@wrdagency/blockout 0.0.11 → 0.0.13
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-raj2vrMY.js → 2NBKRL7C-C6mXReCE.js} +3 -3
- package/dist/{P7GR5CS5-PkUYC6hd.js → P7GR5CS5-DNbthaqU.js} +11 -11
- package/dist/{T7VMP3TM-BeJUiw28.js → T7VMP3TM-B3jxXFmj.js} +2 -2
- package/dist/{UQQRIHDV-xtNCxi0H.js → UQQRIHDV-CFdrMoqW.js} +1 -1
- package/dist/{VIIRIBF3-B3f0V2Nc.js → VIIRIBF3-B585VK9r.js} +1 -1
- package/dist/assets/form.css +1 -0
- package/dist/assets/index.css +1 -1
- package/dist/assets/index10.css +1 -1
- package/dist/assets/index11.css +1 -0
- package/dist/assets/index2.css +1 -1
- package/dist/assets/index3.css +1 -1
- package/dist/assets/index4.css +1 -1
- package/dist/assets/index5.css +1 -1
- package/dist/assets/index6.css +1 -1
- package/dist/assets/index7.css +1 -1
- package/dist/assets/index8.css +1 -1
- package/dist/assets/index9.css +1 -1
- package/dist/components/breadcrumbs/index.d.ts +7 -0
- package/dist/components/breadcrumbs/index.js +29 -0
- package/dist/components/breadcrumbs/types.d.ts +4 -0
- package/dist/components/button/index.js +1 -1
- package/dist/components/controls/base-control/index.js +1 -1
- package/dist/components/controls/choice-control/index.d.ts +12 -3
- package/dist/components/controls/choice-control/index.js +32 -22
- package/dist/components/controls/number-control/index.d.ts +1 -0
- package/dist/components/controls/number-control/index.js +33 -25
- package/dist/components/controls/select-control/index.d.ts +2 -0
- package/dist/components/controls/select-control/index.js +337 -334
- package/dist/components/controls/text-control/index.d.ts +1 -0
- package/dist/components/controls/text-control/index.js +15 -8
- package/dist/components/controls/textarea-control/index.d.ts +1 -0
- package/dist/components/controls/textarea-control/index.js +17 -9
- package/dist/components/controls/toggle-control/index.d.ts +3 -1
- package/dist/components/controls/toggle-control/index.js +35 -23
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/form/components/description.d.ts +2 -0
- package/dist/components/form/components/description.js +15 -0
- package/dist/components/form/components/form.d.ts +9 -0
- package/dist/components/form/components/form.js +41 -0
- package/dist/components/form/components/index.js +18 -0
- package/dist/components/form/components/pagination.d.ts +6 -0
- package/dist/components/form/components/pagination.js +46 -0
- package/dist/components/form/components/progress.d.ts +5 -0
- package/dist/components/form/components/progress.js +22 -0
- package/dist/components/form/components/row.d.ts +6 -0
- package/dist/components/form/components/row.js +22 -0
- package/dist/components/form/components/step.d.ts +6 -0
- package/dist/components/form/components/step.js +24 -0
- package/dist/components/form/components/title.d.ts +2 -0
- package/dist/components/form/components/title.js +15 -0
- package/dist/components/form/index.d.ts +9 -0
- package/dist/components/form/index.js +6 -0
- package/dist/components/form/types/fields.d.ts +21 -0
- package/dist/components/form/types/fields.js +11 -0
- package/dist/components/form/types/form.d.ts +28 -0
- package/dist/components/form/types/form.js +7 -0
- package/dist/components/form/types/steps.d.ts +5 -0
- package/dist/components/form/types/steps.js +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +29 -23
- package/dist/components/markdown/formats.d.ts +11 -0
- package/dist/components/markdown/formats.js +318 -0
- package/dist/components/markdown/index.js +1 -0
- package/dist/components/markdown/types/format.d.ts +27 -0
- package/dist/components/markdown/types/format.js +4 -0
- package/dist/components/menu/index.js +11 -11
- package/dist/components/menu/item.js +1 -1
- package/dist/components/menu/items/action.js +1 -1
- package/dist/components/menu/items/spacer.js +10 -10
- package/dist/components/menu/items/submenu.js +2 -2
- package/dist/components/menu/items/toggle.js +1 -1
- package/dist/components/progress/index.js +13 -11
- package/dist/index.js +33 -27
- package/dist/{item-Bcbx6pI-.js → item-C0kyELlf.js} +36 -36
- package/package.json +3 -2
- /package/dist/components/{controls/ranked-choice-control/index.js → breadcrumbs/types.js} +0 -0
- /package/dist/components/{controls/ranked-choice-control → markdown}/index.d.ts +0 -0
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { jsx as I, jsxs as se, Fragment as Fe } from "react/jsx-runtime";
|
|
2
2
|
import { normalizeOption as Zt } from "../../../types/options.js";
|
|
3
|
-
import {
|
|
3
|
+
import { noop as $t } from "../../../utils/noop.js";
|
|
4
|
+
import { e as qt } from "../../../CaretDown.es-eySGHzTJ.js";
|
|
4
5
|
import * as M from "react";
|
|
5
|
-
import { createContext as ge, useMemo as Ee, useState as de, useRef as le, useEffect as ae, useCallback as Je, useContext as Ve, startTransition as
|
|
6
|
-
import { w as
|
|
7
|
-
import { g as
|
|
8
|
-
import { BaseControl as
|
|
9
|
-
import { useBaseControlProps as
|
|
10
|
-
import { c as Qe, P as
|
|
11
|
-
import { d as it, c as ct, t as dt, e as mt, k as ft, u as vt, f as pt, j as
|
|
12
|
-
import { m as Et, o as
|
|
13
|
-
import '../../../assets/
|
|
6
|
+
import { createContext as ge, useMemo as Ee, useState as de, useRef as le, useEffect as ae, useCallback as Je, useContext as Ve, startTransition as zt } from "react";
|
|
7
|
+
import { w as Yt } from "../../../SSRBase.es-BUXS72ra.js";
|
|
8
|
+
import { g as Gt } from "../../../_commonjsHelpers-C6fGbg64.js";
|
|
9
|
+
import { BaseControl as Jt } from "../base-control/index.js";
|
|
10
|
+
import { useBaseControlProps as Qt } from "../base-control/props.js";
|
|
11
|
+
import { c as Qe, P as Xt, C as Xe, a as en, b as et, d as te, _ as ne, q as tn, i as me, j as R, k as x, t as tt, f as oe, e as re, K as nt, x as ue, y as D, z as Z, M as Me, u as L, g as G, a2 as ot, G as he, s as Ae, O as rt, m as lt, r as Ie, J as nn, h as on, l as st, n as at, ag as rn, ah as ut, a3 as ln, D as sn, a6 as an, ai as un, aj as cn, ak as dn, ac as Be, al as Pe, U as mn, af as fn, v as ke, H as vn, a4 as pn, am as bn, W as hn } from "../../../P7GR5CS5-DNbthaqU.js";
|
|
12
|
+
import { d as it, c as ct, t as dt, e as mt, k as ft, u as vt, f as pt, j as Sn, h as bt, i as ht, g as St, b as Cn, a as gn, l as En, C as On, m as Ct, n as gt, o as xn, p as yn, q as An, r as In } from "../../../T7VMP3TM-B3jxXFmj.js";
|
|
13
|
+
import { m as Et, o as wn, t as Ot, c as xt, f as J, s as Q, i as yt, g as At, d as be, j as It, a as wt, b as Pt, u as Pn, p as Vn, k as _e } from "../../../UQQRIHDV-CFdrMoqW.js";
|
|
14
|
+
import '../../../assets/index11.css';const kn = /* @__PURE__ */ new Map([
|
|
14
15
|
[
|
|
15
16
|
"bold",
|
|
16
17
|
/* @__PURE__ */ M.createElement(M.Fragment, null, /* @__PURE__ */ M.createElement("path", { d: "M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z" }))
|
|
@@ -35,24 +36,24 @@ import '../../../assets/index10.css';const Vn = /* @__PURE__ */ new Map([
|
|
|
35
36
|
"thin",
|
|
36
37
|
/* @__PURE__ */ M.createElement(M.Fragment, null, /* @__PURE__ */ M.createElement("path", { d: "M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z" }))
|
|
37
38
|
]
|
|
38
|
-
]), Vt = M.forwardRef((t, n) => /* @__PURE__ */ M.createElement(
|
|
39
|
+
]), Vt = M.forwardRef((t, n) => /* @__PURE__ */ M.createElement(Yt, { ref: n, ...t, weights: kn }));
|
|
39
40
|
Vt.displayName = "MagnifyingGlassIcon";
|
|
40
41
|
var Oe = Qe(
|
|
41
|
-
[
|
|
42
|
-
[
|
|
43
|
-
), De = Oe.useContext,
|
|
42
|
+
[en, et],
|
|
43
|
+
[Xt, Xe]
|
|
44
|
+
), De = Oe.useContext, _n = Oe.useScopedContext, Ne = Oe.useProviderContext, Mn = Oe.ContextProvider, kt = Oe.ScopedContextProvider, Dn = ge(!1), je = ge(null), Nn = "span", Tn = {
|
|
44
45
|
top: "4,10 8,6 12,10",
|
|
45
46
|
right: "6,4 10,8 6,12",
|
|
46
47
|
bottom: "4,6 8,10 12,6",
|
|
47
48
|
left: "10,4 6,8 10,12"
|
|
48
49
|
}, _t = te(function(n) {
|
|
49
50
|
var o = n, { store: e, placement: r } = o, l = ne(o, ["store", "placement"]);
|
|
50
|
-
const a =
|
|
51
|
+
const a = tn();
|
|
51
52
|
e = e || a, me(
|
|
52
53
|
e,
|
|
53
54
|
process.env.NODE_ENV !== "production" && "PopoverDisclosureArrow must be wrapped in a PopoverDisclosure component."
|
|
54
55
|
);
|
|
55
|
-
const
|
|
56
|
+
const f = e.useState((s) => r || s.placement).split("-")[0], c = Tn[f], u = Ee(
|
|
56
57
|
() => /* @__PURE__ */ I(
|
|
57
58
|
"svg",
|
|
58
59
|
{
|
|
@@ -84,10 +85,10 @@ var Oe = Qe(
|
|
|
84
85
|
oe(
|
|
85
86
|
function(n) {
|
|
86
87
|
const o = _t(n);
|
|
87
|
-
return re(
|
|
88
|
+
return re(Nn, o);
|
|
88
89
|
}
|
|
89
90
|
);
|
|
90
|
-
function
|
|
91
|
+
function Ln(t = {}) {
|
|
91
92
|
var n = t, {
|
|
92
93
|
combobox: o
|
|
93
94
|
} = n, e = nt(n, [
|
|
@@ -95,7 +96,7 @@ function Tn(t = {}) {
|
|
|
95
96
|
]);
|
|
96
97
|
const r = Et(
|
|
97
98
|
e.store,
|
|
98
|
-
|
|
99
|
+
wn(o, [
|
|
99
100
|
"value",
|
|
100
101
|
"items",
|
|
101
102
|
"renderedItems",
|
|
@@ -131,19 +132,19 @@ function Tn(t = {}) {
|
|
|
131
132
|
l.orientation,
|
|
132
133
|
"vertical"
|
|
133
134
|
)
|
|
134
|
-
})),
|
|
135
|
+
})), m = ct(ue(Z({}, e), {
|
|
135
136
|
store: r,
|
|
136
137
|
placement: D(
|
|
137
138
|
e.placement,
|
|
138
139
|
l.placement,
|
|
139
140
|
"bottom-start"
|
|
140
141
|
)
|
|
141
|
-
})),
|
|
142
|
+
})), f = new String(""), c = ue(Z(Z({}, a.getState()), m.getState()), {
|
|
142
143
|
value: D(
|
|
143
144
|
e.value,
|
|
144
145
|
l.value,
|
|
145
146
|
e.defaultValue,
|
|
146
|
-
|
|
147
|
+
f
|
|
147
148
|
),
|
|
148
149
|
setValueOnMove: D(
|
|
149
150
|
e.setValueOnMove,
|
|
@@ -153,15 +154,15 @@ function Tn(t = {}) {
|
|
|
153
154
|
labelElement: D(l.labelElement, null),
|
|
154
155
|
selectElement: D(l.selectElement, null),
|
|
155
156
|
listElement: D(l.listElement, null)
|
|
156
|
-
}), u = xt(c, a,
|
|
157
|
+
}), u = xt(c, a, m, r);
|
|
157
158
|
return J(
|
|
158
159
|
u,
|
|
159
160
|
() => Q(u, ["value", "items"], (s) => {
|
|
160
|
-
if (s.value !==
|
|
161
|
-
const
|
|
161
|
+
if (s.value !== f || !s.items.length) return;
|
|
162
|
+
const v = s.items.find(
|
|
162
163
|
(C) => !C.disabled && C.value != null
|
|
163
164
|
);
|
|
164
|
-
(
|
|
165
|
+
(v == null ? void 0 : v.value) != null && u.setState("value", v.value);
|
|
165
166
|
})
|
|
166
167
|
), J(
|
|
167
168
|
u,
|
|
@@ -172,22 +173,22 @@ function Tn(t = {}) {
|
|
|
172
173
|
u,
|
|
173
174
|
() => Q(u, ["mounted", "items", "value"], (s) => {
|
|
174
175
|
if (o || s.mounted) return;
|
|
175
|
-
const
|
|
176
|
+
const v = dt(s.value), C = v[v.length - 1];
|
|
176
177
|
if (C == null) return;
|
|
177
|
-
const
|
|
178
|
-
(
|
|
178
|
+
const d = s.items.find(
|
|
179
|
+
(p) => !p.disabled && p.value === C
|
|
179
180
|
);
|
|
180
|
-
|
|
181
|
+
d && u.setState("activeId", d.id);
|
|
181
182
|
})
|
|
182
183
|
), J(
|
|
183
184
|
u,
|
|
184
185
|
() => yt(u, ["setValueOnMove", "moves"], (s) => {
|
|
185
|
-
const { mounted:
|
|
186
|
-
if (!s.setValueOnMove &&
|
|
187
|
-
const
|
|
188
|
-
!
|
|
186
|
+
const { mounted: v, value: C, activeId: d } = u.getState();
|
|
187
|
+
if (!s.setValueOnMove && v || Array.isArray(C) || !s.moves || !d) return;
|
|
188
|
+
const p = a.item(d);
|
|
189
|
+
!p || p.disabled || p.value == null || u.setState("value", p.value);
|
|
189
190
|
})
|
|
190
|
-
), ue(Z(Z(Z({}, a),
|
|
191
|
+
), ue(Z(Z(Z({}, a), m), u), {
|
|
191
192
|
combobox: o,
|
|
192
193
|
setValue: (s) => u.setState("value", s),
|
|
193
194
|
setLabelElement: (s) => u.setState("labelElement", s),
|
|
@@ -195,13 +196,13 @@ function Tn(t = {}) {
|
|
|
195
196
|
setListElement: (s) => u.setState("listElement", s)
|
|
196
197
|
});
|
|
197
198
|
}
|
|
198
|
-
function
|
|
199
|
+
function Rn(t) {
|
|
199
200
|
const n = mt();
|
|
200
201
|
return t = R(x({}, t), {
|
|
201
202
|
combobox: t.combobox !== void 0 ? t.combobox : n
|
|
202
203
|
}), ft(t);
|
|
203
204
|
}
|
|
204
|
-
function
|
|
205
|
+
function Kn(t, n, o) {
|
|
205
206
|
return Me(n, [o.combobox]), be(t, o, "value", "setValue"), be(t, o, "setValueOnMove"), Object.assign(
|
|
206
207
|
vt(
|
|
207
208
|
pt(t, n, o),
|
|
@@ -211,22 +212,22 @@ function Rn(t, n, o) {
|
|
|
211
212
|
{ combobox: o.combobox }
|
|
212
213
|
);
|
|
213
214
|
}
|
|
214
|
-
function
|
|
215
|
-
t =
|
|
216
|
-
const [n, o] = At(
|
|
217
|
-
return
|
|
215
|
+
function Hn(t = {}) {
|
|
216
|
+
t = Rn(t);
|
|
217
|
+
const [n, o] = At(Ln, t);
|
|
218
|
+
return Kn(n, o, t);
|
|
218
219
|
}
|
|
219
|
-
var
|
|
220
|
+
var Un = "span", Fn = te(
|
|
220
221
|
function(n) {
|
|
221
222
|
var o = n, { store: e } = o, r = ne(o, ["store"]);
|
|
222
223
|
const l = De();
|
|
223
224
|
return e = e || l, r = _t(x({ store: e }, r)), r;
|
|
224
225
|
}
|
|
225
|
-
),
|
|
226
|
-
const o =
|
|
227
|
-
return re(
|
|
228
|
-
}),
|
|
229
|
-
function
|
|
226
|
+
), Bn = oe(function(n) {
|
|
227
|
+
const o = Fn(n);
|
|
228
|
+
return re(Un, o);
|
|
229
|
+
}), jn = "button";
|
|
230
|
+
function Wn(t) {
|
|
230
231
|
return Array.from(t.selectedOptions).map((n) => n.value);
|
|
231
232
|
}
|
|
232
233
|
function ye(t, n) {
|
|
@@ -243,14 +244,14 @@ function ye(t, n) {
|
|
|
243
244
|
return r == null ? void 0 : r.id;
|
|
244
245
|
};
|
|
245
246
|
}
|
|
246
|
-
var
|
|
247
|
+
var Zn = te(function(n) {
|
|
247
248
|
var o = n, {
|
|
248
249
|
store: e,
|
|
249
250
|
name: r,
|
|
250
251
|
form: l,
|
|
251
252
|
required: a,
|
|
252
|
-
showOnKeyDown:
|
|
253
|
-
moveOnKeyDown:
|
|
253
|
+
showOnKeyDown: m = !0,
|
|
254
|
+
moveOnKeyDown: f = !0,
|
|
254
255
|
toggleOnPress: c = !0,
|
|
255
256
|
toggleOnClick: u = c
|
|
256
257
|
} = o, s = ne(o, [
|
|
@@ -263,12 +264,12 @@ var Wn = te(function(n) {
|
|
|
263
264
|
"toggleOnPress",
|
|
264
265
|
"toggleOnClick"
|
|
265
266
|
]);
|
|
266
|
-
const
|
|
267
|
-
e = e ||
|
|
267
|
+
const v = Ne();
|
|
268
|
+
e = e || v, me(
|
|
268
269
|
e,
|
|
269
270
|
process.env.NODE_ENV !== "production" && "Select must receive a `store` prop or be wrapped in a SelectProvider component."
|
|
270
271
|
);
|
|
271
|
-
const C = s.onKeyDown,
|
|
272
|
+
const C = s.onKeyDown, d = L(m), p = L(f), y = e.useState("placement").split("-")[0], g = e.useState("value"), W = Array.isArray(g), K = G((S) => {
|
|
272
273
|
var E;
|
|
273
274
|
if (C == null || C(S), S.defaultPrevented || !e) return;
|
|
274
275
|
const { orientation: q, items: z, activeId: X } = e.getState(), fe = q !== "horizontal", ie = q !== "vertical", _ = !!((E = z.find((xe) => !xe.disabled && xe.value != null)) != null && E.rowId), pe = {
|
|
@@ -277,14 +278,14 @@ var Wn = te(function(n) {
|
|
|
277
278
|
ArrowDown: (_ || fe) && ye(e, e.down),
|
|
278
279
|
ArrowLeft: (_ || ie) && ye(e, e.previous)
|
|
279
280
|
}[S.key];
|
|
280
|
-
pe &&
|
|
281
|
+
pe && p(S) && (S.preventDefault(), e.move(pe()));
|
|
281
282
|
const Se = y === "top" || y === "bottom";
|
|
282
283
|
({
|
|
283
284
|
ArrowDown: Se,
|
|
284
285
|
ArrowUp: Se,
|
|
285
286
|
ArrowLeft: y === "left",
|
|
286
287
|
ArrowRight: y === "right"
|
|
287
|
-
})[S.key] &&
|
|
288
|
+
})[S.key] && d(S) && (S.preventDefault(), e.move(X), ot(S.currentTarget, "keyup", e.show));
|
|
288
289
|
});
|
|
289
290
|
s = he(
|
|
290
291
|
s,
|
|
@@ -299,7 +300,7 @@ var Wn = te(function(n) {
|
|
|
299
300
|
const U = e.useState((S) => {
|
|
300
301
|
var E;
|
|
301
302
|
return (E = S.labelElement) == null ? void 0 : E.id;
|
|
302
|
-
}),
|
|
303
|
+
}), b = s["aria-label"], O = s["aria-labelledby"] || U, F = e.useState((S) => {
|
|
303
304
|
if (r)
|
|
304
305
|
return S.items;
|
|
305
306
|
}), B = Ee(() => [...new Set(F == null ? void 0 : F.map((S) => S.value).filter((S) => S != null))], [F]);
|
|
@@ -322,7 +323,7 @@ var Wn = te(function(n) {
|
|
|
322
323
|
},
|
|
323
324
|
tabIndex: -1,
|
|
324
325
|
"aria-hidden": !0,
|
|
325
|
-
"aria-label":
|
|
326
|
+
"aria-label": b,
|
|
326
327
|
"aria-labelledby": O,
|
|
327
328
|
name: r,
|
|
328
329
|
form: l,
|
|
@@ -336,7 +337,7 @@ var Wn = te(function(n) {
|
|
|
336
337
|
},
|
|
337
338
|
onChange: (E) => {
|
|
338
339
|
w.current = !0, k(!0), e == null || e.setValue(
|
|
339
|
-
W ?
|
|
340
|
+
W ? Wn(E.target) : E.target.value
|
|
340
341
|
);
|
|
341
342
|
},
|
|
342
343
|
children: [
|
|
@@ -349,7 +350,7 @@ var Wn = te(function(n) {
|
|
|
349
350
|
] }) : S,
|
|
350
351
|
[
|
|
351
352
|
e,
|
|
352
|
-
|
|
353
|
+
b,
|
|
353
354
|
O,
|
|
354
355
|
r,
|
|
355
356
|
l,
|
|
@@ -362,7 +363,7 @@ var Wn = te(function(n) {
|
|
|
362
363
|
);
|
|
363
364
|
const h = /* @__PURE__ */ se(Fe, { children: [
|
|
364
365
|
g,
|
|
365
|
-
/* @__PURE__ */ I(
|
|
366
|
+
/* @__PURE__ */ I(Bn, {})
|
|
366
367
|
] }), P = e.useState("contentElement");
|
|
367
368
|
return s = R(x({
|
|
368
369
|
role: "combobox",
|
|
@@ -375,29 +376,29 @@ var Wn = te(function(n) {
|
|
|
375
376
|
}, s), {
|
|
376
377
|
ref: Ae(e.setSelectElement, s.ref),
|
|
377
378
|
onKeyDown: K
|
|
378
|
-
}), s =
|
|
379
|
-
}),
|
|
380
|
-
const o =
|
|
381
|
-
return re(
|
|
379
|
+
}), s = Sn(x({ store: e, toggleOnClick: u }, s)), s = bt(x({ store: e }, s)), s;
|
|
380
|
+
}), $n = oe(function(n) {
|
|
381
|
+
const o = Zn(n);
|
|
382
|
+
return re(jn, o);
|
|
382
383
|
});
|
|
383
|
-
function
|
|
384
|
-
const n =
|
|
385
|
-
return /* @__PURE__ */ I(
|
|
384
|
+
function qn(t = {}) {
|
|
385
|
+
const n = Hn(t);
|
|
386
|
+
return /* @__PURE__ */ I(Mn, { value: n, children: t.children });
|
|
386
387
|
}
|
|
387
|
-
var
|
|
388
|
-
function
|
|
388
|
+
var zn = "div";
|
|
389
|
+
function Yn(t, n) {
|
|
389
390
|
if (n != null)
|
|
390
391
|
return t == null ? !1 : Array.isArray(t) ? t.includes(n) : t === n;
|
|
391
392
|
}
|
|
392
|
-
var
|
|
393
|
+
var Gn = te(
|
|
393
394
|
function(n) {
|
|
394
395
|
var o = n, {
|
|
395
396
|
store: e,
|
|
396
397
|
value: r,
|
|
397
398
|
getItem: l,
|
|
398
399
|
hideOnClick: a,
|
|
399
|
-
setValueOnClick:
|
|
400
|
-
preventScrollOnKeyDown:
|
|
400
|
+
setValueOnClick: m = r != null,
|
|
401
|
+
preventScrollOnKeyDown: f = !0,
|
|
401
402
|
focusOnHover: c = !0
|
|
402
403
|
} = o, u = ne(o, [
|
|
403
404
|
"store",
|
|
@@ -408,43 +409,43 @@ var Yn = te(
|
|
|
408
409
|
"preventScrollOnKeyDown",
|
|
409
410
|
"focusOnHover"
|
|
410
411
|
]), s;
|
|
411
|
-
const
|
|
412
|
-
e = e ||
|
|
412
|
+
const v = _n();
|
|
413
|
+
e = e || v, me(
|
|
413
414
|
e,
|
|
414
415
|
process.env.NODE_ENV !== "production" && "SelectItem must be wrapped in a SelectList or SelectPopover component."
|
|
415
416
|
);
|
|
416
|
-
const C = Ie(u.id),
|
|
417
|
+
const C = Ie(u.id), d = nn(u), { listElement: p, multiSelectable: V, selected: y, autoFocus: g } = It(e, {
|
|
417
418
|
listElement: "listElement",
|
|
418
|
-
multiSelectable(
|
|
419
|
-
return Array.isArray(
|
|
419
|
+
multiSelectable(b) {
|
|
420
|
+
return Array.isArray(b.value);
|
|
420
421
|
},
|
|
421
|
-
selected(
|
|
422
|
-
return
|
|
422
|
+
selected(b) {
|
|
423
|
+
return Yn(b.value, r);
|
|
423
424
|
},
|
|
424
|
-
autoFocus(
|
|
425
|
-
return r == null ||
|
|
425
|
+
autoFocus(b) {
|
|
426
|
+
return r == null || b.value == null || b.activeId !== C && (e != null && e.item(b.activeId)) ? !1 : Array.isArray(b.value) ? b.value[b.value.length - 1] === r : b.value === r;
|
|
426
427
|
}
|
|
427
428
|
}), W = Je(
|
|
428
|
-
(
|
|
429
|
-
const O = R(x({},
|
|
430
|
-
value:
|
|
429
|
+
(b) => {
|
|
430
|
+
const O = R(x({}, b), {
|
|
431
|
+
value: d ? void 0 : r,
|
|
431
432
|
children: r
|
|
432
433
|
});
|
|
433
434
|
return l ? l(O) : O;
|
|
434
435
|
},
|
|
435
|
-
[
|
|
436
|
+
[d, r, l]
|
|
436
437
|
);
|
|
437
438
|
a = a ?? (r != null && !V);
|
|
438
|
-
const K = u.onClick, $ = L(
|
|
439
|
-
K == null || K(
|
|
439
|
+
const K = u.onClick, $ = L(m), k = L(a), w = G((b) => {
|
|
440
|
+
K == null || K(b), !b.defaultPrevented && (st(b) || at(b) || ($(b) && r != null && (e == null || e.setValue((O) => Array.isArray(O) ? O.includes(r) ? O.filter((F) => F !== r) : [...O, r] : r)), k(b) && (e == null || e.hide())));
|
|
440
441
|
});
|
|
441
442
|
u = he(
|
|
442
443
|
u,
|
|
443
|
-
(
|
|
444
|
+
(b) => /* @__PURE__ */ I(Dn.Provider, { value: y ?? !1, children: b }),
|
|
444
445
|
[y]
|
|
445
446
|
), u = R(x({
|
|
446
447
|
id: C,
|
|
447
|
-
role:
|
|
448
|
+
role: on(p),
|
|
448
449
|
"aria-selected": y,
|
|
449
450
|
children: r
|
|
450
451
|
}, u), {
|
|
@@ -453,7 +454,7 @@ var Yn = te(
|
|
|
453
454
|
}), u = wt(x({
|
|
454
455
|
store: e,
|
|
455
456
|
getItem: W,
|
|
456
|
-
preventScrollOnKeyDown:
|
|
457
|
+
preventScrollOnKeyDown: f
|
|
457
458
|
}, u));
|
|
458
459
|
const U = L(c);
|
|
459
460
|
return u = Pt(R(x({
|
|
@@ -462,27 +463,27 @@ var Yn = te(
|
|
|
462
463
|
// We have to disable focusOnHover when the popup is closed, otherwise
|
|
463
464
|
// the active item will change to null (the container) when the popup is
|
|
464
465
|
// closed by clicking on an item.
|
|
465
|
-
focusOnHover(
|
|
466
|
-
if (!U(
|
|
466
|
+
focusOnHover(b) {
|
|
467
|
+
if (!U(b)) return !1;
|
|
467
468
|
const O = e == null ? void 0 : e.getState();
|
|
468
469
|
return !!(O != null && O.open);
|
|
469
470
|
}
|
|
470
471
|
})), u;
|
|
471
472
|
}
|
|
472
|
-
),
|
|
473
|
+
), Jn = lt(
|
|
473
474
|
oe(function(n) {
|
|
474
|
-
const o =
|
|
475
|
-
return re(
|
|
475
|
+
const o = Gn(n);
|
|
476
|
+
return re(zn, o);
|
|
476
477
|
})
|
|
477
|
-
),
|
|
478
|
+
), Qn = "div", We = ge(null), Mt = te(
|
|
478
479
|
function(n) {
|
|
479
480
|
var o = n, {
|
|
480
481
|
store: e,
|
|
481
482
|
resetOnEscape: r = !0,
|
|
482
483
|
hideOnEnter: l = !0,
|
|
483
484
|
focusOnMove: a = !0,
|
|
484
|
-
composite:
|
|
485
|
-
alwaysVisible:
|
|
485
|
+
composite: m,
|
|
486
|
+
alwaysVisible: f
|
|
486
487
|
} = o, c = ne(o, [
|
|
487
488
|
"store",
|
|
488
489
|
"resetOnEscape",
|
|
@@ -496,13 +497,13 @@ var Yn = te(
|
|
|
496
497
|
e,
|
|
497
498
|
process.env.NODE_ENV !== "production" && "SelectList must receive a `store` prop or be wrapped in a SelectProvider component."
|
|
498
499
|
);
|
|
499
|
-
const s = Ie(c.id),
|
|
500
|
+
const s = Ie(c.id), v = e.useState("value"), C = Array.isArray(v), [d, p] = de(v), V = e.useState("mounted");
|
|
500
501
|
ae(() => {
|
|
501
|
-
V ||
|
|
502
|
-
}, [V,
|
|
502
|
+
V || p(v);
|
|
503
|
+
}, [V, v]), r = r && !C;
|
|
503
504
|
const y = c.onKeyDown, g = L(r), W = L(l), K = G((_) => {
|
|
504
|
-
y == null || y(_), !_.defaultPrevented && (_.key === "Escape" && g(_) && (e == null || e.setValue(
|
|
505
|
-
}), $ = Ve(je), k = de(), [w, U] = $ || k,
|
|
505
|
+
y == null || y(_), !_.defaultPrevented && (_.key === "Escape" && g(_) && (e == null || e.setValue(d)), (_.key === " " || _.key === "Enter") && ln(_) && W(_) && (_.preventDefault(), e == null || e.hide()));
|
|
506
|
+
}), $ = Ve(je), k = de(), [w, U] = $ || k, b = Ee(
|
|
506
507
|
() => [w, U],
|
|
507
508
|
[w]
|
|
508
509
|
), [O, F] = de(null), B = Ve(We);
|
|
@@ -511,15 +512,15 @@ var Yn = te(
|
|
|
511
512
|
return B(e), () => B(null);
|
|
512
513
|
}, [B, e]), c = he(
|
|
513
514
|
c,
|
|
514
|
-
(_) => /* @__PURE__ */ I(kt, { value: e, children: /* @__PURE__ */ I(We.Provider, { value: F, children: /* @__PURE__ */ I(je.Provider, { value:
|
|
515
|
-
[e,
|
|
515
|
+
(_) => /* @__PURE__ */ I(kt, { value: e, children: /* @__PURE__ */ I(We.Provider, { value: F, children: /* @__PURE__ */ I(je.Provider, { value: b, children: _ }) }) }),
|
|
516
|
+
[e, b]
|
|
516
517
|
);
|
|
517
518
|
const h = !!e.combobox;
|
|
518
|
-
|
|
519
|
-
const [P, S] =
|
|
520
|
-
|
|
521
|
-
), E = ut(P, "role", c.role), z = (
|
|
522
|
-
|
|
519
|
+
m = m ?? (!h && O !== e);
|
|
520
|
+
const [P, S] = rn(
|
|
521
|
+
m ? e.setListElement : null
|
|
522
|
+
), E = ut(P, "role", c.role), z = (m || (E === "listbox" || E === "menu" || E === "tree" || E === "grid")) && C || void 0, X = ht(V, c.hidden, f), fe = X ? R(x({}, c.style), { display: "none" }) : c.style;
|
|
523
|
+
m && (c = x({
|
|
523
524
|
role: "listbox",
|
|
524
525
|
"aria-multiselectable": z
|
|
525
526
|
}, c));
|
|
@@ -537,57 +538,57 @@ var Yn = te(
|
|
|
537
538
|
ref: Ae(S, c.ref),
|
|
538
539
|
style: fe,
|
|
539
540
|
onKeyDown: K
|
|
540
|
-
}), c = St(R(x({ store: e }, c), { composite:
|
|
541
|
+
}), c = St(R(x({ store: e }, c), { composite: m })), c = bt(x({ store: e, typeahead: !h }, c)), c;
|
|
541
542
|
}
|
|
542
|
-
),
|
|
543
|
+
), Xn = oe(function(n) {
|
|
543
544
|
const o = Mt(n);
|
|
544
|
-
return re(
|
|
545
|
-
}),
|
|
545
|
+
return re(Qn, o);
|
|
546
|
+
}), eo = "div", to = te(
|
|
546
547
|
function(n) {
|
|
547
548
|
var o = n, { store: e, alwaysVisible: r } = o, l = ne(o, ["store", "alwaysVisible"]);
|
|
548
549
|
const a = Ne();
|
|
549
|
-
return e = e || a, l = Mt(x({ store: e, alwaysVisible: r }, l)), l =
|
|
550
|
+
return e = e || a, l = Mt(x({ store: e, alwaysVisible: r }, l)), l = gn(x({ store: e, alwaysVisible: r }, l)), l;
|
|
550
551
|
}
|
|
551
|
-
),
|
|
552
|
+
), no = Cn(
|
|
552
553
|
oe(function(n) {
|
|
553
|
-
const o =
|
|
554
|
-
return re(
|
|
554
|
+
const o = to(n);
|
|
555
|
+
return re(eo, o);
|
|
555
556
|
}),
|
|
556
557
|
Ne
|
|
557
558
|
);
|
|
558
|
-
function
|
|
559
|
+
function oo({
|
|
559
560
|
store: t,
|
|
560
561
|
fallback: n,
|
|
561
562
|
children: o
|
|
562
563
|
} = {}) {
|
|
563
564
|
const e = De();
|
|
564
565
|
t = t || e;
|
|
565
|
-
const r =
|
|
566
|
+
const r = Pn(t, (l) => l != null && l.value.length ? l.value : n);
|
|
566
567
|
return o ? o(r || "") : r;
|
|
567
568
|
}
|
|
568
569
|
ge(null);
|
|
569
570
|
ge(
|
|
570
571
|
null
|
|
571
572
|
);
|
|
572
|
-
var
|
|
573
|
+
var ro = Qe(
|
|
573
574
|
[et],
|
|
574
575
|
[Xe]
|
|
575
|
-
),
|
|
576
|
-
function
|
|
576
|
+
), lo = ro.useContext, so = an() && un();
|
|
577
|
+
function ao(t = {}) {
|
|
577
578
|
var n = t, {
|
|
578
579
|
tag: o
|
|
579
580
|
} = n, e = nt(n, [
|
|
580
581
|
"tag"
|
|
581
582
|
]);
|
|
582
|
-
const r = Et(e.store,
|
|
583
|
+
const r = Et(e.store, Vn(o, ["value", "rtl"]));
|
|
583
584
|
Ot(e, r);
|
|
584
|
-
const l = o == null ? void 0 : o.getState(), a = r == null ? void 0 : r.getState(),
|
|
585
|
+
const l = o == null ? void 0 : o.getState(), a = r == null ? void 0 : r.getState(), m = D(
|
|
585
586
|
e.activeId,
|
|
586
587
|
a == null ? void 0 : a.activeId,
|
|
587
588
|
e.defaultActiveId,
|
|
588
589
|
null
|
|
589
|
-
),
|
|
590
|
-
activeId:
|
|
590
|
+
), f = it(ue(Z({}, e), {
|
|
591
|
+
activeId: m,
|
|
591
592
|
includesBaseElement: D(
|
|
592
593
|
e.includesBaseElement,
|
|
593
594
|
a == null ? void 0 : a.includesBaseElement,
|
|
@@ -622,72 +623,72 @@ function so(t = {}) {
|
|
|
622
623
|
l == null ? void 0 : l.values,
|
|
623
624
|
e.defaultSelectedValue,
|
|
624
625
|
""
|
|
625
|
-
),
|
|
626
|
+
), v = Array.isArray(s), C = ue(Z(Z({}, f.getState()), c.getState()), {
|
|
626
627
|
value: u,
|
|
627
628
|
selectedValue: s,
|
|
628
629
|
resetValueOnSelect: D(
|
|
629
630
|
e.resetValueOnSelect,
|
|
630
631
|
a == null ? void 0 : a.resetValueOnSelect,
|
|
631
|
-
|
|
632
|
+
v
|
|
632
633
|
),
|
|
633
634
|
resetValueOnHide: D(
|
|
634
635
|
e.resetValueOnHide,
|
|
635
636
|
a == null ? void 0 : a.resetValueOnHide,
|
|
636
|
-
|
|
637
|
+
v && !o
|
|
637
638
|
),
|
|
638
639
|
activeValue: a == null ? void 0 : a.activeValue
|
|
639
|
-
}),
|
|
640
|
-
return
|
|
641
|
-
|
|
642
|
-
() => Q(
|
|
643
|
-
|
|
640
|
+
}), d = xt(C, f, c, r);
|
|
641
|
+
return so && J(
|
|
642
|
+
d,
|
|
643
|
+
() => Q(d, ["virtualFocus"], () => {
|
|
644
|
+
d.setState("virtualFocus", !1);
|
|
644
645
|
})
|
|
645
|
-
), J(
|
|
646
|
+
), J(d, () => {
|
|
646
647
|
if (o)
|
|
647
|
-
return
|
|
648
|
-
Q(
|
|
649
|
-
Array.isArray(
|
|
648
|
+
return sn(
|
|
649
|
+
Q(d, ["selectedValue"], (p) => {
|
|
650
|
+
Array.isArray(p.selectedValue) && o.setValues(p.selectedValue);
|
|
650
651
|
}),
|
|
651
|
-
Q(o, ["values"], (
|
|
652
|
-
|
|
652
|
+
Q(o, ["values"], (p) => {
|
|
653
|
+
d.setState("selectedValue", p.values);
|
|
653
654
|
})
|
|
654
655
|
);
|
|
655
656
|
}), J(
|
|
656
|
-
|
|
657
|
-
() => Q(
|
|
658
|
-
|
|
657
|
+
d,
|
|
658
|
+
() => Q(d, ["resetValueOnHide", "mounted"], (p) => {
|
|
659
|
+
p.resetValueOnHide && (p.mounted || d.setState("value", u));
|
|
659
660
|
})
|
|
660
661
|
), J(
|
|
661
|
-
|
|
662
|
-
() => Q(
|
|
663
|
-
|
|
662
|
+
d,
|
|
663
|
+
() => Q(d, ["open"], (p) => {
|
|
664
|
+
p.open || (d.setState("activeId", m), d.setState("moves", 0));
|
|
664
665
|
})
|
|
665
666
|
), J(
|
|
666
|
-
|
|
667
|
-
() => Q(
|
|
668
|
-
|
|
667
|
+
d,
|
|
668
|
+
() => Q(d, ["moves", "activeId"], (p, V) => {
|
|
669
|
+
p.moves === V.moves && d.setState("activeValue", void 0);
|
|
669
670
|
})
|
|
670
671
|
), J(
|
|
671
|
-
|
|
672
|
-
() => yt(
|
|
673
|
-
if (
|
|
674
|
-
const { activeId: y } =
|
|
675
|
-
|
|
672
|
+
d,
|
|
673
|
+
() => yt(d, ["moves", "renderedItems"], (p, V) => {
|
|
674
|
+
if (p.moves === V.moves) return;
|
|
675
|
+
const { activeId: y } = d.getState(), g = f.item(y);
|
|
676
|
+
d.setState("activeValue", g == null ? void 0 : g.value);
|
|
676
677
|
})
|
|
677
|
-
), ue(Z(Z(Z({}, c),
|
|
678
|
+
), ue(Z(Z(Z({}, c), f), d), {
|
|
678
679
|
tag: o,
|
|
679
|
-
setValue: (
|
|
680
|
-
resetValue: () =>
|
|
681
|
-
setSelectedValue: (
|
|
680
|
+
setValue: (p) => d.setState("value", p),
|
|
681
|
+
resetValue: () => d.setState("value", C.value),
|
|
682
|
+
setSelectedValue: (p) => d.setState("selectedValue", p)
|
|
682
683
|
});
|
|
683
684
|
}
|
|
684
|
-
function
|
|
685
|
-
const n =
|
|
685
|
+
function uo(t) {
|
|
686
|
+
const n = lo();
|
|
686
687
|
return t = R(x({}, t), {
|
|
687
688
|
tag: t.tag !== void 0 ? t.tag : n
|
|
688
689
|
}), ft(t);
|
|
689
690
|
}
|
|
690
|
-
function
|
|
691
|
+
function io(t, n, o) {
|
|
691
692
|
return Me(n, [o.tag]), be(t, o, "value", "setValue"), be(t, o, "selectedValue", "setSelectedValue"), be(t, o, "resetValueOnHide"), be(t, o, "resetValueOnSelect"), Object.assign(
|
|
692
693
|
pt(
|
|
693
694
|
vt(t, n, o),
|
|
@@ -697,49 +698,49 @@ function uo(t, n, o) {
|
|
|
697
698
|
{ tag: o.tag }
|
|
698
699
|
);
|
|
699
700
|
}
|
|
700
|
-
function
|
|
701
|
-
t =
|
|
702
|
-
const [n, o] = At(
|
|
703
|
-
return
|
|
701
|
+
function co(t = {}) {
|
|
702
|
+
t = uo(t);
|
|
703
|
+
const [n, o] = At(ao, t);
|
|
704
|
+
return io(n, o, t);
|
|
704
705
|
}
|
|
705
|
-
var
|
|
706
|
+
var mo = "input";
|
|
706
707
|
function Ze(t, n, o) {
|
|
707
708
|
if (!o) return !1;
|
|
708
709
|
const e = t.find((r) => !r.disabled && r.value);
|
|
709
710
|
return (e == null ? void 0 : e.value) === n;
|
|
710
711
|
}
|
|
711
712
|
function $e(t, n) {
|
|
712
|
-
return !n || t == null ? !1 : (t =
|
|
713
|
+
return !n || t == null ? !1 : (t = bn(t), n.length > t.length && n.toLowerCase().indexOf(t.toLowerCase()) === 0);
|
|
713
714
|
}
|
|
714
|
-
function
|
|
715
|
+
function fo(t) {
|
|
715
716
|
return t.type === "input";
|
|
716
717
|
}
|
|
717
|
-
function
|
|
718
|
+
function vo(t) {
|
|
718
719
|
return t === "inline" || t === "list" || t === "both" || t === "none";
|
|
719
720
|
}
|
|
720
|
-
function
|
|
721
|
+
function po(t) {
|
|
721
722
|
const n = t.find((o) => {
|
|
722
723
|
var e;
|
|
723
724
|
return o.disabled ? !1 : ((e = o.element) == null ? void 0 : e.getAttribute("role")) !== "tab";
|
|
724
725
|
});
|
|
725
726
|
return n == null ? void 0 : n.id;
|
|
726
727
|
}
|
|
727
|
-
var
|
|
728
|
+
var bo = te(
|
|
728
729
|
function(n) {
|
|
729
730
|
var o = n, {
|
|
730
731
|
store: e,
|
|
731
732
|
focusable: r = !0,
|
|
732
733
|
autoSelect: l = !1,
|
|
733
734
|
getAutoSelectId: a,
|
|
734
|
-
setValueOnChange:
|
|
735
|
-
showMinLength:
|
|
735
|
+
setValueOnChange: m,
|
|
736
|
+
showMinLength: f = 0,
|
|
736
737
|
showOnChange: c,
|
|
737
738
|
showOnMouseDown: u,
|
|
738
739
|
showOnClick: s = u,
|
|
739
|
-
showOnKeyDown:
|
|
740
|
-
showOnKeyPress: C =
|
|
741
|
-
blurActiveItemOnClick:
|
|
742
|
-
setValueOnClick:
|
|
740
|
+
showOnKeyDown: v,
|
|
741
|
+
showOnKeyPress: C = v,
|
|
742
|
+
blurActiveItemOnClick: d,
|
|
743
|
+
setValueOnClick: p = !0,
|
|
743
744
|
moveOnKeyPress: V = !0,
|
|
744
745
|
autoComplete: y = "list"
|
|
745
746
|
} = o, g = ne(o, [
|
|
@@ -764,10 +765,10 @@ var po = te(
|
|
|
764
765
|
e,
|
|
765
766
|
process.env.NODE_ENV !== "production" && "Combobox must receive a `store` prop or be wrapped in a ComboboxProvider component."
|
|
766
767
|
);
|
|
767
|
-
const K = le(null), [$, k] =
|
|
768
|
+
const K = le(null), [$, k] = cn(), w = le(!1), U = le(!1), b = e.useState(
|
|
768
769
|
(i) => i.virtualFocus && l
|
|
769
770
|
), O = y === "inline" || y === "both", [F, B] = de(O);
|
|
770
|
-
|
|
771
|
+
dn(() => {
|
|
771
772
|
O && B(!0);
|
|
772
773
|
}, [O]);
|
|
773
774
|
const h = e.useState("value"), P = le();
|
|
@@ -783,7 +784,7 @@ var po = te(
|
|
|
783
784
|
if (Ze(
|
|
784
785
|
E,
|
|
785
786
|
S,
|
|
786
|
-
|
|
787
|
+
b
|
|
787
788
|
)) {
|
|
788
789
|
if ($e(h, S)) {
|
|
789
790
|
const A = (S == null ? void 0 : S.slice(h.length)) || "";
|
|
@@ -792,7 +793,7 @@ var po = te(
|
|
|
792
793
|
return h;
|
|
793
794
|
}
|
|
794
795
|
return S || h;
|
|
795
|
-
}, [O, F, E, S,
|
|
796
|
+
}, [O, F, E, S, b, h]);
|
|
796
797
|
ae(() => {
|
|
797
798
|
const i = K.current;
|
|
798
799
|
if (!i) return;
|
|
@@ -804,9 +805,9 @@ var po = te(
|
|
|
804
805
|
if (!O || !F || !S || !Ze(
|
|
805
806
|
E,
|
|
806
807
|
S,
|
|
807
|
-
|
|
808
|
+
b
|
|
808
809
|
) || !$e(h, S)) return;
|
|
809
|
-
let A =
|
|
810
|
+
let A = mn;
|
|
810
811
|
return queueMicrotask(() => {
|
|
811
812
|
const N = K.current;
|
|
812
813
|
if (!N) return;
|
|
@@ -823,13 +824,13 @@ var po = te(
|
|
|
823
824
|
F,
|
|
824
825
|
S,
|
|
825
826
|
E,
|
|
826
|
-
|
|
827
|
+
b,
|
|
827
828
|
h
|
|
828
829
|
]);
|
|
829
830
|
const fe = le(null), ie = G(a), _ = le(null);
|
|
830
831
|
ae(() => {
|
|
831
832
|
if (!q || !z) return;
|
|
832
|
-
const i =
|
|
833
|
+
const i = fn(z);
|
|
833
834
|
if (!i) return;
|
|
834
835
|
fe.current = i;
|
|
835
836
|
const A = () => {
|
|
@@ -845,8 +846,8 @@ var po = te(
|
|
|
845
846
|
}, [q, z, e]), ke(() => {
|
|
846
847
|
h && (U.current || (w.current = !0));
|
|
847
848
|
}, [h]), ke(() => {
|
|
848
|
-
|
|
849
|
-
}, [
|
|
849
|
+
b !== "always" && q || (w.current = q);
|
|
850
|
+
}, [b, q]);
|
|
850
851
|
const ve = e.useState("resetValueOnSelect");
|
|
851
852
|
Me(() => {
|
|
852
853
|
var i, A;
|
|
@@ -858,8 +859,8 @@ var po = te(
|
|
|
858
859
|
const H = new MutationObserver(k);
|
|
859
860
|
return H.observe(Y, { attributeFilter: ["data-placing"] }), () => H.disconnect();
|
|
860
861
|
}
|
|
861
|
-
if (
|
|
862
|
-
const H = ie(E), ce = H !== void 0 ? H : (i =
|
|
862
|
+
if (b && N) {
|
|
863
|
+
const H = ie(E), ce = H !== void 0 ? H : (i = po(E)) != null ? i : e.first();
|
|
863
864
|
_.current = ce, e.move(ce ?? null);
|
|
864
865
|
} else {
|
|
865
866
|
const H = (A = e.item(ee || e.first())) == null ? void 0 : A.element;
|
|
@@ -871,7 +872,7 @@ var po = te(
|
|
|
871
872
|
q,
|
|
872
873
|
$,
|
|
873
874
|
h,
|
|
874
|
-
|
|
875
|
+
b,
|
|
875
876
|
ve,
|
|
876
877
|
ie,
|
|
877
878
|
E
|
|
@@ -882,7 +883,7 @@ var po = te(
|
|
|
882
883
|
const A = [i, z].filter(
|
|
883
884
|
(T) => !!T
|
|
884
885
|
), N = (T) => {
|
|
885
|
-
A.every((Y) =>
|
|
886
|
+
A.every((Y) => pn(T, Y)) && (e == null || e.setValue(X));
|
|
886
887
|
};
|
|
887
888
|
for (const T of A)
|
|
888
889
|
T.addEventListener("focusout", N);
|
|
@@ -891,14 +892,14 @@ var po = te(
|
|
|
891
892
|
T.removeEventListener("focusout", N);
|
|
892
893
|
};
|
|
893
894
|
}, [O, z, e, X]);
|
|
894
|
-
const pe = (i) => i.currentTarget.value.length >=
|
|
895
|
+
const pe = (i) => i.currentTarget.value.length >= f, Se = g.onChange, Te = L(c ?? pe), Le = L(
|
|
895
896
|
// If the combobox is combined with tags, the value will be set by the tag
|
|
896
897
|
// input component.
|
|
897
|
-
|
|
898
|
+
m ?? !e.tag
|
|
898
899
|
), Re = G((i) => {
|
|
899
900
|
if (Se == null || Se(i), i.defaultPrevented || !e) return;
|
|
900
901
|
const A = i.currentTarget, { value: N, selectionStart: T, selectionEnd: Y } = A, ee = i.nativeEvent;
|
|
901
|
-
if (w.current = !0,
|
|
902
|
+
if (w.current = !0, fo(ee) && (ee.isComposing && (w.current = !1, U.current = !0), O)) {
|
|
902
903
|
const H = ee.inputType === "insertText" || ee.inputType === "insertCompositionText", ce = T === N.length;
|
|
903
904
|
B(H && ce);
|
|
904
905
|
}
|
|
@@ -906,14 +907,14 @@ var po = te(
|
|
|
906
907
|
const H = N === e.getState().value;
|
|
907
908
|
e.setValue(N), queueMicrotask(() => {
|
|
908
909
|
Pe(A, T, Y);
|
|
909
|
-
}), O &&
|
|
910
|
+
}), O && b && H && k();
|
|
910
911
|
}
|
|
911
|
-
Te(i) && e.show(), (!
|
|
912
|
+
Te(i) && e.show(), (!b || !w.current) && e.setActiveId(null);
|
|
912
913
|
}), we = g.onCompositionEnd, xe = G((i) => {
|
|
913
|
-
w.current = !0, U.current = !1, we == null || we(i), !i.defaultPrevented &&
|
|
914
|
+
w.current = !0, U.current = !1, we == null || we(i), !i.defaultPrevented && b && k();
|
|
914
915
|
}), Ke = g.onMouseDown, Nt = L(
|
|
915
|
-
|
|
916
|
-
), Tt = L(
|
|
916
|
+
d ?? (() => !!(e != null && e.getState().includesBaseElement))
|
|
917
|
+
), Tt = L(p), Lt = L(s ?? pe), Rt = G((i) => {
|
|
917
918
|
Ke == null || Ke(i), !i.defaultPrevented && (i.button || i.ctrlKey || e && (Nt(i) && e.setActiveId(null), Tt(i) && e.setValue(X), Lt(i) && ot(i.currentTarget, "mouseup", e.show)));
|
|
918
919
|
}), He = g.onKeyDown, Kt = L(C ?? pe), Ht = G((i) => {
|
|
919
920
|
if (He == null || He(i), i.repeat || (w.current = !1), i.defaultPrevented || i.ctrlKey || i.altKey || i.shiftKey || i.metaKey || !e) return;
|
|
@@ -921,7 +922,7 @@ var po = te(
|
|
|
921
922
|
A || (i.key === "ArrowUp" || i.key === "ArrowDown") && Kt(i) && (i.preventDefault(), e.show());
|
|
922
923
|
}), Ue = g.onBlur, Ut = G((i) => {
|
|
923
924
|
w.current = !1, Ue == null || Ue(i), i.defaultPrevented;
|
|
924
|
-
}), Ft = Ie(g.id), Bt =
|
|
925
|
+
}), Ft = Ie(g.id), Bt = vo(y) ? y : void 0, jt = e.useState((i) => i.activeId === null);
|
|
925
926
|
return g = R(x({
|
|
926
927
|
id: Ft,
|
|
927
928
|
role: "combobox",
|
|
@@ -944,23 +945,23 @@ var po = te(
|
|
|
944
945
|
}, g), {
|
|
945
946
|
// Enable inline autocomplete when the user moves from the combobox input
|
|
946
947
|
// to an item.
|
|
947
|
-
moveOnKeyPress: (i) =>
|
|
948
|
-
})), g =
|
|
948
|
+
moveOnKeyPress: (i) => vn(V, i) ? !1 : (O && B(!0), !0)
|
|
949
|
+
})), g = En(x({ store: e }, g)), x({ autoComplete: "off" }, g);
|
|
949
950
|
}
|
|
950
|
-
),
|
|
951
|
-
const o =
|
|
952
|
-
return re(
|
|
951
|
+
), ho = oe(function(n) {
|
|
952
|
+
const o = bo(n);
|
|
953
|
+
return re(mo, o);
|
|
953
954
|
});
|
|
954
|
-
function
|
|
955
|
-
const n =
|
|
956
|
-
return /* @__PURE__ */ I(
|
|
955
|
+
function So(t = {}) {
|
|
956
|
+
const n = co(t);
|
|
957
|
+
return /* @__PURE__ */ I(On, { value: n, children: t.children });
|
|
957
958
|
}
|
|
958
|
-
var
|
|
959
|
-
function
|
|
959
|
+
var Co = "div";
|
|
960
|
+
function go(t, n) {
|
|
960
961
|
if (n != null)
|
|
961
962
|
return t == null ? !1 : Array.isArray(t) ? t.includes(n) : t === n;
|
|
962
963
|
}
|
|
963
|
-
function
|
|
964
|
+
function Eo(t) {
|
|
964
965
|
var n;
|
|
965
966
|
return (n = {
|
|
966
967
|
menu: "menuitem",
|
|
@@ -968,19 +969,19 @@ function go(t) {
|
|
|
968
969
|
tree: "treeitem"
|
|
969
970
|
}[t]) != null ? n : "option";
|
|
970
971
|
}
|
|
971
|
-
var
|
|
972
|
+
var Oo = te(
|
|
972
973
|
function(n) {
|
|
973
974
|
var o = n, {
|
|
974
975
|
store: e,
|
|
975
976
|
value: r,
|
|
976
977
|
hideOnClick: l,
|
|
977
978
|
setValueOnClick: a,
|
|
978
|
-
selectValueOnClick:
|
|
979
|
-
resetValueOnSelect:
|
|
979
|
+
selectValueOnClick: m = !0,
|
|
980
|
+
resetValueOnSelect: f,
|
|
980
981
|
focusOnHover: c = !1,
|
|
981
982
|
moveOnKeyPress: u = !0,
|
|
982
983
|
getItem: s
|
|
983
|
-
} = o,
|
|
984
|
+
} = o, v = ne(o, [
|
|
984
985
|
"store",
|
|
985
986
|
"value",
|
|
986
987
|
"hideOnClick",
|
|
@@ -991,18 +992,18 @@ var Eo = te(
|
|
|
991
992
|
"moveOnKeyPress",
|
|
992
993
|
"getItem"
|
|
993
994
|
]), C;
|
|
994
|
-
const
|
|
995
|
-
e = e ||
|
|
995
|
+
const d = Ct();
|
|
996
|
+
e = e || d, me(
|
|
996
997
|
e,
|
|
997
998
|
process.env.NODE_ENV !== "production" && "ComboboxItem must be wrapped in a ComboboxList or ComboboxPopover component."
|
|
998
999
|
);
|
|
999
|
-
const { resetValueOnSelectState:
|
|
1000
|
+
const { resetValueOnSelectState: p, multiSelectable: V, selected: y } = It(e, {
|
|
1000
1001
|
resetValueOnSelectState: "resetValueOnSelect",
|
|
1001
1002
|
multiSelectable(h) {
|
|
1002
1003
|
return Array.isArray(h.selectedValue);
|
|
1003
1004
|
},
|
|
1004
1005
|
selected(h) {
|
|
1005
|
-
return
|
|
1006
|
+
return go(h.selectedValue, r);
|
|
1006
1007
|
}
|
|
1007
1008
|
}), g = Je(
|
|
1008
1009
|
(h) => {
|
|
@@ -1012,35 +1013,35 @@ var Eo = te(
|
|
|
1012
1013
|
[r, s]
|
|
1013
1014
|
);
|
|
1014
1015
|
a = a ?? !V, l = l ?? (r != null && !V);
|
|
1015
|
-
const W =
|
|
1016
|
-
(C =
|
|
1016
|
+
const W = v.onClick, K = L(a), $ = L(m), k = L(
|
|
1017
|
+
(C = f ?? p) != null ? C : V
|
|
1017
1018
|
), w = L(l), U = G((h) => {
|
|
1018
1019
|
W == null || W(h), !h.defaultPrevented && (st(h) || at(h) || (r != null && ($(h) && (k(h) && (e == null || e.resetValue()), e == null || e.setSelectedValue((P) => Array.isArray(P) ? P.includes(r) ? P.filter((S) => S !== r) : [...P, r] : r)), K(h) && (e == null || e.setValue(r))), w(h) && (e == null || e.hide())));
|
|
1019
|
-
}),
|
|
1020
|
-
if (
|
|
1020
|
+
}), b = v.onKeyDown, O = G((h) => {
|
|
1021
|
+
if (b == null || b(h), h.defaultPrevented) return;
|
|
1021
1022
|
const P = e == null ? void 0 : e.getState().baseElement;
|
|
1022
1023
|
if (!P || _e(P)) return;
|
|
1023
|
-
(h.key.length === 1 || h.key === "Backspace" || h.key === "Delete") && (queueMicrotask(() => P.focus()),
|
|
1024
|
+
(h.key.length === 1 || h.key === "Backspace" || h.key === "Delete") && (queueMicrotask(() => P.focus()), hn(P) && (e == null || e.setValue(P.value)));
|
|
1024
1025
|
});
|
|
1025
|
-
V && y != null && (
|
|
1026
|
+
V && y != null && (v = x({
|
|
1026
1027
|
"aria-selected": y
|
|
1027
|
-
},
|
|
1028
|
-
|
|
1029
|
-
(h) => /* @__PURE__ */ I(
|
|
1028
|
+
}, v)), v = he(
|
|
1029
|
+
v,
|
|
1030
|
+
(h) => /* @__PURE__ */ I(xn.Provider, { value: r, children: /* @__PURE__ */ I(yn.Provider, { value: y ?? !1, children: h }) }),
|
|
1030
1031
|
[r, y]
|
|
1031
1032
|
);
|
|
1032
1033
|
const F = Ve(gt);
|
|
1033
|
-
|
|
1034
|
-
role:
|
|
1034
|
+
v = R(x({
|
|
1035
|
+
role: Eo(F),
|
|
1035
1036
|
children: r
|
|
1036
|
-
},
|
|
1037
|
+
}, v), {
|
|
1037
1038
|
onClick: U,
|
|
1038
1039
|
onKeyDown: O
|
|
1039
1040
|
});
|
|
1040
1041
|
const B = L(u);
|
|
1041
|
-
return
|
|
1042
|
+
return v = wt(R(x({
|
|
1042
1043
|
store: e
|
|
1043
|
-
},
|
|
1044
|
+
}, v), {
|
|
1044
1045
|
getItem: g,
|
|
1045
1046
|
// Dispatch a custom event on the combobox input when moving to an item
|
|
1046
1047
|
// with the keyboard so the Combobox component can enable inline
|
|
@@ -1050,26 +1051,26 @@ var Eo = te(
|
|
|
1050
1051
|
const P = new Event("combobox-item-move"), S = e == null ? void 0 : e.getState().baseElement;
|
|
1051
1052
|
return S == null || S.dispatchEvent(P), !0;
|
|
1052
1053
|
}
|
|
1053
|
-
})),
|
|
1054
|
+
})), v = Pt(x({ store: e, focusOnHover: c }, v)), v;
|
|
1054
1055
|
}
|
|
1055
|
-
),
|
|
1056
|
+
), xo = lt(
|
|
1056
1057
|
oe(function(n) {
|
|
1057
|
-
const o =
|
|
1058
|
-
return re(
|
|
1058
|
+
const o = Oo(n);
|
|
1059
|
+
return re(Co, o);
|
|
1059
1060
|
})
|
|
1060
|
-
),
|
|
1061
|
+
), yo = "div", Ao = te(
|
|
1061
1062
|
function(n) {
|
|
1062
1063
|
var o = n, { store: e, alwaysVisible: r } = o, l = ne(o, ["store", "alwaysVisible"]);
|
|
1063
|
-
const a = Ct(!0),
|
|
1064
|
-
e = e ||
|
|
1065
|
-
const
|
|
1064
|
+
const a = Ct(!0), m = An();
|
|
1065
|
+
e = e || m;
|
|
1066
|
+
const f = !!e && e === a;
|
|
1066
1067
|
me(
|
|
1067
1068
|
e,
|
|
1068
1069
|
process.env.NODE_ENV !== "production" && "ComboboxList must receive a `store` prop or be wrapped in a ComboboxProvider component."
|
|
1069
1070
|
);
|
|
1070
|
-
const c = le(null), u = Ie(l.id), s = e.useState("mounted"),
|
|
1071
|
+
const c = le(null), u = Ie(l.id), s = e.useState("mounted"), v = ht(s, l.hidden, r), C = v ? R(x({}, l.style), { display: "none" }) : l.style, d = e.useState(
|
|
1071
1072
|
(k) => Array.isArray(k.selectedValue)
|
|
1072
|
-
),
|
|
1073
|
+
), p = ut(c, "role", l.role), y = (p === "listbox" || p === "tree" || p === "grid") && d || void 0, [g, W] = de(!1), K = e.useState("contentElement");
|
|
1073
1074
|
ke(() => {
|
|
1074
1075
|
if (!s) return;
|
|
1075
1076
|
const k = c.current;
|
|
@@ -1087,23 +1088,23 @@ var Eo = te(
|
|
|
1087
1088
|
"aria-multiselectable": y
|
|
1088
1089
|
}, l)), l = he(
|
|
1089
1090
|
l,
|
|
1090
|
-
(k) => /* @__PURE__ */ I(
|
|
1091
|
-
[e,
|
|
1091
|
+
(k) => /* @__PURE__ */ I(In, { value: e, children: /* @__PURE__ */ I(gt.Provider, { value: p, children: k }) }),
|
|
1092
|
+
[e, p]
|
|
1092
1093
|
);
|
|
1093
|
-
const $ = u && (!a || !
|
|
1094
|
+
const $ = u && (!a || !f) ? e.setContentElement : null;
|
|
1094
1095
|
return l = R(x({
|
|
1095
1096
|
id: u,
|
|
1096
|
-
hidden:
|
|
1097
|
+
hidden: v
|
|
1097
1098
|
}, l), {
|
|
1098
1099
|
ref: Ae($, c, l.ref),
|
|
1099
1100
|
style: C
|
|
1100
1101
|
}), tt(l);
|
|
1101
1102
|
}
|
|
1102
|
-
),
|
|
1103
|
-
const o =
|
|
1104
|
-
return re(
|
|
1103
|
+
), Io = oe(function(n) {
|
|
1104
|
+
const o = Ao(n);
|
|
1105
|
+
return re(yo, o);
|
|
1105
1106
|
}), Ce = { exports: {} }, qe;
|
|
1106
|
-
function
|
|
1107
|
+
function wo() {
|
|
1107
1108
|
if (qe) return Ce.exports;
|
|
1108
1109
|
qe = 1;
|
|
1109
1110
|
var t = {
|
|
@@ -1567,18 +1568,18 @@ function Io() {
|
|
|
1567
1568
|
ё: "е",
|
|
1568
1569
|
Ё: "Е"
|
|
1569
1570
|
}, n = Object.keys(t).join("|"), o = new RegExp(n, "g"), e = new RegExp(n, "");
|
|
1570
|
-
function r(
|
|
1571
|
-
return t[
|
|
1571
|
+
function r(m) {
|
|
1572
|
+
return t[m];
|
|
1572
1573
|
}
|
|
1573
|
-
var l = function(
|
|
1574
|
-
return
|
|
1575
|
-
}, a = function(
|
|
1576
|
-
return !!
|
|
1574
|
+
var l = function(m) {
|
|
1575
|
+
return m.replace(o, r);
|
|
1576
|
+
}, a = function(m) {
|
|
1577
|
+
return !!m.match(e);
|
|
1577
1578
|
};
|
|
1578
1579
|
return Ce.exports = l, Ce.exports.has = a, Ce.exports.remove = l, Ce.exports;
|
|
1579
1580
|
}
|
|
1580
|
-
var
|
|
1581
|
-
const
|
|
1581
|
+
var Po = wo();
|
|
1582
|
+
const Vo = /* @__PURE__ */ Gt(Po);
|
|
1582
1583
|
/**
|
|
1583
1584
|
* @name match-sorter
|
|
1584
1585
|
* @license MIT license.
|
|
@@ -1594,35 +1595,35 @@ const j = {
|
|
|
1594
1595
|
ACRONYM: 2,
|
|
1595
1596
|
MATCHES: 1,
|
|
1596
1597
|
NO_MATCH: 0
|
|
1597
|
-
},
|
|
1598
|
+
}, ko = (t, n) => String(t.rankedValue).localeCompare(String(n.rankedValue));
|
|
1598
1599
|
function Dt(t, n, o) {
|
|
1599
1600
|
o === void 0 && (o = {});
|
|
1600
1601
|
const {
|
|
1601
1602
|
keys: e,
|
|
1602
1603
|
threshold: r = j.MATCHES,
|
|
1603
|
-
baseSort: l =
|
|
1604
|
-
sorter: a = (c) => c.sort((u, s) =>
|
|
1605
|
-
} = o,
|
|
1606
|
-
return a(
|
|
1604
|
+
baseSort: l = ko,
|
|
1605
|
+
sorter: a = (c) => c.sort((u, s) => No(u, s, l))
|
|
1606
|
+
} = o, m = t.reduce(f, []);
|
|
1607
|
+
return a(m).map((c) => {
|
|
1607
1608
|
let {
|
|
1608
1609
|
item: u
|
|
1609
1610
|
} = c;
|
|
1610
1611
|
return u;
|
|
1611
1612
|
});
|
|
1612
|
-
function
|
|
1613
|
-
const
|
|
1613
|
+
function f(c, u, s) {
|
|
1614
|
+
const v = _o(u, e, n, o), {
|
|
1614
1615
|
rank: C,
|
|
1615
|
-
keyThreshold:
|
|
1616
|
-
} =
|
|
1617
|
-
return C >=
|
|
1618
|
-
...
|
|
1616
|
+
keyThreshold: d = r
|
|
1617
|
+
} = v;
|
|
1618
|
+
return C >= d && c.push({
|
|
1619
|
+
...v,
|
|
1619
1620
|
item: u,
|
|
1620
1621
|
index: s
|
|
1621
1622
|
}), c;
|
|
1622
1623
|
}
|
|
1623
1624
|
}
|
|
1624
1625
|
Dt.rankings = j;
|
|
1625
|
-
function
|
|
1626
|
+
function _o(t, n, o, e) {
|
|
1626
1627
|
if (!n) {
|
|
1627
1628
|
const l = t;
|
|
1628
1629
|
return {
|
|
@@ -1633,24 +1634,24 @@ function ko(t, n, o, e) {
|
|
|
1633
1634
|
keyThreshold: e.threshold
|
|
1634
1635
|
};
|
|
1635
1636
|
}
|
|
1636
|
-
return
|
|
1637
|
+
return Ro(t, n).reduce((l, a, m) => {
|
|
1637
1638
|
let {
|
|
1638
|
-
rank:
|
|
1639
|
+
rank: f,
|
|
1639
1640
|
rankedValue: c,
|
|
1640
1641
|
keyIndex: u,
|
|
1641
1642
|
keyThreshold: s
|
|
1642
1643
|
} = l, {
|
|
1643
|
-
itemValue:
|
|
1644
|
+
itemValue: v,
|
|
1644
1645
|
attributes: C
|
|
1645
|
-
} = a,
|
|
1646
|
+
} = a, d = ze(v, o, e), p = c;
|
|
1646
1647
|
const {
|
|
1647
1648
|
minRanking: V,
|
|
1648
1649
|
maxRanking: y,
|
|
1649
1650
|
threshold: g
|
|
1650
1651
|
} = C;
|
|
1651
|
-
return
|
|
1652
|
-
rankedValue:
|
|
1653
|
-
rank:
|
|
1652
|
+
return d < V && d >= j.MATCHES ? d = V : d > y && (d = y), d > f && (f = d, u = m, s = g, p = v), {
|
|
1653
|
+
rankedValue: p,
|
|
1654
|
+
rank: f,
|
|
1654
1655
|
keyIndex: u,
|
|
1655
1656
|
keyThreshold: s
|
|
1656
1657
|
};
|
|
@@ -1662,9 +1663,9 @@ function ko(t, n, o, e) {
|
|
|
1662
1663
|
});
|
|
1663
1664
|
}
|
|
1664
1665
|
function ze(t, n, o) {
|
|
1665
|
-
return t = Ye(t, o), n = Ye(n, o), n.length > t.length ? j.NO_MATCH : t === n ? j.CASE_SENSITIVE_EQUAL : (t = t.toLowerCase(), n = n.toLowerCase(), t === n ? j.EQUAL : t.startsWith(n) ? j.STARTS_WITH : t.includes(` ${n}`) ? j.WORD_STARTS_WITH : t.includes(n) ? j.CONTAINS : n.length === 1 ? j.NO_MATCH :
|
|
1666
|
+
return t = Ye(t, o), n = Ye(n, o), n.length > t.length ? j.NO_MATCH : t === n ? j.CASE_SENSITIVE_EQUAL : (t = t.toLowerCase(), n = n.toLowerCase(), t === n ? j.EQUAL : t.startsWith(n) ? j.STARTS_WITH : t.includes(` ${n}`) ? j.WORD_STARTS_WITH : t.includes(n) ? j.CONTAINS : n.length === 1 ? j.NO_MATCH : Mo(t).includes(n) ? j.ACRONYM : Do(t, n));
|
|
1666
1667
|
}
|
|
1667
|
-
function
|
|
1668
|
+
function Mo(t) {
|
|
1668
1669
|
let n = "";
|
|
1669
1670
|
return t.split(" ").forEach((e) => {
|
|
1670
1671
|
e.split("-").forEach((l) => {
|
|
@@ -1672,47 +1673,47 @@ function _o(t) {
|
|
|
1672
1673
|
});
|
|
1673
1674
|
}), n;
|
|
1674
1675
|
}
|
|
1675
|
-
function
|
|
1676
|
+
function Do(t, n) {
|
|
1676
1677
|
let o = 0, e = 0;
|
|
1677
|
-
function r(
|
|
1678
|
-
for (let s = u,
|
|
1679
|
-
if (c[s] ===
|
|
1678
|
+
function r(f, c, u) {
|
|
1679
|
+
for (let s = u, v = c.length; s < v; s++)
|
|
1680
|
+
if (c[s] === f)
|
|
1680
1681
|
return o += 1, s + 1;
|
|
1681
1682
|
return -1;
|
|
1682
1683
|
}
|
|
1683
|
-
function l(
|
|
1684
|
-
const c = 1 /
|
|
1684
|
+
function l(f) {
|
|
1685
|
+
const c = 1 / f, u = o / n.length;
|
|
1685
1686
|
return j.MATCHES + u * c;
|
|
1686
1687
|
}
|
|
1687
1688
|
const a = r(n[0], t, 0);
|
|
1688
1689
|
if (a < 0)
|
|
1689
1690
|
return j.NO_MATCH;
|
|
1690
1691
|
e = a;
|
|
1691
|
-
for (let
|
|
1692
|
-
const u = n[
|
|
1692
|
+
for (let f = 1, c = n.length; f < c; f++) {
|
|
1693
|
+
const u = n[f];
|
|
1693
1694
|
if (e = r(u, t, e), !(e > -1))
|
|
1694
1695
|
return j.NO_MATCH;
|
|
1695
1696
|
}
|
|
1696
|
-
const
|
|
1697
|
-
return l(
|
|
1697
|
+
const m = e - a;
|
|
1698
|
+
return l(m);
|
|
1698
1699
|
}
|
|
1699
|
-
function
|
|
1700
|
+
function No(t, n, o) {
|
|
1700
1701
|
const {
|
|
1701
1702
|
rank: l,
|
|
1702
1703
|
keyIndex: a
|
|
1703
1704
|
} = t, {
|
|
1704
|
-
rank:
|
|
1705
|
-
keyIndex:
|
|
1705
|
+
rank: m,
|
|
1706
|
+
keyIndex: f
|
|
1706
1707
|
} = n;
|
|
1707
|
-
return l ===
|
|
1708
|
+
return l === m ? a === f ? o(t, n) : a < f ? -1 : 1 : l > m ? -1 : 1;
|
|
1708
1709
|
}
|
|
1709
1710
|
function Ye(t, n) {
|
|
1710
1711
|
let {
|
|
1711
1712
|
keepDiacritics: o
|
|
1712
1713
|
} = n;
|
|
1713
|
-
return t = `${t}`, o || (t =
|
|
1714
|
+
return t = `${t}`, o || (t = Vo(t)), t;
|
|
1714
1715
|
}
|
|
1715
|
-
function
|
|
1716
|
+
function To(t, n) {
|
|
1716
1717
|
typeof n == "object" && (n = n.key);
|
|
1717
1718
|
let o;
|
|
1718
1719
|
if (typeof n == "function")
|
|
@@ -1723,36 +1724,36 @@ function No(t, n) {
|
|
|
1723
1724
|
o = t[n];
|
|
1724
1725
|
else {
|
|
1725
1726
|
if (n.includes("."))
|
|
1726
|
-
return
|
|
1727
|
+
return Lo(n, t);
|
|
1727
1728
|
o = null;
|
|
1728
1729
|
}
|
|
1729
1730
|
return o == null ? [] : Array.isArray(o) ? o : [String(o)];
|
|
1730
1731
|
}
|
|
1731
|
-
function
|
|
1732
|
+
function Lo(t, n) {
|
|
1732
1733
|
const o = t.split(".");
|
|
1733
1734
|
let e = [n];
|
|
1734
1735
|
for (let r = 0, l = o.length; r < l; r++) {
|
|
1735
1736
|
const a = o[r];
|
|
1736
|
-
let
|
|
1737
|
-
for (let
|
|
1738
|
-
const u = e[
|
|
1737
|
+
let m = [];
|
|
1738
|
+
for (let f = 0, c = e.length; f < c; f++) {
|
|
1739
|
+
const u = e[f];
|
|
1739
1740
|
if (u != null)
|
|
1740
1741
|
if (Object.hasOwnProperty.call(u, a)) {
|
|
1741
1742
|
const s = u[a];
|
|
1742
|
-
s != null &&
|
|
1743
|
-
} else a === "*" && (
|
|
1743
|
+
s != null && m.push(s);
|
|
1744
|
+
} else a === "*" && (m = m.concat(u));
|
|
1744
1745
|
}
|
|
1745
|
-
e =
|
|
1746
|
+
e = m;
|
|
1746
1747
|
}
|
|
1747
1748
|
return Array.isArray(e[0]) ? [].concat(...e) : e;
|
|
1748
1749
|
}
|
|
1749
|
-
function
|
|
1750
|
+
function Ro(t, n) {
|
|
1750
1751
|
const o = [];
|
|
1751
1752
|
for (let e = 0, r = n.length; e < r; e++) {
|
|
1752
|
-
const l = n[e], a =
|
|
1753
|
-
for (let
|
|
1753
|
+
const l = n[e], a = Ko(l), m = To(t, l);
|
|
1754
|
+
for (let f = 0, c = m.length; f < c; f++)
|
|
1754
1755
|
o.push({
|
|
1755
|
-
itemValue: f
|
|
1756
|
+
itemValue: m[f],
|
|
1756
1757
|
attributes: a
|
|
1757
1758
|
});
|
|
1758
1759
|
}
|
|
@@ -1762,47 +1763,49 @@ const Ge = {
|
|
|
1762
1763
|
maxRanking: 1 / 0,
|
|
1763
1764
|
minRanking: -1 / 0
|
|
1764
1765
|
};
|
|
1765
|
-
function
|
|
1766
|
+
function Ko(t) {
|
|
1766
1767
|
return typeof t == "string" ? Ge : {
|
|
1767
1768
|
...Ge,
|
|
1768
1769
|
...t
|
|
1769
1770
|
};
|
|
1770
1771
|
}
|
|
1771
|
-
const
|
|
1772
|
-
const { baseProps: n, controlProps: o } =
|
|
1772
|
+
const Jo = (t) => {
|
|
1773
|
+
const { baseProps: n, controlProps: o } = Qt(t, {
|
|
1773
1774
|
className: "component-select-control"
|
|
1774
1775
|
}), [e, r] = de(""), {
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
...
|
|
1779
|
-
|
|
1780
|
-
|
|
1776
|
+
value: l,
|
|
1777
|
+
onChangeValue: a = $t,
|
|
1778
|
+
options: m,
|
|
1779
|
+
placeholder: f = "Choose an option...",
|
|
1780
|
+
searchable: c = !1,
|
|
1781
|
+
...u
|
|
1782
|
+
} = o, s = (m || []).map(Zt), v = Ee(() => Dt(s, e, {
|
|
1783
|
+
baseSort: (d, p) => d.index < p.index ? -1 : 1,
|
|
1781
1784
|
keys: ["label", "description"]
|
|
1782
|
-
}), [e]),
|
|
1785
|
+
}), [e]), C = c ? Io : Xn;
|
|
1783
1786
|
return /* @__PURE__ */ I(
|
|
1784
|
-
|
|
1787
|
+
So,
|
|
1785
1788
|
{
|
|
1786
1789
|
resetValueOnHide: !0,
|
|
1787
1790
|
setValue: (d) => {
|
|
1788
|
-
|
|
1791
|
+
zt(() => {
|
|
1789
1792
|
r(d);
|
|
1790
1793
|
});
|
|
1791
1794
|
},
|
|
1792
|
-
children: /* @__PURE__ */ I(
|
|
1795
|
+
children: /* @__PURE__ */ I(qn, { value: l, setValue: a, children: /* @__PURE__ */ se(Jt, { ...n, children: [
|
|
1793
1796
|
/* @__PURE__ */ se(
|
|
1794
|
-
|
|
1797
|
+
$n,
|
|
1795
1798
|
{
|
|
1796
1799
|
className: "component-select-control__input",
|
|
1797
|
-
...
|
|
1800
|
+
...u,
|
|
1798
1801
|
children: [
|
|
1799
|
-
/* @__PURE__ */ I("div", { className: "component-select-control__value", children: /* @__PURE__ */ I(
|
|
1800
|
-
/* @__PURE__ */ I("div", { className: "component-select-control__caret", children: /* @__PURE__ */ I(
|
|
1802
|
+
/* @__PURE__ */ I("div", { className: "component-select-control__value", children: /* @__PURE__ */ I(oo, { fallback: f }) }),
|
|
1803
|
+
/* @__PURE__ */ I("div", { className: "component-select-control__caret", children: /* @__PURE__ */ I(qt, {}) })
|
|
1801
1804
|
]
|
|
1802
1805
|
}
|
|
1803
1806
|
),
|
|
1804
1807
|
/* @__PURE__ */ se(
|
|
1805
|
-
|
|
1808
|
+
no,
|
|
1806
1809
|
{
|
|
1807
1810
|
className: "component-select-control__popover",
|
|
1808
1811
|
wrapperProps: {
|
|
@@ -1818,12 +1821,12 @@ const Yo = (t) => {
|
|
|
1818
1821
|
"div",
|
|
1819
1822
|
{
|
|
1820
1823
|
className: "component-select-control__popover__search-wrapper",
|
|
1821
|
-
inert: !
|
|
1822
|
-
hidden: !
|
|
1824
|
+
inert: !c,
|
|
1825
|
+
hidden: !c,
|
|
1823
1826
|
children: [
|
|
1824
1827
|
/* @__PURE__ */ I(Vt, { className: "component-select-control__popover__search-icon" }),
|
|
1825
1828
|
/* @__PURE__ */ I(
|
|
1826
|
-
|
|
1829
|
+
ho,
|
|
1827
1830
|
{
|
|
1828
1831
|
autoSelect: !0,
|
|
1829
1832
|
placeholder: "Search...",
|
|
@@ -1833,13 +1836,13 @@ const Yo = (t) => {
|
|
|
1833
1836
|
]
|
|
1834
1837
|
}
|
|
1835
1838
|
),
|
|
1836
|
-
/* @__PURE__ */ I(
|
|
1837
|
-
|
|
1839
|
+
/* @__PURE__ */ I(C, { className: "component-select-control__list", children: v.map((d) => /* @__PURE__ */ se(
|
|
1840
|
+
Jn,
|
|
1838
1841
|
{
|
|
1839
1842
|
disabled: d.disabled,
|
|
1840
1843
|
value: d.value,
|
|
1841
1844
|
className: "component-select-control__option",
|
|
1842
|
-
render: /* @__PURE__ */ I(
|
|
1845
|
+
render: /* @__PURE__ */ I(xo, {}),
|
|
1843
1846
|
children: [
|
|
1844
1847
|
/* @__PURE__ */ I("div", { className: "component-select-control__option__label", children: d.label }),
|
|
1845
1848
|
d.description && /* @__PURE__ */ I("div", { className: "component-select-control__option__description", children: d.description })
|
|
@@ -1855,5 +1858,5 @@ const Yo = (t) => {
|
|
|
1855
1858
|
);
|
|
1856
1859
|
};
|
|
1857
1860
|
export {
|
|
1858
|
-
|
|
1861
|
+
Jo as SelectControl
|
|
1859
1862
|
};
|