@zydon/common 2.8.46 → 2.8.48
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/DynamicDataView/index.js +1 -1
- package/dist/components/form/Address/index.d.ts +2 -1
- package/dist/components/form/Address/index.js +9 -9
- package/dist/components/form/Address/index.js.map +1 -1
- package/dist/components/form/DatePicker/index.d.ts +1 -0
- package/dist/components/form/DateRangePicker/index.d.ts +2 -1
- package/dist/components/form/DateRangePicker/index.js +4 -4
- package/dist/components/form/DateRangePicker/index.js.map +1 -1
- package/dist/components/form/DateTimePicker/index.d.ts +2 -1
- package/dist/components/form/DateTimePicker/index.js +3 -3
- package/dist/components/form/DateTimePicker/index.js.map +1 -1
- package/dist/components/form/Switch/index.d.ts +1 -0
- package/dist/components/form/TimePicker/index.d.ts +2 -1
- package/dist/components/form/TimePicker/index.js +3 -3
- package/dist/components/form/TimePicker/index.js.map +1 -1
- package/dist/types/addressProps.d.ts +2 -0
- package/dist/types/datePickerProps.d.ts +2 -1
- package/dist/types/dateRangePickerProps.d.ts +2 -0
- package/dist/types/dateTimePickerProps.d.ts +2 -0
- package/dist/types/size.d.ts +3 -0
- package/dist/types/size.js +2 -0
- package/dist/types/size.js.map +1 -0
- package/dist/types/switchProps.d.ts +2 -1
- package/dist/types/timePickerProps.d.ts +2 -0
- package/dist/utils/buildExportPayload.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import '../../chunk-4P2L7UJA.js';
|
|
2
1
|
export { a as FilterOperator, b as SortType } from '../../chunk-VL4W63YA.js';
|
|
2
|
+
import '../../chunk-4P2L7UJA.js';
|
|
3
3
|
import { a as a$1 } from '../../chunk-LG2B5RFV.js';
|
|
4
4
|
import { d, c } from '../../chunk-N7IK5EUP.js';
|
|
5
5
|
import { h, a as a$3 } from '../../chunk-OF6623HG.js';
|
|
@@ -3,7 +3,8 @@ import { AddressProps } from '../../../types/addressProps.js';
|
|
|
3
3
|
import '@mui/material/Stack';
|
|
4
4
|
import '../../../types/baseField.js';
|
|
5
5
|
import 'react-hook-form';
|
|
6
|
+
import '../../../types/size.js';
|
|
6
7
|
|
|
7
|
-
declare const Address: ({ name, containerProps, required, rules, tabIndex, loading, disableTyping, onZipCodeChange, }: AddressProps) => react_jsx_runtime.JSX.Element;
|
|
8
|
+
declare const Address: ({ name, containerProps, required, rules, tabIndex, loading, disableTyping, onZipCodeChange, size, }: AddressProps) => react_jsx_runtime.JSX.Element;
|
|
8
9
|
|
|
9
10
|
export { Address as default };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { a as a$
|
|
2
|
-
import { a
|
|
3
|
-
import { a as a$
|
|
1
|
+
import { a as a$3 } from '../../../chunk-MSCOIJQ5.js';
|
|
2
|
+
import { a } from '../../../chunk-X64QHBVQ.js';
|
|
3
|
+
import { a as a$1 } from '../../../chunk-YXRL4O4H.js';
|
|
4
4
|
import '../../../chunk-RTC7H5E5.js';
|
|
5
|
-
import { a as a$
|
|
5
|
+
import { a as a$2 } from '../../../chunk-G2UA2MTH.js';
|
|
6
6
|
import '../../../chunk-37WASMP5.js';
|
|
7
7
|
import '../../../chunk-4GMBTAO6.js';
|
|
8
8
|
import '../../../chunk-QNSWRP73.js';
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
9
|
+
import L from '@mui/material/CircularProgress';
|
|
10
|
+
import g from '@mui/material/InputAdornment';
|
|
11
|
+
import s from '@mui/material/Stack';
|
|
12
12
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var A=({name:t,containerProps:u,required:d,rules:f,tabIndex:e,loading:w,disableTyping:i,onZipCodeChange:h,size:n})=>{let P=`${t}.zipCode`,b=`${t}.publicPlace`,C=`${t}.number`,E=`${t}.district`,D=`${t}.complement`,I=`${t}.state`,k=`${t}.city`,a$4=p=>{p.key==="Enter"&&p.preventDefault();};return jsxs(s,{gap:1.5,...u,children:[jsxs(s,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[jsx(a,{name:P,label:"CEP",mask:[{mask:"00000-000"}],InputProps:{endAdornment:w&&jsx(g,{position:"end",children:jsx(L,{size:24})})},rules:f,onKeyDown:a$4,required:d,sx:{width:"auto",flex:1,minWidth:160},tabIndex:e,onChange:h,size:n}),jsxs(s,{direction:{xs:"column",sm:"row"},gap:1.5,flex:{xs:1,md:"1 1 50%"},children:[jsx(a$1,{name:b,label:"Logradouro",onKeyDown:a$4,inputProps:{maxLength:70},sx:{width:"auto",minWidth:250,flex:1},tabIndex:e,disabled:i,size:n}),jsx(a$1,{name:C,label:"N\xFAmero",onKeyDown:a$4,inputProps:{maxLength:6},sx:{width:"auto",minWidth:100},tabIndex:e})]})]}),jsxs(s,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[jsx(a$1,{name:E,label:"Bairro",onKeyDown:a$4,inputProps:{maxLength:20},sx:{width:"auto",flex:{xs:1,md:"1 1 100px"}},tabIndex:e,disabled:i,size:n}),jsx(a$1,{name:D,label:"Complemento",onKeyDown:a$4,inputProps:{maxLength:30},sx:{minWidth:200,width:"auto",flex:{xs:1,md:"1 1 500px"}},tabIndex:e,size:n})]}),jsxs(s,{gap:1.5,flexWrap:"wrap",direction:{xs:"column",sm:"row"},children:[jsx(a$2,{name:I,label:"Estado",options:a$3,disabled:i,required:d,sx:{flex:1},tabIndex:e,size:n}),jsx(a$1,{name:k,label:"Cidade",disabled:i,required:d,sx:{flex:1},tabIndex:e,size:n})]})]})},T=A;
|
|
15
15
|
|
|
16
|
-
export {
|
|
16
|
+
export { T as default };
|
|
17
17
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/form/Address/index.tsx"],"names":["CircularProgress","InputAdornment","Stack","jsx","jsxs","Address","name","containerProps","required","rules","tabIndex","loading","disableTyping","onZipCodeChange","ZIP_CODE_FIELD","PUBLIC_PLACE","NUMBER","DISTRICT","COMPLEMENT","STATE","CITY","handleKeyDown","e","MaskedInput_default","Field_default","Autocomplete_default","ufs_default","Address_default"],"mappings":"wUACA,OAAOA,MAAsB,iCAC7B,OAAOC,MAAoB,+BAC3B,OAAOC,MAAW,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/form/Address/index.tsx"],"names":["CircularProgress","InputAdornment","Stack","jsx","jsxs","Address","name","containerProps","required","rules","tabIndex","loading","disableTyping","onZipCodeChange","size","ZIP_CODE_FIELD","PUBLIC_PLACE","NUMBER","DISTRICT","COMPLEMENT","STATE","CITY","handleKeyDown","e","MaskedInput_default","Field_default","Autocomplete_default","ufs_default","Address_default"],"mappings":"wUACA,OAAOA,MAAsB,iCAC7B,OAAOC,MAAoB,+BAC3B,OAAOC,MAAW,sBAqDF,cAAAC,EAiBR,QAAAC,MAjBQ,oBA5ChB,IAAMC,EAAU,CAAC,CACf,KAAAC,EACA,eAAAC,EACA,SAAAC,EACA,MAAAC,EACA,SAAAC,EACA,QAAAC,EACA,cAAAC,EACA,gBAAAC,EACA,KAAAC,CACF,IAAoB,CAClB,IAAMC,EAAiB,GAAGT,YACpBU,EAAe,GAAGV,gBAClBW,EAAS,GAAGX,WACZY,EAAW,GAAGZ,aACda,EAAa,GAAGb,eAChBc,EAAQ,GAAGd,UACXe,EAAO,GAAGf,SAEVgB,EAAiBC,GAA2C,CAC5DA,EAAE,MAAQ,SAASA,EAAE,eAAe,CAC1C,EAEA,OACEnB,EAACF,EAAA,CAAM,IAAK,IAAM,GAAGK,EACnB,UAAAH,EAACF,EAAA,CACC,UAAW,CACT,GAAI,SACJ,GAAI,KACN,EACA,IAAK,IACL,SAAS,OAET,UAAAC,EAACqB,EAAA,CACC,KAAMT,EACN,MAAM,MACN,KAAM,CACJ,CACE,KAAM,WACR,CACF,EACA,WAAY,CACV,aAAcJ,GACZR,EAACF,EAAA,CAAe,SAAS,MACvB,SAAAE,EAACH,EAAA,CAAiB,KAAM,GAAI,EAC9B,CAEJ,EACA,MAAOS,EACP,UAAWa,EACX,SAAUd,EACV,GAAI,CACF,MAAO,OACP,KAAM,EACN,SAAU,GACZ,EACA,SAAUE,EACV,SAAUG,EACV,KAAMC,EACR,EAEAV,EAACF,EAAA,CACC,UAAW,CACT,GAAI,SACJ,GAAI,KACN,EACA,IAAK,IACL,KAAM,CACJ,GAAI,EACJ,GAAI,SACN,EAEA,UAAAC,EAACsB,EAAA,CACC,KAAMT,EACN,MAAM,aACN,UAAWM,EACX,WAAY,CAAE,UAAW,EAAG,EAC5B,GAAI,CACF,MAAO,OACP,SAAU,IACV,KAAM,CACR,EACA,SAAUZ,EACV,SAAUE,EACV,KAAME,EACR,EAEAX,EAACsB,EAAA,CACC,KAAMR,EACN,MAAM,YACN,UAAWK,EACX,WAAY,CAAE,UAAW,CAAE,EAC3B,GAAI,CACF,MAAO,OACP,SAAU,GACZ,EACA,SAAUZ,EACZ,GACF,GACF,EAEAN,EAACF,EAAA,CACC,UAAW,CACT,GAAI,SACJ,GAAI,KACN,EACA,IAAK,IACL,SAAS,OAET,UAAAC,EAACsB,EAAA,CACC,KAAMP,EACN,MAAM,SACN,UAAWI,EACX,WAAY,CAAE,UAAW,EAAG,EAC5B,GAAI,CACF,MAAO,OACP,KAAM,CACJ,GAAI,EACJ,GAAI,WACN,CACF,EACA,SAAUZ,EACV,SAAUE,EACV,KAAME,EACR,EAEAX,EAACsB,EAAA,CACC,KAAMN,EACN,MAAM,cACN,UAAWG,EACX,WAAY,CAAE,UAAW,EAAG,EAC5B,GAAI,CACF,SAAU,IACV,MAAO,OACP,KAAM,CACJ,GAAI,EACJ,GAAI,WACN,CACF,EACA,SAAUZ,EACV,KAAMI,EACR,GACF,EAEAV,EAACF,EAAA,CACC,IAAK,IACL,SAAS,OACT,UAAW,CACT,GAAI,SACJ,GAAI,KACN,EAEA,UAAAC,EAACuB,EAAA,CACC,KAAMN,EACN,MAAM,SACN,QAASO,EACT,SAAUf,EACV,SAAUJ,EACV,GAAI,CAAE,KAAM,CAAE,EACd,SAAUE,EACV,KAAMI,EACR,EAEAX,EAACsB,EAAA,CACC,KAAMJ,EACN,MAAM,SACN,SAAUT,EACV,SAAUJ,EACV,GAAI,CAAE,KAAM,CAAE,EACd,SAAUE,EACV,KAAMI,EACR,GACF,GACF,CAEJ,EAEOc,EAAQvB","sourcesContent":["import React from 'react';\nimport CircularProgress from '@mui/material/CircularProgress';\nimport InputAdornment from '@mui/material/InputAdornment';\nimport Stack from '@mui/material/Stack';\n\nimport { AddressProps } from 'types/addressProps';\nimport ufs from 'utils/ufs';\n\nimport Autocomplete from '../Autocomplete';\nimport Field from '../Field';\nimport MaskedInput from '../MaskedInput';\n\nconst Address = ({\n name,\n containerProps,\n required,\n rules,\n tabIndex,\n loading,\n disableTyping,\n onZipCodeChange,\n size,\n}: AddressProps) => {\n const ZIP_CODE_FIELD = `${name}.zipCode`;\n const PUBLIC_PLACE = `${name}.publicPlace`;\n const NUMBER = `${name}.number`;\n const DISTRICT = `${name}.district`;\n const COMPLEMENT = `${name}.complement`;\n const STATE = `${name}.state`;\n const CITY = `${name}.city`;\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n if (e.key === 'Enter') e.preventDefault();\n };\n\n return (\n <Stack gap={1.5} {...containerProps}>\n <Stack\n direction={{\n xs: 'column',\n md: 'row',\n }}\n gap={1.5}\n flexWrap=\"wrap\"\n >\n <MaskedInput\n name={ZIP_CODE_FIELD}\n label=\"CEP\"\n mask={[\n {\n mask: '00000-000',\n },\n ]}\n InputProps={{\n endAdornment: loading && (\n <InputAdornment position=\"end\">\n <CircularProgress size={24} />\n </InputAdornment>\n ),\n }}\n rules={rules}\n onKeyDown={handleKeyDown}\n required={required}\n sx={{\n width: 'auto',\n flex: 1,\n minWidth: 160,\n }}\n tabIndex={tabIndex}\n onChange={onZipCodeChange}\n size={size}\n />\n\n <Stack\n direction={{\n xs: 'column',\n sm: 'row',\n }}\n gap={1.5}\n flex={{\n xs: 1,\n md: '1 1 50%',\n }}\n >\n <Field\n name={PUBLIC_PLACE}\n label=\"Logradouro\"\n onKeyDown={handleKeyDown}\n inputProps={{ maxLength: 70 }}\n sx={{\n width: 'auto',\n minWidth: 250,\n flex: 1,\n }}\n tabIndex={tabIndex}\n disabled={disableTyping}\n size={size}\n />\n\n <Field\n name={NUMBER}\n label=\"Número\"\n onKeyDown={handleKeyDown}\n inputProps={{ maxLength: 6 }}\n sx={{\n width: 'auto',\n minWidth: 100,\n }}\n tabIndex={tabIndex}\n />\n </Stack>\n </Stack>\n\n <Stack\n direction={{\n xs: 'column',\n md: 'row',\n }}\n gap={1.5}\n flexWrap=\"wrap\"\n >\n <Field\n name={DISTRICT}\n label=\"Bairro\"\n onKeyDown={handleKeyDown}\n inputProps={{ maxLength: 20 }}\n sx={{\n width: 'auto',\n flex: {\n xs: 1,\n md: '1 1 100px',\n },\n }}\n tabIndex={tabIndex}\n disabled={disableTyping}\n size={size}\n />\n\n <Field\n name={COMPLEMENT}\n label=\"Complemento\"\n onKeyDown={handleKeyDown}\n inputProps={{ maxLength: 30 }}\n sx={{\n minWidth: 200,\n width: 'auto',\n flex: {\n xs: 1,\n md: '1 1 500px',\n },\n }}\n tabIndex={tabIndex}\n size={size}\n />\n </Stack>\n\n <Stack\n gap={1.5}\n flexWrap=\"wrap\"\n direction={{\n xs: 'column',\n sm: 'row',\n }}\n >\n <Autocomplete\n name={STATE}\n label=\"Estado\"\n options={ufs}\n disabled={disableTyping}\n required={required}\n sx={{ flex: 1 }}\n tabIndex={tabIndex}\n size={size}\n />\n\n <Field\n name={CITY}\n label=\"Cidade\"\n disabled={disableTyping}\n required={required}\n sx={{ flex: 1 }}\n tabIndex={tabIndex}\n size={size}\n />\n </Stack>\n </Stack>\n );\n};\n\nexport default Address;\n"]}
|
|
@@ -5,6 +5,7 @@ import '@mui/x-date-pickers-pro';
|
|
|
5
5
|
import 'dayjs';
|
|
6
6
|
import '../../../types/baseField.js';
|
|
7
7
|
import 'react-hook-form';
|
|
8
|
+
import '../../../types/size.js';
|
|
8
9
|
|
|
9
10
|
declare const DatePicker: ({ name, id, rules, tabIndex, helperText, required, size, fullWidth, placeholder, ...other }: DatePickerProps) => react_jsx_runtime.JSX.Element;
|
|
10
11
|
|
|
@@ -5,7 +5,8 @@ import '@mui/x-date-pickers-pro';
|
|
|
5
5
|
import 'dayjs';
|
|
6
6
|
import '../../../types/baseField.js';
|
|
7
7
|
import 'react-hook-form';
|
|
8
|
+
import '../../../types/size.js';
|
|
8
9
|
|
|
9
|
-
declare const DateRangePicker: ({ name, label, rules, helperText, required, ...other }: DateRangePickerProps) => react_jsx_runtime.JSX.Element;
|
|
10
|
+
declare const DateRangePicker: ({ name, label, rules, helperText, required, size, ...other }: DateRangePickerProps) => react_jsx_runtime.JSX.Element;
|
|
10
11
|
|
|
11
12
|
export { DateRangePicker as default };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useFormContext, Controller } from 'react-hook-form';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import k from '@mui/material/FormHelperText';
|
|
3
|
+
import x from '@mui/material/Stack';
|
|
4
4
|
import { DateRangePicker } from '@mui/x-date-pickers-pro';
|
|
5
5
|
import i from 'dayjs';
|
|
6
6
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var F=({name:e,label:s,rules:D,helperText:l,required:d,size:f,...r})=>{let{control:c,setError:p}=useFormContext();return jsx(Controller,{name:e,control:c,rules:D,render:({field:{value:o,onChange:g},fieldState:{error:a}})=>jsxs(x,{children:[jsx(DateRangePicker,{"data-intercom-target":e,...r,format:"DD/MM/YYYY",value:[o?.startDate?i(o.startDate):null,o?.endDate?i(o.endDate):null],onChange:t=>{let m={startDate:t[0]?t[0].toDate():null,endDate:t[1]?t[1].toDate():null};g(m),r.onChange&&r.onChange(m);},onError:t=>{p(e,{message:t[0]||t[1]||void 0});},slotProps:{textField:({position:t})=>({...r.slotProps?.textField,required:d,error:!!a,autoComplete:"off",spellCheck:"false",fullWidth:!0,label:t==="start"?`${s} (Dt. In\xEDcio)`:`${s} (Dt. Fim)`,name:t==="start"?`${e}Start`:`${e}End`,size:f})},sx:{width:1}}),(a?.message||l)&&jsx(k,{error:!!a,sx:{mx:"14px"},children:a?.message||l})]})})},E=F;
|
|
9
9
|
|
|
10
|
-
export {
|
|
10
|
+
export { E as default };
|
|
11
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/form/DateRangePicker/index.tsx"],"names":["Controller","useFormContext","FormHelperText","Stack","MuiDateRangePicker","dayjs","jsx","jsxs","DateRangePicker","name","label","rules","helperText","required","other","control","setError","value","onChange","error","v","newValue","newError","position","DateRangePicker_default"],"mappings":"AAAA,OAAS,cAAAA,EAAY,kBAAAC,MAAsB,kBAC3C,OAAOC,MAAoB,+BAC3B,OAAOC,MAAW,sBAClB,OAAS,mBAAmBC,MAA0B,0BACtD,OAAOC,MAAW,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/form/DateRangePicker/index.tsx"],"names":["Controller","useFormContext","FormHelperText","Stack","MuiDateRangePicker","dayjs","jsx","jsxs","DateRangePicker","name","label","rules","helperText","required","size","other","control","setError","value","onChange","error","v","newValue","newError","position","DateRangePicker_default"],"mappings":"AAAA,OAAS,cAAAA,EAAY,kBAAAC,MAAsB,kBAC3C,OAAOC,MAAoB,+BAC3B,OAAOC,MAAW,sBAClB,OAAS,mBAAmBC,MAA0B,0BACtD,OAAOC,MAAW,QAsBR,OACE,OAAAC,EADF,QAAAC,MAAA,oBAlBV,IAAMC,EAAkB,CAAC,CACvB,KAAAC,EACA,MAAAC,EACA,MAAAC,EACA,WAAAC,EACA,SAAAC,EACA,KAAAC,EACA,GAAGC,CACL,IAA4B,CAC1B,GAAM,CAAE,QAAAC,EAAS,SAAAC,CAAS,EAAIhB,EAAe,EAE7C,OACEK,EAACN,EAAA,CACC,KAAMS,EACN,QAASO,EACT,MAAOL,EACP,OAAQ,CAAC,CAAE,MAAO,CAAE,MAAAO,EAAO,SAAAC,CAAS,EAAG,WAAY,CAAE,MAAAC,CAAM,CAAE,IAEzDb,EAACJ,EAAA,CACC,UAAAG,EAACF,EAAA,CACC,uBAAsBK,EACrB,GAAGM,EACJ,OAAO,aACP,MAAO,CACLG,GAAO,UAAYb,EAAMa,EAAM,SAAS,EAAI,KAC5CA,GAAO,QAAUb,EAAMa,EAAM,OAAO,EAAI,IAC1C,EACA,SAAUG,GAAK,CACb,IAAMC,EAAW,CACf,UAAWD,EAAE,CAAC,EAAIA,EAAE,CAAC,EAAE,OAAO,EAAI,KAClC,QAASA,EAAE,CAAC,EAAIA,EAAE,CAAC,EAAE,OAAO,EAAI,IAClC,EACAF,EAASG,CAAQ,EACjBP,EAAM,UAAYA,EAAM,SAASO,CAAQ,CAC3C,EACA,QAASC,GAAY,CACnBN,EAASR,EAAM,CACb,QAASc,EAAS,CAAC,GAAKA,EAAS,CAAC,GAAK,MACzC,CAAC,CACH,EACA,UAAW,CACT,UAAW,CAAC,CAAE,SAAAC,CAAS,KAAO,CAC5B,GAAGT,EAAM,WAAW,UACpB,SAAAF,EACA,MAAO,CAAC,CAACO,EACT,aAAc,MACd,WAAY,QACZ,UAAW,GACX,MACEI,IAAa,QACT,GAAGd,oBACH,GAAGA,cACT,KAAMc,IAAa,QAAU,GAAGf,SAAc,GAAGA,OACjD,KAAAK,CACF,EACF,EACA,GAAI,CACF,MAAO,CACT,EACF,GACEM,GAAO,SAAWR,IAClBN,EAACJ,EAAA,CAAe,MAAO,CAAC,CAACkB,EAAO,GAAI,CAAE,GAAI,MAAO,EAC9C,SAAAA,GAAO,SAAWR,EACrB,GAEJ,EAGN,CAEJ,EAEOa,EAAQjB","sourcesContent":["import { Controller, useFormContext } from 'react-hook-form';\nimport FormHelperText from '@mui/material/FormHelperText';\nimport Stack from '@mui/material/Stack';\nimport { DateRangePicker as MuiDateRangePicker } from '@mui/x-date-pickers-pro';\nimport dayjs from 'dayjs';\n\nimport { DateRangePickerProps } from 'types/dateRangePickerProps';\n\nconst DateRangePicker = ({\n name,\n label,\n rules,\n helperText,\n required,\n size,\n ...other\n}: DateRangePickerProps) => {\n const { control, setError } = useFormContext();\n\n return (\n <Controller\n name={name}\n control={control}\n rules={rules}\n render={({ field: { value, onChange }, fieldState: { error } }) => {\n return (\n <Stack>\n <MuiDateRangePicker\n data-intercom-target={name}\n {...other}\n format=\"DD/MM/YYYY\"\n value={[\n value?.startDate ? dayjs(value.startDate) : null,\n value?.endDate ? dayjs(value.endDate) : null,\n ]}\n onChange={v => {\n const newValue = {\n startDate: v[0] ? v[0].toDate() : null,\n endDate: v[1] ? v[1].toDate() : null,\n };\n onChange(newValue);\n other.onChange && other.onChange(newValue);\n }}\n onError={newError => {\n setError(name, {\n message: newError[0] || newError[1] || undefined,\n });\n }}\n slotProps={{\n textField: ({ position }) => ({\n ...other.slotProps?.textField,\n required,\n error: !!error,\n autoComplete: 'off',\n spellCheck: 'false',\n fullWidth: true,\n label:\n position === 'start'\n ? `${label} (Dt. Início)`\n : `${label} (Dt. Fim)`,\n name: position === 'start' ? `${name}Start` : `${name}End`,\n size,\n }),\n }}\n sx={{\n width: 1,\n }}\n />\n {(error?.message || helperText) && (\n <FormHelperText error={!!error} sx={{ mx: '14px' }}>\n {error?.message || helperText}\n </FormHelperText>\n )}\n </Stack>\n );\n }}\n />\n );\n};\n\nexport default DateRangePicker;\n"]}
|
|
@@ -5,7 +5,8 @@ import '@mui/x-date-pickers-pro';
|
|
|
5
5
|
import 'dayjs';
|
|
6
6
|
import '../../../types/baseField.js';
|
|
7
7
|
import 'react-hook-form';
|
|
8
|
+
import '../../../types/size.js';
|
|
8
9
|
|
|
9
|
-
declare const DateTimePicker: ({ name, rules, tabIndex, helperText, required, ...other }: DateTimePickerProps) => react_jsx_runtime.JSX.Element;
|
|
10
|
+
declare const DateTimePicker: ({ name, rules, tabIndex, helperText, required, size, ...other }: DateTimePickerProps) => react_jsx_runtime.JSX.Element;
|
|
10
11
|
|
|
11
12
|
export { DateTimePicker as default };
|
|
@@ -1,9 +1,9 @@
|
|
|
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
|
|
6
|
+
var T=({name:t,rules:n,tabIndex:m,helperText:s,required:u,size:p,...e})=>{let{control:c}=useFormContext();return jsx(Controller,{name:t,control:c,rules:n,render:({field:{ref:f,onChange:P,...o},fieldState:{error:r}})=>jsx(DateTimePicker,{format:"DD/MM/YYYY HH:mm",inputRef:f,...o,"data-intercom-target":t,...e,value:o.value?C(o.value):null,onChange:l=>{let a=l?l.toDate():null;P(a),e.onChange&&e.onChange(a);},slotProps:{textField:{...e.slotProps?.textField,name:t,required:u,error:!!r,helperText:r?.message||s,autoComplete:"off",spellCheck:"false",fullWidth:!0,size:p},openPickerButton:{tabIndex:m}}})})},h=T;
|
|
7
7
|
|
|
8
|
-
export {
|
|
8
|
+
export { h as default };
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/form/DateTimePicker/index.tsx"],"names":["Controller","useFormContext","MuiDateTimePicker","dayjs","jsx","DateTimePicker","name","rules","tabIndex","helperText","required","other","control","ref","onChange","field","error","v","newValue","DateTimePicker_default"],"mappings":"AAAA,OAAS,cAAAA,EAAY,kBAAAC,MAAsB,kBAC3C,OAAS,kBAAkBC,MAAyB,0BACpD,OAAOC,MAAW,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/form/DateTimePicker/index.tsx"],"names":["Controller","useFormContext","MuiDateTimePicker","dayjs","jsx","DateTimePicker","name","rules","tabIndex","helperText","required","size","other","control","ref","onChange","field","error","v","newValue","DateTimePicker_default"],"mappings":"AAAA,OAAS,cAAAA,EAAY,kBAAAC,MAAsB,kBAC3C,OAAS,kBAAkBC,MAAyB,0BACpD,OAAOC,MAAW,QAwBV,cAAAC,MAAA,oBApBR,IAAMC,EAAiB,CAAC,CACtB,KAAAC,EACA,MAAAC,EACA,SAAAC,EACA,WAAAC,EACA,SAAAC,EACA,KAAAC,EACA,GAAGC,CACL,IAA2B,CACzB,GAAM,CAAE,QAAAC,CAAQ,EAAIZ,EAAe,EAEnC,OACEG,EAACJ,EAAA,CACC,KAAMM,EACN,QAASO,EACT,MAAON,EACP,OAAQ,CAAC,CACP,MAAO,CAAE,IAAAO,EAAK,SAAAC,EAAU,GAAGC,CAAM,EACjC,WAAY,CAAE,MAAAC,CAAM,CACtB,IACEb,EAACF,EAAA,CACC,OAAO,mBACP,SAAUY,EACT,GAAGE,EACJ,uBAAsBV,EACrB,GAAGM,EACJ,MAAOI,EAAM,MAAQb,EAAMa,EAAM,KAAK,EAAI,KAC1C,SAAUE,GAAK,CACb,IAAMC,EAAWD,EAAIA,EAAE,OAAO,EAAI,KAClCH,EAASI,CAAQ,EACjBP,EAAM,UAAYA,EAAM,SAASO,CAAQ,CAC3C,EACA,UAAW,CACT,UAAW,CACT,GAAGP,EAAM,WAAW,UACpB,KAAAN,EACA,SAAAI,EACA,MAAO,CAAC,CAACO,EACT,WAAYA,GAAO,SAAWR,EAC9B,aAAc,MACd,WAAY,QACZ,UAAW,GACX,KAAAE,CACF,EACA,iBAAkB,CAChB,SAAAH,CACF,CACF,EACF,EAEJ,CAEJ,EAEOY,EAAQf","sourcesContent":["import { Controller, useFormContext } from 'react-hook-form';\nimport { DateTimePicker as MuiDateTimePicker } from '@mui/x-date-pickers-pro';\nimport dayjs from 'dayjs';\n\nimport { DateTimePickerProps } from 'types/dateTimePickerProps';\n\nconst DateTimePicker = ({\n name,\n rules,\n tabIndex,\n helperText,\n required,\n size,\n ...other\n}: DateTimePickerProps) => {\n const { control } = useFormContext();\n\n return (\n <Controller\n name={name}\n control={control}\n rules={rules}\n render={({\n field: { ref, onChange, ...field },\n fieldState: { error },\n }) => (\n <MuiDateTimePicker\n format=\"DD/MM/YYYY HH:mm\"\n inputRef={ref}\n {...field}\n data-intercom-target={name}\n {...other}\n value={field.value ? dayjs(field.value) : null}\n onChange={v => {\n const newValue = v ? v.toDate() : null;\n onChange(newValue);\n other.onChange && other.onChange(newValue);\n }}\n slotProps={{\n textField: {\n ...other.slotProps?.textField,\n name,\n required,\n error: !!error,\n helperText: error?.message || helperText,\n autoComplete: 'off',\n spellCheck: 'false',\n fullWidth: true,\n size,\n },\n openPickerButton: {\n tabIndex,\n },\n }}\n />\n )}\n />\n );\n};\n\nexport default DateTimePicker;\n"]}
|
|
@@ -4,6 +4,7 @@ import '@mui/material/FormControlLabel';
|
|
|
4
4
|
import '@mui/material/Switch';
|
|
5
5
|
import '../../../types/baseField.js';
|
|
6
6
|
import 'react-hook-form';
|
|
7
|
+
import '../../../types/size.js';
|
|
7
8
|
|
|
8
9
|
declare const Switch: ({ name, helperText, rules, onChange, tabIndex, size, label, sx, ...other }: SwitchProps) => react_jsx_runtime.JSX.Element;
|
|
9
10
|
|
|
@@ -5,7 +5,8 @@ import '@mui/x-date-pickers-pro';
|
|
|
5
5
|
import 'dayjs';
|
|
6
6
|
import '../../../types/baseField.js';
|
|
7
7
|
import 'react-hook-form';
|
|
8
|
+
import '../../../types/size.js';
|
|
8
9
|
|
|
9
|
-
declare const TimePicker: ({ name, rules, tabIndex, helperText, required, ...other }: TimePickerProps) => react_jsx_runtime.JSX.Element;
|
|
10
|
+
declare const TimePicker: ({ name, rules, tabIndex, helperText, required, size, ...other }: TimePickerProps) => react_jsx_runtime.JSX.Element;
|
|
10
11
|
|
|
11
12
|
export { TimePicker as default };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useFormContext, Controller } from 'react-hook-form';
|
|
2
2
|
import { TimePicker } from '@mui/x-date-pickers-pro';
|
|
3
|
-
import
|
|
3
|
+
import T from 'dayjs';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var g=({name:o,rules:n,tabIndex:a,helperText:s,required:p,size:u,...e})=>{let{control:c}=useFormContext();return jsx(Controller,{name:o,control:c,rules:n,render:({field:{ref:f,onChange:P,...t},fieldState:{error:r}})=>jsx(TimePicker,{ampm:!1,format:"HH:mm",inputRef:f,...t,"data-intercom-target":o,...e,value:t.value?T(t.value):null,onChange:l=>{let i=l?l.toDate():null;P(i),e.onChange&&e.onChange(i);},slotProps:{textField:{...e.slotProps?.textField,name:o,error:!!r,required:p,helperText:r?.message||s,autoComplete:"off",spellCheck:"false",fullWidth:!0,size:u},openPickerButton:{tabIndex:a}}})})},v=g;
|
|
7
7
|
|
|
8
|
-
export {
|
|
8
|
+
export { v as default };
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/form/TimePicker/index.tsx"],"names":["Controller","useFormContext","MuiTimePicker","dayjs","jsx","TimePicker","name","rules","tabIndex","helperText","required","other","control","ref","onChange","field","error","v","newValue","TimePicker_default"],"mappings":"AAAA,OAAS,cAAAA,EAAY,kBAAAC,MAAsB,kBAC3C,OAAS,cAAcC,MAAqB,0BAC5C,OAAOC,MAAW,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/form/TimePicker/index.tsx"],"names":["Controller","useFormContext","MuiTimePicker","dayjs","jsx","TimePicker","name","rules","tabIndex","helperText","required","size","other","control","ref","onChange","field","error","v","newValue","TimePicker_default"],"mappings":"AAAA,OAAS,cAAAA,EAAY,kBAAAC,MAAsB,kBAC3C,OAAS,cAAcC,MAAqB,0BAC5C,OAAOC,MAAW,QAwBV,cAAAC,MAAA,oBApBR,IAAMC,EAAa,CAAC,CAClB,KAAAC,EACA,MAAAC,EACA,SAAAC,EACA,WAAAC,EACA,SAAAC,EACA,KAAAC,EACA,GAAGC,CACL,IAAuB,CACrB,GAAM,CAAE,QAAAC,CAAQ,EAAIZ,EAAe,EAEnC,OACEG,EAACJ,EAAA,CACC,KAAMM,EACN,QAASO,EACT,MAAON,EACP,OAAQ,CAAC,CACP,MAAO,CAAE,IAAAO,EAAK,SAAAC,EAAU,GAAGC,CAAM,EACjC,WAAY,CAAE,MAAAC,CAAM,CACtB,IACEb,EAACF,EAAA,CACC,KAAM,GACN,OAAO,QACP,SAAUY,EACT,GAAGE,EACJ,uBAAsBV,EACrB,GAAGM,EACJ,MAAOI,EAAM,MAAQb,EAAMa,EAAM,KAAK,EAAI,KAC1C,SAAUE,GAAK,CACb,IAAMC,EAAWD,EAAIA,EAAE,OAAO,EAAI,KAClCH,EAASI,CAAQ,EACjBP,EAAM,UAAYA,EAAM,SAASO,CAAQ,CAC3C,EACA,UAAW,CACT,UAAW,CACT,GAAGP,EAAM,WAAW,UACpB,KAAAN,EACA,MAAO,CAAC,CAACW,EACT,SAAAP,EACA,WAAYO,GAAO,SAAWR,EAC9B,aAAc,MACd,WAAY,QACZ,UAAW,GACX,KAAAE,CACF,EACA,iBAAkB,CAChB,SAAAH,CACF,CACF,EACF,EAEJ,CAEJ,EAEOY,EAAQf","sourcesContent":["import { Controller, useFormContext } from 'react-hook-form';\nimport { TimePicker as MuiTimePicker } from '@mui/x-date-pickers-pro';\nimport dayjs from 'dayjs';\n\nimport { TimePickerProps } from 'types/timePickerProps';\n\nconst TimePicker = ({\n name,\n rules,\n tabIndex,\n helperText,\n required,\n size,\n ...other\n}: TimePickerProps) => {\n const { control } = useFormContext();\n\n return (\n <Controller\n name={name}\n control={control}\n rules={rules}\n render={({\n field: { ref, onChange, ...field },\n fieldState: { error },\n }) => (\n <MuiTimePicker\n ampm={false}\n format=\"HH:mm\"\n inputRef={ref}\n {...field}\n data-intercom-target={name}\n {...other}\n value={field.value ? dayjs(field.value) : null}\n onChange={v => {\n const newValue = v ? v.toDate() : null;\n onChange(newValue);\n other.onChange && other.onChange(newValue);\n }}\n slotProps={{\n textField: {\n ...other.slotProps?.textField,\n name,\n error: !!error,\n required,\n helperText: error?.message || helperText,\n autoComplete: 'off',\n spellCheck: 'false',\n fullWidth: true,\n size,\n },\n openPickerButton: {\n tabIndex,\n },\n }}\n />\n )}\n />\n );\n};\n\nexport default TimePicker;\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { StackProps } from '@mui/material/Stack';
|
|
2
2
|
import { BaseField } from './baseField.js';
|
|
3
|
+
import { Size } from './size.js';
|
|
3
4
|
import 'react-hook-form';
|
|
4
5
|
|
|
5
6
|
interface Props {
|
|
@@ -9,6 +10,7 @@ interface Props {
|
|
|
9
10
|
loading?: boolean;
|
|
10
11
|
disableTyping?: boolean;
|
|
11
12
|
onZipCodeChange?: (zipCode: string) => void;
|
|
13
|
+
size?: Size;
|
|
12
14
|
}
|
|
13
15
|
type AddressProps = BaseField<Props>;
|
|
14
16
|
|
|
@@ -2,6 +2,7 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { DatePickerProps as DatePickerProps$1 } from '@mui/x-date-pickers-pro';
|
|
3
3
|
import { Dayjs } from 'dayjs';
|
|
4
4
|
import { BaseField } from './baseField.js';
|
|
5
|
+
import { Size } from './size.js';
|
|
5
6
|
import 'react-hook-form';
|
|
6
7
|
|
|
7
8
|
type DatePickerProps = BaseField<Omit<DatePickerProps$1<Dayjs>, 'value' | 'onChange'>> & {
|
|
@@ -11,7 +12,7 @@ type DatePickerProps = BaseField<Omit<DatePickerProps$1<Dayjs>, 'value' | 'onCha
|
|
|
11
12
|
required?: boolean;
|
|
12
13
|
value?: Date | null | undefined;
|
|
13
14
|
onChange?(value: Date | null | undefined): void;
|
|
14
|
-
size?:
|
|
15
|
+
size?: Size;
|
|
15
16
|
fullWidth?: boolean;
|
|
16
17
|
placeholder?: string;
|
|
17
18
|
};
|
|
@@ -2,6 +2,7 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { DateRangePickerProps as DateRangePickerProps$1 } from '@mui/x-date-pickers-pro';
|
|
3
3
|
import { Dayjs } from 'dayjs';
|
|
4
4
|
import { BaseField } from './baseField.js';
|
|
5
|
+
import { Size } from './size.js';
|
|
5
6
|
import 'react-hook-form';
|
|
6
7
|
|
|
7
8
|
type DateRange = {
|
|
@@ -13,6 +14,7 @@ type DateRangePickerProps = BaseField<Omit<DateRangePickerProps$1<Dayjs>, 'value
|
|
|
13
14
|
onChange?(value?: DateRange): void;
|
|
14
15
|
helperText?: ReactNode;
|
|
15
16
|
required?: boolean;
|
|
17
|
+
size?: Size;
|
|
16
18
|
};
|
|
17
19
|
|
|
18
20
|
export { DateRangePickerProps };
|
|
@@ -2,6 +2,7 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { DateTimePickerProps as DateTimePickerProps$1 } from '@mui/x-date-pickers-pro';
|
|
3
3
|
import { Dayjs } from 'dayjs';
|
|
4
4
|
import { BaseField } from './baseField.js';
|
|
5
|
+
import { Size } from './size.js';
|
|
5
6
|
import 'react-hook-form';
|
|
6
7
|
|
|
7
8
|
type DateTimePickerProps = BaseField<Omit<DateTimePickerProps$1<Dayjs>, 'value' | 'onChange'>> & {
|
|
@@ -10,6 +11,7 @@ type DateTimePickerProps = BaseField<Omit<DateTimePickerProps$1<Dayjs>, 'value'
|
|
|
10
11
|
required?: boolean;
|
|
11
12
|
value?: Date | null | undefined;
|
|
12
13
|
onChange?(value: Date | null | undefined): void;
|
|
14
|
+
size?: Size;
|
|
13
15
|
};
|
|
14
16
|
|
|
15
17
|
export { DateTimePickerProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { FormControlLabelProps } from '@mui/material/FormControlLabel';
|
|
2
2
|
import { SwitchProps as SwitchProps$1 } from '@mui/material/Switch';
|
|
3
3
|
import { BaseField } from './baseField.js';
|
|
4
|
+
import { Size } from './size.js';
|
|
4
5
|
import 'react-hook-form';
|
|
5
6
|
|
|
6
7
|
interface Props extends Omit<FormControlLabelProps, 'control'> {
|
|
7
8
|
helperText?: React.ReactNode;
|
|
8
|
-
size?:
|
|
9
|
+
size?: Size;
|
|
9
10
|
sx?: SwitchProps$1['sx'];
|
|
10
11
|
}
|
|
11
12
|
type SwitchProps = BaseField<Props>;
|
|
@@ -2,6 +2,7 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { TimePickerProps as TimePickerProps$1 } from '@mui/x-date-pickers-pro';
|
|
3
3
|
import { Dayjs } from 'dayjs';
|
|
4
4
|
import { BaseField } from './baseField.js';
|
|
5
|
+
import { Size } from './size.js';
|
|
5
6
|
import 'react-hook-form';
|
|
6
7
|
|
|
7
8
|
type TimePickerProps = BaseField<Omit<TimePickerProps$1<Dayjs>, 'components' | 'value' | 'onChange'>> & {
|
|
@@ -10,6 +11,7 @@ type TimePickerProps = BaseField<Omit<TimePickerProps$1<Dayjs>, 'components' | '
|
|
|
10
11
|
required?: boolean;
|
|
11
12
|
value?: Date | null | undefined;
|
|
12
13
|
onChange?(value: Date | null | undefined): void;
|
|
14
|
+
size?: Size;
|
|
13
15
|
};
|
|
14
16
|
|
|
15
17
|
export { TimePickerProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import '../chunk-4P2L7UJA.js';
|
|
2
1
|
import '../chunk-VL4W63YA.js';
|
|
2
|
+
import '../chunk-4P2L7UJA.js';
|
|
3
3
|
|
|
4
4
|
var u=(t,e)=>{if(!(!t?.fields||!e))return t.fields.find(r=>r.name===e||r.filter_field_name===e)},i=(t,e)=>{if(!e)return;let r=u(t,e);return t?.fields?r?.filter_field_name||r?.name:e},f=(t,e)=>{if(!(!t?.fields||!e||e.length===0))return e.filter(r=>r!=="ACTIONS")},l=(t,e)=>{let r=e?.trim();if(!r)return;let n=i(t,t?.description_field_name)||i(t,"name");if(n)return {operator:"AND",groups:[{operator:"AND",conditionals:[{fieldName:n,conditional:"LIKE",value:[r]}]}]}},p=(t,e,r)=>{if(!e||!r)return;let n=i(t,e);if(n)return {fieldName:n,sortType:r==="desc"?"DESC":"ASC"}},c=({metadata:t,visibleFieldNames:e,search:r,sort:n,dir:s})=>{let o=f(t,e),d=l(t,r),a=p(t,n,s);return {...o&&{criteria:o},...d&&{filter:d},...a&&{sort:a}}},y=c;
|
|
5
5
|
|