@altinn/altinn-components 0.68.9 → 0.68.15
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/{ToolbarSearch-BtCd0Qph.js → ToolbarSearch-BWqWKrm-.js} +1 -1
- package/dist/components/AccessAreaListItem/AccessAreaListItem.js +1 -1
- package/dist/components/AccessPackageListItem/AccessPackageListItem.js +14 -15
- package/dist/components/Account/AccountList.js +1 -1
- 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 +1 -1
- package/dist/components/Account/AccountNotificationSettings.js +1 -1
- package/dist/components/Account/AccountOrganization.js +1 -1
- package/dist/components/AccountSelector/AccountSelector.js +1 -1
- 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/Alert/Alert.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/Attachment/AttachmentLink.js +1 -1
- package/dist/components/AuthEvidence/AuthEvidence.js +1 -1
- package/dist/components/AuthEvidence/AuthEvidenceItem.js +1 -1
- package/dist/components/AuthEvidence/AuthEvidenceOwner.js +1 -1
- package/dist/components/AuthEvidence/AuthEvidenceParent.js +1 -1
- package/dist/components/AuthEvidence/AuthEvidenceService.js +1 -1
- package/dist/components/Badge/Badge.js +1 -1
- package/dist/components/Badge/index.js +1 -1
- package/dist/components/Banner/Banner.js +1 -1
- package/dist/components/Bookmarks/BookmarkModal.js +1 -1
- package/dist/components/Bookmarks/BookmarkSettingsItem.js +1 -1
- package/dist/components/Bookmarks/BookmarkSettingsItemLabel.js +1 -1
- package/dist/components/Bookmarks/BookmarkSettingsList.js +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/Bulk/BulkHeader.js +1 -1
- 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/Byline/index.js +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +1 -1
- package/dist/components/Dashboard/DashboardCard.js +1 -1
- package/dist/components/Dashboard/DashboardHeader.js +1 -1
- package/dist/components/Datepicker/Datepicker.js +1 -1
- 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 +1 -1
- 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/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 +1 -1
- 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/Dialog/index.js +1 -1
- package/dist/components/Dropdown/DrawerButton.js +1 -1
- package/dist/components/Dropdown/DrawerHeader.js +1 -1
- package/dist/components/Dropdown/Dropdown.js +1 -1
- package/dist/components/Dropdown/DropdownBase.js +1 -1
- package/dist/components/Dropdown/FloatingDropdown.js +1 -1
- package/dist/components/Dropdown/index.js +1 -1
- package/dist/components/Forms/Checkbox.js +1 -1
- package/dist/components/Forms/CheckboxOptions.js +1 -1
- package/dist/components/Forms/FieldBase.js +1 -1
- package/dist/components/Forms/FieldsetBase.js +1 -1
- package/dist/components/Forms/Radio.js +1 -1
- package/dist/components/Forms/RadioOptions.js +1 -1
- package/dist/components/Forms/SearchField.js +1 -1
- package/dist/components/Forms/SelectField.js +1 -1
- package/dist/components/Forms/Switch.js +1 -1
- package/dist/components/Forms/SwitchOptions.js +1 -1
- package/dist/components/Forms/TextField.js +1 -1
- package/dist/components/Forms/TextFieldDropdown.js +1 -1
- package/dist/components/Forms/TextareaField.js +1 -1
- package/dist/components/Forms/index.js +1 -1
- package/dist/components/GlobalHeader/GlobalAccountButton.js +1 -1
- package/dist/components/GlobalHeader/GlobalHeader.js +1 -1
- package/dist/components/GlobalHeader/GlobalMenuButton.js +1 -1
- package/dist/components/GlobalHeader/HeaderDrawer.js +1 -1
- package/dist/components/GlobalHeader/HeaderDropdown.js +1 -1
- package/dist/components/GlobalHeader/HeaderLogo.js +1 -1
- package/dist/components/GlobalMenu/GlobalMenu.js +1 -1
- package/dist/components/GlobalMenu/LocaleSwitcher.js +1 -1
- package/dist/components/GlobalMenu/LogoutButton.js +1 -1
- package/dist/components/Icon/Icon.js +1 -1
- package/dist/components/Icon/index.js +1 -1
- package/dist/components/Inbox/InboxPage.js +1 -1
- package/dist/components/InboxSearch/InboxSearch.js +1 -1
- package/dist/components/Item/ItemLabel.js +1 -1
- package/dist/components/Item/ItemMedia.js +1 -1
- package/dist/components/Item/ItemSelect.js +1 -1
- package/dist/components/Item/index.js +1 -1
- package/dist/components/Layout/Layout.js +1 -1
- package/dist/components/List/List.js +1 -1
- package/dist/components/List/ListBase.js +1 -1
- package/dist/components/List/ListItemHeader.js +1 -1
- package/dist/components/List/ListItemIcon.js +1 -1
- package/dist/components/List/ListItemLabel.js +1 -1
- package/dist/components/Menu/Menu.js +1 -1
- package/dist/components/Menu/MenuItem.js +1 -1
- package/dist/components/Menu/MenuItems.js +1 -1
- package/dist/components/Menu/MenuListSearch.js +1 -1
- package/dist/components/Menu/MenuOption.js +1 -1
- package/dist/components/Menu/TabMenu.js +1 -1
- package/dist/components/Menu/VirtualizedMenuItems.js +1 -1
- package/dist/components/Menu/index.js +1 -1
- package/dist/components/Menu/useMenuSearch.js +1 -1
- package/dist/components/Metadata/MetaItem.js +1 -1
- package/dist/components/Metadata/MetaItemIcon.js +1 -1
- package/dist/components/Metadata/MetaTimestamp.js +1 -1
- package/dist/components/Metadata/Metadata.js +1 -1
- package/dist/components/Metadata/index.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/Pagination/Pagination.js +1 -1
- package/dist/components/ResourceListItem/ResourceListItem.js +1 -1
- package/dist/components/RootProvider/RootProvider.js +1 -1
- package/dist/components/RootProvider/index.js +1 -1
- package/dist/components/Search/SearchItem.js +1 -1
- package/dist/components/Searchbar/Autocomplete.js +1 -1
- package/dist/components/Searchbar/AutocompleteItem.js +1 -1
- package/dist/components/Searchbar/Searchbar.js +1 -1
- package/dist/components/Searchbar/SearchbarField.js +1 -1
- package/dist/components/Settings/SettingsItem.js +1 -1
- package/dist/components/Settings/SettingsItemBase.js +1 -1
- package/dist/components/Settings/SettingsList.js +1 -1
- package/dist/components/Settings/SettingsListVirtual.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/Snackbar.js +1 -1
- package/dist/components/Snackbar/SnackbarItem.js +1 -1
- package/dist/components/Snackbar/index.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/SelectDateFilter.js +1 -1
- package/dist/components/Toolbar/Toolbar.js +1 -1
- package/dist/components/Toolbar/ToolbarFilter.js +1 -1
- package/dist/components/Toolbar/ToolbarFilterAddMenu.js +1 -1
- package/dist/components/Toolbar/ToolbarFilterButton.js +1 -1
- package/dist/components/Toolbar/ToolbarFilterMenu.js +1 -1
- package/dist/components/Toolbar/ToolbarMenu.js +1 -1
- package/dist/components/Toolbar/ToolbarSearch.js +1 -1
- package/dist/components/Toolbar/index.js +1 -1
- 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/Typography/index.js +1 -1
- package/dist/components/UserListItem/UserListItem.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/hooks/useAccountSelector.js +119 -121
- package/dist/index.js +1 -1
- package/dist/types/lib/hooks/useAccountSelector.d.ts +5 -1
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as t, jsxs as r, Fragment as g } from "react/jsx-runtime";
|
|
3
3
|
import { useState as _ } from "react";
|
|
4
|
-
import { B as v } from "../../ToolbarSearch-
|
|
4
|
+
import { B as v } from "../../ToolbarSearch-BWqWKrm-.js";
|
|
5
5
|
import "../../index-p1eeF8LQ.js";
|
|
6
6
|
import { AttachmentList as L } from "../Attachment/AttachmentList.js";
|
|
7
7
|
import "../../tooltip-Caqi75cv.js";
|
|
@@ -2,7 +2,7 @@ import { jsx as i, jsxs as s } from "react/jsx-runtime";
|
|
|
2
2
|
import { createElement as l } from "react";
|
|
3
3
|
import "../../index-p1eeF8LQ.js";
|
|
4
4
|
import "../../tooltip-Caqi75cv.js";
|
|
5
|
-
import { a } from "../../ToolbarSearch-
|
|
5
|
+
import { a } from "../../ToolbarSearch-BWqWKrm-.js";
|
|
6
6
|
import "../Typography/Link.js";
|
|
7
7
|
import "../Button/Button.js";
|
|
8
8
|
import "react-dom";
|
|
@@ -3,7 +3,7 @@ import "../../index-p1eeF8LQ.js";
|
|
|
3
3
|
import "react";
|
|
4
4
|
import "../Skeleton/Skeleton.js";
|
|
5
5
|
import "../../tooltip-Caqi75cv.js";
|
|
6
|
-
import { H as s } from "../../ToolbarSearch-
|
|
6
|
+
import { H as s } from "../../ToolbarSearch-BWqWKrm-.js";
|
|
7
7
|
import "./useHighlightedText.js";
|
|
8
8
|
import "./Link.js";
|
|
9
9
|
import "../Button/Button.js";
|
package/dist/components/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import { AccountNotificationSettings as A } from "./Account/AccountNotificationS
|
|
|
11
11
|
import { AccountOrganization as y } from "./Account/AccountOrganization.js";
|
|
12
12
|
import { AccountSelector as k } from "./AccountSelector/AccountSelector.js";
|
|
13
13
|
import { Alert as v } from "./Alert/Alert.js";
|
|
14
|
-
import { B as P, a as C, D as H, b as w, c as E, d as G, e as O, f as R, g as N, F as V, H as z, I as U, h as j, i as Q, M as q, j as J, k as K, l as W, m as X, n as Y, R as Z, S as _, o as $, p as oo, q as ro, T as eo, w as to, V as mo, x as ao, z as po } from "../ToolbarSearch-
|
|
14
|
+
import { B as P, a as C, D as H, b as w, c as E, d as G, e as O, f as R, g as N, F as V, H as z, I as U, h as j, i as Q, M as q, j as J, k as K, l as W, m as X, n as Y, R as Z, S as _, o as $, p as oo, q as ro, T as eo, w as to, V as mo, x as ao, z as po } from "../ToolbarSearch-BWqWKrm-.js";
|
|
15
15
|
import { Banner as xo, BannerColorEnum as fo, BannerVariantEnum as so } from "./Banner/Banner.js";
|
|
16
16
|
import { BookmarkSettingsItem as lo } from "./Bookmarks/BookmarkSettingsItem.js";
|
|
17
17
|
import { BookmarkSettingsList as uo } from "./Bookmarks/BookmarkSettingsList.js";
|
|
@@ -1,147 +1,145 @@
|
|
|
1
1
|
import { jsx as F } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as
|
|
2
|
+
import { useRef as O, useMemo as v } from "react";
|
|
3
3
|
import "../index-p1eeF8LQ.js";
|
|
4
4
|
import "../tooltip-Caqi75cv.js";
|
|
5
|
-
import "../ToolbarSearch-
|
|
5
|
+
import "../ToolbarSearch-BWqWKrm-.js";
|
|
6
6
|
import "../components/Typography/Link.js";
|
|
7
|
-
import { Button as
|
|
7
|
+
import { Button as Q } from "../components/Button/Button.js";
|
|
8
8
|
import "react-dom";
|
|
9
|
-
import { useIsDesktop as
|
|
9
|
+
import { useIsDesktop as X } from "./useIsDesktop.js";
|
|
10
10
|
import "../components/GlobalMenu/GlobalMenuBase.js";
|
|
11
11
|
import "../components/Snackbar/useSnackbar.js";
|
|
12
|
-
import { formatDisplayName as
|
|
13
|
-
import { formatDate as
|
|
14
|
-
import { formatOrgNo as
|
|
15
|
-
import { a as
|
|
16
|
-
const
|
|
12
|
+
import { formatDisplayName as R } from "../functions/name/name.js";
|
|
13
|
+
import { formatDate as Z } from "../functions/date/date.js";
|
|
14
|
+
import { formatOrgNo as H } from "../functions/orgno/orgno.js";
|
|
15
|
+
import { a as C, S as T } from "../HeartFill-CbQmSZr5.js";
|
|
16
|
+
const V = (e) => e === "Organization" ? "company" : "person", W = /* @__PURE__ */ new Map(), E = (e) => {
|
|
17
|
+
const o = e || "nb";
|
|
18
|
+
let i = W.get(o);
|
|
19
|
+
return i || (i = new Intl.Collator(o, { sensitivity: "base", ignorePunctuation: !0 }), W.set(o, i)), i;
|
|
20
|
+
}, _t = ({
|
|
17
21
|
partyListDTO: e = [],
|
|
18
22
|
favoriteAccountUuids: o,
|
|
19
|
-
currentAccountUuid:
|
|
20
|
-
selfAccountUuid:
|
|
21
|
-
isLoading:
|
|
23
|
+
currentAccountUuid: i,
|
|
24
|
+
selfAccountUuid: l,
|
|
25
|
+
isLoading: d = !1,
|
|
22
26
|
onSelectAccount: N,
|
|
23
|
-
virtualized:
|
|
24
|
-
onToggleFavorite:
|
|
25
|
-
languageCode:
|
|
26
|
-
showDeletedUnits:
|
|
27
|
+
virtualized: m = !1,
|
|
28
|
+
onToggleFavorite: h,
|
|
29
|
+
languageCode: n,
|
|
30
|
+
showDeletedUnits: a,
|
|
27
31
|
onShowDeletedUnitsChange: g
|
|
28
32
|
}) => {
|
|
29
|
-
const
|
|
30
|
-
u.current =
|
|
31
|
-
const _ =
|
|
32
|
-
_.current =
|
|
33
|
-
const
|
|
33
|
+
const p = X(), u = O(h);
|
|
34
|
+
u.current = h;
|
|
35
|
+
const _ = O(i);
|
|
36
|
+
_.current = i;
|
|
37
|
+
const I = v(() => {
|
|
34
38
|
if (!e || e.length === 0) return [];
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return [...e].sort(r);
|
|
40
|
-
}, [e, s]), $ = h(
|
|
41
|
-
() => e.some((i) => i.isDeleted || i.subunits?.some((r) => r.isDeleted)),
|
|
39
|
+
const r = E(n);
|
|
40
|
+
return [...e].sort((s, c) => r.compare(s.name, c.name));
|
|
41
|
+
}, [e, n]), D = v(
|
|
42
|
+
() => e.some((r) => r.isDeleted || r.subunits?.some((s) => s.isDeleted)),
|
|
42
43
|
[e]
|
|
43
|
-
),
|
|
44
|
-
() => e.reduce((
|
|
44
|
+
), K = v(
|
|
45
|
+
() => e.reduce((r, s) => r + 1 + (s.subunits?.length ?? 0), 0),
|
|
45
46
|
[e]
|
|
46
|
-
), [
|
|
47
|
-
if (
|
|
47
|
+
), P = o?.join(",") ?? "", B = v(() => new Set(P ? P.split(",") : []), [P]), [w, Y] = v(() => {
|
|
48
|
+
if (d || !I.length || !l)
|
|
48
49
|
return [
|
|
49
50
|
{ selfAccountItem: void 0, peopleAccountItems: [], organizationAccountItems: [], favoriteAccountItems: [] },
|
|
50
51
|
{}
|
|
51
52
|
];
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
if (t.partyUuid === d)
|
|
61
|
-
x = z(
|
|
62
|
-
s,
|
|
53
|
+
const r = (t) => B.has(t), s = (t) => !t.isDeleted || a !== !1 || t.partyUuid === _.current, c = G(n), y = E(n), A = (t, f) => y.compare(t.name, f.name);
|
|
54
|
+
let j;
|
|
55
|
+
const $ = [], U = [], S = [];
|
|
56
|
+
for (const t of I)
|
|
57
|
+
if (et(t.type)) {
|
|
58
|
+
if (t.partyUuid === l)
|
|
59
|
+
j = z(
|
|
60
|
+
n,
|
|
63
61
|
t,
|
|
64
62
|
"favorites",
|
|
65
63
|
!1,
|
|
66
64
|
u,
|
|
67
|
-
|
|
65
|
+
p,
|
|
68
66
|
void 0,
|
|
69
67
|
!0
|
|
70
68
|
);
|
|
71
|
-
else if (
|
|
72
|
-
const
|
|
73
|
-
|
|
69
|
+
else if (s(t) || r(t.partyUuid)) {
|
|
70
|
+
const f = z(
|
|
71
|
+
n,
|
|
74
72
|
t,
|
|
75
73
|
t.partyUuid,
|
|
76
74
|
r(t.partyUuid),
|
|
77
75
|
u,
|
|
78
|
-
|
|
76
|
+
p
|
|
79
77
|
);
|
|
80
|
-
|
|
78
|
+
$.push(f), r(t.partyUuid) && S.push({ ...f, groupId: "favorites" });
|
|
81
79
|
}
|
|
82
|
-
} else if (
|
|
83
|
-
if (
|
|
84
|
-
const
|
|
85
|
-
|
|
80
|
+
} else if (tt(t.type)) {
|
|
81
|
+
if (s(t) || r(t.partyUuid)) {
|
|
82
|
+
const f = z(
|
|
83
|
+
n,
|
|
86
84
|
t,
|
|
87
85
|
t.partyUuid,
|
|
88
86
|
r(t.partyUuid),
|
|
89
87
|
u,
|
|
90
|
-
|
|
88
|
+
p
|
|
91
89
|
);
|
|
92
|
-
|
|
90
|
+
s(t) && U.push(f), r(t.partyUuid) && S.push({ ...f, groupId: "favorites" });
|
|
93
91
|
}
|
|
94
92
|
if (t.subunits && t.subunits.length > 0) {
|
|
95
|
-
const
|
|
96
|
-
for (const b of
|
|
97
|
-
if (
|
|
98
|
-
const
|
|
99
|
-
|
|
93
|
+
const f = [...t.subunits].sort(A);
|
|
94
|
+
for (const b of f)
|
|
95
|
+
if (s(b) || r(b.partyUuid)) {
|
|
96
|
+
const M = z(
|
|
97
|
+
n,
|
|
100
98
|
b,
|
|
101
99
|
t.partyUuid,
|
|
102
100
|
r(b.partyUuid),
|
|
103
101
|
u,
|
|
104
|
-
|
|
102
|
+
p,
|
|
105
103
|
t
|
|
106
104
|
);
|
|
107
|
-
|
|
108
|
-
...
|
|
105
|
+
s(b) && U.push(M), r(b.partyUuid) && S.push({
|
|
106
|
+
...M,
|
|
109
107
|
groupId: "favorites"
|
|
110
108
|
});
|
|
111
109
|
}
|
|
112
110
|
}
|
|
113
111
|
}
|
|
114
|
-
const
|
|
112
|
+
const J = {
|
|
115
113
|
[U[0]?.groupId || "company"]: {
|
|
116
|
-
title:
|
|
114
|
+
title: c.account_orgs,
|
|
117
115
|
divider: !0
|
|
118
116
|
},
|
|
119
|
-
[
|
|
120
|
-
title:
|
|
117
|
+
[$[0]?.groupId || "person"]: {
|
|
118
|
+
title: c.account_persons,
|
|
121
119
|
divider: !0
|
|
122
120
|
},
|
|
123
121
|
favorites: {
|
|
124
|
-
title:
|
|
122
|
+
title: c.account_favorites,
|
|
125
123
|
divider: !0
|
|
126
124
|
}
|
|
127
125
|
};
|
|
128
|
-
return [{ selfAccountItem:
|
|
129
|
-
}, [
|
|
130
|
-
const { selfAccountItem:
|
|
131
|
-
return
|
|
132
|
-
}, [
|
|
133
|
-
if (
|
|
126
|
+
return [{ selfAccountItem: j, peopleAccountItems: $, organizationAccountItems: U, favoriteAccountItems: S }, J];
|
|
127
|
+
}, [I, l, B, d, n, p, a]), k = v(() => {
|
|
128
|
+
const { selfAccountItem: r, peopleAccountItems: s, organizationAccountItems: c, favoriteAccountItems: y } = w;
|
|
129
|
+
return r ? [r, ...y, ...s, ...c] : [];
|
|
130
|
+
}, [w]), [q, x] = v(() => {
|
|
131
|
+
if (k.length === 0)
|
|
134
132
|
return [[], void 0];
|
|
135
|
-
let
|
|
136
|
-
return [
|
|
137
|
-
if (
|
|
138
|
-
const A = { ...
|
|
139
|
-
return
|
|
133
|
+
let r;
|
|
134
|
+
return [k.map((c) => {
|
|
135
|
+
if (i === c.id) {
|
|
136
|
+
const A = { ...c, selected: !0 };
|
|
137
|
+
return r = A, A;
|
|
140
138
|
}
|
|
141
|
-
return
|
|
142
|
-
}),
|
|
143
|
-
}, [
|
|
144
|
-
return
|
|
139
|
+
return c.selected ? { ...c, selected: !1 } : c;
|
|
140
|
+
}), r];
|
|
141
|
+
}, [k, i]);
|
|
142
|
+
return d || !e || !x ? {
|
|
145
143
|
accountMenu: {
|
|
146
144
|
items: [],
|
|
147
145
|
groups: {},
|
|
@@ -150,89 +148,89 @@ const H = (e) => e === "Organization" ? "company" : "person", pt = ({
|
|
|
150
148
|
},
|
|
151
149
|
currentAccount: void 0
|
|
152
150
|
},
|
|
153
|
-
loading:
|
|
151
|
+
loading: d
|
|
154
152
|
} : {
|
|
155
153
|
accountMenu: {
|
|
156
|
-
items:
|
|
157
|
-
groups:
|
|
158
|
-
virtualized:
|
|
154
|
+
items: q,
|
|
155
|
+
groups: Y,
|
|
156
|
+
virtualized: m,
|
|
159
157
|
onSelectAccount: N,
|
|
160
|
-
currentAccount:
|
|
158
|
+
currentAccount: x
|
|
161
159
|
},
|
|
162
160
|
loading: !1,
|
|
163
|
-
showDeletedUnits:
|
|
164
|
-
onShowDeletedUnitsChange:
|
|
165
|
-
accountCount:
|
|
161
|
+
showDeletedUnits: D ? a : void 0,
|
|
162
|
+
onShowDeletedUnitsChange: D ? g : void 0,
|
|
163
|
+
accountCount: K
|
|
166
164
|
};
|
|
167
|
-
},
|
|
165
|
+
}, L = ({
|
|
168
166
|
partyUuid: e,
|
|
169
167
|
isFavorite: o,
|
|
170
|
-
toggleFavoriteRef:
|
|
171
|
-
texts:
|
|
168
|
+
toggleFavoriteRef: i,
|
|
169
|
+
texts: l
|
|
172
170
|
}) => /* @__PURE__ */ F(
|
|
173
|
-
|
|
171
|
+
Q,
|
|
174
172
|
{
|
|
175
173
|
rounded: !0,
|
|
176
174
|
variant: "ghost",
|
|
177
|
-
"aria-label": o ?
|
|
178
|
-
onClick: (
|
|
179
|
-
|
|
175
|
+
"aria-label": o ? l.remove_from_favorites : l.add_to_favorites,
|
|
176
|
+
onClick: (d) => {
|
|
177
|
+
d.stopPropagation(), i?.current?.(e);
|
|
180
178
|
},
|
|
181
179
|
size: "xs",
|
|
182
|
-
children: o ? /* @__PURE__ */ F(
|
|
180
|
+
children: o ? /* @__PURE__ */ F(C, {}) : /* @__PURE__ */ F(T, {})
|
|
183
181
|
}
|
|
184
|
-
), z = (e, o,
|
|
185
|
-
const
|
|
182
|
+
), z = (e, o, i, l, d, N, m, h) => {
|
|
183
|
+
const n = V(o?.type ?? ""), a = G(e), g = R({
|
|
186
184
|
fullName: o?.name,
|
|
187
|
-
type:
|
|
188
|
-
}),
|
|
189
|
-
fullName:
|
|
190
|
-
type:
|
|
185
|
+
type: n
|
|
186
|
+
}), p = m ? R({
|
|
187
|
+
fullName: m?.name,
|
|
188
|
+
type: V(m?.type ?? ""),
|
|
191
189
|
reverseNameOrder: !1
|
|
192
190
|
}) : void 0;
|
|
193
191
|
let u = "";
|
|
194
|
-
const _ =
|
|
192
|
+
const _ = n === "company" && m ? "subunit" : n;
|
|
195
193
|
switch (_) {
|
|
196
194
|
case "company":
|
|
197
|
-
u = `${
|
|
195
|
+
u = `${a.org_no}. ${H(o.organizationNumber)}`;
|
|
198
196
|
break;
|
|
199
197
|
case "person":
|
|
200
|
-
u = o?.dateOfBirth ? `${
|
|
198
|
+
u = o?.dateOfBirth ? `${a.birthdate}: ${Z(o?.dateOfBirth)}` : "";
|
|
201
199
|
break;
|
|
202
200
|
case "subunit":
|
|
203
|
-
u = `↳ ${
|
|
201
|
+
u = `↳ ${a.org_no}. ${H(o?.organizationNumber)}, ${a.subunit_of} ${p}`;
|
|
204
202
|
break;
|
|
205
203
|
default:
|
|
206
204
|
u = "";
|
|
207
205
|
}
|
|
208
|
-
const
|
|
209
|
-
|
|
206
|
+
const I = h ? void 0 : /* @__PURE__ */ F(
|
|
207
|
+
L,
|
|
210
208
|
{
|
|
211
209
|
partyUuid: o?.partyUuid,
|
|
212
|
-
isFavorite:
|
|
213
|
-
toggleFavoriteRef:
|
|
214
|
-
texts:
|
|
210
|
+
isFavorite: l,
|
|
211
|
+
toggleFavoriteRef: d,
|
|
212
|
+
texts: a
|
|
215
213
|
}
|
|
216
214
|
);
|
|
217
215
|
return {
|
|
218
216
|
id: o?.partyUuid,
|
|
219
217
|
icon: {
|
|
220
218
|
name: g,
|
|
221
|
-
type:
|
|
222
|
-
isParent: !
|
|
219
|
+
type: n,
|
|
220
|
+
isParent: !m,
|
|
223
221
|
isDeleted: o?.isDeleted
|
|
224
222
|
},
|
|
225
223
|
name: g,
|
|
226
224
|
description: u,
|
|
227
225
|
searchWords: _ === "person" ? [g, o?.dateOfBirth ?? ""] : [g, o?.organizationNumber ?? ""],
|
|
228
|
-
groupId:
|
|
226
|
+
groupId: i,
|
|
229
227
|
type: _,
|
|
230
228
|
selected: !1,
|
|
231
229
|
disabled: !!o?.onlyHierarchyElementWithNoAccess,
|
|
232
|
-
badge:
|
|
233
|
-
controls:
|
|
230
|
+
badge: h ? { label: a.you, color: "person" } : o.isDeleted && N ? { label: a.deleted, color: "neutral" } : void 0,
|
|
231
|
+
controls: I
|
|
234
232
|
};
|
|
235
|
-
},
|
|
233
|
+
}, tt = (e) => e === "Organization", et = (e) => e === "Person" || e === "SelfIdentified", G = (e) => {
|
|
236
234
|
switch (e) {
|
|
237
235
|
case "nn":
|
|
238
236
|
return {
|
|
@@ -276,5 +274,5 @@ const H = (e) => e === "Organization" ? "company" : "person", pt = ({
|
|
|
276
274
|
}
|
|
277
275
|
};
|
|
278
276
|
export {
|
|
279
|
-
|
|
277
|
+
_t as useAccountSelector
|
|
280
278
|
};
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import { AccountNotificationSettings as b } from "./components/Account/AccountNo
|
|
|
11
11
|
import { AccountOrganization as y } from "./components/Account/AccountOrganization.js";
|
|
12
12
|
import { AccountSelector as k } from "./components/AccountSelector/AccountSelector.js";
|
|
13
13
|
import { Alert as v } from "./components/Alert/Alert.js";
|
|
14
|
-
import { B as C, a as P, D as H, b as w, c as E, d as G, e as O, f as N, g as R, F as V, H as z, I as U, h as j, i as Q, M as q, j as K, k as J, l as W, m as X, n as Y, R as Z, S as _, o as $, p as oo, q as ro, T as eo, w as to, V as mo, x as ao, z as po } from "./ToolbarSearch-
|
|
14
|
+
import { B as C, a as P, D as H, b as w, c as E, d as G, e as O, f as N, g as R, F as V, H as z, I as U, h as j, i as Q, M as q, j as K, k as J, l as W, m as X, n as Y, R as Z, S as _, o as $, p as oo, q as ro, T as eo, w as to, V as mo, x as ao, z as po } from "./ToolbarSearch-BWqWKrm-.js";
|
|
15
15
|
import { Banner as xo, BannerColorEnum as fo, BannerVariantEnum as so } from "./components/Banner/Banner.js";
|
|
16
16
|
import { BookmarkSettingsItem as co } from "./components/Bookmarks/BookmarkSettingsItem.js";
|
|
17
17
|
import { BookmarkSettingsList as uo } from "./components/Bookmarks/BookmarkSettingsList.js";
|
|
@@ -32,7 +32,11 @@ export interface AuthorizedParty {
|
|
|
32
32
|
export interface useAccountSelectorProps {
|
|
33
33
|
/** UUID of the user's own personal account */
|
|
34
34
|
selfAccountUuid?: string;
|
|
35
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* Array of authorized parties that the user can act on behalf of.
|
|
37
|
+
* Pass a referentially stable array: a fresh reference on every render
|
|
38
|
+
* forces the full list to be re-sorted and rebuilt.
|
|
39
|
+
*/
|
|
36
40
|
partyListDTO?: AuthorizedParty[];
|
|
37
41
|
/** Array of parties (defined by their partyUUIDs) marked as favorites by the user */
|
|
38
42
|
favoriteAccountUuids?: string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@altinn/altinn-components",
|
|
3
|
-
"version": "0.68.
|
|
3
|
+
"version": "0.68.15",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@types/react": "^19.1.5",
|
|
46
46
|
"@types/react-dom": "^19.2.3",
|
|
47
47
|
"@vitejs/plugin-react-swc": "^3.11.0",
|
|
48
|
-
"@vitest/browser": "4.
|
|
48
|
+
"@vitest/browser": "4.1.8",
|
|
49
49
|
"@vitest/browser-playwright": "4.0.16",
|
|
50
50
|
"@vitest/coverage-v8": "^4.1.3",
|
|
51
51
|
"axe-core": "^4.10.3",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"storybook-addon-theme-provider": "^0.2.10",
|
|
62
62
|
"tsx": "^4.21.0",
|
|
63
63
|
"typescript": "^5.8.3",
|
|
64
|
-
"vite": "7.3.
|
|
64
|
+
"vite": "7.3.5",
|
|
65
65
|
"vite-plugin-dts": "^4.5.4",
|
|
66
66
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
67
67
|
"vite-plugin-static-copy": "^2.3.2",
|