Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sortable-dnd

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sortable-dnd - npm Package Compare versions

Comparing version 0.4.4 to 0.4.5

14

dist/sortable.js
/*!
* sortable-dnd v0.4.4
* sortable-dnd v0.4.5
* open source under the MIT license

@@ -571,3 +571,3 @@ * https://github.com/mfuu/sortable-dnd#readme

onTrulyStarted: function onTrulyStarted(dragEl, sortable) {
sortable.animator.collect(dragEl);
sortable.animator.collect(dragEl, dragEl, dragEl.parentNode);
selectedElements[this.groupName].forEach(function (node) {

@@ -593,3 +593,3 @@ if (node == dragEl) return;

var _this2 = this;
multiTo.sortable.animator.collect(dragEl);
multiTo.sortable.animator.collect(dragEl, dragEl, dragEl.parentNode);
var index = selectedElements[this.groupName].indexOf(dragEl);

@@ -725,3 +725,3 @@ selectedElements[this.groupName].forEach(function (node, i) {

var _this = this;
container = container || dragEl.parentNode;
if (!container) return;
var children = _toConsumableArray(Array.from(container.children));

@@ -1191,3 +1191,3 @@ var _this$_getRange = this._getRange(children, dragEl, dropEl),

if (autoScroll) {
autoScroller.update(this.el, scrollThreshold, downEvent, moveEvent);
autoScroller.update(this.scrollEl, scrollThreshold, downEvent, moveEvent);
}

@@ -1222,3 +1222,3 @@ if (!this._allowPut()) return;

var parentEl = insert ? rootEl : dropEl.parentNode;
from.sortable.animator.collect(dragEl, target);
from.sortable.animator.collect(dragEl, target, dragEl.parentNode);
if (isMultiple) this.multiplayer.onChange(dragEl, this);

@@ -1249,3 +1249,3 @@ to = {

var parentEl = dropEl.parentNode;
this.animator.collect(dragEl, dropEl);
this.animator.collect(dragEl, dropEl, parentEl);
if (isMultiple) this.multiplayer.onChange(dragEl, this);

@@ -1252,0 +1252,0 @@ to = {

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Sortable=e()}(this,function(){"use strict";function F(e,t){var n,o=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)),o}function c(o){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?F(Object(i),!0).forEach(function(t){var e,n;e=o,n=i[t=t],(t=function(t){t=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===e?String:Number)(t);n=n.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):F(Object(i)).forEach(function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(i,t))})}return o}function H(t){return(H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function I(t){return function(t){if(Array.isArray(t))return L(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){var n;if(t)return"string"==typeof t?L(t,e):"Map"===(n="Object"===(n=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?L(t,e):void 0}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function L(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}var R={capture:!1,passive:!1},k=/\s+/g,n={start:["pointerdown","touchstart","mousedown"],move:["pointermove","touchmove","mousemove"],end:["pointerup","pointercancel","touchend","touchcancel","mouseup"]};function t(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var W,f=t(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),z=t(/Edge/i),l=t(/safari/i)&&!t(/chrome/i)&&!t(/android/i),q=(W=!1,document.addEventListener("checkIfSupportPassive",null,{get passive(){return W=!0}}),W),U="undefined"==typeof window||"undefined"==typeof document?"":(i=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],"ms"!==(i=(Array.prototype.slice.call(i).join("").match(/-(moz|webkit|ms)-/)||""===i.OLink&&["","o"])[1])?i&&i.length?i[0].toUpperCase()+i.substr(1):"":"ms");function u(t,e){t.style["".concat(U,"Transition")]=e?"none"===e?"none":"".concat(e):""}function h(t,e){t.style["".concat(U,"Transform")]=e?"".concat(e):""}function p(t,e,n){window.addEventListener?t.addEventListener(e,n,!(!q&&f)&&R):window.attachEvent&&t.attachEvent("on"+e,n)}function o(t,e,n){window.removeEventListener?t.removeEventListener(e,n,!(!q&&f)&&R):window.detachEvent&&t.detachEvent("on"+e,n)}function V(t){var n=t,o=t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0]||t.pointerType&&"touch"===t.pointerType&&t,t=o?document.elementFromPoint(e.clientX,e.clientY):t.target;return o&&(n.clientX=o.clientX,n.clientY=o.clientY,n.pageX=o.pageX,n.pageY=o.pageY,n.screenX=o.screenX,n.screenY=o.screenY),{touch:o,event:n,target:t}}function a(t){for(var e={top:0,left:0,height:t.offsetHeight,width:t.offsetWidth},n=d();e.top+=t.offsetTop,e.left+=t.offsetLeft,t!==n&&(t=t.offsetParent););return e}function d(){var t=document.scrollingElement;return!t||t.contains(document.body)?document:t}function m(t){var e,n,o,i,r,s,a,l=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},c=2<arguments.length?arguments[2]:void 0;if(t.getBoundingClientRect||t===window){if(t!==window&&t.parentNode&&t!==d()){if(n=(e=t.getBoundingClientRect()).top,o=e.left,i=e.bottom,r=e.right,s=e.height,a=e.width,l.parent&&t.parentNode!==t.ownerDocument.body)for(var u,h=t.parentNode;h&&h.getBoundingClientRect&&h!==t.ownerDocument.body;){if((u=h.getBoundingClientRect()).height<s)return n=u.top,o=u.left,i=u.bottom,r=u.right,s=u.height,{top:n,left:o,bottom:i,right:r,width:a=u.width,height:s};h=h.parentNode}}else o=n=0,i=window.innerHeight,r=window.innerWidth,s=window.innerHeight,a=window.innerWidth;if((l.block||l.relative)&&t!==window&&(c=c||t.parentNode,!f))do{if(c&&c.getBoundingClientRect&&("none"!==y(c,"transform")||l.relative&&"static"!==y(c,"position"))){var p=c.getBoundingClientRect();n-=p.top+parseInt(y(c,"border-top-width")),o-=p.left+parseInt(y(c,"border-left-width")),i=n+e.height,r=o+e.width;break}}while(c=c.parentNode);return{top:n,left:o,bottom:i,right:r,width:a,height:s}}}function Z(t,e,n,o){if(t){n=n||document;do{if(null==e){var i=I(Array.from(n.children)),r=i.indexOf(t);if(-1<r)return i[r];for(var s=0;s<i.length;s++)if($(t,i[s]))return i[s]}else if(">"===e[0]?t.parentNode===n&&v(t,e):v(t,e)||o&&t===n)return t}while(t=t.parentNode)}return null}function $(t,e){if(e.compareDocumentPosition)return e===t||16&e.compareDocumentPosition(t);if(e.contains&&1===t.nodeType)return e.contains(t)&&e!==t;for(;t=t.parentNode;)if(t===e)return 1}function g(t,e,n){var o;t&&e&&(t.classList?t.classList[n?"add":"remove"](e):(o=(" "+t.className+" ").replace(k," ").replace(" "+e+" "," "),t.className=(o+(n?" "+e:"")).replace(k," ")))}function v(t,e){if(e&&(">"===e[0]&&(e=e.substring(1)),t))try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return}}function G(t,e){return t.top!==e.top||t.left!==e.left}function y(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];o[e=e in o||-1!==e.indexOf("webkit")?e:"-webkit-"+e]=n+("string"==typeof n?"":"px")}}var b="Sortable"+Date.now(),i={sortable:null,nodes:[]},s=c({},i),w=c({},i),_={};function J(t){this.options=t||{},this.groupName=t.group.name}function K(){this.autoScrollAnimationFrame=null,this.speed={x:10,y:10}}function Q(){this.animations=[]}function tt(){this.helper=null}J.prototype={allowDrag:function(t){return this.options.multiple&&_[this.groupName]&&_[this.groupName].length&&-1<_[this.groupName].indexOf(t)},getHelper:function(){var n=document.createElement("div");return _[this.groupName].forEach(function(t,e){t=t.cloneNode(!0);t.style="\n opacity: ".concat(0===e?1:.5,";\n position: absolute;\n z-index: ").concat(e,";\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n "),n.appendChild(t)}),n},select:function(t,e,n){var o,i=this;e&&(_[this.groupName]||(_[this.groupName]=[]),o=_[this.groupName].indexOf(e),g(e,this.options.selectedClass,o<0),t=c(c({},n),{},{event:t}),o<0?(_[this.groupName].push(e),n.sortable._dispatchEvent("onSelect",t)):(_[this.groupName].splice(o,1),n.sortable._dispatchEvent("onDeselect",t)),_[this.groupName].sort(function(t,e){return i._sortByOffset(a(t),a(e))}))},onDrag:function(t){s.sortable=t,s.nodes=_[this.groupName].map(function(t){return{node:t,rect:m(t),offset:a(t)}}),w.sortable=t},onTrulyStarted:function(e,t){t.animator.collect(e),_[this.groupName].forEach(function(t){t!=e&&t.parentNode.removeChild(t)}),t.animator.animate(t.options.animation)},onChange:function(t,e){var n=m(t),o=a(t);w.sortable=e,w.nodes=_[this.groupName].map(function(t){return{node:t,rect:n,offset:o}})},onDrop:function(t,n,e,o){var i=this,r=(w.sortable.animator.collect(n),_[this.groupName].indexOf(n)),e=(_[this.groupName].forEach(function(t,e){e<r?n.parentNode.insertBefore(t,n):(e=0<e?_[i.groupName][e-1]:n,n.parentNode.insertBefore(t,e.nextSibling))}),s.sortable=e.sortable,w.nodes=_[this.groupName].map(function(t){return{node:t,rect:m(t),offset:a(t)}}),this._offsetChanged(s.nodes,w.nodes)),o=c(c({},o()),{},{changed:e,event:t});w.sortable.el!=s.sortable.el&&s.sortable._dispatchEvent("onDrop",o),w.sortable._dispatchEvent("onDrop",o),w.sortable.animator.animate(w.sortable.options.animation)},_sortByOffset:function(t,e){return t.top==e.top?t.left>e.left:t.top>e.top},_offsetChanged:function(t,n){return!!t.find(function(e){return G(n.find(function(t){return t.node===e.node}).offset,e.offset)})}},window.requestAnimationFrame||(window.requestAnimationFrame=function(t){return setTimeout(t,17)}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),K.prototype={clear:function(){null!=this.autoScrollAnimationFrame&&(cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=null)},update:function(t,e,n,o){var i=this;n&&o&&this.autoScroll(t,e,o),cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=requestAnimationFrame(function(){return i.update(t,e,n,o)})},autoScroll:function(t,e,n){var o,i,r,s,a,l,c,u,h,p,f,d;t&&(o=n.clientX,n=n.clientY,void 0!==o)&&void 0!==n&&(h=m(t))&&(f=t.scrollTop,i=t.scrollLeft,r=t.scrollHeight,p=t.scrollWidth,s=h.top,a=h.right,l=h.bottom,c=h.left,d=h.height,u=0<f&&s<=n&&n<=s+e,h=i+h.width<p&&o<=a&&a-e<=o,p=f+d<r&&n<=l&&l-e<=n,f=(d=f=0)<i&&c<=o&&o<=c+e?Math.floor(Math.max(-1,(o-c)/e-1)*this.speed.x):h?Math.ceil(Math.min(1,(o-a)/e+1)*this.speed.x):0,(d=u?Math.floor(Math.max(-1,(n-s)/e-1)*this.speed.y):p?Math.ceil(Math.min(1,(n-l)/e+1)*this.speed.y):0)&&(t.scrollTop+=d),f)&&(t.scrollLeft+=f)}},Q.prototype={collect:function(t,e,n){var o=this,i=(n=n||t.parentNode,I(Array.from(n.children))),e=this._getRange(i,t,e),r=e.start,e=e.end,n=(this.animations.length=0,Math.floor(n.scrollHeight/t.offsetHeight)),t=Math.min(i.length-1,n);r<0&&(r=e,e=t),i.slice(r,(e=e<0?t:e)+1).forEach(function(t){o.animations.push({node:t,rect:m(t)})})},animate:function(n){var o=this;this.animations.forEach(function(t){var e=t.node,t=t.rect;o._excute(e,t,n)})},_excute:function(t,e){var n=e.left,e=e.top,o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:150,i=m(t),e=e-i.top,n=n-i.left;u(t,"none"),h(t,"translate3d(".concat(n,"px, ").concat(e,"px, 0)")),t.offsetWidth,u(t,"".concat(o,"ms")),h(t,"translate3d(0px, 0px, 0px)"),clearTimeout(t.animated),t.animated=setTimeout(function(){u(t,""),h(t,""),t.animated=null},o)},_getRange:function(t,e,n){e=t.indexOf(e),t=t.indexOf(n);return t<e&&(e=(n=[t,e])[0],t=n[1]),{start:e,end:t}}},tt.prototype={get node(){return this.helper},destroy:function(){this.helper&&this.helper.parentNode&&this.helper.parentNode.removeChild(this.helper),this.helper=null},move:function(t,e){h(this.helper,"translate3d(".concat(t,"px, ").concat(e,"px, 0)"))},init:function(t,e,n,o,i){if(!this.helper){var r,s=o.fallbackOnBody,a=o.ghostClass,o=o.ghostStyle,o=void 0===o?{}:o,s=s?document.body:n,l=(this.helper=e.cloneNode(!0),g(this.helper,a,!0),c({"box-sizing":"border-box",top:t.top,left:t.left,width:t.width,height:t.height,position:"fixed",opacity:"0.8","z-index":1e5,"pointer-events":"none"},o));for(r in l)y(this.helper,r,l[r]);u(this.helper,"none"),h(this.helper,"translate3d(0px, 0px, 0px)"),s.appendChild(this.helper);n=i.x/parseInt(this.helper.style.width)*100,e=i.y/parseInt(this.helper.style.height)*100;y(this.helper,"transform-origin","".concat(n,"% ").concat(e,"%")),y(this.helper,"transform","translateZ(0)")}}};function et(t){var e;D&&(e=t.touches?t.touches[0]:t,e=nt(e.clientX,e.clientY))&&(S=e)!==N.group&&e[b]._onMove(t)}function nt(i,r){var s;return A.some(function(t){var e,n,o=t[b].options.emptyInsertThreshold;if(o)return n=m(t,{parent:!0}),e=i>=n.left-o&&i<=n.right+o,n=r>=n.top-o&&r<=n.bottom+o,e&&n?s=t:void 0}),s}function r(){var t,e={from:c({},j),to:c({},B)};return C&&(t={from:c({},s),to:c({},w)},e.from=c(c({},t.from),e.from),e.to=c(c({},t.to),e.to)),e}var S,D,E,N,x,O,C,T,M,ot={sortable:null,group:null,node:null,rect:{},offset:{}},A=[],P=new tt,j=c({},ot),B=c({},ot),it={x:0,y:0},X={x:0,y:0};function Y(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));(t[b]=this).el=t,this.ownerDocument=t.ownerDocument,this.scrollEl=function(t,e){if(t&&t.getBoundingClientRect){var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=y(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return d();if(o||e)return n;o=!0}}}while(n=n.parentNode)}return d()}(t,!0),this.options=e=Object.assign({},e);var n,o,i,r={group:"",animation:150,multiple:!1,draggable:null,handle:null,onDrag:null,onMove:null,onDrop:null,onChange:null,autoScroll:!0,scrollThreshold:25,delay:0,delayOnTouchOnly:!1,disabled:!1,ghostClass:"",ghostStyle:{},chosenClass:"",selectedClass:"",fallbackOnBody:!1,stopPropagation:!1,supportPointer:"onpointerdown"in window&&!l,supportTouch:"ontouchstart"in window,emptyInsertThreshold:5};for(n in r)n in this.options||(this.options[n]=r[n]);for(i in e=e,s="group_"+Number(Math.random().toString().slice(-3)+Date.now()).toString(32),o={},(a=e.group)&&"object"==H(a)||(a={name:a,pull:!0,put:!0}),o.name=a.name||s,o.pull=a.pull,o.put=a.put,e.group=o,this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));var s=this.options,a=s.supportPointer,e=s.supportTouch;p(t,a?"pointerdown":e?"touchstart":"mousedown",this._onDrag),A.push(t),this.multiplayer=new J(this.options),this.animator=new Q,T=new K}return(Y.prototype={constructor:Y,get helper(){return P.node},destroy:function(){this._dispatchEvent("destroy",this),this.el[b]=null;for(var t=0;t<n.start.length;t++)o(this.el,n.start[t],this._onDrag);this._clearState(),A.splice(A.indexOf(this.el),1),0==A.length&&(T=null),this.el=null},_onDrag:function(t){var e=this;if(!D&&!this.options.disabled&&this.options.group.pull&&(!/mousedown|pointerdown/.test(t.type)||0===t.button)){var n=V(t),o=n.touch,i=n.event,n=n.target;if(!(l&&n&&"SELECT"===n.tagName.toUpperCase()||n===this.el)){var r=this.options,s=r.draggable,r=r.handle;if(("function"!=typeof r||r(t))&&("string"!=typeof r||v(n,r))){if("function"==typeof s){r=s(t);if(!r)return;!function(e){if(e){var t=document.createElement("div");try{return t.appendChild(e.cloneNode(!0)),1==e.nodeType}catch(t){return e==window||e==document}}}(r)||(D=r)}else D=Z(n,s,this.el,!1);D&&!D.animated&&(o&&(D.style["touch-action"]="none"),t=D.parentNode,O=o,(N=i).sortable=this,N.group=t,(C=this.options.multiple&&this.multiplayer.allowDrag(D))&&this.multiplayer.onDrag(this),r=m(D),n=a(D),j={sortable:this,group:t,node:D,rect:r,offset:n},B.group=t,B.sortable=this,it={x:i.clientX-r.left,y:i.clientY-r.top},this.options.supportPointer?p(this.ownerDocument,"pointermove",et):p(this.ownerDocument,o?"touchmove":"mousemove",et),n=(s=this.options).delay,t=s.delayOnTouchOnly,!n||t&&!o||z||f?this._onStart():(clearTimeout(M),M=setTimeout(function(){return e._onStart()},n)))}}}},_onStart:function(){S=this.el,this.options.supportPointer?(p(this.ownerDocument,"pointermove",this._onMove),p(this.ownerDocument,"pointerup",this._onDrop),p(this.ownerDocument,"pointercancel",this._onDrop)):O?(p(this.ownerDocument,"touchmove",this._onMove),p(this.ownerDocument,"touchend",this._onDrop),p(this.ownerDocument,"touchcancel",this._onDrop)):(p(this.ownerDocument,"mousemove",this._onMove),p(this.ownerDocument,"mouseup",this._onDrop));try{document.selection?setTimeout(function(){document.selection.empty()},0):window.getSelection().removeAllRanges()}catch(t){}},_onTrulyStarted:function(){var t;x||(this._dispatchEvent("onDrag",c(c({},r()),{},{event:N})),C&&this.multiplayer.onTrulyStarted(D,this),t=C?this.multiplayer.getHelper():D,P.init(j.rect,t,this.el,this.options,it),g(D,this.options.chosenClass,!0),D.style["will-change"]="transform",l&&y(document.body,"user-select","none"))},_onMove:function(t){var e,n,o,i;this._preventEvent(t),N&&D&&(i=(e=t).clientX,e=e.clientY,n=i-X.x,o=e-X.y,X.x=i,X.y=e,void 0!==i&&void 0!==e&&Math.abs(n)<=0&&Math.abs(o)<=0||(e=(i=V(t)).event,n=i.target,this._onTrulyStarted(),x=e,o=t.clientX-N.clientX,i=t.clientY-N.clientY,P.move(o,i),this._dispatchEvent("onMove",c(c({},r()),{},{event:e})),o=(t=this.options).autoScroll,i=t.scrollThreshold,o&&T.update(this.el,i,N,x),!this._allowPut())||(E=Z(n,this.options.draggable,S,!1))===D||E&&E.animated||E&&$(E,D)||(S!==j.sortable.el?n!==S&&function(t,e,n){for(var o=t.lastElementChild;o&&(o===e||"none"===y(o,"display")||n&&!v(o,n));)o=o.previousElementSibling;return o}(S,P.node)?E&&this._onInsert(e,!1):this._onInsert(e,!0):E&&this._onChange(e)))},_allowPut:function(){var t,e;return N.group===this.el||!!this.options.group.put&&(t=this.options.group.name,(e=N.sortable.options.group).name)&&t&&e.name===t},_onInsert:function(t,e){var n=e?D:E,o=e?S:E.parentNode;j.sortable.animator.collect(D,n),C&&this.multiplayer.onChange(D,this),B={sortable:this,group:o,node:n,rect:m(D),offset:a(D)},j.sortable._dispatchEvent("onRemove",c(c({},r()),{},{event:t})),e?o.appendChild(D):o.insertBefore(D,n),this._dispatchEvent("onAdd",c(c({},r()),{},{event:t})),j.sortable.animator.animate(),j.group=o,j.sortable=this},_onChange:function(t){var e=E.parentNode,t=(this.animator.collect(D,E),C&&this.multiplayer.onChange(D,this),B={sortable:this,group:e,node:E,rect:m(E),offset:a(E)},this._dispatchEvent("onChange",c(c({},r()),{},{event:t})),a(D));t.top<B.offset.top||t.left<B.offset.left?e.insertBefore(D,E.nextSibling):e.insertBefore(D,E),this.animator.animate(),j.group=e,j.sortable=this},_onDrop:function(t){var e;this._unbindMoveEvents(),this._unbindDropEvents(),this._preventEvent(t),T.clear(),clearTimeout(M),D&&(g(D,this.options.chosenClass,!1),O&&(D.style["touch-action"]=""),D.style["will-change"]=""),D&&N&&x?(j.group=N.group,j.sortable=N.sortable,C?this.multiplayer.onDrop(t,D,N,r):(B.rect=m(D),B.offset=a(D),e=G(j.offset,B.offset),e=c(c({},r()),{},{changed:e,event:t}),B.sortable.el!==j.sortable.el&&j.sortable._dispatchEvent("onDrop",e),B.sortable._dispatchEvent("onDrop",e)),l&&y(document.body,"user-select","")):this.options.multiple&&this.multiplayer.select(t,D,c({},j)),this._clearState()},_preventEvent:function(t){void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),this.options.stopPropagation&&t.stopPropagation&&t.stopPropagation()},_dispatchEvent:function(t,e){t=this.options[t];"function"==typeof t&&t(e)},_clearState:function(){D=E=N=x=O=C=M=Y.ghost=null,it=X={x:0,y:0},j=B=c({},ot),P.destroy()},_unbindMoveEvents:function(){for(var t=0;t<n.move.length;t++)o(this.ownerDocument,n.move[t],this._onMove),o(this.ownerDocument,n.move[t],et)},_unbindDropEvents:function(){for(var t=0;t<n.end.length;t++)o(this.ownerDocument,n.end[t],this._onDrop)}}).utils={getRect:m,getOffset:a},Y});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Sortable=e()}(this,function(){"use strict";function F(e,t){var n,o=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)),o}function c(o){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?F(Object(i),!0).forEach(function(t){var e,n;e=o,n=i[t=t],(t=function(t){t=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===e?String:Number)(t);n=n.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):F(Object(i)).forEach(function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(i,t))})}return o}function H(t){return(H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function I(t){return function(t){if(Array.isArray(t))return L(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){var n;if(t)return"string"==typeof t?L(t,e):"Map"===(n="Object"===(n=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?L(t,e):void 0}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function L(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}var R={capture:!1,passive:!1},k=/\s+/g,n={start:["pointerdown","touchstart","mousedown"],move:["pointermove","touchmove","mousemove"],end:["pointerup","pointercancel","touchend","touchcancel","mouseup"]};function t(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var W,f=t(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),z=t(/Edge/i),l=t(/safari/i)&&!t(/chrome/i)&&!t(/android/i),q=(W=!1,document.addEventListener("checkIfSupportPassive",null,{get passive(){return W=!0}}),W),U="undefined"==typeof window||"undefined"==typeof document?"":(i=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],"ms"!==(i=(Array.prototype.slice.call(i).join("").match(/-(moz|webkit|ms)-/)||""===i.OLink&&["","o"])[1])?i&&i.length?i[0].toUpperCase()+i.substr(1):"":"ms");function u(t,e){t.style["".concat(U,"Transition")]=e?"none"===e?"none":"".concat(e):""}function h(t,e){t.style["".concat(U,"Transform")]=e?"".concat(e):""}function p(t,e,n){window.addEventListener?t.addEventListener(e,n,!(!q&&f)&&R):window.attachEvent&&t.attachEvent("on"+e,n)}function o(t,e,n){window.removeEventListener?t.removeEventListener(e,n,!(!q&&f)&&R):window.detachEvent&&t.detachEvent("on"+e,n)}function V(t){var n=t,o=t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0]||t.pointerType&&"touch"===t.pointerType&&t,t=o?document.elementFromPoint(e.clientX,e.clientY):t.target;return o&&(n.clientX=o.clientX,n.clientY=o.clientY,n.pageX=o.pageX,n.pageY=o.pageY,n.screenX=o.screenX,n.screenY=o.screenY),{touch:o,event:n,target:t}}function a(t){for(var e={top:0,left:0,height:t.offsetHeight,width:t.offsetWidth},n=d();e.top+=t.offsetTop,e.left+=t.offsetLeft,t!==n&&(t=t.offsetParent););return e}function d(){var t=document.scrollingElement;return!t||t.contains(document.body)?document:t}function m(t){var e,n,o,i,r,s,a,l=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},c=2<arguments.length?arguments[2]:void 0;if(t.getBoundingClientRect||t===window){if(t!==window&&t.parentNode&&t!==d()){if(n=(e=t.getBoundingClientRect()).top,o=e.left,i=e.bottom,r=e.right,s=e.height,a=e.width,l.parent&&t.parentNode!==t.ownerDocument.body)for(var u,h=t.parentNode;h&&h.getBoundingClientRect&&h!==t.ownerDocument.body;){if((u=h.getBoundingClientRect()).height<s)return n=u.top,o=u.left,i=u.bottom,r=u.right,s=u.height,{top:n,left:o,bottom:i,right:r,width:a=u.width,height:s};h=h.parentNode}}else o=n=0,i=window.innerHeight,r=window.innerWidth,s=window.innerHeight,a=window.innerWidth;if((l.block||l.relative)&&t!==window&&(c=c||t.parentNode,!f))do{if(c&&c.getBoundingClientRect&&("none"!==y(c,"transform")||l.relative&&"static"!==y(c,"position"))){var p=c.getBoundingClientRect();n-=p.top+parseInt(y(c,"border-top-width")),o-=p.left+parseInt(y(c,"border-left-width")),i=n+e.height,r=o+e.width;break}}while(c=c.parentNode);return{top:n,left:o,bottom:i,right:r,width:a,height:s}}}function Z(t,e,n,o){if(t){n=n||document;do{if(null==e){var i=I(Array.from(n.children)),r=i.indexOf(t);if(-1<r)return i[r];for(var s=0;s<i.length;s++)if($(t,i[s]))return i[s]}else if(">"===e[0]?t.parentNode===n&&v(t,e):v(t,e)||o&&t===n)return t}while(t=t.parentNode)}return null}function $(t,e){if(e.compareDocumentPosition)return e===t||16&e.compareDocumentPosition(t);if(e.contains&&1===t.nodeType)return e.contains(t)&&e!==t;for(;t=t.parentNode;)if(t===e)return 1}function g(t,e,n){var o;t&&e&&(t.classList?t.classList[n?"add":"remove"](e):(o=(" "+t.className+" ").replace(k," ").replace(" "+e+" "," "),t.className=(o+(n?" "+e:"")).replace(k," ")))}function v(t,e){if(e&&(">"===e[0]&&(e=e.substring(1)),t))try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return}}function G(t,e){return t.top!==e.top||t.left!==e.left}function y(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];o[e=e in o||-1!==e.indexOf("webkit")?e:"-webkit-"+e]=n+("string"==typeof n?"":"px")}}var b="Sortable"+Date.now(),i={sortable:null,nodes:[]},s=c({},i),w=c({},i),_={};function J(t){this.options=t||{},this.groupName=t.group.name}function K(){this.autoScrollAnimationFrame=null,this.speed={x:10,y:10}}function Q(){this.animations=[]}function tt(){this.helper=null}J.prototype={allowDrag:function(t){return this.options.multiple&&_[this.groupName]&&_[this.groupName].length&&-1<_[this.groupName].indexOf(t)},getHelper:function(){var n=document.createElement("div");return _[this.groupName].forEach(function(t,e){t=t.cloneNode(!0);t.style="\n opacity: ".concat(0===e?1:.5,";\n position: absolute;\n z-index: ").concat(e,";\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n "),n.appendChild(t)}),n},select:function(t,e,n){var o,i=this;e&&(_[this.groupName]||(_[this.groupName]=[]),o=_[this.groupName].indexOf(e),g(e,this.options.selectedClass,o<0),t=c(c({},n),{},{event:t}),o<0?(_[this.groupName].push(e),n.sortable._dispatchEvent("onSelect",t)):(_[this.groupName].splice(o,1),n.sortable._dispatchEvent("onDeselect",t)),_[this.groupName].sort(function(t,e){return i._sortByOffset(a(t),a(e))}))},onDrag:function(t){s.sortable=t,s.nodes=_[this.groupName].map(function(t){return{node:t,rect:m(t),offset:a(t)}}),w.sortable=t},onTrulyStarted:function(e,t){t.animator.collect(e,e,e.parentNode),_[this.groupName].forEach(function(t){t!=e&&t.parentNode.removeChild(t)}),t.animator.animate(t.options.animation)},onChange:function(t,e){var n=m(t),o=a(t);w.sortable=e,w.nodes=_[this.groupName].map(function(t){return{node:t,rect:n,offset:o}})},onDrop:function(t,n,e,o){var i=this,r=(w.sortable.animator.collect(n,n,n.parentNode),_[this.groupName].indexOf(n)),e=(_[this.groupName].forEach(function(t,e){e<r?n.parentNode.insertBefore(t,n):(e=0<e?_[i.groupName][e-1]:n,n.parentNode.insertBefore(t,e.nextSibling))}),s.sortable=e.sortable,w.nodes=_[this.groupName].map(function(t){return{node:t,rect:m(t),offset:a(t)}}),this._offsetChanged(s.nodes,w.nodes)),o=c(c({},o()),{},{changed:e,event:t});w.sortable.el!=s.sortable.el&&s.sortable._dispatchEvent("onDrop",o),w.sortable._dispatchEvent("onDrop",o),w.sortable.animator.animate(w.sortable.options.animation)},_sortByOffset:function(t,e){return t.top==e.top?t.left>e.left:t.top>e.top},_offsetChanged:function(t,n){return!!t.find(function(e){return G(n.find(function(t){return t.node===e.node}).offset,e.offset)})}},window.requestAnimationFrame||(window.requestAnimationFrame=function(t){return setTimeout(t,17)}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),K.prototype={clear:function(){null!=this.autoScrollAnimationFrame&&(cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=null)},update:function(t,e,n,o){var i=this;n&&o&&this.autoScroll(t,e,o),cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=requestAnimationFrame(function(){return i.update(t,e,n,o)})},autoScroll:function(t,e,n){var o,i,r,s,a,l,c,u,h,p,f,d;t&&(o=n.clientX,n=n.clientY,void 0!==o)&&void 0!==n&&(h=m(t))&&(f=t.scrollTop,i=t.scrollLeft,r=t.scrollHeight,p=t.scrollWidth,s=h.top,a=h.right,l=h.bottom,c=h.left,d=h.height,u=0<f&&s<=n&&n<=s+e,h=i+h.width<p&&o<=a&&a-e<=o,p=f+d<r&&n<=l&&l-e<=n,f=(d=f=0)<i&&c<=o&&o<=c+e?Math.floor(Math.max(-1,(o-c)/e-1)*this.speed.x):h?Math.ceil(Math.min(1,(o-a)/e+1)*this.speed.x):0,(d=u?Math.floor(Math.max(-1,(n-s)/e-1)*this.speed.y):p?Math.ceil(Math.min(1,(n-l)/e+1)*this.speed.y):0)&&(t.scrollTop+=d),f)&&(t.scrollLeft+=f)}},Q.prototype={collect:function(t,e,n){var o,i,r=this;n&&(o=I(Array.from(n.children)),i=(e=this._getRange(o,t,e)).start,e=e.end,this.animations.length=0,n=Math.floor(n.scrollHeight/t.offsetHeight),t=Math.min(o.length-1,n),i<0&&(i=e,e=t),o.slice(i,(e=e<0?t:e)+1).forEach(function(t){r.animations.push({node:t,rect:m(t)})}))},animate:function(n){var o=this;this.animations.forEach(function(t){var e=t.node,t=t.rect;o._excute(e,t,n)})},_excute:function(t,e){var n=e.left,e=e.top,o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:150,i=m(t),e=e-i.top,n=n-i.left;u(t,"none"),h(t,"translate3d(".concat(n,"px, ").concat(e,"px, 0)")),t.offsetWidth,u(t,"".concat(o,"ms")),h(t,"translate3d(0px, 0px, 0px)"),clearTimeout(t.animated),t.animated=setTimeout(function(){u(t,""),h(t,""),t.animated=null},o)},_getRange:function(t,e,n){e=t.indexOf(e),t=t.indexOf(n);return t<e&&(e=(n=[t,e])[0],t=n[1]),{start:e,end:t}}},tt.prototype={get node(){return this.helper},destroy:function(){this.helper&&this.helper.parentNode&&this.helper.parentNode.removeChild(this.helper),this.helper=null},move:function(t,e){h(this.helper,"translate3d(".concat(t,"px, ").concat(e,"px, 0)"))},init:function(t,e,n,o,i){if(!this.helper){var r,s=o.fallbackOnBody,a=o.ghostClass,o=o.ghostStyle,o=void 0===o?{}:o,s=s?document.body:n,l=(this.helper=e.cloneNode(!0),g(this.helper,a,!0),c({"box-sizing":"border-box",top:t.top,left:t.left,width:t.width,height:t.height,position:"fixed",opacity:"0.8","z-index":1e5,"pointer-events":"none"},o));for(r in l)y(this.helper,r,l[r]);u(this.helper,"none"),h(this.helper,"translate3d(0px, 0px, 0px)"),s.appendChild(this.helper);n=i.x/parseInt(this.helper.style.width)*100,e=i.y/parseInt(this.helper.style.height)*100;y(this.helper,"transform-origin","".concat(n,"% ").concat(e,"%")),y(this.helper,"transform","translateZ(0)")}}};function et(t){var e;D&&(e=t.touches?t.touches[0]:t,e=nt(e.clientX,e.clientY))&&(S=e)!==N.group&&e[b]._onMove(t)}function nt(i,r){var s;return A.some(function(t){var e,n,o=t[b].options.emptyInsertThreshold;if(o)return n=m(t,{parent:!0}),e=i>=n.left-o&&i<=n.right+o,n=r>=n.top-o&&r<=n.bottom+o,e&&n?s=t:void 0}),s}function r(){var t,e={from:c({},j),to:c({},B)};return C&&(t={from:c({},s),to:c({},w)},e.from=c(c({},t.from),e.from),e.to=c(c({},t.to),e.to)),e}var S,D,E,N,x,O,C,T,M,ot={sortable:null,group:null,node:null,rect:{},offset:{}},A=[],P=new tt,j=c({},ot),B=c({},ot),it={x:0,y:0},X={x:0,y:0};function Y(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));(t[b]=this).el=t,this.ownerDocument=t.ownerDocument,this.scrollEl=function(t,e){if(t&&t.getBoundingClientRect){var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=y(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return d();if(o||e)return n;o=!0}}}while(n=n.parentNode)}return d()}(t,!0),this.options=e=Object.assign({},e);var n,o,i,r={group:"",animation:150,multiple:!1,draggable:null,handle:null,onDrag:null,onMove:null,onDrop:null,onChange:null,autoScroll:!0,scrollThreshold:25,delay:0,delayOnTouchOnly:!1,disabled:!1,ghostClass:"",ghostStyle:{},chosenClass:"",selectedClass:"",fallbackOnBody:!1,stopPropagation:!1,supportPointer:"onpointerdown"in window&&!l,supportTouch:"ontouchstart"in window,emptyInsertThreshold:5};for(n in r)n in this.options||(this.options[n]=r[n]);for(i in e=e,s="group_"+Number(Math.random().toString().slice(-3)+Date.now()).toString(32),o={},(a=e.group)&&"object"==H(a)||(a={name:a,pull:!0,put:!0}),o.name=a.name||s,o.pull=a.pull,o.put=a.put,e.group=o,this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));var s=this.options,a=s.supportPointer,e=s.supportTouch;p(t,a?"pointerdown":e?"touchstart":"mousedown",this._onDrag),A.push(t),this.multiplayer=new J(this.options),this.animator=new Q,T=new K}return(Y.prototype={constructor:Y,get helper(){return P.node},destroy:function(){this._dispatchEvent("destroy",this),this.el[b]=null;for(var t=0;t<n.start.length;t++)o(this.el,n.start[t],this._onDrag);this._clearState(),A.splice(A.indexOf(this.el),1),0==A.length&&(T=null),this.el=null},_onDrag:function(t){var e=this;if(!D&&!this.options.disabled&&this.options.group.pull&&(!/mousedown|pointerdown/.test(t.type)||0===t.button)){var n=V(t),o=n.touch,i=n.event,n=n.target;if(!(l&&n&&"SELECT"===n.tagName.toUpperCase()||n===this.el)){var r=this.options,s=r.draggable,r=r.handle;if(("function"!=typeof r||r(t))&&("string"!=typeof r||v(n,r))){if("function"==typeof s){r=s(t);if(!r)return;!function(e){if(e){var t=document.createElement("div");try{return t.appendChild(e.cloneNode(!0)),1==e.nodeType}catch(t){return e==window||e==document}}}(r)||(D=r)}else D=Z(n,s,this.el,!1);D&&!D.animated&&(o&&(D.style["touch-action"]="none"),t=D.parentNode,O=o,(N=i).sortable=this,N.group=t,(C=this.options.multiple&&this.multiplayer.allowDrag(D))&&this.multiplayer.onDrag(this),r=m(D),n=a(D),j={sortable:this,group:t,node:D,rect:r,offset:n},B.group=t,B.sortable=this,it={x:i.clientX-r.left,y:i.clientY-r.top},this.options.supportPointer?p(this.ownerDocument,"pointermove",et):p(this.ownerDocument,o?"touchmove":"mousemove",et),n=(s=this.options).delay,t=s.delayOnTouchOnly,!n||t&&!o||z||f?this._onStart():(clearTimeout(M),M=setTimeout(function(){return e._onStart()},n)))}}}},_onStart:function(){S=this.el,this.options.supportPointer?(p(this.ownerDocument,"pointermove",this._onMove),p(this.ownerDocument,"pointerup",this._onDrop),p(this.ownerDocument,"pointercancel",this._onDrop)):O?(p(this.ownerDocument,"touchmove",this._onMove),p(this.ownerDocument,"touchend",this._onDrop),p(this.ownerDocument,"touchcancel",this._onDrop)):(p(this.ownerDocument,"mousemove",this._onMove),p(this.ownerDocument,"mouseup",this._onDrop));try{document.selection?setTimeout(function(){document.selection.empty()},0):window.getSelection().removeAllRanges()}catch(t){}},_onTrulyStarted:function(){var t;x||(this._dispatchEvent("onDrag",c(c({},r()),{},{event:N})),C&&this.multiplayer.onTrulyStarted(D,this),t=C?this.multiplayer.getHelper():D,P.init(j.rect,t,this.el,this.options,it),g(D,this.options.chosenClass,!0),D.style["will-change"]="transform",l&&y(document.body,"user-select","none"))},_onMove:function(t){var e,n,o,i;this._preventEvent(t),N&&D&&(i=(e=t).clientX,e=e.clientY,n=i-X.x,o=e-X.y,X.x=i,X.y=e,void 0!==i&&void 0!==e&&Math.abs(n)<=0&&Math.abs(o)<=0||(e=(i=V(t)).event,n=i.target,this._onTrulyStarted(),x=e,o=t.clientX-N.clientX,i=t.clientY-N.clientY,P.move(o,i),this._dispatchEvent("onMove",c(c({},r()),{},{event:e})),o=(t=this.options).autoScroll,i=t.scrollThreshold,o&&T.update(this.scrollEl,i,N,x),!this._allowPut())||(E=Z(n,this.options.draggable,S,!1))===D||E&&E.animated||E&&$(E,D)||(S!==j.sortable.el?n!==S&&function(t,e,n){for(var o=t.lastElementChild;o&&(o===e||"none"===y(o,"display")||n&&!v(o,n));)o=o.previousElementSibling;return o}(S,P.node)?E&&this._onInsert(e,!1):this._onInsert(e,!0):E&&this._onChange(e)))},_allowPut:function(){var t,e;return N.group===this.el||!!this.options.group.put&&(t=this.options.group.name,(e=N.sortable.options.group).name)&&t&&e.name===t},_onInsert:function(t,e){var n=e?D:E,o=e?S:E.parentNode;j.sortable.animator.collect(D,n,D.parentNode),C&&this.multiplayer.onChange(D,this),B={sortable:this,group:o,node:n,rect:m(D),offset:a(D)},j.sortable._dispatchEvent("onRemove",c(c({},r()),{},{event:t})),e?o.appendChild(D):o.insertBefore(D,n),this._dispatchEvent("onAdd",c(c({},r()),{},{event:t})),j.sortable.animator.animate(),j.group=o,j.sortable=this},_onChange:function(t){var e=E.parentNode,t=(this.animator.collect(D,E,e),C&&this.multiplayer.onChange(D,this),B={sortable:this,group:e,node:E,rect:m(E),offset:a(E)},this._dispatchEvent("onChange",c(c({},r()),{},{event:t})),a(D));t.top<B.offset.top||t.left<B.offset.left?e.insertBefore(D,E.nextSibling):e.insertBefore(D,E),this.animator.animate(),j.group=e,j.sortable=this},_onDrop:function(t){var e;this._unbindMoveEvents(),this._unbindDropEvents(),this._preventEvent(t),T.clear(),clearTimeout(M),D&&(g(D,this.options.chosenClass,!1),O&&(D.style["touch-action"]=""),D.style["will-change"]=""),D&&N&&x?(j.group=N.group,j.sortable=N.sortable,C?this.multiplayer.onDrop(t,D,N,r):(B.rect=m(D),B.offset=a(D),e=G(j.offset,B.offset),e=c(c({},r()),{},{changed:e,event:t}),B.sortable.el!==j.sortable.el&&j.sortable._dispatchEvent("onDrop",e),B.sortable._dispatchEvent("onDrop",e)),l&&y(document.body,"user-select","")):this.options.multiple&&this.multiplayer.select(t,D,c({},j)),this._clearState()},_preventEvent:function(t){void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),this.options.stopPropagation&&t.stopPropagation&&t.stopPropagation()},_dispatchEvent:function(t,e){t=this.options[t];"function"==typeof t&&t(e)},_clearState:function(){D=E=N=x=O=C=M=Y.ghost=null,it=X={x:0,y:0},j=B=c({},ot),P.destroy()},_unbindMoveEvents:function(){for(var t=0;t<n.move.length;t++)o(this.ownerDocument,n.move[t],this._onMove),o(this.ownerDocument,n.move[t],et)},_unbindDropEvents:function(){for(var t=0;t<n.end.length;t++)o(this.ownerDocument,n.end[t],this._onDrop)}}).utils={getRect:m,getOffset:a},Y});
{
"name": "sortable-dnd",
"version": "0.4.4",
"version": "0.4.5",
"description": "JS library for drag-and-drop lists, supports sortable and draggable",

@@ -5,0 +5,0 @@ "main": "dist/sortable.js",

@@ -64,6 +64,6 @@ [![npm](https://img.shields.io/npm/v/sortable-dnd.svg)](https://www.npmjs.com/package/sortable-dnd) [![npm](https://img.shields.io/npm/dt/sortable-dnd.svg)](https://npm-stat.com/charts.html?package=sortable-dnd) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE)

},
onSelect: ({ group, target, event }) => {
onSelect: (params) => {
// code
},
onDeselect: ({ group, target, event }) => {
onDeselect: (params) => {
// code

@@ -70,0 +70,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc