fixed badge

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2023-08-30 16:57:44 -05:00
parent 794f68a67f
commit efb51d12c4
2 changed files with 13 additions and 13 deletions

View File

@ -57,16 +57,16 @@ open class Badge: View {
/// This will render the badges fill color based on the available options.
/// When used in conjunction with the surface prop, this fill color will change its tint automatically based on a light or dark surface.
open var fillColor: FillColor = .red { didSet { setNeedsUpdate() }}
open var fillColor: FillColor = .red { didSet { if oldValue != fillColor { setNeedsUpdate() } } }
/// The text that will be shown in the label.
open var text: String = "" { didSet { setNeedsUpdate() }}
open var text: String = "" { didSet { if oldValue != text { setNeedsUpdate() } } }
/// When applied, this property takes a px value that will restrict the width at that point.
open var maxWidth: CGFloat? { didSet { setNeedsUpdate() }}
open var maxWidth: CGFloat? { didSet { if oldValue != maxWidth { setNeedsUpdate() } } }
/// This will restrict the badge height to a specific number of lines. If the text overflows the allowable space, ellipsis will show.
open var numberOfLines: Int = 1 { didSet { setNeedsUpdate() }}
open var numberOfLines: Int = 1 { didSet { if oldValue != numberOfLines { setNeedsUpdate() } } }
//--------------------------------------------------
// MARK: - Constraints

View File

@ -108,26 +108,26 @@ open class Label: UILabel, ViewProtocol, UserInfoable {
open var useAttributedText: Bool = false
/// Will determine if a scaled font should be used for the font.
open var useScaledFont: Bool = false { didSet { setNeedsUpdate() }}
open var useScaledFont: Bool = false { didSet { if oldValue != useScaledFont { setNeedsUpdate() } } }
open var surface: Surface = .light { didSet { setNeedsUpdate() }}
open var surface: Surface = .light { didSet { if oldValue != surface { setNeedsUpdate() } } }
/// Array of LabelAttributeModel objects used in rendering the text.
open var attributes: [any LabelAttributeModel]? { didSet { setNeedsUpdate() }}
open var attributes: [any LabelAttributeModel]? { didSet { if oldValue != attributes { setNeedsUpdate() } } }
/// TextStyle used on the this label.
open var textStyle: TextStyle = .defaultStyle { didSet { setNeedsUpdate() }}
open var textStyle: TextStyle = .defaultStyle { didSet { if oldValue != textStyle { setNeedsUpdate() } } }
/// The alignment of the text within the label.
open override var textAlignment: NSTextAlignment { didSet { setNeedsUpdate() }}
open override var textAlignment: NSTextAlignment { didSet { if oldValue != textAlignment { setNeedsUpdate() } } }
open var userInfo = [String: Primitive]()
/// Number of lines the label can render out, default is set to 0.
open override var numberOfLines: Int { didSet { setNeedsUpdate() }}
open override var numberOfLines: Int { didSet { if oldValue != numberOfLines { setNeedsUpdate() } } }
/// Line break mode for the label, default is set to word wrapping.
open override var lineBreakMode: NSLineBreakMode { didSet { setNeedsUpdate() }}
open override var lineBreakMode: NSLineBreakMode { didSet { if oldValue != lineBreakMode { setNeedsUpdate() } } }
/// Text that will be used in the label.
override open var text: String? {
@ -139,7 +139,7 @@ open class Label: UILabel, ViewProtocol, UserInfoable {
}
/// Whether the View is enabled or not.
open override var isEnabled: Bool { didSet { setNeedsUpdate() } }
open override var isEnabled: Bool { didSet { if oldValue != isEnabled { setNeedsUpdate() } } }
//--------------------------------------------------
// MARK: - Configuration Properties
@ -149,7 +149,7 @@ open class Label: UILabel, ViewProtocol, UserInfoable {
open var textColorConfiguration: AnyColorable = ViewColorConfiguration().with {
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forDisabled: true)
$0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forDisabled: false)
}.eraseToAnyColorable(){ didSet { setNeedsUpdate() }}
}.eraseToAnyColorable(){ didSet { setNeedsUpdate() } }
//--------------------------------------------------
// MARK: - Lifecycle