nntc-ui 0.0.62 → 0.0.63
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/index.js +5 -6
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -3308,14 +3308,13 @@ function VirtualTable(props) {
|
|
|
3308
3308
|
if (!rowNumberColumnId) {
|
|
3309
3309
|
return getColumns(columns);
|
|
3310
3310
|
}
|
|
3311
|
-
const buildRowsNumbersColumn = (template
|
|
3311
|
+
const buildRowsNumbersColumn = (template) => ({
|
|
3312
3312
|
id: rowNumberColumnId,
|
|
3313
|
-
...isRoot ? { width: 50 } : void 0,
|
|
3314
3313
|
...!template?.columns?.length ? { accessorKey: rowNumberColumnId } : void 0,
|
|
3315
3314
|
label: "#",
|
|
3316
|
-
columns: template?.columns?.map((child) => buildRowsNumbersColumn(child
|
|
3315
|
+
columns: template?.columns?.map((child) => buildRowsNumbersColumn(child))
|
|
3317
3316
|
});
|
|
3318
|
-
const nextColumns = [buildRowsNumbersColumn(columns[0]
|
|
3317
|
+
const nextColumns = [buildRowsNumbersColumn(columns[0]), ...columns];
|
|
3319
3318
|
const result = getColumns(nextColumns);
|
|
3320
3319
|
return result;
|
|
3321
3320
|
}, [columns, rowNumberColumnId]);
|
|
@@ -3347,8 +3346,8 @@ function VirtualTable(props) {
|
|
|
3347
3346
|
return result;
|
|
3348
3347
|
}, [rows, sortBy, filterBy, rowNumberColumnId]);
|
|
3349
3348
|
const columnsEstimateSize = useMemo8(
|
|
3350
|
-
() => cellWidth ?? ((index) => memoizedColumns[index]?.meta?.width ?? 200),
|
|
3351
|
-
[cellWidth, memoizedColumns]
|
|
3349
|
+
() => cellWidth ?? ((index) => rowNumberColumnId && index === 0 ? memoizedData.length.toString().length * 8 + 26 : memoizedColumns[index]?.meta?.width ?? 200),
|
|
3350
|
+
[cellWidth, memoizedColumns, memoizedData, rowNumberColumnId]
|
|
3352
3351
|
);
|
|
3353
3352
|
const table2 = useReactTable({
|
|
3354
3353
|
data: memoizedData,
|