@pismo/marola 1.0.0-beta.23 → 1.0.0-beta.25
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/SelectButton-BlVl6pJn.js +70 -0
- package/dist/{Tabs.module-jkH1Qjn7.js → Tabs.module-BGGTkDc5.js} +7 -7
- package/dist/assets/Autocomplete.css +1 -1
- package/dist/assets/SelectButton.css +1 -1
- package/dist/assets/Tabs.css +1 -1
- package/dist/components/Autocomplete/Autocomplete.js +324 -305
- package/dist/components/Pagination/Pagination.js +26 -33
- package/dist/components/Select/Select.d.ts +1 -0
- package/dist/components/Select/Select.js +179 -169
- package/dist/components/Select/SelectButton.d.ts +1 -0
- package/dist/components/Select/SelectButton.js +1 -1
- package/dist/components/Tabs/Tab.d.ts +5 -3
- package/dist/components/Tabs/Tab.js +34 -33
- package/dist/components/Tabs/TabPanel.d.ts +4 -2
- package/dist/components/Tabs/TabPanel.js +48 -38
- package/dist/components/Tabs/Tabs.d.ts +6 -4
- package/dist/components/Tabs/Tabs.js +113 -110
- package/package.json +1 -1
- package/dist/SelectButton-oWzluvmj.js +0 -63
|
@@ -2,11 +2,11 @@ import '../../assets/Autocomplete.css';
|
|
|
2
2
|
import { jsx as le, jsxs as lt } from "react/jsx-runtime";
|
|
3
3
|
import * as h from "react";
|
|
4
4
|
import { useId as at, useState as ut, createElement as ct } from "react";
|
|
5
|
-
import { Icon as
|
|
6
|
-
import { Input as
|
|
7
|
-
import { b as Ve, s as
|
|
5
|
+
import { Icon as pt } from "../Icon/Icon.js";
|
|
6
|
+
import { Input as ft } from "../Input/Input.js";
|
|
7
|
+
import { b as Ve, s as dt } from "../../useSlotProps-C_I1kEHr.js";
|
|
8
8
|
import { u as gt } from "../../useId-BW-oWmul.js";
|
|
9
|
-
import { u as
|
|
9
|
+
import { u as _e } from "../../useControlled-CCMYYdCM.js";
|
|
10
10
|
import { u as ae } from "../../useEventCallback-BAQJJ3ye.js";
|
|
11
11
|
const ht = (c) => {
|
|
12
12
|
const b = h.useRef({});
|
|
@@ -17,26 +17,26 @@ const ht = (c) => {
|
|
|
17
17
|
function Me(c) {
|
|
18
18
|
return typeof c.normalize < "u" ? c.normalize("NFD").replace(/[\u0300-\u036f]/g, "") : c;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function yt(c = {}) {
|
|
21
21
|
const {
|
|
22
22
|
ignoreAccents: b = !0,
|
|
23
23
|
ignoreCase: g = !0,
|
|
24
|
-
limit:
|
|
25
|
-
matchFrom:
|
|
26
|
-
stringify:
|
|
24
|
+
limit: D,
|
|
25
|
+
matchFrom: K = "any",
|
|
26
|
+
stringify: v,
|
|
27
27
|
trim: C = !1
|
|
28
28
|
} = c;
|
|
29
|
-
return (
|
|
29
|
+
return (N, {
|
|
30
30
|
inputValue: L,
|
|
31
|
-
getOptionLabel:
|
|
31
|
+
getOptionLabel: m
|
|
32
32
|
}) => {
|
|
33
|
-
let
|
|
34
|
-
g && (
|
|
35
|
-
const
|
|
36
|
-
let w = (
|
|
37
|
-
return g && (w = w.toLowerCase()), b && (w = Me(w)),
|
|
38
|
-
}) :
|
|
39
|
-
return typeof
|
|
33
|
+
let S = C ? L.trim() : L;
|
|
34
|
+
g && (S = S.toLowerCase()), b && (S = Me(S));
|
|
35
|
+
const B = S ? N.filter((z) => {
|
|
36
|
+
let w = (v || m)(z);
|
|
37
|
+
return g && (w = w.toLowerCase()), b && (w = Me(w)), K === "start" ? w.indexOf(S) === 0 : w.indexOf(S) > -1;
|
|
38
|
+
}) : N;
|
|
39
|
+
return typeof D == "number" ? B.slice(0, D) : B;
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
function ue(c, b) {
|
|
@@ -45,312 +45,312 @@ function ue(c, b) {
|
|
|
45
45
|
return g;
|
|
46
46
|
return -1;
|
|
47
47
|
}
|
|
48
|
-
const bt =
|
|
48
|
+
const bt = yt(), Re = 5, mt = (c) => {
|
|
49
49
|
var b;
|
|
50
50
|
return c.current !== null && ((b = c.current.parentElement) == null ? void 0 : b.contains(document.activeElement));
|
|
51
51
|
};
|
|
52
|
-
function
|
|
52
|
+
function xt(c) {
|
|
53
53
|
const {
|
|
54
54
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
55
|
-
unstable_isActiveElementInListbox: b =
|
|
55
|
+
unstable_isActiveElementInListbox: b = mt,
|
|
56
56
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
57
57
|
unstable_classNamePrefix: g = "Mui",
|
|
58
|
-
autoComplete:
|
|
59
|
-
autoHighlight:
|
|
60
|
-
autoSelect:
|
|
58
|
+
autoComplete: D = !1,
|
|
59
|
+
autoHighlight: K = !1,
|
|
60
|
+
autoSelect: v = !1,
|
|
61
61
|
blurOnSelect: C = !1,
|
|
62
|
-
clearOnBlur:
|
|
62
|
+
clearOnBlur: N = !c.freeSolo,
|
|
63
63
|
clearOnEscape: L = !1,
|
|
64
|
-
componentName:
|
|
65
|
-
defaultValue:
|
|
66
|
-
disableClearable:
|
|
67
|
-
disableCloseOnSelect:
|
|
64
|
+
componentName: m = "useAutocomplete",
|
|
65
|
+
defaultValue: S = c.multiple ? [] : null,
|
|
66
|
+
disableClearable: B = !1,
|
|
67
|
+
disableCloseOnSelect: z = !1,
|
|
68
68
|
disabled: w,
|
|
69
69
|
disabledItemsFocusable: ce = !1,
|
|
70
|
-
disableListWrap:
|
|
71
|
-
filterOptions:
|
|
72
|
-
filterSelectedOptions:
|
|
70
|
+
disableListWrap: J = !1,
|
|
71
|
+
filterOptions: pe = bt,
|
|
72
|
+
filterSelectedOptions: Q = !1,
|
|
73
73
|
freeSolo: i = !1,
|
|
74
|
-
getOptionDisabled:
|
|
75
|
-
getOptionKey:
|
|
76
|
-
getOptionLabel:
|
|
74
|
+
getOptionDisabled: y,
|
|
75
|
+
getOptionKey: V,
|
|
76
|
+
getOptionLabel: M = (t) => {
|
|
77
77
|
var e;
|
|
78
78
|
return (e = t.label) != null ? e : t;
|
|
79
79
|
},
|
|
80
|
-
groupBy:
|
|
80
|
+
groupBy: _,
|
|
81
81
|
handleHomeEndKeys: Z = !c.freeSolo,
|
|
82
|
-
id:
|
|
83
|
-
includeInputInList:
|
|
82
|
+
id: fe,
|
|
83
|
+
includeInputInList: Oe = !1,
|
|
84
84
|
inputValue: He,
|
|
85
|
-
isOptionEqualToValue:
|
|
85
|
+
isOptionEqualToValue: R = (t, e) => t === e,
|
|
86
86
|
multiple: u = !1,
|
|
87
|
-
onChange:
|
|
87
|
+
onChange: Ie,
|
|
88
88
|
onClose: Se,
|
|
89
|
-
onHighlightChange:
|
|
90
|
-
onInputChange:
|
|
91
|
-
onOpen:
|
|
89
|
+
onHighlightChange: we,
|
|
90
|
+
onInputChange: H,
|
|
91
|
+
onOpen: ke,
|
|
92
92
|
open: Fe,
|
|
93
93
|
openOnFocus: qe = !1,
|
|
94
|
-
options:
|
|
95
|
-
readOnly:
|
|
94
|
+
options: de,
|
|
95
|
+
readOnly: W = !1,
|
|
96
96
|
selectOnFocus: Be = !c.freeSolo,
|
|
97
97
|
value: Ue
|
|
98
|
-
} = c,
|
|
99
|
-
let O =
|
|
98
|
+
} = c, E = gt(fe);
|
|
99
|
+
let O = M;
|
|
100
100
|
O = (t) => {
|
|
101
|
-
const e =
|
|
101
|
+
const e = M(t);
|
|
102
102
|
if (typeof e != "string") {
|
|
103
103
|
if (process.env.NODE_ENV !== "production") {
|
|
104
|
-
const
|
|
105
|
-
console.error(`MUI: The \`getOptionLabel\` method of ${
|
|
104
|
+
const o = e === void 0 ? "undefined" : `${typeof e} (${e})`;
|
|
105
|
+
console.error(`MUI: The \`getOptionLabel\` method of ${m} returned ${o} instead of a string for ${JSON.stringify(t)}.`);
|
|
106
106
|
}
|
|
107
107
|
return String(e);
|
|
108
108
|
}
|
|
109
109
|
return e;
|
|
110
110
|
};
|
|
111
|
-
const ge = h.useRef(!1), he = h.useRef(!0),
|
|
111
|
+
const ge = h.useRef(!1), he = h.useRef(!0), f = h.useRef(null), T = h.useRef(null), [ee, je] = h.useState(null), [$, ye] = h.useState(-1), Ee = K ? 0 : -1, x = h.useRef(Ee), [r, Ke] = _e({
|
|
112
112
|
controlled: Ue,
|
|
113
|
-
default:
|
|
114
|
-
name:
|
|
115
|
-
}), [a, te] =
|
|
113
|
+
default: S,
|
|
114
|
+
name: m
|
|
115
|
+
}), [a, te] = _e({
|
|
116
116
|
controlled: He,
|
|
117
117
|
default: "",
|
|
118
|
-
name:
|
|
118
|
+
name: m,
|
|
119
119
|
state: "inputValue"
|
|
120
|
-
}), [
|
|
121
|
-
if (!(u ?
|
|
120
|
+
}), [oe, Te] = h.useState(!1), re = h.useCallback((t, e) => {
|
|
121
|
+
if (!(u ? r.length < e.length : e !== null) && !N)
|
|
122
122
|
return;
|
|
123
|
-
let
|
|
123
|
+
let n;
|
|
124
124
|
if (u)
|
|
125
|
-
|
|
125
|
+
n = "";
|
|
126
126
|
else if (e == null)
|
|
127
|
-
|
|
127
|
+
n = "";
|
|
128
128
|
else {
|
|
129
129
|
const s = O(e);
|
|
130
|
-
|
|
130
|
+
n = typeof s == "string" ? s : "";
|
|
131
131
|
}
|
|
132
|
-
a !==
|
|
133
|
-
}, [O, a, u,
|
|
132
|
+
a !== n && (te(n), H && H(t, n, "reset"));
|
|
133
|
+
}, [O, a, u, H, te, N, r]), [U, $e] = _e({
|
|
134
134
|
controlled: Fe,
|
|
135
135
|
default: !1,
|
|
136
|
-
name:
|
|
136
|
+
name: m,
|
|
137
137
|
state: "open"
|
|
138
|
-
}), [ze,
|
|
139
|
-
|
|
138
|
+
}), [ze, Pe] = h.useState(!0), Ae = !u && r != null && a === O(r), k = U && !W, p = k ? pe(
|
|
139
|
+
de.filter((t) => !(Q && (u ? r : [r]).some((e) => e !== null && R(t, e)))),
|
|
140
140
|
// we use the empty string to manipulate `filterOptions` to not filter any options
|
|
141
141
|
// i.e. the filter predicate always returns true
|
|
142
142
|
{
|
|
143
|
-
inputValue:
|
|
143
|
+
inputValue: Ae && ze ? "" : a,
|
|
144
144
|
getOptionLabel: O
|
|
145
145
|
}
|
|
146
|
-
) : [],
|
|
147
|
-
filteredOptions:
|
|
148
|
-
value:
|
|
146
|
+
) : [], P = ht({
|
|
147
|
+
filteredOptions: p,
|
|
148
|
+
value: r,
|
|
149
149
|
inputValue: a
|
|
150
150
|
});
|
|
151
151
|
h.useEffect(() => {
|
|
152
|
-
const t =
|
|
153
|
-
|
|
154
|
-
}, [
|
|
155
|
-
const be =
|
|
156
|
-
if (process.env.NODE_ENV !== "production" &&
|
|
157
|
-
const t = (u ?
|
|
158
|
-
t.length > 0 && console.warn([`MUI: The value provided to ${
|
|
152
|
+
const t = r !== P.value;
|
|
153
|
+
oe && !t || i && !t || re(null, r);
|
|
154
|
+
}, [r, re, oe, P.value, i]);
|
|
155
|
+
const be = U && p.length > 0 && !W;
|
|
156
|
+
if (process.env.NODE_ENV !== "production" && r !== null && !i && de.length > 0) {
|
|
157
|
+
const t = (u ? r : [r]).filter((e) => !de.some((o) => R(o, e)));
|
|
158
|
+
t.length > 0 && console.warn([`MUI: The value provided to ${m} is invalid.`, `None of the options match with \`${t.length > 1 ? JSON.stringify(t) : JSON.stringify(t[0])}\`.`, "You can use the `isOptionEqualToValue` prop to customize the equality test."].join(`
|
|
159
159
|
`));
|
|
160
160
|
}
|
|
161
|
-
const
|
|
162
|
-
t === -1 ?
|
|
161
|
+
const ne = ae((t) => {
|
|
162
|
+
t === -1 ? f.current.focus() : ee.querySelector(`[data-tag-index="${t}"]`).focus();
|
|
163
163
|
});
|
|
164
164
|
h.useEffect(() => {
|
|
165
|
-
u && $ >
|
|
166
|
-
}, [
|
|
165
|
+
u && $ > r.length - 1 && (ye(-1), ne(-1));
|
|
166
|
+
}, [r, u, $, ne]);
|
|
167
167
|
function Je(t, e) {
|
|
168
|
-
if (!
|
|
168
|
+
if (!T.current || t < 0 || t >= p.length)
|
|
169
169
|
return -1;
|
|
170
|
-
let
|
|
170
|
+
let o = t;
|
|
171
171
|
for (; ; ) {
|
|
172
|
-
const
|
|
173
|
-
if (
|
|
174
|
-
return
|
|
175
|
-
if (e === "next" ?
|
|
172
|
+
const n = T.current.querySelector(`[data-option-index="${o}"]`), s = ce ? !1 : !n || n.disabled || n.getAttribute("aria-disabled") === "true";
|
|
173
|
+
if (n && n.hasAttribute("tabindex") && !s)
|
|
174
|
+
return o;
|
|
175
|
+
if (e === "next" ? o = (o + 1) % p.length : o = (o - 1 + p.length) % p.length, o === t)
|
|
176
176
|
return -1;
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
|
-
const
|
|
179
|
+
const F = ae(({
|
|
180
180
|
event: t,
|
|
181
181
|
index: e,
|
|
182
|
-
reason:
|
|
182
|
+
reason: o = "auto"
|
|
183
183
|
}) => {
|
|
184
|
-
if (
|
|
184
|
+
if (x.current = e, e === -1 ? f.current.removeAttribute("aria-activedescendant") : f.current.setAttribute("aria-activedescendant", `${E}-option-${e}`), we && we(t, e === -1 ? null : p[e], o), !T.current)
|
|
185
185
|
return;
|
|
186
|
-
const
|
|
187
|
-
|
|
188
|
-
let s =
|
|
189
|
-
if (
|
|
186
|
+
const n = T.current.querySelector(`[role="option"].${g}-focused`);
|
|
187
|
+
n && (n.classList.remove(`${g}-focused`), n.classList.remove(`${g}-focusVisible`));
|
|
188
|
+
let s = T.current;
|
|
189
|
+
if (T.current.getAttribute("role") !== "listbox" && (s = T.current.parentElement.querySelector('[role="listbox"]')), !s)
|
|
190
190
|
return;
|
|
191
191
|
if (e === -1) {
|
|
192
192
|
s.scrollTop = 0;
|
|
193
193
|
return;
|
|
194
194
|
}
|
|
195
|
-
const l =
|
|
196
|
-
if (l && (l.classList.add(`${g}-focused`),
|
|
197
|
-
const
|
|
198
|
-
ie > I ? s.scrollTop = ie - s.clientHeight :
|
|
195
|
+
const l = T.current.querySelector(`[data-option-index="${e}"]`);
|
|
196
|
+
if (l && (l.classList.add(`${g}-focused`), o === "keyboard" && l.classList.add(`${g}-focusVisible`), s.scrollHeight > s.clientHeight && o !== "mouse" && o !== "touch")) {
|
|
197
|
+
const d = l, I = s.clientHeight + s.scrollTop, ie = d.offsetTop + d.offsetHeight;
|
|
198
|
+
ie > I ? s.scrollTop = ie - s.clientHeight : d.offsetTop - d.offsetHeight * (_ ? 1.3 : 0) < s.scrollTop && (s.scrollTop = d.offsetTop - d.offsetHeight * (_ ? 1.3 : 0));
|
|
199
199
|
}
|
|
200
|
-
}),
|
|
200
|
+
}), A = ae(({
|
|
201
201
|
event: t,
|
|
202
202
|
diff: e,
|
|
203
|
-
direction:
|
|
204
|
-
reason:
|
|
203
|
+
direction: o = "next",
|
|
204
|
+
reason: n = "auto"
|
|
205
205
|
}) => {
|
|
206
|
-
if (!
|
|
206
|
+
if (!k)
|
|
207
207
|
return;
|
|
208
208
|
const l = Je((() => {
|
|
209
|
-
const
|
|
209
|
+
const d = p.length - 1;
|
|
210
210
|
if (e === "reset")
|
|
211
|
-
return
|
|
211
|
+
return Ee;
|
|
212
212
|
if (e === "start")
|
|
213
213
|
return 0;
|
|
214
214
|
if (e === "end")
|
|
215
|
-
return
|
|
216
|
-
const I =
|
|
217
|
-
return I < 0 ? I === -1 &&
|
|
218
|
-
})(),
|
|
219
|
-
if (
|
|
215
|
+
return d;
|
|
216
|
+
const I = x.current + e;
|
|
217
|
+
return I < 0 ? I === -1 && Oe ? -1 : J && x.current !== -1 || Math.abs(e) > 1 ? 0 : d : I > d ? I === d + 1 && Oe ? -1 : J || Math.abs(e) > 1 ? d : 0 : I;
|
|
218
|
+
})(), o);
|
|
219
|
+
if (F({
|
|
220
220
|
index: l,
|
|
221
|
-
reason:
|
|
221
|
+
reason: n,
|
|
222
222
|
event: t
|
|
223
|
-
}),
|
|
223
|
+
}), D && e !== "reset")
|
|
224
224
|
if (l === -1)
|
|
225
|
-
|
|
225
|
+
f.current.value = a;
|
|
226
226
|
else {
|
|
227
|
-
const
|
|
228
|
-
|
|
227
|
+
const d = O(p[l]);
|
|
228
|
+
f.current.value = d, d.toLowerCase().indexOf(a.toLowerCase()) === 0 && a.length > 0 && f.current.setSelectionRange(a.length, d.length);
|
|
229
229
|
}
|
|
230
230
|
}), We = () => {
|
|
231
|
-
const t = (e,
|
|
232
|
-
const
|
|
233
|
-
return
|
|
231
|
+
const t = (e, o) => {
|
|
232
|
+
const n = e ? O(e) : "", s = o ? O(o) : "";
|
|
233
|
+
return n === s;
|
|
234
234
|
};
|
|
235
|
-
if (
|
|
236
|
-
const e =
|
|
235
|
+
if (x.current !== -1 && P.filteredOptions && P.filteredOptions.length !== p.length && P.inputValue === a && (u ? r.length === P.value.length && P.value.every((e, o) => O(r[o]) === O(e)) : t(P.value, r))) {
|
|
236
|
+
const e = P.filteredOptions[x.current];
|
|
237
237
|
if (e)
|
|
238
|
-
return ue(
|
|
238
|
+
return ue(p, (o) => O(o) === O(e));
|
|
239
239
|
}
|
|
240
240
|
return -1;
|
|
241
|
-
},
|
|
242
|
-
if (!
|
|
241
|
+
}, me = h.useCallback(() => {
|
|
242
|
+
if (!k)
|
|
243
243
|
return;
|
|
244
244
|
const t = We();
|
|
245
245
|
if (t !== -1) {
|
|
246
|
-
|
|
246
|
+
x.current = t;
|
|
247
247
|
return;
|
|
248
248
|
}
|
|
249
|
-
const e = u ?
|
|
250
|
-
if (
|
|
251
|
-
|
|
249
|
+
const e = u ? r[0] : r;
|
|
250
|
+
if (p.length === 0 || e == null) {
|
|
251
|
+
A({
|
|
252
252
|
diff: "reset"
|
|
253
253
|
});
|
|
254
254
|
return;
|
|
255
255
|
}
|
|
256
|
-
if (
|
|
256
|
+
if (T.current) {
|
|
257
257
|
if (e != null) {
|
|
258
|
-
const
|
|
259
|
-
if (u &&
|
|
258
|
+
const o = p[x.current];
|
|
259
|
+
if (u && o && ue(r, (s) => R(o, s)) !== -1)
|
|
260
260
|
return;
|
|
261
|
-
const
|
|
262
|
-
|
|
261
|
+
const n = ue(p, (s) => R(s, e));
|
|
262
|
+
n === -1 ? A({
|
|
263
263
|
diff: "reset"
|
|
264
|
-
}) :
|
|
265
|
-
index:
|
|
264
|
+
}) : F({
|
|
265
|
+
index: n
|
|
266
266
|
});
|
|
267
267
|
return;
|
|
268
268
|
}
|
|
269
|
-
if (
|
|
270
|
-
|
|
271
|
-
index:
|
|
269
|
+
if (x.current >= p.length - 1) {
|
|
270
|
+
F({
|
|
271
|
+
index: p.length - 1
|
|
272
272
|
});
|
|
273
273
|
return;
|
|
274
274
|
}
|
|
275
|
-
|
|
276
|
-
index:
|
|
275
|
+
F({
|
|
276
|
+
index: x.current
|
|
277
277
|
});
|
|
278
278
|
}
|
|
279
279
|
}, [
|
|
280
280
|
// Only sync the highlighted index when the option switch between empty and not
|
|
281
|
-
|
|
281
|
+
p.length,
|
|
282
282
|
// Don't sync the highlighted index with the value when multiple
|
|
283
283
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
284
|
-
u ? !1 :
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
284
|
+
u ? !1 : r,
|
|
285
|
+
Q,
|
|
286
|
+
A,
|
|
287
|
+
F,
|
|
288
|
+
k,
|
|
289
289
|
a,
|
|
290
290
|
u
|
|
291
291
|
]), Ye = ae((t) => {
|
|
292
|
-
|
|
292
|
+
dt(T, t), t && me();
|
|
293
293
|
});
|
|
294
294
|
process.env.NODE_ENV !== "production" && h.useEffect(() => {
|
|
295
|
-
(!
|
|
296
|
-
`)) : console.error([`MUI: Unable to find the input element. It was resolved to ${
|
|
295
|
+
(!f.current || f.current.nodeName !== "INPUT") && (f.current && f.current.nodeName === "TEXTAREA" ? console.warn([`A textarea element was provided to ${m} where input was expected.`, "This is not a supported scenario but it may work under certain conditions.", "A textarea keyboard navigation may conflict with Autocomplete controls (for example enter and arrow keys).", "Make sure to test keyboard navigation and add custom event handlers if necessary."].join(`
|
|
296
|
+
`)) : console.error([`MUI: Unable to find the input element. It was resolved to ${f.current} while an HTMLInputElement was expected.`, `Instead, ${m} expects an input element.`, "", m === "useAutocomplete" ? "Make sure you have bound getInputProps correctly and that the normal ref/effect resolutions order is guaranteed." : "Make sure you have customized the input component correctly."].join(`
|
|
297
297
|
`)));
|
|
298
|
-
}, [
|
|
299
|
-
|
|
300
|
-
}, [
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
},
|
|
304
|
-
|
|
305
|
-
},
|
|
298
|
+
}, [m]), h.useEffect(() => {
|
|
299
|
+
me();
|
|
300
|
+
}, [me]);
|
|
301
|
+
const q = (t) => {
|
|
302
|
+
U || ($e(!0), Pe(!0), ke && ke(t));
|
|
303
|
+
}, Y = (t, e) => {
|
|
304
|
+
U && ($e(!1), Se && Se(t, e));
|
|
305
|
+
}, j = (t, e, o, n) => {
|
|
306
306
|
if (u) {
|
|
307
|
-
if (
|
|
307
|
+
if (r.length === e.length && r.every((s, l) => s === e[l]))
|
|
308
308
|
return;
|
|
309
|
-
} else if (
|
|
309
|
+
} else if (r === e)
|
|
310
310
|
return;
|
|
311
|
-
|
|
312
|
-
}, se = h.useRef(!1),
|
|
313
|
-
let s =
|
|
311
|
+
Ie && Ie(t, e, o, n), Ke(e);
|
|
312
|
+
}, se = h.useRef(!1), X = (t, e, o = "selectOption", n = "options") => {
|
|
313
|
+
let s = o, l = e;
|
|
314
314
|
if (u) {
|
|
315
|
-
if (l = Array.isArray(
|
|
316
|
-
const I = l.filter((ie) =>
|
|
317
|
-
I.length > 1 && console.error([`MUI: The \`isOptionEqualToValue\` method of ${
|
|
315
|
+
if (l = Array.isArray(r) ? r.slice() : [], process.env.NODE_ENV !== "production") {
|
|
316
|
+
const I = l.filter((ie) => R(e, ie));
|
|
317
|
+
I.length > 1 && console.error([`MUI: The \`isOptionEqualToValue\` method of ${m} does not handle the arguments correctly.`, `The component expects a single value to match a given option but found ${I.length} matches.`].join(`
|
|
318
318
|
`));
|
|
319
319
|
}
|
|
320
|
-
const
|
|
321
|
-
|
|
320
|
+
const d = ue(l, (I) => R(e, I));
|
|
321
|
+
d === -1 ? l.push(e) : n !== "freeSolo" && (l.splice(d, 1), s = "removeOption");
|
|
322
322
|
}
|
|
323
|
-
|
|
323
|
+
re(t, l), j(t, l, s, {
|
|
324
324
|
option: e
|
|
325
|
-
}), !
|
|
325
|
+
}), !z && (!t || !t.ctrlKey && !t.metaKey) && Y(t, s), (C === !0 || C === "touch" && se.current || C === "mouse" && !se.current) && f.current.blur();
|
|
326
326
|
};
|
|
327
327
|
function Xe(t, e) {
|
|
328
328
|
if (t === -1)
|
|
329
329
|
return -1;
|
|
330
|
-
let
|
|
330
|
+
let o = t;
|
|
331
331
|
for (; ; ) {
|
|
332
|
-
if (e === "next" &&
|
|
332
|
+
if (e === "next" && o === r.length || e === "previous" && o === -1)
|
|
333
333
|
return -1;
|
|
334
|
-
const
|
|
335
|
-
if (!
|
|
336
|
-
|
|
334
|
+
const n = ee.querySelector(`[data-tag-index="${o}"]`);
|
|
335
|
+
if (!n || !n.hasAttribute("tabindex") || n.disabled || n.getAttribute("aria-disabled") === "true")
|
|
336
|
+
o += e === "next" ? 1 : -1;
|
|
337
337
|
else
|
|
338
|
-
return
|
|
338
|
+
return o;
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
|
-
const
|
|
341
|
+
const De = (t, e) => {
|
|
342
342
|
if (!u)
|
|
343
343
|
return;
|
|
344
|
-
a === "" &&
|
|
345
|
-
let
|
|
346
|
-
$ === -1 ? a === "" && e === "previous" && (
|
|
344
|
+
a === "" && Y(t, "toggleInput");
|
|
345
|
+
let o = $;
|
|
346
|
+
$ === -1 ? a === "" && e === "previous" && (o = r.length - 1) : (o += e === "next" ? 1 : -1, o < 0 && (o = 0), o === r.length && (o = -1)), o = Xe(o, e), ye(o), ne(o);
|
|
347
347
|
}, Ce = (t) => {
|
|
348
|
-
ge.current = !0, te(""),
|
|
348
|
+
ge.current = !0, te(""), H && H(t, "", "clear"), j(t, u ? [] : null, "clear");
|
|
349
349
|
}, Ge = (t) => (e) => {
|
|
350
|
-
if (t.onKeyDown && t.onKeyDown(e), !e.defaultMuiPrevented && ($ !== -1 && ["ArrowLeft", "ArrowRight"].indexOf(e.key) === -1 && (
|
|
350
|
+
if (t.onKeyDown && t.onKeyDown(e), !e.defaultMuiPrevented && ($ !== -1 && ["ArrowLeft", "ArrowRight"].indexOf(e.key) === -1 && (ye(-1), ne(-1)), e.which !== 229))
|
|
351
351
|
switch (e.key) {
|
|
352
352
|
case "Home":
|
|
353
|
-
|
|
353
|
+
k && Z && (e.preventDefault(), A({
|
|
354
354
|
diff: "start",
|
|
355
355
|
direction: "next",
|
|
356
356
|
reason: "keyboard",
|
|
@@ -358,7 +358,7 @@ function yt(c) {
|
|
|
358
358
|
}));
|
|
359
359
|
break;
|
|
360
360
|
case "End":
|
|
361
|
-
|
|
361
|
+
k && Z && (e.preventDefault(), A({
|
|
362
362
|
diff: "end",
|
|
363
363
|
direction: "previous",
|
|
364
364
|
reason: "keyboard",
|
|
@@ -366,158 +366,158 @@ function yt(c) {
|
|
|
366
366
|
}));
|
|
367
367
|
break;
|
|
368
368
|
case "PageUp":
|
|
369
|
-
e.preventDefault(),
|
|
369
|
+
e.preventDefault(), A({
|
|
370
370
|
diff: -Re,
|
|
371
371
|
direction: "previous",
|
|
372
372
|
reason: "keyboard",
|
|
373
373
|
event: e
|
|
374
|
-
}),
|
|
374
|
+
}), q(e);
|
|
375
375
|
break;
|
|
376
376
|
case "PageDown":
|
|
377
|
-
e.preventDefault(),
|
|
377
|
+
e.preventDefault(), A({
|
|
378
378
|
diff: Re,
|
|
379
379
|
direction: "next",
|
|
380
380
|
reason: "keyboard",
|
|
381
381
|
event: e
|
|
382
|
-
}),
|
|
382
|
+
}), q(e);
|
|
383
383
|
break;
|
|
384
384
|
case "ArrowDown":
|
|
385
|
-
e.preventDefault(),
|
|
385
|
+
e.preventDefault(), A({
|
|
386
386
|
diff: 1,
|
|
387
387
|
direction: "next",
|
|
388
388
|
reason: "keyboard",
|
|
389
389
|
event: e
|
|
390
|
-
}),
|
|
390
|
+
}), q(e);
|
|
391
391
|
break;
|
|
392
392
|
case "ArrowUp":
|
|
393
|
-
e.preventDefault(),
|
|
393
|
+
e.preventDefault(), A({
|
|
394
394
|
diff: -1,
|
|
395
395
|
direction: "previous",
|
|
396
396
|
reason: "keyboard",
|
|
397
397
|
event: e
|
|
398
|
-
}),
|
|
398
|
+
}), q(e);
|
|
399
399
|
break;
|
|
400
400
|
case "ArrowLeft":
|
|
401
|
-
|
|
401
|
+
De(e, "previous");
|
|
402
402
|
break;
|
|
403
403
|
case "ArrowRight":
|
|
404
|
-
|
|
404
|
+
De(e, "next");
|
|
405
405
|
break;
|
|
406
406
|
case "Enter":
|
|
407
|
-
if (
|
|
408
|
-
const
|
|
409
|
-
if (e.preventDefault(),
|
|
407
|
+
if (x.current !== -1 && k) {
|
|
408
|
+
const o = p[x.current], n = y ? y(o) : !1;
|
|
409
|
+
if (e.preventDefault(), n)
|
|
410
410
|
return;
|
|
411
|
-
|
|
411
|
+
X(e, o, "selectOption"), D && f.current.setSelectionRange(f.current.value.length, f.current.value.length);
|
|
412
412
|
} else
|
|
413
|
-
i && a !== "" &&
|
|
413
|
+
i && a !== "" && Ae === !1 && (u && e.preventDefault(), X(e, a, "createOption", "freeSolo"));
|
|
414
414
|
break;
|
|
415
415
|
case "Escape":
|
|
416
|
-
|
|
416
|
+
k ? (e.preventDefault(), e.stopPropagation(), Y(e, "escape")) : L && (a !== "" || u && r.length > 0) && (e.preventDefault(), e.stopPropagation(), Ce(e));
|
|
417
417
|
break;
|
|
418
418
|
case "Backspace":
|
|
419
|
-
if (u && !
|
|
420
|
-
const
|
|
421
|
-
|
|
422
|
-
option: o
|
|
419
|
+
if (u && !W && a === "" && r.length > 0) {
|
|
420
|
+
const o = $ === -1 ? r.length - 1 : $, n = r.slice();
|
|
421
|
+
n.splice(o, 1), j(e, n, "removeOption", {
|
|
422
|
+
option: r[o]
|
|
423
423
|
});
|
|
424
424
|
}
|
|
425
425
|
break;
|
|
426
426
|
case "Delete":
|
|
427
|
-
if (u && !
|
|
428
|
-
const
|
|
429
|
-
|
|
430
|
-
option: o
|
|
427
|
+
if (u && !W && a === "" && r.length > 0 && $ !== -1) {
|
|
428
|
+
const o = $, n = r.slice();
|
|
429
|
+
n.splice(o, 1), j(e, n, "removeOption", {
|
|
430
|
+
option: r[o]
|
|
431
431
|
});
|
|
432
432
|
}
|
|
433
433
|
break;
|
|
434
434
|
}
|
|
435
435
|
}, Qe = (t) => {
|
|
436
|
-
|
|
437
|
-
},
|
|
438
|
-
if (b(
|
|
439
|
-
|
|
436
|
+
Te(!0), qe && !ge.current && q(t);
|
|
437
|
+
}, Ne = (t) => {
|
|
438
|
+
if (b(T)) {
|
|
439
|
+
f.current.focus();
|
|
440
440
|
return;
|
|
441
441
|
}
|
|
442
|
-
|
|
442
|
+
Te(!1), he.current = !0, ge.current = !1, v && x.current !== -1 && k ? X(t, p[x.current], "blur") : v && i && a !== "" ? X(t, a, "blur", "freeSolo") : N && re(t, r), Y(t, "blur");
|
|
443
443
|
}, Ze = (t) => {
|
|
444
444
|
const e = t.target.value;
|
|
445
|
-
a !== e && (te(e),
|
|
445
|
+
a !== e && (te(e), Pe(!1), H && H(t, e, "input")), e === "" ? !B && !u && j(t, null, "clear") : q(t);
|
|
446
446
|
}, et = (t) => {
|
|
447
447
|
const e = Number(t.currentTarget.getAttribute("data-option-index"));
|
|
448
|
-
|
|
448
|
+
x.current !== e && F({
|
|
449
449
|
event: t,
|
|
450
450
|
index: e,
|
|
451
451
|
reason: "mouse"
|
|
452
452
|
});
|
|
453
453
|
}, tt = (t) => {
|
|
454
|
-
|
|
454
|
+
F({
|
|
455
455
|
event: t,
|
|
456
456
|
index: Number(t.currentTarget.getAttribute("data-option-index")),
|
|
457
457
|
reason: "touch"
|
|
458
458
|
}), se.current = !0;
|
|
459
|
-
},
|
|
459
|
+
}, ot = (t) => {
|
|
460
460
|
const e = Number(t.currentTarget.getAttribute("data-option-index"));
|
|
461
|
-
|
|
462
|
-
},
|
|
463
|
-
const
|
|
464
|
-
|
|
465
|
-
option:
|
|
461
|
+
X(t, p[e], "selectOption"), se.current = !1;
|
|
462
|
+
}, rt = (t) => (e) => {
|
|
463
|
+
const o = r.slice();
|
|
464
|
+
o.splice(t, 1), j(e, o, "removeOption", {
|
|
465
|
+
option: r[t]
|
|
466
466
|
});
|
|
467
|
-
},
|
|
468
|
-
|
|
469
|
-
},
|
|
470
|
-
t.currentTarget.contains(t.target) && t.target.getAttribute("id") !==
|
|
467
|
+
}, ve = (t) => {
|
|
468
|
+
U ? Y(t, "toggleInput") : q(t);
|
|
469
|
+
}, nt = (t) => {
|
|
470
|
+
t.currentTarget.contains(t.target) && t.target.getAttribute("id") !== E && t.preventDefault();
|
|
471
471
|
}, st = (t) => {
|
|
472
|
-
t.currentTarget.contains(t.target) && (
|
|
472
|
+
t.currentTarget.contains(t.target) && (f.current.focus(), Be && he.current && f.current.selectionEnd - f.current.selectionStart === 0 && f.current.select(), he.current = !1);
|
|
473
473
|
}, it = (t) => {
|
|
474
|
-
!w && (a === "" || !
|
|
474
|
+
!w && (a === "" || !U) && ve(t);
|
|
475
475
|
};
|
|
476
|
-
let
|
|
477
|
-
|
|
478
|
-
let Le =
|
|
479
|
-
if (
|
|
476
|
+
let xe = i && a.length > 0;
|
|
477
|
+
xe = xe || (u ? r.length > 0 : r !== null);
|
|
478
|
+
let Le = p;
|
|
479
|
+
if (_) {
|
|
480
480
|
const t = /* @__PURE__ */ new Map();
|
|
481
481
|
let e = !1;
|
|
482
|
-
Le =
|
|
483
|
-
const l =
|
|
484
|
-
return
|
|
482
|
+
Le = p.reduce((o, n, s) => {
|
|
483
|
+
const l = _(n);
|
|
484
|
+
return o.length > 0 && o[o.length - 1].group === l ? o[o.length - 1].options.push(n) : (process.env.NODE_ENV !== "production" && (t.get(l) && !e && (console.warn(`MUI: The options provided combined with the \`groupBy\` method of ${m} returns duplicated headers.`, "You can solve the issue by sorting the options with the output of `groupBy`."), e = !0), t.set(l, !0)), o.push({
|
|
485
485
|
key: s,
|
|
486
486
|
index: s,
|
|
487
487
|
group: l,
|
|
488
|
-
options: [
|
|
489
|
-
})),
|
|
488
|
+
options: [n]
|
|
489
|
+
})), o;
|
|
490
490
|
}, []);
|
|
491
491
|
}
|
|
492
|
-
return w &&
|
|
492
|
+
return w && oe && Ne(), {
|
|
493
493
|
getRootProps: (t = {}) => Ve({
|
|
494
|
-
"aria-owns": be ? `${
|
|
494
|
+
"aria-owns": be ? `${E}-listbox` : null
|
|
495
495
|
}, t, {
|
|
496
496
|
onKeyDown: Ge(t),
|
|
497
|
-
onMouseDown:
|
|
497
|
+
onMouseDown: nt,
|
|
498
498
|
onClick: st
|
|
499
499
|
}),
|
|
500
500
|
getInputLabelProps: () => ({
|
|
501
|
-
id: `${
|
|
502
|
-
htmlFor:
|
|
501
|
+
id: `${E}-label`,
|
|
502
|
+
htmlFor: E
|
|
503
503
|
}),
|
|
504
504
|
getInputProps: () => ({
|
|
505
|
-
id:
|
|
505
|
+
id: E,
|
|
506
506
|
value: a,
|
|
507
|
-
onBlur:
|
|
507
|
+
onBlur: Ne,
|
|
508
508
|
onFocus: Qe,
|
|
509
509
|
onChange: Ze,
|
|
510
510
|
onMouseDown: it,
|
|
511
511
|
// if open then this is handled imperatively so don't let react override
|
|
512
512
|
// only have an opinion about this when closed
|
|
513
|
-
"aria-activedescendant":
|
|
514
|
-
"aria-autocomplete":
|
|
515
|
-
"aria-controls": be ? `${
|
|
513
|
+
"aria-activedescendant": k ? "" : null,
|
|
514
|
+
"aria-autocomplete": D ? "both" : "list",
|
|
515
|
+
"aria-controls": be ? `${E}-listbox` : void 0,
|
|
516
516
|
"aria-expanded": be,
|
|
517
517
|
// Disable browser's suggestion that might overlap with the popup.
|
|
518
518
|
// Handle autocomplete but not autofill.
|
|
519
519
|
autoComplete: "off",
|
|
520
|
-
ref:
|
|
520
|
+
ref: f,
|
|
521
521
|
autoCapitalize: "none",
|
|
522
522
|
spellCheck: "false",
|
|
523
523
|
role: "combobox",
|
|
@@ -531,7 +531,7 @@ function yt(c) {
|
|
|
531
531
|
getPopupIndicatorProps: () => ({
|
|
532
532
|
tabIndex: -1,
|
|
533
533
|
type: "button",
|
|
534
|
-
onClick:
|
|
534
|
+
onClick: ve
|
|
535
535
|
}),
|
|
536
536
|
getTagProps: ({
|
|
537
537
|
index: t
|
|
@@ -539,13 +539,13 @@ function yt(c) {
|
|
|
539
539
|
key: t,
|
|
540
540
|
"data-tag-index": t,
|
|
541
541
|
tabIndex: -1
|
|
542
|
-
}, !
|
|
543
|
-
onDelete:
|
|
542
|
+
}, !W && {
|
|
543
|
+
onDelete: rt(t)
|
|
544
544
|
}),
|
|
545
545
|
getListboxProps: () => ({
|
|
546
546
|
role: "listbox",
|
|
547
|
-
id: `${
|
|
548
|
-
"aria-labelledby": `${
|
|
547
|
+
id: `${E}-listbox`,
|
|
548
|
+
"aria-labelledby": `${E}-label`,
|
|
549
549
|
ref: Ye,
|
|
550
550
|
onMouseDown: (t) => {
|
|
551
551
|
t.preventDefault();
|
|
@@ -555,106 +555,125 @@ function yt(c) {
|
|
|
555
555
|
index: t,
|
|
556
556
|
option: e
|
|
557
557
|
}) => {
|
|
558
|
-
var
|
|
559
|
-
const
|
|
558
|
+
var o;
|
|
559
|
+
const n = (u ? r : [r]).some((l) => l != null && R(e, l)), s = y ? y(e) : !1;
|
|
560
560
|
return {
|
|
561
|
-
key: (
|
|
561
|
+
key: (o = V == null ? void 0 : V(e)) != null ? o : O(e),
|
|
562
562
|
tabIndex: -1,
|
|
563
563
|
role: "option",
|
|
564
|
-
id: `${
|
|
564
|
+
id: `${E}-option-${t}`,
|
|
565
565
|
onMouseMove: et,
|
|
566
|
-
onClick:
|
|
566
|
+
onClick: ot,
|
|
567
567
|
onTouchStart: tt,
|
|
568
568
|
"data-option-index": t,
|
|
569
569
|
"aria-disabled": s,
|
|
570
|
-
"aria-selected":
|
|
570
|
+
"aria-selected": n
|
|
571
571
|
};
|
|
572
572
|
},
|
|
573
|
-
id:
|
|
573
|
+
id: E,
|
|
574
574
|
inputValue: a,
|
|
575
|
-
value:
|
|
576
|
-
dirty:
|
|
577
|
-
expanded:
|
|
578
|
-
popupOpen:
|
|
579
|
-
focused:
|
|
575
|
+
value: r,
|
|
576
|
+
dirty: xe,
|
|
577
|
+
expanded: k && ee,
|
|
578
|
+
popupOpen: k,
|
|
579
|
+
focused: oe || $ !== -1,
|
|
580
580
|
anchorEl: ee,
|
|
581
581
|
setAnchorEl: je,
|
|
582
582
|
focusedTag: $,
|
|
583
583
|
groupedOptions: Le
|
|
584
584
|
};
|
|
585
585
|
}
|
|
586
|
-
const
|
|
587
|
-
|
|
588
|
-
"
|
|
589
|
-
"
|
|
590
|
-
"
|
|
591
|
-
|
|
586
|
+
const _t = "_autocomplete_164gy_65", G = {
|
|
587
|
+
"u-typography-h1": "_u-typography-h1_164gy_1",
|
|
588
|
+
"u-typography-h2": "_u-typography-h2_164gy_8",
|
|
589
|
+
"u-typography-h3": "_u-typography-h3_164gy_15",
|
|
590
|
+
"u-typography-h4": "_u-typography-h4_164gy_22",
|
|
591
|
+
"u-typography-h5": "_u-typography-h5_164gy_29",
|
|
592
|
+
"u-typography-h6": "_u-typography-h6_164gy_36",
|
|
593
|
+
"u-typography-base": "_u-typography-base_164gy_43",
|
|
594
|
+
"u-typography-base--xxl": "_u-typography-base--xxl_164gy_49",
|
|
595
|
+
"u-typography-base--xl": "_u-typography-base--xl_164gy_53",
|
|
596
|
+
"u-typography-base--lg": "_u-typography-base--lg_164gy_57",
|
|
597
|
+
"u-typography-base--sm": "_u-typography-base--sm_164gy_61",
|
|
598
|
+
"u-typography-base--bold": "_u-typography-base--bold_164gy_65",
|
|
599
|
+
"autocomplete__dropdown-item": "_autocomplete__dropdown-item_164gy_65",
|
|
600
|
+
"u-typography-base--strikethrough": "_u-typography-base--strikethrough_164gy_68",
|
|
601
|
+
"u-typography-base--underlined": "_u-typography-base--underlined_164gy_71",
|
|
602
|
+
"u-typography-base--strikethrough-underlined": "_u-typography-base--strikethrough-underlined_164gy_74",
|
|
603
|
+
autocomplete: _t,
|
|
604
|
+
"autocomplete__dropdown-list": "_autocomplete__dropdown-list_164gy_82",
|
|
605
|
+
"option-focused": "_option-focused_164gy_106"
|
|
606
|
+
}, Pt = ({
|
|
592
607
|
labelKey: c,
|
|
593
608
|
valueKey: b,
|
|
594
609
|
options: g,
|
|
595
|
-
type:
|
|
596
|
-
value:
|
|
597
|
-
onChange:
|
|
610
|
+
type: D,
|
|
611
|
+
value: K,
|
|
612
|
+
onChange: v,
|
|
598
613
|
onInputChange: C,
|
|
599
|
-
"data-testid-wrapper":
|
|
614
|
+
"data-testid-wrapper": N,
|
|
600
615
|
...L
|
|
601
616
|
}) => {
|
|
602
|
-
const
|
|
617
|
+
const m = at(), [S, B] = ut("");
|
|
603
618
|
g != null && g.some((i) => typeof i != "string") && (!c || !b) && console.error(
|
|
604
619
|
'[autocomplete] When options is a list of objects, you must provide the "labelKey" and "valueKey" parameters.'
|
|
605
620
|
);
|
|
606
|
-
const { getRootProps:
|
|
607
|
-
id: `autocomplete_${
|
|
621
|
+
const { getRootProps: z, getInputProps: w, getOptionProps: ce, groupedOptions: J, getListboxProps: pe } = xt({
|
|
622
|
+
id: `autocomplete_${m}`,
|
|
608
623
|
options: g,
|
|
609
624
|
getOptionLabel: (i) => typeof i == "string" ? i : String(i[c || "label"]),
|
|
610
|
-
value:
|
|
611
|
-
inputValue:
|
|
612
|
-
isOptionEqualToValue: (i,
|
|
613
|
-
onChange: (i,
|
|
614
|
-
|
|
625
|
+
value: K,
|
|
626
|
+
inputValue: S,
|
|
627
|
+
isOptionEqualToValue: (i, y) => typeof i == "string" ? String(i) === String(y) : String(i[b || "id"]) === String(y[b || "id"]),
|
|
628
|
+
onChange: (i, y) => {
|
|
629
|
+
v && v(i, y);
|
|
615
630
|
},
|
|
616
|
-
onInputChange: (i,
|
|
617
|
-
C && C(i,
|
|
631
|
+
onInputChange: (i, y) => {
|
|
632
|
+
C && C(i, y), B(y);
|
|
618
633
|
},
|
|
619
|
-
onHighlightChange: (i,
|
|
620
|
-
var
|
|
621
|
-
if (
|
|
622
|
-
const
|
|
623
|
-
|
|
634
|
+
onHighlightChange: (i, y, V) => {
|
|
635
|
+
var M;
|
|
636
|
+
if (V === "keyboard") {
|
|
637
|
+
const _ = document.querySelector("#autocomplete-list"), Z = (i == null ? void 0 : i.target).getAttribute("aria-activedescendant");
|
|
638
|
+
_ == null || _.querySelectorAll("li").forEach((fe) => fe.classList.remove(G["option-focused"])), (M = _ == null ? void 0 : _.querySelector(`[id="${Z}"]`)) == null || M.classList.add(G["option-focused"]);
|
|
624
639
|
}
|
|
625
640
|
}
|
|
626
|
-
}),
|
|
641
|
+
}), Q = {
|
|
627
642
|
...w(),
|
|
628
643
|
...L
|
|
629
644
|
};
|
|
630
|
-
return /* @__PURE__ */ le("div", { className:
|
|
645
|
+
return /* @__PURE__ */ le("div", { className: G.autocomplete, "data-testid": N, children: /* @__PURE__ */ lt("div", { ...z(), children: [
|
|
631
646
|
/* @__PURE__ */ le(
|
|
632
|
-
|
|
647
|
+
ft,
|
|
633
648
|
{
|
|
634
|
-
rightIcon:
|
|
635
|
-
...
|
|
649
|
+
rightIcon: D === "search" && /* @__PURE__ */ le(pt, { color: "var(--accent)", icon: "magnifying-glass" }),
|
|
650
|
+
...Q
|
|
636
651
|
}
|
|
637
652
|
),
|
|
638
|
-
|
|
653
|
+
J.length > 0 && !L.disabled && /* @__PURE__ */ le(
|
|
639
654
|
"ul",
|
|
640
655
|
{
|
|
641
|
-
...
|
|
656
|
+
...pe(),
|
|
642
657
|
id: "autocomplete-list",
|
|
643
|
-
className:
|
|
644
|
-
children:
|
|
645
|
-
"
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
658
|
+
className: G["autocomplete__dropdown-list"],
|
|
659
|
+
children: J.map((i, y) => {
|
|
660
|
+
const V = ce({ option: i, index: y }), M = typeof i == "string" ? i : String(i[c || "label"]), _ = V.key === S;
|
|
661
|
+
return /* @__PURE__ */ ct(
|
|
662
|
+
"li",
|
|
663
|
+
{
|
|
664
|
+
tabIndex: y,
|
|
665
|
+
className: G["autocomplete__dropdown-item"],
|
|
666
|
+
...V,
|
|
667
|
+
"aria-selected": _,
|
|
668
|
+
key: String(y)
|
|
669
|
+
},
|
|
670
|
+
M
|
|
671
|
+
);
|
|
672
|
+
})
|
|
654
673
|
}
|
|
655
674
|
)
|
|
656
675
|
] }) });
|
|
657
676
|
};
|
|
658
677
|
export {
|
|
659
|
-
|
|
678
|
+
Pt as Autocomplete
|
|
660
679
|
};
|