@wrdagency/blockout 1.0.5 → 1.0.7
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/2NBKRL7C-CzwWfv1x.js +76 -0
- package/dist/2RSXSRCN-rMUAytae.js +61 -0
- package/dist/{4CMBR7SL-xNGezbCB.js → 4CMBR7SL-ChJnawVl.js} +132 -126
- package/dist/{5JTVDSTH-CIreO5bC.js → 5JTVDSTH-DcfjjEya.js} +4 -4
- package/dist/{5VQZOHHZ-CNzYHc1X.js → 5VQZOHHZ-BN-teS5E.js} +1 -1
- package/dist/{6VRAQV3D-BoLhl3hf.js → 6VRAQV3D-DK_p41oq.js} +6 -6
- package/dist/A3WPL2ZJ-CpUtG5Sk.js +12 -0
- package/dist/{BM6PGYQY-Bhr7peim.js → BM6PGYQY-CkMwDqt0.js} +2 -2
- package/dist/Check.es-CMkTf2It.js +38 -0
- package/dist/{DG5U6ZEL-C7eLVyh-.js → DG5U6ZEL-GfwW2sqh.js} +3 -3
- package/dist/EM5CXX6A-C74NAQPE.js +13 -0
- package/dist/{F5MUBM3I-_HauDyEF.js → F5MUBM3I-BbDMTUwx.js} +24 -24
- package/dist/{G7GW6PWC-Crp1Jn-8.js → G7GW6PWC-A0eDeXMt.js} +100 -96
- package/dist/IWEFDH56-CvOsIcbb.js +19 -0
- package/dist/{J2LQO3EC-CcHJqN0I.js → J2LQO3EC-DYtZQQv6.js} +4 -3
- package/dist/{KFH4SEIX-D-fCkpQv.js → KFH4SEIX-BFT9WmYk.js} +3 -3
- package/dist/{LMDWO4NN-DdLnHzru.js → LMDWO4NN-CIZvvtic.js} +233 -203
- package/dist/MAXQOH4L-DBaf8WKp.js +564 -0
- package/dist/MR26YJYP-DacZIkgJ.js +287 -0
- package/dist/MTZPJQMC-DPwZ6caC.js +13 -0
- package/dist/{O2PQ2652-THp22K4G.js → O2PQ2652-D2GSkoLq.js} +6 -6
- package/dist/P7GR5CS5-5PtDURPc.js +24 -0
- package/dist/{PFRGBC2K-DUhGSIey.js → PFRGBC2K-B9ko--FF.js} +34 -33
- package/dist/Plus.es-DJ5SuqNv.js +38 -0
- package/dist/RS7LB2H4-BvDKQaCt.js +18 -0
- package/dist/RZ4GPYOB-COPqjbOz.js +37 -0
- package/dist/{S43UC3DV-erT1ucAd.js → S43UC3DV-CiBKpqp8.js} +3 -3
- package/dist/{T7VMP3TM-C-Aesx9K.js → T7VMP3TM-C0xl-w4G.js} +21 -21
- package/dist/TP7N7UIH-Dc0CLLi8.js +33 -0
- package/dist/{UQQRIHDV-DIXH69U3.js → UQQRIHDV-BBkcyl82.js} +17 -17
- package/dist/UYGDZTLQ-9uAEICxv.js +13 -0
- package/dist/VIIRIBF3-uvnIyICw.js +31 -0
- package/dist/WMYDSCNQ-D4CU76mX.js +61 -0
- package/dist/{WYCIER3C-S-jsj0wy.js → WYCIER3C-CaoIoaX7.js} +4 -4
- package/dist/{YV4JVR4I-BXEaRiAN.js → YV4JVR4I-w1-dnslS.js} +47 -47
- package/dist/assets/index10.css +1 -1
- package/dist/assets/index11.css +1 -1
- package/dist/assets/index12.css +1 -1
- package/dist/assets/index13.css +1 -1
- package/dist/assets/index14.css +1 -1
- package/dist/assets/index15.css +1 -1
- package/dist/assets/index16.css +1 -1
- package/dist/assets/index17.css +1 -1
- package/dist/assets/index4.css +1 -1
- package/dist/assets/style16.css +1 -1
- package/dist/assets/style17.css +1 -1
- package/dist/assets/style18.css +1 -1
- package/dist/assets/style19.css +1 -1
- package/dist/assets/style20.css +1 -1
- package/dist/assets/style21.css +1 -1
- package/dist/assets/style22.css +1 -1
- package/dist/assets/style23.css +1 -1
- package/dist/assets/style24.css +1 -1
- package/dist/assets/style25.css +1 -1
- package/dist/assets/style26.css +1 -1
- package/dist/assets/style27.css +1 -0
- package/dist/components/breadcrumbs/index.js +5 -5
- package/dist/components/button/row.js +4 -4
- package/dist/components/controls/base-popover-control/index.js +4 -4
- package/dist/components/controls/card-number-control/index.js +1 -1
- package/dist/components/controls/date-control/index.js +1 -1
- package/dist/components/controls/date-control/picker.js +5 -5
- package/dist/components/controls/index.d.ts +1 -0
- package/dist/components/controls/index.js +12 -10
- package/dist/components/controls/list-control/item.js +34 -67
- package/dist/components/controls/list-control/list.js +1 -1
- package/dist/components/controls/recurrence-control/index.js +19 -18
- package/dist/components/controls/select-control/control.js +26 -37
- package/dist/components/controls/select-control/select.js +62 -1129
- package/dist/components/controls/tag-control/ariakit-experimental.d.ts +7 -0
- package/dist/components/controls/tag-control/ariakit-experimental.js +2308 -0
- package/dist/components/controls/tag-control/index.d.ts +10 -0
- package/dist/components/controls/tag-control/index.js +137 -0
- package/dist/components/controls/tag-control/props.d.ts +20 -0
- package/dist/components/controls/tag-control/props.js +57 -0
- package/dist/components/controls/text-control/index.js +1 -1
- package/dist/components/data-view/data/apply.js +15 -15
- package/dist/components/data-view/data/filter.js +14 -12
- package/dist/components/data-view/index.js +1 -1
- package/dist/components/data-view/layouts/grid/empty.js +1 -1
- package/dist/components/data-view/layouts/grid/group.js +9 -7
- package/dist/components/data-view/layouts/grid/item.js +9 -7
- package/dist/components/data-view/layouts/grid/root.js +1 -1
- package/dist/components/data-view/layouts/kanban/empty.js +1 -1
- package/dist/components/data-view/layouts/kanban/group.js +9 -7
- package/dist/components/data-view/layouts/kanban/item.js +9 -7
- package/dist/components/data-view/layouts/kanban/root.js +1 -1
- package/dist/components/data-view/layouts/list/empty.js +1 -1
- package/dist/components/data-view/layouts/list/group.js +9 -7
- package/dist/components/data-view/layouts/list/item.js +9 -7
- package/dist/components/data-view/layouts/list/root.js +1 -1
- package/dist/components/data-view/layouts/table/empty.js +9 -7
- package/dist/components/data-view/layouts/table/group.js +10 -8
- package/dist/components/data-view/layouts/table/item.js +10 -8
- package/dist/components/data-view/layouts/table/root.js +9 -7
- package/dist/components/data-view/parts/body/index.js +11 -9
- package/dist/components/data-view/parts/controls/index.js +9 -7
- package/dist/components/data-view/parts/controls/search.js +9 -7
- package/dist/components/data-view/parts/filters/editor.js +8 -6
- package/dist/components/data-view/parts/filters/index.js +1 -1
- package/dist/components/data-view/parts/filters/list.js +39 -73
- package/dist/components/data-view/parts/footer/actions.js +9 -7
- package/dist/components/data-view/parts/footer/index.js +9 -7
- package/dist/components/data-view/parts/footer/selection.js +9 -7
- package/dist/components/data-view/parts/view-control/index.js +23 -21
- package/dist/components/data-view/root.js +9 -7
- package/dist/components/data-view/slots/group/checkbox.js +9 -7
- package/dist/components/data-view/slots/group/context.js +1 -1
- package/dist/components/data-view/slots/group/icon.js +1 -1
- package/dist/components/data-view/slots/group/index.js +1 -1
- package/dist/components/data-view/slots/group/label.js +1 -1
- package/dist/components/data-view/slots/index.js +3 -3
- package/dist/components/data-view/slots/item/actions.js +1 -1
- package/dist/components/data-view/slots/item/checkbox.js +9 -7
- package/dist/components/data-view/slots/item/depth.js +3 -3
- package/dist/components/data-view/slots/item/description.js +1 -1
- package/dist/components/data-view/slots/item/index.js +2 -2
- package/dist/components/data-view/slots/item/properties.js +2 -2
- package/dist/components/data-view/slots/item/relations.js +3 -3
- package/dist/components/data-view/slots/item/tags.js +1 -1
- package/dist/components/data-view/slots/item/thumbnail.js +1 -1
- package/dist/components/data-view/slots/item/title.js +1 -1
- package/dist/components/data-view/slots/item/util.js +2 -2
- package/dist/components/data-view/slots/property/field/editable.js +8 -6
- package/dist/components/data-view/slots/property/field/index.js +2 -2
- package/dist/components/data-view/slots/property/field/static.js +1 -1
- package/dist/components/data-view/slots/property/index.js +1 -1
- package/dist/components/data-view/slots/property/label.js +1 -1
- package/dist/components/data-view/slots/root/checkbox.js +8 -6
- package/dist/components/data-view/slots/root/index.js +1 -1
- package/dist/components/filesystem/file.js +1 -1
- package/dist/components/filesystem/folder.js +29 -80
- package/dist/components/filesystem/list.js +1 -1
- package/dist/components/filesystem/root.js +1 -1
- package/dist/components/index.js +41 -39
- package/dist/components/menu/index.js +14 -13
- package/dist/components/menu/item.js +1 -1
- package/dist/components/menu/items/action.js +1 -1
- package/dist/components/menu/items/spacer.js +4 -16
- package/dist/components/menu/items/submenu.js +4 -3
- package/dist/components/menu/items/toggle.js +1 -1
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/tabs/list.js +8 -36
- package/dist/components/tabs/panel.js +13 -126
- package/dist/components/tabs/root.js +14 -166
- package/dist/components/tabs/tab.js +5 -79
- package/dist/components/toolbar/divider.js +7 -19
- package/dist/components/toolbar/index.js +10 -24
- package/dist/components/toolbar/root.js +5 -67
- package/dist/components/window/index.js +2 -2
- package/dist/{composite-provider-R5SnRc_G.js → composite-provider-B-M1AaRb.js} +2 -2
- package/dist/disclosure-provider-DW9RmAuE.js +61 -0
- package/dist/{filter-C-ZkRgt_.js → filter-GoxwLwkT.js} +14 -12
- package/dist/{index-DI0cEpya.js → index-C_xrLeQq.js} +20 -18
- package/dist/{index-BW-2OhmK.js → index-DJ2XZnew.js} +7 -5
- package/dist/{index-Bj4Ga50P.js → index-DpV0obFX.js} +6 -4
- package/dist/index.js +87 -85
- package/dist/item-CYpF0or4.js +58 -0
- package/dist/{style-tA0yiKCL.js → match-sorter.esm-MNVE8H_6.js} +1 -1
- package/dist/menu-button-D0chRxS0.js +416 -0
- package/dist/menu-separator-Cy38O3cZ.js +16 -0
- package/dist/{picker-BkmBjgWA.js → picker-BAQPD-c9.js} +4 -4
- package/dist/popover-provider-DZV1nb7Q.js +10 -0
- package/dist/primitives/popover/index.js +2 -2
- package/dist/primitives/popover/root.js +12 -3
- package/dist/primitives/popover/target.js +1 -1
- package/dist/primitives/popover/window.js +3 -3
- package/dist/primitives/tooltip/index.js +10 -173
- package/dist/select-popover-DYAZyLp4.js +542 -0
- package/dist/select-value-CeoMyvpZ.js +15 -0
- package/dist/{sortable.esm-De3H-_AA.js → sortable.esm-BuV7eW2H.js} +4 -4
- package/dist/{style-C7eFpUVU.js → style-CWAa57kN.js} +1 -1
- package/dist/tab-DjNG1rEI.js +79 -0
- package/dist/tab-list-DtMnUjoy.js +33 -0
- package/dist/tab-panel-DdkeLgKE.js +118 -0
- package/dist/tab-provider-BMkHrtIK.js +158 -0
- package/dist/tag-remove-BVa8oSsq.js +533 -0
- package/dist/toolbar-B7_t1rYu.js +68 -0
- package/dist/toolbar-separator-DBoO5XdF.js +16 -0
- package/dist/tooltip-anchor-CxZWazuo.js +173 -0
- package/package.json +1 -1
- package/dist/2NBKRL7C-Cug3TzgR.js +0 -85
- package/dist/2RSXSRCN-Bc3g-z-i.js +0 -61
- package/dist/A3WPL2ZJ-D0Eh1dEB.js +0 -11
- package/dist/EM5CXX6A-DKxCXPnz.js +0 -14
- package/dist/MR26YJYP-yD1_RvCA.js +0 -283
- package/dist/MTZPJQMC-RLG1q394.js +0 -12
- package/dist/P7GR5CS5-Dub2zqTX.js +0 -22
- package/dist/RS7LB2H4-C0kmTjy8.js +0 -15
- package/dist/RZ4GPYOB-c8s_KHUk.js +0 -37
- package/dist/TP7N7UIH-mdk33dnV.js +0 -34
- package/dist/UYGDZTLQ-fOwUiOjI.js +0 -12
- package/dist/VIIRIBF3-DylpToFV.js +0 -18
- package/dist/WMYDSCNQ-D43V-JUe.js +0 -62
- package/dist/item-C5GtZF5t.js +0 -470
- package/dist/root-C7IYlG1s.js +0 -20
|
@@ -1,1139 +1,72 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { cn as
|
|
3
|
-
import '../../../assets/styles.css';import '../../../assets/style7.css';import '../../../assets/style6.css';import '../../../assets/style5.css';import '../../../assets/style4.css';import '../../../assets/style3.css';import '../../../assets/style2.css';import '../../../assets/style.css';import '../../../assets/style10.css';/* empty css */
|
|
4
|
-
import {
|
|
1
|
+
import { jsx as o, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import { cn as b } from "../../../utils/css.js";
|
|
3
|
+
import '../../../assets/style16.css';import '../../../assets/styles.css';import '../../../assets/style7.css';import '../../../assets/style6.css';import '../../../assets/style5.css';import '../../../assets/style4.css';import '../../../assets/style3.css';import '../../../assets/style2.css';import '../../../assets/style.css';import '../../../assets/style10.css';/* empty css */
|
|
4
|
+
import { useState as p, useMemo as x, startTransition as N } from "react";
|
|
5
5
|
/* empty css */
|
|
6
6
|
/* empty css */
|
|
7
7
|
/* empty css */
|
|
8
8
|
import "../../../primitives/popover/index.js";
|
|
9
9
|
/* empty css */
|
|
10
|
-
import { ScrollArea as
|
|
10
|
+
import { ScrollArea as O } from "../../../primitives/scroll-area/index.js";
|
|
11
11
|
import "../../../primitives/symbol/index.js";
|
|
12
12
|
/* empty css */
|
|
13
13
|
/* empty css */
|
|
14
14
|
/* empty css */
|
|
15
15
|
/* empty css */
|
|
16
|
-
import { normalizeOption as
|
|
17
|
-
import { s as
|
|
18
|
-
import { m as
|
|
19
|
-
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
import { h as Ee } from "../../../PFRGBC2K-DUhGSIey.js";
|
|
34
|
-
import { u as St } from "../../../UQQRIHDV-DIXH69U3.js";
|
|
35
|
-
import { u as ht } from "../../../6VRAQV3D-BoLhl3hf.js";
|
|
36
|
-
var ho = "span", go = {
|
|
37
|
-
top: "4,10 8,6 12,10",
|
|
38
|
-
right: "6,4 10,8 6,12",
|
|
39
|
-
bottom: "4,6 8,10 12,6",
|
|
40
|
-
left: "10,4 6,8 10,12"
|
|
41
|
-
}, gt = Z(function(o) {
|
|
42
|
-
var n = o, { store: e, placement: r } = n, i = ee(n, ["store", "placement"]);
|
|
43
|
-
const a = fo();
|
|
44
|
-
e = e || a, ce(
|
|
45
|
-
e,
|
|
46
|
-
process.env.NODE_ENV !== "production" && "PopoverDisclosureArrow must be wrapped in a PopoverDisclosure component."
|
|
47
|
-
);
|
|
48
|
-
const I = e.useState((s) => r || s.placement).split("-")[0], v = go[I], u = Se(
|
|
49
|
-
() => /* @__PURE__ */ V(
|
|
50
|
-
"svg",
|
|
51
|
-
{
|
|
52
|
-
display: "block",
|
|
53
|
-
fill: "none",
|
|
54
|
-
stroke: "currentColor",
|
|
55
|
-
strokeLinecap: "round",
|
|
56
|
-
strokeLinejoin: "round",
|
|
57
|
-
strokeWidth: 1.5,
|
|
58
|
-
viewBox: "0 0 16 16",
|
|
59
|
-
height: "1em",
|
|
60
|
-
width: "1em",
|
|
61
|
-
children: /* @__PURE__ */ V("polyline", { points: v })
|
|
62
|
-
}
|
|
63
|
-
),
|
|
64
|
-
[v]
|
|
65
|
-
);
|
|
66
|
-
return i = R(C({
|
|
67
|
-
children: u,
|
|
68
|
-
"aria-hidden": !0
|
|
69
|
-
}, i), {
|
|
70
|
-
style: C({
|
|
71
|
-
width: "1em",
|
|
72
|
-
height: "1em",
|
|
73
|
-
pointerEvents: "none"
|
|
74
|
-
}, i.style)
|
|
75
|
-
}), Ue(i);
|
|
76
|
-
});
|
|
77
|
-
te(
|
|
78
|
-
function(o) {
|
|
79
|
-
const n = gt(o);
|
|
80
|
-
return oe(ho, n);
|
|
81
|
-
}
|
|
82
|
-
);
|
|
83
|
-
function Co(t = {}) {
|
|
84
|
-
var o = t, {
|
|
85
|
-
combobox: n
|
|
86
|
-
} = o, e = je(o, [
|
|
87
|
-
"combobox"
|
|
88
|
-
]);
|
|
89
|
-
const r = ot(
|
|
90
|
-
e.store,
|
|
91
|
-
oo(n, [
|
|
92
|
-
"value",
|
|
93
|
-
"items",
|
|
94
|
-
"renderedItems",
|
|
95
|
-
"baseElement",
|
|
96
|
-
"arrowElement",
|
|
97
|
-
"anchorElement",
|
|
98
|
-
"contentElement",
|
|
99
|
-
"popoverElement",
|
|
100
|
-
"disclosureElement"
|
|
101
|
-
])
|
|
102
|
-
);
|
|
103
|
-
nt(e, r);
|
|
104
|
-
const i = r.getState(), a = Ze(se(j({}, e), {
|
|
105
|
-
store: r,
|
|
106
|
-
virtualFocus: D(
|
|
107
|
-
e.virtualFocus,
|
|
108
|
-
i.virtualFocus,
|
|
109
|
-
!0
|
|
110
|
-
),
|
|
111
|
-
includesBaseElement: D(
|
|
112
|
-
e.includesBaseElement,
|
|
113
|
-
i.includesBaseElement,
|
|
114
|
-
!1
|
|
115
|
-
),
|
|
116
|
-
activeId: D(
|
|
117
|
-
e.activeId,
|
|
118
|
-
i.activeId,
|
|
119
|
-
e.defaultActiveId,
|
|
120
|
-
null
|
|
121
|
-
),
|
|
122
|
-
orientation: D(
|
|
123
|
-
e.orientation,
|
|
124
|
-
i.orientation,
|
|
125
|
-
"vertical"
|
|
126
|
-
)
|
|
127
|
-
})), w = Xe(se(j({}, e), {
|
|
128
|
-
store: r,
|
|
129
|
-
placement: D(
|
|
130
|
-
e.placement,
|
|
131
|
-
i.placement,
|
|
132
|
-
"bottom-start"
|
|
133
|
-
)
|
|
134
|
-
})), I = new String(""), v = se(j(j({}, a.getState()), w.getState()), {
|
|
135
|
-
value: D(
|
|
136
|
-
e.value,
|
|
137
|
-
i.value,
|
|
138
|
-
e.defaultValue,
|
|
139
|
-
I
|
|
140
|
-
),
|
|
141
|
-
setValueOnMove: D(
|
|
142
|
-
e.setValueOnMove,
|
|
143
|
-
i.setValueOnMove,
|
|
144
|
-
!1
|
|
145
|
-
),
|
|
146
|
-
labelElement: D(i.labelElement, null),
|
|
147
|
-
selectElement: D(i.selectElement, null),
|
|
148
|
-
listElement: D(i.listElement, null)
|
|
149
|
-
}), u = rt(v, a, w, r);
|
|
150
|
-
return Q(
|
|
151
|
-
u,
|
|
152
|
-
() => J(u, ["value", "items"], (s) => {
|
|
153
|
-
if (s.value !== I || !s.items.length) return;
|
|
154
|
-
const b = s.items.find(
|
|
155
|
-
(O) => !O.disabled && O.value != null
|
|
156
|
-
);
|
|
157
|
-
(b == null ? void 0 : b.value) != null && u.setState("value", b.value);
|
|
158
|
-
})
|
|
159
|
-
), Q(
|
|
160
|
-
u,
|
|
161
|
-
() => J(u, ["mounted"], (s) => {
|
|
162
|
-
s.mounted || u.setState("activeId", v.activeId);
|
|
163
|
-
})
|
|
164
|
-
), Q(
|
|
165
|
-
u,
|
|
166
|
-
() => J(u, ["mounted", "items", "value"], (s) => {
|
|
167
|
-
if (n || s.mounted) return;
|
|
168
|
-
const b = dt(s.value), O = b[b.length - 1];
|
|
169
|
-
if (O == null) return;
|
|
170
|
-
const c = s.items.find(
|
|
171
|
-
(p) => !p.disabled && p.value === O
|
|
172
|
-
);
|
|
173
|
-
c && u.setState("activeId", c.id);
|
|
174
|
-
})
|
|
175
|
-
), Q(
|
|
176
|
-
u,
|
|
177
|
-
() => lt(u, ["setValueOnMove", "moves"], (s) => {
|
|
178
|
-
const { mounted: b, value: O, activeId: c } = u.getState();
|
|
179
|
-
if (!s.setValueOnMove && b || Array.isArray(O) || !s.moves || !c) return;
|
|
180
|
-
const p = a.item(c);
|
|
181
|
-
!p || p.disabled || p.value == null || u.setState("value", p.value);
|
|
182
|
-
})
|
|
183
|
-
), se(j(j(j({}, a), w), u), {
|
|
184
|
-
combobox: n,
|
|
185
|
-
setValue: (s) => u.setState("value", s),
|
|
186
|
-
setLabelElement: (s) => u.setState("labelElement", s),
|
|
187
|
-
setSelectElement: (s) => u.setState("selectElement", s),
|
|
188
|
-
setListElement: (s) => u.setState("listElement", s)
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
function xo(t) {
|
|
192
|
-
const o = at();
|
|
193
|
-
return t = R(C({}, t), {
|
|
194
|
-
combobox: t.combobox !== void 0 ? t.combobox : o
|
|
195
|
-
}), et(t);
|
|
196
|
-
}
|
|
197
|
-
function yo(t, o, n) {
|
|
198
|
-
return Ie(o, [n.combobox]), ve(t, n, "value", "setValue"), ve(t, n, "setValueOnMove"), Object.assign(
|
|
199
|
-
Ye(
|
|
200
|
-
tt(t, o, n),
|
|
201
|
-
o,
|
|
202
|
-
n
|
|
203
|
-
),
|
|
204
|
-
{ combobox: n.combobox }
|
|
205
|
-
);
|
|
206
|
-
}
|
|
207
|
-
function Oo(t = {}) {
|
|
208
|
-
t = xo(t);
|
|
209
|
-
const [o, n] = st(Co, t);
|
|
210
|
-
return yo(o, n, t);
|
|
211
|
-
}
|
|
212
|
-
var wo = "span", Po = Z(
|
|
213
|
-
function(o) {
|
|
214
|
-
var n = o, { store: e } = n, r = ee(n, ["store"]);
|
|
215
|
-
const i = mt();
|
|
216
|
-
return e = e || i, r = gt(C({ store: e }, r)), r;
|
|
217
|
-
}
|
|
218
|
-
), Eo = te(function(o) {
|
|
219
|
-
const n = Po(o);
|
|
220
|
-
return oe(wo, n);
|
|
221
|
-
}), Vo = "button";
|
|
222
|
-
function Io(t) {
|
|
223
|
-
return Array.from(t.selectedOptions).map((o) => o.value);
|
|
224
|
-
}
|
|
225
|
-
function ge(t, o) {
|
|
226
|
-
return () => {
|
|
227
|
-
const n = o();
|
|
228
|
-
if (!n) return;
|
|
229
|
-
let e = 0, r = t.item(n);
|
|
230
|
-
const i = r;
|
|
231
|
-
for (; r && r.value == null; ) {
|
|
232
|
-
const a = o(++e);
|
|
233
|
-
if (!a) return;
|
|
234
|
-
if (r = t.item(a), r === i) break;
|
|
235
|
-
}
|
|
236
|
-
return r == null ? void 0 : r.id;
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
var _o = Z(function(o) {
|
|
240
|
-
var n = o, {
|
|
241
|
-
store: e,
|
|
242
|
-
name: r,
|
|
243
|
-
form: i,
|
|
244
|
-
required: a,
|
|
245
|
-
showOnKeyDown: w = !0,
|
|
246
|
-
moveOnKeyDown: I = !0,
|
|
247
|
-
toggleOnPress: v = !0,
|
|
248
|
-
toggleOnClick: u = v
|
|
249
|
-
} = n, s = ee(n, [
|
|
250
|
-
"store",
|
|
251
|
-
"name",
|
|
252
|
-
"form",
|
|
253
|
-
"required",
|
|
254
|
-
"showOnKeyDown",
|
|
255
|
-
"moveOnKeyDown",
|
|
256
|
-
"toggleOnPress",
|
|
257
|
-
"toggleOnClick"
|
|
258
|
-
]);
|
|
259
|
-
const b = _e();
|
|
260
|
-
e = e || b, ce(
|
|
261
|
-
e,
|
|
262
|
-
process.env.NODE_ENV !== "production" && "Select must receive a `store` prop or be wrapped in a SelectProvider component."
|
|
263
|
-
);
|
|
264
|
-
const O = s.onKeyDown, c = T(w), p = T(I), P = e.useState("placement").split("-")[0], h = e.useState("value"), M = Array.isArray(h), x = G((f) => {
|
|
265
|
-
var S;
|
|
266
|
-
if (O == null || O(f), f.defaultPrevented || !e) return;
|
|
267
|
-
const { orientation: q, items: W, activeId: X } = e.getState(), de = q !== "horizontal", ae = q !== "vertical", k = !!((S = W.find((he) => !he.disabled && he.value != null)) != null && S.rowId), fe = {
|
|
268
|
-
ArrowUp: (k || de) && ge(e, e.up),
|
|
269
|
-
ArrowRight: (k || ae) && ge(e, e.next),
|
|
270
|
-
ArrowDown: (k || de) && ge(e, e.down),
|
|
271
|
-
ArrowLeft: (k || ae) && ge(e, e.previous)
|
|
272
|
-
}[f.key];
|
|
273
|
-
fe && p(f) && (f.preventDefault(), e.move(fe()));
|
|
274
|
-
const be = P === "top" || P === "bottom";
|
|
275
|
-
({
|
|
276
|
-
ArrowDown: be,
|
|
277
|
-
ArrowUp: be,
|
|
278
|
-
ArrowLeft: P === "left",
|
|
279
|
-
ArrowRight: P === "right"
|
|
280
|
-
})[f.key] && c(f) && (f.preventDefault(), e.move(X), qe(f.currentTarget, "keyup", e.show));
|
|
281
|
-
});
|
|
282
|
-
s = pe(
|
|
283
|
-
s,
|
|
284
|
-
(f) => /* @__PURE__ */ V(ft, { value: e, children: f }),
|
|
285
|
-
[e]
|
|
286
|
-
);
|
|
287
|
-
const [U, A] = ie(!1), E = ne(!1);
|
|
288
|
-
le(() => {
|
|
289
|
-
const f = E.current;
|
|
290
|
-
E.current = !1, !f && A(!1);
|
|
291
|
-
}, [h]);
|
|
292
|
-
const B = e.useState((f) => {
|
|
293
|
-
var S;
|
|
294
|
-
return (S = f.labelElement) == null ? void 0 : S.id;
|
|
295
|
-
}), d = s["aria-label"], g = s["aria-labelledby"] || B, H = e.useState((f) => {
|
|
296
|
-
if (r)
|
|
297
|
-
return f.items;
|
|
298
|
-
}), $ = Se(() => [...new Set(H == null ? void 0 : H.map((f) => f.value).filter((f) => f != null))], [H]);
|
|
299
|
-
s = pe(
|
|
300
|
-
s,
|
|
301
|
-
(f) => r ? /* @__PURE__ */ re(Te, { children: [
|
|
302
|
-
/* @__PURE__ */ re(
|
|
303
|
-
"select",
|
|
304
|
-
{
|
|
305
|
-
style: {
|
|
306
|
-
border: 0,
|
|
307
|
-
clip: "rect(0 0 0 0)",
|
|
308
|
-
height: "1px",
|
|
309
|
-
margin: "-1px",
|
|
310
|
-
overflow: "hidden",
|
|
311
|
-
padding: 0,
|
|
312
|
-
position: "absolute",
|
|
313
|
-
whiteSpace: "nowrap",
|
|
314
|
-
width: "1px"
|
|
315
|
-
},
|
|
316
|
-
tabIndex: -1,
|
|
317
|
-
"aria-hidden": !0,
|
|
318
|
-
"aria-label": d,
|
|
319
|
-
"aria-labelledby": g,
|
|
320
|
-
name: r,
|
|
321
|
-
form: i,
|
|
322
|
-
required: a,
|
|
323
|
-
disabled: s.disabled,
|
|
324
|
-
value: h,
|
|
325
|
-
multiple: M,
|
|
326
|
-
onFocus: () => {
|
|
327
|
-
var S;
|
|
328
|
-
return (S = e == null ? void 0 : e.getState().selectElement) == null ? void 0 : S.focus();
|
|
329
|
-
},
|
|
330
|
-
onChange: (S) => {
|
|
331
|
-
E.current = !0, A(!0), e == null || e.setValue(
|
|
332
|
-
M ? Io(S.target) : S.target.value
|
|
333
|
-
);
|
|
334
|
-
},
|
|
335
|
-
children: [
|
|
336
|
-
dt(h).map((S) => S == null || $.includes(S) ? null : /* @__PURE__ */ V("option", { value: S, children: S }, S)),
|
|
337
|
-
$.map((S) => /* @__PURE__ */ V("option", { value: S, children: S }, S))
|
|
338
|
-
]
|
|
339
|
-
}
|
|
340
|
-
),
|
|
341
|
-
f
|
|
342
|
-
] }) : f,
|
|
343
|
-
[
|
|
344
|
-
e,
|
|
345
|
-
d,
|
|
346
|
-
g,
|
|
347
|
-
r,
|
|
348
|
-
i,
|
|
349
|
-
a,
|
|
350
|
-
h,
|
|
351
|
-
M,
|
|
352
|
-
$,
|
|
353
|
-
s.disabled
|
|
354
|
-
]
|
|
355
|
-
);
|
|
356
|
-
const m = /* @__PURE__ */ re(Te, { children: [
|
|
357
|
-
h,
|
|
358
|
-
/* @__PURE__ */ V(Eo, {})
|
|
359
|
-
] }), _ = e.useState("contentElement");
|
|
360
|
-
return s = R(C({
|
|
361
|
-
role: "combobox",
|
|
362
|
-
"aria-autocomplete": "none",
|
|
363
|
-
"aria-labelledby": B,
|
|
364
|
-
"aria-haspopup": We(_, "listbox"),
|
|
365
|
-
"data-autofill": U || void 0,
|
|
366
|
-
"data-name": r,
|
|
367
|
-
children: m
|
|
368
|
-
}, s), {
|
|
369
|
-
ref: Ce(e.setSelectElement, s.ref),
|
|
370
|
-
onKeyDown: x
|
|
371
|
-
}), s = vo(C({ store: e, toggleOnClick: u }, s)), s = vt(C({ store: e }, s)), s;
|
|
372
|
-
}), Ao = te(function(o) {
|
|
373
|
-
const n = _o(o);
|
|
374
|
-
return oe(Vo, n);
|
|
375
|
-
});
|
|
376
|
-
function ko(t = {}) {
|
|
377
|
-
const o = Oo(t);
|
|
378
|
-
return /* @__PURE__ */ V(uo, { value: o, children: t.children });
|
|
379
|
-
}
|
|
380
|
-
var Do = "div";
|
|
381
|
-
function Lo(t, o) {
|
|
382
|
-
if (o != null)
|
|
383
|
-
return t == null ? !1 : Array.isArray(t) ? t.includes(o) : t === o;
|
|
384
|
-
}
|
|
385
|
-
var Ko = Z(
|
|
386
|
-
function(o) {
|
|
387
|
-
var n = o, {
|
|
388
|
-
store: e,
|
|
389
|
-
value: r,
|
|
390
|
-
getItem: i,
|
|
391
|
-
hideOnClick: a,
|
|
392
|
-
setValueOnClick: w = r != null,
|
|
393
|
-
preventScrollOnKeyDown: I = !0,
|
|
394
|
-
focusOnHover: v = !0
|
|
395
|
-
} = n, u = ee(n, [
|
|
396
|
-
"store",
|
|
397
|
-
"value",
|
|
398
|
-
"getItem",
|
|
399
|
-
"hideOnClick",
|
|
400
|
-
"setValueOnClick",
|
|
401
|
-
"preventScrollOnKeyDown",
|
|
402
|
-
"focusOnHover"
|
|
403
|
-
]), s;
|
|
404
|
-
const b = co();
|
|
405
|
-
e = e || b, ce(
|
|
406
|
-
e,
|
|
407
|
-
process.env.NODE_ENV !== "production" && "SelectItem must be wrapped in a SelectList or SelectPopover component."
|
|
408
|
-
);
|
|
409
|
-
const O = xe(u.id), c = Bt(u), { listElement: p, multiSelectable: L, selected: P, autoFocus: h } = it(e, {
|
|
410
|
-
listElement: "listElement",
|
|
411
|
-
multiSelectable(d) {
|
|
412
|
-
return Array.isArray(d.value);
|
|
413
|
-
},
|
|
414
|
-
selected(d) {
|
|
415
|
-
return Lo(d.value, r);
|
|
416
|
-
},
|
|
417
|
-
autoFocus(d) {
|
|
418
|
-
return r == null || d.value == null || d.activeId !== O && (e != null && e.item(d.activeId)) ? !1 : Array.isArray(d.value) ? d.value[d.value.length - 1] === r : d.value === r;
|
|
419
|
-
}
|
|
420
|
-
}), M = $e(
|
|
421
|
-
(d) => {
|
|
422
|
-
const g = R(C({}, d), {
|
|
423
|
-
value: c ? void 0 : r,
|
|
424
|
-
children: r
|
|
425
|
-
});
|
|
426
|
-
return i ? i(g) : g;
|
|
427
|
-
},
|
|
428
|
-
[c, r, i]
|
|
429
|
-
);
|
|
430
|
-
a = a ?? (r != null && !L);
|
|
431
|
-
const x = u.onClick, U = T(w), A = T(a), E = G((d) => {
|
|
432
|
-
x == null || x(d), !d.defaultPrevented && (Ge(d) || Qe(d) || (U(d) && r != null && (e == null || e.setValue((g) => Array.isArray(g) ? g.includes(r) ? g.filter((H) => H !== r) : [...g, r] : r)), A(d) && (e == null || e.hide())));
|
|
433
|
-
});
|
|
434
|
-
u = pe(
|
|
435
|
-
u,
|
|
436
|
-
(d) => /* @__PURE__ */ V(mo.Provider, { value: P ?? !1, children: d }),
|
|
437
|
-
[P]
|
|
438
|
-
), u = R(C({
|
|
439
|
-
id: O,
|
|
440
|
-
role: Ht(p),
|
|
441
|
-
"aria-selected": P,
|
|
442
|
-
children: r
|
|
443
|
-
}, u), {
|
|
444
|
-
autoFocus: (s = u.autoFocus) != null ? s : h,
|
|
445
|
-
onClick: E
|
|
446
|
-
}), u = ht(C({
|
|
447
|
-
store: e,
|
|
448
|
-
getItem: M,
|
|
449
|
-
preventScrollOnKeyDown: I
|
|
450
|
-
}, u));
|
|
451
|
-
const B = T(v);
|
|
452
|
-
return u = St(R(C({
|
|
453
|
-
store: e
|
|
454
|
-
}, u), {
|
|
455
|
-
// We have to disable focusOnHover when the popup is closed, otherwise
|
|
456
|
-
// the active item will change to null (the container) when the popup is
|
|
457
|
-
// closed by clicking on an item.
|
|
458
|
-
focusOnHover(d) {
|
|
459
|
-
if (!B(d)) return !1;
|
|
460
|
-
const g = e == null ? void 0 : e.getState();
|
|
461
|
-
return !!(g != null && g.open);
|
|
462
|
-
}
|
|
463
|
-
})), u;
|
|
464
|
-
}
|
|
465
|
-
), No = ze(
|
|
466
|
-
te(function(o) {
|
|
467
|
-
const n = Ko(o);
|
|
468
|
-
return oe(Do, n);
|
|
469
|
-
})
|
|
470
|
-
), To = "div", Fe = Ve(null), Ct = Z(
|
|
471
|
-
function(o) {
|
|
472
|
-
var n = o, {
|
|
473
|
-
store: e,
|
|
474
|
-
resetOnEscape: r = !0,
|
|
475
|
-
hideOnEnter: i = !0,
|
|
476
|
-
focusOnMove: a = !0,
|
|
477
|
-
composite: w,
|
|
478
|
-
alwaysVisible: I
|
|
479
|
-
} = n, v = ee(n, [
|
|
480
|
-
"store",
|
|
481
|
-
"resetOnEscape",
|
|
482
|
-
"hideOnEnter",
|
|
483
|
-
"focusOnMove",
|
|
484
|
-
"composite",
|
|
485
|
-
"alwaysVisible"
|
|
486
|
-
]);
|
|
487
|
-
const u = mt();
|
|
488
|
-
e = e || u, ce(
|
|
489
|
-
e,
|
|
490
|
-
process.env.NODE_ENV !== "production" && "SelectList must receive a `store` prop or be wrapped in a SelectProvider component."
|
|
491
|
-
);
|
|
492
|
-
const s = xe(v.id), b = e.useState("value"), O = Array.isArray(b), [c, p] = ie(b), L = e.useState("mounted");
|
|
493
|
-
le(() => {
|
|
494
|
-
L || p(b);
|
|
495
|
-
}, [L, b]), r = r && !O;
|
|
496
|
-
const P = v.onKeyDown, h = T(r), M = T(i), x = G((k) => {
|
|
497
|
-
P == null || P(k), !k.defaultPrevented && (k.key === "Escape" && h(k) && (e == null || e.setValue(c)), (k.key === " " || k.key === "Enter") && $t(k) && M(k) && (k.preventDefault(), e == null || e.hide()));
|
|
498
|
-
}), U = we(Re), A = ie(), [E, B] = U || A, d = Se(
|
|
499
|
-
() => [E, B],
|
|
500
|
-
[E]
|
|
501
|
-
), [g, H] = ie(null), $ = we(Fe);
|
|
502
|
-
le(() => {
|
|
503
|
-
if ($)
|
|
504
|
-
return $(e), () => $(null);
|
|
505
|
-
}, [$, e]), v = pe(
|
|
506
|
-
v,
|
|
507
|
-
(k) => /* @__PURE__ */ V(ft, { value: e, children: /* @__PURE__ */ V(Fe.Provider, { value: H, children: /* @__PURE__ */ V(Re.Provider, { value: d, children: k }) }) }),
|
|
508
|
-
[e, d]
|
|
509
|
-
);
|
|
510
|
-
const m = !!e.combobox;
|
|
511
|
-
w = w ?? (!m && g !== e);
|
|
512
|
-
const [_, f] = Ut(
|
|
513
|
-
w ? e.setListElement : null
|
|
514
|
-
), S = Je(_, "role", v.role), W = (w || (S === "listbox" || S === "menu" || S === "tree" || S === "grid")) && O || void 0, X = pt(L, v.hidden, I), de = X ? R(C({}, v.style), { display: "none" }) : v.style;
|
|
515
|
-
w && (v = C({
|
|
516
|
-
role: "listbox",
|
|
517
|
-
"aria-multiselectable": W
|
|
518
|
-
}, v));
|
|
519
|
-
const ae = e.useState(
|
|
520
|
-
(k) => {
|
|
521
|
-
var me;
|
|
522
|
-
return E || ((me = k.labelElement) == null ? void 0 : me.id);
|
|
523
|
-
}
|
|
524
|
-
);
|
|
525
|
-
return v = R(C({
|
|
526
|
-
id: s,
|
|
527
|
-
"aria-labelledby": ae,
|
|
528
|
-
hidden: X
|
|
529
|
-
}, v), {
|
|
530
|
-
ref: Ce(f, v.ref),
|
|
531
|
-
style: de,
|
|
532
|
-
onKeyDown: x
|
|
533
|
-
}), v = bt(R(C({ store: e }, v), { composite: w })), v = vt(C({ store: e, typeahead: !m }, v)), v;
|
|
534
|
-
}
|
|
535
|
-
), Mo = te(function(o) {
|
|
536
|
-
const n = Ct(o);
|
|
537
|
-
return oe(To, n);
|
|
538
|
-
}), Ro = "div", Fo = Z(
|
|
539
|
-
function(o) {
|
|
540
|
-
var n = o, { store: e, alwaysVisible: r } = n, i = ee(n, ["store", "alwaysVisible"]);
|
|
541
|
-
const a = _e();
|
|
542
|
-
return e = e || a, i = Ct(C({ store: e, alwaysVisible: r }, i)), i = So(C({ store: e, alwaysVisible: r }, i)), i;
|
|
543
|
-
}
|
|
544
|
-
), Bo = bo(
|
|
545
|
-
te(function(o) {
|
|
546
|
-
const n = Fo(o);
|
|
547
|
-
return oe(Ro, n);
|
|
548
|
-
}),
|
|
549
|
-
_e
|
|
550
|
-
);
|
|
551
|
-
Ve(null);
|
|
552
|
-
Ve(
|
|
553
|
-
null
|
|
554
|
-
);
|
|
555
|
-
var Ho = jt(
|
|
556
|
-
[Ft],
|
|
557
|
-
[Rt]
|
|
558
|
-
), $o = Ho.useContext, Uo = Wt() && zt();
|
|
559
|
-
function jo(t = {}) {
|
|
560
|
-
var o = t, {
|
|
561
|
-
tag: n
|
|
562
|
-
} = o, e = je(o, [
|
|
563
|
-
"tag"
|
|
564
|
-
]);
|
|
565
|
-
const r = ot(e.store, no(n, ["value", "rtl"]));
|
|
566
|
-
nt(e, r);
|
|
567
|
-
const i = n == null ? void 0 : n.getState(), a = r == null ? void 0 : r.getState(), w = D(
|
|
568
|
-
e.activeId,
|
|
569
|
-
a == null ? void 0 : a.activeId,
|
|
570
|
-
e.defaultActiveId,
|
|
571
|
-
null
|
|
572
|
-
), I = Ze(se(j({}, e), {
|
|
573
|
-
activeId: w,
|
|
574
|
-
includesBaseElement: D(
|
|
575
|
-
e.includesBaseElement,
|
|
576
|
-
a == null ? void 0 : a.includesBaseElement,
|
|
577
|
-
!0
|
|
578
|
-
),
|
|
579
|
-
orientation: D(
|
|
580
|
-
e.orientation,
|
|
581
|
-
a == null ? void 0 : a.orientation,
|
|
582
|
-
"vertical"
|
|
583
|
-
),
|
|
584
|
-
focusLoop: D(e.focusLoop, a == null ? void 0 : a.focusLoop, !0),
|
|
585
|
-
focusWrap: D(e.focusWrap, a == null ? void 0 : a.focusWrap, !0),
|
|
586
|
-
virtualFocus: D(
|
|
587
|
-
e.virtualFocus,
|
|
588
|
-
a == null ? void 0 : a.virtualFocus,
|
|
589
|
-
!0
|
|
590
|
-
)
|
|
591
|
-
})), v = Xe(se(j({}, e), {
|
|
592
|
-
placement: D(
|
|
593
|
-
e.placement,
|
|
594
|
-
a == null ? void 0 : a.placement,
|
|
595
|
-
"bottom-start"
|
|
596
|
-
)
|
|
597
|
-
})), u = D(
|
|
598
|
-
e.value,
|
|
599
|
-
a == null ? void 0 : a.value,
|
|
600
|
-
e.defaultValue,
|
|
601
|
-
""
|
|
602
|
-
), s = D(
|
|
603
|
-
e.selectedValue,
|
|
604
|
-
a == null ? void 0 : a.selectedValue,
|
|
605
|
-
i == null ? void 0 : i.values,
|
|
606
|
-
e.defaultSelectedValue,
|
|
607
|
-
""
|
|
608
|
-
), b = Array.isArray(s), O = se(j(j({}, I.getState()), v.getState()), {
|
|
609
|
-
value: u,
|
|
610
|
-
selectedValue: s,
|
|
611
|
-
resetValueOnSelect: D(
|
|
612
|
-
e.resetValueOnSelect,
|
|
613
|
-
a == null ? void 0 : a.resetValueOnSelect,
|
|
614
|
-
b
|
|
615
|
-
),
|
|
616
|
-
resetValueOnHide: D(
|
|
617
|
-
e.resetValueOnHide,
|
|
618
|
-
a == null ? void 0 : a.resetValueOnHide,
|
|
619
|
-
b && !n
|
|
620
|
-
),
|
|
621
|
-
activeValue: a == null ? void 0 : a.activeValue
|
|
622
|
-
}), c = rt(O, I, v, r);
|
|
623
|
-
return Uo && Q(
|
|
624
|
-
c,
|
|
625
|
-
() => J(c, ["virtualFocus"], () => {
|
|
626
|
-
c.setState("virtualFocus", !1);
|
|
627
|
-
})
|
|
628
|
-
), Q(c, () => {
|
|
629
|
-
if (n)
|
|
630
|
-
return qt(
|
|
631
|
-
J(c, ["selectedValue"], (p) => {
|
|
632
|
-
Array.isArray(p.selectedValue) && n.setValues(p.selectedValue);
|
|
633
|
-
}),
|
|
634
|
-
J(n, ["values"], (p) => {
|
|
635
|
-
c.setState("selectedValue", p.values);
|
|
636
|
-
})
|
|
637
|
-
);
|
|
638
|
-
}), Q(
|
|
639
|
-
c,
|
|
640
|
-
() => J(c, ["resetValueOnHide", "mounted"], (p) => {
|
|
641
|
-
p.resetValueOnHide && (p.mounted || c.setState("value", u));
|
|
642
|
-
})
|
|
643
|
-
), Q(
|
|
644
|
-
c,
|
|
645
|
-
() => J(c, ["open"], (p) => {
|
|
646
|
-
p.open || (c.setState("activeId", w), c.setState("moves", 0));
|
|
647
|
-
})
|
|
648
|
-
), Q(
|
|
649
|
-
c,
|
|
650
|
-
() => J(c, ["moves", "activeId"], (p, L) => {
|
|
651
|
-
p.moves === L.moves && c.setState("activeValue", void 0);
|
|
652
|
-
})
|
|
653
|
-
), Q(
|
|
654
|
-
c,
|
|
655
|
-
() => lt(c, ["moves", "renderedItems"], (p, L) => {
|
|
656
|
-
if (p.moves === L.moves) return;
|
|
657
|
-
const { activeId: P } = c.getState(), h = I.item(P);
|
|
658
|
-
c.setState("activeValue", h == null ? void 0 : h.value);
|
|
659
|
-
})
|
|
660
|
-
), se(j(j(j({}, v), I), c), {
|
|
661
|
-
tag: n,
|
|
662
|
-
setValue: (p) => c.setState("value", p),
|
|
663
|
-
resetValue: () => c.setState("value", O.value),
|
|
664
|
-
setSelectedValue: (p) => c.setState("selectedValue", p)
|
|
665
|
-
});
|
|
666
|
-
}
|
|
667
|
-
function qo(t) {
|
|
668
|
-
const o = $o();
|
|
669
|
-
return t = R(C({}, t), {
|
|
670
|
-
tag: t.tag !== void 0 ? t.tag : o
|
|
671
|
-
}), et(t);
|
|
672
|
-
}
|
|
673
|
-
function Wo(t, o, n) {
|
|
674
|
-
return Ie(o, [n.tag]), ve(t, n, "value", "setValue"), ve(t, n, "selectedValue", "setSelectedValue"), ve(t, n, "resetValueOnHide"), ve(t, n, "resetValueOnSelect"), Object.assign(
|
|
675
|
-
tt(
|
|
676
|
-
Ye(t, o, n),
|
|
677
|
-
o,
|
|
678
|
-
n
|
|
679
|
-
),
|
|
680
|
-
{ tag: n.tag }
|
|
681
|
-
);
|
|
682
|
-
}
|
|
683
|
-
function zo(t = {}) {
|
|
684
|
-
t = qo(t);
|
|
685
|
-
const [o, n] = st(jo, t);
|
|
686
|
-
return Wo(o, n, t);
|
|
687
|
-
}
|
|
688
|
-
var Go = "input";
|
|
689
|
-
function Be(t, o, n) {
|
|
690
|
-
if (!n) return !1;
|
|
691
|
-
const e = t.find((r) => !r.disabled && r.value);
|
|
692
|
-
return (e == null ? void 0 : e.value) === o;
|
|
693
|
-
}
|
|
694
|
-
function He(t, o) {
|
|
695
|
-
return !o || t == null ? !1 : (t = eo(t), o.length > t.length && o.toLowerCase().indexOf(t.toLowerCase()) === 0);
|
|
696
|
-
}
|
|
697
|
-
function Qo(t) {
|
|
698
|
-
return t.type === "input";
|
|
699
|
-
}
|
|
700
|
-
function Jo(t) {
|
|
701
|
-
return t === "inline" || t === "list" || t === "both" || t === "none";
|
|
702
|
-
}
|
|
703
|
-
function Xo(t) {
|
|
704
|
-
const o = t.find((n) => {
|
|
705
|
-
var e;
|
|
706
|
-
return n.disabled ? !1 : ((e = n.element) == null ? void 0 : e.getAttribute("role")) !== "tab";
|
|
707
|
-
});
|
|
708
|
-
return o == null ? void 0 : o.id;
|
|
709
|
-
}
|
|
710
|
-
var Yo = Z(
|
|
711
|
-
function(o) {
|
|
712
|
-
var n = o, {
|
|
713
|
-
store: e,
|
|
714
|
-
focusable: r = !0,
|
|
715
|
-
autoSelect: i = !1,
|
|
716
|
-
getAutoSelectId: a,
|
|
717
|
-
setValueOnChange: w,
|
|
718
|
-
showMinLength: I = 0,
|
|
719
|
-
showOnChange: v,
|
|
720
|
-
showOnMouseDown: u,
|
|
721
|
-
showOnClick: s = u,
|
|
722
|
-
showOnKeyDown: b,
|
|
723
|
-
showOnKeyPress: O = b,
|
|
724
|
-
blurActiveItemOnClick: c,
|
|
725
|
-
setValueOnClick: p = !0,
|
|
726
|
-
moveOnKeyPress: L = !0,
|
|
727
|
-
autoComplete: P = "list"
|
|
728
|
-
} = n, h = ee(n, [
|
|
729
|
-
"store",
|
|
730
|
-
"focusable",
|
|
731
|
-
"autoSelect",
|
|
732
|
-
"getAutoSelectId",
|
|
733
|
-
"setValueOnChange",
|
|
734
|
-
"showMinLength",
|
|
735
|
-
"showOnChange",
|
|
736
|
-
"showOnMouseDown",
|
|
737
|
-
"showOnClick",
|
|
738
|
-
"showOnKeyDown",
|
|
739
|
-
"showOnKeyPress",
|
|
740
|
-
"blurActiveItemOnClick",
|
|
741
|
-
"setValueOnClick",
|
|
742
|
-
"moveOnKeyPress",
|
|
743
|
-
"autoComplete"
|
|
744
|
-
]);
|
|
745
|
-
const M = at();
|
|
746
|
-
e = e || M, ce(
|
|
747
|
-
e,
|
|
748
|
-
process.env.NODE_ENV !== "production" && "Combobox must receive a `store` prop or be wrapped in a ComboboxProvider component."
|
|
749
|
-
);
|
|
750
|
-
const x = ne(null), [U, A] = Gt(), E = ne(!1), B = ne(!1), d = e.useState(
|
|
751
|
-
(l) => l.virtualFocus && i
|
|
752
|
-
), g = P === "inline" || P === "both", [H, $] = ie(g);
|
|
753
|
-
Qt(() => {
|
|
754
|
-
g && $(!0);
|
|
755
|
-
}, [g]);
|
|
756
|
-
const m = e.useState("value"), _ = ne();
|
|
757
|
-
le(() => J(e, ["selectedValue", "activeId"], (l, y) => {
|
|
758
|
-
_.current = y.selectedValue;
|
|
759
|
-
}), []);
|
|
760
|
-
const f = e.useState((l) => {
|
|
761
|
-
var y;
|
|
762
|
-
if (g && H && !(l.activeValue && Array.isArray(l.selectedValue) && (l.selectedValue.includes(l.activeValue) || (y = _.current) != null && y.includes(l.activeValue))))
|
|
763
|
-
return l.activeValue;
|
|
764
|
-
}), S = e.useState("renderedItems"), q = e.useState("open"), W = e.useState("contentElement"), X = Se(() => {
|
|
765
|
-
if (!g || !H) return m;
|
|
766
|
-
if (Be(
|
|
767
|
-
S,
|
|
768
|
-
f,
|
|
769
|
-
d
|
|
770
|
-
)) {
|
|
771
|
-
if (He(m, f)) {
|
|
772
|
-
const y = (f == null ? void 0 : f.slice(m.length)) || "";
|
|
773
|
-
return m + y;
|
|
774
|
-
}
|
|
775
|
-
return m;
|
|
776
|
-
}
|
|
777
|
-
return f || m;
|
|
778
|
-
}, [g, H, S, f, d, m]);
|
|
779
|
-
le(() => {
|
|
780
|
-
const l = x.current;
|
|
781
|
-
if (!l) return;
|
|
782
|
-
const y = () => $(!0);
|
|
783
|
-
return l.addEventListener("combobox-item-move", y), () => {
|
|
784
|
-
l.removeEventListener("combobox-item-move", y);
|
|
785
|
-
};
|
|
786
|
-
}, []), le(() => {
|
|
787
|
-
if (!g || !H || !f || !Be(
|
|
788
|
-
S,
|
|
789
|
-
f,
|
|
790
|
-
d
|
|
791
|
-
) || !He(m, f)) return;
|
|
792
|
-
let y = Jt;
|
|
793
|
-
return queueMicrotask(() => {
|
|
794
|
-
const K = x.current;
|
|
795
|
-
if (!K) return;
|
|
796
|
-
const { start: N, end: z } = Me(K), Y = m.length, F = f.length;
|
|
797
|
-
Oe(K, Y, F), y = () => {
|
|
798
|
-
if (!Ee(K)) return;
|
|
799
|
-
const { start: ue, end: kt } = Me(K);
|
|
800
|
-
ue === Y && kt === F && Oe(K, N, z);
|
|
801
|
-
};
|
|
802
|
-
}), () => y();
|
|
803
|
-
}, [
|
|
804
|
-
U,
|
|
805
|
-
g,
|
|
806
|
-
H,
|
|
807
|
-
f,
|
|
808
|
-
S,
|
|
809
|
-
d,
|
|
810
|
-
m
|
|
811
|
-
]);
|
|
812
|
-
const de = ne(null), ae = G(a), k = ne(null);
|
|
813
|
-
le(() => {
|
|
814
|
-
if (!q || !W) return;
|
|
815
|
-
const l = Xt(W);
|
|
816
|
-
if (!l) return;
|
|
817
|
-
de.current = l;
|
|
818
|
-
const y = () => {
|
|
819
|
-
E.current = !1;
|
|
820
|
-
}, K = () => {
|
|
821
|
-
if (!e || !E.current) return;
|
|
822
|
-
const { activeId: z } = e.getState();
|
|
823
|
-
z !== null && z !== k.current && (E.current = !1);
|
|
824
|
-
}, N = { passive: !0, capture: !0 };
|
|
825
|
-
return l.addEventListener("wheel", y, N), l.addEventListener("touchmove", y, N), l.addEventListener("scroll", K, N), () => {
|
|
826
|
-
l.removeEventListener("wheel", y, !0), l.removeEventListener("touchmove", y, !0), l.removeEventListener("scroll", K, !0);
|
|
827
|
-
};
|
|
828
|
-
}, [q, W, e]), Pe(() => {
|
|
829
|
-
m && (B.current || (E.current = !0));
|
|
830
|
-
}, [m]), Pe(() => {
|
|
831
|
-
d !== "always" && q || (E.current = q);
|
|
832
|
-
}, [d, q]);
|
|
833
|
-
const me = e.useState("resetValueOnSelect");
|
|
834
|
-
Ie(() => {
|
|
835
|
-
var l, y;
|
|
836
|
-
const K = E.current;
|
|
837
|
-
if (!e || !q || !K && !me) return;
|
|
838
|
-
const { baseElement: N, contentElement: z, activeId: Y } = e.getState();
|
|
839
|
-
if (!(N && !Ee(N))) {
|
|
840
|
-
if (z != null && z.hasAttribute("data-placing")) {
|
|
841
|
-
const F = new MutationObserver(A);
|
|
842
|
-
return F.observe(z, { attributeFilter: ["data-placing"] }), () => F.disconnect();
|
|
843
|
-
}
|
|
844
|
-
if (d && K) {
|
|
845
|
-
const F = ae(S), ue = F !== void 0 ? F : (l = Xo(S)) != null ? l : e.first();
|
|
846
|
-
k.current = ue, e.move(ue ?? null);
|
|
847
|
-
} else {
|
|
848
|
-
const F = (y = e.item(Y || e.first())) == null ? void 0 : y.element;
|
|
849
|
-
F && "scrollIntoView" in F && F.scrollIntoView({ block: "nearest", inline: "nearest" });
|
|
850
|
-
}
|
|
851
|
-
}
|
|
852
|
-
}, [
|
|
853
|
-
e,
|
|
854
|
-
q,
|
|
855
|
-
U,
|
|
856
|
-
m,
|
|
857
|
-
d,
|
|
858
|
-
me,
|
|
859
|
-
ae,
|
|
860
|
-
S
|
|
861
|
-
]), le(() => {
|
|
862
|
-
if (!g) return;
|
|
863
|
-
const l = x.current;
|
|
864
|
-
if (!l) return;
|
|
865
|
-
const y = [l, W].filter(
|
|
866
|
-
(N) => !!N
|
|
867
|
-
), K = (N) => {
|
|
868
|
-
y.every((z) => Zt(N, z)) && (e == null || e.setValue(X));
|
|
869
|
-
};
|
|
870
|
-
for (const N of y)
|
|
871
|
-
N.addEventListener("focusout", K);
|
|
872
|
-
return () => {
|
|
873
|
-
for (const N of y)
|
|
874
|
-
N.removeEventListener("focusout", K);
|
|
875
|
-
};
|
|
876
|
-
}, [g, W, e, X]);
|
|
877
|
-
const fe = (l) => l.currentTarget.value.length >= I, be = h.onChange, Ae = T(v ?? fe), ke = T(
|
|
878
|
-
// If the combobox is combined with tags, the value will be set by the tag
|
|
879
|
-
// input component.
|
|
880
|
-
w ?? !e.tag
|
|
881
|
-
), De = G((l) => {
|
|
882
|
-
if (be == null || be(l), l.defaultPrevented || !e) return;
|
|
883
|
-
const y = l.currentTarget, { value: K, selectionStart: N, selectionEnd: z } = y, Y = l.nativeEvent;
|
|
884
|
-
if (E.current = !0, Qo(Y) && (Y.isComposing && (E.current = !1, B.current = !0), g)) {
|
|
885
|
-
const F = Y.inputType === "insertText" || Y.inputType === "insertCompositionText", ue = N === K.length;
|
|
886
|
-
$(F && ue);
|
|
887
|
-
}
|
|
888
|
-
if (ke(l)) {
|
|
889
|
-
const F = K === e.getState().value;
|
|
890
|
-
e.setValue(K), queueMicrotask(() => {
|
|
891
|
-
Oe(y, N, z);
|
|
892
|
-
}), g && d && F && A();
|
|
893
|
-
}
|
|
894
|
-
Ae(l) && e.show(), (!d || !E.current) && e.setActiveId(null);
|
|
895
|
-
}), ye = h.onCompositionEnd, he = G((l) => {
|
|
896
|
-
E.current = !0, B.current = !1, ye == null || ye(l), !l.defaultPrevented && d && A();
|
|
897
|
-
}), Le = h.onMouseDown, xt = T(
|
|
898
|
-
c ?? (() => !!(e != null && e.getState().includesBaseElement))
|
|
899
|
-
), yt = T(p), Ot = T(s ?? fe), wt = G((l) => {
|
|
900
|
-
Le == null || Le(l), !l.defaultPrevented && (l.button || l.ctrlKey || e && (xt(l) && e.setActiveId(null), yt(l) && e.setValue(X), Ot(l) && qe(l.currentTarget, "mouseup", e.show)));
|
|
901
|
-
}), Ke = h.onKeyDown, Pt = T(O ?? fe), Et = G((l) => {
|
|
902
|
-
if (Ke == null || Ke(l), l.repeat || (E.current = !1), l.defaultPrevented || l.ctrlKey || l.altKey || l.shiftKey || l.metaKey || !e) return;
|
|
903
|
-
const { open: y } = e.getState();
|
|
904
|
-
y || (l.key === "ArrowUp" || l.key === "ArrowDown") && Pt(l) && (l.preventDefault(), e.show());
|
|
905
|
-
}), Ne = h.onBlur, Vt = G((l) => {
|
|
906
|
-
E.current = !1, Ne == null || Ne(l), l.defaultPrevented;
|
|
907
|
-
}), It = xe(h.id), _t = Jo(P) ? P : void 0, At = e.useState((l) => l.activeId === null);
|
|
908
|
-
return h = R(C({
|
|
909
|
-
id: It,
|
|
910
|
-
role: "combobox",
|
|
911
|
-
"aria-autocomplete": _t,
|
|
912
|
-
"aria-haspopup": We(W, "listbox"),
|
|
913
|
-
"aria-expanded": q,
|
|
914
|
-
"aria-controls": W == null ? void 0 : W.id,
|
|
915
|
-
"data-active-item": At || void 0,
|
|
916
|
-
value: X
|
|
917
|
-
}, h), {
|
|
918
|
-
ref: Ce(x, h.ref),
|
|
919
|
-
onChange: De,
|
|
920
|
-
onCompositionEnd: he,
|
|
921
|
-
onMouseDown: wt,
|
|
922
|
-
onKeyDown: Et,
|
|
923
|
-
onBlur: Vt
|
|
924
|
-
}), h = bt(R(C({
|
|
925
|
-
store: e,
|
|
926
|
-
focusable: r
|
|
927
|
-
}, h), {
|
|
928
|
-
// Enable inline autocomplete when the user moves from the combobox input
|
|
929
|
-
// to an item.
|
|
930
|
-
moveOnKeyPress: (l) => Yt(L, l) ? !1 : (g && $(!0), !0)
|
|
931
|
-
})), h = po(C({ store: e }, h)), C({ autoComplete: "off" }, h);
|
|
932
|
-
}
|
|
933
|
-
), Zo = te(function(o) {
|
|
934
|
-
const n = Yo(o);
|
|
935
|
-
return oe(Go, n);
|
|
936
|
-
});
|
|
937
|
-
function en(t = {}) {
|
|
938
|
-
const o = zo(t);
|
|
939
|
-
return /* @__PURE__ */ V(ro, { value: o, children: t.children });
|
|
940
|
-
}
|
|
941
|
-
var tn = "div";
|
|
942
|
-
function on(t, o) {
|
|
943
|
-
if (o != null)
|
|
944
|
-
return t == null ? !1 : Array.isArray(t) ? t.includes(o) : t === o;
|
|
945
|
-
}
|
|
946
|
-
function nn(t) {
|
|
947
|
-
var o;
|
|
948
|
-
return (o = {
|
|
949
|
-
menu: "menuitem",
|
|
950
|
-
listbox: "option",
|
|
951
|
-
tree: "treeitem"
|
|
952
|
-
}[t]) != null ? o : "option";
|
|
953
|
-
}
|
|
954
|
-
var rn = Z(
|
|
955
|
-
function(o) {
|
|
956
|
-
var n = o, {
|
|
957
|
-
store: e,
|
|
958
|
-
value: r,
|
|
959
|
-
hideOnClick: i,
|
|
960
|
-
setValueOnClick: a,
|
|
961
|
-
selectValueOnClick: w = !0,
|
|
962
|
-
resetValueOnSelect: I,
|
|
963
|
-
focusOnHover: v = !1,
|
|
964
|
-
moveOnKeyPress: u = !0,
|
|
965
|
-
getItem: s
|
|
966
|
-
} = n, b = ee(n, [
|
|
967
|
-
"store",
|
|
968
|
-
"value",
|
|
969
|
-
"hideOnClick",
|
|
970
|
-
"setValueOnClick",
|
|
971
|
-
"selectValueOnClick",
|
|
972
|
-
"resetValueOnSelect",
|
|
973
|
-
"focusOnHover",
|
|
974
|
-
"moveOnKeyPress",
|
|
975
|
-
"getItem"
|
|
976
|
-
]), O;
|
|
977
|
-
const c = ut();
|
|
978
|
-
e = e || c, ce(
|
|
979
|
-
e,
|
|
980
|
-
process.env.NODE_ENV !== "production" && "ComboboxItem must be wrapped in a ComboboxList or ComboboxPopover component."
|
|
981
|
-
);
|
|
982
|
-
const { resetValueOnSelectState: p, multiSelectable: L, selected: P } = it(e, {
|
|
983
|
-
resetValueOnSelectState: "resetValueOnSelect",
|
|
984
|
-
multiSelectable(m) {
|
|
985
|
-
return Array.isArray(m.selectedValue);
|
|
986
|
-
},
|
|
987
|
-
selected(m) {
|
|
988
|
-
return on(m.selectedValue, r);
|
|
989
|
-
}
|
|
990
|
-
}), h = $e(
|
|
991
|
-
(m) => {
|
|
992
|
-
const _ = R(C({}, m), { value: r });
|
|
993
|
-
return s ? s(_) : _;
|
|
994
|
-
},
|
|
995
|
-
[r, s]
|
|
996
|
-
);
|
|
997
|
-
a = a ?? !L, i = i ?? (r != null && !L);
|
|
998
|
-
const M = b.onClick, x = T(a), U = T(w), A = T(
|
|
999
|
-
(O = I ?? p) != null ? O : L
|
|
1000
|
-
), E = T(i), B = G((m) => {
|
|
1001
|
-
M == null || M(m), !m.defaultPrevented && (Ge(m) || Qe(m) || (r != null && (U(m) && (A(m) && (e == null || e.resetValue()), e == null || e.setSelectedValue((_) => Array.isArray(_) ? _.includes(r) ? _.filter((f) => f !== r) : [..._, r] : r)), x(m) && (e == null || e.setValue(r))), E(m) && (e == null || e.hide())));
|
|
1002
|
-
}), d = b.onKeyDown, g = G((m) => {
|
|
1003
|
-
if (d == null || d(m), m.defaultPrevented) return;
|
|
1004
|
-
const _ = e == null ? void 0 : e.getState().baseElement;
|
|
1005
|
-
if (!_ || Ee(_)) return;
|
|
1006
|
-
(m.key.length === 1 || m.key === "Backspace" || m.key === "Delete") && (queueMicrotask(() => _.focus()), to(_) && (e == null || e.setValue(_.value)));
|
|
1007
|
-
});
|
|
1008
|
-
L && P != null && (b = C({
|
|
1009
|
-
"aria-selected": P
|
|
1010
|
-
}, b)), b = pe(
|
|
1011
|
-
b,
|
|
1012
|
-
(m) => /* @__PURE__ */ V(lo.Provider, { value: r, children: /* @__PURE__ */ V(so.Provider, { value: P ?? !1, children: m }) }),
|
|
1013
|
-
[r, P]
|
|
1014
|
-
);
|
|
1015
|
-
const H = we(ct);
|
|
1016
|
-
b = R(C({
|
|
1017
|
-
role: nn(H),
|
|
1018
|
-
children: r
|
|
1019
|
-
}, b), {
|
|
1020
|
-
onClick: B,
|
|
1021
|
-
onKeyDown: g
|
|
1022
|
-
});
|
|
1023
|
-
const $ = T(u);
|
|
1024
|
-
return b = ht(R(C({
|
|
1025
|
-
store: e
|
|
1026
|
-
}, b), {
|
|
1027
|
-
getItem: h,
|
|
1028
|
-
// Dispatch a custom event on the combobox input when moving to an item
|
|
1029
|
-
// with the keyboard so the Combobox component can enable inline
|
|
1030
|
-
// autocompletion.
|
|
1031
|
-
moveOnKeyPress: (m) => {
|
|
1032
|
-
if (!$(m)) return !1;
|
|
1033
|
-
const _ = new Event("combobox-item-move"), f = e == null ? void 0 : e.getState().baseElement;
|
|
1034
|
-
return f == null || f.dispatchEvent(_), !0;
|
|
1035
|
-
}
|
|
1036
|
-
})), b = St(C({ store: e, focusOnHover: v }, b)), b;
|
|
1037
|
-
}
|
|
1038
|
-
), ln = ze(
|
|
1039
|
-
te(function(o) {
|
|
1040
|
-
const n = rn(o);
|
|
1041
|
-
return oe(tn, n);
|
|
1042
|
-
})
|
|
1043
|
-
), sn = "div", an = Z(
|
|
1044
|
-
function(o) {
|
|
1045
|
-
var n = o, { store: e, alwaysVisible: r } = n, i = ee(n, ["store", "alwaysVisible"]);
|
|
1046
|
-
const a = ut(!0), w = io();
|
|
1047
|
-
e = e || w;
|
|
1048
|
-
const I = !!e && e === a;
|
|
1049
|
-
ce(
|
|
1050
|
-
e,
|
|
1051
|
-
process.env.NODE_ENV !== "production" && "ComboboxList must receive a `store` prop or be wrapped in a ComboboxProvider component."
|
|
1052
|
-
);
|
|
1053
|
-
const v = ne(null), u = xe(i.id), s = e.useState("mounted"), b = pt(s, i.hidden, r), O = b ? R(C({}, i.style), { display: "none" }) : i.style, c = e.useState(
|
|
1054
|
-
(A) => Array.isArray(A.selectedValue)
|
|
1055
|
-
), p = Je(v, "role", i.role), P = (p === "listbox" || p === "tree" || p === "grid") && c || void 0, [h, M] = ie(!1), x = e.useState("contentElement");
|
|
1056
|
-
Pe(() => {
|
|
1057
|
-
if (!s) return;
|
|
1058
|
-
const A = v.current;
|
|
1059
|
-
if (!A || x !== A) return;
|
|
1060
|
-
const E = () => {
|
|
1061
|
-
M(!!A.querySelector("[role='listbox']"));
|
|
1062
|
-
}, B = new MutationObserver(E);
|
|
1063
|
-
return B.observe(A, {
|
|
1064
|
-
subtree: !0,
|
|
1065
|
-
childList: !0,
|
|
1066
|
-
attributeFilter: ["role"]
|
|
1067
|
-
}), E(), () => B.disconnect();
|
|
1068
|
-
}, [s, x]), h || (i = C({
|
|
1069
|
-
role: "listbox",
|
|
1070
|
-
"aria-multiselectable": P
|
|
1071
|
-
}, i)), i = pe(
|
|
1072
|
-
i,
|
|
1073
|
-
(A) => /* @__PURE__ */ V(ao, { value: e, children: /* @__PURE__ */ V(ct.Provider, { value: p, children: A }) }),
|
|
1074
|
-
[e, p]
|
|
1075
|
-
);
|
|
1076
|
-
const U = u && (!a || !I) ? e.setContentElement : null;
|
|
1077
|
-
return i = R(C({
|
|
1078
|
-
id: u,
|
|
1079
|
-
hidden: b
|
|
1080
|
-
}, i), {
|
|
1081
|
-
ref: Ce(U, v, i.ref),
|
|
1082
|
-
style: O
|
|
1083
|
-
}), Ue(i);
|
|
1084
|
-
}
|
|
1085
|
-
), un = te(function(o) {
|
|
1086
|
-
const n = an(o);
|
|
1087
|
-
return oe(sn, n);
|
|
1088
|
-
});
|
|
1089
|
-
const qn = ({
|
|
1090
|
-
value: t,
|
|
1091
|
-
onChangeValue: o,
|
|
1092
|
-
options: n,
|
|
1093
|
-
searchable: e = !1,
|
|
1094
|
-
placeholder: r = "Choose an option...",
|
|
1095
|
-
prefix: i,
|
|
1096
|
-
suffix: a,
|
|
1097
|
-
children: w,
|
|
1098
|
-
withIcon: I,
|
|
1099
|
-
...v
|
|
16
|
+
import { normalizeOption as w } from "../../../types/options.js";
|
|
17
|
+
import { s as C } from "../../../MagnifyingGlass.es-CLstwG_v.js";
|
|
18
|
+
import { m as P } from "../../../match-sorter.esm-MNVE8H_6.js";
|
|
19
|
+
/* empty css */
|
|
20
|
+
import { C as V, a as I, b as L, c as g } from "../../../MAXQOH4L-DBaf8WKp.js";
|
|
21
|
+
import { S as j, a as y, b as k, c as z, d as A } from "../../../select-popover-DYAZyLp4.js";
|
|
22
|
+
const ne = ({
|
|
23
|
+
value: r,
|
|
24
|
+
onChangeValue: m,
|
|
25
|
+
options: d,
|
|
26
|
+
searchable: c = !1,
|
|
27
|
+
placeholder: H = "Choose an option...",
|
|
28
|
+
prefix: M,
|
|
29
|
+
suffix: T,
|
|
30
|
+
children: _,
|
|
31
|
+
withIcon: $,
|
|
32
|
+
...h
|
|
1100
33
|
}) => {
|
|
1101
|
-
const [
|
|
1102
|
-
baseSort: (
|
|
34
|
+
const [s, i] = p(!1), [a, u] = p(""), n = (d || []).map(w), f = x(() => P(n, a, {
|
|
35
|
+
baseSort: (e, S) => e.index < S.index ? -1 : 1,
|
|
1103
36
|
keys: ["label", "description"]
|
|
1104
|
-
}), [
|
|
1105
|
-
return /* @__PURE__ */
|
|
1106
|
-
|
|
37
|
+
}), [a]), v = c ? L : z, l = !!!n.find((e) => e.value === r);
|
|
38
|
+
return /* @__PURE__ */ o(
|
|
39
|
+
V,
|
|
1107
40
|
{
|
|
1108
41
|
resetValueOnHide: !0,
|
|
1109
|
-
open:
|
|
1110
|
-
setOpen:
|
|
1111
|
-
setValue: (
|
|
1112
|
-
|
|
1113
|
-
|
|
42
|
+
open: s,
|
|
43
|
+
setOpen: i,
|
|
44
|
+
setValue: (e) => {
|
|
45
|
+
N(() => {
|
|
46
|
+
u(e);
|
|
1114
47
|
});
|
|
1115
48
|
},
|
|
1116
|
-
children: /* @__PURE__ */
|
|
1117
|
-
|
|
49
|
+
children: /* @__PURE__ */ t(
|
|
50
|
+
j,
|
|
1118
51
|
{
|
|
1119
|
-
value:
|
|
1120
|
-
setValue:
|
|
1121
|
-
open:
|
|
1122
|
-
setOpen:
|
|
52
|
+
value: l ? "" : r,
|
|
53
|
+
setValue: m,
|
|
54
|
+
open: s,
|
|
55
|
+
setOpen: i,
|
|
1123
56
|
children: [
|
|
1124
|
-
/* @__PURE__ */
|
|
1125
|
-
|
|
57
|
+
/* @__PURE__ */ o(
|
|
58
|
+
y,
|
|
1126
59
|
{
|
|
1127
|
-
className:
|
|
60
|
+
className: b(
|
|
1128
61
|
"component-select__input",
|
|
1129
|
-
|
|
62
|
+
l && "component-select__input--placeholder"
|
|
1130
63
|
),
|
|
1131
|
-
...
|
|
1132
|
-
children:
|
|
64
|
+
...h,
|
|
65
|
+
children: _
|
|
1133
66
|
}
|
|
1134
67
|
),
|
|
1135
|
-
|
|
1136
|
-
|
|
68
|
+
s && /* @__PURE__ */ o(
|
|
69
|
+
k,
|
|
1137
70
|
{
|
|
1138
71
|
className: "component-select__popover",
|
|
1139
72
|
"data-colour-scheme": "invert",
|
|
@@ -1144,11 +77,11 @@ const qn = ({
|
|
|
1144
77
|
gutter: 8,
|
|
1145
78
|
overflowPadding: 4,
|
|
1146
79
|
shift: -1,
|
|
1147
|
-
children: /* @__PURE__ */
|
|
1148
|
-
|
|
1149
|
-
/* @__PURE__ */
|
|
1150
|
-
/* @__PURE__ */
|
|
1151
|
-
|
|
80
|
+
children: /* @__PURE__ */ t(O, { className: "component-select__popover__scroll", axis: "y", children: [
|
|
81
|
+
c && /* @__PURE__ */ t("div", { className: "component-select__popover__search-wrapper", children: [
|
|
82
|
+
/* @__PURE__ */ o(C, { className: "component-select__popover__search-icon" }),
|
|
83
|
+
/* @__PURE__ */ o(
|
|
84
|
+
I,
|
|
1152
85
|
{
|
|
1153
86
|
autoSelect: !0,
|
|
1154
87
|
placeholder: "Search...",
|
|
@@ -1156,22 +89,22 @@ const qn = ({
|
|
|
1156
89
|
}
|
|
1157
90
|
)
|
|
1158
91
|
] }),
|
|
1159
|
-
/* @__PURE__ */
|
|
1160
|
-
|
|
92
|
+
/* @__PURE__ */ o(v, { className: "component-select__list", children: f.map((e) => /* @__PURE__ */ t(
|
|
93
|
+
A,
|
|
1161
94
|
{
|
|
1162
|
-
disabled:
|
|
1163
|
-
value:
|
|
95
|
+
disabled: e.disabled,
|
|
96
|
+
value: e.value,
|
|
1164
97
|
className: "component-select__option",
|
|
1165
|
-
render: /* @__PURE__ */
|
|
98
|
+
render: /* @__PURE__ */ o(g, {}),
|
|
1166
99
|
children: [
|
|
1167
|
-
/* @__PURE__ */
|
|
1168
|
-
|
|
1169
|
-
|
|
100
|
+
/* @__PURE__ */ t("div", { className: "component-select__option__label", children: [
|
|
101
|
+
e.icon,
|
|
102
|
+
e.label
|
|
1170
103
|
] }),
|
|
1171
|
-
|
|
104
|
+
e.description && /* @__PURE__ */ o("div", { className: "component-select__option__description", children: e.description })
|
|
1172
105
|
]
|
|
1173
106
|
},
|
|
1174
|
-
|
|
107
|
+
e.value
|
|
1175
108
|
)) })
|
|
1176
109
|
] })
|
|
1177
110
|
}
|
|
@@ -1183,5 +116,5 @@ const qn = ({
|
|
|
1183
116
|
);
|
|
1184
117
|
};
|
|
1185
118
|
export {
|
|
1186
|
-
|
|
119
|
+
ne as Select
|
|
1187
120
|
};
|