removed disabled form the code
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
012d6b3daf
commit
29714501cc
@ -44,7 +44,7 @@ open class CheckboxGroup: SelectorGroupBase<CheckboxItem>, SelectorGroupMultiSel
|
|||||||
if let selectorModels {
|
if let selectorModels {
|
||||||
items = selectorModels.enumerated().map { index, model in
|
items = selectorModels.enumerated().map { index, model in
|
||||||
return CheckboxItem().with {
|
return CheckboxItem().with {
|
||||||
$0.isEnabled = !model.disabled
|
$0.isEnabled = model.enabled
|
||||||
$0.surface = model.surface
|
$0.surface = model.surface
|
||||||
$0.inputId = model.inputId
|
$0.inputId = model.inputId
|
||||||
$0.hiddenValue = model.value
|
$0.hiddenValue = model.value
|
||||||
@ -110,8 +110,8 @@ open class CheckboxGroup: SelectorGroupBase<CheckboxItem>, SelectorGroupMultiSel
|
|||||||
extension CheckboxGroup {
|
extension CheckboxGroup {
|
||||||
public struct CheckboxItemModel : Surfaceable, Initable, Errorable {
|
public struct CheckboxItemModel : Surfaceable, Initable, Errorable {
|
||||||
|
|
||||||
/// Whether this object is disabled or not
|
/// Whether this object is enabled or not
|
||||||
public var disabled: Bool
|
public var enabled: Bool
|
||||||
/// Current Surface and this is used to pass down to child objects that implement Surfacable
|
/// Current Surface and this is used to pass down to child objects that implement Surfacable
|
||||||
public var surface: Surface
|
public var surface: Surface
|
||||||
public var inputId: String?
|
public var inputId: String?
|
||||||
@ -128,8 +128,8 @@ extension CheckboxGroup {
|
|||||||
public var showError: Bool
|
public var showError: Bool
|
||||||
public var errorText: String?
|
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) {
|
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.disabled = disabled
|
self.enabled = enabled
|
||||||
self.surface = surface
|
self.surface = surface
|
||||||
self.inputId = inputId
|
self.inputId = inputId
|
||||||
self.value = value
|
self.value = value
|
||||||
@ -144,7 +144,7 @@ extension CheckboxGroup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public init() {
|
public init() {
|
||||||
self.init(disabled: false)
|
self.init(enabled: false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -49,7 +49,7 @@ open class RadioBoxGroup: SelectorGroupBase<RadioBoxItem>, SelectorGroupSingleSe
|
|||||||
$0.subTextAttributes = model.subTextAttributes
|
$0.subTextAttributes = model.subTextAttributes
|
||||||
$0.subTextRight = model.subTextRight
|
$0.subTextRight = model.subTextRight
|
||||||
$0.subTextRightAttributes = model.subTextRightAttributes
|
$0.subTextRightAttributes = model.subTextRightAttributes
|
||||||
$0.isEnabled = !model.disabled
|
$0.isEnabled = model.enabled
|
||||||
$0.inputId = model.inputId
|
$0.inputId = model.inputId
|
||||||
$0.hiddenValue = model.value
|
$0.hiddenValue = model.value
|
||||||
$0.isSelected = model.selected
|
$0.isSelected = model.selected
|
||||||
@ -114,8 +114,8 @@ open class RadioBoxGroup: SelectorGroupBase<RadioBoxItem>, SelectorGroupSingleSe
|
|||||||
|
|
||||||
extension RadioBoxGroup {
|
extension RadioBoxGroup {
|
||||||
public struct RadioBoxItemModel: Surfaceable, Initable, FormFieldable {
|
public struct RadioBoxItemModel: Surfaceable, Initable, FormFieldable {
|
||||||
/// Whether this object is disabled or not
|
/// Whether this object is enabled or not
|
||||||
public var disabled: Bool
|
public var enabled: Bool
|
||||||
/// Current Surface and this is used to pass down to child objects that implement Surfacable
|
/// Current Surface and this is used to pass down to child objects that implement Surfacable
|
||||||
public var surface: Surface
|
public var surface: Surface
|
||||||
public var inputId: String?
|
public var inputId: String?
|
||||||
@ -134,12 +134,12 @@ extension RadioBoxGroup {
|
|||||||
public var strikethrough: Bool = false
|
public var strikethrough: Bool = false
|
||||||
public var strikethroughAccessibileText: String
|
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,
|
text: String = "", textAttributes: [any LabelAttributeModel]? = nil,
|
||||||
subText: String? = nil, subTextAttributes: [any LabelAttributeModel]? = nil,
|
subText: String? = nil, subTextAttributes: [any LabelAttributeModel]? = nil,
|
||||||
subTextRight: String? = nil, subTextRightAttributes: [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") {
|
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.surface = surface
|
||||||
self.inputId = inputId
|
self.inputId = inputId
|
||||||
self.value = value
|
self.value = value
|
||||||
@ -156,7 +156,7 @@ extension RadioBoxGroup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public init() {
|
public init() {
|
||||||
self.init(disabled: false)
|
self.init(enabled: false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,7 +43,7 @@ open class RadioButtonGroup: SelectorGroupBase<RadioButtonItem>, SelectorGroupSi
|
|||||||
if let selectorModels {
|
if let selectorModels {
|
||||||
items = selectorModels.enumerated().map { index, model in
|
items = selectorModels.enumerated().map { index, model in
|
||||||
return RadioButtonItem().with {
|
return RadioButtonItem().with {
|
||||||
$0.isEnabled = !model.disabled
|
$0.isEnabled = model.enabled
|
||||||
$0.surface = model.surface
|
$0.surface = model.surface
|
||||||
$0.inputId = model.inputId
|
$0.inputId = model.inputId
|
||||||
$0.hiddenValue = model.value
|
$0.hiddenValue = model.value
|
||||||
@ -105,8 +105,8 @@ open class RadioButtonGroup: SelectorGroupBase<RadioButtonItem>, SelectorGroupSi
|
|||||||
extension RadioButtonGroup {
|
extension RadioButtonGroup {
|
||||||
public struct RadioButtonItemModel: Surfaceable, Initable, FormFieldable, Errorable {
|
public struct RadioButtonItemModel: Surfaceable, Initable, FormFieldable, Errorable {
|
||||||
|
|
||||||
/// Whether this object is disabled or not
|
/// Whether this object is enabled or not
|
||||||
public var disabled: Bool
|
public var enabled: Bool
|
||||||
/// Current Surface and this is used to pass down to child objects that implement Surfacable
|
/// Current Surface and this is used to pass down to child objects that implement Surfacable
|
||||||
public var surface: Surface
|
public var surface: Surface
|
||||||
public var inputId: String?
|
public var inputId: String?
|
||||||
@ -123,8 +123,8 @@ extension RadioButtonGroup {
|
|||||||
public var showError: Bool
|
public var showError: Bool
|
||||||
public var errorText: String?
|
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) {
|
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.disabled = disabled
|
self.enabled = enabled
|
||||||
self.surface = surface
|
self.surface = surface
|
||||||
self.inputId = inputId
|
self.inputId = inputId
|
||||||
self.value = value
|
self.value = value
|
||||||
@ -139,7 +139,7 @@ extension RadioButtonGroup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public init() {
|
public init() {
|
||||||
self.init(disabled: false)
|
self.init(enabled: false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user