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

2 lines
6.0 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"),o=require("primereact/ripple");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=r(e);function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(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 c(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 u(e){return u="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},u(e)}function f(e,t){if(t&&("object"===u(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return a(e)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function b(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){h(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 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 m=function(r){c(O,e.Component);var p,u,h,g,m,v=(p=O,u=y(),function(){var e,t=d(p);if(u){var n=d(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return f(this,e)});function O(e){var t;s(this,O);var n={id:(t=v.call(this,e)).props.id};return t.props.onToggle||(n=b(b({},n),{},{collapsed:t.props.collapsed})),t.state=n,t.toggle=t.toggle.bind(a(t)),t.contentRef=l.default.createRef(),t}return h=O,(g=[{key:"toggle",value:function(e){if(this.props.toggleable){var t=this.props.onToggle?this.props.collapsed:this.state.collapsed;t?this.expand(e):this.collapse(e),this.props.onToggle&&this.props.onToggle({originalEvent:e,value:!t})}e.preventDefault()}},{key:"expand",value:function(e){this.props.onToggle||this.setState({collapsed:!1}),this.props.onExpand&&this.props.onExpand(e)}},{key:"collapse",value:function(e){this.props.onToggle||this.setState({collapsed:!0}),this.props.onCollapse&&this.props.onCollapse(e)}},{key:"isCollapsed",value:function(){return!!this.props.toggleable&&(this.props.onToggle?this.props.collapsed:this.state.collapsed)}},{key:"componentDidMount",value:function(){this.state.id||this.setState({id:n.UniqueComponentId()})}},{key:"renderToggleIcon",value:function(e){return this.props.toggleable?l.default.createElement("button",{className:"p-panel-header-icon p-panel-toggler p-link",onClick:this.toggle,id:this.state.id+"_label","aria-controls":this.state.id+"_content","aria-expanded":!e,role:"tab"},n.IconUtils.getJSXIcon(e?this.props.expandIcon:this.props.collapseIcon,{props:this.props,collapsed:e}),l.default.creat