This commit is contained in:
51
node_modules/react-dnd/dist/esm/hooks/useDrop/DropTargetImpl.js
generated
vendored
Normal file
51
node_modules/react-dnd/dist/esm/hooks/useDrop/DropTargetImpl.js
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
export var DropTargetImpl = /*#__PURE__*/function () {
|
||||
function DropTargetImpl(spec, monitor) {
|
||||
_classCallCheck(this, DropTargetImpl);
|
||||
|
||||
_defineProperty(this, "spec", void 0);
|
||||
|
||||
_defineProperty(this, "monitor", void 0);
|
||||
|
||||
this.spec = spec;
|
||||
this.monitor = monitor;
|
||||
}
|
||||
|
||||
_createClass(DropTargetImpl, [{
|
||||
key: "canDrop",
|
||||
value: function canDrop() {
|
||||
var spec = this.spec;
|
||||
var monitor = this.monitor;
|
||||
return spec.canDrop ? spec.canDrop(monitor.getItem(), monitor) : true;
|
||||
}
|
||||
}, {
|
||||
key: "hover",
|
||||
value: function hover() {
|
||||
var spec = this.spec;
|
||||
var monitor = this.monitor;
|
||||
|
||||
if (spec.hover) {
|
||||
spec.hover(monitor.getItem(), monitor);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "drop",
|
||||
value: function drop() {
|
||||
var spec = this.spec;
|
||||
var monitor = this.monitor;
|
||||
|
||||
if (spec.drop) {
|
||||
return spec.drop(monitor.getItem(), monitor);
|
||||
}
|
||||
}
|
||||
}]);
|
||||
|
||||
return DropTargetImpl;
|
||||
}();
|
||||
Reference in New Issue
Block a user