@judo/components 0.1.1 → 0.2.0

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
- import{jsxs as e,jsx as r,Fragment as t}from"react/jsx-runtime";import{Dialog as i,DialogTitle as n,DialogContent as o,DialogContentText as l,DialogActions as a,Button as s,createTheme as d,alpha as c,Popper as u,Grow as p,Paper as h,ClickAwayListener as m,MenuList as g,MenuItem as f,TextField as v,InputAdornment as b,Slide as y,Typography as x,Container as C,Box as w,Grid as O,IconButton as k,FormControlLabel as M,Checkbox as P,TablePagination as I,ButtonBase as T,Breadcrumbs as F,ListItem as D,ListItemButton as S,AppBar as A,Toolbar as E,Divider as B}from"@mui/material";import{useRef as q,useEffect as N,useState as W,forwardRef as R,createContext as z,useContext as L,useMemo as _}from"react";import{mdiFormatTextVariant as V,mdiNumeric as j,mdiCalendarClock as H,mdiCalendarMonth as Q}from"@mdi/js";import $ from"@mdi/react";import{KeyboardArrowDown as G,CheckBoxOutlined as Y,Close as J,MoreHoriz as K,Visibility as U,Delete as X,NoteAdd as Z,LinkOff as ee,Home as re}from"@mui/icons-material";import{DateTimePicker as te,DatePicker as ie}from"@mui/x-date-pickers";import{DataGrid as ne,GridToolbarContainer as oe}from"@mui/x-data-grid";import{useSnackbar as le}from"notistack";import{useNavigate as ae,useLocation as se,useResolvedPath as de,useMatch as ce}from"react-router-dom";const ue=({confirmationMessage:t,title:d,resolve:c,open:u,handleClose:p})=>{const h=q(null);N((()=>{if(u){const{current:e}=h;null!==e&&e.focus()}}),[u]);return e(i,{open:u,onClose:p,scroll:"paper",fullWidth:!0,maxWidth:"xs",children:[d&&r(n,{id:"scroll-dialog-title",children:d}),r(o,{dividers:!!d,children:r(l,{id:"scroll-dialog-description",ref:h,tabIndex:-1,children:t})}),e(a,{children:[r(s,{variant:"text",onClick:()=>{p(),c(!1)},children:"No"}),r(s,{variant:"text",onClick:()=>{p(),c(!0)},children:"Yes"})]})]})},pe=new Map([[null,"Unknown"],[!0,"Yes"],[!1,"No"]]);var he;!function(e){e[e.boolean=0]="boolean",e[e.numeric=1]="numeric",e[e.string=2]="string",e[e.enumeration=3]="enumeration",e[e.date=4]="date",e[e.dateTime=5]="dateTime",e[e.trinaryLogic=6]="trinaryLogic"}(he||(he={}));const me=e=>null!=e,ge=(e,r,t)=>{if(me(e[0].location)){if(r("Please make sure all fields are filled in correctly.",{variant:"error",preventDuplicate:!0,persist:!t?.duration,autoHideDuration:t?.duration??void 0}),void 0!==t?.setValidation){let r=new Map;e.forEach((e=>r.set(e.location,e.code))),t?.setValidation(r)}}else r(e[0].code,{variant:"error",preventDuplicate:!0,persist:!t?.duration,autoHideDuration:t?.duration??void 0})},fe=e=>{e("Something went wrong. Please contact with the system admins.",{variant:"error",preventDuplicate:!0,persist:!0})},ve=e=>({message:e.code}),be={marginTop:8,marginBottom:8,display:"flex",flexDirection:"column",alignItems:"center"},ye=d({palette:{mode:"light",primary:{main:"#3C4166FF"},secondary:{main:"#E7501DFF"},text:{primary:"#17191DFF",secondary:"#434448FF"},background:{default:"#FAFAFAFF"},subtitleColor:{main:"#8c8c8c"}},typography:{h5:{fontWeight:500,fontSize:26,letterSpacing:.5}},shape:{borderRadius:8},components:{MuiTab:{defaultProps:{disableRipple:!0}}},mixins:{toolbar:{minHeight:48}}}),xe={...ye,components:{MuiAppBar:{styleOverrides:{colorPrimary:{backgroundColor:ye.palette.background.default}}},MuiButton:{defaultProps:{variant:"contained",size:"small"},styleOverrides:{root:{textTransform:"none",borderRadius:"20px 20px 20px 20px",paddingLeft:15,paddingRight:15},contained:{boxShadow:"none","&:active":{boxShadow:"none"}},outlined:{border:"2px solid",fontWeight:"bold","&:hover":{border:"2px solid",background:c(ye.palette.primary.main,.15)}}}},MuiInputLabel:{styleOverrides:{root:{color:ye.palette.subtitleColor.main,fontWeight:500,fontSize:16,"&.Mui-focused":{color:ye.palette.subtitleColor.main}}}},MuiFilledInput:{styleOverrides:{input:{"&:-webkit-autofill":{WebkitBackgroundClip:"text !important"}},root:{background:"inherit","&.Mui-focused":{background:"inherit"},"&:hover:not(.Mui-disabled):not(.Mui-focused)":{background:c(ye.palette.secondary.main,.1)},"&:hover:not(.Mui-disabled):before":{borderBottom:"none"},"&.Mui-focused .MuiInputAdornment-root .MuiSvgIcon-root":{color:ye.palette.secondary.main}}}},MuiTextField:{defaultProps:{fullWidth:!0,variant:"filled",color:"secondary"},styleOverrides:{root:{background:"white","& .MuiFilledInput-underline:before":{borderBottom:"none"},"&.Mui-readOnly:not(.Mui-disabled):not(.Mui-focused)":{borderBottom:`1px solid ${c(ye.palette.primary.main,.2)}`,background:"transparent"},"&:not(.Mui-readOnly):not(.Mui-disabled)":{boxShadow:"0px 0px 8px 2px rgba(0,0,0,0.05)",borderRadius:"8px 8px 0 0"}}}},MuiSelect:{styleOverrides:{filled:{"&:focus":{backgroundColor:"white"}}}},MuiDataGrid:{styleOverrides:{root:{border:"none"},toolbarContainer:{padding:"8px 8px 4px 8px"}}},MuiPaper:{styleOverrides:{rounded:{boxShadow:"0px 0px 8px 1px rgba(0,0,0,0.05)",borderRadius:16,padding:8}}},MuiDrawer:{styleOverrides:{paper:{border:"none",boxShadow:"0px 0px 8px 1px rgba(0,0,0,0.05)"}}},MuiTabs:{styleOverrides:{root:{marginLeft:ye.spacing(1)},indicator:{height:3,borderTopLeftRadius:3,borderTopRightRadius:3,backgroundColor:ye.palette.common.white}}},MuiTab:{styleOverrides:{root:{textTransform:"none",margin:"0 16px",minWidth:0,padding:0,[ye.breakpoints.up("md")]:{padding:0,minWidth:0}}}},MuiIconButton:{styleOverrides:{root:{color:ye.palette.secondary.main,padding:ye.spacing(1)}}},MuiTooltip:{styleOverrides:{tooltip:{borderRadius:4}}},MuiDivider:{styleOverrides:{root:{backgroundColor:"rgb(255,255,255,0.15)"},middle:{marginTop:8,marginBottom:8}}},MuiListItemButton:{defaultProps:{disableTouchRipple:!0}},MuiListItemText:{styleOverrides:{primary:{fontSize:14,fontWeight:ye.typography.fontWeightMedium}}},MuiListItemIcon:{styleOverrides:{root:{color:"inherit",minWidth:"auto",marginRight:ye.spacing(2),"& svg":{fontSize:20}}}},MuiAvatar:{styleOverrides:{root:{width:32,height:32}}},MuiCard:{styleOverrides:{root:{width:"100%",length:"100%",padding:10}}}}};var Ce,we,Oe,ke;function Me({children:i,id:n,menuItems:o,disabled:l=!1,showDropdownIcon:a=!0,fullWidth:d=!1,variant:c="contained"}){const[v,b]=W(!1),y=q(null),x=e=>{y.current&&y.current.contains(e.target)||b(!1)};function C(e){"Tab"===e.key?(e.preventDefault(),b(!1)):"Escape"===e.key&&b(!1)}const w=q(v);return N((()=>{w.current&&!v&&y.current.focus(),w.current=v}),[v]),e(t,{children:[r(s,{ref:y,id:n,onClick:()=>{b((e=>!e))},endIcon:a&&r(G,{}),disabled:l,fullWidth:d,variant:c,children:i}),r(u,{open:v,anchorEl:y.current,placement:"bottom",transition:!0,style:{zIndex:1400,minWidth:y.current?.scrollWidth},children:({TransitionProps:t,placement:i})=>r(p,{...t,style:{transformOrigin:"bottom-start"===i?"left top":"left bottom"},children:r(h,{children:r(m,{onClickAway:x,children:r(g,{autoFocusItem:v,onKeyDown:C,children:o.filter((e=>e.visible??!0)).map(((r,t)=>e(f,{id:r.label??""+t,disabled:r.disabled??!1,onClick:e=>{x(e),r.onClick()},children:[r.startIcon,r.label,r.endIcon]})))})})})})})]})}!function(e){e.equals="equals"}(Ce||(Ce={})),function(e){e.equals="equals",e.notEquals="notEquals"}(we||(we={})),function(e){e.lessThan="lessThan",e.greaterThan="greaterThan",e.lessOrEqual="lessOrEqual",e.greaterOrEqual="greaterOrEqual",e.equal="equal",e.notEqual="notEqual"}(Oe||(Oe={})),function(e){e.lessThan="lessThan",e.greaterThan="greaterThan",e.lessOrEqual="lessOrEqual",e.greaterOrEqual="greaterOrEqual",e.equal="equal",e.notEqual="notEqual",e.matches="matches",e.like="like"}(ke||(ke={}));const Pe=({readOnly:e=!1,value:t=null,id:i,label:n,name:o,error:l,helperText:a,onChange:s})=>{const d=s?e=>{const r=Array.from(pe.values()).indexOf(e.target.value),t=Array.from(pe.keys());s(t[r])}:void 0;return r(v,{name:o,id:i,label:n,select:!0,value:pe.get(t),onChange:d,className:e?"Mui-readOnly":void 0,error:l,helperText:a,InputProps:{readOnly:e,startAdornment:r(b,{position:"start",children:r(Y,{})})},children:Array.from(pe.keys()).map((e=>r(f,{value:pe.get(e),children:pe.get(e)},pe.get(e))))})},Ie=e=>{switch(e){case he.boolean:return Ce.equals;case he.date:case he.dateTime:return Oe.equal;case he.enumeration:return we.equals;case he.numeric:return Oe.equal;case he.string:return ke.equal;case he.trinaryLogic:return Ce.equals}},Te=e=>{switch(e.filterOption.filterType){case he.boolean:return Object.values(Ce);case he.date:case he.dateTime:return Object.values(Oe);case he.enumeration:return Object.values(we);case he.numeric:return Object.values(Oe);case he.string:return Object.values(ke);case he.trinaryLogic:return Object.values(Ce)}},Fe=({filter:e,setFilterOperator:t})=>r(v,{name:"operation",id:"operation",label:"Operation",select:!0,value:e.filterBy.operator,onChange:r=>{t(e,((e,r)=>{switch(e.filterOption.filterType){case he.boolean:return Ce[r];case he.date:case he.dateTime:return Oe[r];case he.enumeration:return we[r];case he.numeric:return Oe[r];case he.string:return ke[r];case he.trinaryLogic:return Ce[r]}})(e,r.target.value))},children:Te(e).map((e=>r(f,{value:e,children:e},e)))}),De=({filter:e,setFilterValue:i})=>{if(e.filterOption.filterType===he.enumeration&&!me(e.filterOption.enumValues))throw new Error(`Missing enumValues from FilterOptions of ${e.filterOption.attributeName}`);return r(t,{children:(()=>{switch(e.filterOption.filterType){case he.boolean:return r(M,{control:r(P,{checked:!!e.filterBy.value,onChange:r=>i(e,!!r.target.value)}),label:e.filterOption.attributeName});case he.date:return r(ie,{renderInput:e=>r(v,{...e}),label:e.filterOption.attributeName,value:e.filterBy.value??null,onChange:r=>i(e,(e=>e?e.toISOString().substring(0,10):e)(r)),InputProps:{startAdornment:r(b,{position:"start",children:r($,{path:Q,size:1})})}});case he.dateTime:return r(te,{renderInput:e=>r(v,{...e}),label:e.filterOption.attributeName,value:e.filterBy.value??null,onChange:r=>i(e,r),InputProps:{startAdornment:r(b,{position:"start",children:r($,{path:H,size:1})})}});case he.enumeration:return r(v,{label:e.filterOption.attributeName,value:e.filterBy.value,select:!0,onChange:r=>i(e,r.target.value),children:e.filterOption.enumValues?.map((e=>r(f,{value:e,children:e},e)))});case he.numeric:return r(v,{label:e.filterOption.attributeName,type:"number",value:e.filterBy.value,onChange:r=>i(e,Number(r.target.value)),InputProps:{startAdornment:r(b,{position:"start",children:r($,{path:j,size:1})})}});case he.string:return r(v,{label:e.filterOption.attributeName,value:e.filterBy.value,onChange:r=>i(e,r.target.value),InputProps:{startAdornment:r(b,{position:"start",children:r($,{path:V,size:1})})}});case he.trinaryLogic:return r(Pe,{label:e.filterOption.attributeName,value:e.filterBy.value,onChange:r=>i(e,r)})}})()})},Se=({filter:t,closeHandler:i,setFilterOperator:n,setFilterValue:o})=>e(O,{item:!0,container:!0,spacing:2,alignItems:"center",children:[r(O,{item:!0,xs:4,children:t&&r(Fe,{filter:t,setFilterOperator:n})}),r(O,{item:!0,xs:7,children:t&&r(De,{filter:t,setFilterValue:o})}),r(O,{item:!0,xs:1,children:r(k,{onClick:()=>i(t),children:r(J,{})})})]}),Ae=R((function(e,t){return r(y,{direction:"left",ref:t,...e})})),Ee=({filters:t,filterOptions:d,resolve:c,open:u,handleClose:p})=>{const h=q(null),[m,g]=W(t??[]);N((()=>{if(u){const{current:e}=h;null!==e&&e.focus()}}),[u]);const f=(e,r)=>{g((t=>t.map((t=>e.id===t.id?{...t,filterBy:{value:r,operator:t.filterBy.operator}}:t))))},v=(e,r)=>{g((t=>t.map((t=>e.id===t.id?{...t,filterBy:{value:t.filterBy.value,operator:r}}:t))))},b=e=>{g((r=>[...r.filter((r=>r.id!==e.id))]))},y=()=>{p(),c(void 0)};return e(i,{open:u,onClose:y,scroll:"paper",TransitionComponent:Ae,disableEnforceFocus:!0,fullWidth:!0,maxWidth:"sm",sx:{"& .MuiDialog-container":{justifyContent:"flex-end"}},PaperProps:{sx:{m:0,height:"100%"}},children:[r(n,{id:"scroll-dialog-title",children:r(x,{component:"span",color:"text.primary",variant:"h5",children:"Filters"})}),r(o,{dividers:!0,children:r(l,{id:"scroll-dialog-description",ref:h,tabIndex:-1,children:r(C,{component:"main",maxWidth:"xs",children:r(w,{sx:be,children:e(O,{container:!0,spacing:2,children:[m.map((e=>r(Se,{filter:e,closeHandler:b,setFilterOperator:v,setFilterValue:f},e.id))),r(O,{item:!0,container:!0,children:r(Me,{fullWidth:!0,showDropdownIcon:!1,menuItems:d.map((e=>({label:e.label??e.attributeName,onClick:()=>g((r=>[...r,{id:r.length,filterOption:{attributeName:e.attributeName,label:e.label,filterType:e.filterType},filterBy:{operator:Ie(e.filterType)}}]))}))),children:"Add new filter"})})]})})})})}),e(a,{children:[r(s,{fullWidth:!0,variant:"outlined",onClick:y,children:"Cancel"}),e(s,{fullWidth:!0,onClick:()=>{p(),c(m)},children:["Apply ","("+m.length+")"]})]})]})},Be=({page:t,open:n,handleClose:d,resolve:c})=>{const u=q(null);N((()=>{if(n){const{current:e}=u;null!==e&&e.focus()}}),[n]);const p=()=>{c(),d()};return e(i,{open:n,onClose:p,scroll:"paper",children:[r(o,{dividers:!0,children:r(l,{ref:u,tabIndex:-1,children:t})}),r(a,{children:r(s,{onClick:p,children:"Ok"})})]})},qe=e=>r(I,{component:"div",count:-1,page:e.page,onPageChange:async(r,t)=>{let i=!0;t<e.page&&(i=!1),e.setPage(t),await e.pageChange(i)},rowsPerPage:e.rowPerPage,rowsPerPageOptions:[e.rowPerPage],labelDisplayedRows:({from:e,to:r})=>`${e}–${r}`,nextIconButtonProps:{disabled:!e.isNextButtonEnabled},backIconButtonProps:{disabled:0===e.page}}),Ne=({resolve:t,open:d,handleClose:c,single:u=!1,columns:p,defaultSortField:h,rangeCall:m,alreadySelectedItems:g,initalQueryCustomizer:f,filterOptions:v})=>{const{openFilterDialog:b}=He(),{enqueueSnackbar:y}=le(),x=q(null),[C,w]=W(!1),[O,k]=W(0),[M,P]=W([h]),[I,T]=W(),[F,D]=W(),[S,A]=W(!0),[E,B]=W(0),[R,z]=W([]),[L,_]=W(g??(u?void 0:[])),[V,j]=W([]),[H,Q]=W([]),[$,G]=W({...f,_seek:{limit:6}}),Y=async e=>{G((r=>({...r,_seek:{limit:e?6:5,reverse:!e,lastItem:e?I:F}}))),A(!e)},J=async()=>{w(!0);try{const e=await m($);e.length>5?(A(!0),e.pop()):6===$._seek?.limit&&A(!1),z(e),D(e[0]),T(e[e.length-1]),k(e.length||0)}catch(e){((e,r,t)=>{if(!e||"boolean"!=typeof e.isAxiosError||!0!==e.isAxiosError)return void fe(r);const i=e.response;if(me(i))if(i?.status)if(422===i?.status)r(ve(e.response?.data).message,{variant:"error",preventDuplicate:!0,persist:!0});else{if(400===i?.status)return ge(i.data,r,t);r(ve(i?.data).message,{variant:"error",preventDuplicate:!0,persist:!0})}else fe(r);else fe(r)})(e,y)}w(!1)};N((()=>{J()}),[$]),N((()=>{if(d){const{current:e}=x;null!==e&&e.focus()}}),[d]);const K=()=>{c(),t(void 0)};return e(i,{open:d,onClose:K,scroll:"paper",fullWidth:!0,maxWidth:"sm",children:[r(n,{id:"scroll-dialog-title",children:"Select"}),r(o,{dividers:!0,children:r(l,{id:"scroll-dialog-description",ref:x,tabIndex:-1,children:r(ne,{sx:u?{".MuiDataGrid-columnHeaderCheckbox .MuiDataGrid-columnHeaderTitleContainer":{display:"none"}}:void 0,autoHeight:!0,getRowId:e=>e.__identifier,loading:C,paginationMode:"server",rows:R,rowCount:O,sortingOrder:["desc","asc"],sortingMode:"server",sortModel:M,onSortModelChange:e=>{B(0),P(e);const{field:r,sort:t}=e[0];G((e=>({...e,_orderBy:[{attribute:r,descending:"desc"===t}]})))},checkboxSelection:!0,onSelectionModelChange:u?e=>{if(Array.isArray(L))return;if(0===e.length)return _(""),void j(void 0);const r=e[e.length-1];_(r),j(R.find((e=>e.__identifier===r)))}:e=>{if(Array.isArray(L)){if(e.length>L.length){const r=e.length-L.length,t=[...e].slice(-1*r),i=R.filter((e=>-1!==t.indexOf(e.__identifier)));j((e=>{if(Array.isArray(e))return[...e,...i]}))}if(e.length<L.length){const r=L.filter((r=>-1===e.indexOf(r)));j((e=>{if(Array.isArray(e))return[...e.filter((e=>-1===r.indexOf(e.__identifier)))]}))}_(e)}},isRowSelectable:u?void 0:e=>{if(g){if(!Array.isArray(g))throw Error("Range dialog gets wrong alreadySelectedItems.");return!g.includes(e.id)}return!0},selectionModel:L,hideFooterSelectedRowCount:u,columns:p,keepNonExistentRowsSelected:!0,components:{Toolbar:()=>r(oe,{children:e(s,{variant:"outlined",onClick:async()=>{const e=await b(v,H);e&&(e=>{B(0),Q(e),G((r=>{const t={...r};return v.forEach((r=>t[r.attributeName]=mapFiltersToQueryCustomizerProperty(e,r.attributeName))),{...r,_seek:{lastItem:void 0,limit:6,reverse:void 0},...t}}))})(e)},disabled:C,children:["Set filters ",0!==H.length?"("+H.length+")":""]})}),Pagination:()=>r(qe,{pageChange:Y,isNextButtonEnabled:S,page:E,setPage:B,rowPerPage:5})}})})}),e(a,{children:[r(s,{onClick:K,children:"Cancel"}),r(s,{onClick:()=>{c(),t(V)},children:"Ok"})]})]})},We=z(),Re=z(),ze=z(),Le=z(),_e=()=>{const e=L(We);if(void 0===e)throw new Error("useConfirmDialog was used outside of its Provider");return e},Ve=()=>{const e=L(Re);if(void 0===e)throw new Error("useConfirmDialog was used outside of its Provider");return e},je=()=>{const e=L(ze);if(void 0===e)throw new Error("useRangeDialog was used outside of its Provider");return e},He=()=>{const e=L(Le);if(void 0===e)throw new Error("useFilterDialog was used outside of its Provider");return e},Qe=({children:t})=>{const[i,n]=W(!1),[o,l]=W(),a=()=>{n(!1)},s={openPageDialog:async e=>(n(!0),new Promise((t=>{l(r(Be,{page:e,handleClose:a,open:!0,resolve:t}))})))},[d,c]=W(!1),[u,p]=W(),h=()=>{c(!1)},m={openRangeDialog:async({columns:e,defaultSortField:t,rangeCall:i,single:n=!1,alreadySelectedItems:o,filterOptions:l,initialQueryCustomizer:a})=>(c(!0),new Promise((s=>{p(r(Ne,{handleClose:h,open:!0,resolve:s,columns:e,defaultSortField:t,rangeCall:i,single:n,alreadySelectedItems:o,filterOptions:l,initalQueryCustomizer:a}))})))},[g,f]=W(!1),[v,b]=W(),y=()=>(f(!1),!1),x={openConfirmDialog:async(e,t)=>(f(!0),new Promise((i=>{b(r(ue,{confirmationMessage:e,title:t,handleClose:y,open:!0,resolve:i}))})))},[C,w]=W(!1),[O,k]=W(),M=()=>(w(!1),!1),P={openFilterDialog:async(e,t)=>(w(!0),new Promise((i=>{k(r(Ee,{filters:t,filterOptions:e,handleClose:M,open:!0,resolve:i}))})))};return r(We.Provider,{value:s,children:r(Re.Provider,{value:x,children:r(ze.Provider,{value:m,children:e(Le.Provider,{value:P,children:[t,i&&o,g&&v,d&&u,C&&O]})})})})},$e=(e,r)=>{if(!me(e)||0===e.length)return[];let t=1;if(r?.shownActions&&(t=e.length<r.shownActions?e.length:r.shownActions),t<0)return Ge(e,r);if(0===t)return[];if(1===t)return Ye(e);{const i=e.length===t?t:t-1,n=e.slice(0,i),o=e.slice(i);return[...Ge(n,r),...Ye(o)]}},Ge=(r,t)=>r.map(((r,i)=>({field:r.label+i,headerName:"",align:"center",type:"actions",renderCell:i=>e(s,{variant:"text",onClick:()=>r.action(i.row),children:[r.icon,(t?.showLabel??!0)&&r.label]})}))),Ye=e=>0===e.length?[]:[{field:"actions",headerName:"",align:"center",type:"actions",renderCell:t=>r(Me,{variant:"text",showDropdownIcon:!1,menuItems:e.map((e=>({label:e.label,startIcon:e.icon,onClick:()=>e.action(t.row)}))),children:r(K,{})})}],Je=({name:t,id:i,label:n,value:o,error:l=!1,helperText:a,disabled:s=!1,readonly:d=!0,labelList:c,icon:u,onSet:p,onView:h,onCreate:m,onRemove:g,onDelete:f})=>{const[y,x]=W(!1);let C;return C=d?r(Ke,{value:o,disabled:s,onCreate:m,onView:h,onDelete:f}):r(Ue,{value:o,disabled:s,onRemove:g}),e(O,{container:!0,item:!0,direction:"row",justifyContent:"stretch",alignContent:"stretch",children:[r(T,{sx:{padding:0},disabled:s||d,onFocusCapture:()=>x(!0),onBlur:()=>x(!1),onClick:p,children:r(v,{disabled:!p||s,name:t,id:i,label:n,error:l,helperText:a,focused:y,fullWidth:!0,value:c.join(" - "),className:d?"Mui-readOnly":void 0,sx:{":hover":{cursor:"pointer"},".MuiFilledInput-input:hover":{cursor:"pointer"}},InputProps:{readOnly:!0,startAdornment:r(b,{position:"start",children:u})}})}),C]})},Ke=({value:i,disabled:n,onCreate:o,onDelete:l,onView:a})=>{let s;return s=me(i)?e(t,{children:[a&&r(k,{disabled:n,onClick:a,children:r(U,{})}),l&&r(k,{disabled:n,onClick:l,children:r(X,{})})]}):r(t,{children:o&&r(k,{disabled:n,onClick:o,children:r(Z,{})})}),r(t,{children:s})},Ue=({value:e,disabled:i,onRemove:n})=>{let o;return o=me(e)?r(t,{children:n&&r(k,{disabled:i,onClick:n,children:r(ee,{})})}):r(t,{}),r(t,{children:o})},Xe=z(),Ze=z([]),er=()=>{const e=L(Xe);if(void 0===e)throw new Error("useJudoNavigation was used outside of its Provider");return e},rr=({children:e})=>{const t=ae(),i=se(),[n,o]=W([]),[l,a]=W({});N((()=>{a((e=>({...e,key:"0."+i.pathname,path:i.pathname})))}),[]);const s={clearNavigate:e=>{o([]),a({key:"0."+e.toString(),label:null,path:e}),t(e)},navigate:e=>{if(null===l.label)throw Error("Page title has not been set!");o((e=>[...e,l])),a({key:n.length+"."+e.toString(),label:null,path:e}),t(e)},back:()=>{if(0!==n.length){const e=n[n.length-1];return a(e),o((e=>[...e.slice(0,e.length-1)])),void t(e.path)}o([]),a({key:"0."+"/".toString(),label:null,path:"/"}),t("/")},isBackDisabled:_((()=>0===n.length),[n]),setTitle:e=>{a((r=>({...r,label:e})))}};return r(Ze.Provider,{value:n,children:r(Xe.Provider,{value:s,children:e})})},tr=()=>{const t=L(Ze);return e(F,{maxItems:2,separator:">",children:[r(re,{}),t.map((({label:e,key:t},i)=>r(x,{color:"text.primary",children:e},t)))]})},ir={py:"2px",px:3,color:xe.palette.text.secondary,"&:hover, &:focus":{color:xe.palette.secondary.main},"&.Mui-selected":{color:xe.palette.secondary.main}};function nr({children:e,to:t,...i}){const n=de(t),o=ce({path:n.pathname,end:!0}),{clearNavigate:l}=er();return r(D,{disablePadding:!0,style:{textDecoration:"none"},children:r(S,{selected:!!o,sx:ir,onClick:()=>{l(t)},children:e})})}const or=({title:i,children:n})=>{const{setTitle:o}=er();return N((()=>{o(i)}),[i]),e(t,{children:[r(A,{component:"div",position:"static",elevation:0,sx:{zIndex:0},children:r(E,{children:e(O,{container:!0,alignItems:"center",spacing:1,children:[r(O,{item:!0,xs:!0,children:r(x,{component:"span",color:"text.primary",variant:"h5",children:i})}),n]})})}),r(B,{})]})};export{Je as AggregationInput,rr as BreadcrumbProvider,ue as ConfirmationDialog,tr as CustomBreadcrumb,nr as CustomLink,qe as CustomTablePagination,Qe as DialogProvider,Me as DropdownButton,Ee as FilterDialog,Be as PageDialog,or as PageHeader,Ne as RangeDialog,$e as columnsActionCalculator,Ve as useConfirmDialog,He as useFilterDialog,er as useJudoNavigation,_e as usePageDialog,je as useRangeDialog};
1
+ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{Dialog as i,DialogTitle as n,DialogContent as o,DialogContentText as l,DialogActions as a,Button as s,createTheme as d,alpha as c,Popper as u,Grow as p,Paper as h,ClickAwayListener as m,MenuList as g,MenuItem as f,TextField as b,InputAdornment as v,Slide as y,Typography as x,Container as C,Box as O,Grid as w,IconButton as k,FormControlLabel as M,Checkbox as I,TablePagination as P,ButtonBase as T,Breadcrumbs as F,ListItem as S,ListItemButton as A,AppBar as D,Toolbar as B,Divider as E}from"@mui/material";import{useRef as q,useEffect as N,useState as W,forwardRef as R,createContext as z,useContext as L,useMemo as _}from"react";import{mdiFormatTextVariant as V,mdiNumeric as j,mdiCalendarClock as H,mdiCalendarMonth as Q}from"@mdi/js";import $ from"@mdi/react";import{KeyboardArrowDown as G,CheckBoxOutlined as Y,Close as J,MoreHoriz as K,Visibility as U,Delete as X,NoteAdd as Z,LinkOff as ee,Home as te}from"@mui/icons-material";import{DateTimePicker as re,DatePicker as ie}from"@mui/x-date-pickers";import{DataGrid as ne,GridToolbarContainer as oe}from"@mui/x-data-grid";import{useSnackbar as le}from"notistack";import{useNavigate as ae,useLocation as se,useResolvedPath as de,useMatch as ce}from"react-router-dom";const ue=({confirmationMessage:r,title:d,resolve:c,open:u,handleClose:p})=>{const h=q(null);N((()=>{if(u){const{current:e}=h;null!==e&&e.focus()}}),[u]);return e(i,{open:u,onClose:p,scroll:"paper",fullWidth:!0,maxWidth:"xs",children:[d&&t(n,{id:"scroll-dialog-title",children:d}),t(o,{dividers:!!d,children:t(l,{id:"scroll-dialog-description",ref:h,tabIndex:-1,children:r})}),e(a,{children:[t(s,{variant:"text",onClick:()=>{p(),c(!1)},children:"No"}),t(s,{variant:"text",onClick:()=>{p(),c(!0)},children:"Yes"})]})]})},pe=new Map([[null,"Unknown"],[!0,"Yes"],[!1,"No"]]);var he;!function(e){e[e.boolean=0]="boolean",e[e.numeric=1]="numeric",e[e.string=2]="string",e[e.enumeration=3]="enumeration",e[e.date=4]="date",e[e.dateTime=5]="dateTime",e[e.trinaryLogic=6]="trinaryLogic"}(he||(he={}));const me=e=>null!=e,ge=(e,t,r)=>{if(me(e[0].location)){if(t("Please make sure all fields are filled in correctly.",{variant:"error",preventDuplicate:!0,persist:!r?.duration,autoHideDuration:r?.duration??void 0}),void 0!==r?.setValidation){let t=new Map;e.forEach((e=>t.set(e.location,e.code))),r?.setValidation(t)}}else t(e[0].code,{variant:"error",preventDuplicate:!0,persist:!r?.duration,autoHideDuration:r?.duration??void 0})},fe=e=>{e("Something went wrong. Please contact with the system admins.",{variant:"error",preventDuplicate:!0,persist:!0})},be=e=>({message:e.code}),ve={marginTop:8,marginBottom:8,display:"flex",flexDirection:"column",alignItems:"center"},ye=d({palette:{mode:"light",primary:{main:"#3C4166FF"},secondary:{main:"#E7501DFF"},text:{primary:"#17191DFF",secondary:"#434448FF"},background:{default:"#FAFAFAFF"},subtitleColor:{main:"#8c8c8c"}},typography:{h5:{fontWeight:500,fontSize:26,letterSpacing:.5}},shape:{borderRadius:8},components:{MuiTab:{defaultProps:{disableRipple:!0}}},mixins:{toolbar:{minHeight:48}}}),xe={...ye,components:{MuiAppBar:{styleOverrides:{colorPrimary:{backgroundColor:ye.palette.background.default}}},MuiButton:{defaultProps:{variant:"contained",size:"small"},styleOverrides:{root:{textTransform:"none",borderRadius:"20px 20px 20px 20px",paddingLeft:15,paddingRight:15},contained:{boxShadow:"none","&:active":{boxShadow:"none"}},outlined:{border:"2px solid",fontWeight:"bold","&:hover":{border:"2px solid",background:c(ye.palette.primary.main,.15)}}}},MuiInputLabel:{styleOverrides:{root:{color:ye.palette.subtitleColor.main,fontWeight:500,fontSize:16,"&.Mui-focused":{color:ye.palette.subtitleColor.main}}}},MuiFilledInput:{styleOverrides:{input:{"&:-webkit-autofill":{WebkitBackgroundClip:"text !important"}},root:{background:"inherit","&.Mui-focused":{background:"inherit"},"&:hover:not(.Mui-disabled):not(.Mui-focused)":{background:c(ye.palette.secondary.main,.1)},"&:hover:not(.Mui-disabled):before":{borderBottom:"none"},"&.Mui-focused .MuiInputAdornment-root .MuiSvgIcon-root":{color:ye.palette.secondary.main}}}},MuiTextField:{defaultProps:{fullWidth:!0,variant:"filled",color:"secondary"},styleOverrides:{root:{background:"white","& .MuiFilledInput-underline:before":{borderBottom:"none"},"&.Mui-readOnly:not(.Mui-disabled):not(.Mui-focused)":{borderBottom:`1px solid ${c(ye.palette.primary.main,.2)}`,background:"transparent"},"&:not(.Mui-readOnly):not(.Mui-disabled)":{boxShadow:"0px 0px 8px 2px rgba(0,0,0,0.05)",borderRadius:"8px 8px 0 0"}}}},MuiSelect:{styleOverrides:{filled:{"&:focus":{backgroundColor:"white"}}}},MuiDataGrid:{styleOverrides:{root:{border:"none"},toolbarContainer:{padding:"8px 8px 4px 8px"}}},MuiPaper:{styleOverrides:{rounded:{boxShadow:"0px 0px 8px 1px rgba(0,0,0,0.05)",borderRadius:16,padding:8}}},MuiDrawer:{styleOverrides:{paper:{border:"none",boxShadow:"0px 0px 8px 1px rgba(0,0,0,0.05)"}}},MuiTabs:{styleOverrides:{root:{marginLeft:ye.spacing(1)},indicator:{height:3,borderTopLeftRadius:3,borderTopRightRadius:3,backgroundColor:ye.palette.common.white}}},MuiTab:{styleOverrides:{root:{textTransform:"none",margin:"0 16px",minWidth:0,padding:0,[ye.breakpoints.up("md")]:{padding:0,minWidth:0}}}},MuiIconButton:{styleOverrides:{root:{color:ye.palette.secondary.main,padding:ye.spacing(1)}}},MuiTooltip:{styleOverrides:{tooltip:{borderRadius:4}}},MuiDivider:{styleOverrides:{root:{backgroundColor:"rgb(255,255,255,0.15)"},middle:{marginTop:8,marginBottom:8}}},MuiListItemButton:{defaultProps:{disableTouchRipple:!0}},MuiListItemText:{styleOverrides:{primary:{fontSize:14,fontWeight:ye.typography.fontWeightMedium}}},MuiListItemIcon:{styleOverrides:{root:{color:"inherit",minWidth:"auto",marginRight:ye.spacing(2),"& svg":{fontSize:20}}}},MuiAvatar:{styleOverrides:{root:{width:32,height:32}}},MuiCard:{styleOverrides:{root:{width:"100%",length:"100%",padding:10}}}}};var Ce,Oe,we,ke;function Me({children:i,id:n,menuItems:o,disabled:l=!1,showDropdownIcon:a=!0,fullWidth:d=!1,variant:c="contained"}){const[b,v]=W(!1),y=q(null),x=e=>{y.current&&y.current.contains(e.target)||v(!1)};function C(e){"Tab"===e.key?(e.preventDefault(),v(!1)):"Escape"===e.key&&v(!1)}const O=q(b);return N((()=>{O.current&&!b&&y.current.focus(),O.current=b}),[b]),e(r,{children:[t(s,{ref:y,id:n,onClick:()=>{v((e=>!e))},endIcon:a&&t(G,{}),disabled:l,fullWidth:d,variant:c,children:i}),t(u,{open:b,anchorEl:y.current,placement:"bottom",transition:!0,style:{zIndex:1400,minWidth:y.current?.scrollWidth},children:({TransitionProps:r,placement:i})=>t(p,{...r,style:{transformOrigin:"bottom-start"===i?"left top":"left bottom"},children:t(h,{children:t(m,{onClickAway:x,children:t(g,{autoFocusItem:b,onKeyDown:C,children:o.filter((e=>e.visible??!0)).map(((t,r)=>e(f,{id:t.label??""+r,disabled:t.disabled??!1,onClick:e=>{x(e),t.onClick()},children:[t.startIcon,t.label,t.endIcon]})))})})})})})]})}!function(e){e.equals="equals"}(Ce||(Ce={})),function(e){e.equals="equals",e.notEquals="notEquals"}(Oe||(Oe={})),function(e){e.lessThan="lessThan",e.greaterThan="greaterThan",e.lessOrEqual="lessOrEqual",e.greaterOrEqual="greaterOrEqual",e.equal="equal",e.notEqual="notEqual"}(we||(we={})),function(e){e.lessThan="lessThan",e.greaterThan="greaterThan",e.lessOrEqual="lessOrEqual",e.greaterOrEqual="greaterOrEqual",e.equal="equal",e.notEqual="notEqual",e.matches="matches",e.like="like"}(ke||(ke={}));const Ie=({readOnly:e=!1,value:r=null,id:i,label:n,name:o,error:l,helperText:a,onChange:s})=>{const d=s?e=>{const t=Array.from(pe.values()).indexOf(e.target.value),r=Array.from(pe.keys());s(r[t])}:void 0;return t(b,{name:o,id:i,label:n,select:!0,value:pe.get(r),onChange:d,className:e?"Mui-readOnly":void 0,error:l,helperText:a,InputProps:{readOnly:e,startAdornment:t(v,{position:"start",children:t(Y,{})})},children:Array.from(pe.keys()).map((e=>t(f,{value:pe.get(e),children:pe.get(e)},pe.get(e))))})},Pe=e=>{switch(e){case he.boolean:return Ce.equals;case he.date:case he.dateTime:return we.equal;case he.enumeration:return Oe.equals;case he.numeric:return we.equal;case he.string:return ke.equal;case he.trinaryLogic:return Ce.equals}},Te=e=>{switch(e.filterOption.filterType){case he.boolean:return Object.values(Ce);case he.date:case he.dateTime:return Object.values(we);case he.enumeration:return Object.values(Oe);case he.numeric:return Object.values(we);case he.string:return Object.values(ke);case he.trinaryLogic:return Object.values(Ce)}},Fe=({filter:e,setFilterOperator:r})=>t(b,{name:"operation",id:"operation",label:"Operation",select:!0,value:e.filterBy.operator,onChange:t=>{r(e,((e,t)=>{switch(e.filterOption.filterType){case he.boolean:return Ce[t];case he.date:case he.dateTime:return we[t];case he.enumeration:return Oe[t];case he.numeric:return we[t];case he.string:return ke[t];case he.trinaryLogic:return Ce[t]}})(e,t.target.value))},children:Te(e).map((e=>t(f,{value:e,children:e},e)))}),Se=({filter:e,setFilterValue:i})=>{if(e.filterOption.filterType===he.enumeration&&!me(e.filterOption.enumValues))throw new Error(`Missing enumValues from FilterOptions of ${e.filterOption.attributeName}`);return t(r,{children:(()=>{switch(e.filterOption.filterType){case he.boolean:return t(M,{control:t(I,{checked:!!e.filterBy.value,onChange:t=>i(e,!!t.target.value)}),label:e.filterOption.attributeName});case he.date:return t(ie,{renderInput:e=>t(b,{...e}),label:e.filterOption.attributeName,value:e.filterBy.value??null,onChange:t=>i(e,(e=>e?e.toISOString().substring(0,10):e)(t)),InputProps:{startAdornment:t(v,{position:"start",children:t($,{path:Q,size:1})})}});case he.dateTime:return t(re,{renderInput:e=>t(b,{...e}),label:e.filterOption.attributeName,value:e.filterBy.value??null,onChange:t=>i(e,t),InputProps:{startAdornment:t(v,{position:"start",children:t($,{path:H,size:1})})}});case he.enumeration:return t(b,{label:e.filterOption.attributeName,value:e.filterBy.value,select:!0,onChange:t=>i(e,t.target.value),children:e.filterOption.enumValues?.map((e=>t(f,{value:e,children:e},e)))});case he.numeric:return t(b,{label:e.filterOption.attributeName,type:"number",value:e.filterBy.value,onChange:t=>i(e,Number(t.target.value)),InputProps:{startAdornment:t(v,{position:"start",children:t($,{path:j,size:1})})}});case he.string:return t(b,{label:e.filterOption.attributeName,value:e.filterBy.value,onChange:t=>i(e,t.target.value),InputProps:{startAdornment:t(v,{position:"start",children:t($,{path:V,size:1})})}});case he.trinaryLogic:return t(Ie,{label:e.filterOption.attributeName,value:e.filterBy.value,onChange:t=>i(e,t)})}})()})},Ae=({filter:r,closeHandler:i,setFilterOperator:n,setFilterValue:o})=>e(w,{item:!0,container:!0,spacing:2,alignItems:"center",children:[t(w,{item:!0,xs:4,children:r&&t(Fe,{filter:r,setFilterOperator:n})}),t(w,{item:!0,xs:7,children:r&&t(Se,{filter:r,setFilterValue:o})}),t(w,{item:!0,xs:1,children:t(k,{onClick:()=>i(r),children:t(J,{})})})]}),De=R((function(e,r){return t(y,{direction:"left",ref:r,...e})})),Be=({filters:r,filterOptions:d,resolve:c,open:u,handleClose:p})=>{const h=q(null),[m,g]=W(r??[]);N((()=>{if(u){const{current:e}=h;null!==e&&e.focus()}}),[u]);const f=(e,t)=>{g((r=>r.map((r=>e.id===r.id?{...r,filterBy:{value:t,operator:r.filterBy.operator}}:r))))},b=(e,t)=>{g((r=>r.map((r=>e.id===r.id?{...r,filterBy:{value:r.filterBy.value,operator:t}}:r))))},v=e=>{g((t=>[...t.filter((t=>t.id!==e.id))]))},y=()=>{p(),c(void 0)};return e(i,{open:u,onClose:y,scroll:"paper",TransitionComponent:De,disableEnforceFocus:!0,fullWidth:!0,maxWidth:"sm",sx:{"& .MuiDialog-container":{justifyContent:"flex-end"}},PaperProps:{sx:{m:0,height:"100%"}},children:[t(n,{id:"scroll-dialog-title",children:t(x,{component:"span",color:"text.primary",variant:"h5",children:"Filters"})}),t(o,{dividers:!0,children:t(l,{id:"scroll-dialog-description",ref:h,tabIndex:-1,children:t(C,{component:"main",maxWidth:"xs",children:t(O,{sx:ve,children:e(w,{container:!0,spacing:2,children:[m.map((e=>t(Ae,{filter:e,closeHandler:v,setFilterOperator:b,setFilterValue:f},e.id))),t(w,{item:!0,container:!0,children:t(Me,{fullWidth:!0,showDropdownIcon:!1,menuItems:d.map((e=>({label:e.label??e.attributeName,onClick:()=>g((t=>[...t,{id:t.length,filterOption:{attributeName:e.attributeName,label:e.label,filterType:e.filterType},filterBy:{operator:Pe(e.filterType)}}]))}))),children:"Add new filter"})})]})})})})}),e(a,{children:[t(s,{fullWidth:!0,variant:"outlined",onClick:y,children:"Cancel"}),e(s,{fullWidth:!0,onClick:()=>{p(),c(m)},children:["Apply ","("+m.length+")"]})]})]})},Ee=({page:r,open:n,handleClose:d,resolve:c})=>{const u=q(null);N((()=>{if(n){const{current:e}=u;null!==e&&e.focus()}}),[n]);const p=()=>{c(),d()};return e(i,{open:n,onClose:p,scroll:"paper",children:[t(o,{dividers:!0,children:t(l,{ref:u,tabIndex:-1,children:r})}),t(a,{children:t(s,{onClick:p,children:"Ok"})})]})},qe=e=>t(P,{component:"div",count:-1,page:e.page,onPageChange:async(t,r)=>{let i=!0;r<e.page&&(i=!1),e.setPage(r),await e.pageChange(i)},rowsPerPage:e.rowPerPage,rowsPerPageOptions:[e.rowPerPage],labelDisplayedRows:({from:e,to:t})=>`${e}–${t}`,nextIconButtonProps:{disabled:!e.isNextButtonEnabled},backIconButtonProps:{disabled:0===e.page}}),Ne=z(),We=z(),Re=z(),ze=z(),Le=({resolve:r,open:d,handleClose:c,single:u=!1,columns:p,defaultSortField:h,rangeCall:m,alreadySelectedItems:g,initalQueryCustomizer:f,filterOptions:b})=>{const{openFilterDialog:v}=(()=>{const e=L(ze);if(void 0===e)throw new Error("useFilterDialog was used outside of its Provider");return e})(),{enqueueSnackbar:y}=le(),x=q(null),[C,O]=W(!1),[w,k]=W(0),[M,I]=W([h]),[P,T]=W(),[F,S]=W(),[A,D]=W(!0),[B,E]=W(0),[R,z]=W([]),[_,V]=W(g??(u?void 0:[])),[j,H]=W([]),[Q,$]=W([]),[G,Y]=W({...f,_seek:{limit:6}}),J=async e=>{Y((t=>({...t,_seek:{limit:e?6:5,reverse:!e,lastItem:e?P:F}}))),D(!e)},K=async()=>{O(!0);try{const e=await m(G);e.length>5?(D(!0),e.pop()):6===G._seek?.limit&&D(!1),z(e),S(e[0]),T(e[e.length-1]),k(e.length||0)}catch(e){((e,t,r)=>{if(!e||"boolean"!=typeof e.isAxiosError||!0!==e.isAxiosError)return void fe(t);const i=e.response;if(me(i))if(i?.status)if(422===i?.status)t(be(e.response?.data).message,{variant:"error",preventDuplicate:!0,persist:!0});else{if(400===i?.status)return ge(i.data,t,r);t(be(i?.data).message,{variant:"error",preventDuplicate:!0,persist:!0})}else fe(t);else fe(t)})(e,y)}O(!1)};N((()=>{K()}),[G]),N((()=>{if(d){const{current:e}=x;null!==e&&e.focus()}}),[d]);const U=()=>{c(),r(void 0)};return e(i,{open:d,onClose:U,scroll:"paper",fullWidth:!0,maxWidth:"sm",children:[t(n,{id:"scroll-dialog-title",children:"Select"}),t(o,{dividers:!0,children:t(l,{id:"scroll-dialog-description",ref:x,tabIndex:-1,children:t(ne,{sx:u?{".MuiDataGrid-columnHeaderCheckbox .MuiDataGrid-columnHeaderTitleContainer":{display:"none"}}:void 0,autoHeight:!0,getRowId:e=>e.__identifier,loading:C,paginationMode:"server",rows:R,rowCount:w,sortingOrder:["desc","asc"],sortingMode:"server",sortModel:M,onSortModelChange:e=>{E(0),I(e);const{field:t,sort:r}=e[0];Y((e=>({...e,_orderBy:[{attribute:t,descending:"desc"===r}]})))},checkboxSelection:!0,onSelectionModelChange:u?e=>{if(Array.isArray(_))return;if(0===e.length)return V(""),void H(void 0);const t=e[e.length-1];V(t),H(R.find((e=>e.__identifier===t)))}:e=>{if(Array.isArray(_)){if(e.length>_.length){const t=e.length-_.length,r=[...e].slice(-1*t),i=R.filter((e=>-1!==r.indexOf(e.__identifier)));H((e=>{if(Array.isArray(e))return[...e,...i]}))}if(e.length<_.length){const t=_.filter((t=>-1===e.indexOf(t)));H((e=>{if(Array.isArray(e))return[...e.filter((e=>-1===t.indexOf(e.__identifier)))]}))}V(e)}},isRowSelectable:u?void 0:e=>{if(g){if(!Array.isArray(g))throw Error("Range dialog gets wrong alreadySelectedItems.");return!g.includes(e.id)}return!0},selectionModel:_,hideFooterSelectedRowCount:u,columns:p,keepNonExistentRowsSelected:!0,components:{Toolbar:()=>t(oe,{children:e(s,{variant:"outlined",onClick:async()=>{const e=await v(b,Q);e&&(e=>{E(0),$(e),Y((t=>{const r={...t};return b.forEach((t=>r[t.attributeName]=mapFiltersToQueryCustomizerProperty(e,t.attributeName))),{...t,_seek:{lastItem:void 0,limit:6,reverse:void 0},...r}}))})(e)},disabled:C,children:["Set filters ",0!==Q.length?"("+Q.length+")":""]})}),Pagination:()=>t(qe,{pageChange:J,isNextButtonEnabled:A,page:B,setPage:E,rowPerPage:5})}})})}),e(a,{children:[t(s,{onClick:U,children:"Cancel"}),t(s,{onClick:()=>{c(),r(j)},children:"Ok"})]})]})},_e=({children:r})=>{const[i,n]=W(!1),[o,l]=W(),a=()=>{n(!1)},s={openPageDialog:async e=>(n(!0),new Promise((r=>{l(t(Ee,{page:e,handleClose:a,open:!0,resolve:r}))})))},[d,c]=W(!1),[u,p]=W(),h=()=>{c(!1)},m={openRangeDialog:async({columns:e,defaultSortField:r,rangeCall:i,single:n=!1,alreadySelectedItems:o,filterOptions:l,initialQueryCustomizer:a})=>(c(!0),new Promise((s=>{p(t(Le,{handleClose:h,open:!0,resolve:s,columns:e,defaultSortField:r,rangeCall:i,single:n,alreadySelectedItems:o,filterOptions:l,initalQueryCustomizer:a}))})))},[g,f]=W(!1),[b,v]=W(),y=()=>(f(!1),!1),x={openConfirmDialog:async(e,r)=>(f(!0),new Promise((i=>{v(t(ue,{confirmationMessage:e,title:r,handleClose:y,open:!0,resolve:i}))})))},[C,O]=W(!1),[w,k]=W(),M=()=>(O(!1),!1),I={openFilterDialog:async(e,r)=>(O(!0),new Promise((i=>{k(t(Be,{filters:r,filterOptions:e,handleClose:M,open:!0,resolve:i}))})))};return t(Ne.Provider,{value:s,children:t(We.Provider,{value:x,children:t(Re.Provider,{value:m,children:e(ze.Provider,{value:I,children:[r,i&&o,g&&b,d&&u,C&&w]})})})})},Ve=(e,t)=>{if(!me(e)||0===e.length)return[];let r=1;if(t?.shownActions&&(r=e.length<t.shownActions?e.length:t.shownActions),r<0)return je(e,t);if(0===r)return[];if(1===r)return He(e);{const i=e.length===r?r:r-1,n=e.slice(0,i),o=e.slice(i);return[...je(n,t),...He(o)]}},je=(t,r)=>t.map(((t,i)=>({field:t.label+i,headerName:"",align:"center",type:"actions",renderCell:i=>e(s,{variant:"text",onClick:()=>t.action(i.row),children:[t.icon,(r?.showLabel??!0)&&t.label]})}))),He=e=>0===e.length?[]:[{field:"actions",headerName:"",align:"center",type:"actions",renderCell:r=>t(Me,{variant:"text",showDropdownIcon:!1,menuItems:e.map((e=>({label:e.label,startIcon:e.icon,onClick:()=>e.action(r.row)}))),children:t(K,{})})}],Qe=({name:r,id:i,label:n,value:o,error:l=!1,helperText:a,disabled:s=!1,readonly:d=!0,labelList:c,icon:u,onSet:p,onView:h,onCreate:m,onRemove:g,onDelete:f})=>{const[y,x]=W(!1);let C;return C=d?t($e,{value:o,disabled:s,onCreate:m,onView:h,onDelete:f}):t(Ge,{value:o,disabled:s,onRemove:g}),e(w,{container:!0,item:!0,direction:"row",justifyContent:"stretch",alignContent:"stretch",children:[t(T,{sx:{padding:0},disabled:s||d,onFocusCapture:()=>x(!0),onBlur:()=>x(!1),onClick:p,children:t(b,{disabled:!p||s,name:r,id:i,label:n,error:l,helperText:a,focused:y,fullWidth:!0,value:c.join(" - "),className:d?"Mui-readOnly":void 0,sx:{":hover":{cursor:"pointer"},".MuiFilledInput-input:hover":{cursor:"pointer"}},InputProps:{readOnly:!0,startAdornment:t(v,{position:"start",children:u})}})}),C]})},$e=({value:i,disabled:n,onCreate:o,onDelete:l,onView:a})=>{let s;return s=me(i)?e(r,{children:[a&&t(k,{disabled:n,onClick:a,children:t(U,{})}),l&&t(k,{disabled:n,onClick:l,children:t(X,{})})]}):t(r,{children:o&&t(k,{disabled:n,onClick:o,children:t(Z,{})})}),t(r,{children:s})},Ge=({value:e,disabled:i,onRemove:n})=>{let o;return o=me(e)?t(r,{children:n&&t(k,{disabled:i,onClick:n,children:t(ee,{})})}):t(r,{}),t(r,{children:o})},Ye=z(),Je=z([]),Ke=()=>{const e=L(Ye);if(void 0===e)throw new Error("useJudoNavigation was used outside of its Provider");return e},Ue=({children:e})=>{const r=ae(),i=se(),[n,o]=W([]),[l,a]=W({});N((()=>{a((e=>({...e,key:"0."+i.pathname,path:i.pathname})))}),[]);const s={clearNavigate:e=>{o([]),a({key:"0."+e.toString(),label:null,path:e}),r(e)},navigate:e=>{if(null===l.label)throw Error("Page title has not been set!");o((e=>[...e,l])),a({key:n.length+"."+e.toString(),label:null,path:e}),r(e)},back:()=>{if(0!==n.length){const e=n[n.length-1];return a(e),o((e=>[...e.slice(0,e.length-1)])),void r(e.path)}o([]),a({key:"0."+"/".toString(),label:null,path:"/"}),r("/")},isBackDisabled:_((()=>0===n.length),[n]),setTitle:e=>{a((t=>({...t,label:e})))}};return t(Je.Provider,{value:n,children:t(Ye.Provider,{value:s,children:e})})},Xe=()=>{const r=L(Je);return e(F,{maxItems:2,separator:">",children:[t(te,{}),r.map((({label:e,key:r},i)=>t(x,{color:"text.primary",children:e},r)))]})},Ze={py:"2px",px:3,color:xe.palette.text.secondary,"&:hover, &:focus":{color:xe.palette.secondary.main},"&.Mui-selected":{color:xe.palette.secondary.main}};function et({children:e,to:r,...i}){const n=de(r),o=ce({path:n.pathname,end:!0}),{clearNavigate:l}=Ke();return t(S,{disablePadding:!0,style:{textDecoration:"none"},children:t(A,{selected:!!o,sx:Ze,onClick:()=>{l(r)},children:e})})}const tt=({title:i,children:n})=>{const{setTitle:o}=Ke();return N((()=>{o(i)}),[i]),e(r,{children:[t(D,{component:"div",position:"static",elevation:0,sx:{zIndex:0},children:t(B,{children:e(w,{container:!0,alignItems:"center",spacing:1,children:[t(w,{item:!0,xs:!0,children:t(x,{component:"span",color:"text.primary",variant:"h5",children:i})}),n]})})}),t(E,{})]})};export{Qe as AggregationInput,Ue as BreadcrumbProvider,ue as ConfirmationDialog,Xe as CustomBreadcrumb,et as CustomLink,qe as CustomTablePagination,_e as DialogProvider,Me as DropdownButton,Be as FilterDialog,Ee as PageDialog,tt as PageHeader,Le as RangeDialog,Ve as columnsActionCalculator,Ke as useJudoNavigation};
2
2
  //# sourceMappingURL=components.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"components.mjs","sources":["../../src/dialog/ConfirmationDialog.tsx","../../../components-api/dist/esm/components-api.mjs","../../../utilities/dist/esm/utilities.mjs","../../../theme/dist/esm/theme.mjs","../../../data-api-common/dist/esm/data-api-common.mjs","../../src/DropdownButton.tsx","../../src/TrinaryLogicCombobox.tsx","../../src/dialog/FilterDialog.tsx","../../src/dialog/PageDialog.tsx","../../src/CustomTablePagination.tsx","../../src/dialog/RangeDialog.tsx","../../src/dialog/DialogContext.tsx","../../src/table/table-row-actions.tsx","../../src/AggregationInput.tsx","../../src/CustomBreadcrumb.tsx","../../src/CustomLink.tsx","../../src/PageHeader.tsx"],"sourcesContent":["import { Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions, Button } from '@mui/material';\nimport { useEffect, useRef } from 'react';\nimport type { ConfirmationDialogProps } from '@judo/components-api';\n\nexport const ConfirmationDialog = ({\n confirmationMessage,\n title,\n resolve,\n open,\n handleClose,\n}: ConfirmationDialogProps) => {\n const descriptionElementRef = useRef<HTMLElement>(null);\n useEffect(() => {\n if (open) {\n const { current: descriptionElement } = descriptionElementRef;\n if (descriptionElement !== null) {\n descriptionElement.focus();\n }\n }\n }, [open]);\n\n const cancel = () => {\n handleClose();\n resolve(false);\n };\n\n const ok = () => {\n handleClose();\n resolve(true);\n };\n\n return (\n <Dialog open={open} onClose={handleClose} scroll=\"paper\" fullWidth={true} maxWidth={'xs'}>\n {title && <DialogTitle id=\"scroll-dialog-title\">{title}</DialogTitle>}\n <DialogContent dividers={!!title}>\n <DialogContentText id=\"scroll-dialog-description\" ref={descriptionElementRef} tabIndex={-1}>\n {confirmationMessage}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button variant=\"text\" onClick={cancel}>\n No\n </Button>\n <Button variant=\"text\" onClick={ok}>\n Yes\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n","const TRINARY_LOGIC = new Map([\n [null, 'Unknown'],\n [true, 'Yes'],\n [false, 'No'],\n]);\n\nvar FilterType;\n(function (FilterType) {\n FilterType[FilterType[\"boolean\"] = 0] = \"boolean\";\n FilterType[FilterType[\"numeric\"] = 1] = \"numeric\";\n FilterType[FilterType[\"string\"] = 2] = \"string\";\n FilterType[FilterType[\"enumeration\"] = 3] = \"enumeration\";\n FilterType[FilterType[\"date\"] = 4] = \"date\";\n FilterType[FilterType[\"dateTime\"] = 5] = \"dateTime\";\n // time,\n FilterType[FilterType[\"trinaryLogic\"] = 6] = \"trinaryLogic\";\n})(FilterType || (FilterType = {}));\n\nexport { FilterType, TRINARY_LOGIC };\n","const e=e=>null!=e,t=e=>e?e.toISOString().substring(0,10):e,r=(t,r,s)=>{if(!t||\"boolean\"!=typeof t.isAxiosError||!0!==t.isAxiosError)return void a(r);const n=t.response;if(e(n))if(n?.status)if(422===n?.status)r(o(t.response?.data).message,{variant:\"error\",preventDuplicate:!0,persist:!0});else{if(400===n?.status)return i(n.data,r,s);r(o(n?.data).message,{variant:\"error\",preventDuplicate:!0,persist:!0})}else a(r);else a(r)},i=(t,r,i)=>{if(e(t[0].location)){if(r(\"Please make sure all fields are filled in correctly.\",{variant:\"error\",preventDuplicate:!0,persist:!i?.duration,autoHideDuration:i?.duration??void 0}),void 0!==i?.setValidation){let e=new Map;t.forEach((t=>e.set(t.location,t.code))),i?.setValidation(e)}}else r(t[0].code,{variant:\"error\",preventDuplicate:!0,persist:!i?.duration,autoHideDuration:i?.duration??void 0})},a=e=>{e(\"Something went wrong. Please contact with the system admins.\",{variant:\"error\",preventDuplicate:!0,persist:!0})},o=e=>({message:e.code}),s=(e,t)=>{if(e.some((e=>e.filterOption.attributeName===t)))return e.filter((e=>e.filterOption.attributeName===t&&e.filterBy.value)).map((e=>({value:e.filterBy.value,operator:e.filterBy.operator})))},n=(e,...t)=>{let r={};for(const i of t)r[i]=s(e,i);return r};export{t as dateToJudoDateString,r as errorHandling,e as exists,n as mapAllFiltersToQueryCustomizerProperties,s as mapFiltersToQueryCustomizerProperty};\n//# sourceMappingURL=utilities.mjs.map\n","import{createTheme as e,alpha as o}from\"@mui/material\";const i={marginTop:8,marginBottom:8,display:\"flex\",flexDirection:\"column\",alignItems:\"center\"},t=e({palette:{mode:\"light\",primary:{main:\"#3C4166FF\"},secondary:{main:\"#E7501DFF\"},text:{primary:\"#17191DFF\",secondary:\"#434448FF\"},background:{default:\"#FAFAFAFF\"},subtitleColor:{main:\"#8c8c8c\"}},typography:{h5:{fontWeight:500,fontSize:26,letterSpacing:.5}},shape:{borderRadius:8},components:{MuiTab:{defaultProps:{disableRipple:!0}}},mixins:{toolbar:{minHeight:48}}}),r={...t,components:{MuiAppBar:{styleOverrides:{colorPrimary:{backgroundColor:t.palette.background.default}}},MuiButton:{defaultProps:{variant:\"contained\",size:\"small\"},styleOverrides:{root:{textTransform:\"none\",borderRadius:\"20px 20px 20px 20px\",paddingLeft:15,paddingRight:15},contained:{boxShadow:\"none\",\"&:active\":{boxShadow:\"none\"}},outlined:{border:\"2px solid\",fontWeight:\"bold\",\"&:hover\":{border:\"2px solid\",background:o(t.palette.primary.main,.15)}}}},MuiInputLabel:{styleOverrides:{root:{color:t.palette.subtitleColor.main,fontWeight:500,fontSize:16,\"&.Mui-focused\":{color:t.palette.subtitleColor.main}}}},MuiFilledInput:{styleOverrides:{input:{\"&:-webkit-autofill\":{WebkitBackgroundClip:\"text !important\"}},root:{background:\"inherit\",\"&.Mui-focused\":{background:\"inherit\"},\"&:hover:not(.Mui-disabled):not(.Mui-focused)\":{background:o(t.palette.secondary.main,.1)},\"&:hover:not(.Mui-disabled):before\":{borderBottom:\"none\"},\"&.Mui-focused .MuiInputAdornment-root .MuiSvgIcon-root\":{color:t.palette.secondary.main}}}},MuiTextField:{defaultProps:{fullWidth:!0,variant:\"filled\",color:\"secondary\"},styleOverrides:{root:{background:\"white\",\"& .MuiFilledInput-underline:before\":{borderBottom:\"none\"},\"&.Mui-readOnly:not(.Mui-disabled):not(.Mui-focused)\":{borderBottom:`1px solid ${o(t.palette.primary.main,.2)}`,background:\"transparent\"},\"&:not(.Mui-readOnly):not(.Mui-disabled)\":{boxShadow:\"0px 0px 8px 2px rgba(0,0,0,0.05)\",borderRadius:\"8px 8px 0 0\"}}}},MuiSelect:{styleOverrides:{filled:{\"&:focus\":{backgroundColor:\"white\"}}}},MuiDataGrid:{styleOverrides:{root:{border:\"none\"},toolbarContainer:{padding:\"8px 8px 4px 8px\"}}},MuiPaper:{styleOverrides:{rounded:{boxShadow:\"0px 0px 8px 1px rgba(0,0,0,0.05)\",borderRadius:16,padding:8}}},MuiDrawer:{styleOverrides:{paper:{border:\"none\",boxShadow:\"0px 0px 8px 1px rgba(0,0,0,0.05)\"}}},MuiTabs:{styleOverrides:{root:{marginLeft:t.spacing(1)},indicator:{height:3,borderTopLeftRadius:3,borderTopRightRadius:3,backgroundColor:t.palette.common.white}}},MuiTab:{styleOverrides:{root:{textTransform:\"none\",margin:\"0 16px\",minWidth:0,padding:0,[t.breakpoints.up(\"md\")]:{padding:0,minWidth:0}}}},MuiIconButton:{styleOverrides:{root:{color:t.palette.secondary.main,padding:t.spacing(1)}}},MuiTooltip:{styleOverrides:{tooltip:{borderRadius:4}}},MuiDivider:{styleOverrides:{root:{backgroundColor:\"rgb(255,255,255,0.15)\"},middle:{marginTop:8,marginBottom:8}}},MuiListItemButton:{defaultProps:{disableTouchRipple:!0}},MuiListItemText:{styleOverrides:{primary:{fontSize:14,fontWeight:t.typography.fontWeightMedium}}},MuiListItemIcon:{styleOverrides:{root:{color:\"inherit\",minWidth:\"auto\",marginRight:t.spacing(2),\"& svg\":{fontSize:20}}}},MuiAvatar:{styleOverrides:{root:{width:32,height:32}}},MuiCard:{styleOverrides:{root:{width:\"100%\",length:\"100%\",padding:10}}}}};export{i as mainContainerPadding,r as theme,t as themeBase};\n//# sourceMappingURL=theme.mjs.map\n","var a,e,l,r;!function(a){a.equals=\"equals\"}(a||(a={})),function(a){a.equals=\"equals\",a.notEquals=\"notEquals\"}(e||(e={})),function(a){a.lessThan=\"lessThan\",a.greaterThan=\"greaterThan\",a.lessOrEqual=\"lessOrEqual\",a.greaterOrEqual=\"greaterOrEqual\",a.equal=\"equal\",a.notEqual=\"notEqual\"}(l||(l={})),function(a){a.lessThan=\"lessThan\",a.greaterThan=\"greaterThan\",a.lessOrEqual=\"lessOrEqual\",a.greaterOrEqual=\"greaterOrEqual\",a.equal=\"equal\",a.notEqual=\"notEqual\",a.matches=\"matches\",a.like=\"like\"}(r||(r={}));export{a as _BooleanOperation,e as _EnumerationOperation,l as _NumericOperation,r as _StringOperation};\n//# sourceMappingURL=data-api-common.mjs.map\n","import { Button, ClickAwayListener, Grow, MenuItem, MenuList, Paper, Popper } from '@mui/material';\nimport { useState, useRef, useEffect } from 'react';\nimport type { ReactNode, KeyboardEvent, SyntheticEvent } from 'react';\nimport { KeyboardArrowDown } from '@mui/icons-material';\n\ninterface DropdownMenuItem {\n disabled?: boolean;\n visible?: boolean;\n label?: string;\n onClick: () => void;\n startIcon?: ReactNode;\n endIcon?: ReactNode;\n}\n\ninterface DropdownButtonProps {\n children?: ReactNode;\n id?: string | undefined;\n menuItems: DropdownMenuItem[];\n disabled?: boolean;\n showDropdownIcon?: boolean;\n fullWidth?: boolean;\n variant?: 'text' | 'outlined' | 'contained' | undefined;\n}\n\nexport function DropdownButton({\n children,\n id,\n menuItems,\n disabled = false,\n showDropdownIcon = true,\n fullWidth = false,\n variant = 'contained',\n}: DropdownButtonProps) {\n const [open, setOpen] = useState(false);\n const anchorRef = useRef<HTMLButtonElement>(null);\n\n const handleToggle = () => {\n setOpen((prevOpen) => !prevOpen);\n };\n\n const handleClose = (event: Event | SyntheticEvent) => {\n if (anchorRef.current && anchorRef.current.contains(event.target as HTMLElement)) {\n return;\n }\n\n setOpen(false);\n };\n\n function handleListKeyDown(event: KeyboardEvent) {\n if (event.key === 'Tab') {\n event.preventDefault();\n setOpen(false);\n } else if (event.key === 'Escape') {\n setOpen(false);\n }\n }\n\n // return focus to the button when we transitioned from !open -> open\n const prevOpen = useRef(open);\n useEffect(() => {\n if (prevOpen.current && !open) {\n anchorRef.current!.focus();\n }\n\n prevOpen.current = open;\n }, [open]);\n\n return (\n <>\n <Button\n ref={anchorRef}\n id={id}\n onClick={handleToggle}\n endIcon={showDropdownIcon && <KeyboardArrowDown />}\n disabled={disabled}\n fullWidth={fullWidth}\n variant={variant}\n >\n {children}\n </Button>\n <Popper\n open={open}\n anchorEl={anchorRef.current}\n placement=\"bottom\"\n transition\n style={{ zIndex: 1400, minWidth: anchorRef.current?.scrollWidth }}\n >\n {({ TransitionProps, placement }) => (\n <Grow\n {...TransitionProps}\n style={{\n transformOrigin: placement === 'bottom-start' ? 'left top' : 'left bottom',\n }}\n >\n <Paper>\n <ClickAwayListener onClickAway={handleClose}>\n <MenuList autoFocusItem={open} onKeyDown={handleListKeyDown}>\n {menuItems\n .filter((menuItem) => menuItem.visible ?? true)\n .map((menuItem, index) => {\n return (\n <MenuItem\n id={menuItem.label ?? '' + index}\n disabled={menuItem.disabled ?? false}\n onClick={(event) => {\n handleClose(event);\n menuItem.onClick();\n }}\n >\n {menuItem.startIcon}\n {menuItem.label}\n {menuItem.endIcon}\n </MenuItem>\n );\n })}\n </MenuList>\n </ClickAwayListener>\n </Paper>\n </Grow>\n )}\n </Popper>\n </>\n );\n}\n","import { CheckBoxOutlined } from '@mui/icons-material';\nimport { TextField, InputAdornment, MenuItem } from '@mui/material';\nimport type { ChangeEvent } from 'react';\nimport { TRINARY_LOGIC } from '@judo/components-api';\n\ninterface TrinaryLogicProps {\n readOnly?: boolean;\n value?: boolean | null;\n id?: string;\n label: string;\n name?: string;\n error?: boolean | undefined;\n helperText?: string | undefined;\n onChange?: (value: boolean | null) => void;\n}\n\nconst TrinaryLogicCombobox = ({\n readOnly = false,\n value = null,\n id,\n label,\n name,\n error,\n helperText,\n onChange,\n}: TrinaryLogicProps) => {\n const onChangeHandler = onChange\n ? (event: ChangeEvent<HTMLTextAreaElement | HTMLInputElement>) => {\n const index = Array.from(TRINARY_LOGIC.values()).indexOf(event.target.value);\n const keysArray = Array.from(TRINARY_LOGIC.keys());\n onChange(keysArray[index]);\n }\n : undefined;\n\n return (\n <TextField\n name={name}\n id={id}\n label={label}\n select\n value={TRINARY_LOGIC.get(value)}\n onChange={onChangeHandler}\n className={readOnly ? 'Mui-readOnly' : undefined}\n error={error}\n helperText={helperText}\n InputProps={{\n readOnly: readOnly,\n startAdornment: (\n <InputAdornment position=\"start\">\n <CheckBoxOutlined />\n </InputAdornment>\n ),\n }}\n >\n {Array.from(TRINARY_LOGIC.keys()).map((key) => (\n <MenuItem key={TRINARY_LOGIC.get(key)} value={TRINARY_LOGIC.get(key)}>\n {TRINARY_LOGIC.get(key)}\n </MenuItem>\n ))}\n </TextField>\n );\n};\n\nexport default TrinaryLogicCombobox;\n","import { mdiCalendarClock, mdiCalendarMonth, mdiFormatTextVariant, mdiNumeric } from '@mdi/js';\nimport Icon from '@mdi/react';\nimport { Close } from '@mui/icons-material';\nimport {\n Dialog,\n DialogTitle,\n DialogContent,\n DialogContentText,\n DialogActions,\n Button,\n Slide,\n Box,\n Container,\n Grid,\n TextField,\n MenuItem,\n Checkbox,\n FormControlLabel,\n InputAdornment,\n IconButton,\n Typography,\n} from '@mui/material';\nimport type { TransitionProps } from '@mui/material/transitions';\nimport { DatePicker, DateTimePicker } from '@mui/x-date-pickers';\nimport { forwardRef, useEffect, useRef, useState } from 'react';\nimport type { ChangeEvent, ReactElement, Ref } from 'react';\nimport type {\n Filter,\n FilterDialogProps,\n FilterInputProps,\n FilterOperatorProps,\n FilterProps,\n Operation,\n} from '@judo/components-api';\nimport { FilterType } from '@judo/components-api';\nimport { dateToJudoDateString, exists } from '@judo/utilities';\nimport { mainContainerPadding } from '@judo/theme';\nimport { _BooleanOperation, _EnumerationOperation, _NumericOperation, _StringOperation } from '@judo/data-api-common';\nimport { DropdownButton } from '../DropdownButton';\nimport TrinaryLogicCombobox from '../TrinaryLogicCombobox';\n\nconst getDefaultOperator = (filterType: FilterType) => {\n switch (filterType) {\n case FilterType.boolean:\n return _BooleanOperation['equals'];\n case FilterType.date:\n return _NumericOperation['equal'];\n case FilterType.dateTime:\n return _NumericOperation['equal'];\n // case FilterType.time:\n // return _NumericOperation['equal'];\n case FilterType.enumeration:\n return _EnumerationOperation['equals'];\n case FilterType.numeric:\n return _NumericOperation['equal'];\n case FilterType.string:\n return _StringOperation['equal'];\n case FilterType.trinaryLogic:\n return _BooleanOperation['equals'];\n }\n};\n\nconst getOperationEnumValue = (filter: Filter, operator: string) => {\n switch (filter.filterOption.filterType) {\n case FilterType.boolean:\n return _BooleanOperation[operator as keyof typeof _BooleanOperation];\n case FilterType.date:\n return _NumericOperation[operator as keyof typeof _NumericOperation];\n case FilterType.dateTime:\n return _NumericOperation[operator as keyof typeof _NumericOperation];\n // case FilterType.time:\n // return _NumericOperation[operator as keyof typeof _NumericOperation];\n case FilterType.enumeration:\n return _EnumerationOperation[operator as keyof typeof _BooleanOperation];\n case FilterType.numeric:\n return _NumericOperation[operator as keyof typeof _NumericOperation];\n case FilterType.string:\n return _StringOperation[operator as keyof typeof _StringOperation];\n case FilterType.trinaryLogic:\n return _BooleanOperation[operator as keyof typeof _BooleanOperation];\n }\n};\n\nconst getOperatorsByFilter = (filter: Filter): string[] => {\n switch (filter.filterOption.filterType) {\n case FilterType.boolean:\n return Object.values(_BooleanOperation);\n case FilterType.date:\n return Object.values(_NumericOperation);\n case FilterType.dateTime:\n return Object.values(_NumericOperation);\n // case FilterType.time:\n // return Object.values(_NumericOperation);\n case FilterType.enumeration:\n return Object.values(_EnumerationOperation);\n case FilterType.numeric:\n return Object.values(_NumericOperation);\n case FilterType.string:\n return Object.values(_StringOperation);\n case FilterType.trinaryLogic:\n return Object.values(_BooleanOperation);\n }\n};\n\nconst FilterOperator = ({ filter, setFilterOperator }: FilterOperatorProps) => {\n const onChangeHandler = (event: ChangeEvent<HTMLTextAreaElement | HTMLInputElement>) => {\n setFilterOperator(filter, getOperationEnumValue(filter, event.target.value));\n };\n\n return (\n <TextField\n name={'operation'}\n id={'operation'}\n label={'Operation'}\n select\n value={filter.filterBy.operator}\n onChange={onChangeHandler}\n >\n {getOperatorsByFilter(filter).map((item) => (\n <MenuItem key={item} value={item}>\n {/* TODO: do not forget localization here*/}\n {item}\n </MenuItem>\n ))}\n </TextField>\n );\n};\n\nconst FilterInput = ({ filter, setFilterValue }: FilterInputProps) => {\n if (filter.filterOption.filterType === FilterType.enumeration && !exists(filter.filterOption.enumValues)) {\n throw new Error(`Missing enumValues from FilterOptions of ${filter.filterOption.attributeName}`);\n }\n\n return (\n <>\n {(() => {\n switch (filter.filterOption.filterType) {\n case FilterType.boolean:\n return (\n <FormControlLabel\n control={\n <Checkbox\n checked={!!filter.filterBy.value}\n onChange={(event) => setFilterValue(filter, !!event.target.value)}\n />\n }\n label={filter.filterOption.attributeName}\n />\n );\n case FilterType.date:\n return (\n <DatePicker\n renderInput={(props) => <TextField {...props} />}\n label={filter.filterOption.attributeName}\n value={filter.filterBy.value ?? null}\n onChange={(newValue) => setFilterValue(filter, dateToJudoDateString(newValue))}\n InputProps={{\n startAdornment: (\n <InputAdornment position=\"start\">\n <Icon path={mdiCalendarMonth} size={1} />\n </InputAdornment>\n ),\n }}\n />\n );\n case FilterType.dateTime:\n return (\n <DateTimePicker\n renderInput={(props) => <TextField {...props} />}\n label={filter.filterOption.attributeName}\n value={filter.filterBy.value ?? null}\n onChange={(newValue) => setFilterValue(filter, newValue)}\n InputProps={{\n startAdornment: (\n <InputAdornment position=\"start\">\n <Icon path={mdiCalendarClock} size={1} />\n </InputAdornment>\n ),\n }}\n />\n );\n // case FilterType.time:\n // return (\n // <TextField\n // label={filter.filterOption.attributeName}\n // value={filter.filterBy.value}\n // onChange={(event) => setFilterValue(filter, event.target.value)}\n // InputProps={{\n // startAdornment: (\n // <InputAdornment position=\"start\">\n // <Icon path={mdiClockOutline} size={1} />\n // </InputAdornment>\n // ),\n // }}\n // />\n // );\n case FilterType.enumeration:\n return (\n <TextField\n label={filter.filterOption.attributeName}\n value={filter.filterBy.value}\n select\n onChange={(event) => setFilterValue(filter, event.target.value)}\n >\n {filter.filterOption.enumValues?.map((item) => (\n <MenuItem key={item} value={item}>\n {item}\n </MenuItem>\n ))}\n </TextField>\n );\n case FilterType.numeric:\n return (\n <TextField\n label={filter.filterOption.attributeName}\n type=\"number\"\n value={filter.filterBy.value}\n onChange={(event) => setFilterValue(filter, Number(event.target.value))}\n InputProps={{\n startAdornment: (\n <InputAdornment position=\"start\">\n <Icon path={mdiNumeric} size={1} />\n </InputAdornment>\n ),\n }}\n />\n );\n case FilterType.string:\n return (\n <TextField\n label={filter.filterOption.attributeName}\n value={filter.filterBy.value}\n onChange={(event) => setFilterValue(filter, event.target.value)}\n InputProps={{\n startAdornment: (\n <InputAdornment position=\"start\">\n <Icon path={mdiFormatTextVariant} size={1} />\n </InputAdornment>\n ),\n }}\n />\n );\n case FilterType.trinaryLogic:\n return (\n <TrinaryLogicCombobox\n label={filter.filterOption.attributeName}\n value={filter.filterBy.value}\n onChange={(value) => setFilterValue(filter, value)}\n />\n );\n }\n })()}\n </>\n );\n};\n\nconst FilterRow = ({ filter, closeHandler, setFilterOperator, setFilterValue }: FilterProps) => {\n return (\n <Grid item container spacing={2} alignItems={'center'}>\n <Grid item xs={4}>\n {filter && <FilterOperator filter={filter} setFilterOperator={setFilterOperator} />}\n </Grid>\n <Grid item xs={7}>\n {filter && <FilterInput filter={filter} setFilterValue={setFilterValue} />}\n </Grid>\n <Grid item xs={1}>\n <IconButton onClick={() => closeHandler(filter)}>\n <Close />\n </IconButton>\n </Grid>\n </Grid>\n );\n};\n\nconst Transition = forwardRef(function Transition(\n props: TransitionProps & {\n children: ReactElement<any, any>;\n },\n ref: Ref<unknown>,\n) {\n return <Slide direction=\"left\" ref={ref} {...props} />;\n});\n\nexport const FilterDialog = ({ filters, filterOptions, resolve, open, handleClose }: FilterDialogProps) => {\n const descriptionElementRef = useRef<HTMLElement>(null);\n const [tempFilters, setTempFilters] = useState<Filter[]>(filters ?? []);\n\n useEffect(() => {\n if (open) {\n const { current: descriptionElement } = descriptionElementRef;\n if (descriptionElement !== null) {\n descriptionElement.focus();\n }\n }\n }, [open]);\n\n const updateFilterValue = (filter: Filter, value: any) => {\n setTempFilters((prevTempFilters) => {\n return prevTempFilters.map((tempFilter) => {\n if (filter.id === tempFilter.id) {\n return {\n ...tempFilter,\n filterBy: { value: value, operator: tempFilter.filterBy.operator },\n };\n }\n\n return tempFilter;\n });\n });\n };\n\n const updateFilterOperator = (filter: Filter, operator: Operation) => {\n setTempFilters((prevTempFilters) => {\n return prevTempFilters.map((tempFilter) => {\n if (filter.id === tempFilter.id) {\n return {\n ...tempFilter,\n filterBy: { value: tempFilter.filterBy.value, operator: operator },\n };\n }\n\n return tempFilter;\n });\n });\n };\n\n const filterCloseHandler = (filter: Filter) => {\n setTempFilters((prevTempFilters) => [...prevTempFilters.filter((tempFilter) => tempFilter.id !== filter.id)]);\n };\n\n const cancel = () => {\n handleClose();\n resolve(undefined);\n };\n\n const ok = () => {\n handleClose();\n resolve(tempFilters);\n };\n\n return (\n <Dialog\n open={open}\n onClose={cancel}\n scroll=\"paper\"\n TransitionComponent={Transition}\n disableEnforceFocus\n fullWidth\n maxWidth=\"sm\"\n sx={{\n '& .MuiDialog-container': {\n justifyContent: 'flex-end',\n },\n }}\n PaperProps={{\n sx: {\n m: 0,\n height: '100%',\n },\n }}\n >\n <DialogTitle id=\"scroll-dialog-title\">\n <Typography component=\"span\" color=\"text.primary\" variant=\"h5\">\n Filters\n </Typography>\n </DialogTitle>\n <DialogContent dividers={true}>\n <DialogContentText id=\"scroll-dialog-description\" ref={descriptionElementRef} tabIndex={-1}>\n <Container component=\"main\" maxWidth=\"xs\">\n <Box sx={mainContainerPadding}>\n <Grid container spacing={2}>\n {tempFilters.map((filter) => (\n <FilterRow\n key={filter.id}\n filter={filter}\n closeHandler={filterCloseHandler}\n setFilterOperator={updateFilterOperator}\n setFilterValue={updateFilterValue}\n />\n ))}\n <Grid item container>\n <DropdownButton\n fullWidth={true}\n showDropdownIcon={false}\n menuItems={filterOptions.map((filterOption) => {\n return {\n label: filterOption.label ?? filterOption.attributeName,\n onClick: () =>\n setTempFilters((prevTempFilters) => [\n ...prevTempFilters,\n {\n id: prevTempFilters.length,\n filterOption: {\n attributeName: filterOption.attributeName,\n label: filterOption.label,\n filterType: filterOption.filterType,\n },\n filterBy: {\n operator: getDefaultOperator(filterOption.filterType),\n },\n },\n ]),\n };\n })}\n >\n Add new filter\n </DropdownButton>\n </Grid>\n </Grid>\n </Box>\n </Container>\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button fullWidth variant=\"outlined\" onClick={cancel}>\n Cancel\n </Button>\n <Button fullWidth onClick={ok}>\n Apply {'(' + tempFilters.length + ')'}\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n","import { Dialog, DialogContent, DialogContentText, DialogActions, Button } from '@mui/material';\nimport { useEffect, useRef } from 'react';\nimport type { ReactNode } from 'react';\n\ninterface PageDialogProps {\n page: ReactNode;\n open: boolean;\n handleClose: () => void;\n resolve: () => void;\n}\n\nexport const PageDialog = ({ page, open, handleClose, resolve }: PageDialogProps) => {\n const descriptionElementRef = useRef<HTMLElement>(null);\n useEffect(() => {\n if (open) {\n const { current: descriptionElement } = descriptionElementRef;\n if (descriptionElement !== null) {\n descriptionElement.focus();\n }\n }\n }, [open]);\n\n const ok = () => {\n resolve();\n handleClose();\n };\n\n return (\n <Dialog open={open} onClose={ok} scroll=\"paper\">\n <DialogContent dividers={true}>\n <DialogContentText ref={descriptionElementRef} tabIndex={-1}>\n {page}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button onClick={ok}>Ok</Button>\n </DialogActions>\n </Dialog>\n );\n};\n","import { TablePagination } from '@mui/material';\nimport type { MouseEvent, Dispatch, SetStateAction } from 'react';\n\nexport interface CustomTablePaginationProps {\n pageChange: (isNext: boolean) => Promise<void>;\n isNextButtonEnabled: boolean;\n page: number;\n rowPerPage: number;\n setPage: Dispatch<SetStateAction<number>>;\n}\n\nexport const CustomTablePagination = (props: CustomTablePaginationProps) => {\n const handleChangePage = async (event: MouseEvent<HTMLButtonElement> | null, newPage: number) => {\n let isNext = true;\n if (newPage < props.page) {\n isNext = false;\n }\n\n props.setPage(newPage);\n\n await props.pageChange(isNext);\n };\n\n return (\n <TablePagination\n component=\"div\"\n count={-1}\n page={props.page}\n onPageChange={handleChangePage}\n rowsPerPage={props.rowPerPage}\n rowsPerPageOptions={[props.rowPerPage]}\n labelDisplayedRows={({ from, to }) => `${from}–${to}`}\n nextIconButtonProps={{\n disabled: !props.isNextButtonEnabled,\n }}\n backIconButtonProps={{\n disabled: props.page === 0,\n }}\n />\n );\n};\n","import { Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions, Button } from '@mui/material';\nimport {\n GridSortModel,\n GridRowModel,\n DataGrid,\n GridRowParams,\n GridColumns,\n GridSortItem,\n GridSelectionModel,\n GridToolbarContainer,\n GridRowId,\n} from '@mui/x-data-grid';\nimport { useSnackbar } from 'notistack';\nimport { useEffect, useRef, useState } from 'react';\nimport type { JudoStored, QueryCustomizer } from '@judo/data-api-common';\nimport type { Filter, FilterOption } from '@judo/components-api';\nimport { errorHandling } from '@judo/utilities';\nimport { CustomTablePagination } from '../CustomTablePagination';\nimport { useFilterDialog } from './DialogContext';\n\ninterface RangeDialogProps<T extends JudoStored<T>, U extends QueryCustomizer<T>> {\n resolve: (value: any) => void;\n open: boolean;\n handleClose: () => void;\n single?: boolean;\n columns: GridColumns<T>;\n defaultSortField: GridSortItem;\n rangeCall: (queryCustomizer: U) => Promise<Array<T>>;\n alreadySelectedItems: GridSelectionModel | GridRowId;\n initalQueryCustomizer: U;\n filterOptions: FilterOption[];\n}\n\nexport const RangeDialog = <T extends JudoStored<T>, U extends QueryCustomizer<T>>({\n resolve,\n open,\n handleClose,\n single = false,\n columns,\n defaultSortField,\n rangeCall,\n alreadySelectedItems,\n initalQueryCustomizer,\n filterOptions,\n}: RangeDialogProps<T, U>) => {\n const { openFilterDialog } = useFilterDialog();\n const { enqueueSnackbar } = useSnackbar();\n\n const descriptionElementRef = useRef<HTMLElement>(null);\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [rowCount, setRowCount] = useState<number>(0);\n const [sortModel, setSortModel] = useState<GridSortModel>([defaultSortField]);\n const [lastItem, setLastItem] = useState<T>();\n const [firstItem, setFirstItem] = useState<T>();\n const [isNextButtonEnabled, setIsNextButtonEnabled] = useState<boolean>(true);\n const [page, setPage] = useState<number>(0);\n const [data, setData] = useState<GridRowModel<T>[]>([]);\n const [selectionModel, setSelectionModel] = useState<GridSelectionModel | GridRowId | undefined>(\n alreadySelectedItems ?? (single ? undefined : []),\n );\n const [selectedItems, setSelectedItems] = useState<T[] | T | undefined>([]);\n const [filters, setFilters] = useState<Filter[]>([]);\n const [queryCustomizer, setQueryCustomizer] = useState<U>({\n ...initalQueryCustomizer,\n _seek: {\n limit: 6,\n },\n });\n\n const handlePageChange = async (isNext: boolean) => {\n setQueryCustomizer((prevQueryCustomizer) => {\n return {\n ...prevQueryCustomizer,\n _seek: {\n limit: isNext ? 6 : 5,\n reverse: !isNext,\n lastItem: isNext ? lastItem : firstItem,\n },\n };\n });\n\n setIsNextButtonEnabled(!isNext);\n };\n\n const fetchData = async () => {\n setIsLoading(true);\n try {\n const res = await rangeCall(queryCustomizer);\n\n if (res.length > 5) {\n setIsNextButtonEnabled(true);\n res.pop();\n } else if (queryCustomizer._seek?.limit === 6) {\n setIsNextButtonEnabled(false);\n }\n\n setData(res);\n setFirstItem(res[0]);\n setLastItem(res[res.length - 1]);\n setRowCount(res.length || 0);\n } catch (error) {\n errorHandling(error, enqueueSnackbar);\n }\n setIsLoading(false);\n };\n\n const handleFiltersChange = (newFilters: Filter[]) => {\n setPage(0);\n setFilters(newFilters);\n\n // @ts-ignore\n setQueryCustomizer((prevQueryCustomizer) => {\n const tempQueryCustomizer = { ...prevQueryCustomizer };\n\n filterOptions.forEach(\n (filter) =>\n // @ts-ignore\n (tempQueryCustomizer[filter.attributeName] = mapFiltersToQueryCustomizerProperty(\n newFilters,\n filter.attributeName,\n )),\n );\n\n return {\n ...prevQueryCustomizer,\n _seek: {\n lastItem: undefined,\n limit: 6,\n reverse: undefined,\n },\n ...tempQueryCustomizer,\n };\n });\n };\n\n const handleSortModelChange = (newModel: GridSortModel) => {\n setPage(0);\n setSortModel(newModel);\n\n const { field, sort } = newModel[0];\n\n setQueryCustomizer((prevQueryCustomizer) => {\n return {\n ...prevQueryCustomizer,\n _orderBy: [{ attribute: field, descending: sort === 'desc' }],\n };\n });\n };\n\n // useEffect(() => {\n // setPage(0);\n // const { field, sort } = sortModel[0];\n\n // setQueryCustomizer((prevQueryCustomizer) => {\n // const tempQueryCustomizer = { ...prevQueryCustomizer };\n\n // filterOptions.forEach(\n // (filter) =>\n // // @ts-ignore\n // (tempQueryCustomizer[filter.attributeName] = mapFiltersToQueryCustomizerProperty(\n // filters,\n // filter.attributeName,\n // )),\n // );\n\n // return {\n // ...prevQueryCustomizer,\n // _seek: {\n // lastItem: undefined,\n // limit: 6,\n // reverse: undefined,\n // },\n // _orderBy: [{ attribute: field, descending: sort === 'desc' }],\n // ...tempQueryCustomizer,\n // };\n // });\n // }, [sortModel, filters]);\n\n useEffect(() => {\n fetchData();\n }, [queryCustomizer]);\n\n useEffect(() => {\n if (open) {\n const { current: descriptionElement } = descriptionElementRef;\n if (descriptionElement !== null) {\n descriptionElement.focus();\n }\n }\n }, [open]);\n\n const cancel = () => {\n handleClose();\n resolve(undefined);\n };\n\n const ok = () => {\n handleClose();\n resolve(selectedItems);\n };\n\n const handleOnSelection = (newSelectionModel: GridSelectionModel) => {\n if (!Array.isArray(selectionModel)) return;\n\n // added new items\n if (newSelectionModel.length > selectionModel.length) {\n const diff = newSelectionModel.length - selectionModel.length;\n const newItemsId = [...newSelectionModel].slice(diff * -1);\n const newItems = data.filter((value) => newItemsId.indexOf(value.__identifier as GridRowId) !== -1);\n setSelectedItems((prevSelectedItems) => {\n if (!Array.isArray(prevSelectedItems)) return;\n\n return [...prevSelectedItems, ...newItems];\n });\n }\n\n // removed items\n if (newSelectionModel.length < selectionModel.length) {\n const removedItemsId = selectionModel.filter((value) => newSelectionModel.indexOf(value) === -1);\n setSelectedItems((prevSelectedItems) => {\n if (!Array.isArray(prevSelectedItems)) return;\n\n return [...prevSelectedItems.filter((value) => removedItemsId.indexOf(value.__identifier as GridRowId) === -1)];\n });\n }\n\n setSelectionModel(newSelectionModel);\n };\n\n const handleSingleOnSelection = (newSelectionModel: GridSelectionModel) => {\n if (Array.isArray(selectionModel)) return;\n\n if (newSelectionModel.length === 0) {\n setSelectionModel('');\n setSelectedItems(undefined);\n return;\n }\n\n const lastId = newSelectionModel[newSelectionModel.length - 1];\n\n setSelectionModel(lastId);\n setSelectedItems(data.find((value) => value.__identifier === lastId));\n };\n\n const handleIsRowSelectable = (params: GridRowParams<T>) => {\n if (alreadySelectedItems) {\n if (!Array.isArray(alreadySelectedItems)) throw Error('Range dialog gets wrong alreadySelectedItems.');\n\n return !alreadySelectedItems.includes(params.id);\n }\n\n return true;\n };\n\n return (\n <Dialog open={open} onClose={cancel} scroll=\"paper\" fullWidth={true} maxWidth={'sm'}>\n <DialogTitle id=\"scroll-dialog-title\">Select</DialogTitle>\n <DialogContent dividers={true}>\n <DialogContentText id=\"scroll-dialog-description\" ref={descriptionElementRef} tabIndex={-1}>\n <DataGrid\n sx={\n single\n ? {\n '.MuiDataGrid-columnHeaderCheckbox .MuiDataGrid-columnHeaderTitleContainer': {\n display: 'none',\n },\n }\n : undefined\n }\n autoHeight\n getRowId={(row: T) => row.__identifier as GridRowId}\n loading={isLoading}\n paginationMode=\"server\"\n rows={data}\n rowCount={rowCount}\n sortingOrder={['desc', 'asc']}\n sortingMode=\"server\"\n sortModel={sortModel}\n onSortModelChange={handleSortModelChange}\n checkboxSelection\n onSelectionModelChange={!single ? handleOnSelection : handleSingleOnSelection}\n isRowSelectable={!single ? handleIsRowSelectable : undefined}\n selectionModel={selectionModel}\n hideFooterSelectedRowCount={single}\n columns={columns}\n keepNonExistentRowsSelected\n components={{\n Toolbar: () => (\n <GridToolbarContainer>\n <Button\n variant=\"outlined\"\n onClick={async () => {\n const newFilters = await openFilterDialog(filterOptions, filters);\n\n if (newFilters) {\n handleFiltersChange(newFilters);\n }\n }}\n disabled={isLoading}\n >\n Set filters {filters.length !== 0 ? '(' + filters.length + ')' : ''}\n </Button>\n </GridToolbarContainer>\n ),\n Pagination: () => (\n <CustomTablePagination\n pageChange={handlePageChange}\n isNextButtonEnabled={isNextButtonEnabled}\n page={page}\n setPage={setPage}\n rowPerPage={5}\n />\n ),\n }}\n />\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button onClick={cancel}>Cancel</Button>\n <Button onClick={ok}>Ok</Button>\n </DialogActions>\n </Dialog>\n );\n};\n","import { createContext, useContext, useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { ConfirmationDialog } from './ConfirmationDialog';\nimport { FilterDialog } from './FilterDialog';\nimport { PageDialog } from './PageDialog';\nimport { RangeDialog } from './RangeDialog';\nimport type {\n ConfirmDialogProviderContext,\n DialogProviderProps,\n FilterDialogProviderContext,\n OpenRangeDialogProps,\n PageDialogProviderContext,\n RangeDialogProviderContext,\n} from '@judo/components-api';\nimport type { Filter, FilterOption } from '@judo/components-api';\nimport type { JudoStored, QueryCustomizer } from '@judo/data-api-common';\n\n// @ts-ignore\nconst PageDialogContextState = createContext<PageDialogProviderContext>();\n\n// @ts-ignore\nconst ConfirmDialogContextState = createContext<ConfirmDialogProviderContext>();\n\n// @ts-ignore\nconst RangeDialogContextState = createContext<RangeDialogProviderContext>();\n\n// @ts-ignore\nconst FilterDialogContextState = createContext<FilterDialogProviderContext>();\n\nconst usePageDialog = () => {\n const context = useContext(PageDialogContextState);\n\n if (context === undefined) {\n throw new Error('useConfirmDialog was used outside of its Provider');\n }\n\n return context;\n};\n\nconst useConfirmDialog = () => {\n const context = useContext(ConfirmDialogContextState);\n\n if (context === undefined) {\n throw new Error('useConfirmDialog was used outside of its Provider');\n }\n\n return context;\n};\n\nconst useRangeDialog = () => {\n const context = useContext(RangeDialogContextState);\n\n if (context === undefined) {\n throw new Error('useRangeDialog was used outside of its Provider');\n }\n\n return context;\n};\n\nconst useFilterDialog = () => {\n const context = useContext(FilterDialogContextState);\n\n if (context === undefined) {\n throw new Error('useFilterDialog was used outside of its Provider');\n }\n\n return context;\n};\n\nconst DialogProvider = ({ children }: DialogProviderProps) => {\n // Page Dialog\n const [isOpenPageDialog, setIsOpenPageDialog] = useState(false);\n const [pageDialog, setPageDialog] = useState<ReactNode>();\n\n const handleClosePageDialog = () => {\n setIsOpenPageDialog(false);\n };\n\n const handleOpenPageDialog = async (page: ReactNode) => {\n setIsOpenPageDialog(true);\n return new Promise<void>((resolve) => {\n setPageDialog(<PageDialog page={page} handleClose={handleClosePageDialog} open={true} resolve={resolve} />);\n });\n };\n\n const pageDialogContext: PageDialogProviderContext = {\n openPageDialog: handleOpenPageDialog,\n };\n\n // Range Dialog\n const [isOpenRangeDialog, setIsOpenRangeDialog] = useState(false);\n const [rangeDialog, setRangeDialog] = useState<ReactNode>();\n\n const handleCloseRangeDialog = () => {\n setIsOpenRangeDialog(false);\n };\n\n const handleOpenRangeDialog = async <T extends JudoStored<T>, U extends QueryCustomizer<T>>({\n columns,\n defaultSortField,\n rangeCall,\n single = false,\n alreadySelectedItems,\n filterOptions,\n initialQueryCustomizer,\n }: OpenRangeDialogProps<T, U>) => {\n setIsOpenRangeDialog(true);\n\n return new Promise<T[] | T>((resolve) => {\n setRangeDialog(\n <RangeDialog<T, U>\n handleClose={handleCloseRangeDialog}\n open={true}\n resolve={resolve}\n columns={columns}\n defaultSortField={defaultSortField}\n rangeCall={rangeCall}\n single={single}\n alreadySelectedItems={alreadySelectedItems}\n filterOptions={filterOptions}\n initalQueryCustomizer={initialQueryCustomizer}\n />,\n );\n });\n };\n\n const customDialogContext: RangeDialogProviderContext = {\n openRangeDialog: handleOpenRangeDialog,\n };\n\n // Confirmation Dialog\n const [isOpenConfirmDialog, setIsOpenConfirmDialog] = useState(false);\n const [confirmDialog, setConfirmDialog] = useState<ReactNode>();\n\n const handleCloseConfirmDialog = () => {\n setIsOpenConfirmDialog(false);\n return false;\n };\n\n const handleOpenConfirmDialog = async (confirmationMessage: string | ReactNode, title?: string | ReactNode) => {\n setIsOpenConfirmDialog(true);\n\n return new Promise<boolean>((resolve) => {\n setConfirmDialog(\n <ConfirmationDialog\n confirmationMessage={confirmationMessage}\n title={title}\n handleClose={handleCloseConfirmDialog}\n open={true}\n resolve={resolve}\n />,\n );\n });\n };\n\n const confirmDialogContext: ConfirmDialogProviderContext = {\n openConfirmDialog: handleOpenConfirmDialog,\n };\n\n // Filter dialog\n const [isOpenFilterDialog, setIsOpenFilterDialog] = useState(false);\n const [filterDialog, setFilterDialog] = useState<ReactNode>();\n\n const handleCloseFilterDialog = () => {\n setIsOpenFilterDialog(false);\n return false;\n };\n\n const handleOpenFilterDialog = async (filterOptions: FilterOption[], filters?: Filter[]) => {\n setIsOpenFilterDialog(true);\n\n return new Promise<Filter[]>((resolve) => {\n setFilterDialog(\n <FilterDialog\n filters={filters}\n filterOptions={filterOptions}\n handleClose={handleCloseFilterDialog}\n open={true}\n resolve={resolve}\n />,\n );\n });\n };\n\n const filterDialogContext: FilterDialogProviderContext = {\n openFilterDialog: handleOpenFilterDialog,\n };\n\n return (\n <PageDialogContextState.Provider value={pageDialogContext}>\n <ConfirmDialogContextState.Provider value={confirmDialogContext}>\n <RangeDialogContextState.Provider value={customDialogContext}>\n <FilterDialogContextState.Provider value={filterDialogContext}>\n {children}\n {isOpenPageDialog && pageDialog}\n {isOpenConfirmDialog && confirmDialog}\n {isOpenRangeDialog && rangeDialog}\n {isOpenFilterDialog && filterDialog}\n </FilterDialogContextState.Provider>\n </RangeDialogContextState.Provider>\n </ConfirmDialogContextState.Provider>\n </PageDialogContextState.Provider>\n );\n};\n\nexport { DialogProvider, useConfirmDialog, useRangeDialog, useFilterDialog, usePageDialog };\n","import type { ColumnActionsProvider, ColumnsActionsOptions, TableRowAction } from '@judo/utilities';\nimport { exists } from '@judo/utilities';\nimport { MoreHoriz } from '@mui/icons-material';\nimport { Button } from '@mui/material';\nimport { GridColDef, GridRenderCellParams } from '@mui/x-data-grid';\nimport { DropdownButton } from '../DropdownButton';\n\nexport const columnsActionCalculator: ColumnActionsProvider<any> = (\n actions: TableRowAction<any>[],\n options?: ColumnsActionsOptions,\n): GridColDef[] => {\n if (!exists(actions) || actions.length === 0) {\n return [];\n }\n\n let shownActionsNumber = 1;\n if (options?.shownActions) {\n shownActionsNumber = actions.length < options.shownActions ? actions.length : options.shownActions;\n }\n\n if (shownActionsNumber < 0) {\n return standaloneActions(actions, options);\n } else if (shownActionsNumber === 0) {\n return [];\n } else if (shownActionsNumber === 1) {\n return dropdownActions(actions, options);\n } else {\n const sliceNumber = actions.length === shownActionsNumber ? shownActionsNumber : shownActionsNumber - 1;\n const standaloneRowActions = actions.slice(0, sliceNumber);\n const dropdownRowActions = actions.slice(sliceNumber);\n\n return [...standaloneActions(standaloneRowActions, options), ...dropdownActions(dropdownRowActions, options)];\n }\n};\n\nconst standaloneActions: ColumnActionsProvider<unknown> = (\n actions: TableRowAction<unknown>[],\n options?: ColumnsActionsOptions,\n): GridColDef[] => {\n return actions.map((action, index) => {\n return {\n field: action.label + index,\n headerName: '',\n align: 'center',\n type: 'actions',\n renderCell: (params: GridRenderCellParams) => {\n return (\n <Button variant=\"text\" onClick={() => action.action(params.row)}>\n {action.icon}\n {(options?.showLabel ?? true) && action.label}\n </Button>\n );\n },\n };\n });\n};\n\nconst dropdownActions: ColumnActionsProvider<unknown> = (actions: TableRowAction<unknown>[]): GridColDef[] => {\n if (actions.length === 0) return [];\n\n return [\n {\n field: 'actions',\n headerName: '',\n align: 'center',\n type: 'actions',\n renderCell: (params: GridRenderCellParams) => {\n return (\n <DropdownButton\n variant=\"text\"\n showDropdownIcon={false}\n menuItems={actions.map((action) => {\n return {\n label: action.label,\n startIcon: action.icon,\n onClick: () => action.action(params.row),\n };\n })}\n >\n <MoreHoriz />\n </DropdownButton>\n );\n },\n },\n ];\n};\n","import { Delete, LinkOff, NoteAdd, Visibility } from '@mui/icons-material';\nimport { ButtonBase, Grid, IconButton, InputAdornment, TextField } from '@mui/material';\nimport { useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { exists } from '@judo/utilities';\n\ninterface AggregationInputProps {\n name?: string;\n id?: string;\n label?: string;\n value: any | undefined | null;\n error?: boolean | undefined;\n helperText?: string | undefined;\n disabled?: boolean | undefined;\n readonly?: boolean | undefined;\n labelList: string[];\n icon?: ReactNode;\n onSet?: () => Promise<void> | undefined;\n onView?: () => void | undefined;\n onCreate?: () => void | undefined;\n onDelete?: () => Promise<void> | undefined;\n onRemove?: () => void | undefined;\n}\n\ninterface ViewIconsProps {\n value: any | undefined | null;\n disabled: boolean;\n onView?: () => void | undefined;\n onCreate?: () => void | undefined;\n onDelete?: () => Promise<void> | undefined;\n}\n\ninterface EditIconsProps {\n value: any | undefined | null;\n disabled: boolean;\n onRemove?: () => void | undefined;\n}\n\nexport const AggregationInput = ({\n name,\n id,\n label,\n value,\n error = false,\n helperText,\n disabled = false,\n readonly = true,\n labelList,\n icon,\n onSet,\n onView,\n onCreate,\n onRemove,\n onDelete,\n}: AggregationInputProps) => {\n const [focused, setFocused] = useState(false);\n\n let icons: ReactNode;\n\n if (readonly) {\n icons = <ViewIcons value={value} disabled={disabled} onCreate={onCreate} onView={onView} onDelete={onDelete} />;\n } else {\n icons = <EditIcons value={value} disabled={disabled} onRemove={onRemove} />;\n }\n\n return (\n <Grid container item direction=\"row\" justifyContent=\"stretch\" alignContent=\"stretch\">\n <ButtonBase\n sx={{ padding: 0 }}\n disabled={disabled || readonly}\n onFocusCapture={() => setFocused(true)}\n onBlur={() => setFocused(false)}\n onClick={onSet}\n >\n <TextField\n disabled={!onSet || disabled}\n name={name}\n id={id}\n label={label}\n error={error}\n helperText={helperText}\n focused={focused}\n fullWidth\n value={labelList.join(' - ')}\n className={!readonly ? undefined : 'Mui-readOnly'}\n sx={{\n ':hover': {\n cursor: 'pointer',\n },\n '.MuiFilledInput-input:hover': {\n cursor: 'pointer',\n },\n }}\n InputProps={{\n readOnly: true,\n startAdornment: <InputAdornment position=\"start\">{icon}</InputAdornment>,\n }}\n />\n </ButtonBase>\n {icons}\n </Grid>\n );\n};\n\nconst ViewIcons = ({ value, disabled, onCreate, onDelete, onView }: ViewIconsProps) => {\n let icons: ReactNode;\n\n if (exists(value)) {\n icons = (\n <>\n {onView && (\n <IconButton disabled={disabled} onClick={onView}>\n <Visibility />\n </IconButton>\n )}\n {onDelete && (\n <IconButton disabled={disabled} onClick={onDelete}>\n <Delete />\n </IconButton>\n )}\n </>\n );\n } else {\n icons = (\n <>\n {onCreate && (\n <IconButton disabled={disabled} onClick={onCreate}>\n <NoteAdd />\n </IconButton>\n )}\n </>\n );\n }\n\n return <>{icons}</>;\n};\n\nconst EditIcons = ({ value, disabled, onRemove }: EditIconsProps) => {\n let icons: ReactNode;\n\n if (exists(value)) {\n icons = (\n <>\n {onRemove && (\n <IconButton disabled={disabled} onClick={onRemove}>\n <LinkOff />\n </IconButton>\n )}\n </>\n );\n } else {\n icons = <></>;\n }\n\n return <>{icons}</>;\n};\n","import { Home } from '@mui/icons-material';\nimport { Breadcrumbs, Typography } from '@mui/material';\nimport { useState, useContext, createContext, useMemo, useEffect } from 'react';\nimport type { ReactNode } from 'react';\nimport { useLocation, useNavigate } from 'react-router-dom';\nimport type { To } from 'react-router-dom';\n\ninterface BreadcrumbProviderProps {\n children: ReactNode;\n}\n\nexport type JudoNavigationSetTitle = (pageTitle: string) => void;\n\ninterface JudoNavigationProviderContext {\n clearNavigate: (to: To) => void;\n navigate: (to: To) => void;\n back: () => void;\n isBackDisabled: boolean;\n setTitle: JudoNavigationSetTitle;\n}\n\ninterface BreadcrumbItem {\n key: string;\n path: To;\n label: string | null;\n}\n\n// @ts-ignore\nconst JudoNavigationContextState = createContext<JudoNavigationProviderContext>();\n\nconst BreadcrumbContextState = createContext<BreadcrumbItem[]>([]);\n\nexport const useJudoNavigation = () => {\n const context = useContext(JudoNavigationContextState);\n\n if (context === undefined) {\n throw new Error('useJudoNavigation was used outside of its Provider');\n }\n\n return context;\n};\n\nexport const BreadcrumbProvider = ({ children }: BreadcrumbProviderProps) => {\n const navigate = useNavigate();\n const location = useLocation();\n\n const [breadcrumbItems, setBreadcrumbItems] = useState<BreadcrumbItem[]>([]);\n const [nextBreadcrumbItem, setNextBreadcrumbItem] = useState<BreadcrumbItem>({} as any);\n\n useEffect(() => {\n setNextBreadcrumbItem((prevNextBreadcrumbItem) => {\n return {\n ...prevNextBreadcrumbItem,\n key: '0.' + location.pathname,\n path: location.pathname,\n };\n });\n }, []);\n\n const isBackDisabled = useMemo(() => {\n return breadcrumbItems.length === 0;\n }, [breadcrumbItems]);\n\n const judoNavigationContext = {\n clearNavigate: (to: To) => {\n setBreadcrumbItems([]);\n setNextBreadcrumbItem({\n key: '0.' + to.toString(),\n label: null,\n path: to,\n });\n\n navigate(to);\n },\n navigate: (to: To) => {\n if (nextBreadcrumbItem.label === null) {\n throw Error('Page title has not been set!');\n }\n\n setBreadcrumbItems((prevBreadCrumbItems) => {\n return [...prevBreadCrumbItems, nextBreadcrumbItem];\n });\n\n setNextBreadcrumbItem({\n key: breadcrumbItems.length + '.' + to.toString(),\n label: null,\n path: to,\n });\n\n navigate(to);\n },\n back: () => {\n if (breadcrumbItems.length !== 0) {\n const lastItem = breadcrumbItems[breadcrumbItems.length - 1];\n setNextBreadcrumbItem(lastItem);\n setBreadcrumbItems((prevBreadcrumbItems) => {\n return [...prevBreadcrumbItems.slice(0, prevBreadcrumbItems.length - 1)];\n });\n navigate(lastItem.path);\n return;\n }\n\n setBreadcrumbItems([]);\n setNextBreadcrumbItem({\n key: '0.' + '/'.toString(),\n label: null,\n path: '/',\n });\n\n navigate('/');\n },\n isBackDisabled: isBackDisabled,\n setTitle: (pageTitle: string) => {\n setNextBreadcrumbItem((prevNextBreadcrumbItem) => {\n return { ...prevNextBreadcrumbItem, label: pageTitle };\n });\n },\n };\n\n return (\n <BreadcrumbContextState.Provider value={breadcrumbItems}>\n <JudoNavigationContextState.Provider value={judoNavigationContext}>\n {children}\n </JudoNavigationContextState.Provider>\n </BreadcrumbContextState.Provider>\n );\n};\n\nexport const CustomBreadcrumb = () => {\n const breadcrumbItems = useContext(BreadcrumbContextState);\n\n return (\n <Breadcrumbs maxItems={2} separator=\">\">\n <Home />\n {breadcrumbItems.map(({ label, key }, index) => {\n return (\n <Typography color=\"text.primary\" key={key}>\n {label}\n </Typography>\n );\n })}\n </Breadcrumbs>\n );\n};\n","import { useMatch, useResolvedPath } from 'react-router-dom';\nimport type { LinkProps } from 'react-router-dom';\nimport { theme } from '@judo/theme';\nimport { ListItem, ListItemButton } from '@mui/material';\nimport { useJudoNavigation } from './CustomBreadcrumb';\n\nconst customLinkItemStyle = {\n py: '2px',\n px: 3,\n color: theme.palette.text.secondary,\n '&:hover, &:focus': {\n color: theme.palette.secondary.main,\n },\n '&.Mui-selected': {\n color: theme.palette.secondary.main,\n },\n};\n\nexport function CustomLink({ children, to, ...props }: LinkProps) {\n const resolved = useResolvedPath(to);\n const match = useMatch({ path: resolved.pathname, end: true });\n const { clearNavigate } = useJudoNavigation();\n\n const onClickHandler = () => {\n clearNavigate(to);\n };\n\n return (\n <ListItem disablePadding style={{ textDecoration: 'none' }}>\n <ListItemButton selected={!!match} sx={customLinkItemStyle} onClick={onClickHandler}>\n {children}\n </ListItemButton>\n </ListItem>\n );\n}\n","import { AppBar, Toolbar, Grid, Typography, Divider } from '@mui/material';\nimport { useEffect } from 'react';\nimport type { ReactNode } from 'react';\nimport { useJudoNavigation } from './CustomBreadcrumb';\n\ninterface PageHeaderProps {\n title: string;\n children: ReactNode;\n}\n\nexport const PageHeader = ({ title, children }: PageHeaderProps) => {\n const { setTitle } = useJudoNavigation();\n\n useEffect(() => {\n setTitle(title);\n }, [title]);\n\n return (\n <>\n <AppBar component=\"div\" position=\"static\" elevation={0} sx={{ zIndex: 0 }}>\n <Toolbar>\n <Grid container alignItems=\"center\" spacing={1}>\n <Grid item xs>\n <Typography component=\"span\" color=\"text.primary\" variant=\"h5\">\n {title}\n </Typography>\n </Grid>\n {children}\n </Grid>\n </Toolbar>\n </AppBar>\n <Divider />\n </>\n );\n};\n"],"names":["ConfirmationDialog","confirmationMessage","title","resolve","open","handleClose","descriptionElementRef","useRef","useEffect","current","descriptionElement","focus","_jsxs","Dialog","onClose","scroll","fullWidth","maxWidth","children","_jsx","DialogTitle","id","DialogContent","dividers","DialogContentText","ref","tabIndex","DialogActions","Button","variant","onClick","TRINARY_LOGIC","Map","FilterType","e","i","t","r","location","preventDuplicate","persist","duration","autoHideDuration","setValidation","forEach","set","code","a","o","message","marginTop","marginBottom","display","flexDirection","alignItems","palette","mode","primary","main","secondary","text","background","default","subtitleColor","typography","h5","fontWeight","fontSize","letterSpacing","shape","borderRadius","components","MuiTab","defaultProps","disableRipple","mixins","toolbar","minHeight","MuiAppBar","styleOverrides","colorPrimary","backgroundColor","MuiButton","size","root","textTransform","paddingLeft","paddingRight","contained","boxShadow","outlined","border","MuiInputLabel","color","MuiFilledInput","input","WebkitBackgroundClip","borderBottom","MuiTextField","MuiSelect","filled","MuiDataGrid","toolbarContainer","padding","MuiPaper","rounded","MuiDrawer","paper","MuiTabs","marginLeft","spacing","indicator","height","borderTopLeftRadius","borderTopRightRadius","common","white","margin","minWidth","breakpoints","up","MuiIconButton","MuiTooltip","tooltip","MuiDivider","middle","MuiListItemButton","disableTouchRipple","MuiListItemText","fontWeightMedium","MuiListItemIcon","marginRight","MuiAvatar","width","MuiCard","length","l","DropdownButton","menuItems","disabled","showDropdownIcon","setOpen","useState","anchorRef","event","contains","target","handleListKeyDown","key","preventDefault","prevOpen","_Fragment","endIcon","KeyboardArrowDown","Popper","anchorEl","placement","transition","style","zIndex","scrollWidth","TransitionProps","Grow","transformOrigin","Paper","ClickAwayListener","onClickAway","MenuList","autoFocusItem","onKeyDown","filter","menuItem","visible","map","index","MenuItem","label","startIcon","equals","notEquals","lessThan","greaterThan","lessOrEqual","greaterOrEqual","equal","notEqual","matches","like","TrinaryLogicCombobox","readOnly","value","name","error","helperText","onChange","onChangeHandler","Array","from","values","indexOf","keysArray","keys","undefined","TextField","select","get","className","InputProps","startAdornment","InputAdornment","position","CheckBoxOutlined","getDefaultOperator","filterType","boolean","_BooleanOperation","date","dateTime","_NumericOperation","enumeration","_EnumerationOperation","numeric","string","_StringOperation","trinaryLogic","getOperatorsByFilter","filterOption","Object","FilterOperator","setFilterOperator","filterBy","operator","getOperationEnumValue","item","FilterInput","setFilterValue","exists","enumValues","Error","attributeName","FormControlLabel","control","Checkbox","checked","DatePicker","renderInput","props","newValue","toISOString","substring","dateToJudoDateString","Icon","path","mdiCalendarMonth","DateTimePicker","mdiCalendarClock","type","Number","mdiNumeric","mdiFormatTextVariant","FilterRow","closeHandler","Grid","container","xs","IconButton","Close","Transition","forwardRef","Slide","direction","FilterDialog","filters","filterOptions","tempFilters","setTempFilters","updateFilterValue","prevTempFilters","tempFilter","updateFilterOperator","filterCloseHandler","cancel","TransitionComponent","disableEnforceFocus","sx","justifyContent","PaperProps","m","Typography","component","Container","Box","mainContainerPadding","PageDialog","page","ok","CustomTablePagination","TablePagination","count","onPageChange","async","newPage","isNext","setPage","pageChange","rowsPerPage","rowPerPage","rowsPerPageOptions","labelDisplayedRows","to","nextIconButtonProps","isNextButtonEnabled","backIconButtonProps","RangeDialog","single","columns","defaultSortField","rangeCall","alreadySelectedItems","initalQueryCustomizer","openFilterDialog","useFilterDialog","enqueueSnackbar","useSnackbar","isLoading","setIsLoading","rowCount","setRowCount","sortModel","setSortModel","lastItem","setLastItem","firstItem","setFirstItem","setIsNextButtonEnabled","data","setData","selectionModel","setSelectionModel","selectedItems","setSelectedItems","setFilters","queryCustomizer","setQueryCustomizer","_seek","limit","handlePageChange","prevQueryCustomizer","reverse","fetchData","res","pop","s","isAxiosError","n","response","status","errorHandling","DataGrid","autoHeight","getRowId","row","__identifier","loading","paginationMode","rows","sortingOrder","sortingMode","onSortModelChange","newModel","field","sort","_orderBy","attribute","descending","checkboxSelection","onSelectionModelChange","newSelectionModel","isArray","lastId","find","diff","newItemsId","slice","newItems","prevSelectedItems","removedItemsId","isRowSelectable","params","includes","hideFooterSelectedRowCount","keepNonExistentRowsSelected","Toolbar","GridToolbarContainer","newFilters","tempQueryCustomizer","mapFiltersToQueryCustomizerProperty","handleFiltersChange","Pagination","PageDialogContextState","createContext","ConfirmDialogContextState","RangeDialogContextState","FilterDialogContextState","usePageDialog","context","useContext","useConfirmDialog","useRangeDialog","DialogProvider","isOpenPageDialog","setIsOpenPageDialog","pageDialog","setPageDialog","handleClosePageDialog","pageDialogContext","openPageDialog","Promise","isOpenRangeDialog","setIsOpenRangeDialog","rangeDialog","setRangeDialog","handleCloseRangeDialog","customDialogContext","openRangeDialog","initialQueryCustomizer","isOpenConfirmDialog","setIsOpenConfirmDialog","confirmDialog","setConfirmDialog","handleCloseConfirmDialog","confirmDialogContext","openConfirmDialog","isOpenFilterDialog","setIsOpenFilterDialog","filterDialog","setFilterDialog","handleCloseFilterDialog","filterDialogContext","Provider","columnsActionCalculator","actions","options","shownActionsNumber","shownActions","standaloneActions","dropdownActions","sliceNumber","standaloneRowActions","dropdownRowActions","action","headerName","align","renderCell","icon","showLabel","MoreHoriz","AggregationInput","readonly","labelList","onSet","onView","onCreate","onRemove","onDelete","focused","setFocused","icons","ViewIcons","EditIcons","alignContent","ButtonBase","onFocusCapture","onBlur","join","cursor","Visibility","Delete","NoteAdd","LinkOff","JudoNavigationContextState","BreadcrumbContextState","useJudoNavigation","BreadcrumbProvider","navigate","useNavigate","useLocation","breadcrumbItems","setBreadcrumbItems","nextBreadcrumbItem","setNextBreadcrumbItem","prevNextBreadcrumbItem","pathname","judoNavigationContext","clearNavigate","toString","prevBreadCrumbItems","back","prevBreadcrumbItems","isBackDisabled","useMemo","setTitle","pageTitle","CustomBreadcrumb","Breadcrumbs","maxItems","separator","Home","customLinkItemStyle","py","px","theme","CustomLink","resolved","useResolvedPath","match","useMatch","end","ListItem","disablePadding","textDecoration","ListItemButton","selected","PageHeader","AppBar","elevation","Divider"],"mappings":"6wCAIa,MAAAA,GAAqB,EAChCC,sBACAC,QACAC,UACAC,OACAC,kBAEA,MAAMC,EAAwBC,EAAoB,MAClDC,GAAU,KACR,GAAIJ,EAAM,CACR,MAAQK,QAASC,GAAuBJ,EACb,OAAvBI,GACFA,EAAmBC,OAEtB,IACA,CAACP,IAYJ,OACEQ,EAACC,EAAM,CAACT,KAAMA,EAAMU,QAAST,EAAaU,OAAO,QAAQC,WAAW,EAAMC,SAAU,KACjFC,SAAA,CAAAhB,GAASiB,EAACC,GAAYC,GAAG,sBAAuBH,SAAAhB,IACjDiB,EAACG,EAAc,CAAAC,WAAYrB,EAAKgB,SAC9BC,EAACK,GAAkBH,GAAG,4BAA4BI,IAAKnB,EAAuBoB,UAAW,EACtFR,SAAAjB,MAGLW,EAACe,EAAa,CAAAT,SAAA,CACZC,EAACS,EAAM,CAACC,QAAQ,OAAOC,QAnBd,KACbzB,IACAF,GAAQ,EAAM,EAmBDe,SAAA,OACTC,EAACS,EAAM,CAACC,QAAQ,OAAOC,QAjBlB,KACTzB,IACAF,GAAQ,EAAK,EAiBAe,SAAA,aAGb,EChDEa,GAAgB,IAAIC,IAAI,CAC1B,CAAC,KAAM,WACP,EAAC,EAAM,OACP,EAAC,EAAO,QAGZ,IAAIC,IACJ,SAAWA,GACPA,EAAWA,EAAoB,QAAI,GAAK,UACxCA,EAAWA,EAAoB,QAAI,GAAK,UACxCA,EAAWA,EAAmB,OAAI,GAAK,SACvCA,EAAWA,EAAwB,YAAI,GAAK,cAC5CA,EAAWA,EAA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SAC3DhB,MAGJgB,SAIPC,EAAC2f,EAAU,CAAA,KAEb"}
