2 lines
9.6 KiB
JavaScript
2 lines
9.6 KiB
JavaScript
|
import e,{Component as t}from"react";import n from"react-dom";import{DomHandler as i,ConnectedOverlayScrollHandler as r,ZIndexUtils as o,ObjectUtils as s,IconUtils as c,classNames as l}from"primereact/utils";import{Button as a}from"primereact/button";import{CSSTransition as p}from"primereact/csstransition";import u,{localeOption as f}from"primereact/api";import{OverlayService as h}from"primereact/overlayservice";import{Portal as d}from"primereact/portal";function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(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 y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e,t){return b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},b(e,t)}function k(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&&b(e,t)}function E(e){return E="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},E(e)}function L(e,t){if(t&&("object"===E(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return y(e)}function j(e){return j=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},j(e)}function C(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O(){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}}function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){C(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function w(t){var r=t.appendTo||document.body,o=document.createDocumentFragment();i.appendChild(o,r),t=R(R({},t),{visible:void 0===t.visible||t.visible});var s=e.createElement(P,t);n.render(s,o);var c=function(i){t=R(R({},t),i),n.render(e.cloneElement(s,t),o)};return{_destroy:function(){n.unmountComponentAtNode(o)},show:function(){c({visible:!0,onHide:function(){c({visible:!1})}})},hide:function(){c({visible:!1})},update:function(e){c(e)}}}var P=function(n){k(P,t);var b,E,C,g,R,w=(b=P,E=O(),function(){var e,t=j(b);if(E){var n=j(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return L(this,e)});function P(t){var n;return v(this,P),(n=w.call(this,t)).state={visible:!1},n.reject=n.reject.bind(y(n)),n.accept=n.accept.bind(y(n)),n.hide=n.hide.bind(y(n)),n.onCloseClick=n.onCloseClick.bind(y(n)),n.onPanelClick=n.onPanelClick.bind(y(n)),n.onEnter=n.onEnter.bind(y(n)),n.onEntered=n.onEntered.bind(y(n)),n.onExit=n.onExit.bind(y(n)),n.onExited=n.onExited.bind(y(n)),n.overlayRef=e.createRef(),n.acceptBtnRef=e.createRef(),n}return C=P,(g=[{key:"acceptLabel",value:function(){return this.props.acceptLabel||f("accept")}},{key:"rejectLabel",value:function(){return this.props.rejectLabel||f("reject")}},{key:"bindDocumentClickListener",value:function(){var e=this;!this.documentClickListener&&this.props.dismissable&&(this.documentClickListener=function(t){
|