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