@zydon/common-csr 2.0.83 → 2.0.85
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.
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import c from '@mui/material/Stack';
|
|
3
|
+
import m from '@mui/material/Typography';
|
|
4
|
+
import v from '@zydon/common/form/Field';
|
|
5
|
+
import { styled } from '@mui/material/styles';
|
|
6
|
+
import s from '@mui/material/ToggleButton';
|
|
7
|
+
import d from '@mui/material/ToggleButtonGroup';
|
|
8
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
9
|
+
|
|
10
|
+
var p=styled(s)(({theme:r})=>({width:"100%","&.Mui-selected":{backgroundColor:r.palette.primary.main,color:r.palette.common.white,"&:hover":{backgroundColor:r.palette.primary.main}}})),g=styled(d)(()=>({display:"flex",justifyContent:"space-between"}));var f=({initialMode:r,rules:a,setRuleType:l})=>{let[i,u]=useState(r);return jsxs(c,{gap:2,children:[jsx(v,{name:"name",label:"Nome da regra",required:!0,rules:{required:{value:!0,message:"Nome da regra \xE9 obrigat\xF3rio"}}}),jsx(m,{color:"grey.500",variant:"overline",children:"Selecione a regra"}),a&&jsx(g,{color:"primary",value:i,size:"small",exclusive:!0,onChange:(e,o)=>{if(o!==null&&(u(o),l))return l(o)},children:a.map((e,o)=>jsx(p,{value:e.value,size:"small",color:"primary",children:jsx(m,{variant:"body2",children:e.toggleTitle})},o))}),a&&a.map((e,o)=>e.value===i?jsx("div",{children:e.component},o):null)]})},q=f;
|
|
11
|
+
|
|
12
|
+
export { q as a };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { a as default } from '../../../chunk-
|
|
1
|
+
export { a as default } from '../../../chunk-2L7N4G6V.mjs';
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
2
|
-
import { useFormContext } from 'react-hook-form';
|
|
3
1
|
import i from '@mui/material/Stack';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
2
|
+
import h from '@mui/material/Typography';
|
|
3
|
+
import f from '@zydon/common/components/DataGrid';
|
|
4
|
+
import M from '@zydon/common/components/SearchInput';
|
|
7
5
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
6
|
|
|
9
|
-
var
|
|
7
|
+
var w=({columns:l,rows:p,page:a=0,perPage:t=5,loading:s,fetching:c,totalRows:g,handlePaginationChange:d,onRowSelectionModelChange:u,handleSearch:m,handleSearchValue:S,rowSelectionModel:n})=>jsxs(i,{gap:2,position:"relative",children:[jsxs(i,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[jsx(M,{onSearch:o=>m(o),onChange:o=>S(o.target.value),iconPosition:"start",size:"small",placeholder:"Buscar"}),jsxs(h,{variant:"body1",color:"text.disabled",children:[n.length," selecionados"]})]}),jsx(f,{columns:l,rows:p,pagination:!0,paginationModel:{page:a,pageSize:t},rowCount:g,paginationMode:"server",onPaginationModelChange:d,initialState:{pagination:{paginationModel:{pageSize:t,page:a}}},pageSizeOptions:[5],loading:s,fetching:c,checkboxSelection:!0,onRowSelectionModelChange:u,rowSelectionModel:n,keepNonExistentRowsSelected:!0})]}),b=w;
|
|
10
8
|
|
|
11
|
-
export {
|
|
9
|
+
export { b as default };
|
package/package.json
CHANGED
package/dist/chunk-7VO4T3XL.mjs
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
2
|
-
import { useFormContext } from 'react-hook-form';
|
|
3
|
-
import h from '@mui/material/Stack';
|
|
4
|
-
import d from '@mui/material/Typography';
|
|
5
|
-
import S from '@zydon/common/form/Field';
|
|
6
|
-
import { styled } from '@mui/material/styles';
|
|
7
|
-
import c from '@mui/material/ToggleButton';
|
|
8
|
-
import f from '@mui/material/ToggleButtonGroup';
|
|
9
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
10
|
-
|
|
11
|
-
var m=styled(c)(({theme:a})=>({width:"100%","&.Mui-selected":{backgroundColor:a.palette.primary.main,color:a.palette.common.white,"&:hover":{backgroundColor:a.palette.primary.main}}})),p=styled(f)(()=>({display:"flex",justifyContent:"space-between"}));var T=({initialMode:a,rules:o,setRuleType:l})=>{let[n,i]=useState(a),{setValue:s}=useFormContext();return useEffect(()=>{if(o&&o.length>0&&(i(o[0].value),l))return l(o[0].value)},[]),useEffect(()=>()=>{s("config",{});},[]),jsxs(h,{gap:2,children:[jsx(S,{name:"name",label:"Nome da regra",required:!0,rules:{required:{value:!0,message:"Nome da regra \xE9 obrigat\xF3rio"}}}),jsx(d,{color:"grey.500",variant:"overline",children:"Selecione a regra"}),o&&jsx(p,{color:"primary",value:n,size:"small",exclusive:!0,onChange:(t,e)=>{if(e!==null&&(i(e),l))return l(e)},children:o.map((t,e)=>jsx(m,{value:t.value,size:"small",color:"primary",children:jsx(d,{variant:"body2",children:t.toggleTitle})},e))}),o&&o.map((t,e)=>t.value===n?jsx("div",{children:t.component},e):null)]})},P=T;
|
|
12
|
-
|
|
13
|
-
export { P as a };
|