@wrdagency/blockout 1.0.29 → 1.0.31
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/assets/index2.css +1 -1
- package/dist/assets/index9.css +1 -1
- package/dist/assets/static.css +1 -1
- package/dist/assets/style16.css +1 -1
- package/dist/assets/style20.css +1 -1
- package/dist/assets/style25.css +1 -1
- package/dist/components/controls/select-control/control.js +23 -23
- package/dist/components/controls/select-control/props.d.ts +2 -2
- package/dist/components/controls/select-control/select.js +85 -71
- package/dist/components/controls/tag-control/ariakit-experimental.js +1067 -1081
- package/dist/components/data-view/api.d.ts +2 -2
- package/dist/components/data-view/api.js +14 -17
- package/dist/components/data-view/data/normalize.d.ts +0 -2
- package/dist/components/data-view/data/normalize.js +24 -36
- package/dist/components/data-view/layouts/grid/group.js +3 -2
- package/dist/components/data-view/layouts/kanban/group.js +3 -2
- package/dist/components/data-view/layouts/list/group.js +3 -2
- package/dist/components/data-view/layouts/table/empty.js +3 -2
- package/dist/components/data-view/layouts/table/group.js +3 -2
- package/dist/components/data-view/layouts/table/root.js +3 -2
- package/dist/components/data-view/layouts/tile/group.js +3 -2
- package/dist/components/data-view/parts/controls/index.js +3 -2
- package/dist/components/data-view/parts/controls/search.js +3 -2
- package/dist/components/data-view/parts/footer/actions.js +43 -62
- package/dist/components/data-view/parts/footer/index.js +3 -2
- package/dist/components/data-view/parts/footer/selection.js +3 -2
- package/dist/components/data-view/parts/view-control/index.js +18 -17
- package/dist/components/data-view/root.js +3 -2
- package/dist/components/data-view/slots/item/actions.js +20 -34
- package/dist/components/data-view/types/actions.d.ts +4 -14
- package/dist/components/menu/context.d.ts +7 -0
- package/dist/components/menu/context.js +10 -0
- package/dist/components/menu/index.d.ts +5 -4
- package/dist/components/menu/index.js +19 -17
- package/dist/components/menu/item.d.ts +1 -1
- package/dist/components/menu/items/action.d.ts +1 -1
- package/dist/components/menu/items/action.js +10 -7
- package/dist/components/menu/items/submenu.d.ts +1 -1
- package/dist/components/menu/items/toggle.d.ts +1 -1
- package/dist/components/menu/items/toggle.js +20 -19
- package/dist/components/menu/types.d.ts +9 -9
- package/dist/primitives/popover/root.d.ts +2 -3
- package/dist/{select-popover-Dheunyb0.js → select-popover-CGgkyRb4.js} +227 -210
- package/dist/types/options.d.ts +15 -0
- package/dist/types/options.js +44 -12
- package/package.json +1 -1
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
import { u as Se, a as se, S as be, b as xe, c as Oe, d as Ce, e as de } from "./DG5U6ZEL-DB0iwihy.js";
|
|
2
2
|
import { u as Ie } from "./MTZPJQMC-D2i4-LA_.js";
|
|
3
|
-
import { c as
|
|
4
|
-
import { useMemo as ae, useState as J, useRef as
|
|
3
|
+
import { c as D, _ as G, i as Y, m as I, o as p, r as Ae, f as _, a as V, Y as De, V as q, U as O, W as K, X as _e, j as N, e as le, J as Ve, l as X, n as he, S as ke, s as Le, q as ge, t as Ke, E as Ne, F as Me, R as Re, h as Te, u as Fe, aa as Ge } from "./LMDWO4NN-CpSMaD5G.js";
|
|
4
|
+
import { useMemo as ae, useState as J, useRef as He, useEffect as ne, useCallback as $e, useContext as me, createContext as je } from "react";
|
|
5
5
|
import { jsx as P, jsxs as oe, Fragment as ve } from "react/jsx-runtime";
|
|
6
6
|
import { u as we } from "./T7VMP3TM-C8D6mVva.js";
|
|
7
|
-
import { a as
|
|
7
|
+
import { a as Be } from "./WMYDSCNQ-pGjWB-Pk.js";
|
|
8
8
|
import { t as ye } from "./7PRQYBBV-91wrWGjk.js";
|
|
9
|
-
import { c as
|
|
10
|
-
import { c as
|
|
9
|
+
import { c as Ue, a as qe } from "./O2PQ2652-DIoegIkE.js";
|
|
10
|
+
import { c as We, d as ze, b as Je } from "./4CMBR7SL-DezfZPUS.js";
|
|
11
11
|
import { u as Xe } from "./S43UC3DV-HCi6u_G4.js";
|
|
12
|
-
import { m as Ye, o as Qe, t as Ze, c as et, s as
|
|
13
|
-
import { u as nt } from "./
|
|
14
|
-
import { u as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
12
|
+
import { m as Ye, o as Qe, t as Ze, c as et, s as W, d as re, g as tt, b as ot, f as pe, u as rt } from "./YV4JVR4I-CQnJhUSg.js";
|
|
13
|
+
import { u as nt, a as st } from "./YORGHBM4-D_fOXG5Y.js";
|
|
14
|
+
import { u as lt } from "./UQQRIHDV-DEGlgATx.js";
|
|
15
|
+
import { u as at } from "./6VRAQV3D-BYmT0QTl.js";
|
|
16
|
+
import { i as it } from "./KFH4SEIX-DaQeP5D_.js";
|
|
17
|
+
import { u as ut } from "./5JTVDSTH-CZ7mfyUK.js";
|
|
18
|
+
import { c as ct, u as dt } from "./G7GW6PWC-Dk4hVbAk.js";
|
|
19
|
+
var mt = "span", vt = {
|
|
19
20
|
top: "4,10 8,6 12,10",
|
|
20
21
|
right: "6,4 10,8 6,12",
|
|
21
22
|
bottom: "4,6 8,10 12,6",
|
|
22
23
|
left: "10,4 6,8 10,12"
|
|
23
|
-
}, Pe =
|
|
24
|
-
var
|
|
24
|
+
}, Pe = D(function(t) {
|
|
25
|
+
var o = t, { store: e, placement: r } = o, a = G(o, ["store", "placement"]);
|
|
25
26
|
const m = Ie();
|
|
26
27
|
e = e || m, Y(
|
|
27
28
|
e,
|
|
28
29
|
process.env.NODE_ENV !== "production" && "PopoverDisclosureArrow must be wrapped in a PopoverDisclosure component."
|
|
29
30
|
);
|
|
30
|
-
const E = e.useState((
|
|
31
|
+
const E = e.useState((s) => r || s.placement).split("-")[0], u = vt[E], l = ae(
|
|
31
32
|
() => /* @__PURE__ */ P(
|
|
32
33
|
"svg",
|
|
33
34
|
{
|
|
@@ -55,21 +56,21 @@ var ct = "span", dt = {
|
|
|
55
56
|
pointerEvents: "none"
|
|
56
57
|
}, a.style)
|
|
57
58
|
}), Ae(a);
|
|
58
|
-
}),
|
|
59
|
-
function(
|
|
60
|
-
const
|
|
61
|
-
return
|
|
59
|
+
}), oo = _(
|
|
60
|
+
function(t) {
|
|
61
|
+
const o = Pe(t);
|
|
62
|
+
return V(mt, o);
|
|
62
63
|
}
|
|
63
64
|
);
|
|
64
|
-
function
|
|
65
|
-
var
|
|
66
|
-
combobox:
|
|
67
|
-
} =
|
|
65
|
+
function pt(n = {}) {
|
|
66
|
+
var t = n, {
|
|
67
|
+
combobox: o
|
|
68
|
+
} = t, e = De(t, [
|
|
68
69
|
"combobox"
|
|
69
70
|
]);
|
|
70
|
-
const
|
|
71
|
+
const r = Ye(
|
|
71
72
|
e.store,
|
|
72
|
-
Qe(
|
|
73
|
+
Qe(o, [
|
|
73
74
|
"value",
|
|
74
75
|
"items",
|
|
75
76
|
"renderedItems",
|
|
@@ -81,9 +82,9 @@ function mt(s = {}) {
|
|
|
81
82
|
"disclosureElement"
|
|
82
83
|
])
|
|
83
84
|
);
|
|
84
|
-
Ze(e,
|
|
85
|
-
const a =
|
|
86
|
-
store:
|
|
85
|
+
Ze(e, r);
|
|
86
|
+
const a = r.getState(), m = We(q(K({}, e), {
|
|
87
|
+
store: r,
|
|
87
88
|
virtualFocus: O(
|
|
88
89
|
e.virtualFocus,
|
|
89
90
|
a.virtualFocus,
|
|
@@ -105,14 +106,14 @@ function mt(s = {}) {
|
|
|
105
106
|
a.orientation,
|
|
106
107
|
"vertical"
|
|
107
108
|
)
|
|
108
|
-
})), S =
|
|
109
|
-
store:
|
|
109
|
+
})), S = Ue(q(K({}, e), {
|
|
110
|
+
store: r,
|
|
110
111
|
placement: O(
|
|
111
112
|
e.placement,
|
|
112
113
|
a.placement,
|
|
113
114
|
"bottom-start"
|
|
114
115
|
)
|
|
115
|
-
})), E = new String(""), u =
|
|
116
|
+
})), E = new String(""), u = q(K(K({}, m.getState()), S.getState()), {
|
|
116
117
|
value: O(
|
|
117
118
|
e.value,
|
|
118
119
|
a.value,
|
|
@@ -127,107 +128,107 @@ function mt(s = {}) {
|
|
|
127
128
|
labelElement: O(a.labelElement, null),
|
|
128
129
|
selectElement: O(a.selectElement, null),
|
|
129
130
|
listElement: O(a.listElement, null)
|
|
130
|
-
}), l = et(u, m, S,
|
|
131
|
-
return
|
|
131
|
+
}), l = et(u, m, S, r);
|
|
132
|
+
return W(
|
|
132
133
|
l,
|
|
133
|
-
() => re(l, ["value", "items"], (
|
|
134
|
-
if (
|
|
135
|
-
const f =
|
|
134
|
+
() => re(l, ["value", "items"], (s) => {
|
|
135
|
+
if (s.value !== E || !s.items.length) return;
|
|
136
|
+
const f = s.items.find(
|
|
136
137
|
(b) => !b.disabled && b.value != null
|
|
137
138
|
);
|
|
138
139
|
(f == null ? void 0 : f.value) != null && l.setState("value", f.value);
|
|
139
140
|
})
|
|
140
|
-
),
|
|
141
|
+
), W(
|
|
141
142
|
l,
|
|
142
|
-
() => re(l, ["mounted"], (
|
|
143
|
-
|
|
143
|
+
() => re(l, ["mounted"], (s) => {
|
|
144
|
+
s.mounted || l.setState("activeId", u.activeId);
|
|
144
145
|
})
|
|
145
|
-
),
|
|
146
|
+
), W(
|
|
146
147
|
l,
|
|
147
|
-
() => re(l, ["mounted", "items", "value"], (
|
|
148
|
-
if (
|
|
149
|
-
const f = ye(
|
|
148
|
+
() => re(l, ["mounted", "items", "value"], (s) => {
|
|
149
|
+
if (o || s.mounted) return;
|
|
150
|
+
const f = ye(s.value), b = f[f.length - 1];
|
|
150
151
|
if (b == null) return;
|
|
151
|
-
const w =
|
|
152
|
+
const w = s.items.find(
|
|
152
153
|
(g) => !g.disabled && g.value === b
|
|
153
154
|
);
|
|
154
155
|
w && l.setState("activeId", w.id);
|
|
155
156
|
})
|
|
156
|
-
),
|
|
157
|
+
), W(
|
|
157
158
|
l,
|
|
158
|
-
() => tt(l, ["setValueOnMove", "moves"], (
|
|
159
|
+
() => tt(l, ["setValueOnMove", "moves"], (s) => {
|
|
159
160
|
const { mounted: f, value: b, activeId: w } = l.getState();
|
|
160
|
-
if (!
|
|
161
|
+
if (!s.setValueOnMove && f || Array.isArray(b) || !s.moves || !w) return;
|
|
161
162
|
const g = m.item(w);
|
|
162
163
|
!g || g.disabled || g.value == null || l.setState("value", g.value);
|
|
163
164
|
})
|
|
164
|
-
),
|
|
165
|
-
combobox:
|
|
166
|
-
setValue: (
|
|
167
|
-
setLabelElement: (
|
|
168
|
-
setSelectElement: (
|
|
169
|
-
setListElement: (
|
|
165
|
+
), q(K(K(K({}, m), S), l), {
|
|
166
|
+
combobox: o,
|
|
167
|
+
setValue: (s) => l.setState("value", s),
|
|
168
|
+
setLabelElement: (s) => l.setState("labelElement", s),
|
|
169
|
+
setSelectElement: (s) => l.setState("selectElement", s),
|
|
170
|
+
setListElement: (s) => l.setState("listElement", s)
|
|
170
171
|
});
|
|
171
172
|
}
|
|
172
|
-
function
|
|
173
|
-
const
|
|
174
|
-
return
|
|
175
|
-
combobox:
|
|
176
|
-
}),
|
|
173
|
+
function ft(n) {
|
|
174
|
+
const t = Xe();
|
|
175
|
+
return n = I(p({}, n), {
|
|
176
|
+
combobox: n.combobox !== void 0 ? n.combobox : t
|
|
177
|
+
}), ze(n);
|
|
177
178
|
}
|
|
178
|
-
function
|
|
179
|
-
return _e(
|
|
180
|
-
|
|
181
|
-
Je(
|
|
182
|
-
|
|
183
|
-
|
|
179
|
+
function St(n, t, o) {
|
|
180
|
+
return _e(t, [o.combobox]), pe(n, o, "value", "setValue"), pe(n, o, "setValueOnMove"), Object.assign(
|
|
181
|
+
qe(
|
|
182
|
+
Je(n, t, o),
|
|
183
|
+
t,
|
|
184
|
+
o
|
|
184
185
|
),
|
|
185
|
-
{ combobox:
|
|
186
|
+
{ combobox: o.combobox }
|
|
186
187
|
);
|
|
187
188
|
}
|
|
188
|
-
function
|
|
189
|
-
|
|
190
|
-
const [
|
|
191
|
-
return
|
|
189
|
+
function bt(n = {}) {
|
|
190
|
+
n = ft(n);
|
|
191
|
+
const [t, o] = ot(pt, n);
|
|
192
|
+
return St(t, o, n);
|
|
192
193
|
}
|
|
193
|
-
var
|
|
194
|
-
function(
|
|
195
|
-
var
|
|
194
|
+
var ht = "span", gt = D(
|
|
195
|
+
function(t) {
|
|
196
|
+
var o = t, { store: e } = o, r = G(o, ["store"]);
|
|
196
197
|
const a = Se();
|
|
197
|
-
return e = e || a,
|
|
198
|
+
return e = e || a, r = Pe(p({ store: e }, r)), r;
|
|
198
199
|
}
|
|
199
|
-
),
|
|
200
|
-
const
|
|
201
|
-
return
|
|
202
|
-
}),
|
|
203
|
-
function
|
|
204
|
-
return Array.from(
|
|
200
|
+
), wt = _(function(t) {
|
|
201
|
+
const o = gt(t);
|
|
202
|
+
return V(ht, o);
|
|
203
|
+
}), yt = "button";
|
|
204
|
+
function Pt(n) {
|
|
205
|
+
return Array.from(n.selectedOptions).map((t) => t.value);
|
|
205
206
|
}
|
|
206
|
-
function
|
|
207
|
+
function z(n, t) {
|
|
207
208
|
return () => {
|
|
208
|
-
const
|
|
209
|
-
if (!
|
|
210
|
-
let e = 0,
|
|
211
|
-
const a =
|
|
212
|
-
for (;
|
|
213
|
-
const m =
|
|
209
|
+
const o = t();
|
|
210
|
+
if (!o) return;
|
|
211
|
+
let e = 0, r = n.item(o);
|
|
212
|
+
const a = r;
|
|
213
|
+
for (; r && r.value == null; ) {
|
|
214
|
+
const m = t(++e);
|
|
214
215
|
if (!m) return;
|
|
215
|
-
if (
|
|
216
|
+
if (r = n.item(m), r === a) break;
|
|
216
217
|
}
|
|
217
|
-
return
|
|
218
|
+
return r == null ? void 0 : r.id;
|
|
218
219
|
};
|
|
219
220
|
}
|
|
220
|
-
var
|
|
221
|
-
var
|
|
221
|
+
var Et = D(function(t) {
|
|
222
|
+
var o = t, {
|
|
222
223
|
store: e,
|
|
223
|
-
name:
|
|
224
|
+
name: r,
|
|
224
225
|
form: a,
|
|
225
226
|
required: m,
|
|
226
227
|
showOnKeyDown: S = !0,
|
|
227
228
|
moveOnKeyDown: E = !0,
|
|
228
229
|
toggleOnPress: u = !0,
|
|
229
230
|
toggleOnClick: l = u
|
|
230
|
-
} =
|
|
231
|
+
} = o, s = G(o, [
|
|
231
232
|
"store",
|
|
232
233
|
"name",
|
|
233
234
|
"form",
|
|
@@ -242,14 +243,14 @@ var yt = R(function(o) {
|
|
|
242
243
|
e,
|
|
243
244
|
process.env.NODE_ENV !== "production" && "Select must receive a `store` prop or be wrapped in a SelectProvider component."
|
|
244
245
|
);
|
|
245
|
-
const b =
|
|
246
|
+
const b = s.onKeyDown, w = N(S), g = N(E), y = e.useState("placement").split("-")[0], x = e.useState("value"), k = Array.isArray(x), R = le((c) => {
|
|
246
247
|
var d;
|
|
247
248
|
if (b == null || b(c), c.defaultPrevented || !e) return;
|
|
248
|
-
const { orientation: Z, items: ee, activeId:
|
|
249
|
-
ArrowUp: (v ||
|
|
250
|
-
ArrowRight: (v ||
|
|
251
|
-
ArrowDown: (v ||
|
|
252
|
-
ArrowLeft: (v ||
|
|
249
|
+
const { orientation: Z, items: ee, activeId: j } = e.getState(), B = Z !== "horizontal", U = Z !== "vertical", v = !!((d = ee.find((ce) => !ce.disabled && ce.value != null)) != null && d.rowId), ie = {
|
|
250
|
+
ArrowUp: (v || B) && z(e, e.up),
|
|
251
|
+
ArrowRight: (v || U) && z(e, e.next),
|
|
252
|
+
ArrowDown: (v || B) && z(e, e.down),
|
|
253
|
+
ArrowLeft: (v || U) && z(e, e.previous)
|
|
253
254
|
}[c.key];
|
|
254
255
|
ie && g(c) && (c.preventDefault(), e.move(ie()));
|
|
255
256
|
const ue = y === "top" || y === "bottom";
|
|
@@ -258,28 +259,28 @@ var yt = R(function(o) {
|
|
|
258
259
|
ArrowUp: ue,
|
|
259
260
|
ArrowLeft: y === "left",
|
|
260
261
|
ArrowRight: y === "right"
|
|
261
|
-
})[c.key] && w(c) && (c.preventDefault(), e.move(
|
|
262
|
+
})[c.key] && w(c) && (c.preventDefault(), e.move(j), Ve(c.currentTarget, "keyup", e.show));
|
|
262
263
|
});
|
|
263
|
-
|
|
264
|
-
|
|
264
|
+
s = X(
|
|
265
|
+
s,
|
|
265
266
|
(c) => /* @__PURE__ */ P(be, { value: e, children: c }),
|
|
266
267
|
[e]
|
|
267
268
|
);
|
|
268
|
-
const [
|
|
269
|
+
const [H, T] = J(!1), C = He(!1);
|
|
269
270
|
ne(() => {
|
|
270
271
|
const c = C.current;
|
|
271
|
-
C.current = !1, !c &&
|
|
272
|
+
C.current = !1, !c && T(!1);
|
|
272
273
|
}, [x]);
|
|
273
|
-
const
|
|
274
|
+
const F = e.useState((c) => {
|
|
274
275
|
var d;
|
|
275
276
|
return (d = c.labelElement) == null ? void 0 : d.id;
|
|
276
|
-
}), i =
|
|
277
|
-
if (
|
|
277
|
+
}), i = s["aria-label"], h = s["aria-labelledby"] || F, L = e.useState((c) => {
|
|
278
|
+
if (r)
|
|
278
279
|
return c.items;
|
|
279
|
-
}), A = ae(() => [...new Set(
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
(c) =>
|
|
280
|
+
}), A = ae(() => [...new Set(L == null ? void 0 : L.map((c) => c.value).filter((c) => c != null))], [L]);
|
|
281
|
+
s = X(
|
|
282
|
+
s,
|
|
283
|
+
(c) => r ? /* @__PURE__ */ oe(ve, { children: [
|
|
283
284
|
/* @__PURE__ */ oe(
|
|
284
285
|
"select",
|
|
285
286
|
{
|
|
@@ -298,19 +299,19 @@ var yt = R(function(o) {
|
|
|
298
299
|
"aria-hidden": !0,
|
|
299
300
|
"aria-label": i,
|
|
300
301
|
"aria-labelledby": h,
|
|
301
|
-
name:
|
|
302
|
+
name: r,
|
|
302
303
|
form: a,
|
|
303
304
|
required: m,
|
|
304
|
-
disabled:
|
|
305
|
+
disabled: s.disabled,
|
|
305
306
|
value: x,
|
|
306
|
-
multiple:
|
|
307
|
+
multiple: k,
|
|
307
308
|
onFocus: () => {
|
|
308
309
|
var d;
|
|
309
310
|
return (d = e == null ? void 0 : e.getState().selectElement) == null ? void 0 : d.focus();
|
|
310
311
|
},
|
|
311
312
|
onChange: (d) => {
|
|
312
|
-
C.current = !0,
|
|
313
|
-
|
|
313
|
+
C.current = !0, T(!0), e == null || e.setValue(
|
|
314
|
+
k ? Pt(d.target) : d.target.value
|
|
314
315
|
);
|
|
315
316
|
},
|
|
316
317
|
children: [
|
|
@@ -325,55 +326,69 @@ var yt = R(function(o) {
|
|
|
325
326
|
e,
|
|
326
327
|
i,
|
|
327
328
|
h,
|
|
328
|
-
|
|
329
|
+
r,
|
|
329
330
|
a,
|
|
330
331
|
m,
|
|
331
332
|
x,
|
|
332
|
-
|
|
333
|
+
k,
|
|
333
334
|
A,
|
|
334
|
-
|
|
335
|
+
s.disabled
|
|
335
336
|
]
|
|
336
337
|
);
|
|
337
|
-
const
|
|
338
|
+
const $ = /* @__PURE__ */ oe(ve, { children: [
|
|
338
339
|
x,
|
|
339
|
-
/* @__PURE__ */ P(
|
|
340
|
+
/* @__PURE__ */ P(wt, {})
|
|
340
341
|
] }), Q = e.useState("contentElement");
|
|
341
|
-
return
|
|
342
|
+
return s = I(p({
|
|
342
343
|
role: "combobox",
|
|
343
344
|
"aria-autocomplete": "none",
|
|
344
|
-
"aria-labelledby":
|
|
345
|
+
"aria-labelledby": F,
|
|
345
346
|
"aria-haspopup": ke(Q, "listbox"),
|
|
346
|
-
"data-autofill":
|
|
347
|
-
"data-name":
|
|
348
|
-
children:
|
|
349
|
-
},
|
|
350
|
-
ref: he(e.setSelectElement,
|
|
351
|
-
onKeyDown:
|
|
352
|
-
}),
|
|
353
|
-
}),
|
|
354
|
-
const
|
|
355
|
-
return
|
|
347
|
+
"data-autofill": H || void 0,
|
|
348
|
+
"data-name": r,
|
|
349
|
+
children: $
|
|
350
|
+
}, s), {
|
|
351
|
+
ref: he(e.setSelectElement, s.ref),
|
|
352
|
+
onKeyDown: R
|
|
353
|
+
}), s = Be(p({ store: e, toggleOnClick: l }, s)), s = we(p({ store: e }, s)), s;
|
|
354
|
+
}), ro = _(function(t) {
|
|
355
|
+
const o = Et(t);
|
|
356
|
+
return V(yt, o);
|
|
356
357
|
});
|
|
357
|
-
function
|
|
358
|
-
const
|
|
359
|
-
return /* @__PURE__ */ P(xe, { value:
|
|
358
|
+
function no(n = {}) {
|
|
359
|
+
const t = bt(n);
|
|
360
|
+
return /* @__PURE__ */ P(xe, { value: t, children: n.children });
|
|
360
361
|
}
|
|
361
|
-
var
|
|
362
|
-
function
|
|
363
|
-
|
|
364
|
-
|
|
362
|
+
var xt = "div", Ot = D(
|
|
363
|
+
function(t) {
|
|
364
|
+
return t = nt(t), t;
|
|
365
|
+
}
|
|
366
|
+
), so = _(function(t) {
|
|
367
|
+
const o = Ot(t);
|
|
368
|
+
return V(xt, o);
|
|
369
|
+
}), Ct = "div", It = D(
|
|
370
|
+
function(t) {
|
|
371
|
+
return t = st(t), t;
|
|
372
|
+
}
|
|
373
|
+
), lo = _(function(t) {
|
|
374
|
+
const o = It(t);
|
|
375
|
+
return V(Ct, o);
|
|
376
|
+
}), At = "div";
|
|
377
|
+
function Dt(n, t) {
|
|
378
|
+
if (t != null)
|
|
379
|
+
return n == null ? !1 : Array.isArray(n) ? n.includes(t) : n === t;
|
|
365
380
|
}
|
|
366
|
-
var
|
|
367
|
-
function(
|
|
368
|
-
var
|
|
381
|
+
var _t = D(
|
|
382
|
+
function(t) {
|
|
383
|
+
var o = t, {
|
|
369
384
|
store: e,
|
|
370
|
-
value:
|
|
385
|
+
value: r,
|
|
371
386
|
getItem: a,
|
|
372
387
|
hideOnClick: m,
|
|
373
|
-
setValueOnClick: S =
|
|
388
|
+
setValueOnClick: S = r != null,
|
|
374
389
|
preventScrollOnKeyDown: E = !0,
|
|
375
390
|
focusOnHover: u = !0
|
|
376
|
-
} =
|
|
391
|
+
} = o, l = G(o, [
|
|
377
392
|
"store",
|
|
378
393
|
"value",
|
|
379
394
|
"getItem",
|
|
@@ -381,36 +396,36 @@ var xt = R(
|
|
|
381
396
|
"setValueOnClick",
|
|
382
397
|
"preventScrollOnKeyDown",
|
|
383
398
|
"focusOnHover"
|
|
384
|
-
]),
|
|
399
|
+
]), s;
|
|
385
400
|
const f = Oe();
|
|
386
401
|
e = e || f, Y(
|
|
387
402
|
e,
|
|
388
403
|
process.env.NODE_ENV !== "production" && "SelectItem must be wrapped in a SelectList or SelectPopover component."
|
|
389
404
|
);
|
|
390
|
-
const b = ge(l.id), w =
|
|
405
|
+
const b = ge(l.id), w = Ke(l), { listElement: g, multiSelectable: M, selected: y, autoFocus: x } = rt(e, {
|
|
391
406
|
listElement: "listElement",
|
|
392
407
|
multiSelectable(i) {
|
|
393
408
|
return Array.isArray(i.value);
|
|
394
409
|
},
|
|
395
410
|
selected(i) {
|
|
396
|
-
return
|
|
411
|
+
return Dt(i.value, r);
|
|
397
412
|
},
|
|
398
413
|
autoFocus(i) {
|
|
399
|
-
return
|
|
414
|
+
return r == null || i.value == null || i.activeId !== b && (e != null && e.item(i.activeId)) ? !1 : Array.isArray(i.value) ? i.value[i.value.length - 1] === r : i.value === r;
|
|
400
415
|
}
|
|
401
|
-
}),
|
|
416
|
+
}), k = $e(
|
|
402
417
|
(i) => {
|
|
403
418
|
const h = I(p({}, i), {
|
|
404
|
-
value: w ? void 0 :
|
|
405
|
-
children:
|
|
419
|
+
value: w ? void 0 : r,
|
|
420
|
+
children: r
|
|
406
421
|
});
|
|
407
422
|
return a ? a(h) : h;
|
|
408
423
|
},
|
|
409
|
-
[w,
|
|
424
|
+
[w, r, a]
|
|
410
425
|
);
|
|
411
|
-
m = m ?? (
|
|
412
|
-
const
|
|
413
|
-
|
|
426
|
+
m = m ?? (r != null && !M);
|
|
427
|
+
const R = l.onClick, H = N(S), T = N(m), C = le((i) => {
|
|
428
|
+
R == null || R(i), !i.defaultPrevented && (Ne(i) || Me(i) || (H(i) && r != null && (e == null || e.setValue((h) => Array.isArray(h) ? h.includes(r) ? h.filter((L) => L !== r) : [...h, r] : r)), T(i) && (e == null || e.hide())));
|
|
414
429
|
});
|
|
415
430
|
l = X(
|
|
416
431
|
l,
|
|
@@ -420,44 +435,44 @@ var xt = R(
|
|
|
420
435
|
id: b,
|
|
421
436
|
role: Re(g),
|
|
422
437
|
"aria-selected": y,
|
|
423
|
-
children:
|
|
438
|
+
children: r
|
|
424
439
|
}, l), {
|
|
425
|
-
autoFocus: (
|
|
440
|
+
autoFocus: (s = l.autoFocus) != null ? s : x,
|
|
426
441
|
onClick: C
|
|
427
|
-
}), l =
|
|
442
|
+
}), l = at(p({
|
|
428
443
|
store: e,
|
|
429
|
-
getItem:
|
|
444
|
+
getItem: k,
|
|
430
445
|
preventScrollOnKeyDown: E
|
|
431
446
|
}, l));
|
|
432
|
-
const
|
|
433
|
-
return l =
|
|
447
|
+
const F = N(u);
|
|
448
|
+
return l = lt(I(p({
|
|
434
449
|
store: e
|
|
435
450
|
}, l), {
|
|
436
451
|
// We have to disable focusOnHover when the popup is closed, otherwise
|
|
437
452
|
// the active item will change to null (the container) when the popup is
|
|
438
453
|
// closed by clicking on an item.
|
|
439
454
|
focusOnHover(i) {
|
|
440
|
-
if (!
|
|
455
|
+
if (!F(i)) return !1;
|
|
441
456
|
const h = e == null ? void 0 : e.getState();
|
|
442
457
|
return !!(h != null && h.open);
|
|
443
458
|
}
|
|
444
459
|
})), l;
|
|
445
460
|
}
|
|
446
|
-
),
|
|
447
|
-
|
|
448
|
-
const
|
|
449
|
-
return
|
|
461
|
+
), ao = Le(
|
|
462
|
+
_(function(t) {
|
|
463
|
+
const o = _t(t);
|
|
464
|
+
return V(At, o);
|
|
450
465
|
})
|
|
451
|
-
),
|
|
452
|
-
function(
|
|
453
|
-
var
|
|
466
|
+
), Vt = "div", fe = je(null), Ee = D(
|
|
467
|
+
function(t) {
|
|
468
|
+
var o = t, {
|
|
454
469
|
store: e,
|
|
455
|
-
resetOnEscape:
|
|
470
|
+
resetOnEscape: r = !0,
|
|
456
471
|
hideOnEnter: a = !0,
|
|
457
472
|
focusOnMove: m = !0,
|
|
458
473
|
composite: S,
|
|
459
474
|
alwaysVisible: E
|
|
460
|
-
} =
|
|
475
|
+
} = o, u = G(o, [
|
|
461
476
|
"store",
|
|
462
477
|
"resetOnEscape",
|
|
463
478
|
"hideOnEnter",
|
|
@@ -470,73 +485,75 @@ var xt = R(
|
|
|
470
485
|
e,
|
|
471
486
|
process.env.NODE_ENV !== "production" && "SelectList must receive a `store` prop or be wrapped in a SelectProvider component."
|
|
472
487
|
);
|
|
473
|
-
const
|
|
488
|
+
const s = ge(u.id), f = e.useState("value"), b = Array.isArray(f), [w, g] = J(f), M = e.useState("mounted");
|
|
474
489
|
ne(() => {
|
|
475
|
-
|
|
476
|
-
}, [
|
|
477
|
-
const y = u.onKeyDown, x =
|
|
478
|
-
y == null || y(v), !v.defaultPrevented && (v.key === "Escape" && x(v) && (e == null || e.setValue(w)), (v.key === " " || v.key === "Enter") && Te(v) &&
|
|
479
|
-
}),
|
|
480
|
-
() => [C,
|
|
490
|
+
M || g(f);
|
|
491
|
+
}, [M, f]), r = r && !b;
|
|
492
|
+
const y = u.onKeyDown, x = N(r), k = N(a), R = le((v) => {
|
|
493
|
+
y == null || y(v), !v.defaultPrevented && (v.key === "Escape" && x(v) && (e == null || e.setValue(w)), (v.key === " " || v.key === "Enter") && Te(v) && k(v) && (v.preventDefault(), e == null || e.hide()));
|
|
494
|
+
}), H = me(de), T = J(), [C, F] = H || T, i = ae(
|
|
495
|
+
() => [C, F],
|
|
481
496
|
[C]
|
|
482
|
-
), [h,
|
|
497
|
+
), [h, L] = J(null), A = me(fe);
|
|
483
498
|
ne(() => {
|
|
484
499
|
if (A)
|
|
485
500
|
return A(e), () => A(null);
|
|
486
501
|
}, [A, e]), u = X(
|
|
487
502
|
u,
|
|
488
|
-
(v) => /* @__PURE__ */ P(be, { value: e, children: /* @__PURE__ */ P(fe.Provider, { value:
|
|
503
|
+
(v) => /* @__PURE__ */ P(be, { value: e, children: /* @__PURE__ */ P(fe.Provider, { value: L, children: /* @__PURE__ */ P(de.Provider, { value: i, children: v }) }) }),
|
|
489
504
|
[e, i]
|
|
490
505
|
);
|
|
491
|
-
const
|
|
492
|
-
S = S ?? (
|
|
506
|
+
const $ = !!e.combobox;
|
|
507
|
+
S = S ?? (!$ && h !== e);
|
|
493
508
|
const [Q, c] = Fe(
|
|
494
509
|
S ? e.setListElement : null
|
|
495
|
-
), d =
|
|
510
|
+
), d = Ge(Q, "role", u.role), ee = (S || (d === "listbox" || d === "menu" || d === "tree" || d === "grid")) && b || void 0, j = it(M, u.hidden, E), B = j ? I(p({}, u.style), { display: "none" }) : u.style;
|
|
496
511
|
S && (u = p({
|
|
497
512
|
role: "listbox",
|
|
498
513
|
"aria-multiselectable": ee
|
|
499
514
|
}, u));
|
|
500
|
-
const
|
|
515
|
+
const U = e.useState(
|
|
501
516
|
(v) => {
|
|
502
517
|
var te;
|
|
503
518
|
return C || ((te = v.labelElement) == null ? void 0 : te.id);
|
|
504
519
|
}
|
|
505
520
|
);
|
|
506
521
|
return u = I(p({
|
|
507
|
-
id:
|
|
508
|
-
"aria-labelledby":
|
|
509
|
-
hidden:
|
|
522
|
+
id: s,
|
|
523
|
+
"aria-labelledby": U,
|
|
524
|
+
hidden: j
|
|
510
525
|
}, u), {
|
|
511
526
|
ref: he(c, u.ref),
|
|
512
|
-
style:
|
|
513
|
-
onKeyDown:
|
|
514
|
-
}), u =
|
|
527
|
+
style: B,
|
|
528
|
+
onKeyDown: R
|
|
529
|
+
}), u = ut(I(p({ store: e }, u), { composite: S })), u = we(p({ store: e, typeahead: !$ }, u)), u;
|
|
515
530
|
}
|
|
516
|
-
),
|
|
517
|
-
const
|
|
518
|
-
return
|
|
519
|
-
}),
|
|
520
|
-
function(
|
|
521
|
-
var
|
|
531
|
+
), io = _(function(t) {
|
|
532
|
+
const o = Ee(t);
|
|
533
|
+
return V(Vt, o);
|
|
534
|
+
}), kt = "div", Lt = D(
|
|
535
|
+
function(t) {
|
|
536
|
+
var o = t, { store: e, alwaysVisible: r } = o, a = G(o, ["store", "alwaysVisible"]);
|
|
522
537
|
const m = se();
|
|
523
|
-
return e = e || m, a = Ee(p({ store: e, alwaysVisible:
|
|
538
|
+
return e = e || m, a = Ee(p({ store: e, alwaysVisible: r }, a)), a = dt(p({ store: e, alwaysVisible: r }, a)), a;
|
|
524
539
|
}
|
|
525
|
-
),
|
|
526
|
-
|
|
527
|
-
const
|
|
528
|
-
return
|
|
540
|
+
), uo = ct(
|
|
541
|
+
_(function(t) {
|
|
542
|
+
const o = Lt(t);
|
|
543
|
+
return V(kt, o);
|
|
529
544
|
}),
|
|
530
545
|
se
|
|
531
546
|
);
|
|
532
547
|
export {
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
548
|
+
oo as P,
|
|
549
|
+
no as S,
|
|
550
|
+
ro as a,
|
|
551
|
+
uo as b,
|
|
552
|
+
io as c,
|
|
553
|
+
lo as d,
|
|
554
|
+
so as e,
|
|
555
|
+
ao as f,
|
|
556
|
+
wt as g,
|
|
557
|
+
bt as h,
|
|
541
558
|
Pe as u
|
|
542
559
|
};
|