Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-virtual-draglist

Package Overview
Dependencies
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-virtual-draglist - npm Package Compare versions

Comparing version 2.7.3 to 2.7.4

2

dist/virtual-drag-list.min.js

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("vue")):"function"==typeof define&&define.amd?define(["vue"],e):(t=t||self).VirtualDragList=e(t.Vue)}(this,function(t){"use strict";function e(e,t){var n,i=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)),i}function y(i){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?e(Object(o),!0).forEach(function(t){var e,n;e=i,n=o[t=t],(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach(function(t){Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(o,t))})}return i}function O(){O=function(){return a};var a={},t=Object.prototype,l=t.hasOwnProperty,c=Object.defineProperty||function(t,e,n){t[e]=n.value},e="function"==typeof Symbol?Symbol:{},i=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function r(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{r({},"")}catch(t){r=function(t,e,n){return t[e]=n}}function s(t,e,n,i){var o,r,a,s,e=e&&e.prototype instanceof f?e:f,e=Object.create(e.prototype),i=new S(i||[]);return c(e,"_invoke",{value:(o=t,r=n,a=i,s="suspendedStart",function(t,e){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===t)throw e;return _()}for(a.method=t,a.arg=e;;){var n=a.delegate;if(n){n=function t(e,n){var i=n.method,o=e.iterator[i];if(void 0===o)return n.delegate=null,"throw"===i&&e.iterator.return&&(n.method="return",n.arg=void 0,t(e,n),"throw"===n.method)||"return"!==i&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+i+"' method")),h;i=u(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,h;o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,h):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}(n,a);if(n){if(n===h)continue;return n}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if("suspendedStart"===s)throw s="completed",a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);s="executing";n=u(o,r,a);if("normal"===n.type){if(s=a.done?"completed":"suspendedYield",n.arg===h)continue;return{value:n.arg,done:a.done}}"throw"===n.type&&(s="completed",a.method="throw",a.arg=n.arg)}})}),e}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}a.wrap=s;var h={};function f(){}function d(){}function p(){}var e={},g=(r(e,i,function(){return this}),Object.getPrototypeOf),g=g&&g(g(x([]))),m=(g&&g!==t&&l.call(g,i)&&(e=g),p.prototype=f.prototype=Object.create(e));function y(t){["next","throw","return"].forEach(function(e){r(t,e,function(t){return this._invoke(e,t)})})}function v(a,s){var e;c(this,"_invoke",{value:function(n,i){function t(){return new s(function(t,e){!function e(t,n,i,o){var r,t=u(a[t],a,n);if("throw"!==t.type)return(n=(r=t.arg).value)&&"object"==typeof n&&l.call(n,"__await")?s.resolve(n.__await).then(function(t){e("next",t,i,o)},function(t){e("throw",t,i,o)}):s.resolve(n).then(function(t){r.value=t,i(r)},function(t){return e("throw",t,i,o)});o(t.arg)}(n,i,t,e)})}return e=e?e.then(t,t):t()}})}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function x(e){if(e){var n,t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return n=-1,(t=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t}).next=t}return{next:_}}function _(){return{value:void 0,done:!0}}return c(m,"constructor",{value:d.prototype=p,configurable:!0}),c(p,"constructor",{value:d,configurable:!0}),d.displayName=r(p,o,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,r(t,o,"GeneratorFunction")),t.prototype=Object.create(m),t},a.awrap=function(t){return{__await:t}},y(v.prototype),r(v.prototype,n,function(){return this}),a.AsyncIterator=v,a.async=function(t,e,n,i,o){void 0===o&&(o=Promise);var r=new v(s(t,e,n,i),o);return a.isGeneratorFunction(e)?r:r.next().then(function(t){return t.done?t.value:r.next()})},y(m),r(m,o,"Generator"),r(m,i,function(){return this}),r(m,"toString",function(){return"[object Generator]"}),a.keys=function(t){var e,n=Object(t),i=[];for(e in n)i.push(e);return i.reverse(),function t(){for(;i.length;){var e=i.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=x,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var i=this;function t(t,e){return r.type="throw",r.arg=n,i.next=t,e&&(i.method="next",i.arg=void 0),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],r=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=l.call(o,"catchLoc"),s=l.call(o,"finallyLoc");if(a&&s){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&l.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}var r=(o=o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc?null:o)?o.completion:{};return r.type=t,r.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(r)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),w(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,i,o=this.tryEntries[e];if(o.tryLoc===t)return"throw"===(n=o.completion).type&&(i=n.arg,w(o)),i}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:x(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},a}function l(t,e,n,i,o,r,a){try{var s=t[r](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(i,o)}function c(s){return function(){var t=this,a=arguments;return new Promise(function(e,n){var i=s.apply(t,a);function o(t){l(i,e,n,o,r,"next",t)}function r(t){l(i,e,n,o,r,"throw",t)}o(void 0)})}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,a(i.key),i)}}function o(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){var n;if(t)return"string"==typeof t?r(t,e):"Map"===(n="Object"===(n=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function a(t){t=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===e?String:Number)(t);if("object"!=typeof(n=n.call(t,e||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==typeof t?t:String(t)}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var s={dataSource:{type:Array,default:function(){return[]}},dataKey:{type:String,required:!0},direction:{type:String,default:"vertical"},keeps:{type:Number,default:30},size:{type:Number},draggable:{type:[Function,String]},handle:{type:[Function,String]},group:{type:[String,Object]},delay:{type:Number,default:0},animation:{type:Number,default:150},autoScroll:{type:Boolean,default:!0},scrollThreshold:{type:Number,default:55},keepOffset:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},fallbackOnBody:{type:Boolean,default:!1},pressDelay:{type:Number,default:0},pressDelayOnTouchOnly:{type:Boolean,default:!1},rootTag:{type:String,default:"div"},wrapTag:{type:String,default:"div"},headerTag:{type:String,default:"div"},footerTag:{type:String,default:"div"},itemTag:{type:String,default:"div"},wrapClass:{type:String,default:""},wrapStyle:{type:Object},itemStyle:{type:Object},itemClass:{type:String,default:""},ghostClass:{type:String,default:""},ghostStyle:{type:Object,default:function(){return{}}},chosenClass:{type:String,default:""}},h={tag:{type:String,default:"div"},event:{type:String},dataKey:{type:[String,Number]},isHorizontal:{type:Boolean}};function v(r,t,e){function n(){for(var t,e=this,n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return c&&clearTimeout(c),l?(t=!c,c=setTimeout(function(){c=null},s),t&&(a=r.apply(this,i))):c=setTimeout(function(){r.apply(e,i)},s),a}var a,s=1<arguments.length&&void 0!==t?t:50,l=2<arguments.length&&void 0!==e&&e,c=null;return n.cancel=function(){clearTimeout(c),c=null},n}function b(t,e){return(Array.isArray(e)?e:e.replace(/\[/g,".").replace(/\]/g,".").split(".")).reduce(function(t,e){return(t||{})[e]},t)}var f=o(function t(){n(this,t),this.start=0,this.end=0,this.front=0,this.behind=0}),d=o(function t(){n(this,t),this.average=void 0,this.total=void 0,this.fixed=void 0,this.header=void 0,this.footer=void 0}),p="INIT",g="FIXED",m="DYNAMIC",w="FRONT",S="BEHIND";function x(t,e){this.options=t,this.callback=e,this.sizes=new Map,this.calcIndex=0,this.calcType=p,this.calcSize=new d,this.direction="",this.offset=0,this.range=new f,t&&this.checkIfUpdate(0,t.keeps-1)}x.prototype={constructor:x,updateUniqueKeys:function(t){this.options.uniqueKeys=t},updateSizes:function(n){var i=this;this.sizes.forEach(function(t,e){n.includes(e)||i.sizes.delete(e)})},updateRange:function(){var t,e,n=this,i=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1;10<i||(t=this.range.start,this.isFront()?t-=2:this.isBehind()&&(t+=2),e=Math.min(this.options.keeps,this.options.uniqueKeys.length),this.sizes.size>=e-2?this.handleUpdate(t,this.getEndByStart(t)):window.requestAnimationFrame?window.requestAnimationFrame(function(){return n.updateRange(i++)}):setTimeout(function(){return n.updateRange(i++)},3))},handleScroll:function(t){this.direction=t<this.offset?w:S,this.offset=t;t=this.getScrollItems(t);this.isFront()?this.handleScrollFront(t):this.isBehind()&&this.handleScrollBehind(t)},isFront:function(){return this.direction===w},isBehind:function(){return this.direction===S},isFixed:function(){return this.calcType===g},getScrollItems:function(t){var e=this.calcSize,n=e.fixed,e=e.header;if(e&&(t-=e),t<=0)return 0;if(this.isFixed())return Math.floor(t/n);for(var i,o,r=0,a=this.options.uniqueKeys.length;r<=a;){if(i=r+Math.floor((a-r)/2),(o=this.getOffsetByIndex(i))===t)return i;o<t?r=i+1:t<o&&(a=i-1)}return 0<r?--r:0},handleScrollFront:function(t){t>this.range.start||(t=Math.max(t-Math.round(this.options.keeps/3),0),this.checkIfUpdate(t,this.getEndByStart(t)))},handleScrollBehind:function(t){t<this.range.start+Math.round(this.options.keeps/3)||this.checkIfUpdate(t,this.getEndByStart(t))},checkIfUpdate:function(t,e){var n=this.options,i=n.uniqueKeys,n=n.keeps;i.length&&i.length<=n?(t=0,e=i.length-1):e-t<n-1&&(t=e-n+1),this.range.start!==t&&this.handleUpdate(t,e)},handleUpdate:function(t,e){this.range.start=t,this.range.end=e,this.range.front=this.getFrontOffset(),this.range.behind=this.getBehindOffset(),this.callback(y({},this.range))},getFrontOffset:function(){return this.isFixed()?this.calcSize.fixed*this.range.start:this.getOffsetByIndex(this.range.start)},getBehindOffset:function(){var t=this.getLastIndex();return this.isFixed()?(t-this.range.end)*this.calcSize.fixed:this.calcIndex===t?this.getOffsetByIndex(t)-this.getOffsetByIndex(this.range.end):(t-this.range.end)*this.getItemSize()},getOffsetByIndex:function(t){if(!t)return 0;for(var e=0,n=0;n<t;n++){var i=this.sizes.get(this.options.uniqueKeys[n]);e+="number"==typeof i?i:this.getItemSize()}return this.calcIndex=Math.max(this.calcIndex,t-1),this.calcIndex=Math.min(this.calcIndex,this.getLastIndex()),e},getEndByStart:function(t){return Math.min(t+this.options.keeps-1,this.getLastIndex())},getLastIndex:function(){var t=this.options,e=t.uniqueKeys,t=t.keeps;return 0<e.length?e.length-1:t-1},getItemSize:function(){return this.isFixed()?this.calcSize.fixed:this.calcSize.average||this.options.size},handleItemSizeChange:function(t,e){this.sizes.set(t,e),this.calcType===p?(this.calcType=g,this.calcSize.fixed=e):this.isFixed()&&this.calcSize.fixed!==e&&(this.calcType=m,this.calcSize.fixed=void 0),this.calcType!==g&&(this.calcSize.total=u(this.sizes.values()).reduce(function(t,e){return t+e},0),this.calcSize.average=Math.round(this.calcSize.total/this.sizes.size))},handleSlotSizeChange:function(t,e){this.calcSize[t]=e}};(function(B){function K(e,t){var n,i=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)),i}function l(o){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?K(Object(r),!0).forEach(function(t){var e,n=o,i=r[t];(t="symbol"==typeof(e=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return String(t);if("object"!=typeof(e=e.call(t,"string")))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t))?e:String(e))in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(r)):K(Object(r)).forEach(function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(r,t))})}return o}function M(t){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function t(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}function o(t,e){t.style["".concat(b,"TransitionDuration")]=null==e?"":"".concat(e,"ms")}function c(t,e){t.style["".concat(b,"Transform")]=e?"".concat(e):""}function u(t,e,n){window.addEventListener?t.addEventListener(e,n,!(!G&&y)&&i):window.attachEvent&&t.attachEvent("on"+e,n)}function n(t,e,n){window.removeEventListener?t.removeEventListener(e,n,!(!G&&y)&&i):window.detachEvent&&t.detachEvent("on"+e,n)}function F(t){var e=t,n=t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0],t=n?document.elementFromPoint(n.clientX,n.clientY):t.target;return!n||"clientX"in e||(e.clientX=n.clientX,e.clientY=n.clientY,e.pageX=n.pageX,e.pageY=n.pageY,e.screenX=n.screenX,e.screenY=n.screenY),{touch:n,event:e,target:t}}function h(t,e){for(var n={top:0,left:0,height:t.offsetHeight,width:t.offsetWidth};n.top+=t.offsetTop,n.left+=t.offsetLeft,(t=t.parentNode)&&t!==e;);return n}function d(){return document.scrollingElement||document.documentElement}function g(t){var e,n,i,o,r,a,s,l=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},c=2<arguments.length?arguments[2]:void 0;if(t.getBoundingClientRect||t===window){if(t!==window&&t.parentNode&&t!==d()){if(n=(e=t.getBoundingClientRect()).top,i=e.left,o=e.bottom,r=e.right,a=e.height,s=e.width,l.parent&&t.parentNode!==t.ownerDocument.body)for(var u,h=t.parentNode;h&&h.getBoundingClientRect&&h!==t.ownerDocument.body;){if((u=h.getBoundingClientRect()).height<a)return n=u.top,i=u.left,o=u.bottom,r=u.right,a=u.height,{top:n,left:i,bottom:o,right:r,width:s=u.width,height:a};h=h.parentNode}}else i=n=0,o=window.innerHeight,r=window.innerWidth,a=window.innerHeight,s=window.innerWidth;if((l.block||l.relative)&&t!==window&&(c=c||t.parentNode,!y))do{if(c&&c.getBoundingClientRect&&("none"!==p(c,"transform")||l.relative&&"static"!==p(c,"position"))){var f=c.getBoundingClientRect();n-=f.top+parseInt(p(c,"border-top-width")),i-=f.left+parseInt(p(c,"border-left-width")),o=n+e.height,r=i+e.width;break}}while(c=c.parentNode);return{top:n,left:i,bottom:o,right:r,width:s,height:a}}}function A(t,e,n,i){if(t){n=n||document;do{if(null==e){var o=Array.prototype.slice.call(n.children),r=o.indexOf(t);if(-1<r)return o[r];for(var a=0;a<o.length;a++)if(R(t,o[a]))return o[a]}else if((">"!==e[0]||t.parentNode===n)&&q(t,e)||i&&t===n)return t}while(t=t.parentNode)}return null}function R(t,e){if(t&&e){if(e.compareDocumentPosition)return e===t||16&e.compareDocumentPosition(t);if(e.contains&&1===t.nodeType)return e.contains(t)&&e!==t;for(;t=t.parentNode;)if(t===e)return 1}}function f(t,e,n){var i;t&&e&&(t.classList?t.classList[n?"add":"remove"](e):(i=(" "+t.className+" ").replace(s," ").replace(" "+e+" "," "),t.className=(i+(n?" "+e:"")).replace(s," ")))}function q(t,e){if(e&&(">"===e[0]&&(e=e.substring(1)),t))try{return t.matches?t.matches(e):t.msMatchesSelector?t.msMatchesSelector(e):t.webkitMatchesSelector&&t.webkitMatchesSelector(e)}catch(t){}}function H(t,e){return t.top!==e.top||t.left!==e.left}function p(t,e,n){var i=t&&t.style;if(i){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];i[e=e in i||-1!==e.indexOf("webkit")?e:"-webkit-"+e]=n+("string"==typeof n?"":"px")}}function $(t){this.options=t||{},this.groupName=t.group.name||"group_"+Number(Math.random().toString().slice(-3)+Date.now()).toString(32)}function Y(){this.autoScrollAnimationFrame=null,this.speed={x:10,y:10}}function X(t){this.options=t,this.animations=[]}function V(){this.helper=null,this.distance={x:0,y:0}}function r(){var t,e={from:l({},C),to:l({},j)};return N&&(t={from:l({},S),to:l({},x)},e.from=l(l({},t.from),e.from),e.to=l(l({},t.to),e.to)),e}function a(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));(t[w]=this).el=t,this.ownerDocument=t.ownerDocument,this.options=e=Object.assign({},e);var n,i,o={disabled:!1,group:"",animation:150,multiple:!1,draggable:null,handle:null,onDrag:null,onMove:null,onDrop:null,onChange:null,autoScroll:!0,scrollThreshold:25,delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,ghostClass:"",ghostStyle:{},chosenClass:"",selectedClass:"",fallbackOnBody:!1,stopPropagation:!1,supportTouch:"ontouchstart"in window,emptyInsertThreshold:5};for(n in o)n in this.options||(this.options[n]=o[n]);for(i in tt(e),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));u(t,this.options.supportTouch?"touchstart":"mousedown",this._onDrag),D.push(t),this.multiplayer=new $(this.options),this.animator=new X(this.options)}var i,s,m,U,y,W,v,G,b,w,e,S,x,_,O,T,E,I,z,N,J,Z,L,D,k,Q,C,j,P,tt;B.exports=(i={capture:!1,passive:!1},s=/\s+/g,m={start:["touchstart","mousedown"],move:["touchmove","mousemove"],end:["touchend","touchcancel","mouseup"]},y=t(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),W=t(/Edge/i),v=t(/safari/i)&&!t(/chrome/i)&&!t(/android/i),U=!1,document.addEventListener("checkIfSupportPassive",null,{get passive(){return U=!0}}),G=U,b="undefined"==typeof window||"undefined"==typeof document?"":(e=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],"ms"!==(e=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1])?e&&e.length?e[0].toUpperCase()+e.substr(1):"":"ms"),w="Sortable"+Date.now(),S=l({},e={sortable:null,nodes:[]}),x=l({},e),_={},$.prototype={allowDrag:function(t){return this.options.multiple&&_[this.groupName]&&_[this.groupName].length&&-1<_[this.groupName].indexOf(t)},getHelper:function(){var n=document.createElement("div");return _[this.groupName].forEach(function(t,e){(t=t.cloneNode(!0)).style="\n opacity: ".concat(0===e?1:.5,";\n position: absolute;\n z-index: ").concat(e,";\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n "),n.appendChild(t)}),n},select:function(t,e,n,i){var o;e&&(_[this.groupName]||(_[this.groupName]=[]),o=_[this.groupName].indexOf(e),f(e,this.options.selectedClass,o<0),t=l(l({},i),{},{event:t}),o<0?(_[this.groupName].push(e),i.sortable._dispatchEvent("onSelect",t)):(_[this.groupName].splice(o,1),i.sortable._dispatchEvent("onDeselect",t)),_[this.groupName].sort(function(t,e){return t=h(t,n),e=h(e,n),t.top==e.top?t.left-e.left:t.top-e.top}))},onDrag:function(e,t){S.sortable=t,S.nodes=_[this.groupName].map(function(t){return{node:t,rect:g(t),offset:h(t,e)}}),x.sortable=t},onTrulyStarted:function(e,t){t.animator.collect(e,null,e.parentNode),_[this.groupName].forEach(function(t){t!=e&&t.parentNode.removeChild(t)}),t.animator.animate()},onChange:function(t,e){var n=g(t),i=h(t,e.el);x.sortable=e,x.nodes=_[this.groupName].map(function(t){return{node:t,rect:n,offset:i}})},onDrop:function(t,n,e,i,o){var r=this,a=(x.sortable.animator.collect(n,null,n.parentNode),_[this.groupName].indexOf(n)),i=(_[this.groupName].forEach(function(t,e){e<a?n.parentNode.insertBefore(t,n):(e=0<e?_[r.groupName][e-1]:n,n.parentNode.insertBefore(t,e.nextSibling))}),S.sortable=i.sortable,x.nodes=_[this.groupName].map(function(t){return{node:t,rect:g(t),offset:h(t,e)}}),x.sortable.el!=S.sortable.el||this._offsetChanged(S.nodes,x.nodes)),o=l(l({},o()),{},{changed:i,event:t});x.sortable.el!=S.sortable.el&&S.sortable._dispatchEvent("onDrop",o),x.sortable._dispatchEvent("onDrop",o),x.sortable.animator.animate()},_offsetChanged:function(t,n){return!!t.find(function(e){return H(n.find(function(t){return t.node===e.node}).offset,e.offset)})}},window.requestAnimationFrame||(window.requestAnimationFrame=function(t){return setTimeout(t,17)}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),Y.prototype={clear:function(){null!=this.autoScrollAnimationFrame&&(cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=null)},update:function(t,e,n,i){var o=this;cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=requestAnimationFrame(function(){n&&i&&o.autoScroll(t,e,i),o.update(t,e,n,i)})},autoScroll:function(t,e,n){var i,o,r,a,s,l,c,u,h,f,d,p;t&&(i=n.clientX,n=n.clientY,void 0!==i)&&void 0!==n&&(h=g(t))&&(d=t.scrollTop,o=t.scrollLeft,r=t.scrollHeight,f=t.scrollWidth,a=h.top,s=h.right,l=h.bottom,c=h.left,p=h.height,h=h.width,n<a||s<i||l<n||i<c||(u=0<d&&a<=n&&n<=a+e,h=o+h<f&&i<=s&&s-e<=i,f=d+p<r&&n<=l&&l-e<=n,(p=d=0)<o&&c<=i&&i<=c+e&&(d=Math.floor(Math.max(-1,(i-c)/e-1)*this.speed.x)),h&&(d=Math.ceil(Math.min(1,(i-s)/e+1)*this.speed.x)),u&&(p=Math.floor(Math.max(-1,(n-a)/e-1)*this.speed.y)),(p=f?Math.ceil(Math.min(1,(n-l)/e+1)*this.speed.y):p)&&(t.scrollTop+=p),d&&(t.scrollLeft+=d)))}},X.prototype={collect:function(t,e,n,i){var o=this;n&&(n=Array.prototype.slice.call(n.children),e=(t=this._getRange(n,t,e,i)).start,t=t.end,this.animations.length=0,n.slice(e,t+1).forEach(function(t){t!==i&&t!==a.helper&&o.animations.push({node:t,rect:g(t)})}))},animate:function(){var n=this;this.animations.forEach(function(t){var e=t.node,t=t.rect;n._excute(e,t)})},_excute:function(t,e){var n=e.left,e=(e=e.top)-(i=g(t)).top,n=n-i.left,i=(o(t),c(t,"translate3d(".concat(n,"px, ").concat(e,"px, 0)")),t.offsetWidth,this.options.animation);o(t,i),c(t,"translate3d(0px, 0px, 0px)"),clearTimeout(t.animated),t.animated=setTimeout(function(){o(t),c(t,""),t.animated=null},i)},_getRange:function(t,e,n){var i,e=t.indexOf(e);return(n=t.indexOf(n))<e&&(e=(i=[n,e])[0],n=i[1]),e<0&&(e=n,n=t.length-1),{start:e,end:n=n<0?t.length-1:n}}},V.prototype={get node(){return this.helper},destroy:function(){this.helper&&this.helper.parentNode&&this.helper.parentNode.removeChild(this.helper),this.helper=null,this.distance={x:0,y:0}},move:function(t,e){this.helper&&c(this.helper,"translate3d(".concat(t,"px, ").concat(e,"px, 0)"))},init:function(t,e,n,i){if(!this.helper){var o,r=i.fallbackOnBody,a=i.ghostClass,i=void 0===(i=i.ghostStyle)?{}:i,r=r?document.body:n,s=(this.helper=e.cloneNode(!0),f(this.helper,a,!0),l({"box-sizing":"border-box",top:t.top,left:t.left,width:t.width,height:t.height,position:"fixed",opacity:"0.8","z-index":1e5,"pointer-events":"none"},i));for(o in s)p(this.helper,o,s[o]);e="none",(n=this.helper).style["".concat(b,"Transition")]=e?"none"===e?"none":"".concat(e):"",c(this.helper,"translate3d(0px, 0px, 0px)"),r.appendChild(this.helper),a=this.distance.x/parseInt(this.helper.style.width)*100,t=this.distance.y/parseInt(this.helper.style.height)*100,p(this.helper,"transform-origin","".concat(a,"% ").concat(t,"%")),p(this.helper,"transform","translateZ(0)"),p(this.helper,"will-change","transform")}}},L={sortable:null,group:null,node:null,rect:{},offset:{}},D=[],k=new V,Q=new Y,C=l({},L),j=l({},L),P={x:0,y:0},tt=function(t){var e={},n=t.group;n&&"object"==M(n)||(n={name:n,pull:!0,put:!0}),e.name=n.name,e.pull=n.pull,e.put=n.put,t.group=e},(a.prototype={constructor:a,destroy:function(){this._dispatchEvent("destroy",this),this.el[w]=null;for(var t=0;t<m.start.length;t++)n(this.el,m.start[t],this._onDrag);this._clearState(),D.splice(D.indexOf(this.el),1),this.el=null},option:function(t,e){var n=this.options;if(void 0===e)return n[t];n[t]=e,"group"===t&&tt(n)},_onDrag:function(t){if(!this.options.disabled&&this.options.group.pull&&(!/mousedown|pointerdown/.test(t.type)||0===t.button)){var e=(i=F(t)).touch,n=i.event,i=i.target;if(!(v&&i&&"SELECT"===i.tagName.toUpperCase()||i===this.el)){var o=this.options,r=o.draggable;if(("function"!=typeof(o=o.handle)||o(t))&&("string"!=typeof o||q(i,o))){if("function"==typeof r){if(!(o=r(t)))return;!function(t){if(t){var e=document.createElement("div");try{return e.appendChild(t.cloneNode(!0)),1==t.nodeType}catch(e){return t==window||t==document}}}(o)||(T=o)}else T=A(i,r,this.el,!1);T&&!T.animated&&this._prepareStart(e,n)}}}},_prepareStart:function(t,e){var n=this,i=T.parentNode,o=((I=e).sortable=this,I.group=T.parentNode,(N=this.options.multiple&&this.multiplayer.allowDrag(T))&&this.multiplayer.onDrag(this.el,this),g(T)),r=h(T,this.el);C={sortable:this,group:i,node:T,rect:o,offset:r},j.group=i,j.sortable=this,k.distance={x:e.clientX-o.left,y:e.clientY-o.top},u(document,"touchend",this._onDrop),u(document,"touchcancel",this._onDrop),u(document,"mouseup",this._onDrop);i=(r=this.options).delay,e=r.delayOnTouchOnly;if(!i||e&&!t||W||y)this._onStart(t);else{for(var a=0;a<m.end.length;a++)u(this.ownerDocument,m.end[a],this._cancelStart);for(var s=0;s<m.move.length;s++)u(this.ownerDocument,m.move[s],this._delayMoveHandler);Z=setTimeout(function(){return n._onStart(t)},i)}},_delayMoveHandler:function(t){t=t.touches?t.touches[0]:t,Math.max(Math.abs(t.clientX-I.clientX),Math.abs(t.clientY-I.clientY))>=Math.floor(this.options.touchStartThreshold/(window.devicePixelRatio||1))&&this._cancelStart()},_cancelStart:function(){clearTimeout(Z);for(var t=0;t<m.end.length;t++)n(this.ownerDocument,m.end[t],this._cancelStart);for(var e=0;e<m.move.length;e++)n(this.ownerDocument,m.move[e],this._delayMoveHandler)},_onStart:function(t){O=this.el,u(document,t?"touchmove":"mousemove",this._nearestSortable);try{document.selection?setTimeout(function(){document.selection.empty()},0):window.getSelection().removeAllRanges()}catch(t){}},_onTrulyStarted:function(){var t;z||(this._dispatchEvent("onDrag",l(l({},r()),{},{event:I})),N&&this.multiplayer.onTrulyStarted(T,this),t=N?this.multiplayer.getHelper():T,k.init(C.rect,t,this.el,this.options),a.helper=k.node,f(T,this.options.chosenClass,!0),v&&p(document.body,"user-select","none"))},_nearestSortable:function(t){var e,n,i,o,r,a,s;this._preventEvent(t),I&&T&&(e=t.clientX,n=t.clientY,i=e-P.x,o=n-P.y,P.x=e,P.y=n,void 0!==e&&void 0!==n&&Math.abs(i)<=0&&Math.abs(o)<=0||(n=(e=F(t)).event,i=e.target,r=n.clientX,a=n.clientY,D.some(function(t){var e,n,i=t[w].options.emptyInsertThreshold;if(i)return n=g(t,{parent:!0}),e=r>=n.left-i&&r<=n.right+i,n=a>=n.top-i&&a<=n.bottom+i,e&&n?s=t:void 0}),o=s,this._onTrulyStarted(),z=n,k.move(n.clientX-I.clientX,n.clientY-I.clientY),this._autoScroll(i),o&&(O=o)[w]._onMove(n,i)))},_allowPut:function(){var t,e;return I.sortable.el===this.el||!!this.options.group.put&&(t=this.options.group.name,(e=I.sortable.options.group).name)&&t&&e.name===t},_onMove:function(t,e){if(this._dispatchEvent("onMove",l(l({},r()),{},{event:t})),this._allowPut()){if(E=A(e,this.options.draggable,O,!1)){if(E===J)return;if((J=E)===T)return;if(E.animated||R(E,T))return}O!==C.sortable.el?e!==O&&function(t,e){for(var n=t.lastElementChild;n&&(n===e||"none"===p(n,"display"));)n=n.previousElementSibling;return n}(O,k.node)?E&&this._onInsert(t,!1):this._onInsert(t,!0):E&&this._onChange(t)}},_autoScroll:function(n){var n=function(){if(n&&n.getBoundingClientRect){var t=n;do{if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var e=p(t);if(t.clientWidth<t.scrollWidth&&("auto"==e.overflowX||"scroll"==e.overflowX)||t.clientHeight<t.scrollHeight&&("auto"==e.overflowY||"scroll"==e.overflowY))return t.getBoundingClientRect&&t!==document.body?t:d()}}while(t=t.parentNode)}return d()}(),t=(e=this.options).autoScroll,e=e.scrollThreshold;t&&Q.update(n,e,I,z)},_onInsert:function(t,e){var n=e?T:E,i=e?O:E.parentNode;C.sortable.animator.collect(T,null,T.parentNode,T),this.animator.collect(null,n,i,T),N&&this.multiplayer.onChange(T,this),j={sortable:this,group:i,node:n,rect:g(n),offset:h(n,O)},C.sortable._dispatchEvent("onRemove",l(l({},r()),{},{event:t})),e?i.appendChild(T):i.insertBefore(T,E),this._dispatchEvent("onAdd",l(l({},r()),{},{event:t})),C.sortable.animator.animate(),this.animator.animate(),C.group=i,C.sortable=this},_onChange:function(t){var e=E.parentNode;this.animator.collect(T,E,e),N&&this.multiplayer.onChange(T,this),j={sortable:this,group:e,node:E,rect:g(E),offset:h(E,O)},this._dispatchEvent("onChange",l(l({},r()),{},{event:t}));t=(t=h(T,O)).top===j.offset.top?t.left<j.offset.left?E.nextSibling:E:t.top<j.offset.top?E.nextSibling:E;e.insertBefore(T,t),this.animator.animate(),C.group=e,C.sortable=this},_onDrop:function(t){this._unbindMoveEvents(),this._unbindDropEvents(),this._preventEvent(t),this._cancelStart(),Q.clear(),T&&f(T,this.options.chosenClass,!1),T&&I&&z?this._onEnd(t):this.options.multiple&&this.multiplayer.select(t,T,O,l({},C)),this._clearState()},_onEnd:function(t){var e;C.group=I.group,C.sortable=I.sortable,N?this.multiplayer.onDrop(t,T,O,I,r):(j.rect=g(T),j.offset=h(T,O),e=j.sortable.el!==C.sortable.el||H(C.offset,j.offset),e=l(l({},r()),{},{changed:e,event:t}),j.sortable.el!==C.sortable.el&&C.sortable._dispatchEvent("onDrop",e),j.sortable._dispatchEvent("onDrop",e)),v&&p(document.body,"user-select","")},_preventEvent:function(t){void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),this.options.stopPropagation&&(t&&t.stopPropagation?t.stopPropagation():window.event.cancelBubble=!0)},_dispatchEvent:function(t,e){"function"==typeof(t=this.options[t])&&t(e)},_clearState:function(){T=E=I=z=N=J=Z=a.helper=null,P={x:0,y:0},C=j=l({},L),k.destroy()},_unbindMoveEvents:function(){for(var t=0;t<m.move.length;t++)n(document,m.move[t],this._nearestSortable)},_unbindDropEvents:function(){for(var t=0;t<m.end.length;t++)n(document,m.end[t],this._onDrop)}}).utils={getRect:g,getOffset:h},a.get=function(t){return t[w]},a.create=function(t,e){return new a(t,e)},a)})(k={exports:{}});var _=k.exports,T="virtualSortableState",E={from:{},to:{}};function I(){}I.prototype={constructor:I,clear:function(){localStorage.removeItem(T)},getStore:function(){try{return JSON.parse(localStorage.getItem(T))||E}catch(t){return E}},getValue:function(){return new Promise(function(t,e){try{t(JSON.parse(localStorage.getItem(T))||E)}catch(t){e(E)}})},setValue:function(o){return new Promise(function(t,e){try{var n=JSON.parse(localStorage.getItem(T)),i=JSON.stringify(y(y({},n),o));localStorage.setItem(T,i),t(i)}catch(t){e(E)}})}};var z=new I,N=["group","handle","disabled","draggable","ghostClass","ghostStyle","chosenClass","animation","autoScroll","scrollThreshold","fallbackOnBody","pressDelay","pressDelayOnTouchOnly"],L=null;function D(t,e){this.context=t,this.callback=e,this.initialList=u(t.list),this.dynamicList=u(t.list),this.sortable=null,this.rangeChanged=!1,this._init()}D.prototype={constructor:D,destroy:function(){this.sortable&&this.sortable.destroy(),this.sortable=null},setValue:function(t,e){"list"===t?(this.initialList=u(e),L&&this._onDrag(L,!1)):(this.context[t]=e,this.sortable.option(t,e))},_init:function(){var i=this,t=N.reduce(function(t,e){return t["pressDelayOnTouchOnly"===e?"delayOnTouchOnly":"pressDelay"===e?"delay":e]=i.context[e],t},{});this.sortable=new _(this.context.$refs.group,y(y({},t),{},{list:this.dynamicList,onDrag:function(t){t=t.from;return i._onDrag(t.node)},onAdd:function(t){var e=t.from,t=t.to;return i._onAdd(e,t)},onRemove:function(t){var e=t.from,t=t.to;return i._onRemove(e,t)},onChange:function(t){var e=t.from,t=t.to;return i._onChange(e,t)},onDrop:function(t){var e=t.from,n=t.to,t=t.changed;return i._onDrop(e,n,t)}}))},_onDrag:function(o){var r=arguments,a=this;return c(O().mark(function t(){var e,n,i;return O().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=!(1<r.length&&void 0!==r[1])||r[1],L=o,a.dynamicList=u(a.initialList),n=u(a.initialList),i=a._getFromTo({node:o},n),t.next=7,z.setValue({from:y({list:n},i)});case 7:if(e)return a.rangeChanged=!1,t.next=11,z.getValue();t.next=15;break;case 11:i=t.sent,a.context.$emit("drag",y({list:n},i)),t.next=16;break;case 15:a.rangeChanged=!0;case 16:case"end":return t.stop()}},t)}))()},_onAdd:function(o,r){var a=this;return c(O().mark(function t(){var e,n,i;return O().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,z.getValue();case 2:e=t.sent,n=u(a.dynamicList),n=a._getIndex(n,r.node.dataset.key),i=y(y({},e.from),{},{index:n}),o.node===r.node?(i.index=a.dynamicList.length,a.dynamicList.push(e.from.item)):a.dynamicList.splice(n,0,e.from.item),delete i.list,a.context.$emit("add",y({},i));case 9:case"end":return t.stop()}},t)}))()},_onRemove:function(n,t){var i=this;return c(O().mark(function t(){var e;return O().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=u(i.dynamicList),e=i._getFromTo(n,e),i.dynamicList.splice(e.index,1),i.context.$emit("remove",y({},e));case 4:case"end":return t.stop()}},t)}))()},_onChange:function(i,o){var r=this;return c(O().mark(function t(){var e,n;return O().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=u(r.dynamicList),n=u(r.dynamicList),e=r._getFromTo(i,e),n=r._getFromTo(o,n),r.dynamicList.splice(e.index,1),r.dynamicList.splice(n.index,0,e.item);case 6:case"end":return t.stop()}},t)}))()},_onDrop:function(r,a,s){var l=this;return c(O().mark(function t(){var e,n,i,o;return O().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return(l.rangeChanged||r.sortable!==a.sortable)&&L&&L.remove(),e=u(l.dynamicList),i=l._getIndex(e,r.node.dataset.key),o=l.initialList[i],n=b(o,l.context.dataKey),t.next=7,z.setValue({to:{list:u(l.initialList),index:i,item:o,key:n}});case 7:return t.next=9,z.getValue();case 9:i=t.sent,o=y(y({list:e},i),{},{changed:s}),l.context.$emit("drop",o),l.callback&&l.callback(o),l.initialList=u(e),l._clear();case 15:case"end":return t.stop()}},t)}))()},_getFromTo:function(t,e){var t=t.node.dataset.key,n=this._getIndex(e,t);return{key:t,item:e[n],index:n}},_getIndex:function(t,e){var n=this;return t.findIndex(function(t){return b(t,n.context.dataKey)==e})},_clear:function(){L=null,z.clear(),this.rangeChanged=!1}};var k={inject:["virtualList"],data:function(){return{observer:null}},mounted:function(){var t=this;"undefined"!=typeof ResizeObserver&&(this.observer=new ResizeObserver(function(){t.onSizeChange()}),this.$el)&&this.observer.observe(this.$el)},updated:function(){this.onSizeChange()},beforeDestroy:function(){this.observer&&(this.observer.disconnect(),this.observer=null)},methods:{onSizeChange:function(){this.virtualList[this.event](this.dataKey,this.getCurrentSize())},getCurrentSize:function(){var t=this.isHorizontal?"offsetWidth":"offsetHeight";return this.$el?this.$el[t]:0}}},C=t.component("virtual-draglist-items",{mixins:[k],props:h,render:function(t){var e=this.tag,n=this.dataKey;return t(e,{key:n,attrs:{"data-key":n}},this.$slots.default)}}),j=t.component("virtual-draglist-slots",{mixins:[k],props:h,render:function(t){var e=this.tag,n=this.dataKey;return t(e,{key:n,attrs:{role:n}},this.$slots.default)}});return t.component("virtual-drag-list",{props:s,data:function(){return{list:[],uniqueKeys:[],virtual:null,sortable:null,lastItem:null,range:new f}},provide:function(){return{virtualList:this}},computed:{isHorizontal:function(){return"vertical"!==this.direction},scrollSizeKey:function(){return this.isHorizontal?"scrollWidth":"scrollHeight"},scrollDirectionKey:function(){return this.isHorizontal?"scrollLeft":"scrollTop"},offsetSizeKey:function(){return this.isHorizontal?"offsetLeft":"offsetTop"},clientSizeKey:function(){return this.isHorizontal?"clientWidth":"clientHeight"}},watch:{dataSource:{handler:function(t){this.init(t)},deep:!0},disabled:{handler:function(t){this.sortable&&this.sortable.setValue("disabled",t)},immediate:!0}},created:function(){this._initVirtual(),this.init(this.dataSource),this.range.end=this.keeps-1},beforeDestroy:function(){this._destroySortable()},methods:{reset:function(){this.scrollToTop(),this.init(this.dataSource)},getSize:function(t){return this.virtual.sizes.get(t)},getOffset:function(){var t=this.$refs.root;return t?Math.ceil(t[this.scrollDirectionKey]):0},scrollToTop:function(){this.$refs.root[this.scrollDirectionKey]=0},scrollToBottom:function(){var t=this,e=this.$refs,n=e.bottomItem,i=e.root;n&&(e=n[this.offsetSizeKey],this.scrollToOffset(e),setTimeout(function(){t.getOffset()+Math.ceil(i[t.clientSizeKey])+1<Math.ceil(i[t.scrollSizeKey])&&t.scrollToBottom()},5))},scrollToIndex:function(t){var e,n=this;t>=this.list.length-1?this.scrollToBottom():(e=this.virtual.getOffsetByIndex(t),this.scrollToOffset(e),setTimeout(function(){n.getOffset()!==n.virtual.getOffsetByIndex(t)&&n.scrollToIndex(t)},5))},scrollToOffset:function(t){this.$refs.root[this.scrollDirectionKey]=t},init:function(t){var e=this;this.list=u(t),this._updateUniqueKeys(),this.virtual.updateUniqueKeys(this.uniqueKeys),this.virtual.updateSizes(this.uniqueKeys),this.$nextTick(function(){return e.virtual.updateRange()}),this.sortable?this.sortable.setValue("list",u(t)):this.$nextTick(function(){return e._initSortable()}),this.lastItem&&this.keepOffset&&(t=this._getItemIndex(this.lastItem),this.scrollToIndex(t),this.lastItem=null)},_initVirtual:function(){var i=this;this.virtual=new x({size:this.size,keeps:this.keeps,uniqueKeys:this.uniqueKeys},function(t){var e,n;i.range=t,i.sortable&&(t=z.getStore(),e=(n=i.range).start,n=n.end,-1<(t=t.from.index))&&!(e<=t&&t<=n)&&(i.sortable.rangeChanged=!0)}),this.virtual.updateSizes(this.uniqueKeys),this.virtual.updateRange()},_initSortable:function(){var n=this;this.sortable=new D(this,function(t){var e=t.list;t.changed&&(n.sortable.rangeChanged&&n.virtual.direction&&0<n.range.start&&-1<(t=e.indexOf(n.list[n.range.start]))&&(n.range.start=t,n.range.end=t+n.keeps-1),n.list=[],n.$nextTick(function(){n.list=u(e),n._updateUniqueKeys(),n.virtual.updateUniqueKeys(n.uniqueKeys)}))})},_destroySortable:function(){this.sortable&&this.sortable.destroy(),this.sortable=null},_handleScroll:function(){var t=this.$refs.root,e=this.getOffset(),n=Math.ceil(t[this.clientSizeKey]),t=Math.ceil(t[this.scrollSizeKey]);!t||e<0||t+1<e+n||(this.virtual.handleScroll(e),this.virtual.isFront()?this.list.length&&e<=0&&this.handleToTop(this):this.virtual.isBehind()&&t<=n+e&&this.handleToBottom(this))},handleToTop:v(function(t){t.$emit("top"),t.lastItem=t.list[0]}),handleToBottom:v(function(t){t.$emit("bottom")}),_onItemResized:function(t,e){this.virtual.handleItemSizeChange(t,e)},_onSlotResized:function(t,e){this.virtual.handleSlotSizeChange(t,e)},_updateUniqueKeys:function(){var e=this;this.uniqueKeys=this.list.map(function(t){return b(t,e.dataKey)})},_getItemIndex:function(e){var n=this;return this.list.findIndex(function(t){return b(e,n.dataKey)==b(t,n.dataKey)})},_getItemStyle:function(t){var e=z.getStore().from.key;return this.sortable&&this.sortable.rangeChanged&&t==e?{display:"none"}:{}}},render:function(i){var o=this,t=this.$slots,e=t.header,t=t.footer,n=this.range,r=n.start,a=n.end,s=n.front,n=n.behind,l=this.isHorizontal,c=this.headerTag,u=this.footerTag,h=this.itemTag,f=this.rootTag,d=this.wrapTag,p=this.itemStyle,g=this.itemClass,m=this.wrapClass,s=y(y({},this.wrapStyle),{},{padding:l?"0px ".concat(n,"px 0px ").concat(s,"px"):"".concat(s,"px 0px ").concat(n,"px")});return i(f,{ref:"root",style:{overflow:l?"auto hidden":"hidden auto"},on:{"&scroll":v(this._handleScroll,this.delay)}},[e?i(j,{props:{tag:c,dataKey:"header",event:"_onSlotResized"}},e):null,i(d,{ref:"group",attrs:{role:"group"},class:m,style:s},this.list.slice(r,a+1).map(function(t){var e=o._getItemIndex(t),n=b(t,o.dataKey);return o.$scopedSlots.item?i(C,{key:n,props:{isHorizontal:l,dataKey:n,tag:h,event:"_onItemResized"},style:y(y({},p),o._getItemStyle(n)),class:g},o.$scopedSlots.item({record:t,index:e,dataKey:n})):i(h,{key:n,attrs:{"data-key":n},style:y(y({},p),{},{height:"".concat(o.size,"px")}),class:g},n)})),t?i(j,{props:{tag:u,dataKey:"footer",event:"_onSlotResized"}},t):null,i("div",{ref:"bottomItem",style:{width:l?"0px":"100%",height:l?"100%":"0px"}})])}})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("vue")):"function"==typeof define&&define.amd?define(["vue"],e):(t=t||self).VirtualDragList=e(t.Vue)}(this,function(t){"use strict";function e(e,t){var n,i=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)),i}function f(i){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?e(Object(o),!0).forEach(function(t){var e,n;e=i,n=o[t=t],(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach(function(t){Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(o,t))})}return i}function O(){O=function(){return s};var s={},t=Object.prototype,l=t.hasOwnProperty,c=Object.defineProperty||function(t,e,n){t[e]=n.value},e="function"==typeof Symbol?Symbol:{},i=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function r(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{r({},"")}catch(t){r=function(t,e,n){return t[e]=n}}function a(t,e,n,i){var o,r,s,a,e=e&&e.prototype instanceof f?e:f,e=Object.create(e.prototype),i=new S(i||[]);return c(e,"_invoke",{value:(o=t,r=n,s=i,a="suspendedStart",function(t,e){if("executing"===a)throw new Error("Generator is already running");if("completed"===a){if("throw"===t)throw e;return _()}for(s.method=t,s.arg=e;;){var n=s.delegate;if(n){n=function t(e,n){var i=n.method,o=e.iterator[i];if(void 0===o)return n.delegate=null,"throw"===i&&e.iterator.return&&(n.method="return",n.arg=void 0,t(e,n),"throw"===n.method)||"return"!==i&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+i+"' method")),h;i=u(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,h;o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,h):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}(n,s);if(n){if(n===h)continue;return n}}if("next"===s.method)s.sent=s._sent=s.arg;else if("throw"===s.method){if("suspendedStart"===a)throw a="completed",s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);a="executing";n=u(o,r,s);if("normal"===n.type){if(a=s.done?"completed":"suspendedYield",n.arg===h)continue;return{value:n.arg,done:s.done}}"throw"===n.type&&(a="completed",s.method="throw",s.arg=n.arg)}})}),e}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}s.wrap=a;var h={};function f(){}function d(){}function p(){}var e={},g=(r(e,i,function(){return this}),Object.getPrototypeOf),g=g&&g(g(x([]))),m=(g&&g!==t&&l.call(g,i)&&(e=g),p.prototype=f.prototype=Object.create(e));function y(t){["next","throw","return"].forEach(function(e){r(t,e,function(t){return this._invoke(e,t)})})}function v(s,a){var e;c(this,"_invoke",{value:function(n,i){function t(){return new a(function(t,e){!function e(t,n,i,o){var r,t=u(s[t],s,n);if("throw"!==t.type)return(n=(r=t.arg).value)&&"object"==typeof n&&l.call(n,"__await")?a.resolve(n.__await).then(function(t){e("next",t,i,o)},function(t){e("throw",t,i,o)}):a.resolve(n).then(function(t){r.value=t,i(r)},function(t){return e("throw",t,i,o)});o(t.arg)}(n,i,t,e)})}return e=e?e.then(t,t):t()}})}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function x(e){if(e){var n,t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return n=-1,(t=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t}).next=t}return{next:_}}function _(){return{value:void 0,done:!0}}return c(m,"constructor",{value:d.prototype=p,configurable:!0}),c(p,"constructor",{value:d,configurable:!0}),d.displayName=r(p,o,"GeneratorFunction"),s.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},s.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,r(t,o,"GeneratorFunction")),t.prototype=Object.create(m),t},s.awrap=function(t){return{__await:t}},y(v.prototype),r(v.prototype,n,function(){return this}),s.AsyncIterator=v,s.async=function(t,e,n,i,o){void 0===o&&(o=Promise);var r=new v(a(t,e,n,i),o);return s.isGeneratorFunction(e)?r:r.next().then(function(t){return t.done?t.value:r.next()})},y(m),r(m,o,"Generator"),r(m,i,function(){return this}),r(m,"toString",function(){return"[object Generator]"}),s.keys=function(t){var e,n=Object(t),i=[];for(e in n)i.push(e);return i.reverse(),function t(){for(;i.length;){var e=i.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},s.values=x,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var i=this;function t(t,e){return r.type="throw",r.arg=n,i.next=t,e&&(i.method="next",i.arg=void 0),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],r=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var s=l.call(o,"catchLoc"),a=l.call(o,"finallyLoc");if(s&&a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!a)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&l.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}var r=(o=o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc?null:o)?o.completion:{};return r.type=t,r.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(r)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),w(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,i,o=this.tryEntries[e];if(o.tryLoc===t)return"throw"===(n=o.completion).type&&(i=n.arg,w(o)),i}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:x(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},s}function l(t,e,n,i,o,r,s){try{var a=t[r](s),l=a.value}catch(t){return void n(t)}a.done?e(l):Promise.resolve(l).then(i,o)}function c(a){return function(){var t=this,s=arguments;return new Promise(function(e,n){var i=a.apply(t,s);function o(t){l(i,e,n,o,r,"next",t)}function r(t){l(i,e,n,o,r,"throw",t)}o(void 0)})}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,s(i.key),i)}}function o(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){var n;if(t)return"string"==typeof t?r(t,e):"Map"===(n="Object"===(n=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function s(t){t=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===e?String:Number)(t);if("object"!=typeof(n=n.call(t,e||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==typeof t?t:String(t)}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var a={dataSource:{type:Array,default:function(){return[]}},dataKey:{type:String,required:!0},direction:{type:String,default:"vertical"},keeps:{type:Number,default:30},size:{type:Number},pageMode:{type:Boolean,default:!1},draggable:{type:[Function,String]},handle:{type:[Function,String]},group:{type:[String,Object]},delay:{type:Number,default:0},animation:{type:Number,default:150},autoScroll:{type:Boolean,default:!0},scrollThreshold:{type:Number,default:55},keepOffset:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},fallbackOnBody:{type:Boolean,default:!1},pressDelay:{type:Number,default:0},pressDelayOnTouchOnly:{type:Boolean,default:!1},rootTag:{type:String,default:"div"},wrapTag:{type:String,default:"div"},headerTag:{type:String,default:"div"},footerTag:{type:String,default:"div"},itemTag:{type:String,default:"div"},wrapClass:{type:String,default:""},wrapStyle:{type:Object},itemStyle:{type:Object},itemClass:{type:String,default:""},ghostClass:{type:String,default:""},ghostStyle:{type:Object,default:function(){return{}}},chosenClass:{type:String,default:""}},h={tag:{type:String,default:"div"},event:{type:String},dataKey:{type:[String,Number]},sizeKey:{type:String}};function d(r,t,e){function n(){for(var t,e=this,n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return c&&clearTimeout(c),l?(t=!c,c=setTimeout(function(){c=null},a),t&&(s=r.apply(this,i))):c=setTimeout(function(){r.apply(e,i)},a),s}var s,a=1<arguments.length&&void 0!==t?t:50,l=2<arguments.length&&void 0!==e&&e,c=null;return n.cancel=function(){clearTimeout(c),c=null},n}function p(t,e){return(Array.isArray(e)?e:e.replace(/\[/g,".").replace(/\]/g,".").split(".")).reduce(function(t,e){return(t||{})[e]},t)}var g=o(function t(){n(this,t),this.start=0,this.end=0,this.front=0,this.behind=0}),m=o(function t(){n(this,t),this.average=0,this.total=0,this.fixed=0,this.header=0,this.footer=0}),y="INIT",v="FIXED",b="DYNAMIC",w="FRONT",S="BEHIND";function x(t,e){this.options=t,this.callback=e,this.sizes=new Map,this.calcType=y,this.calcSize=new m,this.direction="",this.offset=0,this.range=new g,t&&this.checkIfUpdate(0,t.keeps-1)}x.prototype={constructor:x,isFront:function(){return this.direction===w},isBehind:function(){return this.direction===S},isFixed:function(){return this.calcType===v},updateOptions:function(t,n){var i=this;this.options&&t in this.options&&("uniqueKeys"===t&&this.sizes.forEach(function(t,e){n.includes(e)||i.sizes.delete(e)}),this.options[t]=n)},updateRange:function(){var t=this.range.start;this.isFront()?t-=2:this.isBehind()&&(t+=2),t=Math.max(t,0),this.handleUpdate(t,this.getEndByStart(t))},handleItemSizeChange:function(t,e){this.sizes.set(t,e),this.calcType===y?(this.calcType=v,this.calcSize.fixed=e):this.isFixed()&&this.calcSize.fixed!==e&&(this.calcType=b,this.calcSize.fixed=void 0),this.calcType!==v&&(this.calcSize.total=u(this.sizes.values()).reduce(function(t,e){return t+e},0),this.calcSize.average=Math.round(this.calcSize.total/this.sizes.size))},handleSlotSizeChange:function(t,e){this.calcSize[t]=e},handleScroll:function(t){this.direction=t<this.offset?w:S,this.offset=t,this.isFront()?this.handleScrollFront():this.isBehind()&&this.handleScrollBehind()},handleScrollFront:function(){var t=this.getScrollItems();t>this.range.start||(t=Math.max(t-this.options.buffer,0),this.checkIfUpdate(t,this.getEndByStart(t)))},handleScrollBehind:function(){var t=this.getScrollItems();t<this.range.start+this.options.buffer||this.checkIfUpdate(t,this.getEndByStart(t))},getScrollItems:function(){var t=this.offset-this.calcSize.header;if(t<=0)return 0;if(this.isFixed())return Math.floor(t/this.calcSize.fixed);for(var e,n,i=0,o=this.options.uniqueKeys.length;i<=o;){if(e=i+Math.floor((o-i)/2),(n=this.getOffsetByIndex(e))===t)return e;n<t?i=e+1:t<n&&(o=e-1)}return 0<i?--i:0},checkIfUpdate:function(t,e){var n=this.options.keeps;this.options.uniqueKeys.length<=n?(t=0,e=this.getLastIndex()):e-t<n-1&&(t=e-n+1),this.range.start!==t&&this.handleUpdate(t,e)},handleUpdate:function(t,e){this.range.start=t,this.range.end=e,this.range.front=this.getFrontOffset(),this.range.behind=this.getBehindOffset(),this.callback(f({},this.range))},getFrontOffset:function(){return this.isFixed()?this.calcSize.fixed*this.range.start:this.getOffsetByIndex(this.range.start)},getBehindOffset:function(){var t=this.range.end,e=this.getLastIndex();return this.isFixed()?(e-t)*this.calcSize.fixed:(e-t)*this.getItemSize()},getOffsetByIndex:function(t){if(!t)return 0;for(var e=this.calcSize.header,n=0;n<t;n++){var i=this.sizes.get(this.options.uniqueKeys[n]);e+="number"==typeof i?i:this.getItemSize()}return e},getEndByStart:function(t){return Math.min(t+this.options.keeps-1,this.getLastIndex())},getLastIndex:function(){var t=this.options,e=t.uniqueKeys,t=t.keeps;return 0<e.length?e.length-1:t-1},getItemSize:function(){return this.isFixed()?this.calcSize.fixed:this.calcSize.average||this.options.size}};(function(I){function B(e,t){var n,i=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)),i}function l(o){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?B(Object(r),!0).forEach(function(t){var e,n=o,i=r[t];(t="symbol"==typeof(e=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return String(t);if("object"!=typeof(e=e.call(t,"string")))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(t))?e:String(e))in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(r)):B(Object(r)).forEach(function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(r,t))})}return o}function K(t){return(K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function t(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}function o(t,e){t.style["".concat(b,"TransitionDuration")]=null==e?"":"".concat(e,"ms")}function c(t,e){t.style["".concat(b,"Transform")]=e?"".concat(e):""}function u(t,e,n){window.addEventListener?t.addEventListener(e,n,!(!Q&&y)&&W):window.attachEvent&&t.attachEvent("on"+e,n)}function n(t,e,n){window.removeEventListener?t.removeEventListener(e,n,!(!Q&&y)&&W):window.detachEvent&&t.detachEvent("on"+e,n)}function F(t){var e=t,n=t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0],t=n?document.elementFromPoint(n.clientX,n.clientY):t.target;return!n||"clientX"in e||(e.clientX=n.clientX,e.clientY=n.clientY,e.pageX=n.pageX,e.pageY=n.pageY,e.screenX=n.screenX,e.screenY=n.screenY),{touch:n,event:e,target:t}}function h(t,e){for(var n={top:0,left:0,height:t.offsetHeight,width:t.offsetWidth};n.top+=t.offsetTop,n.left+=t.offsetLeft,(t=t.parentNode)&&t!==e;);return n}function d(){return document.scrollingElement||document.documentElement}function g(t){var e,n,i,o,r,s,a,l=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},c=2<arguments.length?arguments[2]:void 0;if(t.getBoundingClientRect||t===window){if(t!==window&&t.parentNode&&t!==d()){if(n=(e=t.getBoundingClientRect()).top,i=e.left,o=e.bottom,r=e.right,s=e.height,a=e.width,l.parent&&t.parentNode!==t.ownerDocument.body)for(var u,h=t.parentNode;h&&h.getBoundingClientRect&&h!==t.ownerDocument.body;){if((u=h.getBoundingClientRect()).height<s)return n=u.top,i=u.left,o=u.bottom,r=u.right,s=u.height,{top:n,left:i,bottom:o,right:r,width:a=u.width,height:s};h=h.parentNode}}else i=n=0,o=window.innerHeight,r=window.innerWidth,s=window.innerHeight,a=window.innerWidth;if((l.block||l.relative)&&t!==window&&(c=c||t.parentNode,!y))do{if(c&&c.getBoundingClientRect&&("none"!==p(c,"transform")||l.relative&&"static"!==p(c,"position"))){var f=c.getBoundingClientRect();n-=f.top+parseInt(p(c,"border-top-width")),i-=f.left+parseInt(p(c,"border-left-width")),o=n+e.height,r=i+e.width;break}}while(c=c.parentNode);return{top:n,left:i,bottom:o,right:r,width:a,height:s}}}function s(t,e,n,i){if(t){n=n||document;do{if(null==e){var o=Array.prototype.slice.call(n.children),r=o.indexOf(t);if(-1<r)return o[r];for(var s=0;s<o.length;s++)if(R(t,o[s]))return o[s]}else if((">"!==e[0]||t.parentNode===n)&&H(t,e)||i&&t===n)return t}while(t=t.parentNode)}return null}function R(t,e){if(t&&e){if(e.compareDocumentPosition)return e===t||16&e.compareDocumentPosition(t);if(e.contains&&1===t.nodeType)return e.contains(t)&&e!==t;for(;t=t.parentNode;)if(t===e)return 1}}function A(t,e,n){var i;t&&e&&(t.classList?t.classList[n?"add":"remove"](e):(i=(" "+t.className+" ").replace(G," ").replace(" "+e+" "," "),t.className=(i+(n?" "+e:"")).replace(G," ")))}function H(t,e){if(e&&(">"===e[0]&&(e=e.substring(1)),t))try{return t.matches?t.matches(e):t.msMatchesSelector?t.msMatchesSelector(e):t.webkitMatchesSelector&&t.webkitMatchesSelector(e)}catch(t){}}function $(t,e){return t.top!==e.top||t.left!==e.left}function p(t,e,n){var i=t&&t.style;if(i){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];i[e=e in i||-1!==e.indexOf("webkit")?e:"-webkit-"+e]=n+("string"==typeof n?"":"px")}}function Y(t,e){return t.sortable.el!==e.sortable.el}function f(t,e){p(t,"display",e?"":"none")}function X(t){this.options=t||{},this.groupName=t.group.name||"group_"+Number(Math.random().toString().slice(-3)+Date.now()).toString(32)}function q(){this.autoScrollAnimationFrame=null,this.speed={x:10,y:10}}function V(t){this.options=t,this.animations=[]}function U(){this.helper=null,this.distance={x:0,y:0}}function r(){var t,e={from:l({},M),to:l({},P)};return N&&(t={from:l({},S),to:l({},x)},e.from=l(l({},t.from),e.from),e.to=l(l({},t.to),e.to)),e}function a(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));(t[w]=this).el=t,this.ownerDocument=t.ownerDocument,this.options=e=Object.assign({},e);var n,i,o={disabled:!1,group:"",animation:150,multiple:!1,draggable:null,handle:null,onDrag:null,onMove:null,onDrop:null,onChange:null,autoScroll:!0,scrollThreshold:55,delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,ghostClass:"",ghostStyle:{},chosenClass:"",selectedClass:"",swapOnDrop:!0,fallbackOnBody:!1,stopPropagation:!1,supportTouch:"ontouchstart"in window,emptyInsertThreshold:5};for(n in o)n in this.options||(this.options[n]=o[n]);for(i in it(e),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));u(t,this.options.supportTouch?"touchstart":"mousedown",this._onDrag),C.push(t),this.multiplayer=new X(this.options),this.animator=new V(this.options)}var W,G,m,J,y,Z,v,Q,b,w,e,S,x,_,O,T,E,L,z,D,N,tt,et,i,C,k,nt,M,P,j,it;I.exports=(W={capture:!1,passive:!1},G=/\s+/g,m={start:["touchstart","mousedown"],move:["touchmove","mousemove"],end:["touchend","touchcancel","mouseup"]},y=t(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Z=t(/Edge/i),v=t(/safari/i)&&!t(/chrome/i)&&!t(/android/i),J=!1,document.addEventListener("checkIfSupportPassive",null,{get passive(){return J=!0}}),Q=J,b="undefined"==typeof window||"undefined"==typeof document?"":(e=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],"ms"!==(e=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1])?e&&e.length?e[0].toUpperCase()+e.substr(1):"":"ms"),w="Sortable"+Date.now(),S=l({},e={sortable:null,nodes:[]}),x=l({},e),_={},X.prototype={allowDrag:function(t){return this.options.multiple&&_[this.groupName]&&_[this.groupName].length&&-1<_[this.groupName].indexOf(t)},getHelper:function(){var n=document.createElement("div");return _[this.groupName].forEach(function(t,e){(t=t.cloneNode(!0)).style="\n opacity: ".concat(0===e?1:.5,";\n position: absolute;\n z-index: ").concat(e,";\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\n "),n.appendChild(t)}),n},select:function(t,e,n,i){var o;e&&(_[this.groupName]||(_[this.groupName]=[]),o=_[this.groupName].indexOf(e),A(e,this.options.selectedClass,o<0),t=l(l({},i),{},{event:t}),o<0?(_[this.groupName].push(e),i.sortable._dispatchEvent("onSelect",t)):(_[this.groupName].splice(o,1),i.sortable._dispatchEvent("onDeselect",t)),_[this.groupName].sort(function(t,e){return t=h(t,n),e=h(e,n),t.top==e.top?t.left-e.left:t.top-e.top}))},onDrag:function(e,t){S.sortable=t,S.nodes=_[this.groupName].map(function(t){return{node:t,rect:g(t),offset:h(t,e)}}),x.sortable=t},onTrulyStarted:function(e,t){t.animator.collect(e,null,e.parentNode),_[this.groupName].forEach(function(t){t!=e&&f(t,!1)}),t.animator.animate()},onChange:function(t,e){var n=g(t),i=h(t,e.el);x.sortable=e,x.nodes=_[this.groupName].map(function(t){return{node:t,rect:n,offset:i}})},onDrop:function(t,n,e,i,o){var r=this,s=(x.sortable.animator.collect(n,null,n.parentNode),_[this.groupName].indexOf(n));_[this.groupName].forEach(function(t,e){f(t,!0),e<s?n.parentNode.insertBefore(t,n):(e=0<e?_[r.groupName][e-1]:n,n.parentNode.insertBefore(t,e.nextSibling))}),S.sortable=i.sortable,x.nodes=_[this.groupName].map(function(t){return{node:t,rect:g(t),offset:h(t,e)}});var a=(i=Y(S,x))||this._offsetChanged(S.nodes,x.nodes),o=l(l({},o()),{},{changed:a,event:t});i&&S.sortable._dispatchEvent("onDrop",o),x.sortable._dispatchEvent("onDrop",o),x.sortable.animator.animate()},_offsetChanged:function(t,n){return!!t.find(function(e){return $(n.find(function(t){return t.node===e.node}).offset,e.offset)})}},window.requestAnimationFrame||(window.requestAnimationFrame=function(t){return setTimeout(t,17)}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),q.prototype={clear:function(){null!=this.autoScrollAnimationFrame&&(cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=null)},update:function(t,e,n,i){var o=this;cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=requestAnimationFrame(function(){n&&i&&o.autoScroll(t,e,i),o.update(t,e,n,i)})},autoScroll:function(t,e,n){var i,o,r,s,a,l,c,u,h,f,d,p;t&&(i=n.clientX,n=n.clientY,void 0!==i)&&void 0!==n&&(h=g(t))&&(d=t.scrollTop,o=t.scrollLeft,r=t.scrollHeight,f=t.scrollWidth,s=h.top,a=h.right,l=h.bottom,c=h.left,p=h.height,h=h.width,n<s||a<i||l<n||i<c||(u=0<d&&s<=n&&n<=s+e,h=o+h<f&&i<=a&&a-e<=i,f=d+p<r&&n<=l&&l-e<=n,(p=d=0)<o&&c<=i&&i<=c+e&&(d=Math.floor(Math.max(-1,(i-c)/e-1)*this.speed.x)),h&&(d=Math.ceil(Math.min(1,(i-a)/e+1)*this.speed.x)),u&&(p=Math.floor(Math.max(-1,(n-s)/e-1)*this.speed.y)),(p=f?Math.ceil(Math.min(1,(n-l)/e+1)*this.speed.y):p)&&(t.scrollTop+=p),d&&(t.scrollLeft+=d)))}},V.prototype={collect:function(t,e,n,i){var o=this;n&&(n=Array.prototype.slice.call(n.children),e=(t=this._getRange(n,t,e,i)).start,t=t.end,this.animations.length=0,n.slice(e,t+1).forEach(function(t){"none"!==p(t,"display")&&t!==i&&t!==a.helper&&o.animations.push({node:t,rect:g(t)})}))},animate:function(){var n=this;this.animations.forEach(function(t){var e=t.node,t=t.rect;n._excute(e,t)})},_excute:function(t,e){var n=e.left,e=(e=e.top)-(i=g(t)).top,n=n-i.left,i=(o(t),c(t,"translate3d(".concat(n,"px, ").concat(e,"px, 0)")),t.offsetWidth,this.options.animation);o(t,i),c(t,"translate3d(0px, 0px, 0px)"),clearTimeout(t.animated),t.animated=setTimeout(function(){o(t),c(t,""),t.animated=null},i)},_getRange:function(t,e,n){var i,e=t.indexOf(e);return(n=t.indexOf(n))<e&&(e=(i=[n,e])[0],n=i[1]),e<0&&(e=n,n=t.length-1),{start:e,end:n=n<0?t.length-1:n}}},U.prototype={get node(){return this.helper},destroy:function(){this.helper&&this.helper.parentNode&&this.helper.parentNode.removeChild(this.helper),this.helper=null,this.distance={x:0,y:0}},move:function(t,e){this.helper&&c(this.helper,"translate3d(".concat(t,"px, ").concat(e,"px, 0)"))},init:function(t,e,n,i){if(!this.helper){var o,r=i.fallbackOnBody,s=i.ghostClass,i=i.ghostStyle,r=r?document.body:n,a=(this.helper=e.cloneNode(!0),A(this.helper,s,!0),l({top:t.top,left:t.left,width:t.width,height:t.height,position:"fixed",opacity:"0.8","z-index":1e5,"pointer-events":"none","box-sizing":"border-box"},i));for(o in a)p(this.helper,o,a[o]);e="none",(n=this.helper).style["".concat(b,"Transition")]=e?"none"===e?"none":"".concat(e):"",c(this.helper,"translate3d(0px, 0px, 0px)"),r.appendChild(this.helper),s=this.distance.x/parseInt(this.helper.style.width)*100,t=this.distance.y/parseInt(this.helper.style.height)*100,p(this.helper,"transform-origin","".concat(s,"% ").concat(t,"%")),p(this.helper,"transform","translateZ(0)"),p(this.helper,"will-change","transform")}}},i={sortable:null,group:null,node:null,rect:{},offset:{}},C=[],k=new U,nt=new q,M=l({},i),P=l({},i),j={x:0,y:0},it=function(t){var e={},n=t.group;n&&"object"==K(n)||(n={name:n,pull:!0,put:!0}),e.name=n.name,e.pull=n.pull,e.put=n.put,t.group=e},(a.prototype={constructor:a,destroy:function(){this._dispatchEvent("destroy",this),this.el[w]=null;for(var t=0;t<m.start.length;t++)n(this.el,m.start[t],this._onDrag);this._clearState(),C.splice(C.indexOf(this.el),1),this.el=null},option:function(t,e){var n=this.options;if(void 0===e)return n[t];n[t]=e,"group"===t&&it(n)},_onDrag:function(t){if(!this.options.disabled&&this.options.group.pull&&(!/mousedown|pointerdown/.test(t.type)||0===t.button)){var e=F(t),n=e.touch,i=e.event;if(!((e=e.target)===this.el||v&&e&&"SELECT"===e.tagName.toUpperCase())){var o=this.options,r=o.draggable;if(("function"!=typeof(o=o.handle)||o(t))&&("string"!=typeof o||H(e,o))){if("function"==typeof r){if(!(o=r(t)))return;!function(t){if(t){var e=document.createElement("div");try{return e.appendChild(t.cloneNode(!0)),1==t.nodeType}catch(e){return t==window||t==document}}}(o)||(T=o)}else T=s(e,r,this.el,!1);T&&!T.animated&&(L=T.cloneNode(!0),this._prepareStart(n,i))}}}},_prepareStart:function(t,e){var n=this,i=T.parentNode,o=((z=e).sortable=this,z.group=T.parentNode,(N=this.options.multiple&&this.multiplayer.allowDrag(T))&&this.multiplayer.onDrag(this.el,this),g(T)),r=h(T,this.el);M={sortable:this,group:i,node:T,rect:o,offset:r},P.group=i,P.sortable=this,k.distance={x:e.clientX-o.left,y:e.clientY-o.top},u(document,"touchend",this._onDrop),u(document,"touchcancel",this._onDrop),u(document,"mouseup",this._onDrop);i=(r=this.options).delay,e=r.delayOnTouchOnly;if(!i||e&&!t||Z||y)this._onStart(t);else{for(var s=0;s<m.end.length;s++)u(this.ownerDocument,m.end[s],this._cancelStart);for(var a=0;a<m.move.length;a++)u(this.ownerDocument,m.move[a],this._delayMoveHandler);et=setTimeout(function(){return n._onStart(t)},i)}},_delayMoveHandler:function(t){t=t.touches?t.touches[0]:t,Math.max(Math.abs(t.clientX-z.clientX),Math.abs(t.clientY-z.clientY))>=Math.floor(this.options.touchStartThreshold/(window.devicePixelRatio||1))&&this._cancelStart()},_cancelStart:function(){clearTimeout(et);for(var t=0;t<m.end.length;t++)n(this.ownerDocument,m.end[t],this._cancelStart);for(var e=0;e<m.move.length;e++)n(this.ownerDocument,m.move[e],this._delayMoveHandler)},_onStart:function(t){O=this.el,u(document,t?"touchmove":"mousemove",this._nearestSortable);try{document.selection?setTimeout(function(){document.selection.empty()},0):window.getSelection().removeAllRanges()}catch(t){}},_onTrulyStarted:function(){var t;D||(this._dispatchEvent("onDrag",l(l({},r()),{},{event:z})),N&&this.multiplayer.onTrulyStarted(T,this),t=N?this.multiplayer.getHelper():T,k.init(M.rect,t,this.el,this.options),a.helper=k.node,f(T,!1),T.parentNode.insertBefore(L,T),A(L,this.options.chosenClass,!0),v&&p(document.body,"user-select","none"))},_nearestSortable:function(t){var e,n,i,o,r,s,a;this._preventEvent(t),!z||!T||(e=(n=t).clientX,n=n.clientY,i=e-j.x,o=n-j.y,j.x=e,j.y=n,void 0!==e&&void 0!==n&&Math.abs(i)<=0&&Math.abs(o)<=0)||(n=(e=F(t)).event,i=e.target,r=n.clientX,s=n.clientY,C.some(function(t){var e,n,i=t[w].options.emptyInsertThreshold;if(i)return n=g(t,{parent:!0}),e=r>=n.left-i&&r<=n.right+i,n=s>=n.top-i&&s<=n.bottom+i,e&&n?a=t:void 0}),o=a,this._onTrulyStarted(),D=n,k.move(n.clientX-z.clientX,n.clientY-z.clientY),this._autoScroll(i),o&&o[w]._onMove(n,i))},_allowPut:function(){var t,e;return z.sortable.el===this.el||!!this.options.group.put&&(t=this.options.group.name,(e=z.sortable.options.group).name)&&t&&e.name===t},_onMove:function(t,e){if(this._allowPut()){if(this._dispatchEvent("onMove",l(l({},r()),{},{event:t})),O=this.el,E=s(e,this.options.draggable,O,!1)){if(E===tt)return;if((tt=E)===L)return;if(E.animated||R(E,L))return}O!==M.sortable.el?e!==O&&function(t,e){for(var n=t.lastElementChild;n&&(n===e||"none"===p(n,"display"));)n=n.previousElementSibling;return n}(O,k.node)?E&&this._onInsert(t,!1):this._onInsert(t,!0):E&&this._onChange(t)}},_autoScroll:function(n){var n=function(){if(n&&n.getBoundingClientRect){var t=n;do{if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var e=p(t);if(t.clientWidth<t.scrollWidth&&("auto"==e.overflowX||"scroll"==e.overflowX)||t.clientHeight<t.scrollHeight&&("auto"==e.overflowY||"scroll"==e.overflowY))return t.getBoundingClientRect&&t!==document.body?t:d()}}while(t=t.parentNode)}return d()}(),t=(e=this.options).autoScroll,e=e.scrollThreshold;t&&nt.update(n,e,z,D)},_onInsert:function(t,e){var n=e?L:E,i=e?O:E.parentNode;M.sortable.animator.collect(L,null,L.parentNode,L),this.animator.collect(null,n,i,L),N&&this.multiplayer.onChange(L,this),P={sortable:this,group:i,node:n,rect:g(n),offset:h(n,O)},M.sortable._dispatchEvent("onRemove",l(l({},r()),{},{event:t})),e?i.appendChild(L):i.insertBefore(L,E),this._dispatchEvent("onAdd",l(l({},r()),{},{event:t})),M.sortable.animator.animate(),this.animator.animate(),M.group=i,M.sortable=this},_onChange:function(t){var e=E.parentNode;this.animator.collect(L,E,e),N&&this.multiplayer.onChange(L,this),P={sortable:this,group:e,node:E,rect:g(E),offset:h(E,O)},this._dispatchEvent("onChange",l(l({},r()),{},{event:t}));t=(t=h(L,O)).top===P.offset.top?t.left<P.offset.left?E.nextSibling:E:t.top<P.offset.top?E.nextSibling:E;e.insertBefore(L,t),this.animator.animate(),M.group=e,M.sortable=this},_onDrop:function(t){this._unbindMoveEvents(),this._unbindDropEvents(),this._preventEvent(t),this._cancelStart(),nt.clear(),T&&z&&D?this._onEnd(t):this.options.multiple&&this.multiplayer.select(t,T,O,l({},M)),this._clearState()},_onEnd:function(t){var e,n;this.options.swapOnDrop&&L.parentNode.insertBefore(T,L),M.group=z.group,M.sortable=z.sortable,P.rect=g(L),P.offset=h(L,O),N?this.multiplayer.onDrop(t,T,O,z,r):(P.node===L&&(P.node=T),n=(e=Y(M,P))||$(M.offset,P.offset),n=l(l({},r()),{},{changed:n,event:t}),e&&M.sortable._dispatchEvent("onDrop",n),P.sortable._dispatchEvent("onDrop",n)),f(T,!0),L.parentNode.removeChild(L),v&&p(document.body,"user-select","")},_preventEvent:function(t){void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),this.options.stopPropagation&&(t&&t.stopPropagation?t.stopPropagation():window.event.cancelBubble=!0)},_dispatchEvent:function(t,e){"function"==typeof(t=this.options[t])&&t(e)},_clearState:function(){T=E=L=z=D=N=tt=et=a.helper=null,j={x:0,y:0},M=P=l({},i),k.destroy()},_unbindMoveEvents:function(){for(var t=0;t<m.move.length;t++)n(document,m.move[t],this._nearestSortable)},_unbindDropEvents:function(){for(var t=0;t<m.end.length;t++)n(document,m.end[t],this._onDrop)}}).utils={on:u,off:n,css:p,closest:s,getRect:g,getOffset:h},a.get=function(t){return t[w]},a.create=function(t,e){return new a(t,e)},a)})(k={exports:{}});var _=k.exports,T="virtualSortableState",E={from:{},to:{}};function L(){}L.prototype={constructor:L,clear:function(){window[T]=void 0},getStore:function(){try{return JSON.parse(window[T])||E}catch(t){return E}},getValue:function(){return new Promise(function(t,e){try{t(JSON.parse(window[T])||E)}catch(t){e(E)}})},setValue:function(i){return new Promise(function(t,e){try{var n=f(f({},JSON.parse(window[T]||"{}")),i);window[T]=JSON.stringify(n),t(n)}catch(t){e(E)}})}};var z=new L,D=["group","handle","disabled","draggable","ghostClass","ghostStyle","chosenClass","animation","autoScroll","scrollThreshold","fallbackOnBody","pressDelay","pressDelayOnTouchOnly"],N=null;function C(t,e){this.ctx=t,this.callback=e,this.initialList=u(t.list),this.dynamicList=u(t.list),this.sortable=null,this.rangeChanged=!1,this._init()}C.prototype={constructor:C,destroy:function(){this.sortable&&this.sortable.destroy(),this.sortable=null},setValue:function(t,e){"list"===t?(this.initialList=u(e),N&&this._onDrag(N,!1)):(this.ctx[t]=e,this.sortable.option(t,e))},_init:function(){var i=this,t=D.reduce(function(t,e){return t["pressDelayOnTouchOnly"===e?"delayOnTouchOnly":"pressDelay"===e?"delay":e]=i.ctx[e],t},{});this.sortable=new _(this.ctx.$refs.groupRef,f(f({},t),{},{swapOnDrop:!1,list:this.dynamicList,onDrag:function(t){t=t.from;return i._onDrag(t.node)},onAdd:function(t){var e=t.from,t=t.to;return i._onAdd(e,t)},onRemove:function(t){var e=t.from,t=t.to;return i._onRemove(e,t)},onChange:function(t){var e=t.from,t=t.to;return i._onChange(e,t)},onDrop:function(t){var e=t.from,n=t.to,t=t.changed;return i._onDrop(e,n,t)}}))},_onDrag:function(o){var r=arguments,s=this;return c(O().mark(function t(){var e,n,i;return O().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=!(1<r.length&&void 0!==r[1])||r[1],N=o,s.dynamicList=u(s.initialList),n=u(s.initialList),i=s._getFromTo({node:o},n),t.next=7,z.setValue({from:f({list:n},i)});case 7:if(e)return s.rangeChanged=!1,t.next=11,z.getValue();t.next=15;break;case 11:i=t.sent,s.ctx.$emit("drag",f({list:n},i)),t.next=16;break;case 15:s.rangeChanged=!0;case 16:case"end":return t.stop()}},t)}))()},_onAdd:function(o,r){var s=this;return c(O().mark(function t(){var e,n,i;return O().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,z.getValue();case 2:e=t.sent,n=u(s.dynamicList),n=s._getIndex(n,r.node.dataset.key),i=f(f({},e.from),{},{index:n}),o.node===r.node?(i.index=s.dynamicList.length,s.dynamicList.push(e.from.item)):s.dynamicList.splice(n,0,e.from.item),delete i.list,s.ctx.$emit("add",f({},i));case 9:case"end":return t.stop()}},t)}))()},_onRemove:function(n,t){var i=this;return c(O().mark(function t(){var e;return O().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=u(i.dynamicList),e=i._getFromTo(n,e),i.dynamicList.splice(e.index,1),i.ctx.$emit("remove",f({},e));case 4:case"end":return t.stop()}},t)}))()},_onChange:function(i,o){var r=this;return c(O().mark(function t(){var e,n;return O().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=u(r.dynamicList),n=u(r.dynamicList),e=r._getFromTo(i,e),n=r._getFromTo(o,n),r.dynamicList.splice(e.index,1),r.dynamicList.splice(n.index,0,e.item);case 6:case"end":return t.stop()}},t)}))()},_onDrop:function(r,t,s){var a=this;return c(O().mark(function t(){var e,n,i,o;return O().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=u(a.dynamicList),i=a._getIndex(e,r.node.dataset.key),o=a.initialList[i],n=p(o,a.ctx.dataKey),t.next=6,z.setValue({to:{list:u(a.initialList),index:i,item:o,key:n}});case 6:return t.next=8,z.getValue();case 8:i=t.sent,o=f(f({list:e},i),{},{changed:s}),a.ctx.$emit("drop",o),a.callback&&a.callback(o),a.initialList=u(e),a._clear();case 14:case"end":return t.stop()}},t)}))()},_getFromTo:function(t,e){var t=t.node.dataset.key,n=this._getIndex(e,t);return{key:t,item:e[n],index:n}},_getIndex:function(t,e){for(var n=0;n<t.length;n++)if(p(t[n],this.ctx.dataKey)==e)return n;return-1},_clear:function(){N=null,z.clear(),this.rangeChanged=!1}};var k={inject:["virtualList"],data:function(){return{observer:null}},mounted:function(){var t=this;"undefined"!=typeof ResizeObserver&&(this.observer=new ResizeObserver(function(){t.onSizeChange()}),this.$el)&&this.observer.observe(this.$el)},updated:function(){this.onSizeChange()},beforeDestroy:function(){this.observer&&(this.observer.disconnect(),this.observer=null)},methods:{onSizeChange:function(){this.virtualList[this.event](this.dataKey,this.getCurrentSize())},getCurrentSize:function(){return this.$el?this.$el[this.sizeKey]:0}}},M=t.component("virtual-draglist-items",{mixins:[k],props:h,render:function(t){var e=this.tag,n=this.dataKey;return t(e,{key:n,attrs:{"data-key":n}},this.$slots.default)}}),P=t.component("virtual-draglist-slots",{mixins:[k],props:h,render:function(t){var e=this.tag,n=this.dataKey;return t(e,{key:n,attrs:{role:n}},this.$slots.default)}});return t.component("virtual-drag-list",{model:{prop:"dataSource",event:"updateDataSource"},props:a,data:function(){return{list:[],uniqueKeys:[],virtual:null,sortable:null,lastLength:null,range:new g,timer:null}},provide:function(){return{virtualList:this}},computed:{isHorizontal:function(){return"vertical"!==this.direction},scrollSizeKey:function(){return this.isHorizontal?"scrollWidth":"scrollHeight"},scrollDirectionKey:function(){return this.isHorizontal?"scrollLeft":"scrollTop"},bottomOffsetKey:function(){return this.isHorizontal?"offsetLeft":"offsetTop"},clientSizeKey:function(){return this.isHorizontal?"clientWidth":"clientHeight"},itemSizeKey:function(){return this.isHorizontal?"offsetWidth":"offsetHeight"}},watch:{"dataSource.length":function(){this.init()},disabled:function(){this.sortable&&this.sortable.setValue("disabled",val)}},activated:function(){this.scrollToOffset(this.virtual.offset),this.pageMode&&this._addPageModeScrollListener()},deactivated:function(){this.pageMode&&this._removePageModeScrollListener()},created:function(){this._debounceScroll=d(this._handleScroll,this.delay),this.range.end=this.keeps-1,this._initVirtual(),this.init()},mounted:function(){this.pageMode&&(this._updatePageModeFront(),this._addPageModeScrollListener())},beforeDestroy:function(){this._destroySortable(),this.pageMode&&this._removePageModeScrollListener()},methods:{reset:function(){this.scrollToTop(),this.init()},getSize:function(t){return this.virtual.sizes.get(t)},getOffset:function(){var t;return this.pageMode?document.documentElement[this.scrollDirectionKey]||document.body[this.scrollDirectionKey]:(t=this.$refs.rootRef)?Math.ceil(t[this.scrollDirectionKey]):0},getClientSize:function(){var t;return this.pageMode?document.documentElement[this.clientSizeKey]||document.body[this.clientSizeKey]:(t=this.$refs.rootRef)?Math.ceil(t[this.clientSizeKey]):0},getScrollSize:function(){var t;return this.pageMode?document.documentElement[this.scrollSizeKey]||document.body[this.scrollSizeKey]:(t=this.$refs.rootRef)?Math.ceil(t[this.scrollSizeKey]):0},scrollToIndex:function(t){t>=this.list.length-1?this.scrollToBottom():(t=this.virtual.getOffsetByIndex(t),this.scrollToOffset(t))},scrollToOffset:function(t){this.pageMode?(document.body[this.scrollDirectionKey]=t,document.documentElement[this.scrollDirectionKey]=t):this.$refs.rootRef[this.scrollDirectionKey]=t},scrollToTop:function(){this.scrollToOffset(0)},scrollToBottom:function(){var t=this,e=this.$refs.bottomRef;e&&(e=e[this.bottomOffsetKey],this.scrollToOffset(e),setTimeout(function(){t._scrolledToBottom()||t.scrollToBottom()},5))},init:function(){var t,e=this;this.list=u(this.dataSource),this._updateUniqueKeys(),this.virtual.sizes.size?this.virtual.updateRange():(clearTimeout(this.timer),this.timer=setTimeout(function(){return e.virtual.updateRange()},17)),this.sortable?this.sortable.setValue("list",u(this.list)):this.$nextTick(function(){return e._initSortable()}),this.lastLength&&this.keepOffset&&(t=Math.abs(this.dataSource.length-this.lastLength),this.scrollToIndex(t),this.lastLength=null)},_initVirtual:function(){var i=this;this.virtual=new x({size:this.size,keeps:this.keeps,uniqueKeys:this.uniqueKeys,buffer:Math.round(this.keeps/3)},function(t){var e,n;i.range=t,i.sortable&&(t=z.getStore(),e=(n=i.range).start,n=n.end,-1<(t=t.from.index))&&!(e<=t&&t<=n)&&(i.sortable.rangeChanged=!0)})},_initSortable:function(){var n=this;this.sortable=new C(this,function(t){var e=t.list;t.changed&&(e.length!==n.list.length&&n._updateRangeOnDrop(e),n.list=u(e),n._updateUniqueKeys(),n.$emit("updateDataSource",u(e)))})},_updateRangeOnDrop:function(t){var e,n=f({},this.range);0<this.range.start&&-1<(e=t.indexOf(this.list[this.range.start]))&&(n.start=e,n.end=e+this.keeps-1),t.length>this.list.length&&this.range.end===this.list.length-1&&this._scrolledToBottom()&&(n.end++,n.start=Math.max(0,n.end-this.keeps+1)),this.virtual.handleUpdate(n.start,n.end)},_destroySortable:function(){this.sortable&&this.sortable.destroy(),this.sortable=null},_addPageModeScrollListener:function(){document.addEventListener("scroll",this._debounceScroll,{passive:!1})},_removePageModeScrollListener:function(){document.removeEventListener("scroll",this._debounceScroll)},_handleScroll:function(){var t=this.getOffset(),e=this.getClientSize(),n=this.getScrollSize();t<0||n+1<t+e||!n||(this.virtual.handleScroll(t),this.virtual.isFront()&&this.list.length&&t<=0?this._handleToTop():this.virtual.isBehind()&&n<=e+t&&this._handleToBottom())},_scrolledToBottom:function(){var t=this.getOffset(),e=this.getClientSize();return this.getScrollSize()<=t+e+1},_handleToTop:d(function(){this.$emit("top"),this.lastLength=this.list.length}),_handleToBottom:d(function(){this.$emit("bottom")}),_onItemResized:function(t,e){this.virtual.handleItemSizeChange(t,e)},_onSlotResized:function(t,e){this.virtual.handleSlotSizeChange(t,e)},_updatePageModeFront:function(){var t,e=this.$refs.rootRef;e&&(t=e.getBoundingClientRect(),e=e.ownerDocument.defaultView,t=this.isHorizontal?t.left+e.pageXOffset:t.top+e.pageYOffset,this.virtual.handleSlotSizeChange("header",t))},_updateUniqueKeys:function(){var e=this;this.uniqueKeys=this.list.map(function(t){return p(t,e.dataKey)}),this.virtual.updateOptions("uniqueKeys",this.uniqueKeys)},_getItemStyle:function(t){var e=z.getStore().from.key;return this.sortable&&this.sortable.rangeChanged&&t==e?{display:"none"}:{}},_renderSlots:function(t,e,n){var i=this.itemSizeKey,o=this.$slots[e];return o?t(P,{props:{tag:n,dataKey:e,sizeKey:i,event:"_onSlotResized"}},o):null},_renderItems:function(t){for(var e=[],n=this.range,i=n.start,o=n.end,r=this.itemTag,s=this.itemClass,a=this.itemSizeKey,l=i;l<=o;l++){var c,u,h=this.list[l];h&&(c=p(h,this.dataKey),u=f(f({},this.itemStyle),this._getItemStyle(c)),e.push(this.$scopedSlots.item?t(M,{key:c,props:{dataKey:c,tag:r,sizeKey:a,event:"_onItemResized"},style:u,class:s},this.$scopedSlots.item({record:h,index:l,dataKey:c})):null))}return e}},render:function(t){var e=this.range,n=e.front,e=e.behind,i=this.pageMode,o=this.isHorizontal,r=this.headerTag,s=this.footerTag,a=this.rootTag,l=this.wrapTag,c=this.wrapClass,n=f(f({},this.wrapStyle),{},{padding:o?"0px ".concat(e,"px 0px ").concat(n,"px"):"".concat(n,"px 0px ").concat(e,"px")});return t(a,{ref:"rootRef",style:!i&&{overflow:o?"auto hidden":"hidden auto"},on:{"&scroll":!i&&this._debounceScroll}},[this._renderSlots(t,"header",r),t(l,{ref:"groupRef",class:c,style:n},this._renderItems(t)),this._renderSlots(t,"footer",s),t("div",{ref:"bottomRef",style:{width:o?"0px":"100%",height:o?"100%":"0px"}})])}})});
{
"name": "vue-virtual-draglist",
"version": "2.7.3",
"version": "2.7.4",
"description": "A virtual scrolling list component that can be sorted by dragging",

@@ -39,3 +39,3 @@ "main": "dist/virtual-drag-list.min.js",

"dependencies": {
"sortable-dnd": "0.5.2"
"sortable-dnd": "0.5.4"
},

@@ -42,0 +42,0 @@ "devDependencies": {

@@ -25,6 +25,7 @@ # vue-virtual-draglist

:handle="'#handle'" // use id
:data-source="list" // or replace with `v-model`
-->
<virtual-drag-list
v-model="list"
:data-key="'id'"
:data-source="list"
:handle="'.handle'"

@@ -119,2 +120,3 @@ style="height: 500px"

| `direction` | `String` | `vertical` | `vertical/horizontal`, scroll direction |
| `pageMode` | `Boolean` | `false` | Let virtual list using global document to scroll through the list |

@@ -128,3 +130,3 @@

| `disabled` | `Boolean` | `false` | Disables the sortable if set to true |
| `delay` | `Number` | `0` | Delay time of debounce function |
| `delay` | `Number` | `0` | Delay time of debounce function |
| `animation` | `Number` | `150` | Animation speed moving items when sorting |

@@ -156,5 +158,6 @@ | `autoScroll` | `Boolean` | `true` | Automatic scrolling when moving to the edge of the container |

| ------------------ | --------------- |
| `reset()` | Reset to initial |
| `getSize(key)` | Get the size of the current item by unique key value |
| `getOffset()` | Get the current scroll height |
| `getClientSize()` | Get wrapper element client viewport size (width or height) |
| `getScrollSize()` | Get all scroll size (scrollHeight or scrollWidth) |
| `scrollToTop()` | Scroll to top of list |

@@ -161,0 +164,0 @@ | `scrollToBottom()` | Scroll to bottom of list |

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc