@famalabs/web-ui 1.0.0-beta.31 → 1.0.0-beta.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"react/compiler-runtime";import t from"@mui/material/Table";import o from"@mui/material/TableBody";import i from"@mui/material/TableContainer";import n,{useEffect as l}from"react";import{
|
|
1
|
+
import{c as e}from"react/compiler-runtime";import t from"@mui/material/Table";import o from"@mui/material/TableBody";import i from"@mui/material/TableContainer";import n,{useEffect as l}from"react";import{useStickyTableOverflow as a,TableCommonHeader as c,EmtpyTableBody as r,SkeletonRows as s,TableDataRows as d,TableContextMenu as m,BlankTableRow as u,stickyTableContainerClassName as h}from"../TableComponents/TableCommonBody.js";import{jsx as b,jsxs as g}from"react/jsx-runtime";function v(v){const f=e(80),{tableData:w,activeFilters:p,onFiltersChange:C,visibleColumns:S,tableActions:A,tableActionsActive:x,quickSelectedRows:R,setQuickSelectedRows:T,rowsPerPage:y,isFetching:k,onRowClick:P,autoSizeHeight:F,emptyTablePlaceholder:B,isTableEmpty:L,hideFooter:M,showNavigateIcon:q,variant:X,localeStr:_}=v,[H,I]=n.useState(!1);let N,Q,Y;f[0]!==k?(N=()=>{let e;if(k)return e=setTimeout(()=>{I(!0)},200),()=>clearTimeout(e);e=setTimeout(()=>{I(!1)},0)},Q=[k],f[0]=k,f[1]=N,f[2]=Q):(N=f[1],Q=f[2]),l(N,Q),f[3]!==A?(Y=A||{},f[3]=A,f[4]=Y):Y=f[4];const{quickActions:j,contextMenuActions:D}=Y;let W;f[5]!==j?(W=j||{},f[5]=j,f[6]=W):W=f[6];const{actionList:z,onAction:E}=W;let $;f[7]!==z?($=void 0===z?[]:z,f[7]=z,f[8]=$):$=f[8];const G=$;let J;f[9]!==D?(J=D||{},f[9]=D,f[10]=J):J=f[10];const{actionList:K,onAction:O}=J;let U;f[11]!==K?(U=void 0===K?[]:K,f[11]=K,f[12]=U):U=f[12];const V=U,[Z,ee]=n.useState(void 0),[te,oe]=n.useState(null);let ie;f[13]!==G||f[14]!==te||f[15]!==V||f[16]!==x||f[17]!==w?(ie=e=>{if(x)return;if(0===G.length&&0===V.length)return;e.preventDefault();const t=e.currentTarget.getAttribute("id");if(t){const e=w.find(e=>String(e.id)===t);ee(e)}else ee(void 0);oe(null===te?{mouseX:e.clientX+2,mouseY:e.clientY-6}:null);const o=document.getSelection();if(o&&o.rangeCount>0){const e=o.getRangeAt(0);setTimeout(()=>{o.addRange(e)})}},f[13]=G,f[14]=te,f[15]=V,f[16]=x,f[17]=w,f[18]=ie):ie=f[18];const ne=ie;let le;f[19]===Symbol.for("react.memo_cache_sentinel")?(le=()=>{oe(null),ee(void 0)},f[19]=le):le=f[19];const ae=le;let ce;f[20]!==y||f[21]!==w?(ce=y>0?w.slice(0,y):w,f[20]=y,f[21]=w,f[22]=ce):ce=f[22];const re=ce,se=F?5-re.length||0:y-re.length,{tableContainerRef:de,hasBoxShadowLeft:me,hasBoxShadowRight:ue}=a(!L);let he;f[23]!==R?(he=e=>R.some(t=>t.id===e.id),f[23]=R,f[24]=he):he=f[24];const be=he;let ge;f[25]!==Z?.id?(ge=e=>Z?.id===e.id,f[25]=Z?.id,f[26]=ge):ge=f[26];const ve=ge;let fe;f[27]!==T?(fe=e=>{T(t=>t.some(t=>t.id===e.id)?t.filter(t=>t.id!==e.id):[...t,e])},f[27]=T,f[28]=fe):fe=f[28];const we=fe,pe=L?"div":n.Fragment,Ce=String(!L&&me),Se=String(!L&&ue),Ae=L?"visible":"auto";let xe,Re,Te,ye,ke,Pe,Fe,Be;return f[29]!==Ae?(xe={bgcolor:"background.paper",tableLayout:"fixed",width:"100%",overflowX:"auto",overflowY:Ae,scrollbarWidth:"thin",scrollbarColor:"silver transparent"},f[29]=Ae,f[30]=xe):xe=f[30],f[31]===Symbol.for("react.memo_cache_sentinel")?(Re={overflowX:"auto",minWidth:150,"@keyframes fadeIn":{"0%":{opacity:0},"100%":{opacity:1}}},f[31]=Re):Re=f[31],f[32]!==L?(Te=L?{role:"table",style:{display:"table",width:"100%"}}:{},f[32]=L,f[33]=Te):Te=f[33],f[34]!==p||f[35]!==re||f[36]!==_||f[37]!==C||f[38]!==R||f[39]!==T||f[40]!==x||f[41]!==S?(ye=b(c,{currentPageRows:re,visibleColumns:S,quickActions:x,quickSelectedRows:R,setQuickSelectedRows:T,activeFilters:p,onFiltersChange:C,localeStr:_}),f[34]=p,f[35]=re,f[36]=_,f[37]=C,f[38]=R,f[39]=T,f[40]=x,f[41]=S,f[42]=ye):ye=f[42],f[43]!==pe||f[44]!==Te||f[45]!==ye?(ke=b(pe,{...Te,children:ye}),f[43]=pe,f[44]=Te,f[45]=ye,f[46]=ke):ke=f[46],f[47]!==G||f[48]!==p||f[49]!==se||f[50]!==te||f[51]!==V||f[52]!==re||f[53]!==B||f[54]!==we||f[55]!==ne||f[56]!==M||f[57]!==ve||f[58]!==be||f[59]!==L||f[60]!==E||f[61]!==O||f[62]!==P||f[63]!==y||f[64]!==Z||f[65]!==q||f[66]!==H||f[67]!==x||f[68]!==X||f[69]!==S?(Pe=L?b(r,{rowsPerPage:y,emptyTablePlaceholder:B,hideFooter:M}):g(o,{component:"div",children:[H?b(s,{rowsPerPage:y,tableActionsActive:x,visibleColumns:S,variant:X}):b(d,{currentPageRows:re,visibleColumns:S,tableActionsActive:x,variant:X,isQuickSelected:be,isContextSelected:ve,onRowClick:P,handleCheckBoxSelect:we,handleContextMenu:ne,showNavigateIcon:q}),b(m,{contextMenu:te,selectedContextRow:Z,contextMenuActionList:V,actionHeaderList:G,onContextMenuAction:O,onActionHeader:E,activeFilters:p,tableActionsActive:x,handleCloseContextMenu:ae}),!H&&se>0&&b(u,{blankRows:se})]}),f[47]=G,f[48]=p,f[49]=se,f[50]=te,f[51]=V,f[52]=re,f[53]=B,f[54]=we,f[55]=ne,f[56]=M,f[57]=ve,f[58]=be,f[59]=L,f[60]=E,f[61]=O,f[62]=P,f[63]=y,f[64]=Z,f[65]=q,f[66]=H,f[67]=x,f[68]=X,f[69]=S,f[70]=Pe):Pe=f[70],f[71]!==ke||f[72]!==Pe?(Fe=g(t,{component:"div",sx:Re,children:[ke,Pe]}),f[71]=ke,f[72]=Pe,f[73]=Fe):Fe=f[73],f[74]!==Ce||f[75]!==Se||f[76]!==xe||f[77]!==Fe||f[78]!==de?(Be=b(i,{ref:de,className:`RealTimeTable-Body ${h}`,"data-box-shadow-left":Ce,"data-box-shadow-right":Se,sx:xe,children:Fe}),f[74]=Ce,f[75]=Se,f[76]=xe,f[77]=Fe,f[78]=de,f[79]=Be):Be=f[79],Be}export{v as RealTimeTableBody};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"react/compiler-runtime";import t from"@mui/material/Grid";import o from"@mui/material/Table";import i from"@mui/material/TableBody";import n from"@mui/material/TableContainer";import l from"react";import{
|
|
1
|
+
import{c as e}from"react/compiler-runtime";import t from"@mui/material/Grid";import o from"@mui/material/Table";import i from"@mui/material/TableBody";import n from"@mui/material/TableContainer";import l from"react";import{useStickyTableOverflow as a,TableCommonHeader as c,SkeletonRows as r,TableDataRows as s,TableContextMenu as d,BlankTableRow as m,stickyTableContainerClassName as u}from"../TableComponents/TableCommonBody.js";import{jsx as b,jsxs as h}from"react/jsx-runtime";function f(f){const g=e(74),{tableData:v,activeFilters:p,visibleColumns:w,page:C,rowsPerPage:x,tableActions:A,tableActionsActive:S,quickSelectedRows:y,setQuickSelectedRows:R,isFetching:k,onRowClick:T,autoSizeHeight:P,emptyTablePlaceholder:B,isTableEmpty:L,hideFooter:M,variant:F}=f;let q;g[0]!==A?(q=A||{},g[0]=A,g[1]=q):q=g[1];const{quickActions:H,contextMenuActions:X}=q;let _;g[2]!==H?(_=H||{},g[2]=H,g[3]=_):_=g[3];const{actionList:j,onAction:I}=_;let Q;g[4]!==j?(Q=void 0===j?[]:j,g[4]=j,g[5]=Q):Q=g[5];const Y=Q;let D;g[6]!==X?(D=X||{},g[6]=X,g[7]=D):D=g[7];const{actionList:W,onAction:z}=D;let E;g[8]!==W?(E=void 0===W?[]:W,g[8]=W,g[9]=E):E=g[9];const G=E;let N;g[10]!==C||g[11]!==x||g[12]!==v?(N=x>0?v.slice(C*x,C*x+x):v,g[10]=C,g[11]=x,g[12]=v,g[13]=N):N=g[13];const $=N,J=P?5-$.length||0:x-$.length,{tableContainerRef:K,hasBoxShadowLeft:O,hasBoxShadowRight:U}=a(!L),[V,Z]=l.useState(void 0),[ee,te]=l.useState(null);let oe;g[14]!==Y||g[15]!==ee||g[16]!==G||g[17]!==S||g[18]!==v?(oe=e=>{if(S)return;if(0===Y.length&&0===G.length)return;e.preventDefault();const t=e.currentTarget.getAttribute("id");if(t){const e=v.find(e=>String(e.id)===t);Z(e)}else Z(void 0);te(null===ee?{mouseX:e.clientX+2,mouseY:e.clientY-6}:null);const o=document.getSelection();if(o&&o.rangeCount>0){const e=o.getRangeAt(0);setTimeout(()=>{o.addRange(e)})}},g[14]=Y,g[15]=ee,g[16]=G,g[17]=S,g[18]=v,g[19]=oe):oe=g[19];const ie=oe;let ne;g[20]===Symbol.for("react.memo_cache_sentinel")?(ne=()=>{te(null),Z(void 0)},g[20]=ne):ne=g[20];const le=ne;let ae;g[21]!==y?(ae=e=>y.some(t=>t.id===e.id),g[21]=y,g[22]=ae):ae=g[22];const ce=ae;let re;g[23]!==V?.id?(re=e=>V?.id===e.id,g[23]=V?.id,g[24]=re):re=g[24];const se=re;let de;g[25]!==R?(de=e=>{R(t=>t.some(t=>t.id===e.id)?t.filter(t=>t.id!==e.id):[...t,e])},g[25]=R,g[26]=de):de=g[26];const me=de,ue=L?"div":l.Fragment,be=String(!L&&O),he=String(!L&&U),fe=L?"visible":"auto";let ge,ve,pe,we,Ce,xe,Ae,Se;return g[27]!==fe?(ge={bgcolor:"background.paper",tableLayout:"fixed",width:"100%",overflowX:"auto",overflowY:fe,scrollbarWidth:"thin",scrollbarColor:"silver transparent"},g[27]=fe,g[28]=ge):ge=g[28],g[29]===Symbol.for("react.memo_cache_sentinel")?(ve={overflowX:"auto",minWidth:150,"@keyframes fadeIn":{"0%":{opacity:0},"100%":{opacity:1}}},g[29]=ve):ve=g[29],g[30]!==L?(pe=L?{role:"table",style:{display:"table",width:"100%"}}:{},g[30]=L,g[31]=pe):pe=g[31],g[32]!==$||g[33]!==y||g[34]!==R||g[35]!==S||g[36]!==w?(we=b(c,{currentPageRows:$,visibleColumns:w,quickActions:S,quickSelectedRows:y,setQuickSelectedRows:R}),g[32]=$,g[33]=y,g[34]=R,g[35]=S,g[36]=w,g[37]=we):we=g[37],g[38]!==ue||g[39]!==pe||g[40]!==we?(Ce=b(ue,{...pe,children:we}),g[38]=ue,g[39]=pe,g[40]=we,g[41]=Ce):Ce=g[41],g[42]!==Y||g[43]!==p||g[44]!==J||g[45]!==ee||g[46]!==G||g[47]!==$||g[48]!==B||g[49]!==me||g[50]!==ie||g[51]!==M||g[52]!==se||g[53]!==k||g[54]!==ce||g[55]!==L||g[56]!==I||g[57]!==z||g[58]!==T||g[59]!==x||g[60]!==V||g[61]!==S||g[62]!==F||g[63]!==w?(xe=L?b(t,{component:"div",container:!0,justifyContent:"center",alignItems:"center",minHeight:56*x+(M?52:0),sx:{animation:"fadeIn 0.2s ease-in-out forwards",opacity:0},children:B}):h(i,{component:"div",children:[k?b(r,{rowsPerPage:x,tableActionsActive:S,visibleColumns:w,variant:F}):b(s,{currentPageRows:$,visibleColumns:w,tableActionsActive:S,variant:F,isQuickSelected:ce,isContextSelected:se,onRowClick:T,handleCheckBoxSelect:me,handleContextMenu:ie}),b(d,{contextMenu:ee,selectedContextRow:V,contextMenuActionList:G,actionHeaderList:Y,onContextMenuAction:z,onActionHeader:I,activeFilters:p,tableActionsActive:S,handleCloseContextMenu:le}),!k&&J>0&&b(m,{blankRows:J})]}),g[42]=Y,g[43]=p,g[44]=J,g[45]=ee,g[46]=G,g[47]=$,g[48]=B,g[49]=me,g[50]=ie,g[51]=M,g[52]=se,g[53]=k,g[54]=ce,g[55]=L,g[56]=I,g[57]=z,g[58]=T,g[59]=x,g[60]=V,g[61]=S,g[62]=F,g[63]=w,g[64]=xe):xe=g[64],g[65]!==Ce||g[66]!==xe?(Ae=h(o,{component:"div",sx:ve,children:[Ce,xe]}),g[65]=Ce,g[66]=xe,g[67]=Ae):Ae=g[67],g[68]!==be||g[69]!==he||g[70]!==ge||g[71]!==Ae||g[72]!==K?(Se=b(n,{ref:K,className:`RealTimeTable-Body ${u}`,"data-box-shadow-left":be,"data-box-shadow-right":he,sx:ge,children:Ae}),g[68]=be,g[69]=he,g[70]=ge,g[71]=Ae,g[72]=K,g[73]=Se):Se=g[73],Se}export{f as StaticTableBody};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"react/compiler-runtime";import t from"@mui/material/Box";import i from"@mui/material/Checkbox";import o from"@mui/material/Divider";import n from"@mui/material/Grid";import r from"@mui/material/IconButton";import l from"@mui/material/ListItemIcon";import a from"@mui/material/ListItemText";import c from"@mui/material/Menu";import s from"@mui/material/MenuItem";import m from"@mui/material/MenuList";import d from"@mui/material/Popover";import p from"@mui/material/Skeleton";import h from"@mui/material/Stack";import{styled as u,useTheme as f,alpha as b}from"@mui/material/styles";import v from"@mui/material/TableCell";import g from"@mui/material/TableHead";import x from"@mui/material/TableRow";import y from"@mui/material/Tooltip";import w from"@mui/material/Typography";import{SquareIcon as k,SquareMinusIcon as C,InfoIcon as I,FunnelPlusIcon as R,SquareCheckIcon as S,ChevronRight as T}from"lucide-react";import W,{useEffect as M}from"react";import{FilterSwitcher as $}from"./TableFilterHeader.js";import{jsx as z,jsxs as O}from"react/jsx-runtime";const P=56,_=u(v)(()=>({height:56,maxWidth:180,padding:"0px 16px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"})),A={standard:56,dense:48,compact:40};function F(e){const t=e.columnOptions;switch(typeof t?.maxWidth){case"number":return`${t.maxWidth}px`;case"string":return"auto"===t.maxWidth?"100%":(t.maxWidth.endsWith("px"),t.maxWidth);default:return"180px"}}function B({theme:e,sticky:t,header:i=!1}){if("left"===t||"right"===t){const o=b(e.palette.primary.main,e.palette.action.selectedOpacity),n=b(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity);return{position:"sticky",..."left"===t?{left:0}:{right:0},bgcolor:i?"rgba(235, 238, 245)":e.palette.background.paper,zIndex:i?3:1,...!i&&{".MuiTableRow-root:hover &":{backgroundImage:`linear-gradient(${e.palette.action.hover}, ${e.palette.action.hover})`},".MuiTableRow-root.Mui-selected &":{backgroundImage:`linear-gradient(${o}, ${o})`},".MuiTableRow-root.Mui-selected:hover &":{backgroundImage:`linear-gradient(${n}, ${n})`}}}}return{}}function L(e,t){const i=t.split(".").reduce((e,t)=>{if(null!=e&&"object"==typeof e&&t in e)return e[t]},e);return null==i?"":String(i)}function H(i){const o=e(31),{row:n,column:l,variant:a,showNavigateIcon:c}=i,s=void 0===a?"standard":a,m=void 0!==c&&c,d=f(),p=F(l),u=L(n,l.accessor),b="Cell"in l&&null!=l.Cell?l.Cell:void 0,v=W.useRef(null),g="string"==typeof u&&""!==u.trim()&&u.length>.6*Number(p.replace("px","")),[x,w]=W.useState(!1);let k,C,I;o[0]!==u?(k=()=>{if("string"==typeof u&&""!==u.trim()&&v.current){const e=v.current.clientWidth<u.length;w(e)}},C=[u],o[0]=u,o[1]=k,o[2]=C):(k=o[1],C=o[2]),M(k,C),o[3]!==u||o[4]!==g||o[5]!==p||o[6]!==x?(I=x||g?z(y,{title:u,arrow:!0,children:z(t,{component:"span",sx:{display:"inline-block",maxWidth:p,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:u})}):z("span",{children:u}),o[3]=u,o[4]=g,o[5]=p,o[6]=x,o[7]=I):I=o[7];const R=I,S=A[s];let $,P;o[8]===Symbol.for("react.memo_cache_sentinel")?($={opacity:1,visibility:"visible"},P={opacity:0,visibility:"hidden"},o[8]=$,o[9]=P):($=o[8],P=o[9]);const H=l.columnOptions?.sticky;let N,j,q,D,Q,Y;return o[10]!==H||o[11]!==d?(N=B({theme:d,sticky:H}),o[10]=H,o[11]=d,o[12]=N):N=o[12],o[13]!==p||o[14]!==S||o[15]!==N?(j={position:"relative",height:S,maxWidth:p,".MuiTableRow-root:hover & .show-navigate":$,".show-navigate":P,...N},o[13]=p,o[14]=S,o[15]=N,o[16]=j):j=o[16],o[17]!==b||o[18]!==R||o[19]!==u||o[20]!==l||o[21]!==n?(q=b?z(b,{cellValue:u,currentColumn:l,currentRow:n}):R,o[17]=b,o[18]=R,o[19]=u,o[20]=l,o[21]=n,o[22]=q):q=o[22],o[23]!==m?(D=m&&z(r,{className:"show-navigate",disableRipple:!0,color:"primary",size:"small",sx:{height:"100%",width:36,background:"linear-gradient(90deg, transparent, white 40%)",position:"absolute",right:0,top:0,bottom:0,borderRadius:0},children:z(T,{size:18})}),o[23]=m,o[24]=D):D=o[24],o[25]!==q||o[26]!==D?(Q=O(h,{direction:"row",flexWrap:"nowrap",justifyContent:"flex-start",alignItems:"center",color:"primary",children:[q,D]}),o[25]=q,o[26]=D,o[27]=Q):Q=o[27],o[28]!==j||o[29]!==Q?(Y=z(_,{ref:v,component:"div",sx:j,children:Q}),o[28]=j,o[29]=Q,o[30]=Y):Y=o[30],Y}function N(o){const l=e(43),{currentPageRows:a,visibleColumns:c,quickActions:s,quickSelectedRows:m,setQuickSelectedRows:p}=o,{activeFilters:h,onFiltersChange:u,localeStr:b}=o;let v;l[0]!==h?(v=void 0===h?[]:h,l[0]=h,l[1]=v):v=l[1];const S=v,T=f(),M="light"===T.palette.mode?"rgba(235, 238, 245)":T.palette.action.selected;let P;l[2]!==a||l[3]!==p?(P=e=>{e.target.checked?p(e=>{const t=a.filter(t=>!e.some(e=>e.id===t.id));return[...e,...t]}):p(e=>e.filter(e=>!a.some(t=>t.id===e.id)))},l[2]=a,l[3]=p,l[4]=P):P=l[4];const A=P;let L;if(l[5]!==a||l[6]!==m){let e;l[8]!==m?(e=e=>m.some(t=>t.id===e.id),l[8]=m,l[9]=e):e=l[9],L=a.every(e),l[5]=a,l[6]=m,l[7]=L}else L=l[7];const H=L,[N,j]=W.useState(null),[q,D]=W.useState(null);let Q;l[10]===Symbol.for("react.memo_cache_sentinel")?(Q=(e,t)=>{e.stopPropagation(),D(t),j(e.currentTarget)},l[10]=Q):Q=l[10];const Y=Q;let E;l[11]===Symbol.for("react.memo_cache_sentinel")?(E=()=>{j(null),D(null)},l[11]=E):E=l[11];const G=E,V=Boolean(N&&q);let X,J,K,U,Z,ee,te,ie,oe;return l[12]!==M?(X={backgroundColor:M,position:"sticky",top:0,zIndex:1},l[12]=M,l[13]=X):X=l[13],l[14]!==H||l[15]!==A||l[16]!==s||l[17]!==T?(J=s&&z(_,{component:"div",padding:"checkbox",sx:{...B({theme:T,sticky:"left",header:!0})},children:z(i,{color:"primary",onChange:A,checkedIcon:H?z(C,{size:22}):void 0,icon:z(k,{size:22}),checked:H})}),l[14]=H,l[15]=A,l[16]=s,l[17]=T,l[18]=J):J=l[18],l[19]!==M||l[20]!==b?.filterBy||l[21]!==u||l[22]!==T||l[23]!==c?(K=c.length>0?c.map((e,i)=>{const o=F(e);return!1===e.columnOptions?.visible?null:O(_,{component:"div",sx:{width:160,position:"relative",maxWidth:o,...B({theme:T,sticky:e.columnOptions?.sticky,header:!0}),"& .tooltip-icon":{opacity:0,visibility:"hidden",transition:"opacity 0.2s ease"},"&:hover .tooltip-icon, &:focus-within .tooltip-icon":{opacity:1,visibility:"visible"}},children:[e.ColumnCell?e.ColumnCell():z(w,{variant:"subtitle2",fontWeight:"bold",noWrap:!0,sx:{pr:e.Tooltip||u&&e.filterOptions?6:0},children:e.label||""}),O(t,{className:"tooltip-icon",sx:{position:"absolute",top:"50%",transform:"translateY(-50%)",right:8,display:"flex",alignItems:"center",backgroundColor:M},children:["Tooltip"in e&&z(y,{title:e.Tooltip?.label||"",children:z(r,{disableRipple:!0,color:e.Tooltip?.color||"default",size:"small",children:e.Tooltip?.icon||z(I,{size:16})})}),u&&e.filterOptions&&z(y,{title:`${b?.filterBy} ${e.label||""}`,children:z(r,{disableRipple:!0,color:"primary",size:"small",onClick:t=>Y(t,e),children:z(R,{size:16})})})]})]},i)}):z(_,{component:"div",sx:{width:160,position:"relative"}}),l[19]=M,l[20]=b?.filterBy,l[21]=u,l[22]=T,l[23]=c,l[24]=K):K=l[24],l[25]!==J||l[26]!==K?(U=O(x,{component:"div",children:[J,K]}),l[25]=J,l[26]=K,l[27]=U):U=l[27],l[28]===Symbol.for("react.memo_cache_sentinel")?(Z={vertical:"bottom",horizontal:"left"},ee={paper:{variant:"outlined"}},l[28]=Z,l[29]=ee):(Z=l[28],ee=l[29]),l[30]!==S||l[31]!==b||l[32]!==u||l[33]!==q?(te=q&&u&&O(n,{container:!0,size:12,p:2,gap:1,maxWidth:300,children:[z(n,{size:12,children:z(w,{variant:"subtitle2",color:"textSecondary",fontWeight:"bold",children:(b?.filterBy??"Filter by")+" "+(q.label??"")})}),z(n,{size:12,children:z($,{column:q,filterIndex:0,activeFilters:S,onFiltersChange:u,handleClose:G,localeStr:b??{}})})]}),l[30]=S,l[31]=b,l[32]=u,l[33]=q,l[34]=te):te=l[34],l[35]!==N||l[36]!==V||l[37]!==te?(ie=z(d,{open:V,anchorEl:N,onClose:G,anchorOrigin:Z,slotProps:ee,children:te}),l[35]=N,l[36]=V,l[37]=te,l[38]=ie):ie=l[38],l[39]!==ie||l[40]!==X||l[41]!==U?(oe=O(g,{component:"div",style:X,children:[U,ie]}),l[39]=ie,l[40]=X,l[41]=U,l[42]=oe):oe=l[42],oe}function j(t){const i=e(4),{rowsPerPage:o,hideFooter:r,emptyTablePlaceholder:l}=t,a=56*o+(r?52:0);let c,s;return i[0]===Symbol.for("react.memo_cache_sentinel")?(c={animation:"fadeIn 0.2s ease-in-out forwards",opacity:0},i[0]=c):c=i[0],i[1]!==l||i[2]!==a?(s=z(n,{component:"div",container:!0,justifyContent:"center",alignItems:"center",minHeight:a,sx:c,children:l}),i[1]=l,i[2]=a,i[3]=s):s=i[3],s}function q(t){const i=e(2),{blankRows:o}=t,n=56*o;let r;return i[0]!==n?(r=z(x,{component:"div",sx:{height:n,borderBottom:"1px solid",borderColor:"divider",animation:"fadeIn 0.2s ease-in-out forwards",opacity:0}}),i[0]=n,i[1]=r):r=i[1],r}function D({rowsPerPage:e,tableActionsActive:t,visibleColumns:i,variant:o}){return Array.from({length:e},(e,n)=>O(x,{component:"div",sx:{animation:"fadeIn 0.2s ease-in-out forwards",opacity:0},children:[t&&z(_,{component:"div",padding:"checkbox",sx:{height:A[o],width:56},children:z(p,{animation:"wave",variant:"rounded",height:"dense"===o?void 0:20})},`skeleton-checkbox-${n}`),i.length>0?i.map(e=>{const t=F(e);return!1===e.columnOptions?.visible?null:z(_,{component:"div",sx:{height:A[o],maxWidth:t},children:z(p,{animation:"wave",variant:"rounded",height:"dense"===o?void 0:20})},`skeleton-cell-${e.accessor}`)}):z(_,{component:"div",colSpan:t?1:0,sx:{height:A[o]}})]},`skeleton-${n}`))}function Q(t){const o=e(23),{currentPageRows:n,visibleColumns:r,tableActionsActive:l,variant:a,showNavigateIcon:c,isQuickSelected:s,isContextSelected:m,onRowClick:d,handleCheckBoxSelect:p,handleContextMenu:h}=t,u=f();let b;if(o[0]!==n||o[1]!==p||o[2]!==h||o[3]!==m||o[4]!==s||o[5]!==d||o[6]!==c||o[7]!==l||o[8]!==u||o[9]!==a||o[10]!==r){let e;o[12]!==p||o[13]!==h||o[14]!==m||o[15]!==s||o[16]!==d||o[17]!==c||o[18]!==l||o[19]!==u||o[20]!==a||o[21]!==r?(e=e=>O(x,{id:String(e.id),component:"div",hover:!0,selected:s(e)||m(e),onClick:l?()=>p(e):()=>d?.(e),onContextMenu:h,"aria-label":`table-row-${e.id}`,sx:{minHeight:56,animation:"fadeIn 0.2s ease-in-out forwards",opacity:0,"&:hover":{cursor:"pointer",transition:"background-color 0s ease"}},children:[l&&z(_,{component:"div",padding:"checkbox",onClick:Y,sx:{height:A[a],...B({theme:u,sticky:"left"})},children:z(i,{color:"primary",onChange:()=>p(e),checked:s(e),icon:z(k,{size:22}),checkedIcon:z(S,{size:22})})},`checkbox-${e.id}`),r.map((t,i)=>{if(!1===t.columnOptions?.visible)return null;const o=!l&&i===r.length-1&&c;return z(H,{row:e,column:t,variant:a,showNavigateIcon:o},`custom-cell-${t.accessor}`)})]},`table-row-${e.id}`),o[12]=p,o[13]=h,o[14]=m,o[15]=s,o[16]=d,o[17]=c,o[18]=l,o[19]=u,o[20]=a,o[21]=r,o[22]=e):e=o[22],b=n.filter(G).filter(E).map(e),o[0]=n,o[1]=p,o[2]=h,o[3]=m,o[4]=s,o[5]=d,o[6]=c,o[7]=l,o[8]=u,o[9]=a,o[10]=r,o[11]=b}else b=o[11];return b}function Y(e){e.stopPropagation()}function E(e,t,i){return i.findIndex(t=>t.id===e.id)===t}function G(e){return null!=e}function V(t){const i=e(32),{contextMenu:n,selectedContextRow:d,contextMenuActionList:p,actionHeaderList:h,onContextMenuAction:u,onActionHeader:f,activeFilters:b,tableActionsActive:v,handleCloseContextMenu:g}=t;let x;i[0]!==b?(x=void 0===b?[]:b,i[0]=b,i[1]=x):x=i[1];const y=x,k=null!==n&&!v;let C,I,R,S,T,W,M,$;return i[2]!==g?(C=e=>{e.preventDefault(),g()},i[2]=g,i[3]=C):C=i[3],i[4]!==n?(I=null!==n?{top:n.mouseY,left:n.mouseX}:void 0,i[4]=n,i[5]=I):I=i[5],i[6]===Symbol.for("react.memo_cache_sentinel")?(R={minWidth:100,maxWidth:240,p:0,outline:"none","& .MuiMenuItem-root":{gap:.5},"& .MuiListItemText-root":{overflow:"hidden",maxWidth:"100%"},"& .MuiListItemText-root .MuiTypography-root":{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"block",maxWidth:"100%"}},i[6]=R):R=i[6],i[7]!==y||i[8]!==p||i[9]!==g||i[10]!==u||i[11]!==d?(S=p?.map((e,t)=>O(s,{onClick:()=>{u&&d&&u(e.type,[d],y),g()},children:[e.icon&&z(l,{children:z(r,{color:e.color||"inherit",disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,sx:{p:0},children:e.icon})}),z(a,{children:z(w,{variant:"body2",color:e.color||"inherit",noWrap:!0,title:e.label,children:e.label})})]},`context-header-item-${t}`)),i[7]=y,i[8]=p,i[9]=g,i[10]=u,i[11]=d,i[12]=S):S=i[12],i[13]!==h||i[14]!==p.length?(T=p.length>0&&h.length>0&&z(o,{}),i[13]=h,i[14]=p.length,i[15]=T):T=i[15],i[16]!==h||i[17]!==y||i[18]!==g||i[19]!==f||i[20]!==d?(W=h?.map((e,t)=>O(s,{onClick:()=>{f&&d&&f(e.type,[d],y),g()},children:[e.icon&&z(l,{children:z(r,{color:e.color||"inherit",disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,sx:{p:0},children:e.icon})}),z(a,{children:z(w,{variant:"body2",color:e.color||"inherit",noWrap:!0,title:e.label,children:e.label})})]},`context-menu-item-${t}`)),i[16]=h,i[17]=y,i[18]=g,i[19]=f,i[20]=d,i[21]=W):W=i[21],i[22]!==S||i[23]!==T||i[24]!==W?(M=O(m,{sx:R,children:[S,T,W]}),i[22]=S,i[23]=T,i[24]=W,i[25]=M):M=i[25],i[26]!==g||i[27]!==M||i[28]!==k||i[29]!==C||i[30]!==I?($=z(c,{open:k,onClose:g,onContextMenu:C,anchorReference:"anchorPosition",anchorPosition:I,children:M}),i[26]=g,i[27]=M,i[28]=k,i[29]=C,i[30]=I,i[31]=$):$=i[31],$}export{q as BlankTableRow,H as DynamicCellCreator,j as EmtpyTableBody,P as ROW_HEIGHT,D as SkeletonRows,_ as StyledTableCell,N as TableCommonHeaderProps,V as TableContextMenu,Q as TableDataRows,F as getMaxWidth,L as getNestedProperty,B as getStickyStyle,A as variantHeightMap};
|
|
1
|
+
import{c as e}from"react/compiler-runtime";import t from"@mui/material/Box";import i from"@mui/material/Checkbox";import o from"@mui/material/Divider";import n from"@mui/material/Grid";import r from"@mui/material/IconButton";import l from"@mui/material/ListItemIcon";import a from"@mui/material/ListItemText";import c from"@mui/material/Menu";import s from"@mui/material/MenuItem";import d from"@mui/material/MenuList";import m from"@mui/material/Popover";import h from"@mui/material/Skeleton";import p from"@mui/material/Stack";import{styled as u,useTheme as f,alpha as b}from"@mui/material/styles";import x from"@mui/material/TableCell";import v from"@mui/material/TableHead";import g from"@mui/material/TableRow";import w from"@mui/material/Tooltip";import y from"@mui/material/Typography";import{SquareIcon as k,SquareMinusIcon as C,InfoIcon as S,FunnelPlusIcon as R,SquareCheckIcon as I,ChevronRight as W}from"lucide-react";import T,{useEffect as M}from"react";import{FilterSwitcher as $}from"./TableFilterHeader.js";import{jsx as z,jsxs as B}from"react/jsx-runtime";const O=56,L=u(x)(()=>({height:56,maxWidth:180,padding:"0px 16px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"})),P={standard:56,dense:48,compact:40},_="StickyTable-ScrollContainer",A={hasBoxShadowLeft:!1,hasBoxShadowRight:!1};function F(t){const i=e(5),o=void 0===t||t,n=T.useRef(null),[r,l]=T.useState(A);let a,c,s;return i[0]!==o?(a=()=>{const e=n.current;if(!o||!e)return;const t=()=>{const t=Math.max(e.scrollWidth-e.clientWidth,0),i=t>1,o={hasBoxShadowLeft:i&&e.scrollLeft>1,hasBoxShadowRight:i&&e.scrollLeft<t-1};l(e=>e.hasBoxShadowLeft===o.hasBoxShadowLeft&&e.hasBoxShadowRight===o.hasBoxShadowRight?e:o)};t();const i=new ResizeObserver(t);return i.observe(e),e.addEventListener("scroll",t,{passive:!0}),()=>{e.removeEventListener("scroll",t),i.disconnect()}},c=[o],i[0]=o,i[1]=a,i[2]=c):(a=i[1],c=i[2]),M(a,c),i[3]!==r?(s={tableContainerRef:n,...r},i[3]=r,i[4]=s):s=i[4],s}function H(e){const t=e.columnOptions;switch(typeof t?.maxWidth){case"number":return`${t.maxWidth}px`;case"string":return"auto"===t.maxWidth?"100%":(t.maxWidth.endsWith("px"),t.maxWidth);default:return"180px"}}function N({theme:e,sticky:t,header:i=!1}){if("left"===t||"right"===t){const o=b(e.palette.primary.main,e.palette.action.selectedOpacity),n=b(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),r=b("light"===e.palette.mode?e.palette.grey[900]:e.palette.common.white,(e.palette.mode,.18)),l="left"===t?{boxShadow:"none",[`.${_}[data-box-shadow-left="true"] &`]:{boxShadow:`12px 0 12px -12px ${r}`}}:{boxShadow:"none",[`.${_}[data-box-shadow-right="true"] &`]:{boxShadow:`-12px 0 12px -12px ${r}`}};return{position:"sticky",..."left"===t?{left:0}:{right:0},bgcolor:i?"rgba(235, 238, 245)":e.palette.background.paper,zIndex:i?3:1,...l,...!i&&{".MuiTableRow-root:hover &":{backgroundImage:`linear-gradient(${e.palette.action.hover}, ${e.palette.action.hover})`},".MuiTableRow-root.Mui-selected &":{backgroundImage:`linear-gradient(${o}, ${o})`},".MuiTableRow-root.Mui-selected:hover &":{backgroundImage:`linear-gradient(${n}, ${n})`}}}}return{}}function j(e,t){const i=t.split(".").reduce((e,t)=>{if(null!=e&&"object"==typeof e&&t in e)return e[t]},e);return null==i?"":String(i)}function E(i){const o=e(31),{row:n,column:l,variant:a,showNavigateIcon:c}=i,s=void 0===a?"standard":a,d=void 0!==c&&c,m=f(),h=H(l),u=j(n,l.accessor),b="Cell"in l&&null!=l.Cell?l.Cell:void 0,x=T.useRef(null),v="string"==typeof u&&""!==u.trim()&&u.length>.6*Number(h.replace("px","")),[g,y]=T.useState(!1);let k,C,S;o[0]!==u?(k=()=>{if("string"==typeof u&&""!==u.trim()&&x.current){const e=x.current.clientWidth<u.length;y(e)}},C=[u],o[0]=u,o[1]=k,o[2]=C):(k=o[1],C=o[2]),M(k,C),o[3]!==u||o[4]!==v||o[5]!==h||o[6]!==g?(S=g||v?z(w,{title:u,arrow:!0,children:z(t,{component:"span",sx:{display:"inline-block",maxWidth:h,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:u})}):z("span",{children:u}),o[3]=u,o[4]=v,o[5]=h,o[6]=g,o[7]=S):S=o[7];const R=S,I=P[s];let $,O;o[8]===Symbol.for("react.memo_cache_sentinel")?($={opacity:1,visibility:"visible"},O={opacity:0,visibility:"hidden"},o[8]=$,o[9]=O):($=o[8],O=o[9]);const _=l.columnOptions?.sticky;let A,F,E,q,D,Q;return o[10]!==_||o[11]!==m?(A=N({theme:m,sticky:_}),o[10]=_,o[11]=m,o[12]=A):A=o[12],o[13]!==h||o[14]!==I||o[15]!==A?(F={position:"relative",height:I,maxWidth:h,".MuiTableRow-root:hover & .show-navigate":$,".show-navigate":O,...A},o[13]=h,o[14]=I,o[15]=A,o[16]=F):F=o[16],o[17]!==b||o[18]!==R||o[19]!==u||o[20]!==l||o[21]!==n?(E=b?z(b,{cellValue:u,currentColumn:l,currentRow:n}):R,o[17]=b,o[18]=R,o[19]=u,o[20]=l,o[21]=n,o[22]=E):E=o[22],o[23]!==d?(q=d&&z(r,{className:"show-navigate",disableRipple:!0,color:"primary",size:"small",sx:{height:"100%",width:36,background:"linear-gradient(90deg, transparent, white 40%)",position:"absolute",right:0,top:0,bottom:0,borderRadius:0},children:z(W,{size:18})}),o[23]=d,o[24]=q):q=o[24],o[25]!==E||o[26]!==q?(D=B(p,{direction:"row",flexWrap:"nowrap",justifyContent:"flex-start",alignItems:"center",color:"primary",children:[E,q]}),o[25]=E,o[26]=q,o[27]=D):D=o[27],o[28]!==F||o[29]!==D?(Q=z(L,{ref:x,component:"div",sx:F,children:D}),o[28]=F,o[29]=D,o[30]=Q):Q=o[30],Q}function q(o){const l=e(43),{currentPageRows:a,visibleColumns:c,quickActions:s,quickSelectedRows:d,setQuickSelectedRows:h}=o,{activeFilters:p,onFiltersChange:u,localeStr:b}=o;let x;l[0]!==p?(x=void 0===p?[]:p,l[0]=p,l[1]=x):x=l[1];const I=x,W=f(),M="light"===W.palette.mode?"rgba(235, 238, 245)":W.palette.action.selected;let O;l[2]!==a||l[3]!==h?(O=e=>{e.target.checked?h(e=>{const t=a.filter(t=>!e.some(e=>e.id===t.id));return[...e,...t]}):h(e=>e.filter(e=>!a.some(t=>t.id===e.id)))},l[2]=a,l[3]=h,l[4]=O):O=l[4];const P=O;let _;if(l[5]!==a||l[6]!==d){let e;l[8]!==d?(e=e=>d.some(t=>t.id===e.id),l[8]=d,l[9]=e):e=l[9],_=a.every(e),l[5]=a,l[6]=d,l[7]=_}else _=l[7];const A=_,[F,j]=T.useState(null),[E,q]=T.useState(null);let D;l[10]===Symbol.for("react.memo_cache_sentinel")?(D=(e,t)=>{e.stopPropagation(),q(t),j(e.currentTarget)},l[10]=D):D=l[10];const Q=D;let Y;l[11]===Symbol.for("react.memo_cache_sentinel")?(Y=()=>{j(null),q(null)},l[11]=Y):Y=l[11];const G=Y,V=Boolean(F&&E);let X,J,K,U,Z,ee,te,ie,oe;return l[12]!==M?(X={backgroundColor:M,position:"sticky",top:0,zIndex:1},l[12]=M,l[13]=X):X=l[13],l[14]!==A||l[15]!==P||l[16]!==s||l[17]!==W?(J=s&&z(L,{component:"div",padding:"checkbox",sx:{...N({theme:W,sticky:"left",header:!0})},children:z(i,{color:"primary",onChange:P,checkedIcon:A?z(C,{size:22}):void 0,icon:z(k,{size:22}),checked:A})}),l[14]=A,l[15]=P,l[16]=s,l[17]=W,l[18]=J):J=l[18],l[19]!==M||l[20]!==b?.filterBy||l[21]!==u||l[22]!==W||l[23]!==c?(K=c.length>0?c.map((e,i)=>{const o=H(e);return!1===e.columnOptions?.visible?null:B(L,{component:"div",sx:{width:160,position:"relative",maxWidth:o,...N({theme:W,sticky:e.columnOptions?.sticky,header:!0}),"& .tooltip-icon":{opacity:0,visibility:"hidden",transition:"opacity 0.2s ease"},"&:hover .tooltip-icon, &:focus-within .tooltip-icon":{opacity:1,visibility:"visible"}},children:[e.ColumnCell?e.ColumnCell():z(y,{variant:"subtitle2",fontWeight:"bold",noWrap:!0,sx:{pr:e.Tooltip||u&&e.filterOptions?6:0},children:e.label||""}),B(t,{className:"tooltip-icon",sx:{position:"absolute",top:"50%",transform:"translateY(-50%)",right:8,display:"flex",alignItems:"center",backgroundColor:M},children:["Tooltip"in e&&z(w,{title:e.Tooltip?.label||"",children:z(r,{disableRipple:!0,color:e.Tooltip?.color||"default",size:"small",children:e.Tooltip?.icon||z(S,{size:16})})}),u&&e.filterOptions&&z(w,{title:`${b?.filterBy} ${e.label||""}`,children:z(r,{disableRipple:!0,color:"primary",size:"small",onClick:t=>Q(t,e),children:z(R,{size:16})})})]})]},i)}):z(L,{component:"div",sx:{width:160,position:"relative"}}),l[19]=M,l[20]=b?.filterBy,l[21]=u,l[22]=W,l[23]=c,l[24]=K):K=l[24],l[25]!==J||l[26]!==K?(U=B(g,{component:"div",children:[J,K]}),l[25]=J,l[26]=K,l[27]=U):U=l[27],l[28]===Symbol.for("react.memo_cache_sentinel")?(Z={vertical:"bottom",horizontal:"left"},ee={paper:{variant:"outlined"}},l[28]=Z,l[29]=ee):(Z=l[28],ee=l[29]),l[30]!==I||l[31]!==b||l[32]!==u||l[33]!==E?(te=E&&u&&B(n,{container:!0,size:12,p:2,gap:1,maxWidth:300,children:[z(n,{size:12,children:z(y,{variant:"subtitle2",color:"textSecondary",fontWeight:"bold",children:(b?.filterBy??"Filter by")+" "+(E.label??"")})}),z(n,{size:12,children:z($,{column:E,filterIndex:0,activeFilters:I,onFiltersChange:u,handleClose:G,localeStr:b??{}})})]}),l[30]=I,l[31]=b,l[32]=u,l[33]=E,l[34]=te):te=l[34],l[35]!==F||l[36]!==V||l[37]!==te?(ie=z(m,{open:V,anchorEl:F,onClose:G,anchorOrigin:Z,slotProps:ee,children:te}),l[35]=F,l[36]=V,l[37]=te,l[38]=ie):ie=l[38],l[39]!==ie||l[40]!==X||l[41]!==U?(oe=B(v,{component:"div",style:X,children:[U,ie]}),l[39]=ie,l[40]=X,l[41]=U,l[42]=oe):oe=l[42],oe}function D(t){const i=e(4),{rowsPerPage:o,hideFooter:r,emptyTablePlaceholder:l}=t,a=56*o+(r?52:0);let c,s;return i[0]===Symbol.for("react.memo_cache_sentinel")?(c={animation:"fadeIn 0.2s ease-in-out forwards",opacity:0},i[0]=c):c=i[0],i[1]!==l||i[2]!==a?(s=z(n,{component:"div",container:!0,justifyContent:"center",alignItems:"center",minHeight:a,sx:c,children:l}),i[1]=l,i[2]=a,i[3]=s):s=i[3],s}function Q(t){const i=e(2),{blankRows:o}=t,n=56*o;let r;return i[0]!==n?(r=z(g,{component:"div",sx:{height:n,borderBottom:"1px solid",borderColor:"divider",animation:"fadeIn 0.2s ease-in-out forwards",opacity:0}}),i[0]=n,i[1]=r):r=i[1],r}function Y({rowsPerPage:e,tableActionsActive:t,visibleColumns:i,variant:o}){return Array.from({length:e},(e,n)=>B(g,{component:"div",sx:{animation:"fadeIn 0.2s ease-in-out forwards",opacity:0},children:[t&&z(L,{component:"div",padding:"checkbox",sx:{height:P[o],width:56},children:z(h,{animation:"wave",variant:"rounded",height:"dense"===o?void 0:20})},`skeleton-checkbox-${n}`),i.length>0?i.map(e=>{const t=H(e);return!1===e.columnOptions?.visible?null:z(L,{component:"div",sx:{height:P[o],maxWidth:t},children:z(h,{animation:"wave",variant:"rounded",height:"dense"===o?void 0:20})},`skeleton-cell-${e.accessor}`)}):z(L,{component:"div",colSpan:t?1:0,sx:{height:P[o]}})]},`skeleton-${n}`))}function G(t){const o=e(23),{currentPageRows:n,visibleColumns:r,tableActionsActive:l,variant:a,showNavigateIcon:c,isQuickSelected:s,isContextSelected:d,onRowClick:m,handleCheckBoxSelect:h,handleContextMenu:p}=t,u=f();let b;if(o[0]!==n||o[1]!==h||o[2]!==p||o[3]!==d||o[4]!==s||o[5]!==m||o[6]!==c||o[7]!==l||o[8]!==u||o[9]!==a||o[10]!==r){let e;o[12]!==h||o[13]!==p||o[14]!==d||o[15]!==s||o[16]!==m||o[17]!==c||o[18]!==l||o[19]!==u||o[20]!==a||o[21]!==r?(e=e=>B(g,{id:String(e.id),component:"div",hover:!0,selected:s(e)||d(e),onClick:l?()=>h(e):()=>m?.(e),onContextMenu:p,"aria-label":`table-row-${e.id}`,sx:{minHeight:56,animation:"fadeIn 0.2s ease-in-out forwards",opacity:0,"&:hover":{cursor:"pointer",transition:"background-color 0s ease"}},children:[l&&z(L,{component:"div",padding:"checkbox",onClick:V,sx:{height:P[a],...N({theme:u,sticky:"left"})},children:z(i,{color:"primary",onChange:()=>h(e),checked:s(e),icon:z(k,{size:22}),checkedIcon:z(I,{size:22})})},`checkbox-${e.id}`),r.map((t,i)=>{if(!1===t.columnOptions?.visible)return null;const o=!l&&i===r.length-1&&c;return z(E,{row:e,column:t,variant:a,showNavigateIcon:o},`custom-cell-${t.accessor}`)})]},`table-row-${e.id}`),o[12]=h,o[13]=p,o[14]=d,o[15]=s,o[16]=m,o[17]=c,o[18]=l,o[19]=u,o[20]=a,o[21]=r,o[22]=e):e=o[22],b=n.filter(J).filter(X).map(e),o[0]=n,o[1]=h,o[2]=p,o[3]=d,o[4]=s,o[5]=m,o[6]=c,o[7]=l,o[8]=u,o[9]=a,o[10]=r,o[11]=b}else b=o[11];return b}function V(e){e.stopPropagation()}function X(e,t,i){return i.findIndex(t=>t.id===e.id)===t}function J(e){return null!=e}function K(t){const i=e(32),{contextMenu:n,selectedContextRow:m,contextMenuActionList:h,actionHeaderList:p,onContextMenuAction:u,onActionHeader:f,activeFilters:b,tableActionsActive:x,handleCloseContextMenu:v}=t;let g;i[0]!==b?(g=void 0===b?[]:b,i[0]=b,i[1]=g):g=i[1];const w=g,k=null!==n&&!x;let C,S,R,I,W,T,M,$;return i[2]!==v?(C=e=>{e.preventDefault(),v()},i[2]=v,i[3]=C):C=i[3],i[4]!==n?(S=null!==n?{top:n.mouseY,left:n.mouseX}:void 0,i[4]=n,i[5]=S):S=i[5],i[6]===Symbol.for("react.memo_cache_sentinel")?(R={minWidth:100,maxWidth:240,p:0,outline:"none","& .MuiMenuItem-root":{gap:.5},"& .MuiListItemText-root":{overflow:"hidden",maxWidth:"100%"},"& .MuiListItemText-root .MuiTypography-root":{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"block",maxWidth:"100%"}},i[6]=R):R=i[6],i[7]!==w||i[8]!==h||i[9]!==v||i[10]!==u||i[11]!==m?(I=h?.map((e,t)=>B(s,{onClick:()=>{u&&m&&u(e.type,[m],w),v()},children:[e.icon&&z(l,{children:z(r,{color:e.color||"inherit",disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,sx:{p:0},children:e.icon})}),z(a,{children:z(y,{variant:"body2",color:e.color||"inherit",noWrap:!0,title:e.label,children:e.label})})]},`context-header-item-${t}`)),i[7]=w,i[8]=h,i[9]=v,i[10]=u,i[11]=m,i[12]=I):I=i[12],i[13]!==p||i[14]!==h.length?(W=h.length>0&&p.length>0&&z(o,{}),i[13]=p,i[14]=h.length,i[15]=W):W=i[15],i[16]!==p||i[17]!==w||i[18]!==v||i[19]!==f||i[20]!==m?(T=p?.map((e,t)=>B(s,{onClick:()=>{f&&m&&f(e.type,[m],w),v()},children:[e.icon&&z(l,{children:z(r,{color:e.color||"inherit",disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,sx:{p:0},children:e.icon})}),z(a,{children:z(y,{variant:"body2",color:e.color||"inherit",noWrap:!0,title:e.label,children:e.label})})]},`context-menu-item-${t}`)),i[16]=p,i[17]=w,i[18]=v,i[19]=f,i[20]=m,i[21]=T):T=i[21],i[22]!==I||i[23]!==W||i[24]!==T?(M=B(d,{sx:R,children:[I,W,T]}),i[22]=I,i[23]=W,i[24]=T,i[25]=M):M=i[25],i[26]!==v||i[27]!==M||i[28]!==k||i[29]!==C||i[30]!==S?($=z(c,{open:k,onClose:v,onContextMenu:C,anchorReference:"anchorPosition",anchorPosition:S,children:M}),i[26]=v,i[27]=M,i[28]=k,i[29]=C,i[30]=S,i[31]=$):$=i[31],$}export{Q as BlankTableRow,E as DynamicCellCreator,D as EmtpyTableBody,O as ROW_HEIGHT,Y as SkeletonRows,L as StyledTableCell,q as TableCommonHeader,K as TableContextMenu,G as TableDataRows,H as getMaxWidth,j as getNestedProperty,N as getStickyStyle,_ as stickyTableContainerClassName,F as useStickyTableOverflow,P as variantHeightMap};
|