@eightshift/ui-components 7.2.1 → 7.3.0
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/Autocomplete-pLMPWMFq.js +451 -0
- package/dist/Button-Biwg7zwt.js +223 -0
- package/dist/Dialog-C1sh8jbh.js +2474 -0
- package/dist/{Disclosure-NYWFw9RJ.js → Disclosure-B_SHgiUz.js} +50 -51
- package/dist/FocusScope-lGkM8AO8.js +734 -0
- package/dist/Form-BxIJCHYd.js +5 -0
- package/dist/Heading-B2EsUuu6.js +16 -0
- package/dist/{Hidden-8TB37dpK.js → Hidden-DYY00jLm.js} +10 -10
- package/dist/I18nProvider-Cm6dj5jY.js +93 -0
- package/dist/Label-B1TkoVOG.js +17 -0
- package/dist/ListBox-BquE0m8z.js +584 -0
- package/dist/{NumberFormatter-m5VW6MTK.js → NumberFormatter-JHF0Tadk.js} +24 -26
- package/dist/PortalProvider-BYcv24il.js +13 -0
- package/dist/RadioGroup-BxjLooWU.js +324 -0
- package/dist/SearchField-BkAU0HLm.js +322 -0
- package/dist/SelectionIndicator-Bx_EYBXD.js +13 -0
- package/dist/{Slider-DW1RuMVp.js → Slider-DSv6fyZ6.js} +321 -363
- package/dist/Text-C8pfwn0W.js +16 -0
- package/dist/{VisuallyHidden-CfsnJHZb.js → VisuallyHidden-KcXlGa5p.js} +12 -12
- package/dist/{animation-Bd2peown.js → animation-BJ-2VKdB.js} +12 -12
- package/dist/assets/style-admin.css +1 -1
- package/dist/assets/style-editor.css +1 -1
- package/dist/assets/style.css +1 -1
- package/dist/{button-D9cbyHeZ.js → button-CawAzlko.js} +21 -73
- package/dist/{checkbox-BO5RZmO8.js → checkbox-t7VrqXv2.js} +59 -62
- package/dist/{color-swatch-D2ZBkuTt.js → color-swatch-gU09x9Ga.js} +417 -414
- package/dist/components/base-control/base-control.js +2 -2
- package/dist/components/base-control/container.js +1 -1
- package/dist/components/breakpoint-preview/breakpoint-preview.js +1 -1
- package/dist/components/button/button.js +1 -1
- package/dist/components/checkbox/checkbox.js +1 -1
- package/dist/components/color-pickers/color-picker.js +2 -2
- package/dist/components/color-pickers/color-swatch.js +1 -1
- package/dist/components/color-pickers/gradient-editor.js +1 -1
- package/dist/components/color-pickers/solid-color-picker.js +1 -1
- package/dist/components/component-toggle/component-toggle.js +4 -4
- package/dist/components/container-panel/container-panel.js +5 -5
- package/dist/components/draggable/draggable-handle.js +1 -1
- package/dist/components/draggable/draggable.js +1 -1
- package/dist/components/draggable-list/draggable-list-item.js +1 -1
- package/dist/components/draggable-list/draggable-list.js +2 -2
- package/dist/components/expandable/expandable.js +7 -7
- package/dist/components/index.js +15 -15
- package/dist/components/input-field/input-field.js +1 -1
- package/dist/components/item-collection/item-collection.js +1 -1
- package/dist/components/link-input/link-input.js +1 -1
- package/dist/components/matrix-align/matrix-align.js +5 -5
- package/dist/components/menu/menu.js +11 -11
- package/dist/components/modal/modal.js +1 -1
- package/dist/components/number-picker/number-picker.js +1 -1
- package/dist/components/option-select/option-select.js +3 -3
- package/dist/components/options-panel/options-panel.js +3 -3
- package/dist/components/placeholders/file-picker-shell.js +1 -1
- package/dist/components/placeholders/file-placeholder.js +1 -1
- package/dist/components/popover/popover.js +6 -6
- package/dist/components/portal-provider/portal-provider.js +2 -2
- package/dist/components/radio/radio.js +9 -9
- package/dist/components/repeater/repeater-item.js +2 -2
- package/dist/components/repeater/repeater.js +3 -3
- package/dist/components/responsive/mini-responsive.js +6 -6
- package/dist/components/responsive/responsive-legacy.js +5 -5
- package/dist/components/responsive/responsive.js +5 -5
- package/dist/components/responsive-preview/responsive-preview.js +2 -2
- package/dist/components/select/async-multi-select.js +27 -26
- package/dist/components/select/async-select.js +27 -26
- package/dist/components/select/multi-select.js +33 -32
- package/dist/components/select/shared.js +1 -1
- package/dist/components/select/single-select.js +33 -32
- package/dist/components/select/styles.js +1 -1
- package/dist/components/slider/column-config-slider.js +8 -8
- package/dist/components/slider/slider.js +8 -8
- package/dist/components/slider/utils.js +1 -1
- package/dist/components/smart-image/smart-image.js +1 -1
- package/dist/components/tabs/tabs.js +1 -1
- package/dist/components/toggle/switch.js +1 -1
- package/dist/components/toggle/toggle.js +3 -3
- package/dist/components/toggle-button/toggle-button.js +1 -1
- package/dist/components/tooltip/tooltip.js +1 -1
- package/dist/{draggable-CTDVJ4zd.js → draggable-Cxv-OueQ.js} +1 -1
- package/dist/filterDOMProps-BfW758QC.js +69 -0
- package/dist/{gradient-editor-CD5Sho6A.js → gradient-editor-CInqVF8v.js} +6 -6
- package/dist/icons/index.js +1 -1
- package/dist/icons/jsx-svg.js +1 -1
- package/dist/index.js +15 -15
- package/dist/{input-field-_OCWbftf.js → input-field-BdFrxQ-R.js} +46 -47
- package/dist/keyboard-CT41mQzR.js +55 -0
- package/dist/{link-input-BnjtzMbF.js → link-input-BDFhSSvH.js} +324 -356
- package/dist/{modal-snrElwty.js → modal-CJDaBdPh.js} +100 -92
- package/dist/{number-ZZIxJukn.js → number-MWRvGfyE.js} +10 -10
- package/dist/{number-picker-Dhtx4409.js → number-picker-BrxrB-xq.js} +43 -42
- package/dist/{shared-BpAYSi3F.js → shared-CI4kcnm8.js} +482 -502
- package/dist/{smart-image-CBNbxJ57.js → smart-image-eGdMu9s9.js} +2 -2
- package/dist/{solid-color-picker-DukArNH-.js → solid-color-picker-DXgX-OAm.js} +926 -935
- package/dist/{switch-DmsvyQPa.js → switch-DNHFoCCx.js} +28 -28
- package/dist/{tabs-Cy6gB0RL.js → tabs-C2tPOEYr.js} +145 -149
- package/dist/textSelection-BhX_2zV9.js +45 -0
- package/dist/{toggle-button-BlzUGfGy.js → toggle-button-DYDp11rq.js} +35 -35
- package/dist/{tooltip-BzJzYlcc.js → tooltip-C-hT6tN9.js} +162 -162
- package/dist/{useAsyncList-BNzwKoX4.js → useAsyncList-DsOh1xIx.js} +54 -74
- package/dist/{useButton-ra1ZSZ4z.js → useButton-BMZc4fTX.js} +11 -11
- package/dist/{SelectionManager-B8lLv6Ue.js → useCollection-CBVYSuGz.js} +1689 -1777
- package/dist/{useEvent-DkZVfgsS.js → useEvent-ypAU33vv.js} +5 -5
- package/dist/useField-BXf__jxy.js +32 -0
- package/dist/{useFilter-OiMnf6sb.js → useFilter-CfKEbIwL.js} +5 -5
- package/dist/{useFocusRing-DuYL4cdO.js → useFocusRing-BgYY-7ko.js} +23 -23
- package/dist/useFormReset-BuMc_O4y.js +17 -0
- package/dist/{FieldError-BWDbP5Db.js → useFormValidation-BcME9D0E.js} +63 -66
- package/dist/useHover-lyApu3ba.js +975 -0
- package/dist/{useLabel-2EohW5l6.js → useLabel-Rv8cIIKk.js} +8 -8
- package/dist/{useLabels-B2p7RXi5.js → useLabels-xOYtkA8o.js} +5 -5
- package/dist/useListState-u6DfeXHi.js +135 -0
- package/dist/{useLocalizedStringFormatter-Dv2diN3k.js → useLocalizedStringFormatter-CR-bmorj.js} +45 -45
- package/dist/{useNumberField-2xbi3jRV.js → useNumberFieldState-xL-ecwNz.js} +665 -619
- package/dist/useNumberFormatter-CR1PAFPG.js +10 -0
- package/dist/useOverlayTriggerState-AeCx45Gv.js +551 -0
- package/dist/usePress-Dnx5rBoD.js +593 -0
- package/dist/useTextField-BW3ZwGyz.js +159 -0
- package/dist/{useToggle-ecIirvIM.js → useToggle-BF5wptMP.js} +19 -20
- package/dist/useToggleState-D5P01lch.js +22 -0
- package/dist/useToolbar-BT25-MJg.js +55 -0
- package/dist/utilities/debounce-throttle.js +1 -1
- package/dist/utilities/es-dash.js +1 -1
- package/dist/utilities/index.js +3 -3
- package/dist/{utils-B_uiqNa4.js → utils-JFcCNFzy.js} +121 -122
- package/package.json +13 -13
- package/dist/Button-h6xF_WrP.js +0 -225
- package/dist/Dialog-i5VLQw1o.js +0 -2488
- package/dist/FocusScope-CgwbGOBB.js +0 -746
- package/dist/Form-DTMkbrQY.js +0 -5
- package/dist/Heading-Hol-wS_B.js +0 -16
- package/dist/Input-BURqyJXW.js +0 -161
- package/dist/Label-DFXXxMKY.js +0 -17
- package/dist/ListBox-BHUJxpwh.js +0 -600
- package/dist/OverlayArrow-BoloUPQM.js +0 -573
- package/dist/PortalProvider-DinZZCKX.js +0 -14
- package/dist/RSPContexts-C_z0bI8W.js +0 -12
- package/dist/RadioGroup-BwlGtCja.js +0 -329
- package/dist/SearchField-Cm1i5mLj.js +0 -764
- package/dist/SelectionIndicator-31L6EI9F.js +0 -13
- package/dist/Text-O6VBBDlP.js +0 -16
- package/dist/context-C-XNeJ_l.js +0 -93
- package/dist/filterDOMProps-_2_3GD-K.js +0 -69
- package/dist/textSelection-Dv6WPj0Z.js +0 -45
- package/dist/useField-D0WrzR2F.js +0 -32
- package/dist/useFormReset-DdkykzAn.js +0 -18
- package/dist/useHover-qaMm3XFO.js +0 -982
- package/dist/useListState-CD_5vfyy.js +0 -147
- package/dist/useNumberFormatter-C2Cm2mNj.js +0 -10
- package/dist/usePress-ZP1TjkFf.js +0 -678
- package/dist/useToggleState-IIDbiKPl.js +0 -23
- /package/dist/{List-DWlgW2Ex.js → List---tsVJlI.js} +0 -0
- /package/dist/{build-module-Bsx62nlm.js → build-module-K6vi4xE0.js} +0 -0
- /package/dist/{debounce-throttle-DXxSAKpq.js → debounce-throttle-LSPAPFtq.js} +0 -0
- /package/dist/{dist-2gkv7_1U.js → dist-jw8wvxoG.js} +0 -0
- /package/dist/{es-dash-HqXWZZ3_.js → es-dash-BuShf_ht.js} +0 -0
- /package/dist/{jsx-svg-DgKbriN1.js → jsx-svg-DT1SBWuP.js} +0 -0
- /package/dist/{utilities-lwX686oD.js → utilities-DV0KKJNR.js} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { f as $fe16bffc7a557bf0$export$7f54fc3180508a52 } from "./useHover-lyApu3ba.js";
|
|
2
2
|
import { useEffect } from "react";
|
|
3
|
-
//#region node_modules
|
|
4
|
-
function $
|
|
5
|
-
let handleEvent = $
|
|
3
|
+
//#region node_modules/react-aria/dist/private/utils/useEvent.mjs
|
|
4
|
+
function $600b3cf69ae46262$export$90fc3a17d93f704c(ref, event, handler, options) {
|
|
5
|
+
let handleEvent = $fe16bffc7a557bf0$export$7f54fc3180508a52(handler);
|
|
6
6
|
let isDisabled = handler == null;
|
|
7
7
|
useEffect(() => {
|
|
8
8
|
if (isDisabled || !ref.current) return;
|
|
@@ -19,4 +19,4 @@ function $e9faafb641e167db$export$90fc3a17d93f704c(ref, event, handler, options)
|
|
|
19
19
|
]);
|
|
20
20
|
}
|
|
21
21
|
//#endregion
|
|
22
|
-
export { $
|
|
22
|
+
export { $600b3cf69ae46262$export$90fc3a17d93f704c as t };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { f as $390e54f620492c70$export$b4cc09c592e8fdb8, u as $bbaa08b3cd72f041$export$9d1611c77c2fe928 } from "./utils-JFcCNFzy.js";
|
|
2
|
+
import { t as $0beb20c9744a2065$export$8467354a121f1b9f } from "./useLabel-Rv8cIIKk.js";
|
|
3
|
+
//#region node_modules/react-aria/dist/private/label/useField.mjs
|
|
4
|
+
function $191c9b6d48a0a4e2$export$294aa081a6c6f55d(props) {
|
|
5
|
+
let { description, errorMessage, isInvalid, validationState } = props;
|
|
6
|
+
let { labelProps, fieldProps } = $0beb20c9744a2065$export$8467354a121f1b9f(props);
|
|
7
|
+
let descriptionId = $390e54f620492c70$export$b4cc09c592e8fdb8([
|
|
8
|
+
Boolean(description),
|
|
9
|
+
Boolean(errorMessage),
|
|
10
|
+
isInvalid,
|
|
11
|
+
validationState
|
|
12
|
+
]);
|
|
13
|
+
let errorMessageId = $390e54f620492c70$export$b4cc09c592e8fdb8([
|
|
14
|
+
Boolean(description),
|
|
15
|
+
Boolean(errorMessage),
|
|
16
|
+
isInvalid,
|
|
17
|
+
validationState
|
|
18
|
+
]);
|
|
19
|
+
fieldProps = $bbaa08b3cd72f041$export$9d1611c77c2fe928(fieldProps, { "aria-describedby": [
|
|
20
|
+
descriptionId,
|
|
21
|
+
errorMessageId,
|
|
22
|
+
props["aria-describedby"]
|
|
23
|
+
].filter(Boolean).join(" ") || void 0 });
|
|
24
|
+
return {
|
|
25
|
+
labelProps,
|
|
26
|
+
fieldProps,
|
|
27
|
+
descriptionProps: { id: descriptionId },
|
|
28
|
+
errorMessageProps: { id: errorMessageId }
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { $191c9b6d48a0a4e2$export$294aa081a6c6f55d as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as $673d46fce3e5717d$export$a16aca283550c30d } from "./Dialog-C1sh8jbh.js";
|
|
2
2
|
import { useCallback, useMemo } from "react";
|
|
3
|
-
//#region node_modules
|
|
4
|
-
function $
|
|
5
|
-
let collator = $
|
|
3
|
+
//#region node_modules/react-aria/dist/private/i18n/useFilter.mjs
|
|
4
|
+
function $ef182bb9912241d8$export$3274cf84b703fff(options) {
|
|
5
|
+
let collator = $673d46fce3e5717d$export$a16aca283550c30d({
|
|
6
6
|
usage: "search",
|
|
7
7
|
...options
|
|
8
8
|
});
|
|
@@ -41,4 +41,4 @@ function $bb77f239b46e8c72$export$3274cf84b703fff(options) {
|
|
|
41
41
|
]);
|
|
42
42
|
}
|
|
43
43
|
//#endregion
|
|
44
|
-
export { $
|
|
44
|
+
export { $ef182bb9912241d8$export$3274cf84b703fff as t };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { H as $
|
|
1
|
+
import { H as $23f2114a1b82827e$export$e58f029f0fbfdb29, M as $a92dc41f639950be$export$525bc4921d56d4a, N as $a92dc41f639950be$export$715c682d09d639cc, P as $a92dc41f639950be$export$c2b7abe5d61ec696, V as $23f2114a1b82827e$export$cd4e5573fbe2b576, W as $d447af545b77c9f1$export$b204af158042fbac, _ as $8f5a2122b0992be3$export$b9b3dfddab17db27, c as $1e74c67db218ce67$export$f8168d8dd8fd66e6, n as $48a7d519b337145d$export$4eaf04e54aa8eed6, v as $8f5a2122b0992be3$export$ec71b4b83ac08ec3, z as $23f2114a1b82827e$export$4282f70798064fe0 } from "./useHover-lyApu3ba.js";
|
|
2
2
|
import { useCallback, useRef, useState } from "react";
|
|
3
|
-
//#region node_modules
|
|
4
|
-
function $
|
|
3
|
+
//#region node_modules/react-aria/dist/private/interactions/useFocusWithin.mjs
|
|
4
|
+
function $2c9edc598a03d523$export$420e68273165f4ec(props) {
|
|
5
5
|
let { isDisabled, onBlurWithin, onFocusWithin, onFocusWithinChange } = props;
|
|
6
6
|
let state = useRef({ isFocusWithin: false });
|
|
7
|
-
let { addGlobalListener, removeAllGlobalListeners } = $
|
|
7
|
+
let { addGlobalListener, removeAllGlobalListeners } = $48a7d519b337145d$export$4eaf04e54aa8eed6();
|
|
8
8
|
let onBlur = useCallback((e) => {
|
|
9
|
-
if (!$
|
|
10
|
-
if (state.current.isFocusWithin && !$
|
|
9
|
+
if (!$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, $23f2114a1b82827e$export$e58f029f0fbfdb29(e))) return;
|
|
10
|
+
if (state.current.isFocusWithin && !$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, e.relatedTarget)) {
|
|
11
11
|
state.current.isFocusWithin = false;
|
|
12
12
|
removeAllGlobalListeners();
|
|
13
13
|
if (onBlurWithin) onBlurWithin(e);
|
|
@@ -19,12 +19,12 @@ function $9ab94262bd0047c7$export$420e68273165f4ec(props) {
|
|
|
19
19
|
state,
|
|
20
20
|
removeAllGlobalListeners
|
|
21
21
|
]);
|
|
22
|
-
let onSyntheticFocus = $
|
|
22
|
+
let onSyntheticFocus = $a92dc41f639950be$export$715c682d09d639cc(onBlur);
|
|
23
23
|
let onFocus = useCallback((e) => {
|
|
24
|
-
if (!$
|
|
25
|
-
let eventTarget = $
|
|
26
|
-
const ownerDocument = $
|
|
27
|
-
const activeElement = $
|
|
24
|
+
if (!$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, $23f2114a1b82827e$export$e58f029f0fbfdb29(e))) return;
|
|
25
|
+
let eventTarget = $23f2114a1b82827e$export$e58f029f0fbfdb29(e);
|
|
26
|
+
const ownerDocument = $d447af545b77c9f1$export$b204af158042fbac(eventTarget);
|
|
27
|
+
const activeElement = $23f2114a1b82827e$export$cd4e5573fbe2b576(ownerDocument);
|
|
28
28
|
if (!state.current.isFocusWithin && activeElement === eventTarget) {
|
|
29
29
|
if (onFocusWithin) onFocusWithin(e);
|
|
30
30
|
if (onFocusWithinChange) onFocusWithinChange(true);
|
|
@@ -32,11 +32,11 @@ function $9ab94262bd0047c7$export$420e68273165f4ec(props) {
|
|
|
32
32
|
onSyntheticFocus(e);
|
|
33
33
|
let currentTarget = e.currentTarget;
|
|
34
34
|
addGlobalListener(ownerDocument, "focus", (e) => {
|
|
35
|
-
let eventTarget = $
|
|
36
|
-
if (state.current.isFocusWithin && !$
|
|
35
|
+
let eventTarget = $23f2114a1b82827e$export$e58f029f0fbfdb29(e);
|
|
36
|
+
if (state.current.isFocusWithin && !$23f2114a1b82827e$export$4282f70798064fe0(currentTarget, eventTarget)) {
|
|
37
37
|
let nativeEvent = new ownerDocument.defaultView.FocusEvent("blur", { relatedTarget: eventTarget });
|
|
38
|
-
$
|
|
39
|
-
onBlur($
|
|
38
|
+
$a92dc41f639950be$export$c2b7abe5d61ec696(nativeEvent, currentTarget);
|
|
39
|
+
onBlur($a92dc41f639950be$export$525bc4921d56d4a(nativeEvent));
|
|
40
40
|
}
|
|
41
41
|
}, { capture: true });
|
|
42
42
|
}
|
|
@@ -57,34 +57,34 @@ function $9ab94262bd0047c7$export$420e68273165f4ec(props) {
|
|
|
57
57
|
} };
|
|
58
58
|
}
|
|
59
59
|
//#endregion
|
|
60
|
-
//#region node_modules
|
|
61
|
-
function $
|
|
60
|
+
//#region node_modules/react-aria/dist/private/focus/useFocusRing.mjs
|
|
61
|
+
function $0c4a58759813079a$export$4e328f61c538687f(props = {}) {
|
|
62
62
|
let { autoFocus = false, isTextInput, within } = props;
|
|
63
63
|
let state = useRef({
|
|
64
64
|
isFocused: false,
|
|
65
|
-
isFocusVisible: autoFocus || $
|
|
65
|
+
isFocusVisible: autoFocus || $8f5a2122b0992be3$export$b9b3dfddab17db27()
|
|
66
66
|
});
|
|
67
67
|
let [isFocused, setFocused] = useState(false);
|
|
68
68
|
let [isFocusVisibleState, setFocusVisible] = useState(() => state.current.isFocused && state.current.isFocusVisible);
|
|
69
69
|
let updateState = useCallback(() => setFocusVisible(state.current.isFocused && state.current.isFocusVisible), []);
|
|
70
70
|
let onFocusChange = useCallback((isFocused) => {
|
|
71
71
|
state.current.isFocused = isFocused;
|
|
72
|
-
state.current.isFocusVisible = $
|
|
72
|
+
state.current.isFocusVisible = $8f5a2122b0992be3$export$b9b3dfddab17db27();
|
|
73
73
|
setFocused(isFocused);
|
|
74
74
|
updateState();
|
|
75
75
|
}, [updateState]);
|
|
76
|
-
$
|
|
76
|
+
$8f5a2122b0992be3$export$ec71b4b83ac08ec3((isFocusVisible) => {
|
|
77
77
|
state.current.isFocusVisible = isFocusVisible;
|
|
78
78
|
updateState();
|
|
79
79
|
}, [isTextInput, isFocused], {
|
|
80
80
|
enabled: isFocused,
|
|
81
81
|
isTextInput
|
|
82
82
|
});
|
|
83
|
-
let { focusProps } = $
|
|
83
|
+
let { focusProps } = $1e74c67db218ce67$export$f8168d8dd8fd66e6({
|
|
84
84
|
isDisabled: within,
|
|
85
85
|
onFocusChange
|
|
86
86
|
});
|
|
87
|
-
let { focusWithinProps } = $
|
|
87
|
+
let { focusWithinProps } = $2c9edc598a03d523$export$420e68273165f4ec({
|
|
88
88
|
isDisabled: !within,
|
|
89
89
|
onFocusWithinChange: onFocusChange
|
|
90
90
|
});
|
|
@@ -95,4 +95,4 @@ function $f7dceffc5ad7768b$export$4e328f61c538687f(props = {}) {
|
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
//#endregion
|
|
98
|
-
export { $
|
|
98
|
+
export { $2c9edc598a03d523$export$420e68273165f4ec as n, $0c4a58759813079a$export$4e328f61c538687f as t };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { f as $fe16bffc7a557bf0$export$7f54fc3180508a52 } from "./useHover-lyApu3ba.js";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
//#region node_modules/react-aria/dist/private/utils/useFormReset.mjs
|
|
4
|
+
function $3274bf1495747a7b$export$5add1d006293d136(ref, initialValue, onReset) {
|
|
5
|
+
let handleReset = $fe16bffc7a557bf0$export$7f54fc3180508a52((e) => {
|
|
6
|
+
if (onReset && !e.defaultPrevented) onReset(initialValue);
|
|
7
|
+
});
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
let form = ref?.current?.form;
|
|
10
|
+
form?.addEventListener("reset", handleReset);
|
|
11
|
+
return () => {
|
|
12
|
+
form?.removeEventListener("reset", handleReset);
|
|
13
|
+
};
|
|
14
|
+
}, [ref]);
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { $3274bf1495747a7b$export$5add1d006293d136 as t };
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { H as $
|
|
1
|
+
import { h as $c4867b2f328c2698$export$e5c5a5f917a5871c } from "./utils-JFcCNFzy.js";
|
|
2
|
+
import { H as $23f2114a1b82827e$export$e58f029f0fbfdb29, f as $fe16bffc7a557bf0$export$7f54fc3180508a52, m as $8f5a2122b0992be3$export$8397ddfc504fdb9a } from "./useHover-lyApu3ba.js";
|
|
3
3
|
import React, { createContext, forwardRef, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
4
|
-
//#region node_modules
|
|
5
|
-
var $
|
|
4
|
+
//#region node_modules/react-aria-components/dist/private/FieldError.mjs
|
|
5
|
+
var $1f3c3b1a70cec653$export$ff05c3ac10437e03 = createContext(null);
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region node_modules/react-stately/dist/private/form/useFormValidationState.mjs
|
|
8
|
+
var $fd2148440a13ec26$export$aca958c65c314e6c = {
|
|
6
9
|
badInput: false,
|
|
7
10
|
customError: false,
|
|
8
11
|
patternMismatch: false,
|
|
@@ -15,21 +18,21 @@ var $e5be200c675c3b3a$export$aca958c65c314e6c = {
|
|
|
15
18
|
valueMissing: false,
|
|
16
19
|
valid: true
|
|
17
20
|
};
|
|
18
|
-
var $
|
|
19
|
-
...$
|
|
21
|
+
var $fd2148440a13ec26$var$CUSTOM_VALIDITY_STATE = {
|
|
22
|
+
...$fd2148440a13ec26$export$aca958c65c314e6c,
|
|
20
23
|
customError: true,
|
|
21
24
|
valid: false
|
|
22
25
|
};
|
|
23
|
-
var $
|
|
26
|
+
var $fd2148440a13ec26$export$dad6ae84456c676a = {
|
|
24
27
|
isInvalid: false,
|
|
25
|
-
validationDetails: $
|
|
28
|
+
validationDetails: $fd2148440a13ec26$export$aca958c65c314e6c,
|
|
26
29
|
validationErrors: []
|
|
27
30
|
};
|
|
28
|
-
var $
|
|
29
|
-
var $
|
|
30
|
-
function $
|
|
31
|
-
if (props[
|
|
32
|
-
let { realtimeValidation, displayValidation, updateValidation, resetValidation, commitValidation } = props[$
|
|
31
|
+
var $fd2148440a13ec26$export$571b5131b7e65c11 = createContext({});
|
|
32
|
+
var $fd2148440a13ec26$export$a763b9476acd3eb = "__reactAriaFormValidationState";
|
|
33
|
+
function $fd2148440a13ec26$export$fc1a364ae1f3ff10(props) {
|
|
34
|
+
if (props["__reactAriaFormValidationState"]) {
|
|
35
|
+
let { realtimeValidation, displayValidation, updateValidation, resetValidation, commitValidation } = props[$fd2148440a13ec26$export$a763b9476acd3eb];
|
|
33
36
|
return {
|
|
34
37
|
realtimeValidation,
|
|
35
38
|
displayValidation,
|
|
@@ -38,24 +41,24 @@ function $e5be200c675c3b3a$export$fc1a364ae1f3ff10(props) {
|
|
|
38
41
|
commitValidation
|
|
39
42
|
};
|
|
40
43
|
}
|
|
41
|
-
return $
|
|
44
|
+
return $fd2148440a13ec26$var$useFormValidationStateImpl(props);
|
|
42
45
|
}
|
|
43
|
-
function $
|
|
46
|
+
function $fd2148440a13ec26$var$useFormValidationStateImpl(props) {
|
|
44
47
|
let { isInvalid, validationState, name, value, builtinValidation, validate, validationBehavior = "aria" } = props;
|
|
45
|
-
if (validationState) isInvalid
|
|
48
|
+
if (validationState) isInvalid ||= validationState === "invalid";
|
|
46
49
|
let controlledError = isInvalid !== void 0 ? {
|
|
47
50
|
isInvalid,
|
|
48
51
|
validationErrors: [],
|
|
49
|
-
validationDetails: $
|
|
52
|
+
validationDetails: $fd2148440a13ec26$var$CUSTOM_VALIDITY_STATE
|
|
50
53
|
} : null;
|
|
51
54
|
let clientError = useMemo(() => {
|
|
52
55
|
if (!validate || value == null) return null;
|
|
53
|
-
return $
|
|
56
|
+
return $fd2148440a13ec26$var$getValidationResult($fd2148440a13ec26$var$runValidate(validate, value));
|
|
54
57
|
}, [validate, value]);
|
|
55
|
-
if (builtinValidation
|
|
56
|
-
let serverErrors = useContext($
|
|
58
|
+
if (builtinValidation?.validationDetails.valid) builtinValidation = void 0;
|
|
59
|
+
let serverErrors = useContext($fd2148440a13ec26$export$571b5131b7e65c11);
|
|
57
60
|
let serverErrorMessages = useMemo(() => {
|
|
58
|
-
if (name) return Array.isArray(name) ? name.flatMap((name) => $
|
|
61
|
+
if (name) return Array.isArray(name) ? name.flatMap((name) => $fd2148440a13ec26$var$asArray(serverErrors[name])) : $fd2148440a13ec26$var$asArray(serverErrors[name]);
|
|
59
62
|
return [];
|
|
60
63
|
}, [serverErrors, name]);
|
|
61
64
|
let [lastServerErrors, setLastServerErrors] = useState(serverErrors);
|
|
@@ -64,15 +67,15 @@ function $e5be200c675c3b3a$var$useFormValidationStateImpl(props) {
|
|
|
64
67
|
setLastServerErrors(serverErrors);
|
|
65
68
|
setServerErrorCleared(false);
|
|
66
69
|
}
|
|
67
|
-
let serverError = useMemo(() => $
|
|
68
|
-
let nextValidation = useRef($
|
|
69
|
-
let [currentValidity, setCurrentValidity] = useState($
|
|
70
|
-
let lastError = useRef($
|
|
70
|
+
let serverError = useMemo(() => $fd2148440a13ec26$var$getValidationResult(isServerErrorCleared ? [] : serverErrorMessages), [isServerErrorCleared, serverErrorMessages]);
|
|
71
|
+
let nextValidation = useRef($fd2148440a13ec26$export$dad6ae84456c676a);
|
|
72
|
+
let [currentValidity, setCurrentValidity] = useState($fd2148440a13ec26$export$dad6ae84456c676a);
|
|
73
|
+
let lastError = useRef($fd2148440a13ec26$export$dad6ae84456c676a);
|
|
71
74
|
let commitValidation = () => {
|
|
72
75
|
if (!commitQueued) return;
|
|
73
76
|
setCommitQueued(false);
|
|
74
77
|
let error = clientError || builtinValidation || nextValidation.current;
|
|
75
|
-
if (!$
|
|
78
|
+
if (!$fd2148440a13ec26$var$isEqualValidation(error, lastError.current)) {
|
|
76
79
|
lastError.current = error;
|
|
77
80
|
setCurrentValidity(error);
|
|
78
81
|
}
|
|
@@ -80,15 +83,15 @@ function $e5be200c675c3b3a$var$useFormValidationStateImpl(props) {
|
|
|
80
83
|
let [commitQueued, setCommitQueued] = useState(false);
|
|
81
84
|
useEffect(commitValidation);
|
|
82
85
|
return {
|
|
83
|
-
realtimeValidation: controlledError || serverError || clientError || builtinValidation || $
|
|
86
|
+
realtimeValidation: controlledError || serverError || clientError || builtinValidation || $fd2148440a13ec26$export$dad6ae84456c676a,
|
|
84
87
|
displayValidation: validationBehavior === "native" ? controlledError || serverError || currentValidity : controlledError || serverError || clientError || builtinValidation || currentValidity,
|
|
85
88
|
updateValidation(value) {
|
|
86
|
-
if (validationBehavior === "aria" && !$
|
|
89
|
+
if (validationBehavior === "aria" && !$fd2148440a13ec26$var$isEqualValidation(currentValidity, value)) setCurrentValidity(value);
|
|
87
90
|
else nextValidation.current = value;
|
|
88
91
|
},
|
|
89
92
|
resetValidation() {
|
|
90
|
-
let error = $
|
|
91
|
-
if (!$
|
|
93
|
+
let error = $fd2148440a13ec26$export$dad6ae84456c676a;
|
|
94
|
+
if (!$fd2148440a13ec26$var$isEqualValidation(error, lastError.current)) {
|
|
92
95
|
lastError.current = error;
|
|
93
96
|
setCurrentValidity(error);
|
|
94
97
|
}
|
|
@@ -101,81 +104,79 @@ function $e5be200c675c3b3a$var$useFormValidationStateImpl(props) {
|
|
|
101
104
|
}
|
|
102
105
|
};
|
|
103
106
|
}
|
|
104
|
-
function $
|
|
107
|
+
function $fd2148440a13ec26$var$asArray(v) {
|
|
105
108
|
if (!v) return [];
|
|
106
109
|
return Array.isArray(v) ? v : [v];
|
|
107
110
|
}
|
|
108
|
-
function $
|
|
111
|
+
function $fd2148440a13ec26$var$runValidate(validate, value) {
|
|
109
112
|
if (typeof validate === "function") {
|
|
110
113
|
let e = validate(value);
|
|
111
|
-
if (e && typeof e !== "boolean") return $
|
|
114
|
+
if (e && typeof e !== "boolean") return $fd2148440a13ec26$var$asArray(e);
|
|
112
115
|
}
|
|
113
116
|
return [];
|
|
114
117
|
}
|
|
115
|
-
function $
|
|
118
|
+
function $fd2148440a13ec26$var$getValidationResult(errors) {
|
|
116
119
|
return errors.length ? {
|
|
117
120
|
isInvalid: true,
|
|
118
121
|
validationErrors: errors,
|
|
119
|
-
validationDetails: $
|
|
122
|
+
validationDetails: $fd2148440a13ec26$var$CUSTOM_VALIDITY_STATE
|
|
120
123
|
} : null;
|
|
121
124
|
}
|
|
122
|
-
function $
|
|
125
|
+
function $fd2148440a13ec26$var$isEqualValidation(a, b) {
|
|
123
126
|
if (a === b) return true;
|
|
124
127
|
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);
|
|
125
128
|
}
|
|
126
129
|
//#endregion
|
|
127
|
-
//#region node_modules
|
|
128
|
-
function $
|
|
130
|
+
//#region node_modules/react-aria/dist/private/form/useFormValidation.mjs
|
|
131
|
+
function $860f7da480e22816$export$b8473d3665f3a75a(props, state, ref) {
|
|
129
132
|
let { validationBehavior, focus } = props;
|
|
130
|
-
$
|
|
131
|
-
if (validationBehavior === "native" &&
|
|
133
|
+
$c4867b2f328c2698$export$e5c5a5f917a5871c(() => {
|
|
134
|
+
if (validationBehavior === "native" && ref?.current && !ref.current.disabled) {
|
|
132
135
|
let errorMessage = state.realtimeValidation.isInvalid ? state.realtimeValidation.validationErrors.join(" ") || "Invalid value." : "";
|
|
133
136
|
ref.current.setCustomValidity(errorMessage);
|
|
134
137
|
if (!ref.current.hasAttribute("title")) ref.current.title = "";
|
|
135
|
-
if (!state.realtimeValidation.isInvalid) state.updateValidation($
|
|
138
|
+
if (!state.realtimeValidation.isInvalid) state.updateValidation($860f7da480e22816$var$getNativeValidity(ref.current));
|
|
136
139
|
}
|
|
137
140
|
});
|
|
138
141
|
let isIgnoredReset = useRef(false);
|
|
139
|
-
let onReset = $
|
|
142
|
+
let onReset = $fe16bffc7a557bf0$export$7f54fc3180508a52(() => {
|
|
140
143
|
if (!isIgnoredReset.current) state.resetValidation();
|
|
141
144
|
});
|
|
142
|
-
let onInvalid = $
|
|
143
|
-
var _ref_current;
|
|
145
|
+
let onInvalid = $fe16bffc7a557bf0$export$7f54fc3180508a52((e) => {
|
|
144
146
|
if (!state.displayValidation.isInvalid) state.commitValidation();
|
|
145
|
-
let form = ref
|
|
146
|
-
if (!e.defaultPrevented && ref && form && $
|
|
147
|
-
var _ref_current1;
|
|
147
|
+
let form = ref?.current?.form;
|
|
148
|
+
if (!e.defaultPrevented && ref && form && $860f7da480e22816$var$getFirstInvalidInput(form) === ref.current) {
|
|
148
149
|
if (focus) focus();
|
|
149
|
-
else
|
|
150
|
-
$
|
|
150
|
+
else ref.current?.focus();
|
|
151
|
+
$8f5a2122b0992be3$export$8397ddfc504fdb9a("keyboard");
|
|
151
152
|
}
|
|
152
153
|
e.preventDefault();
|
|
153
154
|
});
|
|
154
|
-
let onChange = $
|
|
155
|
+
let onChange = $fe16bffc7a557bf0$export$7f54fc3180508a52(() => {
|
|
155
156
|
state.commitValidation();
|
|
156
157
|
});
|
|
157
158
|
useEffect(() => {
|
|
158
|
-
let input = ref
|
|
159
|
+
let input = ref?.current;
|
|
159
160
|
if (!input) return;
|
|
160
161
|
let form = input.form;
|
|
161
|
-
let reset = form
|
|
162
|
+
let reset = form?.reset;
|
|
162
163
|
if (form) form.reset = () => {
|
|
163
|
-
isIgnoredReset.current = !window.event || window.event.type === "message" && $
|
|
164
|
-
reset
|
|
164
|
+
isIgnoredReset.current = !window.event || window.event.type === "message" && $23f2114a1b82827e$export$e58f029f0fbfdb29(window.event) instanceof MessagePort;
|
|
165
|
+
reset?.call(form);
|
|
165
166
|
isIgnoredReset.current = false;
|
|
166
167
|
};
|
|
167
168
|
input.addEventListener("invalid", onInvalid);
|
|
168
169
|
input.addEventListener("change", onChange);
|
|
169
|
-
form
|
|
170
|
+
form?.addEventListener("reset", onReset);
|
|
170
171
|
return () => {
|
|
171
172
|
input.removeEventListener("invalid", onInvalid);
|
|
172
173
|
input.removeEventListener("change", onChange);
|
|
173
|
-
form
|
|
174
|
+
form?.removeEventListener("reset", onReset);
|
|
174
175
|
if (form) form.reset = reset;
|
|
175
176
|
};
|
|
176
177
|
}, [ref, validationBehavior]);
|
|
177
178
|
}
|
|
178
|
-
function $
|
|
179
|
+
function $860f7da480e22816$var$getValidity(input) {
|
|
179
180
|
let validity = input.validity;
|
|
180
181
|
return {
|
|
181
182
|
badInput: validity.badInput,
|
|
@@ -191,23 +192,19 @@ function $e93e671b31057976$var$getValidity(input) {
|
|
|
191
192
|
valid: validity.valid
|
|
192
193
|
};
|
|
193
194
|
}
|
|
194
|
-
function $
|
|
195
|
+
function $860f7da480e22816$var$getNativeValidity(input) {
|
|
195
196
|
return {
|
|
196
197
|
isInvalid: !input.validity.valid,
|
|
197
|
-
validationDetails: $
|
|
198
|
+
validationDetails: $860f7da480e22816$var$getValidity(input),
|
|
198
199
|
validationErrors: input.validationMessage ? [input.validationMessage] : []
|
|
199
200
|
};
|
|
200
201
|
}
|
|
201
|
-
function $
|
|
202
|
+
function $860f7da480e22816$var$getFirstInvalidInput(form) {
|
|
202
203
|
for (let i = 0; i < form.elements.length; i++) {
|
|
203
|
-
var _element_validity;
|
|
204
204
|
let element = form.elements[i];
|
|
205
|
-
if (
|
|
205
|
+
if (element.validity?.valid === false) return element;
|
|
206
206
|
}
|
|
207
207
|
return null;
|
|
208
208
|
}
|
|
209
209
|
//#endregion
|
|
210
|
-
|
|
211
|
-
var $ee014567cb39d3f0$export$ff05c3ac10437e03 = createContext(null);
|
|
212
|
-
//#endregion
|
|
213
|
-
export { $e5be200c675c3b3a$export$fc1a364ae1f3ff10 as a, $e5be200c675c3b3a$export$dad6ae84456c676a as i, $e93e671b31057976$export$b8473d3665f3a75a as n, $e5be200c675c3b3a$export$a763b9476acd3eb as r, $ee014567cb39d3f0$export$ff05c3ac10437e03 as t };
|
|
210
|
+
export { $1f3c3b1a70cec653$export$ff05c3ac10437e03 as a, $fd2148440a13ec26$export$fc1a364ae1f3ff10 as i, $fd2148440a13ec26$export$a763b9476acd3eb as n, $fd2148440a13ec26$export$dad6ae84456c676a as r, $860f7da480e22816$export$b8473d3665f3a75a as t };
|