asma-core-ui 3.0.10 → 3.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/asma-core-ui.es.js +1 -1
- package/package.json +1 -1
package/dist/asma-core-ui.es.js
CHANGED
|
@@ -44,4 +44,4 @@ function Ty(e,t){return"function"==typeof e?e(t):e}function Py(e,t){return n=>{t
|
|
|
44
44
|
*
|
|
45
45
|
* @license MIT
|
|
46
46
|
*/
|
|
47
|
-
function Eb(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 Cb=e=>{var t;const{header:n,enableResizing:o,element:r}=e;let i=n.getSize();if(!o){i&&(i=`${i}px`);const e="actions"===(null==(t=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}(n.headerGroup.headers))?void 0:t.id),o=n.headerGroup.headers[n.headerGroup.headers.length-(e?2:1)];return((null==o?void 0:o.id)===n.id||!i)&&(i="100%"),{width:i||n.column.columnDef.size,maxWidth:i||n.column.columnDef.maxSize,minWidth:i||n.column.columnDef.minSize}}const a=n.column.columnDef.size,l=n.column.columnDef.minSize;return{width:a,maxWidth:n.column.columnDef.maxSize,minWidth:l}};function Ob({styledTableProps:e,header:t}){const{hideHeader:n=!1,enableResizing:r=!1}=e,i=o(null);return $n.jsx("th",{ref:i,colSpan:t.colSpan,className:Kt("t-cell","actions"===t.column.id&&"t-cell__actions"),style:Cb({enableResizing:r,header:t,element:i.current}),children:$n.jsxs("div",{className:Kt("flex items-center justify-left",n?"hide-table-header":"show-table-header",t.column.getCanSort()&&"sortable-column",t.column.columnDef.className),onClick:t.column.getToggleSortingHandler(),children:[Eb(t.column.columnDef.header,t.getContext()),{asc:$n.jsx(jl,{className:"sort-icon"}),desc:$n.jsx(Tl,{className:"sort-icon"})}[t.column.getIsSorted()]??null]})},t.id)}function Sb({table:e,styledTableProps:t}){const{stickyHeader:n=!1,hideHeader:o=!1}=t;return t.loading?null:$n.jsx("thead",{className:Kt("table-header",o&&"hide-table-header"),style:n&&{position:"sticky",top:-.2}||{},children:e.getHeaderGroups().map((e=>$n.jsx("tr",{children:e.headers.map((e=>$n.jsx(Ob,{styledTableProps:t,header:e},e.column.id)))},e.id)))})}const Nb=({colSpan:e})=>$n.jsx($n.Fragment,{children:Array.from({length:5}).map(((t,n)=>$n.jsx("tr",{children:$n.jsx("td",{colSpan:e,children:$n.jsx(ne,{variant:"text",width:"100%",height:50},n)})},n)))});function jb({styledTableProps:e,row:t,index:n}){const{focusable:o,loading:r,getRowClassName:i,rowHeight:a,onRowClick:l,expandArrow:s,tdClassName:u,customSubRowData:c,renderSubRows:d}=e;return $n.jsxs(m,{children:[$n.jsx("tr",{"data-index":n,"data-test":t.id,id:t.id,tabIndex:o?-1:void 0,className:Fn("t-row",r&&"is-loading",(t.getIsExpanded()||t.getIsSelected())&&"selected",null==i?void 0:i(t)),style:{height:a?`${a}px`:"inherit"},onMouseDown:e=>{var n;e.target.classList.contains("MuiModal-backdrop")||"INPUT"===e.target.nodeName||"BUTTON"===e.target.nodeName||(t.getCanExpand()&&!s&&t.getToggleExpandedHandler()(),null==(n=document.getElementById(t.id))||n.focus(),l&&l(e,t))},children:t.getVisibleCells().map((e=>{const n="actions"===e.column.id;return $n.jsx("td",{className:Fn("t-cell",u,n&&"action-cell",n&&(t.getIsExpanded()||t.getIsSelected())&&"selected",n&&(null!=i&&i(t)?null==i?void 0:i(t):"action-cell-default-background")),children:Eb(e.column.columnDef.cell,e.getContext())},e.id)}))}),t.getIsExpanded()&&$n.jsx($n.Fragment,{children:c&&d&&d({rows:c.get(t.original.id.toString())??[],row:t.original})})]},t.id)}function Tb({styledTableProps:e,table:t}){const n=e.hideFooter?t.getCoreRowModel().rows:t.getRowModel().rows;return $n.jsx($n.Fragment,{children:n.map(((t,n)=>$n.jsx(jb,{styledTableProps:e,row:t,index:n},t.id)))})}const Pb=({colSpan:e,noRowsOverlay:t})=>$n.jsx("tr",{className:"no-rows-overlay",children:$n.jsx("td",{colSpan:e,children:t})});function Mb({table:e,styledTableProps:t}){const{columns:n,data:o,loading:r,noRowsOverlay:i}=t;return $n.jsxs("tbody",{className:"tbody",children:[o.length>0&&r&&$n.jsx(Nl,{className:"loading-icon",width:50,height:50}),0===o.length&&r?$n.jsx(Nb,{colSpan:n.length}):o.length>0?$n.jsx(Tb,{table:e,styledTableProps:t}):$n.jsx(Pb,{colSpan:n.length,noRowsOverlay:i})]})}const Ab=e=>$n.jsx(F,{...e}),Rb=()=>{const[e,t]=f(null),n=!!e,o=r((e=>{t(e.currentTarget)}),[]);return{open:n,handleClose:r((()=>{t(null)}),[]),handleOpen:o,anchorEl:e}};function Db({table:e,locale:t}){const{anchorEl:n,open:r,handleClose:i,handleOpen:a}=Rb(),l=o(null),s="no"===t,u=()=>{var e,t,n,o;null==(o=null==(n=null==(t=null==(e=null==l?void 0:l.current)?void 0:e.closest(".asma-core-ui-styled-table"))?void 0:t.querySelectorAll('[data-index="0"]'))?void 0:n[0])||o.scrollIntoView({block:"center",inline:"start"})},c=e.getPageCount(),d=e.getState().pagination.pageIndex+1,f=Array.from({length:c},((e,t)=>t+1));return c>1?$n.jsxs("div",{ref:l,className:"table-pagination",children:[$n.jsx(gi,{title:s?"Nåværende side":"Current Page",children:$n.jsx("div",{children:$n.jsxs(vs,{variant:"outlined",dataTest:"list-pages",style:{width:"134px"},onClick:e=>{a(e)},endIcon:r?$n.jsx(Dl,{height:24,width:24}):$n.jsx(Rl,{height:24,width:24}),children:[s?"Side":"Page"," ",d," ",s?"av":"of"," ",c]})})}),$n.jsx(Ab,{open:r,anchorEl:n,onClose:i,anchorOrigin:{vertical:-5,horizontal:"center"},transformOrigin:{vertical:"bottom",horizontal:"center"},children:$n.jsx("div",{className:"table-pagination__pages-list",children:f.map((t=>$n.jsxs("div",{className:Fn("table-pagination__pages-list__page",d===t&&"page-selected"),onClick:()=>{e.setPageIndex(t-1),i(),u()},children:[d===t&&$n.jsx(Ll,{className:"check-icon",height:24,width:24}),$n.jsxs("span",{children:[s?"Side":"Page"," ",t]})]},t)))})}),$n.jsx(gi,{title:1===d?"":s?"Forrige side":"Previous Page",children:$n.jsx("div",{children:$n.jsx(vs,{variant:"outlined",dataTest:"pagination-ChevronLeftIcon",startIcon:$n.jsx(el,{height:24,width:24}),onClick:()=>{e.previousPage(),u()},disabled:!e.getCanPreviousPage()})})}),$n.jsx(gi,{title:d===c?"":s?"Neste side":"Next Page",children:$n.jsx("div",{children:$n.jsx(vs,{variant:"outlined",dataTest:"pagination-ChevronRightIcon",startIcon:$n.jsx(Ja,{height:24,width:24}),onClick:()=>{e.nextPage(),u()},disabled:!e.getCanNextPage()})})})]}):null}function Ib({table:e,styledTableProps:t}){var n;return t.hideFooter?null:$n.jsxs("div",{className:"table-footer",children:[null==(n=t.footer)?void 0:n.call(t,e),$n.jsx(Db,{table:e,locale:t.locale||"en"})]})}const Lb=t=>{const{columns:n,data:o,initialState:r,pageSize:i,enableRowSelection:a,tableInstanceRef:l,...s}=t,u=function(t){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[o]=e.useState((()=>({current:bb(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}({columns:n,data:o,initialState:{pagination:{pageIndex:0,pageSize:i||50},columnVisibility:{...null==r?void 0:r.columnVisibility,[Sy]:!1},...r},enableRowSelection:a,getCoreRowModel:e=>Ay((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(t,r,i){void 0===r&&(r=0);const a=[];for(let s=0;s<t.length;s++){const u=wb(e,e._getRowId(t[s],s,i),t[s],s,r,void 0,null==i?void 0:i.id);var l;n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),e.options.getSubRows&&(u.originalSubRows=e.options.getSubRows(t[s],s),null!=(l=u.originalSubRows)&&l.length&&(u.subRows=o(u.originalSubRows,r+1,u)))}return a};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=>Ay((()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows]),((e,t,n)=>t.rows.length&&(!0===e||Object.keys(e??{}).length)&&n?kb(t):t),{key:"development"===process.env.NODE_ENV&&"getExpandedRowModel",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable}}),getFilteredRowModel:e=>Ay((()=>[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 a=n.map((e=>e.id)),l=e.getGlobalFilterFn(),s=e.getAllLeafColumns().filter((e=>e.getCanGlobalFilter()));let u,c;o&&l&&s.length&&(a.push("__global__"),s.forEach((e=>{var t;i.push({id:e.id,filterFn:l,resolvedValue:null!=(t=null==l.resolveFilterValue?void 0:l.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 _b(t.rows,(e=>{for(let t=0;t<a.length;t++)if(!1===e.columnFilters[a[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=>Ay((()=>[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()})),a={};i.forEach((t=>{const n=e.getColumn(t.id);n&&(a[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})}));const l=e=>{const t=[...e];return t.sort(((e,t)=>{for(let o=0;o<i.length;o+=1){var n;const r=i[o],l=a[r.id],s=null!=(n=null==r?void 0:r.desc)&&n;let u=0;if(l.sortUndefined){const n=void 0===e.getValue(r.id),o=void 0===t.getValue(r.id);(n||o)&&(u=n&&o?0:n?l.sortUndefined:-l.sortUndefined)}if(0===u&&(u=l.sortingFn(e,t,r.id)),0!==u)return s&&(u*=-1),l.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=l(e.subRows))})),t};return{rows:l(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()}}),getPaginationRowModel:e=>Ay((()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded]),((t,n)=>{if(!n.rows.length)return n;const{pageSize:o,pageIndex:r}=t;let{rows:i,flatRows:a,rowsById:l}=n;const s=o*r,u=s+o;let c;i=i.slice(s,u),c=e.options.paginateExpandedRows?{rows:i,flatRows:a,rowsById:l}:kb({rows:i,flatRows:a,rowsById:l}),c.flatRows=[];const d=e=>{c.flatRows.push(e),e.subRows.length&&e.subRows.forEach(d)};return c.rows.forEach(d),c}),{key:"development"===process.env.NODE_ENV&&"getPaginationRowModel",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable}}),getRowId:s.getRowId||((e,t,n)=>n?[n.id,e.id].join("."):e.id.toString()),defaultColumn:t.enableResizing?{size:void 0}:void 0,...s});return l&&(l.current=u),{table:u}};function qb({tableData:e,actions:t}){const{anchorEl:n,open:o,handleClose:r,handleOpen:i}=Rb(),a=t(e.row).filter((e=>!e.hide));return $n.jsx("div",{className:"flex justify-center items-center w-[42px]",children:a.length?$n.jsxs($n.Fragment,{children:[$n.jsx(vs,{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:$n.jsx(Ol,{className:"!text-delta-800",width:20,height:20})}),$n.jsx(Ab,{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,n)=>$n.jsx(by,{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},n)))})]}):null})}function Fb({headerData:e}){const{anchorEl:t,open:n,handleClose:o,handleOpen:r}=Rb();return $n.jsxs("div",{className:"w-full flex items-center justify-end ",children:[$n.jsx("div",{className:"px-2.5 h-[30px] flex items-center justify-center cursor-pointer",onClick:r,children:$n.jsx($a,{icon:"mdi:pin",className:"text-delta-500 hover:text-delta-600 min-w-[20px] min-h-[20px]"})}),$n.jsx(Ab,{anchorEl:t,anchorOrigin:{horizontal:"left",vertical:"bottom"},open:n,onClose:o,children:e.table.getAllLeafColumns().filter((e=>e.getCanHide()&&e.id!==Sy)).map((e=>e.columnDef.header?$n.jsxs(by,{onClick:()=>e.toggleVisibility(!e.getIsVisible()),children:[$n.jsx(vc,{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 zb=e=>{const{columns:t,actions:n,customActionsNode:o,headerPin:r=!0,enableRowSelection:i,expandArrow:a}=e;!t.find((e=>"actions"===e.id))&&(n||o||r)&&t.push(function(e){const{headerPin:t,actions:n,customActionsNode:o}=e;return{id:"actions",enableHiding:!1,enableSorting:!1,accessorFn:e=>e,header:e=>t?$n.jsx(Fb,{headerData:e}):null,cell:e=>n||o?$n.jsxs("div",{className:"flex items-center justify-end",children:[o&&$n.jsx("div",{className:"mr-1",children:null==o?void 0:o(e)}),n&&$n.jsx(qb,{tableData:e,actions:n})]}):null,size:50}}({headerPin:r,actions:n,customActionsNode:o})),i&&!t.find((e=>e.id===Sy))&&t.unshift({id:Sy,minSize:40,maxSize:40,size:40,header:({table:e})=>$n.jsx("div",{className:"w-[25px]",children:$n.jsx(vc,{size:"small",dataTest:"cell-select-all",checked:e.getIsAllRowsSelected(),indeterminate:e.getIsSomeRowsSelected(),onChange:e.getToggleAllRowsSelectedHandler()})}),cell:({cell:e})=>$n.jsx("div",{className:"w-[25px]",children:$n.jsx(vc,{size:"small",dataTest:"cell-select",checked:e.row.getIsSelected(),disabled:!e.row.getCanSelect(),onClick:e=>e.stopPropagation(),onChange:e.row.getToggleSelectedHandler()})})}),a&&!t.find((e=>e.id===Ny))&&t.unshift({id:Ny,minSize:40,maxSize:40,size:40,enableHiding:!1,enableSorting:!1,header:()=>null,cell:({cell:e})=>{const t=e.row.getIsExpanded();return e.row.getCanExpand()?$n.jsx("span",{className:"flex w-fit h-fit px-2 bg-transparent outline-none focus:outline-none items-center justify-center",onClick:()=>e.row.getToggleExpandedHandler()(),children:t?$n.jsx(Dl,{width:24,height:24}):$n.jsx(Rl,{width:24,height:24})}):null}})},Vb=e=>{const{className:t,height:n}=e;zb(e);const{table:o}=Lb(e);return $n.jsxs("div",{className:"asma-core-ui-styled-table",children:[$n.jsx("div",{className:Fn("table-wrapper",t),style:{height:n},children:$n.jsxs("table",{className:"styled-table",children:[$n.jsx(Sb,{table:o,styledTableProps:e}),$n.jsx(Mb,{table:o,styledTableProps:e})]})}),$n.jsx(Ib,{table:o,styledTableProps:e})]})},Bb=function(e){return $n.jsx("div",{className:"styled-widget-title",children:e.children})},Hb=function(e){return $n.jsx("h1",{"data-test":e.dataTest,className:"styled-module-title",children:e.children})},Ub=()=>{const[e,t]=f(null),n=()=>{t((()=>null))};return{anchorEl:e,onClose:n,onAnchorClick:o=>{e?n():(e=>{t((()=>e.currentTarget))})(o)}}},Wb=({filterIsActive:e,popoverContent:t,dataTest:n,disabled:o,size:r="large",variant:i="outlined"})=>{const{onAnchorClick:a,onClose:l,anchorEl:s}=Ub();return $n.jsxs($n.Fragment,{children:[$n.jsxs("div",{className:"w-fit h-fit relative",children:[$n.jsx(vs,{disabled:o,variant:i,startIcon:$n.jsx($l,{width:"large"===r?24:20,height:"large"===r?24:20}),onClick:a,size:r,dataTest:n,children:"Filter"}),e&&$n.jsx("div",{className:Kt("h-2 w-2 bg-gama-400 rounded-full absolute","large"===r?"top-2 right-2":"top-1 right-1")})]}),$n.jsx(Ab,{open:!!s,anchorEl:s,onClose:l,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},className:"my-1",children:t})]})},Gb=({onCloseText:e,onMinimizeText:t,onExpandText:n,showCloseIcon:o=!0,showMinimizeIcon:r=!0,showExpandIcon:i=!0,title:a,label:l,children:s,open:u,onClose:c,className:d="",primaryButtonText:p,secondaryButtonText:h,onPrimaryButtonClick:g,onSecondaryButtonClick:m,dataTest:v})=>{const[y,b]=f(!1),w=()=>{b(!y)};return u?y?$n.jsx("div",{className:"fixed bottom-4 right-4 z-[51] w-[387px] rounded-lg bg-white py-2 pl-4 pr-3 shadow-[0_4px_40px_0px_rgba(34,33,51,0.4)] transition-all duration-300",children:$n.jsxs("div",{className:"flex items-center justify-between","data-test":v,children:[$n.jsx("div",{className:"truncate text-lg font-semibold text-delta-800",children:a}),$n.jsxs("div",{className:"flex gap-x-1",children:[$n.jsx("div",{className:"flex items-center gap-x-2",children:$n.jsx(vs,{dataTest:"minimize-button",variant:"text",size:"small",onClick:w,endIcon:i&&$n.jsx(fs,{height:20,width:20,color:"text-gama-500"}),children:n})}),$n.jsx("div",{className:"flex items-center gap-x-2",children:$n.jsx(vs,{dataTest:"close-button",variant:"textGray",size:"small",onClick:c,endIcon:o&&$n.jsx(Il,{height:20,width:20,color:"text-delta-700"}),children:e})})]})]})}):$n.jsxs("div",{className:Kt("fixed bottom-4 right-4 z-[51] rounded-lg bg-white shadow-[0_4px_40px_0px_rgba(34,33,51,0.4)] transition-all duration-300",d),"data-test":v,children:[$n.jsxs("div",{className:"fixed-top flex flex-col gap-y-2 p-4 border-b-[1px] border-delta-200",children:[$n.jsxs("div",{className:"flex items-center justify-between",children:[l?$n.jsx("div",{className:"text-sm text-delta-700",children:l}):$n.jsx("div",{className:"text-2xl font-semibold text-delta-800",children:a}),$n.jsxs("div",{className:"flex gap-x-1",children:[$n.jsx("div",{className:"flex items-center gap-x-2",children:$n.jsx(vs,{dataTest:"minimize-button",variant:"textGray",size:"small",onClick:w,endIcon:r&&$n.jsx(ds,{height:20,width:20,color:"text-delta-700"}),children:t})}),$n.jsx("div",{className:"flex items-center gap-x-2",children:$n.jsx(vs,{dataTest:"close-button",variant:"textGray",size:"small",onClick:c,endIcon:$n.jsx(Il,{height:20,width:20,color:"text-delta-700"}),children:e})})]})]}),l&&$n.jsx("div",{className:"text-2xl font-semibold text-delta-800",children:a})]}),$n.jsx("div",{children:s}),$n.jsxs("div",{className:"fixed-bottom flex justify-end gap-x-4 border-t-[1px] border-delta-200 p-4",children:[h&&m&&$n.jsx(vs,{dataTest:"cancel-button",variant:"outlined",onClick:m,children:h}),p&&g&&$n.jsx(vs,{dataTest:"save-button",onClick:g,children:p})]})]}):null};export{jy as ACTIONS_COLUMN_ID,Pl as ArchiveIcon,pl as AssignmentIcon,hl as AssignmentOutlineIcon,oe as Avatar,hs as BadgeIcon,Xa as BellIcon,Za as BellOutlineIcon,Ql as CalendarBlankOutlineIcon,dl as CalendarIcon,fl as CalendarRangeIcon,Al as CheckBoxCheckedIcon,cl as CheckFactOutlineIcon,Ll as CheckIcon,ul as CheckOutlineIcon,tl as ChevronDoubleLeftIcon,nl as ChevronDoubleRightIcon,Rl as ChevronDownIcon,el as ChevronLeftIcon,Ja as ChevronRightIcon,Dl as ChevronUpIcon,re as ClickAwayListener,Il as CloseIcon,cs as ConsentsIcon,ie as Container,il as DashboardViewIcon,al as DashboardViewOutlineIcon,Gl as DeleteOutlineIcon,Ol as DotsVerticalIcon,Ml as DownloadIcon,Ul as DragHorizontalIcon,Tl as DropDownIcon,jl as DropUpIcon,Yl as DvrIcon,Ny as EXPAND_COLUMN_ID,is as EarthIcon,gs as EditSquareIcon,Hl as EmptyPageIcon,Zl as ErrorOutlineIcon,ae as Fade,es as FastCheckOutlineIcon,Wl as FilePdfIcon,$l as FilterIcon,_l as FindReplaceIcon,kl as FindReplacePeopleIcon,Qa as HamburgerIcon,zl as InboxOutboxIcon,Vl as InboxOutboxOutlineIcon,fs as KeyboardCapslockIcon,Jl as LinkOutlineIcon,gl as ListNumberedIcon,rs as ListSettingsLineIcon,ns as ListStatusIcon,Nl as LoadingIcon,Kl as LockIcon,ml as MessageProcessingIcon,vl as MessageProcessingOutlineIcon,ps as MessageReplyIcon,Gb as MinimizableDialog,ds as MinimizeIcon,us as OutlineCalendarMonth,le as Paper,rl as PdfIcon,ls as PencilOutlineIcon,sl as PeopleIcon,ll as PeopleOutlineIcon,ql as PermMediaIcon,Fl as PermMediaOutline,El as PersonIcon,Cl as PersonOutlineIcon,se as Popper,ol as QnrIcon,Xl as ReplayIcon,yl as ReportBoxIcon,bl as ReportBoxOutlineIcon,bg as RichInput,Sy as SELECT_COLUMN_ID,Sl as SearchIcon,wl as SettingsIcon,as as SettingsMenuHorizontalIcon,xl as SettingsOutlineIcon,ue as Skeleton,dc as SnackbarProvider,ce as Stack,Ey as StyledAccordion,Oy as StyledAccordionDetails,Cy as StyledAccordionSummary,_s as StyledAlert,ks as StyledAlertTitle,Kn as StyledBadge,vs as StyledButton,vc as StyledCheckbox,Yn as StyledChip,Kv as StyledDatePicker,ys as StyledDialog,bs as StyledDialogActions,ws as StyledDialogContent,xs as StyledDialogTitle,vy as StyledDrawer,Wb as StyledFilterMenu,Fv as StyledFormControl,fy as StyledFormControlLabel,my as StyledFormGroup,py as StyledFormHelperText,hy as StyledFormLabel,yc as StyledInputField,gy as StyledInputLabel,Sg as StyledLabel,xy as StyledLink,yy as StyledMenu,by as StyledMenuItem,wy as StyledMenuList,Hb as StyledModuleTitle,Ab as StyledPopover,Cg as StyledRadio,Og as StyledRadioGroup,wg as StyledSelect,_g as StyledSelectAutocomplete,xg as StyledSelectItem,kg as StyledSlider,fc as StyledSnackbar,Eg as StyledSwitch,_y as StyledTab,Vb as StyledTable,ky as StyledTabs,wc as StyledTextarea,dy as StyledTimePicker,gi as StyledTooltip,ms as StyledTypography,Bb as StyledWidgetTitle,os as TextBoxCheckOutlineIcon,Bl as TopicIcon,ts as UnknownDocumentOutlineRoundedIcon,ss as WarningAmberOutlineIcon,Yu as closeSnackbar,Fn as cn,xb as createColumnHelper,Ku as enqueueSnackbar,mc as message,ge as omit,pc as processAlertSnackBar,hc as processInfoSnackbar,Wt as setMidnightTime,Gt as setZeroTime,sc as useSnackbar};
|
|
47
|
+
function Eb(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 Cb=e=>{var t;const{header:n,enableResizing:o,element:r}=e;let i=n.getSize();if(!o){i&&(i=`${i}px`);const e="actions"===(null==(t=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}(n.headerGroup.headers))?void 0:t.id),o=n.headerGroup.headers[n.headerGroup.headers.length-(e?2:1)];return((null==o?void 0:o.id)===n.id||!i)&&(i="100%"),{width:i||n.column.columnDef.size,maxWidth:i||n.column.columnDef.maxSize,minWidth:i||n.column.columnDef.minSize}}const a=n.column.columnDef.size,l=n.column.columnDef.minSize;return{width:a,maxWidth:n.column.columnDef.maxSize,minWidth:l}};function Ob({styledTableProps:e,header:t}){const{hideHeader:n=!1,enableResizing:r=!1}=e,i=o(null);return $n.jsx("th",{ref:i,colSpan:t.colSpan,className:Kt("t-cell","actions"===t.column.id&&"t-cell__actions"),style:Cb({enableResizing:r,header:t,element:i.current}),children:$n.jsxs("div",{className:Kt("flex items-center justify-left",n?"hide-table-header":"show-table-header",t.column.getCanSort()&&"sortable-column",t.column.columnDef.className),onClick:t.column.getToggleSortingHandler(),children:[Eb(t.column.columnDef.header,t.getContext()),{asc:$n.jsx(jl,{className:"sort-icon"}),desc:$n.jsx(Tl,{className:"sort-icon"})}[t.column.getIsSorted()]??null]})},t.id)}function Sb({table:e,styledTableProps:t}){const{stickyHeader:n=!1,hideHeader:o=!1}=t;return t.loading?null:$n.jsx("thead",{className:Kt("table-header",o&&"hide-table-header"),style:n&&{position:"sticky",top:-.2}||{},children:e.getHeaderGroups().map((e=>$n.jsx("tr",{children:e.headers.map((e=>$n.jsx(Ob,{styledTableProps:t,header:e},e.column.id)))},e.id)))})}const Nb=({colSpan:e})=>$n.jsx($n.Fragment,{children:Array.from({length:5}).map(((t,n)=>$n.jsx("tr",{children:$n.jsx("td",{colSpan:e,children:$n.jsx(ne,{variant:"text",width:"100%",height:50},n)})},n)))});function jb({styledTableProps:e,row:t,index:n}){const{focusable:o,loading:r,getRowClassName:i,rowHeight:a,onRowClick:l,expandArrow:s,tdClassName:u,customSubRowData:c,renderSubRows:d}=e;return $n.jsxs(m,{children:[$n.jsx("tr",{"data-index":n,"data-test":t.id,id:t.id,tabIndex:o?-1:void 0,className:Fn("t-row",r&&"is-loading",(t.getIsExpanded()||t.getIsSelected())&&"selected",null==i?void 0:i(t)),style:{height:a?`${a}px`:"inherit"},onMouseDown:e=>{var n;e.target.classList.contains("MuiModal-backdrop")||"INPUT"===e.target.nodeName||"BUTTON"===e.target.nodeName||(t.getCanExpand()&&!s&&t.getToggleExpandedHandler()(),null==(n=document.getElementById(t.id))||n.focus(),l&&l(e,t))},children:t.getVisibleCells().map((e=>{const n="actions"===e.column.id;return $n.jsx("td",{className:Fn("t-cell",u,n&&"action-cell",n&&(t.getIsExpanded()||t.getIsSelected())&&"selected",n&&(null!=i&&i(t)?null==i?void 0:i(t):"action-cell-default-background")),children:Eb(e.column.columnDef.cell,e.getContext())},e.id)}))}),t.getIsExpanded()&&$n.jsx($n.Fragment,{children:c&&d&&d({rows:c.get(t.original.id.toString())??[],row:t.original})})]},t.id)}function Tb({styledTableProps:e,table:t}){const n=e.hideFooter?t.getCoreRowModel().rows:t.getRowModel().rows;return $n.jsx($n.Fragment,{children:n.map(((t,n)=>$n.jsx(jb,{styledTableProps:e,row:t,index:n},t.id)))})}const Pb=({colSpan:e,noRowsOverlay:t})=>$n.jsx("tr",{className:"no-rows-overlay",children:$n.jsx("td",{colSpan:e,children:t})});function Mb({table:e,styledTableProps:t}){const{columns:n,data:o,loading:r,noRowsOverlay:i}=t;return $n.jsxs("tbody",{className:"tbody",children:[o.length>0&&r&&$n.jsx(Nl,{className:"loading-icon",width:50,height:50}),0===o.length&&r?$n.jsx(Nb,{colSpan:n.length}):o.length>0?$n.jsx(Tb,{table:e,styledTableProps:t}):$n.jsx(Pb,{colSpan:n.length,noRowsOverlay:i})]})}const Ab=e=>$n.jsx(F,{...e}),Rb=()=>{const[e,t]=f(null),n=!!e,o=r((e=>{t(e.currentTarget)}),[]);return{open:n,handleClose:r((()=>{t(null)}),[]),handleOpen:o,anchorEl:e}};function Db({table:e,locale:t}){const{anchorEl:n,open:r,handleClose:i,handleOpen:a}=Rb(),l=o(null),s="no"===t,u=()=>{var e,t,n,o;null==(o=null==(n=null==(t=null==(e=null==l?void 0:l.current)?void 0:e.closest(".asma-core-ui-styled-table"))?void 0:t.querySelectorAll('[data-index="0"]'))?void 0:n[0])||o.scrollIntoView({block:"center",inline:"start"})},c=e.getPageCount(),d=e.getState().pagination.pageIndex+1,f=Array.from({length:c},((e,t)=>t+1));return c>1?$n.jsxs("div",{ref:l,className:"table-pagination",children:[$n.jsx(gi,{title:s?"Nåværende side":"Current Page",children:$n.jsx("div",{children:$n.jsxs(vs,{variant:"outlined",dataTest:"list-pages",style:{width:"134px"},onClick:e=>{a(e)},endIcon:r?$n.jsx(Dl,{height:24,width:24}):$n.jsx(Rl,{height:24,width:24}),children:[s?"Side":"Page"," ",d," ",s?"av":"of"," ",c]})})}),$n.jsx(Ab,{open:r,anchorEl:n,onClose:i,anchorOrigin:{vertical:-5,horizontal:"center"},transformOrigin:{vertical:"bottom",horizontal:"center"},children:$n.jsx("div",{className:"table-pagination__pages-list",children:f.map((t=>$n.jsxs("div",{className:Fn("table-pagination__pages-list__page",d===t&&"page-selected"),onClick:()=>{e.setPageIndex(t-1),i(),u()},children:[d===t&&$n.jsx(Ll,{className:"check-icon",height:24,width:24}),$n.jsxs("span",{children:[s?"Side":"Page"," ",t]})]},t)))})}),$n.jsx(gi,{title:1===d?"":s?"Forrige side":"Previous Page",children:$n.jsx("div",{children:$n.jsx(vs,{variant:"outlined",dataTest:"pagination-ChevronLeftIcon",startIcon:$n.jsx(el,{height:24,width:24}),onClick:()=>{e.previousPage(),u()},disabled:!e.getCanPreviousPage()})})}),$n.jsx(gi,{title:d===c?"":s?"Neste side":"Next Page",children:$n.jsx("div",{children:$n.jsx(vs,{variant:"outlined",dataTest:"pagination-ChevronRightIcon",startIcon:$n.jsx(Ja,{height:24,width:24}),onClick:()=>{e.nextPage(),u()},disabled:!e.getCanNextPage()})})})]}):null}function Ib({table:e,styledTableProps:t}){var n;return t.hideFooter?null:$n.jsxs("div",{className:"table-footer",children:[null==(n=t.footer)?void 0:n.call(t,e),$n.jsx(Db,{table:e,locale:t.locale||"en"})]})}const Lb=t=>{const{columns:n,data:o,initialState:r,pageSize:i,enableRowSelection:a,tableInstanceRef:l,...s}=t,u=function(t){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[o]=e.useState((()=>({current:bb(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}({columns:n,data:o,initialState:{pagination:{pageIndex:0,pageSize:i||50},columnVisibility:{...null==r?void 0:r.columnVisibility,[Sy]:!1},...r},enableRowSelection:a,getCoreRowModel:e=>Ay((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(t,r,i){void 0===r&&(r=0);const a=[];for(let s=0;s<t.length;s++){const u=wb(e,e._getRowId(t[s],s,i),t[s],s,r,void 0,null==i?void 0:i.id);var l;n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),e.options.getSubRows&&(u.originalSubRows=e.options.getSubRows(t[s],s),null!=(l=u.originalSubRows)&&l.length&&(u.subRows=o(u.originalSubRows,r+1,u)))}return a};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=>Ay((()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows]),((e,t,n)=>t.rows.length&&(!0===e||Object.keys(e??{}).length)&&n?kb(t):t),{key:"development"===process.env.NODE_ENV&&"getExpandedRowModel",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable}}),getFilteredRowModel:e=>Ay((()=>[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 a=n.map((e=>e.id)),l=e.getGlobalFilterFn(),s=e.getAllLeafColumns().filter((e=>e.getCanGlobalFilter()));let u,c;o&&l&&s.length&&(a.push("__global__"),s.forEach((e=>{var t;i.push({id:e.id,filterFn:l,resolvedValue:null!=(t=null==l.resolveFilterValue?void 0:l.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 _b(t.rows,(e=>{for(let t=0;t<a.length;t++)if(!1===e.columnFilters[a[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=>Ay((()=>[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()})),a={};i.forEach((t=>{const n=e.getColumn(t.id);n&&(a[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})}));const l=e=>{const t=[...e];return t.sort(((e,t)=>{for(let o=0;o<i.length;o+=1){var n;const r=i[o],l=a[r.id],s=null!=(n=null==r?void 0:r.desc)&&n;let u=0;if(l.sortUndefined){const n=void 0===e.getValue(r.id),o=void 0===t.getValue(r.id);(n||o)&&(u=n&&o?0:n?l.sortUndefined:-l.sortUndefined)}if(0===u&&(u=l.sortingFn(e,t,r.id)),0!==u)return s&&(u*=-1),l.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=l(e.subRows))})),t};return{rows:l(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()}}),getPaginationRowModel:e=>Ay((()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded]),((t,n)=>{if(!n.rows.length)return n;const{pageSize:o,pageIndex:r}=t;let{rows:i,flatRows:a,rowsById:l}=n;const s=o*r,u=s+o;let c;i=i.slice(s,u),c=e.options.paginateExpandedRows?{rows:i,flatRows:a,rowsById:l}:kb({rows:i,flatRows:a,rowsById:l}),c.flatRows=[];const d=e=>{c.flatRows.push(e),e.subRows.length&&e.subRows.forEach(d)};return c.rows.forEach(d),c}),{key:"development"===process.env.NODE_ENV&&"getPaginationRowModel",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable}}),getRowId:s.getRowId||((e,t,n)=>n?[n.id,e.id].join("."):e.id.toString()),defaultColumn:t.enableResizing?{size:void 0}:void 0,...s});return l&&(l.current=u),{table:u}};function qb({tableData:e,actions:t}){const{anchorEl:n,open:o,handleClose:r,handleOpen:i}=Rb(),a=t(e.row).filter((e=>!e.hide));return $n.jsx("div",{className:"flex justify-center items-center w-[42px]",children:a.length?$n.jsxs($n.Fragment,{children:[$n.jsx(vs,{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:$n.jsx(Ol,{className:"!text-delta-800",width:20,height:20})}),$n.jsx(Ab,{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,n)=>$n.jsx(by,{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},n)))})]}):null})}function Fb({headerData:e}){const{anchorEl:t,open:n,handleClose:o,handleOpen:r}=Rb();return $n.jsxs("div",{className:"w-full flex items-center justify-end ",children:[$n.jsx("div",{className:"px-2.5 h-[30px] flex items-center justify-center cursor-pointer",onClick:r,children:$n.jsx($a,{icon:"mdi:pin",className:"text-delta-500 hover:text-delta-600 min-w-[20px] min-h-[20px]"})}),$n.jsx(Ab,{anchorEl:t,anchorOrigin:{horizontal:"left",vertical:"bottom"},open:n,onClose:o,children:e.table.getAllLeafColumns().filter((e=>e.getCanHide()&&e.id!==Sy)).map((e=>e.columnDef.header?$n.jsxs(by,{onClick:()=>e.toggleVisibility(!e.getIsVisible()),children:[$n.jsx(vc,{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 zb=e=>{const{columns:t,actions:n,customActionsNode:o,headerPin:r=!0,enableRowSelection:i,expandArrow:a}=e;!t.find((e=>"actions"===e.id))&&(n||o||r)&&t.push(function(e){const{headerPin:t,actions:n,customActionsNode:o}=e;return{id:"actions",enableHiding:!1,enableSorting:!1,accessorFn:e=>e,header:e=>t?$n.jsx(Fb,{headerData:e}):null,cell:e=>n||o?$n.jsxs("div",{className:"flex items-center justify-end",children:[o&&$n.jsx("div",{className:"mr-1",children:null==o?void 0:o(e)}),n&&$n.jsx(qb,{tableData:e,actions:n})]}):null,size:50}}({headerPin:r,actions:n,customActionsNode:o})),i&&!t.find((e=>e.id===Sy))&&t.unshift({id:Sy,minSize:40,maxSize:40,size:40,header:({table:e})=>$n.jsx("div",{className:"w-[25px]",children:$n.jsx(vc,{size:"small",dataTest:"cell-select-all",checked:e.getIsAllRowsSelected(),indeterminate:e.getIsSomeRowsSelected(),onChange:e.getToggleAllRowsSelectedHandler()})}),cell:({cell:e})=>$n.jsx("div",{className:"w-[25px]",children:$n.jsx(vc,{size:"small",dataTest:"cell-select",checked:e.row.getIsSelected(),disabled:!e.row.getCanSelect(),onClick:e=>e.stopPropagation(),onChange:e.row.getToggleSelectedHandler()})})}),a&&!t.find((e=>e.id===Ny))&&t.unshift({id:Ny,minSize:40,maxSize:40,size:40,enableHiding:!1,enableSorting:!1,header:()=>null,cell:({cell:e})=>{const t=e.row.getIsExpanded();return e.row.getCanExpand()?$n.jsx("span",{className:"flex w-fit h-fit px-2 bg-transparent outline-none focus:outline-none items-center justify-center",onClick:()=>e.row.getToggleExpandedHandler()(),children:t?$n.jsx(Dl,{width:24,height:24}):$n.jsx(Rl,{width:24,height:24})}):null}})},Vb=e=>{const{className:t,height:n}=e;zb(e);const{table:o}=Lb(e);return $n.jsxs("div",{className:"asma-core-ui-styled-table",children:[$n.jsx("div",{className:Fn("table-wrapper",t),style:{height:n},children:$n.jsxs("table",{className:"styled-table",children:[$n.jsx(Sb,{table:o,styledTableProps:e}),$n.jsx(Mb,{table:o,styledTableProps:e})]})}),$n.jsx(Ib,{table:o,styledTableProps:e})]})},Bb=function(e){return $n.jsx("div",{className:"styled-widget-title",children:e.children})},Hb=function(e){return $n.jsx("h1",{"data-test":e.dataTest,className:"styled-module-title",children:e.children})},Ub=()=>{const[e,t]=f(null),n=()=>{t((()=>null))};return{anchorEl:e,onClose:n,onAnchorClick:o=>{e?n():(e=>{t((()=>e.currentTarget))})(o)}}},Wb=({filterIsActive:e,popoverContent:t,dataTest:n,disabled:o,size:r="large",variant:i="outlined"})=>{const{onAnchorClick:a,onClose:l,anchorEl:s}=Ub();return $n.jsxs($n.Fragment,{children:[$n.jsxs("div",{className:"w-fit h-fit relative",children:[$n.jsx(vs,{disabled:o,variant:i,startIcon:$n.jsx($l,{width:"large"===r?24:20,height:"large"===r?24:20}),onClick:a,size:r,dataTest:n,children:"Filter"}),e&&$n.jsx("div",{className:Kt("h-2 w-2 bg-gama-400 rounded-full absolute","large"===r?"top-2 right-2":"top-1 right-1")})]}),$n.jsx(Ab,{open:!!s,anchorEl:s,onClose:l,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},className:"my-1",children:t})]})},Gb=({onCloseText:e,onMinimizeText:t,onExpandText:n,showCloseIcon:o=!0,showMinimizeIcon:r=!0,showExpandIcon:i=!0,title:a,label:l,children:s,open:u,onClose:c,className:d="",primaryButtonText:p,secondaryButtonText:h,onPrimaryButtonClick:g,onSecondaryButtonClick:m,dataTest:v})=>{const[y,b]=f(!1),w=()=>{b(!y)};return u?y?$n.jsx("div",{style:{zIndex:51},className:"fixed bottom-4 right-4 w-[387px] rounded-lg bg-white py-2 pl-4 pr-3 shadow-[0_4px_40px_0px_rgba(34,33,51,0.4)] transition-all duration-300",children:$n.jsxs("div",{className:"flex items-center justify-between","data-test":v,children:[$n.jsx("div",{className:"truncate text-lg font-semibold text-delta-800",children:a}),$n.jsxs("div",{className:"flex gap-x-1",children:[$n.jsx("div",{className:"flex items-center gap-x-2",children:$n.jsx(vs,{dataTest:"minimize-button",variant:"text",size:"small",onClick:w,endIcon:i&&$n.jsx(fs,{height:20,width:20,color:"text-gama-500"}),children:n})}),$n.jsx("div",{className:"flex items-center gap-x-2",children:$n.jsx(vs,{dataTest:"close-button",variant:"textGray",size:"small",onClick:c,endIcon:o&&$n.jsx(Il,{height:20,width:20,color:"text-delta-700"}),children:e})})]})]})}):$n.jsxs("div",{className:Kt("fixed bottom-4 right-4 z-[51] rounded-lg bg-white shadow-[0_4px_40px_0px_rgba(34,33,51,0.4)] transition-all duration-300",d),"data-test":v,children:[$n.jsxs("div",{className:"fixed-top flex flex-col gap-y-2 p-4 border-b-[1px] border-delta-200",children:[$n.jsxs("div",{className:"flex items-center justify-between",children:[l?$n.jsx("div",{className:"text-sm text-delta-700",children:l}):$n.jsx("div",{className:"text-2xl font-semibold text-delta-800",children:a}),$n.jsxs("div",{className:"flex gap-x-1",children:[$n.jsx("div",{className:"flex items-center gap-x-2",children:$n.jsx(vs,{dataTest:"minimize-button",variant:"textGray",size:"small",onClick:w,endIcon:r&&$n.jsx(ds,{height:20,width:20,color:"text-delta-700"}),children:t})}),$n.jsx("div",{className:"flex items-center gap-x-2",children:$n.jsx(vs,{dataTest:"close-button",variant:"textGray",size:"small",onClick:c,endIcon:$n.jsx(Il,{height:20,width:20,color:"text-delta-700"}),children:e})})]})]}),l&&$n.jsx("div",{className:"text-2xl font-semibold text-delta-800",children:a})]}),$n.jsx("div",{children:s}),$n.jsxs("div",{className:"fixed-bottom flex justify-end gap-x-4 border-t-[1px] border-delta-200 p-4",children:[h&&m&&$n.jsx(vs,{dataTest:"cancel-button",variant:"outlined",onClick:m,children:h}),p&&g&&$n.jsx(vs,{dataTest:"save-button",onClick:g,children:p})]})]}):null};export{jy as ACTIONS_COLUMN_ID,Pl as ArchiveIcon,pl as AssignmentIcon,hl as AssignmentOutlineIcon,oe as Avatar,hs as BadgeIcon,Xa as BellIcon,Za as BellOutlineIcon,Ql as CalendarBlankOutlineIcon,dl as CalendarIcon,fl as CalendarRangeIcon,Al as CheckBoxCheckedIcon,cl as CheckFactOutlineIcon,Ll as CheckIcon,ul as CheckOutlineIcon,tl as ChevronDoubleLeftIcon,nl as ChevronDoubleRightIcon,Rl as ChevronDownIcon,el as ChevronLeftIcon,Ja as ChevronRightIcon,Dl as ChevronUpIcon,re as ClickAwayListener,Il as CloseIcon,cs as ConsentsIcon,ie as Container,il as DashboardViewIcon,al as DashboardViewOutlineIcon,Gl as DeleteOutlineIcon,Ol as DotsVerticalIcon,Ml as DownloadIcon,Ul as DragHorizontalIcon,Tl as DropDownIcon,jl as DropUpIcon,Yl as DvrIcon,Ny as EXPAND_COLUMN_ID,is as EarthIcon,gs as EditSquareIcon,Hl as EmptyPageIcon,Zl as ErrorOutlineIcon,ae as Fade,es as FastCheckOutlineIcon,Wl as FilePdfIcon,$l as FilterIcon,_l as FindReplaceIcon,kl as FindReplacePeopleIcon,Qa as HamburgerIcon,zl as InboxOutboxIcon,Vl as InboxOutboxOutlineIcon,fs as KeyboardCapslockIcon,Jl as LinkOutlineIcon,gl as ListNumberedIcon,rs as ListSettingsLineIcon,ns as ListStatusIcon,Nl as LoadingIcon,Kl as LockIcon,ml as MessageProcessingIcon,vl as MessageProcessingOutlineIcon,ps as MessageReplyIcon,Gb as MinimizableDialog,ds as MinimizeIcon,us as OutlineCalendarMonth,le as Paper,rl as PdfIcon,ls as PencilOutlineIcon,sl as PeopleIcon,ll as PeopleOutlineIcon,ql as PermMediaIcon,Fl as PermMediaOutline,El as PersonIcon,Cl as PersonOutlineIcon,se as Popper,ol as QnrIcon,Xl as ReplayIcon,yl as ReportBoxIcon,bl as ReportBoxOutlineIcon,bg as RichInput,Sy as SELECT_COLUMN_ID,Sl as SearchIcon,wl as SettingsIcon,as as SettingsMenuHorizontalIcon,xl as SettingsOutlineIcon,ue as Skeleton,dc as SnackbarProvider,ce as Stack,Ey as StyledAccordion,Oy as StyledAccordionDetails,Cy as StyledAccordionSummary,_s as StyledAlert,ks as StyledAlertTitle,Kn as StyledBadge,vs as StyledButton,vc as StyledCheckbox,Yn as StyledChip,Kv as StyledDatePicker,ys as StyledDialog,bs as StyledDialogActions,ws as StyledDialogContent,xs as StyledDialogTitle,vy as StyledDrawer,Wb as StyledFilterMenu,Fv as StyledFormControl,fy as StyledFormControlLabel,my as StyledFormGroup,py as StyledFormHelperText,hy as StyledFormLabel,yc as StyledInputField,gy as StyledInputLabel,Sg as StyledLabel,xy as StyledLink,yy as StyledMenu,by as StyledMenuItem,wy as StyledMenuList,Hb as StyledModuleTitle,Ab as StyledPopover,Cg as StyledRadio,Og as StyledRadioGroup,wg as StyledSelect,_g as StyledSelectAutocomplete,xg as StyledSelectItem,kg as StyledSlider,fc as StyledSnackbar,Eg as StyledSwitch,_y as StyledTab,Vb as StyledTable,ky as StyledTabs,wc as StyledTextarea,dy as StyledTimePicker,gi as StyledTooltip,ms as StyledTypography,Bb as StyledWidgetTitle,os as TextBoxCheckOutlineIcon,Bl as TopicIcon,ts as UnknownDocumentOutlineRoundedIcon,ss as WarningAmberOutlineIcon,Yu as closeSnackbar,Fn as cn,xb as createColumnHelper,Ku as enqueueSnackbar,mc as message,ge as omit,pc as processAlertSnackBar,hc as processInfoSnackbar,Wt as setMidnightTime,Gt as setZeroTime,sc as useSnackbar};
|