more refactoring
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
522624b403
commit
e70d160619
@ -97,16 +97,7 @@ open class InputField: EntryFieldBase {
|
||||
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forDisabled: true)
|
||||
$0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forDisabled: false)
|
||||
}.eraseToAnyColorable()
|
||||
|
||||
open var leftImageView = UIImageView().with {
|
||||
$0.height(20)
|
||||
$0.width(32)
|
||||
$0.isAccessibilityElement = false
|
||||
$0.translatesAutoresizingMaskIntoConstraints = false
|
||||
$0.contentMode = .scaleAspectFill
|
||||
$0.clipsToBounds = true
|
||||
}
|
||||
|
||||
|
||||
open var actionTextLink = TextLink().with { $0.contentEdgeInsets = .top(-2) }
|
||||
|
||||
open var actionTextLinkModel: TextLinkModel? { didSet { setNeedsUpdate() } }
|
||||
@ -177,11 +168,10 @@ open class InputField: EntryFieldBase {
|
||||
//--------------------------------------------------
|
||||
/// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations.
|
||||
open override func setup() {
|
||||
super.setup()
|
||||
super.setup()
|
||||
textField.heightAnchor.constraint(equalToConstant: 20).isActive = true
|
||||
textField.delegate = self
|
||||
mainStackView.addArrangedSubview(successLabel)
|
||||
mainStackView.setCustomSpacing(8, after: successLabel)
|
||||
bottomContainerStackView.insertArrangedSubview(successLabel, at: 0)
|
||||
|
||||
fieldStackView.addArrangedSubview(actionTextLink)
|
||||
|
||||
@ -194,15 +184,7 @@ open class InputField: EntryFieldBase {
|
||||
}
|
||||
|
||||
open override func getFieldContainer() -> UIView {
|
||||
// stackview for controls in EntryFieldBase.controlContainerView
|
||||
let stackView = UIStackView().with {
|
||||
$0.translatesAutoresizingMaskIntoConstraints = false
|
||||
$0.axis = .horizontal
|
||||
$0.spacing = VDSLayout.space3X
|
||||
}
|
||||
stackView.addArrangedSubview(leftImageView)
|
||||
stackView.addArrangedSubview(textField)
|
||||
return stackView
|
||||
return textField
|
||||
}
|
||||
|
||||
/// Resets to default settings.
|
||||
@ -322,6 +304,7 @@ extension InputField: UITextFieldDelegate {
|
||||
validate()
|
||||
}
|
||||
sendActions(for: .valueChanged)
|
||||
setNeedsUpdate()
|
||||
}
|
||||
|
||||
public func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user