@@ -9,6 +9,16 @@ external view: ReasonReact.reactClass = "TextInput";
99
1010[@ bs . send ] external blur : ReasonReact . reactRef => unit = "" ;
1111
12+ type editingEvent = {
13+ .
14+ "nativeEvent": {
15+ .
16+ "text": string ,
17+ "eventCount": int ,
18+ "target": int ,
19+ },
20+ };
21+
1222let make =
1323 (
1424 ~accessibilityLabel=?,
@@ -47,14 +57,14 @@ let make =
4757 ~maxLength=?,
4858 ~multiline=?,
4959 ~onBlur=?,
50- ~onChange=?,
5160 ~onChangeText=?,
52- ~onContentSizeChange =?,
61+ ~onChange =?,
5362 ~onEndEditing=?,
63+ ~onSubmitEditing=?,
64+ ~onContentSizeChange=?,
5465 ~onFocus=?,
5566 ~onScroll=?,
5667 ~onSelectionChange=?,
57- ~onSubmitEditing=?,
5868 ~placeholder=?,
5969 ~placeholderTextColor=?,
6070 ~returnKeyType=?,
@@ -86,86 +96,82 @@ let make =
8696 ViewProps . extend(
8797 {
8898 "autoCapitalize" :
89- autoCapitalize
90- -> Belt . Option . map(
91- fun
92- | ` none => "none"
93- | ` sentences => "sentences"
94- | ` words => "words"
95- | ` characters => "characters" ,
96- ),
99+ autoCapitalize-> Belt . Option . map(
100+ fun
101+ | ` none => "none"
102+ | ` sentences => "sentences"
103+ | ` words => "words"
104+ | ` characters => "characters" ,
105+ ),
97106 "autoComplete" :
98- autoComplete
99- -> Belt . Option . map(
100- fun
101- | ` off => "off"
102- | ` username => "username"
103- | ` password => "password"
104- | ` email => "email"
105- | ` name => "name"
106- | ` tel => "tel"
107- | ` streetAddress => "street-address"
108- | ` postalCode => "postal-code"
109- | ` ccNumber => "cc-number"
110- | ` ccCsc => "cc-csc"
111- | ` ccExp => "cc-exp"
112- | ` ccExpMonth => "cc-exp-month"
113- | ` ccExpYear => "cc-exp-year" ,
114- ),
107+ autoComplete-> Belt . Option . map(
108+ fun
109+ | ` off => "off"
110+ | ` username => "username"
111+ | ` password => "password"
112+ | ` email => "email"
113+ | ` name => "name"
114+ | ` tel => "tel"
115+ | ` streetAddress => "street-address"
116+ | ` postalCode => "postal-code"
117+ | ` ccNumber => "cc-number"
118+ | ` ccCsc => "cc-csc"
119+ | ` ccExp => "cc-exp"
120+ | ` ccExpMonth => "cc-exp-month"
121+ | ` ccExpYear => "cc-exp-year" ,
122+ ),
115123 "autoCorrect" : autoCorrect,
116124 "autoFocus" : autoFocus,
117125 "blurOnSubmit" : blurOnSubmit,
118126 "caretHidden" : caretHidden,
119127 "defaultValue" : defaultValue,
120128 "editable" : editable,
121129 "keyboardType" :
122- keyboardType
123- -> Belt . Option . map(
124- fun
125- | ` default => "default"
126- | ` emailAddress => "email-address"
127- | ` numeric => "numeric"
128- | ` phonePad => "phone-pad"
129- | ` asciiCapable => "ascii-capable"
130- | ` numbersAndPunctuation => "numbers-and-punctuation"
131- | ` url => "url"
132- | ` numberPad => "number-pad"
133- | ` namePhonePad => "name-phone-pad"
134- | ` decimalPad => "decimal-pad"
135- | ` twitter => "twitter"
136- | ` webSearch => "web-search" ,
137- ),
130+ keyboardType-> Belt . Option . map(
131+ fun
132+ | ` default => "default"
133+ | ` emailAddress => "email-address"
134+ | ` numeric => "numeric"
135+ | ` phonePad => "phone-pad"
136+ | ` asciiCapable => "ascii-capable"
137+ | ` numbersAndPunctuation => "numbers-and-punctuation"
138+ | ` url => "url"
139+ | ` numberPad => "number-pad"
140+ | ` namePhonePad => "name-phone-pad"
141+ | ` decimalPad => "decimal-pad"
142+ | ` twitter => "twitter"
143+ | ` webSearch => "web-search" ,
144+ ),
138145 "maxLength" : maxLength,
139146 "multiline" : multiline,
140147 "onBlur" : onBlur,
141- "onChange" : onChange,
142148 "onChangeText" : onChangeText,
143- "onContentSizeChange " : onContentSizeChange ,
149+ "onChange " : onChange ,
144150 "onEndEditing" : onEndEditing,
151+ "onSubmitEditing" : onSubmitEditing,
152+ "onContentSizeChange" : onContentSizeChange,
145153 "onFocus" : onFocus,
146154 "onScroll" : onScroll,
147155 "onSelectionChange" : onSelectionChange,
148- "onSubmitEditing" : onSubmitEditing,
149156 "placeholder" : placeholder,
150157 "placeholderTextColor" : placeholderTextColor,
151158 "returnKeyType" :
152- returnKeyType
153- -> Belt . Option . map(
154- fun
155- | ` done_ => "done"
156- | ` go => "go"
157- | ` next => "next"
158- | ` search => "search"
159- | ` send => "send"
160- | ` none => "none"
161- | ` previous => "previous"
162- | ` default => "default"
163- | ` emergencyCall => "emergencyCall"
164- | ` google => "google"
165- | ` join => "join"
166- | ` route => "route"
167- | ` yahoo => "yahoo" ,
168- ),
159+ returnKeyType-> Belt . Option . map(
160+ fun
161+ | ` done_ => "done"
162+ | ` go => "go"
163+ | ` next => "next"
164+ | ` search => "search"
165+ | ` send => "send"
166+ | ` none => "none"
167+ | ` previous => "previous"
168+ | ` default => "default"
169+ | ` emergencyCall => "emergencyCall"
170+ | ` google => "google"
171+ | ` join => "join"
172+ | ` route => "route"
173+ | ` yahoo => "yahoo" ,
174+ ),
169175 "secureTextEntry" : secureTextEntry,
170176 "selectTextOnFocus" : selectTextOnFocus,
171177 "selection" : selection,
@@ -178,45 +184,41 @@ let make =
178184 "numberOfLines" : numberOfLines,
179185 "returnKeyLabel" : returnKeyLabel,
180186 "textBreakStrategy" :
181- textBreakStrategy
182- -> Belt . Option . map(
183- fun
184- | ` simple => "simple"
185- | ` highQuality => "highQuality"
186- | ` balanced => "balanced" ,
187- ),
187+ textBreakStrategy-> Belt . Option . map(
188+ fun
189+ | ` simple => "simple"
190+ | ` highQuality => "highQuality"
191+ | ` balanced => "balanced" ,
192+ ),
188193 "underlineColorAndroid" : underlineColorAndroid,
189194 "clearButtonMode" :
190- clearButtonMode
191- -> Belt . Option . map(
192- fun
193- | ` never => "never"
194- | ` whileEditing => "while-editing"
195- | ` unlessEditing => "unless-editing"
196- | ` always => "always" ,
197- ),
195+ clearButtonMode-> Belt . Option . map(
196+ fun
197+ | ` never => "never"
198+ | ` whileEditing => "while-editing"
199+ | ` unlessEditing => "unless-editing"
200+ | ` always => "always" ,
201+ ),
198202 "clearTextOnFocus" : clearTextOnFocus,
199203 "dataDetectorTypes" :
200- dataDetectorTypes
201- -> Belt . Option . map(
202- Array . map(
203- fun
204- | ` phoneNumber => "phoneNumber"
205- | ` link => "link"
206- | ` calendarEvent => "calendarEvent"
207- | ` none => "none"
208- | ` all => "all" ,
209- ),
204+ dataDetectorTypes-> Belt . Option . map(
205+ Array . map(
206+ fun
207+ | ` phoneNumber => "phoneNumber"
208+ | ` link => "link"
209+ | ` calendarEvent => "calendarEvent"
210+ | ` none => "none"
211+ | ` all => "all" ,
210212 ),
213+ ),
211214 "enablesReturnKeyAutomatically" : enablesReturnKeyAutomatically,
212215 "keyboardAppearance" :
213- keyboardAppearance
214- -> Belt . Option . map(
215- fun
216- | ` default => "never"
217- | ` light => "light"
218- | ` dark => "dark" ,
219- ),
216+ keyboardAppearance-> Belt . Option . map(
217+ fun
218+ | ` default => "never"
219+ | ` light => "light"
220+ | ` dark => "dark" ,
221+ ),
220222 "onKeyPress" : onKeyPress,
221223 "selectionState" : selectionState,
222224 "spellCheck" : spellCheck,
0 commit comments