vue-virtual-draglist
Advanced tools
Comparing version 2.9.1 to 2.9.2
/*! | ||
* vue-virtual-drag-list v2.9.1 | ||
* vue-virtual-drag-list v2.9.2 | ||
* open source under the MIT license | ||
* https://github.com/mfuu/vue-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).VirtualList=e(t.Vue)}(this,(function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t);function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function o(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function r(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 i=n.call(t,e||"default");if("object"!=typeof i)return i;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 s(t){return function(t){if(Array.isArray(t))return l(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(t,e)}(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){(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 a={dataSource:{type:Array,default:function(){return[]}},dataKey:{type:String,required:!0},scroller:{type:[Document,HTMLElement]},direction:{type:String,default:"vertical"},keeps:{type:Number,default:30},size:{type:Number},keepOffset:{type:Boolean,default:!1},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:[String,Object]},lockAxis:{type:String,default:""},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},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:""}},c={dataKey:{type:[String,Number]},sizeKey:{type:String}},u=Vue.component("virtual-list-item",{props:c,data:function(){return{sizeObserver:null}},mounted:function(){var t=this;"undefined"!=typeof ResizeObserver&&(this.sizeObserver=new ResizeObserver((function(){t.onSizeChange()})),this.$el&&this.sizeObserver.observe(this.$el))},updated:function(){this.onSizeChange()},beforeDestroy:function(){this.sizeObserver&&(this.sizeObserver.disconnect(),this.sizeObserver=null)},methods:{onSizeChange:function(){this.$emit("resized",this.dataKey,this.getCurrentSize())},getCurrentSize:function(){return this.$el?this.$el[this.sizeKey]:0}},render:function(){return this.$slots.default}});"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function h(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var d={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){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t);function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function o(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){o(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function l(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var n={}.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)?i(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.")}()}var a={dataSource:{type:Array,default:function(){return[]}},dataKey:{type:String,required:!0},scroller:{type:[Document,HTMLElement]},direction:{type:String,default:"vertical"},keeps:{type:Number,default:30},size:{type:Number},keepOffset:{type:Boolean,default:!1},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:[String,Object]},lockAxis:{type:String,default:""},debounceTime:{type:Number,default:0},throttleTime:{type:Number,default:0},animation:{type:Number,default:150},autoScroll:{type:Boolean,default:!0},scrollSpeed:{type:Object,default:function(){return{x:10,y:10}}},scrollThreshold:{type:Number,default:55},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:""}},c={dataKey:{type:[String,Number]},sizeKey:{type:String}},u=n.default.component("virtual-list-item",{props:c,data:function(){return{sizeObserver:null}},mounted:function(){var t=this;"undefined"!=typeof ResizeObserver&&(this.sizeObserver=new ResizeObserver((function(){t.onSizeChange()})),this.$el&&this.sizeObserver.observe(this.$el))},updated:function(){this.onSizeChange()},beforeDestroy:function(){this.sizeObserver&&(this.sizeObserver.disconnect(),this.sizeObserver=null)},methods:{onSizeChange:function(){this.$emit("resized",this.dataKey,this.getCurrentSize())},getCurrentSize:function(){return this.$el?this.$el[this.sizeKey]:0}},render:function(){return this.$slots.default}});"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function h(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var d={exports:{}}; | ||
/*! | ||
@@ -11,2 +11,2 @@ * sortable-dnd v0.6.15 | ||
* https://github.com/mfuu/sortable-dnd#readme | ||
*/!function(t,e){t.exports=function(){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},e.apply(this,arguments)}var n={capture:!1,passive:!1},i=/\s+/g;function o(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var r=o(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),s=o(/Edge/i),l=o(/safari/i)&&!o(/chrome/i)&&!o(/android/i),a=function(){var t=!1;return document.addEventListener("checkIfSupportPassive",null,{get passive(){return t=!0,!0}}),t}();function c(t,e,i){window.addEventListener?t.addEventListener(e,i,!(!a&&r)&&n):window.attachEvent?t.attachEvent("on"+e,i):t["on"+e]=i}function u(t,e,i){window.removeEventListener?t.removeEventListener(e,i,!(!a&&r)&&n):window.detachEvent?t.detachEvent("on"+e,i):t["on"+e]=null}function h(){return document.scrollingElement||document.documentElement}function d(t,e,n){if(t.getBoundingClientRect||t===window){var i,o,r,s,l,a,c;if(t!==window&&t.parentNode&&t!==h()?(o=(i=t.getBoundingClientRect()).top,r=i.left,s=i.bottom,l=i.right,a=i.height,c=i.width):(o=0,r=0,s=window.innerHeight,l=window.innerWidth,a=window.innerHeight,c=window.innerWidth),e&&t!==window){n=n||t.parentNode;do{if(n&&n.getBoundingClientRect){var u=n.getBoundingClientRect();o-=u.top+parseInt(w(n,"border-top-width")),r-=u.left+parseInt(w(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 f(t,e,n,i){if(t){if(n&&!e)for(var o=Array.prototype.slice.call(n.children),r=0,s=o.length;r<s;r++)if(o[r]===t||p(t,o[r]))return o[r];n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&S(t,e):S(t,e))||i&&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===it.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,i){for(var o=0,r=0,s=t.children;o<s.length;){if(s[o]!==it.ghost&&"none"!==w(s[o],"display")&&f(s[o],n,t,!1)&&(i||s[o]!==it.dragged)){if(r===e)return s[o];r++}o++}return null}function y(t,e){var n=w(t),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),o=v(t,0,e),l=v(t,1,e),a=o&&w(o),c=l&&w(l),u=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+d(o).width,h=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+d(l).width,f=s||r?"cssFloat":"float";if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&a.float&&"none"!==a.float){var p="left"===a.float?"left":"right";return!l||"both"!==c.clear&&c.clear!==p?"horizontal":"vertical"}return o&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||u>=i&&"none"===n[f]||l&&"none"===n[f]&&u+h>i)?"vertical":"horizontal"}function b(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(i," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(i," ")}}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 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];e in i||-1!==e.indexOf("webkit")||(e="-webkit-"+e),i[e]=n+("string"==typeof n?"":"px")}}function x(t,e){var n,i,o=(i=e,(n=t).compareDocumentPosition?n.compareDocumentPosition(i):n.contains?(n!=i&&n.contains(i)&&16)+(n!=i&&i.contains(n)&&8)+(n.sourceIndex>=0&&i.sourceIndex>=0?(n.sourceIndex<i.sourceIndex&&4)+(n.sourceIndex>i.sourceIndex&&2):1):0);return 2===o?1:4===o?-1:0}function _(t){void 0!==t.preventDefault&&t.cancelable&&t.preventDefault()}function T(t){var n=t.sortable,i=t.name,o=t.params,r=n.options[i];"function"==typeof r&&r(e({},o))}!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 E,O,D="Sortable"+Date.now();function I(t){this.options=t,this.autoScrollAnimationFrame=null}function z(t){this.options=t,this.stack=[]}function R(t){this.options=t||{},this.selectedElements=[]}window.requestAnimationFrame||(window.requestAnimationFrame=function(t){return setTimeout(t,17)}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),I.prototype={destroy:function(){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){if(t&&void 0!==e.clientX&&void 0!==e.clientY){var n=d(t);if(n){var i=e.clientX,o=e.clientY,r=n.top,s=n.right,l=n.bottom,a=n.left,c=n.height,u=n.width;if(!(o<r||i>s||o>l||i<a)){var h=this.options,f=h.scrollThreshold,p=h.scrollSpeed,m=t.scrollTop,g=t.scrollLeft,v=t.scrollHeight,y=m>0&&o>=r&&o<=r+f,b=g+u<t.scrollWidth&&i<=s&&i>=s-f,S=m+c<v&&o<=l&&o>=l-f;g>0&&i>=a&&i<=a+f&&(t.scrollLeft+=Math.floor(Math.max(-1,(i-a)/f-1)*p.x)),b&&(t.scrollLeft+=Math.ceil(Math.min(1,(i-s)/f+1)*p.x)),y&&(t.scrollTop+=Math.floor(Math.max(-1,(o-r)/f-1)*p.y)),S&&(t.scrollTop+=Math.ceil(Math.min(1,(o-l)/f+1)*p.y))}}}}},z.prototype={collect:function(t){if(t){for(var e=d(t),n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,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,c=s.length;a<=c;a++){var u=s[a];if(u&&u!==it.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>o)break;l.push({el:u,rect:h})}}}this.stack.push(l)}},animate:function(){for(var t=this.stack.pop(),e=0,n=t.length;e<n;e++){var i=t[e],o=i.el,r=i.rect;this.options.animation&&this._excute(o,r)}},_excute:function(t,e){var n=d(t);if(n.top!==e.top||n.left!==e.left){var i=e.left-n.left,o=e.top-n.top;w(t,"transition",""),w(t,"transform","translate3d("+i+"px, "+o+"px, 0)"),t.offsetWidth;var r=this.options,s=r.animation,l=r.easing;w(t,"transition","transform "+s+"ms"+(l?" "+l:"")),w(t,"transform","translate3d(0px, 0px, 0px)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){w(t,"transition",""),w(t,"transform",""),t.animated=null}),s)}}},R.prototype={destroy:function(){E=O=null},active:function(){return!!E},setParams:function(t){t.nodes=E||[],t.clones=O||[]},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(!E)return null;var t=document.createElement("div");return this.selectedElements.forEach((function(e,n){var i=e.cloneNode(!0),o=0===n?1:.5;i.style="position: absolute;left: 0;top: 0;bottom: 0;right: 0;opacity: ".concat(o,";z-index: ").concat(n,";"),t.appendChild(i)})),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(E)for(var e=0;e<E.length;e++)b(E[e],this.options.chosenClass,t)},toggleVisible:function(t){if(E)if(t){var e=E.indexOf(it.dragged);this._viewElements(E,e,it.dragged)}else this._hideElements(E)},onChoose:function(){!this.options.multiple||!this.selectedElements.length||this.selectedElements.indexOf(it.dragged)<0||(this.selectedElements.sort((function(t,e){return x(t,e)})),E=this.selectedElements,this.toggleClass(!0))},onDrag:function(t){E&&(t.animator.collect(it.dragged.parentNode),this._hideElements(E),t.animator.animate(),this.toggleClass(!1))},onDrop:function(t,e,n){if(E){var i=it.dragged,o=it.clone,r=E.indexOf(i);e[D].animator.collect(o.parentNode),t!==e&&"clone"===n?(w(o,"display","none"),O=E.map((function(t){return t.cloneNode(!0)})),this._viewElements(O,r,o),this._viewElements(E,r,i)):this._viewElements(E,r,o),e[D].animator.animate(),t!==e&&(e[D].multiplayer.toggleSelected(O||E,!0),"clone"!==n&&t[D].multiplayer.toggleSelected(E,!1))}},onSelect:function(t,e,n){var i=this.selectedElements.indexOf(e);b(e,this.options.selectedClass,i<0);var o={from:n.el,event:t,node:e,index:g(e)};i<0?(this.selectedElements.push(e),T({sortable:n,name:"onSelect",params:o})):(this.selectedElements.splice(i,1),T({sortable:n,name:"onDeselect",params:o})),this.selectedElements.sort((function(t,e){return x(t,e)}))},_viewElements:function(t,e,n){for(var i=0;i<t.length;i++)if(w(t[i],"display",""),i<e)n.parentNode.insertBefore(t[i],n);else{var o=i>0?t[i-1]:n;n.parentNode.insertBefore(t[i],o.nextSibling)}},_hideElements:function(t){for(var e=0;e<t.length;e++)t[e]!=it.dragged&&w(t[e],"display","none")}};var C,k,A,M,B,N,L,P,K,F,j,H,q,W,$,U,Y,X,V,G,J,Q,Z,tt=[];function et(e){var n={},i=e.group;i&&"object"==t(i)||(i={name:i,pull:!0,put:!0,revertDrag:!0}),n.name=i.name,n.pull=i.pull,n.put=i.put,n.revertDrag=i.revertDrag,e.group=n}function nt(t){var e=U||$;return!(void 0!==t.clientX&&void 0!==t.clientY&&Math.abs(t.clientX-e.clientX)<=0&&Math.abs(t.clientY-e.clientY)<=0)}function it(t,n){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable-dnd: `el` must be an HTMLElement, not ".concat({}.toString.call(t));t[D]=this,this.el=t,this.options=n=e({},n);var i={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 o in i)!(o in this.options)&&(this.options[o]=i[o]);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 I(this.options),this.multiplayer=new R(this.options),this.animator=new z(this.options)}return it.prototype={constructor:it,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[D]=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(!M&&!this.options.disabled&&this.options.group.pull&&(!/mousedown|pointerdown/.test(t.type)||0===t.button)){var n=t.touches&&t.touches[0],i=(n||t).target;if(!l||!i||"SELECT"!==i.tagName.toUpperCase()){var o=f(i,this.options.draggable,this.el);if(o&&!o.animated){$={origin:t,clientX:(n||t).clientX,clientY:(n||t).clientY},M=o,c(G=n?M:document,"mouseup",this._onDrop),c(G,"touchend",this._onDrop),c(G,"touchcancel",this._onDrop);var a=this.options,u=a.handle,h=a.selectHandle;if("function"==typeof h&&h(t)||"string"==typeof h&&S(i,h))Z=!0;else if(("function"!=typeof u||u(t))&&("string"!=typeof u||S(i,u))){var d=this.options,p=d.delay,m=d.delayOnTouchOnly;!p||m&&!n||s||r?this._onStart(n,t):(c(this.el.ownerDocument,"touchmove",this._delayMoveHandler),c(this.el.ownerDocument,"mousemove",this._delayMoveHandler),c(this.el.ownerDocument,"mouseup",this._cancelStart),c(this.el.ownerDocument,"touchend",this._cancelStart),c(this.el.ownerDocument,"touchcancel",this._cancelStart),Q=setTimeout((function(){return e._onStart(n,t)}),p)),c(document,"selectstart",_),l&&w(document.body,"user-select","none")}}}}},_delayMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-$.clientX),Math.abs(e.clientY-$.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",_),l&&w(document.body,"user-select","")},_onStart:function(t,e){var n=g(M);C=this.el,k=this.el,K=M,H=n,q=n,W=n,X={to:this.el,target:M,newIndex:n,relative:0},V=M,A=this.el,L=M.cloneNode(!0),F=M.parentNode,j=this.options.group.pull,it.clone=L,it.active=this,it.dragged=M,b(M,this.options.chosenClass,!0),this.multiplayer.onChoose(),T({sortable:this,name:"onChoose",params:this._getParams(e)}),c(G,t?"touchmove":"mousemove",this._nearestSortable);try{document.selection?setTimeout((function(){return document.selection.empty()}),0):window.getSelection().removeAllRanges()}catch(t){}},_onStarted:function(){b(L,this.options.chosenClass,!0),this._appendGhost(),this.multiplayer.onDrag(this),T({sortable:this,name:"onDrag",params:this._getParams($.origin)}),w(M,"display","none"),b(M,this.options.chosenClass,!1),M.parentNode.insertBefore(L,M)},_getGhostElement:function(){var t=this.options.customGhost;if("function"==typeof t){var e=this.multiplayer.selectedElements;return t(e.length?e:[M])}return this.multiplayer.getGhostElement()||M},_appendGhost:function(){if(!P){var t=this.options.fallbackOnBody?document.body:this.el,n=this._getGhostElement();b(P=n.cloneNode(!0),this.options.ghostClass,!0);var i=d(M),o=e({position:"fixed",top:i.top,left:i.left,width:i.width,height:i.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 o)w(P,r,o[r]);it.ghost=P,t.appendChild(P);var s=($.clientX-i.left)/parseInt(P.style.width)*100,l=($.clientY-i.top)/parseInt(P.style.height)*100;w(P,"transform-origin",s+"% "+l+"%"),w(P,"will-change","transform")}},_nearestSortable:function(t){_(t);var e=t.touches&&t.touches[0]||t;if(M&&nt(e)){!U&&this._onStarted();var n=this.options.lockAxis,i="x"===n?$.clientX:e.clientX,o="y"===n?$.clientY:e.clientY,r=document.elementFromPoint(i,o),s=i-$.clientX,l=o-$.clientY;U={origin:t,clientX:i,clientY:o},w(P,"transform","translate3d("+s+"px, "+l+"px, 0)");var a,c,u,f=(a=i,c=o,tt.reduce((function(t,e){var n=e[D].options.emptyInsertThreshold;if(null!=n){var i=d(e),o=a>=i.left-n&&a<=i.right+n,r=c>=i.top-n&&c<=i.bottom+n;return o&&r&&(!u||u&&i.left>=u.left&&i.right<=u.right&&i.top>=u.top&&i.bottom<=u.bottom)&&(t=e,u=i),t}}),null));if(f&&f[D]._onMove(t,r),!f||f[D].options.autoScroll){var p=function(t,e){if(!t||!t.getBoundingClientRect)return h();var n=t,i=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var o=w(n);if(n.clientWidth<n.scrollWidth&&("auto"==o.overflowX||"scroll"==o.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==o.overflowY||"scroll"==o.overflowY)){if(!n.getBoundingClientRect||n===document.body)return h();if(i||e)return n;i=!0}}}while(n=n.parentNode);return h()}(r,!0);this.autoScroller.update(p,$,U)}else this.autoScroller.destroy()}},_allowPut:function(){if(A===this.el)return!0;if(this.options.group.put){var t=this.options.group,e=t.name,n=t.put,i=A[D].options.group;return n.join&&n.indexOf(i.name)>-1||i.name&&e&&i.name===e}return!1},_getDirection:function(){var t=this.options,e=t.draggable,n=t.direction;return n?"function"==typeof n?n.call(U.origin,M,this):n:y(F,e)},_allowSwap:function(){var t=d(B),e="vertical"===this._getDirection(),n=e?"top":"left",i=e?"bottom":"right",o=B[e?"offsetHeight":"offsetWidth"],r=e?U.clientY:U.clientX,s=r>=t[n]&&r<t[i]-o/2?-1:1,l=v(F,0,this.options.draggable),a=m(F),c=d(l),u=d(a);if(B===F||p(F,B))return L===l&&r<c[n]?(N=B,!0):L===a&&r>u[i]&&(N=B.nextSibling,!0);var h=x(L,B);return N=h<0?B.nextSibling:B,Y!==B?(J=s,!0):J!==s&&(J=s,s<0?h>0:h<0)},_onMove:function(t,e){if(!this.options.disabled&&this._allowPut()){if(B=f(e,this.options.draggable,this.el),T({sortable:this,name:"onMove",params:this._getParams(t,{target:B})}),this.options.sortable||this.el!==A)return this.el===k||e!==this.el&&m(this.el)?void(B&&!B.animated&&!p(B,L)&&this._allowSwap()&&(B!==L&&N!==L?(this.el!==k?this._onInsert(t):B!==M&&this._onChange(t),Y=B):Y=B)):(B=Y=null,void this._onInsert(t));k!==A&&(B=Y=M,J=0,this._onInsert(t))}},_onInsert:function(t){var e=B||L,n="clone"===j&&this.el!==A&&k===A,i="clone"===j&&this.el===A&&k!==A,o=p(B,document),r=B===M&&!o;C=this.el,H=g(L),K=e,F=o?B.parentNode:this.el,k[D].animator.collect(L.parentNode),this.animator.collect(F),n&&(X.target=V,X.newIndex=H,X.relative=V===M?0:x(L,V),w(M,"display",""),A[D].multiplayer.toggleVisible(!0),A[D].options.group.revertDrag||L.parentNode.insertBefore(M,L)),i&&(H=g(M),w(M,"display","none"),this.multiplayer.toggleVisible(!1)),w(L,"display",r?"none":""),B&&o?F.insertBefore(L,J<0?B:B.nextSibling):F.appendChild(L),q=r?W:g(L),n&&A[D].options.group.revertDrag&&(X.target=M,X.newIndex=W,X.relative=0,T({sortable:A[D],name:"onChange",params:this._getParams(t,{to:A,target:M,newIndex:W,revertDrag:!0})})),n||T({sortable:k[D],name:"onRemove",params:this._getParams(t,{newIndex:-1})}),i&&e!==M&&(V=e,T({sortable:this,name:"onChange",params:this._getParams(t,{from:A,backToOrigin:!0})})),i||T({sortable:this,name:"onAdd",params:this._getParams(t,{oldIndex:-1})}),k[D].animator.animate(),this.animator.animate(),k=this.el},_onChange:function(t){H=g(L),F=B.parentNode,K=B,this.el===A&&(V=B),this.animator.collect(F),F.insertBefore(L,N),q=g(L),T({sortable:this,name:"onChange",params:this._getParams(t)}),this.animator.animate(),k=this.el},_onDrop:function(t){this._cancelStart(),u(G,"touchmove",this._nearestSortable),u(G,"mousemove",this._nearestSortable),u(G,"mouseup",this._onDrop),u(G,"touchend",this._onDrop),u(G,"touchcancel",this._onDrop),b(M,this.options.chosenClass,!1),A&&(k=A,H=W,K===L&&(K=M),this.multiplayer.toggleClass(!1),T({sortable:this,name:"onUnchoose",params:this._getParams(t)}),U&&this._onEnd(t));var e=this.options,n=e.multiple,i=e.selectHandle;n&&(i&&Z||!i&&!A)&&!nt(t.changedTouches?t.changedTouches[0]:t)&&this.multiplayer.onSelect(t,M,this),P&&P.parentNode&&P.parentNode.removeChild(P),this.autoScroller.destroy(),this.multiplayer.destroy(),this._nulling()},_onEnd:function(t){var n=this._getParams(t);this.multiplayer.onDrop(k,C,j);var i=this.options.swapOnDrop;"clone"===j&&k!==C||!("function"==typeof i?i(n):i)||F.insertBefore(M,L),"clone"!==j||k===C||this.multiplayer.active()?L&&L.parentNode&&L.parentNode.removeChild(L):b(L,this.options.chosenClass,!1),w(M,"display",""),k!==C&&T({sortable:k[D],name:"onDrop",params:e({},n,"clone"===j?X:{newIndex:-1})}),T({sortable:C[D],name:"onDrop",params:e({},n,k===C?{}:{oldIndex:-1})})},_getParams:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i={};return i.event=t,i.to=C,i.from=k,i.node=M,i.clone=L,i.target=K,i.oldIndex=H,i.newIndex=q,i.pullMode=j,this.multiplayer.setParams(i),e(i,n),i.relative=K===M?0:x(L,K),i},_nulling:function(){C=k=A=M=B=N=L=P=K=F=j=H=q=W=$=U=Y=X=V=G=J=Q=Z=it.clone=it.ghost=it.active=it.dragged=null}},it.utils={on:c,off:u,css:w,index:g,closest:f,getRect:d,toggleClass:b,detectDirection:y},it.get=function(t){return t[D]},it.create=function(t,e){return new it(t,e)},it}()}(d);var f=h(d.exports),p=["delay","group","handle","lockAxis","disabled","sortable","draggable","animation","autoScroll","ghostClass","ghostStyle","chosenClass","fallbackOnBody","scrollThreshold","delayOnTouchOnly"];function m(t,e){this.el=t,this.options=e,this.reRendered=!1,this.installSortable()}function g(t,e){var n=null,i=function(){for(var i=this,o=arguments.length,r=new Array(o),s=0;s<o;s++)r[s]=arguments[s];n||(e<=0?t.apply(this,r):n=setTimeout((function(){n=void 0,t.apply(i,r)}),e))};return i.cancel=function(){n&&(clearTimeout(n),n=null)},i}function v(t,e){var n=g(t,e),i=function(){n.cancel(),n.apply(this,arguments)};return i.cancel=function(){n.cancel()},i}function y(t,e){return(Array.isArray(e)?e:e.replace(/\[/g,".").replace(/\]/g,".").split(".")).reduce((function(t,e){return(t||{})[e]}),t)}m.prototype={constructor:m,destroy:function(){this.sortable&&this.sortable.destroy(),this.sortable=this.reRendered=null},option:function(t,e){this.options[t]=e,p.includes(t)&&this.sortable.option(t,e)},installSortable:function(){var t=this,e=p.reduce((function(e,n){return e[n]=t.options[n],e}),{});this.sortable=new f(this.el,o(o({},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=f.get(t.from).option("store"),n=e.item,i=e.key;this.sortable.option("store",{item:n,key:i}),this.dispatchEvent("onAdd",{item:n,key:i,event:t})},onRemove:function(t){var e=f.get(t.from).option("store"),n=e.item,i=e.key;this.dispatchEvent("onRemove",{item:n,key:i,event:t})},onDrag:function(t){var e=t.node.getAttribute("data-key"),n=this.getIndex(e),i=this.options.list[n];this.sortable.option("store",{item:i,key:e,index:n}),this.dispatchEvent("onDrag",{item:i,key:e,index:n,event:t})},onDrop:function(t){var e,n,i=f.get(t.from).option("store"),o=i.item,r=i.key,l=i.index,a=this.options.list,c={key:r,item:o,list:a,event:t,changed:!1,oldList:s(a),oldIndex:l,newIndex:l};(t.from===t.to&&t.node===t.target||this.getDropParams(c,t,o,r,l,a),this.dispatchEvent("onDrop",c),t.from===this.el&&this.reRendered)&&(null===(e=f.dragged)||void 0===e||e.remove());t.from!==t.to&&"clone"===t.pullMode&&(null===(n=f.clone)||void 0===n||n.remove());this.reRendered=!1},getDropParams:function(t,e,n,i,o,r){var s=e.target.getAttribute("data-key"),l=-1,a=o;e.from===e.to?(((a=this.getIndex(i))<(l=this.getIndex(s))&&-1===e.relative||a>l&&1===e.relative)&&(l+=e.relative),l!==a&&(r.splice(a,1),r.splice(l,0,n))):(e.from===this.el&&(a=this.getIndex(i),r.splice(a,1)),e.to===this.el&&(a=-1,l=this.getIndex(s),0===e.relative?l=r.length:1===e.relative&&(l+=e.relative),r.splice(l,0,n))),t.changed=e.from!==e.to||l!==a,t.list=r,t.oldIndex=a,t.newIndex=l},getIndex:function(t){return this.options.uniqueKeys.indexOf(t)},dispatchEvent:function(t,e){var n=this.options[t];n&&n(e)}};var b=["size","keeps","scroller","direction","debounceTime","throttleTime"],S="INIT",w="FIXED",x="DYNAMIC",_="FRONT",T="BEHIND",E="STATIONARY",O={vertical:"top",horizontal:"left"},D={vertical:"scrollTop",horizontal:"scrollLeft"},I={vertical:"scrollHeight",horizontal:"scrollWidth"},z={vertical:"offsetHeight",horizontal:"offsetWidth"};function R(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=S,this.calcSize={average:0,total:0,fixed:0},this.scrollDirection="",this.updateScrollElement(),this.updateOnScrollFunction(),this.addScrollEventListener(),this.checkIfUpdate(0,t.keeps-1)}return R.prototype={constructor:R,isFront:function(){return this.scrollDirection===_},isBehind:function(){return this.scrollDirection===T},isFixed:function(){return this.calcType===w},getSize:function(t){return this.sizes.get(t)||this.getItemSize()},getOffset:function(){return this.scrollEl[D[this.options.direction]]},getScrollSize:function(){return this.scrollEl[I[this.options.direction]]},getClientSize:function(){return this.scrollEl[z[this.options.direction]]},scrollToOffset:function(t){this.scrollEl[D[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,i=this.options[t];this.options[t]=e,"uniqueKeys"===t&&this.sizes.forEach((function(t,i){e.includes(i)||n.sizes.delete(i)})),"scroller"===t&&(i&&f.utils.off(i,"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===S?(this.calcType=w,this.calcSize.fixed=e):this.isFixed()&&this.calcSize.fixed!==e&&(this.calcType=x,this.calcSize.fixed=void 0),this.calcType!==w&&(this.calcSize.total=s(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&&f.utils.on(this.options.scroller,"scroll",this.onScroll)},removeScrollEventListener:function(){this.options.scroller&&f.utils.off(this.options.scroller,"scroll",this.onScroll)},enableScroll:function(t){var e=this.options.scroller,n=t?f.utils.off:f.utils.on,i="onwheel"in document.createElement("div")?"wheel":"mousewheel";n(e,"DOMMouseScroll",this.preventDefault),n(e,i,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=this,e=this.options,n=e.debounceTime,i=e.throttleTime;this.onScroll=n?v((function(){return t.handleScroll()}),n):i?g((function(){return t.handleScroll()}),i):function(){return t.handleScroll()}},handleScroll:function(){var t=this.getOffset(),e=this.getClientSize(),n=this.getScrollSize();t===this.offset?this.scrollDirection=E:this.scrollDirection=t<this.offset?_:T,this.offset=t;var i=this.isFront()&&t<=0,o=this.isBehind()&&e+t>=n;this.options.onScroll({top:i,bottom:o,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,i=0,o=0;e<=n;){if(i=e+Math.floor((n-e)/2),(o=this.getOffsetByIndex(i))===t)return i;o<t?e=i+1:o>t&&(n=i-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(o({},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,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,i=e.scroller,o=e.direction;if(i&&n){var r=i instanceof Window?f.utils.getRect(n):f.utils.getRect(n,!0,i);t=this.offset+r[O[o]]}return t}},n.default.component("virtual-list",{model:{prop:"dataSource",event:"updateDataSource"},props:a,data:function(){return{range:{start:0,end:0,front:0,behind:0},dragging:"",lastList:[],lastLength:null,uniqueKeys:[],virtualRef:null,sortableRef:null}},computed:{isHorizontal:function(){return"vertical"!==this.direction},itemSizeKey:function(){return this.isHorizontal?"offsetWidth":"offsetHeight"},virtualAttributes:function(){var t=this;return b.reduce((function(e,n){return e[n]=t[n],e}),{})},sortableAttributes:function(){var t=this;return p.reduce((function(e,n){return e[n]=t[n],e}),{})}},watch:{dataSource:{handler:function(){this._onUpdate()},deep:!0},virtualAttributes:{handler:function(t,e){if(this.virtualRef)for(var n in t)t[n]!=e[n]&&this.virtualRef.option(n,t[n])}},sortableAttributes:{handler:function(t,e){if(this.sortableRef)for(var n in t)t[n]!=e[n]&&this.sortableRef.option(n,t[n])}}},activated:function(){this.scrollToOffset(this.virtualRef.offset),this.virtualRef.addScrollEventListener()},deactivated:function(){this.virtualRef.removeScrollEventListener()},created:function(){this.range.end=this.keeps-1,this._onUpdate()},mounted:function(){this._installVirtual(),this._installSortable()},beforeDestroy:function(){var t,e;null===(t=this.sortableRef)||void 0===t||t.destroy(),null===(e=this.virtualRef)||void 0===e||e.removeScrollEventListener()},methods:{getSize:function(t){return this.virtualRef.getSize(t)},getOffset:function(){return this.virtualRef.getOffset()},getClientSize:function(){return this.virtualRef.getClientSize()},getScrollSize:function(){return this.virtualRef.getScrollSize()},scrollToKey:function(t){var e=this.uniqueKeys.indexOf(t);e>-1&&this.virtualRef.scrollToIndex(e)},scrollToIndex:function(t){this.virtualRef.scrollToIndex(t)},scrollToOffset:function(t){this.virtualRef.scrollToOffset(t)},scrollToTop:function(){this.virtualRef.scrollToOffset(0)},scrollToBottom:function(){this.virtualRef.scrollToBottom()},_onUpdate:function(){var t;if(this._updateUniqueKeys(),this._updateRange(this.lastList,this.dataSource),null===(t=this.sortableRef)||void 0===t||t.option("list",this.dataSource),this.lastLength&&this.keepOffset){var e=this.dataSource.length-this.lastLength;e>0&&this.scrollToIndex(e),this.lastLength=null}this.lastList=s(this.dataSource)},_updateUniqueKeys:function(){var t,e,n=this;this.uniqueKeys=this.dataSource.map((function(t){return y(t,n.dataKey)})),null===(t=this.virtualRef)||void 0===t||t.option("uniqueKeys",this.uniqueKeys),null===(e=this.sortableRef)||void 0===e||e.option("uniqueKeys",this.uniqueKeys)},_updateRange:function(t,e){var n,i=o({},this.range);e.length>t.length&&this.range.end===t.length-1&&this._scrolledToBottom()&&(i.end++,i.start=Math.max(0,i.end-this.keeps+1)),null===(n=this.virtualRef)||void 0===n||n.updateRange(i)},_scrolledToBottom:function(){return this.getOffset()+this.getClientSize()+1>=this.getScrollSize()},_installVirtual:function(){var t=this;this.virtualRef=new R(o(o({},this.virtualAttributes),{},{buffer:Math.round(this.keeps/3),wrapper:this.$refs.wrapRef,scroller:this.scroller||this.$refs.rootRef,uniqueKeys:this.uniqueKeys,onScroll:function(e){t.lastLength=null,t.dataSource.length&&e.top?t._handleToTop():e.bottom&&t._handleToBottom()},onUpdate:function(e){var n,i=e.start!==t.range.start;t.dragging&&i&&(t.sortableRef.reRendered=!0),t.range=e,null===(n=t.sortableRef)||void 0===n||n.option("range",e),i&&t.$emit("rangeChange",e)}}))},_installSortable:function(){var t=this;this.sortableRef=new m(this.$refs.rootRef,o(o({},this.sortableAttributes),{},{list:this.dataSource,uniqueKeys:this.uniqueKeys,onDrag:function(e){t.dragging=e.key,t.sortable||(t.virtualRef.enableScroll(!1),t.sortableRef.option("autoScroll",!1)),t.$emit("drag",e)},onDrop:function(e){t.dragging="",t.virtualRef.enableScroll(!0),t.sortableRef.option("autoScroll",t.autoScroll),e.changed&&t.$emit("updateDataSource",e.list),t.$emit("drop",e)}}))},_handleToTop:v((function(){this.$emit("top"),this.lastLength=this.dataSource.length})),_handleToBottom:v((function(){this.$emit("bottom")})),_onItemResized:function(t,e){var n=this.virtualRef.sizes.size,i=Math.min(this.keeps,this.dataSource.length);this.virtualRef.onItemResized(t,e),n===i-1&&this._updateRange(this.dataSource,this.dataSource)},_renderSpacer:function(t,e){return this.tableMode?t("tr",{},[t("td",{style:{padding:0,margin:0,border:0,height:"".concat(e,"px")}})]):null},_renderItems:function(t){var e=[],n=this.range,i=n.start,o=n.end,r=n.front,s=n.behind;e.push(this._renderSpacer(t,r));for(var l=i;l<=o;l++){var a=this.dataSource[l];if(a){var c=y(a,this.dataKey);e.push(this.$scopedSlots.item?t(u,{key:c,attrs:{"data-key":c},props:{dataKey:c,sizeKey:this.itemSizeKey},on:{resized:this._onItemResized},style:c==this.dragging&&{display:"none"},class:this.itemClass},this.$scopedSlots.item({record:a,index:l,dataKey:c})):null)}}return e.push(this._renderSpacer(t,s)),e}},render:function(t){var e=this.range,n=e.front,i=e.behind,r=this.tableMode,s=this.isHorizontal,l=this.rootTag,a=this.wrapTag,c=s?"0px ".concat(i,"px 0px ").concat(n,"px"):"".concat(n,"px 0px ").concat(i,"px"),u=s?"auto hidden":"hidden auto",h=r?"tbody":a;return t(r?"table":l,{ref:"rootRef",style:!this.scroller&&!r&&{overflow:u}},[this.$slots.header,t(h,{ref:"wrapRef",class:this.wrapClass,style:o(o({},this.wrapStyle),{},{padding:!r&&c})},this._renderItems(t)),this.$slots.footer])}})})); | ||
*/!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 i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},e.apply(this,arguments)}var n={capture:!1,passive:!1},i=/\s+/g;function o(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var r=o(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),s=o(/Edge/i),l=o(/safari/i)&&!o(/chrome/i)&&!o(/android/i),a=function(){var t=!1;return document.addEventListener("checkIfSupportPassive",null,{get passive(){return t=!0,!0}}),t}();function c(t,e,i){window.addEventListener?t.addEventListener(e,i,!(!a&&r)&&n):window.attachEvent?t.attachEvent("on"+e,i):t["on"+e]=i}function u(t,e,i){window.removeEventListener?t.removeEventListener(e,i,!(!a&&r)&&n):window.detachEvent?t.detachEvent("on"+e,i):t["on"+e]=null}function h(){return document.scrollingElement||document.documentElement}function d(t,e,n){if(t.getBoundingClientRect||t===window){var i,o,r,s,l,a,c;if(t!==window&&t.parentNode&&t!==h()?(o=(i=t.getBoundingClientRect()).top,r=i.left,s=i.bottom,l=i.right,a=i.height,c=i.width):(o=0,r=0,s=window.innerHeight,l=window.innerWidth,a=window.innerHeight,c=window.innerWidth),e&&t!==window){n=n||t.parentNode;do{if(n&&n.getBoundingClientRect){var u=n.getBoundingClientRect();o-=u.top+parseInt(w(n,"border-top-width")),r-=u.left+parseInt(w(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 f(t,e,n,i){if(t){if(n&&!e)for(var o=Array.prototype.slice.call(n.children),r=0,s=o.length;r<s;r++)if(o[r]===t||p(t,o[r]))return o[r];n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&S(t,e):S(t,e))||i&&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===it.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,i){for(var o=0,r=0,s=t.children;o<s.length;){if(s[o]!==it.ghost&&"none"!==w(s[o],"display")&&f(s[o],n,t,!1)&&(i||s[o]!==it.dragged)){if(r===e)return s[o];r++}o++}return null}function y(t,e){var n=w(t),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),o=v(t,0,e),l=v(t,1,e),a=o&&w(o),c=l&&w(l),u=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+d(o).width,h=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+d(l).width,f=s||r?"cssFloat":"float";if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&a.float&&"none"!==a.float){var p="left"===a.float?"left":"right";return!l||"both"!==c.clear&&c.clear!==p?"horizontal":"vertical"}return o&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||u>=i&&"none"===n[f]||l&&"none"===n[f]&&u+h>i)?"vertical":"horizontal"}function b(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(i," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(i," ")}}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 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];e in i||-1!==e.indexOf("webkit")||(e="-webkit-"+e),i[e]=n+("string"==typeof n?"":"px")}}function x(t,e){var n,i,o=(i=e,(n=t).compareDocumentPosition?n.compareDocumentPosition(i):n.contains?(n!=i&&n.contains(i)&&16)+(n!=i&&i.contains(n)&&8)+(n.sourceIndex>=0&&i.sourceIndex>=0?(n.sourceIndex<i.sourceIndex&&4)+(n.sourceIndex>i.sourceIndex&&2):1):0);return 2===o?1:4===o?-1:0}function _(t){void 0!==t.preventDefault&&t.cancelable&&t.preventDefault()}function T(t){var n=t.sortable,i=t.name,o=t.params,r=n.options[i];"function"==typeof r&&r(e({},o))}!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 E,O,D="Sortable"+Date.now();function z(t){this.options=t,this.autoScrollAnimationFrame=null}function I(t){this.options=t,this.stack=[]}function R(t){this.options=t||{},this.selectedElements=[]}window.requestAnimationFrame||(window.requestAnimationFrame=function(t){return setTimeout(t,17)}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),z.prototype={destroy:function(){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){if(t&&void 0!==e.clientX&&void 0!==e.clientY){var n=d(t);if(n){var i=e.clientX,o=e.clientY,r=n.top,s=n.right,l=n.bottom,a=n.left,c=n.height,u=n.width;if(!(o<r||i>s||o>l||i<a)){var h=this.options,f=h.scrollThreshold,p=h.scrollSpeed,m=t.scrollTop,g=t.scrollLeft,v=t.scrollHeight,y=m>0&&o>=r&&o<=r+f,b=g+u<t.scrollWidth&&i<=s&&i>=s-f,S=m+c<v&&o<=l&&o>=l-f;g>0&&i>=a&&i<=a+f&&(t.scrollLeft+=Math.floor(Math.max(-1,(i-a)/f-1)*p.x)),b&&(t.scrollLeft+=Math.ceil(Math.min(1,(i-s)/f+1)*p.x)),y&&(t.scrollTop+=Math.floor(Math.max(-1,(o-r)/f-1)*p.y)),S&&(t.scrollTop+=Math.ceil(Math.min(1,(o-l)/f+1)*p.y))}}}}},I.prototype={collect:function(t){if(t){for(var e=d(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,c=s.length;a<=c;a++){var u=s[a];if(u&&u!==it.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>o)break;l.push({el:u,rect:h})}}}this.stack.push(l)}},animate:function(){for(var t=this.stack.pop(),e=0,n=t.length;e<n;e++){var i=t[e],o=i.el,r=i.rect;this.options.animation&&this._excute(o,r)}},_excute:function(t,e){var n=d(t);if(n.top!==e.top||n.left!==e.left){var i=e.left-n.left,o=e.top-n.top;w(t,"transition",""),w(t,"transform","translate3d("+i+"px, "+o+"px, 0)"),t.offsetWidth;var r=this.options,s=r.animation,l=r.easing;w(t,"transition","transform "+s+"ms"+(l?" "+l:"")),w(t,"transform","translate3d(0px, 0px, 0px)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){w(t,"transition",""),w(t,"transform",""),t.animated=null}),s)}}},R.prototype={destroy:function(){E=O=null},active:function(){return!!E},setParams:function(t){t.nodes=E||[],t.clones=O||[]},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(!E)return null;var t=document.createElement("div");return this.selectedElements.forEach((function(e,n){var i=e.cloneNode(!0),o=0===n?1:.5;i.style="position: absolute;left: 0;top: 0;bottom: 0;right: 0;opacity: ".concat(o,";z-index: ").concat(n,";"),t.appendChild(i)})),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(E)for(var e=0;e<E.length;e++)b(E[e],this.options.chosenClass,t)},toggleVisible:function(t){if(E)if(t){var e=E.indexOf(it.dragged);this._viewElements(E,e,it.dragged)}else this._hideElements(E)},onChoose:function(){!this.options.multiple||!this.selectedElements.length||this.selectedElements.indexOf(it.dragged)<0||(this.selectedElements.sort((function(t,e){return x(t,e)})),E=this.selectedElements,this.toggleClass(!0))},onDrag:function(t){E&&(t.animator.collect(it.dragged.parentNode),this._hideElements(E),t.animator.animate(),this.toggleClass(!1))},onDrop:function(t,e,n){if(E){var i=it.dragged,o=it.clone,r=E.indexOf(i);e[D].animator.collect(o.parentNode),t!==e&&"clone"===n?(w(o,"display","none"),O=E.map((function(t){return t.cloneNode(!0)})),this._viewElements(O,r,o),this._viewElements(E,r,i)):this._viewElements(E,r,o),e[D].animator.animate(),t!==e&&(e[D].multiplayer.toggleSelected(O||E,!0),"clone"!==n&&t[D].multiplayer.toggleSelected(E,!1))}},onSelect:function(t,e,n){var i=this.selectedElements.indexOf(e);b(e,this.options.selectedClass,i<0);var o={from:n.el,event:t,node:e,index:g(e)};i<0?(this.selectedElements.push(e),T({sortable:n,name:"onSelect",params:o})):(this.selectedElements.splice(i,1),T({sortable:n,name:"onDeselect",params:o})),this.selectedElements.sort((function(t,e){return x(t,e)}))},_viewElements:function(t,e,n){for(var i=0;i<t.length;i++)if(w(t[i],"display",""),i<e)n.parentNode.insertBefore(t[i],n);else{var o=i>0?t[i-1]:n;n.parentNode.insertBefore(t[i],o.nextSibling)}},_hideElements:function(t){for(var e=0;e<t.length;e++)t[e]!=it.dragged&&w(t[e],"display","none")}};var C,k,M,B,A,N,L,P,K,F,j,H,q,W,$,U,Y,X,V,G,J,Q,Z,tt=[];function et(e){var n={},i=e.group;i&&"object"==t(i)||(i={name:i,pull:!0,put:!0,revertDrag:!0}),n.name=i.name,n.pull=i.pull,n.put=i.put,n.revertDrag=i.revertDrag,e.group=n}function nt(t){var e=U||$;return!(void 0!==t.clientX&&void 0!==t.clientY&&Math.abs(t.clientX-e.clientX)<=0&&Math.abs(t.clientY-e.clientY)<=0)}function it(t,n){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable-dnd: `el` must be an HTMLElement, not ".concat({}.toString.call(t));t[D]=this,this.el=t,this.options=n=e({},n);var i={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 o in i)!(o in this.options)&&(this.options[o]=i[o]);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 z(this.options),this.multiplayer=new R(this.options),this.animator=new I(this.options)}return it.prototype={constructor:it,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[D]=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],i=(n||t).target;if(!l||!i||"SELECT"!==i.tagName.toUpperCase()){var o=f(i,this.options.draggable,this.el);if(o&&!o.animated){$={origin:t,clientX:(n||t).clientX,clientY:(n||t).clientY},B=o,c(G=n?B:document,"mouseup",this._onDrop),c(G,"touchend",this._onDrop),c(G,"touchcancel",this._onDrop);var a=this.options,u=a.handle,h=a.selectHandle;if("function"==typeof h&&h(t)||"string"==typeof h&&S(i,h))Z=!0;else if(("function"!=typeof u||u(t))&&("string"!=typeof u||S(i,u))){var d=this.options,p=d.delay,m=d.delayOnTouchOnly;!p||m&&!n||s||r?this._onStart(n,t):(c(this.el.ownerDocument,"touchmove",this._delayMoveHandler),c(this.el.ownerDocument,"mousemove",this._delayMoveHandler),c(this.el.ownerDocument,"mouseup",this._cancelStart),c(this.el.ownerDocument,"touchend",this._cancelStart),c(this.el.ownerDocument,"touchcancel",this._cancelStart),Q=setTimeout((function(){return e._onStart(n,t)}),p)),c(document,"selectstart",_),l&&w(document.body,"user-select","none")}}}}},_delayMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-$.clientX),Math.abs(e.clientY-$.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",_),l&&w(document.body,"user-select","")},_onStart:function(t,e){var n=g(B);C=this.el,k=this.el,K=B,H=n,q=n,W=n,X={to:this.el,target:B,newIndex:n,relative:0},V=B,M=this.el,L=B.cloneNode(!0),F=B.parentNode,j=this.options.group.pull,it.clone=L,it.active=this,it.dragged=B,b(B,this.options.chosenClass,!0),this.multiplayer.onChoose(),T({sortable:this,name:"onChoose",params:this._getParams(e)}),c(G,t?"touchmove":"mousemove",this._nearestSortable);try{document.selection?setTimeout((function(){return document.selection.empty()}),0):window.getSelection().removeAllRanges()}catch(t){}},_onStarted:function(){b(L,this.options.chosenClass,!0),this._appendGhost(),this.multiplayer.onDrag(this),T({sortable:this,name:"onDrag",params:this._getParams($.origin)}),w(B,"display","none"),b(B,this.options.chosenClass,!1),B.parentNode.insertBefore(L,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(!P){var t=this.options.fallbackOnBody?document.body:this.el,n=this._getGhostElement();b(P=n.cloneNode(!0),this.options.ghostClass,!0);var i=d(B),o=e({position:"fixed",top:i.top,left:i.left,width:i.width,height:i.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 o)w(P,r,o[r]);it.ghost=P,t.appendChild(P);var s=($.clientX-i.left)/parseInt(P.style.width)*100,l=($.clientY-i.top)/parseInt(P.style.height)*100;w(P,"transform-origin",s+"% "+l+"%"),w(P,"will-change","transform")}},_nearestSortable:function(t){_(t);var e=t.touches&&t.touches[0]||t;if(B&&nt(e)){!U&&this._onStarted();var n=this.options.lockAxis,i="x"===n?$.clientX:e.clientX,o="y"===n?$.clientY:e.clientY,r=document.elementFromPoint(i,o),s=i-$.clientX,l=o-$.clientY;U={origin:t,clientX:i,clientY:o},w(P,"transform","translate3d("+s+"px, "+l+"px, 0)");var a,c,u,f=(a=i,c=o,tt.reduce((function(t,e){var n=e[D].options.emptyInsertThreshold;if(null!=n){var i=d(e),o=a>=i.left-n&&a<=i.right+n,r=c>=i.top-n&&c<=i.bottom+n;return o&&r&&(!u||u&&i.left>=u.left&&i.right<=u.right&&i.top>=u.top&&i.bottom<=u.bottom)&&(t=e,u=i),t}}),null));if(f&&f[D]._onMove(t,r),!f||f[D].options.autoScroll){var p=function(t,e){if(!t||!t.getBoundingClientRect)return h();var n=t,i=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var o=w(n);if(n.clientWidth<n.scrollWidth&&("auto"==o.overflowX||"scroll"==o.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==o.overflowY||"scroll"==o.overflowY)){if(!n.getBoundingClientRect||n===document.body)return h();if(i||e)return n;i=!0}}}while(n=n.parentNode);return h()}(r,!0);this.autoScroller.update(p,$,U)}else this.autoScroller.destroy()}},_allowPut:function(){if(M===this.el)return!0;if(this.options.group.put){var t=this.options.group,e=t.name,n=t.put,i=M[D].options.group;return n.join&&n.indexOf(i.name)>-1||i.name&&e&&i.name===e}return!1},_getDirection:function(){var t=this.options,e=t.draggable,n=t.direction;return n?"function"==typeof n?n.call(U.origin,B,this):n:y(F,e)},_allowSwap:function(){var t=d(A),e="vertical"===this._getDirection(),n=e?"top":"left",i=e?"bottom":"right",o=A[e?"offsetHeight":"offsetWidth"],r=e?U.clientY:U.clientX,s=r>=t[n]&&r<t[i]-o/2?-1:1,l=v(F,0,this.options.draggable),a=m(F),c=d(l),u=d(a);if(A===F||p(F,A))return L===l&&r<c[n]?(N=A,!0):L===a&&r>u[i]&&(N=A.nextSibling,!0);var h=x(L,A);return N=h<0?A.nextSibling:A,Y!==A?(J=s,!0):J!==s&&(J=s,s<0?h>0:h<0)},_onMove:function(t,e){if(!this.options.disabled&&this._allowPut()){if(A=f(e,this.options.draggable,this.el),T({sortable:this,name:"onMove",params:this._getParams(t,{target:A})}),this.options.sortable||this.el!==M)return this.el===k||e!==this.el&&m(this.el)?void(A&&!A.animated&&!p(A,L)&&this._allowSwap()&&(A!==L&&N!==L?(this.el!==k?this._onInsert(t):A!==B&&this._onChange(t),Y=A):Y=A)):(A=Y=null,void this._onInsert(t));k!==M&&(A=Y=B,J=0,this._onInsert(t))}},_onInsert:function(t){var e=A||L,n="clone"===j&&this.el!==M&&k===M,i="clone"===j&&this.el===M&&k!==M,o=p(A,document),r=A===B&&!o;C=this.el,H=g(L),K=e,F=o?A.parentNode:this.el,k[D].animator.collect(L.parentNode),this.animator.collect(F),n&&(X.target=V,X.newIndex=H,X.relative=V===B?0:x(L,V),w(B,"display",""),M[D].multiplayer.toggleVisible(!0),M[D].options.group.revertDrag||L.parentNode.insertBefore(B,L)),i&&(H=g(B),w(B,"display","none"),this.multiplayer.toggleVisible(!1)),w(L,"display",r?"none":""),A&&o?F.insertBefore(L,J<0?A:A.nextSibling):F.appendChild(L),q=r?W:g(L),n&&M[D].options.group.revertDrag&&(X.target=B,X.newIndex=W,X.relative=0,T({sortable:M[D],name:"onChange",params:this._getParams(t,{to:M,target:B,newIndex:W,revertDrag:!0})})),n||T({sortable:k[D],name:"onRemove",params:this._getParams(t,{newIndex:-1})}),i&&e!==B&&(V=e,T({sortable:this,name:"onChange",params:this._getParams(t,{from:M,backToOrigin:!0})})),i||T({sortable:this,name:"onAdd",params:this._getParams(t,{oldIndex:-1})}),k[D].animator.animate(),this.animator.animate(),k=this.el},_onChange:function(t){H=g(L),F=A.parentNode,K=A,this.el===M&&(V=A),this.animator.collect(F),F.insertBefore(L,N),q=g(L),T({sortable:this,name:"onChange",params:this._getParams(t)}),this.animator.animate(),k=this.el},_onDrop:function(t){this._cancelStart(),u(G,"touchmove",this._nearestSortable),u(G,"mousemove",this._nearestSortable),u(G,"mouseup",this._onDrop),u(G,"touchend",this._onDrop),u(G,"touchcancel",this._onDrop),b(B,this.options.chosenClass,!1),M&&(k=M,H=W,K===L&&(K=B),this.multiplayer.toggleClass(!1),T({sortable:this,name:"onUnchoose",params:this._getParams(t)}),U&&this._onEnd(t));var e=this.options,n=e.multiple,i=e.selectHandle;n&&(i&&Z||!i&&!M)&&!nt(t.changedTouches?t.changedTouches[0]:t)&&this.multiplayer.onSelect(t,B,this),P&&P.parentNode&&P.parentNode.removeChild(P),this.autoScroller.destroy(),this.multiplayer.destroy(),this._nulling()},_onEnd:function(t){var n=this._getParams(t);this.multiplayer.onDrop(k,C,j);var i=this.options.swapOnDrop;"clone"===j&&k!==C||!("function"==typeof i?i(n):i)||F.insertBefore(B,L),"clone"!==j||k===C||this.multiplayer.active()?L&&L.parentNode&&L.parentNode.removeChild(L):b(L,this.options.chosenClass,!1),w(B,"display",""),k!==C&&T({sortable:k[D],name:"onDrop",params:e({},n,"clone"===j?X:{newIndex:-1})}),T({sortable:C[D],name:"onDrop",params:e({},n,k===C?{}:{oldIndex:-1})})},_getParams:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i={};return i.event=t,i.to=C,i.from=k,i.node=B,i.clone=L,i.target=K,i.oldIndex=H,i.newIndex=q,i.pullMode=j,this.multiplayer.setParams(i),e(i,n),i.relative=K===B?0:x(L,K),i},_nulling:function(){C=k=M=B=A=N=L=P=K=F=j=H=q=W=$=U=Y=X=V=G=J=Q=Z=it.clone=it.ghost=it.active=it.dragged=null}},it.utils={on:c,off:u,css:w,index:g,closest:f,getRect:d,toggleClass:b,detectDirection:y},it.get=function(t){return t[D]},it.create=function(t,e){return new it(t,e)},it}()}(d);var f=h(d.exports),p=["delay","group","handle","lockAxis","disabled","sortable","draggable","animation","autoScroll","ghostClass","ghostStyle","chosenClass","scrollSpeed","fallbackOnBody","scrollThreshold","delayOnTouchOnly"];function m(t,e){this.el=t,this.options=e,this.reRendered=!1,this.installSortable()}function g(t,e){var n=null,i=function(){for(var i=this,o=arguments.length,r=new Array(o),s=0;s<o;s++)r[s]=arguments[s];n||(e<=0?t.apply(this,r):n=setTimeout((function(){n=void 0,t.apply(i,r)}),e))};return i.cancel=function(){n&&(clearTimeout(n),n=null)},i}function v(t,e){var n=g(t,e),i=function(){n.cancel(),n.apply(this,arguments)};return i.cancel=function(){n.cancel()},i}function y(t,e){return(Array.isArray(e)?e:e.replace(/\[/g,".").replace(/\]/g,".").split(".")).reduce((function(t,e){return(t||{})[e]}),t)}m.prototype={constructor:m,destroy:function(){this.sortable&&this.sortable.destroy(),this.sortable=this.reRendered=null},option:function(t,e){this.options[t]=e,p.includes(t)&&this.sortable.option(t,e)},installSortable:function(){var t=this,e=p.reduce((function(e,n){return e[n]=t.options[n],e}),{});this.sortable=new f(this.el,s(s({},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)}}))},onDrag:function(t){var e=t.node.getAttribute("data-key"),n=this.getIndex(e),i=this.options.list[n];this.sortable.option("store",{item:i,key:e,index:n}),this.dispatchEvent("onDrag",{item:i,key:e,index:n,event:t})},onDrop:function(t){var e,n,i=f.get(t.from).option("store"),o=i.item,r=i.key,s=i.index,a=this.options.list,c={key:r,item:o,list:a,event:t,changed:!1,oldList:l(a),oldIndex:s,newIndex:s};(t.from===t.to&&t.node===t.target||this.handleDropEvent(c,t,o,r,s,a),this.dispatchEvent("onDrop",c),t.from===this.el&&this.reRendered)&&(null===(e=f.dragged)||void 0===e||e.remove());t.from!==t.to&&"clone"===t.pullMode&&(null===(n=f.clone)||void 0===n||n.remove());this.reRendered=!1},handleDropEvent:function(t,e,n,i,o,r){var s=e.target.getAttribute("data-key"),l=-1,a=o;e.from===e.to?(((a=this.getIndex(i))<(l=this.getIndex(s))&&-1===e.relative||a>l&&1===e.relative)&&(l+=e.relative),l!==a&&(r.splice(a,1),r.splice(l,0,n))):(e.from===this.el&&(a=this.getIndex(i),r.splice(a,1)),e.to===this.el&&(a=-1,l=this.getIndex(s),0===e.relative?l=r.length:1===e.relative&&(l+=e.relative),r.splice(l,0,n))),t.changed=e.from!==e.to||l!==a,t.list=r,t.oldIndex=a,t.newIndex=l},getIndex:function(t){return this.options.uniqueKeys.indexOf(t)},dispatchEvent:function(t,e){var n=this.options[t];n&&n(e)}};var b=["size","keeps","scroller","direction","debounceTime","throttleTime"],S="INIT",w="FIXED",x="DYNAMIC",_="FRONT",T="BEHIND",E="STATIONARY",O={vertical:"top",horizontal:"left"},D={vertical:"scrollTop",horizontal:"scrollLeft"},z={vertical:"scrollHeight",horizontal:"scrollWidth"},I={vertical:"offsetHeight",horizontal:"offsetWidth"};function R(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=S,this.calcSize={average:0,fixed:0},this.scrollDirection="",this.updateScrollElement(),this.updateOnScrollFunction(),this.addScrollEventListener(),this.checkIfUpdate(0,t.keeps-1)}return R.prototype={constructor:R,isFront:function(){return this.scrollDirection===_},isBehind:function(){return this.scrollDirection===T},isFixed:function(){return this.calcType===w},getSize:function(t){return this.sizes.get(t)||this.getItemSize()},getOffset:function(){return this.scrollEl[D[this.options.direction]]},getScrollSize:function(){return this.scrollEl[z[this.options.direction]]},getClientSize:function(){return this.scrollEl[I[this.options.direction]]},scrollToOffset:function(t){this.scrollEl[D[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,i=this.options[t];this.options[t]=e,"uniqueKeys"===t&&this.sizes.forEach((function(t,i){e.includes(i)||n.sizes.delete(i)})),"scroller"===t&&(i&&f.utils.off(i,"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){if(this.sizes.get(t)!==e&&(this.sizes.set(t,e),this.calcType===S?(this.calcType=w,this.calcSize.fixed=e):this.isFixed()&&this.calcSize.fixed!==e&&(this.calcType=x,this.calcSize.fixed=0),this.calcType===x&&!this.calcSize.average)){var n=Math.min(this.options.keeps,this.options.uniqueKeys.length);if(this.sizes.size===n){var i=l(this.sizes.values()).reduce((function(t,e){return t+e}),0);this.calcSize.average=Math.round(i/this.sizes.size)}}},addScrollEventListener:function(){this.options.scroller&&f.utils.on(this.options.scroller,"scroll",this.onScroll)},removeScrollEventListener:function(){this.options.scroller&&f.utils.off(this.options.scroller,"scroll",this.onScroll)},enableScroll:function(t){var e=this.options.scroller,n=t?f.utils.off:f.utils.on,i="onwheel"in document.createElement("div")?"wheel":"mousewheel";n(e,"DOMMouseScroll",this.preventDefault),n(e,i,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=this,e=this.options,n=e.debounceTime,i=e.throttleTime;this.onScroll=n?v((function(){return t.handleScroll()}),n):i?g((function(){return t.handleScroll()}),i):function(){return t.handleScroll()}},handleScroll:function(){var t=this.getOffset(),e=this.getClientSize(),n=this.getScrollSize();t===this.offset?this.scrollDirection=E:this.scrollDirection=t<this.offset?_:T,this.offset=t;var i=this.isFront()&&t<=0,o=this.isBehind()&&e+t>=n;this.options.onScroll({top:i,bottom:o,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,i=0,o=0;e<=n;){if(i=e+Math.floor((n-e)/2),(o=this.getOffsetByIndex(i))===t)return i;o<t?e=i+1:o>t&&(n=i-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(s({},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,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,i=e.scroller,o=e.direction;if(i===n)return 0;if(i&&n){var r=i instanceof Window?f.utils.getRect(n):f.utils.getRect(n,!0,i);t=this.offset+r[O[o]]}return t}},n.default.component("virtual-list",{model:{prop:"dataSource",event:"updateDataSource"},props:a,data:function(){return{range:{start:0,end:0,front:0,behind:0},dragging:"",lastList:[],lastLength:null,uniqueKeys:[],virtualRef:null,sortableRef:null}},computed:{isHorizontal:function(){return"vertical"!==this.direction},itemSizeKey:function(){return this.isHorizontal?"offsetWidth":"offsetHeight"},virtualAttributes:function(){var t=this;return b.reduce((function(e,n){return e[n]=t[n],e}),{})},sortableAttributes:function(){var t=this;return p.reduce((function(e,n){return e[n]=t[n],e}),{})}},watch:{dataSource:{handler:function(){this._onUpdate()},deep:!0},virtualAttributes:{handler:function(t,e){if(this.virtualRef)for(var n in t)t[n]!=e[n]&&this.virtualRef.option(n,t[n])}},sortableAttributes:{handler:function(t,e){if(this.sortableRef)for(var n in t)t[n]!=e[n]&&this.sortableRef.option(n,t[n])}}},activated:function(){this.scrollToOffset(this.virtualRef.offset),this.virtualRef.addScrollEventListener()},deactivated:function(){this.virtualRef.removeScrollEventListener()},created:function(){this.range.end=this.keeps-1,this._onUpdate()},mounted:function(){this._installVirtual(),this._installSortable()},beforeDestroy:function(){var t,e;null===(t=this.sortableRef)||void 0===t||t.destroy(),null===(e=this.virtualRef)||void 0===e||e.removeScrollEventListener()},methods:{getSize:function(t){return this.virtualRef.getSize(t)},getOffset:function(){return this.virtualRef.getOffset()},getClientSize:function(){return this.virtualRef.getClientSize()},getScrollSize:function(){return this.virtualRef.getScrollSize()},scrollToKey:function(t){var e=this.uniqueKeys.indexOf(t);e>-1&&this.virtualRef.scrollToIndex(e)},scrollToIndex:function(t){this.virtualRef.scrollToIndex(t)},scrollToOffset:function(t){this.virtualRef.scrollToOffset(t)},scrollToTop:function(){this.virtualRef.scrollToOffset(0)},scrollToBottom:function(){this.virtualRef.scrollToBottom()},_onUpdate:function(){var t;if(this._updateUniqueKeys(),this._updateRange(this.lastList,this.dataSource),null===(t=this.sortableRef)||void 0===t||t.option("list",this.dataSource),this.lastLength&&this.keepOffset){var e=this.dataSource.length-this.lastLength;e>0&&this.scrollToIndex(e),this.lastLength=null}this.lastList=l(this.dataSource)},_updateUniqueKeys:function(){var t,e,n=this;this.uniqueKeys=this.dataSource.map((function(t){return y(t,n.dataKey)})),null===(t=this.virtualRef)||void 0===t||t.option("uniqueKeys",this.uniqueKeys),null===(e=this.sortableRef)||void 0===e||e.option("uniqueKeys",this.uniqueKeys)},_updateRange:function(t,e){var n,i=s({},this.range);e.length>t.length&&this.range.end===t.length-1&&this._scrolledToBottom()&&(i.end++,i.start=Math.max(0,i.end-this.keeps+1)),null===(n=this.virtualRef)||void 0===n||n.updateRange(i)},_scrolledToBottom:function(){return this.getOffset()+this.getClientSize()+1>=this.getScrollSize()},_installVirtual:function(){var t=this;this.virtualRef=new R(s(s({},this.virtualAttributes),{},{buffer:Math.round(this.keeps/3),wrapper:this.$refs.wrapRef,scroller:this.scroller||this.$refs.rootRef,uniqueKeys:this.uniqueKeys,onScroll:function(e){t.lastLength=null,t.dataSource.length&&e.top?t._handleToTop():e.bottom&&t._handleToBottom()},onUpdate:function(e){var n,i=e.start!==t.range.start;t.dragging&&i&&(t.sortableRef.reRendered=!0),t.range=e,null===(n=t.sortableRef)||void 0===n||n.option("range",e),i&&t.$emit("rangeChange",e)}}))},_installSortable:function(){var t=this;this.sortableRef=new m(this.$refs.rootRef,s(s({},this.sortableAttributes),{},{list:this.dataSource,uniqueKeys:this.uniqueKeys,onDrag:function(e){t.dragging=e.key,t.sortable||(t.virtualRef.enableScroll(!1),t.sortableRef.option("autoScroll",!1)),t.$emit("drag",e)},onDrop:function(e){t.dragging="",t.virtualRef.enableScroll(!0),t.sortableRef.option("autoScroll",t.autoScroll),e.changed&&t.$emit("updateDataSource",e.list),t.$emit("drop",e)}}))},_handleToTop:v((function(){this.$emit("top"),this.lastLength=this.dataSource.length})),_handleToBottom:v((function(){this.$emit("bottom")})),_onItemResized:function(t,e){var n=this.virtualRef.sizes.size,i=Math.min(this.keeps,this.dataSource.length);this.virtualRef.onItemResized(t,e),n===i-1&&this._updateRange(this.dataSource,this.dataSource)},_renderSpacer:function(t,e){return this.tableMode?t("tr",{},[t("td",{style:{padding:0,margin:0,border:0,height:"".concat(e,"px")}})]):null},_renderItems:function(t){var e=[],n=this.range,i=n.start,o=n.end,r=n.front,s=n.behind;e.push(this._renderSpacer(t,r));for(var l=i;l<=o;l++){var a=this.dataSource[l];if(a){var c=y(a,this.dataKey);e.push(this.$scopedSlots.item?t(u,{key:c,attrs:{"data-key":c},props:{dataKey:c,sizeKey:this.itemSizeKey},on:{resized:this._onItemResized},style:c==this.dragging&&{display:"none"},class:this.itemClass},this.$scopedSlots.item({record:a,index:l,dataKey:c})):null)}}return e.push(this._renderSpacer(t,s)),e}},render:function(t){var e=this.range,n=e.front,i=e.behind,o=this.tableMode,r=this.isHorizontal,l=this.rootTag,a=this.wrapTag,c=r?"0px ".concat(i,"px 0px ").concat(n,"px"):"".concat(n,"px 0px ").concat(i,"px"),u=r?"auto hidden":"hidden auto",h=o?"tbody":a;return t(o?"table":l,{ref:"rootRef",style:!this.scroller&&!o&&{overflow:u}},[this.$slots.header,t(h,{ref:"wrapRef",class:this.wrapClass,style:s(s({},this.wrapStyle),{},{padding:!o&&c})},this._renderItems(t)),this.$slots.footer])}})})); |
{ | ||
"name": "vue-virtual-draglist", | ||
"version": "2.9.1", | ||
"version": "2.9.2", | ||
"description": "A virtual scrolling list component that can be sorted by dragging", | ||
@@ -39,3 +39,3 @@ "main": "dist/virtual-drag-list.min.js", | ||
"dependencies": { | ||
"sortable-dnd": "^0.6.15" | ||
"sortable-dnd": "latest" | ||
}, | ||
@@ -42,0 +42,0 @@ "devDependencies": { |
@@ -68,3 +68,3 @@ # vue-virtual-draglist | ||
| `drop` | drag is completed | | ||
| `rangeChange` | range changeed | | ||
| `rangeChange` | range changed | | ||
@@ -90,6 +90,7 @@ ## Props | ||
| `group` | `Function/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` | debounce time on scroll | | ||
@@ -108,2 +109,3 @@ | `throttleTime` | `Number` | `0` | throttle time on scroll | | ||
| `autoScroll` | `Boolean` | `true` | Automatic scrolling when moving to the edge of the container | | ||
| `scrollSpeed` | `Object` | `{ x: 10, y: 10 }` | Vertical&Horizontal scrolling speed (px) | | ||
| `scrollThreshold` | `Number` | `55` | Threshold to trigger autoscroll | | ||
@@ -110,0 +112,0 @@ | `delay` | `Number` | `0` | Time in milliseconds to define when the sorting should start | |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
0
135
119849
2057
Updatedsortable-dnd@latest