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