@lax-wp/design-system 0.13.57 → 0.13.58

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,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("react"),pi=require("../../../../../constants/table.cjs.js"),$i=require("../../../../../providers/design-system-provider/hooks.cjs.js"),Mi=require("@dnd-kit/core"),wi=require("@dnd-kit/sortable"),ie=require("@dnd-kit/utilities"),Fi=require("@mui/icons-material"),ee=require("@mui/icons-material/AddRounded"),Ei=require("../../../../../_virtual/index.cjs.js"),ne=require("react-dom"),Ni=require("../../context.cjs.js"),te=require("../cell/ActionCell.cjs.js"),le=require("../cell/CheckboxCell.cjs.js"),ae=require("../cell/DataCell.cjs.js"),Hi=require("../../validateCell.cjs.js"),se=require("../cell/LoaderCell.cjs.js"),oe=require("../cell/PendingEditCell.cjs.js"),de=require("../cell/RowActionCell.cjs.js"),re=require("../cell/RowOptionsCell.cjs.js"),ge=({row:i,isLastRow:$,lastRow:w,highlightSubstring:ii,index:z,style:Ci,level:e=0,expandedRows:c,rows:ei})=>{const{lastNonStickyColumnIndex:M,checkboxConfig:s,onRowClick:E,rowOptions:b,disableOptionsForRowIndex:F=null,getSumOfNextVisibleColumnWidth:ni,onRowEdit:H,inlineEditColumns:xi,tableActions:ti,dndSortableUtils:li,withSortable:f,withDraggable:N,getInnerRowData:ai,showNewItem:W,rawData:O,dragConfig:p,getFullRowDataOnClick:si,selectedRowId:r,rowWrapper:U,isCellClickDisabled:vi,rowAdditionalActions:j,hoverConfig:oi,addPendingEdit:D,removePendingEdit:P,fieldOperationLoading:di,clearRowPendingEdits:q,saveRowPendingEdits:K,pendingEdits:A}=l.useContext(Ni.TableContext),B=$i.useTableConfig(),ri=!!s,{activeInlineEdit:gi,setActiveInlineEdit:L}=l.useContext(Ni.TableContext),a=gi?.rowId===i.original.id?gi?.columnKey:null,u=!!a,ci=n=>{L?.(n===null?null:{rowId:String(i.original.id),columnKey:n})},[C,Y]=l.useState(null),[ui,_]=l.useState(null),[R,G]=l.useState(null),[x,S]=l.useState(!1),[y,J]=l.useState(!1),_i=l.useRef(null);l.useEffect(()=>{const n=_i.current,g=a;if(n&&!g){const h=A?.[i.original.id]?.[n];if(h){const d=i.cells?.find(m=>m.column?.key===n);if(d){const m=Hi.validateCellValue(h.value,d.column);!m.isValid&&D&&D(String(i.original.id),n,{...h,validationError:m.error})}}}_i.current=g??null},[a,i.original.id,i.cells,A,D]),l.useEffect(()=>{if(O){const n=String(i?.original?.id);G(O[n]?.[i?.cells[0].column.Header]||O[n]?.[0])}},[O,i?.original?.id,i?.cells]);const o=wi.useSortable({id:i.original.id,data:{...i.original},disabled:!f}),v=Mi.useDraggable({id:i.original.id,data:{...i.original},disabled:!!f}),{listeners:fi,transform:mi,setNodeRef:bi,isDragging:T,attributes:hi,active:V,over:I,...Ui}=f?o:v,{setNodeRef:ji}=Mi.useDroppable({id:`table-file-dropzone-${i?.original?.id}`,data:{type:"table-file-dropzone",folderId:i?.original?.id,isFolder:i?.original?.type==="folder"}}),Ki={transform:ie.CSS.Transform.toString(mi),transition:f?Ui.transition:void 0,cursor:T?"grabbing":"grab",opacity:T?"0.5":"1"},Yi=()=>!V||!I||!f?!1:li?.checkOverEachItem?li.checkOverEachItem(V,I)&&!!I:V.data.current?.type!==I.data.current?.type&&!!I,Di=n=>{_(n.target.value)},Gi=()=>{di||ci(null)},Ri=l.useRef(null),Ii=l.useCallback(n=>{Ri.current=n},[]),Pi=l.useRef(B);Pi.current=B;const Bi=l.useCallback(()=>{q&&q(String(i.original.id))},[q,i.original.id]),Oi=l.useCallback(()=>{if(Ri.current){const n=Ri.current();if(!n.isValid)return;a&&n.value!==void 0&&D&&D(String(i.original.id),a,{value:n.value,originalValue:i.original[a],meta:n.meta||void 0})}else if(a){const n=i.cells?.find(g=>g.column?.key===a);if(n){const g=A?.[i.original.id]?.[a]?.value,h=g!==void 0?g:n.value,d=Hi.validateCellValue(h,n.column);if(!d.isValid){Pi.current?.showNotification?.("error",d.error||"Validation failed");return}}}K&&K(String(i.original.id))},[K,i.original,i.cells,a,D,A]),qi=(n,g)=>{const h={...i.original},d=n!==void 0?n:ui;a&&d!==void 0&&(h[a]=d,H&&H(h,z,a,d,g),P&&P(String(i.original.id),a)),Gi()},Ai=l.useRef(null),Li=(n,g,h,d)=>{if(!vi&&(n?.stopPropagation(),a!==d)){if(H){if(xi?.includes(d))ci(d),_(String(i.original[d]));else{const m=B?.getSystemMessage?.("notAllowedInlineEdit")||"Inline Edit is not allowed for this column";B?.showNotification?.("error",m)}return}if(E)E(g,h,i.original,ei?.map(m=>m.original)||[]);else if(!E&&s){const m=i.original.id,Zi={target:{checked:!s.checkedIds.includes(m)}};s.onItemCheck(Zi,m)}}},Ti=async()=>{S(!0),ai&&await ai(i?.original?.id,i?.original,!(c?.[i?.original?.id]?.isOpen??!1),i?.original?.__level||0),S(!1)},Ji=l.useMemo(()=>i.cells.filter(n=>n.column?.visible).map(n=>n.column?.width??0).reduce((n,g)=>n+g,0),[i.cells]),Q=l.useMemo(()=>p?.draggingOver&&p?.draggingOver===i?.original?.id,[p,i?.original?.id]),Si=l.useMemo(()=>Q?p?.dropPosition||"inside":null,[Q,p?.dropPosition]),X=!!(Q&&Si==="inside"),k=i?.original?.__rowMetadata||i?.original?._meta,Z=C!==i?.original?.id,yi=!i?.original?.__isLoading,Vi=!!(k?.__is_new||k?.__is_added||i?.original?.is_added||R?.is_added||k?.is_added||k?.is_new),Qi=!!(i?.original?.is_deleted||k?.__is_deleted||R?.is_deleted||k?.is_deleted),Xi=!!(i?.original?.is_modified||i?.original?.is_row_modified||k?.__is_modified||k?.__is_edited||R?.is_row_modified||k?.is_modified)&&!Vi,ki=r!=null&&String(r)===String(i?.original?.id),zi=Ei({"bg-neutral-100 dark:bg-black-600":C===i?.original?.id&&!u,"bg-primary-100 dark:bg-primary-950":ki&&Z&&!u,"bg-primary-50 dark:bg-black-700":!i?.original?.is_read&&W&&!i?.original?.__isLoading&&Z&&!u,"bg-warning-50 dark:bg-warning-975":Xi&&yi&&Z&&!u,"bg-error-50 dark:bg-error-975":Qi&&yi&&Z&&!u,"bg-success-50 dark:bg-success-975":Vi&&yi&&Z&&!u,"bg-primary-50 dark:bg-primary-900":u,[pi.getTableRowBgClassNamesByStatus[i?.original?.__rowBgStatus]]:i?.original?.__rowBgStatus&&!u});return l.createElement("tr",{...i.getRowProps(),ref:N||f?bi:null,key:i.original.id,"data-row-id":i.original.id,className:Ei(`text-neutral-900 dark:text-white cursor-pointer min-w-full relative ${s?.selectionDisabledRowIds?.includes(i?.original?.id)?"opacity-50":""} border-t`,T?"z-40":"",Yi()?"shadow-dnd-drop":"",N&&I&&I?.data?.current?.type==="table-file-dropzone"&&I?.data?.current?.folderId===i?.original?.id&&i?.original?.type==="folder"?"bg-primary-50":"",i?.original?.isDefinedActionRow?"bg-primary-50":"",X?"z-50":"",zi||"bg-white dark:bg-black-800"),style:{...Ci,...f?Ki:{},width:"max-content"},...N||f?hi:{},...N||f?fi:{}},X&&p?.dragOperation?t.jsx("div",{className:"absolute right-2 h-row flex items-center z-20 pointer-events-none",children:t.jsx("div",{className:"bg-primary-200 px-2 py-1 rounded",children:p?.dragOperation==="COPY"?t.jsx(ee,{sx:{fontSize:12},className:"text-primary-700"}):t.jsx(Fi.SubdirectoryArrowLeftRounded,{sx:{fontSize:12},className:"text-primary-700"})})}):null,X&&!p?.dragOperation?t.jsx("div",{className:"absolute right-2 h-row flex items-center z-20 pointer-events-none",children:t.jsx(Fi.SubdirectoryArrowLeftRounded,{sx:{fontSize:16},className:"text-primary-500"})}):null,Q&&Si==="before"&&!i?.original?.isDefinedActionRow?t.jsx("div",{className:"absolute -top-[1px] left-0 right-0 h-[2px] bg-primary-500 z-20 pointer-events-none",children:t.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-2 h-2 rounded-full bg-primary-500"})}):null,Q&&Si==="after"&&!i?.original?.isDefinedActionRow?t.jsx("div",{className:"absolute -bottom-[1px] left-0 right-0 h-[2px] bg-primary-500 z-20 pointer-events-none",children:t.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-2 h-2 rounded-full bg-primary-500"})}):null,i?.original?.isDefinedActionRow?t.jsx(te.ActionCell,{cells:i.cells,id:i?.original?.id,isCheckbox:s,level:e,name:i?.original?.name,onClick:i?.original?.onClick,rowHovering:C||"",isRoot:i?.original?.isRoot,totalWidth:Ji,row:i.original,uploadCell:i?.original?.uploadCell,disabled:i?.original?.disabled,disabledTooltip:i?.original?.disabledTooltip}):U?t.jsx(U,{data:i.original,setIsDraggingFile:J,children:t.jsx(Wi,{isDraggingOver:X,level:e,withDraggable:N,setDroppableNodeRef:ji,isLastRow:$,lastRow:w,isCheckbox:ri,checkboxConfig:s,row:i,rowHovering:C,tableActions:ti,disableOptionsForRowIndex:F,index:z,showNewItem:W,currentData:R,lastNonStickyColumnIndex:M,getSumOfNextVisibleColumnWidth:ni,toggleRowExpand:Ti,loadingExpand:x,cellRef:Ai,handleCellClick:Li,getFullRowDataOnClick:si,handleCellValueChange:Di,handleUpdateCellData:qi,handleRowCancelEdit:Bi,handleRowConfirmEdit:Oi,registerValidation:Ii,inlineEditing:a,isInlineEditing:u,setRowHovering:Y,highlightSubstring:ii,rowOptions:b,isDraggingFile:y,rowAdditionalActions:j,hoverConfig:oi,isSelected:ki})}):t.jsx(Wi,{level:e,withDraggable:N,setDroppableNodeRef:ji,isLastRow:$,lastRow:w,isCheckbox:ri,checkboxConfig:s,row:i,rowHovering:C,tableActions:ti,disableOptionsForRowIndex:F,index:z,showNewItem:W,currentData:R,lastNonStickyColumnIndex:M,getSumOfNextVisibleColumnWidth:ni,toggleRowExpand:Ti,loadingExpand:x,cellRef:Ai,handleCellClick:Li,getFullRowDataOnClick:si,handleCellValueChange:Di,handleUpdateCellData:qi,handleRowCancelEdit:Bi,handleRowConfirmEdit:Oi,registerValidation:Ii,inlineEditing:a,isInlineEditing:u,setRowHovering:Y,highlightSubstring:ii,rowOptions:b,isDraggingFile:y,isDraggingOver:X,rowAdditionalActions:j,hoverConfig:oi,isSelected:ki}))},Wi=({withDraggable:i,setDroppableNodeRef:$,isLastRow:w,lastRow:ii,isCheckbox:z,checkboxConfig:Ci,row:e,rowHovering:c,tableActions:ei,disableOptionsForRowIndex:M,index:s,showNewItem:E,currentData:b,lastNonStickyColumnIndex:F,getSumOfNextVisibleColumnWidth:ni,toggleRowExpand:H,loadingExpand:xi,cellRef:ti,handleCellClick:li,getFullRowDataOnClick:f,handleCellValueChange:N,handleUpdateCellData:ai,handleRowCancelEdit:W,handleRowConfirmEdit:O,registerValidation:p,inlineEditing:si,isInlineEditing:r,setRowHovering:U,highlightSubstring:vi,rowOptions:j,level:oi,isDraggingFile:D,isDraggingOver:P,rowAdditionalActions:di,hoverConfig:q,isSelected:K})=>{const[A,B]=l.useState(!1),{getPendingEdit:ri,hasPendingEdit:gi,pendingEdits:L,tableHeaders:a,pendingEditsCount:u,scrollToCell:ci}=l.useContext(Ni.TableContext),C=L?.[e.original.id]&&Object.keys(L[e.original.id]).length>0,Y=(u??0)>0,ui=l.useMemo(()=>{if(Array.isArray(j))return j;if(typeof j=="function"){const o=j({...e.original,rowIndex:s});return Array.isArray(o)?o:[]}return[]},[j,e.original,s]),_=e?.original?.__rowMetadata||e?.original?._meta,R=c!==e?.original?.id,G=!e?.original?.__isLoading,x=!!(_?.__is_new||_?.__is_added||e?.original?.is_added||b?.is_added||_?.is_added||_?.is_new),S=!!(e?.original?.is_deleted||_?.__is_deleted||b?.is_deleted||_?.is_deleted),y=!!(e?.original?.is_modified||e?.original?.is_row_modified||_?.__is_modified||_?.__is_edited||b?.is_row_modified||_?.is_deleted)&&!x,J=K&&!r&&c!==e?.original?.id?"bg-primary-100 dark:bg-primary-950":void 0,_i=Ei("pointer-events-none absolute left-0 top-0 bottom-0 w-[3px] z-10",{"bg-success-400 dark:bg-success-500":x&&G&&R&&!r,"bg-error-400 dark:bg-error-500":S&&G&&R&&!r,"bg-warning-400 dark:bg-warning-500":y&&G&&R&&!r});return t.jsxs("div",{ref:i?$:null,className:P?"border-2 border-primary-400 dark:border-primary-500 rounded-sm":"",children:[t.jsx("div",{className:_i}),t.jsxs("div",{className:"flex",ref:w?ii:null,children:[Y&&t.jsx(oe.PendingEditCell,{rowId:String(e.original.id),rowIndex:s,pendingEdits:L,tableHeaders:a,rowHasPendingEdits:!!C,rowHovering:c!=null?String(c):void 0,isInlineEditing:r,is_read:!!e.original.is_read,is_modified:y,is_row_modified:!!e.original.is_row_modified,is_deleted:S,is_added:x,is_incomplete:e?.original?.status==="Incomplete",showNewItem:E,onScrollToCell:ci}),z&&t.jsx(le.CheckboxCell,{checkboxConfig:Ci,id:String(e.original.id),rowHovering:c!=null?String(c):void 0,isDisabled:!!e?.original?.__isLoading,isDraggingOver:P,is_added:x,is_deleted:S,is_incomplete:e?.original?.status==="Incomplete",is_modified:y,is_read:!!e.original.is_read,is_row_modified:!!e.original.is_row_modified,showNewItem:E,currentData:b??{},bgColor:e?.original?.__rowBgStatus?pi.getTableRowBgClassNamesByStatus[e?.original?.__rowBgStatus]:J,isInlineEditing:r,hasPendingEditsColumn:Y,rowHasPendingEdits:C}),ei?t.jsx(de.RowActionCell,{tableActions:ei,disableOptionsForRowIndex:M??null,id:String(e.original.id),index:s,is_read:!!e?.original?.is_read,is_incomplete:e?.original?.status==="Incomplete",showNewItem:!!E,is_modified:y,is_row_modified:!!e?.original?.is_row_modified,is_deleted:S,currentData:b??{},is_added:x,rowData:e.original,rowHovering:c,isDisabled:!!e?.original?.__isLoading,bgColor:D?"bg-primary-50":e?.original?.__rowBgStatus?pi.getTableRowBgClassNamesByStatus[e?.original?.__rowBgStatus]:J,isInlineEditing:r,rowHasPendingEdits:C}):null,t.jsxs("div",{className:"relative flex-1",id:`row-${e.original.id}`,onMouseEnter:()=>B(!0),onMouseLeave:()=>B(!1),children:[e.cells.filter(o=>o?.column?.visible!==!1).map((o,v)=>{const fi=v===F?.(),mi=v===(F?.()??-1)+1,bi=o?.column?.sticky?ni?.(v)??0:0;if(e.original?.__isLoading)return t.jsx(se.LoaderCell,{cell:o,id:v,nextWidthSum:bi,isLastCell:fi,rowHovering:c,index:v,isFirstStickyCell:mi},v);const T=ri?.(String(e.original.id),o?.column?.key||""),hi=gi?.(String(e.original.id),o?.column?.key||"");return t.jsx(ae.DataCell,{cell:o,rowHovering:c,isFirstStickyCell:mi,level:oi??0,toggleRowExpand:H,loadingExpand:xi,index:v,cellRef:ti,currentData:b,handleCellClick:V=>{V&&li(V,f?e.original:String(e.original.id),v,o?.column?.key||"")},handleCellValueChange:N,handleUpdateCellData:ai,registerValidation:p,id:e.original.id,inlineEditing:si,isInlineEditing:r,isLastCell:fi,is_incomplete:e?.original?.status==="Incomplete",is_added:x,is_deleted:S,is_modified:y,is_read:!!e.original.is_read,is_row_modified:!!e.original.is_row_modified,nextWidthSum:bi,setRowHovering:U,highlightSubstring:vi,isDraggingOver:P,isLoading:!!e?.original?.__isLoading,pendingEdit:T,hasPendingEdit:hi,pendingValidationError:T?.validationError},o?.column?.key)}),q?.onHover&&A&&ne.createPortal(t.jsx("div",{className:"absolute top-full left-10 z-50 bg-white dark:bg-black-800 rounded-xl",children:q.onHover(e.original)}),document.getElementById(`row-${e.original.id}`))]}),(ui.length>0||!!di)&&t.jsx(re.RowOptionsCell,{rowId:e.original.id,rowOptions:ui,disableOption:M!==null||!!e?.original?.__isLoading,rowHovering:c,setRowHovering:U,is_read:!!e.original.is_read,showNewItem:!!E,is_modified:y,is_row_modified:!!e.original.is_row_modified,is_incomplete:e?.original?.status==="Incomplete",currentData:b??{},is_deleted:S,is_added:x,isDraggingOver:!!P,rowAdditionalActions:di,rowData:e.original,index:s,bgColor:e?.original?.__rowBgStatus?pi.getTableRowBgClassNamesByStatus[e?.original?.__rowBgStatus]:J,isInlineEditing:r,onConfirmEdit:O,onCancelEdit:W,rowHasPendingEdits:C})]})]})};exports.Row=ge;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("react"),pi=require("../../../../../constants/table.cjs.js"),$i=require("../../../../../providers/design-system-provider/hooks.cjs.js"),Mi=require("@dnd-kit/core"),wi=require("@dnd-kit/sortable"),ie=require("@dnd-kit/utilities"),Fi=require("@mui/icons-material"),ee=require("@mui/icons-material/AddRounded"),Ei=require("../../../../../_virtual/index.cjs.js"),ne=require("react-dom"),Ni=require("../../context.cjs.js"),te=require("../cell/ActionCell.cjs.js"),le=require("../cell/CheckboxCell.cjs.js"),ae=require("../cell/DataCell.cjs.js"),Hi=require("../../validateCell.cjs.js"),se=require("../cell/LoaderCell.cjs.js"),oe=require("../cell/PendingEditCell.cjs.js"),de=require("../cell/RowActionCell.cjs.js"),re=require("../cell/RowOptionsCell.cjs.js"),ge=({row:i,isLastRow:$,lastRow:w,highlightSubstring:ii,index:z,style:Ci,level:e=0,expandedRows:c,rows:ei})=>{const{lastNonStickyColumnIndex:M,checkboxConfig:s,onRowClick:E,rowOptions:b,disableOptionsForRowIndex:F=null,getSumOfNextVisibleColumnWidth:ni,onRowEdit:H,inlineEditColumns:xi,tableActions:ti,dndSortableUtils:li,withSortable:f,withDraggable:N,getInnerRowData:ai,showNewItem:W,rawData:O,dragConfig:p,getFullRowDataOnClick:si,selectedRowId:r,rowWrapper:U,isCellClickDisabled:vi,rowAdditionalActions:j,hoverConfig:oi,addPendingEdit:D,removePendingEdit:P,fieldOperationLoading:di,clearRowPendingEdits:q,saveRowPendingEdits:K,pendingEdits:A}=l.useContext(Ni.TableContext),B=$i.useTableConfig(),ri=!!s,{activeInlineEdit:gi,setActiveInlineEdit:L}=l.useContext(Ni.TableContext),a=gi?.rowId===i.original.id?gi?.columnKey:null,u=!!a,ci=n=>{L?.(n===null?null:{rowId:String(i.original.id),columnKey:n})},[C,Y]=l.useState(null),[ui,_]=l.useState(null),[R,G]=l.useState(null),[x,S]=l.useState(!1),[y,J]=l.useState(!1),_i=l.useRef(null);l.useEffect(()=>{const n=_i.current,g=a;if(n&&!g){const h=A?.[i.original.id]?.[n];if(h){const d=i.cells?.find(m=>m.column?.key===n);if(d){const m=Hi.validateCellValue(h.value,d.column);!m.isValid&&D&&D(String(i.original.id),n,{...h,validationError:m.error})}}}_i.current=g??null},[a,i.original.id,i.cells,A,D]),l.useEffect(()=>{if(O){const n=String(i?.original?.id);G(O[n]?.[i?.cells[0].column.Header]||O[n]?.[0])}},[O,i?.original?.id,i?.cells]);const o=wi.useSortable({id:i.original.id,data:{...i.original},disabled:!f}),v=Mi.useDraggable({id:i.original.id,data:{...i.original},disabled:!!f}),{listeners:fi,transform:mi,setNodeRef:bi,isDragging:T,attributes:hi,active:V,over:I,...Ui}=f?o:v,{setNodeRef:ji}=Mi.useDroppable({id:`table-file-dropzone-${i?.original?.id}`,data:{type:"table-file-dropzone",folderId:i?.original?.id,isFolder:i?.original?.type==="folder"}}),Ki={transform:ie.CSS.Transform.toString(mi),transition:f?Ui.transition:void 0,cursor:T?"grabbing":"grab",opacity:T?"0.5":"1"},Yi=()=>!V||!I||!f?!1:li?.checkOverEachItem?li.checkOverEachItem(V,I)&&!!I:V.data.current?.type!==I.data.current?.type&&!!I,Di=n=>{_(n.target.value)},Gi=()=>{di||ci(null)},Ri=l.useRef(null),Ii=l.useCallback(n=>{Ri.current=n},[]),Pi=l.useRef(B);Pi.current=B;const Bi=l.useCallback(()=>{q&&q(String(i.original.id))},[q,i.original.id]),Oi=l.useCallback(()=>{if(Ri.current){const n=Ri.current();if(!n.isValid)return;a&&n.value!==void 0&&D&&D(String(i.original.id),a,{value:n.value,originalValue:i.original[a],meta:n.meta||void 0})}else if(a){const n=i.cells?.find(g=>g.column?.key===a);if(n){const g=A?.[i.original.id]?.[a]?.value,h=g!==void 0?g:n.value,d=Hi.validateCellValue(h,n.column);if(!d.isValid){Pi.current?.showNotification?.("error",d.error||"Validation failed");return}}}K&&K(String(i.original.id))},[K,i.original,i.cells,a,D,A]),qi=(n,g)=>{const h={...i.original},d=n!==void 0?n:ui;a&&d!==void 0&&(h[a]=d,H&&H(h,z,a,d,g),P&&P(String(i.original.id),a)),Gi()},Ai=l.useRef(null),Li=(n,g,h,d)=>{if(!vi&&(n?.stopPropagation(),a!==d)){if(H){if(xi?.includes(d))ci(d),_(String(i.original[d]));else{const m=B?.getSystemMessage?.("notAllowedInlineEdit")||"Inline Edit is not allowed for this column";B?.showNotification?.("error",m)}return}if(E)E(g,h,i.original,ei?.map(m=>m.original)||[]);else if(!E&&s){const m=i.original.id,Zi={target:{checked:!s.checkedIds.includes(m)}};s.onItemCheck(Zi,m)}}},Ti=async()=>{S(!0),ai&&await ai(i?.original?.id,i?.original,!(c?.[i?.original?.id]?.isOpen??!1),i?.original?.__level||0),S(!1)},Ji=l.useMemo(()=>i.cells.filter(n=>n.column?.visible).map(n=>n.column?.width??0).reduce((n,g)=>n+g,0),[i.cells]),Q=l.useMemo(()=>p?.draggingOver&&p?.draggingOver===i?.original?.id,[p,i?.original?.id]),Si=l.useMemo(()=>Q?p?.dropPosition||"inside":null,[Q,p?.dropPosition]),X=!!(Q&&Si==="inside"),k=i?.original?.__rowMetadata||i?.original?._meta,Z=C!==i?.original?.id,yi=!i?.original?.__isLoading,Vi=!!(k?.__is_new||k?.__is_added||i?.original?.is_added||R?.is_added||k?.is_added||k?.is_new),Qi=!!(i?.original?.is_deleted||k?.__is_deleted||R?.is_deleted||k?.is_deleted),Xi=!!(i?.original?.is_modified||i?.original?.is_row_modified||k?.__is_modified||k?.__is_edited||R?.is_row_modified||k?.is_modified)&&!Vi,ki=r!=null&&String(r)===String(i?.original?.id),zi=Ei({"bg-neutral-100 dark:bg-black-600":C===i?.original?.id&&!u,"bg-primary-100 dark:bg-primary-950":ki&&Z&&!u,"bg-primary-50 dark:bg-black-700":!i?.original?.is_read&&W&&!i?.original?.__isLoading&&Z&&!u,"bg-warning-50 dark:bg-warning-975":Xi&&yi&&Z&&!u,"bg-error-50 dark:bg-error-975":Qi&&yi&&Z&&!u,"bg-success-50 dark:bg-success-975":Vi&&yi&&Z&&!u,"bg-primary-50 dark:bg-primary-900":u,[pi.getTableRowBgClassNamesByStatus[i?.original?.__rowBgStatus]]:i?.original?.__rowBgStatus&&!u});return l.createElement("tr",{...i.getRowProps(),ref:N||f?bi:null,key:i.original.id,"data-row-id":i.original.id,className:Ei(`text-neutral-900 dark:text-white cursor-pointer min-w-full relative ${s?.selectionDisabledRowIds?.includes(i?.original?.id)?"opacity-50":""} border-t`,T?"z-40":"",Yi()?"shadow-dnd-drop":"",N&&I&&I?.data?.current?.type==="table-file-dropzone"&&I?.data?.current?.folderId===i?.original?.id&&i?.original?.type==="folder"?"bg-primary-50":"",i?.original?.isDefinedActionRow?"bg-primary-50":"",X?"z-50":"",zi||"bg-white dark:bg-black-800"),style:{...Ci,...f?Ki:{},width:"max-content"},...N||f?hi:{},...N||f?fi:{}},X&&p?.dragOperation?t.jsx("div",{className:"absolute right-2 h-row flex items-center z-20 pointer-events-none",children:t.jsx("div",{className:"bg-primary-200 px-2 py-1 rounded",children:p?.dragOperation==="COPY"?t.jsx(ee,{sx:{fontSize:12},className:"text-primary-700"}):t.jsx(Fi.SubdirectoryArrowLeftRounded,{sx:{fontSize:12},className:"text-primary-700"})})}):null,X&&!p?.dragOperation?t.jsx("div",{className:"absolute right-2 h-row flex items-center z-20 pointer-events-none",children:t.jsx(Fi.SubdirectoryArrowLeftRounded,{sx:{fontSize:16},className:"text-primary-500"})}):null,Q&&Si==="before"&&!i?.original?.isDefinedActionRow?t.jsx("div",{className:"absolute -top-[1px] left-0 right-0 h-[2px] bg-primary-500 z-20 pointer-events-none",children:t.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-2 h-2 rounded-full bg-primary-500"})}):null,Q&&Si==="after"&&!i?.original?.isDefinedActionRow?t.jsx("div",{className:"absolute -bottom-[1px] left-0 right-0 h-[2px] bg-primary-500 z-20 pointer-events-none",children:t.jsx("div",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-2 h-2 rounded-full bg-primary-500"})}):null,i?.original?.isDefinedActionRow?t.jsx(te.ActionCell,{cells:i.cells,id:i?.original?.id,isCheckbox:s,level:e,name:i?.original?.name,onClick:i?.original?.onClick,rowHovering:C||"",isRoot:i?.original?.isRoot,totalWidth:Ji,row:i.original,uploadCell:i?.original?.uploadCell,disabled:i?.original?.disabled,disabledTooltip:i?.original?.disabledTooltip}):U?t.jsx(U,{data:i.original,setIsDraggingFile:J,children:t.jsx(Wi,{isDraggingOver:X,level:e,withDraggable:N,setDroppableNodeRef:ji,isLastRow:$,lastRow:w,isCheckbox:ri,checkboxConfig:s,row:i,rowHovering:C,tableActions:ti,disableOptionsForRowIndex:F,index:z,showNewItem:W,currentData:R,lastNonStickyColumnIndex:M,getSumOfNextVisibleColumnWidth:ni,toggleRowExpand:Ti,loadingExpand:x,cellRef:Ai,handleCellClick:Li,getFullRowDataOnClick:si,handleCellValueChange:Di,handleUpdateCellData:qi,handleRowCancelEdit:Bi,handleRowConfirmEdit:Oi,registerValidation:Ii,inlineEditing:a,isInlineEditing:u,setRowHovering:Y,highlightSubstring:ii,rowOptions:b,isDraggingFile:y,rowAdditionalActions:j,hoverConfig:oi,isSelected:ki})}):t.jsx(Wi,{level:e,withDraggable:N,setDroppableNodeRef:ji,isLastRow:$,lastRow:w,isCheckbox:ri,checkboxConfig:s,row:i,rowHovering:C,tableActions:ti,disableOptionsForRowIndex:F,index:z,showNewItem:W,currentData:R,lastNonStickyColumnIndex:M,getSumOfNextVisibleColumnWidth:ni,toggleRowExpand:Ti,loadingExpand:x,cellRef:Ai,handleCellClick:Li,getFullRowDataOnClick:si,handleCellValueChange:Di,handleUpdateCellData:qi,handleRowCancelEdit:Bi,handleRowConfirmEdit:Oi,registerValidation:Ii,inlineEditing:a,isInlineEditing:u,setRowHovering:Y,highlightSubstring:ii,rowOptions:b,isDraggingFile:y,isDraggingOver:X,rowAdditionalActions:j,hoverConfig:oi,isSelected:ki}))},Wi=({withDraggable:i,setDroppableNodeRef:$,isLastRow:w,lastRow:ii,isCheckbox:z,checkboxConfig:Ci,row:e,rowHovering:c,tableActions:ei,disableOptionsForRowIndex:M,index:s,showNewItem:E,currentData:b,lastNonStickyColumnIndex:F,getSumOfNextVisibleColumnWidth:ni,toggleRowExpand:H,loadingExpand:xi,cellRef:ti,handleCellClick:li,getFullRowDataOnClick:f,handleCellValueChange:N,handleUpdateCellData:ai,handleRowCancelEdit:W,handleRowConfirmEdit:O,registerValidation:p,inlineEditing:si,isInlineEditing:r,setRowHovering:U,highlightSubstring:vi,rowOptions:j,level:oi,isDraggingFile:D,isDraggingOver:P,rowAdditionalActions:di,hoverConfig:q,isSelected:K})=>{const[A,B]=l.useState(!1),{getPendingEdit:ri,hasPendingEdit:gi,pendingEdits:L,tableHeaders:a,pendingEditsCount:u,scrollToCell:ci}=l.useContext(Ni.TableContext),C=L?.[e.original.id]&&Object.keys(L[e.original.id]).length>0,Y=(u??0)>0,ui=l.useMemo(()=>{if(Array.isArray(j))return j;if(typeof j=="function"){const o=j({...e.original,rowIndex:s});return Array.isArray(o)?o:[]}return[]},[j,e.original,s]),_=e?.original?.__rowMetadata||e?.original?._meta,R=c!==e?.original?.id,G=!e?.original?.__isLoading,x=!!(_?.__is_new||_?.__is_added||e?.original?.is_added||b?.is_added||_?.is_added||_?.is_new),S=!!(e?.original?.is_deleted||_?.__is_deleted||b?.is_deleted||_?.is_deleted),y=!!(e?.original?.is_modified||e?.original?.is_row_modified||_?.__is_modified||_?.__is_edited||b?.is_row_modified||_?.is_deleted)&&!x,J=K&&!r&&c!==e?.original?.id?"bg-primary-100 dark:bg-primary-950":void 0,_i=Ei("pointer-events-none absolute left-0 top-0 bottom-0 w-[3px] z-40",{"bg-success-400 dark:bg-success-500":x&&G&&R&&!r,"bg-error-400 dark:bg-error-500":S&&G&&R&&!r,"bg-warning-400 dark:bg-warning-500":y&&G&&R&&!r});return t.jsxs("div",{ref:i?$:null,className:P?"border-2 border-primary-400 dark:border-primary-500 rounded-sm":"",children:[t.jsx("div",{className:_i}),t.jsxs("div",{className:"flex",ref:w?ii:null,children:[Y&&t.jsx(oe.PendingEditCell,{rowId:String(e.original.id),rowIndex:s,pendingEdits:L,tableHeaders:a,rowHasPendingEdits:!!C,rowHovering:c!=null?String(c):void 0,isInlineEditing:r,is_read:!!e.original.is_read,is_modified:y,is_row_modified:!!e.original.is_row_modified,is_deleted:S,is_added:x,is_incomplete:e?.original?.status==="Incomplete",showNewItem:E,onScrollToCell:ci}),z&&t.jsx(le.CheckboxCell,{checkboxConfig:Ci,id:String(e.original.id),rowHovering:c!=null?String(c):void 0,isDisabled:!!e?.original?.__isLoading,isDraggingOver:P,is_added:x,is_deleted:S,is_incomplete:e?.original?.status==="Incomplete",is_modified:y,is_read:!!e.original.is_read,is_row_modified:!!e.original.is_row_modified,showNewItem:E,currentData:b??{},bgColor:e?.original?.__rowBgStatus?pi.getTableRowBgClassNamesByStatus[e?.original?.__rowBgStatus]:J,isInlineEditing:r,hasPendingEditsColumn:Y,rowHasPendingEdits:C}),ei?t.jsx(de.RowActionCell,{tableActions:ei,disableOptionsForRowIndex:M??null,id:String(e.original.id),index:s,is_read:!!e?.original?.is_read,is_incomplete:e?.original?.status==="Incomplete",showNewItem:!!E,is_modified:y,is_row_modified:!!e?.original?.is_row_modified,is_deleted:S,currentData:b??{},is_added:x,rowData:e.original,rowHovering:c,isDisabled:!!e?.original?.__isLoading,bgColor:D?"bg-primary-50":e?.original?.__rowBgStatus?pi.getTableRowBgClassNamesByStatus[e?.original?.__rowBgStatus]:J,isInlineEditing:r,rowHasPendingEdits:C}):null,t.jsxs("div",{className:"relative flex-1",id:`row-${e.original.id}`,onMouseEnter:()=>B(!0),onMouseLeave:()=>B(!1),children:[e.cells.filter(o=>o?.column?.visible!==!1).map((o,v)=>{const fi=v===F?.(),mi=v===(F?.()??-1)+1,bi=o?.column?.sticky?ni?.(v)??0:0;if(e.original?.__isLoading)return t.jsx(se.LoaderCell,{cell:o,id:v,nextWidthSum:bi,isLastCell:fi,rowHovering:c,index:v,isFirstStickyCell:mi},v);const T=ri?.(String(e.original.id),o?.column?.key||""),hi=gi?.(String(e.original.id),o?.column?.key||"");return t.jsx(ae.DataCell,{cell:o,rowHovering:c,isFirstStickyCell:mi,level:oi??0,toggleRowExpand:H,loadingExpand:xi,index:v,cellRef:ti,currentData:b,handleCellClick:V=>{V&&li(V,f?e.original:String(e.original.id),v,o?.column?.key||"")},handleCellValueChange:N,handleUpdateCellData:ai,registerValidation:p,id:e.original.id,inlineEditing:si,isInlineEditing:r,isLastCell:fi,is_incomplete:e?.original?.status==="Incomplete",is_added:x,is_deleted:S,is_modified:y,is_read:!!e.original.is_read,is_row_modified:!!e.original.is_row_modified,nextWidthSum:bi,setRowHovering:U,highlightSubstring:vi,isDraggingOver:P,isLoading:!!e?.original?.__isLoading,pendingEdit:T,hasPendingEdit:hi,pendingValidationError:T?.validationError},o?.column?.key)}),q?.onHover&&A&&ne.createPortal(t.jsx("div",{className:"absolute top-full left-10 z-50 bg-white dark:bg-black-800 rounded-xl",children:q.onHover(e.original)}),document.getElementById(`row-${e.original.id}`))]}),(ui.length>0||!!di)&&t.jsx(re.RowOptionsCell,{rowId:e.original.id,rowOptions:ui,disableOption:M!==null||!!e?.original?.__isLoading,rowHovering:c,setRowHovering:U,is_read:!!e.original.is_read,showNewItem:!!E,is_modified:y,is_row_modified:!!e.original.is_row_modified,is_incomplete:e?.original?.status==="Incomplete",currentData:b??{},is_deleted:S,is_added:x,isDraggingOver:!!P,rowAdditionalActions:di,rowData:e.original,index:s,bgColor:e?.original?.__rowBgStatus?pi.getTableRowBgClassNamesByStatus[e?.original?.__rowBgStatus]:J,isInlineEditing:r,onConfirmEdit:O,onCancelEdit:W,rowHasPendingEdits:C})]})]})};exports.Row=ge;
2
2
  //# sourceMappingURL=row.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"row.cjs.js","sources":["../../../../../../src/components/data-display/infinite-table/body/rows/row.tsx"],"sourcesContent":["import { getTableRowBgClassNamesByStatus } from '../../../../../constants/table';\nimport { useTableConfig } from '../../../../../providers/design-system-provider/hooks';\nimport { useDraggable, useDroppable } from '@dnd-kit/core';\nimport { useSortable } from '@dnd-kit/sortable';\nimport { CSS } from '@dnd-kit/utilities';\nimport { SubdirectoryArrowLeftRounded } from '@mui/icons-material';\nimport AddRounded from '@mui/icons-material/AddRounded';\nimport cn from 'classnames';\nimport React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { TableContext } from '../../context';\nimport { ActionCell } from '../cell/ActionCell';\nimport { CheckboxCell } from '../cell/CheckboxCell';\nimport { DataCell } from '../cell/DataCell';\nimport { validateCellValue } from '../../validateCell';\nimport { LoaderCell } from '../cell/LoaderCell';\nimport { PendingEditCell } from '../cell/PendingEditCell';\nimport { RowActionCell } from '../cell/RowActionCell';\nimport { RowOptionsCell } from '../cell/RowOptionsCell';\n\ntype TRowMetadata = {\n is_modified: object;\n is_new: boolean;\n is_deleted: boolean;\n is_added: boolean;\n __is_modified?: boolean;\n __is_edited?: boolean;\n __is_deleted?: boolean;\n __is_new?: boolean;\n __is_added?: boolean;\n};\n\ninterface TableCell {\n column: {\n key?: string;\n visible?: boolean;\n width?: number;\n sticky?: boolean;\n Header?: string;\n type?: string;\n is_required?: boolean;\n meta?: Record<string, unknown>;\n [key: string]: unknown;\n };\n value?: unknown;\n [key: string]: unknown;\n}\n\ninterface RowOriginal {\n id: string | number;\n is_read?: boolean;\n is_modified?: boolean;\n is_row_modified?: boolean;\n is_deleted?: boolean;\n is_added?: boolean;\n status?: string;\n type?: string;\n __isLoading?: boolean;\n __level?: number;\n __rowBgStatus?: string;\n __rowMetadata?: { __is_modified?: boolean };\n isDefinedActionRow?: boolean;\n isRoot?: boolean;\n name?: string | { props?: { text?: string } };\n onClick?: () => void;\n uploadCell?: boolean;\n disabled?: boolean;\n disabledTooltip?: string;\n [key: string]: unknown;\n}\n\ninterface TableRowData {\n original: RowOriginal;\n cells: TableCell[];\n getRowProps: () => Record<string, unknown>;\n index: number;\n [key: string]: unknown;\n}\n\ntype TRowOption = {\n key: string;\n label: React.ReactNode;\n isVisible?: boolean;\n [k: string]: unknown;\n};\n\ntype TProps = {\n row: TableRowData;\n isLastRow?: boolean;\n lastRow?: unknown;\n getSubRows?: () => unknown;\n prepareRow?: (row: unknown) => void;\n highlightSubstring?: (value: string) => JSX.Element;\n index: number;\n style?: Record<string, unknown>;\n visibleSubRowIds?: Record<string, unknown>;\n rowsLength?: number;\n level?: number;\n columns?: Record<string, unknown>;\n expandedRows?: Record<string, { isOpen: boolean }>;\n rows?: Array<{ original: unknown }>;\n};\n\nexport const Row = ({ row, isLastRow, lastRow, highlightSubstring, index, style, level = 0, expandedRows, rows }: TProps) => {\n const {\n lastNonStickyColumnIndex,\n checkboxConfig,\n onRowClick,\n rowOptions,\n disableOptionsForRowIndex = null,\n getSumOfNextVisibleColumnWidth,\n onRowEdit,\n inlineEditColumns,\n tableActions,\n dndSortableUtils,\n withSortable,\n withDraggable,\n getInnerRowData,\n showNewItem,\n rawData,\n dragConfig,\n getFullRowDataOnClick,\n selectedRowId,\n rowWrapper: RowWrapper,\n isCellClickDisabled,\n rowAdditionalActions,\n hoverConfig,\n addPendingEdit,\n removePendingEdit,\n fieldOperationLoading,\n clearRowPendingEdits,\n saveRowPendingEdits,\n pendingEdits: contextPendingEdits,\n } = useContext(TableContext);\n\n const tableConfig = useTableConfig();\n\n const isCheckbox = Boolean(checkboxConfig);\n const { activeInlineEdit, setActiveInlineEdit } = useContext(TableContext);\n const inlineEditing = activeInlineEdit?.rowId === row.original.id ? activeInlineEdit?.columnKey : null;\n const isInlineEditing = Boolean(inlineEditing);\n const setInlineEditing = (columnKey: string | null) => {\n if (columnKey === null) setActiveInlineEdit?.(null);\n else setActiveInlineEdit?.({ rowId: String(row.original.id), columnKey });\n };\n const [rowHovering, setRowHovering] = useState<string | number | null>(null);\n const [editedCellValue, setEditedCellValue] = useState<string | null>(null);\n const [currentData, setCurrentData] = useState<Record<string, unknown> | null>(null);\n const [loadingExpand, setLoadingExpand] = useState(false);\n const [isDraggingFile, setIsDraggingFile] = useState(false);\n\n const prevInlineEditingRef = useRef<string | null>(null);\n useEffect(() => {\n const wasEditing = prevInlineEditingRef.current;\n const isNowEditing = inlineEditing;\n\n if (wasEditing && !isNowEditing) {\n const pendingEdit = contextPendingEdits?.[row.original.id]?.[wasEditing];\n if (pendingEdit) {\n const currentCell = row.cells?.find((c: TableCell) => c.column?.key === wasEditing);\n if (currentCell) {\n const result = validateCellValue(pendingEdit.value, currentCell.column as { type?: string; is_required?: boolean });\n if (!result.isValid && addPendingEdit) {\n addPendingEdit(String(row.original.id), wasEditing, {\n ...pendingEdit,\n validationError: result.error,\n });\n }\n }\n }\n }\n\n prevInlineEditingRef.current = isNowEditing ?? null;\n }, [inlineEditing, row.original.id, row.cells, contextPendingEdits, addPendingEdit]);\n\n useEffect(() => {\n if (rawData) {\n const idKey = String(row?.original?.id);\n setCurrentData(rawData[idKey]?.[row?.cells[0].column.Header as string] || rawData[idKey]?.[0]);\n }\n }, [rawData, row?.original?.id, row?.cells]);\n\n const sortableResult = useSortable({ id: row.original.id, data: { ...row.original }, disabled: !withSortable });\n const draggableResult = useDraggable({ id: row.original.id, data: { ...row.original }, disabled: !!withSortable });\n const { listeners, transform, setNodeRef, isDragging, attributes, active, over, ...rest } = withSortable\n ? sortableResult\n : draggableResult;\n\n const { setNodeRef: setDroppableNodeRef } = useDroppable({\n id: `table-file-dropzone-${row?.original?.id}`,\n data: { type: 'table-file-dropzone', folderId: row?.original?.id, isFolder: row?.original?.type === 'folder' },\n });\n\n const dndStyles = {\n transform: CSS.Transform.toString(transform),\n transition: withSortable ? (rest as { transition?: string }).transition : undefined,\n cursor: isDragging ? 'grabbing' : 'grab',\n opacity: isDragging ? '0.5' : '1',\n };\n\n const isOverOtherContext = (): boolean => {\n if (!active || !over || !withSortable) return false;\n if (dndSortableUtils?.checkOverEachItem) return dndSortableUtils.checkOverEachItem(active, over) && Boolean(over);\n return active.data.current?.type !== over.data.current?.type && Boolean(over);\n };\n\n const handleCellValueChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n setEditedCellValue(e.target.value);\n };\n\n const handleCloseEdit = () => {\n if (fieldOperationLoading) return;\n setInlineEditing(null);\n };\n\n const validationRef = useRef<(() => { isValid: boolean; value?: string | boolean | null; meta?: Record<string, unknown> | null }) | null>(null);\n\n const registerValidation = useCallback(\n (validateFn: () => { isValid: boolean; value?: string | boolean | null; meta?: Record<string, unknown> | null }) => {\n validationRef.current = validateFn;\n },\n [],\n );\n\n const tableConfigRef = useRef(tableConfig);\n tableConfigRef.current = tableConfig;\n\n const handleRowCancelEdit = useCallback(() => {\n if (clearRowPendingEdits) clearRowPendingEdits(String(row.original.id));\n }, [clearRowPendingEdits, row.original.id]);\n\n const handleRowConfirmEdit = useCallback(() => {\n if (validationRef.current) {\n const result = validationRef.current();\n if (!result.isValid) return;\n if (inlineEditing && result.value !== undefined && addPendingEdit) {\n addPendingEdit(String(row.original.id), inlineEditing, {\n value: result.value,\n originalValue: row.original[inlineEditing],\n meta: result.meta || undefined,\n });\n }\n } else if (inlineEditing) {\n const currentCell = row.cells?.find((c: TableCell) => c.column?.key === inlineEditing);\n if (currentCell) {\n const pendingValue = contextPendingEdits?.[row.original.id]?.[inlineEditing]?.value;\n const valueToValidate = pendingValue !== undefined ? pendingValue : currentCell.value;\n const result = validateCellValue(valueToValidate as string | boolean | null | undefined, currentCell.column as { type?: string; is_required?: boolean });\n if (!result.isValid) {\n tableConfigRef.current?.showNotification?.('error', result.error || 'Validation failed');\n return;\n }\n }\n }\n\n if (saveRowPendingEdits) saveRowPendingEdits(String(row.original.id));\n }, [saveRowPendingEdits, row.original, row.cells, inlineEditing, addPendingEdit, contextPendingEdits]);\n\n const handleUpdateCellData = (\n directValue?: string | boolean | null,\n meta?: { currency_code?: string | null; reference?: unknown | null;[key: string]: unknown | null } | null,\n ) => {\n const _item = { ...row.original };\n const updatedValue = directValue !== undefined ? directValue : editedCellValue;\n if (inlineEditing && updatedValue !== undefined) {\n _item[inlineEditing] = updatedValue;\n if (onRowEdit) onRowEdit(_item, index, inlineEditing, updatedValue, meta);\n if (removePendingEdit) removePendingEdit(String(row.original.id), inlineEditing);\n }\n handleCloseEdit();\n };\n\n const ref = useRef<HTMLElement>(null);\n\n const handleCellClick = (event: React.MouseEvent, data: string | Record<string, unknown>, idx: number, key: string) => {\n if (isCellClickDisabled) return;\n event?.stopPropagation();\n if (inlineEditing === key) return;\n\n if (onRowEdit) {\n if (inlineEditColumns?.includes(key)) {\n setInlineEditing(key);\n setEditedCellValue(String(row.original[key]));\n } else {\n const msg = tableConfig?.getSystemMessage?.('notAllowedInlineEdit') || 'Inline Edit is not allowed for this column';\n tableConfig?.showNotification?.('error', msg);\n }\n return;\n }\n\n if (onRowClick) {\n onRowClick(data, idx, row.original, rows?.map((_row: { original: unknown }) => _row.original) || []);\n } else if (!onRowClick && checkboxConfig) {\n const _id = row.original.id;\n const checkEvent = { target: { checked: !checkboxConfig.checkedIds.includes(_id) } };\n checkboxConfig.onItemCheck(checkEvent, _id);\n }\n };\n\n const toggleRowExpand = async () => {\n setLoadingExpand(true);\n if (getInnerRowData) {\n await getInnerRowData(row?.original?.id, row?.original, !(expandedRows?.[row?.original?.id as string]?.isOpen ?? false), row?.original?.__level || 0);\n }\n setLoadingExpand(false);\n };\n\n\n\n\n const totalWidth = useMemo(() => {\n return row.cells.filter((c: TableCell) => c.column?.visible).map((c: TableCell) => c.column?.width ?? 0).reduce((a: number, b: number) => a + b, 0);\n }, [row.cells]);\n\n const isDraggingOver = useMemo(() => {\n return dragConfig?.draggingOver && dragConfig?.draggingOver === row?.original?.id;\n }, [dragConfig, row?.original?.id]);\n\n const dropPosition = useMemo(() => {\n if (!isDraggingOver) return null;\n return dragConfig?.dropPosition || 'inside';\n }, [isDraggingOver, dragConfig?.dropPosition]);\n\n const isDraggingOverInside = Boolean(isDraggingOver && dropPosition === 'inside');\n\n const _meta = (row?.original?.__rowMetadata as TRowMetadata) || (row?.original?._meta as TRowMetadata | undefined);\n const _notHovering = rowHovering !== row?.original?.id;\n const _notLoading = !row?.original?.__isLoading;\n const _isNewRow = !!(\n _meta?.__is_new ||\n _meta?.__is_added ||\n row?.original?.is_added ||\n (currentData?.is_added as boolean) ||\n _meta?.is_added ||\n _meta?.is_new\n );\n const _isDeletedRow = !!(row?.original?.is_deleted || _meta?.__is_deleted || (currentData?.is_deleted as boolean) || _meta?.is_deleted);\n const _isModifiedRow =\n !!(\n row?.original?.is_modified ||\n row?.original?.is_row_modified ||\n _meta?.__is_modified ||\n _meta?.__is_edited ||\n (currentData?.is_row_modified as boolean) ||\n _meta?.is_modified\n ) && !_isNewRow;\n\n const isSelected =\n selectedRowId !== null && selectedRowId !== undefined && String(selectedRowId) === String(row?.original?.id);\n\n const bgColor = cn({\n 'bg-neutral-100 dark:bg-black-600': rowHovering === row?.original?.id && !isInlineEditing,\n 'bg-primary-100 dark:bg-primary-950': isSelected && _notHovering && !isInlineEditing,\n 'bg-primary-50 dark:bg-black-700': !row?.original?.is_read && showNewItem && !row?.original?.__isLoading && _notHovering && !isInlineEditing,\n // 'bg-white dark:bg-black-700': cell.column.sticky && rowHovering !== id,\n 'bg-warning-50 dark:bg-warning-975': _isModifiedRow && _notLoading && _notHovering && !isInlineEditing,\n 'bg-error-50 dark:bg-error-975': _isDeletedRow && _notLoading && _notHovering && !isInlineEditing,\n 'bg-success-50 dark:bg-success-975': _isNewRow && _notLoading && _notHovering && !isInlineEditing,\n 'bg-primary-50 dark:bg-primary-900': isInlineEditing,\n [getTableRowBgClassNamesByStatus[row?.original?.__rowBgStatus as string]]: row?.original?.__rowBgStatus && !isInlineEditing,\n });\n\n return (\n <tr\n {...row.getRowProps()}\n ref={withDraggable || withSortable ? setNodeRef : null}\n key={row.original.id}\n data-row-id={row.original.id}\n className={cn(\n `text-neutral-900 dark:text-white cursor-pointer min-w-full relative ${checkboxConfig?.selectionDisabledRowIds?.includes(row?.original?.id) ? 'opacity-50' : ''} border-t`,\n isDragging ? 'z-40' : '',\n isOverOtherContext() ? 'shadow-dnd-drop' : '',\n withDraggable && over && over?.data?.current?.type === 'table-file-dropzone' && over?.data?.current?.folderId === row?.original?.id && row?.original?.type === 'folder' ? 'bg-primary-50' : '',\n row?.original?.isDefinedActionRow ? 'bg-primary-50' : '',\n isDraggingOverInside ? 'z-50' : '',\n bgColor ? bgColor : 'bg-white dark:bg-black-800',\n )}\n style={{ ...style, ...(withSortable ? dndStyles : {}), width: 'max-content' }}\n {...(withDraggable || withSortable ? attributes : {})}\n {...(withDraggable || withSortable ? listeners : {})}\n >\n {isDraggingOverInside && dragConfig?.dragOperation ? (\n <div className='absolute right-2 h-row flex items-center z-20 pointer-events-none'>\n <div className='bg-primary-200 px-2 py-1 rounded'>\n {dragConfig?.dragOperation === 'COPY' ? (\n <AddRounded sx={{ fontSize: 12 }} className='text-primary-700' />\n ) : (\n <SubdirectoryArrowLeftRounded sx={{ fontSize: 12 }} className='text-primary-700' />\n )}\n </div>\n </div>\n ) : null}\n {isDraggingOverInside && !dragConfig?.dragOperation ? (\n <div className='absolute right-2 h-row flex items-center z-20 pointer-events-none'>\n <SubdirectoryArrowLeftRounded sx={{ fontSize: 16 }} className='text-primary-500' />\n </div>\n ) : null}\n {isDraggingOver && dropPosition === 'before' && !row?.original?.isDefinedActionRow ? (\n <div className='absolute -top-[1px] left-0 right-0 h-[2px] bg-primary-500 z-20 pointer-events-none'>\n <div className='absolute left-0 top-1/2 -translate-y-1/2 w-2 h-2 rounded-full bg-primary-500' />\n </div>\n ) : null}\n {isDraggingOver && dropPosition === 'after' && !row?.original?.isDefinedActionRow ? (\n <div className='absolute -bottom-[1px] left-0 right-0 h-[2px] bg-primary-500 z-20 pointer-events-none'>\n <div className='absolute left-0 top-1/2 -translate-y-1/2 w-2 h-2 rounded-full bg-primary-500' />\n </div>\n ) : null}\n\n {row?.original?.isDefinedActionRow ? (\n <ActionCell\n cells={row.cells}\n id={row?.original?.id}\n isCheckbox={checkboxConfig}\n level={level}\n name={row?.original?.name as string}\n onClick={row?.original?.onClick as () => void}\n rowHovering={rowHovering || ''}\n isRoot={row?.original?.isRoot as boolean}\n totalWidth={totalWidth}\n row={row.original as Record<string, unknown>}\n uploadCell={row?.original?.uploadCell as boolean}\n disabled={row?.original?.disabled as boolean}\n disabledTooltip={row?.original?.disabledTooltip as string}\n />\n ) : RowWrapper ? (\n <RowWrapper data={row.original} setIsDraggingFile={setIsDraggingFile}>\n <RowContent\n isDraggingOver={isDraggingOverInside}\n level={level}\n withDraggable={withDraggable}\n setDroppableNodeRef={setDroppableNodeRef}\n isLastRow={isLastRow}\n lastRow={lastRow}\n isCheckbox={isCheckbox}\n checkboxConfig={checkboxConfig}\n row={row}\n rowHovering={rowHovering}\n tableActions={tableActions}\n disableOptionsForRowIndex={disableOptionsForRowIndex}\n index={index}\n showNewItem={showNewItem}\n currentData={currentData}\n lastNonStickyColumnIndex={lastNonStickyColumnIndex}\n getSumOfNextVisibleColumnWidth={getSumOfNextVisibleColumnWidth}\n toggleRowExpand={toggleRowExpand}\n loadingExpand={loadingExpand}\n cellRef={ref}\n handleCellClick={handleCellClick}\n getFullRowDataOnClick={getFullRowDataOnClick}\n handleCellValueChange={handleCellValueChange}\n handleUpdateCellData={handleUpdateCellData}\n handleRowCancelEdit={handleRowCancelEdit}\n handleRowConfirmEdit={handleRowConfirmEdit}\n registerValidation={registerValidation}\n inlineEditing={inlineEditing}\n isInlineEditing={isInlineEditing}\n setRowHovering={setRowHovering}\n highlightSubstring={highlightSubstring}\n rowOptions={rowOptions}\n isDraggingFile={isDraggingFile}\n rowAdditionalActions={rowAdditionalActions}\n hoverConfig={hoverConfig}\n isSelected={isSelected}\n />\n </RowWrapper>\n ) : (\n <RowContent\n level={level}\n withDraggable={withDraggable}\n setDroppableNodeRef={setDroppableNodeRef}\n isLastRow={isLastRow}\n lastRow={lastRow}\n isCheckbox={isCheckbox}\n checkboxConfig={checkboxConfig}\n row={row}\n rowHovering={rowHovering}\n tableActions={tableActions}\n disableOptionsForRowIndex={disableOptionsForRowIndex}\n index={index}\n showNewItem={showNewItem}\n currentData={currentData}\n lastNonStickyColumnIndex={lastNonStickyColumnIndex}\n getSumOfNextVisibleColumnWidth={getSumOfNextVisibleColumnWidth}\n toggleRowExpand={toggleRowExpand}\n loadingExpand={loadingExpand}\n cellRef={ref}\n handleCellClick={handleCellClick}\n getFullRowDataOnClick={getFullRowDataOnClick}\n handleCellValueChange={handleCellValueChange}\n handleUpdateCellData={handleUpdateCellData}\n handleRowCancelEdit={handleRowCancelEdit}\n handleRowConfirmEdit={handleRowConfirmEdit}\n registerValidation={registerValidation}\n inlineEditing={inlineEditing}\n isInlineEditing={isInlineEditing}\n setRowHovering={setRowHovering}\n highlightSubstring={highlightSubstring}\n rowOptions={rowOptions}\n isDraggingFile={isDraggingFile}\n isDraggingOver={isDraggingOverInside}\n rowAdditionalActions={rowAdditionalActions}\n hoverConfig={hoverConfig}\n isSelected={isSelected}\n />\n )}\n </tr>\n );\n};\n\ninterface RowContentProps {\n withDraggable?: boolean;\n setDroppableNodeRef: (node: HTMLElement | null) => void;\n isLastRow?: boolean;\n lastRow?: unknown;\n isCheckbox: boolean;\n checkboxConfig: Record<string, unknown> | null;\n row: TableRowData;\n rowHovering: string | number | null;\n tableActions?: ((rowData: Record<string, unknown>, index: number) => React.ReactNode) | null;\n disableOptionsForRowIndex?: number | null;\n index: number;\n showNewItem?: boolean;\n currentData: Record<string, unknown> | null;\n lastNonStickyColumnIndex?: (() => number | null) | null;\n getSumOfNextVisibleColumnWidth?: (index: number) => number | null;\n toggleRowExpand: () => Promise<void>;\n loadingExpand: boolean;\n cellRef: React.RefObject<HTMLElement | null>;\n handleCellClick: (event: React.MouseEvent, data: string | Record<string, unknown>, idx: number, key: string) => void;\n getFullRowDataOnClick?: boolean;\n handleCellValueChange: (e: React.ChangeEvent<HTMLInputElement>) => void;\n handleUpdateCellData: (directValue?: string | boolean | null, meta?: Record<string, unknown> | null) => void;\n handleRowCancelEdit: () => void;\n handleRowConfirmEdit: () => void;\n registerValidation: (fn: () => { isValid: boolean; value?: string | boolean | null; meta?: Record<string, unknown> | null }) => void;\n inlineEditing: string | null;\n isInlineEditing: boolean;\n setRowHovering: (id: string | number | null) => void;\n highlightSubstring?: (value: string) => React.ReactNode;\n rowOptions?: TRowOption[] | ((rowData: Record<string, unknown>) => TRowOption[] | null) | null;\n level?: number;\n isDraggingFile?: boolean;\n isDraggingOver?: boolean;\n rowAdditionalActions?: unknown;\n hoverConfig?: { onHover?: (data: Record<string, unknown>) => React.ReactNode };\n isSelected?: boolean;\n}\n\nconst RowContent = ({\n withDraggable,\n setDroppableNodeRef,\n isLastRow,\n lastRow,\n isCheckbox,\n checkboxConfig,\n row,\n rowHovering,\n tableActions,\n disableOptionsForRowIndex,\n index,\n showNewItem,\n currentData,\n lastNonStickyColumnIndex,\n getSumOfNextVisibleColumnWidth,\n toggleRowExpand,\n loadingExpand,\n cellRef,\n handleCellClick,\n getFullRowDataOnClick,\n handleCellValueChange,\n handleUpdateCellData,\n handleRowCancelEdit,\n handleRowConfirmEdit,\n registerValidation,\n inlineEditing,\n isInlineEditing,\n setRowHovering,\n highlightSubstring,\n rowOptions,\n level,\n isDraggingFile,\n isDraggingOver,\n rowAdditionalActions,\n hoverConfig,\n isSelected,\n}: RowContentProps) => {\n const [isRowContentHovering, setIsRowContentHovering] = useState(false);\n const {\n getPendingEdit: getPendingEditFn,\n hasPendingEdit: hasPendingEditFn,\n pendingEdits,\n tableHeaders,\n pendingEditsCount,\n scrollToCell,\n } = useContext(TableContext);\n const rowHasPendingEdits = pendingEdits?.[row.original.id] && Object.keys(pendingEdits[row.original.id]).length > 0;\n const tableHasAnyPendingEdits = (pendingEditsCount ?? 0) > 0;\n const resolvedRowOptions = useMemo<TRowOption[]>(() => {\n if (Array.isArray(rowOptions)) return rowOptions;\n if (typeof rowOptions === 'function') {\n const options = rowOptions({ ...row.original, rowIndex: index });\n return Array.isArray(options) ? options : [];\n }\n return [];\n }, [rowOptions, row.original, index]);\n\n\n const _meta = (row?.original?.__rowMetadata as TRowMetadata | undefined) || (row?.original?._meta as TRowMetadata | undefined);\n const _notHovering = rowHovering !== row?.original?.id;\n const _notLoading = !row?.original?.__isLoading;\n const _isNewRow = !!(\n _meta?.__is_new ||\n _meta?.__is_added ||\n row?.original?.is_added ||\n (currentData?.is_added as boolean) ||\n _meta?.is_added ||\n _meta?.is_new\n );\n const _isDeletedRow = !!(row?.original?.is_deleted || _meta?.__is_deleted || (currentData?.is_deleted as boolean) || _meta?.is_deleted);\n const _isModifiedRow =\n !!(\n row?.original?.is_modified ||\n row?.original?.is_row_modified ||\n _meta?.__is_modified ||\n _meta?.__is_edited ||\n (currentData?.is_row_modified as boolean) ||\n _meta?.is_deleted\n ) && !_isNewRow;\n\n // Only apply the selected background when the row is not being hovered, so on hover the icon cells\n // (checkbox, actions, options) fall back to the same gray hover background as the data cells.\n const selectedBg =\n isSelected && !isInlineEditing && rowHovering !== row?.original?.id ? 'bg-primary-100 dark:bg-primary-950' : undefined;\n\n const statusBorderClass = cn('pointer-events-none absolute left-0 top-0 bottom-0 w-[3px] z-10', {\n 'bg-success-400 dark:bg-success-500': _isNewRow && _notLoading && _notHovering && !isInlineEditing,\n 'bg-error-400 dark:bg-error-500': _isDeletedRow && _notLoading && _notHovering && !isInlineEditing,\n 'bg-warning-400 dark:bg-warning-500': _isModifiedRow && _notLoading && _notHovering && !isInlineEditing,\n });\n\n return (\n <div\n ref={withDraggable ? setDroppableNodeRef : null}\n className={isDraggingOver ? 'border-2 border-primary-400 dark:border-primary-500 rounded-sm' : ''}\n >\n <div className={statusBorderClass} />\n <div className='flex' ref={isLastRow ? (lastRow as React.Ref<HTMLDivElement>) : null}>\n {tableHasAnyPendingEdits && (\n <PendingEditCell\n rowId={String(row.original.id)}\n rowIndex={index}\n pendingEdits={pendingEdits}\n tableHeaders={tableHeaders}\n rowHasPendingEdits={!!rowHasPendingEdits}\n rowHovering={rowHovering != null ? String(rowHovering) : undefined}\n isInlineEditing={isInlineEditing}\n is_read={!!row.original.is_read}\n is_modified={_isModifiedRow}\n is_row_modified={!!row.original.is_row_modified}\n is_deleted={_isDeletedRow}\n is_added={_isNewRow}\n is_incomplete={row?.original?.status === 'Incomplete'}\n showNewItem={showNewItem}\n onScrollToCell={scrollToCell}\n />\n )}\n\n {isCheckbox && (\n <CheckboxCell\n checkboxConfig={checkboxConfig as never}\n id={String(row.original.id)}\n rowHovering={rowHovering != null ? String(rowHovering) : undefined}\n isDisabled={!!row?.original?.__isLoading}\n isDraggingOver={isDraggingOver}\n is_added={_isNewRow}\n is_deleted={_isDeletedRow}\n is_incomplete={row?.original?.status === 'Incomplete'}\n is_modified={_isModifiedRow}\n is_read={!!row.original.is_read}\n is_row_modified={!!row.original.is_row_modified}\n showNewItem={showNewItem}\n currentData={currentData ?? {}}\n bgColor={row?.original?.__rowBgStatus ? getTableRowBgClassNamesByStatus[row?.original?.__rowBgStatus as string] : selectedBg}\n isInlineEditing={isInlineEditing}\n hasPendingEditsColumn={tableHasAnyPendingEdits}\n rowHasPendingEdits={rowHasPendingEdits}\n />\n )}\n\n {tableActions ? (\n <RowActionCell\n tableActions={tableActions as (rowData: Record<string, unknown>, index: number) => JSX.Element}\n disableOptionsForRowIndex={disableOptionsForRowIndex ?? null}\n id={String(row.original.id)}\n index={index}\n is_read={!!row?.original?.is_read}\n is_incomplete={row?.original?.status === 'Incomplete'}\n showNewItem={!!showNewItem}\n is_modified={_isModifiedRow}\n is_row_modified={!!row?.original?.is_row_modified}\n is_deleted={_isDeletedRow}\n currentData={currentData ?? {}}\n is_added={_isNewRow}\n rowData={row.original as Record<string, unknown>}\n rowHovering={rowHovering}\n isDisabled={!!row?.original?.__isLoading}\n bgColor={isDraggingFile ? 'bg-primary-50' : row?.original?.__rowBgStatus ? getTableRowBgClassNamesByStatus[row?.original?.__rowBgStatus as string] : selectedBg}\n isInlineEditing={isInlineEditing}\n rowHasPendingEdits={rowHasPendingEdits}\n />\n ) : null}\n\n <div\n className='relative flex-1'\n id={`row-${row.original.id}`}\n onMouseEnter={() => setIsRowContentHovering(true)}\n onMouseLeave={() => setIsRowContentHovering(false)}\n >\n {row.cells\n .filter((cell: TableCell) => cell?.column?.visible !== false)\n .map((cell: TableCell, y: number) => {\n const isLastCell = y === lastNonStickyColumnIndex?.();\n const isFirstStickyCell = y === (lastNonStickyColumnIndex?.() ?? -1) + 1;\n const nextWidthSum = cell?.column?.sticky ? (getSumOfNextVisibleColumnWidth?.(y) ?? 0) : 0;\n\n if (row.original?.__isLoading) {\n return (\n <LoaderCell cell={cell as unknown as { column: { width: number; sticky?: boolean; sequence?: number } }} id={y} nextWidthSum={nextWidthSum} isLastCell={isLastCell} rowHovering={rowHovering} index={y} key={y} isFirstStickyCell={isFirstStickyCell} />\n );\n }\n\n const pendingEdit = getPendingEditFn?.(String(row.original.id), cell?.column?.key || '');\n const hasPending = hasPendingEditFn?.(String(row.original.id), cell?.column?.key || '');\n\n return (\n <DataCell\n cell={cell as unknown as import('../../types').ICell}\n rowHovering={rowHovering}\n isFirstStickyCell={isFirstStickyCell}\n level={level ?? 0}\n toggleRowExpand={toggleRowExpand}\n loadingExpand={loadingExpand}\n key={cell?.column?.key}\n index={y}\n cellRef={cellRef as React.RefObject<HTMLDivElement>}\n currentData={currentData as { is_row_modified?: boolean; is_deleted?: boolean; is_added?: boolean }}\n handleCellClick={(e?: React.MouseEvent) => { if (e) handleCellClick(e, getFullRowDataOnClick ? row.original : String(row.original.id), y, cell?.column?.key || ''); }}\n handleCellValueChange={handleCellValueChange}\n handleUpdateCellData={handleUpdateCellData}\n registerValidation={registerValidation}\n id={row.original.id}\n inlineEditing={inlineEditing}\n isInlineEditing={isInlineEditing}\n isLastCell={isLastCell}\n is_incomplete={row?.original?.status === 'Incomplete'}\n is_added={_isNewRow}\n is_deleted={_isDeletedRow}\n is_modified={_isModifiedRow}\n is_read={!!row.original.is_read}\n is_row_modified={!!row.original.is_row_modified}\n nextWidthSum={nextWidthSum}\n setRowHovering={setRowHovering}\n highlightSubstring={highlightSubstring as ((value: string) => JSX.Element) | undefined}\n isDraggingOver={isDraggingOver}\n isLoading={!!row?.original?.__isLoading}\n pendingEdit={pendingEdit}\n hasPendingEdit={hasPending}\n pendingValidationError={pendingEdit?.validationError}\n />\n );\n })}\n\n {hoverConfig?.onHover &&\n isRowContentHovering &&\n createPortal(\n <div className='absolute top-full left-10 z-50 bg-white dark:bg-black-800 rounded-xl'>{hoverConfig.onHover(row.original) as React.ReactNode}</div>,\n document.getElementById(`row-${row.original.id}`) as HTMLElement,\n )}\n </div>\n\n {(resolvedRowOptions.length > 0 || !!rowAdditionalActions) && (\n <RowOptionsCell\n rowId={row.original.id}\n rowOptions={resolvedRowOptions}\n disableOption={disableOptionsForRowIndex !== null || !!row?.original?.__isLoading}\n rowHovering={rowHovering}\n setRowHovering={setRowHovering}\n is_read={!!row.original.is_read}\n showNewItem={!!showNewItem}\n is_modified={_isModifiedRow}\n is_row_modified={!!row.original.is_row_modified}\n is_incomplete={row?.original?.status === 'Incomplete'}\n currentData={currentData ?? {}}\n is_deleted={_isDeletedRow}\n is_added={_isNewRow}\n isDraggingOver={!!isDraggingOver}\n rowAdditionalActions={rowAdditionalActions as (rowData: Record<string, unknown>, index: number, isHovering: boolean) => React.ReactNode}\n rowData={row.original as Record<string, unknown>}\n index={index}\n bgColor={row?.original?.__rowBgStatus ? getTableRowBgClassNamesByStatus[row?.original?.__rowBgStatus as string] : selectedBg}\n isInlineEditing={isInlineEditing}\n onConfirmEdit={handleRowConfirmEdit}\n onCancelEdit={handleRowCancelEdit}\n rowHasPendingEdits={rowHasPendingEdits}\n />\n )}\n </div>\n </div>\n );\n};\n"],"names":["Row","row","isLastRow","lastRow","highlightSubstring","index","style","level","expandedRows","rows","lastNonStickyColumnIndex","checkboxConfig","onRowClick","rowOptions","disableOptionsForRowIndex","getSumOfNextVisibleColumnWidth","onRowEdit","inlineEditColumns","tableActions","dndSortableUtils","withSortable","withDraggable","getInnerRowData","showNewItem","rawData","dragConfig","getFullRowDataOnClick","selectedRowId","RowWrapper","isCellClickDisabled","rowAdditionalActions","hoverConfig","addPendingEdit","removePendingEdit","fieldOperationLoading","clearRowPendingEdits","saveRowPendingEdits","contextPendingEdits","useContext","TableContext","tableConfig","useTableConfig","isCheckbox","activeInlineEdit","setActiveInlineEdit","inlineEditing","isInlineEditing","setInlineEditing","columnKey","rowHovering","setRowHovering","useState","editedCellValue","setEditedCellValue","currentData","setCurrentData","loadingExpand","setLoadingExpand","isDraggingFile","setIsDraggingFile","prevInlineEditingRef","useRef","useEffect","wasEditing","isNowEditing","pendingEdit","currentCell","c","result","validateCellValue","idKey","sortableResult","useSortable","draggableResult","useDraggable","listeners","transform","setNodeRef","isDragging","attributes","active","over","rest","setDroppableNodeRef","useDroppable","dndStyles","CSS","isOverOtherContext","handleCellValueChange","e","handleCloseEdit","validationRef","registerValidation","useCallback","validateFn","tableConfigRef","handleRowCancelEdit","handleRowConfirmEdit","pendingValue","valueToValidate","handleUpdateCellData","directValue","meta","_item","updatedValue","ref","handleCellClick","event","data","idx","key","msg","_row","_id","checkEvent","toggleRowExpand","totalWidth","useMemo","a","b","isDraggingOver","dropPosition","isDraggingOverInside","_meta","_notHovering","_notLoading","_isNewRow","_isDeletedRow","_isModifiedRow","isSelected","bgColor","cn","getTableRowBgClassNamesByStatus","createElement","jsx","AddRounded","SubdirectoryArrowLeftRounded","ActionCell","RowContent","cellRef","isRowContentHovering","setIsRowContentHovering","getPendingEditFn","hasPendingEditFn","pendingEdits","tableHeaders","pendingEditsCount","scrollToCell","rowHasPendingEdits","tableHasAnyPendingEdits","resolvedRowOptions","options","selectedBg","statusBorderClass","jsxs","PendingEditCell","CheckboxCell","RowActionCell","cell","y","isLastCell","isFirstStickyCell","nextWidthSum","LoaderCell","hasPending","DataCell","createPortal","RowOptionsCell"],"mappings":"62BAwGaA,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AAaC,EACb,QAAS,CAAC,CAAC/H,EAAI,SAAS,QACxB,gBAAiB,CAAC,CAACA,EAAI,SAAS,gBAChC,aAAAiK,GACA,eAAAhH,EACA,mBAAA9C,GACA,eAAAoH,EACA,UAAW,CAAC,CAACvH,GAAK,UAAU,YAC5B,YAAAgE,EACA,eAAgBmG,GAChB,uBAAwBnG,GAAa,eAAA,EAzBhC6F,GAAM,QAAQ,GAAA,CA4BzB,CAAC,EAEF/H,GAAa,SACZ6G,GACA0B,GAAAA,aACEhC,EAAAA,IAAC,OAAI,UAAU,uEAAwE,WAAY,QAAQrI,EAAI,QAAQ,EAAqB,EAC5I,SAAS,eAAe,OAAOA,EAAI,SAAS,EAAE,EAAE,CAAA,CAClD,CAAA,CAAA,GAGFqJ,GAAmB,OAAS,GAAK,CAAC,CAACxH,KACnCwG,EAAAA,IAACiC,GAAAA,eAAA,CACC,MAAOtK,EAAI,SAAS,GACpB,WAAYqJ,GACZ,cAAexI,IAA8B,MAAQ,CAAC,CAACb,GAAK,UAAU,YACtE,YAAAgD,EACA,eAAAC,EACA,QAAS,CAAC,CAACjD,EAAI,SAAS,QACxB,YAAa,CAAC,CAACsB,EACf,YAAayG,EACb,gBAAiB,CAAC,CAAC/H,EAAI,SAAS,gBAChC,cAAeA,GAAK,UAAU,SAAW,aACzC,YAAaqD,GAAe,CAAA,EAC5B,WAAYyE,EACZ,SAAUD,EACV,eAAgB,CAAC,CAACN,EAClB,qBAAA1F,GACA,QAAS7B,EAAI,SAAA,MACbI,EACA,QAASJ,GAAK,UAAU,cAAgBmI,GAAAA,gCAAgCnI,GAAK,UAAU,aAAuB,EAAIuJ,EAClH,gBAAA1G,EACA,cAAemD,EACf,aAAcD,EACd,mBAAAoD,CAAA,CAAA,CACF,CAAA,CAEJ,CAAA,CAAA,CAAA,CAGN"}
