@altinn/altinn-components 0.16.0 → 0.18.0
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/README.md +39 -31
- package/dist/ListItemBase-BVx5MDhO.js +83 -0
- package/dist/assets/Flex.css +1 -1
- package/dist/assets/ListItemBase.css +1 -1
- package/dist/assets/ListItemIcon.css +1 -1
- package/dist/components/AccessAreaList/AccessAreaListItem.js +26 -21
- package/dist/components/AccessPackageList/AccessPackageListItem.js +8 -16
- package/dist/components/Bookmarks/BookmarksSection.js +19 -19
- package/dist/components/Dialog/DialogListItem.js +12 -13
- package/dist/components/Dialog/SeenByLog.js +0 -1
- package/dist/components/List/List.js +3 -3
- package/dist/components/List/ListBase.js +2 -2
- package/dist/components/List/ListItem.js +62 -62
- package/dist/components/List/ListItemBase.js +4 -78
- package/dist/components/List/ListItemHeader.js +48 -48
- package/dist/components/List/ListItemIcon.js +6 -6
- package/dist/components/List/index.js +1 -1
- package/dist/components/Page/Flex.js +7 -7
- package/dist/components/Search/Autocomplete.js +27 -24
- package/dist/components/Transmission/TransmissionItem.js +55 -58
- package/dist/components/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/types/lib/components/AccessAreaList/AccessAreaListItem.d.ts +11 -2
- package/dist/types/lib/components/AccessAreaList/AccessAreaListItem.stories.d.ts +11 -2
- package/dist/types/lib/components/AccessPackageList/AccessPackageList.stories.d.ts +11 -9
- package/dist/types/lib/components/AccessPackageList/AccessPackageListItem.d.ts +2 -3
- package/dist/types/lib/components/Dialog/DialogListItem.stories.d.ts +4 -3
- package/dist/types/lib/components/List/ListBase.stories.d.ts +3 -4
- package/dist/types/lib/components/List/ListItem.d.ts +2 -0
- package/dist/types/lib/components/List/ListItemBase.d.ts +24 -2
- package/dist/types/lib/components/List/ListItemHeader.d.ts +6 -5
- package/dist/types/lib/components/List/Patterns.stories.d.ts +0 -1
- package/dist/types/lib/components/List/Specimens.stories.d.ts +2 -2
- package/dist/types/lib/components/Page/Flex.d.ts +1 -1
- package/dist/types/lib/components/ResourceList/ResourceList.stories.d.ts +0 -7
- package/dist/types/lib/components/ResourceList/ResourceListItem.d.ts +9 -1
- package/dist/types/lib/components/ResourceList/ResourceListItem.stories.d.ts +1 -0
- package/dist/types/lib/components/Transmission/TransmissionItem.stories.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as r, jsxs as R } from "react/jsx-runtime";
|
|
2
|
+
import { s as x, L as c } from "../../ListItemBase-BVx5MDhO.js";
|
|
3
3
|
import { ListItemHeader as B } from "./ListItemHeader.js";
|
|
4
|
-
import { S as
|
|
5
|
-
import { S as
|
|
6
|
-
import { S as
|
|
7
|
-
const
|
|
4
|
+
import { S as U } from "../../ChevronRight-DUaHaWi-.js";
|
|
5
|
+
import { S as k } from "../../ChevronUp-H8Nuww4h.js";
|
|
6
|
+
import { S as l } from "../../ChevronDown-CRAwzuD3.js";
|
|
7
|
+
const K = ({
|
|
8
8
|
className: o,
|
|
9
9
|
variant: v = "solid",
|
|
10
|
-
color:
|
|
11
|
-
theme:
|
|
10
|
+
color: f,
|
|
11
|
+
theme: p = "default",
|
|
12
12
|
shadow: S = "xs",
|
|
13
|
-
loading:
|
|
13
|
+
loading: e,
|
|
14
14
|
collapsible: D,
|
|
15
15
|
expanded: m,
|
|
16
|
-
size:
|
|
17
|
-
icon:
|
|
16
|
+
size: t = "sm",
|
|
17
|
+
icon: u,
|
|
18
18
|
avatar: L,
|
|
19
|
-
avatarGroup:
|
|
19
|
+
avatarGroup: I,
|
|
20
20
|
title: i,
|
|
21
|
-
description:
|
|
22
|
-
badge:
|
|
23
|
-
linkIcon: H =
|
|
24
|
-
label:
|
|
25
|
-
select:
|
|
21
|
+
description: C,
|
|
22
|
+
badge: j,
|
|
23
|
+
linkIcon: H = !1,
|
|
24
|
+
label: h,
|
|
25
|
+
select: y,
|
|
26
26
|
controls: n,
|
|
27
|
-
children:
|
|
28
|
-
...
|
|
27
|
+
children: N,
|
|
28
|
+
...s
|
|
29
29
|
}) => {
|
|
30
|
-
const
|
|
31
|
-
return m ? /* @__PURE__ */
|
|
32
|
-
|
|
30
|
+
const a = D ? m ? k : l : void 0, d = typeof h == "function" ? h() : h;
|
|
31
|
+
return m ? /* @__PURE__ */ r("li", { className: x.item, children: /* @__PURE__ */ R(
|
|
32
|
+
c,
|
|
33
33
|
{
|
|
34
34
|
interactive: !1,
|
|
35
35
|
variant: v,
|
|
36
|
-
color:
|
|
37
|
-
theme:
|
|
36
|
+
color: f,
|
|
37
|
+
theme: p,
|
|
38
38
|
shadow: S,
|
|
39
39
|
expanded: m,
|
|
40
40
|
title: i,
|
|
41
|
-
loading:
|
|
41
|
+
loading: e,
|
|
42
42
|
children: [
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
|
|
43
|
+
/* @__PURE__ */ r(
|
|
44
|
+
c,
|
|
45
45
|
{
|
|
46
46
|
theme: "transparent",
|
|
47
47
|
interactive: !n,
|
|
48
|
-
size:
|
|
49
|
-
color:
|
|
50
|
-
loading:
|
|
48
|
+
size: t,
|
|
49
|
+
color: f,
|
|
50
|
+
loading: e,
|
|
51
51
|
title: i,
|
|
52
|
-
...
|
|
53
|
-
children: /* @__PURE__ */
|
|
52
|
+
...s,
|
|
53
|
+
children: /* @__PURE__ */ r(
|
|
54
54
|
B,
|
|
55
55
|
{
|
|
56
56
|
className: o,
|
|
57
|
-
loading:
|
|
58
|
-
select:
|
|
59
|
-
size:
|
|
57
|
+
loading: e,
|
|
58
|
+
select: y,
|
|
59
|
+
size: t,
|
|
60
60
|
title: i,
|
|
61
|
-
description:
|
|
62
|
-
icon:
|
|
61
|
+
description: C,
|
|
62
|
+
icon: u,
|
|
63
63
|
avatar: L,
|
|
64
|
-
avatarGroup:
|
|
65
|
-
badge:
|
|
66
|
-
|
|
64
|
+
avatarGroup: I,
|
|
65
|
+
badge: j,
|
|
66
|
+
chevron: a,
|
|
67
67
|
controls: n,
|
|
68
|
-
...
|
|
69
|
-
children:
|
|
68
|
+
...s,
|
|
69
|
+
children: d
|
|
70
70
|
}
|
|
71
71
|
)
|
|
72
72
|
}
|
|
73
73
|
),
|
|
74
|
-
|
|
74
|
+
N
|
|
75
75
|
]
|
|
76
76
|
}
|
|
77
|
-
) : /* @__PURE__ */
|
|
78
|
-
|
|
77
|
+
) }) : /* @__PURE__ */ r("li", { className: x.item, children: /* @__PURE__ */ r(
|
|
78
|
+
c,
|
|
79
79
|
{
|
|
80
80
|
interactive: !n,
|
|
81
81
|
variant: v,
|
|
82
|
-
color:
|
|
83
|
-
theme:
|
|
82
|
+
color: f,
|
|
83
|
+
theme: p,
|
|
84
84
|
shadow: S,
|
|
85
85
|
expanded: m,
|
|
86
|
-
loading:
|
|
86
|
+
loading: e,
|
|
87
87
|
title: i,
|
|
88
|
-
...
|
|
89
|
-
children: /* @__PURE__ */
|
|
88
|
+
...s,
|
|
89
|
+
children: /* @__PURE__ */ r(
|
|
90
90
|
B,
|
|
91
91
|
{
|
|
92
92
|
className: o,
|
|
93
|
-
loading:
|
|
94
|
-
select:
|
|
95
|
-
size:
|
|
93
|
+
loading: e,
|
|
94
|
+
select: y,
|
|
95
|
+
size: t,
|
|
96
96
|
title: i,
|
|
97
|
-
description:
|
|
98
|
-
icon:
|
|
97
|
+
description: C,
|
|
98
|
+
icon: u,
|
|
99
99
|
avatar: L,
|
|
100
|
-
avatarGroup:
|
|
101
|
-
badge:
|
|
102
|
-
|
|
100
|
+
avatarGroup: I,
|
|
101
|
+
badge: j,
|
|
102
|
+
chevron: a ?? (H ? U : void 0),
|
|
103
103
|
controls: n,
|
|
104
|
-
...
|
|
105
|
-
children:
|
|
104
|
+
...s,
|
|
105
|
+
children: d
|
|
106
106
|
}
|
|
107
107
|
)
|
|
108
108
|
}
|
|
109
|
-
);
|
|
109
|
+
) });
|
|
110
110
|
};
|
|
111
111
|
export {
|
|
112
|
-
|
|
112
|
+
K as ListItem
|
|
113
113
|
};
|
|
@@ -1,80 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
item: B,
|
|
5
|
-
interactive: E,
|
|
6
|
-
interactiveSelected: I,
|
|
7
|
-
interactiveHidden: L
|
|
8
|
-
}, F = ({
|
|
9
|
-
title: S,
|
|
10
|
-
interactive: f = !0,
|
|
11
|
-
as: q,
|
|
12
|
-
href: u,
|
|
13
|
-
onClick: a,
|
|
14
|
-
onKeyPress: e,
|
|
15
|
-
tabIndex: H,
|
|
16
|
-
size: c,
|
|
17
|
-
variant: d,
|
|
18
|
-
color: s,
|
|
19
|
-
theme: i,
|
|
20
|
-
shadow: h,
|
|
21
|
-
loading: n,
|
|
22
|
-
disabled: r,
|
|
23
|
-
hidden: o = !1,
|
|
24
|
-
active: v = !1,
|
|
25
|
-
selected: m,
|
|
26
|
-
className: p,
|
|
27
|
-
children: _
|
|
28
|
-
}) => {
|
|
29
|
-
const l = i === "transparent" ? "none" : h;
|
|
30
|
-
if (f) {
|
|
31
|
-
const z = x(
|
|
32
|
-
t.item,
|
|
33
|
-
t.interactive,
|
|
34
|
-
p,
|
|
35
|
-
m && t.interactiveSelected,
|
|
36
|
-
o && t.interactiveHidden
|
|
37
|
-
);
|
|
38
|
-
return /* @__PURE__ */ w(
|
|
39
|
-
q || "button",
|
|
40
|
-
{
|
|
41
|
-
"aria-label": S,
|
|
42
|
-
className: z,
|
|
43
|
-
"data-variant": d,
|
|
44
|
-
"data-color": s,
|
|
45
|
-
"data-theme": i,
|
|
46
|
-
"data-size": c,
|
|
47
|
-
"data-shadow": l,
|
|
48
|
-
"data-active": v,
|
|
49
|
-
href: u,
|
|
50
|
-
onKeyPress: (b) => {
|
|
51
|
-
b.key === "Enter" && (a == null || a()), e == null || e(b);
|
|
52
|
-
},
|
|
53
|
-
onClick: a,
|
|
54
|
-
tabIndex: H,
|
|
55
|
-
"aria-disabled": r || n,
|
|
56
|
-
disabled: r || n,
|
|
57
|
-
children: _
|
|
58
|
-
}
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
const j = x(t.item, p, m && t.interactiveSelected);
|
|
62
|
-
return /* @__PURE__ */ w(
|
|
63
|
-
"article",
|
|
64
|
-
{
|
|
65
|
-
className: j,
|
|
66
|
-
"data-variant": d,
|
|
67
|
-
"data-color": s,
|
|
68
|
-
"data-theme": i,
|
|
69
|
-
"data-size": c,
|
|
70
|
-
"data-shadow": l,
|
|
71
|
-
"data-active": v,
|
|
72
|
-
"aria-hidden": o,
|
|
73
|
-
"aria-disabled": r || n,
|
|
74
|
-
children: _
|
|
75
|
-
}
|
|
76
|
-
);
|
|
77
|
-
};
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "../../index-L8X2o7IH.js";
|
|
3
|
+
import { L as e } from "../../ListItemBase-BVx5MDhO.js";
|
|
78
4
|
export {
|
|
79
|
-
|
|
5
|
+
e as ListItemBase
|
|
80
6
|
};
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
3
|
-
import { isValidElement as
|
|
1
|
+
import { jsxs as i, jsx as e, Fragment as p } from "react/jsx-runtime";
|
|
2
|
+
import { c as y } from "../../index-L8X2o7IH.js";
|
|
3
|
+
import { isValidElement as B } from "react";
|
|
4
4
|
import { Icon as d } from "../Icon/Icon.js";
|
|
5
|
-
import { Badge as
|
|
5
|
+
import { Badge as M } from "../Badge/Badge.js";
|
|
6
6
|
import "../RootProvider/RootProvider.js";
|
|
7
|
-
import { ListItemLink as
|
|
8
|
-
import { ListItemLabel as
|
|
9
|
-
import { ListItemIcon as
|
|
10
|
-
import { ListItemControls as
|
|
11
|
-
import { ListItemSelect as
|
|
7
|
+
import { ListItemLink as v } from "./ListItemLink.js";
|
|
8
|
+
import { ListItemLabel as C } from "./ListItemLabel.js";
|
|
9
|
+
import { ListItemIcon as F } from "./ListItemIcon.js";
|
|
10
|
+
import { ListItemControls as H } from "./ListItemControls.js";
|
|
11
|
+
import { ListItemSelect as V } from "./ListItemSelect.js";
|
|
12
12
|
import "../Search/AutocompleteBase.js";
|
|
13
13
|
import "../Snackbar/useSnackbar.js";
|
|
14
|
-
import '../../assets/ListItemHeader.css';const
|
|
15
|
-
header:
|
|
16
|
-
link:
|
|
14
|
+
import '../../assets/ListItemHeader.css';const b = "_header_13dzg_1", g = "_link_13dzg_39", m = {
|
|
15
|
+
header: b,
|
|
16
|
+
link: g
|
|
17
17
|
}, X = ({
|
|
18
18
|
as: f,
|
|
19
|
-
loading:
|
|
20
|
-
disabled:
|
|
19
|
+
loading: t,
|
|
20
|
+
disabled: I,
|
|
21
21
|
select: c,
|
|
22
|
-
href:
|
|
23
|
-
onClick:
|
|
24
|
-
onKeyPress:
|
|
25
|
-
tabIndex:
|
|
22
|
+
href: h,
|
|
23
|
+
onClick: L,
|
|
24
|
+
onKeyPress: x,
|
|
25
|
+
tabIndex: z,
|
|
26
26
|
size: s = "sm",
|
|
27
|
-
title:
|
|
28
|
-
description:
|
|
29
|
-
icon:
|
|
30
|
-
avatar:
|
|
27
|
+
title: k,
|
|
28
|
+
description: _,
|
|
29
|
+
icon: u,
|
|
30
|
+
avatar: N,
|
|
31
31
|
avatarGroup: S,
|
|
32
|
-
|
|
32
|
+
chevron: l,
|
|
33
33
|
badge: r,
|
|
34
|
-
controls:
|
|
34
|
+
controls: o,
|
|
35
35
|
className: j,
|
|
36
|
-
children:
|
|
36
|
+
children: E
|
|
37
37
|
}) => {
|
|
38
38
|
const n = {
|
|
39
39
|
xs: "sm",
|
|
@@ -41,46 +41,46 @@ import '../../assets/ListItemHeader.css';const V = "_header_13dzg_1", b = "_link
|
|
|
41
41
|
md: "lg",
|
|
42
42
|
lg: "lg",
|
|
43
43
|
xl: "xl"
|
|
44
|
-
}[s], a = () => r && typeof r == "object" && "label" in r ? /* @__PURE__ */ e(
|
|
45
|
-
return /* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
c && /* @__PURE__ */ e(
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
|
|
44
|
+
}[s], a = () => r && !t && typeof r == "object" && "label" in r ? /* @__PURE__ */ e(M, { ...r }) : B(r) ? r : null;
|
|
45
|
+
return /* @__PURE__ */ i("header", { className: m.header, "data-size": s, children: [
|
|
46
|
+
/* @__PURE__ */ i("div", { className: m.link, children: [
|
|
47
|
+
c && /* @__PURE__ */ e(V, { ...c, className: m.select, size: n }),
|
|
48
|
+
/* @__PURE__ */ i(
|
|
49
|
+
v,
|
|
50
50
|
{
|
|
51
|
-
interactive: !!
|
|
52
|
-
className:
|
|
51
|
+
interactive: !!o,
|
|
52
|
+
className: y(m.link, j),
|
|
53
53
|
as: f,
|
|
54
|
-
href:
|
|
55
|
-
onClick:
|
|
56
|
-
onKeyPress:
|
|
57
|
-
tabIndex:
|
|
58
|
-
loading:
|
|
59
|
-
disabled:
|
|
54
|
+
href: h,
|
|
55
|
+
onClick: L,
|
|
56
|
+
onKeyPress: x,
|
|
57
|
+
tabIndex: z,
|
|
58
|
+
loading: t,
|
|
59
|
+
disabled: I || t,
|
|
60
60
|
size: s,
|
|
61
61
|
children: [
|
|
62
62
|
/* @__PURE__ */ e(
|
|
63
|
-
|
|
63
|
+
F,
|
|
64
64
|
{
|
|
65
|
-
loading:
|
|
65
|
+
loading: t,
|
|
66
66
|
size: n,
|
|
67
|
-
icon:
|
|
68
|
-
avatar:
|
|
67
|
+
icon: u,
|
|
68
|
+
avatar: N,
|
|
69
69
|
avatarGroup: S
|
|
70
70
|
}
|
|
71
71
|
),
|
|
72
|
-
/* @__PURE__ */ e(
|
|
73
|
-
|
|
72
|
+
/* @__PURE__ */ e(C, { size: s, loading: t, title: k, description: _, children: E }),
|
|
73
|
+
o && /* @__PURE__ */ i(p, { children: [
|
|
74
74
|
a(),
|
|
75
|
-
|
|
75
|
+
l && /* @__PURE__ */ e(d, { svgElement: l, size: n })
|
|
76
76
|
] })
|
|
77
77
|
]
|
|
78
78
|
}
|
|
79
79
|
)
|
|
80
80
|
] }),
|
|
81
|
-
/* @__PURE__ */ e(
|
|
81
|
+
/* @__PURE__ */ e(H, { className: m.controls, children: o && !t ? o : /* @__PURE__ */ i(p, { children: [
|
|
82
82
|
a(),
|
|
83
|
-
|
|
83
|
+
l && /* @__PURE__ */ e(d, { svgElement: l, size: n })
|
|
84
84
|
] }) })
|
|
85
85
|
] });
|
|
86
86
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { Icon as c } from "../Icon/Icon.js";
|
|
3
3
|
import "../../index-L8X2o7IH.js";
|
|
4
|
-
import { IconOrAvatar as
|
|
4
|
+
import { IconOrAvatar as l } from "../Icon/IconOrAvatar.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "../RootProvider/RootProvider.js";
|
|
7
7
|
import "../Search/AutocompleteBase.js";
|
|
8
8
|
import "../Snackbar/useSnackbar.js";
|
|
9
|
-
import { S as
|
|
10
|
-
import '../../assets/ListItemIcon.css';const
|
|
11
|
-
|
|
12
|
-
},
|
|
9
|
+
import { S as p } from "../../XMark-Bv1I87Ev.js";
|
|
10
|
+
import '../../assets/ListItemIcon.css';const e = "_listIcon_ghios_1", I = {
|
|
11
|
+
listIcon: e
|
|
12
|
+
}, j = ({ loading: n, size: t = "sm", icon: r, avatar: m, avatarGroup: s, children: i }) => !r && !m && !s && !i ? null : n ? /* @__PURE__ */ o(c, { svgElement: p, size: t, loading: !0 }) : /* @__PURE__ */ o("span", { className: I.listIcon, children: i || /* @__PURE__ */ o(l, { size: t, icon: r, avatar: m, avatarGroup: s }) });
|
|
13
13
|
export {
|
|
14
|
-
|
|
14
|
+
j as ListItemIcon
|
|
15
15
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { L as o } from "../../ListItemBase-BVx5MDhO.js";
|
|
2
2
|
import { ListItemLink as m } from "./ListItemLink.js";
|
|
3
3
|
import { ListItemHeader as L } from "./ListItemHeader.js";
|
|
4
4
|
import { ListItemLabel as f } from "./ListItemLabel.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as v } from "react/jsx-runtime";
|
|
2
2
|
import { c as _ } from "../../index-L8X2o7IH.js";
|
|
3
|
-
import '../../assets/Flex.css';const h = "
|
|
3
|
+
import '../../assets/Flex.css';const h = "_flex_vvg9d_1", j = {
|
|
4
4
|
flex: h
|
|
5
5
|
}, C = ({
|
|
6
6
|
as: a = "div",
|
|
@@ -16,14 +16,14 @@ import '../../assets/Flex.css';const h = "_flex_8w6x1_1", j = {
|
|
|
16
16
|
margin: c,
|
|
17
17
|
bleed: f = !1,
|
|
18
18
|
className: m,
|
|
19
|
-
style:
|
|
20
|
-
children:
|
|
19
|
+
style: p,
|
|
20
|
+
children: x,
|
|
21
21
|
...g
|
|
22
|
-
}) => /* @__PURE__ */
|
|
22
|
+
}) => /* @__PURE__ */ v(
|
|
23
23
|
a,
|
|
24
24
|
{
|
|
25
25
|
className: _(j.flex, m),
|
|
26
|
-
style:
|
|
26
|
+
style: p,
|
|
27
27
|
"data-color": t,
|
|
28
28
|
"data-theme": e,
|
|
29
29
|
"data-shadow": n,
|
|
@@ -36,7 +36,7 @@ import '../../assets/Flex.css';const h = "_flex_8w6x1_1", j = {
|
|
|
36
36
|
"data-margin": c,
|
|
37
37
|
"data-bleed": f,
|
|
38
38
|
...g,
|
|
39
|
-
children:
|
|
39
|
+
children: x
|
|
40
40
|
}
|
|
41
41
|
);
|
|
42
42
|
export {
|
|
@@ -1,42 +1,45 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as v, createElement as x } from "react";
|
|
3
3
|
import "../../index-L8X2o7IH.js";
|
|
4
|
-
import { useMenu as
|
|
4
|
+
import { useMenu as A } from "../../hooks/useMenu.js";
|
|
5
5
|
import "../RootProvider/RootProvider.js";
|
|
6
|
-
import { AutocompleteBase as
|
|
7
|
-
import { AutocompleteGroup as
|
|
6
|
+
import { AutocompleteBase as I } from "./AutocompleteBase.js";
|
|
7
|
+
import { AutocompleteGroup as l } from "./AutocompleteGroup.js";
|
|
8
8
|
import { AutocompleteItem as h } from "./AutocompleteItem.js";
|
|
9
9
|
import "../Snackbar/useSnackbar.js";
|
|
10
10
|
import { useEnterKey as k } from "../../hooks/useEnterKey.js";
|
|
11
|
-
const C = ({ className: u, items:
|
|
12
|
-
const p =
|
|
11
|
+
const C = ({ className: u, items: s, groups: i = {}, expanded: n, onSelect: r }) => {
|
|
12
|
+
const p = v(null);
|
|
13
13
|
k(() => {
|
|
14
|
-
var
|
|
15
|
-
const
|
|
16
|
-
|
|
14
|
+
var e;
|
|
15
|
+
const t = (e = p.current) == null ? void 0 : e.querySelector('[data-active="true"]');
|
|
16
|
+
t == null || t.dispatchEvent(new MouseEvent("click", { bubbles: !0 })), r == null || r();
|
|
17
17
|
});
|
|
18
|
-
const { menu:
|
|
19
|
-
items:
|
|
20
|
-
groups:
|
|
18
|
+
const { menu: a, setActiveIndex: c } = A({
|
|
19
|
+
items: s,
|
|
20
|
+
groups: i,
|
|
21
21
|
groupByKey: "groupId",
|
|
22
22
|
keyboardEvents: !0
|
|
23
23
|
});
|
|
24
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ m(I, { className: u, expanded: n, ref: p, children: a.map((t, e) => /* @__PURE__ */ x(l, { ...t.props, key: e }, /* @__PURE__ */ m("ul", { children: t.items.map((d, f) => {
|
|
25
25
|
const {
|
|
26
|
-
active:
|
|
27
|
-
menuIndex:
|
|
28
|
-
props: { groupId: M, onClick:
|
|
29
|
-
} =
|
|
30
|
-
return /* @__PURE__ */
|
|
26
|
+
active: y,
|
|
27
|
+
menuIndex: E,
|
|
28
|
+
props: { groupId: M, onClick: o, ...b }
|
|
29
|
+
} = d;
|
|
30
|
+
return /* @__PURE__ */ m(
|
|
31
31
|
h,
|
|
32
32
|
{
|
|
33
|
-
|
|
33
|
+
tabIndex: -1,
|
|
34
|
+
onMouseEnter: () => c(E),
|
|
35
|
+
...b,
|
|
34
36
|
onClick: () => {
|
|
35
|
-
|
|
37
|
+
o == null || o(), r == null || r();
|
|
36
38
|
},
|
|
37
|
-
active:
|
|
38
|
-
}
|
|
39
|
-
|
|
39
|
+
active: y
|
|
40
|
+
},
|
|
41
|
+
f
|
|
42
|
+
);
|
|
40
43
|
}) }))) });
|
|
41
44
|
};
|
|
42
45
|
export {
|