@altinn/altinn-components 0.56.15 → 0.56.17

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 (25) hide show
  1. package/dist/assets/UserListItem.css +1 -1
  2. package/dist/components/Bookmarks/BookmarkModal.js +41 -0
  3. package/dist/components/Bookmarks/BookmarkSettingsItem.js +35 -0
  4. package/dist/components/{Settings/BookmarksSettingsItemLabel.js → Bookmarks/BookmarkSettingsItemLabel.js} +1 -1
  5. package/dist/components/Bookmarks/BookmarkSettingsList.js +18 -0
  6. package/dist/components/Bookmarks/index.js +8 -0
  7. package/dist/components/Settings/index.js +8 -12
  8. package/dist/components/Toolbar/SelectDateFilter.js +31 -28
  9. package/dist/components/UserListItem/UserListItem.js +18 -18
  10. package/dist/components/index.js +451 -449
  11. package/dist/index.js +463 -461
  12. package/dist/types/lib/components/Bookmarks/BookmarkModal.d.ts +18 -0
  13. package/dist/types/lib/components/Bookmarks/BookmarkModal.stories.d.ts +5 -0
  14. package/dist/types/lib/components/Bookmarks/BookmarkSettingsItem.d.ts +22 -0
  15. package/dist/types/lib/components/{Settings/BookmarksSettingsItemLabel.d.ts → Bookmarks/BookmarkSettingsItemLabel.d.ts} +2 -2
  16. package/dist/types/lib/components/Bookmarks/BookmarkSettingsList.d.ts +6 -0
  17. package/dist/types/lib/components/Bookmarks/BookmarkSettingsList.stories.d.ts +19 -0
  18. package/dist/types/lib/components/Bookmarks/index.d.ts +3 -0
  19. package/dist/types/lib/components/Settings/index.d.ts +0 -2
  20. package/dist/types/lib/components/index.d.ts +1 -0
  21. package/package.json +1 -1
  22. package/dist/components/Settings/BookmarksSettingsItem.js +0 -90
  23. package/dist/components/Settings/BookmarksSettingsList.js +0 -46
  24. package/dist/types/lib/components/Settings/BookmarksSettingsItem.d.ts +0 -32
  25. package/dist/types/lib/components/Settings/BookmarksSettingsList.d.ts +0 -12
