publ-echo-test 0.0.33 → 0.0.34

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.
@@ -315,16 +315,6 @@ var GridItem = function (_a) {
315
315
  */
316
316
  var onResize = function (e, callbackData) {
317
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
- // );
328
318
  onResizeHandler(e, callbackData, "onResize");
329
319
  };
330
320
  /**
@@ -345,27 +335,31 @@ var GridItem = function (_a) {
345
335
  * @return {Function} Handler function.
346
336
  */
347
337
  var onResizeHandler = function (e, _a, handlerName) {
348
- var node = _a.node, size = _a.size, handle = _a.handle, minWidth = _a.minWidth;
338
+ var node = _a.node, size = _a.size, handle = _a.handle, minWidth = _a.minWidth, minHeight = _a.minHeight;
349
339
  var handler = props[handlerName];
350
340
  if (!handler)
351
341
  return;
352
342
  var prevW = props.w, prevH = props.h;
353
343
  // Get new XY
354
344
  var _b = calcWH(getPositionParams(), size, x, y, handle, prevW, prevH, false), w = _b.w, h = _b.h;
345
+ var tempMinH = minH;
355
346
  if (minWidth) {
356
- var minW_1 = calcWH(getPositionParams(), __assign(__assign({}, size), { width: minWidth }), x, y, handle, prevW, prevH, true).w;
347
+ var _c = calcWH(getPositionParams(), __assign(__assign({}, size), { width: minWidth, height: minHeight !== null && minHeight !== void 0 ? minHeight : 0 }), x, y, handle, prevW, prevH, true), minW_1 = _c.w, newMinH = _c.h;
357
348
  if (minW_1 > w) {
358
349
  w = minW_1;
359
350
  }
351
+ if (minH > 1) {
352
+ tempMinH = Math.max(1, newMinH);
353
+ }
360
354
  }
361
355
  // minW should be at least 1
362
356
  // minW = Math.max(minW, 1);
363
357
  // maxW should be at most (cols - x)
364
358
  // maxW = Math.min(maxW, cols - x);
365
359
  w = clamp(w, minW, maxW);
366
- h = clamp(h, minH, maxH);
360
+ h = clamp(h, tempMinH, maxH);
367
361
  setResizing(handlerName === "onResizeStop" ? undefined : size);
368
- var _c = getResizableXYPosition(handle, w, h, prevW, prevH), newX = _c.newX, newY = _c.newY;
362
+ var _d = getResizableXYPosition(handle, w, h, prevW, prevH), newX = _d.newX, newY = _d.newY;
369
363
  handler(i, w, h, { e: e, node: node, size: size }, newX, newY);
370
364
  };
371
365
  var pos = calcGridItemPosition(getPositionParams(), x, y, z, w, h, {
@@ -360,6 +360,7 @@ var ReactGridLayout = function (_a) {
360
360
  l.h = h;
361
361
  l.x = x;
362
362
  l.y = y;
363
+ l.minH = h;
363
364
  }
364
365
  return l;
365
366
  }), newLayout = _a[0], l = _a[1];
@@ -161,7 +161,7 @@ var Resizable = function (_a) {
161
161
  var resizeHandler = function (handlerName, handleAxis) {
162
162
  return function (e, _a) {
163
163
  var _b, _c;
164
- var _d, _e, _f, _g, _h, _j;
164
+ var _d, _e, _f, _g, _h, _j, _k;
165
165
  var node = _a.node, deltaX = _a.deltaX, deltaY = _a.deltaY;
166
166
  if (handlerName === "onResizeStart") {
167
167
  var position = { top: (_d = props.top) !== null && _d !== void 0 ? _d : 0, left: (_e = props.left) !== null && _e !== void 0 ? _e : 0 };
@@ -222,7 +222,7 @@ var Resizable = function (_a) {
222
222
  var cb = typeof props[handlerName] === "function" ? props[handlerName] : null;
223
223
  var isCbSkipped = handlerName === "onResize" && !isDimensionsChanged;
224
224
  if (cb && !isCbSkipped) {
225
- cb(e, { node: node, size: { width: width, height: height, top: top, left: left }, handle: handleAxis, minWidth: minWidth.current });
225
+ cb(e, { node: node, size: { width: width, height: height, top: top, left: left }, handle: handleAxis, minWidth: minWidth.current, minHeight: (_k = extendedHeightRef.current) !== null && _k !== void 0 ? _k : 0 });
226
226
  }
227
227
  if (handlerName === "onResizeStop") {
228
228
  startPosition.current = null;
@@ -30,6 +30,7 @@ export type ResizeCallbackData = {
30
30
  };
31
31
  handle: ResizeHandleAxis;
32
32
  minWidth?: number;
33
+ minHeight?: number;
33
34
  };
34
35
  export type ResizableDefaultProps = {
35
36
  axis: Axis;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "publ-echo-test",
3
- "version": "0.0.33",
3
+ "version": "0.0.34",
4
4
  "private": false,
5
5
  "main": "dist/lib/index.js",
6
6
  "types": "dist/lib/index.d.js",