@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
|
-
.
|
|
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
|
|
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
|
|
10
|
-
import { formatDateRange as
|
|
11
|
-
const
|
|
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:
|
|
15
|
-
keyboardEvents:
|
|
14
|
+
searchable: k,
|
|
15
|
+
keyboardEvents: v,
|
|
16
16
|
items: l,
|
|
17
17
|
groups: E,
|
|
18
|
-
filterState:
|
|
18
|
+
filterState: o = {},
|
|
19
19
|
onFilterStateChange: c
|
|
20
20
|
}) => {
|
|
21
|
-
const s =
|
|
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
|
-
...
|
|
24
|
-
|
|
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]:
|
|
27
|
-
}),
|
|
28
|
-
}, [c,
|
|
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
|
|
35
|
-
s.current && !s.current.contains(
|
|
36
|
-
},
|
|
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(
|
|
45
|
+
clearTimeout(g), document.removeEventListener("mousedown", D), document.removeEventListener("keydown", e);
|
|
41
46
|
};
|
|
42
47
|
}, [a, i]);
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
},
|
|
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:
|
|
48
|
-
selected:
|
|
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
|
-
...
|
|
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(
|
|
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
|
-
|
|
69
|
+
P as SelectDateFilter
|
|
67
70
|
};
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Badge as
|
|
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
|
|
10
|
-
import { ListItem as
|
|
11
|
-
import '../../assets/UserListItem.css';const
|
|
12
|
-
badges:
|
|
13
|
-
label:
|
|
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:
|
|
18
|
-
roleNames:
|
|
19
|
-
titleAs:
|
|
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
|
-
...
|
|
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 &&
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
|
|
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:
|
|
35
|
-
description:
|
|
36
|
-
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__ */
|
|
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
|