2 lines
10 KiB
JavaScript
2 lines
10 KiB
JavaScript
|
this.primereact=this.primereact||{},this.primereact.slidemenu=function(e,t,n,i,r,s,o){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=a(t),u=a(o);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){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 m(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 h(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 v(e){return v="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},v(e)}function b(e,t){if(t&&("object"===v(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 y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function k(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E(e){var t=w();return function(){var n,i=y(e);if(t){var r=y(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return b(this,n)}}function w(){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 g=function(e){h(i,e);var t=E(i);function i(e){var n;return p(this,i),(n=t.call(this,e)).state={activeItem:null},n}return m(i,[{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(e){return l.default.createElement("li",{key:"separator_"+e,className:"p-menu-separator"})}},{key:"renderSubmenu",value:function(e){return e.items?l.default.createElement(i,{model:e.items,index:this.props.index+1,menuWidth:this.props.menuWidth,effectDuration:this.props.effectDuration,onForward:this.props.onForward,parentActive:e===this.state.activeItem}):null}},{key:"renderMenuitem",value:function(e,t){var i=this,r=this.state.activeItem===e,s=n.classNames("p-menuitem",{"p-menuitem-active":r,"p-disabled":e.disabled},e.className),o=n.classNames("p-menuitem-icon",e.icon),a="p-submenu-icon pi pi-fw pi-angle-right",u=e.icon&&l.default.createElement("span",{className:o}),c=e.label&&l.default.createElement("span",{className:"p-menuitem-text"},e.label),p=e.items&&l.default.createElement("span",{className:a}),d=this.renderSubmenu(e),m=l.default.createElement("a",{href:e.url||"#",className:"p-menuitem-link",target:e.target,onClick:function(n){return i.onItemClick(n,e,t)},"aria-disabled":e.disabled},u,c,p);e.template&&(m=n.ObjectUtils.getJSXElement(e.template,e,{onClick:function(n){return i.onItemClick(n,e,t)},className:"p-menuitem-link",labelClassName:"p-menuitem-text",iconClassName:o,submenuIconClassName:a,element:m,props:this.props,active:r}));return l.default.createElement("li",{key:e.label+"_"+t,className:s,style:e.style},m,d)}},{key:"renderItem",value:function(e,t){return e.separator?this.renderSeparator(t):this.renderMenuitem(e,t)}},{key:"renderItems",value:function(){var e=this;return this.props.model?this.props.model.map((function(t,n){return e.renderItem(t,n
|