publ-echo-test 0.0.48 → 0.0.50
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,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,12 +75,16 @@ 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;
|
80
85
|
}
|
81
86
|
else {
|
82
|
-
|
87
|
+
extendedHeightRef.current = null;
|
83
88
|
}
|
84
89
|
if (shouldShrinkRef.current && (target.clientHeight < elementRef.current.clientHeight)) {
|
85
90
|
extendedHeightRef.current = target.clientHeight;
|
@@ -206,6 +211,9 @@ var Resizable = function (_a) {
|
|
206
211
|
if (axisV === "n") {
|
207
212
|
deltaY = -deltaY;
|
208
213
|
}
|
214
|
+
if (shouldShrinkRef.current) {
|
215
|
+
deltaY = 0;
|
216
|
+
}
|
209
217
|
var width = props.width + (canDragX ? deltaX / transformScale : 0);
|
210
218
|
var height = props.height + (canDragY ? deltaY / transformScale : 0);
|
211
219
|
var left = (_h = props === null || props === void 0 ? void 0 : props.left) !== null && _h !== void 0 ? _h : 0;
|
@@ -218,6 +226,9 @@ var Resizable = function (_a) {
|
|
218
226
|
}
|
219
227
|
// width = Math.max(width, minWidth.current);
|
220
228
|
// const isOverMin = calcWH()
|
229
|
+
if (minHeight.current) {
|
230
|
+
height = Math.max(minHeight.current, height);
|
231
|
+
}
|
221
232
|
if (extendedHeightRef.current) {
|
222
233
|
height = extendedHeightRef.current;
|
223
234
|
handleAxis = removeNorthHandle(handleAxis);
|
@@ -228,7 +239,7 @@ var Resizable = function (_a) {
|
|
228
239
|
var cb = typeof props[handlerName] === "function" ? props[handlerName] : null;
|
229
240
|
var isCbSkipped = handlerName === "onResize" && !isDimensionsChanged;
|
230
241
|
if (cb && !isCbSkipped) {
|
231
|
-
cb(e, { node: node, size: { width: width, height: height, top: top, left: left }, handle: handleAxis, minWidth: minWidth.current, minHeight: (_k =
|
242
|
+
cb(e, { node: node, size: { width: width, height: height, top: top, left: left }, handle: handleAxis, minWidth: minWidth.current, minHeight: (_k = minHeight.current) !== null && _k !== void 0 ? _k : 0 });
|
232
243
|
}
|
233
244
|
if (handlerName === "onResizeStop") {
|
234
245
|
startPosition.current = null;
|