refactored label to remove disabled.
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
1b9a2799b2
commit
a6a0003c3b
@ -237,7 +237,7 @@ open class SelectorItemBase<Selector: SelectorControlable>: Control, Errorable,
|
||||
//top label
|
||||
if let labelText {
|
||||
label.surface = surface
|
||||
label.disabled = disabled
|
||||
label.isEnabled = isEnabled
|
||||
label.attributes = labelTextAttributes
|
||||
label.text = labelText
|
||||
label.isHidden = false
|
||||
@ -252,7 +252,7 @@ open class SelectorItemBase<Selector: SelectorControlable>: Control, Errorable,
|
||||
if let childText {
|
||||
childLabel.text = childText
|
||||
childLabel.surface = surface
|
||||
childLabel.disabled = disabled
|
||||
childLabel.isEnabled = isEnabled
|
||||
childLabel.attributes = childTextAttributes
|
||||
childLabel.isHidden = false
|
||||
|
||||
@ -276,7 +276,7 @@ open class SelectorItemBase<Selector: SelectorControlable>: Control, Errorable,
|
||||
if let errorText, shouldShowError {
|
||||
errorLabel.text = errorText
|
||||
errorLabel.surface = surface
|
||||
errorLabel.disabled = disabled
|
||||
errorLabel.isEnabled = isEnabled
|
||||
mainStackView.spacing = 8
|
||||
errorLabel.isHidden = false
|
||||
} else {
|
||||
|
||||
@ -157,6 +157,6 @@ open class Badge: View {
|
||||
label.numberOfLines = numberOfLines
|
||||
label.text = text
|
||||
label.surface = surface
|
||||
label.disabled = disabled
|
||||
label.isEnabled = isEnabled
|
||||
}
|
||||
}
|
||||
|
||||
@ -341,7 +341,7 @@ open class BadgeIndicator: View {
|
||||
label.textColorConfiguration = textColorConfiguration.eraseToAnyColorable()
|
||||
label.text = getText()
|
||||
label.surface = surface
|
||||
label.disabled = disabled
|
||||
label.isEnabled = isEnabled
|
||||
label.sizeToFit()
|
||||
setNeedsLayout()
|
||||
layoutIfNeeded()
|
||||
|
||||
@ -55,16 +55,6 @@ open class Label: UILabel, ViewProtocol, UserInfoable {
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether this object is disabled or not
|
||||
open var disabled: Bool {
|
||||
get { !isEnabled }
|
||||
set {
|
||||
if !isEnabled != newValue {
|
||||
isEnabled = !newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether the View is enabled or not.
|
||||
open override var isEnabled: Bool { didSet { setNeedsUpdate(); isUserInteractionEnabled = isEnabled } }
|
||||
|
||||
@ -123,7 +113,7 @@ open class Label: UILabel, ViewProtocol, UserInfoable {
|
||||
open func reset() {
|
||||
shouldUpdateView = false
|
||||
surface = .light
|
||||
disabled = false
|
||||
isEnabled = true
|
||||
attributes = nil
|
||||
textStyle = .defaultStyle
|
||||
textPosition = .left
|
||||
|
||||
@ -187,14 +187,14 @@ open class RadioBoxItem: Control, Changeable {
|
||||
//text label
|
||||
textLabel.text = text
|
||||
textLabel.surface = surface
|
||||
textLabel.disabled = disabled
|
||||
textLabel.isEnabled = isEnabled
|
||||
textLabel.attributes = textAttributes
|
||||
|
||||
//subText label
|
||||
if let subText {
|
||||
subTextLabel.text = subText
|
||||
subTextLabel.surface = surface
|
||||
subTextLabel.disabled = disabled
|
||||
subTextLabel.isEnabled = isEnabled
|
||||
subTextLabel.attributes = subTextAttributes
|
||||
subTextLabel.isHidden = false
|
||||
|
||||
@ -209,7 +209,7 @@ open class RadioBoxItem: Control, Changeable {
|
||||
if let subTextRight {
|
||||
subTextRightLabel.text = subTextRight
|
||||
subTextRightLabel.surface = surface
|
||||
subTextRightLabel.disabled = disabled
|
||||
subTextRightLabel.isEnabled = isEnabled
|
||||
subTextRightLabel.attributes = subTextRightAttributes
|
||||
subTextRightLabel.isHidden = false
|
||||
|
||||
|
||||
@ -132,7 +132,7 @@ open class RadioSwatchGroup: SelectorGroupSelectedHandlerBase<RadioSwatch>, UICo
|
||||
label.textStyle = .bodySmall
|
||||
label.text = selectedHandler?.text ?? " "
|
||||
label.surface = surface
|
||||
label.disabled = disabled
|
||||
label.isEnabled = isEnabled
|
||||
collectionView.reloadData()
|
||||
}
|
||||
|
||||
|
||||
@ -301,7 +301,7 @@ open class EntryField: Control, Changeable {
|
||||
titleLabel.text = updatedLabelText
|
||||
titleLabel.attributes = attributes
|
||||
titleLabel.surface = surface
|
||||
titleLabel.disabled = disabled
|
||||
titleLabel.isEnabled = isEnabled
|
||||
|
||||
}
|
||||
|
||||
@ -309,7 +309,7 @@ open class EntryField: Control, Changeable {
|
||||
if showError, let errorText {
|
||||
errorLabel.text = errorText
|
||||
errorLabel.surface = surface
|
||||
errorLabel.disabled = disabled
|
||||
errorLabel.isEnabled = isEnabled
|
||||
errorLabel.isHidden = false
|
||||
icon.name = .error
|
||||
icon.color = VDSColor.paletteBlack
|
||||
@ -326,7 +326,7 @@ open class EntryField: Control, Changeable {
|
||||
if let helperText {
|
||||
helperLabel.text = helperText
|
||||
helperLabel.surface = surface
|
||||
helperLabel.disabled = disabled
|
||||
helperLabel.isEnabled = isEnabled
|
||||
helperLabel.isHidden = false
|
||||
} else {
|
||||
helperLabel.isHidden = true
|
||||
|
||||
@ -175,7 +175,7 @@ open class InputField: EntryField, UITextFieldDelegate {
|
||||
} else if showSuccess, let successText {
|
||||
successLabel.text = successText
|
||||
successLabel.surface = surface
|
||||
successLabel.disabled = disabled
|
||||
successLabel.isEnabled = isEnabled
|
||||
successLabel.isHidden = false
|
||||
errorLabel.isHidden = true
|
||||
icon.name = .checkmarkAlt
|
||||
|
||||
@ -234,7 +234,7 @@ open class Toggle: Control, Changeable {
|
||||
label.textStyle = textStyle
|
||||
label.text = statusText
|
||||
label.surface = surface
|
||||
label.disabled = disabled
|
||||
label.isEnabled = isEnabled
|
||||
switch textPosition {
|
||||
case .left:
|
||||
NSLayoutConstraint.deactivate(rightConstraints)
|
||||
|
||||
@ -71,7 +71,7 @@ open class TrailingTooltipLabel: View, TooltipLaunchable {
|
||||
label.textPosition = labelTextPosition
|
||||
label.attributes = labelAttributes
|
||||
label.surface = surface
|
||||
label.disabled = disabled
|
||||
label.isEnabled = isEnabled
|
||||
|
||||
//add tooltip
|
||||
if let labelText, !labelText.isEmpty {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user