@zydon/common 2.8.82 → 2.8.83

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.
@@ -11,7 +11,7 @@ interface ImageContainerProps {
11
11
 
12
12
  declare const Avatar: react.MemoExoticComponent<react.ForwardRefExoticComponent<Omit<PropsWithChildren<ImageContainerProps & _mui_material_Avatar.AvatarOwnProps & _mui_material_Avatar.AvatarSlotsAndSlotProps & _mui_material_OverridableComponent.CommonProps & Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
13
13
  ref?: ((instance: HTMLDivElement | null) => void) | react.RefObject<HTMLDivElement> | null | undefined;
14
- }, "children" | "className" | "style" | "classes" | "sx" | "variant" | "slots" | "slotProps" | "alt" | "src" | "sizes" | "srcSet" | "imgProps"> & {
14
+ }, "children" | "className" | "style" | "classes" | "sx" | "variant" | "slots" | "slotProps" | "sizes" | "alt" | "src" | "srcSet" | "imgProps"> & {
15
15
  component?: react.ElementType<any, keyof react.JSX.IntrinsicElements> | undefined;
16
16
  }>, "ref"> & react.RefAttributes<HTMLDivElement>>>;
17
17
 
@@ -90,7 +90,7 @@ declare const SelectionOverlay: _emotion_styled.StyledComponent<_mui_material_St
90
90
  }, keyof _mui_material_OverridableComponent.CommonProps | keyof _mui_material_Stack.StackOwnProps> & _mui_system.MUIStyledCommonProps<_mui_material_styles.Theme>, {}, {}>;
91
91
  declare const SelectionCount: _emotion_styled.StyledComponent<_mui_material_Typography.TypographyOwnProps & _mui_material_OverridableComponent.CommonProps & Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
92
92
  ref?: ((instance: HTMLSpanElement | null) => void) | react.RefObject<HTMLSpanElement> | null | undefined;
93
- }, "fontFamily" | "children" | "pt" | "className" | "style" | "classes" | "sx" | "variant" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "color" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "p" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & _mui_system.MUIStyledCommonProps<_mui_material_styles.Theme>, {}, {}>;
93
+ }, "typography" | "zIndex" | "fontFamily" | "fontWeight" | "children" | "pt" | "className" | "style" | "classes" | "sx" | "variant" | "border" | "boxShadow" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "color" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "p" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "displayPrint" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & _mui_system.MUIStyledCommonProps<_mui_material_styles.Theme>, {}, {}>;
94
94
  declare const SelectionActions: _emotion_styled.StyledComponent<_mui_material_Stack.StackOwnProps & _mui_material_OverridableComponent.CommonProps & Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
95
95
  ref?: ((instance: HTMLDivElement | null) => void) | react.RefObject<HTMLDivElement> | null | undefined;
96
96
  }, keyof _mui_material_OverridableComponent.CommonProps | keyof _mui_material_Stack.StackOwnProps> & _mui_system.MUIStyledCommonProps<_mui_material_styles.Theme>, {}, {}>;
@@ -1,8 +1,8 @@
1
1
  import '../../chunk-4P2L7UJA.js';
2
2
  export { a as FilterOperator, b as SortType } from '../../chunk-M62EJMQ6.js';
3
- import { a as a$2 } from '../../chunk-WLRSUL67.js';
3
+ import { a as a$4 } from '../../chunk-WLRSUL67.js';
4
4
  import { d, c } from '../../chunk-N7IK5EUP.js';
5
- import { h, a as a$4 } from '../../chunk-OF6623HG.js';
5
+ import { h, a as a$6 } from '../../chunk-OF6623HG.js';
6
6
  import { d as d$1 } from '../../chunk-Z275MVEP.js';
7
7
  import '../../chunk-R2BCPHRH.js';
8
8
  import '../../chunk-4F2NKGF6.js';
@@ -11,51 +11,52 @@ import '../../chunk-6U5LS7MP.js';
11
11
  import '../../chunk-LZQ7OFKO.js';
12
12
  import '../../chunk-NIQW2J3M.js';
13
13
  import '../../chunk-PRWQQJDL.js';
14
- import { a as a$3 } from '../../chunk-3PMDTIVB.js';
14
+ import { a as a$5 } from '../../chunk-3PMDTIVB.js';
15
15
  import '../../chunk-5J35UAV6.js';
16
16
  import { e } from '../../chunk-XUDTPZHF.js';
17
17
  import '../../chunk-UVPQR2Q2.js';
18
18
  import '../../chunk-RBTYTONM.js';
19
19
  import '../../chunk-F65ZXAGV.js';
20
20
  import '../../chunk-I4PPSW36.js';
21
+ import { a as a$3 } from '../../chunk-6N456D64.js';
21
22
  import '../../chunk-CO2KQFUN.js';
22
23
  import { a } from '../../chunk-2GTD4JW2.js';
23
24
  import '../../chunk-PBLSVXV5.js';
24
25
  import '../../chunk-IAOMC4C4.js';
25
26
  import { a as a$1 } from '../../chunk-E3R7W7GK.js';
26
- import { a as a$6 } from '../../chunk-F6H765KA.js';
27
+ import { a as a$8 } from '../../chunk-F6H765KA.js';
27
28
  import '../../chunk-LQRRMVFN.js';
28
29
  import { b } from '../../chunk-2ZJUGM2S.js';
29
30
  import '../../chunk-GLRLKFPS.js';
30
- import { a as a$5 } from '../../chunk-2HAPOY5M.js';
31
+ import { a as a$2 } from '../../chunk-GNNZB7DN.js';
32
+ import { a as a$7 } from '../../chunk-2HAPOY5M.js';
31
33
  import '../../chunk-FJBC6QA5.js';
32
34
  import '../../chunk-POTVACYB.js';
33
35
  import '../../chunk-ET3WPQIO.js';
34
36
  import '../../chunk-CFNATBO2.js';
35
- import { memo, useMemo, useCallback, useState, useEffect, useRef } from 'react';
36
- import Qo from 'react-fast-compare';
37
+ import { memo, useState, useMemo, useCallback, useEffect, useRef } from 'react';
38
+ import $o from 'react-fast-compare';
37
39
  import et from '@mui/material/Badge';
38
- import Te from '@mui/material/Button';
40
+ import Fe from '@mui/material/Button';
39
41
  import tt from '@mui/material/IconButton';
40
- import Pt from '@mui/material/Stack';
42
+ import Lt from '@mui/material/Stack';
41
43
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
42
- import bt from '@mui/material/Divider';
43
- import he from '@mui/material/Typography';
44
- import ye from '@mui/material/FormControl';
45
- import be from '@mui/material/InputLabel';
46
- import j from '@mui/material/MenuItem';
47
- import Se from '@mui/material/Select';
48
- import gr from '@mui/material/TextField';
49
- import tr from '@mui/material/CircularProgress';
50
- import Z from '@mui/material/Box';
44
+ import yt from '@mui/material/Divider';
45
+ import be from '@mui/material/Typography';
46
+ import ge from '@mui/material/FormControl';
47
+ import Ce from '@mui/material/InputLabel';
48
+ import J from '@mui/material/MenuItem';
49
+ import ye from '@mui/material/Select';
50
+ import cr from '@mui/material/TextField';
51
+ import ee from '@mui/material/Box';
51
52
  import { styled } from '@mui/material/styles';
52
- import Br from '@mui/material/Dialog';
53
- import Wr from '@mui/material/DialogActions';
54
- import Vr from '@mui/material/DialogContent';
55
- import Gr from '@mui/material/DialogTitle';
56
- import pi from '@mui/material/Chip';
53
+ import Lr from '@mui/material/Dialog';
54
+ import Pr from '@mui/material/DialogActions';
55
+ import Or from '@mui/material/DialogContent';
56
+ import kr from '@mui/material/DialogTitle';
57
+ import li from '@mui/material/Chip';
57
58
 
