draggable-helper
Advanced tools
Comparing version 6.0.3 to 6.0.4
/*! | ||
* draggable-helper v6.0.3 | ||
* draggable-helper v6.0.4 | ||
* (c) phphe <phphe@outlook.com> (https://github.com/phphe) | ||
@@ -11,2 +11,4 @@ * Homepage: null | ||
var _regeneratorRuntime = require('@babel/runtime/regenerator'); | ||
var tslib = require('tslib'); | ||
var hp = require('helper-js'); | ||
@@ -37,2 +39,3 @@ var DragEventService = require('drag-event-service'); | ||
var _regeneratorRuntime__default = /*#__PURE__*/_interopDefaultLegacy(_regeneratorRuntime); | ||
var hp__namespace = /*#__PURE__*/_interopNamespace(hp); | ||
@@ -72,2 +75,4 @@ var DragEventService__default = /*#__PURE__*/_interopDefaultLegacy(DragEventService); | ||
function index (listenerElement) { | ||
var _this = this; | ||
var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
@@ -385,52 +390,97 @@ var store; // set default value of options | ||
var onMouseupOrTouchEnd = function onMouseupOrTouchEnd(e) { | ||
// execute native event hooks | ||
if (!DragEventService__default['default'].isTouch(e)) { | ||
opt.onmousedown && opt.onmousedown(e); | ||
} else { | ||
opt.ontouchend && opt.ontouchend(e); | ||
} // cancel listening mousemove, touchmove, mouseup, touchend | ||
// 取消监听事件mousemove, touchmove, mouseup, touchend | ||
return tslib.__awaiter(_this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee() { | ||
var _store2, movedElement, updateMovedElementStyle; | ||
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) { | ||
while (1) { | ||
switch (_context.prev = _context.next) { | ||
case 0: | ||
// execute native event hooks | ||
if (!DragEventService__default['default'].isTouch(e)) { | ||
opt.onmousedown && opt.onmousedown(e); | ||
} else { | ||
opt.ontouchend && opt.ontouchend(e); | ||
} // cancel listening mousemove, touchmove, mouseup, touchend | ||
// 取消监听事件mousemove, touchmove, mouseup, touchend | ||
DragEventService__default['default'].off(document, 'move', onMousemoveOrTouchMove, { | ||
touchArgs: [{ | ||
passive: false | ||
}] | ||
}); | ||
DragEventService__default['default'].off(window, 'end', onMouseupOrTouchEnd); // | ||
if (store.movedCount === 0) { | ||
return; | ||
} | ||
DragEventService__default['default'].off(document, 'move', onMousemoveOrTouchMove, { | ||
touchArgs: [{ | ||
passive: false | ||
}] | ||
}); | ||
DragEventService__default['default'].off(window, 'end', onMouseupOrTouchEnd); // | ||
store.endEvent = e; | ||
var _store2 = store, | ||
movedElement = _store2.movedElement; // define the function to update moved element style | ||
// 定义更新移动元素样式的方法 | ||
if (!(store.movedCount === 0)) { | ||
_context.next = 5; | ||
break; | ||
} | ||
var updateMovedElementStyle = function updateMovedElementStyle() { | ||
hp__namespace.restoreAttr(movedElement, 'style'); | ||
hp__namespace.restoreAttr(movedElement, 'class'); | ||
hp__namespace.restoreAttr(document.body, 'style'); | ||
return _context.abrupt("return"); | ||
if (store._isMovingElementCloned) { | ||
hp__namespace.removeEl(movedElement); | ||
} | ||
}; | ||
case 5: | ||
store.endEvent = e; | ||
_store2 = store, movedElement = _store2.movedElement; // define the function to update moved element style | ||
// 定义更新移动元素样式的方法 | ||
store.updateMovedElementStyle = updateMovedElementStyle; // call hook beforeDrop | ||
updateMovedElementStyle = function updateMovedElementStyle() { | ||
hp__namespace.restoreAttr(movedElement, 'style'); | ||
hp__namespace.restoreAttr(movedElement, 'class'); | ||
hp__namespace.restoreAttr(document.body, 'style'); | ||
if (opt.beforeDrop && opt.beforeDrop(store, opt) === false) { | ||
return; | ||
} // try to update moved element style | ||
// 尝试更新移动元素样式 | ||
if (store._isMovingElementCloned) { | ||
hp__namespace.removeEl(movedElement); | ||
} | ||
}; | ||
store.updateMovedElementStyle = updateMovedElementStyle; // call hook beforeDrop | ||
if (!opt.updateMovedElementStyleManually) { | ||
updateMovedElementStyle(); | ||
} | ||
_context.t0 = opt.beforeDrop; | ||
_edgeScroll.afterDrop(store, opt); | ||
if (!_context.t0) { | ||
_context.next = 15; | ||
break; | ||
} | ||
opt.afterDrop && opt.afterDrop(store, opt); | ||
_context.next = 13; | ||
return opt.beforeDrop(store, opt); | ||
case 13: | ||
_context.t1 = _context.sent; | ||
_context.t0 = _context.t1 === false; | ||
case 15: | ||
if (!_context.t0) { | ||
_context.next = 17; | ||
break; | ||
} | ||
return _context.abrupt("return"); | ||
case 17: | ||
// try to update moved element style | ||
// 尝试更新移动元素样式 | ||
if (!opt.updateMovedElementStyleManually) { | ||
updateMovedElementStyle(); | ||
} | ||
_edgeScroll.afterDrop(store, opt); | ||
_context.t2 = opt.afterDrop; | ||
if (!_context.t2) { | ||
_context.next = 23; | ||
break; | ||
} | ||
_context.next = 23; | ||
return opt.afterDrop(store, opt); | ||
case 23: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
} | ||
}, _callee); | ||
})); | ||
}; // define the destroy function | ||
@@ -437,0 +487,0 @@ // 定义销毁/退出的方法 |
/*! | ||
* draggable-helper v6.0.3 | ||
* draggable-helper v6.0.4 | ||
* (c) phphe <phphe@outlook.com> (https://github.com/phphe) | ||
@@ -7,2 +7,4 @@ * Homepage: null | ||
*/ | ||
import _regeneratorRuntime from '@babel/runtime/regenerator'; | ||
import { __awaiter } from 'tslib'; | ||
import * as hp from 'helper-js'; | ||
@@ -42,2 +44,4 @@ import DragEventService from 'drag-event-service'; | ||
function index (listenerElement) { | ||
var _this = this; | ||
var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
@@ -355,52 +359,97 @@ var store; // set default value of options | ||
var onMouseupOrTouchEnd = function onMouseupOrTouchEnd(e) { | ||
// execute native event hooks | ||
if (!DragEventService.isTouch(e)) { | ||
opt.onmousedown && opt.onmousedown(e); | ||
} else { | ||
opt.ontouchend && opt.ontouchend(e); | ||
} // cancel listening mousemove, touchmove, mouseup, touchend | ||
// 取消监听事件mousemove, touchmove, mouseup, touchend | ||
return __awaiter(_this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime.mark(function _callee() { | ||
var _store2, movedElement, updateMovedElementStyle; | ||
return _regeneratorRuntime.wrap(function _callee$(_context) { | ||
while (1) { | ||
switch (_context.prev = _context.next) { | ||
case 0: | ||
// execute native event hooks | ||
if (!DragEventService.isTouch(e)) { | ||
opt.onmousedown && opt.onmousedown(e); | ||
} else { | ||
opt.ontouchend && opt.ontouchend(e); | ||
} // cancel listening mousemove, touchmove, mouseup, touchend | ||
// 取消监听事件mousemove, touchmove, mouseup, touchend | ||
DragEventService.off(document, 'move', onMousemoveOrTouchMove, { | ||
touchArgs: [{ | ||
passive: false | ||
}] | ||
}); | ||
DragEventService.off(window, 'end', onMouseupOrTouchEnd); // | ||
if (store.movedCount === 0) { | ||
return; | ||
} | ||
DragEventService.off(document, 'move', onMousemoveOrTouchMove, { | ||
touchArgs: [{ | ||
passive: false | ||
}] | ||
}); | ||
DragEventService.off(window, 'end', onMouseupOrTouchEnd); // | ||
store.endEvent = e; | ||
var _store2 = store, | ||
movedElement = _store2.movedElement; // define the function to update moved element style | ||
// 定义更新移动元素样式的方法 | ||
if (!(store.movedCount === 0)) { | ||
_context.next = 5; | ||
break; | ||
} | ||
var updateMovedElementStyle = function updateMovedElementStyle() { | ||
hp.restoreAttr(movedElement, 'style'); | ||
hp.restoreAttr(movedElement, 'class'); | ||
hp.restoreAttr(document.body, 'style'); | ||
return _context.abrupt("return"); | ||
if (store._isMovingElementCloned) { | ||
hp.removeEl(movedElement); | ||
} | ||
}; | ||
case 5: | ||
store.endEvent = e; | ||
_store2 = store, movedElement = _store2.movedElement; // define the function to update moved element style | ||
// 定义更新移动元素样式的方法 | ||
store.updateMovedElementStyle = updateMovedElementStyle; // call hook beforeDrop | ||
updateMovedElementStyle = function updateMovedElementStyle() { | ||
hp.restoreAttr(movedElement, 'style'); | ||
hp.restoreAttr(movedElement, 'class'); | ||
hp.restoreAttr(document.body, 'style'); | ||
if (opt.beforeDrop && opt.beforeDrop(store, opt) === false) { | ||
return; | ||
} // try to update moved element style | ||
// 尝试更新移动元素样式 | ||
if (store._isMovingElementCloned) { | ||
hp.removeEl(movedElement); | ||
} | ||
}; | ||
store.updateMovedElementStyle = updateMovedElementStyle; // call hook beforeDrop | ||
if (!opt.updateMovedElementStyleManually) { | ||
updateMovedElementStyle(); | ||
} | ||
_context.t0 = opt.beforeDrop; | ||
_edgeScroll.afterDrop(store, opt); | ||
if (!_context.t0) { | ||
_context.next = 15; | ||
break; | ||
} | ||
opt.afterDrop && opt.afterDrop(store, opt); | ||
_context.next = 13; | ||
return opt.beforeDrop(store, opt); | ||
case 13: | ||
_context.t1 = _context.sent; | ||
_context.t0 = _context.t1 === false; | ||
case 15: | ||
if (!_context.t0) { | ||
_context.next = 17; | ||
break; | ||
} | ||
return _context.abrupt("return"); | ||
case 17: | ||
// try to update moved element style | ||
// 尝试更新移动元素样式 | ||
if (!opt.updateMovedElementStyleManually) { | ||
updateMovedElementStyle(); | ||
} | ||
_edgeScroll.afterDrop(store, opt); | ||
_context.t2 = opt.afterDrop; | ||
if (!_context.t2) { | ||
_context.next = 23; | ||
break; | ||
} | ||
_context.next = 23; | ||
return opt.afterDrop(store, opt); | ||
case 23: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
} | ||
}, _callee); | ||
})); | ||
}; // define the destroy function | ||
@@ -407,0 +456,0 @@ // 定义销毁/退出的方法 |
/*! | ||
* draggable-helper v6.0.3 | ||
* draggable-helper v6.0.4 | ||
* (c) phphe <phphe@outlook.com> (https://github.com/phphe) | ||
@@ -7,3 +7,17 @@ * Homepage: null | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).draggableHelper={})}(this,(function(e){"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function n(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,n){if(e){if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e){return t=e,"[object Array]"===Object.prototype.toString.call(t)?e:[e]; | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).draggableHelper={})}(this,(function(e){"use strict";var t={exports:{}};!function(e){var t=function(e){var t,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var o=t&&t.prototype instanceof v?t:v,i=Object.create(o.prototype),a=new A(r||[]);return i._invoke=function(e,t,n){var r=f;return function(o,i){if(r===p)throw new Error("Generator is already running");if(r===h){if("throw"===o)throw i;return _()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var l=M(a,n);if(l){if(l===g)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var c=s(e,t,n);if("normal"===c.type){if(r=n.done?h:d,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=h,n.method="throw",n.arg=c.arg)}}}(e,n,a),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var f="suspendedStart",d="suspendedYield",p="executing",h="completed",g={};function v(){}function m(){}function y(){}var E={};c(E,i,(function(){return this}));var w=Object.getPrototypeOf,b=w&&w(w(O([])));b&&b!==n&&r.call(b,i)&&(E=b);var x=y.prototype=v.prototype=Object.create(E);function S(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function n(o,i,a,l){var c=s(e[o],e,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,a,l)}),(function(e){n("throw",e,a,l)})):t.resolve(f).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,l)}))}l(c.arg)}var o;this._invoke=function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}}function M(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,M(e,n),"throw"===n.method))return g;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var o=s(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function O(e){if(e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}return{next:_}}function _(){return{value:t,done:!0}}return m.prototype=y,c(x,"constructor",y),c(y,"constructor",m),m.displayName=c(y,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,c(e,l,"GeneratorFunction")),e.prototype=Object.create(x),e},e.awrap=function(e){return{__await:e}},S(T.prototype),c(T.prototype,a,(function(){return this})),e.AsyncIterator=T,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new T(u(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(x),c(x,l,"Generator"),c(x,i,(function(){return this})),c(x,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=O,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return l.type="throw",l.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;C(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:O(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(t);var n=t.exports; | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */function r(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function l(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}c((r=r.apply(e,t||[])).next())}))}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function i(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()} | ||
/*! | ||
@@ -14,4 +28,3 @@ * helper-js v2.0.6 | ||
* Released under the MIT License. | ||
*/ | ||
var t}function o(e,t){Object.keys(t).forEach((function(n){null==e[n]&&(e[n]=t[n])}))}function i(e,t){for(;;){if(null==e.parentElement)return!1;if(e.parentElement===t)return!0;e=e.parentElement}}function a(e){if(null!==e.parentNode)return e.parentNode.removeChild(e)}function l(e){var t=e.getBoundingClientRect(),n=t.top-document.documentElement.clientTop,r=t.bottom,o=t.left-document.documentElement.clientLeft,i=t.right;return{top:n,right:i,bottom:r,left:o,width:t.width||i-o,height:t.height||r-n,x:o,y:n}}!function(e){var t=function(e){var t,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var o=t&&t.prototype instanceof m?t:m,i=Object.create(o.prototype),a=new A(r||[]);return i._invoke=function(e,t,n){var r=f;return function(o,i){if(r===h)throw new Error("Generator is already running");if(r===p){if("throw"===o)throw i;return _()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var l=M(a,n);if(l){if(l===g)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=h;var c=s(e,t,n);if("normal"===c.type){if(r=n.done?p:d,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=p,n.method="throw",n.arg=c.arg)}}}(e,n,a),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var f="suspendedStart",d="suspendedYield",h="executing",p="completed",g={};function m(){}function v(){}function y(){}var E={};c(E,i,(function(){return this}));var w=Object.getPrototypeOf,b=w&&w(w(O([])));b&&b!==n&&r.call(b,i)&&(E=b);var S=y.prototype=m.prototype=Object.create(E);function x(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function n(o,i,a,l){var c=s(e[o],e,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,a,l)}),(function(e){n("throw",e,a,l)})):t.resolve(f).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,l)}))}l(c.arg)}var o;this._invoke=function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}}function M(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,M(e,n),"throw"===n.method))return g;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var o=s(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function O(e){if(e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}return{next:_}}function _(){return{value:t,done:!0}}return v.prototype=y,c(S,"constructor",y),c(y,"constructor",v),v.displayName=c(y,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,c(e,l,"GeneratorFunction")),e.prototype=Object.create(S),e},e.awrap=function(e){return{__await:e}},x(T.prototype),c(T.prototype,a,(function(){return this})),e.AsyncIterator=T,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new T(u(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},x(S),c(S,l,"Generator"),c(S,i,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=O,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return l.type="throw",l.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;C(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:O(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}({exports:{}});var c=l;function u(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n&&n.withSelf?e:e.parentElement;r;){var o=t(r);if("break"===o)return;if(o)return r;r=r.parentElement}}function s(e,t){e["original_".concat(t)]=e.getAttribute(t)}function f(e,t){var n=e["original_".concat(t)];null==n?e.removeAttribute(t):e.setAttribute(t,n)}function d(e,t){return e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className)}function h(e,t){d(e,t)||(e.classList?e.classList.add(t):e.className+=" "+t)}function p(e,t,n){for(var r=arguments.length,o=new Array(r>3?r-3:0),i=3;i<r;i++)o[i-3]=arguments[i];e.addEventListener?e.addEventListener.apply(e,[t,n].concat(o)):e.attachEvent&&e.attachEvent.apply(e,["on".concat(t),n].concat(o))}function g(e,t,n){for(var r=arguments.length,o=new Array(r>3?r-3:0),i=3;i<r;i++)o[i-3]=arguments[i];e.removeEventListener?e.removeEventListener.apply(e,[t,n].concat(o)):e.detachEvent&&e.detachEvent.apply(e,["on".concat(t),n].concat(o))}function m(e,t){var n=[e,t];return(document.elementsFromPoint||document.msElementsFromPoint||function(e,t){var n=[],r=void 0;do{r!==document.elementFromPoint(e,t)?(r=document.elementFromPoint(e,t),n.push(r),r.style.pointerEvents="none"):r=!1}while(r);return n.forEach((function(e){return e.style.pointerEvents="all"})),n}).apply(document,n)}function v(e){e.element||(e.element=document.scrollingElement||document.documentElement),null==e.duration&&(e.duration=0);var t,n=e.x,r=e.y,o=e.duration,i=e.element,a=0,l=i.scrollTop,c=r-l,u=i.scrollLeft,s=n-u,f=+new Date;return function h(){if(!e.beforeEveryFrame||!1!==e.beforeEveryFrame(a)){var p=(new Date).getTime()-f;null!=r&&(i.scrollTop=parseInt(d(l,c,p,o))),null!=n&&(i.scrollLeft=parseInt(d(u,s,p,o))),p<o?t=requestAnimationFrame(h):(null!=r&&(i.scrollTop=r),null!=n&&(i.scrollLeft=n)),a++}}(),function(){cancelAnimationFrame(t)};function d(e,t,n,r){return e+t*(n/r)}} | ||
*/function a(e){return t=e,"[object Array]"===Object.prototype.toString.call(t)?e:[e];var t}function l(e,t){Object.keys(t).forEach((function(n){null==e[n]&&(e[n]=t[n])}))}function c(e,t){for(;;){if(null==e.parentElement)return!1;if(e.parentElement===t)return!0;e=e.parentElement}}function u(e){if(null!==e.parentNode)return e.parentNode.removeChild(e)}function s(e){var t=e.getBoundingClientRect(),n=t.top-document.documentElement.clientTop,r=t.bottom,o=t.left-document.documentElement.clientLeft,i=t.right;return{top:n,right:i,bottom:r,left:o,width:t.width||i-o,height:t.height||r-n,x:o,y:n}}var f=s;function d(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n&&n.withSelf?e:e.parentElement;r;){var o=t(r);if("break"===o)return;if(o)return r;r=r.parentElement}}function p(e,t){e["original_".concat(t)]=e.getAttribute(t)}function h(e,t){var n=e["original_".concat(t)];null==n?e.removeAttribute(t):e.setAttribute(t,n)}function g(e,t){return e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className)}function v(e,t){g(e,t)||(e.classList?e.classList.add(t):e.className+=" "+t)}function m(e,t,n){for(var r=arguments.length,o=new Array(r>3?r-3:0),i=3;i<r;i++)o[i-3]=arguments[i];e.addEventListener?e.addEventListener.apply(e,[t,n].concat(o)):e.attachEvent&&e.attachEvent.apply(e,["on".concat(t),n].concat(o))}function y(e,t,n){for(var r=arguments.length,o=new Array(r>3?r-3:0),i=3;i<r;i++)o[i-3]=arguments[i];e.removeEventListener?e.removeEventListener.apply(e,[t,n].concat(o)):e.detachEvent&&e.detachEvent.apply(e,["on".concat(t),n].concat(o))}function E(e,t){var n=[e,t],r=document.elementsFromPoint||document.msElementsFromPoint||function(e,t){var n=[],r=void 0;do{r!==document.elementFromPoint(e,t)?(r=document.elementFromPoint(e,t),n.push(r),r.style.pointerEvents="none"):r=!1}while(r);return n.forEach((function(e){return e.style.pointerEvents="all"})),n};return r.apply(document,n)}function w(e){e.element||(e.element=document.scrollingElement||document.documentElement),null==e.duration&&(e.duration=0);var t,n=e.x,r=e.y,o=e.duration,i=e.element,a=0,l=i.scrollTop,c=r-l,u=i.scrollLeft,s=n-u,f=+new Date;return function p(){if(!e.beforeEveryFrame||!1!==e.beforeEveryFrame(a)){var h=(new Date).getTime()-f;null!=r&&(i.scrollTop=parseInt(d(l,c,h,o))),null!=n&&(i.scrollLeft=parseInt(d(u,s,h,o))),h<o?t=requestAnimationFrame(p):(null!=r&&(i.scrollTop=r),null!=n&&(i.scrollLeft=n)),a++}}(),function(){cancelAnimationFrame(t)};function d(e,t,n,r){return e+t*(n/r)}} | ||
/*! | ||
@@ -22,2 +35,2 @@ * drag-event-service v1.1.10 | ||
* Released under the MIT License. | ||
*/var y={start:["mousedown","touchstart"],move:["mousemove","touchmove"],end:["mouseup","touchend"]},E={isTouch:function(e){return e.type&&e.type.startsWith("touch")},_getStore:function(e){return e._wrapperStore||(e._wrapperStore=[]),e._wrapperStore},on:function(e,t,r,o){var i,a,l=w(o),c=l.args,u=l.mouseArgs,s=l.touchArgs,f=this._getStore(e),d=this,h=function(e){var n;if(d.isTouch(e))n={x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY,pageX:e.changedTouches[0].pageX,pageY:e.changedTouches[0].pageY,clientX:e.changedTouches[0].clientX,clientY:e.changedTouches[0].clientY,screenX:e.changedTouches[0].screenX,screenY:e.changedTouches[0].screenY};else if(n={x:e.pageX,y:e.pageY,pageX:e.pageX,pageY:e.pageY,clientX:e.clientX,clientY:e.clientY,screenX:e.screenX,screenY:e.screenY},"start"===t&&1!==e.which)return;return r.call(this,e,n)};f.push({handler:r,wrapper:h}),(i=p).call.apply(i,[null,e,y[t][0],h].concat([].concat(n(c),n(u)))),(a=p).call.apply(a,[null,e,y[t][1],h].concat([].concat(n(c),n(s))))},off:function(e,t,r,o){for(var i=w(o),a=i.args,l=i.mouseArgs,c=this._getStore(e),u=c.length-1;u>=0;u--){var s,f,d=c[u],h=d.handler,p=d.wrapper;if(r===h)(s=g).call.apply(s,[null,e,y[t][0],p].concat([].concat(n(a),n(l)))),(f=g).call.apply(f,[null,e,y[t][1],p].concat([].concat(n(a),n(l)))),c.splice(u,1)}}};function w(e){return e||(e={}),{args:e.args||[],mouseArgs:e.mouseArgs||[],touchArgs:e.touchArgs||[]}}function b(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return S(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var x={afterFirstMove:function(e,t){},afterMove:function(e,t){},afterDrop:function(e,t){}};var T,M,L={ingoreTags:["INPUT","TEXTAREA","SELECT","OPTGROUP","OPTION"],undraggableClassName:"undraggable",minDisplacement:10,draggingClassName:"dragging",clone:!1,updateMovedElementStyleManually:!1,preventTextSelection:!0,edgeScrollTriggerMargin:50,edgeScrollSpeed:.35,edgeScrollTriggerMode:"top_left_corner"},C={movedCount:0};function A(){T&&(T(),T=null),M&&(M(),M=null)}x.afterMove=function(e,t){if(t.edgeScroll){var n=t.edgeScrollTriggerMargin;A();var r,o,a,l,u,s,f,d={x:e.mouse.clientX,y:e.mouse.clientY};if("top_left_corner"===t.edgeScrollTriggerMode){var h=c(e.movedElement);d={x:h.x,y:h.y}}var p;if(t.edgeScrollSpecifiedContainerX)(p="function"==typeof t.edgeScrollSpecifiedContainerX?t.edgeScrollSpecifiedContainerX(e,t):t.edgeScrollSpecifiedContainerX)&&(s=[p]);s||(f=s=m(d.x,d.y));var g,y,E=b(s);try{for(E.s();!(g=E.n()).done;){var w=g.value;if(!a||i(a,w)){if(!r&&w.scrollWidth>w.clientWidth){var S=N(w);d.x<=S.left+n?j(w,"left")>10&&_(w,"x")&&(r=w,l="left"):d.x>=S.left+w.clientWidth-n&&j(w,"right")>10&&_(w,"x")&&(r=w,l="right")}if(r)break;a=w}}}catch(e){E.e(e)}finally{E.f()}if(a=null,s=null,t.edgeScrollSpecifiedContainerY)(y="function"==typeof t.edgeScrollSpecifiedContainerY?t.edgeScrollSpecifiedContainerY(e,t):t.edgeScrollSpecifiedContainerY)&&(s=[y]);s||(s=f||m(d.x,d.y));var x,L=b(s);try{for(L.s();!(x=L.n()).done;){var C=x.value;if(!a||i(a,C)){if(!o&&C.scrollHeight>C.clientHeight){var O=N(C);d.y<=O.top+n?j(C,"up")>10&&_(C,"y")&&(o=C,u="up"):d.y>=O.top+C.clientHeight-n&&j(C,"down")>10&&_(C,"y")&&(o=C,u="down")}if(o)break;a=C}}}catch(e){L.e(e)}finally{L.f()}r&&(T=v("left"===l?{x:0,element:r,duration:j(r,"left")/t.edgeScrollSpeed}:{x:r.scrollWidth-r.clientWidth,element:r,duration:j(r,"right")/t.edgeScrollSpeed})),o&&(M=v("up"===u?{y:0,element:o,duration:j(o,"up")/t.edgeScrollSpeed}:{y:o.scrollHeight-o.clientHeight,element:o,duration:j(o,"down")/t.edgeScrollSpeed}))}function _(e,t){var n=getComputedStyle(e),r="overflow-".concat(t);return e===(document.scrollingElement||document.documentElement)?"visible"===n[r]||"auto"===n[r]||"scroll"===n[r]:"auto"===n[r]||"scroll"===n[r]}function j(e,t){return"up"===t?e.scrollTop:"down"===t?e.scrollHeight-e.scrollTop-e.clientHeight:"left"===t?e.scrollLeft:"right"===t?e.scrollWidth-e.scrollLeft-e.clientWidth:void 0}function N(e){var t=c(e);return e===(document.scrollingElement||document.documentElement)&&(t.top=0,t.left=0),t}},x.afterDrop=function(e,t){t.edgeScroll&&A()},e.default=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(n,L);var i=function(o,i){E.isTouch(o)?n.ontouchstart&&n.ontouchstart(o):n.onmousedown&&n.onmousedown(o);var a=o.target;if(!n.ingoreTags.includes(a.tagName)&&(!d(a,n.undraggableClassName)&&!u(a,(function(t){return!!d(t,n.undraggableClassName)||(t===e?"break":void 0)})))){(t=JSON.parse(JSON.stringify(C))).startEvent=o,t.listenerElement=e,t.directTriggerElement=a,t.initialMouse=Object.assign({},i);var l=!1;if(n.getTriggerElement){var c=n.getTriggerElement(t.directTriggerElement,t);if(!c)return;t.triggerElement=c}else if(n.triggerClassName){var s,f,h=b(r(n.triggerClassName));try{var m=function(){var n=f.value;if(s=u(t.directTriggerElement,(function(t){return!!d(t,n)||(t===e?"break":void 0)}),{withSelf:!0}))return"break"};for(h.s();!(f=h.n()).done;){if("break"===m())break}}catch(e){h.e(e)}finally{h.f()}if(!s)return;t.triggerElement=s}else l=!0;t.movedOrClonedElement=n.getMovedOrClonedElement?n.getMovedOrClonedElement(t.directTriggerElement,t,n):e,t.movedOrClonedElement&&(l&&(t.triggerElement=t.movedOrClonedElement),n.triggerBySelf&&t.triggerElement!==t.directTriggerElement||(E.isTouch(o)||n.preventTextSelection&&o.preventDefault(),E.on(document,"move",p,{touchArgs:[{passive:!1}]}),E.on(window,"end",g)))}};E.on(e,"start",i,{touchArgs:[{passive:!0}]});var p=function(e,r){E.isTouch(e)?n.ontouchmove&&n.ontouchmove(e):n.onmousemove&&n.onmousemove(e);var o=t.movedOrClonedElement,i=t.move={x:r.clientX-t.initialMouse.clientX,y:r.clientY-t.initialMouse.clientY};if(t.moveEvent=e,t.mouse=r,(E.isTouch(e)||n.preventTextSelection)&&e.preventDefault(),0===t.movedCount){if(n.minDisplacement){var a=Math.pow(i.x,2),u=Math.pow(i.y,2);if(Math.pow(a+u,.5)<n.minDisplacement)return}t._isMovingElementCloned=Boolean(n.clone&&(!n.onClone||n.onClone(t,n)));var f=t._isMovingElementCloned?o.cloneNode(!0):o;t._isMovingElementCloned&&f.setAttribute("id",void 0);var d=c(o);t.movedOrClonedElement=o,t.movedElement=f,t.initialPositionRelativeToViewport=d,t.initialPosition=d;if(t.updateMovedElementStyle=function(){t._isMovingElementCloned&&t.movedOrClonedElement.parentElement.appendChild(f);var e=l(f),r={width:"".concat(Math.ceil(e.width),"px"),height:"".concat(Math.ceil(e.height),"px"),zIndex:9999,opacity:.8,position:"fixed",left:d.x+"px",top:d.y+"px",pointerEvents:"none"};for(var o in s(f,"style"),s(f,"class"),s(document.body,"style"),r)f.style[o]=r[o];h(f,n.draggingClassName),document.body.style.cursor="grabbing";var i=c(f);i.x!==d.x&&(d.x=d.x-(i.x-d.x),d.y=d.y-(i.y-d.y),f.style.left=d.x+"px",f.style.top=d.y+"px")},n.beforeFirstMove&&!1===n.beforeFirstMove(t,n))return;if(n.beforeMove&&!1===n.beforeMove(t,n))return;n.updateMovedElementStyleManually||t.updateMovedElementStyle(),x.afterFirstMove(t,n),n.afterFirstMove&&n.afterFirstMove(t,n)}else{if(t.updateMovedElementStyle=function(){Object.assign(t.movedElement.style,{left:t.initialPosition.x+i.x+"px",top:t.initialPosition.y+i.y+"px"})},n.beforeMove&&!1===n.beforeMove(t,n))return;n.updateMovedElementStyleManually||t.updateMovedElementStyle()}x.afterMove(t,n),t.movedCount++,n.afterMove&&n.afterMove(t,n)},g=function e(r){if(E.isTouch(r)?n.ontouchend&&n.ontouchend(r):n.onmousedown&&n.onmousedown(r),E.off(document,"move",p,{touchArgs:[{passive:!1}]}),E.off(window,"end",e),0!==t.movedCount){t.endEvent=r;var o=t.movedElement,i=function(){f(o,"style"),f(o,"class"),f(document.body,"style"),t._isMovingElementCloned&&a(o)};t.updateMovedElementStyle=i,n.beforeDrop&&!1===n.beforeDrop(t,n)||(n.updateMovedElementStyleManually||i(),x.afterDrop(t,n),n.afterDrop&&n.afterDrop(t,n))}},m=function(){E.off(e,"start",i,{touchArgs:[{passive:!0}]}),E.off(document,"move",p,{touchArgs:[{passive:!1}]}),E.off(window,"end",g)};return{destroy:m,options:n}},e.defaultOptions=L,e.initialStore=C,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
*/var b={start:["mousedown","touchstart"],move:["mousemove","touchmove"],end:["mouseup","touchend"]},x={isTouch:function(e){return e.type&&e.type.startsWith("touch")},_getStore:function(e){return e._wrapperStore||(e._wrapperStore=[]),e._wrapperStore},on:function(e,t,n,r){var o,a,l=S(r),c=l.args,u=l.mouseArgs,s=l.touchArgs,f=this._getStore(e),d=this,p=function(e){var r;if(d.isTouch(e))r={x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY,pageX:e.changedTouches[0].pageX,pageY:e.changedTouches[0].pageY,clientX:e.changedTouches[0].clientX,clientY:e.changedTouches[0].clientY,screenX:e.changedTouches[0].screenX,screenY:e.changedTouches[0].screenY};else if(r={x:e.pageX,y:e.pageY,pageX:e.pageX,pageY:e.pageY,clientX:e.clientX,clientY:e.clientY,screenX:e.screenX,screenY:e.screenY},"start"===t&&1!==e.which)return;return n.call(this,e,r)};f.push({handler:n,wrapper:p}),(o=m).call.apply(o,[null,e,b[t][0],p].concat([].concat(i(c),i(u)))),(a=m).call.apply(a,[null,e,b[t][1],p].concat([].concat(i(c),i(s))))},off:function(e,t,n,r){for(var o=S(r),a=o.args,l=o.mouseArgs,c=this._getStore(e),u=c.length-1;u>=0;u--){var s,f,d=c[u],p=d.handler,h=d.wrapper;if(n===p)(s=y).call.apply(s,[null,e,b[t][0],h].concat([].concat(i(a),i(l)))),(f=y).call.apply(f,[null,e,b[t][1],h].concat([].concat(i(a),i(l)))),c.splice(u,1)}}};function S(e){return e||(e={}),{args:e.args||[],mouseArgs:e.mouseArgs||[],touchArgs:e.touchArgs||[]}}function T(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return M(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return M(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var L={afterFirstMove:function(e,t){},afterMove:function(e,t){},afterDrop:function(e,t){}};var C,A,O={ingoreTags:["INPUT","TEXTAREA","SELECT","OPTGROUP","OPTION"],undraggableClassName:"undraggable",minDisplacement:10,draggingClassName:"dragging",clone:!1,updateMovedElementStyleManually:!1,preventTextSelection:!0,edgeScrollTriggerMargin:50,edgeScrollSpeed:.35,edgeScrollTriggerMode:"top_left_corner"},_={movedCount:0};function j(){C&&(C(),C=null),A&&(A(),A=null)}L.afterMove=function(e,t){if(t.edgeScroll){var n=t.edgeScrollTriggerMargin;j();var r,o,i,a,l,u,s,d={x:e.mouse.clientX,y:e.mouse.clientY};if("top_left_corner"===t.edgeScrollTriggerMode){var p=f(e.movedElement);d={x:p.x,y:p.y}}var h;if(t.edgeScrollSpecifiedContainerX)(h="function"==typeof t.edgeScrollSpecifiedContainerX?t.edgeScrollSpecifiedContainerX(e,t):t.edgeScrollSpecifiedContainerX)&&(u=[h]);u||(s=u=E(d.x,d.y));var g,v,m=T(u);try{for(m.s();!(g=m.n()).done;){var y=g.value;if(!i||c(i,y)){if(!r&&y.scrollWidth>y.clientWidth){var b=N(y);d.x<=b.left+n?_(y,"left")>10&&O(y,"x")&&(r=y,a="left"):d.x>=b.left+y.clientWidth-n&&_(y,"right")>10&&O(y,"x")&&(r=y,a="right")}if(r)break;i=y}}}catch(e){m.e(e)}finally{m.f()}if(i=null,u=null,t.edgeScrollSpecifiedContainerY)(v="function"==typeof t.edgeScrollSpecifiedContainerY?t.edgeScrollSpecifiedContainerY(e,t):t.edgeScrollSpecifiedContainerY)&&(u=[v]);u||(u=s||E(d.x,d.y));var x,S=T(u);try{for(S.s();!(x=S.n()).done;){var M=x.value;if(!i||c(i,M)){if(!o&&M.scrollHeight>M.clientHeight){var L=N(M);d.y<=L.top+n?_(M,"up")>10&&O(M,"y")&&(o=M,l="up"):d.y>=L.top+M.clientHeight-n&&_(M,"down")>10&&O(M,"y")&&(o=M,l="down")}if(o)break;i=M}}}catch(e){S.e(e)}finally{S.f()}r&&(C=w("left"===a?{x:0,element:r,duration:_(r,"left")/t.edgeScrollSpeed}:{x:r.scrollWidth-r.clientWidth,element:r,duration:_(r,"right")/t.edgeScrollSpeed})),o&&(A=w("up"===l?{y:0,element:o,duration:_(o,"up")/t.edgeScrollSpeed}:{y:o.scrollHeight-o.clientHeight,element:o,duration:_(o,"down")/t.edgeScrollSpeed}))}function O(e,t){var n=getComputedStyle(e),r="overflow-".concat(t);return e===(document.scrollingElement||document.documentElement)?"visible"===n[r]||"auto"===n[r]||"scroll"===n[r]:"auto"===n[r]||"scroll"===n[r]}function _(e,t){return"up"===t?e.scrollTop:"down"===t?e.scrollHeight-e.scrollTop-e.clientHeight:"left"===t?e.scrollLeft:"right"===t?e.scrollWidth-e.scrollLeft-e.clientWidth:void 0}function N(e){var t=f(e);return e===(document.scrollingElement||document.documentElement)&&(t.top=0,t.left=0),t}},L.afterDrop=function(e,t){t.edgeScroll&&j()},e.default=function(e){var t,o=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};l(i,O);var c=function(n,r){x.isTouch(n)?i.ontouchstart&&i.ontouchstart(n):i.onmousedown&&i.onmousedown(n);var o=n.target;if(!i.ingoreTags.includes(o.tagName)&&!g(o,i.undraggableClassName)){var l=d(o,(function(t){return!!g(t,i.undraggableClassName)||(t===e?"break":void 0)}));if(!l){(t=JSON.parse(JSON.stringify(_))).startEvent=n,t.listenerElement=e,t.directTriggerElement=o,t.initialMouse=Object.assign({},r);var c=!1;if(i.getTriggerElement){var u=i.getTriggerElement(t.directTriggerElement,t);if(!u)return;t.triggerElement=u}else if(i.triggerClassName){var s,f,p=T(a(i.triggerClassName));try{var h=function(){var n=f.value;if(s=d(t.directTriggerElement,(function(t){return!!g(t,n)||(t===e?"break":void 0)}),{withSelf:!0}),s)return"break"};for(p.s();!(f=p.n()).done;){if("break"===h())break}}catch(e){p.e(e)}finally{p.f()}if(!s)return;t.triggerElement=s}else c=!0;t.movedOrClonedElement=i.getMovedOrClonedElement?i.getMovedOrClonedElement(t.directTriggerElement,t,i):e,t.movedOrClonedElement&&(c&&(t.triggerElement=t.movedOrClonedElement),i.triggerBySelf&&t.triggerElement!==t.directTriggerElement||(x.isTouch(n)||i.preventTextSelection&&n.preventDefault(),x.on(document,"move",m,{touchArgs:[{passive:!1}]}),x.on(window,"end",y)))}}};x.on(e,"start",c,{touchArgs:[{passive:!0}]});var m=function(e,n){x.isTouch(e)?i.ontouchmove&&i.ontouchmove(e):i.onmousemove&&i.onmousemove(e);var r=t.movedOrClonedElement,o=t.move={x:n.clientX-t.initialMouse.clientX,y:n.clientY-t.initialMouse.clientY};if(t.moveEvent=e,t.mouse=n,(x.isTouch(e)||i.preventTextSelection)&&e.preventDefault(),0===t.movedCount){if(i.minDisplacement){var a=Math.pow(o.x,2),l=Math.pow(o.y,2);if(Math.pow(a+l,.5)<i.minDisplacement)return}t._isMovingElementCloned=Boolean(i.clone&&(!i.onClone||i.onClone(t,i)));var c=t._isMovingElementCloned?r.cloneNode(!0):r;t._isMovingElementCloned&&c.setAttribute("id",void 0);var u=f(r);t.movedOrClonedElement=r,t.movedElement=c,t.initialPositionRelativeToViewport=u,t.initialPosition=u;if(t.updateMovedElementStyle=function(){t._isMovingElementCloned&&t.movedOrClonedElement.parentElement.appendChild(c);var e=s(c),n={width:"".concat(Math.ceil(e.width),"px"),height:"".concat(Math.ceil(e.height),"px"),zIndex:9999,opacity:.8,position:"fixed",left:u.x+"px",top:u.y+"px",pointerEvents:"none"};for(var r in p(c,"style"),p(c,"class"),p(document.body,"style"),n)c.style[r]=n[r];v(c,i.draggingClassName),document.body.style.cursor="grabbing";var o=f(c);o.x!==u.x&&(u.x=u.x-(o.x-u.x),u.y=u.y-(o.y-u.y),c.style.left=u.x+"px",c.style.top=u.y+"px")},i.beforeFirstMove&&!1===i.beforeFirstMove(t,i))return;if(i.beforeMove&&!1===i.beforeMove(t,i))return;i.updateMovedElementStyleManually||t.updateMovedElementStyle(),L.afterFirstMove(t,i),i.afterFirstMove&&i.afterFirstMove(t,i)}else{if(t.updateMovedElementStyle=function(){Object.assign(t.movedElement.style,{left:t.initialPosition.x+o.x+"px",top:t.initialPosition.y+o.y+"px"})},i.beforeMove&&!1===i.beforeMove(t,i))return;i.updateMovedElementStyleManually||t.updateMovedElementStyle()}L.afterMove(t,i),t.movedCount++,i.afterMove&&i.afterMove(t,i)},y=function e(a){return r(o,void 0,void 0,n.mark((function r(){var o,l;return n.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(x.isTouch(a)?i.ontouchend&&i.ontouchend(a):i.onmousedown&&i.onmousedown(a),x.off(document,"move",m,{touchArgs:[{passive:!1}]}),x.off(window,"end",e),0!==t.movedCount){n.next=5;break}return n.abrupt("return");case 5:if(t.endEvent=a,o=t.movedElement,l=function(){h(o,"style"),h(o,"class"),h(document.body,"style"),t._isMovingElementCloned&&u(o)},t.updateMovedElementStyle=l,n.t0=i.beforeDrop,!n.t0){n.next=15;break}return n.next=13,i.beforeDrop(t,i);case 13:n.t1=n.sent,n.t0=!1===n.t1;case 15:if(!n.t0){n.next=17;break}return n.abrupt("return");case 17:if(i.updateMovedElementStyleManually||l(),L.afterDrop(t,i),n.t2=i.afterDrop,!n.t2){n.next=23;break}return n.next=23,i.afterDrop(t,i);case 23:case"end":return n.stop()}}),r)})))},E=function(){x.off(e,"start",c,{touchArgs:[{passive:!0}]}),x.off(document,"move",m,{touchArgs:[{passive:!1}]}),x.off(window,"end",y)};return{destroy:E,options:i}},e.defaultOptions=O,e.initialStore=_,Object.defineProperty(e,"__esModule",{value:!0})})); |
{ | ||
"name": "draggable-helper", | ||
"version": "6.0.3", | ||
"version": "6.0.4", | ||
"description": "To simplify drag and drop.", | ||
@@ -5,0 +5,0 @@ "main": "dist/draggable-helper.cjs.js", |
@@ -27,4 +27,4 @@ import { EventPosition, MouseOrTouchEvent } from 'drag-event-service'; | ||
afterMove?: (store: Store, opt: Options) => void; | ||
beforeDrop?: (store: Store, opt: Options) => boolean | undefined; | ||
afterDrop?: (store: Store, opt: Options) => void; | ||
beforeDrop?: (store: Store, opt: Options) => boolean | undefined | Promise<boolean>; | ||
afterDrop?: (store: Store, opt: Options) => void | Promise<void>; | ||
preventTextSelection?: boolean; | ||
@@ -31,0 +31,0 @@ edgeScroll?: boolean; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
146687
3027