@react-aria/numberfield 3.1.3 → 3.1.4
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/main.js +134 -134
- package/dist/module.js +134 -134
- package/package.json +13 -13
package/dist/main.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var $
|
|
2
|
-
var $
|
|
3
|
-
var $
|
|
4
|
-
var $
|
|
5
|
-
var $
|
|
6
|
-
var $
|
|
1
|
+
var $2wEZH$reactariautils = require("@react-aria/utils");
|
|
2
|
+
var $2wEZH$react = require("react");
|
|
3
|
+
var $2wEZH$reactariainteractions = require("@react-aria/interactions");
|
|
4
|
+
var $2wEZH$reactariatextfield = require("@react-aria/textfield");
|
|
5
|
+
var $2wEZH$reactariai18n = require("@react-aria/i18n");
|
|
6
|
+
var $2wEZH$reactariaspinbutton = require("@react-aria/spinbutton");
|
|
7
7
|
|
|
8
8
|
function $parcel$exportWildcard(dest, source) {
|
|
9
9
|
Object.keys(source).forEach(function(key) {
|
|
@@ -27,183 +27,183 @@ function $parcel$interopDefault(a) {
|
|
|
27
27
|
function $parcel$export(e, n, v, s) {
|
|
28
28
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
29
29
|
}
|
|
30
|
-
var $
|
|
30
|
+
var $fa863e9b015ae839$exports = {};
|
|
31
31
|
|
|
32
|
-
$parcel$export($
|
|
32
|
+
$parcel$export($fa863e9b015ae839$exports, "useNumberField", () => $fa863e9b015ae839$export$23f548e970bdf099);
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
var $
|
|
36
|
-
var $
|
|
37
|
-
$
|
|
35
|
+
var $1bcaad54abc442a2$exports = {};
|
|
36
|
+
var $15c26e9e75543508$exports = {};
|
|
37
|
+
$15c26e9e75543508$exports = JSON.parse("{\"decrease\":\"خفض {fieldLabel}\",\"increase\":\"زيادة {fieldLabel}\",\"numberField\":\"حقل رقمي\"}");
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
var $
|
|
41
|
-
$
|
|
40
|
+
var $2d346802965e5c25$exports = {};
|
|
41
|
+
$2d346802965e5c25$exports = JSON.parse("{\"decrease\":\"Намаляване {fieldLabel}\",\"increase\":\"Усилване {fieldLabel}\",\"numberField\":\"Номер на полето\"}");
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
var $
|
|
45
|
-
$
|
|
44
|
+
var $09893e85abdd2974$exports = {};
|
|
45
|
+
$09893e85abdd2974$exports = JSON.parse("{\"decrease\":\"Snížit {fieldLabel}\",\"increase\":\"Zvýšit {fieldLabel}\",\"numberField\":\"Číselné pole\"}");
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
var $
|
|
49
|
-
$
|
|
48
|
+
var $413bf45f477fb4e1$exports = {};
|
|
49
|
+
$413bf45f477fb4e1$exports = JSON.parse("{\"decrease\":\"Reducer {fieldLabel}\",\"increase\":\"Øg {fieldLabel}\",\"numberField\":\"Talfelt\"}");
|
|
50
50
|
|
|
51
51
|
|
|
52
|
-
var $
|
|
53
|
-
$
|
|
52
|
+
var $2727845e2efab680$exports = {};
|
|
53
|
+
$2727845e2efab680$exports = JSON.parse("{\"decrease\":\"{fieldLabel} verringern\",\"increase\":\"{fieldLabel} erhöhen\",\"numberField\":\"Nummernfeld\"}");
|
|
54
54
|
|
|
55
55
|
|
|
56
|
-
var $
|
|
57
|
-
$
|
|
56
|
+
var $11030a3afacdbc2e$exports = {};
|
|
57
|
+
$11030a3afacdbc2e$exports = JSON.parse("{\"decrease\":\"Μείωση {fieldLabel}\",\"increase\":\"Αύξηση {fieldLabel}\",\"numberField\":\"Πεδίο αριθμού\"}");
|
|
58
58
|
|
|
59
59
|
|
|
60
|
-
var $
|
|
61
|
-
$
|
|
60
|
+
var $1e48617299cb10e8$exports = {};
|
|
61
|
+
$1e48617299cb10e8$exports = JSON.parse("{\"decrease\":\"Decrease {fieldLabel}\",\"increase\":\"Increase {fieldLabel}\",\"numberField\":\"Number field\"}");
|
|
62
62
|
|
|
63
63
|
|
|
64
|
-
var $
|
|
65
|
-
$
|
|
64
|
+
var $335176f389a02847$exports = {};
|
|
65
|
+
$335176f389a02847$exports = JSON.parse("{\"decrease\":\"Reducir {fieldLabel}\",\"increase\":\"Aumentar {fieldLabel}\",\"numberField\":\"Campo de número\"}");
|
|
66
66
|
|
|
67
67
|
|
|
68
|
-
var $
|
|
69
|
-
$
|
|
68
|
+
var $b08e7fdc34a812f3$exports = {};
|
|
69
|
+
$b08e7fdc34a812f3$exports = JSON.parse("{\"decrease\":\"Vähenda {fieldLabel}\",\"increase\":\"Suurenda {fieldLabel}\",\"numberField\":\"Numbri väli\"}");
|
|
70
70
|
|
|
71
71
|
|
|
72
|
-
var $
|
|
73
|
-
$
|
|
72
|
+
var $ce4c5a1eb7e6fc96$exports = {};
|
|
73
|
+
$ce4c5a1eb7e6fc96$exports = JSON.parse("{\"decrease\":\"Vähennä {fieldLabel}\",\"increase\":\"Lisää {fieldLabel}\",\"numberField\":\"Numerokenttä\"}");
|
|
74
74
|
|
|
75
75
|
|
|
76
|
-
var $
|
|
77
|
-
$
|
|
76
|
+
var $341f988ce23c559c$exports = {};
|
|
77
|
+
$341f988ce23c559c$exports = JSON.parse("{\"decrease\":\"Diminuer {fieldLabel}\",\"increase\":\"Augmenter {fieldLabel}\",\"numberField\":\"Champ de nombre\"}");
|
|
78
78
|
|
|
79
79
|
|
|
80
|
-
var $
|
|
81
|
-
$
|
|
80
|
+
var $950fd1a1d57d2f86$exports = {};
|
|
81
|
+
$950fd1a1d57d2f86$exports = JSON.parse("{\"decrease\":\"הקטן {fieldLabel}\",\"increase\":\"הגדל {fieldLabel}\",\"numberField\":\"שדה מספר\"}");
|
|
82
82
|
|
|
83
83
|
|
|
84
|
-
var $
|
|
85
|
-
$
|
|
84
|
+
var $7b949fa64cf10a07$exports = {};
|
|
85
|
+
$7b949fa64cf10a07$exports = JSON.parse("{\"decrease\":\"Smanji {fieldLabel}\",\"increase\":\"Povećaj {fieldLabel}\",\"numberField\":\"Polje broja\"}");
|
|
86
86
|
|
|
87
87
|
|
|
88
|
-
var $
|
|
89
|
-
$
|
|
88
|
+
var $a945ff6d5cb9cf90$exports = {};
|
|
89
|
+
$a945ff6d5cb9cf90$exports = JSON.parse("{\"decrease\":\"{fieldLabel} csökkentése\",\"increase\":\"{fieldLabel} növelése\",\"numberField\":\"Számmező\"}");
|
|
90
90
|
|
|
91
91
|
|
|
92
|
-
var $
|
|
93
|
-
$
|
|
92
|
+
var $f3393075c1f078d7$exports = {};
|
|
93
|
+
$f3393075c1f078d7$exports = JSON.parse("{\"decrease\":\"Riduci {fieldLabel}\",\"increase\":\"Aumenta {fieldLabel}\",\"numberField\":\"Campo numero\"}");
|
|
94
94
|
|
|
95
95
|
|
|
96
|
-
var $
|
|
97
|
-
$
|
|
96
|
+
var $a12655e072ef354d$exports = {};
|
|
97
|
+
$a12655e072ef354d$exports = JSON.parse("{\"decrease\":\"{fieldLabel}を縮小\",\"increase\":\"{fieldLabel}を拡大\",\"numberField\":\"数値フィールド\"}");
|
|
98
98
|
|
|
99
99
|
|
|
100
|
-
var $
|
|
101
|
-
$
|
|
100
|
+
var $880dbee0519c1bad$exports = {};
|
|
101
|
+
$880dbee0519c1bad$exports = JSON.parse("{\"decrease\":\"{fieldLabel} 감소\",\"increase\":\"{fieldLabel} 증가\",\"numberField\":\"번호 필드\"}");
|
|
102
102
|
|
|
103
103
|
|
|
104
|
-
var $
|
|
105
|
-
$
|
|
104
|
+
var $d4a9630b079105aa$exports = {};
|
|
105
|
+
$d4a9630b079105aa$exports = JSON.parse("{\"decrease\":\"Sumažinti {fieldLabel}\",\"increase\":\"Padidinti {fieldLabel}\",\"numberField\":\"Numerio laukas\"}");
|
|
106
106
|
|
|
107
107
|
|
|
108
|
-
var $
|
|
109
|
-
$
|
|
108
|
+
var $e358cd3315986eb7$exports = {};
|
|
109
|
+
$e358cd3315986eb7$exports = JSON.parse("{\"decrease\":\"Samazināšana {fieldLabel}\",\"increase\":\"Palielināšana {fieldLabel}\",\"numberField\":\"Skaitļu lauks\"}");
|
|
110
110
|
|
|
111
111
|
|
|
112
|
-
var $
|
|
113
|
-
$
|
|
112
|
+
var $a8d0ee8ec28363c7$exports = {};
|
|
113
|
+
$a8d0ee8ec28363c7$exports = JSON.parse("{\"decrease\":\"Reduser {fieldLabel}\",\"increase\":\"Øk {fieldLabel}\",\"numberField\":\"Tallfelt\"}");
|
|
114
114
|
|
|
115
115
|
|
|
116
|
-
var $
|
|
117
|
-
$
|
|
116
|
+
var $0073957e0c754983$exports = {};
|
|
117
|
+
$0073957e0c754983$exports = JSON.parse("{\"decrease\":\"{fieldLabel} verlagen\",\"increase\":\"{fieldLabel} verhogen\",\"numberField\":\"Getalveld\"}");
|
|
118
118
|
|
|
119
119
|
|
|
120
|
-
var $
|
|
121
|
-
$
|
|
120
|
+
var $51626cc4fccef54e$exports = {};
|
|
121
|
+
$51626cc4fccef54e$exports = JSON.parse("{\"decrease\":\"Zmniejsz {fieldLabel}\",\"increase\":\"Zwiększ {fieldLabel}\",\"numberField\":\"Pole numeru\"}");
|
|
122
122
|
|
|
123
123
|
|
|
124
|
-
var $
|
|
125
|
-
$
|
|
124
|
+
var $60b1cee412b56d27$exports = {};
|
|
125
|
+
$60b1cee412b56d27$exports = JSON.parse("{\"decrease\":\"Diminuir {fieldLabel}\",\"increase\":\"Aumentar {fieldLabel}\",\"numberField\":\"Campo de número\"}");
|
|
126
126
|
|
|
127
127
|
|
|
128
|
-
var $
|
|
129
|
-
$
|
|
128
|
+
var $df9c7cc4e8072a0f$exports = {};
|
|
129
|
+
$df9c7cc4e8072a0f$exports = JSON.parse("{\"decrease\":\"Diminuir {fieldLabel}\",\"increase\":\"Aumentar {fieldLabel}\",\"numberField\":\"Campo numérico\"}");
|
|
130
130
|
|
|
131
131
|
|
|
132
|
-
var $
|
|
133
|
-
$
|
|
132
|
+
var $aea54857f9df076d$exports = {};
|
|
133
|
+
$aea54857f9df076d$exports = JSON.parse("{\"decrease\":\"Scădere {fieldLabel}\",\"increase\":\"Creștere {fieldLabel}\",\"numberField\":\"Câmp numeric\"}");
|
|
134
134
|
|
|
135
135
|
|
|
136
|
-
var $
|
|
137
|
-
$
|
|
136
|
+
var $8337ebc47a7e61a3$exports = {};
|
|
137
|
+
$8337ebc47a7e61a3$exports = JSON.parse("{\"decrease\":\"Уменьшение {fieldLabel}\",\"increase\":\"Увеличение {fieldLabel}\",\"numberField\":\"Числовое поле\"}");
|
|
138
138
|
|
|
139
139
|
|
|
140
|
-
var $
|
|
141
|
-
$
|
|
140
|
+
var $4703837f8f4224f8$exports = {};
|
|
141
|
+
$4703837f8f4224f8$exports = JSON.parse("{\"decrease\":\"Znížiť {fieldLabel}\",\"increase\":\"Zvýšiť {fieldLabel}\",\"numberField\":\"Číselné pole\"}");
|
|
142
142
|
|
|
143
143
|
|
|
144
|
-
var $
|
|
145
|
-
$
|
|
144
|
+
var $2b9c8b37ab5bbcca$exports = {};
|
|
145
|
+
$2b9c8b37ab5bbcca$exports = JSON.parse("{\"decrease\":\"Upadati {fieldLabel}\",\"increase\":\"Povečajte {fieldLabel}\",\"numberField\":\"Številčno polje\"}");
|
|
146
146
|
|
|
147
147
|
|
|
148
|
-
var $
|
|
149
|
-
$
|
|
148
|
+
var $2c78665a3b81ed56$exports = {};
|
|
149
|
+
$2c78665a3b81ed56$exports = JSON.parse("{\"decrease\":\"Decrease {fieldLabel}\",\"increase\":\"Increase {fieldLabel}\",\"numberField\":\"Number field\"}");
|
|
150
150
|
|
|
151
151
|
|
|
152
|
-
var $
|
|
153
|
-
$
|
|
152
|
+
var $8da5dab2105c0d01$exports = {};
|
|
153
|
+
$8da5dab2105c0d01$exports = JSON.parse("{\"decrease\":\"Minska {fieldLabel}\",\"increase\":\"Öka {fieldLabel}\",\"numberField\":\"Nummerfält\"}");
|
|
154
154
|
|
|
155
155
|
|
|
156
|
-
var $
|
|
157
|
-
$
|
|
156
|
+
var $73a2418cb50e8fda$exports = {};
|
|
157
|
+
$73a2418cb50e8fda$exports = JSON.parse("{\"decrease\":\"{fieldLabel} azalt\",\"increase\":\"{fieldLabel} arttır\",\"numberField\":\"Sayı alanı\"}");
|
|
158
158
|
|
|
159
159
|
|
|
160
|
-
var $
|
|
161
|
-
$
|
|
160
|
+
var $9c85d1989bb8c41d$exports = {};
|
|
161
|
+
$9c85d1989bb8c41d$exports = JSON.parse("{\"decrease\":\"Зменшити {fieldLabel}\",\"increase\":\"Збільшити {fieldLabel}\",\"numberField\":\"Поле номера\"}");
|
|
162
162
|
|
|
163
163
|
|
|
164
|
-
var $
|
|
165
|
-
$
|
|
164
|
+
var $a7db09d81aa41beb$exports = {};
|
|
165
|
+
$a7db09d81aa41beb$exports = JSON.parse("{\"decrease\":\"降低 {fieldLabel}\",\"increase\":\"提高 {fieldLabel}\",\"numberField\":\"数字字段\"}");
|
|
166
166
|
|
|
167
167
|
|
|
168
|
-
var $
|
|
169
|
-
$
|
|
168
|
+
var $edd6ee4675b7a1cd$exports = {};
|
|
169
|
+
$edd6ee4675b7a1cd$exports = JSON.parse("{\"decrease\":\"縮小 {fieldLabel}\",\"increase\":\"放大 {fieldLabel}\",\"numberField\":\"數字欄位\"}");
|
|
170
170
|
|
|
171
171
|
|
|
172
|
-
$
|
|
173
|
-
"ar-AE": $
|
|
174
|
-
"bg-BG": $
|
|
175
|
-
"cs-CZ": $
|
|
176
|
-
"da-DK": $
|
|
177
|
-
"de-DE": $
|
|
178
|
-
"el-GR": $
|
|
179
|
-
"en-US": $
|
|
180
|
-
"es-ES": $
|
|
181
|
-
"et-EE": $
|
|
182
|
-
"fi-FI": $
|
|
183
|
-
"fr-FR": $
|
|
184
|
-
"he-IL": $
|
|
185
|
-
"hr-HR": $
|
|
186
|
-
"hu-HU": $
|
|
187
|
-
"it-IT": $
|
|
188
|
-
"ja-JP": $
|
|
189
|
-
"ko-KR": $
|
|
190
|
-
"lt-LT": $
|
|
191
|
-
"lv-LV": $
|
|
192
|
-
"nb-NO": $
|
|
193
|
-
"nl-NL": $
|
|
194
|
-
"pl-PL": $
|
|
195
|
-
"pt-BR": $
|
|
196
|
-
"pt-PT": $
|
|
197
|
-
"ro-RO": $
|
|
198
|
-
"ru-RU": $
|
|
199
|
-
"sk-SK": $
|
|
200
|
-
"sl-SI": $
|
|
201
|
-
"sr-SP": $
|
|
202
|
-
"sv-SE": $
|
|
203
|
-
"tr-TR": $
|
|
204
|
-
"uk-UA": $
|
|
205
|
-
"zh-CN": $
|
|
206
|
-
"zh-TW": $
|
|
172
|
+
$1bcaad54abc442a2$exports = {
|
|
173
|
+
"ar-AE": $15c26e9e75543508$exports,
|
|
174
|
+
"bg-BG": $2d346802965e5c25$exports,
|
|
175
|
+
"cs-CZ": $09893e85abdd2974$exports,
|
|
176
|
+
"da-DK": $413bf45f477fb4e1$exports,
|
|
177
|
+
"de-DE": $2727845e2efab680$exports,
|
|
178
|
+
"el-GR": $11030a3afacdbc2e$exports,
|
|
179
|
+
"en-US": $1e48617299cb10e8$exports,
|
|
180
|
+
"es-ES": $335176f389a02847$exports,
|
|
181
|
+
"et-EE": $b08e7fdc34a812f3$exports,
|
|
182
|
+
"fi-FI": $ce4c5a1eb7e6fc96$exports,
|
|
183
|
+
"fr-FR": $341f988ce23c559c$exports,
|
|
184
|
+
"he-IL": $950fd1a1d57d2f86$exports,
|
|
185
|
+
"hr-HR": $7b949fa64cf10a07$exports,
|
|
186
|
+
"hu-HU": $a945ff6d5cb9cf90$exports,
|
|
187
|
+
"it-IT": $f3393075c1f078d7$exports,
|
|
188
|
+
"ja-JP": $a12655e072ef354d$exports,
|
|
189
|
+
"ko-KR": $880dbee0519c1bad$exports,
|
|
190
|
+
"lt-LT": $d4a9630b079105aa$exports,
|
|
191
|
+
"lv-LV": $e358cd3315986eb7$exports,
|
|
192
|
+
"nb-NO": $a8d0ee8ec28363c7$exports,
|
|
193
|
+
"nl-NL": $0073957e0c754983$exports,
|
|
194
|
+
"pl-PL": $51626cc4fccef54e$exports,
|
|
195
|
+
"pt-BR": $60b1cee412b56d27$exports,
|
|
196
|
+
"pt-PT": $df9c7cc4e8072a0f$exports,
|
|
197
|
+
"ro-RO": $aea54857f9df076d$exports,
|
|
198
|
+
"ru-RU": $8337ebc47a7e61a3$exports,
|
|
199
|
+
"sk-SK": $4703837f8f4224f8$exports,
|
|
200
|
+
"sl-SI": $2b9c8b37ab5bbcca$exports,
|
|
201
|
+
"sr-SP": $2c78665a3b81ed56$exports,
|
|
202
|
+
"sv-SE": $8da5dab2105c0d01$exports,
|
|
203
|
+
"tr-TR": $73a2418cb50e8fda$exports,
|
|
204
|
+
"uk-UA": $9c85d1989bb8c41d$exports,
|
|
205
|
+
"zh-CN": $a7db09d81aa41beb$exports,
|
|
206
|
+
"zh-TW": $edd6ee4675b7a1cd$exports
|
|
207
207
|
};
|
|
208
208
|
|
|
209
209
|
|
|
@@ -212,18 +212,18 @@ $18a9fb1e4ce20537$exports = {
|
|
|
212
212
|
|
|
213
213
|
|
|
214
214
|
|
|
215
|
-
function $
|
|
215
|
+
function $fa863e9b015ae839$export$23f548e970bdf099(props, state, inputRef) {
|
|
216
216
|
let { id: id , decrementAriaLabel: decrementAriaLabel , incrementAriaLabel: incrementAriaLabel , isDisabled: isDisabled , isReadOnly: isReadOnly , isRequired: isRequired , minValue: minValue , maxValue: maxValue , autoFocus: autoFocus , validationState: validationState , label: label , formatOptions: formatOptions , onBlur: onBlur , onFocus: onFocus , onFocusChange: onFocusChange , onKeyDown: onKeyDown , onKeyUp: onKeyUp , description: description , errorMessage: errorMessage } = props;
|
|
217
217
|
let { increment: increment , incrementToMax: incrementToMax , decrement: decrement , decrementToMin: decrementToMin , numberValue: numberValue , commit: commit } = state;
|
|
218
|
-
const formatMessage = $
|
|
219
|
-
let inputId = $
|
|
220
|
-
let { focusProps: focusProps } = $
|
|
218
|
+
const formatMessage = $2wEZH$reactariai18n.useMessageFormatter((/*@__PURE__*/$parcel$interopDefault($1bcaad54abc442a2$exports)));
|
|
219
|
+
let inputId = $2wEZH$reactariautils.useId(id);
|
|
220
|
+
let { focusProps: focusProps } = $2wEZH$reactariainteractions.useFocus({
|
|
221
221
|
onBlur: ()=>{
|
|
222
222
|
// Set input value to normalized valid value
|
|
223
223
|
commit();
|
|
224
224
|
}
|
|
225
225
|
});
|
|
226
|
-
let { spinButtonProps: spinButtonProps , incrementButtonProps: incButtonProps , decrementButtonProps: decButtonProps } = $
|
|
226
|
+
let { spinButtonProps: spinButtonProps , incrementButtonProps: incButtonProps , decrementButtonProps: decButtonProps } = $2wEZH$reactariaspinbutton.useSpinButton({
|
|
227
227
|
isDisabled: isDisabled,
|
|
228
228
|
isReadOnly: isReadOnly,
|
|
229
229
|
isRequired: isRequired,
|
|
@@ -236,12 +236,12 @@ function $1405e85978caae1b$export$23f548e970bdf099(props, state, inputRef) {
|
|
|
236
236
|
value: numberValue,
|
|
237
237
|
textValue: state.inputValue
|
|
238
238
|
});
|
|
239
|
-
let [focusWithin, setFocusWithin] = $
|
|
240
|
-
let { focusWithinProps: focusWithinProps } = $
|
|
239
|
+
let [focusWithin, setFocusWithin] = $2wEZH$react.useState(false);
|
|
240
|
+
let { focusWithinProps: focusWithinProps } = $2wEZH$reactariainteractions.useFocusWithin({
|
|
241
241
|
isDisabled: isDisabled,
|
|
242
242
|
onFocusWithinChange: setFocusWithin
|
|
243
243
|
});
|
|
244
|
-
let onWheel = $
|
|
244
|
+
let onWheel = $2wEZH$react.useCallback((e)=>{
|
|
245
245
|
// if on a trackpad, users can scroll in both X and Y at once, check the magnitude of the change
|
|
246
246
|
// if it's mostly in the X direction, then just return, the user probably doesn't mean to inc/dec
|
|
247
247
|
// this isn't perfect, events come in fast with small deltas and a part of the scroll may give a false indication
|
|
@@ -255,7 +255,7 @@ function $1405e85978caae1b$export$23f548e970bdf099(props, state, inputRef) {
|
|
|
255
255
|
]);
|
|
256
256
|
// If the input isn't supposed to receive input, disable scrolling.
|
|
257
257
|
let scrollingDisabled = isDisabled || isReadOnly || !focusWithin;
|
|
258
|
-
$
|
|
258
|
+
$2wEZH$reactariainteractions.useScrollWheel({
|
|
259
259
|
onScroll: onWheel,
|
|
260
260
|
isDisabled: scrollingDisabled
|
|
261
261
|
}, inputRef);
|
|
@@ -263,21 +263,21 @@ function $1405e85978caae1b$export$23f548e970bdf099(props, state, inputRef) {
|
|
|
263
263
|
// Browsers and operating systems are quite inconsistent about what keys are available, however.
|
|
264
264
|
// We choose between numeric and decimal based on whether we allow negative and fractional numbers,
|
|
265
265
|
// and based on testing on various devices to determine what keys are available in each inputMode.
|
|
266
|
-
let numberFormatter = $
|
|
267
|
-
let intlOptions = $
|
|
266
|
+
let numberFormatter = $2wEZH$reactariai18n.useNumberFormatter(formatOptions);
|
|
267
|
+
let intlOptions = $2wEZH$react.useMemo(()=>numberFormatter.resolvedOptions()
|
|
268
268
|
, [
|
|
269
269
|
numberFormatter
|
|
270
270
|
]);
|
|
271
271
|
let hasDecimals = intlOptions.maximumFractionDigits > 0;
|
|
272
272
|
let hasNegative = isNaN(state.minValue) || state.minValue < 0;
|
|
273
273
|
let inputMode = 'numeric';
|
|
274
|
-
if ($
|
|
274
|
+
if ($2wEZH$reactariautils.isIPhone()) {
|
|
275
275
|
// iPhone doesn't have a minus sign in either numeric or decimal.
|
|
276
276
|
// Note this is only for iPhone, not iPad, which always has both
|
|
277
277
|
// minus and decimal in numeric.
|
|
278
278
|
if (hasNegative) inputMode = 'text';
|
|
279
279
|
else if (hasDecimals) inputMode = 'decimal';
|
|
280
|
-
} else if ($
|
|
280
|
+
} else if ($2wEZH$reactariautils.isAndroid()) {
|
|
281
281
|
// Android numeric has both a decimal point and minus key.
|
|
282
282
|
// decimal does not have a minus key.
|
|
283
283
|
if (hasNegative) inputMode = 'numeric';
|
|
@@ -286,8 +286,8 @@ function $1405e85978caae1b$export$23f548e970bdf099(props, state, inputRef) {
|
|
|
286
286
|
let onChange = (value)=>{
|
|
287
287
|
state.setInputValue(value);
|
|
288
288
|
};
|
|
289
|
-
let domProps = $
|
|
290
|
-
let { labelProps: labelProps , inputProps: textFieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = $
|
|
289
|
+
let domProps = $2wEZH$reactariautils.filterDOMProps(props);
|
|
290
|
+
let { labelProps: labelProps , inputProps: textFieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = $2wEZH$reactariatextfield.useFormattedTextField({
|
|
291
291
|
...domProps,
|
|
292
292
|
label: label,
|
|
293
293
|
autoFocus: autoFocus,
|
|
@@ -311,11 +311,11 @@ function $1405e85978caae1b$export$23f548e970bdf099(props, state, inputRef) {
|
|
|
311
311
|
description: description,
|
|
312
312
|
errorMessage: errorMessage
|
|
313
313
|
}, state, inputRef);
|
|
314
|
-
let inputProps = $
|
|
314
|
+
let inputProps = $2wEZH$reactariautils.mergeProps(spinButtonProps, textFieldProps, focusProps, {
|
|
315
315
|
// override the spinbutton role, we can't focus a spin button with VO
|
|
316
316
|
role: null,
|
|
317
317
|
// ignore aria-roledescription on iOS so that required state will announce when it is present
|
|
318
|
-
'aria-roledescription': !$
|
|
318
|
+
'aria-roledescription': !$2wEZH$reactariautils.isIOS() ? formatMessage('numberField') : null,
|
|
319
319
|
'aria-valuemax': null,
|
|
320
320
|
'aria-valuemin': null,
|
|
321
321
|
'aria-valuenow': null,
|
|
@@ -346,9 +346,9 @@ function $1405e85978caae1b$export$23f548e970bdf099(props, state, inputRef) {
|
|
|
346
346
|
let fieldLabel = props['aria-label'] || (typeof props.label === 'string' ? props.label : '');
|
|
347
347
|
let ariaLabelledby;
|
|
348
348
|
if (!fieldLabel) ariaLabelledby = props.label != null ? labelProps.id : props['aria-labelledby'];
|
|
349
|
-
let incrementId = $
|
|
350
|
-
let decrementId = $
|
|
351
|
-
let incrementButtonProps = $
|
|
349
|
+
let incrementId = $2wEZH$reactariautils.useId();
|
|
350
|
+
let decrementId = $2wEZH$reactariautils.useId();
|
|
351
|
+
let incrementButtonProps = $2wEZH$reactariautils.mergeProps(incButtonProps, {
|
|
352
352
|
'aria-label': incrementAriaLabel || formatMessage('increase', {
|
|
353
353
|
fieldLabel: fieldLabel
|
|
354
354
|
}).trim(),
|
|
@@ -361,7 +361,7 @@ function $1405e85978caae1b$export$23f548e970bdf099(props, state, inputRef) {
|
|
|
361
361
|
isDisabled: !state.canIncrement,
|
|
362
362
|
onPressStart: onButtonPressStart
|
|
363
363
|
});
|
|
364
|
-
let decrementButtonProps = $
|
|
364
|
+
let decrementButtonProps = $2wEZH$reactariautils.mergeProps(decButtonProps, {
|
|
365
365
|
'aria-label': decrementAriaLabel || formatMessage('decrease', {
|
|
366
366
|
fieldLabel: fieldLabel
|
|
367
367
|
}).trim(),
|
|
@@ -391,7 +391,7 @@ function $1405e85978caae1b$export$23f548e970bdf099(props, state, inputRef) {
|
|
|
391
391
|
}
|
|
392
392
|
|
|
393
393
|
|
|
394
|
-
$parcel$exportWildcard(module.exports, $
|
|
394
|
+
$parcel$exportWildcard(module.exports, $fa863e9b015ae839$exports);
|
|
395
395
|
|
|
396
396
|
|
|
397
397
|
//# sourceMappingURL=main.js.map
|
package/dist/module.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {useId as $
|
|
2
|
-
import {useState as $
|
|
3
|
-
import {useFocus as $
|
|
4
|
-
import {useFormattedTextField as $
|
|
5
|
-
import {useMessageFormatter as $
|
|
6
|
-
import {useSpinButton as $
|
|
1
|
+
import {useId as $gfhJl$useId, isIPhone as $gfhJl$isIPhone, isAndroid as $gfhJl$isAndroid, filterDOMProps as $gfhJl$filterDOMProps, mergeProps as $gfhJl$mergeProps, isIOS as $gfhJl$isIOS} from "@react-aria/utils";
|
|
2
|
+
import {useState as $gfhJl$useState, useCallback as $gfhJl$useCallback, useMemo as $gfhJl$useMemo} from "react";
|
|
3
|
+
import {useFocus as $gfhJl$useFocus, useFocusWithin as $gfhJl$useFocusWithin, useScrollWheel as $gfhJl$useScrollWheel} from "@react-aria/interactions";
|
|
4
|
+
import {useFormattedTextField as $gfhJl$useFormattedTextField} from "@react-aria/textfield";
|
|
5
|
+
import {useMessageFormatter as $gfhJl$useMessageFormatter, useNumberFormatter as $gfhJl$useNumberFormatter} from "@react-aria/i18n";
|
|
6
|
+
import {useSpinButton as $gfhJl$useSpinButton} from "@react-aria/spinbutton";
|
|
7
7
|
|
|
8
8
|
function $parcel$interopDefault(a) {
|
|
9
9
|
return a && a.__esModule ? a.default : a;
|
|
@@ -11,183 +11,183 @@ function $parcel$interopDefault(a) {
|
|
|
11
11
|
function $parcel$export(e, n, v, s) {
|
|
12
12
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
13
13
|
}
|
|
14
|
-
var $
|
|
14
|
+
var $81397a9303501bda$exports = {};
|
|
15
15
|
|
|
16
|
-
$parcel$export($
|
|
16
|
+
$parcel$export($81397a9303501bda$exports, "useNumberField", () => $81397a9303501bda$export$23f548e970bdf099);
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var $
|
|
20
|
-
var $
|
|
21
|
-
$
|
|
19
|
+
var $c3ef0f8b54adbb57$exports = {};
|
|
20
|
+
var $fb78e0f6ab6349ed$exports = {};
|
|
21
|
+
$fb78e0f6ab6349ed$exports = JSON.parse("{\"decrease\":\"خفض {fieldLabel}\",\"increase\":\"زيادة {fieldLabel}\",\"numberField\":\"حقل رقمي\"}");
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
var $
|
|
25
|
-
$
|
|
24
|
+
var $2776acdd9959a647$exports = {};
|
|
25
|
+
$2776acdd9959a647$exports = JSON.parse("{\"decrease\":\"Намаляване {fieldLabel}\",\"increase\":\"Усилване {fieldLabel}\",\"numberField\":\"Номер на полето\"}");
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
var $
|
|
29
|
-
$
|
|
28
|
+
var $741954410a365ad3$exports = {};
|
|
29
|
+
$741954410a365ad3$exports = JSON.parse("{\"decrease\":\"Snížit {fieldLabel}\",\"increase\":\"Zvýšit {fieldLabel}\",\"numberField\":\"Číselné pole\"}");
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var $
|
|
33
|
-
$
|
|
32
|
+
var $8321ed0f8ab642f0$exports = {};
|
|
33
|
+
$8321ed0f8ab642f0$exports = JSON.parse("{\"decrease\":\"Reducer {fieldLabel}\",\"increase\":\"Øg {fieldLabel}\",\"numberField\":\"Talfelt\"}");
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
var $
|
|
37
|
-
$
|
|
36
|
+
var $92978e0c4ecafa32$exports = {};
|
|
37
|
+
$92978e0c4ecafa32$exports = JSON.parse("{\"decrease\":\"{fieldLabel} verringern\",\"increase\":\"{fieldLabel} erhöhen\",\"numberField\":\"Nummernfeld\"}");
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
var $
|
|
41
|
-
$
|
|
40
|
+
var $ac5ff71962864a84$exports = {};
|
|
41
|
+
$ac5ff71962864a84$exports = JSON.parse("{\"decrease\":\"Μείωση {fieldLabel}\",\"increase\":\"Αύξηση {fieldLabel}\",\"numberField\":\"Πεδίο αριθμού\"}");
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
var $
|
|
45
|
-
$
|
|
44
|
+
var $efe4685e2440d8be$exports = {};
|
|
45
|
+
$efe4685e2440d8be$exports = JSON.parse("{\"decrease\":\"Decrease {fieldLabel}\",\"increase\":\"Increase {fieldLabel}\",\"numberField\":\"Number field\"}");
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
var $
|
|
49
|
-
$
|
|
48
|
+
var $e50a9a48739b90e1$exports = {};
|
|
49
|
+
$e50a9a48739b90e1$exports = JSON.parse("{\"decrease\":\"Reducir {fieldLabel}\",\"increase\":\"Aumentar {fieldLabel}\",\"numberField\":\"Campo de número\"}");
|
|
50
50
|
|
|
51
51
|
|
|
52
|
-
var $
|
|
53
|
-
$
|
|
52
|
+
var $6e0d5294ecbb8ab6$exports = {};
|
|
53
|
+
$6e0d5294ecbb8ab6$exports = JSON.parse("{\"decrease\":\"Vähenda {fieldLabel}\",\"increase\":\"Suurenda {fieldLabel}\",\"numberField\":\"Numbri väli\"}");
|
|
54
54
|
|
|
55
55
|
|
|
56
|
-
var $
|
|
57
|
-
$
|
|
56
|
+
var $e7129d65f607f77f$exports = {};
|
|
57
|
+
$e7129d65f607f77f$exports = JSON.parse("{\"decrease\":\"Vähennä {fieldLabel}\",\"increase\":\"Lisää {fieldLabel}\",\"numberField\":\"Numerokenttä\"}");
|
|
58
58
|
|
|
59
59
|
|
|
60
|
-
var $
|
|
61
|
-
$
|
|
60
|
+
var $d72adf5b20573e34$exports = {};
|
|
61
|
+
$d72adf5b20573e34$exports = JSON.parse("{\"decrease\":\"Diminuer {fieldLabel}\",\"increase\":\"Augmenter {fieldLabel}\",\"numberField\":\"Champ de nombre\"}");
|
|
62
62
|
|
|
63
63
|
|
|
64
|
-
var $
|
|
65
|
-
$
|
|
64
|
+
var $a25c707e88b844a7$exports = {};
|
|
65
|
+
$a25c707e88b844a7$exports = JSON.parse("{\"decrease\":\"הקטן {fieldLabel}\",\"increase\":\"הגדל {fieldLabel}\",\"numberField\":\"שדה מספר\"}");
|
|
66
66
|
|
|
67
67
|
|
|
68
|
-
var $
|
|
69
|
-
$
|
|
68
|
+
var $69b41140b9a4ca54$exports = {};
|
|
69
|
+
$69b41140b9a4ca54$exports = JSON.parse("{\"decrease\":\"Smanji {fieldLabel}\",\"increase\":\"Povećaj {fieldLabel}\",\"numberField\":\"Polje broja\"}");
|
|
70
70
|
|
|
71
71
|
|
|
72
|
-
var $
|
|
73
|
-
$
|
|
72
|
+
var $81dab28f37f59d1a$exports = {};
|
|
73
|
+
$81dab28f37f59d1a$exports = JSON.parse("{\"decrease\":\"{fieldLabel} csökkentése\",\"increase\":\"{fieldLabel} növelése\",\"numberField\":\"Számmező\"}");
|
|
74
74
|
|
|
75
75
|
|
|
76
|
-
var $
|
|
77
|
-
$
|
|
76
|
+
var $866555b31f2d7711$exports = {};
|
|
77
|
+
$866555b31f2d7711$exports = JSON.parse("{\"decrease\":\"Riduci {fieldLabel}\",\"increase\":\"Aumenta {fieldLabel}\",\"numberField\":\"Campo numero\"}");
|
|
78
78
|
|
|
79
79
|
|
|
80
|
-
var $
|
|
81
|
-
$
|
|
80
|
+
var $dafcd55d52b9d371$exports = {};
|
|
81
|
+
$dafcd55d52b9d371$exports = JSON.parse("{\"decrease\":\"{fieldLabel}を縮小\",\"increase\":\"{fieldLabel}を拡大\",\"numberField\":\"数値フィールド\"}");
|
|
82
82
|
|
|
83
83
|
|
|
84
|
-
var $
|
|
85
|
-
$
|
|
84
|
+
var $f090c1f8c5da0145$exports = {};
|
|
85
|
+
$f090c1f8c5da0145$exports = JSON.parse("{\"decrease\":\"{fieldLabel} 감소\",\"increase\":\"{fieldLabel} 증가\",\"numberField\":\"번호 필드\"}");
|
|
86
86
|
|
|
87
87
|
|
|
88
|
-
var $
|
|
89
|
-
$
|
|
88
|
+
var $6f10f3a13360a75c$exports = {};
|
|
89
|
+
$6f10f3a13360a75c$exports = JSON.parse("{\"decrease\":\"Sumažinti {fieldLabel}\",\"increase\":\"Padidinti {fieldLabel}\",\"numberField\":\"Numerio laukas\"}");
|
|
90
90
|
|
|
91
91
|
|
|
92
|
-
var $
|
|
93
|
-
$
|
|
92
|
+
var $47432cefd4b7bd1b$exports = {};
|
|
93
|
+
$47432cefd4b7bd1b$exports = JSON.parse("{\"decrease\":\"Samazināšana {fieldLabel}\",\"increase\":\"Palielināšana {fieldLabel}\",\"numberField\":\"Skaitļu lauks\"}");
|
|
94
94
|
|
|
95
95
|
|
|
96
|
-
var $
|
|
97
|
-
$
|
|
96
|
+
var $dc578a950a2bf23d$exports = {};
|
|
97
|
+
$dc578a950a2bf23d$exports = JSON.parse("{\"decrease\":\"Reduser {fieldLabel}\",\"increase\":\"Øk {fieldLabel}\",\"numberField\":\"Tallfelt\"}");
|
|
98
98
|
|
|
99
99
|
|
|
100
|
-
var $
|
|
101
|
-
$
|
|
100
|
+
var $353f1bfca4dc395a$exports = {};
|
|
101
|
+
$353f1bfca4dc395a$exports = JSON.parse("{\"decrease\":\"{fieldLabel} verlagen\",\"increase\":\"{fieldLabel} verhogen\",\"numberField\":\"Getalveld\"}");
|
|
102
102
|
|
|
103
103
|
|
|
104
|
-
var $
|
|
105
|
-
$
|
|
104
|
+
var $241bc0bbd870e982$exports = {};
|
|
105
|
+
$241bc0bbd870e982$exports = JSON.parse("{\"decrease\":\"Zmniejsz {fieldLabel}\",\"increase\":\"Zwiększ {fieldLabel}\",\"numberField\":\"Pole numeru\"}");
|
|
106
106
|
|
|
107
107
|
|
|
108
|
-
var $
|
|
109
|
-
$
|
|
108
|
+
var $da3005c7bd72b0a8$exports = {};
|
|
109
|
+
$da3005c7bd72b0a8$exports = JSON.parse("{\"decrease\":\"Diminuir {fieldLabel}\",\"increase\":\"Aumentar {fieldLabel}\",\"numberField\":\"Campo de número\"}");
|
|
110
110
|
|
|
111
111
|
|
|
112
|
-
var $
|
|
113
|
-
$
|
|
112
|
+
var $cf48bfc540882310$exports = {};
|
|
113
|
+
$cf48bfc540882310$exports = JSON.parse("{\"decrease\":\"Diminuir {fieldLabel}\",\"increase\":\"Aumentar {fieldLabel}\",\"numberField\":\"Campo numérico\"}");
|
|
114
114
|
|
|
115
115
|
|
|
116
|
-
var $
|
|
117
|
-
$
|
|
116
|
+
var $b63a28c481ab9ee3$exports = {};
|
|
117
|
+
$b63a28c481ab9ee3$exports = JSON.parse("{\"decrease\":\"Scădere {fieldLabel}\",\"increase\":\"Creștere {fieldLabel}\",\"numberField\":\"Câmp numeric\"}");
|
|
118
118
|
|
|
119
119
|
|
|
120
|
-
var $
|
|
121
|
-
$
|
|
120
|
+
var $19f9df95c2464ab6$exports = {};
|
|
121
|
+
$19f9df95c2464ab6$exports = JSON.parse("{\"decrease\":\"Уменьшение {fieldLabel}\",\"increase\":\"Увеличение {fieldLabel}\",\"numberField\":\"Числовое поле\"}");
|
|
122
122
|
|
|
123
123
|
|
|
124
|
-
var $
|
|
125
|
-
$
|
|
124
|
+
var $b272932a685e8482$exports = {};
|
|
125
|
+
$b272932a685e8482$exports = JSON.parse("{\"decrease\":\"Znížiť {fieldLabel}\",\"increase\":\"Zvýšiť {fieldLabel}\",\"numberField\":\"Číselné pole\"}");
|
|
126
126
|
|
|
127
127
|
|
|
128
|
-
var $
|
|
129
|
-
$
|
|
128
|
+
var $cbaf8b5b61f9e544$exports = {};
|
|
129
|
+
$cbaf8b5b61f9e544$exports = JSON.parse("{\"decrease\":\"Upadati {fieldLabel}\",\"increase\":\"Povečajte {fieldLabel}\",\"numberField\":\"Številčno polje\"}");
|
|
130
130
|
|
|
131
131
|
|
|
132
|
-
var $
|
|
133
|
-
$
|
|
132
|
+
var $e0a3af6ac1449b2f$exports = {};
|
|
133
|
+
$e0a3af6ac1449b2f$exports = JSON.parse("{\"decrease\":\"Decrease {fieldLabel}\",\"increase\":\"Increase {fieldLabel}\",\"numberField\":\"Number field\"}");
|
|
134
134
|
|
|
135
135
|
|
|
136
|
-
var $
|
|
137
|
-
$
|
|
136
|
+
var $71e167d2458a6019$exports = {};
|
|
137
|
+
$71e167d2458a6019$exports = JSON.parse("{\"decrease\":\"Minska {fieldLabel}\",\"increase\":\"Öka {fieldLabel}\",\"numberField\":\"Nummerfält\"}");
|
|
138
138
|
|
|
139
139
|
|
|
140
|
-
var $
|
|
141
|
-
$
|
|
140
|
+
var $3719245abc082946$exports = {};
|
|
141
|
+
$3719245abc082946$exports = JSON.parse("{\"decrease\":\"{fieldLabel} azalt\",\"increase\":\"{fieldLabel} arttır\",\"numberField\":\"Sayı alanı\"}");
|
|
142
142
|
|
|
143
143
|
|
|
144
|
-
var $
|
|
145
|
-
$
|
|
144
|
+
var $2ccc589e2f51824d$exports = {};
|
|
145
|
+
$2ccc589e2f51824d$exports = JSON.parse("{\"decrease\":\"Зменшити {fieldLabel}\",\"increase\":\"Збільшити {fieldLabel}\",\"numberField\":\"Поле номера\"}");
|
|
146
146
|
|
|
147
147
|
|
|
148
|
-
var $
|
|
149
|
-
$
|
|
148
|
+
var $e1103cb9b4c13942$exports = {};
|
|
149
|
+
$e1103cb9b4c13942$exports = JSON.parse("{\"decrease\":\"降低 {fieldLabel}\",\"increase\":\"提高 {fieldLabel}\",\"numberField\":\"数字字段\"}");
|
|
150
150
|
|
|
151
151
|
|
|
152
|
-
var $
|
|
153
|
-
$
|
|
152
|
+
var $448607634f80dccb$exports = {};
|
|
153
|
+
$448607634f80dccb$exports = JSON.parse("{\"decrease\":\"縮小 {fieldLabel}\",\"increase\":\"放大 {fieldLabel}\",\"numberField\":\"數字欄位\"}");
|
|
154
154
|
|
|
155
155
|
|
|
156
|
-
$
|
|
157
|
-
"ar-AE": $
|
|
158
|
-
"bg-BG": $
|
|
159
|
-
"cs-CZ": $
|
|
160
|
-
"da-DK": $
|
|
161
|
-
"de-DE": $
|
|
162
|
-
"el-GR": $
|
|
163
|
-
"en-US": $
|
|
164
|
-
"es-ES": $
|
|
165
|
-
"et-EE": $
|
|
166
|
-
"fi-FI": $
|
|
167
|
-
"fr-FR": $
|
|
168
|
-
"he-IL": $
|
|
169
|
-
"hr-HR": $
|
|
170
|
-
"hu-HU": $
|
|
171
|
-
"it-IT": $
|
|
172
|
-
"ja-JP": $
|
|
173
|
-
"ko-KR": $
|
|
174
|
-
"lt-LT": $
|
|
175
|
-
"lv-LV": $
|
|
176
|
-
"nb-NO": $
|
|
177
|
-
"nl-NL": $
|
|
178
|
-
"pl-PL": $
|
|
179
|
-
"pt-BR": $
|
|
180
|
-
"pt-PT": $
|
|
181
|
-
"ro-RO": $
|
|
182
|
-
"ru-RU": $
|
|
183
|
-
"sk-SK": $
|
|
184
|
-
"sl-SI": $
|
|
185
|
-
"sr-SP": $
|
|
186
|
-
"sv-SE": $
|
|
187
|
-
"tr-TR": $
|
|
188
|
-
"uk-UA": $
|
|
189
|
-
"zh-CN": $
|
|
190
|
-
"zh-TW": $
|
|
156
|
+
$c3ef0f8b54adbb57$exports = {
|
|
157
|
+
"ar-AE": $fb78e0f6ab6349ed$exports,
|
|
158
|
+
"bg-BG": $2776acdd9959a647$exports,
|
|
159
|
+
"cs-CZ": $741954410a365ad3$exports,
|
|
160
|
+
"da-DK": $8321ed0f8ab642f0$exports,
|
|
161
|
+
"de-DE": $92978e0c4ecafa32$exports,
|
|
162
|
+
"el-GR": $ac5ff71962864a84$exports,
|
|
163
|
+
"en-US": $efe4685e2440d8be$exports,
|
|
164
|
+
"es-ES": $e50a9a48739b90e1$exports,
|
|
165
|
+
"et-EE": $6e0d5294ecbb8ab6$exports,
|
|
166
|
+
"fi-FI": $e7129d65f607f77f$exports,
|
|
167
|
+
"fr-FR": $d72adf5b20573e34$exports,
|
|
168
|
+
"he-IL": $a25c707e88b844a7$exports,
|
|
169
|
+
"hr-HR": $69b41140b9a4ca54$exports,
|
|
170
|
+
"hu-HU": $81dab28f37f59d1a$exports,
|
|
171
|
+
"it-IT": $866555b31f2d7711$exports,
|
|
172
|
+
"ja-JP": $dafcd55d52b9d371$exports,
|
|
173
|
+
"ko-KR": $f090c1f8c5da0145$exports,
|
|
174
|
+
"lt-LT": $6f10f3a13360a75c$exports,
|
|
175
|
+
"lv-LV": $47432cefd4b7bd1b$exports,
|
|
176
|
+
"nb-NO": $dc578a950a2bf23d$exports,
|
|
177
|
+
"nl-NL": $353f1bfca4dc395a$exports,
|
|
178
|
+
"pl-PL": $241bc0bbd870e982$exports,
|
|
179
|
+
"pt-BR": $da3005c7bd72b0a8$exports,
|
|
180
|
+
"pt-PT": $cf48bfc540882310$exports,
|
|
181
|
+
"ro-RO": $b63a28c481ab9ee3$exports,
|
|
182
|
+
"ru-RU": $19f9df95c2464ab6$exports,
|
|
183
|
+
"sk-SK": $b272932a685e8482$exports,
|
|
184
|
+
"sl-SI": $cbaf8b5b61f9e544$exports,
|
|
185
|
+
"sr-SP": $e0a3af6ac1449b2f$exports,
|
|
186
|
+
"sv-SE": $71e167d2458a6019$exports,
|
|
187
|
+
"tr-TR": $3719245abc082946$exports,
|
|
188
|
+
"uk-UA": $2ccc589e2f51824d$exports,
|
|
189
|
+
"zh-CN": $e1103cb9b4c13942$exports,
|
|
190
|
+
"zh-TW": $448607634f80dccb$exports
|
|
191
191
|
};
|
|
192
192
|
|
|
193
193
|
|
|
@@ -196,18 +196,18 @@ $2dbd11b99107b9a3$exports = {
|
|
|
196
196
|
|
|
197
197
|
|
|
198
198
|
|
|
199
|
-
function $
|
|
199
|
+
function $81397a9303501bda$export$23f548e970bdf099(props, state, inputRef) {
|
|
200
200
|
let { id: id , decrementAriaLabel: decrementAriaLabel , incrementAriaLabel: incrementAriaLabel , isDisabled: isDisabled , isReadOnly: isReadOnly , isRequired: isRequired , minValue: minValue , maxValue: maxValue , autoFocus: autoFocus , validationState: validationState , label: label , formatOptions: formatOptions , onBlur: onBlur , onFocus: onFocus , onFocusChange: onFocusChange , onKeyDown: onKeyDown , onKeyUp: onKeyUp , description: description , errorMessage: errorMessage } = props;
|
|
201
201
|
let { increment: increment , incrementToMax: incrementToMax , decrement: decrement , decrementToMin: decrementToMin , numberValue: numberValue , commit: commit } = state;
|
|
202
|
-
const formatMessage = $
|
|
203
|
-
let inputId = $
|
|
204
|
-
let { focusProps: focusProps } = $
|
|
202
|
+
const formatMessage = $gfhJl$useMessageFormatter((/*@__PURE__*/$parcel$interopDefault($c3ef0f8b54adbb57$exports)));
|
|
203
|
+
let inputId = $gfhJl$useId(id);
|
|
204
|
+
let { focusProps: focusProps } = $gfhJl$useFocus({
|
|
205
205
|
onBlur: ()=>{
|
|
206
206
|
// Set input value to normalized valid value
|
|
207
207
|
commit();
|
|
208
208
|
}
|
|
209
209
|
});
|
|
210
|
-
let { spinButtonProps: spinButtonProps , incrementButtonProps: incButtonProps , decrementButtonProps: decButtonProps } = $
|
|
210
|
+
let { spinButtonProps: spinButtonProps , incrementButtonProps: incButtonProps , decrementButtonProps: decButtonProps } = $gfhJl$useSpinButton({
|
|
211
211
|
isDisabled: isDisabled,
|
|
212
212
|
isReadOnly: isReadOnly,
|
|
213
213
|
isRequired: isRequired,
|
|
@@ -220,12 +220,12 @@ function $cf0c3bd5e1672ec9$export$23f548e970bdf099(props, state, inputRef) {
|
|
|
220
220
|
value: numberValue,
|
|
221
221
|
textValue: state.inputValue
|
|
222
222
|
});
|
|
223
|
-
let [focusWithin, setFocusWithin] = $
|
|
224
|
-
let { focusWithinProps: focusWithinProps } = $
|
|
223
|
+
let [focusWithin, setFocusWithin] = $gfhJl$useState(false);
|
|
224
|
+
let { focusWithinProps: focusWithinProps } = $gfhJl$useFocusWithin({
|
|
225
225
|
isDisabled: isDisabled,
|
|
226
226
|
onFocusWithinChange: setFocusWithin
|
|
227
227
|
});
|
|
228
|
-
let onWheel = $
|
|
228
|
+
let onWheel = $gfhJl$useCallback((e)=>{
|
|
229
229
|
// if on a trackpad, users can scroll in both X and Y at once, check the magnitude of the change
|
|
230
230
|
// if it's mostly in the X direction, then just return, the user probably doesn't mean to inc/dec
|
|
231
231
|
// this isn't perfect, events come in fast with small deltas and a part of the scroll may give a false indication
|
|
@@ -239,7 +239,7 @@ function $cf0c3bd5e1672ec9$export$23f548e970bdf099(props, state, inputRef) {
|
|
|
239
239
|
]);
|
|
240
240
|
// If the input isn't supposed to receive input, disable scrolling.
|
|
241
241
|
let scrollingDisabled = isDisabled || isReadOnly || !focusWithin;
|
|
242
|
-
$
|
|
242
|
+
$gfhJl$useScrollWheel({
|
|
243
243
|
onScroll: onWheel,
|
|
244
244
|
isDisabled: scrollingDisabled
|
|
245
245
|
}, inputRef);
|
|
@@ -247,21 +247,21 @@ function $cf0c3bd5e1672ec9$export$23f548e970bdf099(props, state, inputRef) {
|
|
|
247
247
|
// Browsers and operating systems are quite inconsistent about what keys are available, however.
|
|
248
248
|
// We choose between numeric and decimal based on whether we allow negative and fractional numbers,
|
|
249
249
|
// and based on testing on various devices to determine what keys are available in each inputMode.
|
|
250
|
-
let numberFormatter = $
|
|
251
|
-
let intlOptions = $
|
|
250
|
+
let numberFormatter = $gfhJl$useNumberFormatter(formatOptions);
|
|
251
|
+
let intlOptions = $gfhJl$useMemo(()=>numberFormatter.resolvedOptions()
|
|
252
252
|
, [
|
|
253
253
|
numberFormatter
|
|
254
254
|
]);
|
|
255
255
|
let hasDecimals = intlOptions.maximumFractionDigits > 0;
|
|
256
256
|
let hasNegative = isNaN(state.minValue) || state.minValue < 0;
|
|
257
257
|
let inputMode = 'numeric';
|
|
258
|
-
if ($
|
|
258
|
+
if ($gfhJl$isIPhone()) {
|
|
259
259
|
// iPhone doesn't have a minus sign in either numeric or decimal.
|
|
260
260
|
// Note this is only for iPhone, not iPad, which always has both
|
|
261
261
|
// minus and decimal in numeric.
|
|
262
262
|
if (hasNegative) inputMode = 'text';
|
|
263
263
|
else if (hasDecimals) inputMode = 'decimal';
|
|
264
|
-
} else if ($
|
|
264
|
+
} else if ($gfhJl$isAndroid()) {
|
|
265
265
|
// Android numeric has both a decimal point and minus key.
|
|
266
266
|
// decimal does not have a minus key.
|
|
267
267
|
if (hasNegative) inputMode = 'numeric';
|
|
@@ -270,8 +270,8 @@ function $cf0c3bd5e1672ec9$export$23f548e970bdf099(props, state, inputRef) {
|
|
|
270
270
|
let onChange = (value)=>{
|
|
271
271
|
state.setInputValue(value);
|
|
272
272
|
};
|
|
273
|
-
let domProps = $
|
|
274
|
-
let { labelProps: labelProps , inputProps: textFieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = $
|
|
273
|
+
let domProps = $gfhJl$filterDOMProps(props);
|
|
274
|
+
let { labelProps: labelProps , inputProps: textFieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = $gfhJl$useFormattedTextField({
|
|
275
275
|
...domProps,
|
|
276
276
|
label: label,
|
|
277
277
|
autoFocus: autoFocus,
|
|
@@ -295,11 +295,11 @@ function $cf0c3bd5e1672ec9$export$23f548e970bdf099(props, state, inputRef) {
|
|
|
295
295
|
description: description,
|
|
296
296
|
errorMessage: errorMessage
|
|
297
297
|
}, state, inputRef);
|
|
298
|
-
let inputProps = $
|
|
298
|
+
let inputProps = $gfhJl$mergeProps(spinButtonProps, textFieldProps, focusProps, {
|
|
299
299
|
// override the spinbutton role, we can't focus a spin button with VO
|
|
300
300
|
role: null,
|
|
301
301
|
// ignore aria-roledescription on iOS so that required state will announce when it is present
|
|
302
|
-
'aria-roledescription': !$
|
|
302
|
+
'aria-roledescription': !$gfhJl$isIOS() ? formatMessage('numberField') : null,
|
|
303
303
|
'aria-valuemax': null,
|
|
304
304
|
'aria-valuemin': null,
|
|
305
305
|
'aria-valuenow': null,
|
|
@@ -330,9 +330,9 @@ function $cf0c3bd5e1672ec9$export$23f548e970bdf099(props, state, inputRef) {
|
|
|
330
330
|
let fieldLabel = props['aria-label'] || (typeof props.label === 'string' ? props.label : '');
|
|
331
331
|
let ariaLabelledby;
|
|
332
332
|
if (!fieldLabel) ariaLabelledby = props.label != null ? labelProps.id : props['aria-labelledby'];
|
|
333
|
-
let incrementId = $
|
|
334
|
-
let decrementId = $
|
|
335
|
-
let incrementButtonProps = $
|
|
333
|
+
let incrementId = $gfhJl$useId();
|
|
334
|
+
let decrementId = $gfhJl$useId();
|
|
335
|
+
let incrementButtonProps = $gfhJl$mergeProps(incButtonProps, {
|
|
336
336
|
'aria-label': incrementAriaLabel || formatMessage('increase', {
|
|
337
337
|
fieldLabel: fieldLabel
|
|
338
338
|
}).trim(),
|
|
@@ -345,7 +345,7 @@ function $cf0c3bd5e1672ec9$export$23f548e970bdf099(props, state, inputRef) {
|
|
|
345
345
|
isDisabled: !state.canIncrement,
|
|
346
346
|
onPressStart: onButtonPressStart
|
|
347
347
|
});
|
|
348
|
-
let decrementButtonProps = $
|
|
348
|
+
let decrementButtonProps = $gfhJl$mergeProps(decButtonProps, {
|
|
349
349
|
'aria-label': decrementAriaLabel || formatMessage('decrease', {
|
|
350
350
|
fieldLabel: fieldLabel
|
|
351
351
|
}).trim(),
|
|
@@ -377,5 +377,5 @@ function $cf0c3bd5e1672ec9$export$23f548e970bdf099(props, state, inputRef) {
|
|
|
377
377
|
|
|
378
378
|
|
|
379
379
|
|
|
380
|
-
export {$
|
|
380
|
+
export {$81397a9303501bda$export$23f548e970bdf099 as useNumberField};
|
|
381
381
|
//# sourceMappingURL=module.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/numberfield",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.4",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -18,17 +18,17 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@babel/runtime": "^7.6.2",
|
|
21
|
-
"@react-aria/i18n": "^3.3.
|
|
22
|
-
"@react-aria/interactions": "^3.8.
|
|
23
|
-
"@react-aria/live-announcer": "^3.0.
|
|
24
|
-
"@react-aria/spinbutton": "^3.0.
|
|
25
|
-
"@react-aria/textfield": "^3.5.
|
|
26
|
-
"@react-aria/utils": "^3.11.
|
|
27
|
-
"@react-stately/numberfield": "^3.0.
|
|
28
|
-
"@react-types/button": "^3.4.
|
|
29
|
-
"@react-types/numberfield": "^3.1.
|
|
30
|
-
"@react-types/shared": "^3.11.
|
|
31
|
-
"@react-types/textfield": "^3.3.
|
|
21
|
+
"@react-aria/i18n": "^3.3.7",
|
|
22
|
+
"@react-aria/interactions": "^3.8.2",
|
|
23
|
+
"@react-aria/live-announcer": "^3.0.4",
|
|
24
|
+
"@react-aria/spinbutton": "^3.0.4",
|
|
25
|
+
"@react-aria/textfield": "^3.5.3",
|
|
26
|
+
"@react-aria/utils": "^3.11.3",
|
|
27
|
+
"@react-stately/numberfield": "^3.0.5",
|
|
28
|
+
"@react-types/button": "^3.4.4",
|
|
29
|
+
"@react-types/numberfield": "^3.1.3",
|
|
30
|
+
"@react-types/shared": "^3.11.2",
|
|
31
|
+
"@react-types/textfield": "^3.3.3"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"react": "^16.8.0 || ^17.0.0-rc.1",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "ed8d8d984c2f7f2c31e8b18795b97858a95e4729"
|
|
41
41
|
}
|