more refactoring
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
522624b403
commit
e70d160619
@ -98,15 +98,6 @@ open class InputField: EntryFieldBase {
|
|||||||
$0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forDisabled: false)
|
$0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forDisabled: false)
|
||||||
}.eraseToAnyColorable()
|
}.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 actionTextLink = TextLink().with { $0.contentEdgeInsets = .top(-2) }
|
||||||
|
|
||||||
open var actionTextLinkModel: TextLinkModel? { didSet { setNeedsUpdate() } }
|
open var actionTextLinkModel: TextLinkModel? { didSet { setNeedsUpdate() } }
|
||||||
@ -180,8 +171,7 @@ open class InputField: EntryFieldBase {
|
|||||||
super.setup()
|
super.setup()
|
||||||
textField.heightAnchor.constraint(equalToConstant: 20).isActive = true
|
textField.heightAnchor.constraint(equalToConstant: 20).isActive = true
|
||||||
textField.delegate = self
|
textField.delegate = self
|
||||||
mainStackView.addArrangedSubview(successLabel)
|
bottomContainerStackView.insertArrangedSubview(successLabel, at: 0)
|
||||||
mainStackView.setCustomSpacing(8, after: successLabel)
|
|
||||||
|
|
||||||
fieldStackView.addArrangedSubview(actionTextLink)
|
fieldStackView.addArrangedSubview(actionTextLink)
|
||||||
|
|
||||||
@ -194,15 +184,7 @@ open class InputField: EntryFieldBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
open override func getFieldContainer() -> UIView {
|
open override func getFieldContainer() -> UIView {
|
||||||
// stackview for controls in EntryFieldBase.controlContainerView
|
return textField
|
||||||
let stackView = UIStackView().with {
|
|
||||||
$0.translatesAutoresizingMaskIntoConstraints = false
|
|
||||||
$0.axis = .horizontal
|
|
||||||
$0.spacing = VDSLayout.space3X
|
|
||||||
}
|
|
||||||
stackView.addArrangedSubview(leftImageView)
|
|
||||||
stackView.addArrangedSubview(textField)
|
|
||||||
return stackView
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Resets to default settings.
|
/// Resets to default settings.
|
||||||
@ -322,6 +304,7 @@ extension InputField: UITextFieldDelegate {
|
|||||||
validate()
|
validate()
|
||||||
}
|
}
|
||||||
sendActions(for: .valueChanged)
|
sendActions(for: .valueChanged)
|
||||||
|
setNeedsUpdate()
|
||||||
}
|
}
|
||||||
|
|
||||||
public func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
|
public func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user