@lanaco/lnc-react-ui
Version:
React component library
16 lines (14 loc) • 1.34 kB
JavaScript
"use strict";const n=require("react/jsx-runtime"),i=require("react"),w=require("./emotion-styled.browser.esm-DwHBgTPn.cjs"),x=require("./DropdownMenu.cjs"),j=require("./DropdownItem.cjs"),A=require("./Icon.cjs"),g=require("./emotion-element-f0de968e.browser.esm-B7k6i6lC.cjs"),N=w.styled.div`
font-family: ${r=>{var o,s;return(s=(o=r.theme)==null?void 0:o.typography)==null?void 0:s.fontFamily}};
position: relative;
width: 100%;
& .column-action-lnc {
position: absolute;
right: 0;
top: 0;
cursor: pointer;
}
& > span {
${r=>r.clickable&&"cursor: pointer;"}
}
`,c=i.memo(i.forwardRef(({item:r,column:o,actionsMenu:s=!1,actions:l=[],onDetails:t=()=>{},color:m="primary",size:a="small",className:u="",style:d={},children:p,...h},f)=>{const b=g.useTheme();return n.jsxs(N,{ref:f,theme:b,className:u,style:d,clickable:!!t,...h,children:[n.jsx("span",{onClick:e=>t(e,r,o),children:p}),s&&n.jsx(x,{className:"column-action-lnc",horizontalAlignment:"right",verticalAlignment:"bottom",color:m,size:a,control:n.jsx(A,{color:"neutral",className:"column-action-lnc",icon:"ellipsis-v"}),children:l==null?void 0:l.map((e,y)=>{if((e==null?void 0:e.show)!=!1)return n.jsx(j,{icon:e.icon,disabled:e.enable==!1,onClick:q=>{e.onAction(q,r,o)},children:e.name},y)})})]})}));c.displayName="KANBAN_HEADER";module.exports=c;