asma-ui-core 3.20.1 → 3.21.1
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/inputs/input-field/StyledInputField.js +6 -6
- package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +26 -23
- package/dist/components/utils/accordion/base-ui/StyledAccordionSummary.js +20 -18
- package/dist/src/table/components/columns/action-column/actionColumn.d.ts +1 -1
- package/dist/src/table/components/columns/action-column/components/HeaderActionMenu.d.ts +1 -1
- package/dist/src/table/components/columns/action-column/components/RowActionMenu.d.ts +1 -1
- package/dist/src/table/components/columns/selectColumn.d.ts +2 -2
- package/dist/src/table/types.d.ts +5 -1
- package/dist/table/components/StyledTable.module.js +51 -50
- package/dist/table/components/StyledTableIndex.js +67 -68
- package/dist/table/components/columns/selectColumn.js +52 -23
- package/dist/table/helpers/injectColumns.js +6 -6
- package/package.json +1 -1
|
@@ -1,59 +1,88 @@
|
|
|
1
|
-
import { SELECT_COLUMN_ID as
|
|
2
|
-
import
|
|
3
|
-
import { StyledCheckbox as
|
|
4
|
-
import { StyledTooltip as
|
|
5
|
-
import { jsx as
|
|
6
|
-
|
|
1
|
+
import { SELECT_COLUMN_ID as u } from "../../types.js";
|
|
2
|
+
import m from "../StyledTable.module.js";
|
|
3
|
+
import { StyledCheckbox as n } from "../../shared-components/StyledCheckbox.js";
|
|
4
|
+
import { StyledTooltip as p } from "../../shared-components/tooltip/index.js";
|
|
5
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
6
|
+
var s = (t) => {
|
|
7
|
+
t.preventDefault(), t.stopPropagation();
|
|
8
|
+
}, i = (t, o) => {
|
|
9
|
+
t.key !== "Enter" && t.key !== " " || (t.preventDefault(), t.stopPropagation(), o());
|
|
10
|
+
}, w = (t) => t === "no" ? {
|
|
11
|
+
selectAll: "Velg alle rader",
|
|
12
|
+
selectRow: (o) => `Velg rad ${o}`
|
|
13
|
+
} : {
|
|
14
|
+
selectAll: "Select all rows",
|
|
15
|
+
selectRow: (o) => `Select row ${o}`
|
|
16
|
+
};
|
|
17
|
+
function k(t, o, c) {
|
|
18
|
+
const a = w(c);
|
|
7
19
|
return {
|
|
8
|
-
id:
|
|
20
|
+
id: u,
|
|
9
21
|
minSize: 38,
|
|
10
22
|
maxSize: 38,
|
|
11
23
|
size: 38,
|
|
12
|
-
header: ({ table: e }) => /* @__PURE__ */
|
|
13
|
-
|
|
24
|
+
header: ({ table: e }) => /* @__PURE__ */ r("div", {
|
|
25
|
+
role: "checkbox",
|
|
26
|
+
tabIndex: 0,
|
|
27
|
+
"aria-label": a.selectAll,
|
|
28
|
+
"aria-checked": e.getIsSomeRowsSelected() ? "mixed" : e.getIsAllRowsSelected(),
|
|
14
29
|
className: "flex size-full items-center justify-start pl-2",
|
|
15
30
|
onClick: () => e.toggleAllRowsSelected(),
|
|
16
|
-
|
|
31
|
+
onMouseDown: s,
|
|
32
|
+
onMouseUp: s,
|
|
33
|
+
onKeyDown: (l) => i(l, () => e.toggleAllRowsSelected()),
|
|
34
|
+
children: /* @__PURE__ */ r(n, {
|
|
17
35
|
size: "small",
|
|
18
36
|
dataTest: "cell-select-all",
|
|
37
|
+
"aria-hidden": !0,
|
|
38
|
+
tabIndex: -1,
|
|
19
39
|
checked: e.getIsAllRowsSelected(),
|
|
20
40
|
indeterminate: e.getIsSomeRowsSelected(),
|
|
41
|
+
className: "pointer-events-none",
|
|
21
42
|
hideWrapper: !0
|
|
22
43
|
})
|
|
23
44
|
}),
|
|
24
45
|
cell: ({ cell: e }) => {
|
|
25
46
|
const l = !e.row.getCanSelect();
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
47
|
+
return /* @__PURE__ */ r("div", {
|
|
48
|
+
role: "checkbox",
|
|
49
|
+
tabIndex: l ? -1 : 0,
|
|
50
|
+
"aria-label": a.selectRow(e.row.index + 1),
|
|
51
|
+
"aria-checked": e.row.getIsSelected(),
|
|
30
52
|
"aria-disabled": l,
|
|
53
|
+
style: { height: o ?? "auto" },
|
|
54
|
+
className: "m-0 flex w-full items-center justify-start p-0 pl-2",
|
|
31
55
|
onClick: () => {
|
|
32
56
|
l || e.row.toggleSelected();
|
|
33
57
|
},
|
|
34
|
-
|
|
58
|
+
onMouseDown: s,
|
|
59
|
+
onMouseUp: s,
|
|
60
|
+
onKeyDown: (d) => {
|
|
61
|
+
l || i(d, () => e.row.toggleSelected());
|
|
62
|
+
},
|
|
63
|
+
children: /* @__PURE__ */ r(p, {
|
|
35
64
|
arrow: !0,
|
|
36
65
|
placement: "top-start",
|
|
37
66
|
title: e.row.getRowSelectionTooltip(),
|
|
38
|
-
children: /* @__PURE__ */
|
|
39
|
-
className: l ?
|
|
40
|
-
children: /* @__PURE__ */
|
|
67
|
+
children: /* @__PURE__ */ r("span", {
|
|
68
|
+
className: l ? m["cursor-not-allowed"] : void 0,
|
|
69
|
+
children: /* @__PURE__ */ r(n, {
|
|
41
70
|
size: "small",
|
|
42
71
|
dataTest: "cell-select",
|
|
72
|
+
"aria-hidden": !0,
|
|
73
|
+
tabIndex: -1,
|
|
43
74
|
checked: e.row.getIsSelected(),
|
|
44
75
|
hideWrapper: !0,
|
|
45
76
|
disabled: l,
|
|
46
|
-
|
|
47
|
-
o.preventDefault(), o.stopPropagation();
|
|
48
|
-
}
|
|
77
|
+
className: "pointer-events-none"
|
|
49
78
|
})
|
|
50
79
|
})
|
|
51
80
|
})
|
|
52
81
|
});
|
|
53
82
|
},
|
|
54
|
-
fixedLeft:
|
|
83
|
+
fixedLeft: t
|
|
55
84
|
};
|
|
56
85
|
}
|
|
57
86
|
export {
|
|
58
|
-
|
|
87
|
+
k as selectColumn
|
|
59
88
|
};
|
|
@@ -4,17 +4,17 @@ import { generateExpandColumn as h } from "../components/columns/expandColumn.js
|
|
|
4
4
|
import { generateActionsColumn as x } from "../components/columns/action-column/actionColumn.js";
|
|
5
5
|
import { generateDndHandleColumn as _ } from "../components/columns/dndHandleColumn.js";
|
|
6
6
|
import { generateShowFullTextColumn as A } from "../components/columns/showTextColumn.js";
|
|
7
|
-
var T = (
|
|
8
|
-
const { columns: o, actions: i, customActionsNode: r, headerPin: d = !0, enableRowSelection:
|
|
7
|
+
var T = (f) => {
|
|
8
|
+
const { columns: o, actions: i, customActionsNode: r, headerPin: d = !0, enableRowSelection: l, expandArrow: u, enableDnd: a, customDndColumnProps: c, rowHeight: e, textExpandArrow: m, customActionsColumnProps: p, rowActionsState: C, locale: s } = f, t = o.some((n) => n.fixedLeft === !0);
|
|
9
9
|
!o.find((n) => n.id === "actions") && (i || r || d) && o.push(x({
|
|
10
10
|
headerPin: d,
|
|
11
11
|
actions: i,
|
|
12
12
|
customActionsNode: r,
|
|
13
13
|
rowHeight: e,
|
|
14
|
-
customActionsColumnProps:
|
|
15
|
-
rowActionsState:
|
|
16
|
-
locale:
|
|
17
|
-
})), m && !o.find((n) => n.id === "show-full-text") && o.unshift(A(t, e)),
|
|
14
|
+
customActionsColumnProps: p,
|
|
15
|
+
rowActionsState: C,
|
|
16
|
+
locale: s
|
|
17
|
+
})), m && !o.find((n) => n.id === "show-full-text") && o.unshift(A(t, e)), u && !m && !o.find((n) => n.id === "expand-column-id") && o.unshift(h(t, e)), a && !o.find((n) => n.id === "dnd-handle") && o.unshift(_(c, e)), l && !o.find((n) => n.id === "select") && o.unshift(D(t, e, s));
|
|
18
18
|
};
|
|
19
19
|
export {
|
|
20
20
|
T as injectColumns
|