@equinor/roma-ui 0.2.0 → 0.2.1
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/number.js +1 -15
- package/number.mjs +335 -646
- package/package.json +1 -1
- package/select.js +2 -2
- package/switch.js +1 -1
package/number.mjs
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
let e = r, i = t.toString(), o = i.indexOf("."), a = o >= 0 ? i.length - o : 0;
|
|
1
|
+
import { jsx as fe } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as w, useContext as pe, createContext as be, useState as M, useRef as Z, useEffect as he, useCallback as ge, forwardRef as $e } from "react";
|
|
3
|
+
import { useNumberField as ye } from "react-aria";
|
|
4
|
+
import { Input as ve } from "@equinor/eds-core-react";
|
|
5
|
+
import { $ as Ne } from "./useControlledState-u436Wbp1.mjs";
|
|
6
|
+
function W(r, e = -1 / 0, t = 1 / 0) {
|
|
7
|
+
return Math.min(Math.max(r, e), t);
|
|
8
|
+
}
|
|
9
|
+
function j(r, e) {
|
|
10
|
+
let t = r, i = e.toString(), n = i.indexOf("."), a = n >= 0 ? i.length - n : 0;
|
|
12
11
|
if (a > 0) {
|
|
13
|
-
let
|
|
14
|
-
|
|
12
|
+
let l = Math.pow(10, a);
|
|
13
|
+
t = Math.round(t * l) / l;
|
|
15
14
|
}
|
|
16
|
-
return
|
|
15
|
+
return t;
|
|
17
16
|
}
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
let
|
|
21
|
-
return isNaN(
|
|
17
|
+
function F(r, e, t, i) {
|
|
18
|
+
e = Number(e), t = Number(t);
|
|
19
|
+
let n = (r - (isNaN(e) ? 0 : e)) % i, a = j(Math.abs(n) * 2 >= i ? r + Math.sign(n) * (i - Math.abs(n)) : r - n, i);
|
|
20
|
+
return isNaN(e) ? !isNaN(t) && a > t && (a = Math.floor(j(t / i, i)) * i) : a < e ? a = e : !isNaN(t) && a > t && (a = e + Math.floor(j((t - e) / i, i)) * i), a = j(a, i), a;
|
|
22
21
|
}
|
|
23
|
-
const
|
|
22
|
+
const ie = {
|
|
24
23
|
badInput: !1,
|
|
25
24
|
customError: !1,
|
|
26
25
|
patternMismatch: !1,
|
|
@@ -32,111 +31,111 @@ const Re = {
|
|
|
32
31
|
typeMismatch: !1,
|
|
33
32
|
valueMissing: !1,
|
|
34
33
|
valid: !0
|
|
35
|
-
},
|
|
36
|
-
...
|
|
34
|
+
}, re = {
|
|
35
|
+
...ie,
|
|
37
36
|
customError: !0,
|
|
38
37
|
valid: !1
|
|
39
|
-
},
|
|
38
|
+
}, T = {
|
|
40
39
|
isInvalid: !1,
|
|
41
|
-
validationDetails:
|
|
40
|
+
validationDetails: ie,
|
|
42
41
|
validationErrors: []
|
|
43
|
-
},
|
|
44
|
-
function
|
|
45
|
-
if (r[
|
|
46
|
-
let { realtimeValidation:
|
|
42
|
+
}, Ve = be({}), q = "__formValidationState" + Date.now();
|
|
43
|
+
function Se(r) {
|
|
44
|
+
if (r[q]) {
|
|
45
|
+
let { realtimeValidation: e, displayValidation: t, updateValidation: i, resetValidation: n, commitValidation: a } = r[q];
|
|
47
46
|
return {
|
|
48
|
-
realtimeValidation:
|
|
49
|
-
displayValidation:
|
|
47
|
+
realtimeValidation: e,
|
|
48
|
+
displayValidation: t,
|
|
50
49
|
updateValidation: i,
|
|
51
|
-
resetValidation:
|
|
50
|
+
resetValidation: n,
|
|
52
51
|
commitValidation: a
|
|
53
52
|
};
|
|
54
53
|
}
|
|
55
|
-
return
|
|
54
|
+
return De(r);
|
|
56
55
|
}
|
|
57
|
-
function
|
|
58
|
-
let { isInvalid:
|
|
59
|
-
|
|
60
|
-
let
|
|
61
|
-
isInvalid:
|
|
56
|
+
function De(r) {
|
|
57
|
+
let { isInvalid: e, validationState: t, name: i, value: n, builtinValidation: a, validate: l, validationBehavior: o = "aria" } = r;
|
|
58
|
+
t && (e || (e = t === "invalid"));
|
|
59
|
+
let m = e !== void 0 ? {
|
|
60
|
+
isInvalid: e,
|
|
62
61
|
validationErrors: [],
|
|
63
|
-
validationDetails:
|
|
64
|
-
} : null,
|
|
65
|
-
if (!
|
|
66
|
-
let
|
|
67
|
-
return
|
|
62
|
+
validationDetails: re
|
|
63
|
+
} : null, N = w(() => {
|
|
64
|
+
if (!l || n == null) return null;
|
|
65
|
+
let s = we(l, n);
|
|
66
|
+
return J(s);
|
|
68
67
|
}, [
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
l,
|
|
69
|
+
n
|
|
71
70
|
]);
|
|
72
71
|
a != null && a.validationDetails.valid && (a = void 0);
|
|
73
|
-
let
|
|
74
|
-
|
|
72
|
+
let b = pe(Ve), d = w(() => i ? Array.isArray(i) ? i.flatMap((s) => B(b[s])) : B(b[i]) : [], [
|
|
73
|
+
b,
|
|
75
74
|
i
|
|
76
|
-
]), [
|
|
77
|
-
|
|
78
|
-
let
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
]),
|
|
82
|
-
if (!
|
|
83
|
-
|
|
84
|
-
let
|
|
85
|
-
|
|
86
|
-
}, [
|
|
87
|
-
return
|
|
88
|
-
realtimeValidation:
|
|
89
|
-
displayValidation:
|
|
90
|
-
updateValidation(
|
|
91
|
-
|
|
75
|
+
]), [h, g] = M(b), [f, p] = M(!1);
|
|
76
|
+
b !== h && (g(b), p(!1));
|
|
77
|
+
let S = w(() => J(f ? [] : d), [
|
|
78
|
+
f,
|
|
79
|
+
d
|
|
80
|
+
]), D = Z(T), [x, $] = M(T), y = Z(T), c = () => {
|
|
81
|
+
if (!P) return;
|
|
82
|
+
V(!1);
|
|
83
|
+
let s = N || a || D.current;
|
|
84
|
+
_(s, y.current) || (y.current = s, $(s));
|
|
85
|
+
}, [P, V] = M(!1);
|
|
86
|
+
return he(c), {
|
|
87
|
+
realtimeValidation: m || S || N || a || T,
|
|
88
|
+
displayValidation: o === "native" ? m || S || x : m || S || N || a || x,
|
|
89
|
+
updateValidation(s) {
|
|
90
|
+
o === "aria" && !_(x, s) ? $(s) : D.current = s;
|
|
92
91
|
},
|
|
93
92
|
resetValidation() {
|
|
94
|
-
let
|
|
95
|
-
|
|
93
|
+
let s = T;
|
|
94
|
+
_(s, y.current) || (y.current = s, $(s)), o === "native" && V(!1), p(!0);
|
|
96
95
|
},
|
|
97
96
|
commitValidation() {
|
|
98
|
-
|
|
97
|
+
o === "native" && V(!0), p(!0);
|
|
99
98
|
}
|
|
100
99
|
};
|
|
101
100
|
}
|
|
102
|
-
function
|
|
101
|
+
function B(r) {
|
|
103
102
|
return r ? Array.isArray(r) ? r : [
|
|
104
103
|
r
|
|
105
104
|
] : [];
|
|
106
105
|
}
|
|
107
|
-
function
|
|
106
|
+
function we(r, e) {
|
|
108
107
|
if (typeof r == "function") {
|
|
109
|
-
let
|
|
110
|
-
if (
|
|
108
|
+
let t = r(e);
|
|
109
|
+
if (t && typeof t != "boolean") return B(t);
|
|
111
110
|
}
|
|
112
111
|
return [];
|
|
113
112
|
}
|
|
114
|
-
function
|
|
113
|
+
function J(r) {
|
|
115
114
|
return r.length ? {
|
|
116
115
|
isInvalid: !0,
|
|
117
116
|
validationErrors: r,
|
|
118
|
-
validationDetails:
|
|
117
|
+
validationDetails: re
|
|
119
118
|
} : null;
|
|
120
119
|
}
|
|
121
|
-
function
|
|
122
|
-
return r ===
|
|
120
|
+
function _(r, e) {
|
|
121
|
+
return r === e ? !0 : !!r && !!e && r.isInvalid === e.isInvalid && r.validationErrors.length === e.validationErrors.length && r.validationErrors.every((t, i) => t === e.validationErrors[i]) && Object.entries(r.validationDetails).every(([t, i]) => e.validationDetails[t] === i);
|
|
123
122
|
}
|
|
124
|
-
let
|
|
123
|
+
let z = /* @__PURE__ */ new Map(), K = !1;
|
|
125
124
|
try {
|
|
126
|
-
|
|
125
|
+
K = new Intl.NumberFormat("de-DE", {
|
|
127
126
|
signDisplay: "exceptZero"
|
|
128
127
|
}).resolvedOptions().signDisplay === "exceptZero";
|
|
129
128
|
} catch {
|
|
130
129
|
}
|
|
131
|
-
let
|
|
130
|
+
let L = !1;
|
|
132
131
|
try {
|
|
133
|
-
|
|
132
|
+
L = new Intl.NumberFormat("de-DE", {
|
|
134
133
|
style: "unit",
|
|
135
134
|
unit: "degree"
|
|
136
135
|
}).resolvedOptions().style === "unit";
|
|
137
136
|
} catch {
|
|
138
137
|
}
|
|
139
|
-
const
|
|
138
|
+
const ae = {
|
|
140
139
|
degree: {
|
|
141
140
|
narrow: {
|
|
142
141
|
default: "°",
|
|
@@ -146,34 +145,34 @@ const Ve = {
|
|
|
146
145
|
}
|
|
147
146
|
}
|
|
148
147
|
};
|
|
149
|
-
class
|
|
148
|
+
class Y {
|
|
150
149
|
/** Formats a number value as a string, according to the locale and options provided to the constructor. */
|
|
151
|
-
format(
|
|
152
|
-
let
|
|
153
|
-
if (!
|
|
150
|
+
format(e) {
|
|
151
|
+
let t = "";
|
|
152
|
+
if (!K && this.options.signDisplay != null ? t = Pe(this.numberFormatter, this.options.signDisplay, e) : t = this.numberFormatter.format(e), this.options.style === "unit" && !L) {
|
|
154
153
|
var i;
|
|
155
|
-
let { unit:
|
|
156
|
-
if (!
|
|
157
|
-
let
|
|
158
|
-
|
|
154
|
+
let { unit: n, unitDisplay: a = "short", locale: l } = this.resolvedOptions();
|
|
155
|
+
if (!n) return t;
|
|
156
|
+
let o = (i = ae[n]) === null || i === void 0 ? void 0 : i[a];
|
|
157
|
+
t += o[l] || o.default;
|
|
159
158
|
}
|
|
160
|
-
return
|
|
159
|
+
return t;
|
|
161
160
|
}
|
|
162
161
|
/** Formats a number to an array of parts such as separators, digits, punctuation, and more. */
|
|
163
|
-
formatToParts(
|
|
164
|
-
return this.numberFormatter.formatToParts(
|
|
162
|
+
formatToParts(e) {
|
|
163
|
+
return this.numberFormatter.formatToParts(e);
|
|
165
164
|
}
|
|
166
165
|
/** Formats a number range as a string. */
|
|
167
|
-
formatRange(
|
|
168
|
-
if (typeof this.numberFormatter.formatRange == "function") return this.numberFormatter.formatRange(
|
|
169
|
-
if (
|
|
170
|
-
return `${this.format(
|
|
166
|
+
formatRange(e, t) {
|
|
167
|
+
if (typeof this.numberFormatter.formatRange == "function") return this.numberFormatter.formatRange(e, t);
|
|
168
|
+
if (t < e) throw new RangeError("End date must be >= start date");
|
|
169
|
+
return `${this.format(e)} – ${this.format(t)}`;
|
|
171
170
|
}
|
|
172
171
|
/** Formats a number range as an array of parts. */
|
|
173
|
-
formatRangeToParts(
|
|
174
|
-
if (typeof this.numberFormatter.formatRangeToParts == "function") return this.numberFormatter.formatRangeToParts(
|
|
175
|
-
if (
|
|
176
|
-
let i = this.numberFormatter.formatToParts(
|
|
172
|
+
formatRangeToParts(e, t) {
|
|
173
|
+
if (typeof this.numberFormatter.formatRangeToParts == "function") return this.numberFormatter.formatRangeToParts(e, t);
|
|
174
|
+
if (t < e) throw new RangeError("End date must be >= start date");
|
|
175
|
+
let i = this.numberFormatter.formatToParts(e), n = this.numberFormatter.formatToParts(t);
|
|
177
176
|
return [
|
|
178
177
|
...i.map((a) => ({
|
|
179
178
|
...a,
|
|
@@ -184,7 +183,7 @@ class me {
|
|
|
184
183
|
value: " – ",
|
|
185
184
|
source: "shared"
|
|
186
185
|
},
|
|
187
|
-
...
|
|
186
|
+
...n.map((a) => ({
|
|
188
187
|
...a,
|
|
189
188
|
source: "endRange"
|
|
190
189
|
}))
|
|
@@ -192,143 +191,143 @@ class me {
|
|
|
192
191
|
}
|
|
193
192
|
/** Returns the resolved formatting options based on the values passed to the constructor. */
|
|
194
193
|
resolvedOptions() {
|
|
195
|
-
let
|
|
196
|
-
return !
|
|
197
|
-
...
|
|
194
|
+
let e = this.numberFormatter.resolvedOptions();
|
|
195
|
+
return !K && this.options.signDisplay != null && (e = {
|
|
196
|
+
...e,
|
|
198
197
|
signDisplay: this.options.signDisplay
|
|
199
|
-
}), !
|
|
200
|
-
...
|
|
198
|
+
}), !L && this.options.style === "unit" && (e = {
|
|
199
|
+
...e,
|
|
201
200
|
style: "unit",
|
|
202
201
|
unit: this.options.unit,
|
|
203
202
|
unitDisplay: this.options.unitDisplay
|
|
204
|
-
}),
|
|
203
|
+
}), e;
|
|
205
204
|
}
|
|
206
|
-
constructor(
|
|
207
|
-
this.numberFormatter =
|
|
205
|
+
constructor(e, t = {}) {
|
|
206
|
+
this.numberFormatter = xe(e, t), this.options = t;
|
|
208
207
|
}
|
|
209
208
|
}
|
|
210
|
-
function
|
|
211
|
-
let { numberingSystem:
|
|
212
|
-
if (
|
|
209
|
+
function xe(r, e = {}) {
|
|
210
|
+
let { numberingSystem: t } = e;
|
|
211
|
+
if (t && r.includes("-nu-") && (r.includes("-u-") || (r += "-u-"), r += `-nu-${t}`), e.style === "unit" && !L) {
|
|
213
212
|
var i;
|
|
214
|
-
let { unit:
|
|
215
|
-
if (!
|
|
216
|
-
if (!(!((i =
|
|
217
|
-
|
|
218
|
-
...
|
|
213
|
+
let { unit: l, unitDisplay: o = "short" } = e;
|
|
214
|
+
if (!l) throw new Error('unit option must be provided with style: "unit"');
|
|
215
|
+
if (!(!((i = ae[l]) === null || i === void 0) && i[o])) throw new Error(`Unsupported unit ${l} with unitDisplay = ${o}`);
|
|
216
|
+
e = {
|
|
217
|
+
...e,
|
|
219
218
|
style: "decimal"
|
|
220
219
|
};
|
|
221
220
|
}
|
|
222
|
-
let
|
|
223
|
-
if (
|
|
224
|
-
let a = new Intl.NumberFormat(r,
|
|
225
|
-
return
|
|
226
|
-
}
|
|
227
|
-
function
|
|
228
|
-
if (
|
|
229
|
-
if (
|
|
221
|
+
let n = r + (e ? Object.entries(e).sort((l, o) => l[0] < o[0] ? -1 : 1).join() : "");
|
|
222
|
+
if (z.has(n)) return z.get(n);
|
|
223
|
+
let a = new Intl.NumberFormat(r, e);
|
|
224
|
+
return z.set(n, a), a;
|
|
225
|
+
}
|
|
226
|
+
function Pe(r, e, t) {
|
|
227
|
+
if (e === "auto") return r.format(t);
|
|
228
|
+
if (e === "never") return r.format(Math.abs(t));
|
|
230
229
|
{
|
|
231
230
|
let i = !1;
|
|
232
|
-
if (
|
|
233
|
-
let
|
|
231
|
+
if (e === "always" ? i = t > 0 || Object.is(t, 0) : e === "exceptZero" && (Object.is(t, -0) || Object.is(t, 0) ? t = Math.abs(t) : i = t > 0), i) {
|
|
232
|
+
let n = r.format(-t), a = r.format(t), l = n.replace(a, "").replace(/\u200e|\u061C/, "");
|
|
234
233
|
return [
|
|
235
|
-
...
|
|
236
|
-
].length !== 1 && console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"),
|
|
237
|
-
} else return r.format(
|
|
234
|
+
...l
|
|
235
|
+
].length !== 1 && console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"), n.replace(a, "!!!").replace(l, "+").replace("!!!", a);
|
|
236
|
+
} else return r.format(t);
|
|
238
237
|
}
|
|
239
238
|
}
|
|
240
|
-
const
|
|
239
|
+
const Ee = new RegExp("^.*\\(.*\\).*$"), Fe = [
|
|
241
240
|
"latn",
|
|
242
241
|
"arab",
|
|
243
242
|
"hanidec",
|
|
244
243
|
"deva",
|
|
245
244
|
"beng"
|
|
246
245
|
];
|
|
247
|
-
class
|
|
246
|
+
class ne {
|
|
248
247
|
/**
|
|
249
248
|
* Parses the given string to a number. Returns NaN if a valid number could not be parsed.
|
|
250
249
|
*/
|
|
251
|
-
parse(
|
|
252
|
-
return
|
|
250
|
+
parse(e) {
|
|
251
|
+
return G(this.locale, this.options, e).parse(e);
|
|
253
252
|
}
|
|
254
253
|
/**
|
|
255
254
|
* Returns whether the given string could potentially be a valid number. This should be used to
|
|
256
255
|
* validate user input as the user types. If a `minValue` or `maxValue` is provided, the validity
|
|
257
256
|
* of the minus/plus sign characters can be checked.
|
|
258
257
|
*/
|
|
259
|
-
isValidPartialNumber(
|
|
260
|
-
return
|
|
258
|
+
isValidPartialNumber(e, t, i) {
|
|
259
|
+
return G(this.locale, this.options, e).isValidPartialNumber(e, t, i);
|
|
261
260
|
}
|
|
262
261
|
/**
|
|
263
262
|
* Returns a numbering system for which the given string is valid in the current locale.
|
|
264
263
|
* If no numbering system could be detected, the default numbering system for the current
|
|
265
264
|
* locale is returned.
|
|
266
265
|
*/
|
|
267
|
-
getNumberingSystem(
|
|
268
|
-
return
|
|
266
|
+
getNumberingSystem(e) {
|
|
267
|
+
return G(this.locale, this.options, e).options.numberingSystem;
|
|
269
268
|
}
|
|
270
|
-
constructor(
|
|
271
|
-
this.locale =
|
|
269
|
+
constructor(e, t = {}) {
|
|
270
|
+
this.locale = e, this.options = t;
|
|
272
271
|
}
|
|
273
272
|
}
|
|
274
|
-
const
|
|
275
|
-
function
|
|
276
|
-
let i =
|
|
277
|
-
if (!r.includes("-nu-") && !i.isValidPartialNumber(
|
|
278
|
-
for (let
|
|
279
|
-
let a =
|
|
280
|
-
if (a.isValidPartialNumber(
|
|
273
|
+
const X = /* @__PURE__ */ new Map();
|
|
274
|
+
function G(r, e, t) {
|
|
275
|
+
let i = H(r, e);
|
|
276
|
+
if (!r.includes("-nu-") && !i.isValidPartialNumber(t)) {
|
|
277
|
+
for (let n of Fe) if (n !== i.options.numberingSystem) {
|
|
278
|
+
let a = H(r + (r.includes("-u-") ? "-nu-" : "-u-nu-") + n, e);
|
|
279
|
+
if (a.isValidPartialNumber(t)) return a;
|
|
281
280
|
}
|
|
282
281
|
}
|
|
283
282
|
return i;
|
|
284
283
|
}
|
|
285
|
-
function
|
|
286
|
-
let
|
|
287
|
-
return i || (i = new
|
|
288
|
-
}
|
|
289
|
-
class
|
|
290
|
-
parse(
|
|
291
|
-
let
|
|
292
|
-
if (this.symbols.group && (
|
|
293
|
-
let
|
|
294
|
-
|
|
295
|
-
let
|
|
296
|
-
|
|
284
|
+
function H(r, e) {
|
|
285
|
+
let t = r + (e ? Object.entries(e).sort((n, a) => n[0] < a[0] ? -1 : 1).join() : ""), i = X.get(t);
|
|
286
|
+
return i || (i = new Me(r, e), X.set(t, i)), i;
|
|
287
|
+
}
|
|
288
|
+
class Me {
|
|
289
|
+
parse(e) {
|
|
290
|
+
let t = this.sanitize(e);
|
|
291
|
+
if (this.symbols.group && (t = A(t, this.symbols.group, "")), this.symbols.decimal && (t = t.replace(this.symbols.decimal, ".")), this.symbols.minusSign && (t = t.replace(this.symbols.minusSign, "-")), t = t.replace(this.symbols.numeral, this.symbols.index), this.options.style === "percent") {
|
|
292
|
+
let l = t.indexOf("-");
|
|
293
|
+
t = t.replace("-", ""), t = t.replace("+", "");
|
|
294
|
+
let o = t.indexOf(".");
|
|
295
|
+
o === -1 && (o = t.length), t = t.replace(".", ""), o - 2 === 0 ? t = `0.${t}` : o - 2 === -1 ? t = `0.0${t}` : o - 2 === -2 ? t = "0.00" : t = `${t.slice(0, o - 2)}.${t.slice(o - 2)}`, l > -1 && (t = `-${t}`);
|
|
297
296
|
}
|
|
298
|
-
let i =
|
|
297
|
+
let i = t ? +t : NaN;
|
|
299
298
|
if (isNaN(i)) return NaN;
|
|
300
299
|
if (this.options.style === "percent") {
|
|
301
|
-
var
|
|
302
|
-
let
|
|
300
|
+
var n, a;
|
|
301
|
+
let l = {
|
|
303
302
|
...this.options,
|
|
304
303
|
style: "decimal",
|
|
305
|
-
minimumFractionDigits: Math.min(((
|
|
304
|
+
minimumFractionDigits: Math.min(((n = this.options.minimumFractionDigits) !== null && n !== void 0 ? n : 0) + 2, 20),
|
|
306
305
|
maximumFractionDigits: Math.min(((a = this.options.maximumFractionDigits) !== null && a !== void 0 ? a : 0) + 2, 20)
|
|
307
306
|
};
|
|
308
|
-
return new
|
|
307
|
+
return new ne(this.locale, l).parse(new Y(this.locale, l).format(i));
|
|
309
308
|
}
|
|
310
|
-
return this.options.currencySign === "accounting" &&
|
|
309
|
+
return this.options.currencySign === "accounting" && Ee.test(e) && (i = -1 * i), i;
|
|
311
310
|
}
|
|
312
|
-
sanitize(
|
|
313
|
-
return
|
|
311
|
+
sanitize(e) {
|
|
312
|
+
return e = e.replace(this.symbols.literals, ""), this.symbols.minusSign && (e = e.replace("-", this.symbols.minusSign)), this.options.numberingSystem === "arab" && (this.symbols.decimal && (e = e.replace(",", this.symbols.decimal), e = e.replace("،", this.symbols.decimal)), this.symbols.group && (e = A(e, ".", this.symbols.group))), this.options.locale === "fr-FR" && this.symbols.group && (e = A(e, " ", this.symbols.group), e = A(e, /\u00A0/g, this.symbols.group)), e;
|
|
314
313
|
}
|
|
315
|
-
isValidPartialNumber(
|
|
316
|
-
return
|
|
314
|
+
isValidPartialNumber(e, t = -1 / 0, i = 1 / 0) {
|
|
315
|
+
return e = this.sanitize(e), this.symbols.minusSign && e.startsWith(this.symbols.minusSign) && t < 0 ? e = e.slice(this.symbols.minusSign.length) : this.symbols.plusSign && e.startsWith(this.symbols.plusSign) && i > 0 && (e = e.slice(this.symbols.plusSign.length)), this.symbols.group && e.startsWith(this.symbols.group) || this.symbols.decimal && e.indexOf(this.symbols.decimal) > -1 && this.options.maximumFractionDigits === 0 ? !1 : (this.symbols.group && (e = A(e, this.symbols.group, "")), e = e.replace(this.symbols.numeral, ""), this.symbols.decimal && (e = e.replace(this.symbols.decimal, "")), e.length === 0);
|
|
317
316
|
}
|
|
318
|
-
constructor(
|
|
319
|
-
this.locale =
|
|
320
|
-
var i,
|
|
321
|
-
this.options.style === "percent" && (((i = this.options.minimumFractionDigits) !== null && i !== void 0 ? i : 0) > 18 || ((
|
|
317
|
+
constructor(e, t = {}) {
|
|
318
|
+
this.locale = e, t.roundingIncrement !== 1 && t.roundingIncrement != null && (t.maximumFractionDigits == null && t.minimumFractionDigits == null ? (t.maximumFractionDigits = 0, t.minimumFractionDigits = 0) : t.maximumFractionDigits == null ? t.maximumFractionDigits = t.minimumFractionDigits : t.minimumFractionDigits == null && (t.minimumFractionDigits = t.maximumFractionDigits)), this.formatter = new Intl.NumberFormat(e, t), this.options = this.formatter.resolvedOptions(), this.symbols = Re(e, this.formatter, this.options, t);
|
|
319
|
+
var i, n;
|
|
320
|
+
this.options.style === "percent" && (((i = this.options.minimumFractionDigits) !== null && i !== void 0 ? i : 0) > 18 || ((n = this.options.maximumFractionDigits) !== null && n !== void 0 ? n : 0) > 18) && console.warn("NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.");
|
|
322
321
|
}
|
|
323
322
|
}
|
|
324
|
-
const
|
|
323
|
+
const ee = /* @__PURE__ */ new Set([
|
|
325
324
|
"decimal",
|
|
326
325
|
"fraction",
|
|
327
326
|
"integer",
|
|
328
327
|
"minusSign",
|
|
329
328
|
"plusSign",
|
|
330
329
|
"group"
|
|
331
|
-
]),
|
|
330
|
+
]), Ie = [
|
|
332
331
|
0,
|
|
333
332
|
4,
|
|
334
333
|
2,
|
|
@@ -342,534 +341,224 @@ const Ne = /* @__PURE__ */ new Set([
|
|
|
342
341
|
0.1,
|
|
343
342
|
1.1
|
|
344
343
|
];
|
|
345
|
-
function
|
|
346
|
-
var
|
|
347
|
-
let
|
|
348
|
-
...
|
|
344
|
+
function Re(r, e, t, i) {
|
|
345
|
+
var n, a, l, o;
|
|
346
|
+
let m = new Intl.NumberFormat(r, {
|
|
347
|
+
...t,
|
|
349
348
|
// Resets so we get the full range of symbols
|
|
350
349
|
minimumSignificantDigits: 1,
|
|
351
350
|
maximumSignificantDigits: 21,
|
|
352
351
|
roundingIncrement: 1,
|
|
353
352
|
roundingPriority: "auto",
|
|
354
353
|
roundingMode: "halfExpand"
|
|
355
|
-
}),
|
|
356
|
-
var
|
|
357
|
-
let
|
|
358
|
-
!
|
|
359
|
-
let
|
|
360
|
-
...
|
|
354
|
+
}), N = m.formatToParts(-10000.111), b = m.formatToParts(10000.111), d = Ie.map((s) => m.formatToParts(s));
|
|
355
|
+
var h;
|
|
356
|
+
let g = (h = (n = N.find((s) => s.type === "minusSign")) === null || n === void 0 ? void 0 : n.value) !== null && h !== void 0 ? h : "-", f = (a = b.find((s) => s.type === "plusSign")) === null || a === void 0 ? void 0 : a.value;
|
|
357
|
+
!f && ((i == null ? void 0 : i.signDisplay) === "exceptZero" || (i == null ? void 0 : i.signDisplay) === "always") && (f = "+");
|
|
358
|
+
let S = (l = new Intl.NumberFormat(r, {
|
|
359
|
+
...t,
|
|
361
360
|
minimumFractionDigits: 2,
|
|
362
361
|
maximumFractionDigits: 2
|
|
363
|
-
}).formatToParts(1e-3).find((
|
|
362
|
+
}).formatToParts(1e-3).find((s) => s.type === "decimal")) === null || l === void 0 ? void 0 : l.value, D = (o = N.find((s) => s.type === "group")) === null || o === void 0 ? void 0 : o.value, x = N.filter((s) => !ee.has(s.type)).map((s) => te(s.value)), $ = d.flatMap((s) => s.filter((E) => !ee.has(E.type)).map((E) => te(E.value))), y = [
|
|
364
363
|
.../* @__PURE__ */ new Set([
|
|
365
364
|
...x,
|
|
366
|
-
|
|
365
|
+
...$
|
|
367
366
|
])
|
|
368
|
-
].sort((
|
|
369
|
-
...new Intl.NumberFormat(
|
|
367
|
+
].sort((s, E) => E.length - s.length), c = y.length === 0 ? new RegExp("[\\p{White_Space}]", "gu") : new RegExp(`${y.join("|")}|[\\p{White_Space}]`, "gu"), P = [
|
|
368
|
+
...new Intl.NumberFormat(t.locale, {
|
|
370
369
|
useGrouping: !1
|
|
371
370
|
}).format(9876543210)
|
|
372
|
-
].reverse(),
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
])),
|
|
371
|
+
].reverse(), V = new Map(P.map((s, E) => [
|
|
372
|
+
s,
|
|
373
|
+
E
|
|
374
|
+
])), I = new RegExp(`[${P.join("")}]`, "g");
|
|
376
375
|
return {
|
|
377
|
-
minusSign:
|
|
378
|
-
plusSign:
|
|
379
|
-
decimal:
|
|
380
|
-
group:
|
|
381
|
-
literals:
|
|
382
|
-
numeral:
|
|
383
|
-
index: (
|
|
376
|
+
minusSign: g,
|
|
377
|
+
plusSign: f,
|
|
378
|
+
decimal: S,
|
|
379
|
+
group: D,
|
|
380
|
+
literals: c,
|
|
381
|
+
numeral: I,
|
|
382
|
+
index: (s) => String(V.get(s))
|
|
384
383
|
};
|
|
385
384
|
}
|
|
386
|
-
function
|
|
387
|
-
return r.replaceAll ? r.replaceAll(
|
|
385
|
+
function A(r, e, t) {
|
|
386
|
+
return r.replaceAll ? r.replaceAll(e, t) : r.split(e).join(t);
|
|
388
387
|
}
|
|
389
|
-
function
|
|
388
|
+
function te(r) {
|
|
390
389
|
return r.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
391
390
|
}
|
|
392
|
-
function
|
|
393
|
-
let { minValue:
|
|
394
|
-
a === null && (a = NaN), a !== void 0 && !isNaN(a) && (i !== void 0 && !isNaN(i) ? a =
|
|
395
|
-
let [
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
]),
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
]),
|
|
402
|
-
...
|
|
403
|
-
numberingSystem:
|
|
391
|
+
function Ce(r) {
|
|
392
|
+
let { minValue: e, maxValue: t, step: i, formatOptions: n, value: a, defaultValue: l = NaN, onChange: o, locale: m, isDisabled: N, isReadOnly: b } = r;
|
|
393
|
+
a === null && (a = NaN), a !== void 0 && !isNaN(a) && (i !== void 0 && !isNaN(i) ? a = F(a, e, t, i) : a = W(a, e, t)), isNaN(l) || (i !== void 0 && !isNaN(i) ? l = F(l, e, t, i) : l = W(l, e, t));
|
|
394
|
+
let [d, h] = Ne(a, isNaN(l) ? NaN : l, o), [g, f] = M(() => isNaN(d) ? "" : new Y(m, n).format(d)), p = w(() => new ne(m, n), [
|
|
395
|
+
m,
|
|
396
|
+
n
|
|
397
|
+
]), S = w(() => p.getNumberingSystem(g), [
|
|
398
|
+
p,
|
|
399
|
+
g
|
|
400
|
+
]), D = w(() => new Y(m, {
|
|
401
|
+
...n,
|
|
402
|
+
numberingSystem: S
|
|
404
403
|
}), [
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
]), x =
|
|
409
|
-
|
|
410
|
-
]),
|
|
411
|
-
|
|
412
|
-
]),
|
|
404
|
+
m,
|
|
405
|
+
n,
|
|
406
|
+
S
|
|
407
|
+
]), x = w(() => D.resolvedOptions(), [
|
|
408
|
+
D
|
|
409
|
+
]), $ = ge((u) => isNaN(u) || u === null ? "" : D.format(u), [
|
|
410
|
+
D
|
|
411
|
+
]), y = Se({
|
|
413
412
|
...r,
|
|
414
|
-
value:
|
|
415
|
-
}),
|
|
416
|
-
x.style === "percent" && (i === void 0 || isNaN(i)) && (
|
|
417
|
-
let [
|
|
418
|
-
(!Object.is(
|
|
419
|
-
let
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
]),
|
|
423
|
-
if (!
|
|
424
|
-
|
|
413
|
+
value: d
|
|
414
|
+
}), c = i !== void 0 && !isNaN(i) ? i : 1;
|
|
415
|
+
x.style === "percent" && (i === void 0 || isNaN(i)) && (c = 0.01);
|
|
416
|
+
let [P, V] = M(d), [I, R] = M(m), [s, E] = M(n);
|
|
417
|
+
(!Object.is(d, P) || m !== I || n !== s) && (f($(d)), V(d), R(m), E(n));
|
|
418
|
+
let v = w(() => p.parse(g), [
|
|
419
|
+
p,
|
|
420
|
+
g
|
|
421
|
+
]), se = () => {
|
|
422
|
+
if (!g.length) {
|
|
423
|
+
h(NaN), f(a === void 0 ? "" : $(d));
|
|
425
424
|
return;
|
|
426
425
|
}
|
|
427
|
-
if (isNaN(
|
|
428
|
-
|
|
426
|
+
if (isNaN(v)) {
|
|
427
|
+
f($(d));
|
|
429
428
|
return;
|
|
430
429
|
}
|
|
431
|
-
let
|
|
432
|
-
i === void 0 || isNaN(i) ?
|
|
433
|
-
},
|
|
434
|
-
let
|
|
435
|
-
if (isNaN(
|
|
436
|
-
let
|
|
437
|
-
return
|
|
430
|
+
let u;
|
|
431
|
+
i === void 0 || isNaN(i) ? u = W(v, e, t) : u = F(v, e, t, i), u = p.parse($(u)), h(u), f($(a === void 0 ? u : d));
|
|
432
|
+
}, k = (u, Q = 0) => {
|
|
433
|
+
let C = v;
|
|
434
|
+
if (isNaN(C)) {
|
|
435
|
+
let O = isNaN(Q) ? 0 : Q;
|
|
436
|
+
return F(O, e, t, c);
|
|
438
437
|
} else {
|
|
439
|
-
let
|
|
440
|
-
return
|
|
438
|
+
let O = F(C, e, t, c);
|
|
439
|
+
return u === "+" && O > C || u === "-" && O < C ? O : F(U(u, C, c), e, t, c);
|
|
441
440
|
}
|
|
442
|
-
},
|
|
443
|
-
let
|
|
444
|
-
|
|
445
|
-
},
|
|
446
|
-
let
|
|
447
|
-
|
|
448
|
-
},
|
|
449
|
-
|
|
450
|
-
},
|
|
451
|
-
|
|
452
|
-
},
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
t,
|
|
441
|
+
}, le = () => {
|
|
442
|
+
let u = k("+", e);
|
|
443
|
+
u === d && f($(u)), h(u), y.commitValidation();
|
|
444
|
+
}, oe = () => {
|
|
445
|
+
let u = k("-", t);
|
|
446
|
+
u === d && f($(u)), h(u), y.commitValidation();
|
|
447
|
+
}, ue = () => {
|
|
448
|
+
t != null && (h(F(t, e, t, c)), y.commitValidation());
|
|
449
|
+
}, me = () => {
|
|
450
|
+
e != null && (h(e), y.commitValidation());
|
|
451
|
+
}, ce = w(() => !N && !b && (isNaN(v) || t === void 0 || isNaN(t) || F(v, e, t, c) > v || U("+", v, c) <= t), [
|
|
452
|
+
N,
|
|
453
|
+
b,
|
|
456
454
|
e,
|
|
457
|
-
n,
|
|
458
|
-
w
|
|
459
|
-
]), U = V(() => !g && !$ && (isNaN(w) || t === void 0 || isNaN(t) || D(w, t, e, n) < w || se("-", w, n) >= t), [
|
|
460
|
-
g,
|
|
461
|
-
$,
|
|
462
455
|
t,
|
|
456
|
+
c,
|
|
457
|
+
v
|
|
458
|
+
]), de = w(() => !N && !b && (isNaN(v) || e === void 0 || isNaN(e) || F(v, e, t, c) < v || U("-", v, c) >= e), [
|
|
459
|
+
N,
|
|
460
|
+
b,
|
|
463
461
|
e,
|
|
464
|
-
|
|
465
|
-
|
|
462
|
+
t,
|
|
463
|
+
c,
|
|
464
|
+
v
|
|
466
465
|
]);
|
|
467
466
|
return {
|
|
468
|
-
...
|
|
469
|
-
validate: (
|
|
470
|
-
increment:
|
|
471
|
-
incrementToMax:
|
|
472
|
-
decrement:
|
|
473
|
-
decrementToMin:
|
|
474
|
-
canIncrement:
|
|
475
|
-
canDecrement:
|
|
476
|
-
minValue:
|
|
477
|
-
maxValue:
|
|
478
|
-
numberValue:
|
|
479
|
-
setNumberValue:
|
|
480
|
-
setInputValue:
|
|
481
|
-
inputValue:
|
|
482
|
-
commit:
|
|
467
|
+
...y,
|
|
468
|
+
validate: (u) => p.isValidPartialNumber(u, e, t),
|
|
469
|
+
increment: le,
|
|
470
|
+
incrementToMax: ue,
|
|
471
|
+
decrement: oe,
|
|
472
|
+
decrementToMin: me,
|
|
473
|
+
canIncrement: ce,
|
|
474
|
+
canDecrement: de,
|
|
475
|
+
minValue: e,
|
|
476
|
+
maxValue: t,
|
|
477
|
+
numberValue: v,
|
|
478
|
+
setNumberValue: h,
|
|
479
|
+
setInputValue: f,
|
|
480
|
+
inputValue: g,
|
|
481
|
+
commit: se
|
|
483
482
|
};
|
|
484
483
|
}
|
|
485
|
-
function
|
|
486
|
-
let i = r === "+" ?
|
|
487
|
-
if (
|
|
488
|
-
const
|
|
489
|
-
|
|
484
|
+
function U(r, e, t) {
|
|
485
|
+
let i = r === "+" ? e + t : e - t;
|
|
486
|
+
if (e % 1 !== 0 || t % 1 !== 0) {
|
|
487
|
+
const n = e.toString().split("."), a = t.toString().split("."), l = n[1] && n[1].length || 0, o = a[1] && a[1].length || 0, m = Math.pow(10, Math.max(l, o));
|
|
488
|
+
e = Math.round(e * m), t = Math.round(t * m), i = r === "+" ? e + t : e - t, i /= m;
|
|
490
489
|
}
|
|
491
490
|
return i;
|
|
492
491
|
}
|
|
493
|
-
|
|
494
|
-
return K = Object.assign || function(t) {
|
|
495
|
-
for (var e, i = 1, o = arguments.length; i < o; i++) {
|
|
496
|
-
e = arguments[i];
|
|
497
|
-
for (var a in e) Object.prototype.hasOwnProperty.call(e, a) && (t[a] = e[a]);
|
|
498
|
-
}
|
|
499
|
-
return t;
|
|
500
|
-
}, K.apply(this, arguments);
|
|
501
|
-
};
|
|
502
|
-
function Fe(r, t) {
|
|
503
|
-
var e = {};
|
|
504
|
-
for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && t.indexOf(i) < 0 && (e[i] = r[i]);
|
|
505
|
-
if (r != null && typeof Object.getOwnPropertySymbols == "function")
|
|
506
|
-
for (var o = 0, i = Object.getOwnPropertySymbols(r); o < i.length; o++)
|
|
507
|
-
t.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(r, i[o]) && (e[i[o]] = r[i[o]]);
|
|
508
|
-
return e;
|
|
509
|
-
}
|
|
510
|
-
var X = { exports: {} }, b = {};
|
|
511
|
-
/** @license React v16.13.1
|
|
512
|
-
* react-is.production.min.js
|
|
513
|
-
*
|
|
514
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
515
|
-
*
|
|
516
|
-
* This source code is licensed under the MIT license found in the
|
|
517
|
-
* LICENSE file in the root directory of this source tree.
|
|
518
|
-
*/
|
|
519
|
-
var Te;
|
|
520
|
-
function lt() {
|
|
521
|
-
if (Te) return b;
|
|
522
|
-
Te = 1;
|
|
523
|
-
var r = typeof Symbol == "function" && Symbol.for, t = r ? Symbol.for("react.element") : 60103, e = r ? Symbol.for("react.portal") : 60106, i = r ? Symbol.for("react.fragment") : 60107, o = r ? Symbol.for("react.strict_mode") : 60108, a = r ? Symbol.for("react.profiler") : 60114, s = r ? Symbol.for("react.provider") : 60109, u = r ? Symbol.for("react.context") : 60110, f = r ? Symbol.for("react.async_mode") : 60111, g = r ? Symbol.for("react.concurrent_mode") : 60111, $ = r ? Symbol.for("react.forward_ref") : 60112, y = r ? Symbol.for("react.suspense") : 60113, N = r ? Symbol.for("react.suspense_list") : 60120, h = r ? Symbol.for("react.memo") : 60115, m = r ? Symbol.for("react.lazy") : 60116, S = r ? Symbol.for("react.block") : 60121, _ = r ? Symbol.for("react.fundamental") : 60117, P = r ? Symbol.for("react.responder") : 60118, x = r ? Symbol.for("react.scope") : 60119;
|
|
524
|
-
function p(n) {
|
|
525
|
-
if (typeof n == "object" && n !== null) {
|
|
526
|
-
var T = n.$$typeof;
|
|
527
|
-
switch (T) {
|
|
528
|
-
case t:
|
|
529
|
-
switch (n = n.type, n) {
|
|
530
|
-
case f:
|
|
531
|
-
case g:
|
|
532
|
-
case i:
|
|
533
|
-
case a:
|
|
534
|
-
case o:
|
|
535
|
-
case y:
|
|
536
|
-
return n;
|
|
537
|
-
default:
|
|
538
|
-
switch (n = n && n.$$typeof, n) {
|
|
539
|
-
case u:
|
|
540
|
-
case $:
|
|
541
|
-
case m:
|
|
542
|
-
case h:
|
|
543
|
-
case s:
|
|
544
|
-
return n;
|
|
545
|
-
default:
|
|
546
|
-
return T;
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
case e:
|
|
550
|
-
return T;
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
function d(n) {
|
|
555
|
-
return p(n) === g;
|
|
556
|
-
}
|
|
557
|
-
return b.AsyncMode = f, b.ConcurrentMode = g, b.ContextConsumer = u, b.ContextProvider = s, b.Element = t, b.ForwardRef = $, b.Fragment = i, b.Lazy = m, b.Memo = h, b.Portal = e, b.Profiler = a, b.StrictMode = o, b.Suspense = y, b.isAsyncMode = function(n) {
|
|
558
|
-
return d(n) || p(n) === f;
|
|
559
|
-
}, b.isConcurrentMode = d, b.isContextConsumer = function(n) {
|
|
560
|
-
return p(n) === u;
|
|
561
|
-
}, b.isContextProvider = function(n) {
|
|
562
|
-
return p(n) === s;
|
|
563
|
-
}, b.isElement = function(n) {
|
|
564
|
-
return typeof n == "object" && n !== null && n.$$typeof === t;
|
|
565
|
-
}, b.isForwardRef = function(n) {
|
|
566
|
-
return p(n) === $;
|
|
567
|
-
}, b.isFragment = function(n) {
|
|
568
|
-
return p(n) === i;
|
|
569
|
-
}, b.isLazy = function(n) {
|
|
570
|
-
return p(n) === m;
|
|
571
|
-
}, b.isMemo = function(n) {
|
|
572
|
-
return p(n) === h;
|
|
573
|
-
}, b.isPortal = function(n) {
|
|
574
|
-
return p(n) === e;
|
|
575
|
-
}, b.isProfiler = function(n) {
|
|
576
|
-
return p(n) === a;
|
|
577
|
-
}, b.isStrictMode = function(n) {
|
|
578
|
-
return p(n) === o;
|
|
579
|
-
}, b.isSuspense = function(n) {
|
|
580
|
-
return p(n) === y;
|
|
581
|
-
}, b.isValidElementType = function(n) {
|
|
582
|
-
return typeof n == "string" || typeof n == "function" || n === i || n === g || n === a || n === o || n === y || n === N || typeof n == "object" && n !== null && (n.$$typeof === m || n.$$typeof === h || n.$$typeof === s || n.$$typeof === u || n.$$typeof === $ || n.$$typeof === _ || n.$$typeof === P || n.$$typeof === x || n.$$typeof === S);
|
|
583
|
-
}, b.typeOf = p, b;
|
|
584
|
-
}
|
|
585
|
-
var v = {};
|
|
586
|
-
/** @license React v16.13.1
|
|
587
|
-
* react-is.development.js
|
|
588
|
-
*
|
|
589
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
590
|
-
*
|
|
591
|
-
* This source code is licensed under the MIT license found in the
|
|
592
|
-
* LICENSE file in the root directory of this source tree.
|
|
593
|
-
*/
|
|
594
|
-
var _e;
|
|
595
|
-
function ut() {
|
|
596
|
-
return _e || (_e = 1, process.env.NODE_ENV !== "production" && function() {
|
|
597
|
-
var r = typeof Symbol == "function" && Symbol.for, t = r ? Symbol.for("react.element") : 60103, e = r ? Symbol.for("react.portal") : 60106, i = r ? Symbol.for("react.fragment") : 60107, o = r ? Symbol.for("react.strict_mode") : 60108, a = r ? Symbol.for("react.profiler") : 60114, s = r ? Symbol.for("react.provider") : 60109, u = r ? Symbol.for("react.context") : 60110, f = r ? Symbol.for("react.async_mode") : 60111, g = r ? Symbol.for("react.concurrent_mode") : 60111, $ = r ? Symbol.for("react.forward_ref") : 60112, y = r ? Symbol.for("react.suspense") : 60113, N = r ? Symbol.for("react.suspense_list") : 60120, h = r ? Symbol.for("react.memo") : 60115, m = r ? Symbol.for("react.lazy") : 60116, S = r ? Symbol.for("react.block") : 60121, _ = r ? Symbol.for("react.fundamental") : 60117, P = r ? Symbol.for("react.responder") : 60118, x = r ? Symbol.for("react.scope") : 60119;
|
|
598
|
-
function p(l) {
|
|
599
|
-
return typeof l == "string" || typeof l == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
600
|
-
l === i || l === g || l === a || l === o || l === y || l === N || typeof l == "object" && l !== null && (l.$$typeof === m || l.$$typeof === h || l.$$typeof === s || l.$$typeof === u || l.$$typeof === $ || l.$$typeof === _ || l.$$typeof === P || l.$$typeof === x || l.$$typeof === S);
|
|
601
|
-
}
|
|
602
|
-
function d(l) {
|
|
603
|
-
if (typeof l == "object" && l !== null) {
|
|
604
|
-
var re = l.$$typeof;
|
|
605
|
-
switch (re) {
|
|
606
|
-
case t:
|
|
607
|
-
var B = l.type;
|
|
608
|
-
switch (B) {
|
|
609
|
-
case f:
|
|
610
|
-
case g:
|
|
611
|
-
case i:
|
|
612
|
-
case a:
|
|
613
|
-
case o:
|
|
614
|
-
case y:
|
|
615
|
-
return B;
|
|
616
|
-
default:
|
|
617
|
-
var he = B && B.$$typeof;
|
|
618
|
-
switch (he) {
|
|
619
|
-
case u:
|
|
620
|
-
case $:
|
|
621
|
-
case m:
|
|
622
|
-
case h:
|
|
623
|
-
case s:
|
|
624
|
-
return he;
|
|
625
|
-
default:
|
|
626
|
-
return re;
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
case e:
|
|
630
|
-
return re;
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
|
-
var n = f, T = g, R = u, O = s, L = t, c = $, C = i, w = m, Q = h, W = e, J = a, k = o, ee = y, q = !1;
|
|
635
|
-
function te(l) {
|
|
636
|
-
return q || (q = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), U(l) || d(l) === f;
|
|
637
|
-
}
|
|
638
|
-
function U(l) {
|
|
639
|
-
return d(l) === g;
|
|
640
|
-
}
|
|
641
|
-
function ve(l) {
|
|
642
|
-
return d(l) === u;
|
|
643
|
-
}
|
|
644
|
-
function E(l) {
|
|
645
|
-
return d(l) === s;
|
|
646
|
-
}
|
|
647
|
-
function G(l) {
|
|
648
|
-
return typeof l == "object" && l !== null && l.$$typeof === t;
|
|
649
|
-
}
|
|
650
|
-
function M(l) {
|
|
651
|
-
return d(l) === $;
|
|
652
|
-
}
|
|
653
|
-
function I(l) {
|
|
654
|
-
return d(l) === i;
|
|
655
|
-
}
|
|
656
|
-
function Me(l) {
|
|
657
|
-
return d(l) === m;
|
|
658
|
-
}
|
|
659
|
-
function Ie(l) {
|
|
660
|
-
return d(l) === h;
|
|
661
|
-
}
|
|
662
|
-
function Ae(l) {
|
|
663
|
-
return d(l) === e;
|
|
664
|
-
}
|
|
665
|
-
function Le(l) {
|
|
666
|
-
return d(l) === a;
|
|
667
|
-
}
|
|
668
|
-
function je(l) {
|
|
669
|
-
return d(l) === o;
|
|
670
|
-
}
|
|
671
|
-
function Ye(l) {
|
|
672
|
-
return d(l) === y;
|
|
673
|
-
}
|
|
674
|
-
v.AsyncMode = n, v.ConcurrentMode = T, v.ContextConsumer = R, v.ContextProvider = O, v.Element = L, v.ForwardRef = c, v.Fragment = C, v.Lazy = w, v.Memo = Q, v.Portal = W, v.Profiler = J, v.StrictMode = k, v.Suspense = ee, v.isAsyncMode = te, v.isConcurrentMode = U, v.isContextConsumer = ve, v.isContextProvider = E, v.isElement = G, v.isForwardRef = M, v.isFragment = I, v.isLazy = Me, v.isMemo = Ie, v.isPortal = Ae, v.isProfiler = Le, v.isStrictMode = je, v.isSuspense = Ye, v.isValidElementType = p, v.typeOf = d;
|
|
675
|
-
}()), v;
|
|
676
|
-
}
|
|
677
|
-
var xe;
|
|
678
|
-
function ct() {
|
|
679
|
-
return xe || (xe = 1, process.env.NODE_ENV === "production" ? X.exports = lt() : X.exports = ut()), X.exports;
|
|
680
|
-
}
|
|
681
|
-
var le, we;
|
|
682
|
-
function ft() {
|
|
683
|
-
if (we) return le;
|
|
684
|
-
we = 1;
|
|
685
|
-
var r = ct(), t = {
|
|
686
|
-
childContextTypes: !0,
|
|
687
|
-
contextType: !0,
|
|
688
|
-
contextTypes: !0,
|
|
689
|
-
defaultProps: !0,
|
|
690
|
-
displayName: !0,
|
|
691
|
-
getDefaultProps: !0,
|
|
692
|
-
getDerivedStateFromError: !0,
|
|
693
|
-
getDerivedStateFromProps: !0,
|
|
694
|
-
mixins: !0,
|
|
695
|
-
propTypes: !0,
|
|
696
|
-
type: !0
|
|
697
|
-
}, e = {
|
|
698
|
-
name: !0,
|
|
699
|
-
length: !0,
|
|
700
|
-
prototype: !0,
|
|
701
|
-
caller: !0,
|
|
702
|
-
callee: !0,
|
|
703
|
-
arguments: !0,
|
|
704
|
-
arity: !0
|
|
705
|
-
}, i = {
|
|
706
|
-
$$typeof: !0,
|
|
707
|
-
render: !0,
|
|
708
|
-
defaultProps: !0,
|
|
709
|
-
displayName: !0,
|
|
710
|
-
propTypes: !0
|
|
711
|
-
}, o = {
|
|
712
|
-
$$typeof: !0,
|
|
713
|
-
compare: !0,
|
|
714
|
-
defaultProps: !0,
|
|
715
|
-
displayName: !0,
|
|
716
|
-
propTypes: !0,
|
|
717
|
-
type: !0
|
|
718
|
-
}, a = {};
|
|
719
|
-
a[r.ForwardRef] = i, a[r.Memo] = o;
|
|
720
|
-
function s(m) {
|
|
721
|
-
return r.isMemo(m) ? o : a[m.$$typeof] || t;
|
|
722
|
-
}
|
|
723
|
-
var u = Object.defineProperty, f = Object.getOwnPropertyNames, g = Object.getOwnPropertySymbols, $ = Object.getOwnPropertyDescriptor, y = Object.getPrototypeOf, N = Object.prototype;
|
|
724
|
-
function h(m, S, _) {
|
|
725
|
-
if (typeof S != "string") {
|
|
726
|
-
if (N) {
|
|
727
|
-
var P = y(S);
|
|
728
|
-
P && P !== N && h(m, P, _);
|
|
729
|
-
}
|
|
730
|
-
var x = f(S);
|
|
731
|
-
g && (x = x.concat(g(S)));
|
|
732
|
-
for (var p = s(m), d = s(S), n = 0; n < x.length; ++n) {
|
|
733
|
-
var T = x[n];
|
|
734
|
-
if (!e[T] && !(_ && _[T]) && !(d && d[T]) && !(p && p[T])) {
|
|
735
|
-
var R = $(S, T);
|
|
736
|
-
try {
|
|
737
|
-
u(m, T, R);
|
|
738
|
-
} catch {
|
|
739
|
-
}
|
|
740
|
-
}
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
return m;
|
|
744
|
-
}
|
|
745
|
-
return le = h, le;
|
|
746
|
-
}
|
|
747
|
-
ft();
|
|
748
|
-
function mt(r, t, e) {
|
|
749
|
-
if (e === void 0 && (e = Error), !r)
|
|
750
|
-
throw new e(t);
|
|
751
|
-
}
|
|
752
|
-
var dt = function(r) {
|
|
753
|
-
process.env.NODE_ENV !== "production" && console.error(r);
|
|
754
|
-
}, pt = function(r) {
|
|
755
|
-
process.env.NODE_ENV !== "production" && console.warn(r);
|
|
756
|
-
}, yt = {
|
|
757
|
-
formats: {},
|
|
758
|
-
messages: {},
|
|
759
|
-
timeZone: void 0,
|
|
760
|
-
defaultLocale: "en",
|
|
761
|
-
defaultFormats: {},
|
|
762
|
-
fallbackOnEmptyString: !0,
|
|
763
|
-
onError: dt,
|
|
764
|
-
onWarn: pt
|
|
765
|
-
};
|
|
766
|
-
function bt(r) {
|
|
767
|
-
mt(r, "[React Intl] Could not find required `intl` object. <IntlProvider> needs to exist in the component ancestry.");
|
|
768
|
-
}
|
|
769
|
-
K(K({}, yt), { textComponent: A.Fragment });
|
|
770
|
-
var ye = typeof window < "u" && !window.__REACT_INTL_BYPASS_GLOBAL_CONTEXT__ ? window.__REACT_INTL_CONTEXT__ || (window.__REACT_INTL_CONTEXT__ = A.createContext(null)) : A.createContext(null);
|
|
771
|
-
ye.Consumer;
|
|
772
|
-
ye.Provider;
|
|
773
|
-
var vt = ye;
|
|
774
|
-
function be() {
|
|
775
|
-
var r = A.useContext(vt);
|
|
776
|
-
return bt(r), r;
|
|
777
|
-
}
|
|
778
|
-
var de;
|
|
779
|
-
(function(r) {
|
|
780
|
-
r.formatDate = "FormattedDate", r.formatTime = "FormattedTime", r.formatNumber = "FormattedNumber", r.formatList = "FormattedList", r.formatDisplayName = "FormattedDisplayName";
|
|
781
|
-
})(de || (de = {}));
|
|
782
|
-
var pe;
|
|
783
|
-
(function(r) {
|
|
784
|
-
r.formatDate = "FormattedDateParts", r.formatTime = "FormattedTimeParts", r.formatNumber = "FormattedNumberParts", r.formatList = "FormattedListParts";
|
|
785
|
-
})(pe || (pe = {}));
|
|
786
|
-
function Oe(r) {
|
|
787
|
-
var t = function(e) {
|
|
788
|
-
var i = be(), o = e.value, a = e.children, s = Fe(e, ["value", "children"]), u = typeof o == "string" ? new Date(o || 0) : o, f = r === "formatDate" ? i.formatDateToParts(u, s) : i.formatTimeToParts(u, s);
|
|
789
|
-
return a(f);
|
|
790
|
-
};
|
|
791
|
-
return t.displayName = pe[r], t;
|
|
792
|
-
}
|
|
793
|
-
function z(r) {
|
|
794
|
-
var t = function(e) {
|
|
795
|
-
var i = be(), o = e.value, a = e.children, s = Fe(
|
|
796
|
-
e,
|
|
797
|
-
["value", "children"]
|
|
798
|
-
), u = i[r](o, s);
|
|
799
|
-
if (typeof a == "function")
|
|
800
|
-
return a(u);
|
|
801
|
-
var f = i.textComponent || A.Fragment;
|
|
802
|
-
return A.createElement(f, null, u);
|
|
803
|
-
};
|
|
804
|
-
return t.displayName = de[r], t;
|
|
805
|
-
}
|
|
806
|
-
z("formatDate");
|
|
807
|
-
z("formatTime");
|
|
808
|
-
z("formatNumber");
|
|
809
|
-
z("formatList");
|
|
810
|
-
z("formatDisplayName");
|
|
811
|
-
Oe("formatDate");
|
|
812
|
-
Oe("formatTime");
|
|
813
|
-
const Nt = Be(
|
|
492
|
+
const _e = $e(
|
|
814
493
|
({
|
|
815
494
|
placeholder: r,
|
|
816
|
-
variant:
|
|
817
|
-
disabled:
|
|
495
|
+
variant: e,
|
|
496
|
+
disabled: t,
|
|
818
497
|
type: i,
|
|
819
|
-
readOnly:
|
|
498
|
+
readOnly: n,
|
|
820
499
|
leftAdornments: a,
|
|
821
|
-
rightAdornments:
|
|
822
|
-
leftAdornmentsProps:
|
|
823
|
-
rightAdornmentsProps:
|
|
824
|
-
leftAdornmentsWidth:
|
|
825
|
-
rightAdornmentsWidth:
|
|
826
|
-
className:
|
|
827
|
-
style:
|
|
828
|
-
label:
|
|
829
|
-
value:
|
|
830
|
-
...
|
|
831
|
-
},
|
|
832
|
-
const
|
|
833
|
-
...
|
|
834
|
-
label:
|
|
835
|
-
value:
|
|
836
|
-
onChange: (
|
|
837
|
-
|
|
500
|
+
rightAdornments: l,
|
|
501
|
+
leftAdornmentsProps: o,
|
|
502
|
+
rightAdornmentsProps: m,
|
|
503
|
+
leftAdornmentsWidth: N,
|
|
504
|
+
rightAdornmentsWidth: b,
|
|
505
|
+
className: d,
|
|
506
|
+
style: h,
|
|
507
|
+
label: g,
|
|
508
|
+
value: f,
|
|
509
|
+
...p
|
|
510
|
+
}, S) => {
|
|
511
|
+
const x = Ce({
|
|
512
|
+
...p,
|
|
513
|
+
label: g,
|
|
514
|
+
value: f,
|
|
515
|
+
onChange: (c) => {
|
|
516
|
+
p.onChange && p.onChange(c);
|
|
838
517
|
},
|
|
839
|
-
locale:
|
|
840
|
-
}),
|
|
518
|
+
locale: "nb-NO"
|
|
519
|
+
}), $ = Z(null), { inputProps: y } = ye(
|
|
841
520
|
{
|
|
842
|
-
...
|
|
843
|
-
label:
|
|
844
|
-
value:
|
|
521
|
+
...p,
|
|
522
|
+
label: g,
|
|
523
|
+
value: f
|
|
845
524
|
},
|
|
846
525
|
x,
|
|
847
|
-
|
|
526
|
+
$
|
|
848
527
|
);
|
|
849
|
-
return /* @__PURE__ */
|
|
850
|
-
|
|
528
|
+
return /* @__PURE__ */ fe(
|
|
529
|
+
ve,
|
|
851
530
|
{
|
|
852
531
|
placeholder: r,
|
|
853
|
-
variant:
|
|
854
|
-
disabled:
|
|
532
|
+
variant: e,
|
|
533
|
+
disabled: t,
|
|
855
534
|
type: i,
|
|
856
|
-
readOnly:
|
|
535
|
+
readOnly: n,
|
|
857
536
|
leftAdornments: a,
|
|
858
|
-
rightAdornments:
|
|
859
|
-
leftAdornmentsProps:
|
|
860
|
-
rightAdornmentsProps:
|
|
861
|
-
leftAdornmentsWidth:
|
|
862
|
-
rightAdornmentsWidth:
|
|
863
|
-
className:
|
|
864
|
-
style:
|
|
865
|
-
"data-testid": `number-field-${
|
|
866
|
-
...
|
|
867
|
-
|
|
868
|
-
|
|
537
|
+
rightAdornments: l,
|
|
538
|
+
leftAdornmentsProps: o,
|
|
539
|
+
rightAdornmentsProps: m,
|
|
540
|
+
leftAdornmentsWidth: N,
|
|
541
|
+
rightAdornmentsWidth: b,
|
|
542
|
+
className: d,
|
|
543
|
+
style: h,
|
|
544
|
+
"data-testid": `number-field-${g}`,
|
|
545
|
+
...y,
|
|
546
|
+
onKeyDown: (c) => {
|
|
547
|
+
var P;
|
|
548
|
+
if (c.key === ".") {
|
|
549
|
+
c.preventDefault();
|
|
550
|
+
const V = c.target;
|
|
551
|
+
if ((P = V.value) != null && P.includes(",")) return;
|
|
552
|
+
const I = V.selectionStart || 0, R = V.selectionEnd || 0;
|
|
553
|
+
V.value = V.value.substring(0, I) + "," + V.value.substring(R);
|
|
554
|
+
}
|
|
555
|
+
},
|
|
556
|
+
ref: S,
|
|
557
|
+
"aria-label": g
|
|
869
558
|
}
|
|
870
559
|
);
|
|
871
560
|
}
|
|
872
561
|
);
|
|
873
562
|
export {
|
|
874
|
-
|
|
563
|
+
_e as NumberField
|
|
875
564
|
};
|