@zydon/common 2.0.3 → 2.0.5

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,6 @@
1
+ import { useState, useEffect } from 'react';
2
+ import { createPortal } from 'react-dom';
3
+
4
+ var d=({children:e,container:o,waitBeforeShow:t=50})=>{let[m,n]=useState(!1);return useEffect(()=>{let s=setTimeout(()=>n(!0),t);return ()=>clearTimeout(s)},[t]),t?m?createPortal(e,document.getElementById(o)||document.body):null:createPortal(e,document.getElementById(o)||document.body)},P=d;
5
+
6
+ export { P as a };
@@ -0,0 +1,10 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { PropsWithChildren } from 'react';
3
+
4
+ interface ModalActionsProps {
5
+ id?: string;
6
+ }
7
+
8
+ declare const ModalActions: ({ children, id, }: PropsWithChildren<ModalActionsProps>) => react_jsx_runtime.JSX.Element;
9
+
10
+ export { ModalActions as default };
@@ -0,0 +1,6 @@
1
+ import { a } from '../../chunk-JWVPX7Y7.mjs';
2
+ import { jsx } from 'react/jsx-runtime';
3
+
4
+ var i=({children:r,id:t="modal-actions"})=>jsx(a,{container:t,children:r}),n=i;
5
+
6
+ export { n as default };
@@ -1,6 +1 @@
1
- import { useState, useEffect } from 'react';
2
- import { createPortal } from 'react-dom';
3
-
4
- var d=({children:e,container:o,waitBeforeShow:t=50})=>{let[m,n]=useState(!1);return useEffect(()=>{let s=setTimeout(()=>n(!0),t);return ()=>clearTimeout(s)},[t]),t?m?createPortal(e,document.getElementById(o)||document.body):null:createPortal(e,document.getElementById(o)||document.body)},P=d;
5
-
6
- export { P as default };
1
+ export { a as default } from '../../chunk-JWVPX7Y7.mjs';
@@ -1,6 +1,6 @@
1
- export { a as default } from '../../chunk-CKOWGDWH.mjs';
2
- import '../../chunk-2ZLS7IUJ.mjs';
1
+ export { a as default } from '../../chunk-XKSDKMZ4.mjs';
3
2
  import '../../chunk-OUPUY4L2.mjs';
3
+ import '../../chunk-2ZLS7IUJ.mjs';
4
4
  import '../../chunk-WHA7HOMZ.mjs';
5
5
  import '../../chunk-SXVKHA6L.mjs';
6
6
  import '../../chunk-MUAMRRNL.mjs';
@@ -1,6 +1,6 @@
1
1
  import { b, a as a$4 } from '../../chunk-MAKO5GLN.mjs';
2
- import { a as a$1 } from '../../chunk-2ZLS7IUJ.mjs';
3
2
  import { a } from '../../chunk-OUPUY4L2.mjs';
3
+ import { a as a$1 } from '../../chunk-2ZLS7IUJ.mjs';
4
4
  import { a as a$2 } from '../../chunk-WHA7HOMZ.mjs';
5
5
  import { a as a$3 } from '../../chunk-SXVKHA6L.mjs';
6
6
  import '../../chunk-MUAMRRNL.mjs';
@@ -1,5 +1,5 @@
1
- import { a as a$1 } from '../../../chunk-HQYCK4C3.mjs';
2
1
  import { a as a$2 } from '../../../chunk-ZREC5BF3.mjs';
2
+ import { a as a$1 } from '../../../chunk-HQYCK4C3.mjs';
3
3
  import { a as a$3 } from '../../../chunk-POP3P3YE.mjs';
4
4
  import '../../../chunk-6UGYYTYE.mjs';
5
5
  import '../../../chunk-D6NU2WRK.mjs';
@@ -1,6 +1,6 @@
1
- import { a } from '../../../chunk-CKOWGDWH.mjs';
2
- import '../../../chunk-2ZLS7IUJ.mjs';
1
+ import { a } from '../../../chunk-XKSDKMZ4.mjs';
3
2
  import '../../../chunk-OUPUY4L2.mjs';
3
+ import '../../../chunk-2ZLS7IUJ.mjs';
4
4
  import '../../../chunk-WHA7HOMZ.mjs';
5
5
  import '../../../chunk-SXVKHA6L.mjs';
6
6
  import '../../../chunk-MUAMRRNL.mjs';
@@ -5,15 +5,15 @@ import '../../../chunk-D6NU2WRK.mjs';
5
5
  import { a as a$1 } from '../../../chunk-QHCGLZFD.mjs';
6
6
  import '../../../chunk-KLIYANST.mjs';
7
7
  import { useFormContext, useFieldArray } from 'react-hook-form';
8
- import w from '@mui/material/Divider';
8
+ import D from '@mui/material/Divider';
9
9
  import T from '@mui/material/IconButton';
10
10
  import q from '@mui/material/InputAdornment';
11
11
  import l from '@mui/material/Stack';
