@wallarm-org/design-system 4.19.0-rc-fix-ci.1 → 4.19.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/components/Table/StickyGroupParent.d.ts +10 -1
- package/dist/components/Table/StickyGroupParent.js +26 -14
- package/dist/components/Table/TableInner/TableInnerWindow.js +159 -132
- package/dist/components/Table/TableMasterCellActions.js +1 -1
- package/dist/components/Table/TableRow.js +117 -115
- package/dist/components/Table/hooks/infiniteScroll/useInfiniteScroll.js +22 -18
- package/dist/components/Table/hooks/infiniteScroll/useScrollEdge.d.ts +8 -3
- package/dist/components/Table/hooks/infiniteScroll/useScrollEdge.js +21 -15
- package/dist/components/Table/hooks/useStickyGroupParent.d.ts +8 -2
- package/dist/components/Table/hooks/useStickyGroupParent.js +38 -38
- package/dist/metadata/components.json +11 -1
- package/package.json +1 -1
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
import { type FC } from 'react';
|
|
1
|
+
import { type FC, type RefObject } from 'react';
|
|
2
|
+
import { type ScrollRoot } from './lib/index.js';
|
|
2
3
|
interface StickyGroupParentProps {
|
|
3
4
|
tableWidth: number;
|
|
4
5
|
headerHeight: number;
|
|
6
|
+
/**
|
|
7
|
+
* `virtualized='window'`: the resolved scroll root. The overlay is then drawn
|
|
8
|
+
* by the caller inside the sticky header shell, right under `headerRef`: the
|
|
9
|
+
* body's horizontal scroll viewport never scrolls vertically, so nothing in it
|
|
10
|
+
* can stick.
|
|
11
|
+
*/
|
|
12
|
+
windowScrollRoot?: ScrollRoot | null;
|
|
13
|
+
headerRef?: RefObject<HTMLElement | null>;
|
|
5
14
|
}
|
|
6
15
|
export declare const StickyGroupParent: FC<StickyGroupParentProps>;
|
|
7
16
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useRef } from "react";
|
|
2
|
+
import { useEffect, useLayoutEffect, useRef } from "react";
|
|
3
3
|
import { cn } from "../../utils/cn.js";
|
|
4
4
|
import { useStickyGroupParent } from "./hooks/index.js";
|
|
5
|
-
import { TABLE_DRAG_HANDLE_COLUMN_ID, TABLE_EXPAND_COLUMN_ID, TABLE_SELECT_COLUMN_ID, useRenderEveryTime, useTableValue, withTableState } from "./lib/index.js";
|
|
5
|
+
import { TABLE_DRAG_HANDLE_COLUMN_ID, TABLE_EXPAND_COLUMN_ID, TABLE_SELECT_COLUMN_ID, scrollRootBy, useRenderEveryTime, useTableValue, withTableState } from "./lib/index.js";
|
|
6
6
|
import { Td, Tr } from "./primitives/index.js";
|
|
7
7
|
import { TableBodyCell } from "./TableBody/TableBodyCell.js";
|
|
8
8
|
import { TableColGroup } from "./TableColGroup.js";
|
|
@@ -13,13 +13,14 @@ const SYSTEM_COLUMN_IDS = new Set([
|
|
|
13
13
|
TABLE_SELECT_COLUMN_ID,
|
|
14
14
|
TABLE_DRAG_HANDLE_COLUMN_ID
|
|
15
15
|
]);
|
|
16
|
-
const StickyGroupParent = ({ tableWidth, headerHeight })=>{
|
|
17
|
-
const { table, containerRef, tbodyRef, virtualizerRef,
|
|
18
|
-
const useWindowScroll =
|
|
16
|
+
const StickyGroupParent = ({ tableWidth, headerHeight, windowScrollRoot, headerRef })=>{
|
|
17
|
+
const { table, containerRef, tbodyRef, virtualizerRef, renderFullWidthGroupRow } = useTableContext();
|
|
18
|
+
const useWindowScroll = null != windowScrollRoot;
|
|
19
19
|
const { stickyRow, pushUpOffset } = useStickyGroupParent({
|
|
20
20
|
table,
|
|
21
21
|
scrollElementRef: containerRef,
|
|
22
|
-
|
|
22
|
+
windowScrollRoot,
|
|
23
|
+
headerRef,
|
|
23
24
|
headerHeight,
|
|
24
25
|
tbodyRef,
|
|
25
26
|
virtualizerRef,
|
|
@@ -42,11 +43,9 @@ const StickyGroupParent = ({ tableWidth, headerHeight })=>{
|
|
|
42
43
|
const tbodyEl = tbodyRef.current;
|
|
43
44
|
if (tbodyEl) {
|
|
44
45
|
const rowEl = tbodyEl.querySelector(`[data-row-id="${stickyRow.id}"]`);
|
|
45
|
-
if (rowEl instanceof HTMLElement) if (
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
top: window.scrollY + rect.top - headerHeight
|
|
49
|
-
});
|
|
46
|
+
if (rowEl instanceof HTMLElement) if (windowScrollRoot) {
|
|
47
|
+
const headerBottom = headerRef?.current?.getBoundingClientRect().bottom ?? headerHeight;
|
|
48
|
+
scrollRootBy(windowScrollRoot, rowEl.getBoundingClientRect().top - headerBottom);
|
|
50
49
|
} else scrollElement.scrollTop = rowEl.offsetTop + (tbodyEl.offsetTop || 0) - headerHeight;
|
|
51
50
|
}
|
|
52
51
|
}
|
|
@@ -57,7 +56,8 @@ const StickyGroupParent = ({ tableWidth, headerHeight })=>{
|
|
|
57
56
|
stickyRow,
|
|
58
57
|
containerRef,
|
|
59
58
|
tbodyRef,
|
|
60
|
-
|
|
59
|
+
windowScrollRoot,
|
|
60
|
+
headerRef,
|
|
61
61
|
headerHeight
|
|
62
62
|
]);
|
|
63
63
|
const cells = useTableValue(()=>stickyRow?.getVisibleCells());
|
|
@@ -67,9 +67,21 @@ const StickyGroupParent = ({ tableWidth, headerHeight })=>{
|
|
|
67
67
|
const isSelected = useTableValue(()=>stickyRow?.getIsAllSubRowsSelected());
|
|
68
68
|
const fullWidthContent = useRenderEveryTime(()=>stickyRow ? renderFullWidthGroupRow?.(stickyRow) : void 0);
|
|
69
69
|
const isFullWidth = void 0 !== fullWidthContent;
|
|
70
|
+
const anchorRef = useRef(null);
|
|
71
|
+
useLayoutEffect(()=>{
|
|
72
|
+
const wrapper = anchorRef.current?.parentElement;
|
|
73
|
+
if (useWindowScroll && stickyRow && wrapper && containerRef.current) wrapper.scrollLeft = containerRef.current.scrollLeft;
|
|
74
|
+
}, [
|
|
75
|
+
useWindowScroll,
|
|
76
|
+
stickyRow,
|
|
77
|
+
containerRef
|
|
78
|
+
]);
|
|
70
79
|
return /*#__PURE__*/ jsx("div", {
|
|
71
|
-
|
|
72
|
-
|
|
80
|
+
ref: anchorRef,
|
|
81
|
+
className: cn('pointer-events-none', !useWindowScroll && 'sticky z-[21] h-0 overflow-visible'),
|
|
82
|
+
style: useWindowScroll ? {
|
|
83
|
+
width: tableWidth
|
|
84
|
+
} : {
|
|
73
85
|
top: headerHeight
|
|
74
86
|
},
|
|
75
87
|
"aria-hidden": "true",
|
|
@@ -4,7 +4,7 @@ import { useEffect, useRef } from "react";
|
|
|
4
4
|
import { useTestId } from "../../../utils/testId.js";
|
|
5
5
|
import { ScrollArea, ScrollAreaScrollbar, ScrollAreaViewport } from "../../ScrollArea/index.js";
|
|
6
6
|
import { WindowScrollRootContext, useInfiniteScroll, useWheelHorizontalScroll, useWindowScrollRoot } from "../hooks/index.js";
|
|
7
|
-
import { useContainerWidth } from "../lib/index.js";
|
|
7
|
+
import { isWindowScrollRoot, useContainerWidth } from "../lib/index.js";
|
|
8
8
|
import { StickyGroupParent } from "../StickyGroupParent.js";
|
|
9
9
|
import { TableBody } from "../TableBody/index.js";
|
|
10
10
|
import { TableColGroup } from "../TableColGroup.js";
|
|
@@ -12,11 +12,12 @@ import { useTableContext } from "../TableContext/index.js";
|
|
|
12
12
|
import { TableHead } from "../TableHead.js";
|
|
13
13
|
import { TableSettingsMenuSlot } from "../TableSettingsMenu/index.js";
|
|
14
14
|
const TableInnerWindow = (t0)=>{
|
|
15
|
-
const $ = c(
|
|
15
|
+
const $ = c(73);
|
|
16
16
|
const { isEmpty, showSettings, hasConsumerSettingsMenu, ariaLabel, children } = t0;
|
|
17
17
|
const { containerRef, headerScrollRef, table, virtualizerRef, tbodyRef, hasSubRowGrouping, onEndReached, onEndReachedThreshold, onStartReached, onStartReachedThreshold, initialScrollToRowId, isLoadingPrevious } = useTableContext();
|
|
18
18
|
const testId = useTestId("window");
|
|
19
19
|
const rootRef = useRef(null);
|
|
20
|
+
const groupScrollRef = useRef(null);
|
|
20
21
|
const containerWidth = useContainerWidth(rootRef);
|
|
21
22
|
let t1;
|
|
22
23
|
if ($[0] !== isEmpty || $[1] !== table) {
|
|
@@ -64,6 +65,7 @@ const TableInnerWindow = (t0)=>{
|
|
|
64
65
|
const onScroll = ()=>{
|
|
65
66
|
rootRef.current?.toggleAttribute("data-scrolled", scrollEl.scrollLeft > 0);
|
|
66
67
|
if (headerScrollRef.current) headerScrollRef.current.scrollLeft = scrollEl.scrollLeft;
|
|
68
|
+
if (groupScrollRef.current) groupScrollRef.current.scrollLeft = scrollEl.scrollLeft;
|
|
67
69
|
};
|
|
68
70
|
scrollEl.addEventListener("scroll", onScroll, {
|
|
69
71
|
passive: true
|
|
@@ -95,188 +97,213 @@ const TableInnerWindow = (t0)=>{
|
|
|
95
97
|
const hasTextDescription = table.getAllLeafColumns().some(_temp);
|
|
96
98
|
const headerHeight = hasTextDescription ? 48 : 32;
|
|
97
99
|
let t7;
|
|
98
|
-
if ($[20] !==
|
|
99
|
-
t7 =
|
|
100
|
-
|
|
101
|
-
};
|
|
102
|
-
$[20] = tableWidth;
|
|
100
|
+
if ($[20] !== scrollRoot) {
|
|
101
|
+
t7 = scrollRoot && !isWindowScrollRoot(scrollRoot) ? -Number.parseFloat(getComputedStyle(scrollRoot).paddingTop) || 0 : 0;
|
|
102
|
+
$[20] = scrollRoot;
|
|
103
103
|
$[21] = t7;
|
|
104
104
|
} else t7 = $[21];
|
|
105
|
+
const shellTop = t7;
|
|
105
106
|
let t8;
|
|
106
|
-
if ($[22] !==
|
|
107
|
-
t8 =
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
$[22] =
|
|
107
|
+
if ($[22] !== shellTop) {
|
|
108
|
+
t8 = {
|
|
109
|
+
top: shellTop
|
|
110
|
+
};
|
|
111
|
+
$[22] = shellTop;
|
|
111
112
|
$[23] = t8;
|
|
112
113
|
} else t8 = $[23];
|
|
113
114
|
let t9;
|
|
114
|
-
if ($[24]
|
|
115
|
-
t9 =
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
if ($[24] !== tableWidth) {
|
|
116
|
+
t9 = {
|
|
117
|
+
width: tableWidth
|
|
118
|
+
};
|
|
119
|
+
$[24] = tableWidth;
|
|
120
|
+
$[25] = t9;
|
|
121
|
+
} else t9 = $[25];
|
|
118
122
|
let t10;
|
|
119
|
-
if ($[
|
|
120
|
-
t10 = /*#__PURE__*/
|
|
123
|
+
if ($[26] !== tableWidth) {
|
|
124
|
+
t10 = /*#__PURE__*/ jsx(TableColGroup, {
|
|
125
|
+
tableWidth: tableWidth
|
|
126
|
+
});
|
|
127
|
+
$[26] = tableWidth;
|
|
128
|
+
$[27] = t10;
|
|
129
|
+
} else t10 = $[27];
|
|
130
|
+
let t11;
|
|
131
|
+
if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
|
|
132
|
+
t11 = /*#__PURE__*/ jsx(TableHead, {});
|
|
133
|
+
$[28] = t11;
|
|
134
|
+
} else t11 = $[28];
|
|
135
|
+
let t12;
|
|
136
|
+
if ($[29] !== t10 || $[30] !== t9) {
|
|
137
|
+
t12 = /*#__PURE__*/ jsxs("table", {
|
|
121
138
|
className: "table-fixed border-separate border-spacing-0",
|
|
122
|
-
style:
|
|
139
|
+
style: t9,
|
|
123
140
|
"aria-hidden": true,
|
|
124
141
|
children: [
|
|
125
|
-
|
|
126
|
-
|
|
142
|
+
t10,
|
|
143
|
+
t11
|
|
127
144
|
]
|
|
128
145
|
});
|
|
129
|
-
$[
|
|
130
|
-
$[
|
|
131
|
-
$[
|
|
132
|
-
} else
|
|
133
|
-
let
|
|
134
|
-
if ($[
|
|
135
|
-
|
|
146
|
+
$[29] = t10;
|
|
147
|
+
$[30] = t9;
|
|
148
|
+
$[31] = t12;
|
|
149
|
+
} else t12 = $[31];
|
|
150
|
+
let t13;
|
|
151
|
+
if ($[32] !== headerScrollRef || $[33] !== t12) {
|
|
152
|
+
t13 = /*#__PURE__*/ jsx("div", {
|
|
136
153
|
ref: headerScrollRef,
|
|
137
154
|
className: "overflow-hidden",
|
|
138
|
-
children:
|
|
139
|
-
});
|
|
140
|
-
$[28] = headerScrollRef;
|
|
141
|
-
$[29] = t10;
|
|
142
|
-
$[30] = t11;
|
|
143
|
-
} else t11 = $[30];
|
|
144
|
-
let t12;
|
|
145
|
-
if ($[31] !== hasConsumerSettingsMenu || $[32] !== showSettings) {
|
|
146
|
-
t12 = showSettings && /*#__PURE__*/ jsx(TableSettingsMenuSlot, {
|
|
147
|
-
hasConsumerMenu: hasConsumerSettingsMenu
|
|
155
|
+
children: t12
|
|
148
156
|
});
|
|
149
|
-
$[
|
|
150
|
-
$[32] = showSettings;
|
|
157
|
+
$[32] = headerScrollRef;
|
|
151
158
|
$[33] = t12;
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
if ($[34] !== t11 || $[35] !== t12) {
|
|
155
|
-
t13 = /*#__PURE__*/ jsxs("div", {
|
|
156
|
-
className: "sticky top-0 z-30",
|
|
157
|
-
children: [
|
|
158
|
-
t11,
|
|
159
|
-
t12
|
|
160
|
-
]
|
|
161
|
-
});
|
|
162
|
-
$[34] = t11;
|
|
163
|
-
$[35] = t12;
|
|
164
|
-
$[36] = t13;
|
|
165
|
-
} else t13 = $[36];
|
|
159
|
+
$[34] = t13;
|
|
160
|
+
} else t13 = $[34];
|
|
166
161
|
let t14;
|
|
167
|
-
if ($[
|
|
168
|
-
t14 = {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
162
|
+
if ($[35] !== hasConsumerSettingsMenu || $[36] !== showSettings) {
|
|
163
|
+
t14 = showSettings && /*#__PURE__*/ jsx(TableSettingsMenuSlot, {
|
|
164
|
+
hasConsumerMenu: hasConsumerSettingsMenu
|
|
165
|
+
});
|
|
166
|
+
$[35] = hasConsumerSettingsMenu;
|
|
167
|
+
$[36] = showSettings;
|
|
172
168
|
$[37] = t14;
|
|
173
169
|
} else t14 = $[37];
|
|
174
170
|
let t15;
|
|
175
|
-
if ($[38] !== hasSubRowGrouping || $[39] !== headerHeight || $[40] !== tableWidth) {
|
|
176
|
-
t15 = hasSubRowGrouping && /*#__PURE__*/ jsx(
|
|
177
|
-
|
|
178
|
-
|
|
171
|
+
if ($[38] !== hasSubRowGrouping || $[39] !== headerHeight || $[40] !== headerScrollRef || $[41] !== scrollRoot || $[42] !== tableWidth) {
|
|
172
|
+
t15 = hasSubRowGrouping && /*#__PURE__*/ jsx("div", {
|
|
173
|
+
ref: groupScrollRef,
|
|
174
|
+
className: "pointer-events-none absolute inset-x-0 top-full overflow-hidden",
|
|
175
|
+
children: /*#__PURE__*/ jsx(StickyGroupParent, {
|
|
176
|
+
tableWidth: tableWidth,
|
|
177
|
+
headerHeight: headerHeight,
|
|
178
|
+
windowScrollRoot: scrollRoot,
|
|
179
|
+
headerRef: headerScrollRef
|
|
180
|
+
})
|
|
179
181
|
});
|
|
180
182
|
$[38] = hasSubRowGrouping;
|
|
181
183
|
$[39] = headerHeight;
|
|
182
|
-
$[40] =
|
|
183
|
-
$[41] =
|
|
184
|
-
|
|
184
|
+
$[40] = headerScrollRef;
|
|
185
|
+
$[41] = scrollRoot;
|
|
186
|
+
$[42] = tableWidth;
|
|
187
|
+
$[43] = t15;
|
|
188
|
+
} else t15 = $[43];
|
|
185
189
|
let t16;
|
|
186
|
-
if ($[
|
|
187
|
-
t16 = {
|
|
190
|
+
if ($[44] !== t13 || $[45] !== t14 || $[46] !== t15 || $[47] !== t8) {
|
|
191
|
+
t16 = /*#__PURE__*/ jsxs("div", {
|
|
192
|
+
className: "sticky z-30",
|
|
193
|
+
style: t8,
|
|
194
|
+
children: [
|
|
195
|
+
t13,
|
|
196
|
+
t14,
|
|
197
|
+
t15
|
|
198
|
+
]
|
|
199
|
+
});
|
|
200
|
+
$[44] = t13;
|
|
201
|
+
$[45] = t14;
|
|
202
|
+
$[46] = t15;
|
|
203
|
+
$[47] = t8;
|
|
204
|
+
$[48] = t16;
|
|
205
|
+
} else t16 = $[48];
|
|
206
|
+
let t17;
|
|
207
|
+
if ($[49] === Symbol.for("react.memo_cache_sentinel")) {
|
|
208
|
+
t17 = {
|
|
209
|
+
overflowX: "auto",
|
|
210
|
+
overflowY: "hidden"
|
|
211
|
+
};
|
|
212
|
+
$[49] = t17;
|
|
213
|
+
} else t17 = $[49];
|
|
214
|
+
let t18;
|
|
215
|
+
if ($[50] !== tableWidth) {
|
|
216
|
+
t18 = {
|
|
188
217
|
width: tableWidth
|
|
189
218
|
};
|
|
190
|
-
$[
|
|
191
|
-
$[
|
|
192
|
-
} else
|
|
193
|
-
let
|
|
194
|
-
if ($[
|
|
195
|
-
|
|
219
|
+
$[50] = tableWidth;
|
|
220
|
+
$[51] = t18;
|
|
221
|
+
} else t18 = $[51];
|
|
222
|
+
let t19;
|
|
223
|
+
if ($[52] !== tableWidth) {
|
|
224
|
+
t19 = /*#__PURE__*/ jsx(TableColGroup, {
|
|
196
225
|
tableWidth: tableWidth
|
|
197
226
|
});
|
|
198
|
-
$[
|
|
199
|
-
$[
|
|
200
|
-
} else
|
|
201
|
-
let
|
|
202
|
-
if ($[
|
|
203
|
-
|
|
227
|
+
$[52] = tableWidth;
|
|
228
|
+
$[53] = t19;
|
|
229
|
+
} else t19 = $[53];
|
|
230
|
+
let t20;
|
|
231
|
+
if ($[54] !== isEmpty || $[55] !== scrollRoot) {
|
|
232
|
+
t20 = !isEmpty && /*#__PURE__*/ jsx(WindowScrollRootContext.Provider, {
|
|
204
233
|
value: scrollRoot,
|
|
205
234
|
children: /*#__PURE__*/ jsx(TableBody, {})
|
|
206
235
|
});
|
|
207
|
-
$[
|
|
208
|
-
$[
|
|
209
|
-
$[
|
|
210
|
-
} else
|
|
211
|
-
let
|
|
212
|
-
if ($[
|
|
213
|
-
|
|
236
|
+
$[54] = isEmpty;
|
|
237
|
+
$[55] = scrollRoot;
|
|
238
|
+
$[56] = t20;
|
|
239
|
+
} else t20 = $[56];
|
|
240
|
+
let t21;
|
|
241
|
+
if ($[57] !== ariaLabel || $[58] !== t18 || $[59] !== t19 || $[60] !== t20) {
|
|
242
|
+
t21 = /*#__PURE__*/ jsxs("table", {
|
|
214
243
|
className: "table-fixed border-separate border-spacing-0",
|
|
215
|
-
style:
|
|
244
|
+
style: t18,
|
|
216
245
|
"aria-label": ariaLabel,
|
|
217
246
|
children: [
|
|
218
|
-
|
|
219
|
-
|
|
247
|
+
t19,
|
|
248
|
+
t20
|
|
220
249
|
]
|
|
221
250
|
});
|
|
222
|
-
$[
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
225
|
-
$[
|
|
226
|
-
$[
|
|
227
|
-
} else
|
|
228
|
-
let
|
|
229
|
-
if ($[
|
|
230
|
-
|
|
251
|
+
$[57] = ariaLabel;
|
|
252
|
+
$[58] = t18;
|
|
253
|
+
$[59] = t19;
|
|
254
|
+
$[60] = t20;
|
|
255
|
+
$[61] = t21;
|
|
256
|
+
} else t21 = $[61];
|
|
257
|
+
let t22;
|
|
258
|
+
if ($[62] !== children || $[63] !== containerRef || $[64] !== t21) {
|
|
259
|
+
t22 = /*#__PURE__*/ jsxs(ScrollAreaViewport, {
|
|
231
260
|
ref: containerRef,
|
|
232
261
|
"data-table-scroll-container": true,
|
|
233
|
-
style:
|
|
262
|
+
style: t17,
|
|
234
263
|
children: [
|
|
235
|
-
|
|
236
|
-
t19,
|
|
264
|
+
t21,
|
|
237
265
|
children
|
|
238
266
|
]
|
|
239
267
|
});
|
|
240
|
-
$[
|
|
241
|
-
$[
|
|
242
|
-
$[
|
|
243
|
-
$[
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
t21 = /*#__PURE__*/ jsx(ScrollAreaScrollbar, {
|
|
268
|
+
$[62] = children;
|
|
269
|
+
$[63] = containerRef;
|
|
270
|
+
$[64] = t21;
|
|
271
|
+
$[65] = t22;
|
|
272
|
+
} else t22 = $[65];
|
|
273
|
+
let t23;
|
|
274
|
+
if ($[66] === Symbol.for("react.memo_cache_sentinel")) {
|
|
275
|
+
t23 = /*#__PURE__*/ jsx(ScrollAreaScrollbar, {
|
|
249
276
|
orientation: "horizontal"
|
|
250
277
|
});
|
|
251
|
-
$[
|
|
252
|
-
} else
|
|
253
|
-
let
|
|
254
|
-
if ($[
|
|
255
|
-
|
|
278
|
+
$[66] = t23;
|
|
279
|
+
} else t23 = $[66];
|
|
280
|
+
let t24;
|
|
281
|
+
if ($[67] !== t16 || $[68] !== t22) {
|
|
282
|
+
t24 = /*#__PURE__*/ jsxs(ScrollArea, {
|
|
256
283
|
className: "group/scroll rounded-12 border border-border-primary-light",
|
|
257
284
|
children: [
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
285
|
+
t16,
|
|
286
|
+
t22,
|
|
287
|
+
t23
|
|
261
288
|
]
|
|
262
289
|
});
|
|
263
|
-
$[
|
|
264
|
-
$[
|
|
265
|
-
$[
|
|
266
|
-
} else
|
|
267
|
-
let
|
|
268
|
-
if ($[
|
|
269
|
-
|
|
290
|
+
$[67] = t16;
|
|
291
|
+
$[68] = t22;
|
|
292
|
+
$[69] = t24;
|
|
293
|
+
} else t24 = $[69];
|
|
294
|
+
let t25;
|
|
295
|
+
if ($[70] !== t24 || $[71] !== testId) {
|
|
296
|
+
t25 = /*#__PURE__*/ jsx("div", {
|
|
270
297
|
ref: rootRef,
|
|
271
298
|
"data-testid": testId,
|
|
272
299
|
className: "group/scroll relative outline-none",
|
|
273
|
-
children:
|
|
300
|
+
children: t24
|
|
274
301
|
});
|
|
275
|
-
$[
|
|
276
|
-
$[
|
|
277
|
-
$[
|
|
278
|
-
} else
|
|
279
|
-
return
|
|
302
|
+
$[70] = t24;
|
|
303
|
+
$[71] = testId;
|
|
304
|
+
$[72] = t25;
|
|
305
|
+
} else t25 = $[72];
|
|
306
|
+
return t25;
|
|
280
307
|
};
|
|
281
308
|
TableInnerWindow.displayName = "TableInnerWindow";
|
|
282
309
|
function _temp(col) {
|
|
@@ -6,7 +6,7 @@ const TableMasterCellActions = (t0)=>{
|
|
|
6
6
|
const { children } = t0;
|
|
7
7
|
let t1;
|
|
8
8
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
9
|
-
t1 = cn("shrink-0 pl-4 pr-4 flex items-center gap-2", "opacity-0 pointer-events-none", "group-hover/row:opacity-100 group-hover/row:pointer-events-auto", "group-data-[preview-active]/row:opacity-100 group-data-[preview-active]/row:pointer-events-auto", "has-[[data-state=open]]:opacity-100 has-[[data-state=open]]:pointer-events-auto", "[&_[data-state=open]]:overlay [&_[data-state=open]]:overlay-states-primary-hover");
|
|
9
|
+
t1 = cn("shrink-0 pl-4 pr-4 flex items-center gap-2", "opacity-0 pointer-events-none", "group-hover/row:opacity-100 group-hover/row:pointer-events-auto", "group-data-[preview-active]/row:opacity-100 group-data-[preview-active]/row:pointer-events-auto", "has-[[data-state=open]]:opacity-100 has-[[data-state=open]]:pointer-events-auto", "has-[:focus-visible]:opacity-100 has-[:focus-visible]:pointer-events-auto", "[&_[data-state=open]]:overlay [&_[data-state=open]]:overlay-states-primary-hover");
|
|
10
10
|
$[0] = t1;
|
|
11
11
|
} else t1 = $[0];
|
|
12
12
|
let t2;
|
|
@@ -57,9 +57,9 @@ const TableFullWidthCell = (t0)=>{
|
|
|
57
57
|
return t6;
|
|
58
58
|
};
|
|
59
59
|
const TableRowInner = (t0)=>{
|
|
60
|
-
const $ = compiler_runtime_c(
|
|
60
|
+
const $ = compiler_runtime_c(114);
|
|
61
61
|
const { row, ref, "data-index": dataIndex } = t0;
|
|
62
|
-
const { table, expandingEnabled, activeRowId, isLoading, renderExpandedRow, stretch, hasSubRowGrouping, showEmptyGroups, allLeafColumns, renderFullWidthGroupRow, renderFullWidthRow } = useTableContext();
|
|
62
|
+
const { table, expandingEnabled, activeRowId, isLoading, renderExpandedRow, stretch, hasSubRowGrouping, showEmptyGroups, allLeafColumns, renderFullWidthGroupRow, renderFullWidthRow, virtualized } = useTableContext();
|
|
63
63
|
const testId = useTestId("row");
|
|
64
64
|
const { canDnd, isDragging, setNodeRef, style: dndStyle, attributes, listeners } = useRowDnd(row);
|
|
65
65
|
const { activeId, overId } = useRowDndIndicator();
|
|
@@ -147,22 +147,23 @@ const TableRowInner = (t0)=>{
|
|
|
147
147
|
let t20;
|
|
148
148
|
let t8;
|
|
149
149
|
let t9;
|
|
150
|
-
if ($[21] !== allLeafColumns || $[22] !== cells || $[23] !== composedRef || $[24] !== dataIndex || $[25] !== fullWidthContent || $[26] !== hasSubRowGrouping || $[27] !== isExpanded || $[28] !== isFullWidth || $[29] !== isLastRow || $[30] !== isPreviewActive || $[31] !== isSelected || $[32] !== row.id || $[33] !== table.state || $[34] !== testId) {
|
|
150
|
+
if ($[21] !== allLeafColumns || $[22] !== cells || $[23] !== composedRef || $[24] !== dataIndex || $[25] !== fullWidthContent || $[26] !== hasSubRowGrouping || $[27] !== isExpanded || $[28] !== isFullWidth || $[29] !== isLastRow || $[30] !== isPreviewActive || $[31] !== isSelected || $[32] !== row.id || $[33] !== table.state || $[34] !== testId || $[35] !== virtualized) {
|
|
151
151
|
const systemCells = cells.filter(_temp);
|
|
152
152
|
const dataCells = cells.filter(_temp2);
|
|
153
153
|
const firstDataCell = dataCells[0];
|
|
154
154
|
let t21;
|
|
155
|
-
if ($[
|
|
156
|
-
t21 = hasSubRowGrouping && isExpanded ? {
|
|
155
|
+
if ($[50] !== allLeafColumns || $[51] !== hasSubRowGrouping || $[52] !== isExpanded || $[53] !== virtualized) {
|
|
156
|
+
t21 = hasSubRowGrouping && isExpanded && "window" !== virtualized ? {
|
|
157
157
|
position: "sticky",
|
|
158
158
|
top: allLeafColumns.some(_temp3) ? 48 : 32,
|
|
159
159
|
zIndex: 20
|
|
160
160
|
} : void 0;
|
|
161
|
-
$[
|
|
162
|
-
$[
|
|
163
|
-
$[
|
|
164
|
-
$[
|
|
165
|
-
|
|
161
|
+
$[50] = allLeafColumns;
|
|
162
|
+
$[51] = hasSubRowGrouping;
|
|
163
|
+
$[52] = isExpanded;
|
|
164
|
+
$[53] = virtualized;
|
|
165
|
+
$[54] = t21;
|
|
166
|
+
} else t21 = $[54];
|
|
166
167
|
const stickyStyle = t21;
|
|
167
168
|
T0 = Tr;
|
|
168
169
|
t8 = composedRef;
|
|
@@ -175,15 +176,15 @@ const TableRowInner = (t0)=>{
|
|
|
175
176
|
t15 = isSelected || void 0;
|
|
176
177
|
t16 = stickyStyle;
|
|
177
178
|
let t22;
|
|
178
|
-
if ($[
|
|
179
|
+
if ($[55] !== isLastRow) {
|
|
179
180
|
t22 = (cell)=>/*#__PURE__*/ jsx(TableBodyCell, {
|
|
180
181
|
cell: cell,
|
|
181
182
|
disablePinnedShadow: true,
|
|
182
183
|
lastRow: isLastRow
|
|
183
184
|
}, cell.id);
|
|
184
|
-
$[
|
|
185
|
-
$[
|
|
186
|
-
} else t22 = $[
|
|
185
|
+
$[55] = isLastRow;
|
|
186
|
+
$[56] = t22;
|
|
187
|
+
} else t22 = $[56];
|
|
187
188
|
t17 = systemCells.map(t22);
|
|
188
189
|
t18 = isFullWidth && /*#__PURE__*/ jsx(TableFullWidthCell, {
|
|
189
190
|
colSpan: dataCells.length,
|
|
@@ -217,47 +218,48 @@ const TableRowInner = (t0)=>{
|
|
|
217
218
|
$[32] = row.id;
|
|
218
219
|
$[33] = table.state;
|
|
219
220
|
$[34] = testId;
|
|
220
|
-
$[35] =
|
|
221
|
-
$[36] =
|
|
222
|
-
$[37] =
|
|
223
|
-
$[38] =
|
|
224
|
-
$[39] =
|
|
225
|
-
$[40] =
|
|
226
|
-
$[41] =
|
|
227
|
-
$[42] =
|
|
228
|
-
$[43] =
|
|
229
|
-
$[44] =
|
|
230
|
-
$[45] =
|
|
231
|
-
$[46] =
|
|
232
|
-
$[47] =
|
|
233
|
-
$[48] =
|
|
221
|
+
$[35] = virtualized;
|
|
222
|
+
$[36] = T0;
|
|
223
|
+
$[37] = t10;
|
|
224
|
+
$[38] = t11;
|
|
225
|
+
$[39] = t12;
|
|
226
|
+
$[40] = t13;
|
|
227
|
+
$[41] = t14;
|
|
228
|
+
$[42] = t15;
|
|
229
|
+
$[43] = t16;
|
|
230
|
+
$[44] = t17;
|
|
231
|
+
$[45] = t18;
|
|
232
|
+
$[46] = t19;
|
|
233
|
+
$[47] = t20;
|
|
234
|
+
$[48] = t8;
|
|
235
|
+
$[49] = t9;
|
|
234
236
|
} else {
|
|
235
|
-
T0 = $[
|
|
236
|
-
t10 = $[
|
|
237
|
-
t11 = $[
|
|
238
|
-
t12 = $[
|
|
239
|
-
t13 = $[
|
|
240
|
-
t14 = $[
|
|
241
|
-
t15 = $[
|
|
242
|
-
t16 = $[
|
|
243
|
-
t17 = $[
|
|
244
|
-
t18 = $[
|
|
245
|
-
t19 = $[
|
|
246
|
-
t20 = $[
|
|
247
|
-
t8 = $[
|
|
248
|
-
t9 = $[
|
|
237
|
+
T0 = $[36];
|
|
238
|
+
t10 = $[37];
|
|
239
|
+
t11 = $[38];
|
|
240
|
+
t12 = $[39];
|
|
241
|
+
t13 = $[40];
|
|
242
|
+
t14 = $[41];
|
|
243
|
+
t15 = $[42];
|
|
244
|
+
t16 = $[43];
|
|
245
|
+
t17 = $[44];
|
|
246
|
+
t18 = $[45];
|
|
247
|
+
t19 = $[46];
|
|
248
|
+
t20 = $[47];
|
|
249
|
+
t8 = $[48];
|
|
250
|
+
t9 = $[49];
|
|
249
251
|
}
|
|
250
252
|
let t21;
|
|
251
|
-
if ($[
|
|
253
|
+
if ($[57] !== stretch) {
|
|
252
254
|
t21 = !stretch && /*#__PURE__*/ jsx(Td, {
|
|
253
255
|
pinned: false,
|
|
254
256
|
"aria-hidden": true
|
|
255
257
|
});
|
|
256
|
-
$[
|
|
257
|
-
$[
|
|
258
|
-
} else t21 = $[
|
|
258
|
+
$[57] = stretch;
|
|
259
|
+
$[58] = t21;
|
|
260
|
+
} else t21 = $[58];
|
|
259
261
|
let t22;
|
|
260
|
-
if ($[
|
|
262
|
+
if ($[59] !== T0 || $[60] !== t10 || $[61] !== t11 || $[62] !== t12 || $[63] !== t13 || $[64] !== t14 || $[65] !== t15 || $[66] !== t16 || $[67] !== t17 || $[68] !== t18 || $[69] !== t19 || $[70] !== t20 || $[71] !== t21 || $[72] !== t8 || $[73] !== t9) {
|
|
261
263
|
t22 = /*#__PURE__*/ jsxs(T0, {
|
|
262
264
|
ref: t8,
|
|
263
265
|
"data-index": t9,
|
|
@@ -276,50 +278,50 @@ const TableRowInner = (t0)=>{
|
|
|
276
278
|
t21
|
|
277
279
|
]
|
|
278
280
|
});
|
|
279
|
-
$[
|
|
280
|
-
$[
|
|
281
|
-
$[
|
|
282
|
-
$[
|
|
283
|
-
$[
|
|
284
|
-
$[
|
|
285
|
-
$[
|
|
286
|
-
$[
|
|
287
|
-
$[
|
|
288
|
-
$[
|
|
289
|
-
$[
|
|
290
|
-
$[
|
|
291
|
-
$[
|
|
292
|
-
$[
|
|
293
|
-
$[
|
|
294
|
-
$[
|
|
295
|
-
} else t22 = $[
|
|
281
|
+
$[59] = T0;
|
|
282
|
+
$[60] = t10;
|
|
283
|
+
$[61] = t11;
|
|
284
|
+
$[62] = t12;
|
|
285
|
+
$[63] = t13;
|
|
286
|
+
$[64] = t14;
|
|
287
|
+
$[65] = t15;
|
|
288
|
+
$[66] = t16;
|
|
289
|
+
$[67] = t17;
|
|
290
|
+
$[68] = t18;
|
|
291
|
+
$[69] = t19;
|
|
292
|
+
$[70] = t20;
|
|
293
|
+
$[71] = t21;
|
|
294
|
+
$[72] = t8;
|
|
295
|
+
$[73] = t9;
|
|
296
|
+
$[74] = t22;
|
|
297
|
+
} else t22 = $[74];
|
|
296
298
|
let t23;
|
|
297
|
-
if ($[
|
|
299
|
+
if ($[75] !== expandingEnabled || $[76] !== isLastRowExpanded || $[77] !== row) {
|
|
298
300
|
t23 = expandingEnabled && /*#__PURE__*/ jsx(TableRowExpanded, {
|
|
299
301
|
row: row,
|
|
300
302
|
lastRow: isLastRowExpanded
|
|
301
303
|
});
|
|
302
|
-
$[
|
|
303
|
-
$[
|
|
304
|
-
$[
|
|
305
|
-
$[
|
|
306
|
-
} else t23 = $[
|
|
304
|
+
$[75] = expandingEnabled;
|
|
305
|
+
$[76] = isLastRowExpanded;
|
|
306
|
+
$[77] = row;
|
|
307
|
+
$[78] = t23;
|
|
308
|
+
} else t23 = $[78];
|
|
307
309
|
let t24;
|
|
308
|
-
if ($[
|
|
310
|
+
if ($[79] !== t22 || $[80] !== t23) {
|
|
309
311
|
t24 = /*#__PURE__*/ jsxs(Fragment, {
|
|
310
312
|
children: [
|
|
311
313
|
t22,
|
|
312
314
|
t23
|
|
313
315
|
]
|
|
314
316
|
});
|
|
315
|
-
$[
|
|
316
|
-
$[
|
|
317
|
-
$[
|
|
318
|
-
} else t24 = $[
|
|
317
|
+
$[79] = t22;
|
|
318
|
+
$[80] = t23;
|
|
319
|
+
$[81] = t24;
|
|
320
|
+
} else t24 = $[81];
|
|
319
321
|
return t24;
|
|
320
322
|
}
|
|
321
323
|
let t8;
|
|
322
|
-
if ($[
|
|
324
|
+
if ($[82] !== activeId || $[83] !== attributes || $[84] !== canDnd || $[85] !== cells || $[86] !== composedRef || $[87] !== dataIndex || $[88] !== dndStyle || $[89] !== fullWidthContent || $[90] !== isDragging || $[91] !== isFullWidth || $[92] !== isLastRow || $[93] !== isPreviewActive || $[94] !== isSelected || $[95] !== listeners || $[96] !== overId || $[97] !== row.depth || $[98] !== row.id || $[99] !== stretch || $[100] !== table || $[101] !== testId) {
|
|
323
325
|
let dropIndicator;
|
|
324
326
|
if (overId === row.id && null != activeId && activeId !== row.id) {
|
|
325
327
|
const modelRows = table.getRowModel().rows;
|
|
@@ -328,12 +330,12 @@ const TableRowInner = (t0)=>{
|
|
|
328
330
|
if (-1 !== activeIndex && -1 !== overIndex) dropIndicator = activeIndex < overIndex ? "below" : "above";
|
|
329
331
|
}
|
|
330
332
|
let t9;
|
|
331
|
-
if ($[
|
|
333
|
+
if ($[103] !== cells || $[104] !== isFullWidth) {
|
|
332
334
|
t9 = isFullWidth ? cells.filter(_temp4) : cells;
|
|
333
|
-
$[
|
|
334
|
-
$[
|
|
335
|
-
$[
|
|
336
|
-
} else t9 = $[
|
|
335
|
+
$[103] = cells;
|
|
336
|
+
$[104] = isFullWidth;
|
|
337
|
+
$[105] = t9;
|
|
338
|
+
} else t9 = $[105];
|
|
337
339
|
t8 = /*#__PURE__*/ jsxs(Tr, {
|
|
338
340
|
ref: composedRef,
|
|
339
341
|
"data-index": dataIndex,
|
|
@@ -376,53 +378,53 @@ const TableRowInner = (t0)=>{
|
|
|
376
378
|
})
|
|
377
379
|
]
|
|
378
380
|
});
|
|
379
|
-
$[
|
|
380
|
-
$[
|
|
381
|
-
$[
|
|
382
|
-
$[
|
|
383
|
-
$[
|
|
384
|
-
$[
|
|
385
|
-
$[
|
|
386
|
-
$[
|
|
387
|
-
$[
|
|
388
|
-
$[
|
|
389
|
-
$[
|
|
390
|
-
$[
|
|
391
|
-
$[
|
|
392
|
-
$[
|
|
393
|
-
$[
|
|
394
|
-
$[
|
|
395
|
-
$[
|
|
396
|
-
$[
|
|
397
|
-
$[
|
|
398
|
-
$[
|
|
399
|
-
$[
|
|
400
|
-
} else t8 = $[
|
|
381
|
+
$[82] = activeId;
|
|
382
|
+
$[83] = attributes;
|
|
383
|
+
$[84] = canDnd;
|
|
384
|
+
$[85] = cells;
|
|
385
|
+
$[86] = composedRef;
|
|
386
|
+
$[87] = dataIndex;
|
|
387
|
+
$[88] = dndStyle;
|
|
388
|
+
$[89] = fullWidthContent;
|
|
389
|
+
$[90] = isDragging;
|
|
390
|
+
$[91] = isFullWidth;
|
|
391
|
+
$[92] = isLastRow;
|
|
392
|
+
$[93] = isPreviewActive;
|
|
393
|
+
$[94] = isSelected;
|
|
394
|
+
$[95] = listeners;
|
|
395
|
+
$[96] = overId;
|
|
396
|
+
$[97] = row.depth;
|
|
397
|
+
$[98] = row.id;
|
|
398
|
+
$[99] = stretch;
|
|
399
|
+
$[100] = table;
|
|
400
|
+
$[101] = testId;
|
|
401
|
+
$[102] = t8;
|
|
402
|
+
} else t8 = $[102];
|
|
401
403
|
let t9;
|
|
402
|
-
if ($[
|
|
404
|
+
if ($[106] !== dndStyle || $[107] !== expandingEnabled || $[108] !== isLastRowExpanded || $[109] !== row) {
|
|
403
405
|
t9 = expandingEnabled && /*#__PURE__*/ jsx(TableRowExpanded, {
|
|
404
406
|
row: row,
|
|
405
407
|
dndStyle: dndStyle,
|
|
406
408
|
lastRow: isLastRowExpanded
|
|
407
409
|
});
|
|
408
|
-
$[
|
|
409
|
-
$[
|
|
410
|
-
$[
|
|
411
|
-
$[
|
|
412
|
-
$[
|
|
413
|
-
} else t9 = $[
|
|
410
|
+
$[106] = dndStyle;
|
|
411
|
+
$[107] = expandingEnabled;
|
|
412
|
+
$[108] = isLastRowExpanded;
|
|
413
|
+
$[109] = row;
|
|
414
|
+
$[110] = t9;
|
|
415
|
+
} else t9 = $[110];
|
|
414
416
|
let t10;
|
|
415
|
-
if ($[
|
|
417
|
+
if ($[111] !== t8 || $[112] !== t9) {
|
|
416
418
|
t10 = /*#__PURE__*/ jsxs(Fragment, {
|
|
417
419
|
children: [
|
|
418
420
|
t8,
|
|
419
421
|
t9
|
|
420
422
|
]
|
|
421
423
|
});
|
|
422
|
-
$[
|
|
423
|
-
$[
|
|
424
|
-
$[
|
|
425
|
-
} else t10 = $[
|
|
424
|
+
$[111] = t8;
|
|
425
|
+
$[112] = t9;
|
|
426
|
+
$[113] = t10;
|
|
427
|
+
} else t10 = $[113];
|
|
426
428
|
return t10;
|
|
427
429
|
};
|
|
428
430
|
TableRowInner.displayName = "TableRow";
|
|
@@ -4,7 +4,7 @@ import { useInitialAnchor } from "./useInitialAnchor.js";
|
|
|
4
4
|
import { usePrependScrollAnchor } from "./usePrependScrollAnchor.js";
|
|
5
5
|
import { useScrollEdge } from "./useScrollEdge.js";
|
|
6
6
|
const useInfiniteScroll = (t0)=>{
|
|
7
|
-
const $ = c(
|
|
7
|
+
const $ = c(31);
|
|
8
8
|
const { mode, scrollRef, scrollRoot, table, virtualizerRef, tbodyRef, onStartReached, onStartReachedThreshold, onEndReached, onEndReachedThreshold, initialScrollToRowId, isLoadingPrevious } = t0;
|
|
9
9
|
let t1;
|
|
10
10
|
if ($[0] !== table) {
|
|
@@ -52,7 +52,7 @@ const useInfiniteScroll = (t0)=>{
|
|
|
52
52
|
usePrependScrollAnchor(t4);
|
|
53
53
|
const t5 = onStartReachedThreshold ?? TABLE_START_REACHED_THRESHOLD;
|
|
54
54
|
let t6;
|
|
55
|
-
if ($[15] !== mode || $[16] !== onStartReached || $[17] !== ready || $[18] !==
|
|
55
|
+
if ($[15] !== mode || $[16] !== onStartReached || $[17] !== ready || $[18] !== rows.length || $[19] !== scrollRef || $[20] !== scrollRoot || $[21] !== t5) {
|
|
56
56
|
t6 = {
|
|
57
57
|
edge: "start",
|
|
58
58
|
mode,
|
|
@@ -60,20 +60,22 @@ const useInfiniteScroll = (t0)=>{
|
|
|
60
60
|
scrollRoot,
|
|
61
61
|
onReached: onStartReached,
|
|
62
62
|
threshold: t5,
|
|
63
|
-
enabled: ready
|
|
63
|
+
enabled: ready,
|
|
64
|
+
itemCount: rows.length
|
|
64
65
|
};
|
|
65
66
|
$[15] = mode;
|
|
66
67
|
$[16] = onStartReached;
|
|
67
68
|
$[17] = ready;
|
|
68
|
-
$[18] =
|
|
69
|
-
$[19] =
|
|
70
|
-
$[20] =
|
|
71
|
-
$[21] =
|
|
72
|
-
|
|
69
|
+
$[18] = rows.length;
|
|
70
|
+
$[19] = scrollRef;
|
|
71
|
+
$[20] = scrollRoot;
|
|
72
|
+
$[21] = t5;
|
|
73
|
+
$[22] = t6;
|
|
74
|
+
} else t6 = $[22];
|
|
73
75
|
useScrollEdge(t6);
|
|
74
76
|
const t7 = onEndReachedThreshold ?? TABLE_END_REACHED_THRESHOLD;
|
|
75
77
|
let t8;
|
|
76
|
-
if ($[
|
|
78
|
+
if ($[23] !== mode || $[24] !== onEndReached || $[25] !== ready || $[26] !== rows.length || $[27] !== scrollRef || $[28] !== scrollRoot || $[29] !== t7) {
|
|
77
79
|
t8 = {
|
|
78
80
|
edge: "end",
|
|
79
81
|
mode,
|
|
@@ -81,16 +83,18 @@ const useInfiniteScroll = (t0)=>{
|
|
|
81
83
|
scrollRoot,
|
|
82
84
|
onReached: onEndReached,
|
|
83
85
|
threshold: t7,
|
|
84
|
-
enabled: ready
|
|
86
|
+
enabled: ready,
|
|
87
|
+
itemCount: rows.length
|
|
85
88
|
};
|
|
86
|
-
$[
|
|
87
|
-
$[
|
|
88
|
-
$[
|
|
89
|
-
$[
|
|
90
|
-
$[
|
|
91
|
-
$[
|
|
92
|
-
$[
|
|
93
|
-
|
|
89
|
+
$[23] = mode;
|
|
90
|
+
$[24] = onEndReached;
|
|
91
|
+
$[25] = ready;
|
|
92
|
+
$[26] = rows.length;
|
|
93
|
+
$[27] = scrollRef;
|
|
94
|
+
$[28] = scrollRoot;
|
|
95
|
+
$[29] = t7;
|
|
96
|
+
$[30] = t8;
|
|
97
|
+
} else t8 = $[30];
|
|
94
98
|
useScrollEdge(t8);
|
|
95
99
|
};
|
|
96
100
|
export { useInfiniteScroll };
|
|
@@ -13,11 +13,16 @@ interface UseScrollEdgeOptions {
|
|
|
13
13
|
enabled?: boolean;
|
|
14
14
|
/** `window` mode: the resolved scroll root (see `useWindowScrollRoot`) */
|
|
15
15
|
scrollRoot?: ScrollRoot | null;
|
|
16
|
+
/** The rows rendered; a change re-arms the edge (new rows, not loaders or row measuring) */
|
|
17
|
+
itemCount?: number;
|
|
16
18
|
}
|
|
17
19
|
/**
|
|
18
20
|
* Fires `onReached` once when the user scrolls within `threshold` px of the
|
|
19
|
-
* given edge. Re-arms after scrolling back past the threshold
|
|
20
|
-
*
|
|
21
|
+
* given edge. Re-arms after scrolling back past the threshold, or once
|
|
22
|
+
* `itemCount` changes (new rows): a jump straight to the new edge, such as
|
|
23
|
+
* a scrollbar drag or End, never passes a point outside the threshold. A
|
|
24
|
+
* cooldown guard prevents rapid re-fires when prepended/appended rows grow the
|
|
25
|
+
* content.
|
|
21
26
|
*/
|
|
22
|
-
export declare const useScrollEdge: ({ edge, mode, scrollRef, onReached, threshold, enabled, scrollRoot, }: UseScrollEdgeOptions) => void;
|
|
27
|
+
export declare const useScrollEdge: ({ edge, mode, scrollRef, onReached, threshold, enabled, scrollRoot, itemCount, }: UseScrollEdgeOptions) => void;
|
|
23
28
|
export {};
|
|
@@ -2,10 +2,11 @@ import { c } from "react/compiler-runtime";
|
|
|
2
2
|
import { useEffect, useRef } from "react";
|
|
3
3
|
import { SCROLL_EDGE_COOLDOWN_MS, getScrollMetrics } from "../../lib/index.js";
|
|
4
4
|
const useScrollEdge = (t0)=>{
|
|
5
|
-
const $ = c(
|
|
6
|
-
const { edge, mode, scrollRef, onReached, threshold, enabled: t1, scrollRoot } = t0;
|
|
5
|
+
const $ = c(12);
|
|
6
|
+
const { edge, mode, scrollRef, onReached, threshold, enabled: t1, scrollRoot, itemCount } = t0;
|
|
7
7
|
const enabled = void 0 === t1 ? true : t1;
|
|
8
8
|
const firedRef = useRef(false);
|
|
9
|
+
const firedCountRef = useRef(itemCount);
|
|
9
10
|
const lastFiredAtRef = useRef(0);
|
|
10
11
|
const onReachedRef = useRef(onReached);
|
|
11
12
|
let t2;
|
|
@@ -18,18 +19,21 @@ const useScrollEdge = (t0)=>{
|
|
|
18
19
|
} else t2 = $[1];
|
|
19
20
|
useEffect(t2);
|
|
20
21
|
const enabledRef = useRef(enabled);
|
|
22
|
+
const itemCountRef = useRef(itemCount);
|
|
21
23
|
let t3;
|
|
22
|
-
if ($[2] !== enabled) {
|
|
24
|
+
if ($[2] !== enabled || $[3] !== itemCount) {
|
|
23
25
|
t3 = ()=>{
|
|
24
26
|
enabledRef.current = enabled;
|
|
27
|
+
itemCountRef.current = itemCount;
|
|
25
28
|
};
|
|
26
29
|
$[2] = enabled;
|
|
27
|
-
$[3] =
|
|
28
|
-
|
|
30
|
+
$[3] = itemCount;
|
|
31
|
+
$[4] = t3;
|
|
32
|
+
} else t3 = $[4];
|
|
29
33
|
useEffect(t3);
|
|
30
34
|
let t4;
|
|
31
35
|
let t5;
|
|
32
|
-
if ($[
|
|
36
|
+
if ($[5] !== edge || $[6] !== mode || $[7] !== scrollRef || $[8] !== scrollRoot || $[9] !== threshold) {
|
|
33
37
|
t4 = ()=>{
|
|
34
38
|
const target = "window" === mode ? scrollRoot : scrollRef?.current;
|
|
35
39
|
if (!target) return;
|
|
@@ -41,8 +45,10 @@ const useScrollEdge = (t0)=>{
|
|
|
41
45
|
const distance = "start" === edge ? scrollTop : scrollHeight - scrollTop - clientHeight;
|
|
42
46
|
if (distance <= threshold) {
|
|
43
47
|
const now = Date.now();
|
|
48
|
+
if (firedRef.current && itemCountRef.current !== firedCountRef.current) firedRef.current = false;
|
|
44
49
|
if (!firedRef.current && now - lastFiredAtRef.current >= SCROLL_EDGE_COOLDOWN_MS) {
|
|
45
50
|
firedRef.current = true;
|
|
51
|
+
firedCountRef.current = itemCountRef.current;
|
|
46
52
|
lastFiredAtRef.current = now;
|
|
47
53
|
callback();
|
|
48
54
|
}
|
|
@@ -63,16 +69,16 @@ const useScrollEdge = (t0)=>{
|
|
|
63
69
|
scrollRoot,
|
|
64
70
|
threshold
|
|
65
71
|
];
|
|
66
|
-
$[
|
|
67
|
-
$[
|
|
68
|
-
$[
|
|
69
|
-
$[
|
|
70
|
-
$[
|
|
71
|
-
$[
|
|
72
|
-
$[
|
|
72
|
+
$[5] = edge;
|
|
73
|
+
$[6] = mode;
|
|
74
|
+
$[7] = scrollRef;
|
|
75
|
+
$[8] = scrollRoot;
|
|
76
|
+
$[9] = threshold;
|
|
77
|
+
$[10] = t4;
|
|
78
|
+
$[11] = t5;
|
|
73
79
|
} else {
|
|
74
|
-
t4 = $[
|
|
75
|
-
t5 = $[
|
|
80
|
+
t4 = $[10];
|
|
81
|
+
t5 = $[11];
|
|
76
82
|
}
|
|
77
83
|
useEffect(t4, t5);
|
|
78
84
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type RefObject } from 'react';
|
|
2
2
|
import type { ReactTable, Row, RowData } from '@tanstack/react-table';
|
|
3
|
-
import type { DSTableFeatures } from '../lib/index.js';
|
|
3
|
+
import type { DSTableFeatures, ScrollRoot } from '../lib/index.js';
|
|
4
4
|
import type { TableVirtualizerInstance } from '../TableContext/types.js';
|
|
5
5
|
export interface StickyGroupParentResult<T extends RowData> {
|
|
6
6
|
stickyRow: Row<DSTableFeatures, T> | null;
|
|
@@ -9,7 +9,13 @@ export interface StickyGroupParentResult<T extends RowData> {
|
|
|
9
9
|
interface UseStickyGroupParentOptions {
|
|
10
10
|
table: ReactTable<DSTableFeatures, RowData>;
|
|
11
11
|
scrollElementRef: RefObject<HTMLElement | null>;
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* `virtualized='window'`: the resolved scroll root (the window or a scrolling
|
|
14
|
+
* pane). Positions are then read in viewport coordinates against the bottom of
|
|
15
|
+
* `headerRef`, the sticky header, so the root's own offset never matters.
|
|
16
|
+
*/
|
|
17
|
+
windowScrollRoot?: ScrollRoot | null;
|
|
18
|
+
headerRef?: RefObject<HTMLElement | null>;
|
|
13
19
|
headerHeight: number;
|
|
14
20
|
tbodyRef: RefObject<HTMLTableSectionElement | null>;
|
|
15
21
|
virtualizerRef: RefObject<TableVirtualizerInstance | null>;
|
|
@@ -51,15 +51,16 @@ const getRowBounds = (index, virt, tbodyScrollOffset, tbodyEl, scrollTop, scroll
|
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
53
|
const useStickyGroupParent = (options)=>{
|
|
54
|
-
const $ = c(
|
|
55
|
-
const { table, scrollElementRef,
|
|
54
|
+
const $ = c(21);
|
|
55
|
+
const { table, scrollElementRef, windowScrollRoot, headerRef, headerHeight, tbodyRef, virtualizerRef, enabled } = options;
|
|
56
|
+
const useWindowScroll = null != windowScrollRoot;
|
|
56
57
|
const [stickyRow, setStickyRow] = useState(null);
|
|
57
58
|
const [pushUpOffset, setPushUpOffset] = useState(0);
|
|
58
59
|
const rafRef = useRef(0);
|
|
59
60
|
const prevStickyRowIdRef = useRef(null);
|
|
60
61
|
const prevOffsetRef = useRef(0);
|
|
61
62
|
let t0;
|
|
62
|
-
if ($[0] !== enabled || $[1] !== headerHeight || $[2] !==
|
|
63
|
+
if ($[0] !== enabled || $[1] !== headerHeight || $[2] !== headerRef || $[3] !== scrollElementRef || $[4] !== table || $[5] !== tbodyRef || $[6] !== useWindowScroll || $[7] !== virtualizerRef) {
|
|
63
64
|
t0 = ()=>{
|
|
64
65
|
if (!enabled) {
|
|
65
66
|
if (null !== prevStickyRowIdRef.current) {
|
|
@@ -71,16 +72,14 @@ const useStickyGroupParent = (options)=>{
|
|
|
71
72
|
}
|
|
72
73
|
const scrollElement = scrollElementRef.current;
|
|
73
74
|
if (!scrollElement) return;
|
|
74
|
-
const scrollTop = useWindowScroll ?
|
|
75
|
-
const headerBottom = scrollTop + headerHeight;
|
|
75
|
+
const scrollTop = useWindowScroll ? 0 : scrollElement.scrollTop;
|
|
76
|
+
const headerBottom = useWindowScroll ? headerRef?.current?.getBoundingClientRect().bottom ?? headerHeight : scrollTop + headerHeight;
|
|
76
77
|
const tbodyEl = tbodyRef.current;
|
|
77
78
|
const virt = virtualizerRef.current;
|
|
78
79
|
let tbodyScrollOffset = 0;
|
|
79
80
|
let scrollContainerTop = 0;
|
|
80
|
-
if (tbodyEl) if (useWindowScroll)
|
|
81
|
-
|
|
82
|
-
scrollContainerTop = 0;
|
|
83
|
-
} else {
|
|
81
|
+
if (tbodyEl) if (useWindowScroll) tbodyScrollOffset = tbodyEl.getBoundingClientRect().top - (virt?.options.scrollMargin ?? 0);
|
|
82
|
+
else {
|
|
84
83
|
const scrollRect = scrollElement.getBoundingClientRect();
|
|
85
84
|
scrollContainerTop = scrollRect.top;
|
|
86
85
|
tbodyScrollOffset = tbodyEl.getBoundingClientRect().top - scrollRect.top + scrollTop;
|
|
@@ -112,20 +111,21 @@ const useStickyGroupParent = (options)=>{
|
|
|
112
111
|
};
|
|
113
112
|
$[0] = enabled;
|
|
114
113
|
$[1] = headerHeight;
|
|
115
|
-
$[2] =
|
|
116
|
-
$[3] =
|
|
117
|
-
$[4] =
|
|
118
|
-
$[5] =
|
|
119
|
-
$[6] =
|
|
120
|
-
$[7] =
|
|
121
|
-
|
|
114
|
+
$[2] = headerRef;
|
|
115
|
+
$[3] = scrollElementRef;
|
|
116
|
+
$[4] = table;
|
|
117
|
+
$[5] = tbodyRef;
|
|
118
|
+
$[6] = useWindowScroll;
|
|
119
|
+
$[7] = virtualizerRef;
|
|
120
|
+
$[8] = t0;
|
|
121
|
+
} else t0 = $[8];
|
|
122
122
|
const compute = t0;
|
|
123
123
|
let t1;
|
|
124
124
|
let t2;
|
|
125
|
-
if ($[
|
|
125
|
+
if ($[9] !== compute || $[10] !== enabled || $[11] !== scrollElementRef || $[12] !== windowScrollRoot) {
|
|
126
126
|
t1 = ()=>{
|
|
127
127
|
if (!enabled) return;
|
|
128
|
-
const scrollTarget =
|
|
128
|
+
const scrollTarget = windowScrollRoot ?? scrollElementRef.current;
|
|
129
129
|
if (!scrollTarget) return;
|
|
130
130
|
const handleScroll = ()=>{
|
|
131
131
|
cancelAnimationFrame(rafRef.current);
|
|
@@ -142,48 +142,48 @@ const useStickyGroupParent = (options)=>{
|
|
|
142
142
|
};
|
|
143
143
|
t2 = [
|
|
144
144
|
enabled,
|
|
145
|
-
|
|
145
|
+
windowScrollRoot,
|
|
146
146
|
scrollElementRef,
|
|
147
147
|
compute
|
|
148
148
|
];
|
|
149
|
-
$[
|
|
150
|
-
$[
|
|
151
|
-
$[
|
|
152
|
-
$[
|
|
153
|
-
$[
|
|
154
|
-
$[
|
|
149
|
+
$[9] = compute;
|
|
150
|
+
$[10] = enabled;
|
|
151
|
+
$[11] = scrollElementRef;
|
|
152
|
+
$[12] = windowScrollRoot;
|
|
153
|
+
$[13] = t1;
|
|
154
|
+
$[14] = t2;
|
|
155
155
|
} else {
|
|
156
|
-
t1 = $[
|
|
157
|
-
t2 = $[
|
|
156
|
+
t1 = $[13];
|
|
157
|
+
t2 = $[14];
|
|
158
158
|
}
|
|
159
159
|
useEffect(t1, t2);
|
|
160
160
|
let t3;
|
|
161
161
|
let t4;
|
|
162
|
-
if ($[
|
|
162
|
+
if ($[15] !== compute) {
|
|
163
163
|
t3 = ()=>{
|
|
164
164
|
compute();
|
|
165
165
|
};
|
|
166
166
|
t4 = [
|
|
167
167
|
compute
|
|
168
168
|
];
|
|
169
|
-
$[
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
169
|
+
$[15] = compute;
|
|
170
|
+
$[16] = t3;
|
|
171
|
+
$[17] = t4;
|
|
172
172
|
} else {
|
|
173
|
-
t3 = $[
|
|
174
|
-
t4 = $[
|
|
173
|
+
t3 = $[16];
|
|
174
|
+
t4 = $[17];
|
|
175
175
|
}
|
|
176
176
|
useEffect(t3, t4);
|
|
177
177
|
let t5;
|
|
178
|
-
if ($[
|
|
178
|
+
if ($[18] !== pushUpOffset || $[19] !== stickyRow) {
|
|
179
179
|
t5 = {
|
|
180
180
|
stickyRow,
|
|
181
181
|
pushUpOffset
|
|
182
182
|
};
|
|
183
|
-
$[
|
|
184
|
-
$[
|
|
185
|
-
$[
|
|
186
|
-
} else t5 = $[
|
|
183
|
+
$[18] = pushUpOffset;
|
|
184
|
+
$[19] = stickyRow;
|
|
185
|
+
$[20] = t5;
|
|
186
|
+
} else t5 = $[20];
|
|
187
187
|
return t5;
|
|
188
188
|
};
|
|
189
189
|
export { useStickyGroupParent };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "4.18.0",
|
|
3
|
-
"generatedAt": "2026-11-
|
|
3
|
+
"generatedAt": "2026-11-16T17:27:24.525Z",
|
|
4
4
|
"components": [
|
|
5
5
|
{
|
|
6
6
|
"name": "Accordion",
|
|
@@ -41458,6 +41458,16 @@
|
|
|
41458
41458
|
"!autodocs"
|
|
41459
41459
|
],
|
|
41460
41460
|
"description": "The same sticky-parent behavior under container virtualization with large grouped data —\nthe overlay stays in the DOM even when the real parent row is unmounted by the virtualizer."
|
|
41461
|
+
},
|
|
41462
|
+
{
|
|
41463
|
+
"name": "StickyGroupParentWindowInPane",
|
|
41464
|
+
"code": "import { useMemo, useState } from 'react';\nimport { Table, type TableExpandedState } from '@wallarm-org/design-system/Table';\nimport { createLargeGroupedData, headerColumns, type SecurityHeaderEntry } from './mocks';\n\nexport const StickyGroupParentWindowInPane = () => {\n const data = useMemo(() => createLargeGroupedData(6, 30), []);\n const [expanded, setExpanded] = useState<TableExpandedState>(() =>\n Object.fromEntries(data.map(g => [g.id, true])),\n );\n\n return (\n <div data-testid='scroll-pane' style={{ height: 480, overflowY: 'auto', paddingTop: 24 }}>\n <Table<SecurityHeaderEntry>\n data={data}\n columns={headerColumns}\n getRowId={row => row.id}\n getSubRows={row => row.children}\n expanded={expanded}\n onExpandedChange={setExpanded}\n virtualized='window'\n data-testid='sticky-group-parent-window-table'\n />\n </div>\n );\n};",
|
|
41465
|
+
"storyFile": "Table/Table.stories.tsx",
|
|
41466
|
+
"storyTitle": "Data Display/Table",
|
|
41467
|
+
"tags": [
|
|
41468
|
+
"!autodocs"
|
|
41469
|
+
],
|
|
41470
|
+
"description": "`virtualized='window'` grouping in a padded app pane: the group row sticks under the header,\nwhich sticks at the pane's top edge (rows never show through the pane's padding)."
|
|
41461
41471
|
}
|
|
41462
41472
|
],
|
|
41463
41473
|
"docs": [
|
package/package.json
CHANGED