ff-step-table 1.0.2 → 1.0.4
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/lib/components/EditLabel/EditLabel.d.ts +1 -1
- package/lib/components/EditLabel/EditLabel.js +2 -2
- package/lib/components/EditLabel/EditLabel.js.map +1 -1
- package/lib/components/EditLabel/types.d.ts +1 -0
- package/lib/components/Icon/Icon.js +2 -2
- package/lib/components/Icon/Icon.js.map +1 -1
- package/lib/components/Icon/iconList.js +2 -0
- package/lib/components/Icon/iconList.js.map +1 -1
- package/lib/components/StatusButton/StatusButton.js +2 -2
- package/lib/components/StatusButton/StatusButton.js.map +1 -1
- package/lib/components/StepsLandingTable/StepLandingTable.d.ts +0 -1
- package/lib/components/StepsLandingTable/StepLandingTable.js +160 -447
- package/lib/components/StepsLandingTable/StepLandingTable.js.map +1 -1
- package/lib/components/StepsLandingTable/types.d.ts +1 -0
- package/lib/components/StepsLandingTableV2/StepLandingTable.d.ts +6 -0
- package/lib/components/StepsLandingTableV2/StepLandingTable.js +682 -0
- package/lib/components/StepsLandingTableV2/StepLandingTable.js.map +1 -0
- package/lib/components/StepsLandingTableV2/compat/legacyAdapter.d.ts +10 -0
- package/lib/components/StepsLandingTableV2/compat/legacyAdapter.js +35 -0
- package/lib/components/StepsLandingTableV2/compat/legacyAdapter.js.map +1 -0
- package/lib/components/StepsLandingTableV2/index.d.ts +4 -0
- package/lib/components/StepsLandingTableV2/index.js +5 -0
- package/lib/components/StepsLandingTableV2/index.js.map +1 -0
- package/lib/components/StepsLandingTableV2/model/blockGraph.d.ts +12 -0
- package/lib/components/StepsLandingTableV2/model/blockGraph.js +167 -0
- package/lib/components/StepsLandingTableV2/model/blockGraph.js.map +1 -0
- package/lib/components/StepsLandingTableV2/model/normalize.d.ts +10 -0
- package/lib/components/StepsLandingTableV2/model/normalize.js +166 -0
- package/lib/components/StepsLandingTableV2/model/normalize.js.map +1 -0
- package/lib/components/StepsLandingTableV2/model/rowClassification.d.ts +14 -0
- package/lib/components/StepsLandingTableV2/model/rowClassification.js +132 -0
- package/lib/components/StepsLandingTableV2/model/rowClassification.js.map +1 -0
- package/lib/components/StepsLandingTableV2/model/types.d.ts +108 -0
- package/lib/components/StepsLandingTableV2/model/types.js.map +1 -0
- package/lib/components/StepsLandingTableV2/selection/IntervalSelection.d.ts +18 -0
- package/lib/components/StepsLandingTableV2/selection/IntervalSelection.js +133 -0
- package/lib/components/StepsLandingTableV2/selection/IntervalSelection.js.map +1 -0
- package/lib/components/StepsLandingTableV2/selection/selectionEngine.d.ts +23 -0
- package/lib/components/StepsLandingTableV2/selection/selectionEngine.js +221 -0
- package/lib/components/StepsLandingTableV2/selection/selectionEngine.js.map +1 -0
- package/lib/components/StepsLandingTableV2/store/store.d.ts +104 -0
- package/lib/components/StepsLandingTableV2/store/store.js +509 -0
- package/lib/components/StepsLandingTableV2/store/store.js.map +1 -0
- package/lib/components/StepsLandingTableV2/virtual/BlockPrefixIndex.d.ts +20 -0
- package/lib/components/StepsLandingTableV2/virtual/BlockPrefixIndex.js +112 -0
- package/lib/components/StepsLandingTableV2/virtual/BlockPrefixIndex.js.map +1 -0
- package/lib/components/StepsLandingTableV2/virtual/viewportController.d.ts +11 -0
- package/lib/components/StepsLandingTableV2/virtual/viewportController.js +55 -0
- package/lib/components/StepsLandingTableV2/virtual/viewportController.js.map +1 -0
- package/lib/components/StepsLandingTableV2/visible/ChunkedSequence.d.ts +24 -0
- package/lib/components/StepsLandingTableV2/visible/ChunkedSequence.js +189 -0
- package/lib/components/StepsLandingTableV2/visible/ChunkedSequence.js.map +1 -0
- package/lib/components/StepsLandingTableV2/visible/buildVisibleSequence.d.ts +4 -0
- package/lib/components/StepsLandingTableV2/visible/buildVisibleSequence.js +124 -0
- package/lib/components/StepsLandingTableV2/visible/buildVisibleSequence.js.map +1 -0
- package/lib/components/StepsLandingTableV2/visible/visibleTypes.d.ts +50 -0
- package/lib/components/StepsLandingTableV2/visible/visibleTypes.js +2 -0
- package/lib/components/StepsLandingTableV2/visible/visibleTypes.js.map +1 -0
- package/lib/components/StorageUsageBar/StorageUsageBar.d.ts +4 -0
- package/lib/components/StorageUsageBar/StorageUsageBar.js +9 -0
- package/lib/components/StorageUsageBar/StorageUsageBar.js.map +1 -0
- package/lib/components/StorageUsageBar/index.d.ts +1 -0
- package/lib/components/StorageUsageBar/index.js +2 -0
- package/lib/components/StorageUsageBar/index.js.map +1 -0
- package/lib/components/StorageUsageBar/types.d.ts +7 -0
- package/lib/components/StorageUsageBar/types.js +2 -0
- package/lib/components/StorageUsageBar/types.js.map +1 -0
- package/lib/components/TableTreeFn/Components/TableCell.js +1 -1
- package/lib/components/TableTreeFn/Components/TableCell.js.map +1 -1
- package/lib/components/TableTreeFn/TableTreeFn.js +25 -4
- package/lib/components/TableTreeFn/TableTreeFn.js.map +1 -1
- package/lib/components/Typography/Typography.js +2 -2
- package/lib/components/Typography/Typography.js.map +1 -1
- package/lib/components/ZoomControl/ZoomControl.d.ts +5 -0
- package/lib/components/ZoomControl/ZoomControl.js +22 -0
- package/lib/components/ZoomControl/ZoomControl.js.map +1 -0
- package/lib/components/ZoomControl/index.d.ts +1 -0
- package/lib/components/ZoomControl/index.js +2 -0
- package/lib/components/ZoomControl/index.js.map +1 -0
- package/lib/components/ZoomControl/types.d.ts +8 -0
- package/lib/components/ZoomControl/types.js +2 -0
- package/lib/components/ZoomControl/types.js.map +1 -0
- package/lib/index.d.ts +25 -2
- package/lib/index.js +9 -9
- package/lib/index.js.map +1 -1
- package/lib/styles.css +1 -1
- package/lib/styles.css.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/getTreeDetails/getTreeDetails.js +70 -11
- package/lib/utils/getTreeDetails/getTreeDetails.js.map +1 -1
- package/lib/utils/handleTreeExpandAllCollapseAll/handleTreeExpandAllCollapseAll.js +1 -0
- package/lib/utils/handleTreeExpandAllCollapseAll/handleTreeExpandAllCollapseAll.js.map +1 -1
- package/package.json +2 -2
- package/lib/components/StepsLandingTable/internal/FenwickTree.d.ts +0 -9
- package/lib/components/StepsLandingTable/internal/FenwickTree.js +0 -57
- package/lib/components/StepsLandingTable/internal/FenwickTree.js.map +0 -1
- package/lib/components/StepsLandingTable/internal/VirtualSurface.d.ts +0 -4
- package/lib/components/StepsLandingTable/internal/VirtualSurface.js +0 -303
- package/lib/components/StepsLandingTable/internal/VirtualSurface.js.map +0 -1
- package/lib/components/StepsLandingTable/internal/flattenVisibleNodes.d.ts +0 -4
- package/lib/components/StepsLandingTable/internal/flattenVisibleNodes.js +0 -156
- package/lib/components/StepsLandingTable/internal/flattenVisibleNodes.js.map +0 -1
- package/lib/components/StepsLandingTable/internal/renderers.d.ts +0 -62
- package/lib/components/StepsLandingTable/internal/renderers.js +0 -109
- package/lib/components/StepsLandingTable/internal/renderers.js.map +0 -1
- package/lib/components/StepsLandingTable/internal/types.d.ts +0 -80
- package/lib/components/StepsLandingTable/internal/types.js.map +0 -1
- /package/lib/components/{StepsLandingTable/internal → StepsLandingTableV2/model}/types.js +0 -0
|
@@ -1,303 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, } from 'react';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
import FenwickTree from './FenwickTree';
|
|
5
|
-
const DEFAULT_VIEWPORT_HEIGHT = 480;
|
|
6
|
-
const MIN_POOL_SIZE = 72;
|
|
7
|
-
const MIN_ROW_HEIGHT = 28;
|
|
8
|
-
const clamp = (value, min, max) => Math.min(max, Math.max(min, value));
|
|
9
|
-
const createEmptyBuffer = (id, poolSize) => ({
|
|
10
|
-
id,
|
|
11
|
-
ready: false,
|
|
12
|
-
stamp: 0,
|
|
13
|
-
window: { start: 0, end: -1, guardStart: 0, guardEnd: -1 },
|
|
14
|
-
slotNodeIndices: new Array(poolSize).fill(-1),
|
|
15
|
-
slotOffsets: new Array(poolSize).fill(0),
|
|
16
|
-
});
|
|
17
|
-
const rangesWithinGuard = (range, guard) => range.start >= guard.guardStart && range.end <= guard.guardEnd;
|
|
18
|
-
const windowsEqual = (left, right) => left.start === right.start &&
|
|
19
|
-
left.end === right.end &&
|
|
20
|
-
left.guardStart === right.guardStart &&
|
|
21
|
-
left.guardEnd === right.guardEnd;
|
|
22
|
-
const slotNodeIndicesEqual = (left, right) => {
|
|
23
|
-
if (left.length !== right.length) {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
for (let index = 0; index < left.length; index += 1) {
|
|
27
|
-
if (left[index] !== right[index]) {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return true;
|
|
32
|
-
};
|
|
33
|
-
const buffersEqual = (left, right) => left.ready === right.ready &&
|
|
34
|
-
windowsEqual(left.window, right.window) &&
|
|
35
|
-
slotNodeIndicesEqual(left.slotNodeIndices, right.slotNodeIndices);
|
|
36
|
-
const RowSlot = memo(({ bufferId, slotIndex, node, top, hidden, renderNode, registerSlot, }) => (_jsx("div", { ref: (element) => registerSlot(bufferId, slotIndex, element), className: "ff-step-virtual-slot", style: {
|
|
37
|
-
transform: `translate3d(0, ${top}px, 0)`,
|
|
38
|
-
visibility: hidden || !node ? 'hidden' : 'visible',
|
|
39
|
-
}, children: node ? renderNode(node) : null })));
|
|
40
|
-
RowSlot.displayName = 'RowSlot';
|
|
41
|
-
const VirtualSurface = ({ nodes, height, renderNode, className = '', surfaceRef, scrollTargetKey, onScrollTargetSettled, onClick, onPointerDown, onMouseOver, onMouseLeave, }) => {
|
|
42
|
-
const containerRef = useRef(null);
|
|
43
|
-
const resizeObserverRef = useRef(null);
|
|
44
|
-
const measurementObserverRef = useRef(null);
|
|
45
|
-
const slotMetaRef = useRef(new Map());
|
|
46
|
-
const heightCacheRef = useRef(new Map());
|
|
47
|
-
const nodeMapRef = useRef(new Map());
|
|
48
|
-
const pendingHeightFrameRef = useRef(null);
|
|
49
|
-
const planFrameRef = useRef(null);
|
|
50
|
-
const swapFrameRef = useRef(null);
|
|
51
|
-
const scrollTargetTimerRef = useRef(null);
|
|
52
|
-
const lastScrollSnapshotRef = useRef({ top: 0, time: 0 });
|
|
53
|
-
const scrollTopRef = useRef(0);
|
|
54
|
-
const velocityRef = useRef(0);
|
|
55
|
-
const [viewportHeight, setViewportHeight] = useState(DEFAULT_VIEWPORT_HEIGHT);
|
|
56
|
-
const [heightVersion, setHeightVersion] = useState(0);
|
|
57
|
-
const poolSize = useMemo(() => Math.max(MIN_POOL_SIZE, Math.ceil((viewportHeight || DEFAULT_VIEWPORT_HEIGHT) / MIN_ROW_HEIGHT) * 4), [viewportHeight]);
|
|
58
|
-
const [activeBuffer, setActiveBuffer] = useState(0);
|
|
59
|
-
const [buffers, setBuffers] = useState([
|
|
60
|
-
createEmptyBuffer(0, poolSize),
|
|
61
|
-
createEmptyBuffer(1, poolSize),
|
|
62
|
-
]);
|
|
63
|
-
const buffersRef = useRef(buffers);
|
|
64
|
-
const activeBufferRef = useRef(activeBuffer);
|
|
65
|
-
const swapStampRef = useRef(0);
|
|
66
|
-
useEffect(() => {
|
|
67
|
-
buffersRef.current = buffers;
|
|
68
|
-
}, [buffers]);
|
|
69
|
-
useEffect(() => {
|
|
70
|
-
activeBufferRef.current = activeBuffer;
|
|
71
|
-
}, [activeBuffer]);
|
|
72
|
-
const heights = useMemo(() => nodes.map((node) => heightCacheRef.current.get(node.key) ?? node.estimatedHeight), [nodes, heightVersion]);
|
|
73
|
-
const heightIndex = useMemo(() => new FenwickTree(heights), [heights]);
|
|
74
|
-
useEffect(() => {
|
|
75
|
-
nodeMapRef.current = new Map(nodes.map((node, index) => [node.key, index]));
|
|
76
|
-
}, [nodes]);
|
|
77
|
-
const getVisibleRange = useCallback((scrollTopValue, viewportHeightValue) => {
|
|
78
|
-
if (nodes.length === 0) {
|
|
79
|
-
return { start: 0, end: -1 };
|
|
80
|
-
}
|
|
81
|
-
const safeViewport = viewportHeightValue || DEFAULT_VIEWPORT_HEIGHT;
|
|
82
|
-
const start = clamp(heightIndex.findIndexByOffset(scrollTopValue), 0, Math.max(nodes.length - 1, 0));
|
|
83
|
-
const end = clamp(heightIndex.findIndexByOffset(scrollTopValue + safeViewport), start, Math.max(nodes.length - 1, 0));
|
|
84
|
-
return { start, end };
|
|
85
|
-
}, [heightIndex, nodes.length]);
|
|
86
|
-
const computeWindow = useCallback((scrollTopValue, viewportHeightValue, velocity) => {
|
|
87
|
-
if (nodes.length === 0) {
|
|
88
|
-
return { start: 0, end: -1, guardStart: 0, guardEnd: -1 };
|
|
89
|
-
}
|
|
90
|
-
const safeViewport = viewportHeightValue || DEFAULT_VIEWPORT_HEIGHT;
|
|
91
|
-
const speed = Math.abs(velocity);
|
|
92
|
-
const isFast = speed > 1.25;
|
|
93
|
-
const backwardOverscanPx = safeViewport * (isFast ? 1 : 0.65);
|
|
94
|
-
const forwardOverscanPx = safeViewport * (isFast ? 2 : 1.2);
|
|
95
|
-
const guardBackwardPx = safeViewport * 0.2;
|
|
96
|
-
const guardForwardPx = safeViewport * (isFast ? 0.8 : 0.45);
|
|
97
|
-
const start = clamp(heightIndex.findIndexByOffset(Math.max(0, scrollTopValue - backwardOverscanPx)), 0, Math.max(nodes.length - 1, 0));
|
|
98
|
-
const end = clamp(heightIndex.findIndexByOffset(scrollTopValue + safeViewport + forwardOverscanPx) + 1, start, Math.max(nodes.length - 1, 0));
|
|
99
|
-
const guardStart = clamp(heightIndex.findIndexByOffset(Math.max(0, scrollTopValue - guardBackwardPx)), start, end);
|
|
100
|
-
const guardEnd = clamp(heightIndex.findIndexByOffset(scrollTopValue + safeViewport + guardForwardPx) + 1, guardStart, end);
|
|
101
|
-
return { start, end, guardStart, guardEnd };
|
|
102
|
-
}, [heightIndex, nodes.length]);
|
|
103
|
-
const buildBuffer = useCallback((id, windowRange, stamp) => {
|
|
104
|
-
const buffer = createEmptyBuffer(id, poolSize);
|
|
105
|
-
buffer.ready = true;
|
|
106
|
-
buffer.stamp = stamp;
|
|
107
|
-
buffer.window = windowRange;
|
|
108
|
-
let slotPointer = 0;
|
|
109
|
-
for (let nodeIndex = windowRange.start; nodeIndex <= windowRange.end && slotPointer < poolSize; nodeIndex += 1) {
|
|
110
|
-
buffer.slotNodeIndices[slotPointer] = nodeIndex;
|
|
111
|
-
buffer.slotOffsets[slotPointer] = heightIndex.prefixSum(nodeIndex - 1);
|
|
112
|
-
slotPointer += 1;
|
|
113
|
-
}
|
|
114
|
-
return buffer;
|
|
115
|
-
}, [heightIndex, poolSize]);
|
|
116
|
-
const resetBuffers = useCallback(() => {
|
|
117
|
-
const nextWindow = computeWindow(scrollTopRef.current, viewportHeight, velocityRef.current);
|
|
118
|
-
const stamp = Date.now();
|
|
119
|
-
const first = buildBuffer(0, nextWindow, stamp);
|
|
120
|
-
const second = buildBuffer(1, nextWindow, stamp);
|
|
121
|
-
setBuffers((previous) => {
|
|
122
|
-
if (buffersEqual(previous[0], first) &&
|
|
123
|
-
buffersEqual(previous[1], second)) {
|
|
124
|
-
return previous;
|
|
125
|
-
}
|
|
126
|
-
return [first, second];
|
|
127
|
-
});
|
|
128
|
-
setActiveBuffer((previous) => (previous === 0 ? previous : 0));
|
|
129
|
-
}, [buildBuffer, computeWindow, viewportHeight]);
|
|
130
|
-
useLayoutEffect(() => {
|
|
131
|
-
resetBuffers();
|
|
132
|
-
}, [nodes, poolSize, resetBuffers]);
|
|
133
|
-
useEffect(() => {
|
|
134
|
-
if (!containerRef.current) {
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
resizeObserverRef.current?.disconnect();
|
|
138
|
-
resizeObserverRef.current = new ResizeObserver((entries) => {
|
|
139
|
-
const entry = entries[0];
|
|
140
|
-
const nextHeight = entry?.contentRect.height;
|
|
141
|
-
if (nextHeight && nextHeight !== viewportHeight) {
|
|
142
|
-
setViewportHeight(nextHeight);
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
resizeObserverRef.current.observe(containerRef.current);
|
|
146
|
-
return () => {
|
|
147
|
-
resizeObserverRef.current?.disconnect();
|
|
148
|
-
};
|
|
149
|
-
}, [viewportHeight]);
|
|
150
|
-
useEffect(() => {
|
|
151
|
-
measurementObserverRef.current?.disconnect();
|
|
152
|
-
measurementObserverRef.current = new ResizeObserver((entries) => {
|
|
153
|
-
let shouldFlush = false;
|
|
154
|
-
entries.forEach((entry) => {
|
|
155
|
-
const meta = slotMetaRef.current.get(entry.target);
|
|
156
|
-
if (!meta) {
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
const buffer = buffersRef.current[meta.bufferId];
|
|
160
|
-
const nodeIndex = buffer?.slotNodeIndices[meta.slotIndex] ?? -1;
|
|
161
|
-
if (nodeIndex < 0) {
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
const node = nodes[nodeIndex];
|
|
165
|
-
if (!node) {
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
const nextHeight = Math.ceil(entry.contentRect.height);
|
|
169
|
-
const previousHeight = heightCacheRef.current.get(node.key);
|
|
170
|
-
if (!previousHeight || Math.abs(previousHeight - nextHeight) > 1) {
|
|
171
|
-
heightCacheRef.current.set(node.key, nextHeight);
|
|
172
|
-
shouldFlush = true;
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
if (shouldFlush && pendingHeightFrameRef.current === null) {
|
|
176
|
-
pendingHeightFrameRef.current = window.requestAnimationFrame(() => {
|
|
177
|
-
pendingHeightFrameRef.current = null;
|
|
178
|
-
setHeightVersion((value) => value + 1);
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
});
|
|
182
|
-
return () => {
|
|
183
|
-
measurementObserverRef.current?.disconnect();
|
|
184
|
-
if (pendingHeightFrameRef.current !== null) {
|
|
185
|
-
window.cancelAnimationFrame(pendingHeightFrameRef.current);
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
}, [nodes]);
|
|
189
|
-
const registerSlot = useCallback((bufferId, slotIndex, element) => {
|
|
190
|
-
if (!measurementObserverRef.current) {
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
for (const [observedElement, meta] of slotMetaRef.current.entries()) {
|
|
194
|
-
if (meta.bufferId === bufferId && meta.slotIndex === slotIndex) {
|
|
195
|
-
measurementObserverRef.current.unobserve(observedElement);
|
|
196
|
-
slotMetaRef.current.delete(observedElement);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
if (element) {
|
|
200
|
-
slotMetaRef.current.set(element, { bufferId, slotIndex });
|
|
201
|
-
measurementObserverRef.current.observe(element);
|
|
202
|
-
}
|
|
203
|
-
}, []);
|
|
204
|
-
const planNextWindow = useCallback(() => {
|
|
205
|
-
planFrameRef.current = null;
|
|
206
|
-
if (nodes.length === 0) {
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
const visibleRange = getVisibleRange(scrollTopRef.current, viewportHeight);
|
|
210
|
-
const currentBuffers = buffersRef.current;
|
|
211
|
-
const currentActiveId = activeBufferRef.current;
|
|
212
|
-
const currentActiveBuffer = currentBuffers[currentActiveId];
|
|
213
|
-
if (currentActiveBuffer.ready && rangesWithinGuard(visibleRange, currentActiveBuffer.window)) {
|
|
214
|
-
return;
|
|
215
|
-
}
|
|
216
|
-
const standbyId = currentActiveId === 0 ? 1 : 0;
|
|
217
|
-
const standbyBuffer = currentBuffers[standbyId];
|
|
218
|
-
if (standbyBuffer.ready && rangesWithinGuard(visibleRange, standbyBuffer.window)) {
|
|
219
|
-
setActiveBuffer(standbyId);
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
const stamp = Date.now();
|
|
223
|
-
const nextWindow = computeWindow(scrollTopRef.current, viewportHeight, velocityRef.current);
|
|
224
|
-
const preparedBuffer = buildBuffer(standbyId, nextWindow, stamp);
|
|
225
|
-
swapStampRef.current = stamp;
|
|
226
|
-
setBuffers((previous) => {
|
|
227
|
-
const copy = [...previous];
|
|
228
|
-
copy[standbyId] = preparedBuffer;
|
|
229
|
-
return copy;
|
|
230
|
-
});
|
|
231
|
-
if (swapFrameRef.current !== null) {
|
|
232
|
-
window.cancelAnimationFrame(swapFrameRef.current);
|
|
233
|
-
}
|
|
234
|
-
swapFrameRef.current = window.requestAnimationFrame(() => {
|
|
235
|
-
swapFrameRef.current = null;
|
|
236
|
-
const latestBuffers = buffersRef.current;
|
|
237
|
-
if (latestBuffers[standbyId]?.stamp === swapStampRef.current) {
|
|
238
|
-
setActiveBuffer(standbyId);
|
|
239
|
-
}
|
|
240
|
-
});
|
|
241
|
-
}, [buildBuffer, computeWindow, getVisibleRange, nodes.length, viewportHeight]);
|
|
242
|
-
const handleScroll = useCallback(() => {
|
|
243
|
-
if (!containerRef.current) {
|
|
244
|
-
return;
|
|
245
|
-
}
|
|
246
|
-
const nextTop = containerRef.current.scrollTop;
|
|
247
|
-
const now = performance.now();
|
|
248
|
-
const previous = lastScrollSnapshotRef.current;
|
|
249
|
-
const elapsed = Math.max(now - previous.time, 1);
|
|
250
|
-
velocityRef.current = (nextTop - previous.top) / elapsed;
|
|
251
|
-
lastScrollSnapshotRef.current = { top: nextTop, time: now };
|
|
252
|
-
scrollTopRef.current = nextTop;
|
|
253
|
-
if (planFrameRef.current === null) {
|
|
254
|
-
planFrameRef.current = window.requestAnimationFrame(planNextWindow);
|
|
255
|
-
}
|
|
256
|
-
}, [planNextWindow]);
|
|
257
|
-
useEffect(() => {
|
|
258
|
-
if (!scrollTargetKey || !containerRef.current) {
|
|
259
|
-
return;
|
|
260
|
-
}
|
|
261
|
-
const targetIndex = nodeMapRef.current.get(scrollTargetKey);
|
|
262
|
-
if (targetIndex === undefined) {
|
|
263
|
-
return;
|
|
264
|
-
}
|
|
265
|
-
const top = Math.max(heightIndex.prefixSum(targetIndex - 1) - 24, 0);
|
|
266
|
-
containerRef.current.scrollTo({ top, behavior: 'smooth' });
|
|
267
|
-
if (scrollTargetTimerRef.current !== null) {
|
|
268
|
-
window.clearTimeout(scrollTargetTimerRef.current);
|
|
269
|
-
}
|
|
270
|
-
scrollTargetTimerRef.current = window.setTimeout(() => {
|
|
271
|
-
onScrollTargetSettled?.();
|
|
272
|
-
}, 320);
|
|
273
|
-
}, [heightIndex, onScrollTargetSettled, scrollTargetKey]);
|
|
274
|
-
useEffect(() => () => {
|
|
275
|
-
if (planFrameRef.current !== null) {
|
|
276
|
-
window.cancelAnimationFrame(planFrameRef.current);
|
|
277
|
-
}
|
|
278
|
-
if (swapFrameRef.current !== null) {
|
|
279
|
-
window.cancelAnimationFrame(swapFrameRef.current);
|
|
280
|
-
}
|
|
281
|
-
if (scrollTargetTimerRef.current !== null) {
|
|
282
|
-
window.clearTimeout(scrollTargetTimerRef.current);
|
|
283
|
-
}
|
|
284
|
-
}, []);
|
|
285
|
-
const totalHeight = heightIndex.total();
|
|
286
|
-
return (_jsx("div", { ref: (element) => {
|
|
287
|
-
containerRef.current = element;
|
|
288
|
-
if (surfaceRef) {
|
|
289
|
-
surfaceRef.current = element;
|
|
290
|
-
}
|
|
291
|
-
}, className: classNames('ff-step-virtual-surface', className), style: { height }, onScroll: handleScroll, onClick: onClick, onPointerDown: onPointerDown, onMouseOver: onMouseOver, onMouseLeave: onMouseLeave, children: _jsx("div", { className: "ff-step-virtual-surface__content", style: { height: totalHeight }, children: buffers.map((buffer) => {
|
|
292
|
-
const hidden = buffer.id !== activeBuffer;
|
|
293
|
-
return (_jsx("div", { className: "ff-step-virtual-buffer", style: {
|
|
294
|
-
visibility: hidden ? 'hidden' : 'visible',
|
|
295
|
-
pointerEvents: hidden ? 'none' : 'auto',
|
|
296
|
-
}, "aria-hidden": hidden, children: buffer.slotNodeIndices.map((nodeIndex, slotIndex) => {
|
|
297
|
-
const node = nodeIndex >= 0 ? nodes[nodeIndex] ?? null : null;
|
|
298
|
-
return (_jsx(RowSlot, { bufferId: buffer.id, slotIndex: slotIndex, node: node, top: buffer.slotOffsets[slotIndex] ?? 0, hidden: hidden, renderNode: renderNode, registerSlot: registerSlot }, `slot-${buffer.id}-${slotIndex}`));
|
|
299
|
-
}) }, `buffer-${buffer.id}`));
|
|
300
|
-
}) }) }));
|
|
301
|
-
};
|
|
302
|
-
export default memo(VirtualSurface);
|
|
303
|
-
//# sourceMappingURL=VirtualSurface.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"VirtualSurface.js","sourceRoot":"","sources":["../../../../src/components/StepsLandingTable/internal/VirtualSurface.tsx"],"names":[],"mappings":";AAAA,OAAc,EACZ,IAAI,EACJ,WAAW,EACX,SAAS,EACT,eAAe,EACf,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AAEf,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,WAAW,MAAM,eAAe,CAAC;AAGxC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AACpC,MAAM,aAAa,GAAG,EAAE,CAAC;AACzB,MAAM,cAAc,GAAG,EAAE,CAAC;AAE1B,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW,EAAE,EAAE,CACxD,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;AAEtC,MAAM,iBAAiB,GAAG,CAAC,EAAS,EAAE,QAAgB,EAAe,EAAE,CAAC,CAAC;IACvE,EAAE;IACF,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE;IAC1D,eAAe,EAAE,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC7C,WAAW,EAAE,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;CACzC,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAG,CACxB,KAAyC,EACzC,KAAk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AAC,EAAE,EAAE,CAwBtB,CACP,CAAC;YACJ,CAAC,CAAC,GACE,GACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC,cAAc,CAAC,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ColumnProps } from '../types';
|
|
2
|
-
import { FlattenVisibleNodesOptions, GridTemplates, VisibleNode } from './types';
|
|
3
|
-
export declare const buildGridTemplates: (columns: ColumnProps[]) => GridTemplates;
|
|
4
|
-
export declare const flattenVisibleNodes: ({ tableData, addNlp, editMode, viewModeId, expandedGroups, expandedSections, isViewPrivilegeMode, isDraggable, }: FlattenVisibleNodesOptions) => VisibleNode[];
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import { appendNewRow } from '../../../utils/AppendNewRow/AppendNewRow';
|
|
2
|
-
const GROUP_TYPES = new Set(['group', 'pre', 'post', 'script']);
|
|
3
|
-
const SECTION_HEIGHT = 34;
|
|
4
|
-
const DATA_ROW_HEIGHT = 34;
|
|
5
|
-
const DETAIL_ROW_HEIGHT = 160;
|
|
6
|
-
const EDIT_ROW_HEIGHT = 88;
|
|
7
|
-
const NLP_ROW_HEIGHT = 80;
|
|
8
|
-
const EMPTY_ROW_HEIGHT = 220;
|
|
9
|
-
const getColumnWidth = (column) => typeof column.width === 'number' ? `${column.width}px` : 'minmax(0, 1fr)';
|
|
10
|
-
const getSectionWidth = (column, index) => {
|
|
11
|
-
const width = column.width ?? 0;
|
|
12
|
-
switch (index) {
|
|
13
|
-
case 0:
|
|
14
|
-
return `${width + 110}px`;
|
|
15
|
-
case 1:
|
|
16
|
-
return `${width + (width > 300 ? 60 : 70)}px`;
|
|
17
|
-
case 2:
|
|
18
|
-
return `${width + 20}px`;
|
|
19
|
-
default:
|
|
20
|
-
return `${width}px`;
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
export const buildGridTemplates = (columns) => ({
|
|
24
|
-
bodyTemplate: columns.map(getColumnWidth).join(' '),
|
|
25
|
-
sectionTemplate: columns.map(getSectionWidth).join(' '),
|
|
26
|
-
});
|
|
27
|
-
const getChildRows = (row) => Array.isArray(row?.data)
|
|
28
|
-
? row.data
|
|
29
|
-
: Array.isArray(row?.stepResults)
|
|
30
|
-
? row.stepResults
|
|
31
|
-
: [];
|
|
32
|
-
const canExpandRow = (row) => {
|
|
33
|
-
const entityType = row?.entityType?.toLowerCase?.();
|
|
34
|
-
const type = row?.type?.toLowerCase?.();
|
|
35
|
-
return GROUP_TYPES.has(entityType) || GROUP_TYPES.has(type) || getChildRows(row).length > 0;
|
|
36
|
-
};
|
|
37
|
-
const createVisibleNode = (kind, sectionIndex, section, row, rootIndex, depth, visualIndent, serialNumber, options) => ({
|
|
38
|
-
key: kind === 'section-header'
|
|
39
|
-
? `section:${section?.title}`
|
|
40
|
-
: kind === 'no-data-row'
|
|
41
|
-
? `empty:${section?.title}`
|
|
42
|
-
: `${kind}:${section?.title}:${row?.stepId ?? row?.id ?? rootIndex}:${serialNumber}`,
|
|
43
|
-
kind,
|
|
44
|
-
sectionIndex,
|
|
45
|
-
sectionTitle: section?.title ?? '',
|
|
46
|
-
section,
|
|
47
|
-
row,
|
|
48
|
-
rowId: row?.stepId ?? row?.id,
|
|
49
|
-
rootIndex,
|
|
50
|
-
depth,
|
|
51
|
-
visualIndent,
|
|
52
|
-
estimatedHeight: kind === 'section-header'
|
|
53
|
-
? SECTION_HEIGHT
|
|
54
|
-
: kind === 'detail-row'
|
|
55
|
-
? DETAIL_ROW_HEIGHT
|
|
56
|
-
: kind === 'edit-row'
|
|
57
|
-
? EDIT_ROW_HEIGHT
|
|
58
|
-
: kind === 'nlp-row'
|
|
59
|
-
? NLP_ROW_HEIGHT
|
|
60
|
-
: kind === 'no-data-row'
|
|
61
|
-
? EMPTY_ROW_HEIGHT
|
|
62
|
-
: DATA_ROW_HEIGHT,
|
|
63
|
-
tableType: section?.title ?? '',
|
|
64
|
-
serialNumber,
|
|
65
|
-
...options,
|
|
66
|
-
});
|
|
67
|
-
export const flattenVisibleNodes = ({ tableData, addNlp, editMode, viewModeId, expandedGroups, expandedSections, isViewPrivilegeMode = false, isDraggable = true, }) => {
|
|
68
|
-
const nodes = [];
|
|
69
|
-
const visitRows = (section, sectionIndex, rows, depth, visualIndent, serialPrefix, rootIndexResolver) => {
|
|
70
|
-
rows.forEach((row, index) => {
|
|
71
|
-
const rootIndex = rootIndexResolver(index);
|
|
72
|
-
const serialNumber = serialPrefix
|
|
73
|
-
? `${serialPrefix}.${index + 1}`
|
|
74
|
-
: `${rootIndex + 1}`;
|
|
75
|
-
const children = getChildRows(row);
|
|
76
|
-
const rowId = row?.stepId ?? row?.id ?? `${section.title}-${serialNumber}`;
|
|
77
|
-
const isRootRow = depth === 0;
|
|
78
|
-
const showGroupToggle = canExpandRow(row);
|
|
79
|
-
const groupExpanded = expandedGroups.has(String(rowId));
|
|
80
|
-
const isEditableRow = isRootRow && editMode === row?.stepId;
|
|
81
|
-
const isNewRow = isRootRow && row?.isNew;
|
|
82
|
-
const isClickableView = depth > 0 && !row?.displayName?.includes?.('End') && !row?.isDisabled;
|
|
83
|
-
if (isEditableRow) {
|
|
84
|
-
nodes.push(createVisibleNode('edit-row', sectionIndex, section, row, rootIndex, depth, visualIndent, serialNumber, {
|
|
85
|
-
isSelectable: false,
|
|
86
|
-
isDraggable: false,
|
|
87
|
-
isClickableView: false,
|
|
88
|
-
showGroupToggle: false,
|
|
89
|
-
isGroupExpanded: false,
|
|
90
|
-
}));
|
|
91
|
-
}
|
|
92
|
-
else if (isNewRow) {
|
|
93
|
-
nodes.push(createVisibleNode('nlp-row', sectionIndex, section, row, rootIndex, depth, visualIndent, serialNumber, {
|
|
94
|
-
isSelectable: false,
|
|
95
|
-
isDraggable: false,
|
|
96
|
-
isClickableView: false,
|
|
97
|
-
showGroupToggle: false,
|
|
98
|
-
isGroupExpanded: false,
|
|
99
|
-
}));
|
|
100
|
-
}
|
|
101
|
-
else if (viewModeId && viewModeId === row?.stepId && depth > 0) {
|
|
102
|
-
nodes.push(createVisibleNode('detail-row', sectionIndex, section, row, rootIndex, depth, visualIndent, serialNumber, {
|
|
103
|
-
isSelectable: false,
|
|
104
|
-
isDraggable: false,
|
|
105
|
-
isClickableView,
|
|
106
|
-
showGroupToggle,
|
|
107
|
-
isGroupExpanded: groupExpanded,
|
|
108
|
-
}));
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
nodes.push(createVisibleNode('data-row', sectionIndex, section, row, rootIndex, depth, visualIndent, serialNumber, {
|
|
112
|
-
isSelectable: isRootRow && !isViewPrivilegeMode,
|
|
113
|
-
isDraggable: isRootRow &&
|
|
114
|
-
section?.title === 'Steps' &&
|
|
115
|
-
isDraggable &&
|
|
116
|
-
!row?.isDisabled &&
|
|
117
|
-
!row?.isSpecialNlp,
|
|
118
|
-
isClickableView,
|
|
119
|
-
showGroupToggle,
|
|
120
|
-
isGroupExpanded: groupExpanded,
|
|
121
|
-
}));
|
|
122
|
-
}
|
|
123
|
-
if (showGroupToggle && groupExpanded && children.length > 0) {
|
|
124
|
-
visitRows(section, sectionIndex, children, depth + 1, depth === 0 ? (row?.marginLeft ?? 0) + 8 : visualIndent + 8, serialNumber, () => rootIndex);
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
};
|
|
128
|
-
tableData.forEach((section, sectionIndex) => {
|
|
129
|
-
nodes.push(createVisibleNode('section-header', sectionIndex, section, undefined, -1, 0, 0, '', {
|
|
130
|
-
isSelectable: false,
|
|
131
|
-
isDraggable: false,
|
|
132
|
-
isClickableView: false,
|
|
133
|
-
showGroupToggle: false,
|
|
134
|
-
isGroupExpanded: false,
|
|
135
|
-
}));
|
|
136
|
-
if (!expandedSections[section.title]) {
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
const sectionRows = section.title === 'Steps'
|
|
140
|
-
? appendNewRow(section.data ?? [], addNlp ?? {})
|
|
141
|
-
: section.data ?? [];
|
|
142
|
-
if (sectionRows.length === 0) {
|
|
143
|
-
nodes.push(createVisibleNode('no-data-row', sectionIndex, section, undefined, -1, 0, 0, '', {
|
|
144
|
-
isSelectable: false,
|
|
145
|
-
isDraggable: false,
|
|
146
|
-
isClickableView: false,
|
|
147
|
-
showGroupToggle: false,
|
|
148
|
-
isGroupExpanded: false,
|
|
149
|
-
}));
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
visitRows(section, sectionIndex, sectionRows, 0, 0, '', (index) => index);
|
|
153
|
-
});
|
|
154
|
-
return nodes;
|
|
155
|
-
};
|
|
156
|
-
//# sourceMappingURL=flattenVisibleNodes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flattenVisibleNodes.js","sourceRoot":"","sources":["../../../../src/components/StepsLandingTable/internal/flattenVisibleNodes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAQxE,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEhE,MAAM,cAAc,GAAG,EAAE,CAAC;AAC1B,MAAM,eAAe,GAAG,EAAE,CAAC;AAC3B,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAC9B,MAAM,eAAe,GAAG,EAAE,CAAC;AAC3B,MAAM,cAAc,GAAG,EAAE,CAAC;AAC1B,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B,MAAM,cAAc,GAAG,CAAC,MAAmB,EAAE,EAAE,CAC7C,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAE5E,MAAM,eAAe,GAAG,CAAC,MAAmB,EAAE,KAAa,EAAE,EAAE;IAC7D,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,IAAI,CAAC,CAAC;IAEhC,QAAQ,KAAK,EAAE,CAAC;QACd,KA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ACZ,OAAO,EACP,SAAS,EACT,CAAC,CAAC,EACF,CAAC,EACD,CAAC,EACD,EAAE,EACF;gBACE,YAAY,EAAE,KAAK;gBACnB,WAAW,EAAE,KAAK;gBAClB,eAAe,EAAE,KAAK;gBACtB,eAAe,EAAE,KAAK;gBACtB,eAAe,EAAE,KAAK;aACvB,CACF,CACF,CAAC;YACF,OAAO;QACT,CAAC;QAED,SAAS,CAAC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
import { ColumnProps } from '../types';
|
|
3
|
-
import { GridTemplates, VisibleNode } from './types';
|
|
4
|
-
export declare const StepCheckbox: ({ checked, partial, disabled, action, rowId, sectionTitle, className, }: {
|
|
5
|
-
checked: boolean;
|
|
6
|
-
partial?: boolean;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
action: "toggle-row-checkbox" | "toggle-section-checkbox";
|
|
9
|
-
rowId?: string;
|
|
10
|
-
sectionTitle: string;
|
|
11
|
-
className?: string;
|
|
12
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export declare const SectionHeaderRow: ({ section, columns, grid, expanded, totalRows, selectedCount, isAllSelected, isPartialSelected, showActionCell, isViewPrivilegeMode, isClientSide, isHeaderRequired, isMaximize, }: {
|
|
14
|
-
section: any;
|
|
15
|
-
columns: ColumnProps[];
|
|
16
|
-
grid: GridTemplates;
|
|
17
|
-
expanded: boolean;
|
|
18
|
-
totalRows: number;
|
|
19
|
-
selectedCount: number;
|
|
20
|
-
isAllSelected: boolean;
|
|
21
|
-
isPartialSelected: boolean;
|
|
22
|
-
showActionCell: boolean;
|
|
23
|
-
isViewPrivilegeMode: boolean;
|
|
24
|
-
isClientSide: boolean;
|
|
25
|
-
isHeaderRequired: boolean;
|
|
26
|
-
isMaximize: boolean;
|
|
27
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
export declare const DataRow: ({ node, columns, grid, row, isSelected, isPartial, isViewPrivilegeMode, isClientSide, showDragHandle, }: {
|
|
29
|
-
node: VisibleNode;
|
|
30
|
-
columns: ColumnProps[];
|
|
31
|
-
grid: GridTemplates;
|
|
32
|
-
row: any;
|
|
33
|
-
isSelected: boolean;
|
|
34
|
-
isPartial: boolean;
|
|
35
|
-
isViewPrivilegeMode: boolean;
|
|
36
|
-
isClientSide: boolean;
|
|
37
|
-
showDragHandle: boolean;
|
|
38
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
39
|
-
export declare const InlineEditRow: ({ columns, grid, editComponent, node, }: {
|
|
40
|
-
columns: ColumnProps[];
|
|
41
|
-
grid: GridTemplates;
|
|
42
|
-
editComponent?: ReactNode;
|
|
43
|
-
node: VisibleNode;
|
|
44
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
45
|
-
export declare const InlineNlpRow: ({ columns, grid, nlpComponent, node, }: {
|
|
46
|
-
columns: ColumnProps[];
|
|
47
|
-
grid: GridTemplates;
|
|
48
|
-
nlpComponent?: ReactNode;
|
|
49
|
-
node: VisibleNode;
|
|
50
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
51
|
-
export declare const InlineDetailRow: ({ columns, grid, viewComponent, node, }: {
|
|
52
|
-
columns: ColumnProps[];
|
|
53
|
-
grid: GridTemplates;
|
|
54
|
-
viewComponent?: React.FC | null;
|
|
55
|
-
node: VisibleNode;
|
|
56
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
57
|
-
export declare const NoDataRow: ({ columns, grid, content, sectionTitle, }: {
|
|
58
|
-
columns: ColumnProps[];
|
|
59
|
-
grid: GridTemplates;
|
|
60
|
-
content?: ReactNode;
|
|
61
|
-
sectionTitle: string;
|
|
62
|
-
}) => import("react/jsx-runtime").JSX.Element;
|