@@ -14,13 +14,14 @@ public final class TextFieldProps: ObservableObject, Decodable {
14
14
@Published public var secure : Bool = false
15
15
@Published public var multiline : Bool = false
16
16
@Published public var disabled : Bool = false
17
+ @Published public var style : StyleProps ?
17
18
// Events
18
19
public var onChange : ( ( String ) -> Void ) ?
19
20
public var onFocus : ( ( ) -> Void ) ?
20
21
public var onBlur : ( ( ) -> Void ) ?
21
22
22
23
enum CodingKeys : String , CodingKey {
23
- case text, label, placeholder, keyboardType, textContentType, returnKeyType, autocapitalizationType, maxLength, secure, multiline, disabled
24
+ case text, label, placeholder, keyboardType, textContentType, returnKeyType, autocapitalizationType, maxLength, secure, multiline, disabled, style
24
25
}
25
26
26
27
public required init ( from decoder: Decoder ) throws {
@@ -58,7 +59,7 @@ public final class TextFieldProps: ObservableObject, Decodable {
58
59
// Decode autocapitalizationType
59
60
if let autocapitalizationTypeString = try container. decodeIfPresent ( String . self, forKey: . autocapitalizationType) {
60
61
switch autocapitalizationTypeString {
61
- case " none " : autocapitalizationType = . none
62
+ case " none " : autocapitalizationType = UITextAutocapitalizationType . none
62
63
case " words " : autocapitalizationType = . words
63
64
case " sentences " : autocapitalizationType = . sentences
64
65
case " allCharacters " : autocapitalizationType = . allCharacters
@@ -69,6 +70,7 @@ public final class TextFieldProps: ObservableObject, Decodable {
69
70
secure = try container. decodeIfPresent ( Bool . self, forKey: . secure) ?? false
70
71
multiline = try container. decodeIfPresent ( Bool . self, forKey: . multiline) ?? false
71
72
disabled = try container. decodeIfPresent ( Bool . self, forKey: . disabled) ?? false
73
+ style = try container. decodeIfPresent ( StyleProps . self, forKey: . style)
72
74
73
75
if maxLength != nil {
74
76
text = enforceMaxLength ( text)
@@ -94,5 +96,6 @@ public final class TextFieldProps: ObservableObject, Decodable {
94
96
secure = other. secure
95
97
multiline = other. multiline
96
98
disabled = other. disabled
99
+ style = other. style
97
100
}
98
101
}
0 commit comments