- md5
- 2d4fb8b53250489a07d7bf40f6cd9a4f
- sha1
- 10925ae314b2e6428f8ec88ce48daed5ad39b4e4
- sha256
- 28c327e0b84e276c98732adf275749ad977f8aa0fa50594ead5b77b91fb29418
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).dragula=e()}}(function(){return function e(n,t,o){function r(u,c){if(!t[u]){if(!n[u]){var a="function"==typeof require&&require;if(!c&&a)return a(u,!0);if(i)return i(u,!0);var f=new Error("Cannot find module '"+u+"'");throw f.code="MODULE_NOT_FOUND",f}var l=t[u]={exports:{}};n[u][0].call(l.exports,function(e){var t=n[u][1][e];return r(t||e)},l,l.exports,e,n,t,o)}return t[u].exports}for(var i="function"==typeof require&&require,u=0;u<o.length;u++)r(o[u]);return r}({1:[function(e,n,t){"use strict";var o={},r="(?:^|\\s)",i="(?:\\s|$)";function u(e){var n=o[e];return n?n.lastIndex=0:o[e]=n=new RegExp(r+e+i,"g"),n}n.exports={add:function(e,n){var t=e.className;t.length?u(n).test(t)||(e.className+=" "+n):e.className=n},rm:function(e,n){e.className=e.className.replace(u(n)," ").trim()}}},{}],2:[function(e,n,t){(function(t){"use strict";var o=e("contra/emitter"),r=e("crossvent"),i=e("./classes"),u=document,c=u.documentElement;function a(e,n,o,i){t.navigator.pointerEnabled?r[n](e,{mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"}[o],i):t.navigator.msPointerEnabled?r[n](e,{mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"}[o],i):(r[n](e,{mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"}[o],i),r[n](e,o,i))}function f(e){if(void 0!==e.touches)return e.touches.length;if(void 0!==e.which&&0!==e.which)return e.which;if(void 0!==e.buttons)return e.buttons;var n=e.button;return void 0!==n?1&n?1:2&n?3:4&n?2:0:void 0}function l(e,n){return void 0!==t[n]?t[n]:c.clientHeight?c[e]:u.body[e]}function d(e,n,t){var o,r=e||{},i=r.className;return r.className+=" gu-hide",o=u.elementFromPoint(n,t),r.className=i,o}function s(){return!1}function v(){return!0}function p(e){return e.width||e.right-e.left}function m(e){return e.height||e.bottom-e.top}function g(e){return e.parentNode===u?null:e.parentNode}function h(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName||"SELECT"===e.tagName||function e(n){if(!n)return!1;if("false"===n.contentEditable)return!1;if("true"===n.contentEditable)return!0;return e(g(n))}(e)}function y(e){return e.nextElementSibling||function(){var n=e;do{n=n.nextSibling}while(n&&1!==n.nodeType);return n}()}function b(e,n){var t=function(e){return e.targetTouches&&e.targetTouches.length?e.targetTouches[0]:e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e}(n),o={pageX:"clientX",pageY:"clientY"};return e in o&&!(e in t)&&o[e]in t&&(e=o[e]),t[e]}n.exports=function(e,n){var t,w,E,x,S,C,O,N,T,X,Y;1===arguments.length&&!1===Array.isArray(e)&&(n=e,e=[]);var B,P=null,D=n||{};void 0===D.moves&&(D.moves=v),void 0===D.accepts&&(D.accepts=v),void 0===D.invalid&&(D.invalid=function(){return!1}),void 0===D.containers&&(D.containers=e||[]),void 0===D.isContainer&&(D.isContainer=s),void 0===D.copy&&(D.copy=!1),void 0===D.copySortSource&&(D.copySortSource=!1),void 0===D.revertOnSpill&&(D.revertOnSpill=!1),void 0===D.removeOnSpill&&(D.removeOnSpill=!1),void 0===D.direction&&(D.direction="vertical"),void 0===D.ignoreInputTextSelection&&(D.ignoreInputTextSelection=!0),void 0===D.mirrorContainer&&(D.mirrorContainer=u.body);var I=o({containers:D.containers,start:function(e){var n=U(e);n&&_(n)},end:F,cancel:$,remove:V,destroy:function(){M(!0),z({})},canMove:function(e){return!!U(e)},dragging:!1});return!0===D.removeOnSpill&&I.on("over",function(e){i.rm(e,"gu-hide")}).on("out",function(e){I.dragging&&i.add(e,"gu-hide")}),M(),I;function L(e){return-1!==I.containers.indexOf(e)||D.isContainer(e)}function M(e){var n=e?"remove":"add";a(c,n,"mousedown",k),a(c,n,"mouseup",z)}function R(e){a(c,e?"remove":"add","mousemove",q)}function A(e){var n=e?"remove":"add";r[n](c,"selectstart",j),r[n](c,"click",j)}function j(e){B&&e.preventDefault()}function k(e){if(C=e.clientX,O=e.clientY,1===f(e)&&!e.metaKey&&!e.ctrlKey){var n=e.target,t=U(n);t&&(B=t,R(),"mousedown"===e.type&&(h(n)?n.focus():e.preventDefault()))}}function q(e){if(B)if(0!==f(e)){if(void 0===e.clientX||e.clientX!==C||void 0===e.clientY||e.clientY!==O){if(D.ignoreInputTextSelection){var n=b("clientX",e),o=b("clientY",e);if(h(u.elementFromPoint(n,o)))return}var r=B;R(!0),A(),F(),_(r);var d,s={left:(d=E.getBoundingClientRect()).left+l("scrollLeft","pageXOffset"),top:d.top+l("scrollTop","pageYOffset")};x=b("pageX",e)-s.left,S=b("pageY",e)-s.top,i.add(X||E,"gu-transit"),function(){if(!t){var e=E.getBoundingClientRect();(t=E.cloneNode(!0)).style.width=p(e)+"px",t.style.height=m(e)+"px",i.rm(t,"gu-transit"),i.add(t,"gu-mirror"),D.mirrorContainer.appendChild(t),a(c,"add","mousemove",W),i.add(D.mirrorContainer,"gu-unselectable"),I.emit("cloned",t,E,"mirror")}}(),W(e)}}else z({})}function U(e){if(!(I.dragging&&t||L(e))){for(var n=e;g(e)&&!1===L(g(e));){if(D.invalid(e,n))return;if(!(e=g(e)))return}var o=g(e);if(o&&!D.invalid(e,n)&&D.moves(e,o,n,y(e)))return{item:e,source:o}}}function _(e){var n,t;n=e.item,t=e.source,("boolean"==typeof D.copy?D.copy:D.copy(n,t))&&(X=e.item.cloneNode(!0),I.emit("cloned",X,e.item,"copy")),w=e.source,E=e.item,N=T=y(e.item),I.dragging=!0,I.emit("drag",E,w)}function F(){if(I.dragging){var e=X||E;H(e,g(e))}}function K(){B=!1,R(!0),A(!0)}function z(e){if(K(),I.dragging){var n=X||E,o=b("clientX",e),r=b("clientY",e),i=Q(d(t,o,r),o,r);i&&(X&&D.copySortSource||!X||i!==w)?H(n,i):D.removeOnSpill?V():$()}}function H(e,n){var t=g(e);X&&D.copySortSource&&n===w&&t.removeChild(E),J(n)?I.emit("cancel",e,w,w):I.emit("drop",e,n,w,T),G()}function V(){if(I.dragging){var e=X||E,n=g(e);n&&n.removeChild(e),I.emit(X?"cancel":"remove",e,n,w),G()}}function $(e){if(I.dragging){var n=arguments.length>0?e:D.revertOnSpill,t=X||E,o=g(t),r=J(o);!1===r&&n&&(X?o&&o.removeChild(X):w.insertBefore(t,N)),r||n?I.emit("cancel",t,w,w):I.emit("drop",t,o,w,T),G()}}function G(){var e=X||E;K(),t&&(i.rm(D.mirrorContainer,"gu-unselectable"),a(c,"remove","mousemove",W),g(t).removeChild(t),t=null),e&&i.rm(e,"gu-transit"),Y&&clearTimeout(Y),I.dragging=!1,P&&I.emit("out",e,P,w),I.emit("dragend",e),w=E=X=N=T=Y=P=null}function J(e,n){var o;return o=void 0!==n?n:t?T:y(X||E),e===w&&o===N}function Q(e,n,t){for(var o=e;o&&!r();)o=g(o);return o;function r(){if(!1===L(o))return!1;var r=Z(o,e),i=ee(o,r,n,t);return!!J(o,i)||D.accepts(E,o,w,i)}}function W(e){if(t){e.preventDefault();var n=b("clientX",e),o=b("clientY",e),r=n-x,i=o-S;t.style.left=r+"px",t.style.top=i+"px";var u=X||E,c=d(t,n,o),a=Q(c,n,o),f=null!==a&&a!==P;(f||null===a)&&(P&&p("out"),P=a,f&&p("over"));var l=g(u);if(a!==w||!X||D.copySortSource){var s,v=Z(a,c);if(null!==v)s=ee(a,v,n,o);else{if(!0!==D.revertOnSpill||X)return void(X&&l&&l.removeChild(u));s=N,a=w}(null===s&&f||s!==u&&s!==y(u))&&(T=s,a.insertBefore(u,s),I.emit("shadow",u,a,w))}else l&&l.removeChild(u)}function p(e){I.emit(e,u,P,w)}}function Z(e,n){for(var t=n;t!==e&&g(t)!==e;)t=g(t);return t===c?null:t}function ee(e,n,t,o){var r,i="horizontal"===D.direction;return n!==e?(r=n.getBoundingClientRect(),u(i?t>r.left+p(r)/2:o>r.top+m(r)/2)):function(){var n,r,u,c=e.children.length;for(n=0;n<c;n++){if(r=e.children[n],u=r.getBoundingClientRect(),i&&u.left+u.width/2>t)return r;if(!i&&u.top+u.height/2>o)return r}return null}();function u(e){return e?y(n):n}}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(e,n,t){n.exports=function(e,n){return Array.prototype.slice.call(e,n)}},{}],4:[function(e,n,t){"use strict";var o=e("ticky");n.exports=function(e,n,t){e&&o(function(){e.apply(t||null,n||[])})}},{ticky:9}],5:[function(e,n,t){"use strict";var o=e("atoa"),r=e("./debounce");n.exports=function(e,n){var t=n||{},i={};return void 0===e&&(e={}),e.on=function(n,t){return i[n]?i[n].push(t):i[n]=[t],e},e.once=function(n,t){return t._once=!0,e.on(n,t),e},e.off=function(n,t){var o=arguments.length;if(1===o)delete i[n];else if(0===o)i={};else{var r=i[n];if(!r)return e;r.splice(r.indexOf(t),1)}return e},e.emit=function(){var n=o(arguments);return e.emitterSnapshot(n.shift()).apply(this,n)},e.emitterSnapshot=function(n){var u=(i[n]||[]).slice(0);return function(){var i=o(arguments),c=this||e;if("error"===n&&!1!==t.throws&&!u.length)throw 1===i.length?i[0]:i;return u.forEach(function(o){t.async?r(o,i,c):o.apply(c,i),o._once&&e.off(n,o)}),e}},e}},{"./debounce":4,atoa:3}],6:[function(e,n,t){(function(t){"use strict";var o=e("custom-event"),r=e("./eventmap"),i=t.document,u=function(e,n,t,o){return e.addEventListener(n,t,o)},c=function(e,n,t,o){return e.removeEventListener(n,t,o)},a=[];function f(e,n,t){var o=function(e,n,t){var o,r;for(o=0;o<a.length;o++)if((r=a[o]).element===e&&r.type===n&&r.fn===t)return o}(e,n,t);if(o){var r=a[o].wrapper;return a.splice(o,1),r}}t.addEventListener||(u=function(e,n,o){return e.attachEvent("on"+n,function(e,n,o){var r=f(e,n,o)||function(e,n,o){return function(n){var r=n||t.event;r.target=r.target||r.srcElement,r.preventDefault=r.preventDefault||function(){r.returnValue=!1},r.stopPropagation=r.stopPropagation||function(){r.cancelBubble=!0},r.which=r.which||r.keyCode,o.call(e,r)}}(e,0,o);return a.push({wrapper:r,element:e,type:n,fn:o}),r}(e,n,o))},c=function(e,n,t){var o=f(e,n,t);if(o)return e.detachEvent("on"+n,o)}),n.exports={add:u,remove:c,fabricate:function(e,n,t){var u=-1===r.indexOf(n)?new o(n,{detail:t}):function(){var e;i.createEvent?(e=i.createEvent("Event")).initEvent(n,!0,!0):i.createEventObject&&(e=i.createEventObject());return e}();e.dispatchEvent?e.dispatchEvent(u):e.fireEvent("on"+n,u)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./eventmap":7,"custom-event":8}],7:[function(e,n,t){(function(e){"use strict";var t=[],o="",r=/^on/;for(o in e)r.test(o)&&t.push(o.slice(2));n.exports=t}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],8:[function(e,n,t){(function(e){var t=e.CustomEvent;n.exports=function(){try{var e=new t("cat",{detail:{foo:"bar"}});return"cat"===e.type&&"bar"===e.detail.foo}catch(e){}return!1}()?t:"function"==typeof document.createEvent?function(e,n){var t=document.createEvent("CustomEvent");return n?t.initCustomEvent(e,n.bubbles,n.cancelable,n.detail):t.initCustomEvent(e,!1,!1,void 0),t}:function(e,n){var t=document.createEventObject();return t.type=e,n?(t.bubbles=Boolean(n.bubbles),t.cancelable=Boolean(n.cancelable),t.detail=n.detail):(t.bubbles=!1,t.cancelable=!1,t.detail=void 0),t}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],9:[function(e,n,t){var o;o="function"==typeof setImmediate?function(e){setImmediate(e)}:function(e){setTimeout(e,0)},n.exports=o},{}]},{},[2])(2)});
No other release has this exact content. See every version of this file.