asma-ui-core 3.121.4 → 3.121.6
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/pathfinder-card/Pathfinder.module.js +14 -13
- package/dist/components/custom/pathfinder-card/PathfinderCard.js +64 -64
- package/dist/components/utils/popover/PopoverAnatomy.js +24 -27
- package/dist/src/table/types.d.ts +8 -0
- package/dist/table/components/TableRow.js +93 -95
- package/dist/table/components/table-header/TableHeader.js +4 -4
- package/dist/table/custom-features/focus-rows/FocusRowsFeature.js +36 -28
- package/package.json +1 -1
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
root:
|
|
3
|
-
shell:
|
|
4
|
-
shellCompact:
|
|
5
|
-
shellExpanded:
|
|
6
|
-
content:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
var t = "_root_6jgtc_2", e = "_shell_6jgtc_6", _ = "_shellCompact_6jgtc_10", a = "_shellExpanded_6jgtc_14", c = "_content_6jgtc_18", r = "_contentCompact_6jgtc_26", o = "_compactItems_6jgtc_30", m = "_compactItemsStacked_6jgtc_34", s = "_expandedItems_6jgtc_38", l = "_measureRow_6jgtc_42", n = "_measureLayer_6jgtc_46", v = "_chevron_6jgtc_50", d = {
|
|
2
|
+
root: t,
|
|
3
|
+
shell: e,
|
|
4
|
+
shellCompact: _,
|
|
5
|
+
shellExpanded: a,
|
|
6
|
+
content: c,
|
|
7
|
+
contentCompact: r,
|
|
8
|
+
compactItems: o,
|
|
9
|
+
compactItemsStacked: m,
|
|
10
|
+
expandedItems: s,
|
|
11
|
+
measureRow: l,
|
|
12
|
+
measureLayer: n,
|
|
13
|
+
chevron: v
|
|
13
14
|
};
|
|
14
15
|
export {
|
|
15
|
-
|
|
16
|
+
d as default
|
|
16
17
|
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { cn as
|
|
1
|
+
import { cn as g } from "../../../helpers/cn.js";
|
|
2
2
|
import { ChevronDownIcon as j } from "../../icons/chevron-down-icon/ChevronDownIcon.js";
|
|
3
3
|
import { ChevronUpIcon as z } from "../../icons/chevron-up-icon/ChevronUpIcon.js";
|
|
4
|
-
import
|
|
5
|
-
import { useCallback as
|
|
6
|
-
import { Fragment as D, jsx as e, jsxs as
|
|
4
|
+
import o from "./Pathfinder.module.js";
|
|
5
|
+
import { useCallback as C, useEffect as M, useLayoutEffect as O, useMemo as y, useRef as I, useState as x, useSyncExternalStore as P } from "react";
|
|
6
|
+
import { Fragment as D, jsx as e, jsxs as R } from "react/jsx-runtime";
|
|
7
7
|
var _ = typeof window < "u" ? O : M;
|
|
8
8
|
function q() {
|
|
9
|
-
const [i, n] = x(null), a =
|
|
9
|
+
const [i, n] = x(null), a = C((t) => {
|
|
10
10
|
n(t);
|
|
11
|
-
}, []), s =
|
|
11
|
+
}, []), s = C(() => i ? Math.floor(i.getBoundingClientRect().width) : 0, [i]);
|
|
12
12
|
return {
|
|
13
13
|
ref: a,
|
|
14
|
-
width: P(
|
|
14
|
+
width: P(C((t) => {
|
|
15
15
|
if (!i || typeof ResizeObserver > "u") return () => {
|
|
16
16
|
};
|
|
17
17
|
let d = 0;
|
|
18
|
-
const
|
|
18
|
+
const l = new ResizeObserver(() => {
|
|
19
19
|
cancelAnimationFrame(d), d = requestAnimationFrame(t);
|
|
20
20
|
});
|
|
21
|
-
return
|
|
22
|
-
cancelAnimationFrame(d),
|
|
21
|
+
return l.observe(i), () => {
|
|
22
|
+
cancelAnimationFrame(d), l.disconnect();
|
|
23
23
|
};
|
|
24
24
|
}, [i]), s, () => 0)
|
|
25
25
|
};
|
|
@@ -31,80 +31,80 @@ function A(i) {
|
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
function K(i) {
|
|
34
|
-
const { items: n, leadSlot: a, actionSlot: s } = i, t =
|
|
34
|
+
const { items: n, leadSlot: a, actionSlot: s } = i, t = I({}), d = I(null), l = I(null), [m, v] = x({
|
|
35
35
|
itemWidths: {},
|
|
36
36
|
leadWidth: 0,
|
|
37
37
|
actionWidth: 0
|
|
38
|
-
}),
|
|
38
|
+
}), p = I(m);
|
|
39
39
|
M(() => {
|
|
40
|
-
|
|
41
|
-
}, [
|
|
42
|
-
const
|
|
43
|
-
t.current[r] =
|
|
40
|
+
p.current = m;
|
|
41
|
+
}, [m]);
|
|
42
|
+
const h = C((r) => (u) => {
|
|
43
|
+
t.current[r] = u;
|
|
44
44
|
}, []);
|
|
45
45
|
return _(() => {
|
|
46
46
|
const r = {};
|
|
47
|
-
for (const
|
|
48
|
-
const
|
|
49
|
-
r[
|
|
47
|
+
for (const f of n) {
|
|
48
|
+
const k = t.current[f.id], w = Math.ceil(k?.getBoundingClientRect().width ?? f.estimatedWidth ?? 0);
|
|
49
|
+
r[f.id] = w;
|
|
50
50
|
}
|
|
51
|
-
const
|
|
52
|
-
(!(Object.keys(W.itemWidths).length === Object.keys(r).length && n.every((
|
|
51
|
+
const u = a ? Math.ceil(d.current?.getBoundingClientRect().width ?? 0) : 0, N = s ? Math.ceil(l.current?.getBoundingClientRect().width ?? 0) : 0, W = p.current;
|
|
52
|
+
(!(Object.keys(W.itemWidths).length === Object.keys(r).length && n.every((f) => W.itemWidths[f.id] === r[f.id])) || W.leadWidth !== u || W.actionWidth !== N) && v({
|
|
53
53
|
itemWidths: r,
|
|
54
|
-
leadWidth:
|
|
55
|
-
actionWidth:
|
|
54
|
+
leadWidth: u,
|
|
55
|
+
actionWidth: N
|
|
56
56
|
});
|
|
57
57
|
}, [
|
|
58
58
|
n,
|
|
59
59
|
a,
|
|
60
60
|
s
|
|
61
61
|
]), {
|
|
62
|
-
measurements:
|
|
63
|
-
registerItemRef:
|
|
62
|
+
measurements: m,
|
|
63
|
+
registerItemRef: h,
|
|
64
64
|
leadRef: d,
|
|
65
|
-
actionRef:
|
|
65
|
+
actionRef: l
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
68
|
function U(i) {
|
|
69
69
|
const { items: n, availableWidth: a, gapPx: s, itemWidths: t } = i, d = [];
|
|
70
|
-
let
|
|
71
|
-
for (const
|
|
72
|
-
const v = Math.max(0, t[
|
|
73
|
-
if (
|
|
74
|
-
d.push(
|
|
70
|
+
let l = 0;
|
|
71
|
+
for (const m of A(n)) {
|
|
72
|
+
const v = Math.max(0, t[m.id] ?? m.estimatedWidth ?? 0), p = d.length === 0 ? v : l + s + v;
|
|
73
|
+
if (p > a) break;
|
|
74
|
+
d.push(m), l = p;
|
|
75
75
|
}
|
|
76
76
|
return d;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function b({ item: i, compact: n }) {
|
|
79
79
|
return /* @__PURE__ */ e(D, { children: i.render({ compact: n }) });
|
|
80
80
|
}
|
|
81
|
-
function Y({ items: i, expanded: n, onToggleExpanded: a, leadSlot: s, actionSlot: t, className: d, leadReservePx:
|
|
82
|
-
const { ref: v, width:
|
|
81
|
+
function Y({ items: i, expanded: n, onToggleExpanded: a, leadSlot: s, actionSlot: t, className: d, leadReservePx: l = 140, actionReservePx: m = 44 }) {
|
|
82
|
+
const { ref: v, width: p } = q(), h = !n, r = y(() => A(i), [i]), { measurements: u, registerItemRef: N, leadRef: W, actionRef: f } = K({
|
|
83
83
|
items: r,
|
|
84
84
|
leadSlot: s,
|
|
85
85
|
actionSlot: t
|
|
86
|
-
}),
|
|
86
|
+
}), k = y(() => {
|
|
87
87
|
if (n) return r;
|
|
88
|
-
const c = 24, L =
|
|
88
|
+
const c = 24, L = 48, B = s ? Math.max(l, u.leadWidth + 12) : 0, F = t ? Math.max(m, u.actionWidth) : 0;
|
|
89
89
|
return U({
|
|
90
90
|
items: r,
|
|
91
|
-
availableWidth: Math.max(0,
|
|
91
|
+
availableWidth: Math.max(0, p - c - L - B - F),
|
|
92
92
|
gapPx: 12,
|
|
93
|
-
itemWidths:
|
|
93
|
+
itemWidths: u.itemWidths
|
|
94
94
|
});
|
|
95
95
|
}, [
|
|
96
96
|
n,
|
|
97
97
|
r,
|
|
98
|
-
|
|
98
|
+
p,
|
|
99
99
|
s,
|
|
100
100
|
t,
|
|
101
|
-
o,
|
|
102
101
|
l,
|
|
103
|
-
m
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
m,
|
|
103
|
+
u
|
|
104
|
+
]), w = h && k.length < Math.min(2, r.length), E = w ? r.slice(0, 2) : k;
|
|
105
|
+
return /* @__PURE__ */ R("div", {
|
|
106
106
|
ref: v,
|
|
107
|
-
className:
|
|
107
|
+
className: g(o.root, "asma-pressable", h ? "overflow-hidden" : "overflow-visible", d),
|
|
108
108
|
"aria-expanded": n,
|
|
109
109
|
role: "button",
|
|
110
110
|
tabIndex: 0,
|
|
@@ -113,34 +113,34 @@ function Y({ items: i, expanded: n, onToggleExpanded: a, leadSlot: s, actionSlot
|
|
|
113
113
|
(c.key === "Enter" || c.key === " ") && (c.preventDefault(), a());
|
|
114
114
|
},
|
|
115
115
|
children: [
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
className:
|
|
116
|
+
/* @__PURE__ */ R("div", {
|
|
117
|
+
className: g(o.shell, h ? o.shellCompact : o.shellExpanded),
|
|
118
118
|
children: [s ? /* @__PURE__ */ e("div", {
|
|
119
119
|
className: "shrink-0",
|
|
120
120
|
children: s
|
|
121
121
|
}) : null, /* @__PURE__ */ e("div", {
|
|
122
|
-
className:
|
|
123
|
-
children:
|
|
124
|
-
className:
|
|
122
|
+
className: g(o.content, h && o.contentCompact),
|
|
123
|
+
children: h ? /* @__PURE__ */ e("div", {
|
|
124
|
+
className: g(o.compactItems, w && o.compactItemsStacked),
|
|
125
125
|
children: E.map((c) => /* @__PURE__ */ e("div", {
|
|
126
|
-
className: "
|
|
127
|
-
children: /* @__PURE__ */ e(
|
|
126
|
+
className: g("min-w-0 whitespace-nowrap", w ? "w-full" : "shrink"),
|
|
127
|
+
children: /* @__PURE__ */ e(b, {
|
|
128
128
|
item: c,
|
|
129
|
-
compact:
|
|
129
|
+
compact: h
|
|
130
130
|
})
|
|
131
131
|
}, c.id))
|
|
132
|
-
}) : /* @__PURE__ */
|
|
133
|
-
className:
|
|
132
|
+
}) : /* @__PURE__ */ R("div", {
|
|
133
|
+
className: o.expandedItems,
|
|
134
134
|
children: [r.map((c) => /* @__PURE__ */ e("div", {
|
|
135
135
|
className: "shrink-0 whitespace-nowrap",
|
|
136
|
-
children: /* @__PURE__ */ e(
|
|
136
|
+
children: /* @__PURE__ */ e(b, {
|
|
137
137
|
item: c,
|
|
138
|
-
compact:
|
|
138
|
+
compact: h
|
|
139
139
|
})
|
|
140
140
|
}, c.id)), t ? /* @__PURE__ */ e("div", {
|
|
141
141
|
className: "shrink-0",
|
|
142
142
|
children: /* @__PURE__ */ e("div", {
|
|
143
|
-
ref:
|
|
143
|
+
ref: f,
|
|
144
144
|
children: t
|
|
145
145
|
})
|
|
146
146
|
}) : null]
|
|
@@ -148,15 +148,15 @@ function Y({ items: i, expanded: n, onToggleExpanded: a, leadSlot: s, actionSlot
|
|
|
148
148
|
})]
|
|
149
149
|
}),
|
|
150
150
|
/* @__PURE__ */ e("div", {
|
|
151
|
-
className:
|
|
151
|
+
className: o.chevron,
|
|
152
152
|
children: n ? /* @__PURE__ */ e(z, { className: "size-6" }) : /* @__PURE__ */ e(j, { className: "size-6" })
|
|
153
153
|
}),
|
|
154
154
|
/* @__PURE__ */ e("div", {
|
|
155
155
|
"aria-hidden": !0,
|
|
156
156
|
inert: "true",
|
|
157
|
-
className:
|
|
158
|
-
children: /* @__PURE__ */
|
|
159
|
-
className:
|
|
157
|
+
className: o.measureLayer,
|
|
158
|
+
children: /* @__PURE__ */ R("div", {
|
|
159
|
+
className: o.measureRow,
|
|
160
160
|
children: [
|
|
161
161
|
s ? /* @__PURE__ */ e("div", {
|
|
162
162
|
className: "shrink-0",
|
|
@@ -166,9 +166,9 @@ function Y({ items: i, expanded: n, onToggleExpanded: a, leadSlot: s, actionSlot
|
|
|
166
166
|
})
|
|
167
167
|
}) : null,
|
|
168
168
|
r.map((c) => /* @__PURE__ */ e("div", {
|
|
169
|
-
ref:
|
|
169
|
+
ref: N(c.id),
|
|
170
170
|
className: "shrink-0 whitespace-nowrap",
|
|
171
|
-
children: /* @__PURE__ */ e(
|
|
171
|
+
children: /* @__PURE__ */ e(b, {
|
|
172
172
|
item: c,
|
|
173
173
|
compact: !0
|
|
174
174
|
})
|
|
@@ -176,7 +176,7 @@ function Y({ items: i, expanded: n, onToggleExpanded: a, leadSlot: s, actionSlot
|
|
|
176
176
|
t ? /* @__PURE__ */ e("div", {
|
|
177
177
|
className: "shrink-0",
|
|
178
178
|
children: /* @__PURE__ */ e("div", {
|
|
179
|
-
ref:
|
|
179
|
+
ref: f,
|
|
180
180
|
children: t
|
|
181
181
|
})
|
|
182
182
|
}) : null
|
|
@@ -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`,
|
|
@@ -77,6 +77,14 @@ export type StyledTableProps<TData, TCustomData> = {
|
|
|
77
77
|
customActionsNode?: (row: CellContext<TData, unknown>) => ReactNode;
|
|
78
78
|
customSubRowData?: Map<string, TCustomData[]>;
|
|
79
79
|
headerPin?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Pins the internal actions column's body cells to the right edge. By default they are pinned
|
|
82
|
+
* when the column renders actions (`actions` / `customActionsNode`) or the table has fixed-right
|
|
83
|
+
* columns; a column that only hosts the header pin menu scrolls with the data. The header cell
|
|
84
|
+
* with the pin menu stays pinned either way. Not supported as `false` together with fixed-right
|
|
85
|
+
* columns: their body and header offsets would no longer match.
|
|
86
|
+
*/
|
|
87
|
+
stickyActions?: boolean;
|
|
80
88
|
expandArrow?: boolean;
|
|
81
89
|
defaultExpanded?: boolean;
|
|
82
90
|
loading?: boolean;
|
|
@@ -1,57 +1,53 @@
|
|
|
1
|
-
import { ACTIONS_COLUMN_ID as
|
|
2
|
-
import { useRootContext as
|
|
1
|
+
import { ACTIONS_COLUMN_ID as w, INTERNAL_COLUMN_IDS as Re } from "../types.js";
|
|
2
|
+
import { useRootContext as Se } 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
|
-
var
|
|
12
|
-
const
|
|
13
|
-
if (!
|
|
14
|
-
const r = Array.from(document.querySelectorAll('a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])')).
|
|
15
|
-
return
|
|
4
|
+
import { compact as De } from "../../helpers/arrays.js";
|
|
5
|
+
import V from "clsx";
|
|
6
|
+
import { Fragment as Ne, useCallback as Y, useEffect as ve, useLayoutEffect as Ee, useMemo as R, useRef as Ie, useState as ye } from "react";
|
|
7
|
+
import { Fragment as Te, jsx as s, jsxs as S } from "react/jsx-runtime";
|
|
8
|
+
import { useSortable as ke } from "@dnd-kit/sortable";
|
|
9
|
+
import { flexRender as Fe } from "@tanstack/react-table";
|
|
10
|
+
import { CSS as Ae } from "@dnd-kit/utilities";
|
|
11
|
+
var J = (D, t) => {
|
|
12
|
+
const g = D.closest("table");
|
|
13
|
+
if (!g) return !1;
|
|
14
|
+
const N = t === "next" ? Node.DOCUMENT_POSITION_FOLLOWING : Node.DOCUMENT_POSITION_PRECEDING, r = Array.from(document.querySelectorAll('a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])')).filter((p) => !g.contains(p) && !!(g.compareDocumentPosition(p) & N)), l = t === "next" ? r[0] : r.at(-1);
|
|
15
|
+
return l ? (l.focus(), document.activeElement === l) : !1;
|
|
16
16
|
};
|
|
17
|
-
function
|
|
18
|
-
const { loading:
|
|
17
|
+
function je({ styledTableProps: D, row: t, index: g, hasFocusedRow: N, columnWindow: { paddingLeft: r, paddingRight: l, indexes: p } }) {
|
|
18
|
+
const { loading: Q, getRowClassName: a, activeRowId: _, rowHeight: x, onRowClick: v, expandArrow: X, enableDnd: B, disableDndForRow: Z, tdClassName: H, customSubRowData: U, renderSubRows: ee, defaultExpanded: te, actions: E, customActionsNode: ne, stickyActions: ie, textExpandArrow: z, enableMultiRowSelection: oe, enableRowSelection: se, singleSelectionRow: le } = D, I = Z?.(t), { transform: ae, transition: ce, setNodeRef: W, isDragging: P } = ke({
|
|
19
19
|
id: t.original.id,
|
|
20
|
-
disabled: !
|
|
21
|
-
}),
|
|
22
|
-
transform:
|
|
23
|
-
transition:
|
|
24
|
-
opacity:
|
|
25
|
-
zIndex:
|
|
20
|
+
disabled: !B || I
|
|
21
|
+
}), de = {
|
|
22
|
+
transform: Ae.Transform.toString(ae),
|
|
23
|
+
transition: ce,
|
|
24
|
+
opacity: P ? 0.8 : 1,
|
|
25
|
+
zIndex: P ? 1 : 0,
|
|
26
26
|
position: "relative"
|
|
27
|
-
}, { isResizing:
|
|
28
|
-
|
|
29
|
-
!
|
|
30
|
-
}, [
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
}, [
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
}, { isResizing: re, disableResizingFlag: ue } = Se(), y = t.isExpanded(), C = Ie(null), [fe, me] = ye(void 0);
|
|
28
|
+
Ee(() => {
|
|
29
|
+
!y && C.current && me(C.current.cells[0]?.clientHeight ?? C.current.offsetHeight);
|
|
30
|
+
}, [y]);
|
|
31
|
+
const ge = Y((e) => {
|
|
32
|
+
C.current = e, I || W(e);
|
|
33
|
+
}, [I, W]), $ = y ? fe ?? x : x;
|
|
34
|
+
ve(() => {
|
|
35
|
+
te && t.getCanExpand() && !t.getIsExpanded() && t.toggleExpand();
|
|
36
36
|
}, []);
|
|
37
|
-
const
|
|
38
|
-
t.getCanExpand() && !
|
|
39
|
-
const i = window.getSelection()?.type !== "Range" && !
|
|
40
|
-
!o &&
|
|
41
|
-
},
|
|
42
|
-
e.target.classList.contains("MuiModal-backdrop") || e.target.nodeName === "INPUT" || e.target.nodeName === "BUTTON" || e.target.nodeName === "LI" || e.target.closest("li") ||
|
|
43
|
-
},
|
|
37
|
+
const j = (e) => {
|
|
38
|
+
t.getCanExpand() && !X && t.getToggleExpandedHandler()(), document.getElementById(t.id)?.focus();
|
|
39
|
+
const i = window.getSelection()?.type !== "Range" && !re, o = v instanceof Function;
|
|
40
|
+
!o && z && i ? t.toggleExpand() : o && i && v(e, t), ue();
|
|
41
|
+
}, he = (e) => {
|
|
42
|
+
e.target.classList.contains("MuiModal-backdrop") || e.target.nodeName === "INPUT" || e.target.nodeName === "BUTTON" || e.target.nodeName === "LI" || e.target.closest("li") || j(e);
|
|
43
|
+
}, pe = (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()) : J(e.currentTarget, "prev") && e.preventDefault();
|
|
50
|
+
} else J(e.currentTarget, "next") && e.preventDefault();
|
|
55
51
|
break;
|
|
56
52
|
case "ArrowDown":
|
|
57
53
|
t.focusNextRow() && e.preventDefault();
|
|
@@ -60,32 +56,32 @@ function We({ styledTableProps: R, row: t, index: r, hasFocusedRow: g, columnWin
|
|
|
60
56
|
t.focusPrevRow() && e.preventDefault();
|
|
61
57
|
break;
|
|
62
58
|
case "Enter":
|
|
63
|
-
e.preventDefault(),
|
|
59
|
+
e.preventDefault(), j(e);
|
|
64
60
|
break;
|
|
65
61
|
}
|
|
66
|
-
},
|
|
62
|
+
}, c = t.getVisibleCells().map((e, i, o) => ({
|
|
67
63
|
...e,
|
|
68
|
-
left: o.slice(0, i).reduce((
|
|
69
|
-
})),
|
|
64
|
+
left: o.slice(0, i).reduce((f, m) => f + (m.column.getSize() ?? 0), 0)
|
|
65
|
+
})), T = !!E || !!ne, k = c.some((e) => !!e.column.columnDef.fixedRight), d = ie ?? (T || k), q = R(() => c.filter((e) => !e.column.columnDef.fixedLeft && !e.column.columnDef.fixedRight && e.column.id !== "actions"), [c]), h = R(() => c.filter((e) => !!e.column.columnDef.fixedRight || e.column.id === "actions" && d).map((e, i, o) => ({
|
|
70
66
|
...e,
|
|
71
|
-
right: o.slice(i + 1).reduce((
|
|
72
|
-
})), [
|
|
73
|
-
const o = e.column.id ===
|
|
67
|
+
right: o.slice(i + 1).reduce((f, m) => f + (m.column.getSize() ?? 0), 0)
|
|
68
|
+
})), [c, d]), G = R(() => h.some((e) => e.column.id === w), [h]), K = d ? void 0 : c.find((e) => e.column.id === w), u = R(() => c.filter((e) => e.column.columnDef.fixedLeft), [c]), F = !oe && !se && le, A = t.getIsSelected() && F, L = v instanceof Function, M = p.length > 0 ? De(p.map((e) => q[e])) : q, b = Y((e, i) => {
|
|
69
|
+
const o = e.column.id === w, f = e.column.columnDef.fixedLeft, m = !!e.column.columnDef.fixedRight, xe = e.id === u.at(-1)?.id, Ce = e.id === h.at(0)?.id && !o, be = t.isExpanded(), O = i === 0;
|
|
74
70
|
return /* @__PURE__ */ s("td", {
|
|
75
|
-
className:
|
|
71
|
+
className: V(n["t-cell"], !Re.includes(e.column.id) && e.column.getSize() > 64 && n["data-cell"], e.column.id === "select" && n["select-cell"], L && "cursor-pointer", H, o && d && n["action-cell"], o && d && (!T || k) && n["action-cell--no-shadow"], o && d && !!E && u.length && n.shadowed, o && d && (a?.(t) ? a?.(t) : n["action-cell-default-background"]), f && n["fixed-cell"], m && n["fixed-right-cell"], xe && n.shadowed, Ce && n["shadowed-right"], t.getIsSelected() && n.selected, f && (a?.(t) ? a?.(t) : n["fixed-cell-default-background"]), m && (a?.(t) ? a?.(t) : n["fixed-right-cell-default-background"]), be && n.expanded_row, !!A && n["single-selection"]),
|
|
76
72
|
style: {
|
|
77
|
-
left:
|
|
78
|
-
right:
|
|
73
|
+
left: f ? e.left : void 0,
|
|
74
|
+
right: m ? e.right + (G ? -1 : 0) : void 0
|
|
79
75
|
},
|
|
80
|
-
children: /* @__PURE__ */
|
|
76
|
+
children: /* @__PURE__ */ S("div", {
|
|
81
77
|
style: {
|
|
82
78
|
display: "flex",
|
|
83
79
|
alignItems: "center",
|
|
84
|
-
minWidth:
|
|
85
|
-
minHeight:
|
|
80
|
+
minWidth: O ? 32 : void 0,
|
|
81
|
+
minHeight: $,
|
|
86
82
|
position: "relative"
|
|
87
83
|
},
|
|
88
|
-
children: [
|
|
84
|
+
children: [O && A && /* @__PURE__ */ s("span", {
|
|
89
85
|
style: {
|
|
90
86
|
display: "inline-flex",
|
|
91
87
|
alignItems: "center",
|
|
@@ -94,85 +90,87 @@ 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(Le, {})
|
|
98
94
|
}), /* @__PURE__ */ s("span", {
|
|
99
95
|
style: {
|
|
100
|
-
marginLeft:
|
|
96
|
+
marginLeft: O && F ? 30 : 0,
|
|
101
97
|
width: "100%"
|
|
102
98
|
},
|
|
103
|
-
children:
|
|
99
|
+
children: Fe(e.column.columnDef.cell, e.getContext())
|
|
104
100
|
})]
|
|
105
101
|
})
|
|
106
102
|
}, e.id);
|
|
107
103
|
}, [
|
|
104
|
+
A,
|
|
108
105
|
E,
|
|
109
|
-
D,
|
|
110
|
-
H,
|
|
111
|
-
l,
|
|
112
|
-
I,
|
|
113
|
-
W,
|
|
114
106
|
$,
|
|
115
|
-
f,
|
|
116
107
|
a,
|
|
108
|
+
L,
|
|
109
|
+
G,
|
|
110
|
+
k,
|
|
111
|
+
u,
|
|
112
|
+
h,
|
|
117
113
|
t,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
114
|
+
T,
|
|
115
|
+
d,
|
|
116
|
+
F,
|
|
117
|
+
H
|
|
121
118
|
]);
|
|
122
|
-
return /* @__PURE__ */
|
|
119
|
+
return /* @__PURE__ */ S(Ne, { children: [/* @__PURE__ */ S("tr", {
|
|
123
120
|
"aria-selected": t.getIsSelected() || t.isFocused() ? "true" : "false",
|
|
124
|
-
tabIndex: t.isFocused() ||
|
|
125
|
-
"data-index":
|
|
121
|
+
tabIndex: t.isFocused() || g === 0 && !N ? 0 : -1,
|
|
122
|
+
"data-index": g,
|
|
126
123
|
"data-test": t.id,
|
|
127
|
-
"data-active":
|
|
124
|
+
"data-active": _ != null && t.id === _ ? "true" : void 0,
|
|
128
125
|
id: t.id,
|
|
129
|
-
className:
|
|
126
|
+
className: V(n["t-row"], Q && n["is-loading"], a?.(t)),
|
|
130
127
|
style: {
|
|
131
128
|
height: x ? `${x}px` : "inherit",
|
|
132
|
-
...
|
|
129
|
+
...B && de
|
|
133
130
|
},
|
|
134
|
-
ref:
|
|
131
|
+
ref: ge,
|
|
135
132
|
onFocus: (e) => {
|
|
136
133
|
e.target === e.currentTarget && !t.isFocused() && t.onChangeFocused(!0);
|
|
137
134
|
},
|
|
138
|
-
onMouseUp:
|
|
135
|
+
onMouseUp: he,
|
|
139
136
|
onMouseDown: (e) => {
|
|
140
|
-
e.detail > 1 && !
|
|
137
|
+
e.detail > 1 && !L && z && e.preventDefault();
|
|
141
138
|
},
|
|
142
|
-
onKeyDownCapture:
|
|
139
|
+
onKeyDownCapture: pe,
|
|
143
140
|
children: [
|
|
144
|
-
|
|
145
|
-
|
|
141
|
+
u.map((e, i) => b(e, i)),
|
|
142
|
+
r > 0 && /* @__PURE__ */ s("td", {
|
|
146
143
|
"aria-hidden": !0,
|
|
147
144
|
className: n["t-cell"],
|
|
148
145
|
style: {
|
|
149
|
-
width: String(
|
|
150
|
-
minWidth: String(
|
|
151
|
-
maxWidth: String(
|
|
146
|
+
width: String(r) + "px",
|
|
147
|
+
minWidth: String(r) + "px",
|
|
148
|
+
maxWidth: String(r) + "px",
|
|
152
149
|
padding: 0,
|
|
153
150
|
border: "none"
|
|
154
151
|
}
|
|
155
152
|
}),
|
|
156
|
-
|
|
157
|
-
|
|
153
|
+
M.map((e, i) => b(e, u.length + i)),
|
|
154
|
+
l > 0 && /* @__PURE__ */ s("td", {
|
|
158
155
|
"aria-hidden": !0,
|
|
159
156
|
className: n["t-cell"],
|
|
160
157
|
style: {
|
|
161
|
-
width: String(
|
|
162
|
-
minWidth: String(
|
|
163
|
-
maxWidth: String(
|
|
158
|
+
width: String(l) + "px",
|
|
159
|
+
minWidth: String(l) + "px",
|
|
160
|
+
maxWidth: String(l) + "px",
|
|
164
161
|
padding: 0,
|
|
165
162
|
border: "none"
|
|
166
163
|
}
|
|
167
164
|
}),
|
|
168
|
-
|
|
165
|
+
h.map((e, i) => b(e, u.length + M.length + i)),
|
|
166
|
+
K && b(K, u.length + M.length + h.length)
|
|
169
167
|
]
|
|
170
|
-
}), t.getIsExpanded() && /* @__PURE__ */ s(
|
|
171
|
-
rows:
|
|
168
|
+
}), t.getIsExpanded() && /* @__PURE__ */ s(Te, { children: U && ee?.({
|
|
169
|
+
rows: U.get(t.original.id.toString()) ?? [],
|
|
172
170
|
row: t.original
|
|
173
171
|
}) })] }, t.id);
|
|
174
172
|
}
|
|
175
|
-
var
|
|
173
|
+
var Le = () => /* @__PURE__ */ S("svg", {
|
|
176
174
|
xmlns: "http://www.w3.org/2000/svg",
|
|
177
175
|
width: "20",
|
|
178
176
|
height: "20",
|
|
@@ -184,5 +182,5 @@ var ke = () => /* @__PURE__ */ C("svg", {
|
|
|
184
182
|
})]
|
|
185
183
|
});
|
|
186
184
|
export {
|
|
187
|
-
|
|
185
|
+
je as TableRow
|
|
188
186
|
};
|