publ-echo-test 0.0.55 → 0.0.58

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.
@@ -32,8 +32,8 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
32
32
  import { createElement as _createElement } from "react";
33
33
  import { jsx as _jsx } from "react/jsx-runtime";
34
34
  import React, { useEffect, useRef } from "react";
35
- import DraggableCore from "../Draggable/DraggableCore";
36
35
  import { cloneElement } from "./utils/cloneElement";
36
+ import { DraggableCore } from "../Draggable";
37
37
  var Resizable = function (_a) {
38
38
  var children = _a.children, _b = _a.axis, axis = _b === void 0 ? "both" : _b, _c = _a.handleSize, handleSize = _c === void 0 ? [20, 20] : _c, _d = _a.lockAspectRatio, lockAspectRatio = _d === void 0 ? false : _d, _e = _a.minConstraints, minConstraints = _e === void 0 ? [20, 20] : _e, _f = _a.maxConstraints, maxConstraints = _f === void 0 ? [Infinity, Infinity] : _f, _g = _a.resizeHandles, resizeHandles = _g === void 0 ? ["se"] : _g, _h = _a.transformScale, transformScale = _h === void 0 ? 1 : _h, isResizing = _a.isResizing, autoResize = _a.autoResize, colWidth = _a.colWidth, margin = _a.margin, props = __rest(_a, ["children", "axis", "handleSize", "lockAspectRatio", "minConstraints", "maxConstraints", "resizeHandles", "transformScale", "isResizing", "autoResize", "colWidth", "margin"]);
39
39
  var handleRefs = useRef({
@@ -90,8 +90,12 @@ var Resizable = function (_a) {
90
90
  minHeight.current = target.clientHeight;
91
91
  }
92
92
  var minWidthStyle = target.computedStyleMap().get('min-width');
93
- if (typeof minWidthStyle.value === 'number') {
94
- minWidth.current = minWidthStyle.value;
93
+ if (typeof minWidthStyle.value === 'number' && margin && colWidth) {
94
+ var minWidthBase = minWidthStyle.value;
95
+ var minColWidth = (minWidthBase + margin[0]) / (colWidth + margin[0]);
96
+ var minW = Math.ceil(minColWidth);
97
+ var minWidthPx = (minW * colWidth) + ((minW - 1) * margin[0]);
98
+ minWidth.current = Math.round(minWidthPx);
95
99
  }
96
100
  }, [isResizing, autoResize, children, elementRef]);
97
101
  var resetData = function () {
@@ -115,6 +119,8 @@ var Resizable = function (_a) {
115
119
  width = height * ratio;
116
120
  }
117
121
  }
122
+ console.log('w: ', width);
123
+ console.log('minW: ', minWidth.current);
118
124
  var _b = [width, height], oldW = _b[0], oldH = _b[1];
119
125
  var _c = (_a = slack.current) !== null && _a !== void 0 ? _a : [0, 0], slackW = _c[0], slackH = _c[1];
120
126
  width += slackW;
@@ -137,9 +143,6 @@ var Resizable = function (_a) {
137
143
  height = Math.min(maxConstraints[1], height);
138
144
  }
139
145
  slack.current = [slackW + (oldW - width), slackH + (oldH - height)];
140
- console.log([slackW, slackH]);
141
- console.log('width: ', width);
142
- console.log('min-width: ', minWidth.current);
143
146
  return [width, height];
144
147
  };
145
148
  var checkTopLeft = function (deltaX, deltaY, top, left, width, height, handleAxis) {
@@ -226,6 +229,7 @@ var Resizable = function (_a) {
226
229
  if (axisV === "n") {
227
230
  deltaY = -deltaY;
228
231
  }
232
+ console.log(deltaX);
229
233
  var width = props.width + (canDragX ? deltaX / transformScale : 0);
230
234
  var height = props.height + (canDragY ? deltaY / transformScale : 0);
231
235
  var left = (_h = props === null || props === void 0 ? void 0 : props.left) !== null && _h !== void 0 ? _h : 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "publ-echo-test",
3
- "version": "0.0.55",
3
+ "version": "0.0.58",
4
4
  "private": false,
5
5
  "main": "dist/lib/index.js",
6
6
  "types": "dist/lib/index.d.js",