Merge branch 'mbruce/bugfixes' into 'develop'
bug fix merge See merge request BPHV_MIPS/vds_ios!106
This commit is contained in:
commit
0a35fd22ad
@ -15,6 +15,7 @@
|
||||
EA0B18022A9E236900F2D0CD /* SelectorGroupBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA0B18012A9E236900F2D0CD /* SelectorGroupBase.swift */; };
|
||||
EA0B18052A9E2D2D00F2D0CD /* SelectorBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA0B18032A9E2D2D00F2D0CD /* SelectorBase.swift */; };
|
||||
EA0B18062A9E2D2D00F2D0CD /* SelectorItemBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA0B18042A9E2D2D00F2D0CD /* SelectorItemBase.swift */; };
|
||||
EA0B180A2AA78F9000F2D0CD /* UIEdgeInsets.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA0B18092AA78F9000F2D0CD /* UIEdgeInsets.swift */; };
|
||||
EA0D1C372A681CCE00E5C127 /* ToggleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA0D1C362A681CCE00E5C127 /* ToggleView.swift */; };
|
||||
EA0D1C392A6AD4DF00E5C127 /* Typography+SpacingConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA0D1C382A6AD4DF00E5C127 /* Typography+SpacingConfig.swift */; };
|
||||
EA0D1C3B2A6AD51B00E5C127 /* Typogprahy+Styles.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA0D1C3A2A6AD51B00E5C127 /* Typogprahy+Styles.swift */; };
|
||||
@ -160,6 +161,7 @@
|
||||
EA0B18012A9E236900F2D0CD /* SelectorGroupBase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SelectorGroupBase.swift; sourceTree = "<group>"; };
|
||||
EA0B18032A9E2D2D00F2D0CD /* SelectorBase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SelectorBase.swift; sourceTree = "<group>"; };
|
||||
EA0B18042A9E2D2D00F2D0CD /* SelectorItemBase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SelectorItemBase.swift; sourceTree = "<group>"; };
|
||||
EA0B18092AA78F9000F2D0CD /* UIEdgeInsets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIEdgeInsets.swift; sourceTree = "<group>"; };
|
||||
EA0D1C362A681CCE00E5C127 /* ToggleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToggleView.swift; sourceTree = "<group>"; };
|
||||
EA0D1C382A6AD4DF00E5C127 /* Typography+SpacingConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Typography+SpacingConfig.swift"; sourceTree = "<group>"; };
|
||||
EA0D1C3A2A6AD51B00E5C127 /* Typogprahy+Styles.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Typogprahy+Styles.swift"; sourceTree = "<group>"; };
|
||||
@ -478,6 +480,7 @@
|
||||
EA3361A7288B23300071C351 /* UIColor.swift */,
|
||||
EA81410F2A127066004F60D2 /* UIColor+VDSColor.swift */,
|
||||
EA33623D2892EE950071C351 /* UIDevice.swift */,
|
||||
EA0B18092AA78F9000F2D0CD /* UIEdgeInsets.swift */,
|
||||
EAF7F0B6289C12A600B287F5 /* UITapGestureRecognizer.swift */,
|
||||
EA8E40902A7D3F6300934ED3 /* UIView+Accessibility.swift */,
|
||||
EAB5FED329267EB300998C17 /* UIView+NSLayoutConstraint.swift */,
|
||||
@ -982,6 +985,7 @@
|
||||
EAF978212A99035B00C2FEA9 /* Enabling.swift in Sources */,
|
||||
EA5E3058295105A40082B959 /* Tilelet.swift in Sources */,
|
||||
EA89201528B56CF4006B9984 /* RadioBoxGroup.swift in Sources */,
|
||||
EA0B180A2AA78F9000F2D0CD /* UIEdgeInsets.swift in Sources */,
|
||||
EA985C1D296CD13600F2FF2E /* BundleManager.swift in Sources */,
|
||||
EA0B18052A9E2D2D00F2D0CD /* SelectorBase.swift in Sources */,
|
||||
EAC71A1D2A2E155A00E47A9F /* Checkbox.swift in Sources */,
|
||||
@ -1167,7 +1171,7 @@
|
||||
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 40;
|
||||
CURRENT_PROJECT_VERSION = 41;
|
||||
DEFINES_MODULE = YES;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
@ -1204,7 +1208,7 @@
|
||||
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 40;
|
||||
CURRENT_PROJECT_VERSION = 41;
|
||||
DEFINES_MODULE = YES;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
|
||||
@ -106,7 +106,11 @@ open class SelectorGroupBase<SelectorItemType: Control>: Control, SelectorGroup,
|
||||
super.setup()
|
||||
|
||||
addSubview(mainStackView)
|
||||
mainStackView.pinToSuperView()
|
||||
mainStackView
|
||||
.pinTop()
|
||||
.pinLeading()
|
||||
.pinTrailing()
|
||||
.pinBottom(0, .defaultHigh)
|
||||
}
|
||||
|
||||
/// Handler for the Group to override on a select event.
|
||||
|
||||
@ -178,7 +178,11 @@ open class SelectorItemBase<Selector: SelectorControlable>: Control, Errorable,
|
||||
selectorStackView.addArrangedSubview(selectorLabelStackView)
|
||||
selectorLabelStackView.addArrangedSubview(label)
|
||||
selectorLabelStackView.addArrangedSubview(childLabel)
|
||||
mainStackView.pinToSuperView()
|
||||
mainStackView
|
||||
.pinTop()
|
||||
.pinLeading()
|
||||
.pinTrailing()
|
||||
.pinBottom(0, .defaultHigh)
|
||||
}
|
||||
|
||||
/// Used to make changes to the View based off a change events or from local properties.
|
||||
|
||||
@ -126,7 +126,7 @@ open class BadgeIndicator: View {
|
||||
case .small:
|
||||
break
|
||||
}
|
||||
return .init(top: verticalPadding, left: horizontalPadding, bottom: verticalPadding, right: horizontalPadding)
|
||||
return .axis(horizontal: horizontalPadding, vertical: verticalPadding)
|
||||
}
|
||||
|
||||
}
|
||||
@ -193,7 +193,7 @@ open class BadgeIndicator: View {
|
||||
open var verticalPadding: CGFloat? { didSet { setNeedsUpdate() } }
|
||||
|
||||
/// Sets the padding at the left/right of the label.
|
||||
open var horitonalPadding: CGFloat? { didSet { setNeedsUpdate() } }
|
||||
open var horizontalPadding: CGFloat? { didSet { setNeedsUpdate() } }
|
||||
|
||||
/// Hides the dot when you are in Kind.simple mode.
|
||||
open var hideDot: Bool = false { didSet { setNeedsUpdate() } }
|
||||
@ -217,12 +217,13 @@ open class BadgeIndicator: View {
|
||||
private var badgeSize: CGFloat { max(minSize, size.textStyle.font.lineHeight) }
|
||||
private var labelEdgeInset: UIEdgeInsets {
|
||||
var newInset = size.edgeInset
|
||||
if let verticalPadding, let horitonalPadding {
|
||||
newInset = .init(top: verticalPadding, left: horitonalPadding, bottom: verticalPadding, right: horitonalPadding)
|
||||
if let verticalPadding, let horizontalPadding {
|
||||
newInset = .init(top: verticalPadding, left: horizontalPadding, bottom: verticalPadding, right: horizontalPadding)
|
||||
newInset = .axis(horizontal: horizontalPadding, vertical: verticalPadding)
|
||||
} else if let verticalPadding {
|
||||
newInset = .init(top: verticalPadding, left: newInset.left, bottom: verticalPadding, right: newInset.right)
|
||||
} else if let horitonalPadding {
|
||||
newInset = .init(top: newInset.top, left: horitonalPadding, bottom: newInset.bottom, right: horitonalPadding)
|
||||
} else if let horizontalPadding {
|
||||
newInset = .init(top: newInset.top, left: horizontalPadding, bottom: newInset.bottom, right: horizontalPadding)
|
||||
}
|
||||
|
||||
return newInset
|
||||
@ -276,8 +277,12 @@ open class BadgeIndicator: View {
|
||||
widthConstraint = badgeView.widthGreaterThanEqualTo(constant: badgeSize)
|
||||
|
||||
//we are insetting the padding to compensate for the border
|
||||
badgeView.pinToSuperView(.init(top: borderWidth, left: borderWidth, bottom: borderWidth, right: borderWidth))
|
||||
|
||||
badgeView
|
||||
.pinTop(borderWidth)
|
||||
.pinLeading(borderWidth)
|
||||
.pinTrailing(borderWidth, .defaultHigh)
|
||||
.pinBottom(borderWidth, .defaultHigh)
|
||||
|
||||
labelContraints.topConstraint = label.pinTopGreaterThanOrEqualTo(anchor: badgeView.topAnchor)
|
||||
labelContraints.bottomConstraint = label.pinBottomGreaterThanOrEqualTo(anchor: badgeView.bottomAnchor)
|
||||
labelContraints.leadingConstraint = label.pinLeadingGreaterThanOrEqualTo(anchor: badgeView.leadingAnchor)
|
||||
|
||||
@ -126,7 +126,7 @@ extension TextLinkCaret {
|
||||
}
|
||||
|
||||
func setAttribute(on attributedString: NSMutableAttributedString) {
|
||||
let imageAttr = ImageLabelAttribute(location: location, imageName: "\(position.rawValue)-caret-bold", frame: .init(x: 0, y: 0, width: caretSize.width, height: caretSize.height), tintColor: tintColor, accessibleText: "Caret")
|
||||
let imageAttr = ImageLabelAttribute(location: location, imageName: "\(position.rawValue)-caret-bold", frame: .init(x: 0, y: 0, width: caretSize.width, height: caretSize.height), tintColor: tintColor)
|
||||
let spacer = NSAttributedString.spacer(for: spacerWidth)
|
||||
|
||||
guard let image = try? imageAttr.getAttachment() else { return }
|
||||
|
||||
@ -264,7 +264,11 @@ open class ButtonIcon: Control {
|
||||
layoutGuideHeightConstraint = iconLayoutGuide.height(constant: size.containerSize)
|
||||
|
||||
//pin layout guide
|
||||
iconLayoutGuide.pinToSuperView()
|
||||
iconLayoutGuide
|
||||
.pinTop()
|
||||
.pinLeading()
|
||||
.pinTrailing(0, .defaultHigh)
|
||||
.pinBottom(0, .defaultHigh)
|
||||
|
||||
//determines the center point of the icon
|
||||
centerXConstraint = icon.centerXAnchor.constraint(equalTo: iconLayoutGuide.centerXAnchor, constant: 0)
|
||||
|
||||
@ -221,15 +221,24 @@ open class Notification: 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()
|
||||
addSubview(mainStackView)
|
||||
mainStackView.pinToSuperView(.init(top: edgeSpacing, left: edgeSpacing, bottom: edgeSpacing, right: edgeSpacing))
|
||||
|
||||
let layoutGuide = UILayoutGuide()
|
||||
addLayoutGuide(layoutGuide)
|
||||
layoutGuide
|
||||
.pinTop(0)
|
||||
.pinLeading(0)
|
||||
.pinTrailing(0, .defaultHigh)
|
||||
.pinBottom(0, .defaultHigh)
|
||||
|
||||
addSubview(mainStackView)
|
||||
mainStackView.pin(layoutGuide, with: .uniform(edgeSpacing))
|
||||
|
||||
NSLayoutConstraint.activate([
|
||||
heightAnchor.constraint(greaterThanOrEqualToConstant: minViewHeight),
|
||||
layoutGuide.heightAnchor.constraint(greaterThanOrEqualToConstant: minViewHeight),
|
||||
mainStackView.heightAnchor.constraint(greaterThanOrEqualToConstant: minContentHeight),
|
||||
widthAnchor.constraint(greaterThanOrEqualToConstant: minViewWidth)
|
||||
layoutGuide.widthAnchor.constraint(greaterThanOrEqualToConstant: minViewWidth)
|
||||
])
|
||||
maxWidthConstraint = widthAnchor.constraint(lessThanOrEqualToConstant: maxViewWidth)
|
||||
maxWidthConstraint = layoutGuide.widthAnchor.constraint(lessThanOrEqualToConstant: maxViewWidth)
|
||||
|
||||
labelButtonView.addArrangedSubview(labelsView)
|
||||
|
||||
|
||||
@ -194,8 +194,13 @@ open class RadioBoxItem: Control, Changeable, FormFieldable {
|
||||
selectorLeftLabelStackView.addArrangedSubview(textLabel)
|
||||
selectorLeftLabelStackView.addArrangedSubview(subTextLabel)
|
||||
|
||||
selectorView.pinToSuperView()
|
||||
mainStackView.pinToSuperView(.init(top: 16, left: 16, bottom: 16, right: 16))
|
||||
selectorView
|
||||
.pinTop()
|
||||
.pinLeading()
|
||||
.pinTrailing(0, .defaultHigh)
|
||||
.pinBottom(0, .defaultHigh)
|
||||
|
||||
mainStackView.pinToSuperView(.uniform(16))
|
||||
}
|
||||
|
||||
/// Resets to default settings.
|
||||
|
||||
@ -73,18 +73,6 @@ open class RadioButtonGroup: SelectorGroupBase<RadioButtonItem>, SelectorGroupSi
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Overrides
|
||||
//--------------------------------------------------
|
||||
/// 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()
|
||||
|
||||
addSubview(mainStackView)
|
||||
|
||||
mainStackView.pinToSuperView()
|
||||
}
|
||||
|
||||
public override func didSelect(_ selectedControl: RadioButtonItem) {
|
||||
if let selectedItem {
|
||||
updateToggle(selectedItem)
|
||||
|
||||
@ -189,10 +189,12 @@ open class EntryFieldBase: Control, Changeable {
|
||||
|
||||
//create the wrapping view
|
||||
heightConstraint = containerView.heightAnchor.constraint(greaterThanOrEqualToConstant: containerSize.height)
|
||||
widthConstraint?.priority = .defaultHigh
|
||||
heightConstraint?.isActive = true
|
||||
|
||||
widthConstraint = containerView.widthAnchor.constraint(equalToConstant: 0)
|
||||
|
||||
widthConstraint?.priority = .defaultHigh
|
||||
|
||||
//get the container this is what is color
|
||||
//border, internal, etc...
|
||||
let container = getContainer()
|
||||
@ -201,7 +203,7 @@ open class EntryFieldBase: Control, Changeable {
|
||||
//this is the horizontal stack that contains
|
||||
//the left, InputContainer, Icons, Buttons
|
||||
container.addSubview(containerStackView)
|
||||
containerStackView.pinToSuperView(.init(top: 12, left: 12, bottom: 12, right: 12))
|
||||
containerStackView.pinToSuperView(.uniform(12))
|
||||
|
||||
//add the view to add input fields
|
||||
containerStackView.addArrangedSubview(controlContainerView)
|
||||
@ -218,9 +220,9 @@ open class EntryFieldBase: Control, Changeable {
|
||||
|
||||
stackView
|
||||
.pinTop()
|
||||
.pinBottom()
|
||||
.pinLeading()
|
||||
.trailingAnchor.constraint(lessThanOrEqualTo: trailingAnchor).isActive = true
|
||||
.pinTrailing(0, .defaultHigh)
|
||||
.pinBottom(0, .defaultHigh)
|
||||
|
||||
titleLabel.textColorConfiguration = primaryColorConfiguration.eraseToAnyColorable()
|
||||
errorLabel.textColorConfiguration = primaryColorConfiguration.eraseToAnyColorable()
|
||||
|
||||
@ -129,7 +129,12 @@ open class InputField: EntryFieldBase, UITextFieldDelegate {
|
||||
minWidthConstraint?.isActive = true
|
||||
|
||||
controlContainerView.addSubview(textField)
|
||||
textField.pinToSuperView()
|
||||
textField
|
||||
.pinTop()
|
||||
.pinLeading()
|
||||
.pinTrailingLessThanOrEqualTo(nil, 0, .defaultHigh)
|
||||
.pinBottom(0, .defaultHigh)
|
||||
|
||||
textField.heightAnchor.constraint(equalToConstant: 20).isActive = true
|
||||
textField
|
||||
.textPublisher
|
||||
|
||||
@ -76,7 +76,12 @@ open class TextArea: EntryFieldBase {
|
||||
minWidthConstraint?.isActive = true
|
||||
|
||||
controlContainerView.addSubview(textView)
|
||||
textView.pinToSuperView()
|
||||
textView
|
||||
.pinTop()
|
||||
.pinLeading()
|
||||
.pinTrailingLessThanOrEqualTo(nil, 0, .defaultHigh)
|
||||
.pinBottom(0, .defaultHigh)
|
||||
|
||||
textViewHeightConstraint = textView.heightAnchor.constraint(greaterThanOrEqualToConstant: 64)
|
||||
textViewHeightConstraint?.isActive = true
|
||||
backgroundColorConfiguration.setSurfaceColors(VDSColor.feedbackSuccessBackgroundOnlight, VDSColor.feedbackSuccessBackgroundOndark, forState: .success)
|
||||
|
||||
@ -187,29 +187,40 @@ open class TileContainer: Control {
|
||||
/// 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()
|
||||
|
||||
let layoutGuide = UILayoutGuide()
|
||||
addLayoutGuide(layoutGuide)
|
||||
layoutGuide
|
||||
.pinTop()
|
||||
.pinLeading()
|
||||
.pinTrailing(0, .defaultHigh)
|
||||
.pinBottom(0, .defaultHigh)
|
||||
|
||||
addSubview(backgroundImageView)
|
||||
addSubview(containerView)
|
||||
addSubview(highlightView)
|
||||
|
||||
widthConstraint = widthAnchor.constraint(equalToConstant: 0)
|
||||
|
||||
widthConstraint = layoutGuide.widthAnchor.constraint(equalToConstant: 0)
|
||||
widthConstraint?.priority = .defaultHigh
|
||||
|
||||
heightGreaterThanConstraint = heightAnchor.constraint(greaterThanOrEqualToConstant: 44.0)
|
||||
heightGreaterThanConstraint = layoutGuide.heightAnchor.constraint(greaterThanOrEqualToConstant: 44.0)
|
||||
heightGreaterThanConstraint?.isActive = false
|
||||
|
||||
heightConstraint = heightAnchor.constraint(equalToConstant: 0)
|
||||
|
||||
backgroundImageView.pinToSuperView()
|
||||
heightConstraint = layoutGuide.heightAnchor.constraint(equalToConstant: 0)
|
||||
heightConstraint?.priority = .defaultHigh
|
||||
|
||||
backgroundImageView.pin(layoutGuide)
|
||||
backgroundImageView.isUserInteractionEnabled = false
|
||||
backgroundImageView.isHidden = true
|
||||
|
||||
|
||||
containerView.backgroundColor = .clear
|
||||
|
||||
containerTopConstraint = containerView.pinTop(anchor: topAnchor, constant: padding.value)
|
||||
containerBottomConstraint = containerView.pinBottom(anchor: bottomAnchor, constant: padding.value)
|
||||
containerLeadingConstraint = containerView.pinLeading(anchor: leadingAnchor, constant: padding.value)
|
||||
containerTrailingConstraint = containerView.pinTrailing(anchor: trailingAnchor, constant: padding.value)
|
||||
containerTopConstraint = containerView.pinTop(anchor: layoutGuide.topAnchor, constant: padding.value)
|
||||
containerBottomConstraint = containerView.pinBottom(anchor: layoutGuide.bottomAnchor, constant: padding.value)
|
||||
containerLeadingConstraint = containerView.pinLeading(anchor: layoutGuide.leadingAnchor, constant: padding.value)
|
||||
containerTrailingConstraint = containerView.pinTrailing(anchor: layoutGuide.trailingAnchor, constant: padding.value)
|
||||
|
||||
highlightView.pinToSuperView()
|
||||
highlightView.pin(layoutGuide)
|
||||
highlightView.isHidden = true
|
||||
highlightView.backgroundColor = .clear
|
||||
|
||||
|
||||
@ -213,7 +213,6 @@ open class Tilelet: TileContainer {
|
||||
/// 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()
|
||||
width = 100
|
||||
aspectRatio = .none
|
||||
color = .black
|
||||
addContentView(stackView)
|
||||
|
||||
@ -191,20 +191,20 @@ open class ToggleView: Control, Changeable, FormFieldable {
|
||||
|
||||
shadowLayer1.frame = knobView.bounds
|
||||
shadowLayer2.frame = knobView.bounds
|
||||
|
||||
let shadowColor = isEnabled ? VDSColor.paletteBlack.cgColor : VDSColor.paletteGray95.cgColor
|
||||
|
||||
let shadowColor = VDSColor.paletteBlack.cgColor
|
||||
shadowLayer1.cornerRadius = knobView.layer.cornerRadius
|
||||
shadowLayer1.shadowColor = shadowColor
|
||||
shadowLayer1.shadowOpacity = isEnabled ? 0.24 : 0.1
|
||||
shadowLayer1.shadowRadius = 10.0
|
||||
shadowLayer1.shadowOffset = .init(width: 0, height: 1)
|
||||
shadowLayer1.shadowRadius = isEnabled ? 5.0 : 10.0
|
||||
shadowLayer1.shadowOpacity = isEnabled ? 0.24 : 0.12
|
||||
|
||||
shadowLayer2.cornerRadius = knobView.layer.cornerRadius
|
||||
shadowLayer2.shadowColor = shadowColor
|
||||
shadowLayer2.shadowOpacity = isEnabled ? 0.08 : 0.04
|
||||
shadowLayer2.shadowOffset = .init(width: 0, height: 2)
|
||||
shadowLayer2.shadowRadius = 2.0
|
||||
|
||||
shadowLayer2.shadowOffset = .init(width: 0, height: 2)
|
||||
shadowLayer2.shadowOpacity = isEnabled ? 0.08 : 0.04
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
|
||||
@ -177,9 +177,9 @@ open class Tooltip: Control, TooltipLaunchable {
|
||||
if let label, !label.isEmpty {
|
||||
accessibilityLabel = label
|
||||
} else {
|
||||
accessibilityLabel = "Tooltip"
|
||||
accessibilityLabel = "Modal"
|
||||
}
|
||||
accessibilityHint = isEnabled ? "Click to open Tooltip." : ""
|
||||
accessibilityHint = isEnabled ? "Double tap to open." : ""
|
||||
accessibilityValue = "collapsed"
|
||||
}
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@ open class TooltipDialog: View, UIScrollViewDelegate {
|
||||
}
|
||||
|
||||
lazy var primaryAccessibilityElement = UIAccessibilityElement(accessibilityContainer: self).with {
|
||||
$0.accessibilityLabel = "Tooltip"
|
||||
$0.accessibilityLabel = "Modal"
|
||||
$0.accessibilityValue = "expanded"
|
||||
$0.accessibilityFrameInContainerSpace = .init(origin: .zero, size: .init(width: fullWidth, height: VDSLayout.Spacing.space1X.value))
|
||||
}
|
||||
@ -181,10 +181,12 @@ open class TooltipDialog: View, UIScrollViewDelegate {
|
||||
}
|
||||
let wrapper = View()
|
||||
wrapper.addSubview(contentView)
|
||||
contentView.pinTop()
|
||||
contentView.pinLeading()
|
||||
contentView.pinBottom()
|
||||
contentView.pinTrailingLessThanOrEqualTo()
|
||||
contentView
|
||||
.pinTop()
|
||||
.pinLeading()
|
||||
.pinBottom()
|
||||
.pinTrailingLessThanOrEqualTo()
|
||||
|
||||
contentView.setNeedsLayout()
|
||||
contentStackView.addArrangedSubview(wrapper)
|
||||
addedContent = true
|
||||
@ -232,7 +234,7 @@ open class TooltipDialog: View, UIScrollViewDelegate {
|
||||
open override func updateAccessibility() {
|
||||
super.updateAccessibility()
|
||||
|
||||
primaryAccessibilityElement.accessibilityHint = "Click on the \(closeButtonText) button to close."
|
||||
primaryAccessibilityElement.accessibilityHint = "Double tap on the \(closeButtonText) button to close."
|
||||
|
||||
var elements: [Any] = [primaryAccessibilityElement]
|
||||
contentStackView.arrangedSubviews.forEach{ elements.append($0) }
|
||||
|
||||
49
VDS/Extensions/UIEdgeInsets.swift
Normal file
49
VDS/Extensions/UIEdgeInsets.swift
Normal file
@ -0,0 +1,49 @@
|
||||
//
|
||||
// UIEdgeInset.swift
|
||||
// VDS
|
||||
//
|
||||
// Created by Matt Bruce on 9/5/23.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import UIKit
|
||||
|
||||
extension UIEdgeInsets {
|
||||
|
||||
public static func uniform(_ value: CGFloat) -> UIEdgeInsets {
|
||||
return UIEdgeInsets(top: value, left: value, bottom: value, right: value)
|
||||
}
|
||||
|
||||
public static func top(_ value: CGFloat) -> UIEdgeInsets {
|
||||
return UIEdgeInsets(top: value, left: 0, bottom: 0, right: 0)
|
||||
}
|
||||
|
||||
public static func left(_ value: CGFloat) -> UIEdgeInsets {
|
||||
return UIEdgeInsets(top: 0, left: value, bottom: 0, right: 0)
|
||||
}
|
||||
|
||||
public static func bottom(_ value: CGFloat) -> UIEdgeInsets {
|
||||
return UIEdgeInsets(top: 0, left: 0, bottom: value, right: 0)
|
||||
}
|
||||
|
||||
public static func right(_ value: CGFloat) -> UIEdgeInsets {
|
||||
return UIEdgeInsets(top: 0, left: 0, bottom: 0, right: value)
|
||||
}
|
||||
|
||||
public static func horizontal(_ value: CGFloat) -> UIEdgeInsets {
|
||||
return UIEdgeInsets(top: 0, left: value, bottom: 0, right: value)
|
||||
}
|
||||
|
||||
public static func vertical(_ value: CGFloat) -> UIEdgeInsets {
|
||||
return UIEdgeInsets(top: value, left: 0, bottom: value, right: 0)
|
||||
}
|
||||
|
||||
public static func axis(horizontal: CGFloat, vertical: CGFloat) -> UIEdgeInsets {
|
||||
return UIEdgeInsets(top: vertical, left: horizontal, bottom: vertical, right: horizontal)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public func + (lhs: UIEdgeInsets, rhs: UIEdgeInsets) -> UIEdgeInsets {
|
||||
return .init(top: lhs.top + rhs.top, left: lhs.left + rhs.left, bottom: lhs.bottom + rhs.bottom, right: lhs.right + rhs.right)
|
||||
}
|
||||
@ -31,19 +31,19 @@ extension LayoutConstraintable {
|
||||
@discardableResult
|
||||
/// Pins each to the all 4 anchor points to a view.
|
||||
/// - Parameters:
|
||||
/// - view: View that you will be pinned within.
|
||||
/// - layoutConstrainable: LayoutConstrainable that you will be pinned within.
|
||||
/// - edges: Insets for each side.
|
||||
/// - Returns: Yourself.
|
||||
public func pin(_ view: UIView, with edges: UIEdgeInsets = UIEdgeInsets.zero) -> Self {
|
||||
pinLeading(view.leadingAnchor, edges.left)
|
||||
pinTrailing(view.trailingAnchor, edges.right)
|
||||
pinTop(view.topAnchor, edges.top)
|
||||
pinBottom(view.bottomAnchor, edges.bottom)
|
||||
public func pin(_ layoutConstrainable: LayoutConstraintable, with edges: UIEdgeInsets = UIEdgeInsets.zero) -> Self {
|
||||
pinLeading(layoutConstrainable.leadingAnchor, edges.left)
|
||||
pinTrailing(layoutConstrainable.trailingAnchor, edges.right)
|
||||
pinTop(layoutConstrainable.topAnchor, edges.top)
|
||||
pinBottom(layoutConstrainable.bottomAnchor, edges.bottom)
|
||||
return self
|
||||
}
|
||||
|
||||
|
||||
|
||||
@discardableResult
|
||||
|
||||
/// Pins each to the all 4 anchor points to the view you are set within.
|
||||
/// - Parameter edges: Insets for each side.
|
||||
/// - Returns: Yourself.
|
||||
|
||||
@ -1,6 +1,12 @@
|
||||
1.0.41
|
||||
=======
|
||||
- CXTDT-457899 - Tabs - Incorrect nonselected color on Dark surface
|
||||
- ONEAPP-4652 - TextLinkCaret - Caret anouncement removed
|
||||
- Fixed ToggleView Disabled Shadow Color
|
||||
- Fixed several component layout issues
|
||||
- Fixed bug in label for ActionLabelAttribute
|
||||
- Updated naming conventions for TextPosition to TextAlignment in regards to alignment properties
|
||||
- Added a ton of Code Documentation
|
||||
|
||||
1.0.40
|
||||
=======
|
||||
|
||||
@ -17,79 +17,79 @@ extension TextStyle {
|
||||
fontFace: .edsBold,
|
||||
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature144 : VDSTypography.fontSizeFeature96,
|
||||
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature136 : VDSTypography.lineHeightFeature88,
|
||||
edgeInsets: .init(bottom: UIDevice.isIPad ? -6: -4))
|
||||
edgeInsets: .bottom(UIDevice.isIPad ? -6: -4))
|
||||
|
||||
public static let featureXLarge = TextStyle(rawValue: "featureXLarge",
|
||||
fontFace: .dsLight,
|
||||
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature144 : VDSTypography.fontSizeFeature96,
|
||||
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature136 : VDSTypography.lineHeightFeature88,
|
||||
letterSpacing: VDSTypography.letterSpacingSemiWide,
|
||||
edgeInsets: .init(bottom: UIDevice.isIPad ? -6: -4))
|
||||
edgeInsets: .bottom(UIDevice.isIPad ? -6: -4))
|
||||
|
||||
public static let boldFeatureLarge = TextStyle(rawValue: "boldFeatureLarge",
|
||||
fontFace: .edsBold,
|
||||
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature128 : VDSTypography.fontSizeFeature80,
|
||||
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature120 : VDSTypography.lineHeightFeature76,
|
||||
edgeInsets: .init(bottom: UIDevice.isIPad ? -6: -2))
|
||||
edgeInsets: .bottom(UIDevice.isIPad ? -6: -2))
|
||||
|
||||
public static let featureLarge = TextStyle(rawValue: "featureLarge",
|
||||
fontFace: .dsLight,
|
||||
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature128 : VDSTypography.fontSizeFeature80,
|
||||
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature120 : VDSTypography.lineHeightFeature76,
|
||||
letterSpacing: VDSTypography.letterSpacingSemiWide,
|
||||
edgeInsets: .init(bottom: UIDevice.isIPad ? -6: -2))
|
||||
edgeInsets: .bottom(UIDevice.isIPad ? -6: -2))
|
||||
|
||||
public static let boldFeatureMedium = TextStyle(rawValue: "boldFeatureMedium",
|
||||
fontFace: .edsBold,
|
||||
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature96 : VDSTypography.fontSizeFeature64,
|
||||
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature88 : VDSTypography.lineHeightFeature64,
|
||||
edgeInsets: .init(bottom: UIDevice.isIPad ? -4: -2))
|
||||
edgeInsets: .bottom(UIDevice.isIPad ? -4: -2))
|
||||
|
||||
public static let featureMedium = TextStyle(rawValue: "featureMedium",
|
||||
fontFace: .dsLight,
|
||||
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature96 : VDSTypography.fontSizeFeature64,
|
||||
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature88 : VDSTypography.lineHeightFeature64,
|
||||
letterSpacing: VDSTypography.letterSpacingSemiWide,
|
||||
edgeInsets: .init(bottom: UIDevice.isIPad ? -4: -2))
|
||||
edgeInsets: .bottom(UIDevice.isIPad ? -4: -2))
|
||||
|
||||
public static let boldFeatureSmall = TextStyle(rawValue: "boldFeatureSmall",
|
||||
fontFace: .edsBold,
|
||||
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature80 : VDSTypography.fontSizeFeature48,
|
||||
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature76 : VDSTypography.lineHeightFeature48,
|
||||
edgeInsets: .init(bottom: UIDevice.isIPad ? -2: 0))
|
||||
edgeInsets: .bottom(UIDevice.isIPad ? -2: 0))
|
||||
|
||||
public static let featureSmall = TextStyle(rawValue: "featureSmall",
|
||||
fontFace: .dsLight,
|
||||
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature80 : VDSTypography.fontSizeFeature48,
|
||||
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature76 : VDSTypography.lineHeightFeature48,
|
||||
letterSpacing: VDSTypography.letterSpacingSemiWide,
|
||||
edgeInsets: .init(bottom: UIDevice.isIPad ? -2: 0))
|
||||
edgeInsets: .bottom(UIDevice.isIPad ? -2: 0))
|
||||
|
||||
public static let boldFeatureXSmall = TextStyle(rawValue: "boldFeatureXSmall",
|
||||
fontFace: .edsBold,
|
||||
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature64 : VDSTypography.fontSizeFeature40,
|
||||
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature64 : VDSTypography.lineHeightFeature40,
|
||||
edgeInsets: .init(bottom: UIDevice.isIPad ? -2: 0))
|
||||
edgeInsets: .bottom(UIDevice.isIPad ? -2: 0))
|
||||
|
||||
public static let featureXSmall = TextStyle(rawValue: "featureXSmall",
|
||||
fontFace: .dsLight,
|
||||
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeFeature64 : VDSTypography.fontSizeFeature40,
|
||||
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightFeature64 : VDSTypography.lineHeightFeature40,
|
||||
letterSpacing: VDSTypography.letterSpacingSemiWide,
|
||||
edgeInsets: .init(bottom: UIDevice.isIPad ? -2: 0))
|
||||
edgeInsets: .bottom(UIDevice.isIPad ? -2: 0))
|
||||
|
||||
public static let boldTitle2XLarge = TextStyle(rawValue: "boldTitle2XLarge",
|
||||
fontFace: .edsBold,
|
||||
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeTitle64 : VDSTypography.fontSizeTitle40,
|
||||
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightTitle64 : VDSTypography.lineHeightTitle40,
|
||||
edgeInsets: .init(bottom: UIDevice.isIPad ? -2: 0))
|
||||
edgeInsets: .bottom(UIDevice.isIPad ? -2: 0))
|
||||
|
||||
public static let title2XLarge = TextStyle(rawValue: "title2XLarge",
|
||||
fontFace: .dsLight,
|
||||
pointSize: UIDevice.isIPad ? VDSTypography.fontSizeTitle64 : VDSTypography.fontSizeTitle40,
|
||||
lineHeight: UIDevice.isIPad ? VDSTypography.lineHeightTitle64 : VDSTypography.lineHeightTitle40,
|
||||
letterSpacing: VDSTypography.letterSpacingSemiWide,
|
||||
edgeInsets: .init(bottom: UIDevice.isIPad ? -2: 0))
|
||||
edgeInsets: .bottom(UIDevice.isIPad ? -2: 0))
|
||||
|
||||
public static let boldTitleXLarge = TextStyle(rawValue: "boldTitleXLarge",
|
||||
fontFace: .edsBold,
|
||||
@ -211,12 +211,6 @@ extension TextStyle {
|
||||
}
|
||||
}
|
||||
|
||||
extension UIEdgeInsets {
|
||||
public init(bottom: CGFloat) {
|
||||
self.init(top: 0, left: 0, bottom: bottom, right: 0)
|
||||
}
|
||||
}
|
||||
|
||||
extension TextStyle {
|
||||
/// Enum used to describe the naming convention for the Typography.
|
||||
public enum StandardStyle: String, CaseIterable {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user