You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
5.5 KiB
10 lines
5.5 KiB
/*!
|
|
* @antv/g-plugin-dom-interaction
|
|
* @description A G plugin
|
|
* @version 2.1.27
|
|
* @date 7/30/2025, 1:35:38 PM
|
|
* @author AntVis
|
|
* @docs https://g.antv.antgroup.com/
|
|
*/
|
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@antv/g-lite")):"function"==typeof define&&define.amd?define(["exports","@antv/g-lite"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).G=e.G||{},e.G.DOMInteraction={}),e.window.G)}(this,function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function r(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}function i(e,t){for(var n=0;t.length>n;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,r(o.key),o)}}function c(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(s=function(){return!!e})()}function a(e,t){if(t&&("object"==o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}var v=function(){function e(){n(this,e)}return c(e,[{key:"apply",value:function(t,n){var o=this,r=t.renderingService,i=t.renderingContext,c=t.config;this.context=t;var u=i.root.ownerDocument.defaultView,s=function(e){r.hooks.pointerMove.call(e)},a=function(e){r.hooks.pointerUp.call(e)},l=function(e){r.hooks.pointerDown.call(e)},v=function(e){r.hooks.pointerOver.call(e)},f=function(e){r.hooks.pointerOut.call(e)},p=function(e){r.hooks.pointerCancel.call(e)},d=function(e){r.hooks.pointerWheel.call(e)},m=function(e){r.hooks.click.call(e)};r.hooks.init.tap(e.tag,function(){var e=o.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(e.style.msContentZooming="none",e.style.msTouchAction="none"):u.supportsPointerEvents&&(e.style.touchAction="none"),u.supportsPointerEvents?function(e){n.globalThis.document.addEventListener("pointermove",s,!0),e.addEventListener("pointerdown",l,!0),e.addEventListener("pointerleave",f,!0),e.addEventListener("pointerover",v,!0),n.globalThis.addEventListener("pointerup",a,!0),n.globalThis.addEventListener("pointercancel",p,!0)}(e):function(e){n.globalThis.document.addEventListener("mousemove",s,!0),e.addEventListener("mousedown",l,!0),e.addEventListener("mouseout",f,!0),e.addEventListener("mouseover",v,!0),n.globalThis.addEventListener("mouseup",a,!0)}(e),u.supportsTouchEvents&&function(e){e.addEventListener("touchstart",l,!0),e.addEventListener("touchend",a,!0),e.addEventListener("touchmove",s,!0),e.addEventListener("touchcancel",p,!0)}(e),c.useNativeClickEvent&&e.addEventListener("click",m,!0),e.addEventListener("wheel",d,{passive:!0,capture:!0})}),r.hooks.destroy.tap(e.tag,function(){var e=o.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(e.style.msContentZooming="",e.style.msTouchAction=""):u.supportsPointerEvents&&(e.style.touchAction=""),u.supportsPointerEvents?function(e){n.globalThis.document.removeEventListener("pointermove",s,!0),e.removeEventListener("pointerdown",l,!0),e.removeEventListener("pointerleave",f,!0),e.removeEventListener("pointerover",v,!0),n.globalThis.removeEventListener("pointerup",a,!0),n.globalThis.removeEventListener("pointercancel",p,!0)}(e):function(e){n.globalThis.document.removeEventListener("mousemove",s,!0),e.removeEventListener("mousedown",l,!0),e.removeEventListener("mouseout",f,!0),e.removeEventListener("mouseover",v,!0),n.globalThis.removeEventListener("mouseup",a,!0)}(e),u.supportsTouchEvents&&function(e){e.removeEventListener("touchstart",l,!0),e.removeEventListener("touchend",a,!0),e.removeEventListener("touchmove",s,!0),e.removeEventListener("touchcancel",p,!0)}(e),c.useNativeClickEvent&&e.removeEventListener("click",m,!0),e.removeEventListener("wheel",d,!0)})}}])}();v.tag="DOMInteraction";var f=function(e){function t(){var e,o,r,i;n(this,t);for(var c=arguments.length,l=Array(c),v=0;c>v;v++)l[v]=arguments[v];return o=this,r=t,i=[].concat(l),r=u(r),(e=a(o,s()?Reflect.construct(r,i||[],u(o).constructor):r.apply(o,i))).name="dom-interaction",e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(t,e),c(t,[{key:"init",value:function(){this.addRenderingPlugin(new v)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(t.AbstractRendererPlugin);e.Plugin=f});
|
|
//# sourceMappingURL=index.umd.min.js.map
|
|
|