Merge branch 'mbruce/bugfixes' into 'develop'

fixed bug for borderline in horizontal - top configuration

See merge request BPHV_MIPS/vds_ios!78
This commit is contained in:
Bruce, Matt R 2023-06-09 19:24:03 +00:00
commit 2c83f0973a
12 changed files with 213 additions and 131 deletions

View File

@ -1090,7 +1090,7 @@
buildSettings = { buildSettings = {
BUILD_LIBRARY_FOR_DISTRIBUTION = YES; BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 21; CURRENT_PROJECT_VERSION = 22;
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_COMPATIBILITY_VERSION = 1;
@ -1123,7 +1123,7 @@
buildSettings = { buildSettings = {
BUILD_LIBRARY_FOR_DISTRIBUTION = YES; BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 21; CURRENT_PROJECT_VERSION = 22;
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_COMPATIBILITY_VERSION = 1;

View File

@ -98,24 +98,24 @@ open class Badge: View {
return config.eraseToAnyColorable() return config.eraseToAnyColorable()
}() }()
private var textColorConfig = ViewColorConfiguration() private var textColorConfiguration = ViewColorConfiguration()
public func updateTextColorConfig() { public func updateTextColorConfig() {
textColorConfig.reset() textColorConfiguration.reset()
switch fillColor { switch fillColor {
case .red, .black: case .red, .black:
textColorConfig.setSurfaceColors(VDSColor.elementsPrimaryOndark, VDSColor.elementsPrimaryOndark, forDisabled: false) textColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOndark, VDSColor.elementsPrimaryOndark, forDisabled: false)
textColorConfig.setSurfaceColors(VDSColor.elementsPrimaryOndark, VDSColor.elementsPrimaryOndark, forDisabled: true) textColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOndark, VDSColor.elementsPrimaryOndark, forDisabled: true)
case .yellow, .white: case .yellow, .white:
textColorConfig.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOnlight, forDisabled: false) textColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOnlight, forDisabled: false)
textColorConfig.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOnlight, forDisabled: true) textColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOnlight, forDisabled: true)
case .orange, .green, .blue: case .orange, .green, .blue:
textColorConfig.setSurfaceColors(VDSColor.elementsPrimaryOndark, VDSColor.elementsPrimaryOnlight, forDisabled: false) textColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOndark, VDSColor.elementsPrimaryOnlight, forDisabled: false)
textColorConfig.setSurfaceColors(VDSColor.elementsPrimaryOndark, VDSColor.elementsPrimaryOnlight, forDisabled: true) textColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOndark, VDSColor.elementsPrimaryOnlight, forDisabled: true)
} }
} }
@ -127,7 +127,7 @@ open class Badge: View {
backgroundColor = backgroundColorConfiguration.getColor(self) backgroundColor = backgroundColorConfiguration.getColor(self)
label.textColorConfiguration = textColorConfig.eraseToAnyColorable() label.textColorConfiguration = textColorConfiguration.eraseToAnyColorable()
label.numberOfLines = numberOfLines label.numberOfLines = numberOfLines
label.text = text label.text = text
label.surface = surface label.surface = surface

View File

@ -75,14 +75,15 @@ open class TextLink: ButtonBase {
super.setup() super.setup()
isAccessibilityElement = true isAccessibilityElement = true
accessibilityTraits = .link accessibilityTraits = .link
if let titleLabel { if let titleLabel {
addSubview(line) addSubview(line)
line.pinLeading(titleLabel.leadingAnchor) line.pinLeading(titleLabel.leadingAnchor)
line.pinTrailing(titleLabel.trailingAnchor) line.pinTrailing(titleLabel.trailingAnchor)
line.pinTop(titleLabel.bottomAnchor, 1) line.pinTop(titleLabel.bottomAnchor)
line.pinBottom(bottomAnchor)
lineHeightConstraint = line.heightAnchor.constraint(equalToConstant: 1.0) lineHeightConstraint = line.heightAnchor.constraint(equalToConstant: 1.0)
lineHeightConstraint?.isActive = true lineHeightConstraint?.isActive = true
titleLabel.debugBorder(show: true)
} }
} }

View File

