django-vue3-admin-web/node_modules/@interactjs/auto-start/dragAxis.prod.js
2025-10-20 21:21:14 +08:00

5 lines
1.3 KiB
JavaScript

/* interact.js 1.10.27 | https://raw.github.com/taye/interact.js/main/LICENSE */
import{parentNode}from"../utils/domUtils.prod.js";import is from"../utils/is.prod.js";import autoStart from"./base.prod.js";import"../utils/extend.prod.js";import"../utils/misc.prod.js";import"./InteractableMethods.prod.js";function beforeStart(t,r){let{interaction:e,eventTarget:a,dx:o,dy:i}=t;if("drag"!==e.prepared.name)return;const n=Math.abs(o),s=Math.abs(i),d=e.interactable.options.drag,c=d.startAxis,p=n>s?"x":n<s?"y":"xy";if(e.prepared.axis="start"===d.lockAxis?p[0]:d.lockAxis,"xy"!==p&&"xy"!==c&&c!==p){e.prepared.name=null;let t=a;const o=function(o){if(o===e.interactable)return;const i=e.interactable.options.drag;if(!i.manualStart&&o.testIgnoreAllow(i,t,a)){const i=o.getAction(e.downPointer,e.downEvent,e,t);if(i&&"drag"===i.name&&checkStartAxis(p,o)&&autoStart.validateAction(i,o,t,a,r))return o}};for(;is.element(t);){const a=r.interactables.forEachMatch(t,o);if(a){e.prepared.name="drag",e.interactable=a,e.element=t;break}t=parentNode(t)}}}function checkStartAxis(t,r){if(!r)return!1;const e=r.options.drag.startAxis;return"xy"===t||"xy"===e||e===t}var dragAxis={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":beforeStart}};export{dragAxis as default};
//# sourceMappingURL=dragAxis.prod.js.map