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