publ-echo-test 0.0.47 → 0.0.49

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.
@@ -377,12 +377,6 @@ var GridItem = function (_a) {
377
377
  h = clamp(h, tempMinH, maxH);
378
378
  setResizing(handlerName === "onResizeStop" ? undefined : size);
379
379
  var _d = getResizableXYPosition(handle, w, h, prevW, prevH), newX = _d.newX, newY = _d.newY;
380
- // NOTE: test to fix
381
- if (handle === 'nw' || handle === 'ne' || handle === 'sw' || handle === 'se') {
382
- if (prevH === h) {
383
- newY = y;
384
- }
385
- }
386
380
  handler(i, w, h, { e: e, node: node, size: size }, newX, newY);
387
381
  };
388
382
  var pos = calcGridItemPosition(getPositionParams(), x, y, z, w, h, {
@@ -58,7 +58,7 @@ export function calcWH(positionParams, _a, x, y, handleAxis, prevW, prevH, shoul
58
58
  var colWidth = calcGridColWidth(positionParams);
59
59
  var rowHeightNumber = resolveRowHeight(rowHeight, colWidth);
60
60
  var roundOrCeil = shouldCeil ? Math.ceil : Math.round;
61
- var w = roundOrCeil((width + margin[0]) / (colWidth + margin[0]));
61
+ var w = roundOrCeil(truncateToOneDecimal((width + margin[0]) / (colWidth + margin[0])));
62
62
  var h = roundOrCeil(roundToOneDecimal((height + margin[1]) / (rowHeightNumber + margin[1])));
63
63
  // // Capping
64
64
  // w = clamp(w, 0, cols - x);
@@ -110,3 +110,6 @@ export function clamp(num, lowerBound, upperBound) {
110
110
  function roundToOneDecimal(num) {
111
111
  return Math.floor(num * 10) / 10;
112
112
  }
113
+ function truncateToOneDecimal(num) {
114
+ return Math.floor(num * 10) / 10;
115
+ }
@@ -55,6 +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
59
  useEffect(function () {
59
60
  var _a;
60
61
  if (!autoResize) {
@@ -74,6 +75,10 @@ var Resizable = function (_a) {
74
75
  return;
75
76
  }
76
77
  var target = (_a = placeholder.children[0].children[0].children[0]) !== null && _a !== void 0 ? _a : placeholder.children[0].children[0];
78
+ if (target.clientHeight) {
79
+ minHeight.current = target.clientHeight;
80
+ }
81
+ // target.clientHeight -> 실제 "노드"의 height. (gridItem아닌)
77
82
  if (target.clientHeight > elementRef.current.clientHeight) {
78
83
  extendedHeightRef.current = target.clientHeight;
79
84
  shouldShrinkRef.current = true;
@@ -218,6 +223,9 @@ var Resizable = function (_a) {
218
223
  }
219
224
  // width = Math.max(width, minWidth.current);
220
225
  // const isOverMin = calcWH()
226
+ if (minHeight.current) {
227
+ height = Math.max(minHeight.current, height);
228
+ }
221
229
  if (extendedHeightRef.current) {
222
230
  height = extendedHeightRef.current;
223
231
  handleAxis = removeNorthHandle(handleAxis);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "publ-echo-test",
3
- "version": "0.0.47",
3
+ "version": "0.0.49",
4
4
  "private": false,
5
5
  "main": "dist/lib/index.js",
6
6
  "types": "dist/lib/index.d.js",