prometeo-design-system 2.5.0 → 2.5.1
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as s } from "./jsx-runtime-DKDX3adD.js";
|
|
2
2
|
import { Icons as J } from "./Icons.es.js";
|
|
3
3
|
import { c as i } from "./cn-B6yFEsav.js";
|
|
4
|
-
import
|
|
4
|
+
import je, { memo as W, useState as fe, useRef as G, useMemo as Z, useCallback as V, useEffect as ee, useImperativeHandle as We } from "react";
|
|
5
5
|
import Be from "./Spinner.es.js";
|
|
6
6
|
import { createPortal as Ke } from "react-dom";
|
|
7
7
|
import { u as Ue } from "./useDragScroll-CHN9OMwn.js";
|
|
@@ -9,7 +9,7 @@ import { u as qe, I as Fe } from "./Input-Bhd0bmVq.js";
|
|
|
9
9
|
import Ge from "./CheckBox.es.js";
|
|
10
10
|
import { Skeleton as Ce } from "./Skeleton.es.js";
|
|
11
11
|
const He = (r) => {
|
|
12
|
-
const { variant: e, className:
|
|
12
|
+
const { variant: e, className: d } = r, c = {
|
|
13
13
|
default: "text-neutral-medium-default pt-[1px]",
|
|
14
14
|
error: "text-error-medium-default pt-[1px]",
|
|
15
15
|
success: "text-success-medium-default"
|
|
@@ -18,13 +18,13 @@ const He = (r) => {
|
|
|
18
18
|
error: /* @__PURE__ */ s.jsx(J.Error, { size: 16, className: "text-error-medium-default" }),
|
|
19
19
|
success: /* @__PURE__ */ s.jsx(J.Check, { size: 16, className: "text-success-medium-default" })
|
|
20
20
|
};
|
|
21
|
-
return /* @__PURE__ */ s.jsx("div", { ref: r.ref, className: i("pl-3",
|
|
21
|
+
return /* @__PURE__ */ s.jsx("div", { ref: r.ref, className: i("pl-3", d), children: typeof r.children == "string" ? /* @__PURE__ */ s.jsxs("div", { className: "flex gap-0.5 items-start", children: [
|
|
22
22
|
o[e],
|
|
23
23
|
/* @__PURE__ */ s.jsx("p", { className: i(" prometeo-fonts-body-small", c[e]), children: r.children })
|
|
24
24
|
] }) : r.children });
|
|
25
25
|
};
|
|
26
26
|
He.displayName = "HelperText";
|
|
27
|
-
const Je =
|
|
27
|
+
const Je = W(He), Qe = {
|
|
28
28
|
default: {
|
|
29
29
|
container: "text-neutral-default-default border-neutral-default-default ",
|
|
30
30
|
icon: ""
|
|
@@ -40,22 +40,22 @@ const Je = R(He), Qe = {
|
|
|
40
40
|
}, ke = {
|
|
41
41
|
icon: " text-neutral-default-disabled",
|
|
42
42
|
container: " border-neutral-strong-default text-neutral-default-disabled"
|
|
43
|
-
}, Ie = ({ id: r, label: e, onRemove:
|
|
43
|
+
}, Ie = ({ id: r, label: e, onRemove: d, className: c, disabled: o, variant: l = "default", tabIndex: y }) => /* @__PURE__ */ s.jsxs(
|
|
44
44
|
"div",
|
|
45
45
|
{
|
|
46
46
|
tabIndex: y,
|
|
47
47
|
className: i(
|
|
48
48
|
"inline-flex max-w-[calc(50%-0.25rem)] items-center gap-1 px-2 py-1 bg-inherit text-xs rounded-lg border h-[30px]",
|
|
49
|
-
Qe[
|
|
49
|
+
Qe[l].container,
|
|
50
50
|
o && ke.container
|
|
51
51
|
),
|
|
52
52
|
children: [
|
|
53
53
|
/* @__PURE__ */ s.jsx("span", { className: "truncate w-max ", children: e }),
|
|
54
|
-
|
|
54
|
+
d && /* @__PURE__ */ s.jsx(
|
|
55
55
|
"button",
|
|
56
56
|
{
|
|
57
57
|
onMouseDown: (p) => {
|
|
58
|
-
o || (p.stopPropagation(), p.preventDefault(),
|
|
58
|
+
o || (p.stopPropagation(), p.preventDefault(), d?.(r));
|
|
59
59
|
},
|
|
60
60
|
className: i(
|
|
61
61
|
"shrink-0 p-0.5 transition-all duration-200 hover:text-neutral-default-hover cursor-pointer z-50 text-neutral-default-default hover:scale-105",
|
|
@@ -71,13 +71,13 @@ const Je = R(He), Qe = {
|
|
|
71
71
|
}
|
|
72
72
|
);
|
|
73
73
|
Ie.displayName = "Chip";
|
|
74
|
-
const Xe =
|
|
75
|
-
function
|
|
74
|
+
const Xe = W(Ie);
|
|
75
|
+
function P(r, e) {
|
|
76
76
|
if (typeof e == "function")
|
|
77
77
|
return e(r);
|
|
78
|
-
const
|
|
78
|
+
const d = e?.split(".");
|
|
79
79
|
let c = r;
|
|
80
|
-
for (const o of
|
|
80
|
+
for (const o of d)
|
|
81
81
|
if (c && typeof c == "object" && o in c)
|
|
82
82
|
c = c[o];
|
|
83
83
|
else
|
|
@@ -86,42 +86,42 @@ function $(r, e) {
|
|
|
86
86
|
}
|
|
87
87
|
const Ee = (r, e) => {
|
|
88
88
|
if (!e) return !0;
|
|
89
|
-
const
|
|
89
|
+
const d = 0.1, c = String(r).toLowerCase(), o = String(e).toLowerCase().trim();
|
|
90
90
|
if (c.includes(o)) return !0;
|
|
91
|
-
const
|
|
92
|
-
if (
|
|
91
|
+
const l = o.split(/\s+/).filter(Boolean), y = l.filter((m) => /^\d+$/.test(m));
|
|
92
|
+
if (l.length > 1 || y.length > 0) {
|
|
93
93
|
for (const m of y)
|
|
94
94
|
if (!new RegExp(`(^|\\D)${m}(\\D|$)`).test(c)) return !1;
|
|
95
|
-
for (const m of
|
|
95
|
+
for (const m of l)
|
|
96
96
|
if (!/^\d+$/.test(m) && !c.includes(m))
|
|
97
97
|
return !1;
|
|
98
98
|
return !0;
|
|
99
99
|
}
|
|
100
100
|
if (o.length > c.length) return !1;
|
|
101
|
-
const p = Math.floor(o.length *
|
|
101
|
+
const p = Math.floor(o.length * d);
|
|
102
102
|
if (p <= 0) return !1;
|
|
103
|
-
const
|
|
104
|
-
const v = m.length,
|
|
105
|
-
if (v === 0) return
|
|
106
|
-
if (
|
|
107
|
-
const
|
|
108
|
-
for (let x = 0; x <=
|
|
103
|
+
const k = (m, A) => {
|
|
104
|
+
const v = m.length, N = A.length;
|
|
105
|
+
if (v === 0) return N;
|
|
106
|
+
if (N === 0) return v;
|
|
107
|
+
const S = new Array(N + 1);
|
|
108
|
+
for (let x = 0; x <= N; x++) S[x] = x;
|
|
109
109
|
for (let x = 1; x <= v; x++) {
|
|
110
|
-
let
|
|
111
|
-
|
|
112
|
-
for (let
|
|
113
|
-
const
|
|
114
|
-
|
|
110
|
+
let E = x - 1;
|
|
111
|
+
S[0] = x;
|
|
112
|
+
for (let f = 1; f <= N; f++) {
|
|
113
|
+
const _ = S[f], B = m.charCodeAt(x - 1) === A.charCodeAt(f - 1) ? 0 : 1, z = S[f] + 1, C = S[f - 1] + 1, T = E + B;
|
|
114
|
+
S[f] = z < C ? z < T ? z : T : C < T ? C : T, E = _;
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
return N
|
|
117
|
+
return S[N];
|
|
118
118
|
};
|
|
119
119
|
for (let m = 0; m <= c.length - o.length; m++) {
|
|
120
|
-
const
|
|
121
|
-
if (
|
|
120
|
+
const A = c.slice(m, m + o.length);
|
|
121
|
+
if (k(A, o) <= p) return !0;
|
|
122
122
|
}
|
|
123
123
|
return !1;
|
|
124
|
-
},
|
|
124
|
+
}, ve = {
|
|
125
125
|
default: {
|
|
126
126
|
container: "",
|
|
127
127
|
input: i(
|
|
@@ -170,7 +170,7 @@ const Ee = (r, e) => {
|
|
|
170
170
|
"peer-focus:text-success-light"
|
|
171
171
|
)
|
|
172
172
|
}
|
|
173
|
-
},
|
|
173
|
+
}, De = {
|
|
174
174
|
input: i(
|
|
175
175
|
"border-neutral-strong-default text-neutral-default-default",
|
|
176
176
|
"focus:ring-primary-default-default focus:ring-[1px] focus:border-primary-default-default ",
|
|
@@ -187,47 +187,47 @@ const Ee = (r, e) => {
|
|
|
187
187
|
}, Ye = ({
|
|
188
188
|
id: r,
|
|
189
189
|
name: e,
|
|
190
|
-
value:
|
|
190
|
+
value: d,
|
|
191
191
|
label: c,
|
|
192
192
|
height: o,
|
|
193
|
-
options:
|
|
193
|
+
options: l,
|
|
194
194
|
controls: y,
|
|
195
195
|
className: p,
|
|
196
|
-
placeholder:
|
|
196
|
+
placeholder: k,
|
|
197
197
|
optionValue: m,
|
|
198
|
-
optionLabel:
|
|
198
|
+
optionLabel: A,
|
|
199
199
|
renderOption: v,
|
|
200
|
-
renderSelection:
|
|
201
|
-
buttonClassName:
|
|
200
|
+
renderSelection: N,
|
|
201
|
+
buttonClassName: S,
|
|
202
202
|
dropdownClassName: x,
|
|
203
|
-
containerClassName:
|
|
204
|
-
dropdownOptions:
|
|
205
|
-
helperComponent:
|
|
203
|
+
containerClassName: E,
|
|
204
|
+
dropdownOptions: f,
|
|
205
|
+
helperComponent: _,
|
|
206
206
|
errorComponent: B,
|
|
207
|
-
onRemoveOption:
|
|
208
|
-
onOptionClick:
|
|
209
|
-
onChange:
|
|
210
|
-
onClose:
|
|
207
|
+
onRemoveOption: z,
|
|
208
|
+
onOptionClick: C,
|
|
209
|
+
onChange: T,
|
|
210
|
+
onClose: te,
|
|
211
211
|
onClear: K,
|
|
212
212
|
disabled: j = !1,
|
|
213
213
|
overflow: ae = "wrap",
|
|
214
|
-
variant:
|
|
215
|
-
multiple:
|
|
214
|
+
variant: $ = "default",
|
|
215
|
+
multiple: H = !1,
|
|
216
216
|
isLoading: de = !1,
|
|
217
|
-
attachToParent:
|
|
218
|
-
displayMode:
|
|
217
|
+
attachToParent: Ne = !1,
|
|
218
|
+
displayMode: re = "compact",
|
|
219
219
|
labelVariant: U = "default",
|
|
220
220
|
disableOpenOnFocus: q = !1,
|
|
221
221
|
emptyMessage: Q = "No hay opciones disponibles"
|
|
222
222
|
}) => {
|
|
223
|
-
const [b, D] = fe(!1), [me, he] = fe([]), [oe, ie] = fe(""),
|
|
224
|
-
}),
|
|
223
|
+
const [b, D] = fe(!1), [me, he] = fe([]), [oe, ie] = fe(""), ne = G(null), X = G(null), Y = G(null), ce = G(null), se = G(() => {
|
|
224
|
+
}), le = G(null), n = G(/* @__PURE__ */ new Set()), { ref: a } = qe(), { bind: u, ref: g } = Ue({
|
|
225
225
|
axis: "x",
|
|
226
226
|
cursor: { idle: "default", dragging: "grabbing" }
|
|
227
|
-
}),
|
|
228
|
-
() =>
|
|
229
|
-
[
|
|
230
|
-
),
|
|
227
|
+
}), I = d && d.length > 0, M = {}, R = Z(() => U === "static" && k ? k : "", [U, k]), ge = Z(
|
|
228
|
+
() => f?.controledSearchValue || oe,
|
|
229
|
+
[f?.controledSearchValue, oe]
|
|
230
|
+
), w = () => {
|
|
231
231
|
const t = {
|
|
232
232
|
static: {
|
|
233
233
|
active: "relative prometeo-fonts-label-large",
|
|
@@ -237,78 +237,78 @@ const Ee = (r, e) => {
|
|
|
237
237
|
active: "absolute top-0 -translate-y-1/2 left-3 px-1 prometeo-fonts-body-small",
|
|
238
238
|
default: "absolute top-1/2 -translate-y-1/2 "
|
|
239
239
|
}
|
|
240
|
-
},
|
|
241
|
-
return t[U][
|
|
242
|
-
},
|
|
243
|
-
id:
|
|
244
|
-
value:
|
|
245
|
-
label:
|
|
246
|
-
}),
|
|
247
|
-
() =>
|
|
248
|
-
[
|
|
249
|
-
),
|
|
240
|
+
}, h = b || I ? "active" : "default";
|
|
241
|
+
return t[U][h];
|
|
242
|
+
}, O = (t) => ({
|
|
243
|
+
id: P(t, m),
|
|
244
|
+
value: P(t, m),
|
|
245
|
+
label: P(t, A)
|
|
246
|
+
}), ue = Z(
|
|
247
|
+
() => l.map(O),
|
|
248
|
+
[l]
|
|
249
|
+
), pe = Z(
|
|
250
250
|
() => {
|
|
251
251
|
const t = [];
|
|
252
|
-
return
|
|
253
|
-
const
|
|
254
|
-
|
|
252
|
+
return d?.forEach((h) => {
|
|
253
|
+
const L = l?.find((F) => P(F, m) === h);
|
|
254
|
+
L && t.push(L);
|
|
255
255
|
}), t;
|
|
256
256
|
},
|
|
257
|
-
[
|
|
258
|
-
),
|
|
259
|
-
() =>
|
|
260
|
-
[ge]
|
|
261
|
-
), ze = V(
|
|
262
|
-
() => new Set(pe.map((t) => t.id)),
|
|
257
|
+
[d, m, l]
|
|
258
|
+
), xe = Z(
|
|
259
|
+
() => pe.map(O),
|
|
263
260
|
[pe]
|
|
264
|
-
),
|
|
261
|
+
), ze = Z(
|
|
262
|
+
() => new Set(xe.map((t) => t.id)),
|
|
263
|
+
[xe]
|
|
264
|
+
), Te = V(() => {
|
|
265
265
|
D((t) => !t);
|
|
266
266
|
}, []);
|
|
267
|
-
|
|
268
|
-
let
|
|
269
|
-
if (!
|
|
270
|
-
|
|
267
|
+
se.current = (t) => {
|
|
268
|
+
let h;
|
|
269
|
+
if (!H)
|
|
270
|
+
h = [t];
|
|
271
271
|
else {
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
const Se =
|
|
272
|
+
const L = d || [], F = [], Me = L.includes(t.value);
|
|
273
|
+
L.forEach((ye) => {
|
|
274
|
+
const Se = ue.find((Re) => Re.value === ye);
|
|
275
275
|
Se && F.push(Se);
|
|
276
|
-
}),
|
|
276
|
+
}), h = Me ? F.filter((ye) => ye.value !== t.value) : [...F, t];
|
|
277
277
|
}
|
|
278
|
-
|
|
278
|
+
T?.(h, e);
|
|
279
279
|
};
|
|
280
|
-
const Ae =
|
|
281
|
-
|
|
282
|
-
}, [
|
|
283
|
-
t.preventDefault(), t.stopPropagation(), t.target.blur(), K?.(),
|
|
284
|
-
},
|
|
285
|
-
|
|
286
|
-
const
|
|
287
|
-
if (!
|
|
288
|
-
const
|
|
289
|
-
|
|
290
|
-
}, [
|
|
291
|
-
|
|
292
|
-
}, [
|
|
293
|
-
|
|
280
|
+
const Ae = V((t) => {
|
|
281
|
+
C?.(t, e), se.current?.(t), H || (D(!1), te?.());
|
|
282
|
+
}, [H, C, te, e]), $e = (t) => {
|
|
283
|
+
t.preventDefault(), t.stopPropagation(), t.target.blur(), K?.(), T?.([], e);
|
|
284
|
+
}, be = V((t) => {
|
|
285
|
+
H || T?.([], e);
|
|
286
|
+
const h = l.find((F) => P(F, m) === t);
|
|
287
|
+
if (!h) return;
|
|
288
|
+
const L = O(h);
|
|
289
|
+
C?.(L, e), se.current?.(L), z?.(h);
|
|
290
|
+
}, [C, z, l, e, H, T]), Oe = V((t) => {
|
|
291
|
+
be(t);
|
|
292
|
+
}, [be]);
|
|
293
|
+
ee(() => {
|
|
294
294
|
if (!b) return;
|
|
295
|
-
const t = (
|
|
296
|
-
const
|
|
297
|
-
if (
|
|
298
|
-
if (
|
|
295
|
+
const t = (h) => {
|
|
296
|
+
const L = h.target;
|
|
297
|
+
if (h.type === "mousedown") {
|
|
298
|
+
if (ne.current?.contains(L) || X.current?.contains(L)) return;
|
|
299
299
|
D(!1);
|
|
300
300
|
}
|
|
301
|
-
if (
|
|
302
|
-
if (X.current?.contains(
|
|
301
|
+
if (h.type === "scroll") {
|
|
302
|
+
if (X.current?.contains(L)) return;
|
|
303
303
|
D(!1);
|
|
304
304
|
}
|
|
305
|
-
|
|
305
|
+
h.type === "resize" && D(!1);
|
|
306
306
|
};
|
|
307
307
|
return document.addEventListener("mousedown", t), window.addEventListener("scroll", t, !0), window.addEventListener("resize", t, !0), () => {
|
|
308
308
|
document.removeEventListener("mousedown", t), window.removeEventListener("scroll", t, !0), window.removeEventListener("resize", t, !0);
|
|
309
309
|
};
|
|
310
|
-
}, [b]),
|
|
311
|
-
|
|
310
|
+
}, [b]), ee(() => {
|
|
311
|
+
n.current.forEach((t) => {
|
|
312
312
|
try {
|
|
313
313
|
t(b);
|
|
314
314
|
} catch {
|
|
@@ -322,8 +322,8 @@ const Ee = (r, e) => {
|
|
|
322
322
|
b && D(!1);
|
|
323
323
|
},
|
|
324
324
|
toggle: () => D((t) => !t),
|
|
325
|
-
subscribeOpenChange: (t) => (
|
|
326
|
-
|
|
325
|
+
subscribeOpenChange: (t) => (n.current.add(t), () => {
|
|
326
|
+
n.current.delete(t);
|
|
327
327
|
}),
|
|
328
328
|
searchInputRef: Y
|
|
329
329
|
}), [b]);
|
|
@@ -344,22 +344,22 @@ const Ee = (r, e) => {
|
|
|
344
344
|
p,
|
|
345
345
|
U === "static" && "mt-2"
|
|
346
346
|
),
|
|
347
|
-
ref:
|
|
347
|
+
ref: ne,
|
|
348
348
|
draggable: !1,
|
|
349
|
-
style:
|
|
349
|
+
style: M,
|
|
350
350
|
children: [
|
|
351
|
-
/* @__PURE__ */ s.jsxs("div", { className: i("relative bg-inherit ",
|
|
351
|
+
/* @__PURE__ */ s.jsxs("div", { className: i("relative bg-inherit ", E), children: [
|
|
352
352
|
/* @__PURE__ */ s.jsx(
|
|
353
353
|
"label",
|
|
354
354
|
{
|
|
355
355
|
htmlFor: r,
|
|
356
|
-
ref:
|
|
356
|
+
ref: a,
|
|
357
357
|
className: i(
|
|
358
358
|
"left-3 pointer-events-none bg-inherit z-10",
|
|
359
359
|
U === "default" && "transition-all duration-200 ease-in-out",
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
j &&
|
|
360
|
+
w(),
|
|
361
|
+
I || b ? ve[$].label : "text-neutral-medium-default",
|
|
362
|
+
j && De.label
|
|
363
363
|
),
|
|
364
364
|
children: c
|
|
365
365
|
}
|
|
@@ -380,44 +380,44 @@ const Ee = (r, e) => {
|
|
|
380
380
|
"w-full px-2 text-left border rounded-lg transition-all duration-200 ease-in-out",
|
|
381
381
|
"flex items-center justify-start bg-inherit ",
|
|
382
382
|
"focus:outline-none",
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
j &&
|
|
387
|
-
|
|
383
|
+
re === "chips" && "mt-1.5",
|
|
384
|
+
re === "chips" && H && I ? "min-h-14 py-3 " : !o && "h-14 min-h-14",
|
|
385
|
+
ve[$].input,
|
|
386
|
+
j && De.input,
|
|
387
|
+
S
|
|
388
388
|
),
|
|
389
389
|
children: [
|
|
390
390
|
/* @__PURE__ */ s.jsx(
|
|
391
391
|
"div",
|
|
392
392
|
{
|
|
393
393
|
className: i("flex-1 overflow-x-auto overflow-y-hidden px-1 prometeo-scrollbar-none "),
|
|
394
|
-
ref:
|
|
395
|
-
onPointerUp:
|
|
396
|
-
onPointerDown:
|
|
397
|
-
onPointerMove:
|
|
398
|
-
onPointerLeave:
|
|
399
|
-
onPointerCancel:
|
|
400
|
-
onClickCapture:
|
|
401
|
-
children:
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
(t,
|
|
394
|
+
ref: g,
|
|
395
|
+
onPointerUp: u.onPointerUp,
|
|
396
|
+
onPointerDown: u.onPointerDown,
|
|
397
|
+
onPointerMove: u.onPointerMove,
|
|
398
|
+
onPointerLeave: u.onPointerLeave,
|
|
399
|
+
onPointerCancel: u.onPointerCancel,
|
|
400
|
+
onClickCapture: u.onClickCapture,
|
|
401
|
+
children: N ? je.createElement(
|
|
402
|
+
W(
|
|
403
|
+
N,
|
|
404
|
+
(t, h) => t.disabled === h.disabled && t.multiple === h.multiple
|
|
405
405
|
),
|
|
406
406
|
{
|
|
407
407
|
disabled: j,
|
|
408
|
-
multiple:
|
|
409
|
-
placeholder:
|
|
410
|
-
selectedOptions:
|
|
408
|
+
multiple: H,
|
|
409
|
+
placeholder: k,
|
|
410
|
+
selectedOptions: pe,
|
|
411
411
|
onRemoveOption: Oe
|
|
412
412
|
}
|
|
413
413
|
) : /* @__PURE__ */ s.jsx(
|
|
414
414
|
Le,
|
|
415
415
|
{
|
|
416
|
-
displayMode:
|
|
417
|
-
selectedOptions:
|
|
418
|
-
placeholder:
|
|
419
|
-
onRemoveOption:
|
|
420
|
-
multiple:
|
|
416
|
+
displayMode: re,
|
|
417
|
+
selectedOptions: xe,
|
|
418
|
+
placeholder: R,
|
|
419
|
+
onRemoveOption: be,
|
|
420
|
+
multiple: H,
|
|
421
421
|
className: i(ae === "scroll" ? "flex-nowrap" : "flex-wrap"),
|
|
422
422
|
disabled: j
|
|
423
423
|
}
|
|
@@ -426,7 +426,7 @@ const Ee = (r, e) => {
|
|
|
426
426
|
),
|
|
427
427
|
/* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
428
428
|
de && /* @__PURE__ */ s.jsx(Be, { size: "small", variant: "clip", className: " translate-y-1", speedMultiplier: 0.7 }),
|
|
429
|
-
|
|
429
|
+
I && K && /* @__PURE__ */ s.jsx(
|
|
430
430
|
"button",
|
|
431
431
|
{
|
|
432
432
|
onMouseDown: (t) => {
|
|
@@ -434,7 +434,7 @@ const Ee = (r, e) => {
|
|
|
434
434
|
},
|
|
435
435
|
type: "button",
|
|
436
436
|
tabIndex: -1,
|
|
437
|
-
children: /* @__PURE__ */ s.jsx(J.Cancel, { size: 20, className: i(" cursor-pointer transition-all",
|
|
437
|
+
children: /* @__PURE__ */ s.jsx(J.Cancel, { size: 20, className: i(" cursor-pointer transition-all", ve[$].icon) })
|
|
438
438
|
}
|
|
439
439
|
),
|
|
440
440
|
/* @__PURE__ */ s.jsx(
|
|
@@ -444,7 +444,7 @@ const Ee = (r, e) => {
|
|
|
444
444
|
className: i(
|
|
445
445
|
"transition-transform text-neutral-default-default",
|
|
446
446
|
b ? "rotate-180" : "",
|
|
447
|
-
j &&
|
|
447
|
+
j && De.icon
|
|
448
448
|
)
|
|
449
449
|
}
|
|
450
450
|
)
|
|
@@ -457,126 +457,126 @@ const Ee = (r, e) => {
|
|
|
457
457
|
Ve,
|
|
458
458
|
{
|
|
459
459
|
isOpen: b,
|
|
460
|
-
multiple:
|
|
460
|
+
multiple: H,
|
|
461
461
|
disabled: j,
|
|
462
|
-
optionLabel:
|
|
462
|
+
optionLabel: A,
|
|
463
463
|
optionValue: m,
|
|
464
464
|
labelVariant: U,
|
|
465
465
|
renderOption: v,
|
|
466
466
|
emptyMessage: Q,
|
|
467
|
-
attachToParent:
|
|
467
|
+
attachToParent: Ne,
|
|
468
468
|
filteredOptions: me,
|
|
469
469
|
dropdownClassName: x,
|
|
470
470
|
setFilteredOptions: he,
|
|
471
471
|
selectedOptionsIds: ze,
|
|
472
|
-
options: v ?
|
|
473
|
-
selectRef:
|
|
472
|
+
options: v ? l : ue,
|
|
473
|
+
selectRef: ne,
|
|
474
474
|
dropdownRef: X,
|
|
475
475
|
selectButtonRef: ce,
|
|
476
|
-
helperComponentRef:
|
|
476
|
+
helperComponentRef: le,
|
|
477
477
|
onOptionClick: Ae,
|
|
478
478
|
onCloseDropdown: () => D(!1),
|
|
479
|
-
searchValue:
|
|
479
|
+
searchValue: ge,
|
|
480
480
|
setSearchValue: ie,
|
|
481
481
|
searchInputRef: Y,
|
|
482
|
-
isLoading:
|
|
483
|
-
onSearchClear:
|
|
484
|
-
hideSearchBar:
|
|
485
|
-
dropdownHeight:
|
|
486
|
-
onSearchValueChange:
|
|
487
|
-
inputSearchPlaceholder:
|
|
482
|
+
isLoading: f?.isLoading,
|
|
483
|
+
onSearchClear: f?.onSearchClear,
|
|
484
|
+
hideSearchBar: f?.hideSearchBar,
|
|
485
|
+
dropdownHeight: f?.dropdownHeight,
|
|
486
|
+
onSearchValueChange: f?.onSearchValueChange,
|
|
487
|
+
inputSearchPlaceholder: f?.inputSearchPlaceholder
|
|
488
488
|
}
|
|
489
489
|
),
|
|
490
|
-
(B ||
|
|
490
|
+
(B || _) && /* @__PURE__ */ s.jsx(
|
|
491
491
|
Je,
|
|
492
492
|
{
|
|
493
|
-
ref:
|
|
494
|
-
variant:
|
|
493
|
+
ref: le,
|
|
494
|
+
variant: $,
|
|
495
495
|
className: "mt-1",
|
|
496
|
-
children: B ||
|
|
496
|
+
children: B || _
|
|
497
497
|
}
|
|
498
498
|
)
|
|
499
499
|
]
|
|
500
500
|
}
|
|
501
501
|
);
|
|
502
|
-
}, ut =
|
|
502
|
+
}, ut = W(Ye, (r, e) => r.value === e.value && r.options === e.options && r.isLoading === e.isLoading && r.disabled === e.disabled && r.errorComponent === e.errorComponent && r.helperComponent === e.helperComponent && r.variant === e.variant && r.label === e.label && r.id === e.id && r.name === e.name && r.placeholder === e.placeholder && r.dropdownOptions?.controledSearchValue === e.dropdownOptions?.controledSearchValue && r.dropdownOptions?.isLoading === e.dropdownOptions?.isLoading);
|
|
503
503
|
function Ze({
|
|
504
504
|
isOpen: r,
|
|
505
505
|
options: e,
|
|
506
|
-
multiple:
|
|
506
|
+
multiple: d,
|
|
507
507
|
disabled: c,
|
|
508
508
|
selectRef: o,
|
|
509
|
-
dropdownRef:
|
|
509
|
+
dropdownRef: l,
|
|
510
510
|
optionLabel: y,
|
|
511
511
|
optionValue: p,
|
|
512
|
-
searchValue:
|
|
512
|
+
searchValue: k,
|
|
513
513
|
labelVariant: m,
|
|
514
|
-
emptyMessage:
|
|
514
|
+
emptyMessage: A,
|
|
515
515
|
renderOption: v,
|
|
516
|
-
onOptionClick:
|
|
517
|
-
onSearchClear:
|
|
516
|
+
onOptionClick: N,
|
|
517
|
+
onSearchClear: S,
|
|
518
518
|
searchInputRef: x,
|
|
519
|
-
setSearchValue:
|
|
520
|
-
dropdownHeight:
|
|
521
|
-
attachToParent:
|
|
519
|
+
setSearchValue: E,
|
|
520
|
+
dropdownHeight: f,
|
|
521
|
+
attachToParent: _,
|
|
522
522
|
filteredOptions: B,
|
|
523
|
-
selectButtonRef:
|
|
524
|
-
onCloseDropdown:
|
|
525
|
-
dropdownClassName:
|
|
526
|
-
helperComponentRef:
|
|
523
|
+
selectButtonRef: z,
|
|
524
|
+
onCloseDropdown: C,
|
|
525
|
+
dropdownClassName: T,
|
|
526
|
+
helperComponentRef: te,
|
|
527
527
|
selectedOptionsIds: K,
|
|
528
528
|
setFilteredOptions: j,
|
|
529
529
|
onSearchValueChange: ae,
|
|
530
|
-
isLoading:
|
|
531
|
-
hideSearchBar:
|
|
530
|
+
isLoading: $ = !1,
|
|
531
|
+
hideSearchBar: H = !1,
|
|
532
532
|
inputSearchPlaceholder: de = "Buscar opciones"
|
|
533
533
|
}) {
|
|
534
|
-
const
|
|
535
|
-
if (!
|
|
536
|
-
const
|
|
534
|
+
const re = m === "static" ? -20 : 7, q = V(() => f ? f.endsWith("px") ? Number(f.replace("px", "")) : f.endsWith("vh") ? window.innerHeight * Number(f.replace("vh", "")) / 100 : f.endsWith("%") ? window.innerHeight * Number(f.replace("%", "")) / 100 : 320 : 320, [f])(), [Q, b] = fe({ direction: "down", height: q }), D = (n) => {
|
|
535
|
+
if (!l.current || !o.current) return;
|
|
536
|
+
const a = o.current.getBoundingClientRect();
|
|
537
537
|
switch (n || Q.direction) {
|
|
538
538
|
case "down":
|
|
539
|
-
|
|
539
|
+
l.current.style.top = `${a.top + a.height - (te?.current?.offsetHeight ? te?.current?.offsetHeight + 4 : 0)}px`;
|
|
540
540
|
break;
|
|
541
541
|
case "up":
|
|
542
|
-
|
|
542
|
+
l.current.style.top = "auto", l.current.style.bottom = `${window.innerHeight - a.top + re}px`;
|
|
543
543
|
break;
|
|
544
544
|
}
|
|
545
|
-
|
|
545
|
+
l.current.style.left = `${a.left}px`, l.current.style.width = `${a.width}px`;
|
|
546
546
|
}, me = (n) => {
|
|
547
|
-
|
|
547
|
+
l.current && (l.current.style.maxHeight = `${n}px`);
|
|
548
548
|
}, he = () => {
|
|
549
|
-
if (!
|
|
550
|
-
const n = o.current.getBoundingClientRect(),
|
|
551
|
-
let
|
|
552
|
-
return
|
|
549
|
+
if (!l.current || !o.current) return Q;
|
|
550
|
+
const n = o.current.getBoundingClientRect(), a = window.innerHeight - (window.innerHeight - n.top), u = window.innerHeight - n.bottom, g = u >= q, I = a >= q;
|
|
551
|
+
let M = "down", R;
|
|
552
|
+
return g ? (M = "down", R = q) : I ? (M = "up", R = q) : u > a ? (M = "down", R = u - 16) : (M = "up", R = a - 16), { direction: M, height: R };
|
|
553
553
|
}, oe = (n) => {
|
|
554
|
-
if (!(!
|
|
555
|
-
if (
|
|
556
|
-
|
|
554
|
+
if (!(!l.current || !o.current)) {
|
|
555
|
+
if (l.current.style.transition = "max-height 0.2s ease,opacity 0.2s ease", !n) {
|
|
556
|
+
l.current.style.maxHeight = "0", l.current.style.opacity = "0", l.current.style.pointerEvents = "none";
|
|
557
557
|
return;
|
|
558
558
|
}
|
|
559
|
-
if (!
|
|
560
|
-
const
|
|
561
|
-
b(
|
|
559
|
+
if (!_) {
|
|
560
|
+
const a = he();
|
|
561
|
+
b(a), D(a.direction), me(a.height);
|
|
562
562
|
}
|
|
563
|
-
|
|
563
|
+
l.current.style.opacity = "1", l.current.style.pointerEvents = "auto";
|
|
564
564
|
}
|
|
565
565
|
};
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
}, [K]),
|
|
566
|
+
ee(() => {
|
|
567
|
+
_ || !o.current || !r || D();
|
|
568
|
+
}, [K]), ee(() => {
|
|
569
569
|
oe(r);
|
|
570
|
-
}, [r]),
|
|
570
|
+
}, [r]), ee(() => {
|
|
571
571
|
e && j(e);
|
|
572
|
-
}, [e]),
|
|
573
|
-
if (
|
|
574
|
-
const n = ie(e,
|
|
572
|
+
}, [e]), ee(() => {
|
|
573
|
+
if ($ || !k) return;
|
|
574
|
+
const n = ie(e, k);
|
|
575
575
|
j(n);
|
|
576
576
|
}, [e]);
|
|
577
|
-
const ie = (n,
|
|
578
|
-
const
|
|
579
|
-
if (j(
|
|
577
|
+
const ie = (n, a) => n.filter((u) => Ee(v ? P(u, y) : u.label, a)), ne = (n) => {
|
|
578
|
+
const a = ie(e, n);
|
|
579
|
+
if (j(a), ae) {
|
|
580
580
|
if (n === "") {
|
|
581
581
|
X();
|
|
582
582
|
return;
|
|
@@ -584,53 +584,53 @@ function Ze({
|
|
|
584
584
|
ae(n);
|
|
585
585
|
return;
|
|
586
586
|
}
|
|
587
|
-
|
|
588
|
-
}, X =
|
|
589
|
-
if (
|
|
590
|
-
|
|
587
|
+
E && e && E(n);
|
|
588
|
+
}, X = V(() => {
|
|
589
|
+
if (S) {
|
|
590
|
+
S(), j(
|
|
591
591
|
e.filter((n) => {
|
|
592
|
-
const
|
|
593
|
-
return K.has(
|
|
592
|
+
const a = v ? P(n, p) : n.id;
|
|
593
|
+
return K.has(a);
|
|
594
594
|
})
|
|
595
595
|
);
|
|
596
596
|
return;
|
|
597
597
|
}
|
|
598
|
-
|
|
599
|
-
}, [e, K, p,
|
|
600
|
-
n.key === "ArrowDown" ? (n.preventDefault(),
|
|
601
|
-
|
|
598
|
+
E && (E(""), j(e));
|
|
599
|
+
}, [e, K, p, S, j, E]), Y = (n) => {
|
|
600
|
+
n.key === "ArrowDown" ? (n.preventDefault(), l.current?.querySelector("[role=listitem]")?.focus()) : (n.key === "Tab" || n.key === "Escape") && setTimeout(() => {
|
|
601
|
+
z.current?.focus(), C();
|
|
602
602
|
}, 10);
|
|
603
|
-
}, ce = (n,
|
|
604
|
-
const
|
|
603
|
+
}, ce = (n, a) => {
|
|
604
|
+
const u = Array.from(l.current?.querySelectorAll("[role=listitem]") || []), g = u.indexOf(n.currentTarget);
|
|
605
605
|
if (n.key === "ArrowDown") {
|
|
606
606
|
n.preventDefault();
|
|
607
|
-
const
|
|
608
|
-
|
|
607
|
+
const I = g < u.length - 1 ? g + 1 : g;
|
|
608
|
+
u[I]?.focus();
|
|
609
609
|
} else if (n.key === "ArrowUp")
|
|
610
|
-
if (n.preventDefault(),
|
|
610
|
+
if (n.preventDefault(), g === 0)
|
|
611
611
|
x && x.current?.focus();
|
|
612
612
|
else {
|
|
613
|
-
const
|
|
614
|
-
|
|
613
|
+
const I = g - 1;
|
|
614
|
+
u[I]?.focus();
|
|
615
615
|
}
|
|
616
616
|
else if (n.key === "Enter" || n.key === " ") {
|
|
617
617
|
if (n.preventDefault(), c) return;
|
|
618
|
-
|
|
619
|
-
|
|
618
|
+
N(a), d || setTimeout(() => {
|
|
619
|
+
z.current?.focus(), C();
|
|
620
620
|
}, 10);
|
|
621
621
|
} else n.key === "Escape" ? (n.preventDefault(), setTimeout(() => {
|
|
622
|
-
|
|
622
|
+
z.current?.focus(), C();
|
|
623
623
|
}, 10)) : n.key === "Tab" && setTimeout(() => {
|
|
624
|
-
|
|
624
|
+
z.current?.focus(), C();
|
|
625
625
|
}, 10);
|
|
626
|
-
},
|
|
627
|
-
|
|
626
|
+
}, se = Array.from({ length: 5 }).map((n, a) => v ? je.createElement(
|
|
627
|
+
W(
|
|
628
628
|
v,
|
|
629
|
-
(
|
|
629
|
+
(u, g) => u.isSelected === g.isSelected && u.option === g.option && u.disabled === g.disabled && u.multiple === g.multiple
|
|
630
630
|
),
|
|
631
631
|
{
|
|
632
|
-
key: `skeleton-option-${
|
|
633
|
-
option: { id:
|
|
632
|
+
key: `skeleton-option-${a}`,
|
|
633
|
+
option: { id: a, label: "", value: "" },
|
|
634
634
|
isSelected: !1,
|
|
635
635
|
multiple: !1,
|
|
636
636
|
onSelect: () => {
|
|
@@ -639,118 +639,121 @@ function Ze({
|
|
|
639
639
|
isLoading: !0
|
|
640
640
|
}
|
|
641
641
|
) : /* @__PURE__ */ s.jsx(
|
|
642
|
-
|
|
642
|
+
we,
|
|
643
643
|
{
|
|
644
644
|
multiple: !1,
|
|
645
645
|
isLoading: !0,
|
|
646
646
|
onSelect: () => {
|
|
647
647
|
},
|
|
648
648
|
isSelected: !1,
|
|
649
|
-
option: { id:
|
|
649
|
+
option: { id: a, label: "", value: "" }
|
|
650
650
|
},
|
|
651
|
-
`skeleton-option-${
|
|
652
|
-
)),
|
|
651
|
+
`skeleton-option-${a}`
|
|
652
|
+
)), le = /* @__PURE__ */ s.jsx(
|
|
653
653
|
"div",
|
|
654
654
|
{
|
|
655
655
|
tabIndex: 0,
|
|
656
|
-
|
|
657
|
-
onKeyDown: (d) => ce(d, l),
|
|
658
|
-
className: "focus-visible:bg-neutral-default-hover outline-none",
|
|
659
|
-
children: n
|
|
660
|
-
}
|
|
661
|
-
), Z = /* @__PURE__ */ s.jsx(
|
|
662
|
-
"div",
|
|
663
|
-
{
|
|
664
|
-
tabIndex: 0,
|
|
665
|
-
ref: a,
|
|
656
|
+
ref: l,
|
|
666
657
|
style: { opacity: "0" },
|
|
667
658
|
className: i(
|
|
668
659
|
" z-50 w-full mt-1 bg-neutral-default-default border border-neutral-default-default rounded-lg shadow-lg",
|
|
669
660
|
" overflow-hidden focus-visible:bg-neutral-default-hover ",
|
|
670
|
-
|
|
661
|
+
_ ? "absolute z-50 " : "fixed z-100 top-0 left-0",
|
|
671
662
|
Q.direction === "up" ? "h-auto" : " h-max",
|
|
672
|
-
|
|
663
|
+
T
|
|
673
664
|
),
|
|
674
665
|
children: /* @__PURE__ */ s.jsxs(
|
|
675
666
|
"div",
|
|
676
667
|
{
|
|
677
668
|
className: i(
|
|
678
669
|
"flex flex-col ",
|
|
679
|
-
|
|
670
|
+
H ? "p-0" : "p-2 pt-0 gap-2"
|
|
680
671
|
),
|
|
681
672
|
style: {
|
|
682
673
|
height: "auto",
|
|
683
674
|
maxHeight: Q.height
|
|
684
675
|
},
|
|
685
676
|
children: [
|
|
686
|
-
!
|
|
677
|
+
!H && /* @__PURE__ */ s.jsx(
|
|
687
678
|
Fe,
|
|
688
679
|
{
|
|
689
680
|
name: "",
|
|
690
681
|
label: "",
|
|
691
682
|
size: "small",
|
|
692
683
|
tabIndex: 0,
|
|
693
|
-
value:
|
|
684
|
+
value: k,
|
|
694
685
|
disabled: c,
|
|
695
686
|
ref: x,
|
|
696
687
|
labelVariant: "static",
|
|
697
688
|
icon: /* @__PURE__ */ s.jsx(J.Search, {}),
|
|
698
|
-
isFetching:
|
|
689
|
+
isFetching: $,
|
|
699
690
|
onKeyDown: Y,
|
|
700
691
|
onClear: X,
|
|
701
|
-
onChange:
|
|
692
|
+
onChange: ne,
|
|
702
693
|
placeholder: de,
|
|
703
694
|
className: " bg-neutral-medium-pressed"
|
|
704
695
|
}
|
|
705
696
|
),
|
|
706
|
-
/* @__PURE__ */ s.jsx("div", { className: " overflow-y-auto flex-1 max-h-max ", children: B.length === 0 ?
|
|
707
|
-
const
|
|
708
|
-
id:
|
|
709
|
-
label: String(
|
|
710
|
-
value:
|
|
711
|
-
} :
|
|
712
|
-
|
|
713
|
-
},
|
|
714
|
-
if (w
|
|
715
|
-
if (!
|
|
716
|
-
|
|
697
|
+
/* @__PURE__ */ s.jsx("div", { className: " overflow-y-auto flex-1 max-h-max ", children: B.length === 0 ? $ ? /* @__PURE__ */ s.jsx("div", { className: "flex flex-col gap-1 overflow-hidden w-full", children: se }) : /* @__PURE__ */ s.jsx("div", { className: "px-3 py-2 text-neutral-medium-default", children: k ? `No se encontraron resultados para "${k}"` : A }) : B.map((n) => {
|
|
698
|
+
const a = v ? P(n, p) : n.id, u = K.has(a), g = (w) => v ? {
|
|
699
|
+
id: a,
|
|
700
|
+
label: String(P(w, y)),
|
|
701
|
+
value: P(w, p)
|
|
702
|
+
} : w, I = () => {
|
|
703
|
+
N(g(n));
|
|
704
|
+
}, M = (w) => {
|
|
705
|
+
if (N(w), !d) {
|
|
706
|
+
if (!E) return;
|
|
707
|
+
E(""), j(e);
|
|
708
|
+
}
|
|
709
|
+
}, R = (w, O) => /* @__PURE__ */ s.jsx(
|
|
710
|
+
"div",
|
|
711
|
+
{
|
|
712
|
+
tabIndex: 0,
|
|
713
|
+
role: "listitem",
|
|
714
|
+
onKeyDown: (ue) => ce(ue, O),
|
|
715
|
+
className: i(
|
|
716
|
+
"focus-visible:bg-neutral-medium-hover outline-none hover:bg-neutral-medium-hover ",
|
|
717
|
+
u && "bg-neutral-medium-selected"
|
|
718
|
+
),
|
|
719
|
+
children: w
|
|
717
720
|
}
|
|
718
|
-
|
|
719
|
-
|
|
721
|
+
), ge = v ? je.createElement(
|
|
722
|
+
W(
|
|
720
723
|
v,
|
|
721
|
-
(
|
|
724
|
+
(w, O) => w.isSelected === O.isSelected && w.option === O.option && w.disabled === O.disabled && w.multiple === O.multiple
|
|
722
725
|
),
|
|
723
726
|
{
|
|
724
|
-
key:
|
|
727
|
+
key: a,
|
|
725
728
|
option: n,
|
|
726
|
-
isSelected:
|
|
727
|
-
multiple:
|
|
728
|
-
onSelect:
|
|
729
|
+
isSelected: u,
|
|
730
|
+
multiple: d,
|
|
731
|
+
onSelect: I,
|
|
729
732
|
disabled: c,
|
|
730
|
-
isLoading:
|
|
733
|
+
isLoading: $
|
|
731
734
|
}
|
|
732
735
|
) : /* @__PURE__ */ s.jsx(
|
|
733
|
-
|
|
736
|
+
we,
|
|
734
737
|
{
|
|
735
738
|
disabled: c,
|
|
736
|
-
multiple:
|
|
737
|
-
isLoading:
|
|
738
|
-
isSelected:
|
|
739
|
-
onSelect:
|
|
739
|
+
multiple: d,
|
|
740
|
+
isLoading: $,
|
|
741
|
+
isSelected: u,
|
|
742
|
+
onSelect: M,
|
|
740
743
|
option: n
|
|
741
744
|
},
|
|
742
|
-
|
|
745
|
+
a
|
|
743
746
|
);
|
|
744
|
-
return
|
|
747
|
+
return R(ge, g(n));
|
|
745
748
|
}) })
|
|
746
749
|
]
|
|
747
750
|
}
|
|
748
751
|
)
|
|
749
752
|
}
|
|
750
753
|
);
|
|
751
|
-
return
|
|
754
|
+
return _ ? le : Ke(le, document.body);
|
|
752
755
|
}
|
|
753
|
-
const Ve =
|
|
756
|
+
const Ve = W(Ze, (r, e) => r.options === e.options && r.selectedOptionsIds === e.selectedOptionsIds && r.multiple === e.multiple && r.disabled === e.disabled && r.emptyMessage === e.emptyMessage && r.renderOption === e.renderOption && r.isOpen === e.isOpen && r.attachToParent === e.attachToParent && r.optionValue === e.optionValue && r.optionLabel === e.optionLabel && r.filteredOptions === e.filteredOptions && r.isLoading === e.isLoading), we = W(({ option: r, isSelected: e, onSelect: d, multiple: c, disabled: o, isLoading: l }) => l ? /* @__PURE__ */ s.jsxs("div", { className: "flex gap-2 w-full px-3 py-2 cursor-wait", children: [
|
|
754
757
|
/* @__PURE__ */ s.jsx(Ce, { className: "size-6 aspect-square" }),
|
|
755
758
|
/* @__PURE__ */ s.jsx(Ce, { className: "flex-1 h-6" })
|
|
756
759
|
] }) : (
|
|
@@ -759,11 +762,11 @@ const Ve = R(Ze, (r, e) => r.options === e.options && r.selectedOptionsIds === e
|
|
|
759
762
|
"div",
|
|
760
763
|
{
|
|
761
764
|
onMouseDown: (y) => {
|
|
762
|
-
y.preventDefault(), y.stopPropagation(), !o &&
|
|
765
|
+
y.preventDefault(), y.stopPropagation(), !o && d?.(r);
|
|
763
766
|
},
|
|
764
767
|
className: i(
|
|
765
768
|
"px-3 py-2 cursor-pointer flex items-center transition-colors text-neutral-default-default ",
|
|
766
|
-
e ? "
|
|
769
|
+
e ? " text-primary-default-default" : "hover:bg-neutral-medium-hover text-neutral-default-hover",
|
|
767
770
|
o && "text-neutral-default-disabled hover:bg-neutral-default-default"
|
|
768
771
|
),
|
|
769
772
|
children: [
|
|
@@ -779,14 +782,14 @@ const Ve = R(Ze, (r, e) => r.options === e.options && r.selectedOptionsIds === e
|
|
|
779
782
|
}
|
|
780
783
|
)
|
|
781
784
|
), (r, e) => r.isSelected === e.isSelected);
|
|
782
|
-
|
|
783
|
-
const Le =
|
|
785
|
+
we.displayName = "DefaultOptionRenderer";
|
|
786
|
+
const Le = W(({ selectedOptions: r, placeholder: e, onRemoveOption: d, displayMode: c, multiple: o, className: l, disabled: y }) => r?.length === 0 ? e ? /* @__PURE__ */ s.jsx("span", { className: "text-neutral-medium-default opacity-50", children: e }) : null : c === "chips" && o ? /* @__PURE__ */ s.jsx("div", { className: i("flex items-center gap-1 ", l), children: r.map((p) => /* @__PURE__ */ s.jsx(
|
|
784
787
|
Xe,
|
|
785
788
|
{
|
|
786
789
|
tabIndex: -1,
|
|
787
790
|
id: p.id,
|
|
788
791
|
label: p.label,
|
|
789
|
-
onRemove:
|
|
792
|
+
onRemove: d,
|
|
790
793
|
disabled: y
|
|
791
794
|
},
|
|
792
795
|
p.id
|
|
@@ -797,5 +800,5 @@ const Le = R(({ selectedOptions: r, placeholder: e, onRemoveOption: f, displayMo
|
|
|
797
800
|
Le.displayName = "DefaultSelectionDisplay";
|
|
798
801
|
export {
|
|
799
802
|
ut as S,
|
|
800
|
-
|
|
803
|
+
P as g
|
|
801
804
|
};
|