@altinn/altinn-components 0.54.2 → 0.55.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/dist/{PersonCircle-DlX_3kRO.js → ChevronUpDown-DqGsU4MC.js} +5 -5
- package/dist/Eye-BrbjRZJp.js +24 -0
- package/dist/InboxFill-vGck_zM_.js +81 -0
- package/dist/InformationSquare-D3WAxfVw.js +24 -0
- package/dist/Trash-DBcymOP9.js +81 -0
- package/dist/assets/AccountMenuButton.css +1 -1
- package/dist/assets/AccountSelector.css +1 -1
- package/dist/assets/AutocompleteBase.css +1 -1
- package/dist/assets/ButtonGroup.css +1 -1
- package/dist/assets/ButtonIcon.css +1 -1
- package/dist/assets/DashboardCard.css +1 -0
- package/dist/assets/DashboardHeader.css +1 -0
- package/dist/assets/DialogListItem.css +1 -1
- package/dist/assets/Dropdown.css +1 -0
- package/dist/assets/DropdownBase.css +1 -1
- package/dist/assets/GlobalHeader.css +1 -1
- package/dist/assets/ItemControls.css +1 -0
- package/dist/assets/ItemLabel.css +1 -0
- package/dist/assets/ItemMedia.css +1 -0
- package/dist/assets/MenuItem.css +1 -1
- package/dist/assets/MenuListDivider.css +1 -0
- package/dist/assets/MenuListHeading.css +1 -0
- package/dist/assets/MenuListItem.css +1 -0
- package/dist/assets/MenuListSearch.css +1 -0
- package/dist/assets/MetaItemIcon.css +1 -1
- package/dist/assets/SearchField.css +1 -1
- package/dist/assets/SeenByLogButton.css +1 -0
- package/dist/assets/Switch.css +1 -0
- package/dist/assets/TabMenu.css +1 -0
- package/dist/assets/Tooltip.css +1 -0
- package/dist/assets/menuList.css +1 -0
- package/dist/components/Account/AccountList.js +1 -1
- package/dist/components/Account/AccountListVirtual.js +4 -4
- package/dist/components/Account/AccountMenu.js +14 -11
- package/dist/components/Account/AccountMenuButton.js +58 -56
- package/dist/components/Attachment/AttachmentLink.js +47 -41
- package/dist/components/Avatar/Avatar.js +11 -12
- package/dist/components/Avatar/AvatarGroup.js +38 -28
- package/dist/components/Banner/Banner.js +20 -38
- package/dist/components/Button/ButtonGroup.js +28 -12
- package/dist/components/Button/ButtonIcon.js +15 -15
- package/dist/components/Button/FloatingActionButton.js +22 -19
- package/dist/components/Byline/Byline.js +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +73 -67
- package/dist/components/Dashboard/DashboardCard.js +24 -21
- package/dist/components/Dashboard/DashboardHeader.js +16 -14
- package/dist/components/Dashboard/index.js +2 -4
- package/dist/components/Datepicker/Datepicker.js +16 -14
- package/dist/components/Datepicker/DatepickerHeader.js +13 -13
- package/dist/components/Dialog/DialogActions.js +9 -9
- package/dist/components/Dialog/DialogAttachments.js +1 -1
- package/dist/components/Dialog/DialogListItem.js +113 -112
- package/dist/components/Dialog/DialogMetadata.js +83 -154
- package/dist/components/Dialog/DialogSeenBy.js +24 -41
- package/dist/components/Dialog/DialogTabs.js +4 -4
- package/dist/components/Dialog/SeenByLog.js +7 -7
- package/dist/components/Dialog/SeenByLogButton.js +12 -6
- package/dist/components/Dropdown/DrawerOrDropdown.js +1 -1
- package/dist/components/Dropdown/Dropdown.js +160 -0
- package/dist/components/Dropdown/DropdownBase.js +12 -12
- package/dist/components/Dropdown/FloatingDropdown.js +119 -74
- package/dist/components/Dropdown/index.js +18 -16
- package/dist/components/DsComponents/index.js +2 -2
- package/dist/components/Forms/SearchField.js +44 -29
- package/dist/components/Forms/Switch.js +10 -8
- package/dist/components/GlobalHeader/AccountSelector.js +55 -55
- package/dist/components/GlobalHeader/GlobalHeader.js +55 -54
- package/dist/components/GlobalHeader/GlobalSearch.js +1 -1
- package/dist/components/GlobalHeader/GlobalSearchButton.js +1 -0
- package/dist/components/GlobalMenu/BackButton.js +1 -1
- package/dist/components/GlobalMenu/GlobalMenu.js +52 -43
- package/dist/components/GlobalMenu/GlobalMenuButton.js +15 -14
- package/dist/components/GlobalMenu/LocaleSwitcher.js +30 -24
- package/dist/components/GlobalMenu_old/BackButton.js +1 -1
- package/dist/components/GlobalMenu_old/CurrentAccount.js +8 -9
- package/dist/components/GlobalMenu_old/EndUserLabel.js +29 -10
- package/dist/components/GlobalMenu_old/GlobalMenu.js +15 -8
- package/dist/components/GlobalMenu_old/GlobalMenuButton.js +1 -1
- package/dist/components/Header/Header.js +6 -6
- package/dist/components/Header/HeaderBase.js +1 -1
- package/dist/components/Header/LocaleSwitcher.js +10 -10
- package/dist/components/Icon/Icon.js +19 -20
- package/dist/components/Icon/ProgressIcon.js +1 -0
- package/dist/components/Icon/index.js +4 -6
- package/dist/components/Item/ItemControls.js +8 -0
- package/dist/components/Item/ItemLabel.js +34 -0
- package/dist/components/Item/ItemMedia.js +33 -0
- package/dist/components/Item/index.js +8 -0
- package/dist/components/Layout/Layout.js +4 -4
- package/dist/components/Menu/Menu.js +67 -45
- package/dist/components/Menu/MenuItem.js +192 -66
- package/dist/components/Menu/MenuItems.js +154 -71
- package/dist/components/Menu/MenuList.js +39 -0
- package/dist/components/Menu/MenuListDivider.js +8 -0
- package/dist/components/Menu/MenuListGroup.js +7 -0
- package/dist/components/Menu/MenuListHeading.js +7 -0
- package/dist/components/Menu/MenuListItem.js +34 -0
- package/dist/components/Menu/MenuListSearch.js +83 -0
- package/dist/components/Menu/MenuOption.js +4 -87
- package/dist/components/Menu/TabMenu.js +15 -0
- package/dist/components/Menu/VirtualizedMenuItems.js +227 -0
- package/dist/components/Menu/aria.js +9 -0
- package/dist/components/Menu/example.data.js +373 -0
- package/dist/components/Menu/example.hooks.js +75 -0
- package/dist/components/Menu/index.js +24 -25
- package/dist/components/Menu/types.js +1 -0
- package/dist/components/Menu/useDropdownMenuController.js +43 -0
- package/dist/components/Menu/useMenuSearch.js +146 -0
- package/dist/components/Menu/useMenuVirtualization.js +5 -0
- package/dist/components/Metadata/MetaItemIcon.js +4 -4
- package/dist/components/Notifications/NotificationItemBase.js +49 -50
- package/dist/components/Page/ContactButtons.js +13 -10
- package/dist/components/Page/PageTabs.js +4 -13
- package/dist/components/Searchbar/Autocomplete.js +34 -32
- package/dist/components/Searchbar/AutocompleteBase.js +3 -3
- package/dist/components/Searchbar/AutocompleteItem.js +29 -42
- package/dist/components/Settings/SettingsItemBase.js +25 -26
- package/dist/components/Settings/UsedByLog.js +6 -6
- package/dist/components/Toolbar/DatepickerFilter.js +87 -0
- package/dist/components/Toolbar/SelectDateFilter.js +51 -0
- package/dist/components/Toolbar/Toolbar.js +18 -104
- package/dist/components/Toolbar/ToolbarFilter.js +69 -73
- package/dist/components/Toolbar/ToolbarFilterAddMenu.js +82 -0
- package/dist/components/Toolbar/ToolbarFilterButton.js +46 -0
- package/dist/components/Toolbar/ToolbarFilterMenu.js +117 -0
- package/dist/components/Toolbar/ToolbarMenu.js +58 -21
- package/dist/components/Toolbar/ToolbarSearch.js +15 -10
- package/dist/components/Toolbar/example.data.js +388 -0
- package/dist/components/Toolbar/example.hooks.js +68 -0
- package/dist/components/Toolbar/formatDateRange.js +19 -0
- package/dist/components/Toolbar/index.js +12 -14
- package/dist/components/Toolbar/useFilter.js +63 -0
- package/dist/components/Tooltip/Tooltip.js +101 -0
- package/dist/components/Tooltip/index.js +4 -0
- package/dist/components/UserListItem/UserListItem.js +15 -13
- package/dist/components/index.js +389 -386
- package/dist/floating-ui.dom-bEgaHJCq.js +997 -0
- package/dist/global.css +1 -1
- package/dist/hooks/useAccountSelector.js +9 -9
- package/dist/hooks/useMenu.js +48 -47
- package/dist/index--jNxJmA8.js +2000 -0
- package/dist/index.js +402 -399
- package/dist/menuList.module-DFH60CqT.js +6 -0
- package/dist/{textfield-DAuYWtUj.js → textfield-Drdr9bio.js} +40 -39
- package/dist/types/lib/components/Account/AccountList.d.ts +2 -2
- package/dist/types/lib/components/Account/AccountList.stories.d.ts +3 -4
- package/dist/types/lib/components/Account/AccountMenu.d.ts +3 -3
- package/dist/types/lib/components/Account/AccountMenu.stories.d.ts +1 -1
- package/dist/types/lib/components/Account/AccountMenuButton.stories.d.ts +10 -2
- package/dist/types/lib/components/Attachment/AttachmentLink.d.ts +3 -1
- package/dist/types/lib/components/Attachment/AttachmentLink.stories.d.ts +1 -1
- package/dist/types/lib/components/Button/ButtonGroup.d.ts +3 -1
- package/dist/types/lib/components/Button/ButtonGroup.stories.d.ts +1 -1
- package/dist/types/lib/components/Button/FloatingActionButton.d.ts +1 -6
- package/dist/types/lib/components/ContextMenu/ContextMenu.d.ts +7 -8
- package/dist/types/lib/components/Dashboard/DashboardCard.d.ts +2 -2
- package/dist/types/lib/components/Dashboard/DashboardHeader.d.ts +2 -2
- package/dist/types/lib/components/Dashboard/index.d.ts +0 -1
- package/dist/types/lib/components/Dialog/DialogTabs.d.ts +2 -4
- package/dist/types/lib/components/Dialog/SeenByLogButton.d.ts +8 -5
- package/dist/types/lib/components/Dropdown/Dropdown.d.ts +22 -0
- package/dist/types/lib/components/Dropdown/Dropdown.stories.d.ts +14 -0
- package/dist/types/lib/components/Dropdown/DropdownBase.d.ts +3 -2
- package/dist/types/lib/components/Dropdown/index.d.ts +1 -0
- package/dist/types/lib/components/Forms/SearchField.d.ts +2 -1
- package/dist/types/lib/components/Forms/SearchField.stories.d.ts +1 -1
- package/dist/types/lib/components/Forms/Switch.d.ts +2 -1
- package/dist/types/lib/components/Forms/Switch.stories.d.ts +1 -1
- package/dist/types/lib/components/GlobalMenu/GlobalMenu.d.ts +1 -1
- package/dist/types/lib/components/GlobalMenu/GlobalMenu.stories.d.ts +1 -3
- package/dist/types/lib/components/GlobalMenu/LocaleSwitcher.d.ts +1 -1
- package/dist/types/lib/components/Header/HeaderButton.d.ts +0 -4
- package/dist/types/lib/components/Header/HeaderButton.stories.d.ts +0 -1
- package/dist/types/lib/components/Icon/Icon.d.ts +3 -2
- package/dist/types/lib/components/Icon/index.d.ts +0 -1
- package/dist/types/lib/components/Item/ItemControls.d.ts +7 -0
- package/dist/types/lib/components/Item/ItemLabel.d.ts +14 -0
- package/dist/types/lib/components/Item/ItemMedia.d.ts +9 -0
- package/dist/types/lib/components/Item/index.d.ts +3 -0
- package/dist/types/lib/components/Menu/Menu.d.ts +4 -7
- package/dist/types/lib/components/Menu/Menu.stories.d.ts +64 -4
- package/dist/types/lib/components/Menu/MenuItem.d.ts +53 -21
- package/dist/types/lib/components/Menu/MenuItems.d.ts +21 -14
- package/dist/types/lib/components/Menu/MenuList.d.ts +21 -0
- package/dist/types/lib/components/Menu/MenuListDivider.d.ts +6 -0
- package/dist/types/lib/components/Menu/MenuListGroup.d.ts +8 -0
- package/dist/types/lib/components/Menu/MenuListHeading.d.ts +8 -0
- package/dist/types/lib/components/Menu/MenuListItem.d.ts +9 -0
- package/dist/types/lib/components/Menu/MenuListSearch.d.ts +15 -0
- package/dist/types/lib/components/Menu/MenuListSearch.stories.d.ts +18 -0
- package/dist/types/lib/components/Menu/MenuOption.d.ts +5 -16
- package/dist/types/lib/components/Menu/TabMenu.d.ts +8 -0
- package/dist/types/lib/components/Menu/VirtualizedMenu.stories.d.ts +22 -0
- package/dist/types/lib/components/Menu/VirtualizedMenuItems.d.ts +2 -0
- package/dist/types/lib/components/Menu/aria.d.ts +1 -0
- package/dist/types/lib/components/Menu/example.hooks.d.ts +24 -0
- package/dist/types/lib/components/Menu/index.d.ts +10 -9
- package/dist/types/lib/components/Menu/types.d.ts +1 -0
- package/dist/types/lib/components/Menu/useDropdownMenuController.d.ts +27 -0
- package/dist/types/lib/components/Menu/useMenuSearch.d.ts +129 -0
- package/dist/types/lib/components/Menu/useMenuVirtualization.d.ts +35 -0
- package/dist/types/lib/components/Page/ContactButtons.d.ts +6 -2
- package/dist/types/lib/components/Page/PageTabs.d.ts +3 -10
- package/dist/types/lib/components/Page/PageTabs.stories.d.ts +1 -1
- package/dist/types/lib/components/Searchbar/AutocompleteItem.d.ts +3 -3
- package/dist/types/lib/components/Searchbar/Searchbar.stories.d.ts +1 -1
- package/dist/types/lib/components/Toolbar/DatepickerFilter.d.ts +15 -0
- package/dist/types/lib/components/Toolbar/SelectDateFilter.d.ts +8 -0
- package/dist/types/lib/components/Toolbar/SelectDateFilter.stories.d.ts +9 -0
- package/dist/types/lib/components/Toolbar/Toolbar.d.ts +6 -19
- package/dist/types/lib/components/Toolbar/Toolbar.stories.d.ts +21 -19
- package/dist/types/lib/components/Toolbar/ToolbarFilter.d.ts +11 -23
- package/dist/types/lib/components/Toolbar/ToolbarFilter.stories.d.ts +6 -13
- package/dist/types/lib/components/Toolbar/ToolbarFilterAddMenu.d.ts +8 -0
- package/dist/types/lib/components/Toolbar/ToolbarFilterButton.d.ts +15 -0
- package/dist/types/lib/components/Toolbar/ToolbarFilterMenu.d.ts +15 -0
- package/dist/types/lib/components/Toolbar/ToolbarMenu.d.ts +5 -10
- package/dist/types/lib/components/Toolbar/ToolbarSearch.d.ts +3 -5
- package/dist/types/lib/components/Toolbar/ToolbarSearch.stories.d.ts +635 -1
- package/dist/types/lib/components/Toolbar/example.hooks.d.ts +41 -0
- package/dist/types/lib/components/Toolbar/formatDateRange.d.ts +10 -0
- package/dist/types/lib/components/Toolbar/index.d.ts +4 -5
- package/dist/types/lib/components/Toolbar/useFilter.d.ts +173 -0
- package/dist/types/lib/components/Tooltip/Tooltip.d.ts +8 -0
- package/dist/types/lib/components/Tooltip/Tooltip.stories.d.ts +9 -0
- package/dist/types/lib/components/Tooltip/index.d.ts +1 -0
- package/dist/types/lib/components/Transmission/Transmission.stories.d.ts +2 -2
- package/dist/types/lib/components/Typography/Heading.d.ts +2 -2
- package/dist/types/lib/components/UserListItem/UserListItem.d.ts +3 -1
- package/dist/types/lib/components/UserListItem/UserListItem.stories.d.ts +7 -1
- package/dist/types/lib/components/index.d.ts +2 -0
- package/dist/types/lib/hooks/useAccountSelector.d.ts +2 -2
- package/dist/types/lib/hooks/useMenu.d.ts +3 -1
- package/dist/{index-De5bF0Gf.js → useMenuVirtualization-DpvWCsyD.js} +216 -165
- package/package.json +1 -1
- package/dist/assets/ContextMenu.css +0 -1
- package/dist/assets/IconOrAvatar.css +0 -1
- package/dist/assets/MenuBase.css +0 -1
- package/dist/assets/MenuHeader.css +0 -1
- package/dist/assets/MenuInputField.css +0 -1
- package/dist/assets/MenuItemBase.css +0 -1
- package/dist/assets/MenuItemIcon.css +0 -1
- package/dist/assets/MenuItemLabel.css +0 -1
- package/dist/assets/MenuItemsVirtual.css +0 -1
- package/dist/assets/MenuOption.css +0 -1
- package/dist/assets/MenuSearch.css +0 -1
- package/dist/assets/PageTabs.css +0 -1
- package/dist/assets/ToolbarBase.css +0 -1
- package/dist/assets/ToolbarButton.css +0 -1
- package/dist/assets/ToolbarDaterange.css +0 -1
- package/dist/assets/ToolbarFilterBase.css +0 -1
- package/dist/components/Dashboard/DashboardIcon.js +0 -11
- package/dist/components/Datepicker/DatepickerBase.js +0 -8
- package/dist/components/GlobalMenu/EndUserLabel.js +0 -13
- package/dist/components/GlobalMenu/LocaleButton.js +0 -13
- package/dist/components/Icon/IconOrAvatar.js +0 -33
- package/dist/components/Menu/MenuBase.js +0 -56
- package/dist/components/Menu/MenuHeader.js +0 -8
- package/dist/components/Menu/MenuInputField.js +0 -31
- package/dist/components/Menu/MenuItemBase.js +0 -58
- package/dist/components/Menu/MenuItemIcon.js +0 -27
- package/dist/components/Menu/MenuItemLabel.js +0 -76
- package/dist/components/Menu/MenuItemsVirtual.js +0 -168
- package/dist/components/Menu/MenuSearch.js +0 -41
- package/dist/components/Toolbar/ToolbarAccountMenu.js +0 -52
- package/dist/components/Toolbar/ToolbarAdd.js +0 -24
- package/dist/components/Toolbar/ToolbarBase.js +0 -8
- package/dist/components/Toolbar/ToolbarButton.js +0 -115
- package/dist/components/Toolbar/ToolbarDaterange.js +0 -58
- package/dist/components/Toolbar/ToolbarFilterBase.js +0 -17
- package/dist/components/Toolbar/ToolbarOptions.js +0 -84
- package/dist/index-DttADHE1.js +0 -2993
- package/dist/types/lib/components/ContextMenu/ContextMenu.stories.d.ts +0 -8
- package/dist/types/lib/components/Dashboard/DashboardIcon.d.ts +0 -7
- package/dist/types/lib/components/Datepicker/DatepickerBase.d.ts +0 -6
- package/dist/types/lib/components/GlobalMenu/EndUserLabel.d.ts +0 -5
- package/dist/types/lib/components/GlobalMenu/LocaleButton.d.ts +0 -3
- package/dist/types/lib/components/Icon/IconOrAvatar.d.ts +0 -13
- package/dist/types/lib/components/Menu/MenuBase.d.ts +0 -42
- package/dist/types/lib/components/Menu/MenuHeader.d.ts +0 -4
- package/dist/types/lib/components/Menu/MenuInputField.d.ts +0 -12
- package/dist/types/lib/components/Menu/MenuItemBase.d.ts +0 -28
- package/dist/types/lib/components/Menu/MenuItemIcon.d.ts +0 -10
- package/dist/types/lib/components/Menu/MenuItemLabel.d.ts +0 -15
- package/dist/types/lib/components/Menu/MenuItemsVirtual.d.ts +0 -2
- package/dist/types/lib/components/Menu/MenuSearch.d.ts +0 -10
- package/dist/types/lib/components/Menu/MenuSearch.stories.d.ts +0 -18
- package/dist/types/lib/components/Toolbar/ToolbarAccountMenu.d.ts +0 -8
- package/dist/types/lib/components/Toolbar/ToolbarAdd.d.ts +0 -8
- package/dist/types/lib/components/Toolbar/ToolbarAdd.stories.d.ts +0 -13
- package/dist/types/lib/components/Toolbar/ToolbarBase.d.ts +0 -5
- package/dist/types/lib/components/Toolbar/ToolbarButton.d.ts +0 -16
- package/dist/types/lib/components/Toolbar/ToolbarButton.stories.d.ts +0 -15
- package/dist/types/lib/components/Toolbar/ToolbarDate.stories.d.ts +0 -26
- package/dist/types/lib/components/Toolbar/ToolbarDaterange.d.ts +0 -11
- package/dist/types/lib/components/Toolbar/ToolbarDaterange.stories.d.ts +0 -15
- package/dist/types/lib/components/Toolbar/ToolbarFilterBase.d.ts +0 -8
- package/dist/types/lib/components/Toolbar/ToolbarMenu.stories.d.ts +0 -19
- package/dist/types/lib/components/Toolbar/ToolbarOptions.d.ts +0 -22
- package/dist/types/lib/components/Toolbar/ToolbarOptions.stories.d.ts +0 -12
- /package/dist/assets/{DatepickerBase.css → Datepicker.css} +0 -0
- /package/dist/types/lib/components/GlobalHeader/{AccountSector.stories.d.ts → AccountSelector.stories.d.ts} +0 -0
|
@@ -1,106 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
showResultsLabel: y,
|
|
19
|
-
removeButtonAltText: S,
|
|
20
|
-
addFilterButtonLabel: x
|
|
21
|
-
}) => {
|
|
22
|
-
const { openId: A, closeAll: F } = V(), t = c || {}, a = typeof f == "function" ? f : () => {
|
|
23
|
-
}, [i, d] = q(
|
|
24
|
-
() => n.filter((e) => !e.removable || typeof t[e.name] < "u").map((e) => e.name)
|
|
25
|
-
), I = T(
|
|
26
|
-
() => i.map((e) => n.find((o) => o.name === e)).filter((e) => typeof e < "u"),
|
|
27
|
-
[n, i]
|
|
28
|
-
), u = T(
|
|
29
|
-
() => n.filter((e) => !i.includes(e.name)),
|
|
30
|
-
[n, i]
|
|
31
|
-
);
|
|
32
|
-
G(() => {
|
|
33
|
-
const e = n.filter((o) => !o.removable || typeof t[o.name] < "u").map((o) => o.name);
|
|
34
|
-
d((o) => {
|
|
35
|
-
const l = e.filter((r) => !o.includes(r));
|
|
36
|
-
return l.length === 0 ? o : [...o, ...l];
|
|
37
|
-
});
|
|
38
|
-
}, [n, t]);
|
|
39
|
-
const j = ({ name: e, value: o, type: l }) => {
|
|
40
|
-
const r = [o];
|
|
41
|
-
l === "radio" ? (F(), a({
|
|
42
|
-
...t,
|
|
43
|
-
[e]: r
|
|
44
|
-
})) : a({
|
|
45
|
-
...t,
|
|
46
|
-
[e]: t[e] ? t[e].some((p) => r.includes(String(p))) ? t[e].filter((p) => !(r || []).includes(String(p))) : [...t[e], ...r || []] : r
|
|
47
|
-
});
|
|
48
|
-
}, C = (e) => {
|
|
49
|
-
d((o) => o.filter((l) => l !== e)), a({
|
|
50
|
-
...t,
|
|
51
|
-
[e]: void 0
|
|
52
|
-
}), F();
|
|
53
|
-
}, N = (e, o) => {
|
|
54
|
-
i.includes(e) || d((l) => [...l, e]), A(o), a({
|
|
55
|
-
...t,
|
|
56
|
-
[e]: t[e] ?? []
|
|
57
|
-
}), requestAnimationFrame(() => {
|
|
58
|
-
document.querySelector(`[data-testid="${o}"]`)?.focus();
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
|
-
return /* @__PURE__ */ R(w, { children: [
|
|
62
|
-
b && /* @__PURE__ */ s($, { buttonTestId: "account-menu-button", ...b }),
|
|
63
|
-
m && /* @__PURE__ */ s(E, { ...m }),
|
|
64
|
-
I.map((e) => /* @__PURE__ */ s(
|
|
65
|
-
B,
|
|
66
|
-
{
|
|
67
|
-
id: g(e.name, e.id),
|
|
68
|
-
showResultsLabel: y,
|
|
69
|
-
onRemove: () => C(e.name),
|
|
70
|
-
onChange: j,
|
|
71
|
-
name: e.name,
|
|
72
|
-
options: e.options,
|
|
73
|
-
label: e.label,
|
|
74
|
-
optionType: e.optionType,
|
|
75
|
-
removable: e.removable,
|
|
76
|
-
getSelectedLabel: h,
|
|
77
|
-
buttonAltText: S,
|
|
78
|
-
optionGroups: e.optionGroups,
|
|
79
|
-
filterState: t,
|
|
80
|
-
search: e.search
|
|
81
|
-
},
|
|
82
|
-
e.name
|
|
83
|
-
)),
|
|
84
|
-
u?.length > 0 && /* @__PURE__ */ s(
|
|
85
|
-
k,
|
|
86
|
-
{
|
|
87
|
-
id: "toolbar-filter-add",
|
|
88
|
-
label: x,
|
|
89
|
-
items: u.map((e) => {
|
|
90
|
-
const o = g(e.name, e.id);
|
|
91
|
-
return {
|
|
92
|
-
id: o,
|
|
93
|
-
title: e.label,
|
|
94
|
-
name: e.name,
|
|
95
|
-
onClick: () => N(e.name, o)
|
|
96
|
-
};
|
|
97
|
-
})
|
|
98
|
-
},
|
|
99
|
-
u.join(",")
|
|
100
|
-
),
|
|
101
|
-
v
|
|
102
|
-
] });
|
|
103
|
-
};
|
|
1
|
+
import { jsxs as s, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import "../Button/Button.js";
|
|
3
|
+
import "../../index-p1eeF8LQ.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "../RootProvider/RootProvider.js";
|
|
6
|
+
import "../Snackbar/useSnackbar.js";
|
|
7
|
+
import { ToolbarFilter as u } from "./ToolbarFilter.js";
|
|
8
|
+
import { ToolbarSearch as b } from "./ToolbarSearch.js";
|
|
9
|
+
import { ToolbarMenu as i } from "./ToolbarMenu.js";
|
|
10
|
+
import { ButtonGroup as f } from "../Button/ButtonGroup.js";
|
|
11
|
+
const F = ({ accountMenu: o, menus: p, search: m, filter: t, children: e }) => /* @__PURE__ */ s(f, { size: "xs", wrap: !0, children: [
|
|
12
|
+
o && /* @__PURE__ */ r(i, { size: "md", ...o, virtualized: !0 }),
|
|
13
|
+
p?.map((a, l) => /* @__PURE__ */ r(i, { ...a }, l)),
|
|
14
|
+
m && /* @__PURE__ */ r(b, { ...m }),
|
|
15
|
+
t && /* @__PURE__ */ r(u, { ...t }),
|
|
16
|
+
e
|
|
17
|
+
] });
|
|
104
18
|
export {
|
|
105
|
-
|
|
19
|
+
F as Toolbar
|
|
106
20
|
};
|
|
@@ -1,83 +1,79 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as g, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { useState as C, createElement as M } from "react";
|
|
3
|
+
import { Button as w } from "../Button/Button.js";
|
|
2
4
|
import "../../index-p1eeF8LQ.js";
|
|
3
|
-
import "
|
|
4
|
-
import { useIsDesktop as j } from "../../hooks/useIsDesktop.js";
|
|
5
|
-
import "../Button/Button.js";
|
|
6
|
-
import { useRootContext as F } from "../RootProvider/RootProvider.js";
|
|
7
|
-
import { DrawerOrDropdown as L } from "../Dropdown/DrawerOrDropdown.js";
|
|
5
|
+
import "../RootProvider/RootProvider.js";
|
|
8
6
|
import "../Snackbar/useSnackbar.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
filterState:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
optionType: h,
|
|
26
|
-
id: s = `toolbar-filter-${o}`
|
|
7
|
+
import { useFilter as I } from "./useFilter.js";
|
|
8
|
+
import { ButtonGroup as L } from "../Button/ButtonGroup.js";
|
|
9
|
+
import { ToolbarFilterAddMenu as N } from "./ToolbarFilterAddMenu.js";
|
|
10
|
+
import { ToolbarFilterMenu as O } from "./ToolbarFilterMenu.js";
|
|
11
|
+
import { S as y } from "../../XMark-tKk6aExO.js";
|
|
12
|
+
const V = ({
|
|
13
|
+
filters: n,
|
|
14
|
+
filterState: e = {},
|
|
15
|
+
onFilterStateChange: r,
|
|
16
|
+
addLabel: u = "Legg til filter",
|
|
17
|
+
addNextLabel: b = "Legg til",
|
|
18
|
+
resetLabel: v = "Nullstill",
|
|
19
|
+
removeLabel: h = "Fjern filter",
|
|
20
|
+
submitLabel: F,
|
|
21
|
+
getFilterLabel: T,
|
|
22
|
+
virtualized: j
|
|
27
23
|
}) => {
|
|
28
|
-
const {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
24
|
+
const { visibleFilters: l, hiddenFilters: s, onFilterAdd: x, onFilterChange: R, onFilterRemove: i } = I({
|
|
25
|
+
filters: n,
|
|
26
|
+
filterState: e,
|
|
27
|
+
onFilterStateChange: r
|
|
28
|
+
}), f = (n?.filter((o) => o.removable)?.length || 0) > 0 && Object.values(e)?.some((o) => o && o?.length > 0), k = n?.filter((o) => o.removable)?.map((o) => o.name) ?? [], [a, d] = C(void 0), p = (o) => {
|
|
29
|
+
d((t) => t === o ? void 0 : o);
|
|
30
|
+
}, c = () => {
|
|
31
|
+
d(void 0);
|
|
32
|
+
}, A = () => {
|
|
33
|
+
for (const o of k)
|
|
34
|
+
i(o);
|
|
35
|
+
r?.({});
|
|
36
|
+
};
|
|
37
|
+
return /* @__PURE__ */ g(L, { size: "xs", wrap: !0, children: [
|
|
38
|
+
l?.map((o, t) => {
|
|
39
|
+
const B = T?.(o?.name, e?.[o?.id]) ?? o?.label;
|
|
40
|
+
return /* @__PURE__ */ M(
|
|
41
|
+
O,
|
|
42
|
+
{
|
|
43
|
+
...o,
|
|
44
|
+
submitLabel: F,
|
|
45
|
+
key: t,
|
|
46
|
+
onToggle: () => p(o.name),
|
|
47
|
+
onClose: c,
|
|
48
|
+
open: a === o.name,
|
|
49
|
+
label: B,
|
|
50
|
+
onRemove: () => i(o.name),
|
|
51
|
+
removeLabel: h,
|
|
52
|
+
onFilterChange: R,
|
|
53
|
+
onFilterStateChange: r,
|
|
54
|
+
filterState: e
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}),
|
|
58
|
+
s?.length > 0 && /* @__PURE__ */ m(
|
|
59
|
+
N,
|
|
42
60
|
{
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
tabIndex: l ? -1 : 0,
|
|
52
|
-
children: B || t
|
|
61
|
+
name: "add",
|
|
62
|
+
onToggle: () => p("add"),
|
|
63
|
+
onClose: c,
|
|
64
|
+
open: a === "add",
|
|
65
|
+
items: s,
|
|
66
|
+
onAdd: x,
|
|
67
|
+
label: l?.length > 0 ? b : u,
|
|
68
|
+
virtualized: j
|
|
53
69
|
}
|
|
54
70
|
),
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
|
|
57
|
-
{
|
|
58
|
-
|
|
59
|
-
drawerTitle: t,
|
|
60
|
-
onClose: d,
|
|
61
|
-
drawerButton: {
|
|
62
|
-
onClick: f,
|
|
63
|
-
label: x
|
|
64
|
-
},
|
|
65
|
-
children: /* @__PURE__ */ a(
|
|
66
|
-
E,
|
|
67
|
-
{
|
|
68
|
-
name: o,
|
|
69
|
-
options: w,
|
|
70
|
-
optionGroups: b,
|
|
71
|
-
onChange: y,
|
|
72
|
-
optionType: h,
|
|
73
|
-
keyboardEvents: l && u,
|
|
74
|
-
search: A
|
|
75
|
-
}
|
|
76
|
-
)
|
|
77
|
-
}
|
|
78
|
-
)
|
|
71
|
+
f && /* @__PURE__ */ g(w, { onClick: A, variant: "ghost", children: [
|
|
72
|
+
/* @__PURE__ */ m(y, { "aria-hidden": "true" }),
|
|
73
|
+
/* @__PURE__ */ m("span", { children: v })
|
|
74
|
+
] })
|
|
79
75
|
] });
|
|
80
76
|
};
|
|
81
77
|
export {
|
|
82
|
-
|
|
78
|
+
V as ToolbarFilter
|
|
83
79
|
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as s, jsxs as h } from "react/jsx-runtime";
|
|
3
|
+
import f, { forwardRef as v, useRef as m, useEffect as y } from "react";
|
|
4
|
+
import { Button as w } from "../Button/Button.js";
|
|
5
|
+
import "../../index-p1eeF8LQ.js";
|
|
6
|
+
import { Dropdown as b } from "../Dropdown/Dropdown.js";
|
|
7
|
+
import "../RootProvider/RootProvider.js";
|
|
8
|
+
import { Menu as O } from "../Menu/Menu.js";
|
|
9
|
+
import { useDropdownMenuController as x } from "../Menu/useDropdownMenuController.js";
|
|
10
|
+
import "../Snackbar/useSnackbar.js";
|
|
11
|
+
import { u as I } from "../../useId-BVFxCjkq.js";
|
|
12
|
+
var R = function(t, a) {
|
|
13
|
+
var o = {};
|
|
14
|
+
for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && a.indexOf(e) < 0 && (o[e] = t[e]);
|
|
15
|
+
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
16
|
+
for (var r = 0, e = Object.getOwnPropertySymbols(t); r < e.length; r++)
|
|
17
|
+
a.indexOf(e[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[r]) && (o[e[r]] = t[e[r]]);
|
|
18
|
+
return o;
|
|
19
|
+
};
|
|
20
|
+
const j = v((t, a) => {
|
|
21
|
+
var { title: o, titleId: e } = t, r = R(t, ["title", "titleId"]);
|
|
22
|
+
let i = I();
|
|
23
|
+
return i = o ? e || "title-" + i : void 0, f.createElement(
|
|
24
|
+
"svg",
|
|
25
|
+
Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: a, "aria-labelledby": i }, r),
|
|
26
|
+
o ? f.createElement("title", { id: i }, o) : null,
|
|
27
|
+
f.createElement("path", { fill: "currentColor", d: "M12.75 5.5a.75.75 0 0 0-1.5 0v5.75H5.5a.75.75 0 0 0 0 1.5h5.75v5.75a.75.75 0 0 0 1.5 0v-5.75h5.75a.75.75 0 0 0 0-1.5h-5.75z" })
|
|
28
|
+
);
|
|
29
|
+
}), H = ({
|
|
30
|
+
label: t = "Legg til filter",
|
|
31
|
+
items: a,
|
|
32
|
+
groups: o = {},
|
|
33
|
+
onAdd: e,
|
|
34
|
+
onToggle: r,
|
|
35
|
+
onClose: i,
|
|
36
|
+
open: n
|
|
37
|
+
}) => {
|
|
38
|
+
const l = x({ id: "tool-filter-add" }), u = m(n), p = m(!1), c = a?.map((d) => ({
|
|
39
|
+
...d,
|
|
40
|
+
onClick: () => e?.(d?.name ?? "")
|
|
41
|
+
}));
|
|
42
|
+
if (y(() => {
|
|
43
|
+
const d = u.current;
|
|
44
|
+
u.current = n, d && !n && l?.triggerRef?.current?.focus();
|
|
45
|
+
}, [n, l.triggerRef]), !c?.length)
|
|
46
|
+
return null;
|
|
47
|
+
const g = () => {
|
|
48
|
+
const d = document.getElementById(l.menuId);
|
|
49
|
+
p.current = !!d?.querySelector('[aria-haspopup="menu"][aria-expanded="true"]'), i();
|
|
50
|
+
};
|
|
51
|
+
return /* @__PURE__ */ s(
|
|
52
|
+
b,
|
|
53
|
+
{
|
|
54
|
+
variant: "drawer-dropdown",
|
|
55
|
+
trigger: /* @__PURE__ */ h(
|
|
56
|
+
w,
|
|
57
|
+
{
|
|
58
|
+
variant: "secondary",
|
|
59
|
+
style: {
|
|
60
|
+
borderStyle: "dashed"
|
|
61
|
+
},
|
|
62
|
+
"aria-haspopup": "menu",
|
|
63
|
+
"aria-expanded": n,
|
|
64
|
+
"aria-controls": n ? l.menuId : void 0,
|
|
65
|
+
onClick: r,
|
|
66
|
+
ref: l.triggerRef,
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ s(j, { "aria-hidden": "true", focusable: "false" }),
|
|
69
|
+
/* @__PURE__ */ s("span", { children: t })
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
open: n,
|
|
74
|
+
onClose: g,
|
|
75
|
+
...l.dropdownA11yProps,
|
|
76
|
+
children: /* @__PURE__ */ s(O, { groups: o, items: c, maxLevels: 1, keyboardEvents: n, open: n, ...l.menuA11yProps })
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
};
|
|
80
|
+
export {
|
|
81
|
+
H as ToolbarFilterAddMenu
|
|
82
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsxs as m, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Button as o } from "../Button/Button.js";
|
|
3
|
+
import "../../index-p1eeF8LQ.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "../RootProvider/RootProvider.js";
|
|
6
|
+
import { Tooltip as s } from "../Tooltip/Tooltip.js";
|
|
7
|
+
import "../Snackbar/useSnackbar.js";
|
|
8
|
+
import { ButtonGroup as c } from "../Button/ButtonGroup.js";
|
|
9
|
+
import { ButtonGroupDivider as h } from "../Button/ButtonGroupDivider.js";
|
|
10
|
+
import { S as b } from "../../XMark-tKk6aExO.js";
|
|
11
|
+
import { S as v } from "../../ChevronUpDown-DqGsU4MC.js";
|
|
12
|
+
function w({
|
|
13
|
+
name: i,
|
|
14
|
+
value: p,
|
|
15
|
+
onClick: e,
|
|
16
|
+
removable: d,
|
|
17
|
+
removeLabel: a = "Fjern filter",
|
|
18
|
+
onRemove: u,
|
|
19
|
+
children: n,
|
|
20
|
+
open: f,
|
|
21
|
+
ref: l
|
|
22
|
+
}) {
|
|
23
|
+
const t = p ? "tinted" : "outline";
|
|
24
|
+
return d ? /* @__PURE__ */ m(c, { variant: t, connected: !0, children: [
|
|
25
|
+
/* @__PURE__ */ r(o, { variant: t, onClick: e, "data-id": `filter-button-${i}`, "aria-expanded": f, ref: l, children: /* @__PURE__ */ r("span", { children: n }) }),
|
|
26
|
+
/* @__PURE__ */ r(h, { variant: t }),
|
|
27
|
+
/* @__PURE__ */ r(s, { content: a, children: /* @__PURE__ */ r(
|
|
28
|
+
o,
|
|
29
|
+
{
|
|
30
|
+
variant: t,
|
|
31
|
+
onClick: u,
|
|
32
|
+
style: {
|
|
33
|
+
borderLeft: "none",
|
|
34
|
+
borderRadius: "0 .25em .25em 0"
|
|
35
|
+
},
|
|
36
|
+
children: /* @__PURE__ */ r(b, { "aria-hidden": "true" })
|
|
37
|
+
}
|
|
38
|
+
) })
|
|
39
|
+
] }) : /* @__PURE__ */ m(o, { variant: t, onClick: e, "data-id": `filter-button-${i}`, children: [
|
|
40
|
+
/* @__PURE__ */ r("span", { children: n }),
|
|
41
|
+
/* @__PURE__ */ r(v, {})
|
|
42
|
+
] });
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
w as ToolbarFilterButton
|
|
46
|
+
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as O, useEffect as B } from "react";
|
|
3
|
+
import "../../index-p1eeF8LQ.js";
|
|
4
|
+
import "../Button/Button.js";
|
|
5
|
+
import { Menu as T } from "../Menu/Menu.js";
|
|
6
|
+
import { useDropdownMenuController as V } from "../Menu/useDropdownMenuController.js";
|
|
7
|
+
import "../RootProvider/RootProvider.js";
|
|
8
|
+
import "../Snackbar/useSnackbar.js";
|
|
9
|
+
import { Dropdown as I } from "../Dropdown/Dropdown.js";
|
|
10
|
+
import { ToolbarFilterButton as M } from "./ToolbarFilterButton.js";
|
|
11
|
+
const Y = ({
|
|
12
|
+
as: R,
|
|
13
|
+
size: l,
|
|
14
|
+
name: n,
|
|
15
|
+
label: a = "",
|
|
16
|
+
searchable: c,
|
|
17
|
+
groups: f,
|
|
18
|
+
items: p,
|
|
19
|
+
removable: A,
|
|
20
|
+
removeLabel: F = "Fjern filter",
|
|
21
|
+
filterState: s,
|
|
22
|
+
onFilterStateChange: g,
|
|
23
|
+
onFilterChange: P,
|
|
24
|
+
onRemove: E,
|
|
25
|
+
open: o,
|
|
26
|
+
onToggle: v,
|
|
27
|
+
onClose: u,
|
|
28
|
+
submitLabel: w,
|
|
29
|
+
search: y,
|
|
30
|
+
virtualized: b
|
|
31
|
+
}) => {
|
|
32
|
+
const x = O(o), t = V({ id: "toolbar-filter-menu" });
|
|
33
|
+
B(() => {
|
|
34
|
+
const r = x.current;
|
|
35
|
+
x.current = o, r && !o && t?.triggerRef?.current?.focus();
|
|
36
|
+
}, [o, t.triggerRef]);
|
|
37
|
+
const j = (r) => {
|
|
38
|
+
const m = r.target.type, C = r.target.name, D = r.target.value;
|
|
39
|
+
P?.(m, C, D), m === "radio" && u();
|
|
40
|
+
}, h = p?.map((r) => ({
|
|
41
|
+
...r,
|
|
42
|
+
onChange: (m) => j(m)
|
|
43
|
+
})), i = p?.filter((r) => r.checked)?.map((r) => r.value || "true"), k = R || T, d = c ? "combobox" : "menu";
|
|
44
|
+
return A ? /* @__PURE__ */ e(
|
|
45
|
+
I,
|
|
46
|
+
{
|
|
47
|
+
submitLabel: w,
|
|
48
|
+
variant: "drawer-dropdown",
|
|
49
|
+
trigger: /* @__PURE__ */ e(
|
|
50
|
+
M,
|
|
51
|
+
{
|
|
52
|
+
name: n,
|
|
53
|
+
onClick: v,
|
|
54
|
+
onRemove: E,
|
|
55
|
+
removable: !0,
|
|
56
|
+
value: i?.length > 0 ? i : void 0,
|
|
57
|
+
removeLabel: F,
|
|
58
|
+
open: o,
|
|
59
|
+
"aria-expanded": o,
|
|
60
|
+
"aria-controls": t.menuId,
|
|
61
|
+
ref: t.triggerRef,
|
|
62
|
+
children: a
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
open: o,
|
|
66
|
+
onClose: u,
|
|
67
|
+
...t.dropdownA11yProps,
|
|
68
|
+
children: /* @__PURE__ */ e(
|
|
69
|
+
k,
|
|
70
|
+
{
|
|
71
|
+
search: y,
|
|
72
|
+
name: n,
|
|
73
|
+
filterState: s,
|
|
74
|
+
onFilterStateChange: g,
|
|
75
|
+
size: l,
|
|
76
|
+
searchable: c,
|
|
77
|
+
groups: f,
|
|
78
|
+
items: h,
|
|
79
|
+
keyboardEvents: o,
|
|
80
|
+
a11yMode: d,
|
|
81
|
+
...d === "combobox" ? { id: t.menuId } : t.menuA11yProps,
|
|
82
|
+
virtualized: b
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
) : /* @__PURE__ */ e(
|
|
87
|
+
I,
|
|
88
|
+
{
|
|
89
|
+
variant: "drawer-dropdown",
|
|
90
|
+
submitLabel: w,
|
|
91
|
+
trigger: /* @__PURE__ */ e(M, { name: n, onClick: v, value: i?.length > 0 ? i : void 0, children: a }),
|
|
92
|
+
open: o,
|
|
93
|
+
onClose: u,
|
|
94
|
+
...t.dropdownA11yProps,
|
|
95
|
+
children: /* @__PURE__ */ e(
|
|
96
|
+
k,
|
|
97
|
+
{
|
|
98
|
+
search: y,
|
|
99
|
+
name: n,
|
|
100
|
+
filterState: s,
|
|
101
|
+
onFilterStateChange: g,
|
|
102
|
+
size: l,
|
|
103
|
+
searchable: c,
|
|
104
|
+
groups: f,
|
|
105
|
+
items: h,
|
|
106
|
+
keyboardEvents: o,
|
|
107
|
+
a11yMode: d,
|
|
108
|
+
...d === "combobox" ? { id: t.menuId } : t.menuA11yProps,
|
|
109
|
+
virtualized: b
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
};
|
|
115
|
+
export {
|
|
116
|
+
Y as ToolbarFilterMenu
|
|
117
|
+
};
|
|
@@ -1,28 +1,65 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as r, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { Button as d } from "../Button/Button.js";
|
|
2
3
|
import "../../index-p1eeF8LQ.js";
|
|
3
4
|
import "react";
|
|
4
|
-
import "../
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { Dropdown as u } from "../Dropdown/Dropdown.js";
|
|
6
|
+
import "../RootProvider/RootProvider.js";
|
|
7
|
+
import { Menu as c } from "../Menu/Menu.js";
|
|
8
|
+
import { useDropdownMenuController as b } from "../Menu/useDropdownMenuController.js";
|
|
8
9
|
import "../Snackbar/useSnackbar.js";
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
label:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
items: l,
|
|
17
|
-
id: r = "toolbar-menu",
|
|
18
|
-
title: p = "Endre aktør"
|
|
10
|
+
import { S as f } from "../../ChevronUpDown-DqGsU4MC.js";
|
|
11
|
+
const k = ({
|
|
12
|
+
title: a = "Title",
|
|
13
|
+
label: i = "Label",
|
|
14
|
+
items: p = [],
|
|
15
|
+
onSelectId: l,
|
|
16
|
+
...e
|
|
19
17
|
}) => {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
const o = b({ id: "toolbar-menu", returnFocusOnClose: !0 }), n = e.searchable ? "combobox" : "menu", m = p.map((t) => ({
|
|
19
|
+
...t,
|
|
20
|
+
onClick: () => {
|
|
21
|
+
l?.(t?.id ?? ""), o.setOpen(!1);
|
|
22
|
+
}
|
|
23
|
+
}));
|
|
24
|
+
return /* @__PURE__ */ r(
|
|
25
|
+
u,
|
|
26
|
+
{
|
|
27
|
+
id: "toolbar-menu",
|
|
28
|
+
variant: "drawer-dropdown",
|
|
29
|
+
title: a,
|
|
30
|
+
trigger: /* @__PURE__ */ s(
|
|
31
|
+
d,
|
|
32
|
+
{
|
|
33
|
+
variant: "primary",
|
|
34
|
+
onClick: o.toggleMenu,
|
|
35
|
+
"aria-expanded": o.open,
|
|
36
|
+
"aria-haspopup": "menu",
|
|
37
|
+
"aria-controls": o.open ? o.menuId : void 0,
|
|
38
|
+
ref: o.triggerRef,
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ r("span", { children: i }),
|
|
41
|
+
/* @__PURE__ */ r(f, { "aria-hidden": "true", focusable: "false" })
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
),
|
|
45
|
+
open: o.open,
|
|
46
|
+
onClose: () => o.setOpen(!1),
|
|
47
|
+
...e?.searchable ? {} : o.dropdownA11yProps,
|
|
48
|
+
children: /* @__PURE__ */ r(
|
|
49
|
+
c,
|
|
50
|
+
{
|
|
51
|
+
...e,
|
|
52
|
+
items: m,
|
|
53
|
+
keyboardEvents: o.open,
|
|
54
|
+
a11yMode: n,
|
|
55
|
+
open: o.open,
|
|
56
|
+
scrollToTopOnOpen: e.virtualized,
|
|
57
|
+
...n === "combobox" ? { id: o.menuId } : o.menuA11yProps
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
);
|
|
25
62
|
};
|
|
26
63
|
export {
|
|
27
|
-
|
|
64
|
+
k as ToolbarMenu
|
|
28
65
|
};
|
|
@@ -1,29 +1,34 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
2
|
import "../../index-p1eeF8LQ.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "../Button/Button.js";
|
|
5
5
|
import "../RootProvider/RootProvider.js";
|
|
6
|
-
import { SearchField as a } from "../Forms/SearchField.js";
|
|
7
6
|
import "../Snackbar/useSnackbar.js";
|
|
8
|
-
|
|
7
|
+
import { SearchField as c } from "../Forms/SearchField.js";
|
|
8
|
+
const S = ({
|
|
9
9
|
value: r,
|
|
10
10
|
name: o,
|
|
11
11
|
placeholder: t = "Search",
|
|
12
|
-
|
|
12
|
+
collapsible: e,
|
|
13
|
+
clearButtonAltText: a = "Clear search",
|
|
13
14
|
onChange: i,
|
|
14
|
-
onClear:
|
|
15
|
-
}) => /* @__PURE__ */
|
|
16
|
-
|
|
15
|
+
onClear: p
|
|
16
|
+
}) => /* @__PURE__ */ m(
|
|
17
|
+
c,
|
|
17
18
|
{
|
|
18
19
|
size: "xs",
|
|
19
20
|
value: r,
|
|
20
21
|
name: o,
|
|
21
22
|
placeholder: t,
|
|
22
|
-
clearButtonAltText:
|
|
23
|
+
clearButtonAltText: a,
|
|
23
24
|
onChange: i,
|
|
24
|
-
onClear:
|
|
25
|
+
onClear: p,
|
|
26
|
+
collapsible: e,
|
|
27
|
+
autoComplete: "off",
|
|
28
|
+
autoCapitalize: "off",
|
|
29
|
+
type: "search"
|
|
25
30
|
}
|
|
26
31
|
);
|
|
27
32
|
export {
|
|
28
|
-
|
|
33
|
+
S as ToolbarSearch
|
|
29
34
|
};
|