publ-echo-test 0.0.11 → 0.0.12
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.
@@ -171,7 +171,7 @@ var GridItem = function (_a) {
|
|
171
171
|
];
|
172
172
|
return (_jsx(Resizable, { draggableOpts: {
|
173
173
|
disabled: !isResizable,
|
174
|
-
}, className: isResizable ? undefined : "react-resizable-hide", width: position.width, height: position.height, top: position.top, left: position.left,
|
174
|
+
}, className: isResizable ? undefined : "react-resizable-hide", width: position.width, height: position.height, top: position.top, left: position.left, resizeHandles: props.resizeHandles, onResizeStop: onResizeStop, onResizeStart: onResizeStart, onResize: onResize, minConstraints: minConstraints, maxConstraints: maxConstraints, transformScale: transformScale, handle: resizeHandle, isResizing: isResizing, children: child }));
|
175
175
|
};
|
176
176
|
/**
|
177
177
|
* onDragStart event handler
|
@@ -304,6 +304,7 @@ var GridItem = function (_a) {
|
|
304
304
|
* @param {Object} callbackData an object with node and size information
|
305
305
|
*/
|
306
306
|
var onResize = function (e, callbackData) {
|
307
|
+
console.log('setting resizing true');
|
307
308
|
setIsResizing(true);
|
308
309
|
onResizeHandler(e, callbackData, "onResize");
|
309
310
|
};
|
@@ -327,6 +328,7 @@ var GridItem = function (_a) {
|
|
327
328
|
var onResizeHandler = function (e, _a, handlerName) {
|
328
329
|
var node = _a.node, size = _a.size, handle = _a.handle;
|
329
330
|
var handler = props[handlerName];
|
331
|
+
console.log(handlerName);
|
330
332
|
if (!handler)
|
331
333
|
return;
|
332
334
|
var prevW = props.w, prevH = props.h;
|
@@ -55,6 +55,7 @@ var Resizable = function (_a) {
|
|
55
55
|
var extendedHeightRef = useRef(null);
|
56
56
|
useEffect(function () {
|
57
57
|
if (!isResizing) {
|
58
|
+
extendedHeightRef.current = null;
|
58
59
|
return;
|
59
60
|
}
|
60
61
|
if (!elementRef.current) {
|
@@ -203,6 +204,7 @@ var Resizable = function (_a) {
|
|
203
204
|
}
|
204
205
|
if (extendedHeightRef.current) {
|
205
206
|
height = extendedHeightRef.current;
|
207
|
+
handleAxis = removeNorthHandle(handleAxis);
|
206
208
|
}
|
207
209
|
_b = checkConstraints(width, height), width = _b[0], height = _b[1];
|
208
210
|
_c = checkTopLeft(deltaX, deltaY, top, left, width, height, handleAxis), top = _c[0], left = _c[1];
|
@@ -242,4 +244,14 @@ var Resizable = function (_a) {
|
|
242
244
|
return (_createElement(DraggableCore, __assign({}, draggableOpts, { nodeRef: ref, key: "resizableHandle-".concat(handleAxis), onStop: resizeHandler("onResizeStop", handleAxis), onStart: resizeHandler("onResizeStart", handleAxis), onDrag: resizeHandler("onResize", handleAxis) }), renderResizeHandle(handleAxis, ref)));
|
243
245
|
}), true) }));
|
244
246
|
};
|
247
|
+
function removeNorthHandle(axis) {
|
248
|
+
switch (axis) {
|
249
|
+
case 'ne':
|
250
|
+
return 'e';
|
251
|
+
case 'nw':
|
252
|
+
return 'w';
|
253
|
+
default:
|
254
|
+
return axis;
|
255
|
+
}
|
256
|
+
}
|
245
257
|
export default Resizable;
|