@internationalized/number 3.5.2-nightly.4555 → 3.5.2-nightly.4558

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 CHANGED
@@ -1,177 +1,13 @@
1
+ var $0c1d5654b62fc485$exports = require("./NumberFormatter.main.js");
2
+ var $d68f3f4c684426c6$exports = require("./NumberParser.main.js");
3
+
1
4
 
2
5
  function $parcel$export(e, n, v, s) {
3
6
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
4
7
  }
5
8
 
6
- $parcel$export(module.exports, "NumberFormatter", () => $0c1d5654b62fc485$export$cc77c4ff7e8673c5);
7
- $parcel$export(module.exports, "NumberParser", () => $d68f3f4c684426c6$export$cd11ab140839f11d);
8
- /*
9
- * Copyright 2020 Adobe. All rights reserved.
10
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
11
- * you may not use this file except in compliance with the License. You may obtain a copy
12
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
13
- *
14
- * Unless required by applicable law or agreed to in writing, software distributed under
15
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
16
- * OF ANY KIND, either express or implied. See the License for the specific language
17
- * governing permissions and limitations under the License.
18
- */ /*
19
- * Copyright 2020 Adobe. All rights reserved.
20
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
21
- * you may not use this file except in compliance with the License. You may obtain a copy
22
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
23
- *
24
- * Unless required by applicable law or agreed to in writing, software distributed under
25
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
26
- * OF ANY KIND, either express or implied. See the License for the specific language
27
- * governing permissions and limitations under the License.
28
- */ let $0c1d5654b62fc485$var$formatterCache = new Map();
29
- let $0c1d5654b62fc485$var$supportsSignDisplay = false;
30
- try {
31
- // @ts-ignore
32
- $0c1d5654b62fc485$var$supportsSignDisplay = new Intl.NumberFormat("de-DE", {
33
- signDisplay: "exceptZero"
34
- }).resolvedOptions().signDisplay === "exceptZero";
35
- // eslint-disable-next-line no-empty
36
- } catch (e) {}
37
- let $0c1d5654b62fc485$var$supportsUnit = false;
38
- try {
39
- // @ts-ignore
40
- $0c1d5654b62fc485$var$supportsUnit = new Intl.NumberFormat("de-DE", {
41
- style: "unit",
42
- unit: "degree"
43
- }).resolvedOptions().style === "unit";
44
- // eslint-disable-next-line no-empty
45
- } catch (e) {}
46
- // Polyfill for units since Safari doesn't support them yet. See https://bugs.webkit.org/show_bug.cgi?id=215438.
47
- // Currently only polyfilling the unit degree in narrow format for ColorSlider in our supported locales.
48
- // Values were determined by switching to each locale manually in Chrome.
49
- const $0c1d5654b62fc485$var$UNITS = {
50
- degree: {
51
- narrow: {
52
- default: "\xb0",
53
- "ja-JP": " \u5EA6",
54
- "zh-TW": "\u5EA6",
55
- "sl-SI": " \xb0"
56
- }
57
- }
58
- };
59
- class $0c1d5654b62fc485$export$cc77c4ff7e8673c5 {
60
- /** Formats a number value as a string, according to the locale and options provided to the constructor. */ format(value) {
61
- let res = "";
62
- if (!$0c1d5654b62fc485$var$supportsSignDisplay && this.options.signDisplay != null) res = $0c1d5654b62fc485$export$711b50b3c525e0f2(this.numberFormatter, this.options.signDisplay, value);
63
- else res = this.numberFormatter.format(value);
64
- if (this.options.style === "unit" && !$0c1d5654b62fc485$var$supportsUnit) {
65
- var _UNITS_unit;
66
- let { unit: unit, unitDisplay: unitDisplay = "short", locale: locale } = this.resolvedOptions();
67
- if (!unit) return res;
68
- let values = (_UNITS_unit = $0c1d5654b62fc485$var$UNITS[unit]) === null || _UNITS_unit === void 0 ? void 0 : _UNITS_unit[unitDisplay];
69
- res += values[locale] || values.default;
70
- }
71
- return res;
72
- }
73
- /** Formats a number to an array of parts such as separators, digits, punctuation, and more. */ formatToParts(value) {
74
- // TODO: implement signDisplay for formatToParts
75
- // @ts-ignore
76
- return this.numberFormatter.formatToParts(value);
77
- }
78
- /** Formats a number range as a string. */ formatRange(start, end) {
79
- // @ts-ignore
80
- if (typeof this.numberFormatter.formatRange === "function") // @ts-ignore
81
- return this.numberFormatter.formatRange(start, end);
82
- if (end < start) throw new RangeError("End date must be >= start date");
83
- // Very basic fallback for old browsers.
84
- return `${this.format(start)} \u{2013} ${this.format(end)}`;
85
- }
86
- /** Formats a number range as an array of parts. */ formatRangeToParts(start, end) {
87
- // @ts-ignore
88
- if (typeof this.numberFormatter.formatRangeToParts === "function") // @ts-ignore
89
- return this.numberFormatter.formatRangeToParts(start, end);
90
- if (end < start) throw new RangeError("End date must be >= start date");
91
- let startParts = this.numberFormatter.formatToParts(start);
92
- let endParts = this.numberFormatter.formatToParts(end);
93
- return [
94
- ...startParts.map((p)=>({
95
- ...p,
96
- source: "startRange"
97
- })),
98
- {
99
- type: "literal",
100
- value: " \u2013 ",
101
- source: "shared"
102
- },
103
- ...endParts.map((p)=>({
104
- ...p,
105
- source: "endRange"
106
- }))
107
- ];
108
- }
109
- /** Returns the resolved formatting options based on the values passed to the constructor. */ resolvedOptions() {
110
- let options = this.numberFormatter.resolvedOptions();
111
- if (!$0c1d5654b62fc485$var$supportsSignDisplay && this.options.signDisplay != null) options = {
112
- ...options,
113
- signDisplay: this.options.signDisplay
114
- };
115
- if (!$0c1d5654b62fc485$var$supportsUnit && this.options.style === "unit") options = {
116
- ...options,
117
- style: "unit",
118
- unit: this.options.unit,
119
- unitDisplay: this.options.unitDisplay
120
- };
121
- return options;
122
- }
123
- constructor(locale, options = {}){
124
- this.numberFormatter = $0c1d5654b62fc485$var$getCachedNumberFormatter(locale, options);
125
- this.options = options;
126
- }
127
- }
128
- function $0c1d5654b62fc485$var$getCachedNumberFormatter(locale, options = {}) {
129
- let { numberingSystem: numberingSystem } = options;
130
- if (numberingSystem && locale.includes("-nu-")) {
131
- if (!locale.includes("-u-")) locale += "-u-";
132
- locale += `-nu-${numberingSystem}`;
133
- }
134
- if (options.style === "unit" && !$0c1d5654b62fc485$var$supportsUnit) {
135
- var _UNITS_unit;
136
- let { unit: unit, unitDisplay: unitDisplay = "short" } = options;
137
- if (!unit) throw new Error('unit option must be provided with style: "unit"');
138
- if (!((_UNITS_unit = $0c1d5654b62fc485$var$UNITS[unit]) === null || _UNITS_unit === void 0 ? void 0 : _UNITS_unit[unitDisplay])) throw new Error(`Unsupported unit ${unit} with unitDisplay = ${unitDisplay}`);
139
- options = {
140
- ...options,
141
- style: "decimal"
142
- };
143
- }
144
- let cacheKey = locale + (options ? Object.entries(options).sort((a, b)=>a[0] < b[0] ? -1 : 1).join() : "");
145
- if ($0c1d5654b62fc485$var$formatterCache.has(cacheKey)) return $0c1d5654b62fc485$var$formatterCache.get(cacheKey);
146
- let numberFormatter = new Intl.NumberFormat(locale, options);
147
- $0c1d5654b62fc485$var$formatterCache.set(cacheKey, numberFormatter);
148
- return numberFormatter;
149
- }
150
- function $0c1d5654b62fc485$export$711b50b3c525e0f2(numberFormat, signDisplay, num) {
151
- if (signDisplay === "auto") return numberFormat.format(num);
152
- else if (signDisplay === "never") return numberFormat.format(Math.abs(num));
153
- else {
154
- let needsPositiveSign = false;
155
- if (signDisplay === "always") needsPositiveSign = num > 0 || Object.is(num, 0);
156
- else if (signDisplay === "exceptZero") {
157
- if (Object.is(num, -0) || Object.is(num, 0)) num = Math.abs(num);
158
- else needsPositiveSign = num > 0;
159
- }
160
- if (needsPositiveSign) {
161
- let negative = numberFormat.format(-num);
162
- let noSign = numberFormat.format(num);
163
- // ignore RTL/LTR marker character
164
- let minus = negative.replace(noSign, "").replace(/\u200e|\u061C/, "");
165
- if ([
166
- ...minus
167
- ].length !== 1) console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case");
168
- let positive = negative.replace(noSign, "!!!").replace(minus, "+").replace("!!!", noSign);
169
- return positive;
170
- } else return numberFormat.format(num);
171
- }
172
- }
173
-
174
-
9
+ $parcel$export(module.exports, "NumberFormatter", () => $0c1d5654b62fc485$exports.NumberFormatter);
10
+ $parcel$export(module.exports, "NumberParser", () => $d68f3f4c684426c6$exports.NumberParser);
175
11
  /*
176
12
  * Copyright 2020 Adobe. All rights reserved.
177
13
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -183,241 +19,6 @@ function $0c1d5654b62fc485$export$711b50b3c525e0f2(numberFormat, signDisplay, nu
183
19
  * OF ANY KIND, either express or implied. See the License for the specific language
184
20
  * governing permissions and limitations under the License.
185
21
  */
