@zydon/common 2.1.95 → 2.1.96
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.
|
@@ -12,6 +12,6 @@ import Z from '@mui/material/Popper';
|
|
|
12
12
|
import { styled } from '@mui/material/styles';
|
|
13
13
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
14
14
|
|
|
15
|
-
var H=styled(Z)({[`& .${autocompleteClasses.listbox}`]:{boxSizing:"border-box","& ul":{padding:0,margin:0}}}),D=styled(v)(({theme:e})=>({flex:1,width:"100%",[e.breakpoints.down("md")]:{flexDirection:"column",gap:0,width:"100%"},[e.breakpoints.up("sm")]:{width:"calc(100% - 75px)"},[e.breakpoints.up("md")]:{flexDirection:"row",gap:8}})),T=styled(v)(({theme:e})=>({flex:1,maxWidth:"100%",[e.breakpoints.up("md")]:{flex:"1 1 calc(50% - 8px)",width:"calc(50% - 8px)",minWidth:"calc(50% - 8px)",maxWidth:"calc(50% - 8px)"}})),R=styled(v)(({theme:e})=>({position:"relative",alignItems:"center",justifyContent:"center",width:68,height:68,borderRadius:8,overflow:"hidden",img:{position:"absolute",width:"100%",height:"100%",objectFit:"cover"},[e.breakpoints.down("sm")]:{display:"none"}}));var te=({option:e})=>{let t=Object.keys(e).filter(l=>l.startsWith("field")).map((l,m)=>{let s=e[l];if(s&&typeof s=="object"){let p="label"in s?s.label:null,d="value"in s?s.value:null;return jsxs(W,{component:"span",variant:"body2",color:"textPrimary",noWrap:!0,children:[p,": ",d]},`${l}:${m}`)}}),i=e.image?jsx("img",{alt:"Imagem",src:e.image}):jsx(a,{alt:e.label||e.value.toString(),name:e.label||e.value.toString(),sx:{width:68,height:68,borderRadius:1}});return jsxs(Fragment,{children:[jsxs(v,{direction:"row",gap:2,margin:2,children:[jsx(R,{children:i}),jsxs(D,{children:[jsxs(T,{children:[jsx(v,{children:jsxs(W,{variant:"subtitle2",color:"textPrimary",noWrap:!0,children:[e.value," - ",e.label]})}),t[0]?t[0]:void 0,t[1]?t[1]:void 0]}),t.length>2&&jsxs(T,{children:[t[2]?t[2]:void 0,t[3]?t[3]:void 0,t[4]?t[4]:void 0]})]})]}),jsx(ee,{className:"border",sx:{borderStyle:"dashed",position:"absolute",bottom:0,width:1}})]})},x=te;var N=8,le=e=>{let{data:t,index:i,style:l}=e,m=t[i],s={...l,top:l.top+N,paddingTop:8,display:"block"};return jsx(W,{component:"li",...m.props,noWrap:!0,style:s,children:jsx(x,{...m?.props?.children?.props})})},X=O.createContext({}),B=forwardRef((e,t)=>{let i=O.useContext(X);return jsx("div",{ref:t,...e,...i})});B.displayName="OuterElementType";var ae=e=>{let t=O.useRef(null);return useEffect(()=>{t.current!=null&&t.current.resetAfterIndex(0,!0);},[e]),t},se=forwardRef(function(t,i){let{children:l,"data-item-height":m,...s}=t,p=[];l.forEach(a=>{p.push(a),p.push(...a.children||[]);});let d=p.length,h=m>112?m:112,u=a=>Object.prototype.hasOwnProperty.call(a,"group")?48:h,S=()=>d>8?8*h:p.map(u).reduce((a,L)=>a+L,0),C=ae(d);return jsx("div",{ref:i,children:jsx(X.Provider,{value:s,children:jsx(VariableSizeList,{itemData:p,height:S()+2*N,width:"100%",ref:C,outerElementType:B,innerElementType:"ul",itemSize:a=>u(p[a]),overscanCount:5,itemCount:d,children:le})})})}),J=se;var j=forwardRef(({label:e,value:t,options:i=[],loading:l,noOptionsText:m="
|
|
15
|
+
var H=styled(Z)({[`& .${autocompleteClasses.listbox}`]:{boxSizing:"border-box","& ul":{padding:0,margin:0}}}),D=styled(v)(({theme:e})=>({flex:1,width:"100%",[e.breakpoints.down("md")]:{flexDirection:"column",gap:0,width:"100%"},[e.breakpoints.up("sm")]:{width:"calc(100% - 75px)"},[e.breakpoints.up("md")]:{flexDirection:"row",gap:8}})),T=styled(v)(({theme:e})=>({flex:1,maxWidth:"100%",[e.breakpoints.up("md")]:{flex:"1 1 calc(50% - 8px)",width:"calc(50% - 8px)",minWidth:"calc(50% - 8px)",maxWidth:"calc(50% - 8px)"}})),R=styled(v)(({theme:e})=>({position:"relative",alignItems:"center",justifyContent:"center",width:68,height:68,borderRadius:8,overflow:"hidden",img:{position:"absolute",width:"100%",height:"100%",objectFit:"cover"},[e.breakpoints.down("sm")]:{display:"none"}}));var te=({option:e})=>{let t=Object.keys(e).filter(l=>l.startsWith("field")).map((l,m)=>{let s=e[l];if(s&&typeof s=="object"){let p="label"in s?s.label:null,d="value"in s?s.value:null;return jsxs(W,{component:"span",variant:"body2",color:"textPrimary",noWrap:!0,children:[p,": ",d]},`${l}:${m}`)}}),i=e.image?jsx("img",{alt:"Imagem",src:e.image}):jsx(a,{alt:e.label||e.value.toString(),name:e.label||e.value.toString(),sx:{width:68,height:68,borderRadius:1}});return jsxs(Fragment,{children:[jsxs(v,{direction:"row",gap:2,margin:2,children:[jsx(R,{children:i}),jsxs(D,{children:[jsxs(T,{children:[jsx(v,{children:jsxs(W,{variant:"subtitle2",color:"textPrimary",noWrap:!0,children:[e.value," - ",e.label]})}),t[0]?t[0]:void 0,t[1]?t[1]:void 0]}),t.length>2&&jsxs(T,{children:[t[2]?t[2]:void 0,t[3]?t[3]:void 0,t[4]?t[4]:void 0]})]})]}),jsx(ee,{className:"border",sx:{borderStyle:"dashed",position:"absolute",bottom:0,width:1}})]})},x=te;var N=8,le=e=>{let{data:t,index:i,style:l}=e,m=t[i],s={...l,top:l.top+N,paddingTop:8,display:"block"};return jsx(W,{component:"li",...m.props,noWrap:!0,style:s,children:jsx(x,{...m?.props?.children?.props})})},X=O.createContext({}),B=forwardRef((e,t)=>{let i=O.useContext(X);return jsx("div",{ref:t,...e,...i})});B.displayName="OuterElementType";var ae=e=>{let t=O.useRef(null);return useEffect(()=>{t.current!=null&&t.current.resetAfterIndex(0,!0);},[e]),t},se=forwardRef(function(t,i){let{children:l,"data-item-height":m,...s}=t,p=[];l.forEach(a=>{p.push(a),p.push(...a.children||[]);});let d=p.length,h=m>112?m:112,u=a=>Object.prototype.hasOwnProperty.call(a,"group")?48:h,S=()=>d>8?8*h:p.map(u).reduce((a,L)=>a+L,0),C=ae(d);return jsx("div",{ref:i,children:jsx(X.Provider,{value:s,children:jsx(VariableSizeList,{itemData:p,height:S()+2*N,width:"100%",ref:C,outerElementType:B,innerElementType:"ul",itemSize:a=>u(p[a]),overscanCount:5,itemCount:d,children:le})})})}),J=se;var j=forwardRef(({label:e,value:t,options:i=[],loading:l,noOptionsText:m="Nenhum resultado encontrado.",loadingText:s="Carregando op\xE7\xF5es...",error:p,helperText:d,placeholder:h,onChange:u,groupBy:S,disabled:C,multiple:a,required:L,renderOption:G,tabIndex:U,onSearch:P,onInputChange:w,..._},F)=>{let V=b("down","md"),q=r=>r&&typeof r=="object"?r.value.toString():r.toString(),I=useMemo(()=>a?(Array.isArray(t)?t:[]).reduce((o,A)=>{let E=i.find(Q=>Q.value.toString()===A.toString());return E?[...o,E]:[...o]},[]):i.find(n=>n.value.toString()===t?.toString())||null,[i,t,a]),K=V&&i[0]?Object.keys(i[0]).length*24:void 0;return jsx(de,{ref:F,value:I,onInputChange:(r,n,o)=>{!l&&!I&&u(a?[]:null),w&&w(r,n,o),P&&r&&(r.type==="change"||r.type==="blur")&&P(n);},options:i,loading:l,noOptionsText:m,loadingText:s,disabled:l||C,disableListWrap:!0,PopperComponent:H,ListboxProps:{"data-item-height":K},ListboxComponent:G?void 0:J,filterOptions:(r,n)=>r.filter(o=>`${o.field1?.value} ${o.field1?.label} ${o.field2?.label} ${o.field2?.value} ${o.field3?.label} ${o.field3?.value} ${o.field4?.label} ${o.field4?.value} ${o.field5?.label} ${o.field5?.value} ${o.label}${o.value}`.toLocaleUpperCase().includes(n.inputValue.toLocaleUpperCase())),onChange:(r,n)=>{if(!n){u(a?[]:null);return}if(Array.isArray(n)){u(n.map(q));return}u(typeof n=="string"?n.toString():n.value.toString());},renderOption:({key:r,...n},o)=>jsx("li",{...n,style:{display:"block"},children:jsx(x,{option:o})},r),renderGroup:r=>r,groupBy:S,multiple:a,renderInput:r=>jsx(ce,{...r,placeholder:h,fullWidth:!0,error:!!p,helperText:d,label:e,required:L,InputProps:{...r.InputProps,endAdornment:jsxs(Fragment,{children:[l?jsx(ue,{color:"primary",size:20}):null,r.InputProps.endAdornment]})},inputProps:{...r.inputProps,tabIndex:U}}),..._})});j.displayName="Autocomplete";var _e=j;
|
|
16
16
|
|
|
17
17
|
export { _e as a };
|
|
@@ -443,7 +443,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
443
443
|
wordWrap?: csstype.Property.WordWrap | readonly NonNullable<csstype.Property.WordWrap | undefined>[] | readonly csstype.Property.WordWrap[] | undefined;
|
|
444
444
|
writingMode?: csstype.Property.WritingMode | readonly NonNullable<csstype.Property.WritingMode | undefined>[] | readonly csstype.Property.WritingMode[] | undefined;
|
|
445
445
|
zIndex?: csstype.Property.ZIndex | readonly NonNullable<csstype.Property.ZIndex | undefined>[] | readonly ((string & {}) | csstype.Globals | "auto")[] | undefined;
|
|
446
|
-
zoom?: csstype.Property.Zoom | readonly NonNullable<csstype.Property.Zoom | undefined>[] | readonly (
|
|
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
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;
|