@adamosuiteservices/ui 1.6.7 → 1.7.8
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 +377 -345
- package/dist/components/ui/combobox/combobox.d.ts +20 -1
- package/dist/components/ui/combobox/combobox.stories.d.ts +4 -0
- package/dist/custom-layered-styles.css +1 -1
- package/dist/styles.css +1 -1
- package/docs/components/ui/combobox.md +654 -631
- package/package.json +1 -1
package/dist/combobox.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import * as
|
|
1
|
+
import { j as p } 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 je, P as
|
|
7
|
-
import { P
|
|
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 Pe } from "./
|
|
4
|
+
import { c as L } from "./index-CRiPKpXj.js";
|
|
5
|
+
import { B as Ie } from "./button-2GdKenQI.js";
|
|
6
|
+
import { R as je, P as Ce, O as De, a as Re } from "./index-DniCthJA.js";
|
|
7
|
+
import { P } from "./index-BMWt1NBG.js";
|
|
8
|
+
import { u as B } from "./index-Cv867SGx.js";
|
|
9
|
+
import { c as te } from "./index-DLcqcWxM.js";
|
|
10
|
+
import { c as Ae } from "./createLucideIcon-B_8CJpcQ.js";
|
|
11
|
+
import { P as Oe, a as Ne, b as Le } from "./popover-3rIoNCXs.js";
|
|
12
|
+
import { C as $e } 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
|
*
|
|
@@ -21,349 +21,349 @@ import { C as Pe } from "./check-Ci0GjV-B.js";
|
|
|
21
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
|
|
29
|
-
if (m
|
|
30
|
-
for (var
|
|
31
|
-
return m
|
|
24
|
+
], Te = Ae("search", Fe);
|
|
25
|
+
var pe = 1, Ve = 0.9, Je = 0.8, Xe = 0.17, ie = 0.1, ue = 0.999, ze = 0.9999, Ke = 0.99, qe = /[\\\/_+.#"@\[\(\{&]/, Be = /[\\\/_+.#"@\[\(\{&]/g, _e = /[\s-]/, ve = /[\s-]/g;
|
|
26
|
+
function de(e, n, r, h, i, s, f) {
|
|
27
|
+
if (s === n.length) return i === e.length ? pe : Ke;
|
|
28
|
+
var m = `${i},${s}`;
|
|
29
|
+
if (f[m] !== void 0) return f[m];
|
|
30
|
+
for (var y = h.charAt(s), u = r.indexOf(y, i), x = 0, d, E, I, O; u >= 0; ) d = de(e, n, r, h, u + 1, s + 1, f), d > x && (u === i ? d *= pe : qe.test(e.charAt(u - 1)) ? (d *= Je, I = e.slice(i, u - 1).match(Be), I && i > 0 && (d *= Math.pow(ue, I.length))) : _e.test(e.charAt(u - 1)) ? (d *= Ve, O = e.slice(i, u - 1).match(ve), O && i > 0 && (d *= Math.pow(ue, O.length))) : (d *= Xe, i > 0 && (d *= Math.pow(ue, u - i))), e.charAt(u) !== n.charAt(s) && (d *= ze)), (d < ie && r.charAt(u - 1) === h.charAt(s + 1) || h.charAt(s + 1) === h.charAt(s) && r.charAt(u - 1) !== h.charAt(s)) && (E = de(e, n, r, h, u + 1, s + 2, f), E * ie > d && (d = E * ie)), d > x && (x = d), u = r.indexOf(y, u + 1);
|
|
31
|
+
return f[m] = x, x;
|
|
32
32
|
}
|
|
33
33
|
function he(e) {
|
|
34
|
-
return e.toLowerCase().replace(
|
|
34
|
+
return e.toLowerCase().replace(ve, " ");
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
return e = r && r.length > 0 ? `${e + " " + r.join(" ")}` : e,
|
|
36
|
+
function Ge(e, n, r) {
|
|
37
|
+
return e = r && r.length > 0 ? `${e + " " + r.join(" ")}` : e, de(e, n, he(e), he(n), 0, 0, {});
|
|
38
38
|
}
|
|
39
|
-
var
|
|
40
|
-
let r =
|
|
39
|
+
var ee = '[cmdk-group=""]', ce = '[cmdk-group-items=""]', Ue = '[cmdk-group-heading=""]', be = '[cmdk-item=""]', ge = `${be}:not([aria-disabled="true"])`, se = "cmdk-item-select", K = "data-value", He = (e, n, r) => Ge(e, n, r), xe = a.createContext(void 0), re = () => a.useContext(xe), ye = a.createContext(void 0), me = () => a.useContext(ye), Se = a.createContext(void 0), ke = a.forwardRef((e, n) => {
|
|
40
|
+
let r = q(() => {
|
|
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 = q(() => /* @__PURE__ */ new Set()), i = q(() => /* @__PURE__ */ new Map()), s = q(() => /* @__PURE__ */ new Map()), f = q(() => /* @__PURE__ */ new Set()), m = we(e), { label: y, children: u, value: x, onValueChange: d, filter: E, shouldFilter: I, loop: O, disablePointerSelection: G = !1, vimBindings: v = !0, ...U } = e, A = B(), H = B(), F = B(), D = a.useRef(null), k = ot();
|
|
44
|
+
J(() => {
|
|
45
45
|
if (x !== void 0) {
|
|
46
46
|
let t = x.trim();
|
|
47
|
-
r.current.value = t,
|
|
47
|
+
r.current.value = t, j.emit();
|
|
48
48
|
}
|
|
49
|
-
}, [x]),
|
|
50
|
-
k(6,
|
|
49
|
+
}, [x]), J(() => {
|
|
50
|
+
k(6, ne);
|
|
51
51
|
}, []);
|
|
52
|
-
let
|
|
53
|
-
var
|
|
52
|
+
let j = a.useMemo(() => ({ subscribe: (t) => (f.current.add(t), () => f.current.delete(t)), snapshot: () => r.current, setState: (t, c, g) => {
|
|
53
|
+
var o, S, w, R;
|
|
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") z(), T(), k(1, Y);
|
|
56
56
|
else if (t === "value") {
|
|
57
57
|
if (document.activeElement.hasAttribute("cmdk-input") || document.activeElement.hasAttribute("cmdk-root")) {
|
|
58
|
-
let
|
|
59
|
-
|
|
58
|
+
let C = document.getElementById(F);
|
|
59
|
+
C ? C.focus() : (o = document.getElementById(A)) == null || o.focus();
|
|
60
60
|
}
|
|
61
61
|
if (k(7, () => {
|
|
62
|
-
var
|
|
63
|
-
r.current.selectedItemId = (
|
|
64
|
-
}),
|
|
65
|
-
let
|
|
66
|
-
(
|
|
62
|
+
var C;
|
|
63
|
+
r.current.selectedItemId = (C = $()) == null ? void 0 : C.id, j.emit();
|
|
64
|
+
}), g || k(5, ne), ((S = m.current) == null ? void 0 : S.value) !== void 0) {
|
|
65
|
+
let C = c ?? "";
|
|
66
|
+
(R = (w = m.current).onValueChange) == null || R.call(w, C);
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
|
|
70
|
+
j.emit();
|
|
71
71
|
}
|
|
72
72
|
}, emit: () => {
|
|
73
|
-
|
|
74
|
-
} }), []),
|
|
75
|
-
var
|
|
76
|
-
c !== ((
|
|
77
|
-
|
|
73
|
+
f.current.forEach((t) => t());
|
|
74
|
+
} }), []), X = a.useMemo(() => ({ value: (t, c, g) => {
|
|
75
|
+
var o;
|
|
76
|
+
c !== ((o = s.current.get(t)) == null ? void 0 : o.value) && (s.current.set(t, { value: c, keywords: g }), r.current.filtered.items.set(t, W(c, g)), k(2, () => {
|
|
77
|
+
T(), j.emit();
|
|
78
78
|
}));
|
|
79
|
-
}, item: (t, c) => (
|
|
80
|
-
|
|
79
|
+
}, item: (t, c) => (h.current.add(t), c && (i.current.has(c) ? i.current.get(c).add(t) : i.current.set(c, /* @__PURE__ */ new Set([t]))), k(3, () => {
|
|
80
|
+
z(), T(), r.current.value || Y(), j.emit();
|
|
81
81
|
}), () => {
|
|
82
|
-
|
|
83
|
-
let
|
|
82
|
+
s.current.delete(t), h.current.delete(t), r.current.filtered.items.delete(t);
|
|
83
|
+
let g = $();
|
|
84
84
|
k(4, () => {
|
|
85
|
-
|
|
85
|
+
z(), g?.getAttribute("id") === t && Y(), j.emit();
|
|
86
86
|
});
|
|
87
|
-
}), group: (t) => (
|
|
88
|
-
|
|
89
|
-
}), filter: () =>
|
|
90
|
-
function
|
|
91
|
-
var
|
|
92
|
-
let
|
|
93
|
-
return t ?
|
|
87
|
+
}), group: (t) => (i.current.has(t) || i.current.set(t, /* @__PURE__ */ new Set()), () => {
|
|
88
|
+
s.current.delete(t), i.current.delete(t);
|
|
89
|
+
}), filter: () => m.current.shouldFilter, label: y || e["aria-label"], getDisablePointerSelection: () => m.current.disablePointerSelection, listId: A, inputId: F, labelId: H, listInnerRef: D }), []);
|
|
90
|
+
function W(t, c) {
|
|
91
|
+
var g, o;
|
|
92
|
+
let S = (o = (g = m.current) == null ? void 0 : g.filter) != null ? o : He;
|
|
93
|
+
return t ? S(t, r.current.search, c) : 0;
|
|
94
94
|
}
|
|
95
|
-
function
|
|
96
|
-
if (!r.current.search ||
|
|
95
|
+
function T() {
|
|
96
|
+
if (!r.current.search || m.current.shouldFilter === !1) return;
|
|
97
97
|
let t = r.current.filtered.items, c = [];
|
|
98
|
-
r.current.filtered.groups.forEach((
|
|
99
|
-
let
|
|
100
|
-
|
|
101
|
-
let
|
|
102
|
-
w = Math.max(
|
|
103
|
-
}), c.push([
|
|
98
|
+
r.current.filtered.groups.forEach((o) => {
|
|
99
|
+
let S = i.current.get(o), w = 0;
|
|
100
|
+
S.forEach((R) => {
|
|
101
|
+
let C = t.get(R);
|
|
102
|
+
w = Math.max(C, w);
|
|
103
|
+
}), c.push([o, w]);
|
|
104
104
|
});
|
|
105
|
-
let
|
|
106
|
-
|
|
107
|
-
var w,
|
|
108
|
-
let
|
|
109
|
-
return ((w = t.get(
|
|
110
|
-
}).forEach((
|
|
111
|
-
let
|
|
112
|
-
|
|
113
|
-
}), c.sort((
|
|
114
|
-
var
|
|
115
|
-
let w = (
|
|
105
|
+
let g = D.current;
|
|
106
|
+
V().sort((o, S) => {
|
|
107
|
+
var w, R;
|
|
108
|
+
let C = o.getAttribute("id"), le = S.getAttribute("id");
|
|
109
|
+
return ((w = t.get(le)) != null ? w : 0) - ((R = t.get(C)) != null ? R : 0);
|
|
110
|
+
}).forEach((o) => {
|
|
111
|
+
let S = o.closest(ce);
|
|
112
|
+
S ? S.appendChild(o.parentElement === S ? o : o.closest(`${ce} > *`)) : g.appendChild(o.parentElement === g ? o : o.closest(`${ce} > *`));
|
|
113
|
+
}), c.sort((o, S) => S[1] - o[1]).forEach((o) => {
|
|
114
|
+
var S;
|
|
115
|
+
let w = (S = D.current) == null ? void 0 : S.querySelector(`${ee}[${K}="${encodeURIComponent(o[0])}"]`);
|
|
116
116
|
w?.parentElement.appendChild(w);
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
|
-
function
|
|
120
|
-
let t =
|
|
121
|
-
|
|
119
|
+
function Y() {
|
|
120
|
+
let t = V().find((g) => g.getAttribute("aria-disabled") !== "true"), c = t?.getAttribute(K);
|
|
121
|
+
j.setState("value", c || void 0);
|
|
122
122
|
}
|
|
123
|
-
function
|
|
124
|
-
var t, c,
|
|
125
|
-
if (!r.current.search ||
|
|
126
|
-
r.current.filtered.count =
|
|
123
|
+
function z() {
|
|
124
|
+
var t, c, g, o;
|
|
125
|
+
if (!r.current.search || m.current.shouldFilter === !1) {
|
|
126
|
+
r.current.filtered.count = h.current.size;
|
|
127
127
|
return;
|
|
128
128
|
}
|
|
129
129
|
r.current.filtered.groups = /* @__PURE__ */ new Set();
|
|
130
|
-
let
|
|
131
|
-
for (let w of
|
|
132
|
-
let
|
|
133
|
-
r.current.filtered.items.set(w,
|
|
130
|
+
let S = 0;
|
|
131
|
+
for (let w of h.current) {
|
|
132
|
+
let R = (c = (t = s.current.get(w)) == null ? void 0 : t.value) != null ? c : "", C = (o = (g = s.current.get(w)) == null ? void 0 : g.keywords) != null ? o : [], le = W(R, C);
|
|
133
|
+
r.current.filtered.items.set(w, le), le > 0 && S++;
|
|
134
134
|
}
|
|
135
|
-
for (let [w,
|
|
135
|
+
for (let [w, R] of i.current) for (let C of R) if (r.current.filtered.items.get(C) > 0) {
|
|
136
136
|
r.current.filtered.groups.add(w);
|
|
137
137
|
break;
|
|
138
138
|
}
|
|
139
|
-
r.current.filtered.count =
|
|
139
|
+
r.current.filtered.count = S;
|
|
140
140
|
}
|
|
141
|
-
function
|
|
142
|
-
var t, c,
|
|
143
|
-
let
|
|
144
|
-
|
|
141
|
+
function ne() {
|
|
142
|
+
var t, c, g;
|
|
143
|
+
let o = $();
|
|
144
|
+
o && (((t = o.parentElement) == null ? void 0 : t.firstChild) === o && ((g = (c = o.closest(ee)) == null ? void 0 : c.querySelector(Ue)) == null || g.scrollIntoView({ block: "nearest" })), o.scrollIntoView({ block: "nearest" }));
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function $() {
|
|
147
147
|
var t;
|
|
148
|
-
return (t =
|
|
148
|
+
return (t = D.current) == null ? void 0 : t.querySelector(`${be}[aria-selected="true"]`);
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function V() {
|
|
151
151
|
var t;
|
|
152
|
-
return Array.from(((t =
|
|
152
|
+
return Array.from(((t = D.current) == null ? void 0 : t.querySelectorAll(ge)) || []);
|
|
153
153
|
}
|
|
154
|
-
function
|
|
155
|
-
let c =
|
|
156
|
-
c &&
|
|
154
|
+
function Q(t) {
|
|
155
|
+
let c = V()[t];
|
|
156
|
+
c && j.setState("value", c.getAttribute(K));
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function Z(t) {
|
|
159
159
|
var c;
|
|
160
|
-
let
|
|
161
|
-
(c =
|
|
160
|
+
let g = $(), o = V(), S = o.findIndex((R) => R === g), w = o[S + t];
|
|
161
|
+
(c = m.current) != null && c.loop && (w = S + t < 0 ? o[o.length - 1] : S + t === o.length ? o[0] : o[S + t]), w && j.setState("value", w.getAttribute(K));
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
let c =
|
|
165
|
-
for (;
|
|
166
|
-
|
|
163
|
+
function ae(t) {
|
|
164
|
+
let c = $(), g = c?.closest(ee), o;
|
|
165
|
+
for (; g && !o; ) g = t > 0 ? at(g, ee) : lt(g, ee), o = g?.querySelector(ge);
|
|
166
|
+
o ? j.setState("value", o.getAttribute(K)) : Z(t);
|
|
167
167
|
}
|
|
168
|
-
let
|
|
169
|
-
t.preventDefault(), t.metaKey ?
|
|
170
|
-
},
|
|
171
|
-
t.preventDefault(), t.metaKey ?
|
|
168
|
+
let l = () => Q(V().length - 1), b = (t) => {
|
|
169
|
+
t.preventDefault(), t.metaKey ? l() : t.altKey ? ae(1) : Z(1);
|
|
170
|
+
}, N = (t) => {
|
|
171
|
+
t.preventDefault(), t.metaKey ? Q(0) : t.altKey ? ae(-1) : Z(-1);
|
|
172
172
|
};
|
|
173
|
-
return
|
|
173
|
+
return a.createElement(P.div, { ref: n, tabIndex: -1, ...U, "cmdk-root": "", onKeyDown: (t) => {
|
|
174
174
|
var c;
|
|
175
175
|
(c = U.onKeyDown) == null || c.call(U, t);
|
|
176
|
-
let
|
|
177
|
-
if (!(t.defaultPrevented ||
|
|
176
|
+
let g = t.nativeEvent.isComposing || t.keyCode === 229;
|
|
177
|
+
if (!(t.defaultPrevented || g)) switch (t.key) {
|
|
178
178
|
case "n":
|
|
179
179
|
case "j": {
|
|
180
|
-
v && t.ctrlKey &&
|
|
180
|
+
v && t.ctrlKey && b(t);
|
|
181
181
|
break;
|
|
182
182
|
}
|
|
183
183
|
case "ArrowDown": {
|
|
184
|
-
|
|
184
|
+
b(t);
|
|
185
185
|
break;
|
|
186
186
|
}
|
|
187
187
|
case "p":
|
|
188
188
|
case "k": {
|
|
189
|
-
v && t.ctrlKey &&
|
|
189
|
+
v && t.ctrlKey && N(t);
|
|
190
190
|
break;
|
|
191
191
|
}
|
|
192
192
|
case "ArrowUp": {
|
|
193
|
-
|
|
193
|
+
N(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
|
|
209
|
-
|
|
206
|
+
let o = $();
|
|
207
|
+
if (o) {
|
|
208
|
+
let S = new Event(se);
|
|
209
|
+
o.dispatchEvent(S);
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
|
-
} },
|
|
214
|
-
}),
|
|
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
|
|
226
|
-
var k,
|
|
227
|
-
G(), (
|
|
213
|
+
} }, a.createElement("label", { "cmdk-label": "", htmlFor: X.inputId, id: X.labelId, style: ut }, y), oe(e, (t) => a.createElement(ye.Provider, { value: j }, a.createElement(xe.Provider, { value: X }, t))));
|
|
214
|
+
}), We = a.forwardRef((e, n) => {
|
|
215
|
+
var r, h;
|
|
216
|
+
let i = B(), s = a.useRef(null), f = a.useContext(Se), m = re(), y = we(e), u = (h = (r = y.current) == null ? void 0 : r.forceMount) != null ? h : f?.forceMount;
|
|
217
|
+
J(() => {
|
|
218
|
+
if (!u) return m.item(i, f?.id);
|
|
219
|
+
}, [u]);
|
|
220
|
+
let x = Ee(i, s, [e.value, e.children, s], e.keywords), d = me(), E = M((k) => k.value && k.value === x.current), I = M((k) => u || m.filter() === !1 ? !0 : k.search ? k.filtered.items.get(i) > 0 : !0);
|
|
221
|
+
a.useEffect(() => {
|
|
222
|
+
let k = s.current;
|
|
223
|
+
if (!(!k || e.disabled)) return k.addEventListener(se, O), () => k.removeEventListener(se, O);
|
|
224
|
+
}, [I, e.onSelect, e.disabled]);
|
|
225
|
+
function O() {
|
|
226
|
+
var k, j;
|
|
227
|
+
G(), (j = (k = y.current).onSelect) == null || j.call(k, x.current);
|
|
228
228
|
}
|
|
229
229
|
function G() {
|
|
230
|
-
|
|
230
|
+
d.setState("value", x.current, !0);
|
|
231
231
|
}
|
|
232
|
-
if (!
|
|
233
|
-
let { disabled: v, value: U, onSelect:
|
|
234
|
-
return
|
|
235
|
-
}), Ye =
|
|
236
|
-
let { heading: r, children:
|
|
237
|
-
|
|
238
|
-
let E =
|
|
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 (!I) return null;
|
|
233
|
+
let { disabled: v, value: U, onSelect: A, forceMount: H, keywords: F, ...D } = e;
|
|
234
|
+
return a.createElement(P.div, { ref: te(s, n), ...D, id: i, "cmdk-item": "", role: "option", "aria-disabled": !!v, "aria-selected": !!E, "data-disabled": !!v, "data-selected": !!E, onPointerMove: v || m.getDisablePointerSelection() ? void 0 : G, onClick: v ? void 0 : O }, e.children);
|
|
235
|
+
}), Ye = a.forwardRef((e, n) => {
|
|
236
|
+
let { heading: r, children: h, forceMount: i, ...s } = e, f = B(), m = a.useRef(null), y = a.useRef(null), u = B(), x = re(), d = M((I) => i || x.filter() === !1 ? !0 : I.search ? I.filtered.groups.has(f) : !0);
|
|
237
|
+
J(() => x.group(f), []), Ee(f, m, [e.value, e.heading, y]);
|
|
238
|
+
let E = a.useMemo(() => ({ id: f, forceMount: i }), [i]);
|
|
239
|
+
return a.createElement(P.div, { ref: te(m, n), ...s, "cmdk-group": "", role: "presentation", hidden: d ? void 0 : !0 }, r && a.createElement("div", { ref: y, "cmdk-group-heading": "", "aria-hidden": !0, id: u }, r), oe(e, (I) => a.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": r ? u : void 0 }, a.createElement(Se.Provider, { value: E }, I))));
|
|
240
|
+
}), Qe = a.forwardRef((e, n) => {
|
|
241
|
+
let { alwaysRender: r, ...h } = e, i = a.useRef(null), s = M((f) => !f.search);
|
|
242
|
+
return !r && !s ? null : a.createElement(P.div, { ref: te(i, n), ...h, "cmdk-separator": "", role: "separator" });
|
|
243
|
+
}), Ze = a.forwardRef((e, n) => {
|
|
244
|
+
let { onValueChange: r, ...h } = e, i = e.value != null, s = me(), f = M((u) => u.search), m = M((u) => u.selectedItemId), y = re();
|
|
245
|
+
return a.useEffect(() => {
|
|
246
|
+
e.value != null && s.setState("search", e.value);
|
|
247
|
+
}, [e.value]), a.createElement(P.input, { ref: n, ...h, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": y.listId, "aria-labelledby": y.labelId, "aria-activedescendant": m, id: y.inputId, type: "text", value: i ? e.value : f, onChange: (u) => {
|
|
248
|
+
i || s.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", ...i } = e, s = a.useRef(null), f = a.useRef(null), m = M((u) => u.selectedItemId), y = re();
|
|
252
|
+
return a.useEffect(() => {
|
|
253
|
+
if (f.current && s.current) {
|
|
254
|
+
let u = f.current, x = s.current, d, E = new ResizeObserver(() => {
|
|
255
|
+
d = requestAnimationFrame(() => {
|
|
256
|
+
let I = u.offsetHeight;
|
|
257
|
+
x.style.setProperty("--cmdk-list-height", I.toFixed(1) + "px");
|
|
258
258
|
});
|
|
259
259
|
});
|
|
260
|
-
return E.observe(
|
|
261
|
-
cancelAnimationFrame(
|
|
260
|
+
return E.observe(u), () => {
|
|
261
|
+
cancelAnimationFrame(d), E.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
|
-
}), _ = Object.assign(
|
|
272
|
-
function
|
|
264
|
+
}, []), a.createElement(P.div, { ref: te(s, n), ...i, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": m, "aria-label": h, id: y.listId }, oe(e, (u) => a.createElement("div", { ref: te(f, y.listInnerRef), "cmdk-list-sizer": "" }, u)));
|
|
265
|
+
}), tt = a.forwardRef((e, n) => {
|
|
266
|
+
let { open: r, onOpenChange: h, overlayClassName: i, contentClassName: s, container: f, ...m } = e;
|
|
267
|
+
return a.createElement(je, { open: r, onOpenChange: h }, a.createElement(Ce, { container: f }, a.createElement(De, { "cmdk-overlay": "", className: i }), a.createElement(Re, { "aria-label": e.label, "cmdk-dialog": "", className: s }, a.createElement(ke, { ref: n, ...m }))));
|
|
268
|
+
}), rt = a.forwardRef((e, n) => M((r) => r.filtered.count === 0) ? a.createElement(P.div, { ref: n, ...e, "cmdk-empty": "", role: "presentation" }) : null), nt = a.forwardRef((e, n) => {
|
|
269
|
+
let { progress: r, children: h, label: i = "Loading...", ...s } = e;
|
|
270
|
+
return a.createElement(P.div, { ref: n, ...s, "cmdk-loading": "", role: "progressbar", "aria-valuenow": r, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": i }, oe(e, (f) => a.createElement("div", { "aria-hidden": !0 }, f)));
|
|
271
|
+
}), _ = Object.assign(ke, { List: et, Item: We, 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 J(() => {
|
|
289
|
+
n.current = e;
|
|
290
|
+
}), n;
|
|
291
291
|
}
|
|
292
|
-
var
|
|
293
|
-
function
|
|
294
|
-
let
|
|
295
|
-
return
|
|
292
|
+
var J = typeof window > "u" ? a.useEffect : a.useLayoutEffect;
|
|
293
|
+
function q(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 M(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
|
|
305
|
-
let
|
|
306
|
-
var
|
|
301
|
+
function Ee(e, n, r, h = []) {
|
|
302
|
+
let i = a.useRef(), s = re();
|
|
303
|
+
return J(() => {
|
|
304
|
+
var f;
|
|
305
|
+
let m = (() => {
|
|
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() : i.current;
|
|
310
310
|
}
|
|
311
|
-
})(),
|
|
312
|
-
|
|
313
|
-
}),
|
|
311
|
+
})(), y = h.map((u) => u.trim());
|
|
312
|
+
s.value(e, m, y), (f = n.current) == null || f.setAttribute(K, m), i.current = m;
|
|
313
|
+
}), i;
|
|
314
314
|
}
|
|
315
315
|
var ot = () => {
|
|
316
|
-
let [e,
|
|
317
|
-
return
|
|
318
|
-
r.current.forEach((
|
|
319
|
-
}, [e]), (
|
|
320
|
-
r.current.set(
|
|
316
|
+
let [e, n] = a.useState(), r = q(() => /* @__PURE__ */ new Map());
|
|
317
|
+
return J(() => {
|
|
318
|
+
r.current.forEach((h) => h()), r.current = /* @__PURE__ */ new Map();
|
|
319
|
+
}, [e]), (h, i) => {
|
|
320
|
+
r.current.set(h, i), n({});
|
|
321
321
|
};
|
|
322
322
|
};
|
|
323
323
|
function it(e) {
|
|
324
|
-
let
|
|
325
|
-
return typeof
|
|
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 oe({ asChild: e, children: n }, r) {
|
|
328
|
+
return e && a.isValidElement(n) ? a.cloneElement(it(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 ct({
|
|
332
332
|
className: e,
|
|
333
|
-
...
|
|
333
|
+
...n
|
|
334
334
|
}) {
|
|
335
|
-
return /* @__PURE__ */
|
|
335
|
+
return /* @__PURE__ */ p.jsx(
|
|
336
336
|
_,
|
|
337
337
|
{
|
|
338
338
|
"data-slot": "command",
|
|
339
|
-
className:
|
|
339
|
+
className: L(
|
|
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
|
-
function
|
|
347
|
+
function dt({
|
|
348
348
|
className: e,
|
|
349
|
-
...
|
|
349
|
+
...n
|
|
350
350
|
}) {
|
|
351
|
-
return /* @__PURE__ */
|
|
351
|
+
return /* @__PURE__ */ p.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__ */
|
|
357
|
+
/* @__PURE__ */ p.jsx(Te, { className: "adm:size-4 adm:shrink-0 adm:opacity-50" }),
|
|
358
|
+
/* @__PURE__ */ p.jsx(
|
|
359
359
|
_.Input,
|
|
360
360
|
{
|
|
361
361
|
"data-slot": "command-input",
|
|
362
|
-
className:
|
|
362
|
+
className: L(
|
|
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,189 +372,221 @@ function ct({
|
|
|
372
372
|
}
|
|
373
373
|
function st({
|
|
374
374
|
className: e,
|
|
375
|
-
...
|
|
375
|
+
...n
|
|
376
376
|
}) {
|
|
377
|
-
return /* @__PURE__ */
|
|
377
|
+
return /* @__PURE__ */ p.jsx(
|
|
378
378
|
_.List,
|
|
379
379
|
{
|
|
380
380
|
"data-slot": "command-list",
|
|
381
|
-
className:
|
|
381
|
+
className: L(
|
|
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__ */
|
|
393
|
+
return /* @__PURE__ */ p.jsx(
|
|
394
394
|
_.Empty,
|
|
395
395
|
{
|
|
396
396
|
"data-slot": "command-empty",
|
|
397
|
-
className:
|
|
398
|
-
...
|
|
397
|
+
className: L("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__ */
|
|
406
|
+
return /* @__PURE__ */ p.jsx(
|
|
407
407
|
_.Group,
|
|
408
408
|
{
|
|
409
409
|
"data-slot": "command-group",
|
|
410
|
-
className:
|
|
410
|
+
className: L(
|
|
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__ */
|
|
422
|
+
return /* @__PURE__ */ p.jsx(
|
|
423
423
|
_.Item,
|
|
424
424
|
{
|
|
425
425
|
"data-slot": "command-item",
|
|
426
|
-
className:
|
|
426
|
+
className: L(
|
|
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
|
-
function
|
|
434
|
+
function Dt({
|
|
435
435
|
searchable: e,
|
|
436
|
-
multiple:
|
|
436
|
+
multiple: n,
|
|
437
437
|
icon: r,
|
|
438
|
-
value:
|
|
439
|
-
onValueChange:
|
|
440
|
-
labels:
|
|
441
|
-
options:
|
|
442
|
-
classNames:
|
|
443
|
-
selectedFeedback:
|
|
444
|
-
alwaysShowPlaceholder:
|
|
438
|
+
value: h,
|
|
439
|
+
onValueChange: i,
|
|
440
|
+
labels: s,
|
|
441
|
+
options: f,
|
|
442
|
+
classNames: m,
|
|
443
|
+
selectedFeedback: y = "checkbox",
|
|
444
|
+
alwaysShowPlaceholder: u = !1,
|
|
445
445
|
valuePosition: x = "right",
|
|
446
|
-
renders:
|
|
446
|
+
renders: d
|
|
447
447
|
}) {
|
|
448
|
-
const [E,
|
|
448
|
+
const [E, I] = fe(!1), [O, G] = fe(n ? [] : ""), v = h !== void 0 ? h : O, A = { ...{
|
|
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
|
-
H(
|
|
452
|
+
multipleSelected: (l) => `${l} options selected`
|
|
453
|
+
}, ...s }, H = (l) => {
|
|
454
|
+
i ? i(l) : G(l);
|
|
455
|
+
}, F = () => n && Array.isArray(v) ? v.length === 0 ? null : v.length === 1 ? f.find((l) => l.value === v[0])?.label : A.multipleSelected?.(v.length) || `${v.length} options selected` : !n && typeof v == "string" && v ? f.find((l) => l.value === v)?.label : null, D = () => n && Array.isArray(v) ? v.length > 0 : typeof v == "string" && v !== "", k = (l) => n && Array.isArray(v) ? v.includes(l) : v === l, j = (l) => {
|
|
456
|
+
if (n) {
|
|
457
|
+
const b = Array.isArray(v) ? v : [], N = b.includes(l) ? b.filter((t) => t !== l) : [...b, l];
|
|
458
|
+
H(N);
|
|
459
459
|
} else
|
|
460
|
-
H(
|
|
461
|
-
},
|
|
462
|
-
const
|
|
463
|
-
|
|
464
|
-
option: P,
|
|
465
|
-
isSelected: N,
|
|
466
|
-
type: b
|
|
467
|
-
}) : b === "check" ? /* @__PURE__ */ g.jsx("span", { className: D("adm:absolute adm:right-2 adm:flex adm:size-3.5 adm:items-center adm:justify-center", s?.check), children: N && /* @__PURE__ */ g.jsx(Pe, { className: "adm:size-4" }) }) : /* @__PURE__ */ g.jsx(
|
|
468
|
-
Le,
|
|
460
|
+
H(l === v ? "" : l), I(!1);
|
|
461
|
+
}, X = (l) => {
|
|
462
|
+
const b = k(l), N = f.find((g) => g.value === l), t = () => y === "check" ? /* @__PURE__ */ p.jsx("span", { className: L("adm:absolute adm:right-2 adm:flex adm:size-3.5 adm:items-center adm:justify-center", m?.check), children: b && /* @__PURE__ */ p.jsx(Me, { className: "adm:size-4" }) }) : /* @__PURE__ */ p.jsx(
|
|
463
|
+
$e,
|
|
469
464
|
{
|
|
470
|
-
checked:
|
|
471
|
-
className:
|
|
465
|
+
checked: b,
|
|
466
|
+
className: m?.checkbox
|
|
472
467
|
}
|
|
473
|
-
);
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
468
|
+
), c = () => t();
|
|
469
|
+
return d?.selectedFeedback ? d.selectedFeedback({
|
|
470
|
+
Original: c,
|
|
471
|
+
option: N,
|
|
472
|
+
isSelected: b,
|
|
473
|
+
type: y
|
|
474
|
+
}) : t();
|
|
475
|
+
}, W = () => {
|
|
476
|
+
const l = () => /* @__PURE__ */ p.jsx("span", { className: "adm:opacity-70", children: A.placeholder }), b = () => l();
|
|
477
|
+
return d?.placeholder ? d.placeholder({
|
|
478
|
+
Original: b,
|
|
479
|
+
text: A.placeholder || "",
|
|
480
|
+
hasValue: D()
|
|
481
|
+
}) : l();
|
|
482
|
+
}, T = () => {
|
|
483
|
+
const l = () => /* @__PURE__ */ p.jsx("span", { children: F() }), b = () => l();
|
|
484
|
+
return d?.displayValue ? d.displayValue({
|
|
485
|
+
Original: b,
|
|
486
|
+
text: F() ?? null,
|
|
487
|
+
value: v
|
|
488
|
+
}) : l();
|
|
489
|
+
}, Y = () => u ? /* @__PURE__ */ p.jsxs("span", { className: "adm:flex adm:items-center adm:gap-2", children: [
|
|
490
|
+
r && /* @__PURE__ */ p.jsx(r, { className: "adm:opacity-50" }),
|
|
491
|
+
W(),
|
|
492
|
+
D() && x === "left" && T()
|
|
493
|
+
] }) : /* @__PURE__ */ p.jsxs("span", { className: "adm:flex adm:items-center adm:gap-2", children: [
|
|
494
|
+
r && /* @__PURE__ */ p.jsx(r, { className: "adm:opacity-50" }),
|
|
495
|
+
D() ? T() : W()
|
|
496
|
+
] }), z = () => {
|
|
497
|
+
const l = () => /* @__PURE__ */ p.jsx(Pe, { className: "adm:size-4 adm:opacity-50" }), b = () => l();
|
|
498
|
+
return d?.triggerIcon ? d.triggerIcon({
|
|
499
|
+
Original: b,
|
|
500
|
+
open: E
|
|
501
|
+
}) : l();
|
|
502
|
+
}, ne = () => u && D() && x === "right" ? /* @__PURE__ */ p.jsxs("span", { className: "adm:flex adm:items-center adm:gap-2", children: [
|
|
503
|
+
T(),
|
|
504
|
+
z()
|
|
505
|
+
] }) : /* @__PURE__ */ p.jsx("span", { className: "adm:flex adm:items-center adm:gap-2", children: z() }), $ = () => {
|
|
506
|
+
const l = () => /* @__PURE__ */ p.jsxs(
|
|
507
|
+
Ie,
|
|
485
508
|
{
|
|
486
509
|
variant: "outline",
|
|
487
510
|
role: "combobox",
|
|
488
511
|
"aria-expanded": E,
|
|
489
|
-
className:
|
|
512
|
+
className: L("adm:justify-between adm:font-normal", m?.trigger),
|
|
490
513
|
children: [
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
d ? i?.placeholder ? i.placeholder({
|
|
494
|
-
text: I.placeholder || "",
|
|
495
|
-
hasValue: R()
|
|
496
|
-
}) : /* @__PURE__ */ g.jsx("span", { className: "adm:opacity-70", children: I.placeholder }) : R() ? i?.displayValue ? i.displayValue({
|
|
497
|
-
text: $() ?? null,
|
|
498
|
-
value: v
|
|
499
|
-
}) : /* @__PURE__ */ g.jsx("span", { children: $() }) : i?.placeholder ? i.placeholder({
|
|
500
|
-
text: I.placeholder || "",
|
|
501
|
-
hasValue: R()
|
|
502
|
-
}) : /* @__PURE__ */ g.jsx("span", { children: I.placeholder }),
|
|
503
|
-
d && R() && x === "left" && (i?.displayValue ? i.displayValue({
|
|
504
|
-
text: $() ?? null,
|
|
505
|
-
value: v
|
|
506
|
-
}) : /* @__PURE__ */ g.jsx("span", { children: $() }))
|
|
507
|
-
] }),
|
|
508
|
-
/* @__PURE__ */ g.jsxs("span", { className: "adm:flex adm:items-center adm:gap-2", children: [
|
|
509
|
-
d && R() && x === "right" && (i?.displayValue ? i.displayValue({
|
|
510
|
-
text: $() ?? null,
|
|
511
|
-
value: v
|
|
512
|
-
}) : /* @__PURE__ */ g.jsx("span", { children: $() })),
|
|
513
|
-
i?.triggerIcon ? i.triggerIcon({ open: E }) : /* @__PURE__ */ g.jsx(Ve, { className: "adm:size-4 adm:opacity-50" })
|
|
514
|
-
] })
|
|
514
|
+
Y(),
|
|
515
|
+
ne()
|
|
515
516
|
]
|
|
516
517
|
}
|
|
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
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
518
|
+
), b = () => l();
|
|
519
|
+
return d?.trigger ? d.trigger({
|
|
520
|
+
Original: b,
|
|
521
|
+
open: E,
|
|
522
|
+
value: v,
|
|
523
|
+
displayText: F() ?? null,
|
|
524
|
+
placeholder: A.placeholder || "",
|
|
525
|
+
hasValue: D(),
|
|
526
|
+
icon: r
|
|
527
|
+
}) : l();
|
|
528
|
+
}, V = () => {
|
|
529
|
+
if (!e) return null;
|
|
530
|
+
const l = () => /* @__PURE__ */ p.jsx(
|
|
531
|
+
dt,
|
|
532
|
+
{
|
|
533
|
+
placeholder: A.searchPlaceholder,
|
|
534
|
+
className: m?.input
|
|
535
|
+
}
|
|
536
|
+
), b = () => l();
|
|
537
|
+
return d?.searchInput ? d.searchInput({
|
|
538
|
+
Original: b,
|
|
539
|
+
placeholder: A.searchPlaceholder || ""
|
|
540
|
+
}) : l();
|
|
541
|
+
}, Q = () => {
|
|
542
|
+
const l = () => /* @__PURE__ */ p.jsx(p.Fragment, { children: A.noItemsFound }), b = () => l();
|
|
543
|
+
return d?.empty ? d.empty({
|
|
544
|
+
Original: b,
|
|
545
|
+
text: A.noItemsFound || ""
|
|
546
|
+
}) : l();
|
|
547
|
+
}, Z = (l) => {
|
|
548
|
+
const b = () => /* @__PURE__ */ p.jsx(p.Fragment, { children: l.label }), N = () => b();
|
|
549
|
+
return d?.optionLabel ? d.optionLabel({
|
|
550
|
+
Original: N,
|
|
551
|
+
option: l
|
|
552
|
+
}) : b();
|
|
553
|
+
}, ae = (l) => {
|
|
554
|
+
const b = () => /* @__PURE__ */ p.jsxs(
|
|
555
|
+
pt,
|
|
556
|
+
{
|
|
557
|
+
value: l.value,
|
|
558
|
+
onSelect: j,
|
|
559
|
+
disabled: l.disabled,
|
|
560
|
+
className: L(
|
|
561
|
+
m?.item,
|
|
562
|
+
y === "check" && "adm:pr-8"
|
|
563
|
+
),
|
|
564
|
+
children: [
|
|
565
|
+
y === "checkbox" && X(l.value),
|
|
566
|
+
Z(l),
|
|
567
|
+
y === "check" && X(l.value)
|
|
568
|
+
]
|
|
569
|
+
},
|
|
570
|
+
l.value
|
|
571
|
+
), N = () => b();
|
|
572
|
+
return d?.option ? /* @__PURE__ */ p.jsx("div", { children: d.option({
|
|
573
|
+
Original: N,
|
|
574
|
+
option: l,
|
|
575
|
+
isSelected: k(l.value),
|
|
576
|
+
selectedFeedback: y
|
|
577
|
+
}) }, l.value) : b();
|
|
578
|
+
};
|
|
579
|
+
return /* @__PURE__ */ p.jsxs(Oe, { open: E, onOpenChange: I, children: [
|
|
580
|
+
/* @__PURE__ */ p.jsx(Ne, { asChild: !0, children: $() }),
|
|
581
|
+
/* @__PURE__ */ p.jsx(Le, { align: "start", className: L("adm:p-0", m?.popover), children: /* @__PURE__ */ p.jsxs(ct, { className: m?.command, children: [
|
|
582
|
+
V(),
|
|
583
|
+
/* @__PURE__ */ p.jsxs(st, { className: m?.list, children: [
|
|
584
|
+
/* @__PURE__ */ p.jsx(mt, { className: m?.empty, children: Q() }),
|
|
585
|
+
/* @__PURE__ */ p.jsx(ft, { className: m?.group, children: f.map((l) => ae(l)) })
|
|
554
586
|
] })
|
|
555
587
|
] }) })
|
|
556
588
|
] });
|
|
557
589
|
}
|
|
558
590
|
export {
|
|
559
|
-
|
|
591
|
+
Dt as Combobox
|
|
560
592
|
};
|