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

2 lines
7.2 KiB
JavaScript
Raw Normal View History

2022-07-06 04:15:11 +00:00
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/csstransition"),n=require("primereact/utils"),i=require("primereact/portal"),o=require("primereact/api");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=a(e),l=a(o);function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(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 u(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 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&&p(e,t)}function f(e){return f="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},f(e)}function d(e,t){if(t&&("object"===f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return u(e)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function y(){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 v,b,k,E=function(o){m(E,e.Component);var a,p,f,v,b,k=(a=E,p=y(),function(){var e,t=h(a);if(p){var n=h(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return d(this,e)});function E(e){var t;return s(this,E),(t=k.call(this,e)).state={maskVisible:!1,previewVisible:!1,rotate:0,scale:1},t.onImageClick=t.onImageClick.bind(u(t)),t.onMaskClick=t.onMaskClick.bind(u(t)),t.onDownload=t.onDownload.bind(u(t)),t.rotateRight=t.rotateRight.bind(u(t)),t.rotateLeft=t.rotateLeft.bind(u(t)),t.zoomIn=t.zoomIn.bind(u(t)),t.zoomOut=t.zoomOut.bind(u(t)),t.onEntering=t.onEntering.bind(u(t)),t.onEntered=t.onEntered.bind(u(t)),t.onPreviewImageClick=t.onPreviewImageClick.bind(u(t)),t.onExit=t.onExit.bind(u(t)),t.onExiting=t.onExiting.bind(u(t)),t.onExited=t.onExited.bind(u(t)),t.previewRef=r.default.createRef(),t}return f=E,(v=[{key:"onImageClick",value:function(){var e=this;this.props.preview&&(this.setState({maskVisible:!0}),setTimeout((function(){e.setState({previewVisible:!0})}),25))}},{key:"onPreviewImageClick",value:function(){this.previewClick=!0}},{key:"onMaskClick",value:function(){this.previewClick||(this.setState({previewVisible:!1}),this.setState({rotate:0}),this.setState({scale:1})),this.previewClick=!1}},{key:"onDownload",value:function(){var e=this.props;n.DomHandler.saveAs({name:e.alt,src:e.src}),this.previewClick=!0}},{key:"rotateRight",value:function(){this.setState((function(e){return{rotate:e.rotate+90}})),this.previewClick=!0}},{key:"rotateLeft",value:function(){this.setState((function(e){return{rotate:e.rotate-90}})),this.previewClick=!0}},{key:"zoomIn",value:function(){this.setState((function(e){return{scale:e.scale+.1}})),this.previewClick=!0}},{key:"zoomOut",value:function(){this.setState((function(e){return{scale:e.scale-.1}})),this.previewClick=!0}},{key:"onEntering",value:function(){n.ZIndexUtils.set("modal",this.mask,l.default.autoZIndex,l.default.zIndex.modal)}},{key:"onEntered",value:function(){this.props.onShow&&this.props.onShow()}},{key:"onExit",value:function(){n.DomHandler.addClass(this.mask,"p-component-overlay-leave")}},{key:"onExiting",value:function(){this.props.onHide&&this.props.onHide()}},{key:"onExited",value:function(e){n.ZIndexUtils.clear(e),th