@famalabs/web-ui 1.0.0-beta.29 → 1.0.0-beta.30
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.
- package/dist/components/tables/RealtimeTable/RealTimeTableBody.js +1 -1
- package/dist/components/tables/RealtimeTable/RealtimeTable.js +1 -1
- package/dist/components/tables/RealtimeTable/RealtimeTableTypes.d.ts +1 -0
- package/dist/components/tables/TableComponents/TableCommonBody.js +1 -1
- package/package.json +1 -2
|
@@ -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{TableCommonHeaderProps as c,EmtpyTableBody as a,SkeletonRows as r,TableDataRows as s,TableContextMenu as d,BlankTableRow as m}from"../TableComponents/TableCommonBody.js";import{jsx as u,jsxs as b}from"react/jsx-runtime";function h(h){const v=e(
|
|
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{TableCommonHeaderProps as c,EmtpyTableBody as a,SkeletonRows as r,TableDataRows as s,TableContextMenu as d,BlankTableRow as m}from"../TableComponents/TableCommonBody.js";import{jsx as u,jsxs as b}from"react/jsx-runtime";function h(h){const v=e(77),{tableData:g,activeFilters:f,onFiltersChange:p,visibleColumns:C,tableActions:w,tableActionsActive:A,quickSelectedRows:S,setQuickSelectedRows:T,rowsPerPage:x,isFetching:y,onRowClick:k,autoSizeHeight:R,emptyTablePlaceholder:P,isTableEmpty:F,hideFooter:M,showNavigateIcon:L,variant:q,localeStr:B}=h,[_,H]=n.useState(!1);let I,N,Q;v[0]!==y?(I=()=>{let e;if(y)return e=setTimeout(()=>{H(!0)},200),()=>clearTimeout(e);e=setTimeout(()=>{H(!1)},0)},N=[y],v[0]=y,v[1]=I,v[2]=N):(I=v[1],N=v[2]),l(I,N),v[3]!==w?(Q=w||{},v[3]=w,v[4]=Q):Q=v[4];const{quickActions:X,contextMenuActions:Y}=Q;let j;v[5]!==X?(j=X||{},v[5]=X,v[6]=j):j=v[6];const{actionList:D,onAction:W}=j;let z;v[7]!==D?(z=void 0===D?[]:D,v[7]=D,v[8]=z):z=v[8];const E=z;let G;v[9]!==Y?(G=Y||{},v[9]=Y,v[10]=G):G=v[10];const{actionList:J,onAction:K}=G;let O;v[11]!==J?(O=void 0===J?[]:J,v[11]=J,v[12]=O):O=v[12];const U=O,[V,Z]=n.useState(void 0),[$,ee]=n.useState(null);let te;v[13]!==E||v[14]!==$||v[15]!==U||v[16]!==A||v[17]!==g?(te=e=>{if(A)return;if(0===E.length&&0===U.length)return;e.preventDefault();const t=e.currentTarget.getAttribute("id");if(t){const e=g.find(e=>String(e.id)===t);Z(e)}else Z(void 0);ee(null===$?{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)})}},v[13]=E,v[14]=$,v[15]=U,v[16]=A,v[17]=g,v[18]=te):te=v[18];const oe=te;let ie;v[19]===Symbol.for("react.memo_cache_sentinel")?(ie=()=>{ee(null),Z(void 0)},v[19]=ie):ie=v[19];const ne=ie;let le;v[20]!==x||v[21]!==g?(le=x>0?g.slice(0,x):g,v[20]=x,v[21]=g,v[22]=le):le=v[22];const ce=le,ae=R?5-ce.length||0:x-ce.length;let re;v[23]!==S?(re=e=>S.some(t=>t.id===e.id),v[23]=S,v[24]=re):re=v[24];const se=re;let de;v[25]!==V?.id?(de=e=>V?.id===e.id,v[25]=V?.id,v[26]=de):de=v[26];const me=de;let ue;v[27]!==T?(ue=e=>{T(t=>t.some(t=>t.id===e.id)?t.filter(t=>t.id!==e.id):[...t,e])},v[27]=T,v[28]=ue):ue=v[28];const be=ue,he=F?"div":n.Fragment,ve=F?"visible":"auto";let ge,fe,pe,Ce,we,Ae,Se,Te;return v[29]!==ve?(ge={bgcolor:"background.paper",tableLayout:"fixed",width:"100%",overflowY:ve,scrollbarWidth:"thin",scrollbarColor:"silver transparent"},v[29]=ve,v[30]=ge):ge=v[30],v[31]===Symbol.for("react.memo_cache_sentinel")?(fe={overflowX:"auto",minWidth:150,"@keyframes fadeIn":{"0%":{opacity:0},"100%":{opacity:1}}},v[31]=fe):fe=v[31],v[32]!==F?(pe=F?{role:"table",style:{display:"table",width:"100%"}}:{},v[32]=F,v[33]=pe):pe=v[33],v[34]!==f||v[35]!==ce||v[36]!==B||v[37]!==p||v[38]!==S||v[39]!==T||v[40]!==A||v[41]!==C?(Ce=u(c,{currentPageRows:ce,visibleColumns:C,quickActions:A,quickSelectedRows:S,setQuickSelectedRows:T,activeFilters:f,onFiltersChange:p,localeStr:B}),v[34]=f,v[35]=ce,v[36]=B,v[37]=p,v[38]=S,v[39]=T,v[40]=A,v[41]=C,v[42]=Ce):Ce=v[42],v[43]!==he||v[44]!==pe||v[45]!==Ce?(we=u(he,{...pe,children:Ce}),v[43]=he,v[44]=pe,v[45]=Ce,v[46]=we):we=v[46],v[47]!==E||v[48]!==f||v[49]!==ae||v[50]!==$||v[51]!==U||v[52]!==ce||v[53]!==P||v[54]!==be||v[55]!==oe||v[56]!==M||v[57]!==me||v[58]!==se||v[59]!==F||v[60]!==W||v[61]!==K||v[62]!==k||v[63]!==x||v[64]!==V||v[65]!==L||v[66]!==_||v[67]!==A||v[68]!==q||v[69]!==C?(Ae=F?u(a,{rowsPerPage:x,emptyTablePlaceholder:P,hideFooter:M}):b(o,{component:"div",children:[_?u(r,{rowsPerPage:x,tableActionsActive:A,visibleColumns:C,variant:q}):u(s,{currentPageRows:ce,visibleColumns:C,tableActionsActive:A,variant:q,isQuickSelected:se,isContextSelected:me,onRowClick:k,handleCheckBoxSelect:be,handleContextMenu:oe,showNavigateIcon:L}),u(d,{contextMenu:$,selectedContextRow:V,contextMenuActionList:U,actionHeaderList:E,onContextMenuAction:K,onActionHeader:W,activeFilters:f,tableActionsActive:A,handleCloseContextMenu:ne}),!_&&ae>0&&u(m,{blankRows:ae})]}),v[47]=E,v[48]=f,v[49]=ae,v[50]=$,v[51]=U,v[52]=ce,v[53]=P,v[54]=be,v[55]=oe,v[56]=M,v[57]=me,v[58]=se,v[59]=F,v[60]=W,v[61]=K,v[62]=k,v[63]=x,v[64]=V,v[65]=L,v[66]=_,v[67]=A,v[68]=q,v[69]=C,v[70]=Ae):Ae=v[70],v[71]!==we||v[72]!==Ae?(Se=b(t,{component:"div",sx:fe,children:[we,Ae]}),v[71]=we,v[72]=Ae,v[73]=Se):Se=v[73],v[74]!==ge||v[75]!==Se?(Te=u(i,{className:"RealTimeTable-Body",sx:ge,children:Se}),v[74]=ge,v[75]=Se,v[76]=Te):Te=v[76],Te}export{h as RealTimeTableBody};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"react/compiler-runtime";import t from"@mui/material/Grid";import o,{useEffectEvent as
|
|
1
|
+
import{c as e}from"react/compiler-runtime";import t from"@mui/material/Grid";import o,{useEffectEvent as a,useEffect as r}from"react";import{TableActionHeader as s}from"../TableComponents/TableActionHeader.js";import{TableFilterHeader as i}from"../TableComponents/TableFilterHeader.js";import{loadSavedColumns as n,parseFiltersQuery as l,buildFiltersQuery as c,buildRequestFilters as u}from"../TableComponents/TableFunctions.js";import{localizedTableStrings as m}from"../TableComponents/TableLocales.js";import{RealTimeTableBody as d}from"./RealTimeTableBody.js";import{RealTimeTableFooter as h}from"./RealTimeTableFooter.js";import{jsx as f,jsxs as b}from"react/jsx-runtime";function p(p){const v=e(120),{tableInfo:g,fetchInfo:C,filtersQuery:w,tableActions:S,tableButtons:F,onRowClick:R,onRowsPerPageChange:y,onColumnsPopoverClose:T,tableLocale:P,localeStr:k}=p,x=void 0===w?"":w,A=void 0===P?"en":P,{tableName:B,tableData:D,columns:N,savedVisibleColumns:j,expectedRowCount:q,currentPage:H,variant:_,defaultShowFilters:z,showRefreshButton:I,emptyTablePlaceholder:V,showVisibleColumnsButton:L,paginationOptions:Q,showNavigateIcon:E}=g;let G;v[0]!==D?(G=void 0===D?[]:D,v[0]=D,v[1]=G):G=v[1];const O=G,J=void 0===H?0:H,K=void 0===_?"standard":_,M=void 0===I||I,U=void 0===L||L;let W;v[2]!==Q?(W=void 0===Q?{}:Q,v[2]=Q,v[3]=W):W=v[3];const X=W,Y=void 0===E||E,{stickyHeader:Z,stickyFooter:$,customPageRowCount:ee,customSelectPages:te,autoSizeHeight:oe,hideFooter:ae,footerVariant:re}=X,se=void 0===Z||Z,ie=void 0===$||$,ne=void 0===oe||oe,le=void 0!==ae&&ae,ce=void 0===re?"standard":re,{fetchData:ue,fetchAllData:me,isDataLoading:de,areColumnsLoading:he}=C;let fe;v[4]!==S?(fe=S||{},v[4]=S,v[5]=fe):fe=v[5];const{quickActions:be}=fe;let pe;v[6]!==F?(pe=F||{},v[6]=F,v[7]=pe):pe=v[7];const{refreshButton:ve}=pe,ge=m[A];let Ce;v[8]!==k||v[9]!==ge?(Ce={...ge,...k},v[8]=k,v[9]=ge,v[10]=Ce):Ce=v[10];const we=Ce;let Se;v[11]!==N||v[12]!==j?(Se=n(N,j),v[11]=N,v[12]=j,v[13]=Se):Se=v[13];const[Fe,Re]=o.useState(Se);let ye;v[14]!==N||v[15]!==j?(ye=()=>{Re(n(N,j))},v[14]=N,v[15]=j,v[16]=ye):ye=v[16];const Te=a(ye);let Pe,ke;v[17]!==Te?(Pe=()=>{Te()},v[17]=Te,v[18]=Pe):Pe=v[18],v[19]!==N?(ke=[N],v[19]=N,v[20]=ke):ke=v[20],r(Pe,ke);const[xe,Ae]=o.useState(Number(ee)||Number(q)),Be=o.useRef("");let De;v[21]!==N||v[22]!==x||v[23]!==B?(De=l(B,x,N),v[21]=N,v[22]=x,v[23]=B,v[24]=De):De=v[24];const Ne=De,[je,qe]=o.useState(!1);let He;v[25]===Symbol.for("react.memo_cache_sentinel")?(He={prev:!1,next:!1},v[25]=He):He=v[25];const[_e,ze]=o.useState(He),Ie=o.useRef(!0);let Ve,Le,Qe;v[26]===Symbol.for("react.memo_cache_sentinel")?(Ve=()=>(Ie.current=!0,()=>{Ie.current=!1}),Le=[],v[26]=Ve,v[27]=Le):(Ve=v[26],Le=v[27]),r(Ve,Le),v[28]!==Ne||v[29]!==ue||v[30]!==xe||v[31]!==B?(Qe=async(e,t)=>{const o=t?.rows??xe,a=t?.active??Ne,r=t?.query??c(B,a),s=t?.filterDto??u(a);qe(!0);const{next:i,prev:n}=await ue({filters:{query:r,active:a,filterDto:s},limit:o,direction:e});Ie.current&&(Be.current=r,ze({next:i,prev:n}),qe(!1))},v[28]=Ne,v[29]=ue,v[30]=xe,v[31]=B,v[32]=Qe):Qe=v[32];const Ee=Qe,Ge=a(Ee);let Oe,Je,Ke;v[33]!==he||v[34]!==Ge?(Oe=()=>{he||Ge()},v[33]=he,v[34]=Ge,v[35]=Oe):Oe=v[35],v[36]!==he?(Je=[he],v[36]=he,v[37]=Je):Je=v[37],r(Oe,Je),v[38]!==Ee?(Ke=async e=>{Ee("reset",{active:e})},v[38]=Ee,v[39]=Ke):Ke=v[39];const Me=Ke;let Ue;v[40]!==Ne||v[41]!==je||v[42]!==x||v[43]!==Ee||v[44]!==B?(Ue=()=>{if(je||""===x)return;const e=c(B,Ne);e!==Be.current&&Ee("reset",{query:e})},v[40]=Ne,v[41]=je,v[42]=x,v[43]=Ee,v[44]=B,v[45]=Ue):Ue=v[45];const We=a(Ue);let Xe,Ye,Ze;v[46]!==We?(Xe=()=>{We()},v[46]=We,v[47]=Xe):Xe=v[47],v[48]!==x?(Ye=[x],v[48]=x,v[49]=Ye):Ye=v[49],r(Xe,Ye),v[50]!==Ee||v[51]!==y?(Ze=e=>{const t=Number(e.target.value);Ae(t),y?.(t),Ee("reset",{rows:t})},v[50]=Ee,v[51]=y,v[52]=Ze):Ze=v[52];const $e=Ze,[et,tt]=o.useState(!1);let ot;v[53]===Symbol.for("react.memo_cache_sentinel")?(ot=[],v[53]=ot):ot=v[53];const[at,rt]=o.useState(ot),st=Boolean(de||he),it=!st&&(0===q||0===O.length),nt=se?"sticky":"static";let lt,ct,ut,mt,dt,ht,ft;return v[54]!==nt?(lt={position:nt,top:0,zIndex:2,backgroundColor:"background.paper",borderRadius:"8px 8px 0 0"},v[54]=nt,v[55]=lt):lt=v[55],v[56]!==Ne||v[57]!==N||v[58]!==we.filters||v[59]!==z||v[60]!==Ee||v[61]!==st||v[62]!==Me||v[63]!==ve||v[64]!==M?(ct=f(i,{columns:N,activeFilters:Ne,onFiltersChange:Me,handleFetchData:Ee,isFetching:st,defaultShowFilters:z,refreshButton:ve,showRefreshButton:M,localeStr:we.filters}),v[56]=Ne,v[57]=N,v[58]=we.filters,v[59]=z,v[60]=Ee,v[61]=st,v[62]=Me,v[63]=ve,v[64]=M,v[65]=ct):ct=v[65],v[66]!==Ne||v[67]!==Fe||v[68]!==we.header||v[69]!==q||v[70]!==me||v[71]!==st||v[72]!==T||v[73]!==be||v[74]!==at||v[75]!==U||v[76]!==et||v[77]!==F||v[78]!==B?(ut=f(s,{tableName:B,expectedRowCount:q,currentColumns:Fe,setCurrentColumns:Re,fetchAllData:me,isFetching:st,quickActions:be,tableActionsActive:et,setQuickActions:tt,quickSelectedRows:at,setQuickSelectedRows:rt,activeFilters:Ne,tableButtons:F,onColumnsPopoverClose:T,showVisibleColumnsButton:U,localeStr:we.header}),v[66]=Ne,v[67]=Fe,v[68]=we.header,v[69]=q,v[70]=me,v[71]=st,v[72]=T,v[73]=be,v[74]=at,v[75]=U,v[76]=et,v[77]=F,v[78]=B,v[79]=ut):ut=v[79],v[80]!==lt||v[81]!==ct||v[82]!==ut?(mt=b(t,{className:"RealTimeTable-Header",component:"div",container:!0,size:12,"data-sticky":!0,sx:lt,children:[ct,ut]}),v[80]=lt,v[81]=ct,v[82]=ut,v[83]=mt):mt=v[83],v[84]!==Ne||v[85]!==ne||v[86]!==Fe||v[87]!==we.filters||v[88]!==V||v[89]!==le||v[90]!==st||v[91]!==it||v[92]!==Me||v[93]!==R||v[94]!==at||v[95]!==xe||v[96]!==Y||v[97]!==S||v[98]!==et||v[99]!==O||v[100]!==K?(dt=f(d,{tableData:O,activeFilters:Ne,onFiltersChange:Me,visibleColumns:Fe,rowsPerPage:xe,tableActionsActive:et,quickSelectedRows:at,setQuickSelectedRows:rt,tableActions:S,isFetching:st,onRowClick:R,autoSizeHeight:ne,emptyTablePlaceholder:V,isTableEmpty:it,hideFooter:le,variant:K,showNavigateIcon:Y,localeStr:we.filters}),v[84]=Ne,v[85]=ne,v[86]=Fe,v[87]=we.filters,v[88]=V,v[89]=le,v[90]=st,v[91]=it,v[92]=Me,v[93]=R,v[94]=at,v[95]=xe,v[96]=Y,v[97]=S,v[98]=et,v[99]=O,v[100]=K,v[101]=dt):dt=v[101],v[102]!==we.footer||v[103]!==J||v[104]!==te||v[105]!==q||v[106]!==ce||v[107]!==$e||v[108]!==Ee||v[109]!==le||v[110]!==st||v[111]!==it||v[112]!==_e||v[113]!==xe||v[114]!==ie?(ht=f(h,{currentPage:J,handleFetchData:Ee,nextFetch:_e,isFetching:st,hideFooter:le,stickyFooter:ie,isTableEmpty:it,expectedRowCount:q,rowsPerPage:xe,handleChangeRowsPerPage:$e,customSelectPages:te,localeStr:we.footer,footerVariant:ce}),v[102]=we.footer,v[103]=J,v[104]=te,v[105]=q,v[106]=ce,v[107]=$e,v[108]=Ee,v[109]=le,v[110]=st,v[111]=it,v[112]=_e,v[113]=xe,v[114]=ie,v[115]=ht):ht=v[115],v[116]!==mt||v[117]!==dt||v[118]!==ht?(ft=b(t,{container:!0,size:12,spacing:0,children:[mt,dt,ht]}),v[116]=mt,v[117]=dt,v[118]=ht,v[119]=ft):ft=v[119],ft}export{p as RealtimeTable};
|
|
@@ -25,6 +25,7 @@ interface FetchInfoProps<T> {
|
|
|
25
25
|
}
|
|
26
26
|
interface RealtimeTableInfoProps<T> extends TableInfoProps<T> {
|
|
27
27
|
savedVisibleColumns?: string[];
|
|
28
|
+
showNavigateIcon?: boolean;
|
|
28
29
|
}
|
|
29
30
|
interface RealtimeTableProps<T> extends CommonTableProps<T> {
|
|
30
31
|
tableInfo: RealtimeTableInfoProps<T>;
|
|
@@ -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 B(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 F({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=B(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()&&(console.log("Checking overflow for cell value:",u),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 j,N,q,D,Q,Y;return o[10]!==H||o[11]!==d?(j=F({theme:d,sticky:H}),o[10]=H,o[11]=d,o[12]=j):j=o[12],o[13]!==p||o[14]!==S||o[15]!==j?(N={position:"relative",height:S,maxWidth:p,".MuiTableRow-root:hover & .show-navigate":$,".show-navigate":P,...j},o[13]=p,o[14]=S,o[15]=j,o[16]=N):N=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]!==N||o[29]!==Q?(Y=z(_,{ref:v,component:"div",sx:N,children:Q}),o[28]=N,o[29]=Q,o[30]=Y):Y=o[30],Y}function j(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,[j,N]=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),N(e.currentTarget)},l[10]=Q):Q=l[10];const Y=Q;let E;l[11]===Symbol.for("react.memo_cache_sentinel")?(E=()=>{N(null),D(null)},l[11]=E):E=l[11];const G=E,V=Boolean(j&&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:{...F({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=B(e);return!1===e.columnOptions?.visible?null:O(_,{component:"div",sx:{width:160,position:"relative",maxWidth:o,...F({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]!==j||l[36]!==V||l[37]!==te?(ie=z(d,{open:V,anchorEl:j,onClose:G,anchorOrigin:Z,slotProps:ee,children:te}),l[35]=j,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 N(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=B(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(21),{currentPageRows:n,visibleColumns:r,tableActionsActive:l,variant:a,isQuickSelected:c,isContextSelected:s,onRowClick:m,handleCheckBoxSelect:d,handleContextMenu:p}=t,h=f();let u;if(o[0]!==n||o[1]!==d||o[2]!==p||o[3]!==s||o[4]!==c||o[5]!==m||o[6]!==l||o[7]!==h||o[8]!==a||o[9]!==r){let e;o[11]!==d||o[12]!==p||o[13]!==s||o[14]!==c||o[15]!==m||o[16]!==l||o[17]!==h||o[18]!==a||o[19]!==r?(e=e=>O(x,{id:String(e.id),component:"div",hover:!0,selected:c(e)||s(e),onClick:l?()=>d(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(_,{component:"div",padding:"checkbox",onClick:Y,sx:{height:A[a],...F({theme:h,sticky:"left"})},children:z(i,{color:"primary",onChange:()=>d(e),checked:c(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&&Boolean(m);return z(H,{row:e,column:t,variant:a,showNavigateIcon:o},`custom-cell-${t.accessor}`)})]},`table-row-${e.id}`),o[11]=d,o[12]=p,o[13]=s,o[14]=c,o[15]=m,o[16]=l,o[17]=h,o[18]=a,o[19]=r,o[20]=e):e=o[20],u=n.filter(G).filter(E).map(e),o[0]=n,o[1]=d,o[2]=p,o[3]=s,o[4]=c,o[5]=m,o[6]=l,o[7]=h,o[8]=a,o[9]=r,o[10]=u}else u=o[10];return u}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,N as EmtpyTableBody,P as ROW_HEIGHT,D as SkeletonRows,_ as StyledTableCell,j as TableCommonHeaderProps,V as TableContextMenu,Q as TableDataRows,B as getMaxWidth,L as getNestedProperty,F 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 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};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@famalabs/web-ui",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.30",
|
|
4
4
|
"author": " Fama Labs <info@famalabs.com>",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
"lucide-react": ">=0.563.0 || ^1.0.0",
|
|
28
28
|
"motion": "^12.34.0",
|
|
29
29
|
"notistack": "^3.0.2",
|
|
30
|
-
"qs": "^6.15.0",
|
|
31
30
|
"react": "^19.2.4",
|
|
32
31
|
"react-dom": "^19.2.4",
|
|
33
32
|
"react-hook-form": "^7.71.0",
|