Socket
Socket
Sign inDemoInstall

vue-virtual-draglist

Package Overview
Dependencies
Maintainers
1
Versions
94
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 3.2.3 to 3.2.4

6

dist/virtual-drag-list.min.js
/*!
* vue-virtual-draglist v3.2.3
* vue-virtual-draglist v3.2.4
* open source under the MIT license

@@ -8,6 +8,6 @@ * https://github.com/mfuu/vue3-virtual-drag-list#readme

/*!
* sortable-dnd v0.6.12
* sortable-dnd v0.6.15
* open source under the MIT license
* https://github.com/mfuu/sortable-dnd#readme
*/
!function(t,e){t.exports=function(){function t(e){return(t="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})(e)}function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},e.apply(this,arguments)}var n={capture:!1,passive:!1},o=/\s+/g;function i(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var r=i(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),s=i(/Edge/i),l=i(/safari/i)&&!i(/chrome/i)&&!i(/android/i),a=function(){var t=!1;return document.addEventListener("checkIfSupportPassive",null,{get passive(){return t=!0,!0}}),t}();function c(t,e,o){window.addEventListener?t.addEventListener(e,o,!(!a&&r)&&n):window.attachEvent?t.attachEvent("on"+e,o):t["on"+e]=o}function u(t,e,o){window.removeEventListener?t.removeEventListener(e,o,!(!a&&r)&&n):window.detachEvent?t.detachEvent("on"+e,o):t["on"+e]=null}function h(){return document.scrollingElement||document.documentElement}function d(t,e,n){if(t.getBoundingClientRect||t===window){var o,i,r,s,l,a,c;if(t!==window&&t.parentNode&&t!==h()?(i=(o=t.getBoundingClientRect()).top,r=o.left,s=o.bottom,l=o.right,a=o.height,c=o.width):(i=0,r=0,s=window.innerHeight,l=window.innerWidth,a=window.innerHeight,c=window.innerWidth),e&&t!==window){n=n||t.parentNode;do{if(n&&n.getBoundingClientRect){var u=n.getBoundingClientRect();i-=u.top+parseInt(w(n,"border-top-width")),r-=u.left+parseInt(w(n,"border-left-width")),s=i+o.height,l=r+o.width;break}}while(n=n.parentNode)}return{top:i,left:r,bottom:s,right:l,width:c,height:a}}}function f(t,e,n,o){if(!t)return null;if(n&&!e){var i=Array.prototype.slice.call(n.children),r=i.indexOf(t);if(r>-1)return i[r];for(var s=0,l=i.length;s<l;s++)if(p(t,i[s]))return i[s]}n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&S(t,e):S(t,e))||o&&t===n)return t;if(t===n)break}while(t=t.parentNode);return null}function p(t,e){if(!t||!e)return!1;if(e.compareDocumentPosition)return!!(16&e.compareDocumentPosition(t));if(e.contains&&1===t.nodeType)return e.contains(t)&&e!==t;for(;t=t.parentNode;)if(t===e)return!0;return!1}function m(t,e){for(var n=t.lastElementChild;n&&(n===ot.ghost||"none"===w(n,"display")||e&&!S(n,e));)n=n.previousElementSibling;return n||null}function g(t,e){if(!t||!t.parentNode)return-1;for(var n=0;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||e&&!S(t,e)||"none"===w(t,"display")||n++;return n}function v(t,e,n,o){for(var i=0,r=0,s=t.children;i<s.length;){if(s[i]!==ot.ghost&&"none"!==w(s[i],"display")&&f(s[i],n,t,!1)&&(o||s[i]!==ot.dragged)){if(r===e)return s[i];r++}i++}return null}function y(t,e){var n=w(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=v(t,0,e),l=v(t,1,e),a=i&&w(i),c=l&&w(l),u=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+d(i).width,h=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+d(l).width,f=s||r?"cssFloat":"float";if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&"none"!==a.float){var p="left"===a.float?"left":"right";return!l||"both"!==c.clear&&c.clear!==p?"horizontal":"vertical"}return i&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||u>=o&&"none"===n[f]||l&&"none"===n[f]&&u+h>o)?"vertical":"horizontal"}function b(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var i=(" "+t.className+" ").replace(o," ").replace(" "+e+" "," ");t.className=(i+(n?" "+e:"")).replace(o," ")}}function S(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function w(t,e,n){var o=t&&t.style;if(o){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];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function x(t,e){var n,o,i=(o=e,(n=t).compareDocumentPosition?n.compareDocumentPosition(o):n.contains?(n!=o&&n.contains(o)&&16)+(n!=o&&o.contains(n)&&8)+(n.sourceIndex>=0&&o.sourceIndex>=0?(n.sourceIndex<o.sourceIndex&&4)+(n.sourceIndex>o.sourceIndex&&2):1):0);return 2===i?1:4===i?-1:0}function E(t){void 0!==t.preventDefault&&t.cancelable&&t.preventDefault()}function T(t){var n=t.sortable,o=t.name,i=t.params,r=n.options[o];"function"==typeof r&&r(e({},i))}!function(){if("undefined"==typeof window||"undefined"==typeof document)return"";var t=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"];(Array.prototype.slice.call(t).join("").match(/-(moz|webkit|ms)-/)||""===t.OLink&&["","o"])[1]}();var O,D,I="Sortable"+Date.now();function _(t){this.options=t,this.autoScrollAnimationFrame=null}function z(t){this.options=t,this.stack=[]}function C(t){this.options=t||{},this.selectedElements=[]}window.requestAnimationFrame||(window.requestAnimationFrame=function(t){return setTimeout(t,17)}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),_.prototype={destroy:function(){this.autoScrollAnimationFrame&&(cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=null)},update:function(t,e,n){var o=this;cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=requestAnimationFrame((function(){e&&n&&o.autoScroll(t,n),o.update(t,e,n)}))},autoScroll:function(t,e){if(t&&void 0!==e.clientX&&void 0!==e.clientY){var n=d(t);if(n){var o=e.clientX,i=e.clientY,r=n.top,s=n.right,l=n.bottom,a=n.left,c=n.height,u=n.width;if(!(i<r||o>s||i>l||o<a)){var h=this.options,f=h.scrollThreshold,p=h.scrollSpeed,m=t.scrollTop,g=t.scrollLeft,v=t.scrollHeight,y=m>0&&i>=r&&i<=r+f,b=g+u<t.scrollWidth&&o<=s&&o>=s-f,S=m+c<v&&i<=l&&i>=l-f;g>0&&o>=a&&o<=a+f&&(t.scrollLeft+=Math.floor(Math.max(-1,(o-a)/f-1)*p.x)),b&&(t.scrollLeft+=Math.ceil(Math.min(1,(o-s)/f+1)*p.x)),y&&(t.scrollTop+=Math.floor(Math.max(-1,(i-r)/f-1)*p.y)),S&&(t.scrollTop+=Math.ceil(Math.min(1,(i-l)/f+1)*p.y))}}}}},z.prototype={collect:function(t){if(t){for(var e=d(t),n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,o=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,i=Math.min(e.right,n),r=Math.min(e.bottom,o),s=Array.prototype.slice.call(t.children),l=[],a=0,c=s.length;a<=c;a++){var u=s[a];if(u&&u!==ot.ghost&&"none"!==w(u,"display")){var h=d(u);if(!(h.bottom<0||h.right<0)){if(h.top-h.height>r||h.left-h.width>i)break;l.push({el:u,rect:h})}}}this.stack.push(l)}},animate:function(){for(var t=this.stack.pop(),e=0,n=t.length;e<n;e++){var o=t[e],i=o.el,r=o.rect;this.options.animation&&this._excute(i,r)}},_excute:function(t,e){var n=d(t);if(n.top!==e.top||n.left!==e.left){var o=e.left-n.left,i=e.top-n.top;w(t,"transition",""),w(t,"transform","translate3d("+o+"px, "+i+"px, 0)"),t.offsetWidth;var r=this.options,s=r.animation,l=r.easing;w(t,"transition","transform "+s+"ms"+(l?" "+l:"")),w(t,"transform","translate3d(0px, 0px, 0px)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){w(t,"transition",""),w(t,"transform",""),t.animated=null}),s)}}},C.prototype={destroy:function(){O=D=null},active:function(){return!!O},setParams:function(t){t.nodes=O||[],t.clones=D||[]},select:function(t){b(t,this.options.selectedClass,!0),this.selectedElements.push(t),this.selectedElements.sort((function(t,e){return x(t,e)}))},deselect:function(t){var e=this.selectedElements.indexOf(t);e>-1&&(b(t,this.options.selectedClass,!1),this.selectedElements.splice(e,1))},getGhostElement:function(){if(!O)return null;var t=document.createElement("div");return this.selectedElements.forEach((function(e,n){var o=e.cloneNode(!0),i=0===n?1:.5;o.style="position: absolute;left: 0;top: 0;bottom: 0;right: 0;opacity: ".concat(i,";z-index: ").concat(n,";"),t.appendChild(o)})),t},toggleSelected:function(t,e){var n=this;e?t.forEach((function(t){return n.selectedElements.push(t)})):this.selectedElements=this.selectedElements.filter((function(e){return t.indexOf(e)<0}))},toggleClass:function(t){if(O)for(var e=0;e<O.length;e++)b(O[e],this.options.chosenClass,t)},toggleVisible:function(t){if(O)if(t){var e=O.indexOf(ot.dragged);this._viewElements(O,e,ot.dragged)}else this._hideElements(O)},onChoose:function(){!this.options.multiple||!this.selectedElements.length||this.selectedElements.indexOf(ot.dragged)<0||(this.selectedElements.sort((function(t,e){return x(t,e)})),O=this.selectedElements,this.toggleClass(!0))},onDrag:function(t){O&&(t.animator.collect(ot.dragged.parentNode),this._hideElements(O),t.animator.animate(),this.toggleClass(!1))},onDrop:function(t,e,n){if(O){var o=ot.dragged,i=ot.clone,r=O.indexOf(o);e[I].animator.collect(i.parentNode),t!==e&&"clone"===n?(w(i,"display","none"),D=O.map((function(t){return t.cloneNode(!0)})),this._viewElements(D,r,i),this._viewElements(O,r,o)):this._viewElements(O,r,i),e[I].animator.animate(),t!==e&&(e[I].multiplayer.toggleSelected(D||O,!0),"clone"!==n&&t[I].multiplayer.toggleSelected(O,!1))}},onSelect:function(t,e,n){var o=this.selectedElements.indexOf(e);b(e,this.options.selectedClass,o<0);var i={from:n.el,event:t,node:e,index:g(e)};o<0?(this.selectedElements.push(e),T({sortable:n,name:"onSelect",params:i})):(this.selectedElements.splice(o,1),T({sortable:n,name:"onDeselect",params:i})),this.selectedElements.sort((function(t,e){return x(t,e)}))},_viewElements:function(t,e,n){for(var o=0;o<t.length;o++)if(w(t[o],"display",""),o<e)n.parentNode.insertBefore(t[o],n);else{var i=o>0?t[o-1]:n;n.parentNode.insertBefore(t[o],i.nextSibling)}},_hideElements:function(t){for(var e=0;e<t.length;e++)t[e]!=ot.dragged&&w(t[e],"display","none")}};var k,M,A,N,B,P,R,j,F,L,K,H,W,Y,X,U,q,V,G,$,J,Q,Z,tt=[];function et(e){var n={},o=e.group;o&&"object"==t(o)||(o={name:o,pull:!0,put:!0,revertDrag:!0}),n.name=o.name,n.pull=o.pull,n.put=o.put,n.revertDrag=o.revertDrag,e.group=n}function nt(t){var e=U||X;return!(void 0!==t.clientX&&void 0!==t.clientY&&Math.abs(t.clientX-e.clientX)<=0&&Math.abs(t.clientY-e.clientY)<=0)}function ot(t,n){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable-dnd: `el` must be an HTMLElement, not ".concat({}.toString.call(t));t[I]=this,this.el=t,this.options=n=e({},n);var o={store:null,group:"",handle:null,sortable:!0,disabled:!1,multiple:!1,lockAxis:"",direction:"",animation:150,easing:"",draggable:null,selectHandle:null,customGhost:null,autoScroll:!0,scrollThreshold:55,scrollSpeed:{x:10,y:10},delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,ghostClass:"",ghostStyle:{},chosenClass:"",selectedClass:"",swapOnDrop:!0,fallbackOnBody:!1,supportTouch:"ontouchstart"in window,emptyInsertThreshold:-1};for(var i in o)!(i in this.options)&&(this.options[i]=o[i]);for(var r in et(n),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));c(t,this.options.supportTouch?"touchstart":"mousedown",this._onDrag),tt.push(t),this.autoScroller=new _(this.options),this.multiplayer=new C(this.options),this.animator=new z(this.options)}return ot.prototype={constructor:ot,_onDrag:function(t){var e=this;if(!N&&!this.options.disabled&&this.options.group.pull&&(!/mousedown|pointerdown/.test(t.type)||0===t.button)){var n=t.touches&&t.touches[0],o=(n||t).target;if(!l||!o||"SELECT"!==o.tagName.toUpperCase()){var i=f(o,this.options.draggable,this.el);if(i&&!i.animated){X={origin:t,clientX:(n||t).clientX,clientY:(n||t).clientY},N=i,c($=n?N:document,"mouseup",this._onDrop),c($,"touchend",this._onDrop),c($,"touchcancel",this._onDrop);var a=this.options,u=a.handle,h=a.selectHandle;if("function"==typeof h&&h(t)||"string"==typeof h&&S(o,h))Z=!0;else if(("function"!=typeof u||u(t))&&("string"!=typeof u||S(o,u))){var d=this.options,p=d.delay,m=d.delayOnTouchOnly;!p||m&&!n||s||r?this._onStart(n,t):(c(this.el.ownerDocument,"touchmove",this._delayMoveHandler),c(this.el.ownerDocument,"mousemove",this._delayMoveHandler),c(this.el.ownerDocument,"mouseup",this._cancelStart),c(this.el.ownerDocument,"touchend",this._cancelStart),c(this.el.ownerDocument,"touchcancel",this._cancelStart),Q=setTimeout((function(){return e._onStart(n,t)}),p)),c(document,"selectstart",E),l&&w(document.body,"user-select","none")}}}}},_delayMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-X.clientX),Math.abs(e.clientY-X.clientY))>=Math.floor(this.options.touchStartThreshold/(window.devicePixelRatio||1))&&this._cancelStart()},_cancelStart:function(){clearTimeout(Q),u(this.el.ownerDocument,"touchmove",this._delayMoveHandler),u(this.el.ownerDocument,"mousemove",this._delayMoveHandler),u(this.el.ownerDocument,"mouseup",this._cancelStart),u(this.el.ownerDocument,"touchend",this._cancelStart),u(this.el.ownerDocument,"touchcancel",this._cancelStart),u(document,"selectstart",E),l&&w(document.body,"user-select","")},_onStart:function(t,e){var n=g(N);k=this.el,M=this.el,F=N,H=n,W=n,Y=n,V={to:this.el,target:N,newIndex:n,relative:0},G=N,A=this.el,R=N.cloneNode(!0),L=N.parentNode,K=this.options.group.pull,ot.clone=R,ot.active=this,ot.dragged=N,b(N,this.options.chosenClass,!0),this.multiplayer.onChoose(),T({sortable:this,name:"onChoose",params:this._getParams(e)}),c($,t?"touchmove":"mousemove",this._nearestSortable);try{document.selection?setTimeout((function(){return document.selection.empty()}),0):window.getSelection().removeAllRanges()}catch(t){}},_onStarted:function(){b(R,this.options.chosenClass,!0),this._appendGhost(),this.multiplayer.onDrag(this),T({sortable:this,name:"onDrag",params:this._getParams(X.origin)}),w(N,"display","none"),b(N,this.options.chosenClass,!1),N.parentNode.insertBefore(R,N)},_getGhostElement:function(){var t=this.options.customGhost;if("function"==typeof t){var e=this.multiplayer.selectedElements;return t(e.length?e:[N])}return this.multiplayer.getGhostElement()||N},_appendGhost:function(){if(!j){var t=this.options.fallbackOnBody?document.body:this.el,n=this._getGhostElement();b(j=n.cloneNode(!0),this.options.ghostClass,!0);var o=d(N),i=e({position:"fixed",top:o.top,left:o.left,width:o.width,height:o.height,zIndex:"100000",opacity:"0.8",overflow:"hidden",boxSizing:"border-box",transform:"translate3d(0px, 0px, 0px)",transition:"none",pointerEvents:"none"},this.options.ghostStyle);for(var r in i)w(j,r,i[r]);ot.ghost=j,t.appendChild(j);var s=(X.clientX-o.left)/parseInt(j.style.width)*100,l=(X.clientY-o.top)/parseInt(j.style.height)*100;w(j,"transform-origin",s+"% "+l+"%"),w(j,"will-change","transform")}},_nearestSortable:function(t){E(t);var e=t.touches&&t.touches[0]||t;if(N&&nt(e)){!U&&this._onStarted();var n=this.options.lockAxis,o="x"===n?X.clientX:e.clientX,i="y"===n?X.clientY:e.clientY,r=document.elementFromPoint(o,i),s=o-X.clientX,l=i-X.clientY;U={origin:t,clientX:o,clientY:i},w(j,"transform","translate3d("+s+"px, "+l+"px, 0)");var a,c,u,f=(a=o,c=i,tt.reduce((function(t,e){var n=e[I].options.emptyInsertThreshold;if(null!=n){var o=d(e),i=a>=o.left-n&&a<=o.right+n,r=c>=o.top-n&&c<=o.bottom+n;return i&&r&&(!u||u&&o.left>=u.left&&o.right<=u.right&&o.top>=u.top&&o.bottom<=u.bottom)&&(t=e,u=o),t}}),null));if(f&&f[I]._onMove(t,r),!f||f[I].options.autoScroll){var p=function(t,e){if(!t||!t.getBoundingClientRect)return h();var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=w(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return h();if(o||e)return n;o=!0}}}while(n=n.parentNode);return h()}(r,!0);this.autoScroller.update(p,X,U)}else this.autoScroller.destroy()}},_allowPut:function(){if(A===this.el)return!0;if(this.options.group.put){var t=this.options.group,e=t.name,n=t.put,o=A[I].options.group;return n.join&&n.indexOf(o.name)>-1||o.name&&e&&o.name===e}return!1},_getDirection:function(){var t=this.options,e=t.draggable,n=t.direction;return n?"function"==typeof n?n.call(U.origin,N,this):n:y(L,e)},_allowSwap:function(){var t=d(B),e="vertical"===this._getDirection(),n=e?"top":"left",o=e?"bottom":"right",i=B[e?"offsetHeight":"offsetWidth"],r=e?U.clientY:U.clientX,s=r>=t[n]&&r<t[o]-i/2?-1:1,l=v(L,0,this.options.draggable),a=m(L),c=d(l),u=d(a);if(B===L||p(L,B))return R===l&&r<c[n]?(P=B,!0):R===a&&r>u[o]&&(P=B.nextSibling,!0);var h=x(R,B);return P=h<0?B.nextSibling:B,q!==B?(J=s,!0):J!==s&&(J=s,s<0?h>0:h<0)},_onMove:function(t,e){if(!this.options.disabled&&this._allowPut()){if(B=f(e,this.options.draggable,this.el),T({sortable:this,name:"onMove",params:this._getParams(t,{target:B})}),this.options.sortable||this.el!==A)return this.el===M||e!==this.el&&m(this.el)?void(B&&!B.animated&&!p(B,R)&&this._allowSwap()&&(B!==R&&P!==R?(this.el!==M?this._onInsert(t):B!==N&&this._onChange(t),q=B):q=B)):(B=q=null,void this._onInsert(t));M!==A&&(B=q=N,J=0,this._onInsert(t))}},_onInsert:function(t){var e=B||R,n="clone"===K&&this.el!==A&&M===A,o="clone"===K&&this.el===A&&M!==A;k=this.el,H=g(R),F=e,L=B?B.parentNode:this.el,M[I].animator.collect(R.parentNode),this.animator.collect(L),n&&(V.target=G,V.newIndex=H,V.relative=G===N?0:x(R,G),w(N,"display",""),A[I].multiplayer.toggleVisible(!0),A[I].options.group.revertDrag||R.parentNode.insertBefore(N,R)),o&&(H=g(N),w(N,"display","none"),this.multiplayer.toggleVisible(!1)),B?L.insertBefore(R,J<0?B:B.nextSibling):L.appendChild(R),W=g(R),n&&A[I].options.group.revertDrag&&(V.target=N,V.newIndex=Y,V.relative=0,T({sortable:A[I],name:"onChange",params:this._getParams(t,{to:A,target:N,newIndex:Y,revertDrag:!0})})),n||T({sortable:M[I],name:"onRemove",params:this._getParams(t,{newIndex:-1})}),o&&e!==N&&(G=e,T({sortable:this,name:"onChange",params:this._getParams(t,{from:A,backToOrigin:!0})})),o||T({sortable:this,name:"onAdd",params:this._getParams(t,{oldIndex:-1})}),M[I].animator.animate(),this.animator.animate(),M=this.el},_onChange:function(t){H=g(R),L=B.parentNode,F=B,this.el===A&&(G=B),this.animator.collect(L),L.insertBefore(R,P),W=g(R),T({sortable:this,name:"onChange",params:this._getParams(t)}),this.animator.animate(),M=this.el},_onDrop:function(t){E(t),this._cancelStart(),u($,"touchmove",this._nearestSortable),u($,"mousemove",this._nearestSortable),u($,"mouseup",this._onDrop),u($,"touchend",this._onDrop),u($,"touchcancel",this._onDrop),b(N,this.options.chosenClass,!1),A&&(M=A,H=Y,F===R&&(F=N),this.multiplayer.toggleClass(!1),T({sortable:this,name:"onUnchoose",params:this._getParams(t)}),U&&this._onEnd(t));var e=this.options,n=e.multiple,o=e.selectHandle;n&&(o&&Z||!o&&!A)&&!nt(t.changedTouches?t.changedTouches[0]:t)&&this.multiplayer.onSelect(t,N,this),j&&j.parentNode&&j.parentNode.removeChild(j),this.autoScroller.destroy(),this.multiplayer.destroy(),this._nulling()},_onEnd:function(t){var n=this._getParams(t);this.multiplayer.onDrop(M,k,K);var o=this.options.swapOnDrop;"clone"===K&&M!==k||!("function"==typeof o?o(n):o)||L.insertBefore(N,R),"clone"!==K||M===k||this.multiplayer.active()?R&&R.parentNode&&R.parentNode.removeChild(R):b(R,this.options.chosenClass,!1),w(N,"display",""),M!==k&&T({sortable:M[I],name:"onDrop",params:e({},n,"clone"===K?V:{newIndex:-1})}),T({sortable:k[I],name:"onDrop",params:e({},n,M===k?{}:{oldIndex:-1})})},_getParams:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o={};return o.event=t,o.to=k,o.from=M,o.node=N,o.clone=R,o.target=F,o.oldIndex=H,o.newIndex=W,o.pullMode=K,this.multiplayer.setParams(o),e(o,n),o.relative=F===N?0:x(R,F),o},_nulling:function(){k=M=A=N=B=P=R=j=F=L=K=H=W=Y=X=U=q=V=G=$=J=Q=Z=ot.clone=ot.ghost=ot.active=ot.dragged=null},destroy:function(){this._cancelStart(),this._nulling(),u(this.el,"touchstart",this._onDrag),u(this.el,"mousedown",this._onDrag),tt.splice(tt.indexOf(this.el),1),this.el[I]=this.animator=this.multiplayer=this.autoScroller=null},option:function(t,e){if(void 0===e)return this.options[t];this.options[t]=e,this.animator.options[t]=e,this.multiplayer.options[t]=e,this.autoScroller.options[t]=e,"group"===t&&et(this.options)},select:function(t){this.multiplayer.select(t)},deselect:function(t){this.multiplayer.deselect(t)},getSelectedElements:function(){return this.multiplayer.selectedElements}},ot.utils={on:c,off:u,css:w,index:g,closest:f,getRect:d,toggleClass:b,detectDirection:y},ot.get=function(t){return t[I]},ot.create=function(t,e){return new ot(t,e)},ot}()}(s);var l=s.exports,a={dataSource:{},modelValue:{},dataKey:{type:String,default:"",required:!0},draggable:{type:String,default:".virtual-dnd-list-item"},sortable:{type:Boolean,default:!0},handle:{type:[Function,String]},group:{type:[Object,String]},scroller:{type:[Document,HTMLElement]},lockAxis:{type:String,default:""},direction:{type:String,default:"vertical"},keeps:{type:Number,default:30},size:{type:Number},debounceTime:{type:Number,default:0},throttleTime:{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},delay:{type:Number,default:0},delayOnTouchOnly:{type:Boolean,default:!1},rootTag:{type:String,default:"div"},wrapTag:{type:String,default:"div"},itemTag:{type:String,default:"div"},wrapClass:{type:String,default:""},wrapStyle:{type:Object,default:function(){return{}}},itemStyle:{type:Object,default:function(){return{}}},itemClass:{type:String,default:""},ghostClass:{type:String,default:""},ghostStyle:{type:Object,default:function(){return{}}},chosenClass:{type:String,default:""}},c={tag:{type:String,default:"div"},dataKey:{type:[String,Number]},sizeKey:{type:String}};function u(t,e){var n=null,o=function(){for(var o=this,i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];n||(e<=0?t.apply(this,r):n=setTimeout((function(){n=void 0,t.apply(o,r)}),e))};return o.cancel=function(){n&&(clearTimeout(n),n=null)},o}function h(t,e){return(Array.isArray(e)?e:e.replace(/\[/g,".").replace(/\]/g,".").split(".")).reduce((function(t,e){return(t||{})[e]}),t)}var d,f,p,m,g=["delay","group","handle","lockAxis","disabled","sortable","draggable","animation","autoScroll","ghostClass","ghostStyle","chosenClass","fallbackOnBody","scrollThreshold","delayOnTouchOnly"];function v(t,e){this.el=t,this.list=e.list,this.options=e,this.reRendered=!1,this.init()}v.prototype={constructor:v,destroy:function(){this.sortable&&this.sortable.destroy(),this.sortable=this.reRendered=null},option:function(t,e){"list"===t?this.list=e:this.sortable.option(t,e)},init:function(){var t=this,e=g.reduce((function(e,n){return e[n]=t.options[n],e}),{});this.sortable=new l(this.el,n(n({},e),{},{emptyInsertThreshold:0,swapOnDrop:function(t){return t.from===t.to},onDrag:function(e){return t.onDrag(e)},onDrop:function(e){return t.onDrop(e)},onAdd:function(e){return t.onAdd(e)},onRemove:function(e){return t.onRemove(e)}}))},onAdd:function(t){var e=l.get(t.from).option("store"),n=e.item,o=e.key;this.sortable.option("store",{item:n,key:o}),this.dispatchEvent("onAdd",{item:n,key:o,event:t})},onRemove:function(t){var e=l.get(t.from).option("store"),n=e.item,o=e.key;this.dispatchEvent("onRemove",{item:n,key:o,event:t})},onDrag:function(t){var e=t.node.getAttribute("data-key"),n=this.getIndex(this.list,e),o=this.list[n];this.sortable.option("store",{item:o,key:e,index:n,list:this.list}),this.dispatchEvent("onDrag",{item:o,key:e,index:n,event:t}),this.options.sortable||this.sortable.option("autoScroll",!1)},onDrop:function(t){var e=l.get(t.from).option("store");e.list;var n,o,r=e.item,s=e.key,a=e.index,c=i(this.list),u={key:s,item:r,event:t,changed:!1,list:c,oldList:this.list,oldIndex:a,newIndex:a};(t.from===t.to&&t.node===t.target||this.getDropParams(u,t,r,s,a,c),this.dispatchEvent("onDrop",u),t.from===this.el&&this.reRendered)&&(null===(n=l.dragged)||void 0===n||n.remove());t.from!==t.to&&"clone"===t.pullMode&&(null===(o=l.clone)||void 0===o||o.remove());this.reRendered=!1,this.sortable.option("autoScroll",this.options.autoScroll)},getDropParams:function(t,e,n,o,i,r){var s=e.target.getAttribute("data-key"),l=-1,a=i;e.from===e.to?(((a=this.getIndex(r,o))<(l=this.getIndex(r,s))&&-1===e.relative||a>l&&1===e.relative)&&(l+=e.relative),l!==a&&(r.splice(a,1),r.splice(l,0,n))):(e.from===this.el&&(a=this.getIndex(r,o),r.splice(a,1)),e.to===this.el&&(a=-1,l=this.getIndex(r,s),0===e.relative?l=r.length:1===e.relative&&(l+=e.relative),r.splice(l,0,n))),t.changed=e.from!==e.to||l!==a,t.list=r,t.oldIndex=a,t.newIndex=l},getIndex:function(t,e){for(var n=0;n<t.length;n++)if(h(t[n],this.options.dataKey)==e)return n;return-1},dispatchEvent:function(t,e){var n=this.options[t];n&&n(e)}};var y=["size","keeps","scroller","direction","debounceTime","throttleTime"],b="INIT",S="FIXED",w="DYNAMIC",x="FRONT",E="BEHIND",T="STATIONARY",O="horizontal",D="vertical",I=(o(d={},D,"top"),o(d,O,"left"),d),_=(o(f={},D,"scrollTop"),o(f,O,"scrollLeft"),f),z=(o(p={},D,"scrollHeight"),o(p,O,"scrollWidth"),p),C=(o(m={},D,"offsetHeight"),o(m,O,"offsetWidth"),m);function k(t){this.options=t;var e={size:0,keeps:0,buffer:0,wrapper:null,scroller:null,direction:"vertical",uniqueKeys:[],debounceTime:null,throttleTime:null};for(var n in e)!(n in this.options)&&(this.options[n]=e[n]);this.sizes=new Map,this.range={start:0,end:0,front:0,behind:0},this.offset=0,this.calcType=b,this.calcSize={average:0,total:0,fixed:0},this.scrollEl=this.getScrollElement(t.scroller),this.scrollDir="",this.updateOnScrollFunction(),this.addScrollEventListener(),this.checkIfUpdate(0,t.keeps-1)}k.prototype={constructor:k,isFront:function(){return this.scrollDir===x},isBehind:function(){return this.scrollDir===E},isFixed:function(){return this.calcType===S},getSize:function(t){return this.sizes.get(t)||this.getItemSize()},getOffset:function(){return this.scrollEl[_[this.options.direction]]},getScrollSize:function(){return this.scrollEl[z[this.options.direction]]},getClientSize:function(){return this.scrollEl[C[this.options.direction]]},scrollToOffset:function(t){this.scrollEl[_[this.options.direction]]=t},scrollToIndex:function(t){if(t>=this.options.uniqueKeys.length-1)this.scrollToBottom();else{var e=this.getOffsetByIndex(t),n=this.getScrollStartOffset();this.scrollToOffset(e+n)}},scrollToBottom:function(){var t=this,e=this.getScrollSize();this.scrollToOffset(e),setTimeout((function(){var e=t.getClientSize(),n=t.getScrollSize();t.getOffset()+e+1<n&&t.scrollToBottom()}),5)},option:function(t,e){var n=this,o=this.options[t];this.options[t]=e,"uniqueKeys"===t&&this.sizes.forEach((function(t,o){e.includes(o)||n.sizes.delete(o)})),"scroller"===t&&(o&&l.utils.off(o,"scroll",this.onScroll),this.scrollEl=this.getScrollElement(e),this.addScrollEventListener())},updateRange:function(t){if(t)this.handleUpdate(t.start,t.end);else{var e=this.range.start;e=Math.max(e,0),this.handleUpdate(e,this.getEndByStart(e))}},onItemResized:function(t,e){this.sizes.set(t,e),this.calcType===b?(this.calcType=S,this.calcSize.fixed=e):this.isFixed()&&this.calcSize.fixed!==e&&(this.calcType=w,this.calcSize.fixed=void 0),this.calcType!==S&&(this.calcSize.total=i(this.sizes.values()).reduce((function(t,e){return t+e}),0),this.calcSize.average=Math.round(this.calcSize.total/this.sizes.size))},addScrollEventListener:function(){this.options.scroller&&l.utils.on(this.options.scroller,"scroll",this.onScroll)},removeScrollEventListener:function(){this.options.scroller&&l.utils.off(this.options.scroller,"scroll",this.onScroll)},enableScroll:function(t){var e=this.options.scroller,n=t?l.utils.off:l.utils.on,o="onwheel"in document.createElement("div")?"wheel":"mousewheel";n(e,"DOMMouseScroll",this.preventDefault),n(e,o,this.preventDefault),n(e,"touchmove",this.preventDefault),n(e,"keydown",this.preventDefaultForKeyDown)},preventDefault:function(t){t.preventDefault()},preventDefaultForKeyDown:function(t){if({37:1,38:1,39:1,40:1}[t.keyCode])return this.preventDefault(t),!1},updateOnScrollFunction:function(){var t,e,n=this,o=this.options,i=o.debounceTime,r=o.throttleTime;this.onScroll=i?(t=u((function(){return n.handleScroll()}),i),e=function(){t.cancel(),t.apply(this,arguments)},e.cancel=function(){t.cancel()},e):r?u((function(){return n.handleScroll()}),r):function(){return n.handleScroll()}},handleScroll:function(){var t=this.getOffset(),e=this.getClientSize(),n=this.getScrollSize();t===this.offset?this.scrollDir=T:this.scrollDir=t<this.offset?x:E,this.offset=t;var o=this.isFront()&&t<=0,i=this.isBehind()&&e+t>=n;this.options.onScroll({top:o,bottom:i,offset:t,direction:this.scrollDir}),this.isFront()?this.handleScrollFront():this.isBehind()&&this.handleScrollBehind()},handleScrollFront:function(){var t=this.getScrollItems();if(!(t>this.range.start)){var e=Math.max(t-this.options.buffer,0);this.checkIfUpdate(e,this.getEndByStart(e))}},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.getScrollStartOffset();if(t<=0)return 0;if(this.isFixed())return Math.floor(t/this.calcSize.fixed);for(var e=0,n=this.options.uniqueKeys.length,o=0,i=0;e<=n;){if(o=e+Math.floor((n-e)/2),(i=this.getOffsetByIndex(o))===t)return o;i<t?e=o+1:i>t&&(n=o-1)}return e>0?--e: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.options.onUpdate(n({},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=0,n=0;n<t;n++){var o=this.sizes.get(this.options.uniqueKeys[n]);e+="number"==typeof o?o: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,n=t.keeps;return e.length>0?e.length-1:n-1},getItemSize:function(){return this.isFixed()?this.calcSize.fixed:this.options.size||this.calcSize.average},getScrollElement:function(t){return t instanceof Document&&9===t.nodeType||t instanceof Window?document.scrollingElement||document.documentElement||document.body:t},getScrollStartOffset:function(){var t=0,e=this.options,n=e.wrapper,o=e.scroller,i=e.direction;if(n&&n){var r=o instanceof Window?l.utils.getRect(n):l.utils.getRect(n,!0,o);t=this.offset+r[I[i]]}return t}};var M=function(e,n,o){var i=null,r=function(){o("resize",n.value?n.value[e.sizeKey]:0,e.dataKey)};t.onMounted((function(){"undefined"!=typeof ResizeObserver&&(i=new ResizeObserver((function(){r()})),n.value&&i.observe(n.value))})),t.onUpdated((function(){r()})),t.onUnmounted((function(){i&&(i.disconnect(),i=null)}))},A=t.defineComponent({name:"VirtualDraglistItems",props:c,emits:["resize"],setup:function(e,n){var o=n.emit,i=n.slots,r=t.ref(null);return M(e,r,o),function(){var n=e.tag,o=e.dataKey;return t.h(n,{ref:r,key:o,"data-key":o,class:"virtual-dnd-list-item"},{default:function(){var t;return null===(t=i.default)||void 0===t?void 0:t.call(i)}})}}});return t.defineComponent({props:a,emits:["update:dataSource","update:modelValue","top","bottom","drag","drop","add","remove"],setup:function(e,n){var o,r,s=n.emit,a=n.slots,c=n.expose,d=t.ref({start:0,end:e.keeps-1,front:0,behind:0}),f=t.ref(null),p=t.ref(null),m=t.ref([]),b=t.computed((function(){return"vertical"!==e.direction})),S=t.computed((function(){return y.reduce((function(t,n){return t[n]=e[n],t}),{})})),w=t.computed((function(){return g.reduce((function(t,n){return t[n]=e[n],t}),{})})),x=[],E=0;function T(){return o.getOffset()}function O(){return o.getClientSize()}function D(){return o.getScrollSize()}function I(t){o.scrollToOffset(t)}function _(t){o.scrollToIndex(t)}c({getSize:function(t){return o.getSize(t)},getOffset:T,getClientSize:O,getScrollSize:D,scrollToTop:function(){I(0)},scrollToBottom:function(){o.scrollToBottom()},scrollToKey:function(t){var e=x.indexOf(t);e>-1&&o.scrollToIndex(e)},scrollToIndex:_,scrollToOffset:I}),t.watch((function(){return[e.dataSource,e.modelValue]}),(function(){z()}),{deep:!0}),t.watch(S,(function(t,e){if(o)for(var n in t)t[n]!=e[n]&&o.option(n,t[n])})),t.watch(w,(function(t,e){if(r)for(var n in t)t[n]!=e[n]&&r.option(n,t[n])})),t.onBeforeMount((function(){M(),z()})),t.onActivated((function(){o&&I(o.offset),o.addScrollEventListener()})),t.onDeactivated((function(){o.removeScrollEventListener()})),t.onMounted((function(){N(),o.option("wrapper",p.value),e.scroller||o.option("scroller",f.value)})),t.onUnmounted((function(){r&&r.destroy(),o.removeScrollEventListener()}));var z=function(){var n,o=(n=e.modelValue||e.dataSource,t.isRef(n)?n.value:n);if(o){var s=i(m.value);if(m.value=o,C(),B(s,o),null==r||r.option("list",o),E&&e.keepOffset){var l=o.length-E;l>0&&_(l),E=0}}},C=function(){x=m.value.map((function(t){return h(t,e.dataKey)})),o.option("uniqueKeys",x)},M=function(){o=new k({size:e.size,keeps:e.keeps,buffer:Math.round(e.keeps/3),scroller:e.scroller,direction:e.direction,uniqueKeys:x,debounceTime:e.debounceTime,throttleTime:e.throttleTime,onScroll:function(t){E=0,m.value.length&&t.top?R():t.bottom&&j()},onUpdate:function(t){l.dragged&&r&&t.start!==d.value.start&&(r.reRendered=!0),d.value=t}})},N=function(){r=new v(f.value,Object.assign(Object.assign({},w.value),{list:m.value,dataKey:e.dataKey,onDrag:function(t){e.sortable||o.enableScroll(!1),s("drag",t)},onAdd:function(t){s("add",t)},onRemove:function(t){s("remove",t)},onDrop:function(t){e.sortable||o.enableScroll(!0),t.changed&&(s("update:dataSource",t.list),s("update:modelValue",t.list)),s("drop",t)}}))},B=function(t,n){var i=Object.assign({},d.value);n.length>t.length&&i.end===t.length-1&&P()&&(i.end++,i.start=Math.max(0,i.end-e.keeps)),o.updateRange(i)},P=function(){return T()+O()+1>=D()},R=u((function(){s("top"),E=m.value.length}),50),j=u((function(){s("bottom")}),50),F=function(t,n){var i=o.sizes.size,r=Math.min(e.keeps,m.value.length);o.onItemResized(n,t),i===r-1&&B(m.value,m.value)},L=function(){for(var n=[],o=d.value,i=o.start,r=o.end,s=function(o){var i=m.value[o];if(i){var r=h(i,e.dataKey),s=Object.assign(Object.assign({},e.itemStyle),function(t){var e;return t==(null===(e=l.dragged)||void 0===e?void 0:e.dataset.key)?{display:"none"}:{}}(r));n.push(a.item?t.h(A,{key:r,tag:e.itemTag,class:e.itemClass,style:s,dataKey:r,sizeKey:"vertical"===e.direction?"offsetHeight":"offsetWidth",onResize:F},{default:function(){var t;return null===(t=a.item)||void 0===t?void 0:t.call(a,{record:i,index:o,dataKey:r})}}):null)}},c=i;c<=r;c++)s(c);return n};return function(){var n=d.value,o=n.front,i=n.behind,r=e.rootTag,s=e.wrapTag,l=e.scroller,c=e.wrapClass,u=e.wrapStyle,h=b.value?"0px ".concat(i,"px 0px ").concat(o,"px"):"".concat(o,"px 0px ").concat(i,"px");return t.h(r,{ref:f,style:!l&&{overflow:b.value?"auto hidden":"hidden auto"}},{default:function(){var e,n;return[null===(e=a.header)||void 0===e?void 0:e.call(a),t.h(s,{ref:p,class:c,style:Object.assign(Object.assign({},u),{padding:h})},{default:function(){return L()}}),null===(n=a.footer)||void 0===n?void 0:n.call(a)]}})}}})}));
!function(t,e){t.exports=function(){function t(e){return(t="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})(e)}function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},e.apply(this,arguments)}var n={capture:!1,passive:!1},o=/\s+/g;function i(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var r=i(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),s=i(/Edge/i),l=i(/safari/i)&&!i(/chrome/i)&&!i(/android/i),a=function(){var t=!1;return document.addEventListener("checkIfSupportPassive",null,{get passive(){return t=!0,!0}}),t}();function c(t,e,o){window.addEventListener?t.addEventListener(e,o,!(!a&&r)&&n):window.attachEvent?t.attachEvent("on"+e,o):t["on"+e]=o}function u(t,e,o){window.removeEventListener?t.removeEventListener(e,o,!(!a&&r)&&n):window.detachEvent?t.detachEvent("on"+e,o):t["on"+e]=null}function h(){return document.scrollingElement||document.documentElement}function d(t,e,n){if(t.getBoundingClientRect||t===window){var o,i,r,s,l,a,c;if(t!==window&&t.parentNode&&t!==h()?(i=(o=t.getBoundingClientRect()).top,r=o.left,s=o.bottom,l=o.right,a=o.height,c=o.width):(i=0,r=0,s=window.innerHeight,l=window.innerWidth,a=window.innerHeight,c=window.innerWidth),e&&t!==window){n=n||t.parentNode;do{if(n&&n.getBoundingClientRect){var u=n.getBoundingClientRect();i-=u.top+parseInt(w(n,"border-top-width")),r-=u.left+parseInt(w(n,"border-left-width")),s=i+o.height,l=r+o.width;break}}while(n=n.parentNode)}return{top:i,left:r,bottom:s,right:l,width:c,height:a}}}function f(t,e,n,o){if(t){if(n&&!e)for(var i=Array.prototype.slice.call(n.children),r=0,s=i.length;r<s;r++)if(i[r]===t||p(t,i[r]))return i[r];n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&S(t,e):S(t,e))||o&&t===n)return t;if(t===n)break}while(t=t.parentNode);return null}}function p(t,e){if(!t||!e)return!1;if(e.compareDocumentPosition)return!!(16&e.compareDocumentPosition(t));if(e.contains&&1===t.nodeType)return e.contains(t)&&e!==t;for(;t=t.parentNode;)if(t===e)return!0;return!1}function m(t,e){for(var n=t.lastElementChild;n&&(n===ot.ghost||"none"===w(n,"display")||e&&!S(n,e));)n=n.previousElementSibling;return n||null}function g(t,e){if(!t||!t.parentNode)return-1;for(var n=0;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||e&&!S(t,e)||"none"===w(t,"display")||n++;return n}function v(t,e,n,o){for(var i=0,r=0,s=t.children;i<s.length;){if(s[i]!==ot.ghost&&"none"!==w(s[i],"display")&&f(s[i],n,t,!1)&&(o||s[i]!==ot.dragged)){if(r===e)return s[i];r++}i++}return null}function y(t,e){var n=w(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=v(t,0,e),l=v(t,1,e),a=i&&w(i),c=l&&w(l),u=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+d(i).width,h=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+d(l).width,f=s||r?"cssFloat":"float";if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&"none"!==a.float){var p="left"===a.float?"left":"right";return!l||"both"!==c.clear&&c.clear!==p?"horizontal":"vertical"}return i&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||u>=o&&"none"===n[f]||l&&"none"===n[f]&&u+h>o)?"vertical":"horizontal"}function b(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var i=(" "+t.className+" ").replace(o," ").replace(" "+e+" "," ");t.className=(i+(n?" "+e:"")).replace(o," ")}}function S(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function w(t,e,n){var o=t&&t.style;if(o){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];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function x(t,e){var n,o,i=(o=e,(n=t).compareDocumentPosition?n.compareDocumentPosition(o):n.contains?(n!=o&&n.contains(o)&&16)+(n!=o&&o.contains(n)&&8)+(n.sourceIndex>=0&&o.sourceIndex>=0?(n.sourceIndex<o.sourceIndex&&4)+(n.sourceIndex>o.sourceIndex&&2):1):0);return 2===i?1:4===i?-1:0}function E(t){void 0!==t.preventDefault&&t.cancelable&&t.preventDefault()}function T(t){var n=t.sortable,o=t.name,i=t.params,r=n.options[o];"function"==typeof r&&r(e({},i))}!function(){if("undefined"==typeof window||"undefined"==typeof document)return"";var t=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"];(Array.prototype.slice.call(t).join("").match(/-(moz|webkit|ms)-/)||""===t.OLink&&["","o"])[1]}();var O,D,I="Sortable"+Date.now();function _(t){this.options=t,this.autoScrollAnimationFrame=null}function z(t){this.options=t,this.stack=[]}function C(t){this.options=t||{},this.selectedElements=[]}window.requestAnimationFrame||(window.requestAnimationFrame=function(t){return setTimeout(t,17)}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),_.prototype={destroy:function(){this.autoScrollAnimationFrame&&(cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=null)},update:function(t,e,n){var o=this;cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=requestAnimationFrame((function(){e&&n&&o.autoScroll(t,n),o.update(t,e,n)}))},autoScroll:function(t,e){if(t&&void 0!==e.clientX&&void 0!==e.clientY){var n=d(t);if(n){var o=e.clientX,i=e.clientY,r=n.top,s=n.right,l=n.bottom,a=n.left,c=n.height,u=n.width;if(!(i<r||o>s||i>l||o<a)){var h=this.options,f=h.scrollThreshold,p=h.scrollSpeed,m=t.scrollTop,g=t.scrollLeft,v=t.scrollHeight,y=m>0&&i>=r&&i<=r+f,b=g+u<t.scrollWidth&&o<=s&&o>=s-f,S=m+c<v&&i<=l&&i>=l-f;g>0&&o>=a&&o<=a+f&&(t.scrollLeft+=Math.floor(Math.max(-1,(o-a)/f-1)*p.x)),b&&(t.scrollLeft+=Math.ceil(Math.min(1,(o-s)/f+1)*p.x)),y&&(t.scrollTop+=Math.floor(Math.max(-1,(i-r)/f-1)*p.y)),S&&(t.scrollTop+=Math.ceil(Math.min(1,(i-l)/f+1)*p.y))}}}}},z.prototype={collect:function(t){if(t){for(var e=d(t),n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,o=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,i=Math.min(e.right,n),r=Math.min(e.bottom,o),s=Array.prototype.slice.call(t.children),l=[],a=0,c=s.length;a<=c;a++){var u=s[a];if(u&&u!==ot.ghost&&"none"!==w(u,"display")){var h=d(u);if(!(h.bottom<0||h.right<0)){if(h.top-h.height>r||h.left-h.width>i)break;l.push({el:u,rect:h})}}}this.stack.push(l)}},animate:function(){for(var t=this.stack.pop(),e=0,n=t.length;e<n;e++){var o=t[e],i=o.el,r=o.rect;this.options.animation&&this._excute(i,r)}},_excute:function(t,e){var n=d(t);if(n.top!==e.top||n.left!==e.left){var o=e.left-n.left,i=e.top-n.top;w(t,"transition",""),w(t,"transform","translate3d("+o+"px, "+i+"px, 0)"),t.offsetWidth;var r=this.options,s=r.animation,l=r.easing;w(t,"transition","transform "+s+"ms"+(l?" "+l:"")),w(t,"transform","translate3d(0px, 0px, 0px)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){w(t,"transition",""),w(t,"transform",""),t.animated=null}),s)}}},C.prototype={destroy:function(){O=D=null},active:function(){return!!O},setParams:function(t){t.nodes=O||[],t.clones=D||[]},select:function(t){b(t,this.options.selectedClass,!0),this.selectedElements.push(t),this.selectedElements.sort((function(t,e){return x(t,e)}))},deselect:function(t){var e=this.selectedElements.indexOf(t);e>-1&&(b(t,this.options.selectedClass,!1),this.selectedElements.splice(e,1))},getGhostElement:function(){if(!O)return null;var t=document.createElement("div");return this.selectedElements.forEach((function(e,n){var o=e.cloneNode(!0),i=0===n?1:.5;o.style="position: absolute;left: 0;top: 0;bottom: 0;right: 0;opacity: ".concat(i,";z-index: ").concat(n,";"),t.appendChild(o)})),t},toggleSelected:function(t,e){var n=this;e?t.forEach((function(t){return n.selectedElements.push(t)})):this.selectedElements=this.selectedElements.filter((function(e){return t.indexOf(e)<0}))},toggleClass:function(t){if(O)for(var e=0;e<O.length;e++)b(O[e],this.options.chosenClass,t)},toggleVisible:function(t){if(O)if(t){var e=O.indexOf(ot.dragged);this._viewElements(O,e,ot.dragged)}else this._hideElements(O)},onChoose:function(){!this.options.multiple||!this.selectedElements.length||this.selectedElements.indexOf(ot.dragged)<0||(this.selectedElements.sort((function(t,e){return x(t,e)})),O=this.selectedElements,this.toggleClass(!0))},onDrag:function(t){O&&(t.animator.collect(ot.dragged.parentNode),this._hideElements(O),t.animator.animate(),this.toggleClass(!1))},onDrop:function(t,e,n){if(O){var o=ot.dragged,i=ot.clone,r=O.indexOf(o);e[I].animator.collect(i.parentNode),t!==e&&"clone"===n?(w(i,"display","none"),D=O.map((function(t){return t.cloneNode(!0)})),this._viewElements(D,r,i),this._viewElements(O,r,o)):this._viewElements(O,r,i),e[I].animator.animate(),t!==e&&(e[I].multiplayer.toggleSelected(D||O,!0),"clone"!==n&&t[I].multiplayer.toggleSelected(O,!1))}},onSelect:function(t,e,n){var o=this.selectedElements.indexOf(e);b(e,this.options.selectedClass,o<0);var i={from:n.el,event:t,node:e,index:g(e)};o<0?(this.selectedElements.push(e),T({sortable:n,name:"onSelect",params:i})):(this.selectedElements.splice(o,1),T({sortable:n,name:"onDeselect",params:i})),this.selectedElements.sort((function(t,e){return x(t,e)}))},_viewElements:function(t,e,n){for(var o=0;o<t.length;o++)if(w(t[o],"display",""),o<e)n.parentNode.insertBefore(t[o],n);else{var i=o>0?t[o-1]:n;n.parentNode.insertBefore(t[o],i.nextSibling)}},_hideElements:function(t){for(var e=0;e<t.length;e++)t[e]!=ot.dragged&&w(t[e],"display","none")}};var k,M,A,N,B,P,R,j,F,L,K,H,W,Y,X,q,U,V,G,$,J,Q,Z,tt=[];function et(e){var n={},o=e.group;o&&"object"==t(o)||(o={name:o,pull:!0,put:!0,revertDrag:!0}),n.name=o.name,n.pull=o.pull,n.put=o.put,n.revertDrag=o.revertDrag,e.group=n}function nt(t){var e=q||X;return!(void 0!==t.clientX&&void 0!==t.clientY&&Math.abs(t.clientX-e.clientX)<=0&&Math.abs(t.clientY-e.clientY)<=0)}function ot(t,n){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable-dnd: `el` must be an HTMLElement, not ".concat({}.toString.call(t));t[I]=this,this.el=t,this.options=n=e({},n);var o={store:null,group:"",handle:null,sortable:!0,disabled:!1,multiple:!1,lockAxis:"",direction:"",animation:150,easing:"",draggable:null,selectHandle:null,customGhost:null,autoScroll:!0,scrollThreshold:55,scrollSpeed:{x:10,y:10},delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,ghostClass:"",ghostStyle:{},chosenClass:"",selectedClass:"",swapOnDrop:!0,fallbackOnBody:!1,supportTouch:"ontouchstart"in window,emptyInsertThreshold:-1};for(var i in o)!(i in this.options)&&(this.options[i]=o[i]);for(var r in et(n),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));c(t,this.options.supportTouch?"touchstart":"mousedown",this._onDrag),tt.push(t),this.autoScroller=new _(this.options),this.multiplayer=new C(this.options),this.animator=new z(this.options)}return ot.prototype={constructor:ot,destroy:function(){this._cancelStart(),this._nulling(),u(this.el,"touchstart",this._onDrag),u(this.el,"mousedown",this._onDrag);var t=tt.indexOf(this.el);t>-1&&tt.splice(t,1),this.el[I]=this.animator=this.multiplayer=this.autoScroller=null},option:function(t,e){if(void 0===e)return this.options[t];this.options[t]=e,this.animator.options[t]=e,this.multiplayer.options[t]=e,this.autoScroller.options[t]=e,"group"===t&&et(this.options)},select:function(t){this.multiplayer.select(t)},deselect:function(t){this.multiplayer.deselect(t)},getSelectedElements:function(){return this.multiplayer.selectedElements},_onDrag:function(t){var e=this;if(!N&&!this.options.disabled&&this.options.group.pull&&(!/mousedown|pointerdown/.test(t.type)||0===t.button)){var n=t.touches&&t.touches[0],o=(n||t).target;if(!l||!o||"SELECT"!==o.tagName.toUpperCase()){var i=f(o,this.options.draggable,this.el);if(i&&!i.animated){X={origin:t,clientX:(n||t).clientX,clientY:(n||t).clientY},N=i,c($=n?N:document,"mouseup",this._onDrop),c($,"touchend",this._onDrop),c($,"touchcancel",this._onDrop);var a=this.options,u=a.handle,h=a.selectHandle;if("function"==typeof h&&h(t)||"string"==typeof h&&S(o,h))Z=!0;else if(("function"!=typeof u||u(t))&&("string"!=typeof u||S(o,u))){var d=this.options,p=d.delay,m=d.delayOnTouchOnly;!p||m&&!n||s||r?this._onStart(n,t):(c(this.el.ownerDocument,"touchmove",this._delayMoveHandler),c(this.el.ownerDocument,"mousemove",this._delayMoveHandler),c(this.el.ownerDocument,"mouseup",this._cancelStart),c(this.el.ownerDocument,"touchend",this._cancelStart),c(this.el.ownerDocument,"touchcancel",this._cancelStart),Q=setTimeout((function(){return e._onStart(n,t)}),p)),c(document,"selectstart",E),l&&w(document.body,"user-select","none")}}}}},_delayMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-X.clientX),Math.abs(e.clientY-X.clientY))>=Math.floor(this.options.touchStartThreshold/(window.devicePixelRatio||1))&&this._cancelStart()},_cancelStart:function(){clearTimeout(Q),u(this.el.ownerDocument,"touchmove",this._delayMoveHandler),u(this.el.ownerDocument,"mousemove",this._delayMoveHandler),u(this.el.ownerDocument,"mouseup",this._cancelStart),u(this.el.ownerDocument,"touchend",this._cancelStart),u(this.el.ownerDocument,"touchcancel",this._cancelStart),u(document,"selectstart",E),l&&w(document.body,"user-select","")},_onStart:function(t,e){var n=g(N);k=this.el,M=this.el,F=N,H=n,W=n,Y=n,V={to:this.el,target:N,newIndex:n,relative:0},G=N,A=this.el,R=N.cloneNode(!0),L=N.parentNode,K=this.options.group.pull,ot.clone=R,ot.active=this,ot.dragged=N,b(N,this.options.chosenClass,!0),this.multiplayer.onChoose(),T({sortable:this,name:"onChoose",params:this._getParams(e)}),c($,t?"touchmove":"mousemove",this._nearestSortable);try{document.selection?setTimeout((function(){return document.selection.empty()}),0):window.getSelection().removeAllRanges()}catch(t){}},_onStarted:function(){b(R,this.options.chosenClass,!0),this._appendGhost(),this.multiplayer.onDrag(this),T({sortable:this,name:"onDrag",params:this._getParams(X.origin)}),w(N,"display","none"),b(N,this.options.chosenClass,!1),N.parentNode.insertBefore(R,N)},_getGhostElement:function(){var t=this.options.customGhost;if("function"==typeof t){var e=this.multiplayer.selectedElements;return t(e.length?e:[N])}return this.multiplayer.getGhostElement()||N},_appendGhost:function(){if(!j){var t=this.options.fallbackOnBody?document.body:this.el,n=this._getGhostElement();b(j=n.cloneNode(!0),this.options.ghostClass,!0);var o=d(N),i=e({position:"fixed",top:o.top,left:o.left,width:o.width,height:o.height,zIndex:"100000",opacity:"0.8",overflow:"hidden",boxSizing:"border-box",transform:"translate3d(0px, 0px, 0px)",transition:"none",pointerEvents:"none"},this.options.ghostStyle);for(var r in i)w(j,r,i[r]);ot.ghost=j,t.appendChild(j);var s=(X.clientX-o.left)/parseInt(j.style.width)*100,l=(X.clientY-o.top)/parseInt(j.style.height)*100;w(j,"transform-origin",s+"% "+l+"%"),w(j,"will-change","transform")}},_nearestSortable:function(t){E(t);var e=t.touches&&t.touches[0]||t;if(N&&nt(e)){!q&&this._onStarted();var n=this.options.lockAxis,o="x"===n?X.clientX:e.clientX,i="y"===n?X.clientY:e.clientY,r=document.elementFromPoint(o,i),s=o-X.clientX,l=i-X.clientY;q={origin:t,clientX:o,clientY:i},w(j,"transform","translate3d("+s+"px, "+l+"px, 0)");var a,c,u,f=(a=o,c=i,tt.reduce((function(t,e){var n=e[I].options.emptyInsertThreshold;if(null!=n){var o=d(e),i=a>=o.left-n&&a<=o.right+n,r=c>=o.top-n&&c<=o.bottom+n;return i&&r&&(!u||u&&o.left>=u.left&&o.right<=u.right&&o.top>=u.top&&o.bottom<=u.bottom)&&(t=e,u=o),t}}),null));if(f&&f[I]._onMove(t,r),!f||f[I].options.autoScroll){var p=function(t,e){if(!t||!t.getBoundingClientRect)return h();var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=w(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return h();if(o||e)return n;o=!0}}}while(n=n.parentNode);return h()}(r,!0);this.autoScroller.update(p,X,q)}else this.autoScroller.destroy()}},_allowPut:function(){if(A===this.el)return!0;if(this.options.group.put){var t=this.options.group,e=t.name,n=t.put,o=A[I].options.group;return n.join&&n.indexOf(o.name)>-1||o.name&&e&&o.name===e}return!1},_getDirection:function(){var t=this.options,e=t.draggable,n=t.direction;return n?"function"==typeof n?n.call(q.origin,N,this):n:y(L,e)},_allowSwap:function(){var t=d(B),e="vertical"===this._getDirection(),n=e?"top":"left",o=e?"bottom":"right",i=B[e?"offsetHeight":"offsetWidth"],r=e?q.clientY:q.clientX,s=r>=t[n]&&r<t[o]-i/2?-1:1,l=v(L,0,this.options.draggable),a=m(L),c=d(l),u=d(a);if(B===L||p(L,B))return R===l&&r<c[n]?(P=B,!0):R===a&&r>u[o]&&(P=B.nextSibling,!0);var h=x(R,B);return P=h<0?B.nextSibling:B,U!==B?(J=s,!0):J!==s&&(J=s,s<0?h>0:h<0)},_onMove:function(t,e){if(!this.options.disabled&&this._allowPut()){if(B=f(e,this.options.draggable,this.el),T({sortable:this,name:"onMove",params:this._getParams(t,{target:B})}),this.options.sortable||this.el!==A)return this.el===M||e!==this.el&&m(this.el)?void(B&&!B.animated&&!p(B,R)&&this._allowSwap()&&(B!==R&&P!==R?(this.el!==M?this._onInsert(t):B!==N&&this._onChange(t),U=B):U=B)):(B=U=null,void this._onInsert(t));M!==A&&(B=U=N,J=0,this._onInsert(t))}},_onInsert:function(t){var e=B||R,n="clone"===K&&this.el!==A&&M===A,o="clone"===K&&this.el===A&&M!==A,i=p(B,document),r=B===N&&!i;k=this.el,H=g(R),F=e,L=i?B.parentNode:this.el,M[I].animator.collect(R.parentNode),this.animator.collect(L),n&&(V.target=G,V.newIndex=H,V.relative=G===N?0:x(R,G),w(N,"display",""),A[I].multiplayer.toggleVisible(!0),A[I].options.group.revertDrag||R.parentNode.insertBefore(N,R)),o&&(H=g(N),w(N,"display","none"),this.multiplayer.toggleVisible(!1)),w(R,"display",r?"none":""),B&&i?L.insertBefore(R,J<0?B:B.nextSibling):L.appendChild(R),W=r?Y:g(R),n&&A[I].options.group.revertDrag&&(V.target=N,V.newIndex=Y,V.relative=0,T({sortable:A[I],name:"onChange",params:this._getParams(t,{to:A,target:N,newIndex:Y,revertDrag:!0})})),n||T({sortable:M[I],name:"onRemove",params:this._getParams(t,{newIndex:-1})}),o&&e!==N&&(G=e,T({sortable:this,name:"onChange",params:this._getParams(t,{from:A,backToOrigin:!0})})),o||T({sortable:this,name:"onAdd",params:this._getParams(t,{oldIndex:-1})}),M[I].animator.animate(),this.animator.animate(),M=this.el},_onChange:function(t){H=g(R),L=B.parentNode,F=B,this.el===A&&(G=B),this.animator.collect(L),L.insertBefore(R,P),W=g(R),T({sortable:this,name:"onChange",params:this._getParams(t)}),this.animator.animate(),M=this.el},_onDrop:function(t){this._cancelStart(),u($,"touchmove",this._nearestSortable),u($,"mousemove",this._nearestSortable),u($,"mouseup",this._onDrop),u($,"touchend",this._onDrop),u($,"touchcancel",this._onDrop),b(N,this.options.chosenClass,!1),A&&(M=A,H=Y,F===R&&(F=N),this.multiplayer.toggleClass(!1),T({sortable:this,name:"onUnchoose",params:this._getParams(t)}),q&&this._onEnd(t));var e=this.options,n=e.multiple,o=e.selectHandle;n&&(o&&Z||!o&&!A)&&!nt(t.changedTouches?t.changedTouches[0]:t)&&this.multiplayer.onSelect(t,N,this),j&&j.parentNode&&j.parentNode.removeChild(j),this.autoScroller.destroy(),this.multiplayer.destroy(),this._nulling()},_onEnd:function(t){var n=this._getParams(t);this.multiplayer.onDrop(M,k,K);var o=this.options.swapOnDrop;"clone"===K&&M!==k||!("function"==typeof o?o(n):o)||L.insertBefore(N,R),"clone"!==K||M===k||this.multiplayer.active()?R&&R.parentNode&&R.parentNode.removeChild(R):b(R,this.options.chosenClass,!1),w(N,"display",""),M!==k&&T({sortable:M[I],name:"onDrop",params:e({},n,"clone"===K?V:{newIndex:-1})}),T({sortable:k[I],name:"onDrop",params:e({},n,M===k?{}:{oldIndex:-1})})},_getParams:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o={};return o.event=t,o.to=k,o.from=M,o.node=N,o.clone=R,o.target=F,o.oldIndex=H,o.newIndex=W,o.pullMode=K,this.multiplayer.setParams(o),e(o,n),o.relative=F===N?0:x(R,F),o},_nulling:function(){k=M=A=N=B=P=R=j=F=L=K=H=W=Y=X=q=U=V=G=$=J=Q=Z=ot.clone=ot.ghost=ot.active=ot.dragged=null}},ot.utils={on:c,off:u,css:w,index:g,closest:f,getRect:d,toggleClass:b,detectDirection:y},ot.get=function(t){return t[I]},ot.create=function(t,e){return new ot(t,e)},ot}()}(s);var l=s.exports,a={dataSource:{},modelValue:{},dataKey:{type:String,default:"",required:!0},draggable:{type:String,default:".virtual-dnd-list-item"},sortable:{type:Boolean,default:!0},handle:{type:[Function,String]},group:{type:[Object,String]},scroller:{type:[Document,HTMLElement]},lockAxis:{type:String,default:""},direction:{type:String,default:"vertical"},keeps:{type:Number,default:30},size:{type:Number},debounceTime:{type:Number,default:0},throttleTime:{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},delay:{type:Number,default:0},delayOnTouchOnly:{type:Boolean,default:!1},rootTag:{type:String,default:"div"},wrapTag:{type:String,default:"div"},itemTag:{type:String,default:"div"},wrapClass:{type:String,default:""},wrapStyle:{type:Object,default:function(){return{}}},itemStyle:{type:Object,default:function(){return{}}},itemClass:{type:String,default:""},ghostClass:{type:String,default:""},ghostStyle:{type:Object,default:function(){return{}}},chosenClass:{type:String,default:""}},c={tag:{type:String,default:"div"},dataKey:{type:[String,Number]},sizeKey:{type:String}},u=["delay","group","handle","lockAxis","disabled","sortable","draggable","animation","autoScroll","ghostClass","ghostStyle","chosenClass","fallbackOnBody","scrollThreshold","delayOnTouchOnly"];function h(t,e){this.el=t,this.options=e,this.reRendered=!1,this.installSortable()}function d(t,e){var n=null,o=function(){for(var o=this,i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];n||(e<=0?t.apply(this,r):n=setTimeout((function(){n=void 0,t.apply(o,r)}),e))};return o.cancel=function(){n&&(clearTimeout(n),n=null)},o}function f(t,e){return(Array.isArray(e)?e:e.replace(/\[/g,".").replace(/\]/g,".").split(".")).reduce((function(t,e){return(t||{})[e]}),t)}h.prototype={constructor:h,destroy:function(){this.sortable&&this.sortable.destroy(),this.sortable=this.reRendered=null},option:function(t,e){this.options[t]=e,u.includes(t)&&this.sortable.option(t,e)},installSortable:function(){var t=this,e=u.reduce((function(e,n){return e[n]=t.options[n],e}),{});this.sortable=new l(this.el,n(n({},e),{},{emptyInsertThreshold:0,swapOnDrop:function(t){return t.from===t.to},onDrag:function(e){return t.onDrag(e)},onDrop:function(e){return t.onDrop(e)},onAdd:function(e){return t.onAdd(e)},onRemove:function(e){return t.onRemove(e)}}))},onAdd:function(t){var e=l.get(t.from).option("store"),n=e.item,o=e.key;this.sortable.option("store",{item:n,key:o}),this.dispatchEvent("onAdd",{item:n,key:o,event:t})},onRemove:function(t){var e=l.get(t.from).option("store"),n=e.item,o=e.key;this.dispatchEvent("onRemove",{item:n,key:o,event:t})},onDrag:function(t){var e=t.node.getAttribute("data-key"),n=this.getIndex(e),o=this.options.list[n];this.sortable.option("store",{item:o,key:e,index:n}),this.dispatchEvent("onDrag",{item:o,key:e,index:n,event:t})},onDrop:function(t){var e,n,o=l.get(t.from).option("store"),r=o.item,s=o.key,a=o.index,c=this.options.list,u={key:s,item:r,list:c,event:t,changed:!1,oldList:i(c),oldIndex:a,newIndex:a};(t.from===t.to&&t.node===t.target||this.getDropParams(u,t,r,s,a,c),this.dispatchEvent("onDrop",u),t.from===this.el&&this.reRendered)&&(null===(e=l.dragged)||void 0===e||e.remove());t.from!==t.to&&"clone"===t.pullMode&&(null===(n=l.clone)||void 0===n||n.remove());this.reRendered=!1},getDropParams:function(t,e,n,o,i,r){var s=e.target.getAttribute("data-key"),l=-1,a=i;e.from===e.to?(((a=this.getIndex(o))<(l=this.getIndex(s))&&-1===e.relative||a>l&&1===e.relative)&&(l+=e.relative),l!==a&&(r.splice(a,1),r.splice(l,0,n))):(e.from===this.el&&(a=this.getIndex(o),r.splice(a,1)),e.to===this.el&&(a=-1,l=this.getIndex(s),0===e.relative?l=r.length:1===e.relative&&(l+=e.relative),r.splice(l,0,n))),t.changed=e.from!==e.to||l!==a,t.list=r,t.oldIndex=a,t.newIndex=l},getIndex:function(t){return this.options.uniqueKeys.indexOf(t)},dispatchEvent:function(t,e){var n=this.options[t];n&&n(e)}};var p=["size","keeps","scroller","direction","debounceTime","throttleTime"],m="INIT",g="FIXED",v="DYNAMIC",y="FRONT",b="BEHIND",S="STATIONARY",w={vertical:"top",horizontal:"left"},x={vertical:"scrollTop",horizontal:"scrollLeft"},E={vertical:"scrollHeight",horizontal:"scrollWidth"},T={vertical:"offsetHeight",horizontal:"offsetWidth"};function O(t){this.options=t;var e={size:0,keeps:0,buffer:0,wrapper:null,scroller:null,direction:"vertical",uniqueKeys:[],debounceTime:null,throttleTime:null};for(var n in e)!(n in this.options)&&(this.options[n]=e[n]);this.sizes=new Map,this.range={start:0,end:0,front:0,behind:0},this.offset=0,this.calcType=m,this.calcSize={average:0,total:0,fixed:0},this.scrollDirection="",this.updateScrollElement(),this.updateOnScrollFunction(),this.addScrollEventListener(),this.checkIfUpdate(0,t.keeps-1)}O.prototype={constructor:O,isFront:function(){return this.scrollDirection===y},isBehind:function(){return this.scrollDirection===b},isFixed:function(){return this.calcType===g},getSize:function(t){return this.sizes.get(t)||this.getItemSize()},getOffset:function(){return this.scrollEl[x[this.options.direction]]},getScrollSize:function(){return this.scrollEl[E[this.options.direction]]},getClientSize:function(){return this.scrollEl[T[this.options.direction]]},scrollToOffset:function(t){this.scrollEl[x[this.options.direction]]=t},scrollToIndex:function(t){if(t>=this.options.uniqueKeys.length-1)this.scrollToBottom();else{var e=this.getOffsetByIndex(t),n=this.getScrollStartOffset();this.scrollToOffset(e+n)}},scrollToBottom:function(){var t=this,e=this.getScrollSize();this.scrollToOffset(e),setTimeout((function(){var e=t.getClientSize(),n=t.getScrollSize();t.getOffset()+e+1<n&&t.scrollToBottom()}),5)},option:function(t,e){var n=this,o=this.options[t];this.options[t]=e,"uniqueKeys"===t&&this.sizes.forEach((function(t,o){e.includes(o)||n.sizes.delete(o)})),"scroller"===t&&(o&&l.utils.off(o,"scroll",this.onScroll),this.updateScrollElement(),this.addScrollEventListener())},updateRange:function(t){if(t)this.handleUpdate(t.start,t.end);else{var e=this.range.start;e=Math.max(e,0),this.handleUpdate(e,this.getEndByStart(e))}},onItemResized:function(t,e){this.sizes.set(t,e),this.calcType===m?(this.calcType=g,this.calcSize.fixed=e):this.isFixed()&&this.calcSize.fixed!==e&&(this.calcType=v,this.calcSize.fixed=void 0),this.calcType!==g&&(this.calcSize.total=i(this.sizes.values()).reduce((function(t,e){return t+e}),0),this.calcSize.average=Math.round(this.calcSize.total/this.sizes.size))},addScrollEventListener:function(){this.options.scroller&&l.utils.on(this.options.scroller,"scroll",this.onScroll)},removeScrollEventListener:function(){this.options.scroller&&l.utils.off(this.options.scroller,"scroll",this.onScroll)},enableScroll:function(t){var e=this.options.scroller,n=t?l.utils.off:l.utils.on,o="onwheel"in document.createElement("div")?"wheel":"mousewheel";n(e,"DOMMouseScroll",this.preventDefault),n(e,o,this.preventDefault),n(e,"touchmove",this.preventDefault),n(e,"keydown",this.preventDefaultForKeyDown)},preventDefault:function(t){t.preventDefault()},preventDefaultForKeyDown:function(t){if({37:1,38:1,39:1,40:1}[t.keyCode])return this.preventDefault(t),!1},updateScrollElement:function(){var t=this.options.scroller;t instanceof Document&&9===t.nodeType||t instanceof Window?this.scrollEl=document.scrollingElement||document.documentElement||document.body:this.scrollEl=t},updateOnScrollFunction:function(){var t,e,n=this,o=this.options,i=o.debounceTime,r=o.throttleTime;this.onScroll=i?(t=d((function(){return n.handleScroll()}),i),e=function(){t.cancel(),t.apply(this,arguments)},e.cancel=function(){t.cancel()},e):r?d((function(){return n.handleScroll()}),r):function(){return n.handleScroll()}},handleScroll:function(){var t=this.getOffset(),e=this.getClientSize(),n=this.getScrollSize();t===this.offset?this.scrollDirection=S:this.scrollDirection=t<this.offset?y:b,this.offset=t;var o=this.isFront()&&t<=0,i=this.isBehind()&&e+t>=n;this.options.onScroll({top:o,bottom:i,offset:t,direction:this.scrollDirection}),this.isFront()?this.handleScrollFront():this.isBehind()&&this.handleScrollBehind()},handleScrollFront:function(){var t=this.getScrollItems();if(!(t>this.range.start)){var e=Math.max(t-this.options.buffer,0);this.checkIfUpdate(e,this.getEndByStart(e))}},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.getScrollStartOffset();if(t<=0)return 0;if(this.isFixed())return Math.floor(t/this.calcSize.fixed);for(var e=0,n=this.options.uniqueKeys.length,o=0,i=0;e<=n;){if(o=e+Math.floor((n-e)/2),(i=this.getOffsetByIndex(o))===t)return o;i<t?e=o+1:i>t&&(n=o-1)}return e>0?--e: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.options.onUpdate(n({},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=0,n=0;n<t;n++){var o=this.sizes.get(this.options.uniqueKeys[n]);e+="number"==typeof o?o: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,n=t.keeps;return e.length>0?e.length-1:n-1},getItemSize:function(){return this.isFixed()?this.calcSize.fixed:this.options.size||this.calcSize.average},getScrollStartOffset:function(){var t=0,e=this.options,n=e.wrapper,o=e.scroller,i=e.direction;if(o&&n){var r=o instanceof Window?l.utils.getRect(n):l.utils.getRect(n,!0,o);t=this.offset+r[w[i]]}return t}};var D=function(e,n,o){var i=null,r=function(){o("resize",n.value?n.value[e.sizeKey]:0,e.dataKey)};t.onMounted((function(){"undefined"!=typeof ResizeObserver&&(i=new ResizeObserver((function(){r()})),n.value&&i.observe(n.value))})),t.onUpdated((function(){r()})),t.onUnmounted((function(){i&&(i.disconnect(),i=null)}))},I=t.defineComponent({name:"VirtualDraglistItems",props:c,emits:["resize"],setup:function(e,n){var o=n.emit,i=n.slots,r=t.ref(null);return D(e,r,o),function(){var n=e.tag,o=e.dataKey;return t.h(n,{ref:r,key:o,"data-key":o,class:"virtual-dnd-list-item"},{default:function(){var t;return null===(t=i.default)||void 0===t?void 0:t.call(i)}})}}});return t.defineComponent({props:a,emits:["update:dataSource","update:modelValue","top","bottom","drag","drop","add","remove"],setup:function(e,n){var o,r,s=n.emit,a=n.slots,c=n.expose,m=t.ref({start:0,end:e.keeps-1,front:0,behind:0}),g=t.ref(null),v=t.ref(null),y=t.ref([]),b=t.ref(),S=t.ref([]),w=t.computed((function(){return"vertical"!==e.direction})),x=t.computed((function(){return p.reduce((function(t,n){return t[n]=e[n],t}),{})})),E=t.computed((function(){return u.reduce((function(t,n){return t[n]=e[n],t}),{})})),T=[],D=0;function _(){return o.getOffset()}function z(){return o.getClientSize()}function C(){return o.getScrollSize()}function k(t){o.scrollToOffset(t)}function M(t){o.scrollToIndex(t)}c({getSize:function(t){return o.getSize(t)},getOffset:_,getClientSize:z,getScrollSize:C,scrollToTop:function(){k(0)},scrollToBottom:function(){o.scrollToBottom()},scrollToKey:function(t){var e=T.indexOf(t);e>-1&&o.scrollToIndex(e)},scrollToIndex:M,scrollToOffset:k}),t.watch((function(){return[e.dataSource,e.modelValue]}),(function(){A()}),{deep:!0}),t.watch(x,(function(t,e){if(o)for(var n in t)t[n]!=e[n]&&o.option(n,t[n])})),t.watch(E,(function(t,e){if(r)for(var n in t)t[n]!=e[n]&&r.option(n,t[n])})),t.onBeforeMount((function(){A()})),t.onActivated((function(){o&&k(o.offset),o.addScrollEventListener()})),t.onDeactivated((function(){o.removeScrollEventListener()})),t.onMounted((function(){B(),P()})),t.onUnmounted((function(){null==r||r.destroy(),null==o||o.removeScrollEventListener()}));var A=function(){var n,o=(n=e.modelValue||e.dataSource,t.isRef(n)?n.value:n);if(o){if(y.value=o,N(),R(S.value,o),null==r||r.option("list",o),D&&e.keepOffset){var s=o.length-D;s>0&&M(s),D=0}S.value=i(y.value)}},N=function(){T=y.value.map((function(t){return f(t,e.dataKey)})),null==o||o.option("uniqueKeys",T),null==r||r.option("uniqueKeys",T)},B=function(){o=new O({size:e.size,keeps:e.keeps,buffer:Math.round(e.keeps/3),wrapper:v.value,scroller:e.scroller||g.value,direction:e.direction,uniqueKeys:T,debounceTime:e.debounceTime,throttleTime:e.throttleTime,onScroll:function(t){D=0,y.value.length&&t.top?F():t.bottom&&L()},onUpdate:function(t){l.dragged&&t.start!==m.value.start&&r&&(r.reRendered=!0),m.value=t}})},P=function(){r=new h(g.value,Object.assign(Object.assign({},E.value),{list:y.value,uniqueKeys:T,onAdd:function(t){s("add",t)},onRemove:function(t){s("remove",t)},onDrag:function(t){b.value=t.key,e.sortable||(o.enableScroll(!1),r.option("autoScroll",!1)),s("drag",t)},onDrop:function(t){b.value="",e.sortable||(o.enableScroll(!0),r.option("autoScroll",e.autoScroll)),t.changed&&(s("update:dataSource",t.list),s("update:modelValue",t.list)),s("drop",t)}}))},R=function(t,n){var i=Object.assign({},m.value);n.length>t.length&&i.end===t.length-1&&j()&&(i.end++,i.start=Math.max(0,i.end-e.keeps)),null==o||o.updateRange(i)},j=function(){return _()+z()+1>=C()},F=d((function(){s("top"),D=y.value.length}),50),L=d((function(){s("bottom")}),50),K=function(t,n){var i=o.sizes.size,r=Math.min(e.keeps,y.value.length);o.onItemResized(n,t),i===r-1&&R(y.value,y.value)},H=function(){for(var n=[],o=m.value,i=o.start,r=o.end,s="vertical"===e.direction?"offsetHeight":"offsetWidth",l=function(o){var i=y.value[o];if(i){var r=f(i,e.dataKey),l=Object.assign(Object.assign({},e.itemStyle),function(t){return t==b.value?{display:"none"}:{}}(r));n.push(a.item?t.h(I,{key:r,tag:e.itemTag,class:e.itemClass,style:l,dataKey:r,sizeKey:s,onResize:K},{default:function(){var t;return null===(t=a.item)||void 0===t?void 0:t.call(a,{record:i,index:o,dataKey:r})}}):null)}},c=i;c<=r;c++)l(c);return n};return function(){var n=m.value,o=n.front,i=n.behind,r=e.rootTag,s=e.wrapTag,l=e.scroller,c=e.wrapClass,u=e.wrapStyle,h=w.value?"0px ".concat(i,"px 0px ").concat(o,"px"):"".concat(o,"px 0px ").concat(i,"px");return t.h(r,{ref:g,style:!l&&{overflow:w.value?"auto hidden":"hidden auto"}},{default:function(){var e,n;return[null===(e=a.header)||void 0===e?void 0:e.call(a),t.h(s,{ref:v,class:c,style:Object.assign(Object.assign({},u),{padding:h})},{default:function(){return H()}}),null===(n=a.footer)||void 0===n?void 0:n.call(a)]}})}}})}));
{
"name": "vue-virtual-draglist",
"version": "3.2.3",
"version": "3.2.4",
"description": "A virtual scrolling list component that can be sorted by dragging, support vue3",

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

"dependencies": {
"sortable-dnd": "0.6.12"
"sortable-dnd": "^0.6.15"
},

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

@@ -23,4 +23,4 @@ # vue-virtual-draglist

:handle="'i'" // use tagName
:handle="'.drag'" // use class
:handle="'#drag'" // use id
:handle="'.handle'" // use class
:handle="'#handle'" // use id
-->

@@ -30,8 +30,8 @@ <VirtualList

:dataKey="'id'"
:handle="'#drag'"
:handle="'#handle'"
style="height: 500px;"
>
<template v-slot:item="{ record, index, dataKey }">
<i id="drag" class="drag">drag me</i>
<span>{{ record.text }}</span>
<i id="handle" class="handle">handle</i>
<p>{{ record.text }}</p>
</template>

@@ -69,8 +69,8 @@ <template v-slot:header>

|--------------|-----------------|
| `top` | Event fired when scroll to top |
| `bottom` | Event fired when scroll to bottom |
| `drag` | Event fired when the drag is started |
| `drop` | Event fired when the drag is completed |
| `add` | Event fired when element is dropped into the list from another |
| `remove` | Event fired when element is removed from the list into another |
| `top` | scrolled to top |
| `bottom` | scrolled to bottom |
| `drag` | drag is started |
| `drop` | drag is completed |
| `add` | element is dropped into the list from another |
| `remove` | element is removed from the list into another |

@@ -84,4 +84,3 @@ ## Props

| `data-key` | String | The unique identifier of each piece of data, in the form of `'a.b.c'` |
| `data-source` | Array/Ref | The data that needs to be rendered |
| `v-model` | Array/Ref | Choose between `data-source` and `v-model`(recommend) |
| `v-model` | Array/Ref | The data that needs to be rendered |

@@ -88,0 +87,0 @@ ### Optional props

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