fixed error/disabled border
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
fc6c398b3f
commit
c0c666c2cb
@ -181,18 +181,14 @@ open class DropdownSelect: Control {
|
|||||||
$0.setSurfaceColors(VDSColor.feedbackErrorBackgroundOnlight, VDSColor.feedbackErrorBackgroundOndark, forState: .error)
|
$0.setSurfaceColors(VDSColor.feedbackErrorBackgroundOnlight, VDSColor.feedbackErrorBackgroundOndark, forState: .error)
|
||||||
}
|
}
|
||||||
|
|
||||||
internal var containerBorderColorConfiguration = ControlColorConfiguration().with {
|
internal var borderColorConfiguration = ControlColorConfiguration().with {
|
||||||
$0.setSurfaceColors(VDSFormControlsColor.borderOnlight, VDSFormControlsColor.borderOnlight, forState: .normal)
|
$0.setSurfaceColors(VDSFormControlsColor.borderOnlight, VDSFormControlsColor.borderOnlight, forState: .normal)
|
||||||
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forState: .disabled)
|
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forState: .disabled)
|
||||||
|
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forState: [.disabled,.error])
|
||||||
$0.setSurfaceColors(VDSColor.feedbackErrorOnlight, VDSColor.feedbackErrorOndark, forState: .error)
|
$0.setSurfaceColors(VDSColor.feedbackErrorOnlight, VDSColor.feedbackErrorOndark, forState: .error)
|
||||||
$0.setSurfaceColors(VDSFormControlsColor.borderHoverOnlight, VDSFormControlsColor.borderHoverOndark, forState: .focused)
|
$0.setSurfaceColors(VDSFormControlsColor.borderHoverOnlight, VDSFormControlsColor.borderHoverOndark, forState: .focused)
|
||||||
}
|
}
|
||||||
|
|
||||||
internal var errorBorderColorConfiguration = ControlColorConfiguration().with {
|
|
||||||
$0.setSurfaceColors(VDSColor.feedbackErrorOnlight, VDSColor.feedbackErrorOndark, forState: .error)
|
|
||||||
$0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forState: .focused)
|
|
||||||
}
|
|
||||||
|
|
||||||
internal var readOnlyBorderColorConfiguration = ControlColorConfiguration().with {
|
internal var readOnlyBorderColorConfiguration = ControlColorConfiguration().with {
|
||||||
$0.setSurfaceColors(VDSFormControlsColor.borderReadonlyOnlight, VDSFormControlsColor.borderReadonlyOndark, forState: .normal)
|
$0.setSurfaceColors(VDSFormControlsColor.borderReadonlyOnlight, VDSFormControlsColor.borderReadonlyOndark, forState: .normal)
|
||||||
}
|
}
|
||||||
@ -264,7 +260,7 @@ open class DropdownSelect: Control {
|
|||||||
containerView.backgroundColor = backgroundColorConfiguration.getColor(self)
|
containerView.backgroundColor = backgroundColorConfiguration.getColor(self)
|
||||||
containerView.layer.borderWidth = VDSFormControls.widthBorder
|
containerView.layer.borderWidth = VDSFormControls.widthBorder
|
||||||
containerView.layer.cornerRadius = VDSFormControls.borderradius
|
containerView.layer.cornerRadius = VDSFormControls.borderradius
|
||||||
containerView.layer.borderColor = readOnly ? readOnlyBorderColorConfiguration.getColor(self).cgColor : (showError ? errorBorderColorConfiguration.getColor(self).cgColor : containerBorderColorConfiguration.getColor(self).cgColor)
|
containerView.layer.borderColor = readOnly ? readOnlyBorderColorConfiguration.getColor(self).cgColor : borderColorConfiguration.getColor(self).cgColor
|
||||||
dropdownField.isUserInteractionEnabled = readOnly ? false : true
|
dropdownField.isUserInteractionEnabled = readOnly ? false : true
|
||||||
stackView.backgroundColor = transparentBackground ? .clear : surface.color
|
stackView.backgroundColor = transparentBackground ? .clear : surface.color
|
||||||
|
|
||||||
@ -276,6 +272,7 @@ open class DropdownSelect: Control {
|
|||||||
icon.name = nil
|
icon.name = nil
|
||||||
}
|
}
|
||||||
selectedOptionLabel.surface = surface
|
selectedOptionLabel.surface = surface
|
||||||
|
selectedOptionLabel.isEnabled = isEnabled
|
||||||
backgroundColor = surface.color
|
backgroundColor = surface.color
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -350,6 +347,7 @@ open class DropdownSelect: Control {
|
|||||||
inlineDisplayLabel.text = showInlineLabel ? labelText : ""
|
inlineDisplayLabel.text = showInlineLabel ? labelText : ""
|
||||||
}
|
}
|
||||||
inlineDisplayLabel.surface = surface
|
inlineDisplayLabel.surface = surface
|
||||||
|
inlineDisplayLabel.isEnabled = isEnabled
|
||||||
|
|
||||||
/// Update width as per updated text size
|
/// Update width as per updated text size
|
||||||
inlineWidthConstraint = inlineDisplayLabel.widthAnchor.constraint(equalToConstant: inlineDisplayLabel.intrinsicContentSize.width)
|
inlineWidthConstraint = inlineDisplayLabel.widthAnchor.constraint(equalToConstant: inlineDisplayLabel.intrinsicContentSize.width)
|
||||||
@ -372,13 +370,13 @@ open class DropdownSelect: Control {
|
|||||||
errorLabel.isHidden = false
|
errorLabel.isHidden = false
|
||||||
icon.name = .error
|
icon.name = .error
|
||||||
icon.size = .medium
|
icon.size = .medium
|
||||||
icon.color = .black
|
|
||||||
icon.surface = surface
|
icon.surface = surface
|
||||||
} else {
|
} else {
|
||||||
icon.name = .downCaret
|
icon.name = .downCaret
|
||||||
icon.surface = surface
|
icon.surface = surface
|
||||||
errorLabel.isHidden = true
|
errorLabel.isHidden = true
|
||||||
}
|
}
|
||||||
|
icon.color = titleLabel.textColorConfiguration.getColor(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
open func updateHelperLabel() {
|
open func updateHelperLabel() {
|
||||||
|
|||||||
@ -110,6 +110,7 @@ open class EntryFieldBase: Control, Changeable, FormFieldInternalValidatable {
|
|||||||
$0.setSurfaceColors(VDSFormControlsColor.borderOnlight, VDSFormControlsColor.borderOndark, forState: .normal)
|
$0.setSurfaceColors(VDSFormControlsColor.borderOnlight, VDSFormControlsColor.borderOndark, forState: .normal)
|
||||||
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forState: .disabled)
|
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forState: .disabled)
|
||||||
$0.setSurfaceColors(VDSColor.feedbackErrorOnlight, VDSColor.feedbackErrorOndark, forState: .error)
|
$0.setSurfaceColors(VDSColor.feedbackErrorOnlight, VDSColor.feedbackErrorOndark, forState: .error)
|
||||||
|
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forState: [.disabled,.error])
|
||||||
}
|
}
|
||||||
|
|
||||||
internal var readOnlyBorderColorConfiguration = ControlColorConfiguration().with {
|
internal var readOnlyBorderColorConfiguration = ControlColorConfiguration().with {
|
||||||
@ -332,7 +333,7 @@ open class EntryFieldBase: Control, Changeable, FormFieldInternalValidatable {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
private func updateContainerView() {
|
private func updateContainerView() {
|
||||||
containerView.backgroundColor = backgroundColorConfiguration.getColor(self)
|
containerView.backgroundColor = backgroundColorConfiguration.getColor(self)
|
||||||
containerView.layer.borderColor = borderColorConfiguration.getColor(self).cgColor
|
containerView.layer.borderColor = readOnly ? readOnlyBorderColorConfiguration.getColor(self).cgColor : borderColorConfiguration.getColor(self).cgColor
|
||||||
containerView.layer.borderWidth = VDSFormControls.widthBorder
|
containerView.layer.borderWidth = VDSFormControls.widthBorder
|
||||||
containerView.layer.cornerRadius = VDSFormControls.borderradius
|
containerView.layer.cornerRadius = VDSFormControls.borderradius
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user