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