@@ -1 +1 @@
1
- ._badges_1csip_1{display:flex;flex-direction:row;gap:.5rem;flex-wrap:wrap;justify-content:start;margin-bottom:auto;margin-top:calc(var(--dsc-item-my) * .85)}._label_1csip_11{display:flex;flex-direction:row;align-items:center;gap:.5rem;min-width:0;flex:1;overflow:hidden}._label_1csip_11>span{min-width:0;flex:1;overflow:hidden}._label_1csip_11 span[data-size]{overflow:hidden}._label_1csip_11 span[data-size] span[data-variant=subtle]{display:-webkit-box;-webkit-line-clamp:1;line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal}._description_1csip_42{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;min-width:0}
1
+ ._badges_1xfrv_1{display:flex;flex-direction:row;gap:.5rem;flex-wrap:wrap;justify-content:start;margin-bottom:auto;flex:1;margin-top:calc(var(--dsc-item-my) * .85)}._label_1xfrv_12{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;gap:.5rem;min-width:0;overflow:hidden}._label_1xfrv_12>span{min-width:0;overflow:hidden}._label_1xfrv_12 span[data-size]{overflow:hidden}._label_1xfrv_12 span[data-size] span[data-variant=subtle]{display:-webkit-box;-webkit-line-clamp:1;line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal}._description_1xfrv_42{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;min-width:0}
@@ -0,0 +1,41 @@
1
+ import { jsxs as l, jsx as a } from "react/jsx-runtime";
2
+ import "../../index-p1eeF8LQ.js";
3
+ import { useState as u } from "react";
4
+ import "../Button/Button.js";
5
+ import "react-dom";
6
+ import "../RootProvider/RootProvider.js";
7
+ import { QueryLabel as g } from "../Searchbar/QueryLabel.js";
8
+ import { TextField as v } from "../Forms/TextField.js";
9
+ import "../Snackbar/useSnackbar.js";
10
+ import { SettingsModal as c } from "../Settings/SettingsModal.js";
11
+ import { S as h } from "../../MagnifyingGlass-bwVhw07z.js";
12
+ const B = ({
13
+ icon: e = h,
14
+ title: n,
15
+ params: t,
16
+ titleField: o,
17
+ buttons: m,
18
+ open: s = !1,
19
+ onClose: p
20
+ }) => {
21
+ const [i, f] = u("");
22
+ return /* @__PURE__ */ l(c, { icon: e, title: n, buttons: m, open: s, onClose: p, children: [
23
+ /* @__PURE__ */ a(g, { params: t }),
24
+ /* @__PURE__ */ a(
25
+ v,
26
+ {
27
+ ...o,
28
+ label: o?.label || "Gi søket et navn",
29
+ size: "sm",
30
+ name: "title",
31
+ value: typeof o?.value == "string" ? o?.value : i,
32
+ onChange: (r) => {
33
+ typeof o?.onChange == "function" ? o.onChange(r) : f(r.target.value);
34
+ }
35
+ }
36
+ )
37
+ ] });
38
+ };
39
+ export {
40
+ B as BookmarkModal
41
+ };
@@ -0,0 +1,35 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import "../../index-p1eeF8LQ.js";
3
+ import "react";
4
+ import "../Button/Button.js";
5
+ import { ContextMenu as a } from "../ContextMenu/ContextMenu.js";
6
+ import "react-dom";
7
+ import "../RootProvider/RootProvider.js";
8
+ import "../Snackbar/useSnackbar.js";
9
+ import { SettingsItemBase as f } from "../Settings/SettingsItemBase.js";
10
+ import { BookmarkSettingsItemLabel as g } from "./BookmarkSettingsItemLabel.js";
11
+ import { S as k } from "../../MagnifyingGlass-bwVhw07z.js";
12
+ const C = ({
13
+ id: m,
14
+ icon: i = k,
15
+ loading: o,
16
+ title: e,
17
+ highlightWords: p,
18
+ params: s,
19
+ contextMenu: r,
20
+ ...n
21
+ }) => /* @__PURE__ */ t(
22
+ f,
23
+ {
24
+ ...n,
25
+ id: m,
26
+ icon: i,
27
+ loading: o,
28
+ label: /* @__PURE__ */ t(g, { highlightWords: p, loading: o, params: s, title: e }),
29
+ controls: r && /* @__PURE__ */ t(a, { ...r }),
30
+ linkIcon: !0
31
+ }
32
+ );
33
+ export {
34
+ C as BookmarkSettingsItem
35
+ };
@@ -17,5 +17,5 @@ const h = ({
17
17
  /* @__PURE__ */ m(a, { params: i, size: r ? "xs" : "sm", variant: r ? "subtle" : "default" })
18
18
  ] });
19
19
  export {
20
- h as BookmarksSettingsItemLabel
20
+ h as BookmarkSettingsItemLabel
21
21
  };
@@ -0,0 +1,18 @@
1
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
2
+ import { Fragment as e, createElement as p } from "react";
3
+ import "../../index-p1eeF8LQ.js";
4
+ import "../Button/Button.js";
5
+ import { BookmarkSettingsItem as l } from "./BookmarkSettingsItem.js";
6
+ import "react-dom";
7
+ import "../RootProvider/RootProvider.js";
8
+ import { Divider as s } from "../Divider/Divider.js";
9
+ import { List as d } from "../List/List.js";
10
+ import "../Snackbar/useSnackbar.js";
11
+ import { SettingsSection as a } from "../Settings/SettingsSection.js";
12
+ const v = ({ loading: i, items: o }) => !o || o.length < 1 ? null : /* @__PURE__ */ t(a, { children: /* @__PURE__ */ t(d, { size: "sm", children: o.map((r, m) => /* @__PURE__ */ n(e, { children: [
13
+ m > 0 && /* @__PURE__ */ t(s, {}),
14
+ /* @__PURE__ */ p(l, { ...r, key: r.id, loading: i || r.loading })
15
+ ] }, r.id)) }) });
16
+ export {
17
+ v as BookmarkSettingsList
18
+ };
@@ -0,0 +1,8 @@
1
+ import { BookmarkSettingsItem as t } from "./BookmarkSettingsItem.js";
2
+ import { BookmarkSettingsList as e } from "./BookmarkSettingsList.js";
3
+ import { BookmarkModal as a } from "./BookmarkModal.js";
4
+ export {
5
+ a as BookmarkModal,
6
+ t as BookmarkSettingsItem,
7
+ e as BookmarkSettingsList
8
+ };
@@ -1,20 +1,16 @@
1
- import { SettingsItem as e } from "./SettingsItem.js";
1
+ import { SettingsItem as o } from "./SettingsItem.js";
2
2
  import { SettingsItemBase as m } from "./SettingsItemBase.js";
3
- import { SettingsList as i } from "./SettingsList.js";
4
- import { SettingsSection as g } from "./SettingsSection.js";
3
+ import { SettingsList as f } from "./SettingsList.js";
4
+ import { SettingsSection as i } from "./SettingsSection.js";
5
5
  import { SettingsModal as x } from "./SettingsModal.js";
