katoikia-app/web-ui/web-react/node_modules/primereact/megamenu/megamenu.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.megamenu=function(e,t,n,a){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=r(t);function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(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&&s(e,t)}function m(e){return m="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},m(e)}function p(e,t){if(t&&("object"===m(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 f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function d(){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,h,y,b=function(e){c(y,e);var t,r,s,m,v,h=(t=y,r=d(),function(){var e,n=f(t);if(r){var a=f(this).constructor;e=Reflect.construct(n,arguments,a)}else e=n.apply(this,arguments);return p(this,e)});function y(e){var t;return l(this,y),(t=h.call(this,e)).state={activeItem:null},t.onLeafClick=t.onLeafClick.bind(u(t)),t}return s=y,(m=[{key:"onLeafClick",value:function(e,t){t.disabled?e.preventDefault():(t.url||e.preventDefault(),t.command&&t.command({originalEvent:e,item:t}),this.setState({activeItem:null}))}},{key:"onCategoryMouseEnter",value:function(e,t){t.disabled?e.preventDefault():this.state.activeItem&&this.setState({activeItem:t})}},{key:"onCategoryClick",value:function(e,t){t.disabled||(t.url||e.preventDefault(),t.command&&t.command({originalEvent:e,item:this.props.item}),t.items&&this.setState(this.state.activeItem&&this.state.activeItem===t?{activeItem:null}:{activeItem:t})),e.preventDefault()}},{key:"onCategoryKeyDown",value:function(e,t){var n=e.currentTarget.parentElement;switch(e.which){case 40:this.isHorizontal()?this.expandMenu(t):this.navigateToNextItem(n),e.preventDefault();break;case 38:this.isVertical()?this.navigateToPrevItem(n):t.items&&t===this.state.activeItem&&this.collapseMenu(),e.preventDefault();break;case 39:this.isHorizontal()?this.navigateToNextItem(n):this.expandMenu(t),e.preventDefault();break;case 37:this.isHorizontal()?this.navigateToPrevItem(n):t.items&&t===this.state.activeItem&&this.collapseMenu(),e.preventDefault()}}},{key:"expandMenu",value:function(e){e.items&&this.setState({activeItem:e})}},{key:"collapseMenu",value:function(e){this.setState({activeItem:null})}},{key:"findNextItem",value:function(e){var t=e.nextElementSibling;return t?n.DomHandler.hasClass(t,"p-disabled")||!n.DomHandler.hasClass(t,"p-menuitem")?this.findNextItem(t):t:null}},{key:"findPrevItem",value:function(e){var t=e.previousElementSibling;return t?n.DomHandler.hasClass(t,"p-disabled")||!n.DomHandler.hasClass(t,"p-menuitem")?this.findPrevItem(t):t:null}},{key:"navigateToNextItem",value:function(e){var t=this.findNextItem(e);t&&t.children[0].focus()}},{key:"navigateToPrevItem",value:function(e){var t=this.findPrevItem(e);t&&t.children[0].focus()}},{key:"isHorizontal",value:function(){return"horizontal"===this.props.orientation}},{key:"isVertical",value:function(){return"vertical"===this.props.orientation}},{key:"getColumnCl