Merge branch 'develop' of https://gitlab.verizon.com/BPHV_MIPS/vds_ios into vasavk/carousel
This commit is contained in:
commit
a38268df0a
@ -1561,7 +1561,7 @@
|
|||||||
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
|
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
|
||||||
CODE_SIGN_IDENTITY = "";
|
CODE_SIGN_IDENTITY = "";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 68;
|
CURRENT_PROJECT_VERSION = 70;
|
||||||
DEFINES_MODULE = YES;
|
DEFINES_MODULE = YES;
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = "";
|
||||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||||
@ -1599,7 +1599,7 @@
|
|||||||
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
|
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
|
||||||
CODE_SIGN_IDENTITY = "";
|
CODE_SIGN_IDENTITY = "";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 68;
|
CURRENT_PROJECT_VERSION = 70;
|
||||||
DEFINES_MODULE = YES;
|
DEFINES_MODULE = YES;
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = "";
|
||||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||||
|
|||||||
@ -214,7 +214,7 @@ extension DatePicker {
|
|||||||
calendar.indicators = calendarModel.indicators
|
calendar.indicators = calendarModel.indicators
|
||||||
calendar.maxDate = calendarModel.maxDate
|
calendar.maxDate = calendarModel.maxDate
|
||||||
calendar.minDate = calendarModel.minDate
|
calendar.minDate = calendarModel.minDate
|
||||||
calendar.surface = calendarModel.surface
|
calendar.surface = surface
|
||||||
calendar.setNeedsLayout()
|
calendar.setNeedsLayout()
|
||||||
calendar.layoutIfNeeded()
|
calendar.layoutIfNeeded()
|
||||||
|
|
||||||
@ -223,7 +223,7 @@ extension DatePicker {
|
|||||||
|
|
||||||
//find scrollView
|
//find scrollView
|
||||||
if scrollView == nil {
|
if scrollView == nil {
|
||||||
scrollView = findScrollView(from: containerView)
|
scrollView = containerView.findSuperview(ofType: UIScrollView.self)
|
||||||
scrollViewContentSize = scrollView?.contentSize
|
scrollViewContentSize = scrollView?.contentSize
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -348,17 +348,6 @@ extension DatePicker {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private func findScrollView(from view: UIView) -> UIScrollView? {
|
|
||||||
var currentView = view
|
|
||||||
while let superview = currentView.superview {
|
|
||||||
if let scrollView = superview as? UIScrollView {
|
|
||||||
return scrollView
|
|
||||||
}
|
|
||||||
currentView = superview
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
private func calculatePopoverPosition(relativeTo sourceView: UIView, in parentView: UIView, size: CGSize, with spacing: CGFloat) -> CGPoint? {
|
private func calculatePopoverPosition(relativeTo sourceView: UIView, in parentView: UIView, size: CGSize, with spacing: CGFloat) -> CGPoint? {
|
||||||
let sourceFrameInParent = sourceView.convert(sourceView.bounds, to: parentView)
|
let sourceFrameInParent = sourceView.convert(sourceView.bounds, to: parentView)
|
||||||
let parentBounds = parentView.bounds
|
let parentBounds = parentView.bounds
|
||||||
@ -442,3 +431,16 @@ extension DatePicker {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension UIView {
|
||||||
|
public func findSuperview<T: UIView>(ofType type: T.Type) -> T? {
|
||||||
|
var currentView: UIView? = self
|
||||||
|
while let view = currentView {
|
||||||
|
if let superview = view.superview as? T {
|
||||||
|
return superview
|
||||||
|
}
|
||||||
|
currentView = view.superview
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -10,8 +10,6 @@ import UIKit
|
|||||||
|
|
||||||
extension DatePicker {
|
extension DatePicker {
|
||||||
public struct CalendarModel {
|
public struct CalendarModel {
|
||||||
public let surface: Surface
|
|
||||||
|
|
||||||
/// If set to true, the calendar will not have a border.
|
/// If set to true, the calendar will not have a border.
|
||||||
public let hideContainerBorder: Bool
|
public let hideContainerBorder: Bool
|
||||||
|
|
||||||
@ -35,15 +33,13 @@ extension DatePicker {
|
|||||||
/// Array of ``CalendarIndicatorModel`` you are wanting to show on legend.
|
/// Array of ``CalendarIndicatorModel`` you are wanting to show on legend.
|
||||||
public let indicators: [CalendarBase.CalendarIndicatorModel]
|
public let indicators: [CalendarBase.CalendarIndicatorModel]
|
||||||
|
|
||||||
public init(surface: Surface = .light,
|
public init(hideContainerBorder: Bool = false,
|
||||||
hideContainerBorder: Bool = false,
|
|
||||||
hideCurrentDateIndicator: Bool = false,
|
hideCurrentDateIndicator: Bool = false,
|
||||||
activeDates: [Date] = [],
|
activeDates: [Date] = [],
|
||||||
inactiveDates: [Date] = [],
|
inactiveDates: [Date] = [],
|
||||||
minDate: Date = Date().startOfMonth,
|
minDate: Date = Date().startOfMonth,
|
||||||
maxDate: Date = Date().endOfMonth,
|
maxDate: Date = Date().endOfMonth,
|
||||||
indicators: [CalendarBase.CalendarIndicatorModel] = []) {
|
indicators: [CalendarBase.CalendarIndicatorModel] = []) {
|
||||||
self.surface = surface
|
|
||||||
self.hideContainerBorder = hideContainerBorder
|
self.hideContainerBorder = hideContainerBorder
|
||||||
self.hideCurrentDateIndicator = hideCurrentDateIndicator
|
self.hideCurrentDateIndicator = hideCurrentDateIndicator
|
||||||
self.activeDates = activeDates
|
self.activeDates = activeDates
|
||||||
|
|||||||
@ -93,12 +93,15 @@ open class Icon: View {
|
|||||||
backgroundColor = .clear
|
backgroundColor = .clear
|
||||||
|
|
||||||
isAccessibilityElement = true
|
isAccessibilityElement = true
|
||||||
accessibilityTraits = .image
|
accessibilityTraits = .none
|
||||||
|
accessibilityHint = "image"
|
||||||
|
|
||||||
bridge_accessibilityLabelBlock = { [weak self] in
|
bridge_accessibilityLabelBlock = { [weak self] in
|
||||||
guard let self else { return "" }
|
guard let self else { return "" }
|
||||||
return name?.rawValue ?? "icon"
|
return name?.rawValue ?? "icon"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -214,7 +214,7 @@ open class RadioBoxItem: Control, Changeable, FormFieldable, Groupable {
|
|||||||
selectorView.isAccessibilityElement = true
|
selectorView.isAccessibilityElement = true
|
||||||
selectorView.accessibilityTraits = .button
|
selectorView.accessibilityTraits = .button
|
||||||
addSubview(selectorView)
|
addSubview(selectorView)
|
||||||
selectorView.isUserInteractionEnabled = true
|
selectorView.isUserInteractionEnabled = false
|
||||||
|
|
||||||
selectorView.addSubview(selectorStackView)
|
selectorView.addSubview(selectorStackView)
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,7 @@ open class EntryFieldBase: Control, Changeable, FormFieldInternalValidatable {
|
|||||||
public required init?(coder: NSCoder) {
|
public required init?(coder: NSCoder) {
|
||||||
super.init(coder: coder)
|
super.init(coder: coder)
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Enums
|
// MARK: - Enums
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -92,12 +92,6 @@ open class EntryFieldBase: Control, Changeable, FormFieldInternalValidatable {
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
/// This is the view that will be wrapped with the border for userInteraction.
|
|
||||||
/// The only subview of this view is the fieldStackView
|
|
||||||
internal var containerView = View().with {
|
|
||||||
$0.isAccessibilityElement = true
|
|
||||||
}
|
|
||||||
|
|
||||||
/// This is set by a local method.
|
/// This is set by a local method.
|
||||||
internal var bottomContainerView: UIView!
|
internal var bottomContainerView: UIView!
|
||||||
|
|
||||||
@ -115,7 +109,7 @@ open class EntryFieldBase: Control, Changeable, FormFieldInternalValidatable {
|
|||||||
internal var widthConstraint: NSLayoutConstraint?
|
internal var widthConstraint: NSLayoutConstraint?
|
||||||
internal var trailingEqualsConstraint: NSLayoutConstraint?
|
internal var trailingEqualsConstraint: NSLayoutConstraint?
|
||||||
internal var trailingLessThanEqualsConstraint: NSLayoutConstraint?
|
internal var trailingLessThanEqualsConstraint: NSLayoutConstraint?
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Configuration Properties
|
// MARK: - Configuration Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -133,14 +127,14 @@ open class EntryFieldBase: Control, Changeable, FormFieldInternalValidatable {
|
|||||||
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forDisabled: true)
|
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forDisabled: true)
|
||||||
$0.setSurfaceColors(VDSColor.elementsSecondaryOnlight, VDSColor.elementsSecondaryOndark, forDisabled: false)
|
$0.setSurfaceColors(VDSColor.elementsSecondaryOnlight, VDSColor.elementsSecondaryOndark, forDisabled: false)
|
||||||
}
|
}
|
||||||
|
|
||||||
internal var backgroundColorConfiguration = ControlColorConfiguration().with {
|
internal var backgroundColorConfiguration = ControlColorConfiguration().with {
|
||||||
$0.setSurfaceColors(VDSFormControlsColor.backgroundOnlight, VDSFormControlsColor.backgroundOndark, forState: .normal)
|
$0.setSurfaceColors(VDSFormControlsColor.backgroundOnlight, VDSFormControlsColor.backgroundOndark, forState: .normal)
|
||||||
$0.setSurfaceColors(VDSFormControlsColor.backgroundOnlight, VDSFormControlsColor.backgroundOndark, forState: .disabled)
|
$0.setSurfaceColors(VDSFormControlsColor.backgroundOnlight, VDSFormControlsColor.backgroundOndark, forState: .disabled)
|
||||||
$0.setSurfaceColors(VDSColor.feedbackErrorBackgroundOnlight, VDSColor.feedbackErrorBackgroundOndark, forState: .error)
|
$0.setSurfaceColors(VDSColor.feedbackErrorBackgroundOnlight, VDSColor.feedbackErrorBackgroundOndark, forState: .error)
|
||||||
$0.setSurfaceColors(VDSColor.feedbackErrorBackgroundOnlight, VDSColor.feedbackErrorBackgroundOndark, forState: [.error, .focused])
|
$0.setSurfaceColors(VDSColor.feedbackErrorBackgroundOnlight, VDSColor.feedbackErrorBackgroundOndark, forState: [.error, .focused])
|
||||||
}
|
}
|
||||||
|
|
||||||
internal var borderColorConfiguration = ControlColorConfiguration().with {
|
internal var borderColorConfiguration = ControlColorConfiguration().with {
|
||||||
$0.setSurfaceColors(VDSFormControlsColor.borderOnlight, VDSFormControlsColor.borderOndark, forState: .normal)
|
$0.setSurfaceColors(VDSFormControlsColor.borderOnlight, VDSFormControlsColor.borderOndark, forState: .normal)
|
||||||
$0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOnlight, forState: .focused)
|
$0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOnlight, forState: .focused)
|
||||||
@ -155,7 +149,7 @@ open class EntryFieldBase: Control, Changeable, FormFieldInternalValidatable {
|
|||||||
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forState: .disabled)
|
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forState: .disabled)
|
||||||
$0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forState: .error)
|
$0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forState: .error)
|
||||||
}
|
}
|
||||||
|
|
||||||
internal var readOnlyBorderColorConfiguration = ControlColorConfiguration().with {
|
internal var readOnlyBorderColorConfiguration = ControlColorConfiguration().with {
|
||||||
$0.setSurfaceColors(VDSFormControlsColor.borderReadonlyOnlight, VDSFormControlsColor.borderReadonlyOndark, forState: .normal)
|
$0.setSurfaceColors(VDSFormControlsColor.borderReadonlyOnlight, VDSFormControlsColor.borderReadonlyOndark, forState: .normal)
|
||||||
}
|
}
|
||||||
@ -163,8 +157,14 @@ open class EntryFieldBase: Control, Changeable, FormFieldInternalValidatable {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Public Properties
|
// MARK: - Public Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
open var onChangeSubscriber: AnyCancellable?
|
/// This is the view that will be wrapped with the border for userInteraction.
|
||||||
|
/// The only subview of this view is the fieldStackView
|
||||||
|
open var containerView = View().with {
|
||||||
|
$0.isAccessibilityElement = true
|
||||||
|
}
|
||||||
|
|
||||||
|
open var onChangeSubscriber: AnyCancellable?
|
||||||
|
|
||||||
open var titleLabel = Label().with {
|
open var titleLabel = Label().with {
|
||||||
$0.setContentCompressionResistancePriority(.required, for: .vertical)
|
$0.setContentCompressionResistancePriority(.required, for: .vertical)
|
||||||
$0.textStyle = .bodySmall
|
$0.textStyle = .bodySmall
|
||||||
@ -185,7 +185,9 @@ open class EntryFieldBase: Control, Changeable, FormFieldInternalValidatable {
|
|||||||
$0.size = .medium
|
$0.size = .medium
|
||||||
$0.isAccessibilityElement = true
|
$0.isAccessibilityElement = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
open var useRequiredRule: Bool = true { didSet { setNeedsUpdate() } }
|
||||||
|
|
||||||
open var labelText: String? { didSet { setNeedsUpdate() } }
|
open var labelText: String? { didSet { setNeedsUpdate() } }
|
||||||
|
|
||||||
open var helperText: String? { didSet { setNeedsUpdate() } }
|
open var helperText: String? { didSet { setNeedsUpdate() } }
|
||||||
@ -195,7 +197,7 @@ open class EntryFieldBase: Control, Changeable, FormFieldInternalValidatable {
|
|||||||
|
|
||||||
/// FormFieldValidator
|
/// FormFieldValidator
|
||||||
open var validator: (any FormFieldValidatorable)?
|
open var validator: (any FormFieldValidatorable)?
|
||||||
|
|
||||||
/// Override UIControl state to add the .error state if showError is true.
|
/// Override UIControl state to add the .error state if showError is true.
|
||||||
open override var state: UIControl.State {
|
open override var state: UIControl.State {
|
||||||
get {
|
get {
|
||||||
@ -214,17 +216,17 @@ open class EntryFieldBase: Control, Changeable, FormFieldInternalValidatable {
|
|||||||
return state
|
return state
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open var errorText: String? { didSet { setNeedsUpdate() } }
|
open var errorText: String? { didSet { setNeedsUpdate() } }
|
||||||
|
|
||||||
open var tooltipModel: Tooltip.TooltipModel? { didSet { setNeedsUpdate() } }
|
open var tooltipModel: Tooltip.TooltipModel? { didSet { setNeedsUpdate() } }
|
||||||
|
|
||||||
open var transparentBackground: Bool = false { didSet { setNeedsUpdate() } }
|
open var transparentBackground: Bool = false { didSet { setNeedsUpdate() } }
|
||||||
|
|
||||||
open var width: CGFloat? { didSet { setNeedsUpdate() } }
|
open var width: CGFloat? { didSet { setNeedsUpdate() } }
|
||||||
|
|
||||||
open var inputId: String? { didSet { setNeedsUpdate() } }
|
open var inputId: String? { didSet { setNeedsUpdate() } }
|
||||||
|
|
||||||
/// The text of this textField.
|
/// The text of this textField.
|
||||||
open var value: String? {
|
open var value: String? {
|
||||||
get { fatalError("must be read from subclass")}
|
get { fatalError("must be read from subclass")}
|
||||||
@ -235,21 +237,21 @@ open class EntryFieldBase: Control, Changeable, FormFieldInternalValidatable {
|
|||||||
open var isRequired: Bool = false { didSet { setNeedsUpdate() } }
|
open var isRequired: Bool = false { didSet { setNeedsUpdate() } }
|
||||||
|
|
||||||
open var isReadOnly: Bool = false { didSet { setNeedsUpdate() } }
|
open var isReadOnly: Bool = false { didSet { setNeedsUpdate() } }
|
||||||
|
|
||||||
open var helperTextPlacement: HelperTextPlacement = .bottom {
|
open var helperTextPlacement: HelperTextPlacement = .bottom {
|
||||||
didSet {
|
didSet {
|
||||||
updateHelperTextPosition()
|
updateHelperTextPosition()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open var rules = [AnyRule<String>]()
|
open var rules = [AnyRule<String>]()
|
||||||
|
|
||||||
open var accessibilityHintText: String = "Double tap to open"
|
open var accessibilityHintText: String = "Double tap to open"
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Overrides
|
// MARK: - Overrides
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
/// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations.
|
/// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations.
|
||||||
open override func setup() {
|
open override func setup() {
|
||||||
super.setup()
|
super.setup()
|
||||||
@ -371,7 +373,7 @@ open class EntryFieldBase: Control, Changeable, FormFieldInternalValidatable {
|
|||||||
titleLabel.textStyle = .bodySmall
|
titleLabel.textStyle = .bodySmall
|
||||||
errorLabel.textStyle = .bodySmall
|
errorLabel.textStyle = .bodySmall
|
||||||
helperLabel.textStyle = .bodySmall
|
helperLabel.textStyle = .bodySmall
|
||||||
|
|
||||||
labelText = nil
|
labelText = nil
|
||||||
helperText = nil
|
helperText = nil
|
||||||
showError = false
|
showError = false
|
||||||
@ -389,19 +391,19 @@ open class EntryFieldBase: Control, Changeable, FormFieldInternalValidatable {
|
|||||||
open override var canBecomeFirstResponder: Bool {
|
open override var canBecomeFirstResponder: Bool {
|
||||||
responder?.canBecomeFirstResponder ?? super.canBecomeFirstResponder
|
responder?.canBecomeFirstResponder ?? super.canBecomeFirstResponder
|
||||||
}
|
}
|
||||||
|
|
||||||
open override func becomeFirstResponder() -> Bool {
|
open override func becomeFirstResponder() -> Bool {
|
||||||
responder?.becomeFirstResponder() ?? super.becomeFirstResponder()
|
responder?.becomeFirstResponder() ?? super.becomeFirstResponder()
|
||||||
}
|
}
|
||||||
|
|
||||||
open override var canResignFirstResponder: Bool {
|
open override var canResignFirstResponder: Bool {
|
||||||
responder?.canResignFirstResponder ?? super.canResignFirstResponder
|
responder?.canResignFirstResponder ?? super.canResignFirstResponder
|
||||||
}
|
}
|
||||||
|
|
||||||
open override func resignFirstResponder() -> Bool {
|
open override func resignFirstResponder() -> Bool {
|
||||||
responder?.resignFirstResponder() ?? super.resignFirstResponder()
|
responder?.resignFirstResponder() ?? super.resignFirstResponder()
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Public Methods
|
// MARK: - Public Methods
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -409,21 +411,21 @@ open class EntryFieldBase: Control, Changeable, FormFieldInternalValidatable {
|
|||||||
open func getFieldContainer() -> UIView {
|
open func getFieldContainer() -> UIView {
|
||||||
fatalError("Subclass must return the view that contains the field/view the user will interact with.")
|
fatalError("Subclass must return the view that contains the field/view the user will interact with.")
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Container for the area in which helper or error text presents.
|
/// Container for the area in which helper or error text presents.
|
||||||
open func getBottomContainer() -> UIView {
|
open func getBottomContainer() -> UIView {
|
||||||
return bottomContainerStackView
|
return bottomContainerStackView
|
||||||
}
|
}
|
||||||
|
|
||||||
open func validate(){
|
open func validate(){
|
||||||
updateRules()
|
updateRules()
|
||||||
validator = FormFieldValidator<EntryFieldBase>(field: self, rules: rules)
|
validator = FormFieldValidator<EntryFieldBase>(field: self, rules: rules)
|
||||||
validator?.validate()
|
validator?.validate()
|
||||||
setNeedsUpdate()
|
setNeedsUpdate()
|
||||||
}
|
}
|
||||||
|
|
||||||
open func updateTitleLabel() {
|
open func updateTitleLabel() {
|
||||||
|
|
||||||
//update the local vars for the label since we no
|
//update the local vars for the label since we no
|
||||||
//long have a model
|
//long have a model
|
||||||
var attributes: [any LabelAttributeModel] = []
|
var attributes: [any LabelAttributeModel] = []
|
||||||
@ -444,36 +446,43 @@ open class EntryFieldBase: Control, Changeable, FormFieldInternalValidatable {
|
|||||||
if let tooltipModel {
|
if let tooltipModel {
|
||||||
attributes.append(TooltipLabelAttribute(surface: surface, model: tooltipModel, presenter: self))
|
attributes.append(TooltipLabelAttribute(surface: surface, model: tooltipModel, presenter: self))
|
||||||
}
|
}
|
||||||
|
|
||||||
//set the titleLabel
|
//set the titleLabel
|
||||||
titleLabel.text = updatedLabelText
|
titleLabel.text = updatedLabelText
|
||||||
titleLabel.attributes = attributes
|
titleLabel.attributes = attributes
|
||||||
titleLabel.surface = surface
|
titleLabel.surface = surface
|
||||||
titleLabel.isEnabled = isEnabled
|
titleLabel.isEnabled = isEnabled
|
||||||
}
|
}
|
||||||
|
|
||||||
open func updateErrorLabel(){
|
open func updateErrorLabel(){
|
||||||
if showError, let errorText {
|
|
||||||
errorLabel.text = errorText
|
/// always show the errorIcon if there is an error
|
||||||
errorLabel.surface = surface
|
if showError || hasInternalError {
|
||||||
errorLabel.isEnabled = isEnabled
|
|
||||||
errorLabel.isHidden = false
|
|
||||||
statusIcon.name = .error
|
|
||||||
statusIcon.surface = surface
|
|
||||||
statusIcon.isHidden = !isEnabled || state.contains(.focused)
|
|
||||||
} else if hasInternalError, let internalErrorText {
|
|
||||||
errorLabel.text = internalErrorText
|
|
||||||
errorLabel.surface = surface
|
|
||||||
errorLabel.isEnabled = isEnabled
|
|
||||||
errorLabel.isHidden = false
|
|
||||||
statusIcon.name = .error
|
statusIcon.name = .error
|
||||||
statusIcon.surface = surface
|
statusIcon.surface = surface
|
||||||
statusIcon.isHidden = !isEnabled || state.contains(.focused)
|
statusIcon.isHidden = !isEnabled || state.contains(.focused)
|
||||||
} else {
|
} else {
|
||||||
statusIcon.isHidden = true
|
statusIcon.isHidden = true
|
||||||
errorLabel.isHidden = true
|
|
||||||
}
|
}
|
||||||
statusIcon.color = iconColorConfiguration.getColor(self)
|
statusIcon.color = iconColorConfiguration.getColor(self)
|
||||||
|
|
||||||
|
// only show errorLabel if there is a message
|
||||||
|
var message: String?
|
||||||
|
if showError, let errorText {
|
||||||
|
message = errorText
|
||||||
|
} else if hasInternalError, let internalErrorText {
|
||||||
|
message = internalErrorText
|
||||||
|
}
|
||||||
|
|
||||||
|
if let message {
|
||||||
|
errorLabel.text = message
|
||||||
|
errorLabel.surface = surface
|
||||||
|
errorLabel.isEnabled = isEnabled
|
||||||
|
errorLabel.isHidden = false
|
||||||
|
} else {
|
||||||
|
errorLabel.isHidden = true
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
open func updateHelperLabel(){
|
open func updateHelperLabel(){
|
||||||
@ -515,7 +524,7 @@ open class EntryFieldBase: Control, Changeable, FormFieldInternalValidatable {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
internal func updateRules() {
|
internal func updateRules() {
|
||||||
rules.removeAll()
|
rules.removeAll()
|
||||||
if self.isRequired {
|
if isRequired && useRequiredRule {
|
||||||
let rule = RequiredRule()
|
let rule = RequiredRule()
|
||||||
if let errorText, !errorText.isEmpty {
|
if let errorText, !errorText.isEmpty {
|
||||||
rule.errorMessage = errorText
|
rule.errorMessage = errorText
|
||||||
|
|||||||
@ -68,6 +68,12 @@ extension InputField {
|
|||||||
actionModel.onClick(inputField)
|
actionModel.onClick(inputField)
|
||||||
}
|
}
|
||||||
inputField.actionTextLink.isHidden = false
|
inputField.actionTextLink.isHidden = false
|
||||||
|
// set the accessibilityLabel
|
||||||
|
if let labelText = inputField.labelText {
|
||||||
|
inputField.actionTextLink.bridge_accessibilityLabelBlock = {
|
||||||
|
return "\(actionModel.text) \(labelText)"
|
||||||
|
}
|
||||||
|
}
|
||||||
inputField.fieldStackView.setCustomSpacing(VDSLayout.space2X, after: inputField.statusIcon)
|
inputField.fieldStackView.setCustomSpacing(VDSLayout.space2X, after: inputField.statusIcon)
|
||||||
} else {
|
} else {
|
||||||
inputField.actionTextLink.isHidden = true
|
inputField.actionTextLink.isHidden = true
|
||||||
|
|||||||
@ -41,7 +41,7 @@ extension InputField {
|
|||||||
guard let self else { return }
|
guard let self else { return }
|
||||||
self.passwordActionType = nextPasswordActionType
|
self.passwordActionType = nextPasswordActionType
|
||||||
inputField.setNeedsUpdate()
|
inputField.setNeedsUpdate()
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
passwordActionType = .show
|
passwordActionType = .show
|
||||||
}
|
}
|
||||||
|
|||||||
@ -67,7 +67,14 @@ extension InputField {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal func formatUSNumber(_ number: String) -> String {
|
override func textFieldDidEndEditing(_ inputField: InputField, textField: UITextField) {
|
||||||
|
if let text = inputField.text {
|
||||||
|
let rawNumber = text.filter { $0.isNumber }
|
||||||
|
textField.text = formatUSNumber(rawNumber)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func formatUSNumber(_ number: String) -> String {
|
||||||
// Format the number in the style XXX-XXX-XXXX
|
// Format the number in the style XXX-XXX-XXXX
|
||||||
let areaCodeLength = 3
|
let areaCodeLength = 3
|
||||||
let centralOfficeCodeLength = 3
|
let centralOfficeCodeLength = 3
|
||||||
|
|||||||
@ -105,6 +105,11 @@ open class InputField: EntryFieldBase {
|
|||||||
$0.translatesAutoresizingMaskIntoConstraints = false
|
$0.translatesAutoresizingMaskIntoConstraints = false
|
||||||
$0.textStyle = TextStyle.bodyLarge
|
$0.textStyle = TextStyle.bodyLarge
|
||||||
$0.isAccessibilityElement = false
|
$0.isAccessibilityElement = false
|
||||||
|
$0.autocorrectionType = .no
|
||||||
|
$0.spellCheckingType = .no
|
||||||
|
$0.smartQuotesType = .no
|
||||||
|
$0.smartDashesType = .no
|
||||||
|
$0.smartInsertDeleteType = .no
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Color configuration for the textField.
|
/// Color configuration for the textField.
|
||||||
@ -182,6 +187,8 @@ open class InputField: EntryFieldBase {
|
|||||||
super.setup()
|
super.setup()
|
||||||
accessibilityHintText = "Double tap to edit"
|
accessibilityHintText = "Double tap to edit"
|
||||||
|
|
||||||
|
actionTextLink.accessibilityTraits = .button
|
||||||
|
|
||||||
textField.heightAnchor.constraint(equalToConstant: 20).isActive = true
|
textField.heightAnchor.constraint(equalToConstant: 20).isActive = true
|
||||||
textField.delegate = self
|
textField.delegate = self
|
||||||
bottomContainerStackView.insertArrangedSubview(successLabel, at: 0)
|
bottomContainerStackView.insertArrangedSubview(successLabel, at: 0)
|
||||||
@ -205,11 +212,11 @@ open class InputField: EntryFieldBase {
|
|||||||
accessibilityLabels.append(text)
|
accessibilityLabels.append(text)
|
||||||
}
|
}
|
||||||
|
|
||||||
if let formatText = textField.formatText, !formatText.isEmpty {
|
if let formatText = textField.formatText, !formatText.isEmpty, textField.text.isEmpty {
|
||||||
accessibilityLabels.append("format, \(formatText)")
|
accessibilityLabels.append("format, \(formatText)")
|
||||||
}
|
}
|
||||||
|
|
||||||
if let placeholderText = textField.placeholder, !placeholderText.isEmpty {
|
if let placeholderText = textField.placeholder, !placeholderText.isEmpty, textField.text.isEmpty {
|
||||||
accessibilityLabels.append("placeholder, \(placeholderText)")
|
accessibilityLabels.append("placeholder, \(placeholderText)")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -244,6 +251,11 @@ open class InputField: EntryFieldBase {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
containerView.bridge_accessibilityValueBlock = { [weak self] in
|
||||||
|
guard let self else { return "" }
|
||||||
|
return textField.isSecureTextEntry ? "\(textField.text.count) stars" : value
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open override func getFieldContainer() -> UIView {
|
open override func getFieldContainer() -> UIView {
|
||||||
@ -338,19 +350,19 @@ open class InputField: EntryFieldBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extension InputField: UITextFieldDelegate {
|
extension InputField: UITextFieldDelegate {
|
||||||
public func textFieldDidBeginEditing(_ textField: UITextField) {
|
open func textFieldDidBeginEditing(_ textField: UITextField) {
|
||||||
fieldType.handler().textFieldDidBeginEditing(self, textField: textField)
|
fieldType.handler().textFieldDidBeginEditing(self, textField: textField)
|
||||||
updateContainerView()
|
updateContainerView()
|
||||||
updateErrorLabel()
|
updateErrorLabel()
|
||||||
}
|
}
|
||||||
|
|
||||||
public func textFieldDidEndEditing(_ textField: UITextField) {
|
open func textFieldDidEndEditing(_ textField: UITextField) {
|
||||||
fieldType.handler().textFieldDidEndEditing(self, textField: textField)
|
fieldType.handler().textFieldDidEndEditing(self, textField: textField)
|
||||||
validate()
|
validate()
|
||||||
UIAccessibility.post(notification: .layoutChanged, argument: self.containerView)
|
UIAccessibility.post(notification: .layoutChanged, argument: self.containerView)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func textFieldDidChangeSelection(_ textField: UITextField) {
|
open func textFieldDidChangeSelection(_ textField: UITextField) {
|
||||||
fieldType.handler().textFieldDidChangeSelection(self, textField: textField)
|
fieldType.handler().textFieldDidChangeSelection(self, textField: textField)
|
||||||
if fieldType.handler().validateOnChange {
|
if fieldType.handler().validateOnChange {
|
||||||
validate()
|
validate()
|
||||||
@ -359,8 +371,12 @@ extension InputField: UITextFieldDelegate {
|
|||||||
setNeedsUpdate()
|
setNeedsUpdate()
|
||||||
}
|
}
|
||||||
|
|
||||||
public func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
|
open func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
|
||||||
return fieldType.handler().textField(self, textField: textField, shouldChangeCharactersIn: range, replacementString: string)
|
let shouldChange = fieldType.handler().textField(self, textField: textField, shouldChangeCharactersIn: range, replacementString: string)
|
||||||
|
if shouldChange {
|
||||||
|
UIAccessibility.post(notification: .announcement, argument: string)
|
||||||
|
}
|
||||||
|
return shouldChange
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -47,6 +47,11 @@ open class TextField: UITextField, ViewProtocol, Errorable {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Properties
|
// MARK: - Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
/// Set to true to hide the blinking textField cursor.
|
||||||
|
open var hideBlinkingCaret = false
|
||||||
|
open var enableClipboardActions: Bool = true
|
||||||
|
open var onDidDeleteBackwards: (() -> Void)?
|
||||||
|
|
||||||
/// Key of whether or not updateView() is called in setNeedsUpdate()
|
/// Key of whether or not updateView() is called in setNeedsUpdate()
|
||||||
open var shouldUpdateView: Bool = true
|
open var shouldUpdateView: Bool = true
|
||||||
|
|
||||||
@ -209,6 +214,23 @@ open class TextField: UITextField, ViewProtocol, Errorable {
|
|||||||
return success
|
return success
|
||||||
}
|
}
|
||||||
|
|
||||||
|
open override func caretRect(for position: UITextPosition) -> CGRect {
|
||||||
|
|
||||||
|
if hideBlinkingCaret {
|
||||||
|
return .zero
|
||||||
|
}
|
||||||
|
|
||||||
|
let caretRect = super.caretRect(for: position)
|
||||||
|
return CGRect(origin: caretRect.origin, size: CGSize(width: 1, height: caretRect.height))
|
||||||
|
}
|
||||||
|
|
||||||
|
open override func deleteBackward() {
|
||||||
|
super.deleteBackward()
|
||||||
|
onDidDeleteBackwards?()
|
||||||
|
}
|
||||||
|
|
||||||
|
open override func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool { enableClipboardActions }
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Private Methods
|
// MARK: - Private Methods
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|||||||
@ -101,6 +101,7 @@ open class TextArea: EntryFieldBase {
|
|||||||
$0.isScrollEnabled = true
|
$0.isScrollEnabled = true
|
||||||
$0.textContainerInset = .zero
|
$0.textContainerInset = .zero
|
||||||
$0.autocorrectionType = .no
|
$0.autocorrectionType = .no
|
||||||
|
$0.spellCheckingType = .no
|
||||||
$0.textContainer.lineFragmentPadding = 0
|
$0.textContainer.lineFragmentPadding = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,7 +111,9 @@ open class TextArea: EntryFieldBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
didSet {
|
didSet {
|
||||||
validate()
|
if textView.isFirstResponder {
|
||||||
|
validate()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,6 +135,7 @@ open class TextArea: EntryFieldBase {
|
|||||||
super.setup()
|
super.setup()
|
||||||
|
|
||||||
accessibilityHintText = "Double tap to edit"
|
accessibilityHintText = "Double tap to edit"
|
||||||
|
textView.delegate = self
|
||||||
|
|
||||||
//events
|
//events
|
||||||
textView
|
textView
|
||||||
@ -226,7 +230,7 @@ open class TextArea: EntryFieldBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func textViewDidChange(_ textView: UITextView) {
|
public func textViewDidChange(_ textView: UITextView) {
|
||||||
|
|
||||||
//dynamic textView Height sizing based on Figma
|
//dynamic textView Height sizing based on Figma
|
||||||
//if you want it to work "as-is" delete this code
|
//if you want it to work "as-is" delete this code
|
||||||
@ -288,3 +292,10 @@ open class TextArea: EntryFieldBase {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
var countRule = CharacterCountRule()
|
var countRule = CharacterCountRule()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extension TextArea: UITextViewDelegate {
|
||||||
|
public func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool {
|
||||||
|
UIAccessibility.post(notification: .announcement, argument: text)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -41,10 +41,19 @@ open class TextView: UITextView, ViewProtocol, Errorable {
|
|||||||
// MARK: - Private Properties
|
// MARK: - Private Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
private var initialSetupPerformed = false
|
private var initialSetupPerformed = false
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Properties
|
// MARK: - Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
open var placeholder: String? { didSet { setNeedsUpdate() } }
|
||||||
|
|
||||||
|
open var placeholderLabel = Label().with {
|
||||||
|
$0.textColorConfiguration = ViewColorConfiguration().with {
|
||||||
|
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forDisabled: true)
|
||||||
|
$0.setSurfaceColors(VDSColor.elementsSecondaryOnlight, VDSColor.elementsSecondaryOndark, forDisabled: false)
|
||||||
|
}.eraseToAnyColorable()
|
||||||
|
}
|
||||||
|
|
||||||
/// Key of whether or not updateView() is called in setNeedsUpdate()
|
/// Key of whether or not updateView() is called in setNeedsUpdate()
|
||||||
open var shouldUpdateView: Bool = true
|
open var shouldUpdateView: Bool = true
|
||||||
|
|
||||||
@ -88,6 +97,7 @@ open class TextView: UITextView, ViewProtocol, Errorable {
|
|||||||
if textAlignment != oldValue {
|
if textAlignment != oldValue {
|
||||||
// Text alignment can be part of our paragraph style, so we may need to
|
// Text alignment can be part of our paragraph style, so we may need to
|
||||||
// re-style when changed
|
// re-style when changed
|
||||||
|
placeholderLabel.textAlignment = textAlignment
|
||||||
updateLabel()
|
updateLabel()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -118,6 +128,9 @@ open class TextView: UITextView, ViewProtocol, Errorable {
|
|||||||
done.pinCenterY()
|
done.pinCenterY()
|
||||||
.pinTrailing(16)
|
.pinTrailing(16)
|
||||||
inputAccessoryView = accessView
|
inputAccessoryView = accessView
|
||||||
|
|
||||||
|
addSubview(placeholderLabel)
|
||||||
|
placeholderLabel.pinToSuperView()
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func doneButtonAction() {
|
@objc func doneButtonAction() {
|
||||||
@ -145,7 +158,11 @@ open class TextView: UITextView, ViewProtocol, Errorable {
|
|||||||
setNeedsUpdate()
|
setNeedsUpdate()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
open override func layoutSubviews() {
|
||||||
|
super.layoutSubviews()
|
||||||
|
placeholderLabel.preferredMaxLayoutWidth = textContainer.size.width - textContainer.lineFragmentPadding * 2
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Accessibility
|
// MARK: - Accessibility
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -297,6 +314,10 @@ open class TextView: UITextView, ViewProtocol, Errorable {
|
|||||||
} else {
|
} else {
|
||||||
attributedText = nil
|
attributedText = nil
|
||||||
}
|
}
|
||||||
|
placeholderLabel.textStyle = textStyle
|
||||||
|
placeholderLabel.surface = surface
|
||||||
|
placeholderLabel.text = placeholder
|
||||||
|
placeholderLabel.isHidden = !text.isEmpty
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -205,15 +205,10 @@ open class Tilelet: TileContainerBase<Tilelet.Padding> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Descriptive Icon positioned in the contentView.
|
/// Descriptive Icon positioned in the contentView.
|
||||||
open var descriptiveIcon = Icon().with {
|
open var descriptiveIcon = Icon()
|
||||||
$0.isAccessibilityElement = false
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Directional Icon positioned in the contentView.
|
/// Directional Icon positioned in the contentView.
|
||||||
open var directionalIcon = Icon().with {
|
open var directionalIcon = Icon()
|
||||||
$0.isAccessibilityElement = false
|
|
||||||
$0.name = .rightArrow
|
|
||||||
}
|
|
||||||
|
|
||||||
private var _textWidth: TextWidth?
|
private var _textWidth: TextWidth?
|
||||||
|
|
||||||
@ -304,7 +299,7 @@ open class Tilelet: TileContainerBase<Tilelet.Padding> {
|
|||||||
super.setup()
|
super.setup()
|
||||||
color = .black
|
color = .black
|
||||||
aspectRatio = .none
|
aspectRatio = .none
|
||||||
|
|
||||||
addContentView(stackView)
|
addContentView(stackView)
|
||||||
|
|
||||||
//badge
|
//badge
|
||||||
@ -382,6 +377,16 @@ open class Tilelet: TileContainerBase<Tilelet.Padding> {
|
|||||||
titleLockupSubTitleLabelHeightGreaterThanConstraint = titleLockup.subTitleLabel.heightGreaterThanEqualTo(constant: titleLockup.subTitleLabel.minimumLineHeight)
|
titleLockupSubTitleLabelHeightGreaterThanConstraint = titleLockup.subTitleLabel.heightGreaterThanEqualTo(constant: titleLockup.subTitleLabel.minimumLineHeight)
|
||||||
titleLockupSubTitleLabelHeightGreaterThanConstraint?.priority = .defaultHigh
|
titleLockupSubTitleLabelHeightGreaterThanConstraint?.priority = .defaultHigh
|
||||||
titleLockupSubTitleLabelHeightGreaterThanConstraint?.activate()
|
titleLockupSubTitleLabelHeightGreaterThanConstraint?.activate()
|
||||||
|
|
||||||
|
directionalIcon.bridge_accessibilityLabelBlock = { [weak self] in
|
||||||
|
guard let self, let directionalIconModel else { return nil }
|
||||||
|
return directionalIconModel.accessibleText
|
||||||
|
}
|
||||||
|
|
||||||
|
descriptiveIcon.bridge_accessibilityLabelBlock = { [weak self] in
|
||||||
|
guard let self, let descriptiveIconModel else { return nil }
|
||||||
|
return descriptiveIconModel.accessibleText
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Resets to default settings.
|
/// Resets to default settings.
|
||||||
@ -425,6 +430,14 @@ open class Tilelet: TileContainerBase<Tilelet.Padding> {
|
|||||||
let titleLockupViews = gatherAccessibilityElements(from: titleLockup)
|
let titleLockupViews = gatherAccessibilityElements(from: titleLockup)
|
||||||
views.append(contentsOf: titleLockupViews)
|
views.append(contentsOf: titleLockupViews)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if descriptiveIconModel != nil {
|
||||||
|
views.append(descriptiveIcon)
|
||||||
|
|
||||||
|
} else if directionalIconModel != nil {
|
||||||
|
views.append(directionalIcon)
|
||||||
|
}
|
||||||
|
|
||||||
containerView.setAccessibilityLabel(for: views)
|
containerView.setAccessibilityLabel(for: views)
|
||||||
|
|
||||||
// get the views to return
|
// get the views to return
|
||||||
|
|||||||
@ -66,6 +66,10 @@ extension Tilelet {
|
|||||||
public var iconName: Icon.Name {
|
public var iconName: Icon.Name {
|
||||||
return self == .rightArrow ? .rightArrow : .externalLink
|
return self == .rightArrow ? .rightArrow : .externalLink
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public var accessibilityLabel: String {
|
||||||
|
self == .rightArrow ? "Directional right arrow" : "External link"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum IconSize: String, EnumSubset {
|
public enum IconSize: String, EnumSubset {
|
||||||
@ -80,7 +84,7 @@ extension Tilelet {
|
|||||||
public var iconColor: IconColor?
|
public var iconColor: IconColor?
|
||||||
|
|
||||||
/// Accessible Text for the Icon
|
/// Accessible Text for the Icon
|
||||||
public var accessibleText: String
|
public var accessibleText: String?
|
||||||
|
|
||||||
/// Enum for a icon type you want shown..
|
/// Enum for a icon type you want shown..
|
||||||
public var iconType: IconType
|
public var iconType: IconType
|
||||||
@ -95,7 +99,7 @@ extension Tilelet {
|
|||||||
|
|
||||||
self.iconType = iconType
|
self.iconType = iconType
|
||||||
self.iconColor = iconColor
|
self.iconColor = iconColor
|
||||||
self.accessibleText = accessibleText ?? iconType.iconName.rawValue
|
self.accessibleText = accessibleText ?? iconType.accessibilityLabel
|
||||||
self.size = size
|
self.size = size
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,15 @@
|
|||||||
|
1.0.71
|
||||||
|
----------------
|
||||||
|
- CXTDT-581803 - DatePicker - Calendar does not switch to Dark Mode
|
||||||
|
- CXTDT-584278 – InputField - Accessibility
|
||||||
|
|
||||||
|
1.0.70
|
||||||
|
----------------
|
||||||
|
- CXTDT-577463 - InputField - Accessibility - #1 Typing Feedback
|
||||||
|
- CXTDT-577463 - InputField - Accessibility - #5 Password / Inline Action
|
||||||
|
- CXTDT-560485 - Tilelet - Accessibility Icons
|
||||||
|
- DatePicker - Final logic for how the calendar shows.
|
||||||
|
|
||||||
1.0.69
|
1.0.69
|
||||||
----------------
|
----------------
|
||||||
- DatePicker - Refactored how this is shown
|
- DatePicker - Refactored how this is shown
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user