@zydon/common 2.0.4 → 2.0.6
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/components/form/DatePicker/index.d.ts +2 -1
- package/dist/components/form/DatePicker/index.mjs +2 -2
- package/dist/components/form/DateRangePicker/index.d.ts +7 -1
- package/dist/components/form/DateRangePicker/index.mjs +3 -3
- package/dist/components/form/DateTimePicker/index.d.ts +2 -1
- package/dist/components/form/DateTimePicker/index.mjs +2 -2
- package/dist/components/form/TimePicker/index.d.ts +2 -1
- package/dist/components/form/TimePicker/index.mjs +1 -1
- package/dist/components/form/Webhook/index.mjs +3 -3
- package/dist/types/webhook.d.ts +1 -1
- package/package.json +1 -1
|
@@ -5,11 +5,12 @@ import { Dayjs } from 'dayjs';
|
|
|
5
5
|
import { BaseField } from '../../../types/baseField.js';
|
|
6
6
|
import 'react-hook-form';
|
|
7
7
|
|
|
8
|
-
type DatePickerProps = BaseField<Omit<DatePickerProps$1<Dayjs>, 'value'>> & {
|
|
8
|
+
type DatePickerProps = BaseField<Omit<DatePickerProps$1<Dayjs>, 'value' | 'onChange'>> & {
|
|
9
9
|
tabIndex?: number;
|
|
10
10
|
helperText?: ReactNode;
|
|
11
11
|
required?: boolean;
|
|
12
12
|
value?: Date | null | undefined;
|
|
13
|
+
onChange(value: Date | null | undefined): void;
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
declare const DatePicker: ({ name, rules, tabIndex, helperText, required, ...other }: DatePickerProps) => react_jsx_runtime.JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useFormContext, Controller } from 'react-hook-form';
|
|
2
2
|
import { DatePicker } from '@mui/x-date-pickers-pro';
|
|
3
|
-
import
|
|
3
|
+
import C from 'dayjs';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
|
-
var d=({name:
|
|
6
|
+
var d=({name:s,rules:p,tabIndex:o,helperText:u,required:i,...e})=>{let{control:m}=useFormContext();return jsx(Controller,{name:s,control:m,rules:p,render:({field:{ref:c,onChange:f,...t},fieldState:{error:r}})=>jsx(DatePicker,{inputRef:c,format:"DD/MM/YYYY",...t,...e,value:t.value?C(t.value):null,onChange:l=>{let a=l?l.toDate():null;f(a),e.onChange(a);},slotProps:{textField:{...e.slotProps?.textField,required:i,error:!!r,helperText:r?.message||u,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:o}},openPickerButton:{tabIndex:o}}})})},x=d;
|
|
7
7
|
|
|
8
8
|
export { x as default };
|
|
@@ -5,7 +5,13 @@ import { Dayjs } from 'dayjs';
|
|
|
5
5
|
import { BaseField } from '../../../types/baseField.js';
|
|
6
6
|
import 'react-hook-form';
|
|
7
7
|
|
|
8
|
-
type
|
|
8
|
+
type DateRange = {
|
|
9
|
+
startDate?: Date | null | undefined;
|
|
10
|
+
endDate?: Date | null | undefined;
|
|
11
|
+
};
|
|
12
|
+
type DateRangePickerProps = BaseField<Omit<DateRangePickerProps$1<Dayjs>, 'value' | 'onChange'>> & {
|
|
13
|
+
value?: DateRange;
|
|
14
|
+
onChange(value?: DateRange): void;
|
|
9
15
|
tabIndex?: number;
|
|
10
16
|
helperText?: ReactNode;
|
|
11
17
|
required?: boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useFormContext, Controller } from 'react-hook-form';
|
|
2
2
|
import { DateRangePicker } from '@mui/x-date-pickers-pro';
|
|
3
|
-
import
|
|
3
|
+
import s from 'dayjs';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var C=({name:o,label:a,rules:D,tabIndex:d,helperText:p,required:f,...r})=>{let{control:m,setError:u}=useFormContext();return jsx(Controller,{name:o,control:m,rules:D,render:({field:{value:t,onChange:c},fieldState:{error:n}})=>jsx(DateRangePicker,{...r,format:"DD/MM/YYYY",value:[t?.startDate?s(t.startDate):null,t?.endDate?s(t.endDate):null],onChange:e=>{let l={startDate:e[0]?e[0].toDate():null,endDate:e[1]?e[1].toDate():null};c(l),r.onChange(l);},onError:e=>{u(o,{message:e[0]||e[1]||void 0});},slotProps:{textField:({position:e})=>({...r.slotProps?.textField,required:f,error:!!n,helperText:n?.message||p,autoComplete:"off",spellCheck:"false",fullWidth:!0,label:e==="start"?`${a} (Dt. In\xEDcio)`:`${a} (Dt. Fim)`,inputProps:{tabIndex:d}})},sx:{width:1}})})},F=C;
|
|
7
7
|
|
|
8
|
-
export {
|
|
8
|
+
export { F as default };
|
|
@@ -5,11 +5,12 @@ import { Dayjs } from 'dayjs';
|
|
|
5
5
|
import { BaseField } from '../../../types/baseField.js';
|
|
6
6
|
import 'react-hook-form';
|
|
7
7
|
|
|
8
|
-
type DateTimePickerProps = BaseField<Omit<DateTimePickerProps$1<Dayjs>, 'value'>> & {
|
|
8
|
+
type DateTimePickerProps = BaseField<Omit<DateTimePickerProps$1<Dayjs>, 'value' | 'onChange'>> & {
|
|
9
9
|
tabIndex?: number;
|
|
10
10
|
helperText?: ReactNode;
|
|
11
11
|
required?: boolean;
|
|
12
12
|
value?: Date | null | undefined;
|
|
13
|
+
onChange(value: Date | null | undefined): void;
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
declare const DateTimePicker: ({ name, rules, tabIndex, helperText, required, ...other }: DateTimePickerProps) => react_jsx_runtime.JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useFormContext, Controller } from 'react-hook-form';
|
|
2
2
|
import { DateTimePicker } from '@mui/x-date-pickers-pro';
|
|
3
|
-
import
|
|
3
|
+
import C from 'dayjs';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
|
-
var T=({name:m,rules:
|
|
6
|
+
var T=({name:m,rules:n,tabIndex:o,helperText:s,required:p,...e})=>{let{control:u}=useFormContext();return jsx(Controller,{name:m,control:u,rules:n,render:({field:{ref:c,onChange:f,...t},fieldState:{error:r}})=>jsx(DateTimePicker,{format:"DD/MM/YYYY HH:mm",inputRef:c,...t,...e,value:t.value?C(t.value):null,onChange:l=>{let i=l?l.toDate():null;f(i),e.onChange(i);},slotProps:{textField:{...e.slotProps?.textField,required:p,error:!!r,helperText:r?.message||s,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:o}},openPickerButton:{tabIndex:o}}})})},h=T;
|
|
7
7
|
|
|
8
8
|
export { h as default };
|
|
@@ -5,11 +5,12 @@ import { Dayjs } from 'dayjs';
|
|
|
5
5
|
import { BaseField } from '../../../types/baseField.js';
|
|
6
6
|
import 'react-hook-form';
|
|
7
7
|
|
|
8
|
-
type TimePickerProps = BaseField<Omit<TimePickerProps$1<Dayjs>, 'components' | 'value'>> & {
|
|
8
|
+
type TimePickerProps = BaseField<Omit<TimePickerProps$1<Dayjs>, 'components' | 'value' | 'onChange'>> & {
|
|
9
9
|
tabIndex?: number;
|
|
10
10
|
helperText?: ReactNode;
|
|
11
11
|
required?: boolean;
|
|
12
12
|
value?: Date | null | undefined;
|
|
13
|
+
onChange(value: Date | null | undefined): void;
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
declare const TimePicker: ({ name, rules, tabIndex, helperText, required, ...other }: TimePickerProps) => react_jsx_runtime.JSX.Element;
|
|
@@ -3,6 +3,6 @@ import { TimePicker } from '@mui/x-date-pickers-pro';
|
|
|
3
3
|
import T from 'dayjs';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
|
-
var d=({name:
|
|
6
|
+
var d=({name:n,rules:s,tabIndex:t,helperText:p,required:a,...e})=>{let{control:u}=useFormContext();return jsx(Controller,{name:n,control:u,rules:s,render:({field:{ref:f,onChange:c,...o},fieldState:{error:r}})=>jsx(TimePicker,{ampm:!1,format:"HH:mm",inputRef:f,...o,...e,value:o.value?T(o.value):null,onChange:l=>{let m=l?l.toDate():null;c(m),e.onChange(m);},slotProps:{textField:{...e.slotProps?.textField,error:!!r,required:a,helperText:r?.message||p,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:t}},openPickerButton:{tabIndex:t}}})})},F=d;
|
|
7
7
|
|
|
8
8
|
export { F as default };
|
|
@@ -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
|
|
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
|
|
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(
|
|
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 };
|
package/dist/types/webhook.d.ts
CHANGED