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

2 lines
9.7 KiB
JavaScript
Raw Normal View History

2022-07-06 04:15:11 +00:00
import e,{Component as t}from"react";import{classNames as n,ObjectUtils as i,ZIndexUtils as r,DomHandler as o,ConnectedOverlayScrollHandler as s}from"primereact/utils";import{CSSTransition as a}from"primereact/csstransition";import{OverlayService as l}from"primereact/overlayservice";import{Portal as u}from"primereact/portal";import c from"primereact/api";function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(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 h(e,t,n){return t&&d(e.prototype,t),n&&d(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(e,t){return f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},f(e,t)}function v(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&&f(e,t)}function b(e){return b="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},b(e)}function y(e,t){if(t&&("object"===b(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return p(e)}function k(e){return k=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},k(e)}function E(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w(e){var t=g();return function(){var n,i=k(e);if(t){var r=k(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return y(this,n)}}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}}var L=function(r){v(s,t);var o=w(s);function s(e){var t;return m(this,s),(t=o.call(this,e)).state={activeItem:null},t}return h(s,[{key:"onItemClick",value:function(e,t){t.disabled?e.preventDefault():(t.url||e.preventDefault(),t.command&&t.command({originalEvent:e,item:t}),t.items&&(this.setState({activeItem:t}),this.props.onForward()))}},{key:"renderSeparator",value:function(t){return e.createElement("li",{key:"separator_"+t,className:"p-menu-separator"})}},{key:"renderSubmenu",value:function(t){return t.items?e.createElement(s,{model:t.items,index:this.props.index+1,menuWidth:this.props.menuWidth,effectDuration:this.props.effectDuration,onForward:this.props.onForward,parentActive:t===this.state.activeItem}):null}},{key:"renderMenuitem",value:function(t,r){var o=this,s=this.state.activeItem===t,a=n("p-menuitem",{"p-menuitem-active":s,"p-disabled":t.disabled},t.className),l=n("p-menuitem-icon",t.icon),u="p-submenu-icon pi pi-fw pi-angle-right",c=t.icon&&e.createElement("span",{className:l}),p=t.label&&e.createElement("span",{className:"p-menuitem-text"},t.label),m=t.items&&e.createElement("span",{className:u}),d=this.renderSubmenu(t),h=e.createElement("a",{href:t.url||"#",className:"p-menuitem-link",target:t.target,onClick:function(e){return o.onItemClick(e,t,r)},"aria-disabled":t.disabled},c,p,m);t.template&&(h=i.getJSXElement(t.template,t,{onClick:function(e){return o.onItemClick(e,t,r)},className:"p-menuitem-link",labelClassName:"p-menuitem-text",iconClassName:l,submenuIconClassName:u,element:h,props:this.props,active:s}));return e.createElement("li",{key:t.label+"_"+r,className:a,style:t.style},h,d)}},{key:"renderItem",value:function(e,t){return e.separator?this.renderSeparator(t):this.renderMenuitem(e,t)}},{key:"renderItems",value:function(){var e=this;retur