asma-ui-core 3.130.2 → 3.130.3
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/asma-ui-core.css +1 -1
- package/dist/datetime/components/date-picker/components/StyledCalendarPicker.module.js +17 -18
- package/dist/datetime/components/date-picker/components/StyledDayPicker.js +10 -9
- package/dist/table/components/columns/action-column/components/RowActionMenu.js +71 -60
- package/dist/table/shared-components/StyledMenuItem.js +16 -16
- package/package.json +1 -1
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
var _ = "
|
|
2
|
-
"styled-calendar-day-picker": "_styled-calendar-day-
|
|
1
|
+
var _ = "_months_1178a_12", a = "_month_1178a_12", e = "_caption_1178a_25", d = "_caption_label_1178a_29", r = "_nav_1178a_34", n = "_nav_button_1178a_38", t = "_nav_button_previous_1178a_44", v = "_nav_button_next_1178a_48", l = "_head_row_1178a_52", o = "_head_cell_1178a_56", y = "_row_1178a_65", i = "_cell_1178a_69", s = "_has_1178a_72", c = "_first_1178a_75", u = "_last_1178a_78", b = "_day_1178a_82", h = "_day_today_1178a_93", p = "_day_selected_1178a_99", m = "_day_outside_1178a_120", w = "_day_range_middle_1178a_126", k = "_day_disabled_1178a_134", f = "_day_hidden_1178a_172", g = "_weeknumber_1178a_176", x = "_caption_end_1178a_188", C = {
|
|
2
|
+
"styled-calendar-day-picker": "_styled-calendar-day-picker_1178a_1",
|
|
3
3
|
months: _,
|
|
4
|
-
month:
|
|
5
|
-
caption:
|
|
6
|
-
caption_label:
|
|
7
|
-
nav:
|
|
8
|
-
nav_button:
|
|
9
|
-
nav_button_previous:
|
|
10
|
-
nav_button_next:
|
|
11
|
-
head_row:
|
|
12
|
-
head_cell:
|
|
13
|
-
row:
|
|
4
|
+
month: a,
|
|
5
|
+
caption: e,
|
|
6
|
+
caption_label: d,
|
|
7
|
+
nav: r,
|
|
8
|
+
nav_button: n,
|
|
9
|
+
nav_button_previous: t,
|
|
10
|
+
nav_button_next: v,
|
|
11
|
+
head_row: l,
|
|
12
|
+
head_cell: o,
|
|
13
|
+
row: y,
|
|
14
14
|
cell: i,
|
|
15
15
|
has: s,
|
|
16
|
-
first:
|
|
17
|
-
last:
|
|
18
|
-
day:
|
|
19
|
-
"focus-visible": "_focus-visible_t2tb0_88",
|
|
16
|
+
first: c,
|
|
17
|
+
last: u,
|
|
18
|
+
day: b,
|
|
20
19
|
day_today: h,
|
|
21
20
|
day_selected: p,
|
|
22
|
-
"rdp-day_range_end": "_rdp-
|
|
21
|
+
"rdp-day_range_end": "_rdp-day_range_end_1178a_120",
|
|
23
22
|
day_outside: m,
|
|
24
23
|
day_range_middle: w,
|
|
25
24
|
day_disabled: k,
|
|
26
25
|
day_hidden: f,
|
|
27
26
|
weeknumber: g,
|
|
28
|
-
"weeknumber-header": "_weeknumber-
|
|
27
|
+
"weeknumber-header": "_weeknumber-header_1178a_180",
|
|
29
28
|
caption_end: x
|
|
30
29
|
};
|
|
31
30
|
export {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { StyledCalendarPickerFooter as C } from "./StyledCalendarPickerFooter.js";
|
|
2
2
|
import { CustomCaption as O } from "./StyledCalendarPickerCaption.js";
|
|
3
3
|
import { StyledCalendarPickerSelectMonth as x } from "./StyledCalendarPickerSelectMonth.js";
|
|
4
|
-
import { StyledCalendarPickerSelectYear as
|
|
4
|
+
import { StyledCalendarPickerSelectYear as F } from "./StyledCalendarPickerSelectYear.js";
|
|
5
5
|
import e from "./StyledCalendarPicker.module.js";
|
|
6
|
-
import { buildDisabled as
|
|
7
|
-
import { useState as
|
|
6
|
+
import { buildDisabled as N } from "../helpers.js";
|
|
7
|
+
import { useState as Y } from "react";
|
|
8
8
|
import { jsx as i } from "react/jsx-runtime";
|
|
9
9
|
import { DayPicker as W } from "react-day-picker";
|
|
10
10
|
import { endOfMonth as q, startOfToday as R } from "date-fns";
|
|
11
11
|
import { enGB as T } from "date-fns/locale";
|
|
12
12
|
var K = ({ datePickerProps: t, popoverProps: y }) => {
|
|
13
|
-
const { showOutsideDays: h = !0, locale: s = T, numberOfMonths: b, disabledDays: w, onClear: f, title: j, ...g } = t, { onClose: m } = y, [_,
|
|
13
|
+
const { showOutsideDays: h = !0, locale: s = T, numberOfMonths: b, disabledDays: w, onClear: f, title: j, ...g } = t, { onClose: m } = y, [_, u] = Y((t.mode === "range" ? t.selected?.from : t.selected) ?? /* @__PURE__ */ new Date()), c = s.code === "nb", v = (b ?? 1) < 2, D = N(w, "disallowPast" in t ? t.disallowPast : void 0, "disallowFuture" in t ? t.disallowFuture : void 0, R()), S = (n) => {
|
|
14
14
|
if (!t.selected || !t.onSelect) return;
|
|
15
15
|
const o = /* @__PURE__ */ new Date(), a = {};
|
|
16
16
|
if (t.mode === "range") {
|
|
@@ -22,11 +22,12 @@ var K = ({ datePickerProps: t, popoverProps: y }) => {
|
|
|
22
22
|
d(void 0, o, a, n);
|
|
23
23
|
};
|
|
24
24
|
return /* @__PURE__ */ i(W, {
|
|
25
|
+
autoFocus: !0,
|
|
25
26
|
...g,
|
|
26
27
|
disabled: D,
|
|
27
28
|
month: _,
|
|
28
29
|
onMonthChange: (n) => {
|
|
29
|
-
if (
|
|
30
|
+
if (u(n), !!t.onSelect && (!t.mode || t.mode === "single")) {
|
|
30
31
|
const o = t.selected;
|
|
31
32
|
if (o instanceof Date) {
|
|
32
33
|
const a = n.getFullYear(), d = n.getMonth(), l = o.getDate(), M = q(new Date(a, d, 1)).getDate(), p = Math.min(l, M), r = new Date(o);
|
|
@@ -44,7 +45,7 @@ var K = ({ datePickerProps: t, popoverProps: y }) => {
|
|
|
44
45
|
showWeekNumber: !0,
|
|
45
46
|
showOutsideDays: h,
|
|
46
47
|
fixedWeeks: !0,
|
|
47
|
-
formatters: { formatWeekNumberHeader: () =>
|
|
48
|
+
formatters: { formatWeekNumberHeader: () => c ? "U" : "W" },
|
|
48
49
|
className: e["styled-calendar-day-picker"],
|
|
49
50
|
classNames: {
|
|
50
51
|
months: e.months,
|
|
@@ -90,15 +91,15 @@ var K = ({ datePickerProps: t, popoverProps: y }) => {
|
|
|
90
91
|
onClose: m
|
|
91
92
|
}),
|
|
92
93
|
MonthsDropdown: x,
|
|
93
|
-
YearsDropdown:
|
|
94
|
+
YearsDropdown: F
|
|
94
95
|
},
|
|
95
96
|
footer: /* @__PURE__ */ i(C, {
|
|
96
97
|
onClose: m,
|
|
97
|
-
isNb:
|
|
98
|
+
isNb: c,
|
|
98
99
|
selected: t.selected,
|
|
99
100
|
removeSelection: S,
|
|
100
101
|
required: t?.required,
|
|
101
|
-
setMonth:
|
|
102
|
+
setMonth: u,
|
|
102
103
|
month: _,
|
|
103
104
|
onClear: f
|
|
104
105
|
})
|
|
@@ -1,27 +1,33 @@
|
|
|
1
|
-
import { DotsVerticalIcon as
|
|
2
|
-
import { CircleWarningOutlineIcon as
|
|
3
|
-
import { StyledPopover as
|
|
4
|
-
import { StyledMenuList as
|
|
5
|
-
import { isCustomAction as
|
|
6
|
-
import { StyledTooltip as
|
|
7
|
-
import { useToggleMenuVisibility as
|
|
8
|
-
import { StyledButton as
|
|
9
|
-
import { StyledMenuItem as
|
|
10
|
-
import
|
|
11
|
-
import { jsx as t, jsxs as
|
|
12
|
-
function
|
|
13
|
-
const { anchorEl: P, open:
|
|
14
|
-
if (!(n.state !== "hidden" && (
|
|
15
|
-
const
|
|
1
|
+
import { DotsVerticalIcon as T } from "../../../../../components/icons/dots-vertical-icon/DotsVerticalIcon.js";
|
|
2
|
+
import { CircleWarningOutlineIcon as S } from "../../../../../components/icons/warning-circle-icon/CircleWarningOutlineIcon.js";
|
|
3
|
+
import { StyledPopover as k } from "../../../../../components/utils/popover/StyledPopover.js";
|
|
4
|
+
import { StyledMenuList as I } from "../../../../../components/navigation/menu/StyledMenuList.js";
|
|
5
|
+
import { isCustomAction as j } from "../../../../types.js";
|
|
6
|
+
import { StyledTooltip as h } from "../../../../shared-components/tooltip/index.js";
|
|
7
|
+
import { useToggleMenuVisibility as O } from "../../../../hooks/useToggleMenuVisibility.hook.js";
|
|
8
|
+
import { StyledButton as R } from "../../../../shared-components/button/StyledButton.js";
|
|
9
|
+
import { StyledMenuItem as g } from "../../../../shared-components/StyledMenuItem.js";
|
|
10
|
+
import b, { useId as B, useMemo as U, useState as V } from "react";
|
|
11
|
+
import { jsx as t, jsxs as w } from "react/jsx-runtime";
|
|
12
|
+
function X({ tableData: l, actions: v, rowActionsState: y }) {
|
|
13
|
+
const { anchorEl: P, open: i, handleClose: s, handleOpen: D } = O(), [x, C] = V(!1), d = B(), a = v(l.row), n = y?.(l.row) ?? { state: "enabled" }, c = l.table.options.meta?.locale, N = c === "no" ? "Ingen handlinger tilgjengelig" : "No actions available", A = c === "no" ? "Radhandlinger" : "Row actions", M = U(() => a.every((e) => "component" in e ? !1 : e.hide), [a]), u = a.length > 0 && !M, m = n.state === "enabled" && !u;
|
|
14
|
+
if (!(n.state !== "hidden" && (u || m || n.state === "disabled"))) return /* @__PURE__ */ t("div", { className: "flex w-[40px] items-center justify-center" });
|
|
15
|
+
const p = n.state === "disabled", f = /* @__PURE__ */ t(R, {
|
|
16
16
|
dataTest: "row-actions-button",
|
|
17
|
-
"aria-label":
|
|
17
|
+
"aria-label": A,
|
|
18
18
|
"aria-haspopup": "true",
|
|
19
|
-
"aria-expanded":
|
|
19
|
+
"aria-expanded": i,
|
|
20
20
|
variant: "text",
|
|
21
21
|
size: "small",
|
|
22
|
-
"aria-disabled":
|
|
22
|
+
"aria-disabled": p || void 0,
|
|
23
23
|
onClick: (e) => {
|
|
24
|
-
e.stopPropagation(), e.preventDefault(), !
|
|
24
|
+
e.stopPropagation(), e.preventDefault(), !p && (e.currentTarget.focus({ preventScroll: !0 }), i ? s() : (C(e.detail === 0), D(e)));
|
|
25
|
+
},
|
|
26
|
+
onKeyDown: (e) => {
|
|
27
|
+
if (!i || e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
28
|
+
e.preventDefault(), e.stopPropagation();
|
|
29
|
+
const r = document.getElementById(d)?.querySelectorAll('[role="menuitem"]');
|
|
30
|
+
r?.length && r[e.key === "ArrowDown" ? 0 : r.length - 1]?.focus();
|
|
25
31
|
},
|
|
26
32
|
onMouseDown: (e) => {
|
|
27
33
|
e.stopPropagation(), e.preventDefault();
|
|
@@ -29,17 +35,17 @@ function q({ tableData: l, actions: v, rowActionsState: w }) {
|
|
|
29
35
|
onMouseUp: (e) => {
|
|
30
36
|
e.stopPropagation(), e.preventDefault();
|
|
31
37
|
},
|
|
32
|
-
children: /* @__PURE__ */ t(
|
|
33
|
-
className:
|
|
38
|
+
children: /* @__PURE__ */ t(T, {
|
|
39
|
+
className: p ? "text-delta-300" : "text-delta-700",
|
|
34
40
|
width: 20,
|
|
35
41
|
height: 20
|
|
36
42
|
})
|
|
37
43
|
});
|
|
38
44
|
return /* @__PURE__ */ t("div", {
|
|
39
45
|
className: "flex w-[40px] items-center justify-center",
|
|
40
|
-
children: /* @__PURE__ */
|
|
46
|
+
children: /* @__PURE__ */ w("div", {
|
|
41
47
|
className: "flex items-center justify-center",
|
|
42
|
-
children: [n.state === "disabled" ? /* @__PURE__ */ t(
|
|
48
|
+
children: [n.state === "disabled" ? /* @__PURE__ */ t(h, {
|
|
43
49
|
title: n.tooltipTitle,
|
|
44
50
|
arrow: !0,
|
|
45
51
|
placement: n.tooltipPlacement ?? "top",
|
|
@@ -53,13 +59,15 @@ function q({ tableData: l, actions: v, rowActionsState: w }) {
|
|
|
53
59
|
onClick: (e) => {
|
|
54
60
|
e.stopPropagation(), e.preventDefault();
|
|
55
61
|
},
|
|
56
|
-
children:
|
|
62
|
+
children: f
|
|
57
63
|
})
|
|
58
|
-
}) :
|
|
59
|
-
|
|
64
|
+
}) : f, n.state === "enabled" && /* @__PURE__ */ t(k, {
|
|
65
|
+
id: d,
|
|
66
|
+
open: i,
|
|
60
67
|
anchorEl: P,
|
|
61
|
-
onClose:
|
|
62
|
-
onClick:
|
|
68
|
+
onClose: s,
|
|
69
|
+
onClick: s,
|
|
70
|
+
tabIntoContent: !1,
|
|
63
71
|
anchorOrigin: {
|
|
64
72
|
horizontal: "right",
|
|
65
73
|
vertical: "bottom"
|
|
@@ -68,39 +76,24 @@ function q({ tableData: l, actions: v, rowActionsState: w }) {
|
|
|
68
76
|
horizontal: "right",
|
|
69
77
|
vertical: "top"
|
|
70
78
|
},
|
|
71
|
-
children: m ? /* @__PURE__ */
|
|
79
|
+
children: m ? /* @__PURE__ */ w("div", {
|
|
72
80
|
className: "flex items-center gap-2 p-3 text-base text-delta-700",
|
|
73
|
-
children: [/* @__PURE__ */ t(
|
|
81
|
+
children: [/* @__PURE__ */ t(S, {
|
|
74
82
|
width: 20,
|
|
75
83
|
height: 20
|
|
76
84
|
}), /* @__PURE__ */ t("span", { children: N })]
|
|
77
|
-
}) : /* @__PURE__ */ t(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
disabledReason: e.tooltipTitle,
|
|
86
|
-
reasonPlacement: e.tooltipPlacement ?? "left",
|
|
87
|
-
onMouseDown: (o) => {
|
|
88
|
-
o.stopPropagation(), o.preventDefault();
|
|
89
|
-
},
|
|
90
|
-
onMouseUp: (o) => {
|
|
91
|
-
o.stopPropagation(), o.preventDefault();
|
|
92
|
-
},
|
|
93
|
-
children: e.label
|
|
94
|
-
}, p) : /* @__PURE__ */ t(f, {
|
|
95
|
-
title: e?.tooltipTitle,
|
|
96
|
-
arrow: !0,
|
|
97
|
-
placement: e?.tooltipPlacement ?? "left",
|
|
98
|
-
children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(h, {
|
|
85
|
+
}) : /* @__PURE__ */ t(I, {
|
|
86
|
+
autoFocus: x,
|
|
87
|
+
children: a.map((e, r) => {
|
|
88
|
+
if (j(e)) {
|
|
89
|
+
const o = e.component(l.row, s);
|
|
90
|
+
return b.isValidElement(o) ? /* @__PURE__ */ t(b.Fragment, { children: o }, r) : null;
|
|
91
|
+
}
|
|
92
|
+
return e.hide ? null : e.disabled && e.tooltipTitle ? /* @__PURE__ */ t(g, {
|
|
99
93
|
className: e.className,
|
|
100
|
-
disabled:
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
},
|
|
94
|
+
disabled: !0,
|
|
95
|
+
disabledReason: e.tooltipTitle,
|
|
96
|
+
reasonPlacement: e.tooltipPlacement ?? "left",
|
|
104
97
|
onMouseDown: (o) => {
|
|
105
98
|
o.stopPropagation(), o.preventDefault();
|
|
106
99
|
},
|
|
@@ -108,13 +101,31 @@ function q({ tableData: l, actions: v, rowActionsState: w }) {
|
|
|
108
101
|
o.stopPropagation(), o.preventDefault();
|
|
109
102
|
},
|
|
110
103
|
children: e.label
|
|
111
|
-
})
|
|
112
|
-
|
|
113
|
-
|
|
104
|
+
}, r) : /* @__PURE__ */ t(h, {
|
|
105
|
+
title: e?.tooltipTitle,
|
|
106
|
+
arrow: !0,
|
|
107
|
+
placement: e?.tooltipPlacement ?? "left",
|
|
108
|
+
children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(g, {
|
|
109
|
+
className: e.className,
|
|
110
|
+
disabled: e.disabled,
|
|
111
|
+
onClick: () => {
|
|
112
|
+
e.disabled || e.onClick?.(l.row);
|
|
113
|
+
},
|
|
114
|
+
onMouseDown: (o) => {
|
|
115
|
+
o.stopPropagation(), o.preventDefault();
|
|
116
|
+
},
|
|
117
|
+
onMouseUp: (o) => {
|
|
118
|
+
o.stopPropagation(), o.preventDefault();
|
|
119
|
+
},
|
|
120
|
+
children: e.label
|
|
121
|
+
}) })
|
|
122
|
+
}, r);
|
|
123
|
+
})
|
|
124
|
+
})
|
|
114
125
|
})]
|
|
115
126
|
})
|
|
116
127
|
});
|
|
117
128
|
}
|
|
118
129
|
export {
|
|
119
|
-
|
|
130
|
+
X as RowActionMenu
|
|
120
131
|
};
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { StyledTooltip as
|
|
3
|
-
import { jsx as
|
|
4
|
-
var
|
|
1
|
+
import { cn as d } from "../../helpers/cn.js";
|
|
2
|
+
import { StyledTooltip as y } from "../../components/data-display/tooltip/StyledTooltip.js";
|
|
3
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
4
|
+
var k = ({ children: i, disabled: e, disabledReason: o, reasonPlacement: l = "left", selected: c, className: s, classes: p, onClick: u, onMouseDown: m, onMouseUp: f }) => {
|
|
5
5
|
const x = (t) => {
|
|
6
|
-
e || (t.key === "Enter" || t.key === " ") && (t.preventDefault(),
|
|
7
|
-
},
|
|
6
|
+
e || (t.key === "Enter" || t.key === " ") && (t.preventDefault(), t.currentTarget.click());
|
|
7
|
+
}, r = !!e && !!o, n = /* @__PURE__ */ a("li", {
|
|
8
8
|
role: "menuitem",
|
|
9
9
|
"aria-disabled": e ? !0 : void 0,
|
|
10
|
-
"data-has-reason":
|
|
10
|
+
"data-has-reason": r || void 0,
|
|
11
11
|
tabIndex: -1,
|
|
12
|
-
onClick: e ? (t) => t.stopPropagation() :
|
|
12
|
+
onClick: e ? (t) => t.stopPropagation() : u,
|
|
13
13
|
onKeyDown: x,
|
|
14
|
-
onMouseDown:
|
|
14
|
+
onMouseDown: m,
|
|
15
15
|
onMouseUp: f,
|
|
16
|
-
className:
|
|
17
|
-
children:
|
|
16
|
+
className: d("box-border flex min-h-10 items-center px-3 py-2 text-base text-delta-700 outline-none", "focus-visible:shadow-[inset_3px_0_var(--colors-focus-ring)]", e ? "cursor-not-allowed" : "cursor-pointer hover:bg-delta-50", c && "bg-gama-50", p?.root, s, e && "aria-disabled:text-delta-300"),
|
|
17
|
+
children: i
|
|
18
18
|
});
|
|
19
|
-
return
|
|
19
|
+
return r ? /* @__PURE__ */ a(y, {
|
|
20
20
|
title: o,
|
|
21
21
|
arrow: !0,
|
|
22
|
-
placement:
|
|
22
|
+
placement: l,
|
|
23
23
|
openOnTap: !0,
|
|
24
24
|
persistentDescription: !0,
|
|
25
|
-
children:
|
|
26
|
-
}) :
|
|
25
|
+
children: n
|
|
26
|
+
}) : n;
|
|
27
27
|
};
|
|
28
28
|
export {
|
|
29
|
-
|
|
29
|
+
k as StyledMenuItem
|
|
30
30
|
};
|