publ-echo-test 0.0.77 → 0.0.79
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.
@@ -36,6 +36,7 @@ var GridItem = function (_a) {
|
|
36
36
|
var _o = useState(), dragStart = _o[0], setDragStart = _o[1];
|
37
37
|
var _p = useState(false), isDragging = _p[0], setIsDragging = _p[1];
|
38
38
|
var _q = useState(false), isResizing = _q[0], setIsResizing = _q[1];
|
39
|
+
var _r = useState(false), pointerEventsNone = _r[0], setPointerEventsNone = _r[1];
|
39
40
|
var elementRef = useRef(null);
|
40
41
|
var isSelected = (_b = elementRef.current) === null || _b === void 0 ? void 0 : _b.classList.contains('react-grid-item-selected');
|
41
42
|
useEffect(function () {
|
@@ -171,7 +172,16 @@ var GridItem = function (_a) {
|
|
171
172
|
* @return {Element} Child wrapped in Draggable.
|
172
173
|
*/
|
173
174
|
var mixinDraggable = function (child, isDraggable) {
|
174
|
-
|
175
|
+
function onMouseDownDraggable() {
|
176
|
+
var _a;
|
177
|
+
if (!isDraggable) {
|
178
|
+
if ((_a = elementRef.current) === null || _a === void 0 ? void 0 : _a.classList) {
|
179
|
+
// elementRef.current?.classList.add('pointer-events-none')
|
180
|
+
setPointerEventsNone(true);
|
181
|
+
}
|
182
|
+
}
|
183
|
+
}
|
184
|
+
return (_jsx(DraggableCore, { disabled: !isDraggable, onMouseDown: onMouseDownDraggable, onStart: onDragStart, onDrag: onDrag, onStop: onDragStop, handle: handle, cancel: ".react-resizable-handle" + (cancel ? "," + cancel : ""), scale: transformScale, nodeRef: elementRef, children: child }));
|
175
185
|
};
|
176
186
|
/**
|
177
187
|
* Mix a Resizable instance into a child.
|
@@ -399,7 +409,7 @@ var GridItem = function (_a) {
|
|
399
409
|
// dropping: Boolean(droppingPosition),
|
400
410
|
cssTransforms: useCSSTransforms,
|
401
411
|
}),
|
402
|
-
style: __assign(__assign(__assign({}, props.style), child.props.style), createStyle(pos)),
|
412
|
+
style: __assign(__assign(__assign(__assign({}, props.style), child.props.style), createStyle(pos)), { pointerEvents: pointerEventsNone ? 'none' : 'auto' }),
|
403
413
|
});
|
404
414
|
newChild = mixinResizable(newChild, pos, isResizable);
|
405
415
|
newChild = mixinDraggable(newChild, isDraggable);
|