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

2 lines
9.1 KiB
JavaScript
Raw Normal View History

2022-07-06 04:15:11 +00:00
this.primereact=this.primereact||{},this.primereact.speeddial=function(e,t,i,n,r){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=s(t);function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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 c(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 u(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 c(e)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function m(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function y(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function b(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?y(Object(i),!0).forEach((function(t){m(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):y(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function v(){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 k=function(e){u(C,e);var t,s,p,f,y,k=(t=C,s=v(),function(){var e,i=h(t);if(s){var n=h(this).constructor;e=Reflect.construct(i,arguments,n)}else e=i.apply(this,arguments);return d(this,e)});function C(e){var t;return l(this,C),(t=k.call(this,e)).state={visible:!1},t.onClick=t.onClick.bind(c(t)),t.onItemClick=t.onItemClick.bind(c(t)),t}return p=C,f=[{key:"isVisible",value:function(){return this.props.onVisibleChange?this.props.visible:this.state.visible}},{key:"show",value:function(){this.props.onVisibleChange?this.props.onVisibleChange(!0):this.setState({visible:!0}),this.props.onShow&&this.props.onShow()}},{key:"hide",value:function(){this.props.onVisibleChange?this.props.onVisibleChange(!1):this.setState({visible:!1}),this.props.onHide&&this.props.onHide()}},{key:"onClick",value:function(e){this.isVisible()?this.hide():this.show(),this.props.onClick&&this.props.onClick(e),this.isItemClicked=!0}},{key:"onItemClick",value:function(e,t){t.command&&t.command({originalEvent:e,item:t}),this.hide(),this.isItemClicked=!0,e.preventDefault()}},{key:"bindDocumentClickListener",value:function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.isVisible()&&e.isOutsideClicked(t)&&e.hide(),e.isItemClicked=!1},document.addEventListener("click",this.documentClickListener))}},{key:"unbindDocumentClickListener",value:function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)}},{key:"isOutsideClicked",value:function(e){return this.container&&!(this.container.isSameNode(e.target)||this.container.contains(e.target)||this.isItemClicked)}},{key:"calculateTr