katoikia-app/web-ui/web-react/node_modules/primereact/confirmdialog/confirmdialog.min.js

2 lines
6.1 KiB
JavaScript

this.primereact=this.primereact||{},this.primereact.confirmdialog=function(e,t,r,n,o,i,c,a){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=l(t),p=l(r);function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function m(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&&h(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 v(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 d(e)}function j(e){return j=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},j(e)}function O(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function g(){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 w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function P(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach((function(t){O(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var E=function(e){m(O,e);var t,r,l,p,h,y=(t=O,r=g(),function(){var e,n=j(t);if(r){var o=j(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return v(this,e)});function O(e){var t;return f(this,O),(t=y.call(this,e)).state={visible:e.visible},t.reject=t.reject.bind(d(t)),t.accept=t.accept.bind(d(t)),t.hide=t.hide.bind(d(t)),t}return l=O,(p=[{key:"acceptLabel",value:function(){return this.props.acceptLabel||c.localeOption("accept")}},{key:"rejectLabel",value:function(){return this.props.rejectLabel||c.localeOption("reject")}},{key:"accept",value:function(){this.props.accept&&this.props.accept(),this.hide("accept")}},{key:"reject",value:function(){this.props.reject&&this.props.reject(),this.hide("reject")}},{key:"show",value:function(){this.setState({visible:!0})}},{key:"hide",value:function(e){var t=this;this.setState({visible:!1},(function(){t.props.onHide&&t.props.onHide(e)}))}},{key:"componentDidUpdate",value:function(e){e.visible!==this.props.visible&&this.setState({visible:this.props.visible})}},{key:"renderFooter",value:function(){var e=n.classNames("p-confirm-dialog-accept",this.props.acceptClassName),t=n.classNames("p-confirm-dialog-reject",{"p-button-text":!this.props.rejectClassName},this.props.rejectClassName),r=s.default.createElement(s.default.Fragment,null,s.default.createElement(i.Button,{label:this.rejectLabel(),icon:this.props.rejectIcon,className:t,onClick:this.reject}),s.default.createElement(i.Button,{label:this.acceptLabel(),icon:this.props.acceptIcon,className:e,onClick:this.accept,autoFocus:!0}));if(this.props.footer){var o={accept:this.accept,reject:this.reject,acceptClassName:e,rejectClassName:t,acceptLabel:this.acceptLabel(),rejectLabel:this.rejectLabel(),element:r,props:this.props};return n.ObjectUtils.getJSXElement(this.props.footer,o)}return r}},{key:"renderElement",value:function(){var e=n.classNames("p-confirm-dialog",this.props.className),t=n.ObjectUtils.findDiffKeys(this.props,O.defaultProps),r=n.ObjectUtils.getJSXElement(this.props.message,this.props),i=this.renderFooter();return s.default.createElement(o.Dialog,u({visible:this.state.visible},t,{className:e,footer:i,onHide:this.hide,breakpoints:this.props.breakpoints}),n.IconUtils.getJSXIcon(this.props.icon,{className:"p-confirm-dialog-icon"},{props:this.props}),s.default.createElement("span",{className:"p-confirm-dialog-message"},r))}},{key:"render",value:function(){var e=this.renderElement();return s.default.createElement(a.Portal,{element:e,appendTo:this.props.appendTo})}}])&&b(l.prototype,p),h&&b(l,h),Object.defineProperty(l,"prototype",{writable:!1}),O}(t.Component);return O(E,"defaultProps",{visible:!1,message:null,rejectLabel:null,acceptLabel:null,icon:null,rejectIcon:null,acceptIcon:null,rejectClassName:null,acceptClassName:null,className:null,appendTo:null,footer:null,breakpoints:null,onHide:null,accept:null,reject:null}),e.ConfirmDialog=E,e.confirmDialog=function(e){var t=e.appendTo||document.body,r=document.createDocumentFragment();n.DomHandler.appendChild(r,t),e=P(P({},e),{visible:void 0===e.visible||e.visible});var o=s.default.createElement(E,e);p.default.render(o,r);var i=function(t){e=P(P({},e),t),p.default.render(s.default.cloneElement(o,e),r)};return{_destroy:function(){p.default.unmountComponentAtNode(r)},show:function(){i({visible:!0,onHide:function(){i({visible:!1})}})},hide:function(){i({visible:!1})},update:function(e){i(e)}}},Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,ReactDOM,primereact.utils,primereact.dialog,primereact.button,primereact.api,primereact.portal);