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 3.2.0 to 3.2.1

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="undefined"!=typeof globalThis?globalThis:t||self).VirtualDragList=e(t.Vue)}(this,function(j){"use strict";function B(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function N(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,P(i.key),i)}}function A(t,e,n){e&&N(t.prototype,e),n&&N(t,n),Object.defineProperty(t,"prototype",{writable:!1})}function t(t,e,n){(e=P(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}function L(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 P(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)}var H,W,Y,u,X,K,U,q,s,l,a,o,c,r,V,h,d,f,p,m,G,g,v,Z,y,S,b,w,x,$,T,k,J;function Q(t){return(Q="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 O(){return(O=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n,i=arguments[e];for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t}).apply(this,arguments)}function tt(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}function et(t,e){t.style["".concat(q.css,"transition-duration")]=null==e?"":"".concat(e,"ms")}function nt(t,e){t.style["".concat(q.css,"transform")]=e?"".concat(e):""}function _(t,e,n){window.addEventListener?t.addEventListener(e,n,!(!U&&u)&&H):window.attachEvent?t.attachEvent("on"+e,n):t["on"+e]=n}function i(t,e,n){window.removeEventListener?t.removeEventListener(e,n,!(!U&&u)&&H):window.detachEvent?t.detachEvent("on"+e,n):t["on"+e]=null}function it(){return document.scrollingElement||document.documentElement}function E(t,e,n){if(t.getBoundingClientRect||t===window){var i,o,r,s,l,a,c=t!==window&&t.parentNode&&t!==it()?(o=(i=t.getBoundingClientRect()).top,r=i.left,s=i.bottom,l=i.right,a=i.height,i.width):(r=o=0,s=window.innerHeight,l=window.innerWidth,a=window.innerHeight,window.innerWidth);if(e&&t!==window){n=n||t.parentNode;do{if(n&&n.getBoundingClientRect){var u=n.getBoundingClientRect();o-=u.top+parseInt(I(n,"border-top-width")),r-=u.left+parseInt(I(n,"border-left-width")),s=o+i.height,l=r+i.width;break}}while(n=n.parentNode)}return{top:o,left:r,bottom:s,right:l,width:c,height:a}}}function ot(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(rt(t,o[s]))return o[s]}else if((">"!==e[0]||t.parentNode===n)&&at(t,e)||i&&t===n)return t}while(t=t.parentNode)}return null}function rt(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 z(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||e&&!at(t,e)||"none"===I(t,"display")||n++;return n}function st(t,e,n,i){for(var o=0,r=0,s=t.children;o<s.length;){if(s[o]!==M.ghost&&"none"!==I(s[o],"display")&&ot(s[o],n,t,!1)&&(i||s[o]!==M.dragged)){if(r===e)return s[o];r++}o++}return null}function lt(t,e){var n,i=I(t),o=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),r=st(t,0,e),t=st(t,1,e),e=r&&I(r),s=t&&I(t),l=e&&parseInt(e.marginLeft)+parseInt(e.marginRight)+E(r).width,a=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+E(t).width,c=X||u?"cssFloat":"float";return"flex"===i.display?"column"===i.flexDirection||"column-reverse"===i.flexDirection?"vertical":"horizontal":"grid"===i.display?i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal":r&&e.float&&"none"!==e.float?(n="left"===e.float?"left":"right",!t||"both"!==s.clear&&s.clear!==n?"horizontal":"vertical"):r&&("block"===e.display||"flex"===e.display||"table"===e.display||"grid"===e.display||o<=l&&"none"===i[c]||t&&"none"===i[c]&&o<l+a)?"vertical":"horizontal"}function C(t,e,n){var i;t&&e&&(t.classList?t.classList[n?"add":"remove"](e):(i=(" "+t.className+" ").replace(W," ").replace(" "+e+" "," "),t.className=(i+(n?" "+e:"")).replace(W," ")))}function at(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 I(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 ct(t,e){return 2===(t=t.compareDocumentPosition?t.compareDocumentPosition(e):t.contains?(t!=e&&t.contains(e)&&16)+(t!=e&&e.contains(t)&&8)+(0<=t.sourceIndex&&0<=e.sourceIndex?(t.sourceIndex<e.sourceIndex&&4)+(t.sourceIndex>e.sourceIndex&&2):1)+0:0)?1:4===t?-1:0}function ut(t){void 0!==t.preventDefault&&t.cancelable&&t.preventDefault()}function D(t){var e=t.sortable,n=t.name,t=t.params;"function"==typeof(e=e.options[n])&&e(O({},t))}function ht(t){this.options=t,this.autoScrollAnimationFrame=null}function dt(t){this.options=t,this.animations=[]}function ft(t){this.options=t||{},this.selectedElements=[]}function M(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable-dnd: `el` must be an HTMLElement, not ".concat({}.toString.call(t));(t[a]=this).el=t,this.options=e=O({},e);var n,i,o={store:null,disabled:!1,group:"",animation:150,draggable:null,handle:null,multiple:!1,selectHandle:null,customGhost:null,direction:function(){return lt(t,e.draggable)},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:-5};for(n in o)n in this.options||(this.options[n]=o[n]);for(i in J(e),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));var r=this.options.supportTouch;_(t,r?"touchstart":"mousedown",this._onDrag),k.push(t),this.autoScroller=new ht(this.options),this.multiplayer=new ft(this.options),this.animator=new dt(this.options)}H={capture:!1,passive:!1},W=/\s+/g,u=tt(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),X=tt(/Edge/i),K=tt(/safari/i)&&!tt(/chrome/i)&&!tt(/android/i),Y=!1,document.addEventListener("checkIfSupportPassive",null,{get passive(){return Y=!0}}),U=Y,q="undefined"==typeof window||"undefined"==typeof document?{}:(e=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],e=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1],{dom:"WebKit|Moz|MS|O".match(new RegExp("("+e+")","i"))[1],lowercase:e,css:"-"+e+"-",js:e[0].toUpperCase()+e.substr(1)}),a="Sortable"+Date.now(),window.requestAnimationFrame||(window.requestAnimationFrame=function(t){return setTimeout(t,17)}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),ht.prototype={destroy:function(){null!=this.autoScrollAnimationFrame&&(cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=null)},update:function(t,e,n){var i=this;cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=requestAnimationFrame(function(){e&&n&&i.autoScroll(t,n),i.update(t,e,n)})},autoScroll:function(t,e){var n,i,o,r,s,l,a,c,u,h,d,f,p;t&&void 0!==e.clientX&&void 0!==e.clientY&&(h=E(t))&&(n=e.clientX,e=e.clientY,i=h.top,o=h.right,r=h.bottom,s=h.left,f=h.height,h=h.width,e<i||o<n||r<e||n<s||(l=(a=this.options).scrollThreshold,a=a.scrollSpeed,d=t.scrollTop,c=t.scrollLeft,p=t.scrollHeight,u=0<d&&i<=e&&e<=i+l,h=c+h<t.scrollWidth&&n<=o&&o-l<=n,d=d+f<p&&e<=r&&r-l<=e,(p=f=0)<c&&s<=n&&n<=s+l&&(f=Math.floor(Math.max(-1,(n-s)/l-1)*a.x)),h&&(f=Math.ceil(Math.min(1,(n-o)/l+1)*a.x)),u&&(p=Math.floor(Math.max(-1,(e-i)/l-1)*a.y)),(p=d?Math.ceil(Math.min(1,(e-r)/l+1)*a.y):p)&&(t.scrollTop+=p),f&&(t.scrollLeft+=f)))}},dt.prototype={collect:function(t){if(t){for(var e=E(t),n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,i=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,o=Math.min(e.right,n),r=Math.min(e.bottom,i),s=Array.prototype.slice.call(t.children),l=[],a=0;a<=s.length;a++){var c=s[a];if(c&&c!==M.ghost&&"none"!==I(c,"display")){var u=E(c);if(!(u.bottom<0||u.right<0)){if(u.top-u.height>r||u.left-u.width>o)break;l.push({node:c,rect:u})}}}this.animations.push(l)}},animate:function(){for(var t=this.animations.pop(),e=0,n=t.length;e<n;e++){var i=(o=t[e]).node,o=o.rect;this._excute(i,o)}},_excute:function(t,e){var n=e.left,e=e.top,i=E(t);i.top===e&&i.left===n||(e-=i.top,n-=i.left,et(t),nt(t,"translate3d(".concat(n,"px, ").concat(e,"px, 0)")),t.offsetWidth,et(t,this.options.animation),nt(t,"translate3d(0px, 0px, 0px)"),clearTimeout(t.animated),t.animated=setTimeout(function(){et(t),nt(t,""),t.animated=null},this.options.animation))}},ft.prototype={destroy:function(){s=l=null},active:function(){return!!s},setParams:function(t){t.nodes=s||[],t.clones=l||[]},select:function(t){C(t,this.options.selectedClass,!0),this.selectedElements.push(t),this.selectedElements.sort(ct)},deselect:function(t){var e=this.selectedElements.indexOf(t);-1<e&&(C(t,this.options.selectedClass,!1),this.selectedElements.splice(e,1))},getGhostElement:function(){var n;return s?(n=document.createElement("div"),this.selectedElements.forEach(function(t,e){(t=t.cloneNode(!0)).style="position: absolute;left: 0;top: 0;bottom: 0;right: 0;opacity: ".concat(0===e?1:.5,";z-index: ").concat(e,";"),n.appendChild(t)}),n):null},toggleSelected:function(e,t){var n=this;t?e.forEach(function(t){return n.selectedElements.push(t)}):this.selectedElements=this.selectedElements.filter(function(t){return e.indexOf(t)<0})},toggleClass:function(t){if(s)for(var e=0;e<s.length;e++)C(s[e],this.options.chosenClass,t)},toggleVisible:function(t){s&&(t?(t=s.indexOf(M.dragged),this._viewElements(s,t,M.dragged)):this._hideElements(s))},onChoose:function(){!this.options.multiple||!this.selectedElements.length||this.selectedElements.indexOf(M.dragged)<0||(this.selectedElements.sort(ct),s=this.selectedElements,this.toggleClass(!0))},onDrag:function(t){s&&(t.animator.collect(M.dragged.parentNode),this._hideElements(s),t.animator.animate(),this.toggleClass(!1))},onDrop:function(t,e,n){var i,o,r;s&&(o=M.clone,r=s.indexOf(i=M.dragged),e[a].animator.collect(o.parentNode),t!==e&&"clone"===n?(I(o,"display","none"),l=s.map(function(t){return t.cloneNode(!0)}),this._viewElements(l,r,o),this._viewElements(s,r,i)):this._viewElements(s,r,o),e[a].animator.animate(),t!==e)&&(e[a].multiplayer.toggleSelected(l||s,!0),"clone"!==n)&&t[a].multiplayer.toggleSelected(s,!1)},onSelect:function(t,e,n){var i=this.selectedElements.indexOf(e),t=(C(e,this.options.selectedClass,i<0),{from:n.el,event:t,node:e,index:z(e)});i<0?(this.selectedElements.push(e),D({sortable:n,name:"onSelect",params:t})):(this.selectedElements.splice(i,1),D({sortable:n,name:"onDeselect",params:t})),this.selectedElements.sort(ct)},_viewElements:function(t,e,n){for(var i,o=0;o<t.length;o++)I(t[o],"display",""),o<e?n.parentNode.insertBefore(t[o],n):(i=0<o?t[o-1]:n,n.parentNode.insertBefore(t[o],i.nextSibling))},_hideElements:function(t){for(var e=0;e<t.length;e++)t[e]!=M.dragged&&I(t[e],"display","none")}},k=[],J=function(t){var e={},n=t.group;n&&"object"==Q(n)||(n={name:n,pull:!0,put:!0,revertDrag:!0}),e.name=n.name,e.pull=n.pull,e.put=n.put,e.revertDrag=n.revertDrag,t.group=e},M.prototype={constructor:M,_onDrag:function(t){var e,n,i,o,r=this;c||this.options.disabled||!this.options.group.pull||/mousedown|pointerdown/.test(t.type)&&0!==t.button||(i=((e=t.touches&&t.touches[0])||t).target,K&&i&&"SELECT"===i.tagName.toUpperCase())||!(n=ot(i,this.options.draggable,this.el))||n.animated||(p={original:t,clientX:(e||t).clientX,clientY:(e||t).clientY},c=n,_(g=e?c:document,"mouseup",this._onDrop),_(g,"touchend",this._onDrop),_(g,"touchcancel",this._onDrop),o=(n=this.options).handle,"function"==typeof(n=n.selectHandle)&&n(t))||"string"==typeof n&&at(i,n)||"function"==typeof o&&!o(t)||"string"==typeof o&&!at(i,o)||(i=(n=this.options).delay,o=n.delayOnTouchOnly,!i||o&&!e||X||u?this._onStart(e,t):(_(this.el.ownerDocument,"touchmove",this._delayMoveHandler),_(this.el.ownerDocument,"mousemove",this._delayMoveHandler),_(this.el.ownerDocument,"mouseup",this._cancelStart),_(this.el.ownerDocument,"touchend",this._cancelStart),_(this.el.ownerDocument,"touchcancel",this._cancelStart),Z=setTimeout(function(){return r._onStart(e,t)},i)))},_delayMoveHandler:function(t){t=t.touches?t.touches[0]:t,Math.max(Math.abs(t.clientX-p.clientX),Math.abs(t.clientY-p.clientY))>=Math.floor(this.options.touchStartThreshold/(window.devicePixelRatio||1))&&this._cancelStart()},_cancelStart:function(){clearTimeout(Z),i(this.el.ownerDocument,"touchmove",this._delayMoveHandler),i(this.el.ownerDocument,"mousemove",this._delayMoveHandler),i(this.el.ownerDocument,"mouseup",this._cancelStart),i(this.el.ownerDocument,"touchend",this._cancelStart),i(this.el.ownerDocument,"touchcancel",this._cancelStart)},_onStart:function(t,e){var n=z(c);y=this.el,S=this.el,$=x=w=n,T=c,o=this.el,h=c.cloneNode(!0),f=c.parentNode,b=this.options.group.pull,M.clone=h,M.active=this,C(M.dragged=c,this.options.chosenClass,!0),this.multiplayer.onChoose(),D({sortable:this,name:"onChoose",params:this._getParams(e)}),_(g,t?"touchmove":"mousemove",this._nearestSortable);try{document.selection?setTimeout(function(){return document.selection.empty()},0):window.getSelection().removeAllRanges()}catch(t){}},_onStarted:function(){C(h,this.options.chosenClass,!0),this._appendGhost(),this.multiplayer.onDrag(this),D({sortable:this,name:"onDrag",params:this._getParams(p.original)}),I(c,"display","none"),C(c,this.options.chosenClass,!1),c.parentNode.insertBefore(h,c),K&&I(document.body,"user-select","none")},_getGhostElement:function(){var t=this.options.customGhost;return"function"==typeof t?t((t=this.multiplayer.selectedElements).length?t:[c]):this.multiplayer.getGhostElement()||c},_appendGhost:function(){if(!d){var t,e=(i=this.options).fallbackOnBody,n=i.ghostClass,i=i.ghostStyle,e=e?document.body:this.el,o=this._getGhostElement();C(d=o.cloneNode(!0),n,!0);var r=O({position:"fixed",top:(o=E(c)).top,left:o.left,width:o.width,height:o.height,minWidth:o.width,minHeight:o.height,opacity:"0.8",overflow:"hidden","z-index":"100000","box-sizing":"border-box","pointer-events":"none"},i);for(t in r)I(d,t,r[t]);d.style["".concat(q.css,"transition")]="none",nt(d,"translate3d(0px, 0px, 0px)"),M.ghost=d,e.appendChild(d),i=(p.clientX-o.left)/parseInt(d.style.width)*100,n=(p.clientY-o.top)/parseInt(d.style.height)*100,I(d,"transform-origin","".concat(i,"% ").concat(n,"%")),I(d,"transform","translateZ(0)"),I(d,"will-change","transform")}},_nearestSortable:function(t){ut(t);var e,n,o,r,s,i=t.touches&&t.touches[0],l=i||t;!p||!c||(n=m||p,void 0!==(e=l).clientX&&void 0!==e.clientY&&Math.abs(e.clientX-n.clientX)<=0&&Math.abs(e.clientY-n.clientY)<=0)||(m||this._onStarted(),m={original:t,clientX:l.clientX,clientY:l.clientY},e=i?document.elementFromPoint(l.clientX,l.clientY):l.target,n=l.clientX-p.clientX,i=l.clientY-p.clientY,nt(d,"translate3d(".concat(n,"px, ").concat(i,"px, 0)")),this.options.autoScroll&&(n=function(t){if(t&&t.getBoundingClientRect){var e=t;do{if(e.clientWidth<e.scrollWidth||e.clientHeight<e.scrollHeight){var n=I(e);if(e.clientWidth<e.scrollWidth&&("auto"==n.overflowX||"scroll"==n.overflowX)||e.clientHeight<e.scrollHeight&&("auto"==n.overflowY||"scroll"==n.overflowY))return e.getBoundingClientRect&&e!==document.body?e:it()}}while(e=e.parentNode)}return it()}(e),this.autoScroller.update(n,p,m)),o=l.clientX,r=l.clientY,k.some(function(t){var e,n,i=t[a].options.emptyInsertThreshold;if(null!=i)return n=E(t),e=o>=n.left-i&&o<=n.right+i,n=r>=n.top-i&&r<=n.bottom+i,e&&n?s=t:void 0}),s&&s[a]._onMove(t,e))},_allowPut:function(){var t,e,n;return o===this.el||!!this.options.group.put&&(t=(e=this.options.group).name,e=e.put,n=o[a].options.group,e.join&&-1<e.indexOf(n.name)||n.name&&t&&n.name===t)},_allowSwap:function(){var t=ct(h,r),e=(V=t<0?r.nextSibling:r,E(r)),n="vertical"===(o="function"==typeof this.options.direction?this.options.direction.call(m.original,c,this):this.options.direction),i=n?m.clientY:m.clientX,o=r["vertical"===o?"offsetHeight":"offsetWidth"],i=i>=(n?e.top:e.left)&&i<(n?e.bottom:e.right)-o/2?-1:1;return G!==r?(v=i,!0):v!==i&&((v=i)<0?0<t:t<0)},_onMove:function(t,e){var n,i;this._allowPut()&&(D({sortable:this,name:"onMove",params:this._getParams(t)}),this.el===S||e!==this.el&&function(t){for(var e=t.lastElementChild;e&&(e===M.ghost||"none"===I(e,"display"));)e=e.previousElementSibling;return e}(this.el)?(r=ot(e,this.options.draggable,this.el))&&!r.animated&&this._allowSwap()&&(r===h||rt(r,h)||(this.el!==S?this._onInsert(t):(n=t,i=i||E(f),n.clientX<=i.right&&n.clientX>=i.left&&n.clientY>=i.top&&n.clientY<=i.bottom&&e===f||this._onChange(t))),G=r):(r=G=null,this._onInsert(t)))},_onInsert:function(t){var e=r||h,n="clone"===b&&this.el!==o&&S===o,i="clone"===b&&this.el===o&&S!==o;y=this.el,w=z(h),T=e,f=r?r.parentNode:this.el,S[a].animator.collect(h.parentNode),this.animator.collect(f),n&&(I(c,"display",""),o[a].multiplayer.toggleVisible(!0),o[a].options.group.revertDrag||S.insertBefore(c,h)),i&&(w=z(c),I(c,"display","none"),this.multiplayer.toggleVisible(!1)),r?f.insertBefore(h,v<0?r:r.nextSibling):f.appendChild(h),x=z(h),n&&o[a].options.group.revertDrag&&D({sortable:o[a],name:"onChange",params:this._getParams(t,{to:o,target:c,newIndex:$,revertDrag:!0})}),n||D({sortable:S[a],name:"onRemove",params:this._getParams(t)}),i&&r!==c&&D({sortable:this,name:"onChange",params:this._getParams(t,{from:o,backToOrigin:!0})}),i||D({sortable:this,name:"onAdd",params:this._getParams(t)}),S[a].animator.animate(),this.animator.animate(),S=this.el},_onChange:function(t){r!==c&&(f=r.parentNode,w=z(h),T=r,this.animator.collect(f),f.insertBefore(h,V),x=z(h),D({sortable:this,name:"onChange",params:this._getParams(t)}),this.animator.animate(),S=this.el)},_onDrop:function(t){var e,n;ut(t),this._cancelStart(),i(g,"touchmove",this._nearestSortable),i(g,"mousemove",this._nearestSortable),i(g,"mouseup",this._onDrop),i(g,"touchend",this._onDrop),i(g,"touchcancel",this._onDrop),C(c,this.options.chosenClass,!1),o&&(S=o,w=$,T===h&&(T=c),this.multiplayer.toggleClass(!1),D({sortable:this,name:"onUnchoose",params:this._getParams(t)}),m)&&this._onEnd(t),o||m||!this.options.multiple||(n=(e=t.changedTouches?t.changedTouches[0]:t).clientX-p.clientX,e=e.clientY-p.clientY,0<=(n=Math.sqrt(n*n+e*e))&&n<=1&&this.multiplayer.onSelect(t,c,this)),d&&d.parentNode&&d.parentNode.removeChild(d),this.multiplayer.destroy(),this.autoScroller.destroy(),this._nulling()},_onEnd:function(t){var t=this._getParams(t),e=(this.multiplayer.onDrop(S,y,b),this.options.swapOnDrop);("clone"!==b||S===y)&&("function"==typeof e?e(t):e)&&f.insertBefore(c,h),"clone"!==b||S===y||this.multiplayer.active()?h&&h.parentNode&&h.parentNode.removeChild(h):C(h,this.options.chosenClass,!1),I(c,"display",""),K&&I(document.body,"user-select",""),S!==y&&D({sortable:S[a],name:"onDrop",params:t}),D({sortable:y[a],name:"onDrop",params:t})},_getParams:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n={};return n.event=t,n.to=y,n.from=S,n.node=c,n.clone=h,n.target=T,n.oldIndex=w,n.newIndex=x,n.pullMode=b,this.multiplayer.setParams(n),O(n,e),n.relative=n.target===c?0:ct(n.target,h),n},_nulling:function(){y=S=o=c=r=V=h=d=f=b=w=x=$=p=m=T=G=g=v=Z=M.clone=M.ghost=M.active=M.dragged=null},destroy:function(){this._nulling(),this._cancelStart(),i(this.el,"touchstart",this._onDrag),i(this.el,"mousedown",this._onDrag),k.splice(k.indexOf(this.el),1),this.el[a]=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&&J(this.options)},select:function(t){this.multiplayer.select(t)},deselect:function(t){this.multiplayer.deselect(t)},getSelectedElements:function(){return this.multiplayer.selectedElements}},M.utils={on:_,off:i,css:I,index:z,closest:ot,getRect:E,toggleClass:C,detectDirection:lt},M.get=function(t){return t[a]},M.create=function(t,e){return new M(t,e)};var F=M;function pt(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 s&&clearTimeout(s),c?(t=!s,s=setTimeout(function(){s=null},a),t&&(l=r.apply(this,i))):s=setTimeout(function(){r.apply(e,i)},a),l}var s,l,a=1<arguments.length&&void 0!==t?t:50,c=2<arguments.length&&void 0!==e&&e;return n.prototype.cancel=function(){clearTimeout(s),s=null},n}function mt(i,t){var o,r=1<arguments.length&&void 0!==t?t:50;return function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];o=o||setTimeout(function(){o=null,i.apply(this,e)},r)}}function gt(t,e){return(Array.isArray(e)?e:e.replace(/\[/g,".").replace(/\]/g,".").split(".")).reduce(function(t,e){return(t||{})[e]},t)}function vt(n,i,o){function t(){var t=n.event,e=n.dataKey;o(t,i.value?i.value[r.value]:0,e)}var e=null,r=j.computed(function(){return n.isHorizontal?"offsetWidth":"offsetHeight"});j.onMounted(function(){"undefined"!=typeof ResizeObserver&&(e=new ResizeObserver(function(){t()}),i.value)&&e.observe(i.value)}),j.onUpdated(function(){t()}),j.onUnmounted(function(){e&&(e.disconnect(),e=null)})}var yt=["group","delay","handle","disabled","draggable","animation","autoScroll","ghostClass","ghostStyle","chosenClass","fallbackOnBody","scrollThreshold","delayOnTouchOnly"],St=function(){function o(t,e,n){var i=this,e=(B(this,o),this.ctx=t,this.onDrag=e,this.onDrop=n,this.list=L(t.list),this.store={},this.reRendered=!1,yt.reduce(function(t,e){return t[e]=i.ctx[e],t},{}));this.sortable=new F(this.ctx.container,Object.assign(Object.assign({},e),{swapOnDrop:function(t){return t.from===t.to},onDrag:function(t){return i._onDrag(t)},onAdd:function(t){return i._onAdd(t)},onRemove:function(t){return i._onRemove(t)},onChange:function(t){return i._onChange(t)},onDrop:function(t){return i._onDrop(t)}}))}return A(o,[{key:"destroy",value:function(){this.sortable&&this.sortable.destroy(),this.sortable=null}},{key:"setValue",value:function(t,e){"list"===t?this.list=L(e):this.sortable&&this.sortable.option(t,e)}},{key:"_onDrag",value:function(t){var e,t=t.node.dataset.key,n=this._getIndex(this.list,t),i=this.list[n];this.store={item:i,key:t,origin:{index:n,list:this.list},from:{index:n,list:this.list},to:{index:n,list:this.list}},null!=(e=this.sortable)&&e.option("store",this.store),this.onDrag(),this.ctx.emit("drag",{item:i,key:t,index:n})}},{key:"_onRemove",value:function(t){var e,t=t.node.dataset.key,n=this._getIndex(this.list,t),i=this.list[n];this.list.splice(n,1),Object.assign(this.store,{key:t,item:i}),null!=(e=this.sortable)&&e.option("store",this.store),this.ctx.emit("remove",{item:i,index:n,key:t})}},{key:"_onAdd",value:function(t){var e=t.from,n=t.target,t=t.relative,e=null==(e=F.get(e))?void 0:e.option("store"),i=e.key,e=e.item,n=this._getIndex(this.list,n.dataset.key);-1===t&&(n+=1),this.list.splice(n,0,e),Object.assign(this.store,{to:{index:n,list:this.list}}),null!=(t=this.sortable)&&t.option("store",this.store),this.ctx.emit("add",{item:e,index:n,key:i})}},{key:"_onChange",value:function(t){var e,n,i,o,r=null==(r=F.get(t.from))?void 0:r.option("store");t.revertDrag?(this.list=L(this.ctx.list),Object.assign(this.store,{from:r.origin})):(n=t.node,o=t.target,e=t.relative,t=t.backToOrigin,n=this._getIndex(this.list,n.dataset.key),i=this.list[n],o=this._getIndex(this.list,o.dataset.key),t&&(1===e&&r.from.index<o&&--o,-1===e)&&r.from.index>o&&(o+=1),this.list.splice(n,1),this.list.splice(o,0,i),Object.assign(this.store,{from:{index:o,list:this.list},to:{index:o,list:this.list}}))}},{key:"_onDrop",value:function(t){var e=this._getStore(t),n=e.from,e=e.to,i=t.from!==t.to||n.origin.index!==e.to.index;this.onDrop({list:this.list}),this.ctx.emit("drop",{changed:i,list:this.list,item:n.item,key:n.key,from:n.origin,to:e.to}),this.ctx.container===t.from&&this.reRendered&&null!=(i=F.dragged)&&i.remove(),t.from!==t.to&&"clone"===t.pullMode&&null!=(n=F.clone)&&n.remove(),this.reRendered=!1}},{key:"_getIndex",value:function(t,e){for(var n=0;n<t.length;n++)if(gt(t[n],this.ctx.dataKey)==e)return n;return-1}},{key:"_getStore",value:function(t){var e;return{from:null==(e=F.get(t.from))?void 0:e.option("store"),to:null==(e=F.get(t.to))?void 0:e.option("store")}}}]),o}(),bt="INIT",wt="FIXED",xt="DYNAMIC",Tt="FRONT",kt="BEHIND",Ot="STATIONARY",e="horizontal",_t="vertical",Et=(t(n={},_t,"scrollTop"),t(n,e,"scrollLeft"),n),zt=(t(n={},_t,"scrollHeight"),t(n,e,"scrollWidth"),n),Ct=(t(n={},_t,"offsetHeight"),t(n,e,"offsetWidth"),n),It=(t(n={},_t,"offsetTop"),t(n,e,"offsetLeft"),n),Dt=["size","keeps","scroller","direction","debounceTime","throttleTime"],Mt=function(){function e(t){B(this,e),this.options=t,this.sizes=new Map,this.range=Object.create(null),this.offset=0,this.calcType=bt,this.calcSize=Object.create(null),this.direction="",this.useWindowScroll=!1,this.onScroll=null,this.updateScrollElement(),this.updateOnScrollFunction(),this.addScrollEventListener(),this.checkIfUpdate(0,t.keeps-1)}return A(e,[{key:"isFront",value:function(){return this.direction===Tt}},{key:"isBehind",value:function(){return this.direction===kt}},{key:"isFixed",value:function(){return this.calcType===wt}},{key:"getSize",value:function(t){return this.sizes.get(t)||this.getItemSize()}},{key:"getOffset",value:function(){return this.scrollEl[Et[this.options.direction]]}},{key:"getScrollSize",value:function(){return this.scrollEl[zt[this.options.direction]]}},{key:"getClientSize",value:function(){return this.scrollEl[Ct[this.options.direction]]}},{key:"scrollToOffset",value:function(t){this.scrollEl[Et[this.options.direction]]=t}},{key:"scrollToIndex",value:function(t){t>=this.options.uniqueKeys.length-1?this.scrollToBottom():(t=this.getOffsetByIndex(t),this.scrollToOffset(t))}},{key:"scrollToBottom",value:function(){var n=this,t=this.getScrollSize();this.scrollToOffset(t),setTimeout(function(){var t=n.getClientSize(),e=n.getScrollSize();n.getOffset()+t+1<e&&n.scrollToBottom()},5)}},{key:"updateOptions",value:function(t,n){var i=this,e=this.options[t];this.options[t]=n,"uniqueKeys"===t?this.sizes.forEach(function(t,e){n.includes(e)||i.sizes.delete(e)}):"scroller"===t&&(null!=e&&e.removeEventListener("scroll",this.onScroll),this.updateScrollElement(),this.addScrollEventListener())}},{key:"updateRange",value:function(t){t?this.handleUpdate(t.start,t.end):(t=this.range.start,t=Math.max(t,0),this.handleUpdate(t,this.getEndByStart(t)))}},{key:"handleItemSizeChange",value:function(t,e){this.sizes.set(t,e),this.calcType===bt?(this.calcType=wt,this.calcSize.fixed=e):this.isFixed()&&this.calcSize.fixed!==e&&(this.calcType=xt,this.calcSize.fixed=0),this.calcType!==wt&&(this.calcSize.total=L(this.sizes.values()).reduce(function(t,e){return t+e},0),this.calcSize.average=Math.round(this.calcSize.total/this.sizes.size))}},{key:"handleSlotSizeChange",value:function(t,e){this.calcSize[t]=e}},{key:"addScrollEventListener",value:function(){var t;null!=(t=this.options.scroller)&&t.addEventListener("scroll",this.onScroll,!1)}},{key:"removeScrollEventListener",value:function(){var t;null!=(t=this.options.scroller)&&t.removeEventListener("scroll",this.onScroll)}},{key:"updateOnScrollFunction",value:function(){var t=this,e=this.options,n=e.debounceTime,e=e.throttleTime;this.onScroll=n?pt(function(){return t.handleScroll()},n):e?mt(function(){return t.handleScroll()},e):function(){return t.handleScroll()}}},{key:"updateScrollElement",value:function(){this.scrollEl=this.getScrollElement(this.options.scroller)}},{key:"handleScroll",value:function(){var t,e,n,i;0!==this.sizes.size&&(t=this.getOffset(),e=this.getClientSize(),i=this.getScrollSize(),t===this.offset?this.direction=Ot:this.direction=t<this.offset?Tt:kt,this.offset=t,n=this.isFront()&&t<=0,i=this.isBehind()&&i<=e+t,this.options.onScroll({top:n,bottom:i,offset:t,direction:this.direction}),this.isFront()?this.handleScrollFront():this.isBehind()&&this.handleScrollBehind())}},{key:"handleScrollFront",value:function(){var t=this.getScrollItems();t>this.range.start||(t=Math.max(t-this.options.buffer,0),this.checkIfUpdate(t,this.getEndByStart(t)))}},{key:"handleScrollBehind",value:function(){var t=this.getScrollItems();t<this.range.start+this.options.buffer||this.checkIfUpdate(t,this.getEndByStart(t))}},{key:"getScrollItems",value: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,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}},{key:"checkIfUpdate",value: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)}},{key:"handleUpdate",value:function(t,e){this.range.start=t,this.range.end=e,this.range.front=this.getFrontOffset(),this.range.behind=this.getBehindOffset(),this.options.onUpdate(Object.assign({},this.range))}},{key:"getFrontOffset",value:function(){return this.isFixed()?this.calcSize.fixed*this.range.start:this.getOffsetByIndex(this.range.start)}},{key:"getBehindOffset",value:function(){var t=this.range.end,e=this.getLastIndex();return this.isFixed()?(e-t)*this.calcSize.fixed:(e-t)*this.getItemSize()}},{key:"getOffsetByIndex",value: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 e}},{key:"getEndByStart",value:function(t){return Math.min(t+this.options.keeps-1,this.getLastIndex())}},{key:"getLastIndex",value:function(){var t=this.options,e=t.uniqueKeys,t=t.keeps;return 0<e.length?e.length-1:t-1}},{key:"getItemSize",value:function(){return this.isFixed()?this.calcSize.fixed:this.calcSize.average||this.options.size}},{key:"getScrollStartOffset",value:function(){var t=this.calcSize.header||0;if(this.useWindowScroll&&this.options.wrapper)for(var e=this.options.wrapper;t+=e[It[this.options.direction]],(e=e.offsetParent)&&e!==this.options.wrapper.ownerDocument;);return t}},{key:"getScrollElement",value:function(t){return t instanceof Document&&9===t.nodeType||t instanceof Window?(this.useWindowScroll=!0,document.scrollingElement||document.documentElement||document.body):(this.useWindowScroll=!1,t)}}]),e}(),_t={dataSource:{default:[],required:!0},dataKey:{type:String,default:"",required:!0},draggable:{type:[String]},handle:{type:[Function,String]},group:{type:[Object,String]},scroller:{},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"},headerTag:{type:String,default:"div"},footerTag:{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:""},headerStyle:{type:Object,default:function(){return{}}},footerStyle:{type:Object,default:function(){return{}}}},n={tag:{type:String,default:"div"},event:{type:String},dataKey:{type:[String,Number]},isHorizontal:{type:Boolean}},Bt=j.defineComponent({name:"VirtualDraglistItems",props:n,emits:["resize"],setup:function(n,t){var e=t.emit,i=t.slots,o=j.ref(null);return vt(n,o,e),function(){var t=n.tag,e=n.dataKey;return j.h(t,{ref:o,key:e,"data-key":e},{default:function(){var t;return null==(t=i.default)?void 0:t.call(i)}})}}}),Nt=j.defineComponent({name:"VirtualDraglistSlots",props:n,emits:["resize"],setup:function(n,t){var e=t.emit,i=t.slots,o=j.ref(null);return vt(n,o,e),function(){var t=n.tag,e=n.dataKey;return j.h(t,{ref:o,key:e,"data-key":e},{default:function(){var t;return null==(t=i.default)?void 0:t.call(i)}})}}});return j.defineComponent({props:_t,emits:["update:dataSource","top","bottom","drag","drop","add","remove"],setup:function(c,t){var i,u,n=this,o=t.emit,r=t.slots,t=t.expose,h=j.ref(Object.create(null)),d=j.ref(null),f=j.ref(null),s=j.ref([]),e=j.ref([]),p=j.computed(function(){return"vertical"!==c.direction}),l=j.computed(function(){return Dt.reduce(function(t,e){return t[e]=c[e],t},{})}),a=j.computed(function(){return yt.reduce(function(t,e){return t[e]=n[e],t},{})}),m=null,g=null,v=0;function y(){return u.getOffset()}function S(){return u.getClientSize()}function b(){return u.getScrollSize()}function w(t){u.scrollToOffset(t)}function x(t){u.scrollToIndex(t)}t({getSize:function(t){return u.getSize(t)},getOffset:y,getClientSize:S,getScrollSize:b,scrollToTop:function(){w(0)},scrollToBottom:function(){u.scrollToBottom()},scrollToKey:function(t){-1<(t=e.value.indexOf(t))&&u.scrollToIndex(t)},scrollToIndex:x,scrollToOffset:w}),j.watch(function(){return c.dataSource},function(){O()},{deep:!0}),j.watch(function(){return l},function(t,e){if(u)for(var n in t)t[n]!=e[n]&&u.updateOptions(n,t[n])}),j.watch(function(){return a},function(t,e){if(u)for(var n in t)t[n]!=e[n]&&i.setValue(n,t[n])}),j.onBeforeMount(function(){E(),O()}),j.onActivated(function(){u&&w(u.offset),u.addScrollEventListener()}),j.onDeactivated(function(){u.removeScrollEventListener()}),j.onMounted(function(){u.updateOptions("wrapper",f.value),c.scroller||u.updateOptions("scroller",d.value)}),j.onUnmounted(function(){i&&i.destroy(),u.removeScrollEventListener()});function T(t,e){var n=r[t];return n?j.h(Nt,{key:t,tag:e,style:c["".concat(t,"Style")],dataKey:t,event:"resize",onResize:N},{default:function(){return null==n?void 0:n()}}):null}function k(){for(var o=[],t=h.value,e=t.start,n=t.end,i=e;i<=n;i++)!function(e){var n,t,i=s.value[e];i&&(n=gt(i,c.dataKey),t=Object.assign(Object.assign({},c.itemStyle),A(n)),o.push(r.item?j.h(Bt,{key:n,tag:c.itemTag,class:c.itemClass,style:t,event:"resize",dataKey:n,isHorizontal:p.value,onResize:B},{default:function(){var t;return null==(t=r.item)?void 0:t.call(r,{record:i,index:e,dataKey:n})}}):null))}(i);return o}var O=function(){e=c.dataSource;var t,e=j.isRef(e)?e.value:e;e&&(t=L(s.value),s.value=e,_(),u.sizes.size?C(t,e):(clearTimeout(g),g=setTimeout(function(){return u.updateRange()},17)),i?i.setValue("list",e):j.nextTick(function(){return z()}),m)&&c.keepOffset&&(0<(t=e.length-m)&&x(t),m=null)},_=function(){e.value=s.value.map(function(t){return gt(t,c.dataKey)}),u.updateOptions("uniqueKeys",e.value)},E=function(){u=new Mt({size:c.size,keeps:c.keeps,buffer:Math.round(c.keeps/3),scroller:c.scroller,direction:c.direction,uniqueKeys:e.value,debounceTime:c.debounceTime,throttleTime:c.throttleTime,onScroll:function(t){m=null,s.value.length&&t.top?D():t.bottom&&M()},onUpdate:function(t){F.dragged&&i&&t.start!==h.value.start&&(i.reRendered=!0),h.value=t}})},z=function(){i=new St(Object.assign({container:f.value,list:s.value,emit:o},c),function(){v=h.value.start},function(t){var e,t=t.list;t.length===s.value.length&&v<h.value.start&&(h.value.front+=(null==(e=F.clone)?void 0:e[p.value?"offsetWidth":"offsetHeight"])||0,v=h.value.start),o("update:dataSource",t)})},C=function(t,e){var n,i=Object.assign({},h.value);0<i.start&&-1<(n=e.indexOf(t[i.start]))&&(i.start=n,i.end=n+c.keeps-1),e.length>t.length&&i.end===t.length-1&&I()&&(i.end++,i.start=Math.max(0,i.end-c.keeps+1)),u.updateRange(i)},I=function(){var t=y(),e=S();return b()<=t+e+1},D=mt(function(){o("top"),m=s.value.length}),M=mt(function(){o("bottom")}),B=function(t,e){u.handleItemSizeChange(e,t)},N=function(t,e){u.handleSlotSizeChange(e,t)},A=function(t){return t==(null==(t=F.dragged)?void 0:t.dataset.key)?{display:"none"}:{}};return function(){var t=u.useWindowScroll,e=c.rootTag,n=c.wrapTag,i=c.wrapClass,o=c.headerTag,r=c.footerTag,s=h.value,l=s.front,s=s.behind,a=Object.assign(Object.assign({},c.wrapStyle),{padding:p.value?"0px ".concat(s,"px 0px ").concat(l,"px"):"".concat(l,"px 0px ").concat(s,"px")});return j.h(e,{ref:d,style:!t&&{overflow:p.value?"auto hidden":"hidden auto"}},{default:function(){return[T("header",o),j.h(n,{ref:f,class:i,style:a},{default:k}),T("footer",r)]}})}}})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("vue")):"function"==typeof define&&define.amd?define(["vue"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).VirtualDragList=e(t.Vue)}(this,function(A){"use strict";function N(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 B(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach(function(t){i(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function i(t,e,n){(e=function(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);n=n.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==typeof t?t:String(t)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}function R(t){return function(t){if(Array.isArray(t))return j(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?j(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)?j(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 j(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}var F,L,K,u,W,Y,H,X,s,l,a,o,c,r,U,h,d,f,p,m,q,g,v,V,y,S,b,w,x,G,O,T,Z;function $(t){return($="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 J(){return(J=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n,i=arguments[e];for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t}).apply(this,arguments)}function Q(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}function tt(t,e){t.style["".concat(X.css,"transition-duration")]=null==e?"":"".concat(e,"ms")}function et(t,e){t.style["".concat(X.css,"transform")]=e?"".concat(e):""}function E(t,e,n){window.addEventListener?t.addEventListener(e,n,!(!H&&u)&&F):window.attachEvent?t.attachEvent("on"+e,n):t["on"+e]=n}function _(t,e,n){window.removeEventListener?t.removeEventListener(e,n,!(!H&&u)&&F):window.detachEvent?t.detachEvent("on"+e,n):t["on"+e]=null}function nt(){return document.scrollingElement||document.documentElement}function z(t,e,n){if(t.getBoundingClientRect||t===window){var i,o,r,s,l,a,c=t!==window&&t.parentNode&&t!==nt()?(o=(i=t.getBoundingClientRect()).top,r=i.left,s=i.bottom,l=i.right,a=i.height,i.width):(r=o=0,s=window.innerHeight,l=window.innerWidth,a=window.innerHeight,window.innerWidth);if(e&&t!==window){n=n||t.parentNode;do{if(n&&n.getBoundingClientRect){var u=n.getBoundingClientRect();o-=u.top+parseInt(C(n,"border-top-width")),r-=u.left+parseInt(C(n,"border-left-width")),s=o+i.height,l=r+i.width;break}}while(n=n.parentNode)}return{top:o,left:r,bottom:s,right:l,width:c,height:a}}}function it(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(ot(t,o[s]))return o[s]}else if((">"!==e[0]||t.parentNode===n)&&lt(t,e)||i&&t===n)return t}while(t=t.parentNode)}return null}function ot(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 D(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||e&&!lt(t,e)||"none"===C(t,"display")||n++;return n}function rt(t,e,n,i){for(var o=0,r=0,s=t.children;o<s.length;){if(s[o]!==M.ghost&&"none"!==C(s[o],"display")&&it(s[o],n,t,!1)&&(i||s[o]!==M.dragged)){if(r===e)return s[o];r++}o++}return null}function st(t,e){var n,i=C(t),o=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),r=rt(t,0,e),t=rt(t,1,e),e=r&&C(r),s=t&&C(t),l=e&&parseInt(e.marginLeft)+parseInt(e.marginRight)+z(r).width,a=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+z(t).width,c=W||u?"cssFloat":"float";return"flex"===i.display?"column"===i.flexDirection||"column-reverse"===i.flexDirection?"vertical":"horizontal":"grid"===i.display?i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal":r&&e.float&&"none"!==e.float?(n="left"===e.float?"left":"right",!t||"both"!==s.clear&&s.clear!==n?"horizontal":"vertical"):r&&("block"===e.display||"flex"===e.display||"table"===e.display||"grid"===e.display||o<=l&&"none"===i[c]||t&&"none"===i[c]&&o<l+a)?"vertical":"horizontal"}function I(t,e,n){var i;t&&e&&(t.classList?t.classList[n?"add":"remove"](e):(i=(" "+t.className+" ").replace(L," ").replace(" "+e+" "," "),t.className=(i+(n?" "+e:"")).replace(L," ")))}function lt(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 C(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 at(t,e){return 2===(t=t.compareDocumentPosition?t.compareDocumentPosition(e):t.contains?(t!=e&&t.contains(e)&&16)+(t!=e&&e.contains(t)&&8)+(0<=t.sourceIndex&&0<=e.sourceIndex?(t.sourceIndex<e.sourceIndex&&4)+(t.sourceIndex>e.sourceIndex&&2):1)+0:0)?1:4===t?-1:0}function ct(t){void 0!==t.preventDefault&&t.cancelable&&t.preventDefault()}function k(t){var e=t.sortable,n=t.name,t=t.params;"function"==typeof(e=e.options[n])&&e(J({},t))}function ut(t){this.options=t,this.autoScrollAnimationFrame=null}function ht(t){this.options=t,this.animations=[]}function dt(t){this.options=t||{},this.selectedElements=[]}function M(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable-dnd: `el` must be an HTMLElement, not ".concat({}.toString.call(t));(t[a]=this).el=t,this.options=e=J({},e);var n,i,o={store:null,disabled:!1,group:"",animation:150,draggable:null,handle:null,multiple:!1,selectHandle:null,customGhost:null,direction:function(){return st(t,e.draggable)},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:-5};for(n in o)n in this.options||(this.options[n]=o[n]);for(i in Z(e),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));var r=this.options.supportTouch;E(t,r?"touchstart":"mousedown",this._onDrag),T.push(t),this.autoScroller=new ut(this.options),this.multiplayer=new dt(this.options),this.animator=new ht(this.options)}F={capture:!1,passive:!1},L=/\s+/g,u=Q(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),W=Q(/Edge/i),Y=Q(/safari/i)&&!Q(/chrome/i)&&!Q(/android/i),K=!1,document.addEventListener("checkIfSupportPassive",null,{get passive(){return K=!0}}),H=K,X="undefined"==typeof window||"undefined"==typeof document?{}:(t=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],t=(Array.prototype.slice.call(t).join("").match(/-(moz|webkit|ms)-/)||""===t.OLink&&["","o"])[1],{dom:"WebKit|Moz|MS|O".match(new RegExp("("+t+")","i"))[1],lowercase:t,css:"-"+t+"-",js:t[0].toUpperCase()+t.substr(1)}),a="Sortable"+Date.now(),window.requestAnimationFrame||(window.requestAnimationFrame=function(t){return setTimeout(t,17)}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),ut.prototype={destroy:function(){null!=this.autoScrollAnimationFrame&&(cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=null)},update:function(t,e,n){var i=this;cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=requestAnimationFrame(function(){e&&n&&i.autoScroll(t,n),i.update(t,e,n)})},autoScroll:function(t,e){var n,i,o,r,s,l,a,c,u,h,d,f,p;t&&void 0!==e.clientX&&void 0!==e.clientY&&(h=z(t))&&(n=e.clientX,e=e.clientY,i=h.top,o=h.right,r=h.bottom,s=h.left,f=h.height,h=h.width,e<i||o<n||r<e||n<s||(l=(a=this.options).scrollThreshold,a=a.scrollSpeed,d=t.scrollTop,c=t.scrollLeft,p=t.scrollHeight,u=0<d&&i<=e&&e<=i+l,h=c+h<t.scrollWidth&&n<=o&&o-l<=n,d=d+f<p&&e<=r&&r-l<=e,(p=f=0)<c&&s<=n&&n<=s+l&&(f=Math.floor(Math.max(-1,(n-s)/l-1)*a.x)),h&&(f=Math.ceil(Math.min(1,(n-o)/l+1)*a.x)),u&&(p=Math.floor(Math.max(-1,(e-i)/l-1)*a.y)),(p=d?Math.ceil(Math.min(1,(e-r)/l+1)*a.y):p)&&(t.scrollTop+=p),f&&(t.scrollLeft+=f)))}},ht.prototype={collect:function(t){if(t){for(var e=z(t),n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,i=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,o=Math.min(e.right,n),r=Math.min(e.bottom,i),s=Array.prototype.slice.call(t.children),l=[],a=0;a<=s.length;a++){var c=s[a];if(c&&c!==M.ghost&&"none"!==C(c,"display")){var u=z(c);if(!(u.bottom<0||u.right<0)){if(u.top-u.height>r||u.left-u.width>o)break;l.push({node:c,rect:u})}}}this.animations.push(l)}},animate:function(){for(var t=this.animations.pop(),e=0,n=t.length;e<n;e++){var i=(o=t[e]).node,o=o.rect;this._excute(i,o)}},_excute:function(t,e){var n=e.left,e=e.top,i=z(t);i.top===e&&i.left===n||(e-=i.top,n-=i.left,tt(t),et(t,"translate3d(".concat(n,"px, ").concat(e,"px, 0)")),t.offsetWidth,tt(t,this.options.animation),et(t,"translate3d(0px, 0px, 0px)"),clearTimeout(t.animated),t.animated=setTimeout(function(){tt(t),et(t,""),t.animated=null},this.options.animation))}},dt.prototype={destroy:function(){s=l=null},active:function(){return!!s},setParams:function(t){t.nodes=s||[],t.clones=l||[]},select:function(t){I(t,this.options.selectedClass,!0),this.selectedElements.push(t),this.selectedElements.sort(at)},deselect:function(t){var e=this.selectedElements.indexOf(t);-1<e&&(I(t,this.options.selectedClass,!1),this.selectedElements.splice(e,1))},getGhostElement:function(){var n;return s?(n=document.createElement("div"),this.selectedElements.forEach(function(t,e){(t=t.cloneNode(!0)).style="position: absolute;left: 0;top: 0;bottom: 0;right: 0;opacity: ".concat(0===e?1:.5,";z-index: ").concat(e,";"),n.appendChild(t)}),n):null},toggleSelected:function(e,t){var n=this;t?e.forEach(function(t){return n.selectedElements.push(t)}):this.selectedElements=this.selectedElements.filter(function(t){return e.indexOf(t)<0})},toggleClass:function(t){if(s)for(var e=0;e<s.length;e++)I(s[e],this.options.chosenClass,t)},toggleVisible:function(t){s&&(t?(t=s.indexOf(M.dragged),this._viewElements(s,t,M.dragged)):this._hideElements(s))},onChoose:function(){!this.options.multiple||!this.selectedElements.length||this.selectedElements.indexOf(M.dragged)<0||(this.selectedElements.sort(at),s=this.selectedElements,this.toggleClass(!0))},onDrag:function(t){s&&(t.animator.collect(M.dragged.parentNode),this._hideElements(s),t.animator.animate(),this.toggleClass(!1))},onDrop:function(t,e,n){var i,o,r;s&&(o=M.clone,r=s.indexOf(i=M.dragged),e[a].animator.collect(o.parentNode),t!==e&&"clone"===n?(C(o,"display","none"),l=s.map(function(t){return t.cloneNode(!0)}),this._viewElements(l,r,o),this._viewElements(s,r,i)):this._viewElements(s,r,o),e[a].animator.animate(),t!==e)&&(e[a].multiplayer.toggleSelected(l||s,!0),"clone"!==n)&&t[a].multiplayer.toggleSelected(s,!1)},onSelect:function(t,e,n){var i=this.selectedElements.indexOf(e),t=(I(e,this.options.selectedClass,i<0),{from:n.el,event:t,node:e,index:D(e)});i<0?(this.selectedElements.push(e),k({sortable:n,name:"onSelect",params:t})):(this.selectedElements.splice(i,1),k({sortable:n,name:"onDeselect",params:t})),this.selectedElements.sort(at)},_viewElements:function(t,e,n){for(var i,o=0;o<t.length;o++)C(t[o],"display",""),o<e?n.parentNode.insertBefore(t[o],n):(i=0<o?t[o-1]:n,n.parentNode.insertBefore(t[o],i.nextSibling))},_hideElements:function(t){for(var e=0;e<t.length;e++)t[e]!=M.dragged&&C(t[e],"display","none")}},T=[],Z=function(t){var e={},n=t.group;n&&"object"==$(n)||(n={name:n,pull:!0,put:!0,revertDrag:!0}),e.name=n.name,e.pull=n.pull,e.put=n.put,e.revertDrag=n.revertDrag,t.group=e},M.prototype={constructor:M,_onDrag:function(t){var e,n,i,o,r=this;c||this.options.disabled||!this.options.group.pull||/mousedown|pointerdown/.test(t.type)&&0!==t.button||(i=((e=t.touches&&t.touches[0])||t).target,Y&&i&&"SELECT"===i.tagName.toUpperCase())||!(n=it(i,this.options.draggable,this.el))||n.animated||(p={original:t,clientX:(e||t).clientX,clientY:(e||t).clientY},c=n,E(g=e?c:document,"mouseup",this._onDrop),E(g,"touchend",this._onDrop),E(g,"touchcancel",this._onDrop),o=(n=this.options).handle,"function"==typeof(n=n.selectHandle)&&n(t))||"string"==typeof n&&lt(i,n)||"function"==typeof o&&!o(t)||"string"==typeof o&&!lt(i,o)||(i=(n=this.options).delay,o=n.delayOnTouchOnly,!i||o&&!e||W||u?this._onStart(e,t):(E(this.el.ownerDocument,"touchmove",this._delayMoveHandler),E(this.el.ownerDocument,"mousemove",this._delayMoveHandler),E(this.el.ownerDocument,"mouseup",this._cancelStart),E(this.el.ownerDocument,"touchend",this._cancelStart),E(this.el.ownerDocument,"touchcancel",this._cancelStart),V=setTimeout(function(){return r._onStart(e,t)},i)))},_delayMoveHandler:function(t){t=t.touches?t.touches[0]:t,Math.max(Math.abs(t.clientX-p.clientX),Math.abs(t.clientY-p.clientY))>=Math.floor(this.options.touchStartThreshold/(window.devicePixelRatio||1))&&this._cancelStart()},_cancelStart:function(){clearTimeout(V),_(this.el.ownerDocument,"touchmove",this._delayMoveHandler),_(this.el.ownerDocument,"mousemove",this._delayMoveHandler),_(this.el.ownerDocument,"mouseup",this._cancelStart),_(this.el.ownerDocument,"touchend",this._cancelStart),_(this.el.ownerDocument,"touchcancel",this._cancelStart)},_onStart:function(t,e){var n=D(c);y=this.el,S=this.el,G=x=w=n,O=c,o=this.el,h=c.cloneNode(!0),f=c.parentNode,b=this.options.group.pull,M.clone=h,M.active=this,I(M.dragged=c,this.options.chosenClass,!0),this.multiplayer.onChoose(),k({sortable:this,name:"onChoose",params:this._getParams(e)}),E(g,t?"touchmove":"mousemove",this._nearestSortable);try{document.selection?setTimeout(function(){return document.selection.empty()},0):window.getSelection().removeAllRanges()}catch(t){}},_onStarted:function(){I(h,this.options.chosenClass,!0),this._appendGhost(),this.multiplayer.onDrag(this),k({sortable:this,name:"onDrag",params:this._getParams(p.original)}),C(c,"display","none"),I(c,this.options.chosenClass,!1),c.parentNode.insertBefore(h,c),Y&&C(document.body,"user-select","none")},_getGhostElement:function(){var t=this.options.customGhost;return"function"==typeof t?t((t=this.multiplayer.selectedElements).length?t:[c]):this.multiplayer.getGhostElement()||c},_appendGhost:function(){if(!d){var t,e=(i=this.options).fallbackOnBody,n=i.ghostClass,i=i.ghostStyle,e=e?document.body:this.el,o=this._getGhostElement();I(d=o.cloneNode(!0),n,!0);var r=J({position:"fixed",top:(o=z(c)).top,left:o.left,width:o.width,height:o.height,minWidth:o.width,minHeight:o.height,opacity:"0.8",overflow:"hidden","z-index":"100000","box-sizing":"border-box","pointer-events":"none"},i);for(t in r)C(d,t,r[t]);d.style["".concat(X.css,"transition")]="none",et(d,"translate3d(0px, 0px, 0px)"),M.ghost=d,e.appendChild(d),i=(p.clientX-o.left)/parseInt(d.style.width)*100,n=(p.clientY-o.top)/parseInt(d.style.height)*100,C(d,"transform-origin","".concat(i,"% ").concat(n,"%")),C(d,"transform","translateZ(0)"),C(d,"will-change","transform")}},_nearestSortable:function(t){ct(t);var e,n,o,r,s,i=t.touches&&t.touches[0],l=i||t;!p||!c||(n=m||p,void 0!==(e=l).clientX&&void 0!==e.clientY&&Math.abs(e.clientX-n.clientX)<=0&&Math.abs(e.clientY-n.clientY)<=0)||(m||this._onStarted(),m={original:t,clientX:l.clientX,clientY:l.clientY},e=i?document.elementFromPoint(l.clientX,l.clientY):l.target,n=l.clientX-p.clientX,i=l.clientY-p.clientY,et(d,"translate3d(".concat(n,"px, ").concat(i,"px, 0)")),this.options.autoScroll&&(n=function(t){if(t&&t.getBoundingClientRect){var e=t;do{if(e.clientWidth<e.scrollWidth||e.clientHeight<e.scrollHeight){var n=C(e);if(e.clientWidth<e.scrollWidth&&("auto"==n.overflowX||"scroll"==n.overflowX)||e.clientHeight<e.scrollHeight&&("auto"==n.overflowY||"scroll"==n.overflowY))return e.getBoundingClientRect&&e!==document.body?e:nt()}}while(e=e.parentNode)}return nt()}(e),this.autoScroller.update(n,p,m)),o=l.clientX,r=l.clientY,T.some(function(t){var e,n,i=t[a].options.emptyInsertThreshold;if(null!=i)return n=z(t),e=o>=n.left-i&&o<=n.right+i,n=r>=n.top-i&&r<=n.bottom+i,e&&n?s=t:void 0}),s&&s[a]._onMove(t,e))},_allowPut:function(){var t,e,n;return o===this.el||!!this.options.group.put&&(t=(e=this.options.group).name,e=e.put,n=o[a].options.group,e.join&&-1<e.indexOf(n.name)||n.name&&t&&n.name===t)},_allowSwap:function(){var t=at(h,r),e=(U=t<0?r.nextSibling:r,z(r)),n="vertical"===(o="function"==typeof this.options.direction?this.options.direction.call(m.original,c,this):this.options.direction),i=n?m.clientY:m.clientX,o=r["vertical"===o?"offsetHeight":"offsetWidth"],i=i>=(n?e.top:e.left)&&i<(n?e.bottom:e.right)-o/2?-1:1;return q!==r?(v=i,!0):v!==i&&((v=i)<0?0<t:t<0)},_onMove:function(t,e){var n,i;this._allowPut()&&(k({sortable:this,name:"onMove",params:this._getParams(t)}),this.el===S||e!==this.el&&function(t){for(var e=t.lastElementChild;e&&(e===M.ghost||"none"===C(e,"display"));)e=e.previousElementSibling;return e}(this.el)?(r=it(e,this.options.draggable,this.el))&&!r.animated&&this._allowSwap()&&(r===h||ot(r,h)||(this.el!==S?this._onInsert(t):(n=t,i=i||z(f),n.clientX<=i.right&&n.clientX>=i.left&&n.clientY>=i.top&&n.clientY<=i.bottom&&e===f||this._onChange(t))),q=r):(r=q=null,this._onInsert(t)))},_onInsert:function(t){var e=r||h,n="clone"===b&&this.el!==o&&S===o,i="clone"===b&&this.el===o&&S!==o;y=this.el,w=D(h),O=e,f=r?r.parentNode:this.el,S[a].animator.collect(h.parentNode),this.animator.collect(f),n&&(C(c,"display",""),o[a].multiplayer.toggleVisible(!0),o[a].options.group.revertDrag||S.insertBefore(c,h)),i&&(w=D(c),C(c,"display","none"),this.multiplayer.toggleVisible(!1)),r?f.insertBefore(h,v<0?r:r.nextSibling):f.appendChild(h),x=D(h),n&&o[a].options.group.revertDrag&&k({sortable:o[a],name:"onChange",params:this._getParams(t,{to:o,target:c,newIndex:G,revertDrag:!0})}),n||k({sortable:S[a],name:"onRemove",params:this._getParams(t)}),i&&r!==c&&k({sortable:this,name:"onChange",params:this._getParams(t,{from:o,backToOrigin:!0})}),i||k({sortable:this,name:"onAdd",params:this._getParams(t)}),S[a].animator.animate(),this.animator.animate(),S=this.el},_onChange:function(t){r!==c&&(f=r.parentNode,w=D(h),O=r,this.animator.collect(f),f.insertBefore(h,U),x=D(h),k({sortable:this,name:"onChange",params:this._getParams(t)}),this.animator.animate(),S=this.el)},_onDrop:function(t){var e,n;ct(t),this._cancelStart(),_(g,"touchmove",this._nearestSortable),_(g,"mousemove",this._nearestSortable),_(g,"mouseup",this._onDrop),_(g,"touchend",this._onDrop),_(g,"touchcancel",this._onDrop),I(c,this.options.chosenClass,!1),o&&(S=o,w=G,O===h&&(O=c),this.multiplayer.toggleClass(!1),k({sortable:this,name:"onUnchoose",params:this._getParams(t)}),m)&&this._onEnd(t),o||m||!this.options.multiple||(n=(e=t.changedTouches?t.changedTouches[0]:t).clientX-p.clientX,e=e.clientY-p.clientY,0<=(n=Math.sqrt(n*n+e*e))&&n<=1&&this.multiplayer.onSelect(t,c,this)),d&&d.parentNode&&d.parentNode.removeChild(d),this.multiplayer.destroy(),this.autoScroller.destroy(),this._nulling()},_onEnd:function(t){var t=this._getParams(t),e=(this.multiplayer.onDrop(S,y,b),this.options.swapOnDrop);("clone"!==b||S===y)&&("function"==typeof e?e(t):e)&&f.insertBefore(c,h),"clone"!==b||S===y||this.multiplayer.active()?h&&h.parentNode&&h.parentNode.removeChild(h):I(h,this.options.chosenClass,!1),C(c,"display",""),Y&&C(document.body,"user-select",""),S!==y&&k({sortable:S[a],name:"onDrop",params:t}),k({sortable:y[a],name:"onDrop",params:t})},_getParams:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n={};return n.event=t,n.to=y,n.from=S,n.node=c,n.clone=h,n.target=O,n.oldIndex=w,n.newIndex=x,n.pullMode=b,this.multiplayer.setParams(n),J(n,e),n.relative=n.target===c?0:at(n.target,h),n},_nulling:function(){y=S=o=c=r=U=h=d=f=b=w=x=G=p=m=O=q=g=v=V=M.clone=M.ghost=M.active=M.dragged=null},destroy:function(){this._nulling(),this._cancelStart(),_(this.el,"touchstart",this._onDrag),_(this.el,"mousedown",this._onDrag),T.splice(T.indexOf(this.el),1),this.el[a]=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&&Z(this.options)},select:function(t){this.multiplayer.select(t)},deselect:function(t){this.multiplayer.deselect(t)},getSelectedElements:function(){return this.multiplayer.selectedElements}},M.utils={on:E,off:_,css:C,index:D,closest:it,getRect:z,toggleClass:I,detectDirection:st},M.get=function(t){return t[a]},M.create=function(t,e){return new M(t,e)};function ft(n,i,o){function t(){var t=n.event,e=n.dataKey;o(t,i.value?i.value[n.sizeKey]:0,e)}var e=null;A.onMounted(function(){"undefined"!=typeof ResizeObserver&&(e=new ResizeObserver(function(){t()}),i.value)&&e.observe(i.value)}),A.onUpdated(function(){t()}),A.onUnmounted(function(){e&&(e.disconnect(),e=null)})}var P=M,t={dataSource:{default:[],required:!0},dataKey:{type:String,default:"",required:!0},draggable:{type:[String]},handle:{type:[Function,String]},group:{type:[Object,String]},scroller:{},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"},headerTag:{type:String,default:"div"},footerTag:{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:""},headerStyle:{type:Object,default:function(){return{}}},footerStyle:{type:Object,default:function(){return{}}}},e={tag:{type:String,default:"div"},event:{type:String},dataKey:{type:[String,Number]},sizeKey:{type:String}},pt=A.defineComponent({name:"VirtualDraglistItems",props:e,emits:["resize"],setup:function(n,t){var e=t.emit,i=t.slots,o=A.ref(null);return ft(n,o,e),function(){var t=n.tag,e=n.dataKey;return A.h(t,{ref:o,key:e,"data-key":e},{default:function(){var t;return null==(t=i.default)?void 0:t.call(i)}})}}}),mt=A.defineComponent({name:"VirtualDraglistSlots",props:e,emits:["resize"],setup:function(n,t){var e=t.emit,i=t.slots,o=A.ref(null);return ft(n,o,e),function(){var t=n.tag,e=n.dataKey;return A.h(t,{ref:o,key:e,"data-key":e},{default:function(){var t;return null==(t=i.default)?void 0:t.call(i)}})}}});function gt(o,r){function t(){for(var t=this,e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];s||(r<=0?o.apply(this,n):s=setTimeout(function(){s=void 0,o.apply(t,n)},r))}var s=null;return t.cancel=function(){s&&(clearTimeout(s),s=null)},t}function vt(t,e){return(Array.isArray(e)?e:e.replace(/\[/g,".").replace(/\]/g,".").split(".")).reduce(function(t,e){return(t||{})[e]},t)}var n,yt=["delay","group","handle","disabled","draggable","animation","autoScroll","ghostClass","ghostStyle","chosenClass","fallbackOnBody","scrollThreshold","delayOnTouchOnly"];function St(t,e){this.el=t,this.options=e,this.list=[],this.store={},this.reRendered=!1,this.attrs=yt,this.init()}St.prototype={constructor:St,destroy:function(){this.sortable&&this.sortable.destroy(),this.sortable=this.store=this.reRendered=null},option:function(t,e){"list"===t?this.list=R(e):this.sortable.option(t,e)},init:function(){for(var e=this,t={},n=0;n<yt.length;n++){var i=yt[n];t[i]=this.options[i]}this.sortable=new P(this.el,B(B({},t),{},{swapOnDrop:function(t){return t.from===t.to},onDrag:function(t){return e.onDrag(t)},onAdd:function(t){return e.onAdd(t)},onRemove:function(t){return e.onRemove(t)},onChange:function(t){return e.onChange(t)},onDrop:function(t){return e.onDrop(t)}})),this.list=R(this.options.list)},onDrag:function(t){var t=t.node.dataset.key,e=this.getIndex(this.list,t),n=this.list[e];this.store={item:n,key:t,origin:{index:e,list:this.list},from:{index:e,list:this.list},to:{index:e,list:this.list}},this.sortable.option("store",this.store),this.dispatchEvent("onDrag",{item:n,key:t,index:e})},onRemove:function(t){var t=t.node.dataset.key,e=this.getIndex(this.list,t),n=this.list[e];this.list.splice(e,1),Object.assign(this.store,{key:t,item:n}),this.sortable.option("store",this.store),this.dispatchEvent("onRemove",{item:n,key:t,index:e})},onAdd:function(t){var e=t.from,n=t.target,t=t.relative,e=P.get(e).option("store"),i=e.key,e=e.item,n=this.getIndex(this.list,n.dataset.key);0===t?n=this.list.length:-1===t&&(n+=1),this.list.splice(n,0,e),Object.assign(this.store,{to:{index:n,list:this.list}}),this.sortable.option("store",this.store),this.dispatchEvent("onAdd",{item:e,key:i,index:n})},onChange:function(t){var e,n,i,o,r=P.get(t.from).option("store");t.revertDrag?(this.list=R(this.options.list),Object.assign(this.store,{from:r.origin})):(n=t.node,o=t.target,e=t.relative,t=t.backToOrigin,n=this.getIndex(this.list,n.dataset.key),i=this.list[n],o=this.getIndex(this.list,o.dataset.key),t&&(1===e&&r.from.index<o&&--o,-1===e)&&r.from.index>o&&(o+=1),this.list.splice(n,1),this.list.splice(o,0,i),Object.assign(this.store,{from:{index:o,list:this.list},to:{index:o,list:this.list}}))},onDrop:function(t){var e=this.getStore(t),n=e.from,e=e.to,i=t.from!==t.to||n.origin.index!==e.to.index;this.dispatchEvent("onDrop",{changed:i,list:this.list,item:n.item,key:n.key,from:n.origin,to:e.to}),t.from===this.el&&this.reRendered&&null!=(i=P.dragged)&&i.remove(),t.from!==t.to&&"clone"===t.pullMode&&null!=(n=P.clone)&&n.remove(),this.reRendered=!1},getIndex:function(t,e){for(var n=0;n<t.length;n++)if(vt(t[n],this.options.dataKey)==e)return n;return-1},getStore:function(t){return{from:P.get(t.from).option("store"),to:P.get(t.to).option("store")}},dispatchEvent:function(t,e){t=this.options[t];t&&t(e)}};var bt=["size","keeps","scroller","direction","debounceTime","throttleTime"],wt="INIT",xt="FIXED",Ot="DYNAMIC",Tt="FRONT",Et="BEHIND",_t="STATIONARY",e="horizontal",zt="vertical",Dt=(i(n={},zt,"scrollTop"),i(n,e,"scrollLeft"),n),It=(i(n={},zt,"offsetTop"),i(n,e,"offsetLeft"),n),Ct=(i(n={},zt,"scrollHeight"),i(n,e,"scrollWidth"),n),kt=(i(n={},zt,"offsetHeight"),i(n,e,"offsetWidth"),n);function Mt(t){this.options=t;var e,n={size:0,keeps:0,buffer:0,wrapper:null,scroller:null,direction:"vertical",uniqueKeys:[],debounceTime:null,throttleTime:null};for(e in n)e in this.options||(this.options[e]=n[e]);this.sizes=new Map,this.range={start:0,end:0,front:0,behind:0},this.offset=0,this.calcType=wt,this.calcSize={average:0,total:0,fixed:0,header:0},this.scrollEl=this.getScrollElement(t.scroller),this.direction="",this.useWindowScroll=null,this.onScroll=null,this.updateOnScrollFunction(),this.addScrollEventListener(),this.checkIfUpdate(0,t.keeps-1)}Mt.prototype={constructor:Mt,isFront:function(){return this.direction===Tt},isBehind:function(){return this.direction===Et},isFixed:function(){return this.calcType===xt},getSize:function(t){return this.sizes.get(t)||this.getItemSize()},getOffset:function(){return this.scrollEl[Dt[this.options.direction]]},getScrollSize:function(){return this.scrollEl[Ct[this.options.direction]]},getClientSize:function(){return this.scrollEl[kt[this.options.direction]]},scrollToOffset:function(t){this.scrollEl[Dt[this.options.direction]]=t},scrollToIndex:function(t){t>=this.options.uniqueKeys.length-1?this.scrollToBottom():(t=this.getOffsetByIndex(t),this.scrollToOffset(t))},scrollToBottom:function(){var n=this,t=this.getScrollSize();this.scrollToOffset(t),setTimeout(function(){var t=n.getClientSize(),e=n.getScrollSize();n.getOffset()+t+1<e&&n.scrollToBottom()},5)},option:function(t,n){var i=this,e=this.options[t];this.options[t]=n,"uniqueKeys"===t&&this.sizes.forEach(function(t,e){n.includes(e)||i.sizes.delete(e)}),"scroller"===t&&(e&&P.utils.off(e,"scroll",this.onScroll),this.scrollEl=this.getScrollElement(n),this.addScrollEventListener())},updateRange:function(t){t?this.handleUpdate(t.start,t.end):(t=this.range.start,t=Math.max(t,0),this.handleUpdate(t,this.getEndByStart(t)))},onItemResized:function(t,e){this.sizes.set(t,e),this.calcType===wt?(this.calcType=xt,this.calcSize.fixed=e):this.isFixed()&&this.calcSize.fixed!==e&&(this.calcType=Ot,this.calcSize.fixed=void 0),this.calcType!==xt&&(this.calcSize.total=R(this.sizes.values()).reduce(function(t,e){return t+e},0),this.calcSize.average=Math.round(this.calcSize.total/this.sizes.size))},onSlotResized:function(t,e){this.calcSize[t]=e},addScrollEventListener:function(){this.options.scroller&&P.utils.on(this.options.scroller,"scroll",this.onScroll)},removeScrollEventListener:function(){this.options.scroller&&P.utils.off(this.options.scroller,"scroll",this.onScroll)},updateOnScrollFunction:function(){var t,e=this,n=this.options,i=n.debounceTime,n=n.throttleTime;function o(){t.cancel(),t.apply(this,arguments)}this.onScroll=i?(t=gt(function(){return e.handleScroll()},i),o.cancel=function(){t.cancel()},o):n?gt(function(){return e.handleScroll()},n):function(){return e.handleScroll()}},handleScroll:function(){var t=this.getOffset(),e=this.getClientSize(),n=this.getScrollSize(),i=(t===this.offset?this.direction=_t:this.direction=t<this.offset?Tt:Et,this.offset=t,this.isFront()&&t<=0),n=this.isBehind()&&n<=e+t;this.options.onScroll({top:i,bottom:n,offset:t,direction:this.direction}),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.getScrollStartOffset();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.options.onUpdate(B({},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 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},getScrollElement:function(t){return t instanceof Document&&9===t.nodeType||t instanceof Window?(this.useWindowScroll=!0,document.scrollingElement||document.documentElement||document.body):(this.useWindowScroll=!1,t)},getScrollStartOffset:function(){var t=this.calcSize.header;if(this.useWindowScroll&&this.options.wrapper)for(var e=this.options.wrapper;t+=e[It[this.options.direction]],(e=e.offsetParent)&&e!==this.options.wrapper.ownerDocument;);return t}};return A.defineComponent({props:t,emits:["update:dataSource","top","bottom","drag","drop","add","remove"],setup:function(c,t){var i,u,n=this,o=t.emit,r=t.slots,t=t.expose,h=A.ref({start:0,end:c.keeps,front:0,behind:0}),d=A.ref(null),f=A.ref(null),s=A.ref([]),e=A.ref([]),p=A.computed(function(){return"vertical"!==c.direction}),l=A.computed(function(){return"vertical"!==c.direction?"offsetWidth":"offsetHeight"}),a=A.computed(function(){return bt.reduce(function(t,e){return t[e]=c[e],t},{})}),m=A.computed(function(){return yt.reduce(function(t,e){return t[e]=n[e],t},{})}),g=null,v=0;function y(){return u.getOffset()}function S(){return u.getClientSize()}function b(){return u.getScrollSize()}function w(t){u.scrollToOffset(t)}function x(t){u.scrollToIndex(t)}t({getSize:function(t){return u.getSize(t)},getOffset:y,getClientSize:S,getScrollSize:b,scrollToTop:function(){w(0)},scrollToBottom:function(){u.scrollToBottom()},scrollToKey:function(t){-1<(t=e.value.indexOf(t))&&u.scrollToIndex(t)},scrollToIndex:x,scrollToOffset:w}),A.watch(function(){return c.dataSource},function(){E()},{deep:!0}),A.watch(function(){return a},function(t,e){if(u)for(var n in t)t[n]!=e[n]&&u.option(n,t[n])}),A.watch(function(){return m},function(t,e){if(u)for(var n in t)t[n]!=e[n]&&i.option(n,t[n])}),A.onBeforeMount(function(){z(),E()}),A.onActivated(function(){u&&w(u.offset),u.addScrollEventListener()}),A.onDeactivated(function(){u.removeScrollEventListener()}),A.onMounted(function(){u.option("wrapper",f.value),c.scroller||u.option("scroller",d.value)}),A.onUnmounted(function(){i&&i.destroy(),u.removeScrollEventListener()});function O(t,e){var n=r[t];return n?A.h(mt,{key:t,tag:e,style:c["".concat(t,"Style")],dataKey:t,event:"resize",sizeKey:l.value,onResize:B},{default:function(){return null==n?void 0:n()}}):null}function T(){for(var o=[],t=h.value,e=t.start,n=t.end,i=e;i<=n;i++)!function(e){var n,t,i=s.value[e];i&&(n=vt(i,c.dataKey),t=Object.assign(Object.assign({},c.itemStyle),j(n)),o.push(r.item?A.h(pt,{key:n,tag:c.itemTag,class:c.itemClass,style:t,event:"resize",dataKey:n,sizeKey:l.value,onResize:N},{default:function(){var t;return null==(t=r.item)?void 0:t.call(r,{record:i,index:e,dataKey:n})}}):null))}(i);return o}var E=function(){e=c.dataSource;var t,e=A.isRef(e)?e.value:e;e&&(t=R(s.value),s.value=e,_(),I(t,e),i?i.option("list",e):A.nextTick(function(){return D()}),g)&&c.keepOffset&&(0<(t=e.length-g)&&x(t),g=null)},_=function(){e.value=s.value.map(function(t){return vt(t,c.dataKey)}),u.option("uniqueKeys",e.value)},z=function(){u=new Mt({size:c.size,keeps:c.keeps,buffer:Math.round(c.keeps/3),scroller:c.scroller,direction:c.direction,uniqueKeys:e.value,debounceTime:c.debounceTime,throttleTime:c.throttleTime,onScroll:function(t){g=null,s.value.length&&t.top?k():t.bottom&&M()},onUpdate:function(t){P.dragged&&i&&t.start!==h.value.start&&(i.reRendered=!0),h.value=t}})},D=function(){i=new St(f.value,Object.assign(Object.assign({list:s.value},c),{onDrag:function(t){v=h.value.start,o("drag",t)},onAdd:function(t){o("add",t)},onRemove:function(t){o("remove",t)},onDrop:function(t){var e;t.list.length===s.value.length&&v<h.value.start&&(h.value.front+=(null==(e=P.clone)?void 0:e[l.value])||0,v=h.value.start),o("update:dataSource",t.list),o("drop",t)}}))},I=function(t,e){var n=Object.assign({},h.value);e.length>t.length&&n.end===t.length-1&&C()&&(n.end++,n.start=Math.max(0,n.end-c.keeps)),u.updateRange(n)},C=function(){var t=y(),e=S();return b()<=t+e+1},k=gt(function(){o("top"),g=s.value.length},50),M=gt(function(){o("bottom")},50),N=function(t,e){var n=u.sizes.size;u.onItemResized(e,t),0===n&&I(s.value,s.value)},B=function(t,e){u.onSlotResized(e,t)},j=function(t){return t==(null==(t=P.dragged)?void 0:t.dataset.key)?{display:"none"}:{}};return function(){var t=u.useWindowScroll,e=c.rootTag,n=c.wrapTag,i=c.wrapClass,o=c.headerTag,r=c.footerTag,s=h.value,l=s.front,s=s.behind,a=Object.assign(Object.assign({},c.wrapStyle),{padding:p.value?"0px ".concat(s,"px 0px ").concat(l,"px"):"".concat(l,"px 0px ").concat(s,"px")});return A.h(e,{ref:d,style:!t&&{overflow:p.value?"auto hidden":"hidden auto"}},{default:function(){return[O("header",o),A.h(n,{ref:f,class:i,style:a},{default:T}),O("footer",r)]}})}}})});
{
"name": "vue-virtual-draglist",
"version": "3.2.0",
"version": "3.2.1",
"description": "A virtual scrolling list component that can be sorted by dragging, support vue3",

@@ -5,0 +5,0 @@ "main": "dist/virtual-drag-list.min.js",

@@ -44,9 +44,10 @@ # vue-virtual-draglist

// const items = ref([{id: '1', text: 'abc'}, {id: '2', text: 'def'}]);
const list = ref([{id: '1', text: 'abc'}, {id: '2', text: 'def'}]);
const items = computed({
get() {
return [];
return list.value;
},
set(val) {
// trigger when drag state changed if you use with `v-model:dataSource`
list.value = val;
console.log(val);

@@ -87,6 +88,8 @@ }

| `handle` | `Function/String` | `-` | Drag handle selector within list items |
| `group` | `Object/String` | `-` | string: 'name' or object: `{ name: 'group', put: true/false, pull: true/false }` |
| `group` | `Object/String` | `-` | string: 'name' or object: `{ name: 'group', put: true/false, pull: true/false/'clone', revertDrag: true/false }` |
| `keepOffset` | `Boolean` | `false` | When scrolling up to load data, keep the same offset as the previous scroll |
| `direction` | `String` | `vertical` | `vertical/horizontal`, scroll direction |
| `pageMode` | `Boolean` | `false` | Let virtual list using global document to scroll through the list |
| `scroller` | `HTMLElement` | `false` | Virtual list scrolling element |
| `debounceTime`| `Number` | `0` | scroll debounce time |
| `throttleTime`| `Number` | `0` | scroll throttle time |

@@ -98,10 +101,9 @@

| -------- | -------- | ----------- | --------------- |
| `draggable` | `Function/String` | `-` | Specifies which items inside the element should be draggable. If does not set a value, the default list element can be dragged |
| `draggable` | `String` | `-` | Specifies which items inside the element should be draggable. If does not set a value, the default list element can be dragged |
| `disabled` | `Boolean` | `false` | Disables the sortable if set to true |
| `delay` | `Number` | `0` | Delay time of debounce function |
| `animation` | `Number` | `150` | Animation speed moving items when sorting |
| `autoScroll` | `Boolean` | `true` | Automatic scrolling when moving to the edge of the container |
| `scrollThreshold` | `Number` | `55` | Threshold to trigger autoscroll |
| `pressDelay` | `Number` | `0` | Time in milliseconds to define when the sorting should start |
| `pressDelayOnTouchOnly` | `Boolean` | `false` | Only delay on press if user is using touch |
| `delay` | `Number` | `0` | Time in milliseconds to define when the sorting should start |
| `delayOnTouchOnly` | `Boolean` | `false` | Only delay on press if user is using touch |
| `fallbackOnBody` | `Boolean` | `false` | Appends the ghost element into the document's body |

@@ -112,3 +114,5 @@ | `rootTag` | `String` | `div` | Label type for root element |

| `headerTag` | `String` | `div` | Label type for header slot element |
| `headerStyle`| `Object` | `{}` | header slot style |
| `footerTag` | `String` | `div` | Label type for footer slot element |
| `footerStyle`| `Object` | `{}` | footer slot style |
| `wrapClass` | `String` | `''` | List wrapper element class |

@@ -132,3 +136,4 @@ | `wrapStyle` | `Object` | `{}` | List wrapper element style |

| `scrollToBottom()` | Scroll to bottom of list |
| `scrollToKey(key)` | Scroll to the specified data-key position |
| `scrollToIndex(index)` | Scroll to the specified index position |
| `scrollToOffset(offset)` | Scroll to the specified offset |

@@ -0,0 +0,0 @@ import * as vue from 'vue';

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