58
- var jo=({showFilterButton:e$1,isMobile:t,hasActiveFilters:o,activeFiltersCount:r,sort:a$1,onFilterClick:i,onSortClick:l})=>e$1?t?jsxs(Pt,{direction:"row",spacing:.5,children:[jsx(et,{badgeContent:r,color:"primary",invisible:r===0,sx:{"& .MuiBadge-badge":{transform:"scale(0.9) translate(10px, 9px)",opacity:r===0?0:1}},children:jsx(tt,{color:o?"primary":"default",onClick:i,size:"small","aria-label":"Filtrar",sx:{overflow:"visible"},children:jsx(a,{icon:"FILTER_VERTICAL"})})}),jsx(e,{sx:{height:16},orientation:"vertical",flexItem:!0}),jsx(tt,{color:a$1?"primary":"default",onClick:l,size:"small","aria-label":"Ordenar",children:jsx(a,{icon:a$1?.sortType==="DESC"?"SORTING_DESC":"SORTING_ASC"})})]}):jsx(et,{badgeContent:r,color:"primary",invisible:r===0,sx:{"& .MuiBadge-badge":r?{transform:"scale(0.9) translate(-3px, 7px)",position:"relative",opacity:1,transition:"none"}:{transition:"none",opacity:0}},children:jsx(Te,{variant:"text",color:o?"primary":"inherit",startIcon:jsx(a,{icon:"FILTER_VERTICAL"}),onClick:i,size:"small",children:"Filtrar"})}):null,ot=memo(jo,Qo);var rt=e=>e.filter(t=>t.available_filter_conditions&&t.available_filter_conditions.length>0&&t.name!=="ACTIONS");var it=e=>{let{type:t,available_filter_conditions:o}=e;return o.length===0?"EQUALS":t==="TEXT"&&o.includes("LIKE")?"LIKE":o[0]},K=e=>e.value.length>0||e.conditional==="IS_NULL"||e.conditional==="IS_NOT_NULL",nt=e=>{if(e.length===0)return;let t=e.filter(K);if(t.length!==0)return {operator:"AND",groups:[{operator:t[0]?.operator||"AND",conditionals:t.map(o=>({fieldName:o.fieldName,conditional:o.conditional,value:o.value}))}]}};var at={["EQUALS"]:"Igual a",["NOT_EQUALS"]:"Diferente de",["LIKE"]:"Cont\xE9m",["NOT_LIKE"]:"N\xE3o cont\xE9m",["GREATER_THAN"]:"Maior que",["LESS_THAN"]:"Menor que",["GREATER_THAN_OR_EQUAL"]:"Maior ou igual a",["LESS_THAN_OR_EQUAL"]:"Menor ou igual a",["IN"]:"Em",["NOT_IN"]:"N\xE3o em",["IS_NULL"]:"\xC9 nulo",["IS_NOT_NULL"]:"N\xE3o \xE9 nulo"};var st={whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},nr=({config:e,metadata:t,value:o,initialLabel:r,onChange:a,disabled:i=!1})=>{let[l,,s]=a$1(!1),{data:d,isLoading:m,isFetching:u}=e.useQuery({page:0,perPage:25,...e.queryParams},{skip:!l&&!o}),p=m||u,c=useMemo(()=>o?{value:o,label:r??o}:null,[o,r]),f=useMemo(()=>{let n=(d?.items??[]).map(g=>({label:String(g[t.description_field_name]??""),value:String(g[t.id_field_name]??"")})).filter(g=>g.value&&g.label);return c&&!n.some(g=>g.value===c.value)&&n.unshift(c),n},[d,t.id_field_name,t.description_field_name,c]),C=useCallback(n=>{if(!n){a("",void 0);return}let g=f.find(T=>T.value===n);a(n,g?.label);},[a,f]),E=`entity-filter-label-${t.name}`;return jsxs(ye,{size:"small",sx:{flex:1,minWidth:120},disabled:i,children:[jsx(be,{id:E,shrink:!0,children:"Filtro"}),jsxs(Se,{labelId:E,label:"Filtro",value:c?.value??"",onChange:n=>C(n.target.value),onOpen:()=>s(!0),onClose:()=>s(!1),size:"small",displayEmpty:!0,notched:!0,renderValue:n=>n?f.find(T=>T.value===n)?.label??c?.label??String(n):"",sx:{"& .MuiSelect-select":st},children:[p&&jsxs(j,{disabled:!0,value:"",children:[jsx(tr,{size:18,sx:{mr:1}}),"Carregando..."]}),!p&&f.length===0&&jsx(j,{disabled:!0,value:"",children:"Nenhum resultado"}),!p&&f.map(n=>jsx(j,{value:n.value,sx:st,title:n.label,children:n.label},n.value))]})]})},mt=memo(nr);var dr=({value:e,onChange:t,totalConditions:o,isFirst:r})=>o===1?null:r?jsx(Pt,{sx:{width:55,flexShrink:0}}):jsxs(Se,{value:e,onChange:a=>t(a.target.value),size:"small",sx:{width:55,flexShrink:0},children:[jsx(j,{value:"AND",children:"e"}),jsx(j,{value:"OR",children:"ou"})]}),pt=memo(dr,Qo);var V={whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},yr=({condition:e,fields:t,onChange:o,onRemove:r,totalConditions:a$1,isFirst:i,entityFilterConfig:l})=>{let s=useMemo(()=>t.find(n=>(n.filter_field_name??n.name)===e.fieldName),[t,e.fieldName]),d=useMemo(()=>s?.available_filter_conditions||[],[s]),m=useMemo(()=>!e.fieldName||e.conditional==="IS_NULL"||e.conditional==="IS_NOT_NULL",[e.fieldName,e.conditional]),u=useCallback(n=>{let g=t.find(L=>(L.filter_field_name??L.name)===n);if(!g)return;let T=g.available_filter_conditions[0]||"EQUALS";o({...e,fieldName:n,conditional:T,value:[]});},[t,e,o]),p=useCallback(n=>{o({...e,conditional:n});},[e,o]),c=useCallback(n=>{o({...e,value:n?[n]:[]});},[e,o]),f=useCallback((n,g)=>{let T={...e.valueLabels};n&&g&&(T[n]=g),o({...e,value:n?[n]:[],valueLabels:T});},[e,o]),C=useCallback(n=>{o({...e,operator:n});},[e,o]),E=()=>{if(s?.type==="BOOLEAN")return jsxs(ye,{size:"small",sx:{flex:1,minWidth:120},disabled:m,children:[jsx(be,{id:`value-label-${e.id}`,children:"Valor"}),jsxs(Se,{labelId:`value-label-${e.id}`,label:"Valor",value:e.value[0]||"",onChange:n=>c(n.target.value),size:"small",sx:{"& .MuiSelect-select":V},children:[jsx(j,{value:"true",children:"Verdadeiro"}),jsx(j,{value:"false",children:"Falso"})]})]});if(s?.type==="ENTITY"&&s.metadata&&l?.[s.metadata.name]){let n=e.value[0]||"";return jsx(mt,{config:l[s.metadata.name],metadata:s.metadata,value:n,initialLabel:e.valueLabels?.[n],onChange:f,disabled:m})}return jsx(gr,{label:"Filtro",value:e.value[0]||"",onChange:n=>c(n.target.value),size:"small",disabled:m,InputLabelProps:{shrink:!0},sx:{flex:1,minWidth:120}})};return jsxs(Pt,{direction:"row",spacing:1,alignItems:"center",children:[jsx(tt,{onClick:r,size:"small","aria-label":"Remover filtro",sx:{flexShrink:0},children:jsx(a,{icon:"CLOSE_MARK_BUTTON",width:18})}),jsx(pt,{value:e.operator,onChange:C,totalConditions:a$1,isFirst:i}),jsxs(ye,{size:"small",sx:{minWidth:150,flex:1},children:[jsx(be,{id:`field-label-${e.id}`,children:"Coluna"}),jsx(Se,{labelId:`field-label-${e.id}`,label:"Coluna",value:e.fieldName,onChange:n=>u(n.target.value),size:"small",sx:{"& .MuiSelect-select":V},children:t.map(n=>jsx(j,{value:n.filter_field_name??n.name,sx:V,title:n.description||n.name,children:n.description||n.name},n.name))})]}),jsxs(ye,{size:"small",sx:{minWidth:90},disabled:!e.fieldName,children:[jsx(be,{id:`condition-label-${e.id}`,children:"Condi\xE7\xE3o"}),jsx(Se,{labelId:`condition-label-${e.id}`,label:"Condi\xE7\xE3o",value:e.conditional,onChange:n=>p(n.target.value),size:"small",sx:{"& .MuiSelect-select":V},children:d.map(n=>jsx(j,{value:n,sx:V,children:at[n]||n},n))})]}),E()]})},ct=memo(yr,Qo);var hr=({filterableFields:e,conditions:t,onUpdateCondition:o,onRemoveCondition:r,entityFilterConfig:a})=>{let i=useCallback(m=>{o(m.id,m);},[o]),l=useCallback(m=>()=>{r(m);},[r]),s=useMemo(()=>t.map(m=>m.fieldName).filter(m=>!!m),[t]),d=useCallback(m=>e.filter(u=>!s.includes(u.name)||u.name===m),[e,s]);return e.length===0?jsx(he,{variant:"body2",color:"text.secondary",textAlign:"center",children:"Nenhum filtro dispon\xEDvel"}):t.length===0?jsxs(he,{variant:"body2",color:"text.secondary",textAlign:"center",children:["Clique em"," ",jsx(he,{component:"strong",variant:"body2",fontWeight:600,color:"text.primary",children:'"+"'})," ","para adicionar um filtro"]}):jsx(Fragment,{children:t.map((m,u)=>jsx(ct,{condition:m,fields:d(m.fieldName),onChange:i,onRemove:l(m.id),showOperator:u>0,totalConditions:t.length,isFirst:u===0,entityFilterConfig:a},m.id))})},ut=memo(hr,Qo);var ft=styled(Z)({display:"flex",flexDirection:"column",height:"100%"}),Ct=styled(Z)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",padding:e.spacing(2,3)})),gt=styled(Z)(({theme:e})=>({flex:1,overflowY:"auto",padding:e.spacing(3),display:"flex",flexDirection:"column",gap:e.spacing(2)})),yt=styled(Z)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",padding:e.spacing(2)}));var Er=({onClose:e,fields:t,conditions:o,onAddCondition:r,onUpdateCondition:a$1,onRemoveCondition:i,onApply:l,onClear:s,onCancel:d,entityFilterConfig:m})=>{let u=rt(t),p=o.length>0,c=useCallback(()=>{l(),e();},[l,e]),f=useCallback(()=>{s(),e();},[s,e]),C=useCallback(()=>{d();},[d]);return jsxs(ft,{children:[jsxs(Ct,{children:[jsx(he,{variant:"overline",fontWeight:600,color:"text.secondary",children:"Defina as condi\xE7\xF5es para filtrar"}),jsx(tt,{onClick:r,size:"small","aria-label":"Adicionar filtro",title:"Adicionar filtro",disabled:o.length>=u.length,children:jsx(a,{icon:"SIMPLE_ADD"})})]}),jsx(bt,{}),jsx(gt,{children:jsx(ut,{filterableFields:u,conditions:o,onUpdateCondition:a$1,onRemoveCondition:i,entityFilterConfig:m})}),jsx(bt,{}),jsxs(yt,{children:[jsx(Te,{variant:"text",color:"inherit",onClick:f,children:"Limpar"}),jsxs(Pt,{direction:"row",spacing:1,children:[jsx(Te,{variant:"outlined",color:"inherit",onClick:C,startIcon:jsx(a,{icon:"CANCEL_CIRCLE"}),children:"Cancelar"}),jsx(Te,{variant:"contained",onClick:c,disabled:!p,startIcon:jsx(a,{icon:"SIMPLE_CHECK"}),children:"Aplicar"})]})]})]})},St=memo(Er,Qo);var Mr=e=>jsx(a$2,{open:e.open,onClose:e.onClose,anchorEl:e.anchorEl,isMobile:e.isMobileProp,popoverProps:{slotProps:{paper:{sx:{width:520,maxWidth:"calc(100vw - 24px)",maxHeight:600,mt:1}}}},drawerProps:{anchor:"right",PaperProps:{sx:{width:"100%",maxWidth:"100%",height:"100%",maxHeight:"100%",borderRadius:0}}},children:jsx(St,{...e})}),ht=memo(Mr,Qo);var Pr=({showFilterButton:e,isOpen:t,filterAnchorEl:o,fields:r,conditions:a,isMobile:i,onClose:l,onAddCondition:s,onUpdateCondition:d,onRemoveCondition:m,onApply:u,onClear:p,onCancel:c,entityFilterConfig:f})=>e?jsx(ht,{open:t||!!o,anchorEl:o,onClose:l,fields:r,conditions:a,onAddCondition:s,onUpdateCondition:d,onRemoveCondition:m,onApply:u,onClear:p,onCancel:c,isMobileProp:i,entityFilterConfig:f}):null,It=memo(Pr,Qo);var Tt=styled(Br)(()=>({"& .MuiDialog-paper":{width:"100%"}})),Rt=styled(Gr)(({theme:e})=>({borderBottom:"1px solid",borderColor:e.palette.divider,padding:e.spacing(1.5,2)})),Dt=styled(Vr)(({theme:e})=>({padding:e.spacing(2)})),_t=styled(Wr)(({theme:e})=>({borderTop:"1px solid",borderColor:e.palette.divider,padding:e.spacing(1.5,2)})),xt=styled(Te)(({theme:e})=>({minWidth:24,[e.breakpoints.down(330)]:{padding:e.spacing(1)}})),Re=styled(he)(({theme:e})=>({fontWeight:"600",margin:e.spacing(0,1),[e.breakpoints.down(330)]:{fontSize:0,margin:0}}));var Ot=({open:e,onClose:t,fields:o,sort:r,onSortChange:a$1})=>{let[i,l]=useState(r?.fieldName||""),[s,d]=useState(r?.sortType||"ASC"),m=useMemo(()=>o.filter(C=>C.name!=="ACTIONS"&&C.access_type!=="WRITE_ONLY"),[o]),u=useMemo(()=>o.find(C=>(C.filter_field_name??C.name)===i),[o,i]),p=u?.type==="DECIMAL"||u?.type==="INTEGER";useEffect(()=>{e&&(l(r?.fieldName||""),d(r?.sortType||"ASC"));},[e,r]);let c=useCallback(()=>{a$1&&a$1(i?{fieldName:i,sortType:s}:void 0),t();},[a$1,i,s,t]),f=useCallback(()=>{a$1&&(l(""),d("ASC"),a$1(void 0),t());},[a$1,t]);return jsxs(Tt,{open:e,onClose:t,maxWidth:"xs",fullWidth:!0,children:[jsx(Rt,{children:jsx(he,{variant:"overline",color:"text.secondary",children:"Ordenar por"})}),jsx(Dt,{children:jsxs(Pt,{spacing:2,pt:2,children:[jsxs(ye,{fullWidth:!0,size:"small",children:[jsx(be,{id:"sort-field-label",children:"Campo"}),jsxs(Se,{labelId:"sort-field-label",value:i,label:"Campo",onChange:C=>l(C.target.value),children:[jsx(j,{value:"",children:jsx("em",{children:"Nenhum"})}),m.map(C=>jsx(j,{value:C.filter_field_name??C.name,children:C.description||C.name},C.name))]})]}),jsxs(ye,{fullWidth:!0,size:"small",disabled:!i,children:[jsx(be,{id:"sort-direction-label",children:"Dire\xE7\xE3o"}),jsxs(Se,{labelId:"sort-direction-label",value:s,label:"Dire\xE7\xE3o",onChange:C=>d(C.target.value),children:[jsxs(j,{value:"ASC",children:["Crescente ",p?"(1-9)":"(A-Z)"]}),jsxs(j,{value:"DESC",children:["Decrescente ",p?"(9-1)":"(Z-A)"]})]})]})]})}),jsxs(_t,{children:[jsx(Pt,{flex:1,width:"100%",direction:"row",children:jsx(Te,{color:"inherit",onClick:f,children:"Limpar"})}),jsxs(Te,{onClick:t,variant:"outlined",color:"inherit",sx:{minWidth:24},children:[jsx(a,{icon:"CANCEL_CIRCLE"}),jsx(Re,{children:"Cancelar"})]}),jsxs(xt,{onClick:c,variant:"contained",children:[jsx(a,{icon:"SIMPLE_CHECK"}),jsx(Re,{children:"Aplicar"})]})]})]})};Ot.displayName="SortModal";var kt=memo(Ot);var Bt=({columns:e,fields:t,preferredFieldOrder:o})=>{let r=useMemo(()=>new Map(e.map(l=>[l.field,l])),[e]),a=useMemo(()=>new Map(t?.map(l=>[l.name,l])||[]),[t]);return {orderedColumns:useMemo(()=>{if(!o||o.length===0||!t)return e;let l="ACTIONS",s=o.filter(p=>p!==l),d=new Set,m=[],u=p=>{let c=a.get(p);if(!c)return;let f=r.get(c.name);!f||d.has(c.name)||(m.push(f),d.add(c.name));};return s.forEach(p=>{u(p);}),t.forEach(p=>{if(p.name===l||s.includes(p.name))return;let c=r.get(p.name);!c||d.has(p.name)||(m.push(c),d.add(p.name));}),u(l),m.length===0?e:m},[e,r,a,o,t]),columnsByFieldId:r,fieldsByName:a}};function Qr(e){return e.name}var Wt=({fields:e,columnsByFieldId:t,defaultVisibleFieldNames:o,columnVisibilityStorageKey:r,onColumnVisibilityModelChange:a})=>{let i=!!r,[l,s]=a$5(r||"__dynamic-data-view:columns__",void 0,{initializeWithValue:i}),d=useMemo(()=>{if(!e)return;let u={};if(e.forEach(p=>{let c=Qr(p);if(!t.has(c))return;let f;if(i&&l){let C=l[c];typeof C=="boolean"&&(f=C);}f===void 0&&o&&o.length>0&&(f=o.includes(p.name)),typeof f=="boolean"&&(u[c]=f);}),Object.keys(u).length!==0)return {columns:{columnVisibilityModel:u}}},[t,o,e,i,l]),m=useCallback(u=>{if(i){let p={...u};delete p.__check__,s(p);}a&&a(u);},[i,a,s]);return {initialState:d,handleColumnVisibilityModelChange:m}};var M={IMAGE_WIDTH:90,MIN_WIDTH:130,ENTITY_MIN_WIDTH:100,ENTITY_FLEX:.5,ID_MIN_WIDTH:200,ID_FLEX:1,ACTIONS_WIDTH:80},_e={READ_ONLY:"READ_ONLY",READ_AND_WRITE:"READ_AND_WRITE"},Vt=["price","base_price","minimum_value","maximum_value","minimum_installment_value"];var Kr=(e,t)=>({field:e.name,headerName:e.description,sortable:!1,width:M.IMAGE_WIDTH,resizable:!1,headerAlign:"center",align:"center",renderCell:o=>t(e,o.row)}),Xr=(e,t)=>({field:e.name,headerName:e.description,minWidth:M.ID_MIN_WIDTH,flex:M.ID_FLEX,renderCell:o=>t(e,o.row)}),jr=(e,t)=>({field:e.name,headerName:e.description,minWidth:M.ENTITY_MIN_WIDTH,flex:M.ENTITY_FLEX,renderCell:o=>t(e,o.row)}),Jr=(e,t)=>({field:e.name,headerName:e.description,minWidth:M.MIN_WIDTH,renderCell:o=>t(e,o.row)}),Zr=(e,t)=>({field:e.name,headerName:"A\xE7\xF5es",width:M.ACTIONS_WIDTH,sortable:!1,resizable:!1,disableReorder:!0,headerAlign:"center",disableColumnMenu:!0,align:"center",renderCell:o=>t(e,o.row)}),Gt=(e,t)=>e.name===t?.id_field_name||e.name==="name"?Xr:e.name==="ACTIONS"?Zr:e.type==="FILE"?Kr:e.type==="ENTITY"?jr:Jr;var Ut=({metadata:e,renderCell:t,columnStrategies:o})=>useMemo(()=>{if(!e?.fields)return [];let r=new Map;return e.fields.filter(i=>i.access_type===_e.READ_ONLY||i.access_type===_e.READ_AND_WRITE?!0:i.name==="ACTIONS"||i.name===e?.id_field_name||i.name==="NAME").forEach(i=>{if(r.has(i.name))return;let s=(o?.[i.name]??Gt(i,e))(i,t,e);r.set(i.name,s);}),Array.from(r.values())},[o,e,t]);var Ht=e=>e?.groups?.[0]?.conditionals?e.groups[0].conditionals.map(t=>({id:a$6(),operator:e.groups[0].operator,fieldName:t.fieldName,conditional:t.conditional,value:t.value})):[],zt=({fields:e,initialFilter:t})=>{let[o,r]=useState(!1),[a,i]=useState(()=>Ht(t)),[l,s]=useState(t),[d,m]=useState(()=>Ht(t)),u=useRef([]),p=useCallback(()=>{u.current=a.map(y=>({...y})),m(a.map(y=>({...y}))),r(!0);},[a]),c=()=>r(!1),f=useCallback(()=>{let y=e.filter(x=>x.available_filter_conditions?.length>0);if(y.length===0)return;let h=d.map(x=>x.fieldName),R=y.filter(x=>!h.includes(x.filter_field_name??x.name));if(R.length===0)return;let w=d.length>0?d[0].operator:"AND",I=R[0],v={id:a$6(),operator:w,fieldName:I.filter_field_name??I.name,conditional:it(I),value:[]};m(x=>[...x,v]);},[e,d]),C=useCallback((y,h)=>{m(R=>{let w=R.find(I=>I.id===y);if(!w)return R;if(h.operator&&h.operator!==w.operator){let I=h.operator;return R.map(v=>v.id===y?{...v,...h}:{...v,operator:I})}return R.map(I=>I.id===y?{...I,...h}:I)});},[]),E=useCallback(y=>{m(h=>h.filter(R=>R.id!==y));},[]),n=()=>{m([]),i([]),s(void 0);},g=()=>{let y=nt(d);return i(d.map(h=>({...h}))),s(y),r(!1),y},T=()=>{m(u.current.map(y=>({...y}))),r(!1);},L=a.some(K),le=a.filter(K).length;return {conditions:d,filter:l,isOpen:o,hasActiveFilters:L,activeFiltersCount:le,openDrawer:p,closeDrawer:c,addCondition:f,updateCondition:C,removeCondition:E,clearAllFilters:n,applyFilters:g,cancelChanges:T}};var Qt=e=>{try{let t=localStorage.getItem(e);return t?JSON.parse(t):void 0}catch{return}},Kt=(e,t)=>{try{t===void 0?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(t));}catch{}},Xt=(e,t,o)=>{let r=`${e}:filter`,[a,i]=useState(()=>Qt(r)||t);useEffect(()=>{t!==void 0&&i(t);},[t]);let l=useCallback(s=>{i(s),Kt(r,s),o?.(s);},[r,o]);return {filter:a,setFilter:l}},jt=(e,t,o)=>{let r=`${e}:sort`,[a,i]=useState(()=>Qt(r)||t);useEffect(()=>{t!==void 0&&i(t);},[t]);let l=useCallback(s=>{i(s),Kt(r,s),o?.(s);},[r,o]);return {sort:a,setSort:l}};var ii=(e,t)=>e?e.find(r=>r.name===t)?.filter_field_name??t:t,ni=(e,t)=>e?e.find(r=>r.filter_field_name===t||r.name===t)?.name??t:t,Jt=({sort:e,onSortChange:t,fields:o})=>{let r=useMemo(()=>e?[{field:ni(o,e.fieldName),sort:e.sortType.toLowerCase()}]:[],[e,o]),a=useCallback(i=>{if(!t)return;let l=i[0];if(!l||!l.sort){t(void 0);return}let s={fieldName:ii(o,l.field),sortType:l.sort.toUpperCase()};t(s);},[t,o]);return {sortModel:r,handleSortModelChange:a}};var Zt=()=>({name:"ACTIONS",description:"",filter_field_name:null,type:"TEXT",metadata:null,access_type:"READ_ONLY",relation_field_name:null,available_filter_conditions:[]}),xe=e=>e.fields.some(o=>o.name==="ACTIONS")?e:{...e,fields:[...e.fields,Zt()]};var li=({value:e,format:t})=>e==null?"-":d(e,t),Ne=memo(li);var mi=({value:e,format:t})=>e==null?"-":c(e,t),Ee=memo(mi);var ci=({value:e,field:t})=>{if(!t.metadata||typeof e!="object"||e===null)return e?String(e):"-";let o=e[t.metadata.description_field_name];return o?jsx(pi,{label:String(o),variant:"outlined",size:"small",sx:{width:"fit-content",color:"text.secondary",borderColor:"divider",borderRadius:3}}):null},ve=memo(ci);var Ci=({value:e,trueIcon:t="STAR_02",falseIcon:o="STAR",color:r="primary.main",width:a$1=18})=>jsx(a,{icon:e?t:o,color:r,width:a$1}),gi=memo(Ci);var to=styled("span")(({theme:e,isActive:t})=>({display:"inline-flex",alignItems:"center",justifyContent:"center",padding:e.spacing(.2,1),borderRadius:e.shape.borderRadius,fontSize:"0.75rem",fontWeight:600,width:"fit-content",height:"auto",lineHeight:"1.25rem",whiteSpace:"nowrap",margin:"auto",backgroundColor:t?e.palette.success.lighter||"#00A76F29":e.palette.warning.lighter||"#FF563029",color:t?e.palette.success.darker||"#007867":e.palette.warning.darker||"#B71D18"})),oo=styled(Z,{shouldForwardProp:e=>!["size","noImage","clickable"].includes(e)})(({theme:e,size:t,noImage:o,clickable:r})=>({width:t,height:t,minWidth:t,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",cursor:r?"pointer":"default",transition:"opacity 0.2s ease-in-out",color:e.palette.text.disabled,...o&&{border:`1px dashed ${e.palette.divider}`,backgroundColor:e.palette.grey[100]},...r&&{"&:hover":{opacity:.8}},"& img":{width:"100%",height:"100%",objectFit:"cover",borderRadius:"50%"},[e.breakpoints.down("sm")]:{justifyContent:"flex-start",alignItems:"flex-start"}}));var Fi=({imageResourceId:e,getImageUrl:t,size:o=48,alt:r="Imagem",onClick:a$1,sx:i})=>{let l=!!e,s=l&&t?t(e):void 0;return jsx(oo,{size:o,noImage:!l,clickable:!!a$1,onClick:a$1,sx:i,children:s?jsx("img",{src:s,alt:r}):jsx(a,{icon:"SEARCH_IMAGE",width:Math.round(o/2),color:"text.disabled"})})},hi=memo(Fi);var Ti=({id:e,displayName:t,copyMessage:o="ID copiado!"})=>jsxs(Pt,{height:1,justifyContent:"center",children:[jsx(he,{variant:"subtitle2",noWrap:!0,title:t,children:t}),jsxs(Pt,{direction:"row",gap:1,alignItems:"center",children:[jsxs(he,{color:"grey.600",variant:"body2",noWrap:!0,children:["ID: ",e]}),jsx(a$3,{toCopy:e,message:o})]})]}),Ri=memo(Ti);var Ni=({value:e,isCurrency:t=!1})=>e==null?"-":jsx(Pt,{direction:"row",alignItems:"center",height:"100%",children:jsx(he,{variant:"body2",noWrap:!0,width:"fit-content",children:t?h(Number(e)):a$4(Number(e))})}),we=memo(Ni);var vi=({active:e,activeLabel:t="Ativo",inactiveLabel:o="Inativo"})=>jsx(to,{isActive:e,children:e?t:o}),Le=memo(vi);var Pi=e=>e.replace(/<[^>]*>/g,"").replace(/&nbsp;/g," ").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").trim(),Oi=({value:e,showCopyButton:t=!1,copyMessage:o="Copiado",copyLabel:r,mask:a})=>{if(!e)return "-";let i=String(e),l=a?a(i):Pi(i);return t?jsxs(Pt,{direction:"row",gap:1,alignItems:"center",children:[jsx(he,{variant:"body2",noWrap:!0,children:l}),jsx(a$3,{toCopy:i,message:o,label:r})]}):l},Pe=memo(Oi);function Bi(e){return Vt.includes(e)}var so=e=>{let{onRowAction:t}=e,o=(r,a)=>{let i=a[r.name];if(r.name==="ACTIONS")return t?.(a.id,a);switch(r.type){case"BOOLEAN":return jsx(Le,{active:!!i,activeLabel:"Ativo",inactiveLabel:"Inativo"});case"DATE":return jsx(Ne,{value:i});case"DATETIME":return jsx(Ee,{value:i});case"DECIMAL":case"INTEGER":return jsx(we,{value:i,isCurrency:Bi(r.name)});case"FILE":case"ENTITY":return jsx(ve,{value:i,field:r});case"TEXT":default:return jsx(Pe,{value:i})}};return o.displayName="CellRendererComponent",o};var Gi=({title:e,metadata:t,data:o,isLoading:r,isFetching:a,page:i,perPage:l,searchValue:s,onSearchChange:d,onSearch:m,onPaginationChange:u,onAdd:p,onRowAction:c,onRowDoubleClick:f,actions:C,moreActions:E,bulkActions:n,rowSelectionModel:g,onRowSelectionModelChange:T,slots:L,mobileRender:le,containerHeight:y=600,showColumnButton:h=!1,showFilterButton:R=!1,filter:w,onFilterChange:I,sort:v,onSortChange:x,defaultVisibleFieldNames:uo,preferredFieldOrder:fo,columnStrategies:Co,onColumnVisibilityModelChange:go,storageKey:se,entityFilterConfig:yo})=>{let{items:U=[],total:bo=0}=o||{},H=useMemo(()=>{if(t)return t;if(U.length>0){let A=U[0],$=Object.keys(A).map(He=>({name:He,type:"TEXT",description:He,filter_field_name:null,metadata:null,access_type:"READ_ONLY",relation_field_name:null,available_filter_conditions:[]}));return {name:"loading",description:"Loading...",id_field_name:"id",description_field_name:$[0]?.name||"id",access_type:"READ_ONLY",fields:$}}},[t,U]),B=useMemo(()=>H&&c?xe(H):H,[H,c]),z=useMemo(()=>B?.fields||[],[B]),So=useMemo(()=>so({onRowAction:c}),[c]),Fo=Ut({metadata:B,renderCell:So,columnStrategies:Co}),{orderedColumns:ho,columnsByFieldId:Io}=Bt({columns:Fo,fields:B?.fields,preferredFieldOrder:fo}),{initialState:To,handleColumnVisibilityModelChange:Ro}=Wt({fields:B?.fields,columnsByFieldId:Io,defaultVisibleFieldNames:uo,columnVisibilityStorageKey:`${se}:columns`,onColumnVisibilityModelChange:go}),Do=useCallback(A=>{if(!f)return;let $=A.id?.toString()||"";f($,A.row);},[f]),Y=b("down","md"),[_o,me]=useState(null),{filter:xo,setFilter:q}=Xt(se,w,I),{sort:No,setSort:Oe}=jt(se,v,x),Eo=w??xo,de=v??No,{sortModel:vo,handleSortModelChange:Ao}=Jt({sort:de,onSortChange:Oe,fields:z}),{conditions:Mo,isOpen:wo,openDrawer:pe,closeDrawer:ke,addCondition:Lo,updateCondition:Po,removeCondition:Oo,clearAllFilters:Be,applyFilters:We,cancelChanges:Ve,hasActiveFilters:ko,activeFiltersCount:Bo}=zt({fields:z,initialFilter:Eo}),Wo=useCallback(()=>{let A=We();q(A);},[We,q]),Vo=useCallback(()=>{Be(),q(void 0);},[Be,q]),Go=useCallback(A=>{Y?pe():(pe(),me(A.currentTarget));},[Y,pe]),Uo=useCallback(()=>{Ve(),me(null);},[Ve]),[Ho,Ge]=useState(!1),zo=useCallback(()=>{me(null),ke();},[ke]),Ue=!!n?.length;return jsxs(Fragment,{children:[jsx(d$1,{title:e,columns:ho,rows:U,mobileRender:le,rowCount:bo,loading:r||!t,fetching:a,searchValue:s,onSearch:m,onSearchChange:d,paginationModel:{page:i,pageSize:l},onPaginationChange:u,actions:C,moreActions:E,onAdd:p,onRowDoubleClick:f?Do:void 0,bulkActions:n,checkboxSelection:Ue,rowSelectionModel:g,onRowSelectionModelChange:T,keepNonExistentRowsSelected:Ue,disableRowSelectionOnClick:!0,slots:L,initialState:To,showColumnButton:h,containerProps:{height:y,maxHeight:y},onColumnVisibilityModelChange:Ro,filterButton:jsx(ot,{showFilterButton:R,isMobile:Y,hasActiveFilters:ko,activeFiltersCount:Bo,sort:de,onFilterClick:Go,onSortClick:()=>Ge(!0)}),sortingMode:"server",sortModel:vo,onSortModelChange:Ao,disableColumnFilter:!0}),t&&jsxs(Fragment,{children:[jsx(It,{showFilterButton:R,isOpen:wo,filterAnchorEl:_o,fields:z,conditions:Mo,isMobile:Y,onClose:zo,onAddCondition:Lo,onUpdateCondition:Po,onRemoveCondition:Oo,onApply:Wo,onClear:Vo,onCancel:Uo,entityFilterConfig:yo}),jsx(kt,{open:Ho,onClose:()=>Ge(!1),fields:z,sort:de,onSortChange:Oe})]})]})},Ui=memo(Gi,Qo);var Hi=({metadata:e,columnVisibilityModel:t,defaultVisibleFields:o})=>{if(!e?.fields)return;let a=e.fields.map(i=>i.name).filter(i=>i==="ACTIONS"?!1:t?t[i]!==!1:o?.includes(i)??!0);return o?a.sort((i,l)=>{let s=o.indexOf(i),d=o.indexOf(l);return s-d||0}):a};
59
+ var Xo=({showFilterButton:e$1,isMobile:t,hasActiveFilters:o,activeFiltersCount:r,sort:n,onFilterClick:i,onSortClick:a$1})=>e$1?t?jsxs(Lt,{direction:"row",spacing:.5,children:[jsx(et,{badgeContent:r,color:"primary",invisible:r===0,sx:{"& .MuiBadge-badge":{transform:"scale(0.9) translate(10px, 9px)",opacity:r===0?0:1}},children:jsx(tt,{color:o?"primary":"default",onClick:i,size:"small","aria-label":"Filtrar",sx:{overflow:"visible"},children:jsx(a,{icon:"FILTER_VERTICAL"})})}),jsx(e,{sx:{height:16},orientation:"vertical",flexItem:!0}),jsx(tt,{color:n?"primary":"default",onClick:a$1,size:"small","aria-label":"Ordenar",children:jsx(a,{icon:n?.sortType==="DESC"?"SORTING_DESC":"SORTING_ASC"})})]}):jsx(et,{badgeContent:r,color:"primary",invisible:r===0,sx:{"& .MuiBadge-badge":r?{transform:"scale(0.9) translate(-3px, 7px)",position:"relative",opacity:1,transition:"none"}:{transition:"none",opacity:0}},children:jsx(Fe,{variant:"text",color:o?"primary":"inherit",startIcon:jsx(a,{icon:"FILTER_VERTICAL"}),onClick:i,size:"small",children:"Filtrar"})}):null,ot=memo(Xo,$o);var rt=e=>e.filter(t=>t.available_filter_conditions&&t.available_filter_conditions.length>0&&t.name!=="ACTIONS");var it=e=>{let{type:t,available_filter_conditions:o}=e;return o.length===0?"EQUALS":t==="TEXT"&&o.includes("LIKE")?"LIKE":o[0]},X=e=>e.value.length>0||e.conditional==="IS_NULL"||e.conditional==="IS_NOT_NULL",nt=e=>{if(e.length===0)return;let t=e.filter(X);if(t.length!==0)return {operator:"AND",groups:[{operator:t[0]?.operator||"AND",conditionals:t.map(o=>({fieldName:o.fieldName,conditional:o.conditional,value:o.value}))}]}};var at={["EQUALS"]:"Igual a",["NOT_EQUALS"]:"Diferente de",["LIKE"]:"Cont\xE9m",["NOT_LIKE"]:"N\xE3o cont\xE9m",["GREATER_THAN"]:"Maior que",["LESS_THAN"]:"Menor que",["GREATER_THAN_OR_EQUAL"]:"Maior ou igual a",["LESS_THAN_OR_EQUAL"]:"Menor ou igual a",["IN"]:"Em",["NOT_IN"]:"N\xE3o em",["IS_NULL"]:"\xC9 nulo",["IS_NOT_NULL"]:"N\xE3o \xE9 nulo"};var er=({config:e,metadata:t,value:o,initialLabel:r,onChange:n,disabled:i=!1})=>{let[a,,l]=a$1(!1),[d,m]=useState(""),p=a$2(d,400),{data:c,isLoading:f,isFetching:C}=e.useQuery({search:p||void 0,page:0,perPage:25,...e.queryParams},{skip:!a}),g=f||C,_=useMemo(()=>o?{value:o,label:r??o}:null,[o,r]),s=useMemo(()=>{let u=(c?.items??[]).map(y=>({label:String(y[t.description_field_name]??""),value:String(y[t.id_field_name]??"")})).filter(y=>y.value&&y.label);return _&&!u.some(y=>y.value.toString()===_.value.toString())&&u.unshift(_),u},[c,t.id_field_name,t.description_field_name,_]),R=useCallback(()=>l(!0),[l]),x=useCallback(()=>{l(!1),m("");},[l]),A=useCallback(u=>{if(!u){n("",void 0);return}let y=s.find(b=>b.value.toString()===u);n(u,y?.label);},[n,s]),B=useCallback(u=>{m(u??"");},[]);return jsx(a$3,{name:`entity-filter-${t.name}`,label:"Filtro",value:o||"",options:s,onChange:A,onSearch:B,loading:g,disabled:i,size:"small",filterOptions:u=>u,noOptionsText:d!==p?"Buscando...":"Nenhum resultado",InputLabelProps:{shrink:!0},sx:{flex:1,minWidth:120},open:a,onOpen:R,onClose:x})},st=memo(er);var ar=({value:e,onChange:t,totalConditions:o,isFirst:r})=>o===1?null:r?jsx(Lt,{sx:{width:55,flexShrink:0}}):jsxs(ye,{value:e,onChange:n=>t(n.target.value),size:"small",sx:{width:55,flexShrink:0},children:[jsx(J,{value:"AND",children:"e"}),jsx(J,{value:"OR",children:"ou"})]}),dt=memo(ar,$o);var G={whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},ur=({condition:e,fields:t,onChange:o,onRemove:r,totalConditions:n,isFirst:i,entityFilterConfig:a$1})=>{let l=useMemo(()=>t.find(s=>(s.filter_field_name??s.name)===e.fieldName),[t,e.fieldName]),d=useMemo(()=>l?.available_filter_conditions||[],[l]),m=useMemo(()=>!e.fieldName||e.conditional==="IS_NULL"||e.conditional==="IS_NOT_NULL",[e.fieldName,e.conditional]),p=useCallback(s=>{let R=t.find(A=>(A.filter_field_name??A.name)===s);if(!R)return;let x=R.available_filter_conditions[0]||"EQUALS";o({...e,fieldName:s,conditional:x,value:[]});},[t,e,o]),c=useCallback(s=>{o({...e,conditional:s});},[e,o]),f=useCallback(s=>{o({...e,value:s?[s]:[]});},[e,o]),C=useCallback((s,R)=>{let x={...e.valueLabels};s&&R&&(x[s]=R),o({...e,value:s?[s]:[],valueLabels:x});},[e,o]),g=useCallback(s=>{o({...e,operator:s});},[e,o]),_=()=>{if(l?.type==="BOOLEAN")return jsxs(ge,{size:"small",sx:{flex:1,minWidth:120},disabled:m,children:[jsx(Ce,{id:`value-label-${e.id}`,children:"Valor"}),jsxs(ye,{labelId:`value-label-${e.id}`,label:"Valor",value:e.value[0]||"",onChange:s=>f(s.target.value),size:"small",sx:{"& .MuiSelect-select":G},children:[jsx(J,{value:"true",children:"Verdadeiro"}),jsx(J,{value:"false",children:"Falso"})]})]});if(l?.type==="ENTITY"&&l.metadata&&a$1?.[l.metadata.name]){let s=e.value[0]||"";return jsx(st,{config:a$1[l.metadata.name],metadata:l.metadata,value:s,initialLabel:e.valueLabels?.[s],onChange:C,disabled:m})}return jsx(cr,{label:"Filtro",value:e.value[0]||"",onChange:s=>f(s.target.value),size:"small",disabled:m,InputLabelProps:{shrink:!0},sx:{flex:1,minWidth:120}})};return jsxs(Lt,{direction:"row",spacing:1,alignItems:"center",children:[jsx(tt,{onClick:r,size:"small","aria-label":"Remover filtro",sx:{flexShrink:0},children:jsx(a,{icon:"CLOSE_MARK_BUTTON",width:18})}),jsx(dt,{value:e.operator,onChange:g,totalConditions:n,isFirst:i}),jsxs(ge,{size:"small",sx:{minWidth:150,flex:1},children:[jsx(Ce,{id:`field-label-${e.id}`,children:"Coluna"}),jsx(ye,{labelId:`field-label-${e.id}`,label:"Coluna",value:e.fieldName,onChange:s=>p(s.target.value),size:"small",sx:{"& .MuiSelect-select":G},children:t.map(s=>jsx(J,{value:s.filter_field_name??s.name,sx:G,title:s.description||s.name,children:s.description||s.name},s.name))})]}),jsxs(ge,{size:"small",sx:{minWidth:90},disabled:!e.fieldName,children:[jsx(Ce,{id:`condition-label-${e.id}`,children:"Condi\xE7\xE3o"}),jsx(ye,{labelId:`condition-label-${e.id}`,label:"Condi\xE7\xE3o",value:e.conditional,onChange:s=>c(s.target.value),size:"small",sx:{"& .MuiSelect-select":G},children:d.map(s=>jsx(J,{value:s,sx:G,children:at[s]||s},s))})]}),_()]})},pt=memo(ur,$o);var yr=({filterableFields:e,conditions:t,onUpdateCondition:o,onRemoveCondition:r,entityFilterConfig:n})=>{let i=useCallback(m=>{o(m.id,m);},[o]),a=useCallback(m=>()=>{r(m);},[r]),l=useMemo(()=>t.map(m=>m.fieldName).filter(m=>!!m),[t]),d=useCallback(m=>e.filter(p=>!l.includes(p.name)||p.name===m),[e,l]);return e.length===0?jsx(be,{variant:"body2",color:"text.secondary",textAlign:"center",children:"Nenhum filtro dispon\xEDvel"}):t.length===0?jsxs(be,{variant:"body2",color:"text.secondary",textAlign:"center",children:["Clique em"," ",jsx(be,{component:"strong",variant:"body2",fontWeight:600,color:"text.primary",children:'"+"'})," ","para adicionar um filtro"]}):jsx(Fragment,{children:t.map((m,p)=>jsx(pt,{condition:m,fields:d(m.fieldName),onChange:i,onRemove:a(m.id),showOperator:p>0,totalConditions:t.length,isFirst:p===0,entityFilterConfig:n},m.id))})},ct=memo(yr,$o);var ut=styled(ee)({display:"flex",flexDirection:"column",height:"100%"}),ft=styled(ee)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",padding:e.spacing(2,3)})),gt=styled(ee)(({theme:e})=>({flex:1,overflowY:"auto",padding:e.spacing(3),display:"flex",flexDirection:"column",gap:e.spacing(2)})),Ct=styled(ee)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",padding:e.spacing(2)}));var Dr=({onClose:e,fields:t,conditions:o,onAddCondition:r,onUpdateCondition:n,onRemoveCondition:i,onApply:a$1,onClear:l,onCancel:d,entityFilterConfig:m})=>{let p=rt(t),c=o.length>0,f=useCallback(()=>{a$1(),e();},[a$1,e]),C=useCallback(()=>{l(),e();},[l,e]),g=useCallback(()=>{d();},[d]);return jsxs(ut,{children:[jsxs(ft,{children:[jsx(be,{variant:"overline",fontWeight:600,color:"text.secondary",children:"Defina as condi\xE7\xF5es para filtrar"}),jsx(tt,{onClick:r,size:"small","aria-label":"Adicionar filtro",title:"Adicionar filtro",disabled:o.length>=p.length,children:jsx(a,{icon:"SIMPLE_ADD"})})]}),jsx(yt,{}),jsx(gt,{children:jsx(ct,{filterableFields:p,conditions:o,onUpdateCondition:n,onRemoveCondition:i,entityFilterConfig:m})}),jsx(yt,{}),jsxs(Ct,{children:[jsx(Fe,{variant:"text",color:"inherit",onClick:C,children:"Limpar"}),jsxs(Lt,{direction:"row",spacing:1,children:[jsx(Fe,{variant:"outlined",color:"inherit",onClick:g,startIcon:jsx(a,{icon:"CANCEL_CIRCLE"}),children:"Cancelar"}),jsx(Fe,{variant:"contained",onClick:f,disabled:!c,startIcon:jsx(a,{icon:"SIMPLE_CHECK"}),children:"Aplicar"})]})]})]})},St=memo(Dr,$o);var Nr=e=>jsx(a$4,{open:e.open,onClose:e.onClose,anchorEl:e.anchorEl,isMobile:e.isMobileProp,popoverProps:{slotProps:{paper:{sx:{width:520,maxWidth:"calc(100vw - 24px)",maxHeight:600,mt:1}}}},drawerProps:{anchor:"right",PaperProps:{sx:{width:"100%",maxWidth:"100%",height:"100%",maxHeight:"100%",borderRadius:0}}},children:jsx(St,{...e})}),ht=memo(Nr,$o);var vr=({showFilterButton:e,isOpen:t,filterAnchorEl:o,fields:r,conditions:n,isMobile:i,onClose:a,onAddCondition:l,onUpdateCondition:d,onRemoveCondition:m,onApply:p,onClear:c,onCancel:f,entityFilterConfig:C})=>e?jsx(ht,{open:t||!!o,anchorEl:o,onClose:a,fields:r,conditions:n,onAddCondition:l,onUpdateCondition:d,onRemoveCondition:m,onApply:p,onClear:c,onCancel:f,isMobileProp:i,entityFilterConfig:C}):null,Ft=memo(vr,$o);var It=styled(Lr)(()=>({"& .MuiDialog-paper":{width:"100%"}})),Tt=styled(kr)(({theme:e})=>({borderBottom:"1px solid",borderColor:e.palette.divider,padding:e.spacing(1.5,2)})),Rt=styled(Or)(({theme:e})=>({padding:e.spacing(2)})),Dt=styled(Pr)(({theme:e})=>({borderTop:"1px solid",borderColor:e.palette.divider,padding:e.spacing(1.5,2)})),_t=styled(Fe)(({theme:e})=>({minWidth:24,[e.breakpoints.down(330)]:{padding:e.spacing(1)}})),Ie=styled(be)(({theme:e})=>({fontWeight:"600",margin:e.spacing(0,1),[e.breakpoints.down(330)]:{fontSize:0,margin:0}}));var Pt=({open:e,onClose:t,fields:o,sort:r,onSortChange:n})=>{let[i,a$1]=useState(r?.fieldName||""),[l,d]=useState(r?.sortType||"ASC"),m=useMemo(()=>o.filter(g=>g.name!=="ACTIONS"&&g.access_type!=="WRITE_ONLY"),[o]),p=useMemo(()=>o.find(g=>(g.filter_field_name??g.name)===i),[o,i]),c=p?.type==="DECIMAL"||p?.type==="INTEGER";useEffect(()=>{e&&(a$1(r?.fieldName||""),d(r?.sortType||"ASC"));},[e,r]);let f=useCallback(()=>{n&&n(i?{fieldName:i,sortType:l}:void 0),t();},[n,i,l,t]),C=useCallback(()=>{n&&(a$1(""),d("ASC"),n(void 0),t());},[n,t]);return jsxs(It,{open:e,onClose:t,maxWidth:"xs",fullWidth:!0,children:[jsx(Tt,{children:jsx(be,{variant:"overline",color:"text.secondary",children:"Ordenar por"})}),jsx(Rt,{children:jsxs(Lt,{spacing:2,pt:2,children:[jsxs(ge,{fullWidth:!0,size:"small",children:[jsx(Ce,{id:"sort-field-label",children:"Campo"}),jsxs(ye,{labelId:"sort-field-label",value:i,label:"Campo",onChange:g=>a$1(g.target.value),children:[jsx(J,{value:"",children:jsx("em",{children:"Nenhum"})}),m.map(g=>jsx(J,{value:g.filter_field_name??g.name,children:g.description||g.name},g.name))]})]}),jsxs(ge,{fullWidth:!0,size:"small",disabled:!i,children:[jsx(Ce,{id:"sort-direction-label",children:"Dire\xE7\xE3o"}),jsxs(ye,{labelId:"sort-direction-label",value:l,label:"Dire\xE7\xE3o",onChange:g=>d(g.target.value),children:[jsxs(J,{value:"ASC",children:["Crescente ",c?"(1-9)":"(A-Z)"]}),jsxs(J,{value:"DESC",children:["Decrescente ",c?"(9-1)":"(Z-A)"]})]})]})]})}),jsxs(Dt,{children:[jsx(Lt,{flex:1,width:"100%",direction:"row",children:jsx(Fe,{color:"inherit",onClick:C,children:"Limpar"})}),jsxs(Fe,{onClick:t,variant:"outlined",color:"inherit",sx:{minWidth:24},children:[jsx(a,{icon:"CANCEL_CIRCLE"}),jsx(Ie,{children:"Cancelar"})]}),jsxs(_t,{onClick:f,variant:"contained",children:[jsx(a,{icon:"SIMPLE_CHECK"}),jsx(Ie,{children:"Aplicar"})]})]})]})};Pt.displayName="SortModal";var Ot=memo(Pt);var kt=({columns:e,fields:t,preferredFieldOrder:o})=>{let r=useMemo(()=>new Map(e.map(a=>[a.field,a])),[e]),n=useMemo(()=>new Map(t?.map(a=>[a.name,a])||[]),[t]);return {orderedColumns:useMemo(()=>{if(!o||o.length===0||!t)return e;let a="ACTIONS",l=o.filter(c=>c!==a),d=new Set,m=[],p=c=>{let f=n.get(c);if(!f)return;let C=r.get(f.name);!C||d.has(f.name)||(m.push(C),d.add(f.name));};return l.forEach(c=>{p(c);}),t.forEach(c=>{if(c.name===a||l.includes(c.name))return;let f=r.get(c.name);!f||d.has(c.name)||(m.push(f),d.add(c.name));}),p(a),m.length===0?e:m},[e,r,n,o,t]),columnsByFieldId:r,fieldsByName:n}};function zr(e){return e.name}var Bt=({fields:e,columnsByFieldId:t,defaultVisibleFieldNames:o,columnVisibilityStorageKey:r,onColumnVisibilityModelChange:n})=>{let i=!!r,[a,l]=a$7(r||"__dynamic-data-view:columns__",void 0,{initializeWithValue:i}),d=useMemo(()=>{if(!e)return;let p={};if(e.forEach(c=>{let f=zr(c);if(!t.has(f))return;let C;if(i&&a){let g=a[f];typeof g=="boolean"&&(C=g);}C===void 0&&o&&o.length>0&&(C=o.includes(c.name)),typeof C=="boolean"&&(p[f]=C);}),Object.keys(p).length!==0)return {columns:{columnVisibilityModel:p}}},[t,o,e,i,a]),m=useCallback(p=>{if(i){let c={...p};delete c.__check__,l(c);}n&&n(p);},[i,n,l]);return {initialState:d,handleColumnVisibilityModelChange:m}};var w={IMAGE_WIDTH:90,MIN_WIDTH:130,ENTITY_MIN_WIDTH:100,ENTITY_FLEX:.5,ID_MIN_WIDTH:200,ID_FLEX:1,ACTIONS_WIDTH:80},Re={READ_ONLY:"READ_ONLY",READ_AND_WRITE:"READ_AND_WRITE"},Wt=["price","base_price","minimum_value","maximum_value","minimum_installment_value"];var Yr=(e,t)=>({field:e.name,headerName:e.description,sortable:!1,width:w.IMAGE_WIDTH,resizable:!1,headerAlign:"center",align:"center",renderCell:o=>t(e,o.row)}),qr=(e,t)=>({field:e.name,headerName:e.description,minWidth:w.ID_MIN_WIDTH,flex:w.ID_FLEX,renderCell:o=>t(e,o.row)}),$r=(e,t)=>({field:e.name,headerName:e.description,minWidth:w.ENTITY_MIN_WIDTH,flex:w.ENTITY_FLEX,renderCell:o=>t(e,o.row)}),Qr=(e,t)=>({field:e.name,headerName:e.description,minWidth:w.MIN_WIDTH,renderCell:o=>t(e,o.row)}),Kr=(e,t)=>({field:e.name,headerName:"A\xE7\xF5es",width:w.ACTIONS_WIDTH,sortable:!1,resizable:!1,disableReorder:!0,headerAlign:"center",disableColumnMenu:!0,align:"center",renderCell:o=>t(e,o.row)}),Vt=(e,t)=>e.name===t?.id_field_name||e.name==="name"?qr:e.name==="ACTIONS"?Kr:e.type==="FILE"?Yr:e.type==="ENTITY"?$r:Qr;var Gt=({metadata:e,renderCell:t,columnStrategies:o})=>useMemo(()=>{if(!e?.fields)return [];let r=new Map;return e.fields.filter(i=>i.access_type===Re.READ_ONLY||i.access_type===Re.READ_AND_WRITE?!0:i.name==="ACTIONS"||i.name===e?.id_field_name||i.name==="NAME").forEach(i=>{if(r.has(i.name))return;let l=(o?.[i.name]??Vt(i,e))(i,t,e);r.set(i.name,l);}),Array.from(r.values())},[o,e,t]);var Ut=e=>e?.groups?.[0]?.conditionals?e.groups[0].conditionals.map(t=>({id:a$8(),operator:e.groups[0].operator,fieldName:t.fieldName,conditional:t.conditional,value:t.value})):[],Ht=({fields:e,initialFilter:t})=>{let[o,r]=useState(!1),[n,i]=useState(()=>Ut(t)),[a,l]=useState(t),[d,m]=useState(()=>Ut(t)),p=useRef([]),c=useCallback(()=>{p.current=n.map(u=>({...u})),m(n.map(u=>({...u}))),r(!0);},[n]),f=()=>r(!1),C=useCallback(()=>{let u=e.filter(N=>N.available_filter_conditions?.length>0);if(u.length===0)return;let y=d.map(N=>N.fieldName),b=u.filter(N=>!y.includes(N.filter_field_name??N.name));if(b.length===0)return;let L=d.length>0?d[0].operator:"AND",I=b[0],v={id:a$8(),operator:L,fieldName:I.filter_field_name??I.name,conditional:it(I),value:[]};m(N=>[...N,v]);},[e,d]),g=useCallback((u,y)=>{m(b=>{let L=b.find(I=>I.id===u);if(!L)return b;if(y.operator&&y.operator!==L.operator){let I=y.operator;return b.map(v=>v.id===u?{...v,...y}:{...v,operator:I})}return b.map(I=>I.id===u?{...I,...y}:I)});},[]),_=useCallback(u=>{m(y=>y.filter(b=>b.id!==u));},[]),s=()=>{m([]),i([]),l(void 0);},R=()=>{let u=nt(d);return i(d.map(y=>({...y}))),l(u),r(!1),u},x=()=>{m(p.current.map(u=>({...u}))),r(!1);},A=n.some(X),B=n.filter(X).length;return {conditions:d,filter:a,isOpen:o,hasActiveFilters:A,activeFiltersCount:B,openDrawer:c,closeDrawer:f,addCondition:C,updateCondition:g,removeCondition:_,clearAllFilters:s,applyFilters:R,cancelChanges:x}};var $t=e=>{try{let t=localStorage.getItem(e);return t?JSON.parse(t):void 0}catch{return}},Qt=(e,t)=>{try{t===void 0?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(t));}catch{}},Kt=(e,t,o)=>{let r=`${e}:filter`,[n,i]=useState(()=>$t(r)||t);useEffect(()=>{t!==void 0&&i(t);},[t]);let a=useCallback(l=>{i(l),Qt(r,l),o?.(l);},[r,o]);return {filter:n,setFilter:a}},Xt=(e,t,o)=>{let r=`${e}:sort`,[n,i]=useState(()=>$t(r)||t);useEffect(()=>{t!==void 0&&i(t);},[t]);let a=useCallback(l=>{i(l),Qt(r,l),o?.(l);},[r,o]);return {sort:n,setSort:a}};var ei=(e,t)=>e?e.find(r=>r.name===t)?.filter_field_name??t:t,ti=(e,t)=>e?e.find(r=>r.filter_field_name===t||r.name===t)?.name??t:t,jt=({sort:e,onSortChange:t,fields:o})=>{let r=useMemo(()=>e?[{field:ti(o,e.fieldName),sort:e.sortType.toLowerCase()}]:[],[e,o]),n=useCallback(i=>{if(!t)return;let a=i[0];if(!a||!a.sort){t(void 0);return}let l={fieldName:ei(o,a.field),sortType:a.sort.toUpperCase()};t(l);},[t,o]);return {sortModel:r,handleSortModelChange:n}};var Jt=()=>({name:"ACTIONS",description:"",filter_field_name:null,type:"TEXT",metadata:null,access_type:"READ_ONLY",relation_field_name:null,available_filter_conditions:[]}),De=e=>e.fields.some(o=>o.name==="ACTIONS")?e:{...e,fields:[...e.fields,Jt()]};var ri=({value:e,format:t})=>e==null?"-":d(e,t),_e=memo(ri);var ni=({value:e,format:t})=>e==null?"-":c(e,t),xe=memo(ni);var si=({value:e,field:t})=>{if(!t.metadata||typeof e!="object"||e===null)return e?String(e):"-";let o=e[t.metadata.description_field_name];return o?jsx(li,{label:String(o),variant:"outlined",size:"small",sx:{width:"fit-content",color:"text.secondary",borderColor:"divider",borderRadius:3}}):null},Ne=memo(si);var pi=({value:e,trueIcon:t="STAR_02",falseIcon:o="STAR",color:r="primary.main",width:n=18})=>jsx(a,{icon:e?t:o,color:r,width:n}),ci=memo(pi);var eo=styled("span")(({theme:e,isActive:t})=>({display:"inline-flex",alignItems:"center",justifyContent:"center",padding:e.spacing(.2,1),borderRadius:e.shape.borderRadius,fontSize:"0.75rem",fontWeight:600,width:"fit-content",height:"auto",lineHeight:"1.25rem",whiteSpace:"nowrap",margin:"auto",backgroundColor:t?e.palette.success.lighter||"#00A76F29":e.palette.warning.lighter||"#FF563029",color:t?e.palette.success.darker||"#007867":e.palette.warning.darker||"#B71D18"})),to=styled(ee,{shouldForwardProp:e=>!["size","noImage","clickable"].includes(e)})(({theme:e,size:t,noImage:o,clickable:r})=>({width:t,height:t,minWidth:t,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",cursor:r?"pointer":"default",transition:"opacity 0.2s ease-in-out",color:e.palette.text.disabled,...o&&{border:`1px dashed ${e.palette.divider}`,backgroundColor:e.palette.grey[100]},...r&&{"&:hover":{opacity:.8}},"& img":{width:"100%",height:"100%",objectFit:"cover",borderRadius:"50%"},[e.breakpoints.down("sm")]:{justifyContent:"flex-start",alignItems:"flex-start"}}));var Ci=({imageResourceId:e,getImageUrl:t,size:o=48,alt:r="Imagem",onClick:n,sx:i})=>{let a$1=!!e,l=a$1&&t?t(e):void 0;return jsx(to,{size:o,noImage:!a$1,clickable:!!n,onClick:n,sx:i,children:l?jsx("img",{src:l,alt:r}):jsx(a,{icon:"SEARCH_IMAGE",width:Math.round(o/2),color:"text.disabled"})})},yi=memo(Ci);var bi=({id:e,displayName:t,copyMessage:o="ID copiado!"})=>jsxs(Lt,{height:1,justifyContent:"center",children:[jsx(be,{variant:"subtitle2",noWrap:!0,title:t,children:t}),jsxs(Lt,{direction:"row",gap:1,alignItems:"center",children:[jsxs(be,{color:"grey.600",variant:"body2",noWrap:!0,children:["ID: ",e]}),jsx(a$5,{toCopy:e,message:o})]})]}),hi=memo(bi);var Ri=({value:e,isCurrency:t=!1})=>e==null?"-":jsx(Lt,{direction:"row",alignItems:"center",height:"100%",children:jsx(be,{variant:"body2",noWrap:!0,width:"fit-content",children:t?h(Number(e)):a$6(Number(e))})}),ve=memo(Ri);var _i=({active:e,activeLabel:t="Ativo",inactiveLabel:o="Inativo"})=>jsx(eo,{isActive:e,children:e?t:o}),Me=memo(_i);var vi=e=>e.replace(/<[^>]*>/g,"").replace(/&nbsp;/g," ").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").trim(),Mi=({value:e,showCopyButton:t=!1,copyMessage:o="Copiado",copyLabel:r,mask:n})=>{if(!e)return "-";let i=String(e),a=n?n(i):vi(i);return t?jsxs(Lt,{direction:"row",gap:1,alignItems:"center",children:[jsx(be,{variant:"body2",noWrap:!0,children:a}),jsx(a$5,{toCopy:i,message:o,label:r})]}):a},we=memo(Mi);function Li(e){return Wt.includes(e)}var lo=e=>{let{onRowAction:t}=e,o=(r,n)=>{let i=n[r.name];if(r.name==="ACTIONS")return t?.(n.id,n);switch(r.type){case"BOOLEAN":return jsx(Me,{active:!!i,activeLabel:"Ativo",inactiveLabel:"Inativo"});case"DATE":return jsx(_e,{value:i});case"DATETIME":return jsx(xe,{value:i});case"DECIMAL":case"INTEGER":return jsx(ve,{value:i,isCurrency:Li(r.name)});case"FILE":case"ENTITY":return jsx(Ne,{value:i,field:r});case"TEXT":default:return jsx(we,{value:i})}};return o.displayName="CellRendererComponent",o};var ki=({title:e,metadata:t,data:o,isLoading:r,isFetching:n,page:i,perPage:a,searchValue:l,onSearchChange:d,onSearch:m,onPaginationChange:p,onAdd:c,onRowAction:f,onRowDoubleClick:C,actions:g,moreActions:_,bulkActions:s,rowSelectionModel:R,onRowSelectionModelChange:x,slots:A,mobileRender:B,containerHeight:u=600,showColumnButton:y=!1,showFilterButton:b$1=!1,filter:L,onFilterChange:I,sort:v,onSortChange:N,defaultVisibleFieldNames:co,preferredFieldOrder:uo,columnStrategies:fo,onColumnVisibilityModelChange:go,storageKey:se,entityFilterConfig:Co})=>{let{items:H=[],total:yo=0}=o||{},z=useMemo(()=>{if(t)return t;if(H.length>0){let M=H[0],Q=Object.keys(M).map(Ge=>({name:Ge,type:"TEXT",description:Ge,filter_field_name:null,metadata:null,access_type:"READ_ONLY",relation_field_name:null,available_filter_conditions:[]}));return {name:"loading",description:"Loading...",id_field_name:"id",description_field_name:Q[0]?.name||"id",access_type:"READ_ONLY",fields:Q}}},[t,H]),W=useMemo(()=>z&&f?De(z):z,[z,f]),Y=useMemo(()=>W?.fields||[],[W]),So=useMemo(()=>lo({onRowAction:f}),[f]),bo=Gt({metadata:W,renderCell:So,columnStrategies:fo}),{orderedColumns:ho,columnsByFieldId:Fo}=kt({columns:bo,fields:W?.fields,preferredFieldOrder:uo}),{initialState:Io,handleColumnVisibilityModelChange:To}=Bt({fields:W?.fields,columnsByFieldId:Fo,defaultVisibleFieldNames:co,columnVisibilityStorageKey:`${se}:columns`,onColumnVisibilityModelChange:go}),Ro=useCallback(M=>{if(!C)return;let Q=M.id?.toString()||"";C(Q,M.row);},[C]),q=b("down","md"),[Do,me]=useState(null),{filter:_o,setFilter:$}=Kt(se,L,I),{sort:xo,setSort:Le}=Xt(se,v,N),No=L??_o,de=v??xo,{sortModel:Eo,handleSortModelChange:Ao}=jt({sort:de,onSortChange:Le,fields:Y}),{conditions:vo,isOpen:Mo,openDrawer:pe,closeDrawer:Pe,addCondition:wo,updateCondition:Lo,removeCondition:Po,clearAllFilters:Oe,applyFilters:ke,cancelChanges:Be,hasActiveFilters:Oo,activeFiltersCount:ko}=Ht({fields:Y,initialFilter:No}),Bo=useCallback(()=>{let M=ke();$(M);},[ke,$]),Wo=useCallback(()=>{Oe(),$(void 0);},[Oe,$]),Vo=useCallback(M=>{q?pe():(pe(),me(M.currentTarget));},[q,pe]),Go=useCallback(()=>{Be(),me(null);},[Be]),[Uo,We]=useState(!1),Ho=useCallback(()=>{me(null),Pe();},[Pe]),Ve=!!s?.length;return jsxs(Fragment,{children:[jsx(d$1,{title:e,columns:ho,rows:H,mobileRender:B,rowCount:yo,loading:r||!t,fetching:n,searchValue:l,onSearch:m,onSearchChange:d,paginationModel:{page:i,pageSize:a},onPaginationChange:p,actions:g,moreActions:_,onAdd:c,onRowDoubleClick:C?Ro:void 0,bulkActions:s,checkboxSelection:Ve,rowSelectionModel:R,onRowSelectionModelChange:x,keepNonExistentRowsSelected:Ve,disableRowSelectionOnClick:!0,slots:A,initialState:Io,showColumnButton:y,containerProps:{height:u,maxHeight:u},onColumnVisibilityModelChange:To,filterButton:jsx(ot,{showFilterButton:b$1,isMobile:q,hasActiveFilters:Oo,activeFiltersCount:ko,sort:de,onFilterClick:Vo,onSortClick:()=>We(!0)}),sortingMode:"server",sortModel:Eo,onSortModelChange:Ao,disableColumnFilter:!0}),t&&jsxs(Fragment,{children:[jsx(Ft,{showFilterButton:b$1,isOpen:Mo,filterAnchorEl:Do,fields:Y,conditions:vo,isMobile:q,onClose:Ho,onAddCondition:wo,onUpdateCondition:Lo,onRemoveCondition:Po,onApply:Bo,onClear:Wo,onCancel:Go,entityFilterConfig:Co}),jsx(Ot,{open:Uo,onClose:()=>We(!1),fields:Y,sort:de,onSortChange:Le})]})]})},Bi=memo(ki,$o);var Wi=({metadata:e,columnVisibilityModel:t,defaultVisibleFields:o})=>{if(!e?.fields)return;let n=e.fields.map(i=>i.name).filter(i=>i==="ACTIONS"?!1:t?t[i]!==!1:o?.includes(i)??!0);return o?n.sort((i,a)=>{let l=o.indexOf(i),d=o.indexOf(a);return l-d||0}):n};
59
60
 
60
- export { Ne as DateRenderer, Ee as DateTimeRenderer, ve as EntityRenderer, gi as IconRenderer, hi as ImageRenderer, Ri as NameRenderer, we as NumberRenderer, Le as StatusRenderer, Pe as TextRenderer, xe as addActionsFieldToMetadata, Hi as buildVisibleFields, Zt as createActionsField, Ui as default };
61
+ export { _e as DateRenderer, xe as DateTimeRenderer, Ne as EntityRenderer, ci as IconRenderer, yi as ImageRenderer, hi as NameRenderer, ve as NumberRenderer, Me as StatusRenderer, we as TextRenderer, De as addActionsFieldToMetadata, Wi as buildVisibleFields, Jt as createActionsField, Bi as default };
61
62
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/DynamicDataView/DynamicDataView.tsx","../../../src/components/DynamicDataView/components/FilterButton.tsx","../../../src/components/DynamicDataView/components/FiltersSection.tsx","../../../src/components/DynamicDataView/components/filters/FiltersContainer.tsx","../../../src/components/DynamicDataView/components/filters/FiltersContent.tsx","../../../src/components/DynamicDataView/utils/filter.ts","../../../src/components/DynamicDataView/components/filters/FiltersList.tsx","../../../src/components/DynamicDataView/components/filters/FilterRow.tsx","../../../src/components/DynamicDataView/constants/filter.ts","../../../src/components/DynamicDataView/components/filters/EntityFilter.tsx","../../../src/components/DynamicDataView/components/filters/OperatorSelect.tsx","../../../src/components/DynamicDataView/components/filters/styles.ts","../../../src/components/DynamicDataView/components/SortModal/index.tsx","../../../src/components/DynamicDataView/components/SortModal/style.ts","../../../src/components/DynamicDataView/hooks/useColumnOrdering.ts","../../../src/components/DynamicDataView/hooks/useColumnVisibility.ts","../../../src/components/DynamicDataView/hooks/useDynamicColumns.ts","../../../src/components/DynamicDataView/constants/columnDefaults.ts","../../../src/components/DynamicDataView/utils/columnStrategies.ts","../../../src/components/DynamicDataView/hooks/useFilters.ts","../../../src/components/DynamicDataView/hooks/useFilterSortStorage.ts","../../../src/components/DynamicDataView/hooks/useSorting.ts","../../../src/components/DynamicDataView/utils/addActionsField.ts","../../../src/components/DynamicDataView/renderers/DateRenderer.ts","../../../src/components/DynamicDataView/renderers/DateTimeRenderer.ts","../../../src/components/DynamicDataView/renderers/EntityRenderer.tsx","../../../src/components/DynamicDataView/renderers/IconRenderer.tsx","../../../src/components/DynamicDataView/renderers/ImageRenderer.tsx","../../../src/components/DynamicDataView/renderers/style.ts","../../../src/components/DynamicDataView/renderers/NameRenderer.tsx","../../../src/components/DynamicDataView/renderers/NumberRenderer.tsx","../../../src/components/DynamicDataView/renderers/StatusRenderer.tsx","../../../src/components/DynamicDataView/renderers/TextRenderer.tsx","../../../src/components/DynamicDataView/utils/createCellRenderer.tsx","../../../src/components/DynamicDataView/utils/fields.ts"],"names":["memo","useCallback","useMemo","useState","isEqual","Badge","Button","IconButton","Stack","jsx","jsxs","FilterButton","showFilterButton","isMobile","hasActiveFilters","activeFiltersCount","sort","onFilterClick","onSortClick","Icon_default","ToolbarActionsDivider","FilterButton_default","Divider","Typography","getFilterableFields","fields","field","getDefaultCondition","type","available_filter_conditions","isValidCondition","condition","buildFilterFromConditions","conditions","validConditions","c","FormControl","InputLabel","MenuItem","Select","TextField","CONDITION_LABELS","CircularProgress","ellipsisStyle","EntityFilter","config","metadata","value","initialLabel","onChange","disabled","open","setOpen","useToggle_default","data","isLoading","isFetching","loading","selectedOption","options","items","item","opt","handleChange","newValue","option","labelId","e","selected","EntityFilter_default","OperatorSelect","totalConditions","isFirst","OperatorSelect_default","FilterRow","onRemove","entityFilterConfig","selectedField","f","availableConditions","isValueDisabled","handleFieldChange","fieldName","newField","defaultCondition","handleConditionChange","conditional","handleValueChange","handleEntityValueChange","label","valueLabels","handleOperatorChange","operator","renderValueInput","currentValue","cond","FilterRow_default","Fragment","FiltersList","filterableFields","onUpdateCondition","onRemoveCondition","handleUpdateCondition","updated","handleRemoveCondition","id","usedFieldNames","name","getAvailableFields","currentFieldName","index","FiltersList_default","Box","styled","Container","Header","theme","Content","Footer","FiltersContent","onClose","onAddCondition","onApply","onClear","onCancel","hasConditions","handleApply","handleClear","handleCancel","FiltersContent_default","FiltersContainer","props","ResponsivePopover_default","FiltersContainer_default","FiltersSection","isOpen","filterAnchorEl","FiltersSection_default","useEffect","Dialog","DialogActions","DialogContent","DialogTitle","StyledDialog","StyledDialogTitle","StyledDialogContent","StyledDialogActions","ApplyButton","LabelButton","SortModal","onSortChange","setSelectedField","selectedDirection","setSelectedDirection","sortableFields","selectedFieldObj","isNumberField","SortModal_default","useColumnOrdering","columns","preferredFieldOrder","columnsByFieldId","column","fieldsByName","actionFieldName","preferredWithoutActions","usedColumnFieldIds","ordered","pushColumnForField","getColumnFieldIdFromField","useColumnVisibility","defaultVisibleFieldNames","columnVisibilityStorageKey","onColumnVisibilityModelChange","hasStorageKey","storedVisibilityModel","setStoredVisibilityModel","useLocalStorage_default","initialState","visibilityModel","columnFieldId","visible","stored","handleColumnVisibilityModelChange","model","modelToSave","COLUMN_DEFAULTS","ACCESS_TYPES","CURRENCY_FIELD_NAMES","createImageColumn","renderCell","params","createIdColumn","createEntityColumn","createDefaultColumn","createActionsColumn","getColumnStrategy","useDynamicColumns","columnStrategies","columnsMap","useRef","parseInitialConditions","initialFilter","uuidv4","useFilters","setIsOpen","appliedConditions","setAppliedConditions","appliedFilter","setAppliedFilter","setConditions","snapshotRef","openDrawer","closeDrawer","addCondition","availableFields","currentOperator","firstField","newCondition","prev","updateCondition","changes","targetCondition","newOperator","removeCondition","clearAllFilters","applyFilters","filter","cancelChanges","getStoredValue","key","setStoredValue","useFilterStorage","storageKey","externalFilter","onFilterChange","filterKey","internalFilter","setInternalFilter","handleFilterChange","newFilter","useSortStorage","externalSort","sortKey","internalSort","setInternalSort","handleSortChange","newSort","resolveApiFieldName","resolveColumnFieldName","useSorting","sortModel","handleSortModelChange","firstItem","createActionsField","addActionsFieldToMetadata","DateRenderer","format","fDate","DateRenderer_default","DateTimeRenderer","fDateTime","DateTimeRenderer_default","Chip","EntityRenderer","entityValue","EntityRenderer_default","IconRenderer","trueIcon","falseIcon","color","width","IconRenderer_default","StatusLabel","isActive","ImageContainer","prop","size","noImage","clickable","ImageRenderer","imageResourceId","getImageUrl","alt","onClick","sx","hasImage","imageUrl","ImageRenderer_default","NameRenderer","displayName","copyMessage","CopyButton_default","NameRenderer_default","NumberRenderer","isCurrency","fCurrencyBRL","fNumber","NumberRenderer_default","StatusRenderer","active","activeLabel","inactiveLabel","StatusRenderer_default","sanitizeHtml","text","TextRenderer","showCopyButton","copyLabel","mask","stringValue","formattedValue","TextRenderer_default","getIsCurrency","createCellRenderer","context","onRowAction","CellRendererComponent","row","DynamicDataView","title","page","perPage","searchValue","onSearchChange","onSearch","onPaginationChange","onAdd","onRowDoubleClick","actions","moreActions","bulkActions","rowSelectionModel","onRowSelectionModelChange","slots","mobileRender","containerHeight","showColumnButton","rows","total","preloadedMetadata","firstRow","effectiveMetadata","effectiveMetadataFields","orderedColumns","handleRowDoubleClick","rowId","useResponsive_default","setFilterAnchorEl","storedFilter","setStoredFilter","storedSort","setStoredSort","effectiveFilter","effectiveSort","handleApplyFilters","handleClearFilters","handleFilterButtonClick","event","handleCancelFilters","isSortModalOpen","setIsSortModalOpen","handleFiltersClose","hasSelectionActions","DataView_default","DynamicDataView_default","buildVisibleFields","columnVisibilityModel","defaultVisibleFields","a","b","indexA","indexB"],"mappings":"kvCAAA,OAAS,QAAAA,GAAM,eAAAC,EAAa,WAAAC,GAAS,YAAAC,OAAgB,QACrD,OAAOC,OAAa,qBCDpB,OAAS,QAAAJ,OAAY,QACrB,OAAOI,OAAa,qBACpB,OAAOC,OAAW,sBAClB,OAAOC,OAAY,uBACnB,OAAOC,OAAgB,2BACvB,OAAOC,OAAW,sBAoBZ,OAmBM,OAAAC,EAnBN,QAAAC,OAAA,oBAbN,IAAMC,GAAe,CAAC,CACpB,iBAAAC,EACA,SAAAC,EACA,iBAAAC,EACA,mBAAAC,EACA,KAAAC,EACA,cAAAC,EACA,YAAAC,CACF,IACON,EAEDC,EAEAH,GAACF,GAAA,CAAM,UAAU,MAAM,QAAS,GAC9B,UAAAC,EAACJ,GAAA,CACC,aAAcU,EACd,MAAM,UACN,UAAWA,IAAuB,EAClC,GAAI,CACF,oBAAqB,CACnB,UAAW,kCACX,QAASA,IAAuB,EAAI,EAAI,CAC1C,CACF,EAEA,SAAAN,EAACF,GAAA,CACC,MAAOO,EAAmB,UAAY,UACtC,QAASG,EACT,KAAK,QACL,aAAW,UACX,GAAI,CAAE,SAAU,SAAU,EAE1B,SAAAR,EAACU,EAAA,CAAK,KAAK,kBAAkB,EAC/B,EACF,EAEAV,EAACW,GAAA,CACC,GAAI,CAAE,OAAQ,EAAG,EACjB,YAAY,WACZ,SAAQ,GACV,EAEAX,EAACF,GAAA,CACC,MAAOS,EAAO,UAAY,UAC1B,QAASE,EACT,KAAK,QACL,aAAW,UAEX,SAAAT,EAACU,EAAA,CACC,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AS6V,GACT,eAAgBpJ,GAChB,kBAAmBM,GACnB,kBAAmBI,GACnB,QAASmI,GACT,QAASC,GACT,SAAUG,GACV,mBAAoB3R,GACtB,EAEAnE,GAACoJ,GAAA,CACC,KAAM2M,GACN,QAAS,IAAMC,GAAmB,EAAK,EACvC,OAAQlB,EACR,KAAMW,GACN,aAAcF,GAChB,GACF,GAEJ,CAEJ,EAEOa,GAAQ7W,GAAK+T,GAAiB3T,EAAO,EkCxSrC,IAAM0W,GAAqB,CAAC,CACjC,SAAAhU,EACA,sBAAAiU,EACA,qBAAAC,CACF,IAAsD,CACpD,GAAI,CAAClU,GAAU,OAAQ,OAIvB,IAAMuI,EAFYvI,EAAS,OAAO,IAAIgC,GAAKA,EAAE,IAAI,EAEvB,OAAOI,GAC3BA,IAAc,UAAkB,GAEhC6R,EACKA,EAAsB7R,CAAS,IAAM,GAGvC8R,GAAsB,SAAS9R,CAAS,GAAK,EACrD,EAED,OAAK8R,EAEE3L,EAAQ,KAAK,CAAC4L,EAAGC,IAAM,CAC5B,IAAMC,EAASH,EAAqB,QAAQC,CAAC,EACvCG,EAASJ,EAAqB,QAAQE,CAAC,EAE7C,OAAOC,EAASC,GAAU,CAC5B,CAAC,EAPiC/L,CAQpC","sourcesContent":["import { memo, useCallback, useMemo, useState } from 'react';\nimport isEqual from 'react-fast-compare';\nimport { AccessType, DataType } from 'model/entity-metadata';\n\nimport useResponsive from 'hooks/useResponsive';\n\nimport DataView from '../DataView';\n\nimport FilterButton from './components/FilterButton';\nimport FiltersSection from './components/FiltersSection';\nimport SortModal from './components/SortModal';\nimport { useColumnOrdering } from './hooks/useColumnOrdering';\nimport { useColumnVisibility } from './hooks/useColumnVisibility';\nimport { useDynamicColumns } from './hooks/useDynamicColumns';\nimport { useFilters } from './hooks/useFilters';\nimport { useFilterStorage, useSortStorage } from './hooks/useFilterSortStorage';\nimport { useSorting } from './hooks/useSorting';\nimport { addActionsFieldToMetadata } from './utils/addActionsField';\nimport { createCellRenderer } from './utils/createCellRenderer';\nimport { DynamicDataViewProps, DynamicRowData } from './props';\n\nconst DynamicDataView = <T extends object = object>({\n title,\n metadata,\n data,\n isLoading,\n isFetching,\n page,\n perPage,\n searchValue,\n onSearchChange,\n onSearch,\n onPaginationChange,\n onAdd,\n onRowAction,\n onRowDoubleClick,\n actions,\n moreActions,\n bulkActions,\n rowSelectionModel,\n onRowSelectionModelChange,\n slots,\n mobileRender,\n containerHeight = 600,\n showColumnButton = false,\n showFilterButton = false,\n filter,\n onFilterChange,\n sort,\n onSortChange,\n defaultVisibleFieldNames,\n preferredFieldOrder,\n columnStrategies,\n onColumnVisibilityModelChange,\n storageKey,\n entityFilterConfig,\n}: DynamicDataViewProps<T>) => {\n const { items: rows = [], total = 0 } = data || {};\n\n // Criar metadata temporário baseado em data quando metadata não disponível\n const preloadedMetadata = useMemo(() => {\n if (metadata) return metadata;\n\n // Se não tem metadata mas tem dados, criar metadata baseado nas keys do primeiro item\n if (rows.length > 0) {\n const firstRow = rows[0];\n const fields = Object.keys(firstRow).map(key => ({\n name: key,\n type: DataType.TEXT,\n description: key,\n filter_field_name: null,\n metadata: null,\n access_type: AccessType.READ_ONLY,\n relation_field_name: null,\n available_filter_conditions: [],\n }));\n\n return {\n name: 'loading',\n description: 'Loading...',\n id_field_name: 'id',\n description_field_name: fields[0]?.name || 'id',\n access_type: AccessType.READ_ONLY,\n fields,\n };\n }\n\n return undefined;\n }, [metadata, rows]);\n\n const effectiveMetadata = useMemo(\n () =>\n preloadedMetadata && onRowAction\n ? addActionsFieldToMetadata(preloadedMetadata)\n : preloadedMetadata,\n [preloadedMetadata, onRowAction],\n );\n\n const effectiveMetadataFields = useMemo(\n () => effectiveMetadata?.fields || [],\n [effectiveMetadata],\n );\n\n const renderCell = useMemo(\n () =>\n createCellRenderer<T>({\n onRowAction,\n }),\n [onRowAction],\n );\n\n const columns = useDynamicColumns<T>({\n metadata: effectiveMetadata,\n renderCell,\n columnStrategies,\n });\n\n const { orderedColumns, columnsByFieldId } = useColumnOrdering({\n columns,\n fields: effectiveMetadata?.fields,\n preferredFieldOrder,\n });\n\n const { initialState, handleColumnVisibilityModelChange } =\n useColumnVisibility({\n fields: effectiveMetadata?.fields,\n columnsByFieldId,\n defaultVisibleFieldNames,\n columnVisibilityStorageKey: `${storageKey}:columns`,\n onColumnVisibilityModelChange,\n });\n\n const handleRowDoubleClick = useCallback(\n (params: { id: string | number; row: DynamicRowData<T> }) => {\n if (!onRowDoubleClick) return;\n\n const rowId = params.id?.toString() || '';\n onRowDoubleClick(rowId, params.row);\n },\n [onRowDoubleClick],\n );\n\n const isMobile = useResponsive('down', 'md');\n const [filterAnchorEl, setFilterAnchorEl] = useState<HTMLElement | null>(\n null,\n );\n\n const { filter: storedFilter, setFilter: setStoredFilter } = useFilterStorage(\n storageKey,\n filter,\n onFilterChange,\n );\n\n const { sort: storedSort, setSort: setStoredSort } = useSortStorage(\n storageKey,\n sort,\n onSortChange,\n );\n\n const effectiveFilter = filter ?? storedFilter;\n const effectiveSort = sort ?? storedSort;\n\n const { sortModel, handleSortModelChange } = useSorting({\n sort: effectiveSort,\n onSortChange: setStoredSort,\n fields: effectiveMetadataFields,\n });\n\n const {\n conditions,\n isOpen,\n openDrawer,\n closeDrawer,\n addCondition,\n updateCondition,\n removeCondition,\n clearAllFilters,\n applyFilters,\n cancelChanges,\n hasActiveFilters,\n activeFiltersCount,\n } = useFilters({\n fields: effectiveMetadataFields,\n initialFilter: effectiveFilter,\n });\n\n const handleApplyFilters = useCallback(() => {\n const newFilter = applyFilters();\n setStoredFilter(newFilter);\n }, [applyFilters, setStoredFilter]);\n\n const handleClearFilters = useCallback(() => {\n clearAllFilters();\n setStoredFilter(undefined);\n }, [clearAllFilters, setStoredFilter]);\n\n const handleFilterButtonClick = useCallback(\n (event: React.MouseEvent<HTMLElement>) => {\n if (isMobile) {\n openDrawer();\n } else {\n openDrawer();\n setFilterAnchorEl(event.currentTarget);\n }\n },\n [isMobile, openDrawer],\n );\n\n const handleCancelFilters = useCallback(() => {\n cancelChanges();\n setFilterAnchorEl(null);\n }, [cancelChanges]);\n\n const [isSortModalOpen, setIsSortModalOpen] = useState(false);\n\n const handleFiltersClose = useCallback(() => {\n setFilterAnchorEl(null);\n closeDrawer();\n }, [closeDrawer]);\n const hasSelectionActions = !!bulkActions?.length;\n\n return (\n <>\n <DataView<DynamicRowData<T>>\n title={title}\n columns={orderedColumns}\n rows={rows}\n mobileRender={mobileRender}\n rowCount={total}\n loading={isLoading || !metadata}\n fetching={isFetching}\n searchValue={searchValue}\n onSearch={onSearch}\n onSearchChange={onSearchChange}\n paginationModel={{\n page,\n pageSize: perPage,\n }}\n onPaginationChange={onPaginationChange}\n actions={actions}\n moreActions={moreActions}\n onAdd={onAdd}\n onRowDoubleClick={onRowDoubleClick ? handleRowDoubleClick : undefined}\n bulkActions={bulkActions}\n checkboxSelection={hasSelectionActions}\n rowSelectionModel={rowSelectionModel}\n onRowSelectionModelChange={onRowSelectionModelChange}\n keepNonExistentRowsSelected={hasSelectionActions}\n disableRowSelectionOnClick\n slots={slots}\n initialState={initialState}\n showColumnButton={showColumnButton}\n containerProps={{\n height: containerHeight,\n maxHeight: containerHeight,\n }}\n onColumnVisibilityModelChange={handleColumnVisibilityModelChange}\n filterButton={\n <FilterButton\n showFilterButton={showFilterButton}\n isMobile={isMobile}\n hasActiveFilters={hasActiveFilters}\n activeFiltersCount={activeFiltersCount}\n sort={effectiveSort}\n onFilterClick={handleFilterButtonClick}\n onSortClick={() => setIsSortModalOpen(true)}\n />\n }\n sortingMode=\"server\"\n sortModel={sortModel}\n onSortModelChange={handleSortModelChange}\n disableColumnFilter\n />\n {metadata && (\n <>\n <FiltersSection\n showFilterButton={showFilterButton}\n isOpen={isOpen}\n filterAnchorEl={filterAnchorEl}\n fields={effectiveMetadataFields}\n conditions={conditions}\n isMobile={isMobile}\n onClose={handleFiltersClose}\n onAddCondition={addCondition}\n onUpdateCondition={updateCondition}\n onRemoveCondition={removeCondition}\n onApply={handleApplyFilters}\n onClear={handleClearFilters}\n onCancel={handleCancelFilters}\n entityFilterConfig={entityFilterConfig}\n />\n\n <SortModal\n open={isSortModalOpen}\n onClose={() => setIsSortModalOpen(false)}\n fields={effectiveMetadataFields}\n sort={effectiveSort}\n onSortChange={setStoredSort}\n />\n </>\n )}\n </>\n );\n};\n\nexport default memo(DynamicDataView, isEqual) as typeof DynamicDataView;\nexport type { DynamicDataViewProps, DynamicRowData } from './props';\n","import { memo } from 'react';\nimport isEqual from 'react-fast-compare';\nimport Badge from '@mui/material/Badge';\nimport Button from '@mui/material/Button';\nimport IconButton from '@mui/material/IconButton';\nimport Stack from '@mui/material/Stack';\n\nimport { ToolbarActionsDivider } from 'components/DataView';\nimport Icon from 'components/Icon';\n\nimport { FilterButtonProps } from '../props';\n\nconst FilterButton = ({\n showFilterButton,\n isMobile,\n hasActiveFilters,\n activeFiltersCount,\n sort,\n onFilterClick,\n onSortClick,\n}: FilterButtonProps) => {\n if (!showFilterButton) return null;\n\n if (isMobile) {\n return (\n <Stack direction=\"row\" spacing={0.5}>\n <Badge\n badgeContent={activeFiltersCount}\n color=\"primary\"\n invisible={activeFiltersCount === 0}\n sx={{\n '& .MuiBadge-badge': {\n transform: 'scale(0.9) translate(10px, 9px)',\n opacity: activeFiltersCount === 0 ? 0 : 1,\n },\n }}\n >\n <IconButton\n color={hasActiveFilters ? 'primary' : 'default'}\n onClick={onFilterClick}\n size=\"small\"\n aria-label=\"Filtrar\"\n sx={{ overflow: 'visible' }}\n >\n <Icon icon=\"FILTER_VERTICAL\" />\n </IconButton>\n </Badge>\n\n <ToolbarActionsDivider\n sx={{ height: 16 }}\n orientation=\"vertical\"\n flexItem\n />\n\n <IconButton\n color={sort ? 'primary' : 'default'}\n onClick={onSortClick}\n size=\"small\"\n aria-label=\"Ordenar\"\n >\n <Icon\n icon={sort?.sortType === 'DESC' ? 'SORTING_DESC' : 'SORTING_ASC'}\n />\n </IconButton>\n </Stack>\n );\n }\n\n return (\n <Badge\n badgeContent={activeFiltersCount}\n color=\"primary\"\n invisible={activeFiltersCount === 0}\n sx={{\n '& .MuiBadge-badge': activeFiltersCount\n ? {\n transform: 'scale(0.9) translate(-3px, 7px)',\n position: 'relative',\n opacity: 1,\n transition: 'none',\n }\n : {\n transition: 'none',\n opacity: 0,\n },\n }}\n >\n <Button\n variant=\"text\"\n color={hasActiveFilters ? 'primary' : 'inherit'}\n startIcon={<Icon icon=\"FILTER_VERTICAL\" />}\n onClick={onFilterClick}\n size=\"small\"\n >\n Filtrar\n </Button>\n </Badge>\n );\n};\n\nexport default memo(FilterButton, isEqual);\n","import { memo } from 'react';\nimport isEqual from 'react-fast-compare';\n\nimport { FiltersSectionProps } from '../props';\n\nimport FiltersContainer from './filters/FiltersContainer';\n\nconst FiltersSection = ({\n showFilterButton,\n isOpen,\n filterAnchorEl,\n fields,\n conditions,\n isMobile,\n onClose,\n onAddCondition,\n onUpdateCondition,\n onRemoveCondition,\n onApply,\n onClear,\n onCancel,\n entityFilterConfig,\n}: FiltersSectionProps) => {\n if (!showFilterButton) return null;\n\n return (\n <FiltersContainer\n open={isOpen || Boolean(filterAnchorEl)}\n anchorEl={filterAnchorEl}\n onClose={onClose}\n fields={fields}\n conditions={conditions}\n onAddCondition={onAddCondition}\n onUpdateCondition={onUpdateCondition}\n onRemoveCondition={onRemoveCondition}\n onApply={onApply}\n onClear={onClear}\n onCancel={onCancel}\n isMobileProp={isMobile}\n entityFilterConfig={entityFilterConfig}\n />\n );\n};\n\nexport default memo(FiltersSection, isEqual);\n","import { memo } from 'react';\nimport isEqual from 'react-fast-compare';\n\nimport ResponsivePopover from 'components/ResponsivePopover';\n\nimport FiltersContent from './FiltersContent';\nimport type { FiltersContainerProps } from './props';\n\nconst FiltersContainer = (props: FiltersContainerProps) => {\n return (\n <ResponsivePopover\n open={props.open}\n onClose={props.onClose}\n anchorEl={props.anchorEl}\n isMobile={props.isMobileProp}\n popoverProps={{\n slotProps: {\n paper: {\n sx: {\n width: 520,\n maxWidth: 'calc(100vw - 24px)',\n maxHeight: 600,\n mt: 1,\n },\n },\n },\n }}\n drawerProps={{\n anchor: 'right',\n PaperProps: {\n sx: {\n width: '100%',\n maxWidth: '100%',\n height: '100%',\n maxHeight: '100%',\n borderRadius: 0,\n },\n },\n }}\n >\n <FiltersContent {...props} />\n </ResponsivePopover>\n );\n};\n\nexport default memo(FiltersContainer, isEqual);\n","import { memo, useCallback } from 'react';\nimport isEqual from 'react-fast-compare';\nimport Button from '@mui/material/Button';\nimport Divider from '@mui/material/Divider';\nimport IconButton from '@mui/material/IconButton';\nimport Stack from '@mui/material/Stack';\nimport Typography from '@mui/material/Typography';\n\nimport Icon from 'components/Icon';\n\nimport { getFilterableFields } from '../../utils/filter';\n\nimport FiltersList from './FiltersList';\nimport type { FiltersPopoverProps } from './props';\nimport { Container, Content, Footer, Header } from './styles';\n\nconst FiltersContent = ({\n onClose,\n fields,\n conditions,\n onAddCondition,\n onUpdateCondition,\n onRemoveCondition,\n onApply,\n onClear,\n onCancel,\n entityFilterConfig,\n}: FiltersPopoverProps) => {\n const filterableFields = getFilterableFields(fields);\n const hasConditions = conditions.length > 0;\n\n const handleApply = useCallback(() => {\n onApply();\n onClose();\n }, [onApply, onClose]);\n\n const handleClear = useCallback(() => {\n onClear();\n onClose();\n }, [onClear, onClose]);\n\n const handleCancel = useCallback(() => {\n onCancel();\n }, [onCancel]);\n\n return (\n <Container>\n <Header>\n <Typography variant=\"overline\" fontWeight={600} color=\"text.secondary\">\n Defina as condições para filtrar\n </Typography>\n\n <IconButton\n onClick={onAddCondition}\n size=\"small\"\n aria-label=\"Adicionar filtro\"\n title=\"Adicionar filtro\"\n disabled={conditions.length >= filterableFields.length}\n >\n <Icon icon=\"SIMPLE_ADD\" />\n </IconButton>\n </Header>\n\n <Divider />\n\n <Content>\n <FiltersList\n filterableFields={filterableFields}\n conditions={conditions}\n onUpdateCondition={onUpdateCondition}\n onRemoveCondition={onRemoveCondition}\n entityFilterConfig={entityFilterConfig}\n />\n </Content>\n\n <Divider />\n\n <Footer>\n <Button variant=\"text\" color=\"inherit\" onClick={handleClear}>\n Limpar\n </Button>\n\n <Stack direction=\"row\" spacing={1}>\n <Button\n variant=\"outlined\"\n color=\"inherit\"\n onClick={handleCancel}\n startIcon={<Icon icon=\"CANCEL_CIRCLE\" />}\n >\n Cancelar\n </Button>\n <Button\n variant=\"contained\"\n onClick={handleApply}\n disabled={!hasConditions}\n startIcon={<Icon icon=\"SIMPLE_CHECK\" />}\n >\n Aplicar\n </Button>\n </Stack>\n </Footer>\n </Container>\n );\n};\n\nexport default memo(FiltersContent, isEqual);\n","import { Condition, DataType, Field } from 'model/entity-metadata';\nimport {\n Filter,\n FilterCondition,\n FilterOperator,\n FilterState,\n} from 'model/filter';\n\n/**\n * Campos filtráveis (campos com condições disponíveis)\n */\nexport const getFilterableFields = (fields: Field[]): Field[] => {\n return fields.filter(\n field =>\n field.available_filter_conditions &&\n field.available_filter_conditions.length > 0 &&\n field.name !== 'ACTIONS',\n );\n};\n\n/**\n * Converte FilterState para formato de API\n */\nexport const buildFilterFromState = (\n state: FilterState,\n): Filter | undefined => {\n const entries = Object.entries(state).filter(\n ([, value]) => value.value.length > 0,\n );\n if (entries.length === 0) return undefined;\n return {\n operator: FilterOperator.AND,\n groups: [\n {\n operator: FilterOperator.AND,\n conditionals: entries.map(([, filterValue]) => ({\n fieldName: filterValue.fieldName,\n conditional: filterValue.conditional,\n value: filterValue.value,\n })),\n },\n ],\n };\n};\n\n/**\n * Retorna o conditional padrão para um tipo de campo\n */\nexport const getDefaultCondition = (field: Field): Condition => {\n const { type, available_filter_conditions } = field;\n if (available_filter_conditions.length === 0) return Condition.EQUALS;\n if (\n type === DataType.TEXT &&\n available_filter_conditions.includes(Condition.LIKE)\n ) {\n return Condition.LIKE;\n }\n return available_filter_conditions[0];\n};\n\n/**\n * Verifica se uma condição é válida (tem valor ou não requer valor)\n */\nexport const isValidCondition = (condition: FilterCondition): boolean => {\n return (\n condition.value.length > 0 ||\n condition.conditional === Condition.IS_NULL ||\n condition.conditional === Condition.IS_NOT_NULL\n );\n};\n\n/**\n * Converte array de FilterCondition para Filter API\n */\nexport const buildFilterFromConditions = (\n conditions: FilterCondition[],\n): Filter | undefined => {\n if (conditions.length === 0) return undefined;\n\n const validConditions = conditions.filter(isValidCondition);\n if (validConditions.length === 0) return undefined;\n\n return {\n operator: FilterOperator.AND,\n groups: [\n {\n operator: validConditions[0]?.operator || FilterOperator.AND,\n conditionals: validConditions.map(c => ({\n fieldName: c.fieldName,\n conditional: c.conditional,\n value: c.value,\n })),\n },\n ],\n };\n};\n","import { memo, useCallback, useMemo } from 'react';\nimport isEqual from 'react-fast-compare';\nimport Typography from '@mui/material/Typography';\nimport type { FilterCondition } from 'model/filter';\n\nimport FilterRow from './FilterRow';\nimport type { FiltersListProps } from './props';\n\nconst FiltersList = ({\n filterableFields,\n conditions,\n onUpdateCondition,\n onRemoveCondition,\n entityFilterConfig,\n}: FiltersListProps) => {\n const handleUpdateCondition = useCallback(\n (updated: FilterCondition) => {\n onUpdateCondition(updated.id, updated);\n },\n [onUpdateCondition],\n );\n\n const handleRemoveCondition = useCallback(\n (id: string) => () => {\n onRemoveCondition(id);\n },\n [onRemoveCondition],\n );\n\n const usedFieldNames = useMemo(\n () =>\n conditions.map(c => c.fieldName).filter((name): name is string => !!name),\n [conditions],\n );\n\n const getAvailableFields = useCallback(\n (currentFieldName: string | undefined) =>\n filterableFields.filter(\n field =>\n !usedFieldNames.includes(field.name) ||\n field.name === currentFieldName,\n ),\n [filterableFields, usedFieldNames],\n );\n\n if (filterableFields.length === 0) {\n return (\n <Typography variant=\"body2\" color=\"text.secondary\" textAlign=\"center\">\n Nenhum filtro disponível\n </Typography>\n );\n }\n\n if (conditions.length === 0) {\n return (\n <Typography variant=\"body2\" color=\"text.secondary\" textAlign=\"center\">\n Clique em{' '}\n <Typography\n component=\"strong\"\n variant=\"body2\"\n fontWeight={600}\n color=\"text.primary\"\n >\n &quot;+&quot;\n </Typography>{' '}\n para adicionar um filtro\n </Typography>\n );\n }\n\n return (\n <>\n {conditions.map((condition, index) => (\n <FilterRow\n key={condition.id}\n condition={condition}\n fields={getAvailableFields(condition.fieldName)}\n onChange={handleUpdateCondition}\n onRemove={handleRemoveCondition(condition.id)}\n showOperator={index > 0}\n totalConditions={conditions.length}\n isFirst={index === 0}\n entityFilterConfig={entityFilterConfig}\n />\n ))}\n </>\n );\n};\n\nexport default memo(FiltersList, isEqual);\n","import { memo, useCallback, useMemo } from 'react';\nimport isEqual from 'react-fast-compare';\nimport FormControl from '@mui/material/FormControl';\nimport IconButton from '@mui/material/IconButton';\nimport InputLabel from '@mui/material/InputLabel';\nimport MenuItem from '@mui/material/MenuItem';\nimport Select from '@mui/material/Select';\nimport Stack from '@mui/material/Stack';\nimport TextField from '@mui/material/TextField';\nimport { Condition } from 'model/entity-metadata';\nimport { FilterOperator } from 'model/filter';\n\nimport Icon from 'components/Icon';\n\nimport { CONDITION_LABELS } from '../../constants/filter';\n\nimport EntityFilter from './EntityFilter';\nimport OperatorSelect from './OperatorSelect';\nimport type { FilterRowProps } from './props';\n\nconst ellipsisStyle = {\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n} as const;\n\nconst FilterRow = ({\n condition,\n fields,\n onChange,\n onRemove,\n totalConditions,\n isFirst,\n entityFilterConfig,\n}: FilterRowProps) => {\n const selectedField = useMemo(\n () =>\n fields.find(f => (f.filter_field_name ?? f.name) === condition.fieldName),\n [fields, condition.fieldName],\n );\n\n const availableConditions = useMemo(\n () => selectedField?.available_filter_conditions || [],\n [selectedField],\n );\n\n const isValueDisabled = useMemo(\n () =>\n !condition.fieldName ||\n condition.conditional === 'IS_NULL' ||\n condition.conditional === 'IS_NOT_NULL',\n [condition.fieldName, condition.conditional],\n );\n\n const handleFieldChange = useCallback(\n (fieldName: string) => {\n const newField = fields.find(\n f => (f.filter_field_name ?? f.name) === fieldName,\n );\n if (!newField) return;\n\n const defaultCondition =\n newField.available_filter_conditions[0] || 'EQUALS';\n\n onChange({\n ...condition,\n fieldName,\n conditional: defaultCondition,\n value: [],\n });\n },\n [fields, condition, onChange],\n );\n\n const handleConditionChange = useCallback(\n (conditional: Condition) => {\n onChange({\n ...condition,\n conditional,\n });\n },\n [condition, onChange],\n );\n\n const handleValueChange = useCallback(\n (value: string) => {\n onChange({\n ...condition,\n value: value ? [value] : [],\n });\n },\n [condition, onChange],\n );\n\n const handleEntityValueChange = useCallback(\n (value: string, label?: string) => {\n const valueLabels = { ...condition.valueLabels };\n if (value && label) {\n valueLabels[value] = label;\n }\n onChange({\n ...condition,\n value: value ? [value] : [],\n valueLabels,\n });\n },\n [condition, onChange],\n );\n\n const handleOperatorChange = useCallback(\n (operator: FilterOperator) => {\n onChange({\n ...condition,\n operator,\n });\n },\n [condition, onChange],\n );\n\n const renderValueInput = () => {\n if (selectedField?.type === 'BOOLEAN') {\n return (\n <FormControl\n size=\"small\"\n sx={{ flex: 1, minWidth: 120 }}\n disabled={isValueDisabled}\n >\n <InputLabel id={`value-label-${condition.id}`}>Valor</InputLabel>\n <Select\n labelId={`value-label-${condition.id}`}\n label=\"Valor\"\n value={condition.value[0] || ''}\n onChange={e => handleValueChange(e.target.value)}\n size=\"small\"\n sx={{\n '& .MuiSelect-select': ellipsisStyle,\n }}\n >\n <MenuItem value=\"true\">Verdadeiro</MenuItem>\n <MenuItem value=\"false\">Falso</MenuItem>\n </Select>\n </FormControl>\n );\n }\n\n if (\n selectedField?.type === 'ENTITY' &&\n selectedField.metadata &&\n entityFilterConfig?.[selectedField.metadata.name]\n ) {\n const currentValue = condition.value[0] || '';\n return (\n <EntityFilter\n config={entityFilterConfig[selectedField.metadata.name]}\n metadata={selectedField.metadata}\n value={currentValue}\n initialLabel={condition.valueLabels?.[currentValue]}\n onChange={handleEntityValueChange}\n disabled={isValueDisabled}\n />\n );\n }\n\n return (\n <TextField\n label=\"Filtro\"\n value={condition.value[0] || ''}\n onChange={e => handleValueChange(e.target.value)}\n size=\"small\"\n disabled={isValueDisabled}\n InputLabelProps={{ shrink: true }}\n sx={{ flex: 1, minWidth: 120 }}\n />\n );\n };\n\n return (\n <Stack direction=\"row\" spacing={1} alignItems=\"center\">\n <IconButton\n onClick={onRemove}\n size=\"small\"\n aria-label=\"Remover filtro\"\n sx={{ flexShrink: 0 }}\n >\n <Icon icon=\"CLOSE_MARK_BUTTON\" width={18} />\n </IconButton>\n\n <OperatorSelect\n value={condition.operator}\n onChange={handleOperatorChange}\n totalConditions={totalConditions}\n isFirst={isFirst}\n />\n\n <FormControl size=\"small\" sx={{ minWidth: 150, flex: 1 }}>\n <InputLabel id={`field-label-${condition.id}`}>Coluna</InputLabel>\n <Select\n labelId={`field-label-${condition.id}`}\n label=\"Coluna\"\n value={condition.fieldName}\n onChange={e => handleFieldChange(e.target.value)}\n size=\"small\"\n sx={{\n '& .MuiSelect-select': ellipsisStyle,\n }}\n >\n {fields.map(field => (\n <MenuItem\n key={field.name}\n value={field.filter_field_name ?? field.name}\n sx={ellipsisStyle}\n title={field.description || field.name}\n >\n {field.description || field.name}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n\n <FormControl\n size=\"small\"\n sx={{ minWidth: 90 }}\n disabled={!condition.fieldName}\n >\n <InputLabel id={`condition-label-${condition.id}`}>Condição</InputLabel>\n <Select\n labelId={`condition-label-${condition.id}`}\n label=\"Condição\"\n value={condition.conditional}\n onChange={e => handleConditionChange(e.target.value as Condition)}\n size=\"small\"\n sx={{\n '& .MuiSelect-select': ellipsisStyle,\n }}\n >\n {availableConditions.map(cond => (\n <MenuItem key={cond} value={cond} sx={ellipsisStyle}>\n {CONDITION_LABELS[cond as Condition] || cond}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n\n {renderValueInput()}\n </Stack>\n );\n};\n\nexport default memo(FilterRow, isEqual);\n","import { Condition } from 'model/entity-metadata';\n\nexport const CONDITION_LABELS: Record<Condition, string> = {\n [Condition.EQUALS]: 'Igual a',\n [Condition.NOT_EQUALS]: 'Diferente de',\n [Condition.LIKE]: 'Contém',\n [Condition.NOT_LIKE]: 'Não contém',\n [Condition.GREATER_THAN]: 'Maior que',\n [Condition.LESS_THAN]: 'Menor que',\n [Condition.GREATER_THAN_OR_EQUAL]: 'Maior ou igual a',\n [Condition.LESS_THAN_OR_EQUAL]: 'Menor ou igual a',\n [Condition.IN]: 'Em',\n [Condition.NOT_IN]: 'Não em',\n [Condition.IS_NULL]: 'É nulo',\n [Condition.IS_NOT_NULL]: 'Não é nulo',\n};\n","import { memo, useCallback, useMemo } from 'react';\nimport CircularProgress from '@mui/material/CircularProgress';\nimport FormControl from '@mui/material/FormControl';\nimport InputLabel from '@mui/material/InputLabel';\nimport MenuItem from '@mui/material/MenuItem';\nimport Select from '@mui/material/Select';\n\nimport useToggle from 'hooks/useToggle';\n\nimport type { EntityFilterOption, EntityFilterProps } from './props';\n\nconst ellipsisStyle = {\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n} as const;\n\nconst EntityFilter = ({\n config,\n metadata,\n value,\n initialLabel,\n onChange,\n disabled = false,\n}: EntityFilterProps) => {\n const [open, , setOpen] = useToggle(false);\n\n const { data, isLoading, isFetching } = config.useQuery(\n {\n page: 0,\n perPage: 25,\n ...config.queryParams,\n },\n { skip: !open && !value },\n );\n\n const loading = isLoading || isFetching;\n\n const selectedOption = useMemo<EntityFilterOption | null>(() => {\n if (!value) return null;\n return { value, label: initialLabel ?? value };\n }, [value, initialLabel]);\n\n const options: EntityFilterOption[] = useMemo(() => {\n const items = (data?.items ?? [])\n .map(item => ({\n label: String(item[metadata.description_field_name] ?? ''),\n value: String(item[metadata.id_field_name] ?? ''),\n }))\n .filter(opt => opt.value && opt.label);\n\n if (\n selectedOption &&\n !items.some(opt => opt.value === selectedOption.value)\n ) {\n items.unshift(selectedOption);\n }\n\n return items;\n }, [\n data,\n metadata.id_field_name,\n metadata.description_field_name,\n selectedOption,\n ]);\n\n const handleChange = useCallback(\n (newValue: string) => {\n if (!newValue) {\n onChange('', undefined);\n return;\n }\n const option = options.find(opt => opt.value === newValue);\n onChange(newValue, option?.label);\n },\n [onChange, options],\n );\n\n const labelId = `entity-filter-label-${metadata.name}`;\n\n return (\n <FormControl\n size=\"small\"\n sx={{ flex: 1, minWidth: 120 }}\n disabled={disabled}\n >\n <InputLabel id={labelId} shrink>\n Filtro\n </InputLabel>\n <Select\n labelId={labelId}\n label=\"Filtro\"\n value={selectedOption?.value ?? ''}\n onChange={e => handleChange(e.target.value)}\n onOpen={() => setOpen(true)}\n onClose={() => setOpen(false)}\n size=\"small\"\n displayEmpty\n notched\n renderValue={selected => {\n if (!selected) return '';\n const option = options.find(opt => opt.value === selected);\n return option?.label ?? selectedOption?.label ?? String(selected);\n }}\n sx={{\n '& .MuiSelect-select': ellipsisStyle,\n }}\n >\n {loading && (\n <MenuItem disabled value=\"\">\n <CircularProgress size={18} sx={{ mr: 1 }} />\n Carregando...\n </MenuItem>\n )}\n {!loading && options.length === 0 && (\n <MenuItem disabled value=\"\">\n Nenhum resultado\n </MenuItem>\n )}\n {!loading &&\n options.map(opt => (\n <MenuItem\n key={opt.value}\n value={opt.value}\n sx={ellipsisStyle}\n title={opt.label}\n >\n {opt.label}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n );\n};\n\nexport default memo(EntityFilter);\n","import { memo } from 'react';\nimport isEqual from 'react-fast-compare';\nimport MenuItem from '@mui/material/MenuItem';\nimport Select from '@mui/material/Select';\nimport Stack from '@mui/material/Stack';\nimport { FilterOperator } from 'model/filter';\n\nimport type { OperatorSelectProps } from './props';\n\nconst OperatorSelect = ({\n value,\n onChange,\n totalConditions,\n isFirst,\n}: OperatorSelectProps) => {\n if (totalConditions === 1) {\n return null;\n }\n\n if (isFirst) {\n return <Stack sx={{ width: 55, flexShrink: 0 }} />;\n }\n\n return (\n <Select\n value={value}\n onChange={e => onChange(e.target.value as FilterOperator)}\n size=\"small\"\n sx={{ width: 55, flexShrink: 0 }}\n >\n <MenuItem value={FilterOperator.AND}>e</MenuItem>\n <MenuItem value={FilterOperator.OR}>ou</MenuItem>\n </Select>\n );\n};\n\nexport default memo(OperatorSelect, isEqual);\n","import Box from '@mui/material/Box';\nimport { styled } from '@mui/material/styles';\n\n// Estilos baseados no Drawer/Popover para garantir consistência\nexport const Container = styled(Box)({\n display: 'flex',\n flexDirection: 'column',\n height: '100%',\n // No popover, a altura será controlada pelo max-height do container\n});\n\nexport const Header = styled(Box)(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: theme.spacing(2, 3),\n}));\n\nexport const Content = styled(Box)(({ theme }) => ({\n flex: 1,\n overflowY: 'auto',\n padding: theme.spacing(3),\n display: 'flex',\n flexDirection: 'column',\n gap: theme.spacing(2),\n}));\n\nexport const Footer = styled(Box)(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: theme.spacing(2),\n}));\n","import { memo, useCallback, useEffect, useMemo, useState } from 'react';\nimport Button from '@mui/material/Button';\nimport FormControl from '@mui/material/FormControl';\nimport InputLabel from '@mui/material/InputLabel';\nimport MenuItem from '@mui/material/MenuItem';\nimport Select from '@mui/material/Select';\nimport Stack from '@mui/material/Stack';\nimport Typography from '@mui/material/Typography';\nimport { SortType } from 'model/filter';\n\nimport Icon from 'components/Icon';\n\nimport { SortModalProps } from './props';\nimport {\n ApplyButton,\n LabelButton,\n StyledDialog,\n StyledDialogActions,\n StyledDialogContent,\n StyledDialogTitle,\n} from './style';\n\nconst SortModal = ({\n open,\n onClose,\n fields,\n sort,\n onSortChange,\n}: SortModalProps) => {\n const [selectedField, setSelectedField] = useState<string>(\n sort?.fieldName || '',\n );\n const [selectedDirection, setSelectedDirection] = useState<SortType>(\n sort?.sortType || SortType.ASC,\n );\n\n const sortableFields = useMemo(\n () =>\n fields.filter(\n field => field.name !== 'ACTIONS' && field.access_type !== 'WRITE_ONLY',\n ),\n [fields],\n );\n\n const selectedFieldObj = useMemo(\n () =>\n fields.find(\n field => (field.filter_field_name ?? field.name) === selectedField,\n ),\n [fields, selectedField],\n );\n\n const isNumberField =\n selectedFieldObj?.type === 'DECIMAL' ||\n selectedFieldObj?.type === 'INTEGER';\n\n useEffect(() => {\n if (open) {\n setSelectedField(sort?.fieldName || '');\n setSelectedDirection(sort?.sortType || SortType.ASC);\n }\n }, [open, sort]);\n\n const handleApply = useCallback(() => {\n if (onSortChange) {\n if (!selectedField) {\n onSortChange(undefined);\n } else {\n onSortChange({\n fieldName: selectedField,\n sortType: selectedDirection,\n });\n }\n }\n onClose();\n }, [onSortChange, selectedField, selectedDirection, onClose]);\n\n const handleClear = useCallback(() => {\n if (!onSortChange) return;\n\n setSelectedField('');\n setSelectedDirection(SortType.ASC);\n\n onSortChange(undefined);\n onClose();\n }, [onSortChange, onClose]);\n\n return (\n <StyledDialog open={open} onClose={onClose} maxWidth=\"xs\" fullWidth>\n <StyledDialogTitle>\n <Typography variant=\"overline\" color=\"text.secondary\">\n Ordenar por\n </Typography>\n </StyledDialogTitle>\n <StyledDialogContent>\n <Stack spacing={2} pt={2}>\n <FormControl fullWidth size=\"small\">\n <InputLabel id=\"sort-field-label\">Campo</InputLabel>\n <Select\n labelId=\"sort-field-label\"\n value={selectedField}\n label=\"Campo\"\n onChange={e => setSelectedField(e.target.value)}\n >\n <MenuItem value=\"\">\n <em>Nenhum</em>\n </MenuItem>\n {sortableFields.map(field => (\n <MenuItem\n key={field.name}\n value={field.filter_field_name ?? field.name}\n >\n {field.description || field.name}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n <FormControl fullWidth size=\"small\" disabled={!selectedField}>\n <InputLabel id=\"sort-direction-label\">Direção</InputLabel>\n <Select\n labelId=\"sort-direction-label\"\n value={selectedDirection}\n label=\"Direção\"\n onChange={e => setSelectedDirection(e.target.value as SortType)}\n >\n <MenuItem value={SortType.ASC}>\n Crescente {isNumberField ? '(1-9)' : '(A-Z)'}\n </MenuItem>\n <MenuItem value={SortType.DESC}>\n Decrescente {isNumberField ? '(9-1)' : '(Z-A)'}\n </MenuItem>\n </Select>\n </FormControl>\n </Stack>\n </StyledDialogContent>\n <StyledDialogActions>\n <Stack flex={1} width=\"100%\" direction=\"row\">\n <Button color=\"inherit\" onClick={handleClear}>\n Limpar\n </Button>\n </Stack>\n <Button\n onClick={onClose}\n variant=\"outlined\"\n color=\"inherit\"\n sx={{ minWidth: 24 }}\n >\n <Icon icon=\"CANCEL_CIRCLE\" />\n <LabelButton>Cancelar</LabelButton>\n </Button>\n <ApplyButton onClick={handleApply} variant=\"contained\">\n <Icon icon=\"SIMPLE_CHECK\" />\n <LabelButton>Aplicar</LabelButton>\n </ApplyButton>\n </StyledDialogActions>\n </StyledDialog>\n );\n};\n\nSortModal.displayName = 'SortModal';\n\nexport default memo(SortModal);\n","import Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogTitle from '@mui/material/DialogTitle';\nimport { styled } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\n\nexport const StyledDialog = styled(Dialog)(() => ({\n '& .MuiDialog-paper': { width: '100%' },\n}));\n\nexport const StyledDialogTitle = styled(DialogTitle)(({ theme }) => ({\n borderBottom: '1px solid',\n borderColor: theme.palette.divider,\n padding: theme.spacing(1.5, 2),\n}));\n\nexport const StyledDialogContent = styled(DialogContent)(({ theme }) => ({\n padding: theme.spacing(2),\n}));\n\nexport const StyledDialogActions = styled(DialogActions)(({ theme }) => ({\n borderTop: '1px solid',\n borderColor: theme.palette.divider,\n padding: theme.spacing(1.5, 2),\n}));\n\nexport const ApplyButton = styled(Button)(({ theme }) => ({\n minWidth: 24,\n [theme.breakpoints.down(330)]: {\n padding: theme.spacing(1),\n },\n}));\n\nexport const LabelButton = styled(Typography)(({ theme }) => ({\n fontWeight: '600',\n margin: theme.spacing(0, 1),\n [theme.breakpoints.down(330)]: {\n fontSize: 0,\n margin: 0,\n },\n}));\n","import { useMemo } from 'react';\nimport type { GridColDef } from '@mui/x-data-grid-premium';\n\nimport { UseColumnOrderingParams } from '../props';\n\nexport const useColumnOrdering = ({\n columns,\n fields,\n preferredFieldOrder,\n}: UseColumnOrderingParams) => {\n const columnsByFieldId = useMemo(\n () => new Map(columns.map(column => [column.field, column])),\n [columns],\n );\n\n const fieldsByName = useMemo(\n () => new Map(fields?.map(f => [f.name, f]) || []),\n [fields],\n );\n\n const orderedColumns = useMemo(() => {\n if (!preferredFieldOrder || preferredFieldOrder.length === 0 || !fields) {\n return columns;\n }\n\n const actionFieldName = 'ACTIONS';\n const preferredWithoutActions = preferredFieldOrder.filter(\n fieldName => fieldName !== actionFieldName,\n );\n\n const usedColumnFieldIds = new Set<string>();\n const ordered: GridColDef[] = [];\n\n const pushColumnForField = (fieldName: string) => {\n const field = fieldsByName.get(fieldName);\n if (!field) return;\n\n const column = columnsByFieldId.get(field.name);\n\n if (!column || usedColumnFieldIds.has(field.name)) return;\n\n ordered.push(column);\n usedColumnFieldIds.add(field.name);\n };\n\n preferredWithoutActions.forEach(fieldName => {\n pushColumnForField(fieldName);\n });\n\n fields.forEach(field => {\n if (field.name === actionFieldName) return;\n if (preferredWithoutActions.includes(field.name)) return;\n\n const column = columnsByFieldId.get(field.name);\n\n if (!column || usedColumnFieldIds.has(field.name)) return;\n\n ordered.push(column);\n usedColumnFieldIds.add(field.name);\n });\n\n pushColumnForField(actionFieldName);\n\n return ordered.length === 0 ? columns : ordered;\n }, [columns, columnsByFieldId, fieldsByName, preferredFieldOrder, fields]);\n\n return { orderedColumns, columnsByFieldId, fieldsByName };\n};\n","import { useCallback, useMemo } from 'react';\nimport type { GridColumnVisibilityModel } from '@mui/x-data-grid-premium';\nimport { Field } from 'model/entity-metadata';\n\nimport useLocalStorage from 'hooks/useLocalStorage';\n\nimport { UseColumnVisibilityParams } from '../props';\n\nfunction getColumnFieldIdFromField(field: Field): string {\n return field.name;\n}\n\nexport const useColumnVisibility = ({\n fields,\n columnsByFieldId,\n defaultVisibleFieldNames,\n columnVisibilityStorageKey,\n onColumnVisibilityModelChange,\n}: UseColumnVisibilityParams) => {\n const hasStorageKey = Boolean(columnVisibilityStorageKey);\n\n const [storedVisibilityModel, setStoredVisibilityModel] = useLocalStorage<\n GridColumnVisibilityModel | undefined\n >(columnVisibilityStorageKey || '__dynamic-data-view:columns__', undefined, {\n initializeWithValue: hasStorageKey,\n });\n\n const initialState = useMemo(() => {\n if (!fields) return undefined;\n\n const visibilityModel: GridColumnVisibilityModel = {};\n\n fields.forEach(field => {\n const columnFieldId = getColumnFieldIdFromField(field);\n if (!columnsByFieldId.has(columnFieldId)) return;\n\n let visible: boolean | undefined;\n\n if (hasStorageKey && storedVisibilityModel) {\n const stored = storedVisibilityModel[columnFieldId];\n if (typeof stored === 'boolean') {\n visible = stored;\n }\n }\n\n if (\n visible === undefined &&\n defaultVisibleFieldNames &&\n defaultVisibleFieldNames.length > 0\n ) {\n visible = defaultVisibleFieldNames.includes(field.name);\n }\n\n if (typeof visible === 'boolean') {\n visibilityModel[columnFieldId] = visible;\n }\n });\n\n if (Object.keys(visibilityModel).length === 0) return undefined;\n\n return {\n columns: {\n columnVisibilityModel: visibilityModel,\n },\n };\n }, [\n columnsByFieldId,\n defaultVisibleFieldNames,\n fields,\n hasStorageKey,\n storedVisibilityModel,\n ]);\n\n const handleColumnVisibilityModelChange = useCallback(\n (model: GridColumnVisibilityModel) => {\n if (hasStorageKey) {\n const modelToSave = { ...model };\n // Prevents __check__ (checkboxSelection column) from being permanently hidden in local storage\n delete modelToSave['__check__'];\n setStoredVisibilityModel(modelToSave);\n }\n\n if (onColumnVisibilityModelChange) {\n onColumnVisibilityModelChange(model);\n }\n },\n [hasStorageKey, onColumnVisibilityModelChange, setStoredVisibilityModel],\n );\n\n return {\n initialState,\n handleColumnVisibilityModelChange,\n };\n};\n","import { useMemo } from 'react';\nimport { GridColDef } from '@mui/x-data-grid-premium';\n\nimport { Columns } from 'types/datagrid';\n\nimport { ACCESS_TYPES } from '../constants/columnDefaults';\nimport { UseDynamicColumnsProps } from '../props';\nimport { getColumnStrategy } from '../utils/columnStrategies';\n\nexport const useDynamicColumns = <T extends object>({\n metadata,\n renderCell,\n columnStrategies,\n}: UseDynamicColumnsProps<T>): Columns => {\n return useMemo(() => {\n if (!metadata?.fields) return [];\n\n const columnsMap = new Map<string, GridColDef>();\n\n const visibleFields = metadata.fields.filter(field => {\n if (\n field.access_type === ACCESS_TYPES.READ_ONLY ||\n field.access_type === ACCESS_TYPES.READ_AND_WRITE\n ) {\n return true;\n }\n\n return (\n field.name === 'ACTIONS' ||\n field.name === metadata?.id_field_name ||\n field.name === 'NAME'\n );\n });\n\n visibleFields.forEach(field => {\n if (columnsMap.has(field.name)) {\n return;\n }\n\n const strategy =\n columnStrategies?.[field.name] ?? getColumnStrategy<T>(field, metadata);\n const column = strategy(field, renderCell, metadata);\n\n columnsMap.set(field.name, column);\n });\n\n return Array.from(columnsMap.values());\n }, [columnStrategies, metadata, renderCell]);\n};\n","export const COLUMN_DEFAULTS = {\n IMAGE_WIDTH: 90,\n MIN_WIDTH: 130,\n ENTITY_MIN_WIDTH: 100,\n ENTITY_FLEX: 0.5,\n ID_MIN_WIDTH: 200,\n ID_FLEX: 1,\n ACTIONS_WIDTH: 80,\n} as const;\n\nexport const ACCESS_TYPES = {\n READ_ONLY: 'READ_ONLY',\n READ_AND_WRITE: 'READ_AND_WRITE',\n} as const;\n\nexport const CURRENCY_FIELD_NAMES: readonly string[] = [\n 'price',\n 'base_price',\n 'minimum_value',\n 'maximum_value',\n 'minimum_installment_value',\n];\n","import { GridColDef, GridRenderCellParams } from '@mui/x-data-grid-premium';\nimport { Field } from 'model/entity-metadata';\n\nimport { COLUMN_DEFAULTS } from '../constants/columnDefaults';\nimport { CellRenderer, ColumnStrategy, DynamicRowData } from '../props';\n\nconst createImageColumn = <T extends object>(\n field: Field,\n renderCell: CellRenderer<T>,\n): GridColDef => ({\n field: field.name,\n headerName: field.description,\n sortable: false,\n width: COLUMN_DEFAULTS.IMAGE_WIDTH,\n resizable: false,\n headerAlign: 'center',\n align: 'center',\n renderCell: (params: GridRenderCellParams) =>\n renderCell(field, params.row as DynamicRowData<T>),\n});\n\nconst createIdColumn = <T extends object>(\n field: Field,\n renderCell: CellRenderer<T>,\n): GridColDef => ({\n field: field.name,\n headerName: field.description,\n minWidth: COLUMN_DEFAULTS.ID_MIN_WIDTH,\n flex: COLUMN_DEFAULTS.ID_FLEX,\n renderCell: (params: GridRenderCellParams) =>\n renderCell(field, params.row as DynamicRowData<T>),\n});\n\nconst createEntityColumn = <T extends object>(\n field: Field,\n renderCell: CellRenderer<T>,\n): GridColDef => ({\n field: field.name,\n headerName: field.description,\n minWidth: COLUMN_DEFAULTS.ENTITY_MIN_WIDTH,\n flex: COLUMN_DEFAULTS.ENTITY_FLEX,\n renderCell: (params: GridRenderCellParams) =>\n renderCell(field, params.row as DynamicRowData<T>),\n});\n\nconst createDefaultColumn = <T extends object>(\n field: Field,\n renderCell: CellRenderer<T>,\n): GridColDef => ({\n field: field.name,\n headerName: field.description,\n minWidth: COLUMN_DEFAULTS.MIN_WIDTH,\n renderCell: (params: GridRenderCellParams) =>\n renderCell(field, params.row as DynamicRowData<T>),\n});\n\nconst createActionsColumn = <T extends object>(\n field: Field,\n renderCell: CellRenderer<T>,\n): GridColDef => ({\n field: field.name,\n headerName: 'Ações',\n width: COLUMN_DEFAULTS.ACTIONS_WIDTH,\n sortable: false,\n resizable: false,\n disableReorder: true,\n headerAlign: 'center',\n disableColumnMenu: true,\n align: 'center',\n renderCell: (params: GridRenderCellParams) =>\n renderCell(field, params.row as DynamicRowData<T>),\n});\n\nexport const getColumnStrategy = <T extends object>(\n field: Field,\n metadata?: { id_field_name?: string },\n): ColumnStrategy<T> => {\n if (field.name === metadata?.id_field_name || field.name === 'name') {\n return createIdColumn;\n }\n\n if (field.name === 'ACTIONS') {\n return createActionsColumn;\n }\n\n if (field.type === 'FILE') {\n return createImageColumn;\n }\n\n if (field.type === 'ENTITY') {\n return createEntityColumn;\n }\n\n return createDefaultColumn;\n};\n","import { useCallback, useRef, useState } from 'react';\nimport {\n type Filter,\n type FilterCondition,\n FilterOperator,\n} from 'model/filter';\n\nimport uuidv4 from 'utils/uuidv4';\n\nimport { UseFiltersProps, UseFiltersReturn } from '../props';\nimport {\n buildFilterFromConditions,\n getDefaultCondition,\n isValidCondition,\n} from '../utils/filter';\n\n// Converte filtro inicial em condições\nconst parseInitialConditions = (initialFilter?: Filter): FilterCondition[] => {\n if (!initialFilter?.groups?.[0]?.conditionals) return [];\n return initialFilter.groups[0].conditionals.map(cond => ({\n id: uuidv4(),\n operator: initialFilter.groups[0].operator,\n fieldName: cond.fieldName,\n conditional: cond.conditional,\n value: cond.value,\n }));\n};\n\n/**\n * Hook para gerenciar estado de filtros do DynamicDataView com condições dinâmicas\n *\n * - conditions: estado de edição (o que o usuário vê no popover)\n * - appliedConditions: estado aplicado (o que está efetivamente filtrando)\n * - hasActiveFilters/activeFiltersCount: calculados com base em appliedConditions\n */\nexport const useFilters = ({\n fields,\n initialFilter,\n}: UseFiltersProps): UseFiltersReturn => {\n const [isOpen, setIsOpen] = useState(false);\n\n // Estado aplicado (efetivamente filtrando)\n const [appliedConditions, setAppliedConditions] = useState<FilterCondition[]>(\n () => parseInitialConditions(initialFilter),\n );\n const [appliedFilter, setAppliedFilter] = useState<Filter | undefined>(\n initialFilter,\n );\n\n // Estado de edição (o que o usuário vê/edita no popover)\n const [conditions, setConditions] = useState<FilterCondition[]>(() =>\n parseInitialConditions(initialFilter),\n );\n\n // Referência para snapshot antes de abrir o popover\n const snapshotRef = useRef<FilterCondition[]>([]);\n\n const openDrawer = useCallback(() => {\n // Salva snapshot das condições atuais (aplicadas) ao abrir\n snapshotRef.current = appliedConditions.map(c => ({ ...c }));\n // Sincroniza edição com aplicado ao abrir\n setConditions(appliedConditions.map(c => ({ ...c })));\n setIsOpen(true);\n }, [appliedConditions]);\n\n const closeDrawer = () => setIsOpen(false);\n\n const addCondition = useCallback(() => {\n const filterableFields = fields.filter(\n f => f.available_filter_conditions?.length > 0,\n );\n if (filterableFields.length === 0) return;\n\n const usedFieldNames = conditions.map(c => c.fieldName);\n const availableFields = filterableFields.filter(\n f => !usedFieldNames.includes(f.filter_field_name ?? f.name),\n );\n if (availableFields.length === 0) return;\n\n const currentOperator =\n conditions.length > 0 ? conditions[0].operator : FilterOperator.AND;\n const firstField = availableFields[0];\n const newCondition: FilterCondition = {\n id: uuidv4(),\n operator: currentOperator,\n fieldName: firstField.filter_field_name ?? firstField.name,\n conditional: getDefaultCondition(firstField),\n value: [],\n };\n\n setConditions(prev => [...prev, newCondition]);\n }, [fields, conditions]);\n\n const updateCondition = useCallback(\n (id: string, changes: Partial<FilterCondition>) => {\n setConditions(prev => {\n const targetCondition = prev.find(c => c.id === id);\n if (!targetCondition) return prev;\n\n if (changes.operator && changes.operator !== targetCondition.operator) {\n const newOperator = changes.operator;\n return prev.map(c => {\n if (c.id === id) {\n return { ...c, ...changes };\n }\n return { ...c, operator: newOperator };\n });\n }\n\n return prev.map(c => (c.id === id ? { ...c, ...changes } : c));\n });\n },\n [],\n );\n\n const removeCondition = useCallback((id: string) => {\n setConditions(prev => prev.filter(c => c.id !== id));\n }, []);\n\n const clearAllFilters = () => {\n setConditions([]);\n setAppliedConditions([]);\n setAppliedFilter(undefined);\n };\n\n const applyFilters = () => {\n const filter = buildFilterFromConditions(conditions);\n setAppliedConditions(conditions.map(c => ({ ...c })));\n setAppliedFilter(filter);\n setIsOpen(false);\n return filter;\n };\n\n const cancelChanges = () => {\n // Reverte para o snapshot salvo ao abrir\n setConditions(snapshotRef.current.map(c => ({ ...c })));\n setIsOpen(false);\n };\n\n // Calculado com base nos filtros APLICADOS (não em edição)\n const hasActiveFilters = appliedConditions.some(isValidCondition);\n const activeFiltersCount = appliedConditions.filter(isValidCondition).length;\n\n return {\n conditions,\n filter: appliedFilter,\n isOpen,\n hasActiveFilters,\n activeFiltersCount,\n openDrawer,\n closeDrawer,\n addCondition,\n updateCondition,\n removeCondition,\n clearAllFilters,\n applyFilters,\n cancelChanges,\n };\n};\n\nexport default useFilters;\n","import { useCallback, useEffect, useState } from 'react';\nimport { Filter, Sort } from 'model/filter';\n\nconst getStoredValue = <T>(key: string): T | undefined => {\n try {\n const item = localStorage.getItem(key);\n return item ? JSON.parse(item) : undefined;\n } catch {\n return undefined;\n }\n};\n\nconst setStoredValue = <T>(key: string, value: T | undefined): void => {\n try {\n if (value === undefined) {\n localStorage.removeItem(key);\n } else {\n localStorage.setItem(key, JSON.stringify(value));\n }\n } catch {\n // Silently ignore localStorage errors\n }\n};\n\nexport const useFilterStorage = (\n storageKey: string,\n externalFilter?: Filter,\n onFilterChange?: (filter: Filter | undefined) => void,\n) => {\n const filterKey = `${storageKey}:filter`;\n\n const [internalFilter, setInternalFilter] = useState<Filter | undefined>(\n () => {\n return getStoredValue<Filter>(filterKey) || externalFilter;\n },\n );\n\n // Sync with external filter\n useEffect(() => {\n if (externalFilter !== undefined) {\n setInternalFilter(externalFilter);\n }\n }, [externalFilter]);\n\n const handleFilterChange = useCallback(\n (newFilter: Filter | undefined) => {\n setInternalFilter(newFilter);\n setStoredValue(filterKey, newFilter);\n onFilterChange?.(newFilter);\n },\n [filterKey, onFilterChange],\n );\n\n return {\n filter: internalFilter,\n setFilter: handleFilterChange,\n };\n};\n\nexport const useSortStorage = (\n storageKey: string,\n externalSort?: Sort,\n onSortChange?: (sort: Sort | undefined) => void,\n) => {\n const sortKey = `${storageKey}:sort`;\n\n const [internalSort, setInternalSort] = useState<Sort | undefined>(() => {\n return getStoredValue<Sort>(sortKey) || externalSort;\n });\n\n // Sync with external sort\n useEffect(() => {\n if (externalSort !== undefined) {\n setInternalSort(externalSort);\n }\n }, [externalSort]);\n\n const handleSortChange = useCallback(\n (newSort: Sort | undefined) => {\n setInternalSort(newSort);\n setStoredValue(sortKey, newSort);\n onSortChange?.(newSort);\n },\n [sortKey, onSortChange],\n );\n\n return {\n sort: internalSort,\n setSort: handleSortChange,\n };\n};\n","import { useCallback, useMemo } from 'react';\nimport type { GridSortModel } from '@mui/x-data-grid-premium';\nimport { Field } from 'model/entity-metadata';\nimport { Sort, SortType } from 'model/filter';\n\nimport { UseSortingParams } from '../props';\n\n/**\n * Mapeia field.name (coluna do DataGrid) → filter_field_name (campo da API).\n * Usado quando o usuário clica no header da coluna para ordenar.\n */\nconst resolveApiFieldName = (\n fields: Field[] | undefined,\n fieldName: string,\n): string => {\n if (!fields) return fieldName;\n const field = fields.find(f => f.name === fieldName);\n return field?.filter_field_name ?? fieldName;\n};\n\n/**\n * Mapeia filter_field_name (campo da API) → field.name (coluna do DataGrid).\n * Usado para o sortModel destacar a coluna correta na UI.\n */\nconst resolveColumnFieldName = (\n fields: Field[] | undefined,\n fieldName: string,\n): string => {\n if (!fields) return fieldName;\n const field = fields.find(\n f => f.filter_field_name === fieldName || f.name === fieldName,\n );\n return field?.name ?? fieldName;\n};\n\nexport const useSorting = ({\n sort,\n onSortChange,\n fields,\n}: UseSortingParams) => {\n const sortModel: GridSortModel = useMemo(() => {\n if (!sort) return [];\n return [\n {\n field: resolveColumnFieldName(fields, sort.fieldName),\n sort: sort.sortType.toLowerCase() as 'asc' | 'desc',\n },\n ];\n }, [sort, fields]);\n\n const handleSortModelChange = useCallback(\n (model: GridSortModel) => {\n if (!onSortChange) return;\n\n const firstItem = model[0];\n if (!firstItem || !firstItem.sort) {\n onSortChange(undefined);\n return;\n }\n\n const newSort: Sort = {\n fieldName: resolveApiFieldName(fields, firstItem.field),\n sortType: firstItem.sort.toUpperCase() as SortType,\n };\n onSortChange(newSort);\n },\n [onSortChange, fields],\n );\n\n return {\n sortModel,\n handleSortModelChange,\n };\n};\n","import {\n AccessType,\n DataType,\n EntityMetadataResponse,\n Field,\n} from 'model/entity-metadata';\n\nexport const createActionsField = (): Field => ({\n name: 'ACTIONS',\n description: '',\n filter_field_name: null,\n type: DataType.TEXT,\n metadata: null,\n access_type: AccessType.READ_ONLY,\n relation_field_name: null,\n available_filter_conditions: [],\n});\n\nexport const addActionsFieldToMetadata = (\n metadata: EntityMetadataResponse,\n): EntityMetadataResponse => {\n const hasActionsField = metadata.fields.some(\n field => field.name === 'ACTIONS',\n );\n\n if (hasActionsField) {\n return metadata;\n }\n\n return {\n ...metadata,\n fields: [...metadata.fields, createActionsField()],\n };\n};\n","import { memo, ReactNode } from 'react';\n\nimport { DatePickerFormat, fDate } from 'utils/formatTime';\n\nimport type { DateRendererProps } from './props';\n\nconst DateRenderer = ({ value, format }: DateRendererProps): ReactNode => {\n if (value === null || value === undefined) return '-';\n\n return fDate(value as DatePickerFormat, format);\n};\n\nexport default memo(DateRenderer);\n","import { memo, ReactNode } from 'react';\n\nimport { DatePickerFormat, fDateTime } from 'utils/formatTime';\n\nimport type { DateTimeRendererProps } from './props';\n\nconst DateTimeRenderer = ({\n value,\n format,\n}: DateTimeRendererProps): ReactNode => {\n if (value === null || value === undefined) return '-';\n\n return fDateTime(value as DatePickerFormat, format);\n};\n\nexport default memo(DateTimeRenderer);\n","import { memo, ReactNode } from 'react';\nimport Chip from '@mui/material/Chip';\n\nimport { EntityRendererProps } from './props';\n\nconst EntityRenderer = ({ value, field }: EntityRendererProps): ReactNode => {\n if (!field.metadata || typeof value !== 'object' || value === null) {\n return value ? String(value) : '-';\n }\n\n const entityValue = (value as Record<string, unknown>)[\n field.metadata.description_field_name\n ];\n\n if (!entityValue) return null;\n\n return (\n <Chip\n label={String(entityValue)}\n variant=\"outlined\"\n size=\"small\"\n sx={{\n width: 'fit-content',\n color: 'text.secondary',\n borderColor: 'divider',\n borderRadius: 3,\n }}\n />\n );\n};\n\nexport default memo(EntityRenderer);\n","import { memo, ReactNode } from 'react';\n\nimport Icon, { IconEnum } from '../../Icon';\n\nimport { IconRendererProps } from './props';\n\nconst IconRenderer = ({\n value,\n trueIcon = IconEnum.STAR_02,\n falseIcon = IconEnum.STAR,\n color = 'primary.main',\n width = 18,\n}: IconRendererProps): ReactNode => {\n return (\n <Icon icon={value ? trueIcon : falseIcon} color={color} width={width} />\n );\n};\n\nexport default memo(IconRenderer);\n","import { memo, ReactNode } from 'react';\n\nimport Icon from 'components/Icon';\n\nimport { ImageRendererProps } from './props';\nimport { ImageContainer } from './style';\n\nconst ImageRenderer = ({\n imageResourceId,\n getImageUrl,\n size = 48,\n alt = 'Imagem',\n onClick,\n sx,\n}: ImageRendererProps): ReactNode => {\n const hasImage = !!imageResourceId;\n const imageUrl =\n hasImage && getImageUrl ? getImageUrl(imageResourceId) : undefined;\n const clickable = !!onClick;\n\n return (\n <ImageContainer\n size={size}\n noImage={!hasImage}\n clickable={clickable}\n onClick={onClick}\n sx={sx}\n >\n {imageUrl ? (\n <img src={imageUrl} alt={alt} />\n ) : (\n <Icon\n icon=\"SEARCH_IMAGE\"\n width={Math.round(size / 2)}\n color=\"text.disabled\"\n />\n )}\n </ImageContainer>\n );\n};\n\nexport default memo(ImageRenderer);\n","import Box from '@mui/material/Box';\nimport { styled } from '@mui/material/styles';\n\n// StatusRenderer styles\nexport interface StatusLabelProps {\n isActive: boolean;\n}\n\nexport const StatusLabel = styled('span')<StatusLabelProps>(\n ({ theme, isActive }) => ({\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n padding: theme.spacing(0.2, 1),\n borderRadius: theme.shape.borderRadius,\n fontSize: '0.75rem',\n fontWeight: 600,\n width: 'fit-content',\n height: 'auto',\n lineHeight: '1.25rem',\n whiteSpace: 'nowrap',\n margin: 'auto',\n backgroundColor: isActive\n ? theme.palette.success.lighter || '#00A76F29'\n : theme.palette.warning.lighter || '#FF563029',\n color: isActive\n ? theme.palette.success.darker || '#007867'\n : theme.palette.warning.darker || '#B71D18',\n }),\n);\n\n// ImageRenderer styles\nexport interface ImageContainerProps {\n size: number;\n noImage: boolean;\n clickable: boolean;\n}\n\nexport const ImageContainer = styled(Box, {\n shouldForwardProp: prop =>\n !['size', 'noImage', 'clickable'].includes(prop as string),\n})<ImageContainerProps>(({ theme, size, noImage, clickable }) => ({\n width: size,\n height: size,\n minWidth: size,\n borderRadius: '50%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n overflow: 'hidden',\n cursor: clickable ? 'pointer' : 'default',\n transition: 'opacity 0.2s ease-in-out',\n color: theme.palette.text.disabled,\n ...(noImage && {\n border: `1px dashed ${theme.palette.divider}`,\n backgroundColor: theme.palette.grey[100],\n }),\n ...(clickable && {\n '&:hover': {\n opacity: 0.8,\n },\n }),\n '& img': {\n width: '100%',\n height: '100%',\n objectFit: 'cover',\n borderRadius: '50%',\n },\n [theme.breakpoints.down('sm')]: {\n justifyContent: 'flex-start',\n alignItems: 'flex-start',\n },\n}));\n","import { memo, ReactNode } from 'react';\nimport Stack from '@mui/material/Stack';\nimport Typography from '@mui/material/Typography';\n\nimport CopyButton from 'components/CopyButton';\n\nimport { NameRendererProps } from './props';\n\nconst NameRenderer = ({\n id,\n displayName,\n copyMessage = 'ID copiado!',\n}: NameRendererProps): ReactNode => {\n return (\n <Stack height={1} justifyContent=\"center\">\n <Typography variant=\"subtitle2\" noWrap title={displayName}>\n {displayName}\n </Typography>\n <Stack direction=\"row\" gap={1} alignItems=\"center\">\n <Typography color=\"grey.600\" variant=\"body2\" noWrap>\n ID: {id}\n </Typography>\n <CopyButton toCopy={id} message={copyMessage} />\n </Stack>\n </Stack>\n );\n};\n\nexport default memo(NameRenderer);\n","import { memo, ReactNode } from 'react';\nimport Stack from '@mui/material/Stack';\nimport Typography from '@mui/material/Typography';\n\nimport { fCurrencyBRL, fNumber } from 'utils/formatNumber';\n\nimport { NumberRendererProps } from './props';\n\nconst NumberRenderer = ({\n value,\n isCurrency = false,\n}: NumberRendererProps): ReactNode => {\n if (value === null || value === undefined) return '-';\n\n return (\n <Stack direction=\"row\" alignItems=\"center\" height=\"100%\">\n <Typography variant=\"body2\" noWrap width=\"fit-content\">\n {isCurrency ? fCurrencyBRL(Number(value)) : fNumber(Number(value))}\n </Typography>\n </Stack>\n );\n};\n\nexport default memo(NumberRenderer);\n","import { memo, ReactNode } from 'react';\n\nimport { StatusRendererProps } from './props';\nimport { StatusLabel } from './style';\n\nconst StatusRenderer = ({\n active,\n activeLabel = 'Ativo',\n inactiveLabel = 'Inativo',\n}: StatusRendererProps): ReactNode => {\n return (\n <StatusLabel isActive={active}>\n {active ? activeLabel : inactiveLabel}\n </StatusLabel>\n );\n};\n\nexport default memo(StatusRenderer);\n","import { memo, ReactNode } from 'react';\nimport Stack from '@mui/material/Stack';\nimport Typography from '@mui/material/Typography';\n\nimport CopyButton from 'components/CopyButton';\n\nimport { TextRendererProps } from './props';\n\nconst sanitizeHtml = (text: string): string => {\n const withoutTags = text.replace(/<[^>]*>/g, '');\n return (\n withoutTags\n .replace(/&nbsp;/g, ' ')\n .replace(/&amp;/g, '&')\n .replace(/&lt;/g, '<')\n .replace(/&gt;/g, '>')\n .replace(/&quot;/g, '\"')\n // prettier-ignore\n .replace(/&#39;/g, '\\'')\n .trim()\n );\n};\n\nconst TextRenderer = ({\n value,\n showCopyButton = false,\n copyMessage = 'Copiado',\n copyLabel,\n mask,\n}: TextRendererProps): ReactNode => {\n if (!value) return '-';\n\n const stringValue = String(value);\n const formattedValue = mask ? mask(stringValue) : sanitizeHtml(stringValue);\n\n if (showCopyButton) {\n return (\n <Stack direction=\"row\" gap={1} alignItems=\"center\">\n <Typography variant=\"body2\" noWrap>\n {formattedValue}\n </Typography>\n <CopyButton\n toCopy={stringValue}\n message={copyMessage}\n label={copyLabel}\n />\n </Stack>\n );\n }\n\n return formattedValue;\n};\n\nexport default memo(TextRenderer);\n","import { ReactNode } from 'react';\nimport { Field } from 'model/entity-metadata';\n\nimport { CURRENCY_FIELD_NAMES } from '../constants/columnDefaults';\nimport { CellRenderer, DynamicRowData } from '../props';\nimport {\n DateRenderer,\n DateTimeRenderer,\n EntityRenderer,\n NumberRenderer,\n StatusRenderer,\n TextRenderer,\n} from '../renderers';\n\nfunction getIsCurrency(fieldName: string): boolean {\n return CURRENCY_FIELD_NAMES.includes(fieldName);\n}\n\nexport const createCellRenderer = <T extends object = object>(context: {\n onRowAction?: (rowId: string, row: DynamicRowData<T>) => ReactNode;\n}): CellRenderer<T> => {\n const { onRowAction } = context;\n\n const CellRendererComponent = (\n field: Field,\n row: DynamicRowData<T>,\n ): ReactNode => {\n const value = row[field.name];\n\n if (field.name === 'ACTIONS') {\n return onRowAction?.(row.id, row);\n }\n\n switch (field.type) {\n case 'BOOLEAN':\n return (\n <StatusRenderer\n active={Boolean(value)}\n activeLabel=\"Ativo\"\n inactiveLabel=\"Inativo\"\n />\n );\n\n case 'DATE':\n return <DateRenderer value={value} />;\n\n case 'DATETIME':\n return <DateTimeRenderer value={value} />;\n\n case 'DECIMAL':\n case 'INTEGER':\n return (\n <NumberRenderer\n value={value}\n isCurrency={getIsCurrency(field.name)}\n />\n );\n\n case 'FILE':\n case 'ENTITY':\n return <EntityRenderer value={value} field={field} />;\n case 'TEXT':\n default:\n return <TextRenderer value={value} />;\n }\n };\n\n CellRendererComponent.displayName = 'CellRendererComponent';\n return CellRendererComponent;\n};\n","import { GridColumnVisibilityModel } from '@mui/x-data-grid-premium';\nimport { EntityMetadataResponse } from 'model/entity-metadata';\n\ninterface BuildVisibleFieldsParams {\n metadata?: EntityMetadataResponse;\n columnVisibilityModel?: GridColumnVisibilityModel;\n defaultVisibleFields?: string[];\n}\n\nexport const buildVisibleFields = ({\n metadata,\n columnVisibilityModel,\n defaultVisibleFields,\n}: BuildVisibleFieldsParams): string[] | undefined => {\n if (!metadata?.fields) return undefined;\n\n const allFields = metadata.fields.map(f => f.name);\n\n const visible = allFields.filter(fieldName => {\n if (fieldName === 'ACTIONS') return false;\n\n if (columnVisibilityModel) {\n return columnVisibilityModel[fieldName] !== false;\n }\n\n return defaultVisibleFields?.includes(fieldName) ?? true;\n });\n\n if (!defaultVisibleFields) return visible;\n\n return visible.sort((a, b) => {\n const indexA = defaultVisibleFields.indexOf(a);\n const indexB = defaultVisibleFields.indexOf(b);\n\n return indexA - indexB || 0;\n });\n};\n"]}
1
+ {"version":3,"sources":["../../../src/components/DynamicDataView/DynamicDataView.tsx","../../../src/components/DynamicDataView/components/FilterButton.tsx","../../../src/components/DynamicDataView/components/FiltersSection.tsx","../../../src/components/DynamicDataView/components/filters/FiltersContainer.tsx","../../../src/components/DynamicDataView/components/filters/FiltersContent.tsx","../../../src/components/DynamicDataView/utils/filter.ts","../../../src/components/DynamicDataView/components/filters/FiltersList.tsx","../../../src/components/DynamicDataView/components/filters/FilterRow.tsx","../../../src/components/DynamicDataView/constants/filter.ts","../../../src/components/DynamicDataView/components/filters/EntityFilter.tsx","../../../src/components/DynamicDataView/components/filters/OperatorSelect.tsx","../../../src/components/DynamicDataView/components/filters/styles.ts","../../../src/components/DynamicDataView/components/SortModal/index.tsx","../../../src/components/DynamicDataView/components/SortModal/style.ts","../../../src/components/DynamicDataView/hooks/useColumnOrdering.ts","../../../src/components/DynamicDataView/hooks/useColumnVisibility.ts","../../../src/components/DynamicDataView/hooks/useDynamicColumns.ts","../../../src/components/DynamicDataView/constants/columnDefaults.ts","../../../src/components/DynamicDataView/utils/columnStrategies.ts","../../../src/components/DynamicDataView/hooks/useFilters.ts","../../../src/components/DynamicDataView/hooks/useFilterSortStorage.ts","../../../src/components/DynamicDataView/hooks/useSorting.ts","../../../src/components/DynamicDataView/utils/addActionsField.ts","../../../src/components/DynamicDataView/renderers/DateRenderer.ts","../../../src/components/DynamicDataView/renderers/DateTimeRenderer.ts","../../../src/components/DynamicDataView/renderers/EntityRenderer.tsx","../../../src/components/DynamicDataView/renderers/IconRenderer.tsx","../../../src/components/DynamicDataView/renderers/ImageRenderer.tsx","../../../src/components/DynamicDataView/renderers/style.ts","../../../src/components/DynamicDataView/renderers/NameRenderer.tsx","../../../src/components/DynamicDataView/renderers/NumberRenderer.tsx","../../../src/components/DynamicDataView/renderers/StatusRenderer.tsx","../../../src/components/DynamicDataView/renderers/TextRenderer.tsx","../../../src/components/DynamicDataView/utils/createCellRenderer.tsx","../../../src/components/DynamicDataView/utils/fields.ts"],"names":["memo","useCallback","useMemo","useState","isEqual","Badge","Button","IconButton","Stack","jsx","jsxs","FilterButton","showFilterButton","isMobile","hasActiveFilters","activeFiltersCount","sort","onFilterClick","onSortClick","Icon_default","ToolbarActionsDivider","FilterButton_default","Divider","Typography","getFilterableFields","fields","field","getDefaultCondition","type","available_filter_conditions","isValidCondition","condition","buildFilterFromConditions","conditions","validConditions","c","FormControl","InputLabel","MenuItem","Select","TextField","CONDITION_LABELS","EntityFilter","config","metadata","value","initialLabel","onChange","disabled","open","setOpen","useToggle_default","searchInput","setSearchInput","debouncedSearch","useDebounceValue_default","data","isLoading","isFetching","loading","selectedOption","options","items","item","opt","handleOpen","handleClose","handleChange","newValue","option","handleSearch","val","Autocomplete_default","x","EntityFilter_default","OperatorSelect","totalConditions","isFirst","e","OperatorSelect_default","ellipsisStyle","FilterRow","onRemove","entityFilterConfig","selectedField","f","availableConditions","isValueDisabled","handleFieldChange","fieldName","newField","defaultCondition","handleConditionChange","conditional","handleValueChange","handleEntityValueChange","label","valueLabels","handleOperatorChange","operator","renderValueInput","currentValue","cond","FilterRow_default","Fragment","FiltersList","filterableFields","onUpdateCondition","onRemoveCondition","handleUpdateCondition","updated","handleRemoveCondition","id","usedFieldNames","name","getAvailableFields","currentFieldName","index","FiltersList_default","Box","styled","Container","Header","theme","Content","Footer","FiltersContent","onClose","onAddCondition","onApply","onClear","onCancel","hasConditions","handleApply","handleClear","handleCancel","FiltersContent_default","FiltersContainer","props","ResponsivePopover_default","FiltersContainer_default","FiltersSection","isOpen","filterAnchorEl","FiltersSection_default","useEffect","Dialog","DialogActions","DialogContent","DialogTitle","StyledDialog","StyledDialogTitle","StyledDialogContent","StyledDialogActions","ApplyButton","LabelButton","SortModal","onSortChange","setSelectedField","selectedDirection","setSelectedDirection","sortableFields","selectedFieldObj","isNumberField","SortModal_default","useColumnOrdering","columns","preferredFieldOrder","columnsByFieldId","column","fieldsByName","actionFieldName","preferredWithoutActions","usedColumnFieldIds","ordered","pushColumnForField","getColumnFieldIdFromField","useColumnVisibility","defaultVisibleFieldNames","columnVisibilityStorageKey","onColumnVisibilityModelChange","hasStorageKey","storedVisibilityModel","setStoredVisibilityModel","useLocalStorage_default","initialState","visibilityModel","columnFieldId","visible","stored","handleColumnVisibilityModelChange","model","modelToSave","COLUMN_DEFAULTS","ACCESS_TYPES","CURRENCY_FIELD_NAMES","createImageColumn","renderCell","params","createIdColumn","createEntityColumn","createDefaultColumn","createActionsColumn","getColumnStrategy","useDynamicColumns","columnStrategies","columnsMap","useRef","parseInitialConditions","initialFilter","uuidv4","useFilters","setIsOpen","appliedConditions","setAppliedConditions","appliedFilter","setAppliedFilter","setConditions","snapshotRef","openDrawer","closeDrawer","addCondition","availableFields","currentOperator","firstField","newCondition","prev","updateCondition","changes","targetCondition","newOperator","removeCondition","clearAllFilters","applyFilters","filter","cancelChanges","getStoredValue","key","setStoredValue","useFilterStorage","storageKey","externalFilter","onFilterChange","filterKey","internalFilter","setInternalFilter","handleFilterChange","newFilter","useSortStorage","externalSort","sortKey","internalSort","setInternalSort","handleSortChange","newSort","resolveApiFieldName","resolveColumnFieldName","useSorting","sortModel","handleSortModelChange","firstItem","createActionsField","addActionsFieldToMetadata","DateRenderer","format","fDate","DateRenderer_default","DateTimeRenderer","fDateTime","DateTimeRenderer_default","Chip","EntityRenderer","entityValue","EntityRenderer_default","IconRenderer","trueIcon","falseIcon","color","width","IconRenderer_default","StatusLabel","isActive","ImageContainer","prop","size","noImage","clickable","ImageRenderer","imageResourceId","getImageUrl","alt","onClick","sx","hasImage","imageUrl","ImageRenderer_default","NameRenderer","displayName","copyMessage","CopyButton_default","NameRenderer_default","NumberRenderer","isCurrency","fCurrencyBRL","fNumber","NumberRenderer_default","StatusRenderer","active","activeLabel","inactiveLabel","StatusRenderer_default","sanitizeHtml","text","TextRenderer","showCopyButton","copyLabel","mask","stringValue","formattedValue","TextRenderer_default","getIsCurrency","createCellRenderer","context","onRowAction","CellRendererComponent","row","DynamicDataView","title","page","perPage","searchValue","onSearchChange","onSearch","onPaginationChange","onAdd","onRowDoubleClick","actions","moreActions","bulkActions","rowSelectionModel","onRowSelectionModelChange","slots","mobileRender","containerHeight","showColumnButton","rows","total","preloadedMetadata","firstRow","effectiveMetadata","effectiveMetadataFields","orderedColumns","handleRowDoubleClick","rowId","useResponsive_default","setFilterAnchorEl","storedFilter","setStoredFilter","storedSort","setStoredSort","effectiveFilter","effectiveSort","handleApplyFilters","handleClearFilters","handleFilterButtonClick","event","handleCancelFilters","isSortModalOpen","setIsSortModalOpen","handleFiltersClose","hasSelectionActions","DataView_default","DynamicDataView_default","buildVisibleFields","columnVisibilityModel","defaultVisibleFields","a","b","indexA","indexB"],"mappings":"40CAAA,OAAS,QAAAA,GAAM,eAAAC,EAAa,WAAAC,GAAS,YAAAC,OAAgB,QACrD,OAAOC,OAAa,qBCDpB,OAAS,QAAAJ,OAAY,QACrB,OAAOI,OAAa,qBACpB,OAAOC,OAAW,sBAClB,OAAOC,OAAY,uBACnB,OAAOC,OAAgB,2BACvB,OAAOC,OAAW,sBAoBZ,OAmBM,OAAAC,EAnBN,QAAAC,OAAA,oBAbN,IAAMC,GAAe,CAAC,CACpB,iBAAAC,EACA,SAAAC,EACA,iBAAAC,EACA,mBAAAC,EACA,KAAAC,EACA,cAAAC,EACA,YAAAC,CACF,IACON,EAEDC,EAEAH,GAACF,GAAA,CAAM,UAAU,MAAM,QAAS,GAC9B,UAAAC,EAACJ,GAAA,CACC,aAAcU,EACd,MAAM,UACN,UAAWA,IAAuB,EAClC,GAAI,CACF,oBAAqB,CACnB,UAAW,kCACX,QAASA,IAAuB,EAAI,EAAI,CAC1C,CACF,EAEA,SAAAN,EAACF,GAAA,CACC,MAAOO,EAAmB,UAAY,UACtC,QAASG,EACT,KAAK,QACL,aAAW,UACX,GAAI,CAAE,SAAU,SAAU,EAE1B,SAAAR,EAACU,EAAA,CAAK,KAAK,kBAAkB,EAC/B,EACF,EAEAV,EAACW,GAAA,CACC,GAAI,CAAE,O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AMiX,GAAqB,CAAC,CACjC,SAAAzU,EACA,sBAAA0U,EACA,qBAAAC,CACF,IAAsD,CACpD,GAAI,CAAC3U,GAAU,OAAQ,OAIvB,IAAMgJ,EAFYhJ,EAAS,OAAO,IAAIyC,GAAKA,EAAE,IAAI,EAEvB,OAAOI,GAC3BA,IAAc,UAAkB,GAEhC6R,EACKA,EAAsB7R,CAAS,IAAM,GAGvC8R,GAAsB,SAAS9R,CAAS,GAAK,EACrD,EAED,OAAK8R,EAEE3L,EAAQ,KAAK,CAAC4L,EAAGC,IAAM,CAC5B,IAAMC,EAASH,EAAqB,QAAQC,CAAC,EACvCG,EAASJ,EAAqB,QAAQE,CAAC,EAE7C,OAAOC,EAASC,GAAU,CAC5B,CAAC,EAPiC/L,CAQpC","sourcesContent":["import { memo, useCallback, useMemo, useState } from 'react';\nimport isEqual from 'react-fast-compare';\nimport { AccessType, DataType } from 'model/entity-metadata';\n\nimport useResponsive from 'hooks/useResponsive';\n\nimport DataView from '../DataView';\n\nimport FilterButton from './components/FilterButton';\nimport FiltersSection from './components/FiltersSection';\nimport SortModal from './components/SortModal';\nimport { useColumnOrdering } from './hooks/useColumnOrdering';\nimport { useColumnVisibility } from './hooks/useColumnVisibility';\nimport { useDynamicColumns } from './hooks/useDynamicColumns';\nimport { useFilters } from './hooks/useFilters';\nimport { useFilterStorage, useSortStorage } from './hooks/useFilterSortStorage';\nimport { useSorting } from './hooks/useSorting';\nimport { addActionsFieldToMetadata } from './utils/addActionsField';\nimport { createCellRenderer } from './utils/createCellRenderer';\nimport { DynamicDataViewProps, DynamicRowData } from './props';\n\nconst DynamicDataView = <T extends object = object>({\n title,\n metadata,\n data,\n isLoading,\n isFetching,\n page,\n perPage,\n searchValue,\n onSearchChange,\n onSearch,\n onPaginationChange,\n onAdd,\n onRowAction,\n onRowDoubleClick,\n actions,\n moreActions,\n bulkActions,\n rowSelectionModel,\n onRowSelectionModelChange,\n slots,\n mobileRender,\n containerHeight = 600,\n showColumnButton = false,\n showFilterButton = false,\n filter,\n onFilterChange,\n sort,\n onSortChange,\n defaultVisibleFieldNames,\n preferredFieldOrder,\n columnStrategies,\n onColumnVisibilityModelChange,\n storageKey,\n entityFilterConfig,\n}: DynamicDataViewProps<T>) => {\n const { items: rows = [], total = 0 } = data || {};\n\n // Criar metadata temporário baseado em data quando metadata não disponível\n const preloadedMetadata = useMemo(() => {\n if (metadata) return metadata;\n\n // Se não tem metadata mas tem dados, criar metadata baseado nas keys do primeiro item\n if (rows.length > 0) {\n const firstRow = rows[0];\n const fields = Object.keys(firstRow).map(key => ({\n name: key,\n type: DataType.TEXT,\n description: key,\n filter_field_name: null,\n metadata: null,\n access_type: AccessType.READ_ONLY,\n relation_field_name: null,\n available_filter_conditions: [],\n }));\n\n return {\n name: 'loading',\n description: 'Loading...',\n id_field_name: 'id',\n description_field_name: fields[0]?.name || 'id',\n access_type: AccessType.READ_ONLY,\n fields,\n };\n }\n\n return undefined;\n }, [metadata, rows]);\n\n const effectiveMetadata = useMemo(\n () =>\n preloadedMetadata && onRowAction\n ? addActionsFieldToMetadata(preloadedMetadata)\n : preloadedMetadata,\n [preloadedMetadata, onRowAction],\n );\n\n const effectiveMetadataFields = useMemo(\n () => effectiveMetadata?.fields || [],\n [effectiveMetadata],\n );\n\n const renderCell = useMemo(\n () =>\n createCellRenderer<T>({\n onRowAction,\n }),\n [onRowAction],\n );\n\n const columns = useDynamicColumns<T>({\n metadata: effectiveMetadata,\n renderCell,\n columnStrategies,\n });\n\n const { orderedColumns, columnsByFieldId } = useColumnOrdering({\n columns,\n fields: effectiveMetadata?.fields,\n preferredFieldOrder,\n });\n\n const { initialState, handleColumnVisibilityModelChange } =\n useColumnVisibility({\n fields: effectiveMetadata?.fields,\n columnsByFieldId,\n defaultVisibleFieldNames,\n columnVisibilityStorageKey: `${storageKey}:columns`,\n onColumnVisibilityModelChange,\n });\n\n const handleRowDoubleClick = useCallback(\n (params: { id: string | number; row: DynamicRowData<T> }) => {\n if (!onRowDoubleClick) return;\n\n const rowId = params.id?.toString() || '';\n onRowDoubleClick(rowId, params.row);\n },\n [onRowDoubleClick],\n );\n\n const isMobile = useResponsive('down', 'md');\n const [filterAnchorEl, setFilterAnchorEl] = useState<HTMLElement | null>(\n null,\n );\n\n const { filter: storedFilter, setFilter: setStoredFilter } = useFilterStorage(\n storageKey,\n filter,\n onFilterChange,\n );\n\n const { sort: storedSort, setSort: setStoredSort } = useSortStorage(\n storageKey,\n sort,\n onSortChange,\n );\n\n const effectiveFilter = filter ?? storedFilter;\n const effectiveSort = sort ?? storedSort;\n\n const { sortModel, handleSortModelChange } = useSorting({\n sort: effectiveSort,\n onSortChange: setStoredSort,\n fields: effectiveMetadataFields,\n });\n\n const {\n conditions,\n isOpen,\n openDrawer,\n closeDrawer,\n addCondition,\n updateCondition,\n removeCondition,\n clearAllFilters,\n applyFilters,\n cancelChanges,\n hasActiveFilters,\n activeFiltersCount,\n } = useFilters({\n fields: effectiveMetadataFields,\n initialFilter: effectiveFilter,\n });\n\n const handleApplyFilters = useCallback(() => {\n const newFilter = applyFilters();\n setStoredFilter(newFilter);\n }, [applyFilters, setStoredFilter]);\n\n const handleClearFilters = useCallback(() => {\n clearAllFilters();\n setStoredFilter(undefined);\n }, [clearAllFilters, setStoredFilter]);\n\n const handleFilterButtonClick = useCallback(\n (event: React.MouseEvent<HTMLElement>) => {\n if (isMobile) {\n openDrawer();\n } else {\n openDrawer();\n setFilterAnchorEl(event.currentTarget);\n }\n },\n [isMobile, openDrawer],\n );\n\n const handleCancelFilters = useCallback(() => {\n cancelChanges();\n setFilterAnchorEl(null);\n }, [cancelChanges]);\n\n const [isSortModalOpen, setIsSortModalOpen] = useState(false);\n\n const handleFiltersClose = useCallback(() => {\n setFilterAnchorEl(null);\n closeDrawer();\n }, [closeDrawer]);\n const hasSelectionActions = !!bulkActions?.length;\n\n return (\n <>\n <DataView<DynamicRowData<T>>\n title={title}\n columns={orderedColumns}\n rows={rows}\n mobileRender={mobileRender}\n rowCount={total}\n loading={isLoading || !metadata}\n fetching={isFetching}\n searchValue={searchValue}\n onSearch={onSearch}\n onSearchChange={onSearchChange}\n paginationModel={{\n page,\n pageSize: perPage,\n }}\n onPaginationChange={onPaginationChange}\n actions={actions}\n moreActions={moreActions}\n onAdd={onAdd}\n onRowDoubleClick={onRowDoubleClick ? handleRowDoubleClick : undefined}\n bulkActions={bulkActions}\n checkboxSelection={hasSelectionActions}\n rowSelectionModel={rowSelectionModel}\n onRowSelectionModelChange={onRowSelectionModelChange}\n keepNonExistentRowsSelected={hasSelectionActions}\n disableRowSelectionOnClick\n slots={slots}\n initialState={initialState}\n showColumnButton={showColumnButton}\n containerProps={{\n height: containerHeight,\n maxHeight: containerHeight,\n }}\n onColumnVisibilityModelChange={handleColumnVisibilityModelChange}\n filterButton={\n <FilterButton\n showFilterButton={showFilterButton}\n isMobile={isMobile}\n hasActiveFilters={hasActiveFilters}\n activeFiltersCount={activeFiltersCount}\n sort={effectiveSort}\n onFilterClick={handleFilterButtonClick}\n onSortClick={() => setIsSortModalOpen(true)}\n />\n }\n sortingMode=\"server\"\n sortModel={sortModel}\n onSortModelChange={handleSortModelChange}\n disableColumnFilter\n />\n {metadata && (\n <>\n <FiltersSection\n showFilterButton={showFilterButton}\n isOpen={isOpen}\n filterAnchorEl={filterAnchorEl}\n fields={effectiveMetadataFields}\n conditions={conditions}\n isMobile={isMobile}\n onClose={handleFiltersClose}\n onAddCondition={addCondition}\n onUpdateCondition={updateCondition}\n onRemoveCondition={removeCondition}\n onApply={handleApplyFilters}\n onClear={handleClearFilters}\n onCancel={handleCancelFilters}\n entityFilterConfig={entityFilterConfig}\n />\n\n <SortModal\n open={isSortModalOpen}\n onClose={() => setIsSortModalOpen(false)}\n fields={effectiveMetadataFields}\n sort={effectiveSort}\n onSortChange={setStoredSort}\n />\n </>\n )}\n </>\n );\n};\n\nexport default memo(DynamicDataView, isEqual) as typeof DynamicDataView;\nexport type { DynamicDataViewProps, DynamicRowData } from './props';\n","import { memo } from 'react';\nimport isEqual from 'react-fast-compare';\nimport Badge from '@mui/material/Badge';\nimport Button from '@mui/material/Button';\nimport IconButton from '@mui/material/IconButton';\nimport Stack from '@mui/material/Stack';\n\nimport { ToolbarActionsDivider } from 'components/DataView';\nimport Icon from 'components/Icon';\n\nimport { FilterButtonProps } from '../props';\n\nconst FilterButton = ({\n showFilterButton,\n isMobile,\n hasActiveFilters,\n activeFiltersCount,\n sort,\n onFilterClick,\n onSortClick,\n}: FilterButtonProps) => {\n if (!showFilterButton) return null;\n\n if (isMobile) {\n return (\n <Stack direction=\"row\" spacing={0.5}>\n <Badge\n badgeContent={activeFiltersCount}\n color=\"primary\"\n invisible={activeFiltersCount === 0}\n sx={{\n '& .MuiBadge-badge': {\n transform: 'scale(0.9) translate(10px, 9px)',\n opacity: activeFiltersCount === 0 ? 0 : 1,\n },\n }}\n >\n <IconButton\n color={hasActiveFilters ? 'primary' : 'default'}\n onClick={onFilterClick}\n size=\"small\"\n aria-label=\"Filtrar\"\n sx={{ overflow: 'visible' }}\n >\n <Icon icon=\"FILTER_VERTICAL\" />\n </IconButton>\n </Badge>\n\n <ToolbarActionsDivider\n sx={{ height: 16 }}\n orientation=\"vertical\"\n flexItem\n />\n\n <IconButton\n color={sort ? 'primary' : 'default'}\n onClick={onSortClick}\n size=\"small\"\n aria-label=\"Ordenar\"\n >\n <Icon\n icon={sort?.sortType === 'DESC' ? 'SORTING_DESC' : 'SORTING_ASC'}\n />\n </IconButton>\n </Stack>\n );\n }\n\n return (\n <Badge\n badgeContent={activeFiltersCount}\n color=\"primary\"\n invisible={activeFiltersCount === 0}\n sx={{\n '& .MuiBadge-badge': activeFiltersCount\n ? {\n transform: 'scale(0.9) translate(-3px, 7px)',\n position: 'relative',\n opacity: 1,\n transition: 'none',\n }\n : {\n transition: 'none',\n opacity: 0,\n },\n }}\n >\n <Button\n variant=\"text\"\n color={hasActiveFilters ? 'primary' : 'inherit'}\n startIcon={<Icon icon=\"FILTER_VERTICAL\" />}\n onClick={onFilterClick}\n size=\"small\"\n >\n Filtrar\n </Button>\n </Badge>\n );\n};\n\nexport default memo(FilterButton, isEqual);\n","import { memo } from 'react';\nimport isEqual from 'react-fast-compare';\n\nimport { FiltersSectionProps } from '../props';\n\nimport FiltersContainer from './filters/FiltersContainer';\n\nconst FiltersSection = ({\n showFilterButton,\n isOpen,\n filterAnchorEl,\n fields,\n conditions,\n isMobile,\n onClose,\n onAddCondition,\n onUpdateCondition,\n onRemoveCondition,\n onApply,\n onClear,\n onCancel,\n entityFilterConfig,\n}: FiltersSectionProps) => {\n if (!showFilterButton) return null;\n\n return (\n <FiltersContainer\n open={isOpen || Boolean(filterAnchorEl)}\n anchorEl={filterAnchorEl}\n onClose={onClose}\n fields={fields}\n conditions={conditions}\n onAddCondition={onAddCondition}\n onUpdateCondition={onUpdateCondition}\n onRemoveCondition={onRemoveCondition}\n onApply={onApply}\n onClear={onClear}\n onCancel={onCancel}\n isMobileProp={isMobile}\n entityFilterConfig={entityFilterConfig}\n />\n );\n};\n\nexport default memo(FiltersSection, isEqual);\n","import { memo } from 'react';\nimport isEqual from 'react-fast-compare';\n\nimport ResponsivePopover from 'components/ResponsivePopover';\n\nimport FiltersContent from './FiltersContent';\nimport type { FiltersContainerProps } from './props';\n\nconst FiltersContainer = (props: FiltersContainerProps) => {\n return (\n <ResponsivePopover\n open={props.open}\n onClose={props.onClose}\n anchorEl={props.anchorEl}\n isMobile={props.isMobileProp}\n popoverProps={{\n slotProps: {\n paper: {\n sx: {\n width: 520,\n maxWidth: 'calc(100vw - 24px)',\n maxHeight: 600,\n mt: 1,\n },\n },\n },\n }}\n drawerProps={{\n anchor: 'right',\n PaperProps: {\n sx: {\n width: '100%',\n maxWidth: '100%',\n height: '100%',\n maxHeight: '100%',\n borderRadius: 0,\n },\n },\n }}\n >\n <FiltersContent {...props} />\n </ResponsivePopover>\n );\n};\n\nexport default memo(FiltersContainer, isEqual);\n","import { memo, useCallback } from 'react';\nimport isEqual from 'react-fast-compare';\nimport Button from '@mui/material/Button';\nimport Divider from '@mui/material/Divider';\nimport IconButton from '@mui/material/IconButton';\nimport Stack from '@mui/material/Stack';\nimport Typography from '@mui/material/Typography';\n\nimport Icon from 'components/Icon';\n\nimport { getFilterableFields } from '../../utils/filter';\n\nimport FiltersList from './FiltersList';\nimport type { FiltersPopoverProps } from './props';\nimport { Container, Content, Footer, Header } from './styles';\n\nconst FiltersContent = ({\n onClose,\n fields,\n conditions,\n onAddCondition,\n onUpdateCondition,\n onRemoveCondition,\n onApply,\n onClear,\n onCancel,\n entityFilterConfig,\n}: FiltersPopoverProps) => {\n const filterableFields = getFilterableFields(fields);\n const hasConditions = conditions.length > 0;\n\n const handleApply = useCallback(() => {\n onApply();\n onClose();\n }, [onApply, onClose]);\n\n const handleClear = useCallback(() => {\n onClear();\n onClose();\n }, [onClear, onClose]);\n\n const handleCancel = useCallback(() => {\n onCancel();\n }, [onCancel]);\n\n return (\n <Container>\n <Header>\n <Typography variant=\"overline\" fontWeight={600} color=\"text.secondary\">\n Defina as condições para filtrar\n </Typography>\n\n <IconButton\n onClick={onAddCondition}\n size=\"small\"\n aria-label=\"Adicionar filtro\"\n title=\"Adicionar filtro\"\n disabled={conditions.length >= filterableFields.length}\n >\n <Icon icon=\"SIMPLE_ADD\" />\n </IconButton>\n </Header>\n\n <Divider />\n\n <Content>\n <FiltersList\n filterableFields={filterableFields}\n conditions={conditions}\n onUpdateCondition={onUpdateCondition}\n onRemoveCondition={onRemoveCondition}\n entityFilterConfig={entityFilterConfig}\n />\n </Content>\n\n <Divider />\n\n <Footer>\n <Button variant=\"text\" color=\"inherit\" onClick={handleClear}>\n Limpar\n </Button>\n\n <Stack direction=\"row\" spacing={1}>\n <Button\n variant=\"outlined\"\n color=\"inherit\"\n onClick={handleCancel}\n startIcon={<Icon icon=\"CANCEL_CIRCLE\" />}\n >\n Cancelar\n </Button>\n <Button\n variant=\"contained\"\n onClick={handleApply}\n disabled={!hasConditions}\n startIcon={<Icon icon=\"SIMPLE_CHECK\" />}\n >\n Aplicar\n </Button>\n </Stack>\n </Footer>\n </Container>\n );\n};\n\nexport default memo(FiltersContent, isEqual);\n","import { Condition, DataType, Field } from 'model/entity-metadata';\nimport {\n Filter,\n FilterCondition,\n FilterOperator,\n FilterState,\n} from 'model/filter';\n\n/**\n * Campos filtráveis (campos com condições disponíveis)\n */\nexport const getFilterableFields = (fields: Field[]): Field[] => {\n return fields.filter(\n field =>\n field.available_filter_conditions &&\n field.available_filter_conditions.length > 0 &&\n field.name !== 'ACTIONS',\n );\n};\n\n/**\n * Converte FilterState para formato de API\n */\nexport const buildFilterFromState = (\n state: FilterState,\n): Filter | undefined => {\n const entries = Object.entries(state).filter(\n ([, value]) => value.value.length > 0,\n );\n if (entries.length === 0) return undefined;\n return {\n operator: FilterOperator.AND,\n groups: [\n {\n operator: FilterOperator.AND,\n conditionals: entries.map(([, filterValue]) => ({\n fieldName: filterValue.fieldName,\n conditional: filterValue.conditional,\n value: filterValue.value,\n })),\n },\n ],\n };\n};\n\n/**\n * Retorna o conditional padrão para um tipo de campo\n */\nexport const getDefaultCondition = (field: Field): Condition => {\n const { type, available_filter_conditions } = field;\n if (available_filter_conditions.length === 0) return Condition.EQUALS;\n if (\n type === DataType.TEXT &&\n available_filter_conditions.includes(Condition.LIKE)\n ) {\n return Condition.LIKE;\n }\n return available_filter_conditions[0];\n};\n\n/**\n * Verifica se uma condição é válida (tem valor ou não requer valor)\n */\nexport const isValidCondition = (condition: FilterCondition): boolean => {\n return (\n condition.value.length > 0 ||\n condition.conditional === Condition.IS_NULL ||\n condition.conditional === Condition.IS_NOT_NULL\n );\n};\n\n/**\n * Converte array de FilterCondition para Filter API\n */\nexport const buildFilterFromConditions = (\n conditions: FilterCondition[],\n): Filter | undefined => {\n if (conditions.length === 0) return undefined;\n\n const validConditions = conditions.filter(isValidCondition);\n if (validConditions.length === 0) return undefined;\n\n return {\n operator: FilterOperator.AND,\n groups: [\n {\n operator: validConditions[0]?.operator || FilterOperator.AND,\n conditionals: validConditions.map(c => ({\n fieldName: c.fieldName,\n conditional: c.conditional,\n value: c.value,\n })),\n },\n ],\n };\n};\n","import { memo, useCallback, useMemo } from 'react';\nimport isEqual from 'react-fast-compare';\nimport Typography from '@mui/material/Typography';\nimport type { FilterCondition } from 'model/filter';\n\nimport FilterRow from './FilterRow';\nimport type { FiltersListProps } from './props';\n\nconst FiltersList = ({\n filterableFields,\n conditions,\n onUpdateCondition,\n onRemoveCondition,\n entityFilterConfig,\n}: FiltersListProps) => {\n const handleUpdateCondition = useCallback(\n (updated: FilterCondition) => {\n onUpdateCondition(updated.id, updated);\n },\n [onUpdateCondition],\n );\n\n const handleRemoveCondition = useCallback(\n (id: string) => () => {\n onRemoveCondition(id);\n },\n [onRemoveCondition],\n );\n\n const usedFieldNames = useMemo(\n () =>\n conditions.map(c => c.fieldName).filter((name): name is string => !!name),\n [conditions],\n );\n\n const getAvailableFields = useCallback(\n (currentFieldName: string | undefined) =>\n filterableFields.filter(\n field =>\n !usedFieldNames.includes(field.name) ||\n field.name === currentFieldName,\n ),\n [filterableFields, usedFieldNames],\n );\n\n if (filterableFields.length === 0) {\n return (\n <Typography variant=\"body2\" color=\"text.secondary\" textAlign=\"center\">\n Nenhum filtro disponível\n </Typography>\n );\n }\n\n if (conditions.length === 0) {\n return (\n <Typography variant=\"body2\" color=\"text.secondary\" textAlign=\"center\">\n Clique em{' '}\n <Typography\n component=\"strong\"\n variant=\"body2\"\n fontWeight={600}\n color=\"text.primary\"\n >\n &quot;+&quot;\n </Typography>{' '}\n para adicionar um filtro\n </Typography>\n );\n }\n\n return (\n <>\n {conditions.map((condition, index) => (\n <FilterRow\n key={condition.id}\n condition={condition}\n fields={getAvailableFields(condition.fieldName)}\n onChange={handleUpdateCondition}\n onRemove={handleRemoveCondition(condition.id)}\n showOperator={index > 0}\n totalConditions={conditions.length}\n isFirst={index === 0}\n entityFilterConfig={entityFilterConfig}\n />\n ))}\n </>\n );\n};\n\nexport default memo(FiltersList, isEqual);\n","import { memo, useCallback, useMemo } from 'react';\nimport isEqual from 'react-fast-compare';\nimport FormControl from '@mui/material/FormControl';\nimport IconButton from '@mui/material/IconButton';\nimport InputLabel from '@mui/material/InputLabel';\nimport MenuItem from '@mui/material/MenuItem';\nimport Select from '@mui/material/Select';\nimport Stack from '@mui/material/Stack';\nimport TextField from '@mui/material/TextField';\nimport { Condition } from 'model/entity-metadata';\nimport { FilterOperator } from 'model/filter';\n\nimport Icon from 'components/Icon';\n\nimport { CONDITION_LABELS } from '../../constants/filter';\n\nimport EntityFilter from './EntityFilter';\nimport OperatorSelect from './OperatorSelect';\nimport type { FilterRowProps } from './props';\n\nconst ellipsisStyle = {\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n} as const;\n\nconst FilterRow = ({\n condition,\n fields,\n onChange,\n onRemove,\n totalConditions,\n isFirst,\n entityFilterConfig,\n}: FilterRowProps) => {\n const selectedField = useMemo(\n () =>\n fields.find(f => (f.filter_field_name ?? f.name) === condition.fieldName),\n [fields, condition.fieldName],\n );\n\n const availableConditions = useMemo(\n () => selectedField?.available_filter_conditions || [],\n [selectedField],\n );\n\n const isValueDisabled = useMemo(\n () =>\n !condition.fieldName ||\n condition.conditional === 'IS_NULL' ||\n condition.conditional === 'IS_NOT_NULL',\n [condition.fieldName, condition.conditional],\n );\n\n const handleFieldChange = useCallback(\n (fieldName: string) => {\n const newField = fields.find(\n f => (f.filter_field_name ?? f.name) === fieldName,\n );\n if (!newField) return;\n\n const defaultCondition =\n newField.available_filter_conditions[0] || 'EQUALS';\n\n onChange({\n ...condition,\n fieldName,\n conditional: defaultCondition,\n value: [],\n });\n },\n [fields, condition, onChange],\n );\n\n const handleConditionChange = useCallback(\n (conditional: Condition) => {\n onChange({\n ...condition,\n conditional,\n });\n },\n [condition, onChange],\n );\n\n const handleValueChange = useCallback(\n (value: string) => {\n onChange({\n ...condition,\n value: value ? [value] : [],\n });\n },\n [condition, onChange],\n );\n\n const handleEntityValueChange = useCallback(\n (value: string, label?: string) => {\n const valueLabels = { ...condition.valueLabels };\n if (value && label) {\n valueLabels[value] = label;\n }\n onChange({\n ...condition,\n value: value ? [value] : [],\n valueLabels,\n });\n },\n [condition, onChange],\n );\n\n const handleOperatorChange = useCallback(\n (operator: FilterOperator) => {\n onChange({\n ...condition,\n operator,\n });\n },\n [condition, onChange],\n );\n\n const renderValueInput = () => {\n if (selectedField?.type === 'BOOLEAN') {\n return (\n <FormControl\n size=\"small\"\n sx={{ flex: 1, minWidth: 120 }}\n disabled={isValueDisabled}\n >\n <InputLabel id={`value-label-${condition.id}`}>Valor</InputLabel>\n <Select\n labelId={`value-label-${condition.id}`}\n label=\"Valor\"\n value={condition.value[0] || ''}\n onChange={e => handleValueChange(e.target.value)}\n size=\"small\"\n sx={{\n '& .MuiSelect-select': ellipsisStyle,\n }}\n >\n <MenuItem value=\"true\">Verdadeiro</MenuItem>\n <MenuItem value=\"false\">Falso</MenuItem>\n </Select>\n </FormControl>\n );\n }\n\n if (\n selectedField?.type === 'ENTITY' &&\n selectedField.metadata &&\n entityFilterConfig?.[selectedField.metadata.name]\n ) {\n const currentValue = condition.value[0] || '';\n return (\n <EntityFilter\n config={entityFilterConfig[selectedField.metadata.name]}\n metadata={selectedField.metadata}\n value={currentValue}\n initialLabel={condition.valueLabels?.[currentValue]}\n onChange={handleEntityValueChange}\n disabled={isValueDisabled}\n />\n );\n }\n\n return (\n <TextField\n label=\"Filtro\"\n value={condition.value[0] || ''}\n onChange={e => handleValueChange(e.target.value)}\n size=\"small\"\n disabled={isValueDisabled}\n InputLabelProps={{ shrink: true }}\n sx={{ flex: 1, minWidth: 120 }}\n />\n );\n };\n\n return (\n <Stack direction=\"row\" spacing={1} alignItems=\"center\">\n <IconButton\n onClick={onRemove}\n size=\"small\"\n aria-label=\"Remover filtro\"\n sx={{ flexShrink: 0 }}\n >\n <Icon icon=\"CLOSE_MARK_BUTTON\" width={18} />\n </IconButton>\n\n <OperatorSelect\n value={condition.operator}\n onChange={handleOperatorChange}\n totalConditions={totalConditions}\n isFirst={isFirst}\n />\n\n <FormControl size=\"small\" sx={{ minWidth: 150, flex: 1 }}>\n <InputLabel id={`field-label-${condition.id}`}>Coluna</InputLabel>\n <Select\n labelId={`field-label-${condition.id}`}\n label=\"Coluna\"\n value={condition.fieldName}\n onChange={e => handleFieldChange(e.target.value)}\n size=\"small\"\n sx={{\n '& .MuiSelect-select': ellipsisStyle,\n }}\n >\n {fields.map(field => (\n <MenuItem\n key={field.name}\n value={field.filter_field_name ?? field.name}\n sx={ellipsisStyle}\n title={field.description || field.name}\n >\n {field.description || field.name}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n\n <FormControl\n size=\"small\"\n sx={{ minWidth: 90 }}\n disabled={!condition.fieldName}\n >\n <InputLabel id={`condition-label-${condition.id}`}>Condição</InputLabel>\n <Select\n labelId={`condition-label-${condition.id}`}\n label=\"Condição\"\n value={condition.conditional}\n onChange={e => handleConditionChange(e.target.value as Condition)}\n size=\"small\"\n sx={{\n '& .MuiSelect-select': ellipsisStyle,\n }}\n >\n {availableConditions.map(cond => (\n <MenuItem key={cond} value={cond} sx={ellipsisStyle}>\n {CONDITION_LABELS[cond as Condition] || cond}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n\n {renderValueInput()}\n </Stack>\n );\n};\n\nexport default memo(FilterRow, isEqual);\n","import { Condition } from 'model/entity-metadata';\n\nexport const CONDITION_LABELS: Record<Condition, string> = {\n [Condition.EQUALS]: 'Igual a',\n [Condition.NOT_EQUALS]: 'Diferente de',\n [Condition.LIKE]: 'Contém',\n [Condition.NOT_LIKE]: 'Não contém',\n [Condition.GREATER_THAN]: 'Maior que',\n [Condition.LESS_THAN]: 'Menor que',\n [Condition.GREATER_THAN_OR_EQUAL]: 'Maior ou igual a',\n [Condition.LESS_THAN_OR_EQUAL]: 'Menor ou igual a',\n [Condition.IN]: 'Em',\n [Condition.NOT_IN]: 'Não em',\n [Condition.IS_NULL]: 'É nulo',\n [Condition.IS_NOT_NULL]: 'Não é nulo',\n};\n","import { memo, useCallback, useMemo, useState } from 'react';\n\nimport Autocomplete from 'components/Autocomplete';\nimport useDebounceValue from 'hooks/useDebounceValue';\nimport useToggle from 'hooks/useToggle';\nimport type { Option } from 'types/option';\n\nimport type { EntityFilterProps } from './props';\n\nconst EntityFilter = ({\n config,\n metadata,\n value,\n initialLabel,\n onChange,\n disabled = false,\n}: EntityFilterProps) => {\n const [open, , setOpen] = useToggle(false);\n const [searchInput, setSearchInput] = useState('');\n const debouncedSearch = useDebounceValue(searchInput, 400);\n\n const { data, isLoading, isFetching } = config.useQuery(\n {\n search: debouncedSearch || undefined,\n page: 0,\n perPage: 25,\n ...config.queryParams,\n },\n { skip: !open },\n );\n\n const loading = isLoading || isFetching;\n\n const selectedOption = useMemo<Option | null>(() => {\n if (!value) return null;\n return { value, label: initialLabel ?? value };\n }, [value, initialLabel]);\n\n const options = useMemo<Option[]>(() => {\n const items: Option[] = (data?.items ?? [])\n .map(item => ({\n label: String(item[metadata.description_field_name] ?? ''),\n value: String(item[metadata.id_field_name] ?? ''),\n }))\n .filter(opt => opt.value && opt.label);\n\n if (\n selectedOption &&\n !items.some(\n opt => opt.value.toString() === selectedOption.value.toString(),\n )\n ) {\n items.unshift(selectedOption);\n }\n\n return items;\n }, [\n data,\n metadata.id_field_name,\n metadata.description_field_name,\n selectedOption,\n ]);\n\n const handleOpen = useCallback(() => setOpen(true), [setOpen]);\n\n const handleClose = useCallback(() => {\n setOpen(false);\n setSearchInput('');\n }, [setOpen]);\n\n const handleChange = useCallback(\n (newValue: string) => {\n if (!newValue) {\n onChange('', undefined);\n return;\n }\n const option = options.find(opt => opt.value.toString() === newValue);\n onChange(newValue, option?.label);\n },\n [onChange, options],\n );\n\n const handleSearch = useCallback((val?: string) => {\n setSearchInput(val ?? '');\n }, []);\n\n return (\n <Autocomplete\n name={`entity-filter-${metadata.name}`}\n label=\"Filtro\"\n value={value || ''}\n options={options}\n onChange={handleChange}\n onSearch={handleSearch}\n loading={loading}\n disabled={disabled}\n size=\"small\"\n filterOptions={x => x}\n noOptionsText={\n searchInput !== debouncedSearch ? 'Buscando...' : 'Nenhum resultado'\n }\n InputLabelProps={{ shrink: true }}\n sx={{ flex: 1, minWidth: 120 }}\n open={open}\n onOpen={handleOpen}\n onClose={handleClose}\n />\n );\n};\n\nexport default memo(EntityFilter);\n","import { memo } from 'react';\nimport isEqual from 'react-fast-compare';\nimport MenuItem from '@mui/material/MenuItem';\nimport Select from '@mui/material/Select';\nimport Stack from '@mui/material/Stack';\nimport { FilterOperator } from 'model/filter';\n\nimport type { OperatorSelectProps } from './props';\n\nconst OperatorSelect = ({\n value,\n onChange,\n totalConditions,\n isFirst,\n}: OperatorSelectProps) => {\n if (totalConditions === 1) {\n return null;\n }\n\n if (isFirst) {\n return <Stack sx={{ width: 55, flexShrink: 0 }} />;\n }\n\n return (\n <Select\n value={value}\n onChange={e => onChange(e.target.value as FilterOperator)}\n size=\"small\"\n sx={{ width: 55, flexShrink: 0 }}\n >\n <MenuItem value={FilterOperator.AND}>e</MenuItem>\n <MenuItem value={FilterOperator.OR}>ou</MenuItem>\n </Select>\n );\n};\n\nexport default memo(OperatorSelect, isEqual);\n","import Box from '@mui/material/Box';\nimport { styled } from '@mui/material/styles';\n\n// Estilos baseados no Drawer/Popover para garantir consistência\nexport const Container = styled(Box)({\n display: 'flex',\n flexDirection: 'column',\n height: '100%',\n // No popover, a altura será controlada pelo max-height do container\n});\n\nexport const Header = styled(Box)(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: theme.spacing(2, 3),\n}));\n\nexport const Content = styled(Box)(({ theme }) => ({\n flex: 1,\n overflowY: 'auto',\n padding: theme.spacing(3),\n display: 'flex',\n flexDirection: 'column',\n gap: theme.spacing(2),\n}));\n\nexport const Footer = styled(Box)(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: theme.spacing(2),\n}));\n","import { memo, useCallback, useEffect, useMemo, useState } from 'react';\nimport Button from '@mui/material/Button';\nimport FormControl from '@mui/material/FormControl';\nimport InputLabel from '@mui/material/InputLabel';\nimport MenuItem from '@mui/material/MenuItem';\nimport Select from '@mui/material/Select';\nimport Stack from '@mui/material/Stack';\nimport Typography from '@mui/material/Typography';\nimport { SortType } from 'model/filter';\n\nimport Icon from 'components/Icon';\n\nimport { SortModalProps } from './props';\nimport {\n ApplyButton,\n LabelButton,\n StyledDialog,\n StyledDialogActions,\n StyledDialogContent,\n StyledDialogTitle,\n} from './style';\n\nconst SortModal = ({\n open,\n onClose,\n fields,\n sort,\n onSortChange,\n}: SortModalProps) => {\n const [selectedField, setSelectedField] = useState<string>(\n sort?.fieldName || '',\n );\n const [selectedDirection, setSelectedDirection] = useState<SortType>(\n sort?.sortType || SortType.ASC,\n );\n\n const sortableFields = useMemo(\n () =>\n fields.filter(\n field => field.name !== 'ACTIONS' && field.access_type !== 'WRITE_ONLY',\n ),\n [fields],\n );\n\n const selectedFieldObj = useMemo(\n () =>\n fields.find(\n field => (field.filter_field_name ?? field.name) === selectedField,\n ),\n [fields, selectedField],\n );\n\n const isNumberField =\n selectedFieldObj?.type === 'DECIMAL' ||\n selectedFieldObj?.type === 'INTEGER';\n\n useEffect(() => {\n if (open) {\n setSelectedField(sort?.fieldName || '');\n setSelectedDirection(sort?.sortType || SortType.ASC);\n }\n }, [open, sort]);\n\n const handleApply = useCallback(() => {\n if (onSortChange) {\n if (!selectedField) {\n onSortChange(undefined);\n } else {\n onSortChange({\n fieldName: selectedField,\n sortType: selectedDirection,\n });\n }\n }\n onClose();\n }, [onSortChange, selectedField, selectedDirection, onClose]);\n\n const handleClear = useCallback(() => {\n if (!onSortChange) return;\n\n setSelectedField('');\n setSelectedDirection(SortType.ASC);\n\n onSortChange(undefined);\n onClose();\n }, [onSortChange, onClose]);\n\n return (\n <StyledDialog open={open} onClose={onClose} maxWidth=\"xs\" fullWidth>\n <StyledDialogTitle>\n <Typography variant=\"overline\" color=\"text.secondary\">\n Ordenar por\n </Typography>\n </StyledDialogTitle>\n <StyledDialogContent>\n <Stack spacing={2} pt={2}>\n <FormControl fullWidth size=\"small\">\n <InputLabel id=\"sort-field-label\">Campo</InputLabel>\n <Select\n labelId=\"sort-field-label\"\n value={selectedField}\n label=\"Campo\"\n onChange={e => setSelectedField(e.target.value)}\n >\n <MenuItem value=\"\">\n <em>Nenhum</em>\n </MenuItem>\n {sortableFields.map(field => (\n <MenuItem\n key={field.name}\n value={field.filter_field_name ?? field.name}\n >\n {field.description || field.name}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n <FormControl fullWidth size=\"small\" disabled={!selectedField}>\n <InputLabel id=\"sort-direction-label\">Direção</InputLabel>\n <Select\n labelId=\"sort-direction-label\"\n value={selectedDirection}\n label=\"Direção\"\n onChange={e => setSelectedDirection(e.target.value as SortType)}\n >\n <MenuItem value={SortType.ASC}>\n Crescente {isNumberField ? '(1-9)' : '(A-Z)'}\n </MenuItem>\n <MenuItem value={SortType.DESC}>\n Decrescente {isNumberField ? '(9-1)' : '(Z-A)'}\n </MenuItem>\n </Select>\n </FormControl>\n </Stack>\n </StyledDialogContent>\n <StyledDialogActions>\n <Stack flex={1} width=\"100%\" direction=\"row\">\n <Button color=\"inherit\" onClick={handleClear}>\n Limpar\n </Button>\n </Stack>\n <Button\n onClick={onClose}\n variant=\"outlined\"\n color=\"inherit\"\n sx={{ minWidth: 24 }}\n >\n <Icon icon=\"CANCEL_CIRCLE\" />\n <LabelButton>Cancelar</LabelButton>\n </Button>\n <ApplyButton onClick={handleApply} variant=\"contained\">\n <Icon icon=\"SIMPLE_CHECK\" />\n <LabelButton>Aplicar</LabelButton>\n </ApplyButton>\n </StyledDialogActions>\n </StyledDialog>\n );\n};\n\nSortModal.displayName = 'SortModal';\n\nexport default memo(SortModal);\n","import Button from '@mui/material/Button';\nimport Dialog from '@mui/material/Dialog';\nimport DialogActions from '@mui/material/DialogActions';\nimport DialogContent from '@mui/material/DialogContent';\nimport DialogTitle from '@mui/material/DialogTitle';\nimport { styled } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\n\nexport const StyledDialog = styled(Dialog)(() => ({\n '& .MuiDialog-paper': { width: '100%' },\n}));\n\nexport const StyledDialogTitle = styled(DialogTitle)(({ theme }) => ({\n borderBottom: '1px solid',\n borderColor: theme.palette.divider,\n padding: theme.spacing(1.5, 2),\n}));\n\nexport const StyledDialogContent = styled(DialogContent)(({ theme }) => ({\n padding: theme.spacing(2),\n}));\n\nexport const StyledDialogActions = styled(DialogActions)(({ theme }) => ({\n borderTop: '1px solid',\n borderColor: theme.palette.divider,\n padding: theme.spacing(1.5, 2),\n}));\n\nexport const ApplyButton = styled(Button)(({ theme }) => ({\n minWidth: 24,\n [theme.breakpoints.down(330)]: {\n padding: theme.spacing(1),\n },\n}));\n\nexport const LabelButton = styled(Typography)(({ theme }) => ({\n fontWeight: '600',\n margin: theme.spacing(0, 1),\n [theme.breakpoints.down(330)]: {\n fontSize: 0,\n margin: 0,\n },\n}));\n","import { useMemo } from 'react';\nimport type { GridColDef } from '@mui/x-data-grid-premium';\n\nimport { UseColumnOrderingParams } from '../props';\n\nexport const useColumnOrdering = ({\n columns,\n fields,\n preferredFieldOrder,\n}: UseColumnOrderingParams) => {\n const columnsByFieldId = useMemo(\n () => new Map(columns.map(column => [column.field, column])),\n [columns],\n );\n\n const fieldsByName = useMemo(\n () => new Map(fields?.map(f => [f.name, f]) || []),\n [fields],\n );\n\n const orderedColumns = useMemo(() => {\n if (!preferredFieldOrder || preferredFieldOrder.length === 0 || !fields) {\n return columns;\n }\n\n const actionFieldName = 'ACTIONS';\n const preferredWithoutActions = preferredFieldOrder.filter(\n fieldName => fieldName !== actionFieldName,\n );\n\n const usedColumnFieldIds = new Set<string>();\n const ordered: GridColDef[] = [];\n\n const pushColumnForField = (fieldName: string) => {\n const field = fieldsByName.get(fieldName);\n if (!field) return;\n\n const column = columnsByFieldId.get(field.name);\n\n if (!column || usedColumnFieldIds.has(field.name)) return;\n\n ordered.push(column);\n usedColumnFieldIds.add(field.name);\n };\n\n preferredWithoutActions.forEach(fieldName => {\n pushColumnForField(fieldName);\n });\n\n fields.forEach(field => {\n if (field.name === actionFieldName) return;\n if (preferredWithoutActions.includes(field.name)) return;\n\n const column = columnsByFieldId.get(field.name);\n\n if (!column || usedColumnFieldIds.has(field.name)) return;\n\n ordered.push(column);\n usedColumnFieldIds.add(field.name);\n });\n\n pushColumnForField(actionFieldName);\n\n return ordered.length === 0 ? columns : ordered;\n }, [columns, columnsByFieldId, fieldsByName, preferredFieldOrder, fields]);\n\n return { orderedColumns, columnsByFieldId, fieldsByName };\n};\n","import { useCallback, useMemo } from 'react';\nimport type { GridColumnVisibilityModel } from '@mui/x-data-grid-premium';\nimport { Field } from 'model/entity-metadata';\n\nimport useLocalStorage from 'hooks/useLocalStorage';\n\nimport { UseColumnVisibilityParams } from '../props';\n\nfunction getColumnFieldIdFromField(field: Field): string {\n return field.name;\n}\n\nexport const useColumnVisibility = ({\n fields,\n columnsByFieldId,\n defaultVisibleFieldNames,\n columnVisibilityStorageKey,\n onColumnVisibilityModelChange,\n}: UseColumnVisibilityParams) => {\n const hasStorageKey = Boolean(columnVisibilityStorageKey);\n\n const [storedVisibilityModel, setStoredVisibilityModel] = useLocalStorage<\n GridColumnVisibilityModel | undefined\n >(columnVisibilityStorageKey || '__dynamic-data-view:columns__', undefined, {\n initializeWithValue: hasStorageKey,\n });\n\n const initialState = useMemo(() => {\n if (!fields) return undefined;\n\n const visibilityModel: GridColumnVisibilityModel = {};\n\n fields.forEach(field => {\n const columnFieldId = getColumnFieldIdFromField(field);\n if (!columnsByFieldId.has(columnFieldId)) return;\n\n let visible: boolean | undefined;\n\n if (hasStorageKey && storedVisibilityModel) {\n const stored = storedVisibilityModel[columnFieldId];\n if (typeof stored === 'boolean') {\n visible = stored;\n }\n }\n\n if (\n visible === undefined &&\n defaultVisibleFieldNames &&\n defaultVisibleFieldNames.length > 0\n ) {\n visible = defaultVisibleFieldNames.includes(field.name);\n }\n\n if (typeof visible === 'boolean') {\n visibilityModel[columnFieldId] = visible;\n }\n });\n\n if (Object.keys(visibilityModel).length === 0) return undefined;\n\n return {\n columns: {\n columnVisibilityModel: visibilityModel,\n },\n };\n }, [\n columnsByFieldId,\n defaultVisibleFieldNames,\n fields,\n hasStorageKey,\n storedVisibilityModel,\n ]);\n\n const handleColumnVisibilityModelChange = useCallback(\n (model: GridColumnVisibilityModel) => {\n if (hasStorageKey) {\n const modelToSave = { ...model };\n // Prevents __check__ (checkboxSelection column) from being permanently hidden in local storage\n delete modelToSave['__check__'];\n setStoredVisibilityModel(modelToSave);\n }\n\n if (onColumnVisibilityModelChange) {\n onColumnVisibilityModelChange(model);\n }\n },\n [hasStorageKey, onColumnVisibilityModelChange, setStoredVisibilityModel],\n );\n\n return {\n initialState,\n handleColumnVisibilityModelChange,\n };\n};\n","import { useMemo } from 'react';\nimport { GridColDef } from '@mui/x-data-grid-premium';\n\nimport { Columns } from 'types/datagrid';\n\nimport { ACCESS_TYPES } from '../constants/columnDefaults';\nimport { UseDynamicColumnsProps } from '../props';\nimport { getColumnStrategy } from '../utils/columnStrategies';\n\nexport const useDynamicColumns = <T extends object>({\n metadata,\n renderCell,\n columnStrategies,\n}: UseDynamicColumnsProps<T>): Columns => {\n return useMemo(() => {\n if (!metadata?.fields) return [];\n\n const columnsMap = new Map<string, GridColDef>();\n\n const visibleFields = metadata.fields.filter(field => {\n if (\n field.access_type === ACCESS_TYPES.READ_ONLY ||\n field.access_type === ACCESS_TYPES.READ_AND_WRITE\n ) {\n return true;\n }\n\n return (\n field.name === 'ACTIONS' ||\n field.name === metadata?.id_field_name ||\n field.name === 'NAME'\n );\n });\n\n visibleFields.forEach(field => {\n if (columnsMap.has(field.name)) {\n return;\n }\n\n const strategy =\n columnStrategies?.[field.name] ?? getColumnStrategy<T>(field, metadata);\n const column = strategy(field, renderCell, metadata);\n\n columnsMap.set(field.name, column);\n });\n\n return Array.from(columnsMap.values());\n }, [columnStrategies, metadata, renderCell]);\n};\n","export const COLUMN_DEFAULTS = {\n IMAGE_WIDTH: 90,\n MIN_WIDTH: 130,\n ENTITY_MIN_WIDTH: 100,\n ENTITY_FLEX: 0.5,\n ID_MIN_WIDTH: 200,\n ID_FLEX: 1,\n ACTIONS_WIDTH: 80,\n} as const;\n\nexport const ACCESS_TYPES = {\n READ_ONLY: 'READ_ONLY',\n READ_AND_WRITE: 'READ_AND_WRITE',\n} as const;\n\nexport const CURRENCY_FIELD_NAMES: readonly string[] = [\n 'price',\n 'base_price',\n 'minimum_value',\n 'maximum_value',\n 'minimum_installment_value',\n];\n","import { GridColDef, GridRenderCellParams } from '@mui/x-data-grid-premium';\nimport { Field } from 'model/entity-metadata';\n\nimport { COLUMN_DEFAULTS } from '../constants/columnDefaults';\nimport { CellRenderer, ColumnStrategy, DynamicRowData } from '../props';\n\nconst createImageColumn = <T extends object>(\n field: Field,\n renderCell: CellRenderer<T>,\n): GridColDef => ({\n field: field.name,\n headerName: field.description,\n sortable: false,\n width: COLUMN_DEFAULTS.IMAGE_WIDTH,\n resizable: false,\n headerAlign: 'center',\n align: 'center',\n renderCell: (params: GridRenderCellParams) =>\n renderCell(field, params.row as DynamicRowData<T>),\n});\n\nconst createIdColumn = <T extends object>(\n field: Field,\n renderCell: CellRenderer<T>,\n): GridColDef => ({\n field: field.name,\n headerName: field.description,\n minWidth: COLUMN_DEFAULTS.ID_MIN_WIDTH,\n flex: COLUMN_DEFAULTS.ID_FLEX,\n renderCell: (params: GridRenderCellParams) =>\n renderCell(field, params.row as DynamicRowData<T>),\n});\n\nconst createEntityColumn = <T extends object>(\n field: Field,\n renderCell: CellRenderer<T>,\n): GridColDef => ({\n field: field.name,\n headerName: field.description,\n minWidth: COLUMN_DEFAULTS.ENTITY_MIN_WIDTH,\n flex: COLUMN_DEFAULTS.ENTITY_FLEX,\n renderCell: (params: GridRenderCellParams) =>\n renderCell(field, params.row as DynamicRowData<T>),\n});\n\nconst createDefaultColumn = <T extends object>(\n field: Field,\n renderCell: CellRenderer<T>,\n): GridColDef => ({\n field: field.name,\n headerName: field.description,\n minWidth: COLUMN_DEFAULTS.MIN_WIDTH,\n renderCell: (params: GridRenderCellParams) =>\n renderCell(field, params.row as DynamicRowData<T>),\n});\n\nconst createActionsColumn = <T extends object>(\n field: Field,\n renderCell: CellRenderer<T>,\n): GridColDef => ({\n field: field.name,\n headerName: 'Ações',\n width: COLUMN_DEFAULTS.ACTIONS_WIDTH,\n sortable: false,\n resizable: false,\n disableReorder: true,\n headerAlign: 'center',\n disableColumnMenu: true,\n align: 'center',\n renderCell: (params: GridRenderCellParams) =>\n renderCell(field, params.row as DynamicRowData<T>),\n});\n\nexport const getColumnStrategy = <T extends object>(\n field: Field,\n metadata?: { id_field_name?: string },\n): ColumnStrategy<T> => {\n if (field.name === metadata?.id_field_name || field.name === 'name') {\n return createIdColumn;\n }\n\n if (field.name === 'ACTIONS') {\n return createActionsColumn;\n }\n\n if (field.type === 'FILE') {\n return createImageColumn;\n }\n\n if (field.type === 'ENTITY') {\n return createEntityColumn;\n }\n\n return createDefaultColumn;\n};\n","import { useCallback, useRef, useState } from 'react';\nimport {\n type Filter,\n type FilterCondition,\n FilterOperator,\n} from 'model/filter';\n\nimport uuidv4 from 'utils/uuidv4';\n\nimport { UseFiltersProps, UseFiltersReturn } from '../props';\nimport {\n buildFilterFromConditions,\n getDefaultCondition,\n isValidCondition,\n} from '../utils/filter';\n\n// Converte filtro inicial em condições\nconst parseInitialConditions = (initialFilter?: Filter): FilterCondition[] => {\n if (!initialFilter?.groups?.[0]?.conditionals) return [];\n return initialFilter.groups[0].conditionals.map(cond => ({\n id: uuidv4(),\n operator: initialFilter.groups[0].operator,\n fieldName: cond.fieldName,\n conditional: cond.conditional,\n value: cond.value,\n }));\n};\n\n/**\n * Hook para gerenciar estado de filtros do DynamicDataView com condições dinâmicas\n *\n * - conditions: estado de edição (o que o usuário vê no popover)\n * - appliedConditions: estado aplicado (o que está efetivamente filtrando)\n * - hasActiveFilters/activeFiltersCount: calculados com base em appliedConditions\n */\nexport const useFilters = ({\n fields,\n initialFilter,\n}: UseFiltersProps): UseFiltersReturn => {\n const [isOpen, setIsOpen] = useState(false);\n\n // Estado aplicado (efetivamente filtrando)\n const [appliedConditions, setAppliedConditions] = useState<FilterCondition[]>(\n () => parseInitialConditions(initialFilter),\n );\n const [appliedFilter, setAppliedFilter] = useState<Filter | undefined>(\n initialFilter,\n );\n\n // Estado de edição (o que o usuário vê/edita no popover)\n const [conditions, setConditions] = useState<FilterCondition[]>(() =>\n parseInitialConditions(initialFilter),\n );\n\n // Referência para snapshot antes de abrir o popover\n const snapshotRef = useRef<FilterCondition[]>([]);\n\n const openDrawer = useCallback(() => {\n // Salva snapshot das condições atuais (aplicadas) ao abrir\n snapshotRef.current = appliedConditions.map(c => ({ ...c }));\n // Sincroniza edição com aplicado ao abrir\n setConditions(appliedConditions.map(c => ({ ...c })));\n setIsOpen(true);\n }, [appliedConditions]);\n\n const closeDrawer = () => setIsOpen(false);\n\n const addCondition = useCallback(() => {\n const filterableFields = fields.filter(\n f => f.available_filter_conditions?.length > 0,\n );\n if (filterableFields.length === 0) return;\n\n const usedFieldNames = conditions.map(c => c.fieldName);\n const availableFields = filterableFields.filter(\n f => !usedFieldNames.includes(f.filter_field_name ?? f.name),\n );\n if (availableFields.length === 0) return;\n\n const currentOperator =\n conditions.length > 0 ? conditions[0].operator : FilterOperator.AND;\n const firstField = availableFields[0];\n const newCondition: FilterCondition = {\n id: uuidv4(),\n operator: currentOperator,\n fieldName: firstField.filter_field_name ?? firstField.name,\n conditional: getDefaultCondition(firstField),\n value: [],\n };\n\n setConditions(prev => [...prev, newCondition]);\n }, [fields, conditions]);\n\n const updateCondition = useCallback(\n (id: string, changes: Partial<FilterCondition>) => {\n setConditions(prev => {\n const targetCondition = prev.find(c => c.id === id);\n if (!targetCondition) return prev;\n\n if (changes.operator && changes.operator !== targetCondition.operator) {\n const newOperator = changes.operator;\n return prev.map(c => {\n if (c.id === id) {\n return { ...c, ...changes };\n }\n return { ...c, operator: newOperator };\n });\n }\n\n return prev.map(c => (c.id === id ? { ...c, ...changes } : c));\n });\n },\n [],\n );\n\n const removeCondition = useCallback((id: string) => {\n setConditions(prev => prev.filter(c => c.id !== id));\n }, []);\n\n const clearAllFilters = () => {\n setConditions([]);\n setAppliedConditions([]);\n setAppliedFilter(undefined);\n };\n\n const applyFilters = () => {\n const filter = buildFilterFromConditions(conditions);\n setAppliedConditions(conditions.map(c => ({ ...c })));\n setAppliedFilter(filter);\n setIsOpen(false);\n return filter;\n };\n\n const cancelChanges = () => {\n // Reverte para o snapshot salvo ao abrir\n setConditions(snapshotRef.current.map(c => ({ ...c })));\n setIsOpen(false);\n };\n\n // Calculado com base nos filtros APLICADOS (não em edição)\n const hasActiveFilters = appliedConditions.some(isValidCondition);\n const activeFiltersCount = appliedConditions.filter(isValidCondition).length;\n\n return {\n conditions,\n filter: appliedFilter,\n isOpen,\n hasActiveFilters,\n activeFiltersCount,\n openDrawer,\n closeDrawer,\n addCondition,\n updateCondition,\n removeCondition,\n clearAllFilters,\n applyFilters,\n cancelChanges,\n };\n};\n\nexport default useFilters;\n","import { useCallback, useEffect, useState } from 'react';\nimport { Filter, Sort } from 'model/filter';\n\nconst getStoredValue = <T>(key: string): T | undefined => {\n try {\n const item = localStorage.getItem(key);\n return item ? JSON.parse(item) : undefined;\n } catch {\n return undefined;\n }\n};\n\nconst setStoredValue = <T>(key: string, value: T | undefined): void => {\n try {\n if (value === undefined) {\n localStorage.removeItem(key);\n } else {\n localStorage.setItem(key, JSON.stringify(value));\n }\n } catch {\n // Silently ignore localStorage errors\n }\n};\n\nexport const useFilterStorage = (\n storageKey: string,\n externalFilter?: Filter,\n onFilterChange?: (filter: Filter | undefined) => void,\n) => {\n const filterKey = `${storageKey}:filter`;\n\n const [internalFilter, setInternalFilter] = useState<Filter | undefined>(\n () => {\n return getStoredValue<Filter>(filterKey) || externalFilter;\n },\n );\n\n // Sync with external filter\n useEffect(() => {\n if (externalFilter !== undefined) {\n setInternalFilter(externalFilter);\n }\n }, [externalFilter]);\n\n const handleFilterChange = useCallback(\n (newFilter: Filter | undefined) => {\n setInternalFilter(newFilter);\n setStoredValue(filterKey, newFilter);\n onFilterChange?.(newFilter);\n },\n [filterKey, onFilterChange],\n );\n\n return {\n filter: internalFilter,\n setFilter: handleFilterChange,\n };\n};\n\nexport const useSortStorage = (\n storageKey: string,\n externalSort?: Sort,\n onSortChange?: (sort: Sort | undefined) => void,\n) => {\n const sortKey = `${storageKey}:sort`;\n\n const [internalSort, setInternalSort] = useState<Sort | undefined>(() => {\n return getStoredValue<Sort>(sortKey) || externalSort;\n });\n\n // Sync with external sort\n useEffect(() => {\n if (externalSort !== undefined) {\n setInternalSort(externalSort);\n }\n }, [externalSort]);\n\n const handleSortChange = useCallback(\n (newSort: Sort | undefined) => {\n setInternalSort(newSort);\n setStoredValue(sortKey, newSort);\n onSortChange?.(newSort);\n },\n [sortKey, onSortChange],\n );\n\n return {\n sort: internalSort,\n setSort: handleSortChange,\n };\n};\n","import { useCallback, useMemo } from 'react';\nimport type { GridSortModel } from '@mui/x-data-grid-premium';\nimport { Field } from 'model/entity-metadata';\nimport { Sort, SortType } from 'model/filter';\n\nimport { UseSortingParams } from '../props';\n\n/**\n * Mapeia field.name (coluna do DataGrid) → filter_field_name (campo da API).\n * Usado quando o usuário clica no header da coluna para ordenar.\n */\nconst resolveApiFieldName = (\n fields: Field[] | undefined,\n fieldName: string,\n): string => {\n if (!fields) return fieldName;\n const field = fields.find(f => f.name === fieldName);\n return field?.filter_field_name ?? fieldName;\n};\n\n/**\n * Mapeia filter_field_name (campo da API) → field.name (coluna do DataGrid).\n * Usado para o sortModel destacar a coluna correta na UI.\n */\nconst resolveColumnFieldName = (\n fields: Field[] | undefined,\n fieldName: string,\n): string => {\n if (!fields) return fieldName;\n const field = fields.find(\n f => f.filter_field_name === fieldName || f.name === fieldName,\n );\n return field?.name ?? fieldName;\n};\n\nexport const useSorting = ({\n sort,\n onSortChange,\n fields,\n}: UseSortingParams) => {\n const sortModel: GridSortModel = useMemo(() => {\n if (!sort) return [];\n return [\n {\n field: resolveColumnFieldName(fields, sort.fieldName),\n sort: sort.sortType.toLowerCase() as 'asc' | 'desc',\n },\n ];\n }, [sort, fields]);\n\n const handleSortModelChange = useCallback(\n (model: GridSortModel) => {\n if (!onSortChange) return;\n\n const firstItem = model[0];\n if (!firstItem || !firstItem.sort) {\n onSortChange(undefined);\n return;\n }\n\n const newSort: Sort = {\n fieldName: resolveApiFieldName(fields, firstItem.field),\n sortType: firstItem.sort.toUpperCase() as SortType,\n };\n onSortChange(newSort);\n },\n [onSortChange, fields],\n );\n\n return {\n sortModel,\n handleSortModelChange,\n };\n};\n","import {\n AccessType,\n DataType,\n EntityMetadataResponse,\n Field,\n} from 'model/entity-metadata';\n\nexport const createActionsField = (): Field => ({\n name: 'ACTIONS',\n description: '',\n filter_field_name: null,\n type: DataType.TEXT,\n metadata: null,\n access_type: AccessType.READ_ONLY,\n relation_field_name: null,\n available_filter_conditions: [],\n});\n\nexport const addActionsFieldToMetadata = (\n metadata: EntityMetadataResponse,\n): EntityMetadataResponse => {\n const hasActionsField = metadata.fields.some(\n field => field.name === 'ACTIONS',\n );\n\n if (hasActionsField) {\n return metadata;\n }\n\n return {\n ...metadata,\n fields: [...metadata.fields, createActionsField()],\n };\n};\n","import { memo, ReactNode } from 'react';\n\nimport { DatePickerFormat, fDate } from 'utils/formatTime';\n\nimport type { DateRendererProps } from './props';\n\nconst DateRenderer = ({ value, format }: DateRendererProps): ReactNode => {\n if (value === null || value === undefined) return '-';\n\n return fDate(value as DatePickerFormat, format);\n};\n\nexport default memo(DateRenderer);\n","import { memo, ReactNode } from 'react';\n\nimport { DatePickerFormat, fDateTime } from 'utils/formatTime';\n\nimport type { DateTimeRendererProps } from './props';\n\nconst DateTimeRenderer = ({\n value,\n format,\n}: DateTimeRendererProps): ReactNode => {\n if (value === null || value === undefined) return '-';\n\n return fDateTime(value as DatePickerFormat, format);\n};\n\nexport default memo(DateTimeRenderer);\n","import { memo, ReactNode } from 'react';\nimport Chip from '@mui/material/Chip';\n\nimport { EntityRendererProps } from './props';\n\nconst EntityRenderer = ({ value, field }: EntityRendererProps): ReactNode => {\n if (!field.metadata || typeof value !== 'object' || value === null) {\n return value ? String(value) : '-';\n }\n\n const entityValue = (value as Record<string, unknown>)[\n field.metadata.description_field_name\n ];\n\n if (!entityValue) return null;\n\n return (\n <Chip\n label={String(entityValue)}\n variant=\"outlined\"\n size=\"small\"\n sx={{\n width: 'fit-content',\n color: 'text.secondary',\n borderColor: 'divider',\n borderRadius: 3,\n }}\n />\n );\n};\n\nexport default memo(EntityRenderer);\n","import { memo, ReactNode } from 'react';\n\nimport Icon, { IconEnum } from '../../Icon';\n\nimport { IconRendererProps } from './props';\n\nconst IconRenderer = ({\n value,\n trueIcon = IconEnum.STAR_02,\n falseIcon = IconEnum.STAR,\n color = 'primary.main',\n width = 18,\n}: IconRendererProps): ReactNode => {\n return (\n <Icon icon={value ? trueIcon : falseIcon} color={color} width={width} />\n );\n};\n\nexport default memo(IconRenderer);\n","import { memo, ReactNode } from 'react';\n\nimport Icon from 'components/Icon';\n\nimport { ImageRendererProps } from './props';\nimport { ImageContainer } from './style';\n\nconst ImageRenderer = ({\n imageResourceId,\n getImageUrl,\n size = 48,\n alt = 'Imagem',\n onClick,\n sx,\n}: ImageRendererProps): ReactNode => {\n const hasImage = !!imageResourceId;\n const imageUrl =\n hasImage && getImageUrl ? getImageUrl(imageResourceId) : undefined;\n const clickable = !!onClick;\n\n return (\n <ImageContainer\n size={size}\n noImage={!hasImage}\n clickable={clickable}\n onClick={onClick}\n sx={sx}\n >\n {imageUrl ? (\n <img src={imageUrl} alt={alt} />\n ) : (\n <Icon\n icon=\"SEARCH_IMAGE\"\n width={Math.round(size / 2)}\n color=\"text.disabled\"\n />\n )}\n </ImageContainer>\n );\n};\n\nexport default memo(ImageRenderer);\n","import Box from '@mui/material/Box';\nimport { styled } from '@mui/material/styles';\n\n// StatusRenderer styles\nexport interface StatusLabelProps {\n isActive: boolean;\n}\n\nexport const StatusLabel = styled('span')<StatusLabelProps>(\n ({ theme, isActive }) => ({\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n padding: theme.spacing(0.2, 1),\n borderRadius: theme.shape.borderRadius,\n fontSize: '0.75rem',\n fontWeight: 600,\n width: 'fit-content',\n height: 'auto',\n lineHeight: '1.25rem',\n whiteSpace: 'nowrap',\n margin: 'auto',\n backgroundColor: isActive\n ? theme.palette.success.lighter || '#00A76F29'\n : theme.palette.warning.lighter || '#FF563029',\n color: isActive\n ? theme.palette.success.darker || '#007867'\n : theme.palette.warning.darker || '#B71D18',\n }),\n);\n\n// ImageRenderer styles\nexport interface ImageContainerProps {\n size: number;\n noImage: boolean;\n clickable: boolean;\n}\n\nexport const ImageContainer = styled(Box, {\n shouldForwardProp: prop =>\n !['size', 'noImage', 'clickable'].includes(prop as string),\n})<ImageContainerProps>(({ theme, size, noImage, clickable }) => ({\n width: size,\n height: size,\n minWidth: size,\n borderRadius: '50%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n overflow: 'hidden',\n cursor: clickable ? 'pointer' : 'default',\n transition: 'opacity 0.2s ease-in-out',\n color: theme.palette.text.disabled,\n ...(noImage && {\n border: `1px dashed ${theme.palette.divider}`,\n backgroundColor: theme.palette.grey[100],\n }),\n ...(clickable && {\n '&:hover': {\n opacity: 0.8,\n },\n }),\n '& img': {\n width: '100%',\n height: '100%',\n objectFit: 'cover',\n borderRadius: '50%',\n },\n [theme.breakpoints.down('sm')]: {\n justifyContent: 'flex-start',\n alignItems: 'flex-start',\n },\n}));\n","import { memo, ReactNode } from 'react';\nimport Stack from '@mui/material/Stack';\nimport Typography from '@mui/material/Typography';\n\nimport CopyButton from 'components/CopyButton';\n\nimport { NameRendererProps } from './props';\n\nconst NameRenderer = ({\n id,\n displayName,\n copyMessage = 'ID copiado!',\n}: NameRendererProps): ReactNode => {\n return (\n <Stack height={1} justifyContent=\"center\">\n <Typography variant=\"subtitle2\" noWrap title={displayName}>\n {displayName}\n </Typography>\n <Stack direction=\"row\" gap={1} alignItems=\"center\">\n <Typography color=\"grey.600\" variant=\"body2\" noWrap>\n ID: {id}\n </Typography>\n <CopyButton toCopy={id} message={copyMessage} />\n </Stack>\n </Stack>\n );\n};\n\nexport default memo(NameRenderer);\n","import { memo, ReactNode } from 'react';\nimport Stack from '@mui/material/Stack';\nimport Typography from '@mui/material/Typography';\n\nimport { fCurrencyBRL, fNumber } from 'utils/formatNumber';\n\nimport { NumberRendererProps } from './props';\n\nconst NumberRenderer = ({\n value,\n isCurrency = false,\n}: NumberRendererProps): ReactNode => {\n if (value === null || value === undefined) return '-';\n\n return (\n <Stack direction=\"row\" alignItems=\"center\" height=\"100%\">\n <Typography variant=\"body2\" noWrap width=\"fit-content\">\n {isCurrency ? fCurrencyBRL(Number(value)) : fNumber(Number(value))}\n </Typography>\n </Stack>\n );\n};\n\nexport default memo(NumberRenderer);\n","import { memo, ReactNode } from 'react';\n\nimport { StatusRendererProps } from './props';\nimport { StatusLabel } from './style';\n\nconst StatusRenderer = ({\n active,\n activeLabel = 'Ativo',\n inactiveLabel = 'Inativo',\n}: StatusRendererProps): ReactNode => {\n return (\n <StatusLabel isActive={active}>\n {active ? activeLabel : inactiveLabel}\n </StatusLabel>\n );\n};\n\nexport default memo(StatusRenderer);\n","import { memo, ReactNode } from 'react';\nimport Stack from '@mui/material/Stack';\nimport Typography from '@mui/material/Typography';\n\nimport CopyButton from 'components/CopyButton';\n\nimport { TextRendererProps } from './props';\n\nconst sanitizeHtml = (text: string): string => {\n const withoutTags = text.replace(/<[^>]*>/g, '');\n return (\n withoutTags\n .replace(/&nbsp;/g, ' ')\n .replace(/&amp;/g, '&')\n .replace(/&lt;/g, '<')\n .replace(/&gt;/g, '>')\n .replace(/&quot;/g, '\"')\n // prettier-ignore\n .replace(/&#39;/g, '\\'')\n .trim()\n );\n};\n\nconst TextRenderer = ({\n value,\n showCopyButton = false,\n copyMessage = 'Copiado',\n copyLabel,\n mask,\n}: TextRendererProps): ReactNode => {\n if (!value) return '-';\n\n const stringValue = String(value);\n const formattedValue = mask ? mask(stringValue) : sanitizeHtml(stringValue);\n\n if (showCopyButton) {\n return (\n <Stack direction=\"row\" gap={1} alignItems=\"center\">\n <Typography variant=\"body2\" noWrap>\n {formattedValue}\n </Typography>\n <CopyButton\n toCopy={stringValue}\n message={copyMessage}\n label={copyLabel}\n />\n </Stack>\n );\n }\n\n return formattedValue;\n};\n\nexport default memo(TextRenderer);\n","import { ReactNode } from 'react';\nimport { Field } from 'model/entity-metadata';\n\nimport { CURRENCY_FIELD_NAMES } from '../constants/columnDefaults';\nimport { CellRenderer, DynamicRowData } from '../props';\nimport {\n DateRenderer,\n DateTimeRenderer,\n EntityRenderer,\n NumberRenderer,\n StatusRenderer,\n TextRenderer,\n} from '../renderers';\n\nfunction getIsCurrency(fieldName: string): boolean {\n return CURRENCY_FIELD_NAMES.includes(fieldName);\n}\n\nexport const createCellRenderer = <T extends object = object>(context: {\n onRowAction?: (rowId: string, row: DynamicRowData<T>) => ReactNode;\n}): CellRenderer<T> => {\n const { onRowAction } = context;\n\n const CellRendererComponent = (\n field: Field,\n row: DynamicRowData<T>,\n ): ReactNode => {\n const value = row[field.name];\n\n if (field.name === 'ACTIONS') {\n return onRowAction?.(row.id, row);\n }\n\n switch (field.type) {\n case 'BOOLEAN':\n return (\n <StatusRenderer\n active={Boolean(value)}\n activeLabel=\"Ativo\"\n inactiveLabel=\"Inativo\"\n />\n );\n\n case 'DATE':\n return <DateRenderer value={value} />;\n\n case 'DATETIME':\n return <DateTimeRenderer value={value} />;\n\n case 'DECIMAL':\n case 'INTEGER':\n return (\n <NumberRenderer\n value={value}\n isCurrency={getIsCurrency(field.name)}\n />\n );\n\n case 'FILE':\n case 'ENTITY':\n return <EntityRenderer value={value} field={field} />;\n case 'TEXT':\n default:\n return <TextRenderer value={value} />;\n }\n };\n\n CellRendererComponent.displayName = 'CellRendererComponent';\n return CellRendererComponent;\n};\n","import { GridColumnVisibilityModel } from '@mui/x-data-grid-premium';\nimport { EntityMetadataResponse } from 'model/entity-metadata';\n\ninterface BuildVisibleFieldsParams {\n metadata?: EntityMetadataResponse;\n columnVisibilityModel?: GridColumnVisibilityModel;\n defaultVisibleFields?: string[];\n}\n\nexport const buildVisibleFields = ({\n metadata,\n columnVisibilityModel,\n defaultVisibleFields,\n}: BuildVisibleFieldsParams): string[] | undefined => {\n if (!metadata?.fields) return undefined;\n\n const allFields = metadata.fields.map(f => f.name);\n\n const visible = allFields.filter(fieldName => {\n if (fieldName === 'ACTIONS') return false;\n\n if (columnVisibilityModel) {\n return columnVisibilityModel[fieldName] !== false;\n }\n\n return defaultVisibleFields?.includes(fieldName) ?? true;\n });\n\n if (!defaultVisibleFields) return visible;\n\n return visible.sort((a, b) => {\n const indexA = defaultVisibleFields.indexOf(a);\n const indexB = defaultVisibleFields.indexOf(b);\n\n return indexA - indexB || 0;\n });\n};\n"]}
@@ -12,7 +12,6 @@ declare const useSnackbar: () => {
12
12
  custom: (jsx: (id: string | number) => react.ReactElement<any, string | react.JSXElementConstructor<any>>, data?: ExternalToast | undefined) => string | number;
13
13
  message: (message: string | number | boolean | react.ReactElement<any, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | react.ReactPortal | (() => ReactNode) | null | undefined, data?: ExternalToast | undefined) => string | number;
14
14
  promise: <ToastData>(promise: Promise<ToastData> | (() => Promise<ToastData>), data?: ({
15
- cancel?: ReactNode | sonner.Action;
16
15
  className?: string | undefined;
17
16
  style?: react.CSSProperties | undefined;
18
17
  position?: ("top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right") | undefined;
@@ -21,6 +20,7 @@ declare const useSnackbar: () => {
21
20
  icon?: ReactNode;
22
21
  duration?: number | undefined;
23
22
  onDismiss?: ((toast: sonner.ToastT) => void) | undefined;
23
+ cancel?: ReactNode | sonner.Action;
24
24
  richColors?: boolean | undefined;
25
25
  invert?: boolean | undefined;
26
26
  closeButton?: boolean | undefined;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as CustomShadows } from './index-c8f1e6e7.js';
2
- export { d as ColorType, k as action, j as background, l as basePalette, o as colorSchemes, h as common, c as components, a as createShadowColor, b as customShadows, n as darkPalette, r as defaultFont, f as error, g as grey, i as info, m as lightPalette, p as primary, u as primaryFont, s as secondary, v as secondaryFont, q as shadows, e as success, t as text, x as typography, w as warning } from './index-c8f1e6e7.js';
1
+ import { C as CustomShadows } from './index-5a5e5dc8.js';
2
+ export { d as ColorType, k as action, j as background, l as basePalette, o as colorSchemes, h as common, c as components, a as createShadowColor, b as customShadows, n as darkPalette, r as defaultFont, f as error, g as grey, i as info, m as lightPalette, p as primary, u as primaryFont, s as secondary, v as secondaryFont, q as shadows, e as success, t as text, x as typography, w as warning } from './index-5a5e5dc8.js';
3
3
  export { S as SettingsContextValue, _ as SettingsProvider, T as ThemeProviderProps, u as useSettingsContext } from './settings-provider-38d09283.js';
4
4
  export { THEME_CONFIG, default as ThemeProvider } from './theme/theme-provider.js';
5
5
  import { S as SettingsState } from './settings-583c107c.js';
@@ -1,4 +1,4 @@
1
- export { d as ColorType, k as action, j as background, l as basePalette, o as colorSchemes, h as common, c as components, a as createShadowColor, b as customShadows, n as darkPalette, r as defaultFont, f as error, g as grey, i as info, m as lightPalette, p as primary, u as primaryFont, s as secondary, v as secondaryFont, q as shadows, e as success, t as text, x as typography, w as warning } from '../../index-c8f1e6e7.js';
1
+ export { d as ColorType, k as action, j as background, l as basePalette, o as colorSchemes, h as common, c as components, a as createShadowColor, b as customShadows, n as darkPalette, r as defaultFont, f as error, g as grey, i as info, m as lightPalette, p as primary, u as primaryFont, s as secondary, v as secondaryFont, q as shadows, e as success, t as text, x as typography, w as warning } from '../../index-5a5e5dc8.js';
2
2
  import '@mui/lab/TimelineConnector';
3
3
  import '@mui/system';
4
4
  import '@mui/lab/TimelineDot';
@@ -173,7 +173,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
173
173
  float?: csstype.Property.Float | readonly NonNullable<csstype.Property.Float | undefined>[] | readonly csstype.Property.Float[] | undefined;
174
174
  floodColor?: readonly string[] | csstype.Property.FloodColor | readonly csstype.Property.FloodColor[] | undefined;
175
175
  floodOpacity?: readonly ((string & {}) | csstype.Globals)[] | csstype.Property.FloodOpacity | readonly NonNullable<csstype.Property.FloodOpacity | undefined>[] | undefined;
176
- fontFamily?: readonly string[] | csstype.Property.FontFamily | readonly csstype.Property.FontFamily[] | undefined;
176
+ fontFamily?: csstype.Property.FontFamily | readonly string[] | readonly csstype.Property.FontFamily[] | undefined;
177
177
  fontFeatureSettings?: readonly string[] | csstype.Property.FontFeatureSettings | readonly csstype.Property.FontFeatureSettings[] | undefined;
178
178
  fontKerning?: csstype.Property.FontKerning | readonly NonNullable<csstype.Property.FontKerning | undefined>[] | readonly csstype.Property.FontKerning[] | undefined;
179
179
  fontLanguageOverride?: readonly string[] | csstype.Property.FontLanguageOverride | readonly csstype.Property.FontLanguageOverride[] | undefined;
@@ -197,7 +197,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
197
197
  fontVariantNumeric?: readonly string[] | csstype.Property.FontVariantNumeric | readonly csstype.Property.FontVariantNumeric[] | undefined;
198
198
  fontVariantPosition?: csstype.Property.FontVariantPosition | readonly NonNullable<csstype.Property.FontVariantPosition | undefined>[] | readonly csstype.Property.FontVariantPosition[] | undefined;
199
199
  fontVariationSettings?: readonly string[] | csstype.Property.FontVariationSettings | readonly csstype.Property.FontVariationSettings[] | undefined;
200
- fontWeight?: csstype.Property.FontWeight | readonly NonNullable<csstype.Property.FontWeight | undefined>[] | readonly ("bold" | (string & {}) | csstype.Globals | "normal" | "bolder" | "lighter")[] | undefined;
200
+ fontWeight?: csstype.Property.FontWeight | readonly NonNullable<csstype.Property.FontWeight | undefined>[] | readonly ((string & {}) | csstype.Globals | "bold" | "normal" | "bolder" | "lighter")[] | undefined;
201
201
  fontWidth?: readonly string[] | csstype.Property.FontWidth | readonly csstype.Property.FontWidth[] | undefined;
202
202
  forcedColorAdjust?: csstype.Property.ForcedColorAdjust | readonly NonNullable<csstype.Property.ForcedColorAdjust | undefined>[] | readonly csstype.Property.ForcedColorAdjust[] | undefined;
203
203
  gridAutoColumns?: readonly (string | (string & {}))[] | csstype.Property.GridAutoColumns<string | number> | readonly NonNullable<csstype.Property.GridAutoColumns<string | number> | undefined>[] | undefined;
@@ -460,9 +460,9 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
460
460
  x?: readonly (string | (string & {}))[] | csstype.Property.X<string | number> | readonly NonNullable<csstype.Property.X<string | number> | undefined>[] | undefined;
461
461
  y?: readonly (string | (string & {}))[] | csstype.Property.Y<string | number> | readonly NonNullable<csstype.Property.Y<string | number> | undefined>[] | undefined;
462
462
  zIndex?: readonly ((string & {}) | csstype.Globals | "auto")[] | csstype.Property.ZIndex | readonly NonNullable<csstype.Property.ZIndex | undefined>[] | undefined;
463
- zoom?: csstype.Property.Zoom | readonly NonNullable<csstype.Property.Zoom | undefined>[] | readonly ("reset" | (string & {}) | csstype.Globals | "normal")[] | undefined;
463
+ zoom?: csstype.Property.Zoom | readonly NonNullable<csstype.Property.Zoom | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reset")[] | undefined;
464
464
  all?: csstype.Globals | readonly NonNullable<csstype.Globals | undefined>[] | readonly csstype.Globals[] | undefined;
465
- animation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ("reverse" | (string & {}) | csstype.Globals | "none" | "auto" | "normal" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
465
+ animation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reverse" | "none" | "auto" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
466
466
  animationRange?: readonly (string | (string & {}))[] | csstype.Property.AnimationRange<string | number> | readonly NonNullable<csstype.Property.AnimationRange<string | number> | undefined>[] | undefined;
467
467
  background?: readonly (string | (string & {}))[] | csstype.Property.Background<string | number> | readonly NonNullable<csstype.Property.Background<string | number> | undefined>[] | undefined;
468
468
  border?: readonly (string | (string & {}))[] | csstype.Property.Border<string | number> | readonly NonNullable<csstype.Property.Border<string | number> | undefined>[] | undefined;
@@ -474,7 +474,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
474
474
  borderBlockWidth?: readonly (string | (string & {}))[] | csstype.Property.BorderBlockWidth<string | number> | readonly NonNullable<csstype.Property.BorderBlockWidth<string | number> | undefined>[] | undefined;
475
475
  borderBottom?: readonly (string | (string & {}))[] | csstype.Property.BorderBottom<string | number> | readonly NonNullable<csstype.Property.BorderBottom<string | number> | undefined>[] | undefined;
476
476
  borderColor?: readonly string[] | csstype.Property.BorderColor | readonly csstype.Property.BorderColor[] | undefined;
477
- borderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "stretch")[] | undefined;
477
+ borderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "none" | "round" | "space" | "stretch")[] | undefined;
478
478
  borderInline?: readonly (string | (string & {}))[] | csstype.Property.BorderInline<string | number> | readonly NonNullable<csstype.Property.BorderInline<string | number> | undefined>[] | undefined;
479
479
  borderInlineColor?: readonly string[] | csstype.Property.BorderInlineColor | readonly csstype.Property.BorderInlineColor[] | undefined;
480
480
  borderInlineEnd?: readonly (string | (string & {}))[] | csstype.Property.BorderInlineEnd<string | number> | readonly NonNullable<csstype.Property.BorderInlineEnd<string | number> | undefined>[] | undefined;
@@ -509,7 +509,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
509
509
  marginBlock?: readonly (string | (string & {}))[] | csstype.Property.MarginBlock<string | number> | readonly NonNullable<csstype.Property.MarginBlock<string | number> | undefined>[] | undefined;
510
510
  marginInline?: readonly (string | (string & {}))[] | csstype.Property.MarginInline<string | number> | readonly NonNullable<csstype.Property.MarginInline<string | number> | undefined>[] | undefined;
511
511
  mask?: readonly (string | (string & {}))[] | csstype.Property.Mask<string | number> | readonly NonNullable<csstype.Property.Mask<string | number> | undefined>[] | undefined;
512
- maskBorder?: csstype.Property.MaskBorder | readonly NonNullable<csstype.Property.MaskBorder | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "alpha" | "luminance" | "stretch")[] | undefined;
512
+ maskBorder?: csstype.Property.MaskBorder | readonly NonNullable<csstype.Property.MaskBorder | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "none" | "round" | "space" | "alpha" | "luminance" | "stretch")[] | undefined;
513
513
  motion?: readonly (string | (string & {}))[] | csstype.Property.Offset<string | number> | readonly NonNullable<csstype.Property.Offset<string | number> | undefined>[] | undefined;
514
514
  offset?: readonly (string | (string & {}))[] | csstype.Property.Offset<string | number> | readonly NonNullable<csstype.Property.Offset<string | number> | undefined>[] | undefined;
515
515
  outline?: readonly (string | (string & {}))[] | csstype.Property.Outline<string | number> | readonly NonNullable<csstype.Property.Outline<string | number> | undefined>[] | undefined;
@@ -758,8 +758,8 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
758
758
  WebkitUserModify?: csstype.Property.WebkitUserModify | readonly NonNullable<csstype.Property.WebkitUserModify | undefined>[] | readonly csstype.Property.WebkitUserModify[] | undefined;
759
759
  WebkitUserSelect?: csstype.Property.WebkitUserSelect | readonly NonNullable<csstype.Property.WebkitUserSelect | undefined>[] | readonly csstype.Property.WebkitUserSelect[] | undefined;
760
760
  WebkitWritingMode?: csstype.Property.WritingMode | readonly NonNullable<csstype.Property.WritingMode | undefined>[] | readonly csstype.Property.WritingMode[] | undefined;
761
- MozAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ("reverse" | (string & {}) | csstype.Globals | "none" | "auto" | "normal" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
762
- MozBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "stretch")[] | undefined;
761
+ MozAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reverse" | "none" | "auto" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
762
+ MozBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "none" | "round" | "space" | "stretch")[] | undefined;
763
763
  MozColumnRule?: readonly (string | (string & {}))[] | csstype.Property.ColumnRule<string | number> | readonly NonNullable<csstype.Property.ColumnRule<string | number> | undefined>[] | undefined;
764
764
  MozColumns?: readonly (string | (string & {}))[] | csstype.Property.Columns<string | number> | readonly NonNullable<csstype.Property.Columns<string | number> | undefined>[] | undefined;
765
765
  MozOutlineRadius?: readonly (string | (string & {}))[] | csstype.Property.MozOutlineRadius<string | number> | readonly NonNullable<csstype.Property.MozOutlineRadius<string | number> | undefined>[] | undefined;
@@ -771,16 +771,16 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
771
771
  msScrollSnapX?: readonly string[] | csstype.Property.MsScrollSnapX | readonly csstype.Property.MsScrollSnapX[] | undefined;
772
772
  msScrollSnapY?: readonly string[] | csstype.Property.MsScrollSnapY | readonly csstype.Property.MsScrollSnapY[] | undefined;
773
773
  msTransition?: readonly string[] | csstype.Property.Transition<string & {}> | readonly csstype.Property.Transition<string & {}>[] | undefined;
774
- WebkitAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ("reverse" | (string & {}) | csstype.Globals | "none" | "auto" | "normal" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
774
+ WebkitAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reverse" | "none" | "auto" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
775
775
  WebkitBorderBefore?: readonly (string | (string & {}))[] | csstype.Property.WebkitBorderBefore<string | number> | readonly NonNullable<csstype.Property.WebkitBorderBefore<string | number> | undefined>[] | undefined;
776
- WebkitBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "stretch")[] | undefined;
776
+ WebkitBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "none" | "round" | "space" | "stretch")[] | undefined;
777
777
  WebkitBorderRadius?: readonly (string | (string & {}))[] | csstype.Property.BorderRadius<string | number> | readonly NonNullable<csstype.Property.BorderRadius<string | number> | undefined>[] | undefined;
778
778
  WebkitColumnRule?: readonly (string | (string & {}))[] | csstype.Property.ColumnRule<string | number> | readonly NonNullable<csstype.Property.ColumnRule<string | number> | undefined>[] | undefined;
779
779
  WebkitColumns?: readonly (string | (string & {}))[] | csstype.Property.Columns<string | number> | readonly NonNullable<csstype.Property.Columns<string | number> | undefined>[] | undefined;
780
780
  WebkitFlex?: readonly (string | (string & {}))[] | csstype.Property.Flex<string | number> | readonly NonNullable<csstype.Property.Flex<string | number> | undefined>[] | undefined;
781
781
  WebkitFlexFlow?: readonly string[] | csstype.Property.FlexFlow | readonly csstype.Property.FlexFlow[] | undefined;
782
782
  WebkitMask?: readonly (string | (string & {}))[] | csstype.Property.WebkitMask<string | number> | readonly NonNullable<csstype.Property.WebkitMask<string | number> | undefined>[] | undefined;
783
- WebkitMaskBoxImage?: csstype.Property.MaskBorder | readonly NonNullable<csstype.Property.MaskBorder | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "alpha" | "luminance" | "stretch")[] | undefined;
783
+ WebkitMaskBoxImage?: csstype.Property.MaskBorder | readonly NonNullable<csstype.Property.MaskBorder | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "none" | "round" | "space" | "alpha" | "luminance" | "stretch")[] | undefined;
784
784
  WebkitTextEmphasis?: readonly string[] | csstype.Property.TextEmphasis | readonly csstype.Property.TextEmphasis[] | undefined;
