@altinn/altinn-components 0.24.0 → 0.24.2
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/assets/Header.css +1 -1
- package/dist/assets/MenuBase.css +1 -1
- package/dist/assets/MenuItemsVirtual.css +1 -1
- package/dist/components/Header/Header.js +35 -34
- package/dist/components/List/ListItem.js +50 -49
- package/dist/components/Menu/MenuBase.js +10 -10
- package/dist/components/Menu/MenuItemsVirtual.js +85 -87
- package/dist/components/Toolbar/ToolbarSearch.js +9 -9
- package/dist/types/lib/components/Header/Header.stories.d.ts +1 -0
- package/package.json +1 -1
package/dist/assets/Header.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._drawer_1vzjh_1[data-expanded=true]{display:block}._dropdown_1vzjh_5[data-expanded=true]{display:none}@media (min-width: 1024px){._dropdown_1vzjh_5[data-expanded=true]{width:320px;display:block}._drawer_1vzjh_1[data-expanded=true]{display:none}}._relative_1vzjh_19{position:relative}
|
package/dist/assets/MenuBase.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._menu_twp4i_1{list-style:none;padding:0;margin:0;text-indent:0;display:flex;flex-direction:column;width:100%}._list_twp4i_12,._item_twp4i_18{list-style:none;padding:0;margin:0}._item_twp4i_18[role=separator]{border-top:1px solid var(--ds-color-border-subtle)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._virtualScrollRef_12fdc_1{max-height:400px;overflow:auto}._virtualMenuListItem_12fdc_6{position:absolute;top:0;left:0;width:100%}._virtualMenuListItem_12fdc_6>*{margin:0}
|
|
@@ -4,58 +4,59 @@ import { DropdownBase as p } from "../Dropdown/DropdownBase.js";
|
|
|
4
4
|
import "../../index-L8X2o7IH.js";
|
|
5
5
|
import { DrawerBase as m } from "../Dropdown/DrawerBase.js";
|
|
6
6
|
import "react";
|
|
7
|
-
import { useRootContext as
|
|
7
|
+
import { useRootContext as C } from "../RootProvider/RootProvider.js";
|
|
8
8
|
import { GlobalMenu as c } from "../GlobalMenu/GlobalMenu.js";
|
|
9
|
-
import { HeaderBase as
|
|
10
|
-
import { HeaderLogo as
|
|
11
|
-
import { HeaderButton as
|
|
12
|
-
import { LocaleButton as
|
|
9
|
+
import { HeaderBase as u } from "./HeaderBase.js";
|
|
10
|
+
import { HeaderLogo as N } from "./HeaderLogo.js";
|
|
11
|
+
import { HeaderButton as b } from "./HeaderButton.js";
|
|
12
|
+
import { LocaleButton as H } from "./LocaleButton.js";
|
|
13
13
|
import { LocaleSwitcher as h } from "./LocaleSwitcher.js";
|
|
14
|
-
import { Searchbar as
|
|
14
|
+
import { Searchbar as j } from "../Search/Searchbar.js";
|
|
15
15
|
import "../Search/AutocompleteBase.js";
|
|
16
16
|
import "../Snackbar/useSnackbar.js";
|
|
17
|
-
import { HeaderGroup as
|
|
18
|
-
import { HeaderSearch as
|
|
19
|
-
import '../../assets/Header.css';const k = "
|
|
20
|
-
drawer:
|
|
21
|
-
dropdown:
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
import { HeaderGroup as B } from "./HeaderGroup.js";
|
|
18
|
+
import { HeaderSearch as L } from "./HeaderSearch.js";
|
|
19
|
+
import '../../assets/Header.css';const S = "_drawer_1vzjh_1", k = "_dropdown_1vzjh_5", z = "_relative_1vzjh_19", a = {
|
|
20
|
+
drawer: S,
|
|
21
|
+
dropdown: k,
|
|
22
|
+
relative: z
|
|
23
|
+
}, X = ({ menu: r, locale: l, search: i, currentAccount: t, logo: f = {}, badge: w }) => {
|
|
24
|
+
const { currentId: e, toggleId: n, openId: g, closeAll: d } = C(), v = () => {
|
|
24
25
|
g("search");
|
|
25
|
-
},
|
|
26
|
-
|
|
26
|
+
}, _ = () => {
|
|
27
|
+
n("search");
|
|
27
28
|
}, x = () => {
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
|
|
29
|
+
n("menu");
|
|
30
|
+
}, y = () => {
|
|
31
|
+
n("locale");
|
|
31
32
|
};
|
|
32
33
|
return /* @__PURE__ */ s(
|
|
33
|
-
|
|
34
|
+
u,
|
|
34
35
|
{
|
|
35
36
|
currentId: e,
|
|
36
37
|
open: e === "search" || e === "menu" || e === "locale",
|
|
37
38
|
onClose: d,
|
|
38
39
|
children: [
|
|
39
|
-
/* @__PURE__ */ o(
|
|
40
|
-
/* @__PURE__ */ s(
|
|
41
|
-
/* @__PURE__ */ o("div", {
|
|
42
|
-
/* @__PURE__ */ s("div", {
|
|
40
|
+
/* @__PURE__ */ o(N, { ...f, className: a.logo }),
|
|
41
|
+
/* @__PURE__ */ s(B, { children: [
|
|
42
|
+
l && /* @__PURE__ */ o("div", { className: a.relative, children: /* @__PURE__ */ o(H, { onClick: y, expanded: e === "locale" }) }),
|
|
43
|
+
/* @__PURE__ */ s("div", { className: a.relative, children: [
|
|
43
44
|
/* @__PURE__ */ o(
|
|
44
|
-
|
|
45
|
+
b,
|
|
45
46
|
{
|
|
46
47
|
color: "company",
|
|
47
48
|
variant: "solid",
|
|
48
49
|
badge: w,
|
|
49
|
-
avatar:
|
|
50
|
-
type:
|
|
51
|
-
name:
|
|
50
|
+
avatar: t && {
|
|
51
|
+
type: t.type,
|
|
52
|
+
name: t.name
|
|
52
53
|
},
|
|
53
54
|
onClick: x,
|
|
54
55
|
expanded: e === "menu",
|
|
55
56
|
label: r == null ? void 0 : r.menuLabel
|
|
56
57
|
}
|
|
57
58
|
),
|
|
58
|
-
|
|
59
|
+
l && /* @__PURE__ */ o(
|
|
59
60
|
p,
|
|
60
61
|
{
|
|
61
62
|
layout: "desktop",
|
|
@@ -63,7 +64,7 @@ import '../../assets/Header.css';const k = "_drawer_d2s9o_1", I = "_dropdown_d2s
|
|
|
63
64
|
placement: "right",
|
|
64
65
|
open: e === "locale",
|
|
65
66
|
className: a.dropdown,
|
|
66
|
-
children: /* @__PURE__ */ o(h, { ...
|
|
67
|
+
children: /* @__PURE__ */ o(h, { ...l })
|
|
67
68
|
}
|
|
68
69
|
),
|
|
69
70
|
r && /* @__PURE__ */ o(
|
|
@@ -74,18 +75,18 @@ import '../../assets/Header.css';const k = "_drawer_d2s9o_1", I = "_dropdown_d2s
|
|
|
74
75
|
placement: "right",
|
|
75
76
|
open: e === "menu",
|
|
76
77
|
className: a.dropdown,
|
|
77
|
-
children: /* @__PURE__ */ o(c, { ...r, currentAccount:
|
|
78
|
+
children: /* @__PURE__ */ o(c, { ...r, currentAccount: t, onClose: d })
|
|
78
79
|
}
|
|
79
80
|
)
|
|
80
81
|
] })
|
|
81
82
|
] }),
|
|
82
|
-
i && /* @__PURE__ */ o(
|
|
83
|
-
|
|
84
|
-
r && /* @__PURE__ */ o(m, { layout: "mobile", open: e === "menu", className: a.drawer, children: /* @__PURE__ */ o(c, { ...r, currentAccount:
|
|
83
|
+
i && /* @__PURE__ */ o(L, { expanded: e === "search", children: /* @__PURE__ */ o(j, { ...i, expanded: e === "search", onClose: _, onFocus: v }) }),
|
|
84
|
+
l && /* @__PURE__ */ o(m, { layout: "mobile", open: e === "locale", className: a.drawer, children: /* @__PURE__ */ o(h, { ...l }) }),
|
|
85
|
+
r && /* @__PURE__ */ o(m, { layout: "mobile", open: e === "menu", className: a.drawer, children: /* @__PURE__ */ o(c, { ...r, currentAccount: t, onClose: d }) })
|
|
85
86
|
]
|
|
86
87
|
}
|
|
87
88
|
);
|
|
88
89
|
};
|
|
89
90
|
export {
|
|
90
|
-
|
|
91
|
+
X as Header
|
|
91
92
|
};
|
|
@@ -1,75 +1,76 @@
|
|
|
1
|
-
import { jsxs as q, jsx as
|
|
2
|
-
import { ListItemBase as
|
|
3
|
-
import { ListItemHeader as
|
|
4
|
-
const
|
|
5
|
-
className:
|
|
6
|
-
variant:
|
|
1
|
+
import { jsxs as q, jsx as w } from "react/jsx-runtime";
|
|
2
|
+
import { ListItemBase as z } from "./ListItemBase.js";
|
|
3
|
+
import { ListItemHeader as A } from "./ListItemHeader.js";
|
|
4
|
+
const F = ({
|
|
5
|
+
className: p,
|
|
6
|
+
variant: c = "solid",
|
|
7
7
|
color: r,
|
|
8
|
-
theme:
|
|
9
|
-
shadow:
|
|
10
|
-
loading:
|
|
8
|
+
theme: m = "default",
|
|
9
|
+
shadow: e = "xs",
|
|
10
|
+
loading: o,
|
|
11
11
|
collapsible: n,
|
|
12
12
|
expanded: s,
|
|
13
|
-
size:
|
|
14
|
-
icon:
|
|
15
|
-
avatar:
|
|
16
|
-
avatarGroup:
|
|
17
|
-
title:
|
|
18
|
-
titleAs:
|
|
19
|
-
description:
|
|
20
|
-
badge:
|
|
21
|
-
linkIcon:
|
|
13
|
+
size: u = "sm",
|
|
14
|
+
icon: L,
|
|
15
|
+
avatar: l,
|
|
16
|
+
avatarGroup: I,
|
|
17
|
+
title: f,
|
|
18
|
+
titleAs: j,
|
|
19
|
+
description: x,
|
|
20
|
+
badge: a,
|
|
21
|
+
linkIcon: h = !1,
|
|
22
22
|
label: t,
|
|
23
|
-
select:
|
|
24
|
-
selected:
|
|
25
|
-
controls:
|
|
26
|
-
children:
|
|
27
|
-
interactive:
|
|
23
|
+
select: y,
|
|
24
|
+
selected: B,
|
|
25
|
+
controls: H,
|
|
26
|
+
children: b,
|
|
27
|
+
interactive: i,
|
|
28
28
|
...d
|
|
29
29
|
}) => {
|
|
30
30
|
const k = typeof t == "function" ? t() : t;
|
|
31
31
|
return /* @__PURE__ */ q(
|
|
32
|
-
|
|
32
|
+
z,
|
|
33
33
|
{
|
|
34
|
-
variant:
|
|
34
|
+
variant: c,
|
|
35
35
|
color: r,
|
|
36
|
-
theme:
|
|
37
|
-
shadow:
|
|
38
|
-
selected:
|
|
36
|
+
theme: m,
|
|
37
|
+
shadow: e,
|
|
38
|
+
selected: B,
|
|
39
39
|
expanded: s,
|
|
40
|
-
title:
|
|
41
|
-
loading:
|
|
42
|
-
interactive:
|
|
40
|
+
title: f,
|
|
41
|
+
loading: o,
|
|
42
|
+
interactive: i,
|
|
43
43
|
children: [
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
|
|
44
|
+
/* @__PURE__ */ w(
|
|
45
|
+
A,
|
|
46
46
|
{
|
|
47
|
-
className:
|
|
47
|
+
className: p,
|
|
48
48
|
color: r,
|
|
49
|
-
theme:
|
|
50
|
-
loading:
|
|
51
|
-
linkIcon:
|
|
49
|
+
theme: m,
|
|
50
|
+
loading: o,
|
|
51
|
+
linkIcon: h,
|
|
52
52
|
collapsible: n,
|
|
53
53
|
expanded: s,
|
|
54
|
-
select:
|
|
55
|
-
size:
|
|
56
|
-
title:
|
|
57
|
-
description:
|
|
58
|
-
icon:
|
|
59
|
-
avatar:
|
|
60
|
-
avatarGroup:
|
|
61
|
-
badge:
|
|
62
|
-
controls:
|
|
63
|
-
titleAs:
|
|
54
|
+
select: y,
|
|
55
|
+
size: u,
|
|
56
|
+
title: f,
|
|
57
|
+
description: x,
|
|
58
|
+
icon: L,
|
|
59
|
+
avatar: l,
|
|
60
|
+
avatarGroup: I,
|
|
61
|
+
badge: a,
|
|
62
|
+
controls: H,
|
|
63
|
+
titleAs: j,
|
|
64
|
+
interactive: i,
|
|
64
65
|
...d,
|
|
65
66
|
children: k
|
|
66
67
|
}
|
|
67
68
|
),
|
|
68
|
-
s ?
|
|
69
|
+
s ? b : null
|
|
69
70
|
]
|
|
70
71
|
}
|
|
71
72
|
);
|
|
72
73
|
};
|
|
73
74
|
export {
|
|
74
|
-
|
|
75
|
+
F as ListItem
|
|
75
76
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import { c as
|
|
3
|
-
import '../../assets/MenuBase.css';const
|
|
4
|
-
menu:
|
|
5
|
-
list:
|
|
6
|
-
item:
|
|
7
|
-
}, d = ({ as: t = "nav", color: n, theme: e, className: o, children: s }) => /* @__PURE__ */ m(t, { className: a
|
|
2
|
+
import { c as i } from "../../index-L8X2o7IH.js";
|
|
3
|
+
import '../../assets/MenuBase.css';const p = "_menu_twp4i_1", r = "_list_twp4i_12", u = "_item_twp4i_18", a = {
|
|
4
|
+
menu: p,
|
|
5
|
+
list: r,
|
|
6
|
+
item: u
|
|
7
|
+
}, d = ({ as: t = "nav", color: n, theme: e, className: o, children: s }) => /* @__PURE__ */ m(t, { className: i(a.menu, o), "data-color": n, "data-theme": e, children: s }), x = ({ as: t = "ul", role: n = "group", className: e, children: o }) => /* @__PURE__ */ m(t, { className: i(a.list, e), role: n, children: o }), w = ({
|
|
8
8
|
as: t = "li",
|
|
9
9
|
role: n = "presentation",
|
|
10
10
|
className: e,
|
|
11
11
|
children: o,
|
|
12
12
|
style: s,
|
|
13
|
-
dataIndex:
|
|
14
|
-
}) => /* @__PURE__ */ m(t, { className: a
|
|
13
|
+
dataIndex: c
|
|
14
|
+
}) => /* @__PURE__ */ m(t, { className: i(a.item, e), role: n, style: s, "data-index": c, children: o });
|
|
15
15
|
export {
|
|
16
16
|
d as MenuBase,
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
x as MenuList,
|
|
18
|
+
w as MenuListItem
|
|
19
19
|
};
|
|
@@ -12,36 +12,36 @@ import { MenuHeader as L } from "./MenuHeader.js";
|
|
|
12
12
|
import { MenuList as W, MenuListItem as j } from "./MenuBase.js";
|
|
13
13
|
import "../Search/AutocompleteBase.js";
|
|
14
14
|
import "../Snackbar/useSnackbar.js";
|
|
15
|
-
import '../../assets/MenuItemsVirtual.css';function
|
|
15
|
+
import '../../assets/MenuItemsVirtual.css';function y(r, l, e) {
|
|
16
16
|
let s = e.initialDeps ?? [], t;
|
|
17
17
|
function n() {
|
|
18
|
-
var i, o,
|
|
19
|
-
let
|
|
20
|
-
e.key && ((i = e.debug) != null && i.call(e)) && (
|
|
18
|
+
var i, o, a, c;
|
|
19
|
+
let h;
|
|
20
|
+
e.key && ((i = e.debug) != null && i.call(e)) && (h = Date.now());
|
|
21
21
|
const f = r();
|
|
22
|
-
if (!(f.length !== s.length || f.some((
|
|
22
|
+
if (!(f.length !== s.length || f.some((u, p) => s[p] !== u)))
|
|
23
23
|
return t;
|
|
24
24
|
s = f;
|
|
25
25
|
let d;
|
|
26
|
-
if (e.key && ((o = e.debug) != null && o.call(e)) && (d = Date.now()), t = l(...f), e.key && ((
|
|
27
|
-
const
|
|
26
|
+
if (e.key && ((o = e.debug) != null && o.call(e)) && (d = Date.now()), t = l(...f), e.key && ((a = e.debug) != null && a.call(e))) {
|
|
27
|
+
const u = Math.round((Date.now() - h) * 100) / 100, p = Math.round((Date.now() - d) * 100) / 100, x = p / 16, v = (g, b) => {
|
|
28
28
|
for (g = String(g); g.length < b; )
|
|
29
29
|
g = " " + g;
|
|
30
30
|
return g;
|
|
31
31
|
};
|
|
32
32
|
console.info(
|
|
33
|
-
`%c⏱ ${
|
|
33
|
+
`%c⏱ ${v(p, 5)} /${v(u, 5)} ms`,
|
|
34
34
|
`
|
|
35
35
|
font-size: .6rem;
|
|
36
36
|
font-weight: bold;
|
|
37
37
|
color: hsl(${Math.max(
|
|
38
38
|
0,
|
|
39
|
-
Math.min(120 - 120 *
|
|
39
|
+
Math.min(120 - 120 * x, 120)
|
|
40
40
|
)}deg 100% 31%);`,
|
|
41
41
|
e == null ? void 0 : e.key
|
|
42
42
|
);
|
|
43
43
|
}
|
|
44
|
-
return (
|
|
44
|
+
return (c = e == null ? void 0 : e.onChange) == null || c.call(e, t), t;
|
|
45
45
|
}
|
|
46
46
|
return n.updateDeps = (i) => {
|
|
47
47
|
s = i;
|
|
@@ -70,19 +70,19 @@ const B = (r, l) => Math.abs(r - l) < 1, $ = (r, l, e) => {
|
|
|
70
70
|
if (!s)
|
|
71
71
|
return;
|
|
72
72
|
const t = (i) => {
|
|
73
|
-
const { width: o, height:
|
|
74
|
-
l({ width: Math.round(o), height: Math.round(
|
|
73
|
+
const { width: o, height: a } = i;
|
|
74
|
+
l({ width: Math.round(o), height: Math.round(a) });
|
|
75
75
|
};
|
|
76
76
|
if (t(e.getBoundingClientRect()), !s.ResizeObserver)
|
|
77
77
|
return () => {
|
|
78
78
|
};
|
|
79
79
|
const n = new s.ResizeObserver((i) => {
|
|
80
80
|
const o = () => {
|
|
81
|
-
const
|
|
82
|
-
if (
|
|
83
|
-
const
|
|
84
|
-
if (
|
|
85
|
-
t({ width:
|
|
81
|
+
const a = i[0];
|
|
82
|
+
if (a != null && a.borderBoxSize) {
|
|
83
|
+
const c = a.borderBoxSize[0];
|
|
84
|
+
if (c) {
|
|
85
|
+
t({ width: c.inlineSize, height: c.blockSize });
|
|
86
86
|
return;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
@@ -110,14 +110,14 @@ const B = (r, l) => Math.abs(r - l) < 1, $ = (r, l, e) => {
|
|
|
110
110
|
l(t, !1);
|
|
111
111
|
},
|
|
112
112
|
r.options.isScrollingResetDelay
|
|
113
|
-
), i = (
|
|
113
|
+
), i = (h) => () => {
|
|
114
114
|
const { horizontal: f, isRtl: m } = r.options;
|
|
115
|
-
t = f ? e.scrollLeft * (m && -1 || 1) : e.scrollTop, n(), l(t,
|
|
116
|
-
}, o = i(!0),
|
|
117
|
-
|
|
118
|
-
const
|
|
119
|
-
return
|
|
120
|
-
e.removeEventListener("scroll", o),
|
|
115
|
+
t = f ? e.scrollLeft * (m && -1 || 1) : e.scrollTop, n(), l(t, h);
|
|
116
|
+
}, o = i(!0), a = i(!1);
|
|
117
|
+
a(), e.addEventListener("scroll", o, C);
|
|
118
|
+
const c = r.options.useScrollendEvent && T;
|
|
119
|
+
return c && e.addEventListener("scrollend", a, C), () => {
|
|
120
|
+
e.removeEventListener("scroll", o), c && e.removeEventListener("scrollend", a);
|
|
121
121
|
};
|
|
122
122
|
}, Y = (r, l, e) => {
|
|
123
123
|
if (l != null && l.borderBoxSize) {
|
|
@@ -200,7 +200,7 @@ class J {
|
|
|
200
200
|
}, this.notify = (e) => {
|
|
201
201
|
var s, t;
|
|
202
202
|
(t = (s = this.options).onChange) == null || t.call(s, this, e);
|
|
203
|
-
}, this.maybeNotify =
|
|
203
|
+
}, this.maybeNotify = y(
|
|
204
204
|
() => (this.calculateRange(), [
|
|
205
205
|
this.isScrolling,
|
|
206
206
|
this.range ? this.range.startIndex : null,
|
|
@@ -251,14 +251,14 @@ class J {
|
|
|
251
251
|
const o = e[i];
|
|
252
252
|
if (t.has(o.lane))
|
|
253
253
|
continue;
|
|
254
|
-
const
|
|
254
|
+
const a = n.get(
|
|
255
255
|
o.lane
|
|
256
256
|
);
|
|
257
|
-
if (
|
|
257
|
+
if (a == null || o.end > a.end ? n.set(o.lane, o) : o.end < a.end && t.set(o.lane, !0), t.size === this.options.lanes)
|
|
258
258
|
break;
|
|
259
259
|
}
|
|
260
260
|
return n.size === this.options.lanes ? Array.from(n.values()).sort((i, o) => i.end === o.end ? i.index - o.index : i.end - o.end)[0] : void 0;
|
|
261
|
-
}, this.getMeasurementOptions =
|
|
261
|
+
}, this.getMeasurementOptions = y(
|
|
262
262
|
() => [
|
|
263
263
|
this.options.count,
|
|
264
264
|
this.options.paddingStart,
|
|
@@ -276,35 +276,35 @@ class J {
|
|
|
276
276
|
{
|
|
277
277
|
key: !1
|
|
278
278
|
}
|
|
279
|
-
), this.getMeasurements =
|
|
279
|
+
), this.getMeasurements = y(
|
|
280
280
|
() => [this.getMeasurementOptions(), this.itemSizeCache],
|
|
281
281
|
({ count: e, paddingStart: s, scrollMargin: t, getItemKey: n, enabled: i }, o) => {
|
|
282
282
|
if (!i)
|
|
283
283
|
return this.measurementsCache = [], this.itemSizeCache.clear(), [];
|
|
284
|
-
this.measurementsCache.length === 0 && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((
|
|
285
|
-
this.itemSizeCache.set(
|
|
284
|
+
this.measurementsCache.length === 0 && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((h) => {
|
|
285
|
+
this.itemSizeCache.set(h.key, h.size);
|
|
286
286
|
}));
|
|
287
|
-
const
|
|
287
|
+
const a = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
|
288
288
|
this.pendingMeasuredCacheIndexes = [];
|
|
289
|
-
const
|
|
290
|
-
for (let
|
|
291
|
-
const f = n(
|
|
292
|
-
|
|
293
|
-
index:
|
|
289
|
+
const c = this.measurementsCache.slice(0, a);
|
|
290
|
+
for (let h = a; h < e; h++) {
|
|
291
|
+
const f = n(h), m = this.options.lanes === 1 ? c[h - 1] : this.getFurthestMeasurement(c, h), d = m ? m.end + this.options.gap : s + t, u = o.get(f), p = typeof u == "number" ? u : this.options.estimateSize(h), x = d + p, v = m ? m.lane : h % this.options.lanes;
|
|
292
|
+
c[h] = {
|
|
293
|
+
index: h,
|
|
294
294
|
start: d,
|
|
295
295
|
size: p,
|
|
296
|
-
end:
|
|
296
|
+
end: x,
|
|
297
297
|
key: f,
|
|
298
|
-
lane:
|
|
298
|
+
lane: v
|
|
299
299
|
};
|
|
300
300
|
}
|
|
301
|
-
return this.measurementsCache =
|
|
301
|
+
return this.measurementsCache = c, c;
|
|
302
302
|
},
|
|
303
303
|
{
|
|
304
304
|
key: process.env.NODE_ENV !== "production" && "getMeasurements",
|
|
305
305
|
debug: () => this.options.debug
|
|
306
306
|
}
|
|
307
|
-
), this.calculateRange =
|
|
307
|
+
), this.calculateRange = y(
|
|
308
308
|
() => [
|
|
309
309
|
this.getMeasurements(),
|
|
310
310
|
this.getSize(),
|
|
@@ -321,7 +321,7 @@ class J {
|
|
|
321
321
|
key: process.env.NODE_ENV !== "production" && "calculateRange",
|
|
322
322
|
debug: () => this.options.debug
|
|
323
323
|
}
|
|
324
|
-
), this.getVirtualIndexes =
|
|
324
|
+
), this.getVirtualIndexes = y(
|
|
325
325
|
() => {
|
|
326
326
|
let e = null, s = null;
|
|
327
327
|
const t = this.calculateRange();
|
|
@@ -371,13 +371,13 @@ class J {
|
|
|
371
371
|
return;
|
|
372
372
|
}
|
|
373
373
|
this._measureElement(e, void 0);
|
|
374
|
-
}, this.getVirtualItems =
|
|
374
|
+
}, this.getVirtualItems = y(
|
|
375
375
|
() => [this.getVirtualIndexes(), this.getMeasurements()],
|
|
376
376
|
(e, s) => {
|
|
377
377
|
const t = [];
|
|
378
378
|
for (let n = 0, i = e.length; n < i; n++) {
|
|
379
|
-
const o = e[n],
|
|
380
|
-
t.push(
|
|
379
|
+
const o = e[n], a = s[o];
|
|
380
|
+
t.push(a);
|
|
381
381
|
}
|
|
382
382
|
return t;
|
|
383
383
|
},
|
|
@@ -399,8 +399,8 @@ class J {
|
|
|
399
399
|
}, this.getOffsetForAlignment = (e, s, t = 0) => {
|
|
400
400
|
const n = this.getSize(), i = this.getScrollOffset();
|
|
401
401
|
s === "auto" && (s = e >= i + n ? "end" : "start"), s === "center" ? e += (t - n) / 2 : s === "end" && (e -= n);
|
|
402
|
-
const o = this.options.horizontal ? "scrollWidth" : "scrollHeight",
|
|
403
|
-
return Math.max(Math.min(
|
|
402
|
+
const o = this.options.horizontal ? "scrollWidth" : "scrollHeight", c = (this.scrollElement ? "document" in this.scrollElement ? this.scrollElement.document.documentElement[o] : this.scrollElement[o] : 0) - n;
|
|
403
|
+
return Math.max(Math.min(c, e), 0);
|
|
404
404
|
}, this.getOffsetForIndex = (e, s = "auto") => {
|
|
405
405
|
e = Math.max(0, Math.min(e, this.options.count - 1));
|
|
406
406
|
const t = this.measurementsCache[e];
|
|
@@ -439,10 +439,10 @@ class J {
|
|
|
439
439
|
if (this.scrollToIndexTimeoutId = null, this.elementsCache.has(
|
|
440
440
|
this.options.getItemKey(e)
|
|
441
441
|
)) {
|
|
442
|
-
const [
|
|
442
|
+
const [c] = I(
|
|
443
443
|
this.getOffsetForIndex(e, o)
|
|
444
444
|
);
|
|
445
|
-
B(
|
|
445
|
+
B(c, this.getScrollOffset()) || this.scrollToIndex(e, { align: o, behavior: t });
|
|
446
446
|
} else
|
|
447
447
|
this.scrollToIndex(e, { align: o, behavior: t });
|
|
448
448
|
}));
|
|
@@ -506,22 +506,22 @@ function Q({
|
|
|
506
506
|
let i = D(
|
|
507
507
|
0,
|
|
508
508
|
t,
|
|
509
|
-
(
|
|
509
|
+
(a) => r[a].start,
|
|
510
510
|
e
|
|
511
511
|
), o = i;
|
|
512
512
|
if (s === 1)
|
|
513
513
|
for (; o < t && r[o].end < e + l; )
|
|
514
514
|
o++;
|
|
515
515
|
else if (s > 1) {
|
|
516
|
-
const
|
|
517
|
-
for (; o < t &&
|
|
518
|
-
const
|
|
519
|
-
h
|
|
516
|
+
const a = Array(s).fill(0);
|
|
517
|
+
for (; o < t && a.some((h) => h < e + l); ) {
|
|
518
|
+
const h = r[o];
|
|
519
|
+
a[h.lane] = h.end, o++;
|
|
520
520
|
}
|
|
521
|
-
const
|
|
522
|
-
for (; i > 0 &&
|
|
523
|
-
const
|
|
524
|
-
|
|
521
|
+
const c = Array(s).fill(e + l);
|
|
522
|
+
for (; i > 0 && c.some((h) => h >= e); ) {
|
|
523
|
+
const h = r[i];
|
|
524
|
+
c[h.lane] = h.start, i--;
|
|
525
525
|
}
|
|
526
526
|
i = Math.max(0, i - i % s), o = Math.min(t, o + (s - 1 - o % s));
|
|
527
527
|
}
|
|
@@ -548,7 +548,7 @@ function Z(r) {
|
|
|
548
548
|
...r
|
|
549
549
|
});
|
|
550
550
|
}
|
|
551
|
-
const ee = "
|
|
551
|
+
const ee = "_virtualScrollRef_12fdc_1", te = "_virtualMenuListItem_12fdc_6", R = {
|
|
552
552
|
virtualScrollRef: ee,
|
|
553
553
|
virtualMenuListItem: te
|
|
554
554
|
}, me = ({
|
|
@@ -561,67 +561,65 @@ const ee = "_virtualScrollRef_1kwwy_1", te = "_virtualMenuListItem_1kwwy_6", R =
|
|
|
561
561
|
defaultItemTheme: i,
|
|
562
562
|
defaultIconTheme: o
|
|
563
563
|
}) => {
|
|
564
|
-
const { menu:
|
|
564
|
+
const { menu: a } = F({
|
|
565
565
|
items: e,
|
|
566
566
|
groups: s,
|
|
567
567
|
groupByKey: "groupId",
|
|
568
568
|
keyboardEvents: !1
|
|
569
|
-
}),
|
|
569
|
+
}), c = k(null), h = a.flatMap((d, u) => {
|
|
570
570
|
var g;
|
|
571
|
-
const p = (d == null ? void 0 : d.props) || {}, { title:
|
|
571
|
+
const p = (d == null ? void 0 : d.props) || {}, { title: x } = p, v = ((g = d == null ? void 0 : d.items) == null ? void 0 : g.filter((b) => {
|
|
572
572
|
var M;
|
|
573
573
|
return !((M = b.props) != null && M.hidden);
|
|
574
574
|
})) || [];
|
|
575
575
|
return [
|
|
576
|
-
...
|
|
577
|
-
...
|
|
578
|
-
...
|
|
576
|
+
...u > 0 || r > 0 ? [{ type: "separator" }] : [],
|
|
577
|
+
...x ? [{ type: "title", title: x }] : [],
|
|
578
|
+
...v.map((b, M) => {
|
|
579
579
|
var z, O;
|
|
580
580
|
return {
|
|
581
581
|
type: "item",
|
|
582
582
|
itemProps: b.props || {},
|
|
583
583
|
active: b.active,
|
|
584
584
|
hasChildren: ((z = b.props) == null ? void 0 : z.expanded) && ((O = b.props) == null ? void 0 : O.items),
|
|
585
|
-
isLastItem: M ===
|
|
585
|
+
isLastItem: M === v.length - 1
|
|
586
586
|
};
|
|
587
587
|
})
|
|
588
588
|
];
|
|
589
589
|
}), f = Z({
|
|
590
|
-
count:
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
},
|
|
595
|
-
getScrollElement: () => u.current
|
|
590
|
+
count: h.length,
|
|
591
|
+
gap: 8,
|
|
592
|
+
estimateSize: () => 44,
|
|
593
|
+
getScrollElement: () => c.current
|
|
596
594
|
}), m = f.getVirtualItems();
|
|
597
595
|
return A(() => {
|
|
598
596
|
for (const d of m) {
|
|
599
|
-
const
|
|
600
|
-
|
|
597
|
+
const u = document.querySelector(`[data-index="${d.index}"]`);
|
|
598
|
+
u && f.measureElement(u);
|
|
601
599
|
}
|
|
602
600
|
}, [m]), /* @__PURE__ */ w(W, { children: [
|
|
603
601
|
l && /* @__PURE__ */ E(V, { ...l }),
|
|
604
|
-
/* @__PURE__ */ E("div", { ref:
|
|
605
|
-
const
|
|
606
|
-
return
|
|
602
|
+
/* @__PURE__ */ E("div", { ref: c, className: R.virtualScrollRef, children: /* @__PURE__ */ E("div", { style: { position: "relative", height: `${f.getTotalSize()}px` }, children: m.map((d) => {
|
|
603
|
+
const u = h[d.index];
|
|
604
|
+
return u ? /* @__PURE__ */ w(
|
|
607
605
|
j,
|
|
608
606
|
{
|
|
609
607
|
dataIndex: d.index,
|
|
610
608
|
className: R.virtualMenuListItem,
|
|
611
609
|
style: { transform: `translateY(${d.start}px)` },
|
|
612
|
-
role:
|
|
610
|
+
role: u.type === "separator" ? "separator" : void 0,
|
|
613
611
|
children: [
|
|
614
|
-
|
|
615
|
-
|
|
612
|
+
u.type === "title" && /* @__PURE__ */ E(L, { title: u.title }),
|
|
613
|
+
u.type === "item" && /* @__PURE__ */ E(
|
|
616
614
|
P,
|
|
617
615
|
{
|
|
618
|
-
...
|
|
619
|
-
size:
|
|
620
|
-
color:
|
|
621
|
-
theme:
|
|
622
|
-
iconTheme:
|
|
623
|
-
active:
|
|
624
|
-
tabIndex:
|
|
616
|
+
...u.itemProps,
|
|
617
|
+
size: u.itemProps.size || t,
|
|
618
|
+
color: u.itemProps.color || n,
|
|
619
|
+
theme: u.itemProps.theme || i,
|
|
620
|
+
iconTheme: u.itemProps.iconTheme || o,
|
|
621
|
+
active: u.active,
|
|
622
|
+
tabIndex: u.itemProps.disabled ? -1 : 0
|
|
625
623
|
}
|
|
626
624
|
)
|
|
627
625
|
]
|
|
@@ -7,25 +7,25 @@ import "../RootProvider/RootProvider.js";
|
|
|
7
7
|
import "../Search/AutocompleteBase.js";
|
|
8
8
|
import "../Snackbar/useSnackbar.js";
|
|
9
9
|
import { S as l } from "../../MagnifyingGlass-DWIcpwS4.js";
|
|
10
|
-
import { S as
|
|
11
|
-
import '../../assets/ToolbarSearch.css';const
|
|
12
|
-
field:
|
|
10
|
+
import { S as _ } from "../../XMark-Bv1I87Ev.js";
|
|
11
|
+
import '../../assets/ToolbarSearch.css';const u = "_field_3uyps_1", f = "_icon_3uyps_5", d = "_input_3uyps_14", y = "_clear_3uyps_31", o = {
|
|
12
|
+
field: u,
|
|
13
13
|
icon: f,
|
|
14
14
|
input: d,
|
|
15
15
|
clear: y
|
|
16
16
|
}, T = ({
|
|
17
|
-
value:
|
|
17
|
+
value: s,
|
|
18
18
|
name: r,
|
|
19
19
|
placeholder: c = "Search",
|
|
20
20
|
clearButtonAltText: n = "Clear search",
|
|
21
21
|
onChange: e,
|
|
22
|
-
onClear:
|
|
22
|
+
onClear: t
|
|
23
23
|
}) => /* @__PURE__ */ a("div", { className: o.field, children: [
|
|
24
24
|
/* @__PURE__ */ i(
|
|
25
25
|
"input",
|
|
26
26
|
{
|
|
27
27
|
type: "search",
|
|
28
|
-
value:
|
|
28
|
+
value: s,
|
|
29
29
|
name: r,
|
|
30
30
|
placeholder: c,
|
|
31
31
|
className: o.input,
|
|
@@ -33,14 +33,14 @@ import '../../assets/ToolbarSearch.css';const _ = "_field_3uyps_1", f = "_icon_3
|
|
|
33
33
|
}
|
|
34
34
|
),
|
|
35
35
|
/* @__PURE__ */ i(m, { svgElement: l, className: o.icon }),
|
|
36
|
-
s && /* @__PURE__ */ i(
|
|
36
|
+
t && !!s && /* @__PURE__ */ i(
|
|
37
37
|
p,
|
|
38
38
|
{
|
|
39
|
-
icon:
|
|
39
|
+
icon: _,
|
|
40
40
|
variant: "solid",
|
|
41
41
|
size: "custom",
|
|
42
42
|
className: o.clear,
|
|
43
|
-
onClick:
|
|
43
|
+
onClick: t,
|
|
44
44
|
iconAltText: n
|
|
45
45
|
}
|
|
46
46
|
)
|
|
@@ -20,3 +20,4 @@ declare const meta: {
|
|
|
20
20
|
export default meta;
|
|
21
21
|
export declare const CurrentAccount: (args: HeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
export declare const Login: (args: HeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const ChangeLocale: (args: HeaderProps) => import("react/jsx-runtime").JSX.Element;
|