@marsio/vue-draggable 1.0.2
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/LICENSE +21 -0
- package/README.md +320 -0
- package/build/cjs/Draggable.js +278 -0
- package/build/cjs/DraggableCore.js +310 -0
- package/build/cjs/cjs.js +9 -0
- package/build/cjs/utils/domFns.js +209 -0
- package/build/cjs/utils/getPrefix.js +48 -0
- package/build/cjs/utils/log.js +9 -0
- package/build/cjs/utils/positionFns.js +140 -0
- package/build/cjs/utils/shims.js +39 -0
- package/build/cjs/utils/test.js +12 -0
- package/build/cjs/utils/types.js +21 -0
- package/build/web/vue-draggable.min.js +2 -0
- package/build/web/vue-draggable.min.js.LICENSE.txt +6 -0
- package/package.json +71 -0
- package/typings/index.d.ts +36 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.canDragX = canDragX;
|
|
7
|
+
exports.canDragY = canDragY;
|
|
8
|
+
exports.createCoreData = createCoreData;
|
|
9
|
+
exports.createDraggableData = createDraggableData;
|
|
10
|
+
exports.getBoundPosition = getBoundPosition;
|
|
11
|
+
exports.getControlPosition = getControlPosition;
|
|
12
|
+
exports.snapToGrid = snapToGrid;
|
|
13
|
+
var _get = _interopRequireDefault(require("lodash/get"));
|
|
14
|
+
var _domFns = require("./domFns");
|
|
15
|
+
var _shims = require("./shims");
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
function getBoundPosition(draggable, x, y) {
|
|
18
|
+
// If no bounds, short-circuit and move on
|
|
19
|
+
if (!draggable.props.bounds) return [x, y];
|
|
20
|
+
|
|
21
|
+
// Clone new bounds
|
|
22
|
+
let bounds = draggable.props.bounds;
|
|
23
|
+
bounds = typeof bounds === 'string' ? bounds : cloneBounds(bounds);
|
|
24
|
+
const node = findDOMNode(draggable);
|
|
25
|
+
const {
|
|
26
|
+
ownerDocument
|
|
27
|
+
} = node;
|
|
28
|
+
const ownerWindow = (0, _get.default)(node, 'ownerWindow');
|
|
29
|
+
const defaultView = (0, _get.default)(node, 'ownerWindow.defaultView');
|
|
30
|
+
if (defaultView && typeof bounds === 'string') {
|
|
31
|
+
let boundNode;
|
|
32
|
+
if (bounds === 'parent') {
|
|
33
|
+
boundNode = node.parentNode;
|
|
34
|
+
} else {
|
|
35
|
+
boundNode = ownerDocument.querySelector(bounds);
|
|
36
|
+
}
|
|
37
|
+
if (!(boundNode instanceof ownerWindow.HTMLElement)) {
|
|
38
|
+
throw new Error(`Bounds selector ${bounds} could not find an element.`);
|
|
39
|
+
}
|
|
40
|
+
const nodeStyle = ownerWindow.getComputedStyle(node);
|
|
41
|
+
const boundNodeStyle = ownerWindow.getComputedStyle(boundNode);
|
|
42
|
+
// Compute bounds. This is a pain with padding and offsets but this gets it exactly right.
|
|
43
|
+
bounds = {
|
|
44
|
+
left: -node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingLeft) + (0, _shims.int)(nodeStyle.marginLeft),
|
|
45
|
+
top: -node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingTop) + (0, _shims.int)(nodeStyle.marginTop),
|
|
46
|
+
right: (0, _domFns.innerWidth)(boundNode) - (0, _domFns.outerWidth)(node) - node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingRight) - (0, _shims.int)(nodeStyle.marginRight),
|
|
47
|
+
bottom: (0, _domFns.innerHeight)(boundNode) - (0, _domFns.outerHeight)(node) - node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingBottom) - (0, _shims.int)(nodeStyle.marginBottom)
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Keep x and y below right and bottom limits...
|
|
52
|
+
if ((0, _shims.isNum)(bounds.right)) x = Math.min(x, bounds.right);
|
|
53
|
+
if ((0, _shims.isNum)(bounds.bottom)) y = Math.min(y, bounds.bottom);
|
|
54
|
+
|
|
55
|
+
// But above left and top limits.
|
|
56
|
+
if ((0, _shims.isNum)(bounds.left)) x = Math.max(x, bounds.left);
|
|
57
|
+
if ((0, _shims.isNum)(bounds.top)) y = Math.max(y, bounds.top);
|
|
58
|
+
return [x, y];
|
|
59
|
+
}
|
|
60
|
+
function snapToGrid(grid, pendingX, pendingY) {
|
|
61
|
+
const x = Math.round(pendingX / grid[0]) * grid[0];
|
|
62
|
+
const y = Math.round(pendingY / grid[1]) * grid[1];
|
|
63
|
+
return [x, y];
|
|
64
|
+
}
|
|
65
|
+
function canDragX(draggable) {
|
|
66
|
+
return draggable.props.axis === 'both' || draggable.props.axis === 'x';
|
|
67
|
+
}
|
|
68
|
+
function canDragY(draggable) {
|
|
69
|
+
return draggable.props.axis === 'both' || draggable.props.axis === 'y';
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Get {x, y} positions from event.
|
|
73
|
+
function getControlPosition(e, draggableCore, touchIdentifier) {
|
|
74
|
+
const touchObj = typeof touchIdentifier === 'number' ? (0, _domFns.getTouch)(e, touchIdentifier) : null;
|
|
75
|
+
if (typeof touchIdentifier === 'number' && !touchObj) return null; // not the right touch
|
|
76
|
+
const node = findDOMNode(draggableCore);
|
|
77
|
+
// User can provide an offsetParent if desired.
|
|
78
|
+
const offsetParent = draggableCore.props.offsetParent || node.offsetParent || node.ownerDocument.body;
|
|
79
|
+
return (0, _domFns.offsetXYFromParent)(touchObj || e, offsetParent, draggableCore.props.scale);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Create an data object exposed by <DraggableCore>'s events
|
|
83
|
+
function createCoreData(draggable, x, y) {
|
|
84
|
+
const state = draggable.state;
|
|
85
|
+
const isStart = !(0, _shims.isNum)(state.lastX);
|
|
86
|
+
const node = findDOMNode(draggable);
|
|
87
|
+
if (isStart) {
|
|
88
|
+
// If this is our first move, use the x and y as last coords.
|
|
89
|
+
return {
|
|
90
|
+
node,
|
|
91
|
+
deltaX: 0,
|
|
92
|
+
deltaY: 0,
|
|
93
|
+
lastX: x,
|
|
94
|
+
lastY: y,
|
|
95
|
+
x,
|
|
96
|
+
y
|
|
97
|
+
};
|
|
98
|
+
} else {
|
|
99
|
+
return {
|
|
100
|
+
node,
|
|
101
|
+
deltaX: x - state.lastX,
|
|
102
|
+
deltaY: y - state.lastY,
|
|
103
|
+
lastX: state.lastX,
|
|
104
|
+
lastY: state.lastY,
|
|
105
|
+
x,
|
|
106
|
+
y
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Create an data exposed by <Draggable>'s events
|
|
112
|
+
function createDraggableData(draggable, coreData) {
|
|
113
|
+
const scale = draggable.props.scale;
|
|
114
|
+
return {
|
|
115
|
+
node: coreData.node,
|
|
116
|
+
x: draggable.state.x + coreData.deltaX / scale,
|
|
117
|
+
y: draggable.state.y + coreData.deltaY / scale,
|
|
118
|
+
deltaX: coreData.deltaX / scale,
|
|
119
|
+
deltaY: coreData.deltaY / scale,
|
|
120
|
+
lastX: draggable.state.x,
|
|
121
|
+
lastY: draggable.state.y
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// A lot faster than stringify/parse
|
|
126
|
+
function cloneBounds(bounds) {
|
|
127
|
+
return {
|
|
128
|
+
left: bounds.left,
|
|
129
|
+
top: bounds.top,
|
|
130
|
+
right: bounds.right,
|
|
131
|
+
bottom: bounds.bottom
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
function findDOMNode(draggable) {
|
|
135
|
+
const node = draggable.findDOMNode();
|
|
136
|
+
if (!node) {
|
|
137
|
+
throw new Error('<DraggableCore>: Unmounted during event!');
|
|
138
|
+
}
|
|
139
|
+
return node;
|
|
140
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.dontSetMe = dontSetMe;
|
|
7
|
+
exports.findInArray = findInArray;
|
|
8
|
+
exports.int = int;
|
|
9
|
+
exports.isFunction = isFunction;
|
|
10
|
+
exports.isNum = isNum;
|
|
11
|
+
exports.prop_is_not_node = prop_is_not_node;
|
|
12
|
+
var _vueTypes = _interopRequireDefault(require("vue-types"));
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
function findInArray(array, callback) {
|
|
15
|
+
for (let i = 0, length = array.length; i < length; i++) {
|
|
16
|
+
const element = array instanceof TouchList ? array.item(i) : array[i];
|
|
17
|
+
if (element !== null && callback(element, i, array)) {
|
|
18
|
+
return element;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
function isFunction(func) {
|
|
24
|
+
return typeof func === 'function' || Object.prototype.toString.call(func) === '[object Function]';
|
|
25
|
+
}
|
|
26
|
+
function isNum(num) {
|
|
27
|
+
return typeof num === 'number' && !isNaN(num);
|
|
28
|
+
}
|
|
29
|
+
function int(a) {
|
|
30
|
+
return parseInt(a, 10);
|
|
31
|
+
}
|
|
32
|
+
function dontSetMe(propsName, componentName) {
|
|
33
|
+
const failed_prop_type = () => !propsName;
|
|
34
|
+
const message = `Invalid prop ${propsName} passed to ${componentName} - do not set this, set it on the child.`;
|
|
35
|
+
return _vueTypes.default.custom(failed_prop_type, message);
|
|
36
|
+
}
|
|
37
|
+
function prop_is_not_node(node) {
|
|
38
|
+
return typeof node === 'object' && node !== null && 'nodeType' in node && node.nodeType === 1;
|
|
39
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TouchEvent2 = exports.SVGElement = void 0;
|
|
7
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
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
|
+
class SVGElement extends HTMLElement {}
|
|
11
|
+
|
|
12
|
+
// Missing targetTouches
|
|
13
|
+
exports.SVGElement = SVGElement;
|
|
14
|
+
class TouchEvent2 extends TouchEvent {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
_defineProperty(this, "changedTouches", void 0);
|
|
18
|
+
_defineProperty(this, "targetTouches", void 0);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.TouchEvent2 = TouchEvent2;
|
|
@@ -0,0 +1,2 @@
|
|
|
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)})()));
|
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@marsio/vue-draggable",
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "Vue draggable component",
|
|
5
|
+
"main": "build/cjs/cjs.js",
|
|
6
|
+
"unpkg": "build/web/vue-draggable.min.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"dev": "make dev",
|
|
9
|
+
"build": "make clean build",
|
|
10
|
+
"lint": "make lint"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"/build",
|
|
14
|
+
"/typings",
|
|
15
|
+
"/vue-draggable.min.js"
|
|
16
|
+
],
|
|
17
|
+
"typings": "./typings/index.d.ts",
|
|
18
|
+
"types": "./typings/index.d.ts",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/marshal-zheng/vue-draggable.git"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"vue3",
|
|
25
|
+
"draggable"
|
|
26
|
+
],
|
|
27
|
+
"author": "Marshall",
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@babel/cli": "^7.23.0",
|
|
31
|
+
"@babel/core": "^7.23.0",
|
|
32
|
+
"@babel/eslint-parser": "^7.22.15",
|
|
33
|
+
"@babel/plugin-transform-class-properties": "^7.18.6",
|
|
34
|
+
"@babel/preset-env": "^7.22.20",
|
|
35
|
+
"@babel/preset-typescript": "^7.23.3",
|
|
36
|
+
"@types/lodash": "^4.14.202",
|
|
37
|
+
"@types/node": "^20.7.0",
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "^6.16.0",
|
|
39
|
+
"@typescript-eslint/parser": "^6.16.0",
|
|
40
|
+
"@vue/babel-plugin-jsx": "^1.1.5",
|
|
41
|
+
"@vue/eslint-config-typescript": "^12.0.0",
|
|
42
|
+
"babel-loader": "^9.1.3",
|
|
43
|
+
"babel-plugin-transform-inline-environment-variables": "^0.4.4",
|
|
44
|
+
"eslint": "^8.56.0",
|
|
45
|
+
"eslint-plugin-vue": "^9.19.2",
|
|
46
|
+
"eslint-webpack-plugin": "^4.0.1",
|
|
47
|
+
"jasmine-core": "^5.1.1",
|
|
48
|
+
"pre-commit": "^1.2.2",
|
|
49
|
+
"process": "^0.11.10",
|
|
50
|
+
"puppeteer": "^21.3.5",
|
|
51
|
+
"semver": "^7.5.4",
|
|
52
|
+
"static-server": "^3.0.0",
|
|
53
|
+
"typescript": "^5.2.2",
|
|
54
|
+
"vue-loader": "next",
|
|
55
|
+
"webpack": "^5.88.2",
|
|
56
|
+
"webpack-cli": "^5.1.4",
|
|
57
|
+
"webpack-dev-server": "^4.15.1"
|
|
58
|
+
},
|
|
59
|
+
"resolutions": {
|
|
60
|
+
"minimist": "^1.2.5"
|
|
61
|
+
},
|
|
62
|
+
"precommit": [
|
|
63
|
+
"lint"
|
|
64
|
+
],
|
|
65
|
+
"dependencies": {
|
|
66
|
+
"clsx": "^1.1.1",
|
|
67
|
+
"lodash": "^4.17.21",
|
|
68
|
+
"vue": "^3.2.23",
|
|
69
|
+
"vue-types": "^5.1.1"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
declare module 'vue-draggable' {
|
|
2
|
+
import { DefineComponent, PropType } from 'vue';
|
|
3
|
+
|
|
4
|
+
export interface DraggableBounds {
|
|
5
|
+
left?: number;
|
|
6
|
+
right?: number;
|
|
7
|
+
top?: number;
|
|
8
|
+
bottom?: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface DraggableData {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
deltaX: number;
|
|
15
|
+
deltaY: number;
|
|
16
|
+
lastX: number;
|
|
17
|
+
lastY: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type ControlPosition = { x: number; y: number };
|
|
21
|
+
export type PositionOffsetControlPosition = { x: number | string; y: number | string };
|
|
22
|
+
|
|
23
|
+
export interface DraggableProps {
|
|
24
|
+
axis?: 'both' | 'x' | 'y' | 'none';
|
|
25
|
+
bounds?: DraggableBounds | string | false;
|
|
26
|
+
defaultClassName?: string;
|
|
27
|
+
defaultClassNameDragging?: string;
|
|
28
|
+
defaultClassNameDragged?: string;
|
|
29
|
+
defaultPosition?: ControlPosition;
|
|
30
|
+
positionOffset?: PositionOffsetControlPosition;
|
|
31
|
+
position?: ControlPosition;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const Draggable: DefineComponent<DraggableProps>;
|
|
35
|
+
export default Draggable;
|
|
36
|
+
}
|