@adamosuiteservices/ui 1.6.6 → 1.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/combobox.cjs +2 -2
- package/dist/combobox.js +371 -331
- package/dist/components/ui/combobox/combobox.d.ts +23 -5
- package/dist/components/ui/combobox/combobox.stories.d.ts +6 -0
- package/dist/custom-layered-styles.css +1 -1
- package/dist/styles.css +1 -1
- package/docs/components/ui/combobox.md +150 -101
- package/package.json +1 -1
package/dist/combobox.js
CHANGED
|
@@ -1,369 +1,369 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import * as
|
|
1
|
+
import { j as d } from "./jsx-runtime-BzflLqGi.js";
|
|
2
|
+
import * as a from "react";
|
|
3
3
|
import { useState as fe } from "react";
|
|
4
|
-
import { c as
|
|
5
|
-
import { B as
|
|
6
|
-
import { R as
|
|
7
|
-
import { P as
|
|
8
|
-
import { u as
|
|
9
|
-
import { c as
|
|
10
|
-
import { c as
|
|
11
|
-
import { P as
|
|
12
|
-
import { C as
|
|
13
|
-
import { C as
|
|
14
|
-
import { C as
|
|
4
|
+
import { c as O } from "./index-CRiPKpXj.js";
|
|
5
|
+
import { B as Ee } from "./button-2GdKenQI.js";
|
|
6
|
+
import { R as Ce, P as Ie, O as Re, a as Ae } from "./index-DniCthJA.js";
|
|
7
|
+
import { P as M } from "./index-BMWt1NBG.js";
|
|
8
|
+
import { u as G } from "./index-Cv867SGx.js";
|
|
9
|
+
import { c as te } from "./index-DLcqcWxM.js";
|
|
10
|
+
import { c as De } from "./createLucideIcon-B_8CJpcQ.js";
|
|
11
|
+
import { P as Ne, a as Oe, b as $e } from "./popover-3rIoNCXs.js";
|
|
12
|
+
import { C as Le } from "./checkbox-Dr487kAg.js";
|
|
13
|
+
import { C as Me } from "./check-Ci0GjV-B.js";
|
|
14
|
+
import { C as Pe } from "./chevron-down-CpVS2Z7w.js";
|
|
15
15
|
/**
|
|
16
16
|
* @license lucide-react v0.546.0 - ISC
|
|
17
17
|
*
|
|
18
18
|
* This source code is licensed under the ISC license.
|
|
19
19
|
* See the LICENSE file in the root directory of this source tree.
|
|
20
20
|
*/
|
|
21
|
-
const
|
|
21
|
+
const Fe = [
|
|
22
22
|
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
23
23
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
24
|
-
],
|
|
25
|
-
var pe = 1,
|
|
26
|
-
function
|
|
27
|
-
if (
|
|
28
|
-
var f = `${
|
|
29
|
-
if (
|
|
30
|
-
for (var
|
|
31
|
-
return
|
|
24
|
+
], Te = De("search", Fe);
|
|
25
|
+
var pe = 1, Ve = 0.9, ze = 0.8, Ke = 0.17, oe = 0.1, ue = 0.999, qe = 0.9999, Be = 0.99, _e = /[\\\/_+.#"@\[\(\{&]/, Ge = /[\\\/_+.#"@\[\(\{&]/g, Ue = /[\s-]/, ge = /[\s-]/g;
|
|
26
|
+
function ce(e, n, r, h, o, m, p) {
|
|
27
|
+
if (m === n.length) return o === e.length ? pe : Be;
|
|
28
|
+
var f = `${o},${m}`;
|
|
29
|
+
if (p[f] !== void 0) return p[f];
|
|
30
|
+
for (var b = h.charAt(m), u = r.indexOf(b, o), x = 0, s, w, S, N; u >= 0; ) s = ce(e, n, r, h, u + 1, m + 1, p), s > x && (u === o ? s *= pe : _e.test(e.charAt(u - 1)) ? (s *= ze, S = e.slice(o, u - 1).match(Ge), S && o > 0 && (s *= Math.pow(ue, S.length))) : Ue.test(e.charAt(u - 1)) ? (s *= Ve, N = e.slice(o, u - 1).match(ge), N && o > 0 && (s *= Math.pow(ue, N.length))) : (s *= Ke, o > 0 && (s *= Math.pow(ue, u - o))), e.charAt(u) !== n.charAt(m) && (s *= qe)), (s < oe && r.charAt(u - 1) === h.charAt(m + 1) || h.charAt(m + 1) === h.charAt(m) && r.charAt(u - 1) !== h.charAt(m)) && (w = ce(e, n, r, h, u + 1, m + 2, p), w * oe > s && (s = w * oe)), s > x && (x = s), u = r.indexOf(b, u + 1);
|
|
31
|
+
return p[f] = x, x;
|
|
32
32
|
}
|
|
33
33
|
function he(e) {
|
|
34
34
|
return e.toLowerCase().replace(ge, " ");
|
|
35
35
|
}
|
|
36
|
-
function He(e,
|
|
37
|
-
return e = r && r.length > 0 ? `${e + " " + r.join(" ")}` : e,
|
|
36
|
+
function He(e, n, r) {
|
|
37
|
+
return e = r && r.length > 0 ? `${e + " " + r.join(" ")}` : e, ce(e, n, he(e), he(n), 0, 0, {});
|
|
38
38
|
}
|
|
39
|
-
var
|
|
40
|
-
let r =
|
|
39
|
+
var ee = '[cmdk-group=""]', de = '[cmdk-group-items=""]', We = '[cmdk-group-heading=""]', xe = '[cmdk-item=""]', ve = `${xe}:not([aria-disabled="true"])`, se = "cmdk-item-select", B = "data-value", Je = (e, n, r) => He(e, n, r), be = a.createContext(void 0), re = () => a.useContext(be), ye = a.createContext(void 0), me = () => a.useContext(ye), ke = a.createContext(void 0), je = a.forwardRef((e, n) => {
|
|
40
|
+
let r = _(() => {
|
|
41
41
|
var t, c;
|
|
42
42
|
return { search: "", value: (c = (t = e.value) != null ? t : e.defaultValue) != null ? c : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
|
|
43
|
-
}),
|
|
44
|
-
|
|
43
|
+
}), h = _(() => /* @__PURE__ */ new Set()), o = _(() => /* @__PURE__ */ new Map()), m = _(() => /* @__PURE__ */ new Map()), p = _(() => /* @__PURE__ */ new Set()), f = we(e), { label: b, children: u, value: x, onValueChange: s, filter: w, shouldFilter: S, loop: N, disablePointerSelection: H = !1, vimBindings: g = !0, ...W } = e, D = G(), J = G(), P = G(), R = a.useRef(null), k = it();
|
|
44
|
+
V(() => {
|
|
45
45
|
if (x !== void 0) {
|
|
46
46
|
let t = x.trim();
|
|
47
47
|
r.current.value = t, C.emit();
|
|
48
48
|
}
|
|
49
|
-
}, [x]),
|
|
50
|
-
k(6,
|
|
49
|
+
}, [x]), V(() => {
|
|
50
|
+
k(6, ne);
|
|
51
51
|
}, []);
|
|
52
|
-
let C =
|
|
53
|
-
var
|
|
52
|
+
let C = a.useMemo(() => ({ subscribe: (t) => (p.current.add(t), () => p.current.delete(t)), snapshot: () => r.current, setState: (t, c, v) => {
|
|
53
|
+
var i, y, j, A;
|
|
54
54
|
if (!Object.is(r.current[t], c)) {
|
|
55
|
-
if (r.current[t] = c, t === "search")
|
|
55
|
+
if (r.current[t] = c, t === "search") K(), F(), k(1, Y);
|
|
56
56
|
else if (t === "value") {
|
|
57
57
|
if (document.activeElement.hasAttribute("cmdk-input") || document.activeElement.hasAttribute("cmdk-root")) {
|
|
58
|
-
let I = document.getElementById(
|
|
59
|
-
I ? I.focus() : (
|
|
58
|
+
let I = document.getElementById(P);
|
|
59
|
+
I ? I.focus() : (i = document.getElementById(D)) == null || i.focus();
|
|
60
60
|
}
|
|
61
61
|
if (k(7, () => {
|
|
62
62
|
var I;
|
|
63
|
-
r.current.selectedItemId = (I =
|
|
64
|
-
}),
|
|
63
|
+
r.current.selectedItemId = (I = $()) == null ? void 0 : I.id, C.emit();
|
|
64
|
+
}), v || k(5, ne), ((y = f.current) == null ? void 0 : y.value) !== void 0) {
|
|
65
65
|
let I = c ?? "";
|
|
66
|
-
(A = (
|
|
66
|
+
(A = (j = f.current).onValueChange) == null || A.call(j, I);
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
C.emit();
|
|
71
71
|
}
|
|
72
72
|
}, emit: () => {
|
|
73
|
-
|
|
74
|
-
} }), []),
|
|
75
|
-
var
|
|
76
|
-
c !== ((
|
|
77
|
-
|
|
73
|
+
p.current.forEach((t) => t());
|
|
74
|
+
} }), []), z = a.useMemo(() => ({ value: (t, c, v) => {
|
|
75
|
+
var i;
|
|
76
|
+
c !== ((i = m.current.get(t)) == null ? void 0 : i.value) && (m.current.set(t, { value: c, keywords: v }), r.current.filtered.items.set(t, X(c, v)), k(2, () => {
|
|
77
|
+
F(), C.emit();
|
|
78
78
|
}));
|
|
79
|
-
}, item: (t, c) => (
|
|
80
|
-
|
|
79
|
+
}, item: (t, c) => (h.current.add(t), c && (o.current.has(c) ? o.current.get(c).add(t) : o.current.set(c, /* @__PURE__ */ new Set([t]))), k(3, () => {
|
|
80
|
+
K(), F(), r.current.value || Y(), C.emit();
|
|
81
81
|
}), () => {
|
|
82
|
-
|
|
83
|
-
let
|
|
82
|
+
m.current.delete(t), h.current.delete(t), r.current.filtered.items.delete(t);
|
|
83
|
+
let v = $();
|
|
84
84
|
k(4, () => {
|
|
85
|
-
|
|
85
|
+
K(), v?.getAttribute("id") === t && Y(), C.emit();
|
|
86
86
|
});
|
|
87
|
-
}), group: (t) => (
|
|
88
|
-
|
|
89
|
-
}), filter: () => f.current.shouldFilter, label:
|
|
90
|
-
function
|
|
91
|
-
var
|
|
92
|
-
let y = (
|
|
87
|
+
}), group: (t) => (o.current.has(t) || o.current.set(t, /* @__PURE__ */ new Set()), () => {
|
|
88
|
+
m.current.delete(t), o.current.delete(t);
|
|
89
|
+
}), filter: () => f.current.shouldFilter, label: b || e["aria-label"], getDisablePointerSelection: () => f.current.disablePointerSelection, listId: D, inputId: P, labelId: J, listInnerRef: R }), []);
|
|
90
|
+
function X(t, c) {
|
|
91
|
+
var v, i;
|
|
92
|
+
let y = (i = (v = f.current) == null ? void 0 : v.filter) != null ? i : Je;
|
|
93
93
|
return t ? y(t, r.current.search, c) : 0;
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function F() {
|
|
96
96
|
if (!r.current.search || f.current.shouldFilter === !1) return;
|
|
97
97
|
let t = r.current.filtered.items, c = [];
|
|
98
|
-
r.current.filtered.groups.forEach((
|
|
99
|
-
let y =
|
|
98
|
+
r.current.filtered.groups.forEach((i) => {
|
|
99
|
+
let y = o.current.get(i), j = 0;
|
|
100
100
|
y.forEach((A) => {
|
|
101
101
|
let I = t.get(A);
|
|
102
|
-
|
|
103
|
-
}), c.push([
|
|
102
|
+
j = Math.max(I, j);
|
|
103
|
+
}), c.push([i, j]);
|
|
104
104
|
});
|
|
105
|
-
let
|
|
106
|
-
|
|
107
|
-
var
|
|
108
|
-
let I =
|
|
109
|
-
return ((
|
|
110
|
-
}).forEach((
|
|
111
|
-
let y =
|
|
112
|
-
y ? y.appendChild(
|
|
113
|
-
}), c.sort((
|
|
105
|
+
let v = R.current;
|
|
106
|
+
T().sort((i, y) => {
|
|
107
|
+
var j, A;
|
|
108
|
+
let I = i.getAttribute("id"), le = y.getAttribute("id");
|
|
109
|
+
return ((j = t.get(le)) != null ? j : 0) - ((A = t.get(I)) != null ? A : 0);
|
|
110
|
+
}).forEach((i) => {
|
|
111
|
+
let y = i.closest(de);
|
|
112
|
+
y ? y.appendChild(i.parentElement === y ? i : i.closest(`${de} > *`)) : v.appendChild(i.parentElement === v ? i : i.closest(`${de} > *`));
|
|
113
|
+
}), c.sort((i, y) => y[1] - i[1]).forEach((i) => {
|
|
114
114
|
var y;
|
|
115
|
-
let
|
|
116
|
-
|
|
115
|
+
let j = (y = R.current) == null ? void 0 : y.querySelector(`${ee}[${B}="${encodeURIComponent(i[0])}"]`);
|
|
116
|
+
j?.parentElement.appendChild(j);
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
|
-
function
|
|
120
|
-
let t =
|
|
119
|
+
function Y() {
|
|
120
|
+
let t = T().find((v) => v.getAttribute("aria-disabled") !== "true"), c = t?.getAttribute(B);
|
|
121
121
|
C.setState("value", c || void 0);
|
|
122
122
|
}
|
|
123
|
-
function
|
|
124
|
-
var t, c,
|
|
123
|
+
function K() {
|
|
124
|
+
var t, c, v, i;
|
|
125
125
|
if (!r.current.search || f.current.shouldFilter === !1) {
|
|
126
|
-
r.current.filtered.count =
|
|
126
|
+
r.current.filtered.count = h.current.size;
|
|
127
127
|
return;
|
|
128
128
|
}
|
|
129
129
|
r.current.filtered.groups = /* @__PURE__ */ new Set();
|
|
130
130
|
let y = 0;
|
|
131
|
-
for (let
|
|
132
|
-
let A = (c = (t =
|
|
133
|
-
r.current.filtered.items.set(
|
|
131
|
+
for (let j of h.current) {
|
|
132
|
+
let A = (c = (t = m.current.get(j)) == null ? void 0 : t.value) != null ? c : "", I = (i = (v = m.current.get(j)) == null ? void 0 : v.keywords) != null ? i : [], le = X(A, I);
|
|
133
|
+
r.current.filtered.items.set(j, le), le > 0 && y++;
|
|
134
134
|
}
|
|
135
|
-
for (let [
|
|
136
|
-
r.current.filtered.groups.add(
|
|
135
|
+
for (let [j, A] of o.current) for (let I of A) if (r.current.filtered.items.get(I) > 0) {
|
|
136
|
+
r.current.filtered.groups.add(j);
|
|
137
137
|
break;
|
|
138
138
|
}
|
|
139
139
|
r.current.filtered.count = y;
|
|
140
140
|
}
|
|
141
|
-
function
|
|
142
|
-
var t, c,
|
|
143
|
-
let
|
|
144
|
-
|
|
141
|
+
function ne() {
|
|
142
|
+
var t, c, v;
|
|
143
|
+
let i = $();
|
|
144
|
+
i && (((t = i.parentElement) == null ? void 0 : t.firstChild) === i && ((v = (c = i.closest(ee)) == null ? void 0 : c.querySelector(We)) == null || v.scrollIntoView({ block: "nearest" })), i.scrollIntoView({ block: "nearest" }));
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function $() {
|
|
147
147
|
var t;
|
|
148
|
-
return (t = R.current) == null ? void 0 : t.querySelector(`${
|
|
148
|
+
return (t = R.current) == null ? void 0 : t.querySelector(`${xe}[aria-selected="true"]`);
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function T() {
|
|
151
151
|
var t;
|
|
152
152
|
return Array.from(((t = R.current) == null ? void 0 : t.querySelectorAll(ve)) || []);
|
|
153
153
|
}
|
|
154
|
-
function
|
|
155
|
-
let c =
|
|
156
|
-
c && C.setState("value", c.getAttribute(
|
|
154
|
+
function Q(t) {
|
|
155
|
+
let c = T()[t];
|
|
156
|
+
c && C.setState("value", c.getAttribute(B));
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function Z(t) {
|
|
159
159
|
var c;
|
|
160
|
-
let
|
|
161
|
-
(c = f.current) != null && c.loop && (
|
|
160
|
+
let v = $(), i = T(), y = i.findIndex((A) => A === v), j = i[y + t];
|
|
161
|
+
(c = f.current) != null && c.loop && (j = y + t < 0 ? i[i.length - 1] : y + t === i.length ? i[0] : i[y + t]), j && C.setState("value", j.getAttribute(B));
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
let c =
|
|
165
|
-
for (;
|
|
166
|
-
|
|
163
|
+
function ae(t) {
|
|
164
|
+
let c = $(), v = c?.closest(ee), i;
|
|
165
|
+
for (; v && !i; ) v = t > 0 ? at(v, ee) : lt(v, ee), i = v?.querySelector(ve);
|
|
166
|
+
i ? C.setState("value", i.getAttribute(B)) : Z(t);
|
|
167
167
|
}
|
|
168
|
-
let
|
|
169
|
-
t.preventDefault(), t.metaKey ?
|
|
170
|
-
},
|
|
171
|
-
t.preventDefault(), t.metaKey ?
|
|
168
|
+
let l = () => Q(T().length - 1), E = (t) => {
|
|
169
|
+
t.preventDefault(), t.metaKey ? l() : t.altKey ? ae(1) : Z(1);
|
|
170
|
+
}, q = (t) => {
|
|
171
|
+
t.preventDefault(), t.metaKey ? Q(0) : t.altKey ? ae(-1) : Z(-1);
|
|
172
172
|
};
|
|
173
|
-
return
|
|
173
|
+
return a.createElement(M.div, { ref: n, tabIndex: -1, ...W, "cmdk-root": "", onKeyDown: (t) => {
|
|
174
174
|
var c;
|
|
175
|
-
(c =
|
|
176
|
-
let
|
|
177
|
-
if (!(t.defaultPrevented ||
|
|
175
|
+
(c = W.onKeyDown) == null || c.call(W, t);
|
|
176
|
+
let v = t.nativeEvent.isComposing || t.keyCode === 229;
|
|
177
|
+
if (!(t.defaultPrevented || v)) switch (t.key) {
|
|
178
178
|
case "n":
|
|
179
179
|
case "j": {
|
|
180
|
-
g && t.ctrlKey &&
|
|
180
|
+
g && t.ctrlKey && E(t);
|
|
181
181
|
break;
|
|
182
182
|
}
|
|
183
183
|
case "ArrowDown": {
|
|
184
|
-
|
|
184
|
+
E(t);
|
|
185
185
|
break;
|
|
186
186
|
}
|
|
187
187
|
case "p":
|
|
188
188
|
case "k": {
|
|
189
|
-
g && t.ctrlKey &&
|
|
189
|
+
g && t.ctrlKey && q(t);
|
|
190
190
|
break;
|
|
191
191
|
}
|
|
192
192
|
case "ArrowUp": {
|
|
193
|
-
|
|
193
|
+
q(t);
|
|
194
194
|
break;
|
|
195
195
|
}
|
|
196
196
|
case "Home": {
|
|
197
|
-
t.preventDefault(),
|
|
197
|
+
t.preventDefault(), Q(0);
|
|
198
198
|
break;
|
|
199
199
|
}
|
|
200
200
|
case "End": {
|
|
201
|
-
t.preventDefault(),
|
|
201
|
+
t.preventDefault(), l();
|
|
202
202
|
break;
|
|
203
203
|
}
|
|
204
204
|
case "Enter": {
|
|
205
205
|
t.preventDefault();
|
|
206
|
-
let
|
|
207
|
-
if (
|
|
208
|
-
let y = new Event(
|
|
209
|
-
|
|
206
|
+
let i = $();
|
|
207
|
+
if (i) {
|
|
208
|
+
let y = new Event(se);
|
|
209
|
+
i.dispatchEvent(y);
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
|
-
} },
|
|
214
|
-
}), Xe =
|
|
215
|
-
var r,
|
|
216
|
-
let
|
|
217
|
-
|
|
218
|
-
if (!
|
|
219
|
-
}, [
|
|
220
|
-
let x =
|
|
221
|
-
|
|
222
|
-
let k =
|
|
223
|
-
if (!(!k || e.disabled)) return k.addEventListener(
|
|
224
|
-
}, [
|
|
225
|
-
function
|
|
213
|
+
} }, a.createElement("label", { "cmdk-label": "", htmlFor: z.inputId, id: z.labelId, style: ut }, b), ie(e, (t) => a.createElement(ye.Provider, { value: C }, a.createElement(be.Provider, { value: z }, t))));
|
|
214
|
+
}), Xe = a.forwardRef((e, n) => {
|
|
215
|
+
var r, h;
|
|
216
|
+
let o = G(), m = a.useRef(null), p = a.useContext(ke), f = re(), b = we(e), u = (h = (r = b.current) == null ? void 0 : r.forceMount) != null ? h : p?.forceMount;
|
|
217
|
+
V(() => {
|
|
218
|
+
if (!u) return f.item(o, p?.id);
|
|
219
|
+
}, [u]);
|
|
220
|
+
let x = Se(o, m, [e.value, e.children, m], e.keywords), s = me(), w = L((k) => k.value && k.value === x.current), S = L((k) => u || f.filter() === !1 ? !0 : k.search ? k.filtered.items.get(o) > 0 : !0);
|
|
221
|
+
a.useEffect(() => {
|
|
222
|
+
let k = m.current;
|
|
223
|
+
if (!(!k || e.disabled)) return k.addEventListener(se, N), () => k.removeEventListener(se, N);
|
|
224
|
+
}, [S, e.onSelect, e.disabled]);
|
|
225
|
+
function N() {
|
|
226
226
|
var k, C;
|
|
227
|
-
|
|
227
|
+
H(), (C = (k = b.current).onSelect) == null || C.call(k, x.current);
|
|
228
228
|
}
|
|
229
|
-
function
|
|
230
|
-
|
|
229
|
+
function H() {
|
|
230
|
+
s.setState("value", x.current, !0);
|
|
231
231
|
}
|
|
232
|
-
if (!
|
|
233
|
-
let { disabled: g, value:
|
|
234
|
-
return
|
|
235
|
-
}), Ye =
|
|
236
|
-
let { heading: r, children:
|
|
237
|
-
|
|
238
|
-
let
|
|
239
|
-
return
|
|
240
|
-
}), Qe =
|
|
241
|
-
let { alwaysRender: r, ...
|
|
242
|
-
return !r && !
|
|
243
|
-
}), Ze =
|
|
244
|
-
let { onValueChange: r, ...
|
|
245
|
-
return
|
|
246
|
-
e.value != null &&
|
|
247
|
-
}, [e.value]),
|
|
248
|
-
|
|
232
|
+
if (!S) return null;
|
|
233
|
+
let { disabled: g, value: W, onSelect: D, forceMount: J, keywords: P, ...R } = e;
|
|
234
|
+
return a.createElement(M.div, { ref: te(m, n), ...R, id: o, "cmdk-item": "", role: "option", "aria-disabled": !!g, "aria-selected": !!w, "data-disabled": !!g, "data-selected": !!w, onPointerMove: g || f.getDisablePointerSelection() ? void 0 : H, onClick: g ? void 0 : N }, e.children);
|
|
235
|
+
}), Ye = a.forwardRef((e, n) => {
|
|
236
|
+
let { heading: r, children: h, forceMount: o, ...m } = e, p = G(), f = a.useRef(null), b = a.useRef(null), u = G(), x = re(), s = L((S) => o || x.filter() === !1 ? !0 : S.search ? S.filtered.groups.has(p) : !0);
|
|
237
|
+
V(() => x.group(p), []), Se(p, f, [e.value, e.heading, b]);
|
|
238
|
+
let w = a.useMemo(() => ({ id: p, forceMount: o }), [o]);
|
|
239
|
+
return a.createElement(M.div, { ref: te(f, n), ...m, "cmdk-group": "", role: "presentation", hidden: s ? void 0 : !0 }, r && a.createElement("div", { ref: b, "cmdk-group-heading": "", "aria-hidden": !0, id: u }, r), ie(e, (S) => a.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": r ? u : void 0 }, a.createElement(ke.Provider, { value: w }, S))));
|
|
240
|
+
}), Qe = a.forwardRef((e, n) => {
|
|
241
|
+
let { alwaysRender: r, ...h } = e, o = a.useRef(null), m = L((p) => !p.search);
|
|
242
|
+
return !r && !m ? null : a.createElement(M.div, { ref: te(o, n), ...h, "cmdk-separator": "", role: "separator" });
|
|
243
|
+
}), Ze = a.forwardRef((e, n) => {
|
|
244
|
+
let { onValueChange: r, ...h } = e, o = e.value != null, m = me(), p = L((u) => u.search), f = L((u) => u.selectedItemId), b = re();
|
|
245
|
+
return a.useEffect(() => {
|
|
246
|
+
e.value != null && m.setState("search", e.value);
|
|
247
|
+
}, [e.value]), a.createElement(M.input, { ref: n, ...h, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": b.listId, "aria-labelledby": b.labelId, "aria-activedescendant": f, id: b.inputId, type: "text", value: o ? e.value : p, onChange: (u) => {
|
|
248
|
+
o || m.setState("search", u.target.value), r?.(u.target.value);
|
|
249
249
|
} });
|
|
250
|
-
}), et =
|
|
251
|
-
let { children: r, label:
|
|
252
|
-
return
|
|
253
|
-
if (
|
|
254
|
-
let
|
|
255
|
-
|
|
256
|
-
let
|
|
257
|
-
x.style.setProperty("--cmdk-list-height",
|
|
250
|
+
}), et = a.forwardRef((e, n) => {
|
|
251
|
+
let { children: r, label: h = "Suggestions", ...o } = e, m = a.useRef(null), p = a.useRef(null), f = L((u) => u.selectedItemId), b = re();
|
|
252
|
+
return a.useEffect(() => {
|
|
253
|
+
if (p.current && m.current) {
|
|
254
|
+
let u = p.current, x = m.current, s, w = new ResizeObserver(() => {
|
|
255
|
+
s = requestAnimationFrame(() => {
|
|
256
|
+
let S = u.offsetHeight;
|
|
257
|
+
x.style.setProperty("--cmdk-list-height", S.toFixed(1) + "px");
|
|
258
258
|
});
|
|
259
259
|
});
|
|
260
|
-
return
|
|
261
|
-
cancelAnimationFrame(
|
|
260
|
+
return w.observe(u), () => {
|
|
261
|
+
cancelAnimationFrame(s), w.unobserve(u);
|
|
262
262
|
};
|
|
263
263
|
}
|
|
264
|
-
}, []),
|
|
265
|
-
}), tt =
|
|
266
|
-
let { open: r, onOpenChange:
|
|
267
|
-
return
|
|
268
|
-
}), rt =
|
|
269
|
-
let { progress: r, children:
|
|
270
|
-
return
|
|
271
|
-
}),
|
|
272
|
-
function
|
|
264
|
+
}, []), a.createElement(M.div, { ref: te(m, n), ...o, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": f, "aria-label": h, id: b.listId }, ie(e, (u) => a.createElement("div", { ref: te(p, b.listInnerRef), "cmdk-list-sizer": "" }, u)));
|
|
265
|
+
}), tt = a.forwardRef((e, n) => {
|
|
266
|
+
let { open: r, onOpenChange: h, overlayClassName: o, contentClassName: m, container: p, ...f } = e;
|
|
267
|
+
return a.createElement(Ce, { open: r, onOpenChange: h }, a.createElement(Ie, { container: p }, a.createElement(Re, { "cmdk-overlay": "", className: o }), a.createElement(Ae, { "aria-label": e.label, "cmdk-dialog": "", className: m }, a.createElement(je, { ref: n, ...f }))));
|
|
268
|
+
}), rt = a.forwardRef((e, n) => L((r) => r.filtered.count === 0) ? a.createElement(M.div, { ref: n, ...e, "cmdk-empty": "", role: "presentation" }) : null), nt = a.forwardRef((e, n) => {
|
|
269
|
+
let { progress: r, children: h, label: o = "Loading...", ...m } = e;
|
|
270
|
+
return a.createElement(M.div, { ref: n, ...m, "cmdk-loading": "", role: "progressbar", "aria-valuenow": r, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": o }, ie(e, (p) => a.createElement("div", { "aria-hidden": !0 }, p)));
|
|
271
|
+
}), U = Object.assign(je, { List: et, Item: Xe, Input: Ze, Group: Ye, Separator: Qe, Dialog: tt, Empty: rt, Loading: nt });
|
|
272
|
+
function at(e, n) {
|
|
273
273
|
let r = e.nextElementSibling;
|
|
274
274
|
for (; r; ) {
|
|
275
|
-
if (r.matches(
|
|
275
|
+
if (r.matches(n)) return r;
|
|
276
276
|
r = r.nextElementSibling;
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
|
-
function lt(e,
|
|
279
|
+
function lt(e, n) {
|
|
280
280
|
let r = e.previousElementSibling;
|
|
281
281
|
for (; r; ) {
|
|
282
|
-
if (r.matches(
|
|
282
|
+
if (r.matches(n)) return r;
|
|
283
283
|
r = r.previousElementSibling;
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
|
-
function
|
|
287
|
-
let
|
|
288
|
-
return
|
|
289
|
-
|
|
290
|
-
}),
|
|
286
|
+
function we(e) {
|
|
287
|
+
let n = a.useRef(e);
|
|
288
|
+
return V(() => {
|
|
289
|
+
n.current = e;
|
|
290
|
+
}), n;
|
|
291
291
|
}
|
|
292
|
-
var
|
|
293
|
-
function
|
|
294
|
-
let
|
|
295
|
-
return
|
|
292
|
+
var V = typeof window > "u" ? a.useEffect : a.useLayoutEffect;
|
|
293
|
+
function _(e) {
|
|
294
|
+
let n = a.useRef();
|
|
295
|
+
return n.current === void 0 && (n.current = e()), n;
|
|
296
296
|
}
|
|
297
|
-
function
|
|
298
|
-
let
|
|
299
|
-
return
|
|
297
|
+
function L(e) {
|
|
298
|
+
let n = me(), r = () => e(n.snapshot());
|
|
299
|
+
return a.useSyncExternalStore(n.subscribe, r, r);
|
|
300
300
|
}
|
|
301
|
-
function
|
|
302
|
-
let
|
|
303
|
-
return
|
|
304
|
-
var
|
|
301
|
+
function Se(e, n, r, h = []) {
|
|
302
|
+
let o = a.useRef(), m = re();
|
|
303
|
+
return V(() => {
|
|
304
|
+
var p;
|
|
305
305
|
let f = (() => {
|
|
306
|
-
var
|
|
306
|
+
var u;
|
|
307
307
|
for (let x of r) {
|
|
308
308
|
if (typeof x == "string") return x.trim();
|
|
309
|
-
if (typeof x == "object" && "current" in x) return x.current ? (
|
|
309
|
+
if (typeof x == "object" && "current" in x) return x.current ? (u = x.current.textContent) == null ? void 0 : u.trim() : o.current;
|
|
310
310
|
}
|
|
311
|
-
})(),
|
|
312
|
-
|
|
313
|
-
}),
|
|
311
|
+
})(), b = h.map((u) => u.trim());
|
|
312
|
+
m.value(e, f, b), (p = n.current) == null || p.setAttribute(B, f), o.current = f;
|
|
313
|
+
}), o;
|
|
314
314
|
}
|
|
315
|
-
var
|
|
316
|
-
let [e,
|
|
317
|
-
return
|
|
318
|
-
r.current.forEach((
|
|
319
|
-
}, [e]), (
|
|
320
|
-
r.current.set(
|
|
315
|
+
var it = () => {
|
|
316
|
+
let [e, n] = a.useState(), r = _(() => /* @__PURE__ */ new Map());
|
|
317
|
+
return V(() => {
|
|
318
|
+
r.current.forEach((h) => h()), r.current = /* @__PURE__ */ new Map();
|
|
319
|
+
}, [e]), (h, o) => {
|
|
320
|
+
r.current.set(h, o), n({});
|
|
321
321
|
};
|
|
322
322
|
};
|
|
323
|
-
function
|
|
324
|
-
let
|
|
325
|
-
return typeof
|
|
323
|
+
function ot(e) {
|
|
324
|
+
let n = e.type;
|
|
325
|
+
return typeof n == "function" ? n(e.props) : "render" in n ? n.render(e.props) : e;
|
|
326
326
|
}
|
|
327
|
-
function
|
|
328
|
-
return e &&
|
|
327
|
+
function ie({ asChild: e, children: n }, r) {
|
|
328
|
+
return e && a.isValidElement(n) ? a.cloneElement(ot(n), { ref: n.ref }, r(n.props.children)) : r(n);
|
|
329
329
|
}
|
|
330
|
-
var
|
|
331
|
-
function
|
|
330
|
+
var ut = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
|
|
331
|
+
function dt({
|
|
332
332
|
className: e,
|
|
333
|
-
...
|
|
333
|
+
...n
|
|
334
334
|
}) {
|
|
335
|
-
return /* @__PURE__ */
|
|
336
|
-
|
|
335
|
+
return /* @__PURE__ */ d.jsx(
|
|
336
|
+
U,
|
|
337
337
|
{
|
|
338
338
|
"data-slot": "command",
|
|
339
|
-
className:
|
|
339
|
+
className: O(
|
|
340
340
|
"adm:bg-popover adm:text-popover-foreground adm:flex adm:h-full adm:w-full adm:flex-col adm:overflow-hidden adm:rounded-md",
|
|
341
341
|
e
|
|
342
342
|
),
|
|
343
|
-
...
|
|
343
|
+
...n
|
|
344
344
|
}
|
|
345
345
|
);
|
|
346
346
|
}
|
|
347
347
|
function ct({
|
|
348
348
|
className: e,
|
|
349
|
-
...
|
|
349
|
+
...n
|
|
350
350
|
}) {
|
|
351
|
-
return /* @__PURE__ */
|
|
351
|
+
return /* @__PURE__ */ d.jsxs(
|
|
352
352
|
"div",
|
|
353
353
|
{
|
|
354
354
|
"data-slot": "command-input-wrapper",
|
|
355
355
|
className: "adm:flex adm:h-9 adm:items-center adm:gap-2 adm:border-b adm:px-3",
|
|
356
356
|
children: [
|
|
357
|
-
/* @__PURE__ */
|
|
358
|
-
/* @__PURE__ */
|
|
359
|
-
|
|
357
|
+
/* @__PURE__ */ d.jsx(Te, { className: "adm:size-4 adm:shrink-0 adm:opacity-50" }),
|
|
358
|
+
/* @__PURE__ */ d.jsx(
|
|
359
|
+
U.Input,
|
|
360
360
|
{
|
|
361
361
|
"data-slot": "command-input",
|
|
362
|
-
className:
|
|
362
|
+
className: O(
|
|
363
363
|
"adm:placeholder:text-muted-foreground adm:flex adm:h-10 adm:w-full adm:rounded-md adm:bg-transparent adm:py-3 adm:text-sm adm:outline-hidden adm:disabled:cursor-not-allowed adm:disabled:opacity-50",
|
|
364
364
|
e
|
|
365
365
|
),
|
|
366
|
-
...
|
|
366
|
+
...n
|
|
367
367
|
}
|
|
368
368
|
)
|
|
369
369
|
]
|
|
@@ -372,177 +372,217 @@ function ct({
|
|
|
372
372
|
}
|
|
373
373
|
function st({
|
|
374
374
|
className: e,
|
|
375
|
-
...
|
|
375
|
+
...n
|
|
376
376
|
}) {
|
|
377
|
-
return /* @__PURE__ */
|
|
378
|
-
|
|
377
|
+
return /* @__PURE__ */ d.jsx(
|
|
378
|
+
U.List,
|
|
379
379
|
{
|
|
380
380
|
"data-slot": "command-list",
|
|
381
|
-
className:
|
|
381
|
+
className: O(
|
|
382
382
|
"adm:max-h-[300px] adm:scroll-py-1 adm:overflow-x-hidden adm:overflow-y-auto",
|
|
383
383
|
e
|
|
384
384
|
),
|
|
385
|
-
...
|
|
385
|
+
...n
|
|
386
386
|
}
|
|
387
387
|
);
|
|
388
388
|
}
|
|
389
389
|
function mt({
|
|
390
390
|
className: e,
|
|
391
|
-
...
|
|
391
|
+
...n
|
|
392
392
|
}) {
|
|
393
|
-
return /* @__PURE__ */
|
|
394
|
-
|
|
393
|
+
return /* @__PURE__ */ d.jsx(
|
|
394
|
+
U.Empty,
|
|
395
395
|
{
|
|
396
396
|
"data-slot": "command-empty",
|
|
397
|
-
className:
|
|
398
|
-
...
|
|
397
|
+
className: O("adm:py-6 adm:text-center adm:text-sm", e),
|
|
398
|
+
...n
|
|
399
399
|
}
|
|
400
400
|
);
|
|
401
401
|
}
|
|
402
402
|
function ft({
|
|
403
403
|
className: e,
|
|
404
|
-
...
|
|
404
|
+
...n
|
|
405
405
|
}) {
|
|
406
|
-
return /* @__PURE__ */
|
|
407
|
-
|
|
406
|
+
return /* @__PURE__ */ d.jsx(
|
|
407
|
+
U.Group,
|
|
408
408
|
{
|
|
409
409
|
"data-slot": "command-group",
|
|
410
|
-
className:
|
|
410
|
+
className: O(
|
|
411
411
|
"adm:text-foreground adm:overflow-hidden adm:p-1 adm:**:**:**:**:**:**:[&_[cmdk-group-heading]]:text-muted-foreground adm:**:**:**:**:**:**:[&_[cmdk-group-heading]]:px-2 adm:**:**:**:**:**:**:[&_[cmdk-group-heading]]:py-1.5 adm:**:**:**:**:**:**:[&_[cmdk-group-heading]]:text-xs adm:**:**:**:**:**:**:[&_[cmdk-group-heading]]:font-medium",
|
|
412
412
|
e
|
|
413
413
|
),
|
|
414
|
-
...
|
|
414
|
+
...n
|
|
415
415
|
}
|
|
416
416
|
);
|
|
417
417
|
}
|
|
418
418
|
function pt({
|
|
419
419
|
className: e,
|
|
420
|
-
...
|
|
420
|
+
...n
|
|
421
421
|
}) {
|
|
422
|
-
return /* @__PURE__ */
|
|
423
|
-
|
|
422
|
+
return /* @__PURE__ */ d.jsx(
|
|
423
|
+
U.Item,
|
|
424
424
|
{
|
|
425
425
|
"data-slot": "command-item",
|
|
426
|
-
className:
|
|
426
|
+
className: O(
|
|
427
427
|
"adm:data-[selected=true]:bg-accent adm:data-[selected=true]:text-accent-foreground adm:[&_svg:not([class*=text-])]:text-muted-foreground adm:relative adm:flex adm:cursor-default adm:items-center adm:gap-2 adm:rounded-sm adm:px-2 adm:py-1.5 adm:text-sm adm:outline-hidden adm:select-none adm:data-[disabled=true]:pointer-events-none adm:data-[disabled=true]:opacity-50 adm:[&_svg]:pointer-events-none adm:[&_svg]:shrink-0 adm:[&_svg:not([class*=size-])]:size-4",
|
|
428
428
|
e
|
|
429
429
|
),
|
|
430
|
-
...
|
|
430
|
+
...n
|
|
431
431
|
}
|
|
432
432
|
);
|
|
433
433
|
}
|
|
434
434
|
function Rt({
|
|
435
435
|
searchable: e,
|
|
436
|
-
multiple:
|
|
436
|
+
multiple: n,
|
|
437
437
|
icon: r,
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
renders:
|
|
438
|
+
value: h,
|
|
439
|
+
onValueChange: o,
|
|
440
|
+
labels: m,
|
|
441
|
+
options: p,
|
|
442
|
+
classNames: f,
|
|
443
|
+
selectedFeedback: b = "checkbox",
|
|
444
|
+
alwaysShowPlaceholder: u = !1,
|
|
445
|
+
valuePosition: x = "right",
|
|
446
|
+
renders: s
|
|
447
447
|
}) {
|
|
448
|
-
const [
|
|
448
|
+
const [w, S] = fe(!1), [N, H] = fe(n ? [] : ""), g = h !== void 0 ? h : N, D = { ...{
|
|
449
449
|
placeholder: "Select options...",
|
|
450
450
|
searchPlaceholder: "Search options...",
|
|
451
451
|
noItemsFound: "No options found.",
|
|
452
|
-
multipleSelected: (
|
|
453
|
-
}, ...
|
|
454
|
-
|
|
455
|
-
},
|
|
456
|
-
if (
|
|
457
|
-
const
|
|
458
|
-
|
|
452
|
+
multipleSelected: (l) => `${l} options selected`
|
|
453
|
+
}, ...m }, J = (l) => {
|
|
454
|
+
o ? o(l) : H(l);
|
|
455
|
+
}, P = () => n && Array.isArray(g) ? g.length === 0 ? null : g.length === 1 ? p.find((l) => l.value === g[0])?.label : D.multipleSelected?.(g.length) || `${g.length} options selected` : !n && typeof g == "string" && g ? p.find((l) => l.value === g)?.label : null, R = () => n && Array.isArray(g) ? g.length > 0 : typeof g == "string" && g !== "", k = (l) => n && Array.isArray(g) ? g.includes(l) : g === l, C = (l) => {
|
|
456
|
+
if (n) {
|
|
457
|
+
const E = Array.isArray(g) ? g : [], q = E.includes(l) ? E.filter((t) => t !== l) : [...E, l];
|
|
458
|
+
J(q);
|
|
459
459
|
} else
|
|
460
|
-
|
|
461
|
-
},
|
|
462
|
-
const
|
|
463
|
-
|
|
464
|
-
option: F,
|
|
465
|
-
isSelected: N,
|
|
466
|
-
type: o
|
|
467
|
-
}) : o === "check" ? /* @__PURE__ */ b.jsx("span", { className: M("adm:absolute adm:right-2 adm:flex adm:size-3.5 adm:items-center adm:justify-center", v?.check), children: N && /* @__PURE__ */ b.jsx(Fe, { className: "adm:size-4" }) }) : /* @__PURE__ */ b.jsx(
|
|
468
|
-
De,
|
|
460
|
+
J(l === g ? "" : l), S(!1);
|
|
461
|
+
}, z = (l) => {
|
|
462
|
+
const E = k(l), q = p.find((c) => c.value === l), t = () => b === "check" ? /* @__PURE__ */ d.jsx("span", { className: O("adm:absolute adm:right-2 adm:flex adm:size-3.5 adm:items-center adm:justify-center", f?.check), children: E && /* @__PURE__ */ d.jsx(Me, { className: "adm:size-4" }) }) : /* @__PURE__ */ d.jsx(
|
|
463
|
+
Le,
|
|
469
464
|
{
|
|
470
|
-
checked:
|
|
471
|
-
className:
|
|
465
|
+
checked: E,
|
|
466
|
+
className: f?.checkbox
|
|
472
467
|
}
|
|
473
468
|
);
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
469
|
+
return s?.selectedFeedback ? s.selectedFeedback({
|
|
470
|
+
Original: t,
|
|
471
|
+
option: q,
|
|
472
|
+
isSelected: E,
|
|
473
|
+
type: b
|
|
474
|
+
}) : /* @__PURE__ */ d.jsx(t, {});
|
|
475
|
+
}, X = () => {
|
|
476
|
+
const l = () => /* @__PURE__ */ d.jsx("span", { className: "adm:opacity-70", children: D.placeholder });
|
|
477
|
+
return s?.placeholder ? s.placeholder({
|
|
478
|
+
Original: l,
|
|
479
|
+
text: D.placeholder || "",
|
|
480
|
+
hasValue: R()
|
|
481
|
+
}) : /* @__PURE__ */ d.jsx(l, {});
|
|
482
|
+
}, F = () => {
|
|
483
|
+
const l = () => /* @__PURE__ */ d.jsx("span", { children: P() });
|
|
484
|
+
return s?.displayValue ? s.displayValue({
|
|
485
|
+
Original: l,
|
|
486
|
+
text: P() ?? null,
|
|
487
|
+
value: g
|
|
488
|
+
}) : /* @__PURE__ */ d.jsx(l, {});
|
|
489
|
+
}, Y = () => u ? /* @__PURE__ */ d.jsxs("span", { className: "adm:flex adm:items-center adm:gap-2", children: [
|
|
490
|
+
r && /* @__PURE__ */ d.jsx(r, { className: "adm:opacity-50" }),
|
|
491
|
+
X(),
|
|
492
|
+
R() && x === "left" && F()
|
|
493
|
+
] }) : /* @__PURE__ */ d.jsxs("span", { className: "adm:flex adm:items-center adm:gap-2", children: [
|
|
494
|
+
r && /* @__PURE__ */ d.jsx(r, { className: "adm:opacity-50" }),
|
|
495
|
+
R() ? F() : X()
|
|
496
|
+
] }), K = () => {
|
|
497
|
+
const l = () => /* @__PURE__ */ d.jsx(Pe, { className: "adm:size-4 adm:opacity-50" });
|
|
498
|
+
return s?.triggerIcon ? s.triggerIcon({
|
|
499
|
+
Original: l,
|
|
500
|
+
open: w
|
|
501
|
+
}) : /* @__PURE__ */ d.jsx(l, {});
|
|
502
|
+
}, ne = () => u && R() && x === "right" ? /* @__PURE__ */ d.jsxs("span", { className: "adm:flex adm:items-center adm:gap-2", children: [
|
|
503
|
+
F(),
|
|
504
|
+
K()
|
|
505
|
+
] }) : /* @__PURE__ */ d.jsx("span", { className: "adm:flex adm:items-center adm:gap-2", children: K() }), $ = () => {
|
|
506
|
+
const l = () => /* @__PURE__ */ d.jsxs(
|
|
507
|
+
Ee,
|
|
486
508
|
{
|
|
487
509
|
variant: "outline",
|
|
488
510
|
role: "combobox",
|
|
489
|
-
"aria-expanded":
|
|
490
|
-
className:
|
|
511
|
+
"aria-expanded": w,
|
|
512
|
+
className: O("adm:justify-between adm:font-normal", f?.trigger),
|
|
491
513
|
children: [
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
x && R() && (d?.placeholder ? d.placeholder({
|
|
495
|
-
text: j.placeholder || "",
|
|
496
|
-
hasValue: R()
|
|
497
|
-
}) : /* @__PURE__ */ b.jsx("span", { className: "adm:opacity-70", children: j.placeholder })),
|
|
498
|
-
R() ? d?.displayValue ? d.displayValue({
|
|
499
|
-
text: L() ?? null,
|
|
500
|
-
value: g
|
|
501
|
-
}) : /* @__PURE__ */ b.jsx("span", { children: L() }) : d?.placeholder ? d.placeholder({
|
|
502
|
-
text: j.placeholder || "",
|
|
503
|
-
hasValue: R()
|
|
504
|
-
}) : /* @__PURE__ */ b.jsx("span", { children: j.placeholder })
|
|
505
|
-
] }),
|
|
506
|
-
d?.triggerIcon ? d.triggerIcon({ open: S }) : /* @__PURE__ */ b.jsx(Le, { className: "adm:size-4 adm:opacity-50" })
|
|
514
|
+
Y(),
|
|
515
|
+
ne()
|
|
507
516
|
]
|
|
508
517
|
}
|
|
509
|
-
)
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
518
|
+
);
|
|
519
|
+
return s?.trigger ? s.trigger({
|
|
520
|
+
Original: l,
|
|
521
|
+
open: w,
|
|
522
|
+
value: g,
|
|
523
|
+
displayText: P() ?? null,
|
|
524
|
+
placeholder: D.placeholder || "",
|
|
525
|
+
hasValue: R(),
|
|
526
|
+
icon: r
|
|
527
|
+
}) : /* @__PURE__ */ d.jsx(l, {});
|
|
528
|
+
}, T = () => {
|
|
529
|
+
if (!e) return null;
|
|
530
|
+
const l = () => /* @__PURE__ */ d.jsx(
|
|
531
|
+
ct,
|
|
532
|
+
{
|
|
533
|
+
placeholder: D.searchPlaceholder,
|
|
534
|
+
className: f?.input
|
|
535
|
+
}
|
|
536
|
+
);
|
|
537
|
+
return s?.searchInput ? s.searchInput({
|
|
538
|
+
Original: l,
|
|
539
|
+
placeholder: D.searchPlaceholder || ""
|
|
540
|
+
}) : /* @__PURE__ */ d.jsx(l, {});
|
|
541
|
+
}, Q = () => {
|
|
542
|
+
const l = () => /* @__PURE__ */ d.jsx(d.Fragment, { children: D.noItemsFound });
|
|
543
|
+
return s?.empty ? s.empty({
|
|
544
|
+
Original: l,
|
|
545
|
+
text: D.noItemsFound || ""
|
|
546
|
+
}) : /* @__PURE__ */ d.jsx(l, {});
|
|
547
|
+
}, Z = (l) => {
|
|
548
|
+
const E = () => /* @__PURE__ */ d.jsx(d.Fragment, { children: l.label });
|
|
549
|
+
return s?.optionLabel ? s.optionLabel({
|
|
550
|
+
Original: E,
|
|
551
|
+
option: l
|
|
552
|
+
}) : /* @__PURE__ */ d.jsx(E, {});
|
|
553
|
+
}, ae = (l) => {
|
|
554
|
+
const E = () => /* @__PURE__ */ d.jsxs(
|
|
555
|
+
pt,
|
|
556
|
+
{
|
|
557
|
+
value: l.value,
|
|
558
|
+
onSelect: C,
|
|
559
|
+
disabled: l.disabled,
|
|
560
|
+
className: O(
|
|
561
|
+
f?.item,
|
|
562
|
+
b === "check" && "adm:pr-8"
|
|
563
|
+
),
|
|
564
|
+
children: [
|
|
565
|
+
b === "checkbox" && z(l.value),
|
|
566
|
+
Z(l),
|
|
567
|
+
b === "check" && z(l.value)
|
|
568
|
+
]
|
|
569
|
+
},
|
|
570
|
+
l.value
|
|
571
|
+
);
|
|
572
|
+
return s?.option ? /* @__PURE__ */ d.jsx("div", { children: s.option({
|
|
573
|
+
Original: E,
|
|
574
|
+
option: l,
|
|
575
|
+
isSelected: k(l.value),
|
|
576
|
+
selectedFeedback: b
|
|
577
|
+
}) }, l.value) : /* @__PURE__ */ d.jsx(E, {});
|
|
578
|
+
};
|
|
579
|
+
return /* @__PURE__ */ d.jsxs(Ne, { open: w, onOpenChange: S, children: [
|
|
580
|
+
/* @__PURE__ */ d.jsx(Oe, { asChild: !0, children: $() }),
|
|
581
|
+
/* @__PURE__ */ d.jsx($e, { align: "start", className: O("adm:p-0", f?.popover), children: /* @__PURE__ */ d.jsxs(dt, { className: f?.command, children: [
|
|
582
|
+
T(),
|
|
583
|
+
/* @__PURE__ */ d.jsxs(st, { className: f?.list, children: [
|
|
584
|
+
/* @__PURE__ */ d.jsx(mt, { className: f?.empty, children: Q() }),
|
|
585
|
+
/* @__PURE__ */ d.jsx(ft, { className: f?.group, children: p.map((l) => ae(l)) })
|
|
546
586
|
] })
|
|
547
587
|
] }) })
|
|
548
588
|
] });
|