@altinn/altinn-components 0.56.15 → 0.56.16

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.
@@ -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}
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altinn/altinn-components",
3
- "version": "0.56.15",
3
+ "version": "0.56.16",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",