prometeo-design-system 4.3.6 → 4.4.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.
- package/dist/Chip.d.ts +6 -0
- package/dist/Chip.es.js +55 -0
- package/dist/Input.es.js +108 -95
- package/dist/PyrionLayout.es.js +6 -5
- package/dist/Select.es.js +382 -429
- package/dist/SelectSearch.es.js +38 -38
- package/dist/{TabLinks-DxqprStp.js → TabLinks-BjGwvqR9.js} +59 -52
- package/dist/TabLinks.es.js +1 -1
- package/dist/Toast.es.js +175 -134
- package/dist/components/Input/Input.d.ts +3 -3
- package/dist/components/Shared/Chip.d.ts +2 -2
- package/dist/components/TabLinks/TabLinks.d.ts +2 -1
- package/dist/components/Toaster/Toaster.d.ts +6 -4
- package/dist/exports/Chip.d.ts +2 -0
- package/dist/prometeo-design-system.es.js +1 -1
- package/package.json +8 -1
package/dist/Select.es.js
CHANGED
|
@@ -1,74 +1,27 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as s } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
2
|
import { c as d } from "./cn-B6yFEsav.js";
|
|
3
|
-
import Se, { memo as
|
|
4
|
-
import
|
|
5
|
-
import { createPortal as
|
|
6
|
-
import { u as
|
|
7
|
-
import { u as
|
|
8
|
-
import { H as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { g as
|
|
12
|
-
import
|
|
3
|
+
import Se, { memo as te, useState as Ne, useRef as ae, useMemo as ee, useCallback as _, useEffect as pe, useImperativeHandle as Je } from "react";
|
|
4
|
+
import Qe from "./Spinner.es.js";
|
|
5
|
+
import { createPortal as Xe } from "react-dom";
|
|
6
|
+
import { u as Ye } from "./useDragScroll-CHN9OMwn.js";
|
|
7
|
+
import { u as Ze } from "./useLabelBackground-D5SzHhl_.js";
|
|
8
|
+
import { H as et } from "./HelperComponent-ljsn0xD6.js";
|
|
9
|
+
import tt from "./Chip.es.js";
|
|
10
|
+
import nt from "./CheckBox.es.js";
|
|
11
|
+
import { g as E, h as Ue } from "./utils-X4-h3cum.js";
|
|
12
|
+
import rt from "./Input.es.js";
|
|
13
13
|
import qe from "./Skeleton.es.js";
|
|
14
|
-
import { Cancel as
|
|
14
|
+
import { Cancel as lt } from "./Icons/Cancel.es.js";
|
|
15
15
|
import { ChevronDown as Re } from "./Icons/ChevronDown.es.js";
|
|
16
|
-
import { Search as
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
error: {
|
|
23
|
-
container: "",
|
|
24
|
-
icon: ""
|
|
25
|
-
},
|
|
26
|
-
success: {
|
|
27
|
-
container: "",
|
|
28
|
-
icon: ""
|
|
29
|
-
}
|
|
30
|
-
}, Ve = {
|
|
31
|
-
icon: " text-neutral-default-disabled",
|
|
32
|
-
container: " border-neutral-strong-default text-neutral-default-disabled"
|
|
33
|
-
}, Je = ({ id: e, label: n, onRemove: f, className: x, disabled: h, variant: w = "default", tabIndex: p }) => /* @__PURE__ */ a.jsxs(
|
|
34
|
-
"div",
|
|
35
|
-
{
|
|
36
|
-
tabIndex: p,
|
|
37
|
-
className: d(
|
|
38
|
-
"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]",
|
|
39
|
-
it[w].container,
|
|
40
|
-
h && Ve.container
|
|
41
|
-
),
|
|
42
|
-
children: [
|
|
43
|
-
/* @__PURE__ */ a.jsx("span", { className: "truncate w-max ", children: n }),
|
|
44
|
-
f && /* @__PURE__ */ a.jsx(
|
|
45
|
-
"button",
|
|
46
|
-
{
|
|
47
|
-
onMouseDown: (O) => {
|
|
48
|
-
h || (O.stopPropagation(), O.preventDefault(), f?.(e));
|
|
49
|
-
},
|
|
50
|
-
className: d(
|
|
51
|
-
"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",
|
|
52
|
-
h && "cursor-default hover:scale-100",
|
|
53
|
-
x
|
|
54
|
-
),
|
|
55
|
-
type: "button",
|
|
56
|
-
tabIndex: p,
|
|
57
|
-
children: /* @__PURE__ */ a.jsx(rt, { size: 18, className: d(h && Ve.icon) })
|
|
58
|
-
}
|
|
59
|
-
)
|
|
60
|
-
]
|
|
61
|
-
}
|
|
62
|
-
);
|
|
63
|
-
Je.displayName = "Chip";
|
|
64
|
-
const ut = J(Je), ct = (e) => {
|
|
65
|
-
const n = [], f = (x) => {
|
|
66
|
-
x.forEach((h) => {
|
|
67
|
-
const w = h, p = typeof w == "object" ? w?.options : [];
|
|
68
|
-
Array.isArray(p) && p.length > 0 ? f(p) : n.push(h);
|
|
16
|
+
import { Search as ot } from "./Icons/Search.es.js";
|
|
17
|
+
const at = (e) => {
|
|
18
|
+
const n = [], h = (v) => {
|
|
19
|
+
v.forEach((C) => {
|
|
20
|
+
const N = C, g = typeof N == "object" ? N?.options : [];
|
|
21
|
+
Array.isArray(g) && g.length > 0 ? h(g) : n.push(C);
|
|
69
22
|
});
|
|
70
23
|
};
|
|
71
|
-
return
|
|
24
|
+
return h(e), n;
|
|
72
25
|
}, Ke = {
|
|
73
26
|
default: {
|
|
74
27
|
container: "",
|
|
@@ -121,19 +74,19 @@ const ut = J(Je), ct = (e) => {
|
|
|
121
74
|
"peer-focus:text-primary-default-default"
|
|
122
75
|
)
|
|
123
76
|
};
|
|
124
|
-
function
|
|
125
|
-
const [n,
|
|
77
|
+
function st(e) {
|
|
78
|
+
const [n, h] = Ne(!1), [v, C] = Ne([]), [N, g] = Ne(""), M = ae(null), f = ae(null), T = ae(null), $ = ae(null), F = ae(
|
|
126
79
|
() => {
|
|
127
80
|
}
|
|
128
81
|
), De = ae(null), ge = ae(/* @__PURE__ */ new Set()), {
|
|
129
|
-
id:
|
|
82
|
+
id: z,
|
|
130
83
|
name: j,
|
|
131
84
|
label: be,
|
|
132
85
|
height: xe,
|
|
133
|
-
options:
|
|
86
|
+
options: J,
|
|
134
87
|
controls: ne,
|
|
135
88
|
className: K,
|
|
136
|
-
placeholder:
|
|
89
|
+
placeholder: L,
|
|
137
90
|
optionValue: H,
|
|
138
91
|
optionLabel: se,
|
|
139
92
|
renderOption: W,
|
|
@@ -144,7 +97,7 @@ function dt(e) {
|
|
|
144
97
|
dropdownClassName: re,
|
|
145
98
|
containerClassName: B,
|
|
146
99
|
dropdownOptions: k,
|
|
147
|
-
helperComponent:
|
|
100
|
+
helperComponent: Q,
|
|
148
101
|
errorComponent: ye,
|
|
149
102
|
onRemoveOption: ke,
|
|
150
103
|
onOptionClick: U,
|
|
@@ -156,16 +109,16 @@ function dt(e) {
|
|
|
156
109
|
isLoading: le = !1,
|
|
157
110
|
attachToParent: ue = !1,
|
|
158
111
|
displayMode: Ee = "compact",
|
|
159
|
-
labelVariant:
|
|
112
|
+
labelVariant: X = "default",
|
|
160
113
|
disableOpenOnFocus: Me = !1,
|
|
161
114
|
emptyMessage: Te = "No hay opciones disponibles"
|
|
162
|
-
} = e, { ref: Le } =
|
|
115
|
+
} = e, { ref: Le } = Ze(), { bind: q, ref: Pe } = Ye({
|
|
163
116
|
axis: "x",
|
|
164
117
|
cursor: { idle: "default", dragging: "grabbing" }
|
|
165
|
-
}), ce = e.multiple ? Array.isArray(e.value) && e.value.length > 0 && e.value.every((t) => t != null && t !== "") : e.value !== void 0 && e.value !== null && e.value !== "",
|
|
166
|
-
() => k?.controledSearchValue ||
|
|
167
|
-
[k?.controledSearchValue,
|
|
168
|
-
),
|
|
118
|
+
}), ce = e.multiple ? Array.isArray(e.value) && e.value.length > 0 && e.value.every((t) => t != null && t !== "") : e.value !== void 0 && e.value !== null && e.value !== "", _e = {}, Ie = ee(() => X === "static" && L ? L : "", [X, L]), $e = ee(
|
|
119
|
+
() => k?.controledSearchValue || N,
|
|
120
|
+
[k?.controledSearchValue, N]
|
|
121
|
+
), Ge = () => {
|
|
169
122
|
const t = {
|
|
170
123
|
static: {
|
|
171
124
|
active: "relative prometeo-fonts-label-large",
|
|
@@ -175,96 +128,96 @@ function dt(e) {
|
|
|
175
128
|
active: "absolute top-0 -translate-y-1/2 left-3 px-1 prometeo-fonts-body-small",
|
|
176
129
|
default: "absolute top-1/2 -translate-y-1/2 "
|
|
177
130
|
}
|
|
178
|
-
},
|
|
179
|
-
return t[
|
|
180
|
-
}, I =
|
|
131
|
+
}, a = n || ce ? "active" : "default";
|
|
132
|
+
return t[X][a];
|
|
133
|
+
}, I = _(
|
|
181
134
|
(t) => ({
|
|
182
|
-
id:
|
|
183
|
-
value:
|
|
184
|
-
label:
|
|
135
|
+
id: E(t, H),
|
|
136
|
+
value: E(t, H),
|
|
137
|
+
label: E(t, se)
|
|
185
138
|
}),
|
|
186
139
|
[H, se]
|
|
187
|
-
),
|
|
188
|
-
() =>
|
|
189
|
-
[
|
|
190
|
-
), de =
|
|
140
|
+
), R = ee(() => at(J), [J]), we = ee(
|
|
141
|
+
() => R.map(I),
|
|
142
|
+
[R, I]
|
|
143
|
+
), de = ee(() => {
|
|
191
144
|
const t = [];
|
|
192
145
|
if (e.multiple)
|
|
193
|
-
e.value?.forEach((
|
|
194
|
-
const l =
|
|
195
|
-
(c) =>
|
|
146
|
+
e.value?.forEach((a) => {
|
|
147
|
+
const l = R?.find(
|
|
148
|
+
(c) => E(c, H) === a
|
|
196
149
|
);
|
|
197
150
|
l && t.push(l);
|
|
198
151
|
});
|
|
199
152
|
else {
|
|
200
|
-
const
|
|
201
|
-
(l) =>
|
|
153
|
+
const a = R?.find(
|
|
154
|
+
(l) => E(l, H) === e.value
|
|
202
155
|
);
|
|
203
|
-
|
|
156
|
+
a && t.push(a);
|
|
204
157
|
}
|
|
205
158
|
return t;
|
|
206
|
-
}, [e.value, H,
|
|
159
|
+
}, [e.value, H, R, e.multiple]), r = ee(
|
|
207
160
|
() => de.map(I),
|
|
208
161
|
[de, I]
|
|
209
|
-
), o =
|
|
162
|
+
), o = ee(
|
|
210
163
|
() => new Set(r.map((t) => t.id)),
|
|
211
164
|
[r]
|
|
212
|
-
), i =
|
|
165
|
+
), i = ee(() => {
|
|
213
166
|
const t = [];
|
|
214
|
-
return
|
|
215
|
-
const c =
|
|
216
|
-
if (Array.isArray(
|
|
217
|
-
const
|
|
218
|
-
id:
|
|
219
|
-
value:
|
|
220
|
-
label: typeof
|
|
167
|
+
return J.forEach((a, l) => {
|
|
168
|
+
const c = a, x = typeof c == "object" ? c?.options : [];
|
|
169
|
+
if (Array.isArray(x) && x.length > 0) {
|
|
170
|
+
const m = c.label, b = E(a, H), Z = `__group-${String(b ?? l)}`, me = {
|
|
171
|
+
id: Z,
|
|
172
|
+
value: Z,
|
|
173
|
+
label: typeof m == "string" ? m : String(b ?? `Grupo ${l + 1}`),
|
|
221
174
|
isGroupHeader: !0,
|
|
222
|
-
groupLabelNode:
|
|
223
|
-
originalOption:
|
|
175
|
+
groupLabelNode: m,
|
|
176
|
+
originalOption: a,
|
|
224
177
|
groupData: {
|
|
225
|
-
groupOptions:
|
|
178
|
+
groupOptions: x
|
|
226
179
|
}
|
|
227
180
|
};
|
|
228
|
-
t.push(me),
|
|
181
|
+
t.push(me), x.forEach((he) => {
|
|
229
182
|
W ? t.push(he) : t.push(I(he));
|
|
230
183
|
});
|
|
231
184
|
} else
|
|
232
|
-
W ? t.push(
|
|
185
|
+
W ? t.push(a) : t.push(I(a));
|
|
233
186
|
}), t;
|
|
234
|
-
}, [
|
|
235
|
-
(t,
|
|
187
|
+
}, [J, H, W, I]), u = _(
|
|
188
|
+
(t, a) => {
|
|
236
189
|
if (!t || t.length === 0) return;
|
|
237
190
|
const l = t.map(
|
|
238
|
-
(
|
|
191
|
+
(y) => I(y)
|
|
239
192
|
);
|
|
240
193
|
if (!e.multiple) {
|
|
241
|
-
const
|
|
242
|
-
if (!
|
|
243
|
-
const
|
|
194
|
+
const y = l[0];
|
|
195
|
+
if (!y) return;
|
|
196
|
+
const S = o.has(y.id), A = a ?? "toggle";
|
|
244
197
|
let Fe;
|
|
245
|
-
|
|
198
|
+
A === "select" || A === "toggle" && !S ? Fe = y : Fe = void 0, e.onChange?.(Fe, j);
|
|
246
199
|
return;
|
|
247
200
|
}
|
|
248
|
-
const c = e.value || [],
|
|
249
|
-
c.forEach((
|
|
250
|
-
const
|
|
251
|
-
|
|
201
|
+
const c = e.value || [], x = [];
|
|
202
|
+
c.forEach((y) => {
|
|
203
|
+
const S = we.find((A) => A.value === y);
|
|
204
|
+
S && x.push(S);
|
|
252
205
|
});
|
|
253
|
-
const
|
|
254
|
-
(
|
|
255
|
-
), me =
|
|
256
|
-
let
|
|
206
|
+
const m = new Set(x.map((y) => y.id)), b = new Set(l.map((y) => y.id)), Z = l.every(
|
|
207
|
+
(y) => m.has(y.id)
|
|
208
|
+
), me = a ?? "toggle", he = me === "select" || me === "toggle" && !Z;
|
|
209
|
+
let G;
|
|
257
210
|
if (!he)
|
|
258
|
-
|
|
211
|
+
G = x.filter((y) => !b.has(y.id));
|
|
259
212
|
else {
|
|
260
|
-
const
|
|
261
|
-
|
|
213
|
+
const y = new Map(
|
|
214
|
+
x.map((S) => [S.id, S])
|
|
262
215
|
);
|
|
263
|
-
l.forEach((
|
|
264
|
-
|
|
265
|
-
}),
|
|
216
|
+
l.forEach((S) => {
|
|
217
|
+
y.set(S.id, S);
|
|
218
|
+
}), G = Array.from(y.values());
|
|
266
219
|
}
|
|
267
|
-
e.onChange?.(
|
|
220
|
+
e.onChange?.(G, j);
|
|
268
221
|
},
|
|
269
222
|
[
|
|
270
223
|
e.multiple,
|
|
@@ -275,90 +228,90 @@ function dt(e) {
|
|
|
275
228
|
I,
|
|
276
229
|
j
|
|
277
230
|
]
|
|
278
|
-
),
|
|
279
|
-
|
|
231
|
+
), w = _(() => {
|
|
232
|
+
h((t) => !t);
|
|
280
233
|
}, []);
|
|
281
234
|
F.current = (t) => {
|
|
282
235
|
if (!e.multiple)
|
|
283
236
|
e.onChange?.(t, j);
|
|
284
237
|
else {
|
|
285
|
-
const
|
|
286
|
-
|
|
287
|
-
const
|
|
288
|
-
(
|
|
238
|
+
const a = e.value || [], l = [], c = a.includes(t.value);
|
|
239
|
+
a.forEach((m) => {
|
|
240
|
+
const b = we.find(
|
|
241
|
+
(Z) => Z.value === m
|
|
289
242
|
);
|
|
290
|
-
|
|
243
|
+
b && l.push(b);
|
|
291
244
|
});
|
|
292
|
-
const
|
|
293
|
-
e.onChange?.(
|
|
245
|
+
const x = c ? l.filter((m) => m.value !== t.value) : [...l, t];
|
|
246
|
+
e.onChange?.(x, j);
|
|
294
247
|
}
|
|
295
248
|
};
|
|
296
|
-
const D =
|
|
297
|
-
(t,
|
|
298
|
-
U?.(t, j), F.current?.(t),
|
|
249
|
+
const D = _(
|
|
250
|
+
(t, a = !1) => {
|
|
251
|
+
U?.(t, j), F.current?.(t), a && (h(!1), Oe?.());
|
|
299
252
|
},
|
|
300
253
|
[U, Oe, j]
|
|
301
|
-
),
|
|
254
|
+
), p = (t) => {
|
|
302
255
|
if (t.preventDefault(), t.stopPropagation(), t.target.blur(), ve?.(), e.multiple) {
|
|
303
|
-
const
|
|
304
|
-
|
|
256
|
+
const a = e.onChange;
|
|
257
|
+
a?.([], j);
|
|
305
258
|
} else {
|
|
306
|
-
const
|
|
307
|
-
|
|
259
|
+
const a = e.onChange;
|
|
260
|
+
a?.(void 0, j);
|
|
308
261
|
}
|
|
309
|
-
},
|
|
262
|
+
}, O = _(
|
|
310
263
|
(t) => {
|
|
311
264
|
e.multiple || e.onChange?.(void 0, j);
|
|
312
|
-
const
|
|
313
|
-
(c) =>
|
|
265
|
+
const a = R.find(
|
|
266
|
+
(c) => E(c, H) === t
|
|
314
267
|
);
|
|
315
|
-
if (!
|
|
316
|
-
const l = I(
|
|
317
|
-
U?.(l, j), F.current?.(l), ke?.(
|
|
268
|
+
if (!a) return;
|
|
269
|
+
const l = I(a);
|
|
270
|
+
U?.(l, j), F.current?.(l), ke?.(a);
|
|
318
271
|
},
|
|
319
272
|
[
|
|
320
273
|
U,
|
|
321
274
|
ke,
|
|
322
|
-
|
|
275
|
+
R,
|
|
323
276
|
j,
|
|
324
277
|
e.multiple,
|
|
325
278
|
e.onChange,
|
|
326
279
|
I,
|
|
327
280
|
H
|
|
328
281
|
]
|
|
329
|
-
),
|
|
282
|
+
), Y = _(
|
|
330
283
|
(t) => {
|
|
331
|
-
|
|
284
|
+
O(t);
|
|
332
285
|
},
|
|
333
|
-
[
|
|
334
|
-
),
|
|
286
|
+
[O]
|
|
287
|
+
), V = (t) => t.tagName === "INPUT" && !["button", "submit", "checkbox", "file", "image"].includes(t.type) || t.hasAttribute("contenteditable");
|
|
335
288
|
pe(() => {
|
|
336
289
|
if (!n) return;
|
|
337
|
-
let t = !1,
|
|
338
|
-
const l = (
|
|
339
|
-
const
|
|
340
|
-
if (console.log("close dropdown target"),
|
|
341
|
-
if (
|
|
342
|
-
|
|
290
|
+
let t = !1, a = 0;
|
|
291
|
+
const l = (m) => {
|
|
292
|
+
const b = m.target;
|
|
293
|
+
if (console.log("close dropdown target"), m.type === "mousedown") {
|
|
294
|
+
if (M.current?.contains(b) || f.current?.contains(b)) return;
|
|
295
|
+
h(!1);
|
|
343
296
|
}
|
|
344
|
-
if (
|
|
345
|
-
if (console.log("close because scroll"), console.log(
|
|
297
|
+
if (m.type === "scroll") {
|
|
298
|
+
if (console.log("close because scroll"), console.log(m, "event"), t || Date.now() - a < 500) {
|
|
346
299
|
console.log("ignoring scroll - keyboard related");
|
|
347
300
|
return;
|
|
348
301
|
}
|
|
349
|
-
if (
|
|
350
|
-
|
|
302
|
+
if (f.current?.contains(b)) return;
|
|
303
|
+
h(!1);
|
|
351
304
|
}
|
|
352
|
-
|
|
353
|
-
}, c = (
|
|
354
|
-
const
|
|
355
|
-
|
|
356
|
-
},
|
|
357
|
-
const
|
|
358
|
-
|
|
305
|
+
m.type === "resize" && (console.log("close dropdown because resize"), console.log(m, "event"), h(!1));
|
|
306
|
+
}, c = (m) => {
|
|
307
|
+
const b = m.target;
|
|
308
|
+
V(b) && (console.log("focus in keyboard"), t = !0, a = Date.now());
|
|
309
|
+
}, x = (m) => {
|
|
310
|
+
const b = m.target;
|
|
311
|
+
V(b) && (console.log("focus out keyboard"), t = !1);
|
|
359
312
|
};
|
|
360
|
-
return document.addEventListener("focusin", c), document.addEventListener("focusout",
|
|
361
|
-
document.removeEventListener("focusin", c), document.removeEventListener("focusout",
|
|
313
|
+
return document.addEventListener("focusin", c), document.addEventListener("focusout", x), document.addEventListener("mousedown", l), window.addEventListener("scroll", l, !0), window.addEventListener("resize", l, !0), () => {
|
|
314
|
+
document.removeEventListener("focusin", c), document.removeEventListener("focusout", x), document.removeEventListener("mousedown", l), window.removeEventListener("scroll", l, !0), window.removeEventListener("resize", l, !0);
|
|
362
315
|
};
|
|
363
316
|
}, [n]), pe(() => {
|
|
364
317
|
ge.current.forEach((t) => {
|
|
@@ -367,16 +320,16 @@ function dt(e) {
|
|
|
367
320
|
} catch {
|
|
368
321
|
}
|
|
369
322
|
});
|
|
370
|
-
}, [n]),
|
|
323
|
+
}, [n]), Je(
|
|
371
324
|
ne,
|
|
372
325
|
() => ({
|
|
373
326
|
open: () => {
|
|
374
|
-
|
|
327
|
+
h(!0);
|
|
375
328
|
},
|
|
376
329
|
close: () => {
|
|
377
|
-
|
|
330
|
+
h(!1);
|
|
378
331
|
},
|
|
379
|
-
toggle: () =>
|
|
332
|
+
toggle: () => h((t) => !t),
|
|
380
333
|
handleOptionSelect: D,
|
|
381
334
|
subscribeOpenChange: (t) => (ge.current.add(t), () => {
|
|
382
335
|
ge.current.delete(t);
|
|
@@ -386,32 +339,32 @@ function dt(e) {
|
|
|
386
339
|
[n, D]
|
|
387
340
|
);
|
|
388
341
|
const fe = (t) => {
|
|
389
|
-
t.preventDefault(), t.stopPropagation(), t.target.matches(":focus-visible") && !Me && !n && (
|
|
342
|
+
t.preventDefault(), t.stopPropagation(), t.target.matches(":focus-visible") && !Me && !n && (h(!0), setTimeout(() => {
|
|
390
343
|
T.current?.focus();
|
|
391
344
|
}, 10));
|
|
392
345
|
}, oe = (t) => {
|
|
393
|
-
t.key === "Tab" && n &&
|
|
346
|
+
t.key === "Tab" && n && h(!1), (t.keyCode === 32 || t.key === "ArrowDown") && (h(!0), setTimeout(() => {
|
|
394
347
|
T.current?.focus();
|
|
395
348
|
}, 10));
|
|
396
349
|
};
|
|
397
|
-
return /* @__PURE__ */
|
|
350
|
+
return /* @__PURE__ */ s.jsxs(
|
|
398
351
|
"div",
|
|
399
352
|
{
|
|
400
353
|
className: d("relative bg-inherit select-none w-full", K),
|
|
401
|
-
ref:
|
|
354
|
+
ref: M,
|
|
402
355
|
draggable: !1,
|
|
403
|
-
style:
|
|
356
|
+
style: _e,
|
|
404
357
|
children: [
|
|
405
|
-
/* @__PURE__ */
|
|
406
|
-
/* @__PURE__ */
|
|
358
|
+
/* @__PURE__ */ s.jsxs("div", { className: d("relative bg-inherit ", B), children: [
|
|
359
|
+
/* @__PURE__ */ s.jsx(
|
|
407
360
|
"label",
|
|
408
361
|
{
|
|
409
|
-
htmlFor: `select-${
|
|
362
|
+
htmlFor: `select-${z}`,
|
|
410
363
|
ref: Le,
|
|
411
364
|
className: d(
|
|
412
365
|
"left-3 pointer-events-none bg-inherit z-10 line-clamp-1 max-w-[calc(100%-2.5rem)] ",
|
|
413
|
-
|
|
414
|
-
|
|
366
|
+
X === "default" && "transition-all duration-200 ease-in-out",
|
|
367
|
+
Ge(),
|
|
415
368
|
ce || n ? Ke[Ce].label : "text-neutral-medium-default",
|
|
416
369
|
P && We.label,
|
|
417
370
|
"mb-0.5"
|
|
@@ -419,17 +372,17 @@ function dt(e) {
|
|
|
419
372
|
children: be
|
|
420
373
|
}
|
|
421
374
|
),
|
|
422
|
-
/* @__PURE__ */
|
|
375
|
+
/* @__PURE__ */ s.jsxs(
|
|
423
376
|
"div",
|
|
424
377
|
{
|
|
425
|
-
id:
|
|
378
|
+
id: z,
|
|
426
379
|
tabIndex: 0,
|
|
427
380
|
role: "button",
|
|
428
|
-
ref:
|
|
381
|
+
ref: $,
|
|
429
382
|
onFocus: fe,
|
|
430
383
|
onKeyDown: oe,
|
|
431
384
|
onClick: (t) => {
|
|
432
|
-
t.preventDefault(), t.stopPropagation(),
|
|
385
|
+
t.preventDefault(), t.stopPropagation(), w();
|
|
433
386
|
},
|
|
434
387
|
className: d(
|
|
435
388
|
"w-full px-2 text-left border rounded-lg transition-all duration-200 ease-in-out",
|
|
@@ -441,7 +394,7 @@ function dt(e) {
|
|
|
441
394
|
He
|
|
442
395
|
),
|
|
443
396
|
children: [
|
|
444
|
-
/* @__PURE__ */
|
|
397
|
+
/* @__PURE__ */ s.jsx(
|
|
445
398
|
"div",
|
|
446
399
|
{
|
|
447
400
|
className: d(
|
|
@@ -455,24 +408,24 @@ function dt(e) {
|
|
|
455
408
|
onPointerCancel: q.onPointerCancel,
|
|
456
409
|
onClickCapture: q.onClickCapture,
|
|
457
410
|
children: je ? Se.createElement(
|
|
458
|
-
|
|
411
|
+
te(
|
|
459
412
|
je,
|
|
460
|
-
(t,
|
|
413
|
+
(t, a) => t.disabled === a.disabled && t.multiple === a.multiple
|
|
461
414
|
),
|
|
462
415
|
{
|
|
463
416
|
disabled: P,
|
|
464
417
|
multiple: e.multiple || !1,
|
|
465
|
-
placeholder:
|
|
418
|
+
placeholder: L,
|
|
466
419
|
selectedOptions: de,
|
|
467
|
-
onRemoveOption:
|
|
420
|
+
onRemoveOption: Y
|
|
468
421
|
}
|
|
469
|
-
) : /* @__PURE__ */
|
|
470
|
-
|
|
422
|
+
) : /* @__PURE__ */ s.jsx(
|
|
423
|
+
Ve,
|
|
471
424
|
{
|
|
472
425
|
displayMode: Ee,
|
|
473
426
|
selectedOptions: r,
|
|
474
|
-
placeholder:
|
|
475
|
-
onRemoveOption:
|
|
427
|
+
placeholder: Ie,
|
|
428
|
+
onRemoveOption: O,
|
|
476
429
|
multiple: e.multiple || !1,
|
|
477
430
|
className: d(
|
|
478
431
|
Ae === "scroll" ? "flex-nowrap" : "flex-wrap"
|
|
@@ -482,26 +435,26 @@ function dt(e) {
|
|
|
482
435
|
)
|
|
483
436
|
}
|
|
484
437
|
),
|
|
485
|
-
/* @__PURE__ */
|
|
486
|
-
le && /* @__PURE__ */
|
|
487
|
-
|
|
438
|
+
/* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
439
|
+
le && /* @__PURE__ */ s.jsx(
|
|
440
|
+
Qe,
|
|
488
441
|
{
|
|
489
442
|
size: "small",
|
|
490
443
|
variant: "sync",
|
|
491
444
|
className: " opacity-90"
|
|
492
445
|
}
|
|
493
446
|
),
|
|
494
|
-
ce && ve && /* @__PURE__ */
|
|
447
|
+
ce && ve && /* @__PURE__ */ s.jsx(
|
|
495
448
|
"button",
|
|
496
449
|
{
|
|
497
450
|
className: "z-100",
|
|
498
451
|
onClick: (t) => {
|
|
499
|
-
t.preventDefault(), t.stopPropagation(),
|
|
452
|
+
t.preventDefault(), t.stopPropagation(), p(t);
|
|
500
453
|
},
|
|
501
454
|
type: "button",
|
|
502
455
|
tabIndex: -1,
|
|
503
|
-
children: /* @__PURE__ */
|
|
504
|
-
|
|
456
|
+
children: /* @__PURE__ */ s.jsx(
|
|
457
|
+
lt,
|
|
505
458
|
{
|
|
506
459
|
size: 20,
|
|
507
460
|
className: d(
|
|
@@ -512,7 +465,7 @@ function dt(e) {
|
|
|
512
465
|
)
|
|
513
466
|
}
|
|
514
467
|
),
|
|
515
|
-
/* @__PURE__ */
|
|
468
|
+
/* @__PURE__ */ s.jsx(
|
|
516
469
|
Re,
|
|
517
470
|
{
|
|
518
471
|
size: 20,
|
|
@@ -528,8 +481,8 @@ function dt(e) {
|
|
|
528
481
|
}
|
|
529
482
|
)
|
|
530
483
|
] }),
|
|
531
|
-
n && /* @__PURE__ */
|
|
532
|
-
|
|
484
|
+
n && /* @__PURE__ */ s.jsx(
|
|
485
|
+
ct,
|
|
533
486
|
{
|
|
534
487
|
label: be,
|
|
535
488
|
isOpen: n,
|
|
@@ -537,25 +490,25 @@ function dt(e) {
|
|
|
537
490
|
optionValue: H,
|
|
538
491
|
optionLabel: se,
|
|
539
492
|
emptyMessage: Te,
|
|
540
|
-
labelVariant:
|
|
493
|
+
labelVariant: X,
|
|
541
494
|
renderOption: W,
|
|
542
495
|
renderOptionGroupHeader: ie,
|
|
543
496
|
attachToParent: ue,
|
|
544
|
-
filteredOptions:
|
|
497
|
+
filteredOptions: v,
|
|
545
498
|
multiple: e.multiple || !1,
|
|
546
499
|
dropdownClassName: re,
|
|
547
500
|
selectedOptionsIds: o,
|
|
548
|
-
setFilteredOptions:
|
|
501
|
+
setFilteredOptions: C,
|
|
549
502
|
renderOptionContext: ze,
|
|
550
503
|
options: i,
|
|
551
|
-
selectRef:
|
|
552
|
-
dropdownRef:
|
|
553
|
-
selectButtonRef:
|
|
504
|
+
selectRef: M,
|
|
505
|
+
dropdownRef: f,
|
|
506
|
+
selectButtonRef: $,
|
|
554
507
|
helperComponentRef: De,
|
|
555
508
|
onOptionClick: D,
|
|
556
|
-
onCloseDropdown: () =>
|
|
557
|
-
searchValue:
|
|
558
|
-
setSearchValue:
|
|
509
|
+
onCloseDropdown: () => h(!1),
|
|
510
|
+
searchValue: $e,
|
|
511
|
+
setSearchValue: g,
|
|
559
512
|
searchInputRef: T,
|
|
560
513
|
isLoading: k?.isLoading,
|
|
561
514
|
onSearchClear: k?.onSearchClear,
|
|
@@ -571,43 +524,43 @@ function dt(e) {
|
|
|
571
524
|
onGroupSelectChange: u
|
|
572
525
|
}
|
|
573
526
|
),
|
|
574
|
-
(ye ||
|
|
575
|
-
|
|
527
|
+
(ye || Q) && /* @__PURE__ */ s.jsx("div", { className: "min-h-6", children: /* @__PURE__ */ s.jsx(
|
|
528
|
+
et,
|
|
576
529
|
{
|
|
577
530
|
ref: De,
|
|
578
531
|
variant: Ce,
|
|
579
532
|
className: "absolute bottom-0 h-5 overflow-visible line-clamp-1!",
|
|
580
|
-
children: ye ||
|
|
533
|
+
children: ye || Q
|
|
581
534
|
}
|
|
582
535
|
) })
|
|
583
536
|
]
|
|
584
537
|
}
|
|
585
538
|
);
|
|
586
539
|
}
|
|
587
|
-
const
|
|
588
|
-
function
|
|
540
|
+
const it = te(st, (e, n) => e.value === n.value && e.options === n.options && e.isLoading === n.isLoading && e.disabled === n.disabled && e.errorComponent === n.errorComponent && e.helperComponent === n.helperComponent && e.variant === n.variant && e.label === n.label && e.id === n.id && e.name === n.name && e.placeholder === n.placeholder && e.renderOptionContext === n.renderOptionContext && e.dropdownOptions?.controledSearchValue === n.dropdownOptions?.controledSearchValue && e.dropdownOptions?.isLoading === n.dropdownOptions?.isLoading), Ht = it;
|
|
541
|
+
function ut({
|
|
589
542
|
footer: e,
|
|
590
543
|
isOpen: n,
|
|
591
|
-
label:
|
|
592
|
-
options:
|
|
593
|
-
multiple:
|
|
594
|
-
disabled:
|
|
595
|
-
selectRef:
|
|
596
|
-
inputProps:
|
|
597
|
-
dropdownRef:
|
|
544
|
+
label: h,
|
|
545
|
+
options: v,
|
|
546
|
+
multiple: C,
|
|
547
|
+
disabled: N,
|
|
548
|
+
selectRef: g,
|
|
549
|
+
inputProps: M,
|
|
550
|
+
dropdownRef: f,
|
|
598
551
|
optionLabel: T,
|
|
599
|
-
optionValue:
|
|
552
|
+
optionValue: $,
|
|
600
553
|
searchValue: F,
|
|
601
554
|
labelVariant: De,
|
|
602
555
|
emptyMessage: ge,
|
|
603
|
-
renderOption:
|
|
556
|
+
renderOption: z,
|
|
604
557
|
renderOptionContext: j,
|
|
605
558
|
renderOptionGroupHeader: be,
|
|
606
559
|
onOptionClick: xe,
|
|
607
|
-
onSearchClear:
|
|
560
|
+
onSearchClear: J,
|
|
608
561
|
searchInputRef: ne,
|
|
609
562
|
setSearchValue: K,
|
|
610
|
-
dropdownHeight:
|
|
563
|
+
dropdownHeight: L,
|
|
611
564
|
attachToParent: H,
|
|
612
565
|
filteredOptions: se,
|
|
613
566
|
selectButtonRef: W,
|
|
@@ -618,161 +571,161 @@ function mt({
|
|
|
618
571
|
selectedOptionsIds: re,
|
|
619
572
|
setFilteredOptions: B,
|
|
620
573
|
onSearchValueChange: k,
|
|
621
|
-
isLoading:
|
|
574
|
+
isLoading: Q = !1,
|
|
622
575
|
hideSearchBar: ye = !1,
|
|
623
576
|
inputSearchPlaceholder: ke = "Buscar opciones",
|
|
624
577
|
enableGroupToggle: U = !0,
|
|
625
578
|
focusSearchInputOnOpen: Oe = !1,
|
|
626
579
|
onGroupSelectChange: ve
|
|
627
580
|
}) {
|
|
628
|
-
const P = e ? 380 : 320, Ae = De === "static" ?
|
|
581
|
+
const P = e ? 380 : 320, Ae = De === "static" ? h !== "" ? -20 : 4 : 7, le = _(() => L ? L.endsWith("px") ? Number(L.replace("px", "")) : L.endsWith("vh") ? window.innerHeight * Number(L.replace("vh", "")) / 100 : L.endsWith("%") ? window.innerHeight * Number(L.replace("%", "")) / 100 : P : P, [L, P])(), [ue, Ee] = Ne({
|
|
629
582
|
direction: "down",
|
|
630
583
|
height: le
|
|
631
|
-
}), [
|
|
584
|
+
}), [X, Me] = Ne(
|
|
632
585
|
() => /* @__PURE__ */ new Set()
|
|
633
|
-
), Te =
|
|
634
|
-
(r) => !
|
|
635
|
-
[
|
|
636
|
-
), Le =
|
|
586
|
+
), Te = _(
|
|
587
|
+
(r) => !X.has(r),
|
|
588
|
+
[X]
|
|
589
|
+
), Le = _(
|
|
637
590
|
(r, o) => {
|
|
638
591
|
Me((i) => {
|
|
639
|
-
const u = new Set(i),
|
|
640
|
-
return (o === void 0 ? !
|
|
592
|
+
const u = new Set(i), w = u.has(r);
|
|
593
|
+
return (o === void 0 ? !w : !o) ? u.add(r) : u.delete(r), u;
|
|
641
594
|
});
|
|
642
595
|
},
|
|
643
596
|
[]
|
|
644
597
|
), q = (r) => {
|
|
645
|
-
if (!
|
|
646
|
-
const o =
|
|
598
|
+
if (!f.current || !g.current) return;
|
|
599
|
+
const o = g.current.getBoundingClientRect();
|
|
647
600
|
switch (r || ue.direction) {
|
|
648
601
|
case "down":
|
|
649
|
-
|
|
602
|
+
f.current.style.top = `${o.top + o.height - (He?.current?.offsetHeight ? He?.current?.offsetHeight + 4 : 0)}px`;
|
|
650
603
|
break;
|
|
651
604
|
case "up":
|
|
652
|
-
|
|
605
|
+
f.current.style.top = "auto", f.current.style.bottom = `${window.innerHeight - o.top + Ae}px`;
|
|
653
606
|
break;
|
|
654
607
|
}
|
|
655
|
-
|
|
608
|
+
f.current.style.left = `${o.left}px`, f.current.style.width = `${o.width}px`;
|
|
656
609
|
}, Pe = (r) => {
|
|
657
|
-
|
|
610
|
+
f.current && (f.current.style.maxHeight = `${r}px`);
|
|
658
611
|
}, ce = () => {
|
|
659
|
-
if (!
|
|
660
|
-
const r =
|
|
661
|
-
let D = "down",
|
|
662
|
-
return u ? (D = "down",
|
|
663
|
-
},
|
|
664
|
-
if (!(!
|
|
665
|
-
if (
|
|
666
|
-
|
|
612
|
+
if (!f.current || !g.current) return ue;
|
|
613
|
+
const r = g.current.getBoundingClientRect(), o = window.innerHeight - (window.innerHeight - r.top), i = window.innerHeight - r.bottom, u = i >= le, w = o >= le;
|
|
614
|
+
let D = "down", p;
|
|
615
|
+
return u ? (D = "down", p = le) : w ? (D = "up", p = le) : i > o ? (D = "down", p = i - 16) : (D = "up", p = o - 16), { direction: D, height: p };
|
|
616
|
+
}, _e = (r) => {
|
|
617
|
+
if (!(!f.current || !g.current)) {
|
|
618
|
+
if (f.current.style.transition = "max-height 0.2s ease,opacity 0.2s ease", !r) {
|
|
619
|
+
f.current.style.maxHeight = "0", f.current.style.opacity = "0", f.current.style.pointerEvents = "none";
|
|
667
620
|
return;
|
|
668
621
|
}
|
|
669
622
|
if (!H) {
|
|
670
623
|
const o = ce();
|
|
671
624
|
Ee(o), q(o.direction), Pe(o.height);
|
|
672
625
|
}
|
|
673
|
-
|
|
626
|
+
f.current.style.opacity = "1", f.current.style.pointerEvents = "auto", Oe && ne?.current && ne.current?.focus();
|
|
674
627
|
}
|
|
675
628
|
};
|
|
676
629
|
pe(() => {
|
|
677
|
-
H || !
|
|
630
|
+
H || !g.current || !n || q();
|
|
678
631
|
}, [re]), pe(() => {
|
|
679
|
-
|
|
632
|
+
_e(n);
|
|
680
633
|
}, [n]), pe(() => {
|
|
681
|
-
|
|
682
|
-
}, [
|
|
683
|
-
if (
|
|
684
|
-
const r =
|
|
634
|
+
v && B(v);
|
|
635
|
+
}, [v]), pe(() => {
|
|
636
|
+
if (Q || !F) return;
|
|
637
|
+
const r = Ie(v, F);
|
|
685
638
|
B(r);
|
|
686
|
-
}, [
|
|
687
|
-
const
|
|
639
|
+
}, [v]);
|
|
640
|
+
const Ie = (r, o) => {
|
|
688
641
|
if (!o) return r;
|
|
689
|
-
if (
|
|
690
|
-
const
|
|
691
|
-
let
|
|
692
|
-
const
|
|
693
|
-
|
|
642
|
+
if (z) {
|
|
643
|
+
const p = [];
|
|
644
|
+
let O = null, Y = [];
|
|
645
|
+
const V = () => {
|
|
646
|
+
O && Y.length > 0 && p.push(O, ...Y), O = null, Y = [];
|
|
694
647
|
};
|
|
695
648
|
return r.forEach((fe) => {
|
|
696
649
|
const oe = fe;
|
|
697
650
|
if (!!(oe || {})?.isGroupHeader) {
|
|
698
|
-
|
|
651
|
+
V(), O = oe;
|
|
699
652
|
return;
|
|
700
653
|
}
|
|
701
|
-
const
|
|
702
|
-
|
|
654
|
+
const a = fe, l = E(
|
|
655
|
+
a,
|
|
703
656
|
T
|
|
704
657
|
), c = Ue(String(l ?? ""), o);
|
|
705
|
-
|
|
706
|
-
}),
|
|
658
|
+
O ? c && Y.push(a) : c && p.push(a);
|
|
659
|
+
}), V(), p;
|
|
707
660
|
}
|
|
708
661
|
const i = [];
|
|
709
|
-
let u = null,
|
|
662
|
+
let u = null, w = [];
|
|
710
663
|
const D = () => {
|
|
711
|
-
u &&
|
|
664
|
+
u && w.length > 0 && i.push(u, ...w), u = null, w = [];
|
|
712
665
|
};
|
|
713
|
-
return r.forEach((
|
|
714
|
-
if (typeof
|
|
715
|
-
if ((
|
|
716
|
-
D(), u =
|
|
666
|
+
return r.forEach((p) => {
|
|
667
|
+
if (typeof p != "object" || p === null) return;
|
|
668
|
+
if ((p || {})?.isGroupHeader) {
|
|
669
|
+
D(), u = p;
|
|
717
670
|
return;
|
|
718
671
|
}
|
|
719
|
-
const
|
|
720
|
-
u ?
|
|
672
|
+
const O = Ue(p.label, o);
|
|
673
|
+
u ? O && w.push(p) : O && i.push(p);
|
|
721
674
|
}), D(), i;
|
|
722
|
-
},
|
|
723
|
-
const o =
|
|
675
|
+
}, $e = (r) => {
|
|
676
|
+
const o = Ie(v, r);
|
|
724
677
|
if (B(o), k) {
|
|
725
678
|
if (r === "") {
|
|
726
|
-
|
|
679
|
+
Ge();
|
|
727
680
|
return;
|
|
728
681
|
}
|
|
729
682
|
k(r);
|
|
730
683
|
return;
|
|
731
684
|
}
|
|
732
|
-
K &&
|
|
733
|
-
},
|
|
734
|
-
if (
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
const o =
|
|
685
|
+
K && v && K(r);
|
|
686
|
+
}, Ge = _(() => {
|
|
687
|
+
if (J) {
|
|
688
|
+
J(), B(
|
|
689
|
+
v.filter((r) => {
|
|
690
|
+
const o = z ? E(r, $) : r.id;
|
|
738
691
|
return re.has(o);
|
|
739
692
|
})
|
|
740
693
|
);
|
|
741
694
|
return;
|
|
742
695
|
}
|
|
743
|
-
K && (K(""), B(
|
|
696
|
+
K && (K(""), B(v));
|
|
744
697
|
}, [
|
|
745
|
-
|
|
698
|
+
v,
|
|
746
699
|
re,
|
|
747
|
-
|
|
748
|
-
|
|
700
|
+
$,
|
|
701
|
+
J,
|
|
749
702
|
B,
|
|
750
703
|
K,
|
|
751
|
-
|
|
704
|
+
z
|
|
752
705
|
]), I = (r) => {
|
|
753
|
-
r.key === "ArrowDown" ? (r.preventDefault(),
|
|
706
|
+
r.key === "ArrowDown" ? (r.preventDefault(), f.current?.querySelector(
|
|
754
707
|
"[role=listitem]"
|
|
755
708
|
)?.focus()) : (r.key === "Tab" || r.key === "Escape") && setTimeout(() => {
|
|
756
709
|
W.current?.focus(), ie();
|
|
757
710
|
}, 10);
|
|
758
|
-
},
|
|
711
|
+
}, R = (r, o) => {
|
|
759
712
|
const i = Array.from(
|
|
760
|
-
|
|
713
|
+
f.current?.querySelectorAll("[role=listitem]") || []
|
|
761
714
|
), u = i.indexOf(r.currentTarget);
|
|
762
715
|
if (r.key === "ArrowDown") {
|
|
763
716
|
r.preventDefault();
|
|
764
|
-
const
|
|
765
|
-
i[
|
|
717
|
+
const w = u < i.length - 1 ? u + 1 : u;
|
|
718
|
+
i[w]?.focus();
|
|
766
719
|
} else if (r.key === "ArrowUp")
|
|
767
720
|
if (r.preventDefault(), u === 0)
|
|
768
721
|
ne && ne.current?.focus();
|
|
769
722
|
else {
|
|
770
|
-
const
|
|
771
|
-
i[
|
|
723
|
+
const w = u - 1;
|
|
724
|
+
i[w]?.focus();
|
|
772
725
|
}
|
|
773
726
|
else if (r.key === "Enter" || r.key === " ") {
|
|
774
|
-
if (r.preventDefault(), (o || {})?.isGroupHeader ||
|
|
775
|
-
xe(o, !
|
|
727
|
+
if (r.preventDefault(), (o || {})?.isGroupHeader || N) return;
|
|
728
|
+
xe(o, !C), C || setTimeout(() => {
|
|
776
729
|
W.current?.focus(), ie();
|
|
777
730
|
}, 10);
|
|
778
731
|
} else r.key === "Escape" ? (r.preventDefault(), setTimeout(() => {
|
|
@@ -781,8 +734,8 @@ function mt({
|
|
|
781
734
|
W.current?.focus(), ie();
|
|
782
735
|
}, 10);
|
|
783
736
|
}, we = Array.from({ length: 5 }).map(
|
|
784
|
-
(r, o) =>
|
|
785
|
-
|
|
737
|
+
(r, o) => z ? Se.createElement(
|
|
738
|
+
te(z, (i, u) => i.isSelected === u.isSelected && i.option === u.option && i.disabled === u.disabled && i.multiple === u.multiple && i.renderContext === u.renderContext),
|
|
786
739
|
{
|
|
787
740
|
key: `skeleton-option-${o}`,
|
|
788
741
|
option: { id: o, label: "", value: "" },
|
|
@@ -794,7 +747,7 @@ function mt({
|
|
|
794
747
|
isLoading: !0,
|
|
795
748
|
renderContext: j
|
|
796
749
|
}
|
|
797
|
-
) : /* @__PURE__ */
|
|
750
|
+
) : /* @__PURE__ */ s.jsx(
|
|
798
751
|
Be,
|
|
799
752
|
{
|
|
800
753
|
multiple: !1,
|
|
@@ -807,11 +760,11 @@ function mt({
|
|
|
807
760
|
`skeleton-option-${// biome-ignore lint/suspicious/noArrayIndexKey: <>
|
|
808
761
|
o}`
|
|
809
762
|
)
|
|
810
|
-
), de = /* @__PURE__ */
|
|
763
|
+
), de = /* @__PURE__ */ s.jsx(
|
|
811
764
|
"div",
|
|
812
765
|
{
|
|
813
766
|
tabIndex: 0,
|
|
814
|
-
ref:
|
|
767
|
+
ref: f,
|
|
815
768
|
style: { opacity: "0" },
|
|
816
769
|
className: d(
|
|
817
770
|
" z-100! w-full mt-1 bg-neutral-default-default border border-neutral-default-default rounded-lg shadow-lg",
|
|
@@ -821,7 +774,7 @@ function mt({
|
|
|
821
774
|
ze,
|
|
822
775
|
"w-full max-w-[max(100%,20vw)] min-w-[min(100%,20vw)]"
|
|
823
776
|
),
|
|
824
|
-
children: /* @__PURE__ */
|
|
777
|
+
children: /* @__PURE__ */ s.jsxs(
|
|
825
778
|
"div",
|
|
826
779
|
{
|
|
827
780
|
className: d(
|
|
@@ -833,58 +786,58 @@ function mt({
|
|
|
833
786
|
maxHeight: ue.height
|
|
834
787
|
},
|
|
835
788
|
children: [
|
|
836
|
-
!ye && /* @__PURE__ */
|
|
837
|
-
|
|
789
|
+
!ye && /* @__PURE__ */ s.jsx(
|
|
790
|
+
rt,
|
|
838
791
|
{
|
|
839
792
|
name: "",
|
|
840
793
|
label: "",
|
|
841
|
-
size: "
|
|
794
|
+
size: "xsmall",
|
|
842
795
|
tabIndex: 0,
|
|
843
796
|
value: F,
|
|
844
|
-
disabled:
|
|
797
|
+
disabled: N,
|
|
845
798
|
ref: ne,
|
|
846
799
|
labelVariant: "static",
|
|
847
|
-
icon: /* @__PURE__ */
|
|
848
|
-
isFetching:
|
|
800
|
+
icon: /* @__PURE__ */ s.jsx(ot, {}),
|
|
801
|
+
isFetching: Q,
|
|
849
802
|
onKeyDown: I,
|
|
850
|
-
onClear:
|
|
851
|
-
onChange: (r) =>
|
|
803
|
+
onClear: Ge,
|
|
804
|
+
onChange: (r) => $e(r.target.value),
|
|
852
805
|
placeholder: ke,
|
|
853
|
-
className: " bg-neutral-medium-pressed",
|
|
854
|
-
...
|
|
806
|
+
className: " bg-neutral-medium-pressed *:max-h-8",
|
|
807
|
+
...M
|
|
855
808
|
}
|
|
856
809
|
),
|
|
857
|
-
/* @__PURE__ */
|
|
810
|
+
/* @__PURE__ */ s.jsx("div", { className: " overflow-y-auto flex-1 max-h-max ", children: se.length === 0 ? Q ? /* @__PURE__ */ s.jsx("div", { className: "flex flex-col gap-1 overflow-hidden w-full", children: je || we }) : /* @__PURE__ */ s.jsx("p", { className: "px-3 py-2 text-neutral-medium-default max-w-full text-pretty wrap-break-word ", children: F ? `No se encontraron resultados para "${F}"` : ge }) : (() => {
|
|
858
811
|
let r = !0;
|
|
859
812
|
return se.map((o) => {
|
|
860
|
-
const i = o, u = !!(i || {}).isGroupHeader,
|
|
861
|
-
id:
|
|
862
|
-
label: String(
|
|
863
|
-
value:
|
|
864
|
-
},
|
|
813
|
+
const i = o, u = !!(i || {}).isGroupHeader, w = z && !u ? E(o, $) : i.id, D = re.has(w), p = (l) => !z || u ? l : {
|
|
814
|
+
id: w,
|
|
815
|
+
label: String(E(l, T)),
|
|
816
|
+
value: E(l, $)
|
|
817
|
+
}, O = (l) => {
|
|
865
818
|
u || xe(
|
|
866
|
-
|
|
867
|
-
l === void 0 ? !
|
|
819
|
+
p(o),
|
|
820
|
+
l === void 0 ? !C : l
|
|
868
821
|
);
|
|
869
|
-
},
|
|
870
|
-
if (xe(l, !
|
|
822
|
+
}, Y = (l) => {
|
|
823
|
+
if (xe(l, !C), !C) {
|
|
871
824
|
if (!K) return;
|
|
872
|
-
K(""), B(
|
|
825
|
+
K(""), B(v);
|
|
873
826
|
}
|
|
874
|
-
},
|
|
875
|
-
const
|
|
827
|
+
}, V = (l, c) => {
|
|
828
|
+
const x = !!(c || {}).isGroupHeader;
|
|
876
829
|
return (
|
|
877
830
|
// biome-ignore lint/a11y/useSemanticElements: <>
|
|
878
|
-
/* @__PURE__ */
|
|
831
|
+
/* @__PURE__ */ s.jsx(
|
|
879
832
|
"div",
|
|
880
833
|
{
|
|
881
834
|
tabIndex: 0,
|
|
882
835
|
role: "listitem",
|
|
883
|
-
onKeyDown: (
|
|
836
|
+
onKeyDown: (m) => R(m, c),
|
|
884
837
|
className: d(
|
|
885
|
-
!
|
|
838
|
+
!x && !N && "focus-visible:bg-neutral-medium-hover outline-none hover:bg-neutral-medium-hover",
|
|
886
839
|
D && "bg-neutral-medium-selected",
|
|
887
|
-
|
|
840
|
+
N && "cursor-default pointer-events-none"
|
|
888
841
|
),
|
|
889
842
|
children: l
|
|
890
843
|
},
|
|
@@ -893,47 +846,47 @@ function mt({
|
|
|
893
846
|
);
|
|
894
847
|
};
|
|
895
848
|
if (u) {
|
|
896
|
-
const l = i.groupLabelNode ?? i.label, c = String(i.id),
|
|
897
|
-
r =
|
|
898
|
-
const
|
|
899
|
-
U && Le(c,
|
|
900
|
-
}, me = (
|
|
901
|
-
!
|
|
902
|
-
}, he =
|
|
903
|
-
(
|
|
904
|
-
).map((
|
|
849
|
+
const l = i.groupLabelNode ?? i.label, c = String(i.id), x = U === !1 ? !0 : Te(c);
|
|
850
|
+
r = x;
|
|
851
|
+
const m = i.originalOption, b = i.groupData?.groupOptions ?? [], Z = (G) => {
|
|
852
|
+
U && Le(c, G);
|
|
853
|
+
}, me = (G) => {
|
|
854
|
+
!b || b.length === 0 || ve && ve(b, G);
|
|
855
|
+
}, he = b.filter(
|
|
856
|
+
(G) => re.has(E(G, $))
|
|
857
|
+
).map((G) => String(E(G, $)));
|
|
905
858
|
if (be) {
|
|
906
|
-
const
|
|
859
|
+
const G = te(
|
|
907
860
|
be,
|
|
908
|
-
(
|
|
909
|
-
),
|
|
910
|
-
group:
|
|
861
|
+
(S, A) => S.label === A.label && S.group === A.group && S.groupOptions === A.groupOptions && S.disabled === A.disabled && S.multiple === A.multiple && S.expanded === A.expanded && S.renderContext === A.renderContext
|
|
862
|
+
), y = Se.createElement(G, {
|
|
863
|
+
group: m,
|
|
911
864
|
label: l,
|
|
912
|
-
groupOptions:
|
|
913
|
-
multiple:
|
|
914
|
-
disabled:
|
|
915
|
-
expanded:
|
|
916
|
-
toggleGroup:
|
|
865
|
+
groupOptions: b,
|
|
866
|
+
multiple: C,
|
|
867
|
+
disabled: N,
|
|
868
|
+
expanded: x,
|
|
869
|
+
toggleGroup: Z,
|
|
917
870
|
selectGroup: me,
|
|
918
871
|
renderContext: j,
|
|
919
872
|
groupSelectedIds: he
|
|
920
873
|
});
|
|
921
|
-
return
|
|
874
|
+
return V(y, i);
|
|
922
875
|
}
|
|
923
|
-
return
|
|
924
|
-
/* @__PURE__ */
|
|
925
|
-
/* @__PURE__ */
|
|
926
|
-
U && /* @__PURE__ */
|
|
876
|
+
return V(
|
|
877
|
+
/* @__PURE__ */ s.jsxs("div", { className: "px-3 py-2 text-neutral-medium-default font-medium text-sm w-full flex justify-between", children: [
|
|
878
|
+
/* @__PURE__ */ s.jsx("div", { children: l }),
|
|
879
|
+
U && /* @__PURE__ */ s.jsx(
|
|
927
880
|
"div",
|
|
928
881
|
{
|
|
929
882
|
className: "cursor-pointer",
|
|
930
883
|
onClick: () => Le(c),
|
|
931
|
-
children: /* @__PURE__ */
|
|
884
|
+
children: /* @__PURE__ */ s.jsx(
|
|
932
885
|
Re,
|
|
933
886
|
{
|
|
934
887
|
className: d(
|
|
935
888
|
"transition-transform duration-300 ease-out",
|
|
936
|
-
|
|
889
|
+
x ? "rotate-180" : "rotate-0"
|
|
937
890
|
)
|
|
938
891
|
}
|
|
939
892
|
)
|
|
@@ -943,42 +896,42 @@ function mt({
|
|
|
943
896
|
i
|
|
944
897
|
);
|
|
945
898
|
}
|
|
946
|
-
const fe =
|
|
947
|
-
|
|
948
|
-
|
|
899
|
+
const fe = z ? Se.createElement(
|
|
900
|
+
te(
|
|
901
|
+
z,
|
|
949
902
|
(l, c) => l.isSelected === c.isSelected && l.option === c.option && l.disabled === c.disabled && l.multiple === c.multiple && l.renderContext === c.renderContext
|
|
950
903
|
),
|
|
951
904
|
{
|
|
952
|
-
key:
|
|
905
|
+
key: w,
|
|
953
906
|
option: o,
|
|
954
907
|
isSelected: D,
|
|
955
|
-
multiple:
|
|
956
|
-
onSelect:
|
|
957
|
-
disabled:
|
|
958
|
-
isLoading:
|
|
908
|
+
multiple: C,
|
|
909
|
+
onSelect: O,
|
|
910
|
+
disabled: N,
|
|
911
|
+
isLoading: Q,
|
|
959
912
|
renderContext: j
|
|
960
913
|
}
|
|
961
|
-
) : /* @__PURE__ */
|
|
914
|
+
) : /* @__PURE__ */ s.jsx(
|
|
962
915
|
Be,
|
|
963
916
|
{
|
|
964
|
-
disabled:
|
|
965
|
-
multiple:
|
|
966
|
-
isLoading:
|
|
917
|
+
disabled: N,
|
|
918
|
+
multiple: C,
|
|
919
|
+
isLoading: Q,
|
|
967
920
|
isSelected: D,
|
|
968
|
-
onSelect:
|
|
921
|
+
onSelect: Y,
|
|
969
922
|
option: o
|
|
970
923
|
},
|
|
971
|
-
|
|
972
|
-
), oe =
|
|
924
|
+
w
|
|
925
|
+
), oe = V(
|
|
973
926
|
fe,
|
|
974
|
-
|
|
927
|
+
p(o)
|
|
975
928
|
);
|
|
976
929
|
if (!U)
|
|
977
930
|
return oe;
|
|
978
|
-
const t = !r,
|
|
979
|
-
return Se.cloneElement(
|
|
931
|
+
const t = !r, a = oe;
|
|
932
|
+
return Se.cloneElement(a, {
|
|
980
933
|
className: d(
|
|
981
|
-
|
|
934
|
+
a.props.className,
|
|
982
935
|
"overflow-hidden transition-[max-height] duration-300 ease-out",
|
|
983
936
|
t ? "max-h-0" : "max-h-[999px]"
|
|
984
937
|
)
|
|
@@ -991,49 +944,49 @@ function mt({
|
|
|
991
944
|
)
|
|
992
945
|
}
|
|
993
946
|
);
|
|
994
|
-
return H ? de :
|
|
947
|
+
return H ? de : Xe(de, document.body);
|
|
995
948
|
}
|
|
996
|
-
const
|
|
997
|
-
|
|
949
|
+
const ct = te(
|
|
950
|
+
ut,
|
|
998
951
|
(e, n) => e.options === n.options && e.selectedOptionsIds === n.selectedOptionsIds && e.multiple === n.multiple && e.disabled === n.disabled && e.emptyMessage === n.emptyMessage && e.renderOption === n.renderOption && e.renderOptionContext === n.renderOptionContext && e.isOpen === n.isOpen && e.attachToParent === n.attachToParent && e.optionValue === n.optionValue && e.optionLabel === n.optionLabel && e.filteredOptions === n.filteredOptions && e.isLoading === n.isLoading
|
|
999
|
-
), Be =
|
|
952
|
+
), Be = te(
|
|
1000
953
|
({
|
|
1001
954
|
option: e,
|
|
1002
955
|
isSelected: n,
|
|
1003
|
-
onSelect:
|
|
1004
|
-
multiple:
|
|
1005
|
-
disabled:
|
|
1006
|
-
isLoading:
|
|
956
|
+
onSelect: h,
|
|
957
|
+
multiple: v,
|
|
958
|
+
disabled: C,
|
|
959
|
+
isLoading: N
|
|
1007
960
|
}) => {
|
|
1008
|
-
const
|
|
1009
|
-
if (
|
|
1010
|
-
return /* @__PURE__ */
|
|
961
|
+
const g = (e || {})?.isGroupHeader;
|
|
962
|
+
if (N)
|
|
963
|
+
return /* @__PURE__ */ s.jsxs(
|
|
1011
964
|
"div",
|
|
1012
965
|
{
|
|
1013
966
|
className: "flex gap-2 w-full px-3 py-2 cursor-wait",
|
|
1014
967
|
children: [
|
|
1015
|
-
/* @__PURE__ */
|
|
1016
|
-
/* @__PURE__ */
|
|
968
|
+
/* @__PURE__ */ s.jsx(qe, { className: "size-6 aspect-square" }),
|
|
969
|
+
/* @__PURE__ */ s.jsx(qe, { className: "flex-1 h-6" })
|
|
1017
970
|
]
|
|
1018
971
|
},
|
|
1019
972
|
e.id
|
|
1020
973
|
);
|
|
1021
|
-
const
|
|
1022
|
-
T.preventDefault(), T.stopPropagation(), !(
|
|
1023
|
-
},
|
|
1024
|
-
return /* @__PURE__ */
|
|
974
|
+
const M = (T) => {
|
|
975
|
+
T.preventDefault(), T.stopPropagation(), !(C || g) && h?.(e);
|
|
976
|
+
}, f = g && e.groupLabelNode ? e.groupLabelNode : e.label;
|
|
977
|
+
return /* @__PURE__ */ s.jsxs(
|
|
1025
978
|
"div",
|
|
1026
979
|
{
|
|
1027
|
-
onMouseDown:
|
|
980
|
+
onMouseDown: M,
|
|
1028
981
|
className: d(
|
|
1029
982
|
"px-3 py-2 flex items-center transition-colors text-neutral-default-default ",
|
|
1030
|
-
|
|
1031
|
-
!
|
|
1032
|
-
|
|
983
|
+
g ? "cursor-default text-neutral-medium-default" : "cursor-pointer",
|
|
984
|
+
!g && (n ? " text-primary-default-default" : "hover:bg-neutral-medium-hover text-neutral-default-hover"),
|
|
985
|
+
C && !g && "text-neutral-default-disabled hover:bg-neutral-default-default"
|
|
1033
986
|
),
|
|
1034
987
|
children: [
|
|
1035
|
-
|
|
1036
|
-
/* @__PURE__ */
|
|
988
|
+
v && !g && /* @__PURE__ */ s.jsx(nt, { checked: n, disabled: C }),
|
|
989
|
+
/* @__PURE__ */ s.jsx("span", { children: f })
|
|
1037
990
|
]
|
|
1038
991
|
},
|
|
1039
992
|
e.id
|
|
@@ -1042,32 +995,32 @@ const ht = J(
|
|
|
1042
995
|
(e, n) => e.isSelected === n.isSelected && e.disabled === n.disabled
|
|
1043
996
|
);
|
|
1044
997
|
Be.displayName = "DefaultOptionRenderer";
|
|
1045
|
-
const
|
|
998
|
+
const Ve = te(
|
|
1046
999
|
({
|
|
1047
1000
|
selectedOptions: e,
|
|
1048
1001
|
placeholder: n,
|
|
1049
|
-
onRemoveOption:
|
|
1050
|
-
displayMode:
|
|
1051
|
-
multiple:
|
|
1052
|
-
className:
|
|
1053
|
-
disabled:
|
|
1054
|
-
}) => e?.length === 0 ? n ? /* @__PURE__ */
|
|
1055
|
-
|
|
1002
|
+
onRemoveOption: h,
|
|
1003
|
+
displayMode: v,
|
|
1004
|
+
multiple: C,
|
|
1005
|
+
className: N,
|
|
1006
|
+
disabled: g
|
|
1007
|
+
}) => e?.length === 0 ? n ? /* @__PURE__ */ s.jsx("span", { className: "text-neutral-medium-default line-clamp-1", children: n }) : null : v === "chips" && C ? /* @__PURE__ */ s.jsx("div", { className: d("flex items-center gap-1 ", N), children: e.map((M) => /* @__PURE__ */ s.jsx(
|
|
1008
|
+
tt,
|
|
1056
1009
|
{
|
|
1057
1010
|
tabIndex: -1,
|
|
1058
|
-
id:
|
|
1059
|
-
label:
|
|
1060
|
-
onRemove:
|
|
1061
|
-
disabled:
|
|
1011
|
+
id: M.id,
|
|
1012
|
+
label: M.label,
|
|
1013
|
+
onRemove: h,
|
|
1014
|
+
disabled: g
|
|
1062
1015
|
},
|
|
1063
|
-
|
|
1064
|
-
)) }) : e?.length === 1 ? /* @__PURE__ */
|
|
1016
|
+
M.id
|
|
1017
|
+
)) }) : e?.length === 1 ? /* @__PURE__ */ s.jsx("span", { className: "line-clamp-1", children: e[0].label }) : /* @__PURE__ */ s.jsxs("span", { className: "line-clamp-1", children: [
|
|
1065
1018
|
e?.length,
|
|
1066
1019
|
" seleccionados"
|
|
1067
1020
|
] }),
|
|
1068
1021
|
(e, n) => e.selectedOptions === n.selectedOptions && e.disabled === n.disabled
|
|
1069
1022
|
);
|
|
1070
|
-
|
|
1023
|
+
Ve.displayName = "DefaultSelectionDisplay";
|
|
1071
1024
|
export {
|
|
1072
|
-
|
|
1025
|
+
Ht as default
|
|
1073
1026
|
};
|