CXTDT-563194 - Dropdown Select - missing transparentBackground option

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-05-28 14:21:11 -05:00
parent fab109b59b
commit cbf5645959
3 changed files with 17 additions and 8 deletions

View File

@ -101,6 +101,14 @@ open class EntryFieldBase: Control, Changeable, FormFieldInternalValidatable {
/// This is set by a local method.
internal var bottomContainerView: UIView!
internal var containerBackgroundColor: UIColor {
if showError || hasInternalError {
return backgroundColorConfiguration.getColor(self)
} else {
return transparentBackground ? .clear : backgroundColorConfiguration.getColor(self)
}
}
//--------------------------------------------------
// MARK: - Constraints
//--------------------------------------------------
@ -441,7 +449,7 @@ open class EntryFieldBase: Control, Changeable, FormFieldInternalValidatable {
}
internal func updateContainerView() {
containerView.backgroundColor = backgroundColorConfiguration.getColor(self)
containerView.backgroundColor = containerBackgroundColor
containerView.layer.borderColor = borderColorConfiguration.getColor(self).cgColor
containerView.layer.borderWidth = VDSFormControls.borderWidth
containerView.layer.cornerRadius = VDSFormControls.borderRadius

View File

@ -34,6 +34,14 @@ open class InputField: EntryFieldBase {
//--------------------------------------------------
// MARK: - Private Properties
//--------------------------------------------------
internal override var containerBackgroundColor: UIColor {
if showSuccess {
return backgroundColorConfiguration.getColor(self)
} else {
return super.containerBackgroundColor
}
}
internal override var minWidth: CGFloat { fieldType.handler().minWidth }
internal override var maxWidth: CGFloat {
let frameWidth = frame.size.width

View File

@ -163,9 +163,6 @@ open class TextArea: EntryFieldBase {
textViewHeightConstraint = textView.heightAnchor.constraint(greaterThanOrEqualToConstant: containerSize.height)
textViewHeightConstraint?.isActive = true
backgroundColorConfiguration.setSurfaceColors(VDSColor.feedbackSuccessBackgroundOnlight, VDSColor.feedbackSuccessBackgroundOndark, forState: .success)
borderColorConfiguration.setSurfaceColors(VDSColor.feedbackSuccessOnlight, VDSColor.feedbackSuccessOndark, forState: .success)
borderColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forState: .focused)
characterCounterLabel.textColorConfiguration = primaryColorConfiguration.eraseToAnyColorable()
bottomContainerStackView.spacing = VDSLayout.space2X
@ -190,11 +187,7 @@ open class TextArea: EntryFieldBase {
textViewHeightConstraint?.constant = minHeight.value
characterCounterLabel.text = getCharacterCounterText()
statusIcon.color = iconColorConfiguration.getColor(self)
containerView.layer.borderColor = isReadOnly ? readOnlyBorderColorConfiguration.getColor(self).cgColor : borderColorConfiguration.getColor(self).cgColor
textView.isEditable = !isEnabled || isReadOnly ? false : true
textView.backgroundColor = backgroundColorConfiguration.getColor(self)
textView.tintColor = iconColorConfiguration.getColor(self)
characterCounterLabel.surface = surface
highlightCharacterOverflow()