@marsio/vue-draggable 1.0.2 → 1.0.3
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/README.md +86 -46
- package/build/cjs/Draggable.js +57 -25
- package/build/cjs/DraggableCore.js +44 -21
- package/build/cjs/utils/domFns.js +221 -97
- package/build/cjs/utils/log.js +2 -3
- package/build/cjs/utils/positionFns.js +86 -68
- package/build/cjs/utils/shims.js +45 -6
- package/build/cjs/utils/types.js +10 -2
- package/build/web/vue-draggable.min.js +1 -2
- package/package.json +33 -11
- package/LICENSE +0 -21
- package/build/cjs/utils/test.js +0 -12
- package/build/web/vue-draggable.min.js.LICENSE.txt +0 -6
package/build/cjs/utils/shims.js
CHANGED
|
@@ -8,9 +8,18 @@ exports.findInArray = findInArray;
|
|
|
8
8
|
exports.int = int;
|
|
9
9
|
exports.isFunction = isFunction;
|
|
10
10
|
exports.isNum = isNum;
|
|
11
|
-
exports.
|
|
11
|
+
exports.propIsNotNode = propIsNotNode;
|
|
12
12
|
var _vueTypes = _interopRequireDefault(require("vue-types"));
|
|
13
|
-
function _interopRequireDefault(
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
/**
|
|
15
|
+
* Searches for an element in an array or TouchList that satisfies the provided callback function.
|
|
16
|
+
* @param {T[] | TouchList} array - The array or TouchList to search.
|
|
17
|
+
* @param {(element: T, index: number, arr: T[] | TouchList) => boolean} callback - A function that accepts up to three arguments.
|
|
18
|
+
* The findInArray method calls the callback function one time for each element in the array, in order, until the callback returns true.
|
|
19
|
+
* If such an element is found, findInArray immediately returns that element value. Otherwise, findInArray returns undefined.
|
|
20
|
+
* @returns {any} The found element in the array, or undefined if not found.
|
|
21
|
+
*/
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
23
|
function findInArray(array, callback) {
|
|
15
24
|
for (let i = 0, length = array.length; i < length; i++) {
|
|
16
25
|
const element = array instanceof TouchList ? array.item(i) : array[i];
|
|
@@ -18,22 +27,52 @@ function findInArray(array, callback) {
|
|
|
18
27
|
return element;
|
|
19
28
|
}
|
|
20
29
|
}
|
|
21
|
-
return undefined;
|
|
22
30
|
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Checks if the passed argument is a function.
|
|
34
|
+
* @param {unknown} func - The argument to check.
|
|
35
|
+
* @returns {boolean} True if the argument is a function, false otherwise.
|
|
36
|
+
*/
|
|
23
37
|
function isFunction(func) {
|
|
24
38
|
return typeof func === 'function' || Object.prototype.toString.call(func) === '[object Function]';
|
|
25
39
|
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Checks if the passed argument is a number.
|
|
43
|
+
* @param {unknown} num - The argument to check.
|
|
44
|
+
* @returns {boolean} True if the argument is a number and not NaN, false otherwise.
|
|
45
|
+
*/
|
|
26
46
|
function isNum(num) {
|
|
27
47
|
return typeof num === 'number' && !isNaN(num);
|
|
28
48
|
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Converts a string to an integer.
|
|
52
|
+
* @param {string} a - The string to convert.
|
|
53
|
+
* @returns {number} The converted integer.
|
|
54
|
+
*/
|
|
29
55
|
function int(a) {
|
|
30
56
|
return parseInt(a, 10);
|
|
31
57
|
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Creates a custom Vue prop type that fails validation.
|
|
61
|
+
* @param {string} propsName - The name of the prop.
|
|
62
|
+
* @param {string} componentName - The name of the component.
|
|
63
|
+
* @returns {VueTypeDef<T>} A VueTypeDef that always fails validation.
|
|
64
|
+
*/
|
|
32
65
|
function dontSetMe(propsName, componentName) {
|
|
33
|
-
const
|
|
66
|
+
const failedPropType = () => !propsName;
|
|
34
67
|
const message = `Invalid prop ${propsName} passed to ${componentName} - do not set this, set it on the child.`;
|
|
35
|
-
return _vueTypes.default.custom(
|
|
68
|
+
return _vueTypes.default.custom(failedPropType, message);
|
|
36
69
|
}
|
|
37
|
-
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Checks if the passed argument is a DOM Node but not a text node.
|
|
73
|
+
* @param {unknown} node - The argument to check.
|
|
74
|
+
* @returns {boolean} True if the argument is a DOM Node and not a text node, false otherwise.
|
|
75
|
+
*/
|
|
76
|
+
function propIsNotNode(node) {
|
|
38
77
|
return typeof node === 'object' && node !== null && 'nodeType' in node && node.nodeType === 1;
|
|
39
78
|
}
|
package/build/cjs/utils/types.js
CHANGED
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.TouchEvent2 = exports.SVGElement = void 0;
|
|
7
|
-
function _defineProperty(
|
|
8
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
|
7
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
9
9
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
10
|
class SVGElement extends HTMLElement {}
|
|
11
11
|
|
|
@@ -18,4 +18,12 @@ class TouchEvent2 extends TouchEvent {
|
|
|
18
18
|
_defineProperty(this, "targetTouches", void 0);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
+
|
|
22
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
23
|
+
|
|
24
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
25
|
+
|
|
26
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
27
|
+
|
|
28
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
21
29
|
exports.TouchEvent2 = TouchEvent2;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
/*! For license information please see vue-draggable.min.js.LICENSE.txt */
|
|
2
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("vue")):"function"==typeof define&&define.amd?define(["vue"],e):"object"==typeof exports?exports.VueDraggable=e(require("vue")):t.VueDraggable=e(t.Vue)}(self,(t=>(()=>{var e={6611:(t,e,n)=>{"use strict";n.r(e),n.d(e,{DraggableCore:()=>Ot,default:()=>jt,draggableProps:()=>_t});var r=n(8976),o=n(7361),a=n.n(o);function i(t){return"[object Object]"===Object.prototype.toString.call(t)}function s(){return s=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},s.apply(this,arguments)}function u(t,e){if(null==t)return{};var n,r,o={},a=Object.keys(t);for(r=0;r<a.length;r++)e.indexOf(n=a[r])>=0||(o[n]=t[n]);return o}const l={silent:!1,logLevel:"warn"},c=["validator"],f=Object.prototype,d=f.toString,p=f.hasOwnProperty,y=/^\s*function (\w+)/;function g(t){var e;const n=null!==(e=null==t?void 0:t.type)&&void 0!==e?e:t;if(n){const t=n.toString().match(y);return t?t[1]:""}return""}const h=function(t){var e,n;return!1!==i(t)&&(void 0===(e=t.constructor)||!1!==i(n=e.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))};let v=t=>t;const b=(t,e)=>p.call(t,e),m=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},x=Array.isArray||function(t){return"[object Array]"===d.call(t)},O=t=>"[object Function]"===d.call(t),_=(t,e)=>h(t)&&b(t,"_vueTypes_name")&&(!e||t._vueTypes_name===e),w=t=>h(t)&&(b(t,"type")||["_vueTypes_name","validator","default","required"].some((e=>b(t,e))));function j(t,e){return Object.defineProperty(t.bind(e),"__original",{value:t})}function T(t,e,n=!1){let r,o=!0,a="";r=h(t)?t:{type:t};const i=_(r)?r._vueTypes_name+" - ":"";if(w(r)&&null!==r.type){if(void 0===r.type||!0===r.type)return o;if(!r.required&&null==e)return o;x(r.type)?(o=r.type.some((t=>!0===T(t,e,!0))),a=r.type.map((t=>g(t))).join(" or ")):(a=g(r),o="Array"===a?x(e):"Object"===a?h(e):"String"===a||"Number"===a||"Boolean"===a||"Function"===a?function(t){if(null==t)return"";const e=t.constructor.toString().match(y);return e?e[1].replace(/^Async/,""):""}(e)===a:e instanceof r.type)}if(!o){const t=`${i}value "${e}" should be of type "${a}"`;return!1===n?(v(t),!1):t}if(b(r,"validator")&&O(r.validator)){const t=v,a=[];if(v=t=>{a.push(t)},o=r.validator(e),v=t,!o){const t=(a.length>1?"* ":"")+a.join("\n* ");return a.length=0,!1===n?(v(t),o):t}}return o}function S(t,e){const n=Object.defineProperties(e,{_vueTypes_name:{value:t,writable:!0},isRequired:{get(){return this.required=!0,this}},def:{value(t){return void 0===t?this.type===Boolean||Array.isArray(this.type)&&this.type.includes(Boolean)?void(this.default=void 0):(b(this,"default")&&delete this.default,this):O(t)||!0===T(this,t,!0)?(this.default=x(t)?()=>[...t]:h(t)?()=>Object.assign({},t):t,this):(v(`${this._vueTypes_name} - invalid default value: "${t}"`),this)}}}),{validator:r}=n;return O(r)&&(n.validator=j(r,n)),n}function $(t,e){const n=S(t,e);return Object.defineProperty(n,"validate",{value(t){return O(this.validator)&&v(`${this._vueTypes_name} - calling .validate() will overwrite the current custom validator function. Validator info:\n${JSON.stringify(this)}`),this.validator=j(t,this),this}})}function D(t,e,n){const r=function(t){const e={};return Object.getOwnPropertyNames(t).forEach((n=>{e[n]=Object.getOwnPropertyDescriptor(t,n)})),Object.defineProperties({},e)}(e);if(r._vueTypes_name=t,!h(n))return r;const{validator:o}=n,a=u(n,c);if(O(o)){let{validator:t}=r;t&&(t=null!==(s=(i=t).__original)&&void 0!==s?s:i),r.validator=j(t?function(e){return t.call(this,e)&&o.call(this,e)}:o,r)}var i,s;return Object.assign(r,a)}function N(t){return t.replace(/^(?!\s*$)/gm," ")}const E=()=>$("boolean",{type:Boolean});function P(t,e="custom validation failed"){if("function"!=typeof t)throw new TypeError("[VueTypes error]: You must provide a function as argument");return S(t.name||"<<anonymous function>>",{type:null,validator(n){const r=t(n);return r||v(`${this._vueTypes_name} - ${e}`),r}})}function M(t){if(!x(t))throw new TypeError("[VueTypes error]: You must provide an array as argument.");const e=`oneOf - value should be one of "${t.map((t=>"symbol"==typeof t?t.toString():t)).join('", "')}".`,n={validator(n){const r=-1!==t.indexOf(n);return r||v(e),r}};if(-1===t.indexOf(null)){const e=t.reduce(((t,e)=>{if(null!=e){const n=e.constructor;-1===t.indexOf(n)&&t.push(n)}return t}),[]);e.length>0&&(n.type=e)}return S("oneOf",n)}function A(t){if(!x(t))throw new TypeError("[VueTypes error]: You must provide an array as argument");let e=!1,n=!1,r=[];for(let o=0;o<t.length;o+=1){const a=t[o];if(w(a)){if(O(a.validator)&&(e=!0),_(a,"oneOf")&&a.type){r=r.concat(a.type);continue}if(_(a,"nullable")){n=!0;continue}if(!0===a.type||!a.type){v('oneOfType - invalid usage of "true" and "null" as types.');continue}r=r.concat(a.type)}else r.push(a)}r=r.filter(((t,e)=>r.indexOf(t)===e));const o=!1===n&&r.length>0?r:null;return S("oneOfType",e?{type:o,validator(e){const n=[],r=t.some((t=>{const r=T(t,e,!0);return"string"==typeof r&&n.push(r),!0===r}));return r||v(`oneOfType - provided value does not match any of the ${n.length} passed-in validators:\n${N(n.join("\n"))}`),r}}:{type:o})}function C(t){return S("arrayOf",{type:Array,validator(e){let n="";const r=e.every((e=>(n=T(t,e,!0),!0===n)));return r||v(`arrayOf - value validation error:\n${N(n)}`),r}})}function k(t){return S("instanceOf",{type:t})}function Y(t){return S("objectOf",{type:Object,validator(e){let n="";const r=Object.keys(e).every((r=>(n=T(t,e[r],!0),!0===n)));return r||v(`objectOf - value validation error:\n${N(n)}`),r}})}function F(t){const e=Object.keys(t),n=e.filter((e=>{var n;return!(null===(n=t[e])||void 0===n||!n.required)})),r=S("shape",{type:Object,validator(r){if(!h(r))return!1;const o=Object.keys(r);if(n.length>0&&n.some((t=>-1===o.indexOf(t)))){const t=n.filter((t=>-1===o.indexOf(t)));return v(1===t.length?`shape - required property "${t[0]}" is not defined.`:`shape - required properties "${t.join('", "')}" are not defined.`),!1}return o.every((n=>{if(-1===e.indexOf(n))return!0===this._vueTypes_isLoose||(v(`shape - shape definition does not include a "${n}" property. Allowed keys: "${e.join('", "')}".`),!1);const o=T(t[n],r[n],!0);return"string"==typeof o&&v(`shape - "${n}" property validation error:\n ${N(o)}`),!0===o}))}});return Object.defineProperty(r,"_vueTypes_isLoose",{writable:!0,value:!1}),Object.defineProperty(r,"loose",{get(){return this._vueTypes_isLoose=!0,this}}),r}const V=["name","validate","getter"],X=(()=>{var t;return(t=class{static get any(){return $("any",{})}static get func(){return $("function",{type:Function}).def(this.defaults.func)}static get bool(){return void 0===this.defaults.bool?E():E().def(this.defaults.bool)}static get string(){return $("string",{type:String}).def(this.defaults.string)}static get number(){return $("number",{type:Number}).def(this.defaults.number)}static get array(){return $("array",{type:Array}).def(this.defaults.array)}static get object(){return $("object",{type:Object}).def(this.defaults.object)}static get integer(){return S("integer",{type:Number,validator(t){const e=m(t);return!1===e&&v(`integer - "${t}" is not an integer`),e}}).def(this.defaults.integer)}static get symbol(){return S("symbol",{validator(t){const e="symbol"==typeof t;return!1===e&&v(`symbol - invalid value "${t}"`),e}})}static get nullable(){return Object.defineProperty({type:null,validator(t){const e=null===t;return!1===e&&v("nullable - value should be null"),e}},"_vueTypes_name",{value:"nullable"})}static extend(t){if(v("VueTypes.extend is deprecated. Use the ES6+ method instead. See https://dwightjack.github.io/vue-types/advanced/extending-vue-types.html#extending-namespaced-validators-in-es6 for details."),x(t))return t.forEach((t=>this.extend(t))),this;const{name:e,validate:n=!1,getter:r=!1}=t,o=u(t,V);if(b(this,e))throw new TypeError(`[VueTypes error]: Type "${e}" already defined`);const{type:a}=o;if(_(a))return delete o.type,Object.defineProperty(this,e,r?{get:()=>D(e,a,o)}:{value(...t){const n=D(e,a,o);return n.validator&&(n.validator=n.validator.bind(n,...t)),n}});let i;return i=r?{get(){const t=Object.assign({},o);return n?$(e,t):S(e,t)},enumerable:!0}:{value(...t){const r=Object.assign({},o);let a;return a=n?$(e,r):S(e,r),r.validator&&(a.validator=r.validator.bind(a,...t)),a},enumerable:!0},Object.defineProperty(this,e,i)}}).defaults={},t.sensibleDefaults=void 0,t.config=l,t.custom=P,t.oneOf=M,t.instanceOf=k,t.oneOfType=A,t.arrayOf=C,t.objectOf=Y,t.shape=F,t.utils={validate:(t,e)=>!0===T(e,t,!0),toType:(t,e,n=!1)=>n?$(t,e):S(t,e)},t})();class L extends(function(t={func:()=>{},bool:!0,string:"",number:0,array:()=>[],object:()=>({}),integer:0}){var e;return(e=class extends X{static get sensibleDefaults(){return s({},this.defaults)}static set sensibleDefaults(e){this.defaults=!1!==e?s({},!0!==e?e:t):{}}}).defaults=s({},t),e}()){}function z(t){var e,n,r="";if("string"==typeof t||"number"==typeof t)r+=t;else if("object"==typeof t)if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=z(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}const B=["Moz","Webkit","O","ms"];function R(t,e){return e?`${e}${function(t){let e="",n=!0;for(let r=0;r<t.length;r++)n?(e+=t[r].toUpperCase(),n=!1):"-"===t[r]?n=!0:e+=t[r];return e}(t)}`:t}const q=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"==typeof window||void 0===window.document)return"";const e=window.document.documentElement.style;if(t in e)return"";for(let n=0;n<B.length;n++)if(R(t,B[n])in e)return B[n];return""}();function U(t,e){for(let n=0,r=t.length;n<r;n++){const r=t instanceof TouchList?t.item(n):t[n];if(null!==r&&e(r,n,t))return r}}function H(t){return"function"==typeof t||"[object Function]"===Object.prototype.toString.call(t)}function I(t){return"number"==typeof t&&!isNaN(t)}function W(t){return parseInt(t,10)}function G(t,e){const n=`Invalid prop ${t} passed to ${e} - do not set this, set it on the child.`;return L.custom((()=>!t),n)}let J="";function K(t,e){return J||(J=U(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],(function(e){return H(t[e])}))),!!H(t[J])&&t[J](e)}function Q(t,e,n){let r=t;do{if(K(r,e))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function Z(t,e,n,r){if(!t)return;const o={capture:!0,...r};t.addEventListener?t.addEventListener(e,n,o):t.attachEvent?t.attachEvent(`on${e}`,n):t[`on${e}`]=n}function tt(t,e,n,r){if(!t)return;const o={capture:!0,...r};t.removeEventListener?t.removeEventListener(e,n,o):t.detachEvent?t.detachEvent("on"+e,n):t[`on${e}`]=null}function et(t){let e=t.clientHeight;const n=t.ownerDocument.defaultView?.getComputedStyle(t);return e+=W(n.borderTopWidth),e+=W(n.borderBottomWidth),e}function nt(t){let e=t.clientWidth;const n=t.ownerDocument?.defaultView?.getComputedStyle(t);return e+=W(n.borderLeftWidth),e+=W(n.borderRightWidth),e}function rt(t){let e=t.clientHeight;const n=t.ownerDocument?.defaultView?.getComputedStyle(t);return e-=W(n.paddingTop),e-=W(n.paddingBottom),e}function ot(t){let e=t.clientWidth;const n=t.ownerDocument?.defaultView?.getComputedStyle(t);return e-=W(n.paddingLeft),e-=W(n.paddingRight),e}function at(t,e,n){let{x:r,y:o}=t,a=`translate(${r}${n},${o}${n})`;return e&&(a=`translate(${"string"==typeof e.x?e.x:e.x+n}, ${"string"==typeof e.y?e.y:e.y+n})`+a),a}function it(t){var e,n;if(t)try{if(t.body&&(e=t.body,n="vue-draggable-transparent-selection",e.classList?e.classList.remove(n):e.className=e.className.replace(new RegExp(`(?:^|\\s)${n}(?!\\S)`,"g"),"")),t.selection)t.selection.empty();else{const e=(t.defaultView||window).getSelection();e&&"Caret"!==e.type&&e.removeAllRanges()}}catch(t){}}function st(t,e,n){if(!t.props.bounds)return[e,n];let r=t.props.bounds;r="string"==typeof r?r:function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}(r);const o=yt(t),{ownerDocument:i}=o,s=a()(o,"ownerWindow");if(a()(o,"ownerWindow.defaultView")&&"string"==typeof r){let t;if(t="parent"===r?o.parentNode:i.querySelector(r),!(t instanceof s.HTMLElement))throw new Error(`Bounds selector ${r} could not find an element.`);const e=s.getComputedStyle(o),n=s.getComputedStyle(t);r={left:-o.offsetLeft+W(n.paddingLeft)+W(e.marginLeft),top:-o.offsetTop+W(n.paddingTop)+W(e.marginTop),right:ot(t)-nt(o)-o.offsetLeft+W(n.paddingRight)-W(e.marginRight),bottom:rt(t)-et(o)-o.offsetTop+W(n.paddingBottom)-W(e.marginBottom)}}return I(r.right)&&(e=Math.min(e,r.right)),I(r.bottom)&&(n=Math.min(n,r.bottom)),I(r.left)&&(e=Math.max(e,r.left)),I(r.top)&&(n=Math.max(n,r.top)),[e,n]}function ut(t,e,n){return[Math.round(e/t[0])*t[0],Math.round(n/t[1])*t[1]]}function lt(t){return"both"===t.props.axis||"x"===t.props.axis}function ct(t){return"both"===t.props.axis||"y"===t.props.axis}function ft(t,e,n){const r="number"==typeof n?function(t,e){return t.targetTouches&&U(t.targetTouches,(t=>e===t.identifier))||t.changedTouches&&U(t.changedTouches,(t=>e===t.identifier))}(t,n):null;if("number"==typeof n&&!r)return null;const o=yt(e);return function(t,e,n){const r=e===e.ownerDocument.body?{left:0,top:0}:e.getBoundingClientRect();return{x:(t.clientX+e.scrollLeft-r.left)/n,y:(t.clientY+e.scrollTop-r.top)/n}}(r||t,e.props.offsetParent||o.offsetParent||o.ownerDocument.body,e.props.scale)}function dt(t,e,n){const r=t.state,o=!I(r.lastX),a=yt(t);return o?{node:a,deltaX:0,deltaY:0,lastX:e,lastY:n,x:e,y:n}:{node:a,deltaX:e-r.lastX,deltaY:n-r.lastY,lastX:r.lastX,lastY:r.lastY,x:e,y:n}}function pt(t,e){const n=t.props.scale;return{node:e.node,x:t.state.x+e.deltaX/n,y:t.state.y+e.deltaY/n,deltaX:e.deltaX/n,deltaY:e.deltaY/n,lastX:t.state.x,lastY:t.state.y}}function yt(t){const e=t.findDOMNode();if(!e)throw new Error("<DraggableCore>: Unmounted during event!");return e}const gt={start:"touchstart",move:"touchmove",stop:"touchend"},ht={start:"mousedown",move:"mousemove",stop:"mouseup"},vt=(t,e)=>!0,bt=function(){};let mt=ht;const xt={allowAnyClick:L.bool.def(!1),disabled:L.bool.def(!1),enableUserSelectHack:L.bool.def(!0),startFn:L.func.def(vt).def(bt),dragFn:L.func.def(vt).def(bt),stopFn:L.func.def(vt).def(bt),scale:L.number.def(1),cancel:L.string,offsetParent:L.custom((function(t){return"object"==typeof t&&null!==t&&"nodeType"in t&&1===t.nodeType}),"Draggable's offsetParent must be a DOM Node."),grid:L.arrayOf(L.number),handle:L.string,nodeRef:L.object.def(null)},Ot=(0,r.defineComponent)({compatConfig:{MODE:3},name:"DraggableCore",inheritAttrs:!1,props:{...xt},setup(t,e){let{slots:n,emit:o}=e;const i=(0,r.ref)(null),s=(0,r.reactive)({dragging:!1,lastX:NaN,lastY:NaN,touchIdentifier:null,mounted:!1}),u=()=>a()(t,"nodeRef.value")||i.value,l=e=>{const n=ft(e,{props:t,findDOMNode:u},s.touchIdentifier);if(null==n)return;let{x:r,y:o}=n;if(Array.isArray(t.grid)){let e=r-s.lastX,n=o-s.lastY;if([e,n]=ut(t.grid,e,n),!e&&!n)return;r=s.lastX+e,o=s.lastY+n}const a=dt({props:t,findDOMNode:u,state:s},r,o),i=t.dragFn?.(e,a);if(!1!==i&&!1!==s.mounted)s.lastX=r,s.lastY=o;else try{c(new MouseEvent("mouseup"))}catch(t){const e=document.createEvent("MouseEvents");e.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),c(e)}},c=e=>{if(!s.dragging)return;const n=ft(e,{props:t,findDOMNode:u},s.touchIdentifier);if(null==n)return;let{x:r,y:o}=n;if(Array.isArray(t.grid)){let e=r-s.lastX||0,n=o-s.lastY||0;[e,n]=ut(t.grid,e,n),r=s.lastX+e,o=s.lastY+n}const a=dt({props:t,findDOMNode:u,state:s},r,o),i=t.stopFn?.(e,a);if(!1===i||!1===s.mounted)return!1;const f=u();f&&t.enableUserSelectHack&&it(f.ownerDocument),s.dragging=!1,s.lastX=NaN,s.lastY=NaN,f&&(tt(f.ownerDocument,mt.move,l),tt(f.ownerDocument,mt.stop,c))},f=e=>{if(o("mousedown",e),!t.allowAnyClick&&"number"==typeof e.button&&0!==e.button)return!1;const n=u();if(!a()(n,"ownerDocument.body"))throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(t.disabled||!(e.target instanceof r.defaultView.Node)||t.handle&&!Q(e.target,t.handle,n)||t.cancel&&Q(e.target,t.cancel,n))return;"touchstart"===e.type&&e.preventDefault();const i=function(t){return t.targetTouches&&t.targetTouches[0]?t.targetTouches[0].identifier:t.changedTouches&&t.changedTouches[0]?t.changedTouches[0].identifier:void 0}(e);s.touchIdentifier=i;const f=ft(e,{props:t,findDOMNode:u},i);if(null==f)return;const{x:d,y:p}=f,y=dt({props:t,findDOMNode:u,state:s},d,p);t.startFn,!1!==t.startFn(e,y)&&!1!==s.mounted&&(t.enableUserSelectHack&&function(t){if(!t)return;let e=t.getElementById("vue-draggable-style-el");var n,r;e||(e=t.createElement("style"),e.type="text/css",e.id="vue-draggable-style-el",e.innerHTML=".vue-draggable-transparent-selection *::-moz-selection {all: inherit;}\n",e.innerHTML+=".vue-draggable-transparent-selection *::selection {all: inherit;}\n",t.getElementsByTagName("head")[0].appendChild(e)),t.body&&(r="vue-draggable-transparent-selection",(n=t.body).classList?n.classList.add(r):n.className.match(new RegExp(`(?:^|\\s)${r}(?!\\S)`))||(n.className+=` ${r}`))}(r),s.dragging=!0,s.lastX=d,s.lastY=p,Z(r,mt.move,l),Z(r,mt.stop,c))},d=t=>(mt=ht,f(t)),p=t=>(mt=ht,c(t)),y=t=>(mt=gt,f(t)),g=t=>(mt=gt,c(t));return(0,r.onMounted)((()=>{s.mounted=!0;const t=u();t&&Z(t,gt.start,y,{passive:!1})})),(0,r.onUnmounted)((()=>{s.mounted=!1;const e=u();if(e){const{ownerDocument:n}=e;tt(n,ht.move,l),tt(n,gt.move,l),tt(n,ht.stop,c),tt(n,gt.stop,c),tt(e,gt.start,y,{passive:!1}),t.enableUserSelectHack&&it(n)}})),()=>{let t=(0,r.renderSlot)(n,"default").children;Array.isArray(t)||(t=[]);const e=a()(t,"0.children[0]");return(0,r.isVNode)(e)?(0,r.cloneVNode)(e,{onMousedown:d,onMouseup:p,onTouchend:g,ref:i}):e}}}),_t={...xt,axis:L.oneOf(["both","x","y","none"]).def("both"),bounds:L.oneOfType([L.shape({left:L.number,right:L.number,top:L.number,bottom:L.number}),L.string,L.oneOf([!1])]).def(!1),defaultClassName:L.string.def("vue-draggable"),defaultClassNameDragging:L.string.def("vue-draggable-dragging"),defaultClassNameDragged:L.string.def("vue-draggable-dragged"),defaultPosition:L.shape({x:L.number,y:L.number}).def({x:0,y:0}),positionOffset:L.shape({x:L.oneOfType([L.number,L.string]),y:L.oneOfType([L.number,L.string])}),position:L.shape({x:L.number,y:L.number}).def(null)},wt="Draggable",jt=(0,r.defineComponent)({compatConfig:{MODE:3},name:wt,inheritAttrs:!1,props:{..._t,style:G("style",wt),class:G("class",wt),transform:G("transform",wt)},setup(t,e){let{slots:n}=e;const o=(0,r.ref)(null);!t.position||t.dragFn||t.stopFn||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.");const i=(0,r.reactive)({dragging:!1,dragged:!1,x:t.position?t.position.x:t.defaultPosition.x,y:t.position?t.position.y:t.defaultPosition.y,prevPropsPosition:{...t.position},slackX:0,slackY:0,isElementSVG:!1}),s=()=>a()(t,"nodeRef.value")||o.value;(0,r.onMounted)((()=>{void 0!==window.SVGElement&&s()instanceof window.SVGElement&&(i.isElementSVG=!0)})),(0,r.onUnmounted)((()=>{i.dragging=!1}));const u=(e,n)=>{if(!1===t.startFn(e,pt({props:t,state:i},n)))return!1;i.dragging=!0,i.dragged=!0},l=(e,n)=>{if(!i.dragging)return!1;const r=pt({props:t,state:i},n),o={x:r.x,y:r.y,slackX:0,slackY:0};if(t.bounds){const{x:e,y:n}=o;o.x+=i.slackX,o.y+=i.slackY;const[a,u]=st({props:t,findDOMNode:s},o.x,o.y);o.x=a,o.y=u,o.slackX=i.slackX+(e-o.x),o.slackY=i.slackY+(n-o.y),r.x=o.x,r.y=o.y,r.deltaX=o.x-i.x,r.deltaY=o.y-i.y}if(!1===t.dragFn(e,r))return!1;Object.keys(o).forEach((t=>{i[t]=o[t]}))},c=(e,n)=>{if(!i.dragging)return!1;if(!1===t.stopFn(e,pt({props:t,state:i},n)))return!1;const r={dragging:!1,slackX:0,slackY:0};if(Boolean(t.position)){const{x:e,y:n}=t.position;r.x=e,r.y=n}Object.keys(r).forEach((t=>{i[t]=r[t]}))};return()=>{const{axis:e,bounds:a,defaultPosition:s,defaultClassName:f,defaultClassNameDragging:d,defaultClassNameDragged:p,position:y,positionOffset:g,scale:h,...v}=t;let b={},m=null;const x=!Boolean(y)||i.dragging,O=y||s,_={x:lt({props:t})&&x?i.x:O.x,y:ct({props:t})&&x?i.y:O.y};i.isElementSVG?m=function(t,e){return at(t,e,"")}(_,g):b=function(t,e){const n=at(t,e,"px");return{[R("transform",q)]:n}}(_,g);let w=(0,r.renderSlot)(n,"default").children;Array.isArray(w)||(w=[]);const j=function(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=z(t))&&(r&&(r+=" "),r+=e);return r}(f,{[d]:i.dragging,[p]:i.dragged}),T=w.flatMap((t=>(0,r.isVNode)(t)?(0,r.cloneVNode)(t,{class:j,style:b,transform:m}):t)),S={...v,startFn:u,dragFn:l,stopFn:c};return(0,r.createVNode)(Ot,(0,r.mergeProps)({ref:o},S),function(t){return"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!(0,r.isVNode)(t)}(T)?T:{default:()=>[T]})}}})},8839:(t,e,n)=>{const{default:r,DraggableCore:o}=n(6611);t.exports=r,t.exports.default=r,t.exports.DraggableCore=o},1989:(t,e,n)=>{var r=n(1789),o=n(401),a=n(7667),i=n(1327),s=n(1866);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=i,u.prototype.set=s,t.exports=u},8407:(t,e,n)=>{var r=n(7040),o=n(4125),a=n(2117),i=n(7518),s=n(4705);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=i,u.prototype.set=s,t.exports=u},7071:(t,e,n)=>{var r=n(852)(n(5639),"Map");t.exports=r},3369:(t,e,n)=>{var r=n(4785),o=n(1285),a=n(6e3),i=n(9916),s=n(5265);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=i,u.prototype.set=s,t.exports=u},2705:(t,e,n)=>{var r=n(5639).Symbol;t.exports=r},9932:t=>{t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}},8470:(t,e,n)=>{var r=n(7813);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},7786:(t,e,n)=>{var r=n(1811),o=n(327);t.exports=function(t,e){for(var n=0,a=(e=r(e,t)).length;null!=t&&n<a;)t=t[o(e[n++])];return n&&n==a?t:void 0}},4239:(t,e,n)=>{var r=n(2705),o=n(9607),a=n(2333),i=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":i&&i in Object(t)?o(t):a(t)}},8458:(t,e,n)=>{var r=n(3560),o=n(5346),a=n(3218),i=n(346),s=/^\[object .+?Constructor\]$/,u=Function.prototype,l=Object.prototype,c=u.toString,f=l.hasOwnProperty,d=RegExp("^"+c.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!a(t)||o(t))&&(r(t)?d:s).test(i(t))}},531:(t,e,n)=>{var r=n(2705),o=n(9932),a=n(1469),i=n(3448),s=r?r.prototype:void 0,u=s?s.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(a(e))return o(e,t)+"";if(i(e))return u?u.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}},1811:(t,e,n)=>{var r=n(1469),o=n(5403),a=n(5514),i=n(9833);t.exports=function(t,e){return r(t)?t:o(t,e)?[t]:a(i(t))}},4429:(t,e,n)=>{var r=n(5639)["__core-js_shared__"];t.exports=r},1957:(t,e,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},5050:(t,e,n)=>{var r=n(7019);t.exports=function(t,e){var n=t.__data__;return r(e)?n["string"==typeof e?"string":"hash"]:n.map}},852:(t,e,n)=>{var r=n(8458),o=n(7801);t.exports=function(t,e){var n=o(t,e);return r(n)?n:void 0}},9607:(t,e,n)=>{var r=n(2705),o=Object.prototype,a=o.hasOwnProperty,i=o.toString,s=r?r.toStringTag:void 0;t.exports=function(t){var e=a.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(t){}var o=i.call(t);return r&&(e?t[s]=n:delete t[s]),o}},7801:t=>{t.exports=function(t,e){return null==t?void 0:t[e]}},1789:(t,e,n)=>{var r=n(4536);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},401:t=>{t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},7667:(t,e,n)=>{var r=n(4536),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(r){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(e,t)?e[t]:void 0}},1327:(t,e,n)=>{var r=n(4536),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return r?void 0!==e[t]:o.call(e,t)}},1866:(t,e,n)=>{var r=n(4536);t.exports=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=r&&void 0===e?"__lodash_hash_undefined__":e,this}},5403:(t,e,n)=>{var r=n(1469),o=n(3448),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i=/^\w*$/;t.exports=function(t,e){if(r(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!o(t))||i.test(t)||!a.test(t)||null!=e&&t in Object(e)}},7019:t=>{t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},5346:(t,e,n)=>{var r,o=n(4429),a=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!a&&a in t}},7040:t=>{t.exports=function(){this.__data__=[],this.size=0}},4125:(t,e,n)=>{var r=n(8470),o=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0||(n==e.length-1?e.pop():o.call(e,n,1),--this.size,0))}},2117:(t,e,n)=>{var r=n(8470);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},7518:(t,e,n)=>{var r=n(8470);t.exports=function(t){return r(this.__data__,t)>-1}},4705:(t,e,n)=>{var r=n(8470);t.exports=function(t,e){var n=this.__data__,o=r(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this}},4785:(t,e,n)=>{var r=n(1989),o=n(8407),a=n(7071);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(a||o),string:new r}}},1285:(t,e,n)=>{var r=n(5050);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},6e3:(t,e,n)=>{var r=n(5050);t.exports=function(t){return r(this,t).get(t)}},9916:(t,e,n)=>{var r=n(5050);t.exports=function(t){return r(this,t).has(t)}},5265:(t,e,n)=>{var r=n(5050);t.exports=function(t,e){var n=r(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this}},4523:(t,e,n)=>{var r=n(8306);t.exports=function(t){var e=r(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}},4536:(t,e,n)=>{var r=n(852)(Object,"create");t.exports=r},2333:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},5639:(t,e,n)=>{var r=n(1957),o="object"==typeof self&&self&&self.Object===Object&&self,a=r||o||Function("return this")();t.exports=a},5514:(t,e,n)=>{var r=n(4523),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,i=r((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(o,(function(t,n,r,o){e.push(r?o.replace(a,"$1"):n||t)})),e}));t.exports=i},327:(t,e,n)=>{var r=n(3448);t.exports=function(t){if("string"==typeof t||r(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},346:t=>{var e=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return e.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},7813:t=>{t.exports=function(t,e){return t===e||t!=t&&e!=e}},7361:(t,e,n)=>{var r=n(7786);t.exports=function(t,e,n){var o=null==t?void 0:r(t,e);return void 0===o?n:o}},1469:t=>{var e=Array.isArray;t.exports=e},3560:(t,e,n)=>{var r=n(4239),o=n(3218);t.exports=function(t){if(!o(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},3218:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},7005:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},3448:(t,e,n)=>{var r=n(4239),o=n(7005);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==r(t)}},8306:(t,e,n)=>{var r=n(3369);function o(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var i=t.apply(this,r);return n.cache=a.set(o,i)||a,i};return n.cache=new(o.Cache||r),n}o.Cache=r,t.exports=o},9833:(t,e,n)=>{var r=n(531);t.exports=function(t){return null==t?"":r(t)}},8976:e=>{"use strict";e.exports=t}},n={};function r(t){var o=n[t];if(void 0!==o)return o.exports;var a=n[t]={exports:{}};return e[t](a,a.exports,r),a.exports}return r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(8839)})()));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):"object"==typeof exports?exports.VueDraggable=t(require("vue")):e.VueDraggable=t(e.Vue)}(self,(e=>(()=>{var t={835:(e,t,n)=>{"use strict";function r(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=r(e[t]))&&(o&&(o+=" "),o+=n);else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}function o(){for(var e,t,n=0,o="";n<arguments.length;)(e=arguments[n++])&&(t=r(e))&&(o&&(o+=" "),o+=t);return o}n.r(t),n.d(t,{clsx:()=>o,default:()=>a});const a=o},968:(e,t)=>{"use strict";function n(e){return"[object Object]"===Object.prototype.toString.call(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.isPlainObject=function(e){var t,r;return!1!==n(e)&&(void 0===(t=e.constructor)||!1!==n(r=t.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf"))}},582:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},644:(e,t,n)=>{var r=n(582);e.exports=function(e,t,n){var o=null==e?void 0:r(e,t);return void 0===o?n:o}},116:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DraggableCore=t.default=t.draggableProps=void 0;var i=n(594),u=n(594),l=a(n(644)),s=a(n(956)),f=a(n(835)),c=n(212),d=n(461),p=n(811),v=a(n(917));t.DraggableCore=v.default;var g=a(n(463)),y=n(917);t.draggableProps=r(r({},y.draggableCoreProps),{axis:s.default.oneOf(["both","x","y","none"]).def("both"),bounds:s.default.oneOfType([s.default.shape({left:s.default.number,right:s.default.number,top:s.default.number,bottom:s.default.number}),s.default.string,s.default.oneOf([!1])]).def(!1),defaultClassName:s.default.string.def("vue-draggable"),defaultClassNameDragging:s.default.string.def("vue-draggable-dragging"),defaultClassNameDragged:s.default.string.def("vue-draggable-dragged"),defaultPosition:s.default.shape({x:s.default.number,y:s.default.number}).def({x:0,y:0}),positionOffset:s.default.shape({x:s.default.oneOfType([s.default.number,s.default.string]),y:s.default.oneOfType([s.default.number,s.default.string])}),position:s.default.shape({x:s.default.number,y:s.default.number}).def(void 0)});var b="Draggable",m=(0,u.defineComponent)({compatConfig:{MODE:3},name:b,inheritAttrs:!1,props:r(r({},t.draggableProps),{style:(0,p.dontSetMe)("style",b),class:(0,p.dontSetMe)("class",b),transform:(0,p.dontSetMe)("transform",b)}),setup:function(e,t){var n=t.slots,a=(0,u.ref)(null);e.position&&!e.dragFn&&e.stopFn;var s=(0,u.reactive)({dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:r({},e.position),slackX:0,slackY:0,isElementSVG:!1}),p=function(){return(0,l.default)(e,"nodeRef.value")||a.value};(0,u.onMounted)((function(){void 0!==window.SVGElement&&p()instanceof window.SVGElement&&(s.isElementSVG=!0)})),(0,u.onUnmounted)((function(){s.dragging=!1}));var y=function(t,n){var r;if((0,g.default)("Draggable: onDragStart: %j",n),!1===(null===(r=e.startFn)||void 0===r?void 0:r.call(e,t,(0,d.createDraggableData)({props:e,state:s},n))))return!1;s.dragging=!0,s.dragged=!0},b=function(t,n){var r,o,a;if(!s.dragging)return!1;(0,g.default)("Draggable: onDrag: %j",n);var i=(0,d.createDraggableData)({props:e,state:s},n),u={x:i.x,y:i.y,slackX:0,slackY:0};if(e.bounds){var l=u.x,f=u.y;u.x+=s.slackX,u.y+=s.slackY;var c=(0,d.getBoundPosition)({props:e,findDOMNode:p},u.x,u.y),v=c[0],y=c[1];u.x=v,u.y=y,u.slackX=s.slackX+(l-u.x),u.slackY=s.slackY+(f-u.y),i.x=u.x,i.y=u.y,i.deltaX=u.x-(null!==(r=s.x)&&void 0!==r?r:0),i.deltaY=u.y-(null!==(o=s.y)&&void 0!==o?o:0)}if(!1===(null===(a=e.dragFn)||void 0===a?void 0:a.call(e,t,i)))return!1;Object.keys(u).forEach((function(e){s[e]=u[e]}))},m=function(t,n){var r;if(!s.dragging)return!1;if(!1===(null===(r=e.stopFn)||void 0===r?void 0:r.call(e,t,(0,d.createDraggableData)({props:e,state:s},n))))return!1;(0,g.default)("Draggable: onDragStop: %j",n);var o={dragging:!1,slackX:0,slackY:0};if(Boolean(e.position)){var a=e.position,i=a.x,u=a.y;o.x=i,o.y=u}Object.keys(o).forEach((function(e){s[e]=o[e]}))};return function(){e.axis,e.bounds;var t,l,p,g=e.defaultPosition,h=e.defaultClassName,O=e.defaultClassNameDragging,j=e.defaultClassNameDragged,T=e.position,P=e.positionOffset,D=(e.scale,o(e,["axis","bounds","defaultPosition","defaultClassName","defaultClassNameDragging","defaultClassNameDragged","position","positionOffset","scale"])),x={},S="",w=!Boolean(T)||s.dragging,_=T||g,N={x:null!==(l=(0,d.canDragX)({props:e})&&w?s.x:_.x)&&void 0!==l?l:0,y:null!==(p=(0,d.canDragY)({props:e})&&w?s.y:_.y)&&void 0!==p?p:0};s.isElementSVG?S=(0,c.createSVGTransform)(N,P):x=(0,c.createCSSTransform)(N,P);var C=(0,f.default)(h,((t={})[O]=s.dragging,t[j]=s.dragged,t)),E=n.default?n.default()[0]:null;if(!E)return null;var M,k=(0,u.cloneVNode)(E,{class:C,style:x,transform:S}),Y=r(r({},D),{startFn:y,dragFn:b,stopFn:m});return(0,i.createVNode)(v.default,(0,i.mergeProps)({ref:a},Y),"function"==typeof(M=k)||"[object Object]"===Object.prototype.toString.call(M)&&!(0,i.isVNode)(M)?k:{default:function(){return[k]}})}}});t.default=m},917:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.draggableCoreProps=t.draggableCoreDefaultProps=t.defaultDraggableEventHandler=void 0;var a=n(594),i=o(n(956)),u=o(n(644)),l=n(212),s=n(461),f=n(811),c=o(n(463)),d={start:"touchstart",move:"touchmove",stop:"touchend"},p={start:"mousedown",move:"mousemove",stop:"mouseup"};t.defaultDraggableEventHandler=function(e,t){return!0};var v=function(){},g=p;t.draggableCoreDefaultProps={allowAnyClick:i.default.bool.def(!1),disabled:i.default.bool.def(!1),enableUserSelectHack:i.default.bool.def(!0),startFn:i.default.func.def(t.defaultDraggableEventHandler).def(v),dragFn:i.default.func.def(t.defaultDraggableEventHandler).def(v),stopFn:i.default.func.def(t.defaultDraggableEventHandler).def(v),scale:i.default.number.def(1)},t.draggableCoreProps=r(r({},t.draggableCoreDefaultProps),{cancel:i.default.string,offsetParent:i.default.custom(f.propIsNotNode,"Draggable's offsetParent must be a DOM Node."),grid:i.default.arrayOf(i.default.number),handle:i.default.string,nodeRef:i.default.object.def((function(){return null}))});t.default=(0,a.defineComponent)({compatConfig:{MODE:3},name:"DraggableCore",inheritAttrs:!1,props:r({},t.draggableCoreProps),setup:function(e,t){var n=t.slots,r=t.emit,o=(0,a.ref)(null),i=(0,a.reactive)({dragging:!1,lastX:NaN,lastY:NaN,touchIdentifier:null,mounted:!1}),f=function(){return(0,u.default)(e,"nodeRef.value")||o.value},v=function(t){var n,r,o=(0,s.getControlPosition)(t,{props:e,findDOMNode:f},i.touchIdentifier);if(null!=o){var a=o.x,u=o.y;if(Array.isArray(e.grid)){var l=a-i.lastX,d=u-i.lastY;if(l=(n=(0,s.snapToGrid)(e.grid,l,d))[0],d=n[1],!l&&!d)return;a=i.lastX+l,u=i.lastY+d}var p=(0,s.createCoreData)({props:e,findDOMNode:f,state:i},a,u);if((0,c.default)("DraggableCore: handleDrag: %j",p),!1!==(null===(r=e.dragFn)||void 0===r?void 0:r.call(e,t,p))&&!1!==i.mounted)i.lastX=a,i.lastY=u;else try{y(new MouseEvent("mouseup"))}catch(e){var v=document.createEvent("MouseEvents");v.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),y(v)}}},y=function(t){var n,r;if(i.dragging){var o=(0,s.getControlPosition)(t,{props:e,findDOMNode:f},i.touchIdentifier);if(null!=o){var a=o.x,u=o.y;if(Array.isArray(e.grid)){var d=a-i.lastX||0,p=u-i.lastY||0;d=(n=(0,s.snapToGrid)(e.grid,d,p))[0],p=n[1],a=i.lastX+d,u=i.lastY+p}var b=(0,s.createCoreData)({props:e,findDOMNode:f,state:i},a,u);if(!1===(null===(r=e.stopFn)||void 0===r?void 0:r.call(e,t,b))||!1===i.mounted)return!1;var m=f();m&&e.enableUserSelectHack&&(0,l.removeUserSelectStyles)(m.ownerDocument),(0,c.default)("DraggableCore: handleDragStop: %j",b),i.dragging=!1,i.lastX=NaN,i.lastY=NaN,m&&((0,c.default)("DraggableCore: Removing handlers"),(0,l.removeEvent)(m.ownerDocument,g.move,v),(0,l.removeEvent)(m.ownerDocument,g.stop,y))}}},b=function(t){var n;if(r("mousedown",t),!e.allowAnyClick&&"number"==typeof t.button&&0!==t.button)return!1;var o=f();(0,u.default)(o,"ownerDocument.body");var a=o.ownerDocument;if(!(e.disabled||!(t.target instanceof a.defaultView.Node)||e.handle&&!(0,l.matchesSelectorAndParentsTo)(t.target,e.handle,o)||e.cancel&&(0,l.matchesSelectorAndParentsTo)(t.target,e.cancel,o))){"touchstart"===t.type&&t.preventDefault();var d=(0,l.getTouchIdentifier)(t);i.touchIdentifier=d;var p=(0,s.getControlPosition)(t,{props:e,findDOMNode:f},d);if(null!=p){var b=p.x,m=p.y,h=(0,s.createCoreData)({props:e,findDOMNode:f,state:i},b,m);(0,c.default)("DraggableCore: handleDragStart: %j",h),(0,c.default)("calling",e.startFn),!1!==(null===(n=e.startFn)||void 0===n?void 0:n.call(e,t,h))&&!1!==i.mounted&&(e.enableUserSelectHack&&(0,l.addUserSelectStyles)(a),i.dragging=!0,i.lastX=b,i.lastY=m,(0,l.addEvent)(a,g.move,v),(0,l.addEvent)(a,g.stop,y))}}},m=function(e){return g=p,b(e)},h=function(e){return g=p,y(e)},O=function(e){return g=d,b(e)},j=function(e){return g=d,y(e)};return(0,a.onMounted)((function(){i.mounted=!0;var e=f();e&&(0,l.addEvent)(e,d.start,O,{passive:!1})})),(0,a.onUnmounted)((function(){i.mounted=!1;var t=f();if(t){var n=t.ownerDocument;(0,l.removeEvent)(n,p.move,v),(0,l.removeEvent)(n,d.move,v),(0,l.removeEvent)(n,p.stop,y),(0,l.removeEvent)(n,d.stop,y),(0,l.removeEvent)(t,d.start,O,{passive:!1}),e.enableUserSelectHack&&(0,l.removeUserSelectStyles)(n)}})),function(){var e=n.default?n.default()[0]:null;return e?(0,a.isVNode)(e)?(0,a.cloneVNode)(e,{onMousedown:m,onMouseup:h,onTouchend:j,ref:o}):e:null}}})},549:(e,t,n)=>{"use strict";var r=n(116),o=r.default,a=r.DraggableCore;e.exports=o,e.exports.default=o,e.exports.DraggableCore=a},212:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return a(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.removeUserSelectStyles=t.addUserSelectStyles=t.removeClassName=t.addClassName=t.getTouchIdentifier=t.getTouch=t.createSVGTransform=t.createCSSTransform=t.getTranslation=t.offsetXYFromParent=t.innerWidth=t.innerHeight=t.outerWidth=t.outerHeight=t.removeEvent=t.addEvent=t.matchesSelectorAndParentsTo=t.matchesSelector=void 0;var u=i(n(157)),l=n(811),s="";t.matchesSelector=function(e,t){return s||(s=(0,l.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],(function(t){return(0,l.isFunction)(e[t])}))),!!(0,l.isFunction)(e[s])&&e[s](t)};t.matchesSelectorAndParentsTo=function(e,n,r){var o=e;do{if((0,t.matchesSelector)(o,n))return!0;if(o===r)return!1;o=o.parentNode}while(o);return!1};t.addEvent=function(e,t,n,o){if(e){var a=r({capture:!0},o);e.addEventListener?e.addEventListener(t,n,a):e.attachEvent?e.attachEvent("on".concat(t),n):e["on".concat(t)]=n}};t.removeEvent=function(e,t,n,o){var a;if(e){var i=r({capture:!0},o);e.removeEventListener?e.removeEventListener(t,n,i):e.detachEvent?null===(a=e.detachEvent)||void 0===a||a.call(e,"on"+t,n):e["on".concat(t)]=null}};t.outerHeight=function(e){var t,n=e.clientHeight,r=null===(t=e.ownerDocument.defaultView)||void 0===t?void 0:t.getComputedStyle(e);return n+=(0,l.int)(r.borderTopWidth),n+=(0,l.int)(r.borderBottomWidth)};t.outerWidth=function(e){var t,n,r=e.clientWidth,o=null===(n=null===(t=e.ownerDocument)||void 0===t?void 0:t.defaultView)||void 0===n?void 0:n.getComputedStyle(e);return r+=(0,l.int)(o.borderLeftWidth),r+=(0,l.int)(o.borderRightWidth)};t.innerHeight=function(e){var t,n,r=e.clientHeight,o=null===(n=null===(t=e.ownerDocument)||void 0===t?void 0:t.defaultView)||void 0===n?void 0:n.getComputedStyle(e);return r-=(0,l.int)(o.paddingTop),r-=(0,l.int)(o.paddingBottom)};t.innerWidth=function(e){var t,n,r=e.clientWidth,o=null===(n=null===(t=e.ownerDocument)||void 0===t?void 0:t.defaultView)||void 0===n?void 0:n.getComputedStyle(e);return r-=(0,l.int)(o.paddingLeft),r-=(0,l.int)(o.paddingRight)};t.offsetXYFromParent=function(e,t,n){var r=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect();return{x:(e.clientX+t.scrollLeft-r.left)/n,y:(e.clientY+t.scrollTop-r.top)/n}};t.getTranslation=function(e,t,n){var r=e.x,o=e.y,a="translate(".concat(r).concat(n,",").concat(o).concat(n,")");if(t){var i="".concat("string"==typeof t.x?t.x:t.x+n),u="".concat("string"==typeof t.y?t.y:t.y+n);a="translate(".concat(i,", ").concat(u,")")+a}return a};t.createCSSTransform=function(e,n){var r,o=(0,t.getTranslation)(e,n,"px");return(r={})[(0,u.browserPrefixToKey)("transform",u.default)]=o,r};t.createSVGTransform=function(e,n){return(0,t.getTranslation)(e,n,"")};t.getTouch=function(e,t){return e.targetTouches&&(0,l.findInArray)(e.targetTouches,(function(e){return t===e.identifier}))||e.changedTouches&&(0,l.findInArray)(e.changedTouches,(function(e){return t===e.identifier}))};t.getTouchIdentifier=function(e){return e.targetTouches&&e.targetTouches[0]?e.targetTouches[0].identifier:e.changedTouches&&e.changedTouches[0]?e.changedTouches[0].identifier:null};t.addClassName=function(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))};t.removeClassName=function(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")};t.addUserSelectStyles=function(e){if(e){var n=e.getElementById("vue-draggable-style-el");n||((n=e.createElement("style")).type="text/css",n.id="vue-draggable-style-el",n.innerHTML=".vue-draggable-transparent-selection *::-moz-selection {all: inherit;}\n",n.innerHTML+=".vue-draggable-transparent-selection *::selection {all: inherit;}\n",e.getElementsByTagName("head")[0].appendChild(n)),e.body&&(0,t.addClassName)(e.body,"vue-draggable-transparent-selection")}};t.removeUserSelectStyles=function(e){if(e)try{e.body&&(0,t.removeClassName)(e.body,"vue-draggable-transparent-selection");var n=e.getSelection();n&&"Caret"!==n.type&&n.removeAllRanges()}catch(e){}}},157:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.browserPrefixToStyle=t.browserPrefixToKey=t.getPrefix=void 0;var n=["Moz","Webkit","O","ms"];function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"==typeof window||void 0===window.document)return"";var t=window.document.documentElement.style;if(e in t)return"";for(var r=0;r<n.length;r++)if(o(e,n[r])in t)return n[r];return""}function o(e,t){return t?"".concat(t).concat(function(e){for(var t="",n=!0,r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):"-"===e[r]?n=!0:t+=e[r];return t}(e)):e}t.getPrefix=r,t.browserPrefixToKey=o,t.browserPrefixToStyle=function(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e},t.default=r()},463:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){}},461:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDraggableData=t.createCoreData=t.getControlPosition=t.canDragY=t.canDragX=t.snapToGrid=t.getBoundPosition=void 0;var r=n(212),o=n(811),a=function(e){return e.findDOMNode()},i=function(e,t){if(!(t in e))return 0;var n=e[t],r=parseInt(n,10);return isNaN(r)?0:r};t.getBoundPosition=function(e,t,n){if(!e.props.bounds)return[t,n];var o=e.props.bounds;o="string"==typeof o?o:function(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}(o);var u=a(e);if(!u)return[t,n];var l=u.ownerDocument,s=null==l?void 0:l.defaultView;if(!s)return[t,n];if("string"==typeof o){var f="parent"===o?u.parentNode:l.querySelector(o);if(!(f instanceof s.HTMLElement))throw new Error('Bounds selector "'.concat(o,'" could not find an element.'));var c=s.getComputedStyle(u),d=s.getComputedStyle(f);o={left:-u.offsetLeft+i(d,"paddingLeft")+i(c,"marginLeft"),top:-u.offsetTop+i(d,"paddingTop")+i(c,"marginTop"),right:(0,r.innerWidth)(f)-(0,r.outerWidth)(u)-u.offsetLeft+i(d,"paddingRight")-i(c,"marginRight"),bottom:(0,r.innerHeight)(f)-(0,r.outerHeight)(u)-u.offsetTop+i(d,"paddingBottom")-i(c,"marginBottom")}}return[t=Math.max(Math.min(t,o.right||0),o.left||0),n=Math.max(Math.min(n,o.bottom||0),o.top||0)]};t.snapToGrid=function(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]};t.canDragX=function(e){return"both"===e.props.axis||"x"===e.props.axis};t.canDragY=function(e){return"both"===e.props.axis||"y"===e.props.axis};t.getControlPosition=function(e,t,n){var o="number"==typeof n?(0,r.getTouch)(e,n):null;if("number"==typeof n&&!o)return null;var i=a(t),u=t.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,r.offsetXYFromParent)(o||e,u,t.props.scale)};t.createCoreData=function(e,t,n){var r=e.state,i=!(0,o.isNum)(r.lastX),u=a(e);return i?{node:u,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:u,deltaX:t-r.lastX,deltaY:n-r.lastY,lastX:r.lastX,lastY:r.lastY,x:t,y:n}};t.createDraggableData=function(e,t){var n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}},811:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.propIsNotNode=t.dontSetMe=t.int=t.isNum=t.isFunction=t.findInArray=void 0;var o=r(n(956));t.findInArray=function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e instanceof TouchList?e.item(n):e[n];if(null!==o&&t(o,n,e))return o}},t.isFunction=function(e){return"function"==typeof e||"[object Function]"===Object.prototype.toString.call(e)},t.isNum=function(e){return"number"==typeof e&&!isNaN(e)},t.int=function(e){return parseInt(e,10)},t.dontSetMe=function(e,t){var n="Invalid prop ".concat(e," passed to ").concat(t," - do not set this, set it on the child.");return o.default.custom((function(){return!e}),n)},t.propIsNotNode=function(e){return"object"==typeof e&&null!==e&&"nodeType"in e&&1===e.nodeType}},594:t=>{"use strict";t.exports=e},956:(e,t,n)=>{var r=n(968);function o(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,o(r.key),r)}}function i(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(this,arguments)}function l(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,s(e,t)}function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}function f(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var c={silent:!1,logLevel:"warn"},d=["validator"],p=Object.prototype,v=p.toString,g=p.hasOwnProperty,y=/^\s*function (\w+)/;function b(e){var t,n=null!==(t=null==e?void 0:e.type)&&void 0!==t?t:e;if(n){var r=n.toString().match(y);return r?r[1]:""}return""}var m=r.isPlainObject,h=function(e){return e},O=function(e,t){return g.call(e,t)},j=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},T=Array.isArray||function(e){return"[object Array]"===v.call(e)},P=function(e){return"[object Function]"===v.call(e)},D=function(e,t){return m(e)&&O(e,"_vueTypes_name")&&(!t||e._vueTypes_name===t)},x=function(e){return m(e)&&(O(e,"type")||["_vueTypes_name","validator","default","required"].some((function(t){return O(e,t)})))};function S(e,t){return Object.defineProperty(e.bind(t),"__original",{value:e})}function w(e,t,n){var r;void 0===n&&(n=!1);var o=!0,a="";r=m(e)?e:{type:e};var i=D(r)?r._vueTypes_name+" - ":"";if(x(r)&&null!==r.type){if(void 0===r.type||!0===r.type)return o;if(!r.required&&null==t)return o;T(r.type)?(o=r.type.some((function(e){return!0===w(e,t,!0)})),a=r.type.map((function(e){return b(e)})).join(" or ")):o="Array"===(a=b(r))?T(t):"Object"===a?m(t):"String"===a||"Number"===a||"Boolean"===a||"Function"===a?function(e){if(null==e)return"";var t=e.constructor.toString().match(y);return t?t[1].replace(/^Async/,""):""}(t)===a:t instanceof r.type}if(!o){var u=i+'value "'+t+'" should be of type "'+a+'"';return!1===n?(h(u),!1):u}if(O(r,"validator")&&P(r.validator)){var l=h,s=[];if(h=function(e){s.push(e)},o=r.validator(t),h=l,!o){var f=(s.length>1?"* ":"")+s.join("\n* ");return s.length=0,!1===n?(h(f),o):f}}return o}function _(e,t){var n=Object.defineProperties(t,{_vueTypes_name:{value:e,writable:!0},isRequired:{get:function(){return this.required=!0,this}},def:{value:function(e){return void 0===e?this.type===Boolean||Array.isArray(this.type)&&this.type.includes(Boolean)?void(this.default=void 0):(O(this,"default")&&delete this.default,this):P(e)||!0===w(this,e,!0)?(this.default=T(e)?function(){return[].concat(e)}:m(e)?function(){return Object.assign({},e)}:e,this):(h(this._vueTypes_name+' - invalid default value: "'+e+'"'),this)}}}),r=n.validator;return P(r)&&(n.validator=S(r,n)),n}function N(e,t){var n=_(e,t);return Object.defineProperty(n,"validate",{value:function(e){return P(this.validator)&&h(this._vueTypes_name+" - calling .validate() will overwrite the current custom validator function. Validator info:\n"+JSON.stringify(this)),this.validator=S(e,this),this}})}function C(e,t,n){var r,o,a=(r=t,o={},Object.getOwnPropertyNames(r).forEach((function(e){o[e]=Object.getOwnPropertyDescriptor(r,e)})),Object.defineProperties({},o));if(a._vueTypes_name=e,!m(n))return a;var i,u,l=n.validator,s=f(n,d);if(P(l)){var c=a.validator;c&&(c=null!==(u=(i=c).__original)&&void 0!==u?u:i),a.validator=S(c?function(e){return c.call(this,e)&&l.call(this,e)}:l,a)}return Object.assign(a,s)}function E(e){return e.replace(/^(?!\s*$)/gm," ")}var M=function(){return N("any",{})},k=function(){return N("function",{type:Function})},Y=function(){return N("boolean",{type:Boolean})},X=function(){return N("string",{type:String})},A=function(){return N("number",{type:Number})},V=function(){return N("array",{type:Array})},F=function(){return N("object",{type:Object})},L=function(){return _("integer",{type:Number,validator:function(e){var t=j(e);return!1===t&&h('integer - "'+e+'" is not an integer'),t}})},I=function(){return _("symbol",{validator:function(e){var t="symbol"==typeof e;return!1===t&&h('symbol - invalid value "'+e+'"'),t}})},H=function(){return Object.defineProperty({type:null,validator:function(e){var t=null===e;return!1===t&&h("nullable - value should be null"),t}},"_vueTypes_name",{value:"nullable"})};function B(e,t){if(void 0===t&&(t="custom validation failed"),"function"!=typeof e)throw new TypeError("[VueTypes error]: You must provide a function as argument");return _(e.name||"<<anonymous function>>",{type:null,validator:function(n){var r=e(n);return r||h(this._vueTypes_name+" - "+t),r}})}function U(e){if(!T(e))throw new TypeError("[VueTypes error]: You must provide an array as argument.");var t='oneOf - value should be one of "'+e.map((function(e){return"symbol"==typeof e?e.toString():e})).join('", "')+'".',n={validator:function(n){var r=-1!==e.indexOf(n);return r||h(t),r}};if(-1===e.indexOf(null)){var r=e.reduce((function(e,t){if(null!=t){var n=t.constructor;-1===e.indexOf(n)&&e.push(n)}return e}),[]);r.length>0&&(n.type=r)}return _("oneOf",n)}function R(e){if(!T(e))throw new TypeError("[VueTypes error]: You must provide an array as argument");for(var t=!1,n=!1,r=[],o=0;o<e.length;o+=1){var a=e[o];if(x(a)){if(P(a.validator)&&(t=!0),D(a,"oneOf")&&a.type){r=r.concat(a.type);continue}if(D(a,"nullable")){n=!0;continue}if(!0===a.type||!a.type){h('oneOfType - invalid usage of "true" and "null" as types.');continue}r=r.concat(a.type)}else r.push(a)}r=r.filter((function(e,t){return r.indexOf(e)===t}));var i=!1===n&&r.length>0?r:null;return _("oneOfType",t?{type:i,validator:function(t){var n=[],r=e.some((function(e){var r=w(e,t,!0);return"string"==typeof r&&n.push(r),!0===r}));return r||h("oneOfType - provided value does not match any of the "+n.length+" passed-in validators:\n"+E(n.join("\n"))),r}}:{type:i})}function W(e){return _("arrayOf",{type:Array,validator:function(t){var n="",r=t.every((function(t){return!0===(n=w(e,t,!0))}));return r||h("arrayOf - value validation error:\n"+E(n)),r}})}function G(e){return _("instanceOf",{type:e})}function q(e){return _("objectOf",{type:Object,validator:function(t){var n="",r=Object.keys(t).every((function(r){return!0===(n=w(e,t[r],!0))}));return r||h("objectOf - value validation error:\n"+E(n)),r}})}function z(e){var t=Object.keys(e),n=t.filter((function(t){var n;return!(null===(n=e[t])||void 0===n||!n.required)})),r=_("shape",{type:Object,validator:function(r){var o=this;if(!m(r))return!1;var a=Object.keys(r);if(n.length>0&&n.some((function(e){return-1===a.indexOf(e)}))){var i=n.filter((function(e){return-1===a.indexOf(e)}));return h(1===i.length?'shape - required property "'+i[0]+'" is not defined.':'shape - required properties "'+i.join('", "')+'" are not defined.'),!1}return a.every((function(n){if(-1===t.indexOf(n))return!0===o._vueTypes_isLoose||(h('shape - shape definition does not include a "'+n+'" property. Allowed keys: "'+t.join('", "')+'".'),!1);var a=w(e[n],r[n],!0);return"string"==typeof a&&h('shape - "'+n+'" property validation error:\n '+E(a)),!0===a}))}});return Object.defineProperty(r,"_vueTypes_isLoose",{writable:!0,value:!1}),Object.defineProperty(r,"loose",{get:function(){return this._vueTypes_isLoose=!0,this}}),r}var K=["name","validate","getter"],J=function(e){return e=function(){function e(){}return e.extend=function(e){var t=this;if(h("VueTypes.extend is deprecated. Use the ES6+ method instead. See https://dwightjack.github.io/vue-types/advanced/extending-vue-types.html#extending-namespaced-validators-in-es6 for details."),T(e))return e.forEach((function(e){return t.extend(e)})),this;var n=e.name,r=e.validate,o=void 0!==r&&r,a=e.getter,i=void 0!==a&&a,u=f(e,K);if(O(this,n))throw new TypeError('[VueTypes error]: Type "'+n+'" already defined');var l,s=u.type;return D(s)?(delete u.type,Object.defineProperty(this,n,i?{get:function(){return C(n,s,u)}}:{value:function(){var e,t=C(n,s,u);return t.validator&&(t.validator=(e=t.validator).bind.apply(e,[t].concat([].slice.call(arguments)))),t}})):(l=i?{get:function(){var e=Object.assign({},u);return o?N(n,e):_(n,e)},enumerable:!0}:{value:function(){var e,t,r=Object.assign({},u);return e=o?N(n,r):_(n,r),r.validator&&(e.validator=(t=r.validator).bind.apply(t,[e].concat([].slice.call(arguments)))),e},enumerable:!0},Object.defineProperty(this,n,l))},i(e,null,[{key:"any",get:function(){return M()}},{key:"func",get:function(){return k().def(this.defaults.func)}},{key:"bool",get:function(){return void 0===this.defaults.bool?Y():Y().def(this.defaults.bool)}},{key:"string",get:function(){return X().def(this.defaults.string)}},{key:"number",get:function(){return A().def(this.defaults.number)}},{key:"array",get:function(){return V().def(this.defaults.array)}},{key:"object",get:function(){return F().def(this.defaults.object)}},{key:"integer",get:function(){return L().def(this.defaults.integer)}},{key:"symbol",get:function(){return I()}},{key:"nullable",get:function(){return H()}}])}(),e.defaults={},e.sensibleDefaults=void 0,e.config=c,e.custom=B,e.oneOf=U,e.instanceOf=G,e.oneOfType=R,e.arrayOf=W,e.objectOf=q,e.shape=z,e.utils={validate:function(e,t){return!0===w(t,e,!0)},toType:function(e,t,n){return void 0===n&&(n=!1),n?N(e,t):_(e,t)}},e}();function $(e){var t;return void 0===e&&(e={func:function(){},bool:!0,string:"",number:0,array:function(){return[]},object:function(){return{}},integer:0}),t=function(t){function n(){return t.apply(this,arguments)||this}return l(n,t),i(n,null,[{key:"sensibleDefaults",get:function(){return u({},this.defaults)},set:function(t){this.defaults=!1!==t?u({},!0!==t?t:e):{}}}])}(J),t.defaults=u({},e),t}var Q=function(e){function t(){return e.apply(this,arguments)||this}return l(t,e),t}($());Object.defineProperty(t,"__esModule",{value:!0}),t.any=M,t.array=V,t.arrayOf=W,t.bool=Y,t.config=c,t.createTypes=$,t.custom=B,t.default=Q,t.fromType=C,t.func=k,t.instanceOf=G,t.integer=L,t.nullable=H,t.number=A,t.object=F,t.objectOf=q,t.oneOf=U,t.oneOfType=R,t.shape=z,t.string=X,t.symbol=I,t.toType=_,t.toValidableType=N,t.validateType=w}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var a=n[e]={exports:{}};return t[e].call(a.exports,a,a.exports,r),a.exports}return r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(549)})()));
|
package/package.json
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marsio/vue-draggable",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Vue draggable component",
|
|
5
5
|
"main": "build/cjs/cjs.js",
|
|
6
6
|
"unpkg": "build/web/vue-draggable.min.js",
|
|
7
|
-
"
|
|
8
|
-
"dev": "make dev",
|
|
9
|
-
"build": "make clean build",
|
|
10
|
-
"lint": "make lint"
|
|
11
|
-
},
|
|
7
|
+
"sideEffects": false,
|
|
12
8
|
"files": [
|
|
13
9
|
"/build",
|
|
14
10
|
"/typings",
|
|
@@ -33,6 +29,8 @@
|
|
|
33
29
|
"@babel/plugin-transform-class-properties": "^7.18.6",
|
|
34
30
|
"@babel/preset-env": "^7.22.20",
|
|
35
31
|
"@babel/preset-typescript": "^7.23.3",
|
|
32
|
+
"@commitlint/cli": "^19.3.0",
|
|
33
|
+
"@commitlint/config-conventional": "^19.2.2",
|
|
36
34
|
"@types/lodash": "^4.14.202",
|
|
37
35
|
"@types/node": "^20.7.0",
|
|
38
36
|
"@typescript-eslint/eslint-plugin": "^6.16.0",
|
|
@@ -40,32 +38,56 @@
|
|
|
40
38
|
"@vue/babel-plugin-jsx": "^1.1.5",
|
|
41
39
|
"@vue/eslint-config-typescript": "^12.0.0",
|
|
42
40
|
"babel-loader": "^9.1.3",
|
|
41
|
+
"babel-plugin-lodash": "^3.3.4",
|
|
43
42
|
"babel-plugin-transform-inline-environment-variables": "^0.4.4",
|
|
43
|
+
"chalk": "^3.0.0",
|
|
44
44
|
"eslint": "^8.56.0",
|
|
45
45
|
"eslint-plugin-vue": "^9.19.2",
|
|
46
46
|
"eslint-webpack-plugin": "^4.0.1",
|
|
47
|
+
"fork-ts-checker-webpack-plugin": "^9.0.2",
|
|
48
|
+
"fs-extra": "^11.2.0",
|
|
49
|
+
"husky": "^9.0.11",
|
|
47
50
|
"jasmine-core": "^5.1.1",
|
|
51
|
+
"lint-staged": "^15.2.7",
|
|
52
|
+
"lodash-webpack-plugin": "^0.11.6",
|
|
53
|
+
"minimist": "^1.2.5",
|
|
48
54
|
"pre-commit": "^1.2.2",
|
|
49
55
|
"process": "^0.11.10",
|
|
56
|
+
"progress-bar-webpack-plugin": "^2.1.0",
|
|
50
57
|
"puppeteer": "^21.3.5",
|
|
51
|
-
"semver": "^7.
|
|
58
|
+
"semver": "^7.6.2",
|
|
52
59
|
"static-server": "^3.0.0",
|
|
60
|
+
"terser-webpack-plugin": "^5.3.10",
|
|
61
|
+
"ts-loader": "^9.5.1",
|
|
53
62
|
"typescript": "^5.2.2",
|
|
54
63
|
"vue-loader": "next",
|
|
55
64
|
"webpack": "^5.88.2",
|
|
65
|
+
"webpack-bundle-analyzer": "^4.10.2",
|
|
56
66
|
"webpack-cli": "^5.1.4",
|
|
57
67
|
"webpack-dev-server": "^4.15.1"
|
|
58
68
|
},
|
|
59
69
|
"resolutions": {
|
|
60
70
|
"minimist": "^1.2.5"
|
|
61
71
|
},
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
|
|
72
|
+
"husky": {
|
|
73
|
+
"hooks": {}
|
|
74
|
+
},
|
|
75
|
+
"lint-staged": {
|
|
76
|
+
"lib/**/*.{js,vue,ts,tsx}": "eslint --fix"
|
|
77
|
+
},
|
|
65
78
|
"dependencies": {
|
|
66
79
|
"clsx": "^1.1.1",
|
|
67
80
|
"lodash": "^4.17.21",
|
|
68
81
|
"vue": "^3.2.23",
|
|
69
82
|
"vue-types": "^5.1.1"
|
|
83
|
+
},
|
|
84
|
+
"scripts": {
|
|
85
|
+
"dev": "node script.js --action=dev",
|
|
86
|
+
"build": "node script.js --action=build",
|
|
87
|
+
"build-docs": "node script.js --action=docs",
|
|
88
|
+
"lint": "eslint 'lib/**/*.{js.vue,ts,tsx}'",
|
|
89
|
+
"clean": "node script.js --action=clean",
|
|
90
|
+
"release": "node script.js --action=release",
|
|
91
|
+
"analyze": "ANALYZE=true webpack --config webpack.config.js"
|
|
70
92
|
}
|
|
71
|
-
}
|
|
93
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
(MIT License)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2023 Marshall. All rights reserved.
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a
|
|
6
|
-
copy of this software and associated documentation files (the "Software"),
|
|
7
|
-
to deal in the Software without restriction, including without limitation
|
|
8
|
-
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
9
|
-
and/or sell copies of the Software, and to permit persons to whom the
|
|
10
|
-
Software is furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
20
|
-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
21
|
-
DEALINGS IN THE SOFTWARE.
|
package/build/cjs/utils/test.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.externalFunction = externalFunction;
|
|
7
|
-
function externalFunction(componentInstance) {
|
|
8
|
-
// 调用组件的内部方法
|
|
9
|
-
if (componentInstance && componentInstance.internalMethod) {
|
|
10
|
-
componentInstance.internalMethod();
|
|
11
|
-
}
|
|
12
|
-
}
|