laif-ds 0.1.35 → 0.1.37
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/_virtual/index.js +5 -2
- package/dist/_virtual/index3.js +2 -7
- package/dist/_virtual/index4.js +2 -5
- package/dist/_virtual/index5.js +4 -4
- package/dist/_virtual/index6.js +5 -2
- package/dist/_virtual/index7.js +5 -2
- package/dist/_virtual/index8.js +5 -0
- package/dist/_virtual/index9.js +5 -0
- package/dist/_virtual/use-sync-external-store-shim.development.js +5 -0
- package/dist/_virtual/use-sync-external-store-shim.production.js +5 -0
- package/dist/components/ui/checkbox.js +12 -12
- package/dist/components/ui/gantt/components/Chart/Chart.js +1 -1
- package/dist/components/ui/message-input.js +1 -1
- package/dist/components/ui/tables/data-cross-table/data-cross-table.js +348 -0
- package/dist/components/ui/tables/data-cross-table/edit-controls.js +47 -0
- package/dist/components/ui/tables/data-cross-table/editable-input.js +100 -0
- package/dist/components/ui/tables/data-cross-table/truncated-text.js +19 -0
- package/dist/index.d.ts +30 -4
- package/dist/index.js +1 -1
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +126 -122
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +10 -6
- package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +44 -42
- package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +33 -43
- package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +237 -120
- package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js +17 -16
- package/dist/node_modules/@radix-ui/react-context-menu/dist/index.js +95 -94
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +20 -19
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +3 -3
- package/dist/node_modules/@radix-ui/react-hover-card/dist/index.js +14 -13
- package/dist/node_modules/@radix-ui/react-menu/dist/index.js +136 -136
- package/dist/node_modules/@radix-ui/react-menubar/dist/index.js +70 -68
- package/dist/node_modules/@radix-ui/react-navigation-menu/dist/index.js +66 -64
- package/dist/node_modules/@radix-ui/react-popover/dist/index.js +10 -9
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js +16 -16
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +11 -10
- package/dist/node_modules/@radix-ui/react-radio-group/dist/index.js +161 -146
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +87 -84
- package/dist/node_modules/@radix-ui/react-select/dist/index.js +269 -257
- package/dist/node_modules/@radix-ui/react-slider/dist/index.js +3 -3
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +29 -28
- package/dist/node_modules/@radix-ui/react-switch/dist/index.js +101 -86
- package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +23 -22
- package/dist/node_modules/@radix-ui/react-toggle/dist/index.js +17 -16
- package/dist/node_modules/@radix-ui/react-toggle-group/dist/index.js +25 -23
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +77 -76
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +43 -21
- package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +16 -0
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +18 -18
- package/dist/node_modules/@tanstack/react-virtual/dist/esm/index.js +36 -0
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +491 -0
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js +53 -0
- package/dist/node_modules/classnames/index.js +1 -1
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
- package/dist/node_modules/property-information/lib/html.js +9 -9
- package/dist/node_modules/react-hook-form/dist/index.esm.js +88 -88
- package/dist/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/react-resizable-panels/dist/react-resizable-panels.browser.esm.js +830 -801
- package/dist/node_modules/recharts/es6/util/ReactUtils.js +1 -1
- package/dist/node_modules/remeda/dist/chunk-AIG3BDKO.js +9 -0
- package/dist/node_modules/remeda/dist/{chunk-A3PVMI4K.js → chunk-KI5X74E2.js} +1 -1
- package/dist/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +3 -3
- package/dist/node_modules/unified/lib/index.js +1 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +68 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +56 -0
- package/dist/node_modules/use-sync-external-store/shim/index.js +11 -0
- package/dist/styles.css +1 -1
- package/package.json +2 -1
- package/dist/components/ui/data-cross-table.js +0 -216
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-arrow/dist/index.js +0 -25
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-collection/dist/index.js +0 -49
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -128
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -138
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-menu/dist/index.js +0 -625
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-popper/dist/index.js +0 -221
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-portal/dist/index.js +0 -17
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-primitive/dist/index.js +0 -37
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-roving-focus/dist/index.js +0 -184
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -55
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-collection/dist/index.js +0 -49
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-primitive/dist/index.js +0 -33
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -55
- package/dist/node_modules/remeda/dist/chunk-OAMXQXGR.js +0 -9
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as t from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as be from "react-dom";
|
|
4
4
|
import { clamp as Re } from "../../number/dist/index.js";
|
|
5
|
-
import { composeEventHandlers as
|
|
5
|
+
import { composeEventHandlers as E } from "../../primitive/dist/index.js";
|
|
6
6
|
import { createCollection as st } from "../../react-collection/dist/index.js";
|
|
7
|
-
import { useComposedRefs as
|
|
7
|
+
import { useComposedRefs as B } from "../../react-compose-refs/dist/index.js";
|
|
8
8
|
import { createContextScope as lt } from "../../react-context/dist/index.js";
|
|
9
9
|
import { useDirection as ct } from "../../react-direction/dist/index.js";
|
|
10
10
|
import { DismissableLayer as it } from "../../react-dismissable-layer/dist/index.js";
|
|
@@ -16,21 +16,21 @@ import { Portal as ht } from "../../react-portal/dist/index.js";
|
|
|
16
16
|
import { Primitive as M } from "../../react-primitive/dist/index.js";
|
|
17
17
|
import { createSlot as vt } from "../../react-slot/dist/index.js";
|
|
18
18
|
import { useCallbackRef as gt } from "../../react-use-callback-ref/dist/index.js";
|
|
19
|
-
import { useControllableState as
|
|
20
|
-
import { useLayoutEffect as
|
|
19
|
+
import { useControllableState as Ee } from "../../react-use-controllable-state/dist/index.js";
|
|
20
|
+
import { useLayoutEffect as Y } from "../../react-use-layout-effect/dist/index.js";
|
|
21
21
|
import { usePrevious as St } from "../../react-use-previous/dist/index.js";
|
|
22
|
-
import {
|
|
22
|
+
import { VISUALLY_HIDDEN_STYLES as wt } from "../../react-visually-hidden/dist/index.js";
|
|
23
23
|
import { hideOthers as Ct } from "../../../aria-hidden/dist/es2015/index.js";
|
|
24
24
|
import yt from "../../../react-remove-scroll/dist/es2015/Combination.js";
|
|
25
|
-
import { jsx as
|
|
26
|
-
var xt = [" ", "Enter", "ArrowUp", "ArrowDown"], It = [" ", "Enter"],
|
|
25
|
+
import { jsx as m, jsxs as ce, Fragment as Te } from "react/jsx-runtime";
|
|
26
|
+
var xt = [" ", "Enter", "ArrowUp", "ArrowDown"], It = [" ", "Enter"], J = "Select", [ae, de, Tt] = st(J), [te, uo] = lt(J, [
|
|
27
27
|
Tt,
|
|
28
28
|
_e
|
|
29
|
-
]), ue = _e(), [Pt,
|
|
29
|
+
]), ue = _e(), [Pt, j] = te(J), [Rt, Et] = te(J), Ne = (n) => {
|
|
30
30
|
const {
|
|
31
|
-
__scopeSelect:
|
|
31
|
+
__scopeSelect: c,
|
|
32
32
|
children: e,
|
|
33
|
-
open:
|
|
33
|
+
open: i,
|
|
34
34
|
defaultOpen: l,
|
|
35
35
|
onOpenChange: u,
|
|
36
36
|
value: r,
|
|
@@ -42,20 +42,22 @@ var xt = [" ", "Enter", "ArrowUp", "ArrowDown"], It = [" ", "Enter"], re = "Sele
|
|
|
42
42
|
disabled: P,
|
|
43
43
|
required: R,
|
|
44
44
|
form: T
|
|
45
|
-
} = n, a = ue(
|
|
46
|
-
prop:
|
|
47
|
-
defaultProp: l,
|
|
48
|
-
onChange: u
|
|
49
|
-
|
|
45
|
+
} = n, a = ue(c), [v, y] = t.useState(null), [d, h] = t.useState(null), [A, O] = t.useState(!1), oe = ct(p), [b, L] = Ee({
|
|
46
|
+
prop: i,
|
|
47
|
+
defaultProp: l ?? !1,
|
|
48
|
+
onChange: u,
|
|
49
|
+
caller: J
|
|
50
|
+
}), [K, X] = Ee({
|
|
50
51
|
prop: r,
|
|
51
52
|
defaultProp: s,
|
|
52
|
-
onChange: o
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
onChange: o,
|
|
54
|
+
caller: J
|
|
55
|
+
}), V = t.useRef(null), H = v ? T || !!v.closest("form") : !0, [G, U] = t.useState(/* @__PURE__ */ new Set()), W = Array.from(G).map((_) => _.props.value).join(";");
|
|
56
|
+
return /* @__PURE__ */ m(ut, { ...a, children: /* @__PURE__ */ ce(
|
|
55
57
|
Pt,
|
|
56
58
|
{
|
|
57
59
|
required: R,
|
|
58
|
-
scope:
|
|
60
|
+
scope: c,
|
|
59
61
|
trigger: v,
|
|
60
62
|
onTriggerChange: y,
|
|
61
63
|
valueNode: d,
|
|
@@ -65,30 +67,30 @@ var xt = [" ", "Enter", "ArrowUp", "ArrowDown"], It = [" ", "Enter"], re = "Sele
|
|
|
65
67
|
contentId: Ie(),
|
|
66
68
|
value: K,
|
|
67
69
|
onValueChange: X,
|
|
68
|
-
open:
|
|
70
|
+
open: b,
|
|
69
71
|
onOpenChange: L,
|
|
70
|
-
dir:
|
|
71
|
-
triggerPointerDownPosRef:
|
|
72
|
+
dir: oe,
|
|
73
|
+
triggerPointerDownPosRef: V,
|
|
72
74
|
disabled: P,
|
|
73
75
|
children: [
|
|
74
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ m(ae.Provider, { scope: c, children: /* @__PURE__ */ m(
|
|
75
77
|
Rt,
|
|
76
78
|
{
|
|
77
79
|
scope: n.__scopeSelect,
|
|
78
80
|
onNativeOptionAdd: t.useCallback((_) => {
|
|
79
|
-
|
|
81
|
+
U((k) => new Set(k).add(_));
|
|
80
82
|
}, []),
|
|
81
83
|
onNativeOptionRemove: t.useCallback((_) => {
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
return
|
|
84
|
+
U((k) => {
|
|
85
|
+
const F = new Set(k);
|
|
86
|
+
return F.delete(_), F;
|
|
85
87
|
});
|
|
86
88
|
}, []),
|
|
87
89
|
children: e
|
|
88
90
|
}
|
|
89
91
|
) }),
|
|
90
92
|
H ? /* @__PURE__ */ ce(
|
|
91
|
-
|
|
93
|
+
tt,
|
|
92
94
|
{
|
|
93
95
|
"aria-hidden": !0,
|
|
94
96
|
required: R,
|
|
@@ -100,20 +102,20 @@ var xt = [" ", "Enter", "ArrowUp", "ArrowDown"], It = [" ", "Enter"], re = "Sele
|
|
|
100
102
|
disabled: P,
|
|
101
103
|
form: T,
|
|
102
104
|
children: [
|
|
103
|
-
K === void 0 ? /* @__PURE__ */
|
|
105
|
+
K === void 0 ? /* @__PURE__ */ m("option", { value: "" }) : null,
|
|
104
106
|
Array.from(G)
|
|
105
107
|
]
|
|
106
108
|
},
|
|
107
|
-
|
|
109
|
+
W
|
|
108
110
|
) : null
|
|
109
111
|
]
|
|
110
112
|
}
|
|
111
113
|
) });
|
|
112
114
|
};
|
|
113
|
-
Ne.displayName =
|
|
115
|
+
Ne.displayName = J;
|
|
114
116
|
var Me = "SelectTrigger", Ae = t.forwardRef(
|
|
115
|
-
(n,
|
|
116
|
-
const { __scopeSelect: e, disabled:
|
|
117
|
+
(n, c) => {
|
|
118
|
+
const { __scopeSelect: e, disabled: i = !1, ...l } = n, u = ue(e), r = j(Me, e), s = r.disabled || i, o = B(c, r.onTriggerChange), p = de(e), g = t.useRef("touch"), [C, P, R] = nt((a) => {
|
|
117
119
|
const v = p().filter((h) => !h.disabled), y = v.find((h) => h.value === r.value), d = rt(v, a, y);
|
|
118
120
|
d !== void 0 && r.onValueChange(d.value);
|
|
119
121
|
}), T = (a) => {
|
|
@@ -122,7 +124,7 @@ var Me = "SelectTrigger", Ae = t.forwardRef(
|
|
|
122
124
|
y: Math.round(a.pageY)
|
|
123
125
|
});
|
|
124
126
|
};
|
|
125
|
-
return /* @__PURE__ */
|
|
127
|
+
return /* @__PURE__ */ m(pt, { asChild: !0, ...u, children: /* @__PURE__ */ m(
|
|
126
128
|
M.button,
|
|
127
129
|
{
|
|
128
130
|
type: "button",
|
|
@@ -135,18 +137,18 @@ var Me = "SelectTrigger", Ae = t.forwardRef(
|
|
|
135
137
|
"data-state": r.open ? "open" : "closed",
|
|
136
138
|
disabled: s,
|
|
137
139
|
"data-disabled": s ? "" : void 0,
|
|
138
|
-
"data-placeholder":
|
|
140
|
+
"data-placeholder": ot(r.value) ? "" : void 0,
|
|
139
141
|
...l,
|
|
140
142
|
ref: o,
|
|
141
|
-
onClick:
|
|
143
|
+
onClick: E(l.onClick, (a) => {
|
|
142
144
|
a.currentTarget.focus(), g.current !== "mouse" && T(a);
|
|
143
145
|
}),
|
|
144
|
-
onPointerDown:
|
|
146
|
+
onPointerDown: E(l.onPointerDown, (a) => {
|
|
145
147
|
g.current = a.pointerType;
|
|
146
148
|
const v = a.target;
|
|
147
149
|
v.hasPointerCapture(a.pointerId) && v.releasePointerCapture(a.pointerId), a.button === 0 && a.ctrlKey === !1 && a.pointerType === "mouse" && (T(a), a.preventDefault());
|
|
148
150
|
}),
|
|
149
|
-
onKeyDown:
|
|
151
|
+
onKeyDown: E(l.onKeyDown, (a) => {
|
|
150
152
|
const v = C.current !== "";
|
|
151
153
|
!(a.ctrlKey || a.altKey || a.metaKey) && a.key.length === 1 && P(a.key), !(v && a.key === " ") && xt.includes(a.key) && (T(), a.preventDefault());
|
|
152
154
|
})
|
|
@@ -156,52 +158,52 @@ var Me = "SelectTrigger", Ae = t.forwardRef(
|
|
|
156
158
|
);
|
|
157
159
|
Ae.displayName = Me;
|
|
158
160
|
var Oe = "SelectValue", De = t.forwardRef(
|
|
159
|
-
(n,
|
|
160
|
-
const { __scopeSelect: e, className:
|
|
161
|
-
return
|
|
161
|
+
(n, c) => {
|
|
162
|
+
const { __scopeSelect: e, className: i, style: l, children: u, placeholder: r = "", ...s } = n, o = j(Oe, e), { onValueNodeHasChildrenChange: p } = o, g = u !== void 0, C = B(c, o.onValueNodeChange);
|
|
163
|
+
return Y(() => {
|
|
162
164
|
p(g);
|
|
163
|
-
}, [p, g]), /* @__PURE__ */
|
|
165
|
+
}, [p, g]), /* @__PURE__ */ m(
|
|
164
166
|
M.span,
|
|
165
167
|
{
|
|
166
168
|
...s,
|
|
167
169
|
ref: C,
|
|
168
170
|
style: { pointerEvents: "none" },
|
|
169
|
-
children:
|
|
171
|
+
children: ot(o.value) ? /* @__PURE__ */ m(Te, { children: r }) : u
|
|
170
172
|
}
|
|
171
173
|
);
|
|
172
174
|
}
|
|
173
175
|
);
|
|
174
176
|
De.displayName = Oe;
|
|
175
|
-
var
|
|
176
|
-
(n,
|
|
177
|
-
const { __scopeSelect: e, children:
|
|
178
|
-
return /* @__PURE__ */
|
|
177
|
+
var bt = "SelectIcon", Le = t.forwardRef(
|
|
178
|
+
(n, c) => {
|
|
179
|
+
const { __scopeSelect: e, children: i, ...l } = n;
|
|
180
|
+
return /* @__PURE__ */ m(M.span, { "aria-hidden": !0, ...l, ref: c, children: i || "▼" });
|
|
179
181
|
}
|
|
180
182
|
);
|
|
181
|
-
Le.displayName =
|
|
182
|
-
var _t = "SelectPortal", ke = (n) => /* @__PURE__ */
|
|
183
|
+
Le.displayName = bt;
|
|
184
|
+
var _t = "SelectPortal", ke = (n) => /* @__PURE__ */ m(ht, { asChild: !0, ...n });
|
|
183
185
|
ke.displayName = _t;
|
|
184
|
-
var
|
|
185
|
-
(n,
|
|
186
|
-
const e =
|
|
187
|
-
if (
|
|
186
|
+
var Q = "SelectContent", Be = t.forwardRef(
|
|
187
|
+
(n, c) => {
|
|
188
|
+
const e = j(Q, n.__scopeSelect), [i, l] = t.useState();
|
|
189
|
+
if (Y(() => {
|
|
188
190
|
l(new DocumentFragment());
|
|
189
191
|
}, []), !e.open) {
|
|
190
|
-
const u =
|
|
191
|
-
return u ?
|
|
192
|
-
/* @__PURE__ */
|
|
192
|
+
const u = i;
|
|
193
|
+
return u ? be.createPortal(
|
|
194
|
+
/* @__PURE__ */ m(Ve, { scope: n.__scopeSelect, children: /* @__PURE__ */ m(ae.Slot, { scope: n.__scopeSelect, children: /* @__PURE__ */ m("div", { children: n.children }) }) }),
|
|
193
195
|
u
|
|
194
196
|
) : null;
|
|
195
197
|
}
|
|
196
|
-
return /* @__PURE__ */
|
|
198
|
+
return /* @__PURE__ */ m(He, { ...n, ref: c });
|
|
197
199
|
}
|
|
198
200
|
);
|
|
199
|
-
|
|
200
|
-
var D = 10, [
|
|
201
|
-
(n,
|
|
201
|
+
Be.displayName = Q;
|
|
202
|
+
var D = 10, [Ve, q] = te(Q), Nt = "SelectContentImpl", Mt = vt("SelectContent.RemoveScroll"), He = t.forwardRef(
|
|
203
|
+
(n, c) => {
|
|
202
204
|
const {
|
|
203
205
|
__scopeSelect: e,
|
|
204
|
-
position:
|
|
206
|
+
position: i = "item-aligned",
|
|
205
207
|
onCloseAutoFocus: l,
|
|
206
208
|
onEscapeKeyDown: u,
|
|
207
209
|
onPointerDownOutside: r,
|
|
@@ -219,16 +221,16 @@ var D = 10, [Be, q] = ee(J), Nt = "SelectContentImpl", Mt = vt("SelectContent.Re
|
|
|
219
221
|
avoidCollisions: v,
|
|
220
222
|
//
|
|
221
223
|
...y
|
|
222
|
-
} = n, d =
|
|
224
|
+
} = n, d = j(Q, e), [h, A] = t.useState(null), [O, oe] = t.useState(null), b = B(c, (f) => A(f)), [L, K] = t.useState(null), [X, V] = t.useState(
|
|
223
225
|
null
|
|
224
|
-
), H = de(e), [G,
|
|
226
|
+
), H = de(e), [G, U] = t.useState(!1), W = t.useRef(!1);
|
|
225
227
|
t.useEffect(() => {
|
|
226
228
|
if (h) return Ct(h);
|
|
227
229
|
}, [h]), at();
|
|
228
230
|
const _ = t.useCallback(
|
|
229
|
-
(
|
|
231
|
+
(f) => {
|
|
230
232
|
const [I, ...N] = H().map((w) => w.ref.current), [x] = N.slice(-1), S = document.activeElement;
|
|
231
|
-
for (const w of
|
|
233
|
+
for (const w of f)
|
|
232
234
|
if (w === S || (w == null || w.scrollIntoView({ block: "nearest" }), w === I && O && (O.scrollTop = 0), w === x && O && (O.scrollTop = O.scrollHeight), w == null || w.focus(), document.activeElement !== S)) return;
|
|
233
235
|
},
|
|
234
236
|
[H, O]
|
|
@@ -239,45 +241,45 @@ var D = 10, [Be, q] = ee(J), Nt = "SelectContentImpl", Mt = vt("SelectContent.Re
|
|
|
239
241
|
t.useEffect(() => {
|
|
240
242
|
G && k();
|
|
241
243
|
}, [G, k]);
|
|
242
|
-
const { onOpenChange:
|
|
244
|
+
const { onOpenChange: F, triggerPointerDownPosRef: z } = d;
|
|
243
245
|
t.useEffect(() => {
|
|
244
246
|
if (h) {
|
|
245
|
-
let
|
|
247
|
+
let f = { x: 0, y: 0 };
|
|
246
248
|
const I = (x) => {
|
|
247
249
|
var S, w;
|
|
248
|
-
|
|
250
|
+
f = {
|
|
249
251
|
x: Math.abs(Math.round(x.pageX) - (((S = z.current) == null ? void 0 : S.x) ?? 0)),
|
|
250
252
|
y: Math.abs(Math.round(x.pageY) - (((w = z.current) == null ? void 0 : w.y) ?? 0))
|
|
251
253
|
};
|
|
252
254
|
}, N = (x) => {
|
|
253
|
-
|
|
255
|
+
f.x <= 10 && f.y <= 10 ? x.preventDefault() : h.contains(x.target) || F(!1), document.removeEventListener("pointermove", I), z.current = null;
|
|
254
256
|
};
|
|
255
257
|
return z.current !== null && (document.addEventListener("pointermove", I), document.addEventListener("pointerup", N, { capture: !0, once: !0 })), () => {
|
|
256
258
|
document.removeEventListener("pointermove", I), document.removeEventListener("pointerup", N, { capture: !0 });
|
|
257
259
|
};
|
|
258
260
|
}
|
|
259
|
-
}, [h,
|
|
260
|
-
const
|
|
261
|
-
return window.addEventListener("blur",
|
|
262
|
-
window.removeEventListener("blur",
|
|
261
|
+
}, [h, F, z]), t.useEffect(() => {
|
|
262
|
+
const f = () => F(!1);
|
|
263
|
+
return window.addEventListener("blur", f), window.addEventListener("resize", f), () => {
|
|
264
|
+
window.removeEventListener("blur", f), window.removeEventListener("resize", f);
|
|
263
265
|
};
|
|
264
|
-
}, [
|
|
265
|
-
const [pe, se] = nt((
|
|
266
|
-
const I = H().filter((S) => !S.disabled), N = I.find((S) => S.ref.current === document.activeElement), x = rt(I,
|
|
266
|
+
}, [F]);
|
|
267
|
+
const [pe, se] = nt((f) => {
|
|
268
|
+
const I = H().filter((S) => !S.disabled), N = I.find((S) => S.ref.current === document.activeElement), x = rt(I, f, N);
|
|
267
269
|
x && setTimeout(() => x.ref.current.focus());
|
|
268
270
|
}), fe = t.useCallback(
|
|
269
|
-
(
|
|
270
|
-
const x = !
|
|
271
|
-
(d.value !== void 0 && d.value === I || x) && (K(
|
|
271
|
+
(f, I, N) => {
|
|
272
|
+
const x = !W.current && !N;
|
|
273
|
+
(d.value !== void 0 && d.value === I || x) && (K(f), x && (W.current = !0));
|
|
272
274
|
},
|
|
273
275
|
[d.value]
|
|
274
|
-
), me = t.useCallback(() => h == null ? void 0 : h.focus(), [h]),
|
|
275
|
-
(
|
|
276
|
-
const x = !
|
|
277
|
-
(d.value !== void 0 && d.value === I || x) &&
|
|
276
|
+
), me = t.useCallback(() => h == null ? void 0 : h.focus(), [h]), ee = t.useCallback(
|
|
277
|
+
(f, I, N) => {
|
|
278
|
+
const x = !W.current && !N;
|
|
279
|
+
(d.value !== void 0 && d.value === I || x) && V(f);
|
|
278
280
|
},
|
|
279
281
|
[d.value]
|
|
280
|
-
), le =
|
|
282
|
+
), le = i === "popper" ? Se : Ue, ne = le === Se ? {
|
|
281
283
|
side: s,
|
|
282
284
|
sideOffset: o,
|
|
283
285
|
align: p,
|
|
@@ -289,55 +291,55 @@ var D = 10, [Be, q] = ee(J), Nt = "SelectContentImpl", Mt = vt("SelectContent.Re
|
|
|
289
291
|
hideWhenDetached: a,
|
|
290
292
|
avoidCollisions: v
|
|
291
293
|
} : {};
|
|
292
|
-
return /* @__PURE__ */
|
|
293
|
-
|
|
294
|
+
return /* @__PURE__ */ m(
|
|
295
|
+
Ve,
|
|
294
296
|
{
|
|
295
297
|
scope: e,
|
|
296
298
|
content: h,
|
|
297
299
|
viewport: O,
|
|
298
|
-
onViewportChange:
|
|
300
|
+
onViewportChange: oe,
|
|
299
301
|
itemRefCallback: fe,
|
|
300
302
|
selectedItem: L,
|
|
301
303
|
onItemLeave: me,
|
|
302
|
-
itemTextRefCallback:
|
|
304
|
+
itemTextRefCallback: ee,
|
|
303
305
|
focusSelectedItem: k,
|
|
304
306
|
selectedItemText: X,
|
|
305
|
-
position:
|
|
307
|
+
position: i,
|
|
306
308
|
isPositioned: G,
|
|
307
309
|
searchRef: pe,
|
|
308
|
-
children: /* @__PURE__ */
|
|
310
|
+
children: /* @__PURE__ */ m(yt, { as: Mt, allowPinchZoom: !0, children: /* @__PURE__ */ m(
|
|
309
311
|
dt,
|
|
310
312
|
{
|
|
311
313
|
asChild: !0,
|
|
312
314
|
trapped: d.open,
|
|
313
|
-
onMountAutoFocus: (
|
|
314
|
-
|
|
315
|
+
onMountAutoFocus: (f) => {
|
|
316
|
+
f.preventDefault();
|
|
315
317
|
},
|
|
316
|
-
onUnmountAutoFocus:
|
|
318
|
+
onUnmountAutoFocus: E(l, (f) => {
|
|
317
319
|
var I;
|
|
318
|
-
(I = d.trigger) == null || I.focus({ preventScroll: !0 }),
|
|
320
|
+
(I = d.trigger) == null || I.focus({ preventScroll: !0 }), f.preventDefault();
|
|
319
321
|
}),
|
|
320
|
-
children: /* @__PURE__ */
|
|
322
|
+
children: /* @__PURE__ */ m(
|
|
321
323
|
it,
|
|
322
324
|
{
|
|
323
325
|
asChild: !0,
|
|
324
326
|
disableOutsidePointerEvents: !0,
|
|
325
327
|
onEscapeKeyDown: u,
|
|
326
328
|
onPointerDownOutside: r,
|
|
327
|
-
onFocusOutside: (
|
|
329
|
+
onFocusOutside: (f) => f.preventDefault(),
|
|
328
330
|
onDismiss: () => d.onOpenChange(!1),
|
|
329
|
-
children: /* @__PURE__ */
|
|
331
|
+
children: /* @__PURE__ */ m(
|
|
330
332
|
le,
|
|
331
333
|
{
|
|
332
334
|
role: "listbox",
|
|
333
335
|
id: d.contentId,
|
|
334
336
|
"data-state": d.open ? "open" : "closed",
|
|
335
337
|
dir: d.dir,
|
|
336
|
-
onContextMenu: (
|
|
338
|
+
onContextMenu: (f) => f.preventDefault(),
|
|
337
339
|
...y,
|
|
338
|
-
...
|
|
339
|
-
onPlaced: () =>
|
|
340
|
-
ref:
|
|
340
|
+
...ne,
|
|
341
|
+
onPlaced: () => U(!0),
|
|
342
|
+
ref: b,
|
|
341
343
|
style: {
|
|
342
344
|
// flex layout so we can place the scroll buttons properly
|
|
343
345
|
display: "flex",
|
|
@@ -346,15 +348,15 @@ var D = 10, [Be, q] = ee(J), Nt = "SelectContentImpl", Mt = vt("SelectContent.Re
|
|
|
346
348
|
outline: "none",
|
|
347
349
|
...y.style
|
|
348
350
|
},
|
|
349
|
-
onKeyDown:
|
|
350
|
-
const I =
|
|
351
|
-
if (
|
|
351
|
+
onKeyDown: E(y.onKeyDown, (f) => {
|
|
352
|
+
const I = f.ctrlKey || f.altKey || f.metaKey;
|
|
353
|
+
if (f.key === "Tab" && f.preventDefault(), !I && f.key.length === 1 && se(f.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(f.key)) {
|
|
352
354
|
let x = H().filter((S) => !S.disabled).map((S) => S.ref.current);
|
|
353
|
-
if (["ArrowUp", "End"].includes(
|
|
354
|
-
const S =
|
|
355
|
+
if (["ArrowUp", "End"].includes(f.key) && (x = x.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(f.key)) {
|
|
356
|
+
const S = f.target, w = x.indexOf(S);
|
|
355
357
|
x = x.slice(w + 1);
|
|
356
358
|
}
|
|
357
|
-
setTimeout(() => _(x)),
|
|
359
|
+
setTimeout(() => _(x)), f.preventDefault();
|
|
358
360
|
}
|
|
359
361
|
})
|
|
360
362
|
}
|
|
@@ -368,12 +370,12 @@ var D = 10, [Be, q] = ee(J), Nt = "SelectContentImpl", Mt = vt("SelectContent.Re
|
|
|
368
370
|
}
|
|
369
371
|
);
|
|
370
372
|
He.displayName = Nt;
|
|
371
|
-
var At = "SelectItemAlignedPosition",
|
|
372
|
-
const { __scopeSelect: e, onPlaced:
|
|
373
|
+
var At = "SelectItemAlignedPosition", Ue = t.forwardRef((n, c) => {
|
|
374
|
+
const { __scopeSelect: e, onPlaced: i, ...l } = n, u = j(Q, e), r = q(Q, e), [s, o] = t.useState(null), [p, g] = t.useState(null), C = B(c, (b) => g(b)), P = de(e), R = t.useRef(!1), T = t.useRef(!0), { viewport: a, selectedItem: v, selectedItemText: y, focusSelectedItem: d } = r, h = t.useCallback(() => {
|
|
373
375
|
if (u.trigger && u.valueNode && s && p && a && v && y) {
|
|
374
|
-
const
|
|
376
|
+
const b = u.trigger.getBoundingClientRect(), L = p.getBoundingClientRect(), K = u.valueNode.getBoundingClientRect(), X = y.getBoundingClientRect();
|
|
375
377
|
if (u.dir !== "rtl") {
|
|
376
|
-
const S = X.left - L.left, w = K.left - S, Z =
|
|
378
|
+
const S = X.left - L.left, w = K.left - S, Z = b.left - w, $ = b.width + Z, he = Math.max($, L.width), ve = window.innerWidth - D, ge = Re(w, [
|
|
377
379
|
D,
|
|
378
380
|
// Prevents the content from going off the starting edge of the
|
|
379
381
|
// viewport. It may still go off the ending edge, but this can be
|
|
@@ -384,33 +386,33 @@ var At = "SelectItemAlignedPosition", We = t.forwardRef((n, i) => {
|
|
|
384
386
|
]);
|
|
385
387
|
s.style.minWidth = $ + "px", s.style.left = ge + "px";
|
|
386
388
|
} else {
|
|
387
|
-
const S = L.right - X.right, w = window.innerWidth - K.right - S, Z = window.innerWidth -
|
|
389
|
+
const S = L.right - X.right, w = window.innerWidth - K.right - S, Z = window.innerWidth - b.right - w, $ = b.width + Z, he = Math.max($, L.width), ve = window.innerWidth - D, ge = Re(w, [
|
|
388
390
|
D,
|
|
389
391
|
Math.max(D, ve - he)
|
|
390
392
|
]);
|
|
391
393
|
s.style.minWidth = $ + "px", s.style.right = ge + "px";
|
|
392
394
|
}
|
|
393
|
-
const
|
|
394
|
-
if (I <=
|
|
395
|
-
const S =
|
|
395
|
+
const V = P(), H = window.innerHeight - D * 2, G = a.scrollHeight, U = window.getComputedStyle(p), W = parseInt(U.borderTopWidth, 10), _ = parseInt(U.paddingTop, 10), k = parseInt(U.borderBottomWidth, 10), F = parseInt(U.paddingBottom, 10), z = W + _ + G + F + k, pe = Math.min(v.offsetHeight * 5, z), se = window.getComputedStyle(a), fe = parseInt(se.paddingTop, 10), me = parseInt(se.paddingBottom, 10), ee = b.top + b.height / 2 - D, le = H - ee, ne = v.offsetHeight / 2, f = v.offsetTop + ne, I = W + _ + f, N = z - I;
|
|
396
|
+
if (I <= ee) {
|
|
397
|
+
const S = V.length > 0 && v === V[V.length - 1].ref.current;
|
|
396
398
|
s.style.bottom = "0px";
|
|
397
399
|
const w = p.clientHeight - a.offsetTop - a.offsetHeight, Z = Math.max(
|
|
398
400
|
le,
|
|
399
|
-
|
|
401
|
+
ne + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
400
402
|
(S ? me : 0) + w + k
|
|
401
403
|
), $ = I + Z;
|
|
402
404
|
s.style.height = $ + "px";
|
|
403
405
|
} else {
|
|
404
|
-
const S =
|
|
406
|
+
const S = V.length > 0 && v === V[0].ref.current;
|
|
405
407
|
s.style.top = "0px";
|
|
406
408
|
const Z = Math.max(
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
(S ? fe : 0) +
|
|
409
|
+
ee,
|
|
410
|
+
W + a.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
411
|
+
(S ? fe : 0) + ne
|
|
410
412
|
) + N;
|
|
411
|
-
s.style.height = Z + "px", a.scrollTop = I -
|
|
413
|
+
s.style.height = Z + "px", a.scrollTop = I - ee + a.offsetTop;
|
|
412
414
|
}
|
|
413
|
-
s.style.margin = `${D}px 0`, s.style.minHeight = pe + "px", s.style.maxHeight = H + "px",
|
|
415
|
+
s.style.margin = `${D}px 0`, s.style.minHeight = pe + "px", s.style.maxHeight = H + "px", i == null || i(), requestAnimationFrame(() => R.current = !0);
|
|
414
416
|
}
|
|
415
417
|
}, [
|
|
416
418
|
P,
|
|
@@ -422,27 +424,27 @@ var At = "SelectItemAlignedPosition", We = t.forwardRef((n, i) => {
|
|
|
422
424
|
v,
|
|
423
425
|
y,
|
|
424
426
|
u.dir,
|
|
425
|
-
|
|
427
|
+
i
|
|
426
428
|
]);
|
|
427
|
-
|
|
429
|
+
Y(() => h(), [h]);
|
|
428
430
|
const [A, O] = t.useState();
|
|
429
|
-
|
|
431
|
+
Y(() => {
|
|
430
432
|
p && O(window.getComputedStyle(p).zIndex);
|
|
431
433
|
}, [p]);
|
|
432
|
-
const
|
|
433
|
-
(
|
|
434
|
-
|
|
434
|
+
const oe = t.useCallback(
|
|
435
|
+
(b) => {
|
|
436
|
+
b && T.current === !0 && (h(), d == null || d(), T.current = !1);
|
|
435
437
|
},
|
|
436
438
|
[h, d]
|
|
437
439
|
);
|
|
438
|
-
return /* @__PURE__ */
|
|
440
|
+
return /* @__PURE__ */ m(
|
|
439
441
|
Dt,
|
|
440
442
|
{
|
|
441
443
|
scope: e,
|
|
442
444
|
contentWrapper: s,
|
|
443
445
|
shouldExpandOnScrollRef: R,
|
|
444
|
-
onScrollButtonChange:
|
|
445
|
-
children: /* @__PURE__ */
|
|
446
|
+
onScrollButtonChange: oe,
|
|
447
|
+
children: /* @__PURE__ */ m(
|
|
446
448
|
"div",
|
|
447
449
|
{
|
|
448
450
|
ref: o,
|
|
@@ -452,7 +454,7 @@ var At = "SelectItemAlignedPosition", We = t.forwardRef((n, i) => {
|
|
|
452
454
|
position: "fixed",
|
|
453
455
|
zIndex: A
|
|
454
456
|
},
|
|
455
|
-
children: /* @__PURE__ */
|
|
457
|
+
children: /* @__PURE__ */ m(
|
|
456
458
|
M.div,
|
|
457
459
|
{
|
|
458
460
|
...l,
|
|
@@ -472,21 +474,21 @@ var At = "SelectItemAlignedPosition", We = t.forwardRef((n, i) => {
|
|
|
472
474
|
}
|
|
473
475
|
);
|
|
474
476
|
});
|
|
475
|
-
|
|
476
|
-
var Ot = "SelectPopperPosition", Se = t.forwardRef((n,
|
|
477
|
+
Ue.displayName = At;
|
|
478
|
+
var Ot = "SelectPopperPosition", Se = t.forwardRef((n, c) => {
|
|
477
479
|
const {
|
|
478
480
|
__scopeSelect: e,
|
|
479
|
-
align:
|
|
481
|
+
align: i = "start",
|
|
480
482
|
collisionPadding: l = D,
|
|
481
483
|
...u
|
|
482
484
|
} = n, r = ue(e);
|
|
483
|
-
return /* @__PURE__ */
|
|
485
|
+
return /* @__PURE__ */ m(
|
|
484
486
|
ft,
|
|
485
487
|
{
|
|
486
488
|
...r,
|
|
487
489
|
...u,
|
|
488
|
-
ref:
|
|
489
|
-
align:
|
|
490
|
+
ref: c,
|
|
491
|
+
align: i,
|
|
490
492
|
collisionPadding: l,
|
|
491
493
|
style: {
|
|
492
494
|
// Ensure border-box for floating-ui calculations
|
|
@@ -502,20 +504,20 @@ var Ot = "SelectPopperPosition", Se = t.forwardRef((n, i) => {
|
|
|
502
504
|
);
|
|
503
505
|
});
|
|
504
506
|
Se.displayName = Ot;
|
|
505
|
-
var [Dt, Pe] =
|
|
506
|
-
(n,
|
|
507
|
-
const { __scopeSelect: e, nonce:
|
|
507
|
+
var [Dt, Pe] = te(Q, {}), we = "SelectViewport", We = t.forwardRef(
|
|
508
|
+
(n, c) => {
|
|
509
|
+
const { __scopeSelect: e, nonce: i, ...l } = n, u = q(we, e), r = Pe(we, e), s = B(c, u.onViewportChange), o = t.useRef(0);
|
|
508
510
|
return /* @__PURE__ */ ce(Te, { children: [
|
|
509
|
-
/* @__PURE__ */
|
|
511
|
+
/* @__PURE__ */ m(
|
|
510
512
|
"style",
|
|
511
513
|
{
|
|
512
514
|
dangerouslySetInnerHTML: {
|
|
513
515
|
__html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"
|
|
514
516
|
},
|
|
515
|
-
nonce:
|
|
517
|
+
nonce: i
|
|
516
518
|
}
|
|
517
519
|
),
|
|
518
|
-
/* @__PURE__ */
|
|
520
|
+
/* @__PURE__ */ m(ae.Slot, { scope: e, children: /* @__PURE__ */ m(
|
|
519
521
|
M.div,
|
|
520
522
|
{
|
|
521
523
|
"data-radix-select-viewport": "",
|
|
@@ -535,7 +537,7 @@ var [Dt, Pe] = ee(J, {}), we = "SelectViewport", Fe = t.forwardRef(
|
|
|
535
537
|
overflow: "hidden auto",
|
|
536
538
|
...l.style
|
|
537
539
|
},
|
|
538
|
-
onScroll:
|
|
540
|
+
onScroll: E(l.onScroll, (p) => {
|
|
539
541
|
const g = p.currentTarget, { contentWrapper: C, shouldExpandOnScrollRef: P } = r;
|
|
540
542
|
if (P != null && P.current && C) {
|
|
541
543
|
const R = Math.abs(o.current - g.scrollTop);
|
|
@@ -554,61 +556,61 @@ var [Dt, Pe] = ee(J, {}), we = "SelectViewport", Fe = t.forwardRef(
|
|
|
554
556
|
] });
|
|
555
557
|
}
|
|
556
558
|
);
|
|
557
|
-
|
|
558
|
-
var
|
|
559
|
-
(n,
|
|
560
|
-
const { __scopeSelect: e, ...
|
|
561
|
-
return /* @__PURE__ */
|
|
559
|
+
We.displayName = we;
|
|
560
|
+
var Fe = "SelectGroup", [Lt, kt] = te(Fe), Ke = t.forwardRef(
|
|
561
|
+
(n, c) => {
|
|
562
|
+
const { __scopeSelect: e, ...i } = n, l = Ie();
|
|
563
|
+
return /* @__PURE__ */ m(Lt, { scope: e, id: l, children: /* @__PURE__ */ m(M.div, { role: "group", "aria-labelledby": l, ...i, ref: c }) });
|
|
562
564
|
}
|
|
563
565
|
);
|
|
564
|
-
Ke.displayName =
|
|
566
|
+
Ke.displayName = Fe;
|
|
565
567
|
var Ge = "SelectLabel", ze = t.forwardRef(
|
|
566
|
-
(n,
|
|
567
|
-
const { __scopeSelect: e, ...
|
|
568
|
-
return /* @__PURE__ */
|
|
568
|
+
(n, c) => {
|
|
569
|
+
const { __scopeSelect: e, ...i } = n, l = kt(Ge, e);
|
|
570
|
+
return /* @__PURE__ */ m(M.div, { id: l.id, ...i, ref: c });
|
|
569
571
|
}
|
|
570
572
|
);
|
|
571
573
|
ze.displayName = Ge;
|
|
572
|
-
var ie = "SelectItem", [
|
|
573
|
-
(n,
|
|
574
|
+
var ie = "SelectItem", [Bt, Ye] = te(ie), je = t.forwardRef(
|
|
575
|
+
(n, c) => {
|
|
574
576
|
const {
|
|
575
577
|
__scopeSelect: e,
|
|
576
|
-
value:
|
|
578
|
+
value: i,
|
|
577
579
|
disabled: l = !1,
|
|
578
580
|
textValue: u,
|
|
579
581
|
...r
|
|
580
|
-
} = n, s =
|
|
581
|
-
|
|
582
|
+
} = n, s = j(ie, e), o = q(ie, e), p = s.value === i, [g, C] = t.useState(u ?? ""), [P, R] = t.useState(!1), T = B(
|
|
583
|
+
c,
|
|
582
584
|
(d) => {
|
|
583
585
|
var h;
|
|
584
|
-
return (h = o.itemRefCallback) == null ? void 0 : h.call(o, d,
|
|
586
|
+
return (h = o.itemRefCallback) == null ? void 0 : h.call(o, d, i, l);
|
|
585
587
|
}
|
|
586
588
|
), a = Ie(), v = t.useRef("touch"), y = () => {
|
|
587
|
-
l || (s.onValueChange(
|
|
589
|
+
l || (s.onValueChange(i), s.onOpenChange(!1));
|
|
588
590
|
};
|
|
589
|
-
if (
|
|
591
|
+
if (i === "")
|
|
590
592
|
throw new Error(
|
|
591
593
|
"A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder."
|
|
592
594
|
);
|
|
593
|
-
return /* @__PURE__ */
|
|
594
|
-
|
|
595
|
+
return /* @__PURE__ */ m(
|
|
596
|
+
Bt,
|
|
595
597
|
{
|
|
596
598
|
scope: e,
|
|
597
|
-
value:
|
|
599
|
+
value: i,
|
|
598
600
|
disabled: l,
|
|
599
601
|
textId: a,
|
|
600
602
|
isSelected: p,
|
|
601
603
|
onItemTextChange: t.useCallback((d) => {
|
|
602
604
|
C((h) => h || ((d == null ? void 0 : d.textContent) ?? "").trim());
|
|
603
605
|
}, []),
|
|
604
|
-
children: /* @__PURE__ */
|
|
606
|
+
children: /* @__PURE__ */ m(
|
|
605
607
|
ae.ItemSlot,
|
|
606
608
|
{
|
|
607
609
|
scope: e,
|
|
608
|
-
value:
|
|
610
|
+
value: i,
|
|
609
611
|
disabled: l,
|
|
610
612
|
textValue: g,
|
|
611
|
-
children: /* @__PURE__ */
|
|
613
|
+
children: /* @__PURE__ */ m(
|
|
612
614
|
M.div,
|
|
613
615
|
{
|
|
614
616
|
role: "option",
|
|
@@ -621,26 +623,26 @@ var ie = "SelectItem", [Vt, je] = ee(ie), Ye = t.forwardRef(
|
|
|
621
623
|
tabIndex: l ? void 0 : -1,
|
|
622
624
|
...r,
|
|
623
625
|
ref: T,
|
|
624
|
-
onFocus:
|
|
625
|
-
onBlur:
|
|
626
|
-
onClick:
|
|
626
|
+
onFocus: E(r.onFocus, () => R(!0)),
|
|
627
|
+
onBlur: E(r.onBlur, () => R(!1)),
|
|
628
|
+
onClick: E(r.onClick, () => {
|
|
627
629
|
v.current !== "mouse" && y();
|
|
628
630
|
}),
|
|
629
|
-
onPointerUp:
|
|
631
|
+
onPointerUp: E(r.onPointerUp, () => {
|
|
630
632
|
v.current === "mouse" && y();
|
|
631
633
|
}),
|
|
632
|
-
onPointerDown:
|
|
634
|
+
onPointerDown: E(r.onPointerDown, (d) => {
|
|
633
635
|
v.current = d.pointerType;
|
|
634
636
|
}),
|
|
635
|
-
onPointerMove:
|
|
637
|
+
onPointerMove: E(r.onPointerMove, (d) => {
|
|
636
638
|
var h;
|
|
637
639
|
v.current = d.pointerType, l ? (h = o.onItemLeave) == null || h.call(o) : v.current === "mouse" && d.currentTarget.focus({ preventScroll: !0 });
|
|
638
640
|
}),
|
|
639
|
-
onPointerLeave:
|
|
641
|
+
onPointerLeave: E(r.onPointerLeave, (d) => {
|
|
640
642
|
var h;
|
|
641
643
|
d.currentTarget === document.activeElement && ((h = o.onItemLeave) == null || h.call(o));
|
|
642
644
|
}),
|
|
643
|
-
onKeyDown:
|
|
645
|
+
onKeyDown: E(r.onKeyDown, (d) => {
|
|
644
646
|
var A;
|
|
645
647
|
((A = o.searchRef) == null ? void 0 : A.current) !== "" && d.key === " " || (It.includes(d.key) && y(), d.key === " " && d.preventDefault());
|
|
646
648
|
})
|
|
@@ -652,11 +654,11 @@ var ie = "SelectItem", [Vt, je] = ee(ie), Ye = t.forwardRef(
|
|
|
652
654
|
);
|
|
653
655
|
}
|
|
654
656
|
);
|
|
655
|
-
|
|
656
|
-
var
|
|
657
|
-
(n,
|
|
658
|
-
const { __scopeSelect: e, className:
|
|
659
|
-
|
|
657
|
+
je.displayName = ie;
|
|
658
|
+
var re = "SelectItemText", qe = t.forwardRef(
|
|
659
|
+
(n, c) => {
|
|
660
|
+
const { __scopeSelect: e, className: i, style: l, ...u } = n, r = j(re, e), s = q(re, e), o = Ye(re, e), p = Et(re, e), [g, C] = t.useState(null), P = B(
|
|
661
|
+
c,
|
|
660
662
|
(y) => C(y),
|
|
661
663
|
o.onItemTextChange,
|
|
662
664
|
(y) => {
|
|
@@ -664,26 +666,26 @@ var ne = "SelectItemText", qe = t.forwardRef(
|
|
|
664
666
|
return (d = s.itemTextRefCallback) == null ? void 0 : d.call(s, y, o.value, o.disabled);
|
|
665
667
|
}
|
|
666
668
|
), R = g == null ? void 0 : g.textContent, T = t.useMemo(
|
|
667
|
-
() => /* @__PURE__ */
|
|
669
|
+
() => /* @__PURE__ */ m("option", { value: o.value, disabled: o.disabled, children: R }, o.value),
|
|
668
670
|
[o.disabled, o.value, R]
|
|
669
671
|
), { onNativeOptionAdd: a, onNativeOptionRemove: v } = p;
|
|
670
|
-
return
|
|
671
|
-
/* @__PURE__ */
|
|
672
|
-
o.isSelected && r.valueNode && !r.valueNodeHasChildren ?
|
|
672
|
+
return Y(() => (a(T), () => v(T)), [a, v, T]), /* @__PURE__ */ ce(Te, { children: [
|
|
673
|
+
/* @__PURE__ */ m(M.span, { id: o.textId, ...u, ref: P }),
|
|
674
|
+
o.isSelected && r.valueNode && !r.valueNodeHasChildren ? be.createPortal(u.children, r.valueNode) : null
|
|
673
675
|
] });
|
|
674
676
|
}
|
|
675
677
|
);
|
|
676
|
-
qe.displayName =
|
|
678
|
+
qe.displayName = re;
|
|
677
679
|
var Xe = "SelectItemIndicator", Ze = t.forwardRef(
|
|
678
|
-
(n,
|
|
679
|
-
const { __scopeSelect: e, ...
|
|
680
|
-
return
|
|
680
|
+
(n, c) => {
|
|
681
|
+
const { __scopeSelect: e, ...i } = n;
|
|
682
|
+
return Ye(Xe, e).isSelected ? /* @__PURE__ */ m(M.span, { "aria-hidden": !0, ...i, ref: c }) : null;
|
|
681
683
|
}
|
|
682
684
|
);
|
|
683
685
|
Ze.displayName = Xe;
|
|
684
|
-
var Ce = "SelectScrollUpButton", $e = t.forwardRef((n,
|
|
685
|
-
const e = q(Ce, n.__scopeSelect),
|
|
686
|
-
return
|
|
686
|
+
var Ce = "SelectScrollUpButton", $e = t.forwardRef((n, c) => {
|
|
687
|
+
const e = q(Ce, n.__scopeSelect), i = Pe(Ce, n.__scopeSelect), [l, u] = t.useState(!1), r = B(c, i.onScrollButtonChange);
|
|
688
|
+
return Y(() => {
|
|
687
689
|
if (e.viewport && e.isPositioned) {
|
|
688
690
|
let s = function() {
|
|
689
691
|
const p = o.scrollTop > 0;
|
|
@@ -692,7 +694,7 @@ var Ce = "SelectScrollUpButton", $e = t.forwardRef((n, i) => {
|
|
|
692
694
|
const o = e.viewport;
|
|
693
695
|
return s(), o.addEventListener("scroll", s), () => o.removeEventListener("scroll", s);
|
|
694
696
|
}
|
|
695
|
-
}, [e.viewport, e.isPositioned]), l ? /* @__PURE__ */
|
|
697
|
+
}, [e.viewport, e.isPositioned]), l ? /* @__PURE__ */ m(
|
|
696
698
|
Qe,
|
|
697
699
|
{
|
|
698
700
|
...n,
|
|
@@ -705,9 +707,9 @@ var Ce = "SelectScrollUpButton", $e = t.forwardRef((n, i) => {
|
|
|
705
707
|
) : null;
|
|
706
708
|
});
|
|
707
709
|
$e.displayName = Ce;
|
|
708
|
-
var ye = "SelectScrollDownButton", Je = t.forwardRef((n,
|
|
709
|
-
const e = q(ye, n.__scopeSelect),
|
|
710
|
-
return
|
|
710
|
+
var ye = "SelectScrollDownButton", Je = t.forwardRef((n, c) => {
|
|
711
|
+
const e = q(ye, n.__scopeSelect), i = Pe(ye, n.__scopeSelect), [l, u] = t.useState(!1), r = B(c, i.onScrollButtonChange);
|
|
712
|
+
return Y(() => {
|
|
711
713
|
if (e.viewport && e.isPositioned) {
|
|
712
714
|
let s = function() {
|
|
713
715
|
const p = o.scrollHeight - o.clientHeight, g = Math.ceil(o.scrollTop) < p;
|
|
@@ -716,7 +718,7 @@ var ye = "SelectScrollDownButton", Je = t.forwardRef((n, i) => {
|
|
|
716
718
|
const o = e.viewport;
|
|
717
719
|
return s(), o.addEventListener("scroll", s), () => o.removeEventListener("scroll", s);
|
|
718
720
|
}
|
|
719
|
-
}, [e.viewport, e.isPositioned]), l ? /* @__PURE__ */
|
|
721
|
+
}, [e.viewport, e.isPositioned]), l ? /* @__PURE__ */ m(
|
|
720
722
|
Qe,
|
|
721
723
|
{
|
|
722
724
|
...n,
|
|
@@ -729,82 +731,92 @@ var ye = "SelectScrollDownButton", Je = t.forwardRef((n, i) => {
|
|
|
729
731
|
) : null;
|
|
730
732
|
});
|
|
731
733
|
Je.displayName = ye;
|
|
732
|
-
var Qe = t.forwardRef((n,
|
|
733
|
-
const { __scopeSelect: e, onAutoScroll:
|
|
734
|
+
var Qe = t.forwardRef((n, c) => {
|
|
735
|
+
const { __scopeSelect: e, onAutoScroll: i, ...l } = n, u = q("SelectScrollButton", e), r = t.useRef(null), s = de(e), o = t.useCallback(() => {
|
|
734
736
|
r.current !== null && (window.clearInterval(r.current), r.current = null);
|
|
735
737
|
}, []);
|
|
736
|
-
return t.useEffect(() => () => o(), [o]),
|
|
738
|
+
return t.useEffect(() => () => o(), [o]), Y(() => {
|
|
737
739
|
var g;
|
|
738
740
|
const p = s().find((C) => C.ref.current === document.activeElement);
|
|
739
741
|
(g = p == null ? void 0 : p.ref.current) == null || g.scrollIntoView({ block: "nearest" });
|
|
740
|
-
}, [s]), /* @__PURE__ */
|
|
742
|
+
}, [s]), /* @__PURE__ */ m(
|
|
741
743
|
M.div,
|
|
742
744
|
{
|
|
743
745
|
"aria-hidden": !0,
|
|
744
746
|
...l,
|
|
745
|
-
ref:
|
|
747
|
+
ref: c,
|
|
746
748
|
style: { flexShrink: 0, ...l.style },
|
|
747
|
-
onPointerDown:
|
|
748
|
-
r.current === null && (r.current = window.setInterval(
|
|
749
|
+
onPointerDown: E(l.onPointerDown, () => {
|
|
750
|
+
r.current === null && (r.current = window.setInterval(i, 50));
|
|
749
751
|
}),
|
|
750
|
-
onPointerMove:
|
|
752
|
+
onPointerMove: E(l.onPointerMove, () => {
|
|
751
753
|
var p;
|
|
752
|
-
(p = u.onItemLeave) == null || p.call(u), r.current === null && (r.current = window.setInterval(
|
|
754
|
+
(p = u.onItemLeave) == null || p.call(u), r.current === null && (r.current = window.setInterval(i, 50));
|
|
753
755
|
}),
|
|
754
|
-
onPointerLeave:
|
|
756
|
+
onPointerLeave: E(l.onPointerLeave, () => {
|
|
755
757
|
o();
|
|
756
758
|
})
|
|
757
759
|
}
|
|
758
760
|
);
|
|
759
|
-
}),
|
|
760
|
-
(n,
|
|
761
|
-
const { __scopeSelect: e, ...
|
|
762
|
-
return /* @__PURE__ */
|
|
761
|
+
}), Vt = "SelectSeparator", et = t.forwardRef(
|
|
762
|
+
(n, c) => {
|
|
763
|
+
const { __scopeSelect: e, ...i } = n;
|
|
764
|
+
return /* @__PURE__ */ m(M.div, { "aria-hidden": !0, ...i, ref: c });
|
|
763
765
|
}
|
|
764
766
|
);
|
|
765
|
-
et.displayName =
|
|
767
|
+
et.displayName = Vt;
|
|
766
768
|
var xe = "SelectArrow", Ht = t.forwardRef(
|
|
767
|
-
(n,
|
|
768
|
-
const { __scopeSelect: e, ...
|
|
769
|
-
return u.open && r.position === "popper" ? /* @__PURE__ */
|
|
769
|
+
(n, c) => {
|
|
770
|
+
const { __scopeSelect: e, ...i } = n, l = ue(e), u = j(xe, e), r = q(xe, e);
|
|
771
|
+
return u.open && r.position === "popper" ? /* @__PURE__ */ m(mt, { ...l, ...i, ref: c }) : null;
|
|
770
772
|
}
|
|
771
773
|
);
|
|
772
774
|
Ht.displayName = xe;
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
var ot = t.forwardRef(
|
|
777
|
-
(n, i) => {
|
|
778
|
-
const { value: e, ...c } = n, l = t.useRef(null), u = V(i, l), r = St(e);
|
|
775
|
+
var Ut = "SelectBubbleInput", tt = t.forwardRef(
|
|
776
|
+
({ __scopeSelect: n, value: c, ...e }, i) => {
|
|
777
|
+
const l = t.useRef(null), u = B(i, l), r = St(c);
|
|
779
778
|
return t.useEffect(() => {
|
|
780
|
-
const s = l.current
|
|
779
|
+
const s = l.current;
|
|
780
|
+
if (!s) return;
|
|
781
|
+
const o = window.HTMLSelectElement.prototype, g = Object.getOwnPropertyDescriptor(
|
|
781
782
|
o,
|
|
782
783
|
"value"
|
|
783
784
|
).set;
|
|
784
|
-
if (r !==
|
|
785
|
+
if (r !== c && g) {
|
|
785
786
|
const C = new Event("change", { bubbles: !0 });
|
|
786
|
-
g.call(s,
|
|
787
|
+
g.call(s, c), s.dispatchEvent(C);
|
|
788
|
+
}
|
|
789
|
+
}, [r, c]), /* @__PURE__ */ m(
|
|
790
|
+
M.select,
|
|
791
|
+
{
|
|
792
|
+
...e,
|
|
793
|
+
style: { ...wt, ...e.style },
|
|
794
|
+
ref: u,
|
|
795
|
+
defaultValue: c
|
|
787
796
|
}
|
|
788
|
-
|
|
797
|
+
);
|
|
789
798
|
}
|
|
790
799
|
);
|
|
791
|
-
|
|
800
|
+
tt.displayName = Ut;
|
|
801
|
+
function ot(n) {
|
|
802
|
+
return n === "" || n === void 0;
|
|
803
|
+
}
|
|
792
804
|
function nt(n) {
|
|
793
|
-
const
|
|
805
|
+
const c = gt(n), e = t.useRef(""), i = t.useRef(0), l = t.useCallback(
|
|
794
806
|
(r) => {
|
|
795
807
|
const s = e.current + r;
|
|
796
|
-
|
|
797
|
-
e.current = p, window.clearTimeout(
|
|
808
|
+
c(s), function o(p) {
|
|
809
|
+
e.current = p, window.clearTimeout(i.current), p !== "" && (i.current = window.setTimeout(() => o(""), 1e3));
|
|
798
810
|
}(s);
|
|
799
811
|
},
|
|
800
|
-
[
|
|
812
|
+
[c]
|
|
801
813
|
), u = t.useCallback(() => {
|
|
802
|
-
e.current = "", window.clearTimeout(
|
|
814
|
+
e.current = "", window.clearTimeout(i.current);
|
|
803
815
|
}, []);
|
|
804
|
-
return t.useEffect(() => () => window.clearTimeout(
|
|
816
|
+
return t.useEffect(() => () => window.clearTimeout(i.current), []), [e, l, u];
|
|
805
817
|
}
|
|
806
|
-
function rt(n,
|
|
807
|
-
const l =
|
|
818
|
+
function rt(n, c, e) {
|
|
819
|
+
const l = c.length > 1 && Array.from(c).every((p) => p === c[0]) ? c[0] : c, u = e ? n.indexOf(e) : -1;
|
|
808
820
|
let r = Wt(n, Math.max(u, 0));
|
|
809
821
|
l.length === 1 && (r = r.filter((p) => p !== e));
|
|
810
822
|
const o = r.find(
|
|
@@ -812,28 +824,28 @@ function rt(n, i, e) {
|
|
|
812
824
|
);
|
|
813
825
|
return o !== e ? o : void 0;
|
|
814
826
|
}
|
|
815
|
-
function Wt(n,
|
|
816
|
-
return n.map((e,
|
|
827
|
+
function Wt(n, c) {
|
|
828
|
+
return n.map((e, i) => n[(c + i) % n.length]);
|
|
817
829
|
}
|
|
818
|
-
var
|
|
830
|
+
var po = Ne, fo = Ae, mo = De, ho = Le, vo = ke, go = Be, So = We, wo = Ke, Co = ze, yo = je, xo = qe, Io = Ze, To = $e, Po = Je, Ro = et;
|
|
819
831
|
export {
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
832
|
+
go as Content,
|
|
833
|
+
wo as Group,
|
|
834
|
+
ho as Icon,
|
|
835
|
+
yo as Item,
|
|
836
|
+
Io as ItemIndicator,
|
|
837
|
+
xo as ItemText,
|
|
838
|
+
Co as Label,
|
|
839
|
+
vo as Portal,
|
|
840
|
+
po as Root,
|
|
841
|
+
Po as ScrollDownButton,
|
|
842
|
+
To as ScrollUpButton,
|
|
831
843
|
Ne as Select,
|
|
832
844
|
Ht as SelectArrow,
|
|
833
|
-
|
|
845
|
+
Be as SelectContent,
|
|
834
846
|
Ke as SelectGroup,
|
|
835
847
|
Le as SelectIcon,
|
|
836
|
-
|
|
848
|
+
je as SelectItem,
|
|
837
849
|
Ze as SelectItemIndicator,
|
|
838
850
|
qe as SelectItemText,
|
|
839
851
|
ze as SelectLabel,
|
|
@@ -843,10 +855,10 @@ export {
|
|
|
843
855
|
et as SelectSeparator,
|
|
844
856
|
Ae as SelectTrigger,
|
|
845
857
|
De as SelectValue,
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
858
|
+
We as SelectViewport,
|
|
859
|
+
Ro as Separator,
|
|
860
|
+
fo as Trigger,
|
|
861
|
+
mo as Value,
|
|
862
|
+
So as Viewport,
|
|
863
|
+
uo as createSelectScope
|
|
852
864
|
};
|