sag_components 1.0.452 → 1.0.454
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.
|
@@ -64,16 +64,17 @@ const Table = props => {
|
|
|
64
64
|
item.checked = event.target.checked;
|
|
65
65
|
});
|
|
66
66
|
};
|
|
67
|
+
const m_pos = (0, _react.useRef)(null);
|
|
67
68
|
const handleMouseDown = (e, columnName) => {
|
|
68
|
-
m_pos = e.clientX;
|
|
69
|
+
m_pos.current = e.clientX;
|
|
69
70
|
setResizing(true);
|
|
70
71
|
setResizeColumn(columnName);
|
|
71
72
|
};
|
|
72
73
|
const handleMouseMove = e => {
|
|
73
74
|
if (resizing) {
|
|
74
75
|
const th = document.querySelector("th[data-column=\"".concat(resizeColumn, "\"]"));
|
|
75
|
-
const dx = e.clientX - m_pos;
|
|
76
|
-
m_pos = e.clientX;
|
|
76
|
+
const dx = e.clientX - m_pos.current;
|
|
77
|
+
m_pos.current = e.clientX;
|
|
77
78
|
th.style.width = "".concat(parseInt(getComputedStyle(th, '').width) + dx, "px");
|
|
78
79
|
}
|
|
79
80
|
};
|
|
@@ -118,8 +119,6 @@ const Table = props => {
|
|
|
118
119
|
document.removeEventListener('mouseup', handleMouseUp, false);
|
|
119
120
|
};
|
|
120
121
|
}, [resizing]);
|
|
121
|
-
let m_pos; // Declare m_pos here so it's accessible in handleMouseMove
|
|
122
|
-
|
|
123
122
|
const pages = Array.from({
|
|
124
123
|
length: rangePagination
|
|
125
124
|
}, (_, index) => index + 1);
|