Merge branch 'bugfix/badgeIndicator' into 'develop'

fixed issues with BadgeIndicator Values on the custom styles

See merge request BPHV_MIPS/vds_ios!194
This commit is contained in:
Bruce, Matt R 2024-04-02 20:57:04 +00:00
commit d587022df4
5 changed files with 67 additions and 42 deletions

View File

@ -7,11 +7,11 @@
objects = {
/* Begin PBXBuildFile section */
1808BEBC2BA41C3200129230 /* CarouselScrollbar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1808BEBB2BA41C3200129230 /* CarouselScrollbar.swift */; };
1808BEC02BA456B700129230 /* CarouselScrollbarChangeLog.txt in Resources */ = {isa = PBXBuildFile; fileRef = 1808BEBF2BA456B700129230 /* CarouselScrollbarChangeLog.txt */; };
1832AC572BA0791D008AE476 /* BreadcrumbCellItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1832AC562BA0791D008AE476 /* BreadcrumbCellItem.swift */; };
18450CF12BA1B19C009FDF2A /* BreadcrumbsChangeLog.txt in Resources */ = {isa = PBXBuildFile; fileRef = 18450CF02BA1B19C009FDF2A /* BreadcrumbsChangeLog.txt */; };
1855EC662BAABF2A002ACAC2 /* BreadcrumbItemModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1855EC652BAABF2A002ACAC2 /* BreadcrumbItemModel.swift */; };
1808BEBC2BA41C3200129230 /* CarouselScrollbar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1808BEBB2BA41C3200129230 /* CarouselScrollbar.swift */; };
1808BEC02BA456B700129230 /* CarouselScrollbarChangeLog.txt in Resources */ = {isa = PBXBuildFile; fileRef = 1808BEBF2BA456B700129230 /* CarouselScrollbarChangeLog.txt */; };
186B2A8A2B88DA7F001AB71F /* TextAreaChangeLog.txt in Resources */ = {isa = PBXBuildFile; fileRef = 186B2A892B88DA7F001AB71F /* TextAreaChangeLog.txt */; };
18792A902B7431F2008C0D29 /* ButtonIconBadgeIndicatorModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18792A8F2B7431F2008C0D29 /* ButtonIconBadgeIndicatorModel.swift */; };
18A65A022B96E848006602CC /* Breadcrumbs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18A65A012B96E848006602CC /* Breadcrumbs.swift */; };
@ -196,11 +196,11 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
1808BEBB2BA41C3200129230 /* CarouselScrollbar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarouselScrollbar.swift; sourceTree = "<group>"; };
1808BEBF2BA456B700129230 /* CarouselScrollbarChangeLog.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = CarouselScrollbarChangeLog.txt; sourceTree = "<group>"; };
1832AC562BA0791D008AE476 /* BreadcrumbCellItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BreadcrumbCellItem.swift; sourceTree = "<group>"; };
18450CF02BA1B19C009FDF2A /* BreadcrumbsChangeLog.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = BreadcrumbsChangeLog.txt; sourceTree = "<group>"; };
1855EC652BAABF2A002ACAC2 /* BreadcrumbItemModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BreadcrumbItemModel.swift; sourceTree = "<group>"; };
1808BEBB2BA41C3200129230 /* CarouselScrollbar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarouselScrollbar.swift; sourceTree = "<group>"; };
1808BEBF2BA456B700129230 /* CarouselScrollbarChangeLog.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = CarouselScrollbarChangeLog.txt; sourceTree = "<group>"; };
186B2A892B88DA7F001AB71F /* TextAreaChangeLog.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = TextAreaChangeLog.txt; sourceTree = "<group>"; };
18792A8F2B7431F2008C0D29 /* ButtonIconBadgeIndicatorModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ButtonIconBadgeIndicatorModel.swift; sourceTree = "<group>"; };
18A65A012B96E848006602CC /* Breadcrumbs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Breadcrumbs.swift; sourceTree = "<group>"; };
@ -398,6 +398,15 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
1808BEBA2BA41B1D00129230 /* CarouselScrollbar */ = {
isa = PBXGroup;
children = (
1808BEBB2BA41C3200129230 /* CarouselScrollbar.swift */,
1808BEBF2BA456B700129230 /* CarouselScrollbarChangeLog.txt */,
);
path = CarouselScrollbar;
sourceTree = "<group>";
};
18A65A002B96E7E1006602CC /* Breadcrumbs */ = {
isa = PBXGroup;
children = (
@ -410,15 +419,6 @@
path = Breadcrumbs;
sourceTree = "<group>";
};
1808BEBA2BA41B1D00129230 /* CarouselScrollbar */ = {
isa = PBXGroup;
children = (
1808BEBB2BA41C3200129230 /* CarouselScrollbar.swift */,
1808BEBF2BA456B700129230 /* CarouselScrollbarChangeLog.txt */,
);
path = CarouselScrollbar;
sourceTree = "<group>";
};
445BA07629C07ABA0036A7C5 /* Notification */ = {
isa = PBXGroup;
children = (
@ -1369,7 +1369,7 @@
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 55;
CURRENT_PROJECT_VERSION = 56;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
@ -1406,7 +1406,7 @@
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 55;
CURRENT_PROJECT_VERSION = 56;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;

View File

@ -84,47 +84,58 @@ open class BadgeIndicator: View {
/// Dynamic TextStyle for the size.
public var textStyle: TextStyle {
let style = TextStyle.bodySmall
var font: Font = .edsRegular
var pointSize: CGFloat = VDSTypography.fontSizeBody12
var letterSpacing: CGFloat = 0.0
var lineHeight: CGFloat = 0.0
var edgeInsets: UIEdgeInsets = .zero
switch self {
case .xxlarge:
pointSize = VDSTypography.fontSizeTitle24
letterSpacing = VDSTypography.letterSpacingWide
lineHeight = VDSTypography.lineHeightTitle24
case .xlarge:
pointSize = VDSTypography.fontSizeTitle20
lineHeight = VDSTypography.lineHeightTitle20
case .large:
pointSize = VDSTypography.fontSizeBody16
letterSpacing = VDSTypography.letterSpacingWide
lineHeight = VDSTypography.lineHeightBody16
case .medium:
pointSize = VDSTypography.fontSizeBody14
letterSpacing = VDSTypography.letterSpacingWide
lineHeight = 14.0
case .small:
font = .etxRegular
pointSize = VDSTypography.fontSizeBody12
lineHeight = 12.0
}
return TextStyle(rawValue: "\(self.rawValue)BadgeIndicator",
fontFace: style.fontFace,
fontFace: font,
pointSize: pointSize,
lineHeight: 0,
letterSpacing: letterSpacing)
lineHeight: lineHeight,
letterSpacing: letterSpacing,
edgeInsets: edgeInsets)
}
//EdgeInsets for the label.
public var edgeInset: UIEdgeInsets {
var horizontalPadding: CGFloat = VDSLayout.Spacing.space1X.value
let verticalPadding: CGFloat = 0
var horizontalPadding: CGFloat = 0.0
let verticalPadding: CGFloat = 2.0
switch self {
case .xxlarge:
horizontalPadding = VDSLayout.Spacing.space2X.value
case .xlarge, .large,.medium:
case .xlarge, .large, .medium:
horizontalPadding = 6.0
case .small:
break
horizontalPadding = VDSLayout.Spacing.space1X.value
}
return .axis(horizontal: horizontalPadding, vertical: verticalPadding)
}
@ -268,10 +279,10 @@ open class BadgeIndicator: View {
/// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations.
open override func setup() {
super.setup()
isAccessibilityElement = true
addSubview(badgeView)
badgeView.addSubview(label)
accessibilityElements = [label]
heightConstraint = badgeView.heightGreaterThanEqualTo(constant: badgeSize)
widthConstraint = badgeView.widthGreaterThanEqualTo(constant: badgeSize)
@ -347,6 +358,15 @@ open class BadgeIndicator: View {
layoutIfNeeded()
}
open override func updateAccessibility() {
super.updateAccessibility()
if kind == .numbered {
accessibilityLabel = label.text
} else {
accessibilityLabel = "Simple"
}
}
open override func layoutSubviews() {
super.layoutSubviews()

View File

@ -108,7 +108,10 @@ open class ButtonIcon: Control, Changeable, FormFieldable {
open var badgeIndicatorModel: BadgeIndicatorModel? { didSet { setNeedsUpdate() } }
/// Icon object used to render out the Icon for this ButtonIcon.
open var icon = Icon().with { $0.isUserInteractionEnabled = false }
open var icon = Icon().with {
$0.isUserInteractionEnabled = false
$0.accessibilityTraits = .button
}
/// Determines the type of button based on the contrast.
open var kind: Kind = .ghost { didSet { setNeedsUpdate() } }
@ -342,9 +345,8 @@ open class ButtonIcon: Control, Changeable, FormFieldable {
/// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations.
open override func setup() {
super.setup()
isAccessibilityElement = true
accessibilityTraits = .button
accessibilityElements = [badgeIndicator]
isAccessibilityElement = false
accessibilityElements = [icon, badgeIndicator]
//create a layoutGuide for the icon to key off of
let iconLayoutGuide = UILayoutGuide()

View File

@ -247,6 +247,11 @@ open class Notification: View {
subTitleLabel.textColorConfiguration = textColorConfiguration.eraseToAnyColorable()
//TODO: Need to add setup animation for displaying the Notification view for iOS.
isAccessibilityElement = false
accessibilityElements = [closeButton, typeIcon, titleLabel, subTitleLabel, buttonGroup]
closeButton.accessibilityTraits = [.button]
closeButton.accessibilityLabel = "Close Notification"
}
/// Resets to default settings.
@ -298,17 +303,7 @@ open class Notification: View {
super.layoutSubviews()
layer.cornerRadius = UIScreen.main.bounds.width == bounds.width ? 0 : 4.0
}
///Updating the accessiblity values i.e elements, label, value other items for the component.
open override func updateAccessibility() {
super.updateAccessibility()
accessibilityElements = [closeButton, typeIcon, titleLabel, subTitleLabel, buttonGroup]
typeIcon.accessibilityLabel = style.rawValue
typeIcon.imageView.image?.isAccessibilityElement = false
closeButton.accessibilityTraits = [.button]
closeButton.accessibilityLabel = "Close Notification"
}
//--------------------------------------------------
// MARK: - Private Methods
//--------------------------------------------------

View File

@ -1,3 +1,11 @@
1.0.56
----------------
- ONEAPP-7190 - Breadcrumbs - Finished Development
- ONEAPP-6830 - CarouselScrollbar - Finished Development
- ONEAPP-6978 - Pagination - Finished Development
- ONEAPP-6984 - Tilelet - Finished Development
- ONEAPP-6682 - TextArea - Finished Development
1.0.55
----------------
- ONEAPP-6305 - BadgeIndicator - Finished Development