@ -37,10 +37,7 @@ open class Line: View {
addSubview(lineView) addSubview(lineView)
lineView.height(1) lineView.height(1)
lineView.pinToSuperView()
lineView
.pinLeading()
.pinTrailing()
} }
open override func reset() { open override func reset() {

View File

@ -181,7 +181,7 @@ open class Notification: View {
return config.eraseToAnyColorable() return config.eraseToAnyColorable()
}() }()
private var textColorConfig = ViewColorConfiguration().with { private var textColorConfiguration = ViewColorConfiguration().with {
$0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forDisabled: false) $0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forDisabled: false)
$0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forDisabled: true) $0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forDisabled: true)
} }
@ -224,8 +224,8 @@ open class Notification: View {
mainStackView.addArrangedSubview(closeButton) mainStackView.addArrangedSubview(closeButton)
//labels //labels
titleLabel.textColorConfiguration = textColorConfig.eraseToAnyColorable() titleLabel.textColorConfiguration = textColorConfiguration.eraseToAnyColorable()
subTitleLabel.textColorConfiguration = textColorConfig.eraseToAnyColorable() subTitleLabel.textColorConfiguration = textColorConfiguration.eraseToAnyColorable()
} }
open override func reset() { open override func reset() {

View File

@ -66,6 +66,32 @@ extension Tabs {
private var indicatorColorConfiguration = SurfaceColorConfiguration(VDSColor.paletteRed, VDSColor.elementsPrimaryOndark) private var indicatorColorConfiguration = SurfaceColorConfiguration(VDSColor.paletteRed, VDSColor.elementsPrimaryOndark)
private var indicatorWidth: CGFloat = 4.0 private var indicatorWidth: CGFloat = 4.0
private var indicatorSide: UIRectEdge {
guard orientation == .horizontal else { return .left }
return indicatorPosition.value
}
private var leadingSpace: CGFloat {
guard orientation == .vertical else { return 0 }
return size == .medium ? VDSLayout.Spacing.space4X.value : VDSLayout.Spacing.space6X.value
}
private var otherSpace: CGFloat {
if orientation == .horizontal {
return size == .medium ? VDSLayout.Spacing.space3X.value : VDSLayout.Spacing.space4X.value
} else {
return VDSLayout.Spacing.space2X.value
}
}
private var widthConstraint: NSLayoutConstraint {
if let width, orientation == .vertical {
return label.widthAnchor.constraint(equalToConstant: width)
} else {
return label.widthAnchor.constraint(greaterThanOrEqualToConstant: minWidth)
}
}
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Initializers // MARK: - Initializers
//-------------------------------------------------- //--------------------------------------------------
@ -87,11 +113,8 @@ extension Tabs {
open override func setup() { open override func setup() {
super.setup() super.setup()
addSubview(label) addSubview(label)
backgroundColor = .clear
accessibilityTraits = .button accessibilityTraits = .button
label.backgroundColor = .clear
label.translatesAutoresizingMaskIntoConstraints = false label.translatesAutoresizingMaskIntoConstraints = false
label.pinTrailing() label.pinTrailing()
@ -125,32 +148,17 @@ extension Tabs {
} }
open override func updateView() { open override func updateView() {
//label properties
label.text = text label.text = text
label.textPosition = textPosition label.textPosition = textPosition
label.textStyle = size.textStyle label.textStyle = size.textStyle
label.textColor = textColorConfiguration.getColor(self) label.textColor = textColorConfiguration.getColor(self)
labelWidthConstraint?.isActive = false
if let width, orientation == .vertical {
labelWidthConstraint = label.widthAnchor.constraint(equalToConstant: width)
} else {
labelWidthConstraint = label.widthAnchor.constraint(greaterThanOrEqualToConstant: minWidth)
}
labelWidthConstraint?.isActive = true
var leadingSpace: CGFloat
if orientation == .horizontal {
leadingSpace = 0
} else {
leadingSpace = size == .medium ? VDSLayout.Spacing.space4X.value : VDSLayout.Spacing.space6X.value
}
labelLeadingConstraint?.constant = leadingSpace
var otherSpace: CGFloat //constaints
if orientation == .horizontal { labelWidthConstraint?.isActive = false
otherSpace = size == .medium ? VDSLayout.Spacing.space3X.value : VDSLayout.Spacing.space4X.value labelWidthConstraint = widthConstraint
} else { labelWidthConstraint?.isActive = true
otherSpace = VDSLayout.Spacing.space2X.value labelLeadingConstraint?.constant = leadingSpace
}
labelTopConstraint?.constant = otherSpace labelTopConstraint?.constant = otherSpace
labelBottomConstraint?.constant = -otherSpace labelBottomConstraint?.constant = -otherSpace
@ -163,12 +171,10 @@ extension Tabs {
removeBorders() removeBorders()
if selected { if selected {
var indicator: UIRectEdge = .left addBorder(side: indicatorSide, width: indicatorWidth, color: indicatorColorConfiguration.getColor(self))
if orientation == .horizontal {
indicator = indicatorPosition.value
}
addBorder(side: indicator, width: indicatorWidth, color: indicatorColorConfiguration.getColor(self), offset: 1)
} }
} }
} }
} }

View File

@ -9,17 +9,21 @@ import Foundation
import UIKit import UIKit
import VDSColorTokens import VDSColorTokens
/// Tabs are organizational components that group content and allow customers to navigate its display. Use them to separate content when the content is related but doesnt need to be compared.
@objc(VDSTabs) @objc(VDSTabs)
open class Tabs: View { open class Tabs: View {
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Enums // MARK: - Enums
//-------------------------------------------------- //--------------------------------------------------
/// Layout Axis of the Tabs
public enum Orientation: String, CaseIterable{ public enum Orientation: String, CaseIterable{
case vertical case vertical
case horizontal case horizontal
} }
/// Position for the Hover Border Accent for a Tab.
public enum IndicatorPosition: String, CaseIterable { public enum IndicatorPosition: String, CaseIterable {
case top case top
case bottom case bottom
@ -33,11 +37,13 @@ open class Tabs: View {
} }
} }
//Type of behavior for Scrolling
public enum Overflow: String, CaseIterable { public enum Overflow: String, CaseIterable {
case scroll case scroll
case none case none
} }
/// Available size for tabs
public enum Size: String, CaseIterable { public enum Size: String, CaseIterable {
case medium case medium
case large case large
@ -94,18 +100,60 @@ open class Tabs: View {
///Model of the Tabs you are wanting to show. ///Model of the Tabs you are wanting to show.
open var tabModels: [TabModel] = [] { didSet { updateTabItems() } } open var tabModels: [TabModel] = [] { didSet { updateTabItems() } }
open var tabSpacing: CGFloat { tabStackView.spacing }
open var tabViews: [Tab] = [] open var tabViews: [Tab] = []
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Private Properties // MARK: - Private Properties
//-------------------------------------------------- //--------------------------------------------------
private var tabStackView: UIStackView! private var tabStackView = UIStackView()
private var scrollView: UIScrollView! private var scrollView = UIScrollView()
private var contentView: View! private var contentView = View()
private var borderlineColorConfig = SurfaceColorConfiguration(VDSColor.elementsLowcontrastOnlight, VDSColor.elementsLowcontrastOndark) private var borderlineView = View()
private let borderlineSize = 1.0
private var borderlineColorConfiguration = SurfaceColorConfiguration(VDSColor.elementsLowcontrastOnlight, VDSColor.elementsLowcontrastOndark)
private var borderlineViewLeadingConstraint: NSLayoutConstraint?
private var borderlineViewTrailingConstraint: NSLayoutConstraint?
private var borderlineViewTopConstraint: NSLayoutConstraint?
private var borderlineViewBottomConstraint: NSLayoutConstraint?
private var borderlineViewHeightConstraint: NSLayoutConstraint?
private var borderlineViewWidthConstraint: NSLayoutConstraint?
private var contentViewWidthConstraint: NSLayoutConstraint? private var contentViewWidthConstraint: NSLayoutConstraint?
//--------------------------------------------------
// MARK: - Configuration Properties
//--------------------------------------------------
private var stackViewAxis: NSLayoutConstraint.Axis {
orientation == .horizontal ? .horizontal : .vertical
}
private var stackViewAlignment: UIStackView.Alignment {
orientation == .horizontal ? .fill : .leading
}
private var stackViewDistribution: UIStackView.Distribution{
if orientation == .horizontal && fillContainer {
return .fillEqually
} else {
return orientation == .horizontal ? .fillProportionally : .fill
}
}
private var stackViewSpacing: CGFloat {
switch orientation {
case .vertical:
return size == .medium ? VDSLayout.Spacing.space4X.value : VDSLayout.Spacing.space6X.value
case .horizontal:
return size == .medium ? VDSLayout.Spacing.space6X.value : VDSLayout.Spacing.space8X.value
}
}
private var scrollIsEnabled: Bool {
orientation == .horizontal && overflow == .scroll
}
private var textPosition: TextPosition {
orientation == .horizontal && fillContainer ? .center : .left
}
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Initializers // MARK: - Initializers
@ -141,12 +189,22 @@ open class Tabs: View {
tabStackView.axis = .horizontal tabStackView.axis = .horizontal
tabStackView.distribution = .fill tabStackView.distribution = .fill
tabStackView.translatesAutoresizingMaskIntoConstraints = false tabStackView.translatesAutoresizingMaskIntoConstraints = false
contentView.addSubview(borderlineView)
contentView.addSubview(tabStackView) contentView.addSubview(tabStackView)
scrollView.pinToSuperView() scrollView.pinToSuperView()
contentView.pinToSuperView() contentView.pinToSuperView()
tabStackView.pinToSuperView() tabStackView.pinToSuperView()
contentView.heightAnchor.constraint(equalTo: scrollView.heightAnchor).isActive = true contentView.heightAnchor.constraint(equalTo: scrollView.heightAnchor).isActive = true
borderlineViewWidthConstraint = borderlineView.widthAnchor.constraint(equalToConstant: 0)
borderlineViewHeightConstraint = borderlineView.heightAnchor.constraint(equalToConstant: 0)
borderlineViewLeadingConstraint = borderlineView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor)
borderlineViewTrailingConstraint = borderlineView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor)
borderlineViewTopConstraint = borderlineView.topAnchor.constraint(equalTo: contentView.topAnchor)
borderlineViewBottomConstraint = borderlineView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor)
} }
private func updateTabItems() { private func updateTabItems() {
@ -193,15 +251,10 @@ open class Tabs: View {
super.updateView() super.updateView()
// Update the stackview properties // Update the stackview properties
if orientation == .horizontal && fillContainer { tabStackView.distribution = stackViewDistribution
tabStackView.distribution = .fillEqually tabStackView.axis = stackViewAxis
} else { tabStackView.alignment = stackViewAlignment
tabStackView.distribution = orientation == .horizontal ? .fillProportionally : .fill tabStackView.spacing = stackViewSpacing
}
tabStackView.axis = orientation == .horizontal ? .horizontal : .vertical
tabStackView.alignment = orientation == .horizontal ? .fill : .leading
tabStackView.spacing = orientation == .horizontal ? VDSLayout.Spacing.space6X.value : VDSLayout.Spacing.space4X.value
// Update tab appearance based on properties // Update tab appearance based on properties
for (index, tabItem) in tabViews.enumerated() { for (index, tabItem) in tabViews.enumerated() {
@ -209,68 +262,86 @@ open class Tabs: View {
tabItem.index = index tabItem.index = index
tabItem.minWidth = minWidth tabItem.minWidth = minWidth
tabItem.size = size tabItem.size = size
tabItem.textPosition = orientation == .horizontal && fillContainer ? .center : .left tabItem.textPosition = textPosition
tabItem.orientation = orientation tabItem.orientation = orientation
tabItem.surface = surface tabItem.surface = surface
tabItem.indicatorPosition = indicatorPosition tabItem.indicatorPosition = indicatorPosition
tabItem.accessibilityLabel = "\(tabItem.text) \(tabItem.selected ? "selected" : "unselected") \(index+1) of \(tabViews.count)" tabItem.accessibilityLabel = "\(tabItem.text) \(tabItem.selected ? "selected" : "unselected") \(index+1) of \(tabViews.count)"
} }
// Deactivate old constraint
contentViewWidthConstraint?.isActive = false
// Apply width //update the width based on rules
if orientation == .vertical { updateContentView()
scrollView.isScrollEnabled = false
contentViewWidthConstraint = contentView.widthAnchor.constraint(equalTo: widthAnchor)
} else {
// Apply overflow
if overflow == .scroll && !fillContainer {
let contentWidth = tabStackView.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize).width
contentViewWidthConstraint = contentView.widthAnchor.constraint(equalToConstant: contentWidth)
// Enable scrolling if necessary
scrollView.contentSize = CGSize(width: contentWidth, height: scrollView.bounds.height)
} else {
contentViewWidthConstraint = contentView.widthAnchor.constraint(equalTo: widthAnchor)
}
}
scrollView.isScrollEnabled = orientation == .horizontal && overflow == .scroll
// Activate old constraint
contentViewWidthConstraint?.isActive = true
setNeedsLayout() setNeedsLayout()
layoutIfNeeded() layoutIfNeeded()
} }
open override func layoutSubviews() { private func updateContentView() {
super.layoutSubviews() // Deactivate old constraint
contentViewWidthConstraint?.isActive = false
//scrollView Contentsize
// Apply overflow
if orientation == .horizontal && overflow == .scroll && !fillContainer { if orientation == .horizontal && overflow == .scroll && !fillContainer {
let contentWidth = tabStackView.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize).width let contentWidth = tabStackView.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize).width
contentViewWidthConstraint = contentView.widthAnchor.constraint(equalToConstant: contentWidth)
scrollView.contentSize = CGSize(width: contentWidth, height: scrollView.bounds.height) scrollView.contentSize = CGSize(width: contentWidth, height: scrollView.bounds.height)
} else { } else {
contentViewWidthConstraint = contentView.widthAnchor.constraint(equalTo: widthAnchor)
scrollView.contentSize = bounds.size scrollView.contentSize = bounds.size
} }
// Apply border line scrollView.isScrollEnabled = scrollIsEnabled
layer.remove(layerName: "borderLineLayer")
if borderLine { // Activate old constraint
let borderLineLayer = CALayer() contentViewWidthConstraint?.isActive = true
borderLineLayer.name = "borderLineLayer"
borderLineLayer.backgroundColor = borderlineColorConfig.getColor(self).cgColor
if orientation == .horizontal {
borderLineLayer.frame = CGRect(x: 0, y: bounds.height - 1, width: bounds.width, height: 1)
} else {
borderLineLayer.frame = CGRect(x: 0, y: 0, width: 1, height: bounds.height)
}
layer.addSublayer(borderLineLayer)
}
scrollToSelectedIndex(animated: true) scrollToSelectedIndex(animated: true)
} }
open override func layoutSubviews() {
super.layoutSubviews()
//borderLine
if borderLine {
var edge: UIRectEdge = .bottom
if orientation == .vertical {
edge = .left
} else if indicatorPosition == .top {
edge = .top
}
borderlineViewLeadingConstraint?.isActive = false
borderlineViewTrailingConstraint?.isActive = false
borderlineViewTopConstraint?.isActive = false
borderlineViewBottomConstraint?.isActive = false
borderlineViewHeightConstraint?.isActive = false
borderlineViewWidthConstraint?.isActive = false
if edge == .left {
borderlineViewWidthConstraint?.constant = borderlineSize
borderlineViewWidthConstraint?.isActive = true
borderlineViewTopConstraint?.isActive = true
borderlineViewLeadingConstraint?.isActive = true
borderlineViewBottomConstraint?.isActive = true
} else if edge == .top {
borderlineViewHeightConstraint?.constant = borderlineSize
borderlineViewHeightConstraint?.isActive = true
borderlineViewTopConstraint?.isActive = true
borderlineViewLeadingConstraint?.isActive = true
borderlineViewTrailingConstraint?.isActive = true
} else {
borderlineViewHeightConstraint?.constant = borderlineSize
borderlineViewHeightConstraint?.isActive = true
borderlineViewLeadingConstraint?.isActive = true
borderlineViewTrailingConstraint?.isActive = true
borderlineViewBottomConstraint?.isActive = true
}
borderlineView.backgroundColor = borderlineColorConfiguration.getColor(self)
borderlineView.isHidden = false
} else {
borderlineView.isHidden = true
}
}
} }

