@zydon/common 2.0.71 → 2.0.73
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-GVG6OKER.js +17 -0
- package/dist/{chunk-C67MHZ3C.js → chunk-SAYKUYAS.js} +1 -1
- package/dist/components/Autocomplete/index.js +1 -1
- package/dist/components/SelectableCards/index.js +1 -1
- package/dist/components/SwapList/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/SelectableCards/index.js +1 -1
- package/dist/components/form/Webhook/index.js +2 -2
- package/dist/components/upload/index.js +1 -1
- package/dist/hooks/useAutocomplete.d.ts +11 -0
- package/dist/hooks/useAutocomplete.js +5 -0
- package/dist/hooks/useLocalStorage.js +1 -1
- package/dist/theme/styles/index.d.ts +4 -4
- package/dist/types/autoComplete.d.ts +1 -0
- package/package.json +1 -1
- package/dist/chunk-QL4N5F55.js +0 -17
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { a } from './chunk-QACPD766.js';
|
|
2
|
+
import { createContext, forwardRef, useContext, useMemo, useRef, useEffect } from 'react';
|
|
3
|
+
import ne, { autocompleteClasses } from '@mui/material/Autocomplete';
|
|
4
|
+
import ie from '@mui/material/CircularProgress';
|
|
5
|
+
import se from '@mui/material/TextField';
|
|
6
|
+
import { VariableSizeList } from 'react-window';
|
|
7
|
+
import G from '@mui/material/ListSubheader';
|
|
8
|
+
import _ from '@mui/material/Stack';
|
|
9
|
+
import { useTheme, styled } from '@mui/material/styles';
|
|
10
|
+
import E from '@mui/material/Typography';
|
|
11
|
+
import F from '@mui/material/useMediaQuery';
|
|
12
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
13
|
+
import ee from '@mui/material/Popper';
|
|
14
|
+
|
|
15
|
+
var I=8,Q=m=>{let{data:o,index:i,style:p}=m,n=o[i],{showValueInLabel:s,...f}=n[0],c={...p,top:p.top+I,paddingTop:8};return Object.prototype.hasOwnProperty.call(n,"group")?jsx(G,{component:"div",style:c,children:n.group},n.key):jsx(E,{component:"li",...f,noWrap:!0,style:c,children:jsxs(_,{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(E,{variant:"inherit",color:"grey.400",children:["(",n[1].value,")"]})]})})},R=createContext({}),z=forwardRef((m,o)=>{let i=useContext(R);return jsx("div",{ref:o,...m,...i})});z.displayName="OuterElementType";var K=m=>{let o=useRef(null);return useEffect(()=>{o.current!=null&&o.current.resetAfterIndex(0,!0);},[m]),o},Y=forwardRef(function(o,i){let{children:p,...n}=o,s=[];p.forEach(r=>{s.push(r),s.push(...r.children||[]);});let f=useTheme(),c=F(f.breakpoints.up("sm")),y=s.length,l=c?36:48,h=r=>Object.prototype.hasOwnProperty.call(r,"group")?48:l,C=()=>y>8?8*l:s.map(h).reduce((r,P)=>r+P,0),L=K(y);return jsx("div",{ref:i,children:jsx(R.Provider,{value:n,children:jsx(VariableSizeList,{itemData:s,height:C()+2*I,width:"100%",ref:L,outerElementType:z,innerElementType:"ul",itemSize:r=>h(s[r]),overscanCount:5,itemCount:y,children:Q})})})}),M=Y;var k=styled(ee)({[`& .${autocompleteClasses.listbox}`]:{boxSizing:"border-box","& ul":{padding:0,margin:0}}});var N=forwardRef(({label:m,value:o,options:i=[],loading:p,noOptionsText:n="Nenhuma resultado encontrado.",loadingText:s="Carregando op\xE7\xF5es...",error:f,helperText:c,placeholder:y,onChange:l,groupBy:h,showValueInLabel:C,disabled:L,multiple:r,required:P,renderOption:x,tabIndex:D,onInputChange:T,onSearch:A,...H},X)=>{let J=e=>e&&typeof e=="object"?e.value.toString():e.toString(),d=useMemo(()=>r?(Array.isArray(o)?o:[]).reduce((u,g)=>{let v=i.find(V=>V.value.toString()===g.toString());return v?[...u,v]:[...u]},[]):i.find(t=>t.value.toString()===o?.toString())||null,[i,o,r]);return jsx(ne,{ref:X,value:d,onInputChange:(e,t,u)=>{!p&&!d&&l(r?[]:null),T&&T(e,t,u),A&&e.type==="change"&&A(t);},options:i,loading:p,noOptionsText:n,loadingText:s,disabled:p||L,disableListWrap:!0,PopperComponent:k,ListboxComponent:x?void 0:M,filterOptions:(e,t)=>e.filter(u=>`${u.value} ${u.label}`.toLocaleUpperCase().includes(t.inputValue.toLocaleUpperCase())),onChange:(e,t)=>{if(!t){l(r?[]:null);return}if(Array.isArray(t)){l(t.map(J));return}l(typeof t=="string"?t.toString():t.value.toString());},renderOption:(e,t,u,g)=>x?x(e,t,u,g):[{...e,showValueInLabel:C},t],renderGroup:e=>e,groupBy:h,multiple:r,renderInput:e=>jsx(se,{...e,placeholder:y,fullWidth:!0,error:!!f,helperText:c,label:m,required:P,InputProps:{...e.InputProps,...!r&&{startAdornment:d&&!Array.isArray(d)&&d.icon?jsx(a,{icon:d.icon}):void 0},endAdornment:jsxs(Fragment,{children:[p?jsx(ie,{color:"primary",size:20}):null,e.InputProps.endAdornment]})},inputProps:{...e.inputProps,tabIndex:D}}),...H})});N.displayName="Autocomplete";var Me=N;
|
|
16
|
+
|
|
17
|
+
export { Me as a };
|
|
@@ -2,7 +2,7 @@ export { a as default } from '../../chunk-DSVM26GM.js';
|
|
|
2
2
|
import '../../chunk-SLNHBQPA.js';
|
|
3
3
|
import '../../chunk-TWGGHTU5.js';
|
|
4
4
|
import '../../chunk-2MVQI7NJ.js';
|
|
5
|
-
import '../../chunk-ZDHXW74M.js';
|
|
6
5
|
import '../../chunk-E5MGOPPQ.js';
|
|
6
|
+
import '../../chunk-ZDHXW74M.js';
|
|
7
7
|
import '../../chunk-QACPD766.js';
|
|
8
8
|
import '../../chunk-S3U3CT7C.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a } from '../../chunk-SLNHBQPA.js';
|
|
2
2
|
import { a as a$1 } from '../../chunk-TWGGHTU5.js';
|
|
3
3
|
import { a as a$2 } from '../../chunk-2MVQI7NJ.js';
|
|
4
|
-
import '../../chunk-ZDHXW74M.js';
|
|
5
4
|
import { a as a$3 } from '../../chunk-E5MGOPPQ.js';
|
|
5
|
+
import '../../chunk-ZDHXW74M.js';
|
|
6
6
|
import { a as a$4 } from '../../chunk-QACPD766.js';
|
|
7
7
|
import '../../chunk-S3U3CT7C.js';
|
|
8
8
|
import { useState } from 'react';
|
|
@@ -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-SAYKUYAS.js';
|
|
4
4
|
import '../../../chunk-QNAXGE5H.js';
|
|
5
|
-
import '../../../chunk-
|
|
5
|
+
import '../../../chunk-GVG6OKER.js';
|
|
6
6
|
import '../../../chunk-QACPD766.js';
|
|
7
7
|
import '../../../chunk-S3U3CT7C.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-SAYKUYAS.js';
|
|
2
|
+
import '../../../chunk-GVG6OKER.js';
|
|
3
3
|
import '../../../chunk-QACPD766.js';
|
|
4
4
|
import '../../../chunk-S3U3CT7C.js';
|
|
@@ -2,8 +2,8 @@ import { a } from '../../../chunk-DSVM26GM.js';
|
|
|
2
2
|
import '../../../chunk-SLNHBQPA.js';
|
|
3
3
|
import '../../../chunk-TWGGHTU5.js';
|
|
4
4
|
import '../../../chunk-2MVQI7NJ.js';
|
|
5
|
-
import '../../../chunk-ZDHXW74M.js';
|
|
6
5
|
import '../../../chunk-E5MGOPPQ.js';
|
|
6
|
+
import '../../../chunk-ZDHXW74M.js';
|
|
7
7
|
import '../../../chunk-QACPD766.js';
|
|
8
8
|
import '../../../chunk-S3U3CT7C.js';
|
|
9
9
|
import { useFormContext, Controller } from 'react-hook-form';
|
|
@@ -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-SAYKUYAS.js';
|
|
3
|
+
import '../../../chunk-GVG6OKER.js';
|
|
3
4
|
import { a as a$3 } from '../../../chunk-EXDRISPF.js';
|
|
4
|
-
import '../../../chunk-QL4N5F55.js';
|
|
5
5
|
import { a as a$1 } from '../../../chunk-QACPD766.js';
|
|
6
6
|
import '../../../chunk-S3U3CT7C.js';
|
|
7
7
|
import { useFormContext, useFieldArray } from 'react-hook-form';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { c as DeleteButton, a as MultiFilePreview, b as SingleFilePreview, d as Upload } from '../../chunk-2ZJD6RIG.js';
|
|
2
1
|
export { a as UploadAvatar, b as UploadAvatarWithCrop, b as UploadWithCrop } from '../../chunk-KDE2GJU6.js';
|
|
2
|
+
export { c as DeleteButton, a as MultiFilePreview, b as SingleFilePreview, d as Upload } from '../../chunk-2ZJD6RIG.js';
|
|
3
3
|
export { c as RejectionFiles } from '../../chunk-YWDAFYKL.js';
|
|
4
4
|
import '../../chunk-TKK4NNZZ.js';
|
|
5
5
|
import '../../chunk-BVOUJHSR.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Option } from '../types/option.js';
|
|
2
|
+
import '../types/icon.js';
|
|
3
|
+
|
|
4
|
+
declare const useAutocomplete: (options?: Option[], initialValue?: Option | Option[]) => {
|
|
5
|
+
options: Option[];
|
|
6
|
+
search: string | undefined;
|
|
7
|
+
onSearch: (search?: string) => void;
|
|
8
|
+
onSelectValue: (selected: string | string[]) => void;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { useAutocomplete as default };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
|
|
3
|
+
var p=(n=[],s)=>{let[a,u]=useState(),[c,o]=useState(),f=t=>u(t),l=t=>{(!t||t.length===0)&&o(void 0),o(typeof t=="string"?n.find(r=>r.value===t):n.filter(r=>t.includes(r.value)));},e=c||s;return {options:e?[...Array.isArray(e)?[...e]:[e],...n]:n,search:a,onSearch:f,onSelectValue:l}},m=p;
|
|
4
|
+
|
|
5
|
+
export { m as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { a as a$1 } from '../chunk-4INDXVIX.js';
|
|
1
2
|
import { a } from '../chunk-Z2TDWMRU.js';
|
|
2
3
|
import '../chunk-3APKMSVD.js';
|
|
3
|
-
import { a as a$1 } from '../chunk-4INDXVIX.js';
|
|
4
4
|
import { useCallback, useState, useEffect } from 'react';
|
|
5
5
|
|
|
6
6
|
var h=typeof window>"u",p=(r,t,o={})=>{let{initializeWithValue:l=!0}=o,S=useCallback(e=>o.serializer?o.serializer(e):JSON.stringify(e),[o]),d=useCallback(e=>{if(o.deserializer)return o.deserializer(e);if(e==="undefined")return;let n=t instanceof Function?t():t,g;try{g=JSON.parse(e);}catch{return n}return g},[o,t]),a$2=useCallback(()=>{let e=t instanceof Function?t():t;if(h)return e;try{let n=window.localStorage.getItem(r);return n?d(n):e}catch{return e}},[t,r,d]),[w,s]=useState(()=>l?a$2():t instanceof Function?t():t),T=a(e=>{try{let n=e instanceof Function?e(a$2()):e;window.localStorage.setItem(r,S(n)),s(n),window.dispatchEvent(new StorageEvent("local-storage",{key:r}));}catch{}}),m=a(()=>{let e=t instanceof Function?t():t;window.localStorage.removeItem(r),s(e),window.dispatchEvent(new StorageEvent("local-storage",{key:r}));});useEffect(()=>{s(a$2());},[r]);let f=useCallback(e=>{e.key&&e.key!==r||s(a$2());},[r,a$2]);return a$1("storage",f),a$1("local-storage",f),[w,T,m]},I=p;
|
|
@@ -445,7 +445,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
445
445
|
zIndex?: csstype.Property.ZIndex | readonly NonNullable<csstype.Property.ZIndex | undefined>[] | readonly ((string & {}) | csstype.Globals | "auto")[] | undefined;
|
|
446
446
|
zoom?: csstype.Property.Zoom | readonly NonNullable<csstype.Property.Zoom | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reset")[] | undefined;
|
|
447
447
|
all?: csstype.Globals | readonly NonNullable<csstype.Globals | undefined>[] | readonly csstype.Globals[] | undefined;
|
|
448
|
-
animation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "
|
|
448
|
+
animation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reverse" | "linear" | "none" | "auto" | "both" | "alternate" | "alternate-reverse" | "backwards" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start")[] | undefined;
|
|
449
449
|
animationRange?: csstype.Property.AnimationRange<string | number> | readonly NonNullable<csstype.Property.AnimationRange<string | number> | undefined>[] | readonly (string | (string & {}))[] | undefined;
|
|
450
450
|
background?: csstype.Property.Background<string | number> | readonly NonNullable<csstype.Property.Background<string | number> | undefined>[] | readonly (string | (string & {}))[] | undefined;
|
|
451
451
|
border?: csstype.Property.Border<string | number> | readonly (string | (string & {}))[] | readonly NonNullable<csstype.Property.Border<string | number> | undefined>[] | undefined;
|
|
@@ -729,7 +729,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
729
729
|
WebkitUserModify?: csstype.Property.WebkitUserModify | readonly NonNullable<csstype.Property.WebkitUserModify | undefined>[] | readonly csstype.Property.WebkitUserModify[] | undefined;
|
|
730
730
|
WebkitUserSelect?: csstype.Property.UserSelect | readonly NonNullable<csstype.Property.UserSelect | undefined>[] | readonly csstype.Property.UserSelect[] | undefined;
|
|
731
731
|
WebkitWritingMode?: csstype.Property.WritingMode | readonly NonNullable<csstype.Property.WritingMode | undefined>[] | readonly csstype.Property.WritingMode[] | undefined;
|
|
732
|
-
MozAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "
|
|
732
|
+
MozAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reverse" | "linear" | "none" | "auto" | "both" | "alternate" | "alternate-reverse" | "backwards" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start")[] | undefined;
|
|
733
733
|
MozBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "none" | "repeat" | "round" | "space" | "stretch")[] | undefined;
|
|
734
734
|
MozColumnRule?: csstype.Property.ColumnRule<string | number> | readonly NonNullable<csstype.Property.ColumnRule<string | number> | undefined>[] | readonly (string | (string & {}))[] | undefined;
|
|
735
735
|
MozColumns?: csstype.Property.Columns<string | number> | readonly NonNullable<csstype.Property.Columns<string | number> | undefined>[] | readonly (string | (string & {}))[] | undefined;
|
|
@@ -741,7 +741,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
741
741
|
msScrollSnapX?: readonly string[] | csstype.Property.MsScrollSnapX | readonly csstype.Property.MsScrollSnapX[] | undefined;
|
|
742
742
|
msScrollSnapY?: readonly string[] | csstype.Property.MsScrollSnapY | readonly csstype.Property.MsScrollSnapY[] | undefined;
|
|
743
743
|
msTransition?: readonly string[] | csstype.Property.Transition<string & {}> | readonly csstype.Property.Transition<string & {}>[] | undefined;
|
|
744
|
-
WebkitAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "
|
|
744
|
+
WebkitAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reverse" | "linear" | "none" | "auto" | "both" | "alternate" | "alternate-reverse" | "backwards" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start")[] | undefined;
|
|
745
745
|
WebkitBorderBefore?: csstype.Property.WebkitBorderBefore<string | number> | readonly NonNullable<csstype.Property.WebkitBorderBefore<string | number> | undefined>[] | readonly (string | (string & {}))[] | undefined;
|
|
746
746
|
WebkitBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "none" | "repeat" | "round" | "space" | "stretch")[] | undefined;
|
|
747
747
|
WebkitBorderRadius?: csstype.Property.BorderRadius<string | number> | readonly NonNullable<csstype.Property.BorderRadius<string | number> | undefined>[] | readonly (string | (string & {}))[] | undefined;
|
|
@@ -831,7 +831,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
831
831
|
MozTransitionTimingFunction?: readonly string[] | csstype.Property.TransitionTimingFunction | readonly csstype.Property.TransitionTimingFunction[] | undefined;
|
|
832
832
|
MozUserInput?: csstype.Property.MozUserInput | readonly NonNullable<csstype.Property.MozUserInput | undefined>[] | readonly csstype.Property.MozUserInput[] | undefined;
|
|
833
833
|
msImeMode?: csstype.Property.ImeMode | readonly NonNullable<csstype.Property.ImeMode | undefined>[] | readonly csstype.Property.ImeMode[] | undefined;
|
|
834
|
-
OAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "
|
|
834
|
+
OAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reverse" | "linear" | "none" | "auto" | "both" | "alternate" | "alternate-reverse" | "backwards" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start")[] | undefined;
|
|
835
835
|
OAnimationDelay?: readonly string[] | csstype.Property.AnimationDelay<string & {}> | readonly csstype.Property.AnimationDelay<string & {}>[] | undefined;
|
|
836
836
|
OAnimationDirection?: readonly string[] | csstype.Property.AnimationDirection | readonly csstype.Property.AnimationDirection[] | undefined;
|
|
837
837
|
OAnimationDuration?: readonly string[] | csstype.Property.AnimationDuration<string & {}> | readonly csstype.Property.AnimationDuration<string & {}>[] | undefined;
|
package/package.json
CHANGED
package/dist/chunk-QL4N5F55.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { a } from './chunk-QACPD766.js';
|
|
2
|
-
import { createContext, forwardRef, useContext, useMemo, useRef, useEffect } from 'react';
|
|
3
|
-
import re, { autocompleteClasses } from '@mui/material/Autocomplete';
|
|
4
|
-
import oe from '@mui/material/CircularProgress';
|
|
5
|
-
import ne from '@mui/material/TextField';
|
|
6
|
-
import { VariableSizeList } from 'react-window';
|
|
7
|
-
import j from '@mui/material/ListSubheader';
|
|
8
|
-
import B from '@mui/material/Stack';
|
|
9
|
-
import { useTheme, styled } from '@mui/material/styles';
|
|
10
|
-
import v from '@mui/material/Typography';
|
|
11
|
-
import _ from '@mui/material/useMediaQuery';
|
|
12
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
13
|
-
import Y from '@mui/material/Popper';
|
|
14
|
-
|
|
15
|
-
var O=8,q=u=>{let{data:r,index:i,style:p}=u,n=r[i],{showValueInLabel:s,...f}=n[0],c={...p,top:p.top+O,paddingTop:8};return Object.prototype.hasOwnProperty.call(n,"group")?jsx(j,{component:"div",style:c,children:n.group},n.key):jsx(v,{component:"li",...f,noWrap:!0,style:c,children:jsxs(B,{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(v,{variant:"inherit",color:"grey.400",children:["(",n[1].value,")"]})]})})},I=createContext({}),w=forwardRef((u,r)=>{let i=useContext(I);return jsx("div",{ref:r,...u,...i})});w.displayName="OuterElementType";var F=u=>{let r=useRef(null);return useEffect(()=>{r.current!=null&&r.current.resetAfterIndex(0,!0);},[u]),r},Q=forwardRef(function(r,i){let{children:p,...n}=r,s=[];p.forEach(t=>{s.push(t),s.push(...t.children||[]);});let f=useTheme(),c=_(f.breakpoints.up("sm")),y=s.length,m=c?36:48,h=t=>Object.prototype.hasOwnProperty.call(t,"group")?48:m,C=()=>y>8?8*m:s.map(h).reduce((t,P)=>t+P,0),L=F(y);return jsx("div",{ref:i,children:jsx(I.Provider,{value:n,children:jsx(VariableSizeList,{itemData:s,height:C()+2*O,width:"100%",ref:L,outerElementType:w,innerElementType:"ul",itemSize:t=>h(s[t]),overscanCount:5,itemCount:y,children:q})})})}),R=Q;var z=styled(Y)({[`& .${autocompleteClasses.listbox}`]:{boxSizing:"border-box","& ul":{padding:0,margin:0}}});var M=forwardRef(({label:u,value:r,options:i=[],loading:p,noOptionsText:n="Nenhuma resultado encontrado.",loadingText:s="Carregando op\xE7\xF5es...",error:f,helperText:c,placeholder:y,onChange:m,groupBy:h,showValueInLabel:C,disabled:L,multiple:t,required:P,renderOption:x,tabIndex:k,...N},D)=>{let H=e=>e&&typeof e=="object"?e.value.toString():e.toString(),d=useMemo(()=>t?(Array.isArray(r)?r:[]).reduce((l,g)=>{let T=i.find(X=>X.value.toString()===g.toString());return T?[...l,T]:[...l]},[]):i.find(o=>o.value.toString()===r?.toString())||null,[i,r,t]);return jsx(re,{ref:D,value:d,onInputChange:()=>{!p&&!d&&m(t?[]:null);},options:i,loading:p,noOptionsText:n,loadingText:s,disabled:p||L,disableListWrap:!0,PopperComponent:z,ListboxComponent:x?void 0:R,filterOptions:(e,o)=>e.filter(l=>`${l.value} ${l.label}`.toLocaleUpperCase().includes(o.inputValue.toLocaleUpperCase())),onChange:(e,o)=>{if(!o){m(t?[]:null);return}if(Array.isArray(o)){m(o.map(H));return}m(typeof o=="string"?o.toString():o.value.toString());},renderOption:(e,o,l,g)=>x?x(e,o,l,g):[{...e,showValueInLabel:C},o],renderGroup:e=>e,groupBy:h,multiple:t,renderInput:e=>jsx(ne,{...e,placeholder:y,fullWidth:!0,error:!!f,helperText:c,label:u,required:P,InputProps:{...e.InputProps,...!t&&{startAdornment:d&&!Array.isArray(d)&&d.icon?jsx(a,{icon:d.icon}):void 0},endAdornment:jsxs(Fragment,{children:[p?jsx(oe,{color:"primary",size:20}):null,e.InputProps.endAdornment]})},inputProps:{...e.inputProps,tabIndex:k}}),...N})});M.displayName="Autocomplete";var Re=M;
|
|
16
|
-
|
|
17
|
-
export { Re as a };
|