@altinn/altinn-components 0.56.32 → 0.56.34
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/ChevronDown-D_a7nb-G.js +24 -0
- package/dist/ChevronUp-hn05LboH.js +24 -0
- package/dist/Plus-Cj3oOc3N.js +24 -0
- package/dist/{SearchField-QTfebYdU.js → SearchField-BU7Imhpe.js} +19 -19
- package/dist/assets/BookmarkSettingsItemLabel.css +1 -0
- package/dist/assets/BulkButton.css +1 -0
- package/dist/assets/BulkFooter.css +1 -0
- package/dist/assets/BulkHeader.css +1 -0
- package/dist/assets/GlobalAccountButton.css +1 -0
- package/dist/assets/GlobalHeader.css +1 -1
- package/dist/assets/GlobalMenuButton.css +1 -1
- package/dist/assets/GlobalMenuButton2.css +1 -1
- package/dist/assets/MenuItem.css +1 -1
- package/dist/assets/QueryLabel.css +1 -1
- package/dist/assets/QueryLabelItem.css +1 -0
- package/dist/components/AccessAreaListItem/AccessAreaListItem.js +1 -1
- package/dist/components/AccessPackageListItem/AccessPackageListItem.js +1 -1
- package/dist/components/Account/AccountList.js +5 -5
- package/dist/components/Account/AccountListItem.js +1 -1
- package/dist/components/Account/AccountListItemControls.js +1 -1
- package/dist/components/Account/AccountListItemDetails.js +1 -1
- package/dist/components/Account/AccountListVirtual.js +1 -1
- package/dist/components/Account/AccountMenu.js +2 -2
- package/dist/components/Account/AccountNotificationSettings.js +3 -3
- package/dist/components/Account/AccountOrganization.js +1 -1
- package/dist/components/{GlobalHeader → AccountSelector}/AccountSelector.js +1 -1
- package/dist/components/AccountSelector/index.js +4 -0
- package/dist/components/ActivityLog/ActivityLog.js +1 -1
- package/dist/components/ActivityLog/ActivityLogItem.js +1 -1
- package/dist/components/ActivityLog/ActivityLogSegment.js +1 -1
- package/dist/components/Article/Article.js +1 -1
- package/dist/components/Article/ArticleContact.js +1 -1
- package/dist/components/Article/ArticleHeader.js +1 -1
- package/dist/components/Banner/Banner.js +1 -1
- package/dist/components/Bookmarks/BookmarkModal.js +5 -5
- package/dist/components/Bookmarks/BookmarkSettingsItem.js +1 -1
- package/dist/components/Bookmarks/BookmarkSettingsItemLabel.js +12 -10
- package/dist/components/Bookmarks/BookmarkSettingsList.js +31 -24
- package/dist/components/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/Bulk/BulkButton.js +15 -0
- package/dist/components/Bulk/BulkFooter.js +10 -0
- package/dist/components/Bulk/BulkHeader.js +38 -0
- package/dist/components/Bulk/index.js +8 -0
- package/dist/components/Button/ButtonIcon.js +1 -1
- package/dist/components/Button/ComboButton.js +1 -1
- package/dist/components/Button/FloatingActionButton.js +1 -1
- package/dist/components/Button/IconButton.js +1 -1
- package/dist/components/Byline/Byline.js +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +4 -4
- package/dist/components/Dashboard/DashboardCard.js +7 -7
- package/dist/components/Dashboard/DashboardHeader.js +7 -7
- package/dist/components/Datepicker/DatepickerHeader.js +1 -1
- package/dist/components/Datepicker/DatepickerTable.js +1 -1
- package/dist/components/Dialog/Dialog.js +1 -1
- package/dist/components/Dialog/DialogActions.js +17 -16
- package/dist/components/Dialog/DialogActivityLog.js +1 -1
- package/dist/components/Dialog/DialogAttachments.js +1 -1
- package/dist/components/Dialog/DialogBody.js +1 -1
- package/dist/components/Dialog/DialogByline.js +1 -1
- package/dist/components/Dialog/DialogContact.js +1 -1
- package/dist/components/Dialog/DialogHeader.js +1 -1
- package/dist/components/Dialog/DialogHistory.js +1 -1
- package/dist/components/Dialog/DialogHistoryItem.js +1 -1
- package/dist/components/Dialog/DialogHistorySegment.js +1 -1
- package/dist/components/Dialog/DialogLayout.js +1 -1
- package/dist/components/Dialog/DialogList.js +1 -1
- package/dist/components/Dialog/DialogListGroup.js +1 -1
- package/dist/components/Dialog/DialogListItem.js +1 -1
- package/dist/components/Dialog/DialogMetadata.js +1 -1
- package/dist/components/Dialog/DialogSection.js +1 -1
- package/dist/components/Dialog/DialogSeenBy.js +1 -1
- package/dist/components/Dialog/DialogSelect.js +1 -1
- package/dist/components/Dialog/DialogStatus.js +1 -1
- package/dist/components/Dialog/DialogTabs.js +2 -2
- package/dist/components/Dialog/SeenByLog.js +1 -1
- package/dist/components/Dialog/SeenByLogButton.js +1 -1
- package/dist/components/Dialog/SeenByLogItem.js +1 -1
- package/dist/components/Dropdown/DrawerButton.js +1 -1
- package/dist/components/Dropdown/DrawerHeader.js +1 -1
- package/dist/components/Dropdown/DrawerOrDropdown.js +1 -1
- package/dist/components/Dropdown/DropdownBase.js +1 -1
- package/dist/components/Dropdown/FloatingDropdown.js +4 -4
- package/dist/components/DsComponents/index.js +1 -1
- package/dist/components/Forms/Checkbox.js +3 -3
- package/dist/components/Forms/CheckboxOptions.js +3 -3
- package/dist/components/Forms/FieldBase.js +7 -7
- package/dist/components/Forms/FieldsetBase.js +3 -3
- package/dist/components/Forms/Radio.js +3 -3
- package/dist/components/Forms/RadioOptions.js +3 -3
- package/dist/components/Forms/SearchField.js +4 -4
- package/dist/components/Forms/SelectField.js +3 -3
- package/dist/components/Forms/Switch.js +3 -3
- package/dist/components/Forms/SwitchOptions.js +3 -3
- package/dist/components/Forms/TextField.js +3 -3
- package/dist/components/Forms/TextFieldDropdown.js +29 -28
- package/dist/components/Forms/TextareaField.js +3 -3
- package/dist/components/Forms/index.js +1 -1
- package/dist/components/GlobalHeader/GlobalAccountButton.js +127 -0
- package/dist/components/GlobalHeader/GlobalHeader.js +40 -41
- package/dist/components/GlobalHeader/GlobalMenuButton.js +26 -26
- package/dist/components/GlobalHeader/HeaderDrawer.js +62 -97
- package/dist/components/GlobalHeader/HeaderDropdown.js +1 -1
- package/dist/components/GlobalHeader/HeaderLogo.js +1 -1
- package/dist/components/GlobalHeader/index.js +4 -2
- package/dist/components/GlobalMenu/GlobalMenu.js +2 -2
- package/dist/components/GlobalMenu/LocaleSwitcher.js +2 -2
- package/dist/components/GlobalMenu/LogoutButton.js +1 -1
- package/dist/components/GlobalMenu_old/BackButton.js +2 -2
- package/dist/components/GlobalMenu_old/CurrentAccount.js +2 -2
- package/dist/components/GlobalMenu_old/GlobalMenu.js +3 -3
- package/dist/components/GlobalMenu_old/GlobalMenuButton.js +2 -2
- package/dist/components/GlobalMenu_old/LogoutButton.js +1 -1
- package/dist/components/Header/Header.js +6 -6
- package/dist/components/Header/HeaderBase.js +1 -1
- package/dist/components/Header/HeaderButton.js +1 -1
- package/dist/components/Header/LocaleButton.js +1 -1
- package/dist/components/Header/LocaleSwitcher.js +1 -1
- package/dist/components/Icon/Icon.js +1 -1
- package/dist/components/InboxSearch/InboxSearch.js +1 -1
- package/dist/components/Item/ItemMedia.js +1 -1
- package/dist/components/Item/ItemSelect.js +12 -0
- package/dist/components/Item/index.js +4 -2
- package/dist/components/Layout/Layout.js +13 -13
- package/dist/components/List/List.js +1 -1
- package/dist/components/List/ListBase.js +1 -1
- package/dist/components/List/ListItemHeader.js +13 -12
- package/dist/components/List/ListItemIcon.js +1 -1
- package/dist/components/List/ListItemLabel.js +1 -1
- package/dist/components/List/ListItemSelect.js +3 -3
- package/dist/components/Menu/Menu.js +1 -1
- package/dist/components/Menu/MenuItem.js +64 -63
- package/dist/components/Menu/MenuItems.js +3 -3
- package/dist/components/Menu/MenuListSearch.js +2 -2
- package/dist/components/Menu/TabMenu.js +2 -2
- package/dist/components/Menu/VirtualizedMenuItems.js +3 -3
- package/dist/components/Menu/index.js +1 -1
- package/dist/components/Metadata/MetaItem.js +1 -1
- package/dist/components/Metadata/MetaItemIcon.js +1 -1
- package/dist/components/Metadata/MetaProgress.js +1 -1
- package/dist/components/Metadata/MetaTimestamp.js +1 -1
- package/dist/components/Metadata/Metadata.js +1 -1
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/ModalBase.js +1 -1
- package/dist/components/Modal/ModalHeader.js +1 -1
- package/dist/components/Modal/ModalIcon.js +1 -1
- package/dist/components/Notifications/NotificationItem.js +1 -1
- package/dist/components/Notifications/NotificationItemBase.js +1 -1
- package/dist/components/Notifications/NotificationItemControls.js +1 -1
- package/dist/components/Notifications/NotificationItemIcon.js +1 -1
- package/dist/components/Page/AccordionSection.js +1 -1
- package/dist/components/Page/ContactButtons.js +1 -1
- package/dist/components/Page/ContactSection.js +1 -1
- package/dist/components/Page/PageMenu.js +1 -1
- package/dist/components/Page/PageNav.js +1 -1
- package/dist/components/Page/Section.js +1 -1
- package/dist/components/ResourceListItem/ResourceListItem.js +1 -1
- package/dist/components/Search/SearchItem.js +1 -1
- package/dist/components/Searchbar/Autocomplete.js +2 -2
- package/dist/components/Searchbar/AutocompleteItem.js +3 -3
- package/dist/components/Searchbar/Searchbar.js +1 -1
- package/dist/components/Searchbar/SearchbarField.js +1 -1
- package/dist/components/Searchbar/index.js +6 -9
- package/dist/components/Settings/SettingsItem.js +2 -2
- package/dist/components/Settings/SettingsItemBase.js +1 -1
- package/dist/components/Settings/SettingsList.js +1 -1
- package/dist/components/Settings/SettingsModal.js +1 -1
- package/dist/components/Settings/SettingsSection.js +1 -1
- package/dist/components/Settings/UsedByLog.js +1 -1
- package/dist/components/Settings/UsedByLogItem.js +1 -1
- package/dist/components/Snackbar/SnackbarItem.js +1 -1
- package/dist/components/Timeline/Timeline.js +1 -1
- package/dist/components/Timeline/TimelineActivity.js +1 -1
- package/dist/components/Timeline/TimelineBase.js +1 -1
- package/dist/components/Timeline/TimelineFooter.js +1 -1
- package/dist/components/Timeline/TimelineHeader.js +1 -1
- package/dist/components/Timeline/TimelineIcon.js +1 -1
- package/dist/components/Timeline/TimelineSection.js +1 -1
- package/dist/components/Timeline/TimelineSegment.js +1 -1
- package/dist/components/Toolbar/DatepickerFilter.js +1 -1
- package/dist/components/Toolbar/QueryLabel.js +13 -0
- package/dist/components/Toolbar/QueryLabelItem.js +7 -0
- package/dist/components/Toolbar/SelectDateFilter.js +2 -2
- package/dist/components/Toolbar/Toolbar.js +1 -1
- package/dist/components/Toolbar/ToolbarFilter.js +1 -1
- package/dist/components/Toolbar/ToolbarFilterAddMenu.js +42 -60
- package/dist/components/Toolbar/ToolbarFilterButton.js +1 -1
- package/dist/components/Toolbar/ToolbarFilterMenu.js +2 -2
- package/dist/components/Toolbar/ToolbarMenu.js +25 -24
- package/dist/components/Toolbar/ToolbarSearch.js +2 -2
- package/dist/components/Toolbar/example.data.js +16 -7
- package/dist/components/Toolbar/index.js +10 -6
- package/dist/components/Transmission/Transmission.js +1 -1
- package/dist/components/Transmission/TransmissionList.js +1 -1
- package/dist/components/Transmission/TransmissionType.js +1 -1
- package/dist/components/Typography/Heading.js +1 -1
- package/dist/components/UserListItem/UserListItem.js +1 -1
- package/dist/components/index.js +468 -457
- package/dist/hooks/useAccountSelector.js +152 -126
- package/dist/index.js +486 -475
- package/dist/textfield-CRXtg-r5.js +3487 -0
- package/dist/types/lib/components/Account/Account.stories.d.ts +6 -1
- package/dist/types/lib/components/Account/AccountList.stories.d.ts +3 -1
- package/dist/types/lib/components/AccountSelector/index.d.ts +1 -0
- package/dist/types/lib/components/Bookmarks/Bookmark.stories.d.ts +11 -0
- package/dist/types/lib/components/Bookmarks/BookmarkSettingsItem.d.ts +2 -0
- package/dist/types/lib/components/Bookmarks/BookmarkSettingsList.d.ts +2 -1
- package/dist/types/lib/components/Bookmarks/BookmarkSettingsList.stories.d.ts +2 -2
- package/dist/types/lib/components/Bulk/Bulk.stories.d.ts +13 -0
- package/dist/types/lib/components/Bulk/BulkButton.d.ts +8 -0
- package/dist/types/lib/components/Bulk/BulkFooter.d.ts +8 -0
- package/dist/types/lib/components/Bulk/BulkHeader.d.ts +12 -0
- package/dist/types/lib/components/Bulk/index.d.ts +3 -0
- package/dist/types/lib/components/GlobalHeader/{AccountSelectorButton.d.ts → GlobalAccountButton.d.ts} +2 -2
- package/dist/types/lib/components/GlobalHeader/{AccountSelectorButton.stories.d.ts → GlobalAccountButton.stories.d.ts} +1 -1
- package/dist/types/lib/components/GlobalHeader/GlobalHeader.d.ts +1 -1
- package/dist/types/lib/components/GlobalHeader/index.d.ts +1 -0
- package/dist/types/lib/components/Item/ItemSelect.d.ts +8 -0
- package/dist/types/lib/components/Item/index.d.ts +1 -0
- package/dist/types/lib/components/Searchbar/index.d.ts +0 -1
- package/dist/types/lib/components/Toolbar/QueryLabel.d.ts +9 -0
- package/dist/types/lib/components/Toolbar/QueryLabelItem.d.ts +13 -0
- package/dist/types/lib/components/Toolbar/ToolbarMenu.d.ts +3 -1
- package/dist/types/lib/components/Toolbar/example.hooks.d.ts +12 -2
- package/dist/types/lib/components/Toolbar/index.d.ts +2 -0
- package/dist/types/lib/components/index.d.ts +3 -1
- package/dist/types/lib/hooks/useAccountSelector.d.ts +1 -1
- package/dist/types/lib/stories/Color.stories.d.ts +20 -0
- package/package.json +2 -2
- package/dist/ChevronUp-_BBfEirx.js +0 -43
- package/dist/assets/AccountSelectorButton.css +0 -1
- package/dist/assets/ActionFooter.css +0 -1
- package/dist/assets/ActionHeader.css +0 -1
- package/dist/components/GlobalHeader/AccountSelectorButton.js +0 -127
- package/dist/components/LayoutAction/ActionFooter.js +0 -7
- package/dist/components/LayoutAction/ActionHeader.js +0 -38
- package/dist/components/LayoutAction/LayoutAction.js +0 -38
- package/dist/components/LayoutAction/index.js +0 -8
- package/dist/components/Searchbar/QueryLabel.js +0 -14
- package/dist/textfield-DP1SL4Wr.js +0 -3406
- package/dist/types/lib/components/GlobalMenu_old/GlobalMenu.stories.d.ts +0 -30
- package/dist/types/lib/components/GlobalMenu_old/GlobalMenuButton.stories.d.ts +0 -19
- package/dist/types/lib/components/LayoutAction/ActionFooter.d.ts +0 -6
- package/dist/types/lib/components/LayoutAction/ActionHeader.d.ts +0 -11
- package/dist/types/lib/components/LayoutAction/LayoutAction.d.ts +0 -15
- package/dist/types/lib/components/LayoutAction/LayoutAction.stories.d.ts +0 -5
- package/dist/types/lib/components/LayoutAction/index.d.ts +0 -3
- package/dist/types/lib/components/Searchbar/QueryLabel.d.ts +0 -14
- /package/dist/types/lib/components/{GlobalHeader → AccountSelector}/AccountSelector.d.ts +0 -0
- /package/dist/types/lib/components/{GlobalHeader → AccountSelector}/AccountSelector.stories.d.ts +0 -0
|
@@ -1,126 +1,138 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as
|
|
1
|
+
import { jsx as S } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as x, useMemo as z } from "react";
|
|
3
3
|
import "../index-p1eeF8LQ.js";
|
|
4
|
+
import "../components/RootProvider/RootProvider.js";
|
|
4
5
|
import { Button as G } from "../components/Button/Button.js";
|
|
5
6
|
import "react-dom";
|
|
6
|
-
import "
|
|
7
|
-
import { useIsDesktop as W } from "./useIsDesktop.js";
|
|
7
|
+
import { useIsDesktop as Y } from "./useIsDesktop.js";
|
|
8
8
|
import "../components/Snackbar/useSnackbar.js";
|
|
9
|
-
import { formatDisplayName as
|
|
10
|
-
import { formatDate as
|
|
11
|
-
import { formatOrgNo as
|
|
12
|
-
import { S as
|
|
13
|
-
const
|
|
9
|
+
import { formatDisplayName as R } from "../functions/name/name.js";
|
|
10
|
+
import { formatDate as q } from "../functions/date/date.js";
|
|
11
|
+
import { formatOrgNo as j } from "../functions/orgno/orgno.js";
|
|
12
|
+
import { S as J, a as K } from "../HeartFill-CYSrJ_xK.js";
|
|
13
|
+
const H = (o) => o === "Organization" ? "company" : "person", ut = ({
|
|
14
14
|
partyListDTO: o = [],
|
|
15
15
|
favoriteAccountUuids: e,
|
|
16
|
-
currentAccountUuid:
|
|
17
|
-
selfAccountUuid:
|
|
18
|
-
isLoading:
|
|
19
|
-
onSelectAccount:
|
|
20
|
-
virtualized:
|
|
21
|
-
onToggleFavorite:
|
|
22
|
-
languageCode:
|
|
23
|
-
showDeletedUnits:
|
|
24
|
-
onShowDeletedUnitsChange:
|
|
16
|
+
currentAccountUuid: f,
|
|
17
|
+
selfAccountUuid: d,
|
|
18
|
+
isLoading: m = !1,
|
|
19
|
+
onSelectAccount: N,
|
|
20
|
+
virtualized: p = !1,
|
|
21
|
+
onToggleFavorite: h,
|
|
22
|
+
languageCode: n,
|
|
23
|
+
showDeletedUnits: i,
|
|
24
|
+
onShowDeletedUnitsChange: _
|
|
25
25
|
}) => {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
const v = Y(), c = x(h);
|
|
27
|
+
c.current = h;
|
|
28
|
+
const g = x(f);
|
|
29
|
+
g.current = f;
|
|
30
|
+
const y = z(() => {
|
|
31
|
+
if (!o || o.length === 0) return [];
|
|
32
|
+
const a = n || "nb", s = (r, l) => r.name.localeCompare(l.name, a, {
|
|
33
|
+
sensitivity: "base",
|
|
34
|
+
ignorePunctuation: !0
|
|
35
|
+
});
|
|
36
|
+
return [...o].sort(s);
|
|
37
|
+
}, [o, n]), [O, V] = z(() => {
|
|
38
|
+
if (m || !y.length || !d)
|
|
39
|
+
return [
|
|
40
|
+
{ selfAccountItem: void 0, peopleAccountItems: [], organizationAccountItems: [], favoriteAccountItems: [] },
|
|
41
|
+
{}
|
|
42
|
+
];
|
|
43
|
+
const a = new Set(e), s = (t) => a.has(t), r = (t) => !t.isDeleted || i !== !1 || t.partyUuid === g.current, l = M(n), I = n || "nb", w = (t, u) => t.name.localeCompare(u.name, I, {
|
|
30
44
|
sensitivity: "base",
|
|
31
45
|
ignorePunctuation: !0
|
|
32
|
-
})
|
|
33
|
-
let
|
|
34
|
-
const
|
|
35
|
-
for (const t of
|
|
36
|
-
if (
|
|
37
|
-
if (t.partyUuid ===
|
|
38
|
-
|
|
39
|
-
|
|
46
|
+
});
|
|
47
|
+
let B;
|
|
48
|
+
const k = [], A = [], U = [];
|
|
49
|
+
for (const t of y)
|
|
50
|
+
if (X(t.type)) {
|
|
51
|
+
if (t.partyUuid === d)
|
|
52
|
+
B = F(
|
|
53
|
+
n,
|
|
40
54
|
t,
|
|
41
55
|
"favorites",
|
|
42
|
-
c,
|
|
43
56
|
!1,
|
|
44
|
-
|
|
45
|
-
|
|
57
|
+
c,
|
|
58
|
+
v,
|
|
46
59
|
void 0,
|
|
47
60
|
!0
|
|
48
61
|
);
|
|
49
|
-
else if (
|
|
50
|
-
const u =
|
|
51
|
-
|
|
62
|
+
else if (r(t) || s(t.partyUuid)) {
|
|
63
|
+
const u = F(
|
|
64
|
+
n,
|
|
52
65
|
t,
|
|
53
66
|
t.partyUuid,
|
|
54
|
-
c,
|
|
55
67
|
s(t.partyUuid),
|
|
56
|
-
|
|
57
|
-
|
|
68
|
+
c,
|
|
69
|
+
v
|
|
58
70
|
);
|
|
59
|
-
|
|
71
|
+
k.push(u), s(t.partyUuid) && U.push({ ...u, groupId: "favorites" });
|
|
60
72
|
}
|
|
61
|
-
} else if (
|
|
62
|
-
if (
|
|
63
|
-
const u =
|
|
64
|
-
|
|
73
|
+
} else if (T(t.type)) {
|
|
74
|
+
if (r(t) || s(t.partyUuid)) {
|
|
75
|
+
const u = F(
|
|
76
|
+
n,
|
|
65
77
|
t,
|
|
66
78
|
t.partyUuid,
|
|
67
|
-
c,
|
|
68
79
|
s(t.partyUuid),
|
|
69
|
-
|
|
70
|
-
|
|
80
|
+
c,
|
|
81
|
+
v
|
|
71
82
|
);
|
|
72
|
-
|
|
83
|
+
r(t) && A.push(u), s(t.partyUuid) && U.push({ ...u, groupId: "favorites" });
|
|
73
84
|
}
|
|
74
85
|
if (t.subunits && t.subunits.length > 0) {
|
|
75
|
-
const u = [...t.subunits].sort(
|
|
76
|
-
for (const
|
|
77
|
-
if (
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
86
|
+
const u = [...t.subunits].sort(w);
|
|
87
|
+
for (const b of u)
|
|
88
|
+
if (r(b) || s(b.partyUuid)) {
|
|
89
|
+
const D = F(
|
|
90
|
+
n,
|
|
91
|
+
b,
|
|
81
92
|
t.partyUuid,
|
|
93
|
+
s(b.partyUuid),
|
|
82
94
|
c,
|
|
83
|
-
|
|
84
|
-
r,
|
|
85
|
-
a,
|
|
95
|
+
v,
|
|
86
96
|
t
|
|
87
97
|
);
|
|
88
|
-
|
|
89
|
-
|
|
98
|
+
r(b) && A.push(D), s(b.partyUuid) && U.push({
|
|
99
|
+
...D,
|
|
90
100
|
groupId: "favorites"
|
|
91
101
|
});
|
|
92
102
|
}
|
|
93
103
|
}
|
|
94
104
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
[y[0]?.groupId || "company"]: {
|
|
99
|
-
title: N.account_orgs,
|
|
105
|
+
const E = {
|
|
106
|
+
[A[0]?.groupId || "company"]: {
|
|
107
|
+
title: l.account_orgs,
|
|
100
108
|
divider: !0
|
|
101
109
|
},
|
|
102
|
-
[
|
|
103
|
-
title:
|
|
110
|
+
[k[0]?.groupId || "person"]: {
|
|
111
|
+
title: l.account_persons,
|
|
104
112
|
divider: !0
|
|
105
113
|
},
|
|
106
114
|
favorites: {
|
|
107
|
-
title:
|
|
115
|
+
title: l.account_favorites,
|
|
108
116
|
divider: !0
|
|
109
117
|
}
|
|
110
118
|
};
|
|
111
|
-
return [A,
|
|
112
|
-
}, [
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
119
|
+
return [{ selfAccountItem: B, peopleAccountItems: k, organizationAccountItems: A, favoriteAccountItems: U }, E];
|
|
120
|
+
}, [y, d, e, m, n, v, i]), P = z(() => {
|
|
121
|
+
const { selfAccountItem: a, peopleAccountItems: s, organizationAccountItems: r, favoriteAccountItems: l } = O;
|
|
122
|
+
return a ? [a, ...l, ...s, ...r] : [];
|
|
123
|
+
}, [O]), [W, $] = z(() => {
|
|
124
|
+
if (P.length === 0)
|
|
125
|
+
return [[], void 0];
|
|
126
|
+
let a;
|
|
127
|
+
return [P.map((r) => {
|
|
128
|
+
if (f === r.id) {
|
|
129
|
+
const I = { ...r, selected: !0 };
|
|
130
|
+
return a = I, I;
|
|
131
|
+
}
|
|
132
|
+
return r.selected ? { ...r, selected: !1 } : r;
|
|
133
|
+
}), a];
|
|
134
|
+
}, [P, f]);
|
|
135
|
+
return m || !o || !$ ? {
|
|
124
136
|
accountMenu: {
|
|
125
137
|
items: [],
|
|
126
138
|
groups: {},
|
|
@@ -129,74 +141,88 @@ const D = (o) => o === "Organization" ? "company" : "person", st = ({
|
|
|
129
141
|
},
|
|
130
142
|
currentAccount: void 0
|
|
131
143
|
},
|
|
132
|
-
loading:
|
|
144
|
+
loading: m
|
|
133
145
|
} : {
|
|
134
146
|
accountMenu: {
|
|
135
|
-
items:
|
|
136
|
-
groups:
|
|
137
|
-
virtualized:
|
|
138
|
-
onSelectAccount:
|
|
139
|
-
currentAccount:
|
|
147
|
+
items: W,
|
|
148
|
+
groups: V,
|
|
149
|
+
virtualized: p,
|
|
150
|
+
onSelectAccount: N,
|
|
151
|
+
currentAccount: $
|
|
140
152
|
},
|
|
141
153
|
loading: !1,
|
|
142
|
-
showDeletedUnits:
|
|
143
|
-
onShowDeletedUnitsChange:
|
|
154
|
+
showDeletedUnits: i,
|
|
155
|
+
onShowDeletedUnitsChange: _
|
|
144
156
|
};
|
|
145
|
-
},
|
|
146
|
-
|
|
157
|
+
}, Q = ({
|
|
158
|
+
partyUuid: o,
|
|
159
|
+
isFavorite: e,
|
|
160
|
+
toggleFavoriteRef: f,
|
|
161
|
+
texts: d
|
|
162
|
+
}) => /* @__PURE__ */ S(
|
|
163
|
+
G,
|
|
164
|
+
{
|
|
165
|
+
rounded: !0,
|
|
166
|
+
variant: "ghost",
|
|
167
|
+
"aria-label": e ? d.remove_from_favorites : d.add_to_favorites,
|
|
168
|
+
onClick: (m) => {
|
|
169
|
+
m.stopPropagation(), f?.current?.(o);
|
|
170
|
+
},
|
|
171
|
+
size: "xs",
|
|
172
|
+
children: e ? /* @__PURE__ */ S(J, {}) : /* @__PURE__ */ S(K, {})
|
|
173
|
+
}
|
|
174
|
+
), F = (o, e, f, d, m, N, p, h) => {
|
|
175
|
+
const n = H(e?.type ?? ""), i = M(o), _ = R({
|
|
147
176
|
fullName: e?.name,
|
|
148
|
-
type:
|
|
149
|
-
}),
|
|
150
|
-
fullName:
|
|
151
|
-
type:
|
|
177
|
+
type: n
|
|
178
|
+
}), v = p ? R({
|
|
179
|
+
fullName: p?.name,
|
|
180
|
+
type: H(p?.type ?? ""),
|
|
152
181
|
reverseNameOrder: !1
|
|
153
182
|
}) : void 0;
|
|
154
|
-
let
|
|
155
|
-
const
|
|
156
|
-
switch (
|
|
183
|
+
let c = "";
|
|
184
|
+
const g = n === "company" && p ? "subunit" : n;
|
|
185
|
+
switch (g) {
|
|
157
186
|
case "company":
|
|
158
|
-
|
|
187
|
+
c = `${i.org_no}. ${j(e.organizationNumber)}`;
|
|
159
188
|
break;
|
|
160
189
|
case "person":
|
|
161
|
-
|
|
190
|
+
c = e?.dateOfBirth ? `${i.birthdate}: ${q(e?.dateOfBirth)}` : "";
|
|
162
191
|
break;
|
|
163
192
|
case "subunit":
|
|
164
|
-
|
|
193
|
+
c = `↳ ${i.org_no}. ${j(e?.organizationNumber)}, ${i.subunit_of} ${v}`;
|
|
165
194
|
break;
|
|
166
195
|
default:
|
|
167
|
-
|
|
196
|
+
c = "";
|
|
168
197
|
}
|
|
198
|
+
const y = h ? void 0 : /* @__PURE__ */ S(
|
|
199
|
+
Q,
|
|
200
|
+
{
|
|
201
|
+
partyUuid: e?.partyUuid,
|
|
202
|
+
isFavorite: d,
|
|
203
|
+
toggleFavoriteRef: m,
|
|
204
|
+
texts: i
|
|
205
|
+
}
|
|
206
|
+
);
|
|
169
207
|
return {
|
|
170
208
|
id: e?.partyUuid,
|
|
171
209
|
icon: {
|
|
172
|
-
name:
|
|
173
|
-
type:
|
|
174
|
-
isParent: !
|
|
210
|
+
name: _,
|
|
211
|
+
type: n,
|
|
212
|
+
isParent: !p,
|
|
175
213
|
isDeleted: e?.isDeleted
|
|
176
214
|
},
|
|
177
|
-
name:
|
|
178
|
-
description:
|
|
179
|
-
searchWords:
|
|
180
|
-
groupId:
|
|
181
|
-
type:
|
|
182
|
-
selected:
|
|
215
|
+
name: _,
|
|
216
|
+
description: c,
|
|
217
|
+
searchWords: g === "person" ? [_, e?.dateOfBirth ?? ""] : [_, e?.organizationNumber ?? ""],
|
|
218
|
+
groupId: f,
|
|
219
|
+
type: g,
|
|
220
|
+
selected: !1,
|
|
183
221
|
disabled: !!e?.onlyHierarchyElementWithNoAccess,
|
|
184
|
-
badge:
|
|
185
|
-
controls:
|
|
186
|
-
G,
|
|
187
|
-
{
|
|
188
|
-
rounded: !0,
|
|
189
|
-
variant: "ghost",
|
|
190
|
-
"aria-label": d ? n.remove_from_favorites : n.add_to_favorites,
|
|
191
|
-
onClick: (s) => {
|
|
192
|
-
b && (s.stopPropagation(), b(e?.partyUuid));
|
|
193
|
-
},
|
|
194
|
-
size: "xs",
|
|
195
|
-
children: d ? /* @__PURE__ */ U(R, {}) : /* @__PURE__ */ U(Y, {})
|
|
196
|
-
}
|
|
197
|
-
)
|
|
222
|
+
badge: h ? { label: i.you, color: "person" } : e.isDeleted && N ? { label: i.deleted, color: "neutral" } : void 0,
|
|
223
|
+
controls: y
|
|
198
224
|
};
|
|
199
|
-
},
|
|
225
|
+
}, T = (o) => o === "Organization", X = (o) => o === "Person" || o === "SelfIdentified", M = (o) => {
|
|
200
226
|
switch (o) {
|
|
201
227
|
case "nn":
|
|
202
228
|
return {
|
|
@@ -240,5 +266,5 @@ const D = (o) => o === "Organization" ? "company" : "person", st = ({
|
|
|
240
266
|
}
|
|
241
267
|
};
|
|
242
268
|
export {
|
|
243
|
-
|
|
269
|
+
ut as useAccountSelector
|
|
244
270
|
};
|