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.3.0 to 3.3.1

6

dist/virtual-drag-list.min.js
/*!
* vue-virtual-draglist v3.3.0
* vue-virtual-draglist v3.3.1
* open source under the MIT license
* https://github.com/mfuu/vue3-virtual-drag-list#readme
*/
!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(t){"use strict";function e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function n(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?e(Object(i),!0).forEach((function(e){o(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function o(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,i,r,l,s=[],a=!0,c=!1;try{if(r=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;a=!1}else for(;!(a=(o=r.call(n)).done)&&(s.push(o.value),s.length!==e);a=!0);}catch(t){c=!0,i=t}finally{try{if(!a&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(c)throw i}}return s}}(t,e)||l(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||l(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 l(t,e){if(t){if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(t,e):void 0}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var a={exports:{}};
!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).VirtualList=e(t.Vue)}(this,(function(t){"use strict";function e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function n(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?e(Object(i),!0).forEach((function(e){o(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function o(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,i,r,l,s=[],a=!0,c=!1;try{if(r=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;a=!1}else for(;!(a=(o=r.call(n)).done)&&(s.push(o.value),s.length!==e);a=!0);}catch(t){c=!0,i=t}finally{try{if(!a&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(c)throw i}}return s}}(t,e)||l(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||l(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 l(t,e){if(t){if("string"==typeof t)return s(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(t,e):void 0}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var a={exports:{}};
/*!

@@ -12,2 +12,2 @@ * sortable-dnd v0.6.15

*/
!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),l=i(/Edge/i),s=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 d(){return document.scrollingElement||document.documentElement}function h(t,e,n){if(t.getBoundingClientRect||t===window){var o,i,r,l,s,a,c;if(t!==window&&t.parentNode&&t!==d()?(i=(o=t.getBoundingClientRect()).top,r=o.left,l=o.bottom,s=o.right,a=o.height,c=o.width):(i=0,r=0,l=window.innerHeight,s=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")),l=i+o.height,s=r+o.width;break}}while(n=n.parentNode)}return{top:i,left:r,bottom:l,right:s,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,l=i.length;r<l;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,l=t.children;i<l.length;){if(l[i]!==ot.ghost&&"none"!==w(l[i],"display")&&f(l[i],n,t,!1)&&(o||l[i]!==ot.dragged)){if(r===e)return l[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),s=v(t,1,e),a=i&&w(i),c=s&&w(s),u=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+h(i).width,d=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+h(s).width,f=l||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!s||"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]||s&&"none"===n[f]&&u+d>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=h(t);if(n){var o=e.clientX,i=e.clientY,r=n.top,l=n.right,s=n.bottom,a=n.left,c=n.height,u=n.width;if(!(i<r||o>l||i>s||o<a)){var d=this.options,f=d.scrollThreshold,p=d.scrollSpeed,m=t.scrollTop,g=t.scrollLeft,v=t.scrollHeight,y=m>0&&i>=r&&i<=r+f,b=g+u<t.scrollWidth&&o<=l&&o>=l-f,S=m+c<v&&i<=s&&i>=s-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-l)/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-s)/f+1)*p.y))}}}}},z.prototype={collect:function(t){if(t){for(var e=h(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),l=Array.prototype.slice.call(t.children),s=[],a=0,c=l.length;a<=c;a++){var u=l[a];if(u&&u!==ot.ghost&&"none"!==w(u,"display")){var d=h(u);if(!(d.bottom<0||d.right<0)){if(d.top-d.height>r||d.left-d.width>i)break;s.push({el:u,rect:d})}}}this.stack.push(s)}},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=h(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,l=r.animation,s=r.easing;w(t,"transition","transform "+l+"ms"+(s?" "+s:"")),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}),l)}}},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,H,K,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(!s||!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,d=a.selectHandle;if("function"==typeof d&&d(t)||"string"==typeof d&&S(o,d))Z=!0;else if(("function"!=typeof u||u(t))&&("string"!=typeof u||S(o,u))){var h=this.options,p=h.delay,m=h.delayOnTouchOnly;!p||m&&!n||l||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),s&&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),s&&w(document.body,"user-select","")},_onStart:function(t,e){var n=g(N);k=this.el,M=this.el,F=N,K=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,H=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=h(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 l=(X.clientX-o.left)/parseInt(j.style.width)*100,s=(X.clientY-o.top)/parseInt(j.style.height)*100;w(j,"transform-origin",l+"% "+s+"%"),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),l=o-X.clientX,s=i-X.clientY;q={origin:t,clientX:o,clientY:i},w(j,"transform","translate3d("+l+"px, "+s+"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=h(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 d();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 d();if(o||e)return n;o=!0}}}while(n=n.parentNode);return d()}(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=h(B),e="vertical"===this._getDirection(),n=e?"top":"left",o=e?"bottom":"right",i=B[e?"offsetHeight":"offsetWidth"],r=e?q.clientY:q.clientX,l=r>=t[n]&&r<t[o]-i/2?-1:1,s=v(L,0,this.options.draggable),a=m(L),c=h(s),u=h(a);if(B===L||p(L,B))return R===s&&r<c[n]?(P=B,!0):R===a&&r>u[o]&&(P=B.nextSibling,!0);var d=x(R,B);return P=d<0?B.nextSibling:B,U!==B?(J=l,!0):J!==l&&(J=l,l<0?d>0:d<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"===H&&this.el!==A&&M===A,o="clone"===H&&this.el===A&&M!==A,i=p(B,document),r=B===N&&!i;k=this.el,K=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=K,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&&(K=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){K=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,K=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,H);var o=this.options.swapOnDrop;"clone"===H&&M!==k||!("function"==typeof o?o(n):o)||L.insertBefore(N,R),"clone"!==H||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"===H?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=K,o.newIndex=W,o.pullMode=H,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=H=K=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:h,toggleClass:b,detectDirection:y},ot.get=function(t){return t[I]},ot.create=function(t,e){return new ot(t,e)},ot}()}(a);var c=a.exports,u=["delay","group","handle","lockAxis","disabled","sortable","draggable","animation","autoScroll","ghostClass","ghostStyle","chosenClass","fallbackOnBody","scrollThreshold","delayOnTouchOnly"];function d(t,e){this.el=t,this.options=e,this.reRendered=!1,this.installSortable()}function h(t,e){var n=null,o=function(){for(var o=this,i=arguments.length,r=new Array(i),l=0;l<i;l++)r[l]=arguments[l];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)}d.prototype={constructor:d,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 c(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=c.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=c.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=c.get(t.from).option("store"),i=o.item,l=o.key,s=o.index,a=this.options.list,u={key:l,item:i,list:a,event:t,changed:!1,oldList:r(a),oldIndex:s,newIndex:s};(t.from===t.to&&t.node===t.target||this.getDropParams(u,t,i,l,s,a),this.dispatchEvent("onDrop",u),t.from===this.el&&this.reRendered)&&(null===(e=c.dragged)||void 0===e||e.remove());t.from!==t.to&&"clone"===t.pullMode&&(null===(n=c.clone)||void 0===n||n.remove());this.reRendered=!1},getDropParams:function(t,e,n,o,i,r){var l=e.target.getAttribute("data-key"),s=-1,a=i;e.from===e.to?(((a=this.getIndex(o))<(s=this.getIndex(l))&&-1===e.relative||a>s&&1===e.relative)&&(s+=e.relative),s!==a&&(r.splice(a,1),r.splice(s,0,n))):(e.from===this.el&&(a=this.getIndex(o),r.splice(a,1)),e.to===this.el&&(a=-1,s=this.getIndex(l),0===e.relative?s=r.length:1===e.relative&&(s+=e.relative),r.splice(s,0,n))),t.changed=e.from!==e.to||s!==a,t.list=r,t.oldIndex=a,t.newIndex=s},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&&c.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=r(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&&c.utils.on(this.options.scroller,"scroll",this.onScroll)},removeScrollEventListener:function(){this.options.scroller&&c.utils.off(this.options.scroller,"scroll",this.onScroll)},enableScroll:function(t){var e=this.options.scroller,n=t?c.utils.off:c.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=h((function(){return n.handleScroll()}),i),e=function(){t.cancel(),t.apply(this,arguments)},e.cancel=function(){t.cancel()},e):r?h((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?c.utils.getRect(n):c.utils.getRect(n,!0,o);t=this.offset+r[w[i]]}return t}};var D={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"},wrapClass:{type:String,default:""},wrapStyle:{type:Object,default:function(){return{}}},ghostClass:{type:String,default:""},ghostStyle:{type:Object,default:function(){return{}}},chosenClass:{type:String,default:""}},I={dataKey:{type:[String,Number]},sizeKey:{type:String,default:"offsetHeight"}},_=t.defineComponent({props:I,emits:["resize"],setup:function(e,n){var o=n.emit,r=n.slots,l=null,s=function(t){var n=t?t[e.sizeKey]:0;o("resize",n,e.dataKey)},a=function(e){var n=e.mounted,o=e.updated,i=e.unmounted;return t.defineComponent({props:["vnode"],mounted:function(){n(this.$el)},onUpdated:function(){o(this.$el)},onUnmounted:function(){i(this.$el)},render:function(t){return t.vnode}})}({mounted:function(t){"undefined"!=typeof ResizeObserver&&(l=new ResizeObserver((function(){s(t)})),t&&l.observe(t))},updated:function(t){s(t)},unmounted:function(){l&&(l.disconnect(),l=null)}});return function(){var n,o=e.dataKey,l=i((null===(n=r.default)||void 0===n?void 0:n.call(r))||[],1)[0];return t.h(a,{key:o,vnode:l,"data-key":o,class:"virtual-dnd-list-item"},{default:function(){var t;return null===(t=r.default)||void 0===t?void 0:t.call(r)}})}}});return t.defineComponent({props:D,emits:["update:dataSource","update:modelValue","top","bottom","drag","drop","add","remove","rangeChange"],setup:function(e,n){var o,i,l=n.emit,s=n.slots,a=n.expose,c=t.ref({start:0,end:e.keeps-1,front:0,behind:0}),m=t.ref(null),g=t.ref(null),v=t.ref([]),y=t.ref(),b=t.ref([]),S=t.computed((function(){return"vertical"!==e.direction})),w=t.computed((function(){return p.reduce((function(t,n){return t[n]=e[n],t}),{})})),x=t.computed((function(){return u.reduce((function(t,n){return t[n]=e[n],t}),{})})),E=[],T=0;function D(){return o.getOffset()}function I(){return o.getClientSize()}function z(){return o.getScrollSize()}function C(t){o.scrollToOffset(t)}function k(t){o.scrollToIndex(t)}a({getSize:function(t){return o.getSize(t)},getOffset:D,getClientSize:I,getScrollSize:z,scrollToTop:function(){C(0)},scrollToBottom:function(){o.scrollToBottom()},scrollToKey:function(t){var e=E.indexOf(t);e>-1&&o.scrollToIndex(e)},scrollToIndex:k,scrollToOffset:C}),t.watch((function(){return[e.dataSource,e.modelValue]}),(function(){M()}),{deep:!0}),t.watch(w,(function(t,e){if(o)for(var n in t)t[n]!=e[n]&&o.option(n,t[n])})),t.watch(x,(function(t,e){if(i)for(var n in t)t[n]!=e[n]&&i.option(n,t[n])})),t.onBeforeMount((function(){M()})),t.onActivated((function(){o&&C(o.offset),o.addScrollEventListener()})),t.onDeactivated((function(){o.removeScrollEventListener()})),t.onMounted((function(){N(),B()})),t.onUnmounted((function(){null==i||i.destroy(),null==o||o.removeScrollEventListener()}));var M=function(){var n,o=(n=e.modelValue||e.dataSource,t.isRef(n)?n.value:n);if(o){if(v.value=o,A(),P(b.value,o),null==i||i.option("list",o),T&&e.keepOffset){var l=o.length-T;l>0&&k(l),T=0}b.value=r(v.value)}},A=function(){E=v.value.map((function(t){return f(t,e.dataKey)})),null==o||o.option("uniqueKeys",E),null==i||i.option("uniqueKeys",E)},N=function(){o=new O({size:e.size,keeps:e.keeps,buffer:Math.round(e.keeps/3),wrapper:g.value,scroller:e.scroller||m.value,direction:e.direction,uniqueKeys:E,debounceTime:e.debounceTime,throttleTime:e.throttleTime,onScroll:function(t){T=0,v.value.length&&t.top?j():t.bottom&&F()},onUpdate:function(t){var e=t.start!==c.value.start;y.value&&e&&i&&(i.reRendered=!0),c.value=t,e&&l("rangeChange",t)}})},B=function(){i=new d(m.value,Object.assign(Object.assign({},x.value),{list:v.value,uniqueKeys:E,onAdd:function(t){l("add",t)},onRemove:function(t){l("remove",t)},onDrag:function(t){y.value=t.key,e.sortable||(o.enableScroll(!1),i.option("autoScroll",!1)),l("drag",t)},onDrop:function(t){y.value="",o.enableScroll(!0),i.option("autoScroll",e.autoScroll),t.changed&&(l("update:dataSource",t.list),l("update:modelValue",t.list)),l("drop",t)}}))},P=function(t,n){var i=Object.assign({},c.value);n.length>t.length&&i.end===t.length-1&&R()&&(i.end++,i.start=Math.max(0,i.end-e.keeps)),null==o||o.updateRange(i)},R=function(){return D()+I()+1>=z()},j=h((function(){l("top"),T=v.value.length}),50),F=h((function(){l("bottom")}),50),L=function(t,n){var i=o.sizes.size,r=Math.min(e.keeps,v.value.length);o.onItemResized(n,t),i===r-1&&P(v.value,v.value)},H=function(t){return t==y.value?{display:"none"}:{}};return function(){var n=c.value,o=n.front,i=n.behind,r=e.rootTag,l=e.wrapTag,a=e.scroller,u=e.wrapClass,d=e.wrapStyle,h=S.value?"0px ".concat(i,"px 0px ").concat(o,"px"):"".concat(o,"px 0px ").concat(i,"px");return t.h(r,{ref:m,style:!a&&{overflow:S.value?"auto hidden":"hidden auto"}},{default:function(){var n,o;return[null===(n=s.header)||void 0===n?void 0:n.call(s),t.h(l,{ref:g,class:u,style:Object.assign(Object.assign({},d),{padding:h})},{default:function(){return function(){for(var n=[],o=c.value,i=o.start,r=o.end,l="vertical"===e.direction?"offsetHeight":"offsetWidth",a=function(o){var i=v.value[o];if(i){var r=f(i,e.dataKey);n.push(s.item?t.h(_,{key:r,class:"virtual-dnd-list-item",style:H(r),dataKey:r,sizeKey:l,onResize:L},{default:function(){var t;return null===(t=s.item)||void 0===t?void 0:t.call(s,{record:i,index:o,dataKey:r})}}):null)}},u=i;u<=r;u++)a(u);return n}()}}),null===(o=s.footer)||void 0===o?void 0:o.call(s)]}})}}})}));
!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),l=i(/Edge/i),s=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,l,s,a,c;if(t!==window&&t.parentNode&&t!==h()?(i=(o=t.getBoundingClientRect()).top,r=o.left,l=o.bottom,s=o.right,a=o.height,c=o.width):(i=0,r=0,l=window.innerHeight,s=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")),l=i+o.height,s=r+o.width;break}}while(n=n.parentNode)}return{top:i,left:r,bottom:l,right:s,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,l=i.length;r<l;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,l=t.children;i<l.length;){if(l[i]!==ot.ghost&&"none"!==w(l[i],"display")&&f(l[i],n,t,!1)&&(o||l[i]!==ot.dragged)){if(r===e)return l[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),s=v(t,1,e),a=i&&w(i),c=s&&w(s),u=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+d(i).width,h=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+d(s).width,f=l||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!s||"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]||s&&"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 O(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 D,T,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,l=n.right,s=n.bottom,a=n.left,c=n.height,u=n.width;if(!(i<r||o>l||i>s||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<=l&&o>=l-f,S=m+c<v&&i<=s&&i>=s-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-l)/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-s)/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),l=Array.prototype.slice.call(t.children),s=[],a=0,c=l.length;a<=c;a++){var u=l[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;s.push({el:u,rect:h})}}}this.stack.push(s)}},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,l=r.animation,s=r.easing;w(t,"transition","transform "+l+"ms"+(s?" "+s:"")),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}),l)}}},C.prototype={destroy:function(){D=T=null},active:function(){return!!D},setParams:function(t){t.nodes=D||[],t.clones=T||[]},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(!D)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(D)for(var e=0;e<D.length;e++)b(D[e],this.options.chosenClass,t)},toggleVisible:function(t){if(D)if(t){var e=D.indexOf(ot.dragged);this._viewElements(D,e,ot.dragged)}else this._hideElements(D)},onChoose:function(){!this.options.multiple||!this.selectedElements.length||this.selectedElements.indexOf(ot.dragged)<0||(this.selectedElements.sort((function(t,e){return x(t,e)})),D=this.selectedElements,this.toggleClass(!0))},onDrag:function(t){D&&(t.animator.collect(ot.dragged.parentNode),this._hideElements(D),t.animator.animate(),this.toggleClass(!1))},onDrop:function(t,e,n){if(D){var o=ot.dragged,i=ot.clone,r=D.indexOf(o);e[I].animator.collect(i.parentNode),t!==e&&"clone"===n?(w(i,"display","none"),T=D.map((function(t){return t.cloneNode(!0)})),this._viewElements(T,r,i),this._viewElements(D,r,o)):this._viewElements(D,r,i),e[I].animator.animate(),t!==e&&(e[I].multiplayer.toggleSelected(T||D,!0),"clone"!==n&&t[I].multiplayer.toggleSelected(D,!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),O({sortable:n,name:"onSelect",params:i})):(this.selectedElements.splice(o,1),O({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,B,N,P,j,R,F,L,H,K,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(!B&&!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(!s||!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},B=i,c($=n?B: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||l||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),s&&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),s&&w(document.body,"user-select","")},_onStart:function(t,e){var n=g(B);k=this.el,M=this.el,F=B,K=n,W=n,Y=n,V={to:this.el,target:B,newIndex:n,relative:0},G=B,A=this.el,j=B.cloneNode(!0),L=B.parentNode,H=this.options.group.pull,ot.clone=j,ot.active=this,ot.dragged=B,b(B,this.options.chosenClass,!0),this.multiplayer.onChoose(),O({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(j,this.options.chosenClass,!0),this._appendGhost(),this.multiplayer.onDrag(this),O({sortable:this,name:"onDrag",params:this._getParams(X.origin)}),w(B,"display","none"),b(B,this.options.chosenClass,!1),B.parentNode.insertBefore(j,B)},_getGhostElement:function(){var t=this.options.customGhost;if("function"==typeof t){var e=this.multiplayer.selectedElements;return t(e.length?e:[B])}return this.multiplayer.getGhostElement()||B},_appendGhost:function(){if(!R){var t=this.options.fallbackOnBody?document.body:this.el,n=this._getGhostElement();b(R=n.cloneNode(!0),this.options.ghostClass,!0);var o=d(B),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(R,r,i[r]);ot.ghost=R,t.appendChild(R);var l=(X.clientX-o.left)/parseInt(R.style.width)*100,s=(X.clientY-o.top)/parseInt(R.style.height)*100;w(R,"transform-origin",l+"% "+s+"%"),w(R,"will-change","transform")}},_nearestSortable:function(t){E(t);var e=t.touches&&t.touches[0]||t;if(B&&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),l=o-X.clientX,s=i-X.clientY;q={origin:t,clientX:o,clientY:i},w(R,"transform","translate3d("+l+"px, "+s+"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,B,this):n:y(L,e)},_allowSwap:function(){var t=d(N),e="vertical"===this._getDirection(),n=e?"top":"left",o=e?"bottom":"right",i=N[e?"offsetHeight":"offsetWidth"],r=e?q.clientY:q.clientX,l=r>=t[n]&&r<t[o]-i/2?-1:1,s=v(L,0,this.options.draggable),a=m(L),c=d(s),u=d(a);if(N===L||p(L,N))return j===s&&r<c[n]?(P=N,!0):j===a&&r>u[o]&&(P=N.nextSibling,!0);var h=x(j,N);return P=h<0?N.nextSibling:N,U!==N?(J=l,!0):J!==l&&(J=l,l<0?h>0:h<0)},_onMove:function(t,e){if(!this.options.disabled&&this._allowPut()){if(N=f(e,this.options.draggable,this.el),O({sortable:this,name:"onMove",params:this._getParams(t,{target:N})}),this.options.sortable||this.el!==A)return this.el===M||e!==this.el&&m(this.el)?void(N&&!N.animated&&!p(N,j)&&this._allowSwap()&&(N!==j&&P!==j?(this.el!==M?this._onInsert(t):N!==B&&this._onChange(t),U=N):U=N)):(N=U=null,void this._onInsert(t));M!==A&&(N=U=B,J=0,this._onInsert(t))}},_onInsert:function(t){var e=N||j,n="clone"===H&&this.el!==A&&M===A,o="clone"===H&&this.el===A&&M!==A,i=p(N,document),r=N===B&&!i;k=this.el,K=g(j),F=e,L=i?N.parentNode:this.el,M[I].animator.collect(j.parentNode),this.animator.collect(L),n&&(V.target=G,V.newIndex=K,V.relative=G===B?0:x(j,G),w(B,"display",""),A[I].multiplayer.toggleVisible(!0),A[I].options.group.revertDrag||j.parentNode.insertBefore(B,j)),o&&(K=g(B),w(B,"display","none"),this.multiplayer.toggleVisible(!1)),w(j,"display",r?"none":""),N&&i?L.insertBefore(j,J<0?N:N.nextSibling):L.appendChild(j),W=r?Y:g(j),n&&A[I].options.group.revertDrag&&(V.target=B,V.newIndex=Y,V.relative=0,O({sortable:A[I],name:"onChange",params:this._getParams(t,{to:A,target:B,newIndex:Y,revertDrag:!0})})),n||O({sortable:M[I],name:"onRemove",params:this._getParams(t,{newIndex:-1})}),o&&e!==B&&(G=e,O({sortable:this,name:"onChange",params:this._getParams(t,{from:A,backToOrigin:!0})})),o||O({sortable:this,name:"onAdd",params:this._getParams(t,{oldIndex:-1})}),M[I].animator.animate(),this.animator.animate(),M=this.el},_onChange:function(t){K=g(j),L=N.parentNode,F=N,this.el===A&&(G=N),this.animator.collect(L),L.insertBefore(j,P),W=g(j),O({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(B,this.options.chosenClass,!1),A&&(M=A,K=Y,F===j&&(F=B),this.multiplayer.toggleClass(!1),O({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,B,this),R&&R.parentNode&&R.parentNode.removeChild(R),this.autoScroller.destroy(),this.multiplayer.destroy(),this._nulling()},_onEnd:function(t){var n=this._getParams(t);this.multiplayer.onDrop(M,k,H);var o=this.options.swapOnDrop;"clone"===H&&M!==k||!("function"==typeof o?o(n):o)||L.insertBefore(B,j),"clone"!==H||M===k||this.multiplayer.active()?j&&j.parentNode&&j.parentNode.removeChild(j):b(j,this.options.chosenClass,!1),w(B,"display",""),M!==k&&O({sortable:M[I],name:"onDrop",params:e({},n,"clone"===H?V:{newIndex:-1})}),O({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=B,o.clone=j,o.target=F,o.oldIndex=K,o.newIndex=W,o.pullMode=H,this.multiplayer.setParams(o),e(o,n),o.relative=F===B?0:x(j,F),o},_nulling:function(){k=M=A=B=N=P=j=R=F=L=H=K=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}()}(a);var c=a.exports,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),l=0;l<i;l++)r[l]=arguments[l];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 c(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=c.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=c.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=c.get(t.from).option("store"),i=o.item,l=o.key,s=o.index,a=this.options.list,u={key:l,item:i,list:a,event:t,changed:!1,oldList:r(a),oldIndex:s,newIndex:s};(t.from===t.to&&t.node===t.target||this.getDropParams(u,t,i,l,s,a),this.dispatchEvent("onDrop",u),t.from===this.el&&this.reRendered)&&(null===(e=c.dragged)||void 0===e||e.remove());t.from!==t.to&&"clone"===t.pullMode&&(null===(n=c.clone)||void 0===n||n.remove());this.reRendered=!1},getDropParams:function(t,e,n,o,i,r){var l=e.target.getAttribute("data-key"),s=-1,a=i;e.from===e.to?(((a=this.getIndex(o))<(s=this.getIndex(l))&&-1===e.relative||a>s&&1===e.relative)&&(s+=e.relative),s!==a&&(r.splice(a,1),r.splice(s,0,n))):(e.from===this.el&&(a=this.getIndex(o),r.splice(a,1)),e.to===this.el&&(a=-1,s=this.getIndex(l),0===e.relative?s=r.length:1===e.relative&&(s+=e.relative),r.splice(s,0,n))),t.changed=e.from!==e.to||s!==a,t.list=r,t.oldIndex=a,t.newIndex=s},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"},O={vertical:"offsetHeight",horizontal:"offsetWidth"};function D(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)}D.prototype={constructor:D,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[O[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&&c.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=r(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&&c.utils.on(this.options.scroller,"scroll",this.onScroll)},removeScrollEventListener:function(){this.options.scroller&&c.utils.off(this.options.scroller,"scroll",this.onScroll)},enableScroll:function(t){var e=this.options.scroller,n=t?c.utils.off:c.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?c.utils.getRect(n):c.utils.getRect(n,!0,o);t=this.offset+r[w[i]]}return t}};var T={dataSource:{},modelValue:{},dataKey:{type:String,default:"",required:!0},tableMode:{type:Boolean,default:!1},draggable:{type:String,default:".virtual-dnd-list-item"},itemClass:{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"},wrapClass:{type:String,default:""},wrapStyle:{type:Object,default:function(){return{}}},ghostClass:{type:String,default:""},ghostStyle:{type:Object,default:function(){return{}}},chosenClass:{type:String,default:""}},I={dataKey:{type:[String,Number]},sizeKey:{type:String,default:"offsetHeight"},itemClass:{type:String}},_=t.defineComponent({props:I,emits:["resize"],setup:function(e,n){var o=n.emit,r=n.slots,l=null,s=function(t){var n=t?t[e.sizeKey]:0;o("resize",n,e.dataKey)},a=function(e){var n=e.mounted,o=e.updated,i=e.unmounted;return t.defineComponent({props:["vnode"],mounted:function(){n(this.$el)},onUpdated:function(){o(this.$el)},onUnmounted:function(){i(this.$el)},render:function(t){return t.vnode}})}({mounted:function(t){"undefined"!=typeof ResizeObserver&&(l=new ResizeObserver((function(){s(t)})),t&&l.observe(t))},updated:function(t){s(t)},unmounted:function(){l&&(l.disconnect(),l=null)}});return function(){var n,o=e.dataKey,l=e.itemClass,s=i((null===(n=r.default)||void 0===n?void 0:n.call(r))||[],1)[0];return t.h(a,{key:o,class:l,vnode:s,"data-key":o},{default:function(){var t;return null===(t=r.default)||void 0===t?void 0:t.call(r)}})}}});return t.defineComponent({props:T,emits:["update:dataSource","update:modelValue","top","bottom","drag","drop","rangeChange"],setup:function(e,n){var o,i,l=n.emit,s=n.slots,a=n.expose,c=t.ref({start:0,end:e.keeps-1,front:0,behind:0}),m=t.ref(null),g=t.ref(null),v=t.ref([]),y=t.ref(),b=t.ref([]),S=t.computed((function(){return"vertical"!==e.direction})),w=t.computed((function(){return p.reduce((function(t,n){return t[n]=e[n],t}),{})})),x=t.computed((function(){return u.reduce((function(t,n){return t[n]=e[n],t}),{})})),E=[],O=0;function T(){return o.getOffset()}function I(){return o.getClientSize()}function z(){return o.getScrollSize()}function C(t){o.scrollToOffset(t)}function k(t){o.scrollToIndex(t)}a({getSize:function(t){return o.getSize(t)},getOffset:T,getClientSize:I,getScrollSize:z,scrollToTop:function(){C(0)},scrollToBottom:function(){o.scrollToBottom()},scrollToKey:function(t){var e=E.indexOf(t);e>-1&&o.scrollToIndex(e)},scrollToIndex:k,scrollToOffset:C}),t.watch((function(){return[e.dataSource,e.modelValue]}),(function(){M()}),{deep:!0}),t.watch(w,(function(t,e){if(o)for(var n in t)t[n]!=e[n]&&o.option(n,t[n])})),t.watch(x,(function(t,e){if(i)for(var n in t)t[n]!=e[n]&&i.option(n,t[n])})),t.onBeforeMount((function(){M()})),t.onActivated((function(){o&&C(o.offset),o.addScrollEventListener()})),t.onDeactivated((function(){o.removeScrollEventListener()})),t.onMounted((function(){B(),N()})),t.onUnmounted((function(){null==i||i.destroy(),null==o||o.removeScrollEventListener()}));var M=function(){var n,o=(n=e.modelValue||e.dataSource,t.isRef(n)?n.value:n);if(o){if(v.value=o,A(),P(b.value,o),null==i||i.option("list",o),O&&e.keepOffset){var l=o.length-O;l>0&&k(l),O=0}b.value=r(v.value)}},A=function(){E=v.value.map((function(t){return f(t,e.dataKey)})),null==o||o.option("uniqueKeys",E),null==i||i.option("uniqueKeys",E)},B=function(){o=new D(Object.assign(Object.assign({},w.value),{buffer:Math.round(e.keeps/3),wrapper:g.value,scroller:e.scroller||m.value,uniqueKeys:E,onScroll:function(t){O=0,v.value.length&&t.top?R():t.bottom&&F()},onUpdate:function(t){var e=t.start!==c.value.start;y.value&&e&&i&&(i.reRendered=!0),c.value=t,e&&l("rangeChange",t)}}))},N=function(){i=new h(m.value,Object.assign(Object.assign({},x.value),{list:v.value,uniqueKeys:E,onDrag:function(t){y.value=t.key,e.sortable||(o.enableScroll(!1),i.option("autoScroll",!1)),l("drag",t)},onDrop:function(t){y.value="",o.enableScroll(!0),i.option("autoScroll",e.autoScroll),t.changed&&(l("update:dataSource",t.list),l("update:modelValue",t.list)),l("drop",t)}}))},P=function(t,n){var i=Object.assign({},c.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 T()+I()+1>=z()},R=d((function(){l("top"),O=v.value.length}),50),F=d((function(){l("bottom")}),50),L=function(t,n){var i=o.sizes.size,r=Math.min(e.keeps,v.value.length);o.onItemResized(n,t),i===r-1&&P(v.value,v.value)},H=function(n){if(e.tableMode){var o={padding:0,margin:0,border:0,height:"".concat(n,"px")};return t.h("tr",{},[t.h("td",{style:o})])}return null};return function(){var n=c.value,o=n.front,i=n.behind,r=e.tableMode,l=e.rootTag,a=e.wrapTag,u=e.scroller,h=e.wrapClass,d=e.wrapStyle,p=S.value?"0 ".concat(i,"px 0 ").concat(o,"px"):"".concat(o,"px 0 ").concat(i,"px"),b=S.value?"auto hidden":"hidden auto",w=r?"table":l,x=r?"tbody":a;return t.h(w,{ref:m,style:!u&&!r&&{overflow:b}},{default:function(){var n,o;return[null===(n=s.header)||void 0===n?void 0:n.call(s),t.h(x,{ref:g,class:h,style:Object.assign(Object.assign({},d),{padding:!r&&p})},{default:function(){return function(){var n=[],o=c.value,i=o.start,r=o.end,l=o.front,a=o.behind,u=S.value?"offsetWidth":"offsetHeight";n.push(H(l));for(var h=function(o){var i=v.value[o];if(i){var r=f(i,e.dataKey);n.push(s.item?t.h(_,{key:r,class:e.itemClass,style:r==y.value&&{display:"none"},dataKey:r,sizeKey:u,onResize:L},{default:function(){var t;return null===(t=s.item)||void 0===t?void 0:t.call(s,{record:i,index:o,dataKey:r})}}):null)}},d=i;d<=r;d++)h(d);return n.push(H(a)),n}()}}),null===(o=s.footer)||void 0===o?void 0:o.call(s)]}})}}})}));
{
"name": "vue-virtual-draglist",
"version": "3.3.0",
"version": "3.3.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",

@@ -66,11 +66,9 @@ # vue-virtual-draglist

| **Emit** | **Description** |
| ------------- | --------------------------------------------- |
| `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 |
| `rangeChange` | triggered when the range changes |
| **Emit** | **Description** |
| ------------- | ------------------ |
| `top` | scrolled to top |
| `bottom` | scrolled to bottom |
| `drag` | drag is started |
| `drop` | drag is completed |
| `rangeChange` | range changed |

@@ -96,6 +94,7 @@ ## Props

| `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` | `vertical \| horizontal` | `vertical` | Scroll direction |
| `scroller` | `Document \| HTMLElement` | `-` | Virtual list scrolling element |
| `lockAxis` | `x \| y` | `-` | Axis on which dragging will be locked |
| `tableMode` | `Boolean` | `false` | display with table and tbody |
| `keepOffset` | `Boolean` | `false` | When scrolling up to load data, keep the same offset as the previous scroll |
| `debounceTime` | `Number` | `0` | scroll debounce time |

@@ -110,2 +109,3 @@ | `throttleTime` | `Number` | `0` | scroll throttle time |

| `draggable` | `String` | `.virtual-dnd-list-item` | Specifies which items inside the element should be draggable. |
| `itemClass` | `String` | `virtual-dnd-list-item` | Default list item class |
| `disabled` | `Boolean` | `false` | Disables the sortable if set to true |

@@ -112,0 +112,0 @@ | `animation` | `Number` | `150` | Animation speed moving items when sorting |

import * as vue from 'vue';
declare const VirtualDragList: vue.DefineComponent<{
declare const VirtualList: vue.DefineComponent<{
dataSource: {};

@@ -11,2 +11,6 @@ modelValue: {};

};
tableMode: {
type: BooleanConstructor;
default: boolean;
};
draggable: {

@@ -16,2 +20,6 @@ type: StringConstructor;

};
itemClass: {
type: StringConstructor;
default: string;
};
sortable: {

@@ -121,3 +129,3 @@ type: BooleanConstructor;

[key: string]: any;
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("update:dataSource" | "update:modelValue" | "top" | "bottom" | "drag" | "drop" | "add" | "remove" | "rangeChange")[], "update:dataSource" | "update:modelValue" | "top" | "bottom" | "drag" | "drop" | "add" | "remove" | "rangeChange", vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
}>, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("update:dataSource" | "update:modelValue" | "top" | "bottom" | "drag" | "drop" | "rangeChange")[], "update:dataSource" | "update:modelValue" | "top" | "bottom" | "drag" | "drop" | "rangeChange", vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
dataSource: {};

@@ -130,2 +138,6 @@ modelValue: {};

};
tableMode: {
type: BooleanConstructor;
default: boolean;
};
draggable: {

@@ -135,2 +147,6 @@ type: StringConstructor;

};
itemClass: {
type: StringConstructor;
default: string;
};
sortable: {

@@ -245,8 +261,8 @@ type: BooleanConstructor;

onDrop?: ((...args: any[]) => any) | undefined;
onAdd?: ((...args: any[]) => any) | undefined;
onRemove?: ((...args: any[]) => any) | undefined;
onRangeChange?: ((...args: any[]) => any) | undefined;
}, {
dataKey: string;
tableMode: boolean;
draggable: string;
itemClass: string;
sortable: boolean;

@@ -275,2 +291,2 @@ lockAxis: "x" | "y";

export { VirtualDragList as default };
export { VirtualList as default };

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