publ-echo-test 0.0.87 → 0.0.89
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.
@@ -30,12 +30,13 @@ var DraggableCore = function (_a) {
|
|
30
30
|
var _c = _a.allowAnyClick, allowAnyClick = _c === void 0 ? false : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, _e = _a.enableUserSelectHack, enableUserSelectHack = _e === void 0 ? true : _e, _f = _a.onStart, onStart = _f === void 0 ? function () { } : _f, _g = _a.onDrag, onDrag = _g === void 0 ? function () { } : _g, _h = _a.onStop, onStop = _h === void 0 ? function () { } : _h, _j = _a.onMouseDown, onMouseDown = _j === void 0 ? function () { } : _j, _k = _a.scale, scale = _k === void 0 ? 1 : _k, children = _a.children, props = __rest(_a, ["allowAnyClick", "disabled", "enableUserSelectHack", "onStart", "onDrag", "onStop", "onMouseDown", "scale", "children"]);
|
31
31
|
var draggableCoreRef = useRef(null);
|
32
32
|
var isMounted = useRef(false);
|
33
|
-
var _l = useState(
|
33
|
+
var _l = useState(false), pointerEventsNone = _l[0], setPointerEventsNone = _l[1];
|
34
|
+
var _m = useState({
|
34
35
|
dragging: false,
|
35
36
|
lastX: NaN,
|
36
37
|
lastY: NaN,
|
37
38
|
touchIdentifier: null,
|
38
|
-
}), draggableCoreState =
|
39
|
+
}), draggableCoreState = _m[0], setDraggableCoreState = _m[1];
|
39
40
|
/**
|
40
41
|
* @when DraggableCore가 랜더링 했을 때
|
41
42
|
* @expected 해당 DOMNode에서 Drag가 동작할 수 있도록 event를 추가합니다.
|
@@ -240,10 +241,12 @@ var DraggableCore = function (_a) {
|
|
240
241
|
}
|
241
242
|
}
|
242
243
|
var handleMouseDown = function (e) {
|
244
|
+
setPointerEventsNone(true);
|
243
245
|
dragEventFor = EVENTS.MOUSE;
|
244
246
|
return handleDragStart(e);
|
245
247
|
};
|
246
248
|
var handleMouseUp = function (e) {
|
249
|
+
setPointerEventsNone(false);
|
247
250
|
dragEventFor = EVENTS.MOUSE;
|
248
251
|
return handleDragStop(e);
|
249
252
|
};
|
@@ -261,6 +264,7 @@ var DraggableCore = function (_a) {
|
|
261
264
|
onMouseUp: handleMouseUp,
|
262
265
|
onTouchEnd: handleTouchEnd,
|
263
266
|
ref: (_b = props.nodeRef) !== null && _b !== void 0 ? _b : draggableCoreRef,
|
267
|
+
className: pointerEventsNone ? 'pointer-events-none' : props.className,
|
264
268
|
});
|
265
269
|
};
|
266
270
|
export default DraggableCore;
|
@@ -172,15 +172,7 @@ var GridItem = function (_a) {
|
|
172
172
|
* @return {Element} Child wrapped in Draggable.
|
173
173
|
*/
|
174
174
|
var mixinDraggable = function (child, isDraggable) {
|
175
|
-
|
176
|
-
var _a;
|
177
|
-
if (!isDraggable) {
|
178
|
-
if ((_a = elementRef.current) === null || _a === void 0 ? void 0 : _a.classList) {
|
179
|
-
setPointerEventsNone(true);
|
180
|
-
}
|
181
|
-
}
|
182
|
-
}
|
183
|
-
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
|
+
return (_jsx(DraggableCore, { disabled: !isDraggable, onStart: onDragStart, onDrag: onDrag, onStop: onDragStop, handle: handle, cancel: ".react-resizable-handle" + (cancel ? "," + cancel : ""), scale: transformScale, nodeRef: elementRef, children: child }));
|
184
176
|
};
|
185
177
|
/**
|
186
178
|
* Mix a Resizable instance into a child.
|
@@ -407,6 +399,7 @@ var GridItem = function (_a) {
|
|
407
399
|
"react-draggable-dragging": Boolean(dragging),
|
408
400
|
// dropping: Boolean(droppingPosition),
|
409
401
|
cssTransforms: useCSSTransforms,
|
402
|
+
'pointer-events-none': !isDraggable,
|
410
403
|
}),
|
411
404
|
style: __assign(__assign(__assign({}, props.style), child.props.style), createStyle(pos)),
|
412
405
|
});
|
@@ -469,7 +469,7 @@ var ReactGridLayout = function (_a) {
|
|
469
469
|
if (!item) {
|
470
470
|
return null;
|
471
471
|
}
|
472
|
-
return (_jsx(GridItem, { w: activeDrag.w, h: activeDrag.h, x: activeDrag.x, y: activeDrag.y, z: activeDrag.z || 0, i: activeDrag.i, className:
|
472
|
+
return (_jsx(GridItem, { w: activeDrag.w, h: activeDrag.h, x: activeDrag.x, y: activeDrag.y, z: activeDrag.z || 0, i: activeDrag.i, className: 'placeholder', containerWidth: width, cols: cols, margin: margin, containerPadding: containerPadding || margin, maxRows: maxRows, rowHeight: rowHeight, isDraggable: false, isResizable: false, isBounded: false, useCSSTransforms: useCSSTransforms, transformScale: transformScale, autoResize: !!l.autoResize, children: item && item }));
|
473
473
|
};
|
474
474
|
/**
|
475
475
|
* Given a grid item, set its style attributes & surround in a <Draggable>.
|