sortable-dnd
Advanced tools
Comparing version 0.6.18 to 0.6.19
/*! | ||
* sortable-dnd v0.6.18 | ||
* sortable-dnd v0.6.19 | ||
* open source under the MIT license | ||
@@ -504,3 +504,3 @@ * https://github.com/mfuu/sortable-dnd#readme | ||
var dragElements, cloneElements; | ||
var dragElements, cloneElements, _useSelectHandle; | ||
function Multiple(options) { | ||
@@ -511,8 +511,8 @@ this.options = options || {}; | ||
Multiple.prototype = { | ||
nulling: function nulling() { | ||
dragElements = cloneElements = null; | ||
}, | ||
active: function active() { | ||
return !!dragElements; | ||
}, | ||
nulling: function nulling() { | ||
dragElements = cloneElements = _useSelectHandle = null; | ||
}, | ||
params: function params() { | ||
@@ -538,5 +538,11 @@ return { | ||
}, | ||
useSelectHandle: function useSelectHandle(event, target) { | ||
var selectHandle = this.options.selectHandle; | ||
_useSelectHandle = typeof selectHandle === 'function' && selectHandle(event) || typeof selectHandle === 'string' && matches(target, selectHandle); | ||
return !!_useSelectHandle; | ||
}, | ||
getGhostElement: function getGhostElement() { | ||
if (!dragElements) return null; | ||
var container = document.createElement('div'); | ||
toggleClass(container, this.options.chosenClass, true); | ||
this.selects.forEach(function (node, index) { | ||
@@ -550,33 +556,2 @@ var clone = node.cloneNode(true); | ||
}, | ||
toggleSelected: function toggleSelected(elements, isAdd) { | ||
var _this = this; | ||
if (isAdd) { | ||
elements.forEach(function (el) { | ||
return _this.selects.push(el); | ||
}); | ||
} else { | ||
this.selects = this.selects.filter(function (el) { | ||
return elements.indexOf(el) < 0; | ||
}); | ||
} | ||
}, | ||
toggleClass: function toggleClass$1(state) { | ||
if (!dragElements) return; | ||
for (var i = 0; i < dragElements.length; i++) { | ||
toggleClass(dragElements[i], this.options.chosenClass, state); | ||
} | ||
}, | ||
toggleVisible: function toggleVisible(visible) { | ||
if (!dragElements) return; | ||
if (visible) { | ||
var dragIndex = dragElements.indexOf(Sortable.dragged); | ||
this._viewElements(dragElements, dragIndex, Sortable.dragged); | ||
} else { | ||
this._hideElements(dragElements); | ||
} | ||
}, | ||
useSelectHandle: function useSelectHandle(event, target) { | ||
var selectHandle = this.options.selectHandle; | ||
return !!(typeof selectHandle === 'function' && selectHandle(event) || typeof selectHandle === 'string' && matches(target, selectHandle)); | ||
}, | ||
onChoose: function onChoose() { | ||
@@ -590,9 +565,4 @@ if (!this.options.multiple || this.selects.length === 0 || this.selects.indexOf(Sortable.dragged) < 0) { | ||
dragElements = this.selects; | ||
this.toggleClass(true); | ||
this.toggleChosenClass(true); | ||
}, | ||
onDrag: function onDrag() { | ||
if (!dragElements) return; | ||
this._hideElements(dragElements); | ||
this.toggleClass(false); | ||
}, | ||
onDrop: function onDrop(from, to, isClone) { | ||
@@ -605,9 +575,9 @@ if (!dragElements) return; | ||
css(cloneEl, 'display', 'none'); | ||
this.toggleVisible(true); | ||
cloneElements = dragElements.map(function (el) { | ||
return el.cloneNode(true); | ||
}); | ||
this._viewElements(cloneElements, dragIndex, cloneEl); | ||
this._viewElements(dragElements, dragIndex, dragEl); | ||
this._sortElements(cloneElements, dragIndex, cloneEl); | ||
} else { | ||
this._viewElements(dragElements, dragIndex, cloneEl); | ||
this._sortElements(dragElements, dragIndex, cloneEl); | ||
} | ||
@@ -621,3 +591,9 @@ | ||
}, | ||
onSelect: function onSelect(event, dragEl, sortable) { | ||
onSelect: function onSelect(event, dragEl, fromEl, sortable) { | ||
var _this$options = this.options, | ||
multiple = _this$options.multiple, | ||
selectHandle = _this$options.selectHandle; | ||
if (!(multiple && (selectHandle && _useSelectHandle || !selectHandle && !fromEl))) { | ||
return; | ||
} | ||
var dragIndex = this.selects.indexOf(dragEl); | ||
@@ -650,4 +626,29 @@ toggleClass(dragEl, this.options.selectedClass, dragIndex < 0); | ||
}, | ||
_viewElements: function _viewElements(elements, index, target) { | ||
for (var i = 0; i < elements.length; i++) { | ||
toggleChosenClass: function toggleChosenClass(state) { | ||
if (!dragElements) return; | ||
for (var i = 0, len = dragElements.length; i < len; i++) { | ||
toggleClass(dragElements[i], this.options.chosenClass, state); | ||
} | ||
}, | ||
toggleVisible: function toggleVisible(visible) { | ||
if (!dragElements) return; | ||
for (var i = 0, len = dragElements.length; i < len; i++) { | ||
if (dragElements[i] == Sortable.dragged) continue; | ||
css(dragElements[i], 'display', visible ? '' : 'none'); | ||
} | ||
}, | ||
toggleSelected: function toggleSelected(elements, isAdd) { | ||
var _this = this; | ||
if (isAdd) { | ||
elements.forEach(function (el) { | ||
return _this.selects.push(el); | ||
}); | ||
} else { | ||
this.selects = this.selects.filter(function (el) { | ||
return elements.indexOf(el) < 0; | ||
}); | ||
} | ||
}, | ||
_sortElements: function _sortElements(elements, index, target) { | ||
for (var i = 0, len = elements.length; i < len; i++) { | ||
css(elements[i], 'display', ''); | ||
@@ -661,8 +662,2 @@ if (i < index) { | ||
} | ||
}, | ||
_hideElements: function _hideElements(elements) { | ||
for (var i = 0; i < elements.length; i++) { | ||
if (elements[i] == Sortable.dragged) continue; | ||
css(elements[i], 'display', 'none'); | ||
} | ||
} | ||
@@ -672,3 +667,3 @@ }; | ||
var sortables = []; | ||
var to, from, fromEl, dragEl, dropEl, nextEl, cloneEl, ghostEl, targetEl, parentEl, pullMode, oldIndex, newIndex, fromIndex, dragEvent, moveEvent, lastDropEl, cloneEvent, cloneTarget, listenerNode, lastHoverArea, dragStartTimer, useSelectHandle; | ||
var to, from, fromEl, dragEl, dropEl, nextEl, cloneEl, ghostEl, targetEl, parentEl, pullMode, oldIndex, newIndex, fromIndex, dragEvent, moveEvent, lastDropEl, cloneEvent, cloneTarget, listenerNode, lastHoverArea, dragStartTimer; | ||
function _prepareGroup(options) { | ||
@@ -698,10 +693,10 @@ var group = {}; | ||
var nearestRect; | ||
return sortables.reduce(function (result, sortable) { | ||
var threshold = sortable[expando].options.emptyInsertThreshold; | ||
return sortables.reduce(function (result, element) { | ||
var threshold = element[expando].options.emptyInsertThreshold; | ||
if (threshold == void 0) return; | ||
var rect = getRect(sortable), | ||
var rect = getRect(element), | ||
insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold, | ||
insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold; | ||
if (insideHorizontally && insideVertically && (!nearestRect || nearestRect && rect.left >= nearestRect.left && rect.right <= nearestRect.right && rect.top >= nearestRect.top && rect.bottom <= nearestRect.bottom)) { | ||
result = sortable; | ||
result = element; | ||
nearestRect = rect; | ||
@@ -811,4 +806,3 @@ } | ||
// use multi-select-handle | ||
useSelectHandle = this.multiplayer.useSelectHandle(event, target); | ||
if (useSelectHandle) return; | ||
if (this.multiplayer.useSelectHandle(event, target)) return; | ||
var handle = this.options.handle; | ||
@@ -877,4 +871,4 @@ if (typeof handle === 'function' && !handle(event)) return; | ||
Sortable.dragged = dragEl; | ||
this.multiplayer.onChoose(); | ||
toggleClass(dragEl, this.options.chosenClass, true); | ||
this.multiplayer.onChoose(); | ||
dispatchEvent({ | ||
@@ -904,3 +898,5 @@ sortable: this, | ||
this._appendGhost(); | ||
this.multiplayer.onDrag(); | ||
this.multiplayer.toggleVisible(false); | ||
css(dragEl, 'display', 'none'); | ||
dragEl.parentNode.insertBefore(cloneEl, dragEl); | ||
dispatchEvent({ | ||
@@ -911,5 +907,2 @@ sortable: this, | ||
}); | ||
css(dragEl, 'display', 'none'); | ||
toggleClass(dragEl, this.options.chosenClass, false); | ||
dragEl.parentNode.insertBefore(cloneEl, dragEl); | ||
this.animator.animate(); | ||
@@ -962,3 +955,3 @@ }, | ||
// Init in the move event to prevent conflict with the click event | ||
// init in the move event to prevent conflict with the click event | ||
!moveEvent && this._onStarted(); | ||
@@ -989,11 +982,11 @@ var lockAxis = this.options.lockAxis, | ||
return true; | ||
} else if (!this.options.group.put) { | ||
} | ||
if (!this.options.group.put) { | ||
return false; | ||
} else { | ||
var _this$options$group = this.options.group, | ||
name = _this$options$group.name, | ||
put = _this$options$group.put; | ||
var fromGroup = fromEl[expando].options.group; | ||
return put.join && put.indexOf(fromGroup.name) > -1 || fromGroup.name && name && fromGroup.name === name; | ||
} | ||
var _this$options$group = this.options.group, | ||
name = _this$options$group.name, | ||
put = _this$options$group.put; | ||
var fromGroup = fromEl[expando].options.group; | ||
return put.join && put.indexOf(fromGroup.name) > -1 || fromGroup.name && name && fromGroup.name === name; | ||
}, | ||
@@ -1004,3 +997,3 @@ _getDirection: function _getDirection() { | ||
direction = _this$options2.direction; | ||
return direction ? typeof direction === 'function' ? direction.call(moveEvent.event, dragEl, this) : direction : detectDirection(parentEl, draggable); | ||
return direction ? typeof direction === 'function' ? direction.call(moveEvent.event, cloneEl, this) : direction : detectDirection(parentEl, draggable); | ||
}, | ||
@@ -1088,3 +1081,5 @@ _allowSwap: function _allowSwap() { | ||
dropExist = containes(dropEl, document), | ||
dragRemoved = dropEl === dragEl && !dropExist; | ||
dragRemoved = dropEl === dragEl && !dropExist, | ||
fromSortable = from[expando], | ||
startSortable = fromEl[expando]; | ||
to = this.el; | ||
@@ -1094,3 +1089,3 @@ oldIndex = index(cloneEl); | ||
parentEl = dropExist ? dropEl.parentNode : this.el; | ||
from[expando].animator.collect(cloneEl.parentNode); | ||
fromSortable.animator.collect(cloneEl.parentNode); | ||
this.animator.collect(parentEl); | ||
@@ -1104,4 +1099,4 @@ | ||
css(dragEl, 'display', ''); | ||
fromEl[expando].multiplayer.toggleVisible(true); | ||
if (!fromEl[expando].options.group.revertDrag) { | ||
startSortable.multiplayer.toggleVisible(true); | ||
if (!startSortable.options.group.revertDrag) { | ||
cloneEl.parentNode.insertBefore(dragEl, cloneEl); | ||
@@ -1124,3 +1119,3 @@ } | ||
newIndex = dragRemoved ? fromIndex : index(cloneEl); | ||
if (cloneTo && fromEl[expando].options.group.revertDrag) { | ||
if (cloneTo && startSortable.options.group.revertDrag) { | ||
cloneEvent.target = dragEl; | ||
@@ -1130,3 +1125,3 @@ cloneEvent.newIndex = fromIndex; | ||
dispatchEvent({ | ||
sortable: fromEl[expando], | ||
sortable: startSortable, | ||
name: 'onChange', | ||
@@ -1143,3 +1138,3 @@ params: this._getParams(event, { | ||
dispatchEvent({ | ||
sortable: from[expando], | ||
sortable: fromSortable, | ||
name: 'onRemove', | ||
@@ -1171,3 +1166,3 @@ params: this._getParams(event, { | ||
} | ||
from[expando].animator.animate(); | ||
fromSortable.animator.animate(); | ||
this.animator.animate(); | ||
@@ -1177,2 +1172,3 @@ from = this.el; | ||
_onChange: function _onChange(event) { | ||
this.animator.collect(parentEl); | ||
oldIndex = index(cloneEl); | ||
@@ -1184,3 +1180,2 @@ parentEl = dropEl.parentNode; | ||
} | ||
this.animator.collect(parentEl); | ||
parentEl.insertBefore(cloneEl, nextEl); | ||
@@ -1204,5 +1199,2 @@ newIndex = index(cloneEl); | ||
if (fromEl) { | ||
this.animator.collect(parentEl); | ||
toggleClass(dragEl, this.options.chosenClass, false); | ||
toggleClass(cloneEl, this.options.placeholderClass, false); | ||
from = fromEl; | ||
@@ -1213,3 +1205,5 @@ oldIndex = fromIndex; | ||
} | ||
this.multiplayer.toggleClass(false); | ||
this.animator.collect(parentEl); | ||
this.multiplayer.toggleChosenClass(false); | ||
toggleClass(dragEl, this.options.chosenClass, false); | ||
dispatchEvent({ | ||
@@ -1221,12 +1215,8 @@ sortable: this, | ||
moveEvent && this._onEnd(event); | ||
this.animator.animate(); | ||
!moveEvent && this.animator.animate(); | ||
} | ||
var _this$options3 = this.options, | ||
multiple = _this$options3.multiple, | ||
selectHandle = _this$options3.selectHandle; | ||
if (multiple && (selectHandle && useSelectHandle || !selectHandle && !fromEl)) { | ||
var evt = event.changedTouches ? event.changedTouches[0] : event; | ||
// check whether the event is a click event | ||
!_positionChanged(evt) && this.multiplayer.onSelect(event, dragEl, this); | ||
} | ||
// check whether the event is a click event | ||
var evt = event.changedTouches ? event.changedTouches[0] : event; | ||
!_positionChanged(evt) && this.multiplayer.onSelect(event, dragEl, fromEl, this); | ||
if (ghostEl && ghostEl.parentNode) { | ||
@@ -1240,7 +1230,10 @@ ghostEl.parentNode.removeChild(ghostEl); | ||
_onEnd: function _onEnd(event) { | ||
var params = this._getParams(event); | ||
toggleClass(cloneEl, this.options.chosenClass, false); | ||
toggleClass(cloneEl, this.options.placeholderClass, false); | ||
var isClone = pullMode === 'clone'; | ||
this.multiplayer.onDrop(from, to, isClone); | ||
var params = this._getParams(event); | ||
// swap real drag element to the current drop position | ||
var swapOnDrop = this.options.swapOnDrop; | ||
// swap real drag element to the current drop position | ||
if ((!isClone || from === to) && (typeof swapOnDrop === 'function' ? swapOnDrop(params) : swapOnDrop)) { | ||
@@ -1251,6 +1244,5 @@ parentEl.insertBefore(dragEl, cloneEl); | ||
cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl); | ||
} else { | ||
toggleClass(cloneEl, this.options.chosenClass, false); | ||
} | ||
css(dragEl, 'display', ''); | ||
this.animator.animate(); | ||
if (from !== to) { | ||
@@ -1260,3 +1252,3 @@ dispatchEvent({ | ||
name: 'onDrop', | ||
params: _extends({}, params, pullMode === 'clone' ? cloneEvent : { | ||
params: _extends({}, params, isClone ? cloneEvent : { | ||
newIndex: -1 | ||
@@ -1291,3 +1283,3 @@ }) | ||
_nulling: function _nulling() { | ||
to = from = fromEl = dragEl = dropEl = nextEl = cloneEl = ghostEl = targetEl = parentEl = pullMode = oldIndex = newIndex = fromIndex = dragEvent = moveEvent = lastDropEl = cloneEvent = cloneTarget = listenerNode = lastHoverArea = dragStartTimer = useSelectHandle = Sortable.clone = Sortable.ghost = Sortable.active = Sortable.dragged = null; | ||
to = from = fromEl = dragEl = dropEl = nextEl = cloneEl = ghostEl = targetEl = parentEl = pullMode = oldIndex = newIndex = fromIndex = dragEvent = moveEvent = lastDropEl = cloneEvent = cloneTarget = listenerNode = lastHoverArea = dragStartTimer = Sortable.clone = Sortable.ghost = Sortable.active = Sortable.dragged = null; | ||
}, | ||
@@ -1294,0 +1286,0 @@ destroy: function destroy() { |
/*! | ||
* sortable-dnd v0.6.18 | ||
* sortable-dnd v0.6.19 | ||
* open source under the MIT license | ||
* https://github.com/mfuu/sortable-dnd#readme | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Sortable=e()}(this,(function(){"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},e.apply(this,arguments)}var n={capture:!1,passive:!1},o=/\s+/g;function i(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var r=i(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),s=i(/Edge/i),a=i(/safari/i)&&!i(/chrome/i)&&!i(/android/i),l=function(){var t=!1;return document.addEventListener("checkIfSupportPassive",null,{get passive(){return t=!0,!0}}),t}();function c(t,e,o){window.addEventListener?t.addEventListener(e,o,!(!l&&r)&&n):window.attachEvent?t.attachEvent("on"+e,o):t["on"+e]=o}function h(t,e,o){window.removeEventListener?t.removeEventListener(e,o,!(!l&&r)&&n):window.detachEvent?t.detachEvent("on"+e,o):t["on"+e]=null}function u(){return document.scrollingElement||document.documentElement}function d(t,e,n){if(t.getBoundingClientRect||t===window){var o,i,r,s,a,l,c;if(t!==window&&t.parentNode&&t!==u()?(i=(o=t.getBoundingClientRect()).top,r=o.left,s=o.bottom,a=o.right,l=o.height,c=o.width):(i=0,r=0,s=window.innerHeight,a=window.innerWidth,l=window.innerHeight,c=window.innerWidth),e&&t!==window){n=n||t.parentNode;do{if(n&&n.getBoundingClientRect){var h=n.getBoundingClientRect();i-=h.top+parseInt(S(n,"border-top-width")),r-=h.left+parseInt(S(n,"border-left-width")),s=i+o.height,a=r+o.width;break}}while(n=n.parentNode)}return{top:i,left:r,bottom:s,right:a,width:c,height:l}}}function p(t,e,n,o){if(t){if(n&&!e)for(var i=Array.prototype.slice.call(n.children),r=0,s=i.length;r<s;r++)if(i[r]===t||m(t,i[r]))return i[r];n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&b(t,e):b(t,e))||o&&t===n)return t;if(t===n)break}while(t=t.parentNode);return null}}function m(t,e){if(!t||!e)return!1;if(e.compareDocumentPosition)return!!(16&e.compareDocumentPosition(t));if(e.contains&&1===t.nodeType)return e.contains(t)&&e!==t;for(;t=t.parentNode;)if(t===e)return!0;return!1}function f(t,e){for(var n=t.lastElementChild;n&&(n===ot.ghost||"none"===S(n,"display")||e&&!b(n,e));)n=n.previousElementSibling;return n||null}function g(t,e){if(!t||!t.parentNode)return-1;for(var n=0;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||e&&!b(t,e)||"none"===S(t,"display")||n++;return n}function v(t,e,n,o){for(var i=0,r=0,s=t.children;i<s.length;){if(s[i]!==ot.ghost&&"none"!==S(s[i],"display")&&p(s[i],n,t,!1)&&(o||s[i]!==ot.dragged)){if(r===e)return s[i];r++}i++}return null}function y(t,e){var n=S(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=v(t,0,e),a=v(t,1,e),l=i&&S(i),c=a&&S(a),h=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+d(i).width,u=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+d(a).width,p=s||r?"cssFloat":"float";if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&l.float&&"none"!==l.float){var m="left"===l.float?"left":"right";return!a||"both"!==c.clear&&c.clear!==m?"horizontal":"vertical"}return i&&("block"===l.display||"flex"===l.display||"table"===l.display||"grid"===l.display||h>=o&&"none"===n[p]||a&&"none"===n[p]&&h+u>o)?"vertical":"horizontal"}function w(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var i=(" "+t.className+" ").replace(o," ").replace(" "+e+" "," ");t.className=(i+(n?" "+e:"")).replace(o," ")}}function b(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function S(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function _(t,e){var n,o,i=(o=e,(n=t).compareDocumentPosition?n.compareDocumentPosition(o):n.contains?(n!=o&&n.contains(o)&&16)+(n!=o&&o.contains(n)&&8)+(n.sourceIndex>=0&&o.sourceIndex>=0?(n.sourceIndex<o.sourceIndex&&4)+(n.sourceIndex>o.sourceIndex&&2):1):0);return 2===i?1:4===i?-1:0}function x(t){void 0!==t.preventDefault&&t.cancelable&&t.preventDefault()}function D(t){var n=t.sortable,o=t.name,i=t.params,r=n.options[o];"function"==typeof r&&r(e({},i))}!function(){if("undefined"==typeof window||"undefined"==typeof document)return"";var t=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],e=(Array.prototype.slice.call(t).join("").match(/-(moz|webkit|ms)-/)||""===t.OLink&&["","o"])[1];e&&"-".concat(e,"-")}();var C,E,I="Sortable"+Date.now();function T(t){this.options=t,this.autoScrollAnimationFrame=null}function M(t){this.options=t,this.stack=[]}function N(t){this.options=t||{},this.selects=[]}window.requestAnimationFrame||(window.requestAnimationFrame=function(t){return setTimeout(t,17)}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),T.prototype={stop:function(){this.autoScrollAnimationFrame&&(cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=null)},start:function(t,e,n){var o=this;cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=requestAnimationFrame((function(){e&&n&&o.autoScroll(t,n),o.start(t,e,n)}))},autoScroll:function(t,e){if(t&&void 0!==e.clientX&&void 0!==e.clientY){var n=d(t);if(n){var o=e.clientX,i=e.clientY,r=n.top,s=n.right,a=n.bottom,l=n.left,c=n.height,h=n.width;if(!(i<r||o>s||i>a||o<l)){var u=this.options,p=u.scrollThreshold,m=u.scrollSpeed,f=t.scrollTop,g=t.scrollLeft,v=t.scrollHeight,y=f>0&&i>=r&&i<=r+p,w=g+h<t.scrollWidth&&o<=s&&o>=s-p,b=f+c<v&&i<=a&&i>=a-p;g>0&&o>=l&&o<=l+p&&(t.scrollLeft+=Math.floor(Math.max(-1,(o-l)/p-1)*m.x)),w&&(t.scrollLeft+=Math.ceil(Math.min(1,(o-s)/p+1)*m.x)),y&&(t.scrollTop+=Math.floor(Math.max(-1,(i-r)/p-1)*m.y)),b&&(t.scrollTop+=Math.ceil(Math.min(1,(i-a)/p+1)*m.y))}}}}},M.prototype={collect:function(t){if(t){for(var e=d(t),n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,o=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,i=Math.min(e.right,n),r=Math.min(e.bottom,o),s=Array.prototype.slice.call(t.children),a=[],l=0,c=s.length;l<=c;l++){var h=s[l];if(h&&h!==ot.ghost&&"none"!==S(h,"display")){var u=d(h);if(!(u.bottom<0||u.right<0)){if(u.top-u.height>r||u.left-u.width>i)break;a.push({el:h,rect:u})}}}this.stack.push(a)}},animate:function(){var t=this.stack.pop();if(t&&this.options.animation)for(var e=0,n=t.length;e<n;e++){var o=t[e],i=o.el,r=o.rect;this._excute(i,r)}},_excute:function(t,e){var n=d(t);if(n.top!==e.top||n.left!==e.left){var o=e.left-n.left,i=e.top-n.top;S(t,"transition",""),S(t,"transform","translate3d(".concat(o,"px, ").concat(i,"px, 0)")),t.offsetWidth;var r=this.options,s=r.animation,a=r.easing;S(t,"transition","transform ".concat(s,"ms ").concat(a?" "+a:"")),S(t,"transform","translate3d(0px, 0px, 0px)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){S(t,"transition",""),S(t,"transform",""),t.animated=null}),s)}}},N.prototype={nulling:function(){C=E=null},active:function(){return!!C},params:function(){return{nodes:C||[],clones:E||[]}},select:function(t){w(t,this.options.selectedClass,!0),this.selects.push(t),this.selects.sort((function(t,e){return _(t,e)}))},deselect:function(t){var e=this.selects.indexOf(t);e>-1&&(w(t,this.options.selectedClass,!1),this.selects.splice(e,1))},getGhostElement:function(){if(!C)return null;var t=document.createElement("div");return this.selects.forEach((function(e,n){var o=e.cloneNode(!0),i=0===n?1:.5;o.style="position: absolute;left: 0;top: 0;bottom: 0;right: 0;opacity: ".concat(i,";z-index: ").concat(n,";"),t.appendChild(o)})),t},toggleSelected:function(t,e){var n=this;e?t.forEach((function(t){return n.selects.push(t)})):this.selects=this.selects.filter((function(e){return t.indexOf(e)<0}))},toggleClass:function(t){if(C)for(var e=0;e<C.length;e++)w(C[e],this.options.chosenClass,t)},toggleVisible:function(t){if(C)if(t){var e=C.indexOf(ot.dragged);this._viewElements(C,e,ot.dragged)}else this._hideElements(C)},useSelectHandle:function(t,e){var n=this.options.selectHandle;return!!("function"==typeof n&&n(t)||"string"==typeof n&&b(e,n))},onChoose:function(){!this.options.multiple||0===this.selects.length||this.selects.indexOf(ot.dragged)<0||(this.selects.sort((function(t,e){return _(t,e)})),C=this.selects,this.toggleClass(!0))},onDrag:function(){C&&(this._hideElements(C),this.toggleClass(!1))},onDrop:function(t,e,n){if(C){var o=ot.dragged,i=ot.clone,r=C.indexOf(o);t!==e&&n?(S(i,"display","none"),E=C.map((function(t){return t.cloneNode(!0)})),this._viewElements(E,r,i),this._viewElements(C,r,o)):this._viewElements(C,r,i),t!==e&&(e[I].multiplayer.toggleSelected(E||C,!0),!n&&t[I].multiplayer.toggleSelected(C,!1))}},onSelect:function(t,e,n){var o=this.selects.indexOf(e);w(e,this.options.selectedClass,o<0);var i={from:n.el,event:t,node:e,index:g(e)};o<0?(this.selects.push(e),D({sortable:n,name:"onSelect",params:i})):(this.selects.splice(o,1),D({sortable:n,name:"onDeselect",params:i})),this.selects.sort((function(t,e){return _(t,e)}))},_viewElements:function(t,e,n){for(var o=0;o<t.length;o++)if(S(t[o],"display",""),o<e)n.parentNode.insertBefore(t[o],n);else{var i=o>0?t[o-1]:n;n.parentNode.insertBefore(t[o],i.nextSibling)}},_hideElements:function(t){for(var e=0;e<t.length;e++)t[e]!=ot.dragged&&S(t[e],"display","none")}};var P,A,O,H,k,L,X,Y,B,F,R,W,z,G,j,V,q,U,J,K,Q,Z,$,tt=[];function et(e){var n={},o=e.group;o&&"object"==t(o)||(o={name:o,pull:!0,put:!0,revertDrag:!0}),n.name=o.name,n.pull=o.pull,n.put=o.put,n.revertDrag=o.revertDrag,e.group=n}function nt(t){var e=V||j;return!(void 0!==t.clientX&&void 0!==t.clientY&&Math.abs(t.clientX-e.clientX)<=0&&Math.abs(t.clientY-e.clientY)<=0)}function ot(t,n){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable-dnd: `el` must be an HTMLElement, not ".concat({}.toString.call(t));t[I]=this,this.el=t,this.options=n=e({},n);var o={store:null,group:"",handle:null,sortable:!0,disabled:!1,multiple:!1,lockAxis:"",direction:"",animation:150,easing:"",draggable:null,selectHandle:null,customGhost:null,autoScroll:!0,scrollThreshold:55,scrollSpeed:{x:10,y:10},delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,ghostClass:"",ghostStyle:{},chosenClass:"",selectedClass:"",placeholderClass:"",swapOnDrop:!0,fallbackOnBody:!1,supportTouch:"ontouchstart"in window,emptyInsertThreshold:-1};for(var i in o)!(i in this.options)&&(this.options[i]=o[i]);for(var r in et(n),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));c(t,this.options.supportTouch?"touchstart":"mousedown",this._onDrag),this.autoScroller=new T(this.options),this.multiplayer=new N(this.options),this.animator=new M(this.options),tt.push(t)}return ot.prototype={constructor:ot,_onDrag:function(t){var e=this;if(!H&&!this.options.disabled&&this.options.group.pull&&(!/mousedown|pointerdown/.test(t.type)||0===t.button)){var n=t.touches&&t.touches[0],o=(n||t).target;if(!a||!o||"SELECT"!==o.tagName.toUpperCase()){var i=p(o,this.options.draggable,this.el);if(i&&!i.animated&&(j={event:t,clientX:(n||t).clientX,clientY:(n||t).clientY},H=i,c(K=n?H:document,"mouseup",this._onDrop),c(K,"touchend",this._onDrop),c(K,"touchcancel",this._onDrop),!($=this.multiplayer.useSelectHandle(t,o)))){var l=this.options.handle;if(("function"!=typeof l||l(t))&&("string"!=typeof l||b(o,l))){var h=this.options,u=h.delay,d=h.delayOnTouchOnly;!u||d&&!n||s||r?this._onStart(n,t):(c(this.el.ownerDocument,"touchmove",this._delayMoveHandler),c(this.el.ownerDocument,"mousemove",this._delayMoveHandler),c(this.el.ownerDocument,"mouseup",this._cancelStart),c(this.el.ownerDocument,"touchend",this._cancelStart),c(this.el.ownerDocument,"touchcancel",this._cancelStart),Z=setTimeout((function(){return e._onStart(n,t)}),u)),c(document,"selectstart",x),a&&S(document.body,"user-select","none")}}}}},_delayMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-j.clientX),Math.abs(e.clientY-j.clientY))>=Math.floor(this.options.touchStartThreshold/(window.devicePixelRatio||1))&&this._cancelStart()},_cancelStart:function(){clearTimeout(Z),h(this.el.ownerDocument,"touchmove",this._delayMoveHandler),h(this.el.ownerDocument,"mousemove",this._delayMoveHandler),h(this.el.ownerDocument,"mouseup",this._cancelStart),h(this.el.ownerDocument,"touchend",this._cancelStart),h(this.el.ownerDocument,"touchcancel",this._cancelStart),h(document,"selectstart",x),a&&S(document.body,"user-select","")},_onStart:function(t,e){x(e);var n=g(H);P=this.el,A=this.el,B=H,W=n,z=n,G=n,U={to:this.el,target:H,newIndex:n,relative:0},J=H,O=this.el,X=H.cloneNode(!0),F=H.parentNode,R=this.options.group.pull,ot.clone=X,ot.active=this,ot.dragged=H,w(H,this.options.chosenClass,!0),this.multiplayer.onChoose(),D({sortable:this,name:"onChoose",params:this._getParams(e)}),c(K,t?"touchmove":"mousemove",this._nearestSortable);try{document.selection?setTimeout((function(){return document.selection.empty()}),0):window.getSelection().removeAllRanges()}catch(t){}},_onStarted:function(){this.animator.collect(F),w(X,this.options.chosenClass,!0),w(X,this.options.placeholderClass,!0),this._appendGhost(),this.multiplayer.onDrag(),D({sortable:this,name:"onDrag",params:this._getParams(j.event)}),S(H,"display","none"),w(H,this.options.chosenClass,!1),H.parentNode.insertBefore(X,H),this.animator.animate()},_getGhostElement:function(){var t=this.options.customGhost;if("function"==typeof t){var e=this.multiplayer.selects;return t(e.length?e:[H])}return this.multiplayer.getGhostElement()||H},_appendGhost:function(){if(!Y){var t=this.options.fallbackOnBody?document.body:this.el,n=this._getGhostElement();w(Y=n.cloneNode(!0),this.options.ghostClass,!0);var o=d(H),i=e({position:"fixed",top:o.top,left:o.left,width:o.width,height:o.height,zIndex:"100000",opacity:"0.8",overflow:"hidden",boxSizing:"border-box",transform:"",transition:"",pointerEvents:"none"},this.options.ghostStyle);for(var r in i)S(Y,r,i[r]);ot.ghost=Y,t.appendChild(Y);var s=(j.clientX-o.left)/parseInt(Y.style.width)*100,a=(j.clientY-o.top)/parseInt(Y.style.height)*100;S(Y,"transform-origin","".concat(s,"% ").concat(a,"%")),S(Y,"will-change","transform")}},_nearestSortable:function(t){x(t);var e=t.touches&&t.touches[0]||t;if(H&&nt(e)){!V&&this._onStarted();var n=this.options.lockAxis,o="x"===n?j.clientX:e.clientX,i="y"===n?j.clientY:e.clientY,r=document.elementFromPoint(o,i),s=o-j.clientX,a=i-j.clientY;V={event:t,clientX:o,clientY:i},S(Y,"transform","translate3d(".concat(s,"px, ").concat(a,"px, 0)"));var l,c,h,p=(l=o,c=i,tt.reduce((function(t,e){var n=e[I].options.emptyInsertThreshold;if(null!=n){var o=d(e),i=l>=o.left-n&&l<=o.right+n,r=c>=o.top-n&&c<=o.bottom+n;return i&&r&&(!h||h&&o.left>=h.left&&o.right<=h.right&&o.top>=h.top&&o.bottom<=h.bottom)&&(t=e,h=o),t}}),null));if(p&&p[I]._onMove(t,r),!p||p[I].options.autoScroll){var m=function(t,e){if(!t||!t.getBoundingClientRect)return u();var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=S(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 u();if(o||e)return n;o=!0}}}while(n=n.parentNode);return u()}(r,!0);this.autoScroller.start(m,j,V)}else this.autoScroller.stop()}},_allowPut:function(){if(O===this.el)return!0;if(this.options.group.put){var t=this.options.group,e=t.name,n=t.put,o=O[I].options.group;return n.join&&n.indexOf(o.name)>-1||o.name&&e&&o.name===e}return!1},_getDirection:function(){var t=this.options,e=t.draggable,n=t.direction;return n?"function"==typeof n?n.call(V.event,H,this):n:y(F,e)},_allowSwap:function(){var t=d(k),e="vertical"===this._getDirection(),n=e?"top":"left",o=e?"bottom":"right",i=k[e?"offsetHeight":"offsetWidth"],r=e?V.clientY:V.clientX,s=r>=t[n]&&r<t[o]-i/2?-1:1,a=v(F,0,this.options.draggable),l=f(F),c=d(a),h=d(l);if(k===F||m(F,k))return X===a&&r<c[n]?(L=k,!0):X===l&&r>h[o]&&(L=k.nextSibling,!0);var u=_(X,k);return L=u<0?k.nextSibling:k,q!==k?(Q=s,!0):Q!==s&&(Q=s,s<0?u>0:u<0)},_onMove:function(t,e){if(!this.options.disabled&&this._allowPut()){if(k=p(e,this.options.draggable,this.el),D({sortable:this,name:"onMove",params:this._getParams(t,{target:k})}),this.options.sortable||this.el!==O)return this.el===A||e!==this.el&&f(this.el)?void(k&&!k.animated&&!m(k,X)&&this._allowSwap()&&(k!==X&&L!==X?(this.el!==A?this._onInsert(t):k!==H&&this._onChange(t),q=k):q=k)):(k=q=null,void this._onInsert(t));A!==O&&(k=q=H,Q=0,this._onInsert(t))}},_onInsert:function(t){var e=k||X,n="clone"===R&&this.el!==O&&A===O,o="clone"===R&&this.el===O&&A!==O,i=m(k,document),r=k===H&&!i;P=this.el,W=g(X),B=e,F=i?k.parentNode:this.el,A[I].animator.collect(X.parentNode),this.animator.collect(F),n&&(U.target=J,U.newIndex=W,U.relative=J===H?0:_(X,J),S(H,"display",""),O[I].multiplayer.toggleVisible(!0),O[I].options.group.revertDrag||X.parentNode.insertBefore(H,X)),o&&(W=g(H),S(H,"display","none"),this.multiplayer.toggleVisible(!1)),S(X,"display",r?"none":""),k&&i?F.insertBefore(X,Q<0?k:k.nextSibling):F.appendChild(X),z=r?G:g(X),n&&O[I].options.group.revertDrag&&(U.target=H,U.newIndex=G,U.relative=0,D({sortable:O[I],name:"onChange",params:this._getParams(t,{to:O,target:H,newIndex:G,revertDrag:!0})})),n||D({sortable:A[I],name:"onRemove",params:this._getParams(t,{newIndex:-1})}),o&&e!==H&&(J=e,D({sortable:this,name:"onChange",params:this._getParams(t,{from:O,backToOrigin:!0})})),o||D({sortable:this,name:"onAdd",params:this._getParams(t,{oldIndex:-1})}),A[I].animator.animate(),this.animator.animate(),A=this.el},_onChange:function(t){W=g(X),F=k.parentNode,B=k,this.el===O&&(J=k),this.animator.collect(F),F.insertBefore(X,L),z=g(X),D({sortable:this,name:"onChange",params:this._getParams(t)}),this.animator.animate(),A=this.el},_onDrop:function(t){this._cancelStart(),h(K,"touchmove",this._nearestSortable),h(K,"mousemove",this._nearestSortable),h(K,"mouseup",this._onDrop),h(K,"touchend",this._onDrop),h(K,"touchcancel",this._onDrop),O&&(this.animator.collect(F),w(H,this.options.chosenClass,!1),w(X,this.options.placeholderClass,!1),A=O,W=G,B===X&&(B=H),this.multiplayer.toggleClass(!1),D({sortable:this,name:"onUnchoose",params:this._getParams(t)}),V&&this._onEnd(t),this.animator.animate());var e=this.options,n=e.multiple,o=e.selectHandle;n&&(o&&$||!o&&!O)&&(!nt(t.changedTouches?t.changedTouches[0]:t)&&this.multiplayer.onSelect(t,H,this));Y&&Y.parentNode&&Y.parentNode.removeChild(Y),this.autoScroller.stop(),this.multiplayer.nulling(),this._nulling()},_onEnd:function(t){var n=this._getParams(t),o="clone"===R;this.multiplayer.onDrop(A,P,o);var i=this.options.swapOnDrop;o&&A!==P||!("function"==typeof i?i(n):i)||F.insertBefore(H,X),!o||A===P||this.multiplayer.active()?X&&X.parentNode&&X.parentNode.removeChild(X):w(X,this.options.chosenClass,!1),S(H,"display",""),A!==P&&D({sortable:A[I],name:"onDrop",params:e({},n,"clone"===R?U:{newIndex:-1})}),D({sortable:P[I],name:"onDrop",params:e({},n,A===P?{}:{oldIndex:-1})})},_getParams:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o={};return o.event=t,o.to=P,o.from=A,o.node=H,o.clone=X,o.target=B,o.oldIndex=W,o.newIndex=z,o.pullMode=R,e(o,this.multiplayer.params(),n),o.relative=B===H?0:_(X,B),o},_nulling:function(){P=A=O=H=k=L=X=Y=B=F=R=W=z=G=j=V=q=U=J=K=Q=Z=$=ot.clone=ot.ghost=ot.active=ot.dragged=null},destroy:function(){this._cancelStart(),this._nulling(),this.multiplayer.nulling(),this.autoScroller.stop(),h(this.el,"touchstart",this._onDrag),h(this.el,"mousedown",this._onDrag);var t=tt.indexOf(this.el);t>-1&&tt.splice(t,1),this.el[I]=this.animator=this.multiplayer=this.autoScroller=null},option:function(t,e){if(void 0===e)return this.options[t];this.options[t]=e,this.animator.options[t]=e,this.multiplayer.options[t]=e,this.autoScroller.options[t]=e,"group"===t&&et(this.options)},select:function(t){this.multiplayer.select(t)},deselect:function(t){this.multiplayer.deselect(t)},getSelectedElements:function(){return this.multiplayer.selects}},ot.utils={on:c,off:h,css:S,index:g,closest:p,getRect:d,toggleClass:w,detectDirection:y},ot.get=function(t){return t[I]},ot.create=function(t,e){return new ot(t,e)},ot})); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Sortable=e()}(this,(function(){"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},e.apply(this,arguments)}var n={capture:!1,passive:!1},o=/\s+/g;function i(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var r=i(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),s=i(/Edge/i),a=i(/safari/i)&&!i(/chrome/i)&&!i(/android/i),l=function(){var t=!1;return document.addEventListener("checkIfSupportPassive",null,{get passive(){return t=!0,!0}}),t}();function c(t,e,o){window.addEventListener?t.addEventListener(e,o,!(!l&&r)&&n):window.attachEvent?t.attachEvent("on"+e,o):t["on"+e]=o}function h(t,e,o){window.removeEventListener?t.removeEventListener(e,o,!(!l&&r)&&n):window.detachEvent?t.detachEvent("on"+e,o):t["on"+e]=null}function u(){return document.scrollingElement||document.documentElement}function d(t,e,n){if(t.getBoundingClientRect||t===window){var o,i,r,s,a,l,c;if(t!==window&&t.parentNode&&t!==u()?(i=(o=t.getBoundingClientRect()).top,r=o.left,s=o.bottom,a=o.right,l=o.height,c=o.width):(i=0,r=0,s=window.innerHeight,a=window.innerWidth,l=window.innerHeight,c=window.innerWidth),e&&t!==window){n=n||t.parentNode;do{if(n&&n.getBoundingClientRect){var h=n.getBoundingClientRect();i-=h.top+parseInt(S(n,"border-top-width")),r-=h.left+parseInt(S(n,"border-left-width")),s=i+o.height,a=r+o.width;break}}while(n=n.parentNode)}return{top:i,left:r,bottom:s,right:a,width:c,height:l}}}function p(t,e,n,o){if(t){if(n&&!e)for(var i=Array.prototype.slice.call(n.children),r=0,s=i.length;r<s;r++)if(i[r]===t||m(t,i[r]))return i[r];n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&b(t,e):b(t,e))||o&&t===n)return t;if(t===n)break}while(t=t.parentNode);return null}}function m(t,e){if(!t||!e)return!1;if(e.compareDocumentPosition)return!!(16&e.compareDocumentPosition(t));if(e.contains&&1===t.nodeType)return e.contains(t)&&e!==t;for(;t=t.parentNode;)if(t===e)return!0;return!1}function f(t,e){for(var n=t.lastElementChild;n&&(n===ot.ghost||"none"===S(n,"display")||e&&!b(n,e));)n=n.previousElementSibling;return n||null}function g(t,e){if(!t||!t.parentNode)return-1;for(var n=0;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||e&&!b(t,e)||"none"===S(t,"display")||n++;return n}function v(t,e,n,o){for(var i=0,r=0,s=t.children;i<s.length;){if(s[i]!==ot.ghost&&"none"!==S(s[i],"display")&&p(s[i],n,t,!1)&&(o||s[i]!==ot.dragged)){if(r===e)return s[i];r++}i++}return null}function y(t,e){var n=S(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=v(t,0,e),a=v(t,1,e),l=i&&S(i),c=a&&S(a),h=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+d(i).width,u=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+d(a).width,p=s||r?"cssFloat":"float";if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&l.float&&"none"!==l.float){var m="left"===l.float?"left":"right";return!a||"both"!==c.clear&&c.clear!==m?"horizontal":"vertical"}return i&&("block"===l.display||"flex"===l.display||"table"===l.display||"grid"===l.display||h>=o&&"none"===n[p]||a&&"none"===n[p]&&h+u>o)?"vertical":"horizontal"}function w(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var i=(" "+t.className+" ").replace(o," ").replace(" "+e+" "," ");t.className=(i+(n?" "+e:"")).replace(o," ")}}function b(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function S(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function _(t,e){var n,o,i=(o=e,(n=t).compareDocumentPosition?n.compareDocumentPosition(o):n.contains?(n!=o&&n.contains(o)&&16)+(n!=o&&o.contains(n)&&8)+(n.sourceIndex>=0&&o.sourceIndex>=0?(n.sourceIndex<o.sourceIndex&&4)+(n.sourceIndex>o.sourceIndex&&2):1):0);return 2===i?1:4===i?-1:0}function x(t){void 0!==t.preventDefault&&t.cancelable&&t.preventDefault()}function C(t){var n=t.sortable,o=t.name,i=t.params,r=n.options[o];"function"==typeof r&&r(e({},i))}!function(){if("undefined"==typeof window||"undefined"==typeof document)return"";var t=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],e=(Array.prototype.slice.call(t).join("").match(/-(moz|webkit|ms)-/)||""===t.OLink&&["","o"])[1];e&&"-".concat(e,"-")}();var D,I,E,T="Sortable"+Date.now();function M(t){this.options=t,this.autoScrollAnimationFrame=null}function N(t){this.options=t,this.stack=[]}function P(t){this.options=t||{},this.selects=[]}window.requestAnimationFrame||(window.requestAnimationFrame=function(t){return setTimeout(t,17)}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),M.prototype={stop:function(){this.autoScrollAnimationFrame&&(cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=null)},start:function(t,e,n){var o=this;cancelAnimationFrame(this.autoScrollAnimationFrame),this.autoScrollAnimationFrame=requestAnimationFrame((function(){e&&n&&o.autoScroll(t,n),o.start(t,e,n)}))},autoScroll:function(t,e){if(t&&void 0!==e.clientX&&void 0!==e.clientY){var n=d(t);if(n){var o=e.clientX,i=e.clientY,r=n.top,s=n.right,a=n.bottom,l=n.left,c=n.height,h=n.width;if(!(i<r||o>s||i>a||o<l)){var u=this.options,p=u.scrollThreshold,m=u.scrollSpeed,f=t.scrollTop,g=t.scrollLeft,v=t.scrollHeight,y=f>0&&i>=r&&i<=r+p,w=g+h<t.scrollWidth&&o<=s&&o>=s-p,b=f+c<v&&i<=a&&i>=a-p;g>0&&o>=l&&o<=l+p&&(t.scrollLeft+=Math.floor(Math.max(-1,(o-l)/p-1)*m.x)),w&&(t.scrollLeft+=Math.ceil(Math.min(1,(o-s)/p+1)*m.x)),y&&(t.scrollTop+=Math.floor(Math.max(-1,(i-r)/p-1)*m.y)),b&&(t.scrollTop+=Math.ceil(Math.min(1,(i-a)/p+1)*m.y))}}}}},N.prototype={collect:function(t){if(t){for(var e=d(t),n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,o=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,i=Math.min(e.right,n),r=Math.min(e.bottom,o),s=Array.prototype.slice.call(t.children),a=[],l=0,c=s.length;l<=c;l++){var h=s[l];if(h&&h!==ot.ghost&&"none"!==S(h,"display")){var u=d(h);if(!(u.bottom<0||u.right<0)){if(u.top-u.height>r||u.left-u.width>i)break;a.push({el:h,rect:u})}}}this.stack.push(a)}},animate:function(){var t=this.stack.pop();if(t&&this.options.animation)for(var e=0,n=t.length;e<n;e++){var o=t[e],i=o.el,r=o.rect;this._excute(i,r)}},_excute:function(t,e){var n=d(t);if(n.top!==e.top||n.left!==e.left){var o=e.left-n.left,i=e.top-n.top;S(t,"transition",""),S(t,"transform","translate3d(".concat(o,"px, ").concat(i,"px, 0)")),t.offsetWidth;var r=this.options,s=r.animation,a=r.easing;S(t,"transition","transform ".concat(s,"ms ").concat(a?" "+a:"")),S(t,"transform","translate3d(0px, 0px, 0px)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){S(t,"transition",""),S(t,"transform",""),t.animated=null}),s)}}},P.prototype={active:function(){return!!D},nulling:function(){D=I=E=null},params:function(){return{nodes:D||[],clones:I||[]}},select:function(t){w(t,this.options.selectedClass,!0),this.selects.push(t),this.selects.sort((function(t,e){return _(t,e)}))},deselect:function(t){var e=this.selects.indexOf(t);e>-1&&(w(t,this.options.selectedClass,!1),this.selects.splice(e,1))},useSelectHandle:function(t,e){var n=this.options.selectHandle;return!!(E="function"==typeof n&&n(t)||"string"==typeof n&&b(e,n))},getGhostElement:function(){if(!D)return null;var t=document.createElement("div");return w(t,this.options.chosenClass,!0),this.selects.forEach((function(e,n){var o=e.cloneNode(!0),i=0===n?1:.5;o.style="position: absolute;left: 0;top: 0;bottom: 0;right: 0;opacity: ".concat(i,";z-index: ").concat(n,";"),t.appendChild(o)})),t},onChoose:function(){!this.options.multiple||0===this.selects.length||this.selects.indexOf(ot.dragged)<0||(this.selects.sort((function(t,e){return _(t,e)})),D=this.selects,this.toggleChosenClass(!0))},onDrop:function(t,e,n){if(D){var o=ot.dragged,i=ot.clone,r=D.indexOf(o);t!==e&&n?(S(i,"display","none"),this.toggleVisible(!0),I=D.map((function(t){return t.cloneNode(!0)})),this._sortElements(I,r,i)):this._sortElements(D,r,i),t!==e&&(e[T].multiplayer.toggleSelected(I||D,!0),!n&&t[T].multiplayer.toggleSelected(D,!1))}},onSelect:function(t,e,n,o){var i=this.options,r=i.multiple,s=i.selectHandle;if(r&&(s&&E||!s&&!n)){var a=this.selects.indexOf(e);w(e,this.options.selectedClass,a<0);var l={from:o.el,event:t,node:e,index:g(e)};a<0?(this.selects.push(e),C({sortable:o,name:"onSelect",params:l})):(this.selects.splice(a,1),C({sortable:o,name:"onDeselect",params:l})),this.selects.sort((function(t,e){return _(t,e)}))}},toggleChosenClass:function(t){if(D)for(var e=0,n=D.length;e<n;e++)w(D[e],this.options.chosenClass,t)},toggleVisible:function(t){if(D)for(var e=0,n=D.length;e<n;e++)D[e]!=ot.dragged&&S(D[e],"display",t?"":"none")},toggleSelected:function(t,e){var n=this;e?t.forEach((function(t){return n.selects.push(t)})):this.selects=this.selects.filter((function(e){return t.indexOf(e)<0}))},_sortElements:function(t,e,n){for(var o=0,i=t.length;o<i;o++)if(S(t[o],"display",""),o<e)n.parentNode.insertBefore(t[o],n);else{var r=o>0?t[o-1]:n;n.parentNode.insertBefore(t[o],r.nextSibling)}}};var A,H,O,k,L,X,Y,B,F,R,W,z,G,V,j,q,U,J,K,Q,Z,$,tt=[];function et(e){var n={},o=e.group;o&&"object"==t(o)||(o={name:o,pull:!0,put:!0,revertDrag:!0}),n.name=o.name,n.pull=o.pull,n.put=o.put,n.revertDrag=o.revertDrag,e.group=n}function nt(t){var e=q||j;return!(void 0!==t.clientX&&void 0!==t.clientY&&Math.abs(t.clientX-e.clientX)<=0&&Math.abs(t.clientY-e.clientY)<=0)}function ot(t,n){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable-dnd: `el` must be an HTMLElement, not ".concat({}.toString.call(t));t[T]=this,this.el=t,this.options=n=e({},n);var o={store:null,group:"",handle:null,sortable:!0,disabled:!1,multiple:!1,lockAxis:"",direction:"",animation:150,easing:"",draggable:null,selectHandle:null,customGhost:null,autoScroll:!0,scrollThreshold:55,scrollSpeed:{x:10,y:10},delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,ghostClass:"",ghostStyle:{},chosenClass:"",selectedClass:"",placeholderClass:"",swapOnDrop:!0,fallbackOnBody:!1,supportTouch:"ontouchstart"in window,emptyInsertThreshold:-1};for(var i in o)!(i in this.options)&&(this.options[i]=o[i]);for(var r in et(n),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));c(t,this.options.supportTouch?"touchstart":"mousedown",this._onDrag),this.autoScroller=new M(this.options),this.multiplayer=new P(this.options),this.animator=new N(this.options),tt.push(t)}return ot.prototype={constructor:ot,_onDrag:function(t){var e=this;if(!k&&!this.options.disabled&&this.options.group.pull&&(!/mousedown|pointerdown/.test(t.type)||0===t.button)){var n=t.touches&&t.touches[0],o=(n||t).target;if(!a||!o||"SELECT"!==o.tagName.toUpperCase()){var i=p(o,this.options.draggable,this.el);if(i&&!i.animated&&(j={event:t,clientX:(n||t).clientX,clientY:(n||t).clientY},k=i,c(Q=n?k:document,"mouseup",this._onDrop),c(Q,"touchend",this._onDrop),c(Q,"touchcancel",this._onDrop),!this.multiplayer.useSelectHandle(t,o))){var l=this.options.handle;if(("function"!=typeof l||l(t))&&("string"!=typeof l||b(o,l))){var h=this.options,u=h.delay,d=h.delayOnTouchOnly;!u||d&&!n||s||r?this._onStart(n,t):(c(this.el.ownerDocument,"touchmove",this._delayMoveHandler),c(this.el.ownerDocument,"mousemove",this._delayMoveHandler),c(this.el.ownerDocument,"mouseup",this._cancelStart),c(this.el.ownerDocument,"touchend",this._cancelStart),c(this.el.ownerDocument,"touchcancel",this._cancelStart),$=setTimeout((function(){return e._onStart(n,t)}),u)),c(document,"selectstart",x),a&&S(document.body,"user-select","none")}}}}},_delayMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-j.clientX),Math.abs(e.clientY-j.clientY))>=Math.floor(this.options.touchStartThreshold/(window.devicePixelRatio||1))&&this._cancelStart()},_cancelStart:function(){clearTimeout($),h(this.el.ownerDocument,"touchmove",this._delayMoveHandler),h(this.el.ownerDocument,"mousemove",this._delayMoveHandler),h(this.el.ownerDocument,"mouseup",this._cancelStart),h(this.el.ownerDocument,"touchend",this._cancelStart),h(this.el.ownerDocument,"touchcancel",this._cancelStart),h(document,"selectstart",x),a&&S(document.body,"user-select","")},_onStart:function(t,e){x(e);var n=g(k);A=this.el,H=this.el,F=k,z=n,G=n,V=n,J={to:this.el,target:k,newIndex:n,relative:0},K=k,O=this.el,Y=k.cloneNode(!0),R=k.parentNode,W=this.options.group.pull,ot.clone=Y,ot.active=this,ot.dragged=k,this.multiplayer.onChoose(),w(k,this.options.chosenClass,!0),C({sortable:this,name:"onChoose",params:this._getParams(e)}),c(Q,t?"touchmove":"mousemove",this._nearestSortable);try{document.selection?setTimeout((function(){return document.selection.empty()}),0):window.getSelection().removeAllRanges()}catch(t){}},_onStarted:function(){this.animator.collect(R),w(Y,this.options.chosenClass,!0),w(Y,this.options.placeholderClass,!0),this._appendGhost(),this.multiplayer.toggleVisible(!1),S(k,"display","none"),k.parentNode.insertBefore(Y,k),C({sortable:this,name:"onDrag",params:this._getParams(j.event)}),this.animator.animate()},_getGhostElement:function(){var t=this.options.customGhost;if("function"==typeof t){var e=this.multiplayer.selects;return t(e.length?e:[k])}return this.multiplayer.getGhostElement()||k},_appendGhost:function(){if(!B){var t=this.options.fallbackOnBody?document.body:this.el,n=this._getGhostElement();w(B=n.cloneNode(!0),this.options.ghostClass,!0);var o=d(k),i=e({position:"fixed",top:o.top,left:o.left,width:o.width,height:o.height,zIndex:"100000",opacity:"0.8",overflow:"hidden",boxSizing:"border-box",transform:"",transition:"",pointerEvents:"none"},this.options.ghostStyle);for(var r in i)S(B,r,i[r]);ot.ghost=B,t.appendChild(B);var s=(j.clientX-o.left)/parseInt(B.style.width)*100,a=(j.clientY-o.top)/parseInt(B.style.height)*100;S(B,"transform-origin","".concat(s,"% ").concat(a,"%")),S(B,"will-change","transform")}},_nearestSortable:function(t){x(t);var e=t.touches&&t.touches[0]||t;if(k&&nt(e)){!q&&this._onStarted();var n=this.options.lockAxis,o="x"===n?j.clientX:e.clientX,i="y"===n?j.clientY:e.clientY,r=document.elementFromPoint(o,i),s=o-j.clientX,a=i-j.clientY;q={event:t,clientX:o,clientY:i},S(B,"transform","translate3d(".concat(s,"px, ").concat(a,"px, 0)"));var l,c,h,p=(l=o,c=i,tt.reduce((function(t,e){var n=e[T].options.emptyInsertThreshold;if(null!=n){var o=d(e),i=l>=o.left-n&&l<=o.right+n,r=c>=o.top-n&&c<=o.bottom+n;return i&&r&&(!h||h&&o.left>=h.left&&o.right<=h.right&&o.top>=h.top&&o.bottom<=h.bottom)&&(t=e,h=o),t}}),null));if(p&&p[T]._onMove(t,r),!p||p[T].options.autoScroll){var m=function(t,e){if(!t||!t.getBoundingClientRect)return u();var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=S(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 u();if(o||e)return n;o=!0}}}while(n=n.parentNode);return u()}(r,!0);this.autoScroller.start(m,j,q)}else this.autoScroller.stop()}},_allowPut:function(){if(O===this.el)return!0;if(!this.options.group.put)return!1;var t=this.options.group,e=t.name,n=t.put,o=O[T].options.group;return n.join&&n.indexOf(o.name)>-1||o.name&&e&&o.name===e},_getDirection:function(){var t=this.options,e=t.draggable,n=t.direction;return n?"function"==typeof n?n.call(q.event,Y,this):n:y(R,e)},_allowSwap:function(){var t=d(L),e="vertical"===this._getDirection(),n=e?"top":"left",o=e?"bottom":"right",i=L[e?"offsetHeight":"offsetWidth"],r=e?q.clientY:q.clientX,s=r>=t[n]&&r<t[o]-i/2?-1:1,a=v(R,0,this.options.draggable),l=f(R),c=d(a),h=d(l);if(L===R||m(R,L))return Y===a&&r<c[n]?(X=L,!0):Y===l&&r>h[o]&&(X=L.nextSibling,!0);var u=_(Y,L);return X=u<0?L.nextSibling:L,U!==L?(Z=s,!0):Z!==s&&(Z=s,s<0?u>0:u<0)},_onMove:function(t,e){if(!this.options.disabled&&this._allowPut()){if(L=p(e,this.options.draggable,this.el),C({sortable:this,name:"onMove",params:this._getParams(t,{target:L})}),this.options.sortable||this.el!==O)return this.el===H||e!==this.el&&f(this.el)?void(L&&!L.animated&&!m(L,Y)&&this._allowSwap()&&(L!==Y&&X!==Y?(this.el!==H?this._onInsert(t):L!==k&&this._onChange(t),U=L):U=L)):(L=U=null,void this._onInsert(t));H!==O&&(L=U=k,Z=0,this._onInsert(t))}},_onInsert:function(t){var e=L||Y,n="clone"===W&&this.el!==O&&H===O,o="clone"===W&&this.el===O&&H!==O,i=m(L,document),r=L===k&&!i,s=H[T],a=O[T];A=this.el,z=g(Y),F=e,R=i?L.parentNode:this.el,s.animator.collect(Y.parentNode),this.animator.collect(R),n&&(J.target=K,J.newIndex=z,J.relative=K===k?0:_(Y,K),S(k,"display",""),a.multiplayer.toggleVisible(!0),a.options.group.revertDrag||Y.parentNode.insertBefore(k,Y)),o&&(z=g(k),S(k,"display","none"),this.multiplayer.toggleVisible(!1)),S(Y,"display",r?"none":""),L&&i?R.insertBefore(Y,Z<0?L:L.nextSibling):R.appendChild(Y),G=r?V:g(Y),n&&a.options.group.revertDrag&&(J.target=k,J.newIndex=V,J.relative=0,C({sortable:a,name:"onChange",params:this._getParams(t,{to:O,target:k,newIndex:V,revertDrag:!0})})),n||C({sortable:s,name:"onRemove",params:this._getParams(t,{newIndex:-1})}),o&&e!==k&&(K=e,C({sortable:this,name:"onChange",params:this._getParams(t,{from:O,backToOrigin:!0})})),o||C({sortable:this,name:"onAdd",params:this._getParams(t,{oldIndex:-1})}),s.animator.animate(),this.animator.animate(),H=this.el},_onChange:function(t){this.animator.collect(R),z=g(Y),R=L.parentNode,F=L,this.el===O&&(K=L),R.insertBefore(Y,X),G=g(Y),C({sortable:this,name:"onChange",params:this._getParams(t)}),this.animator.animate(),H=this.el},_onDrop:function(t){this._cancelStart(),h(Q,"touchmove",this._nearestSortable),h(Q,"mousemove",this._nearestSortable),h(Q,"mouseup",this._onDrop),h(Q,"touchend",this._onDrop),h(Q,"touchcancel",this._onDrop),O&&(H=O,z=V,F===Y&&(F=k),this.animator.collect(R),this.multiplayer.toggleChosenClass(!1),w(k,this.options.chosenClass,!1),C({sortable:this,name:"onUnchoose",params:this._getParams(t)}),q&&this._onEnd(t),!q&&this.animator.animate()),!nt(t.changedTouches?t.changedTouches[0]:t)&&this.multiplayer.onSelect(t,k,O,this),B&&B.parentNode&&B.parentNode.removeChild(B),this.autoScroller.stop(),this.multiplayer.nulling(),this._nulling()},_onEnd:function(t){w(Y,this.options.chosenClass,!1),w(Y,this.options.placeholderClass,!1);var n="clone"===W;this.multiplayer.onDrop(H,A,n);var o=this._getParams(t),i=this.options.swapOnDrop;n&&H!==A||!("function"==typeof i?i(o):i)||R.insertBefore(k,Y),n&&H!==A&&!this.multiplayer.active()||Y&&Y.parentNode&&Y.parentNode.removeChild(Y),S(k,"display",""),this.animator.animate(),H!==A&&C({sortable:H[T],name:"onDrop",params:e({},o,n?J:{newIndex:-1})}),C({sortable:A[T],name:"onDrop",params:e({},o,H===A?{}:{oldIndex:-1})})},_getParams:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o={};return o.event=t,o.to=A,o.from=H,o.node=k,o.clone=Y,o.target=F,o.oldIndex=z,o.newIndex=G,o.pullMode=W,e(o,this.multiplayer.params(),n),o.relative=F===k?0:_(Y,F),o},_nulling:function(){A=H=O=k=L=X=Y=B=F=R=W=z=G=V=j=q=U=J=K=Q=Z=$=ot.clone=ot.ghost=ot.active=ot.dragged=null},destroy:function(){this._cancelStart(),this._nulling(),this.multiplayer.nulling(),this.autoScroller.stop(),h(this.el,"touchstart",this._onDrag),h(this.el,"mousedown",this._onDrag);var t=tt.indexOf(this.el);t>-1&&tt.splice(t,1),this.el[T]=this.animator=this.multiplayer=this.autoScroller=null},option:function(t,e){if(void 0===e)return this.options[t];this.options[t]=e,this.animator.options[t]=e,this.multiplayer.options[t]=e,this.autoScroller.options[t]=e,"group"===t&&et(this.options)},select:function(t){this.multiplayer.select(t)},deselect:function(t){this.multiplayer.deselect(t)},getSelectedElements:function(){return this.multiplayer.selects}},ot.utils={on:c,off:h,css:S,index:g,closest:p,getRect:d,toggleClass:w,detectDirection:y},ot.get=function(t){return t[T]},ot.create=function(t,e){return new ot(t,e)},ot})); |
{ | ||
"name": "sortable-dnd", | ||
"version": "0.6.18", | ||
"version": "0.6.19", | ||
"description": "JS library for drag-and-drop lists, supports sortable and draggable", | ||
@@ -5,0 +5,0 @@ "main": "dist/sortable-dnd.min.js", |
@@ -90,3 +90,3 @@ export type Direction = 'vertical' | 'horizontal'; | ||
/** | ||
* cloned elements, there is a value only in the `pull: clone` after moving to a another list. | ||
* cloned elements, there is a value only in the `pull: 'clone'` & `multiple: true` after moving to a another list. | ||
*/ | ||
@@ -101,3 +101,5 @@ clones: HTMLElement[]; | ||
/** | ||
* old index within parent. `-1`: element added from another list to the current list | ||
* old index within parent(from). | ||
* | ||
* `-1`: element added from another list to the current list | ||
*/ | ||
@@ -107,3 +109,5 @@ oldIndex: number; | ||
/** | ||
* new index within parent. `-1`: element has been removed from the current list | ||
* new index within parent(to). | ||
* | ||
* `-1`: element has been removed from the current list | ||
*/ | ||
@@ -126,9 +130,11 @@ newIndex: number; | ||
* 0: // The position of dropEl is the same as dragEl. | ||
* <div>dragEl, dropEl</div> | ||
* <div id="same">dragEl, dropEl</div> | ||
* | ||
* 1: // dragEl comes after dropEl. | ||
* <div>dropEl</div> <div>dragEl</div> | ||
* <div id="before">dropEl</div> | ||
* <div id="after">dragEl</div> | ||
* | ||
* -1: // dragEl comes before dropEl. | ||
* <div>dragEl</div> <div>dropEl</div> | ||
* <div id="before">dragEl</div> | ||
* <div id="after">dropEl</div> | ||
*/ | ||
@@ -138,3 +144,3 @@ relative: 0 | 1 | -1; | ||
/** | ||
* Revert draged element to initial position after moving to a another list in `pull: 'clone'` & `revertDrag: true`. | ||
* The dragEl returns to the start position of the drag after moving to a another list in `pull: 'clone'` & `revertDrag: true`. | ||
*/ | ||
@@ -290,3 +296,3 @@ revertDrag?: boolean; | ||
/** | ||
* Threshold to trigger autoscroll. | ||
* Threshold to trigger autoScroll. | ||
* @defaults `55` | ||
@@ -333,3 +339,5 @@ */ | ||
/** | ||
* When the value is false, the dragEl will not move to the drop position. | ||
* Whether to place the dragEl in the drop position after the drag is complete. | ||
* | ||
* When the value is `false`, the dragEl will not move to the drop position (for virtual-list). | ||
* @defaults `true` | ||
@@ -336,0 +344,0 @@ */ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
93172
1838