@zydon/common 2.2.11 → 2.2.13
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-VAZ53BM6.js → chunk-ADVIQ6SV.js} +1 -1
- package/dist/chunk-CNZCR56X.js +17 -0
- package/dist/chunk-MW4PGDC4.js +18 -0
- package/dist/chunk-P72SJ5S3.js +11 -0
- package/dist/components/Autocomplete/index.js +1 -1
- package/dist/components/Incrementer/index.js +1 -1
- package/dist/components/form/Address/index.js +2 -2
- package/dist/components/form/Autocomplete/index.js +2 -2
- package/dist/components/form/Incrementer/index.js +1 -1
- package/dist/components/form/UploadAvatarWithCrop/index.js +1 -1
- package/dist/components/form/Webhook/index.js +2 -2
- package/dist/components/upload/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-3YZHNOL6.js +0 -18
- package/dist/chunk-WRPWZC6G.js +0 -11
- package/dist/chunk-WTUGAMJ5.js +0 -17
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { a } from './chunk-4Z2JJGWA.js';
|
|
2
|
+
import { createContext, forwardRef, useContext, useState, useMemo, useRef, useEffect } from 'react';
|
|
3
|
+
import pe, { autocompleteClasses } from '@mui/material/Autocomplete';
|
|
4
|
+
import ue from '@mui/material/CircularProgress';
|
|
5
|
+
import me from '@mui/material/TextField';
|
|
6
|
+
import { VariableSizeList } from 'react-window';
|
|
7
|
+
import q from '@mui/material/ListSubheader';
|
|
8
|
+
import F from '@mui/material/Stack';
|
|
9
|
+
import { useTheme, styled } from '@mui/material/styles';
|
|
10
|
+
import O from '@mui/material/Typography';
|
|
11
|
+
import K from '@mui/material/useMediaQuery';
|
|
12
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
13
|
+
import re from '@mui/material/Popper';
|
|
14
|
+
|
|
15
|
+
var R=8,Y=u=>{let{data:r,index:i,style:m}=u,n=r[i],{showValueInLabel:s,key:c,...f}=n[0],l={...m,top:m.top+R,paddingTop:8};return Object.prototype.hasOwnProperty.call(n,"group")?jsx(q,{component:"div",style:l,children:n.group},`list-box-item-group-${c}`):jsx(O,{component:"li",...f,noWrap:!0,style:l,children:jsxs(F,{component:"div",direction:"row",flex:1,gap:1,justifyContent:"start",children:[n[1].icon&&jsx(a,{icon:n[1].icon}),n[1].label,s&&jsxs(O,{variant:"inherit",color:"grey.400",children:["(",n[1].value,")"]})]})},`list-box-item-${c}`)},k=createContext({}),z=forwardRef((u,r)=>{let i=useContext(k);return jsx("div",{ref:r,...u,...i})});z.displayName="OuterElementType";var Z=u=>{let r=useRef(null);return useEffect(()=>{r.current!=null&&r.current.resetAfterIndex(0,!0);},[u]),r},ee=forwardRef(function(r,i){let{children:m,...n}=r,s=[];m.forEach(o=>{s.push(o),s.push(...o.children||[]);});let c=useTheme(),f=K(c.breakpoints.up("sm")),l=s.length,d=f?36:48,g=o=>Object.prototype.hasOwnProperty.call(o,"group")?48:d,C=()=>l>8?8*d:s.map(g).reduce((o,L)=>o+L,0),x=Z(l);return jsx("div",{ref:i,children:jsx(k.Provider,{value:n,children:jsx(VariableSizeList,{itemData:s,height:C()+2*R,width:"100%",ref:x,outerElementType:z,innerElementType:"ul",itemSize:o=>g(s[o]),overscanCount:5,itemCount:l,children:Y})})})}),M=ee;var N=styled(re)({[`& .${autocompleteClasses.listbox}`]:{boxSizing:"border-box","& ul":{padding:0,margin:0}}});var D=forwardRef(({label:u,value:r,options:i=[],loading:m,noOptionsText:n="Nenhum resultado encontrado.",loadingText:s="Carregando op\xE7\xF5es...",error:c,helperText:f,placeholder:l,onChange:d,groupBy:g,showValueInLabel:C,disabled:x,multiple:o,required:L,renderOption:P,tabIndex:H,onInputChange:T,onSearch:A,...X},J)=>{let[$,v]=useState(),V=e=>e&&typeof e=="object"?e.value.toString():e.toString(),y=useMemo(()=>o?(Array.isArray(r)?r:[]).reduce((p,h)=>{let E=i.find(U=>U.value.toString()===h.toString());return E?[...p,E]:[...p]},[]):i.find(t=>t.value.toString()===r?.toString())||null,[i,r,o]);return jsx(pe,{ref:J,value:$||y,onInputChange:(e,t,p)=>{if(T&&T(e,t,p),p==="input"){A&&A(t),v(t);return}v(void 0);},options:i,loading:m,noOptionsText:n,loadingText:s,disabled:m||x,disableListWrap:!0,PopperComponent:N,ListboxComponent:P?void 0:M,filterOptions:(e,t)=>e.filter(p=>`${p.value} ${p.label}`.toLocaleUpperCase().includes(t.inputValue.toLocaleUpperCase())),onChange:(e,t)=>{if(!t){d(o?[]:null);return}if(Array.isArray(t)){d(t.map(V));return}d(typeof t=="string"?t.toString():t.value.toString());},renderOption:(e,t,p,h)=>P?P(e,t,p,h):[{...e,showValueInLabel:C},t],renderGroup:e=>e,groupBy:g,multiple:o,renderInput:e=>jsx(me,{...e,placeholder:l,fullWidth:!0,error:!!c,helperText:f,label:u,required:L,InputProps:{...e.InputProps,...!o&&{startAdornment:y&&!Array.isArray(y)&&y.icon?jsx(a,{icon:y.icon}):void 0},endAdornment:jsxs(Fragment,{children:[m?jsx(ue,{color:"primary",size:20}):null,e.InputProps.endAdornment]})},inputProps:{...e.inputProps,tabIndex:H}}),...X})});D.displayName="Autocomplete";var De=D;
|
|
16
|
+
|
|
17
|
+
export { De as a };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { c, f } from './chunk-XQYZ3UC2.js';
|
|
2
|
+
import { a as a$3 } from './chunk-KVL7ASVR.js';
|
|
3
|
+
import { e } from './chunk-ANAHA3L6.js';
|
|
4
|
+
import { i } from './chunk-D27ND54J.js';
|
|
5
|
+
import { a } from './chunk-4Z2JJGWA.js';
|
|
6
|
+
import { a as a$2 } from './chunk-KFZEM7KS.js';
|
|
7
|
+
import { a as a$1 } from './chunk-M6QHAL4V.js';
|
|
8
|
+
import { useState, useEffect } from 'react';
|
|
9
|
+
import { useDropzone } from 'react-dropzone';
|
|
10
|
+
import A from '@mui/material/Box';
|
|
11
|
+
import T from '@mui/material/Typography';
|
|
12
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
13
|
+
import H from '@mui/material/Dialog';
|
|
14
|
+
import J from '@mui/material/Stack';
|
|
15
|
+
|
|
16
|
+
function M({sx:n,error:s,file:e,disabled:d,helperText:m,...f}){let{getRootProps:y,getInputProps:C,isDragActive:b,isDragReject:g,fileRejections:h}=useDropzone({multiple:!1,disabled:d,accept:{"image/*":[]},...f}),r=!!e,t=g||!!s,[w,v]=useState();useEffect(()=>{typeof e=="string"?v(e):e instanceof File&&v(URL.createObjectURL(e));},[e]);let R=r&&jsx("img",{alt:"avatar",src:w,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover"}}),x=jsxs(A,{className:"upload-placeholder",sx:{top:0,gap:1,left:0,width:1,height:1,zIndex:9,display:"flex",borderRadius:"50%",position:"absolute",alignItems:"center",color:"text.disabled",flexDirection:"column",justifyContent:"center",bgcolor:o=>i(o.vars.palette.grey["500Channel"],.08),transition:o=>o.transitions.create(["opacity"],{duration:o.transitions.duration.shorter}),"&:hover":{opacity:.72},...t&&{color:"error.main",bgcolor:o=>i(o.vars.palette.error.mainChannel,.08)},...r&&{zIndex:9,opacity:0,color:"common.white",bgcolor:o=>i(o.vars.palette.grey["900Channel"],.64)}},children:[jsx(a,{icon:"ADD_IMAGE",width:32}),jsx(T,{variant:"caption",children:r?"Atualizar foto":"Enviar foto"})]}),P=jsxs(A,{sx:{width:1,height:1,overflow:"hidden",borderRadius:"50%",position:"relative"},children:[R,x]});return jsxs(Fragment,{children:[jsxs(A,{...y(),sx:{p:1,m:"auto",width:144,height:144,cursor:"pointer",overflow:"hidden",borderRadius:"50%",border:o=>`1px dashed ${i(o.vars.palette.grey["500Channel"],.2)}`,...b&&{opacity:.72},...d&&{opacity:.48,pointerEvents:"none"},...t&&{borderColor:"error.main"},...r&&{...t&&{bgcolor:o=>i(o.vars.palette.error.mainChannel,.08)},"&:hover .upload-placeholder":{opacity:1}},...n},children:[jsx("input",{...C()}),P]}),m&&m,jsx(c,{files:h})]})}var K=({onFileCropped:n,onImageUploaded:s,onCancel:e$1,aspect:d,label:m,image:f$1="",uploading:y,file:C,tabIndex:b,maxSize:g,onDropRejected:h,...r})=>{let{id:t,setCropModalOpen:w,handleRemove:v,cropModalOpen:R,cancelChanges:x,saveChanges:P,previewImage:o,setCropper:F,preview:I,closePreviewImage:O,saving:W}=a$1({onFileCropped:n,onImageUploaded:s,onCancel:e$1}),{error:$}=a$2();return jsxs(Fragment,{children:[jsxs(J,{position:"relative",alignItems:"center",justifyContent:"center",children:[y&&jsx(f,{}),jsx(M,{...r,maxSize:g,id:t,file:C,onDrop:i=>{if(i.length>0){w(!0);let p=new FileReader;p.addEventListener("load",()=>{let D=p.result?.toString()||"";s(D),n(i[0]);}),p.readAsDataURL(i[0]);}},image:f$1,tabIndex:b,onDropRejected:(i,p)=>{let D=i[0]?.errors[0]?.code;s(void 0),n(void 0),$(D==="file-too-large"?`Imagem n\xE3o pode ser maior que ${e(g)}`:"Erro ao enviar imagem"),h&&h(i,p);}})]}),jsx(a$3,{id:t,open:R,onClose:x,label:m,aspectRatio:d,imageSrc:f$1,onRemove:v,onSave:P,onPreview:o,onInitialized:F,loading:W}),jsx(H,{open:!!I,onClose:O,scroll:"body",PaperProps:{sx:{p:2}},children:I&&jsx("img",{src:I,alt:"Preview"})})]})},ho=K;
|
|
17
|
+
|
|
18
|
+
export { M as a, ho as b };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { f } from './chunk-ANAHA3L6.js';
|
|
2
|
+
import { a } from './chunk-PV522B4W.js';
|
|
3
|
+
import { a as a$1 } from './chunk-4Z2JJGWA.js';
|
|
4
|
+
import { forwardRef, useState, useRef, useMemo, useCallback } from 'react';
|
|
5
|
+
import A from '@mui/material/IconButton';
|
|
6
|
+
import C from '@mui/material/InputAdornment';
|
|
7
|
+
import { jsx } from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
var M=forwardRef(({name:R,increment:r=1,updadteForMultiple:D,allowNegative:s=!1,value:d=0,onChange:c,minValue:n,maxValue:e,decimalScale:p,disabled:i,tabIndex:T,...w},B)=>{let[O,v]=useState(`incrementer-input-${Date.now()}`),I=useRef(null),u=Number(d||0),y=()=>{I.current&&(clearTimeout(I.current),I.current=null);},z=useMemo(()=>{let o=u-r;return typeof n=="number"&&o<n?!0:i||!s&&o<0},[i,u,r,n,s]),E=useMemo(()=>{let o=u+r;return typeof e=="number"&&o>e?!0:i},[i,u,r,e]),L=useCallback(()=>{if(y(),!s&&u-r<0)return;let o=u-r,t=n!==void 0&&o<n?n:f(o,p);c(t);},[u,r,n,p,c,s]),N=useCallback(()=>{y();let o=u+r,t=e!==void 0&&o>e?e:f(o,p);c(t);},[u,r,e,p,c]),_=useCallback(o=>{y();let t=Number(o.target.value||0);(r!==1||D)&&(t=t+r/2,t-=t%r),!s&&t<0&&(t=0),typeof n=="number"&&t<n&&(t=n),typeof e=="number"&&t>e&&(t=e),t=f(t,p),t===d&&(I.current=setTimeout(()=>{v(`incrementer-input-${Date.now()}`);},600)),c(t);},[d,r,n,e,p,c,D,s]);return jsx(a,{ref:B,name:R,value:u,minValue:n,maxValue:e,allowNegative:s,decimalScale:p,InputProps:{startAdornment:jsx(C,{position:"start",children:jsx(A,{size:"medium",onClick:L,disabled:z,children:jsx(a$1,{icon:"MINUS_SIGN",width:14,height:14,color:"primary.main"})})}),endAdornment:jsx(C,{position:"end",children:jsx(A,{size:"medium",onClick:N,disabled:E,children:jsx(a$1,{icon:"SIMPLE_ADD",width:14,height:14,color:"primary.main"})})}),inputProps:{style:{textAlign:"center"}}},inputProps:{tabIndex:T},onChange:_,disabled:i,...w},O)});M.displayName="Incrementer";var X=M;
|
|
10
|
+
|
|
11
|
+
export { X as a };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as a$2 } from '../../../chunk-P46BBUKR.js';
|
|
2
2
|
import { a as a$1 } from '../../../chunk-U7BKKRLD.js';
|
|
3
|
-
import { a as a$3 } from '../../../chunk-
|
|
3
|
+
import { a as a$3 } from '../../../chunk-ADVIQ6SV.js';
|
|
4
4
|
import '../../../chunk-QNAXGE5H.js';
|
|
5
|
-
import '../../../chunk-
|
|
5
|
+
import '../../../chunk-CNZCR56X.js';
|
|
6
6
|
import '../../../chunk-4Z2JJGWA.js';
|
|
7
7
|
import '../../../chunk-QDDGXWNG.js';
|
|
8
8
|
import E from '@mui/material/CircularProgress';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a as default } from '../../../chunk-
|
|
2
|
-
import '../../../chunk-
|
|
1
|
+
export { a as default } from '../../../chunk-ADVIQ6SV.js';
|
|
2
|
+
import '../../../chunk-CNZCR56X.js';
|
|
3
3
|
import '../../../chunk-4Z2JJGWA.js';
|
|
4
4
|
import '../../../chunk-QDDGXWNG.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a } from '../../../chunk-P46BBUKR.js';
|
|
2
|
-
import { a as a$2 } from '../../../chunk-
|
|
2
|
+
import { a as a$2 } from '../../../chunk-ADVIQ6SV.js';
|
|
3
3
|
import { a as a$3 } from '../../../chunk-AKR4HFCK.js';
|
|
4
|
-
import '../../../chunk-
|
|
4
|
+
import '../../../chunk-CNZCR56X.js';
|
|
5
5
|
import { a as a$1 } from '../../../chunk-4Z2JJGWA.js';
|
|
6
6
|
import '../../../chunk-QDDGXWNG.js';
|
|
7
7
|
import { useFormContext, useFieldArray } from 'react-hook-form';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a as UploadAvatar, b as UploadAvatarWithCrop, b as UploadWithCrop } from '../../chunk-
|
|
1
|
+
export { a as UploadAvatar, b as UploadAvatarWithCrop, b as UploadWithCrop } from '../../chunk-MW4PGDC4.js';
|
|
2
2
|
export { c as DeleteButton, a as MultiFilePreview, b as SingleFilePreview, d as Upload } from '../../chunk-JBH4Q2LO.js';
|
|
3
3
|
export { c as RejectionFiles } from '../../chunk-XQYZ3UC2.js';
|
|
4
4
|
import '../../chunk-KVL7ASVR.js';
|
package/package.json
CHANGED
package/dist/chunk-3YZHNOL6.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { c, f } from './chunk-XQYZ3UC2.js';
|
|
2
|
-
import { a as a$3 } from './chunk-KVL7ASVR.js';
|
|
3
|
-
import { e } from './chunk-ANAHA3L6.js';
|
|
4
|
-
import { i } from './chunk-D27ND54J.js';
|
|
5
|
-
import { a } from './chunk-4Z2JJGWA.js';
|
|
6
|
-
import { a as a$2 } from './chunk-KFZEM7KS.js';
|
|
7
|
-
import { a as a$1 } from './chunk-M6QHAL4V.js';
|
|
8
|
-
import { useState, useEffect } from 'react';
|
|
9
|
-
import { useDropzone } from 'react-dropzone';
|
|
10
|
-
import A from '@mui/material/Box';
|
|
11
|
-
import T from '@mui/material/Typography';
|
|
12
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
13
|
-
import H from '@mui/material/Dialog';
|
|
14
|
-
import J from '@mui/material/Stack';
|
|
15
|
-
|
|
16
|
-
function M({sx:n,error:s,file:e,disabled:d,helperText:m,...f}){let{getRootProps:y,getInputProps:C,isDragActive:b,isDragReject:g,fileRejections:h}=useDropzone({multiple:!1,disabled:d,accept:{"image/*":[]},...f}),r=!!e,t=g||!!s,[w,v]=useState("");useEffect(()=>{typeof e=="string"?v(e):e instanceof File&&v(URL.createObjectURL(e));},[e]);let R=r&&jsx("img",{alt:"avatar",src:w,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover"}}),x=jsxs(A,{className:"upload-placeholder",sx:{top:0,gap:1,left:0,width:1,height:1,zIndex:9,display:"flex",borderRadius:"50%",position:"absolute",alignItems:"center",color:"text.disabled",flexDirection:"column",justifyContent:"center",bgcolor:o=>i(o.vars.palette.grey["500Channel"],.08),transition:o=>o.transitions.create(["opacity"],{duration:o.transitions.duration.shorter}),"&:hover":{opacity:.72},...t&&{color:"error.main",bgcolor:o=>i(o.vars.palette.error.mainChannel,.08)},...r&&{zIndex:9,opacity:0,color:"common.white",bgcolor:o=>i(o.vars.palette.grey["900Channel"],.64)}},children:[jsx(a,{icon:"ADD_IMAGE",width:32}),jsx(T,{variant:"caption",children:r?"Atualizar foto":"Enviar foto"})]}),P=jsxs(A,{sx:{width:1,height:1,overflow:"hidden",borderRadius:"50%",position:"relative"},children:[R,x]});return jsxs(Fragment,{children:[jsxs(A,{...y(),sx:{p:1,m:"auto",width:144,height:144,cursor:"pointer",overflow:"hidden",borderRadius:"50%",border:o=>`1px dashed ${i(o.vars.palette.grey["500Channel"],.2)}`,...b&&{opacity:.72},...d&&{opacity:.48,pointerEvents:"none"},...t&&{borderColor:"error.main"},...r&&{...t&&{bgcolor:o=>i(o.vars.palette.error.mainChannel,.08)},"&:hover .upload-placeholder":{opacity:1}},...n},children:[jsx("input",{...C()}),P]}),m&&m,jsx(c,{files:h})]})}var K=({onFileCropped:n,onImageUploaded:s,onCancel:e$1,aspect:d,label:m,image:f$1="",uploading:y,file:C,tabIndex:b,maxSize:g,onDropRejected:h,...r})=>{let{id:t,setCropModalOpen:w,handleRemove:v,cropModalOpen:R,cancelChanges:x,saveChanges:P,previewImage:o,setCropper:F,preview:I,closePreviewImage:O,saving:W}=a$1({onFileCropped:n,onImageUploaded:s,onCancel:e$1}),{error:$}=a$2();return jsxs(Fragment,{children:[jsxs(J,{position:"relative",alignItems:"center",justifyContent:"center",children:[y&&jsx(f,{}),jsx(M,{...r,maxSize:g,id:t,file:C,onDrop:i=>{if(i.length>0){w(!0);let p=new FileReader;p.addEventListener("load",()=>{let D=p.result?.toString()||"";s(D),n(i[0]);}),p.readAsDataURL(i[0]);}},image:f$1,tabIndex:b,onDropRejected:(i,p)=>{let D=i[0]?.errors[0]?.code;s(void 0),n(void 0),$(D==="file-too-large"?`Imagem n\xE3o pode ser maior que ${e(g)}`:"Erro ao enviar imagem"),h&&h(i,p);}})]}),jsx(a$3,{id:t,open:R,onClose:x,label:m,aspectRatio:d,imageSrc:f$1,onRemove:v,onSave:P,onPreview:o,onInitialized:F,loading:W}),jsx(H,{open:!!I,onClose:O,scroll:"body",PaperProps:{sx:{p:2}},children:I&&jsx("img",{src:I,alt:"Preview"})})]})},ho=K;
|
|
17
|
-
|
|
18
|
-
export { M as a, ho as b };
|
package/dist/chunk-WRPWZC6G.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { f } from './chunk-ANAHA3L6.js';
|
|
2
|
-
import { a } from './chunk-PV522B4W.js';
|
|
3
|
-
import { a as a$1 } from './chunk-4Z2JJGWA.js';
|
|
4
|
-
import { forwardRef, useState, useRef, useMemo, useCallback } from 'react';
|
|
5
|
-
import A from '@mui/material/IconButton';
|
|
6
|
-
import C from '@mui/material/InputAdornment';
|
|
7
|
-
import { jsx } from 'react/jsx-runtime';
|
|
8
|
-
|
|
9
|
-
var M=forwardRef(({name:R,increment:r=1,updadteForMultiple:h,allowNegative:s=!1,value:D=0,onChange:c,minValue:n,maxValue:e,decimalScale:p,disabled:i,tabIndex:T,...w},B)=>{let[O,v]=useState(`incrementer-input-${Date.now()}`),I=useRef(null),u=Number(D||0),d=()=>{I.current&&(clearTimeout(I.current),I.current=null);},z=useMemo(()=>{let o=u-r;return typeof n=="number"&&o<n?!0:i||!s&&o<0},[i,u,r,n,s]),E=useMemo(()=>{let o=u+r;return typeof e=="number"&&o>e?!0:i},[i,u,r,e]),L=useCallback(()=>{if(d(),!s&&u-r<0)return;let o=u-r,t=n!==void 0&&o<n?n:f(o,p);c(t);},[u,r,n,p,c,s]),N=useCallback(()=>{d();let o=u+r,t=e!==void 0&&o>e?e:f(o,p);c(t);},[u,r,e,p,c]),_=useCallback(o=>{d();let t=Number(o.target.value||0);(r!==1||h)&&(t=t+r/2,t-=t%r),!s&&t<0&&(t=0),typeof n=="number"&&t<n&&(t=n),typeof e=="number"&&t>e&&(t=e),t=f(t,p),t===D&&(I.current=setTimeout(()=>{v(`incrementer-input-${Date.now()}`);},600)),c(t);},[r,n,e,p,c,h,s]);return jsx(a,{ref:B,name:R,value:u,minValue:n,maxValue:e,allowNegative:s,decimalScale:p,InputProps:{startAdornment:jsx(C,{position:"start",children:jsx(A,{size:"medium",onClick:L,disabled:z,children:jsx(a$1,{icon:"MINUS_SIGN",width:14,height:14,color:"primary.main"})})}),endAdornment:jsx(C,{position:"end",children:jsx(A,{size:"medium",onClick:N,disabled:E,children:jsx(a$1,{icon:"SIMPLE_ADD",width:14,height:14,color:"primary.main"})})}),inputProps:{style:{textAlign:"center"}}},inputProps:{tabIndex:T},onChange:_,disabled:i,...w},O)});M.displayName="Incrementer";var X=M;
|
|
10
|
-
|
|
11
|
-
export { X as a };
|
package/dist/chunk-WTUGAMJ5.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { a } from './chunk-4Z2JJGWA.js';
|
|
2
|
-
import { createContext, forwardRef, useContext, useState, useMemo, useRef, useEffect } from 'react';
|
|
3
|
-
import pe, { autocompleteClasses } from '@mui/material/Autocomplete';
|
|
4
|
-
import ue from '@mui/material/CircularProgress';
|
|
5
|
-
import me from '@mui/material/TextField';
|
|
6
|
-
import { VariableSizeList } from 'react-window';
|
|
7
|
-
import q from '@mui/material/ListSubheader';
|
|
8
|
-
import F from '@mui/material/Stack';
|
|
9
|
-
import { useTheme, styled } from '@mui/material/styles';
|
|
10
|
-
import O from '@mui/material/Typography';
|
|
11
|
-
import K from '@mui/material/useMediaQuery';
|
|
12
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
13
|
-
import re from '@mui/material/Popper';
|
|
14
|
-
|
|
15
|
-
var R=8,Y=u=>{let{data:r,index:i,style:m}=u,n=r[i],{showValueInLabel:s,...d}=n[0],a$1={...m,top:m.top+R,paddingTop:8};return Object.prototype.hasOwnProperty.call(n,"group")?jsx(q,{component:"div",style:a$1,children:n.group},n.key):jsx(O,{component:"li",...d,noWrap:!0,style:a$1,children:jsxs(F,{component:"div",direction:"row",flex:1,gap:1,justifyContent:"start",children:[n[1].icon&&jsx(a,{icon:n[1].icon}),n[1].label,s&&jsxs(O,{variant:"inherit",color:"grey.400",children:["(",n[1].value,")"]})]})})},z=createContext({}),M=forwardRef((u,r)=>{let i=useContext(z);return jsx("div",{ref:r,...u,...i})});M.displayName="OuterElementType";var Z=u=>{let r=useRef(null);return useEffect(()=>{r.current!=null&&r.current.resetAfterIndex(0,!0);},[u]),r},ee=forwardRef(function(r,i){let{children:m,...n}=r,s=[];m.forEach(o=>{s.push(o),s.push(...o.children||[]);});let d=useTheme(),a=K(d.breakpoints.up("sm")),f=s.length,c=a?36:48,g=o=>Object.prototype.hasOwnProperty.call(o,"group")?48:c,C=()=>f>8?8*c:s.map(g).reduce((o,P)=>o+P,0),L=Z(f);return jsx("div",{ref:i,children:jsx(z.Provider,{value:n,children:jsx(VariableSizeList,{itemData:s,height:C()+2*R,width:"100%",ref:L,outerElementType:M,innerElementType:"ul",itemSize:o=>g(s[o]),overscanCount:5,itemCount:f,children:Y})})})}),k=ee;var N=styled(re)({[`& .${autocompleteClasses.listbox}`]:{boxSizing:"border-box","& ul":{padding:0,margin:0}}});var D=forwardRef(({label:u,value:r,options:i=[],loading:m,noOptionsText:n="Nenhum resultado encontrado.",loadingText:s="Carregando op\xE7\xF5es...",error:d,helperText:a$1,placeholder:f,onChange:c,groupBy:g,showValueInLabel:C,disabled:L,multiple:o,required:P,renderOption:x,tabIndex:H,onInputChange:T,onSearch:A,...X},J)=>{let[V,v]=useState(),U=e=>e&&typeof e=="object"?e.value.toString():e.toString(),y=useMemo(()=>o?(Array.isArray(r)?r:[]).reduce((p,h)=>{let E=i.find(W=>W.value.toString()===h.toString());return E?[...p,E]:[...p]},[]):i.find(t=>t.value.toString()===r?.toString())||null,[i,r,o]);return jsx(pe,{ref:J,value:V||y,onInputChange:(e,t,p)=>{if(T&&T(e,t,p),p==="input"){A&&A(t),v(t);return}v(void 0);},options:i,loading:m,noOptionsText:n,loadingText:s,disabled:m||L,disableListWrap:!0,PopperComponent:N,ListboxComponent:x?void 0:k,filterOptions:(e,t)=>e.filter(p=>`${p.value} ${p.label}`.toLocaleUpperCase().includes(t.inputValue.toLocaleUpperCase())),onChange:(e,t)=>{if(!t){c(o?[]:null);return}if(Array.isArray(t)){c(t.map(U));return}c(typeof t=="string"?t.toString():t.value.toString());},renderOption:(e,t,p,h)=>x?x(e,t,p,h):[{...e,showValueInLabel:C},t],renderGroup:e=>e,groupBy:g,multiple:o,renderInput:e=>jsx(me,{...e,placeholder:f,fullWidth:!0,error:!!d,helperText:a$1,label:u,required:P,InputProps:{...e.InputProps,...!o&&{startAdornment:y&&!Array.isArray(y)&&y.icon?jsx(a,{icon:y.icon}):void 0},endAdornment:jsxs(Fragment,{children:[m?jsx(ue,{color:"primary",size:20}):null,e.InputProps.endAdornment]})},inputProps:{...e.inputProps,tabIndex:H}}),...X})});D.displayName="Autocomplete";var De=D;
|
|
16
|
-
|
|
17
|
-
export { De as a };
|