asma-ui-core 3.105.0 → 3.106.0
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/components/custom/module/header-layout/DynamicToolbar.js +99 -97
- package/dist/components/custom/module/header-layout/ToolbarActionGroup.js +60 -41
- package/dist/components/custom/module/header-layout/ToolbarRows.js +51 -47
- package/dist/components/custom/module/header-layout/useTranslations.js +12 -10
- package/dist/components/custom/page/page-header/PageHeader.js +41 -40
- package/dist/components/custom/widget/widget/StyledWidget.js +21 -20
- package/dist/components/data-display/chip/StyledChip.js +70 -53
- package/dist/components/data-display/tooltip/StyledTooltip.js +116 -73
- package/dist/components/feedback/dialog/DialogBusyContext.js +32 -0
- package/dist/components/feedback/dialog/StyledDialog.js +81 -72
- package/dist/components/feedback/dialog/dialog-footer/StyledDialogFooter.js +76 -71
- package/dist/components/feedback/minimizable-dialog/MinimizableDialog.js +133 -137
- package/dist/components/feedback/minimizable-dialog/components/CloseBtn.js +11 -8
- package/dist/components/feedback/minimizable-dialog/components/FullscreenBtn.js +6 -6
- package/dist/components/feedback/minimizable-dialog/components/MinimizeBtn.js +1 -1
- package/dist/components/feedback/minimizable-dialog/v2/MinimizableDialogV2.js +94 -85
- package/dist/components/feedback/minimizable-dialog/v2/useTranslations.js +6 -4
- package/dist/components/inputs/button/StyledButton.js +83 -33
- package/dist/components/inputs/button/StyledButton.module.js +13 -13
- package/dist/components/inputs/dynamic-select/components/DynamicInteractiveChipGroup.js +32 -32
- package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +6 -6
- package/dist/components/inputs/select/StyledSelect.js +8 -8
- package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +14 -14
- package/dist/components/navigation/link/StyledLink.js +53 -26
- package/dist/components/navigation/link/StyledLink.module.js +6 -6
- package/dist/components/navigation/menu/StyledMenuItem.js +35 -30
- package/dist/components/navigation/tabs/StyledTab.js +23 -25
- package/dist/components/utils/bottom-sheet/StyledBottomSheet.js +6 -6
- package/dist/components/utils/copy-wrapper/CopyButton.js +4 -4
- package/dist/components/utils/copy-wrapper/CopyWrapper.js +4 -4
- package/dist/datetime/shared-components/button/StyledButton.module.js +11 -11
- package/dist/helpers/focusable.js +2 -2
- package/dist/index.js +589 -585
- package/dist/src/components/custom/module/header-layout/ToolbarActionGroup.d.ts +13 -2
- package/dist/src/components/custom/module/header-layout/ToolbarRows.d.ts +2 -1
- package/dist/src/components/custom/module/header-layout/planToolbarActions.d.ts +18 -1
- package/dist/src/components/custom/module/header-layout/useTranslations.d.ts +2 -0
- package/dist/src/components/custom/widget/widget/StyledWidget.d.ts +5 -0
- package/dist/src/components/data-display/chip/StyledChip.d.ts +6 -0
- package/dist/src/components/data-display/interactive-chip/StyledInteractiveChip.d.ts +7 -1
- package/dist/src/components/data-display/tooltip/StyledTooltip.d.ts +16 -2
- package/dist/src/components/feedback/dialog/DialogBusy.test.d.ts +1 -0
- package/dist/src/components/feedback/dialog/DialogBusyContext.d.ts +28 -0
- package/dist/src/components/feedback/dialog/StyledDialog.d.ts +5 -0
- package/dist/src/components/feedback/dialog/dialog-footer/StyledDialogFooter.d.ts +9 -8
- package/dist/src/components/feedback/dialog/index.d.ts +1 -0
- package/dist/src/components/feedback/minimizable-dialog/components/CloseBtn.d.ts +2 -0
- package/dist/src/components/feedback/minimizable-dialog/types.d.ts +11 -0
- package/dist/src/components/feedback/minimizable-dialog/v2/types.d.ts +2 -0
- package/dist/src/components/feedback/minimizable-dialog/v2/useTranslations.d.ts +2 -0
- package/dist/src/components/inputs/button/StyledButton.d.ts +25 -1
- package/dist/src/components/inputs/button/StyledButtonBusy.test.d.ts +1 -0
- package/dist/src/components/navigation/link/StyledLink.d.ts +6 -0
- package/dist/src/components/navigation/menu/StyledMenuItem.d.ts +8 -1
- package/dist/src/components/navigation/tabs/StyledTab.d.ts +6 -0
- package/dist/src/forms/submitChanged.d.ts +3 -0
- package/dist/src/helpers/focusable.d.ts +8 -0
- package/dist/src/helpers/index.d.ts +1 -0
- package/dist/src/helpers/uiCoreLocale.d.ts +1 -0
- package/dist/src/table/shared-components/StyledMenuItem.d.ts +5 -1
- package/dist/table/components/columns/action-column/components/RowActionMenu.js +63 -69
- package/dist/table/shared-components/StyledMenuItem.js +28 -16
- package/package.json +1 -1
|
@@ -1,37 +1,27 @@
|
|
|
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:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if (L(() => {
|
|
17
|
-
if (!p || !h.current) return;
|
|
18
|
-
const e = window.setTimeout(() => l(!1), 1600);
|
|
19
|
-
return () => window.clearTimeout(e);
|
|
20
|
-
}, [p]), !S) return /* @__PURE__ */ t("div", { className: "flex w-[40px] items-center justify-center" });
|
|
21
|
-
const d = o.state === "disabled", g = /* @__PURE__ */ t(B, {
|
|
1
|
+
import { DotsVerticalIcon as y } from "../../../../../components/icons/dots-vertical-icon/DotsVerticalIcon.js";
|
|
2
|
+
import { CircleWarningOutlineIcon as D } from "../../../../../components/icons/warning-circle-icon/CircleWarningOutlineIcon.js";
|
|
3
|
+
import { StyledPopover as T } from "../../../../../components/utils/popover/StyledPopover.js";
|
|
4
|
+
import { StyledMenuList as A } from "../../../../../components/navigation/menu/StyledMenuList.js";
|
|
5
|
+
import { isCustomAction as S } from "../../../../types.js";
|
|
6
|
+
import { StyledTooltip as f } from "../../../../shared-components/tooltip/index.js";
|
|
7
|
+
import { useToggleMenuVisibility as j } from "../../../../hooks/useToggleMenuVisibility.hook.js";
|
|
8
|
+
import { StyledButton as k } from "../../../../shared-components/button/StyledButton.js";
|
|
9
|
+
import { StyledMenuItem as h } from "../../../../shared-components/StyledMenuItem.js";
|
|
10
|
+
import g, { useMemo as O } from "react";
|
|
11
|
+
import { jsx as t, jsxs as b } from "react/jsx-runtime";
|
|
12
|
+
function q({ tableData: l, actions: v, rowActionsState: w }) {
|
|
13
|
+
const { anchorEl: P, open: s, handleClose: r, handleOpen: x } = j(), i = v(l.row), n = w?.(l.row) ?? { state: "enabled" }, d = l.table.options.meta?.locale, N = d === "no" ? "Ingen handlinger tilgjengelig" : "No actions available", C = d === "no" ? "Radhandlinger" : "Row actions", M = O(() => i.every((e) => "component" in e ? !1 : e.hide), [i]), c = i.length > 0 && !M, m = n.state === "enabled" && !c;
|
|
14
|
+
if (!(n.state !== "hidden" && (c || m || n.state === "disabled"))) return /* @__PURE__ */ t("div", { className: "flex w-[40px] items-center justify-center" });
|
|
15
|
+
const a = n.state === "disabled", u = /* @__PURE__ */ t(k, {
|
|
22
16
|
dataTest: "row-actions-button",
|
|
23
|
-
"aria-label":
|
|
17
|
+
"aria-label": C,
|
|
24
18
|
"aria-haspopup": "true",
|
|
25
|
-
"aria-expanded":
|
|
19
|
+
"aria-expanded": s,
|
|
26
20
|
variant: "text",
|
|
27
21
|
size: "small",
|
|
28
|
-
"aria-disabled":
|
|
22
|
+
"aria-disabled": a || void 0,
|
|
29
23
|
onClick: (e) => {
|
|
30
|
-
|
|
31
|
-
s(!1);
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
e.currentTarget.focus({ preventScroll: !0 }), c ? i() : M(e);
|
|
24
|
+
e.stopPropagation(), e.preventDefault(), !a && (e.currentTarget.focus({ preventScroll: !0 }), s ? r() : x(e));
|
|
35
25
|
},
|
|
36
26
|
onMouseDown: (e) => {
|
|
37
27
|
e.stopPropagation(), e.preventDefault();
|
|
@@ -39,45 +29,37 @@ function _({ tableData: r, actions: y, rowActionsState: T }) {
|
|
|
39
29
|
onMouseUp: (e) => {
|
|
40
30
|
e.stopPropagation(), e.preventDefault();
|
|
41
31
|
},
|
|
42
|
-
children: /* @__PURE__ */ t(
|
|
43
|
-
className:
|
|
32
|
+
children: /* @__PURE__ */ t(y, {
|
|
33
|
+
className: a ? "text-delta-300" : "text-delta-700",
|
|
44
34
|
width: 20,
|
|
45
35
|
height: 20
|
|
46
36
|
})
|
|
47
37
|
});
|
|
48
38
|
return /* @__PURE__ */ t("div", {
|
|
49
39
|
className: "flex w-[40px] items-center justify-center",
|
|
50
|
-
children: /* @__PURE__ */
|
|
40
|
+
children: /* @__PURE__ */ b("div", {
|
|
51
41
|
className: "flex items-center justify-center",
|
|
52
|
-
children: [
|
|
53
|
-
title:
|
|
42
|
+
children: [n.state === "disabled" ? /* @__PURE__ */ t(f, {
|
|
43
|
+
title: n.tooltipTitle,
|
|
54
44
|
arrow: !0,
|
|
55
|
-
placement:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
onClose: () => l(!1),
|
|
45
|
+
placement: n.tooltipPlacement ?? "top",
|
|
46
|
+
openOnTap: !0,
|
|
47
|
+
persistentDescription: !0,
|
|
59
48
|
children: /* @__PURE__ */ t("span", {
|
|
60
49
|
className: "cursor-not-allowed",
|
|
61
|
-
onMouseEnter: () => s(!1),
|
|
62
|
-
onMouseLeave: () => l(!1),
|
|
63
|
-
onFocus: () => s(!1),
|
|
64
|
-
onBlur: () => l(!1),
|
|
65
|
-
onKeyDown: (e) => {
|
|
66
|
-
e.key === "Escape" && l(!1);
|
|
67
|
-
},
|
|
68
50
|
onTouchStart: (e) => {
|
|
69
|
-
e.stopPropagation(), e.preventDefault()
|
|
51
|
+
e.stopPropagation(), e.preventDefault();
|
|
70
52
|
},
|
|
71
53
|
onClick: (e) => {
|
|
72
54
|
e.stopPropagation(), e.preventDefault();
|
|
73
55
|
},
|
|
74
|
-
children:
|
|
56
|
+
children: u
|
|
75
57
|
})
|
|
76
|
-
}) :
|
|
77
|
-
open:
|
|
78
|
-
anchorEl:
|
|
79
|
-
onClose:
|
|
80
|
-
onClick:
|
|
58
|
+
}) : u, n.state === "enabled" && /* @__PURE__ */ t(T, {
|
|
59
|
+
open: s,
|
|
60
|
+
anchorEl: P,
|
|
61
|
+
onClose: r,
|
|
62
|
+
onClick: r,
|
|
81
63
|
anchorOrigin: {
|
|
82
64
|
horizontal: "right",
|
|
83
65
|
vertical: "bottom"
|
|
@@ -86,38 +68,50 @@ function _({ tableData: r, actions: y, rowActionsState: T }) {
|
|
|
86
68
|
horizontal: "right",
|
|
87
69
|
vertical: "top"
|
|
88
70
|
},
|
|
89
|
-
children:
|
|
71
|
+
children: m ? /* @__PURE__ */ b("div", {
|
|
90
72
|
className: "flex items-center gap-2 p-3 text-base text-delta-700",
|
|
91
|
-
children: [/* @__PURE__ */ t(
|
|
73
|
+
children: [/* @__PURE__ */ t(D, {
|
|
92
74
|
width: 20,
|
|
93
75
|
height: 20
|
|
94
|
-
}), /* @__PURE__ */ t("span", { children:
|
|
95
|
-
}) : /* @__PURE__ */ t(
|
|
76
|
+
}), /* @__PURE__ */ t("span", { children: N })]
|
|
77
|
+
}) : /* @__PURE__ */ t(A, {
|
|
96
78
|
disablePadding: !0,
|
|
97
|
-
children:
|
|
98
|
-
if (
|
|
99
|
-
const
|
|
100
|
-
return
|
|
79
|
+
children: i.map((e, p) => {
|
|
80
|
+
if (S(e)) {
|
|
81
|
+
const o = e.component(l.row, r);
|
|
82
|
+
return g.isValidElement(o) ? /* @__PURE__ */ t(g.Fragment, { children: o }, p) : null;
|
|
101
83
|
}
|
|
102
|
-
return e.hide ? null : /* @__PURE__ */ t(
|
|
84
|
+
return e.hide ? null : e.disabled && e.tooltipTitle ? /* @__PURE__ */ t(h, {
|
|
85
|
+
className: e.className,
|
|
86
|
+
disabled: !0,
|
|
87
|
+
disabledReason: e.tooltipTitle,
|
|
88
|
+
reasonPlacement: e.tooltipPlacement ?? "left",
|
|
89
|
+
onMouseDown: (o) => {
|
|
90
|
+
o.stopPropagation(), o.preventDefault();
|
|
91
|
+
},
|
|
92
|
+
onMouseUp: (o) => {
|
|
93
|
+
o.stopPropagation(), o.preventDefault();
|
|
94
|
+
},
|
|
95
|
+
children: e.label
|
|
96
|
+
}, p) : /* @__PURE__ */ t(f, {
|
|
103
97
|
title: e?.tooltipTitle,
|
|
104
98
|
arrow: !0,
|
|
105
99
|
placement: e?.tooltipPlacement ?? "left",
|
|
106
|
-
children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(
|
|
100
|
+
children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(h, {
|
|
107
101
|
className: e.className,
|
|
108
102
|
disabled: e.disabled,
|
|
109
103
|
onClick: () => {
|
|
110
|
-
e.disabled || e.onClick?.(
|
|
104
|
+
e.disabled || e.onClick?.(l.row);
|
|
111
105
|
},
|
|
112
|
-
onMouseDown: (
|
|
113
|
-
|
|
106
|
+
onMouseDown: (o) => {
|
|
107
|
+
o.stopPropagation(), o.preventDefault();
|
|
114
108
|
},
|
|
115
|
-
onMouseUp: (
|
|
116
|
-
|
|
109
|
+
onMouseUp: (o) => {
|
|
110
|
+
o.stopPropagation(), o.preventDefault();
|
|
117
111
|
},
|
|
118
112
|
children: e.label
|
|
119
113
|
}) })
|
|
120
|
-
},
|
|
114
|
+
}, p);
|
|
121
115
|
})
|
|
122
116
|
})
|
|
123
117
|
})]
|
|
@@ -125,5 +119,5 @@ function _({ tableData: r, actions: y, rowActionsState: T }) {
|
|
|
125
119
|
});
|
|
126
120
|
}
|
|
127
121
|
export {
|
|
128
|
-
|
|
122
|
+
q as RowActionMenu
|
|
129
123
|
};
|
|
@@ -1,18 +1,30 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { cn as y } from "../../helpers/cn.js";
|
|
2
|
+
import { StyledTooltip as d } from "../../components/data-display/tooltip/StyledTooltip.js";
|
|
3
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
4
|
+
var D = ({ children: l, disabled: e, disabledReason: o, reasonPlacement: p = "left", selected: m, className: u, classes: s, onClick: r, onMouseDown: c, onMouseUp: f }) => {
|
|
5
|
+
const x = (t) => {
|
|
6
|
+
e || (t.key === "Enter" || t.key === " ") && (t.preventDefault(), r?.(t));
|
|
7
|
+
}, n = !!e && !!o, a = /* @__PURE__ */ i("li", {
|
|
8
|
+
role: "menuitem",
|
|
9
|
+
"aria-disabled": e ? !0 : void 0,
|
|
10
|
+
"data-has-reason": n || void 0,
|
|
11
|
+
tabIndex: -1,
|
|
12
|
+
onClick: e ? (t) => t.stopPropagation() : r,
|
|
13
|
+
onKeyDown: x,
|
|
14
|
+
onMouseDown: c,
|
|
15
|
+
onMouseUp: f,
|
|
16
|
+
className: y("box-border flex min-h-10 items-center px-3 py-2 text-base text-delta-700 outline-none", e ? "cursor-not-allowed" : "cursor-pointer hover:bg-delta-50", m && "bg-gama-50", s?.root, u, e && "aria-disabled:text-delta-300"),
|
|
17
|
+
children: l
|
|
18
|
+
});
|
|
19
|
+
return n ? /* @__PURE__ */ i(d, {
|
|
20
|
+
title: o,
|
|
21
|
+
arrow: !0,
|
|
22
|
+
placement: p,
|
|
23
|
+
openOnTap: !0,
|
|
24
|
+
persistentDescription: !0,
|
|
25
|
+
children: a
|
|
26
|
+
}) : a;
|
|
27
|
+
};
|
|
16
28
|
export {
|
|
17
|
-
|
|
29
|
+
D as StyledMenuItem
|
|
18
30
|
};
|