es-grid-template 1.7.36 → 1.7.37
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.
|
@@ -664,24 +664,19 @@ const TableContainerEdit = props => {
|
|
|
664
664
|
columnVirtualizer.measure();
|
|
665
665
|
});
|
|
666
666
|
}, [columnSizingState, columnVirtualizer]);
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
//
|
|
680
|
-
// return acc;
|
|
681
|
-
// }, {} as Record<string, number>)
|
|
682
|
-
// );
|
|
683
|
-
// }
|
|
684
|
-
// }, [table.getTotalSize(), windowSize.innerWidth])
|
|
667
|
+
React.useEffect(() => {
|
|
668
|
+
if (!containerRef.current) return;
|
|
669
|
+
const containerWidth = containerRef.current.offsetWidth - 1;
|
|
670
|
+
const totalWidth = table.getTotalSize();
|
|
671
|
+
if (totalWidth && totalWidth < containerWidth) {
|
|
672
|
+
const factor = containerWidth / totalWidth;
|
|
673
|
+
table.setColumnSizing(table.getAllLeafColumns().reduce((acc, col) => {
|
|
674
|
+
acc[col.id] = (col.getSize() || col.columnDef.size || 150) * factor;
|
|
675
|
+
return acc;
|
|
676
|
+
}, {}));
|
|
677
|
+
}
|
|
678
|
+
}, [table.getTotalSize(), windowSize.innerWidth, table.getState().columnSizing]);
|
|
679
|
+
// }, [table.getState().columnSizing, table.getTotalSize(), containerRef])
|
|
685
680
|
|
|
686
681
|
React.useEffect(() => {
|
|
687
682
|
const totalHeight = minHeight ?? height;
|
|
@@ -65,7 +65,7 @@ const Grid = props => {
|
|
|
65
65
|
const [grouping, setGrouping] = React.useState([]);
|
|
66
66
|
const [columnSizing, setColumnSizing] = React.useState({});
|
|
67
67
|
const [manualUpdate, setManualUpdate] = React.useState(false);
|
|
68
|
-
// const [
|
|
68
|
+
// const [manualResize, setManualResize] = React.useState(false)
|
|
69
69
|
|
|
70
70
|
const [columnFilters, setColumnFilters] = React.useState([]);
|
|
71
71
|
const [operator, setOperator] = React.useState([]);
|
|
@@ -671,24 +671,19 @@ const TableContainerEdit = props => {
|
|
|
671
671
|
columnVirtualizer.measure();
|
|
672
672
|
});
|
|
673
673
|
}, [columnSizingState, columnVirtualizer]);
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
//
|
|
687
|
-
// return acc;
|
|
688
|
-
// }, {} as Record<string, number>)
|
|
689
|
-
// );
|
|
690
|
-
// }
|
|
691
|
-
// }, [table.getTotalSize(), windowSize.innerWidth])
|
|
674
|
+
_react.default.useEffect(() => {
|
|
675
|
+
if (!containerRef.current) return;
|
|
676
|
+
const containerWidth = containerRef.current.offsetWidth - 1;
|
|
677
|
+
const totalWidth = table.getTotalSize();
|
|
678
|
+
if (totalWidth && totalWidth < containerWidth) {
|
|
679
|
+
const factor = containerWidth / totalWidth;
|
|
680
|
+
table.setColumnSizing(table.getAllLeafColumns().reduce((acc, col) => {
|
|
681
|
+
acc[col.id] = (col.getSize() || col.columnDef.size || 150) * factor;
|
|
682
|
+
return acc;
|
|
683
|
+
}, {}));
|
|
684
|
+
}
|
|
685
|
+
}, [table.getTotalSize(), windowSize.innerWidth, table.getState().columnSizing]);
|
|
686
|
+
// }, [table.getState().columnSizing, table.getTotalSize(), containerRef])
|
|
692
687
|
|
|
693
688
|
_react.default.useEffect(() => {
|
|
694
689
|
const totalHeight = minHeight ?? height;
|
|
@@ -67,7 +67,7 @@ const Grid = props => {
|
|
|
67
67
|
const [grouping, setGrouping] = _react.default.useState([]);
|
|
68
68
|
const [columnSizing, setColumnSizing] = _react.default.useState({});
|
|
69
69
|
const [manualUpdate, setManualUpdate] = _react.default.useState(false);
|
|
70
|
-
// const [
|
|
70
|
+
// const [manualResize, setManualResize] = React.useState(false)
|
|
71
71
|
|
|
72
72
|
const [columnFilters, setColumnFilters] = _react.default.useState([]);
|
|
73
73
|
const [operator, setOperator] = _react.default.useState([]);
|