satis 2.0.7 β 2.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/gem-push.yml +11 -0
- data/.gitignore +15 -0
- data/.nvmrc +1 -0
- data/.rubocop.yml +18 -0
- data/Gemfile +27 -0
- data/Procfile +2 -0
- data/TODO.md +26 -0
- data/app/assets/images/satis/.keep +0 -0
- data/app/components/satis/tabs/component_controller.js +6 -0
- data/bin/importmap +4 -0
- data/bin/rails +14 -0
- data/lib/satis/version.rb +1 -1
- data/package.json +9 -0
- data/satis.gemspec +39 -0
- data/vendor/javascript/@codemirror--autocomplete.js +2 -0
- data/vendor/javascript/@codemirror--commands.js +2 -0
- data/vendor/javascript/@codemirror--lang-css.js +2 -0
- data/vendor/javascript/@codemirror--lang-html.js +2 -0
- data/vendor/javascript/@codemirror--lang-javascript.js +2 -0
- data/vendor/javascript/@codemirror--lang-json.js +2 -0
- data/vendor/javascript/@codemirror--lang-liquid.js +2 -0
- data/vendor/javascript/@codemirror--lang-markdown.js +2 -0
- data/vendor/javascript/@codemirror--lang-yaml.js +2 -0
- data/vendor/javascript/@codemirror--language.js +2 -0
- data/vendor/javascript/@codemirror--lint.js +2 -0
- data/vendor/javascript/@codemirror--search.js +2 -0
- data/vendor/javascript/@codemirror--state.js +2 -0
- data/vendor/javascript/@codemirror--view.js +2 -0
- data/vendor/javascript/@lezer--common.js +2 -0
- data/vendor/javascript/@lezer--css.js +2 -0
- data/vendor/javascript/@lezer--highlight.js +2 -0
- data/vendor/javascript/@lezer--html.js +2 -0
- data/vendor/javascript/@lezer--javascript.js +2 -0
- data/vendor/javascript/@lezer--json.js +2 -0
- data/vendor/javascript/@lezer--lr.js +2 -0
- data/vendor/javascript/@lezer--markdown.js +2 -0
- data/vendor/javascript/@lezer--yaml.js +2 -0
- data/vendor/javascript/@rails--actiontext.js +2 -0
- data/vendor/javascript/codemirror.js +2 -0
- data/vendor/javascript/crelt.js +2 -0
- data/vendor/javascript/data.min.js +7 -0
- data/vendor/javascript/intl-tel-input-utils.js +520 -0
- data/vendor/javascript/intl-tel-input.js +1782 -0
- data/vendor/javascript/leaflet.js +6 -0
- data/vendor/javascript/popper.js.js +1805 -0
- data/vendor/javascript/sortablejs.js +134 -0
- data/vendor/javascript/style-mod.js +2 -0
- data/vendor/javascript/tippy.js.js +2 -0
- data/vendor/javascript/trix.js +2 -0
- data/vendor/javascript/w3c-keyname.js +2 -0
- data/yarn.lock +821 -0
- metadata +51 -2
@@ -0,0 +1,134 @@
|
|
1
|
+
/**!
|
2
|
+
* Sortable 1.15.2
|
3
|
+
* @author RubaXa <trash@rubaxa.org>
|
4
|
+
* @author owenm <owen23355@gmail.com>
|
5
|
+
* @license MIT
|
6
|
+
*/
|
7
|
+
function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})));n.push.apply(n,o)}return n}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ownKeys(Object(n),true).forEach((function(t){_defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _typeof(e){_typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};return _typeof(e)}function _defineProperty(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true}):e[t]=n;return e}function _extends(){_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e};return _extends.apply(this,arguments)}function _objectWithoutPropertiesLoose(e,t){if(e==null)return{};var n={};var o=Object.keys(e);var r,i;for(i=0;i<o.length;i++){r=o[i];t.indexOf(r)>=0||(n[r]=e[r])}return n}function _objectWithoutProperties(e,t){if(e==null)return{};var n=_objectWithoutPropertiesLoose(e,t);var o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){o=i[r];t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}}return n}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _iterableToArray(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function _unsupportedIterableToArray(e,t){if(e){if(typeof e==="string")return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);n==="Object"&&e.constructor&&(n=e.constructor.name);return n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var e="1.15.2";function userAgent(e){if(typeof window!=="undefined"&&window.navigator)return!!navigator.userAgent.match(e)}var t=userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i);var n=userAgent(/Edge/i);var o=userAgent(/firefox/i);var r=userAgent(/safari/i)&&!userAgent(/chrome/i)&&!userAgent(/android/i);var i=userAgent(/iP(ad|od|hone)/i);var a=userAgent(/chrome/i)&&userAgent(/android/i);var l={capture:false,passive:false};function on(e,n,o){e.addEventListener(n,o,!t&&l)}function off(e,n,o){e.removeEventListener(n,o,!t&&l)}function matches(e,t){if(t){t[0]===">"&&(t=t.substring(1));if(e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return false}return false}}function getParentOrHost(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function closest(e,t,n,o){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&matches(e,t):matches(e,t))||o&&e===n)return e;if(e===n)break}while(e=getParentOrHost(e))}return null}var s=/\s+/g;function toggleClass(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var o=(" "+e.className+" ").replace(s," ").replace(" "+t+" "," ");e.className=(o+(n?" "+t:"")).replace(s," ")}}function css(e,t,n){var o=e&&e.style;if(o){if(n===void 0){document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle);return t===void 0?n:n[t]}t in o||t.indexOf("webkit")!==-1||(t="-webkit-"+t);o[t]=n+(typeof n==="string"?"":"px")}}function matrix(e,t){var n="";if(typeof e==="string")n=e;else do{var o=css(e,"transform");o&&o!=="none"&&(n=o+" "+n)}while(!t&&(e=e.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(n)}function find(e,t,n){if(e){var o=e.getElementsByTagName(t),r=0,i=o.length;if(n)for(;r<i;r++)n(o[r],r);return o}return[]}function getWindowScrollingElement(){var e=document.scrollingElement;return e||document.documentElement}
|
8
|
+
/**
|
9
|
+
* Returns the "bounding client rect" of given element
|
10
|
+
* @param {HTMLElement} el The element whose boundingClientRect is wanted
|
11
|
+
* @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container
|
12
|
+
* @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr
|
13
|
+
* @param {[Boolean]} undoScale Whether the container's scale() should be undone
|
14
|
+
* @param {[HTMLElement]} container The parent the element will be placed in
|
15
|
+
* @return {Object} The boundingClientRect of el, with specified adjustments
|
16
|
+
*/function getRect(e,n,o,r,i){if(e.getBoundingClientRect||e===window){var a,l,s,c,u,d,f;if(e!==window&&e.parentNode&&e!==getWindowScrollingElement()){a=e.getBoundingClientRect();l=a.top;s=a.left;c=a.bottom;u=a.right;d=a.height;f=a.width}else{l=0;s=0;c=window.innerHeight;u=window.innerWidth;d=window.innerHeight;f=window.innerWidth}if((n||o)&&e!==window){i=i||e.parentNode;if(!t)do{if(i&&i.getBoundingClientRect&&(css(i,"transform")!=="none"||o&&css(i,"position")!=="static")){var h=i.getBoundingClientRect();l-=h.top+parseInt(css(i,"border-top-width"));s-=h.left+parseInt(css(i,"border-left-width"));c=l+a.height;u=s+a.width;break}}while(i=i.parentNode)}if(r&&e!==window){var g=matrix(i||e),p=g&&g.a,v=g&&g.d;if(g){l/=v;s/=p;f/=p;d/=v;c=l+d;u=s+f}}return{top:l,left:s,bottom:c,right:u,width:f,height:d}}}
|
17
|
+
/**
|
18
|
+
* Checks if a side of an element is scrolled past a side of its parents
|
19
|
+
* @param {HTMLElement} el The element who's side being scrolled out of view is in question
|
20
|
+
* @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')
|
21
|
+
* @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')
|
22
|
+
* @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element
|
23
|
+
*/function isScrolledPast(e,t,n){var o=getParentAutoScrollElement(e,true),r=getRect(e)[t];while(o){var i=getRect(o)[n],a=void 0;a=n==="top"||n==="left"?r>=i:r<=i;if(!a)return o;if(o===getWindowScrollingElement())break;o=getParentAutoScrollElement(o,false)}return false}
|
24
|
+
/**
|
25
|
+
* Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)
|
26
|
+
* and non-draggable elements
|
27
|
+
* @param {HTMLElement} el The parent element
|
28
|
+
* @param {Number} childNum The index of the child
|
29
|
+
* @param {Object} options Parent Sortable's options
|
30
|
+
* @return {HTMLElement} The child at index childNum, or null if not found
|
31
|
+
*/function getChild(e,t,n,o){var r=0,i=0,a=e.children;while(i<a.length){if(a[i].style.display!=="none"&&a[i]!==Sortable.ghost&&(o||a[i]!==Sortable.dragged)&&closest(a[i],n.draggable,e,false)){if(r===t)return a[i];r++}i++}return null}
|
32
|
+
/**
|
33
|
+
* Gets the last child in the el, ignoring ghostEl or invisible elements (clones)
|
34
|
+
* @param {HTMLElement} el Parent element
|
35
|
+
* @param {selector} selector Any other elements that should be ignored
|
36
|
+
* @return {HTMLElement} The last child, ignoring ghostEl
|
37
|
+
*/function lastChild(e,t){var n=e.lastElementChild;while(n&&(n===Sortable.ghost||css(n,"display")==="none"||t&&!matches(n,t)))n=n.previousElementSibling;return n||null}
|
38
|
+
/**
|
39
|
+
* Returns the index of an element within its parent for a selected set of
|
40
|
+
* elements
|
41
|
+
* @param {HTMLElement} el
|
42
|
+
* @param {selector} selector
|
43
|
+
* @return {number}
|
44
|
+
*/function index(e,t){var n=0;if(!e||!e.parentNode)return-1;while(e=e.previousElementSibling)e.nodeName.toUpperCase()==="TEMPLATE"||e===Sortable.clone||t&&!matches(e,t)||n++;return n}
|
45
|
+
/**
|
46
|
+
* Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.
|
47
|
+
* The value is returned in real pixels.
|
48
|
+
* @param {HTMLElement} el
|
49
|
+
* @return {Array} Offsets in the format of [left, top]
|
50
|
+
*/function getRelativeScrollOffset(e){var t=0,n=0,o=getWindowScrollingElement();if(e)do{var r=matrix(e),i=r.a,a=r.d;t+=e.scrollLeft*i;n+=e.scrollTop*a}while(e!==o&&(e=e.parentNode));return[t,n]}
|
51
|
+
/**
|
52
|
+
* Returns the index of the object within the given array
|
53
|
+
* @param {Array} arr Array that may or may not hold the object
|
54
|
+
* @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find
|
55
|
+
* @return {Number} The index of the object in the array, or -1
|
56
|
+
*/function indexOfObject(e,t){for(var n in e)if(e.hasOwnProperty(n))for(var o in t)if(t.hasOwnProperty(o)&&t[o]===e[n][o])return Number(n);return-1}function getParentAutoScrollElement(e,t){if(!e||!e.getBoundingClientRect)return getWindowScrollingElement();var n=e;var o=false;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var r=css(n);if(n.clientWidth<n.scrollWidth&&(r.overflowX=="auto"||r.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(r.overflowY=="auto"||r.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return getWindowScrollingElement();if(o||t)return n;o=true}}}while(n=n.parentNode);return getWindowScrollingElement()}function extend(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function isRectEqual(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var c;function throttle(e,t){return function(){if(!c){var n=arguments,o=this;n.length===1?e.call(o,n[0]):e.apply(o,n);c=setTimeout((function(){c=void 0}),t)}}}function cancelThrottle(){clearTimeout(c);c=void 0}function scrollBy(e,t,n){e.scrollLeft+=t;e.scrollTop+=n}function clone(e){var t=window.Polymer;var n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(true):n?n(e).clone(true)[0]:e.cloneNode(true)}function setRect(e,t){css(e,"position","absolute");css(e,"top",t.top);css(e,"left",t.left);css(e,"width",t.width);css(e,"height",t.height)}function unsetRect(e){css(e,"position","");css(e,"top","");css(e,"left","");css(e,"width","");css(e,"height","")}function getChildContainingRectFromElement(e,t,n){var o={};Array.from(e.children).forEach((function(r){var i,a,l,s;if(closest(r,t.draggable,e,false)&&!r.animated&&r!==n){var c=getRect(r);o.left=Math.min((i=o.left)!==null&&i!==void 0?i:Infinity,c.left);o.top=Math.min((a=o.top)!==null&&a!==void 0?a:Infinity,c.top);o.right=Math.max((l=o.right)!==null&&l!==void 0?l:-Infinity,c.right);o.bottom=Math.max((s=o.bottom)!==null&&s!==void 0?s:-Infinity,c.bottom)}}));o.width=o.right-o.left;o.height=o.bottom-o.top;o.x=o.left;o.y=o.top;return o}var u="Sortable"+(new Date).getTime();function AnimationStateManager(){var e,t=[];return{captureAnimationState:function captureAnimationState(){t=[];if(this.options.animation){var e=[].slice.call(this.el.children);e.forEach((function(e){if(css(e,"display")!=="none"&&e!==Sortable.ghost){t.push({target:e,rect:getRect(e)});var n=_objectSpread2({},t[t.length-1].rect);if(e.thisAnimationDuration){var o=matrix(e,true);if(o){n.top-=o.f;n.left-=o.e}}e.fromRect=n}}))}},addAnimationState:function addAnimationState(e){t.push(e)},removeAnimationState:function removeAnimationState(e){t.splice(indexOfObject(t,{target:e}),1)},animateAll:function animateAll(n){var o=this;if(this.options.animation){var r=false,i=0;t.forEach((function(e){var t=0,n=e.target,a=n.fromRect,l=getRect(n),s=n.prevFromRect,c=n.prevToRect,u=e.rect,d=matrix(n,true);if(d){l.top-=d.f;l.left-=d.e}n.toRect=l;n.thisAnimationDuration&&isRectEqual(s,l)&&!isRectEqual(a,l)&&(u.top-l.top)/(u.left-l.left)===(a.top-l.top)/(a.left-l.left)&&(t=calculateRealTime(u,s,c,o.options));if(!isRectEqual(l,a)){n.prevFromRect=a;n.prevToRect=l;t||(t=o.options.animation);o.animate(n,u,l,t)}if(t){r=true;i=Math.max(i,t);clearTimeout(n.animationResetTimer);n.animationResetTimer=setTimeout((function(){n.animationTime=0;n.prevFromRect=null;n.fromRect=null;n.prevToRect=null;n.thisAnimationDuration=null}),t);n.thisAnimationDuration=t}}));clearTimeout(e);r?e=setTimeout((function(){typeof n==="function"&&n()}),i):typeof n==="function"&&n();t=[]}else{clearTimeout(e);typeof n==="function"&&n()}},animate:function animate(e,t,n,o){if(o){css(e,"transition","");css(e,"transform","");var r=matrix(this.el),i=r&&r.a,a=r&&r.d,l=(t.left-n.left)/(i||1),s=(t.top-n.top)/(a||1);e.animatingX=!!l;e.animatingY=!!s;css(e,"transform","translate3d("+l+"px,"+s+"px,0)");this.forRepaintDummy=repaint(e);css(e,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:""));css(e,"transform","translate3d(0,0,0)");typeof e.animated==="number"&&clearTimeout(e.animated);e.animated=setTimeout((function(){css(e,"transition","");css(e,"transform","");e.animated=false;e.animatingX=false;e.animatingY=false}),o)}}}}function repaint(e){return e.offsetWidth}function calculateRealTime(e,t,n,o){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*o.animation}var d=[];var f={initializeByDefault:true};var h={mount:function mount(e){for(var t in f)f.hasOwnProperty(t)&&!(t in e)&&(e[t]=f[t]);d.forEach((function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}));d.push(e)},pluginEvent:function pluginEvent(e,t,n){var o=this;this.eventCanceled=false;n.cancel=function(){o.eventCanceled=true};var r=e+"Global";d.forEach((function(o){if(t[o.pluginName]){t[o.pluginName][r]&&t[o.pluginName][r](_objectSpread2({sortable:t},n));t.options[o.pluginName]&&t[o.pluginName][e]&&t[o.pluginName][e](_objectSpread2({sortable:t},n))}}))},initializePlugins:function initializePlugins(e,t,n,o){d.forEach((function(o){var r=o.pluginName;if(e.options[r]||o.initializeByDefault){var i=new o(e,t,e.options);i.sortable=e;i.options=e.options;e[r]=i;_extends(n,i.defaults)}}));for(var r in e.options)if(e.options.hasOwnProperty(r)){var i=this.modifyOption(e,r,e.options[r]);typeof i!=="undefined"&&(e.options[r]=i)}},getEventProperties:function getEventProperties(e,t){var n={};d.forEach((function(o){typeof o.eventProperties==="function"&&_extends(n,o.eventProperties.call(t[o.pluginName],e))}));return n},modifyOption:function modifyOption(e,t,n){var o;d.forEach((function(r){e[r.pluginName]&&r.optionListeners&&typeof r.optionListeners[t]==="function"&&(o=r.optionListeners[t].call(e[r.pluginName],n))}));return o}};function dispatchEvent(e){var o=e.sortable,r=e.rootEl,i=e.name,a=e.targetEl,l=e.cloneEl,s=e.toEl,c=e.fromEl,d=e.oldIndex,f=e.newIndex,g=e.oldDraggableIndex,p=e.newDraggableIndex,v=e.originalEvent,m=e.putSortable,b=e.extraEventProperties;o=o||r&&r[u];if(o){var S,_=o.options,y="on"+i.charAt(0).toUpperCase()+i.substr(1);if(!window.CustomEvent||t||n){S=document.createEvent("Event");S.initEvent(i,true,true)}else S=new CustomEvent(i,{bubbles:true,cancelable:true});S.to=s||r;S.from=c||r;S.item=a||r;S.clone=l;S.oldIndex=d;S.newIndex=f;S.oldDraggableIndex=g;S.newDraggableIndex=p;S.originalEvent=v;S.pullMode=m?m.lastPutMode:void 0;var E=_objectSpread2(_objectSpread2({},b),h.getEventProperties(i,o));for(var w in E)S[w]=E[w];r&&r.dispatchEvent(S);_[y]&&_[y].call(o,S)}}var g=["evt"];var p=function pluginEvent(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=n.evt,r=_objectWithoutProperties(n,g);h.pluginEvent.bind(Sortable)(e,t,_objectSpread2({dragEl:v,parentEl:m,ghostEl:b,rootEl:S,nextEl:_,lastDownEl:y,cloneEl:E,cloneHidden:w,dragStarted:j,putSortable:O,activeSortable:Sortable.active,originalEvent:o,oldIndex:D,oldDraggableIndex:x,newIndex:C,newDraggableIndex:A,hideGhostForTarget:re,unhideGhostForTarget:ie,cloneNowHidden:function cloneNowHidden(){w=true},cloneNowShown:function cloneNowShown(){w=false},dispatchSortableEvent:function dispatchSortableEvent(e){_dispatchEvent({sortable:t,name:e,originalEvent:o})}},r))};function _dispatchEvent(e){dispatchEvent(_objectSpread2({putSortable:O,cloneEl:E,targetEl:v,rootEl:S,oldIndex:D,oldDraggableIndex:x,newIndex:C,newDraggableIndex:A},e))}var v,m,b,S,_,y,E,w,D,C,x,A,T,O,M,I,P,R,N,k,j,F,X,Y,B,W=false,H=false,L=[],K=false,G=false,z=[],U=false,q=[];var V=typeof document!=="undefined",$=i,Z=n||t?"cssFloat":"float",Q=V&&!a&&!i&&"draggable"in document.createElement("div"),J=function(){if(V){if(t)return false;var e=document.createElement("x");e.style.cssText="pointer-events:auto";return e.style.pointerEvents==="auto"}}(),ee=function _detectDirection(e,t){var n=css(e),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),r=getChild(e,0,t),i=getChild(e,1,t),a=r&&css(r),l=i&&css(i),s=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+getRect(r).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+getRect(i).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&a.float&&a.float!=="none"){var u=a.float==="left"?"left":"right";return!i||l.clear!=="both"&&l.clear!==u?"horizontal":"vertical"}return r&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||s>=o&&n[Z]==="none"||i&&n[Z]==="none"&&s+c>o)?"vertical":"horizontal"},te=function _dragElInRowColumn(e,t,n){var o=n?e.left:e.top,r=n?e.right:e.bottom,i=n?e.width:e.height,a=n?t.left:t.top,l=n?t.right:t.bottom,s=n?t.width:t.height;return o===a||r===l||o+i/2===a+s/2},
|
57
|
+
/**
|
58
|
+
* Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.
|
59
|
+
* @param {Number} x X position
|
60
|
+
* @param {Number} y Y position
|
61
|
+
* @return {HTMLElement} Element of the first found nearest Sortable
|
62
|
+
*/
|
63
|
+
ne=function _detectNearestEmptySortable(e,t){var n;L.some((function(o){var r=o[u].options.emptyInsertThreshold;if(r&&!lastChild(o)){var i=getRect(o),a=e>=i.left-r&&e<=i.right+r,l=t>=i.top-r&&t<=i.bottom+r;return a&&l?n=o:void 0}}));return n},oe=function _prepareGroup(e){function toFn(e,t){return function(n,o,r,i){var a=n.options.group.name&&o.options.group.name&&n.options.group.name===o.options.group.name;if(e==null&&(t||a))return true;if(e==null||e===false)return false;if(t&&e==="clone")return e;if(typeof e==="function")return toFn(e(n,o,r,i),t)(n,o,r,i);var l=(t?n:o).options.group.name;return e===true||typeof e==="string"&&e===l||e.join&&e.indexOf(l)>-1}}var t={};var n=e.group;n&&_typeof(n)=="object"||(n={name:n});t.name=n.name;t.checkPull=toFn(n.pull,true);t.checkPut=toFn(n.put);t.revertClone=n.revertClone;e.group=t},re=function _hideGhostForTarget(){!J&&b&&css(b,"display","none")},ie=function _unhideGhostForTarget(){!J&&b&&css(b,"display","")};V&&!a&&document.addEventListener("click",(function(e){if(H){e.preventDefault();e.stopPropagation&&e.stopPropagation();e.stopImmediatePropagation&&e.stopImmediatePropagation();H=false;return false}}),true);var ae=function nearestEmptyInsertDetectEvent(e){if(v){e=e.touches?e.touches[0]:e;var t=ne(e.clientX,e.clientY);if(t){var n={};for(var o in e)e.hasOwnProperty(o)&&(n[o]=e[o]);n.target=n.rootEl=t;n.preventDefault=void 0;n.stopPropagation=void 0;t[u]._onDragOver(n)}}};var le=function _checkOutsideTargetEl(e){v&&v.parentNode[u]._isOutsideThisEl(e.target)};
|
64
|
+
/**
|
65
|
+
* @class Sortable
|
66
|
+
* @param {HTMLElement} el
|
67
|
+
* @param {Object} [options]
|
68
|
+
*/function Sortable(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e;this.options=t=_extends({},t);e[u]=this;var n={group:null,sort:true,disabled:false,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:false,invertedSwapThreshold:null,removeCloneOnHide:true,direction:function direction(){return ee(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:true,animation:0,easing:null,setData:function setData(e,t){e.setData("Text",t.textContent)},dropBubble:false,dragoverBubble:false,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:false,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:false,fallbackClass:"sortable-fallback",fallbackOnBody:false,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Sortable.supportPointer!==false&&"PointerEvent"in window&&!r,emptyInsertThreshold:5};h.initializePlugins(this,e,n);for(var o in n)!(o in t)&&(t[o]=n[o]);oe(t);for(var i in this)i.charAt(0)==="_"&&typeof this[i]==="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=!t.forceFallback&&Q;this.nativeDraggable&&(this.options.touchStartThreshold=1);if(t.supportPointer)on(e,"pointerdown",this._onTapStart);else{on(e,"mousedown",this._onTapStart);on(e,"touchstart",this._onTapStart)}if(this.nativeDraggable){on(e,"dragover",this);on(e,"dragenter",this)}L.push(this.el);t.store&&t.store.get&&this.sort(t.store.get(this)||[]);_extends(this,AnimationStateManager())}Sortable.prototype={constructor:Sortable,_isOutsideThisEl:function _isOutsideThisEl(e){this.el.contains(e)||e===this.el||(F=null)},_getDirection:function _getDirection(e,t){return typeof this.options.direction==="function"?this.options.direction.call(this,e,t,v):this.options.direction},_onTapStart:function _onTapStart(e){if(e.cancelable){var t=this,n=this.el,o=this.options,i=o.preventOnFilter,a=e.type,l=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,s=(l||e).target,c=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,u=o.filter;_saveInputCheckedState(n);if(!v&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||o.disabled)&&!c.isContentEditable&&(this.nativeDraggable||!r||!s||s.tagName.toUpperCase()!=="SELECT")){s=closest(s,o.draggable,n,false);if((!s||!s.animated)&&y!==s){D=index(s);x=index(s,o.draggable);if(typeof u==="function"){if(u.call(this,e,s,this)){_dispatchEvent({sortable:t,rootEl:c,name:"filter",targetEl:s,toEl:n,fromEl:n});p("filter",t,{evt:e});i&&e.cancelable&&e.preventDefault();return}}else if(u){u=u.split(",").some((function(o){o=closest(c,o.trim(),n,false);if(o){_dispatchEvent({sortable:t,rootEl:o,name:"filter",targetEl:s,fromEl:n,toEl:n});p("filter",t,{evt:e});return true}}));if(u){i&&e.cancelable&&e.preventDefault();return}}o.handle&&!closest(c,o.handle,n,false)||this._prepareDragStart(e,l,s)}}}},_prepareDragStart:function _prepareDragStart(e,r,i){var a,l=this,s=l.el,c=l.options,u=s.ownerDocument;if(i&&!v&&i.parentNode===s){var d=getRect(i);S=s;v=i;m=v.parentNode;_=v.nextSibling;y=i;T=c.group;Sortable.dragged=v;M={target:v,clientX:(r||e).clientX,clientY:(r||e).clientY};N=M.clientX-d.left;k=M.clientY-d.top;this._lastX=(r||e).clientX;this._lastY=(r||e).clientY;v.style["will-change"]="all";a=function dragStartFn(){p("delayEnded",l,{evt:e});if(Sortable.eventCanceled)l._onDrop();else{l._disableDelayedDragEvents();!o&&l.nativeDraggable&&(v.draggable=true);l._triggerDragStart(e,r);_dispatchEvent({sortable:l,name:"choose",originalEvent:e});toggleClass(v,c.chosenClass,true)}};c.ignore.split(",").forEach((function(e){find(v,e.trim(),_disableDraggable)}));on(u,"dragover",ae);on(u,"mousemove",ae);on(u,"touchmove",ae);on(u,"mouseup",l._onDrop);on(u,"touchend",l._onDrop);on(u,"touchcancel",l._onDrop);if(o&&this.nativeDraggable){this.options.touchStartThreshold=4;v.draggable=true}p("delayStart",this,{evt:e});if(!c.delay||c.delayOnTouchOnly&&!r||this.nativeDraggable&&(n||t))a();else{if(Sortable.eventCanceled){this._onDrop();return}on(u,"mouseup",l._disableDelayedDrag);on(u,"touchend",l._disableDelayedDrag);on(u,"touchcancel",l._disableDelayedDrag);on(u,"mousemove",l._delayedDragTouchMoveHandler);on(u,"touchmove",l._delayedDragTouchMoveHandler);c.supportPointer&&on(u,"pointermove",l._delayedDragTouchMoveHandler);l._dragStartTimer=setTimeout(a,c.delay)}}},_delayedDragTouchMoveHandler:function _delayedDragTouchMoveHandler(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function _disableDelayedDrag(){v&&_disableDraggable(v);clearTimeout(this._dragStartTimer);this._disableDelayedDragEvents()},_disableDelayedDragEvents:function _disableDelayedDragEvents(){var e=this.el.ownerDocument;off(e,"mouseup",this._disableDelayedDrag);off(e,"touchend",this._disableDelayedDrag);off(e,"touchcancel",this._disableDelayedDrag);off(e,"mousemove",this._delayedDragTouchMoveHandler);off(e,"touchmove",this._delayedDragTouchMoveHandler);off(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function _triggerDragStart(e,t){t=t||e.pointerType=="touch"&&e;if(!this.nativeDraggable||t)this.options.supportPointer?on(document,"pointermove",this._onTouchMove):on(document,t?"touchmove":"mousemove",this._onTouchMove);else{on(v,"dragend",this);on(S,"dragstart",this._onDragStart)}try{document.selection?_nextTick((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function _dragStarted(e,t){W=false;if(S&&v){p("dragStarted",this,{evt:t});this.nativeDraggable&&on(document,"dragover",le);var n=this.options;!e&&toggleClass(v,n.dragClass,false);toggleClass(v,n.ghostClass,true);Sortable.active=this;e&&this._appendGhost();_dispatchEvent({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function _emulateDragOver(){if(I){this._lastX=I.clientX;this._lastY=I.clientY;re();var e=document.elementFromPoint(I.clientX,I.clientY);var t=e;while(e&&e.shadowRoot){e=e.shadowRoot.elementFromPoint(I.clientX,I.clientY);if(e===t)break;t=e}v.parentNode[u]._isOutsideThisEl(e);if(t)do{if(t[u]){var n=void 0;n=t[u]._onDragOver({clientX:I.clientX,clientY:I.clientY,target:e,rootEl:t});if(n&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);ie()}},_onTouchMove:function _onTouchMove(e){if(M){var t=this.options,n=t.fallbackTolerance,o=t.fallbackOffset,r=e.touches?e.touches[0]:e,i=b&&matrix(b,true),a=b&&i&&i.a,l=b&&i&&i.d,s=$&&B&&getRelativeScrollOffset(B),c=(r.clientX-M.clientX+o.x)/(a||1)+(s?s[0]-z[0]:0)/(a||1),u=(r.clientY-M.clientY+o.y)/(l||1)+(s?s[1]-z[1]:0)/(l||1);if(!Sortable.active&&!W){if(n&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<n)return;this._onDragStart(e,true)}if(b){if(i){i.e+=c-(P||0);i.f+=u-(R||0)}else i={a:1,b:0,c:0,d:1,e:c,f:u};var d="matrix(".concat(i.a,",").concat(i.b,",").concat(i.c,",").concat(i.d,",").concat(i.e,",").concat(i.f,")");css(b,"webkitTransform",d);css(b,"mozTransform",d);css(b,"msTransform",d);css(b,"transform",d);P=c;R=u;I=r}e.cancelable&&e.preventDefault()}},_appendGhost:function _appendGhost(){if(!b){var e=this.options.fallbackOnBody?document.body:S,t=getRect(v,true,$,true,e),n=this.options;if($){B=e;while(css(B,"position")==="static"&&css(B,"transform")==="none"&&B!==document)B=B.parentNode;if(B!==document.body&&B!==document.documentElement){B===document&&(B=getWindowScrollingElement());t.top+=B.scrollTop;t.left+=B.scrollLeft}else B=getWindowScrollingElement();z=getRelativeScrollOffset(B)}b=v.cloneNode(true);toggleClass(b,n.ghostClass,false);toggleClass(b,n.fallbackClass,true);toggleClass(b,n.dragClass,true);css(b,"transition","");css(b,"transform","");css(b,"box-sizing","border-box");css(b,"margin",0);css(b,"top",t.top);css(b,"left",t.left);css(b,"width",t.width);css(b,"height",t.height);css(b,"opacity","0.8");css(b,"position",$?"absolute":"fixed");css(b,"zIndex","100000");css(b,"pointerEvents","none");Sortable.ghost=b;e.appendChild(b);css(b,"transform-origin",N/parseInt(b.style.width)*100+"% "+k/parseInt(b.style.height)*100+"%")}},_onDragStart:function _onDragStart(e,t){var n=this;var o=e.dataTransfer;var i=n.options;p("dragStart",this,{evt:e});if(Sortable.eventCanceled)this._onDrop();else{p("setupClone",this);if(!Sortable.eventCanceled){E=clone(v);E.removeAttribute("id");E.draggable=false;E.style["will-change"]="";this._hideClone();toggleClass(E,this.options.chosenClass,false);Sortable.clone=E}n.cloneId=_nextTick((function(){p("clone",n);if(!Sortable.eventCanceled){n.options.removeCloneOnHide||S.insertBefore(E,v);n._hideClone();_dispatchEvent({sortable:n,name:"clone"})}}));!t&&toggleClass(v,i.dragClass,true);if(t){H=true;n._loopId=setInterval(n._emulateDragOver,50)}else{off(document,"mouseup",n._onDrop);off(document,"touchend",n._onDrop);off(document,"touchcancel",n._onDrop);if(o){o.effectAllowed="move";i.setData&&i.setData.call(n,o,v)}on(document,"drop",n);css(v,"transform","translateZ(0)")}W=true;n._dragStartId=_nextTick(n._dragStarted.bind(n,t,e));on(document,"selectstart",n);j=true;r&&css(document.body,"user-select","none")}},_onDragOver:function _onDragOver(e){var t,n,o,r,i=this.el,a=e.target,l=this.options,s=l.group,c=Sortable.active,d=T===s,f=l.sort,h=O||c,g=this,y=false;if(!U){e.preventDefault!==void 0&&e.cancelable&&e.preventDefault();a=closest(a,l.draggable,i,true);dragOverEvent("dragOver");if(Sortable.eventCanceled)return y;if(v.contains(e.target)||a.animated&&a.animatingX&&a.animatingY||g._ignoreWhileAnimating===a)return completed(false);H=false;if(c&&!l.disabled&&(d?f||(o=m!==S):O===this||(this.lastPutMode=T.checkPull(this,c,v,e))&&s.checkPut(this,c,v,e))){r=this._getDirection(e,a)==="vertical";t=getRect(v);dragOverEvent("dragOverValid");if(Sortable.eventCanceled)return y;if(o){m=S;capture();this._hideClone();dragOverEvent("revert");Sortable.eventCanceled||(_?S.insertBefore(v,_):S.appendChild(v));return completed(true)}var E=lastChild(i,l.draggable);if(!E||_ghostIsLast(e,r,this)&&!E.animated){if(E===v)return completed(false);E&&i===e.target&&(a=E);a&&(n=getRect(a));if(_onMove(S,i,v,t,a,n,e,!!a)!==false){capture();E&&E.nextSibling?i.insertBefore(v,E.nextSibling):i.appendChild(v);m=i;changed();return completed(true)}}else if(E&&_ghostIsFirst(e,r,this)){var w=getChild(i,0,l,true);if(w===v)return completed(false);a=w;n=getRect(a);if(_onMove(S,i,v,t,a,n,e,false)!==false){capture();i.insertBefore(v,w);m=i;changed();return completed(true)}}else if(a.parentNode===i){n=getRect(a);var D,x=0,M=v.parentNode!==i,I=!te(v.animated&&v.toRect||t,a.animated&&a.toRect||n,r),P=r?"top":"left",R=isScrolledPast(a,"top","top")||isScrolledPast(v,"top","top"),N=R?R.scrollTop:void 0;if(F!==a){D=n[P];K=false;G=!I&&l.invertSwap||M}x=_getSwapDirection(e,a,n,r,I?1:l.swapThreshold,l.invertedSwapThreshold==null?l.swapThreshold:l.invertedSwapThreshold,G,F===a);var k;if(x!==0){var j=index(v);do{j-=x;k=m.children[j]}while(k&&(css(k,"display")==="none"||k===b))}if(x===0||k===a)return completed(false);F=a;X=x;var B=a.nextElementSibling,W=false;W=x===1;var L=_onMove(S,i,v,t,a,n,e,W);if(L!==false){L!==1&&L!==-1||(W=L===1);U=true;setTimeout(_unsilent,30);capture();W&&!B?i.appendChild(v):a.parentNode.insertBefore(v,W?B:a);R&&scrollBy(R,0,N-R.scrollTop);m=v.parentNode;D===void 0||G||(Y=Math.abs(D-getRect(a)[P]));changed();return completed(true)}}if(i.contains(v))return completed(false)}return false}function dragOverEvent(l,s){p(l,g,_objectSpread2({evt:e,isOwner:d,axis:r?"vertical":"horizontal",revert:o,dragRect:t,targetRect:n,canSort:f,fromSortable:h,target:a,completed:completed,onMove:function onMove(n,o){return _onMove(S,i,v,t,n,getRect(n),e,o)},changed:changed},s))}function capture(){dragOverEvent("dragOverAnimationCapture");g.captureAnimationState();g!==h&&h.captureAnimationState()}function completed(t){dragOverEvent("dragOverCompleted",{insertion:t});if(t){d?c._hideClone():c._showClone(g);if(g!==h){toggleClass(v,O?O.options.ghostClass:c.options.ghostClass,false);toggleClass(v,l.ghostClass,true)}O!==g&&g!==Sortable.active?O=g:g===Sortable.active&&O&&(O=null);h===g&&(g._ignoreWhileAnimating=a);g.animateAll((function(){dragOverEvent("dragOverAnimationComplete");g._ignoreWhileAnimating=null}));if(g!==h){h.animateAll();h._ignoreWhileAnimating=null}}(a===v&&!v.animated||a===i&&!a.animated)&&(F=null);if(!l.dragoverBubble&&!e.rootEl&&a!==document){v.parentNode[u]._isOutsideThisEl(e.target);!t&&ae(e)}!l.dragoverBubble&&e.stopPropagation&&e.stopPropagation();return y=true}function changed(){C=index(v);A=index(v,l.draggable);_dispatchEvent({sortable:g,name:"change",toEl:i,newIndex:C,newDraggableIndex:A,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function _offMoveEvents(){off(document,"mousemove",this._onTouchMove);off(document,"touchmove",this._onTouchMove);off(document,"pointermove",this._onTouchMove);off(document,"dragover",ae);off(document,"mousemove",ae);off(document,"touchmove",ae)},_offUpEvents:function _offUpEvents(){var e=this.el.ownerDocument;off(e,"mouseup",this._onDrop);off(e,"touchend",this._onDrop);off(e,"pointerup",this._onDrop);off(e,"touchcancel",this._onDrop);off(document,"selectstart",this)},_onDrop:function _onDrop(e){var t=this.el,n=this.options;C=index(v);A=index(v,n.draggable);p("drop",this,{evt:e});m=v&&v.parentNode;C=index(v);A=index(v,n.draggable);if(Sortable.eventCanceled)this._nulling();else{W=false;G=false;K=false;clearInterval(this._loopId);clearTimeout(this._dragStartTimer);_cancelNextTick(this.cloneId);_cancelNextTick(this._dragStartId);if(this.nativeDraggable){off(document,"drop",this);off(t,"dragstart",this._onDragStart)}this._offMoveEvents();this._offUpEvents();r&&css(document.body,"user-select","");css(v,"transform","");if(e){if(j){e.cancelable&&e.preventDefault();!n.dropBubble&&e.stopPropagation()}b&&b.parentNode&&b.parentNode.removeChild(b);(S===m||O&&O.lastPutMode!=="clone")&&E&&E.parentNode&&E.parentNode.removeChild(E);if(v){this.nativeDraggable&&off(v,"dragend",this);_disableDraggable(v);v.style["will-change"]="";j&&!W&&toggleClass(v,O?O.options.ghostClass:this.options.ghostClass,false);toggleClass(v,this.options.chosenClass,false);_dispatchEvent({sortable:this,name:"unchoose",toEl:m,newIndex:null,newDraggableIndex:null,originalEvent:e});if(S!==m){if(C>=0){_dispatchEvent({rootEl:m,name:"add",toEl:m,fromEl:S,originalEvent:e});_dispatchEvent({sortable:this,name:"remove",toEl:m,originalEvent:e});_dispatchEvent({rootEl:m,name:"sort",toEl:m,fromEl:S,originalEvent:e});_dispatchEvent({sortable:this,name:"sort",toEl:m,originalEvent:e})}O&&O.save()}else if(C!==D&&C>=0){_dispatchEvent({sortable:this,name:"update",toEl:m,originalEvent:e});_dispatchEvent({sortable:this,name:"sort",toEl:m,originalEvent:e})}if(Sortable.active){if(C==null||C===-1){C=D;A=x}_dispatchEvent({sortable:this,name:"end",toEl:m,originalEvent:e});this.save()}}}this._nulling()}},_nulling:function _nulling(){p("nulling",this);S=v=m=b=_=E=y=w=M=I=j=C=A=D=x=F=X=O=T=Sortable.dragged=Sortable.ghost=Sortable.clone=Sortable.active=null;q.forEach((function(e){e.checked=true}));q.length=P=R=0},handleEvent:function handleEvent(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":if(v){this._onDragOver(e);_globalDragOver(e)}break;case"selectstart":e.preventDefault();break}},
|
69
|
+
/**
|
70
|
+
* Serializes the item into an array of string.
|
71
|
+
* @returns {String[]}
|
72
|
+
*/
|
73
|
+
toArray:function toArray(){var e,t=[],n=this.el.children,o=0,r=n.length,i=this.options;for(;o<r;o++){e=n[o];closest(e,i.draggable,this.el,false)&&t.push(e.getAttribute(i.dataIdAttr)||_generateId(e))}return t},
|
74
|
+
/**
|
75
|
+
* Sorts the elements according to the array.
|
76
|
+
* @param {String[]} order order of the items
|
77
|
+
*/
|
78
|
+
sort:function sort(e,t){var n={},o=this.el;this.toArray().forEach((function(e,t){var r=o.children[t];closest(r,this.options.draggable,o,false)&&(n[e]=r)}),this);t&&this.captureAnimationState();e.forEach((function(e){if(n[e]){o.removeChild(n[e]);o.appendChild(n[e])}}));t&&this.animateAll()},save:function save(){var e=this.options.store;e&&e.set&&e.set(this)},
|
79
|
+
/**
|
80
|
+
* For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
|
81
|
+
* @param {HTMLElement} el
|
82
|
+
* @param {String} [selector] default: `options.draggable`
|
83
|
+
* @returns {HTMLElement|null}
|
84
|
+
*/
|
85
|
+
closest:function closest$1(e,t){return closest(e,t||this.options.draggable,this.el,false)},
|
86
|
+
/**
|
87
|
+
* Set/get option
|
88
|
+
* @param {string} name
|
89
|
+
* @param {*} [value]
|
90
|
+
* @returns {*}
|
91
|
+
*/
|
92
|
+
option:function option(e,t){var n=this.options;if(t===void 0)return n[e];var o=h.modifyOption(this,e,t);n[e]=typeof o!=="undefined"?o:t;e==="group"&&oe(n)},destroy:function destroy(){p("destroy",this);var e=this.el;e[u]=null;off(e,"mousedown",this._onTapStart);off(e,"touchstart",this._onTapStart);off(e,"pointerdown",this._onTapStart);if(this.nativeDraggable){off(e,"dragover",this);off(e,"dragenter",this)}Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),(function(e){e.removeAttribute("draggable")}));this._onDrop();this._disableDelayedDragEvents();L.splice(L.indexOf(this.el),1);this.el=e=null},_hideClone:function _hideClone(){if(!w){p("hideClone",this);if(Sortable.eventCanceled)return;css(E,"display","none");this.options.removeCloneOnHide&&E.parentNode&&E.parentNode.removeChild(E);w=true}},_showClone:function _showClone(e){if(e.lastPutMode==="clone"){if(w){p("showClone",this);if(Sortable.eventCanceled)return;v.parentNode!=S||this.options.group.revertClone?_?S.insertBefore(E,_):S.appendChild(E):S.insertBefore(E,v);this.options.group.revertClone&&this.animate(v,E);css(E,"display","");w=false}}else this._hideClone()}};function _globalDragOver(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move");e.cancelable&&e.preventDefault()}function _onMove(e,o,r,i,a,l,s,c){var d,f,h=e[u],g=h.options.onMove;if(!window.CustomEvent||t||n){d=document.createEvent("Event");d.initEvent("move",true,true)}else d=new CustomEvent("move",{bubbles:true,cancelable:true});d.to=o;d.from=e;d.dragged=r;d.draggedRect=i;d.related=a||o;d.relatedRect=l||getRect(o);d.willInsertAfter=c;d.originalEvent=s;e.dispatchEvent(d);g&&(f=g.call(h,d,s));return f}function _disableDraggable(e){e.draggable=false}function _unsilent(){U=false}function _ghostIsFirst(e,t,n){var o=getRect(getChild(n.el,0,n.options,true));var r=getChildContainingRectFromElement(n.el,n.options,b);var i=10;return t?e.clientX<r.left-i||e.clientY<o.top&&e.clientX<o.right:e.clientY<r.top-i||e.clientY<o.bottom&&e.clientX<o.left}function _ghostIsLast(e,t,n){var o=getRect(lastChild(n.el,n.options.draggable));var r=getChildContainingRectFromElement(n.el,n.options,b);var i=10;return t?e.clientX>r.right+i||e.clientY>o.bottom&&e.clientX>o.left:e.clientY>r.bottom+i||e.clientX>o.right&&e.clientY>o.top}function _getSwapDirection(e,t,n,o,r,i,a,l){var s=o?e.clientY:e.clientX,c=o?n.height:n.width,u=o?n.top:n.left,d=o?n.bottom:n.right,f=false;if(!a)if(l&&Y<c*r){!K&&(X===1?s>u+c*i/2:s<d-c*i/2)&&(K=true);if(K)f=true;else if(X===1?s<u+Y:s>d-Y)return-X}else if(s>u+c*(1-r)/2&&s<d-c*(1-r)/2)return _getInsertDirection(t);f=f||a;return f&&(s<u+c*i/2||s>d-c*i/2)?s>u+c/2?1:-1:0}
|
93
|
+
/**
|
94
|
+
* Gets the direction dragEl must be swapped relative to target in order to make it
|
95
|
+
* seem that dragEl has been "inserted" into that element's position
|
96
|
+
* @param {HTMLElement} target The target whose position dragEl is being inserted at
|
97
|
+
* @return {Number} Direction dragEl must be swapped
|
98
|
+
*/function _getInsertDirection(e){return index(v)<index(e)?1:-1}
|
99
|
+
/**
|
100
|
+
* Generate id
|
101
|
+
* @param {HTMLElement} el
|
102
|
+
* @returns {String}
|
103
|
+
* @private
|
104
|
+
*/function _generateId(e){var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,o=0;while(n--)o+=t.charCodeAt(n);return o.toString(36)}function _saveInputCheckedState(e){q.length=0;var t=e.getElementsByTagName("input");var n=t.length;while(n--){var o=t[n];o.checked&&q.push(o)}}function _nextTick(e){return setTimeout(e,0)}function _cancelNextTick(e){return clearTimeout(e)}V&&on(document,"touchmove",(function(e){(Sortable.active||W)&&e.cancelable&&e.preventDefault()}));Sortable.utils={on:on,off:off,css:css,find:find,is:function is(e,t){return!!closest(e,t,e,false)},extend:extend,throttle:throttle,closest:closest,toggleClass:toggleClass,clone:clone,index:index,nextTick:_nextTick,cancelNextTick:_cancelNextTick,detectDirection:ee,getChild:getChild};
|
105
|
+
/**
|
106
|
+
* Get the Sortable instance of an element
|
107
|
+
* @param {HTMLElement} element The element
|
108
|
+
* @return {Sortable|undefined} The instance of Sortable
|
109
|
+
*/Sortable.get=function(e){return e[u]};
|
110
|
+
/**
|
111
|
+
* Mount a plugin to Sortable
|
112
|
+
* @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted
|
113
|
+
*/Sortable.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]);t.forEach((function(e){if(!e.prototype||!e.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(e));e.utils&&(Sortable.utils=_objectSpread2(_objectSpread2({},Sortable.utils),e.utils));h.mount(e)}))};
|
114
|
+
/**
|
115
|
+
* Create sortable instance
|
116
|
+
* @param {HTMLElement} el
|
117
|
+
* @param {Object} [options]
|
118
|
+
*/Sortable.create=function(e,t){return new Sortable(e,t)};Sortable.version=e;var se,ce,ue,de,fe,he,ge=[],pe=false;function AutoScrollPlugin(){function AutoScroll(){this.defaults={scroll:true,forceAutoScrollFallback:false,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:true};for(var e in this)e.charAt(0)==="_"&&typeof this[e]==="function"&&(this[e]=this[e].bind(this))}AutoScroll.prototype={dragStarted:function dragStarted(e){var t=e.originalEvent;this.sortable.nativeDraggable?on(document,"dragover",this._handleAutoScroll):this.options.supportPointer?on(document,"pointermove",this._handleFallbackAutoScroll):t.touches?on(document,"touchmove",this._handleFallbackAutoScroll):on(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function dragOverCompleted(e){var t=e.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function drop(){if(this.sortable.nativeDraggable)off(document,"dragover",this._handleAutoScroll);else{off(document,"pointermove",this._handleFallbackAutoScroll);off(document,"touchmove",this._handleFallbackAutoScroll);off(document,"mousemove",this._handleFallbackAutoScroll)}clearPointerElemChangedInterval();clearAutoScrolls();cancelThrottle()},nulling:function nulling(){fe=ce=se=pe=he=ue=de=null;ge.length=0},_handleFallbackAutoScroll:function _handleFallbackAutoScroll(e){this._handleAutoScroll(e,true)},_handleAutoScroll:function _handleAutoScroll(e,o){var i=this;var a=(e.touches?e.touches[0]:e).clientX,l=(e.touches?e.touches[0]:e).clientY,s=document.elementFromPoint(a,l);fe=e;if(o||this.options.forceAutoScrollFallback||n||t||r){ve(e,this.options,s,o);var c=getParentAutoScrollElement(s,true);if(pe&&(!he||a!==ue||l!==de)){he&&clearPointerElemChangedInterval();he=setInterval((function(){var t=getParentAutoScrollElement(document.elementFromPoint(a,l),true);if(t!==c){c=t;clearAutoScrolls()}ve(e,i.options,t,o)}),10);ue=a;de=l}}else{if(!this.options.bubbleScroll||getParentAutoScrollElement(s,true)===getWindowScrollingElement()){clearAutoScrolls();return}ve(e,this.options,getParentAutoScrollElement(s,false),false)}}};return _extends(AutoScroll,{pluginName:"scroll",initializeByDefault:true})}function clearAutoScrolls(){ge.forEach((function(e){clearInterval(e.pid)}));ge=[]}function clearPointerElemChangedInterval(){clearInterval(he)}var ve=throttle((function(e,t,n,o){if(t.scroll){var r=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,a=t.scrollSensitivity,l=t.scrollSpeed,s=getWindowScrollingElement();var c,d=false;if(ce!==n){ce=n;clearAutoScrolls();se=t.scroll;c=t.scrollFn;se===true&&(se=getParentAutoScrollElement(n,true))}var f=0;var h=se;do{var g=h,p=getRect(g),v=p.top,m=p.bottom,b=p.left,S=p.right,_=p.width,y=p.height,E=void 0,w=void 0,D=g.scrollWidth,C=g.scrollHeight,x=css(g),A=g.scrollLeft,T=g.scrollTop;if(g===s){E=_<D&&(x.overflowX==="auto"||x.overflowX==="scroll"||x.overflowX==="visible");w=y<C&&(x.overflowY==="auto"||x.overflowY==="scroll"||x.overflowY==="visible")}else{E=_<D&&(x.overflowX==="auto"||x.overflowX==="scroll");w=y<C&&(x.overflowY==="auto"||x.overflowY==="scroll")}var O=E&&(Math.abs(S-r)<=a&&A+_<D)-(Math.abs(b-r)<=a&&!!A);var M=w&&(Math.abs(m-i)<=a&&T+y<C)-(Math.abs(v-i)<=a&&!!T);if(!ge[f])for(var I=0;I<=f;I++)ge[I]||(ge[I]={});if(ge[f].vx!=O||ge[f].vy!=M||ge[f].el!==g){ge[f].el=g;ge[f].vx=O;ge[f].vy=M;clearInterval(ge[f].pid);if(O!=0||M!=0){d=true;ge[f].pid=setInterval(function(){o&&this.layer===0&&Sortable.active._onTouchMove(fe);var t=ge[this.layer].vy?ge[this.layer].vy*l:0;var n=ge[this.layer].vx?ge[this.layer].vx*l:0;typeof c==="function"&&c.call(Sortable.dragged.parentNode[u],n,t,e,fe,ge[this.layer].el)!=="continue"||scrollBy(ge[this.layer].el,n,t)}.bind({layer:f}),24)}}f++}while(t.bubbleScroll&&h!==s&&(h=getParentAutoScrollElement(h,false)));pe=d}}),30);var me=function drop(e){var t=e.originalEvent,n=e.putSortable,o=e.dragEl,r=e.activeSortable,i=e.dispatchSortableEvent,a=e.hideGhostForTarget,l=e.unhideGhostForTarget;if(t){var s=n||r;a();var c=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t;var u=document.elementFromPoint(c.clientX,c.clientY);l();if(s&&!s.el.contains(u)){i("spill");this.onSpill({dragEl:o,putSortable:n})}}};function Revert(){}Revert.prototype={startIndex:null,dragStart:function dragStart(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function onSpill(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState();n&&n.captureAnimationState();var o=getChild(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(t,o):this.sortable.el.appendChild(t);this.sortable.animateAll();n&&n.animateAll()},drop:me};_extends(Revert,{pluginName:"revertOnSpill"});function Remove(){}Remove.prototype={onSpill:function onSpill(e){var t=e.dragEl,n=e.putSortable;var o=n||this.sortable;o.captureAnimationState();t.parentNode&&t.parentNode.removeChild(t);o.animateAll()},drop:me};_extends(Remove,{pluginName:"removeOnSpill"});var be;function SwapPlugin(){function Swap(){this.defaults={swapClass:"sortable-swap-highlight"}}Swap.prototype={dragStart:function dragStart(e){var t=e.dragEl;be=t},dragOverValid:function dragOverValid(e){var t=e.completed,n=e.target,o=e.onMove,r=e.activeSortable,i=e.changed,a=e.cancel;if(r.options.swap){var l=this.sortable.el,s=this.options;if(n&&n!==l){var c=be;if(o(n)!==false){toggleClass(n,s.swapClass,true);be=n}else be=null;c&&c!==be&&toggleClass(c,s.swapClass,false)}i();t(true);a()}},drop:function drop(e){var t=e.activeSortable,n=e.putSortable,o=e.dragEl;var r=n||this.sortable;var i=this.options;be&&toggleClass(be,i.swapClass,false);if(be&&(i.swap||n&&n.options.swap)&&o!==be){r.captureAnimationState();r!==t&&t.captureAnimationState();swapNodes(o,be);r.animateAll();r!==t&&t.animateAll()}},nulling:function nulling(){be=null}};return _extends(Swap,{pluginName:"swap",eventProperties:function eventProperties(){return{swapItem:be}}})}function swapNodes(e,t){var n,o,r=e.parentNode,i=t.parentNode;if(r&&i&&!r.isEqualNode(t)&&!i.isEqualNode(e)){n=index(e);o=index(t);r.isEqualNode(i)&&n<o&&o++;r.insertBefore(t,r.children[n]);i.insertBefore(e,i.children[o])}}var Se,_e,ye,Ee,we,De=[],Ce=[],xe=false,Ae=false,Te=false;function MultiDragPlugin(){function MultiDrag(e){for(var t in this)t.charAt(0)==="_"&&typeof this[t]==="function"&&(this[t]=this[t].bind(this));if(!e.options.avoidImplicitDeselect)if(e.options.supportPointer)on(document,"pointerup",this._deselectMultiDrag);else{on(document,"mouseup",this._deselectMultiDrag);on(document,"touchend",this._deselectMultiDrag)}on(document,"keydown",this._checkKeyDown);on(document,"keyup",this._checkKeyUp);this.defaults={selectedClass:"sortable-selected",multiDragKey:null,avoidImplicitDeselect:false,setData:function setData(t,n){var o="";De.length&&_e===e?De.forEach((function(e,t){o+=(t?", ":"")+e.textContent})):o=n.textContent;t.setData("Text",o)}}}MultiDrag.prototype={multiDragKeyDown:false,isMultiDrag:false,delayStartGlobal:function delayStartGlobal(e){var t=e.dragEl;ye=t},delayEnded:function delayEnded(){this.isMultiDrag=~De.indexOf(ye)},setupClone:function setupClone(e){var t=e.sortable,n=e.cancel;if(this.isMultiDrag){for(var o=0;o<De.length;o++){Ce.push(clone(De[o]));Ce[o].sortableIndex=De[o].sortableIndex;Ce[o].draggable=false;Ce[o].style["will-change"]="";toggleClass(Ce[o],this.options.selectedClass,false);De[o]===ye&&toggleClass(Ce[o],this.options.chosenClass,false)}t._hideClone();n()}},clone:function clone(e){var t=e.sortable,n=e.rootEl,o=e.dispatchSortableEvent,r=e.cancel;if(this.isMultiDrag&&!this.options.removeCloneOnHide&&De.length&&_e===t){insertMultiDragClones(true,n);o("clone");r()}},showClone:function showClone(e){var t=e.cloneNowShown,n=e.rootEl,o=e.cancel;if(this.isMultiDrag){insertMultiDragClones(false,n);Ce.forEach((function(e){css(e,"display","")}));t();we=false;o()}},hideClone:function hideClone(e){var t=this;e.sortable;var n=e.cloneNowHidden,o=e.cancel;if(this.isMultiDrag){Ce.forEach((function(e){css(e,"display","none");t.options.removeCloneOnHide&&e.parentNode&&e.parentNode.removeChild(e)}));n();we=true;o()}},dragStartGlobal:function dragStartGlobal(e){e.sortable;!this.isMultiDrag&&_e&&_e.multiDrag._deselectMultiDrag();De.forEach((function(e){e.sortableIndex=index(e)}));De=De.sort((function(e,t){return e.sortableIndex-t.sortableIndex}));Te=true},dragStarted:function dragStarted(e){var t=this;var n=e.sortable;if(this.isMultiDrag){if(this.options.sort){n.captureAnimationState();if(this.options.animation){De.forEach((function(e){e!==ye&&css(e,"position","absolute")}));var o=getRect(ye,false,true,true);De.forEach((function(e){e!==ye&&setRect(e,o)}));Ae=true;xe=true}}n.animateAll((function(){Ae=false;xe=false;t.options.animation&&De.forEach((function(e){unsetRect(e)}));t.options.sort&&removeMultiDragElements()}))}},dragOver:function dragOver(e){var t=e.target,n=e.completed,o=e.cancel;if(Ae&&~De.indexOf(t)){n(false);o()}},revert:function revert(e){var t=e.fromSortable,n=e.rootEl,o=e.sortable,r=e.dragRect;if(De.length>1){De.forEach((function(e){o.addAnimationState({target:e,rect:Ae?getRect(e):r});unsetRect(e);e.fromRect=r;t.removeAnimationState(e)}));Ae=false;insertMultiDragElements(!this.options.removeCloneOnHide,n)}},dragOverCompleted:function dragOverCompleted(e){var t=e.sortable,n=e.isOwner,o=e.insertion,r=e.activeSortable,i=e.parentEl,a=e.putSortable;var l=this.options;if(o){n&&r._hideClone();xe=false;if(l.animation&&De.length>1&&(Ae||!n&&!r.options.sort&&!a)){var s=getRect(ye,false,true,true);De.forEach((function(e){if(e!==ye){setRect(e,s);i.appendChild(e)}}));Ae=true}if(!n){Ae||removeMultiDragElements();if(De.length>1){var c=we;r._showClone(t);r.options.animation&&!we&&c&&Ce.forEach((function(e){r.addAnimationState({target:e,rect:Ee});e.fromRect=Ee;e.thisAnimationDuration=null}))}else r._showClone(t)}}},dragOverAnimationCapture:function dragOverAnimationCapture(e){var t=e.dragRect,n=e.isOwner,o=e.activeSortable;De.forEach((function(e){e.thisAnimationDuration=null}));if(o.options.animation&&!n&&o.multiDrag.isMultiDrag){Ee=_extends({},t);var r=matrix(ye,true);Ee.top-=r.f;Ee.left-=r.e}},dragOverAnimationComplete:function dragOverAnimationComplete(){if(Ae){Ae=false;removeMultiDragElements()}},drop:function drop(e){var t=e.originalEvent,n=e.rootEl,o=e.parentEl,r=e.sortable,i=e.dispatchSortableEvent,a=e.oldIndex,l=e.putSortable;var s=l||this.sortable;if(t){var c=this.options,d=o.children;if(!Te){c.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag();toggleClass(ye,c.selectedClass,!~De.indexOf(ye));if(~De.indexOf(ye)){De.splice(De.indexOf(ye),1);Se=null;dispatchEvent({sortable:r,rootEl:n,name:"deselect",targetEl:ye,originalEvent:t})}else{De.push(ye);dispatchEvent({sortable:r,rootEl:n,name:"select",targetEl:ye,originalEvent:t});if(t.shiftKey&&Se&&r.el.contains(Se)){var f=index(Se),h=index(ye);if(~f&&~h&&f!==h){var g,p;if(h>f){p=f;g=h}else{p=h;g=f+1}for(;p<g;p++)if(!~De.indexOf(d[p])){toggleClass(d[p],c.selectedClass,true);De.push(d[p]);dispatchEvent({sortable:r,rootEl:n,name:"select",targetEl:d[p],originalEvent:t})}}}else Se=ye;_e=s}}if(Te&&this.isMultiDrag){Ae=false;if((o[u].options.sort||o!==n)&&De.length>1){var v=getRect(ye),m=index(ye,":not(."+this.options.selectedClass+")");!xe&&c.animation&&(ye.thisAnimationDuration=null);s.captureAnimationState();if(!xe){if(c.animation){ye.fromRect=v;De.forEach((function(e){e.thisAnimationDuration=null;if(e!==ye){var t=Ae?getRect(e):v;e.fromRect=t;s.addAnimationState({target:e,rect:t})}}))}removeMultiDragElements();De.forEach((function(e){d[m]?o.insertBefore(e,d[m]):o.appendChild(e);m++}));if(a===index(ye)){var b=false;De.forEach((function(e){e.sortableIndex===index(e)||(b=true)}));if(b){i("update");i("sort")}}}De.forEach((function(e){unsetRect(e)}));s.animateAll()}_e=s}(n===o||l&&l.lastPutMode!=="clone")&&Ce.forEach((function(e){e.parentNode&&e.parentNode.removeChild(e)}))}},nullingGlobal:function nullingGlobal(){this.isMultiDrag=Te=false;Ce.length=0},destroyGlobal:function destroyGlobal(){this._deselectMultiDrag();off(document,"pointerup",this._deselectMultiDrag);off(document,"mouseup",this._deselectMultiDrag);off(document,"touchend",this._deselectMultiDrag);off(document,"keydown",this._checkKeyDown);off(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function _deselectMultiDrag(e){if((typeof Te==="undefined"||!Te)&&_e===this.sortable&&(!e||!closest(e.target,this.options.draggable,this.sortable.el,false))&&(!e||e.button===0))while(De.length){var t=De[0];toggleClass(t,this.options.selectedClass,false);De.shift();dispatchEvent({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:t,originalEvent:e})}},_checkKeyDown:function _checkKeyDown(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=true)},_checkKeyUp:function _checkKeyUp(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=false)}};return _extends(MultiDrag,{pluginName:"multiDrag",utils:{
|
119
|
+
/**
|
120
|
+
* Selects the provided multi-drag item
|
121
|
+
* @param {HTMLElement} el The element to be selected
|
122
|
+
*/
|
123
|
+
select:function select(e){var t=e.parentNode[u];if(t&&t.options.multiDrag&&!~De.indexOf(e)){if(_e&&_e!==t){_e.multiDrag._deselectMultiDrag();_e=t}toggleClass(e,t.options.selectedClass,true);De.push(e)}},
|
124
|
+
/**
|
125
|
+
* Deselects the provided multi-drag item
|
126
|
+
* @param {HTMLElement} el The element to be deselected
|
127
|
+
*/
|
128
|
+
deselect:function deselect(e){var t=e.parentNode[u],n=De.indexOf(e);if(t&&t.options.multiDrag&&~n){toggleClass(e,t.options.selectedClass,false);De.splice(n,1)}}},eventProperties:function eventProperties(){var e=this;var t=[],n=[];De.forEach((function(o){t.push({multiDragElement:o,index:o.sortableIndex});var r;r=Ae&&o!==ye?-1:Ae?index(o,":not(."+e.options.selectedClass+")"):index(o);n.push({multiDragElement:o,index:r})}));return{items:_toConsumableArray(De),clones:[].concat(Ce),oldIndicies:t,newIndicies:n}},optionListeners:{multiDragKey:function multiDragKey(e){e=e.toLowerCase();e==="ctrl"?e="Control":e.length>1&&(e=e.charAt(0).toUpperCase()+e.substr(1));return e}}})}function insertMultiDragElements(e,t){De.forEach((function(n,o){var r=t.children[n.sortableIndex+(e?Number(o):0)];r?t.insertBefore(n,r):t.appendChild(n)}))}
|
129
|
+
/**
|
130
|
+
* Insert multi-drag clones
|
131
|
+
* @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted
|
132
|
+
* @param {HTMLElement} rootEl
|
133
|
+
*/function insertMultiDragClones(e,t){Ce.forEach((function(n,o){var r=t.children[n.sortableIndex+(e?Number(o):0)];r?t.insertBefore(n,r):t.appendChild(n)}))}function removeMultiDragElements(){De.forEach((function(e){e!==ye&&e.parentNode&&e.parentNode.removeChild(e)}))}Sortable.mount(new AutoScrollPlugin);Sortable.mount(Remove,Revert);export{MultiDragPlugin as MultiDrag,Sortable,SwapPlugin as Swap,Sortable as default};
|
134
|
+
|
@@ -0,0 +1,2 @@
|
|
1
|
+
const e="ΝΌ";const t=typeof Symbol=="undefined"?"__"+e:Symbol.for(e);const s=typeof Symbol=="undefined"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet");const l=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:{};class StyleModule{constructor(e,t){this.rules=[];let{finish:s}=t||{};function splitSelector(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function render(e,t,l,n){let i=[],o=/^@(\w+)\b/.exec(e[0]),r=o&&o[1]=="keyframes";if(o&&t==null)return l.push(e[0]+";");for(let s in t){let n=t[s];if(/&/.test(s))render(s.split(/,\s*/).map((t=>e.map((e=>t.replace(/&/,e))))).reduce(((e,t)=>e.concat(t))),n,l);else if(n&&typeof n=="object"){if(!o)throw new RangeError("The value of a property ("+s+") should be a primitive value.");render(splitSelector(s),n,i,r)}else n!=null&&i.push(s.replace(/_.*/,"").replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()))+": "+n+";")}(i.length||r)&&l.push((!s||o||n?e:e.map(s)).join(", ")+" {"+i.join(" ")+"}")}for(let t in e)render(splitSelector(t),e[t],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let s=l[t]||1;l[t]=s+1;return e+s.toString(36)}static mount(e,t,l){let n=e[s],i=l&&l.nonce;n?i&&n.setNonce(i):n=new StyleSet(e,i);n.mount(Array.isArray(t)?t:[t],e)}}let n=new Map;class StyleSet{constructor(e,t){let l=e.ownerDocument||e,i=l.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let t=n.get(l);if(t)return e[s]=t;this.sheet=new i.CSSStyleSheet;n.set(l,this)}else{this.styleTag=l.createElement("style");t&&this.styleTag.setAttribute("nonce",t)}this.modules=[];e[s]=this}mount(e,t){let s=this.sheet;let l=0,n=0;for(let t=0;t<e.length;t++){let i=e[t],o=this.modules.indexOf(i);if(o<n&&o>-1){this.modules.splice(o,1);n--;o=-1}if(o==-1){this.modules.splice(n++,0,i);if(s)for(let e=0;e<i.rules.length;e++)s.insertRule(i.rules[e],l++)}else{while(n<o)l+=this.modules[n++].rules.length;l+=i.rules.length;n++}}if(s)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e="";for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+"\n";this.styleTag.textContent=e;let s=t.head||t;this.styleTag.parentNode!=s&&s.insertBefore(this.styleTag,s.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}export{StyleModule};
|
2
|
+
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{createPopper as e,applyStyles as t}from"@popperjs/core";var n='<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>';var r="tippy-box";var o="tippy-content";var i="tippy-backdrop";var a="tippy-arrow";var s="tippy-svg-arrow";var u={passive:true,capture:true};var c=function TIPPY_DEFAULT_APPEND_TO(){return document.body};function hasOwnProperty(e,t){return{}.hasOwnProperty.call(e,t)}function getValueAtIndexOrReturn(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function isType(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function invokeWithArgsOrReturn(e,t){return"function"===typeof e?e.apply(void 0,t):e}function debounce(e,t){return 0===t?e:function(r){clearTimeout(n);n=setTimeout((function(){e(r)}),t)};var n}function removeProperties(e,t){var n=Object.assign({},e);t.forEach((function(e){delete n[e]}));return n}function splitBySpaces(e){return e.split(/\s+/).filter(Boolean)}function normalizeToArray(e){return[].concat(e)}function pushIfUnique(e,t){-1===e.indexOf(t)&&e.push(t)}function unique(e){return e.filter((function(t,n){return e.indexOf(t)===n}))}function getBasePlacement(e){return e.split("-")[0]}function arrayFrom(e){return[].slice.call(e)}function removeUndefinedProps(e){return Object.keys(e).reduce((function(t,n){void 0!==e[n]&&(t[n]=e[n]);return t}),{})}function div(){return document.createElement("div")}function isElement(e){return["Element","Fragment"].some((function(t){return isType(e,t)}))}function isNodeList(e){return isType(e,"NodeList")}function isMouseEvent(e){return isType(e,"MouseEvent")}function isReferenceElement(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function getArrayOfElements(e){return isElement(e)?[e]:isNodeList(e)?arrayFrom(e):Array.isArray(e)?e:arrayFrom(document.querySelectorAll(e))}function setTransitionDuration(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function setVisibilityState(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function getOwnerDocument(e){var t;var n=normalizeToArray(e),r=n[0];return null!=r&&null!=(t=r.ownerDocument)&&t.body?r.ownerDocument:document}function isCursorOutsideInteractiveBorder(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,o=e.popperState,i=e.props;var a=i.interactiveBorder;var s=getBasePlacement(o.placement);var u=o.modifiersData.offset;if(!u)return true;var c="bottom"===s?u.top.y:0;var p="top"===s?u.bottom.y:0;var l="right"===s?u.left.x:0;var d="left"===s?u.right.x:0;var f=t.top-r+c>a;var v=r-t.bottom-p>a;var g=t.left-n+l>a;var m=n-t.right-d>a;return f||v||g||m}))}function updateTransitionEndListener(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function actualContains(e,t){var n=t;while(n){var r;if(e.contains(n))return true;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return false}var p={isTouch:false};var l=0;function onDocumentTouchStart(){if(!p.isTouch){p.isTouch=true;window.performance&&document.addEventListener("mousemove",onDocumentMouseMove)}}function onDocumentMouseMove(){var e=performance.now();if(e-l<20){p.isTouch=false;document.removeEventListener("mousemove",onDocumentMouseMove)}l=e}function onWindowBlur(){var e=document.activeElement;if(isReferenceElement(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function bindGlobalEventListeners(){document.addEventListener("touchstart",onDocumentTouchStart,u);window.addEventListener("blur",onWindowBlur)}var d="undefined"!==typeof window&&"undefined"!==typeof document;var f=!!d&&!!window.msCrypto;function createMemoryLeakWarning(e){var t="destroy"===e?"n already-":" ";return[e+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function clean(e){var t=/[ \t]{2,}/g;var n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function getDevMessage(e){return clean("\n %ctippy.js\n\n %c"+clean(e)+"\n\n %cπ·β This is a development-only message. It will be removed in production.\n ")}function getFormattedMessage(e){return[getDevMessage(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var v;"production"!=="production"&&resetVisitedMessages();function resetVisitedMessages(){v=new Set}function warnWhen(e,t){if(e&&!v.has(t)){var n;v.add(t);(n=console).warn.apply(n,getFormattedMessage(t))}}function errorWhen(e,t){if(e&&!v.has(t)){var n;v.add(t);(n=console).error.apply(n,getFormattedMessage(t))}}function validateTargets(e){var t=!e;var n="[object Object]"===Object.prototype.toString.call(e)&&!e.addEventListener;errorWhen(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" "));errorWhen(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var g={animateFill:false,followCursor:false,inlinePositioning:false,sticky:false};var m={allowHTML:false,animation:"fade",arrow:true,content:"",inertia:false,maxWidth:350,role:"tooltip",theme:"",zIndex:9999};var h=Object.assign({appendTo:c,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:true,ignoreAttributes:false,interactive:false,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function onAfterUpdate(){},onBeforeUpdate:function onBeforeUpdate(){},onCreate:function onCreate(){},onDestroy:function onDestroy(){},onHidden:function onHidden(){},onHide:function onHide(){},onMount:function onMount(){},onShow:function onShow(){},onShown:function onShown(){},onTrigger:function onTrigger(){},onUntrigger:function onUntrigger(){},onClickOutside:function onClickOutside(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:false,touch:true,trigger:"mouseenter focus",triggerTarget:null},g,m);var y=Object.keys(h);var b=function setDefaultProps(e){"production"!=="production"&&validateProps(e,[]);var t=Object.keys(e);t.forEach((function(t){h[t]=e[t]}))};function getExtendedPassedProps(e){var t=e.plugins||[];var n=t.reduce((function(t,n){var r=n.name,o=n.defaultValue;if(r){var i;t[r]=void 0!==e[r]?e[r]:null!=(i=h[r])?i:o}return t}),{});return Object.assign({},e,n)}function getDataAttributeProps(e,t){var n=t?Object.keys(getExtendedPassedProps(Object.assign({},h,{plugins:t}))):y;var r=n.reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{});return r}function evaluateProps(e,t){var n=Object.assign({},t,{content:invokeWithArgsOrReturn(t.content,[e])},t.ignoreAttributes?{}:getDataAttributeProps(e,t.plugins));n.aria=Object.assign({},h.aria,n.aria);n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content};return n}function validateProps(e,t){void 0===e&&(e={});void 0===t&&(t=[]);var n=Object.keys(e);n.forEach((function(e){var n=removeProperties(h,Object.keys(g));var r=!hasOwnProperty(n,e);r&&(r=0===t.filter((function(t){return t.name===e})).length);warnWhen(r,["`"+e+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.","\n\n","All props: https://atomiks.github.io/tippyjs/v6/all-props/\n","Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))}))}var T=function innerHTML(){return"innerHTML"};function dangerouslySetInnerHTML(e,t){e[T()]=t}function createArrowElement(e){var t=div();if(true===e)t.className=a;else{t.className=s;isElement(e)?t.appendChild(e):dangerouslySetInnerHTML(t,e)}return t}function setContent(e,t){if(isElement(t.content)){dangerouslySetInnerHTML(e,"");e.appendChild(t.content)}else"function"!==typeof t.content&&(t.allowHTML?dangerouslySetInnerHTML(e,t.content):e.textContent=t.content)}function getChildren(e){var t=e.firstElementChild;var n=arrayFrom(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(o)})),arrow:n.find((function(e){return e.classList.contains(a)||e.classList.contains(s)})),backdrop:n.find((function(e){return e.classList.contains(i)}))}}function render(e){var t=div();var n=div();n.className=r;n.setAttribute("data-state","hidden");n.setAttribute("tabindex","-1");var i=div();i.className=o;i.setAttribute("data-state","hidden");setContent(i,e.props);t.appendChild(n);n.appendChild(i);onUpdate(e.props,e.props);function onUpdate(n,r){var o=getChildren(t),i=o.box,a=o.content,s=o.arrow;r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme");"string"===typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation");r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia");i.style.maxWidth="number"===typeof r.maxWidth?r.maxWidth+"px":r.maxWidth;r.role?i.setAttribute("role",r.role):i.removeAttribute("role");n.content===r.content&&n.allowHTML===r.allowHTML||setContent(a,e.props);if(r.arrow)if(s){if(n.arrow!==r.arrow){i.removeChild(s);i.appendChild(createArrowElement(r.arrow))}}else i.appendChild(createArrowElement(r.arrow));else s&&i.removeChild(s)}return{popper:t,onUpdate:onUpdate}}render.$$tippy=true;var E=1;var w=[];var C=[];function createTippy(t,n){var r=evaluateProps(t,Object.assign({},h,getExtendedPassedProps(removeUndefinedProps(n))));var o;var i;var a;var s=false;var l=false;var d=false;var v=false;var g;var m;var y;var b=[];var T=debounce(onMouseMove,r.interactiveDebounce);var D;var O=E++;var A=null;var M=unique(r.plugins);var P={isEnabled:true,isVisible:false,isDestroyed:false,isMounted:false,isShown:false};var L={id:O,reference:t,popper:div(),popperInstance:A,props:r,state:P,plugins:M,clearDelayTimeouts:clearDelayTimeouts,setProps:setProps,setContent:setContent,show:show,hide:hide,hideWithInteractivity:hideWithInteractivity,enable:enable,disable:disable,unmount:unmount,destroy:destroy};if(!r.render){"production"!=="production"&&errorWhen(true,"render() function has not been supplied.");return L}var I=r.render(L),k=I.popper,R=I.onUpdate;k.setAttribute("data-tippy-root","");k.id="tippy-"+L.id;L.popper=k;t._tippy=L;k._tippy=L;var x=M.map((function(e){return e.fn(L)}));var S=t.hasAttribute("aria-expanded");addListeners();handleAriaExpandedAttribute();handleStyles();invokeHook("onCreate",[L]);r.showOnCreate&&scheduleShow();k.addEventListener("mouseenter",(function(){L.props.interactive&&L.state.isVisible&&L.clearDelayTimeouts()}));k.addEventListener("mouseleave",(function(){L.props.interactive&&L.props.trigger.indexOf("mouseenter")>=0&&getDocument().addEventListener("mousemove",T)}));return L;function getNormalizedTouchSettings(){var e=L.props.touch;return Array.isArray(e)?e:[e,0]}function getIsCustomTouchBehavior(){return"hold"===getNormalizedTouchSettings()[0]}function getIsDefaultRenderFn(){var e;return!!(null!=(e=L.props.render)&&e.$$tippy)}function getCurrentTarget(){return D||t}function getDocument(){var e=getCurrentTarget().parentNode;return e?getOwnerDocument(e):document}function getDefaultTemplateChildren(){return getChildren(k)}function getDelay(e){return L.state.isMounted&&!L.state.isVisible||p.isTouch||g&&"focus"===g.type?0:getValueAtIndexOrReturn(L.props.delay,e?0:1,h.delay)}function handleStyles(e){void 0===e&&(e=false);k.style.pointerEvents=L.props.interactive&&!e?"":"none";k.style.zIndex=""+L.props.zIndex}function invokeHook(e,t,n){void 0===n&&(n=true);x.forEach((function(n){n[e]&&n[e].apply(n,t)}));if(n){var r;(r=L.props)[e].apply(r,t)}}function handleAriaContentAttribute(){var e=L.props.aria;if(e.content){var n="aria-"+e.content;var r=k.id;var o=normalizeToArray(L.props.triggerTarget||t);o.forEach((function(e){var t=e.getAttribute(n);if(L.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var o=t&&t.replace(r,"").trim();o?e.setAttribute(n,o):e.removeAttribute(n)}}))}}function handleAriaExpandedAttribute(){if(!S&&L.props.aria.expanded){var e=normalizeToArray(L.props.triggerTarget||t);e.forEach((function(e){L.props.interactive?e.setAttribute("aria-expanded",L.state.isVisible&&e===getCurrentTarget()?"true":"false"):e.removeAttribute("aria-expanded")}))}}function cleanupInteractiveMouseListeners(){getDocument().removeEventListener("mousemove",T);w=w.filter((function(e){return e!==T}))}function onDocumentPress(e){if(!p.isTouch||!d&&"mousedown"!==e.type){var n=e.composedPath&&e.composedPath()[0]||e.target;if(!L.props.interactive||!actualContains(k,n)){if(normalizeToArray(L.props.triggerTarget||t).some((function(e){return actualContains(e,n)}))){if(p.isTouch)return;if(L.state.isVisible&&L.props.trigger.indexOf("click")>=0)return}else invokeHook("onClickOutside",[L,e]);if(true===L.props.hideOnClick){L.clearDelayTimeouts();L.hide();l=true;setTimeout((function(){l=false}));L.state.isMounted||removeDocumentPress()}}}}function onTouchMove(){d=true}function onTouchStart(){d=false}function addDocumentPress(){var e=getDocument();e.addEventListener("mousedown",onDocumentPress,true);e.addEventListener("touchend",onDocumentPress,u);e.addEventListener("touchstart",onTouchStart,u);e.addEventListener("touchmove",onTouchMove,u)}function removeDocumentPress(){var e=getDocument();e.removeEventListener("mousedown",onDocumentPress,true);e.removeEventListener("touchend",onDocumentPress,u);e.removeEventListener("touchstart",onTouchStart,u);e.removeEventListener("touchmove",onTouchMove,u)}function onTransitionedOut(e,t){onTransitionEnd(e,(function(){!L.state.isVisible&&k.parentNode&&k.parentNode.contains(k)&&t()}))}function onTransitionedIn(e,t){onTransitionEnd(e,t)}function onTransitionEnd(e,t){var n=getDefaultTemplateChildren().box;function listener(e){if(e.target===n){updateTransitionEndListener(n,"remove",listener);t()}}if(0===e)return t();updateTransitionEndListener(n,"remove",m);updateTransitionEndListener(n,"add",listener);m=listener}function on(e,n,r){void 0===r&&(r=false);var o=normalizeToArray(L.props.triggerTarget||t);o.forEach((function(t){t.addEventListener(e,n,r);b.push({node:t,eventType:e,handler:n,options:r})}))}function addListeners(){if(getIsCustomTouchBehavior()){on("touchstart",onTrigger,{passive:true});on("touchend",onMouseLeave,{passive:true})}splitBySpaces(L.props.trigger).forEach((function(e){if("manual"!==e){on(e,onTrigger);switch(e){case"mouseenter":on("mouseleave",onMouseLeave);break;case"focus":on(f?"focusout":"blur",onBlurOrFocusOut);break;case"focusin":on("focusout",onBlurOrFocusOut);break}}}))}function removeListeners(){b.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,o=e.options;t.removeEventListener(n,r,o)}));b=[]}function onTrigger(e){var t;var n=false;if(L.state.isEnabled&&!isEventListenerStopped(e)&&!l){var r="focus"===(null==(t=g)?void 0:t.type);g=e;D=e.currentTarget;handleAriaExpandedAttribute();!L.state.isVisible&&isMouseEvent(e)&&w.forEach((function(t){return t(e)}));"click"===e.type&&(L.props.trigger.indexOf("mouseenter")<0||s)&&false!==L.props.hideOnClick&&L.state.isVisible?n=true:scheduleShow(e);"click"===e.type&&(s=!n);n&&!r&&scheduleHide(e)}}function onMouseMove(e){var t=e.target;var n=getCurrentTarget().contains(t)||k.contains(t);if("mousemove"!==e.type||!n){var o=getNestedPopperTree().concat(k).map((function(e){var t;var n=e._tippy;var o=null==(t=n.popperInstance)?void 0:t.state;return o?{popperRect:e.getBoundingClientRect(),popperState:o,props:r}:null})).filter(Boolean);if(isCursorOutsideInteractiveBorder(o,e)){cleanupInteractiveMouseListeners();scheduleHide(e)}}}function onMouseLeave(e){var t=isEventListenerStopped(e)||L.props.trigger.indexOf("click")>=0&&s;t||(L.props.interactive?L.hideWithInteractivity(e):scheduleHide(e))}function onBlurOrFocusOut(e){L.props.trigger.indexOf("focusin")<0&&e.target!==getCurrentTarget()||L.props.interactive&&e.relatedTarget&&k.contains(e.relatedTarget)||scheduleHide(e)}function isEventListenerStopped(e){return!!p.isTouch&&getIsCustomTouchBehavior()!==e.type.indexOf("touch")>=0}function createPopperInstance(){destroyPopperInstance();var n=L.props,r=n.popperOptions,o=n.placement,i=n.offset,a=n.getReferenceClientRect,s=n.moveTransition;var u=getIsDefaultRenderFn()?getChildren(k).arrow:null;var c=a?{getBoundingClientRect:a,contextElement:a.contextElement||getCurrentTarget()}:t;var p={name:"$$tippy",enabled:true,phase:"beforeWrite",requires:["computeStyles"],fn:function fn(e){var t=e.state;if(getIsDefaultRenderFn()){var n=getDefaultTemplateChildren(),r=n.box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?r.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?r.setAttribute("data-"+e,""):r.removeAttribute("data-"+e)}));t.attributes.popper={}}}};var l=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},p];getIsDefaultRenderFn()&&u&&l.push({name:"arrow",options:{element:u,padding:3}});l.push.apply(l,(null==r?void 0:r.modifiers)||[]);L.popperInstance=e(c,k,Object.assign({},r,{placement:o,onFirstUpdate:y,modifiers:l}))}function destroyPopperInstance(){if(L.popperInstance){L.popperInstance.destroy();L.popperInstance=null}}function mount(){var e=L.props.appendTo;var t;var n=getCurrentTarget();t=L.props.interactive&&e===c||"parent"===e?n.parentNode:invokeWithArgsOrReturn(e,[n]);t.contains(k)||t.appendChild(k);L.state.isMounted=true;createPopperInstance();"production"!=="production"&&warnWhen(L.props.interactive&&e===h.appendTo&&n.nextElementSibling!==k,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.","\n\n","Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.","\n\n","Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.","\n\n","See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function getNestedPopperTree(){return arrayFrom(k.querySelectorAll("[data-tippy-root]"))}function scheduleShow(e){L.clearDelayTimeouts();e&&invokeHook("onTrigger",[L,e]);addDocumentPress();var t=getDelay(true);var n=getNormalizedTouchSettings(),r=n[0],i=n[1];p.isTouch&&"hold"===r&&i&&(t=i);t?o=setTimeout((function(){L.show()}),t):L.show()}function scheduleHide(e){L.clearDelayTimeouts();invokeHook("onUntrigger",[L,e]);if(L.state.isVisible){if(!(L.props.trigger.indexOf("mouseenter")>=0&&L.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&s)){var t=getDelay(false);t?i=setTimeout((function(){L.state.isVisible&&L.hide()}),t):a=requestAnimationFrame((function(){L.hide()}))}}else removeDocumentPress()}function enable(){L.state.isEnabled=true}function disable(){L.hide();L.state.isEnabled=false}function clearDelayTimeouts(){clearTimeout(o);clearTimeout(i);cancelAnimationFrame(a)}function setProps(e){"production"!=="production"&&warnWhen(L.state.isDestroyed,createMemoryLeakWarning("setProps"));if(!L.state.isDestroyed){invokeHook("onBeforeUpdate",[L,e]);removeListeners();var n=L.props;var r=evaluateProps(t,Object.assign({},n,removeUndefinedProps(e),{ignoreAttributes:true}));L.props=r;addListeners();if(n.interactiveDebounce!==r.interactiveDebounce){cleanupInteractiveMouseListeners();T=debounce(onMouseMove,r.interactiveDebounce)}n.triggerTarget&&!r.triggerTarget?normalizeToArray(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&t.removeAttribute("aria-expanded");handleAriaExpandedAttribute();handleStyles();R&&R(n,r);if(L.popperInstance){createPopperInstance();getNestedPopperTree().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)}))}invokeHook("onAfterUpdate",[L,e])}}function setContent(e){L.setProps({content:e})}function show(){"production"!=="production"&&warnWhen(L.state.isDestroyed,createMemoryLeakWarning("show"));var e=L.state.isVisible;var t=L.state.isDestroyed;var n=!L.state.isEnabled;var r=p.isTouch&&!L.props.touch;var o=getValueAtIndexOrReturn(L.props.duration,0,h.duration);if(!(e||t||n||r)&&!getCurrentTarget().hasAttribute("disabled")){invokeHook("onShow",[L],false);if(false!==L.props.onShow(L)){L.state.isVisible=true;getIsDefaultRenderFn()&&(k.style.visibility="visible");handleStyles();addDocumentPress();L.state.isMounted||(k.style.transition="none");if(getIsDefaultRenderFn()){var i=getDefaultTemplateChildren(),a=i.box,s=i.content;setTransitionDuration([a,s],0)}y=function onFirstUpdate(){var e;if(L.state.isVisible&&!v){v=true;void k.offsetHeight;k.style.transition=L.props.moveTransition;if(getIsDefaultRenderFn()&&L.props.animation){var t=getDefaultTemplateChildren(),n=t.box,r=t.content;setTransitionDuration([n,r],o);setVisibilityState([n,r],"visible")}handleAriaContentAttribute();handleAriaExpandedAttribute();pushIfUnique(C,L);null==(e=L.popperInstance)?void 0:e.forceUpdate();invokeHook("onMount",[L]);L.props.animation&&getIsDefaultRenderFn()&&onTransitionedIn(o,(function(){L.state.isShown=true;invokeHook("onShown",[L])}))}};mount()}}}function hide(){"production"!=="production"&&warnWhen(L.state.isDestroyed,createMemoryLeakWarning("hide"));var e=!L.state.isVisible;var t=L.state.isDestroyed;var n=!L.state.isEnabled;var r=getValueAtIndexOrReturn(L.props.duration,1,h.duration);if(!(e||t||n)){invokeHook("onHide",[L],false);if(false!==L.props.onHide(L)){L.state.isVisible=false;L.state.isShown=false;v=false;s=false;getIsDefaultRenderFn()&&(k.style.visibility="hidden");cleanupInteractiveMouseListeners();removeDocumentPress();handleStyles(true);if(getIsDefaultRenderFn()){var o=getDefaultTemplateChildren(),i=o.box,a=o.content;if(L.props.animation){setTransitionDuration([i,a],r);setVisibilityState([i,a],"hidden")}}handleAriaContentAttribute();handleAriaExpandedAttribute();L.props.animation?getIsDefaultRenderFn()&&onTransitionedOut(r,L.unmount):L.unmount()}}}function hideWithInteractivity(e){"production"!=="production"&&warnWhen(L.state.isDestroyed,createMemoryLeakWarning("hideWithInteractivity"));getDocument().addEventListener("mousemove",T);pushIfUnique(w,T);T(e)}function unmount(){"production"!=="production"&&warnWhen(L.state.isDestroyed,createMemoryLeakWarning("unmount"));L.state.isVisible&&L.hide();if(L.state.isMounted){destroyPopperInstance();getNestedPopperTree().forEach((function(e){e._tippy.unmount()}));k.parentNode&&k.parentNode.removeChild(k);C=C.filter((function(e){return e!==L}));L.state.isMounted=false;invokeHook("onHidden",[L])}}function destroy(){"production"!=="production"&&warnWhen(L.state.isDestroyed,createMemoryLeakWarning("destroy"));if(!L.state.isDestroyed){L.clearDelayTimeouts();L.unmount();removeListeners();delete t._tippy;L.state.isDestroyed=true;invokeHook("onDestroy",[L])}}}function tippy(e,t){void 0===t&&(t={});var n=h.plugins.concat(t.plugins||[]);if("production"!=="production"){validateTargets(e);validateProps(t,n)}bindGlobalEventListeners();var r=Object.assign({},t,{plugins:n});var o=getArrayOfElements(e);if("production"!=="production"){var i=isElement(r.content);var a=o.length>1;warnWhen(i&&a,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.","\n\n","Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.","\n\n","1) content: element.innerHTML\n","2) content: () => element.cloneNode(true)"].join(" "))}var s=o.reduce((function(e,t){var n=t&&createTippy(t,r);n&&e.push(n);return e}),[]);return isElement(e)?s[0]:s}tippy.defaultProps=h;tippy.setDefaultProps=b;tippy.currentInput=p;var D=function hideAll(e){var t=void 0===e?{}:e,n=t.exclude,r=t.duration;C.forEach((function(e){var t=false;n&&(t=isReferenceElement(n)?e.reference===n:e.popper===n.popper);if(!t){var o=e.props.duration;e.setProps({duration:r});e.hide();e.state.isDestroyed||e.setProps({duration:o})}}))};var O=Object.assign({},t,{effect:function effect(e){var t=e.state;var n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper);t.styles=n;t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}});var A=function createSingleton(e,t){var n;void 0===t&&(t={});"production"!=="production"&&errorWhen(!Array.isArray(e),["The first argument passed to createSingleton() must be an array of","tippy instances. The passed value was",String(e)].join(" "));var r=e;var o=[];var i=[];var a;var s=t.overrides;var u=[];var c=false;function setTriggerTargets(){i=r.map((function(e){return normalizeToArray(e.props.triggerTarget||e.reference)})).reduce((function(e,t){return e.concat(t)}),[])}function setReferences(){o=r.map((function(e){return e.reference}))}function enableInstances(e){r.forEach((function(t){e?t.enable():t.disable()}))}function interceptSetProps(e){return r.map((function(t){var n=t.setProps;t.setProps=function(r){n(r);t.reference===a&&e.setProps(r)};return function(){t.setProps=n}}))}function prepareInstance(e,t){var n=i.indexOf(t);if(t!==a){a=t;var u=(s||[]).concat("content").reduce((function(e,t){e[t]=r[n].props[t];return e}),{});e.setProps(Object.assign({},u,{getReferenceClientRect:"function"===typeof u.getReferenceClientRect?u.getReferenceClientRect:function(){var e;return null==(e=o[n])?void 0:e.getBoundingClientRect()}}))}}enableInstances(false);setReferences();setTriggerTargets();var p={fn:function fn(){return{onDestroy:function onDestroy(){enableInstances(true)},onHidden:function onHidden(){a=null},onClickOutside:function onClickOutside(e){if(e.props.showOnCreate&&!c){c=true;a=null}},onShow:function onShow(e){if(e.props.showOnCreate&&!c){c=true;prepareInstance(e,o[0])}},onTrigger:function onTrigger(e,t){prepareInstance(e,t.currentTarget)}}}};var l=tippy(div(),Object.assign({},removeProperties(t,["overrides"]),{plugins:[p].concat(t.plugins||[]),triggerTarget:i,popperOptions:Object.assign({},t.popperOptions,{modifiers:[].concat((null==(n=t.popperOptions)?void 0:n.modifiers)||[],[O])})}));var d=l.show;l.show=function(e){d();if(!a&&null==e)return prepareInstance(l,o[0]);if(!a||null!=e){if("number"===typeof e)return o[e]&&prepareInstance(l,o[e]);if(r.indexOf(e)>=0){var t=e.reference;return prepareInstance(l,t)}return o.indexOf(e)>=0?prepareInstance(l,e):void 0}};l.showNext=function(){var e=o[0];if(!a)return l.show(0);var t=o.indexOf(a);l.show(o[t+1]||e)};l.showPrevious=function(){var e=o[o.length-1];if(!a)return l.show(e);var t=o.indexOf(a);var n=o[t-1]||e;l.show(n)};var f=l.setProps;l.setProps=function(e){s=e.overrides||s;f(e)};l.setInstances=function(e){enableInstances(true);u.forEach((function(e){return e()}));r=e;enableInstances(false);setReferences();setTriggerTargets();u=interceptSetProps(l);l.setProps({triggerTarget:i})};u=interceptSetProps(l);return l};var M={mouseover:"mouseenter",focusin:"focus",click:"click"};function delegate(e,t){"production"!=="production"&&errorWhen(!(t&&t.target),["You must specity a `target` prop indicating a CSS selector string matching","the target elements that should receive a tippy."].join(" "));var n=[];var r=[];var o=false;var i=t.target;var a=removeProperties(t,["target"]);var s=Object.assign({},a,{trigger:"manual",touch:false});var c=Object.assign({touch:h.touch},a,{showOnCreate:true});var p=tippy(e,s);var l=normalizeToArray(p);function onTrigger(e){if(e.target&&!o){var n=e.target.closest(i);if(n){var a=n.getAttribute("data-tippy-trigger")||t.trigger||h.trigger;if(!n._tippy&&("touchstart"!==e.type||"boolean"!==typeof c.touch)&&!("touchstart"!==e.type&&a.indexOf(M[e.type])<0)){var s=tippy(n,c);s&&(r=r.concat(s))}}}}function on(e,t,r,o){void 0===o&&(o=false);e.addEventListener(t,r,o);n.push({node:e,eventType:t,handler:r,options:o})}function addEventListeners(e){var t=e.reference;on(t,"touchstart",onTrigger,u);on(t,"mouseover",onTrigger);on(t,"focusin",onTrigger);on(t,"click",onTrigger)}function removeEventListeners(){n.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,o=e.options;t.removeEventListener(n,r,o)}));n=[]}function applyMutations(e){var t=e.destroy;var n=e.enable;var i=e.disable;e.destroy=function(e){void 0===e&&(e=true);e&&r.forEach((function(e){e.destroy()}));r=[];removeEventListeners();t()};e.enable=function(){n();r.forEach((function(e){return e.enable()}));o=false};e.disable=function(){i();r.forEach((function(e){return e.disable()}));o=true};addEventListeners(e)}l.forEach(applyMutations);return p}var P={name:"animateFill",defaultValue:false,fn:function fn(e){var t;if(!(null!=(t=e.props.render)&&t.$$tippy)){"production"!=="production"&&errorWhen(e.props.animateFill,"The `animateFill` plugin requires the default render function.");return{}}var n=getChildren(e.popper),r=n.box,o=n.content;var i=e.props.animateFill?createBackdropElement():null;return{onCreate:function onCreate(){if(i){r.insertBefore(i,r.firstElementChild);r.setAttribute("data-animatefill","");r.style.overflow="hidden";e.setProps({arrow:false,animation:"shift-away"})}},onMount:function onMount(){if(i){var e=r.style.transitionDuration;var t=Number(e.replace("ms",""));o.style.transitionDelay=Math.round(t/10)+"ms";i.style.transitionDuration=e;setVisibilityState([i],"visible")}},onShow:function onShow(){i&&(i.style.transitionDuration="0ms")},onHide:function onHide(){i&&setVisibilityState([i],"hidden")}}}};function createBackdropElement(){var e=div();e.className=i;setVisibilityState([e],"hidden");return e}var L={clientX:0,clientY:0};var I=[];function storeMouseCoords(e){var t=e.clientX,n=e.clientY;L={clientX:t,clientY:n}}function addMouseCoordsListener(e){e.addEventListener("mousemove",storeMouseCoords)}function removeMouseCoordsListener(e){e.removeEventListener("mousemove",storeMouseCoords)}var k={name:"followCursor",defaultValue:false,fn:function fn(e){var t=e.reference;var n=getOwnerDocument(e.props.triggerTarget||t);var r=false;var o=false;var i=true;var a=e.props;function getIsInitialBehavior(){return"initial"===e.props.followCursor&&e.state.isVisible}function addListener(){n.addEventListener("mousemove",onMouseMove)}function removeListener(){n.removeEventListener("mousemove",onMouseMove)}function unsetGetReferenceClientRect(){r=true;e.setProps({getReferenceClientRect:null});r=false}function onMouseMove(n){var r=!n.target||t.contains(n.target);var o=e.props.followCursor;var i=n.clientX,a=n.clientY;var s=t.getBoundingClientRect();var u=i-s.left;var c=a-s.top;!r&&e.props.interactive||e.setProps({getReferenceClientRect:function getReferenceClientRect(){var e=t.getBoundingClientRect();var n=i;var r=a;if("initial"===o){n=e.left+u;r=e.top+c}var s="horizontal"===o?e.top:r;var p="vertical"===o?e.right:n;var l="horizontal"===o?e.bottom:r;var d="vertical"===o?e.left:n;return{width:p-d,height:l-s,top:s,right:p,bottom:l,left:d}}})}function create(){if(e.props.followCursor){I.push({instance:e,doc:n});addMouseCoordsListener(n)}}function destroy(){I=I.filter((function(t){return t.instance!==e}));0===I.filter((function(e){return e.doc===n})).length&&removeMouseCoordsListener(n)}return{onCreate:create,onDestroy:destroy,onBeforeUpdate:function onBeforeUpdate(){a=e.props},onAfterUpdate:function onAfterUpdate(t,n){var i=n.followCursor;if(!r&&void 0!==i&&a.followCursor!==i){destroy();if(i){create();!e.state.isMounted||o||getIsInitialBehavior()||addListener()}else{removeListener();unsetGetReferenceClientRect()}}},onMount:function onMount(){if(e.props.followCursor&&!o){if(i){onMouseMove(L);i=false}getIsInitialBehavior()||addListener()}},onTrigger:function onTrigger(e,t){isMouseEvent(t)&&(L={clientX:t.clientX,clientY:t.clientY});o="focus"===t.type},onHidden:function onHidden(){if(e.props.followCursor){unsetGetReferenceClientRect();removeListener();i=true}}}}};function getProps(e,t){var n;return{popperOptions:Object.assign({},e.popperOptions,{modifiers:[].concat(((null==(n=e.popperOptions)?void 0:n.modifiers)||[]).filter((function(e){var n=e.name;return n!==t.name})),[t])})}}var R={name:"inlinePositioning",defaultValue:false,fn:function fn(e){var t=e.reference;function isEnabled(){return!!e.props.inlinePositioning}var n;var r=-1;var o=false;var i=[];var a={name:"tippyInlinePositioning",enabled:true,phase:"afterWrite",fn:function fn(t){var r=t.state;if(isEnabled()){-1!==i.indexOf(r.placement)&&(i=[]);if(n!==r.placement&&-1===i.indexOf(r.placement)){i.push(r.placement);e.setProps({getReferenceClientRect:function getReferenceClientRect(){return _getReferenceClientRect(r.placement)}})}n=r.placement}}};function _getReferenceClientRect(e){return getInlineBoundingClientRect(getBasePlacement(e),t.getBoundingClientRect(),arrayFrom(t.getClientRects()),r)}function setInternalProps(t){o=true;e.setProps(t);o=false}function addModifier(){o||setInternalProps(getProps(e.props,a))}return{onCreate:addModifier,onAfterUpdate:addModifier,onTrigger:function onTrigger(t,n){if(isMouseEvent(n)){var o=arrayFrom(e.reference.getClientRects());var i=o.find((function(e){return e.left-2<=n.clientX&&e.right+2>=n.clientX&&e.top-2<=n.clientY&&e.bottom+2>=n.clientY}));var a=o.indexOf(i);r=a>-1?a:r}},onHidden:function onHidden(){r=-1}}}};function getInlineBoundingClientRect(e,t,n,r){if(n.length<2||null===e)return t;if(2===n.length&&r>=0&&n[0].left>n[1].right)return n[r]||t;switch(e){case"top":case"bottom":var o=n[0];var i=n[n.length-1];var a="top"===e;var s=o.top;var u=i.bottom;var c=a?o.left:i.left;var p=a?o.right:i.right;var l=p-c;var d=u-s;return{top:s,bottom:u,left:c,right:p,width:l,height:d};case"left":case"right":var f=Math.min.apply(Math,n.map((function(e){return e.left})));var v=Math.max.apply(Math,n.map((function(e){return e.right})));var g=n.filter((function(t){return"left"===e?t.left===f:t.right===v}));var m=g[0].top;var h=g[g.length-1].bottom;var y=f;var b=v;var T=b-y;var E=h-m;return{top:m,bottom:h,left:y,right:b,width:T,height:E};default:return t}}var x={name:"sticky",defaultValue:false,fn:function fn(e){var t=e.reference,n=e.popper;function getReference(){return e.popperInstance?e.popperInstance.state.elements.reference:t}function shouldCheck(t){return true===e.props.sticky||e.props.sticky===t}var r=null;var o=null;function updatePosition(){var t=shouldCheck("reference")?getReference().getBoundingClientRect():null;var i=shouldCheck("popper")?n.getBoundingClientRect():null;(t&&areRectsDifferent(r,t)||i&&areRectsDifferent(o,i))&&e.popperInstance&&e.popperInstance.update();r=t;o=i;e.state.isMounted&&requestAnimationFrame(updatePosition)}return{onMount:function onMount(){e.props.sticky&&updatePosition()}}}};function areRectsDifferent(e,t){return!e||!t||(e.top!==t.top||e.right!==t.right||e.bottom!==t.bottom||e.left!==t.left)}tippy.setDefaultProps({render:render});export{P as animateFill,A as createSingleton,tippy as default,delegate,k as followCursor,D as hideAll,R as inlinePositioning,n as roundArrow,x as sticky};
|
2
|
+
|