diff --git a/VDS/Components/DropdownSelect/DropdownSelect.swift b/VDS/Components/DropdownSelect/DropdownSelect.swift index e001d130..ae07d616 100644 --- a/VDS/Components/DropdownSelect/DropdownSelect.swift +++ b/VDS/Components/DropdownSelect/DropdownSelect.swift @@ -279,7 +279,7 @@ open class DropdownSelect: EntryFieldBase { open override func updateAccessibility() { super.updateAccessibility() fieldStackView.accessibilityLabel = "Dropdown Select, \(accessibilityLabelText)" - fieldStackView.accessibilityHint = isReadOnly || !isEnabled ? "" : "Double tap to open." + fieldStackView.accessibilityHint = isReadOnly || !isEnabled ? "" : "has popup, Double tap to open." fieldStackView.accessibilityValue = value } diff --git a/VDS/Components/Icon/ButtonIcon/ButtonIcon.swift b/VDS/Components/Icon/ButtonIcon/ButtonIcon.swift index 5ba6a9fe..1b18f4ce 100644 --- a/VDS/Components/Icon/ButtonIcon/ButtonIcon.swift +++ b/VDS/Components/Icon/ButtonIcon/ButtonIcon.swift @@ -143,10 +143,7 @@ open class ButtonIcon: Control, Changeable { /// Sets the size of button icon and icon. open var size: Size = .large { didSet { setNeedsUpdate() } } - - /// Sets the size of button icon and icon. - open var customSize: Int? { didSet { setNeedsUpdate() } } - + /// If provided, the button icon will have a box shadow. open var floating: Bool = false { didSet { setNeedsUpdate() } } @@ -169,10 +166,20 @@ open class ButtonIcon: Control, Changeable { setNeedsUpdate() } } - + /// Used to move the icon inside the button in both x and y axis. open var iconOffset: CGPoint = .init(x: 0, y: 0) { didSet { setNeedsUpdate() } } + + /// Sets a custom size of button icon container. + open var customContainerSize: Int? { didSet { setNeedsUpdate() } } + + /// Sets a custom size of the icon. + open var customIconSize: Int? { didSet { setNeedsUpdate() } } + + /// Sets a custom badgeIndicator offset + open var customBadgeIndicatorOffset: CGPoint? { didSet { setNeedsUpdate() } } + //-------------------------------------------------- // MARK: - Configuration //-------------------------------------------------- @@ -444,8 +451,11 @@ open class ButtonIcon: Control, Changeable { icon.name = currentIconName let color = iconColorConfiguration.getColor(self) icon.color = color - icon.size = iconSize - icon.customSize = customSize + if let customIconSize { + icon.customSize = customIconSize + } else { + icon.size = iconSize + } icon.isEnabled = isEnabled } else { icon.reset() @@ -480,8 +490,8 @@ open class ButtonIcon: Control, Changeable { //updating current container size var iconLayoutSize = size.containerSize - if let customSize { - iconLayoutSize = CGFloat(customSize) + if let customContainerSize { + iconLayoutSize = CGFloat(customContainerSize) } // check to see if this is fitToIcon if fitToIcon && kind == .ghost { @@ -503,10 +513,11 @@ open class ButtonIcon: Control, Changeable { layer.borderWidth = 0 } - badgeIndicatorCenterXConstraint?.constant = badgeIndicatorOffset.x + badgeIndicatorDefaultSize.width/2 - badgeIndicatorCenterYConstraint?.constant = badgeIndicatorOffset.y + badgeIndicatorDefaultSize.height/2 - badgeIndicatorLeadingConstraint?.constant = badgeIndicatorOffset.x - badgeIndicatorTrailingConstraint?.constant = badgeIndicatorOffset.x + badgeIndicatorDefaultSize.width + let offSet = customBadgeIndicatorOffset ?? badgeIndicatorOffset + badgeIndicatorCenterXConstraint?.constant = offSet.x + badgeIndicatorDefaultSize.width/2 + badgeIndicatorCenterYConstraint?.constant = offSet.y + badgeIndicatorDefaultSize.height/2 + badgeIndicatorLeadingConstraint?.constant = offSet.x + badgeIndicatorTrailingConstraint?.constant = offSet.x + badgeIndicatorDefaultSize.width if showBadgeIndicator { updateExpandDirectionalConstraints() diff --git a/VDS/Components/Label/Label.swift b/VDS/Components/Label/Label.swift index 7d14a85f..a374caf5 100644 --- a/VDS/Components/Label/Label.swift +++ b/VDS/Components/Label/Label.swift @@ -204,7 +204,7 @@ open class Label: UILabel, ViewProtocol, UserInfoable { }.store(in: &subscribers) backgroundColor = .clear numberOfLines = 0 - lineBreakMode = .byWordWrapping + lineBreakMode = .byTruncatingTail translatesAutoresizingMaskIntoConstraints = false accessibilityCustomActions = [] isAccessibilityElement = true diff --git a/VDS/Components/TextFields/InputField/FieldTypes/CreditCard.swift b/VDS/Components/TextFields/InputField/FieldTypes/CreditCard.swift index bc3a289a..ed457446 100644 --- a/VDS/Components/TextFields/InputField/FieldTypes/CreditCard.swift +++ b/VDS/Components/TextFields/InputField/FieldTypes/CreditCard.swift @@ -216,9 +216,12 @@ extension InputField { return false } + // Set the value to the rawNumber, if you don't the onChange will trigger + value = rawNumber + // Set the formatted text textField.text = formattedNumber - + // Calculate the new cursor position if let newPosition = textField.cursorPosition(range: range, replacementString: string, @@ -227,9 +230,6 @@ extension InputField { textField.selectedTextRange = textField.textRange(from: newPosition, to: newPosition) } - // if all passes, then set the number1 - value = rawNumber - // Prevent the default behavior return false } @@ -252,11 +252,20 @@ extension InputField { internal func maskCreditCardNumber(_ cardType: CreditCardType, number: String) -> String { // Mask the first 12 characters if the length is 16 let rawNumber = number.filter { $0.isNumber } - guard rawNumber.count == cardType.maxLength else { return formatCreditCardNumber(cardType, number: number) } + let count = rawNumber.count + let min = cardType.minLength + let max = cardType.maxLength + var shouldFormat: Bool = false + if min == max { + shouldFormat = true + } else { + shouldFormat = count >= min && count <= max + } + guard shouldFormat else { return formatCreditCardNumber(cardType, number: number) } let lastFourDigits = rawNumber.suffix(4) - let maskedSection = String(repeating: "•", count: 12) - let formattedMaskSection = String.format(maskedSection, indices: cardType.separatorIndices(rawNumber.count), with: " ") - return formattedMaskSection + " " + lastFourDigits + let maskedSection = String(repeating: "•", count: number.count - lastFourDigits.count) + let formattedMaskSection = String.format(maskedSection + lastFourDigits, indices: cardType.separatorIndices(rawNumber.count), with: " ") + return formattedMaskSection } } } diff --git a/VDS/SupportingFiles/ReleaseNotes.txt b/VDS/SupportingFiles/ReleaseNotes.txt index 615f10df..326146fb 100644 --- a/VDS/SupportingFiles/ReleaseNotes.txt +++ b/VDS/SupportingFiles/ReleaseNotes.txt @@ -1,19 +1,29 @@ +1.0.67 +---------------- +- CXTDT-553663 - DropdownSelect - Accessibility - has popup + 1.0.66 ---------------- - ONEAPP-6325 - Table - Development finished -- CXTDT-565087 - InputField - Text - OnDark colors -- CXTDT-565112 - InputField - Credit Card icons -- CXTDT-565117 - InputField - Overflow not clipped -- CXTDT-565105 - InputField - Date - Typeover text not working -- CXTDT-565115 - InputField - CreditCard - China UnionPay does not allow longer numbers -- CXTDT-560823 – TextArea – Accessibility Labels/Error/ReadyOnly/Disabled -- CXTDT-553663 - DropdownSelect – Accessibility - CXTDT-544662 - Breadcrumbs - Text Wrapping - CXTDT-568398 - Calendar - Saturday missing (on smaller screen size devices) - CXTDT-568402 - Calendar - Extra row (on smaller screen size devices) - CXTDT-568409 - Calendar - Width control missing - CXTDT-568419 - Calendar - When hideContainerBorder=true, corner radius disappears - CXTDT-568413 - Calendar - Missing option for Transparent Background +- CXTDT-553663 - DropdownSelect – Accessibility +- CXTDT-565796 - DropdownSelect – Accessibility +- CXTDT-560458 - DropdownSelect - Accessibility +- CXTDT-565087 - InputField - Text - OnDark colors +- CXTDT-565112 - InputField - Credit Card icons +- CXTDT-565117 - InputField - Overflow not clipped +- CXTDT-565105 - InputField - Date - Typeover text not working +- CXTDT-565106 - InputField - CreditCard - Incorrect generic card icon color +- CXTDT-565115 - InputField - CreditCard - China UnionPay does not allow longer numbers +- CXTDT-560823 – TextArea – Accessibility Labels/Error/ReadyOnly/Disabled +- CXTDT-552060 - TextArea - Placeholder text +- CXTDT-565164 – TileContainer – Voiceover reads extra text “Accessible” +- CXTDT-552834 – TileContainer – Voice over is not rendering the information present within the tile container when it receives focus in clickable state. 1.0.65 ----------------