@zydon/common 2.0.13 → 2.0.14
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.
- package/dist/chunk-CWBBB534.mjs +18 -0
- package/dist/components/SelectableCards/index.d.ts +1 -1
- package/dist/components/SelectableCards/index.mjs +1 -1
- package/dist/components/form/SelectableCards/index.d.ts +1 -1
- package/dist/components/form/SelectableCards/index.mjs +1 -1
- package/dist/{props-f459546a.d.ts → props-c546afde.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-WZIIPXIC.mjs +0 -18
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { a as a$1 } from './chunk-M4VESEVT.mjs';
|
|
2
|
+
import { a as a$3 } from './chunk-2ZLS7IUJ.mjs';
|
|
3
|
+
import { a as a$4 } from './chunk-WHA7HOMZ.mjs';
|
|
4
|
+
import { a as a$2 } from './chunk-SXVKHA6L.mjs';
|
|
5
|
+
import { a as a$5 } from './chunk-X4ZQHYJU.mjs';
|
|
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 };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { S as SelectableCardsProps } from '../../props-
|
|
2
|
+
import { S as SelectableCardsProps } from '../../props-c546afde.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
|
|
5
5
|
declare const SelectableCards: ({ title, action, loading, items, values, onChange, }: SelectableCardsProps) => react_jsx_runtime.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { S as SelectableCardsProps$1 } from '../../../props-
|
|
2
|
+
import { S as SelectableCardsProps$1 } from '../../../props-c546afde.js';
|
|
3
3
|
import { BaseField } from '../../../types/baseField.js';
|
|
4
4
|
import 'react';
|
|
5
5
|
import 'react-hook-form';
|
package/package.json
CHANGED
package/dist/chunk-WZIIPXIC.mjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { a as a$1 } from './chunk-M4VESEVT.mjs';
|
|
2
|
-
import { a as a$3 } from './chunk-2ZLS7IUJ.mjs';
|
|
3
|
-
import { a as a$4 } from './chunk-WHA7HOMZ.mjs';
|
|
4
|
-
import { a as a$2 } from './chunk-SXVKHA6L.mjs';
|
|
5
|
-
import { a as a$5 } from './chunk-X4ZQHYJU.mjs';
|
|
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:r=>r!=="active"})(({theme:r,active:i})=>({boxShadow:"none",cursor:"pointer",borderRadius:8,borderStyle:"solid",borderWidth:1.5,borderColor:i?r.palette.primary.main:r.palette.grey[300],color:r.palette.primary.main,backgroundColor:i?alpha(r.palette.primary.main,.04):"white","&:hover":{borderColor:r.palette.primary.main}}));var z=({title:r,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:[jsx(p,{variant:"overline",color:"text.disabled",children:r}),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 };
|