Liferay.Loader.define("data-engine-js-components-web@1.0.55/js/custom/form-report/components/chart/Legend",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/icon","liferay!frontend-js-react-web$react","../../utils/colors"],(function(e,t,l){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({activeIndex:t,labels:l,onMouseOut:n,onMouseOver:a}){const[u,c]=(0,r.useState)(!1),d=({currentTarget:e})=>{const t=e.closest("li").dataset.item;a(parseInt(t,10))};return r.default.createElement("div",{className:"legend-container well well-lg"},r.default.createElement("div",{className:"legend-list"},r.default.createElement("ul",null,l.slice(0,u?l.length:e).map(((e,l)=>r.default.createElement(i,{active:null===t||t===l,color:(0,o.default)(l),index:l,key:"item-".concat(l),label:e,onMouseOut:n,onMouseOver:d}))),r.default.createElement(s,{expand:c,expanded:u,labelsLength:l.length}))))};var n=c(l("@frontend-taglib-clay$clayui/button")),a=c(l("@frontend-taglib-clay$clayui/icon")),r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var l={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var r=n?Object.getOwnPropertyDescriptor(e,a):null;r&&(r.get||r.set)?Object.defineProperty(l,a,r):l[a]=e[a]}l.default=e,t&&t.set(e,l);return l}(l("liferay!frontend-js-react-web$react")),o=c(l("../../utils/colors"));function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function c(e){return e&&e.__esModule?e:{default:e}}const e=10,i=({active:e,color:t,index:l,label:n,onMouseOut:a,onMouseOver:o})=>r.default.createElement("li",{className:e?"":"dim","data-item":l},r.default.createElement("svg",{height:"20",width:"20"},r.default.createElement("circle",{cx:"10",cy:"10",fill:t,onMouseOut:a,onMouseOver:o,r:"9",strokeWidth:"3"})),r.default.createElement("p",{onMouseOut:a,onMouseOver:o,x:"0em",y:"1em"},r.default.createElement("span",{dy:"2em",x:"2.5em"},n))),s=({expand:t,expanded:l,labelsLength:o})=>{if(o<=e)return null;return r.default.createElement("div",{className:"show-more-action"},r.default.createElement("svg",{height:"20",width:"20"},r.default.createElement("g",null,r.default.createElement("circle",{cx:"10",cy:"10",fill:"#F0F5FF",r:"9",strokeWidth:"3"}),r.default.createElement(a.default,{symbol:l?"caret-top-l":"caret-bottom-l"}))),r.default.createElement(n.default,{className:"show-more-button",displayType:"unstyled",onClick:()=>{t(!l)}},l?Liferay.Language.get("show-less"):Liferay.Language.get("show-all")))}}}));
//# sourceMappingURL=Legend.js.map