publ-echo-test 0.0.53 → 0.0.55
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.
@@ -198,7 +198,7 @@ var GridItem = function (_a) {
|
|
198
198
|
];
|
199
199
|
return (_jsx(Resizable, { draggableOpts: {
|
200
200
|
disabled: !isResizable,
|
201
|
-
}, 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, autoResize: autoResize, children: child }));
|
201
|
+
}, 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, autoResize: autoResize, colWidth: colWidth, margin: props.margin, children: child }));
|
202
202
|
};
|
203
203
|
/**
|
204
204
|
* onDragStart event handler
|
@@ -2,5 +2,5 @@ import React from "react";
|
|
2
2
|
import { PropsWithChildren } from "../Draggable/types";
|
3
3
|
import { ResizableProps } from "./types";
|
4
4
|
type Props = ResizableProps;
|
5
|
-
declare const Resizable: ({ children, axis, handleSize, lockAspectRatio, minConstraints, maxConstraints, resizeHandles, transformScale, isResizing, autoResize, ...props }: PropsWithChildren<Props>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
5
|
+
declare const Resizable: ({ children, axis, handleSize, lockAspectRatio, minConstraints, maxConstraints, resizeHandles, transformScale, isResizing, autoResize, colWidth, margin, ...props }: PropsWithChildren<Props>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
6
6
|
export default Resizable;
|
@@ -35,7 +35,7 @@ import React, { useEffect, useRef } from "react";
|
|
35
35
|
import DraggableCore from "../Draggable/DraggableCore";
|
36
36
|
import { cloneElement } from "./utils/cloneElement";
|
37
37
|
var Resizable = function (_a) {
|
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, props = __rest(_a, ["children", "axis", "handleSize", "lockAspectRatio", "minConstraints", "maxConstraints", "resizeHandles", "transformScale", "isResizing", "autoResize"]);
|
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({
|
40
40
|
s: useRef(null),
|
41
41
|
n: useRef(null),
|
@@ -137,6 +137,9 @@ var Resizable = function (_a) {
|
|
137
137
|
height = Math.min(maxConstraints[1], height);
|
138
138
|
}
|
139
139
|
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);
|
140
143
|
return [width, height];
|
141
144
|
};
|
142
145
|
var checkTopLeft = function (deltaX, deltaY, top, left, width, height, handleAxis) {
|
@@ -234,7 +237,7 @@ var Resizable = function (_a) {
|
|
234
237
|
left = left - deltaX;
|
235
238
|
}
|
236
239
|
_b = checkConstraints(width, height), width = _b[0], height = _b[1];
|
237
|
-
if (autoResize &&
|
240
|
+
if (autoResize && minHeight.current === height) {
|
238
241
|
handleAxis = removeNorthHandle(handleAxis);
|
239
242
|
}
|
240
243
|
_c = checkTopLeft(deltaX, deltaY, top, left, width, height, handleAxis), top = _c[0], left = _c[1];
|
@@ -63,5 +63,7 @@ export type ResizableProps = {
|
|
63
63
|
height: number;
|
64
64
|
isResizing?: boolean;
|
65
65
|
autoResize?: boolean;
|
66
|
+
colWidth?: number;
|
67
|
+
margin?: [number, number];
|
66
68
|
};
|
67
69
|
export type ResizeHandleType = ReactElement<any> | ((resizeHandleAxis: ResizeHandleAxis, ref: Ref<HTMLElement>) => ReactElement<any>);
|