asma-core-ui 2.19.39 → 2.19.41

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.
@@ -219,4 +219,4 @@ function(e,t){const n=de(e,t);return"production"!==process.env.NODE_ENV?(...t)=>
219
219
  *
220
220
  * @license MIT
221
221
  */
222
- function FL(t,n){return t?function(e){return function(e){return"function"==typeof e&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}(e)||"function"==typeof e||function(e){return"object"==typeof e&&"symbol"==typeof e.$$typeof&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}(e)}(t)?e.createElement(t,n):t:null}const AL=()=>{const[e,t]=l(null),n=!!e,o=u((e=>{t(e.currentTarget)}),[]);return{open:n,handleClose:u((()=>{t(null)}),[]),handleOpen:o,anchorEl:e}},LL=e=>_e.jsx(O,{...e});function VL({tableData:e,actions:t}){const{anchorEl:n,open:o,handleClose:r,handleOpen:i}=AL();return _e.jsxs("div",{className:"flex justify-center items-center",children:[_e.jsx(dR,{dataTest:"test",variant:"text",size:"small",onClick:e=>{e.stopPropagation(),e.preventDefault(),i(e)},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onMouseUp:e=>{e.stopPropagation(),e.preventDefault()},children:_e.jsx(jl,{className:"!text-delta-800",width:20,height:20})}),_e.jsx(LL,{open:o,anchorEl:n,onClose:r,onClick:r,anchorOrigin:{horizontal:"center",vertical:"bottom"},transformOrigin:{vertical:"top",horizontal:"right"},children:t(e.row).filter((e=>!e.hide)).map((t=>_e.jsx(IA,{className:t.className,disabled:t.disabled,onClick:()=>{var n;null==(n=t.onClick)||n.call(t,e.row)},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onMouseUp:e=>{e.stopPropagation(),e.preventDefault()},children:t.label},t.label)))})]})}function $L({headerData:e}){const{anchorEl:t,open:n,handleClose:o,handleOpen:r}=AL();return _e.jsxs("div",{className:"w-full flex items-center justify-end ",children:[_e.jsx(dR,{dataTest:"data-test-pin",variant:"text",size:"small",onClick:r,children:_e.jsx(tl,{icon:"mdi:pin",className:"text-delta-600 min-w-[20px] min-h-[20px]"})}),_e.jsx(LL,{anchorEl:t,anchorOrigin:{horizontal:"left",vertical:"bottom"},open:n,onClose:o,children:e.table.getAllLeafColumns().filter((e=>e.getCanHide()&&e.id!==qL)).map((e=>e.columnDef.header?_e.jsxs(IA,{onClick:()=>e.toggleVisibility(!e.getIsVisible()),children:[_e.jsx(fN,{size:"small",dataTest:"test",disableRipple:!0,className:"p-0 pr-2",checked:e.getIsVisible()}),"string"==typeof e.columnDef.header?e.columnDef.header:e.id]},e.id):null))})]})}const qL="select",HL=({actions:t,columns:n,data:o,customSubRowData:r,initialState:i,enableRowSelection:l,headerPin:a=!0,loading:s,noRowsOverlay:u,tableInstanceRef:c,className:d,rowHeight:p,tdClassName:f,thClassName:h,getRowClassName:m,onRowClick:g,renderSubRows:v,customActionsNode:y,focusable:w,stickyHeader:x,...C})=>{n.find((e=>"actions"===e.id))||n.push(function(e){const{headerPin:t,actions:n,customActionsNode:o}=e;return{id:"actions",enableHiding:!1,enableSorting:!1,accessorFn:e=>e,header:e=>t?_e.jsx($L,{headerData:e}):null,cell:e=>n?_e.jsxs("div",{className:"flex gap-2 items-center justify-end",children:[null==o?void 0:o(e),_e.jsx(VL,{tableData:e,actions:n})]}):null,size:50}}({headerPin:a,actions:t,customActionsNode:y})),l&&!n.find((e=>e.id===qL))&&n.unshift({id:qL,maxSize:50,header:({table:e})=>_e.jsx(fN,{dataTest:"test",checked:e.getIsAllRowsSelected(),indeterminate:e.getIsSomeRowsSelected(),onChange:e.getToggleAllRowsSelectedHandler()}),cell:({row:e})=>_e.jsx(fN,{dataTest:"test",checked:e.getIsSelected(),disabled:!e.getCanSelect(),indeterminate:e.getIsSomeSelected(),onClick:e=>e.stopPropagation(),onChange:e.getToggleSelectedHandler()})});const O=function(t){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[o]=e.useState((()=>({current:ML(n)}))),[r,i]=e.useState((()=>o.current.initialState));return o.current.setOptions((e=>({...e,...t,state:{...r,...t.state},onStateChange:e=>{i(e),null==t.onStateChange||t.onStateChange(e)}}))),o.current}({...C,columns:n,data:o,initialState:{...i,columnVisibility:{...null==i?void 0:i.columnVisibility,[qL]:!1}},enableRowSelection:l,getCoreRowModel:e=>WA((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(t,r,i){void 0===r&&(r=0);const l=[];for(let s=0;s<t.length;s++){const u=IL(e,e._getRowId(t[s],s,i),t[s],s,r,void 0,null==i?void 0:i.id);var a;n.flatRows.push(u),n.rowsById[u.id]=u,l.push(u),e.options.getSubRows&&(u.originalSubRows=e.options.getSubRows(t[s],s),null!=(a=u.originalSubRows)&&a.length&&(u.subRows=o(u.originalSubRows,r+1,u)))}return l};return n.rows=o(t),n}),{key:"development"===process.env.NODE_ENV&&"getRowModel",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}}),getExpandedRowModel:e=>WA((()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows]),((e,t,n)=>t.rows.length&&(!0===e||Object.keys(e??{}).length)&&n?function(e){const t=[],n=e=>{var o;t.push(e),null!=(o=e.subRows)&&o.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}(t):t),{key:"development"===process.env.NODE_ENV&&"getExpandedRowModel",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable}}),getFilteredRowModel:e=>WA((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter]),((t,n,o)=>{if(!t.rows.length||(null==n||!n.length)&&!o){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const r=[],i=[];(n??[]).forEach((t=>{var n;const o=e.getColumn(t.id);if(!o)return;const i=o.getFilterFn();i?r.push({id:t.id,filterFn:i,resolvedValue:null!=(n=null==i.resolveFilterValue?void 0:i.resolveFilterValue(t.value))?n:t.value}):"production"!==process.env.NODE_ENV&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${o.id}.`)}));const l=n.map((e=>e.id)),a=e.getGlobalFilterFn(),s=e.getAllLeafColumns().filter((e=>e.getCanGlobalFilter()));let u,c;o&&a&&s.length&&(l.push("__global__"),s.forEach((e=>{var t;i.push({id:e.id,filterFn:a,resolvedValue:null!=(t=null==a.resolveFilterValue?void 0:a.resolveFilterValue(o))?t:o})})));for(let e=0;e<t.flatRows.length;e++){const n=t.flatRows[e];if(n.columnFilters={},r.length)for(let e=0;e<r.length;e++){u=r[e];const t=u.id;n.columnFilters[t]=u.filterFn(n,t,u.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))}if(i.length){for(let e=0;e<i.length;e++){c=i[e];const t=c.id;if(c.filterFn(n,t,c.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return DL(t.rows,(e=>{for(let t=0;t<l.length;t++)if(!1===e.columnFilters[l[t]])return!1;return!0}),e)}),{key:"development"===process.env.NODE_ENV&&"getFilteredRowModel",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}}),getSortedRowModel:e=>WA((()=>[e.getState().sorting,e.getPreSortedRowModel()]),((t,n)=>{if(!n.rows.length||null==t||!t.length)return n;const o=e.getState().sorting,r=[],i=o.filter((t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()})),l={};i.forEach((t=>{const n=e.getColumn(t.id);n&&(l[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})}));const a=e=>{const t=[...e];return t.sort(((e,t)=>{for(let o=0;o<i.length;o+=1){var n;const r=i[o],a=l[r.id],s=null!=(n=null==r?void 0:r.desc)&&n;let u=0;if(a.sortUndefined){const n=void 0===e.getValue(r.id),o=void 0===t.getValue(r.id);(n||o)&&(u=n&&o?0:n?a.sortUndefined:-a.sortUndefined)}if(0===u&&(u=a.sortingFn(e,t,r.id)),0!==u)return s&&(u*=-1),a.invertSorting&&(u*=-1),u}return e.index-t.index})),t.forEach((e=>{var t;r.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=a(e.subRows))})),t};return{rows:a(n.rows),flatRows:r,rowsById:n.rowsById}}),{key:"development"===process.env.NODE_ENV&&"getSortedRowModel",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}}),getRowId:C.getRowId||((e,t,n)=>n?[n.id,e.id].join("."):e.id.toString())});return c&&(c.current=O),_e.jsxs("table",{className:vo("table box-border border-collapse animate-opacity-appear-3 border-spacing-[1px] max-w-[inherit] mx-auto w-full",d),children:[_e.jsx("thead",{className:"table-header-group bg-[#fcfcfd] border-t-solid border-b-solid border-y-delta-300 border-y cursor-default",style:x&&{position:"sticky",top:-.1}||{},children:0===o.length&&s?_e.jsx("tr",{children:_e.jsx("th",{colSpan:n.length,children:_e.jsx(ne,{variant:"text"})})}):O.getHeaderGroups().map((e=>_e.jsx("tr",{children:e.headers.map((e=>{let t=e.getSize();t&&(t=`min-w-[${t}px] w-[${t}px] max-w-[${t}px]`);const n=e.headerGroup.headers[e.headerGroup.headers.length-2];return((null==n?void 0:n.id)===e.id||!t)&&(t="w-full"),_e.jsx("th",{colSpan:e.colSpan,className:vo(t,e.id.includes("width_stabilizer")?"p-0 m-0":"px-2.5","text-delta-500 text-start text-[10px] font-semibold uppercase justify-start",h),style:{maxWidth:e.column.columnDef.maxSize,minWidth:e.column.columnDef.minSize},children:e.isPlaceholder?null:_e.jsxs("div",{className:vo("flex items-center h-[30px] justify-left",e.column.getCanSort()||"actions"===e.column.id?"cursor-pointer select-none":"",e.column.columnDef.className),onClick:e.column.getToggleSortingHandler(),children:[FL(e.column.columnDef.header,e.getContext()),{asc:_e.jsx(Al,{className:"text-delta-800"}),desc:_e.jsx(Ll,{className:"text-delta-800"})}[e.column.getIsSorted()]??null]})},e.id)}))},e.id)))}),_e.jsxs("tbody",{className:"table-row-group align-middle max-w-[inherit]",children:[o.length>0&&s?_e.jsx(Fl,{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-primary-500 z-10",width:50,height:50}):null,0===o.length&&s?_e.jsx(_e.Fragment,{children:Array.from({length:5}).map(((e,t)=>_e.jsx("tr",{children:_e.jsx("td",{colSpan:n.length,children:_e.jsx(ne,{variant:"text",width:"100%",height:50},t)})},t)))}):o.length>0?O.getRowModel().rows.map((e=>_e.jsxs(b,{children:[_e.jsx("tr",{"data-test":e.id,id:e.id,tabIndex:w?-1:void 0,className:vo("table-row align-middle border-x-0 border-y border-solid border-delta-300 hover:cursor-pointer hover:bg-primary-25 focus:bg-primary-100",(e.getIsExpanded()||e.getIsSelected())&&"bg-primary-50",s&&"opacity-50",null==m?void 0:m(e)),style:{height:p?`${p}px`:"inherit"},onMouseDown:t=>{t.target.classList.contains("MuiModal-backdrop")||"INPUT"===t.target.nodeName||"BUTTON"===t.target.nodeName||(e.getCanExpand()&&e.getToggleExpandedHandler()(),g&&g(t,e))},children:e.getVisibleCells().map((e=>_e.jsx("td",{className:vo("break-words table-cell align-middle text-sm text-delta-900 whitespace-pre-wrap",e.id.includes("width_stabilizer")?"p-0 m-0":"px-2.5",f),children:FL(e.column.columnDef.cell,e.getContext())},e.id)))}),e.getIsExpanded()&&_e.jsx(_e.Fragment,{children:r&&v&&v({rows:r.get(e.original.id.toString())??[],row:e.original})})]},e.id))):_e.jsx("tr",{className:"h-28",children:_e.jsx("td",{colSpan:n.length,className:"text-center align-middle text-sm text-delta-900",children:u})})]})]})},zL="_title_17oo0_1",BL=function(e){return _e.jsx("div",{className:zL,children:e.children})},UL=function(e){return _e.jsx("h1",{"data-test":e.dataTest,className:"font-roboto md:mb-2 mb-5 text-2xl font-bold leading-10 text-[#17232E]",children:e.children})};export{Vl as ArchiveIcon,xl as AssignmentIcon,Cl as AssignmentOutlineIcon,il as BellIcon,rl as BellOutlineIcon,yl as CalendarIcon,wl as CalendarRangeIcon,ql as CheckBoxCheckedIcon,vl as CheckFactOutlineIcon,Ul as CheckIcon,bl as CheckOutlineIcon,ul as ChevronDoubleLeftIcon,cl as ChevronDoubleRightIcon,Hl as ChevronDownIcon,sl as ChevronLeftIcon,al as ChevronRightIcon,zl as ChevronUpIcon,Bl as CloseIcon,fl as DashboardViewIcon,hl as DashboardViewOutlineIcon,ea as DeleteOutlineIcon,jl as DotsVerticalIcon,$l as DownloadIcon,Ql as DragHorizontalIcon,Ll as DropDownIcon,Al as DropUpIcon,Xl as EmptyPageIcon,Jl as FilePdfIcon,Pl as FindReplaceIcon,_l as FindReplacePeopleIcon,yO as GridRow,ll as HamburgerIcon,Kl as InboxOutboxIcon,Yl as InboxOutboxOutlineIcon,Ol as ListNumberedIcon,Fl as LoadingIcon,El as MessageProcessingIcon,Sl as MessageProcessingOutlineIcon,pl as PdfIcon,gl as PeopleIcon,ml as PeopleOutlineIcon,Wl as PermMediaIcon,Gl as PermMediaOutline,Ml as PersonIcon,Il as PersonOutlineIcon,dl as QnrIcon,kl as ReportBoxIcon,Rl as ReportBoxOutlineIcon,gj as RichInput,qL as SELECT_COLUMN_ID,Dl as SearchIcon,Tl as SettingsIcon,Nl as SettingsOutlineIcon,iN as SnackbarProvider,$A as StyledAccordion,HA as StyledAccordionDetails,qA as StyledAccordionSummary,gR as StyledAlert,bR as StyledAlertTitle,Me as StyledBadge,dR as StyledButton,fN as StyledCheckbox,Ie as StyledChip,VA as StyledContainer,sR as StyledDataGrid,EA as StyledDatePicker,pR as StyledDialog,fR as StyledDialogActions,hR as StyledDialogContent,mR as StyledDialogTitle,_A as StyledDrawer,SA as StyledFormControl,kA as StyledFormControlLabel,Kk as StyledFormGroup,RA as StyledFormHelperText,TA as StyledFormLabel,uR as StyledGridActionsCellItem,mN as StyledInput,gN as StyledInputField,NA as StyledInputLabel,FA as StyledLink,MA as StyledMenu,IA as StyledMenuItem,jA as StyledMenuList,UL as StyledModuleTitle,LL as StyledPopover,Cj as StyledRadio,Oj as StyledRadioGroup,bj as StyledSelect,yj as StyledSelectAutocomplete,vj as StyledSelectItem,wj as StyledSlider,lN as StyledSnackbar,PA as StyledStack,xj as StyledSwitch,AA as StyledTab,HL as StyledTable,LA as StyledTabs,vN as StyledTextarea,Cr as StyledTooltip,ta as StyledTypography,BL as StyledWidgetTitle,Zl as TopicIcon,zT as closeSnackbar,jL as createColumnHelper,ge as customPalettes,HT as enqueueSnackbar,lg as gridDateComparator,pe as omit,fe as pick,aN as processAlertSnackBar,sN as processInfoSnackbar,Oe as theme,he as tokenOptimizer,oN as useSnackbar};
222
+ function FL(t,n){return t?function(e){return function(e){return"function"==typeof e&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}(e)||"function"==typeof e||function(e){return"object"==typeof e&&"symbol"==typeof e.$$typeof&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}(e)}(t)?e.createElement(t,n):t:null}const AL=()=>{const[e,t]=l(null),n=!!e,o=u((e=>{t(e.currentTarget)}),[]);return{open:n,handleClose:u((()=>{t(null)}),[]),handleOpen:o,anchorEl:e}},LL=e=>_e.jsx(O,{...e});function VL({tableData:e,actions:t}){const{anchorEl:n,open:o,handleClose:r,handleOpen:i}=AL();return _e.jsxs("div",{className:"flex justify-center items-center",children:[_e.jsx(dR,{dataTest:"test",variant:"text",size:"small",onClick:e=>{e.stopPropagation(),e.preventDefault(),i(e)},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onMouseUp:e=>{e.stopPropagation(),e.preventDefault()},children:_e.jsx(jl,{className:"!text-delta-800",width:20,height:20})}),_e.jsx(LL,{open:o,anchorEl:n,onClose:r,onClick:r,anchorOrigin:{horizontal:"center",vertical:"bottom"},transformOrigin:{vertical:"top",horizontal:"right"},children:t(e.row).filter((e=>!e.hide)).map((t=>_e.jsx(IA,{className:t.className,disabled:t.disabled,onClick:()=>{var n;null==(n=t.onClick)||n.call(t,e.row)},onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},onMouseUp:e=>{e.stopPropagation(),e.preventDefault()},children:t.label},t.label)))})]})}function $L({headerData:e}){const{anchorEl:t,open:n,handleClose:o,handleOpen:r}=AL();return _e.jsxs("div",{className:"w-full flex items-center justify-end ",children:[_e.jsx(dR,{dataTest:"data-test-pin",variant:"text",size:"small",onClick:r,children:_e.jsx(tl,{icon:"mdi:pin",className:"text-delta-600 min-w-[20px] min-h-[20px]"})}),_e.jsx(LL,{anchorEl:t,anchorOrigin:{horizontal:"left",vertical:"bottom"},open:n,onClose:o,children:e.table.getAllLeafColumns().filter((e=>e.getCanHide()&&e.id!==qL)).map((e=>e.columnDef.header?_e.jsxs(IA,{onClick:()=>e.toggleVisibility(!e.getIsVisible()),children:[_e.jsx(fN,{size:"small",dataTest:"test",disableRipple:!0,className:"p-0 pr-2",checked:e.getIsVisible()}),"string"==typeof e.columnDef.header?e.columnDef.header:e.id]},e.id):null))})]})}const qL="select",HL="expand-column-id",zL=({actions:t,columns:n,data:o,customSubRowData:r,initialState:i,enableRowSelection:l,headerPin:a=!0,loading:s,noRowsOverlay:u,tableInstanceRef:c,className:d,rowHeight:p,tdClassName:f,thClassName:h,getRowClassName:m,onRowClick:g,renderSubRows:v,customActionsNode:y,focusable:w,stickyHeader:x,expandArrow:C,...O})=>{n.find((e=>"actions"===e.id))||n.push(function(e){const{headerPin:t,actions:n,customActionsNode:o}=e;return{id:"actions",enableHiding:!1,enableSorting:!1,accessorFn:e=>e,header:e=>t?_e.jsx($L,{headerData:e}):null,cell:e=>n?_e.jsxs("div",{className:"flex gap-2 items-center justify-end",children:[null==o?void 0:o(e),_e.jsx(VL,{tableData:e,actions:n})]}):null,size:50}}({headerPin:a,actions:t,customActionsNode:y})),C&&!n.find((e=>e.id===HL))&&n.unshift({id:HL,maxSize:50,enableHiding:!1,enableSorting:!1,header:()=>null,cell:({cell:e})=>{const t=e.row.getIsExpanded();return e.row.getCanExpand()?_e.jsx(dR,{dataTest:"data-button-expand",variant:"text","data-test":"expand-arrow-container",onClick:()=>e.row.getToggleExpandedHandler()(),startIcon:t?_e.jsx(zl,{width:24,height:24}):_e.jsx(Hl,{width:24,height:24})}):null}}),l&&!n.find((e=>e.id===qL))&&n.unshift({id:qL,maxSize:50,header:({table:e})=>_e.jsx(fN,{dataTest:"test",checked:e.getIsAllRowsSelected(),indeterminate:e.getIsSomeRowsSelected(),onChange:e.getToggleAllRowsSelectedHandler()}),cell:({row:e})=>_e.jsx(fN,{dataTest:"test",checked:e.getIsSelected(),disabled:!e.getCanSelect(),indeterminate:e.getIsSomeSelected(),onClick:e=>e.stopPropagation(),onChange:e.getToggleSelectedHandler()})});const E=function(t){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[o]=e.useState((()=>({current:ML(n)}))),[r,i]=e.useState((()=>o.current.initialState));return o.current.setOptions((e=>({...e,...t,state:{...r,...t.state},onStateChange:e=>{i(e),null==t.onStateChange||t.onStateChange(e)}}))),o.current}({...O,columns:n,data:o,initialState:{...i,columnVisibility:{...null==i?void 0:i.columnVisibility,[qL]:!1}},enableRowSelection:l,getCoreRowModel:e=>WA((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(t,r,i){void 0===r&&(r=0);const l=[];for(let s=0;s<t.length;s++){const u=IL(e,e._getRowId(t[s],s,i),t[s],s,r,void 0,null==i?void 0:i.id);var a;n.flatRows.push(u),n.rowsById[u.id]=u,l.push(u),e.options.getSubRows&&(u.originalSubRows=e.options.getSubRows(t[s],s),null!=(a=u.originalSubRows)&&a.length&&(u.subRows=o(u.originalSubRows,r+1,u)))}return l};return n.rows=o(t),n}),{key:"development"===process.env.NODE_ENV&&"getRowModel",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}}),getExpandedRowModel:e=>WA((()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows]),((e,t,n)=>t.rows.length&&(!0===e||Object.keys(e??{}).length)&&n?function(e){const t=[],n=e=>{var o;t.push(e),null!=(o=e.subRows)&&o.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}(t):t),{key:"development"===process.env.NODE_ENV&&"getExpandedRowModel",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable}}),getFilteredRowModel:e=>WA((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter]),((t,n,o)=>{if(!t.rows.length||(null==n||!n.length)&&!o){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const r=[],i=[];(n??[]).forEach((t=>{var n;const o=e.getColumn(t.id);if(!o)return;const i=o.getFilterFn();i?r.push({id:t.id,filterFn:i,resolvedValue:null!=(n=null==i.resolveFilterValue?void 0:i.resolveFilterValue(t.value))?n:t.value}):"production"!==process.env.NODE_ENV&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${o.id}.`)}));const l=n.map((e=>e.id)),a=e.getGlobalFilterFn(),s=e.getAllLeafColumns().filter((e=>e.getCanGlobalFilter()));let u,c;o&&a&&s.length&&(l.push("__global__"),s.forEach((e=>{var t;i.push({id:e.id,filterFn:a,resolvedValue:null!=(t=null==a.resolveFilterValue?void 0:a.resolveFilterValue(o))?t:o})})));for(let e=0;e<t.flatRows.length;e++){const n=t.flatRows[e];if(n.columnFilters={},r.length)for(let e=0;e<r.length;e++){u=r[e];const t=u.id;n.columnFilters[t]=u.filterFn(n,t,u.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))}if(i.length){for(let e=0;e<i.length;e++){c=i[e];const t=c.id;if(c.filterFn(n,t,c.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return DL(t.rows,(e=>{for(let t=0;t<l.length;t++)if(!1===e.columnFilters[l[t]])return!1;return!0}),e)}),{key:"development"===process.env.NODE_ENV&&"getFilteredRowModel",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}}),getSortedRowModel:e=>WA((()=>[e.getState().sorting,e.getPreSortedRowModel()]),((t,n)=>{if(!n.rows.length||null==t||!t.length)return n;const o=e.getState().sorting,r=[],i=o.filter((t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()})),l={};i.forEach((t=>{const n=e.getColumn(t.id);n&&(l[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})}));const a=e=>{const t=[...e];return t.sort(((e,t)=>{for(let o=0;o<i.length;o+=1){var n;const r=i[o],a=l[r.id],s=null!=(n=null==r?void 0:r.desc)&&n;let u=0;if(a.sortUndefined){const n=void 0===e.getValue(r.id),o=void 0===t.getValue(r.id);(n||o)&&(u=n&&o?0:n?a.sortUndefined:-a.sortUndefined)}if(0===u&&(u=a.sortingFn(e,t,r.id)),0!==u)return s&&(u*=-1),a.invertSorting&&(u*=-1),u}return e.index-t.index})),t.forEach((e=>{var t;r.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=a(e.subRows))})),t};return{rows:a(n.rows),flatRows:r,rowsById:n.rowsById}}),{key:"development"===process.env.NODE_ENV&&"getSortedRowModel",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}}),getRowId:O.getRowId||((e,t,n)=>n?[n.id,e.id].join("."):e.id.toString())});return c&&(c.current=E),_e.jsxs("table",{className:vo("table box-border border-collapse animate-opacity-appear-3 border-spacing-[1px] max-w-[inherit] mx-auto w-full",d),children:[_e.jsx("thead",{className:"table-header-group bg-[#fcfcfd] border-t-solid border-b-solid border-y-delta-300 border-y cursor-default",style:x&&{position:"sticky",top:-.1}||{},children:0===o.length&&s?_e.jsx("tr",{children:_e.jsx("th",{colSpan:n.length,children:_e.jsx(ne,{variant:"text"})})}):E.getHeaderGroups().map((e=>_e.jsx("tr",{children:e.headers.map((e=>{let t=e.getSize();t&&(t=`min-w-[${t}px] w-[${t}px] max-w-[${t}px]`);const n=e.headerGroup.headers[e.headerGroup.headers.length-2];return((null==n?void 0:n.id)===e.id||!t)&&(t="w-full"),_e.jsx("th",{colSpan:e.colSpan,className:vo(t,e.id.includes("width_stabilizer")?"p-0 m-0":"px-2.5","text-delta-500 text-start text-[10px] font-semibold uppercase justify-start",h),style:{maxWidth:e.column.columnDef.maxSize,minWidth:e.column.columnDef.minSize},children:e.isPlaceholder?null:_e.jsxs("div",{className:vo("flex items-center h-[30px] justify-left",e.column.getCanSort()||"actions"===e.column.id?"cursor-pointer select-none":"",e.column.columnDef.className),onClick:e.column.getToggleSortingHandler(),children:[FL(e.column.columnDef.header,e.getContext()),{asc:_e.jsx(Al,{className:"text-delta-800"}),desc:_e.jsx(Ll,{className:"text-delta-800"})}[e.column.getIsSorted()]??null]})},e.id)}))},e.id)))}),_e.jsxs("tbody",{className:"table-row-group align-middle max-w-[inherit]",children:[o.length>0&&s?_e.jsx(Fl,{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-primary-500 z-10",width:50,height:50}):null,0===o.length&&s?_e.jsx(_e.Fragment,{children:Array.from({length:5}).map(((e,t)=>_e.jsx("tr",{children:_e.jsx("td",{colSpan:n.length,children:_e.jsx(ne,{variant:"text",width:"100%",height:50},t)})},t)))}):o.length>0?E.getRowModel().rows.map((e=>_e.jsxs(b,{children:[_e.jsx("tr",{"data-test":e.id,id:e.id,tabIndex:w?-1:void 0,className:vo("table-row align-middle border-x-0 border-y border-solid border-delta-300 hover:cursor-pointer hover:bg-primary-25 focus:bg-primary-100",(e.getIsExpanded()||e.getIsSelected())&&"bg-primary-50",s&&"opacity-50",null==m?void 0:m(e)),style:{height:p?`${p}px`:"inherit"},onMouseDown:t=>{t.target.classList.contains("MuiModal-backdrop")||"INPUT"===t.target.nodeName||"BUTTON"===t.target.nodeName||(e.getCanExpand()&&!C&&e.getToggleExpandedHandler()(),g&&g(t,e))},children:e.getVisibleCells().map((e=>_e.jsx("td",{className:vo("break-words table-cell align-middle text-sm text-delta-900 whitespace-pre-wrap",e.id.includes("width_stabilizer")?"p-0 m-0":"px-2.5",f),children:FL(e.column.columnDef.cell,e.getContext())},e.id)))}),e.getIsExpanded()&&_e.jsx(_e.Fragment,{children:r&&v&&v({rows:r.get(e.original.id.toString())??[],row:e.original})})]},e.id))):_e.jsx("tr",{className:"h-28",children:_e.jsx("td",{colSpan:n.length,className:"text-center align-middle text-sm text-delta-900",children:u})})]})]})},BL="_title_17oo0_1",UL=function(e){return _e.jsx("div",{className:BL,children:e.children})},WL=function(e){return _e.jsx("h1",{"data-test":e.dataTest,className:"font-roboto md:mb-2 mb-5 text-2xl font-bold leading-10 text-[#17232E]",children:e.children})};export{Vl as ArchiveIcon,xl as AssignmentIcon,Cl as AssignmentOutlineIcon,il as BellIcon,rl as BellOutlineIcon,yl as CalendarIcon,wl as CalendarRangeIcon,ql as CheckBoxCheckedIcon,vl as CheckFactOutlineIcon,Ul as CheckIcon,bl as CheckOutlineIcon,ul as ChevronDoubleLeftIcon,cl as ChevronDoubleRightIcon,Hl as ChevronDownIcon,sl as ChevronLeftIcon,al as ChevronRightIcon,zl as ChevronUpIcon,Bl as CloseIcon,fl as DashboardViewIcon,hl as DashboardViewOutlineIcon,ea as DeleteOutlineIcon,jl as DotsVerticalIcon,$l as DownloadIcon,Ql as DragHorizontalIcon,Ll as DropDownIcon,Al as DropUpIcon,HL as EXPAND_COLUMN_ID,Xl as EmptyPageIcon,Jl as FilePdfIcon,Pl as FindReplaceIcon,_l as FindReplacePeopleIcon,yO as GridRow,ll as HamburgerIcon,Kl as InboxOutboxIcon,Yl as InboxOutboxOutlineIcon,Ol as ListNumberedIcon,Fl as LoadingIcon,El as MessageProcessingIcon,Sl as MessageProcessingOutlineIcon,pl as PdfIcon,gl as PeopleIcon,ml as PeopleOutlineIcon,Wl as PermMediaIcon,Gl as PermMediaOutline,Ml as PersonIcon,Il as PersonOutlineIcon,dl as QnrIcon,kl as ReportBoxIcon,Rl as ReportBoxOutlineIcon,gj as RichInput,qL as SELECT_COLUMN_ID,Dl as SearchIcon,Tl as SettingsIcon,Nl as SettingsOutlineIcon,iN as SnackbarProvider,$A as StyledAccordion,HA as StyledAccordionDetails,qA as StyledAccordionSummary,gR as StyledAlert,bR as StyledAlertTitle,Me as StyledBadge,dR as StyledButton,fN as StyledCheckbox,Ie as StyledChip,VA as StyledContainer,sR as StyledDataGrid,EA as StyledDatePicker,pR as StyledDialog,fR as StyledDialogActions,hR as StyledDialogContent,mR as StyledDialogTitle,_A as StyledDrawer,SA as StyledFormControl,kA as StyledFormControlLabel,Kk as StyledFormGroup,RA as StyledFormHelperText,TA as StyledFormLabel,uR as StyledGridActionsCellItem,mN as StyledInput,gN as StyledInputField,NA as StyledInputLabel,FA as StyledLink,MA as StyledMenu,IA as StyledMenuItem,jA as StyledMenuList,WL as StyledModuleTitle,LL as StyledPopover,Cj as StyledRadio,Oj as StyledRadioGroup,bj as StyledSelect,yj as StyledSelectAutocomplete,vj as StyledSelectItem,wj as StyledSlider,lN as StyledSnackbar,PA as StyledStack,xj as StyledSwitch,AA as StyledTab,zL as StyledTable,LA as StyledTabs,vN as StyledTextarea,Cr as StyledTooltip,ta as StyledTypography,UL as StyledWidgetTitle,Zl as TopicIcon,zT as closeSnackbar,jL as createColumnHelper,ge as customPalettes,HT as enqueueSnackbar,lg as gridDateComparator,pe as omit,fe as pick,aN as processAlertSnackBar,sN as processInfoSnackbar,Oe as theme,he as tokenOptimizer,oN as useSnackbar};
@@ -1,5 +1,6 @@
1
1
  import type { StyledTableProps } from './types';
2
2
  export declare const SELECT_COLUMN_ID = "select";
3
+ export declare const EXPAND_COLUMN_ID = "expand-column-id";
3
4
  /**
4
5
  *
5
6
  * Custom props:
@@ -7,9 +8,9 @@ export declare const SELECT_COLUMN_ID = "select";
7
8
  *
8
9
  * If you have a very long data, like descriptions. use input to render long strings instead of div. Example is in Storybook.
9
10
  *
10
- * @param focusable: Used for controlling the focusability of rows. If set to true, the tabIndex={0} attribute will be added to each table row. Used, for example, when adding a new item to scroll to it and focus it
11
+ * @param focusable: Used for controlling the focus of rows. If set to true, the tabIndex={0} attribute will be added to each table row. Used, for example, when adding a new item to scroll to it and focus it
11
12
  *
12
13
  */
13
14
  export declare const StyledTable: <TData extends {
14
15
  id: string | number;
15
- }, TCustomData = Record<string, unknown>>({ actions, columns, data, customSubRowData, initialState, enableRowSelection, headerPin, loading, noRowsOverlay, tableInstanceRef, className, rowHeight, tdClassName, thClassName, getRowClassName, onRowClick, renderSubRows, customActionsNode, focusable, stickyHeader, ...rest }: StyledTableProps<TData, TCustomData>) => JSX.Element;
16
+ }, TCustomData = Record<string, unknown>>({ actions, columns, data, customSubRowData, initialState, enableRowSelection, headerPin, loading, noRowsOverlay, tableInstanceRef, className, rowHeight, tdClassName, thClassName, getRowClassName, onRowClick, renderSubRows, customActionsNode, focusable, stickyHeader, expandArrow, ...rest }: StyledTableProps<TData, TCustomData>) => JSX.Element;
@@ -16,6 +16,6 @@ export declare function generateActionsColumn<TData>(options: {
16
16
  enableSorting: boolean;
17
17
  accessorFn: (row: TData) => TData;
18
18
  header: (props: HeaderContext<TData, TData>) => JSX.Element | null;
19
- cell: (row: CellContext<TData, TData>) => JSX.Element | null;
19
+ cell: (cell: CellContext<TData, TData>) => JSX.Element | null;
20
20
  size: number;
21
21
  };
@@ -0,0 +1,9 @@
1
+ import { type CellContext } from '@tanstack/react-table';
2
+ export declare function generateExpandColumn<TData>(): {
3
+ id: string;
4
+ maxSize: number;
5
+ enableHiding: boolean;
6
+ enableSorting: boolean;
7
+ header: () => null;
8
+ cell: ({ cell }: CellContext<TData, TData>) => JSX.Element | null;
9
+ };
@@ -27,6 +27,7 @@ export interface StyledTableProps<TData, TCustomData> extends Omit<TableOptions<
27
27
  customActionsNode?: (row: CellContext<TData, TData>) => ReactNode;
28
28
  customSubRowData?: Map<string, TCustomData[]>;
29
29
  headerPin?: boolean;
30
+ expandArrow?: boolean;
30
31
  loading?: boolean;
31
32
  noRowsOverlay?: ReactElement;
32
33
  tableInstanceRef?: React.MutableRefObject<Table<TData> | null>;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "2.19.39",
6
+ "version": "2.19.41",
7
7
  "type": "module",
8
8
  "files": [
9
9
  "dist/**/*",