publ-echo 0.0.64 → 0.0.65
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.
|
@@ -32,6 +32,7 @@ import { shouldAutoResize, shouldBlockResize } from "./utils/autoResizeUtils";
|
|
|
32
32
|
var GridItem = function (_a) {
|
|
33
33
|
var children = _a.children, props = __rest(_a, ["children"]);
|
|
34
34
|
var resizeHandle = props.resizeHandle, cols = props.cols, isDraggable = props.isDraggable, _b = props.transformScale, transformScale = _b === void 0 ? 1 : _b, isResizable = props.isResizable, useCSSTransforms = props.useCSSTransforms, className = props.className, _c = props.cancel, cancel = _c === void 0 ? "" : _c, _d = props.handle, handle = _d === void 0 ? "" : _d, x = props.x, y = props.y, z = props.z, w = props.w, h = props.h, _e = props.minH, minH = _e === void 0 ? 1 : _e, _f = props.minW, minW = _f === void 0 ? 1 : _f, _g = props.maxH, maxH = _g === void 0 ? Infinity : _g, _h = props.maxW, maxW = _h === void 0 ? Infinity : _h, i = props.i, _j = props.isHiddenVisibility, isHiddenVisibility = _j === void 0 ? false : _j, containerWidth = props.containerWidth, customColWidth = props.customColWidth, rowHeight = props.rowHeight;
|
|
35
|
+
var child = React.Children.only(children);
|
|
35
36
|
var shouldAutoShrink = useRef({ shouldAutoShrink: false, initialHeight: 0 });
|
|
36
37
|
var _k = useState(), resizing = _k[0], setResizing = _k[1];
|
|
37
38
|
var _l = useState(), dragging = _l[0], setDragging = _l[1];
|
|
@@ -44,9 +45,14 @@ var GridItem = function (_a) {
|
|
|
44
45
|
box: 'border-box',
|
|
45
46
|
}, [isDragging, isResizing]), _r = _q.width, width = _r === void 0 ? 0 : _r, _s = _q.height, height = _s === void 0 ? 0 : _s, _t = _q.clientHeight, clientHeight = _t === void 0 ? 0 : _t, _u = _q.scrollHeight, scrollHeight = _u === void 0 ? 0 : _u, textContentHeight = _q.contentHeight;
|
|
46
47
|
useEffect(function () {
|
|
48
|
+
var _a;
|
|
49
|
+
if (!((_a = child.props.className) === null || _a === void 0 ? void 0 : _a.includes('react-grid-item-selected'))) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
47
52
|
if (!elementRef.current || !props.onContentSizeChange) {
|
|
48
53
|
return;
|
|
49
54
|
}
|
|
55
|
+
console.log(elementRef.current);
|
|
50
56
|
var observer = new ResizeObserver(function (_a) {
|
|
51
57
|
var _b, _c, _d, _e;
|
|
52
58
|
var entry = _a[0];
|
|
@@ -65,8 +71,7 @@ var GridItem = function (_a) {
|
|
|
65
71
|
return function () {
|
|
66
72
|
observer.disconnect();
|
|
67
73
|
};
|
|
68
|
-
}, [scrollHeight, props]);
|
|
69
|
-
console.log(textContentHeight);
|
|
74
|
+
}, [scrollHeight, props.i, props.w, props.h, x, y, child.props.className]);
|
|
70
75
|
// const moveDroppingItem = (prevProps: GridItemProps) => {
|
|
71
76
|
// const { droppingPosition } = props;
|
|
72
77
|
// if (!droppingPosition) return;
|
|
@@ -157,8 +162,6 @@ var GridItem = function (_a) {
|
|
|
157
162
|
Math.min(maxes.width, containerWidth),
|
|
158
163
|
Math.min(maxes.height, Infinity),
|
|
159
164
|
];
|
|
160
|
-
console.log("from mixin: ".concat(className), textContentHeight);
|
|
161
|
-
console.log('prop value: ', placeholderHeight);
|
|
162
165
|
return (_jsx(Resizable, { draggableOpts: {
|
|
163
166
|
disabled: !isResizable,
|
|
164
167
|
}, className: isResizable ? undefined : "react-resizable-hide", width: position.width, height: position.height, top: position.top, left: position.left, minConstraints: minConstraints, maxConstraints: maxConstraints, onResizeStop: onResizeStop, onResizeStart: onResizeStart, onResize: onResize, transformScale: transformScale, resizeHandles: props.resizeHandles, handle: resizeHandle, children: child }));
|
|
@@ -463,7 +466,6 @@ var GridItem = function (_a) {
|
|
|
463
466
|
dragging: dragging,
|
|
464
467
|
resizing: resizing,
|
|
465
468
|
}, colWidth);
|
|
466
|
-
var child = React.Children.only(children);
|
|
467
469
|
var newChild = React.cloneElement(child, {
|
|
468
470
|
key: i,
|
|
469
471
|
ref: elementRef,
|