@commercetools/nimbus 0.0.0-canary-20260116161853 → 0.0.0-canary-20260119093042
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/{DateField-C0JaKbSn.es.js → DateField-DCWy1Ysp.es.js} +2 -2
- package/dist/chunks/{DateField-C0JaKbSn.es.js.map → DateField-DCWy1Ysp.es.js.map} +1 -1
- package/dist/chunks/{DatePicker-yMmjwrzP.es.js → DatePicker-CL72jbDo.es.js} +2 -2
- package/dist/chunks/{DatePicker-yMmjwrzP.es.js.map → DatePicker-CL72jbDo.es.js.map} +1 -1
- package/dist/chunks/combobox-B7ck7gxL.cjs.js +2 -0
- package/dist/chunks/combobox-B7ck7gxL.cjs.js.map +1 -0
- package/dist/chunks/{combobox-h1qOiDJD.es.js → combobox-vjauyzlS.es.js} +365 -363
- package/dist/chunks/combobox-vjauyzlS.es.js.map +1 -0
- package/dist/chunks/{date-input-BR-AeTsM.es.js → date-input-Cd9q4qBj.es.js} +2 -2
- package/dist/chunks/{date-input-BR-AeTsM.es.js.map → date-input-Cd9q4qBj.es.js.map} +1 -1
- package/dist/chunks/{date-picker-4vPcj4T0.es.js → date-picker-B8VVNXU3.es.js} +5 -5
- package/dist/chunks/{date-picker-4vPcj4T0.es.js.map → date-picker-B8VVNXU3.es.js.map} +1 -1
- package/dist/chunks/{date-range-picker-D3cnZQYb.es.js → date-range-picker-BnbKgO1E.es.js} +5 -5
- package/dist/chunks/{date-range-picker-D3cnZQYb.es.js.map → date-range-picker-BnbKgO1E.es.js.map} +1 -1
- package/dist/chunks/{date-range-picker-field-BKmTQ50O.es.js → date-range-picker-field-BuI6eLMY.es.js} +2 -2
- package/dist/chunks/{date-range-picker-field-BKmTQ50O.es.js.map → date-range-picker-field-BuI6eLMY.es.js.map} +1 -1
- package/dist/chunks/{time-input-C_igRgEc.es.js → time-input-CCuIFoY2.es.js} +2 -2
- package/dist/chunks/{time-input-C_igRgEc.es.js.map → time-input-CCuIFoY2.es.js.map} +1 -1
- package/dist/components/combobox.cjs +1 -1
- package/dist/components/combobox.es.js +1 -1
- package/dist/components/date-input.es.js +1 -1
- package/dist/components/date-picker.es.js +1 -1
- package/dist/components/date-range-picker-field.es.js +1 -1
- package/dist/components/date-range-picker.es.js +1 -1
- package/dist/components/fields.es.js +1 -1
- package/dist/components/patterns.es.js +1 -1
- package/dist/components/time-input.es.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.es.js +6 -6
- package/package.json +6 -6
- package/dist/chunks/combobox-Do4z66WO.cjs.js +0 -2
- package/dist/chunks/combobox-Do4z66WO.cjs.js.map +0 -1
- package/dist/chunks/combobox-h1qOiDJD.es.js.map +0 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { jsx as g, jsxs as
|
|
2
|
-
import { useReducer as St, useRef as
|
|
1
|
+
import { jsx as g, jsxs as ve, Fragment as He } from "react/jsx-runtime";
|
|
2
|
+
import { useReducer as St, useRef as A, useEffect as Y, createContext as Qe, useMemo as _, useContext as Pe, useState as Z, 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
|
-
import { f as Ft, g as
|
|
6
|
-
import { createSlotRecipeContext as
|
|
7
|
-
import { Close as
|
|
8
|
-
import { e as
|
|
9
|
-
import { P as
|
|
5
|
+
import { f as Ft, g as Ot } from "./CollectionBuilder-BOe312C_.es.js";
|
|
6
|
+
import { createSlotRecipeContext as Vt } from "@chakra-ui/react";
|
|
7
|
+
import { Close as Lt, KeyboardArrowDown as Tt, Check as Et } from "@commercetools/nimbus-icons";
|
|
8
|
+
import { e as fe } from "./extract-style-props-BdibuNZ7.es.js";
|
|
9
|
+
import { P as Rt } from "./popover-CuA9VugH.es.js";
|
|
10
10
|
import { I as Ue } from "./icon-button-CosIm3oY.es.js";
|
|
11
|
-
import { L as
|
|
11
|
+
import { L as Pt } from "./loading-spinner-gf62wtm3.es.js";
|
|
12
12
|
import { $ as Me, a as Dt } from "./Input-Cmg08oRP.es.js";
|
|
13
|
-
import { $ as De, T as
|
|
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";
|
|
16
|
-
import { $ as
|
|
16
|
+
import { $ as Ee } from "./Button-BjcDZ5eb.es.js";
|
|
17
17
|
import { $ as kt, e as Ye } from "./utils-B6pV5ewr.es.js";
|
|
18
18
|
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 xe, 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";
|
|
@@ -87,8 +87,8 @@ function Qt(e, t) {
|
|
|
87
87
|
case "loadingMore":
|
|
88
88
|
case "sorting":
|
|
89
89
|
case "filtering":
|
|
90
|
-
var
|
|
91
|
-
(
|
|
90
|
+
var h;
|
|
91
|
+
(h = e.abortController) === null || h === void 0 || h.abort();
|
|
92
92
|
var d;
|
|
93
93
|
return {
|
|
94
94
|
...e,
|
|
@@ -115,16 +115,16 @@ function Qt(e, t) {
|
|
|
115
115
|
...e.selectedKeys,
|
|
116
116
|
...(p = t.selectedKeys) !== null && p !== void 0 ? p : []
|
|
117
117
|
]);
|
|
118
|
-
var
|
|
118
|
+
var K, T;
|
|
119
119
|
return {
|
|
120
120
|
...e,
|
|
121
121
|
state: "idle",
|
|
122
122
|
items: [
|
|
123
123
|
...e.items,
|
|
124
|
-
...(
|
|
124
|
+
...(K = t.items) !== null && K !== void 0 ? K : []
|
|
125
125
|
],
|
|
126
126
|
selectedKeys: r,
|
|
127
|
-
sortDescriptor: (
|
|
127
|
+
sortDescriptor: (T = t.sortDescriptor) !== null && T !== void 0 ? T : e.sortDescriptor,
|
|
128
128
|
abortController: void 0,
|
|
129
129
|
cursor: t.cursor
|
|
130
130
|
};
|
|
@@ -137,20 +137,20 @@ function Qt(e, t) {
|
|
|
137
137
|
case "loading":
|
|
138
138
|
case "sorting":
|
|
139
139
|
case "filtering":
|
|
140
|
-
var
|
|
141
|
-
(
|
|
142
|
-
var
|
|
140
|
+
var I;
|
|
141
|
+
(I = e.abortController) === null || I === void 0 || I.abort();
|
|
142
|
+
var y;
|
|
143
143
|
return {
|
|
144
144
|
...e,
|
|
145
|
-
filterText: (
|
|
145
|
+
filterText: (y = t.filterText) !== null && y !== void 0 ? y : e.filterText,
|
|
146
146
|
state: t.type,
|
|
147
147
|
// Reset items to an empty list if loading, but not when sorting.
|
|
148
148
|
items: t.type === "loading" ? [] : e.items,
|
|
149
149
|
abortController: t.abortController
|
|
150
150
|
};
|
|
151
151
|
case "loadingMore":
|
|
152
|
-
var
|
|
153
|
-
return (
|
|
152
|
+
var F;
|
|
153
|
+
return (F = t.abortController) === null || F === void 0 || F.abort(), e;
|
|
154
154
|
case "update":
|
|
155
155
|
var $;
|
|
156
156
|
return {
|
|
@@ -181,41 +181,41 @@ function Xt(e) {
|
|
|
181
181
|
...d,
|
|
182
182
|
abortController: p
|
|
183
183
|
});
|
|
184
|
+
var K;
|
|
185
|
+
let y = (K = d.filterText) !== null && K !== void 0 ? K : l.filterText;
|
|
184
186
|
var T;
|
|
185
|
-
let
|
|
186
|
-
var M;
|
|
187
|
-
let I = await w({
|
|
187
|
+
let F = await w({
|
|
188
188
|
items: l.items.slice(),
|
|
189
189
|
selectedKeys: l.selectedKeys,
|
|
190
|
-
sortDescriptor: (
|
|
190
|
+
sortDescriptor: (T = d.sortDescriptor) !== null && T !== void 0 ? T : l.sortDescriptor,
|
|
191
191
|
signal: p.signal,
|
|
192
192
|
cursor: d.type === "loadingMore" ? l.cursor : void 0,
|
|
193
|
-
filterText:
|
|
193
|
+
filterText: y,
|
|
194
194
|
loadingState: l.state
|
|
195
195
|
});
|
|
196
|
-
var
|
|
197
|
-
let $ = (
|
|
196
|
+
var I;
|
|
197
|
+
let $ = (I = F.filterText) !== null && I !== void 0 ? I : y;
|
|
198
198
|
u({
|
|
199
199
|
type: "success",
|
|
200
|
-
...
|
|
200
|
+
...F,
|
|
201
201
|
abortController: p
|
|
202
|
-
}), $ && $ !==
|
|
202
|
+
}), $ && $ !== y && !p.signal.aborted && b({
|
|
203
203
|
type: "filtering",
|
|
204
204
|
filterText: $
|
|
205
205
|
}, t);
|
|
206
|
-
} catch (
|
|
206
|
+
} catch (y) {
|
|
207
207
|
u({
|
|
208
208
|
type: "error",
|
|
209
|
-
error:
|
|
209
|
+
error: y,
|
|
210
210
|
abortController: p
|
|
211
211
|
});
|
|
212
212
|
}
|
|
213
213
|
};
|
|
214
|
-
let
|
|
215
|
-
return
|
|
216
|
-
|
|
214
|
+
let h = A(!1);
|
|
215
|
+
return Y(() => {
|
|
216
|
+
h.current || (b({
|
|
217
217
|
type: "loading"
|
|
218
|
-
}, t),
|
|
218
|
+
}, t), h.current = !0);
|
|
219
219
|
}, []), {
|
|
220
220
|
items: l.items,
|
|
221
221
|
selectedKeys: l.selectedKeys,
|
|
@@ -263,61 +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 =
|
|
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), p = A(!0), K = A(), T = A();
|
|
267
267
|
w.current = e;
|
|
268
|
-
var
|
|
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
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
var D = function(y) {
|
|
279
|
-
var V = b.current, Z = x.current;
|
|
280
|
-
return b.current = x.current = null, c.current = y, l.current = l.current || y, d.current = w.current.apply(Z, V);
|
|
281
|
-
}, G = function(y, V) {
|
|
282
|
-
M && cancelAnimationFrame(u.current), u.current = M ? requestAnimationFrame(y) : setTimeout(y, V);
|
|
283
|
-
}, re = function(y) {
|
|
271
|
+
var F = !!(r = r || {}).leading, $ = !("trailing" in r) || !!r.trailing, H = !!r.flushOnExit && $, U = "maxWait" in r, q = "debounceOnServer" in r && !!r.debounceOnServer, J = U ? Math.max(+r.maxWait || 0, t) : null, ne = _(function() {
|
|
272
|
+
var P = function(x) {
|
|
273
|
+
var O = b.current, D = h.current;
|
|
274
|
+
return b.current = h.current = null, c.current = x, l.current = l.current || x, d.current = w.current.apply(D, O);
|
|
275
|
+
}, Q = function(x, O) {
|
|
276
|
+
y && cancelAnimationFrame(u.current), u.current = y ? requestAnimationFrame(x) : setTimeout(x, O);
|
|
277
|
+
}, se = function(x) {
|
|
284
278
|
if (!p.current) return !1;
|
|
285
|
-
var
|
|
286
|
-
return !n.current ||
|
|
287
|
-
},
|
|
288
|
-
return u.current = null,
|
|
289
|
-
},
|
|
290
|
-
var
|
|
291
|
-
if (
|
|
279
|
+
var O = x - n.current;
|
|
280
|
+
return !n.current || O >= t || O < 0 || U && x - c.current >= J;
|
|
281
|
+
}, le = function(x) {
|
|
282
|
+
return u.current = null, $ && b.current ? P(x) : (b.current = h.current = null, d.current);
|
|
283
|
+
}, B = function x() {
|
|
284
|
+
var O = Date.now();
|
|
285
|
+
if (F && l.current === c.current && me(), se(O)) return le(O);
|
|
292
286
|
if (p.current) {
|
|
293
|
-
var
|
|
294
|
-
|
|
287
|
+
var D = t - (O - n.current), j = U ? Math.min(D, J - (O - c.current)) : D;
|
|
288
|
+
Q(x, j);
|
|
295
289
|
}
|
|
296
|
-
},
|
|
297
|
-
},
|
|
298
|
-
if (
|
|
299
|
-
var
|
|
300
|
-
if (b.current = [].slice.call(arguments),
|
|
301
|
-
|
|
302
|
-
|
|
290
|
+
}, me = function() {
|
|
291
|
+
}, ee = function() {
|
|
292
|
+
if (I || q) {
|
|
293
|
+
var x, O = Date.now(), D = se(O);
|
|
294
|
+
if (b.current = [].slice.call(arguments), h.current = o, n.current = O, H && !K.current && (K.current = function() {
|
|
295
|
+
var j;
|
|
296
|
+
((j = global.document) == null ? void 0 : j.visibilityState) === "hidden" && T.current.flush();
|
|
297
|
+
}, (x = global.document) == null || x.addEventListener == null || x.addEventListener("visibilitychange", K.current)), D) {
|
|
298
|
+
if (!u.current && p.current) return c.current = n.current, Q(B, t), F ? P(n.current) : d.current;
|
|
299
|
+
if (U) return Q(B, t), P(n.current);
|
|
303
300
|
}
|
|
304
|
-
return u.current ||
|
|
301
|
+
return u.current || Q(B, t), d.current;
|
|
305
302
|
}
|
|
306
303
|
};
|
|
307
|
-
return
|
|
308
|
-
var
|
|
309
|
-
|
|
310
|
-
},
|
|
304
|
+
return ee.cancel = function() {
|
|
305
|
+
var x = u.current;
|
|
306
|
+
x && (y ? cancelAnimationFrame(u.current) : clearTimeout(u.current)), c.current = 0, b.current = n.current = h.current = u.current = null;
|
|
307
|
+
}, ee.isPending = function() {
|
|
311
308
|
return !!u.current;
|
|
312
|
-
},
|
|
313
|
-
return u.current ?
|
|
314
|
-
},
|
|
315
|
-
}, [
|
|
316
|
-
return
|
|
309
|
+
}, ee.flush = function() {
|
|
310
|
+
return u.current ? le(Date.now()) : d.current;
|
|
311
|
+
}, ee;
|
|
312
|
+
}, [F, U, t, J, $, H, y, I, q, s]);
|
|
313
|
+
return T.current = ne, Y(function() {
|
|
314
|
+
return p.current = !0, function() {
|
|
315
|
+
var P;
|
|
316
|
+
H && T.current.flush(), K.current && ((P = global.document) == null || P.removeEventListener == null || P.removeEventListener("visibilitychange", K.current), K.current = null), p.current = !1;
|
|
317
|
+
};
|
|
318
|
+
}, [H]), ne;
|
|
317
319
|
}
|
|
318
|
-
const { withProvider: _t, withContext:
|
|
320
|
+
const { withProvider: _t, withContext: G } = /* @__PURE__ */ Vt({
|
|
319
321
|
key: "combobox"
|
|
320
|
-
}), er = /* @__PURE__ */ _t("div", "root"), tr = /* @__PURE__ */
|
|
322
|
+
}), er = /* @__PURE__ */ _t("div", "root"), tr = /* @__PURE__ */ G("div", "trigger"), rr = /* @__PURE__ */ G("div", "leadingElement"), or = /* @__PURE__ */ G("div", "content"), nr = /* @__PURE__ */ G("div", "tagGroup"), sr = /* @__PURE__ */ G("div", "input"), lr = /* @__PURE__ */ G("div", "popover"), ir = /* @__PURE__ */ G("div", "listBox"), cr = /* @__PURE__ */ G("div", "section"), ar = /* @__PURE__ */ G("div", "option"), ur = /* @__PURE__ */ G("div", "optionIndicator"), dr = /* @__PURE__ */ G("div", "optionContent"), fr = {
|
|
321
323
|
clearSelection: "Clear selection",
|
|
322
324
|
toggleOptions: "Toggle options",
|
|
323
325
|
selectedValues: "Selected values",
|
|
@@ -343,11 +345,11 @@ const { withProvider: _t, withContext: W } = /* @__PURE__ */ Ot({
|
|
|
343
345
|
selectedValues: "Valores selecionados",
|
|
344
346
|
options: "Menu de opções"
|
|
345
347
|
}, br = {
|
|
346
|
-
en: /* @__PURE__ */
|
|
347
|
-
de: /* @__PURE__ */
|
|
348
|
-
es: /* @__PURE__ */
|
|
349
|
-
"fr-FR": /* @__PURE__ */
|
|
350
|
-
"pt-BR": /* @__PURE__ */
|
|
348
|
+
en: /* @__PURE__ */ xe(fr),
|
|
349
|
+
de: /* @__PURE__ */ xe(mr),
|
|
350
|
+
es: /* @__PURE__ */ xe(pr),
|
|
351
|
+
"fr-FR": /* @__PURE__ */ xe(gr),
|
|
352
|
+
"pt-BR": /* @__PURE__ */ xe(yr)
|
|
351
353
|
};
|
|
352
354
|
function Ze(e) {
|
|
353
355
|
if (typeof e == "string" || typeof e == "number")
|
|
@@ -369,8 +371,8 @@ function xr(e) {
|
|
|
369
371
|
name: e
|
|
370
372
|
};
|
|
371
373
|
}
|
|
372
|
-
const vr = (e) => e ? e instanceof Set ? e : new Set(Array.isArray(e) ? e : [e]) : /* @__PURE__ */ new Set(), Cr = (e) => Array.from(e),
|
|
373
|
-
const e =
|
|
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), Ae = () => {
|
|
375
|
+
const e = Pe(Re);
|
|
374
376
|
if (!e)
|
|
375
377
|
throw new Error(
|
|
376
378
|
"Nimbus - ComboBox components must be used within ComboBox.Root"
|
|
@@ -388,17 +390,17 @@ const vr = (e) => e ? e instanceof Set ? e : new Set(Array.isArray(e) ? e : [e])
|
|
|
388
390
|
inputValue: u
|
|
389
391
|
} = e;
|
|
390
392
|
if (!t) return null;
|
|
391
|
-
const b =
|
|
393
|
+
const b = _(() => {
|
|
392
394
|
if (o === "single") {
|
|
393
|
-
const
|
|
394
|
-
return
|
|
395
|
-
(w) => w.key ===
|
|
396
|
-
)?.textValue || u || "" : String(
|
|
395
|
+
const h = Array.from(s)[0];
|
|
396
|
+
return h ? n === "text" || c ? Array.from(l).find(
|
|
397
|
+
(w) => w.key === h
|
|
398
|
+
)?.textValue || u || "" : String(h) : "";
|
|
397
399
|
} else {
|
|
398
|
-
const
|
|
399
|
-
return n === "text" || c ?
|
|
400
|
+
const h = Array.from(s);
|
|
401
|
+
return n === "text" || c ? h.map((d) => Array.from(l).find(
|
|
400
402
|
(p) => p.key === d
|
|
401
|
-
)?.textValue || "").filter(Boolean).join(",") :
|
|
403
|
+
)?.textValue || "").filter(Boolean).join(",") : h.join(",");
|
|
402
404
|
}
|
|
403
405
|
}, [
|
|
404
406
|
o,
|
|
@@ -431,72 +433,72 @@ function et(e) {
|
|
|
431
433
|
leadingElement: l,
|
|
432
434
|
inputValue: u,
|
|
433
435
|
onInputChange: b,
|
|
434
|
-
isLoading:
|
|
436
|
+
isLoading: h,
|
|
435
437
|
allowsEmptyMenu: d,
|
|
436
438
|
renderEmptyState: w,
|
|
437
439
|
async: p,
|
|
438
|
-
filter:
|
|
439
|
-
allowsCustomOptions:
|
|
440
|
-
isDisabled:
|
|
441
|
-
isInvalid:
|
|
442
|
-
isRequired:
|
|
440
|
+
filter: K,
|
|
441
|
+
allowsCustomOptions: T = !1,
|
|
442
|
+
isDisabled: I = !1,
|
|
443
|
+
isInvalid: y = !1,
|
|
444
|
+
isRequired: F = !1,
|
|
443
445
|
isReadOnly: $ = !1
|
|
444
|
-
} = e,
|
|
446
|
+
} = e, H = zt({ key: "combobox" }), [U, q] = H.splitVariantProps(e), [J, ne] = fe(q), P = A(null), Q = A(null), [se, le] = Z([]), B = Xt({
|
|
445
447
|
getKey: o,
|
|
446
|
-
async load({ signal:
|
|
448
|
+
async load({ signal: M, filterText: k }) {
|
|
447
449
|
if (!p) return { items: [] };
|
|
448
450
|
const v = p.minSearchLength ?? 0;
|
|
449
|
-
if (!
|
|
451
|
+
if (!k || k.length < v)
|
|
450
452
|
return { items: [] };
|
|
451
453
|
try {
|
|
452
|
-
return { items: await p.load(
|
|
453
|
-
} catch (
|
|
454
|
-
if (
|
|
455
|
-
throw
|
|
456
|
-
const
|
|
457
|
-
return p.onError?.(
|
|
454
|
+
return { items: await p.load(k, M) };
|
|
455
|
+
} catch (V) {
|
|
456
|
+
if (V.name === "AbortError")
|
|
457
|
+
throw V;
|
|
458
|
+
const te = V;
|
|
459
|
+
return p.onError?.(te), { items: [] };
|
|
458
460
|
}
|
|
459
461
|
}
|
|
460
|
-
}), [
|
|
461
|
-
|
|
462
|
+
}), [me, ee] = Z(u), [x, O] = Z(!1), [D, j] = Z([]), Fe = p?.debounce ?? 300, Ce = Zt((M) => {
|
|
463
|
+
O(!1), B.setFilterText(M);
|
|
462
464
|
}, Fe), Se = R(
|
|
463
|
-
(
|
|
464
|
-
|
|
465
|
+
(M) => {
|
|
466
|
+
ee(M), O(!0), Ce(M);
|
|
465
467
|
},
|
|
466
468
|
[Ce]
|
|
467
|
-
),
|
|
468
|
-
const
|
|
469
|
-
let
|
|
470
|
-
(
|
|
471
|
-
), ...
|
|
472
|
-
if (p && r === "multiple" &&
|
|
473
|
-
const
|
|
474
|
-
|
|
475
|
-
(
|
|
476
|
-
), ...
|
|
469
|
+
), z = p ? me : u, we = p ? Se : b, X = p ? x || B.loadingState === "loading" || B.loadingState === "loadingMore" || B.loadingState === "filtering" : h, $e = p || T ? !0 : d, Ke = R(() => X ? z?.length ? `loading results for "${z}"` : "loading results" : z?.length && p?.minSearchLength && z.length >= p.minSearchLength ? `no results for "${z}"` : p?.minSearchLength ? `enter at least ${p?.minSearchLength} characters` : "type to search", [p?.minSearchLength, X, z]), Ie = R(() => X ? z?.length ? `loading results for "${z}"` : "loading results" : 'hit "enter" to create an option', [X, z]), ge = (T ? Ie : p ? Ke : void 0) ?? w, ue = _(() => {
|
|
470
|
+
const M = p ? Array.from(B.items) : e.items, k = M ? Array.from(M) : [], v = new Set(k.map((ie) => o(ie)));
|
|
471
|
+
let te = [...se.filter(
|
|
472
|
+
(ie) => !v.has(o(ie))
|
|
473
|
+
), ...k];
|
|
474
|
+
if (p && r === "multiple" && D.length > 0) {
|
|
475
|
+
const ie = new Set(te.map((L) => o(L)));
|
|
476
|
+
te = [...D.filter(
|
|
477
|
+
(L) => !ie.has(o(L))
|
|
478
|
+
), ...te];
|
|
477
479
|
}
|
|
478
|
-
return
|
|
480
|
+
return te;
|
|
479
481
|
}, [
|
|
480
482
|
p,
|
|
481
|
-
|
|
483
|
+
B.items,
|
|
482
484
|
e.items,
|
|
483
|
-
|
|
484
|
-
|
|
485
|
+
se,
|
|
486
|
+
D,
|
|
485
487
|
r,
|
|
486
488
|
o
|
|
487
|
-
]),
|
|
489
|
+
]), ye = _(
|
|
488
490
|
() => ({
|
|
489
491
|
selectionMode: r,
|
|
490
492
|
size: s,
|
|
491
493
|
getKey: o,
|
|
492
494
|
getTextValue: n,
|
|
493
495
|
leadingElement: l,
|
|
494
|
-
triggerRef:
|
|
495
|
-
inputRef:
|
|
496
|
-
isLoading:
|
|
497
|
-
isDisabled:
|
|
498
|
-
isRequired:
|
|
499
|
-
isInvalid:
|
|
496
|
+
triggerRef: P,
|
|
497
|
+
inputRef: Q,
|
|
498
|
+
isLoading: X,
|
|
499
|
+
isDisabled: I,
|
|
500
|
+
isRequired: F,
|
|
501
|
+
isInvalid: y,
|
|
500
502
|
isReadOnly: $
|
|
501
503
|
}),
|
|
502
504
|
[
|
|
@@ -504,96 +506,96 @@ function et(e) {
|
|
|
504
506
|
o,
|
|
505
507
|
n,
|
|
506
508
|
l,
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
K,
|
|
509
|
+
P,
|
|
510
|
+
Q,
|
|
510
511
|
I,
|
|
511
|
-
|
|
512
|
+
F,
|
|
513
|
+
y,
|
|
512
514
|
$
|
|
513
515
|
]
|
|
514
|
-
),
|
|
515
|
-
if (
|
|
516
|
-
return Array.from(
|
|
517
|
-
const
|
|
518
|
-
return
|
|
519
|
-
...
|
|
520
|
-
...
|
|
521
|
-
...v ? {} : { textValue: n(
|
|
516
|
+
), be = _(() => {
|
|
517
|
+
if (ue)
|
|
518
|
+
return Array.from(ue).map((M) => {
|
|
519
|
+
const k = "id" in M, v = "textValue" in M;
|
|
520
|
+
return k && v ? M : {
|
|
521
|
+
...M,
|
|
522
|
+
...k ? {} : { id: o(M) },
|
|
523
|
+
...v ? {} : { textValue: n(M) }
|
|
522
524
|
};
|
|
523
525
|
});
|
|
524
|
-
}, [
|
|
526
|
+
}, [ue, o, n]), Oe = _(
|
|
525
527
|
() => /* @__PURE__ */ g(
|
|
526
|
-
|
|
528
|
+
Re.Provider,
|
|
527
529
|
{
|
|
528
|
-
value:
|
|
529
|
-
children: /* @__PURE__ */ g(Xe.Provider, { value: { items:
|
|
530
|
+
value: ye,
|
|
531
|
+
children: /* @__PURE__ */ g(Xe.Provider, { value: { items: be }, children: typeof c == "function" ? c({
|
|
530
532
|
isOpen: !1,
|
|
531
|
-
isDisabled:
|
|
532
|
-
isInvalid:
|
|
533
|
-
isRequired:
|
|
533
|
+
isDisabled: I,
|
|
534
|
+
isInvalid: y,
|
|
535
|
+
isRequired: F,
|
|
534
536
|
defaultChildren: null
|
|
535
537
|
}) : c })
|
|
536
538
|
}
|
|
537
539
|
),
|
|
538
540
|
[
|
|
539
541
|
c,
|
|
540
|
-
K,
|
|
541
|
-
h,
|
|
542
542
|
I,
|
|
543
|
-
|
|
544
|
-
|
|
543
|
+
y,
|
|
544
|
+
F,
|
|
545
|
+
be,
|
|
546
|
+
ye
|
|
545
547
|
]
|
|
546
548
|
);
|
|
547
549
|
return /* @__PURE__ */ g(
|
|
548
550
|
Ye,
|
|
549
551
|
{
|
|
550
552
|
values: [
|
|
551
|
-
[
|
|
553
|
+
[Ee, {}],
|
|
552
554
|
[Me, {}],
|
|
553
555
|
[De, {}]
|
|
554
556
|
],
|
|
555
557
|
children: /* @__PURE__ */ g(
|
|
556
|
-
|
|
558
|
+
Re.Provider,
|
|
557
559
|
{
|
|
558
|
-
value:
|
|
560
|
+
value: ye,
|
|
559
561
|
children: /* @__PURE__ */ g(
|
|
560
562
|
er,
|
|
561
563
|
{
|
|
562
564
|
ref: t,
|
|
563
|
-
...
|
|
564
|
-
...
|
|
565
|
+
...U,
|
|
566
|
+
...J,
|
|
565
567
|
size: s,
|
|
566
|
-
"data-disabled":
|
|
567
|
-
"data-invalid":
|
|
568
|
-
"data-required":
|
|
568
|
+
"data-disabled": I,
|
|
569
|
+
"data-invalid": y,
|
|
570
|
+
"data-required": F,
|
|
569
571
|
"data-readonly": $,
|
|
570
572
|
"data-open": e.isOpen,
|
|
571
573
|
role: "group",
|
|
572
|
-
children: /* @__PURE__ */ g(Ft, { content:
|
|
574
|
+
children: /* @__PURE__ */ g(Ft, { content: Oe, children: (M) => (
|
|
573
575
|
// Pass the built collection to ComboBoxRootInner which handles all behavior
|
|
574
576
|
/* @__PURE__ */ g(
|
|
575
577
|
Sr,
|
|
576
578
|
{
|
|
577
|
-
...
|
|
579
|
+
...ne,
|
|
578
580
|
size: s,
|
|
579
|
-
filter:
|
|
581
|
+
filter: K,
|
|
580
582
|
selectionMode: r,
|
|
581
|
-
inputValue:
|
|
583
|
+
inputValue: z,
|
|
582
584
|
onInputChange: we,
|
|
583
585
|
getKey: o,
|
|
584
586
|
getTextValue: n,
|
|
585
587
|
allowsEmptyMenu: $e,
|
|
586
|
-
renderEmptyState:
|
|
587
|
-
isDisabled:
|
|
588
|
-
isRequired:
|
|
589
|
-
isInvalid:
|
|
588
|
+
renderEmptyState: ge,
|
|
589
|
+
isDisabled: I,
|
|
590
|
+
isRequired: F,
|
|
591
|
+
isInvalid: y,
|
|
590
592
|
isReadOnly: $,
|
|
591
|
-
collection:
|
|
592
|
-
allowsCustomOptions:
|
|
593
|
+
collection: M,
|
|
594
|
+
allowsCustomOptions: T,
|
|
593
595
|
asyncConfig: p,
|
|
594
|
-
onAsyncSelectedItemsChange: p && r === "multiple" ?
|
|
595
|
-
onAddCustomItem:
|
|
596
|
-
onAddAsyncSelectedItem:
|
|
596
|
+
onAsyncSelectedItemsChange: p && r === "multiple" ? j : void 0,
|
|
597
|
+
onAddCustomItem: le,
|
|
598
|
+
onAddAsyncSelectedItem: j
|
|
597
599
|
}
|
|
598
600
|
)
|
|
599
601
|
) })
|
|
@@ -615,110 +617,110 @@ const Sr = (e) => {
|
|
|
615
617
|
selectedKeys: l = [],
|
|
616
618
|
onSelectionChange: u,
|
|
617
619
|
disabledKeys: b,
|
|
618
|
-
inputValue:
|
|
620
|
+
inputValue: h = "",
|
|
619
621
|
onInputChange: d,
|
|
620
622
|
filter: w,
|
|
621
623
|
placeholder: p,
|
|
622
|
-
menuTrigger:
|
|
623
|
-
shouldCloseOnBlur:
|
|
624
|
-
shouldCloseOnSelect:
|
|
625
|
-
isOpen:
|
|
626
|
-
defaultOpen:
|
|
624
|
+
menuTrigger: K = "input",
|
|
625
|
+
shouldCloseOnBlur: T = !0,
|
|
626
|
+
shouldCloseOnSelect: I = !0,
|
|
627
|
+
isOpen: y,
|
|
628
|
+
defaultOpen: F = !1,
|
|
627
629
|
onOpenChange: $,
|
|
628
|
-
allowsEmptyMenu:
|
|
629
|
-
renderEmptyState:
|
|
630
|
-
allowsCustomOptions:
|
|
631
|
-
isValidNewOption:
|
|
632
|
-
getNewOptionData:
|
|
633
|
-
onCreateOption:
|
|
634
|
-
"aria-label":
|
|
635
|
-
"aria-labelledby":
|
|
636
|
-
"aria-describedby":
|
|
637
|
-
isDisabled:
|
|
638
|
-
isRequired:
|
|
639
|
-
isInvalid:
|
|
640
|
-
isReadOnly:
|
|
641
|
-
shouldFocusWrap:
|
|
642
|
-
autoFocus:
|
|
643
|
-
name:
|
|
630
|
+
allowsEmptyMenu: H = !1,
|
|
631
|
+
renderEmptyState: U,
|
|
632
|
+
allowsCustomOptions: q = !1,
|
|
633
|
+
isValidNewOption: J,
|
|
634
|
+
getNewOptionData: ne = xr,
|
|
635
|
+
onCreateOption: P,
|
|
636
|
+
"aria-label": Q,
|
|
637
|
+
"aria-labelledby": se,
|
|
638
|
+
"aria-describedby": le,
|
|
639
|
+
isDisabled: B = !1,
|
|
640
|
+
isRequired: me = !1,
|
|
641
|
+
isInvalid: ee = !1,
|
|
642
|
+
isReadOnly: x = !1,
|
|
643
|
+
shouldFocusWrap: O = !0,
|
|
644
|
+
autoFocus: D = !1,
|
|
645
|
+
name: j,
|
|
644
646
|
formValue: Fe,
|
|
645
647
|
validationBehavior: Ce = "aria",
|
|
646
648
|
form: Se,
|
|
647
|
-
validate:
|
|
649
|
+
validate: z,
|
|
648
650
|
isLoading: we,
|
|
649
|
-
asyncConfig:
|
|
651
|
+
asyncConfig: X,
|
|
650
652
|
onAsyncSelectedItemsChange: $e,
|
|
651
653
|
onAddCustomItem: Ke,
|
|
652
654
|
onAddAsyncSelectedItem: Ie
|
|
653
|
-
} = e,
|
|
655
|
+
} = e, pe = Je(), ge = Je(), ue = A(null), ye = A(null), be = _(
|
|
654
656
|
() => vr(l),
|
|
655
657
|
[l]
|
|
656
|
-
),
|
|
657
|
-
|
|
658
|
-
), v =
|
|
659
|
-
if (
|
|
660
|
-
if (
|
|
658
|
+
), Oe = !!u, [M, k] = Z(
|
|
659
|
+
be
|
|
660
|
+
), v = Oe ? be : M, V = d !== void 0, te = () => {
|
|
661
|
+
if (h) return h;
|
|
662
|
+
if (V || r !== "single") return "";
|
|
661
663
|
const i = Array.from(v);
|
|
662
664
|
if (i.length === 0) return "";
|
|
663
665
|
const a = i[0];
|
|
664
666
|
return o.getItem(a)?.textValue ?? "";
|
|
665
|
-
}, [
|
|
666
|
-
|
|
667
|
-
),
|
|
667
|
+
}, [ie, re] = Z(
|
|
668
|
+
te
|
|
669
|
+
), L = V ? h : ie, oe = A(L), [at, ze] = Z(F), C = y ?? at, [Ve, he] = Z(
|
|
668
670
|
null
|
|
669
|
-
),
|
|
671
|
+
), E = R(
|
|
670
672
|
(i) => {
|
|
671
|
-
|
|
673
|
+
y === void 0 && ze(i), $?.(i);
|
|
672
674
|
},
|
|
673
|
-
[
|
|
674
|
-
), ut =
|
|
675
|
-
if (
|
|
675
|
+
[y, $]
|
|
676
|
+
), ut = _(() => {
|
|
677
|
+
if (L.trim() === "")
|
|
676
678
|
return o;
|
|
677
679
|
if (r === "single") {
|
|
678
680
|
const a = Array.from(v);
|
|
679
681
|
if (a.length > 0) {
|
|
680
682
|
const f = a[0];
|
|
681
|
-
if (o.getItem(f)?.textValue ===
|
|
683
|
+
if (o.getItem(f)?.textValue === L)
|
|
682
684
|
return o;
|
|
683
685
|
}
|
|
684
686
|
}
|
|
685
687
|
if (w) {
|
|
686
|
-
const a = Array.from(o), f = Array.from(w(a,
|
|
687
|
-
return o.filter?.((Be,
|
|
688
|
+
const a = Array.from(o), f = Array.from(w(a, L)), S = new Set(f.map((Be) => Be.key));
|
|
689
|
+
return o.filter?.((Be, Le) => S.has(Le.key)) ?? o;
|
|
688
690
|
}
|
|
689
|
-
const i =
|
|
691
|
+
const i = L.toLowerCase();
|
|
690
692
|
return o.filter?.((a) => a.toLowerCase().includes(i)) ?? o;
|
|
691
|
-
}, [o,
|
|
693
|
+
}, [o, L, w, r, v]), dt = _(
|
|
692
694
|
() => r === "multiple" ? Array.from(v).map((i) => o.getItem(i)?.value).filter((i) => i !== void 0) : [],
|
|
693
695
|
[r, v, o]
|
|
694
|
-
), [ft, mt] =
|
|
695
|
-
const i =
|
|
696
|
-
|
|
697
|
-
}, [
|
|
696
|
+
), [ft, mt] = Z(null), pt = R(() => {
|
|
697
|
+
const i = y === void 0 ? !C : !y;
|
|
698
|
+
y === void 0 ? ze((a) => !a) : $?.(!y), i && (ce.current?.focus(), he("first"));
|
|
699
|
+
}, [y, C, $]), gt = R(
|
|
698
700
|
(i) => {
|
|
699
|
-
|
|
701
|
+
V || re(i), d?.(i), K === "input" && i !== oe.current && E(!0), oe.current = i;
|
|
700
702
|
},
|
|
701
|
-
[
|
|
702
|
-
),
|
|
703
|
+
[V, d, K, E]
|
|
704
|
+
), W = R(
|
|
703
705
|
(i, a) => {
|
|
704
|
-
let f = i === "all" ? new Set(Array.from(o).map((
|
|
705
|
-
const S = a ?? v, Be = f.size > 0 && Array.from(f).every((
|
|
706
|
+
let f = i === "all" ? new Set(Array.from(o).map((N) => N.key)) : i;
|
|
707
|
+
const S = a ?? v, Be = f.size > 0 && Array.from(f).every((N) => S.has(N)) && f.size < S.size;
|
|
706
708
|
if (r === "multiple" && f.size === 1 && !Be) {
|
|
707
|
-
const
|
|
708
|
-
|
|
709
|
+
const N = Array.from(f)[0], de = S.has(N), ae = new Set(S);
|
|
710
|
+
de ? ae.delete(N) : ae.add(N), f = ae;
|
|
709
711
|
}
|
|
710
|
-
const
|
|
711
|
-
if (u ? u(
|
|
712
|
-
const
|
|
713
|
-
$e(
|
|
712
|
+
const Le = Cr(f);
|
|
713
|
+
if (u ? u(Le) : k(f), X && r === "multiple" && $e) {
|
|
714
|
+
const N = Array.from(f).map((de) => o.getItem(de)?.value).filter((de) => de !== void 0);
|
|
715
|
+
$e(N);
|
|
714
716
|
}
|
|
715
717
|
if (r === "single") {
|
|
716
|
-
const
|
|
717
|
-
if (
|
|
718
|
-
const
|
|
719
|
-
|
|
718
|
+
const N = Array.from(f)[0];
|
|
719
|
+
if (N !== null) {
|
|
720
|
+
const ae = o.getItem(N)?.textValue ?? "";
|
|
721
|
+
V || (re(ae), oe.current = ae), d?.(ae);
|
|
720
722
|
}
|
|
721
|
-
|
|
723
|
+
I && E(!1);
|
|
722
724
|
}
|
|
723
725
|
},
|
|
724
726
|
[
|
|
@@ -727,73 +729,73 @@ const Sr = (e) => {
|
|
|
727
729
|
v,
|
|
728
730
|
u,
|
|
729
731
|
d,
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
732
|
+
I,
|
|
733
|
+
E,
|
|
734
|
+
V
|
|
733
735
|
]
|
|
734
736
|
), m = Jt({
|
|
735
737
|
selectionMode: r,
|
|
736
738
|
collection: ut,
|
|
737
739
|
selectedKeys: v,
|
|
738
|
-
onSelectionChange:
|
|
740
|
+
onSelectionChange: W,
|
|
739
741
|
disabledKeys: b
|
|
740
742
|
}), yt = R(() => {
|
|
741
|
-
m.selectionManager.setSelectedKeys(/* @__PURE__ */ new Set()), r === "single" && (
|
|
742
|
-
}, [m.selectionManager, r,
|
|
743
|
+
m.selectionManager.setSelectedKeys(/* @__PURE__ */ new Set()), r === "single" && (V || (re(""), oe.current = ""), d?.(""));
|
|
744
|
+
}, [m.selectionManager, r, V, d]), Ne = R(
|
|
743
745
|
(i) => {
|
|
744
|
-
Ke?.((S) => [...S, i]),
|
|
746
|
+
Ke?.((S) => [...S, i]), X && r === "multiple" && Ie?.((S) => [...S, i]);
|
|
745
747
|
const a = n(i), f = v;
|
|
746
748
|
if (r === "single")
|
|
747
|
-
|
|
749
|
+
W(/* @__PURE__ */ new Set([a]), f);
|
|
748
750
|
else {
|
|
749
751
|
const S = new Set(f);
|
|
750
|
-
S.add(a),
|
|
752
|
+
S.add(a), W(S, f);
|
|
751
753
|
}
|
|
752
754
|
},
|
|
753
755
|
[
|
|
754
756
|
Ke,
|
|
755
|
-
|
|
757
|
+
X,
|
|
756
758
|
r,
|
|
757
759
|
Ie,
|
|
758
760
|
n,
|
|
759
761
|
v,
|
|
760
|
-
|
|
762
|
+
W
|
|
761
763
|
]
|
|
762
764
|
), ke = R(() => {
|
|
763
|
-
if (!
|
|
764
|
-
const i =
|
|
765
|
+
if (!q) return !1;
|
|
766
|
+
const i = L.trim();
|
|
765
767
|
if (!i || Array.from(o).some(
|
|
766
768
|
(S) => S.textValue?.toLowerCase() === i.toLowerCase()
|
|
767
|
-
) ||
|
|
769
|
+
) || J && !J(i))
|
|
768
770
|
return !1;
|
|
769
|
-
const f =
|
|
770
|
-
return Ne(f), r === "multiple" ? (
|
|
771
|
+
const f = ne(i);
|
|
772
|
+
return Ne(f), r === "multiple" ? (V || (re(""), oe.current = ""), d?.("")) : (V || (re(i), oe.current = i), d?.(i)), P?.(f), !0;
|
|
771
773
|
}, [
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
774
|
+
q,
|
|
775
|
+
ne,
|
|
776
|
+
J,
|
|
777
|
+
L,
|
|
776
778
|
o,
|
|
777
779
|
r,
|
|
778
780
|
d,
|
|
779
|
-
|
|
781
|
+
P,
|
|
780
782
|
Ne,
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
783
|
+
V,
|
|
784
|
+
re,
|
|
785
|
+
oe
|
|
784
786
|
]), bt = R(
|
|
785
787
|
(i) => {
|
|
786
|
-
if (
|
|
788
|
+
if (B || x) return;
|
|
787
789
|
const a = v, f = new Set(a);
|
|
788
|
-
i.forEach((S) => f.delete(S)),
|
|
790
|
+
i.forEach((S) => f.delete(S)), W(f, a), f.size === 0 && ce.current?.focus();
|
|
789
791
|
},
|
|
790
|
-
[v,
|
|
792
|
+
[v, W, B, x]
|
|
791
793
|
), ht = R(
|
|
792
794
|
(i) => {
|
|
793
795
|
switch (i.key) {
|
|
794
796
|
case "ArrowDown":
|
|
795
797
|
if (i.preventDefault(), !C)
|
|
796
|
-
|
|
798
|
+
E(!0), he("first");
|
|
797
799
|
else {
|
|
798
800
|
const a = m.selectionManager.focusedKey, f = a ? m.collection.getKeyAfter(a) : m.collection.getFirstKey();
|
|
799
801
|
m.selectionManager.setFocusedKey(
|
|
@@ -803,7 +805,7 @@ const Sr = (e) => {
|
|
|
803
805
|
break;
|
|
804
806
|
case "ArrowUp":
|
|
805
807
|
if (i.preventDefault(), !C)
|
|
806
|
-
|
|
808
|
+
E(!0), he("last");
|
|
807
809
|
else {
|
|
808
810
|
const a = m.selectionManager.focusedKey, f = a ? m.collection.getKeyBefore(a) : m.collection.getLastKey();
|
|
809
811
|
m.selectionManager.setFocusedKey(
|
|
@@ -817,13 +819,13 @@ const Sr = (e) => {
|
|
|
817
819
|
const a = m.selectionManager.focusedKey;
|
|
818
820
|
if (r === "multiple") {
|
|
819
821
|
const f = new Set(v);
|
|
820
|
-
f.has(a) ? f.delete(a) : f.add(a),
|
|
822
|
+
f.has(a) ? f.delete(a) : f.add(a), W(f);
|
|
821
823
|
} else
|
|
822
|
-
|
|
823
|
-
} else C && !m.selectionManager.focusedKey &&
|
|
824
|
+
W(/* @__PURE__ */ new Set([a])), m.selectionManager.setFocusedKey(null);
|
|
825
|
+
} else C && !m.selectionManager.focusedKey && q && ke() && i.preventDefault();
|
|
824
826
|
break;
|
|
825
827
|
case "Escape":
|
|
826
|
-
C && (i.preventDefault(),
|
|
828
|
+
C && (i.preventDefault(), E(!1), m.selectionManager.setFocusedKey(null));
|
|
827
829
|
break;
|
|
828
830
|
case "Home":
|
|
829
831
|
if (C) {
|
|
@@ -840,14 +842,14 @@ const Sr = (e) => {
|
|
|
840
842
|
}
|
|
841
843
|
break;
|
|
842
844
|
case "Backspace":
|
|
843
|
-
if (
|
|
845
|
+
if (L === "") {
|
|
844
846
|
const a = Array.from(v);
|
|
845
847
|
if (a.length > 0)
|
|
846
848
|
if (i.preventDefault(), r === "single")
|
|
847
|
-
|
|
849
|
+
W(/* @__PURE__ */ new Set());
|
|
848
850
|
else {
|
|
849
851
|
const f = new Set(a);
|
|
850
|
-
f.delete(a[a.length - 1]),
|
|
852
|
+
f.delete(a[a.length - 1]), W(f);
|
|
851
853
|
}
|
|
852
854
|
}
|
|
853
855
|
break;
|
|
@@ -857,42 +859,42 @@ const Sr = (e) => {
|
|
|
857
859
|
C,
|
|
858
860
|
m.selectionManager,
|
|
859
861
|
m.collection,
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
862
|
+
W,
|
|
863
|
+
E,
|
|
864
|
+
he,
|
|
863
865
|
r,
|
|
864
|
-
|
|
866
|
+
L,
|
|
865
867
|
v,
|
|
866
|
-
|
|
868
|
+
q,
|
|
867
869
|
ke
|
|
868
870
|
]
|
|
869
871
|
), xt = R(() => {
|
|
870
|
-
|
|
872
|
+
K === "focus" && !B && !x && E(!0), r === "single" && L && ce.current && ce.current.select();
|
|
871
873
|
}, [
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
874
|
+
K,
|
|
875
|
+
B,
|
|
876
|
+
x,
|
|
877
|
+
E,
|
|
876
878
|
r,
|
|
877
|
-
|
|
879
|
+
L
|
|
878
880
|
]), vt = R(
|
|
879
881
|
(i) => {
|
|
880
|
-
if (!
|
|
882
|
+
if (!T) return;
|
|
881
883
|
const a = i.currentTarget;
|
|
882
884
|
setTimeout(() => {
|
|
883
885
|
const f = document.activeElement;
|
|
884
|
-
a.contains(f) ||
|
|
886
|
+
a.contains(f) || E(!1);
|
|
885
887
|
}, 150);
|
|
886
888
|
},
|
|
887
|
-
[
|
|
888
|
-
), We =
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
}, [
|
|
892
|
-
const Ge =
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
}, [C,
|
|
889
|
+
[T, E]
|
|
890
|
+
), We = A(null);
|
|
891
|
+
Y(() => {
|
|
892
|
+
D && ce.current && !B && ce.current.focus();
|
|
893
|
+
}, [D, B]);
|
|
894
|
+
const Ge = A(C);
|
|
895
|
+
Y(() => {
|
|
896
|
+
y === void 0 && Ge.current !== C && (Ge.current = C, $?.(C));
|
|
897
|
+
}, [C, y, $]), Y(() => {
|
|
896
898
|
if (r !== "single") return;
|
|
897
899
|
const i = Array.from(m.selectionManager.selectedKeys), a = i.length > 0 ? i[0] : null;
|
|
898
900
|
if (a === We.current) return;
|
|
@@ -901,35 +903,35 @@ const Sr = (e) => {
|
|
|
901
903
|
if (a !== null && !f)
|
|
902
904
|
return;
|
|
903
905
|
const S = f?.textValue ?? "";
|
|
904
|
-
|
|
906
|
+
V ? d?.(S) : (re(S), oe.current = S);
|
|
905
907
|
}, [
|
|
906
908
|
r,
|
|
907
909
|
m.selectionManager.selectedKeys,
|
|
908
910
|
m.collection,
|
|
909
|
-
|
|
911
|
+
V,
|
|
910
912
|
d
|
|
911
|
-
]),
|
|
912
|
-
if (C &&
|
|
913
|
-
const i =
|
|
914
|
-
m.selectionManager.setFocusedKey(i ?? null),
|
|
913
|
+
]), Y(() => {
|
|
914
|
+
if (C && Ve) {
|
|
915
|
+
const i = Ve === "first" ? m.collection.getFirstKey() : m.collection.getLastKey();
|
|
916
|
+
m.selectionManager.setFocusedKey(i ?? null), he(null);
|
|
915
917
|
}
|
|
916
|
-
}, [C,
|
|
918
|
+
}, [C, Ve, m.collection, m.selectionManager]), Y(() => {
|
|
917
919
|
C ? m.selectionManager.setFocused(!0) : (m.selectionManager.setFocused(!1), m.selectionManager.setFocusedKey(null));
|
|
918
920
|
}, [C, m.selectionManager]);
|
|
919
|
-
const qe =
|
|
920
|
-
m.collection.size > 0 && (qe.current = !0),
|
|
921
|
-
if (!C ||
|
|
922
|
-
m.collection.size > 0 ||
|
|
921
|
+
const qe = A(!1);
|
|
922
|
+
m.collection.size > 0 && (qe.current = !0), Y(() => {
|
|
923
|
+
if (!C || H || we || !qe.current) return;
|
|
924
|
+
m.collection.size > 0 || E(!1);
|
|
923
925
|
}, [
|
|
924
926
|
C,
|
|
925
|
-
|
|
927
|
+
H,
|
|
926
928
|
we,
|
|
927
929
|
m.collection.size,
|
|
928
|
-
|
|
929
|
-
|
|
930
|
+
E,
|
|
931
|
+
L
|
|
930
932
|
]);
|
|
931
|
-
const { triggerRef: je, inputRef:
|
|
932
|
-
|
|
933
|
+
const { triggerRef: je, inputRef: ce } = Ae();
|
|
934
|
+
Y(() => {
|
|
933
935
|
const i = je.current;
|
|
934
936
|
if (!i) return;
|
|
935
937
|
const a = () => {
|
|
@@ -948,33 +950,33 @@ const Sr = (e) => {
|
|
|
948
950
|
[
|
|
949
951
|
Me,
|
|
950
952
|
{
|
|
951
|
-
ref:
|
|
953
|
+
ref: ce,
|
|
952
954
|
role: "combobox",
|
|
953
955
|
// ARIA role for autocomplete input
|
|
954
956
|
"aria-autocomplete": "list",
|
|
955
957
|
// Indicates suggestions are in a list
|
|
956
|
-
"aria-controls": r === "multiple" ? `${
|
|
958
|
+
"aria-controls": r === "multiple" ? `${ge} ${pe}` : pe,
|
|
957
959
|
// Single-select: controls only listbox
|
|
958
960
|
"aria-expanded": C,
|
|
959
961
|
// Announces menu open/closed state
|
|
960
|
-
"aria-activedescendant": m.selectionManager.focusedKey ? `${
|
|
961
|
-
"aria-describedby": r === "multiple" ? `${
|
|
962
|
-
"aria-label":
|
|
963
|
-
"aria-labelledby":
|
|
964
|
-
value:
|
|
962
|
+
"aria-activedescendant": m.selectionManager.focusedKey ? `${pe}-option-${m.selectionManager.focusedKey}` : void 0,
|
|
963
|
+
"aria-describedby": r === "multiple" ? `${ge} ${le ?? ""}` : le,
|
|
964
|
+
"aria-label": Q,
|
|
965
|
+
"aria-labelledby": se,
|
|
966
|
+
value: L,
|
|
965
967
|
onChange: (i) => gt(i.target.value),
|
|
966
968
|
onKeyDown: ht,
|
|
967
969
|
onFocus: xt,
|
|
968
970
|
onBlur: vt,
|
|
969
|
-
disabled:
|
|
970
|
-
readOnly:
|
|
971
|
-
required:
|
|
972
|
-
"aria-invalid":
|
|
971
|
+
disabled: B,
|
|
972
|
+
readOnly: x,
|
|
973
|
+
required: me,
|
|
974
|
+
"aria-invalid": ee,
|
|
973
975
|
placeholder: p,
|
|
974
|
-
name:
|
|
976
|
+
name: j,
|
|
975
977
|
form: Se,
|
|
976
978
|
validationbehavior: Ce,
|
|
977
|
-
validate:
|
|
979
|
+
validate: z
|
|
978
980
|
}
|
|
979
981
|
],
|
|
980
982
|
// TagGroupContext: Props for ComboBox.TagGroup component (multi-select only)
|
|
@@ -982,7 +984,7 @@ const Sr = (e) => {
|
|
|
982
984
|
[
|
|
983
985
|
De,
|
|
984
986
|
{
|
|
985
|
-
id:
|
|
987
|
+
id: ge,
|
|
986
988
|
"aria-label": t.format("selectedValues"),
|
|
987
989
|
items: dt,
|
|
988
990
|
// Selected items to display as tags
|
|
@@ -993,13 +995,13 @@ const Sr = (e) => {
|
|
|
993
995
|
// ButtonContext: Props for toggle and clear buttons
|
|
994
996
|
// Uses "slots" pattern to configure multiple buttons via single context
|
|
995
997
|
[
|
|
996
|
-
|
|
998
|
+
Ee,
|
|
997
999
|
{
|
|
998
1000
|
slots: {
|
|
999
1001
|
toggle: {
|
|
1000
1002
|
onPress: pt,
|
|
1001
1003
|
"aria-label": t.format("toggleOptions"),
|
|
1002
|
-
isDisabled:
|
|
1004
|
+
isDisabled: B || x,
|
|
1003
1005
|
isPressed: C
|
|
1004
1006
|
// Visual indicator that menu is open
|
|
1005
1007
|
},
|
|
@@ -1007,7 +1009,7 @@ const Sr = (e) => {
|
|
|
1007
1009
|
onPress: yt,
|
|
1008
1010
|
"aria-label": t.format("clearSelection"),
|
|
1009
1011
|
style: v.size > 0 ? void 0 : { display: "none" },
|
|
1010
|
-
isDisabled:
|
|
1012
|
+
isDisabled: B || x || m.selectionManager.selectedKeys.size === 0
|
|
1011
1013
|
// Disabled when nothing selected
|
|
1012
1014
|
}
|
|
1013
1015
|
}
|
|
@@ -1022,10 +1024,10 @@ const Sr = (e) => {
|
|
|
1022
1024
|
// No-op onOpenChange: We control state internally, prevent React Aria from managing its own state
|
|
1023
1025
|
onOpenChange: () => {
|
|
1024
1026
|
},
|
|
1025
|
-
ref:
|
|
1027
|
+
ref: ye,
|
|
1026
1028
|
triggerRef: je,
|
|
1027
1029
|
// Popover positions relative to this element
|
|
1028
|
-
scrollRef:
|
|
1030
|
+
scrollRef: ue,
|
|
1029
1031
|
// Enables scroll-into-view for keyboard navigation
|
|
1030
1032
|
isNonModal: !0,
|
|
1031
1033
|
// Non-modal: doesn't trap focus, allows interaction outside
|
|
@@ -1040,7 +1042,7 @@ const Sr = (e) => {
|
|
|
1040
1042
|
clearContexts: [
|
|
1041
1043
|
// Clear these contexts so popover content doesn't inherit combobox contexts
|
|
1042
1044
|
Gt,
|
|
1043
|
-
|
|
1045
|
+
Ee,
|
|
1044
1046
|
Me,
|
|
1045
1047
|
Wt,
|
|
1046
1048
|
jt
|
|
@@ -1057,13 +1059,13 @@ const Sr = (e) => {
|
|
|
1057
1059
|
{
|
|
1058
1060
|
items: s,
|
|
1059
1061
|
// Items to render (merged from outer component)
|
|
1060
|
-
id:
|
|
1062
|
+
id: pe,
|
|
1061
1063
|
// ID referenced by aria-controls on input
|
|
1062
|
-
ref:
|
|
1064
|
+
ref: ue,
|
|
1063
1065
|
// Ref for scroll positioning
|
|
1064
|
-
renderEmptyState:
|
|
1066
|
+
renderEmptyState: U,
|
|
1065
1067
|
// Custom empty state renderer
|
|
1066
|
-
shouldFocusWrap:
|
|
1068
|
+
shouldFocusWrap: O,
|
|
1067
1069
|
// Whether to wrap focus from last to first item
|
|
1068
1070
|
"aria-label": t.format("options")
|
|
1069
1071
|
}
|
|
@@ -1071,7 +1073,7 @@ const Sr = (e) => {
|
|
|
1071
1073
|
// ListStateContext: React Aria's collection state for managing selection and focus
|
|
1072
1074
|
[It, m]
|
|
1073
1075
|
];
|
|
1074
|
-
return /* @__PURE__ */
|
|
1076
|
+
return /* @__PURE__ */ ve(
|
|
1075
1077
|
Ye,
|
|
1076
1078
|
{
|
|
1077
1079
|
values: Ct,
|
|
@@ -1079,14 +1081,14 @@ const Sr = (e) => {
|
|
|
1079
1081
|
/* @__PURE__ */ g(
|
|
1080
1082
|
_e,
|
|
1081
1083
|
{
|
|
1082
|
-
name:
|
|
1084
|
+
name: j,
|
|
1083
1085
|
form: Se,
|
|
1084
1086
|
selectedKeys: v,
|
|
1085
1087
|
selectionMode: r,
|
|
1086
1088
|
formValue: Fe,
|
|
1087
|
-
allowsCustomOptions:
|
|
1089
|
+
allowsCustomOptions: q,
|
|
1088
1090
|
collection: m.collection,
|
|
1089
|
-
inputValue:
|
|
1091
|
+
inputValue: L
|
|
1090
1092
|
}
|
|
1091
1093
|
),
|
|
1092
1094
|
c
|
|
@@ -1094,7 +1096,7 @@ const Sr = (e) => {
|
|
|
1094
1096
|
}
|
|
1095
1097
|
);
|
|
1096
1098
|
}, tt = (e) => {
|
|
1097
|
-
const [t, r] =
|
|
1099
|
+
const [t, r] = fe(e), s = Pe(Me), { inputRef: o } = Ae();
|
|
1098
1100
|
let n = "", c = "";
|
|
1099
1101
|
s && typeof s == "object" && "value" in s && (n = s.value || "", c = s.placeholder || "");
|
|
1100
1102
|
const l = Math.max(n.length || c.length || 1, 1);
|
|
@@ -1112,11 +1114,11 @@ tt.displayName = "ComboBox.Input";
|
|
|
1112
1114
|
const wr = ({
|
|
1113
1115
|
children: e
|
|
1114
1116
|
}) => /* @__PURE__ */ g(rr, { children: e }), rt = (e) => {
|
|
1115
|
-
const { selectionMode: t, size: r, getKey: s, getTextValue: o, isDisabled: n, isReadOnly: c } = Ae(), [l, u] =
|
|
1116
|
-
return t !== "multiple" ? null : /* @__PURE__ */ g(nr, { ...l, ...u, asChild: !0, children: /* @__PURE__ */ g(
|
|
1117
|
+
const { selectionMode: t, size: r, getKey: s, getTextValue: o, isDisabled: n, isReadOnly: c } = Ae(), [l, u] = fe(e), b = Pe(De), h = (b && "items" in b ? b.items : void 0) ?? [];
|
|
1118
|
+
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) => {
|
|
1117
1119
|
const w = s(d), p = o(d);
|
|
1118
1120
|
return /* @__PURE__ */ g(
|
|
1119
|
-
|
|
1121
|
+
Te.Tag,
|
|
1120
1122
|
{
|
|
1121
1123
|
id: w,
|
|
1122
1124
|
textValue: p,
|
|
@@ -1133,11 +1135,11 @@ const ot = ({
|
|
|
1133
1135
|
...t
|
|
1134
1136
|
}) => {
|
|
1135
1137
|
const { triggerRef: r, leadingElement: s, inputRef: o, isLoading: n, isDisabled: c } = Ae();
|
|
1136
|
-
return /* @__PURE__ */
|
|
1138
|
+
return /* @__PURE__ */ ve(tr, { ref: r, onClick: (u) => {
|
|
1137
1139
|
!c && u.target instanceof HTMLElement && !u.target.closest("button") && o.current?.focus();
|
|
1138
1140
|
}, ...t, children: [
|
|
1139
1141
|
s && /* @__PURE__ */ g(wr, { children: s }),
|
|
1140
|
-
/* @__PURE__ */
|
|
1142
|
+
/* @__PURE__ */ ve(or, { children: [
|
|
1141
1143
|
/* @__PURE__ */ g(rt, {}),
|
|
1142
1144
|
/* @__PURE__ */ g(tt, {})
|
|
1143
1145
|
] }),
|
|
@@ -1148,7 +1150,7 @@ const ot = ({
|
|
|
1148
1150
|
size: "2xs",
|
|
1149
1151
|
variant: "ghost",
|
|
1150
1152
|
colorPalette: "primary",
|
|
1151
|
-
children: /* @__PURE__ */ g(
|
|
1153
|
+
children: /* @__PURE__ */ g(Lt, {})
|
|
1152
1154
|
}
|
|
1153
1155
|
),
|
|
1154
1156
|
/* @__PURE__ */ g(
|
|
@@ -1159,7 +1161,7 @@ const ot = ({
|
|
|
1159
1161
|
variant: "ghost",
|
|
1160
1162
|
colorPalette: "neutral",
|
|
1161
1163
|
excludeFromTabOrder: !0,
|
|
1162
|
-
children: n ? /* @__PURE__ */ g(
|
|
1164
|
+
children: n ? /* @__PURE__ */ g(Pt, { size: "xs", margin: "50" }) : /* @__PURE__ */ g(Tt, {})
|
|
1163
1165
|
}
|
|
1164
1166
|
),
|
|
1165
1167
|
e
|
|
@@ -1171,9 +1173,9 @@ const nt = ({
|
|
|
1171
1173
|
ref: t,
|
|
1172
1174
|
...r
|
|
1173
1175
|
}) => {
|
|
1174
|
-
const [s, o] =
|
|
1176
|
+
const [s, o] = fe(r);
|
|
1175
1177
|
return /* @__PURE__ */ g(lr, { asChild: !0, ...s, children: /* @__PURE__ */ g(
|
|
1176
|
-
|
|
1178
|
+
Rt,
|
|
1177
1179
|
{
|
|
1178
1180
|
ref: t,
|
|
1179
1181
|
isNonModal: !0,
|
|
@@ -1189,7 +1191,7 @@ function st({
|
|
|
1189
1191
|
ref: t,
|
|
1190
1192
|
...r
|
|
1191
1193
|
}) {
|
|
1192
|
-
const [s, o] =
|
|
1194
|
+
const [s, o] = fe(r);
|
|
1193
1195
|
return /* @__PURE__ */ g(ir, { ...s, ref: t, asChild: !0, children: /* @__PURE__ */ g(Bt, { ...o, children: typeof e == "function" ? (c) => {
|
|
1194
1196
|
const l = e(c), u = c;
|
|
1195
1197
|
return wt(l) && (u.id || u.textValue) ? $t(
|
|
@@ -1208,13 +1210,13 @@ function lt({
|
|
|
1208
1210
|
ref: t,
|
|
1209
1211
|
...r
|
|
1210
1212
|
}) {
|
|
1211
|
-
const [s, o] =
|
|
1213
|
+
const [s, o] = fe(r);
|
|
1212
1214
|
return /* @__PURE__ */ g(ar, { ...s, asChild: !0, children: /* @__PURE__ */ g(Mt, { ref: t, ...o, children: (n) => {
|
|
1213
1215
|
const c = typeof e == "function" ? e({
|
|
1214
1216
|
...n
|
|
1215
1217
|
}) : e;
|
|
1216
|
-
return n.selectionMode === "multiple" ? /* @__PURE__ */
|
|
1217
|
-
/* @__PURE__ */ g(ur, { children: /* @__PURE__ */ g("span", { "data-selected": n.isSelected, children: n.isSelected && /* @__PURE__ */ g(
|
|
1218
|
+
return n.selectionMode === "multiple" ? /* @__PURE__ */ ve(He, { children: [
|
|
1219
|
+
/* @__PURE__ */ g(ur, { children: /* @__PURE__ */ g("span", { "data-selected": n.isSelected, children: n.isSelected && /* @__PURE__ */ g(Et, {}) }) }),
|
|
1218
1220
|
/* @__PURE__ */ g(dr, { children: c })
|
|
1219
1221
|
] }) : /* @__PURE__ */ g(He, { children: c });
|
|
1220
1222
|
} }) });
|
|
@@ -1231,9 +1233,9 @@ function it({
|
|
|
1231
1233
|
throw new Error(
|
|
1232
1234
|
'ComboBox.Section: When "items" is provided, "children" must be a function'
|
|
1233
1235
|
);
|
|
1234
|
-
return /* @__PURE__ */
|
|
1236
|
+
return /* @__PURE__ */ ve(At, { ref: s, ...o, children: [
|
|
1235
1237
|
t && /* @__PURE__ */ g(cr, { asChild: !0, children: /* @__PURE__ */ g(Kt, { children: t }) }),
|
|
1236
|
-
r ? /* @__PURE__ */ g(
|
|
1238
|
+
r ? /* @__PURE__ */ g(Ot, { items: r, children: (n) => typeof e == "function" ? e(n) : null }) : e
|
|
1237
1239
|
] });
|
|
1238
1240
|
}
|
|
1239
1241
|
it.displayName = "ComboBox.Section";
|
|
@@ -1320,7 +1322,7 @@ function Fr(e = ct) {
|
|
|
1320
1322
|
return n;
|
|
1321
1323
|
};
|
|
1322
1324
|
}
|
|
1323
|
-
function
|
|
1325
|
+
function Or(e) {
|
|
1324
1326
|
return (t, r) => {
|
|
1325
1327
|
if (!r.trim()) return t;
|
|
1326
1328
|
const s = [];
|
|
@@ -1540,10 +1542,10 @@ const oo = {
|
|
|
1540
1542
|
createMultiPropertyFilter: Mr,
|
|
1541
1543
|
createRankedFilter: Ar,
|
|
1542
1544
|
createMultiTermFilter: Fr,
|
|
1543
|
-
createSectionAwareFilter:
|
|
1545
|
+
createSectionAwareFilter: Or
|
|
1544
1546
|
}
|
|
1545
1547
|
};
|
|
1546
1548
|
export {
|
|
1547
1549
|
oo as C
|
|
1548
1550
|
};
|
|
1549
|
-
//# sourceMappingURL=combobox-
|
|
1551
|
+
//# sourceMappingURL=combobox-vjauyzlS.es.js.map
|