@react-aria/numberfield 3.9.1 → 3.10.0
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/dist/import.mjs +89 -77
- package/dist/main.js +90 -77
- package/dist/main.js.map +1 -1
- package/dist/module.js +89 -77
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +12 -13
- package/src/useNumberField.ts +22 -12
package/dist/import.mjs
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import {useId as $gfhJl$useId, isIPhone as $gfhJl$isIPhone, isAndroid as $gfhJl$isAndroid, filterDOMProps as $gfhJl$filterDOMProps, chain as $gfhJl$chain, useFormReset as $gfhJl$useFormReset, mergeProps as $gfhJl$mergeProps, isIOS as $gfhJl$isIOS} from "@react-aria/utils";
|
|
2
2
|
import {useMemo as $gfhJl$useMemo, useState as $gfhJl$useState, useCallback as $gfhJl$useCallback} from "react";
|
|
3
|
+
import {privateValidationStateProp as $gfhJl$privateValidationStateProp} from "@react-stately/form";
|
|
3
4
|
import {useFocus as $gfhJl$useFocus, useFocusWithin as $gfhJl$useFocusWithin, useScrollWheel as $gfhJl$useScrollWheel} from "@react-aria/interactions";
|
|
4
5
|
import {useFormattedTextField as $gfhJl$useFormattedTextField} from "@react-aria/textfield";
|
|
5
6
|
import {useLocalizedStringFormatter as $gfhJl$useLocalizedStringFormatter, useNumberFormatter as $gfhJl$useNumberFormatter} from "@react-aria/i18n";
|
|
6
7
|
import {useSpinButton as $gfhJl$useSpinButton} from "@react-aria/spinbutton";
|
|
7
8
|
|
|
9
|
+
|
|
8
10
|
function $parcel$interopDefault(a) {
|
|
9
11
|
return a && a.__esModule ? a.default : a;
|
|
10
12
|
}
|
|
@@ -33,32 +35,32 @@ function $parcel$interopDefault(a) {
|
|
|
33
35
|
var $280a227d7cb94b92$exports = {};
|
|
34
36
|
var $fb78e0f6ab6349ed$exports = {};
|
|
35
37
|
$fb78e0f6ab6349ed$exports = {
|
|
36
|
-
"decrease": (args)
|
|
37
|
-
"increase": (args)
|
|
38
|
-
"numberField":
|
|
38
|
+
"decrease": (args)=>`\u{62E}\u{641}\u{636} ${args.fieldLabel}`,
|
|
39
|
+
"increase": (args)=>`\u{632}\u{64A}\u{627}\u{62F}\u{629} ${args.fieldLabel}`,
|
|
40
|
+
"numberField": `\u{62D}\u{642}\u{644} \u{631}\u{642}\u{645}\u{64A}`
|
|
39
41
|
};
|
|
40
42
|
|
|
41
43
|
|
|
42
44
|
var $2776acdd9959a647$exports = {};
|
|
43
45
|
$2776acdd9959a647$exports = {
|
|
44
|
-
"decrease": (args)
|
|
45
|
-
"increase": (args)
|
|
46
|
-
"numberField":
|
|
46
|
+
"decrease": (args)=>`\u{41D}\u{430}\u{43C}\u{430}\u{43B}\u{44F}\u{432}\u{430}\u{43D}\u{435} ${args.fieldLabel}`,
|
|
47
|
+
"increase": (args)=>`\u{423}\u{441}\u{438}\u{43B}\u{432}\u{430}\u{43D}\u{435} ${args.fieldLabel}`,
|
|
48
|
+
"numberField": `\u{41D}\u{43E}\u{43C}\u{435}\u{440} \u{43D}\u{430} \u{43F}\u{43E}\u{43B}\u{435}\u{442}\u{43E}`
|
|
47
49
|
};
|
|
48
50
|
|
|
49
51
|
|
|
50
52
|
var $741954410a365ad3$exports = {};
|
|
51
53
|
$741954410a365ad3$exports = {
|
|
52
|
-
"decrease": (args)=>`
|
|
53
|
-
"increase": (args)=>`
|
|
54
|
-
"numberField":
|
|
54
|
+
"decrease": (args)=>`Sn\xed\u{17E}it ${args.fieldLabel}`,
|
|
55
|
+
"increase": (args)=>`Zv\xfd\u{161}it ${args.fieldLabel}`,
|
|
56
|
+
"numberField": `\u{10C}\xedseln\xe9 pole`
|
|
55
57
|
};
|
|
56
58
|
|
|
57
59
|
|
|
58
60
|
var $8321ed0f8ab642f0$exports = {};
|
|
59
61
|
$8321ed0f8ab642f0$exports = {
|
|
60
62
|
"decrease": (args)=>`Reducer ${args.fieldLabel}`,
|
|
61
|
-
"increase": (args)
|
|
63
|
+
"increase": (args)=>`\xd8g ${args.fieldLabel}`,
|
|
62
64
|
"numberField": `Talfelt`
|
|
63
65
|
};
|
|
64
66
|
|
|
@@ -66,16 +68,16 @@ $8321ed0f8ab642f0$exports = {
|
|
|
66
68
|
var $92978e0c4ecafa32$exports = {};
|
|
67
69
|
$92978e0c4ecafa32$exports = {
|
|
68
70
|
"decrease": (args)=>`${args.fieldLabel} verringern`,
|
|
69
|
-
"increase": (args)=>`${args.fieldLabel}
|
|
71
|
+
"increase": (args)=>`${args.fieldLabel} erh\xf6hen`,
|
|
70
72
|
"numberField": `Nummernfeld`
|
|
71
73
|
};
|
|
72
74
|
|
|
73
75
|
|
|
74
76
|
var $ac5ff71962864a84$exports = {};
|
|
75
77
|
$ac5ff71962864a84$exports = {
|
|
76
|
-
"decrease": (args)
|
|
77
|
-
"increase": (args)
|
|
78
|
-
"numberField":
|
|
78
|
+
"decrease": (args)=>`\u{39C}\u{3B5}\u{3AF}\u{3C9}\u{3C3}\u{3B7} ${args.fieldLabel}`,
|
|
79
|
+
"increase": (args)=>`\u{391}\u{3CD}\u{3BE}\u{3B7}\u{3C3}\u{3B7} ${args.fieldLabel}`,
|
|
80
|
+
"numberField": `\u{3A0}\u{3B5}\u{3B4}\u{3AF}\u{3BF} \u{3B1}\u{3C1}\u{3B9}\u{3B8}\u{3BC}\u{3BF}\u{3CD}`
|
|
79
81
|
};
|
|
80
82
|
|
|
81
83
|
|
|
@@ -91,23 +93,23 @@ var $e50a9a48739b90e1$exports = {};
|
|
|
91
93
|
$e50a9a48739b90e1$exports = {
|
|
92
94
|
"decrease": (args)=>`Reducir ${args.fieldLabel}`,
|
|
93
95
|
"increase": (args)=>`Aumentar ${args.fieldLabel}`,
|
|
94
|
-
"numberField": `Campo de
|
|
96
|
+
"numberField": `Campo de n\xfamero`
|
|
95
97
|
};
|
|
96
98
|
|
|
97
99
|
|
|
98
100
|
var $6e0d5294ecbb8ab6$exports = {};
|
|
99
101
|
$6e0d5294ecbb8ab6$exports = {
|
|
100
|
-
"decrease": (args)=>`
|
|
102
|
+
"decrease": (args)=>`V\xe4henda ${args.fieldLabel}`,
|
|
101
103
|
"increase": (args)=>`Suurenda ${args.fieldLabel}`,
|
|
102
|
-
"numberField": `Numbri
|
|
104
|
+
"numberField": `Numbri v\xe4li`
|
|
103
105
|
};
|
|
104
106
|
|
|
105
107
|
|
|
106
108
|
var $e7129d65f607f77f$exports = {};
|
|
107
109
|
$e7129d65f607f77f$exports = {
|
|
108
|
-
"decrease": (args)=>`
|
|
109
|
-
"increase": (args)=>`
|
|
110
|
-
"numberField": `Numerokentt
|
|
110
|
+
"decrease": (args)=>`V\xe4henn\xe4 ${args.fieldLabel}`,
|
|
111
|
+
"increase": (args)=>`Lis\xe4\xe4 ${args.fieldLabel}`,
|
|
112
|
+
"numberField": `Numerokentt\xe4`
|
|
111
113
|
};
|
|
112
114
|
|
|
113
115
|
|
|
@@ -121,25 +123,25 @@ $d72adf5b20573e34$exports = {
|
|
|
121
123
|
|
|
122
124
|
var $a25c707e88b844a7$exports = {};
|
|
123
125
|
$a25c707e88b844a7$exports = {
|
|
124
|
-
"decrease": (args)
|
|
125
|
-
"increase": (args)
|
|
126
|
-
"numberField":
|
|
126
|
+
"decrease": (args)=>`\u{5D4}\u{5E7}\u{5D8}\u{5DF} ${args.fieldLabel}`,
|
|
127
|
+
"increase": (args)=>`\u{5D4}\u{5D2}\u{5D3}\u{5DC} ${args.fieldLabel}`,
|
|
128
|
+
"numberField": `\u{5E9}\u{5D3}\u{5D4} \u{5DE}\u{5E1}\u{5E4}\u{5E8}`
|
|
127
129
|
};
|
|
128
130
|
|
|
129
131
|
|
|
130
132
|
var $69b41140b9a4ca54$exports = {};
|
|
131
133
|
$69b41140b9a4ca54$exports = {
|
|
132
134
|
"decrease": (args)=>`Smanji ${args.fieldLabel}`,
|
|
133
|
-
"increase": (args)=>`
|
|
135
|
+
"increase": (args)=>`Pove\u{107}aj ${args.fieldLabel}`,
|
|
134
136
|
"numberField": `Polje broja`
|
|
135
137
|
};
|
|
136
138
|
|
|
137
139
|
|
|
138
140
|
var $81dab28f37f59d1a$exports = {};
|
|
139
141
|
$81dab28f37f59d1a$exports = {
|
|
140
|
-
"decrease": (args)=>`${args.fieldLabel}
|
|
141
|
-
"increase": (args)=>`${args.fieldLabel}
|
|
142
|
-
"numberField": `
|
|
142
|
+
"decrease": (args)=>`${args.fieldLabel} cs\xf6kkent\xe9se`,
|
|
143
|
+
"increase": (args)=>`${args.fieldLabel} n\xf6vel\xe9se`,
|
|
144
|
+
"numberField": `Sz\xe1mmez\u{151}`
|
|
143
145
|
};
|
|
144
146
|
|
|
145
147
|
|
|
@@ -153,23 +155,23 @@ $866555b31f2d7711$exports = {
|
|
|
153
155
|
|
|
154
156
|
var $dafcd55d52b9d371$exports = {};
|
|
155
157
|
$dafcd55d52b9d371$exports = {
|
|
156
|
-
"decrease": (args)=>`${args.fieldLabel}
|
|
157
|
-
"increase": (args)=>`${args.fieldLabel}
|
|
158
|
-
"numberField":
|
|
158
|
+
"decrease": (args)=>`${args.fieldLabel}\u{3092}\u{7E2E}\u{5C0F}`,
|
|
159
|
+
"increase": (args)=>`${args.fieldLabel}\u{3092}\u{62E1}\u{5927}`,
|
|
160
|
+
"numberField": `\u{6570}\u{5024}\u{30D5}\u{30A3}\u{30FC}\u{30EB}\u{30C9}`
|
|
159
161
|
};
|
|
160
162
|
|
|
161
163
|
|
|
162
164
|
var $f090c1f8c5da0145$exports = {};
|
|
163
165
|
$f090c1f8c5da0145$exports = {
|
|
164
|
-
"decrease": (args)=>`${args.fieldLabel}
|
|
165
|
-
"increase": (args)=>`${args.fieldLabel}
|
|
166
|
-
"numberField":
|
|
166
|
+
"decrease": (args)=>`${args.fieldLabel} \u{AC10}\u{C18C}`,
|
|
167
|
+
"increase": (args)=>`${args.fieldLabel} \u{C99D}\u{AC00}`,
|
|
168
|
+
"numberField": `\u{BC88}\u{D638} \u{D544}\u{B4DC}`
|
|
167
169
|
};
|
|
168
170
|
|
|
169
171
|
|
|
170
172
|
var $6f10f3a13360a75c$exports = {};
|
|
171
173
|
$6f10f3a13360a75c$exports = {
|
|
172
|
-
"decrease": (args)=>`
|
|
174
|
+
"decrease": (args)=>`Suma\u{17E}inti ${args.fieldLabel}`,
|
|
173
175
|
"increase": (args)=>`Padidinti ${args.fieldLabel}`,
|
|
174
176
|
"numberField": `Numerio laukas`
|
|
175
177
|
};
|
|
@@ -177,16 +179,16 @@ $6f10f3a13360a75c$exports = {
|
|
|
177
179
|
|
|
178
180
|
var $47432cefd4b7bd1b$exports = {};
|
|
179
181
|
$47432cefd4b7bd1b$exports = {
|
|
180
|
-
"decrease": (args)=>`
|
|
181
|
-
"increase": (args)=>`
|
|
182
|
-
"numberField": `
|
|
182
|
+
"decrease": (args)=>`Samazin\u{101}\u{161}ana ${args.fieldLabel}`,
|
|
183
|
+
"increase": (args)=>`Palielin\u{101}\u{161}ana ${args.fieldLabel}`,
|
|
184
|
+
"numberField": `Skait\u{13C}u lauks`
|
|
183
185
|
};
|
|
184
186
|
|
|
185
187
|
|
|
186
188
|
var $dc578a950a2bf23d$exports = {};
|
|
187
189
|
$dc578a950a2bf23d$exports = {
|
|
188
190
|
"decrease": (args)=>`Reduser ${args.fieldLabel}`,
|
|
189
|
-
"increase": (args)
|
|
191
|
+
"increase": (args)=>`\xd8k ${args.fieldLabel}`,
|
|
190
192
|
"numberField": `Tallfelt`
|
|
191
193
|
};
|
|
192
194
|
|
|
@@ -202,7 +204,7 @@ $353f1bfca4dc395a$exports = {
|
|
|
202
204
|
var $241bc0bbd870e982$exports = {};
|
|
203
205
|
$241bc0bbd870e982$exports = {
|
|
204
206
|
"decrease": (args)=>`Zmniejsz ${args.fieldLabel}`,
|
|
205
|
-
"increase": (args)=>`
|
|
207
|
+
"increase": (args)=>`Zwi\u{119}ksz ${args.fieldLabel}`,
|
|
206
208
|
"numberField": `Pole numeru`
|
|
207
209
|
};
|
|
208
210
|
|
|
@@ -211,7 +213,7 @@ var $da3005c7bd72b0a8$exports = {};
|
|
|
211
213
|
$da3005c7bd72b0a8$exports = {
|
|
212
214
|
"decrease": (args)=>`Diminuir ${args.fieldLabel}`,
|
|
213
215
|
"increase": (args)=>`Aumentar ${args.fieldLabel}`,
|
|
214
|
-
"numberField": `Campo de
|
|
216
|
+
"numberField": `Campo de n\xfamero`
|
|
215
217
|
};
|
|
216
218
|
|
|
217
219
|
|
|
@@ -219,87 +221,87 @@ var $cf48bfc540882310$exports = {};
|
|
|
219
221
|
$cf48bfc540882310$exports = {
|
|
220
222
|
"decrease": (args)=>`Diminuir ${args.fieldLabel}`,
|
|
221
223
|
"increase": (args)=>`Aumentar ${args.fieldLabel}`,
|
|
222
|
-
"numberField": `Campo
|
|
224
|
+
"numberField": `Campo num\xe9rico`
|
|
223
225
|
};
|
|
224
226
|
|
|
225
227
|
|
|
226
228
|
var $b63a28c481ab9ee3$exports = {};
|
|
227
229
|
$b63a28c481ab9ee3$exports = {
|
|
228
|
-
"decrease": (args)=>`
|
|
229
|
-
"increase": (args)=>`
|
|
230
|
-
"numberField": `
|
|
230
|
+
"decrease": (args)=>`Sc\u{103}dere ${args.fieldLabel}`,
|
|
231
|
+
"increase": (args)=>`Cre\u{219}tere ${args.fieldLabel}`,
|
|
232
|
+
"numberField": `C\xe2mp numeric`
|
|
231
233
|
};
|
|
232
234
|
|
|
233
235
|
|
|
234
236
|
var $19f9df95c2464ab6$exports = {};
|
|
235
237
|
$19f9df95c2464ab6$exports = {
|
|
236
|
-
"decrease": (args)
|
|
237
|
-
"increase": (args)
|
|
238
|
-
"numberField":
|
|
238
|
+
"decrease": (args)=>`\u{423}\u{43C}\u{435}\u{43D}\u{44C}\u{448}\u{435}\u{43D}\u{438}\u{435} ${args.fieldLabel}`,
|
|
239
|
+
"increase": (args)=>`\u{423}\u{432}\u{435}\u{43B}\u{438}\u{447}\u{435}\u{43D}\u{438}\u{435} ${args.fieldLabel}`,
|
|
240
|
+
"numberField": `\u{427}\u{438}\u{441}\u{43B}\u{43E}\u{432}\u{43E}\u{435} \u{43F}\u{43E}\u{43B}\u{435}`
|
|
239
241
|
};
|
|
240
242
|
|
|
241
243
|
|
|
242
244
|
var $b272932a685e8482$exports = {};
|
|
243
245
|
$b272932a685e8482$exports = {
|
|
244
|
-
"decrease": (args)=>`
|
|
245
|
-
"increase": (args)=>`
|
|
246
|
-
"numberField":
|
|
246
|
+
"decrease": (args)=>`Zn\xed\u{17E}i\u{165} ${args.fieldLabel}`,
|
|
247
|
+
"increase": (args)=>`Zv\xfd\u{161}i\u{165} ${args.fieldLabel}`,
|
|
248
|
+
"numberField": `\u{10C}\xedseln\xe9 pole`
|
|
247
249
|
};
|
|
248
250
|
|
|
249
251
|
|
|
250
252
|
var $cbaf8b5b61f9e544$exports = {};
|
|
251
253
|
$cbaf8b5b61f9e544$exports = {
|
|
252
254
|
"decrease": (args)=>`Upadati ${args.fieldLabel}`,
|
|
253
|
-
"increase": (args)=>`
|
|
254
|
-
"numberField":
|
|
255
|
+
"increase": (args)=>`Pove\u{10D}ajte ${args.fieldLabel}`,
|
|
256
|
+
"numberField": `\u{160}tevil\u{10D}no polje`
|
|
255
257
|
};
|
|
256
258
|
|
|
257
259
|
|
|
258
260
|
var $e0a3af6ac1449b2f$exports = {};
|
|
259
261
|
$e0a3af6ac1449b2f$exports = {
|
|
260
|
-
"decrease": (args)=>`
|
|
261
|
-
"increase": (args)=>`
|
|
262
|
-
"numberField": `
|
|
262
|
+
"decrease": (args)=>`Smanji ${args.fieldLabel}`,
|
|
263
|
+
"increase": (args)=>`Pove\u{107}aj ${args.fieldLabel}`,
|
|
264
|
+
"numberField": `Polje broja`
|
|
263
265
|
};
|
|
264
266
|
|
|
265
267
|
|
|
266
268
|
var $71e167d2458a6019$exports = {};
|
|
267
269
|
$71e167d2458a6019$exports = {
|
|
268
270
|
"decrease": (args)=>`Minska ${args.fieldLabel}`,
|
|
269
|
-
"increase": (args)
|
|
270
|
-
"numberField": `
|
|
271
|
+
"increase": (args)=>`\xd6ka ${args.fieldLabel}`,
|
|
272
|
+
"numberField": `Nummerf\xe4lt`
|
|
271
273
|
};
|
|
272
274
|
|
|
273
275
|
|
|
274
276
|
var $3719245abc082946$exports = {};
|
|
275
277
|
$3719245abc082946$exports = {
|
|
276
278
|
"decrease": (args)=>`${args.fieldLabel} azalt`,
|
|
277
|
-
"increase": (args)=>`${args.fieldLabel}
|
|
278
|
-
"numberField": `
|
|
279
|
+
"increase": (args)=>`${args.fieldLabel} artt\u{131}r`,
|
|
280
|
+
"numberField": `Say\u{131} alan\u{131}`
|
|
279
281
|
};
|
|
280
282
|
|
|
281
283
|
|
|
282
284
|
var $2ccc589e2f51824d$exports = {};
|
|
283
285
|
$2ccc589e2f51824d$exports = {
|
|
284
|
-
"decrease": (args)
|
|
285
|
-
"increase": (args)
|
|
286
|
-
"numberField":
|
|
286
|
+
"decrease": (args)=>`\u{417}\u{43C}\u{435}\u{43D}\u{448}\u{438}\u{442}\u{438} ${args.fieldLabel}`,
|
|
287
|
+
"increase": (args)=>`\u{417}\u{431}\u{456}\u{43B}\u{44C}\u{448}\u{438}\u{442}\u{438} ${args.fieldLabel}`,
|
|
288
|
+
"numberField": `\u{41F}\u{43E}\u{43B}\u{435} \u{43D}\u{43E}\u{43C}\u{435}\u{440}\u{430}`
|
|
287
289
|
};
|
|
288
290
|
|
|
289
291
|
|
|
290
292
|
var $e1103cb9b4c13942$exports = {};
|
|
291
293
|
$e1103cb9b4c13942$exports = {
|
|
292
|
-
"decrease": (args)
|
|
293
|
-
"increase": (args)
|
|
294
|
-
"numberField":
|
|
294
|
+
"decrease": (args)=>`\u{964D}\u{4F4E} ${args.fieldLabel}`,
|
|
295
|
+
"increase": (args)=>`\u{63D0}\u{9AD8} ${args.fieldLabel}`,
|
|
296
|
+
"numberField": `\u{6570}\u{5B57}\u{5B57}\u{6BB5}`
|
|
295
297
|
};
|
|
296
298
|
|
|
297
299
|
|
|
298
300
|
var $448607634f80dccb$exports = {};
|
|
299
301
|
$448607634f80dccb$exports = {
|
|
300
|
-
"decrease": (args)
|
|
301
|
-
"increase": (args)
|
|
302
|
-
"numberField":
|
|
302
|
+
"decrease": (args)=>`\u{7E2E}\u{5C0F} ${args.fieldLabel}`,
|
|
303
|
+
"increase": (args)=>`\u{653E}\u{5927} ${args.fieldLabel}`,
|
|
304
|
+
"numberField": `\u{6578}\u{5B57}\u{6B04}\u{4F4D}`
|
|
303
305
|
};
|
|
304
306
|
|
|
305
307
|
|
|
@@ -345,13 +347,14 @@ $280a227d7cb94b92$exports = {
|
|
|
345
347
|
|
|
346
348
|
|
|
347
349
|
|
|
350
|
+
|
|
348
351
|
function $81397a9303501bda$export$23f548e970bdf099(props, state, inputRef) {
|
|
349
|
-
let { id: id, decrementAriaLabel: decrementAriaLabel, incrementAriaLabel: incrementAriaLabel, isDisabled: isDisabled, isReadOnly: isReadOnly, isRequired: isRequired, minValue: minValue, maxValue: maxValue, autoFocus: autoFocus,
|
|
350
|
-
let { increment: increment, incrementToMax: incrementToMax, decrement: decrement, decrementToMin: decrementToMin, numberValue: numberValue, inputValue: inputValue, commit: commit } = state;
|
|
352
|
+
let { id: id, decrementAriaLabel: decrementAriaLabel, incrementAriaLabel: incrementAriaLabel, isDisabled: isDisabled, isReadOnly: isReadOnly, isRequired: isRequired, minValue: minValue, maxValue: maxValue, autoFocus: autoFocus, label: label, formatOptions: formatOptions, onBlur: onBlur = ()=>{}, onFocus: onFocus, onFocusChange: onFocusChange, onKeyDown: onKeyDown, onKeyUp: onKeyUp, description: description, errorMessage: errorMessage, ...otherProps } = props;
|
|
353
|
+
let { increment: increment, incrementToMax: incrementToMax, decrement: decrement, decrementToMin: decrementToMin, numberValue: numberValue, inputValue: inputValue, commit: commit, commitValidation: commitValidation } = state;
|
|
351
354
|
const stringFormatter = (0, $gfhJl$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($280a227d7cb94b92$exports))));
|
|
352
355
|
let inputId = (0, $gfhJl$useId)(id);
|
|
353
356
|
let { focusProps: focusProps } = (0, $gfhJl$useFocus)({
|
|
354
|
-
onBlur
|
|
357
|
+
onBlur () {
|
|
355
358
|
// Set input value to normalized valid value
|
|
356
359
|
commit();
|
|
357
360
|
}
|
|
@@ -430,10 +433,15 @@ function $81397a9303501bda$export$23f548e970bdf099(props, state, inputRef) {
|
|
|
430
433
|
};
|
|
431
434
|
let domProps = (0, $gfhJl$filterDOMProps)(props);
|
|
432
435
|
let onKeyDownEnter = (0, $gfhJl$useCallback)((e)=>{
|
|
433
|
-
if (e.key === "Enter")
|
|
436
|
+
if (e.key === "Enter") {
|
|
437
|
+
commit();
|
|
438
|
+
commitValidation();
|
|
439
|
+
} else e.continuePropagation();
|
|
434
440
|
}, [
|
|
435
|
-
commit
|
|
441
|
+
commit,
|
|
442
|
+
commitValidation
|
|
436
443
|
]);
|
|
444
|
+
let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = state.displayValidation;
|
|
437
445
|
let { labelProps: labelProps, inputProps: textFieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $gfhJl$useFormattedTextField)({
|
|
438
446
|
...otherProps,
|
|
439
447
|
...domProps,
|
|
@@ -443,8 +451,8 @@ function $81397a9303501bda$export$23f548e970bdf099(props, state, inputRef) {
|
|
|
443
451
|
isDisabled: isDisabled,
|
|
444
452
|
isReadOnly: isReadOnly,
|
|
445
453
|
isRequired: isRequired,
|
|
446
|
-
|
|
447
|
-
|
|
454
|
+
validate: undefined,
|
|
455
|
+
[(0, $gfhJl$privateValidationStateProp)]: state,
|
|
448
456
|
value: inputValue,
|
|
449
457
|
defaultValue: undefined,
|
|
450
458
|
autoComplete: "off",
|
|
@@ -478,6 +486,7 @@ function $81397a9303501bda$export$23f548e970bdf099(props, state, inputRef) {
|
|
|
478
486
|
autoCorrect: "off",
|
|
479
487
|
spellCheck: "false"
|
|
480
488
|
});
|
|
489
|
+
if (props.validationBehavior === "native") inputProps["aria-required"] = undefined;
|
|
481
490
|
let onButtonPressStart = (e)=>{
|
|
482
491
|
// If focus is already on the input, keep it there so we don't hide the
|
|
483
492
|
// software keyboard when tapping the increment/decrement buttons.
|
|
@@ -534,14 +543,17 @@ function $81397a9303501bda$export$23f548e970bdf099(props, state, inputRef) {
|
|
|
534
543
|
...focusWithinProps,
|
|
535
544
|
role: "group",
|
|
536
545
|
"aria-disabled": isDisabled,
|
|
537
|
-
"aria-invalid": isInvalid
|
|
546
|
+
"aria-invalid": isInvalid ? "true" : undefined
|
|
538
547
|
},
|
|
539
548
|
labelProps: labelProps,
|
|
540
549
|
inputProps: inputProps,
|
|
541
550
|
incrementButtonProps: incrementButtonProps,
|
|
542
551
|
decrementButtonProps: decrementButtonProps,
|
|
543
552
|
errorMessageProps: errorMessageProps,
|
|
544
|
-
descriptionProps: descriptionProps
|
|
553
|
+
descriptionProps: descriptionProps,
|
|
554
|
+
isInvalid: isInvalid,
|
|
555
|
+
validationErrors: validationErrors,
|
|
556
|
+
validationDetails: validationDetails
|
|
545
557
|
};
|
|
546
558
|
}
|
|
547
559
|
|