trotl-table 1.0.102 → 1.0.103
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 +2 -2
- package/dist/Table.cjs.js +9 -2
- package/dist/Table.cjs.js.map +1 -1
- package/dist/Table.esm.js +10 -3
- package/dist/Table.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/Table.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default, { cloneElement, useRef,
|
|
2
|
+
import React__default, { cloneElement, useRef, useEffect, useState, useMemo, useCallback } from 'react';
|
|
3
3
|
import { DndProvider, useDrop, useDrag } from 'react-dnd';
|
|
4
4
|
import { HTML5Backend } from 'react-dnd-html5-backend';
|
|
5
5
|
import Modal from './Modal.esm.js';
|
|
@@ -9700,8 +9700,8 @@ function TableInner({
|
|
|
9700
9700
|
routePath = null,
|
|
9701
9701
|
extraSearchTerm = "",
|
|
9702
9702
|
styles,
|
|
9703
|
-
rowHeight =
|
|
9704
|
-
groupHeaderHeight =
|
|
9703
|
+
rowHeight: requestedRowHeight = 34,
|
|
9704
|
+
groupHeaderHeight: requestedGroupHeaderHeight = 36,
|
|
9705
9705
|
showKey = false,
|
|
9706
9706
|
keyWidth = null,
|
|
9707
9707
|
selectedRowsCallback = () => {},
|
|
@@ -9741,6 +9741,12 @@ function TableInner({
|
|
|
9741
9741
|
t
|
|
9742
9742
|
}) {
|
|
9743
9743
|
const isProfessional = styles === "professional";
|
|
9744
|
+
const rowHeight = isProfessional ? 30 : requestedRowHeight;
|
|
9745
|
+
const groupHeaderHeight = isProfessional ? 32 : requestedGroupHeaderHeight;
|
|
9746
|
+
const virtualizedListRef = useRef(null);
|
|
9747
|
+
useEffect(() => {
|
|
9748
|
+
virtualizedListRef.current?.recomputeRowHeights();
|
|
9749
|
+
}, [rowHeight, groupHeaderHeight]);
|
|
9744
9750
|
let translate;
|
|
9745
9751
|
if (t) {
|
|
9746
9752
|
translate = t;
|
|
@@ -11541,6 +11547,7 @@ function TableInner({
|
|
|
11541
11547
|
height,
|
|
11542
11548
|
width
|
|
11543
11549
|
}) => /*#__PURE__*/React__default.createElement(List, {
|
|
11550
|
+
ref: virtualizedListRef,
|
|
11544
11551
|
width: width,
|
|
11545
11552
|
height: height,
|
|
11546
11553
|
rowCount: tableDataFlat.length,
|