@zydon/common 2.2.2 → 2.2.4
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-BBZ76UXI.js +17 -0
- package/dist/{chunk-H3BSTE4Q.js → chunk-CU3JVXEY.js} +1 -1
- package/dist/components/Autocomplete/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/Webhook/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-FMUKZOVG.js +0 -17
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { a } from './chunk-4Z2JJGWA.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 v 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=u=>{let{data:r,index:i,style:m}=u,n=r[i],{showValueInLabel:s,...d}=n[0],a$1={...m,top:m.top+I,paddingTop:8};return Object.prototype.hasOwnProperty.call(n,"group")?jsx(G,{component:"div",style:a$1,children:n.group},n.key):jsx(v,{component:"li",...d,noWrap:!0,style:a$1,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(v,{variant:"inherit",color:"grey.400",children:["(",n[1].value,")"]})]})})},R=createContext({}),z=forwardRef((u,r)=>{let i=useContext(R);return jsx("div",{ref:r,...u,...i})});z.displayName="OuterElementType";var K=u=>{let r=useRef(null);return useEffect(()=>{r.current!=null&&r.current.resetAfterIndex(0,!0);},[u]),r},Y=forwardRef(function(r,i){let{children:m,...n}=r,s=[];m.forEach(o=>{s.push(o),s.push(...o.children||[]);});let d=useTheme(),a=F(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=K(f);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:o=>g(s[o]),overscanCount:5,itemCount:f,children:Q})})})}),M=Y;var k=styled(ee)({[`& .${autocompleteClasses.listbox}`]:{boxSizing:"border-box","& ul":{padding:0,margin:0}}});var N=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:D,onInputChange:T,onSearch:A,...H},X)=>{let J=e=>e&&typeof e=="object"?e.value.toString():e.toString(),y=useMemo(()=>o?(Array.isArray(r)?r:[]).reduce((p,h)=>{let E=i.find(V=>V.value.toString()===h.toString());return E?[...p,E]:[...p]},[]):i.find(t=>t.value.toString()===r?.toString())||null,[i,r,o]);return jsx(ne,{ref:X,value:y,onInputChange:(e,t,p)=>{T&&T(e,t,p),A&&e&&(e.type==="change"||e.type==="blur")&&A(t);},options:i,loading:m,noOptionsText:n,loadingText:s,disabled:m||L,disableListWrap:!0,PopperComponent:k,ListboxComponent:x?void 0:M,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(J));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(se,{...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(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 };
|
|
@@ -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-CU3JVXEY.js';
|
|
4
4
|
import '../../../chunk-QNAXGE5H.js';
|
|
5
|
-
import '../../../chunk-
|
|
5
|
+
import '../../../chunk-BBZ76UXI.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-CU3JVXEY.js';
|
|
2
|
+
import '../../../chunk-BBZ76UXI.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-CU3JVXEY.js';
|
|
3
3
|
import { a as a$3 } from '../../../chunk-AKR4HFCK.js';
|
|
4
|
-
import '../../../chunk-
|
|
4
|
+
import '../../../chunk-BBZ76UXI.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';
|
package/package.json
CHANGED
package/dist/chunk-FMUKZOVG.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { a } from './chunk-4Z2JJGWA.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 v 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:s,style:p}=m,n=o[s],{showValueInLabel:i,...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(v,{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,i&&jsxs(v,{variant:"inherit",color:"grey.400",children:["(",n[1].value,")"]})]})})},R=createContext({}),z=forwardRef((m,o)=>{let s=useContext(R);return jsx("div",{ref:o,...m,...s})});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,s){let{children:p,...n}=o,i=[];p.forEach(r=>{i.push(r),i.push(...r.children||[]);});let f=useTheme(),c=F(f.breakpoints.up("sm")),y=i.length,l=c?36:48,h=r=>Object.prototype.hasOwnProperty.call(r,"group")?48:l,C=()=>y>8?8*l:i.map(h).reduce((r,P)=>r+P,0),L=K(y);return jsx("div",{ref:s,children:jsx(R.Provider,{value:n,children:jsx(VariableSizeList,{itemData:i,height:C()+2*I,width:"100%",ref:L,outerElementType:z,innerElementType:"ul",itemSize:r=>h(i[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:s=[],loading:p,noOptionsText:n="Nenhum resultado encontrado.",loadingText:i="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:A,onSearch:T,...H},X)=>{let J=e=>e&&typeof e=="object"?e.value.toString():e.toString(),d=useMemo(()=>r?(Array.isArray(o)?o:[]).reduce((u,b)=>{let E=s.find(V=>V.value.toString()===b.toString());return E?[...u,E]:[...u]},[]):s.find(t=>t.value.toString()===o?.toString())||null,[s,o,r]);return jsx(ne,{ref:X,value:d,onInputChange:(e,t,u)=>{!p&&!d&&l(r?[]:null),A&&A(e,t,u),T&&e&&(e.type==="change"||e.type==="blur")&&T(t);},options:s,loading:p,noOptionsText:p?i:n,loadingText:i,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,b)=>x?x(e,t,u,b):[{...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 };
|