Merge branch 'mbruce/bugfix' into 'develop'

SetDefaults() updates

See merge request BPHV_MIPS/vds_ios!288
This commit is contained in:
Bruce, Matt R 2024-08-17 19:37:44 +00:00
commit 352affeddd
9 changed files with 54 additions and 72 deletions

View File

@ -1589,7 +1589,7 @@
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 71;
CURRENT_PROJECT_VERSION = 72;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
@ -1627,7 +1627,7 @@
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 71;
CURRENT_PROJECT_VERSION = 72;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;

View File

@ -293,16 +293,6 @@ open class BadgeIndicator: View {
label.centerYAnchor.constraint(equalTo: badgeView.centerYAnchor).isActive = true
labelContraints.isActive = true
bridge_accessibilityLabelBlock = { [weak self] in
guard let self else { return "" }
if let accessibilityText {
return kind == .numbered ? label.text + " " + accessibilityText : accessibilityText
} else if kind == .numbered {
return label.text
} else {
return "Simple"
}
}
}
open override func setDefaults() {
@ -324,6 +314,17 @@ open class BadgeIndicator: View {
height = nil
accessibilityText = nil
maximumDigits = .two
bridge_accessibilityLabelBlock = { [weak self] in
guard let self else { return "" }
if let accessibilityText {
return kind == .numbered ? label.text + " " + accessibilityText : accessibilityText
} else if kind == .numbered {
return label.text
} else {
return "Simple"
}
}
}
/// Resets to default settings.

View File

@ -49,13 +49,6 @@ open class CheckboxItem: SelectorItemBase<Checkbox> {
sendActions(for: .valueChanged)
}
open override func setup() {
super.setup()
let foo = ConcreteClass(customView: Checkbox())
print(foo.customView.isAnimated)
}
open override func setDefaults() {
super.setDefaults()
isAnimated = false
@ -67,24 +60,3 @@ open class CheckboxItem: SelectorItemBase<Checkbox> {
super.updateView()
}
}
@objcMembers
open class GenericClass<T: UIView>: NSObject {
public var customView: T
public init(customView: T = T()) {
self.customView = customView
}
}
@objcMembers
@objc(VDSConcreteClass)
open class ConcreteClass: GenericClass<Checkbox> {
}
@objcMembers
@objc(VDSConcreteCheckboxClass)
open class ConcreteCheckboxClass: ConcreteClass {}

View File

@ -152,15 +152,7 @@ open class DatePicker: EntryFieldBase<String> {
// setting color config
selectedDateLabel.textColorConfiguration = primaryColorConfiguration.eraseToAnyColorable()
// tap gesture
containerView.onClick = { [weak self] _ in
guard let self else { return }
if isEnabled && !isReadOnly {
showPopover()
}
}
NotificationCenter.default
.publisher(for: UIDevice.orientationDidChangeNotification).sink { [weak self] _ in
guard let self else { return }
@ -177,6 +169,14 @@ open class DatePicker: EntryFieldBase<String> {
calendarModel = .init()
dateFormat = .shortNumeric
selectedDateLabel.textStyle = .bodyLarge
// tap gesture
containerView.onClick = { [weak self] _ in
guard let self else { return }
if isEnabled && !isReadOnly {
showPopover()
}
}
}
open override func getFieldContainer() -> UIView {

View File

@ -268,10 +268,6 @@ open class Notification: View {
closeButton.accessibilityTraits = [.button]
closeButton.accessibilityLabel = "Close Notification"
typeIcon.bridge_accessibilityLabelBlock = { [weak self] in
guard let self else { return "" }
return style.accessibleText
}
}
open override func setDefaults() {
@ -296,6 +292,10 @@ open class Notification: View {
hideCloseButton = false
typeIcon.bridge_accessibilityLabelBlock = { [weak self] in
guard let self else { return "" }
return style.accessibleText
}
}
/// Resets to default settings.

View File

@ -145,6 +145,10 @@ open class Pagination: View {
.sink { [weak self] value in
self?.collectionViewWidthAnchor?.constant = value //As cell width is dynamic i.e cell may contain 2 or 3 or 4 charcters. Make sure that all the visible cells are displayed.
}.store(in: &subscribers)
}
open override func setDefaults() {
super.setDefaults()
collectionContainerView.onAccessibilityIncrement = { [weak self] in
guard let self else { return }
self.selectedPage = max(0, self.selectedPage + 1)

View File

@ -150,6 +150,10 @@ extension Tabs {
labelLeadingConstraint = label.pinLeading(anchor: layoutGuide.leadingAnchor)
labelBottomConstraint = label.pinBottom(anchor: layoutGuide.bottomAnchor, priority: .defaultHigh)
}
open override func setDefaults() {
super.setDefaults()
bridge_accessibilityLabelBlock = { [weak self] in
guard let self else { return "" }
return text

View File

@ -379,15 +379,6 @@ open class Tilelet: TileContainerBase<Tilelet.Padding> {
titleLockupSubTitleLabelHeightGreaterThanConstraint?.priority = .defaultHigh
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
}
}
open override func setDefaults() {
@ -403,6 +394,16 @@ open class Tilelet: TileContainerBase<Tilelet.Padding> {
subTitleModel = nil
descriptiveIconModel = nil
directionalIconModel = nil
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
}
}
/// Used to make changes to the View based off a change events or from local properties.

View File

@ -129,6 +129,16 @@ open class Tooltip: Control, TooltipLaunchable {
isAccessibilityElement = true
accessibilityTraits = .button
}
open override func setDefaults() {
super.setDefaults()
closeButtonText = "Close"
fillColor = .primary
size = .medium
title = nil
content = nil
contentView = nil
onClick = { [weak self] tooltip in
guard let self else { return}
@ -158,16 +168,6 @@ open class Tooltip: Control, TooltipLaunchable {
return isEnabled ? "Double tap to open." : ""
}
}
open override func setDefaults() {
super.setDefaults()
closeButtonText = "Close"
fillColor = .primary
size = .medium
title = nil
content = nil
contentView = nil
}
/// Used to make changes to the View based off a change events or from local properties.