asma-ui-core 3.50.0 → 3.51.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/ToolbarRows.js +50 -49
- package/dist/components/inputs/search-field/StyledSearchField.js +8 -8
- package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +45 -45
- package/dist/hooks/useFocusTrap.hook.js +18 -18
- package/dist/table/components/StyledTable.module.js +55 -54
- package/dist/table/components/columns/selectColumn.js +33 -33
- package/package.json +1 -1
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { SELECT_COLUMN_ID as
|
|
2
|
-
import
|
|
3
|
-
import { StyledCheckbox as
|
|
4
|
-
import { StyledTooltip as
|
|
1
|
+
import { SELECT_COLUMN_ID as p } from "../../types.js";
|
|
2
|
+
import s from "../StyledTable.module.js";
|
|
3
|
+
import { StyledCheckbox as c } from "../../shared-components/StyledCheckbox.js";
|
|
4
|
+
import { StyledTooltip as u } from "../../shared-components/tooltip/index.js";
|
|
5
5
|
import { jsx as r } from "react/jsx-runtime";
|
|
6
|
-
var
|
|
6
|
+
var a = (t) => {
|
|
7
7
|
t.preventDefault(), t.stopPropagation();
|
|
8
|
-
}, i = (t,
|
|
9
|
-
t.key !== "Enter" && t.key !== " " || (t.preventDefault(), t.stopPropagation(),
|
|
8
|
+
}, i = (t, l) => {
|
|
9
|
+
t.key !== "Enter" && t.key !== " " || (t.preventDefault(), t.stopPropagation(), l());
|
|
10
10
|
}, w = (t) => t === "no" ? {
|
|
11
11
|
selectAll: "Velg alle rader",
|
|
12
|
-
selectRow: (
|
|
12
|
+
selectRow: (l) => `Velg rad ${l}`
|
|
13
13
|
} : {
|
|
14
14
|
selectAll: "Select all rows",
|
|
15
|
-
selectRow: (
|
|
15
|
+
selectRow: (l) => `Select row ${l}`
|
|
16
16
|
};
|
|
17
|
-
function k(t,
|
|
18
|
-
const
|
|
17
|
+
function k(t, l, d) {
|
|
18
|
+
const n = w(d);
|
|
19
19
|
return {
|
|
20
|
-
id:
|
|
20
|
+
id: p,
|
|
21
21
|
minSize: 38,
|
|
22
22
|
maxSize: 38,
|
|
23
23
|
size: 38,
|
|
24
24
|
header: ({ table: e }) => /* @__PURE__ */ r("div", {
|
|
25
25
|
role: "checkbox",
|
|
26
26
|
tabIndex: 0,
|
|
27
|
-
"aria-label":
|
|
27
|
+
"aria-label": n.selectAll,
|
|
28
28
|
"aria-checked": e.getIsSomeRowsSelected() ? "mixed" : e.getIsAllRowsSelected(),
|
|
29
|
-
className: "
|
|
29
|
+
className: s["select-control"],
|
|
30
30
|
onClick: () => e.toggleAllRowsSelected(),
|
|
31
|
-
onMouseDown:
|
|
32
|
-
onMouseUp:
|
|
33
|
-
onKeyDown: (
|
|
34
|
-
children: /* @__PURE__ */ r(
|
|
31
|
+
onMouseDown: a,
|
|
32
|
+
onMouseUp: a,
|
|
33
|
+
onKeyDown: (o) => i(o, () => e.toggleAllRowsSelected()),
|
|
34
|
+
children: /* @__PURE__ */ r(c, {
|
|
35
35
|
size: "small",
|
|
36
36
|
dataTest: "cell-select-all",
|
|
37
37
|
"aria-hidden": !0,
|
|
@@ -43,37 +43,37 @@ function k(t, o, c) {
|
|
|
43
43
|
})
|
|
44
44
|
}),
|
|
45
45
|
cell: ({ cell: e }) => {
|
|
46
|
-
const
|
|
46
|
+
const o = !e.row.getCanSelect();
|
|
47
47
|
return /* @__PURE__ */ r("div", {
|
|
48
48
|
role: "checkbox",
|
|
49
|
-
tabIndex:
|
|
50
|
-
"aria-label":
|
|
49
|
+
tabIndex: o ? -1 : 0,
|
|
50
|
+
"aria-label": n.selectRow(e.row.index + 1),
|
|
51
51
|
"aria-checked": e.row.getIsSelected(),
|
|
52
|
-
"aria-disabled":
|
|
53
|
-
style: { height:
|
|
54
|
-
className: "
|
|
52
|
+
"aria-disabled": o,
|
|
53
|
+
style: { height: l ?? "auto" },
|
|
54
|
+
className: s["select-control"],
|
|
55
55
|
onClick: () => {
|
|
56
|
-
|
|
56
|
+
o || e.row.toggleSelected();
|
|
57
57
|
},
|
|
58
|
-
onMouseDown:
|
|
59
|
-
onMouseUp:
|
|
60
|
-
onKeyDown: (
|
|
61
|
-
|
|
58
|
+
onMouseDown: a,
|
|
59
|
+
onMouseUp: a,
|
|
60
|
+
onKeyDown: (m) => {
|
|
61
|
+
o || i(m, () => e.row.toggleSelected());
|
|
62
62
|
},
|
|
63
|
-
children: /* @__PURE__ */ r(
|
|
63
|
+
children: /* @__PURE__ */ r(u, {
|
|
64
64
|
arrow: !0,
|
|
65
65
|
placement: "top-start",
|
|
66
66
|
title: e.row.getRowSelectionTooltip(),
|
|
67
67
|
children: /* @__PURE__ */ r("span", {
|
|
68
|
-
className:
|
|
69
|
-
children: /* @__PURE__ */ r(
|
|
68
|
+
className: o ? s["cursor-not-allowed"] : void 0,
|
|
69
|
+
children: /* @__PURE__ */ r(c, {
|
|
70
70
|
size: "small",
|
|
71
71
|
dataTest: "cell-select",
|
|
72
72
|
"aria-hidden": !0,
|
|
73
73
|
tabIndex: -1,
|
|
74
74
|
checked: e.row.getIsSelected(),
|
|
75
75
|
hideWrapper: !0,
|
|
76
|
-
disabled:
|
|
76
|
+
disabled: o,
|
|
77
77
|
className: "pointer-events-none"
|
|
78
78
|
})
|
|
79
79
|
})
|