@eventlook/sdk 1.5.0-beta.3 → 1.5.0-beta.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.
- package/.claude/settings.local.json +3 -1
- package/dist/cjs/index-DLC5Hr8L.js +35809 -0
- package/dist/cjs/index-DLC5Hr8L.js.map +1 -0
- package/dist/cjs/index.js +11 -49194
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.umd-BSCKGDNQ.js +13407 -0
- package/dist/cjs/index.umd-BSCKGDNQ.js.map +1 -0
- package/dist/esm/index-BwmbJihM.js +35805 -0
- package/dist/esm/index-BwmbJihM.js.map +1 -0
- package/dist/esm/index.js +10 -49197
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.umd-6fgyuQlr.js +13405 -0
- package/dist/esm/index.umd-6fgyuQlr.js.map +1 -0
- package/dist/types/components/animate/variants/index.d.ts +0 -8
- package/dist/types/components/hook-form/index.d.ts +0 -4
- package/package.json +1 -2
- package/src/@types/index.d.ts +0 -2
- package/src/components/animate/variants/index.ts +0 -8
- package/src/components/hook-form/index.ts +0 -4
- package/src/form/PaymentPending.tsx +6 -3
- package/dist/types/components/animate/variants/actions.d.ts +0 -5
- package/dist/types/components/animate/variants/background.d.ts +0 -104
- package/dist/types/components/animate/variants/flip.d.ts +0 -75
- package/dist/types/components/animate/variants/path.d.ts +0 -14
- package/dist/types/components/animate/variants/rotate.d.ts +0 -39
- package/dist/types/components/animate/variants/scale.d.ts +0 -75
- package/dist/types/components/animate/variants/slide.d.ts +0 -155
- package/dist/types/components/animate/variants/zoom.d.ts +0 -199
- package/dist/types/components/hook-form/RHFAutocomplete.d.ts +0 -9
- package/dist/types/components/hook-form/RHFCodes.d.ts +0 -8
- package/dist/types/components/hook-form/RHFSlider.d.ts +0 -8
- package/dist/types/components/hook-form/RHFSwitch.d.ts +0 -8
- package/src/components/animate/variants/actions.ts +0 -7
- package/src/components/animate/variants/background.ts +0 -106
- package/src/components/animate/variants/flip.ts +0 -37
- package/src/components/animate/variants/path.ts +0 -14
- package/src/components/animate/variants/rotate.ts +0 -28
- package/src/components/animate/variants/scale.ts +0 -37
- package/src/components/animate/variants/slide.ts +0 -60
- package/src/components/animate/variants/zoom.ts +0 -129
- package/src/components/hook-form/RHFAutocomplete.tsx +0 -52
- package/src/components/hook-form/RHFCodes.tsx +0 -93
- package/src/components/hook-form/RHFSlider.tsx +0 -30
- package/src/components/hook-form/RHFSwitch.tsx +0 -30
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useFormContext, Controller } from 'react-hook-form';
|
|
3
|
-
import { Autocomplete, AutocompleteProps, TextField } from '@mui/material';
|
|
4
|
-
|
|
5
|
-
// ----------------------------------------------------------------------
|
|
6
|
-
|
|
7
|
-
interface Props<
|
|
8
|
-
T,
|
|
9
|
-
Multiple extends boolean | undefined,
|
|
10
|
-
DisableClearable extends boolean | undefined,
|
|
11
|
-
FreeSolo extends boolean | undefined,
|
|
12
|
-
> extends AutocompleteProps<T, Multiple, DisableClearable, FreeSolo> {
|
|
13
|
-
name: string;
|
|
14
|
-
label?: string;
|
|
15
|
-
helperText?: React.ReactNode;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export default function RHFAutocomplete<
|
|
19
|
-
T,
|
|
20
|
-
Multiple extends boolean | undefined,
|
|
21
|
-
DisableClearable extends boolean | undefined,
|
|
22
|
-
FreeSolo extends boolean | undefined,
|
|
23
|
-
>({
|
|
24
|
-
name,
|
|
25
|
-
label,
|
|
26
|
-
helperText,
|
|
27
|
-
...other
|
|
28
|
-
}: Omit<Props<T, Multiple, DisableClearable, FreeSolo>, 'renderInput'>) {
|
|
29
|
-
const { control, setValue } = useFormContext();
|
|
30
|
-
|
|
31
|
-
return (
|
|
32
|
-
<Controller
|
|
33
|
-
name={name}
|
|
34
|
-
control={control}
|
|
35
|
-
render={({ field, fieldState: { error } }) => (
|
|
36
|
-
<Autocomplete
|
|
37
|
-
{...field}
|
|
38
|
-
onChange={(event, newValue) => setValue(name, newValue, { shouldValidate: true })}
|
|
39
|
-
renderInput={(params) => (
|
|
40
|
-
<TextField
|
|
41
|
-
label={label}
|
|
42
|
-
error={!!error}
|
|
43
|
-
helperText={error ? error?.message : helperText}
|
|
44
|
-
{...params}
|
|
45
|
-
/>
|
|
46
|
-
)}
|
|
47
|
-
{...other}
|
|
48
|
-
/>
|
|
49
|
-
)}
|
|
50
|
-
/>
|
|
51
|
-
);
|
|
52
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import React, { RefObject, useRef } from 'react';
|
|
2
|
-
// form
|
|
3
|
-
import { useFormContext, Controller } from 'react-hook-form';
|
|
4
|
-
// @mui
|
|
5
|
-
import { Stack, TextField, TextFieldProps } from '@mui/material';
|
|
6
|
-
// hooks
|
|
7
|
-
import useEventListener from '@hooks/useEventListener';
|
|
8
|
-
|
|
9
|
-
// ----------------------------------------------------------------------
|
|
10
|
-
|
|
11
|
-
type Props = TextFieldProps & {
|
|
12
|
-
keyName: string;
|
|
13
|
-
inputs: string[];
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default function RHFCodes({ keyName = '', inputs = [], ...other }: Props) {
|
|
17
|
-
const codesRef = useRef<HTMLDivElement | null>(null);
|
|
18
|
-
|
|
19
|
-
const { control, setValue } = useFormContext();
|
|
20
|
-
|
|
21
|
-
const handlePaste = (event: any) => {
|
|
22
|
-
let data = event.clipboardData.getData('text');
|
|
23
|
-
|
|
24
|
-
data = data.split('');
|
|
25
|
-
|
|
26
|
-
inputs.map((input, index) => setValue(input, data[index]));
|
|
27
|
-
|
|
28
|
-
event.preventDefault();
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const handleChangeWithNextField = (
|
|
32
|
-
event: React.ChangeEvent<HTMLInputElement>,
|
|
33
|
-
handleChange: (event: React.ChangeEvent<HTMLInputElement>) => void
|
|
34
|
-
) => {
|
|
35
|
-
const { maxLength, value, name } = event.target;
|
|
36
|
-
|
|
37
|
-
const fieldIndex = name.replace(keyName, '');
|
|
38
|
-
|
|
39
|
-
const fieldIntIndex = Number(fieldIndex);
|
|
40
|
-
|
|
41
|
-
const nextfield: HTMLElement | null = document.querySelector(
|
|
42
|
-
`input[name=${keyName}${fieldIntIndex + 1}]`
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
if (value.length > maxLength) {
|
|
46
|
-
event.target.value = value[0];
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (value.length >= maxLength && fieldIntIndex < 6 && nextfield !== null) {
|
|
50
|
-
(nextfield as HTMLElement).focus();
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
handleChange(event);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
useEventListener('paste', handlePaste, codesRef as RefObject<HTMLElement>);
|
|
57
|
-
|
|
58
|
-
return (
|
|
59
|
-
<Stack direction="row" spacing={2} justifyContent="center" ref={codesRef}>
|
|
60
|
-
{inputs.map((name, index) => (
|
|
61
|
-
<Controller
|
|
62
|
-
key={name}
|
|
63
|
-
name={`${keyName}${index + 1}`}
|
|
64
|
-
control={control}
|
|
65
|
-
render={({ field, fieldState: { error } }) => (
|
|
66
|
-
<TextField
|
|
67
|
-
{...field}
|
|
68
|
-
error={!!error}
|
|
69
|
-
autoFocus={index === 0}
|
|
70
|
-
placeholder="-"
|
|
71
|
-
onChange={(event: React.ChangeEvent<HTMLInputElement>) => {
|
|
72
|
-
handleChangeWithNextField(event, field.onChange);
|
|
73
|
-
}}
|
|
74
|
-
onFocus={(event) => event.currentTarget.select()}
|
|
75
|
-
InputProps={{
|
|
76
|
-
sx: {
|
|
77
|
-
width: { xs: 36, sm: 56 },
|
|
78
|
-
height: { xs: 36, sm: 56 },
|
|
79
|
-
'& input': { p: 0, textAlign: 'center' },
|
|
80
|
-
},
|
|
81
|
-
}}
|
|
82
|
-
inputProps={{
|
|
83
|
-
maxLength: 1,
|
|
84
|
-
type: 'number',
|
|
85
|
-
}}
|
|
86
|
-
{...other}
|
|
87
|
-
/>
|
|
88
|
-
)}
|
|
89
|
-
/>
|
|
90
|
-
))}
|
|
91
|
-
</Stack>
|
|
92
|
-
);
|
|
93
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useFormContext, Controller } from 'react-hook-form';
|
|
3
|
-
import { Slider, SliderProps, FormHelperText } from '@mui/material';
|
|
4
|
-
|
|
5
|
-
// ----------------------------------------------------------------------
|
|
6
|
-
|
|
7
|
-
type Props = SliderProps & {
|
|
8
|
-
name: string;
|
|
9
|
-
helperText?: React.ReactNode;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export default function RHFSlider({ name, helperText, ...other }: Props) {
|
|
13
|
-
const { control } = useFormContext();
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<Controller
|
|
17
|
-
name={name}
|
|
18
|
-
control={control}
|
|
19
|
-
render={({ field, fieldState: { error } }) => (
|
|
20
|
-
<div>
|
|
21
|
-
<Slider {...field} valueLabelDisplay="auto" {...other} />
|
|
22
|
-
|
|
23
|
-
{(!!error || helperText) && (
|
|
24
|
-
<FormHelperText error={!!error}>{error ? error?.message : helperText}</FormHelperText>
|
|
25
|
-
)}
|
|
26
|
-
</div>
|
|
27
|
-
)}
|
|
28
|
-
/>
|
|
29
|
-
);
|
|
30
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useFormContext, Controller } from 'react-hook-form';
|
|
3
|
-
import { Switch, FormControlLabel, FormControlLabelProps, FormHelperText } from '@mui/material';
|
|
4
|
-
|
|
5
|
-
// ----------------------------------------------------------------------
|
|
6
|
-
|
|
7
|
-
interface Props extends Omit<FormControlLabelProps, 'control'> {
|
|
8
|
-
name: string;
|
|
9
|
-
helperText?: React.ReactNode;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export default function RHFSwitch({ name, helperText, ...other }: Props) {
|
|
13
|
-
const { control } = useFormContext();
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<Controller
|
|
17
|
-
name={name}
|
|
18
|
-
control={control}
|
|
19
|
-
render={({ field, fieldState: { error } }) => (
|
|
20
|
-
<div>
|
|
21
|
-
<FormControlLabel control={<Switch {...field} checked={field.value} />} {...other} />
|
|
22
|
-
|
|
23
|
-
{(!!error || helperText) && (
|
|
24
|
-
<FormHelperText error={!!error}>{error ? error?.message : helperText}</FormHelperText>
|
|
25
|
-
)}
|
|
26
|
-
</div>
|
|
27
|
-
)}
|
|
28
|
-
/>
|
|
29
|
-
);
|
|
30
|
-
}
|