vue-dndrop
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).VueDndrop={})}(this,function(e){"use strict";var i="smooth-dnd-container-instance",v="smooth-dnd-draggable-wrapper",o="animated",u="__smooth_dnd_draggable_translation_value",a="__smooth_dnd_draggable_visibility_value",f="smooth-dnd-ghost",y="smooth-dnd-container",d="smooth-dnd-stretcher-element",c="smooth-dnd-stretcher-instance",s="smooth-dnd-disable-touch-action",g="smooth-dnd-no-user-select",p="smooth-dnd-drop-preview-default-class",m="smooth-dnd-drop-preview-inner-class",h="smooth-dnd-drop-preview-constant-class",b="smooth-dnd-drop-preview-flex-container-class",w={groupName:void 0,behaviour:"move",orientation:"vertical",getChildPayload:void 0,animationDuration:250,autoScrollEnabled:!0,shouldAcceptDrop:void 0,shouldAnimateDrop:void 0};function x(e){var l=e.element,s=e.draggables;return function(e,t){var n,o=e.removedIndex,i=e.addedIndex,r=e.droppedElement,a=null;null!==o&&(a=l.removeChild(l.children[o]),s.splice(o,1)),null!==i&&((n=window.document.createElement("div")).className="smooth-dnd-draggable-wrapper",n.appendChild(a&&a.firstElementChild?a.firstElementChild:r),o=n,(a=i)>=(r=l).children.length?r.appendChild(o):r.insertBefore(o,r.children[a]),i>=s.length?s.push(n):s.splice(i,0,n)),t&&t(e)}}function r(e,t){var n=window.getComputedStyle(e),e=n.overflow,t=n["overflow-"+t];return"auto"===e||"scroll"===e||("auto"===t||"scroll"===t)}function E(e,t){for(var n=e,o=t||S(e),n=e.parentElement;n;)R(n,"x")&&C(n,"x")&&(o=O(o,n.getBoundingClientRect(),"x")),R(n,"y")&&C(n,"y")&&(o=O(o,n.getBoundingClientRect(),"y")),n=n.parentElement;return o}function D(e,t){return-1<e.className.split(" ").map(function(e){return e}).indexOf(t)}var l={x:"x",y:"y",xy:"xy"},O=function(e,t,n){return"x"===n?{left:Math.max(e.left,t.left),top:e.top,right:Math.min(e.right,t.right),bottom:e.bottom}:{left:e.left,top:Math.max(e.top,t.top),right:e.right,bottom:Math.min(e.bottom,t.bottom)}},S=function(e){var t,n=e.getBoundingClientRect(),n={left:n.left,right:n.right,top:n.top,bottom:n.bottom};return R(e,"x")&&!C(e,"x")&&(t=n.right-n.left,n.right=n.right+e.scrollWidth-t),R(e,"y")&&!C(e,"y")&&(t=n.bottom-n.top,n.bottom=n.bottom+e.scrollHeight-t),n},C=function(e,t){var n=window.getComputedStyle(e),e=n.overflow,t=n["overflow-"+t];return"auto"===e||"scroll"===e||"hidden"===e||("auto"===t||"scroll"===t||"hidden"===t)},R=function(e,t){return"x"===t?e.scrollWidth>e.clientWidth:e.scrollHeight>e.clientHeight},A=function(t,n){var o=[];function e(){o&&(o.forEach(function(e){return e.removeEventListener("scroll",n)}),window.removeEventListener("scroll",n))}return function(){var e=t;for(;e;)(r(e,"x")||r(e,"y"))&&o.push(e),e=e.parentElement}(),{dispose:function(){e(),o=null},start:function(){o&&(o.forEach(function(e){return e.addEventListener("scroll",n)}),window.addEventListener("scroll",n))},stop:e}},B=function(e,t){for(var n=e;n;){if(n.matches(t))return n;n=n.parentElement}return null},I=function(e,t){var n;!e||-1===(n=e.className.split(" ").filter(function(e){return e})).indexOf(t)&&(n.unshift(t),e.className=n.join(" "))},T=function(e,t){var n;e&&(n=e.className.split(" ").filter(function(e){return e&&e!==t}),e.className=n.join(" "))},P=function(){window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():window.document.selection&&window.document.selection.empty()},z=function(e){if(e){e=window.getComputedStyle(e);if(e)return e.cursor}return null};function N(e){return!(e.bottom<=e.top||e.right<=e.left)}var L={size:"offsetWidth",distanceToParent:"offsetLeft",translate:"transform",begin:"left",end:"right",dragPosition:"x",scrollSize:"scrollWidth",offsetSize:"offsetWidth",scrollValue:"scrollLeft",scale:"scaleX",setSize:"width",setters:{translate:function(e){return"translate3d("+e+"px, 0, 0)"}}},M={size:"offsetHeight",distanceToParent:"offsetTop",translate:"transform",begin:"top",end:"bottom",dragPosition:"y",scrollSize:"scrollHeight",offsetSize:"offsetHeight",scrollValue:"scrollTop",scale:"scaleY",setSize:"height",setters:{translate:function(e){return"translate3d(0,"+e+"px, 0)"}}};function F(o){return{get:function(e,t){return e[o[t]||t]},set:function(e,t,n){e[o[t]]=o.setters[t]?o.setters[t](n):n}}}function j(n,l){n["smooth-dnd-extra-size-for-insertion"]=0;var o=F("horizontal"===l?L:M),s={translation:0};function e(){var e,t;i(n),t=(e=n).getBoundingClientRect(),s.scaleX=e.offsetWidth?(t.right-t.left)/e.offsetWidth:1,s.scaleY=e.offsetHeight?(t.bottom-t.top)/e.offsetHeight:1}function i(e){s.rect=S(e);e=E(e,s.rect);N(e)&&(s.lastVisibleRect=s.visibleRect),s.visibleRect=e}function r(e){var t=e;if(t.tagName){t=t.getBoundingClientRect();return"vertical"===l?t.bottom-t.top:t.right-t.left}return o.get(e,"size")*o.get(s,"scale")}function t(e){return o.get(e,"dragPosition")}return window.addEventListener("resize",function(){i(n)}),setTimeout(function(){e()},10),{getSize:r,getContainerRectangles:function(){return{rect:s.rect,visibleRect:s.visibleRect,lastVisibleRect:s.lastVisibleRect}},getBeginEndOfDOMRect:function(e){return{begin:o.get(e,"begin"),end:o.get(e,"end")}},getBeginEndOfContainer:function(){return{begin:o.get(s.rect,"begin")+s.translation,end:o.get(s.rect,"end")+s.translation}},getBeginEndOfContainerVisibleRect:function(){return{begin:o.get(s.visibleRect,"begin")+s.translation,end:o.get(s.visibleRect,"end")+s.translation}},getBeginEnd:function(e){var t=(t=e,(o.get(t,"distanceToParent")+(t[u]||0))*o.get(s,"scale")+(o.get(s.rect,"begin")+s.translation)-o.get(n,"scrollValue"));return{begin:t,end:t+r(e)*o.get(s,"scale")}},getAxisValue:t,setTranslation:function(e,t){t?o.set(e.style,"translate",t):e.style.removeProperty("transform"),e[u]=t},getTranslation:function(e){return e[u]},setVisibility:function(e,t){void 0!==e[a]&&e[a]===t||(t?e.style.removeProperty("visibility"):e.style.visibility="hidden",e[a]=t)},isVisible:function(e){return void 0===e[a]||e[a]},isInVisibleRect:function(e,t){var n=s.visibleRect,o=n.left,i=n.top,r=n.right,a=n.bottom;return a-i<2&&(a=i+30),n=s.rect,"vertical"===l?e>n.left&&e<n.right&&i<t&&t<a:o<e&&e<r&&t>n.top&&t<n.bottom},setSize:function(e,t){o.set(e,"setSize",t)},getTopLeftOfElementBegin:function(e){var t=0;return{top:"horizontal"===l?(t=e,s.rect.top):(t=s.rect.left,e),left:t}},getScrollSize:function(e){return o.get(e,"scrollSize")},getScrollValue:function(e){return o.get(e,"scrollValue")},setScrollValue:function(e,t){return o.set(e,"scrollValue",t)},invalidate:e,invalidateRects:function(){i(n)},getPosition:t,setBegin:function(e,t){o.set(e,"begin",t)}}}var _="x",V="y",X="xy";function k(e,t,n){var o,i,r=n.left,a=n.right,l=n.top,s=n.bottom,n=e.x,e=e.y;if(n<r||a<n||e<l||s<e)return null;s="x"===t?(o=r,i=a,n):(o=l,i=s,e),e=i-o,e=400<e?100:e/4;return i-s<e?{direction:"end",speedFactor:(e-(i-s))/e}:s-o<e?{direction:"begin",speedFactor:(e-(s-o))/e}:null}function Y(e,t,n){e&&(e!==window?"x"===t?e.scrollLeft+=n:e.scrollTop+=n:"x"===t?e.scrollBy(n,0):e.scrollBy(0,n))}function H(o,i){void 0===i&&(i="y");var r=null,a=null,l=null,s=null;return{animate:function(e,t){l=e,s=t,function n(){null===r&&(r=requestAnimationFrame(function(e){var t=e-(a=null===a?e:a);a=e;t=t/1e3*s;Y(o,i,t="begin"===l?0-t:t),r=null,n()}))}()},stop:function(){null!==r&&(cancelAnimationFrame(r),r=null),a=null}}}var t;function n(e){for(var t=[],n=e.element;n;){var o=function(e){var t=window.getComputedStyle(e),e=t.overflow;if("auto"===e||"scroll"===e)return l.xy;e=t["overflow-x"],e="auto"===e||"scroll"===e,t=t["overflow-y"],t="auto"===t||"scroll"===t;return e&&t?l.xy:e?l.x:t?l.y:null}(n);if(o&&!D(n,"smooth-dnd-prevent-auto-scroll-class")){var i={};switch(o){case X:i.x={animator:H(n,"x")},i.y={animator:H(n,"y")};break;case _:i.x={animator:H(n,"x")};break;case V:i.y={animator:H(n,"y")}}t.push({axisAnimations:i,getRect:function(e){return function(){return E(e,e.getBoundingClientRect())}}(n),scrollerElement:n})}n=n.parentElement}return t}function G(e,i){void 0===i&&(i=1500);var r=e.reduce(function(e,t){t=n(t).filter(function(t){return!e.find(function(e){return e.scrollerElement===t.scrollerElement})});return e.concat(t)},[]);return function(e){var t,o,n=e.draggableInfo;e.reset?r.forEach(function(e){e.axisAnimations.x&&e.axisAnimations.x.animator.stop(),e.axisAnimations.y&&e.axisAnimations.y.animator.stop()}):n&&(o=n.mousePosition,r.forEach(function(e){var t=e.axisAnimations,n=(0,e.getRect)();t.x&&(t.x.scrollParams=k(o,"x",n),e.cachedRect=n),t.y&&(t.y.scrollParams=k(o,"y",n),e.cachedRect=n)}),r.forEach(function(e){var t,n=e.axisAnimations,o=n.x,e=n.y;o&&(o.scrollParams?(n=(t=o.scrollParams).direction,t=t.speedFactor,o.animator.animate(n,t*i)):o.animator.stop()),e&&(e.scrollParams?(o=(t=e.scrollParams).direction,t=t.speedFactor,e.animator.animate(o,t*i)):e.animator.stop())}),(e=r.filter(function(e){return e.cachedRect})).length&&1<e.length&&((t=function(e,t){for(var n=document.elementFromPoint(t.x,t.y);n;){var o=e.find(function(e){return e.scrollerElement===n});if(o)return o;n=n.parentElement}return null}(e,n.mousePosition))&&e.forEach(function(e){e!==t&&(e.axisAnimations.x&&e.axisAnimations.x.animator.stop(),e.axisAnimations.y&&e.axisAnimations.y.animator.stop())})))}}"undefined"!=typeof window&&((t=Element)&&t.prototype&&!t.prototype.matches&&(t.prototype.matches=t.prototype.matchesSelector||t.prototype.mozMatchesSelector||t.prototype.msMatchesSelector||t.prototype.oMatchesSelector||t.prototype.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),n=t.length;0<=--n&&t.item(n)!==this;);return-1<n}),Array.prototype.some||(Array.prototype.some=function(e){if(null==this)throw new TypeError("Array.prototype.some called on null or undefined");if("function"!=typeof e)throw new TypeError;for(var t=Object(this),n=t.length>>>0,o=2<=arguments.length?arguments[1]:void 0,i=0;i<n;i++)if(i in t&&e.call(o,t[i],i,t))return!0;return!1}));var $={overflow:"hidden",display:"block"},W={height:"100%",display:"table-cell","vertical-align":"top"},q={};function U(o){return Object.keys(o).reduce(function(e,t){var n=o[t];return"object"==typeof n?""+e+t+"{"+U(n)+"}":""+e+t+":"+n+";"},"")}function J(e){if(e&&"undefined"!=typeof window){var t=window.document.head||window.document.getElementsByTagName("head")[0],n=window.document.createElement("style"),e=U({"body *":{cursor:e+" !important"}});return n.type="text/css",n.styleSheet?n.styleSheet.cssText=e:n.appendChild(window.document.createTextNode(e)),t.appendChild(n),n}return null}q["."+y]={position:"relative","min-height":"30px","min-width":"30px"},q["."+y+".horizontal"]={display:"table"},q["."+y+".horizontal > ."+d]={display:"inline-block"},q["."+y+".horizontal > ."+v]=W,q["."+y+".vertical > ."+v]=$,q["."+v]={"box-sizing":"border-box"},q["."+v+".horizontal"]=W,q["."+v+".vertical"]=$,q["."+v+".animated"]={transition:"transform ease"},q["."+f]={"box-sizing":"border-box"},q["."+f+".animated"]={transition:"all ease-in-out"},q["."+f+" *"]={"pointer-events":"none"},q["."+s+" *"]={"touch-action":"none","-ms-touch-action":"none"},q["."+g]={"-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none"},q["."+m]={flex:"1"},q["."+y+".horizontal > ."+h]={height:"100%",overflow:"hidden",display:"table-cell","vertical-align":"top"},q["."+y+".vertical > ."+h]={overflow:"hidden",display:"block",width:"100%"},q["."+b]={width:"100%",height:"100%",display:"flex","justify-content":"stretch","align-items":"stretch"},q["."+p]={"background-color":"rgba(150, 150, 150, 0.1)",border:"1px solid #ccc"};var K,Q,Z=["mousedown","touchstart"],ee=["mousemove","touchmove"],te=["mouseup","touchend"],ne=null,oe=null,ie=null,re=null,ae=[],le=!1,se=!1,ue=!1,de=!1,ce=null,fe=null,ge=null,pe=null,me=(K=null,Q=!1,{start:function(){Q||(Q=!0,function e(){K=requestAnimationFrame(function(){ne.forEach(function(e){return e.layout.invalidateRects()}),setTimeout(function(){null!==K&&e()},50)})}())},stop:function(){null!==K&&(cancelAnimationFrame(K),K=null),Q=!1}}),he="undefined"!=typeof window&&!!(window.navigator.userAgent.match(/Android/i)||window.navigator.userAgent.match(/webOS/i)||window.navigator.userAgent.match(/iPhone/i)||window.navigator.userAgent.match(/iPad/i)||window.navigator.userAgent.match(/iPod/i)||window.navigator.userAgent.match(/BlackBerry/i)||window.navigator.userAgent.match(/Windows Phone/i));function ve(){"undefined"!=typeof window&&Z.forEach(function(e){window.document.addEventListener(e,ze,{passive:!1})})}function ye(){return re&&re.ghostParent?re.ghostParent:oe&&oe.parentElement||window.document.body}function be(e,t,n,o){var i=t.x,r=t.y,a=e.getBoundingClientRect(),l=a.left,s=a.top,u=a.right,d=a.bottom,t=(t=n.layout.getContainerRectangles().visibleRect,a=a,{left:Math.max(t.left,a.left),top:Math.max(t.top,a.top),right:Math.min(t.right,a.right),bottom:Math.min(t.bottom,a.bottom)}),a=t.left+(t.right-t.left)/2,t=t.top+(t.bottom-t.top)/2,c=e.cloneNode(!0);return c.style.zIndex="1000",c.style.boxSizing="border-box",c.style.position="fixed",c.style.top="0px",c.style.left="0px",c.style.transform="none",c.style.removeProperty("transform"),n.shouldUseTransformForGhost()?c.style.transform="translate3d("+l+"px, "+s+"px, 0)":(c.style.top=s+"px",c.style.left=l+"px"),c.style.width=u-l+"px",c.style.height=d-s+"px",c.style.overflow="visible",c.style.transition=null,c.style.removeProperty("transition"),c.style.pointerEvents="none",c.style.userSelect="none",n.getOptions().dragClass?setTimeout(function(){I(c.firstElementChild,n.getOptions().dragClass);var e=window.getComputedStyle(c.firstElementChild).cursor;pe=J(e)}):pe=J(o),I(c,n.getOptions().orientation||"vertical"),I(c,f),{ghost:c,centerDelta:{x:a-i,y:t-r},positionDelta:{left:l-i,top:s-r},topLeft:{x:l,y:s}}}function we(e){function i(){T(ie.ghost,"animated"),ie.ghost.style.transitionDuration=null,ye().removeChild(ie.ghost),e()}function t(e,t,n){var o=e.top,e=e.left;I(ie.ghost,"animated"),n&&I(ie.ghost.firstElementChild,n),ie.topLeft.x=e,ie.topLeft.y=o,Qe(t),setTimeout(function(){i()},t+20)}function n(e,t){I(ie.ghost,"animated"),Qe(e,.9,!0),setTimeout(function(){t()},e+20)}var o,r,a,l,s,u;re.targetElement?(o=ae.filter(function(e){return e.element===re.targetElement})[0],!(u=o.getOptions()).shouldAnimateDrop||u.shouldAnimateDrop(re.container.getOptions(),re.payload)?t(o.getDragResult().shadowBeginEnd.rect,Math.max(150,o.getOptions().animationDuration/2),o.getOptions().dropClass):i()):(r=ae.filter(function(e){return e===re.container})[0])?(l=(a=r.getOptions()).behaviour,s=a.removeOnDropOut,"move"!==l&&"contain"!==l||!se&&s||!r.getDragResult()?n(r.getOptions().animationDuration,i):!N((a=r.layout.getContainerRectangles()).visibleRect)&&N(a.lastVisibleRect)?t({top:a.lastVisibleRect.top,left:a.lastVisibleRect.left},r.getOptions().animationDuration,r.getOptions().dropClass):(s=(l=r.getDragResult()).removedIndex,a=l.elementSize,l=r.layout,r.getTranslateCalculator({dragResult:{removedIndex:s,addedIndex:s,elementSize:a,pos:void 0,shadowBeginEnd:void 0}}),s=0<s?l.getBeginEnd(r.draggables[s-1]).end:l.getBeginEndOfContainer().begin,t(l.getTopLeftOfElementBegin(s),r.getOptions().animationDuration,r.getOptions().dropClass))):n(w.animationDuration,i)}var xe,Ee,De,Oe,Se,Ce,Re=(Se=1,Ce=5,function(e,t,n){xe=ke(e),De=n,(Ee="number"==typeof t?t:he?200:0)&&(Oe=setTimeout(Pe,Ee)),ee.forEach(function(e){return window.document.addEventListener(e,Ae)},{passive:!1}),te.forEach(function(e){return window.document.addEventListener(e,Be)},{passive:!1}),window.document.addEventListener("drag",Ie,{passive:!1})});function Ae(e){var t=ke(e),e=t.clientX,t=t.clientY;if(Ee)(Math.abs(xe.clientX-e)>Ce||Math.abs(xe.clientY-t)>Ce)&&Te();else if(Math.abs(xe.clientX-e)>Se||Math.abs(xe.clientY-t)>Se)return Pe()}function Be(){Te()}function Ie(){Te()}function Te(){clearTimeout(Oe),ee.forEach(function(e){return window.document.removeEventListener(e,Ae)},{passive:!1}),te.forEach(function(e){return window.document.removeEventListener(e,Be)},{passive:!1}),window.document.removeEventListener("drag",Ie,{passive:!1})}function Pe(){clearTimeout(Oe),Te(),De()}function ze(e){var t,n,o,i,r,a,l=ke(e);le||void 0!==l.button&&0!==l.button||(oe=B(l.target,"."+v))&&(t=B(oe,"."+y),o=(n=ae.filter(function(e){return e.element===t})[0]).getOptions().dragHandleSelector,i=n.getOptions().nonDragAreaSelector,r=!0,o&&!B(l.target,o)&&(r=!1),(r=i&&B(l.target,i)?!1:r)&&(n.layout.invalidate(),I(window.document.body,s),I(window.document.body,g),a=function(){T(window.document.body,s),T(window.document.body,g),window.document.removeEventListener("mouseup",a)},window.document.addEventListener("mouseup",a)),r&&Re(l,n.getOptions().dragBeginDelay,function(){P(),We(l,z(e.target)),ee.forEach(function(e){window.document.addEventListener(e,Ne,{passive:!1})}),te.forEach(function(e){window.document.addEventListener(e,Xe,{passive:!1})})}))}function Ne(e){e.preventDefault();var t,n=ke(e);re?("contain"===(t=re.container.getOptions()).behaviour?function(e,t){var n=e.clientX,o=e.clientY;void 0===t&&(t="vertical");var i,r,e=re.container.layout.getBeginEndOfContainerVisibleRect(),t="vertical"===t?(i=o,r="y",a="top",re.size.offsetHeight):(i=n,r="x",a="left",re.size.offsetWidth),o=e.begin,n=e.end-t,a=Math.max(o,Math.min(n,i+ie.positionDelta[a]));ie.topLeft[r]=a,re.position[r]=Math.max(e.begin,Math.min(e.end,i+ie.centerDelta[r])),re.mousePosition[r]=Math.max(e.begin,Math.min(e.end,i)),re.position[r]<e.begin+t/2&&(re.position[r]=e.begin+2),re.position[r]>e.end-t/2&&(re.position[r]=e.end-2)}(n,t.orientation):ge?"y"===ge?(ie.topLeft.y=n.clientY+ie.positionDelta.top,re.position.y=n.clientY+ie.centerDelta.y,re.mousePosition.y=n.clientY):"x"===ge&&(ie.topLeft.x=n.clientX+ie.positionDelta.left,re.position.x=n.clientX+ie.centerDelta.x,re.mousePosition.x=n.clientX):(ie.topLeft.x=n.clientX+ie.positionDelta.left,ie.topLeft.y=n.clientY+ie.positionDelta.top,re.position.x=n.clientX+ie.centerDelta.x,re.position.y=n.clientY+ie.centerDelta.y,re.mousePosition.x=n.clientX,re.mousePosition.y=n.clientY),Qe(),(de=!ce(re))&&_e()):We(n,z(e.target))}var Le,Me,Fe,je,_e=(Le=Ve,Fe=!(Me=20),function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];je&&clearTimeout(je),Fe&&!je?Le.call.apply(Le,[null].concat(e)):je=setTimeout(function(){je=null,Le.call.apply(Le,[null].concat(e))},Me)});function Ve(){de&&(de=!1,Ye(re,ne))}function Xe(){var e;ee.forEach(function(e){window.document.removeEventListener(e,Ne,{passive:!1})}),te.forEach(function(e){window.document.removeEventListener(e,Xe,{passive:!1})}),fe({reset:!0}),pe&&((e=pe)&&"undefined"!=typeof window&&(window.document.head||window.document.getElementsByTagName("head")[0]).removeChild(e),pe=null),re&&(me.stop(),Ve(),ue=!0,we(function(){$e(le=!1);for(var e=ne||[],t=e.shift();void 0!==t;)t.handleDrop(re),t=e.shift();ce=ge=re=ie=oe=ne=null,ue=!1}))}function ke(e){return e.touches?e.touches[0]:e}function Ye(t,e){var n=!1;e.forEach(function(e){e=e.handleDrag(t);n=!!e.containerBoxChanged||!1,e.containerBoxChanged=!1}),n&&(n=!1,requestAnimationFrame(function(){ae.forEach(function(e){e.layout.invalidateRects(),e.onTranslated()})}))}function He(e){var t=e,n=null;return function(e){return!(null!==n||!le||ue)&&(n=requestAnimationFrame(function(){le&&!ue&&(Ye(e,t),fe({draggableInfo:e})),n=null}),!0)}}function Ge(e,t){return e.getOptions().autoScrollEnabled?G(t,e.getScrollMaxSpeed()):function(e){return null}}function $e(o){var i=re.container,r=re.payload;ae.forEach(function(e){var t,n;i.getOptions().fireRelatedEventsOnly&&e!==i||(t=(n=e.getOptions()).onDragStart,n=n.onDragEnd,(t=o?t:n)&&(n={isSource:e===i,payload:r,willAcceptDrop:!1},e.isDragRelevant(i,r)&&(n.willAcceptDrop=!0),t(n)))})}function We(e,t){var n,o,i,r,a,l;null!==oe&&(le=!0,(n=ae.filter(function(e){return oe.parentElement===e.element})[0]).setDraggables(),ge=n.getOptions().lockAxis?n.getOptions().lockAxis.toLowerCase():null,o=oe,i=ae.filter(function(e){return o.parentElement===e.element})[0],r=i.draggables.indexOf(o),a=i.getOptions().getGhostParent,l=o.getBoundingClientRect(),re={container:i,element:o,size:{offsetHeight:l.bottom-l.top,offsetWidth:l.right-l.left},elementIndex:r,payload:i.getOptions().getChildPayload?i.getOptions().getChildPayload(r):void 0,targetElement:null,position:{x:0,y:0},groupName:i.getOptions().groupName,ghostParent:a?a():null,invalidateShadow:null,mousePosition:null,relevantContainers:null},ie=be(oe,{x:e.clientX,y:e.clientY},re.container,t),re.position={x:e.clientX+ie.centerDelta.x,y:e.clientY+ie.centerDelta.y},re.mousePosition={x:e.clientX,y:e.clientY},ne=ae.filter(function(e){return e.isDragRelevant(n,re.payload)}),re.relevantContainers=ne,ce=He(ne),fe&&fe({reset:!0,draggableInfo:void 0}),fe=Ge(n,ne),ne.forEach(function(e){return e.prepareDrag(e,ne)}),$e(!0),ce(re),ye().appendChild(ie.ghost),me.start())}var qe,Ue,Je,Ke=je=Oe=null;function Qe(e,t,n){void 0===e&&(e=0),void 0===t&&(t=1),void 0===n&&(n=!1);var o=ie.ghost,i=ie.topLeft,r=i.x,a=i.y,l=!re.container||re.container.shouldUseTransformForGhost(),s=l?"translate3d("+r+"px,"+a+"px, 0)":null;if(1!==t&&(s=s?s+" scale("+t+")":"scale("+t+")"),0<e)return ie.ghost.style.transitionDuration=e+"ms",void requestAnimationFrame(function(){s&&(o.style.transform=s),l||(o.style.left=r+"px",o.style.top=a+"px"),Ke=null,n&&(o.style.opacity="0")});null===Ke&&(Ke=requestAnimationFrame(function(){s&&(o.style.transform=s),l||(o.style.left=r+"px",o.style.top=a+"px"),Ke=null,n&&(o.style.opacity="0")}))}function Ze(){var t;!le||se||ue||(de=!(se=!0),t=Object.assign({},re,{targetElement:null,position:{x:Number.MAX_SAFE_INTEGER,y:Number.MAX_SAFE_INTEGER},mousePosition:{x:Number.MAX_SAFE_INTEGER,y:Number.MAX_SAFE_INTEGER}}),ne.forEach(function(e){e.handleDrag(t)}),re&&(re.targetElement=null,re.cancelDrop=!0,Xe(),se=!1))}"undefined"!=typeof window&&"undefined"!=typeof window&&(qe=window.document.head||window.document.getElementsByTagName("head")[0],(Ue=window.document.createElement("style")).id="smooth-dnd-style-definitions",Je=U(q),Ue.type="text/css",Ue.styleSheet?Ue.styleSheet.cssText=Je:Ue.appendChild(window.document.createTextNode(Je)),qe.appendChild(Ue));var et=(ve(),{register:function(e){e=e,ae.push(e),le&&re&&e.isDragRelevant(re.container,re.payload)&&(ne.push(e),e.prepareDrag(e,ne),fe&&fe({reset:!0,draggableInfo:void 0}),fe=Ge(e,ne),ce=He(ne),e.handleDrag(re))},unregister:function(e){var t;t=e,ae.splice(ae.indexOf(t),1),le&&re&&(re.container===t&&t.fireRemoveElement(),re.targetElement===t.element&&(re.targetElement=null),-1<(e=ne.indexOf(t))&&(ne.splice(e,1),fe&&fe({reset:!0,draggableInfo:void 0}),fe=Ge(t,ne),ce=He(ne)))},isDragging:function(){return le},cancelDrag:Ze});function tt(e,t,n){void 0===n&&(n=w.animationDuration),t?(I(e,o),e.style.transitionDuration=n+"ms"):(T(e,o),e.style.removeProperty("transition-duration"))}function nt(n){var o=[];return Array.prototype.forEach.call(n.children,function(e){var t;e.nodeType===Node.ELEMENT_NODE?((t=!D(t=e,v)?function(e){if(St.wrapChild){var t=window.document.createElement("div");return t.className=""+v,e.parentElement.insertBefore(t,e),t.appendChild(e),t}return e}(e):t)[u]=0,o.push(t)):n.removeChild(e)}),o}function ot(e){function s(e,t,n,o,i){if(void 0===i&&(i=!1),o<n)return n;if(n!==o)return r=Math.floor((o+n)/2),l=u.getBeginEnd(e[r]),a=l.begin,l=l.end,t<a?s(e,t,n,r-1,i):l<t?s(e,t,r+1,o,i):!i||t<(l+a)/2?r:r+1;var r=u.getBeginEnd(e[n]),a=r.begin,l=r.end;return!i||t<(l+a)/2?n:n+1}var u=e.layout;return function(e,t,n){return s(e,t,0,e.length-1,n=void 0===n?!1:n)}}function it(e){var t,n,o,i=e.element,r=e.draggables,a=e.layout,l=e.getOptions,s=(t=(e={element:i,draggables:r,layout:a,getOptions:l}).element,n=e.draggables,o=e.layout,function(){n.forEach(function(e){tt(e,!1),o.setTranslation(e,0),o.setVisibility(e,!0)}),t[c]&&(t[c].parentNode.removeChild(t[c]),t[c]=null)}),u=(St.dropHandler||x)({element:i,draggables:r,layout:a,getOptions:l});return function(e,t,n){var o=t.addedIndex,t=t.removedIndex;if(void 0===n&&(n=!1),s(),e&&!e.cancelDrop)if(e.targetElement||l().removeOnDropOut||n){var n=function(e){return null!==e},o=n(o)?n(t)&&t<o?o-1:o:null,i={removedIndex:t,addedIndex:o,payload:e.payload};(!e.container.getOptions().fireRelatedEventsOnly||n(t)||n(o))&&u(i,l().onDrop)}else if(l().dropNotAllowed){i=e.payload,e=e.container;return l().dropNotAllowed({payload:i,container:e})}}}function rt(e){var n=e.element,o=e.getOptions,i=null;return function(e){var t=e.draggableInfo,e=i;return{removedIndex:e=null==i&&t.container.element===n&&"copy"!==o().behaviour?i=t.elementIndex:e}}}function at(e){var t=e.draggables,n=e.layout;return function(e){e=e.dragResult;null!==e.removedIndex&&n.setVisibility(t[e.removedIndex],!1)}}function lt(e){var n=e.element,o=e.layout;return function(e){var t=e.draggableInfo,e=document.elementFromPoint(t.position.x,t.position.y);if(e){e=function(e,t){for(var n=e;n;){if(n[i]){var o=n[i];if(t.some(function(e){return e===o}))return o}n=n.parentElement}return null}(e,t.relevantContainers);if(e&&e.element===n)return{pos:o.getPosition(t.position)}}return{pos:null}}}function st(e){var n=e.layout,o=null;return function(e){var t=e.draggableInfo;return null===e.dragResult.pos?o=null:{elementSize:o=o||n.getSize(t.size)}}}function ut(e){var o=e.element;return function(e){var t=e.draggableInfo,n=e.dragResult;e=t,t=o,void 0===(n=!!n.pos)&&(n=!0),t&&n?e.targetElement=t:e.targetElement===t&&(e.targetElement=null)}}function dt(){return function(e){return null!==e.dragResult.pos?{addedIndex:0}:{addedIndex:null}}}function ct(e){var t=e.layout,n=null;return function(e){e=e.dragResult.addedIndex;if(e===n)return null;n=e;e=t.getBeginEndOfContainer().begin;return{shadowBeginEnd:{rect:t.getTopLeftOfElementBegin(e)}}}}function ft(e){var u=e.layout,d=e.element,c=e.getOptions,f=null;return function(e){var t=e.dragResult,n=t.elementSize,o=t.shadowBeginEnd,i=t.addedIndex,r=t.dropPlaceholderContainer,a=c();if(a.dropPlaceholder){var l="boolean"==typeof a.dropPlaceholder?{}:a.dropPlaceholder,s=l.animationDuration,e=l.className,t=l.showOnTop;return null===i?(r&&null!==f&&d.removeChild(r),f=null,{dropPlaceholderContainer:void 0}):(r||(a=document.createElement("div"),(l=document.createElement("div")).className=b,a.className=m+" "+(e||p),(r=document.createElement("div")).className=h,r.style.position="absolute",void 0!==s&&(r.style.transition="all "+s+"ms ease"),r.appendChild(l),l.appendChild(a),u.setSize(r.style,n+"px"),r.style.pointerEvents="none",t?d.appendChild(r):d.insertBefore(r,d.firstElementChild)),f!==i&&o.dropArea&&u.setBegin(r.style,o.dropArea.begin-u.getBeginEndOfContainer().begin+"px"),f=i,{dropPlaceholderContainer:r})}return null}}function gt(e){var n=yt(e);return function(e){var t=e.draggableInfo,e=e.dragResult;return t.invalidateShadow?n({draggableInfo:t,dragResult:e}):null}}function pt(e){var n,o,i=(n=e.draggables,o=ot({layout:e.layout}),function(e){var t=e.dragResult,e=t.shadowBeginEnd,t=t.pos;if(e)return e.begin+e.beginAdjustment<=t&&e.end>=t?null:t<e.begin+e.beginAdjustment?o(n,t):t>e.end?o(n,t)+1:n.length;t=o(n,t,!0);return null!==t?t:n.length});return function(e){var t=e.dragResult,e=null;return{addedIndex:e=null!==t.pos&&null===(e=i({dragResult:t}))?t.addedIndex:e}}}function mt(){var n=null;return function(e){var t=e.dragResult,e=t.addedIndex,t=t.shadowBeginEnd;e!==n&&null!==n&&t&&(t.beginAdjustment=0),n=e}}function ht(e){var i=e.element,r=e.draggables,a=e.layout,l=e.getOptions,s=null;return function(e){var t=e.dragResult,n=t.addedIndex,e=t.removedIndex,t=t.elementSize;if(null===e)if(null!==n){if(!s){e=a.getBeginEndOfContainer();e.end=e.begin+a.getSize(i);n=a.getScrollSize(i)>a.getSize(i)?e.begin+a.getScrollSize(i)-a.getScrollValue(i):e.end,e=0<r.length?a.getBeginEnd(r[r.length-1]).end-r[r.length-1][u]:e.begin;if(n<e+t){(s=window.document.createElement("div")).className=d+" "+l().orientation;var o=0<r.length?t+e-n:t;return a.setSize(s.style,o+"px"),i.appendChild(s),i[c]=s,{containerBoxChanged:!0}}}}else if(s){a.setTranslation(s,0);o=s;return s=null,i.removeChild(o),{containerBoxChanged:!(i[c]=null)}}}}function vt(e){var l=e.draggables,s=e.layout,u=null,d=null;return function(e){var e=e.dragResult,t=e.addedIndex,n=e.removedIndex,o=e.elementSize;if(t!==u||n!==d){for(var i,r,a=0;a<l.length;a++)a!==n&&(i=l[a],r=0,null!==n&&n<a&&(r-=o),null!==t&&t<=a&&(r+=o),s.setTranslation(i,r));return{addedIndex:u=t,removedIndex:d=n}}}}function yt(e){var c=e.draggables,f=e.layout,g=null;return function(e){var t=e.draggableInfo,n=e.dragResult,o=n.addedIndex,i=n.removedIndex,r=n.elementSize,a=n.pos,l=n.shadowBeginEnd;if(null===a)return{shadowBeginEnd:g=null};if(null===o||!t.invalidateShadow&&o===g)return null;var s=o-1,u=Number.MIN_SAFE_INTEGER,e=0,n=0,a=null,t=null;s===i&&s--;var e=-1<s?(d=f.getSize(c[s]),t=f.getBeginEnd(c[s]),u=r<d?t.end-(d-r)/2:t.end,t.end):(t={end:f.getBeginEndOfContainer().begin},f.getBeginEndOfContainer().begin),s=Number.MAX_SAFE_INTEGER,d=o;d===i&&d++;n=d<c.length?(i=f.getSize(c[d]),a=f.getBeginEnd(c[d]),s=r<i?a.begin+(i-r)/2:a.begin,a.begin):(a={begin:f.getContainerRectangles().rect.end},f.getContainerRectangles().rect.end-f.getContainerRectangles().rect.begin),t=t&&a?f.getTopLeftOfElementBegin(t.end):null;return g=o,{shadowBeginEnd:{dropArea:{begin:e,end:n},begin:u,end:s,rect:t,beginAdjustment:l?l.beginAdjustment:0}}}}function bt(){var o=null;return function(e){var t=e.dragResult,n=t.pos,e=t.addedIndex,t=t.shadowBeginEnd;null!==n?null!=e&&null===o&&(n<t.begin&&(n=n-t.begin-5,t.beginAdjustment=n),o=e):o=null}}function wt(e){var e=e.getOptions,t=!1,n=e();return function(e){e=!!e.dragResult.pos;e!==t&&((t=e)?n.onDragEnter&&n.onDragEnter():n.onDragLeave&&n.onDragLeave())}}function xt(e){var e=e.getOptions,r=null,a=e();return function(e){var t=e.dragResult,n=t.addedIndex,o=t.removedIndex,i=e.draggableInfo,t=i.payload,e=i.element;a.onDropReady&&null!==n&&r!==n&&(i=r=n,null!==o&&o<n&&i--,a.onDropReady({addedIndex:i,removedIndex:o,payload:t,element:e?e.firstElementChild:void 0}))}}function Et(e){return"drop-zone"===e.getOptions().behaviour?Dt(e)(rt,at,lt,st,ut,dt,ct,wt,xt):Dt(e)(rt,at,lt,st,ut,gt,pt,mt,ht,vt,yt,ft,bt,wt,xt)}function Dt(n){return function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var o=e.map(function(e){return e(n)}),i=null;return function(n){return i=o.reduce(function(e,t){return Object.assign(e,t({draggableInfo:n,dragResult:e}))},i||{addedIndex:null,removedIndex:null,elementSize:null,pos:null,shadowBeginEnd:null})}}}function Ot(h){return function(e){var t,n,o,i,r,a=Object.assign({},w,e),l=null,s=null,u=(n=m,o=nt(t=h),e=n(),I(t,y+" "+e.orientation),{element:t,draggables:o,getOptions:n,layout:j(t,e.orientation,e.animationDuration)}),d=Et(u),c=it(u),f=A(h,function(){u.layout.invalidateRects(),g()});function g(){null!==s&&(s.invalidateShadow=!0,l=d(s),s.invalidateShadow=!1)}function p(e,t){for(var n=nt(t),o=0;o<n.length;o++)e[o]=n[o];for(var i=0;i<e.length-n.length;i++)e.pop()}function m(){return a}return{element:h,draggables:u.draggables,isDragRelevant:(i=(e=u).element,r=e.getOptions,function(e,t){var n=r();if(n.shouldAcceptDrop)return n.shouldAcceptDrop(e.getOptions(),t);t=e.getOptions();return"copy"!==n.behaviour&&(B(i,"."+v)!==e.element&&(e.element===i||!(!t.groupName||t.groupName!==n.groupName)))}),layout:u.layout,dispose:function(e){var t;f.dispose(),t=e.element,St.wrapChild&&Array.prototype.forEach.call(t.children,function(e){e.nodeType===Node.ELEMENT_NODE&&D(e,v)&&(t.insertBefore(e.firstElementChild,e),t.removeChild(e))})},prepareDrag:function(e,t){var n=e.element,o=u.draggables;p(o,n),e.layout.invalidateRects(),o.forEach(function(e){return tt(e,!0,a.animationDuration)}),f.start()},handleDrag:function(e){return l=d(s=e)},handleDrop:function(e){f.stop(),l&&l.dropPlaceholderContainer&&h.removeChild(l.dropPlaceholderContainer),s=null,d=Et(u),c(e,l),l=null},fireRemoveElement:function(){c(s,Object.assign({},l,{addedIndex:null}),!0),l=null},getDragResult:function(){return l},getTranslateCalculator:function(e){return vt(u)(e)},onTranslated:function(){g()},setDraggables:function(){p(u.draggables,h)},getScrollMaxSpeed:function(){return St.maxScrollSpeed},shouldUseTransformForGhost:function(){return!0===St.useTransformForGhost},getOptions:m,setOptions:function(e,t){a=!1===(t=void 0===t?!0:t)?Object.assign({},w,e):Object.assign({},w,a,e)}}}}var St=function(e,t){var n=Ot(e)(t);return e[i]=n,et.register(n),{dispose:function(){et.unregister(n),n.dispose(n)},setOptions:function(e,t){n.setOptions(e,t)}}};St.wrapChild=!0,St.cancelDrag=function(){et.cancelDrag()},St.isDragging=function(){return et.isDragging()};function Ct(e,t){e=e.$props.tag;if(e){if("string"==typeof e){var n={value:e};return t&&(n.props={class:t}),n}if("object"==typeof e){n={value:e.value||"div",props:e.props||{}};return t&&(n.props.class?(e=n.props.class,"[object Array]"===Object.prototype.toString.call(e)?n.props.class.push(t):n.props.class=[t,n.props.class]):n.props.class=t),n}}return{value:"div"}}function Rt(e){return!e||("string"==typeof e||"object"==typeof e&&("string"==typeof e.value||"function"==typeof e.value||"object"==typeof e.value))}St.dropHandler=function(){return function(e,t){t&&t(e)}},St.wrapChild=!1;var At={drop:"onDrop","drag-end":"onDragEnd","drag-start":"onDragStart","drag-enter":"onDragEnter","drag-leave":"onDragLeave","drop-ready":"onDropReady","drop-not-allowed":"dropNotAllowed"};function Bt(e){var i,r,t=Object.assign({},e.$props,e.$listeners);return i=t,r=e,Object.keys(i).reduce(function(e,t){var n=t,o=i[n];return void 0!==o&&("function"==typeof o?At[n]?e[At[n]]=function(e){r.$emit(n,e)}:e[n]=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return o.apply(void 0,e)}:e[n]=o),e},{})}W={name:"Container",mounted:function(){this.containerElement=this.$refs.container||this.$el,this.container=St(this.containerElement,Bt(this))},updated:function(){if(this.$refs.container!==this.containerElement&&this.$el!==this.containerElement)return this.container&&this.container.dispose(),this.containerElement=this.$refs.container||this.$el,void(this.container=St(this.containerElement,Bt(this)));this.container.setOptions(Bt(this))},destroyed:function(){this.container&&this.container.dispose()},props:{behaviour:String,groupName:String,orientation:String,dragHandleSelector:String,nonDragAreaSelector:String,dragBeginDelay:Number,animationDuration:Number,autoScrollEnabled:{type:Boolean,default:!0},lockAxis:String,dragClass:String,dropClass:String,removeOnDropOut:{type:Boolean,default:!1},"drag-start":Function,"drag-end":Function,drop:Function,getChildPayload:Function,shouldAnimateDrop:Function,fireRelatedEventsOnly:{type:Boolean,default:!1},shouldAcceptDrop:Function,"drag-enter":Function,"drag-leave":Function,tag:{validator:Rt,default:"div"},getGhostParent:Function,"drop-ready":Function,dropPlaceholder:[Object,Boolean]},render:function(e){var t=Ct(this);return e(t.value,Object.assign({},{ref:"container"},t.props),this.$slots.default)}},$={name:"Draggable",props:{tag:{validator:Rt,default:"div"}},render:function(e){return t=e,e=Ct(n=this,"smooth-dnd-draggable-wrapper"),t(e.value,Object.assign({},e.props),n.$slots.default);var t,n}};e.Container=W,e.Draggable=$,e.smoothDnD=St,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).VueDndrop={})}(this,function(e){"use strict";var i="dndrop-container-instance",v="dndrop-draggable-wrapper",o="animated",u="__smooth_dnd_draggable_translation_value",a="__smooth_dnd_draggable_visibility_value",f="dndrop-ghost",y="dndrop-container",d="dndrop-stretcher-element",c="dndrop-stretcher-instance",s="dndrop-disable-touch-action",g="dndrop-no-user-select",p="dndrop-drop-preview-default-class",m="dndrop-drop-preview-inner-class",h="dndrop-drop-preview-constant-class",b="dndrop-drop-preview-flex-container-class",w={groupName:void 0,behaviour:"move",orientation:"vertical",getChildPayload:void 0,animationDuration:250,autoScrollEnabled:!0,shouldAcceptDrop:void 0,shouldAnimateDrop:void 0};function x(e){var l=e.element,s=e.draggables;return function(e,t){var n,o=e.removedIndex,i=e.addedIndex,r=e.droppedElement,a=null;null!==o&&(a=l.removeChild(l.children[o]),s.splice(o,1)),null!==i&&((n=window.document.createElement("div")).className="dndrop-draggable-wrapper",n.appendChild(a&&a.firstElementChild?a.firstElementChild:r),o=n,(a=i)>=(r=l).children.length?r.appendChild(o):r.insertBefore(o,r.children[a]),i>=s.length?s.push(n):s.splice(i,0,n)),t&&t(e)}}function r(e,t){var n=window.getComputedStyle(e),e=n.overflow,t=n["overflow-"+t];return"auto"===e||"scroll"===e||("auto"===t||"scroll"===t)}function E(e,t){for(var n=e,o=t||S(e),n=e.parentElement;n;)R(n,"x")&&C(n,"x")&&(o=O(o,n.getBoundingClientRect(),"x")),R(n,"y")&&C(n,"y")&&(o=O(o,n.getBoundingClientRect(),"y")),n=n.parentElement;return o}function D(e,t){return-1<e.className.split(" ").map(function(e){return e}).indexOf(t)}var l={x:"x",y:"y",xy:"xy"},O=function(e,t,n){return"x"===n?{left:Math.max(e.left,t.left),top:e.top,right:Math.min(e.right,t.right),bottom:e.bottom}:{left:e.left,top:Math.max(e.top,t.top),right:e.right,bottom:Math.min(e.bottom,t.bottom)}},S=function(e){var t,n=e.getBoundingClientRect(),n={left:n.left,right:n.right,top:n.top,bottom:n.bottom};return R(e,"x")&&!C(e,"x")&&(t=n.right-n.left,n.right=n.right+e.scrollWidth-t),R(e,"y")&&!C(e,"y")&&(t=n.bottom-n.top,n.bottom=n.bottom+e.scrollHeight-t),n},C=function(e,t){var n=window.getComputedStyle(e),e=n.overflow,t=n["overflow-"+t];return"auto"===e||"scroll"===e||"hidden"===e||("auto"===t||"scroll"===t||"hidden"===t)},R=function(e,t){return"x"===t?e.scrollWidth>e.clientWidth:e.scrollHeight>e.clientHeight},A=function(t,n){var o=[];function e(){o&&(o.forEach(function(e){return e.removeEventListener("scroll",n)}),window.removeEventListener("scroll",n))}return function(){var e=t;for(;e;)(r(e,"x")||r(e,"y"))&&o.push(e),e=e.parentElement}(),{dispose:function(){e(),o=null},start:function(){o&&(o.forEach(function(e){return e.addEventListener("scroll",n)}),window.addEventListener("scroll",n))},stop:e}},B=function(e,t){for(var n=e;n;){if(n.matches(t))return n;n=n.parentElement}return null},I=function(e,t){var n;!e||-1===(n=e.className.split(" ").filter(function(e){return e})).indexOf(t)&&(n.unshift(t),e.className=n.join(" "))},T=function(e,t){var n;e&&(n=e.className.split(" ").filter(function(e){return e&&e!==t}),e.className=n.join(" "))},P=function(){window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():window.document.selection&&window.document.selection.empty()},z=function(e){if(e){e=window.getComputedStyle(e);if(e)return e.cursor}return null};function N(e){return!(e.bottom<=e.top||e.right<=e.left)}var L={size:"offsetWidth",distanceToParent:"offsetLeft",translate:"transform",begin:"left",end:"right",dragPosition:"x",scrollSize:"scrollWidth",offsetSize:"offsetWidth",scrollValue:"scrollLeft",scale:"scaleX",setSize:"width",setters:{translate:function(e){return"translate3d("+e+"px, 0, 0)"}}},M={size:"offsetHeight",distanceToParent:"offsetTop",translate:"transform",begin:"top",end:"bottom",dragPosition:"y",scrollSize:"scrollHeight",offsetSize:"offsetHeight",scrollValue:"scrollTop",scale:"scaleY",setSize:"height",setters:{translate:function(e){return"translate3d(0,"+e+"px, 0)"}}};function F(o){return{get:function(e,t){return e[o[t]||t]},set:function(e,t,n){e[o[t]]=o.setters[t]?o.setters[t](n):n}}}function j(n,l){n["dndrop-extra-size-for-insertion"]=0;var o=F("horizontal"===l?L:M),s={translation:0};function e(){var e,t;i(n),t=(e=n).getBoundingClientRect(),s.scaleX=e.offsetWidth?(t.right-t.left)/e.offsetWidth:1,s.scaleY=e.offsetHeight?(t.bottom-t.top)/e.offsetHeight:1}function i(e){s.rect=S(e);e=E(e,s.rect);N(e)&&(s.lastVisibleRect=s.visibleRect),s.visibleRect=e}function r(e){var t=e;if(t.tagName){t=t.getBoundingClientRect();return"vertical"===l?t.bottom-t.top:t.right-t.left}return o.get(e,"size")*o.get(s,"scale")}function t(e){return o.get(e,"dragPosition")}return window.addEventListener("resize",function(){i(n)}),setTimeout(function(){e()},10),{getSize:r,getContainerRectangles:function(){return{rect:s.rect,visibleRect:s.visibleRect,lastVisibleRect:s.lastVisibleRect}},getBeginEndOfDOMRect:function(e){return{begin:o.get(e,"begin"),end:o.get(e,"end")}},getBeginEndOfContainer:function(){return{begin:o.get(s.rect,"begin")+s.translation,end:o.get(s.rect,"end")+s.translation}},getBeginEndOfContainerVisibleRect:function(){return{begin:o.get(s.visibleRect,"begin")+s.translation,end:o.get(s.visibleRect,"end")+s.translation}},getBeginEnd:function(e){var t=(t=e,(o.get(t,"distanceToParent")+(t[u]||0))*o.get(s,"scale")+(o.get(s.rect,"begin")+s.translation)-o.get(n,"scrollValue"));return{begin:t,end:t+r(e)*o.get(s,"scale")}},getAxisValue:t,setTranslation:function(e,t){t?o.set(e.style,"translate",t):e.style.removeProperty("transform"),e[u]=t},getTranslation:function(e){return e[u]},setVisibility:function(e,t){void 0!==e[a]&&e[a]===t||(t?e.style.removeProperty("visibility"):e.style.visibility="hidden",e[a]=t)},isVisible:function(e){return void 0===e[a]||e[a]},isInVisibleRect:function(e,t){var n=s.visibleRect,o=n.left,i=n.top,r=n.right,a=n.bottom;return a-i<2&&(a=i+30),n=s.rect,"vertical"===l?e>n.left&&e<n.right&&i<t&&t<a:o<e&&e<r&&t>n.top&&t<n.bottom},setSize:function(e,t){o.set(e,"setSize",t)},getTopLeftOfElementBegin:function(e){var t=0;return{top:"horizontal"===l?(t=e,s.rect.top):(t=s.rect.left,e),left:t}},getScrollSize:function(e){return o.get(e,"scrollSize")},getScrollValue:function(e){return o.get(e,"scrollValue")},setScrollValue:function(e,t){return o.set(e,"scrollValue",t)},invalidate:e,invalidateRects:function(){i(n)},getPosition:t,setBegin:function(e,t){o.set(e,"begin",t)}}}var _="x",V="y",X="xy";function k(e,t,n){var o,i,r=n.left,a=n.right,l=n.top,s=n.bottom,n=e.x,e=e.y;if(n<r||a<n||e<l||s<e)return null;s="x"===t?(o=r,i=a,n):(o=l,i=s,e),e=i-o,e=400<e?100:e/4;return i-s<e?{direction:"end",speedFactor:(e-(i-s))/e}:s-o<e?{direction:"begin",speedFactor:(e-(s-o))/e}:null}function Y(e,t,n){e&&(e!==window?"x"===t?e.scrollLeft+=n:e.scrollTop+=n:"x"===t?e.scrollBy(n,0):e.scrollBy(0,n))}function H(o,i){void 0===i&&(i="y");var r=null,a=null,l=null,s=null;return{animate:function(e,t){l=e,s=t,function n(){null===r&&(r=requestAnimationFrame(function(e){var t=e-(a=null===a?e:a);a=e;t=t/1e3*s;Y(o,i,t="begin"===l?0-t:t),r=null,n()}))}()},stop:function(){null!==r&&(cancelAnimationFrame(r),r=null),a=null}}}var t;function n(e){for(var t=[],n=e.element;n;){var o=function(e){var t=window.getComputedStyle(e),e=t.overflow;if("auto"===e||"scroll"===e)return l.xy;e=t["overflow-x"],e="auto"===e||"scroll"===e,t=t["overflow-y"],t="auto"===t||"scroll"===t;return e&&t?l.xy:e?l.x:t?l.y:null}(n);if(o&&!D(n,"dndrop-prevent-auto-scroll-class")){var i={};switch(o){case X:i.x={animator:H(n,"x")},i.y={animator:H(n,"y")};break;case _:i.x={animator:H(n,"x")};break;case V:i.y={animator:H(n,"y")}}t.push({axisAnimations:i,getRect:function(e){return function(){return E(e,e.getBoundingClientRect())}}(n),scrollerElement:n})}n=n.parentElement}return t}function G(e,i){void 0===i&&(i=1500);var r=e.reduce(function(e,t){t=n(t).filter(function(t){return!e.find(function(e){return e.scrollerElement===t.scrollerElement})});return e.concat(t)},[]);return function(e){var t,o,n=e.draggableInfo;e.reset?r.forEach(function(e){e.axisAnimations.x&&e.axisAnimations.x.animator.stop(),e.axisAnimations.y&&e.axisAnimations.y.animator.stop()}):n&&(o=n.mousePosition,r.forEach(function(e){var t=e.axisAnimations,n=(0,e.getRect)();t.x&&(t.x.scrollParams=k(o,"x",n),e.cachedRect=n),t.y&&(t.y.scrollParams=k(o,"y",n),e.cachedRect=n)}),r.forEach(function(e){var t,n=e.axisAnimations,o=n.x,e=n.y;o&&(o.scrollParams?(n=(t=o.scrollParams).direction,t=t.speedFactor,o.animator.animate(n,t*i)):o.animator.stop()),e&&(e.scrollParams?(o=(t=e.scrollParams).direction,t=t.speedFactor,e.animator.animate(o,t*i)):e.animator.stop())}),(e=r.filter(function(e){return e.cachedRect})).length&&1<e.length&&((t=function(e,t){for(var n=document.elementFromPoint(t.x,t.y);n;){var o=e.find(function(e){return e.scrollerElement===n});if(o)return o;n=n.parentElement}return null}(e,n.mousePosition))&&e.forEach(function(e){e!==t&&(e.axisAnimations.x&&e.axisAnimations.x.animator.stop(),e.axisAnimations.y&&e.axisAnimations.y.animator.stop())})))}}"undefined"!=typeof window&&((t=Element)&&t.prototype&&!t.prototype.matches&&(t.prototype.matches=t.prototype.matchesSelector||t.prototype.mozMatchesSelector||t.prototype.msMatchesSelector||t.prototype.oMatchesSelector||t.prototype.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),n=t.length;0<=--n&&t.item(n)!==this;);return-1<n}),Array.prototype.some||(Array.prototype.some=function(e){if(null==this)throw new TypeError("Array.prototype.some called on null or undefined");if("function"!=typeof e)throw new TypeError;for(var t=Object(this),n=t.length>>>0,o=2<=arguments.length?arguments[1]:void 0,i=0;i<n;i++)if(i in t&&e.call(o,t[i],i,t))return!0;return!1}));var $={overflow:"hidden",display:"block"},W={height:"100%",display:"table-cell","vertical-align":"top"},q={};function U(o){return Object.keys(o).reduce(function(e,t){var n=o[t];return"object"==typeof n?""+e+t+"{"+U(n)+"}":""+e+t+":"+n+";"},"")}function J(e){if(e&&"undefined"!=typeof window){var t=window.document.head||window.document.getElementsByTagName("head")[0],n=window.document.createElement("style"),e=U({"body *":{cursor:e+" !important"}});return n.type="text/css",n.styleSheet?n.styleSheet.cssText=e:n.appendChild(window.document.createTextNode(e)),t.appendChild(n),n}return null}q["."+y]={position:"relative","min-height":"30px","min-width":"30px"},q["."+y+".horizontal"]={display:"table"},q["."+y+".horizontal > ."+d]={display:"inline-block"},q["."+y+".horizontal > ."+v]=W,q["."+y+".vertical > ."+v]=$,q["."+v]={"box-sizing":"border-box"},q["."+v+".horizontal"]=W,q["."+v+".vertical"]=$,q["."+v+".animated"]={transition:"transform ease"},q["."+f]={"box-sizing":"border-box"},q["."+f+".animated"]={transition:"all ease-in-out"},q["."+f+" *"]={"pointer-events":"none"},q["."+s+" *"]={"touch-action":"none","-ms-touch-action":"none"},q["."+g]={"-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none"},q["."+m]={flex:"1"},q["."+y+".horizontal > ."+h]={height:"100%",overflow:"hidden",display:"table-cell","vertical-align":"top"},q["."+y+".vertical > ."+h]={overflow:"hidden",display:"block",width:"100%"},q["."+b]={width:"100%",height:"100%",display:"flex","justify-content":"stretch","align-items":"stretch"},q["."+p]={"background-color":"rgba(150, 150, 150, 0.1)",border:"1px solid #ccc"};var K,Q,Z=["mousedown","touchstart"],ee=["mousemove","touchmove"],te=["mouseup","touchend"],ne=null,oe=null,ie=null,re=null,ae=[],le=!1,se=!1,ue=!1,de=!1,ce=null,fe=null,ge=null,pe=null,me=(K=null,Q=!1,{start:function(){Q||(Q=!0,function e(){K=requestAnimationFrame(function(){ne.forEach(function(e){return e.layout.invalidateRects()}),setTimeout(function(){null!==K&&e()},50)})}())},stop:function(){null!==K&&(cancelAnimationFrame(K),K=null),Q=!1}}),he="undefined"!=typeof window&&!!(window.navigator.userAgent.match(/Android/i)||window.navigator.userAgent.match(/webOS/i)||window.navigator.userAgent.match(/iPhone/i)||window.navigator.userAgent.match(/iPad/i)||window.navigator.userAgent.match(/iPod/i)||window.navigator.userAgent.match(/BlackBerry/i)||window.navigator.userAgent.match(/Windows Phone/i));function ve(){"undefined"!=typeof window&&Z.forEach(function(e){window.document.addEventListener(e,ze,{passive:!1})})}function ye(){return re&&re.ghostParent?re.ghostParent:oe&&oe.parentElement||window.document.body}function be(e,t,n,o){var i=t.x,r=t.y,a=e.getBoundingClientRect(),l=a.left,s=a.top,u=a.right,d=a.bottom,t=(t=n.layout.getContainerRectangles().visibleRect,a=a,{left:Math.max(t.left,a.left),top:Math.max(t.top,a.top),right:Math.min(t.right,a.right),bottom:Math.min(t.bottom,a.bottom)}),a=t.left+(t.right-t.left)/2,t=t.top+(t.bottom-t.top)/2,c=e.cloneNode(!0);return c.style.zIndex="1000",c.style.boxSizing="border-box",c.style.position="fixed",c.style.top="0px",c.style.left="0px",c.style.transform="none",c.style.removeProperty("transform"),n.shouldUseTransformForGhost()?c.style.transform="translate3d("+l+"px, "+s+"px, 0)":(c.style.top=s+"px",c.style.left=l+"px"),c.style.width=u-l+"px",c.style.height=d-s+"px",c.style.overflow="visible",c.style.transition=null,c.style.removeProperty("transition"),c.style.pointerEvents="none",c.style.userSelect="none",n.getOptions().dragClass?setTimeout(function(){I(c.firstElementChild,n.getOptions().dragClass);var e=window.getComputedStyle(c.firstElementChild).cursor;pe=J(e)}):pe=J(o),I(c,n.getOptions().orientation||"vertical"),I(c,f),{ghost:c,centerDelta:{x:a-i,y:t-r},positionDelta:{left:l-i,top:s-r},topLeft:{x:l,y:s}}}function we(e){function i(){T(ie.ghost,"animated"),ie.ghost.style.transitionDuration=null,ye().removeChild(ie.ghost),e()}function t(e,t,n){var o=e.top,e=e.left;I(ie.ghost,"animated"),n&&I(ie.ghost.firstElementChild,n),ie.topLeft.x=e,ie.topLeft.y=o,Qe(t),setTimeout(function(){i()},t+20)}function n(e,t){I(ie.ghost,"animated"),Qe(e,.9,!0),setTimeout(function(){t()},e+20)}var o,r,a,l,s,u;re.targetElement?(o=ae.filter(function(e){return e.element===re.targetElement})[0],!(u=o.getOptions()).shouldAnimateDrop||u.shouldAnimateDrop(re.container.getOptions(),re.payload)?t(o.getDragResult().shadowBeginEnd.rect,Math.max(150,o.getOptions().animationDuration/2),o.getOptions().dropClass):i()):(r=ae.filter(function(e){return e===re.container})[0])?(l=(a=r.getOptions()).behaviour,s=a.removeOnDropOut,"move"!==l&&"contain"!==l||!se&&s||!r.getDragResult()?n(r.getOptions().animationDuration,i):!N((a=r.layout.getContainerRectangles()).visibleRect)&&N(a.lastVisibleRect)?t({top:a.lastVisibleRect.top,left:a.lastVisibleRect.left},r.getOptions().animationDuration,r.getOptions().dropClass):(s=(l=r.getDragResult()).removedIndex,a=l.elementSize,l=r.layout,r.getTranslateCalculator({dragResult:{removedIndex:s,addedIndex:s,elementSize:a,pos:void 0,shadowBeginEnd:void 0}}),s=0<s?l.getBeginEnd(r.draggables[s-1]).end:l.getBeginEndOfContainer().begin,t(l.getTopLeftOfElementBegin(s),r.getOptions().animationDuration,r.getOptions().dropClass))):n(w.animationDuration,i)}var xe,Ee,De,Oe,Se,Ce,Re=(Se=1,Ce=5,function(e,t,n){xe=ke(e),De=n,(Ee="number"==typeof t?t:he?200:0)&&(Oe=setTimeout(Pe,Ee)),ee.forEach(function(e){return window.document.addEventListener(e,Ae)},{passive:!1}),te.forEach(function(e){return window.document.addEventListener(e,Be)},{passive:!1}),window.document.addEventListener("drag",Ie,{passive:!1})});function Ae(e){var t=ke(e),e=t.clientX,t=t.clientY;if(Ee)(Math.abs(xe.clientX-e)>Ce||Math.abs(xe.clientY-t)>Ce)&&Te();else if(Math.abs(xe.clientX-e)>Se||Math.abs(xe.clientY-t)>Se)return Pe()}function Be(){Te()}function Ie(){Te()}function Te(){clearTimeout(Oe),ee.forEach(function(e){return window.document.removeEventListener(e,Ae)},{passive:!1}),te.forEach(function(e){return window.document.removeEventListener(e,Be)},{passive:!1}),window.document.removeEventListener("drag",Ie,{passive:!1})}function Pe(){clearTimeout(Oe),Te(),De()}function ze(e){var t,n,o,i,r,a,l=ke(e);le||void 0!==l.button&&0!==l.button||(oe=B(l.target,"."+v))&&(t=B(oe,"."+y),o=(n=ae.filter(function(e){return e.element===t})[0]).getOptions().dragHandleSelector,i=n.getOptions().nonDragAreaSelector,r=!0,o&&!B(l.target,o)&&(r=!1),(r=i&&B(l.target,i)?!1:r)&&(n.layout.invalidate(),I(window.document.body,s),I(window.document.body,g),a=function(){T(window.document.body,s),T(window.document.body,g),window.document.removeEventListener("mouseup",a)},window.document.addEventListener("mouseup",a)),r&&Re(l,n.getOptions().dragBeginDelay,function(){P(),We(l,z(e.target)),ee.forEach(function(e){window.document.addEventListener(e,Ne,{passive:!1})}),te.forEach(function(e){window.document.addEventListener(e,Xe,{passive:!1})})}))}function Ne(e){e.preventDefault();var t,n=ke(e);re?("contain"===(t=re.container.getOptions()).behaviour?function(e,t){var n=e.clientX,o=e.clientY;void 0===t&&(t="vertical");var i,r,e=re.container.layout.getBeginEndOfContainerVisibleRect(),t="vertical"===t?(i=o,r="y",a="top",re.size.offsetHeight):(i=n,r="x",a="left",re.size.offsetWidth),o=e.begin,n=e.end-t,a=Math.max(o,Math.min(n,i+ie.positionDelta[a]));ie.topLeft[r]=a,re.position[r]=Math.max(e.begin,Math.min(e.end,i+ie.centerDelta[r])),re.mousePosition[r]=Math.max(e.begin,Math.min(e.end,i)),re.position[r]<e.begin+t/2&&(re.position[r]=e.begin+2),re.position[r]>e.end-t/2&&(re.position[r]=e.end-2)}(n,t.orientation):ge?"y"===ge?(ie.topLeft.y=n.clientY+ie.positionDelta.top,re.position.y=n.clientY+ie.centerDelta.y,re.mousePosition.y=n.clientY):"x"===ge&&(ie.topLeft.x=n.clientX+ie.positionDelta.left,re.position.x=n.clientX+ie.centerDelta.x,re.mousePosition.x=n.clientX):(ie.topLeft.x=n.clientX+ie.positionDelta.left,ie.topLeft.y=n.clientY+ie.positionDelta.top,re.position.x=n.clientX+ie.centerDelta.x,re.position.y=n.clientY+ie.centerDelta.y,re.mousePosition.x=n.clientX,re.mousePosition.y=n.clientY),Qe(),(de=!ce(re))&&_e()):We(n,z(e.target))}var Le,Me,Fe,je,_e=(Le=Ve,Fe=!(Me=20),function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];je&&clearTimeout(je),Fe&&!je?Le.call.apply(Le,[null].concat(e)):je=setTimeout(function(){je=null,Le.call.apply(Le,[null].concat(e))},Me)});function Ve(){de&&(de=!1,Ye(re,ne))}function Xe(){var e;ee.forEach(function(e){window.document.removeEventListener(e,Ne,{passive:!1})}),te.forEach(function(e){window.document.removeEventListener(e,Xe,{passive:!1})}),fe({reset:!0}),pe&&((e=pe)&&"undefined"!=typeof window&&(window.document.head||window.document.getElementsByTagName("head")[0]).removeChild(e),pe=null),re&&(me.stop(),Ve(),ue=!0,we(function(){$e(le=!1);for(var e=ne||[],t=e.shift();void 0!==t;)t.handleDrop(re),t=e.shift();ce=ge=re=ie=oe=ne=null,ue=!1}))}function ke(e){return e.touches?e.touches[0]:e}function Ye(t,e){var n=!1;e.forEach(function(e){e=e.handleDrag(t);n=!!e.containerBoxChanged||!1,e.containerBoxChanged=!1}),n&&(n=!1,requestAnimationFrame(function(){ae.forEach(function(e){e.layout.invalidateRects(),e.onTranslated()})}))}function He(e){var t=e,n=null;return function(e){return!(null!==n||!le||ue)&&(n=requestAnimationFrame(function(){le&&!ue&&(Ye(e,t),fe({draggableInfo:e})),n=null}),!0)}}function Ge(e,t){return e.getOptions().autoScrollEnabled?G(t,e.getScrollMaxSpeed()):function(e){return null}}function $e(o){var i=re.container,r=re.payload;ae.forEach(function(e){var t,n;i.getOptions().fireRelatedEventsOnly&&e!==i||(t=(n=e.getOptions()).onDragStart,n=n.onDragEnd,(t=o?t:n)&&(n={isSource:e===i,payload:r,willAcceptDrop:!1},e.isDragRelevant(i,r)&&(n.willAcceptDrop=!0),t(n)))})}function We(e,t){var n,o,i,r,a,l;null!==oe&&(le=!0,(n=ae.filter(function(e){return oe.parentElement===e.element})[0]).setDraggables(),ge=n.getOptions().lockAxis?n.getOptions().lockAxis.toLowerCase():null,o=oe,i=ae.filter(function(e){return o.parentElement===e.element})[0],r=i.draggables.indexOf(o),a=i.getOptions().getGhostParent,l=o.getBoundingClientRect(),re={container:i,element:o,size:{offsetHeight:l.bottom-l.top,offsetWidth:l.right-l.left},elementIndex:r,payload:i.getOptions().getChildPayload?i.getOptions().getChildPayload(r):void 0,targetElement:null,position:{x:0,y:0},groupName:i.getOptions().groupName,ghostParent:a?a():null,invalidateShadow:null,mousePosition:null,relevantContainers:null},ie=be(oe,{x:e.clientX,y:e.clientY},re.container,t),re.position={x:e.clientX+ie.centerDelta.x,y:e.clientY+ie.centerDelta.y},re.mousePosition={x:e.clientX,y:e.clientY},ne=ae.filter(function(e){return e.isDragRelevant(n,re.payload)}),re.relevantContainers=ne,ce=He(ne),fe&&fe({reset:!0,draggableInfo:void 0}),fe=Ge(n,ne),ne.forEach(function(e){return e.prepareDrag(e,ne)}),$e(!0),ce(re),ye().appendChild(ie.ghost),me.start())}var qe,Ue,Je,Ke=je=Oe=null;function Qe(e,t,n){void 0===e&&(e=0),void 0===t&&(t=1),void 0===n&&(n=!1);var o=ie.ghost,i=ie.topLeft,r=i.x,a=i.y,l=!re.container||re.container.shouldUseTransformForGhost(),s=l?"translate3d("+r+"px,"+a+"px, 0)":null;if(1!==t&&(s=s?s+" scale("+t+")":"scale("+t+")"),0<e)return ie.ghost.style.transitionDuration=e+"ms",void requestAnimationFrame(function(){s&&(o.style.transform=s),l||(o.style.left=r+"px",o.style.top=a+"px"),Ke=null,n&&(o.style.opacity="0")});null===Ke&&(Ke=requestAnimationFrame(function(){s&&(o.style.transform=s),l||(o.style.left=r+"px",o.style.top=a+"px"),Ke=null,n&&(o.style.opacity="0")}))}function Ze(){var t;!le||se||ue||(de=!(se=!0),t=Object.assign({},re,{targetElement:null,position:{x:Number.MAX_SAFE_INTEGER,y:Number.MAX_SAFE_INTEGER},mousePosition:{x:Number.MAX_SAFE_INTEGER,y:Number.MAX_SAFE_INTEGER}}),ne.forEach(function(e){e.handleDrag(t)}),re&&(re.targetElement=null,re.cancelDrop=!0,Xe(),se=!1))}"undefined"!=typeof window&&"undefined"!=typeof window&&(qe=window.document.head||window.document.getElementsByTagName("head")[0],(Ue=window.document.createElement("style")).id="dndrop-style-definitions",Je=U(q),Ue.type="text/css",Ue.styleSheet?Ue.styleSheet.cssText=Je:Ue.appendChild(window.document.createTextNode(Je)),qe.appendChild(Ue));var et=(ve(),{register:function(e){e=e,ae.push(e),le&&re&&e.isDragRelevant(re.container,re.payload)&&(ne.push(e),e.prepareDrag(e,ne),fe&&fe({reset:!0,draggableInfo:void 0}),fe=Ge(e,ne),ce=He(ne),e.handleDrag(re))},unregister:function(e){var t;t=e,ae.splice(ae.indexOf(t),1),le&&re&&(re.container===t&&t.fireRemoveElement(),re.targetElement===t.element&&(re.targetElement=null),-1<(e=ne.indexOf(t))&&(ne.splice(e,1),fe&&fe({reset:!0,draggableInfo:void 0}),fe=Ge(t,ne),ce=He(ne)))},isDragging:function(){return le},cancelDrag:Ze});function tt(e,t,n){void 0===n&&(n=w.animationDuration),t?(I(e,o),e.style.transitionDuration=n+"ms"):(T(e,o),e.style.removeProperty("transition-duration"))}function nt(n){var o=[];return Array.prototype.forEach.call(n.children,function(e){var t;e.nodeType===Node.ELEMENT_NODE?((t=!D(t=e,v)?function(e){if(St.wrapChild){var t=window.document.createElement("div");return t.className=""+v,e.parentElement.insertBefore(t,e),t.appendChild(e),t}return e}(e):t)[u]=0,o.push(t)):n.removeChild(e)}),o}function ot(e){function s(e,t,n,o,i){if(void 0===i&&(i=!1),o<n)return n;if(n!==o)return r=Math.floor((o+n)/2),l=u.getBeginEnd(e[r]),a=l.begin,l=l.end,t<a?s(e,t,n,r-1,i):l<t?s(e,t,r+1,o,i):!i||t<(l+a)/2?r:r+1;var r=u.getBeginEnd(e[n]),a=r.begin,l=r.end;return!i||t<(l+a)/2?n:n+1}var u=e.layout;return function(e,t,n){return s(e,t,0,e.length-1,n=void 0===n?!1:n)}}function it(e){var t,n,o,i=e.element,r=e.draggables,a=e.layout,l=e.getOptions,s=(t=(e={element:i,draggables:r,layout:a,getOptions:l}).element,n=e.draggables,o=e.layout,function(){n.forEach(function(e){tt(e,!1),o.setTranslation(e,0),o.setVisibility(e,!0)}),t[c]&&(t[c].parentNode.removeChild(t[c]),t[c]=null)}),u=(St.dropHandler||x)({element:i,draggables:r,layout:a,getOptions:l});return function(e,t,n){var o=t.addedIndex,t=t.removedIndex;if(void 0===n&&(n=!1),s(),e&&!e.cancelDrop)if(e.targetElement||l().removeOnDropOut||n){var n=function(e){return null!==e},o=n(o)?n(t)&&t<o?o-1:o:null,i={removedIndex:t,addedIndex:o,payload:e.payload};(!e.container.getOptions().fireRelatedEventsOnly||n(t)||n(o))&&u(i,l().onDrop)}else if(l().dropNotAllowed){i=e.payload,e=e.container;return l().dropNotAllowed({payload:i,container:e})}}}function rt(e){var n=e.element,o=e.getOptions,i=null;return function(e){var t=e.draggableInfo,e=i;return{removedIndex:e=null==i&&t.container.element===n&&"copy"!==o().behaviour?i=t.elementIndex:e}}}function at(e){var t=e.draggables,n=e.layout;return function(e){e=e.dragResult;null!==e.removedIndex&&n.setVisibility(t[e.removedIndex],!1)}}function lt(e){var n=e.element,o=e.layout;return function(e){var t=e.draggableInfo,e=document.elementFromPoint(t.position.x,t.position.y);if(e){e=function(e,t){for(var n=e;n;){if(n[i]){var o=n[i];if(t.some(function(e){return e===o}))return o}n=n.parentElement}return null}(e,t.relevantContainers);if(e&&e.element===n)return{pos:o.getPosition(t.position)}}return{pos:null}}}function st(e){var n=e.layout,o=null;return function(e){var t=e.draggableInfo;return null===e.dragResult.pos?o=null:{elementSize:o=o||n.getSize(t.size)}}}function ut(e){var o=e.element;return function(e){var t=e.draggableInfo,n=e.dragResult;e=t,t=o,void 0===(n=!!n.pos)&&(n=!0),t&&n?e.targetElement=t:e.targetElement===t&&(e.targetElement=null)}}function dt(){return function(e){return null!==e.dragResult.pos?{addedIndex:0}:{addedIndex:null}}}function ct(e){var t=e.layout,n=null;return function(e){e=e.dragResult.addedIndex;if(e===n)return null;n=e;e=t.getBeginEndOfContainer().begin;return{shadowBeginEnd:{rect:t.getTopLeftOfElementBegin(e)}}}}function ft(e){var u=e.layout,d=e.element,c=e.getOptions,f=null;return function(e){var t=e.dragResult,n=t.elementSize,o=t.shadowBeginEnd,i=t.addedIndex,r=t.dropPlaceholderContainer,a=c();if(a.dropPlaceholder){var l="boolean"==typeof a.dropPlaceholder?{}:a.dropPlaceholder,s=l.animationDuration,e=l.className,t=l.showOnTop;return null===i?(r&&null!==f&&d.removeChild(r),f=null,{dropPlaceholderContainer:void 0}):(r||(a=document.createElement("div"),(l=document.createElement("div")).className=b,a.className=m+" "+(e||p),(r=document.createElement("div")).className=h,r.style.position="absolute",void 0!==s&&(r.style.transition="all "+s+"ms ease"),r.appendChild(l),l.appendChild(a),u.setSize(r.style,n+"px"),r.style.pointerEvents="none",t?d.appendChild(r):d.insertBefore(r,d.firstElementChild)),f!==i&&o.dropArea&&u.setBegin(r.style,o.dropArea.begin-u.getBeginEndOfContainer().begin+"px"),f=i,{dropPlaceholderContainer:r})}return null}}function gt(e){var n=yt(e);return function(e){var t=e.draggableInfo,e=e.dragResult;return t.invalidateShadow?n({draggableInfo:t,dragResult:e}):null}}function pt(e){var n,o,i=(n=e.draggables,o=ot({layout:e.layout}),function(e){var t=e.dragResult,e=t.shadowBeginEnd,t=t.pos;if(e)return e.begin+e.beginAdjustment<=t&&e.end>=t?null:t<e.begin+e.beginAdjustment?o(n,t):t>e.end?o(n,t)+1:n.length;t=o(n,t,!0);return null!==t?t:n.length});return function(e){var t=e.dragResult,e=null;return{addedIndex:e=null!==t.pos&&null===(e=i({dragResult:t}))?t.addedIndex:e}}}function mt(){var n=null;return function(e){var t=e.dragResult,e=t.addedIndex,t=t.shadowBeginEnd;e!==n&&null!==n&&t&&(t.beginAdjustment=0),n=e}}function ht(e){var i=e.element,r=e.draggables,a=e.layout,l=e.getOptions,s=null;return function(e){var t=e.dragResult,n=t.addedIndex,e=t.removedIndex,t=t.elementSize;if(null===e)if(null!==n){if(!s){e=a.getBeginEndOfContainer();e.end=e.begin+a.getSize(i);n=a.getScrollSize(i)>a.getSize(i)?e.begin+a.getScrollSize(i)-a.getScrollValue(i):e.end,e=0<r.length?a.getBeginEnd(r[r.length-1]).end-r[r.length-1][u]:e.begin;if(n<e+t){(s=window.document.createElement("div")).className=d+" "+l().orientation;var o=0<r.length?t+e-n:t;return a.setSize(s.style,o+"px"),i.appendChild(s),i[c]=s,{containerBoxChanged:!0}}}}else if(s){a.setTranslation(s,0);o=s;return s=null,i.removeChild(o),{containerBoxChanged:!(i[c]=null)}}}}function vt(e){var l=e.draggables,s=e.layout,u=null,d=null;return function(e){var e=e.dragResult,t=e.addedIndex,n=e.removedIndex,o=e.elementSize;if(t!==u||n!==d){for(var i,r,a=0;a<l.length;a++)a!==n&&(i=l[a],r=0,null!==n&&n<a&&(r-=o),null!==t&&t<=a&&(r+=o),s.setTranslation(i,r));return{addedIndex:u=t,removedIndex:d=n}}}}function yt(e){var c=e.draggables,f=e.layout,g=null;return function(e){var t=e.draggableInfo,n=e.dragResult,o=n.addedIndex,i=n.removedIndex,r=n.elementSize,a=n.pos,l=n.shadowBeginEnd;if(null===a)return{shadowBeginEnd:g=null};if(null===o||!t.invalidateShadow&&o===g)return null;var s=o-1,u=Number.MIN_SAFE_INTEGER,e=0,n=0,a=null,t=null;s===i&&s--;var e=-1<s?(d=f.getSize(c[s]),t=f.getBeginEnd(c[s]),u=r<d?t.end-(d-r)/2:t.end,t.end):(t={end:f.getBeginEndOfContainer().begin},f.getBeginEndOfContainer().begin),s=Number.MAX_SAFE_INTEGER,d=o;d===i&&d++;n=d<c.length?(i=f.getSize(c[d]),a=f.getBeginEnd(c[d]),s=r<i?a.begin+(i-r)/2:a.begin,a.begin):(a={begin:f.getContainerRectangles().rect.end},f.getContainerRectangles().rect.end-f.getContainerRectangles().rect.begin),t=t&&a?f.getTopLeftOfElementBegin(t.end):null;return g=o,{shadowBeginEnd:{dropArea:{begin:e,end:n},begin:u,end:s,rect:t,beginAdjustment:l?l.beginAdjustment:0}}}}function bt(){var o=null;return function(e){var t=e.dragResult,n=t.pos,e=t.addedIndex,t=t.shadowBeginEnd;null!==n?null!=e&&null===o&&(n<t.begin&&(n=n-t.begin-5,t.beginAdjustment=n),o=e):o=null}}function wt(e){var e=e.getOptions,t=!1,n=e();return function(e){e=!!e.dragResult.pos;e!==t&&((t=e)?n.onDragEnter&&n.onDragEnter():n.onDragLeave&&n.onDragLeave())}}function xt(e){var e=e.getOptions,r=null,a=e();return function(e){var t=e.dragResult,n=t.addedIndex,o=t.removedIndex,i=e.draggableInfo,t=i.payload,e=i.element;a.onDropReady&&null!==n&&r!==n&&(i=r=n,null!==o&&o<n&&i--,a.onDropReady({addedIndex:i,removedIndex:o,payload:t,element:e?e.firstElementChild:void 0}))}}function Et(e){return"drop-zone"===e.getOptions().behaviour?Dt(e)(rt,at,lt,st,ut,dt,ct,wt,xt):Dt(e)(rt,at,lt,st,ut,gt,pt,mt,ht,vt,yt,ft,bt,wt,xt)}function Dt(n){return function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var o=e.map(function(e){return e(n)}),i=null;return function(n){return i=o.reduce(function(e,t){return Object.assign(e,t({draggableInfo:n,dragResult:e}))},i||{addedIndex:null,removedIndex:null,elementSize:null,pos:null,shadowBeginEnd:null})}}}function Ot(h){return function(e){var t,n,o,i,r,a=Object.assign({},w,e),l=null,s=null,u=(n=m,o=nt(t=h),e=n(),I(t,y+" "+e.orientation),{element:t,draggables:o,getOptions:n,layout:j(t,e.orientation,e.animationDuration)}),d=Et(u),c=it(u),f=A(h,function(){u.layout.invalidateRects(),g()});function g(){null!==s&&(s.invalidateShadow=!0,l=d(s),s.invalidateShadow=!1)}function p(e,t){for(var n=nt(t),o=0;o<n.length;o++)e[o]=n[o];for(var i=0;i<e.length-n.length;i++)e.pop()}function m(){return a}return{element:h,draggables:u.draggables,isDragRelevant:(i=(e=u).element,r=e.getOptions,function(e,t){var n=r();if(n.shouldAcceptDrop)return n.shouldAcceptDrop(e.getOptions(),t);t=e.getOptions();return"copy"!==n.behaviour&&(B(i,"."+v)!==e.element&&(e.element===i||!(!t.groupName||t.groupName!==n.groupName)))}),layout:u.layout,dispose:function(e){var t;f.dispose(),t=e.element,St.wrapChild&&Array.prototype.forEach.call(t.children,function(e){e.nodeType===Node.ELEMENT_NODE&&D(e,v)&&(t.insertBefore(e.firstElementChild,e),t.removeChild(e))})},prepareDrag:function(e,t){var n=e.element,o=u.draggables;p(o,n),e.layout.invalidateRects(),o.forEach(function(e){return tt(e,!0,a.animationDuration)}),f.start()},handleDrag:function(e){return l=d(s=e)},handleDrop:function(e){f.stop(),l&&l.dropPlaceholderContainer&&h.removeChild(l.dropPlaceholderContainer),s=null,d=Et(u),c(e,l),l=null},fireRemoveElement:function(){c(s,Object.assign({},l,{addedIndex:null}),!0),l=null},getDragResult:function(){return l},getTranslateCalculator:function(e){return vt(u)(e)},onTranslated:function(){g()},setDraggables:function(){p(u.draggables,h)},getScrollMaxSpeed:function(){return St.maxScrollSpeed},shouldUseTransformForGhost:function(){return!0===St.useTransformForGhost},getOptions:m,setOptions:function(e,t){a=!1===(t=void 0===t?!0:t)?Object.assign({},w,e):Object.assign({},w,a,e)}}}}var St=function(e,t){var n=Ot(e)(t);return e[i]=n,et.register(n),{dispose:function(){et.unregister(n),n.dispose(n)},setOptions:function(e,t){n.setOptions(e,t)}}};St.wrapChild=!0,St.cancelDrag=function(){et.cancelDrag()},St.isDragging=function(){return et.isDragging()};function Ct(e,t){e=e.$props.tag;if(e){if("string"==typeof e){var n={value:e};return t&&(n.props={class:t}),n}if("object"==typeof e){n={value:e.value||"div",props:e.props||{}};return t&&(n.props.class?(e=n.props.class,"[object Array]"===Object.prototype.toString.call(e)?n.props.class.push(t):n.props.class=[t,n.props.class]):n.props.class=t),n}}return{value:"div"}}function Rt(e){return!e||("string"==typeof e||"object"==typeof e&&("string"==typeof e.value||"function"==typeof e.value||"object"==typeof e.value))}St.dropHandler=function(){return function(e,t){t&&t(e)}},St.wrapChild=!1;var At={drop:"onDrop","drag-end":"onDragEnd","drag-start":"onDragStart","drag-enter":"onDragEnter","drag-leave":"onDragLeave","drop-ready":"onDropReady","drop-not-allowed":"dropNotAllowed"};function Bt(e){var i,r,t=Object.assign({},e.$props,e.$listeners);return i=t,r=e,Object.keys(i).reduce(function(e,t){var n=t,o=i[n];return void 0!==o&&("function"==typeof o?At[n]?e[At[n]]=function(e){r.$emit(n,e)}:e[n]=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return o.apply(void 0,e)}:e[n]=o),e},{})}W={name:"Container",mounted:function(){this.containerElement=this.$refs.container||this.$el,this.container=St(this.containerElement,Bt(this))},updated:function(){if(this.$refs.container!==this.containerElement&&this.$el!==this.containerElement)return this.container&&this.container.dispose(),this.containerElement=this.$refs.container||this.$el,void(this.container=St(this.containerElement,Bt(this)));this.container.setOptions(Bt(this))},destroyed:function(){this.container&&this.container.dispose()},props:{behaviour:String,groupName:String,orientation:String,dragHandleSelector:String,nonDragAreaSelector:String,dragBeginDelay:Number,animationDuration:Number,autoScrollEnabled:{type:Boolean,default:!0},lockAxis:String,dragClass:String,dropClass:String,removeOnDropOut:{type:Boolean,default:!1},"drag-start":Function,"drag-end":Function,drop:Function,getChildPayload:Function,shouldAnimateDrop:Function,fireRelatedEventsOnly:{type:Boolean,default:!1},shouldAcceptDrop:Function,"drag-enter":Function,"drag-leave":Function,tag:{validator:Rt,default:"div"},getGhostParent:Function,"drop-ready":Function,dropPlaceholder:[Object,Boolean]},render:function(e){var t=Ct(this);return e(t.value,Object.assign({},{ref:"container"},t.props),this.$slots.default)}},$={name:"Draggable",props:{tag:{validator:Rt,default:"div"}},render:function(e){return t=e,e=Ct(n=this,"dndrop-draggable-wrapper"),t(e.value,Object.assign({},e.props),n.$slots.default);var t,n}};e.Container=W,e.Draggable=$,e.smoothDnD=St,Object.defineProperty(e,"__esModule",{value:!0})}); |
{ | ||
"name": "vue-dndrop", | ||
"version": "1.1.2", | ||
"description": "Vue wrappers for drag n drop", | ||
"version": "1.1.3", | ||
"description": "Vue wrappers for drag n droppin", | ||
"author": "amendx && kutlugsahin", | ||
@@ -20,5 +20,2 @@ "repository": { | ||
"Vue.js", | ||
"vue3", | ||
"vue3.js", | ||
"vue 3.x", | ||
"sortable", | ||
@@ -42,2 +39,3 @@ "drag and drop", | ||
"docs": "cd docs && npm run dev", | ||
"deploy": "cd docs && npm run deploy", | ||
"lint": "eslint src/*" | ||
@@ -62,5 +60,7 @@ }, | ||
"rollup-plugin-typescript2": "^0.30.0", | ||
"rollup-plugin-uglify": "^6.0.4" | ||
"rollup-plugin-uglify": "^6.0.4", | ||
"prismjs": "^1.25.0", | ||
"raw-loader": "^4.0.2" | ||
}, | ||
"homepage": "https://github.com/amendx/vue-dndrop#readme" | ||
} |
@@ -13,2 +13,3 @@ <p align="center"> | ||
<a href="https://www.npmjs.com/package/vue-dndrop"><img alt="npm" src="https://img.shields.io/npm/v/vue-dndrop.svg?style=flat-square"></a> | ||
<img src="https://app.travis-ci.com/amendx/vue-dndrop.svg?branch=master"/> | ||
</p> | ||
@@ -41,3 +42,3 @@ | ||
```shell | ||
npm i vue-dndrop@next | ||
npm i vue-dndrop | ||
``` | ||
@@ -59,3 +60,3 @@ | ||
View the **original** docs here: | ||
Take a look at the full docs here. There's a lot of examples, details and more. | ||
@@ -86,3 +87,3 @@ - https://amendx.github.io/vue-dndrop | ||
<script> | ||
import { Container, Draggable } from "vue-smooth-dnd"; | ||
import { Container, Draggable } from "vue-dndrop"; | ||
import { applyDrag, generateItems } from "./utils"; | ||
@@ -108,7 +109,7 @@ export default { | ||
> Component that contains the draggable elements or components. Each of its children should be wrapped by **Draggable** component | ||
Component that contains the draggable elements or components. Each of its children should be wrapped by **Draggable** component | ||
### Properties | ||
> Properties define the visual behaviour of the library: | ||
Properties define the visual behaviour of the library: | ||
@@ -135,4 +136,4 @@ | Property | Type | Default | Description | | ||
> Tag name or the node definition to render the root element of the Container. | ||
> Default value is 'div'. | ||
Tag name or the node definition to render the root element of the Container. | ||
Default value is 'div'. | ||
@@ -158,3 +159,3 @@ ```ts | ||
> The lifecycle of a drag is both described, and can be controlled, by a series of [callbacks](#callbacks) and [events](#events), which are illustrated below for a example **containing 3 containers**: | ||
The lifecycle of a drag is both described, and can be controlled, by a series of [callbacks](#callbacks) and [events](#events), which are illustrated below for a example **containing 3 containers**: | ||
@@ -227,11 +228,11 @@ ``` | ||
> This can provide handler functions context-sensitive data, such as the loop index or current item. | ||
This can provide handler functions context-sensitive data, such as the loop index or current item. | ||
## Callbacks | ||
> Callbacks provide additional logic and checks before and during user interaction. | ||
Callbacks provide additional logic and checks before and during user interaction. | ||
### `get-child-payload()` | ||
> The function to be called to get the payload object to be passed **onDrop** function. | ||
The function to be called to get the payload object to be passed **onDrop** function. | ||
@@ -260,3 +261,3 @@ ```jsx | ||
> The function to be called by all containers before drag starts to determine the containers to which the drop is possible. Setting this function will override the **group-name** property and only the return value of this function will be taken into account. | ||
The function to be called by all containers before drag starts to determine the containers to which the drop is possible. Setting this function will override the **group-name** property and only the return value of this function will be taken into account. | ||
@@ -284,4 +285,4 @@ ```jsx | ||
> The function to be called by the target container to which the dragged item will be dropped. | ||
> Sometimes dragged item's dimensions are not suitable with the target container and dropping animation can be wierd. So it can be disabled by returning **false**. If not set drop animations are enabled. | ||
The function to be called by the target container to which the dragged item will be dropped. | ||
Sometimes dragged item's dimensions are not suitable with the target container and dropping animation can be wierd. So it can be disabled by returning **false**. If not set drop animations are enabled. | ||
@@ -309,5 +310,5 @@ ```jsx | ||
> The function to be called to get the element that the dragged ghost will be appended. Default parent element is the container itself. | ||
> The ghost element is positioned as 'fixed' and appended to given parent element. | ||
> But if any anchestor of container has a transform property, ghost element will be positioned relative to that element which breaks the calculations. Thats why if you have any transformed parent element of Containers you should set this property so that it returns any element that has not transformed parent element. | ||
The function to be called to get the element that the dragged ghost will be appended. Default parent element is the container itself. | ||
The ghost element is positioned as 'fixed' and appended to given parent element. | ||
But if any anchestor of container has a transform property, ghost element will be positioned relative to that element which breaks the calculations. Thats why if you have any transformed parent element of Containers you should set this property so that it returns any element that has not transformed parent element. | ||
@@ -332,7 +333,7 @@ ```jsx | ||
> Events may call user-defined handlers at particular points in the drag-and-drop lifecycle. | ||
Events may call user-defined handlers at particular points in the drag-and-drop lifecycle. | ||
### `@drag-start` | ||
> Event to be emitted by all containers on drag start. | ||
Event to be emitted by all containers on drag start. | ||
@@ -359,3 +360,3 @@ ```jsx | ||
> The function to be called by all containers on drag end. Called before [drop](#drop) event. | ||
The function to be called by all containers on drag end. Called before [drop](#drop) event. | ||
@@ -396,3 +397,3 @@ ```jsx | ||
> The event to be emitted by the relevant container whenever a dragged item leaves its boundaries while dragging. | ||
The event to be emitted by the relevant container whenever a dragged item leaves its boundaries while dragging. | ||
@@ -411,3 +412,3 @@ ```jsx | ||
> The function to be called by the container which is being drag over, when the index of possible drop position changed in container. Basically it is called each time the draggables in a container slides for opening a space for dragged item. **dropResult** is the only parameter passed to the function which contains the following properties. | ||
The function to be called by the container which is being drag over, when the index of possible drop position changed in container. Basically it is called each time the draggables in a container slides for opening a space for dragged item. **dropResult** is the only parameter passed to the function which contains the following properties. | ||
@@ -435,3 +436,3 @@ ```jsx | ||
> The event to be emitted by any relevant container when drop is over. (After drop animation ends). Source container and any container that could accept drop is considered relevant. | ||
The event to be emitted by any relevant container when drop is over. (After drop animation ends). Source container and any container that could accept drop is considered relevant. | ||
@@ -460,3 +461,3 @@ ```jsx | ||
> Event to be emitted by the current container when drop is not allowed or does not fit the rule applied inside the column/element validation. | ||
Event to be emitted by the current container when drop is not allowed or does not fit the rule applied inside the column/element validation. | ||
@@ -494,4 +495,4 @@ ```jsx | ||
> Tag name or the node definition to render the root element of the Draggable. | ||
> Default value is 'div'. | ||
Tag name or the node definition to render the root element of the Draggable. | ||
Default value is 'div'. | ||
@@ -498,0 +499,0 @@ ```jsx |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
495
241449
15