prometeo-design-system 8.2.4 → 8.2.6
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/Select.es.js +493 -478
- package/dist/SelectSearch.es.js +156 -154
- package/dist/components/Select/types.d.ts +6 -0
- package/dist/components/SelectSearch/SelectSearch.d.ts +3 -1
- package/dist/components/SelectSearch/useAsyncOptions.d.ts +2 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/styles/tokens.css +1 -1
- package/src/styles/utilities/background.css +1 -1
- package/src/styles/utilities/border.css +1 -1
- package/src/styles/utilities/dataviz.css +1 -1
- package/src/styles/utilities/icon.css +1 -1
- package/src/styles/utilities/os.css +1 -1
- package/src/styles/utilities/size.css +1 -1
- package/src/styles/utilities/text.css +1 -1
package/dist/Select.es.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { u as
|
|
3
|
-
import { c as
|
|
1
|
+
import { j as a } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
|
+
import { u as _e } from "./useDevice-S7cYqLVh.js";
|
|
3
|
+
import { c as V } from "./cn-B6yFEsav.js";
|
|
4
4
|
import { f as Ue } from "./MenuFloating-DQsbU8n3.js";
|
|
5
|
-
import { g as S, h as
|
|
6
|
-
import { memo as pe,
|
|
7
|
-
import { Menu as he, useMenuControl as
|
|
8
|
-
import
|
|
5
|
+
import { g as S, h as je } from "./utils-X4-h3cum.js";
|
|
6
|
+
import { memo as pe, useCallback as D, forwardRef as Ie, useMemo as Z, useRef as Q, useState as Te, useEffect as se, useLayoutEffect as We } from "react";
|
|
7
|
+
import { Menu as he, useMenuControl as $e, useMenuState as Le } from "./Menu.es.js";
|
|
8
|
+
import Oe from "./Input.es.js";
|
|
9
9
|
import { MenuList as Ne } from "./MenuList.es.js";
|
|
10
|
+
import Re from "./Spinner.es.js";
|
|
10
11
|
import ke from "./ListItem.es.js";
|
|
11
12
|
import { KeyboardArrowUp as qe } from "./Icon-KeyboardArrowUp.es.js";
|
|
12
13
|
import { KeyboardArrowDown as Xe } from "./Icon-KeyboardArrowDown.es.js";
|
|
13
14
|
import { S as De } from "./Skeleton-B0cQzX3_.js";
|
|
14
15
|
import { Search as Je } from "./Icon-Search.es.js";
|
|
15
|
-
import { useDragScroll as
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import je from "./Chip.es.js";
|
|
16
|
+
import { useDragScroll as Qe } from "./useDragScroll.es.js";
|
|
17
|
+
import Ye from "./IconButton.es.js";
|
|
18
|
+
import we from "./Chip.es.js";
|
|
19
19
|
import { Close as ye } from "./Icon-Close.es.js";
|
|
20
20
|
import { ChevronDown as Ze } from "./Icon-ChevronDown.es.js";
|
|
21
21
|
const Ve = pe(
|
|
@@ -23,13 +23,13 @@ const Ve = pe(
|
|
|
23
23
|
label: t,
|
|
24
24
|
expanded: n,
|
|
25
25
|
onToggle: r,
|
|
26
|
-
onSelectGroup:
|
|
26
|
+
onSelectGroup: o,
|
|
27
27
|
multiple: c,
|
|
28
28
|
selectedCount: s,
|
|
29
29
|
totalCount: l
|
|
30
30
|
}) {
|
|
31
|
-
const
|
|
32
|
-
return typeof t != "string" ? /* @__PURE__ */
|
|
31
|
+
const j = l > 0 && s === l;
|
|
32
|
+
return typeof t != "string" ? /* @__PURE__ */ a.jsx("div", { className: "flex items-center gap-2 px-3 py-2", children: t }) : /* @__PURE__ */ a.jsx(
|
|
33
33
|
ke,
|
|
34
34
|
{
|
|
35
35
|
label: t,
|
|
@@ -37,8 +37,8 @@ const Ve = pe(
|
|
|
37
37
|
trailingIcon: n ? qe : Xe,
|
|
38
38
|
onClick: r,
|
|
39
39
|
showSelectionComponent: c,
|
|
40
|
-
isSelected:
|
|
41
|
-
onSelectionClick: () =>
|
|
40
|
+
isSelected: j,
|
|
41
|
+
onSelectionClick: () => o?.("toggle"),
|
|
42
42
|
showDivider: !1,
|
|
43
43
|
supportingText: c ? `${s}/${l}` : void 0
|
|
44
44
|
}
|
|
@@ -50,9 +50,9 @@ function et(e) {
|
|
|
50
50
|
return e ?? "medium";
|
|
51
51
|
}
|
|
52
52
|
function Ae() {
|
|
53
|
-
return /* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
/* @__PURE__ */
|
|
53
|
+
return /* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-2 px-3 py-2 animate-pulse", children: [
|
|
54
|
+
/* @__PURE__ */ a.jsx(De, { className: "size-6 aspect-square" }),
|
|
55
|
+
/* @__PURE__ */ a.jsx(De, { className: "h-6 flex-1 max-w-[60%]" })
|
|
56
56
|
] });
|
|
57
57
|
}
|
|
58
58
|
const tt = pe(
|
|
@@ -60,18 +60,18 @@ const tt = pe(
|
|
|
60
60
|
label: t,
|
|
61
61
|
isSelected: n,
|
|
62
62
|
multiple: r,
|
|
63
|
-
disabled:
|
|
63
|
+
disabled: o,
|
|
64
64
|
isOptionActive: c,
|
|
65
65
|
isLoading: s,
|
|
66
66
|
size: l
|
|
67
67
|
}) {
|
|
68
|
-
return s ? /* @__PURE__ */
|
|
68
|
+
return s ? /* @__PURE__ */ a.jsx(Ae, {}) : /* @__PURE__ */ a.jsx(
|
|
69
69
|
ke,
|
|
70
70
|
{
|
|
71
71
|
label: t,
|
|
72
72
|
isSelected: n,
|
|
73
73
|
showSelectionComponent: r,
|
|
74
|
-
disabled:
|
|
74
|
+
disabled: o || !c,
|
|
75
75
|
showDivider: !1,
|
|
76
76
|
size: et(l)
|
|
77
77
|
}
|
|
@@ -79,10 +79,10 @@ const tt = pe(
|
|
|
79
79
|
},
|
|
80
80
|
(e, t) => e.isSelected === t.isSelected && e.disabled === t.disabled && e.isOptionActive === t.isOptionActive && e.isLoading === t.isLoading && e.label === t.label
|
|
81
81
|
);
|
|
82
|
-
function
|
|
82
|
+
function Ee(e) {
|
|
83
83
|
return e.length === 0 ? [] : e.flatMap((t) => {
|
|
84
84
|
const n = t.options;
|
|
85
|
-
return n?.length ?
|
|
85
|
+
return n?.length ? Ee(n) : [t];
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
function rt(e) {
|
|
@@ -107,28 +107,28 @@ function ct(e) {
|
|
|
107
107
|
controledSearchValue: t,
|
|
108
108
|
inputSearchPlaceholder: n,
|
|
109
109
|
dropdownHeight: r,
|
|
110
|
-
controlledSearchValue:
|
|
110
|
+
controlledSearchValue: o,
|
|
111
111
|
searchPlaceholder: c,
|
|
112
112
|
maxHeight: s,
|
|
113
113
|
...l
|
|
114
114
|
} = e;
|
|
115
115
|
return {
|
|
116
116
|
...l,
|
|
117
|
-
controlledSearchValue:
|
|
117
|
+
controlledSearchValue: o ?? t,
|
|
118
118
|
searchPlaceholder: c ?? n,
|
|
119
119
|
maxHeight: s ?? r
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
|
-
const st =
|
|
123
|
-
function({ value: t, onChange: n, onClear: r, onKeyDown:
|
|
124
|
-
return /* @__PURE__ */
|
|
125
|
-
|
|
122
|
+
const st = Ie(
|
|
123
|
+
function({ value: t, onChange: n, onClear: r, onKeyDown: o, placeholder: c, ...s }, l) {
|
|
124
|
+
return /* @__PURE__ */ a.jsx(
|
|
125
|
+
Oe,
|
|
126
126
|
{
|
|
127
127
|
ref: l,
|
|
128
128
|
value: t,
|
|
129
|
-
onChange: (
|
|
129
|
+
onChange: (j) => n(j.target.value),
|
|
130
130
|
onClear: r,
|
|
131
|
-
onKeyDown:
|
|
131
|
+
onKeyDown: o,
|
|
132
132
|
placeholder: c,
|
|
133
133
|
size: "small",
|
|
134
134
|
leadingIcon: Je,
|
|
@@ -138,51 +138,55 @@ const st = Oe(
|
|
|
138
138
|
}
|
|
139
139
|
);
|
|
140
140
|
function at({ message: e }) {
|
|
141
|
-
return /* @__PURE__ */
|
|
141
|
+
return /* @__PURE__ */ a.jsx("div", { className: "flex items-center justify-center px-3 py-6 text-sm text-neutral-secondary-default", children: e });
|
|
142
142
|
}
|
|
143
143
|
function ot({
|
|
144
144
|
loadingComponent: e
|
|
145
145
|
}) {
|
|
146
|
-
return e ? /* @__PURE__ */
|
|
146
|
+
return e ? /* @__PURE__ */ a.jsx(a.Fragment, { children: e }) : /* @__PURE__ */ a.jsx("div", { className: "flex flex-col gap-1 p-2", children: Array.from({ length: 5 }, (t, n) => /* @__PURE__ */ a.jsx(Ae, {}, n)) });
|
|
147
147
|
}
|
|
148
|
-
|
|
148
|
+
const it = 48;
|
|
149
|
+
function lt() {
|
|
150
|
+
return /* @__PURE__ */ a.jsx("div", { className: "flex items-center justify-center py-3", children: /* @__PURE__ */ a.jsx(Re, { size: "small", variant: "sync", className: "opacity-90" }) });
|
|
151
|
+
}
|
|
152
|
+
function He({
|
|
149
153
|
option: e,
|
|
150
154
|
optionLabel: t,
|
|
151
155
|
optionValue: n,
|
|
152
156
|
optionActive: r,
|
|
153
|
-
selectedIds:
|
|
157
|
+
selectedIds: o,
|
|
154
158
|
multiple: c,
|
|
155
159
|
disabled: s,
|
|
156
160
|
size: l,
|
|
157
|
-
renderOption:
|
|
161
|
+
renderOption: j,
|
|
158
162
|
renderOptionContext: w,
|
|
159
163
|
onSelect: f,
|
|
160
|
-
createOptionKeyHandler:
|
|
164
|
+
createOptionKeyHandler: I
|
|
161
165
|
}) {
|
|
162
|
-
const i = S(e, n), p = S(e, t),
|
|
166
|
+
const i = S(e, n), p = S(e, t), E = o.has(i), g = ae(e, r), N = () => {
|
|
163
167
|
g && f(i);
|
|
164
|
-
},
|
|
165
|
-
() =>
|
|
166
|
-
[
|
|
168
|
+
}, T = Z(
|
|
169
|
+
() => I(i),
|
|
170
|
+
[I, i]
|
|
167
171
|
), M = {
|
|
168
172
|
role: "option",
|
|
169
|
-
"aria-selected":
|
|
173
|
+
"aria-selected": E,
|
|
170
174
|
"aria-disabled": !g,
|
|
171
175
|
"data-option-value": i,
|
|
172
176
|
tabIndex: -1,
|
|
173
|
-
onKeyDown:
|
|
177
|
+
onKeyDown: T,
|
|
174
178
|
// Custom renderOption owns click via onSelect; wrapper onClick would double-toggle.
|
|
175
|
-
...!
|
|
179
|
+
...!j && { onClick: N }
|
|
176
180
|
};
|
|
177
|
-
if (
|
|
178
|
-
const
|
|
179
|
-
return /* @__PURE__ */
|
|
180
|
-
|
|
181
|
+
if (j) {
|
|
182
|
+
const H = j;
|
|
183
|
+
return /* @__PURE__ */ a.jsx("div", { ...M, children: /* @__PURE__ */ a.jsx(
|
|
184
|
+
H,
|
|
181
185
|
{
|
|
182
186
|
option: e,
|
|
183
|
-
isSelected:
|
|
184
|
-
onSelect: (
|
|
185
|
-
f(i,
|
|
187
|
+
isSelected: E,
|
|
188
|
+
onSelect: (R) => {
|
|
189
|
+
f(i, R);
|
|
186
190
|
},
|
|
187
191
|
multiple: c,
|
|
188
192
|
disabled: s,
|
|
@@ -192,11 +196,11 @@ function Ge({
|
|
|
192
196
|
}
|
|
193
197
|
) });
|
|
194
198
|
}
|
|
195
|
-
return /* @__PURE__ */
|
|
199
|
+
return /* @__PURE__ */ a.jsx("div", { ...M, children: /* @__PURE__ */ a.jsx(
|
|
196
200
|
tt,
|
|
197
201
|
{
|
|
198
202
|
label: p,
|
|
199
|
-
isSelected:
|
|
203
|
+
isSelected: E,
|
|
200
204
|
multiple: c,
|
|
201
205
|
disabled: s,
|
|
202
206
|
isOptionActive: g,
|
|
@@ -204,7 +208,7 @@ function Ge({
|
|
|
204
208
|
}
|
|
205
209
|
) });
|
|
206
210
|
}
|
|
207
|
-
function
|
|
211
|
+
function ut(e, t, n) {
|
|
208
212
|
return (r) => {
|
|
209
213
|
switch (r.key) {
|
|
210
214
|
case " ": {
|
|
@@ -239,60 +243,60 @@ function it(e, t, n) {
|
|
|
239
243
|
}
|
|
240
244
|
};
|
|
241
245
|
}
|
|
242
|
-
function
|
|
246
|
+
function ft({
|
|
243
247
|
group: e,
|
|
244
248
|
children: t,
|
|
245
249
|
optionLabel: n,
|
|
246
250
|
optionValue: r,
|
|
247
|
-
optionActive:
|
|
251
|
+
optionActive: o,
|
|
248
252
|
selectedIds: c,
|
|
249
253
|
multiple: s,
|
|
250
254
|
disabled: l,
|
|
251
|
-
size:
|
|
255
|
+
size: j,
|
|
252
256
|
dropdownOptions: w,
|
|
253
257
|
renderOption: f,
|
|
254
|
-
renderOptionGroupHeader:
|
|
258
|
+
renderOptionGroupHeader: I,
|
|
255
259
|
renderOptionContext: i,
|
|
256
260
|
onSelect: p,
|
|
257
|
-
onSelectGroup:
|
|
261
|
+
onSelectGroup: E,
|
|
258
262
|
closeDropdown: g,
|
|
259
263
|
createOptionKeyHandler: N,
|
|
260
|
-
navigateNext:
|
|
264
|
+
navigateNext: T,
|
|
261
265
|
navigatePrev: M,
|
|
262
|
-
hasActiveSearch:
|
|
266
|
+
hasActiveSearch: H
|
|
263
267
|
}) {
|
|
264
|
-
const
|
|
265
|
-
(
|
|
266
|
-
),
|
|
267
|
-
(
|
|
268
|
-
), z =
|
|
269
|
-
(
|
|
270
|
-
[
|
|
271
|
-
),
|
|
272
|
-
const h = !
|
|
273
|
-
}, C =
|
|
274
|
-
onSelectGroup:
|
|
275
|
-
navigateNext:
|
|
268
|
+
const R = S(e, r), b = S(e, n), P = w?.enableGroupToggle !== !1, $ = t.filter(
|
|
269
|
+
(k) => ae(k, o)
|
|
270
|
+
), F = $.filter(
|
|
271
|
+
(k) => c.has(S(k, r))
|
|
272
|
+
), z = D(
|
|
273
|
+
(k) => E(R, k),
|
|
274
|
+
[E, R]
|
|
275
|
+
), L = w?.allGroupsExpanded === !0 || (w?.initialExpandedGroupIds?.includes(R) ?? !1), _ = (k) => {
|
|
276
|
+
const h = !P || !k.isCollapsed, d = P ? k.toggle : () => {
|
|
277
|
+
}, C = ut(R, k, {
|
|
278
|
+
onSelectGroup: E,
|
|
279
|
+
navigateNext: T,
|
|
276
280
|
navigatePrev: M,
|
|
277
281
|
closeDropdown: g
|
|
278
282
|
});
|
|
279
283
|
let m;
|
|
280
|
-
if (
|
|
281
|
-
const y =
|
|
282
|
-
m = /* @__PURE__ */
|
|
284
|
+
if (I) {
|
|
285
|
+
const y = I;
|
|
286
|
+
m = /* @__PURE__ */ a.jsx(
|
|
283
287
|
y,
|
|
284
288
|
{
|
|
285
289
|
group: e,
|
|
286
|
-
label:
|
|
290
|
+
label: b,
|
|
287
291
|
groupOptions: t,
|
|
288
|
-
groupSelectedIds:
|
|
292
|
+
groupSelectedIds: F.map(
|
|
289
293
|
(u) => S(u, r)
|
|
290
294
|
),
|
|
291
295
|
multiple: s,
|
|
292
296
|
disabled: l,
|
|
293
297
|
expanded: h,
|
|
294
298
|
toggleGroup: (u) => {
|
|
295
|
-
if (
|
|
299
|
+
if (P) {
|
|
296
300
|
if (u === void 0) {
|
|
297
301
|
d();
|
|
298
302
|
return;
|
|
@@ -300,28 +304,28 @@ function lt({
|
|
|
300
304
|
u !== h && d();
|
|
301
305
|
}
|
|
302
306
|
},
|
|
303
|
-
selectGroup: (u) => R
|
|
307
|
+
selectGroup: (u) => E(R, u ?? "toggle"),
|
|
304
308
|
renderContext: i
|
|
305
309
|
}
|
|
306
310
|
);
|
|
307
311
|
} else
|
|
308
|
-
m = /* @__PURE__ */
|
|
312
|
+
m = /* @__PURE__ */ a.jsx(
|
|
309
313
|
Ve,
|
|
310
314
|
{
|
|
311
|
-
label:
|
|
315
|
+
label: b,
|
|
312
316
|
expanded: h,
|
|
313
317
|
onToggle: d,
|
|
314
318
|
onSelectGroup: z,
|
|
315
319
|
multiple: s,
|
|
316
|
-
selectedCount:
|
|
317
|
-
totalCount:
|
|
320
|
+
selectedCount: F.length,
|
|
321
|
+
totalCount: $.length
|
|
318
322
|
}
|
|
319
323
|
);
|
|
320
|
-
return /* @__PURE__ */
|
|
324
|
+
return /* @__PURE__ */ a.jsx(
|
|
321
325
|
"div",
|
|
322
326
|
{
|
|
323
327
|
"data-group-header": !0,
|
|
324
|
-
"data-group-id":
|
|
328
|
+
"data-group-id": R,
|
|
325
329
|
tabIndex: -1,
|
|
326
330
|
"aria-expanded": h,
|
|
327
331
|
onKeyDown: C,
|
|
@@ -329,58 +333,58 @@ function lt({
|
|
|
329
333
|
}
|
|
330
334
|
);
|
|
331
335
|
};
|
|
332
|
-
return /* @__PURE__ */
|
|
336
|
+
return /* @__PURE__ */ a.jsx(
|
|
333
337
|
Ne.Group,
|
|
334
338
|
{
|
|
335
|
-
header:
|
|
336
|
-
forceExpanded:
|
|
337
|
-
defaultExpanded:
|
|
338
|
-
defaultCollapsed: !!
|
|
339
|
+
header: _,
|
|
340
|
+
forceExpanded: H || !P,
|
|
341
|
+
defaultExpanded: L,
|
|
342
|
+
defaultCollapsed: !!P,
|
|
339
343
|
className: w?.groupContainerClassName,
|
|
340
|
-
children: t.map((
|
|
341
|
-
|
|
344
|
+
children: t.map((k) => /* @__PURE__ */ a.jsx(
|
|
345
|
+
He,
|
|
342
346
|
{
|
|
343
|
-
option:
|
|
347
|
+
option: k,
|
|
344
348
|
optionLabel: n,
|
|
345
349
|
optionValue: r,
|
|
346
|
-
optionActive:
|
|
350
|
+
optionActive: o,
|
|
347
351
|
selectedIds: c,
|
|
348
352
|
multiple: s,
|
|
349
353
|
disabled: l,
|
|
350
|
-
size:
|
|
354
|
+
size: j,
|
|
351
355
|
renderOption: f,
|
|
352
356
|
renderOptionContext: i,
|
|
353
357
|
onSelect: p,
|
|
354
358
|
closeDropdown: g,
|
|
355
359
|
createOptionKeyHandler: N
|
|
356
360
|
},
|
|
357
|
-
S(
|
|
361
|
+
S(k, r)
|
|
358
362
|
))
|
|
359
363
|
}
|
|
360
364
|
);
|
|
361
365
|
}
|
|
362
|
-
function
|
|
366
|
+
function dt({
|
|
363
367
|
filteredOptions: e,
|
|
364
368
|
emptyMessage: t,
|
|
365
369
|
...n
|
|
366
370
|
}) {
|
|
367
|
-
return e.length === 0 ? /* @__PURE__ */
|
|
371
|
+
return e.length === 0 ? /* @__PURE__ */ a.jsx(at, { message: t }) : /* @__PURE__ */ a.jsx(
|
|
368
372
|
Ne,
|
|
369
373
|
{
|
|
370
374
|
className: n.dropdownOptions?.optionContainerClassName,
|
|
371
375
|
accordion: n.dropdownOptions?.groupAccordion !== !1,
|
|
372
376
|
children: e.map((r) => {
|
|
373
|
-
const
|
|
374
|
-
return
|
|
375
|
-
|
|
377
|
+
const o = r.options;
|
|
378
|
+
return o?.length ? /* @__PURE__ */ a.jsx(
|
|
379
|
+
ft,
|
|
376
380
|
{
|
|
377
381
|
group: r,
|
|
378
|
-
children:
|
|
382
|
+
children: o,
|
|
379
383
|
...n
|
|
380
384
|
},
|
|
381
385
|
S(r, n.optionValue)
|
|
382
|
-
) : /* @__PURE__ */
|
|
383
|
-
|
|
386
|
+
) : /* @__PURE__ */ a.jsx(
|
|
387
|
+
He,
|
|
384
388
|
{
|
|
385
389
|
option: r,
|
|
386
390
|
...n
|
|
@@ -391,43 +395,50 @@ function ut({
|
|
|
391
395
|
}
|
|
392
396
|
);
|
|
393
397
|
}
|
|
394
|
-
function
|
|
398
|
+
function gt({
|
|
395
399
|
menuRef: e,
|
|
396
400
|
triggerRef: t,
|
|
397
401
|
anchorRef: n,
|
|
398
402
|
dropdownVariant: r = "list",
|
|
399
|
-
attachToParent:
|
|
403
|
+
attachToParent: o,
|
|
400
404
|
filteredOptions: c,
|
|
401
405
|
selectedIds: s,
|
|
402
406
|
optionLabel: l,
|
|
403
|
-
optionValue:
|
|
407
|
+
optionValue: j,
|
|
404
408
|
optionActive: w,
|
|
405
409
|
multiple: f,
|
|
406
|
-
renderOption:
|
|
410
|
+
renderOption: I,
|
|
407
411
|
renderOptionGroupHeader: i,
|
|
408
412
|
renderOptionContext: p,
|
|
409
|
-
onSelect:
|
|
413
|
+
onSelect: E,
|
|
410
414
|
onSelectGroup: g,
|
|
411
415
|
closeDropdown: N,
|
|
412
|
-
searchValue:
|
|
416
|
+
searchValue: T,
|
|
413
417
|
onSearchChange: M,
|
|
414
|
-
onSearchClear:
|
|
415
|
-
searchInputRef:
|
|
416
|
-
dropdownOptions:
|
|
417
|
-
onSearchKeyDown:
|
|
418
|
-
createOptionKeyHandler:
|
|
419
|
-
navigateNext:
|
|
418
|
+
onSearchClear: H,
|
|
419
|
+
searchInputRef: R,
|
|
420
|
+
dropdownOptions: b,
|
|
421
|
+
onSearchKeyDown: P,
|
|
422
|
+
createOptionKeyHandler: $,
|
|
423
|
+
navigateNext: F,
|
|
420
424
|
navigatePrev: z,
|
|
421
|
-
optionsContainerRef:
|
|
422
|
-
isLoading:
|
|
423
|
-
emptyMessage:
|
|
425
|
+
optionsContainerRef: L,
|
|
426
|
+
isLoading: _,
|
|
427
|
+
emptyMessage: k,
|
|
424
428
|
disabled: h,
|
|
425
429
|
size: d,
|
|
426
430
|
dropdownClassName: C,
|
|
427
431
|
label: m
|
|
428
432
|
}) {
|
|
429
|
-
const y =
|
|
430
|
-
|
|
433
|
+
const y = T.trim().length > 0, u = b?.maxHeight ?? (r === "drawer" ? "auto" : nt), G = D(
|
|
434
|
+
(X) => {
|
|
435
|
+
if (!b?.hasMore || b?.isLoadingMore) return;
|
|
436
|
+
const { scrollHeight: A, scrollTop: q, clientHeight: B } = X.currentTarget;
|
|
437
|
+
A - q - B < it && b.onEndReached?.();
|
|
438
|
+
},
|
|
439
|
+
[b]
|
|
440
|
+
);
|
|
441
|
+
return /* @__PURE__ */ a.jsxs(
|
|
431
442
|
he,
|
|
432
443
|
{
|
|
433
444
|
ref: e,
|
|
@@ -436,7 +447,7 @@ function ft({
|
|
|
436
447
|
variant: r,
|
|
437
448
|
matchTriggerWidth: r === "list",
|
|
438
449
|
placement: "bottom-start",
|
|
439
|
-
attachToParent:
|
|
450
|
+
attachToParent: o,
|
|
440
451
|
closeOnScroll: !1,
|
|
441
452
|
scrollTriggerWhenCovered: r === "list",
|
|
442
453
|
autoFocus: !1,
|
|
@@ -446,98 +457,102 @@ function ft({
|
|
|
446
457
|
snapPoints: r === "drawer" ? ["60%", "90%"] : void 0,
|
|
447
458
|
className: C,
|
|
448
459
|
children: [
|
|
449
|
-
!
|
|
460
|
+
!b?.hideSearchBar && /* @__PURE__ */ a.jsx(he.Header, { className: V(r === "drawer" && "px-3"), children: /* @__PURE__ */ a.jsx(
|
|
450
461
|
st,
|
|
451
462
|
{
|
|
452
|
-
ref:
|
|
453
|
-
value:
|
|
454
|
-
onClear:
|
|
455
|
-
onKeyDown:
|
|
456
|
-
placeholder:
|
|
457
|
-
...
|
|
463
|
+
ref: R,
|
|
464
|
+
value: T,
|
|
465
|
+
onClear: H,
|
|
466
|
+
onKeyDown: P,
|
|
467
|
+
placeholder: b?.searchPlaceholder ?? "Buscar opciones",
|
|
468
|
+
...b?.inputProps,
|
|
458
469
|
onChange: M
|
|
459
470
|
}
|
|
460
471
|
) }),
|
|
461
|
-
/* @__PURE__ */
|
|
472
|
+
/* @__PURE__ */ a.jsx(he.Content, { className: V("overflow-y-hidden!", r === "drawer" && "px-3"), children: /* @__PURE__ */ a.jsx(
|
|
462
473
|
"div",
|
|
463
474
|
{
|
|
464
|
-
ref:
|
|
475
|
+
ref: L,
|
|
465
476
|
role: "listbox",
|
|
466
477
|
"aria-label": m,
|
|
467
478
|
"aria-multiselectable": f,
|
|
468
|
-
className:
|
|
479
|
+
className: V(
|
|
469
480
|
"overflow-y-auto w-full min-h-0 flex-1",
|
|
470
|
-
|
|
481
|
+
b?.optionContainerClassName
|
|
471
482
|
),
|
|
472
483
|
style: u === "auto" ? void 0 : { maxHeight: u },
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
484
|
+
onScroll: G,
|
|
485
|
+
children: _ ? /* @__PURE__ */ a.jsx(ot, { loadingComponent: b?.loadingComponent }) : /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
486
|
+
/* @__PURE__ */ a.jsx(
|
|
487
|
+
dt,
|
|
488
|
+
{
|
|
489
|
+
filteredOptions: c,
|
|
490
|
+
emptyMessage: k,
|
|
491
|
+
optionLabel: l,
|
|
492
|
+
optionValue: j,
|
|
493
|
+
optionActive: w,
|
|
494
|
+
selectedIds: s,
|
|
495
|
+
multiple: f,
|
|
496
|
+
disabled: h,
|
|
497
|
+
size: d,
|
|
498
|
+
dropdownOptions: b,
|
|
499
|
+
renderOption: I,
|
|
500
|
+
renderOptionGroupHeader: i,
|
|
501
|
+
renderOptionContext: p,
|
|
502
|
+
onSelect: E,
|
|
503
|
+
onSelectGroup: g,
|
|
504
|
+
closeDropdown: N,
|
|
505
|
+
createOptionKeyHandler: $,
|
|
506
|
+
navigateNext: F,
|
|
507
|
+
navigatePrev: z,
|
|
508
|
+
hasActiveSearch: y
|
|
509
|
+
}
|
|
510
|
+
),
|
|
511
|
+
b?.isLoadingMore && /* @__PURE__ */ a.jsx(lt, {})
|
|
512
|
+
] })
|
|
498
513
|
}
|
|
499
514
|
) }),
|
|
500
|
-
|
|
515
|
+
b?.footer && /* @__PURE__ */ a.jsx(he.Footer, { children: b.footer })
|
|
501
516
|
]
|
|
502
517
|
}
|
|
503
518
|
);
|
|
504
519
|
}
|
|
505
|
-
const
|
|
520
|
+
const ht = pe(function({
|
|
506
521
|
chipItems: t,
|
|
507
522
|
selectedCount: n,
|
|
508
523
|
displayMode: r,
|
|
509
|
-
overflow:
|
|
524
|
+
overflow: o,
|
|
510
525
|
disabled: c,
|
|
511
526
|
placeholder: s,
|
|
512
527
|
onRemoveOption: l,
|
|
513
|
-
onRemoveGroup:
|
|
528
|
+
onRemoveGroup: j,
|
|
514
529
|
resolveOptionId: w
|
|
515
530
|
}) {
|
|
516
|
-
return n === 0 ? s ? /* @__PURE__ */
|
|
531
|
+
return n === 0 ? s ? /* @__PURE__ */ a.jsx("span", { className: "text-neutral-tertiary-default pyrion-fonts-body-medium line-clamp-1 truncate", children: s }) : null : r === "compact" ? /* @__PURE__ */ a.jsxs("span", { className: "line-clamp-1 truncate", children: [
|
|
517
532
|
n,
|
|
518
533
|
" seleccionados"
|
|
519
|
-
] }) : /* @__PURE__ */
|
|
534
|
+
] }) : /* @__PURE__ */ a.jsx(
|
|
520
535
|
"div",
|
|
521
536
|
{
|
|
522
|
-
className:
|
|
537
|
+
className: V(
|
|
523
538
|
"flex gap-1",
|
|
524
|
-
|
|
539
|
+
o === "wrap" ? "flex-wrap" : "flex-nowrap"
|
|
525
540
|
),
|
|
526
541
|
children: t.map(
|
|
527
|
-
(f) => f.type === "group" ? /* @__PURE__ */
|
|
528
|
-
|
|
542
|
+
(f) => f.type === "group" ? /* @__PURE__ */ a.jsx(
|
|
543
|
+
we,
|
|
529
544
|
{
|
|
530
545
|
label: `${f.groupLabel} (${f.count})`,
|
|
531
546
|
disabled: c,
|
|
532
547
|
trailingIcon: ye,
|
|
533
548
|
onTrailingIconClick: () => {
|
|
534
|
-
|
|
549
|
+
j(f.options.map(w));
|
|
535
550
|
},
|
|
536
551
|
isSelected: !0
|
|
537
552
|
},
|
|
538
553
|
`group-${f.groupId}`
|
|
539
|
-
) : /* @__PURE__ */
|
|
540
|
-
|
|
554
|
+
) : /* @__PURE__ */ a.jsx(
|
|
555
|
+
we,
|
|
541
556
|
{
|
|
542
557
|
label: f.label,
|
|
543
558
|
disabled: c,
|
|
@@ -550,20 +565,20 @@ const dt = pe(function({
|
|
|
550
565
|
)
|
|
551
566
|
}
|
|
552
567
|
);
|
|
553
|
-
}),
|
|
568
|
+
}), pt = pe(function({
|
|
554
569
|
label: t,
|
|
555
570
|
placeholder: n
|
|
556
571
|
}) {
|
|
557
|
-
return t ? /* @__PURE__ */
|
|
572
|
+
return t ? /* @__PURE__ */ a.jsx("span", { className: "line-clamp-1 truncate", children: t }) : n ? /* @__PURE__ */ a.jsx("span", { className: "text-neutral-tertiary-default pyrion-fonts-body-medium line-clamp-1 truncate", children: n }) : null;
|
|
558
573
|
});
|
|
559
|
-
function
|
|
574
|
+
function mt({
|
|
560
575
|
isOpen: e,
|
|
561
576
|
disabled: t
|
|
562
577
|
}) {
|
|
563
|
-
return /* @__PURE__ */
|
|
578
|
+
return /* @__PURE__ */ a.jsx(
|
|
564
579
|
Ze,
|
|
565
580
|
{
|
|
566
|
-
className:
|
|
581
|
+
className: V(
|
|
567
582
|
"transition-transform duration-200 shrink-0",
|
|
568
583
|
e && "rotate-180",
|
|
569
584
|
t ? "text-disabled-default" : "text-neutral-secondary-default"
|
|
@@ -571,99 +586,99 @@ function ht({
|
|
|
571
586
|
}
|
|
572
587
|
);
|
|
573
588
|
}
|
|
574
|
-
const
|
|
589
|
+
const xt = Ie(function({
|
|
575
590
|
label: t,
|
|
576
591
|
size: n,
|
|
577
592
|
variant: r,
|
|
578
|
-
disabled:
|
|
593
|
+
disabled: o,
|
|
579
594
|
isLoading: c,
|
|
580
595
|
placeholder: s,
|
|
581
596
|
selectedOptions: l,
|
|
582
|
-
chipItems:
|
|
597
|
+
chipItems: j,
|
|
583
598
|
multiple: w,
|
|
584
599
|
displayMode: f,
|
|
585
|
-
overflow:
|
|
600
|
+
overflow: I,
|
|
586
601
|
optionLabel: i,
|
|
587
602
|
optionValue: p,
|
|
588
|
-
renderSelection:
|
|
603
|
+
renderSelection: E,
|
|
589
604
|
onRemoveOption: g,
|
|
590
605
|
onRemoveGroup: N,
|
|
591
|
-
onClear:
|
|
606
|
+
onClear: T,
|
|
592
607
|
onClick: M,
|
|
593
|
-
onFocus:
|
|
594
|
-
isOpen:
|
|
595
|
-
onKeyDown:
|
|
596
|
-
className:
|
|
597
|
-
containerClassName:
|
|
598
|
-
buttonClassName:
|
|
608
|
+
onFocus: H,
|
|
609
|
+
isOpen: R,
|
|
610
|
+
onKeyDown: b,
|
|
611
|
+
className: P,
|
|
612
|
+
containerClassName: $,
|
|
613
|
+
buttonClassName: F,
|
|
599
614
|
width: z,
|
|
600
|
-
height:
|
|
601
|
-
tabIndex:
|
|
602
|
-
helperComponent:
|
|
615
|
+
height: L,
|
|
616
|
+
tabIndex: _,
|
|
617
|
+
helperComponent: k,
|
|
603
618
|
errorComponent: h,
|
|
604
619
|
inputProps: d
|
|
605
620
|
}, C) {
|
|
606
|
-
const m = w && f === "chips" &&
|
|
621
|
+
const m = w && f === "chips" && I === "wrap", { bind: y, ref: u } = Qe({
|
|
607
622
|
axis: "x",
|
|
608
623
|
cursor: { idle: "default", dragging: "grabbing" },
|
|
609
|
-
disabled:
|
|
610
|
-
}),
|
|
611
|
-
(
|
|
612
|
-
if (
|
|
613
|
-
const
|
|
614
|
-
return /* @__PURE__ */
|
|
615
|
-
|
|
624
|
+
disabled: I !== "scroll" || !w || f !== "chips"
|
|
625
|
+
}), G = D(
|
|
626
|
+
(A) => {
|
|
627
|
+
if (E) {
|
|
628
|
+
const B = E;
|
|
629
|
+
return /* @__PURE__ */ a.jsx(
|
|
630
|
+
B,
|
|
616
631
|
{
|
|
617
632
|
selectedOptions: l,
|
|
618
633
|
placeholder: s,
|
|
619
634
|
multiple: w,
|
|
620
635
|
onRemoveOption: g,
|
|
621
|
-
disabled:
|
|
636
|
+
disabled: A.disabled
|
|
622
637
|
}
|
|
623
638
|
);
|
|
624
639
|
}
|
|
625
640
|
if (!w) {
|
|
626
|
-
const
|
|
627
|
-
return /* @__PURE__ */
|
|
628
|
-
|
|
641
|
+
const B = l[0] ? S(l[0], i) : void 0;
|
|
642
|
+
return /* @__PURE__ */ a.jsx(
|
|
643
|
+
pt,
|
|
629
644
|
{
|
|
630
|
-
label:
|
|
645
|
+
label: B,
|
|
631
646
|
placeholder: s,
|
|
632
|
-
disabled:
|
|
647
|
+
disabled: A.disabled
|
|
633
648
|
}
|
|
634
649
|
);
|
|
635
650
|
}
|
|
636
|
-
const
|
|
637
|
-
|
|
651
|
+
const q = /* @__PURE__ */ a.jsx(
|
|
652
|
+
ht,
|
|
638
653
|
{
|
|
639
|
-
chipItems:
|
|
654
|
+
chipItems: j,
|
|
640
655
|
selectedCount: l.length,
|
|
641
656
|
displayMode: f,
|
|
642
|
-
overflow:
|
|
643
|
-
disabled:
|
|
657
|
+
overflow: I,
|
|
658
|
+
disabled: A.disabled,
|
|
644
659
|
placeholder: s,
|
|
645
660
|
onRemoveOption: g,
|
|
646
661
|
onRemoveGroup: N,
|
|
647
|
-
resolveOptionId: (
|
|
662
|
+
resolveOptionId: (B) => S(B, p)
|
|
648
663
|
}
|
|
649
664
|
);
|
|
650
|
-
return
|
|
665
|
+
return I === "scroll" && f === "chips" ? /* @__PURE__ */ a.jsx(
|
|
651
666
|
"div",
|
|
652
667
|
{
|
|
653
668
|
ref: u,
|
|
654
669
|
...y,
|
|
655
670
|
className: "flex overflow-x-auto pyrion-scrollbar-none w-full",
|
|
656
|
-
children:
|
|
671
|
+
children: q
|
|
657
672
|
}
|
|
658
|
-
) :
|
|
673
|
+
) : q;
|
|
659
674
|
},
|
|
660
675
|
[
|
|
661
|
-
|
|
676
|
+
E,
|
|
662
677
|
l,
|
|
663
|
-
|
|
678
|
+
j,
|
|
664
679
|
w,
|
|
665
680
|
f,
|
|
666
|
-
|
|
681
|
+
I,
|
|
667
682
|
s,
|
|
668
683
|
g,
|
|
669
684
|
i,
|
|
@@ -671,58 +686,58 @@ const pt = Oe(function({
|
|
|
671
686
|
y,
|
|
672
687
|
u
|
|
673
688
|
]
|
|
674
|
-
),
|
|
675
|
-
(
|
|
676
|
-
c && /* @__PURE__ */
|
|
677
|
-
|
|
678
|
-
|
|
689
|
+
), X = D(
|
|
690
|
+
(A) => /* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
691
|
+
c && /* @__PURE__ */ a.jsx(Re, { size: "small", variant: "sync", className: "opacity-90" }),
|
|
692
|
+
T && l.length > 0 && /* @__PURE__ */ a.jsx(
|
|
693
|
+
Ye,
|
|
679
694
|
{
|
|
680
695
|
icon: ye,
|
|
681
696
|
size: "small",
|
|
682
697
|
variant: "text",
|
|
683
698
|
color: "neutral",
|
|
684
699
|
tabIndex: -1,
|
|
685
|
-
onClick: (
|
|
686
|
-
|
|
700
|
+
onClick: (q) => {
|
|
701
|
+
q.stopPropagation(), T();
|
|
687
702
|
},
|
|
688
|
-
disabled:
|
|
703
|
+
disabled: o,
|
|
689
704
|
"aria-label": "Clear selection"
|
|
690
705
|
}
|
|
691
706
|
),
|
|
692
|
-
/* @__PURE__ */
|
|
707
|
+
/* @__PURE__ */ a.jsx(mt, { isOpen: R, disabled: o })
|
|
693
708
|
] }),
|
|
694
|
-
[c,
|
|
709
|
+
[c, T, l.length, o, R]
|
|
695
710
|
);
|
|
696
|
-
return /* @__PURE__ */
|
|
711
|
+
return /* @__PURE__ */ a.jsx(
|
|
697
712
|
"div",
|
|
698
713
|
{
|
|
699
714
|
ref: C,
|
|
700
715
|
role: "combobox",
|
|
701
|
-
"aria-expanded":
|
|
716
|
+
"aria-expanded": R,
|
|
702
717
|
"aria-haspopup": "listbox",
|
|
703
|
-
tabIndex:
|
|
704
|
-
onClick: (
|
|
705
|
-
|
|
718
|
+
tabIndex: _ ?? 0,
|
|
719
|
+
onClick: (A) => {
|
|
720
|
+
A.preventDefault(), o || M();
|
|
706
721
|
},
|
|
707
|
-
onFocus:
|
|
708
|
-
onKeyDown:
|
|
709
|
-
className:
|
|
710
|
-
style: z ? { width: z } :
|
|
711
|
-
children: /* @__PURE__ */
|
|
712
|
-
|
|
722
|
+
onFocus: H,
|
|
723
|
+
onKeyDown: b,
|
|
724
|
+
className: V("w-full outline-none", $, F),
|
|
725
|
+
style: z ? { width: z } : L ? { height: L } : void 0,
|
|
726
|
+
children: /* @__PURE__ */ a.jsx(
|
|
727
|
+
Oe,
|
|
713
728
|
{
|
|
714
729
|
...d,
|
|
715
730
|
label: t,
|
|
716
731
|
size: n,
|
|
717
732
|
state: r,
|
|
718
|
-
disabled:
|
|
733
|
+
disabled: o,
|
|
719
734
|
readOnly: !0,
|
|
720
735
|
hideClearButton: !0,
|
|
721
736
|
flexibleHeight: m,
|
|
722
|
-
className:
|
|
723
|
-
renderValue:
|
|
724
|
-
slotActions:
|
|
725
|
-
helperComponent:
|
|
737
|
+
className: V(d?.className, P),
|
|
738
|
+
renderValue: G,
|
|
739
|
+
slotActions: X,
|
|
740
|
+
helperComponent: k,
|
|
726
741
|
errorComponent: h,
|
|
727
742
|
value: ""
|
|
728
743
|
}
|
|
@@ -730,40 +745,40 @@ const pt = Oe(function({
|
|
|
730
745
|
}
|
|
731
746
|
);
|
|
732
747
|
});
|
|
733
|
-
function
|
|
748
|
+
function St(e) {
|
|
734
749
|
if (!e) return [];
|
|
735
750
|
const t = e.querySelectorAll(
|
|
736
751
|
'[role="option"]:not([aria-disabled="true"]), [data-group-header]'
|
|
737
752
|
);
|
|
738
753
|
return Array.from(t).filter((n) => !n.closest("[inert]"));
|
|
739
754
|
}
|
|
740
|
-
function
|
|
755
|
+
function vt(e, t) {
|
|
741
756
|
const n = t.getBoundingClientRect(), r = e.getBoundingClientRect();
|
|
742
757
|
r.bottom > n.bottom ? t.scrollTop += r.bottom - n.bottom : r.top < n.top && (t.scrollTop -= n.top - r.top);
|
|
743
758
|
}
|
|
744
|
-
function
|
|
759
|
+
function yt({
|
|
745
760
|
menuRef: e,
|
|
746
761
|
searchInputRef: t,
|
|
747
762
|
optionsContainerRef: n,
|
|
748
763
|
onSelect: r
|
|
749
764
|
}) {
|
|
750
|
-
const
|
|
765
|
+
const o = Q(-1), c = D(
|
|
751
766
|
(i) => {
|
|
752
767
|
const p = n.current;
|
|
753
768
|
if (!p) return !1;
|
|
754
|
-
const g =
|
|
755
|
-
return g ? (g.focus(),
|
|
769
|
+
const g = St(p)[i];
|
|
770
|
+
return g ? (g.focus(), vt(g, p), o.current = i, !0) : !1;
|
|
756
771
|
},
|
|
757
772
|
[n]
|
|
758
|
-
), s =
|
|
759
|
-
const i =
|
|
760
|
-
return i < 0 ? (
|
|
761
|
-
}, [c, t]),
|
|
773
|
+
), s = D(() => c(o.current + 1), [c]), l = D(() => {
|
|
774
|
+
const i = o.current - 1;
|
|
775
|
+
return i < 0 ? (o.current = -1, t.current?.focus(), !0) : c(i);
|
|
776
|
+
}, [c, t]), j = D(
|
|
762
777
|
(i) => {
|
|
763
778
|
(i.key === " " || i.key === "ArrowDown" || i.key === "Enter") && (i.preventDefault(), e.current?.open());
|
|
764
779
|
},
|
|
765
780
|
[e]
|
|
766
|
-
), w =
|
|
781
|
+
), w = D(
|
|
767
782
|
(i) => {
|
|
768
783
|
switch (i.key) {
|
|
769
784
|
case "ArrowDown": {
|
|
@@ -780,7 +795,7 @@ function St({
|
|
|
780
795
|
}
|
|
781
796
|
},
|
|
782
797
|
[c, e]
|
|
783
|
-
), f =
|
|
798
|
+
), f = D(
|
|
784
799
|
(i) => (p) => {
|
|
785
800
|
switch (p.key) {
|
|
786
801
|
case "ArrowDown": {
|
|
@@ -804,108 +819,108 @@ function St({
|
|
|
804
819
|
}
|
|
805
820
|
},
|
|
806
821
|
[s, l, r, e]
|
|
807
|
-
),
|
|
808
|
-
|
|
822
|
+
), I = D(() => {
|
|
823
|
+
o.current = -1;
|
|
809
824
|
}, []);
|
|
810
825
|
return {
|
|
811
|
-
handleTriggerKeyDown:
|
|
826
|
+
handleTriggerKeyDown: j,
|
|
812
827
|
handleSearchKeyDown: w,
|
|
813
828
|
createOptionKeyHandler: f,
|
|
814
829
|
navigateNext: s,
|
|
815
830
|
navigatePrev: l,
|
|
816
|
-
resetFocus:
|
|
831
|
+
resetFocus: I
|
|
817
832
|
};
|
|
818
833
|
}
|
|
819
|
-
function
|
|
820
|
-
return t.trim() ? e.reduce((r,
|
|
821
|
-
const c =
|
|
834
|
+
function Ct(e, t, n) {
|
|
835
|
+
return t.trim() ? e.reduce((r, o) => {
|
|
836
|
+
const c = o.options;
|
|
822
837
|
if (c?.length) {
|
|
823
838
|
const s = c.filter(
|
|
824
|
-
(l) =>
|
|
839
|
+
(l) => je(S(l, n), t)
|
|
825
840
|
);
|
|
826
|
-
return s.length === 0 || r.push({ ...
|
|
841
|
+
return s.length === 0 || r.push({ ...o, options: s }), r;
|
|
827
842
|
}
|
|
828
|
-
return
|
|
843
|
+
return je(S(o, n), t) && r.push(o), r;
|
|
829
844
|
}, []) : e;
|
|
830
845
|
}
|
|
831
|
-
function
|
|
846
|
+
function bt({
|
|
832
847
|
options: e,
|
|
833
848
|
optionLabel: t,
|
|
834
849
|
dropdownOptions: n
|
|
835
850
|
}) {
|
|
836
|
-
const [r,
|
|
837
|
-
() =>
|
|
851
|
+
const [r, o] = Te(""), c = n?.controlledSearchValue != null, s = c ? n.controlledSearchValue : r, l = Z(
|
|
852
|
+
() => Ct(e, s, t),
|
|
838
853
|
[e, s, t]
|
|
839
|
-
),
|
|
840
|
-
(
|
|
854
|
+
), j = D(
|
|
855
|
+
(I) => {
|
|
841
856
|
if (c) {
|
|
842
|
-
n?.onSearchValueChange?.(
|
|
857
|
+
n?.onSearchValueChange?.(I);
|
|
843
858
|
return;
|
|
844
859
|
}
|
|
845
|
-
|
|
860
|
+
o(I), n?.onSearchValueChange?.(I);
|
|
846
861
|
},
|
|
847
862
|
[c, n?.onSearchValueChange]
|
|
848
|
-
), w =
|
|
863
|
+
), w = D(() => {
|
|
849
864
|
if (c) {
|
|
850
865
|
n?.onSearchClear?.();
|
|
851
866
|
return;
|
|
852
867
|
}
|
|
853
|
-
|
|
854
|
-
}, [c, n?.onSearchClear]), f =
|
|
855
|
-
c ||
|
|
868
|
+
o(""), n?.onSearchClear?.();
|
|
869
|
+
}, [c, n?.onSearchClear]), f = D(() => {
|
|
870
|
+
c || o("");
|
|
856
871
|
}, [c]);
|
|
857
872
|
return {
|
|
858
873
|
searchValue: s,
|
|
859
874
|
filteredOptions: l,
|
|
860
875
|
isControlledSearch: c,
|
|
861
|
-
handleSearchChange:
|
|
876
|
+
handleSearchChange: j,
|
|
862
877
|
handleSearchClear: w,
|
|
863
878
|
resetSearch: f
|
|
864
879
|
};
|
|
865
880
|
}
|
|
866
|
-
function
|
|
881
|
+
function jt({
|
|
867
882
|
options: e,
|
|
868
883
|
value: t,
|
|
869
884
|
defaultValue: n,
|
|
870
885
|
isControlled: r,
|
|
871
|
-
multiple:
|
|
886
|
+
multiple: o,
|
|
872
887
|
optionLabel: c,
|
|
873
888
|
optionValue: s,
|
|
874
889
|
optionActive: l,
|
|
875
|
-
groupSelection:
|
|
890
|
+
groupSelection: j,
|
|
876
891
|
onChange: w,
|
|
877
892
|
onOptionClick: f,
|
|
878
|
-
onRemoveOption:
|
|
893
|
+
onRemoveOption: I,
|
|
879
894
|
name: i
|
|
880
895
|
}) {
|
|
881
|
-
const p =
|
|
896
|
+
const p = Q(
|
|
882
897
|
w
|
|
883
898
|
);
|
|
884
899
|
p.current = w;
|
|
885
|
-
const [
|
|
900
|
+
const [E, g] = Te(() => {
|
|
886
901
|
if (!r)
|
|
887
|
-
return n ?? (
|
|
888
|
-
}), N = r ? t :
|
|
889
|
-
() =>
|
|
890
|
-
[
|
|
891
|
-
),
|
|
902
|
+
return n ?? (o ? [] : void 0);
|
|
903
|
+
}), N = r ? t : E, T = Z(() => Ee(e), [e]), M = Z(
|
|
904
|
+
() => T.map((h) => re(h, c, s)),
|
|
905
|
+
[T, c, s]
|
|
906
|
+
), H = Z(() => {
|
|
892
907
|
if (N == null || N === "") return [];
|
|
893
908
|
const h = Array.isArray(N) ? N : [N], d = new Map(
|
|
894
|
-
|
|
909
|
+
T.map((C) => [
|
|
895
910
|
S(C, s),
|
|
896
911
|
C
|
|
897
912
|
])
|
|
898
913
|
);
|
|
899
914
|
return h.map((C) => d.get(C)).filter((C) => C != null);
|
|
900
|
-
}, [
|
|
901
|
-
() => new Set(
|
|
902
|
-
[
|
|
903
|
-
),
|
|
904
|
-
|
|
905
|
-
const
|
|
906
|
-
if (!
|
|
907
|
-
if (!
|
|
908
|
-
return
|
|
915
|
+
}, [T, N, s]), R = Z(
|
|
916
|
+
() => new Set(H.map((h) => S(h, s))),
|
|
917
|
+
[H, s]
|
|
918
|
+
), b = Q(H);
|
|
919
|
+
b.current = H;
|
|
920
|
+
const P = Z(() => {
|
|
921
|
+
if (!o) return [];
|
|
922
|
+
if (!j)
|
|
923
|
+
return H.map((m) => ({
|
|
909
924
|
type: "option",
|
|
910
925
|
option: m,
|
|
911
926
|
id: S(m, s),
|
|
@@ -914,25 +929,25 @@ function Ct({
|
|
|
914
929
|
const h = rt(e), d = [];
|
|
915
930
|
for (const m of h) {
|
|
916
931
|
const u = (m.options ?? []).filter(
|
|
917
|
-
(
|
|
918
|
-
),
|
|
919
|
-
(
|
|
932
|
+
(A) => ae(A, l)
|
|
933
|
+
), G = u.filter(
|
|
934
|
+
(A) => R.has(S(A, s))
|
|
920
935
|
);
|
|
921
|
-
if (u.length > 0 &&
|
|
936
|
+
if (u.length > 0 && G.length === u.length)
|
|
922
937
|
d.push({
|
|
923
938
|
type: "group",
|
|
924
939
|
groupLabel: S(m, c),
|
|
925
|
-
count:
|
|
940
|
+
count: G.length,
|
|
926
941
|
groupId: S(m, s),
|
|
927
|
-
options:
|
|
942
|
+
options: G
|
|
928
943
|
});
|
|
929
944
|
else
|
|
930
|
-
for (const
|
|
945
|
+
for (const A of G)
|
|
931
946
|
d.push({
|
|
932
947
|
type: "option",
|
|
933
|
-
option:
|
|
934
|
-
id: S(
|
|
935
|
-
label: S(
|
|
948
|
+
option: A,
|
|
949
|
+
id: S(A, s),
|
|
950
|
+
label: S(A, c)
|
|
936
951
|
});
|
|
937
952
|
}
|
|
938
953
|
const C = new Set(
|
|
@@ -942,7 +957,7 @@ function Ct({
|
|
|
942
957
|
)
|
|
943
958
|
)
|
|
944
959
|
);
|
|
945
|
-
for (const m of
|
|
960
|
+
for (const m of H) {
|
|
946
961
|
const y = S(m, s);
|
|
947
962
|
C.has(y) || d.push({
|
|
948
963
|
type: "option",
|
|
@@ -954,36 +969,36 @@ function Ct({
|
|
|
954
969
|
return d;
|
|
955
970
|
}, [
|
|
956
971
|
e,
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
972
|
+
R,
|
|
973
|
+
H,
|
|
974
|
+
o,
|
|
975
|
+
j,
|
|
961
976
|
c,
|
|
962
977
|
s,
|
|
963
978
|
l
|
|
964
|
-
]),
|
|
979
|
+
]), $ = D(
|
|
965
980
|
(h) => {
|
|
966
981
|
const d = M.find((u) => u.id === h);
|
|
967
982
|
if (!d) return;
|
|
968
|
-
if (f?.(d, i), !
|
|
983
|
+
if (f?.(d, i), !o) {
|
|
969
984
|
r || g(d.id), p.current?.(d, i);
|
|
970
985
|
return;
|
|
971
986
|
}
|
|
972
|
-
const C =
|
|
987
|
+
const C = b.current.map(
|
|
973
988
|
(u) => re(u, c, s)
|
|
974
989
|
), y = C.some((u) => u.id === h) ? C.filter((u) => u.id !== h) : [...C, d];
|
|
975
990
|
r || g(y.map((u) => u.id)), p.current?.(y, i);
|
|
976
991
|
},
|
|
977
992
|
[
|
|
978
993
|
M,
|
|
979
|
-
|
|
994
|
+
o,
|
|
980
995
|
r,
|
|
981
996
|
f,
|
|
982
997
|
i,
|
|
983
998
|
c,
|
|
984
999
|
s
|
|
985
1000
|
]
|
|
986
|
-
),
|
|
1001
|
+
), F = D(
|
|
987
1002
|
(h, d) => {
|
|
988
1003
|
const C = e.find(
|
|
989
1004
|
(x) => S(x, s) === h
|
|
@@ -997,26 +1012,26 @@ function Ct({
|
|
|
997
1012
|
if (y.length === 0) return;
|
|
998
1013
|
const u = y.map(
|
|
999
1014
|
(x) => re(x, c, s)
|
|
1000
|
-
),
|
|
1015
|
+
), G = b.current.map(
|
|
1001
1016
|
(x) => re(x, c, s)
|
|
1002
1017
|
);
|
|
1003
|
-
if (!
|
|
1018
|
+
if (!o) {
|
|
1004
1019
|
const x = u[0];
|
|
1005
1020
|
if (!x) return;
|
|
1006
|
-
const ee =
|
|
1021
|
+
const ee = G.some((J) => J.id === x.id), ue = d ?? "toggle", U = ue === "select" || ue === "toggle" && !ee;
|
|
1007
1022
|
r || g(U ? x.id : void 0), p.current?.(U ? x : void 0, i);
|
|
1008
1023
|
return;
|
|
1009
1024
|
}
|
|
1010
|
-
const
|
|
1011
|
-
(x) =>
|
|
1012
|
-
),
|
|
1013
|
-
if (!(
|
|
1014
|
-
const x =
|
|
1025
|
+
const X = new Set(G.map((x) => x.id)), A = new Set(u.map((x) => x.id)), q = u.every(
|
|
1026
|
+
(x) => X.has(x.id)
|
|
1027
|
+
), B = d ?? "toggle";
|
|
1028
|
+
if (!(B === "select" || B === "toggle" && !q)) {
|
|
1029
|
+
const x = G.filter((ee) => !A.has(ee.id));
|
|
1015
1030
|
r || g(x.map((ee) => ee.id)), p.current?.(x, i);
|
|
1016
1031
|
return;
|
|
1017
1032
|
}
|
|
1018
1033
|
const ie = new Map(
|
|
1019
|
-
|
|
1034
|
+
G.map((x) => [x.id, x])
|
|
1020
1035
|
);
|
|
1021
1036
|
u.forEach((x) => {
|
|
1022
1037
|
ie.set(x.id, x);
|
|
@@ -1028,49 +1043,49 @@ function Ct({
|
|
|
1028
1043
|
e,
|
|
1029
1044
|
s,
|
|
1030
1045
|
l,
|
|
1031
|
-
|
|
1046
|
+
o,
|
|
1032
1047
|
r,
|
|
1033
1048
|
c,
|
|
1034
1049
|
i
|
|
1035
1050
|
]
|
|
1036
|
-
), z =
|
|
1051
|
+
), z = D(
|
|
1037
1052
|
(h) => {
|
|
1038
|
-
const d =
|
|
1053
|
+
const d = T.find(
|
|
1039
1054
|
(u) => S(u, s) === h
|
|
1040
1055
|
);
|
|
1041
1056
|
if (!d) return;
|
|
1042
1057
|
const C = re(d, c, s);
|
|
1043
|
-
if (f?.(C, i),
|
|
1058
|
+
if (f?.(C, i), I?.(d), !o) {
|
|
1044
1059
|
r || g(void 0), p.current?.(void 0, i);
|
|
1045
1060
|
return;
|
|
1046
1061
|
}
|
|
1047
|
-
const y =
|
|
1062
|
+
const y = b.current.map(
|
|
1048
1063
|
(u) => re(u, c, s)
|
|
1049
1064
|
).filter((u) => u.id !== h);
|
|
1050
1065
|
r || g(y.map((u) => u.id)), p.current?.(y, i);
|
|
1051
1066
|
},
|
|
1052
1067
|
[
|
|
1053
|
-
|
|
1068
|
+
T,
|
|
1054
1069
|
s,
|
|
1055
1070
|
c,
|
|
1056
1071
|
f,
|
|
1057
|
-
|
|
1072
|
+
I,
|
|
1058
1073
|
i,
|
|
1059
|
-
|
|
1074
|
+
o,
|
|
1060
1075
|
r
|
|
1061
1076
|
]
|
|
1062
|
-
),
|
|
1077
|
+
), L = D(
|
|
1063
1078
|
(h) => {
|
|
1064
|
-
if (!
|
|
1065
|
-
const d = new Set(h), m =
|
|
1079
|
+
if (!o) return;
|
|
1080
|
+
const d = new Set(h), m = b.current.map(
|
|
1066
1081
|
(y) => re(y, c, s)
|
|
1067
1082
|
).filter((y) => !d.has(y.id));
|
|
1068
1083
|
r || g(m.map((y) => y.id)), p.current?.(m, i);
|
|
1069
1084
|
},
|
|
1070
|
-
[
|
|
1071
|
-
),
|
|
1072
|
-
r || g(
|
|
1073
|
-
}, [r,
|
|
1085
|
+
[o, r, c, s, i]
|
|
1086
|
+
), _ = D(() => {
|
|
1087
|
+
r || g(o ? [] : void 0), p.current?.(o ? [] : void 0, i);
|
|
1088
|
+
}, [r, o, i]), k = D(
|
|
1074
1089
|
(h) => {
|
|
1075
1090
|
r || g(h);
|
|
1076
1091
|
const d = M.find((C) => C.id === h);
|
|
@@ -1079,21 +1094,21 @@ function Ct({
|
|
|
1079
1094
|
[r, M, i]
|
|
1080
1095
|
);
|
|
1081
1096
|
return {
|
|
1082
|
-
flatOptions:
|
|
1097
|
+
flatOptions: T,
|
|
1083
1098
|
sanitizedOptions: M,
|
|
1084
|
-
selectedOptions:
|
|
1085
|
-
selectedIds:
|
|
1086
|
-
chipItems:
|
|
1087
|
-
toggleOption:
|
|
1088
|
-
selectGroup:
|
|
1099
|
+
selectedOptions: H,
|
|
1100
|
+
selectedIds: R,
|
|
1101
|
+
chipItems: P,
|
|
1102
|
+
toggleOption: $,
|
|
1103
|
+
selectGroup: F,
|
|
1089
1104
|
removeOption: z,
|
|
1090
|
-
removeOptions:
|
|
1091
|
-
clearSelection:
|
|
1092
|
-
selectByValue:
|
|
1105
|
+
removeOptions: L,
|
|
1106
|
+
clearSelection: _,
|
|
1107
|
+
selectByValue: k
|
|
1093
1108
|
};
|
|
1094
1109
|
}
|
|
1095
|
-
function
|
|
1096
|
-
const t =
|
|
1110
|
+
function Dt(e) {
|
|
1111
|
+
const t = Q({
|
|
1097
1112
|
renderOptionContext: !1,
|
|
1098
1113
|
attachToParent: !1,
|
|
1099
1114
|
onOptionClick: !1
|
|
@@ -1123,119 +1138,119 @@ function wt(e, t) {
|
|
|
1123
1138
|
});
|
|
1124
1139
|
});
|
|
1125
1140
|
}
|
|
1126
|
-
function
|
|
1141
|
+
function Lt(e) {
|
|
1127
1142
|
const t = "value" in e, n = t ? e.value : void 0, r = t ? void 0 : e.defaultValue, {
|
|
1128
|
-
options:
|
|
1143
|
+
options: o,
|
|
1129
1144
|
multiple: c,
|
|
1130
1145
|
label: s,
|
|
1131
1146
|
variant: l = "default",
|
|
1132
|
-
size:
|
|
1147
|
+
size: j = "medium",
|
|
1133
1148
|
labelVariant: w = "default",
|
|
1134
1149
|
disabled: f = !1,
|
|
1135
|
-
isLoading:
|
|
1150
|
+
isLoading: I = !1,
|
|
1136
1151
|
displayMode: i = "compact",
|
|
1137
1152
|
overflow: p = "wrap",
|
|
1138
|
-
groupSelection:
|
|
1153
|
+
groupSelection: E,
|
|
1139
1154
|
optionLabel: g,
|
|
1140
1155
|
optionValue: N,
|
|
1141
|
-
optionActive:
|
|
1156
|
+
optionActive: T,
|
|
1142
1157
|
renderOption: M,
|
|
1143
|
-
renderOptionGroupHeader:
|
|
1144
|
-
renderSelection:
|
|
1145
|
-
renderOptionContext:
|
|
1146
|
-
dropdownOptions:
|
|
1147
|
-
onChange:
|
|
1148
|
-
onClose:
|
|
1158
|
+
renderOptionGroupHeader: H,
|
|
1159
|
+
renderSelection: R,
|
|
1160
|
+
renderOptionContext: b,
|
|
1161
|
+
dropdownOptions: P,
|
|
1162
|
+
onChange: $,
|
|
1163
|
+
onClose: F,
|
|
1149
1164
|
onClear: z,
|
|
1150
|
-
onRemoveOption:
|
|
1151
|
-
onOptionActivate:
|
|
1152
|
-
onOptionClick:
|
|
1165
|
+
onRemoveOption: L,
|
|
1166
|
+
onOptionActivate: _,
|
|
1167
|
+
onOptionClick: k,
|
|
1153
1168
|
controls: h,
|
|
1154
1169
|
disableOpenOnFocus: d,
|
|
1155
1170
|
emptyMessage: C = "No hay opciones disponibles",
|
|
1156
1171
|
placeholder: m,
|
|
1157
1172
|
helperComponent: y,
|
|
1158
1173
|
errorComponent: u,
|
|
1159
|
-
inputProps:
|
|
1160
|
-
className:
|
|
1161
|
-
containerClassName:
|
|
1162
|
-
buttonClassName:
|
|
1163
|
-
dropdownClassName:
|
|
1174
|
+
inputProps: G,
|
|
1175
|
+
className: X,
|
|
1176
|
+
containerClassName: A,
|
|
1177
|
+
buttonClassName: q,
|
|
1178
|
+
dropdownClassName: B,
|
|
1164
1179
|
width: oe,
|
|
1165
1180
|
height: ie,
|
|
1166
1181
|
tabIndex: le,
|
|
1167
1182
|
name: x,
|
|
1168
1183
|
id: ee
|
|
1169
1184
|
} = e;
|
|
1170
|
-
|
|
1171
|
-
const ue =
|
|
1172
|
-
() => ct(
|
|
1173
|
-
[
|
|
1174
|
-
), fe =
|
|
1175
|
-
options:
|
|
1185
|
+
Dt(e);
|
|
1186
|
+
const ue = _e(), U = e.mobileDropdown === "drawer" && ue ? "drawer" : "list", J = Z(
|
|
1187
|
+
() => ct(P),
|
|
1188
|
+
[P]
|
|
1189
|
+
), fe = Q(null), me = Q(null), xe = Q(!1), Se = Q(!1), O = $e(), te = Le(O.ref, U), K = jt({
|
|
1190
|
+
options: o,
|
|
1176
1191
|
value: n,
|
|
1177
1192
|
defaultValue: r,
|
|
1178
1193
|
isControlled: t,
|
|
1179
1194
|
multiple: !!c,
|
|
1180
1195
|
optionLabel: g,
|
|
1181
1196
|
optionValue: N,
|
|
1182
|
-
optionActive:
|
|
1183
|
-
groupSelection: c ?
|
|
1184
|
-
onChange:
|
|
1185
|
-
onOptionClick:
|
|
1186
|
-
onRemoveOption:
|
|
1197
|
+
optionActive: T,
|
|
1198
|
+
groupSelection: c ? E : void 0,
|
|
1199
|
+
onChange: $,
|
|
1200
|
+
onOptionClick: k,
|
|
1201
|
+
onRemoveOption: L,
|
|
1187
1202
|
name: x
|
|
1188
|
-
}), ne =
|
|
1189
|
-
options:
|
|
1203
|
+
}), ne = bt({
|
|
1204
|
+
options: o,
|
|
1190
1205
|
optionLabel: g,
|
|
1191
|
-
dropdownOptions:
|
|
1192
|
-
}), ve =
|
|
1193
|
-
(v,
|
|
1194
|
-
|
|
1206
|
+
dropdownOptions: J
|
|
1207
|
+
}), ve = D(
|
|
1208
|
+
(v, W) => {
|
|
1209
|
+
K.toggleOption(v), W !== !1 && (!c || W === !0) && O.close();
|
|
1195
1210
|
},
|
|
1196
|
-
[
|
|
1197
|
-
), Ce =
|
|
1198
|
-
(v,
|
|
1199
|
-
const ce =
|
|
1211
|
+
[K.toggleOption, c, O]
|
|
1212
|
+
), Ce = D(
|
|
1213
|
+
(v, W, de) => {
|
|
1214
|
+
const ce = K.flatOptions.find(
|
|
1200
1215
|
(ge) => S(ge, N) === v
|
|
1201
1216
|
);
|
|
1202
|
-
if (!(!ce || !ae(ce,
|
|
1203
|
-
if (!
|
|
1217
|
+
if (!(!ce || !ae(ce, T))) {
|
|
1218
|
+
if (!_) {
|
|
1204
1219
|
ve(v, de);
|
|
1205
1220
|
return;
|
|
1206
1221
|
}
|
|
1207
|
-
|
|
1222
|
+
_({
|
|
1208
1223
|
option: ce,
|
|
1209
1224
|
value: v,
|
|
1210
|
-
isSelected:
|
|
1225
|
+
isSelected: K.selectedIds.has(v),
|
|
1211
1226
|
multiple: !!c,
|
|
1212
|
-
source:
|
|
1227
|
+
source: W,
|
|
1213
1228
|
commit: () => ve(v),
|
|
1214
|
-
close: () =>
|
|
1229
|
+
close: () => O.close()
|
|
1215
1230
|
});
|
|
1216
1231
|
}
|
|
1217
1232
|
},
|
|
1218
1233
|
[
|
|
1219
|
-
|
|
1234
|
+
_,
|
|
1220
1235
|
N,
|
|
1221
|
-
|
|
1236
|
+
T,
|
|
1222
1237
|
c,
|
|
1223
1238
|
ve,
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1239
|
+
O,
|
|
1240
|
+
K.flatOptions,
|
|
1241
|
+
K.selectedIds
|
|
1227
1242
|
]
|
|
1228
|
-
),
|
|
1229
|
-
menuRef:
|
|
1243
|
+
), Y = yt({
|
|
1244
|
+
menuRef: O.ref,
|
|
1230
1245
|
searchInputRef: fe,
|
|
1231
1246
|
optionsContainerRef: me,
|
|
1232
1247
|
onSelect: (v) => Ce(v, "keyboard")
|
|
1233
1248
|
});
|
|
1234
|
-
se(() =>
|
|
1235
|
-
|
|
1236
|
-
}), [
|
|
1237
|
-
if (!(!te ||
|
|
1238
|
-
if (
|
|
1249
|
+
se(() => O.subscribeOpenChange((W) => {
|
|
1250
|
+
W || (xe.current = !0, ne.resetSearch(), Y.resetFocus(), F?.());
|
|
1251
|
+
}), [O, ne.resetSearch, Y.resetFocus, F]), se(() => {
|
|
1252
|
+
if (!(!te || J?.focusSearchInputOnOpen === !1)) {
|
|
1253
|
+
if (J?.hideSearchBar) {
|
|
1239
1254
|
me.current?.querySelector(
|
|
1240
1255
|
'[role="option"]'
|
|
1241
1256
|
)?.focus();
|
|
@@ -1245,19 +1260,19 @@ function Wt(e) {
|
|
|
1245
1260
|
}
|
|
1246
1261
|
}, [
|
|
1247
1262
|
te,
|
|
1248
|
-
|
|
1249
|
-
|
|
1263
|
+
J?.focusSearchInputOnOpen,
|
|
1264
|
+
J?.hideSearchBar
|
|
1250
1265
|
]);
|
|
1251
|
-
const
|
|
1252
|
-
Se.current = !0, !f && (U === "drawer" ?
|
|
1253
|
-
}, [f,
|
|
1266
|
+
const Me = D(() => {
|
|
1267
|
+
Se.current = !0, !f && (U === "drawer" ? O.toggle(void 0, "60%") : O.toggle());
|
|
1268
|
+
}, [f, O, U]), Ge = D(
|
|
1254
1269
|
(v) => {
|
|
1255
|
-
Se.current = !0, !(v.target !== v.currentTarget && (v.key === "Enter" || v.key === " ")) &&
|
|
1270
|
+
Se.current = !0, !(v.target !== v.currentTarget && (v.key === "Enter" || v.key === " ")) && Y.handleTriggerKeyDown(v);
|
|
1256
1271
|
},
|
|
1257
|
-
[
|
|
1258
|
-
),
|
|
1259
|
-
|
|
1260
|
-
}, [
|
|
1272
|
+
[Y.handleTriggerKeyDown]
|
|
1273
|
+
), Ke = D(() => {
|
|
1274
|
+
K.clearSelection(), z?.();
|
|
1275
|
+
}, [K.clearSelection, z]), Pe = D(
|
|
1261
1276
|
(v) => {
|
|
1262
1277
|
if (v.target !== v.currentTarget) return;
|
|
1263
1278
|
if (xe.current) {
|
|
@@ -1265,110 +1280,110 @@ function Wt(e) {
|
|
|
1265
1280
|
return;
|
|
1266
1281
|
}
|
|
1267
1282
|
if (!Se.current) return;
|
|
1268
|
-
v.target.matches(":focus-visible") && !d && !te && !f && (U === "drawer" ?
|
|
1283
|
+
v.target.matches(":focus-visible") && !d && !te && !f && (U === "drawer" ? O.open(void 0, "60%") : O.open());
|
|
1269
1284
|
},
|
|
1270
|
-
[d, te, f,
|
|
1285
|
+
[d, te, f, O, U]
|
|
1271
1286
|
);
|
|
1272
1287
|
se(() => {
|
|
1273
1288
|
if (!te || U !== "drawer") return;
|
|
1274
|
-
const v =
|
|
1289
|
+
const v = O.triggerRef.current;
|
|
1275
1290
|
if (!v) return;
|
|
1276
|
-
const
|
|
1291
|
+
const W = setTimeout(() => {
|
|
1277
1292
|
const de = window.innerHeight * 0.33, ce = v.getBoundingClientRect(), ge = ce.top + ce.height / 2;
|
|
1278
1293
|
if (ge > de) {
|
|
1279
|
-
const
|
|
1280
|
-
|
|
1294
|
+
const Be = Ue(v), Fe = ge - de;
|
|
1295
|
+
Be.scrollBy({ top: Fe, behavior: "smooth" });
|
|
1281
1296
|
}
|
|
1282
1297
|
}, 250);
|
|
1283
|
-
return () => clearTimeout(
|
|
1284
|
-
}, [te, U,
|
|
1285
|
-
menu:
|
|
1286
|
-
selectState:
|
|
1298
|
+
return () => clearTimeout(W);
|
|
1299
|
+
}, [te, U, O.triggerRef]), wt(h, {
|
|
1300
|
+
menu: O,
|
|
1301
|
+
selectState: K,
|
|
1287
1302
|
searchInputRef: fe
|
|
1288
1303
|
});
|
|
1289
|
-
const
|
|
1290
|
-
return
|
|
1291
|
-
const v =
|
|
1304
|
+
const ze = c ? i ?? "compact" : "compact", be = Q(null);
|
|
1305
|
+
return We(() => {
|
|
1306
|
+
const v = O.triggerRef.current;
|
|
1292
1307
|
be.current = v ? v.querySelector("[data-input-content]") : null;
|
|
1293
|
-
}), /* @__PURE__ */
|
|
1308
|
+
}), /* @__PURE__ */ a.jsxs(
|
|
1294
1309
|
"div",
|
|
1295
1310
|
{
|
|
1296
|
-
className:
|
|
1311
|
+
className: V("relative inline-flex w-full flex-col", X),
|
|
1297
1312
|
style: oe ? { width: oe } : void 0,
|
|
1298
1313
|
id: ee,
|
|
1299
1314
|
children: [
|
|
1300
|
-
/* @__PURE__ */
|
|
1301
|
-
|
|
1315
|
+
/* @__PURE__ */ a.jsx(
|
|
1316
|
+
xt,
|
|
1302
1317
|
{
|
|
1303
|
-
ref:
|
|
1318
|
+
ref: O.triggerRef,
|
|
1304
1319
|
label: s,
|
|
1305
|
-
size:
|
|
1320
|
+
size: j,
|
|
1306
1321
|
variant: l,
|
|
1307
1322
|
labelVariant: w,
|
|
1308
1323
|
disabled: f,
|
|
1309
|
-
isLoading:
|
|
1324
|
+
isLoading: I,
|
|
1310
1325
|
placeholder: m,
|
|
1311
|
-
selectedOptions:
|
|
1312
|
-
chipItems:
|
|
1326
|
+
selectedOptions: K.selectedOptions,
|
|
1327
|
+
chipItems: K.chipItems,
|
|
1313
1328
|
multiple: !!c,
|
|
1314
|
-
displayMode:
|
|
1329
|
+
displayMode: ze,
|
|
1315
1330
|
overflow: p,
|
|
1316
1331
|
optionLabel: g,
|
|
1317
1332
|
optionValue: N,
|
|
1318
|
-
renderSelection:
|
|
1319
|
-
onRemoveOption:
|
|
1320
|
-
onRemoveGroup:
|
|
1321
|
-
onClear: z ?
|
|
1322
|
-
onClick:
|
|
1323
|
-
onFocus:
|
|
1333
|
+
renderSelection: R,
|
|
1334
|
+
onRemoveOption: K.removeOption,
|
|
1335
|
+
onRemoveGroup: K.removeOptions,
|
|
1336
|
+
onClear: z ? Ke : void 0,
|
|
1337
|
+
onClick: Me,
|
|
1338
|
+
onFocus: Pe,
|
|
1324
1339
|
isOpen: te,
|
|
1325
|
-
onKeyDown:
|
|
1326
|
-
className:
|
|
1327
|
-
containerClassName:
|
|
1328
|
-
buttonClassName:
|
|
1340
|
+
onKeyDown: Ge,
|
|
1341
|
+
className: X,
|
|
1342
|
+
containerClassName: A,
|
|
1343
|
+
buttonClassName: q,
|
|
1329
1344
|
width: oe,
|
|
1330
1345
|
height: ie,
|
|
1331
1346
|
tabIndex: le,
|
|
1332
1347
|
helperComponent: y,
|
|
1333
1348
|
errorComponent: u,
|
|
1334
|
-
inputProps:
|
|
1349
|
+
inputProps: G
|
|
1335
1350
|
}
|
|
1336
1351
|
),
|
|
1337
|
-
/* @__PURE__ */
|
|
1338
|
-
|
|
1352
|
+
/* @__PURE__ */ a.jsx(
|
|
1353
|
+
gt,
|
|
1339
1354
|
{
|
|
1340
|
-
menuRef:
|
|
1341
|
-
triggerRef:
|
|
1355
|
+
menuRef: O.ref,
|
|
1356
|
+
triggerRef: O.triggerRef,
|
|
1342
1357
|
anchorRef: be,
|
|
1343
1358
|
dropdownVariant: U,
|
|
1344
1359
|
attachToParent: e.attachToParent,
|
|
1345
1360
|
filteredOptions: ne.filteredOptions,
|
|
1346
|
-
selectedIds:
|
|
1361
|
+
selectedIds: K.selectedIds,
|
|
1347
1362
|
optionLabel: g,
|
|
1348
1363
|
optionValue: N,
|
|
1349
|
-
optionActive:
|
|
1364
|
+
optionActive: T,
|
|
1350
1365
|
multiple: !!c,
|
|
1351
1366
|
renderOption: M,
|
|
1352
|
-
renderOptionGroupHeader:
|
|
1353
|
-
renderOptionContext:
|
|
1354
|
-
onSelect: (v,
|
|
1355
|
-
closeDropdown:
|
|
1356
|
-
onSelectGroup:
|
|
1367
|
+
renderOptionGroupHeader: H,
|
|
1368
|
+
renderOptionContext: b,
|
|
1369
|
+
onSelect: (v, W) => Ce(v, "mouse", W),
|
|
1370
|
+
closeDropdown: O.close,
|
|
1371
|
+
onSelectGroup: K.selectGroup,
|
|
1357
1372
|
searchValue: ne.searchValue,
|
|
1358
1373
|
onSearchChange: ne.handleSearchChange,
|
|
1359
1374
|
onSearchClear: ne.handleSearchClear,
|
|
1360
1375
|
searchInputRef: fe,
|
|
1361
|
-
dropdownOptions:
|
|
1362
|
-
onSearchKeyDown:
|
|
1363
|
-
createOptionKeyHandler:
|
|
1364
|
-
navigateNext:
|
|
1365
|
-
navigatePrev:
|
|
1376
|
+
dropdownOptions: J,
|
|
1377
|
+
onSearchKeyDown: Y.handleSearchKeyDown,
|
|
1378
|
+
createOptionKeyHandler: Y.createOptionKeyHandler,
|
|
1379
|
+
navigateNext: Y.navigateNext,
|
|
1380
|
+
navigatePrev: Y.navigatePrev,
|
|
1366
1381
|
optionsContainerRef: me,
|
|
1367
|
-
isLoading:
|
|
1382
|
+
isLoading: I || !!J?.isLoading,
|
|
1368
1383
|
emptyMessage: C,
|
|
1369
1384
|
disabled: f,
|
|
1370
|
-
size:
|
|
1371
|
-
dropdownClassName:
|
|
1385
|
+
size: j,
|
|
1386
|
+
dropdownClassName: B,
|
|
1372
1387
|
label: s
|
|
1373
1388
|
}
|
|
1374
1389
|
)
|
|
@@ -1377,5 +1392,5 @@ function Wt(e) {
|
|
|
1377
1392
|
);
|
|
1378
1393
|
}
|
|
1379
1394
|
export {
|
|
1380
|
-
|
|
1395
|
+
Lt as default
|
|
1381
1396
|
};
|