@altinn/altinn-components 0.8.1 → 0.8.3
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/ContextMenu.css +1 -0
- package/dist/assets/DialogListItem.css +1 -0
- package/dist/assets/ListItemControls.css +1 -0
- package/dist/assets/ListItemHeader.css +1 -0
- package/dist/assets/ListItemMenu.css +1 -0
- package/dist/assets/ScopeListItem.css +1 -0
- package/dist/components/Bookmarks/BookmarksList.js +2 -1
- package/dist/components/Bookmarks/BookmarksListItem.js +6 -4
- package/dist/components/Bookmarks/BookmarksListItem.stories.js +15 -14
- package/dist/components/Bookmarks/BookmarksSection.js +1 -1
- package/dist/components/Bookmarks/index.js +4 -4
- package/dist/components/Button/Buttons.stories.js +1 -1
- package/dist/components/ContextMenu/ContextMenu.d.ts +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +39 -5
- package/dist/components/ContextMenu/ContextMenu.stories.js +8 -8
- package/dist/components/ContextMenu/index.js +1 -1
- package/dist/components/Dialog/Dialog.js +1 -1
- package/dist/components/Dialog/DialogActions.js +1 -1
- package/dist/components/Dialog/DialogGroup.js +1 -1
- package/dist/components/Dialog/DialogHistory.js +1 -1
- package/dist/components/Dialog/DialogList.js +6 -5
- package/dist/components/Dialog/DialogListItem.js +89 -12
- package/dist/components/Dialog/DialogListItem.stories.js +24 -23
- package/dist/components/Dialog/DialogNav.js +11 -11
- package/dist/components/Dialog/index.js +1 -1
- package/dist/components/Dropdown/DrawerBase.d.ts +2 -2
- package/dist/components/Dropdown/DrawerBase.js +1 -1
- package/dist/components/Dropdown/DrawerButton.js +1 -1
- package/dist/components/Dropdown/DrawerOrDropdown.d.ts +4 -4
- package/dist/components/Dropdown/DrawerOrDropdown.js +22 -16
- package/dist/components/Dropdown/DropdownBase.d.ts +3 -2
- package/dist/components/Dropdown/DropdownBase.js +28 -21
- package/dist/components/GlobalMenu/AccountButton.js +1 -1
- package/dist/components/GlobalMenu/AccountMenu.js +1 -1
- package/dist/components/GlobalMenu/BackButton.js +1 -1
- package/dist/components/GlobalMenu/GlobalMenu.js +1 -1
- package/dist/components/Header/Header.js +24 -27
- package/dist/components/Header/HeaderBase.js +1 -1
- package/dist/components/History/HistoryItem.js +1 -1
- package/dist/components/Layout/Layout.js +1 -1
- package/dist/components/Layout/Layout.stories.js +10 -9
- package/dist/components/LayoutAction/ActionMenu.js +1 -1
- package/dist/components/List/List.js +5 -4
- package/dist/components/List/List.stories.js +1 -1
- package/dist/components/List/ListItem.js +47 -4
- package/dist/components/List/ListItem.stories.js +25 -23
- package/dist/components/List/ListItemControls.js +15 -5
- package/dist/components/List/ListItemHeader.js +73 -7
- package/dist/components/List/ListItemHeader.stories.js +20 -19
- package/dist/components/List/ListItemMenu.js +6 -3
- package/dist/components/List/index.js +14 -12
- package/dist/components/Menu/Menu.js +9 -9
- package/dist/components/Menu/MenuItem.stories.js +1 -1
- package/dist/components/Menu/MenuItems.js +63 -8
- package/dist/components/Menu/MenuItems.stories.js +1 -1
- package/dist/components/Menu/MenuSearch.js +1 -1
- package/dist/components/Menu/index.js +7 -7
- package/dist/components/Page/PageHeader.js +1 -1
- package/dist/components/RootProvider/RootProvider.js +16 -15
- package/dist/components/Searchbar/Autocomplete.d.ts +2 -1
- package/dist/components/Searchbar/Autocomplete.js +39 -7
- package/dist/components/Searchbar/Autocomplete.stories.js +2 -2
- package/dist/components/Searchbar/AutocompleteItem.d.ts +1 -0
- package/dist/components/Searchbar/AutocompleteItem.js +21 -3
- package/dist/components/Searchbar/ScopeListItem.d.ts +1 -1
- package/dist/components/Searchbar/ScopeListItem.js +7 -3
- package/dist/components/Searchbar/Searchbar.js +16 -25
- package/dist/components/Toolbar/Toolbar.d.ts +2 -1
- package/dist/components/Toolbar/Toolbar.js +67 -68
- package/dist/components/Toolbar/Toolbar.stories.js +24 -19
- package/dist/components/Toolbar/ToolbarAdd.d.ts +2 -4
- package/dist/components/Toolbar/ToolbarAdd.js +15 -12
- package/dist/components/Toolbar/ToolbarBase.d.ts +0 -2
- package/dist/components/Toolbar/ToolbarDaterange.js +12 -12
- package/dist/components/Toolbar/ToolbarFilter.d.ts +3 -3
- package/dist/components/Toolbar/ToolbarFilter.js +42 -42
- package/dist/components/Toolbar/ToolbarMenu.d.ts +2 -4
- package/dist/components/Toolbar/ToolbarMenu.js +15 -12
- package/dist/components/Toolbar/ToolbarOptions.js +1 -1
- package/dist/components/Toolbar/ToolbarSearch.d.ts +2 -2
- package/dist/components/Toolbar/ToolbarSearch.js +1 -1
- package/dist/components/Transmission/TransmissionItem.js +14 -13
- package/dist/components/Transmission/TransmissionList.js +1 -1
- package/dist/components/Transmission/TransmissionSection.js +1 -1
- package/dist/components/index.js +237 -231
- package/dist/hooks/useClickOutside.d.ts +1 -1
- package/dist/hooks/useClickOutside.js +6 -6
- package/dist/index.js +245 -239
- package/package.json +1 -1
- package/dist/Autocomplete-Cb9fQrzy.js +0 -367
- package/dist/assets/Autocomplete.css +0 -1
- package/dist/components/ContextMenu/ContextMenuBase.d.ts +0 -12
- package/dist/components/ContextMenu/ContextMenuBase.js +0 -11
|
@@ -1,93 +1,92 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { useRootContext as
|
|
5
|
-
import { ToolbarAdd as
|
|
6
|
-
import { ToolbarBase as
|
|
7
|
-
import { ToolbarFilter as
|
|
8
|
-
import { ToolbarMenu as
|
|
9
|
-
import { ToolbarSearch as
|
|
10
|
-
const
|
|
11
|
-
filters:
|
|
12
|
-
filterState:
|
|
13
|
-
onFilterStateChange:
|
|
14
|
-
search:
|
|
15
|
-
menu:
|
|
16
|
-
getFilterLabel:
|
|
17
|
-
children:
|
|
2
|
+
import { jsxs as L, jsx as i } from "react/jsx-runtime";
|
|
3
|
+
import { useState as u, useMemo as T } from "react";
|
|
4
|
+
import { useRootContext as M } from "../RootProvider/RootProvider.js";
|
|
5
|
+
import { ToolbarAdd as k } from "./ToolbarAdd.js";
|
|
6
|
+
import { ToolbarBase as B } from "./ToolbarBase.js";
|
|
7
|
+
import { ToolbarFilter as V } from "./ToolbarFilter.js";
|
|
8
|
+
import { ToolbarMenu as $ } from "./ToolbarMenu.js";
|
|
9
|
+
import { ToolbarSearch as q } from "./ToolbarSearch.js";
|
|
10
|
+
const g = (n, l) => l || `toolbar-filter-${n}`, O = ({
|
|
11
|
+
filters: n = [],
|
|
12
|
+
filterState: l,
|
|
13
|
+
onFilterStateChange: s,
|
|
14
|
+
search: m,
|
|
15
|
+
menu: b,
|
|
16
|
+
getFilterLabel: y,
|
|
17
|
+
children: S,
|
|
18
|
+
showResultsLabel: h
|
|
18
19
|
}) => {
|
|
19
|
-
const {
|
|
20
|
-
|
|
21
|
-
),
|
|
22
|
-
(
|
|
23
|
-
),
|
|
24
|
-
() =>
|
|
25
|
-
[
|
|
26
|
-
), a =
|
|
27
|
-
() =>
|
|
28
|
-
[
|
|
29
|
-
),
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
...
|
|
36
|
-
[o]: n
|
|
37
|
-
}), t("filter", o)) : p({
|
|
38
|
-
...r,
|
|
39
|
-
[o]: r[o] ? r[o].some((f) => n == null ? void 0 : n.includes(f)) ? r[o].filter((f) => !(n || []).includes(f)) : [...r[o], ...n || []] : n
|
|
20
|
+
const { openId: x, closeAll: A } = M(), [C, I] = u(
|
|
21
|
+
l ?? {}
|
|
22
|
+
), c = typeof s == "function" ? s : I, t = l || C, [d, f] = u(
|
|
23
|
+
(n == null ? void 0 : n.filter((o) => !(o.removable && typeof t[o.name] > "u")).map((o) => o.name)) ?? []
|
|
24
|
+
), F = n == null ? void 0 : n.filter((o) => !d.includes(o.name)), N = T(
|
|
25
|
+
() => d.map((o) => n.find((e) => e.name === o)).filter((o) => typeof o < "u"),
|
|
26
|
+
[n, d]
|
|
27
|
+
), a = T(
|
|
28
|
+
() => n.filter((o) => F.includes(o)),
|
|
29
|
+
[n, F]
|
|
30
|
+
), R = (o, e, r) => {
|
|
31
|
+
r === "radio" ? (A(), c({
|
|
32
|
+
...t,
|
|
33
|
+
[o]: e
|
|
34
|
+
})) : c({
|
|
35
|
+
...t,
|
|
36
|
+
[o]: t[o] ? t[o].some((p) => e == null ? void 0 : e.includes(p)) ? t[o].filter((p) => !(e || []).includes(p)) : [...t[o], ...e || []] : e
|
|
40
37
|
});
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
...
|
|
38
|
+
}, j = (o) => {
|
|
39
|
+
f((e) => e.filter((r) => r !== o)), c({
|
|
40
|
+
...t,
|
|
44
41
|
[o]: void 0
|
|
45
42
|
});
|
|
46
|
-
},
|
|
47
|
-
|
|
43
|
+
}, v = (o, e) => {
|
|
44
|
+
f((r) => [...r, o]), x(e);
|
|
48
45
|
};
|
|
49
|
-
return /* @__PURE__ */
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
46
|
+
return /* @__PURE__ */ L(B, { children: [
|
|
47
|
+
b && /* @__PURE__ */ i($, { ...b }),
|
|
48
|
+
m && /* @__PURE__ */ i(q, { ...m }),
|
|
49
|
+
N.map((o) => /* @__PURE__ */ i(
|
|
50
|
+
V,
|
|
54
51
|
{
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
id: g(o.name, o.id),
|
|
53
|
+
showResultsLabel: h,
|
|
57
54
|
onRemove: () => {
|
|
58
|
-
|
|
55
|
+
j(o.name);
|
|
59
56
|
},
|
|
60
|
-
onChange: (
|
|
61
|
-
|
|
57
|
+
onChange: (e) => {
|
|
58
|
+
R(o.name, [e.target.value], o.optionType);
|
|
62
59
|
},
|
|
63
60
|
name: o.name,
|
|
64
61
|
options: o.options,
|
|
65
62
|
label: o.label,
|
|
66
|
-
value:
|
|
63
|
+
value: t[o.name],
|
|
67
64
|
optionType: o.optionType,
|
|
68
65
|
removable: o.removable,
|
|
69
|
-
getSelectedLabel:
|
|
66
|
+
getSelectedLabel: y
|
|
70
67
|
},
|
|
71
68
|
o.name
|
|
72
69
|
)),
|
|
73
|
-
(a == null ? void 0 : a.length) > 0 && /* @__PURE__ */
|
|
74
|
-
|
|
70
|
+
(a == null ? void 0 : a.length) > 0 && /* @__PURE__ */ i(
|
|
71
|
+
k,
|
|
75
72
|
{
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
73
|
+
id: "toolbar-filter-add",
|
|
74
|
+
items: a.map((o) => {
|
|
75
|
+
const e = g(o.name, o.id);
|
|
76
|
+
return {
|
|
77
|
+
id: e,
|
|
78
|
+
title: o.label,
|
|
79
|
+
name: o.name,
|
|
80
|
+
onClick: () => {
|
|
81
|
+
v(o.name, e);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
})
|
|
86
85
|
}
|
|
87
86
|
),
|
|
88
|
-
|
|
87
|
+
S
|
|
89
88
|
] });
|
|
90
89
|
};
|
|
91
90
|
export {
|
|
92
|
-
|
|
91
|
+
O as Toolbar
|
|
93
92
|
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import i from "react";
|
|
3
3
|
import { Toolbar as o } from "./Toolbar.js";
|
|
4
|
-
const
|
|
4
|
+
const m = {
|
|
5
5
|
title: "Toolbar/Toolbar",
|
|
6
6
|
component: o,
|
|
7
7
|
tags: ["autodocs"],
|
|
8
8
|
parameters: {},
|
|
9
|
-
args: {
|
|
9
|
+
args: {
|
|
10
|
+
showResultsLabel: "Vis alle treff"
|
|
11
|
+
}
|
|
10
12
|
}, a = {
|
|
11
13
|
args: {
|
|
12
14
|
menu: {
|
|
@@ -17,13 +19,15 @@ const d = {
|
|
|
17
19
|
avatar: {
|
|
18
20
|
name: "Ola Nordmann"
|
|
19
21
|
},
|
|
20
|
-
|
|
22
|
+
title: "Ola Nordmann",
|
|
23
|
+
id: "ola"
|
|
21
24
|
},
|
|
22
25
|
{
|
|
23
26
|
avatar: {
|
|
24
27
|
name: "Kari Nordmann"
|
|
25
28
|
},
|
|
26
|
-
|
|
29
|
+
title: "Kari Nordmann",
|
|
30
|
+
id: "kari"
|
|
27
31
|
}
|
|
28
32
|
]
|
|
29
33
|
},
|
|
@@ -110,33 +114,34 @@ const d = {
|
|
|
110
114
|
}
|
|
111
115
|
]
|
|
112
116
|
}
|
|
113
|
-
},
|
|
117
|
+
}, g = {
|
|
114
118
|
args: {
|
|
115
119
|
...a.args,
|
|
116
120
|
getFilterLabel: (t, e) => Array.isArray(e) && e.length > 1 ? `${e.length} selected` : e
|
|
117
121
|
}
|
|
118
|
-
},
|
|
122
|
+
}, p = {
|
|
119
123
|
args: {
|
|
120
124
|
...a.args,
|
|
121
125
|
filters: []
|
|
122
126
|
}
|
|
123
127
|
};
|
|
124
128
|
var l, r;
|
|
125
|
-
const
|
|
129
|
+
const v = {
|
|
126
130
|
args: {
|
|
127
131
|
filters: (r = (l = a == null ? void 0 : a.args) == null ? void 0 : l.filters) == null ? void 0 : r.map((t) => ({
|
|
128
132
|
...t,
|
|
129
133
|
removable: !1
|
|
130
134
|
}))
|
|
131
135
|
}
|
|
132
|
-
},
|
|
133
|
-
const [
|
|
136
|
+
}, c = (t) => {
|
|
137
|
+
const [e, s] = i.useState({
|
|
134
138
|
from: ["skatt", "brreg"]
|
|
135
139
|
});
|
|
136
|
-
return /* @__PURE__ */
|
|
137
|
-
},
|
|
140
|
+
return /* @__PURE__ */ n(o, { ...t, filters: a.args.filters, filterState: e, onFilterStateChange: s });
|
|
141
|
+
}, f = {
|
|
138
142
|
args: {
|
|
139
143
|
search: {
|
|
144
|
+
name: "search",
|
|
140
145
|
placeholder: "Søk etter filter"
|
|
141
146
|
},
|
|
142
147
|
filters: [
|
|
@@ -176,11 +181,11 @@ const p = {
|
|
|
176
181
|
}
|
|
177
182
|
};
|
|
178
183
|
export {
|
|
179
|
-
|
|
180
|
-
|
|
184
|
+
c as ControlledStateFilters,
|
|
185
|
+
g as CustomFilterLabel,
|
|
181
186
|
a as Default,
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
187
|
+
f as FilterAndSearch,
|
|
188
|
+
p as NoFilters,
|
|
189
|
+
v as StaticFilters,
|
|
190
|
+
m as default
|
|
186
191
|
};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { MouseEventHandler } from 'react';
|
|
2
1
|
import { MenuItemProps } from '../Menu';
|
|
3
2
|
export interface ToolbarAddProps {
|
|
4
3
|
items: MenuItemProps[];
|
|
5
|
-
|
|
6
|
-
onToggle?: MouseEventHandler;
|
|
4
|
+
id: string;
|
|
7
5
|
label?: string;
|
|
8
6
|
className?: string;
|
|
9
7
|
}
|
|
10
|
-
export declare const ToolbarAdd: ({
|
|
8
|
+
export declare const ToolbarAdd: ({ label, items, id }: ToolbarAddProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as p, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import "../../index-L8X2o7IH.js";
|
|
3
3
|
import "../Icon/SvgIcon.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import "../RootProvider/RootProvider.js";
|
|
6
|
-
import { ToolbarButton as
|
|
7
|
-
import { ToolbarFilterBase as
|
|
8
|
-
import { Menu as
|
|
9
|
-
import { DrawerOrDropdown as
|
|
10
|
-
import "
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
/* @__PURE__ */
|
|
14
|
-
|
|
5
|
+
import { useRootContext as d } from "../RootProvider/RootProvider.js";
|
|
6
|
+
import { ToolbarButton as s } from "./ToolbarButton.js";
|
|
7
|
+
import { ToolbarFilterBase as c } from "./ToolbarFilterBase.js";
|
|
8
|
+
import { Menu as g } from "../Menu/Menu.js";
|
|
9
|
+
import { DrawerOrDropdown as a } from "../Dropdown/DrawerOrDropdown.js";
|
|
10
|
+
import "../Searchbar/AutocompleteBase.js";
|
|
11
|
+
const D = ({ label: r = "Legg til", items: n, id: t }) => {
|
|
12
|
+
const { closeAll: m, currentId: l, toggleId: i } = d(), e = l === t;
|
|
13
|
+
return /* @__PURE__ */ p(c, { expanded: e, children: [
|
|
14
|
+
/* @__PURE__ */ o(s, { type: "add", onToggle: () => i(t), children: r }),
|
|
15
|
+
/* @__PURE__ */ o(a, { drawerTitle: r, onClose: m, open: e, children: /* @__PURE__ */ o(g, { theme: "global", items: n }) })
|
|
16
|
+
] });
|
|
17
|
+
};
|
|
15
18
|
export {
|
|
16
|
-
|
|
19
|
+
D as ToolbarAdd
|
|
17
20
|
};
|
|
@@ -3,17 +3,17 @@ import { useState as m } from "react";
|
|
|
3
3
|
import "../../index-L8X2o7IH.js";
|
|
4
4
|
import "../Icon/SvgIcon.js";
|
|
5
5
|
import "../RootProvider/RootProvider.js";
|
|
6
|
-
import { ToolbarButton as
|
|
6
|
+
import { ToolbarButton as T } from "./ToolbarButton.js";
|
|
7
7
|
import { MenuInputField as p } from "../Menu/MenuInputField.js";
|
|
8
|
-
import { MenuBase as
|
|
9
|
-
import { ToolbarFilterBase as
|
|
10
|
-
import { DrawerOrDropdown as
|
|
11
|
-
import "
|
|
8
|
+
import { MenuBase as v } from "../Menu/MenuBase.js";
|
|
9
|
+
import { ToolbarFilterBase as C } from "./ToolbarFilterBase.js";
|
|
10
|
+
import { DrawerOrDropdown as F } from "../Dropdown/DrawerOrDropdown.js";
|
|
11
|
+
import "../Searchbar/AutocompleteBase.js";
|
|
12
12
|
import { Datepicker as S } from "../Datepicker/Datepicker.js";
|
|
13
|
-
import '../../assets/ToolbarDaterange.css';const
|
|
14
|
-
datepicker:
|
|
15
|
-
fields:
|
|
16
|
-
description:
|
|
13
|
+
import '../../assets/ToolbarDaterange.css';const w = "_datepicker_mqb1p_1", y = "_fields_mqb1p_6", q = "_description_mqb1p_10", n = {
|
|
14
|
+
datepicker: w,
|
|
15
|
+
fields: y,
|
|
16
|
+
description: q
|
|
17
17
|
}, J = ({
|
|
18
18
|
title: d = "Select daterange",
|
|
19
19
|
description: f = "Choose dates or click to set daterange.",
|
|
@@ -31,9 +31,9 @@ import '../../assets/ToolbarDaterange.css';const y = "_datepicker_mqb1p_1", q =
|
|
|
31
31
|
}, k = (e) => {
|
|
32
32
|
s ? (r(e), a("")) : t && e < t ? (a(t), r(e)) : t ? a(e) : r(e);
|
|
33
33
|
};
|
|
34
|
-
return /* @__PURE__ */ i(
|
|
35
|
-
/* @__PURE__ */ o(
|
|
36
|
-
/* @__PURE__ */ o(
|
|
34
|
+
return /* @__PURE__ */ i(C, { expanded: c, children: [
|
|
35
|
+
/* @__PURE__ */ o(T, { type: "switch", onToggle: l, active: !!_, children: u }),
|
|
36
|
+
/* @__PURE__ */ o(F, { open: c, drawerTitle: d, onClose: l, children: /* @__PURE__ */ i(v, { children: [
|
|
37
37
|
/* @__PURE__ */ i("div", { className: n.fields, children: [
|
|
38
38
|
/* @__PURE__ */ o(
|
|
39
39
|
p,
|
|
@@ -9,15 +9,15 @@ export interface ToolbarFilterProps {
|
|
|
9
9
|
[key: string]: OptionGroup;
|
|
10
10
|
};
|
|
11
11
|
label: string;
|
|
12
|
+
id?: string;
|
|
12
13
|
value?: ToolbarFilterValue;
|
|
13
14
|
optionType: 'checkbox' | 'radio';
|
|
14
|
-
expanded?: boolean;
|
|
15
15
|
removable?: boolean;
|
|
16
16
|
getSelectedLabel?: (name: string, value?: ToolbarFilterValue) => string;
|
|
17
17
|
className?: string;
|
|
18
18
|
onChange?: ChangeEventHandler;
|
|
19
|
-
onToggle?: MouseEventHandler;
|
|
20
19
|
onRemove?: MouseEventHandler;
|
|
20
|
+
showResultsLabel?: string;
|
|
21
21
|
}
|
|
22
|
-
export declare const ToolbarFilter: ({
|
|
22
|
+
export declare const ToolbarFilter: ({ removable, label, name, value, options, optionGroups, onChange, onRemove, getSelectedLabel, showResultsLabel, optionType, id, }: ToolbarFilterProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
23
|
export {};
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
import { jsxs as b, jsx as
|
|
1
|
+
import { jsxs as b, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import "../../index-L8X2o7IH.js";
|
|
3
3
|
import "../Icon/SvgIcon.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import "../RootProvider/RootProvider.js";
|
|
6
|
-
import { ToolbarButton as
|
|
7
|
-
import { ToolbarFilterBase as
|
|
8
|
-
import { DrawerOrDropdown as
|
|
9
|
-
import "
|
|
10
|
-
import { ToolbarOptions as
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
name: i,
|
|
5
|
+
import { useRootContext as j } from "../RootProvider/RootProvider.js";
|
|
6
|
+
import { ToolbarButton as B } from "./ToolbarButton.js";
|
|
7
|
+
import { ToolbarFilterBase as C } from "./ToolbarFilterBase.js";
|
|
8
|
+
import { DrawerOrDropdown as O } from "../Dropdown/DrawerOrDropdown.js";
|
|
9
|
+
import "../Searchbar/AutocompleteBase.js";
|
|
10
|
+
import { ToolbarOptions as k } from "./ToolbarOptions.js";
|
|
11
|
+
const D = (p, o) => Array.isArray(o) ? o.join(", ") : o, H = ({
|
|
12
|
+
removable: p,
|
|
13
|
+
label: o,
|
|
14
|
+
name: t,
|
|
16
15
|
value: r,
|
|
17
|
-
options:
|
|
18
|
-
optionGroups:
|
|
19
|
-
|
|
20
|
-
onChange: A,
|
|
16
|
+
options: f,
|
|
17
|
+
optionGroups: m,
|
|
18
|
+
onChange: d,
|
|
21
19
|
onRemove: a,
|
|
22
20
|
getSelectedLabel: n,
|
|
23
|
-
|
|
21
|
+
showResultsLabel: y = "Show results",
|
|
22
|
+
optionType: A,
|
|
23
|
+
id: c = `toolbar-filter-${t}`
|
|
24
24
|
}) => {
|
|
25
|
-
const
|
|
26
|
-
(
|
|
27
|
-
...
|
|
28
|
-
name:
|
|
29
|
-
checked: Array.isArray(r) ? r.includes(
|
|
25
|
+
const { currentId: h, toggleId: T, closeAll: u } = j(), w = (f ?? []).map(
|
|
26
|
+
(i) => ({
|
|
27
|
+
...i,
|
|
28
|
+
name: t,
|
|
29
|
+
checked: Array.isArray(r) ? r.includes(i.value) : i.value === r
|
|
30
30
|
})
|
|
31
|
-
),
|
|
32
|
-
return /* @__PURE__ */ b(
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
|
|
31
|
+
), x = (n == null ? void 0 : n(t, r)) ?? D(t, r), e = () => T(c), l = h === c;
|
|
32
|
+
return /* @__PURE__ */ b(C, { expanded: l, children: [
|
|
33
|
+
/* @__PURE__ */ s(
|
|
34
|
+
B,
|
|
35
35
|
{
|
|
36
36
|
type: "select",
|
|
37
|
-
removable:
|
|
37
|
+
removable: p,
|
|
38
38
|
active: Array.isArray(r) ? r.length > 0 : typeof r < "u",
|
|
39
|
-
onToggle:
|
|
39
|
+
onToggle: e,
|
|
40
40
|
onRemove: a,
|
|
41
|
-
children:
|
|
41
|
+
children: x || o
|
|
42
42
|
}
|
|
43
43
|
),
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
|
|
44
|
+
/* @__PURE__ */ s(
|
|
45
|
+
O,
|
|
46
46
|
{
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
onClose:
|
|
50
|
-
|
|
51
|
-
children: /* @__PURE__ */
|
|
52
|
-
|
|
47
|
+
open: l,
|
|
48
|
+
drawerTitle: o,
|
|
49
|
+
onClose: u,
|
|
50
|
+
drawerButton: { onClick: e, label: y },
|
|
51
|
+
children: /* @__PURE__ */ s(
|
|
52
|
+
k,
|
|
53
53
|
{
|
|
54
|
-
options:
|
|
55
|
-
optionGroups:
|
|
56
|
-
onChange:
|
|
57
|
-
optionType:
|
|
54
|
+
options: w,
|
|
55
|
+
optionGroups: m,
|
|
56
|
+
onChange: d,
|
|
57
|
+
optionType: A
|
|
58
58
|
}
|
|
59
59
|
)
|
|
60
60
|
}
|
|
@@ -62,5 +62,5 @@ const w = (t, o) => Array.isArray(o) ? o.join(", ") : o, e = ({
|
|
|
62
62
|
] });
|
|
63
63
|
};
|
|
64
64
|
export {
|
|
65
|
-
|
|
65
|
+
H as ToolbarFilter
|
|
66
66
|
};
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { MouseEventHandler } from 'react';
|
|
2
1
|
import { MenuItemGroups, MenuItemProps, MenuSearchProps } from '../Menu';
|
|
3
2
|
export interface ToolbarMenuProps {
|
|
4
|
-
onToggle?: MouseEventHandler;
|
|
5
3
|
label: string;
|
|
6
4
|
value: string | number;
|
|
7
5
|
items: MenuItemProps[];
|
|
8
6
|
groups?: MenuItemGroups;
|
|
9
7
|
search?: MenuSearchProps;
|
|
10
|
-
|
|
8
|
+
id?: string;
|
|
11
9
|
className?: string;
|
|
12
10
|
}
|
|
13
|
-
export declare const ToolbarMenu: ({
|
|
11
|
+
export declare const ToolbarMenu: ({ label, value, groups, search, items, id }: ToolbarMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as d, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import "../../index-L8X2o7IH.js";
|
|
3
3
|
import "../Icon/SvgIcon.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import "../RootProvider/RootProvider.js";
|
|
6
|
-
import { ToolbarButton as
|
|
7
|
-
import { Menu as
|
|
8
|
-
import { ToolbarFilterBase as
|
|
9
|
-
import { DrawerOrDropdown as
|
|
10
|
-
import "
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
/* @__PURE__ */
|
|
14
|
-
|
|
5
|
+
import { useRootContext as u } from "../RootProvider/RootProvider.js";
|
|
6
|
+
import { ToolbarButton as f } from "./ToolbarButton.js";
|
|
7
|
+
import { Menu as b } from "../Menu/Menu.js";
|
|
8
|
+
import { ToolbarFilterBase as g } from "./ToolbarFilterBase.js";
|
|
9
|
+
import { DrawerOrDropdown as h } from "../Dropdown/DrawerOrDropdown.js";
|
|
10
|
+
import "../Searchbar/AutocompleteBase.js";
|
|
11
|
+
const v = ({ label: e, value: n, groups: l, search: m, items: i, id: r = "toolbar-menu" }) => {
|
|
12
|
+
const { currentId: p, toggleId: s, closeAll: a } = u(), c = () => s(r), t = p === r;
|
|
13
|
+
return /* @__PURE__ */ d(g, { expanded: t, children: [
|
|
14
|
+
/* @__PURE__ */ o(f, { type: "switch", onToggle: c, active: !!n, children: e }),
|
|
15
|
+
/* @__PURE__ */ o(h, { open: t, drawerTitle: "Endre konto", onClose: a, children: /* @__PURE__ */ o(b, { theme: "global", defaultItemColor: "subtle", groups: l, search: m, items: i }) })
|
|
16
|
+
] });
|
|
17
|
+
};
|
|
15
18
|
export {
|
|
16
|
-
|
|
19
|
+
v as ToolbarMenu
|
|
17
20
|
};
|
|
@@ -6,7 +6,7 @@ import { MenuOption as v } from "../Menu/MenuOption.js";
|
|
|
6
6
|
import { MenuSearch as j } from "../Menu/MenuSearch.js";
|
|
7
7
|
import { MenuHeader as x } from "../Menu/MenuHeader.js";
|
|
8
8
|
import "../RootProvider/RootProvider.js";
|
|
9
|
-
import "
|
|
9
|
+
import "../Searchbar/AutocompleteBase.js";
|
|
10
10
|
import { MenuBase as O, MenuList as I, MenuListItem as m } from "../Menu/MenuBase.js";
|
|
11
11
|
const w = ({ search: d, optionGroups: n = {}, options: h, onChange: b, optionType: g }) => {
|
|
12
12
|
var a;
|
|
@@ -2,8 +2,8 @@ import { ChangeEventHandler } from 'react';
|
|
|
2
2
|
export interface ToolbarSearchProps {
|
|
3
3
|
placeholder?: string;
|
|
4
4
|
name: string;
|
|
5
|
-
value
|
|
6
|
-
onChange
|
|
5
|
+
value?: string;
|
|
6
|
+
onChange?: ChangeEventHandler;
|
|
7
7
|
onClear?: () => void;
|
|
8
8
|
}
|
|
9
9
|
export declare const ToolbarSearch: ({ value, name, placeholder, onChange, onClear }: ToolbarSearchProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,7 +5,7 @@ import "../../index-L8X2o7IH.js";
|
|
|
5
5
|
import "react";
|
|
6
6
|
import { IconButton as m } from "../Button/IconButton.js";
|
|
7
7
|
import "../RootProvider/RootProvider.js";
|
|
8
|
-
import "
|
|
8
|
+
import "../Searchbar/AutocompleteBase.js";
|
|
9
9
|
import '../../assets/ToolbarSearch.css';const l = "_field_dvezx_1", p = "_icon_dvezx_5", d = "_input_dvezx_14", _ = "_clear_dvezx_30", o = {
|
|
10
10
|
field: l,
|
|
11
11
|
icon: p,
|
|
@@ -6,29 +6,30 @@ import { Typography as x } from "../Typography/Typography.js";
|
|
|
6
6
|
import { AttachmentSection as b } from "../Attachment/AttachmentSection.js";
|
|
7
7
|
import { MetaTimestamp as T } from "../Meta/MetaTimestamp.js";
|
|
8
8
|
import { ListItemBase as u } from "../List/ListItemBase.js";
|
|
9
|
-
import {
|
|
9
|
+
import { ListItemHeader as v } from "../List/ListItemHeader.js";
|
|
10
10
|
import "../RootProvider/RootProvider.js";
|
|
11
|
+
import "../Searchbar/AutocompleteBase.js";
|
|
11
12
|
import '../../assets/TransmissionItem.css';const I = "_body_1m345_1", z = {
|
|
12
13
|
body: I
|
|
13
|
-
},
|
|
14
|
+
}, M = ({
|
|
14
15
|
loading: c,
|
|
15
16
|
sender: o,
|
|
16
|
-
createdAt:
|
|
17
|
+
createdAt: p,
|
|
17
18
|
createdAtLabel: l,
|
|
18
19
|
badge: r,
|
|
19
20
|
title: n,
|
|
20
|
-
description:
|
|
21
|
-
summary:
|
|
22
|
-
attachments:
|
|
21
|
+
description: g,
|
|
22
|
+
summary: h,
|
|
23
|
+
attachments: a
|
|
23
24
|
}) => {
|
|
24
|
-
const [t,
|
|
25
|
+
const [t, s] = f(!1);
|
|
25
26
|
return /* @__PURE__ */ i(u, { expanded: t, children: [
|
|
26
27
|
/* @__PURE__ */ m(
|
|
27
28
|
v,
|
|
28
29
|
{
|
|
29
30
|
as: "button",
|
|
30
31
|
onClick: () => {
|
|
31
|
-
|
|
32
|
+
s((y) => !y);
|
|
32
33
|
},
|
|
33
34
|
size: "sm",
|
|
34
35
|
avatar: {
|
|
@@ -37,23 +38,23 @@ import '../../assets/TransmissionItem.css';const I = "_body_1m345_1", z = {
|
|
|
37
38
|
name: o == null ? void 0 : o.name
|
|
38
39
|
},
|
|
39
40
|
title: n,
|
|
40
|
-
description: t ? "" :
|
|
41
|
+
description: t ? "" : g,
|
|
41
42
|
badge: r,
|
|
42
43
|
linkIcon: t ? "chevron-down" : "chevron-up"
|
|
43
44
|
}
|
|
44
45
|
),
|
|
45
46
|
t && /* @__PURE__ */ i("div", { className: z.body, children: [
|
|
46
|
-
|
|
47
|
+
p && /* @__PURE__ */ i(T, { loading: c, datetime: p, size: "xs", children: [
|
|
47
48
|
o && /* @__PURE__ */ m("strong", { children: (o == null ? void 0 : o.name) + ", " }),
|
|
48
49
|
l
|
|
49
50
|
] }),
|
|
50
51
|
/* @__PURE__ */ i(x, { size: "lg", children: [
|
|
51
|
-
/* @__PURE__ */ m("p", { children:
|
|
52
|
-
|
|
52
|
+
/* @__PURE__ */ m("p", { children: h }),
|
|
53
|
+
a && /* @__PURE__ */ m(b, { ...a })
|
|
53
54
|
] })
|
|
54
55
|
] })
|
|
55
56
|
] });
|
|
56
57
|
};
|
|
57
58
|
export {
|
|
58
|
-
|
|
59
|
+
M as TransmissionItem
|
|
59
60
|
};
|