asma-ui-core 3.104.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 +62 -43
- 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 -52
- package/dist/components/data-display/tooltip/StyledTooltip.js +110 -65
- package/dist/components/feedback/dialog/DialogBusyContext.js +32 -0
- package/dist/components/feedback/dialog/StyledDialog.js +104 -80
- 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 +8 -8
- package/dist/components/inputs/dynamic-select/components/DynamicInteractiveChipGroup.js +32 -32
- package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +91 -82
- package/dist/components/inputs/select/StyledSelect.js +8 -8
- package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +152 -152
- 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/menu/StyledMenuList.js +47 -38
- package/dist/components/navigation/tabs/StyledTab.js +25 -18
- package/dist/components/navigation/tabs/StyledTabs.js +33 -33
- 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 +4 -3
- package/dist/helpers/warnUnnamedDialog.js +6 -0
- 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 +15 -2
- package/dist/src/components/feedback/dialog/dialog-footer/StyledDialogFooter.d.ts +10 -7
- 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/menu/StyledMenuList.d.ts +2 -1
- package/dist/src/components/navigation/tabs/StyledTab.d.ts +17 -1
- package/dist/src/forms/submitChanged.d.ts +3 -0
- package/dist/src/helpers/focusable.d.ts +9 -0
- package/dist/src/helpers/index.d.ts +1 -0
- package/dist/src/helpers/uiCoreLocale.d.ts +1 -0
- package/dist/src/helpers/warnUnnamedDialog.d.ts +5 -0
- package/dist/src/table/shared-components/StyledMenuItem.d.ts +5 -1
- package/dist/table/components/columns/action-column/components/RowActionMenu.js +57 -50
- package/dist/table/shared-components/StyledMenuItem.js +28 -16
- package/dist/table/shared-components/button/StyledButton.module.js +11 -11
- package/package.json +1 -1
|
@@ -1,31 +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
|
|
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
11
|
import { jsx as t, jsxs as b } from "react/jsx-runtime";
|
|
12
|
-
function
|
|
13
|
-
const { anchorEl:
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
const e = window.setTimeout(() => s(!1), 1600);
|
|
17
|
-
return () => window.clearTimeout(e);
|
|
18
|
-
}, [c]), !M) return /* @__PURE__ */ t("div", { className: "flex w-[40px] items-center justify-center" });
|
|
19
|
-
const p = o.state === "disabled", f = /* @__PURE__ */ t(I, {
|
|
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, {
|
|
20
16
|
dataTest: "row-actions-button",
|
|
21
|
-
"aria-label":
|
|
17
|
+
"aria-label": C,
|
|
22
18
|
"aria-haspopup": "true",
|
|
23
|
-
"aria-expanded":
|
|
19
|
+
"aria-expanded": s,
|
|
24
20
|
variant: "text",
|
|
25
21
|
size: "small",
|
|
26
|
-
disabled:
|
|
22
|
+
"aria-disabled": a || void 0,
|
|
27
23
|
onClick: (e) => {
|
|
28
|
-
e.stopPropagation(), e.preventDefault(), !
|
|
24
|
+
e.stopPropagation(), e.preventDefault(), !a && (e.currentTarget.focus({ preventScroll: !0 }), s ? r() : x(e));
|
|
29
25
|
},
|
|
30
26
|
onMouseDown: (e) => {
|
|
31
27
|
e.stopPropagation(), e.preventDefault();
|
|
@@ -33,8 +29,8 @@ function X({ tableData: l, actions: v, rowActionsState: x }) {
|
|
|
33
29
|
onMouseUp: (e) => {
|
|
34
30
|
e.stopPropagation(), e.preventDefault();
|
|
35
31
|
},
|
|
36
|
-
children: /* @__PURE__ */ t(
|
|
37
|
-
className:
|
|
32
|
+
children: /* @__PURE__ */ t(y, {
|
|
33
|
+
className: a ? "text-delta-300" : "text-delta-700",
|
|
38
34
|
width: 20,
|
|
39
35
|
height: 20
|
|
40
36
|
})
|
|
@@ -43,26 +39,25 @@ function X({ tableData: l, actions: v, rowActionsState: x }) {
|
|
|
43
39
|
className: "flex w-[40px] items-center justify-center",
|
|
44
40
|
children: /* @__PURE__ */ b("div", {
|
|
45
41
|
className: "flex items-center justify-center",
|
|
46
|
-
children: [
|
|
47
|
-
title:
|
|
42
|
+
children: [n.state === "disabled" ? /* @__PURE__ */ t(f, {
|
|
43
|
+
title: n.tooltipTitle,
|
|
48
44
|
arrow: !0,
|
|
49
|
-
placement:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
onClose: () => s(!1),
|
|
45
|
+
placement: n.tooltipPlacement ?? "top",
|
|
46
|
+
openOnTap: !0,
|
|
47
|
+
persistentDescription: !0,
|
|
53
48
|
children: /* @__PURE__ */ t("span", {
|
|
54
49
|
className: "cursor-not-allowed",
|
|
55
50
|
onTouchStart: (e) => {
|
|
56
|
-
e.stopPropagation(), e.preventDefault()
|
|
51
|
+
e.stopPropagation(), e.preventDefault();
|
|
57
52
|
},
|
|
58
53
|
onClick: (e) => {
|
|
59
54
|
e.stopPropagation(), e.preventDefault();
|
|
60
55
|
},
|
|
61
|
-
children:
|
|
56
|
+
children: u
|
|
62
57
|
})
|
|
63
|
-
}) :
|
|
64
|
-
open:
|
|
65
|
-
anchorEl:
|
|
58
|
+
}) : u, n.state === "enabled" && /* @__PURE__ */ t(T, {
|
|
59
|
+
open: s,
|
|
60
|
+
anchorEl: P,
|
|
66
61
|
onClose: r,
|
|
67
62
|
onClick: r,
|
|
68
63
|
anchorOrigin: {
|
|
@@ -75,36 +70,48 @@ function X({ tableData: l, actions: v, rowActionsState: x }) {
|
|
|
75
70
|
},
|
|
76
71
|
children: m ? /* @__PURE__ */ b("div", {
|
|
77
72
|
className: "flex items-center gap-2 p-3 text-base text-delta-700",
|
|
78
|
-
children: [/* @__PURE__ */ t(
|
|
73
|
+
children: [/* @__PURE__ */ t(D, {
|
|
79
74
|
width: 20,
|
|
80
75
|
height: 20
|
|
81
|
-
}), /* @__PURE__ */ t("span", { children:
|
|
82
|
-
}) : /* @__PURE__ */ t(
|
|
76
|
+
}), /* @__PURE__ */ t("span", { children: N })]
|
|
77
|
+
}) : /* @__PURE__ */ t(A, {
|
|
83
78
|
disablePadding: !0,
|
|
84
|
-
children: i.map((e,
|
|
85
|
-
if (
|
|
86
|
-
const
|
|
87
|
-
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;
|
|
88
83
|
}
|
|
89
|
-
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, {
|
|
90
97
|
title: e?.tooltipTitle,
|
|
91
98
|
arrow: !0,
|
|
92
99
|
placement: e?.tooltipPlacement ?? "left",
|
|
93
|
-
children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(
|
|
100
|
+
children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(h, {
|
|
94
101
|
className: e.className,
|
|
95
102
|
disabled: e.disabled,
|
|
96
103
|
onClick: () => {
|
|
97
104
|
e.disabled || e.onClick?.(l.row);
|
|
98
105
|
},
|
|
99
|
-
onMouseDown: (
|
|
100
|
-
|
|
106
|
+
onMouseDown: (o) => {
|
|
107
|
+
o.stopPropagation(), o.preventDefault();
|
|
101
108
|
},
|
|
102
|
-
onMouseUp: (
|
|
103
|
-
|
|
109
|
+
onMouseUp: (o) => {
|
|
110
|
+
o.stopPropagation(), o.preventDefault();
|
|
104
111
|
},
|
|
105
112
|
children: e.label
|
|
106
113
|
}) })
|
|
107
|
-
},
|
|
114
|
+
}, p);
|
|
108
115
|
})
|
|
109
116
|
})
|
|
110
117
|
})]
|
|
@@ -112,5 +119,5 @@ function X({ tableData: l, actions: v, rowActionsState: x }) {
|
|
|
112
119
|
});
|
|
113
120
|
}
|
|
114
121
|
export {
|
|
115
|
-
|
|
122
|
+
q as RowActionMenu
|
|
116
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
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
"asma-core-ui-button": "_asma-core-ui-
|
|
3
|
-
contained:
|
|
4
|
-
common:
|
|
5
|
-
medium:
|
|
1
|
+
var a = "_contained_awucv_6", _ = "_common_awucv_6", t = "_medium_awucv_56", e = "_small_awucv_61", r = "_large_awucv_66", u = "_error_awucv_76", v = "_outlined_awucv_146", c = "_text_awucv_286", o = "_textGray_awucv_426", m = "_textWhite_awucv_496", l = {
|
|
2
|
+
"asma-core-ui-button": "_asma-core-ui-button_awucv_1",
|
|
3
|
+
contained: a,
|
|
4
|
+
common: _,
|
|
5
|
+
medium: t,
|
|
6
6
|
small: e,
|
|
7
|
-
large:
|
|
8
|
-
error:
|
|
9
|
-
outlined:
|
|
10
|
-
text:
|
|
11
|
-
textGray:
|
|
12
|
-
textWhite:
|
|
7
|
+
large: r,
|
|
8
|
+
error: u,
|
|
9
|
+
outlined: v,
|
|
10
|
+
text: c,
|
|
11
|
+
textGray: o,
|
|
12
|
+
textWhite: m
|
|
13
13
|
};
|
|
14
14
|
export {
|
|
15
15
|
l as default
|