asma-ui-core 3.58.2 → 3.58.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.
@@ -4,28 +4,28 @@ import { isCustomAction as O } from "../../../../types.js";
4
4
  import { StyledTooltip as g } from "../../../../shared-components/tooltip/index.js";
5
5
  import { useToggleMenuVisibility as j } from "../../../../hooks/useToggleMenuVisibility.hook.js";
6
6
  import { StyledButton as k } from "../../../../shared-components/button/StyledButton.js";
7
- import { DotsVerticalIcon as D } from "../../../../shared-components/DotsVerticalIcon.js";
8
- import { StyledMenuItem as F } from "../../../../shared-components/StyledMenuItem.js";
9
- import { CircleWarningOutlineIcon as I } from "../../../../shared-components/CircleWarningOutlineIcon.js";
10
- import w, { useEffect as R, useMemo as V, useState as z } from "react";
7
+ import { DotsVerticalIcon as F } from "../../../../shared-components/DotsVerticalIcon.js";
8
+ import { StyledMenuItem as I } from "../../../../shared-components/StyledMenuItem.js";
9
+ import { CircleWarningOutlineIcon as R } from "../../../../shared-components/CircleWarningOutlineIcon.js";
10
+ import w, { useEffect as V, useMemo as z, useState as D } from "react";
11
11
  import { jsx as t, jsxs as b } from "react/jsx-runtime";
