From 7d0bb49bb2c20a7be0ab280d267b89ccd4ef713b Mon Sep 17 00:00:00 2001 From: smmercuri Date: Thu, 26 Oct 2023 14:40:14 +0100 Subject: [PATCH] minified sortable lib --- corsscripts/sortable.min.js | 254 ++++++++++++++++++++++++++++++++++++ 1 file changed, 254 insertions(+) create mode 100644 corsscripts/sortable.min.js diff --git a/corsscripts/sortable.min.js b/corsscripts/sortable.min.js new file mode 100644 index 00000000000..82da77a6233 --- /dev/null +++ b/corsscripts/sortable.min.js @@ -0,0 +1,254 @@ + +function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;});} +keys.push.apply(keys,symbols);} +return keys;} +function _objectSpread2(target){for(var i=1;i=0)continue;target[key]=source[key];} +return target;} +function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key];}} +return target;} +function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();} +function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);} +function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);} +function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);} +function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i'&&(selector=selector.substring(1));if(el){try{if(el.matches){return el.matches(selector);}else if(el.msMatchesSelector){return el.msMatchesSelector(selector);}else if(el.webkitMatchesSelector){return el.webkitMatchesSelector(selector);}}catch(_){return false;}} +return false;} +function getParentOrHost(el){return el.host&&el!==document&&el.host.nodeType?el.host:el.parentNode;} +function closest(el,selector,ctx,includeCTX){if(el){ctx=ctx||document;do{if(selector!=null&&(selector[0]==='>'?el.parentNode===ctx&&matches(el,selector):matches(el,selector))||includeCTX&&el===ctx){return el;} +if(el===ctx)break;}while(el=getParentOrHost(el));} +return null;} +var R_SPACE=/\s+/g;function toggleClass(el,name,state){if(el&&name){if(el.classList){el.classList[state?'add':'remove'](name);}else{var className=(' '+el.className+' ').replace(R_SPACE,' ').replace(' '+name+' ',' ');el.className=(className+(state?' '+name:'')).replace(R_SPACE,' ');}}} +function css(el,prop,val){var style=el&&el.style;if(style){if(val===void 0){if(document.defaultView&&document.defaultView.getComputedStyle){val=document.defaultView.getComputedStyle(el,'');}else if(el.currentStyle){val=el.currentStyle;} +return prop===void 0?val:val[prop];}else{if(!(prop in style)&&prop.indexOf('webkit')===-1){prop='-webkit-'+prop;} +style[prop]=val+(typeof val==='string'?'':'px');}}} +function matrix(el,selfOnly){var appliedTransforms='';if(typeof el==='string'){appliedTransforms=el;}else{do{var transform=css(el,'transform');if(transform&&transform!=='none'){appliedTransforms=transform+' '+appliedTransforms;}}while(!selfOnly&&(el=el.parentNode));} +var matrixFn=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return matrixFn&&new matrixFn(appliedTransforms);} +function find(ctx,tagName,iterator){if(ctx){var list=ctx.getElementsByTagName(tagName),i=0,n=list.length;if(iterator){for(;i=parentSideVal;}else{visible=elSideVal<=parentSideVal;} +if(!visible)return parent;if(parent===getWindowScrollingElement())break;parent=getParentAutoScrollElement(parent,false);} +return false;} +function getChild(el,childNum,options,includeDragEl){var currentChild=0,i=0,children=el.children;while(i2&&arguments[2]!==undefined?arguments[2]:{},originalEvent=_ref.evt,data=_objectWithoutProperties(_ref,_excluded);PluginManager.pluginEvent.bind(Sortable)(eventName,sortable,_objectSpread2({dragEl:dragEl,parentEl:parentEl,ghostEl:ghostEl,rootEl:rootEl,nextEl:nextEl,lastDownEl:lastDownEl,cloneEl:cloneEl,cloneHidden:cloneHidden,dragStarted:moved,putSortable:putSortable,activeSortable:Sortable.active,originalEvent:originalEvent,oldIndex:oldIndex,oldDraggableIndex:oldDraggableIndex,newIndex:newIndex,newDraggableIndex:newDraggableIndex,hideGhostForTarget:_hideGhostForTarget,unhideGhostForTarget:_unhideGhostForTarget,cloneNowHidden:function cloneNowHidden(){cloneHidden=true;},cloneNowShown:function cloneNowShown(){cloneHidden=false;},dispatchSortableEvent:function dispatchSortableEvent(name){_dispatchEvent({sortable:sortable,name:name,originalEvent:originalEvent});}},data));};function _dispatchEvent(info){dispatchEvent(_objectSpread2({putSortable:putSortable,cloneEl:cloneEl,targetEl:dragEl,rootEl:rootEl,oldIndex:oldIndex,oldDraggableIndex:oldDraggableIndex,newIndex:newIndex,newDraggableIndex:newDraggableIndex},info));} +var dragEl,parentEl,ghostEl,rootEl,nextEl,lastDownEl,cloneEl,cloneHidden,oldIndex,newIndex,oldDraggableIndex,newDraggableIndex,activeGroup,putSortable,awaitingDragStarted=false,ignoreNextClick=false,sortables=[],tapEvt,touchEvt,lastDx,lastDy,tapDistanceLeft,tapDistanceTop,moved,lastTarget,lastDirection,pastFirstInvertThresh=false,isCircumstantialInvert=false,targetMoveDistance,ghostRelativeParent,ghostRelativeParentInitialScroll=[],_silent=false,savedInputChecked=[];var documentExists=typeof document!=='undefined',PositionGhostAbsolutely=IOS,CSSFloatProperty=Edge||IE11OrLess?'cssFloat':'float',supportDraggable=documentExists&&!ChromeForAndroid&&!IOS&&'draggable'in document.createElement('div'),supportCssPointerEvents=function(){if(!documentExists)return;if(IE11OrLess){return false;} +var el=document.createElement('x');el.style.cssText='pointer-events:auto';return el.style.pointerEvents==='auto';}(),_detectDirection=function _detectDirection(el,options){var elCSS=css(el),elWidth=parseInt(elCSS.width)-parseInt(elCSS.paddingLeft)-parseInt(elCSS.paddingRight)-parseInt(elCSS.borderLeftWidth)-parseInt(elCSS.borderRightWidth),child1=getChild(el,0,options),child2=getChild(el,1,options),firstChildCSS=child1&&css(child1),secondChildCSS=child2&&css(child2),firstChildWidth=firstChildCSS&&parseInt(firstChildCSS.marginLeft)+parseInt(firstChildCSS.marginRight)+getRect(child1).width,secondChildWidth=secondChildCSS&&parseInt(secondChildCSS.marginLeft)+parseInt(secondChildCSS.marginRight)+getRect(child2).width;if(elCSS.display==='flex'){return elCSS.flexDirection==='column'||elCSS.flexDirection==='column-reverse'?'vertical':'horizontal';} +if(elCSS.display==='grid'){return elCSS.gridTemplateColumns.split(' ').length<=1?'vertical':'horizontal';} +if(child1&&firstChildCSS["float"]&&firstChildCSS["float"]!=='none'){var touchingSideChild2=firstChildCSS["float"]==='left'?'left':'right';return child2&&(secondChildCSS.clear==='both'||secondChildCSS.clear===touchingSideChild2)?'vertical':'horizontal';} +return child1&&(firstChildCSS.display==='block'||firstChildCSS.display==='flex'||firstChildCSS.display==='table'||firstChildCSS.display==='grid'||firstChildWidth>=elWidth&&elCSS[CSSFloatProperty]==='none'||child2&&elCSS[CSSFloatProperty]==='none'&&firstChildWidth+secondChildWidth>elWidth)?'vertical':'horizontal';},_dragElInRowColumn=function _dragElInRowColumn(dragRect,targetRect,vertical){var dragElS1Opp=vertical?dragRect.left:dragRect.top,dragElS2Opp=vertical?dragRect.right:dragRect.bottom,dragElOppLength=vertical?dragRect.width:dragRect.height,targetS1Opp=vertical?targetRect.left:targetRect.top,targetS2Opp=vertical?targetRect.right:targetRect.bottom,targetOppLength=vertical?targetRect.width:targetRect.height;return dragElS1Opp===targetS1Opp||dragElS2Opp===targetS2Opp||dragElS1Opp+dragElOppLength/2===targetS1Opp+targetOppLength/2;},_detectNearestEmptySortable=function _detectNearestEmptySortable(x,y){var ret;sortables.some(function(sortable){var threshold=sortable[expando].options.emptyInsertThreshold;if(!threshold||lastChild(sortable))return;var rect=getRect(sortable),insideHorizontally=x>=rect.left-threshold&&x<=rect.right+threshold,insideVertically=y>=rect.top-threshold&&y<=rect.bottom+threshold;if(insideHorizontally&&insideVertically){return ret=sortable;}});return ret;},_prepareGroup=function _prepareGroup(options){function toFn(value,pull){return function(to,from,dragEl,evt){var sameGroup=to.options.group.name&&from.options.group.name&&to.options.group.name===from.options.group.name;if(value==null&&(pull||sameGroup)){return true;}else if(value==null||value===false){return false;}else if(pull&&value==='clone'){return value;}else if(typeof value==='function'){return toFn(value(to,from,dragEl,evt),pull)(to,from,dragEl,evt);}else{var otherGroup=(pull?to:from).options.group.name;return value===true||typeof value==='string'&&value===otherGroup||value.join&&value.indexOf(otherGroup)>-1;}};} +var group={};var originalGroup=options.group;if(!originalGroup||_typeof(originalGroup)!='object'){originalGroup={name:originalGroup};} +group.name=originalGroup.name;group.checkPull=toFn(originalGroup.pull,true);group.checkPut=toFn(originalGroup.put);group.revertClone=originalGroup.revertClone;options.group=group;},_hideGhostForTarget=function _hideGhostForTarget(){if(!supportCssPointerEvents&&ghostEl){css(ghostEl,'display','none');}},_unhideGhostForTarget=function _unhideGhostForTarget(){if(!supportCssPointerEvents&&ghostEl){css(ghostEl,'display','');}};if(documentExists&&!ChromeForAndroid){document.addEventListener('click',function(evt){if(ignoreNextClick){evt.preventDefault();evt.stopPropagation&&evt.stopPropagation();evt.stopImmediatePropagation&&evt.stopImmediatePropagation();ignoreNextClick=false;return false;}},true);} +var nearestEmptyInsertDetectEvent=function nearestEmptyInsertDetectEvent(evt){if(dragEl){evt=evt.touches?evt.touches[0]:evt;var nearest=_detectNearestEmptySortable(evt.clientX,evt.clientY);if(nearest){var event={};for(var i in evt){if(evt.hasOwnProperty(i)){event[i]=evt[i];}} +event.target=event.rootEl=nearest;event.preventDefault=void 0;event.stopPropagation=void 0;nearest[expando]._onDragOver(event);}}};var _checkOutsideTargetEl=function _checkOutsideTargetEl(evt){if(dragEl){dragEl.parentNode[expando]._isOutsideThisEl(evt.target);}};function Sortable(el,options){if(!(el&&el.nodeType&&el.nodeType===1)){throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(el));} +this.el=el;this.options=options=_extends({},options);el[expando]=this;var defaults={group:null,sort:true,disabled:false,store:null,handle:null,draggable:/^[uo]l$/i.test(el.nodeName)?'>li':'>*',swapThreshold:1,invertSwap:false,invertedSwapThreshold:null,removeCloneOnHide:true,direction:function direction(){return _detectDirection(el,this.options);},ghostClass:'sortable-ghost',chosenClass:'sortable-chosen',dragClass:'sortable-drag',ignore:'a, img',filter:null,preventOnFilter:true,animation:0,easing:null,setData:function setData(dataTransfer,dragEl){dataTransfer.setData('Text',dragEl.textContent);},dropBubble:false,dragoverBubble:false,dataIdAttr:'data-id',delay:0,delayOnTouchOnly:false,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:false,fallbackClass:'sortable-fallback',fallbackOnBody:false,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Sortable.supportPointer!==false&&'PointerEvent'in window&&!Safari,emptyInsertThreshold:5};PluginManager.initializePlugins(this,el,defaults);for(var name in defaults){!(name in options)&&(options[name]=defaults[name]);} +_prepareGroup(options);for(var fn in this){if(fn.charAt(0)==='_'&&typeof this[fn]==='function'){this[fn]=this[fn].bind(this);}} +this.nativeDraggable=options.forceFallback?false:supportDraggable;if(this.nativeDraggable){this.options.touchStartThreshold=1;} +if(options.supportPointer){on(el,'pointerdown',this._onTapStart);}else{on(el,'mousedown',this._onTapStart);on(el,'touchstart',this._onTapStart);} +if(this.nativeDraggable){on(el,'dragover',this);on(el,'dragenter',this);} +sortables.push(this.el);options.store&&options.store.get&&this.sort(options.store.get(this)||[]);_extends(this,AnimationStateManager());} +Sortable.prototype={constructor:Sortable,_isOutsideThisEl:function _isOutsideThisEl(target){if(!this.el.contains(target)&&target!==this.el){lastTarget=null;}},_getDirection:function _getDirection(evt,target){return typeof this.options.direction==='function'?this.options.direction.call(this,evt,target,dragEl):this.options.direction;},_onTapStart:function _onTapStart(evt){if(!evt.cancelable)return;var _this=this,el=this.el,options=this.options,preventOnFilter=options.preventOnFilter,type=evt.type,touch=evt.touches&&evt.touches[0]||evt.pointerType&&evt.pointerType==='touch'&&evt,target=(touch||evt).target,originalTarget=evt.target.shadowRoot&&(evt.path&&evt.path[0]||evt.composedPath&&evt.composedPath()[0])||target,filter=options.filter;_saveInputCheckedState(el);if(dragEl){return;} +if(/mousedown|pointerdown/.test(type)&&evt.button!==0||options.disabled){return;} +if(originalTarget.isContentEditable){return;} +if(!this.nativeDraggable&&Safari&&target&&target.tagName.toUpperCase()==='SELECT'){return;} +target=closest(target,options.draggable,el,false);if(target&&target.animated){return;} +if(lastDownEl===target){return;} +oldIndex=index(target);oldDraggableIndex=index(target,options.draggable);if(typeof filter==='function'){if(filter.call(this,evt,target,this)){_dispatchEvent({sortable:_this,rootEl:originalTarget,name:'filter',targetEl:target,toEl:el,fromEl:el});pluginEvent('filter',_this,{evt:evt});preventOnFilter&&evt.cancelable&&evt.preventDefault();return;}}else if(filter){filter=filter.split(',').some(function(criteria){criteria=closest(originalTarget,criteria.trim(),el,false);if(criteria){_dispatchEvent({sortable:_this,rootEl:criteria,name:'filter',targetEl:target,fromEl:el,toEl:el});pluginEvent('filter',_this,{evt:evt});return true;}});if(filter){preventOnFilter&&evt.cancelable&&evt.preventDefault();return;}} +if(options.handle&&!closest(originalTarget,options.handle,el,false)){return;} +this._prepareDragStart(evt,touch,target);},_prepareDragStart:function _prepareDragStart(evt,touch,target){var _this=this,el=_this.el,options=_this.options,ownerDocument=el.ownerDocument,dragStartFn;if(target&&!dragEl&&target.parentNode===el){var dragRect=getRect(target);rootEl=el;dragEl=target;parentEl=dragEl.parentNode;nextEl=dragEl.nextSibling;lastDownEl=target;activeGroup=options.group;Sortable.dragged=dragEl;tapEvt={target:dragEl,clientX:(touch||evt).clientX,clientY:(touch||evt).clientY};tapDistanceLeft=tapEvt.clientX-dragRect.left;tapDistanceTop=tapEvt.clientY-dragRect.top;this._lastX=(touch||evt).clientX;this._lastY=(touch||evt).clientY;dragEl.style['will-change']='all';dragStartFn=function dragStartFn(){pluginEvent('delayEnded',_this,{evt:evt});if(Sortable.eventCanceled){_this._onDrop();return;} +_this._disableDelayedDragEvents();if(!FireFox&&_this.nativeDraggable){dragEl.draggable=true;} +_this._triggerDragStart(evt,touch);_dispatchEvent({sortable:_this,name:'choose',originalEvent:evt});toggleClass(dragEl,options.chosenClass,true);};options.ignore.split(',').forEach(function(criteria){find(dragEl,criteria.trim(),_disableDraggable);});on(ownerDocument,'dragover',nearestEmptyInsertDetectEvent);on(ownerDocument,'mousemove',nearestEmptyInsertDetectEvent);on(ownerDocument,'touchmove',nearestEmptyInsertDetectEvent);on(ownerDocument,'mouseup',_this._onDrop);on(ownerDocument,'touchend',_this._onDrop);on(ownerDocument,'touchcancel',_this._onDrop);if(FireFox&&this.nativeDraggable){this.options.touchStartThreshold=4;dragEl.draggable=true;} +pluginEvent('delayStart',this,{evt:evt});if(options.delay&&(!options.delayOnTouchOnly||touch)&&(!this.nativeDraggable||!(Edge||IE11OrLess))){if(Sortable.eventCanceled){this._onDrop();return;} +on(ownerDocument,'mouseup',_this._disableDelayedDrag);on(ownerDocument,'touchend',_this._disableDelayedDrag);on(ownerDocument,'touchcancel',_this._disableDelayedDrag);on(ownerDocument,'mousemove',_this._delayedDragTouchMoveHandler);on(ownerDocument,'touchmove',_this._delayedDragTouchMoveHandler);options.supportPointer&&on(ownerDocument,'pointermove',_this._delayedDragTouchMoveHandler);_this._dragStartTimer=setTimeout(dragStartFn,options.delay);}else{dragStartFn();}}},_delayedDragTouchMoveHandler:function _delayedDragTouchMoveHandler(e){var touch=e.touches?e.touches[0]:e;if(Math.max(Math.abs(touch.clientX-this._lastX),Math.abs(touch.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))){this._disableDelayedDrag();}},_disableDelayedDrag:function _disableDelayedDrag(){dragEl&&_disableDraggable(dragEl);clearTimeout(this._dragStartTimer);this._disableDelayedDragEvents();},_disableDelayedDragEvents:function _disableDelayedDragEvents(){var ownerDocument=this.el.ownerDocument;off(ownerDocument,'mouseup',this._disableDelayedDrag);off(ownerDocument,'touchend',this._disableDelayedDrag);off(ownerDocument,'touchcancel',this._disableDelayedDrag);off(ownerDocument,'mousemove',this._delayedDragTouchMoveHandler);off(ownerDocument,'touchmove',this._delayedDragTouchMoveHandler);off(ownerDocument,'pointermove',this._delayedDragTouchMoveHandler);},_triggerDragStart:function _triggerDragStart(evt,touch){touch=touch||evt.pointerType=='touch'&&evt;if(!this.nativeDraggable||touch){if(this.options.supportPointer){on(document,'pointermove',this._onTouchMove);}else if(touch){on(document,'touchmove',this._onTouchMove);}else{on(document,'mousemove',this._onTouchMove);}}else{on(dragEl,'dragend',this);on(rootEl,'dragstart',this._onDragStart);} +try{if(document.selection){_nextTick(function(){document.selection.empty();});}else{window.getSelection().removeAllRanges();}}catch(err){}},_dragStarted:function _dragStarted(fallback,evt){awaitingDragStarted=false;if(rootEl&&dragEl){pluginEvent('dragStarted',this,{evt:evt});if(this.nativeDraggable){on(document,'dragover',_checkOutsideTargetEl);} +var options=this.options;!fallback&&toggleClass(dragEl,options.dragClass,false);toggleClass(dragEl,options.ghostClass,true);Sortable.active=this;fallback&&this._appendGhost();_dispatchEvent({sortable:this,name:'start',originalEvent:evt});}else{this._nulling();}},_emulateDragOver:function _emulateDragOver(){if(touchEvt){this._lastX=touchEvt.clientX;this._lastY=touchEvt.clientY;_hideGhostForTarget();var target=document.elementFromPoint(touchEvt.clientX,touchEvt.clientY);var parent=target;while(target&&target.shadowRoot){target=target.shadowRoot.elementFromPoint(touchEvt.clientX,touchEvt.clientY);if(target===parent)break;parent=target;} +dragEl.parentNode[expando]._isOutsideThisEl(target);if(parent){do{if(parent[expando]){var inserted=void 0;inserted=parent[expando]._onDragOver({clientX:touchEvt.clientX,clientY:touchEvt.clientY,target:target,rootEl:parent});if(inserted&&!this.options.dragoverBubble){break;}} +target=parent;} +while(parent=parent.parentNode);} +_unhideGhostForTarget();}},_onTouchMove:function _onTouchMove(evt){if(tapEvt){var options=this.options,fallbackTolerance=options.fallbackTolerance,fallbackOffset=options.fallbackOffset,touch=evt.touches?evt.touches[0]:evt,ghostMatrix=ghostEl&&matrix(ghostEl,true),scaleX=ghostEl&&ghostMatrix&&ghostMatrix.a,scaleY=ghostEl&&ghostMatrix&&ghostMatrix.d,relativeScrollOffset=PositionGhostAbsolutely&&ghostRelativeParent&&getRelativeScrollOffset(ghostRelativeParent),dx=(touch.clientX-tapEvt.clientX+fallbackOffset.x)/(scaleX||1)+(relativeScrollOffset?relativeScrollOffset[0]-ghostRelativeParentInitialScroll[0]:0)/(scaleX||1),dy=(touch.clientY-tapEvt.clientY+fallbackOffset.y)/(scaleY||1)+(relativeScrollOffset?relativeScrollOffset[1]-ghostRelativeParentInitialScroll[1]:0)/(scaleY||1);if(!Sortable.active&&!awaitingDragStarted){if(fallbackTolerance&&Math.max(Math.abs(touch.clientX-this._lastX),Math.abs(touch.clientY-this._lastY))=0){_dispatchEvent({rootEl:parentEl,name:'add',toEl:parentEl,fromEl:rootEl,originalEvent:evt});_dispatchEvent({sortable:this,name:'remove',toEl:parentEl,originalEvent:evt});_dispatchEvent({rootEl:parentEl,name:'sort',toEl:parentEl,fromEl:rootEl,originalEvent:evt});_dispatchEvent({sortable:this,name:'sort',toEl:parentEl,originalEvent:evt});} +putSortable&&putSortable.save();}else{if(newIndex!==oldIndex){if(newIndex>=0){_dispatchEvent({sortable:this,name:'update',toEl:parentEl,originalEvent:evt});_dispatchEvent({sortable:this,name:'sort',toEl:parentEl,originalEvent:evt});}}} +if(Sortable.active){if(newIndex==null||newIndex===-1){newIndex=oldIndex;newDraggableIndex=oldDraggableIndex;} +_dispatchEvent({sortable:this,name:'end',toEl:parentEl,originalEvent:evt});this.save();}}} +this._nulling();},_nulling:function _nulling(){pluginEvent('nulling',this);rootEl=dragEl=parentEl=ghostEl=nextEl=cloneEl=lastDownEl=cloneHidden=tapEvt=touchEvt=moved=newIndex=newDraggableIndex=oldIndex=oldDraggableIndex=lastTarget=lastDirection=putSortable=activeGroup=Sortable.dragged=Sortable.ghost=Sortable.clone=Sortable.active=null;savedInputChecked.forEach(function(el){el.checked=true;});savedInputChecked.length=lastDx=lastDy=0;},handleEvent:function handleEvent(evt){switch(evt.type){case'drop':case'dragend':this._onDrop(evt);break;case'dragenter':case'dragover':if(dragEl){this._onDragOver(evt);_globalDragOver(evt);} +break;case'selectstart':evt.preventDefault();break;}},toArray:function toArray(){var order=[],el,children=this.el.children,i=0,n=children.length,options=this.options;for(;irect.right+spacer||evt.clientX<=rect.right&&evt.clientY>rect.bottom&&evt.clientX>=rect.left:evt.clientX>rect.right&&evt.clientY>rect.top||evt.clientX<=rect.right&&evt.clientY>rect.bottom+spacer;} +function _getSwapDirection(evt,target,targetRect,vertical,swapThreshold,invertedSwapThreshold,invertSwap,isLastTarget){var mouseOnAxis=vertical?evt.clientY:evt.clientX,targetLength=vertical?targetRect.height:targetRect.width,targetS1=vertical?targetRect.top:targetRect.left,targetS2=vertical?targetRect.bottom:targetRect.right,invert=false;if(!invertSwap){if(isLastTarget&&targetMoveDistancetargetS1+targetLength*invertedSwapThreshold/2:mouseOnAxistargetS2-targetMoveDistance){return-lastDirection;}}else{invert=true;}}else{if(mouseOnAxis>targetS1+targetLength*(1-swapThreshold)/2&&mouseOnAxistargetS2-targetLength*invertedSwapThreshold/2){return mouseOnAxis>targetS1+targetLength/2?1:-1;}} +return 0;} +function _getInsertDirection(target){if(index(dragEl)1){multiDragElements.forEach(function(multiDragElement){sortable.addAnimationState({target:multiDragElement,rect:folding?getRect(multiDragElement):dragRect});unsetRect(multiDragElement);multiDragElement.fromRect=dragRect;fromSortable.removeAnimationState(multiDragElement);});folding=false;insertMultiDragElements(!this.options.removeCloneOnHide,rootEl);}},dragOverCompleted:function dragOverCompleted(_ref10){var sortable=_ref10.sortable,isOwner=_ref10.isOwner,insertion=_ref10.insertion,activeSortable=_ref10.activeSortable,parentEl=_ref10.parentEl,putSortable=_ref10.putSortable;var options=this.options;if(insertion){if(isOwner){activeSortable._hideClone();} +initialFolding=false;if(options.animation&&multiDragElements.length>1&&(folding||!isOwner&&!activeSortable.options.sort&&!putSortable)){var dragRectAbsolute=getRect(dragEl$1,false,true,true);multiDragElements.forEach(function(multiDragElement){if(multiDragElement===dragEl$1)return;setRect(multiDragElement,dragRectAbsolute);parentEl.appendChild(multiDragElement);});folding=true;} +if(!isOwner){if(!folding){removeMultiDragElements();} +if(multiDragElements.length>1){var clonesHiddenBefore=clonesHidden;activeSortable._showClone(sortable);if(activeSortable.options.animation&&!clonesHidden&&clonesHiddenBefore){multiDragClones.forEach(function(clone){activeSortable.addAnimationState({target:clone,rect:clonesFromRect});clone.fromRect=clonesFromRect;clone.thisAnimationDuration=null;});}}else{activeSortable._showClone(sortable);}}}},dragOverAnimationCapture:function dragOverAnimationCapture(_ref11){var dragRect=_ref11.dragRect,isOwner=_ref11.isOwner,activeSortable=_ref11.activeSortable;multiDragElements.forEach(function(multiDragElement){multiDragElement.thisAnimationDuration=null;});if(activeSortable.options.animation&&!isOwner&&activeSortable.multiDrag.isMultiDrag){clonesFromRect=_extends({},dragRect);var dragMatrix=matrix(dragEl$1,true);clonesFromRect.top-=dragMatrix.f;clonesFromRect.left-=dragMatrix.e;}},dragOverAnimationComplete:function dragOverAnimationComplete(){if(folding){folding=false;removeMultiDragElements();}},drop:function drop(_ref12){var evt=_ref12.originalEvent,rootEl=_ref12.rootEl,parentEl=_ref12.parentEl,sortable=_ref12.sortable,dispatchSortableEvent=_ref12.dispatchSortableEvent,oldIndex=_ref12.oldIndex,putSortable=_ref12.putSortable;var toSortable=putSortable||this.sortable;if(!evt)return;var options=this.options,children=parentEl.children;if(!dragStarted){if(options.multiDragKey&&!this.multiDragKeyDown){this._deselectMultiDrag();} +toggleClass(dragEl$1,options.selectedClass,!~multiDragElements.indexOf(dragEl$1));if(!~multiDragElements.indexOf(dragEl$1)){multiDragElements.push(dragEl$1);dispatchEvent({sortable:sortable,rootEl:rootEl,name:'select',targetEl:dragEl$1,originalEvent:evt});if(evt.shiftKey&&lastMultiDragSelect&&sortable.el.contains(lastMultiDragSelect)){var lastIndex=index(lastMultiDragSelect),currentIndex=index(dragEl$1);if(~lastIndex&&~currentIndex&&lastIndex!==currentIndex){var n,i;if(currentIndex>lastIndex){i=lastIndex;n=currentIndex;}else{i=currentIndex;n=lastIndex+1;} +for(;i1){var dragRect=getRect(dragEl$1),multiDragIndex=index(dragEl$1,':not(.'+this.options.selectedClass+')');if(!initialFolding&&options.animation)dragEl$1.thisAnimationDuration=null;toSortable.captureAnimationState();if(!initialFolding){if(options.animation){dragEl$1.fromRect=dragRect;multiDragElements.forEach(function(multiDragElement){multiDragElement.thisAnimationDuration=null;if(multiDragElement!==dragEl$1){var rect=folding?getRect(multiDragElement):dragRect;multiDragElement.fromRect=rect;toSortable.addAnimationState({target:multiDragElement,rect:rect});}});} +removeMultiDragElements();multiDragElements.forEach(function(multiDragElement){if(children[multiDragIndex]){parentEl.insertBefore(multiDragElement,children[multiDragIndex]);}else{parentEl.appendChild(multiDragElement);} +multiDragIndex++;});if(oldIndex===index(dragEl$1)){var update=false;multiDragElements.forEach(function(multiDragElement){if(multiDragElement.sortableIndex!==index(multiDragElement)){update=true;return;}});if(update){dispatchSortableEvent('update');}}} +multiDragElements.forEach(function(multiDragElement){unsetRect(multiDragElement);});toSortable.animateAll();} +multiDragSortable=toSortable;} +if(rootEl===parentEl||putSortable&&putSortable.lastPutMode!=='clone'){multiDragClones.forEach(function(clone){clone.parentNode&&clone.parentNode.removeChild(clone);});}},nullingGlobal:function nullingGlobal(){this.isMultiDrag=dragStarted=false;multiDragClones.length=0;},destroyGlobal:function destroyGlobal(){this._deselectMultiDrag();off(document,'pointerup',this._deselectMultiDrag);off(document,'mouseup',this._deselectMultiDrag);off(document,'touchend',this._deselectMultiDrag);off(document,'keydown',this._checkKeyDown);off(document,'keyup',this._checkKeyUp);},_deselectMultiDrag:function _deselectMultiDrag(evt){if(typeof dragStarted!=="undefined"&&dragStarted)return;if(multiDragSortable!==this.sortable)return;if(evt&&closest(evt.target,this.options.draggable,this.sortable.el,false))return;if(evt&&evt.button!==0)return;while(multiDragElements.length){var el=multiDragElements[0];toggleClass(el,this.options.selectedClass,false);multiDragElements.shift();dispatchEvent({sortable:this.sortable,rootEl:this.sortable.el,name:'deselect',targetEl:el,originalEvent:evt});}},_checkKeyDown:function _checkKeyDown(evt){if(evt.key===this.options.multiDragKey){this.multiDragKeyDown=true;}},_checkKeyUp:function _checkKeyUp(evt){if(evt.key===this.options.multiDragKey){this.multiDragKeyDown=false;}}};return _extends(MultiDrag,{pluginName:'multiDrag',utils:{select:function select(el){var sortable=el.parentNode[expando];if(!sortable||!sortable.options.multiDrag||~multiDragElements.indexOf(el))return;if(multiDragSortable&&multiDragSortable!==sortable){multiDragSortable.multiDrag._deselectMultiDrag();multiDragSortable=sortable;} +toggleClass(el,sortable.options.selectedClass,true);multiDragElements.push(el);},deselect:function deselect(el){var sortable=el.parentNode[expando],index=multiDragElements.indexOf(el);if(!sortable||!sortable.options.multiDrag||!~index)return;toggleClass(el,sortable.options.selectedClass,false);multiDragElements.splice(index,1);}},eventProperties:function eventProperties(){var _this3=this;var oldIndicies=[],newIndicies=[];multiDragElements.forEach(function(multiDragElement){oldIndicies.push({multiDragElement:multiDragElement,index:multiDragElement.sortableIndex});var newIndex;if(folding&&multiDragElement!==dragEl$1){newIndex=-1;}else if(folding){newIndex=index(multiDragElement,':not(.'+_this3.options.selectedClass+')');}else{newIndex=index(multiDragElement);} +newIndicies.push({multiDragElement:multiDragElement,index:newIndex});});return{items:_toConsumableArray(multiDragElements),clones:[].concat(multiDragClones),oldIndicies:oldIndicies,newIndicies:newIndicies};},optionListeners:{multiDragKey:function multiDragKey(key){key=key.toLowerCase();if(key==='ctrl'){key='Control';}else if(key.length>1){key=key.charAt(0).toUpperCase()+key.substr(1);} +return key;}}});} +function insertMultiDragElements(clonesInserted,rootEl){multiDragElements.forEach(function(multiDragElement,i){var target=rootEl.children[multiDragElement.sortableIndex+(clonesInserted?Number(i):0)];if(target){rootEl.insertBefore(multiDragElement,target);}else{rootEl.appendChild(multiDragElement);}});} +function insertMultiDragClones(elementsInserted,rootEl){multiDragClones.forEach(function(clone,i){var target=rootEl.children[clone.sortableIndex+(elementsInserted?Number(i):0)];if(target){rootEl.insertBefore(clone,target);}else{rootEl.appendChild(clone);}});} +function removeMultiDragElements(){multiDragElements.forEach(function(multiDragElement){if(multiDragElement===dragEl$1)return;multiDragElement.parentNode&&multiDragElement.parentNode.removeChild(multiDragElement);});} +Sortable.mount(new AutoScrollPlugin());Sortable.mount(Remove,Revert);export default Sortable;export{MultiDragPlugin as MultiDrag,Sortable,SwapPlugin as Swap}; \ No newline at end of file