6
6
  import { UsedByLog as S } from "./UsedByLog.js";
7
- import { UsedByLogItem as a } from "./UsedByLogItem.js";
8
- import { BookmarksSettingsItem as I } from "./BookmarksSettingsItem.js";
9
- import { BookmarksSettingsList as d } from "./BookmarksSettingsList.js";
7
+ import { UsedByLogItem as B } from "./UsedByLogItem.js";
10
8
  export {
11
- I as BookmarksSettingsItem,
12
- d as BookmarksSettingsList,
13
- e as SettingsItem,
9
+ o as SettingsItem,
14
10
  m as SettingsItemBase,
15
- i as SettingsList,
11
+ f as SettingsList,
16
12
  x as SettingsModal,
17
- g as SettingsSection,
13
+ i as SettingsSection,
18
14
  S as UsedByLog,
19
- a as UsedByLogItem
15
+ B as UsedByLogItem
20
16
  };
@@ -1,67 +1,70 @@
1
1
  import { jsx as d } from "react/jsx-runtime";
2
- import { useRef as L, useState as u, useCallback as O, useEffect as R } from "react";
2
+ import { useRef as A, useState as p, useCallback as C, useEffect as R } from "react";
3
3
  import { M as x } from "../../SearchField-QTfebYdU.js";
4
4
  import "../../index-p1eeF8LQ.js";
5
5
  import "../Button/Button.js";
6
6
  import "react-dom";
7
7
  import "../RootProvider/RootProvider.js";
8
8
  import "../Snackbar/useSnackbar.js";
