PageSourceSearch

https://static.touchsurgery.com/static/js/react-onclickoutside.DVZcPtXS.js

js touchsurgery.com collected 2026-09-24 09:23:55 UTC 4,156 bytes, 2 lines download raw bytes

1import{r as m}from"./react.B-3k8uP_.js";import{r as k}from"./react-dom.BN6VrI28.js";function y(e,r){e.prototype=Object.create(r.prototype),e.prototype.constructor=e,v(e,r)}function v(e,r){return v=Object.setPrototypeOf||function(s,u){return s.__proto__=u,s},v(e,r)}function E(e,r){if(e==null)return{};var o={},s=Object.keys(e),u,c;for(c=0;c<s.length;c++)u=s[c],!(r.indexOf(u)>=0)&&(o[u]=e[u]);return o}function _(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function C(e,r,o){return e===r?!0:e.correspondingElement?e.correspondingElement.classList.contains(o):e.classList.contains(o)}function b(e,r,o){if(e===r)return!0;for(;e.parentNode||e.host;){if(e.parentNode&&C(e,r,o))return!0;e=e.parentNode||e.host}return e}function P(e){return document.documentElement.clientWidth<=e.clientX||document.documentElement.clientHeight<=e.clientY}var w=function(){if(!(typeof window>"u"||typeof window.addEventListener!="function")){var r=!1,o=Object.defineProperty({},"passive",{get:function(){r=!0}}),s=function(){};return window.addEventListener("testPassiveEventSupport",s,o),window.removeEventListener("testPassiveEventSupport",s,o),r}};function N(e){return e===void 0&&(e=0),function(){return++e}}var I=N(),O,l={},h={},R=["touchstart","touchmove"],S="ignore-react-onclickoutside";function g(e,r){var o=null,s=R.indexOf(r)!==-1;return s&&O&&(o={passive:!e.props.preventDefault}),o}function x(e,r){var o,s,u=e.displayName||e.name||"Component";return s=o=function(c){y(p,c);function p(a){var t;return t=c.call(this,a)||this,t.__outsideClickHandler=function(n){if(typeof t.__clickOutsideHandlerProp=="function"){t.__clickOutsideHandlerProp(n);return}var i=t.getInstance();if(typeof i.props.handleClickOutside=="function"){i.props.handleClickOutside(n);return}if(typeof i.handleClickOutside=="function"){i.handleClickOutside(n);return}throw new Error("WrappedComponent: "+u+" lacks a handleClickOutside(event) function for processing outside click events.")},t.__getComponentNode=function(){var n=t.getInstance();return typeof n.setClickOutsideRef=="function"?n.setClickOutsideRef():k.findDOMNode(n)},t.enableOnClickOutside=function(){if(!(typeof document>"u"||h[t._uid])){typeof O>"u"&&(O=w()),h[t._uid]=!0;var n=t.props.eventTypes;n.forEach||(n=[n]),l[t._uid]=function(i){if(t.componentNode!==null&&(t.props.preventDefault&&i.preventDefault(),t.props.stopPropagation&&i.stopPropagation(),!(t.props.excludeScrollbar&&P(i)))){var f=i.composed&&i.composedPath&&i.composedPath().shift()||i.target;b(f,t.componentNode,t.props.outsideClickIgnoreClass)===document&&t.__outsideClickHandler(i)}},n.forEach(function(i){document.addEventListener(i,l[t._uid],g(_(t),i))})}},t.disableOnClickOutside=function(){delete h[t._uid];var n=l[t._uid];if(n&&typeof document<"u"){var i=t.props.eventTypes;
1i.forEach||(i=[i]),i.forEach(function(f){return document.removeEventListener(f,n,g(_(t),f))}),delete l[t._uid]}},t.getRef=function(n){return t.instanceRef=n},t._uid=I(),t}var d=p.prototype;return d.getInstance=function(){if(e.prototype&&!e.prototype.isReactComponent)return this;var t=this.instanceRef;return t.getInstance?t.getInstance():t},d.componentDidMount=function(){typeof document>"u"||!document.createElement||(this.getInstance(),this.componentNode=this.__getComponentNode(),!this.props.disableOnClickOutside&&this.enableOnClickOutside())},d.componentDidUpdate=function(){this.componentNode=this.__getComponentNode()},d.componentWillUnmount=function(){this.disableOnClickOutside()},d.render=function(){var t=this.props;t.excludeScrollbar;var n=E(t,["excludeScrollbar"]);return e.prototype&&e.prototype.isReactComponent?n.ref=this.getRef:n.wrappedRef=this.getRef,n.disableOnClickOutside=this.disableOnClickOutside,n.enableOnClickOutside=this.enableOnClickOutside,m.createElement(e,n)},p}(m.Component),o.displayName="OnClickOutside("+u+")",o.defaultProps={eventTypes:["mousedown","touchstart"],excludeScrollbar:!1,outsideClickIgnoreClass:S,preventDefault:!1,stopPropagation:!1},o.getClass=function(){return e.getClass?e.getClass():e},s}export{x as o};
2//# sourceMappingURL=react-onclickoutside.DVZcPtXS.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.