publ-echo-test 0.0.31 → 0.0.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.
@@ -52,11 +52,8 @@ var GridItem = function (_a) {
|
|
52
52
|
for (var _i = 0, mutationsList_1 = mutationsList; _i < mutationsList_1.length; _i++) {
|
53
53
|
var mutation = mutationsList_1[_i];
|
54
54
|
var isCharacterChanged = mutation.type === 'characterData';
|
55
|
-
var keepWidth =
|
55
|
+
var keepWidth = true;
|
56
56
|
var height = isCharacterChanged ? mutation.target.parentNode.clientHeight : mutation.target.clientHeight;
|
57
|
-
console.log('mutation.target.clientWidth', mutation.target.clientWidth);
|
58
|
-
console.log('mutation.target.parentNode.clientWidth', mutation.target.parentNode.clientWidth);
|
59
|
-
console.log('targetNode.clientWidth', targetNode.clientWidth);
|
60
57
|
var width = targetNode.clientWidth;
|
61
58
|
if (!isCharacterChanged && mutation.target instanceof Element) {
|
62
59
|
var styles = getComputedStyle(mutation.target);
|
@@ -318,6 +315,16 @@ var GridItem = function (_a) {
|
|
318
315
|
*/
|
319
316
|
var onResize = function (e, callbackData) {
|
320
317
|
setIsResizing(true);
|
318
|
+
// let { w, h } = calcWH(
|
319
|
+
// getPositionParams(),
|
320
|
+
// callbackData.size,
|
321
|
+
// x,
|
322
|
+
// y,
|
323
|
+
// callbackData.handle,
|
324
|
+
// undefined,
|
325
|
+
// undefined,
|
326
|
+
// callbackData.isOverMin
|
327
|
+
// );
|
321
328
|
onResizeHandler(e, callbackData, "onResize");
|
322
329
|
};
|
323
330
|
/**
|
@@ -338,13 +345,19 @@ var GridItem = function (_a) {
|
|
338
345
|
* @return {Function} Handler function.
|
339
346
|
*/
|
340
347
|
var onResizeHandler = function (e, _a, handlerName) {
|
341
|
-
var node = _a.node, size = _a.size, handle = _a.handle;
|
348
|
+
var node = _a.node, size = _a.size, handle = _a.handle, minWidth = _a.minWidth;
|
342
349
|
var handler = props[handlerName];
|
343
350
|
if (!handler)
|
344
351
|
return;
|
345
352
|
var prevW = props.w, prevH = props.h;
|
346
353
|
// Get new XY
|
347
|
-
var _b = calcWH(getPositionParams(), size, x, y, handle, prevW, prevH), w = _b.w, h = _b.h;
|
354
|
+
var _b = calcWH(getPositionParams(), size, x, y, handle, prevW, prevH, false), w = _b.w, h = _b.h;
|
355
|
+
if (minWidth) {
|
356
|
+
var minW_1 = calcWH(getPositionParams(), __assign(__assign({}, size), { width: minWidth }), x, y, handle, prevW, prevH, true).w;
|
357
|
+
if (minW_1 > w) {
|
358
|
+
w = minW_1;
|
359
|
+
}
|
360
|
+
}
|
348
361
|
// minW should be at least 1
|
349
362
|
// minW = Math.max(minW, 1);
|
350
363
|
// maxW should be at most (cols - x)
|
@@ -210,7 +210,8 @@ var Resizable = function (_a) {
|
|
210
210
|
if (axisH === "w") {
|
211
211
|
left = left - deltaX;
|
212
212
|
}
|
213
|
-
width =
|
213
|
+
// width = Math.max(width, minWidth.current);
|
214
|
+
// const isOverMin = calcWH()
|
214
215
|
if (extendedHeightRef.current) {
|
215
216
|
height = extendedHeightRef.current;
|
216
217
|
handleAxis = removeNorthHandle(handleAxis);
|
@@ -221,7 +222,7 @@ var Resizable = function (_a) {
|
|
221
222
|
var cb = typeof props[handlerName] === "function" ? props[handlerName] : null;
|
222
223
|
var isCbSkipped = handlerName === "onResize" && !isDimensionsChanged;
|
223
224
|
if (cb && !isCbSkipped) {
|
224
|
-
cb(e, { node: node, size: { width: width, height: height, top: top, left: left }, handle: handleAxis });
|
225
|
+
cb(e, { node: node, size: { width: width, height: height, top: top, left: left }, handle: handleAxis, minWidth: minWidth.current });
|
225
226
|
}
|
226
227
|
if (handlerName === "onResizeStop") {
|
227
228
|
startPosition.current = null;
|