CXTDT-549901 - RadioBox strike through state

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-04-29 09:13:03 -05:00
parent 4935db72d6
commit 42a469aec9
3 changed files with 12 additions and 4 deletions

View File

@ -49,6 +49,8 @@ open class RadioBoxGroup: SelectorGroupBase<RadioBoxItem>, SelectorGroupSingleSe
$0.isEnabled = !model.disabled $0.isEnabled = !model.disabled
$0.inputId = model.inputId $0.inputId = model.inputId
$0.isSelected = model.selected $0.isSelected = model.selected
$0.strikethrough = model.strikethrough
$0.strikethroughAccessibilityText = model.strikethroughAccessibileText
} }
} }
} }
@ -115,12 +117,14 @@ extension RadioBoxGroup {
/// Array of LabelAttributeModel objects used in rendering the subTextRight. /// Array of LabelAttributeModel objects used in rendering the subTextRight.
public var subTextRightAttributes: [any LabelAttributeModel]? public var subTextRightAttributes: [any LabelAttributeModel]?
public var selected: Bool public var selected: Bool
public var strikethrough: Bool = false
public var strikethroughAccessibileText: String
public init(disabled: Bool, surface: Surface = .light, inputId: String? = nil, value: AnyHashable? = nil, public init(disabled: Bool, surface: Surface = .light, inputId: String? = nil, value: AnyHashable? = 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) { selected: Bool = false, errorText: String? = nil, accessibileText: String? = nil, strikethrough: Bool = false, strikethroughAccessibileText: String = "not available") {
self.disabled = disabled self.disabled = disabled
self.surface = surface self.surface = surface
self.inputId = inputId self.inputId = inputId
@ -133,6 +137,8 @@ extension RadioBoxGroup {
self.subTextRightAttributes = subTextRightAttributes self.subTextRightAttributes = subTextRightAttributes
self.selected = selected self.selected = selected
self.accessibileText = accessibileText self.accessibileText = accessibileText
self.strikethrough = strikethrough
self.strikethroughAccessibileText = strikethroughAccessibileText
} }
public init() { public init() {

View File

@ -123,6 +123,8 @@ open class RadioBoxItem: Control, Changeable, FormFieldable {
/// If provided, the radio box will be rendered to show the option with a strikethrough. /// If provided, the radio box will be rendered to show the option with a strikethrough.
open var strikethrough: Bool = false { didSet { setNeedsUpdate() } } open var strikethrough: Bool = false { didSet { setNeedsUpdate() } }
open var strikethroughAccessibilityText: String = "not available" { didSet { setNeedsUpdate() } }
open var inputId: String? { didSet { setNeedsUpdate() } } open var inputId: String? { didSet { setNeedsUpdate() } }
open var value: AnyHashable? { didSet { setNeedsUpdate() } } open var value: AnyHashable? { didSet { setNeedsUpdate() } }
@ -236,9 +238,8 @@ open class RadioBoxItem: Control, Changeable, FormFieldable {
/// Used to update any Accessibility properties. /// Used to update any Accessibility properties.
open override func updateAccessibility() { open override func updateAccessibility() {
super.updateAccessibility() super.updateAccessibility()
if accessibilityLabel == nil { setAccessibilityLabel(for: [textLabel, subTextLabel, subTextRightLabel])
setAccessibilityLabel(for: [textLabel, subTextLabel, subTextRightLabel]) accessibilityValue = strikethrough ? strikethroughAccessibilityText : nil
}
} }
//-------------------------------------------------- //--------------------------------------------------

View File

@ -5,6 +5,7 @@
- CXTDT-547200 - Carousel scrollbar Accessibility - The scrollbar is receiving right/ left swipe focus - CXTDT-547200 - Carousel scrollbar Accessibility - The scrollbar is receiving right/ left swipe focus
- CXTDT-549888 - Pagination - Accessibility - Next/Previous - CXTDT-549888 - Pagination - Accessibility - Next/Previous
- CXTDT-542333 - RadioBox Padding - CXTDT-542333 - RadioBox Padding
- CXTDT-549901 - RadioBox strike through state
1.0.59 1.0.59
---------------- ----------------