From 29714501cc157de3fba274154e3cf2bc21a03901 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 21 Aug 2024 16:14:43 -0500 Subject: [PATCH] removed disabled form the code Signed-off-by: Matt Bruce --- VDS/Components/Checkbox/CheckboxGroup.swift | 12 ++++++------ VDS/Components/RadioBox/RadioBoxGroup.swift | 12 ++++++------ VDS/Components/RadioButton/RadioButtonGroup.swift | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/VDS/Components/Checkbox/CheckboxGroup.swift b/VDS/Components/Checkbox/CheckboxGroup.swift index 8268f90f..199d9701 100644 --- a/VDS/Components/Checkbox/CheckboxGroup.swift +++ b/VDS/Components/Checkbox/CheckboxGroup.swift @@ -44,7 +44,7 @@ open class CheckboxGroup: SelectorGroupBase, SelectorGroupMultiSel if let selectorModels { items = selectorModels.enumerated().map { index, model in return CheckboxItem().with { - $0.isEnabled = !model.disabled + $0.isEnabled = model.enabled $0.surface = model.surface $0.inputId = model.inputId $0.hiddenValue = model.value @@ -110,8 +110,8 @@ open class CheckboxGroup: SelectorGroupBase, SelectorGroupMultiSel extension CheckboxGroup { public struct CheckboxItemModel : Surfaceable, Initable, Errorable { - /// Whether this object is disabled or not - public var disabled: Bool + /// Whether this object is enabled or not + public var enabled: Bool /// Current Surface and this is used to pass down to child objects that implement Surfacable public var surface: Surface public var inputId: String? @@ -128,8 +128,8 @@ extension CheckboxGroup { public var showError: Bool public var errorText: String? - public init(disabled: Bool, surface: Surface = .light, inputId: String? = nil, value: AnyHashable? = nil, accessibileText: String? = nil, labelText: String? = nil, labelTextAttributes: [any LabelAttributeModel]? = nil, childText: String? = nil, childTextAttributes: [any LabelAttributeModel]? = nil, selected: Bool = false, showError: Bool = false, errorText: String? = nil) { - self.disabled = disabled + public init(enabled: Bool, surface: Surface = .light, inputId: String? = nil, value: AnyHashable? = nil, accessibileText: String? = nil, labelText: String? = nil, labelTextAttributes: [any LabelAttributeModel]? = nil, childText: String? = nil, childTextAttributes: [any LabelAttributeModel]? = nil, selected: Bool = false, showError: Bool = false, errorText: String? = nil) { + self.enabled = enabled self.surface = surface self.inputId = inputId self.value = value @@ -144,7 +144,7 @@ extension CheckboxGroup { } public init() { - self.init(disabled: false) + self.init(enabled: false) } } diff --git a/VDS/Components/RadioBox/RadioBoxGroup.swift b/VDS/Components/RadioBox/RadioBoxGroup.swift index 000e3433..425a416b 100644 --- a/VDS/Components/RadioBox/RadioBoxGroup.swift +++ b/VDS/Components/RadioBox/RadioBoxGroup.swift @@ -49,7 +49,7 @@ open class RadioBoxGroup: SelectorGroupBase, SelectorGroupSingleSe $0.subTextAttributes = model.subTextAttributes $0.subTextRight = model.subTextRight $0.subTextRightAttributes = model.subTextRightAttributes - $0.isEnabled = !model.disabled + $0.isEnabled = model.enabled $0.inputId = model.inputId $0.hiddenValue = model.value $0.isSelected = model.selected @@ -114,8 +114,8 @@ open class RadioBoxGroup: SelectorGroupBase, SelectorGroupSingleSe extension RadioBoxGroup { public struct RadioBoxItemModel: Surfaceable, Initable, FormFieldable { - /// Whether this object is disabled or not - public var disabled: Bool + /// Whether this object is enabled or not + public var enabled: Bool /// Current Surface and this is used to pass down to child objects that implement Surfacable public var surface: Surface public var inputId: String? @@ -134,12 +134,12 @@ extension RadioBoxGroup { public var strikethrough: Bool = false public var strikethroughAccessibileText: String - public init(disabled: Bool, surface: Surface = .light, inputId: String? = nil, value: String? = nil, + public init(enabled: Bool, surface: Surface = .light, inputId: String? = nil, value: String? = nil, text: String = "", textAttributes: [any LabelAttributeModel]? = nil, subText: String? = nil, subTextAttributes: [any LabelAttributeModel]? = nil, subTextRight: String? = nil, subTextRightAttributes: [any LabelAttributeModel]? = nil, selected: Bool = false, errorText: String? = nil, accessibileText: String? = nil, strikethrough: Bool = false, strikethroughAccessibileText: String = "not available") { - self.disabled = disabled + self.enabled = enabled self.surface = surface self.inputId = inputId self.value = value @@ -156,7 +156,7 @@ extension RadioBoxGroup { } public init() { - self.init(disabled: false) + self.init(enabled: false) } } } diff --git a/VDS/Components/RadioButton/RadioButtonGroup.swift b/VDS/Components/RadioButton/RadioButtonGroup.swift index 5d323997..0cccbe06 100644 --- a/VDS/Components/RadioButton/RadioButtonGroup.swift +++ b/VDS/Components/RadioButton/RadioButtonGroup.swift @@ -43,7 +43,7 @@ open class RadioButtonGroup: SelectorGroupBase, SelectorGroupSi if let selectorModels { items = selectorModels.enumerated().map { index, model in return RadioButtonItem().with { - $0.isEnabled = !model.disabled + $0.isEnabled = model.enabled $0.surface = model.surface $0.inputId = model.inputId $0.hiddenValue = model.value @@ -105,8 +105,8 @@ open class RadioButtonGroup: SelectorGroupBase, SelectorGroupSi extension RadioButtonGroup { public struct RadioButtonItemModel: Surfaceable, Initable, FormFieldable, Errorable { - /// Whether this object is disabled or not - public var disabled: Bool + /// Whether this object is enabled or not + public var enabled: Bool /// Current Surface and this is used to pass down to child objects that implement Surfacable public var surface: Surface public var inputId: String? @@ -123,8 +123,8 @@ extension RadioButtonGroup { public var showError: Bool public var errorText: String? - public init(disabled: Bool, surface: Surface = .light, inputId: String? = nil, value: AnyHashable? = nil, accessibileText: String? = nil, labelText: String? = nil, labelTextAttributes: [any LabelAttributeModel]? = nil, childText: String? = nil, childTextAttributes: [any LabelAttributeModel]? = nil, selected: Bool = false, showError: Bool = false, errorText: String? = nil) { - self.disabled = disabled + public init(enabled: Bool, surface: Surface = .light, inputId: String? = nil, value: AnyHashable? = nil, accessibileText: String? = nil, labelText: String? = nil, labelTextAttributes: [any LabelAttributeModel]? = nil, childText: String? = nil, childTextAttributes: [any LabelAttributeModel]? = nil, selected: Bool = false, showError: Bool = false, errorText: String? = nil) { + self.enabled = enabled self.surface = surface self.inputId = inputId self.value = value @@ -139,7 +139,7 @@ extension RadioButtonGroup { } public init() { - self.init(disabled: false) + self.init(enabled: false) } } }