@gpa-gemstone/react-table 1.2.32 → 1.2.33
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.
|
@@ -80,7 +80,7 @@ function AdjColumnHeaderWrapper(props) {
|
|
|
80
80
|
props.startAdjustment(e);
|
|
81
81
|
console.log('onCLick border div');
|
|
82
82
|
}, [props.startAdjustment]);
|
|
83
|
-
return React.createElement("th", { ref: thref, style: style, onClick: onClick },
|
|
83
|
+
return React.createElement("th", { ref: thref, style: style, onClick: onClick, onDrag: function (e) { e.stopPropagation(); } },
|
|
84
84
|
React.createElement("div", { style: {
|
|
85
85
|
width: 5,
|
|
86
86
|
height: '100%',
|
|
@@ -185,7 +185,7 @@ function Header(props) {
|
|
|
185
185
|
var _a = React.useState(undefined), adjKeys = _a[0], setAdjKeys = _a[1];
|
|
186
186
|
var _b = React.useState(0), mouseDown = _b[0], setMouseDown = _b[1];
|
|
187
187
|
var _c = React.useState(0), deltaX = _c[0], setDeltaX = _c[1];
|
|
188
|
-
var finishAdjustment =
|
|
188
|
+
var finishAdjustment = function (e) {
|
|
189
189
|
var _a, _b;
|
|
190
190
|
var d = deltaX;
|
|
191
191
|
if (adjKeys === undefined)
|
|
@@ -193,12 +193,14 @@ function Header(props) {
|
|
|
193
193
|
var w = limitMovement(adjKeys[0], adjKeys[1], d);
|
|
194
194
|
var leftWidth = (_a = props.GetWidth(adjKeys[0], 'adjustable')) !== null && _a !== void 0 ? _a : 100;
|
|
195
195
|
var rightWidth = (_b = props.GetWidth(adjKeys[1], 'adjustable')) !== null && _b !== void 0 ? _b : 100;
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
if (Math.abs(w) > 5) {
|
|
197
|
+
props.SetWidth(adjKeys[0], (leftWidth - w), 'adjustable');
|
|
198
|
+
props.SetWidth(adjKeys[1], (rightWidth + w), 'adjustable');
|
|
199
|
+
}
|
|
198
200
|
setMouseDown(0);
|
|
199
201
|
setAdjKeys(undefined);
|
|
200
202
|
setDeltaX(0);
|
|
201
|
-
}
|
|
203
|
+
};
|
|
202
204
|
var onMove = React.useCallback(function (e) {
|
|
203
205
|
if (adjKeys === undefined)
|
|
204
206
|
return;
|
|
@@ -215,7 +217,7 @@ function Header(props) {
|
|
|
215
217
|
w = (leftWidth !== null && leftWidth !== void 0 ? leftWidth : 100) - leftMin;
|
|
216
218
|
}
|
|
217
219
|
if ((rightWidth !== null && rightWidth !== void 0 ? rightWidth : 100) + w < rightMin) {
|
|
218
|
-
w = (rightWidth !== null && rightWidth !== void 0 ? rightWidth : 100) - rightMin;
|
|
220
|
+
w = -(rightWidth !== null && rightWidth !== void 0 ? rightWidth : 100) - rightMin;
|
|
219
221
|
}
|
|
220
222
|
return w;
|
|
221
223
|
}
|
|
@@ -228,6 +230,7 @@ function Header(props) {
|
|
|
228
230
|
return w - deltaX;
|
|
229
231
|
if (key === adjKeys[1])
|
|
230
232
|
return w + deltaX;
|
|
233
|
+
return w;
|
|
231
234
|
};
|
|
232
235
|
return (React.createElement("thead", { className: props.Class, style: props.Style, onMouseMove: function (e) { onMove(e.nativeEvent); e.stopPropagation(); }, onMouseUp: function (e) { finishAdjustment(e.nativeEvent); e.stopPropagation(); }, onMouseLeave: function (e) { finishAdjustment(e.nativeEvent); e.stopPropagation(); } },
|
|
233
236
|
React.createElement("tr", { ref: trRef },
|
|
@@ -73,7 +73,7 @@ function ColumnHeaderWrapper(props) {
|
|
|
73
73
|
var onClick = React.useCallback(function (e) {
|
|
74
74
|
props.onSort(props.Key, e, props.Field);
|
|
75
75
|
}, [props.onSort]);
|
|
76
|
-
return React.createElement("th", { ref: thref, style: style, onClick: onClick },
|
|
76
|
+
return React.createElement("th", { ref: thref, style: style, onClick: onClick, onDrag: function (e) { e.stopPropagation(); } },
|
|
77
77
|
props.sorted && props.asc ? React.createElement("div", { style: { position: 'absolute', width: 25 } }, gpa_symbols_1.SVGIcons.ArrowDropDown) : null,
|
|
78
78
|
props.sorted && !props.asc ? React.createElement("div", { style: { position: 'absolute', width: 25 } }, gpa_symbols_1.SVGIcons.ArrowDropUp) : null,
|
|
79
79
|
React.createElement("div", { style: {
|