Merge branch 'develop' of https://gitlab.verizon.com/BPHV_MIPS/vds_ios into vasavk/carousel

This commit is contained in:
vasavk 2024-06-13 12:10:37 +05:30
commit 8a8bb73da3
5 changed files with 60 additions and 30 deletions

View File

@ -279,7 +279,7 @@ open class DropdownSelect: EntryFieldBase {
open override func updateAccessibility() { open override func updateAccessibility() {
super.updateAccessibility() super.updateAccessibility()
fieldStackView.accessibilityLabel = "Dropdown Select, \(accessibilityLabelText)" 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 fieldStackView.accessibilityValue = value
} }

View File

@ -143,10 +143,7 @@ open class ButtonIcon: Control, Changeable {
/// Sets the size of button icon and icon. /// Sets the size of button icon and icon.
open var size: Size = .large { didSet { setNeedsUpdate() } } 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. /// If provided, the button icon will have a box shadow.
open var floating: Bool = false { didSet { setNeedsUpdate() } } open var floating: Bool = false { didSet { setNeedsUpdate() } }
@ -169,10 +166,20 @@ open class ButtonIcon: Control, Changeable {
setNeedsUpdate() setNeedsUpdate()
} }
} }
/// Used to move the icon inside the button in both x and y axis. /// 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() } } 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 // MARK: - Configuration
//-------------------------------------------------- //--------------------------------------------------
@ -444,8 +451,11 @@ open class ButtonIcon: Control, Changeable {
icon.name = currentIconName icon.name = currentIconName
let color = iconColorConfiguration.getColor(self) let color = iconColorConfiguration.getColor(self)
icon.color = color icon.color = color
icon.size = iconSize if let customIconSize {
icon.customSize = customSize icon.customSize = customIconSize
} else {
icon.size = iconSize
}
icon.isEnabled = isEnabled icon.isEnabled = isEnabled
} else { } else {
icon.reset() icon.reset()
@ -480,8 +490,8 @@ open class ButtonIcon: Control, Changeable {
//updating current container size //updating current container size
var iconLayoutSize = size.containerSize var iconLayoutSize = size.containerSize
if let customSize { if let customContainerSize {
iconLayoutSize = CGFloat(customSize) iconLayoutSize = CGFloat(customContainerSize)
} }
// check to see if this is fitToIcon // check to see if this is fitToIcon
if fitToIcon && kind == .ghost { if fitToIcon && kind == .ghost {
@ -503,10 +513,11 @@ open class ButtonIcon: Control, Changeable {
layer.borderWidth = 0 layer.borderWidth = 0
} }
badgeIndicatorCenterXConstraint?.constant = badgeIndicatorOffset.x + badgeIndicatorDefaultSize.width/2 let offSet = customBadgeIndicatorOffset ?? badgeIndicatorOffset
badgeIndicatorCenterYConstraint?.constant = badgeIndicatorOffset.y + badgeIndicatorDefaultSize.height/2 badgeIndicatorCenterXConstraint?.constant = offSet.x + badgeIndicatorDefaultSize.width/2
badgeIndicatorLeadingConstraint?.constant = badgeIndicatorOffset.x badgeIndicatorCenterYConstraint?.constant = offSet.y + badgeIndicatorDefaultSize.height/2
badgeIndicatorTrailingConstraint?.constant = badgeIndicatorOffset.x + badgeIndicatorDefaultSize.width badgeIndicatorLeadingConstraint?.constant = offSet.x
badgeIndicatorTrailingConstraint?.constant = offSet.x + badgeIndicatorDefaultSize.width
if showBadgeIndicator { if showBadgeIndicator {
updateExpandDirectionalConstraints() updateExpandDirectionalConstraints()

View File

@ -204,7 +204,7 @@ open class Label: UILabel, ViewProtocol, UserInfoable {
}.store(in: &subscribers) }.store(in: &subscribers)
backgroundColor = .clear backgroundColor = .clear
numberOfLines = 0 numberOfLines = 0
lineBreakMode = .byWordWrapping lineBreakMode = .byTruncatingTail
translatesAutoresizingMaskIntoConstraints = false translatesAutoresizingMaskIntoConstraints = false
accessibilityCustomActions = [] accessibilityCustomActions = []
isAccessibilityElement = true isAccessibilityElement = true

View File

@ -216,9 +216,12 @@ extension InputField {
return false return false
} }
// Set the value to the rawNumber, if you don't the onChange will trigger
value = rawNumber
// Set the formatted text // Set the formatted text
textField.text = formattedNumber textField.text = formattedNumber
// Calculate the new cursor position // Calculate the new cursor position
if let newPosition = textField.cursorPosition(range: range, if let newPosition = textField.cursorPosition(range: range,
replacementString: string, replacementString: string,
@ -227,9 +230,6 @@ extension InputField {
textField.selectedTextRange = textField.textRange(from: newPosition, to: newPosition) textField.selectedTextRange = textField.textRange(from: newPosition, to: newPosition)
} }
// if all passes, then set the number1
value = rawNumber
// Prevent the default behavior // Prevent the default behavior
return false return false
} }
@ -252,11 +252,20 @@ extension InputField {
internal func maskCreditCardNumber(_ cardType: CreditCardType, number: String) -> String { internal func maskCreditCardNumber(_ cardType: CreditCardType, number: String) -> String {
// Mask the first 12 characters if the length is 16 // Mask the first 12 characters if the length is 16
let rawNumber = number.filter { $0.isNumber } 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 lastFourDigits = rawNumber.suffix(4)
let maskedSection = String(repeating: "", count: 12) let maskedSection = String(repeating: "", count: number.count - lastFourDigits.count)
let formattedMaskSection = String.format(maskedSection, indices: cardType.separatorIndices(rawNumber.count), with: " ") let formattedMaskSection = String.format(maskedSection + lastFourDigits, indices: cardType.separatorIndices(rawNumber.count), with: " ")
return formattedMaskSection + " " + lastFourDigits return formattedMaskSection
} }
} }
} }

View File

@ -1,19 +1,29 @@
1.0.67
----------------
- CXTDT-553663 - DropdownSelect - Accessibility - has popup
1.0.66 1.0.66
---------------- ----------------
- ONEAPP-6325 - Table - Development finished - 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-544662 - Breadcrumbs - Text Wrapping
- CXTDT-568398 - Calendar - Saturday missing (on smaller screen size devices) - CXTDT-568398 - Calendar - Saturday missing (on smaller screen size devices)
- CXTDT-568402 - Calendar - Extra row (on smaller screen size devices) - CXTDT-568402 - Calendar - Extra row (on smaller screen size devices)
- CXTDT-568409 - Calendar - Width control missing - CXTDT-568409 - Calendar - Width control missing
- CXTDT-568419 - Calendar - When hideContainerBorder=true, corner radius disappears - CXTDT-568419 - Calendar - When hideContainerBorder=true, corner radius disappears
- CXTDT-568413 - Calendar - Missing option for Transparent Background - 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 1.0.65
---------------- ----------------