1
+ {"version":3,"file":"components.mjs","sources":["../../src/dialog/ConfirmationDialog.tsx","../../../components-api/dist/esm/components-api.mjs","../../../utilities/dist/esm/utilities.mjs","../../../theme/dist/esm/theme.mjs","../../../data-api-common/dist/esm/data-api-common.mjs","../../src/DropdownButton.tsx","../../src/TrinaryLogicCombobox.tsx","../../src/dialog/FilterDialog.tsx","../../src/dialog/PageDialog.tsx","../../src/CustomTablePagination.tsx","../../src/dialog/hooks.tsx","../../src/dialog/RangeDialog.tsx","../../src/dialog/DialogProvider.tsx","../../src/table/table-row-actions.tsx","../../src/AggregationInput.tsx","../../src/CustomBreadcrumb.tsx","../../src/CustomLink.tsx","../../src/PageHeader.tsx"],"sourcesContent":["import { Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions, Button } from '@mui/material';\nimport { useEffect, useRef } from 'react';\nimport type { ConfirmationDialogProps } from '@judo/components-api';\n\nexport const ConfirmationDialog = ({\n confirmationMessage,\n title,\n resolve,\n open,\n handleClose,\n}: ConfirmationDialogProps) => {\n const descriptionElementRef = useRef<HTMLElement>(null);\n useEffect(() => {\n if (open) {\n const { current: descriptionElement } = descriptionElementRef;\n if (descriptionElement !== null) {\n descriptionElement.focus();\n }\n }\n }, [open]);\n\n const cancel = () => {\n handleClose();\n resolve(false);\n };\n\n const ok = () => {\n handleClose();\n resolve(true);\n };\n\n return (\n <Dialog open={open} onClose={handleClose} scroll=\"paper\" fullWidth={true} maxWidth={'xs'}>\n {title && <DialogTitle id=\"scroll-dialog-title\">{title}</DialogTitle>}\n <DialogContent dividers={!!title}>\n <DialogContentText id=\"scroll-dialog-description\" ref={descriptionElementRef} tabIndex={-1}>\n {confirmationMessage}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button variant=\"text\" onClick={cancel}>\n No\n </Button>\n <Button variant=\"text\" onClick={ok}>\n Yes\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n","const TRINARY_LOGIC = new Map([\n [null, 'Unknown'],\n [true, 'Yes'],\n [false, 'No'],\n]);\n\nvar FilterType;\n(function (FilterType) {\n FilterType[FilterType[\"boolean\"] = 0] = \"boolean\";\n FilterType[FilterType[\"numeric\"] = 1] = \"numeric\";\n FilterType[FilterType[\"string\"] = 2] = \"string\";\n FilterType[FilterType[\"enumeration\"] = 3] = \"enumeration\";\n FilterType[FilterType[\"date\"] = 4] = \"date\";\n FilterType[FilterType[\"dateTime\"] = 5] = \"dateTime\";\n // time,\n FilterType[FilterType[\"trinaryLogic\"] = 6] = \"trinaryLogic\";\n})(FilterType || (FilterType = {}));\n\nexport { FilterType, TRINARY_LOGIC };\n","const e=e=>null!=e,t=e=>e?e.toISOString().substring(0,10):e,r=(t,r,s)=>{if(!t||\"boolean\"!=typeof t.isAxiosError||!0!==t.isAxiosError)return void a(r);const n=t.response;if(e(n))if(n?.status)if(422===n?.status)r(o(t.response?.data).message,{variant:\"error\",preventDuplicate:!0,persist:!0});else{if(400===n?.status)return i(n.data,r,s);r(o(n?.data).message,{variant:\"error\",preventDuplicate:!0,persist:!0})}else a(r);else a(r)},i=(t,r,i)=>{if(e(t[0].location)){if(r(\"Please make sure all fields are filled in correctly.\",{variant:\"error\",preventDuplicate:!0,persist:!i?.duration,autoHideDuration:i?.duration??void 0}),void 0!==i?.setValidation){let e=new Map;t.forEach((t=>e.set(t.location,t.code))),i?.setValidation(e)}}else r(t[0].code,{variant:\"error\",preventDuplicate:!0,persist:!i?.duration,autoHideDuration:i?.duration??void 0})},a=e=>{e(\"Something went wrong. Please contact with the system admins.\",{variant:\"error\",preventDuplicate:!0,persist:!0})},o=e=>({message:e.code}),s=(e,t)=>{if(e.some((e=>e.filterOption.attributeName===t)))return e.filter((e=>e.filterOption.attributeName===t&&e.filterBy.value)).map((e=>({value:e.filterBy.value,operator:e.filterBy.operator})))},n=(e,...t)=>{let r={};for(const i of t)r[i]=s(e,i);return r};export{t as dateToJudoDateString,r as errorHandling,e as exists,n as mapAllFiltersToQueryCustomizerProperties,s as mapFiltersToQueryCustomizerProperty};\n//# sourceMappingURL=utilities.mjs.map\n","import{createTheme as e,alpha as o}from\"@mui/material\";const i={marginTop:8,marginBottom:8,display:\"flex\",flexDirection:\"column\",alignItems:\"center\"},t=e({palette:{mode:\"light\",primary:{main:\"#3C4166FF\"},secondary:{main:\"#E7501DFF\"},text:{primary:\"#17191DFF\",secondary:\"#434448FF\"},background:{default:\"#FAFAFAFF\"},subtitleColor:{main:\"#8c8c8c\"}},typography:{h5:{fontWeight:500,fontSize:26,letterSpacing:.5}},shape:{borderRadius:8},components:{MuiTab:{defaultProps:{disableRipple:!0}}},mixins:{toolbar:{minHeight:48}}}),r={...t,components:{MuiAppBar:{styleOverrides:{colorPrimary:{backgroundColor:t.palette.background.default}}},MuiButton:{defaultProps:{variant:\"contained\",size:\"small\"},styleOverrides:{root:{textTransform:\"none\",borderRadius:\"20px 20px 20px 20px\",paddingLeft:15,paddingRight:15},contained:{boxShadow:\"none\",\"&:active\":{boxShadow:\"none\"}},outlined:{border:\"2px solid\",fontWeight:\"bold\",\"&:hover\":{border:\"2px solid\",background:o(t.palette.primary.main,.15)}}}},MuiInputLabel:{styleOverrides:{root:{color:t.palette.subtitleColor.main,fontWeight:500,fontSize:16,\"&.Mui-focused\":{color:t.palette.subtitleColor.main}}}},MuiFilledInput:{styleOverrides:{input:{\"&:-webkit-autofill\":{WebkitBackgroundClip:\"text !important\"}},root:{background:\"inherit\",\"&.Mui-focused\":{background:\"inherit\"},\"&:hover:not(.Mui-disabled):not(.Mui-focused)\":{background:o(t.palette.secondary.main,.1)},\"&:hover:not(.Mui-disabled):before\":{borderBottom:\"none\"},\"&.Mui-focused .MuiInputAdornment-root .MuiSvgIcon-root\":{color:t.palette.secondary.main}}}},MuiTextField:{defaultProps:{fullWidth:!0,variant:\"filled\",color:\"secondary\"},styleOverrides:{root:{background:\"white\",\"& .MuiFilledInput-underline:before\":{borderBottom:\"none\"},\"&.Mui-readOnly:not(.Mui-disabled):not(.Mui-focused)\":{borderBottom:`1px solid ${o(t.palette.primary.main,.2)}`,background:\"transparent\"},\"&:not(.Mui-readOnly):not(.Mui-disabled)\":{boxShadow:\"0px 0px 8px 2px rgba(0,0,0,0.05)\",borderRadius:\"8px 8px 0 0\"}}}},MuiSelect:{styleOverrides:{filled:{\"&:focus\":{backgroundColor:\"white\"}}}},MuiDataGrid:{styleOverrides:{root:{border:\"none\"},toolbarContainer:{padding:\"8px 8px 4px 8px\"}}},MuiPaper:{styleOverrides:{rounded:{boxShadow:\"0px 0px 8px 1px rgba(0,0,0,0.05)\",borderRadius:16,padding:8}}},MuiDrawer:{styleOverrides:{paper:{border:\"none\",boxShadow:\"0px 0px 8px 1px rgba(0,0,0,0.05)\"}}},MuiTabs:{styleOverrides:{root:{marginLeft:t.spacing(1)},indicator:{height:3,borderTopLeftRadius:3,borderTopRightRadius:3,backgroundColor:t.palette.common.white}}},MuiTab:{styleOverrides:{root:{textTransform:\"none\",margin:\"0 16px\",minWidth:0,padding:0,[t.breakpoints.up(\"md\")]:{padding:0,minWidth:0}}}},MuiIconButton:{styleOverrides:{root:{color:t.palette.secondary.main,padding:t.spacing(1)}}},MuiTooltip:{styleOverrides:{tooltip:{borderRadius:4}}},MuiDivider:{styleOverrides:{root:{backgroundColor:\"rgb(255,255,255,0.15)\"},middle:{marginTop:8,marginBottom:8}}},MuiListItemButton:{defaultProps:{disableTouchRipple:!0}},MuiListItemText:{styleOverrides:{primary:{fontSize:14,fontWeight:t.typography.fontWeightMedium}}},MuiListItemIcon:{styleOverrides:{root:{color:\"inherit\",minWidth:\"auto\",marginRight:t.spacing(2),\"& svg\":{fontSize:20}}}},MuiAvatar:{styleOverrides:{root:{width:32,height:32}}},MuiCard:{styleOverrides:{root:{width:\"100%\",length:\"100%\",padding:10}}}}};export{i as mainContainerPadding,r as theme,t as themeBase};\n//# sourceMappingURL=theme.mjs.map\n","var a,e,l,r;!function(a){a.equals=\"equals\"}(a||(a={})),function(a){a.equals=\"equals\",a.notEquals=\"notEquals\"}(e||(e={})),function(a){a.lessThan=\"lessThan\",a.greaterThan=\"greaterThan\",a.lessOrEqual=\"lessOrEqual\",a.greaterOrEqual=\"greaterOrEqual\",a.equal=\"equal\",a.notEqual=\"notEqual\"}(l||(l={})),function(a){a.lessThan=\"lessThan\",a.greaterThan=\"greaterThan\",a.lessOrEqual=\"lessOrEqual\",a.greaterOrEqual=\"greaterOrEqual\",a.equal=\"equal\",a.notEqual=\"notEqual\",a.matches=\"matches\",a.like=\"like\"}(r||(r={}));export{a as _BooleanOperation,e as _EnumerationOperation,l as _NumericOperation,r as _StringOperation};\n//# sourceMappingURL=data-api-common.mjs.map\n","import { Button, ClickAwayListener, Grow, MenuItem, MenuList, Paper, Popper } from '@mui/material';\nimport { useState, useRef, useEffect } from 'react';\nimport type { ReactNode, KeyboardEvent, SyntheticEvent } from 'react';\nimport { KeyboardArrowDown } from '@mui/icons-material';\n\ninterface DropdownMenuItem {\n disabled?: boolean;\n visible?: boolean;\n label?: string;\n onClick: () => void;\n startIcon?: ReactNode;\n endIcon?: ReactNode;\n}\n\ninterface DropdownButtonProps {\n children?: ReactNode;\n id?: string | undefined;\n menuItems: DropdownMenuItem[];\n disabled?: boolean;\n showDropdownIcon?: boolean;\n fullWidth?: boolean;\n variant?: 'text' | 'outlined' | 'contained' | undefined;\n}\n\nexport function DropdownButton({\n children,\n id,\n menuItems,\n disabled = false,\n showDropdownIcon = true,\n fullWidth = false,\n variant = 'contained',\n}: DropdownButtonProps) {\n const [open, setOpen] = useState(false);\n const anchorRef = useRef<HTMLButtonElement>(null);\n\n const handleToggle = () => {\n setOpen((prevOpen) => !prevOpen);\n };\n\n const handleClose = (event: Event | SyntheticEvent) => {\n if (anchorRef.current && anchorRef.current.contains(event.target as HTMLElement)) {\n return;\n }\n\n setOpen(false);\n };\n\n function handleListKeyDown(event: KeyboardEvent) {\n if (event.key === 'Tab') {\n event.preventDefault();\n setOpen(false);\n } else if (event.key === 'Escape') {\n setOpen(false);\n }\n }\n\n // return focus to the button when we transitioned from !open -> open\n const prevOpen = useRef(open);\n useEffect(() => {\n if (prevOpen.current && !open) {\n anchorRef.current!.focus();\n }\n\n prevOpen.current = open;\n }, [open]);\n\n return (\n <>\n <Button\n ref={anchorRef}\n id={id}\n onClick={handleToggle}\n endIcon={showDropdownIcon && <KeyboardArrowDown />}\n disabled={disabled}\n fullWidth={fullWidth}\n variant={variant}\n >\n {children}\n </Button>\n <Popper\n open={open}\n anchorEl={anchorRef.current}\n placement=\"bottom\"\n transition\n style={{ zIndex: 1400, minWidth: anchorRef.current?.scrollWidth }}\n >\n {({ TransitionProps, placement }) => (\n <Grow\n {...TransitionProps}\n style={{\n transformOrigin: placement === 'bottom-start' ? 'left top' : 'left bottom',\n }}\n >\n <Paper>\n <ClickAwayListener onClickAway={handleClose}>\n <MenuList autoFocusItem={open} onKeyDown={handleListKeyDown}>\n {menuItems\n .filter((menuItem) => menuItem.visible ?? true)\n .map((menuItem, index) => {\n return (\n <MenuItem\n id={menuItem.label ?? '' + index}\n disabled={menuItem.disabled ?? false}\n onClick={(event) => {\n handleClose(event);\n menuItem.onClick();\n }}\n >\n {menuItem.startIcon}\n {menuItem.label}\n {menuItem.endIcon}\n </MenuItem>\n );\n })}\n </MenuList>\n </ClickAwayListener>\n </Paper>\n </Grow>\n )}\n </Popper>\n </>\n );\n}\n","import { CheckBoxOutlined } from '@mui/icons-material';\nimport { TextField, InputAdornment, MenuItem } from '@mui/material';\nimport type { ChangeEvent } from 'react';\nimport { TRINARY_LOGIC } from '@judo/components-api';\n\ninterface TrinaryLogicProps {\n readOnly?: boolean;\n value?: boolean | null;\n id?: string;\n label: string;\n name?: string;\n error?: boolean | undefined;\n helperText?: string | undefined;\n onChange?: (value: boolean | null) => void;\n}\n\nconst TrinaryLogicCombobox = ({\n readOnly = false,\n value = null,\n id,\n label,\n name,\n error,\n helperText,\n onChange,\n}: TrinaryLogicProps) => {\n const onChangeHandler = onChange\n ? (event: ChangeEvent<HTMLTextAreaElement | HTMLInputElement>) => {\n const index = Array.from(TRINARY_LOGIC.values()).indexOf(event.target.value);\n const keysArray = Array.from(TRINARY_LOGIC.keys());\n onChange(keysArray[index]);\n }\n : undefined;\n\n return (\n <TextField\n name={name}\n id={id}\n label={label}\n select\n value={TRINARY_LOGIC.get(value)}\n onChange={onChangeHandler}\n className={readOnly ? 'Mui-readOnly' : undefined}\n error={error}\n helperText={helperText}\n InputProps={{\n readOnly: readOnly,\n startAdornment: (\n <InputAdornment position=\"start\">\n <CheckBoxOutlined />\n </InputAdornment>\n ),\n }}\n >\n {Array.from(TRINARY_LOGIC.keys()).map((key) => (\n <MenuItem key={TRINARY_LOGIC.get(key)} value={TRINARY_LOGIC.get(key)}>\n {TRINARY_LOGIC.get(key)}\n </MenuItem>\n ))}\n </TextField>\n );\n};\n\nexport default TrinaryLogicCombobox;\n","import { mdiCalendarClock, mdiCalendarMonth, mdiFormatTextVariant, mdiNumeric } from '@mdi/js';\nimport Icon from '@mdi/react';\nimport { Close } from '@mui/icons-material';\nimport {\n Dialog,\n DialogTitle,\n DialogContent,\n DialogContentText,\n DialogActions,\n Button,\n Slide,\n Box,\n Container,\n Grid,\n TextField,\n MenuItem,\n Checkbox,\n FormControlLabel,\n InputAdornment,\n IconButton,\n Typography,\n} from '@mui/material';\nimport type { TransitionProps } from '@mui/material/transitions';\nimport { DatePicker, DateTimePicker } from '@mui/x-date-pickers';\nimport { forwardRef, useEffect, useRef, useState } from 'react';\nimport type { ChangeEvent, ReactElement, Ref } from 'react';\nimport type {\n Filter,\n FilterDialogProps,\n FilterInputProps,\n FilterOperatorProps,\n FilterProps,\n Operation,\n} from '@judo/components-api';\nimport { FilterType } from '@judo/components-api';\nimport { dateToJudoDateString, exists } from '@judo/utilities';\nimport { mainContainerPadding } from '@judo/theme';\nimport { _BooleanOperation, _EnumerationOperation, _NumericOperation, _StringOperation } from '@judo/data-api-common';\nimport { DropdownButton } from '../DropdownButton';\nimport TrinaryLogicCombobox from '../TrinaryLogicCombobox';\n\nconst getDefaultOperator = (filterType: FilterType) => {\n switch (filterType) {\n case FilterType.boolean:\n return _BooleanOperation['equals'];\n case FilterType.date:\n return _NumericOperation['equal'];\n case FilterType.dateTime:\n return _NumericOperation['equal'];\n // case FilterType.time:\n // return _NumericOperation['equal'];\n case FilterType.enumeration:\n return _EnumerationOperation['equals'];\n case FilterType.numeric:\n return _NumericOperation['equal'];\n case FilterType.string:\n return _StringOperation['equal'];\n case FilterType.trinaryLogic:\n return _BooleanOperation['equals'];\n }\n};\n\nconst getOperationEnumValue = (filter: Filter, operator: string) => {\n switch (filter.filterOption.filterType) {\n case FilterType.boolean:\n return _BooleanOperation[operator as keyof typeof _BooleanOperation];\n case FilterType.date:\n return _NumericOperation[operator as keyof typeof _NumericOperation];\n case FilterType.dateTime:\n return _NumericOperation[operator as keyof typeof _NumericOperation];\n // case FilterType.time:\n // return _NumericOperation[operator as keyof typeof _NumericOperation];\n case FilterType.enumeration:\n return _EnumerationOperation[operator as keyof typeof _BooleanOperation];\n case FilterType.numeric:\n return _NumericOperation[operator as keyof typeof _NumericOperation];\n case FilterType.string:\n return _StringOperation[operator as keyof typeof _StringOperation];\n case FilterType.trinaryLogic:\n return _BooleanOperation[operator as keyof typeof _BooleanOperation];\n }\n};\n\nconst getOperatorsByFilter = (filter: Filter): string[] => {\n switch (filter.filterOption.filterType) {\n case FilterType.boolean:\n return Object.values(_BooleanOperation);\n case FilterType.date:\n return Object.values(_NumericOperation);\n case FilterType.dateTime:\n return Object.values(_NumericOperation);\n // case FilterType.time:\n // return Object.values(_NumericOperation);\n case FilterType.enumeration:\n return Object.values(_EnumerationOperation);\n case FilterType.numeric:\n return Object.values(_NumericOperation);\n case FilterType.string:\n return Object.values(_StringOperation);\n case FilterType.trinaryLogic:\n return Object.values(_BooleanOperation);\n }\n};\n\nconst FilterOperator = ({ filter, setFilterOperator }: FilterOperatorProps) => {\n const onChangeHandler = (event: ChangeEvent<HTMLTextAreaElement | HTMLInputElement>) => {\n setFilterOperator(filter, getOperationEnumValue(filter, event.target.value));\n };\n\n return (\n <TextField\n name={'operation'}\n id={'operation'}\n label={'Operation'}\n select\n value={filter.filterBy.operator}\n onChange={onChangeHandler}\n >\n {getOperatorsByFilter(filter).map((item) => (\n <MenuItem key={item} value={item}>\n {/* TODO: do not forget localization here*/}\n {item}\n </MenuItem>\n ))}\n </TextField>\n );\n};\n\nconst FilterInput = ({ filter, setFilterValue }: FilterInputProps) => {\n if (filter.filterOption.filterType === FilterType.enumeration && !exists(filter.filterOption.enumValues)) {\n throw new Error(`Missing enumValues from FilterOptions of ${filter.filterOption.attributeName}`);\n }\n\n return (\n <>\n {(() => {\n switch (filter.filterOption.filterType) {\n case FilterType.boolean:\n return (\n <FormControlLabel\n control={\n <Checkbox\n checked={!!filter.filterBy.value}\n onChange={(event) => setFilterValue(filter, !!event.target.value)}\n />\n }\n label={filter.filterOption.attributeName}\n />\n );\n case FilterType.date:\n return (\n <DatePicker\n renderInput={(props) => <TextField {...props} />}\n label={filter.filterOption.attributeName}\n value={filter.filterBy.value ?? null}\n onChange={(newValue) => setFilterValue(filter, dateToJudoDateString(newValue))}\n InputProps={{\n startAdornment: (\n <InputAdornment position=\"start\">\n <Icon path={mdiCalendarMonth} size={1} />\n </InputAdornment>\n ),\n }}\n />\n );\n case FilterType.dateTime:\n return (\n <DateTimePicker\n renderInput={(props) => <TextField {...props} />}\n label={filter.filterOption.attributeName}\n value={filter.filterBy.value ?? null}\n onChange={(newValue) => setFilterValue(filter, newValue)}\n InputProps={{\n startAdornment: (\n <InputAdornment position=\"start\">\n <Icon path={mdiCalendarClock} size={1} />\n </InputAdornment>\n ),\n }}\n />\n );\n // case FilterType.time:\n // return (\n // <TextField\n // label={filter.filterOption.attributeName}\n // value={filter.filterBy.value}\n // onChange={(event) => setFilterValue(filter, event.target.value)}\n // InputProps={{\n // startAdornment: (\n // <InputAdornment position=\"start\">\n // <Icon path={mdiClockOutline} size={1} />\n // </InputAdornment>\n // ),\n // }}\n // />\n // );\n case FilterType.enumeration:\n return (\n <TextField\n label={filter.filterOption.attributeName}\n value={filter.filterBy.value}\n select\n onChange={(event) => setFilterValue(filter, event.target.value)}\n >\n {filter.filterOption.enumValues?.map((item) => (\n <MenuItem key={item} value={item}>\n {item}\n </MenuItem>\n ))}\n </TextField>\n );\n case FilterType.numeric:\n return (\n <TextField\n label={filter.filterOption.attributeName}\n type=\"number\"\n value={filter.filterBy.value}\n onChange={(event) => setFilterValue(filter, Number(event.target.value))}\n InputProps={{\n startAdornment: (\n <InputAdornment position=\"start\">\n <Icon path={mdiNumeric} size={1} />\n </InputAdornment>\n ),\n }}\n />\n );\n case FilterType.string:\n return (\n <TextField\n label={filter.filterOption.attributeName}\n value={filter.filterBy.value}\n onChange={(event) => setFilterValue(filter, event.target.value)}\n InputProps={{\n startAdornment: (\n <InputAdornment position=\"start\">\n <Icon path={mdiFormatTextVariant} size={1} />\n </InputAdornment>\n ),\n }}\n />\n );\n case FilterType.trinaryLogic:\n return (\n <TrinaryLogicCombobox\n label={filter.filterOption.attributeName}\n value={filter.filterBy.value}\n onChange={(value) => setFilterValue(filter, value)}\n />\n );\n }\n })()}\n </>\n );\n};\n\nconst FilterRow = ({ filter, closeHandler, setFilterOperator, setFilterValue }: FilterProps) => {\n return (\n <Grid item container spacing={2} alignItems={'center'}>\n <Grid item xs={4}>\n {filter && <FilterOperator filter={filter} setFilterOperator={setFilterOperator} />}\n </Grid>\n <Grid item xs={7}>\n {filter && <FilterInput filter={filter} setFilterValue={setFilterValue} />}\n </Grid>\n <Grid item xs={1}>\n <IconButton onClick={() => closeHandler(filter)}>\n <Close />\n </IconButton>\n </Grid>\n </Grid>\n );\n};\n\nconst Transition = forwardRef(function Transition(\n props: TransitionProps & {\n children: ReactElement<any, any>;\n },\n ref: Ref<unknown>,\n) {\n return <Slide direction=\"left\" ref={ref} {...props} />;\n});\n\nexport const FilterDialog = ({ filters, filterOptions, resolve, open, handleClose }: FilterDialogProps) => {\n const descriptionElementRef = useRef<HTMLElement>(null);\n const [tempFilters, setTempFilters] = useState<Filter[]>(filters ?? []);\n\n useEffect(() => {\n if (open) {\n const { current: descriptionElement } = descriptionElementRef;\n if (descriptionElement !== null) {\n descriptionElement.focus();\n }\n }\n }, [open]);\n\n const updateFilterValue = (filter: Filter, value: any) => {\n setTempFilters((prevTempFilters) => {\n return prevTempFilters.map((tempFilter) => {\n if (filter.id === tempFilter.id) {\n return {\n ...tempFilter,\n filterBy: { value: value, operator: tempFilter.filterBy.operator },\n };\n }\n\n return tempFilter;\n });\n });\n };\n\n const updateFilterOperator = (filter: Filter, operator: Operation) => {\n setTempFilters((prevTempFilters) => {\n return prevTempFilters.map((tempFilter) => {\n if (filter.id === tempFilter.id) {\n return {\n ...tempFilter,\n filterBy: { value: tempFilter.filterBy.value, operator: operator },\n };\n }\n\n return tempFilter;\n });\n });\n };\n\n const filterCloseHandler = (filter: Filter) => {\n setTempFilters((prevTempFilters) => [...prevTempFilters.filter((tempFilter) => tempFilter.id !== filter.id)]);\n };\n\n const cancel = () => {\n handleClose();\n resolve(undefined);\n };\n\n const ok = () => {\n handleClose();\n resolve(tempFilters);\n };\n\n return (\n <Dialog\n open={open}\n onClose={cancel}\n scroll=\"paper\"\n TransitionComponent={Transition}\n disableEnforceFocus\n fullWidth\n maxWidth=\"sm\"\n sx={{\n '& .MuiDialog-container': {\n justifyContent: 'flex-end',\n },\n }}\n PaperProps={{\n sx: {\n m: 0,\n height: '100%',\n },\n }}\n >\n <DialogTitle id=\"scroll-dialog-title\">\n <Typography component=\"span\" color=\"text.primary\" variant=\"h5\">\n Filters\n </Typography>\n </DialogTitle>\n <DialogContent dividers={true}>\n <DialogContentText id=\"scroll-dialog-description\" ref={descriptionElementRef} tabIndex={-1}>\n <Container component=\"main\" maxWidth=\"xs\">\n <Box sx={mainContainerPadding}>\n <Grid container spacing={2}>\n {tempFilters.map((filter) => (\n <FilterRow\n key={filter.id}\n filter={filter}\n closeHandler={filterCloseHandler}\n setFilterOperator={updateFilterOperator}\n setFilterValue={updateFilterValue}\n />\n ))}\n <Grid item container>\n <DropdownButton\n fullWidth={true}\n showDropdownIcon={false}\n menuItems={filterOptions.map((filterOption) => {\n return {\n label: filterOption.label ?? filterOption.attributeName,\n onClick: () =>\n setTempFilters((prevTempFilters) => [\n ...prevTempFilters,\n {\n id: prevTempFilters.length,\n filterOption: {\n attributeName: filterOption.attributeName,\n label: filterOption.label,\n filterType: filterOption.filterType,\n },\n filterBy: {\n operator: getDefaultOperator(filterOption.filterType),\n },\n },\n ]),\n };\n })}\n >\n Add new filter\n </DropdownButton>\n </Grid>\n </Grid>\n </Box>\n </Container>\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button fullWidth variant=\"outlined\" onClick={cancel}>\n Cancel\n </Button>\n <Button fullWidth onClick={ok}>\n Apply {'(' + tempFilters.length + ')'}\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n","import { Dialog, DialogContent, DialogContentText, DialogActions, Button } from '@mui/material';\nimport { useEffect, useRef } from 'react';\nimport type { ReactNode } from 'react';\n\ninterface PageDialogProps {\n page: ReactNode;\n open: boolean;\n handleClose: () => void;\n resolve: () => void;\n}\n\nexport const PageDialog = ({ page, open, handleClose, resolve }: PageDialogProps) => {\n const descriptionElementRef = useRef<HTMLElement>(null);\n useEffect(() => {\n if (open) {\n const { current: descriptionElement } = descriptionElementRef;\n if (descriptionElement !== null) {\n descriptionElement.focus();\n }\n }\n }, [open]);\n\n const ok = () => {\n resolve();\n handleClose();\n };\n\n return (\n <Dialog open={open} onClose={ok} scroll=\"paper\">\n <DialogContent dividers={true}>\n <DialogContentText ref={descriptionElementRef} tabIndex={-1}>\n {page}\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button onClick={ok}>Ok</Button>\n </DialogActions>\n </Dialog>\n );\n};\n","import { TablePagination } from '@mui/material';\nimport type { MouseEvent, Dispatch, SetStateAction } from 'react';\n\nexport interface CustomTablePaginationProps {\n pageChange: (isNext: boolean) => Promise<void>;\n isNextButtonEnabled: boolean;\n page: number;\n rowPerPage: number;\n setPage: Dispatch<SetStateAction<number>>;\n}\n\nexport const CustomTablePagination = (props: CustomTablePaginationProps) => {\n const handleChangePage = async (event: MouseEvent<HTMLButtonElement> | null, newPage: number) => {\n let isNext = true;\n if (newPage < props.page) {\n isNext = false;\n }\n\n props.setPage(newPage);\n\n await props.pageChange(isNext);\n };\n\n return (\n <TablePagination\n component=\"div\"\n count={-1}\n page={props.page}\n onPageChange={handleChangePage}\n rowsPerPage={props.rowPerPage}\n rowsPerPageOptions={[props.rowPerPage]}\n labelDisplayedRows={({ from, to }) => `${from}–${to}`}\n nextIconButtonProps={{\n disabled: !props.isNextButtonEnabled,\n }}\n backIconButtonProps={{\n disabled: props.page === 0,\n }}\n />\n );\n};\n","import { createContext, useContext } from 'react';\nimport {\n ConfirmDialogProviderContext,\n FilterDialogProviderContext,\n PageDialogProviderContext,\n RangeDialogProviderContext,\n} from '@judo/components-api';\n\n// @ts-ignore\nexport const PageDialogContextState = createContext<PageDialogProviderContext>();\n\n// @ts-ignore\nexport const ConfirmDialogContextState = createContext<ConfirmDialogProviderContext>();\n\n// @ts-ignore\nexport const RangeDialogContextState = createContext<RangeDialogProviderContext>();\n\n// @ts-ignore\nexport const FilterDialogContextState = createContext<FilterDialogProviderContext>();\n\nexport const useFilterDialog = () => {\n const context = useContext(FilterDialogContextState);\n\n if (context === undefined) {\n throw new Error('useFilterDialog was used outside of its Provider');\n }\n\n return context;\n};\n\nconst usePageDialog = () => {\n const context = useContext(PageDialogContextState);\n\n if (context === undefined) {\n throw new Error('useConfirmDialog was used outside of its Provider');\n }\n\n return context;\n};\n\nconst useConfirmDialog = () => {\n const context = useContext(ConfirmDialogContextState);\n\n if (context === undefined) {\n throw new Error('useConfirmDialog was used outside of its Provider');\n }\n\n return context;\n};\n\nconst useRangeDialog = () => {\n const context = useContext(RangeDialogContextState);\n\n if (context === undefined) {\n throw new Error('useRangeDialog was used outside of its Provider');\n }\n\n return context;\n};\n","import { Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions, Button } from '@mui/material';\nimport {\n GridSortModel,\n GridRowModel,\n DataGrid,\n GridRowParams,\n GridColumns,\n GridSortItem,\n GridSelectionModel,\n GridToolbarContainer,\n GridRowId,\n} from '@mui/x-data-grid';\nimport { useSnackbar } from 'notistack';\nimport { useEffect, useRef, useState } from 'react';\nimport type { JudoStored, QueryCustomizer } from '@judo/data-api-common';\nimport type { Filter, FilterOption } from '@judo/components-api';\nimport { errorHandling } from '@judo/utilities';\nimport { CustomTablePagination } from '../CustomTablePagination';\nimport { useFilterDialog } from './hooks';\n\ninterface RangeDialogProps<T extends JudoStored<T>, U extends QueryCustomizer<T>> {\n resolve: (value: any) => void;\n open: boolean;\n handleClose: () => void;\n single?: boolean;\n columns: GridColumns<T>;\n defaultSortField: GridSortItem;\n rangeCall: (queryCustomizer: U) => Promise<Array<T>>;\n alreadySelectedItems: GridSelectionModel | GridRowId;\n initalQueryCustomizer: U;\n filterOptions: FilterOption[];\n}\n\nexport const RangeDialog = <T extends JudoStored<T>, U extends QueryCustomizer<T>>({\n resolve,\n open,\n handleClose,\n single = false,\n columns,\n defaultSortField,\n rangeCall,\n alreadySelectedItems,\n initalQueryCustomizer,\n filterOptions,\n}: RangeDialogProps<T, U>) => {\n const { openFilterDialog } = useFilterDialog();\n const { enqueueSnackbar } = useSnackbar();\n\n const descriptionElementRef = useRef<HTMLElement>(null);\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [rowCount, setRowCount] = useState<number>(0);\n const [sortModel, setSortModel] = useState<GridSortModel>([defaultSortField]);\n const [lastItem, setLastItem] = useState<T>();\n const [firstItem, setFirstItem] = useState<T>();\n const [isNextButtonEnabled, setIsNextButtonEnabled] = useState<boolean>(true);\n const [page, setPage] = useState<number>(0);\n const [data, setData] = useState<GridRowModel<T>[]>([]);\n const [selectionModel, setSelectionModel] = useState<GridSelectionModel | GridRowId | undefined>(\n alreadySelectedItems ?? (single ? undefined : []),\n );\n const [selectedItems, setSelectedItems] = useState<T[] | T | undefined>([]);\n const [filters, setFilters] = useState<Filter[]>([]);\n const [queryCustomizer, setQueryCustomizer] = useState<U>({\n ...initalQueryCustomizer,\n _seek: {\n limit: 6,\n },\n });\n\n const handlePageChange = async (isNext: boolean) => {\n setQueryCustomizer((prevQueryCustomizer) => {\n return {\n ...prevQueryCustomizer,\n _seek: {\n limit: isNext ? 6 : 5,\n reverse: !isNext,\n lastItem: isNext ? lastItem : firstItem,\n },\n };\n });\n\n setIsNextButtonEnabled(!isNext);\n };\n\n const fetchData = async () => {\n setIsLoading(true);\n try {\n const res = await rangeCall(queryCustomizer);\n\n if (res.length > 5) {\n setIsNextButtonEnabled(true);\n res.pop();\n } else if (queryCustomizer._seek?.limit === 6) {\n setIsNextButtonEnabled(false);\n }\n\n setData(res);\n setFirstItem(res[0]);\n setLastItem(res[res.length - 1]);\n setRowCount(res.length || 0);\n } catch (error) {\n errorHandling(error, enqueueSnackbar);\n }\n setIsLoading(false);\n };\n\n const handleFiltersChange = (newFilters: Filter[]) => {\n setPage(0);\n setFilters(newFilters);\n\n // @ts-ignore\n setQueryCustomizer((prevQueryCustomizer) => {\n const tempQueryCustomizer = { ...prevQueryCustomizer };\n\n filterOptions.forEach(\n (filter) =>\n // @ts-ignore\n (tempQueryCustomizer[filter.attributeName] = mapFiltersToQueryCustomizerProperty(\n newFilters,\n filter.attributeName,\n )),\n );\n\n return {\n ...prevQueryCustomizer,\n _seek: {\n lastItem: undefined,\n limit: 6,\n reverse: undefined,\n },\n ...tempQueryCustomizer,\n };\n });\n };\n\n const handleSortModelChange = (newModel: GridSortModel) => {\n setPage(0);\n setSortModel(newModel);\n\n const { field, sort } = newModel[0];\n\n setQueryCustomizer((prevQueryCustomizer) => {\n return {\n ...prevQueryCustomizer,\n _orderBy: [{ attribute: field, descending: sort === 'desc' }],\n };\n });\n };\n\n // useEffect(() => {\n // setPage(0);\n // const { field, sort } = sortModel[0];\n\n // setQueryCustomizer((prevQueryCustomizer) => {\n // const tempQueryCustomizer = { ...prevQueryCustomizer };\n\n // filterOptions.forEach(\n // (filter) =>\n // // @ts-ignore\n // (tempQueryCustomizer[filter.attributeName] = mapFiltersToQueryCustomizerProperty(\n // filters,\n // filter.attributeName,\n // )),\n // );\n\n // return {\n // ...prevQueryCustomizer,\n // _seek: {\n // lastItem: undefined,\n // limit: 6,\n // reverse: undefined,\n // },\n // _orderBy: [{ attribute: field, descending: sort === 'desc' }],\n // ...tempQueryCustomizer,\n // };\n // });\n // }, [sortModel, filters]);\n\n useEffect(() => {\n fetchData();\n }, [queryCustomizer]);\n\n useEffect(() => {\n if (open) {\n const { current: descriptionElement } = descriptionElementRef;\n if (descriptionElement !== null) {\n descriptionElement.focus();\n }\n }\n }, [open]);\n\n const cancel = () => {\n handleClose();\n resolve(undefined);\n };\n\n const ok = () => {\n handleClose();\n resolve(selectedItems);\n };\n\n const handleOnSelection = (newSelectionModel: GridSelectionModel) => {\n if (!Array.isArray(selectionModel)) return;\n\n // added new items\n if (newSelectionModel.length > selectionModel.length) {\n const diff = newSelectionModel.length - selectionModel.length;\n const newItemsId = [...newSelectionModel].slice(diff * -1);\n const newItems = data.filter((value) => newItemsId.indexOf(value.__identifier as GridRowId) !== -1);\n setSelectedItems((prevSelectedItems) => {\n if (!Array.isArray(prevSelectedItems)) return;\n\n return [...prevSelectedItems, ...newItems];\n });\n }\n\n // removed items\n if (newSelectionModel.length < selectionModel.length) {\n const removedItemsId = selectionModel.filter((value) => newSelectionModel.indexOf(value) === -1);\n setSelectedItems((prevSelectedItems) => {\n if (!Array.isArray(prevSelectedItems)) return;\n\n return [...prevSelectedItems.filter((value) => removedItemsId.indexOf(value.__identifier as GridRowId) === -1)];\n });\n }\n\n setSelectionModel(newSelectionModel);\n };\n\n const handleSingleOnSelection = (newSelectionModel: GridSelectionModel) => {\n if (Array.isArray(selectionModel)) return;\n\n if (newSelectionModel.length === 0) {\n setSelectionModel('');\n setSelectedItems(undefined);\n return;\n }\n\n const lastId = newSelectionModel[newSelectionModel.length - 1];\n\n setSelectionModel(lastId);\n setSelectedItems(data.find((value) => value.__identifier === lastId));\n };\n\n const handleIsRowSelectable = (params: GridRowParams<T>) => {\n if (alreadySelectedItems) {\n if (!Array.isArray(alreadySelectedItems)) throw Error('Range dialog gets wrong alreadySelectedItems.');\n\n return !alreadySelectedItems.includes(params.id);\n }\n\n return true;\n };\n\n return (\n <Dialog open={open} onClose={cancel} scroll=\"paper\" fullWidth={true} maxWidth={'sm'}>\n <DialogTitle id=\"scroll-dialog-title\">Select</DialogTitle>\n <DialogContent dividers={true}>\n <DialogContentText id=\"scroll-dialog-description\" ref={descriptionElementRef} tabIndex={-1}>\n <DataGrid\n sx={\n single\n ? {\n '.MuiDataGrid-columnHeaderCheckbox .MuiDataGrid-columnHeaderTitleContainer': {\n display: 'none',\n },\n }\n : undefined\n }\n autoHeight\n getRowId={(row: T) => row.__identifier as GridRowId}\n loading={isLoading}\n paginationMode=\"server\"\n rows={data}\n rowCount={rowCount}\n sortingOrder={['desc', 'asc']}\n sortingMode=\"server\"\n sortModel={sortModel}\n onSortModelChange={handleSortModelChange}\n checkboxSelection\n onSelectionModelChange={!single ? handleOnSelection : handleSingleOnSelection}\n isRowSelectable={!single ? handleIsRowSelectable : undefined}\n selectionModel={selectionModel}\n hideFooterSelectedRowCount={single}\n columns={columns}\n keepNonExistentRowsSelected\n components={{\n Toolbar: () => (\n <GridToolbarContainer>\n <Button\n variant=\"outlined\"\n onClick={async () => {\n const newFilters = await openFilterDialog(filterOptions, filters);\n\n if (newFilters) {\n handleFiltersChange(newFilters);\n }\n }}\n disabled={isLoading}\n >\n Set filters {filters.length !== 0 ? '(' + filters.length + ')' : ''}\n </Button>\n </GridToolbarContainer>\n ),\n Pagination: () => (\n <CustomTablePagination\n pageChange={handlePageChange}\n isNextButtonEnabled={isNextButtonEnabled}\n page={page}\n setPage={setPage}\n rowPerPage={5}\n />\n ),\n }}\n />\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button onClick={cancel}>Cancel</Button>\n <Button onClick={ok}>Ok</Button>\n </DialogActions>\n </Dialog>\n );\n};\n","import { useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { ConfirmationDialog } from './ConfirmationDialog';\nimport { FilterDialog } from './FilterDialog';\nimport { PageDialog } from './PageDialog';\nimport { RangeDialog } from './RangeDialog';\nimport type {\n ConfirmDialogProviderContext,\n DialogProviderProps,\n FilterDialogProviderContext,\n OpenRangeDialogProps,\n PageDialogProviderContext,\n RangeDialogProviderContext,\n} from '@judo/components-api';\nimport type { Filter, FilterOption } from '@judo/components-api';\nimport type { JudoStored, QueryCustomizer } from '@judo/data-api-common';\nimport {\n ConfirmDialogContextState,\n FilterDialogContextState,\n PageDialogContextState,\n RangeDialogContextState,\n} from './hooks';\n\nexport const DialogProvider = ({ children }: DialogProviderProps) => {\n // Page Dialog\n const [isOpenPageDialog, setIsOpenPageDialog] = useState(false);\n const [pageDialog, setPageDialog] = useState<ReactNode>();\n\n const handleClosePageDialog = () => {\n setIsOpenPageDialog(false);\n };\n\n const handleOpenPageDialog = async (page: ReactNode) => {\n setIsOpenPageDialog(true);\n return new Promise<void>((resolve) => {\n setPageDialog(<PageDialog page={page} handleClose={handleClosePageDialog} open={true} resolve={resolve} />);\n });\n };\n\n const pageDialogContext: PageDialogProviderContext = {\n openPageDialog: handleOpenPageDialog,\n };\n\n // Range Dialog\n const [isOpenRangeDialog, setIsOpenRangeDialog] = useState(false);\n const [rangeDialog, setRangeDialog] = useState<ReactNode>();\n\n const handleCloseRangeDialog = () => {\n setIsOpenRangeDialog(false);\n };\n\n const handleOpenRangeDialog = async <T extends JudoStored<T>, U extends QueryCustomizer<T>>({\n columns,\n defaultSortField,\n rangeCall,\n single = false,\n alreadySelectedItems,\n filterOptions,\n initialQueryCustomizer,\n }: OpenRangeDialogProps<T, U>) => {\n setIsOpenRangeDialog(true);\n\n return new Promise<T[] | T>((resolve) => {\n setRangeDialog(\n <RangeDialog<T, U>\n handleClose={handleCloseRangeDialog}\n open={true}\n resolve={resolve}\n columns={columns}\n defaultSortField={defaultSortField}\n rangeCall={rangeCall}\n single={single}\n alreadySelectedItems={alreadySelectedItems}\n filterOptions={filterOptions}\n initalQueryCustomizer={initialQueryCustomizer}\n />,\n );\n });\n };\n\n const customDialogContext: RangeDialogProviderContext = {\n openRangeDialog: handleOpenRangeDialog,\n };\n\n // Confirmation Dialog\n const [isOpenConfirmDialog, setIsOpenConfirmDialog] = useState(false);\n const [confirmDialog, setConfirmDialog] = useState<ReactNode>();\n\n const handleCloseConfirmDialog = () => {\n setIsOpenConfirmDialog(false);\n return false;\n };\n\n const handleOpenConfirmDialog = async (confirmationMessage: string | ReactNode, title?: string | ReactNode) => {\n setIsOpenConfirmDialog(true);\n\n return new Promise<boolean>((resolve) => {\n setConfirmDialog(\n <ConfirmationDialog\n confirmationMessage={confirmationMessage}\n title={title}\n handleClose={handleCloseConfirmDialog}\n open={true}\n resolve={resolve}\n />,\n );\n });\n };\n\n const confirmDialogContext: ConfirmDialogProviderContext = {\n openConfirmDialog: handleOpenConfirmDialog,\n };\n\n // Filter dialog\n const [isOpenFilterDialog, setIsOpenFilterDialog] = useState(false);\n const [filterDialog, setFilterDialog] = useState<ReactNode>();\n\n const handleCloseFilterDialog = () => {\n setIsOpenFilterDialog(false);\n return false;\n };\n\n const handleOpenFilterDialog = async (filterOptions: FilterOption[], filters?: Filter[]) => {\n setIsOpenFilterDialog(true);\n\n return new Promise<Filter[]>((resolve) => {\n setFilterDialog(\n <FilterDialog\n filters={filters}\n filterOptions={filterOptions}\n handleClose={handleCloseFilterDialog}\n open={true}\n resolve={resolve}\n />,\n );\n });\n };\n\n const filterDialogContext: FilterDialogProviderContext = {\n openFilterDialog: handleOpenFilterDialog,\n };\n\n return (\n <PageDialogContextState.Provider value={pageDialogContext}>\n <ConfirmDialogContextState.Provider value={confirmDialogContext}>\n <RangeDialogContextState.Provider value={customDialogContext}>\n <FilterDialogContextState.Provider value={filterDialogContext}>\n {children}\n {isOpenPageDialog && pageDialog}\n {isOpenConfirmDialog && confirmDialog}\n {isOpenRangeDialog && rangeDialog}\n {isOpenFilterDialog && filterDialog}\n </FilterDialogContextState.Provider>\n </RangeDialogContextState.Provider>\n </ConfirmDialogContextState.Provider>\n </PageDialogContextState.Provider>\n );\n};\n","import type { ColumnActionsProvider, ColumnsActionsOptions, TableRowAction } from '@judo/utilities';\nimport { exists } from '@judo/utilities';\nimport { MoreHoriz } from '@mui/icons-material';\nimport { Button } from '@mui/material';\nimport { GridColDef, GridRenderCellParams } from '@mui/x-data-grid';\nimport { DropdownButton } from '../DropdownButton';\n\nexport const columnsActionCalculator: ColumnActionsProvider<any> = (\n actions: TableRowAction<any>[],\n options?: ColumnsActionsOptions,\n): GridColDef[] => {\n if (!exists(actions) || actions.length === 0) {\n return [];\n }\n\n let shownActionsNumber = 1;\n if (options?.shownActions) {\n shownActionsNumber = actions.length < options.shownActions ? actions.length : options.shownActions;\n }\n\n if (shownActionsNumber < 0) {\n return standaloneActions(actions, options);\n } else if (shownActionsNumber === 0) {\n return [];\n } else if (shownActionsNumber === 1) {\n return dropdownActions(actions, options);\n } else {\n const sliceNumber = actions.length === shownActionsNumber ? shownActionsNumber : shownActionsNumber - 1;\n const standaloneRowActions = actions.slice(0, sliceNumber);\n const dropdownRowActions = actions.slice(sliceNumber);\n\n return [...standaloneActions(standaloneRowActions, options), ...dropdownActions(dropdownRowActions, options)];\n }\n};\n\nconst standaloneActions: ColumnActionsProvider<unknown> = (\n actions: TableRowAction<unknown>[],\n options?: ColumnsActionsOptions,\n): GridColDef[] => {\n return actions.map((action, index) => {\n return {\n field: action.label + index,\n headerName: '',\n align: 'center',\n type: 'actions',\n renderCell: (params: GridRenderCellParams) => {\n return (\n <Button variant=\"text\" onClick={() => action.action(params.row)}>\n {action.icon}\n {(options?.showLabel ?? true) && action.label}\n </Button>\n );\n },\n };\n });\n};\n\nconst dropdownActions: ColumnActionsProvider<unknown> = (actions: TableRowAction<unknown>[]): GridColDef[] => {\n if (actions.length === 0) return [];\n\n return [\n {\n field: 'actions',\n headerName: '',\n align: 'center',\n type: 'actions',\n renderCell: (params: GridRenderCellParams) => {\n return (\n <DropdownButton\n variant=\"text\"\n showDropdownIcon={false}\n menuItems={actions.map((action) => {\n return {\n label: action.label,\n startIcon: action.icon,\n onClick: () => action.action(params.row),\n };\n })}\n >\n <MoreHoriz />\n </DropdownButton>\n );\n },\n },\n ];\n};\n","import { Delete, LinkOff, NoteAdd, Visibility } from '@mui/icons-material';\nimport { ButtonBase, Grid, IconButton, InputAdornment, TextField } from '@mui/material';\nimport { useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { exists } from '@judo/utilities';\n\ninterface AggregationInputProps {\n name?: string;\n id?: string;\n label?: string;\n value: any | undefined | null;\n error?: boolean | undefined;\n helperText?: string | undefined;\n disabled?: boolean | undefined;\n readonly?: boolean | undefined;\n labelList: string[];\n icon?: ReactNode;\n onSet?: () => Promise<void> | undefined;\n onView?: () => void | undefined;\n onCreate?: () => void | undefined;\n onDelete?: () => Promise<void> | undefined;\n onRemove?: () => void | undefined;\n}\n\ninterface ViewIconsProps {\n value: any | undefined | null;\n disabled: boolean;\n onView?: () => void | undefined;\n onCreate?: () => void | undefined;\n onDelete?: () => Promise<void> | undefined;\n}\n\ninterface EditIconsProps {\n value: any | undefined | null;\n disabled: boolean;\n onRemove?: () => void | undefined;\n}\n\nexport const AggregationInput = ({\n name,\n id,\n label,\n value,\n error = false,\n helperText,\n disabled = false,\n readonly = true,\n labelList,\n icon,\n onSet,\n onView,\n onCreate,\n onRemove,\n onDelete,\n}: AggregationInputProps) => {\n const [focused, setFocused] = useState(false);\n\n let icons: ReactNode;\n\n if (readonly) {\n icons = <ViewIcons value={value} disabled={disabled} onCreate={onCreate} onView={onView} onDelete={onDelete} />;\n } else {\n icons = <EditIcons value={value} disabled={disabled} onRemove={onRemove} />;\n }\n\n return (\n <Grid container item direction=\"row\" justifyContent=\"stretch\" alignContent=\"stretch\">\n <ButtonBase\n sx={{ padding: 0 }}\n disabled={disabled || readonly}\n onFocusCapture={() => setFocused(true)}\n onBlur={() => setFocused(false)}\n onClick={onSet}\n >\n <TextField\n disabled={!onSet || disabled}\n name={name}\n id={id}\n label={label}\n error={error}\n helperText={helperText}\n focused={focused}\n fullWidth\n value={labelList.join(' - ')}\n className={!readonly ? undefined : 'Mui-readOnly'}\n sx={{\n ':hover': {\n cursor: 'pointer',\n },\n '.MuiFilledInput-input:hover': {\n cursor: 'pointer',\n },\n }}\n InputProps={{\n readOnly: true,\n startAdornment: <InputAdornment position=\"start\">{icon}</InputAdornment>,\n }}\n />\n </ButtonBase>\n {icons}\n </Grid>\n );\n};\n\nconst ViewIcons = ({ value, disabled, onCreate, onDelete, onView }: ViewIconsProps) => {\n let icons: ReactNode;\n\n if (exists(value)) {\n icons = (\n <>\n {onView && (\n <IconButton disabled={disabled} onClick={onView}>\n <Visibility />\n </IconButton>\n )}\n {onDelete && (\n <IconButton disabled={disabled} onClick={onDelete}>\n <Delete />\n </IconButton>\n )}\n </>\n );\n } else {\n icons = (\n <>\n {onCreate && (\n <IconButton disabled={disabled} onClick={onCreate}>\n <NoteAdd />\n </IconButton>\n )}\n </>\n );\n }\n\n return <>{icons}</>;\n};\n\nconst EditIcons = ({ value, disabled, onRemove }: EditIconsProps) => {\n let icons: ReactNode;\n\n if (exists(value)) {\n icons = (\n <>\n {onRemove && (\n <IconButton disabled={disabled} onClick={onRemove}>\n <LinkOff />\n </IconButton>\n )}\n </>\n );\n } else {\n icons = <></>;\n }\n\n return <>{icons}</>;\n};\n","import { Home } from '@mui/icons-material';\nimport { Breadcrumbs, Typography } from '@mui/material';\nimport { useState, useContext, createContext, useMemo, useEffect } from 'react';\nimport type { ReactNode } from 'react';\nimport { useLocation, useNavigate } from 'react-router-dom';\nimport type { To } from 'react-router-dom';\n\ninterface BreadcrumbProviderProps {\n children: ReactNode;\n}\n\nexport type JudoNavigationSetTitle = (pageTitle: string) => void;\n\ninterface JudoNavigationProviderContext {\n clearNavigate: (to: To) => void;\n navigate: (to: To) => void;\n back: () => void;\n isBackDisabled: boolean;\n setTitle: JudoNavigationSetTitle;\n}\n\ninterface BreadcrumbItem {\n key: string;\n path: To;\n label: string | null;\n}\n\n// @ts-ignore\nconst JudoNavigationContextState = createContext<JudoNavigationProviderContext>();\n\nconst BreadcrumbContextState = createContext<BreadcrumbItem[]>([]);\n\nexport const useJudoNavigation = () => {\n const context = useContext(JudoNavigationContextState);\n\n if (context === undefined) {\n throw new Error('useJudoNavigation was used outside of its Provider');\n }\n\n return context;\n};\n\nexport const BreadcrumbProvider = ({ children }: BreadcrumbProviderProps) => {\n const navigate = useNavigate();\n const location = useLocation();\n\n const [breadcrumbItems, setBreadcrumbItems] = useState<BreadcrumbItem[]>([]);\n const [nextBreadcrumbItem, setNextBreadcrumbItem] = useState<BreadcrumbItem>({} as any);\n\n useEffect(() => {\n setNextBreadcrumbItem((prevNextBreadcrumbItem) => {\n return {\n ...prevNextBreadcrumbItem,\n key: '0.' + location.pathname,\n path: location.pathname,\n };\n });\n }, []);\n\n const isBackDisabled = useMemo(() => {\n return breadcrumbItems.length === 0;\n }, [breadcrumbItems]);\n\n const judoNavigationContext = {\n clearNavigate: (to: To) => {\n setBreadcrumbItems([]);\n setNextBreadcrumbItem({\n key: '0.' + to.toString(),\n label: null,\n path: to,\n });\n\n navigate(to);\n },\n navigate: (to: To) => {\n if (nextBreadcrumbItem.label === null) {\n throw Error('Page title has not been set!');\n }\n\n setBreadcrumbItems((prevBreadCrumbItems) => {\n return [...prevBreadCrumbItems, nextBreadcrumbItem];\n });\n\n setNextBreadcrumbItem({\n key: breadcrumbItems.length + '.' + to.toString(),\n label: null,\n path: to,\n });\n\n navigate(to);\n },\n back: () => {\n if (breadcrumbItems.length !== 0) {\n const lastItem = breadcrumbItems[breadcrumbItems.length - 1];\n setNextBreadcrumbItem(lastItem);\n setBreadcrumbItems((prevBreadcrumbItems) => {\n return [...prevBreadcrumbItems.slice(0, prevBreadcrumbItems.length - 1)];\n });\n navigate(lastItem.path);\n return;\n }\n\n setBreadcrumbItems([]);\n setNextBreadcrumbItem({\n key: '0.' + '/'.toString(),\n label: null,\n path: '/',\n });\n\n navigate('/');\n },\n isBackDisabled: isBackDisabled,\n setTitle: (pageTitle: string) => {\n setNextBreadcrumbItem((prevNextBreadcrumbItem) => {\n return { ...prevNextBreadcrumbItem, label: pageTitle };\n });\n },\n };\n\n return (\n <BreadcrumbContextState.Provider value={breadcrumbItems}>\n <JudoNavigationContextState.Provider value={judoNavigationContext}>\n {children}\n </JudoNavigationContextState.Provider>\n </BreadcrumbContextState.Provider>\n );\n};\n\nexport const CustomBreadcrumb = () => {\n const breadcrumbItems = useContext(BreadcrumbContextState);\n\n return (\n <Breadcrumbs maxItems={2} separator=\">\">\n <Home />\n {breadcrumbItems.map(({ label, key }, index) => {\n return (\n <Typography color=\"text.primary\" key={key}>\n {label}\n </Typography>\n );\n })}\n </Breadcrumbs>\n );\n};\n","import { useMatch, useResolvedPath } from 'react-router-dom';\nimport type { LinkProps } from 'react-router-dom';\nimport { theme } from '@judo/theme';\nimport { ListItem, ListItemButton } from '@mui/material';\nimport { useJudoNavigation } from './CustomBreadcrumb';\n\nconst customLinkItemStyle = {\n py: '2px',\n px: 3,\n color: theme.palette.text.secondary,\n '&:hover, &:focus': {\n color: theme.palette.secondary.main,\n },\n '&.Mui-selected': {\n color: theme.palette.secondary.main,\n },\n};\n\nexport function CustomLink({ children, to, ...props }: LinkProps) {\n const resolved = useResolvedPath(to);\n const match = useMatch({ path: resolved.pathname, end: true });\n const { clearNavigate } = useJudoNavigation();\n\n const onClickHandler = () => {\n clearNavigate(to);\n };\n\n return (\n <ListItem disablePadding style={{ textDecoration: 'none' }}>\n <ListItemButton selected={!!match} sx={customLinkItemStyle} onClick={onClickHandler}>\n {children}\n </ListItemButton>\n </ListItem>\n );\n}\n","import { AppBar, Toolbar, Grid, Typography, Divider } from '@mui/material';\nimport { useEffect } from 'react';\nimport type { ReactNode } from 'react';\nimport { useJudoNavigation } from './CustomBreadcrumb';\n\ninterface PageHeaderProps {\n title: string;\n children: ReactNode;\n}\n\nexport const PageHeader = ({ title, children }: PageHeaderProps) => {\n const { setTitle } = useJudoNavigation();\n\n useEffect(() => {\n setTitle(title);\n }, [title]);\n\n return (\n <>\n <AppBar component=\"div\" position=\"static\" elevation={0} sx={{ zIndex: 0 }}>\n <Toolbar>\n <Grid container alignItems=\"center\" spacing={1}>\n <Grid item xs>\n <Typography component=\"span\" color=\"text.primary\" variant=\"h5\">\n {title}\n </Typography>\n </Grid>\n {children}\n </Grid>\n </Toolbar>\n </AppBar>\n <Divider />\n </>\n );\n};\n"],"names":["ConfirmationDialog","confirmationMessage","title","resolve","open","handleClose","descriptionElementRef","useRef","useEffect","current","descriptionElement","focus","_jsxs","Dialog","onClose","scroll","fullWidth","maxWidth","children","_jsx","DialogTitle","id","DialogContent","dividers","DialogContentText","ref","tabIndex","DialogActions","Button","variant","onClick","TRINARY_LOGIC","Map","FilterType","e","i","t","r","location","preventDuplicate","persist","duration","autoHideDuration","setValidation","forEach","set","code","a","o","message","marginTop","marginBottom","display","flexDirection","alignItems","palette","mode","primary","main","secondary","text","background","default","subtitleColor","typography","h5","fontWeight","fontSize","letterSpacing","shape","borderRadius","components","MuiTab","defaultProps","disableRipple","mixins","toolbar","minHeight","MuiAppBar","styleOverrides","colorPrimary","backgroundColor","MuiButton","size","root","textTransform","paddingLeft","paddingRight","contained","boxShadow","outlined","border","MuiInputLabel","color","MuiFilledInput","input","WebkitBackgroundClip","borderBottom","MuiTextField","MuiSelect","filled","MuiDataGrid","toolbarContainer","padding","MuiPaper","rounded","MuiDrawer","paper","MuiTabs","marginLeft","spacing","indicator","height","borderTopLeftRadius","borderTopRightRadius","common","white","margin","minWidth","breakpoints","up","MuiIconButton","MuiTooltip","tooltip","MuiDivider","middle","MuiListItemButton","disableTouchRipple","MuiListItemText","fontWeightMedium","MuiListItemIcon","marginRight","MuiAvatar","width","MuiCard","length","l","DropdownButton","menuItems","disabled","showDropdownIcon","setOpen","useState","anchorRef","event","contains","target","handleListKeyDown","key","preventDefault","prevOpen","_Fragment","endIcon","KeyboardArrowDown","Popper","anchorEl","placement","transition","style","zIndex","scrollWidth","TransitionProps","Grow","transformOrigin","Paper","ClickAwayListener","onClickAway","MenuList","autoFocusItem","onKeyDown","filter","menuItem","visible","map","index","MenuItem","label","startIcon","equals","notEquals","lessThan","greaterThan","lessOrEqual","greaterOrEqual","equal","notEqual","matches","like","TrinaryLogicCombobox","readOnly","value","name","error","helperText","onChange","onChangeHandler","Array","from","values","indexOf","keysArray","keys","undefined","TextField","select","get","className","InputProps","startAdornment","InputAdornment","position","CheckBoxOutlined","getDefaultOperator","filterType","boolean","_BooleanOperation","date","dateTime","_NumericOperation","enumeration","_EnumerationOperation","numeric","string","_StringOperation","trinaryLogic","getOperatorsByFilter","filterOption","Object","FilterOperator","setFilterOperator","filterBy","operator","getOperationEnumValue","item","FilterInput","setFilterValue","exists","enumValues","Error","attributeName","FormControlLabel","control","Checkbox","checked","DatePicker","renderInput","props","newValue","toISOString","substring","dateToJudoDateString","Icon","path","mdiCalendarMonth","DateTimePicker","mdiCalendarClock","type","Number","mdiNumeric","mdiFormatTextVariant","FilterRow","closeHandler","Grid","container","xs","IconButton","Close","Transition","forwardRef","Slide","direction","FilterDialog","filters","filterOptions","tempFilters","setTempFilters","updateFilterValue","prevTempFilters","tempFilter","updateFilterOperator","filterCloseHandler","cancel","TransitionComponent","disableEnforceFocus","sx","justifyContent","PaperProps","m","Typography","component","Container","Box","mainContainerPadding","PageDialog","page","ok","CustomTablePagination","TablePagination","count","onPageChange","async","newPage","isNext","setPage","pageChange","rowsPerPage","rowPerPage","rowsPerPageOptions","labelDisplayedRows","to","nextIconButtonProps","isNextButtonEnabled","backIconButtonProps","PageDialogContextState","createContext","ConfirmDialogContextState","RangeDialogContextState","FilterDialogContextState","RangeDialog","single","columns","defaultSortField","rangeCall","alreadySelectedItems","initalQueryCustomizer","openFilterDialog","context","useContext","useFilterDialog","enqueueSnackbar","useSnackbar","isLoading","setIsLoading","rowCount","setRowCount","sortModel","setSortModel","lastItem","setLastItem","firstItem","setFirstItem","setIsNextButtonEnabled","data","setData","selectionModel","setSelectionModel","selectedItems","setSelectedItems","setFilters","queryCustomizer","setQueryCustomizer","_seek","limit","handlePageChange","prevQueryCustomizer","reverse","fetchData","res","pop","s","isAxiosError","n","response","status","errorHandling","DataGrid","autoHeight","getRowId","row","__identifier","loading","paginationMode","rows","sortingOrder","sortingMode","onSortModelChange","newModel","field","sort","_orderBy","attribute","descending","checkboxSelection","onSelectionModelChange","newSelectionModel","isArray","lastId","find","diff","newItemsId","slice","newItems","prevSelectedItems","removedItemsId","isRowSelectable","params","includes","hideFooterSelectedRowCount","keepNonExistentRowsSelected","Toolbar","GridToolbarContainer","newFilters","tempQueryCustomizer","mapFiltersToQueryCustomizerProperty","handleFiltersChange","Pagination","DialogProvider","isOpenPageDialog","setIsOpenPageDialog","pageDialog","setPageDialog","handleClosePageDialog","pageDialogContext","openPageDialog","Promise","isOpenRangeDialog","setIsOpenRangeDialog","rangeDialog","setRangeDialog","handleCloseRangeDialog","customDialogContext","openRangeDialog","initialQueryCustomizer","isOpenConfirmDialog","setIsOpenConfirmDialog","confirmDialog","setConfirmDialog","handleCloseConfirmDialog","confirmDialogContext","openConfirmDialog","isOpenFilterDialog","setIsOpenFilterDialog","filterDialog","setFilterDialog","handleCloseFilterDialog","filterDialogContext","Provider","columnsActionCalculator","actions","options","shownActionsNumber","shownActions","standaloneActions","dropdownActions","sliceNumber","standaloneRowActions","dropdownRowActions","action","headerName","align","renderCell","icon","showLabel","MoreHoriz","AggregationInput","readonly","labelList","onSet","onView","onCreate","onRemove","onDelete","focused","setFocused","icons","ViewIcons","EditIcons","alignContent","ButtonBase","onFocusCapture","onBlur","join","cursor","Visibility","Delete","NoteAdd","LinkOff","JudoNavigationContextState","BreadcrumbContextState","useJudoNavigation","BreadcrumbProvider","navigate","useNavigate","useLocation","breadcrumbItems","setBreadcrumbItems","nextBreadcrumbItem","setNextBreadcrumbItem","prevNextBreadcrumbItem","pathname","judoNavigationContext","clearNavigate","toString","prevBreadCrumbItems","back","prevBreadcrumbItems","isBackDisabled","useMemo","setTitle","pageTitle","CustomBreadcrumb","Breadcrumbs","maxItems","separator","Home","customLinkItemStyle","py","px","theme","CustomLink","resolved","useResolvedPath","match","useMatch","end","ListItem","disablePadding","textDecoration","ListItemButton","selected","PageHeader","AppBar","elevation","Divider"],"mappings":"6wCAIa,MAAAA,GAAqB,EAChCC,sBACAC,QACAC,UACAC,OACAC,kBAEA,MAAMC,EAAwBC,EAAoB,MAClDC,GAAU,KACR,GAAIJ,EAAM,CACR,MAAQK,QAASC,GAAuBJ,EACb,OAAvBI,GACFA,EAAmBC,OAEtB,IACA,CAACP,IAYJ,OACEQ,EAACC,EAAM,CAACT,KAAMA,EAAMU,QAAST,EAAaU,OAAO,QAAQC,WAAW,EAAMC,SAAU,KACjFC,SAAA,CAAAhB,GAASiB,EAACC,GAAYC,GAAG,sBAAuBH,SAAAhB,IACjDiB,EAACG,EAAc,CAAAC,WAAYrB,EAAKgB,SAC9BC,EAACK,GAAkBH,GAAG,4BAA4BI,IAAKnB,EAAuBoB,UAAW,EACtFR,SAAAjB,MAGLW,EAACe,EAAa,CAAAT,SAAA,CACZC,EAACS,EAAM,CAACC,QAAQ,OAAOC,QAnBd,KACbzB,IACAF,GAAQ,EAAM,EAmBDe,SAAA,OACTC,EAACS,EAAM,CAACC,QAAQ,OAAOC,QAjBlB,KACTzB,IACAF,GAAQ,EAAK,EAiBAe,SAAA,aAGb,EChDEa,GAAgB,IAAIC,IAAI,CAC1B,CAAC,KAAM,WACP,EAAC,EAAM,OACP,EAAC,EAAO,QAGZ,IAAIC,IACJ,SAAWA,GACPA,EAAWA,EAAoB,QAAI,GAAK,UACxCA,EAAWA,EAAoB,QAAI,GAAK,UACxCA,EAAWA,EAAmB,OAAI,GAAK,SACvCA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