@expo/ui 55.0.9 → 55.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +11 -7
- package/android/src/main/java/expo/modules/ui/TextFieldView.kt +326 -0
- package/build/jetpack-compose/SlotView.d.ts +7 -0
- package/build/jetpack-compose/SlotView.d.ts.map +1 -0
- package/build/jetpack-compose/TextField/index.d.ts +177 -0
- package/build/jetpack-compose/TextField/index.d.ts.map +1 -0
- package/build/jetpack-compose/index.d.ts +1 -1
- package/build/swift-ui/SecureField/index.d.ts +9 -20
- package/build/swift-ui/SecureField/index.d.ts.map +1 -1
- package/build/swift-ui/TextField/index.d.ts +17 -63
- package/build/swift-ui/TextField/index.d.ts.map +1 -1
- package/build/swift-ui/modifiers/index.d.ts +65 -4
- package/build/swift-ui/modifiers/index.d.ts.map +1 -1
- package/expo-module.config.json +1 -1
- package/ios/Modifiers/KeyboardTypeModifier.swift +68 -0
- package/ios/Modifiers/LineLimitModifier.swift +29 -0
- package/ios/Modifiers/OnSubmitModifier.swift +21 -0
- package/ios/Modifiers/ScrollTargetBehaviorModifier.swift +26 -0
- package/ios/Modifiers/ScrollTargetLayoutModifier.swift +14 -0
- package/ios/Modifiers/TextContentTypeModifier.swift +191 -0
- package/ios/Modifiers/TextInputAutocapitalizationModifier.swift +28 -0
- package/ios/Modifiers/ViewModifierRegistry.swift +28 -8
- package/ios/SecureFieldView.swift +5 -12
- package/ios/TextFieldView.swift +26 -94
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.9/expo.modules.ui-55.0.9-sources.jar → 55.0.11/expo.modules.ui-55.0.11-sources.jar} +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.11/expo.modules.ui-55.0.11-sources.jar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.11/expo.modules.ui-55.0.11-sources.jar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.11/expo.modules.ui-55.0.11-sources.jar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.11/expo.modules.ui-55.0.11-sources.jar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.11/expo.modules.ui-55.0.11.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.11/expo.modules.ui-55.0.11.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.11/expo.modules.ui-55.0.11.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.11/expo.modules.ui-55.0.11.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.11/expo.modules.ui-55.0.11.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.9/expo.modules.ui-55.0.9.module → 55.0.11/expo.modules.ui-55.0.11.module} +22 -22
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.11/expo.modules.ui-55.0.11.module.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.11/expo.modules.ui-55.0.11.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.11/expo.modules.ui-55.0.11.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.11/expo.modules.ui-55.0.11.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.9/expo.modules.ui-55.0.9.pom → 55.0.11/expo.modules.ui-55.0.11.pom} +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.11/expo.modules.ui-55.0.11.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.11/expo.modules.ui-55.0.11.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.11/expo.modules.ui-55.0.11.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.11/expo.modules.ui-55.0.11.pom.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml +4 -4
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha512 +1 -1
- package/package.json +2 -2
- package/src/jetpack-compose/SlotView.tsx +15 -0
- package/src/jetpack-compose/TextField/index.tsx +276 -0
- package/src/jetpack-compose/index.ts +1 -1
- package/src/swift-ui/SecureField/index.tsx +18 -36
- package/src/swift-ui/TextField/index.tsx +30 -91
- package/src/swift-ui/modifiers/index.ts +151 -3
- package/android/src/main/java/expo/modules/ui/TextInputView.kt +0 -124
- package/build/jetpack-compose/TextInput/index.d.ts +0 -105
- package/build/jetpack-compose/TextInput/index.d.ts.map +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.9/expo.modules.ui-55.0.9-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.9/expo.modules.ui-55.0.9-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.9/expo.modules.ui-55.0.9-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.9/expo.modules.ui-55.0.9-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.9/expo.modules.ui-55.0.9.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.9/expo.modules.ui-55.0.9.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.9/expo.modules.ui-55.0.9.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.9/expo.modules.ui-55.0.9.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.9/expo.modules.ui-55.0.9.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.9/expo.modules.ui-55.0.9.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.9/expo.modules.ui-55.0.9.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.9/expo.modules.ui-55.0.9.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.9/expo.modules.ui-55.0.9.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.9/expo.modules.ui-55.0.9.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.9/expo.modules.ui-55.0.9.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.9/expo.modules.ui-55.0.9.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.9/expo.modules.ui-55.0.9.pom.sha512 +0 -1
- package/src/jetpack-compose/TextInput/index.tsx +0 -157
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
// Copyright 2026-present 650 Industries. All rights reserved.
|
|
2
|
+
|
|
3
|
+
import ExpoModulesCore
|
|
4
|
+
import SwiftUI
|
|
5
|
+
|
|
6
|
+
internal enum TextContentTypeValue: String, Enumerable {
|
|
7
|
+
// Web addresses
|
|
8
|
+
case url = "URL"
|
|
9
|
+
|
|
10
|
+
// Contacts
|
|
11
|
+
case namePrefix
|
|
12
|
+
case name
|
|
13
|
+
case nameSuffix
|
|
14
|
+
case givenName
|
|
15
|
+
case middleName
|
|
16
|
+
case familyName
|
|
17
|
+
case nickname
|
|
18
|
+
case organizationName
|
|
19
|
+
case jobTitle
|
|
20
|
+
|
|
21
|
+
// Location
|
|
22
|
+
case location
|
|
23
|
+
case fullStreetAddress
|
|
24
|
+
case streetAddressLine1
|
|
25
|
+
case streetAddressLine2
|
|
26
|
+
case addressCity
|
|
27
|
+
case addressCityAndState
|
|
28
|
+
case addressState
|
|
29
|
+
case postalCode
|
|
30
|
+
case sublocality
|
|
31
|
+
case countryName
|
|
32
|
+
|
|
33
|
+
// Accounts
|
|
34
|
+
case username
|
|
35
|
+
case password
|
|
36
|
+
case newPassword
|
|
37
|
+
|
|
38
|
+
// Security
|
|
39
|
+
case oneTimeCode
|
|
40
|
+
|
|
41
|
+
// Communication
|
|
42
|
+
case emailAddress
|
|
43
|
+
case telephoneNumber
|
|
44
|
+
case cellularEID
|
|
45
|
+
case cellularIMEI
|
|
46
|
+
|
|
47
|
+
// Payment
|
|
48
|
+
case creditCardNumber
|
|
49
|
+
case creditCardExpiration
|
|
50
|
+
case creditCardExpirationMonth
|
|
51
|
+
case creditCardExpirationYear
|
|
52
|
+
case creditCardSecurityCode
|
|
53
|
+
case creditCardType
|
|
54
|
+
case creditCardName
|
|
55
|
+
case creditCardGivenName
|
|
56
|
+
case creditCardMiddleName
|
|
57
|
+
case creditCardFamilyName
|
|
58
|
+
|
|
59
|
+
// Birthday
|
|
60
|
+
case birthdate
|
|
61
|
+
case birthdateDay
|
|
62
|
+
case birthdateMonth
|
|
63
|
+
case birthdateYear
|
|
64
|
+
|
|
65
|
+
// Events
|
|
66
|
+
case dateTime
|
|
67
|
+
case flightNumber
|
|
68
|
+
case shipmentTrackingNumber
|
|
69
|
+
|
|
70
|
+
var toUITextContentType: UITextContentType {
|
|
71
|
+
switch self {
|
|
72
|
+
case .url: return .URL
|
|
73
|
+
case .namePrefix: return .namePrefix
|
|
74
|
+
case .name: return .name
|
|
75
|
+
case .nameSuffix: return .nameSuffix
|
|
76
|
+
case .givenName: return .givenName
|
|
77
|
+
case .middleName: return .middleName
|
|
78
|
+
case .familyName: return .familyName
|
|
79
|
+
case .nickname: return .nickname
|
|
80
|
+
case .organizationName: return .organizationName
|
|
81
|
+
case .jobTitle: return .jobTitle
|
|
82
|
+
case .location: return .location
|
|
83
|
+
case .fullStreetAddress: return .fullStreetAddress
|
|
84
|
+
case .streetAddressLine1: return .streetAddressLine1
|
|
85
|
+
case .streetAddressLine2: return .streetAddressLine2
|
|
86
|
+
case .addressCity: return .addressCity
|
|
87
|
+
case .addressCityAndState: return .addressCityAndState
|
|
88
|
+
case .addressState: return .addressState
|
|
89
|
+
case .postalCode: return .postalCode
|
|
90
|
+
case .sublocality: return .sublocality
|
|
91
|
+
case .countryName: return .countryName
|
|
92
|
+
case .username: return .username
|
|
93
|
+
case .password: return .password
|
|
94
|
+
case .newPassword: return .newPassword
|
|
95
|
+
case .oneTimeCode: return .oneTimeCode
|
|
96
|
+
case .emailAddress: return .emailAddress
|
|
97
|
+
case .telephoneNumber: return .telephoneNumber
|
|
98
|
+
case .cellularEID:
|
|
99
|
+
if #available(iOS 17.4, tvOS 17.4, *) {
|
|
100
|
+
return .cellularEID
|
|
101
|
+
}
|
|
102
|
+
return .telephoneNumber
|
|
103
|
+
case .cellularIMEI:
|
|
104
|
+
if #available(iOS 17.4, tvOS 17.4, *) {
|
|
105
|
+
return .cellularIMEI
|
|
106
|
+
}
|
|
107
|
+
return .telephoneNumber
|
|
108
|
+
case .creditCardNumber: return .creditCardNumber
|
|
109
|
+
case .creditCardExpiration:
|
|
110
|
+
if #available(iOS 17.0, tvOS 17.0, *) {
|
|
111
|
+
return .creditCardExpiration
|
|
112
|
+
}
|
|
113
|
+
return .creditCardNumber
|
|
114
|
+
case .creditCardExpirationMonth:
|
|
115
|
+
if #available(iOS 17.0, tvOS 17.0, *) {
|
|
116
|
+
return .creditCardExpirationMonth
|
|
117
|
+
}
|
|
118
|
+
return .creditCardNumber
|
|
119
|
+
case .creditCardExpirationYear:
|
|
120
|
+
if #available(iOS 17.0, tvOS 17.0, *) {
|
|
121
|
+
return .creditCardExpirationYear
|
|
122
|
+
}
|
|
123
|
+
return .creditCardNumber
|
|
124
|
+
case .creditCardSecurityCode:
|
|
125
|
+
if #available(iOS 17.0, tvOS 17.0, *) {
|
|
126
|
+
return .creditCardSecurityCode
|
|
127
|
+
}
|
|
128
|
+
return .creditCardNumber
|
|
129
|
+
case .creditCardType:
|
|
130
|
+
if #available(iOS 17.0, tvOS 17.0, *) {
|
|
131
|
+
return .creditCardType
|
|
132
|
+
}
|
|
133
|
+
return .creditCardNumber
|
|
134
|
+
case .creditCardName:
|
|
135
|
+
if #available(iOS 17.0, tvOS 17.0, *) {
|
|
136
|
+
return .creditCardName
|
|
137
|
+
}
|
|
138
|
+
return .creditCardNumber
|
|
139
|
+
case .creditCardGivenName:
|
|
140
|
+
if #available(iOS 17.0, tvOS 17.0, *) {
|
|
141
|
+
return .creditCardGivenName
|
|
142
|
+
}
|
|
143
|
+
return .creditCardNumber
|
|
144
|
+
case .creditCardMiddleName:
|
|
145
|
+
if #available(iOS 17.0, tvOS 17.0, *) {
|
|
146
|
+
return .creditCardMiddleName
|
|
147
|
+
}
|
|
148
|
+
return .creditCardNumber
|
|
149
|
+
case .creditCardFamilyName:
|
|
150
|
+
if #available(iOS 17.0, tvOS 17.0, *) {
|
|
151
|
+
return .creditCardFamilyName
|
|
152
|
+
}
|
|
153
|
+
return .creditCardNumber
|
|
154
|
+
case .birthdate:
|
|
155
|
+
if #available(iOS 17.0, tvOS 17.0, *) {
|
|
156
|
+
return .birthdate
|
|
157
|
+
}
|
|
158
|
+
return .name
|
|
159
|
+
case .birthdateDay:
|
|
160
|
+
if #available(iOS 17.0, tvOS 17.0, *) {
|
|
161
|
+
return .birthdateDay
|
|
162
|
+
}
|
|
163
|
+
return .name
|
|
164
|
+
case .birthdateMonth:
|
|
165
|
+
if #available(iOS 17.0, tvOS 17.0, *) {
|
|
166
|
+
return .birthdateMonth
|
|
167
|
+
}
|
|
168
|
+
return .name
|
|
169
|
+
case .birthdateYear:
|
|
170
|
+
if #available(iOS 17.0, tvOS 17.0, *) {
|
|
171
|
+
return .birthdateYear
|
|
172
|
+
}
|
|
173
|
+
return .name
|
|
174
|
+
case .dateTime: return .dateTime
|
|
175
|
+
case .flightNumber: return .flightNumber
|
|
176
|
+
case .shipmentTrackingNumber: return .shipmentTrackingNumber
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
internal struct TextContentTypeModifier: ViewModifier, Record {
|
|
182
|
+
@Field var textContentType: TextContentTypeValue?
|
|
183
|
+
|
|
184
|
+
func body(content: Content) -> some View {
|
|
185
|
+
if let textContentType {
|
|
186
|
+
content.textContentType(textContentType.toUITextContentType)
|
|
187
|
+
} else {
|
|
188
|
+
content
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Copyright 2026-present 650 Industries. All rights reserved.
|
|
2
|
+
|
|
3
|
+
import ExpoModulesCore
|
|
4
|
+
import SwiftUI
|
|
5
|
+
|
|
6
|
+
internal enum TextInputAutocapitalizationType: String, Enumerable {
|
|
7
|
+
case never
|
|
8
|
+
case words
|
|
9
|
+
case sentences
|
|
10
|
+
case characters
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
internal struct TextInputAutocapitalizationModifier: ViewModifier, Record {
|
|
14
|
+
@Field var autocapitalization: TextInputAutocapitalizationType = .sentences
|
|
15
|
+
|
|
16
|
+
func body(content: Content) -> some View {
|
|
17
|
+
switch autocapitalization {
|
|
18
|
+
case .never:
|
|
19
|
+
content.textInputAutocapitalization(.never)
|
|
20
|
+
case .words:
|
|
21
|
+
content.textInputAutocapitalization(.words)
|
|
22
|
+
case .sentences:
|
|
23
|
+
content.textInputAutocapitalization(.sentences)
|
|
24
|
+
case .characters:
|
|
25
|
+
content.textInputAutocapitalization(.characters)
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -985,14 +985,6 @@ internal struct LineSpacing: ViewModifier, Record {
|
|
|
985
985
|
}
|
|
986
986
|
}
|
|
987
987
|
|
|
988
|
-
internal struct LineLimitModifier: ViewModifier, Record {
|
|
989
|
-
@Field var limit: Int?
|
|
990
|
-
|
|
991
|
-
func body(content: Content) -> some View {
|
|
992
|
-
content.lineLimit(limit)
|
|
993
|
-
}
|
|
994
|
-
}
|
|
995
|
-
|
|
996
988
|
internal enum Prominence: String, Enumerable {
|
|
997
989
|
case standard
|
|
998
990
|
case increased
|
|
@@ -1826,6 +1818,14 @@ extension ViewModifierRegistry {
|
|
|
1826
1818
|
return try TagModifier(from: params, appContext: appContext)
|
|
1827
1819
|
}
|
|
1828
1820
|
|
|
1821
|
+
register("scrollTargetBehavior") { params, appContext, _ in
|
|
1822
|
+
return try ScrollTargetBehaviorModifier(from: params, appContext: appContext)
|
|
1823
|
+
}
|
|
1824
|
+
|
|
1825
|
+
register("scrollTargetLayout") { params, appContext, _ in
|
|
1826
|
+
return try ScrollTargetLayoutModifier(from: params, appContext: appContext)
|
|
1827
|
+
}
|
|
1828
|
+
|
|
1829
1829
|
register("pickerStyle") { params, appContext, _ in
|
|
1830
1830
|
return try PickerStyleModifier(from: params, appContext: appContext)
|
|
1831
1831
|
}
|
|
@@ -1834,6 +1834,14 @@ extension ViewModifierRegistry {
|
|
|
1834
1834
|
return try SubmitLabelModifier(from: params, appContext: appContext)
|
|
1835
1835
|
}
|
|
1836
1836
|
|
|
1837
|
+
register("textInputAutocapitalization") { params, appContext, _ in
|
|
1838
|
+
return try TextInputAutocapitalizationModifier(from: params, appContext: appContext)
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1841
|
+
register("textContentType") { params, appContext, _ in
|
|
1842
|
+
return try TextContentTypeModifier(from: params, appContext: appContext)
|
|
1843
|
+
}
|
|
1844
|
+
|
|
1837
1845
|
register("datePickerStyle") { params, appContext, _ in
|
|
1838
1846
|
return try DatePickerStyleModifier(from: params, appContext: appContext)
|
|
1839
1847
|
}
|
|
@@ -1897,5 +1905,17 @@ extension ViewModifierRegistry {
|
|
|
1897
1905
|
register("widgetURL") { params, appContext, _ in
|
|
1898
1906
|
return try WidgetURLModifier(from: params, appContext: appContext)
|
|
1899
1907
|
}
|
|
1908
|
+
|
|
1909
|
+
register("keyboardType") { params, appContext, _ in
|
|
1910
|
+
return try KeyboardTypeModifier(from: params, appContext: appContext)
|
|
1911
|
+
}
|
|
1912
|
+
|
|
1913
|
+
register("autocorrectionDisabled") { params, appContext, _ in
|
|
1914
|
+
return try AutocorrectionDisabledModifier(from: params, appContext: appContext)
|
|
1915
|
+
}
|
|
1916
|
+
|
|
1917
|
+
register("onSubmit") { params, appContext, eventDispatcher in
|
|
1918
|
+
return try OnSubmitModifier(from: params, appContext: appContext, eventDispatcher: eventDispatcher)
|
|
1919
|
+
}
|
|
1900
1920
|
}
|
|
1901
1921
|
}
|
|
@@ -3,12 +3,10 @@ import ExpoModulesCore
|
|
|
3
3
|
|
|
4
4
|
final class SecureFieldProps: UIBaseViewProps {
|
|
5
5
|
@Field var defaultValue: String = ""
|
|
6
|
-
@Field var placeholder: String = ""
|
|
7
|
-
@Field var keyboardType: KeyboardType = KeyboardType.defaultKeyboard
|
|
8
6
|
@Field var autoFocus: Bool = false
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
7
|
+
@Field var placeholder: String = ""
|
|
8
|
+
var onValueChange = EventDispatcher()
|
|
9
|
+
var onFocusChange = EventDispatcher()
|
|
12
10
|
}
|
|
13
11
|
|
|
14
12
|
struct SecureFieldView: ExpoSwiftUI.View, ExpoSwiftUI.FocusableView {
|
|
@@ -46,11 +44,7 @@ struct SecureFieldView: ExpoSwiftUI.View, ExpoSwiftUI.FocusableView {
|
|
|
46
44
|
props.placeholder,
|
|
47
45
|
text: $textManager.text
|
|
48
46
|
)
|
|
49
|
-
.fixedSize(horizontal: false, vertical: true)
|
|
50
47
|
.focused($isFocused)
|
|
51
|
-
.onSubmit({
|
|
52
|
-
props.onSubmit(["value": textManager.text])
|
|
53
|
-
})
|
|
54
48
|
.onAppear {
|
|
55
49
|
textManager.text = props.defaultValue
|
|
56
50
|
if props.autoFocus {
|
|
@@ -58,15 +52,14 @@ struct SecureFieldView: ExpoSwiftUI.View, ExpoSwiftUI.FocusableView {
|
|
|
58
52
|
}
|
|
59
53
|
}
|
|
60
54
|
.onChange(of: textManager.text) { newValue in
|
|
61
|
-
props.
|
|
55
|
+
props.onValueChange(["value": newValue])
|
|
62
56
|
}
|
|
63
57
|
.onChange(of: textManager.isFocused) { newValue in
|
|
64
58
|
isFocused = newValue
|
|
65
59
|
}
|
|
66
60
|
.onChange(of: isFocused) { newValue in
|
|
67
61
|
textManager.isFocused = newValue
|
|
68
|
-
props.
|
|
62
|
+
props.onFocusChange(["value": newValue])
|
|
69
63
|
}
|
|
70
|
-
.keyboardType(getKeyboardType(props.keyboardType))
|
|
71
64
|
}
|
|
72
65
|
}
|
package/ios/TextFieldView.swift
CHANGED
|
@@ -1,66 +1,19 @@
|
|
|
1
1
|
import SwiftUI
|
|
2
2
|
import ExpoModulesCore
|
|
3
3
|
|
|
4
|
-
enum
|
|
5
|
-
case
|
|
6
|
-
case
|
|
7
|
-
case numeric = "numeric"
|
|
8
|
-
case phonePad = "phone-pad"
|
|
9
|
-
case asciiCapable = "ascii-capable"
|
|
10
|
-
case numbersAndPunctuation = "numbers-and-punctuation"
|
|
11
|
-
case url = "url"
|
|
12
|
-
case namePhonePad = "name-phone-pad"
|
|
13
|
-
case decimalPad = "decimal-pad"
|
|
14
|
-
case twitter = "twitter"
|
|
15
|
-
case webSearch = "web-search"
|
|
16
|
-
case asciiCapableNumberPad = "ascii-capable-number-pad"
|
|
4
|
+
enum TextFieldAxis: String, Enumerable {
|
|
5
|
+
case horizontal
|
|
6
|
+
case vertical
|
|
17
7
|
}
|
|
18
8
|
|
|
19
9
|
final class TextFieldProps: UIBaseViewProps {
|
|
20
10
|
@Field var defaultValue: String = ""
|
|
21
|
-
@Field var placeholder: String = ""
|
|
22
|
-
@Field var multiline: Bool = false
|
|
23
|
-
@Field var numberOfLines: Int?
|
|
24
|
-
@Field var keyboardType: KeyboardType = KeyboardType.defaultKeyboard
|
|
25
|
-
@Field var autocorrection: Bool = true
|
|
26
|
-
@Field var allowNewlines: Bool = true
|
|
27
11
|
@Field var autoFocus: Bool = false
|
|
28
|
-
var
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
func getKeyboardType(_ keyboardType: KeyboardType?) -> UIKeyboardType {
|
|
35
|
-
guard let keyboardType = keyboardType else {
|
|
36
|
-
return .default
|
|
37
|
-
}
|
|
38
|
-
switch keyboardType {
|
|
39
|
-
case .defaultKeyboard:
|
|
40
|
-
return .default
|
|
41
|
-
case .emailAddress:
|
|
42
|
-
return .emailAddress
|
|
43
|
-
case .numeric:
|
|
44
|
-
return .numberPad
|
|
45
|
-
case .phonePad:
|
|
46
|
-
return .phonePad
|
|
47
|
-
case .asciiCapable:
|
|
48
|
-
return .asciiCapable
|
|
49
|
-
case .numbersAndPunctuation:
|
|
50
|
-
return .numbersAndPunctuation
|
|
51
|
-
case .url:
|
|
52
|
-
return .URL
|
|
53
|
-
case .namePhonePad:
|
|
54
|
-
return .namePhonePad
|
|
55
|
-
case .decimalPad:
|
|
56
|
-
return .decimalPad
|
|
57
|
-
case .twitter:
|
|
58
|
-
return .twitter
|
|
59
|
-
case .webSearch:
|
|
60
|
-
return .webSearch
|
|
61
|
-
case .asciiCapableNumberPad:
|
|
62
|
-
return .asciiCapableNumberPad
|
|
63
|
-
}
|
|
12
|
+
@Field var placeholder: String = ""
|
|
13
|
+
@Field var axis: TextFieldAxis = .horizontal
|
|
14
|
+
var onValueChange = EventDispatcher()
|
|
15
|
+
var onFocusChange = EventDispatcher()
|
|
16
|
+
var onSelectionChange = EventDispatcher()
|
|
64
17
|
}
|
|
65
18
|
|
|
66
19
|
class TextFieldManager: ObservableObject {
|
|
@@ -82,14 +35,6 @@ class TextFieldManager: ObservableObject {
|
|
|
82
35
|
}
|
|
83
36
|
}
|
|
84
37
|
|
|
85
|
-
func allowMultiLine() -> Bool {
|
|
86
|
-
#if os(tvOS)
|
|
87
|
-
return false
|
|
88
|
-
#else
|
|
89
|
-
return true
|
|
90
|
-
#endif
|
|
91
|
-
}
|
|
92
|
-
|
|
93
38
|
struct TextFieldView: ExpoSwiftUI.View, ExpoSwiftUI.FocusableView {
|
|
94
39
|
@ObservedObject var props: TextFieldProps
|
|
95
40
|
@ObservedObject var textManager: TextFieldManager = TextFieldManager()
|
|
@@ -132,60 +77,47 @@ struct TextFieldView: ExpoSwiftUI.View, ExpoSwiftUI.FocusableView {
|
|
|
132
77
|
#endif
|
|
133
78
|
}
|
|
134
79
|
|
|
135
|
-
var
|
|
136
|
-
|
|
80
|
+
private var swiftUIAxis: Axis {
|
|
81
|
+
props.axis == .vertical ? .vertical : .horizontal
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@ViewBuilder
|
|
85
|
+
var textField: some View {
|
|
86
|
+
if #available(iOS 18.0, macOS 15.0, tvOS 18.0, *) {
|
|
137
87
|
#if !os(tvOS)
|
|
138
88
|
TextField(
|
|
139
89
|
props.placeholder,
|
|
140
90
|
text: $textManager.text,
|
|
141
91
|
selection: $textManager.selection,
|
|
142
|
-
axis:
|
|
92
|
+
axis: swiftUIAxis
|
|
143
93
|
)
|
|
94
|
+
.focused($isFocused)
|
|
144
95
|
#else
|
|
145
96
|
TextField(
|
|
146
97
|
props.placeholder,
|
|
147
98
|
text: $textManager.text,
|
|
148
|
-
axis:
|
|
99
|
+
axis: swiftUIAxis
|
|
149
100
|
)
|
|
101
|
+
.focused($isFocused)
|
|
150
102
|
#endif
|
|
151
103
|
} else if #available(iOS 16.0, tvOS 16.0, *) {
|
|
152
104
|
TextField(
|
|
153
105
|
props.placeholder,
|
|
154
106
|
text: $textManager.text,
|
|
155
|
-
axis:
|
|
107
|
+
axis: swiftUIAxis
|
|
156
108
|
)
|
|
109
|
+
.focused($isFocused)
|
|
157
110
|
} else {
|
|
158
111
|
TextField(
|
|
159
112
|
props.placeholder,
|
|
160
113
|
text: $textManager.text
|
|
161
114
|
)
|
|
162
|
-
}
|
|
163
|
-
return text.lineLimit((props.multiline && allowMultiLine()) ? props.numberOfLines : 1)
|
|
164
|
-
.fixedSize(horizontal: false, vertical: true)
|
|
165
|
-
.keyboardType(getKeyboardType(props.keyboardType))
|
|
166
|
-
.autocorrectionDisabled(!props.autocorrection)
|
|
167
115
|
.focused($isFocused)
|
|
168
|
-
|
|
169
|
-
if props.allowNewlines && props.multiline && allowMultiLine() {
|
|
170
|
-
if textManager.text.filter({ $0 == "\n" }).count < props.numberOfLines ?? Int.max - 1 {
|
|
171
|
-
textManager.text.append("\n")
|
|
172
|
-
|
|
173
|
-
// when selection state is set, the cursor does not auto update to added newline
|
|
174
|
-
#if !os(tvOS)
|
|
175
|
-
if #available(iOS 18.0, macOS 15.0, *) {
|
|
176
|
-
let cursorPosition = textManager.text.endIndex
|
|
177
|
-
textManager.selection = SwiftUI.TextSelection(range: cursorPosition..<cursorPosition)
|
|
178
|
-
}
|
|
179
|
-
#endif
|
|
180
|
-
}
|
|
181
|
-
isFocused = true
|
|
182
|
-
}
|
|
183
|
-
props.onSubmit(["value": textManager.text])
|
|
184
|
-
})
|
|
116
|
+
}
|
|
185
117
|
}
|
|
186
118
|
|
|
187
119
|
var body: some View {
|
|
188
|
-
let baseView =
|
|
120
|
+
let baseView = textField
|
|
189
121
|
.onAppear {
|
|
190
122
|
textManager.text = props.defaultValue
|
|
191
123
|
if props.autoFocus {
|
|
@@ -193,14 +125,14 @@ struct TextFieldView: ExpoSwiftUI.View, ExpoSwiftUI.FocusableView {
|
|
|
193
125
|
}
|
|
194
126
|
}
|
|
195
127
|
.onChange(of: textManager.text) { newValue in
|
|
196
|
-
props.
|
|
128
|
+
props.onValueChange(["value": newValue])
|
|
197
129
|
}
|
|
198
130
|
.onChange(of: textManager.isFocused) { newValue in
|
|
199
131
|
isFocused = newValue
|
|
200
132
|
}
|
|
201
133
|
.onChange(of: isFocused) { newValue in
|
|
202
134
|
textManager.isFocused = newValue
|
|
203
|
-
props.
|
|
135
|
+
props.onFocusChange(["value": newValue])
|
|
204
136
|
}
|
|
205
137
|
|
|
206
138
|
#if !os(tvOS)
|
|
@@ -213,7 +145,7 @@ struct TextFieldView: ExpoSwiftUI.View, ExpoSwiftUI.FocusableView {
|
|
|
213
145
|
|
|
214
146
|
let start = textManager.text.distance(from: textManager.text.startIndex, to: clampedLower)
|
|
215
147
|
let end = textManager.text.distance(from: textManager.text.startIndex, to: clampedUpper)
|
|
216
|
-
props.
|
|
148
|
+
props.onSelectionChange(["start": start, "end": end])
|
|
217
149
|
}
|
|
218
150
|
}
|
|
219
151
|
}
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
867d5885bc0a30e6c34e5559c030609c
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
f8c9ace39c912ab1cdf6a71d39e968c305e31153
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
70de253a9147c6ff1cf1874e6cdb587183aaabcbe10631ab4051f0ad254c54d5
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
08d65b836394cc88f152cfb2a1ee79ae229155b54ab069dac6a7bfe4cabd8a30b09428b5261025453b3289aa6b1d4aeffca52365e74aefb4af9ade252a1c80a9
|
|
Binary file
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.11/expo.modules.ui-55.0.11.aar.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7b371c66845dbf67635d20082532b752
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.11/expo.modules.ui-55.0.11.aar.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ff635efe00b621675925f4799e500bfd51d3716e
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.11/expo.modules.ui-55.0.11.aar.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3f5ed3a5af84ec2ad3f936f28e0be63971ebd17006aac943818fcdbed5e6f659
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.11/expo.modules.ui-55.0.11.aar.sha512
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
808b352ca5908016e70ca2686f59300b6bb10e1ccaf90bc89c7b13cf7f635ada21a2200a5bb32bb7739be25571f48242224e422d099c21e1d784265013ce1294
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "expo.modules.ui",
|
|
5
5
|
"module": "expo.modules.ui",
|
|
6
|
-
"version": "55.0.
|
|
6
|
+
"version": "55.0.11",
|
|
7
7
|
"attributes": {
|
|
8
8
|
"org.gradle.status": "release"
|
|
9
9
|
}
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
{
|
|
27
|
-
"name": "expo.modules.ui-55.0.
|
|
28
|
-
"url": "expo.modules.ui-55.0.
|
|
29
|
-
"size":
|
|
30
|
-
"sha512": "
|
|
31
|
-
"sha256": "
|
|
32
|
-
"sha1": "
|
|
33
|
-
"md5": "
|
|
27
|
+
"name": "expo.modules.ui-55.0.11.aar",
|
|
28
|
+
"url": "expo.modules.ui-55.0.11.aar",
|
|
29
|
+
"size": 1078328,
|
|
30
|
+
"sha512": "808b352ca5908016e70ca2686f59300b6bb10e1ccaf90bc89c7b13cf7f635ada21a2200a5bb32bb7739be25571f48242224e422d099c21e1d784265013ce1294",
|
|
31
|
+
"sha256": "3f5ed3a5af84ec2ad3f936f28e0be63971ebd17006aac943818fcdbed5e6f659",
|
|
32
|
+
"sha1": "ff635efe00b621675925f4799e500bfd51d3716e",
|
|
33
|
+
"md5": "7b371c66845dbf67635d20082532b752"
|
|
34
34
|
}
|
|
35
35
|
]
|
|
36
36
|
},
|
|
@@ -120,13 +120,13 @@
|
|
|
120
120
|
],
|
|
121
121
|
"files": [
|
|
122
122
|
{
|
|
123
|
-
"name": "expo.modules.ui-55.0.
|
|
124
|
-
"url": "expo.modules.ui-55.0.
|
|
125
|
-
"size":
|
|
126
|
-
"sha512": "
|
|
127
|
-
"sha256": "
|
|
128
|
-
"sha1": "
|
|
129
|
-
"md5": "
|
|
123
|
+
"name": "expo.modules.ui-55.0.11.aar",
|
|
124
|
+
"url": "expo.modules.ui-55.0.11.aar",
|
|
125
|
+
"size": 1078328,
|
|
126
|
+
"sha512": "808b352ca5908016e70ca2686f59300b6bb10e1ccaf90bc89c7b13cf7f635ada21a2200a5bb32bb7739be25571f48242224e422d099c21e1d784265013ce1294",
|
|
127
|
+
"sha256": "3f5ed3a5af84ec2ad3f936f28e0be63971ebd17006aac943818fcdbed5e6f659",
|
|
128
|
+
"sha1": "ff635efe00b621675925f4799e500bfd51d3716e",
|
|
129
|
+
"md5": "7b371c66845dbf67635d20082532b752"
|
|
130
130
|
}
|
|
131
131
|
]
|
|
132
132
|
},
|
|
@@ -140,13 +140,13 @@
|
|
|
140
140
|
},
|
|
141
141
|
"files": [
|
|
142
142
|
{
|
|
143
|
-
"name": "expo.modules.ui-55.0.
|
|
144
|
-
"url": "expo.modules.ui-55.0.
|
|
145
|
-
"size":
|
|
146
|
-
"sha512": "
|
|
147
|
-
"sha256": "
|
|
148
|
-
"sha1": "
|
|
149
|
-
"md5": "
|
|
143
|
+
"name": "expo.modules.ui-55.0.11-sources.jar",
|
|
144
|
+
"url": "expo.modules.ui-55.0.11-sources.jar",
|
|
145
|
+
"size": 68147,
|
|
146
|
+
"sha512": "08d65b836394cc88f152cfb2a1ee79ae229155b54ab069dac6a7bfe4cabd8a30b09428b5261025453b3289aa6b1d4aeffca52365e74aefb4af9ade252a1c80a9",
|
|
147
|
+
"sha256": "70de253a9147c6ff1cf1874e6cdb587183aaabcbe10631ab4051f0ad254c54d5",
|
|
148
|
+
"sha1": "f8c9ace39c912ab1cdf6a71d39e968c305e31153",
|
|
149
|
+
"md5": "867d5885bc0a30e6c34e5559c030609c"
|
|
150
150
|
}
|
|
151
151
|
]
|
|
152
152
|
}
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.11/expo.modules.ui-55.0.11.module.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a4e52858cff677077967e16735895247
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.11/expo.modules.ui-55.0.11.module.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ff7435751d191feab9e4269a64ae3fdfb232303a
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3bba2f6a3f6c281ce62c4f426e1cf58de159cf64caf990082930b5e801d9f7a5
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7707b44bc8dbe7ce846f224d26af235fc0c01e24522880fd8a6a60f045ca6ff17b407f11ed4896f6de0b69f2a6d8975dfd1b364747f9a18c7fa93f99f59dc92e
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<modelVersion>4.0.0</modelVersion>
|
|
10
10
|
<groupId>expo.modules.ui</groupId>
|
|
11
11
|
<artifactId>expo.modules.ui</artifactId>
|
|
12
|
-
<version>55.0.
|
|
12
|
+
<version>55.0.11</version>
|
|
13
13
|
<packaging>aar</packaging>
|
|
14
14
|
<name>expo.modules.ui</name>
|
|
15
15
|
<url>https://github.com/expo/expo</url>
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.11/expo.modules.ui-55.0.11.pom.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ebb34c266d2957719e21147dd181439f
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.11/expo.modules.ui-55.0.11.pom.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
e32abfad99f23e44f76a85b7bf8a7a96bb5726b7
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.11/expo.modules.ui-55.0.11.pom.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3be2ed26f75ecd062b2b0c3dfa80c885a087b1d310d7b5b15da068acf26ce21b
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.11/expo.modules.ui-55.0.11.pom.sha512
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
b6c981bdc7215c9927ea9d9a0e6856ef40fbe0a65cc89fc6ad47f46040fe6d887354635cc8e2d06fe0e67b8eb6ed7765a4063c4dfda99d364a2a37f7c1e72c03
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<groupId>expo.modules.ui</groupId>
|
|
4
4
|
<artifactId>expo.modules.ui</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>55.0.
|
|
7
|
-
<release>55.0.
|
|
6
|
+
<latest>55.0.11</latest>
|
|
7
|
+
<release>55.0.11</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>55.0.
|
|
9
|
+
<version>55.0.11</version>
|
|
10
10
|
</versions>
|
|
11
|
-
<lastUpdated>
|
|
11
|
+
<lastUpdated>20260409135101</lastUpdated>
|
|
12
12
|
</versioning>
|
|
13
13
|
</metadata>
|