From 42a469aec95182b9d42adc5a52f513c9016d301e Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Mon, 29 Apr 2024 09:13:03 -0500 Subject: [PATCH] CXTDT-549901 - RadioBox strike through state Signed-off-by: Matt Bruce --- VDS/Components/RadioBox/RadioBoxGroup.swift | 8 +++++++- VDS/Components/RadioBox/RadioBoxItem.swift | 7 ++++--- VDS/SupportingFiles/ReleaseNotes.txt | 1 + 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/VDS/Components/RadioBox/RadioBoxGroup.swift b/VDS/Components/RadioBox/RadioBoxGroup.swift index b31bcb0e..18d3c26b 100644 --- a/VDS/Components/RadioBox/RadioBoxGroup.swift +++ b/VDS/Components/RadioBox/RadioBoxGroup.swift @@ -49,6 +49,8 @@ open class RadioBoxGroup: SelectorGroupBase, SelectorGroupSingleSe $0.isEnabled = !model.disabled $0.inputId = model.inputId $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. public var subTextRightAttributes: [any LabelAttributeModel]? 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, 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) { + selected: Bool = false, errorText: String? = nil, accessibileText: String? = nil, strikethrough: Bool = false, strikethroughAccessibileText: String = "not available") { self.disabled = disabled self.surface = surface self.inputId = inputId @@ -133,6 +137,8 @@ extension RadioBoxGroup { self.subTextRightAttributes = subTextRightAttributes self.selected = selected self.accessibileText = accessibileText + self.strikethrough = strikethrough + self.strikethroughAccessibileText = strikethroughAccessibileText } public init() { diff --git a/VDS/Components/RadioBox/RadioBoxItem.swift b/VDS/Components/RadioBox/RadioBoxItem.swift index d81b68ea..23dd2b41 100644 --- a/VDS/Components/RadioBox/RadioBoxItem.swift +++ b/VDS/Components/RadioBox/RadioBoxItem.swift @@ -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. open var strikethrough: Bool = false { didSet { setNeedsUpdate() } } + open var strikethroughAccessibilityText: String = "not available" { didSet { setNeedsUpdate() } } + open var inputId: String? { didSet { setNeedsUpdate() } } open var value: AnyHashable? { didSet { setNeedsUpdate() } } @@ -236,9 +238,8 @@ open class RadioBoxItem: Control, Changeable, FormFieldable { /// Used to update any Accessibility properties. open override func updateAccessibility() { super.updateAccessibility() - if accessibilityLabel == nil { - setAccessibilityLabel(for: [textLabel, subTextLabel, subTextRightLabel]) - } + setAccessibilityLabel(for: [textLabel, subTextLabel, subTextRightLabel]) + accessibilityValue = strikethrough ? strikethroughAccessibilityText : nil } //-------------------------------------------------- diff --git a/VDS/SupportingFiles/ReleaseNotes.txt b/VDS/SupportingFiles/ReleaseNotes.txt index 7989a4fe..70fd4153 100644 --- a/VDS/SupportingFiles/ReleaseNotes.txt +++ b/VDS/SupportingFiles/ReleaseNotes.txt @@ -5,6 +5,7 @@ - CXTDT-547200 - Carousel scrollbar – Accessibility - The scrollbar is receiving right/ left swipe focus - CXTDT-549888 - Pagination - Accessibility - Next/Previous - CXTDT-542333 - RadioBox Padding +- CXTDT-549901 - RadioBox strike through state 1.0.59 ----------------