9
- import { DatepickerFilter as A } from "./DatepickerFilter.js";
10
- import { formatDateRange as M } from "./formatDateRange.js";
11
- const N = ({
9
+ import { DatepickerFilter as M } from "./DatepickerFilter.js";
10
+ import { formatDateRange as j } from "./formatDateRange.js";
11
+ const P = ({
12
12
  name: n = "time",
13
13
  size: f,
14
- searchable: v,
15
- keyboardEvents: k,
14
+ searchable: k,
15
+ keyboardEvents: v,
16
16
  items: l,
17
17
  groups: E,
18
- filterState: t = {},
18
+ filterState: o = {},
19
19
  onFilterStateChange: c
20
20
  }) => {
21
- const s = L(null), [a, p] = u(!1), [o, w] = u(t?.fromDate?.[0] || ""), [r, T] = u(t?.toDate?.[0] || ""), i = O(() => {
21
+ const s = A(null), [a, u] = p(!1), [t, T] = p(o?.fromDate?.[0] || ""), [r, w] = p(o?.toDate?.[0] || ""), b = () => {
22
22
  c?.({
23
- ...t,
24
- fromDate: o ? [o] : void 0,
23
+ ...o,
24
+ [n]: ["fromAndToDate"]
25
+ }), u(!0);
26
+ }, i = C(() => {
27
+ c?.({
28
+ ...o,
29
+ fromDate: t ? [t] : void 0,
25
30
  toDate: r ? [r] : void 0,
26
- [n]: o || r ? ["fromAndToDate"] : void 0
27
- }), p(!1);
28
- }, [c, t, o, r, n]);
31
+ [n]: t || r ? ["fromAndToDate"] : void 0
32
+ }), u(!1);
33
+ }, [c, o, t, r, n]);
29
34
  R(() => {
30
35
  if (!a) return;
31
36
  const e = (m) => {
32
37
  m.key === "Escape" && i();
33
38
  }, D = (m) => {
34
- const C = m.target;
35
- s.current && !s.current.contains(C) && i();
36
- }, y = setTimeout(() => {
39
+ const h = m.target;
40
+ s.current && !s.current.contains(h) && i();
41
+ }, g = setTimeout(() => {
37
42
  document.addEventListener("mousedown", D), document.addEventListener("keydown", e);
38
43
  }, 0);
39
44
  return () => {
40
- clearTimeout(y), document.removeEventListener("mousedown", D), document.removeEventListener("keydown", e);
45
+ clearTimeout(g), document.removeEventListener("mousedown", D), document.removeEventListener("keydown", e);
41
46
  };
42
47
  }, [a, i]);
43
- const b = (e) => {
44
- w(e?.fromDate || ""), T(e?.toDate || "");
45
- }, g = M(o, r), h = l?.map((e) => e.role === "datepicker" ? {
48
+ const y = (e) => {
49
+ T(e?.fromDate || ""), w(e?.toDate || "");
50
+ }, L = j(t, r), O = l?.map((e) => e.role === "datepicker" ? {
46
51
  ...e,
47
- description: g,
48
- selected: t?.[n]?.[0] === "fromAndToDate",
49
- onClick: () => {
50
- p(!0);
51
- }
52
+ description: L,
53
+ selected: o?.[n]?.[0] === "fromAndToDate",
54
+ onClick: b
52
55
  } : {
53
56
  ...e,
54
57
  onChange: () => {
55
58
  c?.({
56
- ...t,
59
+ ...o,
57
60
  fromDate: void 0,
58
61
  toDate: void 0,
59
62
  [n]: e?.value ? [e.value] : void 0
60
63
  });
61
64
  }
62
65
  });
63
- return a ? /* @__PURE__ */ d("div", { ref: s, children: /* @__PURE__ */ d(A, { formData: { fromDate: o, toDate: r }, onChange: b, onSubmit: i }) }) : /* @__PURE__ */ d(x, { size: f, searchable: v, keyboardEvents: k, items: h, groups: E });
66
+ return a ? /* @__PURE__ */ d("div", { ref: s, children: /* @__PURE__ */ d(M, { formData: { fromDate: t, toDate: r }, onChange: y, onSubmit: i }) }) : /* @__PURE__ */ d(x, { size: f, searchable: k, keyboardEvents: v, items: O, groups: E });
64
67
  };
65
68
  export {
66
- N as SelectDateFilter
69
+ P as SelectDateFilter
67
70
  };
@@ -1,45 +1,45 @@
1
- import { jsx as e, jsxs as _ } from "react/jsx-runtime";
2
- import { Badge as h } from "../Badge/Badge.js";
1
+ import { jsx as s, jsxs as h } from "react/jsx-runtime";
2
+ import { Badge as p } from "../Badge/Badge.js";
3
3
  import "../../index-p1eeF8LQ.js";
4
4
  import "react";
5
5
  import "../Button/Button.js";
6
6
  import "react-dom";
7
7
  import "../RootProvider/RootProvider.js";
8
8
  import "../Snackbar/useSnackbar.js";
9
- import { ListItemLabel as L } from "../List/ListItemLabel.js";
10
- import { ListItem as g } from "../List/ListItem.js";
11
- import '../../assets/UserListItem.css';const z = "_badges_1csip_1", v = "_label_1csip_11", c = {
12
- badges: z,
13
- label: v
9
+ import { ListItemLabel as v } from "../List/ListItemLabel.js";
10
+ import { ListItem as x } from "../List/ListItem.js";
11
+ import '../../assets/UserListItem.css';const L = "_badges_1xfrv_1", g = "_label_1xfrv_12", m = {
12
+ badges: L,
13
+ label: g
14
14
  }, k = ({
15
15
  name: t,
16
16
  type: l,
17
- description: o,
18
- roleNames: r,
19
- titleAs: m = "h3",
17
+ description: r,
18
+ roleNames: o,
19
+ titleAs: c = "h3",
20
20
  subUnit: b = !1,
21
21
  loading: i = !1,
22
22
  deleted: d = !1,
23
- ...s
23
+ ...e
24
24
  }) => {
25
25
  const n = {
26
26
  name: t,
27
27
  type: l,
28
28
  isParent: l === "company" && !b,
29
29
  isDeleted: d
30
- }, f = !i && r ? /* @__PURE__ */ e("div", { className: c.badges, children: r.map((a) => /* @__PURE__ */ e(h, { label: a, color: s.color, children: a }, a)) }) : void 0, p = /* @__PURE__ */ _("div", { className: c.label, "data-size": s.size, children: [
31
- /* @__PURE__ */ e(
32
- L,
30
+ }, f = !i && o ? /* @__PURE__ */ s("div", { className: m.badges, children: o.map((a) => /* @__PURE__ */ s(p, { label: a, color: e.color, children: a }, a)) }) : void 0, _ = /* @__PURE__ */ h("div", { className: m.label, "data-size": e.size, children: [
31
+ /* @__PURE__ */ s(
32
+ v,
33
33
  {
34
- title: { children: t, as: m },
35
- description: o,
36
- size: s.size,
34
+ title: { children: t, as: c },
35
+ description: r,
36
+ size: e.size,
37
37
  loading: i
38
38
  }
39
39
  ),
40
40
  f
41
41
  ] });
42
- return /* @__PURE__ */ e(g, { icon: n, ariaLabel: t, label: p, description: o, loading: i, ...s });
42
+ return /* @__PURE__ */ s(x, { icon: n, ariaLabel: t, label: _, description: r, loading: i, ...e });
43
43
  };
44
44
  export {
45
45
  k as UserListItem