1
+ {"version":3,"file":"row.cjs.js","sources":["../../../../../../src/components/data-display/infinite-table/body/rows/row.tsx"],"sourcesContent":["import { getTableRowBgClassNamesByStatus } from '../../../../../constants/table';\nimport { useTableConfig } from '../../../../../providers/design-system-provider/hooks';\nimport { useDraggable, useDroppable } from '@dnd-kit/core';\nimport { useSortable } from '@dnd-kit/sortable';\nimport { CSS } from '@dnd-kit/utilities';\nimport { SubdirectoryArrowLeftRounded } from '@mui/icons-material';\nimport AddRounded from '@mui/icons-material/AddRounded';\nimport cn from 'classnames';\nimport React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { TableContext } from '../../context';\nimport { ActionCell } from '../cell/ActionCell';\nimport { CheckboxCell } from '../cell/CheckboxCell';\nimport { DataCell } from '../cell/DataCell';\nimport { validateCellValue } from '../../validateCell';\nimport { LoaderCell } from '../cell/LoaderCell';\nimport { PendingEditCell } from '../cell/PendingEditCell';\nimport { RowActionCell } from '../cell/RowActionCell';\nimport { RowOptionsCell } from '../cell/RowOptionsCell';\n\ntype TRowMetadata = {\n is_modified: object;\n is_new: boolean;\n is_deleted: boolean;\n is_added: boolean;\n __is_modified?: boolean;\n __is_edited?: boolean;\n __is_deleted?: boolean;\n __is_new?: boolean;\n __is_added?: boolean;\n};\n\ninterface TableCell {\n column: {\n key?: string;\n visible?: boolean;\n width?: number;\n sticky?: boolean;\n Header?: string;\n type?: string;\n is_required?: boolean;\n meta?: Record<string, unknown>;\n [key: string]: unknown;\n };\n value?: unknown;\n [key: string]: unknown;\n}\n\ninterface RowOriginal {\n id: string | number;\n is_read?: boolean;\n is_modified?: boolean;\n is_row_modified?: boolean;\n is_deleted?: boolean;\n is_added?: boolean;\n status?: string;\n type?: string;\n __isLoading?: boolean;\n __level?: number;\n __rowBgStatus?: string;\n __rowMetadata?: { __is_modified?: boolean };\n isDefinedActionRow?: boolean;\n isRoot?: boolean;\n name?: string | { props?: { text?: string } };\n onClick?: () => void;\n uploadCell?: boolean;\n disabled?: boolean;\n disabledTooltip?: string;\n [key: string]: unknown;\n}\n\ninterface TableRowData {\n original: RowOriginal;\n cells: TableCell[];\n getRowProps: () => Record<string, unknown>;\n index: number;\n [key: string]: unknown;\n}\n\ntype TRowOption = {\n key: string;\n label: React.ReactNode;\n isVisible?: boolean;\n [k: string]: unknown;\n};\n\ntype TProps = {\n row: TableRowData;\n isLastRow?: boolean;\n lastRow?: unknown;\n getSubRows?: () => unknown;\n prepareRow?: (row: unknown) => void;\n highlightSubstring?: (value: string) => JSX.Element;\n index: number;\n style?: Record<string, unknown>;\n visibleSubRowIds?: Record<string, unknown>;\n rowsLength?: number;\n level?: number;\n columns?: Record<string, unknown>;\n expandedRows?: Record<string, { isOpen: boolean }>;\n rows?: Array<{ original: unknown }>;\n};\n\nexport const Row = ({ row, isLastRow, lastRow, highlightSubstring, index, style, level = 0, expandedRows, rows }: TProps) => {\n const {\n lastNonStickyColumnIndex,\n checkboxConfig,\n onRowClick,\n rowOptions,\n disableOptionsForRowIndex = null,\n getSumOfNextVisibleColumnWidth,\n onRowEdit,\n inlineEditColumns,\n tableActions,\n dndSortableUtils,\n withSortable,\n withDraggable,\n getInnerRowData,\n showNewItem,\n rawData,\n dragConfig,\n getFullRowDataOnClick,\n selectedRowId,\n rowWrapper: RowWrapper,\n isCellClickDisabled,\n rowAdditionalActions,\n hoverConfig,\n addPendingEdit,\n removePendingEdit,\n fieldOperationLoading,\n clearRowPendingEdits,\n saveRowPendingEdits,\n pendingEdits: contextPendingEdits,\n } = useContext(TableContext);\n\n const tableConfig = useTableConfig();\n\n const isCheckbox = Boolean(checkboxConfig);\n const { activeInlineEdit, setActiveInlineEdit } = useContext(TableContext);\n const inlineEditing = activeInlineEdit?.rowId === row.original.id ? activeInlineEdit?.columnKey : null;\n const isInlineEditing = Boolean(inlineEditing);\n const setInlineEditing = (columnKey: string | null) => {\n if (columnKey === null) setActiveInlineEdit?.(null);\n else setActiveInlineEdit?.({ rowId: String(row.original.id), columnKey });\n };\n const [rowHovering, setRowHovering] = useState<string | number | null>(null);\n const [editedCellValue, setEditedCellValue] = useState<string | null>(null);\n const [currentData, setCurrentData] = useState<Record<string, unknown> | null>(null);\n const [loadingExpand, setLoadingExpand] = useState(false);\n const [isDraggingFile, setIsDraggingFile] = useState(false);\n\n const prevInlineEditingRef = useRef<string | null>(null);\n useEffect(() => {\n const wasEditing = prevInlineEditingRef.current;\n const isNowEditing = inlineEditing;\n\n if (wasEditing && !isNowEditing) {\n const pendingEdit = contextPendingEdits?.[row.original.id]?.[wasEditing];\n if (pendingEdit) {\n const currentCell = row.cells?.find((c: TableCell) => c.column?.key === wasEditing);\n if (currentCell) {\n const result = validateCellValue(pendingEdit.value, currentCell.column as { type?: string; is_required?: boolean });\n if (!result.isValid && addPendingEdit) {\n addPendingEdit(String(row.original.id), wasEditing, {\n ...pendingEdit,\n validationError: result.error,\n });\n }\n }\n }\n }\n\n prevInlineEditingRef.current = isNowEditing ?? null;\n }, [inlineEditing, row.original.id, row.cells, contextPendingEdits, addPendingEdit]);\n\n useEffect(() => {\n if (rawData) {\n const idKey = String(row?.original?.id);\n setCurrentData(rawData[idKey]?.[row?.cells[0].column.Header as string] || rawData[idKey]?.[0]);\n }\n }, [rawData, row?.original?.id, row?.cells]);\n\n const sortableResult = useSortable({ id: row.original.id, data: { ...row.original }, disabled: !withSortable });\n const draggableResult = useDraggable({ id: row.original.id, data: { ...row.original }, disabled: !!withSortable });\n const { listeners, transform, setNodeRef, isDragging, attributes, active, over, ...rest } = withSortable\n ? sortableResult\n : draggableResult;\n\n const { setNodeRef: setDroppableNodeRef } = useDroppable({\n id: `table-file-dropzone-${row?.original?.id}`,\n data: { type: 'table-file-dropzone', folderId: row?.original?.id, isFolder: row?.original?.type === 'folder' },\n });\n\n const dndStyles = {\n transform: CSS.Transform.toString(transform),\n transition: withSortable ? (rest as { transition?: string }).transition : undefined,\n cursor: isDragging ? 'grabbing' : 'grab',\n opacity: isDragging ? '0.5' : '1',\n };\n\n const isOverOtherContext = (): boolean => {\n if (!active || !over || !withSortable) return false;\n if (dndSortableUtils?.checkOverEachItem) return dndSortableUtils.checkOverEachItem(active, over) && Boolean(over);\n return active.data.current?.type !== over.data.current?.type && Boolean(over);\n };\n\n const handleCellValueChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n setEditedCellValue(e.target.value);\n };\n\n const handleCloseEdit = () => {\n if (fieldOperationLoading) return;\n setInlineEditing(null);\n };\n\n const validationRef = useRef<(() => { isValid: boolean; value?: string | boolean | null; meta?: Record<string, unknown> | null }) | null>(null);\n\n const registerValidation = useCallback(\n (validateFn: () => { isValid: boolean; value?: string | boolean | null; meta?: Record<string, unknown> | null }) => {\n validationRef.current = validateFn;\n },\n [],\n );\n\n const tableConfigRef = useRef(tableConfig);\n tableConfigRef.current = tableConfig;\n\n const handleRowCancelEdit = useCallback(() => {\n if (clearRowPendingEdits) clearRowPendingEdits(String(row.original.id));\n }, [clearRowPendingEdits, row.original.id]);\n\n const handleRowConfirmEdit = useCallback(() => {\n if (validationRef.current) {\n const result = validationRef.current();\n if (!result.isValid) return;\n if (inlineEditing && result.value !== undefined && addPendingEdit) {\n addPendingEdit(String(row.original.id), inlineEditing, {\n value: result.value,\n originalValue: row.original[inlineEditing],\n meta: result.meta || undefined,\n });\n }\n } else if (inlineEditing) {\n const currentCell = row.cells?.find((c: TableCell) => c.column?.key === inlineEditing);\n if (currentCell) {\n const pendingValue = contextPendingEdits?.[row.original.id]?.[inlineEditing]?.value;\n const valueToValidate = pendingValue !== undefined ? pendingValue : currentCell.value;\n const result = validateCellValue(valueToValidate as string | boolean | null | undefined, currentCell.column as { type?: string; is_required?: boolean });\n if (!result.isValid) {\n tableConfigRef.current?.showNotification?.('error', result.error || 'Validation failed');\n return;\n }\n }\n }\n\n if (saveRowPendingEdits) saveRowPendingEdits(String(row.original.id));\n }, [saveRowPendingEdits, row.original, row.cells, inlineEditing, addPendingEdit, contextPendingEdits]);\n\n const handleUpdateCellData = (\n directValue?: string | boolean | null,\n meta?: { currency_code?: string | null; reference?: unknown | null;[key: string]: unknown | null } | null,\n ) => {\n const _item = { ...row.original };\n const updatedValue = directValue !== undefined ? directValue : editedCellValue;\n if (inlineEditing && updatedValue !== undefined) {\n _item[inlineEditing] = updatedValue;\n if (onRowEdit) onRowEdit(_item, index, inlineEditing, updatedValue, meta);\n if (removePendingEdit) removePendingEdit(String(row.original.id), inlineEditing);\n }\n handleCloseEdit();\n };\n\n const ref = useRef<HTMLElement>(null);\n\n const handleCellClick = (event: React.MouseEvent, data: string | Record<string, unknown>, idx: number, key: string) => {\n if (isCellClickDisabled) return;\n event?.stopPropagation();\n if (inlineEditing === key) return;\n\n if (onRowEdit) {\n if (inlineEditColumns?.includes(key)) {\n setInlineEditing(key);\n setEditedCellValue(String(row.original[key]));\n } else {\n const msg = tableConfig?.getSystemMessage?.('notAllowedInlineEdit') || 'Inline Edit is not allowed for this column';\n tableConfig?.showNotification?.('error', msg);\n }\n return;\n }\n\n if (onRowClick) {\n onRowClick(data, idx, row.original, rows?.map((_row: { original: unknown }) => _row.original) || []);\n } else if (!onRowClick && checkboxConfig) {\n const _id = row.original.id;\n const checkEvent = { target: { checked: !checkboxConfig.checkedIds.includes(_id) } };\n checkboxConfig.onItemCheck(checkEvent, _id);\n }\n };\n\n const toggleRowExpand = async () => {\n setLoadingExpand(true);\n if (getInnerRowData) {\n await getInnerRowData(row?.original?.id, row?.original, !(expandedRows?.[row?.original?.id as string]?.isOpen ?? false), row?.original?.__level || 0);\n }\n setLoadingExpand(false);\n };\n\n\n\n\n const totalWidth = useMemo(() => {\n return row.cells.filter((c: TableCell) => c.column?.visible).map((c: TableCell) => c.column?.width ?? 0).reduce((a: number, b: number) => a + b, 0);\n }, [row.cells]);\n\n const isDraggingOver = useMemo(() => {\n return dragConfig?.draggingOver && dragConfig?.draggingOver === row?.original?.id;\n }, [dragConfig, row?.original?.id]);\n\n const dropPosition = useMemo(() => {\n if (!isDraggingOver) return null;\n return dragConfig?.dropPosition || 'inside';\n }, [isDraggingOver, dragConfig?.dropPosition]);\n\n const isDraggingOverInside = Boolean(isDraggingOver && dropPosition === 'inside');\n\n const _meta = (row?.original?.__rowMetadata as TRowMetadata) || (row?.original?._meta as TRowMetadata | undefined);\n const _notHovering = rowHovering !== row?.original?.id;\n const _notLoading = !row?.original?.__isLoading;\n const _isNewRow = !!(\n _meta?.__is_new ||\n _meta?.__is_added ||\n row?.original?.is_added ||\n (currentData?.is_added as boolean) ||\n _meta?.is_added ||\n _meta?.is_new\n );\n const _isDeletedRow = !!(row?.original?.is_deleted || _meta?.__is_deleted || (currentData?.is_deleted as boolean) || _meta?.is_deleted);\n const _isModifiedRow =\n !!(\n row?.original?.is_modified ||\n row?.original?.is_row_modified ||\n _meta?.__is_modified ||\n _meta?.__is_edited ||\n (currentData?.is_row_modified as boolean) ||\n _meta?.is_modified\n ) && !_isNewRow;\n\n const isSelected =\n selectedRowId !== null && selectedRowId !== undefined && String(selectedRowId) === String(row?.original?.id);\n\n const bgColor = cn({\n 'bg-neutral-100 dark:bg-black-600': rowHovering === row?.original?.id && !isInlineEditing,\n 'bg-primary-100 dark:bg-primary-950': isSelected && _notHovering && !isInlineEditing,\n 'bg-primary-50 dark:bg-black-700': !row?.original?.is_read && showNewItem && !row?.original?.__isLoading && _notHovering && !isInlineEditing,\n // 'bg-white dark:bg-black-700': cell.column.sticky && rowHovering !== id,\n 'bg-warning-50 dark:bg-warning-975': _isModifiedRow && _notLoading && _notHovering && !isInlineEditing,\n 'bg-error-50 dark:bg-error-975': _isDeletedRow && _notLoading && _notHovering && !isInlineEditing,\n 'bg-success-50 dark:bg-success-975': _isNewRow && _notLoading && _notHovering && !isInlineEditing,\n 'bg-primary-50 dark:bg-primary-900': isInlineEditing,\n [getTableRowBgClassNamesByStatus[row?.original?.__rowBgStatus as string]]: row?.original?.__rowBgStatus && !isInlineEditing,\n });\n\n return (\n <tr\n {...row.getRowProps()}\n ref={withDraggable || withSortable ? setNodeRef : null}\n key={row.original.id}\n data-row-id={row.original.id}\n className={cn(\n `text-neutral-900 dark:text-white cursor-pointer min-w-full relative ${checkboxConfig?.selectionDisabledRowIds?.includes(row?.original?.id) ? 'opacity-50' : ''} border-t`,\n isDragging ? 'z-40' : '',\n isOverOtherContext() ? 'shadow-dnd-drop' : '',\n withDraggable && over && over?.data?.current?.type === 'table-file-dropzone' && over?.data?.current?.folderId === row?.original?.id && row?.original?.type === 'folder' ? 'bg-primary-50' : '',\n row?.original?.isDefinedActionRow ? 'bg-primary-50' : '',\n isDraggingOverInside ? 'z-50' : '',\n bgColor ? bgColor : 'bg-white dark:bg-black-800',\n )}\n style={{ ...style, ...(withSortable ? dndStyles : {}), width: 'max-content' }}\n {...(withDraggable || withSortable ? attributes : {})}\n {...(withDraggable || withSortable ? listeners : {})}\n >\n {isDraggingOverInside && dragConfig?.dragOperation ? (\n <div className='absolute right-2 h-row flex items-center z-20 pointer-events-none'>\n <div className='bg-primary-200 px-2 py-1 rounded'>\n {dragConfig?.dragOperation === 'COPY' ? (\n <AddRounded sx={{ fontSize: 12 }} className='text-primary-700' />\n ) : (\n <SubdirectoryArrowLeftRounded sx={{ fontSize: 12 }} className='text-primary-700' />\n )}\n </div>\n </div>\n ) : null}\n {isDraggingOverInside && !dragConfig?.dragOperation ? (\n <div className='absolute right-2 h-row flex items-center z-20 pointer-events-none'>\n <SubdirectoryArrowLeftRounded sx={{ fontSize: 16 }} className='text-primary-500' />\n </div>\n ) : null}\n {isDraggingOver && dropPosition === 'before' && !row?.original?.isDefinedActionRow ? (\n <div className='absolute -top-[1px] left-0 right-0 h-[2px] bg-primary-500 z-20 pointer-events-none'>\n <div className='absolute left-0 top-1/2 -translate-y-1/2 w-2 h-2 rounded-full bg-primary-500' />\n </div>\n ) : null}\n {isDraggingOver && dropPosition === 'after' && !row?.original?.isDefinedActionRow ? (\n <div className='absolute -bottom-[1px] left-0 right-0 h-[2px] bg-primary-500 z-20 pointer-events-none'>\n <div className='absolute left-0 top-1/2 -translate-y-1/2 w-2 h-2 rounded-full bg-primary-500' />\n </div>\n ) : null}\n\n {row?.original?.isDefinedActionRow ? (\n <ActionCell\n cells={row.cells}\n id={row?.original?.id}\n isCheckbox={checkboxConfig}\n level={level}\n name={row?.original?.name as string}\n onClick={row?.original?.onClick as () => void}\n rowHovering={rowHovering || ''}\n isRoot={row?.original?.isRoot as boolean}\n totalWidth={totalWidth}\n row={row.original as Record<string, unknown>}\n uploadCell={row?.original?.uploadCell as boolean}\n disabled={row?.original?.disabled as boolean}\n disabledTooltip={row?.original?.disabledTooltip as string}\n />\n ) : RowWrapper ? (\n <RowWrapper data={row.original} setIsDraggingFile={setIsDraggingFile}>\n <RowContent\n isDraggingOver={isDraggingOverInside}\n level={level}\n withDraggable={withDraggable}\n setDroppableNodeRef={setDroppableNodeRef}\n isLastRow={isLastRow}\n lastRow={lastRow}\n isCheckbox={isCheckbox}\n checkboxConfig={checkboxConfig}\n row={row}\n rowHovering={rowHovering}\n tableActions={tableActions}\n disableOptionsForRowIndex={disableOptionsForRowIndex}\n index={index}\n showNewItem={showNewItem}\n currentData={currentData}\n lastNonStickyColumnIndex={lastNonStickyColumnIndex}\n getSumOfNextVisibleColumnWidth={getSumOfNextVisibleColumnWidth}\n toggleRowExpand={toggleRowExpand}\n loadingExpand={loadingExpand}\n cellRef={ref}\n handleCellClick={handleCellClick}\n getFullRowDataOnClick={getFullRowDataOnClick}\n handleCellValueChange={handleCellValueChange}\n handleUpdateCellData={handleUpdateCellData}\n handleRowCancelEdit={handleRowCancelEdit}\n handleRowConfirmEdit={handleRowConfirmEdit}\n registerValidation={registerValidation}\n inlineEditing={inlineEditing}\n isInlineEditing={isInlineEditing}\n setRowHovering={setRowHovering}\n highlightSubstring={highlightSubstring}\n rowOptions={rowOptions}\n isDraggingFile={isDraggingFile}\n rowAdditionalActions={rowAdditionalActions}\n hoverConfig={hoverConfig}\n isSelected={isSelected}\n />\n </RowWrapper>\n ) : (\n <RowContent\n level={level}\n withDraggable={withDraggable}\n setDroppableNodeRef={setDroppableNodeRef}\n isLastRow={isLastRow}\n lastRow={lastRow}\n isCheckbox={isCheckbox}\n checkboxConfig={checkboxConfig}\n row={row}\n rowHovering={rowHovering}\n tableActions={tableActions}\n disableOptionsForRowIndex={disableOptionsForRowIndex}\n index={index}\n showNewItem={showNewItem}\n currentData={currentData}\n lastNonStickyColumnIndex={lastNonStickyColumnIndex}\n getSumOfNextVisibleColumnWidth={getSumOfNextVisibleColumnWidth}\n toggleRowExpand={toggleRowExpand}\n loadingExpand={loadingExpand}\n cellRef={ref}\n handleCellClick={handleCellClick}\n getFullRowDataOnClick={getFullRowDataOnClick}\n handleCellValueChange={handleCellValueChange}\n handleUpdateCellData={handleUpdateCellData}\n handleRowCancelEdit={handleRowCancelEdit}\n handleRowConfirmEdit={handleRowConfirmEdit}\n registerValidation={registerValidation}\n inlineEditing={inlineEditing}\n isInlineEditing={isInlineEditing}\n setRowHovering={setRowHovering}\n highlightSubstring={highlightSubstring}\n rowOptions={rowOptions}\n isDraggingFile={isDraggingFile}\n isDraggingOver={isDraggingOverInside}\n rowAdditionalActions={rowAdditionalActions}\n hoverConfig={hoverConfig}\n isSelected={isSelected}\n />\n )}\n </tr>\n );\n};\n\ninterface RowContentProps {\n withDraggable?: boolean;\n setDroppableNodeRef: (node: HTMLElement | null) => void;\n isLastRow?: boolean;\n lastRow?: unknown;\n isCheckbox: boolean;\n checkboxConfig: Record<string, unknown> | null;\n row: TableRowData;\n rowHovering: string | number | null;\n tableActions?: ((rowData: Record<string, unknown>, index: number) => React.ReactNode) | null;\n disableOptionsForRowIndex?: number | null;\n index: number;\n showNewItem?: boolean;\n currentData: Record<string, unknown> | null;\n lastNonStickyColumnIndex?: (() => number | null) | null;\n getSumOfNextVisibleColumnWidth?: (index: number) => number | null;\n toggleRowExpand: () => Promise<void>;\n loadingExpand: boolean;\n cellRef: React.RefObject<HTMLElement | null>;\n handleCellClick: (event: React.MouseEvent, data: string | Record<string, unknown>, idx: number, key: string) => void;\n getFullRowDataOnClick?: boolean;\n handleCellValueChange: (e: React.ChangeEvent<HTMLInputElement>) => void;\n handleUpdateCellData: (directValue?: string | boolean | null, meta?: Record<string, unknown> | null) => void;\n handleRowCancelEdit: () => void;\n handleRowConfirmEdit: () => void;\n registerValidation: (fn: () => { isValid: boolean; value?: string | boolean | null; meta?: Record<string, unknown> | null }) => void;\n inlineEditing: string | null;\n isInlineEditing: boolean;\n setRowHovering: (id: string | number | null) => void;\n highlightSubstring?: (value: string) => React.ReactNode;\n rowOptions?: TRowOption[] | ((rowData: Record<string, unknown>) => TRowOption[] | null) | null;\n level?: number;\n isDraggingFile?: boolean;\n isDraggingOver?: boolean;\n rowAdditionalActions?: unknown;\n hoverConfig?: { onHover?: (data: Record<string, unknown>) => React.ReactNode };\n isSelected?: boolean;\n}\n\nconst RowContent = ({\n withDraggable,\n setDroppableNodeRef,\n isLastRow,\n lastRow,\n isCheckbox,\n checkboxConfig,\n row,\n rowHovering,\n tableActions,\n disableOptionsForRowIndex,\n index,\n showNewItem,\n currentData,\n lastNonStickyColumnIndex,\n getSumOfNextVisibleColumnWidth,\n toggleRowExpand,\n loadingExpand,\n cellRef,\n handleCellClick,\n getFullRowDataOnClick,\n handleCellValueChange,\n handleUpdateCellData,\n handleRowCancelEdit,\n handleRowConfirmEdit,\n registerValidation,\n inlineEditing,\n isInlineEditing,\n setRowHovering,\n highlightSubstring,\n rowOptions,\n level,\n isDraggingFile,\n isDraggingOver,\n rowAdditionalActions,\n hoverConfig,\n isSelected,\n}: RowContentProps) => {\n const [isRowContentHovering, setIsRowContentHovering] = useState(false);\n const {\n getPendingEdit: getPendingEditFn,\n hasPendingEdit: hasPendingEditFn,\n pendingEdits,\n tableHeaders,\n pendingEditsCount,\n scrollToCell,\n } = useContext(TableContext);\n const rowHasPendingEdits = pendingEdits?.[row.original.id] && Object.keys(pendingEdits[row.original.id]).length > 0;\n const tableHasAnyPendingEdits = (pendingEditsCount ?? 0) > 0;\n const resolvedRowOptions = useMemo<TRowOption[]>(() => {\n if (Array.isArray(rowOptions)) return rowOptions;\n if (typeof rowOptions === 'function') {\n const options = rowOptions({ ...row.original, rowIndex: index });\n return Array.isArray(options) ? options : [];\n }\n return [];\n }, [rowOptions, row.original, index]);\n\n\n const _meta = (row?.original?.__rowMetadata as TRowMetadata | undefined) || (row?.original?._meta as TRowMetadata | undefined);\n const _notHovering = rowHovering !== row?.original?.id;\n const _notLoading = !row?.original?.__isLoading;\n const _isNewRow = !!(\n _meta?.__is_new ||\n _meta?.__is_added ||\n row?.original?.is_added ||\n (currentData?.is_added as boolean) ||\n _meta?.is_added ||\n _meta?.is_new\n );\n const _isDeletedRow = !!(row?.original?.is_deleted || _meta?.__is_deleted || (currentData?.is_deleted as boolean) || _meta?.is_deleted);\n const _isModifiedRow =\n !!(\n row?.original?.is_modified ||\n row?.original?.is_row_modified ||\n _meta?.__is_modified ||\n _meta?.__is_edited ||\n (currentData?.is_row_modified as boolean) ||\n _meta?.is_deleted\n ) && !_isNewRow;\n\n // Only apply the selected background when the row is not being hovered, so on hover the icon cells\n // (checkbox, actions, options) fall back to the same gray hover background as the data cells.\n const selectedBg =\n isSelected && !isInlineEditing && rowHovering !== row?.original?.id ? 'bg-primary-100 dark:bg-primary-950' : undefined;\n\n const statusBorderClass = cn('pointer-events-none absolute left-0 top-0 bottom-0 w-[3px] z-40', {\n 'bg-success-400 dark:bg-success-500': _isNewRow && _notLoading && _notHovering && !isInlineEditing,\n 'bg-error-400 dark:bg-error-500': _isDeletedRow && _notLoading && _notHovering && !isInlineEditing,\n 'bg-warning-400 dark:bg-warning-500': _isModifiedRow && _notLoading && _notHovering && !isInlineEditing,\n });\n\n return (\n <div\n ref={withDraggable ? setDroppableNodeRef : null}\n className={isDraggingOver ? 'border-2 border-primary-400 dark:border-primary-500 rounded-sm' : ''}\n >\n <div className={statusBorderClass} />\n <div className='flex' ref={isLastRow ? (lastRow as React.Ref<HTMLDivElement>) : null}>\n {tableHasAnyPendingEdits && (\n <PendingEditCell\n rowId={String(row.original.id)}\n rowIndex={index}\n pendingEdits={pendingEdits}\n tableHeaders={tableHeaders}\n rowHasPendingEdits={!!rowHasPendingEdits}\n rowHovering={rowHovering != null ? String(rowHovering) : undefined}\n isInlineEditing={isInlineEditing}\n is_read={!!row.original.is_read}\n is_modified={_isModifiedRow}\n is_row_modified={!!row.original.is_row_modified}\n is_deleted={_isDeletedRow}\n is_added={_isNewRow}\n is_incomplete={row?.original?.status === 'Incomplete'}\n showNewItem={showNewItem}\n onScrollToCell={scrollToCell}\n />\n )}\n\n {isCheckbox && (\n <CheckboxCell\n checkboxConfig={checkboxConfig as never}\n id={String(row.original.id)}\n rowHovering={rowHovering != null ? String(rowHovering) : undefined}\n isDisabled={!!row?.original?.__isLoading}\n isDraggingOver={isDraggingOver}\n is_added={_isNewRow}\n is_deleted={_isDeletedRow}\n is_incomplete={row?.original?.status === 'Incomplete'}\n is_modified={_isModifiedRow}\n is_read={!!row.original.is_read}\n is_row_modified={!!row.original.is_row_modified}\n showNewItem={showNewItem}\n currentData={currentData ?? {}}\n bgColor={row?.original?.__rowBgStatus ? getTableRowBgClassNamesByStatus[row?.original?.__rowBgStatus as string] : selectedBg}\n isInlineEditing={isInlineEditing}\n hasPendingEditsColumn={tableHasAnyPendingEdits}\n rowHasPendingEdits={rowHasPendingEdits}\n />\n )}\n\n {tableActions ? (\n <RowActionCell\n tableActions={tableActions as (rowData: Record<string, unknown>, index: number) => JSX.Element}\n disableOptionsForRowIndex={disableOptionsForRowIndex ?? null}\n id={String(row.original.id)}\n index={index}\n is_read={!!row?.original?.is_read}\n is_incomplete={row?.original?.status === 'Incomplete'}\n showNewItem={!!showNewItem}\n is_modified={_isModifiedRow}\n is_row_modified={!!row?.original?.is_row_modified}\n is_deleted={_isDeletedRow}\n currentData={currentData ?? {}}\n is_added={_isNewRow}\n rowData={row.original as Record<string, unknown>}\n rowHovering={rowHovering}\n isDisabled={!!row?.original?.__isLoading}\n bgColor={isDraggingFile ? 'bg-primary-50' : row?.original?.__rowBgStatus ? getTableRowBgClassNamesByStatus[row?.original?.__rowBgStatus as string] : selectedBg}\n isInlineEditing={isInlineEditing}\n rowHasPendingEdits={rowHasPendingEdits}\n />\n ) : null}\n\n <div\n className='relative flex-1'\n id={`row-${row.original.id}`}\n onMouseEnter={() => setIsRowContentHovering(true)}\n onMouseLeave={() => setIsRowContentHovering(false)}\n >\n {row.cells\n .filter((cell: TableCell) => cell?.column?.visible !== false)\n .map((cell: TableCell, y: number) => {\n const isLastCell = y === lastNonStickyColumnIndex?.();\n const isFirstStickyCell = y === (lastNonStickyColumnIndex?.() ?? -1) + 1;\n const nextWidthSum = cell?.column?.sticky ? (getSumOfNextVisibleColumnWidth?.(y) ?? 0) : 0;\n\n if (row.original?.__isLoading) {\n return (\n <LoaderCell cell={cell as unknown as { column: { width: number; sticky?: boolean; sequence?: number } }} id={y} nextWidthSum={nextWidthSum} isLastCell={isLastCell} rowHovering={rowHovering} index={y} key={y} isFirstStickyCell={isFirstStickyCell} />\n );\n }\n\n const pendingEdit = getPendingEditFn?.(String(row.original.id), cell?.column?.key || '');\n const hasPending = hasPendingEditFn?.(String(row.original.id), cell?.column?.key || '');\n\n return (\n <DataCell\n cell={cell as unknown as import('../../types').ICell}\n rowHovering={rowHovering}\n isFirstStickyCell={isFirstStickyCell}\n level={level ?? 0}\n toggleRowExpand={toggleRowExpand}\n loadingExpand={loadingExpand}\n key={cell?.column?.key}\n index={y}\n cellRef={cellRef as React.RefObject<HTMLDivElement>}\n currentData={currentData as { is_row_modified?: boolean; is_deleted?: boolean; is_added?: boolean }}\n handleCellClick={(e?: React.MouseEvent) => { if (e) handleCellClick(e, getFullRowDataOnClick ? row.original : String(row.original.id), y, cell?.column?.key || ''); }}\n handleCellValueChange={handleCellValueChange}\n handleUpdateCellData={handleUpdateCellData}\n registerValidation={registerValidation}\n id={row.original.id}\n inlineEditing={inlineEditing}\n isInlineEditing={isInlineEditing}\n isLastCell={isLastCell}\n is_incomplete={row?.original?.status === 'Incomplete'}\n is_added={_isNewRow}\n is_deleted={_isDeletedRow}\n is_modified={_isModifiedRow}\n is_read={!!row.original.is_read}\n is_row_modified={!!row.original.is_row_modified}\n nextWidthSum={nextWidthSum}\n setRowHovering={setRowHovering}\n highlightSubstring={highlightSubstring as ((value: string) => JSX.Element) | undefined}\n isDraggingOver={isDraggingOver}\n isLoading={!!row?.original?.__isLoading}\n pendingEdit={pendingEdit}\n hasPendingEdit={hasPending}\n pendingValidationError={pendingEdit?.validationError}\n />\n );\n })}\n\n {hoverConfig?.onHover &&\n isRowContentHovering &&\n createPortal(\n <div className='absolute top-full left-10 z-50 bg-white dark:bg-black-800 rounded-xl'>{hoverConfig.onHover(row.original) as React.ReactNode}</div>,\n document.getElementById(`row-${row.original.id}`) as HTMLElement,\n )}\n </div>\n\n {(resolvedRowOptions.length > 0 || !!rowAdditionalActions) && (\n <RowOptionsCell\n rowId={row.original.id}\n rowOptions={resolvedRowOptions}\n disableOption={disableOptionsForRowIndex !== null || !!row?.original?.__isLoading}\n rowHovering={rowHovering}\n setRowHovering={setRowHovering}\n is_read={!!row.original.is_read}\n showNewItem={!!showNewItem}\n is_modified={_isModifiedRow}\n is_row_modified={!!row.original.is_row_modified}\n is_incomplete={row?.original?.status === 'Incomplete'}\n currentData={currentData ?? {}}\n is_deleted={_isDeletedRow}\n is_added={_isNewRow}\n isDraggingOver={!!isDraggingOver}\n rowAdditionalActions={rowAdditionalActions as (rowData: Record<string, unknown>, index: number, isHovering: boolean) => React.ReactNode}\n rowData={row.original as Record<string, unknown>}\n index={index}\n bgColor={row?.original?.__rowBgStatus ? getTableRowBgClassNamesByStatus[row?.original?.__rowBgStatus as string] : selectedBg}\n isInlineEditing={isInlineEditing}\n onConfirmEdit={handleRowConfirmEdit}\n onCancelEdit={handleRowCancelEdit}\n rowHasPendingEdits={rowHasPendingEdits}\n />\n )}\n </div>\n </div>\n );\n};\n"],"names":["Row","row","isLastRow","lastRow","highlightSubstring","index","style","level","expandedRows","rows","lastNonStickyColumnIndex","checkboxConfig","onRowClick","rowOptions","disableOptionsForRowIndex","getSumOfNextVisibleColumnWidth","onRowEdit","inlineEditColumns","tableActions","dndSortableUtils","withSortable","withDraggable","getInnerRowData","showNewItem","rawData","dragConfig","getFullRowDataOnClick","selectedRowId","RowWrapper","isCellClickDisabled","rowAdditionalActions","hoverConfig","addPendingEdit","removePendingEdit","fieldOperationLoading","clearRowPendingEdits","saveRowPendingEdits","contextPendingEdits","useContext","TableContext","tableConfig","useTableConfig","isCheckbox","activeInlineEdit","setActiveInlineEdit","inlineEditing","isInlineEditing","setInlineEditing","columnKey","rowHovering","setRowHovering","useState","editedCellValue","setEditedCellValue","currentData","setCurrentData","loadingExpand","setLoadingExpand","isDraggingFile","setIsDraggingFile","prevInlineEditingRef","useRef","useEffect","wasEditing","isNowEditing","pendingEdit","currentCell","c","result","validateCellValue","idKey","sortableResult","useSortable","draggableResult","useDraggable","listeners","transform","setNodeRef","isDragging","attributes","active","over","rest","setDroppableNodeRef","useDroppable","dndStyles","CSS","isOverOtherContext","handleCellValueChange","e","handleCloseEdit","validationRef","registerValidation","useCallback","validateFn","tableConfigRef","handleRowCancelEdit","handleRowConfirmEdit","pendingValue","valueToValidate","handleUpdateCellData","directValue","meta","_item","updatedValue","ref","handleCellClick","event","data","idx","key","msg","_row","_id","checkEvent","toggleRowExpand","totalWidth","useMemo","a","b","isDraggingOver","dropPosition","isDraggingOverInside","_meta","_notHovering","_notLoading","_isNewRow","_isDeletedRow","_isModifiedRow","isSelected","bgColor","cn","getTableRowBgClassNamesByStatus","createElement","jsx","AddRounded","SubdirectoryArrowLeftRounded","ActionCell","RowContent","cellRef","isRowContentHovering","setIsRowContentHovering","getPendingEditFn","hasPendingEditFn","pendingEdits","tableHeaders","pendingEditsCount","scrollToCell","rowHasPendingEdits","tableHasAnyPendingEdits","resolvedRowOptions","options","selectedBg","statusBorderClass","jsxs","PendingEditCell","CheckboxCell","RowActionCell","cell","y","isLastCell","isFirstStickyCell","nextWidthSum","LoaderCell","hasPending","DataCell","createPortal","RowOptionsCell"],"mappings":"62BAwGaA,GAAM,CAAC,CAAE,IAAAC,EAAK,UAAAC,EAAW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QACxB,gBAAiB,CAAC,CAACA,EAAI,SAAS,gBAChC,aAAAiK,GACA,eAAAhH,EACA,mBAAA9C,GACA,eAAAoH,EACA,UAAW,CAAC,CAACvH,GAAK,UAAU,YAC5B,YAAAgE,EACA,eAAgBmG,GAChB,uBAAwBnG,GAAa,eAAA,EAzBhC6F,GAAM,QAAQ,GAAA,CA4BzB,CAAC,EAEF/H,GAAa,SACZ6G,GACA0B,GAAAA,aACEhC,EAAAA,IAAC,OAAI,UAAU,uEAAwE,WAAY,QAAQrI,EAAI,QAAQ,EAAqB,EAC5I,SAAS,eAAe,OAAOA,EAAI,SAAS,EAAE,EAAE,CAAA,CAClD,CAAA,CAAA,GAGFqJ,GAAmB,OAAS,GAAK,CAAC,CAACxH,KACnCwG,EAAAA,IAACiC,GAAAA,eAAA,CACC,MAAOtK,EAAI,SAAS,GACpB,WAAYqJ,GACZ,cAAexI,IAA8B,MAAQ,CAAC,CAACb,GAAK,UAAU,YACtE,YAAAgD,EACA,eAAAC,EACA,QAAS,CAAC,CAACjD,EAAI,SAAS,QACxB,YAAa,CAAC,CAACsB,EACf,YAAayG,EACb,gBAAiB,CAAC,CAAC/H,EAAI,SAAS,gBAChC,cAAeA,GAAK,UAAU,SAAW,aACzC,YAAaqD,GAAe,CAAA,EAC5B,WAAYyE,EACZ,SAAUD,EACV,eAAgB,CAAC,CAACN,EAClB,qBAAA1F,GACA,QAAS7B,EAAI,SAAA,MACbI,EACA,QAASJ,GAAK,UAAU,cAAgBmI,GAAAA,gCAAgCnI,GAAK,UAAU,aAAuB,EAAIuJ,EAClH,gBAAA1G,EACA,cAAemD,EACf,aAAcD,EACd,mBAAAoD,CAAA,CAAA,CACF,CAAA,CAEJ,CAAA,CAAA,CAAA,CAGN"}
@@ -323,7 +323,7 @@ const Fe = ({ row: i, isLastRow: Z, lastRow: w, highlightSubstring: ii, index: M
323
323
  return Array.isArray(o) ? o : [];
324
324
  }
325
325
  return [];
326
- }, [N, e.original, a]), m = e?.original?.__rowMetadata || e?.original?._meta, y = g !== e?.original?.id, q = !e?.original?.__isLoading, C = !!(m?.__is_new || m?.__is_added || e?.original?.is_added || f?.is_added || m?.is_added || m?.is_new), R = !!(e?.original?.is_deleted || m?.__is_deleted || f?.is_deleted || m?.is_deleted), k = !!(e?.original?.is_modified || e?.original?.is_row_modified || m?.__is_modified || m?.__is_edited || f?.is_row_modified || m?.is_deleted) && !C, G = K && !s && g !== e?.original?.id ? "bg-primary-100 dark:bg-primary-950" : void 0, ui = Oi("pointer-events-none absolute left-0 top-0 bottom-0 w-[3px] z-10", {
326
+ }, [N, e.original, a]), m = e?.original?.__rowMetadata || e?.original?._meta, y = g !== e?.original?.id, q = !e?.original?.__isLoading, C = !!(m?.__is_new || m?.__is_added || e?.original?.is_added || f?.is_added || m?.is_added || m?.is_new), R = !!(e?.original?.is_deleted || m?.__is_deleted || f?.is_deleted || m?.is_deleted), k = !!(e?.original?.is_modified || e?.original?.is_row_modified || m?.__is_modified || m?.__is_edited || f?.is_row_modified || m?.is_deleted) && !C, G = K && !s && g !== e?.original?.id ? "bg-primary-100 dark:bg-primary-950" : void 0, ui = Oi("pointer-events-none absolute left-0 top-0 bottom-0 w-[3px] z-40", {
327
327
  "bg-success-400 dark:bg-success-500": C && q && y && !s,
328
328
  "bg-error-400 dark:bg-error-500": R && q && y && !s,
329
329
  "bg-warning-400 dark:bg-warning-500": k && q && y && !s
@@ -1 +1 @@
1
- {"version":3,"file":"row.es.js","sources":["../../../../../../src/components/data-display/infinite-table/body/rows/row.tsx"],"sourcesContent":["import { getTableRowBgClassNamesByStatus } from '../../../../../constants/table';\nimport { useTableConfig } from '../../../../../providers/design-system-provider/hooks';\nimport { useDraggable, useDroppable } from '@dnd-kit/core';\nimport { useSortable } from '@dnd-kit/sortable';\nimport { CSS } from '@dnd-kit/utilities';\nimport { SubdirectoryArrowLeftRounded } from '@mui/icons-material';\nimport AddRounded from '@mui/icons-material/AddRounded';\nimport cn from 'classnames';\nimport React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { TableContext } from '../../context';\nimport { ActionCell } from '../cell/ActionCell';\nimport { CheckboxCell } from '../cell/CheckboxCell';\nimport { DataCell } from '../cell/DataCell';\nimport { validateCellValue } from '../../validateCell';\nimport { LoaderCell } from '../cell/LoaderCell';\nimport { PendingEditCell } from '../cell/PendingEditCell';\nimport { RowActionCell } from '../cell/RowActionCell';\nimport { RowOptionsCell } from '../cell/RowOptionsCell';\n\ntype TRowMetadata = {\n is_modified: object;\n is_new: boolean;\n is_deleted: boolean;\n is_added: boolean;\n __is_modified?: boolean;\n __is_edited?: boolean;\n __is_deleted?: boolean;\n __is_new?: boolean;\n __is_added?: boolean;\n};\n\ninterface TableCell {\n column: {\n key?: string;\n visible?: boolean;\n width?: number;\n sticky?: boolean;\n Header?: string;\n type?: string;\n is_required?: boolean;\n meta?: Record<string, unknown>;\n [key: string]: unknown;\n };\n value?: unknown;\n [key: string]: unknown;\n}\n\ninterface RowOriginal {\n id: string | number;\n is_read?: boolean;\n is_modified?: boolean;\n is_row_modified?: boolean;\n is_deleted?: boolean;\n is_added?: boolean;\n status?: string;\n type?: string;\n __isLoading?: boolean;\n __level?: number;\n __rowBgStatus?: string;\n __rowMetadata?: { __is_modified?: boolean };\n isDefinedActionRow?: boolean;\n isRoot?: boolean;\n name?: string | { props?: { text?: string } };\n onClick?: () => void;\n uploadCell?: boolean;\n disabled?: boolean;\n disabledTooltip?: string;\n [key: string]: unknown;\n}\n\ninterface TableRowData {\n original: RowOriginal;\n cells: TableCell[];\n getRowProps: () => Record<string, unknown>;\n index: number;\n [key: string]: unknown;\n}\n\ntype TRowOption = {\n key: string;\n label: React.ReactNode;\n isVisible?: boolean;\n [k: string]: unknown;\n};\n\ntype TProps = {\n row: TableRowData;\n isLastRow?: boolean;\n lastRow?: unknown;\n getSubRows?: () => unknown;\n prepareRow?: (row: unknown) => void;\n highlightSubstring?: (value: string) => JSX.Element;\n index: number;\n style?: Record<string, unknown>;\n visibleSubRowIds?: Record<string, unknown>;\n rowsLength?: number;\n level?: number;\n columns?: Record<string, unknown>;\n expandedRows?: Record<string, { isOpen: boolean }>;\n rows?: Array<{ original: unknown }>;\n};\n\nexport const Row = ({ row, isLastRow, lastRow, highlightSubstring, index, style, level = 0, expandedRows, rows }: TProps) => {\n const {\n lastNonStickyColumnIndex,\n checkboxConfig,\n onRowClick,\n rowOptions,\n disableOptionsForRowIndex = null,\n getSumOfNextVisibleColumnWidth,\n onRowEdit,\n inlineEditColumns,\n tableActions,\n dndSortableUtils,\n withSortable,\n withDraggable,\n getInnerRowData,\n showNewItem,\n rawData,\n dragConfig,\n getFullRowDataOnClick,\n selectedRowId,\n rowWrapper: RowWrapper,\n isCellClickDisabled,\n rowAdditionalActions,\n hoverConfig,\n addPendingEdit,\n removePendingEdit,\n fieldOperationLoading,\n clearRowPendingEdits,\n saveRowPendingEdits,\n pendingEdits: contextPendingEdits,\n } = useContext(TableContext);\n\n const tableConfig = useTableConfig();\n\n const isCheckbox = Boolean(checkboxConfig);\n const { activeInlineEdit, setActiveInlineEdit } = useContext(TableContext);\n const inlineEditing = activeInlineEdit?.rowId === row.original.id ? activeInlineEdit?.columnKey : null;\n const isInlineEditing = Boolean(inlineEditing);\n const setInlineEditing = (columnKey: string | null) => {\n if (columnKey === null) setActiveInlineEdit?.(null);\n else setActiveInlineEdit?.({ rowId: String(row.original.id), columnKey });\n };\n const [rowHovering, setRowHovering] = useState<string | number | null>(null);\n const [editedCellValue, setEditedCellValue] = useState<string | null>(null);\n const [currentData, setCurrentData] = useState<Record<string, unknown> | null>(null);\n const [loadingExpand, setLoadingExpand] = useState(false);\n const [isDraggingFile, setIsDraggingFile] = useState(false);\n\n const prevInlineEditingRef = useRef<string | null>(null);\n useEffect(() => {\n const wasEditing = prevInlineEditingRef.current;\n const isNowEditing = inlineEditing;\n\n if (wasEditing && !isNowEditing) {\n const pendingEdit = contextPendingEdits?.[row.original.id]?.[wasEditing];\n if (pendingEdit) {\n const currentCell = row.cells?.find((c: TableCell) => c.column?.key === wasEditing);\n if (currentCell) {\n const result = validateCellValue(pendingEdit.value, currentCell.column as { type?: string; is_required?: boolean });\n if (!result.isValid && addPendingEdit) {\n addPendingEdit(String(row.original.id), wasEditing, {\n ...pendingEdit,\n validationError: result.error,\n });\n }\n }\n }\n }\n\n prevInlineEditingRef.current = isNowEditing ?? null;\n }, [inlineEditing, row.original.id, row.cells, contextPendingEdits, addPendingEdit]);\n\n useEffect(() => {\n if (rawData) {\n const idKey = String(row?.original?.id);\n setCurrentData(rawData[idKey]?.[row?.cells[0].column.Header as string] || rawData[idKey]?.[0]);\n }\n }, [rawData, row?.original?.id, row?.cells]);\n\n const sortableResult = useSortable({ id: row.original.id, data: { ...row.original }, disabled: !withSortable });\n const draggableResult = useDraggable({ id: row.original.id, data: { ...row.original }, disabled: !!withSortable });\n const { listeners, transform, setNodeRef, isDragging, attributes, active, over, ...rest } = withSortable\n ? sortableResult\n : draggableResult;\n\n const { setNodeRef: setDroppableNodeRef } = useDroppable({\n id: `table-file-dropzone-${row?.original?.id}`,\n data: { type: 'table-file-dropzone', folderId: row?.original?.id, isFolder: row?.original?.type === 'folder' },\n });\n\n const dndStyles = {\n transform: CSS.Transform.toString(transform),\n transition: withSortable ? (rest as { transition?: string }).transition : undefined,\n cursor: isDragging ? 'grabbing' : 'grab',\n opacity: isDragging ? '0.5' : '1',\n };\n\n const isOverOtherContext = (): boolean => {\n if (!active || !over || !withSortable) return false;\n if (dndSortableUtils?.checkOverEachItem) return dndSortableUtils.checkOverEachItem(active, over) && Boolean(over);\n return active.data.current?.type !== over.data.current?.type && Boolean(over);\n };\n\n const handleCellValueChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n setEditedCellValue(e.target.value);\n };\n\n const handleCloseEdit = () => {\n if (fieldOperationLoading) return;\n setInlineEditing(null);\n };\n\n const validationRef = useRef<(() => { isValid: boolean; value?: string | boolean | null; meta?: Record<string, unknown> | null }) | null>(null);\n\n const registerValidation = useCallback(\n (validateFn: () => { isValid: boolean; value?: string | boolean | null; meta?: Record<string, unknown> | null }) => {\n validationRef.current = validateFn;\n },\n [],\n );\n\n const tableConfigRef = useRef(tableConfig);\n tableConfigRef.current = tableConfig;\n\n const handleRowCancelEdit = useCallback(() => {\n if (clearRowPendingEdits) clearRowPendingEdits(String(row.original.id));\n }, [clearRowPendingEdits, row.original.id]);\n\n const handleRowConfirmEdit = useCallback(() => {\n if (validationRef.current) {\n const result = validationRef.current();\n if (!result.isValid) return;\n if (inlineEditing && result.value !== undefined && addPendingEdit) {\n addPendingEdit(String(row.original.id), inlineEditing, {\n value: result.value,\n originalValue: row.original[inlineEditing],\n meta: result.meta || undefined,\n });\n }\n } else if (inlineEditing) {\n const currentCell = row.cells?.find((c: TableCell) => c.column?.key === inlineEditing);\n if (currentCell) {\n const pendingValue = contextPendingEdits?.[row.original.id]?.[inlineEditing]?.value;\n const valueToValidate = pendingValue !== undefined ? pendingValue : currentCell.value;\n const result = validateCellValue(valueToValidate as string | boolean | null | undefined, currentCell.column as { type?: string; is_required?: boolean });\n if (!result.isValid) {\n tableConfigRef.current?.showNotification?.('error', result.error || 'Validation failed');\n return;\n }\n }\n }\n\n if (saveRowPendingEdits) saveRowPendingEdits(String(row.original.id));\n }, [saveRowPendingEdits, row.original, row.cells, inlineEditing, addPendingEdit, contextPendingEdits]);\n\n const handleUpdateCellData = (\n directValue?: string | boolean | null,\n meta?: { currency_code?: string | null; reference?: unknown | null;[key: string]: unknown | null } | null,\n ) => {\n const _item = { ...row.original };\n const updatedValue = directValue !== undefined ? directValue : editedCellValue;\n if (inlineEditing && updatedValue !== undefined) {\n _item[inlineEditing] = updatedValue;\n if (onRowEdit) onRowEdit(_item, index, inlineEditing, updatedValue, meta);\n if (removePendingEdit) removePendingEdit(String(row.original.id), inlineEditing);\n }\n handleCloseEdit();\n };\n\n const ref = useRef<HTMLElement>(null);\n\n const handleCellClick = (event: React.MouseEvent, data: string | Record<string, unknown>, idx: number, key: string) => {\n if (isCellClickDisabled) return;\n event?.stopPropagation();\n if (inlineEditing === key) return;\n\n if (onRowEdit) {\n if (inlineEditColumns?.includes(key)) {\n setInlineEditing(key);\n setEditedCellValue(String(row.original[key]));\n } else {\n const msg = tableConfig?.getSystemMessage?.('notAllowedInlineEdit') || 'Inline Edit is not allowed for this column';\n tableConfig?.showNotification?.('error', msg);\n }\n return;\n }\n\n if (onRowClick) {\n onRowClick(data, idx, row.original, rows?.map((_row: { original: unknown }) => _row.original) || []);\n } else if (!onRowClick && checkboxConfig) {\n const _id = row.original.id;\n const checkEvent = { target: { checked: !checkboxConfig.checkedIds.includes(_id) } };\n checkboxConfig.onItemCheck(checkEvent, _id);\n }\n };\n\n const toggleRowExpand = async () => {\n setLoadingExpand(true);\n if (getInnerRowData) {\n await getInnerRowData(row?.original?.id, row?.original, !(expandedRows?.[row?.original?.id as string]?.isOpen ?? false), row?.original?.__level || 0);\n }\n setLoadingExpand(false);\n };\n\n\n\n\n const totalWidth = useMemo(() => {\n return row.cells.filter((c: TableCell) => c.column?.visible).map((c: TableCell) => c.column?.width ?? 0).reduce((a: number, b: number) => a + b, 0);\n }, [row.cells]);\n\n const isDraggingOver = useMemo(() => {\n return dragConfig?.draggingOver && dragConfig?.draggingOver === row?.original?.id;\n }, [dragConfig, row?.original?.id]);\n\n const dropPosition = useMemo(() => {\n if (!isDraggingOver) return null;\n return dragConfig?.dropPosition || 'inside';\n }, [isDraggingOver, dragConfig?.dropPosition]);\n\n const isDraggingOverInside = Boolean(isDraggingOver && dropPosition === 'inside');\n\n const _meta = (row?.original?.__rowMetadata as TRowMetadata) || (row?.original?._meta as TRowMetadata | undefined);\n const _notHovering = rowHovering !== row?.original?.id;\n const _notLoading = !row?.original?.__isLoading;\n const _isNewRow = !!(\n _meta?.__is_new ||\n _meta?.__is_added ||\n row?.original?.is_added ||\n (currentData?.is_added as boolean) ||\n _meta?.is_added ||\n _meta?.is_new\n );\n const _isDeletedRow = !!(row?.original?.is_deleted || _meta?.__is_deleted || (currentData?.is_deleted as boolean) || _meta?.is_deleted);\n const _isModifiedRow =\n !!(\n row?.original?.is_modified ||\n row?.original?.is_row_modified ||\n _meta?.__is_modified ||\n _meta?.__is_edited ||\n (currentData?.is_row_modified as boolean) ||\n _meta?.is_modified\n ) && !_isNewRow;\n\n const isSelected =\n selectedRowId !== null && selectedRowId !== undefined && String(selectedRowId) === String(row?.original?.id);\n\n const bgColor = cn({\n 'bg-neutral-100 dark:bg-black-600': rowHovering === row?.original?.id && !isInlineEditing,\n 'bg-primary-100 dark:bg-primary-950': isSelected && _notHovering && !isInlineEditing,\n 'bg-primary-50 dark:bg-black-700': !row?.original?.is_read && showNewItem && !row?.original?.__isLoading && _notHovering && !isInlineEditing,\n // 'bg-white dark:bg-black-700': cell.column.sticky && rowHovering !== id,\n 'bg-warning-50 dark:bg-warning-975': _isModifiedRow && _notLoading && _notHovering && !isInlineEditing,\n 'bg-error-50 dark:bg-error-975': _isDeletedRow && _notLoading && _notHovering && !isInlineEditing,\n 'bg-success-50 dark:bg-success-975': _isNewRow && _notLoading && _notHovering && !isInlineEditing,\n 'bg-primary-50 dark:bg-primary-900': isInlineEditing,\n [getTableRowBgClassNamesByStatus[row?.original?.__rowBgStatus as string]]: row?.original?.__rowBgStatus && !isInlineEditing,\n });\n\n return (\n <tr\n {...row.getRowProps()}\n ref={withDraggable || withSortable ? setNodeRef : null}\n key={row.original.id}\n data-row-id={row.original.id}\n className={cn(\n `text-neutral-900 dark:text-white cursor-pointer min-w-full relative ${checkboxConfig?.selectionDisabledRowIds?.includes(row?.original?.id) ? 'opacity-50' : ''} border-t`,\n isDragging ? 'z-40' : '',\n isOverOtherContext() ? 'shadow-dnd-drop' : '',\n withDraggable && over && over?.data?.current?.type === 'table-file-dropzone' && over?.data?.current?.folderId === row?.original?.id && row?.original?.type === 'folder' ? 'bg-primary-50' : '',\n row?.original?.isDefinedActionRow ? 'bg-primary-50' : '',\n isDraggingOverInside ? 'z-50' : '',\n bgColor ? bgColor : 'bg-white dark:bg-black-800',\n )}\n style={{ ...style, ...(withSortable ? dndStyles : {}), width: 'max-content' }}\n {...(withDraggable || withSortable ? attributes : {})}\n {...(withDraggable || withSortable ? listeners : {})}\n >\n {isDraggingOverInside && dragConfig?.dragOperation ? (\n <div className='absolute right-2 h-row flex items-center z-20 pointer-events-none'>\n <div className='bg-primary-200 px-2 py-1 rounded'>\n {dragConfig?.dragOperation === 'COPY' ? (\n <AddRounded sx={{ fontSize: 12 }} className='text-primary-700' />\n ) : (\n <SubdirectoryArrowLeftRounded sx={{ fontSize: 12 }} className='text-primary-700' />\n )}\n </div>\n </div>\n ) : null}\n {isDraggingOverInside && !dragConfig?.dragOperation ? (\n <div className='absolute right-2 h-row flex items-center z-20 pointer-events-none'>\n <SubdirectoryArrowLeftRounded sx={{ fontSize: 16 }} className='text-primary-500' />\n </div>\n ) : null}\n {isDraggingOver && dropPosition === 'before' && !row?.original?.isDefinedActionRow ? (\n <div className='absolute -top-[1px] left-0 right-0 h-[2px] bg-primary-500 z-20 pointer-events-none'>\n <div className='absolute left-0 top-1/2 -translate-y-1/2 w-2 h-2 rounded-full bg-primary-500' />\n </div>\n ) : null}\n {isDraggingOver && dropPosition === 'after' && !row?.original?.isDefinedActionRow ? (\n <div className='absolute -bottom-[1px] left-0 right-0 h-[2px] bg-primary-500 z-20 pointer-events-none'>\n <div className='absolute left-0 top-1/2 -translate-y-1/2 w-2 h-2 rounded-full bg-primary-500' />\n </div>\n ) : null}\n\n {row?.original?.isDefinedActionRow ? (\n <ActionCell\n cells={row.cells}\n id={row?.original?.id}\n isCheckbox={checkboxConfig}\n level={level}\n name={row?.original?.name as string}\n onClick={row?.original?.onClick as () => void}\n rowHovering={rowHovering || ''}\n isRoot={row?.original?.isRoot as boolean}\n totalWidth={totalWidth}\n row={row.original as Record<string, unknown>}\n uploadCell={row?.original?.uploadCell as boolean}\n disabled={row?.original?.disabled as boolean}\n disabledTooltip={row?.original?.disabledTooltip as string}\n />\n ) : RowWrapper ? (\n <RowWrapper data={row.original} setIsDraggingFile={setIsDraggingFile}>\n <RowContent\n isDraggingOver={isDraggingOverInside}\n level={level}\n withDraggable={withDraggable}\n setDroppableNodeRef={setDroppableNodeRef}\n isLastRow={isLastRow}\n lastRow={lastRow}\n isCheckbox={isCheckbox}\n checkboxConfig={checkboxConfig}\n row={row}\n rowHovering={rowHovering}\n tableActions={tableActions}\n disableOptionsForRowIndex={disableOptionsForRowIndex}\n index={index}\n showNewItem={showNewItem}\n currentData={currentData}\n lastNonStickyColumnIndex={lastNonStickyColumnIndex}\n getSumOfNextVisibleColumnWidth={getSumOfNextVisibleColumnWidth}\n toggleRowExpand={toggleRowExpand}\n loadingExpand={loadingExpand}\n cellRef={ref}\n handleCellClick={handleCellClick}\n getFullRowDataOnClick={getFullRowDataOnClick}\n handleCellValueChange={handleCellValueChange}\n handleUpdateCellData={handleUpdateCellData}\n handleRowCancelEdit={handleRowCancelEdit}\n handleRowConfirmEdit={handleRowConfirmEdit}\n registerValidation={registerValidation}\n inlineEditing={inlineEditing}\n isInlineEditing={isInlineEditing}\n setRowHovering={setRowHovering}\n highlightSubstring={highlightSubstring}\n rowOptions={rowOptions}\n isDraggingFile={isDraggingFile}\n rowAdditionalActions={rowAdditionalActions}\n hoverConfig={hoverConfig}\n isSelected={isSelected}\n />\n </RowWrapper>\n ) : (\n <RowContent\n level={level}\n withDraggable={withDraggable}\n setDroppableNodeRef={setDroppableNodeRef}\n isLastRow={isLastRow}\n lastRow={lastRow}\n isCheckbox={isCheckbox}\n checkboxConfig={checkboxConfig}\n row={row}\n rowHovering={rowHovering}\n tableActions={tableActions}\n disableOptionsForRowIndex={disableOptionsForRowIndex}\n index={index}\n showNewItem={showNewItem}\n currentData={currentData}\n lastNonStickyColumnIndex={lastNonStickyColumnIndex}\n getSumOfNextVisibleColumnWidth={getSumOfNextVisibleColumnWidth}\n toggleRowExpand={toggleRowExpand}\n loadingExpand={loadingExpand}\n cellRef={ref}\n handleCellClick={handleCellClick}\n getFullRowDataOnClick={getFullRowDataOnClick}\n handleCellValueChange={handleCellValueChange}\n handleUpdateCellData={handleUpdateCellData}\n handleRowCancelEdit={handleRowCancelEdit}\n handleRowConfirmEdit={handleRowConfirmEdit}\n registerValidation={registerValidation}\n inlineEditing={inlineEditing}\n isInlineEditing={isInlineEditing}\n setRowHovering={setRowHovering}\n highlightSubstring={highlightSubstring}\n rowOptions={rowOptions}\n isDraggingFile={isDraggingFile}\n isDraggingOver={isDraggingOverInside}\n rowAdditionalActions={rowAdditionalActions}\n hoverConfig={hoverConfig}\n isSelected={isSelected}\n />\n )}\n </tr>\n );\n};\n\ninterface RowContentProps {\n withDraggable?: boolean;\n setDroppableNodeRef: (node: HTMLElement | null) => void;\n isLastRow?: boolean;\n lastRow?: unknown;\n isCheckbox: boolean;\n checkboxConfig: Record<string, unknown> | null;\n row: TableRowData;\n rowHovering: string | number | null;\n tableActions?: ((rowData: Record<string, unknown>, index: number) => React.ReactNode) | null;\n disableOptionsForRowIndex?: number | null;\n index: number;\n showNewItem?: boolean;\n currentData: Record<string, unknown> | null;\n lastNonStickyColumnIndex?: (() => number | null) | null;\n getSumOfNextVisibleColumnWidth?: (index: number) => number | null;\n toggleRowExpand: () => Promise<void>;\n loadingExpand: boolean;\n cellRef: React.RefObject<HTMLElement | null>;\n handleCellClick: (event: React.MouseEvent, data: string | Record<string, unknown>, idx: number, key: string) => void;\n getFullRowDataOnClick?: boolean;\n handleCellValueChange: (e: React.ChangeEvent<HTMLInputElement>) => void;\n handleUpdateCellData: (directValue?: string | boolean | null, meta?: Record<string, unknown> | null) => void;\n handleRowCancelEdit: () => void;\n handleRowConfirmEdit: () => void;\n registerValidation: (fn: () => { isValid: boolean; value?: string | boolean | null; meta?: Record<string, unknown> | null }) => void;\n inlineEditing: string | null;\n isInlineEditing: boolean;\n setRowHovering: (id: string | number | null) => void;\n highlightSubstring?: (value: string) => React.ReactNode;\n rowOptions?: TRowOption[] | ((rowData: Record<string, unknown>) => TRowOption[] | null) | null;\n level?: number;\n isDraggingFile?: boolean;\n isDraggingOver?: boolean;\n rowAdditionalActions?: unknown;\n hoverConfig?: { onHover?: (data: Record<string, unknown>) => React.ReactNode };\n isSelected?: boolean;\n}\n\nconst RowContent = ({\n withDraggable,\n setDroppableNodeRef,\n isLastRow,\n lastRow,\n isCheckbox,\n checkboxConfig,\n row,\n rowHovering,\n tableActions,\n disableOptionsForRowIndex,\n index,\n showNewItem,\n currentData,\n lastNonStickyColumnIndex,\n getSumOfNextVisibleColumnWidth,\n toggleRowExpand,\n loadingExpand,\n cellRef,\n handleCellClick,\n getFullRowDataOnClick,\n handleCellValueChange,\n handleUpdateCellData,\n handleRowCancelEdit,\n handleRowConfirmEdit,\n registerValidation,\n inlineEditing,\n isInlineEditing,\n setRowHovering,\n highlightSubstring,\n rowOptions,\n level,\n isDraggingFile,\n isDraggingOver,\n rowAdditionalActions,\n hoverConfig,\n isSelected,\n}: RowContentProps) => {\n const [isRowContentHovering, setIsRowContentHovering] = useState(false);\n const {\n getPendingEdit: getPendingEditFn,\n hasPendingEdit: hasPendingEditFn,\n pendingEdits,\n tableHeaders,\n pendingEditsCount,\n scrollToCell,\n } = useContext(TableContext);\n const rowHasPendingEdits = pendingEdits?.[row.original.id] && Object.keys(pendingEdits[row.original.id]).length > 0;\n const tableHasAnyPendingEdits = (pendingEditsCount ?? 0) > 0;\n const resolvedRowOptions = useMemo<TRowOption[]>(() => {\n if (Array.isArray(rowOptions)) return rowOptions;\n if (typeof rowOptions === 'function') {\n const options = rowOptions({ ...row.original, rowIndex: index });\n return Array.isArray(options) ? options : [];\n }\n return [];\n }, [rowOptions, row.original, index]);\n\n\n const _meta = (row?.original?.__rowMetadata as TRowMetadata | undefined) || (row?.original?._meta as TRowMetadata | undefined);\n const _notHovering = rowHovering !== row?.original?.id;\n const _notLoading = !row?.original?.__isLoading;\n const _isNewRow = !!(\n _meta?.__is_new ||\n _meta?.__is_added ||\n row?.original?.is_added ||\n (currentData?.is_added as boolean) ||\n _meta?.is_added ||\n _meta?.is_new\n );\n const _isDeletedRow = !!(row?.original?.is_deleted || _meta?.__is_deleted || (currentData?.is_deleted as boolean) || _meta?.is_deleted);\n const _isModifiedRow =\n !!(\n row?.original?.is_modified ||\n row?.original?.is_row_modified ||\n _meta?.__is_modified ||\n _meta?.__is_edited ||\n (currentData?.is_row_modified as boolean) ||\n _meta?.is_deleted\n ) && !_isNewRow;\n\n // Only apply the selected background when the row is not being hovered, so on hover the icon cells\n // (checkbox, actions, options) fall back to the same gray hover background as the data cells.\n const selectedBg =\n isSelected && !isInlineEditing && rowHovering !== row?.original?.id ? 'bg-primary-100 dark:bg-primary-950' : undefined;\n\n const statusBorderClass = cn('pointer-events-none absolute left-0 top-0 bottom-0 w-[3px] z-10', {\n 'bg-success-400 dark:bg-success-500': _isNewRow && _notLoading && _notHovering && !isInlineEditing,\n 'bg-error-400 dark:bg-error-500': _isDeletedRow && _notLoading && _notHovering && !isInlineEditing,\n 'bg-warning-400 dark:bg-warning-500': _isModifiedRow && _notLoading && _notHovering && !isInlineEditing,\n });\n\n return (\n <div\n ref={withDraggable ? setDroppableNodeRef : null}\n className={isDraggingOver ? 'border-2 border-primary-400 dark:border-primary-500 rounded-sm' : ''}\n >\n <div className={statusBorderClass} />\n <div className='flex' ref={isLastRow ? (lastRow as React.Ref<HTMLDivElement>) : null}>\n {tableHasAnyPendingEdits && (\n <PendingEditCell\n rowId={String(row.original.id)}\n rowIndex={index}\n pendingEdits={pendingEdits}\n tableHeaders={tableHeaders}\n rowHasPendingEdits={!!rowHasPendingEdits}\n rowHovering={rowHovering != null ? String(rowHovering) : undefined}\n isInlineEditing={isInlineEditing}\n is_read={!!row.original.is_read}\n is_modified={_isModifiedRow}\n is_row_modified={!!row.original.is_row_modified}\n is_deleted={_isDeletedRow}\n is_added={_isNewRow}\n is_incomplete={row?.original?.status === 'Incomplete'}\n showNewItem={showNewItem}\n onScrollToCell={scrollToCell}\n />\n )}\n\n {isCheckbox && (\n <CheckboxCell\n checkboxConfig={checkboxConfig as never}\n id={String(row.original.id)}\n rowHovering={rowHovering != null ? String(rowHovering) : undefined}\n isDisabled={!!row?.original?.__isLoading}\n isDraggingOver={isDraggingOver}\n is_added={_isNewRow}\n is_deleted={_isDeletedRow}\n is_incomplete={row?.original?.status === 'Incomplete'}\n is_modified={_isModifiedRow}\n is_read={!!row.original.is_read}\n is_row_modified={!!row.original.is_row_modified}\n showNewItem={showNewItem}\n currentData={currentData ?? {}}\n bgColor={row?.original?.__rowBgStatus ? getTableRowBgClassNamesByStatus[row?.original?.__rowBgStatus as string] : selectedBg}\n isInlineEditing={isInlineEditing}\n hasPendingEditsColumn={tableHasAnyPendingEdits}\n rowHasPendingEdits={rowHasPendingEdits}\n />\n )}\n\n {tableActions ? (\n <RowActionCell\n tableActions={tableActions as (rowData: Record<string, unknown>, index: number) => JSX.Element}\n disableOptionsForRowIndex={disableOptionsForRowIndex ?? null}\n id={String(row.original.id)}\n index={index}\n is_read={!!row?.original?.is_read}\n is_incomplete={row?.original?.status === 'Incomplete'}\n showNewItem={!!showNewItem}\n is_modified={_isModifiedRow}\n is_row_modified={!!row?.original?.is_row_modified}\n is_deleted={_isDeletedRow}\n currentData={currentData ?? {}}\n is_added={_isNewRow}\n rowData={row.original as Record<string, unknown>}\n rowHovering={rowHovering}\n isDisabled={!!row?.original?.__isLoading}\n bgColor={isDraggingFile ? 'bg-primary-50' : row?.original?.__rowBgStatus ? getTableRowBgClassNamesByStatus[row?.original?.__rowBgStatus as string] : selectedBg}\n isInlineEditing={isInlineEditing}\n rowHasPendingEdits={rowHasPendingEdits}\n />\n ) : null}\n\n <div\n className='relative flex-1'\n id={`row-${row.original.id}`}\n onMouseEnter={() => setIsRowContentHovering(true)}\n onMouseLeave={() => setIsRowContentHovering(false)}\n >\n {row.cells\n .filter((cell: TableCell) => cell?.column?.visible !== false)\n .map((cell: TableCell, y: number) => {\n const isLastCell = y === lastNonStickyColumnIndex?.();\n const isFirstStickyCell = y === (lastNonStickyColumnIndex?.() ?? -1) + 1;\n const nextWidthSum = cell?.column?.sticky ? (getSumOfNextVisibleColumnWidth?.(y) ?? 0) : 0;\n\n if (row.original?.__isLoading) {\n return (\n <LoaderCell cell={cell as unknown as { column: { width: number; sticky?: boolean; sequence?: number } }} id={y} nextWidthSum={nextWidthSum} isLastCell={isLastCell} rowHovering={rowHovering} index={y} key={y} isFirstStickyCell={isFirstStickyCell} />\n );\n }\n\n const pendingEdit = getPendingEditFn?.(String(row.original.id), cell?.column?.key || '');\n const hasPending = hasPendingEditFn?.(String(row.original.id), cell?.column?.key || '');\n\n return (\n <DataCell\n cell={cell as unknown as import('../../types').ICell}\n rowHovering={rowHovering}\n isFirstStickyCell={isFirstStickyCell}\n level={level ?? 0}\n toggleRowExpand={toggleRowExpand}\n loadingExpand={loadingExpand}\n key={cell?.column?.key}\n index={y}\n cellRef={cellRef as React.RefObject<HTMLDivElement>}\n currentData={currentData as { is_row_modified?: boolean; is_deleted?: boolean; is_added?: boolean }}\n handleCellClick={(e?: React.MouseEvent) => { if (e) handleCellClick(e, getFullRowDataOnClick ? row.original : String(row.original.id), y, cell?.column?.key || ''); }}\n handleCellValueChange={handleCellValueChange}\n handleUpdateCellData={handleUpdateCellData}\n registerValidation={registerValidation}\n id={row.original.id}\n inlineEditing={inlineEditing}\n isInlineEditing={isInlineEditing}\n isLastCell={isLastCell}\n is_incomplete={row?.original?.status === 'Incomplete'}\n is_added={_isNewRow}\n is_deleted={_isDeletedRow}\n is_modified={_isModifiedRow}\n is_read={!!row.original.is_read}\n is_row_modified={!!row.original.is_row_modified}\n nextWidthSum={nextWidthSum}\n setRowHovering={setRowHovering}\n highlightSubstring={highlightSubstring as ((value: string) => JSX.Element) | undefined}\n isDraggingOver={isDraggingOver}\n isLoading={!!row?.original?.__isLoading}\n pendingEdit={pendingEdit}\n hasPendingEdit={hasPending}\n pendingValidationError={pendingEdit?.validationError}\n />\n );\n })}\n\n {hoverConfig?.onHover &&\n isRowContentHovering &&\n createPortal(\n <div className='absolute top-full left-10 z-50 bg-white dark:bg-black-800 rounded-xl'>{hoverConfig.onHover(row.original) as React.ReactNode}</div>,\n document.getElementById(`row-${row.original.id}`) as HTMLElement,\n )}\n </div>\n\n {(resolvedRowOptions.length > 0 || !!rowAdditionalActions) && (\n <RowOptionsCell\n rowId={row.original.id}\n rowOptions={resolvedRowOptions}\n disableOption={disableOptionsForRowIndex !== null || !!row?.original?.__isLoading}\n rowHovering={rowHovering}\n setRowHovering={setRowHovering}\n is_read={!!row.original.is_read}\n showNewItem={!!showNewItem}\n is_modified={_isModifiedRow}\n is_row_modified={!!row.original.is_row_modified}\n is_incomplete={row?.original?.status === 'Incomplete'}\n currentData={currentData ?? {}}\n is_deleted={_isDeletedRow}\n is_added={_isNewRow}\n isDraggingOver={!!isDraggingOver}\n rowAdditionalActions={rowAdditionalActions as (rowData: Record<string, unknown>, index: number, isHovering: boolean) => React.ReactNode}\n rowData={row.original as Record<string, unknown>}\n index={index}\n bgColor={row?.original?.__rowBgStatus ? getTableRowBgClassNamesByStatus[row?.original?.__rowBgStatus as string] : selectedBg}\n isInlineEditing={isInlineEditing}\n onConfirmEdit={handleRowConfirmEdit}\n onCancelEdit={handleRowCancelEdit}\n rowHasPendingEdits={rowHasPendingEdits}\n />\n )}\n </div>\n </div>\n );\n};\n"],"names":["Row","row","isLastRow","lastRow","highlightSubstring","index","style","level","expandedRows","rows","lastNonStickyColumnIndex","checkboxConfig","onRowClick","rowOptions","disableOptionsForRowIndex","getSumOfNextVisibleColumnWidth","onRowEdit","inlineEditColumns","tableActions","dndSortableUtils","withSortable","withDraggable","getInnerRowData","showNewItem","rawData","dragConfig","getFullRowDataOnClick","selectedRowId","RowWrapper","isCellClickDisabled","rowAdditionalActions","hoverConfig","addPendingEdit","removePendingEdit","fieldOperationLoading","clearRowPendingEdits","saveRowPendingEdits","contextPendingEdits","useContext","TableContext","tableConfig","useTableConfig","isCheckbox","activeInlineEdit","setActiveInlineEdit","inlineEditing","isInlineEditing","setInlineEditing","columnKey","rowHovering","setRowHovering","useState","editedCellValue","setEditedCellValue","currentData","setCurrentData","loadingExpand","setLoadingExpand","isDraggingFile","setIsDraggingFile","prevInlineEditingRef","useRef","useEffect","wasEditing","isNowEditing","pendingEdit","currentCell","c","result","validateCellValue","idKey","sortableResult","useSortable","draggableResult","useDraggable","listeners","transform","setNodeRef","isDragging","attributes","active","over","rest","setDroppableNodeRef","useDroppable","dndStyles","CSS","isOverOtherContext","handleCellValueChange","e","handleCloseEdit","validationRef","registerValidation","useCallback","validateFn","tableConfigRef","handleRowCancelEdit","handleRowConfirmEdit","pendingValue","valueToValidate","handleUpdateCellData","directValue","meta","_item","updatedValue","ref","handleCellClick","event","data","idx","key","msg","_row","_id","checkEvent","toggleRowExpand","totalWidth","useMemo","a","b","isDraggingOver","dropPosition","isDraggingOverInside","_meta","_notHovering","_notLoading","_isNewRow","_isDeletedRow","_isModifiedRow","isSelected","bgColor","cn","getTableRowBgClassNamesByStatus","createElement","jsx","AddRounded","SubdirectoryArrowLeftRounded","ActionCell","RowContent","cellRef","isRowContentHovering","setIsRowContentHovering","getPendingEditFn","hasPendingEditFn","pendingEdits","tableHeaders","pendingEditsCount","scrollToCell","rowHasPendingEdits","tableHasAnyPendingEdits","resolvedRowOptions","options","selectedBg","statusBorderClass","jsxs","PendingEditCell","CheckboxCell","RowActionCell","cell","y","isLastCell","isFirstStickyCell","nextWidthSum","LoaderCell","hasPending","DataCell","createPortal","RowOptionsCell"],"mappings":";;;;;;;;;;;;;;;;;;;;AAwGO,MAAMA,KAAM,CAAC,EAAE,KAAAC,GAAK,WAAAC,GAAW,SAAAC,GAAS,oBAAAC,IAAoB,OAAAC,GAAO,OAAAC,IAAO,OAAAC,IAAQ,GAAG,cAAAC,GAAc,MAAAC,SAAmB;AAC3H,QAAM;AAAA,IACJ,0BAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,YAAAC;AAAA,IACA,2BAAAC,IAA4B;AAA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,GAAmB,SAAS,KAAK,CAAC,CAACxH,OACnC,gBAAAwG;AAAA,YAACiC;AAAA,YAAA;AAAA,cACC,OAAOtK,EAAI,SAAS;AAAA,cACpB,YAAYqJ;AAAA,cACZ,eAAexI,MAA8B,QAAQ,CAAC,CAACb,GAAK,UAAU;AAAA,cACtE,aAAAgD;AAAA,cACA,gBAAAC;AAAA,cACA,SAAS,CAAC,CAACjD,EAAI,SAAS;AAAA,cACxB,aAAa,CAAC,CAACsB;AAAA,cACf,aAAayG;AAAA,cACb,iBAAiB,CAAC,CAAC/H,EAAI,SAAS;AAAA,cAChC,eAAeA,GAAK,UAAU,WAAW;AAAA,cACzC,aAAaqD,KAAe,CAAA;AAAA,cAC5B,YAAYyE;AAAA,cACZ,UAAUD;AAAA,cACV,gBAAgB,CAAC,CAACN;AAAA,cAClB,sBAAA1F;AAAA,cACA,SAAS7B,EAAI;AAAA,cACb,OAAAI;AAAA,cACA,SAASJ,GAAK,UAAU,gBAAgBmI,GAAgCnI,GAAK,UAAU,aAAuB,IAAIuJ;AAAA,cAClH,iBAAA1G;AAAA,cACA,eAAemD;AAAA,cACf,cAAcD;AAAA,cACd,oBAAAoD;AAAA,YAAA;AAAA,UAAA;AAAA,QACF,EAAA,CAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"row.es.js","sources":["../../../../../../src/components/data-display/infinite-table/body/rows/row.tsx"],"sourcesContent":["import { getTableRowBgClassNamesByStatus } from '../../../../../constants/table';\nimport { useTableConfig } from '../../../../../providers/design-system-provider/hooks';\nimport { useDraggable, useDroppable } from '@dnd-kit/core';\nimport { useSortable } from '@dnd-kit/sortable';\nimport { CSS } from '@dnd-kit/utilities';\nimport { SubdirectoryArrowLeftRounded } from '@mui/icons-material';\nimport AddRounded from '@mui/icons-material/AddRounded';\nimport cn from 'classnames';\nimport React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { TableContext } from '../../context';\nimport { ActionCell } from '../cell/ActionCell';\nimport { CheckboxCell } from '../cell/CheckboxCell';\nimport { DataCell } from '../cell/DataCell';\nimport { validateCellValue } from '../../validateCell';\nimport { LoaderCell } from '../cell/LoaderCell';\nimport { PendingEditCell } from '../cell/PendingEditCell';\nimport { RowActionCell } from '../cell/RowActionCell';\nimport { RowOptionsCell } from '../cell/RowOptionsCell';\n\ntype TRowMetadata = {\n is_modified: object;\n is_new: boolean;\n is_deleted: boolean;\n is_added: boolean;\n __is_modified?: boolean;\n __is_edited?: boolean;\n __is_deleted?: boolean;\n __is_new?: boolean;\n __is_added?: boolean;\n};\n\ninterface TableCell {\n column: {\n key?: string;\n visible?: boolean;\n width?: number;\n sticky?: boolean;\n Header?: string;\n type?: string;\n is_required?: boolean;\n meta?: Record<string, unknown>;\n [key: string]: unknown;\n };\n value?: unknown;\n [key: string]: unknown;\n}\n\ninterface RowOriginal {\n id: string | number;\n is_read?: boolean;\n is_modified?: boolean;\n is_row_modified?: boolean;\n is_deleted?: boolean;\n is_added?: boolean;\n status?: string;\n type?: string;\n __isLoading?: boolean;\n __level?: number;\n __rowBgStatus?: string;\n __rowMetadata?: { __is_modified?: boolean };\n isDefinedActionRow?: boolean;\n isRoot?: boolean;\n name?: string | { props?: { text?: string } };\n onClick?: () => void;\n uploadCell?: boolean;\n disabled?: boolean;\n disabledTooltip?: string;\n [key: string]: unknown;\n}\n\ninterface TableRowData {\n original: RowOriginal;\n cells: TableCell[];\n getRowProps: () => Record<string, unknown>;\n index: number;\n [key: string]: unknown;\n}\n\ntype TRowOption = {\n key: string;\n label: React.ReactNode;\n isVisible?: boolean;\n [k: string]: unknown;\n};\n\ntype TProps = {\n row: TableRowData;\n isLastRow?: boolean;\n lastRow?: unknown;\n getSubRows?: () => unknown;\n prepareRow?: (row: unknown) => void;\n highlightSubstring?: (value: string) => JSX.Element;\n index: number;\n style?: Record<string, unknown>;\n visibleSubRowIds?: Record<string, unknown>;\n rowsLength?: number;\n level?: number;\n columns?: Record<string, unknown>;\n expandedRows?: Record<string, { isOpen: boolean }>;\n rows?: Array<{ original: unknown }>;\n};\n\nexport const Row = ({ row, isLastRow, lastRow, highlightSubstring, index, style, level = 0, expandedRows, rows }: TProps) => {\n const {\n lastNonStickyColumnIndex,\n checkboxConfig,\n onRowClick,\n rowOptions,\n disableOptionsForRowIndex = null,\n getSumOfNextVisibleColumnWidth,\n onRowEdit,\n inlineEditColumns,\n tableActions,\n dndSortableUtils,\n withSortable,\n withDraggable,\n getInnerRowData,\n showNewItem,\n rawData,\n dragConfig,\n getFullRowDataOnClick,\n selectedRowId,\n rowWrapper: RowWrapper,\n isCellClickDisabled,\n rowAdditionalActions,\n hoverConfig,\n addPendingEdit,\n removePendingEdit,\n fieldOperationLoading,\n clearRowPendingEdits,\n saveRowPendingEdits,\n pendingEdits: contextPendingEdits,\n } = useContext(TableContext);\n\n const tableConfig = useTableConfig();\n\n const isCheckbox = Boolean(checkboxConfig);\n const { activeInlineEdit, setActiveInlineEdit } = useContext(TableContext);\n const inlineEditing = activeInlineEdit?.rowId === row.original.id ? activeInlineEdit?.columnKey : null;\n const isInlineEditing = Boolean(inlineEditing);\n const setInlineEditing = (columnKey: string | null) => {\n if (columnKey === null) setActiveInlineEdit?.(null);\n else setActiveInlineEdit?.({ rowId: String(row.original.id), columnKey });\n };\n const [rowHovering, setRowHovering] = useState<string | number | null>(null);\n const [editedCellValue, setEditedCellValue] = useState<string | null>(null);\n const [currentData, setCurrentData] = useState<Record<string, unknown> | null>(null);\n const [loadingExpand, setLoadingExpand] = useState(false);\n const [isDraggingFile, setIsDraggingFile] = useState(false);\n\n const prevInlineEditingRef = useRef<string | null>(null);\n useEffect(() => {\n const wasEditing = prevInlineEditingRef.current;\n const isNowEditing = inlineEditing;\n\n if (wasEditing && !isNowEditing) {\n const pendingEdit = contextPendingEdits?.[row.original.id]?.[wasEditing];\n if (pendingEdit) {\n const currentCell = row.cells?.find((c: TableCell) => c.column?.key === wasEditing);\n if (currentCell) {\n const result = validateCellValue(pendingEdit.value, currentCell.column as { type?: string; is_required?: boolean });\n if (!result.isValid && addPendingEdit) {\n addPendingEdit(String(row.original.id), wasEditing, {\n ...pendingEdit,\n validationError: result.error,\n });\n }\n }\n }\n }\n\n prevInlineEditingRef.current = isNowEditing ?? null;\n }, [inlineEditing, row.original.id, row.cells, contextPendingEdits, addPendingEdit]);\n\n useEffect(() => {\n if (rawData) {\n const idKey = String(row?.original?.id);\n setCurrentData(rawData[idKey]?.[row?.cells[0].column.Header as string] || rawData[idKey]?.[0]);\n }\n }, [rawData, row?.original?.id, row?.cells]);\n\n const sortableResult = useSortable({ id: row.original.id, data: { ...row.original }, disabled: !withSortable });\n const draggableResult = useDraggable({ id: row.original.id, data: { ...row.original }, disabled: !!withSortable });\n const { listeners, transform, setNodeRef, isDragging, attributes, active, over, ...rest } = withSortable\n ? sortableResult\n : draggableResult;\n\n const { setNodeRef: setDroppableNodeRef } = useDroppable({\n id: `table-file-dropzone-${row?.original?.id}`,\n data: { type: 'table-file-dropzone', folderId: row?.original?.id, isFolder: row?.original?.type === 'folder' },\n });\n\n const dndStyles = {\n transform: CSS.Transform.toString(transform),\n transition: withSortable ? (rest as { transition?: string }).transition : undefined,\n cursor: isDragging ? 'grabbing' : 'grab',\n opacity: isDragging ? '0.5' : '1',\n };\n\n const isOverOtherContext = (): boolean => {\n if (!active || !over || !withSortable) return false;\n if (dndSortableUtils?.checkOverEachItem) return dndSortableUtils.checkOverEachItem(active, over) && Boolean(over);\n return active.data.current?.type !== over.data.current?.type && Boolean(over);\n };\n\n const handleCellValueChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n setEditedCellValue(e.target.value);\n };\n\n const handleCloseEdit = () => {\n if (fieldOperationLoading) return;\n setInlineEditing(null);\n };\n\n const validationRef = useRef<(() => { isValid: boolean; value?: string | boolean | null; meta?: Record<string, unknown> | null }) | null>(null);\n\n const registerValidation = useCallback(\n (validateFn: () => { isValid: boolean; value?: string | boolean | null; meta?: Record<string, unknown> | null }) => {\n validationRef.current = validateFn;\n },\n [],\n );\n\n const tableConfigRef = useRef(tableConfig);\n tableConfigRef.current = tableConfig;\n\n const handleRowCancelEdit = useCallback(() => {\n if (clearRowPendingEdits) clearRowPendingEdits(String(row.original.id));\n }, [clearRowPendingEdits, row.original.id]);\n\n const handleRowConfirmEdit = useCallback(() => {\n if (validationRef.current) {\n const result = validationRef.current();\n if (!result.isValid) return;\n if (inlineEditing && result.value !== undefined && addPendingEdit) {\n addPendingEdit(String(row.original.id), inlineEditing, {\n value: result.value,\n originalValue: row.original[inlineEditing],\n meta: result.meta || undefined,\n });\n }\n } else if (inlineEditing) {\n const currentCell = row.cells?.find((c: TableCell) => c.column?.key === inlineEditing);\n if (currentCell) {\n const pendingValue = contextPendingEdits?.[row.original.id]?.[inlineEditing]?.value;\n const valueToValidate = pendingValue !== undefined ? pendingValue : currentCell.value;\n const result = validateCellValue(valueToValidate as string | boolean | null | undefined, currentCell.column as { type?: string; is_required?: boolean });\n if (!result.isValid) {\n tableConfigRef.current?.showNotification?.('error', result.error || 'Validation failed');\n return;\n }\n }\n }\n\n if (saveRowPendingEdits) saveRowPendingEdits(String(row.original.id));\n }, [saveRowPendingEdits, row.original, row.cells, inlineEditing, addPendingEdit, contextPendingEdits]);\n\n const handleUpdateCellData = (\n directValue?: string | boolean | null,\n meta?: { currency_code?: string | null; reference?: unknown | null;[key: string]: unknown | null } | null,\n ) => {\n const _item = { ...row.original };\n const updatedValue = directValue !== undefined ? directValue : editedCellValue;\n if (inlineEditing && updatedValue !== undefined) {\n _item[inlineEditing] = updatedValue;\n if (onRowEdit) onRowEdit(_item, index, inlineEditing, updatedValue, meta);\n if (removePendingEdit) removePendingEdit(String(row.original.id), inlineEditing);\n }\n handleCloseEdit();\n };\n\n const ref = useRef<HTMLElement>(null);\n\n const handleCellClick = (event: React.MouseEvent, data: string | Record<string, unknown>, idx: number, key: string) => {\n if (isCellClickDisabled) return;\n event?.stopPropagation();\n if (inlineEditing === key) return;\n\n if (onRowEdit) {\n if (inlineEditColumns?.includes(key)) {\n setInlineEditing(key);\n setEditedCellValue(String(row.original[key]));\n } else {\n const msg = tableConfig?.getSystemMessage?.('notAllowedInlineEdit') || 'Inline Edit is not allowed for this column';\n tableConfig?.showNotification?.('error', msg);\n }\n return;\n }\n\n if (onRowClick) {\n onRowClick(data, idx, row.original, rows?.map((_row: { original: unknown }) => _row.original) || []);\n } else if (!onRowClick && checkboxConfig) {\n const _id = row.original.id;\n const checkEvent = { target: { checked: !checkboxConfig.checkedIds.includes(_id) } };\n checkboxConfig.onItemCheck(checkEvent, _id);\n }\n };\n\n const toggleRowExpand = async () => {\n setLoadingExpand(true);\n if (getInnerRowData) {\n await getInnerRowData(row?.original?.id, row?.original, !(expandedRows?.[row?.original?.id as string]?.isOpen ?? false), row?.original?.__level || 0);\n }\n setLoadingExpand(false);\n };\n\n\n\n\n const totalWidth = useMemo(() => {\n return row.cells.filter((c: TableCell) => c.column?.visible).map((c: TableCell) => c.column?.width ?? 0).reduce((a: number, b: number) => a + b, 0);\n }, [row.cells]);\n\n const isDraggingOver = useMemo(() => {\n return dragConfig?.draggingOver && dragConfig?.draggingOver === row?.original?.id;\n }, [dragConfig, row?.original?.id]);\n\n const dropPosition = useMemo(() => {\n if (!isDraggingOver) return null;\n return dragConfig?.dropPosition || 'inside';\n }, [isDraggingOver, dragConfig?.dropPosition]);\n\n const isDraggingOverInside = Boolean(isDraggingOver && dropPosition === 'inside');\n\n const _meta = (row?.original?.__rowMetadata as TRowMetadata) || (row?.original?._meta as TRowMetadata | undefined);\n const _notHovering = rowHovering !== row?.original?.id;\n const _notLoading = !row?.original?.__isLoading;\n const _isNewRow = !!(\n _meta?.__is_new ||\n _meta?.__is_added ||\n row?.original?.is_added ||\n (currentData?.is_added as boolean) ||\n _meta?.is_added ||\n _meta?.is_new\n );\n const _isDeletedRow = !!(row?.original?.is_deleted || _meta?.__is_deleted || (currentData?.is_deleted as boolean) || _meta?.is_deleted);\n const _isModifiedRow =\n !!(\n row?.original?.is_modified ||\n row?.original?.is_row_modified ||\n _meta?.__is_modified ||\n _meta?.__is_edited ||\n (currentData?.is_row_modified as boolean) ||\n _meta?.is_modified\n ) && !_isNewRow;\n\n const isSelected =\n selectedRowId !== null && selectedRowId !== undefined && String(selectedRowId) === String(row?.original?.id);\n\n const bgColor = cn({\n 'bg-neutral-100 dark:bg-black-600': rowHovering === row?.original?.id && !isInlineEditing,\n 'bg-primary-100 dark:bg-primary-950': isSelected && _notHovering && !isInlineEditing,\n 'bg-primary-50 dark:bg-black-700': !row?.original?.is_read && showNewItem && !row?.original?.__isLoading && _notHovering && !isInlineEditing,\n // 'bg-white dark:bg-black-700': cell.column.sticky && rowHovering !== id,\n 'bg-warning-50 dark:bg-warning-975': _isModifiedRow && _notLoading && _notHovering && !isInlineEditing,\n 'bg-error-50 dark:bg-error-975': _isDeletedRow && _notLoading && _notHovering && !isInlineEditing,\n 'bg-success-50 dark:bg-success-975': _isNewRow && _notLoading && _notHovering && !isInlineEditing,\n 'bg-primary-50 dark:bg-primary-900': isInlineEditing,\n [getTableRowBgClassNamesByStatus[row?.original?.__rowBgStatus as string]]: row?.original?.__rowBgStatus && !isInlineEditing,\n });\n\n return (\n <tr\n {...row.getRowProps()}\n ref={withDraggable || withSortable ? setNodeRef : null}\n key={row.original.id}\n data-row-id={row.original.id}\n className={cn(\n `text-neutral-900 dark:text-white cursor-pointer min-w-full relative ${checkboxConfig?.selectionDisabledRowIds?.includes(row?.original?.id) ? 'opacity-50' : ''} border-t`,\n isDragging ? 'z-40' : '',\n isOverOtherContext() ? 'shadow-dnd-drop' : '',\n withDraggable && over && over?.data?.current?.type === 'table-file-dropzone' && over?.data?.current?.folderId === row?.original?.id && row?.original?.type === 'folder' ? 'bg-primary-50' : '',\n row?.original?.isDefinedActionRow ? 'bg-primary-50' : '',\n isDraggingOverInside ? 'z-50' : '',\n bgColor ? bgColor : 'bg-white dark:bg-black-800',\n )}\n style={{ ...style, ...(withSortable ? dndStyles : {}), width: 'max-content' }}\n {...(withDraggable || withSortable ? attributes : {})}\n {...(withDraggable || withSortable ? listeners : {})}\n >\n {isDraggingOverInside && dragConfig?.dragOperation ? (\n <div className='absolute right-2 h-row flex items-center z-20 pointer-events-none'>\n <div className='bg-primary-200 px-2 py-1 rounded'>\n {dragConfig?.dragOperation === 'COPY' ? (\n <AddRounded sx={{ fontSize: 12 }} className='text-primary-700' />\n ) : (\n <SubdirectoryArrowLeftRounded sx={{ fontSize: 12 }} className='text-primary-700' />\n )}\n </div>\n </div>\n ) : null}\n {isDraggingOverInside && !dragConfig?.dragOperation ? (\n <div className='absolute right-2 h-row flex items-center z-20 pointer-events-none'>\n <SubdirectoryArrowLeftRounded sx={{ fontSize: 16 }} className='text-primary-500' />\n </div>\n ) : null}\n {isDraggingOver && dropPosition === 'before' && !row?.original?.isDefinedActionRow ? (\n <div className='absolute -top-[1px] left-0 right-0 h-[2px] bg-primary-500 z-20 pointer-events-none'>\n <div className='absolute left-0 top-1/2 -translate-y-1/2 w-2 h-2 rounded-full bg-primary-500' />\n </div>\n ) : null}\n {isDraggingOver && dropPosition === 'after' && !row?.original?.isDefinedActionRow ? (\n <div className='absolute -bottom-[1px] left-0 right-0 h-[2px] bg-primary-500 z-20 pointer-events-none'>\n <div className='absolute left-0 top-1/2 -translate-y-1/2 w-2 h-2 rounded-full bg-primary-500' />\n </div>\n ) : null}\n\n {row?.original?.isDefinedActionRow ? (\n <ActionCell\n cells={row.cells}\n id={row?.original?.id}\n isCheckbox={checkboxConfig}\n level={level}\n name={row?.original?.name as string}\n onClick={row?.original?.onClick as () => void}\n rowHovering={rowHovering || ''}\n isRoot={row?.original?.isRoot as boolean}\n totalWidth={totalWidth}\n row={row.original as Record<string, unknown>}\n uploadCell={row?.original?.uploadCell as boolean}\n disabled={row?.original?.disabled as boolean}\n disabledTooltip={row?.original?.disabledTooltip as string}\n />\n ) : RowWrapper ? (\n <RowWrapper data={row.original} setIsDraggingFile={setIsDraggingFile}>\n <RowContent\n isDraggingOver={isDraggingOverInside}\n level={level}\n withDraggable={withDraggable}\n setDroppableNodeRef={setDroppableNodeRef}\n isLastRow={isLastRow}\n lastRow={lastRow}\n isCheckbox={isCheckbox}\n checkboxConfig={checkboxConfig}\n row={row}\n rowHovering={rowHovering}\n tableActions={tableActions}\n disableOptionsForRowIndex={disableOptionsForRowIndex}\n index={index}\n showNewItem={showNewItem}\n currentData={currentData}\n lastNonStickyColumnIndex={lastNonStickyColumnIndex}\n getSumOfNextVisibleColumnWidth={getSumOfNextVisibleColumnWidth}\n toggleRowExpand={toggleRowExpand}\n loadingExpand={loadingExpand}\n cellRef={ref}\n handleCellClick={handleCellClick}\n getFullRowDataOnClick={getFullRowDataOnClick}\n handleCellValueChange={handleCellValueChange}\n handleUpdateCellData={handleUpdateCellData}\n handleRowCancelEdit={handleRowCancelEdit}\n handleRowConfirmEdit={handleRowConfirmEdit}\n registerValidation={registerValidation}\n inlineEditing={inlineEditing}\n isInlineEditing={isInlineEditing}\n setRowHovering={setRowHovering}\n highlightSubstring={highlightSubstring}\n rowOptions={rowOptions}\n isDraggingFile={isDraggingFile}\n rowAdditionalActions={rowAdditionalActions}\n hoverConfig={hoverConfig}\n isSelected={isSelected}\n />\n </RowWrapper>\n ) : (\n <RowContent\n level={level}\n withDraggable={withDraggable}\n setDroppableNodeRef={setDroppableNodeRef}\n isLastRow={isLastRow}\n lastRow={lastRow}\n isCheckbox={isCheckbox}\n checkboxConfig={checkboxConfig}\n row={row}\n rowHovering={rowHovering}\n tableActions={tableActions}\n disableOptionsForRowIndex={disableOptionsForRowIndex}\n index={index}\n showNewItem={showNewItem}\n currentData={currentData}\n lastNonStickyColumnIndex={lastNonStickyColumnIndex}\n getSumOfNextVisibleColumnWidth={getSumOfNextVisibleColumnWidth}\n toggleRowExpand={toggleRowExpand}\n loadingExpand={loadingExpand}\n cellRef={ref}\n handleCellClick={handleCellClick}\n getFullRowDataOnClick={getFullRowDataOnClick}\n handleCellValueChange={handleCellValueChange}\n handleUpdateCellData={handleUpdateCellData}\n handleRowCancelEdit={handleRowCancelEdit}\n handleRowConfirmEdit={handleRowConfirmEdit}\n registerValidation={registerValidation}\n inlineEditing={inlineEditing}\n isInlineEditing={isInlineEditing}\n setRowHovering={setRowHovering}\n highlightSubstring={highlightSubstring}\n rowOptions={rowOptions}\n isDraggingFile={isDraggingFile}\n isDraggingOver={isDraggingOverInside}\n rowAdditionalActions={rowAdditionalActions}\n hoverConfig={hoverConfig}\n isSelected={isSelected}\n />\n )}\n </tr>\n );\n};\n\ninterface RowContentProps {\n withDraggable?: boolean;\n setDroppableNodeRef: (node: HTMLElement | null) => void;\n isLastRow?: boolean;\n lastRow?: unknown;\n isCheckbox: boolean;\n checkboxConfig: Record<string, unknown> | null;\n row: TableRowData;\n rowHovering: string | number | null;\n tableActions?: ((rowData: Record<string, unknown>, index: number) => React.ReactNode) | null;\n disableOptionsForRowIndex?: number | null;\n index: number;\n showNewItem?: boolean;\n currentData: Record<string, unknown> | null;\n lastNonStickyColumnIndex?: (() => number | null) | null;\n getSumOfNextVisibleColumnWidth?: (index: number) => number | null;\n toggleRowExpand: () => Promise<void>;\n loadingExpand: boolean;\n cellRef: React.RefObject<HTMLElement | null>;\n handleCellClick: (event: React.MouseEvent, data: string | Record<string, unknown>, idx: number, key: string) => void;\n getFullRowDataOnClick?: boolean;\n handleCellValueChange: (e: React.ChangeEvent<HTMLInputElement>) => void;\n handleUpdateCellData: (directValue?: string | boolean | null, meta?: Record<string, unknown> | null) => void;\n handleRowCancelEdit: () => void;\n handleRowConfirmEdit: () => void;\n registerValidation: (fn: () => { isValid: boolean; value?: string | boolean | null; meta?: Record<string, unknown> | null }) => void;\n inlineEditing: string | null;\n isInlineEditing: boolean;\n setRowHovering: (id: string | number | null) => void;\n highlightSubstring?: (value: string) => React.ReactNode;\n rowOptions?: TRowOption[] | ((rowData: Record<string, unknown>) => TRowOption[] | null) | null;\n level?: number;\n isDraggingFile?: boolean;\n isDraggingOver?: boolean;\n rowAdditionalActions?: unknown;\n hoverConfig?: { onHover?: (data: Record<string, unknown>) => React.ReactNode };\n isSelected?: boolean;\n}\n\nconst RowContent = ({\n withDraggable,\n setDroppableNodeRef,\n isLastRow,\n lastRow,\n isCheckbox,\n checkboxConfig,\n row,\n rowHovering,\n tableActions,\n disableOptionsForRowIndex,\n index,\n showNewItem,\n currentData,\n lastNonStickyColumnIndex,\n getSumOfNextVisibleColumnWidth,\n toggleRowExpand,\n loadingExpand,\n cellRef,\n handleCellClick,\n getFullRowDataOnClick,\n handleCellValueChange,\n handleUpdateCellData,\n handleRowCancelEdit,\n handleRowConfirmEdit,\n registerValidation,\n inlineEditing,\n isInlineEditing,\n setRowHovering,\n highlightSubstring,\n rowOptions,\n level,\n isDraggingFile,\n isDraggingOver,\n rowAdditionalActions,\n hoverConfig,\n isSelected,\n}: RowContentProps) => {\n const [isRowContentHovering, setIsRowContentHovering] = useState(false);\n const {\n getPendingEdit: getPendingEditFn,\n hasPendingEdit: hasPendingEditFn,\n pendingEdits,\n tableHeaders,\n pendingEditsCount,\n scrollToCell,\n } = useContext(TableContext);\n const rowHasPendingEdits = pendingEdits?.[row.original.id] && Object.keys(pendingEdits[row.original.id]).length > 0;\n const tableHasAnyPendingEdits = (pendingEditsCount ?? 0) > 0;\n const resolvedRowOptions = useMemo<TRowOption[]>(() => {\n if (Array.isArray(rowOptions)) return rowOptions;\n if (typeof rowOptions === 'function') {\n const options = rowOptions({ ...row.original, rowIndex: index });\n return Array.isArray(options) ? options : [];\n }\n return [];\n }, [rowOptions, row.original, index]);\n\n\n const _meta = (row?.original?.__rowMetadata as TRowMetadata | undefined) || (row?.original?._meta as TRowMetadata | undefined);\n const _notHovering = rowHovering !== row?.original?.id;\n const _notLoading = !row?.original?.__isLoading;\n const _isNewRow = !!(\n _meta?.__is_new ||\n _meta?.__is_added ||\n row?.original?.is_added ||\n (currentData?.is_added as boolean) ||\n _meta?.is_added ||\n _meta?.is_new\n );\n const _isDeletedRow = !!(row?.original?.is_deleted || _meta?.__is_deleted || (currentData?.is_deleted as boolean) || _meta?.is_deleted);\n const _isModifiedRow =\n !!(\n row?.original?.is_modified ||\n row?.original?.is_row_modified ||\n _meta?.__is_modified ||\n _meta?.__is_edited ||\n (currentData?.is_row_modified as boolean) ||\n _meta?.is_deleted\n ) && !_isNewRow;\n\n // Only apply the selected background when the row is not being hovered, so on hover the icon cells\n // (checkbox, actions, options) fall back to the same gray hover background as the data cells.\n const selectedBg =\n isSelected && !isInlineEditing && rowHovering !== row?.original?.id ? 'bg-primary-100 dark:bg-primary-950' : undefined;\n\n const statusBorderClass = cn('pointer-events-none absolute left-0 top-0 bottom-0 w-[3px] z-40', {\n 'bg-success-400 dark:bg-success-500': _isNewRow && _notLoading && _notHovering && !isInlineEditing,\n 'bg-error-400 dark:bg-error-500': _isDeletedRow && _notLoading && _notHovering && !isInlineEditing,\n 'bg-warning-400 dark:bg-warning-500': _isModifiedRow && _notLoading && _notHovering && !isInlineEditing,\n });\n\n return (\n <div\n ref={withDraggable ? setDroppableNodeRef : null}\n className={isDraggingOver ? 'border-2 border-primary-400 dark:border-primary-500 rounded-sm' : ''}\n >\n <div className={statusBorderClass} />\n <div className='flex' ref={isLastRow ? (lastRow as React.Ref<HTMLDivElement>) : null}>\n {tableHasAnyPendingEdits && (\n <PendingEditCell\n rowId={String(row.original.id)}\n rowIndex={index}\n pendingEdits={pendingEdits}\n tableHeaders={tableHeaders}\n rowHasPendingEdits={!!rowHasPendingEdits}\n rowHovering={rowHovering != null ? String(rowHovering) : undefined}\n isInlineEditing={isInlineEditing}\n is_read={!!row.original.is_read}\n is_modified={_isModifiedRow}\n is_row_modified={!!row.original.is_row_modified}\n is_deleted={_isDeletedRow}\n is_added={_isNewRow}\n is_incomplete={row?.original?.status === 'Incomplete'}\n showNewItem={showNewItem}\n onScrollToCell={scrollToCell}\n />\n )}\n\n {isCheckbox && (\n <CheckboxCell\n checkboxConfig={checkboxConfig as never}\n id={String(row.original.id)}\n rowHovering={rowHovering != null ? String(rowHovering) : undefined}\n isDisabled={!!row?.original?.__isLoading}\n isDraggingOver={isDraggingOver}\n is_added={_isNewRow}\n is_deleted={_isDeletedRow}\n is_incomplete={row?.original?.status === 'Incomplete'}\n is_modified={_isModifiedRow}\n is_read={!!row.original.is_read}\n is_row_modified={!!row.original.is_row_modified}\n showNewItem={showNewItem}\n currentData={currentData ?? {}}\n bgColor={row?.original?.__rowBgStatus ? getTableRowBgClassNamesByStatus[row?.original?.__rowBgStatus as string] : selectedBg}\n isInlineEditing={isInlineEditing}\n hasPendingEditsColumn={tableHasAnyPendingEdits}\n rowHasPendingEdits={rowHasPendingEdits}\n />\n )}\n\n {tableActions ? (\n <RowActionCell\n tableActions={tableActions as (rowData: Record<string, unknown>, index: number) => JSX.Element}\n disableOptionsForRowIndex={disableOptionsForRowIndex ?? null}\n id={String(row.original.id)}\n index={index}\n is_read={!!row?.original?.is_read}\n is_incomplete={row?.original?.status === 'Incomplete'}\n showNewItem={!!showNewItem}\n is_modified={_isModifiedRow}\n is_row_modified={!!row?.original?.is_row_modified}\n is_deleted={_isDeletedRow}\n currentData={currentData ?? {}}\n is_added={_isNewRow}\n rowData={row.original as Record<string, unknown>}\n rowHovering={rowHovering}\n isDisabled={!!row?.original?.__isLoading}\n bgColor={isDraggingFile ? 'bg-primary-50' : row?.original?.__rowBgStatus ? getTableRowBgClassNamesByStatus[row?.original?.__rowBgStatus as string] : selectedBg}\n isInlineEditing={isInlineEditing}\n rowHasPendingEdits={rowHasPendingEdits}\n />\n ) : null}\n\n <div\n className='relative flex-1'\n id={`row-${row.original.id}`}\n onMouseEnter={() => setIsRowContentHovering(true)}\n onMouseLeave={() => setIsRowContentHovering(false)}\n >\n {row.cells\n .filter((cell: TableCell) => cell?.column?.visible !== false)\n .map((cell: TableCell, y: number) => {\n const isLastCell = y === lastNonStickyColumnIndex?.();\n const isFirstStickyCell = y === (lastNonStickyColumnIndex?.() ?? -1) + 1;\n const nextWidthSum = cell?.column?.sticky ? (getSumOfNextVisibleColumnWidth?.(y) ?? 0) : 0;\n\n if (row.original?.__isLoading) {\n return (\n <LoaderCell cell={cell as unknown as { column: { width: number; sticky?: boolean; sequence?: number } }} id={y} nextWidthSum={nextWidthSum} isLastCell={isLastCell} rowHovering={rowHovering} index={y} key={y} isFirstStickyCell={isFirstStickyCell} />\n );\n }\n\n const pendingEdit = getPendingEditFn?.(String(row.original.id), cell?.column?.key || '');\n const hasPending = hasPendingEditFn?.(String(row.original.id), cell?.column?.key || '');\n\n return (\n <DataCell\n cell={cell as unknown as import('../../types').ICell}\n rowHovering={rowHovering}\n isFirstStickyCell={isFirstStickyCell}\n level={level ?? 0}\n toggleRowExpand={toggleRowExpand}\n loadingExpand={loadingExpand}\n key={cell?.column?.key}\n index={y}\n cellRef={cellRef as React.RefObject<HTMLDivElement>}\n currentData={currentData as { is_row_modified?: boolean; is_deleted?: boolean; is_added?: boolean }}\n handleCellClick={(e?: React.MouseEvent) => { if (e) handleCellClick(e, getFullRowDataOnClick ? row.original : String(row.original.id), y, cell?.column?.key || ''); }}\n handleCellValueChange={handleCellValueChange}\n handleUpdateCellData={handleUpdateCellData}\n registerValidation={registerValidation}\n id={row.original.id}\n inlineEditing={inlineEditing}\n isInlineEditing={isInlineEditing}\n isLastCell={isLastCell}\n is_incomplete={row?.original?.status === 'Incomplete'}\n is_added={_isNewRow}\n is_deleted={_isDeletedRow}\n is_modified={_isModifiedRow}\n is_read={!!row.original.is_read}\n is_row_modified={!!row.original.is_row_modified}\n nextWidthSum={nextWidthSum}\n setRowHovering={setRowHovering}\n highlightSubstring={highlightSubstring as ((value: string) => JSX.Element) | undefined}\n isDraggingOver={isDraggingOver}\n isLoading={!!row?.original?.__isLoading}\n pendingEdit={pendingEdit}\n hasPendingEdit={hasPending}\n pendingValidationError={pendingEdit?.validationError}\n />\n );\n })}\n\n {hoverConfig?.onHover &&\n isRowContentHovering &&\n createPortal(\n <div className='absolute top-full left-10 z-50 bg-white dark:bg-black-800 rounded-xl'>{hoverConfig.onHover(row.original) as React.ReactNode}</div>,\n document.getElementById(`row-${row.original.id}`) as HTMLElement,\n )}\n </div>\n\n {(resolvedRowOptions.length > 0 || !!rowAdditionalActions) && (\n <RowOptionsCell\n rowId={row.original.id}\n rowOptions={resolvedRowOptions}\n disableOption={disableOptionsForRowIndex !== null || !!row?.original?.__isLoading}\n rowHovering={rowHovering}\n setRowHovering={setRowHovering}\n is_read={!!row.original.is_read}\n showNewItem={!!showNewItem}\n is_modified={_isModifiedRow}\n is_row_modified={!!row.original.is_row_modified}\n is_incomplete={row?.original?.status === 'Incomplete'}\n currentData={currentData ?? {}}\n is_deleted={_isDeletedRow}\n is_added={_isNewRow}\n isDraggingOver={!!isDraggingOver}\n rowAdditionalActions={rowAdditionalActions as (rowData: Record<string, unknown>, index: number, isHovering: boolean) => React.ReactNode}\n rowData={row.original as Record<string, unknown>}\n index={index}\n bgColor={row?.original?.__rowBgStatus ? getTableRowBgClassNamesByStatus[row?.original?.__rowBgStatus as string] : selectedBg}\n isInlineEditing={isInlineEditing}\n onConfirmEdit={handleRowConfirmEdit}\n onCancelEdit={handleRowCancelEdit}\n rowHasPendingEdits={rowHasPendingEdits}\n />\n )}\n </div>\n </div>\n );\n};\n"],"names":["Row","row","isLastRow","lastRow","highlightSubstring","index","style","level","expandedRows","rows","lastNonStickyColumnIndex","checkboxConfig","onRowClick","rowOptions","disableOptionsForRowIndex","getSumOfNextVisibleColumnWidth","onRowEdit","inlineEditColumns","tableActions","dndSortableUtils","withSortable","withDraggable","getInnerRowData","showNewItem","rawData","dragConfig","getFullRowDataOnClick","selectedRowId","RowWrapper","isCellClickDisabled","rowAdditionalActions","hoverConfig","addPendingEdit","removePendingEdit","fieldOperationLoading","clearRowPendingEdits","saveRowPendingEdits","contextPendingEdits","useContext","TableContext","tableConfig","useTableConfig","isCheckbox","activeInlineEdit","setActiveInlineEdit","inlineEditing","isInlineEditing","setInlineEditing","columnKey","rowHovering","setRowHovering","useState","editedCellValue","setEditedCellValue","currentData","setCurrentData","loadingExpand","setLoadingExpand","isDraggingFile","setIsDraggingFile","prevInlineEditingRef","useRef","useEffect","wasEditing","isNowEditing","pendingEdit","currentCell","c","result","validateCellValue","idKey","sortableResult","useSortable","draggableResult","useDraggable","listeners","transform","setNodeRef","isDragging","attributes","active","over","rest","setDroppableNodeRef","useDroppable","dndStyles","CSS","isOverOtherContext","handleCellValueChange","e","handleCloseEdit","validationRef","registerValidation","useCallback","validateFn","tableConfigRef","handleRowCancelEdit","handleRowConfirmEdit","pendingValue","valueToValidate","handleUpdateCellData","directValue","meta","_item","updatedValue","ref","handleCellClick","event","data","idx","key","msg","_row","_id","checkEvent","toggleRowExpand","totalWidth","useMemo","a","b","isDraggingOver","dropPosition","isDraggingOverInside","_meta","_notHovering","_notLoading","_isNewRow","_isDeletedRow","_isModifiedRow","isSelected","bgColor","cn","getTableRowBgClassNamesByStatus","createElement","jsx","AddRounded","SubdirectoryArrowLeftRounded","ActionCell","RowContent","cellRef","isRowContentHovering","setIsRowContentHovering","getPendingEditFn","hasPendingEditFn","pendingEdits","tableHeaders","pendingEditsCount","scrollToCell","rowHasPendingEdits","tableHasAnyPendingEdits","resolvedRowOptions","options","selectedBg","statusBorderClass","jsxs","PendingEditCell","CheckboxCell","RowActionCell","cell","y","isLastCell","isFirstStickyCell","nextWidthSum","LoaderCell","hasPending","DataCell","createPortal","RowOptionsCell"],"mappings":";;;;;;;;;;;;;;;;;;;;AAwGO,MAAMA,KAAM,CAAC,EAAE,KAAAC,GAAK,WAAAC,GAAW,SAAAC,GAAS,oBAAAC,IAAoB,OAAAC,GAAO,OAAAC,IAAO,OAAAC,IAAQ,GAAG,cAAAC,GAAc,MAAAC,SAAmB;AAC3H,QAAM;AAAA,IACJ,0BAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,YAAAC;AAAA,IACA,2BAAAC,IAA4B;AAAA,IAC5B,gCAAAC;AAAA,IACA,WAAAC;AAAA,IACA,mBAAAC;A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AACiC;AAAA,YAAA;AAAA,cACC,OAAOtK,EAAI,SAAS;AAAA,cACpB,YAAYqJ;AAAA,cACZ,eAAexI,MAA8B,QAAQ,CAAC,CAACb,GAAK,UAAU;AAAA,cACtE,aAAAgD;AAAA,cACA,gBAAAC;AAAA,cACA,SAAS,CAAC,CAACjD,EAAI,SAAS;AAAA,cACxB,aAAa,CAAC,CAACsB;AAAA,cACf,aAAayG;AAAA,cACb,iBAAiB,CAAC,CAAC/H,EAAI,SAAS;AAAA,cAChC,eAAeA,GAAK,UAAU,WAAW;AAAA,cACzC,aAAaqD,KAAe,CAAA;AAAA,cAC5B,YAAYyE;AAAA,cACZ,UAAUD;AAAA,cACV,gBAAgB,CAAC,CAACN;AAAA,cAClB,sBAAA1F;AAAA,cACA,SAAS7B,EAAI;AAAA,cACb,OAAAI;AAAA,cACA,SAASJ,GAAK,UAAU,gBAAgBmI,GAAgCnI,GAAK,UAAU,aAAuB,IAAIuJ;AAAA,cAClH,iBAAA1G;AAAA,cACA,eAAemD;AAAA,cACf,cAAcD;AAAA,cACd,oBAAAoD;AAAA,YAAA;AAAA,UAAA;AAAA,QACF,EAAA,CAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),O=require("@mui/icons-material/EditOutlined"),V=require("@mui/icons-material/WarningRounded"),s=require("../../_virtual/index.cjs.js"),n=require("react"),l=require("../data-display/typography/Typography.cjs.js"),g=require("../data-display/tag/Tag.cjs.js"),D=require("../data-display/skeleton/Skeleton.cjs.js"),ee=require("../../utils/countryFlags.cjs.js"),re=require("./UserAvatarPopper.cjs.js"),ae=require("./StatusInfoRow.cjs.js"),u=require("./constants.cjs.js"),se=require("./PersonIcon.cjs.js"),oe=require("./useDynamicPosition.cjs.js"),ne=require("../icon/icons.generated.cjs.js"),j=({label:t,content:i})=>e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx(l.Typography,{size:"small",variant:"medium",className:"mr-5",appearance:"body",children:t}),i]}),H=({firstName:t,lastName:i,email:U,profilePic:c,size:v="md",hoverSize:k="lg",containerClassName:F="",enablePopper:P=!0,className:A,userId:C,lastViewedOn:m,isActive:b,statusIndicator:B=!1,userDetails:r,isFetchingUserDetails:$=!1,authToken:z,onHover:G,currentlyEditing:R})=>{if(t==="All"&&i==="Users")return e.jsx("div",{className:"p-1 rounded-full bg-primary-100 dark:bg-black-600 flex items-center justify-center",children:e.jsx(ne.GroupsIcon,{className:"text-primary-600 dark:text-primary-600 w-xs h-xs"})});const[W,w]=n.useState(!1),[M,d]=n.useState(!1),_=u.sizeClasses[v],{triggerRef:J,dropdownRef:K,position:f,isVisible:Q,show:S,hide:q}=oe.useDynamicPosition(),N=n.useRef({}),I=n.useMemo(()=>{if(b||!m)return!1;const a=new Date(m);return(new Date().getTime()-a.getTime())/(1e3*60*60)<24},[b,m]),h=b?"bg-primary-600 dark:bg-primary-600":I?"bg-primary-300 dark:bg-primary-300":m?"bg-neutral-400 dark:bg-neutral-400":null,p=b?"border-primary-600 dark:border-primary-600":I?"border-primary-300 dark:border-primary-300":m?"border-neutral-400 dark:border-neutral-400":"border-primary-200 dark:border-neutral-800",X={"2xs":"w-1.5 h-1.5",xs:"w-2 h-2",sm:"w-2.5 h-2.5",md:"w-3 h-3",lg:"w-3.5 h-3.5",xl:"w-4 h-4"};n.useEffect(()=>{if(c)if(N.current[c])d(!0);else{d(!1);const a=new Image,x=z||(typeof localStorage<"u"?localStorage.getItem("token"):null);a.src=c+(x?"?token="+x:""),a.onload=()=>{N.current[c]=a.src,d(!0)},a.onerror=()=>{d(!1)}}else d(!1)},[c,z]),n.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]);const y=c?N.current[c]:void 0,o=n.useRef(null),T=n.useRef(null),Y=()=>{G?.(),t&&i&&P&&(o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{w(!0)},300))},L=a=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{T.current&&!T.current.contains(a.relatedTarget)&&w(!1)},200)},Z=e.jsxs("div",{ref:T,className:"bg-white dark:bg-black-800 shadow rounded-lg border border-neutral-200 dark:border-black-700 min-w-[280px]",onMouseEnter:()=>{o.current&&clearTimeout(o.current)},onMouseLeave:a=>L(a),children:[e.jsxs("div",{className:"flex flex-col gap-1 items-center p-5",children:[e.jsxs("div",{className:s("relative",u.sizeClasses[k]),children:[y&&M?e.jsx("img",{src:y,alt:"Profile",className:s("rounded-full border-2 object-cover w-full h-full",p),onError:()=>d(!1)}):e.jsx("div",{className:s("bg-primary-100 dark:bg-primary-950 border-2 flex items-center justify-center rounded-full w-full h-full",p),children:e.jsx(l.Typography,{size:"extra-small",variant:"semibold",appearance:"custom",className:s("text-primary-600",u.initialsFontSizeClasses[k]),children:u.getInitials((t||"")+" "+(i||""))})}),h&&e.jsx("div",{className:s("absolute bottom-0 right-0 rounded-full border-2 border-white dark:border-black-800",X[k],h)})]}),e.jsxs("div",{className:"flex flex-row gap-1 items-center justify-center",children:[e.jsxs(l.Typography,{size:"medium",variant:"semibold",className:"w-full text-center",children:[t||""," ",i||""]}),r?.region&&e.jsx("span",{children:ee.getFlagComponentRectangleMd(r?.region)})]}),e.jsx(l.Typography,{size:"small",variant:"medium",appearance:"body",children:U||r?.email||""})]}),R?e.jsx("div",{className:"px-5 pb-3",children:e.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-primary-100 dark:border-primary-900 bg-[rgba(230,241,252,0.60)] dark:bg-primary-950/40 px-[13px] py-[7px]",children:[e.jsx("div",{className:"flex items-center justify-center shrink-0 w-7 h-7 rounded-[5px] border-[0.4px] border-primary-100 dark:border-primary-900 bg-primary-50 dark:bg-primary-950",children:e.jsx(O,{sx:{width:13,height:13},className:"text-primary-600 dark:text-primary-500"})}),e.jsxs("div",{className:"flex flex-col min-w-0",children:[e.jsx(l.Typography,{size:"extra-small",variant:"semibold",appearance:"custom",className:"text-2xs leading-4 uppercase tracking-[0.2px] text-primary-600 dark:text-primary-500",children:"Currently editing"}),e.jsx(l.Typography,{size:"extra-small",variant:"semibold",className:"truncate",children:R})]})]})}):null,C&&($?e.jsx("div",{className:"p-5",children:e.jsx(D.Skeleton,{})}):C&&(r?.teams||r?.clearanceLevel||r?.group)?e.jsxs("div",{className:"flex flex-col gap-4 bg-neutral-50 border-t border-neutral-200 dark:bg-black-700 dark:border-none p-5 rounded-b-lg",children:[e.jsx(ae.StatusInfoRow,{isActive:b,lastViewedOn:m}),r.username&&e.jsx(j,{label:"Username",content:e.jsx("div",{className:"flex gap-2",children:e.jsx(l.Typography,{size:"small",variant:"medium",appearance:"body",children:r.username})})}),r?.teams&&r?.teams?.length>0&&e.jsx(j,{label:"Team",content:e.jsxs("div",{className:"flex gap-2",children:[r?.teams?.length>0&&e.jsx(g.Tag,{label:r?.teams[0]?.name,color:r?.teams[0]?.color||"#e38715",size:"md",isHashColor:!0},r?.teams[0]?.id),r?.teams?.length>=2&&e.jsxs("div",{ref:J,className:"relative cursor-pointer",onMouseEnter:S,onMouseLeave:q,onClick:a=>a.stopPropagation(),children:[e.jsx(g.Tag,{label:`+ ${r?.teams?.length-1} More`,color:"#004f08",size:"md",isHashColor:!0},1),Q&&e.jsx("div",{ref:K,className:s("absolute w-max bg-white dark:text-black-200 dark:bg-black-800 shadow-md border border-neutral-200 dark:border-black-800 rounded-md px-2 z-10 overflow-y-auto max-h-60",{"top-full":f.vertical==="bottom","bottom-full":f.vertical==="top","left-0":f.horizontal==="left","right-0":f.horizontal==="right"}),onMouseEnter:S,onMouseLeave:q,children:r?.teams?.slice(1)?.map((a,x)=>e.jsx("div",{className:"my-2",children:e.jsx(g.Tag,{label:a?.name,color:a?.color||"#4A5568",size:"md",isHashColor:!0,className:"w-fit"},a?.id)},a?.id||x))})]})]})}),r?.group&&e.jsx(j,{label:"Role",content:e.jsx(g.Tag,{label:r?.group,color:"#004094",size:"md",isHashColor:!0},r?.group)}),r?.clearanceLevel&&e.jsx(j,{label:"Clearance Level",content:e.jsx(g.Tag,{label:`Level ${r?.clearanceLevel}`,color:"#b30000",size:"md",isHashColor:!0},String(r?.clearanceLevel))})]}):e.jsx("div",{className:"flex items-center justify-center bg-neutral-50 dark:bg-black-700 border-t border-neutral-200 dark:border-black-700 p-5 rounded-b-lg",children:e.jsxs(l.Typography,{className:"flex items-center justify-center gap-1",size:"extra-small",variant:"medium",appearance:"body",children:[e.jsx(V,{sx:{height:"16px",width:"16px",color:"#F04438"}}),"No other information found!"]})}))]}),E=n.useRef(null);return e.jsxs("div",{onMouseEnter:Y,onMouseLeave:L,className:s("inline-block relative cursor-pointer",A),ref:E,children:[e.jsxs("div",{className:s("relative",F||_),children:[y&&M?e.jsx("img",{src:y,alt:"Profile",className:s("rounded-full border object-cover w-full h-full",p),onError:()=>d(!1)}):t&&i?e.jsx("div",{className:s("bg-primary-100 flex items-center justify-center rounded-full border dark:bg-black-700",u.sizeClasses[v],p),children:e.jsx(l.Typography,{size:"extra-small",variant:"semibold",appearance:"custom",className:s("text-primary-600",u.initialsFontSizeClasses[v]),children:u.getInitials((t||"")+" "+(i||""))})}):e.jsx("div",{className:s(p,"p-1 rounded-full bg-neutral-200 dark:bg-black-600 flex items-center justify-center border w-full h-full"),children:e.jsx(se.PersonIcon,{fill:"#98A2B3"})}),B&&h&&e.jsx("div",{className:s("absolute bottom-0 right-0 rounded-full border border-white dark:border-black-800 w-2 h-2",h)})]}),e.jsx(re.UserAvatarPopper,{isOpen:W,onClose:()=>w(!1),anchorEl:E.current,className:"bg-white dark:bg-black-700 shadow rounded-lg border border-neutral-200 dark:border-black-600",children:Z})]})};H.displayName="UserAvatar";exports.UserAvatar=H;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),O=require("@mui/icons-material/EditOutlined"),V=require("@mui/icons-material/WarningRounded"),s=require("../../_virtual/index.cjs.js"),n=require("react"),l=require("../data-display/typography/Typography.cjs.js"),x=require("../data-display/tag/Tag.cjs.js"),D=require("../data-display/skeleton/Skeleton.cjs.js"),ee=require("../../utils/countryFlags.cjs.js"),re=require("./UserAvatarPopper.cjs.js"),ae=require("./StatusInfoRow.cjs.js"),m=require("./constants.cjs.js"),se=require("./PersonIcon.cjs.js"),oe=require("./useDynamicPosition.cjs.js"),ne=require("../icon/icons.generated.cjs.js"),j=({label:t,content:i})=>e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx(l.Typography,{size:"small",variant:"medium",className:"mr-5",appearance:"body",children:t}),i]}),H=({firstName:t,lastName:i,email:U,profilePic:c,size:v="md",hoverSize:k="lg",containerClassName:F="",enablePopper:P=!0,className:A,userId:C,lastViewedOn:u,isActive:b,statusIndicator:B=!1,userDetails:r,isFetchingUserDetails:$=!1,authToken:z,onHover:G,currentlyEditing:R})=>{const[W,w]=n.useState(!1),[M,d]=n.useState(!1),_=m.sizeClasses[v],{triggerRef:J,dropdownRef:K,position:f,isVisible:Q,show:S,hide:q}=oe.useDynamicPosition(),N=n.useRef({}),I=n.useMemo(()=>{if(b||!u)return!1;const a=new Date(u);return(new Date().getTime()-a.getTime())/(1e3*60*60)<24},[b,u]),h=b?"bg-primary-600 dark:bg-primary-600":I?"bg-primary-300 dark:bg-primary-300":u?"bg-neutral-400 dark:bg-neutral-400":null,p=b?"border-primary-600 dark:border-primary-600":I?"border-primary-300 dark:border-primary-300":u?"border-neutral-400 dark:border-neutral-400":"border-primary-200 dark:border-neutral-800",X={"2xs":"w-1.5 h-1.5",xs:"w-2 h-2",sm:"w-2.5 h-2.5",md:"w-3 h-3",lg:"w-3.5 h-3.5",xl:"w-4 h-4"};n.useEffect(()=>{if(c)if(N.current[c])d(!0);else{d(!1);const a=new Image,g=z||(typeof localStorage<"u"?localStorage.getItem("token"):null);a.src=c+(g?"?token="+g:""),a.onload=()=>{N.current[c]=a.src,d(!0)},a.onerror=()=>{d(!1)}}else d(!1)},[c,z]),n.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]);const y=c?N.current[c]:void 0,o=n.useRef(null),T=n.useRef(null),Y=()=>{G?.(),t&&i&&P&&(o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{w(!0)},300))},L=a=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{T.current&&!T.current.contains(a.relatedTarget)&&w(!1)},200)},Z=e.jsxs("div",{ref:T,className:"bg-white dark:bg-black-800 shadow rounded-lg border border-neutral-200 dark:border-black-700 min-w-[280px]",onMouseEnter:()=>{o.current&&clearTimeout(o.current)},onMouseLeave:a=>L(a),children:[e.jsxs("div",{className:"flex flex-col gap-1 items-center p-5",children:[e.jsxs("div",{className:s("relative",m.sizeClasses[k]),children:[y&&M?e.jsx("img",{src:y,alt:"Profile",className:s("rounded-full border-2 object-cover w-full h-full",p),onError:()=>d(!1)}):e.jsx("div",{className:s("bg-primary-100 dark:bg-primary-950 border-2 flex items-center justify-center rounded-full w-full h-full",p),children:e.jsx(l.Typography,{size:"extra-small",variant:"semibold",appearance:"custom",className:s("text-primary-600",m.initialsFontSizeClasses[k]),children:m.getInitials((t||"")+" "+(i||""))})}),h&&e.jsx("div",{className:s("absolute bottom-0 right-0 rounded-full border-2 border-white dark:border-black-800",X[k],h)})]}),e.jsxs("div",{className:"flex flex-row gap-1 items-center justify-center",children:[e.jsxs(l.Typography,{size:"medium",variant:"semibold",className:"w-full text-center",children:[t||""," ",i||""]}),r?.region&&e.jsx("span",{children:ee.getFlagComponentRectangleMd(r?.region)})]}),e.jsx(l.Typography,{size:"small",variant:"medium",appearance:"body",children:U||r?.email||""})]}),R?e.jsx("div",{className:"px-5 pb-3",children:e.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-primary-100 dark:border-primary-900 bg-[rgba(230,241,252,0.60)] dark:bg-primary-950/40 px-[13px] py-[7px]",children:[e.jsx("div",{className:"flex items-center justify-center shrink-0 w-7 h-7 rounded-[5px] border-[0.4px] border-primary-100 dark:border-primary-900 bg-primary-50 dark:bg-primary-950",children:e.jsx(O,{sx:{width:13,height:13},className:"text-primary-600 dark:text-primary-500"})}),e.jsxs("div",{className:"flex flex-col min-w-0",children:[e.jsx(l.Typography,{size:"extra-small",variant:"semibold",appearance:"custom",className:"text-2xs leading-4 uppercase tracking-[0.2px] text-primary-600 dark:text-primary-500",children:"Currently editing"}),e.jsx(l.Typography,{size:"extra-small",variant:"semibold",className:"truncate",children:R})]})]})}):null,C&&($?e.jsx("div",{className:"p-5",children:e.jsx(D.Skeleton,{})}):C&&(r?.teams||r?.clearanceLevel||r?.group)?e.jsxs("div",{className:"flex flex-col gap-4 bg-neutral-50 border-t border-neutral-200 dark:bg-black-700 dark:border-none p-5 rounded-b-lg",children:[e.jsx(ae.StatusInfoRow,{isActive:b,lastViewedOn:u}),r.username&&e.jsx(j,{label:"Username",content:e.jsx("div",{className:"flex gap-2",children:e.jsx(l.Typography,{size:"small",variant:"medium",appearance:"body",children:r.username})})}),r?.teams&&r?.teams?.length>0&&e.jsx(j,{label:"Team",content:e.jsxs("div",{className:"flex gap-2",children:[r?.teams?.length>0&&e.jsx(x.Tag,{label:r?.teams[0]?.name,color:r?.teams[0]?.color||"#e38715",size:"md",isHashColor:!0},r?.teams[0]?.id),r?.teams?.length>=2&&e.jsxs("div",{ref:J,className:"relative cursor-pointer",onMouseEnter:S,onMouseLeave:q,onClick:a=>a.stopPropagation(),children:[e.jsx(x.Tag,{label:`+ ${r?.teams?.length-1} More`,color:"#004f08",size:"md",isHashColor:!0},1),Q&&e.jsx("div",{ref:K,className:s("absolute w-max bg-white dark:text-black-200 dark:bg-black-800 shadow-md border border-neutral-200 dark:border-black-800 rounded-md px-2 z-10 overflow-y-auto max-h-60",{"top-full":f.vertical==="bottom","bottom-full":f.vertical==="top","left-0":f.horizontal==="left","right-0":f.horizontal==="right"}),onMouseEnter:S,onMouseLeave:q,children:r?.teams?.slice(1)?.map((a,g)=>e.jsx("div",{className:"my-2",children:e.jsx(x.Tag,{label:a?.name,color:a?.color||"#4A5568",size:"md",isHashColor:!0,className:"w-fit"},a?.id)},a?.id||g))})]})]})}),r?.group&&e.jsx(j,{label:"Role",content:e.jsx(x.Tag,{label:r?.group,color:"#004094",size:"md",isHashColor:!0},r?.group)}),r?.clearanceLevel&&e.jsx(j,{label:"Clearance Level",content:e.jsx(x.Tag,{label:`Level ${r?.clearanceLevel}`,color:"#b30000",size:"md",isHashColor:!0},String(r?.clearanceLevel))})]}):e.jsx("div",{className:"flex items-center justify-center bg-neutral-50 dark:bg-black-700 border-t border-neutral-200 dark:border-black-700 p-5 rounded-b-lg",children:e.jsxs(l.Typography,{className:"flex items-center justify-center gap-1",size:"extra-small",variant:"medium",appearance:"body",children:[e.jsx(V,{sx:{height:"16px",width:"16px",color:"#F04438"}}),"No other information found!"]})}))]}),E=n.useRef(null);return e.jsxs("div",{onMouseEnter:Y,onMouseLeave:L,className:s("inline-block relative cursor-pointer",A),ref:E,children:[e.jsxs("div",{className:s("relative",F||_),children:[y&&M?e.jsx("img",{src:y,alt:"Profile",className:s("rounded-full border object-cover w-full h-full",p),onError:()=>d(!1)}):t==="All"&&i==="Users"?e.jsx("div",{className:s("rounded-full bg-primary-100 dark:bg-black-600 flex items-center justify-center"),children:e.jsx(ne.GroupsIcon,{className:"text-primary-600 dark:text-primary-600 w-md h-md"})}):t&&i?e.jsx("div",{className:s("bg-primary-100 flex items-center justify-center rounded-full border dark:bg-black-700",m.sizeClasses[v],p),children:e.jsx(l.Typography,{size:"extra-small",variant:"semibold",appearance:"custom",className:s("text-primary-600",m.initialsFontSizeClasses[v]),children:m.getInitials((t||"")+" "+(i||""))})}):e.jsx("div",{className:s(p,"p-1 rounded-full bg-neutral-200 dark:bg-black-600 flex items-center justify-center border w-full h-full"),children:e.jsx(se.PersonIcon,{fill:"#98A2B3"})}),B&&h&&e.jsx("div",{className:s("absolute bottom-0 right-0 rounded-full border border-white dark:border-black-800 w-2 h-2",h)})]}),e.jsx(re.UserAvatarPopper,{isOpen:W,onClose:()=>w(!1),anchorEl:E.current,className:"bg-white dark:bg-black-700 shadow rounded-lg border border-neutral-200 dark:border-black-600",children:Z})]})};H.displayName="UserAvatar";exports.UserAvatar=H;
2
2
  //# sourceMappingURL=UserAvatar.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UserAvatar.cjs.js","sources":["../../../src/components/user-avatar/UserAvatar.tsx"],"sourcesContent":["import EditOutlinedIcon from '@mui/icons-material/EditOutlined';\nimport WarningRoundedIcon from '@mui/icons-material/WarningRounded';\nimport cn from 'classnames';\nimport { type FC, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { Typography } from '../data-display/typography/Typography';\nimport { Tag } from '../data-display/tag/Tag';\nimport { Skeleton } from '../data-display/skeleton/Skeleton';\nimport { getFlagComponentRectangleMd } from '../../utils/countryFlags';\nimport { UserAvatarPopper } from './UserAvatarPopper';\nimport { StatusInfoRow } from './StatusInfoRow';\nimport { sizeClasses, getInitials, initialsFontSizeClasses } from './constants';\nimport { PersonIcon } from './PersonIcon';\nimport { useDynamicPosition } from './useDynamicPosition';\nimport { GroupsIcon } from '../icon';\n\nexport type UserAvatarSize = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\nexport type UserDetailsTeam = {\n id?: string;\n name: string;\n color?: string;\n};\n\nexport type UserDetails = {\n email?: string;\n username?: string;\n teams?: UserDetailsTeam[];\n group?: string;\n clearanceLevel?: number | string;\n region?: string;\n};\n\nexport type UserAvatarProps = {\n firstName?: string;\n lastName?: string;\n email?: string;\n enablePopper?: boolean;\n profilePic?: string;\n size?: UserAvatarSize;\n hoverSize?: UserAvatarSize;\n containerClassName?: string;\n className?: string;\n userId?: string;\n lastViewedOn?: string;\n isActive?: boolean;\n statusIndicator?: boolean;\n /** User details to display in the popper - replaces the useTeamMemberFilter hook */\n userDetails?: UserDetails | null;\n /** Whether user details are being fetched */\n isFetchingUserDetails?: boolean;\n /** Optional token for authenticated image loading */\n authToken?: string;\n /** Callback triggered when mouse enters the avatar */\n onHover?: () => void;\n /** Name of the clause / line item the user is currently editing. When set, a highlighted \"Currently editing\" card is shown in the popper. */\n currentlyEditing?: string;\n};\n\nconst InfoRow = ({ label, content }: { label: string; content: React.ReactNode }) => (\n <div className='flex justify-between items-center'>\n <Typography size='small' variant='medium' className='mr-5' appearance='body'>\n {label}\n </Typography>\n {content}\n </div>\n);\n\n/**\n * UserAvatar component for displaying user profile pictures with hover popper\n *\n * @example\n * ```tsx\n * <UserAvatar\n * firstName=\"John\"\n * lastName=\"Doe\"\n * email=\"john@example.com\"\n * profilePic=\"/avatar.jpg\"\n * userDetails={{ teams: [{ name: 'Engineering', color: '#0066cc' }], group: 'Admin' }}\n * />\n * ```\n */\nexport const UserAvatar: FC<UserAvatarProps> = ({\n firstName,\n lastName,\n email,\n profilePic,\n size = 'md',\n hoverSize = 'lg',\n containerClassName = '',\n enablePopper = true,\n className,\n userId,\n lastViewedOn,\n isActive,\n statusIndicator = false,\n userDetails,\n isFetchingUserDetails = false,\n authToken,\n onHover,\n currentlyEditing,\n}) => {\n if (firstName === 'All' && lastName === 'Users') {\n return (\n <div className='p-1 rounded-full bg-primary-100 dark:bg-black-600 flex items-center justify-center'>\n <GroupsIcon className='text-primary-600 dark:text-primary-600 w-xs h-xs' />\n </div>\n );\n }\n\n const [visible, setVisible] = useState<boolean>(false);\n const [imageLoaded, setImageLoaded] = useState<boolean>(false);\n\n const avatarSizeClass = sizeClasses[size];\n\n const {\n triggerRef: moreTagRef,\n dropdownRef,\n position: dropdownPosition,\n isVisible: showMore,\n show: handleShowMore,\n hide: handleHideMore,\n } = useDynamicPosition();\n\n const imageCacheRef = useRef<{ [key: string]: string }>({});\n\n const isRecent = useMemo(() => {\n if (isActive || !lastViewedOn) return false;\n const date = new Date(lastViewedOn);\n const now = new Date();\n const diffInHours = (now.getTime() - date.getTime()) / (1000 * 60 * 60);\n return diffInHours < 24;\n }, [isActive, lastViewedOn]);\n\n const getStatusColor = () => {\n if (isActive) return 'bg-primary-600 dark:bg-primary-600';\n if (isRecent) return 'bg-primary-300 dark:bg-primary-300';\n if (lastViewedOn) return 'bg-neutral-400 dark:bg-neutral-400';\n return null;\n };\n\n const statusColor = getStatusColor();\n\n const getBorderColor = () => {\n if (isActive) return 'border-primary-600 dark:border-primary-600';\n if (isRecent) return 'border-primary-300 dark:border-primary-300';\n if (lastViewedOn) return 'border-neutral-400 dark:border-neutral-400';\n return 'border-primary-200 dark:border-neutral-800';\n };\n\n const borderColor = getBorderColor();\n\n const indicatorSizes = {\n '2xs': 'w-1.5 h-1.5',\n xs: 'w-2 h-2',\n sm: 'w-2.5 h-2.5',\n md: 'w-3 h-3',\n lg: 'w-3.5 h-3.5',\n xl: 'w-4 h-4',\n };\n\n useEffect(() => {\n if (profilePic) {\n if (imageCacheRef.current[profilePic]) {\n setImageLoaded(true);\n } else {\n setImageLoaded(false);\n const img = new Image();\n const token = authToken || (typeof localStorage !== 'undefined' ? localStorage.getItem('token') : null);\n img.src = profilePic + (token ? '?token=' + token : '');\n img.onload = () => {\n imageCacheRef.current[profilePic] = img.src;\n setImageLoaded(true);\n };\n img.onerror = () => {\n setImageLoaded(false);\n };\n }\n } else {\n setImageLoaded(false);\n }\n }, [profilePic, authToken]);\n\n useEffect(() => {\n return () => {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n }\n };\n }, []);\n\n const cachedSrc = profilePic ? imageCacheRef.current[profilePic] : undefined;\n\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const popperRef = useRef<HTMLDivElement | null>(null);\n\n const handleMouseEnter = () => {\n onHover?.();\n if (firstName && lastName && enablePopper) {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n }\n timerRef.current = setTimeout(() => {\n setVisible(true);\n }, 300);\n }\n };\n\n const handleMouseLeave = (event: React.MouseEvent) => {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n }\n timerRef.current = setTimeout(() => {\n if (popperRef.current && !popperRef.current.contains(event.relatedTarget as Node)) {\n setVisible(false);\n }\n }, 200);\n };\n\n const popperContent = (\n <div\n ref={popperRef}\n className='bg-white dark:bg-black-800 shadow rounded-lg border border-neutral-200 dark:border-black-700 min-w-[280px]'\n onMouseEnter={() => {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n }\n }}\n onMouseLeave={(event) => handleMouseLeave(event)}\n >\n <div className='flex flex-col gap-1 items-center p-5'>\n <div className={cn('relative', sizeClasses[hoverSize])}>\n {cachedSrc && imageLoaded ? (\n <img\n src={cachedSrc}\n alt='Profile'\n className={cn('rounded-full border-2 object-cover w-full h-full', borderColor)}\n onError={() => setImageLoaded(false)}\n />\n ) : (\n <div\n className={cn(\n 'bg-primary-100 dark:bg-primary-950 border-2 flex items-center justify-center rounded-full w-full h-full',\n borderColor,\n )}\n >\n <Typography\n size='extra-small'\n variant='semibold'\n appearance='custom'\n className={cn('text-primary-600', initialsFontSizeClasses[hoverSize])}\n >\n {getInitials((firstName || '') + ' ' + (lastName || ''))}\n </Typography>\n </div>\n )}\n\n {statusColor && (\n <div\n className={cn(\n 'absolute bottom-0 right-0 rounded-full border-2 border-white dark:border-black-800',\n indicatorSizes[hoverSize],\n statusColor,\n )}\n />\n )}\n </div>\n <div className='flex flex-row gap-1 items-center justify-center'>\n <Typography size='medium' variant='semibold' className='w-full text-center'>\n {firstName || ''} {lastName || ''}\n </Typography>\n {userDetails?.region && <span>{getFlagComponentRectangleMd(userDetails?.region)}</span>}\n </div>\n\n <Typography size='small' variant='medium' appearance='body'>\n {email || userDetails?.email || ''}\n </Typography>\n </div>\n\n {currentlyEditing ? (\n <div className='px-5 pb-3'>\n <div className='flex items-center gap-3 rounded-lg border border-primary-100 dark:border-primary-900 bg-[rgba(230,241,252,0.60)] dark:bg-primary-950/40 px-[13px] py-[7px]'>\n <div className='flex items-center justify-center shrink-0 w-7 h-7 rounded-[5px] border-[0.4px] border-primary-100 dark:border-primary-900 bg-primary-50 dark:bg-primary-950'>\n <EditOutlinedIcon sx={{ width: 13, height: 13 }} className='text-primary-600 dark:text-primary-500' />\n </div>\n <div className='flex flex-col min-w-0'>\n <Typography\n size='extra-small'\n variant='semibold'\n appearance='custom'\n className='text-2xs leading-4 uppercase tracking-[0.2px] text-primary-600 dark:text-primary-500'\n >\n Currently editing\n </Typography>\n <Typography size='extra-small' variant='semibold' className='truncate'>\n {currentlyEditing}\n </Typography>\n </div>\n </div>\n </div>\n ) : null}\n\n {userId &&\n (isFetchingUserDetails ? (\n <div className='p-5'>\n <Skeleton />\n </div>\n ) : userId && (userDetails?.teams || userDetails?.clearanceLevel || userDetails?.group) ? (\n <div className='flex flex-col gap-4 bg-neutral-50 border-t border-neutral-200 dark:bg-black-700 dark:border-none p-5 rounded-b-lg'>\n <StatusInfoRow isActive={isActive} lastViewedOn={lastViewedOn} />\n {userDetails.username && (\n <InfoRow\n label='Username'\n content={\n <div className='flex gap-2'>\n <Typography size='small' variant='medium' appearance='body'>\n {userDetails.username}\n </Typography>\n </div>\n }\n />\n )}\n\n {userDetails?.teams && userDetails?.teams?.length > 0 && (\n <InfoRow\n label='Team'\n content={\n <div className='flex gap-2'>\n {userDetails?.teams?.length > 0 && (\n <Tag\n key={userDetails?.teams[0]?.id}\n label={userDetails?.teams[0]?.name}\n color={userDetails?.teams[0]?.color || '#e38715'}\n size='md'\n isHashColor\n />\n )}\n {userDetails?.teams?.length >= 2 && (\n <div\n ref={moreTagRef}\n className='relative cursor-pointer'\n onMouseEnter={handleShowMore}\n onMouseLeave={handleHideMore}\n onClick={(e) => e.stopPropagation()}\n >\n <Tag key={1} label={`+ ${userDetails?.teams?.length - 1} More`} color='#004f08' size='md' isHashColor />\n\n {showMore && (\n <div\n ref={dropdownRef}\n className={cn(\n 'absolute w-max bg-white dark:text-black-200 dark:bg-black-800 shadow-md border border-neutral-200 dark:border-black-800 rounded-md px-2 z-10 overflow-y-auto max-h-60',\n {\n 'top-full': dropdownPosition.vertical === 'bottom',\n 'bottom-full': dropdownPosition.vertical === 'top',\n 'left-0': dropdownPosition.horizontal === 'left',\n 'right-0': dropdownPosition.horizontal === 'right',\n },\n )}\n onMouseEnter={handleShowMore}\n onMouseLeave={handleHideMore}\n >\n {userDetails?.teams?.slice(1)?.map((team, index) => (\n <div key={team?.id || index} className='my-2'>\n <Tag key={team?.id} label={team?.name} color={team?.color || '#4A5568'} size='md' isHashColor className='w-fit' />\n </div>\n ))}\n </div>\n )}\n </div>\n )}\n </div>\n }\n />\n )}\n\n {userDetails?.group && (\n <InfoRow\n label='Role'\n content={<Tag key={userDetails?.group} label={userDetails?.group} color='#004094' size='md' isHashColor />}\n />\n )}\n\n {userDetails?.clearanceLevel && (\n <InfoRow\n label='Clearance Level'\n content={\n <Tag\n key={String(userDetails?.clearanceLevel)}\n label={`Level ${userDetails?.clearanceLevel}`}\n color='#b30000'\n size='md'\n isHashColor\n />\n }\n />\n )}\n </div>\n ) : (\n <div className='flex items-center justify-center bg-neutral-50 dark:bg-black-700 border-t border-neutral-200 dark:border-black-700 p-5 rounded-b-lg'>\n <Typography className='flex items-center justify-center gap-1' size='extra-small' variant='medium' appearance='body'>\n <WarningRoundedIcon\n sx={{\n height: '16px',\n width: '16px',\n color: '#F04438',\n }}\n />\n No other information found!\n </Typography>\n </div>\n ))}\n </div>\n );\n const containerRef = useRef<HTMLDivElement>(null);\n return (\n <div\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n className={cn('inline-block relative cursor-pointer', className)}\n ref={containerRef}\n >\n <div className={cn('relative', containerClassName || avatarSizeClass)}>\n {cachedSrc && imageLoaded ? (\n <img\n src={cachedSrc}\n alt='Profile'\n className={cn('rounded-full border object-cover w-full h-full', borderColor)}\n onError={() => setImageLoaded(false)}\n />\n ) : firstName && lastName ? (\n <div\n className={cn(\n 'bg-primary-100 flex items-center justify-center rounded-full border dark:bg-black-700',\n sizeClasses[size],\n borderColor,\n )}\n >\n <Typography\n size='extra-small'\n variant='semibold'\n appearance='custom'\n className={cn('text-primary-600', initialsFontSizeClasses[size])}\n >\n {getInitials((firstName || '') + ' ' + (lastName || ''))}\n </Typography>\n </div>\n ) : (\n <div className={cn(borderColor, 'p-1 rounded-full bg-neutral-200 dark:bg-black-600 flex items-center justify-center border w-full h-full')}>\n <PersonIcon fill='#98A2B3' />\n </div>\n )}\n\n {statusIndicator && statusColor && (\n <div\n className={cn(\n 'absolute bottom-0 right-0 rounded-full border border-white dark:border-black-800 w-2 h-2',\n\n statusColor,\n )}\n />\n )}\n </div>\n <UserAvatarPopper\n isOpen={visible}\n onClose={() => setVisible(false)}\n anchorEl={containerRef.current}\n className='bg-white dark:bg-black-700 shadow rounded-lg border border-neutral-200 dark:border-black-600'\n >\n {popperContent}\n </UserAvatarPopper>\n </div>\n );\n};\n\nUserAvatar.displayName = 'UserAvatar';\n\n"],"names":["InfoRow","label","content","jsxs","jsx","Typography","UserAvatar","firstName","lastName","email","profilePic","size","hoverSize","containerClassName","enablePopper","className","userId","lastViewedOn","isActive","statusIndicator","userDetails","isFetchingUserDetails","authToken","onHover","currentlyEditing","GroupsIcon","visible","setVisible","useState","imageLoaded","setImageLoaded","avatarSizeClass","sizeClasses","moreTagRef","dropdownRef","dropdownPosition","showMore","handleShowMore","handleHideMore","useDynamicPosition","imageCacheRef","useRef","isRecent","useMemo","date","statusColor","borderColor","indicatorSizes","useEffect","img","token","timerRef","cachedSrc","popperRef","handleMouseEnter","handleMouseLeave","event","popperContent","cn","initialsFontSizeClasses","getInitials","getFlagComponentRectangleMd","EditOutlinedIcon","Skeleton","StatusInfoRow","Tag","e","team","index","WarningRoundedIcon","containerRef","PersonIcon","UserAvatarPopper"],"mappings":"+rBA2DMA,EAAU,CAAC,CAAE,MAAAC,EAAO,QAAAC,KACxBC,OAAC,MAAA,CAAI,UAAU,oCACb,SAAA,CAAAC,EAAAA,IAACC,EAAAA,WAAA,CAAW,KAAK,QAAQ,QAAQ,SAAS,UAAU,OAAO,WAAW,OACnE,SAAAJ,CAAA,CACH,EACCC,CAAA,EACH,EAiBWI,EAAkC,CAAC,CAC9C,UAAAC,EACA,SAAAC,EACA,MAAAC,EACA,WAAAC,EAC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Ac"}
1
+ {"version":3,"file":"UserAvatar.cjs.js","sources":["../../../src/components/user-avatar/UserAvatar.tsx"],"sourcesContent":["import EditOutlinedIcon from '@mui/icons-material/EditOutlined';\nimport WarningRoundedIcon from '@mui/icons-material/WarningRounded';\nimport cn from 'classnames';\nimport { type FC, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { Typography } from '../data-display/typography/Typography';\nimport { Tag } from '../data-display/tag/Tag';\nimport { Skeleton } from '../data-display/skeleton/Skeleton';\nimport { getFlagComponentRectangleMd } from '../../utils/countryFlags';\nimport { UserAvatarPopper } from './UserAvatarPopper';\nimport { StatusInfoRow } from './StatusInfoRow';\nimport { sizeClasses, getInitials, initialsFontSizeClasses } from './constants';\nimport { PersonIcon } from './PersonIcon';\nimport { useDynamicPosition } from './useDynamicPosition';\nimport { GroupsIcon } from '../icon';\n\nexport type UserAvatarSize = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\nexport type UserDetailsTeam = {\n id?: string;\n name: string;\n color?: string;\n};\n\nexport type UserDetails = {\n email?: string;\n username?: string;\n teams?: UserDetailsTeam[];\n group?: string;\n clearanceLevel?: number | string;\n region?: string;\n};\n\nexport type UserAvatarProps = {\n firstName?: string;\n lastName?: string;\n email?: string;\n enablePopper?: boolean;\n profilePic?: string;\n size?: UserAvatarSize;\n hoverSize?: UserAvatarSize;\n containerClassName?: string;\n className?: string;\n userId?: string;\n lastViewedOn?: string;\n isActive?: boolean;\n statusIndicator?: boolean;\n /** User details to display in the popper - replaces the useTeamMemberFilter hook */\n userDetails?: UserDetails | null;\n /** Whether user details are being fetched */\n isFetchingUserDetails?: boolean;\n /** Optional token for authenticated image loading */\n authToken?: string;\n /** Callback triggered when mouse enters the avatar */\n onHover?: () => void;\n /** Name of the clause / line item the user is currently editing. When set, a highlighted \"Currently editing\" card is shown in the popper. */\n currentlyEditing?: string;\n};\n\nconst InfoRow = ({ label, content }: { label: string; content: React.ReactNode }) => (\n <div className='flex justify-between items-center'>\n <Typography size='small' variant='medium' className='mr-5' appearance='body'>\n {label}\n </Typography>\n {content}\n </div>\n);\n\n/**\n * UserAvatar component for displaying user profile pictures with hover popper\n *\n * @example\n * ```tsx\n * <UserAvatar\n * firstName=\"John\"\n * lastName=\"Doe\"\n * email=\"john@example.com\"\n * profilePic=\"/avatar.jpg\"\n * userDetails={{ teams: [{ name: 'Engineering', color: '#0066cc' }], group: 'Admin' }}\n * />\n * ```\n */\nexport const UserAvatar: FC<UserAvatarProps> = ({\n firstName,\n lastName,\n email,\n profilePic,\n size = 'md',\n hoverSize = 'lg',\n containerClassName = '',\n enablePopper = true,\n className,\n userId,\n lastViewedOn,\n isActive,\n statusIndicator = false,\n userDetails,\n isFetchingUserDetails = false,\n authToken,\n onHover,\n currentlyEditing,\n}) => {\n // if (firstName === 'All' && lastName === 'Users') {\n // return (\n // <div className='p-1 rounded-full bg-primary-100 dark:bg-black-600 flex items-center justify-center'>\n // <GroupsIcon className='text-primary-600 dark:text-primary-600 w-xs h-xs' />\n // </div>\n // );\n // }\n\n const [visible, setVisible] = useState<boolean>(false);\n const [imageLoaded, setImageLoaded] = useState<boolean>(false);\n\n const avatarSizeClass = sizeClasses[size];\n\n const {\n triggerRef: moreTagRef,\n dropdownRef,\n position: dropdownPosition,\n isVisible: showMore,\n show: handleShowMore,\n hide: handleHideMore,\n } = useDynamicPosition();\n\n const imageCacheRef = useRef<{ [key: string]: string }>({});\n\n const isRecent = useMemo(() => {\n if (isActive || !lastViewedOn) return false;\n const date = new Date(lastViewedOn);\n const now = new Date();\n const diffInHours = (now.getTime() - date.getTime()) / (1000 * 60 * 60);\n return diffInHours < 24;\n }, [isActive, lastViewedOn]);\n\n const getStatusColor = () => {\n if (isActive) return 'bg-primary-600 dark:bg-primary-600';\n if (isRecent) return 'bg-primary-300 dark:bg-primary-300';\n if (lastViewedOn) return 'bg-neutral-400 dark:bg-neutral-400';\n return null;\n };\n\n const statusColor = getStatusColor();\n\n const getBorderColor = () => {\n if (isActive) return 'border-primary-600 dark:border-primary-600';\n if (isRecent) return 'border-primary-300 dark:border-primary-300';\n if (lastViewedOn) return 'border-neutral-400 dark:border-neutral-400';\n return 'border-primary-200 dark:border-neutral-800';\n };\n\n const borderColor = getBorderColor();\n\n const indicatorSizes = {\n '2xs': 'w-1.5 h-1.5',\n xs: 'w-2 h-2',\n sm: 'w-2.5 h-2.5',\n md: 'w-3 h-3',\n lg: 'w-3.5 h-3.5',\n xl: 'w-4 h-4',\n };\n\n useEffect(() => {\n if (profilePic) {\n if (imageCacheRef.current[profilePic]) {\n setImageLoaded(true);\n } else {\n setImageLoaded(false);\n const img = new Image();\n const token = authToken || (typeof localStorage !== 'undefined' ? localStorage.getItem('token') : null);\n img.src = profilePic + (token ? '?token=' + token : '');\n img.onload = () => {\n imageCacheRef.current[profilePic] = img.src;\n setImageLoaded(true);\n };\n img.onerror = () => {\n setImageLoaded(false);\n };\n }\n } else {\n setImageLoaded(false);\n }\n }, [profilePic, authToken]);\n\n useEffect(() => {\n return () => {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n }\n };\n }, []);\n\n const cachedSrc = profilePic ? imageCacheRef.current[profilePic] : undefined;\n\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const popperRef = useRef<HTMLDivElement | null>(null);\n\n const handleMouseEnter = () => {\n onHover?.();\n if (firstName && lastName && enablePopper) {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n }\n timerRef.current = setTimeout(() => {\n setVisible(true);\n }, 300);\n }\n };\n\n const handleMouseLeave = (event: React.MouseEvent) => {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n }\n timerRef.current = setTimeout(() => {\n if (popperRef.current && !popperRef.current.contains(event.relatedTarget as Node)) {\n setVisible(false);\n }\n }, 200);\n };\n\n const popperContent = (\n <div\n ref={popperRef}\n className='bg-white dark:bg-black-800 shadow rounded-lg border border-neutral-200 dark:border-black-700 min-w-[280px]'\n onMouseEnter={() => {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n }\n }}\n onMouseLeave={(event) => handleMouseLeave(event)}\n >\n <div className='flex flex-col gap-1 items-center p-5'>\n <div className={cn('relative', sizeClasses[hoverSize])}>\n {cachedSrc && imageLoaded ? (\n <img\n src={cachedSrc}\n alt='Profile'\n className={cn('rounded-full border-2 object-cover w-full h-full', borderColor)}\n onError={() => setImageLoaded(false)}\n />\n ) : (\n <div\n className={cn(\n 'bg-primary-100 dark:bg-primary-950 border-2 flex items-center justify-center rounded-full w-full h-full',\n borderColor,\n )}\n >\n <Typography\n size='extra-small'\n variant='semibold'\n appearance='custom'\n className={cn('text-primary-600', initialsFontSizeClasses[hoverSize])}\n >\n {getInitials((firstName || '') + ' ' + (lastName || ''))}\n </Typography>\n </div>\n )}\n\n {statusColor && (\n <div\n className={cn(\n 'absolute bottom-0 right-0 rounded-full border-2 border-white dark:border-black-800',\n indicatorSizes[hoverSize],\n statusColor,\n )}\n />\n )}\n </div>\n <div className='flex flex-row gap-1 items-center justify-center'>\n <Typography size='medium' variant='semibold' className='w-full text-center'>\n {firstName || ''} {lastName || ''}\n </Typography>\n {userDetails?.region && <span>{getFlagComponentRectangleMd(userDetails?.region)}</span>}\n </div>\n\n <Typography size='small' variant='medium' appearance='body'>\n {email || userDetails?.email || ''}\n </Typography>\n </div>\n\n {currentlyEditing ? (\n <div className='px-5 pb-3'>\n <div className='flex items-center gap-3 rounded-lg border border-primary-100 dark:border-primary-900 bg-[rgba(230,241,252,0.60)] dark:bg-primary-950/40 px-[13px] py-[7px]'>\n <div className='flex items-center justify-center shrink-0 w-7 h-7 rounded-[5px] border-[0.4px] border-primary-100 dark:border-primary-900 bg-primary-50 dark:bg-primary-950'>\n <EditOutlinedIcon sx={{ width: 13, height: 13 }} className='text-primary-600 dark:text-primary-500' />\n </div>\n <div className='flex flex-col min-w-0'>\n <Typography\n size='extra-small'\n variant='semibold'\n appearance='custom'\n className='text-2xs leading-4 uppercase tracking-[0.2px] text-primary-600 dark:text-primary-500'\n >\n Currently editing\n </Typography>\n <Typography size='extra-small' variant='semibold' className='truncate'>\n {currentlyEditing}\n </Typography>\n </div>\n </div>\n </div>\n ) : null}\n\n {userId &&\n (isFetchingUserDetails ? (\n <div className='p-5'>\n <Skeleton />\n </div>\n ) : userId && (userDetails?.teams || userDetails?.clearanceLevel || userDetails?.group) ? (\n <div className='flex flex-col gap-4 bg-neutral-50 border-t border-neutral-200 dark:bg-black-700 dark:border-none p-5 rounded-b-lg'>\n <StatusInfoRow isActive={isActive} lastViewedOn={lastViewedOn} />\n {userDetails.username && (\n <InfoRow\n label='Username'\n content={\n <div className='flex gap-2'>\n <Typography size='small' variant='medium' appearance='body'>\n {userDetails.username}\n </Typography>\n </div>\n }\n />\n )}\n\n {userDetails?.teams && userDetails?.teams?.length > 0 && (\n <InfoRow\n label='Team'\n content={\n <div className='flex gap-2'>\n {userDetails?.teams?.length > 0 && (\n <Tag\n key={userDetails?.teams[0]?.id}\n label={userDetails?.teams[0]?.name}\n color={userDetails?.teams[0]?.color || '#e38715'}\n size='md'\n isHashColor\n />\n )}\n {userDetails?.teams?.length >= 2 && (\n <div\n ref={moreTagRef}\n className='relative cursor-pointer'\n onMouseEnter={handleShowMore}\n onMouseLeave={handleHideMore}\n onClick={(e) => e.stopPropagation()}\n >\n <Tag key={1} label={`+ ${userDetails?.teams?.length - 1} More`} color='#004f08' size='md' isHashColor />\n\n {showMore && (\n <div\n ref={dropdownRef}\n className={cn(\n 'absolute w-max bg-white dark:text-black-200 dark:bg-black-800 shadow-md border border-neutral-200 dark:border-black-800 rounded-md px-2 z-10 overflow-y-auto max-h-60',\n {\n 'top-full': dropdownPosition.vertical === 'bottom',\n 'bottom-full': dropdownPosition.vertical === 'top',\n 'left-0': dropdownPosition.horizontal === 'left',\n 'right-0': dropdownPosition.horizontal === 'right',\n },\n )}\n onMouseEnter={handleShowMore}\n onMouseLeave={handleHideMore}\n >\n {userDetails?.teams?.slice(1)?.map((team, index) => (\n <div key={team?.id || index} className='my-2'>\n <Tag key={team?.id} label={team?.name} color={team?.color || '#4A5568'} size='md' isHashColor className='w-fit' />\n </div>\n ))}\n </div>\n )}\n </div>\n )}\n </div>\n }\n />\n )}\n\n {userDetails?.group && (\n <InfoRow\n label='Role'\n content={<Tag key={userDetails?.group} label={userDetails?.group} color='#004094' size='md' isHashColor />}\n />\n )}\n\n {userDetails?.clearanceLevel && (\n <InfoRow\n label='Clearance Level'\n content={\n <Tag\n key={String(userDetails?.clearanceLevel)}\n label={`Level ${userDetails?.clearanceLevel}`}\n color='#b30000'\n size='md'\n isHashColor\n />\n }\n />\n )}\n </div>\n ) : (\n <div className='flex items-center justify-center bg-neutral-50 dark:bg-black-700 border-t border-neutral-200 dark:border-black-700 p-5 rounded-b-lg'>\n <Typography className='flex items-center justify-center gap-1' size='extra-small' variant='medium' appearance='body'>\n <WarningRoundedIcon\n sx={{\n height: '16px',\n width: '16px',\n color: '#F04438',\n }}\n />\n No other information found!\n </Typography>\n </div>\n ))}\n </div>\n );\n const containerRef = useRef<HTMLDivElement>(null);\n return (\n <div\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n className={cn('inline-block relative cursor-pointer', className)}\n ref={containerRef}\n >\n <div className={cn('relative', containerClassName || avatarSizeClass)}>\n {cachedSrc && imageLoaded ? (\n <img\n src={cachedSrc}\n alt='Profile'\n className={cn('rounded-full border object-cover w-full h-full', borderColor)}\n onError={() => setImageLoaded(false)}\n />\n ) : firstName === 'All' && lastName === 'Users' ? (\n <div className={cn('rounded-full bg-primary-100 dark:bg-black-600 flex items-center justify-center')}>\n <GroupsIcon className='text-primary-600 dark:text-primary-600 w-md h-md' />\n </div>\n ) :\n firstName && lastName ? (\n <div\n className={cn(\n 'bg-primary-100 flex items-center justify-center rounded-full border dark:bg-black-700',\n sizeClasses[size],\n borderColor,\n )}\n >\n <Typography\n size='extra-small'\n variant='semibold'\n appearance='custom'\n className={cn('text-primary-600', initialsFontSizeClasses[size])}\n >\n {getInitials((firstName || '') + ' ' + (lastName || ''))}\n </Typography>\n </div>\n ) : (\n <div className={cn(borderColor, 'p-1 rounded-full bg-neutral-200 dark:bg-black-600 flex items-center justify-center border w-full h-full')}>\n <PersonIcon fill='#98A2B3' />\n </div>\n )}\n\n {statusIndicator && statusColor && (\n <div\n className={cn(\n 'absolute bottom-0 right-0 rounded-full border border-white dark:border-black-800 w-2 h-2',\n\n statusColor,\n )}\n />\n )}\n </div>\n <UserAvatarPopper\n isOpen={visible}\n onClose={() => setVisible(false)}\n anchorEl={containerRef.current}\n className='bg-white dark:bg-black-700 shadow rounded-lg border border-neutral-200 dark:border-black-600'\n >\n {popperContent}\n </UserAvatarPopper>\n </div>\n );\n};\n\nUserAvatar.displayName = 'UserAvatar';\n\n"],"names":["InfoRow","label","content","jsxs","jsx","Typography","UserAvatar","firstName","lastName","email","profilePic","size","hoverSize","containerClassName","enablePopper","className","userId","lastViewedOn","isActive","statusIndicator","userDetails","isFetchingUserDetails","authToken","onHover","currentlyEditing","visible","setVisible","useState","imageLoaded","setImageLoaded","avatarSizeClass","sizeClasses","moreTagRef","dropdownRef","dropdownPosition","showMore","handleShowMore","handleHideMore","useDynamicPosition","imageCacheRef","useRef","isRecent","useMemo","date","statusColor","borderColor","indicatorSizes","useEffect","img","token","timerRef","cachedSrc","popperRef","handleMouseEnter","handleMouseLeave","event","popperContent","cn","initialsFontSizeClasses","getInitials","getFlagComponentRectangleMd","EditOutlinedIcon","Skeleton","StatusInfoRow","Tag","e","team","index","WarningRoundedIcon","containerRef","GroupsIcon","PersonIcon","UserAvatarPopper"],"mappings":"+rBA2DMA,EAAU,CAAC,CAAE,MAAAC,EAAO,QAAAC,KACxBC,OAAC,MAAA,CAAI,UAAU,oCACb,SAAA,CAAAC,EAAAA,IAACC,EAAAA,WAAA,CAAW,KAAK,QAAQ,QAAQ,SAAS,UAAU,OAAO,WAAW,OACnE,SAAAJ,CAAA,CACH,EACCC,CAAA,EACH,EAiBWI,EAAkC,CAAC,CAC9C,UAAAC,EACA,SAAAC,EACA,M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AlD,EAAW,YAAc"}
@@ -1,7 +1,7 @@
1
- import { jsx as e, jsxs as o } from "react/jsx-runtime";
1
+ import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
2
  import re from "@mui/icons-material/EditOutlined";
3
3
  import ae from "@mui/icons-material/WarningRounded";
4
- import l from "../../_virtual/index.es.js";
4
+ import o from "../../_virtual/index.es.js";
5
5
  import { useState as B, useRef as v, useMemo as oe, useEffect as F } from "react";
6
6
  import { Typography as n } from "../data-display/typography/Typography.es.js";
7
7
  import { Tag as p } from "../data-display/tag/Tag.es.js";
@@ -13,7 +13,7 @@ import { sizeClasses as M, getInitials as A, initialsFontSizeClasses as $ } from
13
13
  import { PersonIcon as ie } from "./PersonIcon.es.js";
14
14
  import { useDynamicPosition as ce } from "./useDynamicPosition.es.js";
15
15
  import { GroupsIcon as se } from "../icon/icons.generated.es.js";
16
- const k = ({ label: d, content: i }) => /* @__PURE__ */ o("div", { className: "flex justify-between items-center", children: [
16
+ const k = ({ label: d, content: i }) => /* @__PURE__ */ l("div", { className: "flex justify-between items-center", children: [
17
17
  /* @__PURE__ */ e(n, { size: "small", variant: "medium", className: "mr-5", appearance: "body", children: d }),
18
18
  i
19
19
  ] }), me = ({
@@ -36,8 +36,6 @@ const k = ({ label: d, content: i }) => /* @__PURE__ */ o("div", { className: "f
36
36
  onHover: Q,
37
37
  currentlyEditing: L
38
38
  }) => {
39
- if (d === "All" && i === "Users")
40
- return /* @__PURE__ */ e("div", { className: "p-1 rounded-full bg-primary-100 dark:bg-black-600 flex items-center justify-center", children: /* @__PURE__ */ e(se, { className: "text-primary-600 dark:text-primary-600 w-xs h-xs" }) });
41
39
  const [X, N] = B(!1), [T, s] = B(!1), Y = M[y], {
42
40
  triggerRef: Z,
43
41
  dropdownRef: _,
@@ -83,7 +81,7 @@ const k = ({ label: d, content: i }) => /* @__PURE__ */ o("div", { className: "f
83
81
  t.current && clearTimeout(t.current), t.current = setTimeout(() => {
84
82
  z.current && !z.current.contains(a.relatedTarget) && N(!1);
85
83
  }, 200);
86
- }, ee = /* @__PURE__ */ o(
84
+ }, ee = /* @__PURE__ */ l(
87
85
  "div",
88
86
  {
89
87
  ref: z,
@@ -93,20 +91,20 @@ const k = ({ label: d, content: i }) => /* @__PURE__ */ o("div", { className: "f
93
91
  },
94
92
  onMouseLeave: (a) => H(a),
95
93
  children: [
96
- /* @__PURE__ */ o("div", { className: "flex flex-col gap-1 items-center p-5", children: [
97
- /* @__PURE__ */ o("div", { className: l("relative", M[w]), children: [
94
+ /* @__PURE__ */ l("div", { className: "flex flex-col gap-1 items-center p-5", children: [
95
+ /* @__PURE__ */ l("div", { className: o("relative", M[w]), children: [
98
96
  x && T ? /* @__PURE__ */ e(
99
97
  "img",
100
98
  {
101
99
  src: x,
102
100
  alt: "Profile",
103
- className: l("rounded-full border-2 object-cover w-full h-full", b),
101
+ className: o("rounded-full border-2 object-cover w-full h-full", b),
104
102
  onError: () => s(!1)
105
103
  }
106
104
  ) : /* @__PURE__ */ e(
107
105
  "div",
108
106
  {
109
- className: l(
107
+ className: o(
110
108
  "bg-primary-100 dark:bg-primary-950 border-2 flex items-center justify-center rounded-full w-full h-full",
111
109
  b
112
110
  ),
@@ -116,7 +114,7 @@ const k = ({ label: d, content: i }) => /* @__PURE__ */ o("div", { className: "f
116
114
  size: "extra-small",
117
115
  variant: "semibold",
118
116
  appearance: "custom",
119
- className: l("text-primary-600", $[w]),
117
+ className: o("text-primary-600", $[w]),
120
118
  children: A((d || "") + " " + (i || ""))
121
119
  }
122
120
  )
@@ -125,7 +123,7 @@ const k = ({ label: d, content: i }) => /* @__PURE__ */ o("div", { className: "f
125
123
  h && /* @__PURE__ */ e(
126
124
  "div",
127
125
  {
128
- className: l(
126
+ className: o(
129
127
  "absolute bottom-0 right-0 rounded-full border-2 border-white dark:border-black-800",
130
128
  V[w],
131
129
  h
@@ -133,8 +131,8 @@ const k = ({ label: d, content: i }) => /* @__PURE__ */ o("div", { className: "f
133
131
  }
134
132
  )
135
133
  ] }),
136
- /* @__PURE__ */ o("div", { className: "flex flex-row gap-1 items-center justify-center", children: [
137
- /* @__PURE__ */ o(n, { size: "medium", variant: "semibold", className: "w-full text-center", children: [
134
+ /* @__PURE__ */ l("div", { className: "flex flex-row gap-1 items-center justify-center", children: [
135
+ /* @__PURE__ */ l(n, { size: "medium", variant: "semibold", className: "w-full text-center", children: [
138
136
  d || "",
139
137
  " ",
140
138
  i || ""
@@ -143,9 +141,9 @@ const k = ({ label: d, content: i }) => /* @__PURE__ */ o("div", { className: "f
143
141
  ] }),
144
142
  /* @__PURE__ */ e(n, { size: "small", variant: "medium", appearance: "body", children: G || r?.email || "" })
145
143
  ] }),
146
- L ? /* @__PURE__ */ e("div", { className: "px-5 pb-3", children: /* @__PURE__ */ o("div", { className: "flex items-center gap-3 rounded-lg border border-primary-100 dark:border-primary-900 bg-[rgba(230,241,252,0.60)] dark:bg-primary-950/40 px-[13px] py-[7px]", children: [
144
+ L ? /* @__PURE__ */ e("div", { className: "px-5 pb-3", children: /* @__PURE__ */ l("div", { className: "flex items-center gap-3 rounded-lg border border-primary-100 dark:border-primary-900 bg-[rgba(230,241,252,0.60)] dark:bg-primary-950/40 px-[13px] py-[7px]", children: [
147
145
  /* @__PURE__ */ e("div", { className: "flex items-center justify-center shrink-0 w-7 h-7 rounded-[5px] border-[0.4px] border-primary-100 dark:border-primary-900 bg-primary-50 dark:bg-primary-950", children: /* @__PURE__ */ e(re, { sx: { width: 13, height: 13 }, className: "text-primary-600 dark:text-primary-500" }) }),
148
- /* @__PURE__ */ o("div", { className: "flex flex-col min-w-0", children: [
146
+ /* @__PURE__ */ l("div", { className: "flex flex-col min-w-0", children: [
149
147
  /* @__PURE__ */ e(
150
148
  n,
151
149
  {
@@ -159,7 +157,7 @@ const k = ({ label: d, content: i }) => /* @__PURE__ */ o("div", { className: "f
159
157
  /* @__PURE__ */ e(n, { size: "extra-small", variant: "semibold", className: "truncate", children: L })
160
158
  ] })
161
159
  ] }) }) : null,
162
- R && (K ? /* @__PURE__ */ e("div", { className: "p-5", children: /* @__PURE__ */ e(le, {}) }) : R && (r?.teams || r?.clearanceLevel || r?.group) ? /* @__PURE__ */ o("div", { className: "flex flex-col gap-4 bg-neutral-50 border-t border-neutral-200 dark:bg-black-700 dark:border-none p-5 rounded-b-lg", children: [
160
+ R && (K ? /* @__PURE__ */ e("div", { className: "p-5", children: /* @__PURE__ */ e(le, {}) }) : R && (r?.teams || r?.clearanceLevel || r?.group) ? /* @__PURE__ */ l("div", { className: "flex flex-col gap-4 bg-neutral-50 border-t border-neutral-200 dark:bg-black-700 dark:border-none p-5 rounded-b-lg", children: [
163
161
  /* @__PURE__ */ e(de, { isActive: u, lastViewedOn: m }),
164
162
  r.username && /* @__PURE__ */ e(
165
163
  k,
@@ -172,7 +170,7 @@ const k = ({ label: d, content: i }) => /* @__PURE__ */ o("div", { className: "f
172
170
  k,
173
171
  {
174
172
  label: "Team",
175
- content: /* @__PURE__ */ o("div", { className: "flex gap-2", children: [
173
+ content: /* @__PURE__ */ l("div", { className: "flex gap-2", children: [
176
174
  r?.teams?.length > 0 && /* @__PURE__ */ e(
177
175
  p,
178
176
  {
@@ -183,7 +181,7 @@ const k = ({ label: d, content: i }) => /* @__PURE__ */ o("div", { className: "f
183
181
  },
184
182
  r?.teams[0]?.id
185
183
  ),
186
- r?.teams?.length >= 2 && /* @__PURE__ */ o(
184
+ r?.teams?.length >= 2 && /* @__PURE__ */ l(
187
185
  "div",
188
186
  {
189
187
  ref: Z,
@@ -197,7 +195,7 @@ const k = ({ label: d, content: i }) => /* @__PURE__ */ o("div", { className: "f
197
195
  "div",
198
196
  {
199
197
  ref: _,
200
- className: l(
198
+ className: o(
201
199
  "absolute w-max bg-white dark:text-black-200 dark:bg-black-800 shadow-md border border-neutral-200 dark:border-black-800 rounded-md px-2 z-10 overflow-y-auto max-h-60",
202
200
  {
203
201
  "top-full": g.vertical === "bottom",
@@ -240,7 +238,7 @@ const k = ({ label: d, content: i }) => /* @__PURE__ */ o("div", { className: "f
240
238
  )
241
239
  }
242
240
  )
243
- ] }) : /* @__PURE__ */ e("div", { className: "flex items-center justify-center bg-neutral-50 dark:bg-black-700 border-t border-neutral-200 dark:border-black-700 p-5 rounded-b-lg", children: /* @__PURE__ */ o(n, { className: "flex items-center justify-center gap-1", size: "extra-small", variant: "medium", appearance: "body", children: [
241
+ ] }) : /* @__PURE__ */ e("div", { className: "flex items-center justify-center bg-neutral-50 dark:bg-black-700 border-t border-neutral-200 dark:border-black-700 p-5 rounded-b-lg", children: /* @__PURE__ */ l(n, { className: "flex items-center justify-center gap-1", size: "extra-small", variant: "medium", appearance: "body", children: [
244
242
  /* @__PURE__ */ e(
245
243
  ae,
246
244
  {
@@ -256,27 +254,27 @@ const k = ({ label: d, content: i }) => /* @__PURE__ */ o("div", { className: "f
256
254
  ]
257
255
  }
258
256
  ), U = v(null);
259
- return /* @__PURE__ */ o(
257
+ return /* @__PURE__ */ l(
260
258
  "div",
261
259
  {
262
260
  onMouseEnter: D,
263
261
  onMouseLeave: H,
264
- className: l("inline-block relative cursor-pointer", q),
262
+ className: o("inline-block relative cursor-pointer", q),
265
263
  ref: U,
266
264
  children: [
267
- /* @__PURE__ */ o("div", { className: l("relative", P || Y), children: [
265
+ /* @__PURE__ */ l("div", { className: o("relative", P || Y), children: [
268
266
  x && T ? /* @__PURE__ */ e(
269
267
  "img",
270
268
  {
271
269
  src: x,
272
270
  alt: "Profile",
273
- className: l("rounded-full border object-cover w-full h-full", b),
271
+ className: o("rounded-full border object-cover w-full h-full", b),
274
272
  onError: () => s(!1)
275
273
  }
276
- ) : d && i ? /* @__PURE__ */ e(
274
+ ) : d === "All" && i === "Users" ? /* @__PURE__ */ e("div", { className: o("rounded-full bg-primary-100 dark:bg-black-600 flex items-center justify-center"), children: /* @__PURE__ */ e(se, { className: "text-primary-600 dark:text-primary-600 w-md h-md" }) }) : d && i ? /* @__PURE__ */ e(
277
275
  "div",
278
276
  {
279
- className: l(
277
+ className: o(
280
278
  "bg-primary-100 flex items-center justify-center rounded-full border dark:bg-black-700",
281
279
  M[y],
282
280
  b
@@ -287,16 +285,16 @@ const k = ({ label: d, content: i }) => /* @__PURE__ */ o("div", { className: "f
287
285
  size: "extra-small",
288
286
  variant: "semibold",
289
287
  appearance: "custom",
290
- className: l("text-primary-600", $[y]),
288
+ className: o("text-primary-600", $[y]),
291
289
  children: A((d || "") + " " + (i || ""))
292
290
  }
293
291
  )
294
292
  }
295
- ) : /* @__PURE__ */ e("div", { className: l(b, "p-1 rounded-full bg-neutral-200 dark:bg-black-600 flex items-center justify-center border w-full h-full"), children: /* @__PURE__ */ e(ie, { fill: "#98A2B3" }) }),
293
+ ) : /* @__PURE__ */ e("div", { className: o(b, "p-1 rounded-full bg-neutral-200 dark:bg-black-600 flex items-center justify-center border w-full h-full"), children: /* @__PURE__ */ e(ie, { fill: "#98A2B3" }) }),
296
294
  J && h && /* @__PURE__ */ e(
297
295
  "div",
298
296
  {
299
- className: l(
297
+ className: o(
300
298
  "absolute bottom-0 right-0 rounded-full border border-white dark:border-black-800 w-2 h-2",
301
299
  h
302
300
  )
@@ -1 +1 @@
1
- {"version":3,"file":"UserAvatar.es.js","sources":["../../../src/components/user-avatar/UserAvatar.tsx"],"sourcesContent":["import EditOutlinedIcon from '@mui/icons-material/EditOutlined';\nimport WarningRoundedIcon from '@mui/icons-material/WarningRounded';\nimport cn from 'classnames';\nimport { type FC, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { Typography } from '../data-display/typography/Typography';\nimport { Tag } from '../data-display/tag/Tag';\nimport { Skeleton } from '../data-display/skeleton/Skeleton';\nimport { getFlagComponentRectangleMd } from '../../utils/countryFlags';\nimport { UserAvatarPopper } from './UserAvatarPopper';\nimport { StatusInfoRow } from './StatusInfoRow';\nimport { sizeClasses, getInitials, initialsFontSizeClasses } from './constants';\nimport { PersonIcon } from './PersonIcon';\nimport { useDynamicPosition } from './useDynamicPosition';\nimport { GroupsIcon } from '../icon';\n\nexport type UserAvatarSize = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\nexport type UserDetailsTeam = {\n id?: string;\n name: string;\n color?: string;\n};\n\nexport type UserDetails = {\n email?: string;\n username?: string;\n teams?: UserDetailsTeam[];\n group?: string;\n clearanceLevel?: number | string;\n region?: string;\n};\n\nexport type UserAvatarProps = {\n firstName?: string;\n lastName?: string;\n email?: string;\n enablePopper?: boolean;\n profilePic?: string;\n size?: UserAvatarSize;\n hoverSize?: UserAvatarSize;\n containerClassName?: string;\n className?: string;\n userId?: string;\n lastViewedOn?: string;\n isActive?: boolean;\n statusIndicator?: boolean;\n /** User details to display in the popper - replaces the useTeamMemberFilter hook */\n userDetails?: UserDetails | null;\n /** Whether user details are being fetched */\n isFetchingUserDetails?: boolean;\n /** Optional token for authenticated image loading */\n authToken?: string;\n /** Callback triggered when mouse enters the avatar */\n onHover?: () => void;\n /** Name of the clause / line item the user is currently editing. When set, a highlighted \"Currently editing\" card is shown in the popper. */\n currentlyEditing?: string;\n};\n\nconst InfoRow = ({ label, content }: { label: string; content: React.ReactNode }) => (\n <div className='flex justify-between items-center'>\n <Typography size='small' variant='medium' className='mr-5' appearance='body'>\n {label}\n </Typography>\n {content}\n </div>\n);\n\n/**\n * UserAvatar component for displaying user profile pictures with hover popper\n *\n * @example\n * ```tsx\n * <UserAvatar\n * firstName=\"John\"\n * lastName=\"Doe\"\n * email=\"john@example.com\"\n * profilePic=\"/avatar.jpg\"\n * userDetails={{ teams: [{ name: 'Engineering', color: '#0066cc' }], group: 'Admin' }}\n * />\n * ```\n */\nexport const UserAvatar: FC<UserAvatarProps> = ({\n firstName,\n lastName,\n email,\n profilePic,\n size = 'md',\n hoverSize = 'lg',\n containerClassName = '',\n enablePopper = true,\n className,\n userId,\n lastViewedOn,\n isActive,\n statusIndicator = false,\n userDetails,\n isFetchingUserDetails = false,\n authToken,\n onHover,\n currentlyEditing,\n}) => {\n if (firstName === 'All' && lastName === 'Users') {\n return (\n <div className='p-1 rounded-full bg-primary-100 dark:bg-black-600 flex items-center justify-center'>\n <GroupsIcon className='text-primary-600 dark:text-primary-600 w-xs h-xs' />\n </div>\n );\n }\n\n const [visible, setVisible] = useState<boolean>(false);\n const [imageLoaded, setImageLoaded] = useState<boolean>(false);\n\n const avatarSizeClass = sizeClasses[size];\n\n const {\n triggerRef: moreTagRef,\n dropdownRef,\n position: dropdownPosition,\n isVisible: showMore,\n show: handleShowMore,\n hide: handleHideMore,\n } = useDynamicPosition();\n\n const imageCacheRef = useRef<{ [key: string]: string }>({});\n\n const isRecent = useMemo(() => {\n if (isActive || !lastViewedOn) return false;\n const date = new Date(lastViewedOn);\n const now = new Date();\n const diffInHours = (now.getTime() - date.getTime()) / (1000 * 60 * 60);\n return diffInHours < 24;\n }, [isActive, lastViewedOn]);\n\n const getStatusColor = () => {\n if (isActive) return 'bg-primary-600 dark:bg-primary-600';\n if (isRecent) return 'bg-primary-300 dark:bg-primary-300';\n if (lastViewedOn) return 'bg-neutral-400 dark:bg-neutral-400';\n return null;\n };\n\n const statusColor = getStatusColor();\n\n const getBorderColor = () => {\n if (isActive) return 'border-primary-600 dark:border-primary-600';\n if (isRecent) return 'border-primary-300 dark:border-primary-300';\n if (lastViewedOn) return 'border-neutral-400 dark:border-neutral-400';\n return 'border-primary-200 dark:border-neutral-800';\n };\n\n const borderColor = getBorderColor();\n\n const indicatorSizes = {\n '2xs': 'w-1.5 h-1.5',\n xs: 'w-2 h-2',\n sm: 'w-2.5 h-2.5',\n md: 'w-3 h-3',\n lg: 'w-3.5 h-3.5',\n xl: 'w-4 h-4',\n };\n\n useEffect(() => {\n if (profilePic) {\n if (imageCacheRef.current[profilePic]) {\n setImageLoaded(true);\n } else {\n setImageLoaded(false);\n const img = new Image();\n const token = authToken || (typeof localStorage !== 'undefined' ? localStorage.getItem('token') : null);\n img.src = profilePic + (token ? '?token=' + token : '');\n img.onload = () => {\n imageCacheRef.current[profilePic] = img.src;\n setImageLoaded(true);\n };\n img.onerror = () => {\n setImageLoaded(false);\n };\n }\n } else {\n setImageLoaded(false);\n }\n }, [profilePic, authToken]);\n\n useEffect(() => {\n return () => {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n }\n };\n }, []);\n\n const cachedSrc = profilePic ? imageCacheRef.current[profilePic] : undefined;\n\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const popperRef = useRef<HTMLDivElement | null>(null);\n\n const handleMouseEnter = () => {\n onHover?.();\n if (firstName && lastName && enablePopper) {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n }\n timerRef.current = setTimeout(() => {\n setVisible(true);\n }, 300);\n }\n };\n\n const handleMouseLeave = (event: React.MouseEvent) => {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n }\n timerRef.current = setTimeout(() => {\n if (popperRef.current && !popperRef.current.contains(event.relatedTarget as Node)) {\n setVisible(false);\n }\n }, 200);\n };\n\n const popperContent = (\n <div\n ref={popperRef}\n className='bg-white dark:bg-black-800 shadow rounded-lg border border-neutral-200 dark:border-black-700 min-w-[280px]'\n onMouseEnter={() => {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n }\n }}\n onMouseLeave={(event) => handleMouseLeave(event)}\n >\n <div className='flex flex-col gap-1 items-center p-5'>\n <div className={cn('relative', sizeClasses[hoverSize])}>\n {cachedSrc && imageLoaded ? (\n <img\n src={cachedSrc}\n alt='Profile'\n className={cn('rounded-full border-2 object-cover w-full h-full', borderColor)}\n onError={() => setImageLoaded(false)}\n />\n ) : (\n <div\n className={cn(\n 'bg-primary-100 dark:bg-primary-950 border-2 flex items-center justify-center rounded-full w-full h-full',\n borderColor,\n )}\n >\n <Typography\n size='extra-small'\n variant='semibold'\n appearance='custom'\n className={cn('text-primary-600', initialsFontSizeClasses[hoverSize])}\n >\n {getInitials((firstName || '') + ' ' + (lastName || ''))}\n </Typography>\n </div>\n )}\n\n {statusColor && (\n <div\n className={cn(\n 'absolute bottom-0 right-0 rounded-full border-2 border-white dark:border-black-800',\n indicatorSizes[hoverSize],\n statusColor,\n )}\n />\n )}\n </div>\n <div className='flex flex-row gap-1 items-center justify-center'>\n <Typography size='medium' variant='semibold' className='w-full text-center'>\n {firstName || ''} {lastName || ''}\n </Typography>\n {userDetails?.region && <span>{getFlagComponentRectangleMd(userDetails?.region)}</span>}\n </div>\n\n <Typography size='small' variant='medium' appearance='body'>\n {email || userDetails?.email || ''}\n </Typography>\n </div>\n\n {currentlyEditing ? (\n <div className='px-5 pb-3'>\n <div className='flex items-center gap-3 rounded-lg border border-primary-100 dark:border-primary-900 bg-[rgba(230,241,252,0.60)] dark:bg-primary-950/40 px-[13px] py-[7px]'>\n <div className='flex items-center justify-center shrink-0 w-7 h-7 rounded-[5px] border-[0.4px] border-primary-100 dark:border-primary-900 bg-primary-50 dark:bg-primary-950'>\n <EditOutlinedIcon sx={{ width: 13, height: 13 }} className='text-primary-600 dark:text-primary-500' />\n </div>\n <div className='flex flex-col min-w-0'>\n <Typography\n size='extra-small'\n variant='semibold'\n appearance='custom'\n className='text-2xs leading-4 uppercase tracking-[0.2px] text-primary-600 dark:text-primary-500'\n >\n Currently editing\n </Typography>\n <Typography size='extra-small' variant='semibold' className='truncate'>\n {currentlyEditing}\n </Typography>\n </div>\n </div>\n </div>\n ) : null}\n\n {userId &&\n (isFetchingUserDetails ? (\n <div className='p-5'>\n <Skeleton />\n </div>\n ) : userId && (userDetails?.teams || userDetails?.clearanceLevel || userDetails?.group) ? (\n <div className='flex flex-col gap-4 bg-neutral-50 border-t border-neutral-200 dark:bg-black-700 dark:border-none p-5 rounded-b-lg'>\n <StatusInfoRow isActive={isActive} lastViewedOn={lastViewedOn} />\n {userDetails.username && (\n <InfoRow\n label='Username'\n content={\n <div className='flex gap-2'>\n <Typography size='small' variant='medium' appearance='body'>\n {userDetails.username}\n </Typography>\n </div>\n }\n />\n )}\n\n {userDetails?.teams && userDetails?.teams?.length > 0 && (\n <InfoRow\n label='Team'\n content={\n <div className='flex gap-2'>\n {userDetails?.teams?.length > 0 && (\n <Tag\n key={userDetails?.teams[0]?.id}\n label={userDetails?.teams[0]?.name}\n color={userDetails?.teams[0]?.color || '#e38715'}\n size='md'\n isHashColor\n />\n )}\n {userDetails?.teams?.length >= 2 && (\n <div\n ref={moreTagRef}\n className='relative cursor-pointer'\n onMouseEnter={handleShowMore}\n onMouseLeave={handleHideMore}\n onClick={(e) => e.stopPropagation()}\n >\n <Tag key={1} label={`+ ${userDetails?.teams?.length - 1} More`} color='#004f08' size='md' isHashColor />\n\n {showMore && (\n <div\n ref={dropdownRef}\n className={cn(\n 'absolute w-max bg-white dark:text-black-200 dark:bg-black-800 shadow-md border border-neutral-200 dark:border-black-800 rounded-md px-2 z-10 overflow-y-auto max-h-60',\n {\n 'top-full': dropdownPosition.vertical === 'bottom',\n 'bottom-full': dropdownPosition.vertical === 'top',\n 'left-0': dropdownPosition.horizontal === 'left',\n 'right-0': dropdownPosition.horizontal === 'right',\n },\n )}\n onMouseEnter={handleShowMore}\n onMouseLeave={handleHideMore}\n >\n {userDetails?.teams?.slice(1)?.map((team, index) => (\n <div key={team?.id || index} className='my-2'>\n <Tag key={team?.id} label={team?.name} color={team?.color || '#4A5568'} size='md' isHashColor className='w-fit' />\n </div>\n ))}\n </div>\n )}\n </div>\n )}\n </div>\n }\n />\n )}\n\n {userDetails?.group && (\n <InfoRow\n label='Role'\n content={<Tag key={userDetails?.group} label={userDetails?.group} color='#004094' size='md' isHashColor />}\n />\n )}\n\n {userDetails?.clearanceLevel && (\n <InfoRow\n label='Clearance Level'\n content={\n <Tag\n key={String(userDetails?.clearanceLevel)}\n label={`Level ${userDetails?.clearanceLevel}`}\n color='#b30000'\n size='md'\n isHashColor\n />\n }\n />\n )}\n </div>\n ) : (\n <div className='flex items-center justify-center bg-neutral-50 dark:bg-black-700 border-t border-neutral-200 dark:border-black-700 p-5 rounded-b-lg'>\n <Typography className='flex items-center justify-center gap-1' size='extra-small' variant='medium' appearance='body'>\n <WarningRoundedIcon\n sx={{\n height: '16px',\n width: '16px',\n color: '#F04438',\n }}\n />\n No other information found!\n </Typography>\n </div>\n ))}\n </div>\n );\n const containerRef = useRef<HTMLDivElement>(null);\n return (\n <div\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n className={cn('inline-block relative cursor-pointer', className)}\n ref={containerRef}\n >\n <div className={cn('relative', containerClassName || avatarSizeClass)}>\n {cachedSrc && imageLoaded ? (\n <img\n src={cachedSrc}\n alt='Profile'\n className={cn('rounded-full border object-cover w-full h-full', borderColor)}\n onError={() => setImageLoaded(false)}\n />\n ) : firstName && lastName ? (\n <div\n className={cn(\n 'bg-primary-100 flex items-center justify-center rounded-full border dark:bg-black-700',\n sizeClasses[size],\n borderColor,\n )}\n >\n <Typography\n size='extra-small'\n variant='semibold'\n appearance='custom'\n className={cn('text-primary-600', initialsFontSizeClasses[size])}\n >\n {getInitials((firstName || '') + ' ' + (lastName || ''))}\n </Typography>\n </div>\n ) : (\n <div className={cn(borderColor, 'p-1 rounded-full bg-neutral-200 dark:bg-black-600 flex items-center justify-center border w-full h-full')}>\n <PersonIcon fill='#98A2B3' />\n </div>\n )}\n\n {statusIndicator && statusColor && (\n <div\n className={cn(\n 'absolute bottom-0 right-0 rounded-full border border-white dark:border-black-800 w-2 h-2',\n\n statusColor,\n )}\n />\n )}\n </div>\n <UserAvatarPopper\n isOpen={visible}\n onClose={() => setVisible(false)}\n anchorEl={containerRef.current}\n className='bg-white dark:bg-black-700 shadow rounded-lg border border-neutral-200 dark:border-black-600'\n >\n {popperContent}\n </UserAvatarPopper>\n </div>\n );\n};\n\nUserAvatar.displayName = 'UserAvatar';\n\n"],"names":["InfoRow","label","content","jsxs","jsx","Typography","UserAvatar","firstName","lastName","email","profilePic","size","hoverSize","containerClassName","enablePopper","className","userId","lastViewedOn","isActive","statusIndicator","userDetails","isFetchingUserDetails","authToken","onHover","currentlyEditing","GroupsIcon","visible","setVisible","useState","imageLoaded","setImageLoaded","avatarSizeClass","sizeClasses","moreTagRef","dropdownRef","dropdownPosition","showMore","handleShowMore","handleHideMore","useDynamicPosition","imageCacheRef","useRef","isRecent","useMemo","date","statusColor","borderColor","indicatorSizes","useEffect","img","token","timerRef","cachedSrc","popperRef","handleMouseEnter","handleMouseLeave","event","popperContent","cn","initialsFontSizeClasses","getInitials","getFlagComponentRectangleMd","EditOutlinedIcon","Skeleton","StatusInfoRow","Tag","e","team","index","WarningRoundedIcon","containerRef","PersonIcon","UserAvatarPopper"],"mappings":";;;;;;;;;;;;;;;AA2DA,MAAMA,IAAU,CAAC,EAAE,OAAAC,GAAO,SAAAC,QACxB,gBAAAC,EAAC,OAAA,EAAI,WAAU,qCACb,UAAA;AAAA,EAAA,gBAAAC,EAACC,GAAA,EAAW,MAAK,SAAQ,SAAQ,UAAS,WAAU,QAAO,YAAW,QACnE,UAAAJ,EAAA,CACH;AAAA,EACCC;AAAA,GACH,GAiBWI,KAAkC,CAAC;AAAA,EAC9C,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,WAAAC,IAAY;AAAA,EACZ,oBAAAC,IAAqB;AAAA,EACrB,cAAAC,IAAe;AAAA,EACf,WAAAC;AAAA,EACA,QAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,iBAAAC,IAAkB;AAAA,EAClB,aAAAC;AAAA,EACA,uBAAAC,IAAwB;AAAA,EACxB,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,kBAAAC;AACF,MAAM;AACJ,MAAIjB,MAAc,SAASC,MAAa;AACtC,WACE,gBAAAJ,EAAC,SAAI,WAAU,sFACb,4BAACqB,IAAA,EAAW,WAAU,oDAAmD,EAAA,CAC3E;AAIJ,QAAM,CAACC,GAASC,CAAU,IAAIC,EAAkB,EAAK,GAC/C,CAACC,GAAaC,CAAc,IAAIF,EAAkB,EAAK,GAEvDG,IAAkBC,EAAYrB,CAAI,GAElC;AAAA,IACJ,YAAYsB;AAAA,IACZ,aAAAC;AAA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SAAS,MAAMhB,EAAe,EAAK;AAAA,YAAA;AAAA,UAAA,IAEnCvB,KAAaC,IACf,gBAAAJ;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAWsD;AAAA,gBACT;AAAA,gBACA1B,EAAYrB,CAAI;AAAA,gBAChBmC;AAAA,cAAA;AAAA,cAGF,UAAA,gBAAA1C;AAAA,gBAACC;AAAA,gBAAA;AAAA,kBACC,MAAK;AAAA,kBACL,SAAQ;AAAA,kBACR,YAAW;AAAA,kBACX,WAAWqD,EAAG,oBAAoBC,EAAwBhD,CAAI,CAAC;AAAA,kBAE9D,UAAAiD,GAAarD,KAAa,MAAM,OAAOC,KAAY,GAAG;AAAA,gBAAA;AAAA,cAAA;AAAA,YACzD;AAAA,UAAA,IAGF,gBAAAJ,EAAC,OAAA,EAAI,WAAWsD,EAAGZ,GAAa,yGAAyG,GACvI,UAAA,gBAAA1C,EAACmE,IAAA,EAAW,MAAK,UAAA,CAAU,EAAA,CAC7B;AAAA,UAGDpD,KAAmB0B,KAClB,gBAAAzC;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAWsD;AAAA,gBACT;AAAA,gBAEAb;AAAA,cAAA;AAAA,YACF;AAAA,UAAA;AAAA,QACF,GAEJ;AAAA,QACA,gBAAAzC;AAAA,UAACoE;AAAA,UAAA;AAAA,YACC,QAAQ9C;AAAA,YACR,SAAS,MAAMC,EAAW,EAAK;AAAA,YAC/B,UAAU2C,EAAa;AAAA,YACvB,WAAU;AAAA,YAET,UAAAb;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAGN;AAEAnD,GAAW,cAAc;"}
1
+ {"version":3,"file":"UserAvatar.es.js","sources":["../../../src/components/user-avatar/UserAvatar.tsx"],"sourcesContent":["import EditOutlinedIcon from '@mui/icons-material/EditOutlined';\nimport WarningRoundedIcon from '@mui/icons-material/WarningRounded';\nimport cn from 'classnames';\nimport { type FC, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { Typography } from '../data-display/typography/Typography';\nimport { Tag } from '../data-display/tag/Tag';\nimport { Skeleton } from '../data-display/skeleton/Skeleton';\nimport { getFlagComponentRectangleMd } from '../../utils/countryFlags';\nimport { UserAvatarPopper } from './UserAvatarPopper';\nimport { StatusInfoRow } from './StatusInfoRow';\nimport { sizeClasses, getInitials, initialsFontSizeClasses } from './constants';\nimport { PersonIcon } from './PersonIcon';\nimport { useDynamicPosition } from './useDynamicPosition';\nimport { GroupsIcon } from '../icon';\n\nexport type UserAvatarSize = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\nexport type UserDetailsTeam = {\n id?: string;\n name: string;\n color?: string;\n};\n\nexport type UserDetails = {\n email?: string;\n username?: string;\n teams?: UserDetailsTeam[];\n group?: string;\n clearanceLevel?: number | string;\n region?: string;\n};\n\nexport type UserAvatarProps = {\n firstName?: string;\n lastName?: string;\n email?: string;\n enablePopper?: boolean;\n profilePic?: string;\n size?: UserAvatarSize;\n hoverSize?: UserAvatarSize;\n containerClassName?: string;\n className?: string;\n userId?: string;\n lastViewedOn?: string;\n isActive?: boolean;\n statusIndicator?: boolean;\n /** User details to display in the popper - replaces the useTeamMemberFilter hook */\n userDetails?: UserDetails | null;\n /** Whether user details are being fetched */\n isFetchingUserDetails?: boolean;\n /** Optional token for authenticated image loading */\n authToken?: string;\n /** Callback triggered when mouse enters the avatar */\n onHover?: () => void;\n /** Name of the clause / line item the user is currently editing. When set, a highlighted \"Currently editing\" card is shown in the popper. */\n currentlyEditing?: string;\n};\n\nconst InfoRow = ({ label, content }: { label: string; content: React.ReactNode }) => (\n <div className='flex justify-between items-center'>\n <Typography size='small' variant='medium' className='mr-5' appearance='body'>\n {label}\n </Typography>\n {content}\n </div>\n);\n\n/**\n * UserAvatar component for displaying user profile pictures with hover popper\n *\n * @example\n * ```tsx\n * <UserAvatar\n * firstName=\"John\"\n * lastName=\"Doe\"\n * email=\"john@example.com\"\n * profilePic=\"/avatar.jpg\"\n * userDetails={{ teams: [{ name: 'Engineering', color: '#0066cc' }], group: 'Admin' }}\n * />\n * ```\n */\nexport const UserAvatar: FC<UserAvatarProps> = ({\n firstName,\n lastName,\n email,\n profilePic,\n size = 'md',\n hoverSize = 'lg',\n containerClassName = '',\n enablePopper = true,\n className,\n userId,\n lastViewedOn,\n isActive,\n statusIndicator = false,\n userDetails,\n isFetchingUserDetails = false,\n authToken,\n onHover,\n currentlyEditing,\n}) => {\n // if (firstName === 'All' && lastName === 'Users') {\n // return (\n // <div className='p-1 rounded-full bg-primary-100 dark:bg-black-600 flex items-center justify-center'>\n // <GroupsIcon className='text-primary-600 dark:text-primary-600 w-xs h-xs' />\n // </div>\n // );\n // }\n\n const [visible, setVisible] = useState<boolean>(false);\n const [imageLoaded, setImageLoaded] = useState<boolean>(false);\n\n const avatarSizeClass = sizeClasses[size];\n\n const {\n triggerRef: moreTagRef,\n dropdownRef,\n position: dropdownPosition,\n isVisible: showMore,\n show: handleShowMore,\n hide: handleHideMore,\n } = useDynamicPosition();\n\n const imageCacheRef = useRef<{ [key: string]: string }>({});\n\n const isRecent = useMemo(() => {\n if (isActive || !lastViewedOn) return false;\n const date = new Date(lastViewedOn);\n const now = new Date();\n const diffInHours = (now.getTime() - date.getTime()) / (1000 * 60 * 60);\n return diffInHours < 24;\n }, [isActive, lastViewedOn]);\n\n const getStatusColor = () => {\n if (isActive) return 'bg-primary-600 dark:bg-primary-600';\n if (isRecent) return 'bg-primary-300 dark:bg-primary-300';\n if (lastViewedOn) return 'bg-neutral-400 dark:bg-neutral-400';\n return null;\n };\n\n const statusColor = getStatusColor();\n\n const getBorderColor = () => {\n if (isActive) return 'border-primary-600 dark:border-primary-600';\n if (isRecent) return 'border-primary-300 dark:border-primary-300';\n if (lastViewedOn) return 'border-neutral-400 dark:border-neutral-400';\n return 'border-primary-200 dark:border-neutral-800';\n };\n\n const borderColor = getBorderColor();\n\n const indicatorSizes = {\n '2xs': 'w-1.5 h-1.5',\n xs: 'w-2 h-2',\n sm: 'w-2.5 h-2.5',\n md: 'w-3 h-3',\n lg: 'w-3.5 h-3.5',\n xl: 'w-4 h-4',\n };\n\n useEffect(() => {\n if (profilePic) {\n if (imageCacheRef.current[profilePic]) {\n setImageLoaded(true);\n } else {\n setImageLoaded(false);\n const img = new Image();\n const token = authToken || (typeof localStorage !== 'undefined' ? localStorage.getItem('token') : null);\n img.src = profilePic + (token ? '?token=' + token : '');\n img.onload = () => {\n imageCacheRef.current[profilePic] = img.src;\n setImageLoaded(true);\n };\n img.onerror = () => {\n setImageLoaded(false);\n };\n }\n } else {\n setImageLoaded(false);\n }\n }, [profilePic, authToken]);\n\n useEffect(() => {\n return () => {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n }\n };\n }, []);\n\n const cachedSrc = profilePic ? imageCacheRef.current[profilePic] : undefined;\n\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const popperRef = useRef<HTMLDivElement | null>(null);\n\n const handleMouseEnter = () => {\n onHover?.();\n if (firstName && lastName && enablePopper) {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n }\n timerRef.current = setTimeout(() => {\n setVisible(true);\n }, 300);\n }\n };\n\n const handleMouseLeave = (event: React.MouseEvent) => {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n }\n timerRef.current = setTimeout(() => {\n if (popperRef.current && !popperRef.current.contains(event.relatedTarget as Node)) {\n setVisible(false);\n }\n }, 200);\n };\n\n const popperContent = (\n <div\n ref={popperRef}\n className='bg-white dark:bg-black-800 shadow rounded-lg border border-neutral-200 dark:border-black-700 min-w-[280px]'\n onMouseEnter={() => {\n if (timerRef.current) {\n clearTimeout(timerRef.current);\n }\n }}\n onMouseLeave={(event) => handleMouseLeave(event)}\n >\n <div className='flex flex-col gap-1 items-center p-5'>\n <div className={cn('relative', sizeClasses[hoverSize])}>\n {cachedSrc && imageLoaded ? (\n <img\n src={cachedSrc}\n alt='Profile'\n className={cn('rounded-full border-2 object-cover w-full h-full', borderColor)}\n onError={() => setImageLoaded(false)}\n />\n ) : (\n <div\n className={cn(\n 'bg-primary-100 dark:bg-primary-950 border-2 flex items-center justify-center rounded-full w-full h-full',\n borderColor,\n )}\n >\n <Typography\n size='extra-small'\n variant='semibold'\n appearance='custom'\n className={cn('text-primary-600', initialsFontSizeClasses[hoverSize])}\n >\n {getInitials((firstName || '') + ' ' + (lastName || ''))}\n </Typography>\n </div>\n )}\n\n {statusColor && (\n <div\n className={cn(\n 'absolute bottom-0 right-0 rounded-full border-2 border-white dark:border-black-800',\n indicatorSizes[hoverSize],\n statusColor,\n )}\n />\n )}\n </div>\n <div className='flex flex-row gap-1 items-center justify-center'>\n <Typography size='medium' variant='semibold' className='w-full text-center'>\n {firstName || ''} {lastName || ''}\n </Typography>\n {userDetails?.region && <span>{getFlagComponentRectangleMd(userDetails?.region)}</span>}\n </div>\n\n <Typography size='small' variant='medium' appearance='body'>\n {email || userDetails?.email || ''}\n </Typography>\n </div>\n\n {currentlyEditing ? (\n <div className='px-5 pb-3'>\n <div className='flex items-center gap-3 rounded-lg border border-primary-100 dark:border-primary-900 bg-[rgba(230,241,252,0.60)] dark:bg-primary-950/40 px-[13px] py-[7px]'>\n <div className='flex items-center justify-center shrink-0 w-7 h-7 rounded-[5px] border-[0.4px] border-primary-100 dark:border-primary-900 bg-primary-50 dark:bg-primary-950'>\n <EditOutlinedIcon sx={{ width: 13, height: 13 }} className='text-primary-600 dark:text-primary-500' />\n </div>\n <div className='flex flex-col min-w-0'>\n <Typography\n size='extra-small'\n variant='semibold'\n appearance='custom'\n className='text-2xs leading-4 uppercase tracking-[0.2px] text-primary-600 dark:text-primary-500'\n >\n Currently editing\n </Typography>\n <Typography size='extra-small' variant='semibold' className='truncate'>\n {currentlyEditing}\n </Typography>\n </div>\n </div>\n </div>\n ) : null}\n\n {userId &&\n (isFetchingUserDetails ? (\n <div className='p-5'>\n <Skeleton />\n </div>\n ) : userId && (userDetails?.teams || userDetails?.clearanceLevel || userDetails?.group) ? (\n <div className='flex flex-col gap-4 bg-neutral-50 border-t border-neutral-200 dark:bg-black-700 dark:border-none p-5 rounded-b-lg'>\n <StatusInfoRow isActive={isActive} lastViewedOn={lastViewedOn} />\n {userDetails.username && (\n <InfoRow\n label='Username'\n content={\n <div className='flex gap-2'>\n <Typography size='small' variant='medium' appearance='body'>\n {userDetails.username}\n </Typography>\n </div>\n }\n />\n )}\n\n {userDetails?.teams && userDetails?.teams?.length > 0 && (\n <InfoRow\n label='Team'\n content={\n <div className='flex gap-2'>\n {userDetails?.teams?.length > 0 && (\n <Tag\n key={userDetails?.teams[0]?.id}\n label={userDetails?.teams[0]?.name}\n color={userDetails?.teams[0]?.color || '#e38715'}\n size='md'\n isHashColor\n />\n )}\n {userDetails?.teams?.length >= 2 && (\n <div\n ref={moreTagRef}\n className='relative cursor-pointer'\n onMouseEnter={handleShowMore}\n onMouseLeave={handleHideMore}\n onClick={(e) => e.stopPropagation()}\n >\n <Tag key={1} label={`+ ${userDetails?.teams?.length - 1} More`} color='#004f08' size='md' isHashColor />\n\n {showMore && (\n <div\n ref={dropdownRef}\n className={cn(\n 'absolute w-max bg-white dark:text-black-200 dark:bg-black-800 shadow-md border border-neutral-200 dark:border-black-800 rounded-md px-2 z-10 overflow-y-auto max-h-60',\n {\n 'top-full': dropdownPosition.vertical === 'bottom',\n 'bottom-full': dropdownPosition.vertical === 'top',\n 'left-0': dropdownPosition.horizontal === 'left',\n 'right-0': dropdownPosition.horizontal === 'right',\n },\n )}\n onMouseEnter={handleShowMore}\n onMouseLeave={handleHideMore}\n >\n {userDetails?.teams?.slice(1)?.map((team, index) => (\n <div key={team?.id || index} className='my-2'>\n <Tag key={team?.id} label={team?.name} color={team?.color || '#4A5568'} size='md' isHashColor className='w-fit' />\n </div>\n ))}\n </div>\n )}\n </div>\n )}\n </div>\n }\n />\n )}\n\n {userDetails?.group && (\n <InfoRow\n label='Role'\n content={<Tag key={userDetails?.group} label={userDetails?.group} color='#004094' size='md' isHashColor />}\n />\n )}\n\n {userDetails?.clearanceLevel && (\n <InfoRow\n label='Clearance Level'\n content={\n <Tag\n key={String(userDetails?.clearanceLevel)}\n label={`Level ${userDetails?.clearanceLevel}`}\n color='#b30000'\n size='md'\n isHashColor\n />\n }\n />\n )}\n </div>\n ) : (\n <div className='flex items-center justify-center bg-neutral-50 dark:bg-black-700 border-t border-neutral-200 dark:border-black-700 p-5 rounded-b-lg'>\n <Typography className='flex items-center justify-center gap-1' size='extra-small' variant='medium' appearance='body'>\n <WarningRoundedIcon\n sx={{\n height: '16px',\n width: '16px',\n color: '#F04438',\n }}\n />\n No other information found!\n </Typography>\n </div>\n ))}\n </div>\n );\n const containerRef = useRef<HTMLDivElement>(null);\n return (\n <div\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n className={cn('inline-block relative cursor-pointer', className)}\n ref={containerRef}\n >\n <div className={cn('relative', containerClassName || avatarSizeClass)}>\n {cachedSrc && imageLoaded ? (\n <img\n src={cachedSrc}\n alt='Profile'\n className={cn('rounded-full border object-cover w-full h-full', borderColor)}\n onError={() => setImageLoaded(false)}\n />\n ) : firstName === 'All' && lastName === 'Users' ? (\n <div className={cn('rounded-full bg-primary-100 dark:bg-black-600 flex items-center justify-center')}>\n <GroupsIcon className='text-primary-600 dark:text-primary-600 w-md h-md' />\n </div>\n ) :\n firstName && lastName ? (\n <div\n className={cn(\n 'bg-primary-100 flex items-center justify-center rounded-full border dark:bg-black-700',\n sizeClasses[size],\n borderColor,\n )}\n >\n <Typography\n size='extra-small'\n variant='semibold'\n appearance='custom'\n className={cn('text-primary-600', initialsFontSizeClasses[size])}\n >\n {getInitials((firstName || '') + ' ' + (lastName || ''))}\n </Typography>\n </div>\n ) : (\n <div className={cn(borderColor, 'p-1 rounded-full bg-neutral-200 dark:bg-black-600 flex items-center justify-center border w-full h-full')}>\n <PersonIcon fill='#98A2B3' />\n </div>\n )}\n\n {statusIndicator && statusColor && (\n <div\n className={cn(\n 'absolute bottom-0 right-0 rounded-full border border-white dark:border-black-800 w-2 h-2',\n\n statusColor,\n )}\n />\n )}\n </div>\n <UserAvatarPopper\n isOpen={visible}\n onClose={() => setVisible(false)}\n anchorEl={containerRef.current}\n className='bg-white dark:bg-black-700 shadow rounded-lg border border-neutral-200 dark:border-black-600'\n >\n {popperContent}\n </UserAvatarPopper>\n </div>\n );\n};\n\nUserAvatar.displayName = 'UserAvatar';\n\n"],"names":["InfoRow","label","content","jsxs","jsx","Typography","UserAvatar","firstName","lastName","email","profilePic","size","hoverSize","containerClassName","enablePopper","className","userId","lastViewedOn","isActive","statusIndicator","userDetails","isFetchingUserDetails","authToken","onHover","currentlyEditing","visible","setVisible","useState","imageLoaded","setImageLoaded","avatarSizeClass","sizeClasses","moreTagRef","dropdownRef","dropdownPosition","showMore","handleShowMore","handleHideMore","useDynamicPosition","imageCacheRef","useRef","isRecent","useMemo","date","statusColor","borderColor","indicatorSizes","useEffect","img","token","timerRef","cachedSrc","popperRef","handleMouseEnter","handleMouseLeave","event","popperContent","cn","initialsFontSizeClasses","getInitials","getFlagComponentRectangleMd","EditOutlinedIcon","Skeleton","StatusInfoRow","Tag","e","team","index","WarningRoundedIcon","containerRef","GroupsIcon","PersonIcon","UserAvatarPopper"],"mappings":";;;;;;;;;;;;;;;AA2DA,MAAMA,IAAU,CAAC,EAAE,OAAAC,GAAO,SAAAC,QACxB,gBAAAC,EAAC,OAAA,EAAI,WAAU,qCACb,UAAA;AAAA,EAAA,gBAAAC,EAACC,GAAA,EAAW,MAAK,SAAQ,SAAQ,UAAS,WAAU,QAAO,YAAW,QACnE,UAAAJ,EAAA,CACH;AAAA,EACCC;AAAA,GACH,GAiBWI,KAAkC,CAAC;AAAA,EAC9C,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,WAAAC,IAAY;AAAA,EACZ,oBAAAC,IAAqB;AAAA,EACrB,cAAAC,IAAe;AAAA,EACf,WAAAC;AAAA,EACA,QAAAC;AA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GAEJ;AAAA,QACA,gBAAAxC;AAAA,UAACoE;AAAA,UAAA;AAAA,YACC,QAAQ/C;AAAA,YACR,SAAS,MAAMC,EAAW,EAAK;AAAA,YAC/B,UAAU2C,EAAa;AAAA,YACvB,WAAU;AAAA,YAET,UAAAb;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAGN;AAEAlD,GAAW,cAAc;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lax-wp/design-system",
3
3
  "private": false,
4
- "version": "0.13.57",
4
+ "version": "0.13.58",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",
7
7
  "module": "dist/index.es.js",