785
785
  WebkitTextStroke?: readonly (string | (string & {}))[] | csstype.Property.WebkitTextStroke<string | number> | readonly NonNullable<csstype.Property.WebkitTextStroke<string | number> | undefined>[] | undefined;
786
786
  WebkitTransition?: readonly string[] | csstype.Property.Transition<string & {}> | readonly csstype.Property.Transition<string & {}>[] | undefined;
@@ -861,7 +861,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
861
861
  MozUserFocus?: csstype.Property.MozUserFocus | readonly NonNullable<csstype.Property.MozUserFocus | undefined>[] | readonly csstype.Property.MozUserFocus[] | undefined;
862
862
  MozUserInput?: csstype.Property.MozUserInput | readonly NonNullable<csstype.Property.MozUserInput | undefined>[] | readonly csstype.Property.MozUserInput[] | undefined;
863
863
  msImeMode?: csstype.Property.ImeMode | readonly NonNullable<csstype.Property.ImeMode | undefined>[] | readonly csstype.Property.ImeMode[] | undefined;
864
- OAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ("reverse" | (string & {}) | csstype.Globals | "none" | "auto" | "normal" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
864
+ OAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reverse" | "none" | "auto" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
865
865
  OAnimationDelay?: readonly string[] | csstype.Property.AnimationDelay<string & {}> | readonly csstype.Property.AnimationDelay<string & {}>[] | undefined;
866
866
  OAnimationDirection?: readonly string[] | csstype.Property.AnimationDirection | readonly csstype.Property.AnimationDirection[] | undefined;
867
867
  OAnimationDuration?: readonly string[] | csstype.Property.AnimationDuration<string & {}> | readonly csstype.Property.AnimationDuration<string & {}>[] | undefined;
@@ -871,7 +871,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
871
871
  OAnimationPlayState?: readonly string[] | csstype.Property.AnimationPlayState | readonly csstype.Property.AnimationPlayState[] | undefined;
872
872
  OAnimationTimingFunction?: readonly string[] | csstype.Property.AnimationTimingFunction | readonly csstype.Property.AnimationTimingFunction[] | undefined;
873
873
  OBackgroundSize?: readonly (string | (string & {}))[] | csstype.Property.BackgroundSize<string | number> | readonly NonNullable<csstype.Property.BackgroundSize<string | number> | undefined>[] | undefined;
874
- OBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "stretch")[] | undefined;
874
+ OBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "none" | "round" | "space" | "stretch")[] | undefined;
875
875
  OObjectFit?: csstype.Property.ObjectFit | readonly NonNullable<csstype.Property.ObjectFit | undefined>[] | readonly csstype.Property.ObjectFit[] | undefined;
