refactored TextField

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2023-01-10 13:25:07 -06:00
parent 8501819658
commit b3e2469393
2 changed files with 12 additions and 14 deletions

View File

@ -84,7 +84,7 @@
EAC9257D29119B5400091998 /* TextLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAC9257C29119B5400091998 /* TextLink.swift */; };
EAC925832911B35400091998 /* TextLinkCaret.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAC925822911B35300091998 /* TextLinkCaret.swift */; };
EAC925842911C63100091998 /* Colorable.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAA5EEDF28F49DB3003B3210 /* Colorable.swift */; };
EAC9258C2911C9DE00091998 /* TextEntryField.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAC925872911C9DE00091998 /* TextEntryField.swift */; };
EAC9258C2911C9DE00091998 /* InputField.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAC925872911C9DE00091998 /* InputField.swift */; };
EAC9258F2911C9DE00091998 /* EntryField.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAC9258B2911C9DE00091998 /* EntryField.swift */; };
EAD8D2C128BFDE8B006EB6A6 /* UIGestureRecognizer+Publisher.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAD8D2C028BFDE8B006EB6A6 /* UIGestureRecognizer+Publisher.swift */; };
EAF7F0952899861000B287F5 /* Checkbox.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF7F0932899861000B287F5 /* Checkbox.swift */; };
@ -195,7 +195,7 @@
EAC846F2294B95CE00F685BA /* ButtonGroupCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ButtonGroupCollectionViewCell.swift; sourceTree = "<group>"; };
EAC9257C29119B5400091998 /* TextLink.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextLink.swift; sourceTree = "<group>"; };
EAC925822911B35300091998 /* TextLinkCaret.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextLinkCaret.swift; sourceTree = "<group>"; };
EAC925872911C9DE00091998 /* TextEntryField.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextEntryField.swift; sourceTree = "<group>"; };
EAC925872911C9DE00091998 /* InputField.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InputField.swift; sourceTree = "<group>"; };
EAC9258B2911C9DE00091998 /* EntryField.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EntryField.swift; sourceTree = "<group>"; };
EAD8D2C028BFDE8B006EB6A6 /* UIGestureRecognizer+Publisher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIGestureRecognizer+Publisher.swift"; sourceTree = "<group>"; };
EAF7F0932899861000B287F5 /* Checkbox.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Checkbox.swift; sourceTree = "<group>"; };
@ -558,18 +558,18 @@
EAC925852911C9DE00091998 /* TextFields */ = {
isa = PBXGroup;
children = (
EAC925862911C9DE00091998 /* TextEntryField */,
EAC925862911C9DE00091998 /* InputField */,
EAC925892911C9DE00091998 /* EntryField */,
);
path = TextFields;
sourceTree = "<group>";
};
EAC925862911C9DE00091998 /* TextEntryField */ = {
EAC925862911C9DE00091998 /* InputField */ = {
isa = PBXGroup;
children = (
EAC925872911C9DE00091998 /* TextEntryField.swift */,
EAC925872911C9DE00091998 /* InputField.swift */,
);
path = TextEntryField;
path = InputField;
sourceTree = "<group>";
};
EAC925892911C9DE00091998 /* EntryField */ = {
@ -737,7 +737,7 @@
EA3361C328902D960071C351 /* Toggle.swift in Sources */,
EAF7F0A0289AB7EC00B287F5 /* View.swift in Sources */,
EA89201328B568D8006B9984 /* RadioBox.swift in Sources */,
EAC9258C2911C9DE00091998 /* TextEntryField.swift in Sources */,
EAC9258C2911C9DE00091998 /* InputField.swift in Sources */,
EA3362402892EF6C0071C351 /* Label.swift in Sources */,
EAF7F0B3289B1ADC00B287F5 /* ActionLabelAttribute.swift in Sources */,
EAC925832911B35400091998 /* TextLinkCaret.swift in Sources */,

View File

@ -11,14 +11,12 @@ import VDSColorTokens
import VDSFormControlsTokens
import Combine
public enum TextEntryFieldType: String, CaseIterable {
public enum InputFieldType: String, CaseIterable {
case text, number, calendar, inlineAction, password, creditCard, tel, date, securityCode
}
@objc(VDSTextEntryField)
public class TextEntryField: TextEntryFieldBase{}
open class TextEntryFieldBase: EntryField {
@objc(VDSInputField)
public class InputField: EntryField {
//--------------------------------------------------
// MARK: - Initializers
//--------------------------------------------------
@ -50,7 +48,7 @@ open class TextEntryFieldBase: EntryField {
// MARK: - Public Properties
//--------------------------------------------------
open var type: TextEntryFieldType = .text { didSet { didChange() }}
open var type: InputFieldType = .text { didSet { didChange() }}
var _showError: Bool = false
open override var showError: Bool {
@ -187,7 +185,7 @@ open class TextEntryFieldBase: EntryField {
}
}
extension TextEntryFieldType {
extension InputFieldType {
var width: CGFloat {
switch self {
case .inlineAction: