converted to use isEnabled
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
883f9fffb4
commit
d8a8caa957
@ -118,10 +118,10 @@ class ButtonGroupViewController: BaseViewController<ButtonGroup> {
|
||||
addFormRow(label: "Percentage (1-100)", view: percentageTextField)
|
||||
|
||||
disabledSwitch.onChange = { [weak self] sender in
|
||||
self?.largeLabel.disabled = sender.isOn
|
||||
self?.smallLabel.disabled = sender.isOn
|
||||
self?.component.disabled = sender.isOn
|
||||
self?.smallButtonGroup.disabled = sender.isOn
|
||||
self?.largeLabel.isEnabled = !sender.isOn
|
||||
self?.smallLabel.isEnabled = !sender.isOn
|
||||
self?.component.isEnabled = !sender.isOn
|
||||
self?.smallButtonGroup.isEnabled = !sender.isOn
|
||||
}
|
||||
|
||||
widthTextField
|
||||
@ -156,7 +156,7 @@ class ButtonGroupViewController: BaseViewController<ButtonGroup> {
|
||||
//setup UI
|
||||
surfacePickerSelectorView.text = component.surface.rawValue
|
||||
buttonPositionSelectorView.text = component.buttonPosition.rawValue
|
||||
disabledSwitch.isOn = component.disabled
|
||||
disabledSwitch.isOn = !component.isEnabled
|
||||
rowQuantitySelectorView.text = RowQuantity(quantity: component.rowQuantity).rawValue
|
||||
widthTextField.text = ""
|
||||
}
|
||||
|
||||
@ -75,7 +75,7 @@ class ButtonIconViewController: BaseViewController<ButtonIcon> {
|
||||
addFormRow(label: "Y Offset", view: centerY)
|
||||
|
||||
disabledSwitch.onChange = { [weak self] sender in
|
||||
self?.component.disabled = sender.isOn
|
||||
self?.component.isEnabled = !sender.isOn
|
||||
}
|
||||
|
||||
component.onClickActionPublisher("ButtonIcon", label: actionLabel)
|
||||
@ -121,7 +121,7 @@ class ButtonIconViewController: BaseViewController<ButtonIcon> {
|
||||
kindPickerSelectorView.text = component.kind.rawValue
|
||||
sizePickerSelectorView.text = component.size.rawValue
|
||||
namePickerSelectorView.text = name.rawValue
|
||||
disabledSwitch.isOn = component.disabled
|
||||
disabledSwitch.isOn = !component.isEnabled
|
||||
}
|
||||
|
||||
func updateOffset() {
|
||||
|
||||
@ -49,7 +49,7 @@ class ButtonViewController: BaseViewController<Button> {
|
||||
|
||||
|
||||
disabledSwitch.onChange = { [weak self] sender in
|
||||
self?.component.disabled = sender.isOn
|
||||
self?.component.isEnabled = !sender.isOn
|
||||
}
|
||||
|
||||
textField
|
||||
@ -73,7 +73,7 @@ class ButtonViewController: BaseViewController<Button> {
|
||||
component.labelPublisher(label)
|
||||
|
||||
surfacePickerSelectorView.text = component.surface.rawValue
|
||||
disabledSwitch.isOn = component.disabled
|
||||
disabledSwitch.isOn = !component.isEnabled
|
||||
textField.text = component.text
|
||||
usePickerSelectorView.text = component.use.rawValue
|
||||
widthTextField.text = ""
|
||||
|
||||
@ -42,7 +42,7 @@ class CheckboxGroupViewController: BaseViewController<CheckboxGroup> {
|
||||
}
|
||||
|
||||
disabledSwitch.onChange = { [weak self] sender in
|
||||
self?.component.disabled = sender.isOn
|
||||
self?.component.isEnabled = !sender.isOn
|
||||
}
|
||||
|
||||
labelTextField
|
||||
@ -96,7 +96,7 @@ class CheckboxGroupViewController: BaseViewController<CheckboxGroup> {
|
||||
|
||||
//setup UI
|
||||
surfacePickerSelectorView.text = component.surface.rawValue
|
||||
disabledSwitch.isOn = component.disabled
|
||||
disabledSwitch.isOn = !component.isEnabled
|
||||
labelTextField.text = checkbox1.labelText
|
||||
childTextField.text = checkbox1.childText
|
||||
showErrorSwitch.isOn = component.showError
|
||||
|
||||
@ -46,7 +46,7 @@ class CheckboxItemViewController: BaseViewController<CheckboxItem> {
|
||||
}
|
||||
|
||||
disabledSwitch.onChange = { [weak self] sender in
|
||||
self?.component.disabled = sender.isOn
|
||||
self?.component.isEnabled = !sender.isOn
|
||||
}
|
||||
|
||||
labelTextField
|
||||
@ -77,7 +77,7 @@ class CheckboxItemViewController: BaseViewController<CheckboxItem> {
|
||||
|
||||
//setup UI
|
||||
surfacePickerSelectorView.text = component.surface.rawValue
|
||||
disabledSwitch.isOn = component.disabled
|
||||
disabledSwitch.isOn = !component.isEnabled
|
||||
labelTextField.text = component.labelText
|
||||
childTextField.text = component.childText
|
||||
showErrorSwitch.isOn = component.showError
|
||||
|
||||
@ -39,7 +39,7 @@ class CheckboxViewController: BaseViewController<Checkbox> {
|
||||
}
|
||||
|
||||
disabledSwitch.onChange = { [weak self] sender in
|
||||
self?.component.disabled = sender.isOn
|
||||
self?.component.isEnabled = !sender.isOn
|
||||
}
|
||||
|
||||
component.onChangeActionPublisher("Checkbox", label: actionLabel)
|
||||
@ -48,7 +48,7 @@ class CheckboxViewController: BaseViewController<Checkbox> {
|
||||
func setupModel() {
|
||||
//setup UI
|
||||
surfacePickerSelectorView.text = component.surface.rawValue
|
||||
disabledSwitch.isOn = component.disabled
|
||||
disabledSwitch.isOn = !component.isEnabled
|
||||
showErrorSwitch.isOn = component.showError
|
||||
|
||||
}
|
||||
|
||||
@ -75,7 +75,7 @@ class InputFieldViewController: BaseViewController<InputField> {
|
||||
}
|
||||
|
||||
disabledSwitch.onChange = { [weak self] sender in
|
||||
self?.component.disabled = sender.isOn
|
||||
self?.component.isEnabled = !sender.isOn
|
||||
}
|
||||
|
||||
labelTextField
|
||||
@ -139,7 +139,7 @@ class InputFieldViewController: BaseViewController<InputField> {
|
||||
//setup UI
|
||||
surfacePickerSelectorView.text = component.surface.rawValue
|
||||
helperTextPlacementPickerSelectorView.text = component.helperTextPlacement.rawValue
|
||||
disabledSwitch.isOn = component.disabled
|
||||
disabledSwitch.isOn = !component.isEnabled
|
||||
requiredSwitch.isOn = component.required
|
||||
labelTextField.text = component.labelText
|
||||
helperTextField.text = component.helperText
|
||||
|
||||
@ -160,7 +160,7 @@ class LabelViewController: BaseViewController<Label> {
|
||||
|
||||
|
||||
disabledSwitch.onChange = { [weak self] sender in
|
||||
self?.component.disabled = sender.isOn
|
||||
self?.component.isEnabled = !sender.isOn
|
||||
}
|
||||
|
||||
boldSwitch
|
||||
@ -267,7 +267,7 @@ class LabelViewController: BaseViewController<Label> {
|
||||
|
||||
//setup UI
|
||||
surfacePickerSelectorView.text = component.surface.rawValue
|
||||
disabledSwitch.isOn = component.disabled
|
||||
disabledSwitch.isOn = !component.isEnabled
|
||||
boldSwitch.isOn = isBold
|
||||
textField.text = component.text
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@ class RadioBoxGroupViewController: BaseViewController<RadioBoxGroup>{
|
||||
addFormRow(label: "Sub Text Right", view: subTextRightField)
|
||||
|
||||
disabledSwitch.onChange = { [weak self] sender in
|
||||
self?.component.disabled = sender.isOn
|
||||
self?.component.isEnabled = !sender.isOn
|
||||
}
|
||||
|
||||
strikeThroughSwitch.onChange = { [weak self] sender in
|
||||
@ -90,7 +90,7 @@ class RadioBoxGroupViewController: BaseViewController<RadioBoxGroup>{
|
||||
|
||||
//set UI values
|
||||
surfacePickerSelectorView.text = component.surface.rawValue
|
||||
disabledSwitch.isOn = component.disabled
|
||||
disabledSwitch.isOn = !component.isEnabled
|
||||
textField.text = radioBox1.text
|
||||
subTextField.text = radioBox1.subText
|
||||
subTextRightField.text = radioBox1.subTextRight
|
||||
|
||||
@ -40,7 +40,7 @@ class RadioButtonGroupViewController: BaseViewController<RadioButtonGroup> {
|
||||
}
|
||||
|
||||
disabledSwitch.onChange = { [weak self] sender in
|
||||
self?.component.disabled = sender.isOn
|
||||
self?.component.isEnabled = !sender.isOn
|
||||
}
|
||||
|
||||
labelTextField
|
||||
@ -86,7 +86,7 @@ class RadioButtonGroupViewController: BaseViewController<RadioButtonGroup> {
|
||||
|
||||
//set UI values
|
||||
surfacePickerSelectorView.text = component.surface.rawValue
|
||||
disabledSwitch.isOn = component.disabled
|
||||
disabledSwitch.isOn = !component.isEnabled
|
||||
showErrorSwitch.isOn = component.showError
|
||||
labelTextField.text = radioButton1.labelText
|
||||
childTextField.text = radioButton1.childText
|
||||
|
||||
@ -46,7 +46,7 @@ class RadioButtonItemViewController: BaseViewController<RadioButtonItem> {
|
||||
}
|
||||
|
||||
disabledSwitch.onChange = { [weak self] sender in
|
||||
self?.component.disabled = sender.isOn
|
||||
self?.component.isEnabled = !sender.isOn
|
||||
}
|
||||
|
||||
labelTextField
|
||||
@ -81,7 +81,7 @@ class RadioButtonItemViewController: BaseViewController<RadioButtonItem> {
|
||||
|
||||
//setup UI
|
||||
surfacePickerSelectorView.text = component.surface.rawValue
|
||||
disabledSwitch.isOn = component.disabled
|
||||
disabledSwitch.isOn = !component.isEnabled
|
||||
labelTextField.text = component.labelText
|
||||
childTextField.text = component.childText
|
||||
showErrorSwitch.isOn = component.showError
|
||||
|
||||
@ -38,7 +38,7 @@ class RadioButtonViewController: BaseViewController<RadioButton> {
|
||||
}
|
||||
|
||||
disabledSwitch.onChange = { [weak self] sender in
|
||||
self?.component.disabled = sender.isOn
|
||||
self?.component.isEnabled = !sender.isOn
|
||||
}
|
||||
|
||||
}
|
||||
@ -52,7 +52,7 @@ class RadioButtonViewController: BaseViewController<RadioButton> {
|
||||
|
||||
//setup UI
|
||||
surfacePickerSelectorView.text = component.surface.rawValue
|
||||
disabledSwitch.isOn = component.disabled
|
||||
disabledSwitch.isOn = !component.isEnabled
|
||||
showErrorSwitch.isOn = component.showError
|
||||
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@ class RadioSwatchGroupViewController: BaseViewController<RadioSwatchGroup> {
|
||||
addFormRow(label: "Strikethrough", view: strikeThroughSwitch)
|
||||
|
||||
disabledSwitch.onChange = { [weak self] sender in
|
||||
self?.component.disabled = sender.isOn
|
||||
self?.component.isEnabled = !sender.isOn
|
||||
}
|
||||
|
||||
strikeThroughSwitch.onChange = { [weak self] sender in
|
||||
@ -91,7 +91,7 @@ class RadioSwatchGroupViewController: BaseViewController<RadioSwatchGroup> {
|
||||
|
||||
//set UI values
|
||||
surfacePickerSelectorView.text = component.surface.rawValue
|
||||
disabledSwitch.isOn = component.disabled
|
||||
disabledSwitch.isOn = !component.isEnabled
|
||||
}
|
||||
|
||||
//Picker
|
||||
|
||||
@ -80,7 +80,7 @@ class TabsContainerViewController: BaseViewController<TabsContainer> {
|
||||
append(section: horizontalOrientationFormStackView)
|
||||
|
||||
disabledSwitch.onChange = { [weak self] sender in
|
||||
self?.component.disabled = sender.isOn
|
||||
self?.component.isEnabled = !sender.isOn
|
||||
}
|
||||
|
||||
borderlineSwitch.onChange = { [weak self] sender in
|
||||
@ -144,7 +144,7 @@ class TabsContainerViewController: BaseViewController<TabsContainer> {
|
||||
orientationPickerSelectorView.text = component.orientation.rawValue
|
||||
indicatorPositionPickerSelectorView.text = component.indicatorPosition.rawValue
|
||||
overflowPickerSelectorView.text = component.overflow.rawValue
|
||||
disabledSwitch.isOn = component.disabled
|
||||
disabledSwitch.isOn = !component.isEnabled
|
||||
borderlineSwitch.isOn = component.borderLine
|
||||
fillContainerSwitch.isOn = component.fillContainer
|
||||
sampleSwitch.isOn = true
|
||||
|
||||
@ -71,7 +71,7 @@ class TabsViewController: BaseViewController<Tabs> {
|
||||
append(section: horizontalOrientationFormStackView)
|
||||
|
||||
disabledSwitch.onChange = { [weak self] sender in
|
||||
self?.component.disabled = sender.isOn
|
||||
self?.component.isEnabled = !sender.isOn
|
||||
}
|
||||
|
||||
borderlineSwitch.onChange = { [weak self] sender in
|
||||
@ -112,7 +112,7 @@ class TabsViewController: BaseViewController<Tabs> {
|
||||
orientationPickerSelectorView.text = component.orientation.rawValue
|
||||
indicatorPositionPickerSelectorView.text = component.indicatorPosition.rawValue
|
||||
//overflowPickerSelectorView.text = component.overflow.rawValue
|
||||
disabledSwitch.isOn = component.disabled
|
||||
disabledSwitch.isOn = !component.isEnabled
|
||||
borderlineSwitch.isOn = component.borderLine
|
||||
fillContainerSwitch.isOn = component.fillContainer
|
||||
sampleSwitch.isOn = true
|
||||
|
||||
@ -58,7 +58,7 @@ class TextAreaViewController: BaseViewController<TextArea> {
|
||||
}
|
||||
|
||||
disabledSwitch.onChange = { [weak self] sender in
|
||||
self?.component.disabled = sender.isOn
|
||||
self?.component.isEnabled = !sender.isOn
|
||||
}
|
||||
|
||||
labelTextField
|
||||
@ -120,7 +120,7 @@ class TextAreaViewController: BaseViewController<TextArea> {
|
||||
|
||||
//setup UI
|
||||
surfacePickerSelectorView.text = component.surface.rawValue
|
||||
disabledSwitch.isOn = component.disabled
|
||||
disabledSwitch.isOn = !component.isEnabled
|
||||
requiredSwitch.isOn = component.required
|
||||
labelTextField.text = component.labelText
|
||||
helperTextField.text = component.helperText
|
||||
|
||||
@ -39,7 +39,7 @@ class TextLinkCaretViewController: BaseViewController<TextLinkCaret> {
|
||||
addFormRow(label: "Caret Position", view: caretPositionPickerSelectorView)
|
||||
|
||||
disabledSwitch.onChange = { [weak self] sender in
|
||||
self?.component.disabled = sender.isOn
|
||||
self?.component.isEnabled = !sender.isOn
|
||||
}
|
||||
|
||||
textField
|
||||
@ -55,7 +55,7 @@ class TextLinkCaretViewController: BaseViewController<TextLinkCaret> {
|
||||
|
||||
//setup UI
|
||||
surfacePickerSelectorView.text = component.surface.rawValue
|
||||
disabledSwitch.isOn = component.disabled
|
||||
disabledSwitch.isOn = !component.isEnabled
|
||||
textField.text = component.text
|
||||
caretPositionPickerSelectorView.text = component.iconPosition.rawValue
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ class TextLinkViewController: BaseViewController<TextLink> {
|
||||
addFormRow(label: "Size", view: buttonSizePickerSelectorView)
|
||||
|
||||
disabledSwitch.onChange = { [weak self] sender in
|
||||
self?.component.disabled = sender.isOn
|
||||
self?.component.isEnabled = !sender.isOn
|
||||
}
|
||||
|
||||
textField
|
||||
@ -57,7 +57,7 @@ class TextLinkViewController: BaseViewController<TextLink> {
|
||||
|
||||
//setup UI
|
||||
surfacePickerSelectorView.text = component.surface.rawValue
|
||||
disabledSwitch.isOn = component.disabled
|
||||
disabledSwitch.isOn = !component.isEnabled
|
||||
textField.text = component.text
|
||||
buttonSizePickerSelectorView.text = ButtonSize.large.rawValue
|
||||
}
|
||||
|
||||
@ -68,7 +68,7 @@ class ToggleViewController: BaseViewController<Toggle> {
|
||||
}
|
||||
|
||||
disabledSwitch.onChange = { [weak self] sender in
|
||||
self?.component.disabled = sender.isOn
|
||||
self?.component.isEnabled = !sender.isOn
|
||||
}
|
||||
|
||||
boldSwitch.onChange = { [weak self] sender in
|
||||
|
||||
@ -49,7 +49,7 @@ class TooltipViewController: BaseViewController<Tooltip> {
|
||||
addFormRow(label: "Close Button Text", view: closeButtonTextField)
|
||||
|
||||
disabledSwitch.onChange = { [weak self] sender in
|
||||
self?.component.disabled = sender.isOn
|
||||
self?.component.isEnabled = !sender.isOn
|
||||
}
|
||||
|
||||
titleTextField
|
||||
@ -78,7 +78,7 @@ class TooltipViewController: BaseViewController<Tooltip> {
|
||||
|
||||
//setup UI
|
||||
surfacePickerSelectorView.text = component.surface.rawValue
|
||||
disabledSwitch.isOn = component.disabled
|
||||
disabledSwitch.isOn = !component.isEnabled
|
||||
titleTextField.text = component.title
|
||||
contentTextField.text = component.content
|
||||
closeButtonTextField.text = component.closeButtonText
|
||||
|
||||
@ -60,7 +60,7 @@ class TrailingTooltipLabelViewController: BaseViewController<TrailingTooltipLabe
|
||||
addFormRow(label: "Tooltip Close Button Text", view: closeButtonTextField)
|
||||
|
||||
disabledSwitch.onChange = { [weak self] sender in
|
||||
self?.component.disabled = sender.isOn
|
||||
self?.component.isEnabled = !sender.isOn
|
||||
}
|
||||
|
||||
boldSwitch
|
||||
@ -103,7 +103,7 @@ class TrailingTooltipLabelViewController: BaseViewController<TrailingTooltipLabe
|
||||
|
||||
//setup UI
|
||||
surfacePickerSelectorView.text = component.surface.rawValue
|
||||
disabledSwitch.isOn = component.disabled
|
||||
disabledSwitch.isOn = !component.isEnabled
|
||||
boldSwitch.isOn = isBold
|
||||
textField.text = component.labelText
|
||||
|
||||
@ -113,7 +113,7 @@ class TrailingTooltipLabelViewController: BaseViewController<TrailingTooltipLabe
|
||||
|
||||
//setup UI
|
||||
surfacePickerSelectorView.text = component.surface.rawValue
|
||||
disabledSwitch.isOn = component.disabled
|
||||
disabledSwitch.isOn = !component.isEnabled
|
||||
titleTextField.text = component.tooltipTitle
|
||||
contentTextField.text = component.tooltipContent
|
||||
closeButtonTextField.text = component.tooltipCloseButtonText
|
||||
|
||||
Loading…
Reference in New Issue
Block a user