186
- const $d68f3f4c684426c6$var$CURRENCY_SIGN_REGEX = new RegExp("^.*\\(.*\\).*$");
187
- const $d68f3f4c684426c6$var$NUMBERING_SYSTEMS = [
188
- "latn",
189
- "arab",
190
- "hanidec"
191
- ];
192
- class $d68f3f4c684426c6$export$cd11ab140839f11d {
193
- /**
194
- * Parses the given string to a number. Returns NaN if a valid number could not be parsed.
195
- */ parse(value) {
196
- return $d68f3f4c684426c6$var$getNumberParserImpl(this.locale, this.options, value).parse(value);
197
- }
198
- /**
199
- * Returns whether the given string could potentially be a valid number. This should be used to
200
- * validate user input as the user types. If a `minValue` or `maxValue` is provided, the validity
201
- * of the minus/plus sign characters can be checked.
202
- */ isValidPartialNumber(value, minValue, maxValue) {
203
- return $d68f3f4c684426c6$var$getNumberParserImpl(this.locale, this.options, value).isValidPartialNumber(value, minValue, maxValue);
204
- }
205
- /**
206
- * Returns a numbering system for which the given string is valid in the current locale.
207
- * If no numbering system could be detected, the default numbering system for the current
208
- * locale is returned.
209
- */ getNumberingSystem(value) {
210
- return $d68f3f4c684426c6$var$getNumberParserImpl(this.locale, this.options, value).options.numberingSystem;
211
- }
212
- constructor(locale, options = {}){
213
- this.locale = locale;
214
- this.options = options;
215
- }
216
- }
217
- const $d68f3f4c684426c6$var$numberParserCache = new Map();
218
- function $d68f3f4c684426c6$var$getNumberParserImpl(locale, options, value) {
219
- // First try the default numbering system for the provided locale
220
- let defaultParser = $d68f3f4c684426c6$var$getCachedNumberParser(locale, options);
221
- // If that doesn't match, and the locale doesn't include a hard coded numbering system,
222
- // try each of the other supported numbering systems until we find one that matches.
223
- if (!locale.includes("-nu-") && !defaultParser.isValidPartialNumber(value)) {
224
- for (let numberingSystem of $d68f3f4c684426c6$var$NUMBERING_SYSTEMS)if (numberingSystem !== defaultParser.options.numberingSystem) {
225
- let parser = $d68f3f4c684426c6$var$getCachedNumberParser(locale + (locale.includes("-u-") ? "-nu-" : "-u-nu-") + numberingSystem, options);
226
- if (parser.isValidPartialNumber(value)) return parser;
227
- }
228
- }
229
- return defaultParser;
230
- }
231
- function $d68f3f4c684426c6$var$getCachedNumberParser(locale, options) {
232
- let cacheKey = locale + (options ? Object.entries(options).sort((a, b)=>a[0] < b[0] ? -1 : 1).join() : "");
233
- let parser = $d68f3f4c684426c6$var$numberParserCache.get(cacheKey);
234
- if (!parser) {
235
- parser = new $d68f3f4c684426c6$var$NumberParserImpl(locale, options);
236
- $d68f3f4c684426c6$var$numberParserCache.set(cacheKey, parser);
237
- }
238
- return parser;
239
- }
240
- // The actual number parser implementation. Instances of this class are cached
241
- // based on the locale, options, and detected numbering system.
242
- class $d68f3f4c684426c6$var$NumberParserImpl {
243
- parse(value) {
244
- // to parse the number, we need to remove anything that isn't actually part of the number, for example we want '-10.40' not '-10.40 USD'
245
- let fullySanitizedValue = this.sanitize(value);
246
- if (this.symbols.group) // Remove group characters, and replace decimal points and numerals with ASCII values.
247
- fullySanitizedValue = $d68f3f4c684426c6$var$replaceAll(fullySanitizedValue, this.symbols.group, "");
248
- if (this.symbols.decimal) fullySanitizedValue = fullySanitizedValue.replace(this.symbols.decimal, ".");
249
- if (this.symbols.minusSign) fullySanitizedValue = fullySanitizedValue.replace(this.symbols.minusSign, "-");
250
- fullySanitizedValue = fullySanitizedValue.replace(this.symbols.numeral, this.symbols.index);
251
- if (this.options.style === "percent") {
252
- // javascript is bad at dividing by 100 and maintaining the same significant figures, so perform it on the string before parsing
253
- let isNegative = fullySanitizedValue.indexOf("-");
254
- fullySanitizedValue = fullySanitizedValue.replace("-", "");
255
- let index = fullySanitizedValue.indexOf(".");
256
- if (index === -1) index = fullySanitizedValue.length;
257
- fullySanitizedValue = fullySanitizedValue.replace(".", "");
258
- if (index - 2 === 0) fullySanitizedValue = `0.${fullySanitizedValue}`;
259
- else if (index - 2 === -1) fullySanitizedValue = `0.0${fullySanitizedValue}`;
260
- else if (index - 2 === -2) fullySanitizedValue = "0.00";
261
- else fullySanitizedValue = `${fullySanitizedValue.slice(0, index - 2)}.${fullySanitizedValue.slice(index - 2)}`;
262
- if (isNegative > -1) fullySanitizedValue = `-${fullySanitizedValue}`;
263
- }
264
- let newValue = fullySanitizedValue ? +fullySanitizedValue : NaN;
265
- if (isNaN(newValue)) return NaN;
266
- if (this.options.style === "percent") {
267
- // extra step for rounding percents to what our formatter would output
268
- let options = {
269
- ...this.options,
270
- style: "decimal",
271
- minimumFractionDigits: Math.min(this.options.minimumFractionDigits + 2, 20),
272
- maximumFractionDigits: Math.min(this.options.maximumFractionDigits + 2, 20)
273
- };
274
- return new $d68f3f4c684426c6$export$cd11ab140839f11d(this.locale, options).parse(new (0, $0c1d5654b62fc485$export$cc77c4ff7e8673c5)(this.locale, options).format(newValue));
275
- }
276
- // accounting will always be stripped to a positive number, so if it's accounting and has a () around everything, then we need to make it negative again
277
- if (this.options.currencySign === "accounting" && $d68f3f4c684426c6$var$CURRENCY_SIGN_REGEX.test(value)) newValue = -1 * newValue;
278
- return newValue;
279
- }
280
- sanitize(value) {
281
- // Remove literals and whitespace, which are allowed anywhere in the string
282
- value = value.replace(this.symbols.literals, "");
283
- // Replace the ASCII minus sign with the minus sign used in the current locale
284
- // so that both are allowed in case the user's keyboard doesn't have the locale's minus sign.
285
- if (this.symbols.minusSign) value = value.replace("-", this.symbols.minusSign);
286
- // In arab numeral system, their decimal character is 1643, but most keyboards don't type that
287
- // instead they use the , (44) character or apparently the (1548) character.
288
- if (this.options.numberingSystem === "arab") {
289
- if (this.symbols.decimal) {
290
- value = value.replace(",", this.symbols.decimal);
291
- value = value.replace(String.fromCharCode(1548), this.symbols.decimal);
292
- }
293
- if (this.symbols.group) value = $d68f3f4c684426c6$var$replaceAll(value, ".", this.symbols.group);
294
- }
295
- // fr-FR group character is char code 8239, but that's not a key on the french keyboard,
296
- // so allow 'period' as a group char and replace it with a space
297
- if (this.options.locale === "fr-FR") value = $d68f3f4c684426c6$var$replaceAll(value, ".", String.fromCharCode(8239));
298
- return value;
299
- }
300
- isValidPartialNumber(value, minValue = -Infinity, maxValue = Infinity) {
301
- value = this.sanitize(value);
302
- // Remove minus or plus sign, which must be at the start of the string.
303
- if (this.symbols.minusSign && value.startsWith(this.symbols.minusSign) && minValue < 0) value = value.slice(this.symbols.minusSign.length);
304
- else if (this.symbols.plusSign && value.startsWith(this.symbols.plusSign) && maxValue > 0) value = value.slice(this.symbols.plusSign.length);
305
- // Numbers cannot start with a group separator
306
- if (this.symbols.group && value.startsWith(this.symbols.group)) return false;
307
- // Numbers that can't have any decimal values fail if a decimal character is typed
308
- if (this.symbols.decimal && value.indexOf(this.symbols.decimal) > -1 && this.options.maximumFractionDigits === 0) return false;
309
- // Remove numerals, groups, and decimals
310
- if (this.symbols.group) value = $d68f3f4c684426c6$var$replaceAll(value, this.symbols.group, "");
311
- value = value.replace(this.symbols.numeral, "");
312
- if (this.symbols.decimal) value = value.replace(this.symbols.decimal, "");
313
- // The number is valid if there are no remaining characters
314
- return value.length === 0;
315
- }
316
- constructor(locale, options = {}){
317
- this.locale = locale;
318
- this.formatter = new Intl.NumberFormat(locale, options);
319
- this.options = this.formatter.resolvedOptions();
320
- this.symbols = $d68f3f4c684426c6$var$getSymbols(locale, this.formatter, this.options, options);
321
- var _this_options_minimumFractionDigits, _this_options_maximumFractionDigits;
322
- if (this.options.style === "percent" && (((_this_options_minimumFractionDigits = this.options.minimumFractionDigits) !== null && _this_options_minimumFractionDigits !== void 0 ? _this_options_minimumFractionDigits : 0) > 18 || ((_this_options_maximumFractionDigits = this.options.maximumFractionDigits) !== null && _this_options_maximumFractionDigits !== void 0 ? _this_options_maximumFractionDigits : 0) > 18)) console.warn("NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.");
323
- }
324
- }
325
- const $d68f3f4c684426c6$var$nonLiteralParts = new Set([
326
- "decimal",
327
- "fraction",
328
- "integer",
329
- "minusSign",
330
- "plusSign",
331
- "group"
332
- ]);
333
- // This list is derived from https://www.unicode.org/cldr/charts/43/supplemental/language_plural_rules.html#comparison and includes
334
- // all unique numbers which we need to check in order to determine all the plural forms for a given locale.
335
- // See: https://github.com/adobe/react-spectrum/pull/5134/files#r1337037855 for used script
336
- const $d68f3f4c684426c6$var$pluralNumbers = [
337
- 0,
338
- 4,
339
- 2,
340
- 1,
341
- 11,
342
- 20,
343
- 3,
344
- 7,
345
- 100,
346
- 21,
347
- 0.1,
348
- 1.1
349
- ];
350
- function $d68f3f4c684426c6$var$getSymbols(locale, formatter, intlOptions, originalOptions) {
351
- var _allParts_find, _posAllParts_find, _decimalParts_find, _allParts_find1;
352
- // formatter needs access to all decimal places in order to generate the correct literal strings for the plural set
353
- let symbolFormatter = new Intl.NumberFormat(locale, {
354
- ...intlOptions,
355
- minimumSignificantDigits: 1,
356
- maximumSignificantDigits: 21
357
- });
358
- // Note: some locale's don't add a group symbol until there is a ten thousands place
359
- let allParts = symbolFormatter.formatToParts(-10000.111);
360
- let posAllParts = symbolFormatter.formatToParts(10000.111);
361
- let pluralParts = $d68f3f4c684426c6$var$pluralNumbers.map((n)=>symbolFormatter.formatToParts(n));
362
- var _allParts_find_value;
363
- let minusSign = (_allParts_find_value = (_allParts_find = allParts.find((p)=>p.type === "minusSign")) === null || _allParts_find === void 0 ? void 0 : _allParts_find.value) !== null && _allParts_find_value !== void 0 ? _allParts_find_value : "-";
364
- let plusSign = (_posAllParts_find = posAllParts.find((p)=>p.type === "plusSign")) === null || _posAllParts_find === void 0 ? void 0 : _posAllParts_find.value;
365
- // Safari does not support the signDisplay option, but our number parser polyfills it.
366
- // If no plus sign was returned, but the original options contained signDisplay, default to the '+' character.
367
- // @ts-ignore
368
- if (!plusSign && ((originalOptions === null || originalOptions === void 0 ? void 0 : originalOptions.signDisplay) === "exceptZero" || (originalOptions === null || originalOptions === void 0 ? void 0 : originalOptions.signDisplay) === "always")) plusSign = "+";
369
- // If maximumSignificantDigits is 1 (the minimum) then we won't get decimal characters out of the above formatters
370
- // Percent also defaults to 0 fractionDigits, so we need to make a new one that isn't percent to get an accurate decimal
371
- let decimalParts = new Intl.NumberFormat(locale, {
372
- ...intlOptions,
373
- minimumFractionDigits: 2,
374
- maximumFractionDigits: 2
375
- }).formatToParts(0.001);
376
- let decimal = (_decimalParts_find = decimalParts.find((p)=>p.type === "decimal")) === null || _decimalParts_find === void 0 ? void 0 : _decimalParts_find.value;
377
- let group = (_allParts_find1 = allParts.find((p)=>p.type === "group")) === null || _allParts_find1 === void 0 ? void 0 : _allParts_find1.value;
378
- // this set is also for a regex, it's all literals that might be in the string we want to eventually parse that
379
- // don't contribute to the numerical value
380
- let allPartsLiterals = allParts.filter((p)=>!$d68f3f4c684426c6$var$nonLiteralParts.has(p.type)).map((p)=>$d68f3f4c684426c6$var$escapeRegex(p.value));
381
- let pluralPartsLiterals = pluralParts.flatMap((p)=>p.filter((p)=>!$d68f3f4c684426c6$var$nonLiteralParts.has(p.type)).map((p)=>$d68f3f4c684426c6$var$escapeRegex(p.value)));
382
- let sortedLiterals = [
383
- ...new Set([
384
- ...allPartsLiterals,
385
- ...pluralPartsLiterals
386
- ])
387
- ].sort((a, b)=>b.length - a.length);
388
- let literals = sortedLiterals.length === 0 ? new RegExp("[\\p{White_Space}]", "gu") : new RegExp(`${sortedLiterals.join("|")}|[\\p{White_Space}]`, "gu");
389
- // These are for replacing non-latn characters with the latn equivalent
390
- let numerals = [
391
- ...new Intl.NumberFormat(intlOptions.locale, {
392
- useGrouping: false
393
- }).format(9876543210)
394
- ].reverse();
395
- let indexes = new Map(numerals.map((d, i)=>[
396
- d,
397
- i
398
- ]));
399
- let numeral = new RegExp(`[${numerals.join("")}]`, "g");
400
- let index = (d)=>String(indexes.get(d));
401
- return {
402
- minusSign: minusSign,
403
- plusSign: plusSign,
404
- decimal: decimal,
405
- group: group,
406
- literals: literals,
407
- numeral: numeral,
408
- index: index
409
- };
410
- }
411
- function $d68f3f4c684426c6$var$replaceAll(str, find, replace) {
412
- // @ts-ignore
413
- if (str.replaceAll) // @ts-ignore
414
- return str.replaceAll(find, replace);
415
- return str.split(find).join(replace);
416
- }
417
- function $d68f3f4c684426c6$var$escapeRegex(string) {
418
- return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
419
- }
420
-
421
22
 
