asma-ui-core 3.45.2 → 3.46.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/src/table/helpers/injectColumns.d.ts +1 -1
- package/dist/src/table/hooks/useColumnSizingPersistence.d.ts +3 -0
- package/dist/table/components/StyledTable.module.js +52 -52
- package/dist/table/components/StyledTableIndex.js +31 -27
- package/dist/table/components/TableRow.js +69 -61
- package/dist/table/components/columns/expandColumn.js +14 -10
- package/dist/table/components/columns/showTextColumn.js +20 -16
- package/dist/table/components/table-header/TableHeaderCell.js +34 -53
- package/dist/table/helpers/injectColumns.js +7 -7
- package/dist/table/hooks/useColumnSizingPersistence.js +36 -0
- package/dist/table/hooks/useColumnVirtualizer.js +4 -3
- package/dist/table/hooks/useStyledTable.js +48 -40
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { StyledTableProps } from '../types';
|
|
2
2
|
export declare const injectColumns: <TData extends {
|
|
3
3
|
id: string | number;
|
|
4
|
-
}, TCustomData = Record<string, unknown>>(props: StyledTableProps<TData, TCustomData>) =>
|
|
4
|
+
}, TCustomData = Record<string, unknown>>(props: StyledTableProps<TData, TCustomData>) => StyledTableProps<TData, TCustomData>["columns"];
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
var e = "
|
|
2
|
-
"asma-ui-table-styled-table": "_asma-ui-table-styled-
|
|
3
|
-
"table-wrapper": "_table-
|
|
4
|
-
"table-shell": "_table-
|
|
5
|
-
"table-wrapper--no-rows": "_table-wrapper--no-
|
|
6
|
-
"table-wrapper--proxy": "_table-wrapper--
|
|
7
|
-
"table-wrapper--proxy-bottom": "_table-wrapper--proxy-
|
|
8
|
-
"table-wrapper-fetching": "_table-wrapper-
|
|
9
|
-
"table-scroll": "_table-
|
|
10
|
-
"table-x--fill-height": "_table-x--fill-
|
|
11
|
-
"table-x": "_table-
|
|
12
|
-
"table-content": "_table-
|
|
13
|
-
"table-header--sticky": "_table-header--
|
|
14
|
-
"table-hscroll": "_table-
|
|
15
|
-
"table-hscroll__content": "_table-
|
|
16
|
-
"no-rows-overlay-container": "_no-rows-overlay-
|
|
17
|
-
"no-rows-overlay-content": "_no-rows-overlay-
|
|
18
|
-
"styled-table": "_styled-
|
|
1
|
+
var e = "_tbody_1g04u_124", _ = "_expanded_row_1g04u_187", l = "_selected_1g04u_205", t = "_shadowed_1g04u_234", a = "_resizer_1g04u_288", o = "_isResizing_1g04u_300", r = {
|
|
2
|
+
"asma-ui-table-styled-table": "_asma-ui-table-styled-table_1g04u_1",
|
|
3
|
+
"table-wrapper": "_table-wrapper_1g04u_26",
|
|
4
|
+
"table-shell": "_table-shell_1g04u_33",
|
|
5
|
+
"table-wrapper--no-rows": "_table-wrapper--no-rows_1g04u_39",
|
|
6
|
+
"table-wrapper--proxy": "_table-wrapper--proxy_1g04u_42",
|
|
7
|
+
"table-wrapper--proxy-bottom": "_table-wrapper--proxy-bottom_1g04u_43",
|
|
8
|
+
"table-wrapper-fetching": "_table-wrapper-fetching_1g04u_53",
|
|
9
|
+
"table-scroll": "_table-scroll_1g04u_56",
|
|
10
|
+
"table-x--fill-height": "_table-x--fill-height_1g04u_65",
|
|
11
|
+
"table-x": "_table-x_1g04u_65",
|
|
12
|
+
"table-content": "_table-content_1g04u_80",
|
|
13
|
+
"table-header--sticky": "_table-header--sticky_1g04u_85",
|
|
14
|
+
"table-hscroll": "_table-hscroll_1g04u_90",
|
|
15
|
+
"table-hscroll__content": "_table-hscroll__content_1g04u_100",
|
|
16
|
+
"no-rows-overlay-container": "_no-rows-overlay-container_1g04u_103",
|
|
17
|
+
"no-rows-overlay-content": "_no-rows-overlay-content_1g04u_111",
|
|
18
|
+
"styled-table": "_styled-table_1g04u_115",
|
|
19
19
|
tbody: e,
|
|
20
|
-
"loading-icon": "_loading-
|
|
21
|
-
"t-row": "_t-
|
|
22
|
-
"t-cell": "_t-
|
|
23
|
-
"action-cell": "_action-
|
|
24
|
-
"fixed-cell": "_fixed-
|
|
25
|
-
"fixed-right-cell": "_fixed-right-
|
|
20
|
+
"loading-icon": "_loading-icon_1g04u_129",
|
|
21
|
+
"t-row": "_t-row_1g04u_136",
|
|
22
|
+
"t-cell": "_t-cell_1g04u_136",
|
|
23
|
+
"action-cell": "_action-cell_1g04u_146",
|
|
24
|
+
"fixed-cell": "_fixed-cell_1g04u_150",
|
|
25
|
+
"fixed-right-cell": "_fixed-right-cell_1g04u_153",
|
|
26
26
|
expanded_row: _,
|
|
27
|
-
selected:
|
|
28
|
-
"single-selection": "_single-
|
|
29
|
-
"action-cell--no-shadow": "_action-cell--no-
|
|
30
|
-
"action-cell--not-fixed": "_action-cell--not-
|
|
31
|
-
shadowed:
|
|
32
|
-
"shadowed-right": "_shadowed-
|
|
33
|
-
"is-loading": "_is-
|
|
34
|
-
"action-cell-default-background": "_action-cell-default-
|
|
35
|
-
"fixed-cell-default-background": "_fixed-cell-default-
|
|
36
|
-
"fixed-right-cell-default-background": "_fixed-right-cell-default-
|
|
37
|
-
"sortable-column": "_sortable-
|
|
38
|
-
resizer:
|
|
39
|
-
isResizing:
|
|
40
|
-
"hide-table-header": "_hide-table-
|
|
41
|
-
"show-table-header": "_show-table-
|
|
42
|
-
"table-header": "_table-
|
|
43
|
-
"hide-header": "_hide-
|
|
44
|
-
"t-cell__actions": "_t-
|
|
45
|
-
"t-cell__actions--no-shadow": "_t-cell__actions--no-
|
|
46
|
-
"t-cell__actions--not-fixed": "_t-cell__actions--not-
|
|
47
|
-
"t-cell__fixed": "_t-
|
|
48
|
-
"t-cell__fixed-right": "_t-cell__fixed-
|
|
49
|
-
"sort-icon": "_sort-
|
|
50
|
-
"table-footer--sticky": "_table-footer--
|
|
51
|
-
"table-footer--inline": "_table-footer--
|
|
52
|
-
"table-bottom": "_table-
|
|
53
|
-
"table-bottom--sticky": "_table-bottom--
|
|
54
|
-
"cursor-not-allowed": "_cursor-not-
|
|
27
|
+
selected: l,
|
|
28
|
+
"single-selection": "_single-selection_1g04u_208",
|
|
29
|
+
"action-cell--no-shadow": "_action-cell--no-shadow_1g04u_225",
|
|
30
|
+
"action-cell--not-fixed": "_action-cell--not-fixed_1g04u_228",
|
|
31
|
+
shadowed: t,
|
|
32
|
+
"shadowed-right": "_shadowed-right_1g04u_268",
|
|
33
|
+
"is-loading": "_is-loading_1g04u_272",
|
|
34
|
+
"action-cell-default-background": "_action-cell-default-background_1g04u_275",
|
|
35
|
+
"fixed-cell-default-background": "_fixed-cell-default-background_1g04u_278",
|
|
36
|
+
"fixed-right-cell-default-background": "_fixed-right-cell-default-background_1g04u_281",
|
|
37
|
+
"sortable-column": "_sortable-column_1g04u_284",
|
|
38
|
+
resizer: a,
|
|
39
|
+
isResizing: o,
|
|
40
|
+
"hide-table-header": "_hide-table-header_1g04u_312",
|
|
41
|
+
"show-table-header": "_show-table-header_1g04u_316",
|
|
42
|
+
"table-header": "_table-header_1g04u_85",
|
|
43
|
+
"hide-header": "_hide-header_1g04u_348",
|
|
44
|
+
"t-cell__actions": "_t-cell__actions_1g04u_351",
|
|
45
|
+
"t-cell__actions--no-shadow": "_t-cell__actions--no-shadow_1g04u_359",
|
|
46
|
+
"t-cell__actions--not-fixed": "_t-cell__actions--not-fixed_1g04u_362",
|
|
47
|
+
"t-cell__fixed": "_t-cell__fixed_1g04u_369",
|
|
48
|
+
"t-cell__fixed-right": "_t-cell__fixed-right_1g04u_376",
|
|
49
|
+
"sort-icon": "_sort-icon_1g04u_383",
|
|
50
|
+
"table-footer--sticky": "_table-footer--sticky_1g04u_386",
|
|
51
|
+
"table-footer--inline": "_table-footer--inline_1g04u_397",
|
|
52
|
+
"table-bottom": "_table-bottom_1g04u_408",
|
|
53
|
+
"table-bottom--sticky": "_table-bottom--sticky_1g04u_422",
|
|
54
|
+
"cursor-not-allowed": "_cursor-not-allowed_1g04u_426"
|
|
55
55
|
};
|
|
56
56
|
export {
|
|
57
57
|
r as default
|
|
@@ -17,7 +17,7 @@ import { DndContext as fe, closestCenter as he } from "@dnd-kit/core";
|
|
|
17
17
|
import { restrictToParentElement as be, restrictToVerticalAxis as ue } from "@dnd-kit/modifiers";
|
|
18
18
|
import { arrayMove as pe } from "@dnd-kit/sortable";
|
|
19
19
|
function we({ enabled: l, data: o, setData: i, children: v }) {
|
|
20
|
-
const y = O(() => o.map((c) => c.id), [o]),
|
|
20
|
+
const y = O(() => o.map((c) => c.id), [o]), P = (c) => {
|
|
21
21
|
if (!l || !i) return;
|
|
22
22
|
const { active: m, over: f } = c;
|
|
23
23
|
!m || !f || m.id === f.id || i((g) => pe(g, y.indexOf(m.id), y.indexOf(f.id)));
|
|
@@ -25,7 +25,7 @@ function we({ enabled: l, data: o, setData: i, children: v }) {
|
|
|
25
25
|
return l ? /* @__PURE__ */ t(fe, {
|
|
26
26
|
collisionDetection: he,
|
|
27
27
|
modifiers: [ue, be],
|
|
28
|
-
onDragEnd:
|
|
28
|
+
onDragEnd: P,
|
|
29
29
|
children: v
|
|
30
30
|
}) : /* @__PURE__ */ t(X, { children: v });
|
|
31
31
|
}
|
|
@@ -36,61 +36,65 @@ function ve({ enabled: l, className: o, children: i }) {
|
|
|
36
36
|
}) : /* @__PURE__ */ t(X, { children: i });
|
|
37
37
|
}
|
|
38
38
|
var Ve = (l) => {
|
|
39
|
-
const o = O(() =>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
const o = O(() => {
|
|
40
|
+
const r = {
|
|
41
|
+
...l,
|
|
42
|
+
rowHeight: l.rowHeight ?? 48
|
|
43
|
+
};
|
|
44
|
+
return {
|
|
45
|
+
...r,
|
|
46
|
+
columns: le(r)
|
|
47
|
+
};
|
|
48
|
+
}, [l]), { className: i, tableClassName: v, height: y, noRowsOverlay: P, data: c, enableDnd: m, setData: f, loading: g } = o, { table: a } = ne(o), C = c.length > 0, F = C && !!g, h = !C && !g, z = oe(re()), n = !!o.stickyFooter && !z, [G, M] = me(!1), x = L(null), W = L(null), S = o.hideHeader ? 0 : 32, { tableScrollRef: R, tableXRef: H, hScrollRef: J, hScrollContentRef: K } = ce(!n);
|
|
45
49
|
q(() => {
|
|
46
|
-
const
|
|
47
|
-
if (!
|
|
50
|
+
const r = n ? x.current : H.current ?? R.current;
|
|
51
|
+
if (!r) {
|
|
48
52
|
M(!1);
|
|
49
53
|
return;
|
|
50
54
|
}
|
|
51
|
-
const s =
|
|
52
|
-
const u =
|
|
55
|
+
const s = r.querySelector("table"), b = () => {
|
|
56
|
+
const u = r.scrollWidth > r.clientWidth;
|
|
53
57
|
M((I) => I === u ? I : u);
|
|
54
58
|
};
|
|
55
59
|
b();
|
|
56
60
|
const d = new ResizeObserver(b);
|
|
57
|
-
return d.observe(
|
|
61
|
+
return d.observe(r), s && d.observe(s), () => {
|
|
58
62
|
d.disconnect();
|
|
59
63
|
};
|
|
60
64
|
}, [
|
|
61
|
-
|
|
65
|
+
n,
|
|
62
66
|
H,
|
|
63
67
|
R
|
|
64
68
|
]);
|
|
65
69
|
const { ref: Q, heightPx: k } = $(), { ref: U, heightPx: D } = $(), N = o.rowHeight ?? 48, E = a.getRowModel().rows.length, V = o.hideHeader ? 0 : 32, _ = 12, Y = O(() => {
|
|
66
70
|
if (N <= 0) return 0;
|
|
67
|
-
const
|
|
71
|
+
const r = n ? 0 : V + D + _, s = Math.max(0, k - r);
|
|
68
72
|
return Math.floor(s / N);
|
|
69
73
|
}, [
|
|
70
|
-
|
|
74
|
+
n,
|
|
71
75
|
D,
|
|
72
76
|
V,
|
|
73
77
|
_,
|
|
74
78
|
N,
|
|
75
79
|
k
|
|
76
|
-
]), T = !
|
|
80
|
+
]), T = !n && E > 0 && E <= Y, Z = p(n ? e["table-wrapper"] : T || !n && h ? e["table-wrapper--proxy-bottom"] : e["table-wrapper--proxy"], F && e["table-wrapper-fetching"], h && e["table-wrapper--no-rows"], i), { columnWindow: j } = de({
|
|
77
81
|
table: a,
|
|
78
|
-
scrollRef:
|
|
82
|
+
scrollRef: n ? x : R,
|
|
79
83
|
isMobileView: z
|
|
80
84
|
});
|
|
81
85
|
q(() => {
|
|
82
|
-
const
|
|
83
|
-
if (!
|
|
86
|
+
const r = x.current, s = W.current, b = () => r?.style.removeProperty("--no-rows-content-height");
|
|
87
|
+
if (!r || !h || !s) {
|
|
84
88
|
b();
|
|
85
89
|
return;
|
|
86
90
|
}
|
|
87
|
-
const d = () =>
|
|
91
|
+
const d = () => r.style.setProperty("--no-rows-content-height", `${Math.ceil(s.getBoundingClientRect().height) + S}px`);
|
|
88
92
|
d();
|
|
89
93
|
const u = new ResizeObserver(d);
|
|
90
94
|
return u.observe(s), () => {
|
|
91
95
|
u.disconnect(), b();
|
|
92
96
|
};
|
|
93
|
-
}, [h,
|
|
97
|
+
}, [h, S]);
|
|
94
98
|
const A = /* @__PURE__ */ w("div", {
|
|
95
99
|
className: e["table-content"],
|
|
96
100
|
children: [/* @__PURE__ */ w("table", {
|
|
@@ -113,11 +117,11 @@ var Ve = (l) => {
|
|
|
113
117
|
}), /* @__PURE__ */ t(ae, { fetching: !!F })]
|
|
114
118
|
}), ee = h ? /* @__PURE__ */ t("div", {
|
|
115
119
|
className: e["no-rows-overlay-container"],
|
|
116
|
-
style: { top:
|
|
120
|
+
style: { top: S },
|
|
117
121
|
children: /* @__PURE__ */ t("div", {
|
|
118
122
|
ref: W,
|
|
119
123
|
className: e["no-rows-overlay-content"],
|
|
120
|
-
children:
|
|
124
|
+
children: P
|
|
121
125
|
})
|
|
122
126
|
}) : null;
|
|
123
127
|
return /* @__PURE__ */ t(te, { children: /* @__PURE__ */ t(we, {
|
|
@@ -130,12 +134,12 @@ var Ve = (l) => {
|
|
|
130
134
|
"data-x-overflow": G ? "true" : "false",
|
|
131
135
|
style: { height: y },
|
|
132
136
|
children: [/* @__PURE__ */ t(ve, {
|
|
133
|
-
enabled:
|
|
137
|
+
enabled: n,
|
|
134
138
|
className: e["table-shell"],
|
|
135
139
|
children: /* @__PURE__ */ w("div", {
|
|
136
140
|
ref: x,
|
|
137
141
|
className: Z,
|
|
138
|
-
children: [
|
|
142
|
+
children: [n ? A : /* @__PURE__ */ w("div", {
|
|
139
143
|
ref: R,
|
|
140
144
|
className: p(e["table-scroll"]),
|
|
141
145
|
children: [
|
|
@@ -164,7 +168,7 @@ var Ve = (l) => {
|
|
|
164
168
|
]
|
|
165
169
|
}), ee]
|
|
166
170
|
})
|
|
167
|
-
}),
|
|
171
|
+
}), n && /* @__PURE__ */ t(B, {
|
|
168
172
|
table: a,
|
|
169
173
|
styledTableProps: o,
|
|
170
174
|
canShowStickyFooter: !0
|
|
@@ -1,55 +1,62 @@
|
|
|
1
|
-
import { ACTIONS_COLUMN_ID as
|
|
2
|
-
import { useRootContext as
|
|
1
|
+
import { ACTIONS_COLUMN_ID as O } from "../types.js";
|
|
2
|
+
import { useRootContext as ue } from "../context/RootContext.js";
|
|
3
3
|
import n from "./StyledTable.module.js";
|
|
4
|
-
import { compact as
|
|
5
|
-
import
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import { useSortable as
|
|
9
|
-
import { flexRender as
|
|
10
|
-
import { CSS as
|
|
11
|
-
function
|
|
12
|
-
const { loading:
|
|
4
|
+
import { compact as fe } from "../../helpers/arrays.js";
|
|
5
|
+
import $ from "clsx";
|
|
6
|
+
import { Fragment as he, useCallback as j, useEffect as pe, useLayoutEffect as xe, useMemo as g, useRef as Ce, useState as Re } from "react";
|
|
7
|
+
import { Fragment as Se, jsx as l, jsxs as C } from "react/jsx-runtime";
|
|
8
|
+
import { useSortable as be } from "@dnd-kit/sortable";
|
|
9
|
+
import { flexRender as De } from "@tanstack/react-table";
|
|
10
|
+
import { CSS as ke } from "@dnd-kit/utilities";
|
|
11
|
+
function Me({ styledTableProps: P, row: t, index: K, columnWindow: { paddingLeft: u, paddingRight: f, indexes: N } }) {
|
|
12
|
+
const { loading: V, getRowClassName: s, rowHeight: h, onRowClick: R, expandArrow: Y, enableDnd: I, disableDndForRow: q, tdClassName: w, customSubRowData: B, renderSubRows: G, defaultExpanded: J, actions: S, customActionsNode: Q, textExpandArrow: A, enableMultiRowSelection: X, enableRowSelection: Z, singleSelectionRow: ee } = P, b = q?.(t), { transform: te, transition: ne, setNodeRef: H, isDragging: L } = be({
|
|
13
13
|
id: t.original.id,
|
|
14
|
-
disabled: !
|
|
15
|
-
}),
|
|
16
|
-
transform:
|
|
17
|
-
transition:
|
|
18
|
-
opacity:
|
|
19
|
-
zIndex:
|
|
14
|
+
disabled: !I || b
|
|
15
|
+
}), ie = {
|
|
16
|
+
transform: ke.Transform.toString(te),
|
|
17
|
+
transition: ne,
|
|
18
|
+
opacity: L ? 0.8 : 1,
|
|
19
|
+
zIndex: L ? 1 : 0,
|
|
20
20
|
position: "relative"
|
|
21
|
-
}, { isResizing:
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
}, { isResizing: oe, disableResizingFlag: le } = ue(), D = t.isExpanded(), p = Ce(null), [se, ae] = Re(void 0);
|
|
22
|
+
xe(() => {
|
|
23
|
+
!D && p.current && ae(p.current.cells[0]?.clientHeight ?? p.current.offsetHeight);
|
|
24
|
+
}, [D]);
|
|
25
|
+
const de = j((e) => {
|
|
26
|
+
p.current = e, b || H(e);
|
|
27
|
+
}, [b, H]), M = D ? se ?? h : h;
|
|
28
|
+
pe(() => {
|
|
29
|
+
J && t.getCanExpand() && !t.getIsExpanded() && t.toggleExpand();
|
|
24
30
|
}, []);
|
|
25
|
-
const
|
|
26
|
-
t.getCanExpand() &&
|
|
27
|
-
const i = window.getSelection()?.type !== "Range" && !
|
|
28
|
-
!o &&
|
|
29
|
-
},
|
|
30
|
-
e.target.classList.contains("MuiModal-backdrop") || e.target.nodeName === "INPUT" || e.target.nodeName === "BUTTON" || e.target.nodeName === "LI" || e.target.closest("li") ||
|
|
31
|
+
const T = (e) => {
|
|
32
|
+
t.getCanExpand() && !Y && t.getToggleExpandedHandler()(), document.getElementById(t.id)?.focus();
|
|
33
|
+
const i = window.getSelection()?.type !== "Range" && !oe, o = R instanceof Function;
|
|
34
|
+
!o && A && i ? t.toggleExpand() : o && i && R(e, t), le();
|
|
35
|
+
}, ce = (e) => {
|
|
36
|
+
e.target.classList.contains("MuiModal-backdrop") || e.target.nodeName === "INPUT" || e.target.nodeName === "BUTTON" || e.target.nodeName === "LI" || e.target.closest("li") || T(e);
|
|
31
37
|
}, r = t.getVisibleCells().map((e, i, o) => ({
|
|
32
38
|
...e,
|
|
33
39
|
left: o.slice(0, i).reduce((d, c) => d + (c.column.getSize() ?? 0), 0)
|
|
34
|
-
})),
|
|
40
|
+
})), z = g(() => r.filter((e) => !e.column.columnDef.fixedLeft && !e.column.columnDef.fixedRight && e.column.id !== "actions"), [r]), a = g(() => r.filter((e) => !!e.column.columnDef.fixedRight || e.column.id === "actions").map((e, i, o) => ({
|
|
35
41
|
...e,
|
|
36
42
|
right: o.slice(i + 1).reduce((d, c) => d + (c.column.getSize() ?? 0), 0)
|
|
37
|
-
})), [r]),
|
|
38
|
-
const o = e.column.id ===
|
|
43
|
+
})), [r]), U = g(() => a.some((e) => e.column.id === O), [a]), x = !!S || !!Q, W = g(() => a.some((e) => !!e.column.columnDef.fixedRight), [a]), m = g(() => r.filter((e) => e.column.columnDef.fixedLeft), [r]), k = !X && !Z && ee, y = t.getIsSelected() && k, F = R instanceof Function, _ = N.length > 0 ? fe(N.map((e) => z[e])) : z, E = j((e, i) => {
|
|
44
|
+
const o = e.column.id === O, d = e.column.columnDef.fixedLeft, c = !!e.column.columnDef.fixedRight, re = e.id === m.at(-1)?.id, me = e.id === a.at(0)?.id && !o, ge = t.isExpanded(), v = i === 0;
|
|
39
45
|
return /* @__PURE__ */ l("td", {
|
|
40
|
-
className:
|
|
46
|
+
className: $(n["t-cell"], F && "cursor-pointer", w, o && n["action-cell"], o && !x && n["action-cell--not-fixed"], o && x && W && n["action-cell--no-shadow"], o && x && !!S && m.length && n.shadowed, o && (s?.(t) ? s?.(t) : n["action-cell-default-background"]), d && n["fixed-cell"], c && n["fixed-right-cell"], re && n.shadowed, me && n["shadowed-right"], t.getIsSelected() && n.selected, d && (s?.(t) ? s?.(t) : n["fixed-cell-default-background"]), c && (s?.(t) ? s?.(t) : n["fixed-right-cell-default-background"]), ge && n.expanded_row, (!!y || t.isFocused()) && n["single-selection"]),
|
|
41
47
|
style: {
|
|
42
48
|
left: d ? e.left : void 0,
|
|
43
|
-
right: c ? e.right + (
|
|
49
|
+
right: c ? e.right + (U ? -1 : 0) : void 0
|
|
44
50
|
},
|
|
45
|
-
children: /* @__PURE__ */
|
|
51
|
+
children: /* @__PURE__ */ C("div", {
|
|
46
52
|
style: {
|
|
47
53
|
display: "flex",
|
|
48
54
|
alignItems: "center",
|
|
49
|
-
minWidth:
|
|
55
|
+
minWidth: v ? 32 : void 0,
|
|
56
|
+
minHeight: M,
|
|
50
57
|
position: "relative"
|
|
51
58
|
},
|
|
52
|
-
children: [
|
|
59
|
+
children: [v && y && /* @__PURE__ */ l("span", {
|
|
53
60
|
style: {
|
|
54
61
|
display: "inline-flex",
|
|
55
62
|
alignItems: "center",
|
|
@@ -58,45 +65,46 @@ function ve({ styledTableProps: _, row: t, index: H, columnWindow: { paddingLeft
|
|
|
58
65
|
top: "50%",
|
|
59
66
|
transform: "translateY(-50%)"
|
|
60
67
|
},
|
|
61
|
-
children: /* @__PURE__ */ l(
|
|
68
|
+
children: /* @__PURE__ */ l(ye, {})
|
|
62
69
|
}), /* @__PURE__ */ l("span", {
|
|
63
70
|
style: {
|
|
64
|
-
marginLeft:
|
|
71
|
+
marginLeft: v && k ? 30 : 0,
|
|
65
72
|
width: "100%"
|
|
66
73
|
},
|
|
67
|
-
children:
|
|
74
|
+
children: De(e.column.columnDef.cell, e.getContext())
|
|
68
75
|
})]
|
|
69
76
|
})
|
|
70
77
|
}, e.id);
|
|
71
78
|
}, [
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
s,
|
|
75
|
-
R,
|
|
76
|
-
L,
|
|
79
|
+
y,
|
|
80
|
+
S,
|
|
77
81
|
M,
|
|
82
|
+
s,
|
|
83
|
+
F,
|
|
84
|
+
U,
|
|
85
|
+
W,
|
|
78
86
|
m,
|
|
79
87
|
a,
|
|
80
88
|
t,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
89
|
+
x,
|
|
90
|
+
k,
|
|
91
|
+
w
|
|
84
92
|
]);
|
|
85
|
-
return /* @__PURE__ */
|
|
93
|
+
return /* @__PURE__ */ C(he, { children: [/* @__PURE__ */ C("tr", {
|
|
86
94
|
"aria-selected": t.getIsSelected() || t.isFocused() ? "true" : "false",
|
|
87
95
|
tabIndex: t.isFocused() ? 0 : -1,
|
|
88
|
-
"data-index":
|
|
96
|
+
"data-index": K,
|
|
89
97
|
"data-test": t.id,
|
|
90
98
|
id: t.id,
|
|
91
|
-
className:
|
|
99
|
+
className: $(n["t-row"], V && n["is-loading"], s?.(t)),
|
|
92
100
|
style: {
|
|
93
|
-
height:
|
|
94
|
-
...
|
|
101
|
+
height: h ? `${h}px` : "inherit",
|
|
102
|
+
...I && ie
|
|
95
103
|
},
|
|
96
|
-
ref:
|
|
97
|
-
onMouseUp:
|
|
104
|
+
ref: de,
|
|
105
|
+
onMouseUp: ce,
|
|
98
106
|
onMouseDown: (e) => {
|
|
99
|
-
e.detail > 1 && !
|
|
107
|
+
e.detail > 1 && !F && A && e.preventDefault();
|
|
100
108
|
},
|
|
101
109
|
onKeyDown: (e) => {
|
|
102
110
|
switch (e.key) {
|
|
@@ -108,12 +116,12 @@ function ve({ styledTableProps: _, row: t, index: H, columnWindow: { paddingLeft
|
|
|
108
116
|
t.focusPrevRow(), e.preventDefault();
|
|
109
117
|
break;
|
|
110
118
|
case "Enter":
|
|
111
|
-
|
|
119
|
+
T(e);
|
|
112
120
|
break;
|
|
113
121
|
}
|
|
114
122
|
},
|
|
115
123
|
children: [
|
|
116
|
-
m.map((e, i) =>
|
|
124
|
+
m.map((e, i) => E(e, i)),
|
|
117
125
|
u > 0 && /* @__PURE__ */ l("td", {
|
|
118
126
|
"aria-hidden": !0,
|
|
119
127
|
className: n["t-cell"],
|
|
@@ -125,7 +133,7 @@ function ve({ styledTableProps: _, row: t, index: H, columnWindow: { paddingLeft
|
|
|
125
133
|
border: "none"
|
|
126
134
|
}
|
|
127
135
|
}),
|
|
128
|
-
|
|
136
|
+
_.map((e, i) => E(e, m.length + i)),
|
|
129
137
|
f > 0 && /* @__PURE__ */ l("td", {
|
|
130
138
|
"aria-hidden": !0,
|
|
131
139
|
className: n["t-cell"],
|
|
@@ -137,14 +145,14 @@ function ve({ styledTableProps: _, row: t, index: H, columnWindow: { paddingLeft
|
|
|
137
145
|
border: "none"
|
|
138
146
|
}
|
|
139
147
|
}),
|
|
140
|
-
a.map((e, i) =>
|
|
148
|
+
a.map((e, i) => E(e, m.length + _.length + i))
|
|
141
149
|
]
|
|
142
|
-
}), t.getIsExpanded() && /* @__PURE__ */ l(
|
|
143
|
-
rows:
|
|
150
|
+
}), t.getIsExpanded() && /* @__PURE__ */ l(Se, { children: B && G?.({
|
|
151
|
+
rows: B.get(t.original.id.toString()) ?? [],
|
|
144
152
|
row: t.original
|
|
145
153
|
}) })] }, t.id);
|
|
146
154
|
}
|
|
147
|
-
var
|
|
155
|
+
var ye = () => /* @__PURE__ */ C("svg", {
|
|
148
156
|
xmlns: "http://www.w3.org/2000/svg",
|
|
149
157
|
width: "20",
|
|
150
158
|
height: "20",
|
|
@@ -156,5 +164,5 @@ var he = () => /* @__PURE__ */ p("svg", {
|
|
|
156
164
|
})]
|
|
157
165
|
});
|
|
158
166
|
export {
|
|
159
|
-
|
|
167
|
+
Me as TableRow
|
|
160
168
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { EXPAND_COLUMN_ID as
|
|
1
|
+
import { EXPAND_COLUMN_ID as i } from "../../types.js";
|
|
2
2
|
import { ChevronDownIcon as a } from "../../shared-components/ChevronDownIcon.js";
|
|
3
3
|
import { jsx as t } from "react/jsx-runtime";
|
|
4
4
|
import "@tanstack/react-table";
|
|
5
|
-
function
|
|
5
|
+
function f(r, o) {
|
|
6
6
|
return {
|
|
7
|
-
id:
|
|
7
|
+
id: i,
|
|
8
8
|
minSize: 50,
|
|
9
9
|
maxSize: 50,
|
|
10
10
|
size: 50,
|
|
@@ -17,23 +17,27 @@ function p(o, i) {
|
|
|
17
17
|
type: "button",
|
|
18
18
|
"aria-label": n ? "Collapse row" : "Expand row",
|
|
19
19
|
"aria-expanded": n,
|
|
20
|
-
className: "flex w-full items-center justify-center border-0 bg-transparent outline-none focus:outline-none",
|
|
20
|
+
className: "flex w-full items-center justify-center border-0 bg-transparent p-0 outline-none focus:outline-none",
|
|
21
21
|
onClick: () => e.row.getToggleExpandedHandler()(),
|
|
22
|
-
style: { height:
|
|
22
|
+
style: { height: o ?? "auto" },
|
|
23
23
|
children: /* @__PURE__ */ t(a, {
|
|
24
|
+
className: "block size-6 shrink-0",
|
|
24
25
|
width: 24,
|
|
25
26
|
height: 24,
|
|
26
27
|
style: {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
transform: n ? "rotate(180deg)" : "rotate(0deg)",
|
|
29
|
+
transformBox: "fill-box",
|
|
30
|
+
transformOrigin: "center",
|
|
31
|
+
transitionProperty: "transform",
|
|
32
|
+
transitionDuration: "500ms",
|
|
33
|
+
transitionTimingFunction: "cubic-bezier(0.4, 0, 0.2, 1)"
|
|
30
34
|
}
|
|
31
35
|
})
|
|
32
36
|
}) : null;
|
|
33
37
|
},
|
|
34
|
-
fixedLeft:
|
|
38
|
+
fixedLeft: r
|
|
35
39
|
};
|
|
36
40
|
}
|
|
37
41
|
export {
|
|
38
|
-
|
|
42
|
+
f as generateExpandColumn
|
|
39
43
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SHOW_FULL_TEXT_ID as i } from "../../types.js";
|
|
2
|
-
import { ChevronDownIcon as
|
|
2
|
+
import { ChevronDownIcon as s } from "../../shared-components/ChevronDownIcon.js";
|
|
3
3
|
import { StyledButton as l } from "../../shared-components/button/StyledButton.js";
|
|
4
|
-
import { jsx as
|
|
5
|
-
function
|
|
4
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
5
|
+
function f(e, n) {
|
|
6
6
|
return {
|
|
7
7
|
id: i,
|
|
8
8
|
minSize: 38,
|
|
@@ -11,24 +11,24 @@ function g(e, o) {
|
|
|
11
11
|
enableHiding: !1,
|
|
12
12
|
enableSorting: !1,
|
|
13
13
|
header: () => null,
|
|
14
|
-
cell: (r) => /* @__PURE__ */
|
|
14
|
+
cell: (r) => /* @__PURE__ */ o(u, {
|
|
15
15
|
info: r,
|
|
16
|
-
rowHeight:
|
|
16
|
+
rowHeight: n
|
|
17
17
|
}),
|
|
18
18
|
fixedLeft: e
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
const r = e.row.getCanExpand();
|
|
23
|
-
return /* @__PURE__ */
|
|
21
|
+
function u({ info: e, rowHeight: n }) {
|
|
22
|
+
const r = e.row.getCanExpand(), a = e.row.isExpanded();
|
|
23
|
+
return /* @__PURE__ */ o("div", {
|
|
24
24
|
className: "flex w-full items-center justify-center",
|
|
25
|
-
style: { height:
|
|
26
|
-
children: /* @__PURE__ */
|
|
25
|
+
style: { height: n ?? "auto" },
|
|
26
|
+
children: /* @__PURE__ */ o(l, {
|
|
27
27
|
dataTest: "expand-text-button",
|
|
28
28
|
size: "small",
|
|
29
29
|
variant: "textGray",
|
|
30
|
-
onClick: () => {
|
|
31
|
-
r && e.row.getToggleExpandedHandler()(), e.row.toggleExpand();
|
|
30
|
+
onClick: (t) => {
|
|
31
|
+
t.stopPropagation(), r && e.row.getToggleExpandedHandler()(), e.row.toggleExpand();
|
|
32
32
|
},
|
|
33
33
|
onMouseDown: (t) => {
|
|
34
34
|
t.preventDefault(), t.stopPropagation();
|
|
@@ -36,13 +36,17 @@ function s({ info: e, rowHeight: o }) {
|
|
|
36
36
|
onMouseUp: (t) => {
|
|
37
37
|
t.preventDefault(), t.stopPropagation();
|
|
38
38
|
},
|
|
39
|
-
startIcon: /* @__PURE__ */
|
|
39
|
+
startIcon: /* @__PURE__ */ o(s, {
|
|
40
|
+
className: "block size-5 shrink-0",
|
|
40
41
|
width: 20,
|
|
41
42
|
height: 20,
|
|
42
43
|
style: {
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
transform: a ? "rotate(180deg)" : "rotate(0deg)",
|
|
45
|
+
transformBox: "fill-box",
|
|
46
|
+
transformOrigin: "center",
|
|
47
|
+
transitionProperty: "transform",
|
|
45
48
|
transitionDuration: "500ms",
|
|
49
|
+
transitionTimingFunction: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
46
50
|
cursor: "pointer"
|
|
47
51
|
}
|
|
48
52
|
})
|
|
@@ -50,5 +54,5 @@ function s({ info: e, rowHeight: o }) {
|
|
|
50
54
|
});
|
|
51
55
|
}
|
|
52
56
|
export {
|
|
53
|
-
|
|
57
|
+
f as generateShowFullTextColumn
|
|
54
58
|
};
|