update for documentation

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2023-08-29 16:23:12 -05:00
parent 001d6125d6
commit a02464a7d4

View File

@ -40,43 +40,44 @@ open class TextLinkCaret: ButtonBase, Buttonable {
public enum IconPosition: String, CaseIterable { public enum IconPosition: String, CaseIterable {
case left, right case left, right
} }
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Private Properties // MARK: - Private Properties
//-------------------------------------------------- //--------------------------------------------------
open override var textStyle: TextStyle {
TextStyle.boldBodyLarge
}
private var imageAttribute: CaretLabelAttribute?
open override var textAttributes: [any LabelAttributeModel]? {
guard let imageAttribute else { return nil }
return [imageAttribute]
}
//--------------------------------------------------
// MARK: - Properties
//--------------------------------------------------
/// The ButtonSize available to this type of Buttonable.
public override var availableSizes: [ButtonSize] { [.large] }
open var iconPosition: IconPosition = .right { didSet { setNeedsUpdate() } }
private var height: CGFloat { private var height: CGFloat {
44 44
} }
/// UIColor used on the titleLabel text.
open override var textColor: UIColor {
textColorConfiguration.getColor(self)
}
private var textColorConfiguration = ControlColorConfiguration().with { private var textColorConfiguration = ControlColorConfiguration().with {
$0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forState: .normal) $0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forState: .normal)
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forState: .disabled) $0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forState: .disabled)
$0.setSurfaceColors(VDSColor.interactiveActiveOnlight, VDSColor.interactiveActiveOndark, forState: .highlighted) $0.setSurfaceColors(VDSColor.interactiveActiveOnlight, VDSColor.interactiveActiveOndark, forState: .highlighted)
} }
private var imageAttribute: CaretLabelAttribute?
//--------------------------------------------------
// MARK: - Public Properties
//--------------------------------------------------
/// The ButtonSize available to this type of Buttonable.
public override var availableSizes: [ButtonSize] { [.large] }
/// Determines icon position of Caret.
open var iconPosition: IconPosition = .right { didSet { setNeedsUpdate() } }
open override var textAttributes: [any LabelAttributeModel]? {
guard let imageAttribute else { return nil }
return [imageAttribute]
}
/// UIColor used on the titleLabel text.
open override var textColor: UIColor {
textColorConfiguration.getColor(self)
}
open override var textStyle: TextStyle {
TextStyle.boldBodyLarge
}
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Overrides // MARK: - Overrides
@ -97,7 +98,7 @@ open class TextLinkCaret: ButtonBase, Buttonable {
open override func reset() { open override func reset() {
super.reset() super.reset()
iconPosition = .right iconPosition = .right
text = nil text = nil
} }
/// The natural size for the receiving view, considering only properties of the view itself. /// The natural size for the receiving view, considering only properties of the view itself.
@ -117,7 +118,7 @@ extension TextLinkCaret {
var spacerWidth: CGFloat = 4.0 var spacerWidth: CGFloat = 4.0
var width: CGFloat { caretSize.width + spacerWidth } var width: CGFloat { caretSize.width + spacerWidth }
var caretSize: CGSize { Icon.Size.xsmall.dimensions } var caretSize: CGSize { Icon.Size.xsmall.dimensions }
init(tintColor: UIColor, position: IconPosition) { init(tintColor: UIColor, position: IconPosition) {
self.tintColor = tintColor self.tintColor = tintColor
self.position = position self.position = position