@zydon/common 2.3.1 → 2.3.3
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.
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var e=r=>{let t=r.replace(/[\s-]/g,"");return /^4/.test(t)?"VISA":/^5[1-5]/.test(t)?"MASTERCARD":/^3[47]/.test(t)?"AMEX":/^6(?:011|5)/.test(t)?"DISCOVER":/^3(?:0|6|8)/.test(t)?"DINERSCLUB":/^35/.test(t)?"JCB":/^62|^81/.test(t)?"UNIONPAY":/^6(?:22|4|5)/.test(t)?"UNIONPAY":/^50/.test(t)?"MAESTRO":/^606282|^637/.test(t)?"HIPERCARD":/^(4011|4312|4389|4514|4576|5041|5066|5067|509|6277|6362|6363|650[4-8]|6516|655[089])/.test(t)?"ELO":"GENERIC"};
|
|
2
|
+
|
|
3
|
+
export { e as a };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as a$1 } from '../../chunk-
|
|
1
|
+
import { a as a$1 } from '../../chunk-X3NPZMCQ.js';
|
|
2
2
|
import '../../chunk-7F7UOLDE.js';
|
|
3
3
|
|
|
4
4
|
var a={["VISA"]:"Visa",["MASTERCARD"]:"Mastercard",["AMEX"]:"American Express",["DISCOVER"]:"Discover",["DINERSCLUB"]:"Diners Club",["JCB"]:"JCB",["UNIONPAY"]:"UnionPay",["MAESTRO"]:"Maestro",["CIRRUS"]:"Cirrus",["HIPER"]:"Hiper",["HIPERCARD"]:"Hipercard",["ELO"]:"Elo",["PIX"]:"PIX",["PAYPAL"]:"PayPal",["GPAY"]:"GPay",["APPLEPAY"]:"Apple Pay",["AMAZONPAY"]:"Amazon Pay",["MERCADOPAY"]:"Mercado Pay",["GENERIC"]:"Gen\xE9rico"},A=({number:P})=>{let e=a$1(P);return a[e]||a["GENERIC"]},C=A;
|
|
@@ -4,18 +4,18 @@ import { a as a$2 } from '../../chunk-ZODC2MGF.js';
|
|
|
4
4
|
import '../../chunk-ZDHXW74M.js';
|
|
5
5
|
import { a as a$1 } from '../../chunk-FK7DDO5L.js';
|
|
6
6
|
import '../../chunk-D27ND54J.js';
|
|
7
|
-
import
|
|
8
|
-
import
|
|
7
|
+
import dt from '@mui/material/Pagination';
|
|
8
|
+
import g from '@mui/material/Stack';
|
|
9
9
|
import { useMemo } from 'react';
|
|
10
|
-
import
|
|
11
|
-
import
|
|
10
|
+
import tt from '@mui/material/CardContent';
|
|
11
|
+
import et from '@mui/material/Checkbox';
|
|
12
12
|
import x from '@mui/material/Typography';
|
|
13
|
-
import
|
|
14
|
-
import
|
|
13
|
+
import X from '@mui/material/Card';
|
|
14
|
+
import Y from '@mui/material/CardActionArea';
|
|
15
15
|
import { styled, alpha } from '@mui/material/styles';
|
|
16
16
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
17
|
-
import
|
|
17
|
+
import y from '@mui/material/Skeleton';
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var P=styled(X)(({theme:e})=>({boxShadow:"none",border:`1px solid ${alpha(e.palette.grey[500],.2)}`})),I=styled(Y)({"&.MuiCardActionArea-focusHighlight":{background:"transparent"}});var rt=(e,t)=>e.renderCell?e.renderCell({value:e.value,field:t,row:{[t]:e.value}}):e.valueFormatter&&e.valueGetter?e.valueFormatter(e.valueGetter(e.value)):e.value,G=e=>{e.stopPropagation();},ot=({fields:e,id:t,row:i,title:p,onClick:o,checkboxSelection:f,selectedRows:s=[],onSelectionRow:n})=>{let c$1=useMemo(()=>`${c(t)?"#":""}${t}`,[t]),l=useMemo(()=>s?.includes(t),[t,s]),d=e.find(r=>r.label.toLowerCase()==="status"||r.type==="status"||r.field==="status"),v=useMemo(()=>d?.renderCell?.({value:d.value,field:t,row:{[t]:d.value}})||d?.value,[d,t]),h=e.find(r=>r.type==="actions"||r.id==="actions"),u=useMemo(()=>h?.getActions({id:t,row:i})||null,[h,t,i]),A=useMemo(()=>e.filter(r=>r.label.toLowerCase()!=="status"&&r.value?.toString()!==t&&r.type!=="actions"),[e,t]),Q=r=>{o?.({id:t},r,e);},U=r=>{n?.(r?[...s,t]:s.filter(M=>M!==t));},V=useMemo(()=>A.map(r=>r.value!=t&&jsxs(g,{flexBasis:"50%",pb:2,order:r.order,children:[jsx(x,{variant:"body2",color:"text.secondary",children:r.label}),jsx(x,{variant:"body1",children:rt(r,t)})]},`data-card-field-${t}-${r.label}`)),[A,t]),R=jsxs(tt,{sx:{padding:"0!important"},children:[jsxs(g,{flexDirection:"row",justifyContent:"space-between",p:2,children:[jsxs(g,{flexDirection:"row",alignItems:"center",gap:1,children:[f&&jsx(et,{checked:l||!1,onChange:(r,M)=>U(M)}),jsx(x,{variant:"body1",fontWeight:600,color:"text.secondary",children:p}),jsx(x,{variant:"body1",fontWeight:600,children:c$1})]}),jsxs(g,{className:"actions",flexDirection:"row",alignItems:"center",gap:1,children:[jsx(x,{variant:"body2",color:"text.secondary",textTransform:"uppercase",fontSize:14,fontWeight:600,children:v}),jsx(g,{onClick:G,onMouseDown:G,children:u})]})]}),jsx(a,{}),jsx(g,{flexWrap:"wrap",direction:"row",justifyContent:"space-between",p:2,pb:0,children:V})]});return o?jsx(P,{onClick:Q,children:jsx(I,{component:"div",children:R})}):jsx(P,{children:R})},L=ot;var nt=()=>jsxs(X,{children:[jsxs(g,{justifyContent:"space-between",direction:"row",spacing:2,p:2,children:[jsx(y,{height:24,width:200}),jsx(y,{height:24,width:100})]}),jsxs(g,{justifyContent:"space-between",flexWrap:"wrap",direction:"row",p:2,children:[jsxs(g,{width:"50%",spacing:1,children:[jsx(y,{height:24,width:100}),jsx(y,{sx:{maxWidth:"95%"},height:24,width:230})]}),jsxs(g,{width:"50%",spacing:1,children:[jsx(y,{height:24,width:80}),jsx(y,{sx:{maxWidth:"100%"},height:27,width:250})]})]})]}),D=nt;var N=(e,t)=>{let i=[];e.forEach(o=>{o.field&&o.field!=="actions"&&i.push({...o,label:o.headerName||o.field,value:t[o.field],type:o.type,order:o?.order||0,id:o.field});});let p=e.find(o=>o.field==="actions");return p&&i.push({...p,label:"Actions",value:null,order:0,type:"actions",id:"actions"}),i};var j=styled(g)(({theme:e})=>({border:`1px solid ${alpha(e.palette.grey[500],.2)}`,borderRadius:16})),z=styled(g)(()=>({padding:"12px 28px",flexDirection:"row",alignItems:"center",backgroundColor:"#F4F4F4",gap:14,borderRadius:"16px 16px 0 0"}));var lt=({children:e,title:t,rows:i,onSelectionRow:p,selectedRows:o,totalItems:f})=>{let s=c=>{p?.(c?i.map(l=>l["@id"]):[]);},n=o?.length||0;return jsxs(j,{children:[jsxs(z,{children:[jsx(et,{onChange:(c,l)=>s(l),checked:n===f,indeterminate:n>0&&n<f}),jsx(x,{variant:"subtitle2",component:"span",color:"grey.600",children:t})]}),jsx(g,{gap:1.5,p:1.5,children:e})]})},J=lt;var mt=({title:e,rows:t,columns:i,getRowId:p,onClick:o,loading:f,fetching:s,pagination:n,checkboxSelection:c,onSelectionRow:l,selectedRows:d})=>{let v=s&&jsx(a$1,{sx:{zIndex:1}});return f?jsxs(Fragment,{children:[v,jsx(D,{}),jsx(D,{}),jsx(D,{})]}):jsxs(g,{gap:2,component:c?J:"div",...c&&{title:e,rows:t,onSelectionRow:l,selectedRows:d,totalItems:n?.total||t.length},children:[v,t.length===0&&jsx(a$2,{sx:{mb:3},title:"Nenhum registro encontrado"}),t.map(h=>{let u=p(h);return jsx(L,{title:e,id:u,row:h,fields:N(i,h),onClick:o,checkboxSelection:c,selectedRows:d,onSelectionRow:l},`data-card-${u}`)}),n&&t.length>0&&jsx(g,{direction:"row",justifyContent:"center",children:jsx(dt,{page:n?.page,onChange:(h,u)=>{n?.onPageChange(u);},count:n?.total})})]})},Xt=mt;
|
|
20
20
|
|
|
21
|
-
export {
|
|
21
|
+
export { L as DataCard, D as DataCardSkeleton, Xt as default, N as getFieldData };
|
|
@@ -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/dist/utils/flagCard.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { a as getFlagCard } from '../chunk-
|
|
1
|
+
export { a as getFlagCard } from '../chunk-X3NPZMCQ.js';
|
|
2
2
|
import '../chunk-7F7UOLDE.js';
|
package/package.json
CHANGED
package/dist/chunk-UOZ6WDXX.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
var s=r=>{let e=r.replace(/[\s-]/g,""),t="1111111111111111".replace(new RegExp(`[1]{${e.length}}`),e);return /^4[0-9]{12}(?:[0-9]{3})?$/.test(t)?"VISA":/^5[1-5][0-9]{14}$/.test(t)?"MASTERCARD":/^3[47][0-9]{13}$/.test(t)?"AMEX":/^6(?:011|5[0-9]{2})[0-9]{12}$/.test(t)?"DISCOVER":/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/.test(t)?"DINERSCLUB":/^35(?:2[89]|[3-8][0-9])[0-9]{12}$/.test(t)?"JCB":/^(62|81)[0-9]{14,17}$/.test(t)?"UNIONPAY":/^6(?:22|4[4-9]|5[0-9])[0-9]{14}$/.test(t)?"UNIONPAY":/^50[0-9]{14,17}$/.test(t)?"MAESTRO":/^(606282|637095|637568|637599|637609|637612)[0-9]{10}$/.test(t)?"HIPERCARD":/^(4011|4312|4389|4514|4576|5041|5066|5067|509|6277|6362|6363|6504|6505|6506|6507|6508|6516|6550|6558|6559)[0-9]{12}$/.test(t)?"ELO":"GENERIC"};
|
|
2
|
-
|
|
3
|
-
export { s as a };
|