2 lines
16 KiB
JavaScript
2 lines
16 KiB
JavaScript
|
import e,{Component as t}from"react";import{UniqueComponentId as i,DomHandler as n,ZIndexUtils as o,classNames as s,ObjectUtils as r}from"primereact/utils";import{CSSTransition as a}from"primereact/csstransition";import{Ripple as l}from"primereact/ripple";import{Portal as d}from"primereact/portal";import c from"primereact/api";function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function u(e){if(Array.isArray(e))return p(e)}function m(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function h(e,t){if(e){if("string"==typeof e)return p(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?p(e,t):void 0}}function g(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(e,t){return v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},v(e,t)}function E(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&&v(e,t)}function k(e){return k="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},k(e)}function z(e,t){if(t&&("object"===k(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 x(e){return x=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},x(e)}function D(){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 w,S,L,R=function(p){E(C,t);var v,k,w,S,L,R=(v=C,k=D(),function(){var e,t=x(v);if(k){var i=x(this).constructor;e=Reflect.construct(t,arguments,i)}else e=t.apply(this,arguments);return z(this,e)});function C(t){var n;return f(this,C),(n=R.call(this,t)).state={id:t.id,maskVisible:!1,visible:!1},n.props.onMaximize||(n.state.maximized=t.maximized),n.onClose=n.onClose.bind(y(n)),n.toggleMaximize=n.toggleMaximize.bind(y(n)),n.onDragStart=n.onDragStart.bind(y(n)),n.onResizeStart=n.onResizeStart.bind(y(n)),n.onMaskClick=n.onMaskClick.bind(y(n)),n.onEnter=n.onEnter.bind(y(n)),n.onEntered=n.onEntered.bind(y(n)),n.onExiting=n.onExiting.bind(y(n)),n.onExited=n.onExited.bind(y(n)),n.attributeSelector=i(),n.dialogRef=e.createRef(),n}return w=C,(S=[{key:"onClose",value:function(e){this.props.onHide(),e.preventDefault()}},{key:"focus",value:function(){var e=document.activeElement;!(e&&this.dialogRef&&this.dialogRef.current.contains(e))&&this.props.closable&&this.props.showHeader&&this.closeElement.focus()}},{key:"onMaskClick",value:function(e){this.props.dismissableMask&&this.props.modal&&this.mask===e.target&&this.onClose(e),this.props.onMaskClick&&this.props.onMaskClick(e)}},{key:"toggleMaximize",value:function(e){var t=!this.maximized;this.props.onMaximize?this.props.onMaximize({originalEvent:e,maximized:t}):this.setState({maximized:t},this.changeScrollOnMaximizable),e.preventDefault()}},{key:"onDragStart",value:function(e){n.hasClass(e.target,"p-dialog-header-icon")||n.hasClass(e.ta
|