@pismo/marola 1.0.0-beta.8 → 1.0.0-beta.9
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/Dialog.module-DFcZsVAd.js +30 -0
- package/dist/{Input.module-iOYlI_1w.js → Input.module-ZTRZRcNt.js} +136 -136
- package/dist/SelectButton-CoOT2txy.js +61 -0
- package/dist/Toggle-f5brSwAI.js +175 -0
- package/dist/assets/Advice.css +1 -1
- package/dist/assets/Autocomplete.css +1 -1
- package/dist/assets/Button.css +1 -1
- package/dist/assets/Checkbox.css +1 -1
- package/dist/assets/Dialog.css +1 -1
- package/dist/assets/IconButton.css +1 -1
- package/dist/assets/Input.css +1 -1
- package/dist/assets/PageHeader.css +1 -1
- package/dist/assets/Pagination.css +1 -1
- package/dist/assets/SelectButton.css +1 -1
- package/dist/assets/Snackbar.css +1 -1
- package/dist/assets/SortTooltip.css +1 -1
- package/dist/assets/Stepper.css +1 -1
- package/dist/assets/Table.css +1 -1
- package/dist/assets/Toggle.css +1 -1
- package/dist/assets/Toggle2.css +1 -1
- package/dist/assets/Typography.css +1 -1
- package/dist/components/Advice/Advice.d.ts +32 -17
- package/dist/components/Advice/Advice.js +39 -40
- package/dist/components/Advice/Advice.stories.d.ts +4 -3
- package/dist/components/Autocomplete/Autocomplete.js +58 -58
- package/dist/components/Button/Button.js +48 -48
- package/dist/components/Checkbox/Checkbox.js +52 -52
- package/dist/components/Chip/Chip.js +1 -1
- package/dist/components/Dialog/Actions.js +1 -1
- package/dist/components/Dialog/Backdrop.js +1 -1
- package/dist/components/Dialog/CloseIconButton.js +1 -1
- package/dist/components/Dialog/Dialog.js +1 -1
- package/dist/components/Dialog/Dialog.stories.d.ts +1 -1
- package/dist/components/Dialog/DialogTitle.js +1 -1
- package/dist/components/IconButton/IconButton.js +42 -42
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/PageHeader/PageHeader.js +57 -57
- package/dist/components/Pagination/Pagination.js +70 -70
- package/dist/components/RowItem/RowItem.js +1 -1
- package/dist/components/Select/Select.js +1 -1
- package/dist/components/Select/SelectButton.js +1 -1
- package/dist/components/Snackbar/Snackbar.js +90 -90
- package/dist/components/SortTooltip/SortTooltip.js +46 -46
- package/dist/components/Stepper/Stepper.js +35 -35
- package/dist/components/Table/Table.js +96 -96
- package/dist/components/Toggle/Toggle.js +55 -55
- package/dist/components/ToggleGroup/Toggle.js +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.js +1 -1
- package/dist/components/Typography/Typography.js +47 -47
- package/dist/main.js +1 -1
- package/package.json +1 -1
- package/dist/Dialog.module-DFEmFdYT.js +0 -30
- package/dist/SelectButton-K3OIfR5m.js +0 -61
- package/dist/Toggle-BSvvbKBp.js +0 -175
|
@@ -1,47 +1,46 @@
|
|
|
1
1
|
import '../../assets/Advice.css';
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { c as
|
|
4
|
-
import { Icon as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"u-typography-h6": "_u-typography-h6_12o7p_36",
|
|
12
|
-
"u-typography-base": "_u-typography-base_12o7p_43",
|
|
13
|
-
"u-typography-base--xxl": "_u-typography-base--xxl_12o7p_48",
|
|
14
|
-
"u-typography-base--xl": "_u-typography-base--xl_12o7p_52",
|
|
15
|
-
"u-typography-base--lg": "_u-typography-base--lg_12o7p_56",
|
|
16
|
-
advice: n,
|
|
17
|
-
content: d,
|
|
18
|
-
"u-typography-base--sm": "_u-typography-base--sm_12o7p_61",
|
|
19
|
-
"u-typography-base--bold": "_u-typography-base--bold_12o7p_65",
|
|
20
|
-
"u-typography-base--strikethrough": "_u-typography-base--strikethrough_12o7p_69",
|
|
21
|
-
"u-typography-base--underlined": "_u-typography-base--underlined_12o7p_72",
|
|
22
|
-
"u-typography-base--strikethrough-underlined": "_u-typography-base--strikethrough-underlined_12o7p_75",
|
|
23
|
-
"content-no-items": "_content-no-items_12o7p_90"
|
|
24
|
-
}, m = {
|
|
2
|
+
import { jsxs as _, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { c as g } from "../../clsx-DB4S2d7J.js";
|
|
4
|
+
import { Icon as h } from "../Icon/Icon.js";
|
|
5
|
+
import { Typography as m } from "../Typography/Typography.js";
|
|
6
|
+
const x = "_advice_1wls4_1", f = "_advice__texts_1wls4_8", u = "_advice__content_1wls4_14", c = {
|
|
7
|
+
advice: x,
|
|
8
|
+
advice__texts: f,
|
|
9
|
+
advice__content: u
|
|
10
|
+
}, b = {
|
|
25
11
|
"no-permission": "eye-slash",
|
|
26
12
|
"no-items": "",
|
|
27
13
|
"error-page": "circle-exclamation",
|
|
28
14
|
"without-results": "folder-magnifying-glass"
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
15
|
+
}, T = ({
|
|
16
|
+
type: e,
|
|
17
|
+
icon: a,
|
|
18
|
+
iconSvg: i,
|
|
19
|
+
content: t,
|
|
20
|
+
title: l,
|
|
21
|
+
titleProps: o = { variant: "base-xxl", color: "var(--gray-75)", bold: !0 },
|
|
22
|
+
description: n,
|
|
23
|
+
descriptionProps: s = { variant: "base-lg", color: "var(--gray-75)" },
|
|
24
|
+
className: v,
|
|
25
|
+
...d
|
|
26
|
+
}) => (e && (a = { icon: b[e] }, (e === "without-results" || e === "no-permission") && (o = Object.assign({}, o, { variant: "base-lg" })), e === "no-items" && (s = Object.assign({}, s, {
|
|
27
|
+
elementProps: { style: { maxWidth: 460, color: s.color } }
|
|
28
|
+
})), e === "error-page" && (a.color = "var(--secondary-orange)")), /* @__PURE__ */ _("div", { className: g(c.advice, v), ...d, children: [
|
|
29
|
+
(a == null ? void 0 : a.icon) && /* @__PURE__ */ r(h, { icon: a.icon, size: a.size || "3.375rem", color: a.color || "var(--accent)" }),
|
|
30
|
+
i && i,
|
|
31
|
+
/* @__PURE__ */ _(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
className: c.advice__texts,
|
|
35
|
+
style: e === "without-results" || e === "no-permission" ? { marginTop: -16 } : {},
|
|
36
|
+
children: [
|
|
37
|
+
l && /* @__PURE__ */ r(m, { element: "h3", ...o, children: l }),
|
|
38
|
+
n && /* @__PURE__ */ r(m, { element: "p", ...s, children: n })
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
/* @__PURE__ */ r("div", { className: c.advice__content, children: t && t })
|
|
43
|
+
] }));
|
|
45
44
|
export {
|
|
46
|
-
|
|
45
|
+
T as Advice
|
|
47
46
|
};
|
|
@@ -2,7 +2,7 @@ import { StoryObj } from '@storybook/react';
|
|
|
2
2
|
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: ({ icon,
|
|
5
|
+
component: ({ type, icon, iconSvg: IconSvg, content, title, titleProps, description, descriptionProps, className, ...rest }: import('./Advice').AdviceProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
tags: string[];
|
|
7
7
|
parameters: {
|
|
8
8
|
layout: string;
|
|
@@ -12,7 +12,8 @@ export default meta;
|
|
|
12
12
|
type Story = StoryObj<typeof meta>;
|
|
13
13
|
export declare const WithoutResults: Story;
|
|
14
14
|
export declare const NoPermission: Story;
|
|
15
|
-
export declare const CustomIcon: Story;
|
|
16
|
-
export declare const CustomIconSVG: Story;
|
|
17
15
|
export declare const NoItems: Story;
|
|
18
16
|
export declare const ErrorPage: Story;
|
|
17
|
+
export declare const CustomIcon: Story;
|
|
18
|
+
export declare const CustomIconSVG: Story;
|
|
19
|
+
export declare const TotallyCustom: Story;
|
|
@@ -4,7 +4,7 @@ import * as g from "react";
|
|
|
4
4
|
import { useId as pt, useState as Fe } from "react";
|
|
5
5
|
import { c as Z } from "../../clsx-DB4S2d7J.js";
|
|
6
6
|
import { Icon as qe } from "../Icon/Icon.js";
|
|
7
|
-
import { s as P, I as gt } from "../../Input.module-
|
|
7
|
+
import { s as P, I as gt } from "../../Input.module-ZTRZRcNt.js";
|
|
8
8
|
import { Typography as Be } from "../Typography/Typography.js";
|
|
9
9
|
import { b as Ke, s as ht } from "../../useSlotProps-kRhf7Gil.js";
|
|
10
10
|
import { u as mt } from "../../useId-BW-oWmul.js";
|
|
@@ -85,10 +85,10 @@ function It(u) {
|
|
|
85
85
|
includeInputInList: se = !1,
|
|
86
86
|
inputValue: Oe,
|
|
87
87
|
isOptionEqualToValue: D = (t, e) => t === e,
|
|
88
|
-
multiple:
|
|
88
|
+
multiple: i = !1,
|
|
89
89
|
onChange: W,
|
|
90
|
-
onClose:
|
|
91
|
-
onHighlightChange:
|
|
90
|
+
onClose: ie,
|
|
91
|
+
onHighlightChange: le,
|
|
92
92
|
onInputChange: E,
|
|
93
93
|
onOpen: c,
|
|
94
94
|
open: v,
|
|
@@ -120,10 +120,10 @@ function It(u) {
|
|
|
120
120
|
name: m,
|
|
121
121
|
state: "inputValue"
|
|
122
122
|
}), [ce, Ae] = g.useState(!1), fe = g.useCallback((t, e) => {
|
|
123
|
-
if (!(
|
|
123
|
+
if (!(i ? r.length < e.length : e !== null) && !M)
|
|
124
124
|
return;
|
|
125
125
|
let o;
|
|
126
|
-
if (
|
|
126
|
+
if (i)
|
|
127
127
|
o = "";
|
|
128
128
|
else if (e == null)
|
|
129
129
|
o = "";
|
|
@@ -132,13 +132,13 @@ function It(u) {
|
|
|
132
132
|
o = typeof s == "string" ? s : "";
|
|
133
133
|
}
|
|
134
134
|
a !== o && (ue(o), E && E(t, o, "reset"));
|
|
135
|
-
}, [y, a,
|
|
135
|
+
}, [y, a, i, E, ue, M, r]), [z, De] = Te({
|
|
136
136
|
controlled: v,
|
|
137
137
|
default: !1,
|
|
138
138
|
name: m,
|
|
139
139
|
state: "open"
|
|
140
|
-
}), [Qe, Ee] = g.useState(!0), ve = !
|
|
141
|
-
Ie.filter((t) => !(te && (
|
|
140
|
+
}), [Qe, Ee] = g.useState(!0), ve = !i && r != null && a === y(r), w = z && !X, f = w ? xe(
|
|
141
|
+
Ie.filter((t) => !(te && (i ? r : [r]).some((e) => e !== null && D(t, e)))),
|
|
142
142
|
// we use the empty string to manipulate `filterOptions` to not filter any options
|
|
143
143
|
// i.e. the filter predicate always returns true
|
|
144
144
|
{
|
|
@@ -156,7 +156,7 @@ function It(u) {
|
|
|
156
156
|
}, [r, fe, ce, C.value, R]);
|
|
157
157
|
const Ne = z && f.length > 0 && !X;
|
|
158
158
|
if (process.env.NODE_ENV !== "production" && r !== null && !R && Ie.length > 0) {
|
|
159
|
-
const t = (
|
|
159
|
+
const t = (i ? r : [r]).filter((e) => !Ie.some((n) => D(n, e)));
|
|
160
160
|
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(`
|
|
161
161
|
`));
|
|
162
162
|
}
|
|
@@ -164,8 +164,8 @@ function It(u) {
|
|
|
164
164
|
t === -1 ? d.current.focus() : ae.querySelector(`[data-tag-index="${t}"]`).focus();
|
|
165
165
|
});
|
|
166
166
|
g.useEffect(() => {
|
|
167
|
-
|
|
168
|
-
}, [r,
|
|
167
|
+
i && S > r.length - 1 && (ke(-1), de(-1));
|
|
168
|
+
}, [r, i, S, de]);
|
|
169
169
|
function Ze(t, e) {
|
|
170
170
|
if (!N.current || t < 0 || t >= f.length)
|
|
171
171
|
return -1;
|
|
@@ -183,7 +183,7 @@ function It(u) {
|
|
|
183
183
|
index: e,
|
|
184
184
|
reason: n = "auto"
|
|
185
185
|
}) => {
|
|
186
|
-
if (x.current = e, e === -1 ? d.current.removeAttribute("aria-activedescendant") : d.current.setAttribute("aria-activedescendant", `${k}-option-${e}`),
|
|
186
|
+
if (x.current = e, e === -1 ? d.current.removeAttribute("aria-activedescendant") : d.current.setAttribute("aria-activedescendant", `${k}-option-${e}`), le && le(t, e === -1 ? null : f[e], n), !N.current)
|
|
187
187
|
return;
|
|
188
188
|
const o = N.current.querySelector(`[role="option"].${h}-focused`);
|
|
189
189
|
o && (o.classList.remove(`${h}-focused`), o.classList.remove(`${h}-focusVisible`));
|
|
@@ -194,9 +194,9 @@ function It(u) {
|
|
|
194
194
|
s.scrollTop = 0;
|
|
195
195
|
return;
|
|
196
196
|
}
|
|
197
|
-
const
|
|
198
|
-
if (
|
|
199
|
-
const p =
|
|
197
|
+
const l = N.current.querySelector(`[data-option-index="${e}"]`);
|
|
198
|
+
if (l && (l.classList.add(`${h}-focused`), n === "keyboard" && l.classList.add(`${h}-focusVisible`), s.scrollHeight > s.clientHeight && n !== "mouse" && n !== "touch")) {
|
|
199
|
+
const p = l, O = s.clientHeight + s.scrollTop, ge = p.offsetTop + p.offsetHeight;
|
|
200
200
|
ge > O ? s.scrollTop = ge - s.clientHeight : p.offsetTop - p.offsetHeight * (j ? 1.3 : 0) < s.scrollTop && (s.scrollTop = p.offsetTop - p.offsetHeight * (j ? 1.3 : 0));
|
|
201
201
|
}
|
|
202
202
|
}), L = he(({
|
|
@@ -207,7 +207,7 @@ function It(u) {
|
|
|
207
207
|
}) => {
|
|
208
208
|
if (!w)
|
|
209
209
|
return;
|
|
210
|
-
const
|
|
210
|
+
const l = Ze((() => {
|
|
211
211
|
const p = f.length - 1;
|
|
212
212
|
if (e === "reset")
|
|
213
213
|
return $e;
|
|
@@ -219,14 +219,14 @@ function It(u) {
|
|
|
219
219
|
return O < 0 ? O === -1 && se ? -1 : ee && x.current !== -1 || Math.abs(e) > 1 ? 0 : p : O > p ? O === p + 1 && se ? -1 : ee || Math.abs(e) > 1 ? p : 0 : O;
|
|
220
220
|
})(), n);
|
|
221
221
|
if (B({
|
|
222
|
-
index:
|
|
222
|
+
index: l,
|
|
223
223
|
reason: o,
|
|
224
224
|
event: t
|
|
225
225
|
}), $ && e !== "reset")
|
|
226
|
-
if (
|
|
226
|
+
if (l === -1)
|
|
227
227
|
d.current.value = a;
|
|
228
228
|
else {
|
|
229
|
-
const p = y(f[
|
|
229
|
+
const p = y(f[l]);
|
|
230
230
|
d.current.value = p, p.toLowerCase().indexOf(a.toLowerCase()) === 0 && a.length > 0 && d.current.setSelectionRange(a.length, p.length);
|
|
231
231
|
}
|
|
232
232
|
}), et = () => {
|
|
@@ -234,7 +234,7 @@ function It(u) {
|
|
|
234
234
|
const o = e ? y(e) : "", s = n ? y(n) : "";
|
|
235
235
|
return o === s;
|
|
236
236
|
};
|
|
237
|
-
if (x.current !== -1 && C.filteredOptions && C.filteredOptions.length !== f.length && C.inputValue === a && (
|
|
237
|
+
if (x.current !== -1 && C.filteredOptions && C.filteredOptions.length !== f.length && C.inputValue === a && (i ? r.length === C.value.length && C.value.every((e, n) => y(r[n]) === y(e)) : t(C.value, r))) {
|
|
238
238
|
const e = C.filteredOptions[x.current];
|
|
239
239
|
if (e)
|
|
240
240
|
return me(f, (n) => y(n) === y(e));
|
|
@@ -248,7 +248,7 @@ function It(u) {
|
|
|
248
248
|
x.current = t;
|
|
249
249
|
return;
|
|
250
250
|
}
|
|
251
|
-
const e =
|
|
251
|
+
const e = i ? r[0] : r;
|
|
252
252
|
if (f.length === 0 || e == null) {
|
|
253
253
|
L({
|
|
254
254
|
diff: "reset"
|
|
@@ -258,7 +258,7 @@ function It(u) {
|
|
|
258
258
|
if (N.current) {
|
|
259
259
|
if (e != null) {
|
|
260
260
|
const n = f[x.current];
|
|
261
|
-
if (
|
|
261
|
+
if (i && n && me(r, (s) => D(n, s)) !== -1)
|
|
262
262
|
return;
|
|
263
263
|
const o = me(f, (s) => D(s, e));
|
|
264
264
|
o === -1 ? L({
|
|
@@ -283,13 +283,13 @@ function It(u) {
|
|
|
283
283
|
f.length,
|
|
284
284
|
// Don't sync the highlighted index with the value when multiple
|
|
285
285
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
286
|
-
|
|
286
|
+
i ? !1 : r,
|
|
287
287
|
te,
|
|
288
288
|
L,
|
|
289
289
|
B,
|
|
290
290
|
w,
|
|
291
291
|
a,
|
|
292
|
-
|
|
292
|
+
i
|
|
293
293
|
]), tt = he((t) => {
|
|
294
294
|
ht(N, t), t && Se();
|
|
295
295
|
});
|
|
@@ -303,26 +303,26 @@ function It(u) {
|
|
|
303
303
|
const K = (t) => {
|
|
304
304
|
z || (De(!0), Ee(!0), c && c(t));
|
|
305
305
|
}, G = (t, e) => {
|
|
306
|
-
z && (De(!1),
|
|
306
|
+
z && (De(!1), ie && ie(t, e));
|
|
307
307
|
}, J = (t, e, n, o) => {
|
|
308
|
-
if (
|
|
309
|
-
if (r.length === e.length && r.every((s,
|
|
308
|
+
if (i) {
|
|
309
|
+
if (r.length === e.length && r.every((s, l) => s === e[l]))
|
|
310
310
|
return;
|
|
311
311
|
} else if (r === e)
|
|
312
312
|
return;
|
|
313
313
|
W && W(t, e, n, o), Ge(e);
|
|
314
314
|
}, pe = g.useRef(!1), Q = (t, e, n = "selectOption", o = "options") => {
|
|
315
|
-
let s = n,
|
|
316
|
-
if (
|
|
317
|
-
if (
|
|
318
|
-
const O =
|
|
315
|
+
let s = n, l = e;
|
|
316
|
+
if (i) {
|
|
317
|
+
if (l = Array.isArray(r) ? r.slice() : [], process.env.NODE_ENV !== "production") {
|
|
318
|
+
const O = l.filter((ge) => D(e, ge));
|
|
319
319
|
O.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 ${O.length} matches.`].join(`
|
|
320
320
|
`));
|
|
321
321
|
}
|
|
322
|
-
const p = me(
|
|
323
|
-
p === -1 ?
|
|
322
|
+
const p = me(l, (O) => D(e, O));
|
|
323
|
+
p === -1 ? l.push(e) : o !== "freeSolo" && (l.splice(p, 1), s = "removeOption");
|
|
324
324
|
}
|
|
325
|
-
fe(t,
|
|
325
|
+
fe(t, l), J(t, l, s, {
|
|
326
326
|
option: e
|
|
327
327
|
}), !Y && (!t || !t.ctrlKey && !t.metaKey) && G(t, s), (V === !0 || V === "touch" && pe.current || V === "mouse" && !pe.current) && d.current.blur();
|
|
328
328
|
};
|
|
@@ -341,13 +341,13 @@ function It(u) {
|
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
343
|
const Ce = (t, e) => {
|
|
344
|
-
if (!
|
|
344
|
+
if (!i)
|
|
345
345
|
return;
|
|
346
346
|
a === "" && G(t, "toggleInput");
|
|
347
347
|
let n = S;
|
|
348
348
|
S === -1 ? a === "" && e === "previous" && (n = r.length - 1) : (n += e === "next" ? 1 : -1, n < 0 && (n = 0), n === r.length && (n = -1)), n = nt(n, e), ke(n), de(n);
|
|
349
349
|
}, Le = (t) => {
|
|
350
|
-
_e.current = !0, ue(""), E && E(t, "", "clear"), J(t,
|
|
350
|
+
_e.current = !0, ue(""), E && E(t, "", "clear"), J(t, i ? [] : null, "clear");
|
|
351
351
|
}, rt = (t) => (e) => {
|
|
352
352
|
if (t.onKeyDown && t.onKeyDown(e), !e.defaultMuiPrevented && (S !== -1 && ["ArrowLeft", "ArrowRight"].indexOf(e.key) === -1 && (ke(-1), de(-1)), e.which !== 229))
|
|
353
353
|
switch (e.key) {
|
|
@@ -412,13 +412,13 @@ function It(u) {
|
|
|
412
412
|
return;
|
|
413
413
|
Q(e, n, "selectOption"), $ && d.current.setSelectionRange(d.current.value.length, d.current.value.length);
|
|
414
414
|
} else
|
|
415
|
-
R && a !== "" && ve === !1 && (
|
|
415
|
+
R && a !== "" && ve === !1 && (i && e.preventDefault(), Q(e, a, "createOption", "freeSolo"));
|
|
416
416
|
break;
|
|
417
417
|
case "Escape":
|
|
418
|
-
w ? (e.preventDefault(), e.stopPropagation(), G(e, "escape")) : F && (a !== "" ||
|
|
418
|
+
w ? (e.preventDefault(), e.stopPropagation(), G(e, "escape")) : F && (a !== "" || i && r.length > 0) && (e.preventDefault(), e.stopPropagation(), Le(e));
|
|
419
419
|
break;
|
|
420
420
|
case "Backspace":
|
|
421
|
-
if (
|
|
421
|
+
if (i && !X && a === "" && r.length > 0) {
|
|
422
422
|
const n = S === -1 ? r.length - 1 : S, o = r.slice();
|
|
423
423
|
o.splice(n, 1), J(e, o, "removeOption", {
|
|
424
424
|
option: r[n]
|
|
@@ -426,7 +426,7 @@ function It(u) {
|
|
|
426
426
|
}
|
|
427
427
|
break;
|
|
428
428
|
case "Delete":
|
|
429
|
-
if (
|
|
429
|
+
if (i && !X && a === "" && r.length > 0 && S !== -1) {
|
|
430
430
|
const n = S, o = r.slice();
|
|
431
431
|
o.splice(n, 1), J(e, o, "removeOption", {
|
|
432
432
|
option: r[n]
|
|
@@ -444,15 +444,15 @@ function It(u) {
|
|
|
444
444
|
Ae(!1), we.current = !0, _e.current = !1, H && x.current !== -1 && w ? Q(t, f[x.current], "blur") : H && R && a !== "" ? Q(t, a, "blur", "freeSolo") : M && fe(t, r), G(t, "blur");
|
|
445
445
|
}, st = (t) => {
|
|
446
446
|
const e = t.target.value;
|
|
447
|
-
a !== e && (ue(e), Ee(!1), E && E(t, e, "input")), e === "" ? !U && !
|
|
448
|
-
},
|
|
447
|
+
a !== e && (ue(e), Ee(!1), E && E(t, e, "input")), e === "" ? !U && !i && J(t, null, "clear") : K(t);
|
|
448
|
+
}, it = (t) => {
|
|
449
449
|
const e = Number(t.currentTarget.getAttribute("data-option-index"));
|
|
450
450
|
x.current !== e && B({
|
|
451
451
|
event: t,
|
|
452
452
|
index: e,
|
|
453
453
|
reason: "mouse"
|
|
454
454
|
});
|
|
455
|
-
},
|
|
455
|
+
}, lt = (t) => {
|
|
456
456
|
B({
|
|
457
457
|
event: t,
|
|
458
458
|
index: Number(t.currentTarget.getAttribute("data-option-index")),
|
|
@@ -476,17 +476,17 @@ function It(u) {
|
|
|
476
476
|
!_ && (a === "" || !z) && Me(t);
|
|
477
477
|
};
|
|
478
478
|
let Pe = R && a.length > 0;
|
|
479
|
-
Pe = Pe || (
|
|
479
|
+
Pe = Pe || (i ? r.length > 0 : r !== null);
|
|
480
480
|
let Re = f;
|
|
481
481
|
if (j) {
|
|
482
482
|
const t = /* @__PURE__ */ new Map();
|
|
483
483
|
let e = !1;
|
|
484
484
|
Re = f.reduce((n, o, s) => {
|
|
485
|
-
const
|
|
486
|
-
return n.length > 0 && n[n.length - 1].group ===
|
|
485
|
+
const l = j(o);
|
|
486
|
+
return n.length > 0 && n[n.length - 1].group === l ? n[n.length - 1].options.push(o) : (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)), n.push({
|
|
487
487
|
key: s,
|
|
488
488
|
index: s,
|
|
489
|
-
group:
|
|
489
|
+
group: l,
|
|
490
490
|
options: [o]
|
|
491
491
|
})), n;
|
|
492
492
|
}, []);
|
|
@@ -558,15 +558,15 @@ function It(u) {
|
|
|
558
558
|
option: e
|
|
559
559
|
}) => {
|
|
560
560
|
var n;
|
|
561
|
-
const o = (
|
|
561
|
+
const o = (i ? r : [r]).some((l) => l != null && D(e, l)), s = q ? q(e) : !1;
|
|
562
562
|
return {
|
|
563
563
|
key: (n = ne == null ? void 0 : ne(e)) != null ? n : y(e),
|
|
564
564
|
tabIndex: -1,
|
|
565
565
|
role: "option",
|
|
566
566
|
id: `${k}-option-${t}`,
|
|
567
|
-
onMouseMove:
|
|
567
|
+
onMouseMove: it,
|
|
568
568
|
onClick: at,
|
|
569
|
-
onTouchStart:
|
|
569
|
+
onTouchStart: lt,
|
|
570
570
|
"data-option-index": t,
|
|
571
571
|
"aria-disabled": s,
|
|
572
572
|
"aria-selected": o
|
|
@@ -585,10 +585,10 @@ function It(u) {
|
|
|
585
585
|
groupedOptions: Re
|
|
586
586
|
};
|
|
587
587
|
}
|
|
588
|
-
const _t = "
|
|
588
|
+
const _t = "_autocomplete_1mx2f_1", ze = {
|
|
589
589
|
autocomplete: _t,
|
|
590
|
-
"autocomplete__dropdown-list": "_autocomplete__dropdown-
|
|
591
|
-
"autocomplete__dropdown-item": "_autocomplete__dropdown-
|
|
590
|
+
"autocomplete__dropdown-list": "_autocomplete__dropdown-list_1mx2f_4",
|
|
591
|
+
"autocomplete__dropdown-item": "_autocomplete__dropdown-item_1mx2f_9"
|
|
592
592
|
}, vt = ({
|
|
593
593
|
label: u,
|
|
594
594
|
type: b,
|
|
@@ -613,7 +613,7 @@ const _t = "_autocomplete_1gluy_1", ze = {
|
|
|
613
613
|
}) => {
|
|
614
614
|
const ne = pt(), re = M || `input_${ne}`;
|
|
615
615
|
Object.assign(q, { "data-testid": xe });
|
|
616
|
-
const [j, oe] = Fe(), [ye, se] = Fe(""), { getRootProps: Oe, getInputProps: D, getOptionProps:
|
|
616
|
+
const [j, oe] = Fe(), [ye, se] = Fe(""), { getRootProps: Oe, getInputProps: D, getOptionProps: i, groupedOptions: W, getListboxProps: ie, focused: le, getInputLabelProps: E } = It({
|
|
617
617
|
id: re,
|
|
618
618
|
options: h,
|
|
619
619
|
getOptionLabel: (c) => typeof c == "string" ? c : c == null ? void 0 : c.label,
|
|
@@ -637,7 +637,7 @@ const _t = "_autocomplete_1gluy_1", ze = {
|
|
|
637
637
|
children: u
|
|
638
638
|
}
|
|
639
639
|
),
|
|
640
|
-
/* @__PURE__ */ T("div", { ...Oe(), className:
|
|
640
|
+
/* @__PURE__ */ T("div", { ...Oe(), className: le ? "Mui-focused" : "", children: /* @__PURE__ */ T(
|
|
641
641
|
gt,
|
|
642
642
|
{
|
|
643
643
|
disabled: F,
|
|
@@ -662,12 +662,12 @@ const _t = "_autocomplete_1gluy_1", ze = {
|
|
|
662
662
|
endAdornment: b === "search" ? /* @__PURE__ */ T("span", { className: P["input__right-icon"], children: /* @__PURE__ */ T(qe, { color: "var(--accent)", icon: "magnifying-glass" }) }) : V && /* @__PURE__ */ T("span", { className: P["input__right-icon"], children: V })
|
|
663
663
|
}
|
|
664
664
|
) }),
|
|
665
|
-
W.length > 0 && !F && /* @__PURE__ */ T("ul", { ...
|
|
665
|
+
W.length > 0 && !F && /* @__PURE__ */ T("ul", { ...ie(), className: ze["autocomplete__dropdown-list"], children: W.map((c, v) => /* @__PURE__ */ T(
|
|
666
666
|
"li",
|
|
667
667
|
{
|
|
668
668
|
tabIndex: v,
|
|
669
669
|
className: ze["autocomplete__dropdown-item"],
|
|
670
|
-
...
|
|
670
|
+
...i({ option: c, index: v }),
|
|
671
671
|
children: typeof c == "string" ? c : c == null ? void 0 : c.label
|
|
672
672
|
}
|
|
673
673
|
)) }),
|
|
@@ -1,61 +1,61 @@
|
|
|
1
1
|
import '../../assets/Button.css';
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { forwardRef as
|
|
2
|
+
import { jsx as p, jsxs as b } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as l, useMemo as x } from "react";
|
|
4
4
|
import { c } from "../../clsx-DB4S2d7J.js";
|
|
5
|
-
import { LoadingSpinner as
|
|
6
|
-
import { B as
|
|
7
|
-
const
|
|
8
|
-
"u-typography-h1": "_u-typography-
|
|
9
|
-
"u-typography-h2": "_u-typography-
|
|
10
|
-
"u-typography-h3": "_u-typography-
|
|
11
|
-
"u-typography-h4": "_u-typography-
|
|
12
|
-
"u-typography-h5": "_u-typography-
|
|
13
|
-
"u-typography-h6": "_u-typography-
|
|
14
|
-
"u-typography-base": "_u-typography-
|
|
15
|
-
"u-typography-base--xxl": "_u-typography-base--
|
|
16
|
-
"u-typography-base--xl": "_u-typography-base--
|
|
17
|
-
"u-typography-base--lg": "_u-typography-base--
|
|
18
|
-
button:
|
|
19
|
-
"u-typography-base--sm": "_u-typography-base--
|
|
20
|
-
"u-typography-base--bold": "_u-typography-base--
|
|
21
|
-
"u-typography-base--strikethrough": "_u-typography-base--
|
|
22
|
-
"u-typography-base--underlined": "_u-typography-base--
|
|
23
|
-
"u-typography-base--strikethrough-underlined": "_u-typography-base--strikethrough-
|
|
24
|
-
"button--primary": "_button--
|
|
25
|
-
"button--secondary": "_button--
|
|
26
|
-
"button--quick": "_button--
|
|
27
|
-
"button__loading-container": "_button__loading-
|
|
28
|
-
}, P =
|
|
5
|
+
import { LoadingSpinner as v } from "../LoadingSpinner/LoadingSpinner.js";
|
|
6
|
+
import { B as m } from "../../Button-DiLqcAJG.js";
|
|
7
|
+
const f = "_button_dxo5v_57", t = {
|
|
8
|
+
"u-typography-h1": "_u-typography-h1_dxo5v_1",
|
|
9
|
+
"u-typography-h2": "_u-typography-h2_dxo5v_8",
|
|
10
|
+
"u-typography-h3": "_u-typography-h3_dxo5v_15",
|
|
11
|
+
"u-typography-h4": "_u-typography-h4_dxo5v_22",
|
|
12
|
+
"u-typography-h5": "_u-typography-h5_dxo5v_29",
|
|
13
|
+
"u-typography-h6": "_u-typography-h6_dxo5v_36",
|
|
14
|
+
"u-typography-base": "_u-typography-base_dxo5v_43",
|
|
15
|
+
"u-typography-base--xxl": "_u-typography-base--xxl_dxo5v_49",
|
|
16
|
+
"u-typography-base--xl": "_u-typography-base--xl_dxo5v_53",
|
|
17
|
+
"u-typography-base--lg": "_u-typography-base--lg_dxo5v_57",
|
|
18
|
+
button: f,
|
|
19
|
+
"u-typography-base--sm": "_u-typography-base--sm_dxo5v_61",
|
|
20
|
+
"u-typography-base--bold": "_u-typography-base--bold_dxo5v_65",
|
|
21
|
+
"u-typography-base--strikethrough": "_u-typography-base--strikethrough_dxo5v_68",
|
|
22
|
+
"u-typography-base--underlined": "_u-typography-base--underlined_dxo5v_71",
|
|
23
|
+
"u-typography-base--strikethrough-underlined": "_u-typography-base--strikethrough-underlined_dxo5v_74",
|
|
24
|
+
"button--primary": "_button--primary_dxo5v_86",
|
|
25
|
+
"button--secondary": "_button--secondary_dxo5v_101",
|
|
26
|
+
"button--quick": "_button--quick_dxo5v_118",
|
|
27
|
+
"button__loading-container": "_button__loading-container_dxo5v_138"
|
|
28
|
+
}, P = l((y, _) => {
|
|
29
29
|
const {
|
|
30
|
-
onClick:
|
|
31
|
-
link:
|
|
30
|
+
onClick: u,
|
|
31
|
+
link: n,
|
|
32
32
|
loading: e,
|
|
33
|
-
children:
|
|
33
|
+
children: a,
|
|
34
34
|
type: s = "button",
|
|
35
35
|
disabled: h,
|
|
36
|
-
className:
|
|
37
|
-
variant:
|
|
38
|
-
muiButtonBaseProps:
|
|
39
|
-
} =
|
|
40
|
-
invert:
|
|
41
|
-
},
|
|
42
|
-
() => c([
|
|
43
|
-
[
|
|
36
|
+
className: r,
|
|
37
|
+
variant: o = "primary",
|
|
38
|
+
muiButtonBaseProps: d
|
|
39
|
+
} = y, g = {
|
|
40
|
+
invert: o === "secondary" || o === "quick"
|
|
41
|
+
}, i = x(
|
|
42
|
+
() => c([t.button, t[`button--${o}`], r]),
|
|
43
|
+
[r, o]
|
|
44
44
|
);
|
|
45
|
-
return /* @__PURE__ */
|
|
46
|
-
|
|
45
|
+
return /* @__PURE__ */ p(
|
|
46
|
+
m,
|
|
47
47
|
{
|
|
48
48
|
type: s,
|
|
49
|
-
href:
|
|
50
|
-
onClick:
|
|
49
|
+
href: n,
|
|
50
|
+
onClick: u,
|
|
51
51
|
disabled: h,
|
|
52
|
-
className:
|
|
53
|
-
ref:
|
|
54
|
-
...
|
|
55
|
-
children: e ? /* @__PURE__ */
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
|
|
58
|
-
] }) :
|
|
52
|
+
className: i,
|
|
53
|
+
ref: _,
|
|
54
|
+
...d ?? {},
|
|
55
|
+
children: e ? /* @__PURE__ */ b("div", { className: t["button__loading-container"], children: [
|
|
56
|
+
/* @__PURE__ */ p(v, { ...g }),
|
|
57
|
+
a
|
|
58
|
+
] }) : a
|
|
59
59
|
}
|
|
60
60
|
);
|
|
61
61
|
});
|