12
12
  import O from '@mui/material/Typography';
13
- import x from '@mui/material/Alert';
13
+ import I from '@mui/material/Alert';
14
14
  import { styled, alpha } from '@mui/material/styles';
15
15
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
16
16
 
17
- var s=[{label:"XML",value:"XML"},{label:"JSON",value:"JSON"},{label:"BYTEA",value:"BYTEA"}],c=[{label:"GET",value:"GET"},{label:"POST",value:"POST"},{label:"DELETE",value:"DELETE"},{label:"PUT",value:"PUT"}];var b=styled(T)(({theme:o})=>({svg:{color:`${o.palette.primary.main} !important`}}));styled(T)(()=>({height:"38px",alignSelf:"center"}));var y=styled(O)(()=>({textDecoration:"underline",fontWeight:"600",cursor:"pointer"})),h=styled(x)(({theme:o})=>({backgroundColor:`${alpha(o.palette.primary.main,.03)}`,border:`1px solid ${alpha(o.palette.primary.main,.4)}`,flexDirection:"row",alignItems:"center",padding:"2px 12px",gap:8,borderRadius:8,marginBottom:16,"& svg":{color:o.palette.primary.main}}));var W=()=>{let o=()=>{let a="https://ajuda.zydon.com.br/pt-BR/articles/9180603-sobre-webhooks";window.open(a,"_blank");};return jsx(h,{severity:"info",children:jsxs(O,{color:"grey",variant:"caption",children:["Webhooks permitem que servi\xE7os externos sejam notificados quando determinados eventos acontecem. Saiba mais"," ",jsx(y,{variant:"caption",color:"primary",onClick:()=>o(),children:"acessando a documenta\xE7\xE3o do Webhook"})]})})},g=W;var U=({webhookData:o,isEditing:a$4=!1,haveTip:S=!1})=>{let{control:k}=useFormContext(),{fields:E,append:A,remove:C}=useFieldArray({name:"headers",control:k}),I=()=>{A({value:"",name:""});};return jsxs(Fragment,{children:[S&&jsx(g,{}),a$4&&jsx(a,{name:"name",label:"Nome do webhook"}),jsxs(l,{direction:"row",gap:2,children:[jsx(a,{name:"url",label:"URL de endpoint",rules:{required:{value:!0,message:"Url \xE9 obrigat\xF3rio"}}}),jsx(a,{name:"filter",label:"Filtro"})]}),a$4&&o&&jsxs(Fragment,{children:[jsx(a,{variant:"filled",name:"solution",label:"Solu\xE7\xE3o",disabled:!0}),jsxs(l,{direction:"row",gap:2,children:[jsx(a,{variant:"filled",name:"resource",label:"Origem",disabled:!0}),jsx(a,{variant:"filled",name:"resourceID",label:"ID origem",disabled:!0,InputProps:{endAdornment:jsx(q,{position:"end",children:jsx(b,{onClick:()=>navigator.clipboard.writeText(o.resourceID),children:jsx(a$1,{className:"copyIcon",icon:"COPY_CONTENT"})})})}}),jsx(a,{variant:"filled",name:"event",label:"Evento",disabled:!0})]})]}),jsxs(l,{direction:"row",gap:2,alignItems:"center",children:[jsx(a$2,{fullWidth:!0,options:s,name:"content_type",label:"Tipo de conte\xFAdo",required:!0,rules:{required:{value:!0,message:"Campo Tipo de conte\xFAdo \xE9 obrigat\xF3rio"}}}),jsx(a$2,{fullWidth:!0,options:c,name:"http_method",label:"M\xE9todo HTTP",required:!0,rules:{required:{value:!0,message:"Campo M\xE9todo HTTP \xE9 obrigat\xF3rio"}}})]}),jsx(O,{variant:"overline",color:"grey",children:"Cabe\xE7alho"}),E?.map((P,i)=>jsxs(l,{direction:"row",gap:2,alignItems:"center",children:[jsx(a,{name:`headers.${i}.name`,label:"Chave",required:!0,rules:{required:{value:!0,message:""}}}),jsx(a,{name:`headers.${i}.value`,label:"Valor"}),jsx(T,{color:"error",onClick:()=>C(i),children:jsx(a$1,{icon:"DELETE_MARK_BUTTON_02"})})]},P.id)),jsx(a$3,{actionType:"NEW",size:"large",variant:"outlined",color:"inherit",fullWidth:!0,onClick:()=>I(),children:"Adicionar novo cabe\xE7alho"}),jsx(w,{})]})},se=U;
17
+ var s=[{label:"XML",value:"XML"},{label:"JSON",value:"JSON"},{label:"BYTEA",value:"BYTEA"}],c=[{label:"GET",value:"GET"},{label:"POST",value:"POST"},{label:"DELETE",value:"DELETE"},{label:"PUT",value:"PUT"}];var b=styled(T)(({theme:o})=>({svg:{color:`${o.palette.primary.main} !important`}}));styled(T)(()=>({height:"38px",alignSelf:"center"}));var y=styled(O)(()=>({textDecoration:"underline",fontWeight:"600",cursor:"pointer"})),h=styled(I)(({theme:o})=>({backgroundColor:`${alpha(o.palette.primary.main,.03)}`,border:`1px solid ${alpha(o.palette.primary.main,.4)}`,flexDirection:"row",alignItems:"center",padding:"2px 12px",gap:8,borderRadius:8,marginBottom:16,"& svg":{color:o.palette.primary.main}}));var W=()=>{let o=()=>{let a="https://ajuda.zydon.com.br/pt-BR/articles/9180603-sobre-webhooks";window.open(a,"_blank");};return jsx(h,{severity:"info",children:jsxs(O,{color:"grey",variant:"caption",children:["Webhooks permitem que servi\xE7os externos sejam notificados quando determinados eventos acontecem. Saiba mais"," ",jsx(y,{variant:"caption",color:"primary",onClick:()=>o(),children:"acessando a documenta\xE7\xE3o do Webhook"})]})})},g=W;var _=({webhookData:o,isEditing:a$4=!1,haveTip:S=!1})=>{let{control:k}=useFormContext(),{fields:E,append:A,remove:C}=useFieldArray({name:"headers",control:k}),P=()=>{A({value:"",name:""});};return jsxs(Fragment,{children:[S&&jsx(g,{}),a$4&&jsx(a,{name:"name",label:"Nome do webhook"}),jsxs(l,{direction:"row",gap:2,children:[jsx(a,{name:"url",label:"URL de endpoint",rules:{required:{value:!0,message:"Url \xE9 obrigat\xF3rio"}}}),jsx(a,{name:"filter",label:"Filtro"})]}),a$4&&o&&jsxs(Fragment,{children:[jsx(a,{variant:"filled",name:"solution",label:"Solu\xE7\xE3o",disabled:!0}),jsxs(l,{direction:"row",gap:2,children:[jsx(a,{variant:"filled",name:"resource",label:"Origem",disabled:!0}),jsx(a,{variant:"filled",name:"resource_id",label:"ID origem",disabled:!0,InputProps:{endAdornment:jsx(q,{position:"end",children:jsx(b,{onClick:()=>navigator.clipboard.writeText(o.resource_id),children:jsx(a$1,{className:"copyIcon",icon:"COPY_CONTENT"})})})}}),jsx(a,{variant:"filled",name:"event",label:"Evento",disabled:!0})]})]}),jsxs(l,{direction:"row",gap:2,alignItems:"center",children:[jsx(a$2,{fullWidth:!0,options:s,name:"content_type",label:"Tipo de conte\xFAdo",required:!0,rules:{required:{value:!0,message:"Campo Tipo de conte\xFAdo \xE9 obrigat\xF3rio"}}}),jsx(a$2,{fullWidth:!0,options:c,name:"http_method",label:"M\xE9todo HTTP",required:!0,rules:{required:{value:!0,message:"Campo M\xE9todo HTTP \xE9 obrigat\xF3rio"}}})]}),jsx(O,{variant:"overline",color:"grey",children:"Cabe\xE7alho"}),E?.map((x,i)=>jsxs(l,{direction:"row",gap:2,alignItems:"center",children:[jsx(a,{name:`headers.${i}.name`,label:"Chave",required:!0,rules:{required:{value:!0,message:""}}}),jsx(a,{name:`headers.${i}.value`,label:"Valor"}),jsx(T,{color:"error",onClick:()=>C(i),children:jsx(a$1,{icon:"DELETE_MARK_BUTTON_02"})})]},x.id)),jsx(a$3,{actionType:"NEW",size:"large",variant:"outlined",color:"inherit",fullWidth:!0,onClick:()=>P(),children:"Adicionar novo cabe\xE7alho"}),jsx(D,{})]})},se=_;
18
18
 
19
19
  export { se as default };
@@ -2,7 +2,7 @@ interface WebhookType {
2
2
  id: string;
3
3
  name: string;
4
4
  resource: string;
5
- resourceID: string;
5
+ resource_id: string;
6
6
  event: string;
7
7
  content_type: ContentTypeStatus;
8
8
  url: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zydon/common",
3
- "version": "2.0.3",
3
+ "version": "2.0.5",
4
4
  "license": "MIT",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -1,5 +1,5 @@
1
- import { a as a$3 } from './chunk-2ZLS7IUJ.mjs';
2
1
  import { a as a$1 } from './chunk-OUPUY4L2.mjs';
2
+ import { a as a$3 } from './chunk-2ZLS7IUJ.mjs';
3
3
  import { a as a$4 } from './chunk-WHA7HOMZ.mjs';
4
4
  import { a as a$2 } from './chunk-SXVKHA6L.mjs';
5
5
  import { a as a$5 } from './chunk-QHCGLZFD.mjs';