@react-aria/numberfield 3.11.1 → 3.11.2
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/ar-AE.mjs +1 -1
- package/dist/bg-BG.mjs +1 -1
- package/dist/cs-CZ.mjs +1 -1
- package/dist/da-DK.mjs +1 -1
- package/dist/de-DE.mjs +1 -1
- package/dist/el-GR.mjs +1 -1
- package/dist/en-US.mjs +1 -1
- package/dist/es-ES.mjs +1 -1
- package/dist/et-EE.mjs +1 -1
- package/dist/fi-FI.mjs +1 -1
- package/dist/fr-FR.mjs +1 -1
- package/dist/he-IL.mjs +1 -1
- package/dist/hr-HR.mjs +1 -1
- package/dist/hu-HU.mjs +1 -1
- package/dist/import.mjs +1 -345
- package/dist/intlStrings.main.js +108 -0
- package/dist/intlStrings.main.js.map +1 -0
- package/dist/intlStrings.mjs +110 -0
- package/dist/intlStrings.module.js +110 -0
- package/dist/intlStrings.module.js.map +1 -0
- package/dist/it-IT.mjs +1 -1
- package/dist/ja-JP.mjs +1 -1
- package/dist/ko-KR.mjs +1 -1
- package/dist/lt-LT.mjs +1 -1
- package/dist/lv-LV.mjs +1 -1
- package/dist/main.js +2 -346
- package/dist/main.js.map +1 -1
- package/dist/module.js +1 -345
- package/dist/module.js.map +1 -1
- package/dist/nb-NO.mjs +1 -1
- package/dist/nl-NL.mjs +1 -1
- package/dist/pl-PL.mjs +1 -1
- package/dist/pt-BR.mjs +1 -1
- package/dist/pt-PT.mjs +1 -1
- package/dist/ro-RO.mjs +1 -1
- package/dist/ru-RU.mjs +1 -1
- package/dist/sk-SK.mjs +1 -1
- package/dist/sl-SI.mjs +1 -1
- package/dist/sr-SP.mjs +1 -1
- package/dist/sv-SE.mjs +1 -1
- package/dist/tr-TR.mjs +1 -1
- package/dist/uk-UA.mjs +1 -1
- package/dist/useNumberField.main.js +249 -0
- package/dist/useNumberField.main.js.map +1 -0
- package/dist/useNumberField.mjs +244 -0
- package/dist/useNumberField.module.js +244 -0
- package/dist/useNumberField.module.js.map +1 -0
- package/dist/zh-CN.mjs +1 -1
- package/dist/zh-TW.mjs +1 -1
- package/package.json +12 -12
package/dist/ar-AE.mjs
CHANGED
package/dist/bg-BG.mjs
CHANGED
package/dist/cs-CZ.mjs
CHANGED
package/dist/da-DK.mjs
CHANGED
package/dist/de-DE.mjs
CHANGED
package/dist/el-GR.mjs
CHANGED
package/dist/en-US.mjs
CHANGED
package/dist/es-ES.mjs
CHANGED
package/dist/et-EE.mjs
CHANGED
package/dist/fi-FI.mjs
CHANGED
package/dist/fr-FR.mjs
CHANGED
package/dist/he-IL.mjs
CHANGED
package/dist/hr-HR.mjs
CHANGED
package/dist/hu-HU.mjs
CHANGED
package/dist/import.mjs
CHANGED
|
@@ -1,60 +1,6 @@
|
|
|
1
|
-
import $
|
|
2
|
-
import $2776acdd9959a647$exports from "./bg-BG.mjs";
|
|
3
|
-
import $741954410a365ad3$exports from "./cs-CZ.mjs";
|
|
4
|
-
import $8321ed0f8ab642f0$exports from "./da-DK.mjs";
|
|
5
|
-
import $92978e0c4ecafa32$exports from "./de-DE.mjs";
|
|
6
|
-
import $ac5ff71962864a84$exports from "./el-GR.mjs";
|
|
7
|
-
import $efe4685e2440d8be$exports from "./en-US.mjs";
|
|
8
|
-
import $e50a9a48739b90e1$exports from "./es-ES.mjs";
|
|
9
|
-
import $6e0d5294ecbb8ab6$exports from "./et-EE.mjs";
|
|
10
|
-
import $e7129d65f607f77f$exports from "./fi-FI.mjs";
|
|
11
|
-
import $d72adf5b20573e34$exports from "./fr-FR.mjs";
|
|
12
|
-
import $a25c707e88b844a7$exports from "./he-IL.mjs";
|
|
13
|
-
import $69b41140b9a4ca54$exports from "./hr-HR.mjs";
|
|
14
|
-
import $81dab28f37f59d1a$exports from "./hu-HU.mjs";
|
|
15
|
-
import $866555b31f2d7711$exports from "./it-IT.mjs";
|
|
16
|
-
import $dafcd55d52b9d371$exports from "./ja-JP.mjs";
|
|
17
|
-
import $f090c1f8c5da0145$exports from "./ko-KR.mjs";
|
|
18
|
-
import $6f10f3a13360a75c$exports from "./lt-LT.mjs";
|
|
19
|
-
import $47432cefd4b7bd1b$exports from "./lv-LV.mjs";
|
|
20
|
-
import $dc578a950a2bf23d$exports from "./nb-NO.mjs";
|
|
21
|
-
import $353f1bfca4dc395a$exports from "./nl-NL.mjs";
|
|
22
|
-
import $241bc0bbd870e982$exports from "./pl-PL.mjs";
|
|
23
|
-
import $da3005c7bd72b0a8$exports from "./pt-BR.mjs";
|
|
24
|
-
import $cf48bfc540882310$exports from "./pt-PT.mjs";
|
|
25
|
-
import $b63a28c481ab9ee3$exports from "./ro-RO.mjs";
|
|
26
|
-
import $19f9df95c2464ab6$exports from "./ru-RU.mjs";
|
|
27
|
-
import $b272932a685e8482$exports from "./sk-SK.mjs";
|
|
28
|
-
import $cbaf8b5b61f9e544$exports from "./sl-SI.mjs";
|
|
29
|
-
import $e0a3af6ac1449b2f$exports from "./sr-SP.mjs";
|
|
30
|
-
import $71e167d2458a6019$exports from "./sv-SE.mjs";
|
|
31
|
-
import $3719245abc082946$exports from "./tr-TR.mjs";
|
|
32
|
-
import $2ccc589e2f51824d$exports from "./uk-UA.mjs";
|
|
33
|
-
import $e1103cb9b4c13942$exports from "./zh-CN.mjs";
|
|
34
|
-
import $448607634f80dccb$exports from "./zh-TW.mjs";
|
|
35
|
-
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";
|
|
36
|
-
import {useMemo as $gfhJl$useMemo, useState as $gfhJl$useState, useCallback as $gfhJl$useCallback} from "react";
|
|
37
|
-
import {privateValidationStateProp as $gfhJl$privateValidationStateProp} from "@react-stately/form";
|
|
38
|
-
import {useFocus as $gfhJl$useFocus, useFocusWithin as $gfhJl$useFocusWithin, useScrollWheel as $gfhJl$useScrollWheel} from "@react-aria/interactions";
|
|
39
|
-
import {useFormattedTextField as $gfhJl$useFormattedTextField} from "@react-aria/textfield";
|
|
40
|
-
import {useLocalizedStringFormatter as $gfhJl$useLocalizedStringFormatter, useNumberFormatter as $gfhJl$useNumberFormatter} from "@react-aria/i18n";
|
|
41
|
-
import {useSpinButton as $gfhJl$useSpinButton} from "@react-aria/spinbutton";
|
|
1
|
+
import {useNumberField as $81397a9303501bda$export$23f548e970bdf099} from "./useNumberField.mjs";
|
|
42
2
|
|
|
43
|
-
|
|
44
|
-
function $parcel$interopDefault(a) {
|
|
45
|
-
return a && a.__esModule ? a.default : a;
|
|
46
|
-
}
|
|
47
3
|
/*
|
|
48
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
49
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
50
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
51
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
52
|
-
*
|
|
53
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
54
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
55
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
56
|
-
* governing permissions and limitations under the License.
|
|
57
|
-
*/ /*
|
|
58
4
|
* Copyright 2020 Adobe. All rights reserved.
|
|
59
5
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
60
6
|
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
@@ -66,296 +12,6 @@ function $parcel$interopDefault(a) {
|
|
|
66
12
|
* governing permissions and limitations under the License.
|
|
67
13
|
*/
|
|
68
14
|
|
|
69
|
-
var $280a227d7cb94b92$exports = {};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
$280a227d7cb94b92$exports = {
|
|
105
|
-
"ar-AE": $fb78e0f6ab6349ed$exports,
|
|
106
|
-
"bg-BG": $2776acdd9959a647$exports,
|
|
107
|
-
"cs-CZ": $741954410a365ad3$exports,
|
|
108
|
-
"da-DK": $8321ed0f8ab642f0$exports,
|
|
109
|
-
"de-DE": $92978e0c4ecafa32$exports,
|
|
110
|
-
"el-GR": $ac5ff71962864a84$exports,
|
|
111
|
-
"en-US": $efe4685e2440d8be$exports,
|
|
112
|
-
"es-ES": $e50a9a48739b90e1$exports,
|
|
113
|
-
"et-EE": $6e0d5294ecbb8ab6$exports,
|
|
114
|
-
"fi-FI": $e7129d65f607f77f$exports,
|
|
115
|
-
"fr-FR": $d72adf5b20573e34$exports,
|
|
116
|
-
"he-IL": $a25c707e88b844a7$exports,
|
|
117
|
-
"hr-HR": $69b41140b9a4ca54$exports,
|
|
118
|
-
"hu-HU": $81dab28f37f59d1a$exports,
|
|
119
|
-
"it-IT": $866555b31f2d7711$exports,
|
|
120
|
-
"ja-JP": $dafcd55d52b9d371$exports,
|
|
121
|
-
"ko-KR": $f090c1f8c5da0145$exports,
|
|
122
|
-
"lt-LT": $6f10f3a13360a75c$exports,
|
|
123
|
-
"lv-LV": $47432cefd4b7bd1b$exports,
|
|
124
|
-
"nb-NO": $dc578a950a2bf23d$exports,
|
|
125
|
-
"nl-NL": $353f1bfca4dc395a$exports,
|
|
126
|
-
"pl-PL": $241bc0bbd870e982$exports,
|
|
127
|
-
"pt-BR": $da3005c7bd72b0a8$exports,
|
|
128
|
-
"pt-PT": $cf48bfc540882310$exports,
|
|
129
|
-
"ro-RO": $b63a28c481ab9ee3$exports,
|
|
130
|
-
"ru-RU": $19f9df95c2464ab6$exports,
|
|
131
|
-
"sk-SK": $b272932a685e8482$exports,
|
|
132
|
-
"sl-SI": $cbaf8b5b61f9e544$exports,
|
|
133
|
-
"sr-SP": $e0a3af6ac1449b2f$exports,
|
|
134
|
-
"sv-SE": $71e167d2458a6019$exports,
|
|
135
|
-
"tr-TR": $3719245abc082946$exports,
|
|
136
|
-
"uk-UA": $2ccc589e2f51824d$exports,
|
|
137
|
-
"zh-CN": $e1103cb9b4c13942$exports,
|
|
138
|
-
"zh-TW": $448607634f80dccb$exports
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
function $81397a9303501bda$export$23f548e970bdf099(props, state, inputRef) {
|
|
148
|
-
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, isWheelDisabled: isWheelDisabled, ...otherProps } = props;
|
|
149
|
-
let { increment: increment, incrementToMax: incrementToMax, decrement: decrement, decrementToMin: decrementToMin, numberValue: numberValue, inputValue: inputValue, commit: commit, commitValidation: commitValidation } = state;
|
|
150
|
-
const stringFormatter = (0, $gfhJl$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($280a227d7cb94b92$exports))), "@react-aria/numberfield");
|
|
151
|
-
let inputId = (0, $gfhJl$useId)(id);
|
|
152
|
-
let { focusProps: focusProps } = (0, $gfhJl$useFocus)({
|
|
153
|
-
onBlur () {
|
|
154
|
-
// Set input value to normalized valid value
|
|
155
|
-
commit();
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
let numberFormatter = (0, $gfhJl$useNumberFormatter)(formatOptions);
|
|
159
|
-
let intlOptions = (0, $gfhJl$useMemo)(()=>numberFormatter.resolvedOptions(), [
|
|
160
|
-
numberFormatter
|
|
161
|
-
]);
|
|
162
|
-
// Replace negative textValue formatted using currencySign: 'accounting'
|
|
163
|
-
// with a textValue that can be announced using a minus sign.
|
|
164
|
-
let textValueFormatter = (0, $gfhJl$useNumberFormatter)({
|
|
165
|
-
...formatOptions,
|
|
166
|
-
currencySign: undefined
|
|
167
|
-
});
|
|
168
|
-
let textValue = (0, $gfhJl$useMemo)(()=>isNaN(numberValue) ? "" : textValueFormatter.format(numberValue), [
|
|
169
|
-
textValueFormatter,
|
|
170
|
-
numberValue
|
|
171
|
-
]);
|
|
172
|
-
let { spinButtonProps: spinButtonProps, incrementButtonProps: incButtonProps, decrementButtonProps: decButtonProps } = (0, $gfhJl$useSpinButton)({
|
|
173
|
-
isDisabled: isDisabled,
|
|
174
|
-
isReadOnly: isReadOnly,
|
|
175
|
-
isRequired: isRequired,
|
|
176
|
-
maxValue: maxValue,
|
|
177
|
-
minValue: minValue,
|
|
178
|
-
onIncrement: increment,
|
|
179
|
-
onIncrementToMax: incrementToMax,
|
|
180
|
-
onDecrement: decrement,
|
|
181
|
-
onDecrementToMin: decrementToMin,
|
|
182
|
-
value: numberValue,
|
|
183
|
-
textValue: textValue
|
|
184
|
-
});
|
|
185
|
-
let [focusWithin, setFocusWithin] = (0, $gfhJl$useState)(false);
|
|
186
|
-
let { focusWithinProps: focusWithinProps } = (0, $gfhJl$useFocusWithin)({
|
|
187
|
-
isDisabled: isDisabled,
|
|
188
|
-
onFocusWithinChange: setFocusWithin
|
|
189
|
-
});
|
|
190
|
-
let onWheel = (0, $gfhJl$useCallback)((e)=>{
|
|
191
|
-
// if on a trackpad, users can scroll in both X and Y at once, check the magnitude of the change
|
|
192
|
-
// if it's mostly in the X direction, then just return, the user probably doesn't mean to inc/dec
|
|
193
|
-
// this isn't perfect, events come in fast with small deltas and a part of the scroll may give a false indication
|
|
194
|
-
// especially if the user is scrolling near 45deg
|
|
195
|
-
if (Math.abs(e.deltaY) <= Math.abs(e.deltaX)) return;
|
|
196
|
-
if (e.deltaY > 0) increment();
|
|
197
|
-
else if (e.deltaY < 0) decrement();
|
|
198
|
-
}, [
|
|
199
|
-
decrement,
|
|
200
|
-
increment
|
|
201
|
-
]);
|
|
202
|
-
// If the input isn't supposed to receive input, disable scrolling.
|
|
203
|
-
let scrollingDisabled = isWheelDisabled || isDisabled || isReadOnly || !focusWithin;
|
|
204
|
-
(0, $gfhJl$useScrollWheel)({
|
|
205
|
-
onScroll: onWheel,
|
|
206
|
-
isDisabled: scrollingDisabled
|
|
207
|
-
}, inputRef);
|
|
208
|
-
// The inputMode attribute influences the software keyboard that is shown on touch devices.
|
|
209
|
-
// Browsers and operating systems are quite inconsistent about what keys are available, however.
|
|
210
|
-
// We choose between numeric and decimal based on whether we allow negative and fractional numbers,
|
|
211
|
-
// and based on testing on various devices to determine what keys are available in each inputMode.
|
|
212
|
-
let hasDecimals = intlOptions.maximumFractionDigits > 0;
|
|
213
|
-
let hasNegative = state.minValue === undefined || isNaN(state.minValue) || state.minValue < 0;
|
|
214
|
-
let inputMode = "numeric";
|
|
215
|
-
if ((0, $gfhJl$isIPhone)()) {
|
|
216
|
-
// iPhone doesn't have a minus sign in either numeric or decimal.
|
|
217
|
-
// Note this is only for iPhone, not iPad, which always has both
|
|
218
|
-
// minus and decimal in numeric.
|
|
219
|
-
if (hasNegative) inputMode = "text";
|
|
220
|
-
else if (hasDecimals) inputMode = "decimal";
|
|
221
|
-
} else if ((0, $gfhJl$isAndroid)()) {
|
|
222
|
-
// Android numeric has both a decimal point and minus key.
|
|
223
|
-
// decimal does not have a minus key.
|
|
224
|
-
if (hasNegative) inputMode = "numeric";
|
|
225
|
-
else if (hasDecimals) inputMode = "decimal";
|
|
226
|
-
}
|
|
227
|
-
let onChange = (value)=>{
|
|
228
|
-
if (state.validate(value)) state.setInputValue(value);
|
|
229
|
-
};
|
|
230
|
-
let domProps = (0, $gfhJl$filterDOMProps)(props);
|
|
231
|
-
let onKeyDownEnter = (0, $gfhJl$useCallback)((e)=>{
|
|
232
|
-
if (e.key === "Enter") {
|
|
233
|
-
commit();
|
|
234
|
-
commitValidation();
|
|
235
|
-
} else e.continuePropagation();
|
|
236
|
-
}, [
|
|
237
|
-
commit,
|
|
238
|
-
commitValidation
|
|
239
|
-
]);
|
|
240
|
-
let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = state.displayValidation;
|
|
241
|
-
let { labelProps: labelProps, inputProps: textFieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $gfhJl$useFormattedTextField)({
|
|
242
|
-
...otherProps,
|
|
243
|
-
...domProps,
|
|
244
|
-
name: undefined,
|
|
245
|
-
label: label,
|
|
246
|
-
autoFocus: autoFocus,
|
|
247
|
-
isDisabled: isDisabled,
|
|
248
|
-
isReadOnly: isReadOnly,
|
|
249
|
-
isRequired: isRequired,
|
|
250
|
-
validate: undefined,
|
|
251
|
-
[(0, $gfhJl$privateValidationStateProp)]: state,
|
|
252
|
-
value: inputValue,
|
|
253
|
-
defaultValue: undefined,
|
|
254
|
-
autoComplete: "off",
|
|
255
|
-
"aria-label": props["aria-label"] || undefined,
|
|
256
|
-
"aria-labelledby": props["aria-labelledby"] || undefined,
|
|
257
|
-
id: inputId,
|
|
258
|
-
type: "text",
|
|
259
|
-
inputMode: inputMode,
|
|
260
|
-
onChange: onChange,
|
|
261
|
-
onBlur: onBlur,
|
|
262
|
-
onFocus: onFocus,
|
|
263
|
-
onFocusChange: onFocusChange,
|
|
264
|
-
onKeyDown: (0, $gfhJl$useMemo)(()=>(0, $gfhJl$chain)(onKeyDownEnter, onKeyDown), [
|
|
265
|
-
onKeyDownEnter,
|
|
266
|
-
onKeyDown
|
|
267
|
-
]),
|
|
268
|
-
onKeyUp: onKeyUp,
|
|
269
|
-
description: description,
|
|
270
|
-
errorMessage: errorMessage
|
|
271
|
-
}, state, inputRef);
|
|
272
|
-
(0, $gfhJl$useFormReset)(inputRef, state.numberValue, state.setNumberValue);
|
|
273
|
-
let inputProps = (0, $gfhJl$mergeProps)(spinButtonProps, focusProps, textFieldProps, {
|
|
274
|
-
// override the spinbutton role, we can't focus a spin button with VO
|
|
275
|
-
role: null,
|
|
276
|
-
// ignore aria-roledescription on iOS so that required state will announce when it is present
|
|
277
|
-
"aria-roledescription": !(0, $gfhJl$isIOS)() ? stringFormatter.format("numberField") : null,
|
|
278
|
-
"aria-valuemax": null,
|
|
279
|
-
"aria-valuemin": null,
|
|
280
|
-
"aria-valuenow": null,
|
|
281
|
-
"aria-valuetext": null,
|
|
282
|
-
autoCorrect: "off",
|
|
283
|
-
spellCheck: "false"
|
|
284
|
-
});
|
|
285
|
-
if (props.validationBehavior === "native") inputProps["aria-required"] = undefined;
|
|
286
|
-
let onButtonPressStart = (e)=>{
|
|
287
|
-
var _inputRef_current;
|
|
288
|
-
// If focus is already on the input, keep it there so we don't hide the
|
|
289
|
-
// software keyboard when tapping the increment/decrement buttons.
|
|
290
|
-
if (document.activeElement === inputRef.current) return;
|
|
291
|
-
// Otherwise, when using a mouse, move focus to the input.
|
|
292
|
-
// On touch, or with a screen reader, focus the button so that the software
|
|
293
|
-
// keyboard does not appear and the screen reader cursor is not moved off the button.
|
|
294
|
-
if (e.pointerType === "mouse") (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus();
|
|
295
|
-
else e.target.focus();
|
|
296
|
-
};
|
|
297
|
-
// Determine the label for the increment and decrement buttons. There are 4 cases:
|
|
298
|
-
//
|
|
299
|
-
// 1. With a visible label that is a string: aria-label: `Increase ${props.label}`
|
|
300
|
-
// 2. With a visible label that is JSX: aria-label: 'Increase', aria-labelledby: '${incrementId} ${labelId}'
|
|
301
|
-
// 3. With an aria-label: aria-label: `Increase ${props['aria-label']}`
|
|
302
|
-
// 4. With an aria-labelledby: aria-label: 'Increase', aria-labelledby: `${incrementId} ${props['aria-labelledby']}`
|
|
303
|
-
//
|
|
304
|
-
// (1) and (2) could possibly be combined and both use aria-labelledby. However, placing the label in
|
|
305
|
-
// the aria-label string rather than using aria-labelledby gives more flexibility to translators to change
|
|
306
|
-
// the order or add additional words around the label if needed.
|
|
307
|
-
let fieldLabel = props["aria-label"] || (typeof props.label === "string" ? props.label : "");
|
|
308
|
-
let ariaLabelledby;
|
|
309
|
-
if (!fieldLabel) ariaLabelledby = props.label != null ? labelProps.id : props["aria-labelledby"];
|
|
310
|
-
let incrementId = (0, $gfhJl$useId)();
|
|
311
|
-
let decrementId = (0, $gfhJl$useId)();
|
|
312
|
-
let incrementButtonProps = (0, $gfhJl$mergeProps)(incButtonProps, {
|
|
313
|
-
"aria-label": incrementAriaLabel || stringFormatter.format("increase", {
|
|
314
|
-
fieldLabel: fieldLabel
|
|
315
|
-
}).trim(),
|
|
316
|
-
id: ariaLabelledby && !incrementAriaLabel ? incrementId : null,
|
|
317
|
-
"aria-labelledby": ariaLabelledby && !incrementAriaLabel ? `${incrementId} ${ariaLabelledby}` : null,
|
|
318
|
-
"aria-controls": inputId,
|
|
319
|
-
excludeFromTabOrder: true,
|
|
320
|
-
preventFocusOnPress: true,
|
|
321
|
-
allowFocusWhenDisabled: true,
|
|
322
|
-
isDisabled: !state.canIncrement,
|
|
323
|
-
onPressStart: onButtonPressStart
|
|
324
|
-
});
|
|
325
|
-
let decrementButtonProps = (0, $gfhJl$mergeProps)(decButtonProps, {
|
|
326
|
-
"aria-label": decrementAriaLabel || stringFormatter.format("decrease", {
|
|
327
|
-
fieldLabel: fieldLabel
|
|
328
|
-
}).trim(),
|
|
329
|
-
id: ariaLabelledby && !decrementAriaLabel ? decrementId : null,
|
|
330
|
-
"aria-labelledby": ariaLabelledby && !decrementAriaLabel ? `${decrementId} ${ariaLabelledby}` : null,
|
|
331
|
-
"aria-controls": inputId,
|
|
332
|
-
excludeFromTabOrder: true,
|
|
333
|
-
preventFocusOnPress: true,
|
|
334
|
-
allowFocusWhenDisabled: true,
|
|
335
|
-
isDisabled: !state.canDecrement,
|
|
336
|
-
onPressStart: onButtonPressStart
|
|
337
|
-
});
|
|
338
|
-
return {
|
|
339
|
-
groupProps: {
|
|
340
|
-
...focusWithinProps,
|
|
341
|
-
role: "group",
|
|
342
|
-
"aria-disabled": isDisabled,
|
|
343
|
-
"aria-invalid": isInvalid ? "true" : undefined
|
|
344
|
-
},
|
|
345
|
-
labelProps: labelProps,
|
|
346
|
-
inputProps: inputProps,
|
|
347
|
-
incrementButtonProps: incrementButtonProps,
|
|
348
|
-
decrementButtonProps: decrementButtonProps,
|
|
349
|
-
errorMessageProps: errorMessageProps,
|
|
350
|
-
descriptionProps: descriptionProps,
|
|
351
|
-
isInvalid: isInvalid,
|
|
352
|
-
validationErrors: validationErrors,
|
|
353
|
-
validationDetails: validationDetails
|
|
354
|
-
};
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
15
|
|
|
360
16
|
export {$81397a9303501bda$export$23f548e970bdf099 as useNumberField};
|
|
361
17
|
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
var $15c26e9e75543508$exports = require("./ar-AE.main.js");
|
|
2
|
+
var $2d346802965e5c25$exports = require("./bg-BG.main.js");
|
|
3
|
+
var $09893e85abdd2974$exports = require("./cs-CZ.main.js");
|
|
4
|
+
var $413bf45f477fb4e1$exports = require("./da-DK.main.js");
|
|
5
|
+
var $2727845e2efab680$exports = require("./de-DE.main.js");
|
|
6
|
+
var $11030a3afacdbc2e$exports = require("./el-GR.main.js");
|
|
7
|
+
var $1e48617299cb10e8$exports = require("./en-US.main.js");
|
|
8
|
+
var $335176f389a02847$exports = require("./es-ES.main.js");
|
|
9
|
+
var $b08e7fdc34a812f3$exports = require("./et-EE.main.js");
|
|
10
|
+
var $ce4c5a1eb7e6fc96$exports = require("./fi-FI.main.js");
|
|
11
|
+
var $341f988ce23c559c$exports = require("./fr-FR.main.js");
|
|
12
|
+
var $950fd1a1d57d2f86$exports = require("./he-IL.main.js");
|
|
13
|
+
var $7b949fa64cf10a07$exports = require("./hr-HR.main.js");
|
|
14
|
+
var $a945ff6d5cb9cf90$exports = require("./hu-HU.main.js");
|
|
15
|
+
var $f3393075c1f078d7$exports = require("./it-IT.main.js");
|
|
16
|
+
var $a12655e072ef354d$exports = require("./ja-JP.main.js");
|
|
17
|
+
var $880dbee0519c1bad$exports = require("./ko-KR.main.js");
|
|
18
|
+
var $d4a9630b079105aa$exports = require("./lt-LT.main.js");
|
|
19
|
+
var $e358cd3315986eb7$exports = require("./lv-LV.main.js");
|
|
20
|
+
var $a8d0ee8ec28363c7$exports = require("./nb-NO.main.js");
|
|
21
|
+
var $0073957e0c754983$exports = require("./nl-NL.main.js");
|
|
22
|
+
var $51626cc4fccef54e$exports = require("./pl-PL.main.js");
|
|
23
|
+
var $60b1cee412b56d27$exports = require("./pt-BR.main.js");
|
|
24
|
+
var $df9c7cc4e8072a0f$exports = require("./pt-PT.main.js");
|
|
25
|
+
var $aea54857f9df076d$exports = require("./ro-RO.main.js");
|
|
26
|
+
var $8337ebc47a7e61a3$exports = require("./ru-RU.main.js");
|
|
27
|
+
var $4703837f8f4224f8$exports = require("./sk-SK.main.js");
|
|
28
|
+
var $2b9c8b37ab5bbcca$exports = require("./sl-SI.main.js");
|
|
29
|
+
var $2c78665a3b81ed56$exports = require("./sr-SP.main.js");
|
|
30
|
+
var $8da5dab2105c0d01$exports = require("./sv-SE.main.js");
|
|
31
|
+
var $73a2418cb50e8fda$exports = require("./tr-TR.main.js");
|
|
32
|
+
var $9c85d1989bb8c41d$exports = require("./uk-UA.main.js");
|
|
33
|
+
var $a7db09d81aa41beb$exports = require("./zh-CN.main.js");
|
|
34
|
+
var $edd6ee4675b7a1cd$exports = require("./zh-TW.main.js");
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
module.exports = {
|
|
71
|
+
"ar-AE": $15c26e9e75543508$exports,
|
|
72
|
+
"bg-BG": $2d346802965e5c25$exports,
|
|
73
|
+
"cs-CZ": $09893e85abdd2974$exports,
|
|
74
|
+
"da-DK": $413bf45f477fb4e1$exports,
|
|
75
|
+
"de-DE": $2727845e2efab680$exports,
|
|
76
|
+
"el-GR": $11030a3afacdbc2e$exports,
|
|
77
|
+
"en-US": $1e48617299cb10e8$exports,
|
|
78
|
+
"es-ES": $335176f389a02847$exports,
|
|
79
|
+
"et-EE": $b08e7fdc34a812f3$exports,
|
|
80
|
+
"fi-FI": $ce4c5a1eb7e6fc96$exports,
|
|
81
|
+
"fr-FR": $341f988ce23c559c$exports,
|
|
82
|
+
"he-IL": $950fd1a1d57d2f86$exports,
|
|
83
|
+
"hr-HR": $7b949fa64cf10a07$exports,
|
|
84
|
+
"hu-HU": $a945ff6d5cb9cf90$exports,
|
|
85
|
+
"it-IT": $f3393075c1f078d7$exports,
|
|
86
|
+
"ja-JP": $a12655e072ef354d$exports,
|
|
87
|
+
"ko-KR": $880dbee0519c1bad$exports,
|
|
88
|
+
"lt-LT": $d4a9630b079105aa$exports,
|
|
89
|
+
"lv-LV": $e358cd3315986eb7$exports,
|
|
90
|
+
"nb-NO": $a8d0ee8ec28363c7$exports,
|
|
91
|
+
"nl-NL": $0073957e0c754983$exports,
|
|
92
|
+
"pl-PL": $51626cc4fccef54e$exports,
|
|
93
|
+
"pt-BR": $60b1cee412b56d27$exports,
|
|
94
|
+
"pt-PT": $df9c7cc4e8072a0f$exports,
|
|
95
|
+
"ro-RO": $aea54857f9df076d$exports,
|
|
96
|
+
"ru-RU": $8337ebc47a7e61a3$exports,
|
|
97
|
+
"sk-SK": $4703837f8f4224f8$exports,
|
|
98
|
+
"sl-SI": $2b9c8b37ab5bbcca$exports,
|
|
99
|
+
"sr-SP": $2c78665a3b81ed56$exports,
|
|
100
|
+
"sv-SE": $8da5dab2105c0d01$exports,
|
|
101
|
+
"tr-TR": $73a2418cb50e8fda$exports,
|
|
102
|
+
"uk-UA": $9c85d1989bb8c41d$exports,
|
|
103
|
+
"zh-CN": $a7db09d81aa41beb$exports,
|
|
104
|
+
"zh-TW": $edd6ee4675b7a1cd$exports
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
//# sourceMappingURL=intlStrings.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,iBAAiB;IACf,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;AACX","sources":["packages/@react-aria/numberfield/src/*.js"],"sourcesContent":["const _temp0 = require(\"../intl/ar-AE.json\");\nconst _temp1 = require(\"../intl/bg-BG.json\");\nconst _temp2 = require(\"../intl/cs-CZ.json\");\nconst _temp3 = require(\"../intl/da-DK.json\");\nconst _temp4 = require(\"../intl/de-DE.json\");\nconst _temp5 = require(\"../intl/el-GR.json\");\nconst _temp6 = require(\"../intl/en-US.json\");\nconst _temp7 = require(\"../intl/es-ES.json\");\nconst _temp8 = require(\"../intl/et-EE.json\");\nconst _temp9 = require(\"../intl/fi-FI.json\");\nconst _temp10 = require(\"../intl/fr-FR.json\");\nconst _temp11 = require(\"../intl/he-IL.json\");\nconst _temp12 = require(\"../intl/hr-HR.json\");\nconst _temp13 = require(\"../intl/hu-HU.json\");\nconst _temp14 = require(\"../intl/it-IT.json\");\nconst _temp15 = require(\"../intl/ja-JP.json\");\nconst _temp16 = require(\"../intl/ko-KR.json\");\nconst _temp17 = require(\"../intl/lt-LT.json\");\nconst _temp18 = require(\"../intl/lv-LV.json\");\nconst _temp19 = require(\"../intl/nb-NO.json\");\nconst _temp20 = require(\"../intl/nl-NL.json\");\nconst _temp21 = require(\"../intl/pl-PL.json\");\nconst _temp22 = require(\"../intl/pt-BR.json\");\nconst _temp23 = require(\"../intl/pt-PT.json\");\nconst _temp24 = require(\"../intl/ro-RO.json\");\nconst _temp25 = require(\"../intl/ru-RU.json\");\nconst _temp26 = require(\"../intl/sk-SK.json\");\nconst _temp27 = require(\"../intl/sl-SI.json\");\nconst _temp28 = require(\"../intl/sr-SP.json\");\nconst _temp29 = require(\"../intl/sv-SE.json\");\nconst _temp30 = require(\"../intl/tr-TR.json\");\nconst _temp31 = require(\"../intl/uk-UA.json\");\nconst _temp32 = require(\"../intl/zh-CN.json\");\nconst _temp33 = require(\"../intl/zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}"],"names":[],"version":3,"file":"intlStrings.main.js.map"}
|