@zydon/common-csr 2.0.20 → 2.0.21

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.
@@ -1251,7 +1251,7 @@ var st=a((ot,Re)=>{(function(){var L="ace",T=function(){return this}();if(!T&&ty
1251
1251
  .ace-chrome .ace_indent-guide-active {
1252
1252
  background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;
1253
1253
  }
1254
- `;});ace.define("ace/theme/chrome",["require","exports","module","ace/theme/chrome-css","ace/lib/dom"],function(L,T,H){T.isDark=!1,T.cssClass="ace-chrome",T.cssText=L("./chrome-css");var E=L("../lib/dom");E.importCssString(T.cssText,T.cssClass,!1);});(function(){ace.require(["ace/theme/chrome"],function(L){typeof De=="object"&&typeof ut=="object"&&De&&(De.exports=L);});})();});var Ee=styled(ke)(({theme:L})=>({borderBottom:`1px solid ${alpha(L.palette.grey[500],.32)}`,borderTop:`1px solid ${alpha(L.palette.grey[500],.32)}`,padding:16})),qe=styled(ke)(({theme:L})=>({border:`1px solid ${alpha(L.palette.grey[500],.32)}`,borderRadius:8,padding:12,"& .MuiInputBase-root":{background:L.palette.grey[100]}})),et=styled(ke)(({theme:L})=>({display:"flex",textAlign:"center",flexDirection:"row",alignItems:"center",width:"100%",gap:8,height:34,backgroundColor:"#fff",padding:"8px 16px",borderRadius:8,border:`1px solid ${alpha(L.palette.grey[500],.24)}`,cursor:"pointer",color:L.palette.text.disabled,"&:hover, &:focus":{border:`1px solid ${L.palette.primary.main}`,backgroundColor:alpha(L.palette.primary.main,.05)}})),tt=styled(ke)(({theme:L})=>({width:"100%","& fieldset":{border:`1px solid ${alpha(L.palette.grey[500],.24)}`,borderRadius:8,"& legend":{color:L.palette.text.disabled,fontSize:12}}})),Be=styled(Dt)({padding:0});var Pt=({openPopover:L,handleClose:T,argumentsValues:H,filter:E,onExecute:x})=>{let[M,s]=useState([]),l=(t,i)=>{if(i&&i!=="")M.filter(e=>e.name===t).length>0?s(M.map(e=>e.name===t?{name:t,value:i}:e)):s([...M||[],{name:t,value:i}]);else {let n=M.filter(e=>e.name===t);s(n);}},r=()=>{let t=E||"";return M.forEach(i=>{t=t.replace(`$ARG[${i.name}]`,`'${i.value}'`);}),t};return jsxs(Ot,{open:!!L,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:L,onClose:T,title:"Pr\xE9-visualizar",children:[jsx(mt,{variant:"subtitle1",color:"text.primary",p:1,children:"Pr\xE9-visualizar"}),jsx(Ee,{children:H?.map((t,i)=>jsx(Wt,{name:t,label:t,size:"small",onChange:n=>l(t,n.target.value),required:!0},i))}),jsxs(ke,{p:2,direction:"row",justifyContent:"flex-end",spacing:1,children:[jsx(it,{variant:"outlined",color:"inherit",size:"small",onClick:T,children:"Cancelar"}),jsx(it,{variant:"contained",color:"primary",size:"small",startIcon:jsx(ze,{icon:"PLAY_SIMPLE"}),onClick:()=>x(r()),disabled:M.length<H.length,children:"Executar"})]})]})},rt=Pt;b(st());b(lt());b(ht());b(dt());var Yt=({openPopover:L,handleClose:T,addItem:H})=>{let[E,x]=useState("");return jsxs(Ot,{open:!!L,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:L,onClose:T,sx:{maxWidth:464},title:"Novo Argumento",children:[jsx(mt,{variant:"subtitle1",color:"text.primary",p:1,children:"Novo Argumento"}),jsx(Ee,{children:jsx(Wt,{value:E,onChange:s=>x(s.target.value),name:"item",label:"Novo argumento",size:"small"})}),jsxs(ke,{p:1,direction:"row",justifyContent:"flex-end",spacing:1,children:[jsx(it,{variant:"outlined",color:"inherit",size:"small",onClick:T,children:"Cancelar"}),jsx(it,{variant:"contained",color:"primary",size:"small",startIcon:jsx(ze,{icon:"SAVE_MARK"}),disabled:!E||E==="",onClick:()=>{H(E),T(),x("");},children:"Salvar"})]})]})},gt=Yt;var qt=({label:L,itens:T,argumentsValues:H,fields:E,addItem:x,removeItem:M,insertItemSQL:s})=>{let[l,r]=useState(!1),t=Jt(),i=()=>{r(!l);},n=(o,a)=>{o.stopPropagation(),M&&M(a);},e=o=>{s(H?` $ARG[${o}]`:E?` this.${o}`:` ${o}`);};return jsxs(ke,{children:[jsxs(ke,{direction:"row",alignItems:"center",spacing:1.5,padding:1,paddingLeft:0,children:[jsx(Be,{edge:"end",onClick:i,children:jsx(ze,{icon:l?"CHEVRON_UP":"CHEVRON_RIGHT"})}),jsx(mt,{variant:"overline",color:"text.primary",children:L}),x&&jsxs(Fragment,{children:[jsx(Be,{edge:"end",onClick:t.onOpen,children:jsx(ze,{icon:"SIMPLE_ADD"})}),jsx(gt,{addItem:x,handleClose:t.onClose,openPopover:t.open})]})]}),l&&jsx(ke,{spacing:.5,children:jsx(Xt,{sx:{maxHeight:150},children:T?.map((o,a)=>jsxs(et,{direction:"row",justifyContent:"space-between",onClick:()=>e(o),children:[jsx(mt,{variant:"caption",textAlign:"center",width:"100%",children:o}),M&&jsx(Dt,{edge:"end",onClick:u=>n(u,o),children:jsx(ze,{icon:"DELETE_MARK_BUTTON_02"})})]},a))})})]})},xe=qt;var oi=({fieldsSelect:L,argumentsValues:T,onChangeArguments:H,sql:E,setSql:x,setFilterRule:M})=>{let[s,l]=useState(),{setValue:r}=useFormContext(),[t,i]=useState(1),[n,e]=useState(),o=m=>{n.session.insert(t,` ${m} `);},a=m=>{H([...T||[],m]);},u=m=>{H(T?.filter($=>$!==m));},y=m=>{x(m[0]),M(m[0]),r("groups",void 0);},S=s?L.filter(m=>m.id.toString().toLocaleLowerCase().includes(s)||m.description.toString().toLocaleLowerCase().includes(s)||m.name?.toString().toLocaleLowerCase().includes(s)):L;return jsxs(ke,{direction:"row",padding:1.5,spacing:1.5,children:[jsxs(qe,{children:[jsx(ni,{value:s,trigger:"change",onSearch:m=>l(m?.toLocaleLowerCase()),fullWidth:!0,size:"small",placeholder:"Buscar",iconPosition:"start"}),jsx(xe,{label:"Campos",fields:!0,itens:S.map(m=>m.name),insertItemSQL:o}),jsx(xe,{label:"Argumentos",argumentsValues:!0,itens:T,addItem:a,removeItem:u,insertItemSQL:o}),jsx(xe,{label:"Operadores",insertItemSQL:o,itens:["=",">","<","<=",">=","!=","IS NULL","IN","LIKE","NOT IN","NOT LIKE","IS NOT NULL"]}),jsx(xe,{label:"Filtros",fields:!0,insertItemSQL:o,itens:S.map(m=>m.name)})]}),jsx(tt,{children:jsxs("fieldset",{children:[jsx("legend",{children:"Regras de listagem"}),jsx(ti,{width:"100%",mode:"sql",theme:"chrome",name:"rule",fontSize:14,onChange:y,onCursorChange:m=>i(m.getCursor()),value:E,onLoad:m=>e(m),showPrintMargin:!1,showGutter:!1,highlightActiveLine:!1,setOptions:{enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,enableSnippets:!0,showLineNumbers:!1,tabSize:2}})]})})]})},vt=oi;var li=({data:L,fields:T,isLoading:H,isError:E})=>jsxs(ke,{children:[jsx(mt,{variant:"subtitle2",color:"text.secondary",children:"PR\xC9 VISUALIZA\xC7\xC3O DOS RESULTADOS DA LISTAGEM"}),E&&jsx(ke,{children:"Falha ao gerar resultado"}),L&&jsx(ai,{columns:T?.map(x=>({field:x,headerName:x,width:150,type:"string"})),loading:H,rows:L,disableRowSelectionOnClick:!0,disableColumnMenu:!0,disableColumnResize:!0,showColumnVerticalBorder:!0,hideFooter:!0})]}),wt=li;var $t=styled(ke)(({theme:L})=>({border:`1px solid ${alpha(L.palette.primary.main,.32)}`,backgroundColor:alpha(L.palette.primary.main,.08),borderRadius:8,padding:8,paddingLeft:24,alignItems:"center"})),Ct=styled(Dt)(()=>({height:"28px",marginLeft:"16px","&:hover":{backgroundColor:"transparent"}})),Oe=styled(Fe)(()=>({width:230}));var vi=({index:L,indexGroup:T,removeConditional:H,fieldsSelect:E})=>{let{watch:x}=useFormContext(),M=`groups.[${T}].conditionals[${L}].field`,s=`groups.[${T}].conditionals[${L}].conditional`,l=`groups.[${T}].conditionals[${L}].type`,r=`groups.[${T}].conditionals[${L}].value`,t=[{value:"=",label:"Igual a"},{value:">",label:"Maior que"},{value:"<",label:"Menor que"},{value:"<=",label:"Menor ou igual a"},{value:">=",label:"Maior ou igual a"},{value:"!=",label:"Diferente de"},{value:"IS NULL",label:"Est\xE1 vazio"},{value:"IN",label:"Contido em"},{value:"LIKE",label:"Contendo"},{value:"NOT IN",label:"N\xE3o contido em"},{value:"NOT LIKE",label:"N\xE3o cont\xE9m"},{value:"IS NOT NULL",label:"N\xE3o est\xE1 vazio"}],i=x(l);return jsxs(ke,{direction:"row",spacing:1.5,alignItems:"center",width:1,children:[jsx(Fe,{label:"Se",name:M,size:"small",fullWidth:!0,options:E?.map(n=>({value:n.name,label:n.description}))}),jsx(Fe,{label:"Estado",name:s,size:"small",fullWidth:!0,options:t}),jsx(Fe,{label:"Objetivo",name:`groups.[${T}].conditionals[${L}].type`,size:"small",fullWidth:!0,options:[{label:"Valor",value:"value"},{label:"Campo",value:"field"}]}),i==="value"?jsx(mi,{label:"Valor",name:r,size:"small",fullWidth:!0}):jsx(Fe,{label:"Se",name:r,size:"small",fullWidth:!0,options:E?.map(n=>({value:n.name,label:n.description}))}),jsx(Ct,{color:"error",onClick:()=>{H(L);},children:jsx(ze,{icon:"DELETE_MARK_BUTTON_02"})})]})},St=vi;var Ai=({index:L,removeGroup:T,fieldsSelect:H})=>{let{control:E}=useFormContext(),x=`groups.[${L}].operator`,{fields:M,append:s,remove:l}=useFieldArray({name:`groups.${L}.conditionals`,control:E});return jsx(Si,{name:`GRUPO ${L+1}`,description:"EXIBIR A LISTAGEM QUANDO ATENDER UMA DAS CONDI\xC7\xD5ES",header:jsx(Oe,{name:x,size:"small",options:[{label:"Qualquer",value:"or"},{label:"Todas as condi\xE7\xF5es",value:"and"}]}),onDelete:()=>T(L),children:jsxs(ke,{spacing:1.5,alignItems:"flex-start",children:[M.map((r,t)=>jsx(St,{index:t,indexGroup:L,removeConditional:i=>l(i),fieldsSelect:H},r.id)),jsx(Ci,{actionType:"NEW",onClick:()=>s({field:"",conditional:"=",type:"value",value:""}),variant:"text",size:"small",children:"Adicionar condi\xE7\xE3o"})]})})},At=Ai;var Ei=({fieldsSelect:L})=>{let{control:T}=useFormContext(),{fields:H,append:E,remove:x}=useFieldArray({name:"groups",control:T});return jsxs(ke,{gap:1.5,children:[jsxs($t,{direction:"row",spacing:1.5,children:[jsx(mt,{variant:"body2",color:"text.light.primary",children:"Se"}),jsx(ke,{children:jsx(Oe,{size:"small",name:"operator",options:[{label:"Qualquer",value:"or"},{label:"Todas as condi\xE7\xF5es",value:"and"}]})}),jsxs(mt,{variant:"body2",color:"text.light.primary",children:["regra de ",jsx("strong",{children:"todos os grupos"})," \u201CSe\u201D forem cumpridas,"," ",jsx("strong",{children:"ir\xE1 exibir a listagem."})]})]}),H.map((M,s)=>jsx(At,{index:s,removeGroup:l=>x(l),fieldsSelect:L},M.id)),jsx(it,{size:"large",color:"inherit",startIcon:jsx(ze,{icon:"SIMPLE_ADD"}),variant:"outlined",fullWidth:!0,onClick:()=>{E({operator:"or",conditionals:[{field:"",conditional:"=",type:"value",value:""}]});},children:"Adicionar grupo"})]})},Lt=Ei;var Tt=styled(ke)(({theme:L})=>({border:`1px solid ${alpha(L.palette.grey[500],.32)}`,borderRadius:8,marginTop:24})),kt=styled(ke)(()=>({padding:12,borderBottom:"1px solid #e0e0e0"})),Qe=styled(_i)(()=>({lineHeight:"1em"})),Et=styled(ke)(()=>({padding:12}));var Bi=({argumentsValues:L,onChangeArguments:T,fieldsSelect:H,onChangeRule:E,onChangeSqlProcessed:x,defaultMode:M,defaultFilter:s,dataPreview:l,errorPreview:r,loadingPreview:t})=>{let[i,n]=useState(s||""),[e,o]=Hi(),[a,u]=useState(M||"simple"),{watch:y,setValue:S}=useFormContext(),m=Jt(),$=y("operator"),d=y("groups");useEffect(()=>()=>{S("config",{});},[]);let h=(v,b)=>{if(b==="advanced"){let f=a$1(d,$);n(f),x(f),E(f);}u(b);},w=v=>{e||a==="simple"||L.length===0?o():m.onOpen(v);},C=v=>{o(),x(v);};return jsx(Fragment,{children:jsxs(Tt,{children:[jsxs(kt,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[jsxs(Oi,{color:"primary",value:a,size:"small",exclusive:!0,onChange:h,children:[jsx(Qe,{value:"simple",size:"small",children:"Modo simplificado"}),jsx(Qe,{value:"advanced",size:"small",children:"Modo avan\xE7ado"})]}),jsx(it,{variant:"outlined",color:"inherit",onClick:v=>w(v),startIcon:!e&&jsx(ze,{icon:"PLAY_SIMPLE",color:"primary.main"}),children:e?"Voltar":"Executar"}),!!m.open&&jsx(rt,{handleClose:m.onClose,openPopover:m.open,argumentsValues:L,filter:i,onExecute:v=>C(v)})]}),jsx(Et,{children:e?jsx(wt,{fields:H.map(v=>v.name),data:l,isError:r,isLoading:t}):jsx(Fragment,{children:a==="simple"?jsx(Lt,{fieldsSelect:H,sql:i,setSql:n}):jsx(vt,{fieldsSelect:H,argumentsValues:L,onChangeArguments:T,sql:i,setSql:n,setFilterRule:E})})})]})})},Or=Bi;/*! Bundled license information:
1254
+ `;});ace.define("ace/theme/chrome",["require","exports","module","ace/theme/chrome-css","ace/lib/dom"],function(L,T,H){T.isDark=!1,T.cssClass="ace-chrome",T.cssText=L("./chrome-css");var E=L("../lib/dom");E.importCssString(T.cssText,T.cssClass,!1);});(function(){ace.require(["ace/theme/chrome"],function(L){typeof De=="object"&&typeof ut=="object"&&De&&(De.exports=L);});})();});var Ee=styled(ke)(({theme:L})=>({borderBottom:`1px solid ${alpha(L.palette.grey[500],.32)}`,borderTop:`1px solid ${alpha(L.palette.grey[500],.32)}`,padding:16})),qe=styled(ke)(({theme:L})=>({border:`1px solid ${alpha(L.palette.grey[500],.32)}`,borderRadius:8,padding:12,"& .MuiInputBase-root":{background:L.palette.grey[100]}})),et=styled(ke)(({theme:L})=>({display:"flex",textAlign:"center",flexDirection:"row",alignItems:"center",width:"100%",gap:8,height:34,backgroundColor:"#fff",padding:"8px 16px",borderRadius:8,border:`1px solid ${alpha(L.palette.grey[500],.24)}`,cursor:"pointer",color:L.palette.text.disabled,"&:hover, &:focus":{border:`1px solid ${L.palette.primary.main}`,backgroundColor:alpha(L.palette.primary.main,.05)}})),tt=styled(ke)(({theme:L})=>({width:"100%","& fieldset":{border:`1px solid ${alpha(L.palette.grey[500],.24)}`,borderRadius:8,"& legend":{color:L.palette.text.disabled,fontSize:12}}})),Be=styled(Dt)({padding:0});var Pt=({openPopover:L,handleClose:T,argumentsValues:H,filter:E,onExecute:x})=>{let[M,s]=useState([]),l=(t,i)=>{if(i&&i!=="")M.filter(e=>e.name===t).length>0?s(M.map(e=>e.name===t?{name:t,value:i}:e)):s([...M||[],{name:t,value:i}]);else {let n=M.filter(e=>e.name===t);s(n);}},r=()=>{let t=E||"";return M.forEach(i=>{t=t.replace(`$ARG[${i.name}]`,`'${i.value}'`);}),t};return jsxs(Ot,{open:!!L,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:L,onClose:T,title:"Pr\xE9-visualizar",children:[jsx(mt,{variant:"subtitle1",color:"text.primary",p:1,children:"Pr\xE9-visualizar"}),jsx(Ee,{children:H?.map((t,i)=>jsx(Wt,{name:t,label:t,size:"small",onChange:n=>l(t,n.target.value),required:!0},i))}),jsxs(ke,{p:2,direction:"row",justifyContent:"flex-end",spacing:1,children:[jsx(it,{variant:"outlined",color:"inherit",size:"small",onClick:T,children:"Cancelar"}),jsx(it,{variant:"contained",color:"primary",size:"small",startIcon:jsx(ze,{icon:"PLAY_SIMPLE"}),onClick:()=>x(r()),disabled:M.length<H.length,children:"Executar"})]})]})},rt=Pt;b(st());b(lt());b(ht());b(dt());var Yt=({openPopover:L,handleClose:T,addItem:H})=>{let[E,x]=useState("");return jsxs(Ot,{open:!!L,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:L,onClose:T,sx:{maxWidth:464},title:"Novo Argumento",children:[jsx(mt,{variant:"subtitle1",color:"text.primary",p:1,children:"Novo Argumento"}),jsx(Ee,{children:jsx(Wt,{value:E,onChange:s=>x(s.target.value),name:"item",label:"Novo argumento",size:"small"})}),jsxs(ke,{p:1,direction:"row",justifyContent:"flex-end",spacing:1,children:[jsx(it,{variant:"outlined",color:"inherit",size:"small",onClick:T,children:"Cancelar"}),jsx(it,{variant:"contained",color:"primary",size:"small",startIcon:jsx(ze,{icon:"SAVE_MARK"}),disabled:!E||E==="",onClick:()=>{H(E),T(),x("");},children:"Salvar"})]})]})},gt=Yt;var qt=({label:L,itens:T,argumentsValues:H,fields:E,addItem:x,removeItem:M,insertItemSQL:s})=>{let[l,r]=useState(!1),t=Jt(),i=()=>{r(!l);},n=(o,a)=>{o.stopPropagation(),M&&M(a);},e=o=>{s(H?` $ARG[${o}]`:E?` this.${o}`:` ${o}`);};return jsxs(ke,{children:[jsxs(ke,{direction:"row",alignItems:"center",spacing:1.5,padding:1,paddingLeft:0,children:[jsx(Be,{edge:"end",onClick:i,children:jsx(ze,{icon:l?"CHEVRON_UP":"CHEVRON_RIGHT"})}),jsx(mt,{variant:"overline",color:"text.primary",children:L}),x&&jsxs(Fragment,{children:[jsx(Be,{edge:"end",onClick:t.onOpen,children:jsx(ze,{icon:"SIMPLE_ADD"})}),jsx(gt,{addItem:x,handleClose:t.onClose,openPopover:t.open})]})]}),l&&jsx(ke,{spacing:.5,children:jsx(Xt,{sx:{maxHeight:150},children:T?.map((o,a)=>jsxs(et,{direction:"row",justifyContent:"space-between",onClick:()=>e(o),children:[jsx(mt,{variant:"caption",textAlign:"center",width:"100%",children:o}),M&&jsx(Dt,{edge:"end",onClick:u=>n(u,o),children:jsx(ze,{icon:"DELETE_MARK_BUTTON_02"})})]},a))})})]})},xe=qt;var oi=({fieldsSelect:L,argumentsValues:T,onChangeArguments:H,sql:E,setSql:x,setFilterRule:M})=>{let[s,l]=useState(),{setValue:r}=useFormContext(),[t,i]=useState(1),[n,e]=useState(),o=m=>{n.session.insert(t,` ${m} `);},a=m=>{H([...T||[],m]);},u=m=>{H(T?.filter($=>$!==m));},y=m=>{x(m[0]),M(m[0]),r("groups",void 0);},S=s?L.filter(m=>m.id.toString().toLocaleLowerCase().includes(s)||m.description.toString().toLocaleLowerCase().includes(s)||m.name?.toString().toLocaleLowerCase().includes(s)):L;return console.log({sql:E}),jsxs(ke,{direction:"row",padding:1.5,spacing:1.5,children:[jsxs(qe,{children:[jsx(ni,{value:s,trigger:"change",onSearch:m=>l(m?.toLocaleLowerCase()),fullWidth:!0,size:"small",placeholder:"Buscar",iconPosition:"start"}),jsx(xe,{label:"Campos",fields:!0,itens:S.map(m=>m.name),insertItemSQL:o}),jsx(xe,{label:"Argumentos",argumentsValues:!0,itens:T,addItem:a,removeItem:u,insertItemSQL:o}),jsx(xe,{label:"Operadores",insertItemSQL:o,itens:["=",">","<","<=",">=","!=","IS NULL","IN","LIKE","NOT IN","NOT LIKE","IS NOT NULL"]}),jsx(xe,{label:"Filtros",fields:!0,insertItemSQL:o,itens:S.map(m=>m.name)})]}),jsx(tt,{children:jsxs("fieldset",{children:[jsx("legend",{children:"Regras de listagem"}),jsx(ti,{width:"100%",mode:"sql",theme:"chrome",name:"rule",fontSize:14,onChange:y,onCursorChange:m=>i(m.getCursor()),value:E,onLoad:m=>e(m),showPrintMargin:!1,showGutter:!1,highlightActiveLine:!1,setOptions:{enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,enableSnippets:!0,showLineNumbers:!1,tabSize:2}})]})})]})},vt=oi;var li=({data:L,fields:T,isLoading:H,isError:E})=>jsxs(ke,{children:[jsx(mt,{variant:"subtitle2",color:"text.secondary",children:"PR\xC9 VISUALIZA\xC7\xC3O DOS RESULTADOS DA LISTAGEM"}),E&&jsx(ke,{children:"Falha ao gerar resultado"}),L&&jsx(ai,{columns:T?.map(x=>({field:x,headerName:x,width:150,type:"string"})),loading:H,rows:L,disableRowSelectionOnClick:!0,disableColumnMenu:!0,disableColumnResize:!0,showColumnVerticalBorder:!0,hideFooter:!0})]}),wt=li;var $t=styled(ke)(({theme:L})=>({border:`1px solid ${alpha(L.palette.primary.main,.32)}`,backgroundColor:alpha(L.palette.primary.main,.08),borderRadius:8,padding:8,paddingLeft:24,alignItems:"center"})),Ct=styled(Dt)(()=>({height:"28px",marginLeft:"16px","&:hover":{backgroundColor:"transparent"}})),Oe=styled(Fe)(()=>({width:230}));var vi=({index:L,indexGroup:T,removeConditional:H,fieldsSelect:E})=>{let{watch:x}=useFormContext(),M=`groups.[${T}].conditionals[${L}].field`,s=`groups.[${T}].conditionals[${L}].conditional`,l=`groups.[${T}].conditionals[${L}].type`,r=`groups.[${T}].conditionals[${L}].value`,t=[{value:"=",label:"Igual a"},{value:">",label:"Maior que"},{value:"<",label:"Menor que"},{value:"<=",label:"Menor ou igual a"},{value:">=",label:"Maior ou igual a"},{value:"!=",label:"Diferente de"},{value:"IS NULL",label:"Est\xE1 vazio"},{value:"IN",label:"Contido em"},{value:"LIKE",label:"Contendo"},{value:"NOT IN",label:"N\xE3o contido em"},{value:"NOT LIKE",label:"N\xE3o cont\xE9m"},{value:"IS NOT NULL",label:"N\xE3o est\xE1 vazio"}],i=x(l);return jsxs(ke,{direction:"row",spacing:1.5,alignItems:"center",width:1,children:[jsx(Fe,{label:"Se",name:M,size:"small",fullWidth:!0,options:E?.map(n=>({value:n.name,label:n.description}))}),jsx(Fe,{label:"Estado",name:s,size:"small",fullWidth:!0,options:t}),jsx(Fe,{label:"Objetivo",name:`groups.[${T}].conditionals[${L}].type`,size:"small",fullWidth:!0,options:[{label:"Valor",value:"value"},{label:"Campo",value:"field"}]}),i==="value"?jsx(mi,{label:"Valor",name:r,size:"small",fullWidth:!0}):jsx(Fe,{label:"Se",name:r,size:"small",fullWidth:!0,options:E?.map(n=>({value:n.name,label:n.description}))}),jsx(Ct,{color:"error",onClick:()=>{H(L);},children:jsx(ze,{icon:"DELETE_MARK_BUTTON_02"})})]})},St=vi;var Ai=({index:L,removeGroup:T,fieldsSelect:H})=>{let{control:E}=useFormContext(),x=`groups.[${L}].operator`,{fields:M,append:s,remove:l}=useFieldArray({name:`groups.${L}.conditionals`,control:E});return jsx(Si,{name:`GRUPO ${L+1}`,description:"EXIBIR A LISTAGEM QUANDO ATENDER UMA DAS CONDI\xC7\xD5ES",header:jsx(Oe,{name:x,size:"small",options:[{label:"Qualquer",value:"or"},{label:"Todas as condi\xE7\xF5es",value:"and"}]}),onDelete:()=>T(L),children:jsxs(ke,{spacing:1.5,alignItems:"flex-start",children:[M.map((r,t)=>jsx(St,{index:t,indexGroup:L,removeConditional:i=>l(i),fieldsSelect:H},r.id)),jsx(Ci,{actionType:"NEW",onClick:()=>s({field:"",conditional:"=",type:"value",value:""}),variant:"text",size:"small",children:"Adicionar condi\xE7\xE3o"})]})})},At=Ai;var Ei=({fieldsSelect:L})=>{let{control:T}=useFormContext(),{fields:H,append:E,remove:x}=useFieldArray({name:"groups",control:T});return jsxs(ke,{gap:1.5,children:[jsxs($t,{direction:"row",spacing:1.5,children:[jsx(mt,{variant:"body2",color:"text.light.primary",children:"Se"}),jsx(ke,{children:jsx(Oe,{size:"small",name:"operator",options:[{label:"Qualquer",value:"or"},{label:"Todas as condi\xE7\xF5es",value:"and"}]})}),jsxs(mt,{variant:"body2",color:"text.light.primary",children:["regra de ",jsx("strong",{children:"todos os grupos"})," \u201CSe\u201D forem cumpridas,"," ",jsx("strong",{children:"ir\xE1 exibir a listagem."})]})]}),H.map((M,s)=>jsx(At,{index:s,removeGroup:l=>x(l),fieldsSelect:L},M.id)),jsx(it,{size:"large",color:"inherit",startIcon:jsx(ze,{icon:"SIMPLE_ADD"}),variant:"outlined",fullWidth:!0,onClick:()=>{E({operator:"or",conditionals:[{field:"",conditional:"=",type:"value",value:""}]});},children:"Adicionar grupo"})]})},Lt=Ei;var Tt=styled(ke)(({theme:L})=>({border:`1px solid ${alpha(L.palette.grey[500],.32)}`,borderRadius:8,marginTop:24})),kt=styled(ke)(()=>({padding:12,borderBottom:"1px solid #e0e0e0"})),Qe=styled(_i)(()=>({lineHeight:"1em"})),Et=styled(ke)(()=>({padding:12}));var Bi=({argumentsValues:L,onChangeArguments:T,fieldsSelect:H,onChangeRule:E,onChangeSqlProcessed:x,defaultMode:M,defaultFilter:s,dataPreview:l,errorPreview:r,loadingPreview:t})=>{let[i,n]=useState(s||""),[e,o]=Hi(),[a,u]=useState(M||"simple"),{watch:y,setValue:S}=useFormContext(),m=Jt(),$=y("operator"),d=y("groups");useEffect(()=>()=>{S("config",{});},[]);let h=(v,b)=>{if(b==="advanced"){let f=a$1(d,$);n(f),x(f),E(f);}u(b);},w=v=>{e||a==="simple"||L.length===0?o():m.onOpen(v);},C=v=>{o(),x(v);};return jsx(Fragment,{children:jsxs(Tt,{children:[jsxs(kt,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[jsxs(Oi,{color:"primary",value:a,size:"small",exclusive:!0,onChange:h,children:[jsx(Qe,{value:"simple",size:"small",children:"Modo simplificado"}),jsx(Qe,{value:"advanced",size:"small",children:"Modo avan\xE7ado"})]}),jsx(it,{variant:"outlined",color:"inherit",onClick:v=>w(v),startIcon:!e&&jsx(ze,{icon:"PLAY_SIMPLE",color:"primary.main"}),children:e?"Voltar":"Executar"}),!!m.open&&jsx(rt,{handleClose:m.onClose,openPopover:m.open,argumentsValues:L,filter:i,onExecute:v=>C(v)})]}),jsx(Et,{children:e?jsx(wt,{fields:H.map(v=>v.name),data:l,isError:r,isLoading:t}):jsx(Fragment,{children:a==="simple"?jsx(Lt,{fieldsSelect:H,sql:i,setSql:n}):jsx(vt,{fieldsSelect:H,argumentsValues:L,onChangeArguments:T,sql:i,setSql:n,setFilterRule:E})})})]})})},Or=Bi;/*! Bundled license information:
1255
1255
 
1256
1256
  ace-builds/src-noconflict/ace.js:
1257
1257
  (*
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.0.20",
2
+ "version": "2.0.21",
3
3
  "name": "@zydon/common-csr",
4
4
  "description": "Zydon common resources for React projects (only Client-Side Rendering (CSR))",
5
5
  "license": "MIT",