@zydon/common 2.3.10 → 2.3.11
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,18 @@
|
|
|
1
|
+
import { a as a$3 } from './chunk-TWGGHTU5.js';
|
|
2
|
+
import { a as a$1 } from './chunk-JQB6LCBL.js';
|
|
3
|
+
import { a as a$4 } from './chunk-2MVQI7NJ.js';
|
|
4
|
+
import { a as a$2 } from './chunk-E5MGOPPQ.js';
|
|
5
|
+
import { a as a$5 } from './chunk-X7L4MC53.js';
|
|
6
|
+
import { useState } from 'react';
|
|
7
|
+
import L from '@mui/material/Button';
|
|
8
|
+
import W from '@mui/material/CircularProgress';
|
|
9
|
+
import C from '@mui/material/Grid';
|
|
10
|
+
import a from '@mui/material/Stack';
|
|
11
|
+
import p from '@mui/material/Typography';
|
|
12
|
+
import O from '@mui/material/Card';
|
|
13
|
+
import { styled, alpha } from '@mui/material/styles';
|
|
14
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
15
|
+
|
|
16
|
+
var b=styled(O,{shouldForwardProp:t=>t!=="active"})(({theme:t,active:i})=>({boxShadow:"none",cursor:"pointer",borderRadius:8,borderStyle:"solid",borderWidth:1.5,borderColor:i?t.palette.primary.main:t.palette.grey[300],color:t.palette.primary.main,backgroundColor:i?alpha(t.palette.primary.main,.04):"white","&:hover":{borderColor:t.palette.primary.main}}));var z=({title:t,action:i,loading:v,items:n,values:l,onChange:y})=>{let[d,w]=useState(),m=e=>l.includes(e),k=d?n.filter(e=>e.title.toLowerCase().includes(d.toLowerCase())):n,x=e=>{let o=m(e.value),s;o?s=l.filter(E=>E!==e.value):s=[...l,e.value],y(s);},I=()=>{l.length===n.length?y([]):y(n.map(e=>e.value));},P=new Intl.PluralRules("pt-BR"),R=new Map([["one","selecionado"],["other","selecionados"]]),T=e=>{let o=P.select(e),s=R.get(o);return `${e} ${s}`};return jsxs(a,{gap:1.5,height:450,children:[jsxs(a,{direction:"row",justifyContent:"space-between",children:[typeof t=="string"?jsx(p,{variant:"overline",color:"text.disabled",children:t}):t,jsx(p,{variant:"overline",color:"text.disabled",children:l.length===0?"nenhum selecionado":T(l.length)})]}),jsxs(a,{direction:"row",alignItems:"center",spacing:1.5,children:[jsx(a$1,{fullWidth:!0,size:"small",iconPosition:"start",placeholder:"Buscar",trigger:"change",onSearch:e=>w(e),onKeyDown:e=>{e.key==="Enter"&&e.preventDefault();}}),i?jsx(Fragment,{children:i}):jsx(L,{onClick:I,size:"small",children:jsx(p,{variant:"overline",children:"TODOS"})})]}),jsx(a$2,{children:jsx(a,{flex:1,mb:2,children:jsx(a$3,{isLoading:v,loading:jsx(a,{alignItems:"center",mt:3,children:jsx(W,{})}),isEmpty:n.length===0,empty:jsx(a$4,{sx:{svg:{height:140}},text:d?`N\xE3o foi possivel encontrar o item "${d}"`:"Nenhum item dispon\xEDvel"}),children:jsx(C,{container:!0,spacing:1.5,children:k.map(e=>jsx(C,{item:!0,xs:4,children:jsx(b,{active:m(e.value),onClick:()=>x(e),children:jsxs(a,{padding:1.5,width:"100%",children:[jsxs(a,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[jsx(p,{color:m(e.value)?"primary.main":"text.primary",variant:"subtitle2",textAlign:"left",noWrap:!0,children:e.title}),m(e.value)&&jsx(a$5,{icon:"CHECK_CIRCLE",width:24})]}),e.options.map(o=>jsx(p,{mt:1,variant:"body2",color:"text.disabled",fontSize:12,textAlign:"left",noWrap:!0,children:`${o.label}: ${o.value}`},o.label))]})})},e.title))})})})})]})},Z=z;
|
|
17
|
+
|
|
18
|
+
export { Z as a };
|
package/package.json
CHANGED
package/dist/chunk-OQUB2JFB.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { a as a$3 } from './chunk-TWGGHTU5.js';
|
|
2
|
-
import { a as a$1 } from './chunk-JQB6LCBL.js';
|
|
3
|
-
import { a as a$4 } from './chunk-2MVQI7NJ.js';
|
|
4
|
-
import { a as a$2 } from './chunk-E5MGOPPQ.js';
|
|
5
|
-
import { a as a$5 } from './chunk-X7L4MC53.js';
|
|
6
|
-
import { useState, useMemo } from 'react';
|
|
7
|
-
import W from '@mui/material/Button';
|
|
8
|
-
import z from '@mui/material/CircularProgress';
|
|
9
|
-
import C from '@mui/material/Grid';
|
|
10
|
-
import a from '@mui/material/Stack';
|
|
11
|
-
import c from '@mui/material/Typography';
|
|
12
|
-
import O from '@mui/material/Card';
|
|
13
|
-
import { styled, alpha } from '@mui/material/styles';
|
|
14
|
-
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
15
|
-
|
|
16
|
-
var b=styled(O,{shouldForwardProp:t=>t!=="active"})(({theme:t,active:i})=>({boxShadow:"none",cursor:"pointer",borderRadius:8,borderStyle:"solid",borderWidth:1.5,borderColor:i?t.palette.primary.main:t.palette.grey[300],color:t.palette.primary.main,backgroundColor:i?alpha(t.palette.primary.main,.04):"white","&:hover":{borderColor:t.palette.primary.main}}));var D=({title:t,action:i,loading:v,items:l,values:n,onChange:y})=>{let[s,w]=useState(),m=e=>n.includes(e),k=useMemo(()=>s?l.filter(e=>e.title.toLowerCase().includes(s.toLowerCase())):l,[s,l]),x=e=>{let o=m(e.value),p;o?p=n.filter(E=>E!==e.value):p=[...n,e.value],y(p);},I=()=>{n.length===l.length?y([]):y(l.map(e=>e.value));},P=new Intl.PluralRules("pt-BR"),R=new Map([["one","selecionado"],["other","selecionados"]]),T=e=>{let o=P.select(e),p=R.get(o);return `${e} ${p}`};return jsxs(a,{gap:1.5,height:450,children:[jsxs(a,{direction:"row",justifyContent:"space-between",children:[typeof t=="string"?jsx(c,{variant:"overline",color:"text.disabled",children:t}):t,jsx(c,{variant:"overline",color:"text.disabled",children:n.length===0?"nenhum selecionado":T(n.length)})]}),jsxs(a,{direction:"row",alignItems:"center",spacing:1.5,children:[jsx(a$1,{fullWidth:!0,size:"small",iconPosition:"start",placeholder:"Buscar",trigger:"change",onSearch:e=>w(e),onKeyDown:e=>{e.key==="Enter"&&e.preventDefault();}}),i?jsx(Fragment,{children:i}):jsx(W,{onClick:I,size:"small",children:jsx(c,{variant:"overline",children:"TODOS"})})]}),jsx(a$2,{children:jsx(a,{flex:1,mb:2,children:jsx(a$3,{isLoading:v,loading:jsx(a,{alignItems:"center",mt:3,children:jsx(z,{})}),isEmpty:l.length===0,empty:jsx(a$4,{sx:{svg:{height:140}},text:s?`N\xE3o foi possivel encontrar o item "${s}"`:"Nenhum item dispon\xEDvel"}),children:jsx(C,{container:!0,spacing:1.5,children:k.map(e=>jsx(C,{item:!0,xs:4,children:jsx(b,{active:m(e.value),onClick:()=>x(e),children:jsxs(a,{padding:1.5,width:"100%",children:[jsxs(a,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[jsx(c,{color:m(e.value)?"primary.main":"text.primary",variant:"subtitle2",textAlign:"left",noWrap:!0,children:e.title}),m(e.value)&&jsx(a$5,{icon:"CHECK_CIRCLE",width:24})]}),e.options.map(o=>jsx(c,{mt:1,variant:"body2",color:"text.disabled",fontSize:12,textAlign:"left",noWrap:!0,children:`${o.label}: ${o.value}`},o.label))]})})},e.title))})})})})]})},ee=D;
|
|
17
|
-
|
|
18
|
-
export { ee as a };
|