publ-echo-test 0.0.52 → 0.0.53

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.
@@ -55,7 +55,7 @@ var Resizable = function (_a) {
55
55
  var extendedHeightRef = useRef(null);
56
56
  var shouldShrinkRef = useRef(false);
57
57
  var minWidth = useRef(0);
58
- var minHeight = useRef(props.height);
58
+ var minHeight = useRef(0);
59
59
  useEffect(function () {
60
60
  var _a;
61
61
  if (!autoResize) {
@@ -87,7 +87,7 @@ var Resizable = function (_a) {
87
87
  extendedHeightRef.current = null;
88
88
  }
89
89
  if (shouldShrinkRef.current && (target.clientHeight < elementRef.current.clientHeight)) {
90
- extendedHeightRef.current = target.clientHeight;
90
+ minHeight.current = target.clientHeight;
91
91
  }
92
92
  var minWidthStyle = target.computedStyleMap().get('min-width');
93
93
  if (typeof minWidthStyle.value === 'number') {
@@ -101,7 +101,7 @@ var Resizable = function (_a) {
101
101
  // NOTE - 최소 또는 최대 제약 조건 width와 height 계산, 비율 고정 계산
102
102
  var checkConstraints = function (width, height) {
103
103
  var _a;
104
- if (!maxConstraints && !lockAspectRatio) {
104
+ if (!minConstraints && !maxConstraints && !lockAspectRatio) {
105
105
  return [width, height];
106
106
  }
107
107
  if (lockAspectRatio) {
@@ -129,12 +129,14 @@ var Resizable = function (_a) {
129
129
  height = Math.max(minConstraints[1], height);
130
130
  }
131
131
  }
132
+ if (shouldShrinkRef.current) {
133
+ height = minHeight.current;
134
+ }
132
135
  if (maxConstraints) {
133
136
  width = Math.min(maxConstraints[0], width);
134
137
  height = Math.min(maxConstraints[1], height);
135
138
  }
136
139
  slack.current = [slackW + (oldW - width), slackH + (oldH - height)];
137
- // console.log([slackW, slackH]);
138
140
  return [width, height];
139
141
  };
140
142
  var checkTopLeft = function (deltaX, deltaY, top, left, width, height, handleAxis) {
@@ -231,13 +233,8 @@ var Resizable = function (_a) {
231
233
  if (axisH === "w") {
232
234
  left = left - deltaX;
233
235
  }
234
- // width = Math.max(width, minWidth.current);
235
- // const isOverMin = calcWH()
236
- // if (minHeight.current) {
237
- // height = Math.max(minHeight.current, height);
238
- // }
239
236
  _b = checkConstraints(width, height), width = _b[0], height = _b[1];
240
- if (extendedHeightRef.current === height) {
237
+ if (autoResize && extendedHeightRef.current === height) {
241
238
  handleAxis = removeNorthHandle(handleAxis);
242
239
  }
243
240
  _c = checkTopLeft(deltaX, deltaY, top, left, width, height, handleAxis), top = _c[0], left = _c[1];
@@ -245,7 +242,6 @@ var Resizable = function (_a) {
245
242
  var cb = typeof props[handlerName] === "function" ? props[handlerName] : null;
246
243
  var isCbSkipped = handlerName === "onResize" && !isDimensionsChanged;
247
244
  if (cb && !isCbSkipped) {
248
- // cb(e, { node, size: { width, height, top, left }, handle: handleAxis, minWidth: minWidth.current, minHeight: minHeight.current ?? 0 });
249
245
  cb(e, { node: node, size: { width: width, height: height, top: top, left: left }, handle: handleAxis });
250
246
  }
251
247
  if (handlerName === "onResizeStop") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "publ-echo-test",
3
- "version": "0.0.52",
3
+ "version": "0.0.53",
4
4
  "private": false,
5
5
  "main": "dist/lib/index.js",
6
6
  "types": "dist/lib/index.d.js",