@povio/ui 4.0.2 → 4.0.3
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/README.md +5 -1
- package/dist/{Breadcrumbs-BibAIBhY.js → Breadcrumbs-C-mZtdCc.js} +1 -1
- package/dist/{Calendar-kSEji28A.js → Calendar-BYcN64W5.js} +6 -136
- package/dist/{DatePicker-BbdtBAGN.js → DatePicker-DGlMtlvy.js} +12 -12
- package/dist/{DatePickerInput-eyHwzKPm.js → DatePickerInput-Nj_rVUyU.js} +8 -7
- package/dist/{DateRangePicker-Ct182qur.js → DateRangePicker-CE9XvAy9.js} +13 -185
- package/dist/{DateTimePicker-taYHMMYi.js → DateTimePicker-CtUPjVp1.js} +12 -12
- package/dist/{FileInput-B-ADr0B3.js → FileInput-BUs7wL0_.js} +1 -1
- package/dist/{FileUpload-3-4Vt4f1.js → FileUpload-C3HzeFeb.js} +1 -1
- package/dist/{FormField-CAcDJ4HC.js → FormField-DTO2cbXC.js} +1 -1
- package/dist/{FormFieldHeaderTooltip-C2IDI4ac.js → FormFieldHeaderTooltip-h6e5hq9V.js} +1 -1
- package/dist/{InlineTooltipWrapper-7HG-g2X3.js → InlineTooltipWrapper-Ct6zi24f.js} +1 -1
- package/dist/{InputItem-B3PlrjuD.js → InputItem-DAunP0iy.js} +9 -9
- package/dist/{Inputs-WZmrBWrL.js → Inputs-_IqA6JRE.js} +1 -1
- package/dist/NumberFormatter-CLDS_LRZ.js +265 -0
- package/dist/{NumberRangeInput-X8G1zfNM.js → NumberRangeInput-Bu-3Y0zf.js} +6 -5
- package/dist/{RadioGroup-DW_OQQDu.js → RadioGroup-DiF7ILto.js} +1 -1
- package/dist/{RichTextEditor-BOTitK7E.js → RichTextEditor-eM9d2umr.js} +2 -2
- package/dist/{Select-DmLkOMr1.js → Select-CyBtGHk9.js} +2 -2
- package/dist/{Slider-Q87Hg_V2.js → Slider-KkWtEm09.js} +1 -1
- package/dist/{TextArea-DZv6XaT0.js → TextArea-DvqDGp4M.js} +2 -2
- package/dist/{TimePicker-DAoHgk8U.js → TimePicker-WirUMDrH.js} +10 -9
- package/dist/{ToggleGroup-Cho_oRZh.js → ToggleGroup-BK6Ka7WA.js} +5 -66
- package/dist/{Tooltip-D94a1IQl.js → Tooltip--PSxkQA3.js} +2 -2
- package/dist/{TooltipWrapper-S2JC-w4e.js → TooltipWrapper-BVc_Aln-.js} +1 -1
- package/dist/components/autocomplete.js +2 -2
- package/dist/components/breadcrumbs.js +1 -1
- package/dist/components/checkbox-group.js +1 -1
- package/dist/components/date-picker.js +1 -1
- package/dist/components/date-range-picker.js +1 -1
- package/dist/components/date-time-picker.js +1 -1
- package/dist/components/file-input.js +1 -1
- package/dist/components/file-upload-container.js +1 -1
- package/dist/components/file-upload.js +1 -1
- package/dist/components/form-field.js +1 -1
- package/dist/components/icon-button.js +1 -1
- package/dist/components/input.js +4 -4
- package/dist/components/number-field.js +7 -6
- package/dist/components/number-range-input.js +1 -1
- package/dist/components/query-autocomplete.js +1 -1
- package/dist/components/query-select.js +2 -2
- package/dist/components/radio-group.js +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/slider.js +1 -1
- package/dist/components/text-area.js +1 -1
- package/dist/components/time-picker.js +1 -1
- package/dist/components/toggle-group.js +1 -1
- package/dist/components/tooltip-ellipsis.js +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/config/ui-router.js +1 -1
- package/dist/{datePickerValue.utils-GADbSu7a.js → datePickerValue.utils-1z4mwZZs.js} +5 -5
- package/dist/hooks/use-filters.js +1 -1
- package/dist/index.js +15 -15
- package/dist/numberStatic.utils-BX50PSee.js +421 -0
- package/dist/rhf/date-picker.js +1 -1
- package/dist/rhf/date-range-picker.js +1 -1
- package/dist/rhf/date-time-picker.js +1 -1
- package/dist/rhf/file-input.js +1 -1
- package/dist/rhf/file-upload.js +1 -1
- package/dist/rhf/number-range-input.js +1 -1
- package/dist/rhf/radio-group.js +1 -1
- package/dist/rhf/rich-text-editor.js +1 -1
- package/dist/rhf/select.js +1 -1
- package/dist/rhf/slider.js +1 -1
- package/dist/rhf/text-area.js +1 -1
- package/dist/rhf/time-picker.js +1 -1
- package/dist/rhf/toggle-group.js +1 -1
- package/dist/rhf.js +15 -15
- package/dist/rich-text-editor.js +1 -1
- package/dist/{router.context-B0jTMtE0.js → router.context-B4FvsTim.js} +2 -2
- package/dist/staticDateTimeSegments-vP2f1woD.js +1763 -0
- package/dist/{staticSelect.utils-ad60elvT.js → staticSelect.utils-DOt6f-ck.js} +4 -143
- package/dist/tanstack/date-picker.js +1 -1
- package/dist/tanstack/date-range-picker.js +1 -1
- package/dist/tanstack/date-time-picker.js +1 -1
- package/dist/tanstack/file-input.js +1 -1
- package/dist/tanstack/file-upload.js +1 -1
- package/dist/tanstack/form.js +1 -1
- package/dist/tanstack/inputs.js +1 -1
- package/dist/tanstack/number-range-input.js +1 -1
- package/dist/tanstack/radio-group.js +1 -1
- package/dist/tanstack/rich-text-editor.js +1 -1
- package/dist/tanstack/select.js +1 -1
- package/dist/tanstack/slider.js +1 -1
- package/dist/tanstack/table.js +1 -1
- package/dist/tanstack/text-area.js +1 -1
- package/dist/tanstack/time-picker.js +1 -1
- package/dist/tanstack/toggle-group.js +1 -1
- package/dist/tanstack.js +24 -24
- package/dist/useControlledState-CzXkZCX8.js +30 -0
- package/dist/{useFieldAccessibility-CtTdRX2u.js → useFieldAccessibility-BTs_WC_5.js} +2 -2
- package/dist/{useFilters-kkEUFKmQ.js → useFilters-XNH27Md2.js} +1 -1
- package/dist/{useFormAutosave-DqP6lB4l.js → useFormAutosave-BRlM0nmq.js} +1 -1
- package/dist/{useStaticInputHandoff-BAaDW_0z.js → useStaticInputHandoff-_stbpoX4.js} +2 -2
- package/dist/{useTableColumnConfig-DVI_jVHz.js → useTableColumnConfig-CiAr7Dbi.js} +1 -1
- package/package.json +1 -1
- package/dist/FocusScope-CO9oJ1sc.js +0 -343
- package/dist/chain-DIXr2VAT.js +0 -10
- package/dist/focusSafely-DCGrr2bb.js +0 -447
- package/dist/getScrollParent-kSR7EtoT.js +0 -47
- package/dist/numberStatic.utils-BMgRzyd3.js +0 -902
- package/dist/openLink-CQhMhfzO.js +0 -121
- package/dist/platform-BXNIIAfU.js +0 -42
- package/dist/staticDateTimeSegments-BQoA94W-.js +0 -3603
- package/dist/useControlledState-DQxX6LMN.js +0 -189
- package/dist/useFocusable-Bd0UsrQ7.js +0 -63
- package/dist/useFormValidationState-D3z-gafz.js +0 -1341
- package/dist/useLayoutEffect-B2-1tbPJ.js +0 -83
- package/dist/useSyncRef-RGMv0rXK.js +0 -338
|
@@ -1,1341 +0,0 @@
|
|
|
1
|
-
import { i as $23f2114a1b82827e$export$e58f029f0fbfdb29, l as $d447af545b77c9f1$export$f531f92e2a15358f, n as $23f2114a1b82827e$export$4282f70798064fe0, r as $23f2114a1b82827e$export$cd4e5573fbe2b576, s as $d447af545b77c9f1$export$b204af158042fbac, t as $c4867b2f328c2698$export$e5c5a5f917a5871c } from "./useLayoutEffect-B2-1tbPJ.js";
|
|
2
|
-
import { c as $a92dc41f639950be$export$525bc4921d56d4a, l as $a92dc41f639950be$export$715c682d09d639cc, r as $8f5a2122b0992be3$export$8397ddfc504fdb9a, u as $a92dc41f639950be$export$c2b7abe5d61ec696 } from "./focusSafely-DCGrr2bb.js";
|
|
3
|
-
import { a as $390e54f620492c70$export$f680877a34711e37, i as $390e54f620492c70$export$b4cc09c592e8fdb8, n as $8296dad1a4c5e0dc$export$8f71654801c2f7cd, r as $bbaa08b3cd72f041$export$9d1611c77c2fe928 } from "./useSyncRef-RGMv0rXK.js";
|
|
4
|
-
import { r as $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7 } from "./useControlledState-DQxX6LMN.js";
|
|
5
|
-
import $ahdqC$react, { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
6
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/utils/useEffectEvent.mjs
|
|
7
|
-
const $fe16bffc7a557bf0$var$useEarlyEffect = $ahdqC$react["useInsertionEffect"] ?? $c4867b2f328c2698$export$e5c5a5f917a5871c;
|
|
8
|
-
function $fe16bffc7a557bf0$export$7f54fc3180508a52(fn) {
|
|
9
|
-
const ref = useRef(null);
|
|
10
|
-
$fe16bffc7a557bf0$var$useEarlyEffect(() => {
|
|
11
|
-
ref.current = fn;
|
|
12
|
-
}, [fn]);
|
|
13
|
-
return useCallback((...args) => {
|
|
14
|
-
const f = ref.current;
|
|
15
|
-
return f?.(...args);
|
|
16
|
-
}, []);
|
|
17
|
-
}
|
|
18
|
-
//#endregion
|
|
19
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/utils/useEvent.mjs
|
|
20
|
-
function $600b3cf69ae46262$export$90fc3a17d93f704c(ref, event, listener, options) {
|
|
21
|
-
let handleEvent = $fe16bffc7a557bf0$export$7f54fc3180508a52(listener);
|
|
22
|
-
let isDisabled = listener == null;
|
|
23
|
-
useEffect(() => {
|
|
24
|
-
if (isDisabled || ref.current == null) return;
|
|
25
|
-
return $d447af545b77c9f1$export$f531f92e2a15358f(ref.current, event, handleEvent, options);
|
|
26
|
-
}, [
|
|
27
|
-
ref,
|
|
28
|
-
event,
|
|
29
|
-
options,
|
|
30
|
-
isDisabled
|
|
31
|
-
]);
|
|
32
|
-
}
|
|
33
|
-
//#endregion
|
|
34
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/utils/useLabels.mjs
|
|
35
|
-
function $e8ac3c3f5d4bae7f$export$d6875122194c7b44(props, defaultLabel) {
|
|
36
|
-
let { id, "aria-label": label, "aria-labelledby": labelledBy } = props;
|
|
37
|
-
id = $390e54f620492c70$export$f680877a34711e37(id);
|
|
38
|
-
if (labelledBy && label) labelledBy = [.../* @__PURE__ */ new Set([id, ...labelledBy.trim().split(/\s+/)])].join(" ");
|
|
39
|
-
else if (labelledBy) labelledBy = labelledBy.trim().split(/\s+/).join(" ");
|
|
40
|
-
if (!label && !labelledBy && defaultLabel) label = defaultLabel;
|
|
41
|
-
return {
|
|
42
|
-
id,
|
|
43
|
-
"aria-label": label,
|
|
44
|
-
"aria-labelledby": labelledBy
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
//#endregion
|
|
48
|
-
//#region ../../node_modules/.bun/@internationalized+string@3.2.10/node_modules/@internationalized/string/dist/private/LocalizedStringDictionary.mjs
|
|
49
|
-
const $a747a10fe70a57da$var$localeSymbol = Symbol.for("react-aria.i18n.locale");
|
|
50
|
-
const $a747a10fe70a57da$var$stringsSymbol = Symbol.for("react-aria.i18n.strings");
|
|
51
|
-
let $a747a10fe70a57da$var$cachedGlobalStrings = void 0;
|
|
52
|
-
var $a747a10fe70a57da$export$c17fa47878dc55b6 = class $a747a10fe70a57da$export$c17fa47878dc55b6 {
|
|
53
|
-
constructor(messages, defaultLocale = "en-US") {
|
|
54
|
-
this.strings = Object.fromEntries(Object.entries(messages).filter(([, v]) => v));
|
|
55
|
-
this.defaultLocale = defaultLocale;
|
|
56
|
-
}
|
|
57
|
-
/** Returns a localized string for the given key and locale. */ getStringForLocale(key, locale) {
|
|
58
|
-
let string = this.getStringsForLocale(locale)[key];
|
|
59
|
-
if (!string) throw new Error(`Could not find intl message ${key} in ${locale} locale`);
|
|
60
|
-
return string;
|
|
61
|
-
}
|
|
62
|
-
/** Returns all localized strings for the given locale. */ getStringsForLocale(locale) {
|
|
63
|
-
let strings = this.strings[locale];
|
|
64
|
-
if (!strings) {
|
|
65
|
-
strings = $a747a10fe70a57da$var$getStringsForLocale(locale, this.strings, this.defaultLocale);
|
|
66
|
-
this.strings[locale] = strings;
|
|
67
|
-
}
|
|
68
|
-
return strings;
|
|
69
|
-
}
|
|
70
|
-
static getGlobalDictionaryForPackage(packageName) {
|
|
71
|
-
if (typeof window === "undefined") return null;
|
|
72
|
-
let locale = window[$a747a10fe70a57da$var$localeSymbol];
|
|
73
|
-
if ($a747a10fe70a57da$var$cachedGlobalStrings === void 0) {
|
|
74
|
-
let globalStrings = window[$a747a10fe70a57da$var$stringsSymbol];
|
|
75
|
-
if (!globalStrings) return null;
|
|
76
|
-
$a747a10fe70a57da$var$cachedGlobalStrings = {};
|
|
77
|
-
for (let pkg in globalStrings) $a747a10fe70a57da$var$cachedGlobalStrings[pkg] = new $a747a10fe70a57da$export$c17fa47878dc55b6({ [locale]: globalStrings[pkg] }, locale);
|
|
78
|
-
}
|
|
79
|
-
let dictionary = $a747a10fe70a57da$var$cachedGlobalStrings?.[packageName];
|
|
80
|
-
if (!dictionary) throw new Error(`Strings for package "${packageName}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);
|
|
81
|
-
return dictionary;
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
function $a747a10fe70a57da$var$getStringsForLocale(locale, strings, defaultLocale = "en-US") {
|
|
85
|
-
if (strings[locale]) return strings[locale];
|
|
86
|
-
let language = $a747a10fe70a57da$var$getLanguage(locale);
|
|
87
|
-
let script = $a747a10fe70a57da$var$getScript(locale);
|
|
88
|
-
if (script && strings[`${language}-${script}`]) return strings[`${language}-${script}`];
|
|
89
|
-
if (strings[language]) return strings[language];
|
|
90
|
-
for (let key in strings) if (key.startsWith(language + "-")) return strings[key];
|
|
91
|
-
return strings[defaultLocale];
|
|
92
|
-
}
|
|
93
|
-
function $a747a10fe70a57da$var$getLanguage(locale) {
|
|
94
|
-
if (Intl.Locale) return new Intl.Locale(locale).language;
|
|
95
|
-
return locale.split("-")[0];
|
|
96
|
-
}
|
|
97
|
-
function $a747a10fe70a57da$var$getScript(locale) {
|
|
98
|
-
if (Intl.Locale) return new Intl.Locale(locale).script;
|
|
99
|
-
}
|
|
100
|
-
//#endregion
|
|
101
|
-
//#region ../../node_modules/.bun/@internationalized+string@3.2.10/node_modules/@internationalized/string/dist/private/LocalizedStringFormatter.mjs
|
|
102
|
-
const $b27c684a33948c64$var$pluralRulesCache = /* @__PURE__ */ new Map();
|
|
103
|
-
const $b27c684a33948c64$var$numberFormatCache = /* @__PURE__ */ new Map();
|
|
104
|
-
var $b27c684a33948c64$export$2f817fcdc4b89ae0 = class {
|
|
105
|
-
constructor(locale, strings) {
|
|
106
|
-
this.locale = locale;
|
|
107
|
-
this.strings = strings;
|
|
108
|
-
}
|
|
109
|
-
/** Formats a localized string for the given key with the provided variables. */ format(key, variables) {
|
|
110
|
-
let message = this.strings.getStringForLocale(key, this.locale);
|
|
111
|
-
return typeof message === "function" ? message(variables, this) : message;
|
|
112
|
-
}
|
|
113
|
-
plural(count, options, type = "cardinal") {
|
|
114
|
-
let opt = options["=" + count];
|
|
115
|
-
if (opt) return typeof opt === "function" ? opt() : opt;
|
|
116
|
-
let key = this.locale + ":" + type;
|
|
117
|
-
let pluralRules = $b27c684a33948c64$var$pluralRulesCache.get(key);
|
|
118
|
-
if (!pluralRules) {
|
|
119
|
-
pluralRules = new Intl.PluralRules(this.locale, { type });
|
|
120
|
-
$b27c684a33948c64$var$pluralRulesCache.set(key, pluralRules);
|
|
121
|
-
}
|
|
122
|
-
opt = options[pluralRules.select(count)] || options.other;
|
|
123
|
-
return typeof opt === "function" ? opt() : opt;
|
|
124
|
-
}
|
|
125
|
-
number(value) {
|
|
126
|
-
let numberFormat = $b27c684a33948c64$var$numberFormatCache.get(this.locale);
|
|
127
|
-
if (!numberFormat) {
|
|
128
|
-
numberFormat = new Intl.NumberFormat(this.locale);
|
|
129
|
-
$b27c684a33948c64$var$numberFormatCache.set(this.locale, numberFormat);
|
|
130
|
-
}
|
|
131
|
-
return numberFormat.format(value);
|
|
132
|
-
}
|
|
133
|
-
select(options, value) {
|
|
134
|
-
let opt = options[value] || options.other;
|
|
135
|
-
return typeof opt === "function" ? opt() : opt;
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
//#endregion
|
|
139
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/i18n/useLocalizedStringFormatter.mjs
|
|
140
|
-
const $cf2482eff2eeeec2$var$cache = /* @__PURE__ */ new WeakMap();
|
|
141
|
-
function $cf2482eff2eeeec2$var$getCachedDictionary(strings) {
|
|
142
|
-
let dictionary = $cf2482eff2eeeec2$var$cache.get(strings);
|
|
143
|
-
if (!dictionary) {
|
|
144
|
-
dictionary = new $a747a10fe70a57da$export$c17fa47878dc55b6(strings);
|
|
145
|
-
$cf2482eff2eeeec2$var$cache.set(strings, dictionary);
|
|
146
|
-
}
|
|
147
|
-
return dictionary;
|
|
148
|
-
}
|
|
149
|
-
function $cf2482eff2eeeec2$export$87b761675e8eaa10(strings, packageName) {
|
|
150
|
-
return packageName && $a747a10fe70a57da$export$c17fa47878dc55b6.getGlobalDictionaryForPackage(packageName) || $cf2482eff2eeeec2$var$getCachedDictionary(strings);
|
|
151
|
-
}
|
|
152
|
-
function $cf2482eff2eeeec2$export$f12b703ca79dfbb1(strings, packageName) {
|
|
153
|
-
let { locale } = $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7();
|
|
154
|
-
let dictionary = $cf2482eff2eeeec2$export$87b761675e8eaa10(strings, packageName);
|
|
155
|
-
return useMemo(() => new $b27c684a33948c64$export$2f817fcdc4b89ae0(locale, dictionary), [locale, dictionary]);
|
|
156
|
-
}
|
|
157
|
-
//#endregion
|
|
158
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/utils/useGlobalListeners.mjs
|
|
159
|
-
function $48a7d519b337145d$export$4eaf04e54aa8eed6() {
|
|
160
|
-
let globalListeners = useRef(/* @__PURE__ */ new Map());
|
|
161
|
-
let addGlobalListener = useCallback((eventTarget, type, listener, options) => {
|
|
162
|
-
let fn = options?.once ? (...args) => {
|
|
163
|
-
globalListeners.current.delete(listener);
|
|
164
|
-
listener(...args);
|
|
165
|
-
} : listener;
|
|
166
|
-
globalListeners.current.set(listener, {
|
|
167
|
-
type,
|
|
168
|
-
eventTarget,
|
|
169
|
-
fn,
|
|
170
|
-
options
|
|
171
|
-
});
|
|
172
|
-
eventTarget.addEventListener(type, fn, options);
|
|
173
|
-
}, []);
|
|
174
|
-
let removeGlobalListener = useCallback((eventTarget, type, listener, options) => {
|
|
175
|
-
let fn = globalListeners.current.get(listener)?.fn || listener;
|
|
176
|
-
eventTarget.removeEventListener(type, fn, options);
|
|
177
|
-
globalListeners.current.delete(listener);
|
|
178
|
-
}, []);
|
|
179
|
-
let removeAllGlobalListeners = useCallback(() => {
|
|
180
|
-
globalListeners.current.forEach((value, key) => {
|
|
181
|
-
removeGlobalListener(value.eventTarget, value.type, key, value.options);
|
|
182
|
-
});
|
|
183
|
-
}, [removeGlobalListener]);
|
|
184
|
-
useEffect(() => {
|
|
185
|
-
return removeAllGlobalListeners;
|
|
186
|
-
}, [removeAllGlobalListeners]);
|
|
187
|
-
return {
|
|
188
|
-
addGlobalListener,
|
|
189
|
-
removeGlobalListener,
|
|
190
|
-
removeAllGlobalListeners
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
//#endregion
|
|
194
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/live-announcer/LiveAnnouncer.mjs
|
|
195
|
-
const $a46cf152bb926da5$var$LIVEREGION_TIMEOUT_DELAY = 7e3;
|
|
196
|
-
let $a46cf152bb926da5$var$liveAnnouncer = null;
|
|
197
|
-
function $a46cf152bb926da5$export$a9b970dcc4ae71a9(message, assertiveness = "assertive", timeout = $a46cf152bb926da5$var$LIVEREGION_TIMEOUT_DELAY) {
|
|
198
|
-
if (!$a46cf152bb926da5$var$liveAnnouncer) {
|
|
199
|
-
$a46cf152bb926da5$var$liveAnnouncer = new $a46cf152bb926da5$var$LiveAnnouncer();
|
|
200
|
-
if (!(typeof IS_REACT_ACT_ENVIRONMENT === "boolean" ? IS_REACT_ACT_ENVIRONMENT : typeof jest !== "undefined")) setTimeout(() => {
|
|
201
|
-
if ($a46cf152bb926da5$var$liveAnnouncer?.isAttached()) $a46cf152bb926da5$var$liveAnnouncer?.announce(message, assertiveness, timeout);
|
|
202
|
-
}, 100);
|
|
203
|
-
else $a46cf152bb926da5$var$liveAnnouncer.announce(message, assertiveness, timeout);
|
|
204
|
-
} else $a46cf152bb926da5$var$liveAnnouncer.announce(message, assertiveness, timeout);
|
|
205
|
-
}
|
|
206
|
-
function $a46cf152bb926da5$export$d10ae4f68404609a(assertiveness) {
|
|
207
|
-
if ($a46cf152bb926da5$var$liveAnnouncer) $a46cf152bb926da5$var$liveAnnouncer.clear(assertiveness);
|
|
208
|
-
}
|
|
209
|
-
var $a46cf152bb926da5$var$LiveAnnouncer = class {
|
|
210
|
-
constructor() {
|
|
211
|
-
this.node = null;
|
|
212
|
-
this.assertiveLog = null;
|
|
213
|
-
this.politeLog = null;
|
|
214
|
-
if (typeof document !== "undefined") {
|
|
215
|
-
this.node = document.createElement("div");
|
|
216
|
-
this.node.dataset.liveAnnouncer = "true";
|
|
217
|
-
Object.assign(this.node.style, {
|
|
218
|
-
border: 0,
|
|
219
|
-
clip: "rect(0 0 0 0)",
|
|
220
|
-
clipPath: "inset(50%)",
|
|
221
|
-
height: "1px",
|
|
222
|
-
margin: "-1px",
|
|
223
|
-
overflow: "hidden",
|
|
224
|
-
padding: 0,
|
|
225
|
-
position: "absolute",
|
|
226
|
-
width: "1px",
|
|
227
|
-
whiteSpace: "nowrap"
|
|
228
|
-
});
|
|
229
|
-
this.assertiveLog = this.createLog("assertive");
|
|
230
|
-
this.node.appendChild(this.assertiveLog);
|
|
231
|
-
this.politeLog = this.createLog("polite");
|
|
232
|
-
this.node.appendChild(this.politeLog);
|
|
233
|
-
document.body.prepend(this.node);
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
isAttached() {
|
|
237
|
-
return this.node?.isConnected;
|
|
238
|
-
}
|
|
239
|
-
createLog(ariaLive) {
|
|
240
|
-
let node = document.createElement("div");
|
|
241
|
-
node.setAttribute("role", "log");
|
|
242
|
-
node.setAttribute("aria-live", ariaLive);
|
|
243
|
-
node.setAttribute("aria-relevant", "additions");
|
|
244
|
-
return node;
|
|
245
|
-
}
|
|
246
|
-
destroy() {
|
|
247
|
-
if (!this.node) return;
|
|
248
|
-
document.body.removeChild(this.node);
|
|
249
|
-
this.node = null;
|
|
250
|
-
}
|
|
251
|
-
announce(message, assertiveness = "assertive", timeout = $a46cf152bb926da5$var$LIVEREGION_TIMEOUT_DELAY) {
|
|
252
|
-
if (!this.node) return;
|
|
253
|
-
let node = document.createElement("div");
|
|
254
|
-
if (typeof message === "object") {
|
|
255
|
-
node.setAttribute("role", "img");
|
|
256
|
-
node.setAttribute("aria-labelledby", message["aria-labelledby"]);
|
|
257
|
-
} else node.textContent = message;
|
|
258
|
-
if (assertiveness === "assertive") this.assertiveLog?.appendChild(node);
|
|
259
|
-
else this.politeLog?.appendChild(node);
|
|
260
|
-
if (message !== "") setTimeout(() => {
|
|
261
|
-
node.remove();
|
|
262
|
-
}, timeout);
|
|
263
|
-
}
|
|
264
|
-
clear(assertiveness) {
|
|
265
|
-
if (!this.node) return;
|
|
266
|
-
if ((!assertiveness || assertiveness === "assertive") && this.assertiveLog) this.assertiveLog.innerHTML = "";
|
|
267
|
-
if ((!assertiveness || assertiveness === "polite") && this.politeLog) this.politeLog.innerHTML = "";
|
|
268
|
-
}
|
|
269
|
-
};
|
|
270
|
-
//#endregion
|
|
271
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/utils/useFormReset.mjs
|
|
272
|
-
function $3274bf1495747a7b$export$5add1d006293d136(ref, initialValue, onReset) {
|
|
273
|
-
let handleReset = $fe16bffc7a557bf0$export$7f54fc3180508a52((e) => {
|
|
274
|
-
if (onReset && !e.defaultPrevented) onReset(initialValue);
|
|
275
|
-
});
|
|
276
|
-
useEffect(() => {
|
|
277
|
-
let form = ref?.current?.form;
|
|
278
|
-
form?.addEventListener("reset", handleReset);
|
|
279
|
-
return () => {
|
|
280
|
-
form?.removeEventListener("reset", handleReset);
|
|
281
|
-
};
|
|
282
|
-
}, [ref]);
|
|
283
|
-
}
|
|
284
|
-
//#endregion
|
|
285
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/form/useFormValidation.mjs
|
|
286
|
-
function $860f7da480e22816$export$b8473d3665f3a75a(props, state, ref) {
|
|
287
|
-
let { validationBehavior, focus } = props;
|
|
288
|
-
$c4867b2f328c2698$export$e5c5a5f917a5871c(() => {
|
|
289
|
-
if (validationBehavior === "native" && ref?.current && "setCustomValidity" in ref.current && !ref.current.disabled) {
|
|
290
|
-
let errorMessage = state.realtimeValidation.isInvalid ? state.realtimeValidation.validationErrors.join(" ") || "Invalid value." : "";
|
|
291
|
-
ref.current.setCustomValidity(errorMessage);
|
|
292
|
-
if (!ref.current.hasAttribute("title")) ref.current.title = "";
|
|
293
|
-
if (!state.realtimeValidation.isInvalid) state.updateValidation($860f7da480e22816$var$getNativeValidity(ref.current));
|
|
294
|
-
}
|
|
295
|
-
});
|
|
296
|
-
let isIgnoredReset = useRef(false);
|
|
297
|
-
let onReset = $fe16bffc7a557bf0$export$7f54fc3180508a52(() => {
|
|
298
|
-
if (!isIgnoredReset.current) state.resetValidation();
|
|
299
|
-
});
|
|
300
|
-
let onInvalid = $fe16bffc7a557bf0$export$7f54fc3180508a52((e) => {
|
|
301
|
-
if (!state.displayValidation.isInvalid) state.commitValidation();
|
|
302
|
-
let form = ref?.current?.form;
|
|
303
|
-
if (!e.defaultPrevented && ref && form && $860f7da480e22816$var$getFirstInvalidInput(form) === ref.current) {
|
|
304
|
-
if (focus) focus();
|
|
305
|
-
else ref.current?.focus();
|
|
306
|
-
$8f5a2122b0992be3$export$8397ddfc504fdb9a("keyboard");
|
|
307
|
-
}
|
|
308
|
-
e.preventDefault();
|
|
309
|
-
});
|
|
310
|
-
let onChange = $fe16bffc7a557bf0$export$7f54fc3180508a52(() => {
|
|
311
|
-
state.commitValidation();
|
|
312
|
-
});
|
|
313
|
-
useEffect(() => {
|
|
314
|
-
let input = ref?.current;
|
|
315
|
-
if (!input) return;
|
|
316
|
-
let form = input.form;
|
|
317
|
-
let reset = form?.reset;
|
|
318
|
-
if (form) form.reset = () => {
|
|
319
|
-
isIgnoredReset.current = !window.event || window.event.type === "message" && $23f2114a1b82827e$export$e58f029f0fbfdb29(window.event) instanceof MessagePort;
|
|
320
|
-
reset?.call(form);
|
|
321
|
-
isIgnoredReset.current = false;
|
|
322
|
-
};
|
|
323
|
-
input.addEventListener("invalid", onInvalid);
|
|
324
|
-
input.addEventListener("change", onChange);
|
|
325
|
-
form?.addEventListener("reset", onReset);
|
|
326
|
-
return () => {
|
|
327
|
-
input.removeEventListener("invalid", onInvalid);
|
|
328
|
-
input.removeEventListener("change", onChange);
|
|
329
|
-
form?.removeEventListener("reset", onReset);
|
|
330
|
-
if (form) form.reset = reset;
|
|
331
|
-
};
|
|
332
|
-
}, [ref, validationBehavior]);
|
|
333
|
-
}
|
|
334
|
-
function $860f7da480e22816$var$getValidity(input) {
|
|
335
|
-
let validity = input.validity;
|
|
336
|
-
return {
|
|
337
|
-
badInput: validity.badInput,
|
|
338
|
-
customError: validity.customError,
|
|
339
|
-
patternMismatch: validity.patternMismatch,
|
|
340
|
-
rangeOverflow: validity.rangeOverflow,
|
|
341
|
-
rangeUnderflow: validity.rangeUnderflow,
|
|
342
|
-
stepMismatch: validity.stepMismatch,
|
|
343
|
-
tooLong: validity.tooLong,
|
|
344
|
-
tooShort: validity.tooShort,
|
|
345
|
-
typeMismatch: validity.typeMismatch,
|
|
346
|
-
valueMissing: validity.valueMissing,
|
|
347
|
-
valid: validity.valid
|
|
348
|
-
};
|
|
349
|
-
}
|
|
350
|
-
function $860f7da480e22816$var$getNativeValidity(input) {
|
|
351
|
-
return {
|
|
352
|
-
isInvalid: !input.validity.valid,
|
|
353
|
-
validationDetails: $860f7da480e22816$var$getValidity(input),
|
|
354
|
-
validationErrors: input.validationMessage ? [input.validationMessage] : []
|
|
355
|
-
};
|
|
356
|
-
}
|
|
357
|
-
function $860f7da480e22816$var$getFirstInvalidInput(form) {
|
|
358
|
-
for (let i = 0; i < form.elements.length; i++) {
|
|
359
|
-
let element = form.elements[i];
|
|
360
|
-
if (element.validity?.valid === false) return element;
|
|
361
|
-
}
|
|
362
|
-
return null;
|
|
363
|
-
}
|
|
364
|
-
//#endregion
|
|
365
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/label/useLabel.mjs
|
|
366
|
-
function $0beb20c9744a2065$export$8467354a121f1b9f(props) {
|
|
367
|
-
let { id, label, "aria-labelledby": ariaLabelledby, "aria-label": ariaLabel, labelElementType = "label" } = props;
|
|
368
|
-
id = $390e54f620492c70$export$f680877a34711e37(id);
|
|
369
|
-
let labelId = $390e54f620492c70$export$f680877a34711e37();
|
|
370
|
-
let labelProps = {};
|
|
371
|
-
if (label) {
|
|
372
|
-
ariaLabelledby = ariaLabelledby ? `${labelId} ${ariaLabelledby}` : labelId;
|
|
373
|
-
labelProps = {
|
|
374
|
-
id: labelId,
|
|
375
|
-
htmlFor: labelElementType === "label" ? id : void 0
|
|
376
|
-
};
|
|
377
|
-
} else if (!ariaLabelledby && !ariaLabel && true) console.warn("If you do not provide a visible label, you must specify an aria-label or aria-labelledby attribute for accessibility");
|
|
378
|
-
let fieldProps = $e8ac3c3f5d4bae7f$export$d6875122194c7b44({
|
|
379
|
-
id,
|
|
380
|
-
"aria-label": ariaLabel,
|
|
381
|
-
"aria-labelledby": ariaLabelledby
|
|
382
|
-
});
|
|
383
|
-
return {
|
|
384
|
-
labelProps,
|
|
385
|
-
fieldProps
|
|
386
|
-
};
|
|
387
|
-
}
|
|
388
|
-
//#endregion
|
|
389
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/label/useField.mjs
|
|
390
|
-
function $191c9b6d48a0a4e2$export$294aa081a6c6f55d(props) {
|
|
391
|
-
let { description, errorMessage, isInvalid, validationState } = props;
|
|
392
|
-
let { labelProps, fieldProps } = $0beb20c9744a2065$export$8467354a121f1b9f(props);
|
|
393
|
-
let descriptionId = $390e54f620492c70$export$b4cc09c592e8fdb8([
|
|
394
|
-
Boolean(description),
|
|
395
|
-
Boolean(errorMessage),
|
|
396
|
-
isInvalid,
|
|
397
|
-
validationState
|
|
398
|
-
]);
|
|
399
|
-
let errorMessageId = $390e54f620492c70$export$b4cc09c592e8fdb8([
|
|
400
|
-
Boolean(description),
|
|
401
|
-
Boolean(errorMessage),
|
|
402
|
-
isInvalid,
|
|
403
|
-
validationState
|
|
404
|
-
]);
|
|
405
|
-
fieldProps = $bbaa08b3cd72f041$export$9d1611c77c2fe928(fieldProps, { "aria-describedby": [
|
|
406
|
-
descriptionId,
|
|
407
|
-
errorMessageId,
|
|
408
|
-
props["aria-describedby"]
|
|
409
|
-
].filter(Boolean).join(" ") || void 0 });
|
|
410
|
-
return {
|
|
411
|
-
labelProps,
|
|
412
|
-
fieldProps,
|
|
413
|
-
descriptionProps: { id: descriptionId },
|
|
414
|
-
errorMessageProps: { id: errorMessageId }
|
|
415
|
-
};
|
|
416
|
-
}
|
|
417
|
-
//#endregion
|
|
418
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/interactions/useFocusWithin.mjs
|
|
419
|
-
function $2c9edc598a03d523$export$420e68273165f4ec(props) {
|
|
420
|
-
let { isDisabled, onBlurWithin, onFocusWithin, onFocusWithinChange } = props;
|
|
421
|
-
let state = useRef({ isFocusWithin: false });
|
|
422
|
-
let { addGlobalListener, removeAllGlobalListeners } = $48a7d519b337145d$export$4eaf04e54aa8eed6();
|
|
423
|
-
let onBlur = useCallback((e) => {
|
|
424
|
-
if (!$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, $23f2114a1b82827e$export$e58f029f0fbfdb29(e))) return;
|
|
425
|
-
if (state.current.isFocusWithin && !$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, e.relatedTarget)) {
|
|
426
|
-
state.current.isFocusWithin = false;
|
|
427
|
-
removeAllGlobalListeners();
|
|
428
|
-
if (onBlurWithin) onBlurWithin(e);
|
|
429
|
-
if (onFocusWithinChange) onFocusWithinChange(false);
|
|
430
|
-
}
|
|
431
|
-
}, [
|
|
432
|
-
onBlurWithin,
|
|
433
|
-
onFocusWithinChange,
|
|
434
|
-
state,
|
|
435
|
-
removeAllGlobalListeners
|
|
436
|
-
]);
|
|
437
|
-
let onSyntheticFocus = $a92dc41f639950be$export$715c682d09d639cc(onBlur);
|
|
438
|
-
let onFocus = useCallback((e) => {
|
|
439
|
-
if (!$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, $23f2114a1b82827e$export$e58f029f0fbfdb29(e))) return;
|
|
440
|
-
let eventTarget = $23f2114a1b82827e$export$e58f029f0fbfdb29(e);
|
|
441
|
-
const ownerDocument = $d447af545b77c9f1$export$b204af158042fbac(eventTarget);
|
|
442
|
-
const activeElement = $23f2114a1b82827e$export$cd4e5573fbe2b576(ownerDocument);
|
|
443
|
-
if (!state.current.isFocusWithin && activeElement === eventTarget) {
|
|
444
|
-
if (onFocusWithin) onFocusWithin(e);
|
|
445
|
-
if (onFocusWithinChange) onFocusWithinChange(true);
|
|
446
|
-
state.current.isFocusWithin = true;
|
|
447
|
-
onSyntheticFocus(e);
|
|
448
|
-
let currentTarget = e.currentTarget;
|
|
449
|
-
addGlobalListener(ownerDocument, "focus", (e) => {
|
|
450
|
-
let eventTarget = $23f2114a1b82827e$export$e58f029f0fbfdb29(e);
|
|
451
|
-
if (state.current.isFocusWithin && !$23f2114a1b82827e$export$4282f70798064fe0(currentTarget, eventTarget)) {
|
|
452
|
-
let nativeEvent = new ownerDocument.defaultView.FocusEvent("blur", { relatedTarget: eventTarget });
|
|
453
|
-
$a92dc41f639950be$export$c2b7abe5d61ec696(nativeEvent, currentTarget);
|
|
454
|
-
let event = $a92dc41f639950be$export$525bc4921d56d4a(nativeEvent);
|
|
455
|
-
onBlur(event);
|
|
456
|
-
}
|
|
457
|
-
}, { capture: true });
|
|
458
|
-
}
|
|
459
|
-
}, [
|
|
460
|
-
onFocusWithin,
|
|
461
|
-
onFocusWithinChange,
|
|
462
|
-
onSyntheticFocus,
|
|
463
|
-
addGlobalListener,
|
|
464
|
-
onBlur
|
|
465
|
-
]);
|
|
466
|
-
if (isDisabled) return { focusWithinProps: {
|
|
467
|
-
onFocus: void 0,
|
|
468
|
-
onBlur: void 0
|
|
469
|
-
} };
|
|
470
|
-
return { focusWithinProps: {
|
|
471
|
-
onFocus,
|
|
472
|
-
onBlur
|
|
473
|
-
} };
|
|
474
|
-
}
|
|
475
|
-
//#endregion
|
|
476
|
-
//#region ../../node_modules/.bun/@internationalized+number@3.6.8/node_modules/@internationalized/number/dist/private/NumberFormatter.mjs
|
|
477
|
-
let $1dfb119a85e764e5$var$formatterCache = /* @__PURE__ */ new Map();
|
|
478
|
-
let $1dfb119a85e764e5$var$supportsSignDisplay = false;
|
|
479
|
-
try {
|
|
480
|
-
$1dfb119a85e764e5$var$supportsSignDisplay = new Intl.NumberFormat("de-DE", { signDisplay: "exceptZero" }).resolvedOptions().signDisplay === "exceptZero";
|
|
481
|
-
} catch {}
|
|
482
|
-
let $1dfb119a85e764e5$var$supportsUnit = false;
|
|
483
|
-
try {
|
|
484
|
-
$1dfb119a85e764e5$var$supportsUnit = new Intl.NumberFormat("de-DE", {
|
|
485
|
-
style: "unit",
|
|
486
|
-
unit: "degree"
|
|
487
|
-
}).resolvedOptions().style === "unit";
|
|
488
|
-
} catch {}
|
|
489
|
-
const $1dfb119a85e764e5$var$UNITS = { degree: { narrow: {
|
|
490
|
-
default: "°",
|
|
491
|
-
"ja-JP": " 度",
|
|
492
|
-
"zh-TW": "度",
|
|
493
|
-
"sl-SI": " °"
|
|
494
|
-
} } };
|
|
495
|
-
var $1dfb119a85e764e5$export$cc77c4ff7e8673c5 = class {
|
|
496
|
-
constructor(locale, options = {}) {
|
|
497
|
-
this.numberFormatter = $1dfb119a85e764e5$var$getCachedNumberFormatter(locale, options);
|
|
498
|
-
this.options = options;
|
|
499
|
-
}
|
|
500
|
-
/**
|
|
501
|
-
* Formats a number value as a string, according to the locale and options provided to the
|
|
502
|
-
* constructor.
|
|
503
|
-
*/ format(value) {
|
|
504
|
-
let res = "";
|
|
505
|
-
if (!$1dfb119a85e764e5$var$supportsSignDisplay && this.options.signDisplay != null) res = $1dfb119a85e764e5$export$711b50b3c525e0f2(this.numberFormatter, this.options.signDisplay, value);
|
|
506
|
-
else res = this.numberFormatter.format(value);
|
|
507
|
-
if (this.options.style === "unit" && !$1dfb119a85e764e5$var$supportsUnit) {
|
|
508
|
-
let { unit, unitDisplay = "short", locale } = this.resolvedOptions();
|
|
509
|
-
if (!unit) return res;
|
|
510
|
-
let values = $1dfb119a85e764e5$var$UNITS[unit]?.[unitDisplay];
|
|
511
|
-
res += values[locale] || values.default;
|
|
512
|
-
}
|
|
513
|
-
return res;
|
|
514
|
-
}
|
|
515
|
-
/** Formats a number to an array of parts such as separators, digits, punctuation, and more. */ formatToParts(value) {
|
|
516
|
-
return this.numberFormatter.formatToParts(value);
|
|
517
|
-
}
|
|
518
|
-
/** Formats a number range as a string. */ formatRange(start, end) {
|
|
519
|
-
if (typeof this.numberFormatter.formatRange === "function") return this.numberFormatter.formatRange(start, end);
|
|
520
|
-
if (end < start) throw new RangeError("End date must be >= start date");
|
|
521
|
-
return `${this.format(start)} \u{2013} ${this.format(end)}`;
|
|
522
|
-
}
|
|
523
|
-
/** Formats a number range as an array of parts. */ formatRangeToParts(start, end) {
|
|
524
|
-
if (typeof this.numberFormatter.formatRangeToParts === "function") return this.numberFormatter.formatRangeToParts(start, end);
|
|
525
|
-
if (end < start) throw new RangeError("End date must be >= start date");
|
|
526
|
-
let startParts = this.numberFormatter.formatToParts(start);
|
|
527
|
-
let endParts = this.numberFormatter.formatToParts(end);
|
|
528
|
-
return [
|
|
529
|
-
...startParts.map((p) => ({
|
|
530
|
-
...p,
|
|
531
|
-
source: "startRange"
|
|
532
|
-
})),
|
|
533
|
-
{
|
|
534
|
-
type: "literal",
|
|
535
|
-
value: " – ",
|
|
536
|
-
source: "shared"
|
|
537
|
-
},
|
|
538
|
-
...endParts.map((p) => ({
|
|
539
|
-
...p,
|
|
540
|
-
source: "endRange"
|
|
541
|
-
}))
|
|
542
|
-
];
|
|
543
|
-
}
|
|
544
|
-
/** Returns the resolved formatting options based on the values passed to the constructor. */ resolvedOptions() {
|
|
545
|
-
let options = this.numberFormatter.resolvedOptions();
|
|
546
|
-
if (!$1dfb119a85e764e5$var$supportsSignDisplay && this.options.signDisplay != null) options = {
|
|
547
|
-
...options,
|
|
548
|
-
signDisplay: this.options.signDisplay
|
|
549
|
-
};
|
|
550
|
-
if (!$1dfb119a85e764e5$var$supportsUnit && this.options.style === "unit") options = {
|
|
551
|
-
...options,
|
|
552
|
-
style: "unit",
|
|
553
|
-
unit: this.options.unit,
|
|
554
|
-
unitDisplay: this.options.unitDisplay
|
|
555
|
-
};
|
|
556
|
-
return options;
|
|
557
|
-
}
|
|
558
|
-
};
|
|
559
|
-
function $1dfb119a85e764e5$var$getCachedNumberFormatter(locale, options = {}) {
|
|
560
|
-
let { numberingSystem } = options;
|
|
561
|
-
if (numberingSystem && locale.includes("-nu-")) {
|
|
562
|
-
if (!locale.includes("-u-")) locale += "-u-";
|
|
563
|
-
locale += `-nu-${numberingSystem}`;
|
|
564
|
-
}
|
|
565
|
-
if (options.style === "unit" && !$1dfb119a85e764e5$var$supportsUnit) {
|
|
566
|
-
let { unit, unitDisplay = "short" } = options;
|
|
567
|
-
if (!unit) throw new Error("unit option must be provided with style: \"unit\"");
|
|
568
|
-
if (!$1dfb119a85e764e5$var$UNITS[unit]?.[unitDisplay]) throw new Error(`Unsupported unit ${unit} with unitDisplay = ${unitDisplay}`);
|
|
569
|
-
options = {
|
|
570
|
-
...options,
|
|
571
|
-
style: "decimal"
|
|
572
|
-
};
|
|
573
|
-
}
|
|
574
|
-
let cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : "");
|
|
575
|
-
if ($1dfb119a85e764e5$var$formatterCache.has(cacheKey)) return $1dfb119a85e764e5$var$formatterCache.get(cacheKey);
|
|
576
|
-
let numberFormatter = new Intl.NumberFormat(locale, options);
|
|
577
|
-
$1dfb119a85e764e5$var$formatterCache.set(cacheKey, numberFormatter);
|
|
578
|
-
return numberFormatter;
|
|
579
|
-
}
|
|
580
|
-
function $1dfb119a85e764e5$export$711b50b3c525e0f2(numberFormat, signDisplay, num) {
|
|
581
|
-
if (signDisplay === "auto") return numberFormat.format(num);
|
|
582
|
-
else if (signDisplay === "never") return numberFormat.format(Math.abs(num));
|
|
583
|
-
else {
|
|
584
|
-
let needsPositiveSign = false;
|
|
585
|
-
if (signDisplay === "always") needsPositiveSign = num > 0 || Object.is(num, 0);
|
|
586
|
-
else if (signDisplay === "exceptZero") {
|
|
587
|
-
if (Object.is(num, -0) || Object.is(num, 0)) num = Math.abs(num);
|
|
588
|
-
else needsPositiveSign = num > 0;
|
|
589
|
-
}
|
|
590
|
-
if (needsPositiveSign) {
|
|
591
|
-
let negative = numberFormat.format(-num);
|
|
592
|
-
let noSign = numberFormat.format(num);
|
|
593
|
-
let minus = negative.replace(noSign, "").replace(/\u200e|\u061C/, "");
|
|
594
|
-
if ([...minus].length !== 1) console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case");
|
|
595
|
-
return negative.replace(noSign, "!!!").replace(minus, "+").replace("!!!", noSign);
|
|
596
|
-
} else return numberFormat.format(num);
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
//#endregion
|
|
600
|
-
//#region ../../node_modules/.bun/@internationalized+number@3.6.8/node_modules/@internationalized/number/dist/private/NumberParser.mjs
|
|
601
|
-
const $eb76cf4feb040f77$var$CURRENCY_SIGN_REGEX = /* @__PURE__ */ new RegExp("^.*\\(.*\\).*$");
|
|
602
|
-
const $eb76cf4feb040f77$var$NUMBERING_SYSTEMS = [
|
|
603
|
-
"latn",
|
|
604
|
-
"arab",
|
|
605
|
-
"hanidec",
|
|
606
|
-
"deva",
|
|
607
|
-
"beng",
|
|
608
|
-
"fullwide"
|
|
609
|
-
];
|
|
610
|
-
var $eb76cf4feb040f77$export$cd11ab140839f11d = class {
|
|
611
|
-
constructor(locale, options = {}) {
|
|
612
|
-
this.locale = locale;
|
|
613
|
-
this.options = options;
|
|
614
|
-
}
|
|
615
|
-
/**
|
|
616
|
-
* Parses the given string to a number. Returns NaN if a valid number could not be parsed.
|
|
617
|
-
*/ parse(value) {
|
|
618
|
-
return $eb76cf4feb040f77$var$getNumberParserImpl(this.locale, this.options, value).parse(value);
|
|
619
|
-
}
|
|
620
|
-
/**
|
|
621
|
-
* Returns whether the given string could potentially be a valid number. This should be used to
|
|
622
|
-
* validate user input as the user types. If a `minValue` or `maxValue` is provided, the validity
|
|
623
|
-
* of the minus/plus sign characters can be checked.
|
|
624
|
-
*/ isValidPartialNumber(value, minValue, maxValue) {
|
|
625
|
-
return $eb76cf4feb040f77$var$getNumberParserImpl(this.locale, this.options, value).isValidPartialNumber(value, minValue, maxValue);
|
|
626
|
-
}
|
|
627
|
-
/**
|
|
628
|
-
* Returns a numbering system for which the given string is valid in the current locale.
|
|
629
|
-
* If no numbering system could be detected, the default numbering system for the current
|
|
630
|
-
* locale is returned.
|
|
631
|
-
*/ getNumberingSystem(value) {
|
|
632
|
-
return $eb76cf4feb040f77$var$getNumberParserImpl(this.locale, this.options, value).options.numberingSystem;
|
|
633
|
-
}
|
|
634
|
-
};
|
|
635
|
-
const $eb76cf4feb040f77$var$numberParserCache = /* @__PURE__ */ new Map();
|
|
636
|
-
function $eb76cf4feb040f77$var$getNumberParserImpl(locale, options, value) {
|
|
637
|
-
let defaultParser = $eb76cf4feb040f77$var$getCachedNumberParser(locale, options);
|
|
638
|
-
if (!locale.includes("-nu-") && !defaultParser.isValidPartialNumber(value)) {
|
|
639
|
-
for (let numberingSystem of $eb76cf4feb040f77$var$NUMBERING_SYSTEMS) if (numberingSystem !== defaultParser.options.numberingSystem) {
|
|
640
|
-
let parser = $eb76cf4feb040f77$var$getCachedNumberParser(locale + (locale.includes("-u-") ? "-nu-" : "-u-nu-") + numberingSystem, options);
|
|
641
|
-
if (parser.isValidPartialNumber(value)) return parser;
|
|
642
|
-
}
|
|
643
|
-
}
|
|
644
|
-
return defaultParser;
|
|
645
|
-
}
|
|
646
|
-
function $eb76cf4feb040f77$var$getCachedNumberParser(locale, options) {
|
|
647
|
-
let cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : "");
|
|
648
|
-
let parser = $eb76cf4feb040f77$var$numberParserCache.get(cacheKey);
|
|
649
|
-
if (!parser) {
|
|
650
|
-
parser = new $eb76cf4feb040f77$var$NumberParserImpl(locale, options);
|
|
651
|
-
$eb76cf4feb040f77$var$numberParserCache.set(cacheKey, parser);
|
|
652
|
-
}
|
|
653
|
-
return parser;
|
|
654
|
-
}
|
|
655
|
-
var $eb76cf4feb040f77$var$NumberParserImpl = class {
|
|
656
|
-
constructor(locale, options = {}) {
|
|
657
|
-
this.locale = locale;
|
|
658
|
-
if (options.roundingIncrement !== 1 && options.roundingIncrement != null) {
|
|
659
|
-
if (options.maximumFractionDigits == null && options.minimumFractionDigits == null) {
|
|
660
|
-
options.maximumFractionDigits = 0;
|
|
661
|
-
options.minimumFractionDigits = 0;
|
|
662
|
-
} else if (options.maximumFractionDigits == null) options.maximumFractionDigits = options.minimumFractionDigits;
|
|
663
|
-
else if (options.minimumFractionDigits == null) options.minimumFractionDigits = options.maximumFractionDigits;
|
|
664
|
-
}
|
|
665
|
-
this.formatter = new Intl.NumberFormat(locale, options);
|
|
666
|
-
this.options = this.formatter.resolvedOptions();
|
|
667
|
-
this.symbols = $eb76cf4feb040f77$var$getSymbols(locale, this.formatter, this.options, options);
|
|
668
|
-
if (this.options.style === "percent" && ((this.options.minimumFractionDigits ?? 0) > 18 || (this.options.maximumFractionDigits ?? 0) > 18)) console.warn("NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.");
|
|
669
|
-
}
|
|
670
|
-
parse(value) {
|
|
671
|
-
let isGroupSymbolAllowed = this.formatter.resolvedOptions().useGrouping;
|
|
672
|
-
let fullySanitizedValue = this.sanitize(value);
|
|
673
|
-
if (!isGroupSymbolAllowed && this.symbols.group && fullySanitizedValue.includes(this.symbols.group)) return NaN;
|
|
674
|
-
else if (this.symbols.group) fullySanitizedValue = fullySanitizedValue.replaceAll(this.symbols.group, "");
|
|
675
|
-
if (this.symbols.decimal) fullySanitizedValue = fullySanitizedValue.replace(this.symbols.decimal, ".");
|
|
676
|
-
if (this.symbols.minusSign) fullySanitizedValue = fullySanitizedValue.replace(this.symbols.minusSign, "-");
|
|
677
|
-
fullySanitizedValue = fullySanitizedValue.replace(this.symbols.numeral, this.symbols.index);
|
|
678
|
-
if (this.options.style === "percent") {
|
|
679
|
-
let isNegative = fullySanitizedValue.indexOf("-");
|
|
680
|
-
fullySanitizedValue = fullySanitizedValue.replace("-", "");
|
|
681
|
-
fullySanitizedValue = fullySanitizedValue.replace("+", "");
|
|
682
|
-
let index = fullySanitizedValue.indexOf(".");
|
|
683
|
-
if (index === -1) index = fullySanitizedValue.length;
|
|
684
|
-
fullySanitizedValue = fullySanitizedValue.replace(".", "");
|
|
685
|
-
if (index - 2 === 0) fullySanitizedValue = `0.${fullySanitizedValue}`;
|
|
686
|
-
else if (index - 2 === -1) fullySanitizedValue = `0.0${fullySanitizedValue}`;
|
|
687
|
-
else if (index - 2 === -2) fullySanitizedValue = "0.00";
|
|
688
|
-
else fullySanitizedValue = `${fullySanitizedValue.slice(0, index - 2)}.${fullySanitizedValue.slice(index - 2)}`;
|
|
689
|
-
if (isNegative > -1) fullySanitizedValue = `-${fullySanitizedValue}`;
|
|
690
|
-
}
|
|
691
|
-
let newValue = fullySanitizedValue ? +fullySanitizedValue : NaN;
|
|
692
|
-
if (isNaN(newValue)) return NaN;
|
|
693
|
-
if (this.options.style === "percent") {
|
|
694
|
-
let options = {
|
|
695
|
-
...this.options,
|
|
696
|
-
style: "decimal",
|
|
697
|
-
minimumFractionDigits: Math.min((this.options.minimumFractionDigits ?? 0) + 2, 20),
|
|
698
|
-
maximumFractionDigits: Math.min((this.options.maximumFractionDigits ?? 0) + 2, 20)
|
|
699
|
-
};
|
|
700
|
-
return new $eb76cf4feb040f77$export$cd11ab140839f11d(this.locale, options).parse(new $1dfb119a85e764e5$export$cc77c4ff7e8673c5(this.locale, options).format(newValue));
|
|
701
|
-
}
|
|
702
|
-
if (this.options.currencySign === "accounting" && $eb76cf4feb040f77$var$CURRENCY_SIGN_REGEX.test(value)) newValue = -1 * newValue;
|
|
703
|
-
return newValue;
|
|
704
|
-
}
|
|
705
|
-
sanitize(value) {
|
|
706
|
-
let isGroupSymbolAllowed = this.formatter.resolvedOptions().useGrouping;
|
|
707
|
-
if (this.symbols.noNumeralUnits.length > 0 && this.symbols.noNumeralUnits.find((obj) => obj.unit === value)) return this.symbols.noNumeralUnits.find((obj) => obj.unit === value).value.toString();
|
|
708
|
-
value = value.replace(this.symbols.literals, "");
|
|
709
|
-
if (this.symbols.minusSign) value = value.replace("-", this.symbols.minusSign);
|
|
710
|
-
if (this.options.numberingSystem === "arab") {
|
|
711
|
-
if (this.symbols.decimal) {
|
|
712
|
-
value = $eb76cf4feb040f77$var$replaceAll(value, ",", this.symbols.decimal);
|
|
713
|
-
value = $eb76cf4feb040f77$var$replaceAll(value, String.fromCharCode(1548), this.symbols.decimal);
|
|
714
|
-
}
|
|
715
|
-
if (this.symbols.group && isGroupSymbolAllowed) value = $eb76cf4feb040f77$var$replaceAll(value, ".", this.symbols.group);
|
|
716
|
-
}
|
|
717
|
-
if (this.symbols.group === "’" && value.includes("'") && isGroupSymbolAllowed) value = $eb76cf4feb040f77$var$replaceAll(value, "'", this.symbols.group);
|
|
718
|
-
if (this.symbols.group === "'" && value.includes("’") && isGroupSymbolAllowed) value = $eb76cf4feb040f77$var$replaceAll(value, "’", this.symbols.group);
|
|
719
|
-
if (this.options.locale === "fr-FR" && this.symbols.group && isGroupSymbolAllowed) {
|
|
720
|
-
value = $eb76cf4feb040f77$var$replaceAll(value, " ", this.symbols.group);
|
|
721
|
-
value = $eb76cf4feb040f77$var$replaceAll(value, /\u00A0/g, this.symbols.group);
|
|
722
|
-
}
|
|
723
|
-
return value;
|
|
724
|
-
}
|
|
725
|
-
isValidPartialNumber(value, minValue = -Infinity, maxValue = Infinity) {
|
|
726
|
-
let isGroupSymbolAllowed = this.formatter.resolvedOptions().useGrouping;
|
|
727
|
-
value = this.sanitize(value);
|
|
728
|
-
if (this.symbols.minusSign && value.startsWith(this.symbols.minusSign) && minValue < 0) value = value.slice(this.symbols.minusSign.length);
|
|
729
|
-
else if (this.symbols.plusSign && value.startsWith(this.symbols.plusSign) && maxValue > 0) value = value.slice(this.symbols.plusSign.length);
|
|
730
|
-
if (this.symbols.decimal && value.indexOf(this.symbols.decimal) > -1 && this.options.maximumFractionDigits === 0) return false;
|
|
731
|
-
if (this.symbols.group && isGroupSymbolAllowed) value = $eb76cf4feb040f77$var$replaceAll(value, this.symbols.group, "");
|
|
732
|
-
value = value.replace(this.symbols.numeral, "");
|
|
733
|
-
if (this.symbols.decimal) value = value.replace(this.symbols.decimal, "");
|
|
734
|
-
return value.length === 0;
|
|
735
|
-
}
|
|
736
|
-
};
|
|
737
|
-
const $eb76cf4feb040f77$var$nonLiteralParts = /* @__PURE__ */ new Set([
|
|
738
|
-
"decimal",
|
|
739
|
-
"fraction",
|
|
740
|
-
"integer",
|
|
741
|
-
"minusSign",
|
|
742
|
-
"plusSign",
|
|
743
|
-
"group"
|
|
744
|
-
]);
|
|
745
|
-
const $eb76cf4feb040f77$var$pluralNumbers = [
|
|
746
|
-
0,
|
|
747
|
-
4,
|
|
748
|
-
2,
|
|
749
|
-
1,
|
|
750
|
-
11,
|
|
751
|
-
20,
|
|
752
|
-
3,
|
|
753
|
-
7,
|
|
754
|
-
100,
|
|
755
|
-
21,
|
|
756
|
-
.1,
|
|
757
|
-
1.1
|
|
758
|
-
];
|
|
759
|
-
function $eb76cf4feb040f77$var$getSymbols(locale, formatter, intlOptions, originalOptions) {
|
|
760
|
-
let symbolFormatter = new Intl.NumberFormat(locale, {
|
|
761
|
-
...intlOptions,
|
|
762
|
-
minimumSignificantDigits: 1,
|
|
763
|
-
maximumSignificantDigits: 21,
|
|
764
|
-
roundingIncrement: 1,
|
|
765
|
-
roundingPriority: "auto",
|
|
766
|
-
roundingMode: "halfExpand",
|
|
767
|
-
useGrouping: true
|
|
768
|
-
});
|
|
769
|
-
let allParts = symbolFormatter.formatToParts(-10000.111);
|
|
770
|
-
let posAllParts = symbolFormatter.formatToParts(10000.111);
|
|
771
|
-
let pluralParts = $eb76cf4feb040f77$var$pluralNumbers.map((n) => symbolFormatter.formatToParts(n));
|
|
772
|
-
let noNumeralUnits = pluralParts.map((p, i) => {
|
|
773
|
-
let unit = p.find((p) => p.type === "unit");
|
|
774
|
-
if (unit && !p.some((p) => p.type === "integer" || p.type === "fraction")) return {
|
|
775
|
-
unit: unit.value,
|
|
776
|
-
value: $eb76cf4feb040f77$var$pluralNumbers[i]
|
|
777
|
-
};
|
|
778
|
-
return null;
|
|
779
|
-
}).filter((p) => !!p);
|
|
780
|
-
let minusSign = allParts.find((p) => p.type === "minusSign")?.value ?? "-";
|
|
781
|
-
let plusSign = posAllParts.find((p) => p.type === "plusSign")?.value;
|
|
782
|
-
if (!plusSign && (originalOptions?.signDisplay === "exceptZero" || originalOptions?.signDisplay === "always")) plusSign = "+";
|
|
783
|
-
let decimal = new Intl.NumberFormat(locale, {
|
|
784
|
-
...intlOptions,
|
|
785
|
-
minimumFractionDigits: 2,
|
|
786
|
-
maximumFractionDigits: 2
|
|
787
|
-
}).formatToParts(.001).find((p) => p.type === "decimal")?.value;
|
|
788
|
-
let group = allParts.find((p) => p.type === "group")?.value;
|
|
789
|
-
let allPartsLiterals = allParts.filter((p) => !$eb76cf4feb040f77$var$nonLiteralParts.has(p.type)).map((p) => $eb76cf4feb040f77$var$escapeRegex(p.value));
|
|
790
|
-
let pluralPartsLiterals = pluralParts.flatMap((p) => p.filter((p) => !$eb76cf4feb040f77$var$nonLiteralParts.has(p.type)).map((p) => $eb76cf4feb040f77$var$escapeRegex(p.value)));
|
|
791
|
-
let sortedLiterals = [.../* @__PURE__ */ new Set([...allPartsLiterals, ...pluralPartsLiterals])].sort((a, b) => b.length - a.length);
|
|
792
|
-
let literals = sortedLiterals.length === 0 ? /* @__PURE__ */ new RegExp("\\p{White_Space}|\\p{Cf}", "gu") : new RegExp(`${sortedLiterals.join("|")}|\\p{White_Space}|\\p{Cf}`, "gu");
|
|
793
|
-
let numerals = [...new Intl.NumberFormat(intlOptions.locale, { useGrouping: false }).format(9876543210)].reverse();
|
|
794
|
-
let indexes = new Map(numerals.map((d, i) => [d, i]));
|
|
795
|
-
let numeral = new RegExp(`[${numerals.join("")}]`, "g");
|
|
796
|
-
let index = (d) => String(indexes.get(d));
|
|
797
|
-
return {
|
|
798
|
-
minusSign,
|
|
799
|
-
plusSign,
|
|
800
|
-
decimal,
|
|
801
|
-
group,
|
|
802
|
-
literals,
|
|
803
|
-
numeral,
|
|
804
|
-
numerals,
|
|
805
|
-
index,
|
|
806
|
-
noNumeralUnits
|
|
807
|
-
};
|
|
808
|
-
}
|
|
809
|
-
function $eb76cf4feb040f77$var$replaceAll(str, find, replace) {
|
|
810
|
-
if (str.replaceAll) return str.replaceAll(find, replace);
|
|
811
|
-
return str.split(find).join(replace);
|
|
812
|
-
}
|
|
813
|
-
function $eb76cf4feb040f77$var$escapeRegex(string) {
|
|
814
|
-
return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
815
|
-
}
|
|
816
|
-
//#endregion
|
|
817
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/ar-AE.mjs
|
|
818
|
-
var $c03aa2dde3f54f51$exports = {};
|
|
819
|
-
$c03aa2dde3f54f51$exports = { "Empty": `\u{641}\u{627}\u{631}\u{63A}` };
|
|
820
|
-
//#endregion
|
|
821
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/bg-BG.mjs
|
|
822
|
-
var $d612b270ee5ea6ca$exports = {};
|
|
823
|
-
$d612b270ee5ea6ca$exports = { "Empty": `\u{418}\u{437}\u{43F}\u{440}\u{430}\u{437}\u{43D}\u{438}` };
|
|
824
|
-
//#endregion
|
|
825
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/cs-CZ.mjs
|
|
826
|
-
var $9516ade4a4f015ec$exports = {};
|
|
827
|
-
$9516ade4a4f015ec$exports = { "Empty": `Pr\xe1zdn\xe9` };
|
|
828
|
-
//#endregion
|
|
829
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/da-DK.mjs
|
|
830
|
-
var $41d49e6197917be1$exports = {};
|
|
831
|
-
$41d49e6197917be1$exports = { "Empty": `Tom` };
|
|
832
|
-
//#endregion
|
|
833
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/de-DE.mjs
|
|
834
|
-
var $23b4dd964f7cc840$exports = {};
|
|
835
|
-
$23b4dd964f7cc840$exports = { "Empty": `Leer` };
|
|
836
|
-
//#endregion
|
|
837
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/el-GR.mjs
|
|
838
|
-
var $18cf3acc4056ec0e$exports = {};
|
|
839
|
-
$18cf3acc4056ec0e$exports = { "Empty": `\u{386}\u{3B4}\u{3B5}\u{3B9}\u{3BF}` };
|
|
840
|
-
//#endregion
|
|
841
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/en-US.mjs
|
|
842
|
-
var $df59f74ff621f180$exports = {};
|
|
843
|
-
$df59f74ff621f180$exports = { "Empty": `Empty` };
|
|
844
|
-
//#endregion
|
|
845
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/es-ES.mjs
|
|
846
|
-
var $1a750506d5a4610f$exports = {};
|
|
847
|
-
$1a750506d5a4610f$exports = { "Empty": `Vac\xedo` };
|
|
848
|
-
//#endregion
|
|
849
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/et-EE.mjs
|
|
850
|
-
var $8e1ed6a70b6e99d0$exports = {};
|
|
851
|
-
$8e1ed6a70b6e99d0$exports = { "Empty": `T\xfchjenda` };
|
|
852
|
-
//#endregion
|
|
853
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/fi-FI.mjs
|
|
854
|
-
var $bda17b3c68ec60e0$exports = {};
|
|
855
|
-
$bda17b3c68ec60e0$exports = { "Empty": `Tyhj\xe4` };
|
|
856
|
-
//#endregion
|
|
857
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/fr-FR.mjs
|
|
858
|
-
var $dfccc3416d8619f2$exports = {};
|
|
859
|
-
$dfccc3416d8619f2$exports = { "Empty": `Vide` };
|
|
860
|
-
//#endregion
|
|
861
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/he-IL.mjs
|
|
862
|
-
var $03ad7cde4af17dbc$exports = {};
|
|
863
|
-
$03ad7cde4af17dbc$exports = { "Empty": `\u{5E8}\u{5D9}\u{5E7}` };
|
|
864
|
-
//#endregion
|
|
865
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/hr-HR.mjs
|
|
866
|
-
var $3d83efd6529bcc21$exports = {};
|
|
867
|
-
$3d83efd6529bcc21$exports = { "Empty": `Prazno` };
|
|
868
|
-
//#endregion
|
|
869
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/hu-HU.mjs
|
|
870
|
-
var $3cf52fb2bf374b1e$exports = {};
|
|
871
|
-
$3cf52fb2bf374b1e$exports = { "Empty": `\xdcres` };
|
|
872
|
-
//#endregion
|
|
873
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/it-IT.mjs
|
|
874
|
-
var $6a6f2c49f92bd42e$exports = {};
|
|
875
|
-
$6a6f2c49f92bd42e$exports = { "Empty": `Vuoto` };
|
|
876
|
-
//#endregion
|
|
877
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/ja-JP.mjs
|
|
878
|
-
var $3cc0319ead4d5f7a$exports = {};
|
|
879
|
-
$3cc0319ead4d5f7a$exports = { "Empty": `\u{7A7A}` };
|
|
880
|
-
//#endregion
|
|
881
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/ko-KR.mjs
|
|
882
|
-
var $24d65dbbedc50cf8$exports = {};
|
|
883
|
-
$24d65dbbedc50cf8$exports = { "Empty": `\u{BE44}\u{C5B4} \u{C788}\u{C74C}` };
|
|
884
|
-
//#endregion
|
|
885
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/lt-LT.mjs
|
|
886
|
-
var $9022dcf5dfa5b508$exports = {};
|
|
887
|
-
$9022dcf5dfa5b508$exports = { "Empty": `Tu\u{161}\u{10D}ias` };
|
|
888
|
-
//#endregion
|
|
889
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/lv-LV.mjs
|
|
890
|
-
var $6746207c35f8a73d$exports = {};
|
|
891
|
-
$6746207c35f8a73d$exports = { "Empty": `Tuk\u{161}s` };
|
|
892
|
-
//#endregion
|
|
893
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/nb-NO.mjs
|
|
894
|
-
var $e23e2c12aa0580ab$exports = {};
|
|
895
|
-
$e23e2c12aa0580ab$exports = { "Empty": `Tom` };
|
|
896
|
-
//#endregion
|
|
897
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/nl-NL.mjs
|
|
898
|
-
var $7a42c3dae25ebf3e$exports = {};
|
|
899
|
-
$7a42c3dae25ebf3e$exports = { "Empty": `Leeg` };
|
|
900
|
-
//#endregion
|
|
901
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/pl-PL.mjs
|
|
902
|
-
var $f033322c769d9228$exports = {};
|
|
903
|
-
$f033322c769d9228$exports = { "Empty": `Pusty` };
|
|
904
|
-
//#endregion
|
|
905
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/pt-BR.mjs
|
|
906
|
-
var $bff6557112f09a21$exports = {};
|
|
907
|
-
$bff6557112f09a21$exports = { "Empty": `Vazio` };
|
|
908
|
-
//#endregion
|
|
909
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/pt-PT.mjs
|
|
910
|
-
var $69371b06c393f3b9$exports = {};
|
|
911
|
-
$69371b06c393f3b9$exports = { "Empty": `Vazio` };
|
|
912
|
-
//#endregion
|
|
913
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/ro-RO.mjs
|
|
914
|
-
var $76fd2ca03adf7a37$exports = {};
|
|
915
|
-
$76fd2ca03adf7a37$exports = { "Empty": `Gol` };
|
|
916
|
-
//#endregion
|
|
917
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/ru-RU.mjs
|
|
918
|
-
var $fa02fe0d4c09a614$exports = {};
|
|
919
|
-
$fa02fe0d4c09a614$exports = { "Empty": `\u{41D}\u{435} \u{437}\u{430}\u{43F}\u{43E}\u{43B}\u{43D}\u{435}\u{43D}\u{43E}` };
|
|
920
|
-
//#endregion
|
|
921
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/sk-SK.mjs
|
|
922
|
-
var $a240aba809e2b311$exports = {};
|
|
923
|
-
$a240aba809e2b311$exports = { "Empty": `Pr\xe1zdne` };
|
|
924
|
-
//#endregion
|
|
925
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/sl-SI.mjs
|
|
926
|
-
var $2c29d48084ee6251$exports = {};
|
|
927
|
-
$2c29d48084ee6251$exports = { "Empty": `Prazen` };
|
|
928
|
-
//#endregion
|
|
929
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/sr-SP.mjs
|
|
930
|
-
var $254c7eb682749050$exports = {};
|
|
931
|
-
$254c7eb682749050$exports = { "Empty": `Prazno` };
|
|
932
|
-
//#endregion
|
|
933
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/sv-SE.mjs
|
|
934
|
-
var $add997722e4d4b6e$exports = {};
|
|
935
|
-
$add997722e4d4b6e$exports = { "Empty": `Tomt` };
|
|
936
|
-
//#endregion
|
|
937
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/tr-TR.mjs
|
|
938
|
-
var $542f020fc9285606$exports = {};
|
|
939
|
-
$542f020fc9285606$exports = { "Empty": `Bo\u{15F}` };
|
|
940
|
-
//#endregion
|
|
941
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/uk-UA.mjs
|
|
942
|
-
var $3135b03c5e7cb78f$exports = {};
|
|
943
|
-
$3135b03c5e7cb78f$exports = { "Empty": `\u{41F}\u{443}\u{441}\u{442}\u{43E}` };
|
|
944
|
-
//#endregion
|
|
945
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/zh-CN.mjs
|
|
946
|
-
var $29092b8c778be040$exports = {};
|
|
947
|
-
$29092b8c778be040$exports = { "Empty": `\u{7A7A}` };
|
|
948
|
-
//#endregion
|
|
949
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/intl/spinbutton/zh-TW.mjs
|
|
950
|
-
var $94b34635baf16223$exports = {};
|
|
951
|
-
$94b34635baf16223$exports = { "Empty": `\u{7A7A}\u{767D}` };
|
|
952
|
-
//#endregion
|
|
953
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/spinbutton/intlStrings.mjs
|
|
954
|
-
var $6279e3628ec747df$exports = {};
|
|
955
|
-
$6279e3628ec747df$exports = {
|
|
956
|
-
"ar-AE": $c03aa2dde3f54f51$exports,
|
|
957
|
-
"bg-BG": $d612b270ee5ea6ca$exports,
|
|
958
|
-
"cs-CZ": $9516ade4a4f015ec$exports,
|
|
959
|
-
"da-DK": $41d49e6197917be1$exports,
|
|
960
|
-
"de-DE": $23b4dd964f7cc840$exports,
|
|
961
|
-
"el-GR": $18cf3acc4056ec0e$exports,
|
|
962
|
-
"en-US": $df59f74ff621f180$exports,
|
|
963
|
-
"es-ES": $1a750506d5a4610f$exports,
|
|
964
|
-
"et-EE": $8e1ed6a70b6e99d0$exports,
|
|
965
|
-
"fi-FI": $bda17b3c68ec60e0$exports,
|
|
966
|
-
"fr-FR": $dfccc3416d8619f2$exports,
|
|
967
|
-
"he-IL": $03ad7cde4af17dbc$exports,
|
|
968
|
-
"hr-HR": $3d83efd6529bcc21$exports,
|
|
969
|
-
"hu-HU": $3cf52fb2bf374b1e$exports,
|
|
970
|
-
"it-IT": $6a6f2c49f92bd42e$exports,
|
|
971
|
-
"ja-JP": $3cc0319ead4d5f7a$exports,
|
|
972
|
-
"ko-KR": $24d65dbbedc50cf8$exports,
|
|
973
|
-
"lt-LT": $9022dcf5dfa5b508$exports,
|
|
974
|
-
"lv-LV": $6746207c35f8a73d$exports,
|
|
975
|
-
"nb-NO": $e23e2c12aa0580ab$exports,
|
|
976
|
-
"nl-NL": $7a42c3dae25ebf3e$exports,
|
|
977
|
-
"pl-PL": $f033322c769d9228$exports,
|
|
978
|
-
"pt-BR": $bff6557112f09a21$exports,
|
|
979
|
-
"pt-PT": $69371b06c393f3b9$exports,
|
|
980
|
-
"ro-RO": $76fd2ca03adf7a37$exports,
|
|
981
|
-
"ru-RU": $fa02fe0d4c09a614$exports,
|
|
982
|
-
"sk-SK": $a240aba809e2b311$exports,
|
|
983
|
-
"sl-SI": $2c29d48084ee6251$exports,
|
|
984
|
-
"sr-SP": $254c7eb682749050$exports,
|
|
985
|
-
"sv-SE": $add997722e4d4b6e$exports,
|
|
986
|
-
"tr-TR": $542f020fc9285606$exports,
|
|
987
|
-
"uk-UA": $3135b03c5e7cb78f$exports,
|
|
988
|
-
"zh-CN": $29092b8c778be040$exports,
|
|
989
|
-
"zh-TW": $94b34635baf16223$exports
|
|
990
|
-
};
|
|
991
|
-
//#endregion
|
|
992
|
-
//#region ../../node_modules/.bun/react-aria@3.52.1+67f6792bdf102c28/node_modules/react-aria/dist/private/spinbutton/useSpinButton.mjs
|
|
993
|
-
function $parcel$interopDefault(a) {
|
|
994
|
-
return a && a.__esModule ? a.default : a;
|
|
995
|
-
}
|
|
996
|
-
const $757ec6630f26125c$var$noop = () => {};
|
|
997
|
-
function $757ec6630f26125c$export$e908e06f4b8e3402(props) {
|
|
998
|
-
const _async = useRef(void 0);
|
|
999
|
-
let { value, textValue, minValue, maxValue, isDisabled, isReadOnly, isRequired, onIncrement, onIncrementPage, onDecrement, onDecrementPage, onDecrementToMin, onIncrementToMax } = props;
|
|
1000
|
-
const stringFormatter = $cf2482eff2eeeec2$export$f12b703ca79dfbb1($parcel$interopDefault($6279e3628ec747df$exports), "@react-aria/spinbutton");
|
|
1001
|
-
let isSpinning = useRef(false);
|
|
1002
|
-
const clearAsync = useCallback(() => {
|
|
1003
|
-
clearTimeout(_async.current);
|
|
1004
|
-
isSpinning.current = false;
|
|
1005
|
-
}, []);
|
|
1006
|
-
const clearAsyncEvent = $fe16bffc7a557bf0$export$7f54fc3180508a52(() => {
|
|
1007
|
-
clearAsync();
|
|
1008
|
-
});
|
|
1009
|
-
useEffect(() => {
|
|
1010
|
-
return () => clearAsyncEvent();
|
|
1011
|
-
}, []);
|
|
1012
|
-
let { keyboardProps } = $8296dad1a4c5e0dc$export$8f71654801c2f7cd({
|
|
1013
|
-
isDisabled: isDisabled || isReadOnly,
|
|
1014
|
-
shortcuts: {
|
|
1015
|
-
PageUp: () => {
|
|
1016
|
-
if (onIncrementPage) {
|
|
1017
|
-
onIncrementPage();
|
|
1018
|
-
return;
|
|
1019
|
-
}
|
|
1020
|
-
if (onIncrement) {
|
|
1021
|
-
onIncrement();
|
|
1022
|
-
return;
|
|
1023
|
-
}
|
|
1024
|
-
return false;
|
|
1025
|
-
},
|
|
1026
|
-
ArrowUp: () => {
|
|
1027
|
-
if (onIncrement) {
|
|
1028
|
-
onIncrement();
|
|
1029
|
-
return;
|
|
1030
|
-
}
|
|
1031
|
-
return false;
|
|
1032
|
-
},
|
|
1033
|
-
PageDown: () => {
|
|
1034
|
-
if (onDecrementPage) {
|
|
1035
|
-
onDecrementPage();
|
|
1036
|
-
return;
|
|
1037
|
-
}
|
|
1038
|
-
if (onDecrement) {
|
|
1039
|
-
onDecrement();
|
|
1040
|
-
return;
|
|
1041
|
-
}
|
|
1042
|
-
return false;
|
|
1043
|
-
},
|
|
1044
|
-
ArrowDown: () => {
|
|
1045
|
-
if (onDecrement) {
|
|
1046
|
-
onDecrement();
|
|
1047
|
-
return;
|
|
1048
|
-
}
|
|
1049
|
-
return false;
|
|
1050
|
-
},
|
|
1051
|
-
Home: () => {
|
|
1052
|
-
if (onDecrementToMin) {
|
|
1053
|
-
onDecrementToMin();
|
|
1054
|
-
return;
|
|
1055
|
-
}
|
|
1056
|
-
return false;
|
|
1057
|
-
},
|
|
1058
|
-
End: () => {
|
|
1059
|
-
if (onIncrementToMax) {
|
|
1060
|
-
onIncrementToMax();
|
|
1061
|
-
return;
|
|
1062
|
-
}
|
|
1063
|
-
return false;
|
|
1064
|
-
}
|
|
1065
|
-
},
|
|
1066
|
-
allowRepeats: true
|
|
1067
|
-
});
|
|
1068
|
-
let isFocused = useRef(false);
|
|
1069
|
-
let onFocus = () => {
|
|
1070
|
-
isFocused.current = true;
|
|
1071
|
-
};
|
|
1072
|
-
let onBlur = () => {
|
|
1073
|
-
isFocused.current = false;
|
|
1074
|
-
};
|
|
1075
|
-
let ariaTextValue = textValue === "" ? stringFormatter.format("Empty") : (textValue || `${value}`).replace("-", "−");
|
|
1076
|
-
useEffect(() => {
|
|
1077
|
-
if (isFocused.current) {
|
|
1078
|
-
$a46cf152bb926da5$export$d10ae4f68404609a("assertive");
|
|
1079
|
-
$a46cf152bb926da5$export$a9b970dcc4ae71a9(ariaTextValue, "assertive");
|
|
1080
|
-
}
|
|
1081
|
-
}, [ariaTextValue]);
|
|
1082
|
-
let onPointerCancel = useCallback(() => {
|
|
1083
|
-
clearAsync();
|
|
1084
|
-
}, [clearAsync]);
|
|
1085
|
-
const onIncrementEvent = $fe16bffc7a557bf0$export$7f54fc3180508a52(onIncrement ?? $757ec6630f26125c$var$noop);
|
|
1086
|
-
const onDecrementEvent = $fe16bffc7a557bf0$export$7f54fc3180508a52(onDecrement ?? $757ec6630f26125c$var$noop);
|
|
1087
|
-
const stepUpEvent = $fe16bffc7a557bf0$export$7f54fc3180508a52(() => {
|
|
1088
|
-
if (maxValue === void 0 || isNaN(maxValue) || value === void 0 || isNaN(value) || value < maxValue) {
|
|
1089
|
-
onIncrementEvent();
|
|
1090
|
-
onIncrementPressStartEvent(60);
|
|
1091
|
-
}
|
|
1092
|
-
});
|
|
1093
|
-
const onIncrementPressStartEvent = $fe16bffc7a557bf0$export$7f54fc3180508a52((initialStepDelay) => {
|
|
1094
|
-
clearAsyncEvent();
|
|
1095
|
-
isSpinning.current = true;
|
|
1096
|
-
_async.current = window.setTimeout(stepUpEvent, initialStepDelay);
|
|
1097
|
-
});
|
|
1098
|
-
const stepDownEvent = $fe16bffc7a557bf0$export$7f54fc3180508a52(() => {
|
|
1099
|
-
if (minValue === void 0 || isNaN(minValue) || value === void 0 || isNaN(value) || value > minValue) {
|
|
1100
|
-
onDecrementEvent();
|
|
1101
|
-
onDecrementPressStartEvent(60);
|
|
1102
|
-
}
|
|
1103
|
-
});
|
|
1104
|
-
const onDecrementPressStartEvent = $fe16bffc7a557bf0$export$7f54fc3180508a52((initialStepDelay) => {
|
|
1105
|
-
clearAsyncEvent();
|
|
1106
|
-
isSpinning.current = true;
|
|
1107
|
-
_async.current = window.setTimeout(stepDownEvent, initialStepDelay);
|
|
1108
|
-
});
|
|
1109
|
-
let cancelContextMenu = (e) => {
|
|
1110
|
-
e.preventDefault();
|
|
1111
|
-
};
|
|
1112
|
-
let { addGlobalListener, removeAllGlobalListeners } = $48a7d519b337145d$export$4eaf04e54aa8eed6();
|
|
1113
|
-
let isUp = useRef(false);
|
|
1114
|
-
let [isIncrementPressed, setIsIncrementPressed] = useState(null);
|
|
1115
|
-
useEffect(() => {
|
|
1116
|
-
if (isIncrementPressed === "touch") onIncrementPressStartEvent(600);
|
|
1117
|
-
else if (isIncrementPressed) onIncrementPressStartEvent(400);
|
|
1118
|
-
else if (!isIncrementPressed) clearAsyncEvent();
|
|
1119
|
-
}, [isIncrementPressed]);
|
|
1120
|
-
let [isDecrementPressed, setIsDecrementPressed] = useState(null);
|
|
1121
|
-
useEffect(() => {
|
|
1122
|
-
if (isDecrementPressed === "touch") onDecrementPressStartEvent(600);
|
|
1123
|
-
else if (isDecrementPressed) onDecrementPressStartEvent(400);
|
|
1124
|
-
else if (!isDecrementPressed) clearAsyncEvent();
|
|
1125
|
-
}, [isDecrementPressed]);
|
|
1126
|
-
return {
|
|
1127
|
-
spinButtonProps: {
|
|
1128
|
-
role: "spinbutton",
|
|
1129
|
-
"aria-valuenow": value !== void 0 && !isNaN(value) ? value : void 0,
|
|
1130
|
-
"aria-valuetext": ariaTextValue,
|
|
1131
|
-
"aria-valuemin": minValue,
|
|
1132
|
-
"aria-valuemax": maxValue,
|
|
1133
|
-
"aria-disabled": isDisabled || void 0,
|
|
1134
|
-
"aria-readonly": isReadOnly || void 0,
|
|
1135
|
-
"aria-required": isRequired || void 0,
|
|
1136
|
-
...keyboardProps,
|
|
1137
|
-
onFocus,
|
|
1138
|
-
onBlur
|
|
1139
|
-
},
|
|
1140
|
-
incrementButtonProps: {
|
|
1141
|
-
onPressStart: (e) => {
|
|
1142
|
-
clearAsync();
|
|
1143
|
-
if (e.pointerType !== "touch") {
|
|
1144
|
-
onIncrement?.();
|
|
1145
|
-
setIsIncrementPressed("mouse");
|
|
1146
|
-
} else {
|
|
1147
|
-
addGlobalListener(window, "pointercancel", onPointerCancel, { capture: true });
|
|
1148
|
-
isUp.current = false;
|
|
1149
|
-
setIsIncrementPressed("touch");
|
|
1150
|
-
}
|
|
1151
|
-
addGlobalListener(window, "contextmenu", cancelContextMenu);
|
|
1152
|
-
},
|
|
1153
|
-
onPressUp: (e) => {
|
|
1154
|
-
clearAsync();
|
|
1155
|
-
if (e.pointerType === "touch") isUp.current = true;
|
|
1156
|
-
removeAllGlobalListeners();
|
|
1157
|
-
setIsIncrementPressed(null);
|
|
1158
|
-
},
|
|
1159
|
-
onPressEnd: (e) => {
|
|
1160
|
-
clearAsync();
|
|
1161
|
-
if (e.pointerType === "touch") {
|
|
1162
|
-
if (!isSpinning.current && isUp.current) onIncrement?.();
|
|
1163
|
-
}
|
|
1164
|
-
isUp.current = false;
|
|
1165
|
-
setIsIncrementPressed(null);
|
|
1166
|
-
},
|
|
1167
|
-
onFocus,
|
|
1168
|
-
onBlur
|
|
1169
|
-
},
|
|
1170
|
-
decrementButtonProps: {
|
|
1171
|
-
onPressStart: (e) => {
|
|
1172
|
-
clearAsync();
|
|
1173
|
-
if (e.pointerType !== "touch") {
|
|
1174
|
-
onDecrement?.();
|
|
1175
|
-
setIsDecrementPressed("mouse");
|
|
1176
|
-
} else {
|
|
1177
|
-
addGlobalListener(window, "pointercancel", onPointerCancel, { capture: true });
|
|
1178
|
-
isUp.current = false;
|
|
1179
|
-
setIsDecrementPressed("touch");
|
|
1180
|
-
}
|
|
1181
|
-
},
|
|
1182
|
-
onPressUp: (e) => {
|
|
1183
|
-
clearAsync();
|
|
1184
|
-
if (e.pointerType === "touch") isUp.current = true;
|
|
1185
|
-
removeAllGlobalListeners();
|
|
1186
|
-
setIsDecrementPressed(null);
|
|
1187
|
-
},
|
|
1188
|
-
onPressEnd: (e) => {
|
|
1189
|
-
clearAsync();
|
|
1190
|
-
if (e.pointerType === "touch") {
|
|
1191
|
-
if (!isSpinning.current && isUp.current) onDecrement?.();
|
|
1192
|
-
}
|
|
1193
|
-
isUp.current = false;
|
|
1194
|
-
setIsDecrementPressed(null);
|
|
1195
|
-
},
|
|
1196
|
-
onFocus,
|
|
1197
|
-
onBlur
|
|
1198
|
-
}
|
|
1199
|
-
};
|
|
1200
|
-
}
|
|
1201
|
-
//#endregion
|
|
1202
|
-
//#region ../../node_modules/.bun/react-stately@3.50.0+83d5fd7b249dbeef/node_modules/react-stately/dist/private/form/useFormValidationState.mjs
|
|
1203
|
-
const $fd2148440a13ec26$export$aca958c65c314e6c = {
|
|
1204
|
-
badInput: false,
|
|
1205
|
-
customError: false,
|
|
1206
|
-
patternMismatch: false,
|
|
1207
|
-
rangeOverflow: false,
|
|
1208
|
-
rangeUnderflow: false,
|
|
1209
|
-
stepMismatch: false,
|
|
1210
|
-
tooLong: false,
|
|
1211
|
-
tooShort: false,
|
|
1212
|
-
typeMismatch: false,
|
|
1213
|
-
valueMissing: false,
|
|
1214
|
-
valid: true
|
|
1215
|
-
};
|
|
1216
|
-
const $fd2148440a13ec26$var$CUSTOM_VALIDITY_STATE = {
|
|
1217
|
-
...$fd2148440a13ec26$export$aca958c65c314e6c,
|
|
1218
|
-
customError: true,
|
|
1219
|
-
valid: false
|
|
1220
|
-
};
|
|
1221
|
-
const $fd2148440a13ec26$export$dad6ae84456c676a = {
|
|
1222
|
-
isInvalid: false,
|
|
1223
|
-
validationDetails: $fd2148440a13ec26$export$aca958c65c314e6c,
|
|
1224
|
-
validationErrors: []
|
|
1225
|
-
};
|
|
1226
|
-
const $fd2148440a13ec26$export$571b5131b7e65c11 = createContext({});
|
|
1227
|
-
const $fd2148440a13ec26$export$a763b9476acd3eb = "__reactAriaFormValidationState";
|
|
1228
|
-
function $fd2148440a13ec26$export$fc1a364ae1f3ff10(props) {
|
|
1229
|
-
if (props["__reactAriaFormValidationState"]) {
|
|
1230
|
-
let { realtimeValidation, displayValidation, updateValidation, resetValidation, commitValidation } = props[$fd2148440a13ec26$export$a763b9476acd3eb];
|
|
1231
|
-
return {
|
|
1232
|
-
realtimeValidation,
|
|
1233
|
-
displayValidation,
|
|
1234
|
-
updateValidation,
|
|
1235
|
-
resetValidation,
|
|
1236
|
-
commitValidation
|
|
1237
|
-
};
|
|
1238
|
-
}
|
|
1239
|
-
return $fd2148440a13ec26$var$useFormValidationStateImpl(props);
|
|
1240
|
-
}
|
|
1241
|
-
function $fd2148440a13ec26$var$useFormValidationStateImpl(props) {
|
|
1242
|
-
let { isInvalid, validationState, name, value, builtinValidation, validate, validationBehavior = "aria" } = props;
|
|
1243
|
-
if (validationState) isInvalid ||= validationState === "invalid";
|
|
1244
|
-
let controlledError = isInvalid !== void 0 ? {
|
|
1245
|
-
isInvalid,
|
|
1246
|
-
validationErrors: [],
|
|
1247
|
-
validationDetails: $fd2148440a13ec26$var$CUSTOM_VALIDITY_STATE
|
|
1248
|
-
} : null;
|
|
1249
|
-
let clientError = useMemo(() => {
|
|
1250
|
-
if (!validate || value == null) return null;
|
|
1251
|
-
return $fd2148440a13ec26$var$getValidationResult($fd2148440a13ec26$var$runValidate(validate, value));
|
|
1252
|
-
}, [validate, value]);
|
|
1253
|
-
if (builtinValidation?.validationDetails.valid) builtinValidation = void 0;
|
|
1254
|
-
let serverErrors = useContext($fd2148440a13ec26$export$571b5131b7e65c11);
|
|
1255
|
-
let serverErrorMessages = useMemo(() => {
|
|
1256
|
-
if (name) return Array.isArray(name) ? name.flatMap((name) => $fd2148440a13ec26$var$asArray(serverErrors[name])) : $fd2148440a13ec26$var$asArray(serverErrors[name]);
|
|
1257
|
-
return [];
|
|
1258
|
-
}, [serverErrors, name]);
|
|
1259
|
-
let [lastServerErrors, setLastServerErrors] = useState(serverErrors);
|
|
1260
|
-
let [isServerErrorCleared, setServerErrorCleared] = useState(false);
|
|
1261
|
-
if (serverErrors !== lastServerErrors) {
|
|
1262
|
-
setLastServerErrors(serverErrors);
|
|
1263
|
-
setServerErrorCleared(false);
|
|
1264
|
-
}
|
|
1265
|
-
let serverError = useMemo(() => $fd2148440a13ec26$var$getValidationResult(isServerErrorCleared ? [] : serverErrorMessages), [isServerErrorCleared, serverErrorMessages]);
|
|
1266
|
-
let nextValidation = useRef($fd2148440a13ec26$export$dad6ae84456c676a);
|
|
1267
|
-
let [currentValidity, setCurrentValidity] = useState($fd2148440a13ec26$export$dad6ae84456c676a);
|
|
1268
|
-
let lastError = useRef($fd2148440a13ec26$export$dad6ae84456c676a);
|
|
1269
|
-
let commitValidation = () => {
|
|
1270
|
-
if (!commitQueued) return;
|
|
1271
|
-
setCommitQueued(false);
|
|
1272
|
-
let error = clientError || builtinValidation || nextValidation.current;
|
|
1273
|
-
if (!$fd2148440a13ec26$var$isEqualValidation(error, lastError.current)) {
|
|
1274
|
-
lastError.current = error;
|
|
1275
|
-
setCurrentValidity(error);
|
|
1276
|
-
}
|
|
1277
|
-
};
|
|
1278
|
-
let [commitQueued, setCommitQueued] = useState(false);
|
|
1279
|
-
useEffect(commitValidation);
|
|
1280
|
-
return {
|
|
1281
|
-
realtimeValidation: controlledError || serverError || clientError || builtinValidation || $fd2148440a13ec26$export$dad6ae84456c676a,
|
|
1282
|
-
displayValidation: validationBehavior === "native" ? controlledError || serverError || currentValidity : controlledError || serverError || clientError || builtinValidation || currentValidity,
|
|
1283
|
-
updateValidation(value) {
|
|
1284
|
-
if (validationBehavior === "aria" && !$fd2148440a13ec26$var$isEqualValidation(currentValidity, value)) setCurrentValidity(value);
|
|
1285
|
-
else nextValidation.current = value;
|
|
1286
|
-
},
|
|
1287
|
-
resetValidation() {
|
|
1288
|
-
let error = $fd2148440a13ec26$export$dad6ae84456c676a;
|
|
1289
|
-
if (!$fd2148440a13ec26$var$isEqualValidation(error, lastError.current)) {
|
|
1290
|
-
lastError.current = error;
|
|
1291
|
-
setCurrentValidity(error);
|
|
1292
|
-
}
|
|
1293
|
-
if (validationBehavior === "native") setCommitQueued(false);
|
|
1294
|
-
setServerErrorCleared(true);
|
|
1295
|
-
},
|
|
1296
|
-
commitValidation() {
|
|
1297
|
-
if (validationBehavior === "native") setCommitQueued(true);
|
|
1298
|
-
setServerErrorCleared(true);
|
|
1299
|
-
}
|
|
1300
|
-
};
|
|
1301
|
-
}
|
|
1302
|
-
function $fd2148440a13ec26$var$asArray(v) {
|
|
1303
|
-
if (!v) return [];
|
|
1304
|
-
return Array.isArray(v) ? v : [v];
|
|
1305
|
-
}
|
|
1306
|
-
function $fd2148440a13ec26$var$runValidate(validate, value) {
|
|
1307
|
-
if (typeof validate === "function") {
|
|
1308
|
-
let e = validate(value);
|
|
1309
|
-
if (e && typeof e !== "boolean") return $fd2148440a13ec26$var$asArray(e);
|
|
1310
|
-
}
|
|
1311
|
-
return [];
|
|
1312
|
-
}
|
|
1313
|
-
function $fd2148440a13ec26$var$getValidationResult(errors) {
|
|
1314
|
-
return errors.length ? {
|
|
1315
|
-
isInvalid: true,
|
|
1316
|
-
validationErrors: errors,
|
|
1317
|
-
validationDetails: $fd2148440a13ec26$var$CUSTOM_VALIDITY_STATE
|
|
1318
|
-
} : null;
|
|
1319
|
-
}
|
|
1320
|
-
function $fd2148440a13ec26$var$isEqualValidation(a, b) {
|
|
1321
|
-
if (a === b) return true;
|
|
1322
|
-
return !!a && !!b && a.isInvalid === b.isInvalid && a.validationErrors.length === b.validationErrors.length && a.validationErrors.every((a, i) => a === b.validationErrors[i]) && Object.entries(a.validationDetails).every(([k, v]) => b.validationDetails[k] === v);
|
|
1323
|
-
}
|
|
1324
|
-
function $fd2148440a13ec26$export$75ee7c75d68f5b0e(...results) {
|
|
1325
|
-
let errors = /* @__PURE__ */ new Set();
|
|
1326
|
-
let isInvalid = false;
|
|
1327
|
-
let validationDetails = { ...$fd2148440a13ec26$export$aca958c65c314e6c };
|
|
1328
|
-
for (let v of results) {
|
|
1329
|
-
for (let e of v.validationErrors) errors.add(e);
|
|
1330
|
-
isInvalid ||= v.isInvalid;
|
|
1331
|
-
for (let key in validationDetails) validationDetails[key] ||= v.validationDetails[key];
|
|
1332
|
-
}
|
|
1333
|
-
validationDetails.valid = !isInvalid;
|
|
1334
|
-
return {
|
|
1335
|
-
isInvalid,
|
|
1336
|
-
validationErrors: [...errors],
|
|
1337
|
-
validationDetails
|
|
1338
|
-
};
|
|
1339
|
-
}
|
|
1340
|
-
//#endregion
|
|
1341
|
-
export { $e8ac3c3f5d4bae7f$export$d6875122194c7b44 as _, $eb76cf4feb040f77$export$cd11ab140839f11d as a, $191c9b6d48a0a4e2$export$294aa081a6c6f55d as c, $a46cf152bb926da5$export$a9b970dcc4ae71a9 as d, $48a7d519b337145d$export$4eaf04e54aa8eed6 as f, $a747a10fe70a57da$export$c17fa47878dc55b6 as g, $b27c684a33948c64$export$2f817fcdc4b89ae0 as h, $757ec6630f26125c$export$e908e06f4b8e3402 as i, $860f7da480e22816$export$b8473d3665f3a75a as l, $cf2482eff2eeeec2$export$f12b703ca79dfbb1 as m, $fd2148440a13ec26$export$aca958c65c314e6c as n, $1dfb119a85e764e5$export$cc77c4ff7e8673c5 as o, $cf2482eff2eeeec2$export$87b761675e8eaa10 as p, $fd2148440a13ec26$export$fc1a364ae1f3ff10 as r, $2c9edc598a03d523$export$420e68273165f4ec as s, $fd2148440a13ec26$export$75ee7c75d68f5b0e as t, $3274bf1495747a7b$export$5add1d006293d136 as u, $600b3cf69ae46262$export$90fc3a17d93f704c as v, $fe16bffc7a557bf0$export$7f54fc3180508a52 as y };
|