updated entry field
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
6283735428
commit
c6ffa5736d
@ -93,7 +93,7 @@ open class EntryField: Control, Accessable {
|
||||
// MARK: - Configuration Properties
|
||||
//--------------------------------------------------
|
||||
// Sizes are from InVision design specs.
|
||||
internal let containerSize = CGSize(width: 45, height: 44)
|
||||
internal var containerSize: CGSize { CGSize(width: 45, height: 44) }
|
||||
|
||||
internal let primaryColorConfig = ViewColorConfiguration().with {
|
||||
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forDisabled: true)
|
||||
|
||||
@ -16,7 +16,7 @@ public enum InputFieldType: String, CaseIterable {
|
||||
}
|
||||
|
||||
@objc(VDSInputField)
|
||||
public class InputField: EntryField {
|
||||
public class InputField: EntryField, UITextFieldDelegate {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Initializers
|
||||
//--------------------------------------------------
|
||||
@ -102,7 +102,6 @@ public class InputField: EntryField {
|
||||
$0.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forDisabled: false)
|
||||
}.eraseToAnyColorable()
|
||||
|
||||
|
||||
internal var minWidthConstraint: NSLayoutConstraint?
|
||||
|
||||
//--------------------------------------------------
|
||||
@ -117,6 +116,13 @@ public class InputField: EntryField {
|
||||
controlContainerView.addSubview(textField)
|
||||
textField.pinToSuperView()
|
||||
textField.heightAnchor.constraint(equalToConstant: 20).isActive = true
|
||||
textField
|
||||
.textPublisher
|
||||
.sink { [weak self] text in
|
||||
self?.value = text
|
||||
self?.sendActions(for: .valueChanged)
|
||||
|
||||
}.store(in: &subscribers)
|
||||
|
||||
stackView.addArrangedSubview(successLabel)
|
||||
stackView.setCustomSpacing(8, after: successLabel)
|
||||
@ -130,6 +136,9 @@ public class InputField: EntryField {
|
||||
|
||||
public override func reset() {
|
||||
super.reset()
|
||||
textField.text = ""
|
||||
textField.delegate = self
|
||||
|
||||
successLabel.reset()
|
||||
successLabel.textPosition = .left
|
||||
successLabel.typograpicalStyle = .BodySmall
|
||||
@ -204,6 +213,7 @@ public class InputField: EntryField {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension InputFieldType {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user