2 lines
8.4 KiB
JavaScript
2 lines
8.4 KiB
JavaScript
|
this.primereact=this.primereact||{},this.primereact.overlaypanel=function(e,t,n,i,r,o,l,s){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=a(t),u=a(s);function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e,t){return p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},p(e,t)}function v(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&&p(e,t)}function y(e){return y="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},y(e)}function m(e,t){if(t&&("object"===y(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return h(e)}function b(e){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},b(e)}function k(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var C,E,L,g=function(e){v(E,e);var t,s,a,p,y,C=(t=E,s=k(),function(){var e,n=b(t);if(s){var i=b(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return m(this,e)});function E(e){var t;return f(this,E),(t=C.call(this,e)).state={visible:!1},t.onCloseClick=t.onCloseClick.bind(h(t)),t.onPanelClick=t.onPanelClick.bind(h(t)),t.onEnter=t.onEnter.bind(h(t)),t.onEntered=t.onEntered.bind(h(t)),t.onExit=t.onExit.bind(h(t)),t.onExited=t.onExited.bind(h(t)),t.onContentClick=t.onContentClick.bind(h(t)),t.attributeSelector=n.UniqueComponentId(),t.overlayRef=c.default.createRef(),t}return a=E,(p=[{key:"bindDocumentClickListener",value:function(){var e=this;!this.documentClickListener&&this.props.dismissable&&(this.documentClickListener=function(t){!e.isPanelClicked&&e.isOutsideClicked(t.target)&&e.hide(),e.isPanelClicked=!1},document.addEventListener("click",this.documentClickListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"bindScrollListener",value:function(){var e=this;this.scrollHandler||(this.scrollHandler=new n.ConnectedOverlayScrollHandler(this.target,(function(){e.state.visible&&e.hide()}))),this.scrollHandler.bindScrollListener()}},{key:"unbindScrollListener",value:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()}},{key:"bindResizeListener",value:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.state.visible&&!n.DomHandler.isTouchDevice()&&e.hide()},window.addEventListener("resize",this.resizeListener))}},{key:"unbindResizeListener",value:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)}},{key:"isOutsideClicked",value:function(e){return this.overlayRef&&this.overlayRef.current&&!(this.overlayRef.current.isSameNode(e)||this.overlayRef.current.contains(e))}},{key:"hasTargetChanged",value:function(e,t){return null!=this.target&&this.target!==(t||e.currentTarget||e.target)}},{key:"onCloseClick",value:function(e){this.hide(),e.preventDefault()}},{key:"onPanelClick",value:function(e){this.isPanelClicked=!0,o.OverlayService.emit("overlay-click",{originalEvent:e,target:this.target})}},{key:"onContentClick",value:function(){this.i
|