@dnd-kit/dom 0.2.0 → 0.2.1
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.
- package/index.cjs +9 -4
- package/index.cjs.map +1 -1
- package/index.d.cts +1 -1
- package/index.d.ts +1 -1
- package/index.js +9 -4
- package/index.js.map +1 -1
- package/package.json +5 -5
package/index.d.cts
CHANGED
|
@@ -78,7 +78,7 @@ declare class PointerSensor extends Sensor<DragDropManager, PointerSensorOptions
|
|
|
78
78
|
constructor(manager: DragDropManager, options?: PointerSensorOptions | undefined);
|
|
79
79
|
protected activationConstraints(event: PointerEvent, source: Draggable): ActivationConstraints<PointerEvent> | undefined;
|
|
80
80
|
bind(source: Draggable, options?: PointerSensorOptions | undefined): () => void;
|
|
81
|
-
protected handlePointerDown(event: PointerEvent, source: Draggable, options
|
|
81
|
+
protected handlePointerDown(event: PointerEvent, source: Draggable, options: PointerSensorOptions | undefined): void;
|
|
82
82
|
private latest;
|
|
83
83
|
protected handleMove: () => void;
|
|
84
84
|
protected handlePointerMove(event: PointerEvent, source: Draggable): void;
|
package/index.d.ts
CHANGED
|
@@ -78,7 +78,7 @@ declare class PointerSensor extends Sensor<DragDropManager, PointerSensorOptions
|
|
|
78
78
|
constructor(manager: DragDropManager, options?: PointerSensorOptions | undefined);
|
|
79
79
|
protected activationConstraints(event: PointerEvent, source: Draggable): ActivationConstraints<PointerEvent> | undefined;
|
|
80
80
|
bind(source: Draggable, options?: PointerSensorOptions | undefined): () => void;
|
|
81
|
-
protected handlePointerDown(event: PointerEvent, source: Draggable, options
|
|
81
|
+
protected handlePointerDown(event: PointerEvent, source: Draggable, options: PointerSensorOptions | undefined): void;
|
|
82
82
|
private latest;
|
|
83
83
|
protected handleMove: () => void;
|
|
84
84
|
protected handlePointerMove(event: PointerEvent, source: Draggable): void;
|
package/index.js
CHANGED
|
@@ -1633,8 +1633,13 @@ var defaults2 = Object.freeze({
|
|
|
1633
1633
|
];
|
|
1634
1634
|
},
|
|
1635
1635
|
preventActivation(event, source) {
|
|
1636
|
+
var _a4;
|
|
1636
1637
|
const { target } = event;
|
|
1637
|
-
|
|
1638
|
+
if (target === source.element) return false;
|
|
1639
|
+
if (target === source.handle) return false;
|
|
1640
|
+
if (!isElement(target)) return false;
|
|
1641
|
+
if ((_a4 = source.handle) == null ? void 0 : _a4.contains(target)) return false;
|
|
1642
|
+
return isInteractiveElement(target);
|
|
1638
1643
|
}
|
|
1639
1644
|
});
|
|
1640
1645
|
var _cleanup;
|
|
@@ -1693,12 +1698,12 @@ var _PointerSensor = class _PointerSensor extends Sensor {
|
|
|
1693
1698
|
});
|
|
1694
1699
|
return unbind;
|
|
1695
1700
|
}
|
|
1696
|
-
handlePointerDown(event, source, options
|
|
1697
|
-
var _a4;
|
|
1701
|
+
handlePointerDown(event, source, options) {
|
|
1698
1702
|
if (this.disabled || !event.isPrimary || event.button !== 0 || !isElement(event.target) || source.disabled || isCapturedBySensor(event) || !this.manager.dragOperation.status.idle) {
|
|
1699
1703
|
return;
|
|
1700
1704
|
}
|
|
1701
|
-
|
|
1705
|
+
const { preventActivation = defaults2.preventActivation } = options != null ? options : {};
|
|
1706
|
+
if (preventActivation == null ? void 0 : preventActivation(event, source)) {
|
|
1702
1707
|
return;
|
|
1703
1708
|
}
|
|
1704
1709
|
const { target } = event;
|