876
876
  OObjectPosition?: readonly (string | (string & {}))[] | csstype.Property.ObjectPosition<string | number> | readonly NonNullable<csstype.Property.ObjectPosition<string | number> | undefined>[] | undefined;
877
877
  OTabSize?: readonly (string | (string & {}))[] | csstype.Property.TabSize<string | number> | readonly NonNullable<csstype.Property.TabSize<string | number> | undefined>[] | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zydon/common",
3
- "version": "2.8.82",
3
+ "version": "2.8.83",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
@@ -286,13 +286,10 @@ declare const components: {
286
286
  MuiTimelineDot: {
287
287
  defaultProps?: Partial<_mui_lab_TimelineDot.TimelineDotProps> | undefined;
288
288
  styleOverrides?: Partial<_mui_material_styles_overrides.OverridesStyleRules<keyof _mui_lab_TimelineDot.TimelineDotClasses, "MuiTimelineDot", {
289
- cssVarPrefix: string;
290
- zIndex: _mui_material.ZIndex;
291
- direction: _mui_system.Direction;
292
- opacity: _mui_material.Opacity;
293
- typography: _mui_material.TypographyVariants;
289
+ transitions: _mui_material.Transitions;
294
290
  palette: _mui_material.Palette;
295
291
  colorSchemes: Record<_mui_material.SupportedColorScheme, _mui_material.ColorSystem>;
292
+ cssVarPrefix: string;
296
293
  vars: _mui_material.ThemeVars;
297
294
  getCssVar: (field: _mui_material.ThemeCssVar, ...vars: _mui_material.ThemeCssVar[]) => string;
298
295
  getColorSchemeSelector: (colorScheme: _mui_material.SupportedColorScheme) => string;
@@ -303,13 +300,16 @@ declare const components: {
303
300
  spacing: _mui_system.Spacing;
304
301
  breakpoints: _mui_system.Breakpoints;
305
302
  shape: _mui_system.Shape;
306
- transitions: _mui_material.Transitions;
303
+ typography: _mui_material.TypographyVariants;
307
304
  shadows: _mui_material.Shadows;
308
305
  mixins: _mui_material.Mixins;
306
+ zIndex: _mui_material.ZIndex;
307
+ direction: _mui_system.Direction;
309
308
  shouldSkipGeneratingVar: (keys: string[], value: string | number) => boolean;
310
309
  unstable_sxConfig: _mui_system.SxConfig;
311
310
  unstable_sx: (props: _mui_system.SxProps<_mui_material.Theme>) => _mui_styled_engine.CSSObject;
312
311
  applyStyles: _mui_system.ApplyStyles<"light" | "dark">;
312
+ opacity: _mui_material.Opacity;
313
313
  overlays: _mui_material.Overlays;
314
314
  customShadows: CustomShadows;
315
315
  unstable_strictMode?: boolean | undefined;
@@ -326,13 +326,10 @@ declare const components: {
326
326
  MuiTimelineConnector: {
327
327
  defaultProps?: Partial<_mui_lab_TimelineConnector.TimelineConnectorProps> | undefined;
328
328
  styleOverrides?: Partial<_mui_material_styles_overrides.OverridesStyleRules<"root", "MuiTimelineConnector", {
329
- cssVarPrefix: string;
330
- zIndex: _mui_material.ZIndex;
331
- direction: _mui_system.Direction;
332
- opacity: _mui_material.Opacity;
333
- typography: _mui_material.TypographyVariants;
329
+ transitions: _mui_material.Transitions;
334
330
  palette: _mui_material.Palette;
335
331
  colorSchemes: Record<_mui_material.SupportedColorScheme, _mui_material.ColorSystem>;
332
+ cssVarPrefix: string;
336
333
  vars: _mui_material.ThemeVars;
337
334
  getCssVar: (field: _mui_material.ThemeCssVar, ...vars: _mui_material.ThemeCssVar[]) => string;
338
335
  getColorSchemeSelector: (colorScheme: _mui_material.SupportedColorScheme) => string;
@@ -343,13 +340,16 @@ declare const components: {
343
340
  spacing: _mui_system.Spacing;
344
341
  breakpoints: _mui_system.Breakpoints;
345
342
  shape: _mui_system.Shape;
346
- transitions: _mui_material.Transitions;
343
+ typography: _mui_material.TypographyVariants;
347
344
  shadows: _mui_material.Shadows;
348
345
  mixins: _mui_material.Mixins;
346
+ zIndex: _mui_material.ZIndex;
347
+ direction: _mui_system.Direction;
349
348
  shouldSkipGeneratingVar: (keys: string[], value: string | number) => boolean;
350
349
  unstable_sxConfig: _mui_system.SxConfig;
351
350
  unstable_sx: (props: _mui_system.SxProps<_mui_material.Theme>) => _mui_styled_engine.CSSObject;
352
351
  applyStyles: _mui_system.ApplyStyles<"light" | "dark">;
352
+ opacity: _mui_material.Opacity;
353
353
  overlays: _mui_material.Overlays;
354
354
  customShadows: CustomShadows;
355
355
  unstable_strictMode?: boolean | undefined;