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

2 lines
4.6 KiB
JavaScript

import e,{Component as t}from"react";import{classNames as r,ObjectUtils as n}from"primereact/utils";import{Ripple as o}from"primereact/ripple";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(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&&a(e,t)}function l(e){return l="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},l(e)}function p(e,t){if(t&&("object"===l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return s(e)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function m(){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 d,y,h,v=function(a){u(k,t);var l,d,y,h,v,b=(l=k,d=m(),function(){var e,t=f(l);if(d){var r=f(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return p(this,e)});function k(e){var t;return i(this,k),(t=b.call(this,e)).state={currentIndex:-3},t.onListMouseLeave=t.onListMouseLeave.bind(s(t)),t}return y=k,(h=[{key:"onListMouseLeave",value:function(){this.setState({currentIndex:-3})}},{key:"onItemMouseEnter",value:function(e){this.setState({currentIndex:e})}},{key:"onItemClick",value:function(e,t){t.command&&t.command({originalEvent:e,item:t}),e.preventDefault()}},{key:"renderItem",value:function(t,i){var c=this,s=t.disabled,a=t.icon,u=t.label,l=t.template,p=t.url,f=t.target,m=r("p-dock-item",{"p-dock-item-second-prev":this.state.currentIndex-2===i,"p-dock-item-prev":this.state.currentIndex-1===i,"p-dock-item-current":this.state.currentIndex===i,"p-dock-item-next":this.state.currentIndex+1===i,"p-dock-item-second-next":this.state.currentIndex+2===i}),d=r("p-dock-action",{"p-disabled":s}),y=r("p-dock-action-icon",a),h="string"==typeof a?e.createElement("span",{className:y}):n.getJSXElement(a,this.props),v=e.createElement("a",{href:p||"#",role:"menuitem",className:d,target:f,"data-pr-tooltip":u,onClick:function(e){return c.onItemClick(e,t)}},h,e.createElement(o,null));return l&&(v=n.getJSXElement(l,t,{onClick:function(e){return c.onItemClick(e,t)},className:d,iconClassName:y,element:v,props:this.props,index:i})),e.createElement("li",{key:i,className:m,role:"none",onMouseEnter:function(){return c.onItemMouseEnter(i)}},v)}},{key:"renderItems",value:function(){var e=this;return this.props.model?this.props.model.map((function(t,r){return e.renderItem(t,r)})):null}},{key:"renderHeader",value:function(){return this.props.header?e.createElement("div",{className:"p-dock-header"},n.getJSXElement(this.props.header,{props:this.props})):null}},{key:"renderList",value:function(){var t=this,r=this.renderItems();return e.createElement("ul",{ref:function(e){return t.list=e},className:"p-dock-list",role:"menu",onMouseLeave:this.onListMouseLeave},r)}},{key:"renderFooter",value:function(){return this.props.footer?e.createElement("div",{className:"p-dock-footer"},n.getJSXElement(this.props.footer,{props:this.props})):null}},{key:"render",value:function(){var t=r("p-dock p-component p-dock-".concat(this.props.position),{"p-dock-magnification":this.props.magnification},this.props.className),n=this.renderHeader(),o=this.renderList(),i=this.renderFooter();return e.createElement("div",{id:this.props.id,className:t,style:this.props.style},e.createElement("div",{className:"p-dock-container"},n,o,i))}}])&&c(y.prototype,h),v&&c(y,v),Object.defineProperty(y,"prototype",{writable:!1}),k}();h={id:null,style:null,className:null,model:null,position:"bottom",magnification:!0,header:null,footer:null},(y="defaultProps")in(d=v)?Object.defineProperty(d,y,{value:h,enumerable:!0,configurable:!0,writable:!0}):d[y]=h;export{v as Dock};