@zydon/common 2.1.87 → 2.1.88
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-BUYQKDFG.js +13 -0
- package/dist/{chunk-WE645O7P.js → chunk-ORBDUMXB.js} +1 -1
- package/dist/components/AutocompleteDetailed/index.js +1 -1
- package/dist/components/ColorPickerInput/index.js +1 -1
- package/dist/components/form/AutocompleteDetailed/index.js +1 -1
- package/dist/components/form/ColorPicker/index.js +1 -1
- package/dist/theme/styles/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist/chunk-6VGUWU3S.js +0 -13
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { a as a$1 } from './chunk-ORYAES3Q.js';
|
|
2
|
+
import d from '@mui/material/Box';
|
|
3
|
+
import u from '@mui/material/IconButton';
|
|
4
|
+
import f from '@mui/material/InputAdornment';
|
|
5
|
+
import P from '@mui/material/Popover';
|
|
6
|
+
import x from '@mui/material/TextField';
|
|
7
|
+
import { ChromePicker } from 'react-color';
|
|
8
|
+
import { styled } from '@mui/material/styles';
|
|
9
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
10
|
+
|
|
11
|
+
var a=styled(ChromePicker)({fontFamily:"inherit",boxShadow:"none"});var g=({value:n,onChangeColor:i,tabIndex:m,...p})=>{let t=n?"#"+n.replaceAll("#",""):"",e=a$1(),s=(o="")=>{(/^#[0-9a-fA-F]*$/.test(o)||o===""||o==="#")&&i("#"+o.replaceAll("#",""));};return jsxs(Fragment,{children:[jsx(x,{...p,value:t,onChange:o=>s(o.target.value),InputProps:{inputProps:{...p.inputProps,maxLength:7,tabIndex:m},startAdornment:jsx(f,{position:"start",sx:{ml:2},children:jsx(u,{edge:"start","aria-label":"Escolher cor",onClick:e.onOpen,children:jsx(d,{sx:{minWidth:24,minHeight:24,backgroundColor:t,borderRadius:.5}})})})}}),jsx(P,{open:!!e.open,anchorEl:e.open,onClose:e.onClose,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"center",horizontal:"center"},slotProps:{paper:{style:{borderRadius:8}}},children:jsx(a,{color:t,onChange:({hex:o})=>i(o),styles:{default:{picker:{fontFamily:"inherit",boxShadow:"none"}}},disableAlpha:!0})})]})},E=g;
|
|
12
|
+
|
|
13
|
+
export { E as a };
|
|
@@ -12,6 +12,6 @@ import Q 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 k=styled(Q)({[`& .${autocompleteClasses.listbox}`]:{boxSizing:"border-box","& ul":{padding:0,margin:0}}}),$=styled(L)(({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(L)(({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)"}})),H=styled(L)(({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 Z=({option:e})=>{let t=Object.keys(e).filter(i=>i.startsWith("field")).map((i,m)=>{let s=e[i];if(s&&typeof s=="object"){let p="label"in s?s.label:null,d="value"in s?s.value:null;return jsxs(R,{component:"span",variant:"body2",color:"textPrimary",noWrap:!0,children:[p,": ",d]},`${i}:${m}`)}}),n=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(L,{direction:"row",gap:2,margin:2,children:[jsx(H,{children:n}),jsxs($,{children:[jsxs(T,{children:[jsx(L,{children:jsxs(R,{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(Y,{className:"border",sx:{borderStyle:"dashed",position:"absolute",bottom:0,width:1}})]})},x=Z;var W=8,ne=e=>{let{data:t,index:n,style:i}=e,m=t[n],s={...i,top:i.top+W,paddingTop:8,display:"block"};return jsx(R,{component:"li",...m.props,noWrap:!0,style:s,children:jsx(x,{...m?.props?.children?.props})})},z=O.createContext({}),N=forwardRef((e,t)=>{let n=O.useContext(z);return jsx("div",{ref:t,...e,...n})});N.displayName="OuterElementType";var ie=e=>{let t=O.useRef(null);return useEffect(()=>{t.current!=null&&t.current.resetAfterIndex(0,!0);},[e]),t},le=forwardRef(function(t,n){let{children:i,"data-item-height":m,...s}=t,p=[];i.forEach(l=>{p.push(l),p.push(...l.children||[]);});let d=p.length,h=m>112?m:112,u=l=>Object.prototype.hasOwnProperty.call(l,"group")?48:h,v=()=>d>8?8*h:p.map(u).reduce((l,C)=>l+C,0),S=ie(d);return jsx("div",{ref:n,children:jsx(z.Provider,{value:s,children:jsx(VariableSizeList,{itemData:p,height:v()+2*W,width:"100%",ref:S,outerElementType:N,innerElementType:"ul",itemSize:l=>u(p[l]),overscanCount:5,itemCount:d,children:ne})})})}),X=le;var B=forwardRef(({label:e,value:t,options:n=[],loading:i,noOptionsText:m="Nenhuma resultado encontrado.",loadingText:s="Carregando op\xE7\xF5es...",error:p,helperText:d,placeholder:h,onChange:u,groupBy:v,disabled:S,multiple:l,required:C,renderOption:J,tabIndex:j,...G},U)=>{let V=b("down","md"),_=r=>r&&typeof r=="object"?r.value.toString():r.toString(),P=useMemo(()=>l?(Array.isArray(t)?t:[]).reduce((o,w)=>{let I=n.find(q=>q.value.toString()===w.toString());return I?[...o,I]:[...o]},[]):n.find(a=>a.value.toString()===t?.toString())||null,[n,t,l]),F=V&&n[0]?Object.keys(n[0]).length*24:void 0;return jsx(pe,{ref:U,value:P,onInputChange:()=>{!i&&!P&&u(l?[]:null);},options:n,loading:i,noOptionsText:m,loadingText:s,disabled:i||S,disableListWrap:!0,PopperComponent:k,ListboxProps:{"data-item-height":F},ListboxComponent:J?void 0:X,filterOptions:(r,a)=>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(a.inputValue.toLocaleUpperCase())),onChange:(r,a)=>{if(!a){u(l?[]:null);return}if(Array.isArray(a)){u(a.map(_));return}u(typeof a=="string"?a.toString():a.value.toString());},renderOption:(r,
|
|
15
|
+
var k=styled(Q)({[`& .${autocompleteClasses.listbox}`]:{boxSizing:"border-box","& ul":{padding:0,margin:0}}}),$=styled(L)(({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(L)(({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)"}})),H=styled(L)(({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 Z=({option:e})=>{let t=Object.keys(e).filter(i=>i.startsWith("field")).map((i,m)=>{let s=e[i];if(s&&typeof s=="object"){let p="label"in s?s.label:null,d="value"in s?s.value:null;return jsxs(R,{component:"span",variant:"body2",color:"textPrimary",noWrap:!0,children:[p,": ",d]},`${i}:${m}`)}}),n=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(L,{direction:"row",gap:2,margin:2,children:[jsx(H,{children:n}),jsxs($,{children:[jsxs(T,{children:[jsx(L,{children:jsxs(R,{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(Y,{className:"border",sx:{borderStyle:"dashed",position:"absolute",bottom:0,width:1}})]})},x=Z;var W=8,ne=e=>{let{data:t,index:n,style:i}=e,m=t[n],s={...i,top:i.top+W,paddingTop:8,display:"block"};return jsx(R,{component:"li",...m.props,noWrap:!0,style:s,children:jsx(x,{...m?.props?.children?.props})})},z=O.createContext({}),N=forwardRef((e,t)=>{let n=O.useContext(z);return jsx("div",{ref:t,...e,...n})});N.displayName="OuterElementType";var ie=e=>{let t=O.useRef(null);return useEffect(()=>{t.current!=null&&t.current.resetAfterIndex(0,!0);},[e]),t},le=forwardRef(function(t,n){let{children:i,"data-item-height":m,...s}=t,p=[];i.forEach(l=>{p.push(l),p.push(...l.children||[]);});let d=p.length,h=m>112?m:112,u=l=>Object.prototype.hasOwnProperty.call(l,"group")?48:h,v=()=>d>8?8*h:p.map(u).reduce((l,C)=>l+C,0),S=ie(d);return jsx("div",{ref:n,children:jsx(z.Provider,{value:s,children:jsx(VariableSizeList,{itemData:p,height:v()+2*W,width:"100%",ref:S,outerElementType:N,innerElementType:"ul",itemSize:l=>u(p[l]),overscanCount:5,itemCount:d,children:ne})})})}),X=le;var B=forwardRef(({label:e,value:t,options:n=[],loading:i,noOptionsText:m="Nenhuma resultado encontrado.",loadingText:s="Carregando op\xE7\xF5es...",error:p,helperText:d,placeholder:h,onChange:u,groupBy:v,disabled:S,multiple:l,required:C,renderOption:J,tabIndex:j,...G},U)=>{let V=b("down","md"),_=r=>r&&typeof r=="object"?r.value.toString():r.toString(),P=useMemo(()=>l?(Array.isArray(t)?t:[]).reduce((o,w)=>{let I=n.find(q=>q.value.toString()===w.toString());return I?[...o,I]:[...o]},[]):n.find(a=>a.value.toString()===t?.toString())||null,[n,t,l]),F=V&&n[0]?Object.keys(n[0]).length*24:void 0;return jsx(pe,{ref:U,value:P,onInputChange:()=>{!i&&!P&&u(l?[]:null);},options:n,loading:i,noOptionsText:m,loadingText:s,disabled:i||S,disableListWrap:!0,PopperComponent:k,ListboxProps:{"data-item-height":F},ListboxComponent:J?void 0:X,filterOptions:(r,a)=>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(a.inputValue.toLocaleUpperCase())),onChange:(r,a)=>{if(!a){u(l?[]:null);return}if(Array.isArray(a)){u(a.map(_));return}u(typeof a=="string"?a.toString():a.value.toString());},renderOption:({key:r,...a},o)=>jsx("li",{...a,style:{display:"block"},children:jsx(x,{option:o})},r),renderGroup:r=>r,groupBy:v,multiple:l,renderInput:r=>jsx(de,{...r,placeholder:h,fullWidth:!0,error:!!p,helperText:d,label:e,required:C,InputProps:{...r.InputProps,endAdornment:jsxs(Fragment,{children:[i?jsx(me,{color:"primary",size:20}):null,r.InputProps.endAdornment]})},inputProps:{...r.inputProps,tabIndex:j}}),...G})});B.displayName="Autocomplete";var Ge=B;
|
|
16
16
|
|
|
17
17
|
export { Ge as a };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { a as default } from '../../chunk-
|
|
1
|
+
export { a as default } from '../../chunk-BUYQKDFG.js';
|
|
2
2
|
import '../../chunk-ORYAES3Q.js';
|
|
@@ -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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zydon/common",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.88",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"@types/color": "^3.0.6",
|
|
77
77
|
"@types/lodash": "^4.17.7",
|
|
78
78
|
"@types/react": "^18.3.4",
|
|
79
|
-
"@types/react-color": "^3.0.
|
|
79
|
+
"@types/react-color": "^3.0.13",
|
|
80
80
|
"@types/react-dom": "^18.3.0",
|
|
81
81
|
"@types/react-window": "^1.8.8",
|
|
82
82
|
"@typescript-eslint/eslint-plugin": "^6.4.1",
|
package/dist/chunk-6VGUWU3S.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { a } from './chunk-ORYAES3Q.js';
|
|
2
|
-
import d from '@mui/material/Box';
|
|
3
|
-
import u from '@mui/material/IconButton';
|
|
4
|
-
import f from '@mui/material/InputAdornment';
|
|
5
|
-
import P from '@mui/material/Popover';
|
|
6
|
-
import x from '@mui/material/TextField';
|
|
7
|
-
import { ChromePicker } from 'react-color';
|
|
8
|
-
import { styled } from '@mui/material/styles';
|
|
9
|
-
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
10
|
-
|
|
11
|
-
var l=styled(ChromePicker)({fontFamily:"inherit",boxShadow:"none"});var g=({value:n,onChangeColor:i,tabIndex:m,...p})=>{let t=n?"#"+n.replaceAll("#",""):"",e=a(),s=(o="")=>{(/^#[0-9a-fA-F]*$/.test(o)||o===""||o==="#")&&i("#"+o.replaceAll("#",""));};return jsxs(Fragment,{children:[jsx(x,{...p,value:t,onChange:o=>s(o.target.value),InputProps:{inputProps:{...p.inputProps,maxLength:7,tabIndex:m},startAdornment:jsx(f,{position:"start",sx:{ml:2},children:jsx(u,{edge:"start","aria-label":"Escolher cor",onClick:e.onOpen,children:jsx(d,{sx:{minWidth:24,minHeight:24,backgroundColor:t,borderRadius:.5}})})})}}),jsx(P,{open:!!e.open,anchorEl:e.open,onClose:e.onClose,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"center",horizontal:"center"},slotProps:{paper:{style:{borderRadius:8}}},children:jsx(l,{color:t,onChange:({hex:o})=>i(o),styles:{default:{picker:{fontFamily:"inherit",boxShadow:"none"}}},disableAlpha:!0})})]})},E=g;
|
|
12
|
-
|
|
13
|
-
export { E as a };
|