diff --git a/VDS.xcodeproj/project.pbxproj b/VDS.xcodeproj/project.pbxproj index 3e5d50bc..fc3417d2 100644 --- a/VDS.xcodeproj/project.pbxproj +++ b/VDS.xcodeproj/project.pbxproj @@ -70,7 +70,6 @@ EA33617C288B19210071C351 /* VDSTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA33617B288B19210071C351 /* VDSTests.swift */; }; EA33617D288B19210071C351 /* VDS.h in Headers */ = {isa = PBXBuildFile; fileRef = EA33616F288B19200071C351 /* VDS.h */; settings = {ATTRIBUTES = (Public, ); }; }; EA3361A8288B23300071C351 /* UIColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3361A7288B23300071C351 /* UIColor.swift */; }; - EA3361AA288B25E40071C351 /* Disabling.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3361A9288B25E40071C351 /* Disabling.swift */; }; EA3361AF288B26310071C351 /* FormFieldable.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3361AE288B26310071C351 /* FormFieldable.swift */; }; EA3361B6288B2A410071C351 /* Control.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3361B5288B2A410071C351 /* Control.swift */; }; EA3361B8288B2AAA0071C351 /* ViewProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3361B7288B2AAA0071C351 /* ViewProtocol.swift */; }; @@ -290,7 +289,6 @@ EA336176288B19210071C351 /* VDSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = VDSTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; EA33617B288B19210071C351 /* VDSTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VDSTests.swift; sourceTree = ""; }; EA3361A7288B23300071C351 /* UIColor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIColor.swift; sourceTree = ""; }; - EA3361A9288B25E40071C351 /* Disabling.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Disabling.swift; sourceTree = ""; }; EA3361AE288B26310071C351 /* FormFieldable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormFieldable.swift; sourceTree = ""; }; EA3361B5288B2A410071C351 /* Control.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Control.swift; sourceTree = ""; }; EA3361B7288B2AAA0071C351 /* ViewProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewProtocol.swift; sourceTree = ""; }; @@ -771,7 +769,6 @@ EAF1FE9829D4850E00101452 /* Clickable.swift */, EAA5EEDF28F49DB3003B3210 /* Colorable.swift */, EAACB8972B92706F006A3869 /* DefaultValuing.swift */, - EA3361A9288B25E40071C351 /* Disabling.swift */, 71BFA7092B7F70E6000DCE33 /* DropShadowable.swift */, EAF978202A99035B00C2FEA9 /* Enabling.swift */, EA5E305929510F8B0082B959 /* EnumSubset.swift */, @@ -1406,7 +1403,6 @@ EAB5FF0129424ACB00998C17 /* UIControl.swift in Sources */, EA985BF5296C60C000F2FF2E /* Icon.swift in Sources */, 1842B1E32BECF0A20021AFCA /* CalendarFooterReusableView.swift in Sources */, - EA3361AA288B25E40071C351 /* Disabling.swift in Sources */, EA3361B6288B2A410071C351 /* Control.swift in Sources */, EAC58C122BED0DDD00BA39FA /* Text.swift in Sources */, 5F21D7BF28DCEB3D003E7CD6 /* Useable.swift in Sources */, diff --git a/VDS/Components/Checkbox/CheckboxGroup.swift b/VDS/Components/Checkbox/CheckboxGroup.swift index 8268f90f..f2a62efa 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: true) } } diff --git a/VDS/Components/RadioBox/RadioBoxGroup.swift b/VDS/Components/RadioBox/RadioBoxGroup.swift index 000e3433..3b17d7d8 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: true) } } } diff --git a/VDS/Components/RadioButton/RadioButtonGroup.swift b/VDS/Components/RadioButton/RadioButtonGroup.swift index 5d323997..8bde87de 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: true) } } } diff --git a/VDS/Protocols/Disabling.swift b/VDS/Protocols/Disabling.swift deleted file mode 100644 index 12b938a7..00000000 --- a/VDS/Protocols/Disabling.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// Disabling.swift -// VDS -// -// Created by Matt Bruce on 7/22/22. -// - -import Foundation - -///// Any object that can be disabled, which may change the appearance -//public protocol Disabling { -// /// Whether this object is disabled or not -// var disabled: Bool { get set } -//}