@zydon/common-csr 2.0.59 → 2.0.61
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,8 +11,9 @@ interface Item {
|
|
|
11
11
|
}
|
|
12
12
|
interface FilterRuleProps {
|
|
13
13
|
items: Item[];
|
|
14
|
+
onChange?(values: any): void;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
|
-
declare const FilterRule: ({ items }: FilterRuleProps) => react_jsx_runtime.JSX.Element;
|
|
17
|
+
declare const FilterRule: ({ items, onChange }: FilterRuleProps) => react_jsx_runtime.JSX.Element;
|
|
17
18
|
|
|
18
19
|
export { FilterRule as default };
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react';
|
|
2
2
|
import { useFormContext } from 'react-hook-form';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
3
|
+
import B from '@mui/material/Accordion';
|
|
4
|
+
import H from '@mui/material/AccordionDetails';
|
|
5
|
+
import _ from '@mui/material/AccordionSummary';
|
|
6
|
+
import M from '@mui/material/Button';
|
|
7
|
+
import L from '@mui/material/Checkbox';
|
|
8
|
+
import k from '@mui/material/FormControlLabel';
|
|
9
|
+
import N from '@mui/material/List';
|
|
10
|
+
import w from '@mui/material/ListItem';
|
|
11
|
+
import x from '@mui/material/Stack';
|
|
12
12
|
import { styled, alpha } from '@mui/material/styles';
|
|
13
13
|
import m from '@mui/material/Typography';
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
14
|
+
import j from '@zydon/common/components/EmptyView';
|
|
15
|
+
import G from '@zydon/common/components/Icon';
|
|
16
|
+
import U from '@zydon/common/components/Label';
|
|
17
|
+
import W from '@zydon/common/components/SearchInput';
|
|
18
|
+
import D from '@zydon/common/components/Scrollbar';
|
|
19
19
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var C=styled(D)(()=>({maxHeight:"260px"}));var q=({items:i,onChange:f})=>{let{setValue:d,getValues:A}=useFormContext(),[a,E]=useState(-1),[p,h]=useState(""),F=Object.fromEntries(i.map((t,o)=>[o,[]])),[c,y]=useState(F);useEffect(()=>()=>{d("config",{});},[]);let T=(t,o)=>{E(o?t:-1),o&&I();},I=()=>{h("");},S=(t,o,e)=>{let n=e.target.checked?[...c[a],o]:c[a].filter(l=>l!==o);y({...c,[a]:n}),v(t,n);},b=t=>{h(t);},V=()=>{let o=i[a].list.every(e=>c[a].includes(e.value))?[]:[...i[a].list.map(e=>e.value)];y({...c,[a]:o}),v(i[a].name,o);},v=(t,o)=>{let e={},n=A("config"),l=i[a];if(l){let R=l.list.filter(u=>c[a].includes(u.value)).map(u=>u.value);e[l.name]={type:"FIELD",values:l.name===t?o:R},d("config",{...n,...e}),f&&f({...n,...e});}};return jsx(Fragment,{children:i.map((t,o)=>jsxs(B,{expanded:a===o,onChange:(e,n)=>T(o,n),children:[jsx(_,{expandIcon:jsx(G,{icon:"CHEVRON_UP"}),id:`${o}`,children:jsxs(x,{alignItems:"center",direction:"row",children:[jsx(m,{variant:"subtitle2",color:"grey.600",children:t.label}),jsxs(U,{variant:"soft",color:"primary",marginLeft:1,sx:e=>({backgroundColor:`${alpha(e.palette.grey[400],.2)}`,cursor:"pointer"}),children:[c[o].length," selecionados"]})]})}),jsxs(H,{children:[jsxs(x,{direction:"row",justifyContent:"space-between",alignItems:"center",gap:1,children:[jsx(W,{onSearch:b,onChange:e=>b(e.target.value),iconPosition:"start",size:"small",placeholder:"Buscar",value:p,fullWidth:!0}),jsx(M,{onClick:()=>V(),size:"small",children:jsx(m,{variant:"overline",children:"TODOS"})})]}),jsx(C,{children:jsx(N,{children:a>-1&&(t.list.filter(e=>e.label?.toLowerCase().includes(p.toLowerCase())).map((e,n)=>jsx(w,{children:jsx(k,{control:jsx(L,{size:"small",checked:c[a].includes(e.value),onChange:l=>S(t.name,e.value,l),name:e.label}),label:jsx(m,{variant:"caption",color:"grey.600",children:e.label})})},n)).length===0?jsx(j,{sx:{svg:{height:100}},text:"Nenhum registro para ser apresentado"}):t.list.filter(e=>e.label?.toLowerCase().includes(p.toLowerCase())).map((e,n)=>jsx(w,{children:jsx(k,{control:jsx(L,{size:"small",checked:c[a].includes(e.value),onChange:l=>S(t.name,e.value,l),name:e.label}),label:jsx(m,{variant:"caption",color:"grey.600",children:e.label})})},n)))})})]})]},o))})},ye=q;
|
|
22
22
|
|
|
23
|
-
export {
|
|
23
|
+
export { ye as default };
|
|
@@ -11,12 +11,14 @@ interface ManualRuleProps {
|
|
|
11
11
|
pageSize?: number | undefined;
|
|
12
12
|
page?: number | undefined;
|
|
13
13
|
}) => void;
|
|
14
|
+
handleSearch: (search: string | undefined) => void;
|
|
15
|
+
handleSearchValue: (search: string | undefined) => void;
|
|
14
16
|
page: number;
|
|
15
17
|
perPage: number;
|
|
16
18
|
rowSelectionModel: GridRowSelectionModel;
|
|
17
19
|
onRowSelectionModelChange(values: GridRowSelectionModel): void;
|
|
18
20
|
}
|
|
19
21
|
|
|
20
|
-
declare const ManualRules: ({ columns, rows, page, perPage, loading, fetching, totalRows, handlePaginationChange, onRowSelectionModelChange, rowSelectionModel, }: ManualRuleProps) => react_jsx_runtime.JSX.Element;
|
|
22
|
+
declare const ManualRules: ({ columns, rows, page, perPage, loading, fetching, totalRows, handlePaginationChange, onRowSelectionModelChange, handleSearch, handleSearchValue, rowSelectionModel, }: ManualRuleProps) => react_jsx_runtime.JSX.Element;
|
|
21
23
|
|
|
22
24
|
export { ManualRules as default };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { useEffect
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
2
|
import { useFormContext } from 'react-hook-form';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
3
|
+
import i from '@mui/material/Stack';
|
|
4
|
+
import w from '@mui/material/Typography';
|
|
5
|
+
import y from '@zydon/common/components/DataGrid';
|
|
6
|
+
import C from '@zydon/common/components/SearchInput';
|
|
7
7
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var k=({columns:l,rows:p,page:t=0,perPage:a=5,loading:s,fetching:c,totalRows:g,handlePaginationChange:m,onRowSelectionModelChange:u,handleSearch:d,handleSearchValue:f,rowSelectionModel:n})=>{let{setValue:S}=useFormContext();return useEffect(()=>()=>{S("config",{});},[]),jsxs(i,{gap:2,position:"relative",children:[jsxs(i,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[jsx(C,{onSearch:o=>d(o),onChange:o=>f(o.target.value),iconPosition:"start",size:"small",placeholder:"Buscar"}),jsxs(w,{variant:"body1",color:"text.disabled",children:[n.length," selecionados"]})]}),jsx(y,{columns:l,rows:p,pagination:!0,paginationModel:{page:t,pageSize:a},rowCount:g,paginationMode:"server",onPaginationModelChange:m,initialState:{pagination:{paginationModel:{pageSize:a,page:t}}},pageSizeOptions:[5],loading:s,fetching:c,checkboxSelection:!0,onRowSelectionModelChange:u,rowSelectionModel:n,keepNonExistentRowsSelected:!0})]})},E=k;
|
|
10
10
|
|
|
11
|
-
export {
|
|
11
|
+
export { E as default };
|
package/package.json
CHANGED