asma-ui-core 3.121.3 → 3.121.5
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/checkbox/base-ui/StyledCheckbox.module.js +15 -15
- package/dist/components/utils/popover/PopoverAnatomy.js +24 -27
- package/dist/table/components/TableRow.js +81 -85
- package/dist/table/components/table-header/TableHeader.js +4 -4
- package/dist/table/custom-features/focus-rows/FocusRowsFeature.js +36 -28
- package/dist/table/shared-components/StyledCheckbox.module.js +10 -10
- package/package.json +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
var
|
|
2
|
-
CheckboxWrapper:
|
|
3
|
-
"size-small": "_size-
|
|
4
|
-
"size-medium": "_size-
|
|
5
|
-
Checkbox:
|
|
6
|
-
Indeterminate:
|
|
7
|
-
Error: "
|
|
8
|
-
ReadOnly:
|
|
9
|
-
Indicator:
|
|
10
|
-
HideWrapper:
|
|
11
|
-
CheckboxHover:
|
|
12
|
-
CheckboxRippleContainer:
|
|
13
|
-
CheckboxRipple:
|
|
14
|
-
ripple:
|
|
1
|
+
var a = "_CheckboxWrapper_ajsar_1", r = "_Checkbox_ajsar_1", e = "_Indeterminate_ajsar_34", _ = "_ReadOnly_ajsar_110", o = "_Indicator_ajsar_119", p = "_HideWrapper_ajsar_123", i = "_CheckboxHover_ajsar_130", s = "_CheckboxRippleContainer_ajsar_130", l = "_CheckboxRipple_ajsar_130", d = "_ripple_ajsar_1", c = {
|
|
2
|
+
CheckboxWrapper: a,
|
|
3
|
+
"size-small": "_size-small_ajsar_17",
|
|
4
|
+
"size-medium": "_size-medium_ajsar_21",
|
|
5
|
+
Checkbox: r,
|
|
6
|
+
Indeterminate: e,
|
|
7
|
+
Error: "_Error_ajsar_61",
|
|
8
|
+
ReadOnly: _,
|
|
9
|
+
Indicator: o,
|
|
10
|
+
HideWrapper: p,
|
|
11
|
+
CheckboxHover: i,
|
|
12
|
+
CheckboxRippleContainer: s,
|
|
13
|
+
CheckboxRipple: l,
|
|
14
|
+
ripple: d
|
|
15
15
|
};
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
c as default
|
|
18
18
|
};
|
|
@@ -9,33 +9,16 @@ var g = 40, j = "relative box-border flex flex-col overflow-hidden rounded-lg bg
|
|
|
9
9
|
return /* @__PURE__ */ l(_, { children: [
|
|
10
10
|
/* @__PURE__ */ l("div", {
|
|
11
11
|
className: "relative flex min-h-0 flex-1 flex-col",
|
|
12
|
-
children: [
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
children: p
|
|
23
|
-
}),
|
|
24
|
-
/* @__PURE__ */ e("div", {
|
|
25
|
-
className: "absolute right-0 top-0",
|
|
26
|
-
children: /* @__PURE__ */ e(h, {
|
|
27
|
-
dataTest: `${a}-close`,
|
|
28
|
-
variant: "textGray",
|
|
29
|
-
type: "button",
|
|
30
|
-
"aria-label": f,
|
|
31
|
-
onClick: x,
|
|
32
|
-
startIcon: /* @__PURE__ */ e(c, {
|
|
33
|
-
width: 24,
|
|
34
|
-
height: 24
|
|
35
|
-
})
|
|
36
|
-
})
|
|
37
|
-
})
|
|
38
|
-
]
|
|
12
|
+
children: [t && /* @__PURE__ */ e("div", {
|
|
13
|
+
id: m,
|
|
14
|
+
className: "shrink-0 truncate pb-1 pl-4 pr-10 pt-2 text-lg font-semibold leading-7 text-delta-800",
|
|
15
|
+
children: t
|
|
16
|
+
}), /* @__PURE__ */ e("div", {
|
|
17
|
+
ref: n,
|
|
18
|
+
className: d("flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto py-2 pl-4 [scrollbar-gutter:stable]", !t && s.overflows && "mt-10"),
|
|
19
|
+
style: { paddingRight: Math.max(0, g - s.width) },
|
|
20
|
+
children: p
|
|
21
|
+
})]
|
|
39
22
|
}),
|
|
40
23
|
(r ?? o) && /* @__PURE__ */ l("div", {
|
|
41
24
|
className: d("flex shrink-0 items-start p-1", r ? "justify-between" : "justify-end"),
|
|
@@ -45,6 +28,20 @@ var g = 40, j = "relative box-border flex flex-col overflow-hidden rounded-lg bg
|
|
|
45
28
|
className: "flex shrink-0 flex-col items-end p-3",
|
|
46
29
|
children: i
|
|
47
30
|
}),
|
|
31
|
+
/* @__PURE__ */ e("div", {
|
|
32
|
+
className: "absolute right-0 top-0",
|
|
33
|
+
children: /* @__PURE__ */ e(h, {
|
|
34
|
+
dataTest: `${a}-close`,
|
|
35
|
+
variant: "textGray",
|
|
36
|
+
type: "button",
|
|
37
|
+
"aria-label": f,
|
|
38
|
+
onClick: x,
|
|
39
|
+
startIcon: /* @__PURE__ */ e(c, {
|
|
40
|
+
width: 24,
|
|
41
|
+
height: 24
|
|
42
|
+
})
|
|
43
|
+
})
|
|
44
|
+
}),
|
|
48
45
|
/* @__PURE__ */ e("span", {
|
|
49
46
|
"aria-hidden": !0,
|
|
50
47
|
"data-test": `${a}-edge`,
|
|
@@ -1,57 +1,53 @@
|
|
|
1
|
-
import { ACTIONS_COLUMN_ID as q, INTERNAL_COLUMN_IDS as
|
|
2
|
-
import { useRootContext as
|
|
1
|
+
import { ACTIONS_COLUMN_ID as q, INTERNAL_COLUMN_IDS as xe } from "../types.js";
|
|
2
|
+
import { useRootContext as Ce } from "../context/RootContext.js";
|
|
3
3
|
import n from "./StyledTable.module.js";
|
|
4
4
|
import { compact as be } from "../../helpers/arrays.js";
|
|
5
|
-
import
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import { useSortable as
|
|
9
|
-
import { flexRender as
|
|
10
|
-
import { CSS as
|
|
11
|
-
var
|
|
12
|
-
const
|
|
13
|
-
if (!
|
|
14
|
-
const
|
|
15
|
-
return
|
|
5
|
+
import G from "clsx";
|
|
6
|
+
import { Fragment as Re, useCallback as K, useEffect as Se, useLayoutEffect as De, useMemo as h, useRef as Ne, useState as ve } from "react";
|
|
7
|
+
import { Fragment as Ee, jsx as s, jsxs as b } from "react/jsx-runtime";
|
|
8
|
+
import { useSortable as Ie } from "@dnd-kit/sortable";
|
|
9
|
+
import { flexRender as ye } from "@tanstack/react-table";
|
|
10
|
+
import { CSS as Te } from "@dnd-kit/utilities";
|
|
11
|
+
var V = (R, t) => {
|
|
12
|
+
const f = R.closest("table");
|
|
13
|
+
if (!f) return !1;
|
|
14
|
+
const S = t === "next" ? Node.DOCUMENT_POSITION_FOLLOWING : Node.DOCUMENT_POSITION_PRECEDING, c = Array.from(document.querySelectorAll('a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])')).filter((p) => !f.contains(p) && !!(f.compareDocumentPosition(p) & S)), l = t === "next" ? c[0] : c.at(-1);
|
|
15
|
+
return l ? (l.focus(), document.activeElement === l) : !1;
|
|
16
16
|
};
|
|
17
|
-
function We({ styledTableProps: R, row: t, index:
|
|
18
|
-
const { loading:
|
|
17
|
+
function We({ styledTableProps: R, row: t, index: f, hasFocusedRow: S, columnWindow: { paddingLeft: c, paddingRight: l, indexes: p } }) {
|
|
18
|
+
const { loading: Y, getRowClassName: a, activeRowId: L, rowHeight: x, onRowClick: D, expandArrow: J, enableDnd: M, disableDndForRow: Q, tdClassName: O, customSubRowData: w, renderSubRows: X, defaultExpanded: Z, actions: N, customActionsNode: ee, textExpandArrow: A, enableMultiRowSelection: te, enableRowSelection: ne, singleSelectionRow: ie } = R, v = Q?.(t), { transform: oe, transition: se, setNodeRef: _, isDragging: B } = Ie({
|
|
19
19
|
id: t.original.id,
|
|
20
|
-
disabled: !
|
|
21
|
-
}),
|
|
22
|
-
transform:
|
|
23
|
-
transition:
|
|
24
|
-
opacity:
|
|
25
|
-
zIndex:
|
|
20
|
+
disabled: !M || v
|
|
21
|
+
}), le = {
|
|
22
|
+
transform: Te.Transform.toString(oe),
|
|
23
|
+
transition: se,
|
|
24
|
+
opacity: B ? 0.8 : 1,
|
|
25
|
+
zIndex: B ? 1 : 0,
|
|
26
26
|
position: "relative"
|
|
27
|
-
}, { isResizing:
|
|
27
|
+
}, { isResizing: ae, disableResizingFlag: ce } = Ce(), E = t.isExpanded(), C = Ne(null), [de, re] = ve(void 0);
|
|
28
|
+
De(() => {
|
|
29
|
+
!E && C.current && re(C.current.cells[0]?.clientHeight ?? C.current.offsetHeight);
|
|
30
|
+
}, [E]);
|
|
31
|
+
const ue = K((e) => {
|
|
32
|
+
C.current = e, v || _(e);
|
|
33
|
+
}, [v, _]), H = E ? de ?? x : x;
|
|
28
34
|
Se(() => {
|
|
29
|
-
|
|
30
|
-
}, [v]);
|
|
31
|
-
const re = G((e) => {
|
|
32
|
-
b.current = e, N || O(e);
|
|
33
|
-
}, [N, O]), H = v ? ce ?? x : x;
|
|
34
|
-
Re(() => {
|
|
35
|
-
X && t.getCanExpand() && !t.getIsExpanded() && t.toggleExpand();
|
|
35
|
+
Z && t.getCanExpand() && !t.getIsExpanded() && t.toggleExpand();
|
|
36
36
|
}, []);
|
|
37
37
|
const U = (e) => {
|
|
38
|
-
t.getCanExpand() && !
|
|
39
|
-
const i = window.getSelection()?.type !== "Range" && !
|
|
40
|
-
!o &&
|
|
41
|
-
}, ue = (e) => {
|
|
42
|
-
e.target.classList.contains("MuiModal-backdrop") || e.target.nodeName === "INPUT" || e.target.nodeName === "BUTTON" || e.target.nodeName === "LI" || e.target.closest("li") || U(e);
|
|
38
|
+
t.getCanExpand() && !J && t.getToggleExpandedHandler()(), document.getElementById(t.id)?.focus();
|
|
39
|
+
const i = window.getSelection()?.type !== "Range" && !ae, o = D instanceof Function;
|
|
40
|
+
!o && A && i ? t.toggleExpand() : o && i && D(e, t), ce();
|
|
43
41
|
}, fe = (e) => {
|
|
42
|
+
e.target.classList.contains("MuiModal-backdrop") || e.target.nodeName === "INPUT" || e.target.nodeName === "BUTTON" || e.target.nodeName === "LI" || e.target.closest("li") || U(e);
|
|
43
|
+
}, me = (e) => {
|
|
44
44
|
if (e.target === e.currentTarget)
|
|
45
45
|
switch (e.key) {
|
|
46
46
|
case "Tab":
|
|
47
47
|
if (e.shiftKey) {
|
|
48
|
-
if (t.focusPrevRow()) {
|
|
49
|
-
e.preventDefault();
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
48
|
const i = e.currentTarget.closest("table")?.querySelector('thead tr[tabindex="0"]');
|
|
53
|
-
i
|
|
54
|
-
} else (
|
|
49
|
+
i ? (e.preventDefault(), i.focus()) : V(e.currentTarget, "prev") && e.preventDefault();
|
|
50
|
+
} else V(e.currentTarget, "next") && e.preventDefault();
|
|
55
51
|
break;
|
|
56
52
|
case "ArrowDown":
|
|
57
53
|
t.focusNextRow() && e.preventDefault();
|
|
@@ -63,21 +59,21 @@ function We({ styledTableProps: R, row: t, index: r, hasFocusedRow: g, columnWin
|
|
|
63
59
|
e.preventDefault(), U(e);
|
|
64
60
|
break;
|
|
65
61
|
}
|
|
66
|
-
},
|
|
62
|
+
}, m = t.getVisibleCells().map((e, i, o) => ({
|
|
67
63
|
...e,
|
|
68
|
-
left: o.slice(0, i).reduce((
|
|
69
|
-
})), z =
|
|
64
|
+
left: o.slice(0, i).reduce((r, u) => r + (u.column.getSize() ?? 0), 0)
|
|
65
|
+
})), z = h(() => m.filter((e) => !e.column.columnDef.fixedLeft && !e.column.columnDef.fixedRight && e.column.id !== "actions"), [m]), d = h(() => m.filter((e) => !!e.column.columnDef.fixedRight || e.column.id === "actions").map((e, i, o) => ({
|
|
70
66
|
...e,
|
|
71
|
-
right: o.slice(i + 1).reduce((
|
|
72
|
-
})), [
|
|
73
|
-
const o = e.column.id === q,
|
|
67
|
+
right: o.slice(i + 1).reduce((r, u) => r + (u.column.getSize() ?? 0), 0)
|
|
68
|
+
})), [m]), W = h(() => d.some((e) => e.column.id === q), [d]), P = !!N || !!ee, $ = h(() => d.some((e) => !!e.column.columnDef.fixedRight), [d]), g = h(() => m.filter((e) => e.column.columnDef.fixedLeft), [m]), I = !te && !ne && ie, y = t.getIsSelected() && I, T = D instanceof Function, j = p.length > 0 ? be(p.map((e) => z[e])) : z, F = K((e, i) => {
|
|
69
|
+
const o = e.column.id === q, r = e.column.columnDef.fixedLeft, u = !!e.column.columnDef.fixedRight, ge = e.id === g.at(-1)?.id, pe = e.id === d.at(0)?.id && !o, he = t.isExpanded(), k = i === 0;
|
|
74
70
|
return /* @__PURE__ */ s("td", {
|
|
75
|
-
className:
|
|
71
|
+
className: G(n["t-cell"], !xe.includes(e.column.id) && e.column.getSize() > 64 && n["data-cell"], e.column.id === "select" && n["select-cell"], T && "cursor-pointer", O, o && n["action-cell"], o && (!P || $) && n["action-cell--no-shadow"], o && !!N && g.length && n.shadowed, o && (a?.(t) ? a?.(t) : n["action-cell-default-background"]), r && n["fixed-cell"], u && n["fixed-right-cell"], ge && n.shadowed, pe && n["shadowed-right"], t.getIsSelected() && n.selected, r && (a?.(t) ? a?.(t) : n["fixed-cell-default-background"]), u && (a?.(t) ? a?.(t) : n["fixed-right-cell-default-background"]), he && n.expanded_row, !!y && n["single-selection"]),
|
|
76
72
|
style: {
|
|
77
|
-
left:
|
|
78
|
-
right:
|
|
73
|
+
left: r ? e.left : void 0,
|
|
74
|
+
right: u ? e.right + (W ? -1 : 0) : void 0
|
|
79
75
|
},
|
|
80
|
-
children: /* @__PURE__ */
|
|
76
|
+
children: /* @__PURE__ */ b("div", {
|
|
81
77
|
style: {
|
|
82
78
|
display: "flex",
|
|
83
79
|
alignItems: "center",
|
|
@@ -85,7 +81,7 @@ function We({ styledTableProps: R, row: t, index: r, hasFocusedRow: g, columnWin
|
|
|
85
81
|
minHeight: H,
|
|
86
82
|
position: "relative"
|
|
87
83
|
},
|
|
88
|
-
children: [k &&
|
|
84
|
+
children: [k && y && /* @__PURE__ */ s("span", {
|
|
89
85
|
style: {
|
|
90
86
|
display: "inline-flex",
|
|
91
87
|
alignItems: "center",
|
|
@@ -94,85 +90,85 @@ function We({ styledTableProps: R, row: t, index: r, hasFocusedRow: g, columnWin
|
|
|
94
90
|
top: "50%",
|
|
95
91
|
transform: "translateY(-50%)"
|
|
96
92
|
},
|
|
97
|
-
children: /* @__PURE__ */ s(
|
|
93
|
+
children: /* @__PURE__ */ s(Fe, {})
|
|
98
94
|
}), /* @__PURE__ */ s("span", {
|
|
99
95
|
style: {
|
|
100
|
-
marginLeft: k &&
|
|
96
|
+
marginLeft: k && I ? 30 : 0,
|
|
101
97
|
width: "100%"
|
|
102
98
|
},
|
|
103
|
-
children:
|
|
99
|
+
children: ye(e.column.columnDef.cell, e.getContext())
|
|
104
100
|
})]
|
|
105
101
|
})
|
|
106
102
|
}, e.id);
|
|
107
103
|
}, [
|
|
108
|
-
|
|
109
|
-
|
|
104
|
+
y,
|
|
105
|
+
N,
|
|
110
106
|
H,
|
|
111
|
-
|
|
112
|
-
|
|
107
|
+
a,
|
|
108
|
+
T,
|
|
113
109
|
W,
|
|
114
110
|
$,
|
|
115
|
-
|
|
116
|
-
|
|
111
|
+
g,
|
|
112
|
+
d,
|
|
117
113
|
t,
|
|
118
114
|
P,
|
|
119
|
-
|
|
120
|
-
|
|
115
|
+
I,
|
|
116
|
+
O
|
|
121
117
|
]);
|
|
122
|
-
return /* @__PURE__ */
|
|
118
|
+
return /* @__PURE__ */ b(Re, { children: [/* @__PURE__ */ b("tr", {
|
|
123
119
|
"aria-selected": t.getIsSelected() || t.isFocused() ? "true" : "false",
|
|
124
|
-
tabIndex: t.isFocused() ||
|
|
125
|
-
"data-index":
|
|
120
|
+
tabIndex: t.isFocused() || f === 0 && !S ? 0 : -1,
|
|
121
|
+
"data-index": f,
|
|
126
122
|
"data-test": t.id,
|
|
127
123
|
"data-active": L != null && t.id === L ? "true" : void 0,
|
|
128
124
|
id: t.id,
|
|
129
|
-
className:
|
|
125
|
+
className: G(n["t-row"], Y && n["is-loading"], a?.(t)),
|
|
130
126
|
style: {
|
|
131
127
|
height: x ? `${x}px` : "inherit",
|
|
132
|
-
...
|
|
128
|
+
...M && le
|
|
133
129
|
},
|
|
134
|
-
ref:
|
|
130
|
+
ref: ue,
|
|
135
131
|
onFocus: (e) => {
|
|
136
132
|
e.target === e.currentTarget && !t.isFocused() && t.onChangeFocused(!0);
|
|
137
133
|
},
|
|
138
|
-
onMouseUp:
|
|
134
|
+
onMouseUp: fe,
|
|
139
135
|
onMouseDown: (e) => {
|
|
140
|
-
e.detail > 1 && !
|
|
136
|
+
e.detail > 1 && !T && A && e.preventDefault();
|
|
141
137
|
},
|
|
142
|
-
onKeyDownCapture:
|
|
138
|
+
onKeyDownCapture: me,
|
|
143
139
|
children: [
|
|
144
|
-
|
|
145
|
-
|
|
140
|
+
g.map((e, i) => F(e, i)),
|
|
141
|
+
c > 0 && /* @__PURE__ */ s("td", {
|
|
146
142
|
"aria-hidden": !0,
|
|
147
143
|
className: n["t-cell"],
|
|
148
144
|
style: {
|
|
149
|
-
width: String(
|
|
150
|
-
minWidth: String(
|
|
151
|
-
maxWidth: String(
|
|
145
|
+
width: String(c) + "px",
|
|
146
|
+
minWidth: String(c) + "px",
|
|
147
|
+
maxWidth: String(c) + "px",
|
|
152
148
|
padding: 0,
|
|
153
149
|
border: "none"
|
|
154
150
|
}
|
|
155
151
|
}),
|
|
156
|
-
j.map((e, i) => F(e,
|
|
157
|
-
|
|
152
|
+
j.map((e, i) => F(e, g.length + i)),
|
|
153
|
+
l > 0 && /* @__PURE__ */ s("td", {
|
|
158
154
|
"aria-hidden": !0,
|
|
159
155
|
className: n["t-cell"],
|
|
160
156
|
style: {
|
|
161
|
-
width: String(
|
|
162
|
-
minWidth: String(
|
|
163
|
-
maxWidth: String(
|
|
157
|
+
width: String(l) + "px",
|
|
158
|
+
minWidth: String(l) + "px",
|
|
159
|
+
maxWidth: String(l) + "px",
|
|
164
160
|
padding: 0,
|
|
165
161
|
border: "none"
|
|
166
162
|
}
|
|
167
163
|
}),
|
|
168
|
-
|
|
164
|
+
d.map((e, i) => F(e, g.length + j.length + i))
|
|
169
165
|
]
|
|
170
|
-
}), t.getIsExpanded() && /* @__PURE__ */ s(
|
|
171
|
-
rows:
|
|
166
|
+
}), t.getIsExpanded() && /* @__PURE__ */ s(Ee, { children: w && X?.({
|
|
167
|
+
rows: w.get(t.original.id.toString()) ?? [],
|
|
172
168
|
row: t.original
|
|
173
169
|
}) })] }, t.id);
|
|
174
170
|
}
|
|
175
|
-
var
|
|
171
|
+
var Fe = () => /* @__PURE__ */ b("svg", {
|
|
176
172
|
xmlns: "http://www.w3.org/2000/svg",
|
|
177
173
|
width: "20",
|
|
178
174
|
height: "20",
|
|
@@ -6,12 +6,12 @@ import "react";
|
|
|
6
6
|
import { jsx as n, jsxs as O } from "react/jsx-runtime";
|
|
7
7
|
import "@tanstack/react-table";
|
|
8
8
|
function M({ table: p, styledTableProps: o, tableCanResize: s, tableWidth: l, columnWindow: { paddingLeft: i, paddingRight: c, indexes: H } }) {
|
|
9
|
-
const { stickyHeader: S = !1, tableHeaderRef: y, tableHeaderStyle: g = {} } = o,
|
|
9
|
+
const { stickyHeader: S = !1, tableHeaderRef: y, tableHeaderStyle: g = {} } = o, b = p.getHeaderGroups(), D = { ...g };
|
|
10
10
|
return /* @__PURE__ */ n("thead", {
|
|
11
11
|
className: C(x["table-header"], S && x["table-header--sticky"], o.tableHeaderClassName),
|
|
12
|
-
style:
|
|
12
|
+
style: D,
|
|
13
13
|
ref: y,
|
|
14
|
-
children:
|
|
14
|
+
children: b.map((f) => {
|
|
15
15
|
const m = f.headers.map((e, t, r) => ({
|
|
16
16
|
header: e,
|
|
17
17
|
left: r.slice(0, t).reduce((d, a) => d + (a.column.getSize() ?? 0), 0)
|
|
@@ -26,7 +26,7 @@ function M({ table: p, styledTableProps: o, tableCanResize: s, tableWidth: l, co
|
|
|
26
26
|
tabIndex: 0,
|
|
27
27
|
onKeyDown: (e) => {
|
|
28
28
|
if (e.key !== "Tab" || e.shiftKey) return;
|
|
29
|
-
const t = e.currentTarget.closest("table")?.querySelector('tbody tr[
|
|
29
|
+
const t = e.currentTarget.closest("table")?.querySelector('tbody tr[tabindex="0"]');
|
|
30
30
|
t && (e.preventDefault(), t.focus());
|
|
31
31
|
},
|
|
32
32
|
children: [
|
|
@@ -1,51 +1,59 @@
|
|
|
1
|
-
import { functionalUpdate as
|
|
2
|
-
var
|
|
1
|
+
import { functionalUpdate as r, makeStateUpdater as u } from "@tanstack/react-table";
|
|
2
|
+
var d = (e) => getComputedStyle(e).position === "sticky", l = (e) => {
|
|
3
|
+
const s = e.closest("table"), t = s?.tHead;
|
|
4
|
+
let n = 0;
|
|
5
|
+
for (let o = s?.parentElement?.nextElementSibling; o; o = o.nextElementSibling) d(o) && (n += o.getBoundingClientRect().height);
|
|
6
|
+
e.style.scrollMarginTop = `${t && d(t) ? t.getBoundingClientRect().height : 0}px`, e.style.scrollMarginBottom = `${n}px`, e.scrollIntoView({
|
|
7
|
+
block: "nearest",
|
|
8
|
+
inline: "nearest"
|
|
9
|
+
});
|
|
10
|
+
}, g = {
|
|
3
11
|
getInitialState: (e) => ({
|
|
4
12
|
focusedRow: null,
|
|
5
13
|
...e
|
|
6
14
|
}),
|
|
7
|
-
getDefaultOptions: (e) => ({ onChangeFocusedRow:
|
|
15
|
+
getDefaultOptions: (e) => ({ onChangeFocusedRow: u("focusedRow", e) }),
|
|
8
16
|
createTable: (e) => {
|
|
9
|
-
e.setFocusedRow = (
|
|
10
|
-
const
|
|
11
|
-
return e.options.onChangeFocusedRow?.(
|
|
17
|
+
e.setFocusedRow = (t) => {
|
|
18
|
+
const n = (o) => r(t, o);
|
|
19
|
+
return e.options.onChangeFocusedRow?.(n);
|
|
12
20
|
};
|
|
13
|
-
const s = async (
|
|
14
|
-
if (e.getRowModel().rows.findIndex((
|
|
15
|
-
const
|
|
16
|
-
if (
|
|
17
|
-
const
|
|
18
|
-
e.setPageIndex?.(
|
|
21
|
+
const s = async (t) => {
|
|
22
|
+
if (e.getRowModel().rows.findIndex((o) => o.id === t) === -1 && e.getState().pagination) {
|
|
23
|
+
const o = e.getState().pagination.pageSize, i = e.getCoreRowModel().rows.findIndex((c) => c.id === t);
|
|
24
|
+
if (i !== -1) {
|
|
25
|
+
const c = Math.floor(i / o);
|
|
26
|
+
e.setPageIndex?.(c);
|
|
19
27
|
}
|
|
20
28
|
}
|
|
21
|
-
if (await new Promise(requestAnimationFrame), !e.getRowModel().rows.find((
|
|
22
|
-
e.setFocusedRow(() =>
|
|
23
|
-
const
|
|
24
|
-
|
|
29
|
+
if (await new Promise(requestAnimationFrame), !e.getRowModel().rows.find((o) => o.id === t)) return;
|
|
30
|
+
e.setFocusedRow(() => t);
|
|
31
|
+
const n = document.getElementById(t);
|
|
32
|
+
n && (n.focus({ preventScroll: !1 }), n.scrollIntoView({
|
|
25
33
|
behavior: "smooth",
|
|
26
34
|
block: "center"
|
|
27
35
|
}));
|
|
28
36
|
};
|
|
29
|
-
e.focusRowById = (
|
|
30
|
-
s(
|
|
37
|
+
e.focusRowById = (t) => {
|
|
38
|
+
s(t);
|
|
31
39
|
};
|
|
32
40
|
},
|
|
33
41
|
createRow: (e, s) => {
|
|
34
|
-
e.isFocused = () => s.getState().focusedRow === e.id, e.onChangeFocused = (
|
|
35
|
-
const
|
|
36
|
-
if (s.setFocusedRow(() =>
|
|
37
|
-
const
|
|
38
|
-
|
|
42
|
+
e.isFocused = () => s.getState().focusedRow === e.id, e.onChangeFocused = (t, n) => {
|
|
43
|
+
const o = n ?? e.id;
|
|
44
|
+
if (s.setFocusedRow(() => t ? o : null), t) {
|
|
45
|
+
const i = document.getElementById(o);
|
|
46
|
+
i && (i.focus({ preventScroll: !0 }), l(i));
|
|
39
47
|
}
|
|
40
48
|
}, e.toggleFocused = () => e.onChangeFocused(!e.isFocused()), e.focusNextRow = () => {
|
|
41
|
-
const
|
|
42
|
-
return
|
|
49
|
+
const t = s.getRowModel().rows, n = t[t.findIndex((o) => o.id === s.getState().focusedRow) + 1];
|
|
50
|
+
return n ? (n.onChangeFocused(!0, n.id), !0) : !1;
|
|
43
51
|
}, e.focusPrevRow = () => {
|
|
44
|
-
const
|
|
45
|
-
return
|
|
52
|
+
const t = s.getRowModel().rows, n = t[t.findIndex((o) => o.id === s.getState().focusedRow) - 1];
|
|
53
|
+
return n ? (n.onChangeFocused(!0, n.id), !0) : !1;
|
|
46
54
|
};
|
|
47
55
|
}
|
|
48
56
|
};
|
|
49
57
|
export {
|
|
50
|
-
|
|
58
|
+
g as FocusedRowsFeature
|
|
51
59
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var e = "
|
|
1
|
+
var e = "_CheckboxWrapper_b7zlc_1", _ = "_Checkbox_b7zlc_1", r = "_Indeterminate_b7zlc_30", a = "_ReadOnly_b7zlc_57", l = "_Indicator_b7zlc_66", c = "_HideWrapper_b7zlc_70", b = "_CheckboxHover_b7zlc_77", p = "_CheckboxRippleContainer_b7zlc_77", i = "_CheckboxRipple_b7zlc_77", o = "_ripple_b7zlc_1", z = {
|
|
2
2
|
CheckboxWrapper: e,
|
|
3
|
-
"size-small": "_size-
|
|
4
|
-
"size-medium": "_size-
|
|
3
|
+
"size-small": "_size-small_b7zlc_13",
|
|
4
|
+
"size-medium": "_size-medium_b7zlc_17",
|
|
5
5
|
Checkbox: _,
|
|
6
6
|
Indeterminate: r,
|
|
7
7
|
ReadOnly: a,
|
|
8
|
-
Indicator:
|
|
9
|
-
HideWrapper:
|
|
10
|
-
CheckboxHover:
|
|
11
|
-
CheckboxRippleContainer:
|
|
12
|
-
CheckboxRipple:
|
|
13
|
-
ripple:
|
|
8
|
+
Indicator: l,
|
|
9
|
+
HideWrapper: c,
|
|
10
|
+
CheckboxHover: b,
|
|
11
|
+
CheckboxRippleContainer: p,
|
|
12
|
+
CheckboxRipple: i,
|
|
13
|
+
ripple: o
|
|
14
14
|
};
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
z as default
|
|
17
17
|
};
|