12
12
  function X({ tableData: o, actions: v, rowActionsState: C }) {
13
- const { anchorEl: x, open: d, handleClose: s, handleOpen: P } = j(), i = v(o.row), n = C?.(o.row) ?? { state: "enabled" }, p = o.table.options.meta?.locale, y = p === "no" ? "Ingen handlinger tilgjengelig" : "No actions available", N = p === "no" ? "Radhandlinger" : "Row actions", T = V(() => i.every((e) => "component" in e ? !1 : e.hide), [i]), u = i.length > 0 && !T, m = n.state === "enabled" && !u, M = n.state !== "hidden" && (u || m || n.state === "disabled"), [a, l] = z(!1);
14
- if (R(() => {
15
- if (!a) return;
16
- const e = window.setTimeout(() => l(!1), 1600);
13
+ const { anchorEl: x, open: a, handleClose: i, handleOpen: P } = j(), l = v(o.row), n = C?.(o.row) ?? { state: "enabled" }, p = o.table.options.meta?.locale, y = p === "no" ? "Ingen handlinger tilgjengelig" : "No actions available", N = p === "no" ? "Radhandlinger" : "Row actions", T = z(() => l.every((e) => "component" in e ? !1 : e.hide), [l]), u = l.length > 0 && !T, m = n.state === "enabled" && !u, M = n.state !== "hidden" && (u || m || n.state === "disabled"), [c, s] = D(!1);
14
+ if (V(() => {
15
+ if (!c) return;
16
+ const e = window.setTimeout(() => s(!1), 1600);
17
17
  return () => window.clearTimeout(e);
18
- }, [a]), !M) return /* @__PURE__ */ t("div", { className: "flex w-[40px] items-center justify-center" });
19
- const c = n.state === "disabled", f = /* @__PURE__ */ t(k, {
18
+ }, [c]), !M) return /* @__PURE__ */ t("div", { className: "flex w-[40px] items-center justify-center" });
19
+ const d = n.state === "disabled", f = /* @__PURE__ */ t(k, {
20
20
  dataTest: "row-actions-button",
21
21
  "aria-label": N,
22
22
  "aria-haspopup": "true",
23
- "aria-expanded": d,
23
+ "aria-expanded": a,
24
24
  variant: "text",
25
25
  size: "small",
26
- disabled: c,
26
+ disabled: d,
27
27
  onClick: (e) => {
28
- e.stopPropagation(), e.preventDefault(), !c && (P(e), o.row.onChangeFocused(!0));
28
+ e.stopPropagation(), e.preventDefault(), !d && (a ? (i(), o.row.onChangeFocused(!1)) : (P(e), o.row.onChangeFocused(!0)));
29
29
  },
30
30
  onMouseDown: (e) => {
31
31
  e.stopPropagation(), e.preventDefault();
@@ -33,8 +33,8 @@ function X({ tableData: o, actions: v, rowActionsState: C }) {
33
33
  onMouseUp: (e) => {
34
34
  e.stopPropagation(), e.preventDefault();
35
35
  },
36
- children: /* @__PURE__ */ t(D, {
37
- className: c ? "text-delta-300" : "text-delta-700",
36
+ children: /* @__PURE__ */ t(F, {
37
+ className: d ? "text-delta-300" : "text-delta-700",
38
38
  width: 20,
39
39
  height: 20
40
40
  })
@@ -47,13 +47,13 @@ function X({ tableData: o, actions: v, rowActionsState: C }) {
47
47
  title: n.tooltipTitle,
48
48
  arrow: !0,
49
49
  placement: n.tooltipPlacement ?? "top",
50
- open: a,
51
- onOpen: () => l(!0),
52
- onClose: () => l(!1),
50
+ open: c,
51
+ onOpen: () => s(!0),
52
+ onClose: () => s(!1),
53
53
  children: /* @__PURE__ */ t("span", {
54
54
  className: "cursor-not-allowed",
55
55
  onTouchStart: (e) => {
56
- e.stopPropagation(), e.preventDefault(), l(!0);
56
+ e.stopPropagation(), e.preventDefault(), s(!0);
57
57
  },
58
58
  onClick: (e) => {
59
59
  e.stopPropagation(), e.preventDefault();
@@ -61,40 +61,40 @@ function X({ tableData: o, actions: v, rowActionsState: C }) {
61
61
  children: f
62
62
  })
63
63
  }) : f, n.state === "enabled" && /* @__PURE__ */ t(S, {
64
- open: d,
64
+ open: a,
65
65
  anchorEl: x,
66
66
  onClose: () => {
67
- s(), o.row.onChangeFocused(!1);
67
+ i(), o.row.onChangeFocused(!1);
68
68
  },
69
69
  onClick: () => {
70
- s(), o.row.onChangeFocused(!1);
70
+ i(), o.row.onChangeFocused(!1);
71
71
  },
72
72
  anchorOrigin: {
73
- horizontal: "center",
73
+ horizontal: "right",
74
74
  vertical: "bottom"
75
75
  },
76
76
  transformOrigin: {
77
- vertical: "top",
78
- horizontal: "right"
77
+ horizontal: "right",
78
+ vertical: "top"
79
79
  },
80
80
  children: m ? /* @__PURE__ */ b("div", {
81
81
  className: "flex items-center gap-2 p-3 text-base text-delta-700",
82
- children: [/* @__PURE__ */ t(I, {
82
+ children: [/* @__PURE__ */ t(R, {
83
83
  width: 20,
84
84
  height: 20
85
85
  }), /* @__PURE__ */ t("span", { children: y })]
86
86
  }) : /* @__PURE__ */ t(A, {
87
87
  disablePadding: !0,
88
- children: i.map((e, h) => {
88
+ children: l.map((e, h) => {
89
89
  if (O(e)) {
90
- const r = e.component(o.row, s);
90
+ const r = e.component(o.row, i);
91
91
  return w.isValidElement(r) ? /* @__PURE__ */ t(w.Fragment, { children: r }, h) : null;
92
92
  }
93
93
  return e.hide ? null : /* @__PURE__ */ t(g, {
94
94
  title: e?.tooltipTitle,
95
95
  arrow: !0,
96
96
  placement: e?.tooltipPlacement ?? "left",
97
- children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(F, {
97
+ children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(I, {
98
98
  className: e.className,
99
99
  disabled: e.disabled,
100
100
  onClick: () => {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.58.2",
6
+ "version": "3.58.3",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",