@altinn/altinn-components 0.55.2 → 0.55.4
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/components/Account/AccountListItem.js +14 -12
- package/dist/components/Account/AccountListItemControls.js +20 -19
- package/dist/components/Toolbar/ToolbarFilterMenu.js +45 -42
- package/dist/types/lib/components/Account/AccountListItem.d.ts +2 -1
- package/dist/types/lib/components/Account/AccountListItem.stories.d.ts +2 -1
- package/dist/types/lib/components/Account/AccountListItemControls.d.ts +2 -1
- package/dist/types/lib/components/Toolbar/ToolbarFilterMenu.d.ts +2 -1
- package/dist/types/lib/components/Toolbar/useFilter.d.ts +9 -3
- package/package.json +1 -1
|
@@ -3,10 +3,10 @@ import "../../index-p1eeF8LQ.js";
|
|
|
3
3
|
import "react";
|
|
4
4
|
import "../Button/Button.js";
|
|
5
5
|
import "../RootProvider/RootProvider.js";
|
|
6
|
-
import { ListItem as
|
|
6
|
+
import { ListItem as q } from "../List/ListItem.js";
|
|
7
7
|
import "../Snackbar/useSnackbar.js";
|
|
8
|
-
import { AccountListItemControls as
|
|
9
|
-
const
|
|
8
|
+
import { AccountListItemControls as w } from "./AccountListItemControls.js";
|
|
9
|
+
const H = ({
|
|
10
10
|
id: m,
|
|
11
11
|
type: c,
|
|
12
12
|
size: s,
|
|
@@ -22,15 +22,16 @@ const G = ({
|
|
|
22
22
|
favouriteLabel: v,
|
|
23
23
|
onToggleFavourite: A,
|
|
24
24
|
contextMenu: j,
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
isPreselectedParty: k,
|
|
26
|
+
children: C,
|
|
27
|
+
interactive: M,
|
|
27
28
|
disabled: r,
|
|
28
29
|
loading: o,
|
|
29
|
-
...
|
|
30
|
+
...h
|
|
30
31
|
}) => /* @__PURE__ */ i(
|
|
31
|
-
|
|
32
|
+
q,
|
|
32
33
|
{
|
|
33
|
-
...
|
|
34
|
+
...h,
|
|
34
35
|
loading: o,
|
|
35
36
|
size: s,
|
|
36
37
|
icon: e,
|
|
@@ -40,13 +41,14 @@ const G = ({
|
|
|
40
41
|
selected: t,
|
|
41
42
|
disabled: r,
|
|
42
43
|
controls: !o && !r && /* @__PURE__ */ i(
|
|
43
|
-
|
|
44
|
+
w,
|
|
44
45
|
{
|
|
45
46
|
id: m,
|
|
46
47
|
type: c,
|
|
47
48
|
favourite: L,
|
|
48
49
|
favouriteLabel: v,
|
|
49
50
|
badge: l,
|
|
51
|
+
isPreselectedParty: k,
|
|
50
52
|
isCurrentEndUser: f,
|
|
51
53
|
isDeleted: I,
|
|
52
54
|
onToggleFavourite: A,
|
|
@@ -54,10 +56,10 @@ const G = ({
|
|
|
54
56
|
}
|
|
55
57
|
),
|
|
56
58
|
linkIcon: !o && !0,
|
|
57
|
-
interactive:
|
|
58
|
-
children:
|
|
59
|
+
interactive: M,
|
|
60
|
+
children: C
|
|
59
61
|
}
|
|
60
62
|
);
|
|
61
63
|
export {
|
|
62
|
-
|
|
64
|
+
H as AccountListItem
|
|
63
65
|
};
|
|
@@ -1,38 +1,39 @@
|
|
|
1
1
|
import { jsxs as p, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { Badge as
|
|
2
|
+
import { Badge as u } from "../Badge/Badge.js";
|
|
3
3
|
import "../../index-p1eeF8LQ.js";
|
|
4
|
-
import { isValidElement as
|
|
5
|
-
import { Button as
|
|
6
|
-
import { ContextMenu as
|
|
4
|
+
import { isValidElement as c } from "react";
|
|
5
|
+
import { Button as d } from "../Button/Button.js";
|
|
6
|
+
import { ContextMenu as v } from "../ContextMenu/ContextMenu.js";
|
|
7
7
|
import "../RootProvider/RootProvider.js";
|
|
8
|
-
import { ListItemControls as
|
|
8
|
+
import { ListItemControls as x } from "../List/ListItemControls.js";
|
|
9
9
|
import "../Snackbar/useSnackbar.js";
|
|
10
|
-
import { S as
|
|
11
|
-
const
|
|
10
|
+
import { S as B, a as C } from "../../HeartFill-CYSrJ_xK.js";
|
|
11
|
+
const E = ({
|
|
12
12
|
id: e,
|
|
13
13
|
type: i,
|
|
14
14
|
badge: r,
|
|
15
15
|
isCurrentEndUser: m = !1,
|
|
16
16
|
favourite: n = !1,
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
isPreselectedParty: l = !1,
|
|
18
|
+
favouriteLabel: s,
|
|
19
|
+
onToggleFavourite: f,
|
|
19
20
|
contextMenu: o,
|
|
20
|
-
loading:
|
|
21
|
-
}) => /* @__PURE__ */ p(
|
|
22
|
-
r && (r && !
|
|
23
|
-
!m && i !== "group" && /* @__PURE__ */ t(
|
|
24
|
-
|
|
21
|
+
loading: a
|
|
22
|
+
}) => /* @__PURE__ */ p(x, { children: [
|
|
23
|
+
r && (r && !a && typeof r == "object" && "label" in r ? /* @__PURE__ */ t(u, { ...r }) : c(r) ? r : null),
|
|
24
|
+
!m && !l && i !== "group" && /* @__PURE__ */ t(
|
|
25
|
+
d,
|
|
25
26
|
{
|
|
26
27
|
size: "xs",
|
|
27
28
|
variant: "ghost",
|
|
28
29
|
rounded: !0,
|
|
29
|
-
"aria-label":
|
|
30
|
-
onClick: () =>
|
|
31
|
-
children: n ? /* @__PURE__ */ t(
|
|
30
|
+
"aria-label": s || "Toggle favourite",
|
|
31
|
+
onClick: () => f?.(e),
|
|
32
|
+
children: n ? /* @__PURE__ */ t(B, {}) : /* @__PURE__ */ t(C, {})
|
|
32
33
|
}
|
|
33
34
|
),
|
|
34
|
-
o && /* @__PURE__ */ t(
|
|
35
|
+
o && /* @__PURE__ */ t(v, { ...o })
|
|
35
36
|
] });
|
|
36
37
|
export {
|
|
37
|
-
|
|
38
|
+
E as AccountListItemControls
|
|
38
39
|
};
|
|
@@ -1,81 +1,83 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as
|
|
2
|
+
import { useRef as B, useEffect as T } from "react";
|
|
3
3
|
import "../../index-p1eeF8LQ.js";
|
|
4
4
|
import "../Button/Button.js";
|
|
5
|
-
import { Menu as
|
|
6
|
-
import { useDropdownMenuController as
|
|
5
|
+
import { Menu as V } from "../Menu/Menu.js";
|
|
6
|
+
import { useDropdownMenuController as q } from "../Menu/useDropdownMenuController.js";
|
|
7
7
|
import "../RootProvider/RootProvider.js";
|
|
8
8
|
import "../Snackbar/useSnackbar.js";
|
|
9
|
-
import { Dropdown as
|
|
10
|
-
import { ToolbarFilterButton as
|
|
11
|
-
const
|
|
12
|
-
as:
|
|
13
|
-
size:
|
|
9
|
+
import { Dropdown as M } from "../Dropdown/Dropdown.js";
|
|
10
|
+
import { ToolbarFilterButton as R } from "./ToolbarFilterButton.js";
|
|
11
|
+
const Z = ({
|
|
12
|
+
as: A,
|
|
13
|
+
size: a,
|
|
14
14
|
name: n,
|
|
15
|
-
label:
|
|
15
|
+
label: f = "",
|
|
16
16
|
searchable: c,
|
|
17
|
-
groups:
|
|
17
|
+
groups: l,
|
|
18
18
|
items: p,
|
|
19
|
-
removable:
|
|
20
|
-
removeLabel:
|
|
19
|
+
removable: F,
|
|
20
|
+
removeLabel: P = "Fjern filter",
|
|
21
21
|
filterState: s,
|
|
22
22
|
onFilterStateChange: g,
|
|
23
|
-
onFilterChange:
|
|
24
|
-
onRemove:
|
|
23
|
+
onFilterChange: E,
|
|
24
|
+
onRemove: j,
|
|
25
25
|
open: o,
|
|
26
26
|
onToggle: v,
|
|
27
27
|
onClose: u,
|
|
28
28
|
submitLabel: w,
|
|
29
29
|
search: y,
|
|
30
|
-
virtualized: b
|
|
30
|
+
virtualized: b,
|
|
31
|
+
title: x
|
|
31
32
|
}) => {
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
const r =
|
|
35
|
-
|
|
33
|
+
const h = B(o), t = q({ id: "toolbar-filter-menu" });
|
|
34
|
+
T(() => {
|
|
35
|
+
const r = h.current;
|
|
36
|
+
h.current = o, r && !o && t?.triggerRef?.current?.focus();
|
|
36
37
|
}, [o, t.triggerRef]);
|
|
37
|
-
const
|
|
38
|
-
const m = r.target.type,
|
|
39
|
-
|
|
40
|
-
},
|
|
38
|
+
const C = (r) => {
|
|
39
|
+
const m = r.target.type, D = r.target.name, O = r.target.value;
|
|
40
|
+
E?.(m, D, O), m === "radio" && u();
|
|
41
|
+
}, k = p?.map((r) => ({
|
|
41
42
|
...r,
|
|
42
|
-
onChange: (m) =>
|
|
43
|
-
})), i = p?.filter((r) => r.checked)?.map((r) => r.value || "true"),
|
|
44
|
-
return
|
|
45
|
-
|
|
43
|
+
onChange: (m) => C(m)
|
|
44
|
+
})), i = p?.filter((r) => r.checked)?.map((r) => r.value || "true"), I = A || V, d = c ? "combobox" : "menu";
|
|
45
|
+
return F ? /* @__PURE__ */ e(
|
|
46
|
+
M,
|
|
46
47
|
{
|
|
47
48
|
submitLabel: w,
|
|
49
|
+
title: x,
|
|
48
50
|
variant: "drawer-dropdown",
|
|
49
51
|
trigger: /* @__PURE__ */ e(
|
|
50
|
-
|
|
52
|
+
R,
|
|
51
53
|
{
|
|
52
54
|
name: n,
|
|
53
55
|
onClick: v,
|
|
54
|
-
onRemove:
|
|
56
|
+
onRemove: j,
|
|
55
57
|
removable: !0,
|
|
56
58
|
value: i?.length > 0 ? i : void 0,
|
|
57
|
-
removeLabel:
|
|
59
|
+
removeLabel: P,
|
|
58
60
|
open: o,
|
|
59
61
|
"aria-expanded": o,
|
|
60
62
|
"aria-controls": t.menuId,
|
|
61
63
|
ref: t.triggerRef,
|
|
62
|
-
children:
|
|
64
|
+
children: f
|
|
63
65
|
}
|
|
64
66
|
),
|
|
65
67
|
open: o,
|
|
66
68
|
onClose: u,
|
|
67
69
|
...t.dropdownA11yProps,
|
|
68
70
|
children: /* @__PURE__ */ e(
|
|
69
|
-
|
|
71
|
+
I,
|
|
70
72
|
{
|
|
71
73
|
search: y,
|
|
72
74
|
name: n,
|
|
73
75
|
filterState: s,
|
|
74
76
|
onFilterStateChange: g,
|
|
75
|
-
size:
|
|
77
|
+
size: a,
|
|
76
78
|
searchable: c,
|
|
77
|
-
groups:
|
|
78
|
-
items:
|
|
79
|
+
groups: l,
|
|
80
|
+
items: k,
|
|
79
81
|
keyboardEvents: o,
|
|
80
82
|
a11yMode: d,
|
|
81
83
|
...d === "combobox" ? { id: t.menuId } : t.menuA11yProps,
|
|
@@ -84,25 +86,26 @@ const Y = ({
|
|
|
84
86
|
)
|
|
85
87
|
}
|
|
86
88
|
) : /* @__PURE__ */ e(
|
|
87
|
-
|
|
89
|
+
M,
|
|
88
90
|
{
|
|
91
|
+
title: x,
|
|
89
92
|
variant: "drawer-dropdown",
|
|
90
93
|
submitLabel: w,
|
|
91
|
-
trigger: /* @__PURE__ */ e(
|
|
94
|
+
trigger: /* @__PURE__ */ e(R, { name: n, onClick: v, value: i?.length > 0 ? i : void 0, children: f }),
|
|
92
95
|
open: o,
|
|
93
96
|
onClose: u,
|
|
94
97
|
...t.dropdownA11yProps,
|
|
95
98
|
children: /* @__PURE__ */ e(
|
|
96
|
-
|
|
99
|
+
I,
|
|
97
100
|
{
|
|
98
101
|
search: y,
|
|
99
102
|
name: n,
|
|
100
103
|
filterState: s,
|
|
101
104
|
onFilterStateChange: g,
|
|
102
|
-
size:
|
|
105
|
+
size: a,
|
|
103
106
|
searchable: c,
|
|
104
|
-
groups:
|
|
105
|
-
items:
|
|
107
|
+
groups: l,
|
|
108
|
+
items: k,
|
|
106
109
|
keyboardEvents: o,
|
|
107
110
|
a11yMode: d,
|
|
108
111
|
...d === "combobox" ? { id: t.menuId } : t.menuA11yProps,
|
|
@@ -113,5 +116,5 @@ const Y = ({
|
|
|
113
116
|
);
|
|
114
117
|
};
|
|
115
118
|
export {
|
|
116
|
-
|
|
119
|
+
Z as ToolbarFilterMenu
|
|
117
120
|
};
|
|
@@ -14,7 +14,8 @@ export interface AccountListItemProps extends ListItemProps, AccountListItemCont
|
|
|
14
14
|
isCurrentEndUser?: boolean;
|
|
15
15
|
isDeleted?: boolean;
|
|
16
16
|
isParent?: boolean;
|
|
17
|
+
isPreselectedParty?: boolean;
|
|
17
18
|
contextMenu?: ContextMenuProps;
|
|
18
19
|
label?: string;
|
|
19
20
|
}
|
|
20
|
-
export declare const AccountListItem: ({ id, type, size, expanded, icon, name, title, description, isCurrentEndUser, isDeleted, badge, favourite, favouriteLabel, onToggleFavourite, contextMenu, children, interactive, disabled, loading, ...item }: AccountListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare const AccountListItem: ({ id, type, size, expanded, icon, name, title, description, isCurrentEndUser, isDeleted, badge, favourite, favouriteLabel, onToggleFavourite, contextMenu, isPreselectedParty, children, interactive, disabled, loading, ...item }: AccountListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,7 @@ import { StoryObj } from '@storybook/react-vite';
|
|
|
2
2
|
import { AccountListItemProps } from '..';
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: ({ id, type, size, expanded, icon, name, title, description, isCurrentEndUser, isDeleted, badge, favourite, favouriteLabel, onToggleFavourite, contextMenu, children, interactive, disabled, loading, ...item }: AccountListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
component: ({ id, type, size, expanded, icon, name, title, description, isCurrentEndUser, isDeleted, badge, favourite, favouriteLabel, onToggleFavourite, contextMenu, isPreselectedParty, children, interactive, disabled, loading, ...item }: AccountListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
tags: string[];
|
|
7
7
|
parameters: {};
|
|
8
8
|
args: {
|
|
@@ -26,6 +26,7 @@ declare const meta: {
|
|
|
26
26
|
isCurrentEndUser?: boolean | undefined;
|
|
27
27
|
isDeleted?: boolean | undefined;
|
|
28
28
|
isParent?: boolean | undefined;
|
|
29
|
+
isPreselectedParty?: boolean | undefined;
|
|
29
30
|
contextMenu?: import('..').ContextMenuProps | undefined;
|
|
30
31
|
label?: string | undefined;
|
|
31
32
|
variant?: import('..').ListItemVariant | undefined;
|
|
@@ -7,6 +7,7 @@ export interface AccountListItemControlsProps {
|
|
|
7
7
|
isCurrentEndUser?: boolean;
|
|
8
8
|
isDeleted?: boolean;
|
|
9
9
|
favourite?: boolean;
|
|
10
|
+
isPreselectedParty?: boolean;
|
|
10
11
|
favouriteLabel?: string;
|
|
11
12
|
onToggleFavourite?: (id: string) => void;
|
|
12
13
|
accountLabel?: string;
|
|
@@ -14,4 +15,4 @@ export interface AccountListItemControlsProps {
|
|
|
14
15
|
loading?: boolean;
|
|
15
16
|
badge?: BadgeProps | ReactNode;
|
|
16
17
|
}
|
|
17
|
-
export declare const AccountListItemControls: ({ id, type, badge, isCurrentEndUser, favourite, favouriteLabel, onToggleFavourite, contextMenu, loading, }: AccountListItemControlsProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const AccountListItemControls: ({ id, type, badge, isCurrentEndUser, favourite, isPreselectedParty, favouriteLabel, onToggleFavourite, contextMenu, loading, }: AccountListItemControlsProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -11,5 +11,6 @@ export interface ToolbarFilterMenuProps extends FilterProps {
|
|
|
11
11
|
onFilterChange?: (type: string, name: string, value: string) => void;
|
|
12
12
|
removeLabel?: string;
|
|
13
13
|
submitLabel?: string;
|
|
14
|
+
title?: string;
|
|
14
15
|
}
|
|
15
|
-
export declare const ToolbarFilterMenu: ({ as, size, name, label, searchable, groups, items, removable, removeLabel, filterState, onFilterStateChange, onFilterChange, onRemove, open, onToggle, onClose, submitLabel, search, virtualized, }: ToolbarFilterMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const ToolbarFilterMenu: ({ as, size, name, label, searchable, groups, items, removable, removeLabel, filterState, onFilterStateChange, onFilterChange, onRemove, open, onToggle, onClose, submitLabel, search, virtualized, title, }: ToolbarFilterMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -9,7 +9,9 @@ export interface FilterProps extends MenuProps {
|
|
|
9
9
|
groupId?: string;
|
|
10
10
|
name: string;
|
|
11
11
|
icon?: MenuItemProps['icon'];
|
|
12
|
-
label
|
|
12
|
+
label?: string;
|
|
13
|
+
title?: MenuItemProps['title'];
|
|
14
|
+
description?: MenuItemProps['description'];
|
|
13
15
|
removable?: boolean;
|
|
14
16
|
groups?: FilterGroups;
|
|
15
17
|
items: MenuItemProps[];
|
|
@@ -114,7 +116,9 @@ export declare const useFilter: ({ filters, filterState, onFilterStateChange }:
|
|
|
114
116
|
groupId?: string;
|
|
115
117
|
name: string;
|
|
116
118
|
icon?: MenuItemProps["icon"];
|
|
117
|
-
label
|
|
119
|
+
label?: string;
|
|
120
|
+
title?: MenuItemProps["title"];
|
|
121
|
+
description?: MenuItemProps["description"];
|
|
118
122
|
removable?: boolean;
|
|
119
123
|
groups?: FilterGroups;
|
|
120
124
|
searchable?: boolean;
|
|
@@ -142,7 +146,9 @@ export declare const useFilter: ({ filters, filterState, onFilterStateChange }:
|
|
|
142
146
|
groupId?: string;
|
|
143
147
|
name: string;
|
|
144
148
|
icon?: MenuItemProps["icon"];
|
|
145
|
-
label
|
|
149
|
+
label?: string;
|
|
150
|
+
title?: MenuItemProps["title"];
|
|
151
|
+
description?: MenuItemProps["description"];
|
|
146
152
|
removable?: boolean;
|
|
147
153
|
groups?: FilterGroups;
|
|
148
154
|
items: MenuItemProps[];
|