publ-echo 0.0.30 → 0.0.32
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.
|
@@ -304,7 +304,9 @@ var GridItem = function (_a) {
|
|
|
304
304
|
});
|
|
305
305
|
var child = React.Children.only(children);
|
|
306
306
|
var newChild = React.cloneElement(child, {
|
|
307
|
+
key: i,
|
|
307
308
|
ref: elementRef,
|
|
309
|
+
'data-grid-id': i,
|
|
308
310
|
className: classNames("react-grid-item", child.props.className, className, {
|
|
309
311
|
static: props.static,
|
|
310
312
|
isResizing: Boolean(resizing) && Boolean(isResizing) && Boolean(isHiddenVisibility),
|
|
@@ -365,7 +365,7 @@ var ReactGridLayout = function (_a) {
|
|
|
365
365
|
: !l.static && isResizable;
|
|
366
366
|
var resizeHandlesOptions = l.resizeHandles || resizeHandles;
|
|
367
367
|
var bounded = draggable && isBounded && l.isBounded !== false;
|
|
368
|
-
return (_jsx(GridItem, { containerWidth: width, cols: cols, margin: margin, containerPadding: containerPadding || margin, maxRows: maxRows, rowHeight: rowHeight, cancel: draggableCancel, handle: draggableHandle, onDragStop: onDragStopHandler, onDragStart: onDragStartHandler, onDrag: onDragHandler, onResizeStart: onResizeStartHandler, onResize: onResizeHandler, onResizeStop: onResizeStopHandler, isDraggable: draggable, isResizable: resizable, isBounded: bounded, useCSSTransforms: useCSSTransforms && isMounted, usePercentages: !isMounted, transformScale: transformScale, w: l.w, h: l.h, x: l.x, y: l.y, z: l.z || 0, i: l.i, minH: l.minH, minW: l.minW, maxH: l.maxH, maxW: l.maxW, static: l.static, droppingPosition: isDroppingItem ? droppingPosition : undefined, resizeHandles: resizeHandlesOptions, resizeHandle: resizeHandle, isHiddenVisibility: isHiddenVisibility, children: child }));
|
|
368
|
+
return (_jsx(GridItem, { containerWidth: width, cols: cols, margin: margin, containerPadding: containerPadding || margin, maxRows: maxRows, rowHeight: rowHeight, cancel: draggableCancel, handle: draggableHandle, onDragStop: onDragStopHandler, onDragStart: onDragStartHandler, onDrag: onDragHandler, onResizeStart: onResizeStartHandler, onResize: onResizeHandler, onResizeStop: onResizeStopHandler, isDraggable: draggable, isResizable: resizable, isBounded: bounded, useCSSTransforms: useCSSTransforms && isMounted, usePercentages: !isMounted, transformScale: transformScale, w: l.w, h: l.h, x: l.x, y: l.y, z: l.z || 0, i: l.i, minH: l.minH, minW: l.minW, maxH: l.maxH, maxW: l.maxW, static: l.static, droppingPosition: isDroppingItem ? droppingPosition : undefined, resizeHandles: resizeHandlesOptions, resizeHandle: resizeHandle, isHiddenVisibility: isHiddenVisibility, children: child }, l.i));
|
|
369
369
|
};
|
|
370
370
|
var getPositionParams = function () {
|
|
371
371
|
return {
|
|
@@ -21,7 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
-
import {
|
|
24
|
+
import { useLayoutEffect, useRef, useState } from "react";
|
|
25
25
|
import { cloneLayout, noop, synchronizeLayoutWithChildren, } from "./utils/renderHelpers";
|
|
26
26
|
import { findOrGenerateResponsiveLayout, getBreakpointFromWidth, getColsFromBreakpoint, } from "./utils/responsiveUtils";
|
|
27
27
|
import isEqual from "../../external-lib/lodash.isEqual";
|
|
@@ -56,12 +56,12 @@ export var ResponsiveGridLayout = function (_a) {
|
|
|
56
56
|
return generateInitialState();
|
|
57
57
|
}), state = _m[0], setState = _m[1];
|
|
58
58
|
var emittedBreakpointChangeOnce = useRef(breakpoint != null);
|
|
59
|
-
|
|
59
|
+
useLayoutEffect(function () {
|
|
60
60
|
if (!state || !isEqual(state.layouts, layouts)) {
|
|
61
61
|
setState(generateInitialState());
|
|
62
62
|
}
|
|
63
63
|
}, [layouts]);
|
|
64
|
-
|
|
64
|
+
useLayoutEffect(function () {
|
|
65
65
|
onWidthChangeHandler();
|
|
66
66
|
}, [width, breakpoint, JSON.stringify(breakpoints), cols]);
|
|
67
67
|
var onLayoutChangeHandler = function (layout) {
|