422
23
 
423
24
 
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC,GAED,IAAI,uCAAiB,IAAI;AAEzB,IAAI,4CAAsB;AAC1B,IAAI;IACF,aAAa;IACb,4CAAsB,AAAC,IAAI,KAAK,YAAY,CAAC,SAAS;QAAC,aAAa;IAAY,GAAI,eAAe,GAAG,WAAW,KAAK;AACtH,oCAAoC;AACtC,EAAE,OAAO,GAAG,CAAC;AAEb,IAAI,qCAAe;AACnB,IAAI;IACF,aAAa;IACb,qCAAe,AAAC,IAAI,KAAK,YAAY,CAAC,SAAS;QAAC,OAAO;QAAQ,MAAM;IAAQ,GAAI,eAAe,GAAG,KAAK,KAAK;AAC7G,oCAAoC;AACtC,EAAE,OAAO,GAAG,CAAC;AAEb,gHAAgH;AAChH,wGAAwG;AACxG,yEAAyE;AACzE,MAAM,8BAAQ;IACZ,QAAQ;QACN,QAAQ;YACN,SAAS;YACT,SAAS;YACT,SAAS;YACT,SAAS;QAGX;IACF;AACF;AAcO,MAAM;IASX,yGAAyG,GACzG,OAAO,KAAa,EAAU;QAC5B,IAAI,MAAM;QACV,IAAI,CAAC,6CAAuB,IAAI,CAAC,OAAO,CAAC,WAAW,IAAI,MACtD,MAAM,0CAAgC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;aAEtF,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OAAO,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC;AAC9B;AAEA,SAAS,kCAAY,MAAc;IACjC,OAAO,OAAO,OAAO,CAAC,uBAAuB;AAC/C;","sources":["packages/@internationalized/number/src/index.ts","packages/@internationalized/number/src/NumberFormatter.ts","packages/@internationalized/number/src/NumberParser.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport type {NumberFormatOptions} from './NumberFormatter';\n\nexport {NumberFormatter} from './NumberFormatter';\nexport {NumberParser} from './NumberParser';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nlet formatterCache = new Map<string, Intl.NumberFormat>();\n\nlet supportsSignDisplay = false;\ntry {\n // @ts-ignore\n supportsSignDisplay = (new Intl.NumberFormat('de-DE', {signDisplay: 'exceptZero'})).resolvedOptions().signDisplay === 'exceptZero';\n // eslint-disable-next-line no-empty\n} catch (e) {}\n\nlet supportsUnit = false;\ntry {\n // @ts-ignore\n supportsUnit = (new Intl.NumberFormat('de-DE', {style: 'unit', unit: 'degree'})).resolvedOptions().style === 'unit';\n // eslint-disable-next-line no-empty\n} catch (e) {}\n\n// Polyfill for units since Safari doesn't support them yet. See https://bugs.webkit.org/show_bug.cgi?id=215438.\n// Currently only polyfilling the unit degree in narrow format for ColorSlider in our supported locales.\n// Values were determined by switching to each locale manually in Chrome.\nconst UNITS = {\n degree: {\n narrow: {\n default: '°',\n 'ja-JP': ' 度',\n 'zh-TW': '度',\n 'sl-SI': ' °'\n // Arabic?? But Safari already doesn't use Arabic digits so might be ok...\n // https://bugs.webkit.org/show_bug.cgi?id=218139\n }\n }\n};\n\nexport interface NumberFormatOptions extends Intl.NumberFormatOptions {\n /** Overrides default numbering system for the current locale. */\n numberingSystem?: string\n}\n\ninterface NumberRangeFormatPart extends Intl.NumberFormatPart {\n source: 'startRange' | 'endRange' | 'shared'\n}\n\n/**\n * A wrapper around Intl.NumberFormat providing additional options, polyfills, and caching for performance.\n */\nexport class NumberFormatter implements Intl.NumberFormat {\n private numberFormatter: Intl.NumberFormat;\n private options: NumberFormatOptions;\n\n constructor(locale: string, options: NumberFormatOptions = {}) {\n this.numberFormatter = getCachedNumberFormatter(locale, options);\n this.options = options;\n }\n\n /** Formats a number value as a string, according to the locale and options provided to the constructor. */\n format(value: number): string {\n let res = '';\n if (!supportsSignDisplay && this.options.signDisplay != null) {\n res = numberFormatSignDisplayPolyfill(this.numberFormatter, this.options.signDisplay, value);\n } else {\n res = this.numberFormatter.format(value);\n }\n\n if (this.options.style === 'unit' && !supportsUnit) {\n let {unit, unitDisplay = 'short', locale} = this.resolvedOptions();\n if (!unit) {\n return res;\n }\n let values = UNITS[unit]?.[unitDisplay];\n res += values[locale] || values.default;\n }\n\n return res;\n }\n\n /** Formats a number to an array of parts such as separators, digits, punctuation, and more. */\n formatToParts(value: number): Intl.NumberFormatPart[] {\n // TODO: implement signDisplay for formatToParts\n // @ts-ignore\n return this.numberFormatter.formatToParts(value);\n }\n\n /** Formats a number range as a string. */\n formatRange(start: number, end: number): string {\n // @ts-ignore\n if (typeof this.numberFormatter.formatRange === 'function') {\n // @ts-ignore\n return this.numberFormatter.formatRange(start, end);\n }\n\n if (end < start) {\n throw new RangeError('End date must be >= start date');\n }\n\n // Very basic fallback for old browsers.\n return `${this.format(start)} – ${this.format(end)}`;\n }\n\n /** Formats a number range as an array of parts. */\n formatRangeToParts(start: number, end: number): NumberRangeFormatPart[] {\n // @ts-ignore\n if (typeof this.numberFormatter.formatRangeToParts === 'function') {\n // @ts-ignore\n return this.numberFormatter.formatRangeToParts(start, end);\n }\n\n if (end < start) {\n throw new RangeError('End date must be >= start date');\n }\n\n let startParts = this.numberFormatter.formatToParts(start);\n let endParts = this.numberFormatter.formatToParts(end);\n return [\n ...startParts.map(p => ({...p, source: 'startRange'} as NumberRangeFormatPart)),\n {type: 'literal', value: ' – ', source: 'shared'},\n ...endParts.map(p => ({...p, source: 'endRange'} as NumberRangeFormatPart))\n ];\n }\n\n /** Returns the resolved formatting options based on the values passed to the constructor. */\n resolvedOptions(): Intl.ResolvedNumberFormatOptions {\n let options = this.numberFormatter.resolvedOptions();\n if (!supportsSignDisplay && this.options.signDisplay != null) {\n options = {...options, signDisplay: this.options.signDisplay};\n }\n\n if (!supportsUnit && this.options.style === 'unit') {\n options = {...options, style: 'unit', unit: this.options.unit, unitDisplay: this.options.unitDisplay};\n }\n\n return options;\n }\n}\n\nfunction getCachedNumberFormatter(locale: string, options: NumberFormatOptions = {}): Intl.NumberFormat {\n let {numberingSystem} = options;\n if (numberingSystem && locale.includes('-nu-')) {\n if (!locale.includes('-u-')) {\n locale += '-u-';\n }\n locale += `-nu-${numberingSystem}`;\n }\n\n if (options.style === 'unit' && !supportsUnit) {\n let {unit, unitDisplay = 'short'} = options;\n if (!unit) {\n throw new Error('unit option must be provided with style: \"unit\"');\n }\n if (!UNITS[unit]?.[unitDisplay]) {\n throw new Error(`Unsupported unit ${unit} with unitDisplay = ${unitDisplay}`);\n }\n options = {...options, style: 'decimal'};\n }\n\n let cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : '');\n if (formatterCache.has(cacheKey)) {\n return formatterCache.get(cacheKey)!;\n }\n\n let numberFormatter = new Intl.NumberFormat(locale, options);\n formatterCache.set(cacheKey, numberFormatter);\n return numberFormatter;\n}\n\n/** @private - exported for tests */\nexport function numberFormatSignDisplayPolyfill(numberFormat: Intl.NumberFormat, signDisplay: string, num: number) {\n if (signDisplay === 'auto') {\n return numberFormat.format(num);\n } else if (signDisplay === 'never') {\n return numberFormat.format(Math.abs(num));\n } else {\n let needsPositiveSign = false;\n if (signDisplay === 'always') {\n needsPositiveSign = num > 0 || Object.is(num, 0);\n } else if (signDisplay === 'exceptZero') {\n if (Object.is(num, -0) || Object.is(num, 0)) {\n num = Math.abs(num);\n } else {\n needsPositiveSign = num > 0;\n }\n }\n\n if (needsPositiveSign) {\n let negative = numberFormat.format(-num);\n let noSign = numberFormat.format(num);\n // ignore RTL/LTR marker character\n let minus = negative.replace(noSign, '').replace(/\\u200e|\\u061C/, '');\n if ([...minus].length !== 1) {\n console.warn('@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case');\n }\n let positive = negative.replace(noSign, '!!!').replace(minus, '+').replace('!!!', noSign);\n return positive;\n } else {\n return numberFormat.format(num);\n }\n }\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {NumberFormatter} from './NumberFormatter';\n\ninterface Symbols {\n minusSign?: string,\n plusSign?: string,\n decimal?: string,\n group?: string,\n literals: RegExp,\n numeral: RegExp,\n index: (v: string) => string\n}\n\nconst CURRENCY_SIGN_REGEX = new RegExp('^.*\\\\(.*\\\\).*$');\nconst NUMBERING_SYSTEMS = ['latn', 'arab', 'hanidec'];\n\n/**\n * A NumberParser can be used to perform locale-aware parsing of numbers from Unicode strings,\n * as well as validation of partial user input. It automatically detects the numbering system\n * used in the input, and supports parsing decimals, percentages, currency values, and units\n * according to the locale.\n */\nexport class NumberParser {\n private locale: string;\n private options: Intl.NumberFormatOptions;\n\n constructor(locale: string, options: Intl.NumberFormatOptions = {}) {\n this.locale = locale;\n this.options = options;\n }\n\n /**\n * Parses the given string to a number. Returns NaN if a valid number could not be parsed.\n */\n parse(value: string): number {\n return getNumberParserImpl(this.locale, this.options, value).parse(value);\n }\n\n /**\n * Returns whether the given string could potentially be a valid number. This should be used to\n * validate user input as the user types. If a `minValue` or `maxValue` is provided, the validity\n * of the minus/plus sign characters can be checked.\n */\n isValidPartialNumber(value: string, minValue?: number, maxValue?: number): boolean {\n return getNumberParserImpl(this.locale, this.options, value).isValidPartialNumber(value, minValue, maxValue);\n }\n\n /**\n * Returns a numbering system for which the given string is valid in the current locale.\n * If no numbering system could be detected, the default numbering system for the current\n * locale is returned.\n */\n getNumberingSystem(value: string): string {\n return getNumberParserImpl(this.locale, this.options, value).options.numberingSystem;\n }\n}\n\nconst numberParserCache = new Map<string, NumberParserImpl>();\nfunction getNumberParserImpl(locale: string, options: Intl.NumberFormatOptions, value: string) {\n // First try the default numbering system for the provided locale\n let defaultParser = getCachedNumberParser(locale, options);\n\n // If that doesn't match, and the locale doesn't include a hard coded numbering system,\n // try each of the other supported numbering systems until we find one that matches.\n if (!locale.includes('-nu-') && !defaultParser.isValidPartialNumber(value)) {\n for (let numberingSystem of NUMBERING_SYSTEMS) {\n if (numberingSystem !== defaultParser.options.numberingSystem) {\n let parser = getCachedNumberParser(locale + (locale.includes('-u-') ? '-nu-' : '-u-nu-') + numberingSystem, options);\n if (parser.isValidPartialNumber(value)) {\n return parser;\n }\n }\n }\n }\n\n return defaultParser;\n}\n\nfunction getCachedNumberParser(locale: string, options: Intl.NumberFormatOptions) {\n let cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : '');\n let parser = numberParserCache.get(cacheKey);\n if (!parser) {\n parser = new NumberParserImpl(locale, options);\n numberParserCache.set(cacheKey, parser);\n }\n\n return parser;\n}\n\n// The actual number parser implementation. Instances of this class are cached\n// based on the locale, options, and detected numbering system.\nclass NumberParserImpl {\n formatter: Intl.NumberFormat;\n options: Intl.ResolvedNumberFormatOptions;\n symbols: Symbols;\n locale: string;\n\n constructor(locale: string, options: Intl.NumberFormatOptions = {}) {\n this.locale = locale;\n this.formatter = new Intl.NumberFormat(locale, options);\n this.options = this.formatter.resolvedOptions();\n this.symbols = getSymbols(locale, this.formatter, this.options, options);\n if (this.options.style === 'percent' && ((this.options.minimumFractionDigits ?? 0) > 18 || (this.options.maximumFractionDigits ?? 0) > 18)) {\n console.warn('NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.');\n }\n }\n\n parse(value: string) {\n // to parse the number, we need to remove anything that isn't actually part of the number, for example we want '-10.40' not '-10.40 USD'\n let fullySanitizedValue = this.sanitize(value);\n\n if (this.symbols.group) {\n // Remove group characters, and replace decimal points and numerals with ASCII values.\n fullySanitizedValue = replaceAll(fullySanitizedValue, this.symbols.group, '');\n }\n if (this.symbols.decimal) {\n fullySanitizedValue = fullySanitizedValue.replace(this.symbols.decimal!, '.');\n }\n if (this.symbols.minusSign) {\n fullySanitizedValue = fullySanitizedValue.replace(this.symbols.minusSign!, '-');\n }\n fullySanitizedValue = fullySanitizedValue.replace(this.symbols.numeral, this.symbols.index);\n\n if (this.options.style === 'percent') {\n // javascript is bad at dividing by 100 and maintaining the same significant figures, so perform it on the string before parsing\n let isNegative = fullySanitizedValue.indexOf('-');\n fullySanitizedValue = fullySanitizedValue.replace('-', '');\n let index = fullySanitizedValue.indexOf('.');\n if (index === -1) {\n index = fullySanitizedValue.length;\n }\n fullySanitizedValue = fullySanitizedValue.replace('.', '');\n if (index - 2 === 0) {\n fullySanitizedValue = `0.${fullySanitizedValue}`;\n } else if (index - 2 === -1) {\n fullySanitizedValue = `0.0${fullySanitizedValue}`;\n } else if (index - 2 === -2) {\n fullySanitizedValue = '0.00';\n } else {\n fullySanitizedValue = `${fullySanitizedValue.slice(0, index - 2)}.${fullySanitizedValue.slice(index - 2)}`;\n }\n if (isNegative > -1) {\n fullySanitizedValue = `-${fullySanitizedValue}`;\n }\n }\n\n let newValue = fullySanitizedValue ? +fullySanitizedValue : NaN;\n if (isNaN(newValue)) {\n return NaN;\n }\n\n if (this.options.style === 'percent') {\n // extra step for rounding percents to what our formatter would output\n let options = {\n ...this.options,\n style: 'decimal',\n minimumFractionDigits: Math.min(this.options.minimumFractionDigits + 2, 20),\n maximumFractionDigits: Math.min(this.options.maximumFractionDigits + 2, 20)\n };\n return (new NumberParser(this.locale, options)).parse(new NumberFormatter(this.locale, options).format(newValue));\n }\n\n // accounting will always be stripped to a positive number, so if it's accounting and has a () around everything, then we need to make it negative again\n if (this.options.currencySign === 'accounting' && CURRENCY_SIGN_REGEX.test(value)) {\n newValue = -1 * newValue;\n }\n\n return newValue;\n }\n\n sanitize(value: string) {\n // Remove literals and whitespace, which are allowed anywhere in the string\n value = value.replace(this.symbols.literals, '');\n\n // Replace the ASCII minus sign with the minus sign used in the current locale\n // so that both are allowed in case the user's keyboard doesn't have the locale's minus sign.\n if (this.symbols.minusSign) {\n value = value.replace('-', this.symbols.minusSign);\n }\n\n // In arab numeral system, their decimal character is 1643, but most keyboards don't type that\n // instead they use the , (44) character or apparently the (1548) character.\n if (this.options.numberingSystem === 'arab') {\n if (this.symbols.decimal) {\n value = value.replace(',', this.symbols.decimal);\n value = value.replace(String.fromCharCode(1548), this.symbols.decimal);\n }\n if (this.symbols.group) {\n value = replaceAll(value, '.', this.symbols.group);\n }\n }\n\n // fr-FR group character is char code 8239, but that's not a key on the french keyboard,\n // so allow 'period' as a group char and replace it with a space\n if (this.options.locale === 'fr-FR') {\n value = replaceAll(value, '.', String.fromCharCode(8239));\n }\n\n return value;\n }\n\n isValidPartialNumber(value: string, minValue: number = -Infinity, maxValue: number = Infinity): boolean {\n value = this.sanitize(value);\n\n // Remove minus or plus sign, which must be at the start of the string.\n if (this.symbols.minusSign && value.startsWith(this.symbols.minusSign) && minValue < 0) {\n value = value.slice(this.symbols.minusSign.length);\n } else if (this.symbols.plusSign && value.startsWith(this.symbols.plusSign) && maxValue > 0) {\n value = value.slice(this.symbols.plusSign.length);\n }\n\n // Numbers cannot start with a group separator\n if (this.symbols.group && value.startsWith(this.symbols.group)) {\n return false;\n }\n\n // Numbers that can't have any decimal values fail if a decimal character is typed\n if (this.symbols.decimal && value.indexOf(this.symbols.decimal) > -1 && this.options.maximumFractionDigits === 0) {\n return false;\n }\n\n // Remove numerals, groups, and decimals\n if (this.symbols.group) {\n value = replaceAll(value, this.symbols.group, '');\n }\n value = value.replace(this.symbols.numeral, '');\n if (this.symbols.decimal) {\n value = value.replace(this.symbols.decimal, '');\n }\n\n // The number is valid if there are no remaining characters\n return value.length === 0;\n }\n}\n\nconst nonLiteralParts = new Set(['decimal', 'fraction', 'integer', 'minusSign', 'plusSign', 'group']);\n\n// This list is derived from https://www.unicode.org/cldr/charts/43/supplemental/language_plural_rules.html#comparison and includes\n// all unique numbers which we need to check in order to determine all the plural forms for a given locale.\n// See: https://github.com/adobe/react-spectrum/pull/5134/files#r1337037855 for used script\nconst pluralNumbers = [\n 0, 4, 2, 1, 11, 20, 3, 7, 100, 21, 0.1, 1.1\n];\n\nfunction getSymbols(locale: string, formatter: Intl.NumberFormat, intlOptions: Intl.ResolvedNumberFormatOptions, originalOptions: Intl.NumberFormatOptions): Symbols {\n // formatter needs access to all decimal places in order to generate the correct literal strings for the plural set\n let symbolFormatter = new Intl.NumberFormat(locale, {...intlOptions, minimumSignificantDigits: 1, maximumSignificantDigits: 21});\n // Note: some locale's don't add a group symbol until there is a ten thousands place\n let allParts = symbolFormatter.formatToParts(-10000.111);\n let posAllParts = symbolFormatter.formatToParts(10000.111);\n let pluralParts = pluralNumbers.map(n => symbolFormatter.formatToParts(n));\n\n let minusSign = allParts.find(p => p.type === 'minusSign')?.value ?? '-';\n let plusSign = posAllParts.find(p => p.type === 'plusSign')?.value;\n\n // Safari does not support the signDisplay option, but our number parser polyfills it.\n // If no plus sign was returned, but the original options contained signDisplay, default to the '+' character.\n // @ts-ignore\n if (!plusSign && (originalOptions?.signDisplay === 'exceptZero' || originalOptions?.signDisplay === 'always')) {\n plusSign = '+';\n }\n\n // If maximumSignificantDigits is 1 (the minimum) then we won't get decimal characters out of the above formatters\n // Percent also defaults to 0 fractionDigits, so we need to make a new one that isn't percent to get an accurate decimal\n let decimalParts = new Intl.NumberFormat(locale, {...intlOptions, minimumFractionDigits: 2, maximumFractionDigits: 2}).formatToParts(0.001);\n\n let decimal = decimalParts.find(p => p.type === 'decimal')?.value;\n let group = allParts.find(p => p.type === 'group')?.value;\n\n // this set is also for a regex, it's all literals that might be in the string we want to eventually parse that\n // don't contribute to the numerical value\n let allPartsLiterals = allParts.filter(p => !nonLiteralParts.has(p.type)).map(p => escapeRegex(p.value));\n let pluralPartsLiterals = pluralParts.flatMap(p => p.filter(p => !nonLiteralParts.has(p.type)).map(p => escapeRegex(p.value)));\n let sortedLiterals = [...new Set([...allPartsLiterals, ...pluralPartsLiterals])].sort((a, b) => b.length - a.length);\n\n let literals = sortedLiterals.length === 0 ?\n new RegExp('[\\\\p{White_Space}]', 'gu') :\n new RegExp(`${sortedLiterals.join('|')}|[\\\\p{White_Space}]`, 'gu');\n\n // These are for replacing non-latn characters with the latn equivalent\n let numerals = [...new Intl.NumberFormat(intlOptions.locale, {useGrouping: false}).format(9876543210)].reverse();\n let indexes = new Map(numerals.map((d, i) => [d, i]));\n let numeral = new RegExp(`[${numerals.join('')}]`, 'g');\n let index = d => String(indexes.get(d));\n\n return {minusSign, plusSign, decimal, group, literals, numeral, index};\n}\n\nfunction replaceAll(str: string, find: string, replace: string) {\n // @ts-ignore\n if (str.replaceAll) {\n // @ts-ignore\n return str.replaceAll(find, replace);\n }\n\n return str.split(find).join(replace);\n}\n\nfunction escapeRegex(string: string) {\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@internationalized/number/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport type {NumberFormatOptions} from './NumberFormatter';\n\nexport {NumberFormatter} from './NumberFormatter';\nexport {NumberParser} from './NumberParser';\n"],"names":[],"version":3,"file":"main.js.map"}