@zydon/common 2.0.47 → 2.0.49

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.
@@ -3,6 +3,6 @@ import { NumericFormat } from 'react-number-format';
3
3
  import H from '@mui/material/TextField';
4
4
  import { jsx } from 'react/jsx-runtime';
5
5
 
6
- var p=forwardRef(({decimalScale:f=0,fixedDecimalScale:s=!0,prefix:c,allowNegative:m,minValue:t,maxValue:a=1/0,maxLength:d,value:I,inputProps:b,InputProps:N,size:S,disabled:T,name:u,helperText:x,error:y,fullWidth:g,label:h,required:v,onChange:r,tabIndex:w},D)=>{let[F,P]=useState(Date.now()),e=useRef(null),l=()=>P(Date.now()),R=(k,o)=>{r&&(e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{let{floatValue:n}=k,i=n||0;if(t!==void 0&&t>i){r({target:{name:u,value:t},event:o}),l();return}if(n!==void 0&&a<i){r({target:{name:u,value:a},event:o}),l();return}r({target:{name:u,value:n},event:o});},600));};return useEffect(()=>()=>{e.current&&clearTimeout(e.current);},[]),jsx(NumericFormat,{getInputRef:D,value:I,prefix:c,decimalSeparator:",",thousandSeparator:".",decimalScale:f,fixedDecimalScale:s,autoComplete:"off",allowNegative:m,maxLength:d,onValueChange:R,customInput:H,InputProps:{...N},inputProps:{...b,tabIndex:w},disabled:T,size:S,helperText:x,error:y,fullWidth:g,label:h,required:v},F)});p.displayName="NumberInput";var C=p;
6
+ var p=forwardRef(({decimalScale:f=0,fixedDecimalScale:s=!0,prefix:c,allowNegative:m,minValue:t,maxValue:a=1/0,maxLength:d,value:I,inputProps:b,InputProps:N,size:S,disabled:T,name:u,helperText:x,error:y,fullWidth:g,label:h,required:v,onChange:r,tabIndex:w},D)=>{let[F,P]=useState(Date.now()),e=useRef(null),l=()=>P(Date.now()),R=(k,o)=>{r&&(e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{let{floatValue:n}=k,i=n||0;if(t!==void 0&&t>i){r({target:{name:u,value:t},event:o}),l();return}if(n!==void 0&&a<i){r({target:{name:u,value:a},event:o}),l();return}r({target:{name:u,value:n},event:o});},500));};return useEffect(()=>()=>{e.current&&clearTimeout(e.current);},[]),jsx(NumericFormat,{getInputRef:D,value:I,prefix:c,decimalSeparator:",",thousandSeparator:".",decimalScale:f,fixedDecimalScale:s,autoComplete:"off",allowNegative:m,maxLength:d,onValueChange:R,customInput:H,InputProps:{...N},inputProps:{...b,tabIndex:w},disabled:T,size:S,helperText:x,error:y,fullWidth:g,label:h,required:v},F)});p.displayName="NumberInput";var C=p;
7
7
 
8
8
  export { C as a };
@@ -1,6 +1,6 @@
1
1
  import { a } from './chunk-TLENQZN5.js';
2
2
  import { f } from './chunk-SKUW6ZCP.js';
3
- import { a as a$1 } from './chunk-TZX33SV2.js';
3
+ import { a as a$1 } from './chunk-37OZXM6O.js';
4
4
  import { a as a$2 } from './chunk-QS4ZTVL4.js';
5
5
  import { forwardRef } from 'react';
6
6
  import P from '@mui/material/IconButton';
@@ -1,6 +1,6 @@
1
- export { a as default } from '../../chunk-ZH4PNDLN.js';
1
+ export { a as default } from '../../chunk-ZZJPS54T.js';
2
2
  import '../../chunk-TLENQZN5.js';
3
3
  import '../../chunk-SKUW6ZCP.js';
4
- import '../../chunk-TZX33SV2.js';
4
+ import '../../chunk-37OZXM6O.js';
5
5
  import '../../chunk-QS4ZTVL4.js';
6
6
  import '../../chunk-27SELUQG.js';
