publ-echo-test 0.0.32 → 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.
@@ -54,9 +54,6 @@ var GridItem = function (_a) {
54
54
  var isCharacterChanged = mutation.type === 'characterData';
55
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)
@@ -255,6 +255,7 @@ var ReactGridLayout = function (_a) {
255
255
  var l = getLayoutItem(layout, i);
256
256
  if (!l)
257
257
  return;
258
+ console.log(l);
258
259
  setOldResizeItem(cloneLayoutItem(l));
259
260
  setOldLayout(layout);
260
261
  props.onResizeStart &&
@@ -210,7 +210,8 @@ var Resizable = function (_a) {
210
210
  if (axisH === "w") {
211
211
  left = left - deltaX;
212
212
  }
213
- width = width > minWidth.current ? width : minWidth.current;
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;
@@ -29,6 +29,7 @@ export type ResizeCallbackData = {
29
29
  left: number;
30
30
  };
31
31
  handle: ResizeHandleAxis;
32
+ minWidth?: number;
32
33
  };
33
34
  export type ResizableDefaultProps = {
34
35
  axis: Axis;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "publ-echo-test",
3
- "version": "0.0.32",
3
+ "version": "0.0.33",
4
4
  "private": false,
5
5
  "main": "dist/lib/index.js",
6
6
  "types": "dist/lib/index.d.js",