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/README.md
CHANGED
|
@@ -125,8 +125,8 @@ export default function Demo() {
|
|
|
125
125
|
- `isGrouped`: enable grouped mode (true/false)
|
|
126
126
|
- `groupKey`: key to group rows by
|
|
127
127
|
- `extraSearchTerm`: string to filter + highlight rows
|
|
128
|
-
- `rowHeight`: row height in px (default `34
|
|
129
|
-
- `groupHeaderHeight`: group header height in px (default `36
|
|
128
|
+
- `rowHeight`: row height in px (default `34`). Ignored with `styles="professional"`, which always uses `30px` rows.
|
|
129
|
+
- `groupHeaderHeight`: group header height in px (default `36`). Ignored with `styles="professional"`, which always uses `32px` group headers.
|
|
130
130
|
- `mobileColumnCount`: number of data columns shown at viewport widths of 768px or less (1 or 2; default `2`). The full row details are shown in a modal when a mobile row is clicked.
|
|
131
131
|
- `mobileRowClick`: optional callback `(row) => {}` invoked instead of opening the built-in details modal when a mobile row is clicked. Clicks on row controls and action buttons keep their existing behavior.
|
|
132
132
|
- On mobile, when `enableMouseRightClick` actions are provided, double-tapping a row opens the same context menu as a right click (a single tap then opens details after a short ~280ms delay).
|
package/dist/Table.cjs.js
CHANGED
|
@@ -9722,8 +9722,8 @@ function TableInner({
|
|
|
9722
9722
|
routePath = null,
|
|
9723
9723
|
extraSearchTerm = "",
|
|
9724
9724
|
styles,
|
|
9725
|
-
rowHeight =
|
|
9726
|
-
groupHeaderHeight =
|
|
9725
|
+
rowHeight: requestedRowHeight = 34,
|
|
9726
|
+
groupHeaderHeight: requestedGroupHeaderHeight = 36,
|
|
9727
9727
|
showKey = false,
|
|
9728
9728
|
keyWidth = null,
|
|
9729
9729
|
selectedRowsCallback = () => {},
|
|
@@ -9763,6 +9763,12 @@ function TableInner({
|
|
|
9763
9763
|
t
|
|
9764
9764
|
}) {
|
|
9765
9765
|
const isProfessional = styles === "professional";
|
|
9766
|
+
const rowHeight = isProfessional ? 30 : requestedRowHeight;
|
|
9767
|
+
const groupHeaderHeight = isProfessional ? 32 : requestedGroupHeaderHeight;
|
|
9768
|
+
const virtualizedListRef = React.useRef(null);
|
|
9769
|
+
React.useEffect(() => {
|
|
9770
|
+
virtualizedListRef.current?.recomputeRowHeights();
|
|
9771
|
+
}, [rowHeight, groupHeaderHeight]);
|
|
9766
9772
|
let translate;
|
|
9767
9773
|
if (t) {
|
|
9768
9774
|
translate = t;
|
|
@@ -11563,6 +11569,7 @@ function TableInner({
|
|
|
11563
11569
|
height,
|
|
11564
11570
|
width
|
|
11565
11571
|
}) => /*#__PURE__*/React.createElement(List, {
|
|
11572
|
+
ref: virtualizedListRef,
|
|
11566
11573
|
width: width,
|
|
11567
11574
|
height: height,
|
|
11568
11575
|
rowCount: tableDataFlat.length,
|