@marimo-team/islands 0.23.17-dev4 → 0.23.17-dev40
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/{ConnectedDataExplorerComponent-f9vLjQiF.js → ConnectedDataExplorerComponent-BBZRR1-C.js} +16 -16
- package/dist/{ErrorBoundary-DhLqwSWA.js → ErrorBoundary-CptUP1_t.js} +3 -3
- package/dist/{ImageComparisonComponent-C3y7L3eJ.js → ImageComparisonComponent-fdY0LUuf.js} +38 -27
- package/dist/{any-language-editor-DifE-fl7.js → any-language-editor-BnIS9Mvg.js} +21 -21
- package/dist/assets/__vite-browser-external-DUz7vvG0.js +1 -0
- package/dist/assets/{worker-CDEKsBgX.js → worker-Cl1KJG2_.js} +2 -2
- package/dist/{button-BSm8IXRU.js → button-8aS1QcHr.js} +4 -2
- package/dist/{capabilities-C6OQ5YBO.js → capabilities-D23lgbH_.js} +1 -1
- package/dist/chat-ui-DH9M4L-6.js +8620 -0
- package/dist/{check-DP7U0H0G.js → check-D-BaEjEh.js} +1 -1
- package/dist/{common-BcQ4kHDP.js → common-DSVkRiDF.js} +652 -652
- package/dist/{copy-DNq8q3zw.js → copy-BkA3t7rJ.js} +2 -2
- package/dist/{defaultLocale-BpsHxBd7.js → defaultLocale-BsfI21d_.js} +26 -26
- package/dist/{diagram-PSM6KHXK-D4ftnaua.js → diagram-PSM6KHXK-D3GsWNcQ.js} +1 -1
- package/dist/{dist-BpeiYpG2.js → dist-3F1XDSYc.js} +2 -2
- package/dist/{dist-BP39XM8u.js → dist-B-upo54Y.js} +1 -1
- package/dist/{dist-BdqCKQ1O.js → dist-B1W12VzQ.js} +2 -2
- package/dist/{dist-3NCqaWjt.js → dist-B6au1PTB.js} +2 -2
- package/dist/{dist-BCX980mU.js → dist-BDwn6WIk.js} +2 -2
- package/dist/dist-BDzVdDo2.js +8 -0
- package/dist/dist-BH2Tq1S1.js +5 -0
- package/dist/dist-BIhBrzqg.js +5 -0
- package/dist/dist-BLCsvXTG.js +6 -0
- package/dist/dist-BNVtuFdd.js +5 -0
- package/dist/{dist-BOMbzyb3.js → dist-BNeJ8P-4.js} +3 -3
- package/dist/{dist-LpLXa9Lb.js → dist-BT96P4oR.js} +2 -2
- package/dist/{dist-CFSb_Frm.js → dist-BUzxp0Xf.js} +1 -1
- package/dist/{dist-JGehap7K.js → dist-Ba1WFESi.js} +5 -5
- package/dist/{dist-CRmSjkLP.js → dist-BrKNRKC8.js} +2 -2
- package/dist/{dist-BIEt-mlF.js → dist-BvvQUFUK.js} +1 -1
- package/dist/{dist-pqIwD8VD.js → dist-BxR-g1ig.js} +2 -2
- package/dist/{dist-DviUBLUp.js → dist-CBraAJlT.js} +4 -4
- package/dist/{dist-BwhXBwMd.js → dist-CDBV8n0I.js} +1 -1
- package/dist/dist-CEJ6Lowi.js +5 -0
- package/dist/{dist-CSlJrrAw.js → dist-CWYsUX_O.js} +1 -1
- package/dist/dist-CYoa69kj.js +5 -0
- package/dist/{dist-DwqBJ014.js → dist-CdKRSqjo.js} +2 -2
- package/dist/{dist-De-GlSAs.js → dist-Cds3J-EE.js} +15 -9
- package/dist/dist-CnZyXFq3.js +8 -0
- package/dist/dist-D-4HaJKc.js +8 -0
- package/dist/{dist-C18MUWTj.js → dist-D8SX5Qdg.js} +2 -2
- package/dist/{dist-D3bdsa1d.js → dist-DFQ91Mx1.js} +4 -4
- package/dist/{dist-BPF0gTRZ.js → dist-DGQmYLkh.js} +1 -1
- package/dist/dist-DIGyvbg3.js +5 -0
- package/dist/dist-DIhaoCL4.js +5 -0
- package/dist/{dist-C2_4pjuS.js → dist-DK0pFEmc.js} +1 -1
- package/dist/{dist-BTdrwBWP.js → dist-DQj6A7SE.js} +3 -3
- package/dist/{dist-DIlxLFXG.js → dist-DarwE0ZO.js} +11 -11
- package/dist/{dist-DaXJPX8F.js → dist-Ddb0VFS3.js} +2 -2
- package/dist/dist-DgQleHmb.js +8 -0
- package/dist/{dist-DZwp8lro.js → dist-DgkJegw4.js} +3 -3
- package/dist/{dist-BO5HRiTf.js → dist-DjQRRttD.js} +2 -2
- package/dist/dist-JaoLzZmt.js +5 -0
- package/dist/{dist-B2jmQKKx.js → dist-PQDZaPEo.js} +2 -2
- package/dist/{dist-4lVIWUT3.js → dist-Slyx4vXr.js} +1 -1
- package/dist/{dist-DgjbnqTg.js → dist-dJeh9ef4.js} +2 -2
- package/dist/dist-pEX0t8ZV.js +6 -0
- package/dist/{dist-w_gWE5Wf.js → dist-v-kAJfMq.js} +1 -1
- package/dist/{error-banner-B_GQfxxD.js → error-banner-dmkbm21G.js} +2 -2
- package/dist/{esm-DzZVaNH4.js → esm-D8vjxCyn.js} +3 -3
- package/dist/{esm-DKOv6P2M.js → esm-DEQU-LUO.js} +22 -22
- package/dist/{extends-w2_S44bV.js → extends-DDOVg_b8.js} +5 -5
- package/dist/{formats-Dwq1THhr.js → formats-xc-Msa0v.js} +3 -3
- package/dist/{ganttDiagram-JELNMOA3-CXXCN7LN.js → ganttDiagram-JELNMOA3-D9ywbC5g.js} +3 -3
- package/dist/{glide-data-editor-B9K6-MJe.js → glide-data-editor-CyTNN635.js} +9 -9
- package/dist/{html-to-image-CZ1kLKkq.js → html-to-image-DrEMf75G.js} +2219 -2209
- package/dist/{input-C5K4VBvB.js → input-B4ddy8Jy.js} +6 -6
- package/dist/{label-DjoYwqmj.js → label-CzHncDvS.js} +2 -2
- package/dist/{linear-H_vsH9ao.js → linear-BOGUO8Cd.js} +2 -2
- package/dist/{loader-DX-IDS7n.js → loader-C7SfUdOD.js} +10 -10
- package/dist/main.js +729 -733
- package/dist/{mermaid-hv6IckVw.js → mermaid-CpL8y5pw.js} +9 -9
- package/dist/{precisionRound-CnHPY_5v.js → precisionRound-Bq50n-bG.js} +1 -1
- package/dist/{process-output-bVfbcx5_.js → process-output-B9IHQuus.js} +3 -3
- package/dist/{quadrantDiagram-AYHSOK5B-BqDB9tUC.js → quadrantDiagram-AYHSOK5B-DD4QBdSv.js} +2 -2
- package/dist/{react-vega-BazDALhI.js → react-vega-Cg17A6rO.js} +8017 -4777
- package/dist/{reveal-component-9QGZq7uF.js → reveal-component-CUzZw4ZH.js} +19 -19
- package/dist/{spec-CQKL_D3i.js → spec-uMKNvMRZ.js} +4 -4
- package/dist/{strings-DIy9NAmg.js → strings-BUDhKc0s.js} +299 -299
- package/dist/style.css +1 -1
- package/dist/{swiper-component-CEdAYjb7.js → swiper-component-dl1H9WIW.js} +2 -2
- package/dist/{time-Bb4A7I6a.js → time-CQnohwNM.js} +2 -2
- package/dist/{toDate-CqhBWjvO.js → toDate-BiyuFdnT.js} +3 -3
- package/dist/{tooltip-f-qR0iUx.js → tooltip-CkCWlUOf.js} +3 -3
- package/dist/{types-DicH9Oi0.js → types-uENjXsiC.js} +1 -1
- package/dist/{useAsyncData-CYOQb1EW.js → useAsyncData-DqJLysjC.js} +1 -1
- package/dist/{useDateFormatter-Bt2qr_XS.js → useDateFormatter-BeN3fHMH.js} +2 -2
- package/dist/{useDeepCompareMemoize-CSHQeQEI.js → useDeepCompareMemoize-CvlmHAmy.js} +1 -1
- package/dist/{useIframeCapabilities-kA09ykNq.js → useIframeCapabilities-pLC-ceDP.js} +1 -1
- package/dist/{useLifecycle-CMJGqBaY.js → useLifecycle-D4N02q82.js} +3 -3
- package/dist/{useTheme-DYfby65G.js → useTheme-Dur2p3iC.js} +4 -3
- package/dist/{vega-component-C7nO5zcf.js → vega-component-Cft458Sr.js} +13 -13
- package/dist/{vega-embed-container-DAQAMjiO.js → vega-embed-container-S9gRu4TZ.js} +3 -3
- package/dist/{vega-loader.browser-DmpxCJqx.js → vega-loader.browser-CmLRI3wk.js} +104 -111
- package/dist/{xychartDiagram-PRI3JC2R-BSkNxYNw.js → xychartDiagram-PRI3JC2R-D9DgEtKn.js} +2 -2
- package/dist/{zod-BUcyXSdR.js → zod-yTHHzJiv.js} +37 -38
- package/package.json +6 -6
- package/src/__mocks__/requests.ts +5 -0
- package/src/components/app-config/user-config-form.tsx +26 -0
- package/src/components/chat/__tests__/chat-abort.test.ts +51 -0
- package/src/components/chat/chat-abort.ts +44 -0
- package/src/components/chat/chat-display.tsx +17 -0
- package/src/components/chat/chat-panel.tsx +85 -37
- package/src/components/chat/chat-utils.ts +1 -1
- package/src/components/data-table/charts/__tests__/schemas.test.ts +35 -0
- package/src/components/data-table/charts/schemas.ts +5 -2
- package/src/components/databases/icons/huggingface.svg +8 -0
- package/src/components/datasets/__tests__/icons.test.ts +21 -0
- package/src/components/datasets/icons.tsx +10 -0
- package/src/components/datasources/__tests__/components.test.tsx +29 -0
- package/src/components/datasources/components.tsx +8 -3
- package/src/components/editor/actions/export-dialog/__tests__/export-dialog.test.tsx +35 -0
- package/src/components/editor/actions/export-dialog/__tests__/state.test.ts +61 -0
- package/src/components/editor/actions/export-dialog/export-command.ts +4 -9
- package/src/components/editor/actions/export-dialog/export-dialog.tsx +27 -23
- package/src/components/editor/actions/export-dialog/format-notice.tsx +28 -0
- package/src/components/editor/actions/export-dialog/state.ts +23 -5
- package/src/components/editor/actions/export-dialog/use-export-dialog.ts +7 -15
- package/src/components/editor/actions/useConfigActions.tsx +24 -0
- package/src/components/editor/ai/add-cell-with-ai.tsx +2 -2
- package/src/components/editor/ai/ai-completion-editor.tsx +2 -2
- package/src/components/editor/chrome/panels/outline/__tests__/useActiveOutline.test.ts +26 -0
- package/src/components/editor/code/__tests__/readonly-python-code.test.tsx +114 -2
- package/src/components/editor/connections/storage/__tests__/__snapshots__/as-code.test.ts.snap +14 -0
- package/src/components/editor/connections/storage/__tests__/as-code.test.ts +20 -0
- package/src/components/editor/connections/storage/add-storage-form.tsx +10 -0
- package/src/components/editor/connections/storage/as-code.ts +19 -1
- package/src/components/editor/connections/storage/schemas.ts +19 -0
- package/src/components/storage/__tests__/storage-snippets.test.ts +88 -0
- package/src/components/storage/components.tsx +2 -0
- package/src/components/storage/storage-snippets.ts +58 -0
- package/src/core/__tests__/mode.test.ts +85 -0
- package/src/core/ai/constants.ts +7 -0
- package/src/core/ai/staged-cells.ts +3 -0
- package/src/core/codemirror/__tests__/setup.test.ts +1 -1
- package/src/core/codemirror/cm.ts +2 -2
- package/src/core/codemirror/code-lens/__tests__/extension.test.ts +4 -5
- package/src/core/codemirror/code-lens/extension.ts +3 -3
- package/src/core/codemirror/find-replace/search-highlight.ts +8 -3
- package/src/core/codemirror/language/languages/sql/__tests__/renderers.test.tsx +44 -0
- package/src/core/codemirror/language/languages/sql/renderers.tsx +3 -3
- package/src/core/codemirror/theme/__tests__/light.test.ts +59 -123
- package/src/core/codemirror/theme/dark.ts +6 -5
- package/src/core/codemirror/theme/light.ts +6 -4
- package/src/core/config/__tests__/config-schema.test.ts +2 -0
- package/src/core/config/config-schema.ts +1 -0
- package/src/core/config/feature-flag.tsx +0 -2
- package/src/core/dom/outline.ts +25 -2
- package/src/core/hotkeys/hotkeys.ts +2 -0
- package/src/core/mode.ts +11 -9
- package/src/core/network/__tests__/api.test.ts +132 -17
- package/src/core/network/__tests__/export-filename.test.ts +43 -0
- package/src/core/network/__tests__/requests-lazy.test.ts +1 -0
- package/src/core/network/api.ts +47 -12
- package/src/core/network/export-filename.ts +37 -0
- package/src/core/network/markdown-export.ts +19 -0
- package/src/core/network/requests-network.ts +29 -5
- package/src/core/network/types.ts +3 -0
- package/src/core/storage/types.ts +1 -0
- package/src/css/app/codemirror.css +11 -7
- package/src/css/globals.css +8 -0
- package/src/plugins/impl/DataEditorPlugin.tsx +2 -9
- package/src/plugins/impl/__tests__/DataEditorPlugin.test.ts +18 -0
- package/src/plugins/impl/chat/chat-ui.tsx +51 -3
- package/src/plugins/impl/data-frames/__tests__/schema.test.ts +30 -0
- package/src/plugins/impl/data-frames/schema.ts +4 -1
- package/src/plugins/impl/image-comparison/ImageComparisonComponent.tsx +20 -1
- package/src/plugins/impl/image-comparison/__tests__/ImageComparisonComponent.test.tsx +58 -0
- package/src/stories/theme.stories.tsx +71 -1
- package/dist/assets/__vite-browser-external-DltVXDv7.js +0 -1
- package/dist/chat-ui-DsZJj75A.js +0 -8369
- package/dist/dist-5o9uz19x.js +0 -5
- package/dist/dist-BpDH0DEP.js +0 -5
- package/dist/dist-BpXhbQXO.js +0 -8
- package/dist/dist-ByadAk_L.js +0 -5
- package/dist/dist-CK0g7JvP.js +0 -8
- package/dist/dist-CfzCtiq2.js +0 -5
- package/dist/dist-D8JtVFrW.js +0 -8
- package/dist/dist-DK2Oocpu.js +0 -6
- package/dist/dist-DnSu977r.js +0 -5
- package/dist/dist-UmxJm6sW.js +0 -8
- package/dist/dist-aYSBQSyM.js +0 -5
- package/dist/dist-kkZ1Ztlh.js +0 -6
- package/dist/dist-ngPczwNi.js +0 -5
- package/dist/dist-wQRyxyTV.js +0 -5
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { s as __toESM } from "./chunk-BNovOVIE.js";
|
|
2
|
-
import { g as Logger, h as cn, m as Events, p as useComposedRefs, r as cva, u as createSlot } from "./button-
|
|
2
|
+
import { g as Logger, h as cn, m as Events, p as useComposedRefs, r as cva, u as createSlot } from "./button-8aS1QcHr.js";
|
|
3
3
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
4
4
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
5
|
-
import { a as createPopperScope, c as VISUALLY_HIDDEN_STYLES, i as Root2$1, n as Arrow, r as Content, t as Anchor, u as createLucideIcon } from "./dist-
|
|
6
|
-
import { t as Check } from "./check-
|
|
5
|
+
import { a as createPopperScope, c as VISUALLY_HIDDEN_STYLES, i as Root2$1, n as Arrow, r as Content, t as Anchor, u as createLucideIcon } from "./dist-DarwE0ZO.js";
|
|
6
|
+
import { t as Check } from "./check-D-BaEjEh.js";
|
|
7
7
|
import { t as require_react_dom } from "./react-dom-BTJzcVJ9.js";
|
|
8
8
|
import { t as require_jsx_runtime } from "./jsx-runtime-DebpN0FN.js";
|
|
9
|
-
import {
|
|
9
|
+
import { $ as StyleNamespace, X as withFullScreenAsRoot, Z as withSmartCollisionBoundary, _t as Primitive, at as FocusScope, et as hideOthers, ft as useControllableState, gt as createContextScope, it as Portal, lt as useCallbackRef, mt as composeEventHandlers, pt as useLayoutEffect2, rt as useFocusGuards, st as DismissableLayer, tt as Combination_default, ut as useId } from "./zod-yTHHzJiv.js";
|
|
10
10
|
import { t as invariant } from "./invariant-wRzNXIsJ.js";
|
|
11
11
|
var ChevronDown = createLucideIcon("chevron-down", [["path", {
|
|
12
12
|
d: "m6 9 6 6 6-6",
|
|
@@ -21,12 +21,12 @@ var ChevronDown = createLucideIcon("chevron-down", [["path", {
|
|
|
21
21
|
d: "m6 6 12 12",
|
|
22
22
|
key: "d8bk6v"
|
|
23
23
|
}]]), import_react = /* @__PURE__ */ __toESM(require_react(), 1), import_jsx_runtime = /* @__PURE__ */ __toESM(require_jsx_runtime(), 1);
|
|
24
|
-
function createCollection(
|
|
25
|
-
let i =
|
|
24
|
+
function createCollection(e) {
|
|
25
|
+
let i = e + "CollectionProvider", [a, o] = createContextScope(i), [c, u] = a(i, {
|
|
26
26
|
collectionRef: { current: null },
|
|
27
27
|
itemMap: /* @__PURE__ */ new Map()
|
|
28
|
-
}), d = (
|
|
29
|
-
let { scope: i2, children: a2 } =
|
|
28
|
+
}), d = (e2) => {
|
|
29
|
+
let { scope: i2, children: a2 } = e2, o2 = import_react.useRef(null), s = import_react.useRef(/* @__PURE__ */ new Map()).current;
|
|
30
30
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(c, {
|
|
31
31
|
scope: i2,
|
|
32
32
|
itemMap: s,
|
|
@@ -35,16 +35,16 @@ function createCollection(t) {
|
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
37
|
d.displayName = i;
|
|
38
|
-
let f =
|
|
39
|
-
let { scope: a2, children: o2 } =
|
|
38
|
+
let f = e + "CollectionSlot", p = createSlot(f), m = import_react.forwardRef((e2, i2) => {
|
|
39
|
+
let { scope: a2, children: o2 } = e2;
|
|
40
40
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(p, {
|
|
41
41
|
ref: useComposedRefs(i2, u(f, a2).collectionRef),
|
|
42
42
|
children: o2
|
|
43
43
|
});
|
|
44
44
|
});
|
|
45
45
|
m.displayName = f;
|
|
46
|
-
let h =
|
|
47
|
-
let { scope: a2, children: o2, ...c2 } =
|
|
46
|
+
let h = e + "CollectionItemSlot", g = "data-radix-collection-item", _ = createSlot(h), v = import_react.forwardRef((e2, i2) => {
|
|
47
|
+
let { scope: a2, children: o2, ...c2 } = e2, l = import_react.useRef(null), d2 = useComposedRefs(i2, l), f2 = u(h, a2);
|
|
48
48
|
return import_react.useEffect(() => (f2.itemMap.set(l, {
|
|
49
49
|
ref: l,
|
|
50
50
|
...c2
|
|
@@ -56,12 +56,12 @@ function createCollection(t) {
|
|
|
56
56
|
});
|
|
57
57
|
v.displayName = h;
|
|
58
58
|
function y(i2) {
|
|
59
|
-
let a2 = u(
|
|
59
|
+
let a2 = u(e + "CollectionConsumer", i2);
|
|
60
60
|
return import_react.useCallback(() => {
|
|
61
|
-
let
|
|
62
|
-
if (!
|
|
63
|
-
let i3 = Array.from(
|
|
64
|
-
return Array.from(a2.itemMap.values()).sort((
|
|
61
|
+
let e2 = a2.collectionRef.current;
|
|
62
|
+
if (!e2) return [];
|
|
63
|
+
let i3 = Array.from(e2.querySelectorAll(`[${g}]`));
|
|
64
|
+
return Array.from(a2.itemMap.values()).sort((e3, a3) => i3.indexOf(e3.ref.current) - i3.indexOf(a3.ref.current));
|
|
65
65
|
}, [a2.collectionRef, a2.itemMap]);
|
|
66
66
|
}
|
|
67
67
|
return [
|
|
@@ -75,27 +75,27 @@ function createCollection(t) {
|
|
|
75
75
|
];
|
|
76
76
|
}
|
|
77
77
|
var DirectionContext = import_react.createContext(void 0);
|
|
78
|
-
function useDirection(
|
|
78
|
+
function useDirection(e) {
|
|
79
79
|
let i = import_react.useContext(DirectionContext);
|
|
80
|
-
return
|
|
80
|
+
return e || i || "ltr";
|
|
81
81
|
}
|
|
82
|
-
function usePrevious(
|
|
82
|
+
function usePrevious(e) {
|
|
83
83
|
let i = import_react.useRef({
|
|
84
|
-
value:
|
|
85
|
-
previous:
|
|
84
|
+
value: e,
|
|
85
|
+
previous: e
|
|
86
86
|
});
|
|
87
|
-
return import_react.useMemo(() => (i.current.value !==
|
|
87
|
+
return import_react.useMemo(() => (i.current.value !== e && (i.current.previous = i.current.value, i.current.value = e), i.current.previous), [e]);
|
|
88
88
|
}
|
|
89
|
-
function clamp(
|
|
90
|
-
return Math.min(a, Math.max(i,
|
|
89
|
+
function clamp(e, [i, a]) {
|
|
90
|
+
return Math.min(a, Math.max(i, e));
|
|
91
91
|
}
|
|
92
92
|
var import_react_dom = /* @__PURE__ */ __toESM(require_react_dom(), 1), OPEN_KEYS = [
|
|
93
93
|
" ",
|
|
94
94
|
"Enter",
|
|
95
95
|
"ArrowUp",
|
|
96
96
|
"ArrowDown"
|
|
97
|
-
], SELECTION_KEYS = [" ", "Enter"], SELECT_NAME = "Select", [Collection, useCollection, createCollectionScope] = createCollection(SELECT_NAME), [createSelectContext, createSelectScope] = createContextScope(SELECT_NAME, [createCollectionScope, createPopperScope]), usePopperScope = createPopperScope(), [SelectProvider, useSelectContext] = createSelectContext(SELECT_NAME), [SelectNativeOptionsProvider, useSelectNativeOptionsContext] = createSelectContext(SELECT_NAME), Select$1 = (
|
|
98
|
-
let { __scopeSelect: i, children: a, open: o, defaultOpen: s, onOpenChange: c, value: l, defaultValue: u, onValueChange: d, dir: f, name: p, autoComplete: h, disabled: g, required: _, form: v } =
|
|
97
|
+
], SELECTION_KEYS = [" ", "Enter"], SELECT_NAME = "Select", [Collection, useCollection, createCollectionScope] = createCollection(SELECT_NAME), [createSelectContext, createSelectScope] = createContextScope(SELECT_NAME, [createCollectionScope, createPopperScope]), usePopperScope = createPopperScope(), [SelectProvider, useSelectContext] = createSelectContext(SELECT_NAME), [SelectNativeOptionsProvider, useSelectNativeOptionsContext] = createSelectContext(SELECT_NAME), Select$1 = (e) => {
|
|
98
|
+
let { __scopeSelect: i, children: a, open: o, defaultOpen: s, onOpenChange: c, value: l, defaultValue: u, onValueChange: d, dir: f, name: p, autoComplete: h, disabled: g, required: _, form: v } = e, y = usePopperScope(i), [b, x] = import_react.useState(null), [S, C] = import_react.useState(null), [w, T] = import_react.useState(false), E = useDirection(f), [D, k] = useControllableState({
|
|
99
99
|
prop: o,
|
|
100
100
|
defaultProp: s ?? false,
|
|
101
101
|
onChange: c,
|
|
@@ -105,7 +105,7 @@ var import_react_dom = /* @__PURE__ */ __toESM(require_react_dom(), 1), OPEN_KEY
|
|
|
105
105
|
defaultProp: u,
|
|
106
106
|
onChange: d,
|
|
107
107
|
caller: SELECT_NAME
|
|
108
|
-
}), M = import_react.useRef(null), N = b ? v || !!b.closest("form") : true, [
|
|
108
|
+
}), M = import_react.useRef(null), N = b ? v || !!b.closest("form") : true, [P, F] = import_react.useState(/* @__PURE__ */ new Set()), I = Array.from(P).map((e2) => e2.props.value).join(";");
|
|
109
109
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Root2$1, {
|
|
110
110
|
...y,
|
|
111
111
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(SelectProvider, {
|
|
@@ -120,7 +120,7 @@ var import_react_dom = /* @__PURE__ */ __toESM(require_react_dom(), 1), OPEN_KEY
|
|
|
120
120
|
contentId: useId(),
|
|
121
121
|
value: A,
|
|
122
122
|
onValueChange: j,
|
|
123
|
-
open:
|
|
123
|
+
open: D,
|
|
124
124
|
onOpenChange: k,
|
|
125
125
|
dir: E,
|
|
126
126
|
triggerPointerDownPosRef: M,
|
|
@@ -128,14 +128,14 @@ var import_react_dom = /* @__PURE__ */ __toESM(require_react_dom(), 1), OPEN_KEY
|
|
|
128
128
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Provider, {
|
|
129
129
|
scope: i,
|
|
130
130
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectNativeOptionsProvider, {
|
|
131
|
-
scope:
|
|
132
|
-
onNativeOptionAdd: import_react.useCallback((
|
|
133
|
-
|
|
131
|
+
scope: e.__scopeSelect,
|
|
132
|
+
onNativeOptionAdd: import_react.useCallback((e2) => {
|
|
133
|
+
F((i2) => new Set(i2).add(e2));
|
|
134
134
|
}, []),
|
|
135
|
-
onNativeOptionRemove: import_react.useCallback((
|
|
136
|
-
|
|
135
|
+
onNativeOptionRemove: import_react.useCallback((e2) => {
|
|
136
|
+
F((i2) => {
|
|
137
137
|
let a2 = new Set(i2);
|
|
138
|
-
return a2.delete(
|
|
138
|
+
return a2.delete(e2), a2;
|
|
139
139
|
});
|
|
140
140
|
}, []),
|
|
141
141
|
children: a
|
|
@@ -147,23 +147,23 @@ var import_react_dom = /* @__PURE__ */ __toESM(require_react_dom(), 1), OPEN_KEY
|
|
|
147
147
|
name: p,
|
|
148
148
|
autoComplete: h,
|
|
149
149
|
value: A,
|
|
150
|
-
onChange: (
|
|
150
|
+
onChange: (e2) => j(e2.target.value),
|
|
151
151
|
disabled: g,
|
|
152
152
|
form: v,
|
|
153
|
-
children: [A === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "" }) : null, Array.from(
|
|
154
|
-
},
|
|
153
|
+
children: [A === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "" }) : null, Array.from(P)]
|
|
154
|
+
}, I) : null]
|
|
155
155
|
})
|
|
156
156
|
});
|
|
157
157
|
};
|
|
158
158
|
Select$1.displayName = SELECT_NAME;
|
|
159
|
-
var TRIGGER_NAME = "SelectTrigger", SelectTrigger$1 = import_react.forwardRef((
|
|
160
|
-
let { __scopeSelect: a, disabled: o = false, ...c } =
|
|
161
|
-
let i2 = p().filter((
|
|
159
|
+
var TRIGGER_NAME = "SelectTrigger", SelectTrigger$1 = import_react.forwardRef((e, i) => {
|
|
160
|
+
let { __scopeSelect: a, disabled: o = false, ...c } = e, l = usePopperScope(a), u = useSelectContext(TRIGGER_NAME, a), d = u.disabled || o, f = useComposedRefs(i, u.onTriggerChange), p = useCollection(a), m = import_react.useRef("touch"), [h, g, v] = useTypeaheadSearch((e2) => {
|
|
161
|
+
let i2 = p().filter((e3) => !e3.disabled), a2 = findNextItem(i2, e2, i2.find((e3) => e3.value === u.value));
|
|
162
162
|
a2 !== void 0 && u.onValueChange(a2.value);
|
|
163
|
-
}), y = (
|
|
164
|
-
d || (u.onOpenChange(true), v()),
|
|
165
|
-
x: Math.round(
|
|
166
|
-
y: Math.round(
|
|
163
|
+
}), y = (e2) => {
|
|
164
|
+
d || (u.onOpenChange(true), v()), e2 && (u.triggerPointerDownPosRef.current = {
|
|
165
|
+
x: Math.round(e2.pageX),
|
|
166
|
+
y: Math.round(e2.pageY)
|
|
167
167
|
});
|
|
168
168
|
};
|
|
169
169
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Anchor, {
|
|
@@ -183,24 +183,24 @@ var TRIGGER_NAME = "SelectTrigger", SelectTrigger$1 = import_react.forwardRef((t
|
|
|
183
183
|
"data-placeholder": shouldShowPlaceholder(u.value) ? "" : void 0,
|
|
184
184
|
...c,
|
|
185
185
|
ref: f,
|
|
186
|
-
onClick: composeEventHandlers(c.onClick, (
|
|
187
|
-
|
|
186
|
+
onClick: composeEventHandlers(c.onClick, (e2) => {
|
|
187
|
+
e2.currentTarget.focus(), m.current !== "mouse" && y(e2);
|
|
188
188
|
}),
|
|
189
|
-
onPointerDown: composeEventHandlers(c.onPointerDown, (
|
|
190
|
-
m.current =
|
|
191
|
-
let i2 =
|
|
192
|
-
i2.hasPointerCapture(
|
|
189
|
+
onPointerDown: composeEventHandlers(c.onPointerDown, (e2) => {
|
|
190
|
+
m.current = e2.pointerType;
|
|
191
|
+
let i2 = e2.target;
|
|
192
|
+
i2.hasPointerCapture(e2.pointerId) && i2.releasePointerCapture(e2.pointerId), e2.button === 0 && e2.ctrlKey === false && e2.pointerType === "mouse" && (y(e2), e2.preventDefault());
|
|
193
193
|
}),
|
|
194
|
-
onKeyDown: composeEventHandlers(c.onKeyDown, (
|
|
194
|
+
onKeyDown: composeEventHandlers(c.onKeyDown, (e2) => {
|
|
195
195
|
let i2 = h.current !== "";
|
|
196
|
-
!(
|
|
196
|
+
!(e2.ctrlKey || e2.altKey || e2.metaKey) && e2.key.length === 1 && g(e2.key), !(i2 && e2.key === " ") && OPEN_KEYS.includes(e2.key) && (y(), e2.preventDefault());
|
|
197
197
|
})
|
|
198
198
|
})
|
|
199
199
|
});
|
|
200
200
|
});
|
|
201
201
|
SelectTrigger$1.displayName = TRIGGER_NAME;
|
|
202
|
-
var VALUE_NAME = "SelectValue", SelectValue$1 = import_react.forwardRef((
|
|
203
|
-
let { __scopeSelect: a, className: o, style: c, children: l, placeholder: u = "", ...d } =
|
|
202
|
+
var VALUE_NAME = "SelectValue", SelectValue$1 = import_react.forwardRef((e, i) => {
|
|
203
|
+
let { __scopeSelect: a, className: o, style: c, children: l, placeholder: u = "", ...d } = e, f = useSelectContext(VALUE_NAME, a), { onValueNodeHasChildrenChange: p } = f, m = l !== void 0, h = useComposedRefs(i, f.onValueNodeChange);
|
|
204
204
|
return useLayoutEffect2(() => {
|
|
205
205
|
p(m);
|
|
206
206
|
}, [p, m]), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.span, {
|
|
@@ -211,8 +211,8 @@ var VALUE_NAME = "SelectValue", SelectValue$1 = import_react.forwardRef((t, i) =
|
|
|
211
211
|
});
|
|
212
212
|
});
|
|
213
213
|
SelectValue$1.displayName = VALUE_NAME;
|
|
214
|
-
var ICON_NAME = "SelectIcon", SelectIcon = import_react.forwardRef((
|
|
215
|
-
let { __scopeSelect: a, children: o, ...s } =
|
|
214
|
+
var ICON_NAME = "SelectIcon", SelectIcon = import_react.forwardRef((e, i) => {
|
|
215
|
+
let { __scopeSelect: a, children: o, ...s } = e;
|
|
216
216
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.span, {
|
|
217
217
|
"aria-hidden": true,
|
|
218
218
|
...s,
|
|
@@ -221,42 +221,42 @@ var ICON_NAME = "SelectIcon", SelectIcon = import_react.forwardRef((t, i) => {
|
|
|
221
221
|
});
|
|
222
222
|
});
|
|
223
223
|
SelectIcon.displayName = ICON_NAME;
|
|
224
|
-
var PORTAL_NAME = "SelectPortal", SelectPortal$1 = (
|
|
224
|
+
var PORTAL_NAME = "SelectPortal", SelectPortal$1 = (e) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal, {
|
|
225
225
|
asChild: true,
|
|
226
|
-
...
|
|
226
|
+
...e
|
|
227
227
|
});
|
|
228
228
|
SelectPortal$1.displayName = PORTAL_NAME;
|
|
229
|
-
var CONTENT_NAME = "SelectContent", SelectContent$1 = import_react.forwardRef((
|
|
230
|
-
let a = useSelectContext(CONTENT_NAME,
|
|
229
|
+
var CONTENT_NAME = "SelectContent", SelectContent$1 = import_react.forwardRef((e, i) => {
|
|
230
|
+
let a = useSelectContext(CONTENT_NAME, e.__scopeSelect), [o, s] = import_react.useState();
|
|
231
231
|
if (useLayoutEffect2(() => {
|
|
232
232
|
s(new DocumentFragment());
|
|
233
233
|
}, []), !a.open) {
|
|
234
234
|
let i2 = o;
|
|
235
235
|
return i2 ? import_react_dom.createPortal(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectContentProvider, {
|
|
236
|
-
scope:
|
|
236
|
+
scope: e.__scopeSelect,
|
|
237
237
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Slot, {
|
|
238
|
-
scope:
|
|
239
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children:
|
|
238
|
+
scope: e.__scopeSelect,
|
|
239
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: e.children })
|
|
240
240
|
})
|
|
241
241
|
}), i2) : null;
|
|
242
242
|
}
|
|
243
243
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectContentImpl, {
|
|
244
|
-
...
|
|
244
|
+
...e,
|
|
245
245
|
ref: i
|
|
246
246
|
});
|
|
247
247
|
});
|
|
248
248
|
SelectContent$1.displayName = CONTENT_NAME;
|
|
249
|
-
var CONTENT_MARGIN = 10, [SelectContentProvider, useSelectContentContext] = createSelectContext(CONTENT_NAME), CONTENT_IMPL_NAME = "SelectContentImpl", Slot = createSlot("SelectContent.RemoveScroll"), SelectContentImpl = import_react.forwardRef((
|
|
250
|
-
let { __scopeSelect: a, position: o = "item-aligned", onCloseAutoFocus: c, onEscapeKeyDown: l, onPointerDownOutside: u, side: d, sideOffset: f, align: p, alignOffset: m, arrowPadding: h, collisionBoundary: g, collisionPadding: _, sticky: v, hideWhenDetached: y, avoidCollisions: b, ...x } =
|
|
249
|
+
var CONTENT_MARGIN = 10, [SelectContentProvider, useSelectContentContext] = createSelectContext(CONTENT_NAME), CONTENT_IMPL_NAME = "SelectContentImpl", Slot = createSlot("SelectContent.RemoveScroll"), SelectContentImpl = import_react.forwardRef((e, i) => {
|
|
250
|
+
let { __scopeSelect: a, position: o = "item-aligned", onCloseAutoFocus: c, onEscapeKeyDown: l, onPointerDownOutside: u, side: d, sideOffset: f, align: p, alignOffset: m, arrowPadding: h, collisionBoundary: g, collisionPadding: _, sticky: v, hideWhenDetached: y, avoidCollisions: b, ...x } = e, S = useSelectContext(CONTENT_NAME, a), [C, w] = import_react.useState(null), [T, O] = import_react.useState(null), k = useComposedRefs(i, (e2) => w(e2)), [A, j] = import_react.useState(null), [N, L] = import_react.useState(null), R = useCollection(a), [z, B] = import_react.useState(false), V = import_react.useRef(false);
|
|
251
251
|
import_react.useEffect(() => {
|
|
252
252
|
if (C) return hideOthers(C);
|
|
253
253
|
}, [C]), useFocusGuards();
|
|
254
|
-
let H = import_react.useCallback((
|
|
255
|
-
let [i2, ...a2] = R().map((
|
|
256
|
-
for (let a3 of
|
|
257
|
-
}, [R, T]), U = import_react.useCallback(() => H([
|
|
254
|
+
let H = import_react.useCallback((e2) => {
|
|
255
|
+
let [i2, ...a2] = R().map((e3) => e3.ref.current), [o2] = a2.slice(-1), s = document.activeElement;
|
|
256
|
+
for (let a3 of e2) if (a3 === s || (a3 == null ? void 0 : a3.scrollIntoView({ block: "nearest" }), a3 === i2 && T && (T.scrollTop = 0), a3 === o2 && T && (T.scrollTop = T.scrollHeight), a3 == null ? void 0 : a3.focus(), document.activeElement !== s)) return;
|
|
257
|
+
}, [R, T]), U = import_react.useCallback(() => H([A, C]), [
|
|
258
258
|
H,
|
|
259
|
-
|
|
259
|
+
A,
|
|
260
260
|
C
|
|
261
261
|
]);
|
|
262
262
|
import_react.useEffect(() => {
|
|
@@ -265,17 +265,17 @@ var CONTENT_MARGIN = 10, [SelectContentProvider, useSelectContentContext] = crea
|
|
|
265
265
|
let { onOpenChange: W, triggerPointerDownPosRef: G } = S;
|
|
266
266
|
import_react.useEffect(() => {
|
|
267
267
|
if (C) {
|
|
268
|
-
let
|
|
268
|
+
let e2 = {
|
|
269
269
|
x: 0,
|
|
270
270
|
y: 0
|
|
271
271
|
}, i2 = (i3) => {
|
|
272
272
|
var _a, _b;
|
|
273
|
-
|
|
273
|
+
e2 = {
|
|
274
274
|
x: Math.abs(Math.round(i3.pageX) - (((_a = G.current) == null ? void 0 : _a.x) ?? 0)),
|
|
275
275
|
y: Math.abs(Math.round(i3.pageY) - (((_b = G.current) == null ? void 0 : _b.y) ?? 0))
|
|
276
276
|
};
|
|
277
277
|
}, a2 = (a3) => {
|
|
278
|
-
|
|
278
|
+
e2.x <= 10 && e2.y <= 10 ? a3.preventDefault() : C.contains(a3.target) || W(false), document.removeEventListener("pointermove", i2), G.current = null;
|
|
279
279
|
};
|
|
280
280
|
return G.current !== null && (document.addEventListener("pointermove", i2), document.addEventListener("pointerup", a2, {
|
|
281
281
|
capture: true,
|
|
@@ -289,20 +289,20 @@ var CONTENT_MARGIN = 10, [SelectContentProvider, useSelectContentContext] = crea
|
|
|
289
289
|
W,
|
|
290
290
|
G
|
|
291
291
|
]), import_react.useEffect(() => {
|
|
292
|
-
let
|
|
293
|
-
return window.addEventListener("blur",
|
|
294
|
-
window.removeEventListener("blur",
|
|
292
|
+
let e2 = () => W(false);
|
|
293
|
+
return window.addEventListener("blur", e2), window.addEventListener("resize", e2), () => {
|
|
294
|
+
window.removeEventListener("blur", e2), window.removeEventListener("resize", e2);
|
|
295
295
|
};
|
|
296
296
|
}, [W]);
|
|
297
|
-
let [K, q] = useTypeaheadSearch((
|
|
298
|
-
let i2 = R().filter((
|
|
297
|
+
let [K, q] = useTypeaheadSearch((e2) => {
|
|
298
|
+
let i2 = R().filter((e3) => !e3.disabled), a2 = findNextItem(i2, e2, i2.find((e3) => e3.ref.current === document.activeElement));
|
|
299
299
|
a2 && setTimeout(() => a2.ref.current.focus());
|
|
300
|
-
}), J = import_react.useCallback((
|
|
300
|
+
}), J = import_react.useCallback((e2, i2, a2) => {
|
|
301
301
|
let o2 = !V.current && !a2;
|
|
302
|
-
(S.value !== void 0 && S.value === i2 || o2) && (
|
|
303
|
-
}, [S.value]), Y = import_react.useCallback(() => C == null ? void 0 : C.focus(), [C]), Z = import_react.useCallback((
|
|
302
|
+
(S.value !== void 0 && S.value === i2 || o2) && (j(e2), o2 && (V.current = true));
|
|
303
|
+
}, [S.value]), Y = import_react.useCallback(() => C == null ? void 0 : C.focus(), [C]), Z = import_react.useCallback((e2, i2, a2) => {
|
|
304
304
|
let o2 = !V.current && !a2;
|
|
305
|
-
(S.value !== void 0 && S.value === i2 || o2) && L(
|
|
305
|
+
(S.value !== void 0 && S.value === i2 || o2) && L(e2);
|
|
306
306
|
}, [S.value]), Q = o === "popper" ? SelectPopperPosition : SelectItemAlignedPosition, $ = Q === SelectPopperPosition ? {
|
|
307
307
|
side: d,
|
|
308
308
|
sideOffset: f,
|
|
@@ -319,13 +319,13 @@ var CONTENT_MARGIN = 10, [SelectContentProvider, useSelectContentContext] = crea
|
|
|
319
319
|
scope: a,
|
|
320
320
|
content: C,
|
|
321
321
|
viewport: T,
|
|
322
|
-
onViewportChange:
|
|
322
|
+
onViewportChange: O,
|
|
323
323
|
itemRefCallback: J,
|
|
324
|
-
selectedItem:
|
|
324
|
+
selectedItem: A,
|
|
325
325
|
onItemLeave: Y,
|
|
326
326
|
itemTextRefCallback: Z,
|
|
327
327
|
focusSelectedItem: U,
|
|
328
|
-
selectedItemText:
|
|
328
|
+
selectedItemText: N,
|
|
329
329
|
position: o,
|
|
330
330
|
isPositioned: z,
|
|
331
331
|
searchRef: K,
|
|
@@ -335,50 +335,50 @@ var CONTENT_MARGIN = 10, [SelectContentProvider, useSelectContentContext] = crea
|
|
|
335
335
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FocusScope, {
|
|
336
336
|
asChild: true,
|
|
337
337
|
trapped: S.open,
|
|
338
|
-
onMountAutoFocus: (
|
|
339
|
-
|
|
338
|
+
onMountAutoFocus: (e2) => {
|
|
339
|
+
e2.preventDefault();
|
|
340
340
|
},
|
|
341
|
-
onUnmountAutoFocus: composeEventHandlers(c, (
|
|
341
|
+
onUnmountAutoFocus: composeEventHandlers(c, (e2) => {
|
|
342
342
|
var _a;
|
|
343
|
-
(_a = S.trigger) == null ? void 0 : _a.focus({ preventScroll: true }),
|
|
343
|
+
(_a = S.trigger) == null ? void 0 : _a.focus({ preventScroll: true }), e2.preventDefault();
|
|
344
344
|
}),
|
|
345
345
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DismissableLayer, {
|
|
346
346
|
asChild: true,
|
|
347
347
|
disableOutsidePointerEvents: true,
|
|
348
348
|
onEscapeKeyDown: l,
|
|
349
349
|
onPointerDownOutside: u,
|
|
350
|
-
onFocusOutside: (
|
|
350
|
+
onFocusOutside: (e2) => e2.preventDefault(),
|
|
351
351
|
onDismiss: () => S.onOpenChange(false),
|
|
352
352
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Q, {
|
|
353
353
|
role: "listbox",
|
|
354
354
|
id: S.contentId,
|
|
355
355
|
"data-state": S.open ? "open" : "closed",
|
|
356
356
|
dir: S.dir,
|
|
357
|
-
onContextMenu: (
|
|
357
|
+
onContextMenu: (e2) => e2.preventDefault(),
|
|
358
358
|
...x,
|
|
359
359
|
...$,
|
|
360
360
|
onPlaced: () => B(true),
|
|
361
|
-
ref:
|
|
361
|
+
ref: k,
|
|
362
362
|
style: {
|
|
363
363
|
display: "flex",
|
|
364
364
|
flexDirection: "column",
|
|
365
365
|
outline: "none",
|
|
366
366
|
...x.style
|
|
367
367
|
},
|
|
368
|
-
onKeyDown: composeEventHandlers(x.onKeyDown, (
|
|
369
|
-
let i2 =
|
|
370
|
-
if (
|
|
368
|
+
onKeyDown: composeEventHandlers(x.onKeyDown, (e2) => {
|
|
369
|
+
let i2 = e2.ctrlKey || e2.altKey || e2.metaKey;
|
|
370
|
+
if (e2.key === "Tab" && e2.preventDefault(), !i2 && e2.key.length === 1 && q(e2.key), [
|
|
371
371
|
"ArrowUp",
|
|
372
372
|
"ArrowDown",
|
|
373
373
|
"Home",
|
|
374
374
|
"End"
|
|
375
|
-
].includes(
|
|
376
|
-
let i3 = R().filter((
|
|
377
|
-
if (["ArrowUp", "End"].includes(
|
|
378
|
-
let a2 =
|
|
375
|
+
].includes(e2.key)) {
|
|
376
|
+
let i3 = R().filter((e3) => !e3.disabled).map((e3) => e3.ref.current);
|
|
377
|
+
if (["ArrowUp", "End"].includes(e2.key) && (i3 = i3.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(e2.key)) {
|
|
378
|
+
let a2 = e2.target, o2 = i3.indexOf(a2);
|
|
379
379
|
i3 = i3.slice(o2 + 1);
|
|
380
380
|
}
|
|
381
|
-
setTimeout(() => H(i3)),
|
|
381
|
+
setTimeout(() => H(i3)), e2.preventDefault();
|
|
382
382
|
}
|
|
383
383
|
})
|
|
384
384
|
})
|
|
@@ -388,30 +388,30 @@ var CONTENT_MARGIN = 10, [SelectContentProvider, useSelectContentContext] = crea
|
|
|
388
388
|
});
|
|
389
389
|
});
|
|
390
390
|
SelectContentImpl.displayName = CONTENT_IMPL_NAME;
|
|
391
|
-
var ITEM_ALIGNED_POSITION_NAME = "SelectItemAlignedPosition", SelectItemAlignedPosition = import_react.forwardRef((
|
|
392
|
-
let { __scopeSelect: a, onPlaced: o, ...c } =
|
|
391
|
+
var ITEM_ALIGNED_POSITION_NAME = "SelectItemAlignedPosition", SelectItemAlignedPosition = import_react.forwardRef((e, i) => {
|
|
392
|
+
let { __scopeSelect: a, onPlaced: o, ...c } = e, l = useSelectContext(CONTENT_NAME, a), u = useSelectContentContext(CONTENT_NAME, a), [d, f] = import_react.useState(null), [p, m] = import_react.useState(null), h = useComposedRefs(i, (e2) => m(e2)), g = useCollection(a), _ = import_react.useRef(false), v = import_react.useRef(true), { viewport: y, selectedItem: b, selectedItemText: x, focusSelectedItem: S } = u, C = import_react.useCallback(() => {
|
|
393
393
|
if (l.trigger && l.valueNode && d && p && y && b && x) {
|
|
394
|
-
let
|
|
394
|
+
let e2 = l.trigger.getBoundingClientRect(), i2 = p.getBoundingClientRect(), a2 = l.valueNode.getBoundingClientRect(), s = x.getBoundingClientRect();
|
|
395
395
|
if (l.dir !== "rtl") {
|
|
396
|
-
let o2 = s.left - i2.left, c3 = a2.left - o2, l2 =
|
|
396
|
+
let o2 = s.left - i2.left, c3 = a2.left - o2, l2 = e2.left - c3, u3 = e2.width + l2, f3 = Math.max(u3, i2.width), p2 = window.innerWidth - CONTENT_MARGIN, m3 = clamp(c3, [CONTENT_MARGIN, Math.max(CONTENT_MARGIN, p2 - f3)]);
|
|
397
397
|
d.style.minWidth = u3 + "px", d.style.left = m3 + "px";
|
|
398
398
|
} else {
|
|
399
|
-
let o2 = i2.right - s.right, c3 = window.innerWidth - a2.right - o2, l2 = window.innerWidth -
|
|
399
|
+
let o2 = i2.right - s.right, c3 = window.innerWidth - a2.right - o2, l2 = window.innerWidth - e2.right - c3, u3 = e2.width + l2, f3 = Math.max(u3, i2.width), p2 = window.innerWidth - CONTENT_MARGIN, m3 = clamp(c3, [CONTENT_MARGIN, Math.max(CONTENT_MARGIN, p2 - f3)]);
|
|
400
400
|
d.style.minWidth = u3 + "px", d.style.right = m3 + "px";
|
|
401
401
|
}
|
|
402
|
-
let c2 = g(), u2 = window.innerHeight - CONTENT_MARGIN * 2, f2 = y.scrollHeight, m2 = window.getComputedStyle(p), h2 = parseInt(m2.borderTopWidth, 10), v2 = parseInt(m2.paddingTop, 10), S2 = parseInt(m2.borderBottomWidth, 10), C2 = parseInt(m2.paddingBottom, 10), w2 = h2 + v2 + f2 + C2 + S2,
|
|
402
|
+
let c2 = g(), u2 = window.innerHeight - CONTENT_MARGIN * 2, f2 = y.scrollHeight, m2 = window.getComputedStyle(p), h2 = parseInt(m2.borderTopWidth, 10), v2 = parseInt(m2.paddingTop, 10), S2 = parseInt(m2.borderBottomWidth, 10), C2 = parseInt(m2.paddingBottom, 10), w2 = h2 + v2 + f2 + C2 + S2, T = Math.min(b.offsetHeight * 5, w2), E2 = window.getComputedStyle(y), D = parseInt(E2.paddingTop, 10), O = parseInt(E2.paddingBottom, 10), k = e2.top + e2.height / 2 - CONTENT_MARGIN, A = u2 - k, j = b.offsetHeight / 2, M = b.offsetTop + j, N = h2 + v2 + M, P = w2 - N;
|
|
403
403
|
if (N <= k) {
|
|
404
|
-
let
|
|
404
|
+
let e3 = c2.length > 0 && b === c2[c2.length - 1].ref.current;
|
|
405
405
|
d.style.bottom = "0px";
|
|
406
|
-
let i3 = p.clientHeight - y.offsetTop - y.offsetHeight, a3 = N + Math.max(A, j + (
|
|
406
|
+
let i3 = p.clientHeight - y.offsetTop - y.offsetHeight, a3 = N + Math.max(A, j + (e3 ? O : 0) + i3 + S2);
|
|
407
407
|
d.style.height = a3 + "px";
|
|
408
408
|
} else {
|
|
409
|
-
let
|
|
409
|
+
let e3 = c2.length > 0 && b === c2[0].ref.current;
|
|
410
410
|
d.style.top = "0px";
|
|
411
|
-
let i3 = Math.max(k, h2 + y.offsetTop + (
|
|
411
|
+
let i3 = Math.max(k, h2 + y.offsetTop + (e3 ? D : 0) + j) + P;
|
|
412
412
|
d.style.height = i3 + "px", y.scrollTop = N - k + y.offsetTop;
|
|
413
413
|
}
|
|
414
|
-
d.style.margin = `${CONTENT_MARGIN}px 0`, d.style.minHeight =
|
|
414
|
+
d.style.margin = `${CONTENT_MARGIN}px 0`, d.style.minHeight = T + "px", d.style.maxHeight = u2 + "px", o == null ? void 0 : o(), requestAnimationFrame(() => _.current = true);
|
|
415
415
|
}
|
|
416
416
|
}, [
|
|
417
417
|
g,
|
|
@@ -426,15 +426,15 @@ var ITEM_ALIGNED_POSITION_NAME = "SelectItemAlignedPosition", SelectItemAlignedP
|
|
|
426
426
|
o
|
|
427
427
|
]);
|
|
428
428
|
useLayoutEffect2(() => C(), [C]);
|
|
429
|
-
let [w,
|
|
429
|
+
let [w, E] = import_react.useState();
|
|
430
430
|
return useLayoutEffect2(() => {
|
|
431
|
-
p &&
|
|
431
|
+
p && E(window.getComputedStyle(p).zIndex);
|
|
432
432
|
}, [p]), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectViewportProvider, {
|
|
433
433
|
scope: a,
|
|
434
434
|
contentWrapper: d,
|
|
435
435
|
shouldExpandOnScrollRef: _,
|
|
436
|
-
onScrollButtonChange: import_react.useCallback((
|
|
437
|
-
|
|
436
|
+
onScrollButtonChange: import_react.useCallback((e2) => {
|
|
437
|
+
e2 && v.current === true && (C(), S == null ? void 0 : S(), v.current = false);
|
|
438
438
|
}, [C, S]),
|
|
439
439
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
440
440
|
ref: f,
|
|
@@ -457,8 +457,8 @@ var ITEM_ALIGNED_POSITION_NAME = "SelectItemAlignedPosition", SelectItemAlignedP
|
|
|
457
457
|
});
|
|
458
458
|
});
|
|
459
459
|
SelectItemAlignedPosition.displayName = ITEM_ALIGNED_POSITION_NAME;
|
|
460
|
-
var POPPER_POSITION_NAME = "SelectPopperPosition", SelectPopperPosition = import_react.forwardRef((
|
|
461
|
-
let { __scopeSelect: a, align: o = "start", collisionPadding: s = CONTENT_MARGIN, ...c } =
|
|
460
|
+
var POPPER_POSITION_NAME = "SelectPopperPosition", SelectPopperPosition = import_react.forwardRef((e, i) => {
|
|
461
|
+
let { __scopeSelect: a, align: o = "start", collisionPadding: s = CONTENT_MARGIN, ...c } = e, l = usePopperScope(a);
|
|
462
462
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Content, {
|
|
463
463
|
...l,
|
|
464
464
|
...c,
|
|
@@ -477,8 +477,8 @@ var POPPER_POSITION_NAME = "SelectPopperPosition", SelectPopperPosition = import
|
|
|
477
477
|
});
|
|
478
478
|
});
|
|
479
479
|
SelectPopperPosition.displayName = POPPER_POSITION_NAME;
|
|
480
|
-
var [SelectViewportProvider, useSelectViewportContext] = createSelectContext(CONTENT_NAME, {}), VIEWPORT_NAME = "SelectViewport", SelectViewport = import_react.forwardRef((
|
|
481
|
-
let { __scopeSelect: a, nonce: o, ...c } =
|
|
480
|
+
var [SelectViewportProvider, useSelectViewportContext] = createSelectContext(CONTENT_NAME, {}), VIEWPORT_NAME = "SelectViewport", SelectViewport = import_react.forwardRef((e, i) => {
|
|
481
|
+
let { __scopeSelect: a, nonce: o, ...c } = e, l = useSelectContentContext(VIEWPORT_NAME, a), u = useSelectViewportContext(VIEWPORT_NAME, a), d = useComposedRefs(i, l.onViewportChange), f = import_react.useRef(0);
|
|
482
482
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", {
|
|
483
483
|
dangerouslySetInnerHTML: { __html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}" },
|
|
484
484
|
nonce: o
|
|
@@ -495,14 +495,14 @@ var [SelectViewportProvider, useSelectViewportContext] = createSelectContext(CON
|
|
|
495
495
|
overflow: "hidden auto",
|
|
496
496
|
...c.style
|
|
497
497
|
},
|
|
498
|
-
onScroll: composeEventHandlers(c.onScroll, (
|
|
499
|
-
let i2 =
|
|
498
|
+
onScroll: composeEventHandlers(c.onScroll, (e2) => {
|
|
499
|
+
let i2 = e2.currentTarget, { contentWrapper: a2, shouldExpandOnScrollRef: o2 } = u;
|
|
500
500
|
if ((o2 == null ? void 0 : o2.current) && a2) {
|
|
501
|
-
let
|
|
502
|
-
if (
|
|
501
|
+
let e3 = Math.abs(f.current - i2.scrollTop);
|
|
502
|
+
if (e3 > 0) {
|
|
503
503
|
let o3 = window.innerHeight - CONTENT_MARGIN * 2, s = parseFloat(a2.style.minHeight), c2 = parseFloat(a2.style.height), l2 = Math.max(s, c2);
|
|
504
504
|
if (l2 < o3) {
|
|
505
|
-
let s2 = l2 +
|
|
505
|
+
let s2 = l2 + e3, c3 = Math.min(o3, s2), u2 = s2 - c3;
|
|
506
506
|
a2.style.height = c3 + "px", a2.style.bottom === "0px" && (i2.scrollTop = u2 > 0 ? u2 : 0, a2.style.justifyContent = "flex-end");
|
|
507
507
|
}
|
|
508
508
|
}
|
|
@@ -513,8 +513,8 @@ var [SelectViewportProvider, useSelectViewportContext] = createSelectContext(CON
|
|
|
513
513
|
})] });
|
|
514
514
|
});
|
|
515
515
|
SelectViewport.displayName = VIEWPORT_NAME;
|
|
516
|
-
var GROUP_NAME = "SelectGroup", [SelectGroupContextProvider, useSelectGroupContext] = createSelectContext(GROUP_NAME), SelectGroup$1 = import_react.forwardRef((
|
|
517
|
-
let { __scopeSelect: a, ...o } =
|
|
516
|
+
var GROUP_NAME = "SelectGroup", [SelectGroupContextProvider, useSelectGroupContext] = createSelectContext(GROUP_NAME), SelectGroup$1 = import_react.forwardRef((e, i) => {
|
|
517
|
+
let { __scopeSelect: a, ...o } = e, s = useId();
|
|
518
518
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectGroupContextProvider, {
|
|
519
519
|
scope: a,
|
|
520
520
|
id: s,
|
|
@@ -527,8 +527,8 @@ var GROUP_NAME = "SelectGroup", [SelectGroupContextProvider, useSelectGroupConte
|
|
|
527
527
|
});
|
|
528
528
|
});
|
|
529
529
|
SelectGroup$1.displayName = GROUP_NAME;
|
|
530
|
-
var LABEL_NAME = "SelectLabel", SelectLabel$1 = import_react.forwardRef((
|
|
531
|
-
let { __scopeSelect: a, ...o } =
|
|
530
|
+
var LABEL_NAME = "SelectLabel", SelectLabel$1 = import_react.forwardRef((e, i) => {
|
|
531
|
+
let { __scopeSelect: a, ...o } = e, s = useSelectGroupContext(LABEL_NAME, a);
|
|
532
532
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
|
|
533
533
|
id: s.id,
|
|
534
534
|
...o,
|
|
@@ -536,10 +536,10 @@ var LABEL_NAME = "SelectLabel", SelectLabel$1 = import_react.forwardRef((t, i) =
|
|
|
536
536
|
});
|
|
537
537
|
});
|
|
538
538
|
SelectLabel$1.displayName = LABEL_NAME;
|
|
539
|
-
var ITEM_NAME = "SelectItem", [SelectItemContextProvider, useSelectItemContext] = createSelectContext(ITEM_NAME), SelectItem$1 = import_react.forwardRef((
|
|
540
|
-
let { __scopeSelect: a, value: o, disabled: c = false, textValue: l, ...u } =
|
|
539
|
+
var ITEM_NAME = "SelectItem", [SelectItemContextProvider, useSelectItemContext] = createSelectContext(ITEM_NAME), SelectItem$1 = import_react.forwardRef((e, i) => {
|
|
540
|
+
let { __scopeSelect: a, value: o, disabled: c = false, textValue: l, ...u } = e, d = useSelectContext(ITEM_NAME, a), f = useSelectContentContext(ITEM_NAME, a), p = d.value === o, [m, h] = import_react.useState(l ?? ""), [g, _] = import_react.useState(false), v = useComposedRefs(i, (e2) => {
|
|
541
541
|
var _a;
|
|
542
|
-
return (_a = f.itemRefCallback) == null ? void 0 : _a.call(f,
|
|
542
|
+
return (_a = f.itemRefCallback) == null ? void 0 : _a.call(f, e2, o, c);
|
|
543
543
|
}), y = useId(), b = import_react.useRef("touch"), x = () => {
|
|
544
544
|
c || (d.onValueChange(o), d.onOpenChange(false));
|
|
545
545
|
};
|
|
@@ -550,8 +550,8 @@ var ITEM_NAME = "SelectItem", [SelectItemContextProvider, useSelectItemContext]
|
|
|
550
550
|
disabled: c,
|
|
551
551
|
textId: y,
|
|
552
552
|
isSelected: p,
|
|
553
|
-
onItemTextChange: import_react.useCallback((
|
|
554
|
-
h((i2) => i2 || ((
|
|
553
|
+
onItemTextChange: import_react.useCallback((e2) => {
|
|
554
|
+
h((i2) => i2 || ((e2 == null ? void 0 : e2.textContent) ?? "").trim());
|
|
555
555
|
}, []),
|
|
556
556
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.ItemSlot, {
|
|
557
557
|
scope: a,
|
|
@@ -577,30 +577,30 @@ var ITEM_NAME = "SelectItem", [SelectItemContextProvider, useSelectItemContext]
|
|
|
577
577
|
onPointerUp: composeEventHandlers(u.onPointerUp, () => {
|
|
578
578
|
b.current === "mouse" && x();
|
|
579
579
|
}),
|
|
580
|
-
onPointerDown: composeEventHandlers(u.onPointerDown, (
|
|
581
|
-
b.current =
|
|
580
|
+
onPointerDown: composeEventHandlers(u.onPointerDown, (e2) => {
|
|
581
|
+
b.current = e2.pointerType;
|
|
582
582
|
}),
|
|
583
|
-
onPointerMove: composeEventHandlers(u.onPointerMove, (
|
|
583
|
+
onPointerMove: composeEventHandlers(u.onPointerMove, (e2) => {
|
|
584
584
|
var _a;
|
|
585
|
-
b.current =
|
|
585
|
+
b.current = e2.pointerType, c ? (_a = f.onItemLeave) == null ? void 0 : _a.call(f) : b.current === "mouse" && e2.currentTarget.focus({ preventScroll: true });
|
|
586
586
|
}),
|
|
587
|
-
onPointerLeave: composeEventHandlers(u.onPointerLeave, (
|
|
587
|
+
onPointerLeave: composeEventHandlers(u.onPointerLeave, (e2) => {
|
|
588
588
|
var _a;
|
|
589
|
-
|
|
589
|
+
e2.currentTarget === document.activeElement && ((_a = f.onItemLeave) == null ? void 0 : _a.call(f));
|
|
590
590
|
}),
|
|
591
|
-
onKeyDown: composeEventHandlers(u.onKeyDown, (
|
|
591
|
+
onKeyDown: composeEventHandlers(u.onKeyDown, (e2) => {
|
|
592
592
|
var _a;
|
|
593
|
-
((_a = f.searchRef) == null ? void 0 : _a.current) !== "" &&
|
|
593
|
+
((_a = f.searchRef) == null ? void 0 : _a.current) !== "" && e2.key === " " || (SELECTION_KEYS.includes(e2.key) && x(), e2.key === " " && e2.preventDefault());
|
|
594
594
|
})
|
|
595
595
|
})
|
|
596
596
|
})
|
|
597
597
|
});
|
|
598
598
|
});
|
|
599
599
|
SelectItem$1.displayName = ITEM_NAME;
|
|
600
|
-
var ITEM_TEXT_NAME = "SelectItemText", SelectItemText = import_react.forwardRef((
|
|
601
|
-
let { __scopeSelect: a, className: o, style: c, ...l } =
|
|
600
|
+
var ITEM_TEXT_NAME = "SelectItemText", SelectItemText = import_react.forwardRef((e, i) => {
|
|
601
|
+
let { __scopeSelect: a, className: o, style: c, ...l } = e, u = useSelectContext(ITEM_TEXT_NAME, a), d = useSelectContentContext(ITEM_TEXT_NAME, a), f = useSelectItemContext(ITEM_TEXT_NAME, a), p = useSelectNativeOptionsContext(ITEM_TEXT_NAME, a), [m, h] = import_react.useState(null), g = useComposedRefs(i, (e2) => h(e2), f.onItemTextChange, (e2) => {
|
|
602
602
|
var _a;
|
|
603
|
-
return (_a = d.itemTextRefCallback) == null ? void 0 : _a.call(d,
|
|
603
|
+
return (_a = d.itemTextRefCallback) == null ? void 0 : _a.call(d, e2, f.value, f.disabled);
|
|
604
604
|
}), _ = m == null ? void 0 : m.textContent, v = import_react.useMemo(() => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", {
|
|
605
605
|
value: f.value,
|
|
606
606
|
disabled: f.disabled,
|
|
@@ -621,8 +621,8 @@ var ITEM_TEXT_NAME = "SelectItemText", SelectItemText = import_react.forwardRef(
|
|
|
621
621
|
}), f.isSelected && u.valueNode && !u.valueNodeHasChildren ? import_react_dom.createPortal(l.children, u.valueNode) : null] });
|
|
622
622
|
});
|
|
623
623
|
SelectItemText.displayName = ITEM_TEXT_NAME;
|
|
624
|
-
var ITEM_INDICATOR_NAME = "SelectItemIndicator", SelectItemIndicator = import_react.forwardRef((
|
|
625
|
-
let { __scopeSelect: a, ...o } =
|
|
624
|
+
var ITEM_INDICATOR_NAME = "SelectItemIndicator", SelectItemIndicator = import_react.forwardRef((e, i) => {
|
|
625
|
+
let { __scopeSelect: a, ...o } = e;
|
|
626
626
|
return useSelectItemContext(ITEM_INDICATOR_NAME, a).isSelected ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.span, {
|
|
627
627
|
"aria-hidden": true,
|
|
628
628
|
...o,
|
|
@@ -630,52 +630,52 @@ var ITEM_INDICATOR_NAME = "SelectItemIndicator", SelectItemIndicator = import_re
|
|
|
630
630
|
}) : null;
|
|
631
631
|
});
|
|
632
632
|
SelectItemIndicator.displayName = ITEM_INDICATOR_NAME;
|
|
633
|
-
var SCROLL_UP_BUTTON_NAME = "SelectScrollUpButton", SelectScrollUpButton = import_react.forwardRef((
|
|
634
|
-
let a = useSelectContentContext(SCROLL_UP_BUTTON_NAME,
|
|
633
|
+
var SCROLL_UP_BUTTON_NAME = "SelectScrollUpButton", SelectScrollUpButton = import_react.forwardRef((e, i) => {
|
|
634
|
+
let a = useSelectContentContext(SCROLL_UP_BUTTON_NAME, e.__scopeSelect), o = useSelectViewportContext(SCROLL_UP_BUTTON_NAME, e.__scopeSelect), [c, l] = import_react.useState(false), u = useComposedRefs(i, o.onScrollButtonChange);
|
|
635
635
|
return useLayoutEffect2(() => {
|
|
636
636
|
if (a.viewport && a.isPositioned) {
|
|
637
|
-
let
|
|
637
|
+
let e2 = function() {
|
|
638
638
|
l(i2.scrollTop > 0);
|
|
639
639
|
}, i2 = a.viewport;
|
|
640
|
-
return
|
|
640
|
+
return e2(), i2.addEventListener("scroll", e2), () => i2.removeEventListener("scroll", e2);
|
|
641
641
|
}
|
|
642
642
|
}, [a.viewport, a.isPositioned]), c ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectScrollButtonImpl, {
|
|
643
|
-
...
|
|
643
|
+
...e,
|
|
644
644
|
ref: u,
|
|
645
645
|
onAutoScroll: () => {
|
|
646
|
-
let { viewport:
|
|
647
|
-
|
|
646
|
+
let { viewport: e2, selectedItem: i2 } = a;
|
|
647
|
+
e2 && i2 && (e2.scrollTop -= i2.offsetHeight);
|
|
648
648
|
}
|
|
649
649
|
}) : null;
|
|
650
650
|
});
|
|
651
651
|
SelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME;
|
|
652
|
-
var SCROLL_DOWN_BUTTON_NAME = "SelectScrollDownButton", SelectScrollDownButton = import_react.forwardRef((
|
|
653
|
-
let a = useSelectContentContext(SCROLL_DOWN_BUTTON_NAME,
|
|
652
|
+
var SCROLL_DOWN_BUTTON_NAME = "SelectScrollDownButton", SelectScrollDownButton = import_react.forwardRef((e, i) => {
|
|
653
|
+
let a = useSelectContentContext(SCROLL_DOWN_BUTTON_NAME, e.__scopeSelect), o = useSelectViewportContext(SCROLL_DOWN_BUTTON_NAME, e.__scopeSelect), [c, l] = import_react.useState(false), u = useComposedRefs(i, o.onScrollButtonChange);
|
|
654
654
|
return useLayoutEffect2(() => {
|
|
655
655
|
if (a.viewport && a.isPositioned) {
|
|
656
|
-
let
|
|
657
|
-
let
|
|
658
|
-
l(Math.ceil(i2.scrollTop) <
|
|
656
|
+
let e2 = function() {
|
|
657
|
+
let e3 = i2.scrollHeight - i2.clientHeight;
|
|
658
|
+
l(Math.ceil(i2.scrollTop) < e3);
|
|
659
659
|
}, i2 = a.viewport;
|
|
660
|
-
return
|
|
660
|
+
return e2(), i2.addEventListener("scroll", e2), () => i2.removeEventListener("scroll", e2);
|
|
661
661
|
}
|
|
662
662
|
}, [a.viewport, a.isPositioned]), c ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectScrollButtonImpl, {
|
|
663
|
-
...
|
|
663
|
+
...e,
|
|
664
664
|
ref: u,
|
|
665
665
|
onAutoScroll: () => {
|
|
666
|
-
let { viewport:
|
|
667
|
-
|
|
666
|
+
let { viewport: e2, selectedItem: i2 } = a;
|
|
667
|
+
e2 && i2 && (e2.scrollTop += i2.offsetHeight);
|
|
668
668
|
}
|
|
669
669
|
}) : null;
|
|
670
670
|
});
|
|
671
671
|
SelectScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME;
|
|
672
|
-
var SelectScrollButtonImpl = import_react.forwardRef((
|
|
673
|
-
let { __scopeSelect: a, onAutoScroll: o, ...s } =
|
|
672
|
+
var SelectScrollButtonImpl = import_react.forwardRef((e, i) => {
|
|
673
|
+
let { __scopeSelect: a, onAutoScroll: o, ...s } = e, c = useSelectContentContext("SelectScrollButton", a), l = import_react.useRef(null), u = useCollection(a), d = import_react.useCallback(() => {
|
|
674
674
|
l.current !== null && (window.clearInterval(l.current), l.current = null);
|
|
675
675
|
}, []);
|
|
676
676
|
return import_react.useEffect(() => () => d(), [d]), useLayoutEffect2(() => {
|
|
677
677
|
var _a, _b;
|
|
678
|
-
(_b = (_a = u().find((
|
|
678
|
+
(_b = (_a = u().find((e2) => e2.ref.current === document.activeElement)) == null ? void 0 : _a.ref.current) == null ? void 0 : _b.scrollIntoView({ block: "nearest" });
|
|
679
679
|
}, [u]), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
|
|
680
680
|
"aria-hidden": true,
|
|
681
681
|
...s,
|
|
@@ -695,8 +695,8 @@ var SelectScrollButtonImpl = import_react.forwardRef((t, i) => {
|
|
|
695
695
|
d();
|
|
696
696
|
})
|
|
697
697
|
});
|
|
698
|
-
}), SEPARATOR_NAME = "SelectSeparator", SelectSeparator$1 = import_react.forwardRef((
|
|
699
|
-
let { __scopeSelect: a, ...o } =
|
|
698
|
+
}), SEPARATOR_NAME = "SelectSeparator", SelectSeparator$1 = import_react.forwardRef((e, i) => {
|
|
699
|
+
let { __scopeSelect: a, ...o } = e;
|
|
700
700
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
|
|
701
701
|
"aria-hidden": true,
|
|
702
702
|
...o,
|
|
@@ -704,8 +704,8 @@ var SelectScrollButtonImpl = import_react.forwardRef((t, i) => {
|
|
|
704
704
|
});
|
|
705
705
|
});
|
|
706
706
|
SelectSeparator$1.displayName = SEPARATOR_NAME;
|
|
707
|
-
var ARROW_NAME = "SelectArrow", SelectArrow = import_react.forwardRef((
|
|
708
|
-
let { __scopeSelect: a, ...o } =
|
|
707
|
+
var ARROW_NAME = "SelectArrow", SelectArrow = import_react.forwardRef((e, i) => {
|
|
708
|
+
let { __scopeSelect: a, ...o } = e, s = usePopperScope(a), c = useSelectContext(ARROW_NAME, a), l = useSelectContentContext(ARROW_NAME, a);
|
|
709
709
|
return c.open && l.position === "popper" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Arrow, {
|
|
710
710
|
...s,
|
|
711
711
|
...o,
|
|
@@ -713,15 +713,15 @@ var ARROW_NAME = "SelectArrow", SelectArrow = import_react.forwardRef((t, i) =>
|
|
|
713
713
|
}) : null;
|
|
714
714
|
});
|
|
715
715
|
SelectArrow.displayName = ARROW_NAME;
|
|
716
|
-
var BUBBLE_INPUT_NAME = "SelectBubbleInput", SelectBubbleInput = import_react.forwardRef(({ __scopeSelect:
|
|
716
|
+
var BUBBLE_INPUT_NAME = "SelectBubbleInput", SelectBubbleInput = import_react.forwardRef(({ __scopeSelect: e, value: i, ...a }, o) => {
|
|
717
717
|
let c = import_react.useRef(null), l = useComposedRefs(o, c), u = usePrevious(i);
|
|
718
718
|
return import_react.useEffect(() => {
|
|
719
|
-
let
|
|
720
|
-
if (!
|
|
719
|
+
let e2 = c.current;
|
|
720
|
+
if (!e2) return;
|
|
721
721
|
let a2 = window.HTMLSelectElement.prototype, o2 = Object.getOwnPropertyDescriptor(a2, "value").set;
|
|
722
722
|
if (u !== i && o2) {
|
|
723
723
|
let a3 = new Event("change", { bubbles: true });
|
|
724
|
-
o2.call(
|
|
724
|
+
o2.call(e2, i), e2.dispatchEvent(a3);
|
|
725
725
|
}
|
|
726
726
|
}, [u, i]), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.select, {
|
|
727
727
|
...a,
|
|
@@ -734,14 +734,14 @@ var BUBBLE_INPUT_NAME = "SelectBubbleInput", SelectBubbleInput = import_react.fo
|
|
|
734
734
|
});
|
|
735
735
|
});
|
|
736
736
|
SelectBubbleInput.displayName = BUBBLE_INPUT_NAME;
|
|
737
|
-
function shouldShowPlaceholder(
|
|
738
|
-
return
|
|
737
|
+
function shouldShowPlaceholder(e) {
|
|
738
|
+
return e === "" || e === void 0;
|
|
739
739
|
}
|
|
740
|
-
function useTypeaheadSearch(
|
|
741
|
-
let i = useCallbackRef(
|
|
742
|
-
let s2 = a.current +
|
|
743
|
-
i(s2), (function
|
|
744
|
-
a.current = i2, window.clearTimeout(o.current), i2 !== "" && (o.current = window.setTimeout(() =>
|
|
740
|
+
function useTypeaheadSearch(e) {
|
|
741
|
+
let i = useCallbackRef(e), a = import_react.useRef(""), o = import_react.useRef(0), s = import_react.useCallback((e2) => {
|
|
742
|
+
let s2 = a.current + e2;
|
|
743
|
+
i(s2), (function e3(i2) {
|
|
744
|
+
a.current = i2, window.clearTimeout(o.current), i2 !== "" && (o.current = window.setTimeout(() => e3(""), 1e3));
|
|
745
745
|
})(s2);
|
|
746
746
|
}, [i]), c = import_react.useCallback(() => {
|
|
747
747
|
a.current = "", window.clearTimeout(o.current);
|
|
@@ -752,14 +752,14 @@ function useTypeaheadSearch(t) {
|
|
|
752
752
|
c
|
|
753
753
|
];
|
|
754
754
|
}
|
|
755
|
-
function findNextItem(
|
|
756
|
-
let o = i.length > 1 && Array.from(i).every((
|
|
757
|
-
o.length === 1 && (c = c.filter((
|
|
758
|
-
let l = c.find((
|
|
755
|
+
function findNextItem(e, i, a) {
|
|
756
|
+
let o = i.length > 1 && Array.from(i).every((e2) => e2 === i[0]) ? i[0] : i, s = a ? e.indexOf(a) : -1, c = wrapArray(e, Math.max(s, 0));
|
|
757
|
+
o.length === 1 && (c = c.filter((e2) => e2 !== a));
|
|
758
|
+
let l = c.find((e2) => e2.textValue.toLowerCase().startsWith(o.toLowerCase()));
|
|
759
759
|
return l === a ? void 0 : l;
|
|
760
760
|
}
|
|
761
|
-
function wrapArray(
|
|
762
|
-
return
|
|
761
|
+
function wrapArray(e, i) {
|
|
762
|
+
return e.map((a, o) => e[(i + o) % e.length]);
|
|
763
763
|
}
|
|
764
764
|
var Root2 = Select$1, Trigger = SelectTrigger$1, Value = SelectValue$1, Icon = SelectIcon, Portal$1 = SelectPortal$1, Content2 = SelectContent$1, Viewport = SelectViewport, Group = SelectGroup$1, Label = SelectLabel$1, Item = SelectItem$1, ItemText = SelectItemText, ItemIndicator = SelectItemIndicator, ScrollUpButton = SelectScrollUpButton, ScrollDownButton = SelectScrollDownButton, Separator = SelectSeparator$1, $b5e257d569688ac6$var$defaultContext = {
|
|
765
765
|
prefix: String(Math.round(Math.random() * 1e10)),
|
|
@@ -767,29 +767,29 @@ var Root2 = Select$1, Trigger = SelectTrigger$1, Value = SelectValue$1, Icon = S
|
|
|
767
767
|
}, $b5e257d569688ac6$var$SSRContext = /* @__PURE__ */ import_react.createContext($b5e257d569688ac6$var$defaultContext), $b5e257d569688ac6$var$IsSSRContext = /* @__PURE__ */ import_react.createContext(false);
|
|
768
768
|
typeof window < "u" && window.document && window.document.createElement;
|
|
769
769
|
var $b5e257d569688ac6$var$componentIds = /* @__PURE__ */ new WeakMap();
|
|
770
|
-
function $b5e257d569688ac6$var$useCounter(
|
|
770
|
+
function $b5e257d569688ac6$var$useCounter(e = false) {
|
|
771
771
|
var _a, _b;
|
|
772
772
|
let i = (0, import_react.useContext)($b5e257d569688ac6$var$SSRContext), a = (0, import_react.useRef)(null);
|
|
773
|
-
if (a.current === null && !
|
|
774
|
-
let
|
|
775
|
-
if (
|
|
776
|
-
let a2 = $b5e257d569688ac6$var$componentIds.get(
|
|
777
|
-
a2 == null ? $b5e257d569688ac6$var$componentIds.set(
|
|
773
|
+
if (a.current === null && !e) {
|
|
774
|
+
let e2 = (_b = (_a = import_react.default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) == null ? void 0 : _a.ReactCurrentOwner) == null ? void 0 : _b.current;
|
|
775
|
+
if (e2) {
|
|
776
|
+
let a2 = $b5e257d569688ac6$var$componentIds.get(e2);
|
|
777
|
+
a2 == null ? $b5e257d569688ac6$var$componentIds.set(e2, {
|
|
778
778
|
id: i.current,
|
|
779
|
-
state:
|
|
780
|
-
}) :
|
|
779
|
+
state: e2.memoizedState
|
|
780
|
+
}) : e2.memoizedState !== a2.state && (i.current = a2.id, $b5e257d569688ac6$var$componentIds.delete(e2));
|
|
781
781
|
}
|
|
782
782
|
a.current = ++i.current;
|
|
783
783
|
}
|
|
784
784
|
return a.current;
|
|
785
785
|
}
|
|
786
|
-
function $b5e257d569688ac6$var$useLegacySSRSafeId(
|
|
787
|
-
let i = (0, import_react.useContext)($b5e257d569688ac6$var$SSRContext), a = $b5e257d569688ac6$var$useCounter(!!
|
|
788
|
-
return
|
|
786
|
+
function $b5e257d569688ac6$var$useLegacySSRSafeId(e) {
|
|
787
|
+
let i = (0, import_react.useContext)($b5e257d569688ac6$var$SSRContext), a = $b5e257d569688ac6$var$useCounter(!!e), o = `react-aria${i.prefix}`;
|
|
788
|
+
return e || `${o}-${a}`;
|
|
789
789
|
}
|
|
790
|
-
function $b5e257d569688ac6$var$useModernSSRSafeId(
|
|
790
|
+
function $b5e257d569688ac6$var$useModernSSRSafeId(e) {
|
|
791
791
|
let i = import_react.useId(), [a] = (0, import_react.useState)($b5e257d569688ac6$export$535bd6ca7f90a273()), o = a ? "react-aria" : `react-aria${$b5e257d569688ac6$var$defaultContext.prefix}`;
|
|
792
|
-
return
|
|
792
|
+
return e || `${o}-${i}`;
|
|
793
793
|
}
|
|
794
794
|
var $b5e257d569688ac6$export$619500959fc48b26 = typeof import_react.useId == "function" ? $b5e257d569688ac6$var$useModernSSRSafeId : $b5e257d569688ac6$var$useLegacySSRSafeId;
|
|
795
795
|
function $b5e257d569688ac6$var$getSnapshot() {
|
|
@@ -798,7 +798,7 @@ function $b5e257d569688ac6$var$getSnapshot() {
|
|
|
798
798
|
function $b5e257d569688ac6$var$getServerSnapshot() {
|
|
799
799
|
return true;
|
|
800
800
|
}
|
|
801
|
-
function $b5e257d569688ac6$var$subscribe(
|
|
801
|
+
function $b5e257d569688ac6$var$subscribe(e) {
|
|
802
802
|
return () => {
|
|
803
803
|
};
|
|
804
804
|
}
|
|
@@ -837,64 +837,64 @@ var $148a7a147e38ea7f$var$RTL_SCRIPTS = /* @__PURE__ */ new Set([
|
|
|
837
837
|
"ur",
|
|
838
838
|
"yi"
|
|
839
839
|
]);
|
|
840
|
-
function $148a7a147e38ea7f$export$702d680b21cbd764(
|
|
840
|
+
function $148a7a147e38ea7f$export$702d680b21cbd764(e) {
|
|
841
841
|
if (Intl.Locale) {
|
|
842
|
-
let i2 = new Intl.Locale(
|
|
842
|
+
let i2 = new Intl.Locale(e).maximize(), a = typeof i2.getTextInfo == "function" ? i2.getTextInfo() : i2.textInfo;
|
|
843
843
|
if (a) return a.direction === "rtl";
|
|
844
844
|
if (i2.script) return $148a7a147e38ea7f$var$RTL_SCRIPTS.has(i2.script);
|
|
845
845
|
}
|
|
846
|
-
let i =
|
|
846
|
+
let i = e.split("-")[0];
|
|
847
847
|
return $148a7a147e38ea7f$var$RTL_LANGS.has(i);
|
|
848
848
|
}
|
|
849
849
|
var $1e5a04cdaf7d1af8$var$localeSymbol = /* @__PURE__ */ Symbol.for("react-aria.i18n.locale");
|
|
850
850
|
function $1e5a04cdaf7d1af8$export$f09106e7c6677ec5() {
|
|
851
|
-
let
|
|
851
|
+
let e = typeof window < "u" && window[$1e5a04cdaf7d1af8$var$localeSymbol] || typeof navigator < "u" && (navigator.language || navigator.userLanguage) || "en-US";
|
|
852
852
|
try {
|
|
853
|
-
Intl.DateTimeFormat.supportedLocalesOf([
|
|
853
|
+
Intl.DateTimeFormat.supportedLocalesOf([e]);
|
|
854
854
|
} catch {
|
|
855
|
-
|
|
855
|
+
e = "en-US";
|
|
856
856
|
}
|
|
857
857
|
return {
|
|
858
|
-
locale:
|
|
859
|
-
direction: $148a7a147e38ea7f$export$702d680b21cbd764(
|
|
858
|
+
locale: e,
|
|
859
|
+
direction: $148a7a147e38ea7f$export$702d680b21cbd764(e) ? "rtl" : "ltr"
|
|
860
860
|
};
|
|
861
861
|
}
|
|
862
862
|
var $1e5a04cdaf7d1af8$var$currentLocale = $1e5a04cdaf7d1af8$export$f09106e7c6677ec5(), $1e5a04cdaf7d1af8$var$listeners = /* @__PURE__ */ new Set();
|
|
863
863
|
function $1e5a04cdaf7d1af8$var$updateLocale() {
|
|
864
864
|
$1e5a04cdaf7d1af8$var$currentLocale = $1e5a04cdaf7d1af8$export$f09106e7c6677ec5();
|
|
865
|
-
for (let
|
|
865
|
+
for (let e of $1e5a04cdaf7d1af8$var$listeners) e($1e5a04cdaf7d1af8$var$currentLocale);
|
|
866
866
|
}
|
|
867
867
|
function $1e5a04cdaf7d1af8$export$188ec29ebc2bdc3a() {
|
|
868
|
-
let
|
|
868
|
+
let e = $b5e257d569688ac6$export$535bd6ca7f90a273(), [i, a] = (0, import_react.useState)($1e5a04cdaf7d1af8$var$currentLocale);
|
|
869
869
|
return (0, import_react.useEffect)(() => ($1e5a04cdaf7d1af8$var$listeners.size === 0 && window.addEventListener("languagechange", $1e5a04cdaf7d1af8$var$updateLocale), $1e5a04cdaf7d1af8$var$listeners.add(a), () => {
|
|
870
870
|
$1e5a04cdaf7d1af8$var$listeners.delete(a), $1e5a04cdaf7d1af8$var$listeners.size === 0 && window.removeEventListener("languagechange", $1e5a04cdaf7d1af8$var$updateLocale);
|
|
871
|
-
}), []),
|
|
871
|
+
}), []), e ? {
|
|
872
872
|
locale: typeof window < "u" && window[$1e5a04cdaf7d1af8$var$localeSymbol] || "en-US",
|
|
873
873
|
direction: "ltr"
|
|
874
874
|
} : i;
|
|
875
875
|
}
|
|
876
876
|
var $18f2051aff69b9bf$var$I18nContext = /* @__PURE__ */ import_react.createContext(null);
|
|
877
|
-
function $18f2051aff69b9bf$var$I18nProviderWithLocale(
|
|
878
|
-
let { locale: i, children: a } =
|
|
877
|
+
function $18f2051aff69b9bf$var$I18nProviderWithLocale(e) {
|
|
878
|
+
let { locale: i, children: a } = e, o = import_react.useMemo(() => ({
|
|
879
879
|
locale: i,
|
|
880
880
|
direction: $148a7a147e38ea7f$export$702d680b21cbd764(i) ? "rtl" : "ltr"
|
|
881
881
|
}), [i]);
|
|
882
882
|
return /* @__PURE__ */ import_react.createElement($18f2051aff69b9bf$var$I18nContext.Provider, { value: o }, a);
|
|
883
883
|
}
|
|
884
|
-
function $18f2051aff69b9bf$var$I18nProviderWithDefaultLocale(
|
|
885
|
-
let { children: i } =
|
|
884
|
+
function $18f2051aff69b9bf$var$I18nProviderWithDefaultLocale(e) {
|
|
885
|
+
let { children: i } = e, a = $1e5a04cdaf7d1af8$export$188ec29ebc2bdc3a();
|
|
886
886
|
return /* @__PURE__ */ import_react.createElement($18f2051aff69b9bf$var$I18nContext.Provider, { value: a }, i);
|
|
887
887
|
}
|
|
888
|
-
function $18f2051aff69b9bf$export$a54013f0d02a8f82(
|
|
889
|
-
let { locale: i, children: a } =
|
|
888
|
+
function $18f2051aff69b9bf$export$a54013f0d02a8f82(e) {
|
|
889
|
+
let { locale: i, children: a } = e;
|
|
890
890
|
return i ? /* @__PURE__ */ import_react.createElement($18f2051aff69b9bf$var$I18nProviderWithLocale, {
|
|
891
891
|
locale: i,
|
|
892
892
|
children: a
|
|
893
893
|
}) : /* @__PURE__ */ import_react.createElement($18f2051aff69b9bf$var$I18nProviderWithDefaultLocale, { children: a });
|
|
894
894
|
}
|
|
895
895
|
function $18f2051aff69b9bf$export$43bb16f9c6d9e3f7() {
|
|
896
|
-
let
|
|
897
|
-
return (0, import_react.useContext)($18f2051aff69b9bf$var$I18nContext) ||
|
|
896
|
+
let e = $1e5a04cdaf7d1af8$export$188ec29ebc2bdc3a();
|
|
897
|
+
return (0, import_react.useContext)($18f2051aff69b9bf$var$I18nContext) || e;
|
|
898
898
|
}
|
|
899
899
|
var $488c6ddbf4ef74c2$var$formatterCache = /* @__PURE__ */ new Map(), $488c6ddbf4ef74c2$var$supportsSignDisplay = false;
|
|
900
900
|
try {
|
|
@@ -915,32 +915,32 @@ var $488c6ddbf4ef74c2$var$UNITS = { degree: { narrow: {
|
|
|
915
915
|
"zh-TW": "\u5EA6",
|
|
916
916
|
"sl-SI": " \xB0"
|
|
917
917
|
} } }, $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5 = class {
|
|
918
|
-
format(
|
|
918
|
+
format(e) {
|
|
919
919
|
var _a;
|
|
920
920
|
let i = "";
|
|
921
|
-
if (i = !$488c6ddbf4ef74c2$var$supportsSignDisplay && this.options.signDisplay != null ? $488c6ddbf4ef74c2$export$711b50b3c525e0f2(this.numberFormatter, this.options.signDisplay,
|
|
922
|
-
let { unit:
|
|
923
|
-
if (!
|
|
924
|
-
let s = (_a = $488c6ddbf4ef74c2$var$UNITS[
|
|
921
|
+
if (i = !$488c6ddbf4ef74c2$var$supportsSignDisplay && this.options.signDisplay != null ? $488c6ddbf4ef74c2$export$711b50b3c525e0f2(this.numberFormatter, this.options.signDisplay, e) : this.numberFormatter.format(e), this.options.style === "unit" && !$488c6ddbf4ef74c2$var$supportsUnit) {
|
|
922
|
+
let { unit: e2, unitDisplay: a = "short", locale: o } = this.resolvedOptions();
|
|
923
|
+
if (!e2) return i;
|
|
924
|
+
let s = (_a = $488c6ddbf4ef74c2$var$UNITS[e2]) == null ? void 0 : _a[a];
|
|
925
925
|
i += s[o] || s.default;
|
|
926
926
|
}
|
|
927
927
|
return i;
|
|
928
928
|
}
|
|
929
|
-
formatToParts(
|
|
930
|
-
return this.numberFormatter.formatToParts(
|
|
929
|
+
formatToParts(e) {
|
|
930
|
+
return this.numberFormatter.formatToParts(e);
|
|
931
931
|
}
|
|
932
|
-
formatRange(
|
|
933
|
-
if (typeof this.numberFormatter.formatRange == "function") return this.numberFormatter.formatRange(
|
|
934
|
-
if (i <
|
|
935
|
-
return `${this.format(
|
|
932
|
+
formatRange(e, i) {
|
|
933
|
+
if (typeof this.numberFormatter.formatRange == "function") return this.numberFormatter.formatRange(e, i);
|
|
934
|
+
if (i < e) throw RangeError("End date must be >= start date");
|
|
935
|
+
return `${this.format(e)} \u2013 ${this.format(i)}`;
|
|
936
936
|
}
|
|
937
|
-
formatRangeToParts(
|
|
938
|
-
if (typeof this.numberFormatter.formatRangeToParts == "function") return this.numberFormatter.formatRangeToParts(
|
|
939
|
-
if (i <
|
|
940
|
-
let a = this.numberFormatter.formatToParts(
|
|
937
|
+
formatRangeToParts(e, i) {
|
|
938
|
+
if (typeof this.numberFormatter.formatRangeToParts == "function") return this.numberFormatter.formatRangeToParts(e, i);
|
|
939
|
+
if (i < e) throw RangeError("End date must be >= start date");
|
|
940
|
+
let a = this.numberFormatter.formatToParts(e), o = this.numberFormatter.formatToParts(i);
|
|
941
941
|
return [
|
|
942
|
-
...a.map((
|
|
943
|
-
...
|
|
942
|
+
...a.map((e2) => ({
|
|
943
|
+
...e2,
|
|
944
944
|
source: "startRange"
|
|
945
945
|
})),
|
|
946
946
|
{
|
|
@@ -948,65 +948,65 @@ var $488c6ddbf4ef74c2$var$UNITS = { degree: { narrow: {
|
|
|
948
948
|
value: " \u2013 ",
|
|
949
949
|
source: "shared"
|
|
950
950
|
},
|
|
951
|
-
...o.map((
|
|
952
|
-
...
|
|
951
|
+
...o.map((e2) => ({
|
|
952
|
+
...e2,
|
|
953
953
|
source: "endRange"
|
|
954
954
|
}))
|
|
955
955
|
];
|
|
956
956
|
}
|
|
957
957
|
resolvedOptions() {
|
|
958
|
-
let
|
|
959
|
-
return !$488c6ddbf4ef74c2$var$supportsSignDisplay && this.options.signDisplay != null && (
|
|
960
|
-
...
|
|
958
|
+
let e = this.numberFormatter.resolvedOptions();
|
|
959
|
+
return !$488c6ddbf4ef74c2$var$supportsSignDisplay && this.options.signDisplay != null && (e = {
|
|
960
|
+
...e,
|
|
961
961
|
signDisplay: this.options.signDisplay
|
|
962
|
-
}), !$488c6ddbf4ef74c2$var$supportsUnit && this.options.style === "unit" && (
|
|
963
|
-
...
|
|
962
|
+
}), !$488c6ddbf4ef74c2$var$supportsUnit && this.options.style === "unit" && (e = {
|
|
963
|
+
...e,
|
|
964
964
|
style: "unit",
|
|
965
965
|
unit: this.options.unit,
|
|
966
966
|
unitDisplay: this.options.unitDisplay
|
|
967
|
-
}),
|
|
967
|
+
}), e;
|
|
968
968
|
}
|
|
969
|
-
constructor(
|
|
970
|
-
this.numberFormatter = $488c6ddbf4ef74c2$var$getCachedNumberFormatter(
|
|
969
|
+
constructor(e, i = {}) {
|
|
970
|
+
this.numberFormatter = $488c6ddbf4ef74c2$var$getCachedNumberFormatter(e, i), this.options = i;
|
|
971
971
|
}
|
|
972
972
|
};
|
|
973
|
-
function $488c6ddbf4ef74c2$var$getCachedNumberFormatter(
|
|
973
|
+
function $488c6ddbf4ef74c2$var$getCachedNumberFormatter(e, i = {}) {
|
|
974
974
|
var _a;
|
|
975
975
|
let { numberingSystem: a } = i;
|
|
976
|
-
if (a &&
|
|
977
|
-
let { unit:
|
|
978
|
-
if (!
|
|
979
|
-
if (!((_a = $488c6ddbf4ef74c2$var$UNITS[
|
|
976
|
+
if (a && e.includes("-nu-") && (e.includes("-u-") || (e += "-u-"), e += `-nu-${a}`), i.style === "unit" && !$488c6ddbf4ef74c2$var$supportsUnit) {
|
|
977
|
+
let { unit: e2, unitDisplay: a2 = "short" } = i;
|
|
978
|
+
if (!e2) throw Error('unit option must be provided with style: "unit"');
|
|
979
|
+
if (!((_a = $488c6ddbf4ef74c2$var$UNITS[e2]) == null ? void 0 : _a[a2])) throw Error(`Unsupported unit ${e2} with unitDisplay = ${a2}`);
|
|
980
980
|
i = {
|
|
981
981
|
...i,
|
|
982
982
|
style: "decimal"
|
|
983
983
|
};
|
|
984
984
|
}
|
|
985
|
-
let o =
|
|
985
|
+
let o = e + (i ? Object.entries(i).sort((e2, i2) => e2[0] < i2[0] ? -1 : 1).join() : "");
|
|
986
986
|
if ($488c6ddbf4ef74c2$var$formatterCache.has(o)) return $488c6ddbf4ef74c2$var$formatterCache.get(o);
|
|
987
|
-
let s = new Intl.NumberFormat(
|
|
987
|
+
let s = new Intl.NumberFormat(e, i);
|
|
988
988
|
return $488c6ddbf4ef74c2$var$formatterCache.set(o, s), s;
|
|
989
989
|
}
|
|
990
|
-
function $488c6ddbf4ef74c2$export$711b50b3c525e0f2(
|
|
991
|
-
if (i === "auto") return
|
|
992
|
-
if (i === "never") return
|
|
990
|
+
function $488c6ddbf4ef74c2$export$711b50b3c525e0f2(e, i, a) {
|
|
991
|
+
if (i === "auto") return e.format(a);
|
|
992
|
+
if (i === "never") return e.format(Math.abs(a));
|
|
993
993
|
{
|
|
994
994
|
let o = false;
|
|
995
995
|
if (i === "always" ? o = a > 0 || Object.is(a, 0) : i === "exceptZero" && (Object.is(a, -0) || Object.is(a, 0) ? a = Math.abs(a) : o = a > 0), o) {
|
|
996
|
-
let i2 =
|
|
996
|
+
let i2 = e.format(-a), o2 = e.format(a), s = i2.replace(o2, "").replace(/\u200e|\u061C/, "");
|
|
997
997
|
return [...s].length !== 1 && console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"), i2.replace(o2, "!!!").replace(s, "+").replace("!!!", o2);
|
|
998
|
-
} else return
|
|
998
|
+
} else return e.format(a);
|
|
999
999
|
}
|
|
1000
1000
|
}
|
|
1001
|
-
function $a916eb452884faea$export$b7a616150fdb9f44(
|
|
1001
|
+
function $a916eb452884faea$export$b7a616150fdb9f44(e = {}) {
|
|
1002
1002
|
let { locale: i } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
|
|
1003
|
-
return (0, import_react.useMemo)(() => new $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5(i,
|
|
1003
|
+
return (0, import_react.useMemo)(() => new $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5(i, e), [i, e]);
|
|
1004
1004
|
}
|
|
1005
|
-
function assertNever(
|
|
1006
|
-
invariant(false, `Unexpected object: ${
|
|
1005
|
+
function assertNever(e) {
|
|
1006
|
+
invariant(false, `Unexpected object: ${e}`);
|
|
1007
1007
|
}
|
|
1008
|
-
function logNever(
|
|
1009
|
-
return Logger.warn(`Unexpected object: ${JSON.stringify(
|
|
1008
|
+
function logNever(e) {
|
|
1009
|
+
return Logger.warn(`Unexpected object: ${JSON.stringify(e)}`), e;
|
|
1010
1010
|
}
|
|
1011
1011
|
var import_compiler_runtime$2 = require_compiler_runtime();
|
|
1012
1012
|
const menuContentCommon = cva("z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md", { variants: { subcontent: { true: "shadow-lg" } } }), menuSubTriggerVariants = cva("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground", { variants: { inset: { true: "pl-8" } } }), MENU_ITEM_DISABLED = "data-disabled:pointer-events-none data-disabled:opacity-50", menuControlVariants = cva(cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground", MENU_ITEM_DISABLED), { variants: {} }), menuControlCheckVariants = cva("absolute left-2 flex h-3.5 w-3.5 items-center justify-center", { variants: {} }), menuLabelVariants = cva("px-2 py-1.5 text-sm font-semibold", { variants: { inset: { true: "pl-8" } } }), menuItemVariants = cva(cn("menu-item relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden", MENU_ITEM_DISABLED), {
|
|
@@ -1021,9 +1021,9 @@ const menuContentCommon = cva("z-50 min-w-32 overflow-hidden rounded-md border b
|
|
|
1021
1021
|
}
|
|
1022
1022
|
},
|
|
1023
1023
|
defaultVariants: { variant: "default" }
|
|
1024
|
-
}), menuSeparatorVariants = cva("-mx-1 my-1 h-px bg-border last:hidden", { variants: {} }), MenuShortcut = (
|
|
1024
|
+
}), menuSeparatorVariants = cva("-mx-1 my-1 h-px bg-border last:hidden", { variants: {} }), MenuShortcut = (e) => {
|
|
1025
1025
|
let i = (0, import_compiler_runtime$2.c)(8), o, s;
|
|
1026
|
-
i[0] ===
|
|
1026
|
+
i[0] === e ? (o = i[1], s = i[2]) : ({ className: o, ...s } = e, i[0] = e, i[1] = o, i[2] = s);
|
|
1027
1027
|
let c;
|
|
1028
1028
|
i[3] === o ? c = i[4] : (c = cn("ml-auto text-xs tracking-widest opacity-60", o), i[3] = o, i[4] = c);
|
|
1029
1029
|
let l;
|
|
@@ -1041,9 +1041,9 @@ const selectStyles = cva("flex h-6 w-fit mb-1 items-center justify-between round
|
|
|
1041
1041
|
} },
|
|
1042
1042
|
defaultVariants: { variant: "default" }
|
|
1043
1043
|
});
|
|
1044
|
-
var NativeSelect = import_react.forwardRef((
|
|
1044
|
+
var NativeSelect = import_react.forwardRef((e, i) => {
|
|
1045
1045
|
let s = (0, import_compiler_runtime$1.c)(12), c, l, u;
|
|
1046
|
-
s[0] ===
|
|
1046
|
+
s[0] === e ? (c = s[1], l = s[2], u = s[3]) : ({ className: l, children: c, ...u } = e, s[0] = e, s[1] = c, s[2] = l, s[3] = u);
|
|
1047
1047
|
let d;
|
|
1048
1048
|
s[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = Events.stopPropagation(), s[4] = d) : d = s[4];
|
|
1049
1049
|
let f;
|
|
@@ -1058,15 +1058,15 @@ var NativeSelect = import_react.forwardRef((t, i) => {
|
|
|
1058
1058
|
}), s[7] = c, s[8] = u, s[9] = i, s[10] = f, s[11] = p) : p = s[11], p;
|
|
1059
1059
|
});
|
|
1060
1060
|
NativeSelect.displayName = "NativeSelect";
|
|
1061
|
-
var import_compiler_runtime = require_compiler_runtime(), Select = Root2, SelectGroup = Group, SelectPortal = withFullScreenAsRoot(Portal$1), SelectValue = Value, SelectTrigger = import_react.forwardRef((
|
|
1061
|
+
var import_compiler_runtime = require_compiler_runtime(), Select = Root2, SelectGroup = Group, SelectPortal = withFullScreenAsRoot(Portal$1), SelectValue = Value, SelectTrigger = import_react.forwardRef((e, i) => {
|
|
1062
1062
|
let o = (0, import_compiler_runtime.c)(21), s, c, l, u, d, f;
|
|
1063
|
-
o[0] ===
|
|
1063
|
+
o[0] === e ? (s = o[1], c = o[2], l = o[3], u = o[4], d = o[5], f = o[6]) : ({ className: c, children: s, onClear: l, variant: f, hideChevron: d, ...u } = e, o[0] = e, o[1] = s, o[2] = c, o[3] = l, o[4] = u, o[5] = d, o[6] = f);
|
|
1064
1064
|
let p = d === void 0 ? false : d, m;
|
|
1065
1065
|
o[7] !== c || o[8] !== f ? (m = cn(selectStyles({ variant: f }), "mb-0", c), o[7] = c, o[8] = f, o[9] = m) : m = o[9];
|
|
1066
1066
|
let h;
|
|
1067
1067
|
o[10] !== p || o[11] !== l ? (h = l ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
1068
|
-
onPointerDown: (
|
|
1069
|
-
|
|
1068
|
+
onPointerDown: (e2) => {
|
|
1069
|
+
e2.preventDefault(), e2.stopPropagation(), l();
|
|
1070
1070
|
},
|
|
1071
1071
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(X, { className: "h-4 w-4 opacity-50 hover:opacity-90" })
|
|
1072
1072
|
}) : !p && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronDown, { className: "h-4 w-4 opacity-50" }), o[10] = p, o[11] = l, o[12] = h) : h = o[12];
|
|
@@ -1084,9 +1084,9 @@ var import_compiler_runtime = require_compiler_runtime(), Select = Root2, Select
|
|
|
1084
1084
|
}), o[15] = s, o[16] = u, o[17] = i, o[18] = m, o[19] = g, o[20] = _) : _ = o[20], _;
|
|
1085
1085
|
});
|
|
1086
1086
|
SelectTrigger.displayName = Trigger.displayName;
|
|
1087
|
-
var InternalSelectContent = withSmartCollisionBoundary(Content2), SelectContent = import_react.forwardRef((
|
|
1087
|
+
var InternalSelectContent = withSmartCollisionBoundary(Content2), SelectContent = import_react.forwardRef((e, i) => {
|
|
1088
1088
|
let o = (0, import_compiler_runtime.c)(21), s, c, l, u;
|
|
1089
|
-
o[0] ===
|
|
1089
|
+
o[0] === e ? (s = o[1], c = o[2], l = o[3], u = o[4]) : ({ className: c, children: s, position: u, ...l } = e, o[0] = e, o[1] = s, o[2] = c, o[3] = l, o[4] = u);
|
|
1090
1090
|
let d = u === void 0 ? "popper" : u, f = d === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", p;
|
|
1091
1091
|
o[5] !== c || o[6] !== f ? (p = cn("max-h-[300px] relative z-50 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", f, c), o[5] = c, o[6] = f, o[7] = p) : p = o[7];
|
|
1092
1092
|
let m;
|
|
@@ -1120,9 +1120,9 @@ var InternalSelectContent = withSmartCollisionBoundary(Content2), SelectContent
|
|
|
1120
1120
|
}) }) }), o[15] = d, o[16] = l, o[17] = i, o[18] = p, o[19] = _, o[20] = y) : y = o[20], y;
|
|
1121
1121
|
});
|
|
1122
1122
|
SelectContent.displayName = Content2.displayName;
|
|
1123
|
-
var SelectLabel = import_react.forwardRef((
|
|
1123
|
+
var SelectLabel = import_react.forwardRef((e, i) => {
|
|
1124
1124
|
let o = (0, import_compiler_runtime.c)(9), s, c;
|
|
1125
|
-
o[0] ===
|
|
1125
|
+
o[0] === e ? (s = o[1], c = o[2]) : ({ className: s, ...c } = e, o[0] = e, o[1] = s, o[2] = c);
|
|
1126
1126
|
let l;
|
|
1127
1127
|
o[3] === s ? l = o[4] : (l = cn("px-2 py-1.5 text-sm font-semibold", s), o[3] = s, o[4] = l);
|
|
1128
1128
|
let u;
|
|
@@ -1133,9 +1133,9 @@ var SelectLabel = import_react.forwardRef((t, i) => {
|
|
|
1133
1133
|
}), o[5] = c, o[6] = i, o[7] = l, o[8] = u) : u = o[8], u;
|
|
1134
1134
|
});
|
|
1135
1135
|
SelectLabel.displayName = Label.displayName;
|
|
1136
|
-
var SelectItem = import_react.forwardRef((
|
|
1136
|
+
var SelectItem = import_react.forwardRef((e, i) => {
|
|
1137
1137
|
let o = (0, import_compiler_runtime.c)(17), s, c, l, u;
|
|
1138
|
-
o[0] ===
|
|
1138
|
+
o[0] === e ? (s = o[1], c = o[2], l = o[3], u = o[4]) : ({ className: c, children: s, subtitle: u, ...l } = e, o[0] = e, o[1] = s, o[2] = c, o[3] = l, o[4] = u);
|
|
1139
1139
|
let d;
|
|
1140
1140
|
o[5] === c ? d = o[6] : (d = cn("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground", MENU_ITEM_DISABLED, c), o[5] = c, o[6] = d);
|
|
1141
1141
|
let f;
|
|
@@ -1162,9 +1162,9 @@ var SelectItem = import_react.forwardRef((t, i) => {
|
|
|
1162
1162
|
}), o[11] = l, o[12] = i, o[13] = u, o[14] = d, o[15] = m, o[16] = h) : h = o[16], h;
|
|
1163
1163
|
});
|
|
1164
1164
|
SelectItem.displayName = Item.displayName;
|
|
1165
|
-
var SelectSeparator = import_react.forwardRef((
|
|
1165
|
+
var SelectSeparator = import_react.forwardRef((e, i) => {
|
|
1166
1166
|
let o = (0, import_compiler_runtime.c)(9), s, c;
|
|
1167
|
-
o[0] ===
|
|
1167
|
+
o[0] === e ? (s = o[1], c = o[2]) : ({ className: s, ...c } = e, o[0] = e, o[1] = s, o[2] = c);
|
|
1168
1168
|
let l;
|
|
1169
1169
|
o[3] === s ? l = o[4] : (l = cn("-mx-1 my-1 h-px bg-muted", s), o[3] = s, o[4] = l);
|
|
1170
1170
|
let u;
|
|
@@ -1175,32 +1175,32 @@ var SelectSeparator = import_react.forwardRef((t, i) => {
|
|
|
1175
1175
|
}), o[5] = c, o[6] = i, o[7] = l, o[8] = u) : u = o[8], u;
|
|
1176
1176
|
});
|
|
1177
1177
|
SelectSeparator.displayName = Separator.displayName;
|
|
1178
|
-
function capitalize(
|
|
1179
|
-
return
|
|
1178
|
+
function capitalize(e) {
|
|
1179
|
+
return e ? e.charAt(0).toUpperCase() + e.slice(1) : "";
|
|
1180
1180
|
}
|
|
1181
|
-
function startCase(
|
|
1182
|
-
if (!
|
|
1183
|
-
if (typeof
|
|
1184
|
-
return /[A-Za-z]/.test(
|
|
1181
|
+
function startCase(e) {
|
|
1182
|
+
if (!e) return "";
|
|
1183
|
+
if (typeof e != "string") throw Logger.error(e), TypeError(`Expected string, got ${typeof e}`);
|
|
1184
|
+
return /[A-Za-z]/.test(e) ? e.replaceAll(/([\da-z])([A-Z])/g, "$1 $2").replaceAll(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replaceAll(/[\s_-]+/g, " ").trim().split(" ").map(capitalize).join(" ") : e;
|
|
1185
1185
|
}
|
|
1186
1186
|
const Strings = {
|
|
1187
1187
|
startCase,
|
|
1188
|
-
htmlEscape: (
|
|
1189
|
-
withTrailingSlash(
|
|
1190
|
-
return
|
|
1188
|
+
htmlEscape: (e) => e && e.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'").replaceAll("\n", " "),
|
|
1189
|
+
withTrailingSlash(e) {
|
|
1190
|
+
return e.endsWith("/") ? e : `${e}/`;
|
|
1191
1191
|
},
|
|
1192
|
-
withoutTrailingSlash(
|
|
1193
|
-
return
|
|
1192
|
+
withoutTrailingSlash(e) {
|
|
1193
|
+
return e.endsWith("/") ? e.slice(0, -1) : e;
|
|
1194
1194
|
},
|
|
1195
|
-
withoutLeadingSlash(
|
|
1196
|
-
return
|
|
1195
|
+
withoutLeadingSlash(e) {
|
|
1196
|
+
return e.startsWith("/") ? e.slice(1) : e;
|
|
1197
1197
|
},
|
|
1198
|
-
asString: (
|
|
1199
|
-
if (typeof
|
|
1198
|
+
asString: (e) => {
|
|
1199
|
+
if (typeof e == "string") return e;
|
|
1200
1200
|
try {
|
|
1201
|
-
return JSON.stringify(
|
|
1201
|
+
return JSON.stringify(e);
|
|
1202
1202
|
} catch {
|
|
1203
|
-
return String(
|
|
1203
|
+
return String(e);
|
|
1204
1204
|
}
|
|
1205
1205
|
}
|
|
1206
1206
|
};
|