@commercetools/nimbus 0.0.0-canary-20260121165837 → 0.0.0-canary-20260122140009
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/chunks/{combobox-vjauyzlS.es.js → combobox-CMm8VWO_.es.js} +334 -328
- package/dist/chunks/combobox-CMm8VWO_.es.js.map +1 -0
- package/dist/chunks/combobox-j72jsIF_.cjs.js +2 -0
- package/dist/chunks/combobox-j72jsIF_.cjs.js.map +1 -0
- package/dist/chunks/{data-table-DA4SdIgU.es.js → data-table-1TdJ0lRB.es.js} +943 -923
- package/dist/chunks/{data-table-DA4SdIgU.es.js.map → data-table-1TdJ0lRB.es.js.map} +1 -1
- package/dist/chunks/data-table-DBUyENHz.cjs.js +2 -0
- package/dist/chunks/{data-table-CBZLbe9h.cjs.js.map → data-table-DBUyENHz.cjs.js.map} +1 -1
- package/dist/chunks/tabs-B0gwV57F.cjs.js +2 -0
- package/dist/chunks/{tabs-iV08OTqG.cjs.js.map → tabs-B0gwV57F.cjs.js.map} +1 -1
- package/dist/chunks/{tabs-D0OPeQ_J.es.js → tabs-D-DgDmHo.es.js} +37 -32
- package/dist/chunks/{tabs-D0OPeQ_J.es.js.map → tabs-D-DgDmHo.es.js.map} +1 -1
- package/dist/components/combo-box/combo-box.messages.d.ts +1 -1
- package/dist/components/combo-box/intl/de.d.ts +1 -3
- package/dist/components/combo-box/intl/en.d.ts +1 -3
- package/dist/components/combo-box/intl/es.d.ts +1 -3
- package/dist/components/combo-box/intl/fr-FR.d.ts +1 -3
- package/dist/components/combo-box/intl/pt-BR.d.ts +1 -3
- package/dist/components/combobox.cjs +1 -1
- package/dist/components/combobox.es.js +1 -1
- package/dist/components/data-table/components/data-table.body.d.ts +1 -1
- package/dist/components/data-table/components/data-table.header.d.ts +1 -1
- package/dist/components/data-table/components/data-table.table.d.ts +1 -1
- package/dist/components/data-table/data-table.d.ts +3 -3
- package/dist/components/data-table/data-table.i18n.d.ts +5 -0
- package/dist/components/data-table/data-table.messages.d.ts +1 -1
- package/dist/components/data-table/intl/de.d.ts +1 -0
- package/dist/components/data-table/intl/en.d.ts +1 -0
- package/dist/components/data-table/intl/es.d.ts +1 -0
- package/dist/components/data-table/intl/fr-FR.d.ts +1 -0
- package/dist/components/data-table/intl/pt-BR.d.ts +1 -0
- package/dist/components/data-table.cjs +1 -1
- package/dist/components/data-table.es.js +1 -1
- package/dist/components/tabs/components/tabs.root.d.ts +1 -1
- package/dist/components/tabs/tabs.d.ts +1 -1
- package/dist/components/tabs/tabs.types.d.ts +5 -0
- package/dist/components/tabs.cjs +1 -1
- package/dist/components/tabs.es.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.es.js +3 -3
- package/package.json +5 -5
- package/dist/chunks/combobox-B7ck7gxL.cjs.js +0 -2
- package/dist/chunks/combobox-B7ck7gxL.cjs.js.map +0 -1
- package/dist/chunks/combobox-vjauyzlS.es.js.map +0 -1
- package/dist/chunks/data-table-CBZLbe9h.cjs.js +0 -2
- package/dist/chunks/tabs-iV08OTqG.cjs.js +0 -2
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx as g, jsxs as
|
|
2
|
-
import { useReducer as St, useRef as A, useEffect as
|
|
1
|
+
import { jsx as g, jsxs as xe, Fragment as He } from "react/jsx-runtime";
|
|
2
|
+
import { useReducer as St, useRef as A, useEffect as Z, createContext as Qe, useMemo as ee, useContext as Pe, useState as _, useCallback as R, isValidElement as wt, cloneElement as $t } from "react";
|
|
3
3
|
import { d as Kt } from "./Header-CiYtrnTw.es.js";
|
|
4
4
|
import { $ as Xe, a as It, b as Bt, c as Mt, d as At } from "./ListBox-RrHJjnuq.es.js";
|
|
5
5
|
import { f as Ft, g as Ot } from "./CollectionBuilder-BOe312C_.es.js";
|
|
6
6
|
import { createSlotRecipeContext as Vt } from "@chakra-ui/react";
|
|
7
7
|
import { Close as Lt, KeyboardArrowDown as Tt, Check as Et } from "@commercetools/nimbus-icons";
|
|
8
|
-
import { e as
|
|
8
|
+
import { e as me } from "./extract-style-props-BdibuNZ7.es.js";
|
|
9
9
|
import { P as Rt } from "./popover-CuA9VugH.es.js";
|
|
10
10
|
import { I as Ue } from "./icon-button-CosIm3oY.es.js";
|
|
11
11
|
import { L as Pt } from "./loading-spinner-gf62wtm3.es.js";
|
|
12
|
-
import { $ as
|
|
12
|
+
import { $ as Be, a as Dt } from "./Input-Cmg08oRP.es.js";
|
|
13
13
|
import { $ as De, T as Te } from "./tag-group-BE8d6xcP.es.js";
|
|
14
14
|
import { useSlotRecipe as zt } from "@chakra-ui/react/styled-system";
|
|
15
15
|
import { b as Nt } from "./RSPContexts-DLgb84PF.es.js";
|
|
@@ -19,7 +19,7 @@ import { a as Wt } from "./Group-BQc9LuMT.es.js";
|
|
|
19
19
|
import { $ as Gt } from "./Label-DIseLESi.es.js";
|
|
20
20
|
import { h as qt } from "./Dialog-B0BQfdQa.es.js";
|
|
21
21
|
import { $ as jt } from "./Text-DOcU1ycg.es.js";
|
|
22
|
-
import { n as
|
|
22
|
+
import { n as he, u as Ht } from "./normalize-messages-D5T4I93D.es.js";
|
|
23
23
|
import { $ as Ut } from "./useListData-CX8_NxJv.es.js";
|
|
24
24
|
import { a as Je } from "./mergeProps-Dsl8k3Ig.es.js";
|
|
25
25
|
import { a as Jt } from "./useListState-Dd0Mtev3.es.js";
|
|
@@ -110,12 +110,12 @@ function Qt(e, t) {
|
|
|
110
110
|
case "loadingMore":
|
|
111
111
|
switch (t.type) {
|
|
112
112
|
case "success":
|
|
113
|
-
var
|
|
113
|
+
var m;
|
|
114
114
|
r = e.selectedKeys === "all" || t.selectedKeys === "all" ? "all" : /* @__PURE__ */ new Set([
|
|
115
115
|
...e.selectedKeys,
|
|
116
|
-
...(
|
|
116
|
+
...(m = t.selectedKeys) !== null && m !== void 0 ? m : []
|
|
117
117
|
]);
|
|
118
|
-
var K,
|
|
118
|
+
var K, L;
|
|
119
119
|
return {
|
|
120
120
|
...e,
|
|
121
121
|
state: "idle",
|
|
@@ -124,7 +124,7 @@ function Qt(e, t) {
|
|
|
124
124
|
...(K = t.items) !== null && K !== void 0 ? K : []
|
|
125
125
|
],
|
|
126
126
|
selectedKeys: r,
|
|
127
|
-
sortDescriptor: (
|
|
127
|
+
sortDescriptor: (L = t.sortDescriptor) !== null && L !== void 0 ? L : e.sortDescriptor,
|
|
128
128
|
abortController: void 0,
|
|
129
129
|
cursor: t.cursor
|
|
130
130
|
};
|
|
@@ -175,20 +175,20 @@ function Xt(e) {
|
|
|
175
175
|
filterText: c
|
|
176
176
|
});
|
|
177
177
|
const b = async (d, w) => {
|
|
178
|
-
let
|
|
178
|
+
let m = new AbortController();
|
|
179
179
|
try {
|
|
180
180
|
u({
|
|
181
181
|
...d,
|
|
182
|
-
abortController:
|
|
182
|
+
abortController: m
|
|
183
183
|
});
|
|
184
184
|
var K;
|
|
185
185
|
let y = (K = d.filterText) !== null && K !== void 0 ? K : l.filterText;
|
|
186
|
-
var
|
|
186
|
+
var L;
|
|
187
187
|
let F = await w({
|
|
188
188
|
items: l.items.slice(),
|
|
189
189
|
selectedKeys: l.selectedKeys,
|
|
190
|
-
sortDescriptor: (
|
|
191
|
-
signal:
|
|
190
|
+
sortDescriptor: (L = d.sortDescriptor) !== null && L !== void 0 ? L : l.sortDescriptor,
|
|
191
|
+
signal: m.signal,
|
|
192
192
|
cursor: d.type === "loadingMore" ? l.cursor : void 0,
|
|
193
193
|
filterText: y,
|
|
194
194
|
loadingState: l.state
|
|
@@ -198,8 +198,8 @@ function Xt(e) {
|
|
|
198
198
|
u({
|
|
199
199
|
type: "success",
|
|
200
200
|
...F,
|
|
201
|
-
abortController:
|
|
202
|
-
}), $ && $ !== y && !
|
|
201
|
+
abortController: m
|
|
202
|
+
}), $ && $ !== y && !m.signal.aborted && b({
|
|
203
203
|
type: "filtering",
|
|
204
204
|
filterText: $
|
|
205
205
|
}, t);
|
|
@@ -207,12 +207,12 @@ function Xt(e) {
|
|
|
207
207
|
u({
|
|
208
208
|
type: "error",
|
|
209
209
|
error: y,
|
|
210
|
-
abortController:
|
|
210
|
+
abortController: m
|
|
211
211
|
});
|
|
212
212
|
}
|
|
213
213
|
};
|
|
214
214
|
let h = A(!1);
|
|
215
|
-
return
|
|
215
|
+
return Z(() => {
|
|
216
216
|
h.current || (b({
|
|
217
217
|
type: "loading"
|
|
218
218
|
}, t), h.current = !0);
|
|
@@ -263,63 +263,63 @@ function Xt(e) {
|
|
|
263
263
|
}
|
|
264
264
|
const Yt = /* @__PURE__ */ Qe(null);
|
|
265
265
|
function Zt(e, t, r, s) {
|
|
266
|
-
var o = this, n = A(null), c = A(0), l = A(0), u = A(null), b = A([]), h = A(), d = A(), w = A(e),
|
|
266
|
+
var o = this, n = A(null), c = A(0), l = A(0), u = A(null), b = A([]), h = A(), d = A(), w = A(e), m = A(!0), K = A(), L = A();
|
|
267
267
|
w.current = e;
|
|
268
268
|
var I = typeof window < "u", y = !t && t !== 0 && I;
|
|
269
269
|
if (typeof e != "function") throw new TypeError("Expected a function");
|
|
270
270
|
t = +t || 0;
|
|
271
|
-
var F = !!(r = r || {}).leading, $ = !("trailing" in r) || !!r.trailing,
|
|
271
|
+
var F = !!(r = r || {}).leading, $ = !("trailing" in r) || !!r.trailing, U = !!r.flushOnExit && $, J = "maxWait" in r, j = "debounceOnServer" in r && !!r.debounceOnServer, Q = J ? Math.max(+r.maxWait || 0, t) : null, se = ee(function() {
|
|
272
272
|
var P = function(x) {
|
|
273
273
|
var O = b.current, D = h.current;
|
|
274
274
|
return b.current = h.current = null, c.current = x, l.current = l.current || x, d.current = w.current.apply(D, O);
|
|
275
|
-
},
|
|
275
|
+
}, X = function(x, O) {
|
|
276
276
|
y && cancelAnimationFrame(u.current), u.current = y ? requestAnimationFrame(x) : setTimeout(x, O);
|
|
277
|
-
}, se = function(x) {
|
|
278
|
-
if (!p.current) return !1;
|
|
279
|
-
var O = x - n.current;
|
|
280
|
-
return !n.current || O >= t || O < 0 || U && x - c.current >= J;
|
|
281
277
|
}, le = function(x) {
|
|
278
|
+
if (!m.current) return !1;
|
|
279
|
+
var O = x - n.current;
|
|
280
|
+
return !n.current || O >= t || O < 0 || J && x - c.current >= Q;
|
|
281
|
+
}, ie = function(x) {
|
|
282
282
|
return u.current = null, $ && b.current ? P(x) : (b.current = h.current = null, d.current);
|
|
283
|
-
},
|
|
283
|
+
}, M = function x() {
|
|
284
284
|
var O = Date.now();
|
|
285
|
-
if (F && l.current === c.current &&
|
|
286
|
-
if (
|
|
287
|
-
var D = t - (O - n.current),
|
|
288
|
-
|
|
285
|
+
if (F && l.current === c.current && pe(), le(O)) return ie(O);
|
|
286
|
+
if (m.current) {
|
|
287
|
+
var D = t - (O - n.current), H = J ? Math.min(D, Q - (O - c.current)) : D;
|
|
288
|
+
X(x, H);
|
|
289
289
|
}
|
|
290
|
-
},
|
|
291
|
-
},
|
|
292
|
-
if (I ||
|
|
293
|
-
var x, O = Date.now(), D =
|
|
294
|
-
if (b.current = [].slice.call(arguments), h.current = o, n.current = O,
|
|
295
|
-
var
|
|
296
|
-
((
|
|
290
|
+
}, pe = function() {
|
|
291
|
+
}, te = function() {
|
|
292
|
+
if (I || j) {
|
|
293
|
+
var x, O = Date.now(), D = le(O);
|
|
294
|
+
if (b.current = [].slice.call(arguments), h.current = o, n.current = O, U && !K.current && (K.current = function() {
|
|
295
|
+
var H;
|
|
296
|
+
((H = global.document) == null ? void 0 : H.visibilityState) === "hidden" && L.current.flush();
|
|
297
297
|
}, (x = global.document) == null || x.addEventListener == null || x.addEventListener("visibilitychange", K.current)), D) {
|
|
298
|
-
if (!u.current &&
|
|
299
|
-
if (
|
|
298
|
+
if (!u.current && m.current) return c.current = n.current, X(M, t), F ? P(n.current) : d.current;
|
|
299
|
+
if (J) return X(M, t), P(n.current);
|
|
300
300
|
}
|
|
301
|
-
return u.current ||
|
|
301
|
+
return u.current || X(M, t), d.current;
|
|
302
302
|
}
|
|
303
303
|
};
|
|
304
|
-
return
|
|
304
|
+
return te.cancel = function() {
|
|
305
305
|
var x = u.current;
|
|
306
306
|
x && (y ? cancelAnimationFrame(u.current) : clearTimeout(u.current)), c.current = 0, b.current = n.current = h.current = u.current = null;
|
|
307
|
-
},
|
|
307
|
+
}, te.isPending = function() {
|
|
308
308
|
return !!u.current;
|
|
309
|
-
},
|
|
310
|
-
return u.current ?
|
|
311
|
-
},
|
|
312
|
-
}, [F,
|
|
313
|
-
return
|
|
314
|
-
return
|
|
309
|
+
}, te.flush = function() {
|
|
310
|
+
return u.current ? ie(Date.now()) : d.current;
|
|
311
|
+
}, te;
|
|
312
|
+
}, [F, J, t, Q, $, U, y, I, j, s]);
|
|
313
|
+
return L.current = se, Z(function() {
|
|
314
|
+
return m.current = !0, function() {
|
|
315
315
|
var P;
|
|
316
|
-
|
|
316
|
+
U && L.current.flush(), K.current && ((P = global.document) == null || P.removeEventListener == null || P.removeEventListener("visibilitychange", K.current), K.current = null), m.current = !1;
|
|
317
317
|
};
|
|
318
|
-
}, [
|
|
318
|
+
}, [U]), se;
|
|
319
319
|
}
|
|
320
|
-
const { withProvider: _t, withContext:
|
|
320
|
+
const { withProvider: _t, withContext: q } = /* @__PURE__ */ Vt({
|
|
321
321
|
key: "combobox"
|
|
322
|
-
}), er = /* @__PURE__ */ _t("div", "root"), tr = /* @__PURE__ */
|
|
322
|
+
}), er = /* @__PURE__ */ _t("div", "root"), tr = /* @__PURE__ */ q("div", "trigger"), rr = /* @__PURE__ */ q("div", "leadingElement"), or = /* @__PURE__ */ q("div", "content"), nr = /* @__PURE__ */ q("div", "tagGroup"), sr = /* @__PURE__ */ q("div", "input"), lr = /* @__PURE__ */ q("div", "popover"), ir = /* @__PURE__ */ q("div", "listBox"), cr = /* @__PURE__ */ q("div", "section"), ar = /* @__PURE__ */ q("div", "option"), ur = /* @__PURE__ */ q("div", "optionIndicator"), dr = /* @__PURE__ */ q("div", "optionContent"), fr = {
|
|
323
323
|
clearSelection: "Clear selection",
|
|
324
324
|
toggleOptions: "Toggle options",
|
|
325
325
|
selectedValues: "Selected values",
|
|
@@ -345,11 +345,11 @@ const { withProvider: _t, withContext: G } = /* @__PURE__ */ Vt({
|
|
|
345
345
|
selectedValues: "Valores selecionados",
|
|
346
346
|
options: "Menu de opções"
|
|
347
347
|
}, br = {
|
|
348
|
-
en: /* @__PURE__ */
|
|
349
|
-
de: /* @__PURE__ */
|
|
350
|
-
es: /* @__PURE__ */
|
|
351
|
-
"fr-FR": /* @__PURE__ */
|
|
352
|
-
"pt-BR": /* @__PURE__ */
|
|
348
|
+
en: /* @__PURE__ */ he(fr),
|
|
349
|
+
de: /* @__PURE__ */ he(mr),
|
|
350
|
+
es: /* @__PURE__ */ he(pr),
|
|
351
|
+
"fr-FR": /* @__PURE__ */ he(gr),
|
|
352
|
+
"pt-BR": /* @__PURE__ */ he(yr)
|
|
353
353
|
};
|
|
354
354
|
function Ze(e) {
|
|
355
355
|
if (typeof e == "string" || typeof e == "number")
|
|
@@ -371,7 +371,7 @@ function xr(e) {
|
|
|
371
371
|
name: e
|
|
372
372
|
};
|
|
373
373
|
}
|
|
374
|
-
const vr = (e) => e ? e instanceof Set ? e : new Set(Array.isArray(e) ? e : [e]) : /* @__PURE__ */ new Set(), Cr = (e) => Array.from(e), Re = /* @__PURE__ */ Qe(null),
|
|
374
|
+
const vr = (e) => e ? e instanceof Set ? e : new Set(Array.isArray(e) ? e : [e]) : /* @__PURE__ */ new Set(), Cr = (e) => Array.from(e), Re = /* @__PURE__ */ Qe(null), Me = () => {
|
|
375
375
|
const e = Pe(Re);
|
|
376
376
|
if (!e)
|
|
377
377
|
throw new Error(
|
|
@@ -390,7 +390,7 @@ const vr = (e) => e ? e instanceof Set ? e : new Set(Array.isArray(e) ? e : [e])
|
|
|
390
390
|
inputValue: u
|
|
391
391
|
} = e;
|
|
392
392
|
if (!t) return null;
|
|
393
|
-
const b =
|
|
393
|
+
const b = ee(() => {
|
|
394
394
|
if (o === "single") {
|
|
395
395
|
const h = Array.from(s)[0];
|
|
396
396
|
return h ? n === "text" || c ? Array.from(l).find(
|
|
@@ -399,7 +399,7 @@ const vr = (e) => e ? e instanceof Set ? e : new Set(Array.isArray(e) ? e : [e])
|
|
|
399
399
|
} else {
|
|
400
400
|
const h = Array.from(s);
|
|
401
401
|
return n === "text" || c ? h.map((d) => Array.from(l).find(
|
|
402
|
-
(
|
|
402
|
+
(m) => m.key === d
|
|
403
403
|
)?.textValue || "").filter(Boolean).join(",") : h.join(",");
|
|
404
404
|
}
|
|
405
405
|
}, [
|
|
@@ -436,57 +436,57 @@ function et(e) {
|
|
|
436
436
|
isLoading: h,
|
|
437
437
|
allowsEmptyMenu: d,
|
|
438
438
|
renderEmptyState: w,
|
|
439
|
-
async:
|
|
439
|
+
async: m,
|
|
440
440
|
filter: K,
|
|
441
|
-
allowsCustomOptions:
|
|
441
|
+
allowsCustomOptions: L = !1,
|
|
442
442
|
isDisabled: I = !1,
|
|
443
443
|
isInvalid: y = !1,
|
|
444
444
|
isRequired: F = !1,
|
|
445
445
|
isReadOnly: $ = !1
|
|
446
|
-
} = e,
|
|
446
|
+
} = e, U = zt({ key: "combobox" }), [J, j] = U.splitVariantProps(e), [Q, se] = me(j), P = A(null), X = A(null), [le, ie] = _([]), M = Xt({
|
|
447
447
|
getKey: o,
|
|
448
|
-
async load({ signal:
|
|
449
|
-
if (!
|
|
450
|
-
const
|
|
451
|
-
if (!
|
|
448
|
+
async load({ signal: B, filterText: G }) {
|
|
449
|
+
if (!m) return { items: [] };
|
|
450
|
+
const oe = m.minSearchLength ?? 0;
|
|
451
|
+
if (!G || G.length < oe)
|
|
452
452
|
return { items: [] };
|
|
453
453
|
try {
|
|
454
|
-
return { items: await
|
|
455
|
-
} catch (
|
|
456
|
-
if (
|
|
457
|
-
throw
|
|
458
|
-
const
|
|
459
|
-
return
|
|
454
|
+
return { items: await m.load(G, B) };
|
|
455
|
+
} catch (ae) {
|
|
456
|
+
if (ae.name === "AbortError")
|
|
457
|
+
throw ae;
|
|
458
|
+
const v = ae;
|
|
459
|
+
return m.onError?.(v), { items: [] };
|
|
460
460
|
}
|
|
461
461
|
}
|
|
462
|
-
}), [
|
|
463
|
-
O(!1),
|
|
464
|
-
},
|
|
465
|
-
(
|
|
466
|
-
|
|
462
|
+
}), [pe, te] = _(u), [x, O] = _(!1), [D, H] = _([]), Ae = m?.debounce ?? 300, ve = Zt((B) => {
|
|
463
|
+
O(!1), M.setFilterText(B);
|
|
464
|
+
}, Ae), Ce = R(
|
|
465
|
+
(B) => {
|
|
466
|
+
te(B), O(!0), ve(B);
|
|
467
467
|
},
|
|
468
|
-
[
|
|
469
|
-
),
|
|
470
|
-
const
|
|
471
|
-
let
|
|
472
|
-
(
|
|
473
|
-
), ...
|
|
474
|
-
if (
|
|
475
|
-
const
|
|
476
|
-
|
|
477
|
-
(
|
|
478
|
-
), ...
|
|
468
|
+
[ve]
|
|
469
|
+
), N = m ? pe : u, Se = m ? Ce : b, Y = m ? x || M.loadingState === "loading" || M.loadingState === "loadingMore" || M.loadingState === "filtering" : h, we = m || L ? !0 : d, $e = R(() => Y ? N?.length ? `loading results for "${N}"` : "loading results" : N?.length && m?.minSearchLength && N.length >= m.minSearchLength ? `no results for "${N}"` : m?.minSearchLength ? `enter at least ${m?.minSearchLength} characters` : "type to search", [m?.minSearchLength, Y, N]), Ke = R(() => Y ? N?.length ? `loading results for "${N}"` : "loading results" : 'hit "enter" to create an option', [Y, N]), W = (L ? Ke : m ? $e : void 0) ?? w, re = ee(() => {
|
|
470
|
+
const B = m ? Array.from(M.items) : e.items, G = B ? Array.from(B) : [], oe = new Set(G.map((V) => o(V)));
|
|
471
|
+
let v = [...le.filter(
|
|
472
|
+
(V) => !oe.has(o(V))
|
|
473
|
+
), ...G];
|
|
474
|
+
if (m && r === "multiple" && D.length > 0) {
|
|
475
|
+
const V = new Set(v.map((ye) => o(ye)));
|
|
476
|
+
v = [...D.filter(
|
|
477
|
+
(ye) => !V.has(o(ye))
|
|
478
|
+
), ...v];
|
|
479
479
|
}
|
|
480
|
-
return
|
|
480
|
+
return v;
|
|
481
481
|
}, [
|
|
482
|
-
|
|
483
|
-
|
|
482
|
+
m,
|
|
483
|
+
M.items,
|
|
484
484
|
e.items,
|
|
485
|
-
|
|
485
|
+
le,
|
|
486
486
|
D,
|
|
487
487
|
r,
|
|
488
488
|
o
|
|
489
|
-
]),
|
|
489
|
+
]), ce = ee(
|
|
490
490
|
() => ({
|
|
491
491
|
selectionMode: r,
|
|
492
492
|
size: s,
|
|
@@ -494,8 +494,8 @@ function et(e) {
|
|
|
494
494
|
getTextValue: n,
|
|
495
495
|
leadingElement: l,
|
|
496
496
|
triggerRef: P,
|
|
497
|
-
inputRef:
|
|
498
|
-
isLoading:
|
|
497
|
+
inputRef: X,
|
|
498
|
+
isLoading: Y,
|
|
499
499
|
isDisabled: I,
|
|
500
500
|
isRequired: F,
|
|
501
501
|
isInvalid: y,
|
|
@@ -507,28 +507,28 @@ function et(e) {
|
|
|
507
507
|
n,
|
|
508
508
|
l,
|
|
509
509
|
P,
|
|
510
|
-
|
|
510
|
+
X,
|
|
511
511
|
I,
|
|
512
512
|
F,
|
|
513
513
|
y,
|
|
514
514
|
$
|
|
515
515
|
]
|
|
516
|
-
),
|
|
517
|
-
if (
|
|
518
|
-
return Array.from(
|
|
519
|
-
const
|
|
520
|
-
return
|
|
521
|
-
...
|
|
522
|
-
...
|
|
523
|
-
...
|
|
516
|
+
), ge = ee(() => {
|
|
517
|
+
if (re)
|
|
518
|
+
return Array.from(re).map((B) => {
|
|
519
|
+
const G = "id" in B, oe = "textValue" in B;
|
|
520
|
+
return G && oe ? B : {
|
|
521
|
+
...B,
|
|
522
|
+
...G ? {} : { id: o(B) },
|
|
523
|
+
...oe ? {} : { textValue: n(B) }
|
|
524
524
|
};
|
|
525
525
|
});
|
|
526
|
-
}, [
|
|
526
|
+
}, [re, o, n]), Oe = ee(
|
|
527
527
|
() => /* @__PURE__ */ g(
|
|
528
528
|
Re.Provider,
|
|
529
529
|
{
|
|
530
|
-
value:
|
|
531
|
-
children: /* @__PURE__ */ g(Xe.Provider, { value: { items:
|
|
530
|
+
value: ce,
|
|
531
|
+
children: /* @__PURE__ */ g(Xe.Provider, { value: { items: ge }, children: typeof c == "function" ? c({
|
|
532
532
|
isOpen: !1,
|
|
533
533
|
isDisabled: I,
|
|
534
534
|
isInvalid: y,
|
|
@@ -542,8 +542,8 @@ function et(e) {
|
|
|
542
542
|
I,
|
|
543
543
|
y,
|
|
544
544
|
F,
|
|
545
|
-
|
|
546
|
-
|
|
545
|
+
ge,
|
|
546
|
+
ce
|
|
547
547
|
]
|
|
548
548
|
);
|
|
549
549
|
return /* @__PURE__ */ g(
|
|
@@ -551,19 +551,19 @@ function et(e) {
|
|
|
551
551
|
{
|
|
552
552
|
values: [
|
|
553
553
|
[Ee, {}],
|
|
554
|
-
[
|
|
554
|
+
[Be, {}],
|
|
555
555
|
[De, {}]
|
|
556
556
|
],
|
|
557
557
|
children: /* @__PURE__ */ g(
|
|
558
558
|
Re.Provider,
|
|
559
559
|
{
|
|
560
|
-
value:
|
|
560
|
+
value: ce,
|
|
561
561
|
children: /* @__PURE__ */ g(
|
|
562
562
|
er,
|
|
563
563
|
{
|
|
564
564
|
ref: t,
|
|
565
|
-
...U,
|
|
566
565
|
...J,
|
|
566
|
+
...Q,
|
|
567
567
|
size: s,
|
|
568
568
|
"data-disabled": I,
|
|
569
569
|
"data-invalid": y,
|
|
@@ -571,31 +571,31 @@ function et(e) {
|
|
|
571
571
|
"data-readonly": $,
|
|
572
572
|
"data-open": e.isOpen,
|
|
573
573
|
role: "group",
|
|
574
|
-
children: /* @__PURE__ */ g(Ft, { content: Oe, children: (
|
|
574
|
+
children: /* @__PURE__ */ g(Ft, { content: Oe, children: (B) => (
|
|
575
575
|
// Pass the built collection to ComboBoxRootInner which handles all behavior
|
|
576
576
|
/* @__PURE__ */ g(
|
|
577
577
|
Sr,
|
|
578
578
|
{
|
|
579
|
-
...
|
|
579
|
+
...se,
|
|
580
580
|
size: s,
|
|
581
581
|
filter: K,
|
|
582
582
|
selectionMode: r,
|
|
583
|
-
inputValue:
|
|
584
|
-
onInputChange:
|
|
583
|
+
inputValue: N,
|
|
584
|
+
onInputChange: Se,
|
|
585
585
|
getKey: o,
|
|
586
586
|
getTextValue: n,
|
|
587
|
-
allowsEmptyMenu:
|
|
588
|
-
renderEmptyState:
|
|
587
|
+
allowsEmptyMenu: we,
|
|
588
|
+
renderEmptyState: W,
|
|
589
589
|
isDisabled: I,
|
|
590
590
|
isRequired: F,
|
|
591
591
|
isInvalid: y,
|
|
592
592
|
isReadOnly: $,
|
|
593
|
-
collection:
|
|
594
|
-
allowsCustomOptions:
|
|
595
|
-
asyncConfig:
|
|
596
|
-
onAsyncSelectedItemsChange:
|
|
597
|
-
onAddCustomItem:
|
|
598
|
-
onAddAsyncSelectedItem:
|
|
593
|
+
collection: B,
|
|
594
|
+
allowsCustomOptions: L,
|
|
595
|
+
asyncConfig: m,
|
|
596
|
+
onAsyncSelectedItemsChange: m && r === "multiple" ? H : void 0,
|
|
597
|
+
onAddCustomItem: ie,
|
|
598
|
+
onAddAsyncSelectedItem: H
|
|
599
599
|
}
|
|
600
600
|
)
|
|
601
601
|
) })
|
|
@@ -620,107 +620,107 @@ const Sr = (e) => {
|
|
|
620
620
|
inputValue: h = "",
|
|
621
621
|
onInputChange: d,
|
|
622
622
|
filter: w,
|
|
623
|
-
placeholder:
|
|
623
|
+
placeholder: m,
|
|
624
624
|
menuTrigger: K = "input",
|
|
625
|
-
shouldCloseOnBlur:
|
|
625
|
+
shouldCloseOnBlur: L = !0,
|
|
626
626
|
shouldCloseOnSelect: I = !0,
|
|
627
627
|
isOpen: y,
|
|
628
628
|
defaultOpen: F = !1,
|
|
629
629
|
onOpenChange: $,
|
|
630
|
-
allowsEmptyMenu:
|
|
631
|
-
renderEmptyState:
|
|
632
|
-
allowsCustomOptions:
|
|
633
|
-
isValidNewOption:
|
|
634
|
-
getNewOptionData:
|
|
630
|
+
allowsEmptyMenu: U = !1,
|
|
631
|
+
renderEmptyState: J,
|
|
632
|
+
allowsCustomOptions: j = !1,
|
|
633
|
+
isValidNewOption: Q,
|
|
634
|
+
getNewOptionData: se = xr,
|
|
635
635
|
onCreateOption: P,
|
|
636
|
-
"aria-label":
|
|
637
|
-
"aria-labelledby":
|
|
638
|
-
"aria-describedby":
|
|
639
|
-
isDisabled:
|
|
640
|
-
isRequired:
|
|
641
|
-
isInvalid:
|
|
636
|
+
"aria-label": X,
|
|
637
|
+
"aria-labelledby": le,
|
|
638
|
+
"aria-describedby": ie,
|
|
639
|
+
isDisabled: M = !1,
|
|
640
|
+
isRequired: pe = !1,
|
|
641
|
+
isInvalid: te = !1,
|
|
642
642
|
isReadOnly: x = !1,
|
|
643
643
|
shouldFocusWrap: O = !0,
|
|
644
644
|
autoFocus: D = !1,
|
|
645
|
-
name:
|
|
646
|
-
formValue:
|
|
647
|
-
validationBehavior:
|
|
648
|
-
form:
|
|
649
|
-
validate:
|
|
650
|
-
isLoading:
|
|
651
|
-
asyncConfig:
|
|
652
|
-
onAsyncSelectedItemsChange:
|
|
653
|
-
onAddCustomItem:
|
|
654
|
-
onAddAsyncSelectedItem:
|
|
655
|
-
} = e,
|
|
645
|
+
name: H,
|
|
646
|
+
formValue: Ae,
|
|
647
|
+
validationBehavior: ve = "aria",
|
|
648
|
+
form: Ce,
|
|
649
|
+
validate: N,
|
|
650
|
+
isLoading: Se,
|
|
651
|
+
asyncConfig: Y,
|
|
652
|
+
onAsyncSelectedItemsChange: we,
|
|
653
|
+
onAddCustomItem: $e,
|
|
654
|
+
onAddAsyncSelectedItem: Ke
|
|
655
|
+
} = e, { triggerRef: Fe, inputRef: W } = Me(), re = Je(), ce = Je(), ge = A(null), Oe = A(null), B = ee(
|
|
656
656
|
() => vr(l),
|
|
657
657
|
[l]
|
|
658
|
-
),
|
|
659
|
-
|
|
660
|
-
), v =
|
|
658
|
+
), G = !!u, [oe, ae] = _(
|
|
659
|
+
B
|
|
660
|
+
), v = G ? B : oe, V = d !== void 0, ze = () => {
|
|
661
661
|
if (h) return h;
|
|
662
662
|
if (V || r !== "single") return "";
|
|
663
663
|
const i = Array.from(v);
|
|
664
664
|
if (i.length === 0) return "";
|
|
665
665
|
const a = i[0];
|
|
666
666
|
return o.getItem(a)?.textValue ?? "";
|
|
667
|
-
}, [
|
|
668
|
-
|
|
669
|
-
),
|
|
667
|
+
}, [ye, ue] = _(
|
|
668
|
+
ze
|
|
669
|
+
), E = V ? h : ye, ne = A(E), [at, Ne] = _(F), C = y ?? at, [Ve, be] = _(
|
|
670
670
|
null
|
|
671
|
-
),
|
|
671
|
+
), T = R(
|
|
672
672
|
(i) => {
|
|
673
|
-
y === void 0 &&
|
|
673
|
+
y === void 0 && Ne(i), $?.(i);
|
|
674
674
|
},
|
|
675
675
|
[y, $]
|
|
676
|
-
), ut =
|
|
677
|
-
if (
|
|
676
|
+
), ut = ee(() => {
|
|
677
|
+
if (E.trim() === "")
|
|
678
678
|
return o;
|
|
679
679
|
if (r === "single") {
|
|
680
680
|
const a = Array.from(v);
|
|
681
681
|
if (a.length > 0) {
|
|
682
682
|
const f = a[0];
|
|
683
|
-
if (o.getItem(f)?.textValue ===
|
|
683
|
+
if (o.getItem(f)?.textValue === E)
|
|
684
684
|
return o;
|
|
685
685
|
}
|
|
686
686
|
}
|
|
687
687
|
if (w) {
|
|
688
|
-
const a = Array.from(o), f = Array.from(w(a,
|
|
689
|
-
return o.filter?.((
|
|
688
|
+
const a = Array.from(o), f = Array.from(w(a, E)), S = new Set(f.map((Ie) => Ie.key));
|
|
689
|
+
return o.filter?.((Ie, Le) => S.has(Le.key)) ?? o;
|
|
690
690
|
}
|
|
691
|
-
const i =
|
|
691
|
+
const i = E.toLowerCase();
|
|
692
692
|
return o.filter?.((a) => a.toLowerCase().includes(i)) ?? o;
|
|
693
|
-
}, [o,
|
|
693
|
+
}, [o, E, w, r, v]), dt = ee(
|
|
694
694
|
() => r === "multiple" ? Array.from(v).map((i) => o.getItem(i)?.value).filter((i) => i !== void 0) : [],
|
|
695
695
|
[r, v, o]
|
|
696
|
-
), [ft, mt] =
|
|
696
|
+
), [ft, mt] = _(null), pt = R(() => {
|
|
697
697
|
const i = y === void 0 ? !C : !y;
|
|
698
|
-
y === void 0 ?
|
|
698
|
+
y === void 0 ? Ne((a) => !a) : $?.(!y), i && (W.current?.focus(), be("first"));
|
|
699
699
|
}, [y, C, $]), gt = R(
|
|
700
700
|
(i) => {
|
|
701
|
-
V ||
|
|
701
|
+
V || ue(i), d?.(i), K === "input" && i !== ne.current && T(!0), ne.current = i;
|
|
702
702
|
},
|
|
703
|
-
[V, d, K,
|
|
704
|
-
),
|
|
703
|
+
[V, d, K, T]
|
|
704
|
+
), z = R(
|
|
705
705
|
(i, a) => {
|
|
706
|
-
let f = i === "all" ? new Set(Array.from(o).map((
|
|
707
|
-
const S = a ?? v,
|
|
708
|
-
if (r === "multiple" && f.size === 1 && !
|
|
709
|
-
const
|
|
710
|
-
|
|
706
|
+
let f = i === "all" ? new Set(Array.from(o).map((k) => k.key)) : i;
|
|
707
|
+
const S = a ?? v, Ie = f.size > 0 && Array.from(f).every((k) => S.has(k)) && f.size < S.size;
|
|
708
|
+
if (r === "multiple" && f.size === 1 && !Ie) {
|
|
709
|
+
const k = Array.from(f)[0], fe = S.has(k), de = new Set(S);
|
|
710
|
+
fe ? de.delete(k) : de.add(k), f = de;
|
|
711
711
|
}
|
|
712
712
|
const Le = Cr(f);
|
|
713
|
-
if (u ? u(Le) :
|
|
714
|
-
const
|
|
715
|
-
|
|
713
|
+
if (u ? u(Le) : ae(f), Y && r === "multiple" && we) {
|
|
714
|
+
const k = Array.from(f).map((fe) => o.getItem(fe)?.value).filter((fe) => fe !== void 0);
|
|
715
|
+
we(k);
|
|
716
716
|
}
|
|
717
717
|
if (r === "single") {
|
|
718
|
-
const
|
|
719
|
-
if (
|
|
720
|
-
const
|
|
721
|
-
V || (
|
|
718
|
+
const k = Array.from(f)[0];
|
|
719
|
+
if (k !== null) {
|
|
720
|
+
const de = o.getItem(k)?.textValue ?? "";
|
|
721
|
+
V || (ue(de), ne.current = de), d?.(de);
|
|
722
722
|
}
|
|
723
|
-
I &&
|
|
723
|
+
I && T(!1);
|
|
724
724
|
}
|
|
725
725
|
},
|
|
726
726
|
[
|
|
@@ -730,126 +730,134 @@ const Sr = (e) => {
|
|
|
730
730
|
u,
|
|
731
731
|
d,
|
|
732
732
|
I,
|
|
733
|
-
|
|
733
|
+
T,
|
|
734
734
|
V
|
|
735
735
|
]
|
|
736
|
-
),
|
|
736
|
+
), p = Jt({
|
|
737
737
|
selectionMode: r,
|
|
738
738
|
collection: ut,
|
|
739
739
|
selectedKeys: v,
|
|
740
|
-
onSelectionChange:
|
|
740
|
+
onSelectionChange: z,
|
|
741
741
|
disabledKeys: b
|
|
742
742
|
}), yt = R(() => {
|
|
743
|
-
|
|
744
|
-
|
|
743
|
+
z(/* @__PURE__ */ new Set()), V || (ue(""), ne.current = ""), d?.(""), T(!0), requestAnimationFrame(() => {
|
|
744
|
+
W.current?.focus();
|
|
745
|
+
});
|
|
746
|
+
}, [
|
|
747
|
+
z,
|
|
748
|
+
V,
|
|
749
|
+
d,
|
|
750
|
+
T,
|
|
751
|
+
W
|
|
752
|
+
]), ke = R(
|
|
745
753
|
(i) => {
|
|
746
|
-
|
|
754
|
+
$e?.((S) => [...S, i]), Y && r === "multiple" && Ke?.((S) => [...S, i]);
|
|
747
755
|
const a = n(i), f = v;
|
|
748
756
|
if (r === "single")
|
|
749
|
-
|
|
757
|
+
z(/* @__PURE__ */ new Set([a]), f);
|
|
750
758
|
else {
|
|
751
759
|
const S = new Set(f);
|
|
752
|
-
S.add(a),
|
|
760
|
+
S.add(a), z(S, f);
|
|
753
761
|
}
|
|
754
762
|
},
|
|
755
763
|
[
|
|
756
|
-
|
|
757
|
-
|
|
764
|
+
$e,
|
|
765
|
+
Y,
|
|
758
766
|
r,
|
|
759
|
-
|
|
767
|
+
Ke,
|
|
760
768
|
n,
|
|
761
769
|
v,
|
|
762
|
-
|
|
770
|
+
z
|
|
763
771
|
]
|
|
764
|
-
),
|
|
765
|
-
if (!
|
|
766
|
-
const i =
|
|
772
|
+
), We = R(() => {
|
|
773
|
+
if (!j) return !1;
|
|
774
|
+
const i = E.trim();
|
|
767
775
|
if (!i || Array.from(o).some(
|
|
768
776
|
(S) => S.textValue?.toLowerCase() === i.toLowerCase()
|
|
769
|
-
) ||
|
|
777
|
+
) || Q && !Q(i))
|
|
770
778
|
return !1;
|
|
771
|
-
const f =
|
|
772
|
-
return
|
|
779
|
+
const f = se(i);
|
|
780
|
+
return ke(f), r === "multiple" ? (V || (ue(""), ne.current = ""), d?.("")) : (V || (ue(i), ne.current = i), d?.(i)), P?.(f), !0;
|
|
773
781
|
}, [
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
782
|
+
j,
|
|
783
|
+
se,
|
|
784
|
+
Q,
|
|
785
|
+
E,
|
|
778
786
|
o,
|
|
779
787
|
r,
|
|
780
788
|
d,
|
|
781
789
|
P,
|
|
782
|
-
|
|
790
|
+
ke,
|
|
783
791
|
V,
|
|
784
|
-
|
|
785
|
-
|
|
792
|
+
ue,
|
|
793
|
+
ne
|
|
786
794
|
]), bt = R(
|
|
787
795
|
(i) => {
|
|
788
|
-
if (
|
|
796
|
+
if (M || x) return;
|
|
789
797
|
const a = v, f = new Set(a);
|
|
790
|
-
i.forEach((S) => f.delete(S)),
|
|
798
|
+
i.forEach((S) => f.delete(S)), z(f, a), f.size === 0 && W.current?.focus();
|
|
791
799
|
},
|
|
792
|
-
[v,
|
|
800
|
+
[v, z, M, x]
|
|
793
801
|
), ht = R(
|
|
794
802
|
(i) => {
|
|
795
803
|
switch (i.key) {
|
|
796
804
|
case "ArrowDown":
|
|
797
805
|
if (i.preventDefault(), !C)
|
|
798
|
-
|
|
806
|
+
T(!0), be("first");
|
|
799
807
|
else {
|
|
800
|
-
const a =
|
|
801
|
-
|
|
802
|
-
f ??
|
|
808
|
+
const a = p.selectionManager.focusedKey, f = a ? p.collection.getKeyAfter(a) : p.collection.getFirstKey();
|
|
809
|
+
p.selectionManager.setFocusedKey(
|
|
810
|
+
f ?? p.collection.getFirstKey()
|
|
803
811
|
);
|
|
804
812
|
}
|
|
805
813
|
break;
|
|
806
814
|
case "ArrowUp":
|
|
807
815
|
if (i.preventDefault(), !C)
|
|
808
|
-
|
|
816
|
+
T(!0), be("last");
|
|
809
817
|
else {
|
|
810
|
-
const a =
|
|
811
|
-
|
|
812
|
-
f ??
|
|
818
|
+
const a = p.selectionManager.focusedKey, f = a ? p.collection.getKeyBefore(a) : p.collection.getLastKey();
|
|
819
|
+
p.selectionManager.setFocusedKey(
|
|
820
|
+
f ?? p.collection.getLastKey()
|
|
813
821
|
);
|
|
814
822
|
}
|
|
815
823
|
break;
|
|
816
824
|
case "Enter":
|
|
817
|
-
if (C &&
|
|
825
|
+
if (C && p.selectionManager.focusedKey) {
|
|
818
826
|
i.preventDefault();
|
|
819
|
-
const a =
|
|
827
|
+
const a = p.selectionManager.focusedKey;
|
|
820
828
|
if (r === "multiple") {
|
|
821
829
|
const f = new Set(v);
|
|
822
|
-
f.has(a) ? f.delete(a) : f.add(a),
|
|
830
|
+
f.has(a) ? f.delete(a) : f.add(a), z(f);
|
|
823
831
|
} else
|
|
824
|
-
|
|
825
|
-
} else C && !
|
|
832
|
+
z(/* @__PURE__ */ new Set([a])), p.selectionManager.setFocusedKey(null);
|
|
833
|
+
} else C && !p.selectionManager.focusedKey && j && We() && i.preventDefault();
|
|
826
834
|
break;
|
|
827
835
|
case "Escape":
|
|
828
|
-
C && (i.preventDefault(),
|
|
836
|
+
C && (i.preventDefault(), T(!1), p.selectionManager.setFocusedKey(null));
|
|
829
837
|
break;
|
|
830
838
|
case "Home":
|
|
831
839
|
if (C) {
|
|
832
840
|
i.preventDefault();
|
|
833
|
-
const a =
|
|
834
|
-
|
|
841
|
+
const a = p.collection.getFirstKey();
|
|
842
|
+
p.selectionManager.setFocusedKey(a);
|
|
835
843
|
}
|
|
836
844
|
break;
|
|
837
845
|
case "End":
|
|
838
846
|
if (C) {
|
|
839
847
|
i.preventDefault();
|
|
840
|
-
const a =
|
|
841
|
-
|
|
848
|
+
const a = p.collection.getLastKey();
|
|
849
|
+
p.selectionManager.setFocusedKey(a);
|
|
842
850
|
}
|
|
843
851
|
break;
|
|
844
852
|
case "Backspace":
|
|
845
|
-
if (
|
|
853
|
+
if (E === "") {
|
|
846
854
|
const a = Array.from(v);
|
|
847
855
|
if (a.length > 0)
|
|
848
856
|
if (i.preventDefault(), r === "single")
|
|
849
|
-
|
|
857
|
+
z(/* @__PURE__ */ new Set());
|
|
850
858
|
else {
|
|
851
859
|
const f = new Set(a);
|
|
852
|
-
f.delete(a[a.length - 1]),
|
|
860
|
+
f.delete(a[a.length - 1]), z(f);
|
|
853
861
|
}
|
|
854
862
|
}
|
|
855
863
|
break;
|
|
@@ -857,82 +865,80 @@ const Sr = (e) => {
|
|
|
857
865
|
},
|
|
858
866
|
[
|
|
859
867
|
C,
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
868
|
+
p.selectionManager,
|
|
869
|
+
p.collection,
|
|
870
|
+
z,
|
|
871
|
+
T,
|
|
872
|
+
be,
|
|
865
873
|
r,
|
|
866
|
-
|
|
874
|
+
E,
|
|
867
875
|
v,
|
|
868
|
-
|
|
869
|
-
|
|
876
|
+
j,
|
|
877
|
+
We
|
|
870
878
|
]
|
|
871
879
|
), xt = R(() => {
|
|
872
|
-
K === "focus" && !
|
|
880
|
+
K === "focus" && !M && !x && T(!0), r === "single" && E && W.current && W.current.select();
|
|
873
881
|
}, [
|
|
874
882
|
K,
|
|
875
|
-
|
|
883
|
+
M,
|
|
876
884
|
x,
|
|
877
|
-
|
|
885
|
+
T,
|
|
878
886
|
r,
|
|
879
|
-
|
|
887
|
+
E
|
|
880
888
|
]), vt = R(
|
|
881
889
|
(i) => {
|
|
882
|
-
if (!
|
|
890
|
+
if (!L) return;
|
|
883
891
|
const a = i.currentTarget;
|
|
884
892
|
setTimeout(() => {
|
|
885
893
|
const f = document.activeElement;
|
|
886
|
-
a.contains(f) ||
|
|
894
|
+
a.contains(f) || T(!1);
|
|
887
895
|
}, 150);
|
|
888
896
|
},
|
|
889
|
-
[
|
|
890
|
-
),
|
|
891
|
-
|
|
892
|
-
D &&
|
|
893
|
-
}, [D,
|
|
894
|
-
const
|
|
895
|
-
|
|
896
|
-
y === void 0 &&
|
|
897
|
-
}, [C, y, $]),
|
|
897
|
+
[L, T]
|
|
898
|
+
), Ge = A(null);
|
|
899
|
+
Z(() => {
|
|
900
|
+
D && W.current && !M && W.current.focus();
|
|
901
|
+
}, [D, M]);
|
|
902
|
+
const qe = A(C);
|
|
903
|
+
Z(() => {
|
|
904
|
+
y === void 0 && qe.current !== C && (qe.current = C, $?.(C));
|
|
905
|
+
}, [C, y, $]), Z(() => {
|
|
898
906
|
if (r !== "single") return;
|
|
899
|
-
const i = Array.from(
|
|
900
|
-
if (a ===
|
|
901
|
-
|
|
902
|
-
const f = a !== null ?
|
|
907
|
+
const i = Array.from(p.selectionManager.selectedKeys), a = i.length > 0 ? i[0] : null;
|
|
908
|
+
if (a === Ge.current) return;
|
|
909
|
+
Ge.current = a;
|
|
910
|
+
const f = a !== null ? p.collection.getItem(a) : null;
|
|
903
911
|
if (a !== null && !f)
|
|
904
912
|
return;
|
|
905
913
|
const S = f?.textValue ?? "";
|
|
906
|
-
V ? d?.(S) : (
|
|
914
|
+
V ? d?.(S) : (ue(S), ne.current = S);
|
|
907
915
|
}, [
|
|
908
916
|
r,
|
|
909
|
-
|
|
910
|
-
|
|
917
|
+
p.selectionManager.selectedKeys,
|
|
918
|
+
p.collection,
|
|
911
919
|
V,
|
|
912
920
|
d
|
|
913
|
-
]),
|
|
921
|
+
]), Z(() => {
|
|
914
922
|
if (C && Ve) {
|
|
915
|
-
const i = Ve === "first" ?
|
|
916
|
-
|
|
923
|
+
const i = Ve === "first" ? p.collection.getFirstKey() : p.collection.getLastKey();
|
|
924
|
+
p.selectionManager.setFocusedKey(i ?? null), be(null);
|
|
917
925
|
}
|
|
918
|
-
}, [C, Ve,
|
|
919
|
-
C ?
|
|
920
|
-
}, [C,
|
|
921
|
-
const
|
|
922
|
-
|
|
923
|
-
if (!C ||
|
|
924
|
-
|
|
926
|
+
}, [C, Ve, p.collection, p.selectionManager]), Z(() => {
|
|
927
|
+
C ? p.selectionManager.setFocused(!0) : (p.selectionManager.setFocused(!1), p.selectionManager.setFocusedKey(null));
|
|
928
|
+
}, [C, p.selectionManager]);
|
|
929
|
+
const je = A(!1);
|
|
930
|
+
p.collection.size > 0 && (je.current = !0), Z(() => {
|
|
931
|
+
if (!C || U || Se || !je.current) return;
|
|
932
|
+
p.collection.size > 0 || T(!1);
|
|
925
933
|
}, [
|
|
926
934
|
C,
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
])
|
|
933
|
-
|
|
934
|
-
Y(() => {
|
|
935
|
-
const i = je.current;
|
|
935
|
+
U,
|
|
936
|
+
Se,
|
|
937
|
+
p.collection.size,
|
|
938
|
+
T,
|
|
939
|
+
E
|
|
940
|
+
]), Z(() => {
|
|
941
|
+
const i = Fe.current;
|
|
936
942
|
if (!i) return;
|
|
937
943
|
const a = () => {
|
|
938
944
|
const S = i.offsetWidth;
|
|
@@ -948,35 +954,35 @@ const Sr = (e) => {
|
|
|
948
954
|
// InputContext: Props for ComboBox.Input component
|
|
949
955
|
// Configures the input field with ARIA attributes, event handlers, and validation
|
|
950
956
|
[
|
|
951
|
-
|
|
957
|
+
Be,
|
|
952
958
|
{
|
|
953
|
-
ref:
|
|
959
|
+
ref: W,
|
|
954
960
|
role: "combobox",
|
|
955
961
|
// ARIA role for autocomplete input
|
|
956
962
|
"aria-autocomplete": "list",
|
|
957
963
|
// Indicates suggestions are in a list
|
|
958
|
-
"aria-controls": r === "multiple" ? `${
|
|
964
|
+
"aria-controls": r === "multiple" ? `${ce} ${re}` : re,
|
|
959
965
|
// Single-select: controls only listbox
|
|
960
966
|
"aria-expanded": C,
|
|
961
967
|
// Announces menu open/closed state
|
|
962
|
-
"aria-activedescendant":
|
|
963
|
-
"aria-describedby": r === "multiple" ? `${
|
|
964
|
-
"aria-label":
|
|
965
|
-
"aria-labelledby":
|
|
966
|
-
value:
|
|
968
|
+
"aria-activedescendant": p.selectionManager.focusedKey ? `${re}-option-${p.selectionManager.focusedKey}` : void 0,
|
|
969
|
+
"aria-describedby": r === "multiple" ? `${ce} ${ie ?? ""}` : ie,
|
|
970
|
+
"aria-label": X,
|
|
971
|
+
"aria-labelledby": le,
|
|
972
|
+
value: E,
|
|
967
973
|
onChange: (i) => gt(i.target.value),
|
|
968
974
|
onKeyDown: ht,
|
|
969
975
|
onFocus: xt,
|
|
970
976
|
onBlur: vt,
|
|
971
|
-
disabled:
|
|
977
|
+
disabled: M,
|
|
972
978
|
readOnly: x,
|
|
973
|
-
required:
|
|
974
|
-
"aria-invalid":
|
|
975
|
-
placeholder:
|
|
976
|
-
name:
|
|
977
|
-
form:
|
|
978
|
-
validationbehavior:
|
|
979
|
-
validate:
|
|
979
|
+
required: pe,
|
|
980
|
+
"aria-invalid": te,
|
|
981
|
+
placeholder: m,
|
|
982
|
+
name: H,
|
|
983
|
+
form: Ce,
|
|
984
|
+
validationbehavior: ve,
|
|
985
|
+
validate: N
|
|
980
986
|
}
|
|
981
987
|
],
|
|
982
988
|
// TagGroupContext: Props for ComboBox.TagGroup component (multi-select only)
|
|
@@ -984,7 +990,7 @@ const Sr = (e) => {
|
|
|
984
990
|
[
|
|
985
991
|
De,
|
|
986
992
|
{
|
|
987
|
-
id:
|
|
993
|
+
id: ce,
|
|
988
994
|
"aria-label": t.format("selectedValues"),
|
|
989
995
|
items: dt,
|
|
990
996
|
// Selected items to display as tags
|
|
@@ -1001,7 +1007,7 @@ const Sr = (e) => {
|
|
|
1001
1007
|
toggle: {
|
|
1002
1008
|
onPress: pt,
|
|
1003
1009
|
"aria-label": t.format("toggleOptions"),
|
|
1004
|
-
isDisabled:
|
|
1010
|
+
isDisabled: M || x,
|
|
1005
1011
|
isPressed: C
|
|
1006
1012
|
// Visual indicator that menu is open
|
|
1007
1013
|
},
|
|
@@ -1009,7 +1015,7 @@ const Sr = (e) => {
|
|
|
1009
1015
|
onPress: yt,
|
|
1010
1016
|
"aria-label": t.format("clearSelection"),
|
|
1011
1017
|
style: v.size > 0 ? void 0 : { display: "none" },
|
|
1012
|
-
isDisabled:
|
|
1018
|
+
isDisabled: M || x || p.selectionManager.selectedKeys.size === 0
|
|
1013
1019
|
// Disabled when nothing selected
|
|
1014
1020
|
}
|
|
1015
1021
|
}
|
|
@@ -1024,10 +1030,10 @@ const Sr = (e) => {
|
|
|
1024
1030
|
// No-op onOpenChange: We control state internally, prevent React Aria from managing its own state
|
|
1025
1031
|
onOpenChange: () => {
|
|
1026
1032
|
},
|
|
1027
|
-
ref:
|
|
1028
|
-
triggerRef:
|
|
1033
|
+
ref: Oe,
|
|
1034
|
+
triggerRef: Fe,
|
|
1029
1035
|
// Popover positions relative to this element
|
|
1030
|
-
scrollRef:
|
|
1036
|
+
scrollRef: ge,
|
|
1031
1037
|
// Enables scroll-into-view for keyboard navigation
|
|
1032
1038
|
isNonModal: !0,
|
|
1033
1039
|
// Non-modal: doesn't trap focus, allows interaction outside
|
|
@@ -1043,7 +1049,7 @@ const Sr = (e) => {
|
|
|
1043
1049
|
// Clear these contexts so popover content doesn't inherit combobox contexts
|
|
1044
1050
|
Gt,
|
|
1045
1051
|
Ee,
|
|
1046
|
-
|
|
1052
|
+
Be,
|
|
1047
1053
|
Wt,
|
|
1048
1054
|
jt
|
|
1049
1055
|
]
|
|
@@ -1059,11 +1065,11 @@ const Sr = (e) => {
|
|
|
1059
1065
|
{
|
|
1060
1066
|
items: s,
|
|
1061
1067
|
// Items to render (merged from outer component)
|
|
1062
|
-
id:
|
|
1068
|
+
id: re,
|
|
1063
1069
|
// ID referenced by aria-controls on input
|
|
1064
|
-
ref:
|
|
1070
|
+
ref: ge,
|
|
1065
1071
|
// Ref for scroll positioning
|
|
1066
|
-
renderEmptyState:
|
|
1072
|
+
renderEmptyState: J,
|
|
1067
1073
|
// Custom empty state renderer
|
|
1068
1074
|
shouldFocusWrap: O,
|
|
1069
1075
|
// Whether to wrap focus from last to first item
|
|
@@ -1071,9 +1077,9 @@ const Sr = (e) => {
|
|
|
1071
1077
|
}
|
|
1072
1078
|
],
|
|
1073
1079
|
// ListStateContext: React Aria's collection state for managing selection and focus
|
|
1074
|
-
[It,
|
|
1080
|
+
[It, p]
|
|
1075
1081
|
];
|
|
1076
|
-
return /* @__PURE__ */
|
|
1082
|
+
return /* @__PURE__ */ xe(
|
|
1077
1083
|
Ye,
|
|
1078
1084
|
{
|
|
1079
1085
|
values: Ct,
|
|
@@ -1081,14 +1087,14 @@ const Sr = (e) => {
|
|
|
1081
1087
|
/* @__PURE__ */ g(
|
|
1082
1088
|
_e,
|
|
1083
1089
|
{
|
|
1084
|
-
name:
|
|
1085
|
-
form:
|
|
1090
|
+
name: H,
|
|
1091
|
+
form: Ce,
|
|
1086
1092
|
selectedKeys: v,
|
|
1087
1093
|
selectionMode: r,
|
|
1088
|
-
formValue:
|
|
1089
|
-
allowsCustomOptions:
|
|
1090
|
-
collection:
|
|
1091
|
-
inputValue:
|
|
1094
|
+
formValue: Ae,
|
|
1095
|
+
allowsCustomOptions: j,
|
|
1096
|
+
collection: p.collection,
|
|
1097
|
+
inputValue: E
|
|
1092
1098
|
}
|
|
1093
1099
|
),
|
|
1094
1100
|
c
|
|
@@ -1096,7 +1102,7 @@ const Sr = (e) => {
|
|
|
1096
1102
|
}
|
|
1097
1103
|
);
|
|
1098
1104
|
}, tt = (e) => {
|
|
1099
|
-
const [t, r] =
|
|
1105
|
+
const [t, r] = me(e), s = Pe(Be), { inputRef: o } = Me();
|
|
1100
1106
|
let n = "", c = "";
|
|
1101
1107
|
s && typeof s == "object" && "value" in s && (n = s.value || "", c = s.placeholder || "");
|
|
1102
1108
|
const l = Math.max(n.length || c.length || 1, 1);
|
|
@@ -1114,17 +1120,17 @@ tt.displayName = "ComboBox.Input";
|
|
|
1114
1120
|
const wr = ({
|
|
1115
1121
|
children: e
|
|
1116
1122
|
}) => /* @__PURE__ */ g(rr, { children: e }), rt = (e) => {
|
|
1117
|
-
const { selectionMode: t, size: r, getKey: s, getTextValue: o, isDisabled: n, isReadOnly: c } =
|
|
1123
|
+
const { selectionMode: t, size: r, getKey: s, getTextValue: o, isDisabled: n, isReadOnly: c } = Me(), [l, u] = me(e), b = Pe(De), h = (b && "items" in b ? b.items : void 0) ?? [];
|
|
1118
1124
|
return t !== "multiple" ? null : /* @__PURE__ */ g(nr, { ...l, ...u, asChild: !0, children: /* @__PURE__ */ g(Te.Root, { size: r, children: /* @__PURE__ */ g(Te.TagList, { items: h, display: "contents", children: (d) => {
|
|
1119
|
-
const w = s(d),
|
|
1125
|
+
const w = s(d), m = o(d);
|
|
1120
1126
|
return /* @__PURE__ */ g(
|
|
1121
1127
|
Te.Tag,
|
|
1122
1128
|
{
|
|
1123
1129
|
id: w,
|
|
1124
|
-
textValue:
|
|
1130
|
+
textValue: m,
|
|
1125
1131
|
isDisabled: n || c,
|
|
1126
1132
|
maxW: "100%",
|
|
1127
|
-
children:
|
|
1133
|
+
children: m
|
|
1128
1134
|
}
|
|
1129
1135
|
);
|
|
1130
1136
|
} }) }) });
|
|
@@ -1134,12 +1140,12 @@ const ot = ({
|
|
|
1134
1140
|
children: e,
|
|
1135
1141
|
...t
|
|
1136
1142
|
}) => {
|
|
1137
|
-
const { triggerRef: r, leadingElement: s, inputRef: o, isLoading: n, isDisabled: c } =
|
|
1138
|
-
return /* @__PURE__ */
|
|
1143
|
+
const { triggerRef: r, leadingElement: s, inputRef: o, isLoading: n, isDisabled: c } = Me();
|
|
1144
|
+
return /* @__PURE__ */ xe(tr, { ref: r, onClick: (u) => {
|
|
1139
1145
|
!c && u.target instanceof HTMLElement && !u.target.closest("button") && o.current?.focus();
|
|
1140
1146
|
}, ...t, children: [
|
|
1141
1147
|
s && /* @__PURE__ */ g(wr, { children: s }),
|
|
1142
|
-
/* @__PURE__ */
|
|
1148
|
+
/* @__PURE__ */ xe(or, { children: [
|
|
1143
1149
|
/* @__PURE__ */ g(rt, {}),
|
|
1144
1150
|
/* @__PURE__ */ g(tt, {})
|
|
1145
1151
|
] }),
|
|
@@ -1173,7 +1179,7 @@ const nt = ({
|
|
|
1173
1179
|
ref: t,
|
|
1174
1180
|
...r
|
|
1175
1181
|
}) => {
|
|
1176
|
-
const [s, o] =
|
|
1182
|
+
const [s, o] = me(r);
|
|
1177
1183
|
return /* @__PURE__ */ g(lr, { asChild: !0, ...s, children: /* @__PURE__ */ g(
|
|
1178
1184
|
Rt,
|
|
1179
1185
|
{
|
|
@@ -1191,7 +1197,7 @@ function st({
|
|
|
1191
1197
|
ref: t,
|
|
1192
1198
|
...r
|
|
1193
1199
|
}) {
|
|
1194
|
-
const [s, o] =
|
|
1200
|
+
const [s, o] = me(r);
|
|
1195
1201
|
return /* @__PURE__ */ g(ir, { ...s, ref: t, asChild: !0, children: /* @__PURE__ */ g(Bt, { ...o, children: typeof e == "function" ? (c) => {
|
|
1196
1202
|
const l = e(c), u = c;
|
|
1197
1203
|
return wt(l) && (u.id || u.textValue) ? $t(
|
|
@@ -1210,12 +1216,12 @@ function lt({
|
|
|
1210
1216
|
ref: t,
|
|
1211
1217
|
...r
|
|
1212
1218
|
}) {
|
|
1213
|
-
const [s, o] =
|
|
1219
|
+
const [s, o] = me(r);
|
|
1214
1220
|
return /* @__PURE__ */ g(ar, { ...s, asChild: !0, children: /* @__PURE__ */ g(Mt, { ref: t, ...o, children: (n) => {
|
|
1215
1221
|
const c = typeof e == "function" ? e({
|
|
1216
1222
|
...n
|
|
1217
1223
|
}) : e;
|
|
1218
|
-
return n.selectionMode === "multiple" ? /* @__PURE__ */
|
|
1224
|
+
return n.selectionMode === "multiple" ? /* @__PURE__ */ xe(He, { children: [
|
|
1219
1225
|
/* @__PURE__ */ g(ur, { children: /* @__PURE__ */ g("span", { "data-selected": n.isSelected, children: n.isSelected && /* @__PURE__ */ g(Et, {}) }) }),
|
|
1220
1226
|
/* @__PURE__ */ g(dr, { children: c })
|
|
1221
1227
|
] }) : /* @__PURE__ */ g(He, { children: c });
|
|
@@ -1233,7 +1239,7 @@ function it({
|
|
|
1233
1239
|
throw new Error(
|
|
1234
1240
|
'ComboBox.Section: When "items" is provided, "children" must be a function'
|
|
1235
1241
|
);
|
|
1236
|
-
return /* @__PURE__ */
|
|
1242
|
+
return /* @__PURE__ */ xe(At, { ref: s, ...o, children: [
|
|
1237
1243
|
t && /* @__PURE__ */ g(cr, { asChild: !0, children: /* @__PURE__ */ g(Kt, { children: t }) }),
|
|
1238
1244
|
r ? /* @__PURE__ */ g(Ot, { items: r, children: (n) => typeof e == "function" ? e(n) : null }) : e
|
|
1239
1245
|
] });
|
|
@@ -1548,4 +1554,4 @@ const oo = {
|
|
|
1548
1554
|
export {
|
|
1549
1555
|
oo as C
|
|
1550
1556
|
};
|
|
1551
|
-
//# sourceMappingURL=combobox-
|
|
1557
|
+
//# sourceMappingURL=combobox-CMm8VWO_.es.js.map
|