asma-ui-core 3.107.1 → 3.107.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.
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
import { cn as u } from "../../../helpers/cn.js";
|
|
2
|
-
import { StyledSelectItem as
|
|
3
|
-
import { useEffect as
|
|
4
|
-
import { jsx as l, jsxs as
|
|
5
|
-
var
|
|
6
|
-
const a =
|
|
7
|
-
return
|
|
8
|
-
s !== null && a.current?.querySelector(`#${CSS.escape(
|
|
2
|
+
import { StyledSelectItem as x } from "../select/StyledSelectItem.js";
|
|
3
|
+
import { useEffect as w, useRef as b } from "react";
|
|
4
|
+
import { jsx as l, jsxs as r } from "react/jsx-runtime";
|
|
5
|
+
var g = ({ dataTest: o, visible: n, selectedIso2: m, activeIndex: s, optionId: t, onSelect: c, listId: f, label: d, renderFlag: p, className: h }) => {
|
|
6
|
+
const a = b(null);
|
|
7
|
+
return w(() => {
|
|
8
|
+
s !== null && a.current?.querySelector(`#${CSS.escape(t(s))}`)?.scrollIntoView({ block: "nearest" });
|
|
9
9
|
}), /* @__PURE__ */ l("ul", {
|
|
10
10
|
ref: a,
|
|
11
|
-
id:
|
|
11
|
+
id: f,
|
|
12
12
|
role: "listbox",
|
|
13
|
-
"aria-label":
|
|
13
|
+
"aria-label": d,
|
|
14
14
|
"data-testid": `${o}-listbox`,
|
|
15
|
-
className: u("m-0 min-h-0 flex-1 list-none overflow-y-auto p-0",
|
|
16
|
-
children:
|
|
17
|
-
id:
|
|
18
|
-
selected: e.iso2 ===
|
|
19
|
-
active:
|
|
15
|
+
className: u("m-0 min-h-0 flex-1 list-none overflow-y-auto p-0", "[&>li:not(:last-child)]:shadow-[inset_0_-1px_0_var(--colors-delta-200)]", h),
|
|
16
|
+
children: n.map((e, i) => /* @__PURE__ */ l(x, {
|
|
17
|
+
id: t(i),
|
|
18
|
+
selected: e.iso2 === m,
|
|
19
|
+
active: i === s,
|
|
20
20
|
onClick: () => c(e.iso2),
|
|
21
|
-
|
|
22
|
-
children: /* @__PURE__ */ i("span", {
|
|
21
|
+
children: /* @__PURE__ */ r("span", {
|
|
23
22
|
className: "flex w-full items-center justify-between gap-2",
|
|
24
|
-
children: [/* @__PURE__ */
|
|
23
|
+
children: [/* @__PURE__ */ r("span", {
|
|
25
24
|
className: "flex min-w-0 items-center gap-2",
|
|
26
25
|
children: [p?.(e.iso2, "eager"), /* @__PURE__ */ l("span", {
|
|
27
26
|
className: "truncate",
|
|
@@ -36,5 +35,5 @@ var j = ({ dataTest: o, visible: m, selectedIso2: n, activeIndex: s, optionId: r
|
|
|
36
35
|
});
|
|
37
36
|
};
|
|
38
37
|
export {
|
|
39
|
-
|
|
38
|
+
g as CountryCodeOptions
|
|
40
39
|
};
|
|
@@ -149,7 +149,7 @@ var re = ({ dataTest: r, countries: g, value: s, onChange: A, disabled: c, selec
|
|
|
149
149
|
anchorEl: B,
|
|
150
150
|
onClose: e.dismiss,
|
|
151
151
|
tabIntoContent: !1,
|
|
152
|
-
slotProps: { paper: { className: "flex max-h-80 w-80 flex-col overflow-hidden" } },
|
|
152
|
+
slotProps: { paper: { className: "flex max-h-80 w-80 flex-col overflow-hidden py-2" } },
|
|
153
153
|
children: N
|
|
154
154
|
})] });
|
|
155
155
|
};
|
|
@@ -10,8 +10,8 @@ import { StyledMenuItem as h } from "../../../../shared-components/StyledMenuIte
|
|
|
10
10
|
import g, { useMemo as O } from "react";
|
|
11
11
|
import { jsx as t, jsxs as b } from "react/jsx-runtime";
|
|
12
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" },
|
|
14
|
-
if (!(n.state !== "hidden" && (
|
|
13
|
+
const { anchorEl: P, open: s, handleClose: r, handleOpen: x } = j(), i = v(l.row), n = w?.(l.row) ?? { state: "enabled" }, c = l.table.options.meta?.locale, N = c === "no" ? "Ingen handlinger tilgjengelig" : "No actions available", C = c === "no" ? "Radhandlinger" : "Row actions", M = O(() => i.every((e) => "component" in e ? !1 : e.hide), [i]), d = i.length > 0 && !M, m = n.state === "enabled" && !d;
|
|
14
|
+
if (!(n.state !== "hidden" && (d || m || n.state === "disabled"))) return /* @__PURE__ */ t("div", { className: "flex w-[40px] items-center justify-center" });
|
|
15
15
|
const a = n.state === "disabled", u = /* @__PURE__ */ t(k, {
|
|
16
16
|
dataTest: "row-actions-button",
|
|
17
17
|
"aria-label": C,
|
|
@@ -74,18 +74,33 @@ function q({ tableData: l, actions: v, rowActionsState: w }) {
|
|
|
74
74
|
width: 20,
|
|
75
75
|
height: 20
|
|
76
76
|
}), /* @__PURE__ */ t("span", { children: N })]
|
|
77
|
-
}) : /* @__PURE__ */ t(A, {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
77
|
+
}) : /* @__PURE__ */ t(A, { children: i.map((e, p) => {
|
|
78
|
+
if (S(e)) {
|
|
79
|
+
const o = e.component(l.row, r);
|
|
80
|
+
return g.isValidElement(o) ? /* @__PURE__ */ t(g.Fragment, { children: o }, p) : null;
|
|
81
|
+
}
|
|
82
|
+
return e.hide ? null : e.disabled && e.tooltipTitle ? /* @__PURE__ */ t(h, {
|
|
83
|
+
className: e.className,
|
|
84
|
+
disabled: !0,
|
|
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
99
|
className: e.className,
|
|
86
|
-
disabled:
|
|
87
|
-
|
|
88
|
-
|
|
100
|
+
disabled: e.disabled,
|
|
101
|
+
onClick: () => {
|
|
102
|
+
e.disabled || e.onClick?.(l.row);
|
|
103
|
+
},
|
|
89
104
|
onMouseDown: (o) => {
|
|
90
105
|
o.stopPropagation(), o.preventDefault();
|
|
91
106
|
},
|
|
@@ -93,27 +108,9 @@ function q({ tableData: l, actions: v, rowActionsState: w }) {
|
|
|
93
108
|
o.stopPropagation(), o.preventDefault();
|
|
94
109
|
},
|
|
95
110
|
children: e.label
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
placement: e?.tooltipPlacement ?? "left",
|
|
100
|
-
children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(h, {
|
|
101
|
-
className: e.className,
|
|
102
|
-
disabled: e.disabled,
|
|
103
|
-
onClick: () => {
|
|
104
|
-
e.disabled || e.onClick?.(l.row);
|
|
105
|
-
},
|
|
106
|
-
onMouseDown: (o) => {
|
|
107
|
-
o.stopPropagation(), o.preventDefault();
|
|
108
|
-
},
|
|
109
|
-
onMouseUp: (o) => {
|
|
110
|
-
o.stopPropagation(), o.preventDefault();
|
|
111
|
-
},
|
|
112
|
-
children: e.label
|
|
113
|
-
}) })
|
|
114
|
-
}, p);
|
|
115
|
-
})
|
|
116
|
-
})
|
|
111
|
+
}) })
|
|
112
|
+
}, p);
|
|
113
|
+
}) })
|
|
117
114
|
})]
|
|
118
115
|
})
|
|
119
116
|
});
|