@@ -1 +1 @@
1
- export { a as default } from '../../chunk-TZX33SV2.js';
1
+ export { a as default } from '../../chunk-37OZXM6O.js';
@@ -7,7 +7,7 @@ import { a as a$4 } from '../../chunk-QS4ZTVL4.js';
7
7
  import '../../chunk-27SELUQG.js';
8
8
  import { useState } from 'react';
9
9
  import h from '@mui/material/Checkbox';
10
- import T from '@mui/material/CircularProgress';
10
+ import F from '@mui/material/CircularProgress';
11
11
  import f from '@mui/material/Divider';
12
12
  import o from '@mui/material/Stack';
13
13
  import S from '@mui/material/Typography';
@@ -17,6 +17,6 @@ import U from '@mui/material/Button';
17
17
  import { styled } from '@mui/material/styles';
18
18
  import { jsx, jsxs } from 'react/jsx-runtime';
19
19
 
20
- var b=styled(U)(({theme:n})=>({borderColor:n.palette.grey[300]})),C=styled(Q)(({theme:n})=>({display:"flex",border:`1.5px solid ${n.palette.grey[300]}`,height:450,borderRadius:8,flex:1,overflow:"hidden"}));var Y=({selectedItems:n,items:R,loading:L,searchText:g,onAdd:B,onRemove:D,search:P,itemsTitle:z,selectedItemsTitle:W,additionalContent:H,enableSearchInSelectedItems:$,onSearch:K})=>{let[A,N]=useState(""),_=debounce(K,400),d=R.filter(e=>!n.some(a=>a.id===e.id)),M=n.filter(e=>e.name?.toLowerCase().includes(A.toLowerCase())),s=$?M:R.filter(e=>n.some(a=>a.id===e.id)),[i,p]=useState([]),[l,m]=useState([]),O=()=>{B(i),p([]);},j=()=>{D(l),m([]);},G=e=>{m(e?s:[]);},V=e=>{p(e?d:[]);},q=(e,a)=>{m(a?c=>[...c,e]:c=>c.filter(k=>k.id!==e.id));},J=(e,a)=>{p(a?c=>[...c,e]:c=>c.filter(k=>k.id!==e.id));},E=e=>{e.key==="Enter"&&e.preventDefault();};return jsx(o,{children:jsxs(o,{direction:"row",alignItems:"center",gap:3,children:[jsx(C,{flex:1,children:jsxs(o,{flex:1,overflow:"hidden",children:[jsxs(o,{direction:"row",gap:1,padding:2,children:[jsx(h,{size:"small",indeterminate:i.length>0&&i.length!==d.length,checked:i.length>0&&i.length===d.length,onChange:e=>V(e.target.checked)}),jsxs(o,{children:[jsx(S,{variant:"subtitle2",color:"text.primary",children:`${z} cadastrados(as)`}),jsx(S,{variant:"caption",color:"text.disabled",children:`${i.length}/${d.length} selecionados`})]})]}),jsx(f,{}),jsxs(o,{p:2,flex:1,overflow:"hidden",children:[jsxs(o,{direction:"row",gap:1,children:[jsx(a,{iconPosition:"start",placeholder:"Buscar",onKeyDown:E,size:"small",fullWidth:!0,trigger:"change",onSearch:e=>_(e)}),H]}),jsx(a$1,{isLoading:L,loading:jsx(o,{alignItems:"center",justifyContent:"center",flex:1,children:jsx(T,{})}),isEmpty:d.length===0,empty:jsx(a$2,{text:P?`Nenhum ${g} encontrado`:`Nenhum ${g} dispon\xEDvel`,sx:{svg:{height:140}}}),children:jsx(a$3,{sx:{maxHeight:280},children:d.map(e=>jsxs(o,{gap:1,marginTop:"8px",children:[jsxs(o,{direction:"row",gap:.5,alignItems:"center",marginTop:"8px",children:[jsx(h,{size:"small",checked:i.includes(e),onChange:a=>J(e,a.target.checked)}),e.label]}),jsx(f,{})]},e.id))})})]})]})}),jsxs(o,{gap:3,children:[jsx(b,{variant:"outlined",onClick:O,children:jsx(a$4,{icon:"ARROW_RIGHT_SIMPLE"})}),jsx(b,{variant:"outlined",onClick:j,children:jsx(a$4,{icon:"ARROW_LEFT_SIMPLE"})})]}),jsx(C,{flex:1,children:jsxs(o,{flex:1,overflow:"hidden",children:[jsxs(o,{direction:"row",gap:1,padding:2,children:[jsx(h,{size:"small",indeterminate:l.length>0&&l.length!==s.length,checked:l.length>0&&l.length===s.length,onChange:e=>G(e.target.checked)}),jsxs(o,{children:[jsx(S,{variant:"subtitle2",color:"text.primary",children:`${W} selecionados(as)`}),jsx(S,{variant:"caption",color:"text.disabled",children:`${l.length}/${s.length} selecionados`})]})]}),jsx(f,{}),jsxs(o,{p:2,gap:1,overflow:"hidden",children:[$&&jsx(a,{iconPosition:"start",placeholder:"Buscar",size:"small",fullWidth:!0,trigger:"change",onSearch:e=>N(e??""),onKeyDown:E}),jsx(a$1,{isLoading:L,loading:jsx(o,{alignItems:"center",justifyContent:"center",flex:1,children:jsx(T,{})}),isEmpty:s.length===0,empty:jsx(a$2,{text:A?`Nenhum ${g} encontrado`:`Nenhum ${g} selecionado`,sx:{svg:{height:140},marginTop:"56px",backgroundColor:"transparent"}}),children:jsx(a$3,{sx:{maxHeight:280},children:s.map(e=>jsxs(o,{gap:1,children:[jsxs(o,{direction:"row",gap:.5,alignItems:"center",marginTop:"8px",children:[jsx(h,{size:"small",checked:l.includes(e),onChange:a=>q(e,a.target.checked)}),e.label]}),jsx(f,{})]},e.id))})})]})]})})]})})},ke=Y;
20
+ var C=styled(U)(({theme:n})=>({borderColor:n.palette.grey[300]})),I=styled(Q)(({theme:n})=>({display:"flex",border:`1.5px solid ${n.palette.grey[300]}`,height:450,borderRadius:8,flex:1,overflow:"hidden"}));var Y=({selectedItems:n,items:T,loading:L,searchText:m,onAdd:B,onRemove:D,search:P,itemsTitle:z,selectedItemsTitle:W,additionalContent:H,enableSearchInSelectedItems:k,onSearch:K})=>{let[$,N]=useState(""),_=debounce(K,400),s=T.filter(e=>!n.some(a=>a.id===e.id)),M=n.filter(e=>e.name?.toLowerCase().includes($.toLowerCase())),d=k?M:n,[i,p]=useState([]),[l,g]=useState([]),O=()=>{B(i),p([]);},j=()=>{D(l),g([]);},G=e=>{g(e?d:[]);},V=e=>{p(e?s:[]);},q=(e,a)=>{g(a?c=>[...c,e]:c=>c.filter(u=>u.id!==e.id));},J=(e,a)=>{p(a?c=>[...c,e]:c=>c.filter(u=>u.id!==e.id));},A=e=>{e.key==="Enter"&&e.preventDefault();};return jsx(o,{children:jsxs(o,{direction:"row",alignItems:"center",gap:3,children:[jsx(I,{flex:1,children:jsxs(o,{flex:1,overflow:"hidden",children:[jsxs(o,{direction:"row",gap:1,padding:2,children:[jsx(h,{size:"small",indeterminate:i.length>0&&i.length!==s.length,checked:i.length>0&&i.length===s.length,onChange:e=>V(e.target.checked)}),jsxs(o,{children:[jsx(S,{variant:"subtitle2",color:"text.primary",children:`${z} cadastrados(as)`}),jsx(S,{variant:"caption",color:"text.disabled",children:`${i.length}/${s.length} selecionados`})]})]}),jsx(f,{}),jsxs(o,{p:2,flex:1,overflow:"hidden",children:[jsxs(o,{direction:"row",gap:1,children:[jsx(a,{iconPosition:"start",placeholder:"Buscar",onKeyDown:A,size:"small",fullWidth:!0,trigger:"change",onSearch:e=>_(e)}),H]}),jsx(a$1,{isLoading:L,loading:jsx(o,{alignItems:"center",justifyContent:"center",flex:1,children:jsx(F,{})}),isEmpty:s.length===0,empty:jsx(a$2,{text:P?`Nenhum ${m} encontrado`:`Nenhum ${m} dispon\xEDvel`,sx:{svg:{height:140}}}),children:jsx(a$3,{sx:{maxHeight:280},children:s.map(e=>jsxs(o,{gap:1,marginTop:"8px",children:[jsxs(o,{direction:"row",gap:.5,alignItems:"center",marginTop:"8px",children:[jsx(h,{size:"small",checked:i.includes(e),onChange:a=>J(e,a.target.checked)}),e.label]}),jsx(f,{})]},e.id))})})]})]})}),jsxs(o,{gap:3,children:[jsx(C,{variant:"outlined",onClick:O,children:jsx(a$4,{icon:"ARROW_RIGHT_SIMPLE"})}),jsx(C,{variant:"outlined",onClick:j,children:jsx(a$4,{icon:"ARROW_LEFT_SIMPLE"})})]}),jsx(I,{flex:1,children:jsxs(o,{flex:1,overflow:"hidden",children:[jsxs(o,{direction:"row",gap:1,padding:2,children:[jsx(h,{size:"small",indeterminate:l.length>0&&l.length!==d.length,checked:l.length>0&&l.length===d.length,onChange:e=>G(e.target.checked)}),jsxs(o,{children:[jsx(S,{variant:"subtitle2",color:"text.primary",children:`${W} selecionados(as)`}),jsx(S,{variant:"caption",color:"text.disabled",children:`${l.length}/${d.length} selecionados`})]})]}),jsx(f,{}),jsxs(o,{p:2,gap:1,overflow:"hidden",children:[k&&jsx(a,{iconPosition:"start",placeholder:"Buscar",size:"small",fullWidth:!0,trigger:"change",onSearch:e=>N(e??""),onKeyDown:A}),jsx(a$1,{isLoading:L,loading:jsx(o,{alignItems:"center",justifyContent:"center",flex:1,children:jsx(F,{})}),isEmpty:d.length===0,empty:jsx(a$2,{text:$&&k?`Nenhum ${m} encontrado`:`Nenhum ${m} selecionado`,sx:{svg:{height:140},marginTop:"56px",backgroundColor:"transparent"}}),children:jsx(a$3,{sx:{maxHeight:280},children:d.map(e=>jsxs(o,{gap:1,children:[jsxs(o,{direction:"row",gap:.5,alignItems:"center",marginTop:"8px",children:[jsx(h,{size:"small",checked:l.includes(e),onChange:a=>q(e,a.target.checked)}),e.label]}),jsx(f,{})]},e.id))})})]})]})})]})})},ke=Y;
21
21
 
22
22
  export { ke as default };
@@ -1,7 +1,7 @@
1
- import { a } from '../../../chunk-ZH4PNDLN.js';
1
+ import { a } from '../../../chunk-ZZJPS54T.js';
2
2
  import '../../../chunk-TLENQZN5.js';
3
3
  import '../../../chunk-SKUW6ZCP.js';
4
- import '../../../chunk-TZX33SV2.js';
4
+ import '../../../chunk-37OZXM6O.js';
5
5
  import '../../../chunk-QS4ZTVL4.js';
6
6
  import '../../../chunk-27SELUQG.js';
7
7
  import { useFormContext, Controller } from 'react-hook-form';
@@ -1,4 +1,4 @@
1
- import { a } from '../../../chunk-TZX33SV2.js';
1
+ import { a } from '../../../chunk-37OZXM6O.js';
2
2
  import { useFormContext, Controller } from 'react-hook-form';
3
3
  import { jsx } from 'react/jsx-runtime';
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zydon/common",
3
- "version": "2.0.47",
3
+ "version": "2.0.49",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",