View File

@ -73,12 +73,12 @@ open class EntryField: Control, Changeable {
// Sizes are from InVision design specs. // Sizes are from InVision design specs.
internal var containerSize: CGSize { CGSize(width: 45, height: 44) } internal var containerSize: CGSize { CGSize(width: 45, height: 44) }
internal let primaryColorConfig = ViewColorConfiguration().with { internal let primaryColorConfiguration = ViewColorConfiguration().with {
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forDisabled: true) $0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forDisabled: true)
$0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forDisabled: false) $0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forDisabled: false)
} }
internal let secondaryColorConfig = ViewColorConfiguration().with { internal let secondaryColorConfiguration = ViewColorConfiguration().with {
$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)
} }
@ -218,9 +218,9 @@ open class EntryField: Control, Changeable {
.pinLeading() .pinLeading()
.trailingAnchor.constraint(lessThanOrEqualTo: trailingAnchor).isActive = true .trailingAnchor.constraint(lessThanOrEqualTo: trailingAnchor).isActive = true
titleLabel.textColorConfiguration = primaryColorConfig.eraseToAnyColorable() titleLabel.textColorConfiguration = primaryColorConfiguration.eraseToAnyColorable()
errorLabel.textColorConfiguration = primaryColorConfig.eraseToAnyColorable() errorLabel.textColorConfiguration = primaryColorConfiguration.eraseToAnyColorable()
helperLabel.textColorConfiguration = secondaryColorConfig.eraseToAnyColorable() helperLabel.textColorConfiguration = secondaryColorConfiguration.eraseToAnyColorable()
} }
open func getContainer() -> UIView { open func getContainer() -> UIView {

View File

@ -133,7 +133,7 @@ open class InputField: EntryField, UITextFieldDelegate {
stackView.addArrangedSubview(successLabel) stackView.addArrangedSubview(successLabel)
stackView.setCustomSpacing(8, after: successLabel) stackView.setCustomSpacing(8, after: successLabel)
successLabel.textColorConfiguration = primaryColorConfig.eraseToAnyColorable() successLabel.textColorConfiguration = primaryColorConfiguration.eraseToAnyColorable()
backgroundColorConfiguration.setSurfaceColors(VDSColor.feedbackSuccessBackgroundOnlight, VDSColor.feedbackSuccessBackgroundOndark, forState: .success) backgroundColorConfiguration.setSurfaceColors(VDSColor.feedbackSuccessBackgroundOnlight, VDSColor.feedbackSuccessBackgroundOndark, forState: .success)
borderColorConfiguration.setSurfaceColors(VDSColor.feedbackSuccessOnlight, VDSColor.feedbackSuccessOndark, forState: .success) borderColorConfiguration.setSurfaceColors(VDSColor.feedbackSuccessOnlight, VDSColor.feedbackSuccessOndark, forState: .success)

View File

@ -209,19 +209,19 @@ open class TileContainer: Control {
//-------------------------------------------------- //--------------------------------------------------
private let cornerRadius = VDSFormControls.borderradius * 2 private let cornerRadius = VDSFormControls.borderradius * 2
private var backgroundColorConfig = BackgroundColorConfiguration() private var backgroundColorConfiguration = BackgroundColorConfiguration()
private var borderColorConfig = SurfaceColorConfiguration().with { private var borderColorConfiguration = SurfaceColorConfiguration().with {
$0.lightColor = VDSColor.elementsLowcontrastOnlight $0.lightColor = VDSColor.elementsLowcontrastOnlight
$0.darkColor = VDSColor.elementsLowcontrastOndark $0.darkColor = VDSColor.elementsLowcontrastOndark
} }
private var imageFallbackColorConfig = SurfaceColorConfiguration().with { private var imageFallbackColorConfiguration = SurfaceColorConfiguration().with {
$0.lightColor = VDSColor.backgroundPrimaryLight $0.lightColor = VDSColor.backgroundPrimaryLight
$0.darkColor = VDSColor.backgroundPrimaryDark $0.darkColor = VDSColor.backgroundPrimaryDark
} }
private var hightLightViewColorConfig = SurfaceColorConfiguration().with { private var hightLightViewColorConfiguration = SurfaceColorConfiguration().with {
$0.lightColor = VDSColor.paletteWhite.withAlphaComponent(0.3) $0.lightColor = VDSColor.paletteWhite.withAlphaComponent(0.3)
$0.darkColor = VDSColor.paletteBlack.withAlphaComponent(0.3) $0.darkColor = VDSColor.paletteBlack.withAlphaComponent(0.3)
} }
@ -265,19 +265,19 @@ open class TileContainer: Control {
open override func updateView() { open override func updateView() {
super.updateView() super.updateView()
highlightView.backgroundColor = hightLightViewColorConfig.getColor(self) highlightView.backgroundColor = hightLightViewColorConfiguration.getColor(self)
highlightView.isHidden = !isHighlighted highlightView.isHidden = !isHighlighted
if let backgroundImage { if let backgroundImage {
backgroundImageView.image = backgroundImage backgroundImageView.image = backgroundImage
backgroundImageView.isHidden = false backgroundImageView.isHidden = false
backgroundColor = imageFallbackColorConfig.getColor(self) backgroundColor = imageFallbackColorConfiguration.getColor(self)
} else { } else {
backgroundImageView.isHidden = true backgroundImageView.isHidden = true
backgroundColor = backgroundColorConfig.getColor(self) backgroundColor = backgroundColorConfiguration.getColor(self)
} }
layer.borderColor = borderColorConfig.getColor(self).cgColor layer.borderColor = borderColorConfiguration.getColor(self).cgColor
layer.borderWidth = showBorder ? VDSFormControls.widthBorder : 0 layer.borderWidth = showBorder ? VDSFormControls.widthBorder : 0
containerTopConstraint?.constant = padding.value containerTopConstraint?.constant = padding.value

View File

@ -61,27 +61,27 @@ open class Tooltip: Control, TooltipLaunchable {
switch fillColor { switch fillColor {
case .primary: case .primary:
return primaryColorConfig.eraseToAnyColorable() return primaryColorConfiguration.eraseToAnyColorable()
case .secondary: case .secondary:
return secondaryColorConfig.eraseToAnyColorable() return secondaryColorConfiguration.eraseToAnyColorable()
case .brandHighlight: case .brandHighlight:
return brandHighlightColorConfig.eraseToAnyColorable() return brandHighlightColorConfiguration.eraseToAnyColorable()
} }
} }
private var primaryColorConfig = ControlColorConfiguration().with { private var primaryColorConfiguration = ControlColorConfiguration().with {
$0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forState: .normal) $0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forState: .normal)
$0.setSurfaceColors(VDSColor.interactiveActiveOnlight, VDSColor.interactiveActiveOndark, forState: .highlighted) $0.setSurfaceColors(VDSColor.interactiveActiveOnlight, VDSColor.interactiveActiveOndark, forState: .highlighted)
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forState: .disabled) $0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forState: .disabled)
} }
private var secondaryColorConfig = ControlColorConfiguration().with { private var secondaryColorConfiguration = ControlColorConfiguration().with {
$0.setSurfaceColors(VDSColor.elementsSecondaryOnlight, VDSColor.elementsSecondaryOndark, forState: .normal) $0.setSurfaceColors(VDSColor.elementsSecondaryOnlight, VDSColor.elementsSecondaryOndark, forState: .normal)
$0.setSurfaceColors(VDSColor.paletteGray65, VDSColor.paletteGray65, forState: .highlighted) $0.setSurfaceColors(VDSColor.paletteGray65, VDSColor.paletteGray65, forState: .highlighted)
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forState: .disabled) $0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forState: .disabled)
} }
private var brandHighlightColorConfig = ControlColorConfiguration().with { private var brandHighlightColorConfiguration = ControlColorConfiguration().with {
$0.setSurfaceColors(VDSColor.elementsBrandhighlight, VDSColor.elementsBrandhighlight, forState: .normal) $0.setSurfaceColors(VDSColor.elementsBrandhighlight, VDSColor.elementsBrandhighlight, forState: .normal)
$0.setSurfaceColors(VDSColor.elementsBrandhighlight, VDSColor.elementsBrandhighlight, forState: .highlighted) $0.setSurfaceColors(VDSColor.elementsBrandhighlight, VDSColor.elementsBrandhighlight, forState: .highlighted)
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forState: .disabled) $0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forState: .disabled)

View File

@ -1,3 +1,10 @@
1.0.22
=======
- CXTDT-423133 - Tabs - Indicator should overlap Border
- CXTDT-423092 - Tabs - Top-aligned version should have line top also
- CXTDT-423141 - Tabs - Incorrect spacing on top-aligned Fill containe
- CXTDT-422872 - Text Link - spacing issue between text and underline
1.0.21 1.0.21
======= =======
- CXTDT-412383 - Label - Disabled Font color - CXTDT-412383 - Label - Disabled Font color