pixel-react 1.15.52 → 1.15.54
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/README.md +75 -75
- package/lib/components/Charts/BarChart/BarChart.js +8 -8
- package/lib/components/Charts/DashboardDonutChart/DashboardDonutChart.js +6 -6
- package/lib/components/Charts/IconRadialChart/IconRadialChart.js +4 -4
- package/lib/components/Charts/PieChart/PieChart.js +5 -5
- package/lib/components/Comments/Comments.js +14 -14
- package/lib/components/Comments/childComment/ChildComment.js +14 -14
- package/lib/components/EditTextField/EditTextField.js +2 -2
- package/lib/components/Editor/Editor.js.map +1 -1
- package/lib/components/Icon/iconList.js +8 -0
- package/lib/components/Icon/iconList.js.map +1 -1
- package/lib/components/LabelEditTextField/LabelEditTextField.js +4 -4
- package/lib/components/MultiSelect/MultiSelect.js +1 -1
- package/lib/components/MultiSelect/MultiSelect.js.map +1 -1
- package/lib/components/Search/Search.d.ts +1 -1
- package/lib/components/Search/Search.js +2 -2
- package/lib/components/Search/Search.js.map +1 -1
- package/lib/components/Search/types.d.ts +2 -0
- package/lib/components/StatusIndicator/StatusIndicator.js +5 -5
- package/lib/components/StepsLandingTable/Components/StepsTitle.d.ts +1 -1
- package/lib/components/StepsLandingTable/Components/StepsTitle.js +4 -2
- package/lib/components/StepsLandingTable/Components/StepsTitle.js.map +1 -1
- package/lib/components/StepsLandingTable/Components/handleStepCheckBox.js +53 -8
- package/lib/components/StepsLandingTable/Components/handleStepCheckBox.js.map +1 -1
- package/lib/components/StepsLandingTable/StepLandingTable.js +2 -2
- package/lib/components/StepsLandingTable/StepLandingTable.js.map +1 -1
- package/lib/components/StepsLandingTable/types.d.ts +4 -0
- package/lib/components/Table/Table.d.ts +1 -1
- package/lib/components/Table/Table.js +148 -253
- package/lib/components/Table/Table.js.map +1 -1
- package/lib/components/Table/Types.d.ts +35 -0
- package/lib/components/Table/components/SortableRow.d.ts +2 -0
- package/lib/components/Table/components/SortableRow.js +71 -0
- package/lib/components/Table/components/SortableRow.js.map +1 -0
- package/lib/components/Table/components/TableHeader.d.ts +3 -0
- package/lib/components/Table/components/TableHeader.js +29 -0
- package/lib/components/Table/components/TableHeader.js.map +1 -0
- package/lib/components/Table/components/VirtualizedRows.d.ts +3 -0
- package/lib/components/Table/components/VirtualizedRows.js +11 -0
- package/lib/components/Table/components/VirtualizedRows.js.map +1 -0
- package/lib/components/Table/utils/constants.d.ts +6 -0
- package/lib/components/Table/utils/constants.js +9 -0
- package/lib/components/Table/utils/constants.js.map +1 -0
- package/lib/components/Table/utils/virtualization.d.ts +7 -0
- package/lib/components/Table/utils/virtualization.js +41 -0
- package/lib/components/Table/utils/virtualization.js.map +1 -0
- package/lib/components/TableTreeFn/TableTreeFn.js +15 -8
- package/lib/components/TableTreeFn/TableTreeFn.js.map +1 -1
- package/lib/components/TableTreeFn/types.d.ts +1 -0
- package/lib/index.d.ts +14 -3
- package/lib/index.js +7 -7
- 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/getTopVisibleNodeKey/getTopVisibleNodeKey.d.ts +7 -2
- package/lib/utils/getTopVisibleNodeKey/getTopVisibleNodeKey.js +4 -5
- package/lib/utils/getTopVisibleNodeKey/getTopVisibleNodeKey.js.map +1 -1
- package/package.json +111 -111
|
@@ -1,296 +1,191 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import './Table.scss';
|
|
3
3
|
import { isFunction } from '../../assets/utils/functionUtils';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
import { useEffect, useRef, cloneElement, isValidElement, useState, useCallback, Fragment, } from 'react';
|
|
13
|
-
import Tooltip from '../Tooltip';
|
|
14
|
-
// Add these constants near the top of the file
|
|
15
|
-
const DEFAULT_ROW_HEIGHT = 50; // Estimated row height
|
|
16
|
-
const BUFFER_SIZE = 5; // Number of extra rows to render above/below visible area
|
|
17
|
-
const getColumnLeftPosition = (index, columns, freezeColumns) => {
|
|
18
|
-
if (index === 0)
|
|
19
|
-
return '0px';
|
|
20
|
-
// Calculate cumulative width of all previous columns including padding
|
|
21
|
-
let leftPosition = 0;
|
|
22
|
-
const CELL_PADDING = 8; // Each cell has 8px padding
|
|
23
|
-
for (let i = 0; i < index; i++) {
|
|
24
|
-
const width = columns[i]?.width;
|
|
25
|
-
// Add column width plus left padding only
|
|
26
|
-
leftPosition += width
|
|
27
|
-
? parseInt(width.toString(), 10)
|
|
28
|
-
: DEFAULT_COLUMN_WIDTH;
|
|
29
|
-
// Add padding between frozen columns
|
|
30
|
-
if (freezeColumns && i < freezeColumns - 1) {
|
|
31
|
-
leftPosition += CELL_PADDING;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return `${leftPosition}px`;
|
|
35
|
-
};
|
|
36
|
-
const DEFAULT_COLUMN_WIDTH = 400;
|
|
37
|
-
const calculateFrozenWidth = (columnData, freezeColumns) => {
|
|
38
|
-
return (columnData
|
|
39
|
-
.slice(0, freezeColumns)
|
|
40
|
-
.reduce((acc, col) => acc +
|
|
41
|
-
parseInt(col.width?.toString() || `${DEFAULT_COLUMN_WIDTH}`, 10), 1) +
|
|
42
|
-
8 * (freezeColumns - 0.17));
|
|
43
|
-
};
|
|
44
|
-
const SortableRow = ({ row, columns, tableBodyRowClass, handleOnclick, tableDataTextColor, withCheckbox, onSelectClick, draggable, serialNumber, editMode, isAccordionOpen, accordionContent, isRowCheckBoxDisable, isRowDisabled = true, freezeColumns, displayCard, updateRowHeight, index, }) => {
|
|
45
|
-
const { attributes, listeners, setNodeRef, transform, transition } = useSortable({
|
|
46
|
-
id: row?._id || row?.id,
|
|
47
|
-
disabled: row.disabled || !!editMode,
|
|
48
|
-
});
|
|
49
|
-
const rowRef = useRef(null);
|
|
50
|
-
useEffect(() => {
|
|
51
|
-
if (rowRef.current && updateRowHeight) {
|
|
52
|
-
const height = rowRef.current.getBoundingClientRect().height;
|
|
53
|
-
updateRowHeight(index, height);
|
|
54
|
-
}
|
|
55
|
-
}, [index, updateRowHeight]);
|
|
56
|
-
const style = {
|
|
57
|
-
transform: CSS.Transform.toString(transform),
|
|
58
|
-
transition,
|
|
59
|
-
};
|
|
60
|
-
const key = row._id || row.id;
|
|
61
|
-
return (_jsxs(_Fragment, { children: [_jsx("tr", { ref: setNodeRef, style: style, className: classNames('ff-table-data-row ', tableBodyRowClass, {
|
|
62
|
-
'ff-table-disabled': row.disabled && isRowDisabled,
|
|
63
|
-
'ff-table-display-card': displayCard,
|
|
64
|
-
}), id: key, children: columns.map((column, index) => {
|
|
65
|
-
const isFrozen = freezeColumns && index < freezeColumns;
|
|
66
|
-
return (_jsx("td", { style: {
|
|
67
|
-
position: isFrozen ? 'sticky' : 'static',
|
|
68
|
-
left: isFrozen
|
|
69
|
-
? getColumnLeftPosition(index, columns, freezeColumns)
|
|
70
|
-
: 'auto',
|
|
71
|
-
zIndex: isFrozen ? 100 : 'auto',
|
|
72
|
-
backgroundColor: isFrozen
|
|
73
|
-
? 'var(--input-label-bg-color)'
|
|
74
|
-
: 'transparent',
|
|
75
|
-
width: column.width ? `${column.width}px` : 'auto',
|
|
76
|
-
padding: '7px 8px',
|
|
77
|
-
boxSizing: 'border-box',
|
|
78
|
-
paddingRight: isFrozen ? 0 : '8px',
|
|
79
|
-
}, "data-frozen": isFrozen || undefined, onClick: () => handleOnclick(column, row), className: classNames('ff-table-data-cell ff-table-icon-container', column.className, {
|
|
80
|
-
'ff-table-clickable-cell': column.onClick,
|
|
81
|
-
'ff-table-sticky-column': isFrozen,
|
|
82
|
-
}), children: _jsxs(Typography, { as: "div", color: tableDataTextColor, className: "ff-table-data-container", children: [index === 0 && withCheckbox && (_jsx("span", { className: "ff-table-checkbox-table", children: _jsx(Checkbox, { onChange: (e) => {
|
|
83
|
-
onSelectClick(e, row);
|
|
84
|
-
}, checked: row.checked, disabled: isRowCheckBoxDisable === undefined
|
|
85
|
-
? !!row.disabled
|
|
86
|
-
: isRowCheckBoxDisable }) })), index === 0 && draggable && (_jsxs(_Fragment, { children: [_jsx("span", { className: row.disabled ? 'ff-table-drag' : 'ff-table-drag-icon', ...listeners, ...attributes, children: _jsx(Icon, { name: "drag", className: "ff-table-drag-active" }) }), _jsx(Typography, { color: "var(--brand-color)", children: serialNumber && `${serialNumber}.` })] })), prepareData(row, column)] }) }, column.accessor + index));
|
|
87
|
-
}) }, key), isAccordionOpen ? (_jsx("tr", { children: _jsx("td", { className: "ff-table-data-cell", colSpan: columns.length, children: _jsx("div", { children: accordionContent ? accordionContent : null }) }) })) : null] }));
|
|
88
|
-
};
|
|
89
|
-
const Table = ({ data = [], columns = [], headerType, withCheckbox = false, onSelect, allSelected, partialSelected = false, withFixedHeader = true, borderWithRadius = false, headerCheckboxDisabled = false, noDataContent, height = '100%', className = '', tableHeadClass = '', tableBodyRowClass = '', headerTextColor, tableDataTextColor, headerIconName = '', headerIconOnClick = () => { }, draggable = false, onDragEnd, loadMore = () => { }, editMode = '', editComponent, getAccordionStatus = () => { }, accordionContent, tableRef = null, isRowCheckBoxDisable, isRowDisabled = true, tableHeaderZindex = 99, freezeColumns, headerIconTooltipTitle, }) => {
|
|
90
|
-
const observerRef = useRef(null);
|
|
91
|
-
// Add virtualization state
|
|
5
|
+
import { useEffect, useRef, useState, useCallback, useMemo, useImperativeHandle, forwardRef, } from 'react';
|
|
6
|
+
import { binarySearch, calculateFrozenWidth } from './utils/virtualization';
|
|
7
|
+
import { BUFFER_SIZE, DEFAULT_ROW_HEIGHT } from './utils/constants';
|
|
8
|
+
import TableHeader from './components/TableHeader';
|
|
9
|
+
import VirtualizedRows from './components/VirtualizedRows';
|
|
10
|
+
import { debounce } from '../../utils/debounce/debounce';
|
|
11
|
+
const Table = forwardRef(({ data = [], columns = [], headerType, withCheckbox = false, onSelect, allSelected, partialSelected = false, withFixedHeader = true, borderWithRadius = false, headerCheckboxDisabled = false, noDataContent, height = '100%', className = '', tableHeadClass = '', tableBodyRowClass = '', headerTextColor, tableDataTextColor, headerIconName = '', headerIconOnClick = () => { }, draggable = false, tableRef = null, isRowCheckBoxDisable, isRowDisabled = true, tableHeaderZindex = 99, freezeColumns, headerIconTooltipTitle, }, ref) => {
|
|
92
12
|
const containerRef = useRef(null);
|
|
13
|
+
const totalRows = data.length;
|
|
93
14
|
const setContainerRef = (node) => {
|
|
94
|
-
// 1. Set internal ref
|
|
95
15
|
containerRef.current = node;
|
|
96
|
-
// 2. Handle forwarded ref
|
|
97
16
|
if (tableRef) {
|
|
98
17
|
if (typeof tableRef === 'function') {
|
|
99
|
-
// Handle callback refs
|
|
100
18
|
tableRef(node);
|
|
101
19
|
}
|
|
102
20
|
else if (typeof tableRef === 'object' && 'current' in tableRef) {
|
|
103
|
-
// Handle mutable ref objects only
|
|
104
21
|
tableRef.current = node;
|
|
105
22
|
}
|
|
106
|
-
// Read-only RefObjects are safely ignored
|
|
107
23
|
}
|
|
108
24
|
};
|
|
109
25
|
const [scrollTop, setScrollTop] = useState(0);
|
|
110
26
|
const [containerHeight, setContainerHeight] = useState(0);
|
|
111
|
-
|
|
112
|
-
|
|
27
|
+
// --- PERFORMANCE FIX 1: Use useRef for heights (No Re-renders) ---
|
|
28
|
+
const rowHeightsMap = useRef({});
|
|
29
|
+
// This version number triggers the re-calculation of the virtual list
|
|
30
|
+
const [heightVersion, setHeightVersion] = useState(0);
|
|
31
|
+
// Reset heights when data array reference changes
|
|
113
32
|
useEffect(() => {
|
|
114
|
-
|
|
115
|
-
setContainerHeight(containerRef.current.clientHeight);
|
|
116
|
-
}
|
|
117
|
-
// Initialize with estimated heights
|
|
118
|
-
setRowHeights(new Array(data.length).fill(DEFAULT_ROW_HEIGHT));
|
|
33
|
+
setHeightVersion((version) => version + 1);
|
|
119
34
|
}, [data]);
|
|
120
|
-
//
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
const
|
|
130
|
-
if (Math.abs(
|
|
131
|
-
|
|
132
|
-
return newHeights;
|
|
35
|
+
// Container Resize Observer
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
const container = containerRef.current;
|
|
38
|
+
if (!container)
|
|
39
|
+
return;
|
|
40
|
+
setContainerHeight(container.clientHeight);
|
|
41
|
+
const observer = new ResizeObserver((entries) => {
|
|
42
|
+
for (let entry of entries) {
|
|
43
|
+
// Use contentRect for the container
|
|
44
|
+
const newHeight = entry.contentRect.height;
|
|
45
|
+
if (Math.abs(newHeight - containerHeight) > 1) {
|
|
46
|
+
setContainerHeight(newHeight);
|
|
133
47
|
}
|
|
134
48
|
}
|
|
135
|
-
return prev;
|
|
136
49
|
});
|
|
50
|
+
observer.observe(container);
|
|
51
|
+
return () => {
|
|
52
|
+
observer.unobserve(container);
|
|
53
|
+
observer.disconnect();
|
|
54
|
+
};
|
|
55
|
+
}, [containerHeight]);
|
|
56
|
+
const handleScroll = useCallback((e) => {
|
|
57
|
+
// Use requestAnimationFrame for scroll updates if scrolling feels jittery,
|
|
58
|
+
// generally direct state update is fine for React 18+ automatic batching.
|
|
59
|
+
setScrollTop(e.currentTarget.scrollTop);
|
|
137
60
|
}, []);
|
|
138
|
-
//
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
cumulativeHeight += rowHeights[i] || DEFAULT_ROW_HEIGHT;
|
|
153
|
-
}
|
|
154
|
-
// Find end index
|
|
155
|
-
cumulativeHeight = 0;
|
|
156
|
-
for (let i = 0; i < data.length; i++) {
|
|
157
|
-
cumulativeHeight += rowHeights[i] || DEFAULT_ROW_HEIGHT;
|
|
158
|
-
if (cumulativeHeight >= scrollTop + containerHeight &&
|
|
159
|
-
endIndex === data.length - 1) {
|
|
160
|
-
endIndex = i;
|
|
161
|
-
break;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
// Apply buffer
|
|
165
|
-
startIndex = Math.max(0, startIndex - BUFFER_SIZE);
|
|
166
|
-
endIndex = Math.min(data.length - 1, endIndex + BUFFER_SIZE);
|
|
167
|
-
// Calculate padding
|
|
168
|
-
paddingTop = rowHeights
|
|
169
|
-
.slice(0, startIndex)
|
|
170
|
-
.reduce((sum, height) => sum + height, 0);
|
|
171
|
-
paddingBottom = rowHeights
|
|
172
|
-
.slice(endIndex + 1)
|
|
173
|
-
.reduce((sum, height) => sum + height, 0);
|
|
61
|
+
// --- PERFORMANCE FIX 2: Batched Updates (Debounce) ---
|
|
62
|
+
// If 100 rows mount, this ensures we only re-calculate layout ONCE after 20ms.
|
|
63
|
+
const commitHeightUpdates = useMemo(() => debounce(() => {
|
|
64
|
+
setHeightVersion((prev) => prev + 1);
|
|
65
|
+
}, 20), []);
|
|
66
|
+
const updateRowHeight = useCallback((index, height) => {
|
|
67
|
+
const currentHeight = rowHeightsMap.current[index];
|
|
68
|
+
// Only schedule update if height changed by > 1px
|
|
69
|
+
if (currentHeight === undefined ||
|
|
70
|
+
Math.abs(currentHeight - height) > 1) {
|
|
71
|
+
// 1. Update the Ref (Synchronous, cheap)
|
|
72
|
+
rowHeightsMap.current[index] = height;
|
|
73
|
+
// 2. Trigger the Debounced Re-render (Asynchronous)
|
|
74
|
+
commitHeightUpdates();
|
|
174
75
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
76
|
+
}, [commitHeightUpdates]);
|
|
77
|
+
// --- PERFORMANCE FIX 3: Calculate Cumulative Heights from Ref ---
|
|
78
|
+
const { cumulativeHeights, totalContentHeight } = useMemo(() => {
|
|
79
|
+
let cumulative = 0;
|
|
80
|
+
const heights = [0];
|
|
81
|
+
for (let i = 0; i < totalRows; i++) {
|
|
82
|
+
// FAST: Reading directly from the Ref object
|
|
83
|
+
const height = rowHeightsMap.current[i] ?? DEFAULT_ROW_HEIGHT;
|
|
84
|
+
cumulative += height;
|
|
85
|
+
heights.push(cumulative);
|
|
183
86
|
}
|
|
87
|
+
return { cumulativeHeights: heights, totalContentHeight: cumulative };
|
|
88
|
+
}, [totalRows, heightVersion]); // Only runs when 'heightVersion' updates
|
|
89
|
+
// Virtualization Logic
|
|
90
|
+
const visibleState = useMemo(() => {
|
|
91
|
+
if (containerHeight === 0 || totalRows === 0) {
|
|
92
|
+
return {
|
|
93
|
+
startIndex: 0,
|
|
94
|
+
endIndex: -1,
|
|
95
|
+
paddingTop: 0,
|
|
96
|
+
paddingBottom: 0,
|
|
97
|
+
visibleRows: [],
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
const startIdxPlusOne = binarySearch(cumulativeHeights, scrollTop + 1);
|
|
101
|
+
let startIndex = startIdxPlusOne > 0 ? startIdxPlusOne - 1 : 0;
|
|
102
|
+
const endIdxPlusOne = binarySearch(cumulativeHeights, scrollTop + containerHeight);
|
|
103
|
+
let endIndex = endIdxPlusOne - 1;
|
|
104
|
+
let bufferedStart = Math.max(0, startIndex - BUFFER_SIZE);
|
|
105
|
+
let bufferedEnd = Math.min(totalRows - 1, endIndex + BUFFER_SIZE);
|
|
106
|
+
const paddingTop = cumulativeHeights[bufferedStart];
|
|
107
|
+
// Ensure we don't access out of bounds
|
|
108
|
+
const nextHeight = cumulativeHeights[bufferedEnd + 1];
|
|
109
|
+
const paddingBottom = totalContentHeight -
|
|
110
|
+
(nextHeight !== undefined ? nextHeight : totalContentHeight);
|
|
111
|
+
// Slicing data is cheap
|
|
184
112
|
return {
|
|
185
|
-
startIndex,
|
|
186
|
-
endIndex,
|
|
187
|
-
paddingTop,
|
|
188
|
-
paddingBottom,
|
|
189
|
-
visibleRows: data.slice(
|
|
113
|
+
startIndex: bufferedStart,
|
|
114
|
+
endIndex: bufferedEnd,
|
|
115
|
+
paddingTop: paddingTop,
|
|
116
|
+
paddingBottom: paddingBottom,
|
|
117
|
+
visibleRows: data.slice(bufferedStart, bufferedEnd + 1),
|
|
190
118
|
};
|
|
191
|
-
};
|
|
192
|
-
const { startIndex, paddingTop, paddingBottom, visibleRows } =
|
|
119
|
+
}, [scrollTop, containerHeight, totalRows, cumulativeHeights, data]);
|
|
120
|
+
const { startIndex, paddingTop, paddingBottom, visibleRows } = visibleState;
|
|
193
121
|
let frozenWidth = 0;
|
|
194
122
|
if (freezeColumns) {
|
|
195
123
|
frozenWidth = calculateFrozenWidth(columns, freezeColumns);
|
|
196
124
|
}
|
|
197
|
-
|
|
198
|
-
const scrollContainer = document.getElementById('ff-table-scroll-container');
|
|
199
|
-
const firstNode = document.getElementById('ff-table-first-node');
|
|
200
|
-
const lastNode = document.getElementById('ff-table-last-node');
|
|
201
|
-
// Exit early if data is empty or elements are missing
|
|
202
|
-
if (!scrollContainer || !firstNode || !lastNode || !data?.length) {
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
|
-
observerRef.current = new IntersectionObserver((entries) => {
|
|
206
|
-
entries.forEach((entry) => {
|
|
207
|
-
if (entry.isIntersecting) {
|
|
208
|
-
const direction = entry.target.id === 'ff-table-last-node' ? 'below' : 'above';
|
|
209
|
-
loadMore(direction);
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
}, {
|
|
213
|
-
root: scrollContainer,
|
|
214
|
-
rootMargin: '8px',
|
|
215
|
-
threshold: 0.1,
|
|
216
|
-
});
|
|
217
|
-
observerRef.current.observe(firstNode);
|
|
218
|
-
observerRef.current.observe(lastNode);
|
|
219
|
-
return () => {
|
|
220
|
-
// Cleanup observer
|
|
221
|
-
observerRef.current?.disconnect();
|
|
222
|
-
};
|
|
223
|
-
}, [data, loadMore]);
|
|
224
|
-
const handleOnclick = (column, row) => {
|
|
125
|
+
const handleOnclick = useCallback((column, row) => {
|
|
225
126
|
let { onClick, accessor } = column;
|
|
226
127
|
if (onClick && isFunction(onClick)) {
|
|
227
128
|
onClick(accessor, row);
|
|
228
129
|
}
|
|
229
|
-
};
|
|
230
|
-
const onSelectClick = (e, item) => {
|
|
130
|
+
}, []);
|
|
131
|
+
const onSelectClick = useCallback((e, item) => {
|
|
231
132
|
if (onSelect) {
|
|
232
133
|
onSelect(e, item);
|
|
233
134
|
}
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
135
|
+
}, [onSelect]);
|
|
136
|
+
// --- START OF NEW AUTOSCROLL LOGIC ---
|
|
137
|
+
/**
|
|
138
|
+
* Calculates the scroll position and imperatively scrolls the table to the row with the given ID.
|
|
139
|
+
* @param rowId The ID or _id of the row to scroll to.
|
|
140
|
+
*/
|
|
141
|
+
const scrollToRow = useCallback((rowId) => {
|
|
142
|
+
// Assuming a safe, estimated fixed header height.
|
|
143
|
+
// You MUST verify this value matches your actual TableHeader height.
|
|
144
|
+
const FIXED_HEADER_HEIGHT = 50;
|
|
145
|
+
const targetIndex = data.findIndex((row) => row.id === rowId || row._id === rowId);
|
|
146
|
+
if (targetIndex === -1 ||
|
|
147
|
+
!containerRef.current ||
|
|
148
|
+
cumulativeHeights.length === 0) {
|
|
238
149
|
return;
|
|
239
|
-
|
|
240
|
-
const
|
|
241
|
-
|
|
150
|
+
}
|
|
151
|
+
const container = containerRef.current;
|
|
152
|
+
const targetRowTop = cumulativeHeights[targetIndex];
|
|
153
|
+
const targetRowBottom = cumulativeHeights[targetIndex + 1];
|
|
154
|
+
// --- 1. Calculate Initial Adjusted Position (Handling Fixed Header) ---
|
|
155
|
+
// Scrolls the row down by the header height to bring it into full view.
|
|
156
|
+
let adjustedScrollPosition = Math.max(0, targetRowTop - FIXED_HEADER_HEIGHT);
|
|
157
|
+
const currentScrollTop = container.scrollTop;
|
|
158
|
+
const currentScrollBottom = container.scrollTop + container.clientHeight;
|
|
159
|
+
if (targetRowTop >= currentScrollTop + FIXED_HEADER_HEIGHT &&
|
|
160
|
+
targetRowBottom <= currentScrollBottom) {
|
|
242
161
|
return;
|
|
243
|
-
if (onDragEnd)
|
|
244
|
-
onDragEnd(oldIndex, newIndex);
|
|
245
|
-
};
|
|
246
|
-
const renderRow = (row, absoluteIndex) => {
|
|
247
|
-
const isOpen = getAccordionStatus(row?.id || row?._id || row?.scriptId);
|
|
248
|
-
if (editMode === row._id || editMode === row.id) {
|
|
249
|
-
return (_jsx("tr", { className: "edit-row", children: _jsx("td", { colSpan: columns.length, style: { padding: '0px' }, children: isValidElement(editComponent) &&
|
|
250
|
-
cloneElement(editComponent, {
|
|
251
|
-
rowData: row,
|
|
252
|
-
rowIndex: absoluteIndex + 1,
|
|
253
|
-
}) }) }, `edit-${row._id}`));
|
|
254
162
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
boxSizing: 'border-box',
|
|
283
|
-
// Remove right padding from frozen columns to prevent overlap
|
|
284
|
-
paddingRight: isFrozen ? 0 : '8px',
|
|
285
|
-
}, children: [_jsx("div", { className: "ff-table-icon", children: _jsx(Tooltip, { title: headerIconTooltipTitle || '', placement: "bottom", children: _jsx(Icon, { height: 14, width: 14, name: headerIconName, onClick: headerIconOnClick, cursorType: "pointer" }) }) }), _jsxs(Typography, { style: column?.width && { width: column?.width }, as: "div", fontWeight: "semi-bold", className: "ff-table-label-checkbox-container", children: [index === 0 && withCheckbox && (_jsx("span", { className: "ff-table-checkbox-table", children: _jsx(Checkbox, { onChange: (e) => {
|
|
286
|
-
onSelectClick(e, {
|
|
287
|
-
allSelected: e.target.checked,
|
|
288
|
-
});
|
|
289
|
-
}, checked: allSelected !== undefined ? allSelected : false, partial: !!partialSelected, disabled: headerCheckboxDisabled }) })), column.header] })] }, column.header));
|
|
290
|
-
}) }) }), _jsxs("tbody", { className: "ff-fixed-header-table", children: [_jsx("tr", { id: "ff-table-first-node", style: { display: 'none' } }), paddingTop > 0 && (_jsx("tr", { children: _jsx("td", { style: { height: paddingTop, padding: 0 }, colSpan: columns.length }) })), visibleRows.map((row, index) => {
|
|
291
|
-
const absoluteIndex = startIndex + index;
|
|
292
|
-
return (_jsx(Fragment, { children: renderRow(row, absoluteIndex) }, row._id || absoluteIndex));
|
|
293
|
-
}), paddingBottom > 0 && (_jsx("tr", { children: _jsx("td", { style: { height: paddingBottom, padding: 0 }, colSpan: columns.length }) })), _jsx("tr", { id: "ff-table-last-node", style: { display: 'none' } })] })] }), data?.length <= 0 && (_jsx("div", { className: "ff-no-data-content", style: { height: `calc(${height} - 50px)` }, children: noDataContent }))] }) }) }));
|
|
294
|
-
};
|
|
163
|
+
// --- 3. Edge Case: Preventing Overscrolling to the Bottom ---
|
|
164
|
+
// Find the maximum possible scrollTop value (total height minus viewport height).
|
|
165
|
+
const maxScrollTop = Math.max(0, totalContentHeight - container.clientHeight);
|
|
166
|
+
// Clamp the adjusted position to ensure we don't scroll past the content end.
|
|
167
|
+
adjustedScrollPosition = Math.min(adjustedScrollPosition, maxScrollTop);
|
|
168
|
+
// --- 4. Perform the Scroll ---
|
|
169
|
+
container.scrollTop = adjustedScrollPosition;
|
|
170
|
+
setScrollTop(adjustedScrollPosition);
|
|
171
|
+
}, [data, cumulativeHeights, totalContentHeight]);
|
|
172
|
+
// 5. Expose the scroll function to the parent component via the ref
|
|
173
|
+
useImperativeHandle(ref, () => ({
|
|
174
|
+
// Expose the custom scroll function
|
|
175
|
+
scrollToRow: scrollToRow,
|
|
176
|
+
// You can expose other methods or the containerRef here if needed
|
|
177
|
+
}));
|
|
178
|
+
// --- END OF NEW AUTOSCROLL LOGIC ---
|
|
179
|
+
return (_jsxs("div", { ref: setContainerRef, style: {
|
|
180
|
+
height,
|
|
181
|
+
overflow: 'auto',
|
|
182
|
+
position: 'relative',
|
|
183
|
+
scrollbarWidth: draggable ? 'none' : 'auto',
|
|
184
|
+
'--frozen-column-width': freezeColumns ? `${frozenWidth}px` : '0px',
|
|
185
|
+
}, id: "ff-table-scroll-container", className: classNames('ff-table-scroll-container', {
|
|
186
|
+
'ff-table-fixed-header': withFixedHeader,
|
|
187
|
+
'ff-table-container--border-radius': borderWithRadius,
|
|
188
|
+
}, className), onScroll: handleScroll, children: [_jsxs("table", { className: "ff-table-container", cellSpacing: 0, style: { height: totalContentHeight }, children: [_jsx(TableHeader, { columns: columns, freezeColumns: freezeColumns, headerType: headerType, tableHeadClass: tableHeadClass, headerTextColor: headerTextColor, headerCheckboxDisabled: headerCheckboxDisabled, withCheckbox: withCheckbox, allSelected: allSelected, partialSelected: partialSelected, headerIconName: headerIconName, headerIconOnClick: headerIconOnClick, headerIconTooltipTitle: headerIconTooltipTitle, tableHeaderZindex: tableHeaderZindex, onSelectClick: onSelectClick, withFixedHeader: withFixedHeader }), _jsx(VirtualizedRows, { paddingTop: paddingTop ?? 0, paddingBottom: paddingBottom, columnsLength: columns.length, visibleRows: visibleRows, startIndex: startIndex, columns: columns, tableBodyRowClass: tableBodyRowClass, handleOnclick: handleOnclick, tableDataTextColor: tableDataTextColor, withCheckbox: withCheckbox, onSelectClick: onSelectClick, isRowCheckBoxDisable: isRowCheckBoxDisable, isRowDisabled: isRowDisabled, freezeColumns: freezeColumns, frozenWidth: frozenWidth, updateRowHeight: updateRowHeight })] }), data?.length <= 0 && (_jsx("div", { className: "ff-no-data-content", style: { height: `calc(${height} - 50px)` }, children: noDataContent }))] }));
|
|
189
|
+
});
|
|
295
190
|
export default Table;
|
|
296
191
|
//# sourceMappingURL=Table.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.js","sourceRoot":"","sources":["../../../src/components/Table/Table.tsx"],"names":[],"mappings":";AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,UAAU,MAAM,YAAY,CAAC;AAOpC,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,UAAU,EAAgB,MAAM,eAAe,CAAC;AACzE,OAAO,EACL,eAAe,EACf,WAAW,EACX,2BAA2B,GAC5B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EACL,SAAS,EACT,MAAM,EACN,YAAY,EAEZ,cAAc,EACd,QAAQ,EACR,WAAW,EACX,QAAQ,GAGT,MAAM,OAAO,CAAC;AACf,OAAO,OAAO,MAAM,YAAY,CAAC;AAEjC,+CAA+C;AAC/C,MAAM,kBAAkB,GAAG,EAAE,CAAC,CAAC,uBAAuB;AACtD,MAAM,WAAW,GAAG,CAAC,CAAC,CAAC,0DAA0D;AAEjF,MAAM,qBAAqB,GAAG,CAC5B,KAAa,EACb,OAA6B,EAC7B,aAAsB,EACtB,EAAE;IACF,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAE9B,uEAAuE;IACvE,IAAI,YAAY,GAAG,CAAC,CAAC;IACrB,MAAM,YAAY,GAAG,CAAC,CAAC,CAAC,4BAA4B;IAEpD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAG,OAAO,CAAC,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CAAC,MAAM,EAC7B,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,OAAO,EAChB,iBAAiB,EAAE,iBAAiB,EACpC,aAAa,EAAE,aAAa,EAC5B,kBAAkB,EAAE,kBAAkB,EACtC,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,aAAa,EAC5B,oBAAoB,EAAE,oBAAoB,EAC1C,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,eAAe,GAChC,IACI,EACP,IAAI,EAAE,MAAM,IAAI,CAAC,IAAI,CACpB,cACE,SAAS,EAAC,oBAAoB,EAC9B,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,MAAM,UAAU,EAAE,YAE1C,aAAa,GACV,CACP,IACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -170,3 +170,38 @@ export interface TableProps {
|
|
|
170
170
|
export interface FormValues {
|
|
171
171
|
ifFailed: string | null;
|
|
172
172
|
}
|
|
173
|
+
export interface TableHeaderProps {
|
|
174
|
+
columns: ColumnsProps[];
|
|
175
|
+
freezeColumns?: number;
|
|
176
|
+
headerType?: string;
|
|
177
|
+
tableHeadClass?: string;
|
|
178
|
+
headerTextColor?: string;
|
|
179
|
+
headerCheckboxDisabled?: boolean;
|
|
180
|
+
withCheckbox?: boolean;
|
|
181
|
+
allSelected?: boolean;
|
|
182
|
+
partialSelected?: boolean;
|
|
183
|
+
headerIconName?: string;
|
|
184
|
+
headerIconOnClick?: () => void;
|
|
185
|
+
headerIconTooltipTitle?: string;
|
|
186
|
+
tableHeaderZindex?: number;
|
|
187
|
+
onSelectClick: (e: any, payload: any) => void;
|
|
188
|
+
withFixedHeader?: boolean;
|
|
189
|
+
}
|
|
190
|
+
export interface VirtualizedRowsProps {
|
|
191
|
+
paddingTop: number;
|
|
192
|
+
paddingBottom: number;
|
|
193
|
+
columnsLength: number;
|
|
194
|
+
visibleRows: any[];
|
|
195
|
+
startIndex: number;
|
|
196
|
+
columns: ColumnsProps[];
|
|
197
|
+
tableBodyRowClass?: string;
|
|
198
|
+
handleOnclick?: (_column: ColumnsProps, _row: DataProps) => void;
|
|
199
|
+
tableDataTextColor?: string;
|
|
200
|
+
withCheckbox?: boolean;
|
|
201
|
+
onSelectClick?: (_e: object, _item: SelectedItemProps) => void;
|
|
202
|
+
isRowCheckBoxDisable?: boolean;
|
|
203
|
+
isRowDisabled?: boolean;
|
|
204
|
+
freezeColumns?: number;
|
|
205
|
+
frozenWidth?: number;
|
|
206
|
+
updateRowHeight?: (index: number, height: number) => void;
|
|
207
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const SortableRow: import("react").MemoExoticComponent<({ row, index, serialNumber, columns, tableBodyRowClass, handleOnclick, tableDataTextColor, withCheckbox, onSelectClick, draggable, isRowCheckBoxDisable, isRowDisabled, freezeColumns, updateRowHeight, }: any) => import("react/jsx-runtime").JSX.Element>;
|
|
2
|
+
export default SortableRow;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, memo } from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import Typography from '../../Typography';
|
|
5
|
+
import Icon from '../../Icon';
|
|
6
|
+
import Checkbox from '../../Checkbox';
|
|
7
|
+
import { prepareData } from '../../../utils/TableCell/TableCell';
|
|
8
|
+
import { getColumnLeftPosition } from '../utils/virtualization';
|
|
9
|
+
// OPTIMIZATION: Memoize to prevent re-rendering when parent Table updates
|
|
10
|
+
const SortableRow = memo(({ row, index, serialNumber, columns, tableBodyRowClass, handleOnclick, tableDataTextColor, withCheckbox, onSelectClick, draggable, isRowCheckBoxDisable, isRowDisabled, freezeColumns, updateRowHeight, }) => {
|
|
11
|
+
const rowRef = useRef(null);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
const element = rowRef.current;
|
|
14
|
+
if (!element || !updateRowHeight)
|
|
15
|
+
return;
|
|
16
|
+
// OPTIMIZATION: ResizeObserver
|
|
17
|
+
// We do NOT call getBoundingClientRect() here anymore.
|
|
18
|
+
// Calling it manually forces the browser to calculate layout immediately (Reflow).
|
|
19
|
+
// The observer will deliver the height asynchronously without freezing the thread.
|
|
20
|
+
const observer = new ResizeObserver((entries) => {
|
|
21
|
+
for (const entry of entries) {
|
|
22
|
+
// Use borderBoxSize (modern) or fallback to contentRect
|
|
23
|
+
// These properties are "Read-Only" from the previous frame and do not trigger Reflow.
|
|
24
|
+
const height = entry.borderBoxSize?.[0]?.blockSize ?? entry.contentRect.height;
|
|
25
|
+
if (height > 0) {
|
|
26
|
+
updateRowHeight(index, height);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
observer.observe(element);
|
|
31
|
+
return () => {
|
|
32
|
+
observer.disconnect();
|
|
33
|
+
};
|
|
34
|
+
}, [index, updateRowHeight]);
|
|
35
|
+
const key = row._id || row.id;
|
|
36
|
+
return (_jsx("tr", { ref: rowRef, className: classNames('ff-table-data-row ', tableBodyRowClass, {
|
|
37
|
+
'ff-table-disabled': row.disabled && isRowDisabled,
|
|
38
|
+
}), id: key, children: columns.map((column, columnIndex) => {
|
|
39
|
+
const isFrozen = freezeColumns && columnIndex < freezeColumns;
|
|
40
|
+
return (_jsx("td", { onClick: () => handleOnclick(column, row), style: {
|
|
41
|
+
position: isFrozen ? 'sticky' : 'static',
|
|
42
|
+
left: isFrozen
|
|
43
|
+
? getColumnLeftPosition(columnIndex, columns, freezeColumns)
|
|
44
|
+
: 'auto',
|
|
45
|
+
zIndex: isFrozen ? 99 : 'auto',
|
|
46
|
+
backgroundColor: isFrozen
|
|
47
|
+
? 'var(--input-label-bg-color)'
|
|
48
|
+
: 'transparent',
|
|
49
|
+
width: column.width ? `${column.width}px` : 'auto',
|
|
50
|
+
padding: '7px 8px',
|
|
51
|
+
boxSizing: 'border-box',
|
|
52
|
+
paddingRight: isFrozen ? 0 : '8px',
|
|
53
|
+
}, className: classNames('ff-table-data-cell ff-table-icon-container', column.className, {
|
|
54
|
+
'ff-table-clickable-cell': column.onClick,
|
|
55
|
+
'ff-table-sticky-column': isFrozen,
|
|
56
|
+
}), children: _jsxs(Typography, { as: "div", color: tableDataTextColor, className: "ff-table-data-container", children: [columnIndex === 0 && withCheckbox && (_jsx("span", { className: "ff-table-checkbox-table", children: _jsx(Checkbox, { onChange: (e) => onSelectClick(e, row), checked: row.checked, disabled: isRowCheckBoxDisable === undefined
|
|
57
|
+
? !!row.disabled
|
|
58
|
+
: isRowCheckBoxDisable }) })), columnIndex === 0 && draggable && (_jsxs(_Fragment, { children: [_jsx("span", { className: row.disabled ? 'ff-table-drag' : 'ff-table-drag-icon', children: _jsx(Icon, { name: "drag", className: "ff-table-drag-active" }) }), _jsx(Typography, { color: "var(--brand-color)", children: serialNumber && `${serialNumber}.` })] })), prepareData(row, column)] }) }, column.accessor + columnIndex));
|
|
59
|
+
}) }, key));
|
|
60
|
+
},
|
|
61
|
+
// OPTIMIZATION: Custom Memo Comparison
|
|
62
|
+
// Returns true if props are equal (prevents re-render)
|
|
63
|
+
(prev, next) => {
|
|
64
|
+
return (prev.row === next.row &&
|
|
65
|
+
prev.index === next.index &&
|
|
66
|
+
prev.serialNumber === next.serialNumber &&
|
|
67
|
+
prev.updateRowHeight === next.updateRowHeight &&
|
|
68
|
+
prev.columns === next.columns);
|
|
69
|
+
});
|
|
70
|
+
export default SortableRow;
|
|
71
|
+
//# sourceMappingURL=SortableRow.js.map
|