@eventlook/sdk 1.5.0-beta.4 → 1.5.0-beta.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/.claude/settings.local.json +3 -1
- package/dist/cjs/{index-DLC5Hr8L.js → index-DvUR1fp8.js} +3 -3
- package/dist/cjs/index-DvUR1fp8.js.map +1 -0
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/{index.umd-BSCKGDNQ.js → index.umd-6SU6nkkJ.js} +2 -2
- package/dist/cjs/{index.umd-BSCKGDNQ.js.map → index.umd-6SU6nkkJ.js.map} +1 -1
- package/dist/esm/{index-BwmbJihM.js → index-BlTqx0jm.js} +3 -3
- package/dist/esm/index-BlTqx0jm.js.map +1 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/{index.umd-6fgyuQlr.js → index.umd-Dn0hjh7E.js} +2 -2
- package/dist/esm/{index.umd-6fgyuQlr.js.map → index.umd-Dn0hjh7E.js.map} +1 -1
- package/dist/types/components/animate/MotionContainer.d.ts +1 -1
- package/dist/types/components/animate/MotionViewport.d.ts +1 -1
- package/dist/types/components/animate/TextAnimate.d.ts +1 -1
- 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 +3 -4
- package/src/components/animate/DialogAnimate.tsx +1 -1
- package/src/components/animate/IconButtonAnimate.tsx +1 -1
- package/src/components/animate/MotionContainer.tsx +1 -1
- package/src/components/animate/MotionLazyContainer.tsx +1 -1
- package/src/components/animate/MotionViewport.tsx +1 -1
- package/src/components/animate/TextAnimate.tsx +1 -1
- package/src/components/animate/features.js +1 -1
- package/src/components/animate/variants/index.ts +0 -8
- package/src/components/hook-form/index.ts +0 -4
- package/src/form/OrderSuccess.tsx +1 -1
- package/src/form/PaymentPending.tsx +1 -1
- package/src/form/PaymentSuccess.tsx +1 -1
- package/dist/cjs/index-DLC5Hr8L.js.map +0 -1
- package/dist/esm/index-BwmbJihM.js.map +0 -1
- 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,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FormControlLabelProps } from '@mui/material';
|
|
3
|
-
interface Props extends Omit<FormControlLabelProps, 'control'> {
|
|
4
|
-
name: string;
|
|
5
|
-
helperText?: React.ReactNode;
|
|
6
|
-
}
|
|
7
|
-
export default function RHFSwitch({ name, helperText, ...other }: Props): React.JSX.Element;
|
|
8
|
-
export {};
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
// @types
|
|
2
|
-
import { BackgroundType } from '@utils/types/animate';
|
|
3
|
-
|
|
4
|
-
// ----------------------------------------------------------------------
|
|
5
|
-
|
|
6
|
-
export const varBgColor = (props?: BackgroundType) => {
|
|
7
|
-
const colors = props?.colors || ['#19dcea', '#b22cff'];
|
|
8
|
-
const duration = props?.duration || 5;
|
|
9
|
-
const ease = props?.ease || 'linear';
|
|
10
|
-
|
|
11
|
-
return {
|
|
12
|
-
animate: {
|
|
13
|
-
background: colors,
|
|
14
|
-
transition: { duration, ease },
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
// ----------------------------------------------------------------------
|
|
20
|
-
|
|
21
|
-
export const varBgKenburns = (props?: BackgroundType) => {
|
|
22
|
-
const duration = props?.duration || 5;
|
|
23
|
-
const ease = props?.ease || 'easeOut';
|
|
24
|
-
|
|
25
|
-
return {
|
|
26
|
-
top: {
|
|
27
|
-
animate: {
|
|
28
|
-
scale: [1, 1.25],
|
|
29
|
-
y: [0, -15],
|
|
30
|
-
transformOrigin: ['50% 16%', 'top'],
|
|
31
|
-
transition: { duration, ease },
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
right: {
|
|
35
|
-
animate: {
|
|
36
|
-
scale: [1, 1.25],
|
|
37
|
-
x: [0, 20],
|
|
38
|
-
y: [0, -15],
|
|
39
|
-
transformOrigin: ['84% 50%', 'right'],
|
|
40
|
-
transition: { duration, ease },
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
bottom: {
|
|
44
|
-
animate: {
|
|
45
|
-
scale: [1, 1.25],
|
|
46
|
-
y: [0, 15],
|
|
47
|
-
transformOrigin: ['50% 84%', 'bottom'],
|
|
48
|
-
transition: { duration, ease },
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
left: {
|
|
52
|
-
animate: {
|
|
53
|
-
scale: [1, 1.25],
|
|
54
|
-
x: [0, -20],
|
|
55
|
-
y: [0, 15],
|
|
56
|
-
transformOrigin: ['16% 50%', 'left'],
|
|
57
|
-
transition: { duration, ease },
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
// ----------------------------------------------------------------------
|
|
64
|
-
|
|
65
|
-
export const varBgPan = (props?: BackgroundType) => {
|
|
66
|
-
const colors = props?.colors || ['#ee7752', '#e73c7e', '#23a6d5', '#23d5ab'];
|
|
67
|
-
const duration = props?.duration || 5;
|
|
68
|
-
const ease = props?.ease || 'linear';
|
|
69
|
-
|
|
70
|
-
const gradient = (deg: number) => `linear-gradient(${deg}deg, ${colors})`;
|
|
71
|
-
|
|
72
|
-
return {
|
|
73
|
-
top: {
|
|
74
|
-
animate: {
|
|
75
|
-
backgroundImage: [gradient(0), gradient(0)],
|
|
76
|
-
backgroundPosition: ['center 99%', 'center 1%'],
|
|
77
|
-
backgroundSize: ['100% 600%', '100% 600%'],
|
|
78
|
-
transition: { duration, ease },
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
right: {
|
|
82
|
-
animate: {
|
|
83
|
-
backgroundPosition: ['1% center', '99% center'],
|
|
84
|
-
backgroundImage: [gradient(270), gradient(270)],
|
|
85
|
-
backgroundSize: ['600% 100%', '600% 100%'],
|
|
86
|
-
transition: { duration, ease },
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
bottom: {
|
|
90
|
-
animate: {
|
|
91
|
-
backgroundImage: [gradient(0), gradient(0)],
|
|
92
|
-
backgroundPosition: ['center 1%', 'center 99%'],
|
|
93
|
-
backgroundSize: ['100% 600%', '100% 600%'],
|
|
94
|
-
transition: { duration, ease },
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
left: {
|
|
98
|
-
animate: {
|
|
99
|
-
backgroundPosition: ['99% center', '1% center'],
|
|
100
|
-
backgroundImage: [gradient(270), gradient(270)],
|
|
101
|
-
backgroundSize: ['600% 100%', '600% 100%'],
|
|
102
|
-
transition: { duration, ease },
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
};
|
|
106
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// @types
|
|
2
|
-
import { VariantsType } from '@utils/types/animate';
|
|
3
|
-
//
|
|
4
|
-
import { varTranEnter, varTranExit } from './transition';
|
|
5
|
-
|
|
6
|
-
// ----------------------------------------------------------------------
|
|
7
|
-
|
|
8
|
-
export const varFlip = (props?: VariantsType) => {
|
|
9
|
-
const durationIn = props?.durationIn;
|
|
10
|
-
const durationOut = props?.durationOut;
|
|
11
|
-
const easeIn = props?.easeIn;
|
|
12
|
-
const easeOut = props?.easeOut;
|
|
13
|
-
|
|
14
|
-
return {
|
|
15
|
-
// IN
|
|
16
|
-
inX: {
|
|
17
|
-
initial: { rotateX: -180, opacity: 0 },
|
|
18
|
-
animate: { rotateX: 0, opacity: 1, transition: varTranEnter({ durationIn, easeIn }) },
|
|
19
|
-
exit: { rotateX: -180, opacity: 0, transition: varTranExit({ durationOut, easeOut }) },
|
|
20
|
-
},
|
|
21
|
-
inY: {
|
|
22
|
-
initial: { rotateY: -180, opacity: 0 },
|
|
23
|
-
animate: { rotateY: 0, opacity: 1, transition: varTranEnter({ durationIn, easeIn }) },
|
|
24
|
-
exit: { rotateY: -180, opacity: 0, transition: varTranExit({ durationOut, easeOut }) },
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
// OUT
|
|
28
|
-
outX: {
|
|
29
|
-
initial: { rotateX: 0, opacity: 1 },
|
|
30
|
-
animate: { rotateX: 70, opacity: 0, transition: varTranExit({ durationOut, easeOut }) },
|
|
31
|
-
},
|
|
32
|
-
outY: {
|
|
33
|
-
initial: { rotateY: 0, opacity: 1 },
|
|
34
|
-
animate: { rotateY: 70, opacity: 0, transition: varTranExit({ durationOut, easeOut }) },
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// ----------------------------------------------------------------------
|
|
2
|
-
|
|
3
|
-
export const TRANSITION = {
|
|
4
|
-
duration: 2,
|
|
5
|
-
ease: [0.43, 0.13, 0.23, 0.96],
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export const varPath = {
|
|
9
|
-
animate: {
|
|
10
|
-
fillOpacity: [0, 0, 1],
|
|
11
|
-
pathLength: [1, 0.4, 0],
|
|
12
|
-
transition: TRANSITION,
|
|
13
|
-
},
|
|
14
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// @types
|
|
2
|
-
import { VariantsType } from '@utils/types/animate';
|
|
3
|
-
//
|
|
4
|
-
import { varTranEnter, varTranExit } from './transition';
|
|
5
|
-
|
|
6
|
-
// ----------------------------------------------------------------------
|
|
7
|
-
|
|
8
|
-
export const varRotate = (props?: VariantsType) => {
|
|
9
|
-
const durationIn = props?.durationIn;
|
|
10
|
-
const durationOut = props?.durationOut;
|
|
11
|
-
const easeIn = props?.easeIn;
|
|
12
|
-
const easeOut = props?.easeOut;
|
|
13
|
-
|
|
14
|
-
return {
|
|
15
|
-
// IN
|
|
16
|
-
in: {
|
|
17
|
-
initial: { opacity: 0, rotate: -360 },
|
|
18
|
-
animate: { opacity: 1, rotate: 0, transition: varTranEnter({ durationIn, easeIn }) },
|
|
19
|
-
exit: { opacity: 0, rotate: -360, transition: varTranExit({ durationOut, easeOut }) },
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
// OUT
|
|
23
|
-
out: {
|
|
24
|
-
initial: { opacity: 1, rotate: 0 },
|
|
25
|
-
animate: { opacity: 0, rotate: -360, transition: varTranExit({ durationOut, easeOut }) },
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// @types
|
|
2
|
-
import { VariantsType } from '@utils/types/animate';
|
|
3
|
-
//
|
|
4
|
-
import { varTranEnter, varTranExit } from './transition';
|
|
5
|
-
|
|
6
|
-
// ----------------------------------------------------------------------
|
|
7
|
-
|
|
8
|
-
export const varScale = (props?: VariantsType) => {
|
|
9
|
-
const durationIn = props?.durationIn;
|
|
10
|
-
const durationOut = props?.durationOut;
|
|
11
|
-
const easeIn = props?.easeIn;
|
|
12
|
-
const easeOut = props?.easeOut;
|
|
13
|
-
|
|
14
|
-
return {
|
|
15
|
-
// IN
|
|
16
|
-
inX: {
|
|
17
|
-
initial: { scaleX: 0, opacity: 0 },
|
|
18
|
-
animate: { scaleX: 1, opacity: 1, transition: varTranEnter({ durationIn, easeIn }) },
|
|
19
|
-
exit: { scaleX: 0, opacity: 0, transition: varTranExit({ durationOut, easeOut }) },
|
|
20
|
-
},
|
|
21
|
-
inY: {
|
|
22
|
-
initial: { scaleY: 0, opacity: 0 },
|
|
23
|
-
animate: { scaleY: 1, opacity: 1, transition: varTranEnter({ durationIn, easeIn }) },
|
|
24
|
-
exit: { scaleY: 0, opacity: 0, transition: varTranExit({ durationOut, easeOut }) },
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
// OUT
|
|
28
|
-
outX: {
|
|
29
|
-
initial: { scaleX: 1, opacity: 1 },
|
|
30
|
-
animate: { scaleX: 0, opacity: 0, transition: varTranEnter({ durationIn, easeIn }) },
|
|
31
|
-
},
|
|
32
|
-
outY: {
|
|
33
|
-
initial: { scaleY: 1, opacity: 1 },
|
|
34
|
-
animate: { scaleY: 0, opacity: 0, transition: varTranEnter({ durationIn, easeIn }) },
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
// @types
|
|
2
|
-
import { VariantsType } from '@utils/types/animate';
|
|
3
|
-
//
|
|
4
|
-
import { varTranEnter, varTranExit } from './transition';
|
|
5
|
-
|
|
6
|
-
// ----------------------------------------------------------------------
|
|
7
|
-
|
|
8
|
-
export const varSlide = (props?: VariantsType) => {
|
|
9
|
-
const distance = props?.distance || 160;
|
|
10
|
-
const durationIn = props?.durationIn;
|
|
11
|
-
const durationOut = props?.durationOut;
|
|
12
|
-
const easeIn = props?.easeIn;
|
|
13
|
-
const easeOut = props?.easeOut;
|
|
14
|
-
|
|
15
|
-
return {
|
|
16
|
-
// IN
|
|
17
|
-
inUp: {
|
|
18
|
-
initial: { y: distance },
|
|
19
|
-
animate: { y: 0, transition: varTranEnter({ durationIn, easeIn }) },
|
|
20
|
-
exit: { y: distance, transition: varTranExit({ durationOut, easeOut }) },
|
|
21
|
-
},
|
|
22
|
-
inDown: {
|
|
23
|
-
initial: { y: -distance },
|
|
24
|
-
animate: { y: 0, transition: varTranEnter({ durationIn, easeIn }) },
|
|
25
|
-
exit: { y: -distance, transition: varTranExit({ durationOut, easeOut }) },
|
|
26
|
-
},
|
|
27
|
-
inLeft: {
|
|
28
|
-
initial: { x: -distance },
|
|
29
|
-
animate: { x: 0, transition: varTranEnter({ durationIn, easeIn }) },
|
|
30
|
-
exit: { x: -distance, transition: varTranExit({ durationOut, easeOut }) },
|
|
31
|
-
},
|
|
32
|
-
inRight: {
|
|
33
|
-
initial: { x: distance },
|
|
34
|
-
animate: { x: 0, transition: varTranEnter({ durationIn, easeIn }) },
|
|
35
|
-
exit: { x: distance, transition: varTranExit({ durationOut, easeOut }) },
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
// OUT
|
|
39
|
-
outUp: {
|
|
40
|
-
initial: { y: 0 },
|
|
41
|
-
animate: { y: -distance, transition: varTranEnter({ durationIn, easeIn }) },
|
|
42
|
-
exit: { y: 0, transition: varTranExit({ durationOut, easeOut }) },
|
|
43
|
-
},
|
|
44
|
-
outDown: {
|
|
45
|
-
initial: { y: 0 },
|
|
46
|
-
animate: { y: distance, transition: varTranEnter({ durationIn, easeIn }) },
|
|
47
|
-
exit: { y: 0, transition: varTranExit({ durationOut, easeOut }) },
|
|
48
|
-
},
|
|
49
|
-
outLeft: {
|
|
50
|
-
initial: { x: 0 },
|
|
51
|
-
animate: { x: -distance, transition: varTranEnter({ durationIn, easeIn }) },
|
|
52
|
-
exit: { x: 0, transition: varTranExit({ durationOut, easeOut }) },
|
|
53
|
-
},
|
|
54
|
-
outRight: {
|
|
55
|
-
initial: { x: 0 },
|
|
56
|
-
animate: { x: distance, transition: varTranEnter({ durationIn, easeIn }) },
|
|
57
|
-
exit: { x: 0, transition: varTranExit({ durationOut, easeOut }) },
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
};
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
// @types
|
|
2
|
-
import { VariantsType } from '@utils/types/animate';
|
|
3
|
-
//
|
|
4
|
-
import { varTranEnter, varTranExit } from './transition';
|
|
5
|
-
|
|
6
|
-
// ----------------------------------------------------------------------
|
|
7
|
-
|
|
8
|
-
export const varZoom = (props?: VariantsType) => {
|
|
9
|
-
const distance = props?.distance || 720;
|
|
10
|
-
const durationIn = props?.durationIn;
|
|
11
|
-
const durationOut = props?.durationOut;
|
|
12
|
-
const easeIn = props?.easeIn;
|
|
13
|
-
const easeOut = props?.easeOut;
|
|
14
|
-
|
|
15
|
-
return {
|
|
16
|
-
// IN
|
|
17
|
-
in: {
|
|
18
|
-
initial: { scale: 0, opacity: 0 },
|
|
19
|
-
animate: { scale: 1, opacity: 1, transition: varTranEnter({ durationIn, easeIn }) },
|
|
20
|
-
exit: { scale: 0, opacity: 0, transition: varTranExit({ durationOut, easeOut }) },
|
|
21
|
-
},
|
|
22
|
-
inUp: {
|
|
23
|
-
initial: { scale: 0, opacity: 0, translateY: distance },
|
|
24
|
-
animate: {
|
|
25
|
-
scale: 1,
|
|
26
|
-
opacity: 1,
|
|
27
|
-
translateY: 0,
|
|
28
|
-
transition: varTranEnter({ durationIn, easeIn }),
|
|
29
|
-
},
|
|
30
|
-
exit: {
|
|
31
|
-
scale: 0,
|
|
32
|
-
opacity: 0,
|
|
33
|
-
translateY: distance,
|
|
34
|
-
transition: varTranExit({ durationOut, easeOut }),
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
inDown: {
|
|
38
|
-
initial: {
|
|
39
|
-
scale: 0,
|
|
40
|
-
opacity: 0,
|
|
41
|
-
translateY: -distance,
|
|
42
|
-
},
|
|
43
|
-
animate: {
|
|
44
|
-
scale: 1,
|
|
45
|
-
opacity: 1,
|
|
46
|
-
translateY: 0,
|
|
47
|
-
transition: varTranEnter({ durationIn, easeIn }),
|
|
48
|
-
},
|
|
49
|
-
exit: {
|
|
50
|
-
scale: 0,
|
|
51
|
-
opacity: 0,
|
|
52
|
-
translateY: -distance,
|
|
53
|
-
transition: varTranExit({ durationOut, easeOut }),
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
inLeft: {
|
|
57
|
-
initial: { scale: 0, opacity: 0, translateX: -distance },
|
|
58
|
-
animate: {
|
|
59
|
-
scale: 1,
|
|
60
|
-
opacity: 1,
|
|
61
|
-
translateX: 0,
|
|
62
|
-
transition: varTranEnter({ durationIn, easeIn }),
|
|
63
|
-
},
|
|
64
|
-
exit: {
|
|
65
|
-
scale: 0,
|
|
66
|
-
opacity: 0,
|
|
67
|
-
translateX: -distance,
|
|
68
|
-
transition: varTranExit({ durationOut, easeOut }),
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
inRight: {
|
|
72
|
-
initial: { scale: 0, opacity: 0, translateX: distance },
|
|
73
|
-
animate: {
|
|
74
|
-
scale: 1,
|
|
75
|
-
opacity: 1,
|
|
76
|
-
translateX: 0,
|
|
77
|
-
transition: varTranEnter({ durationIn, easeIn }),
|
|
78
|
-
},
|
|
79
|
-
exit: {
|
|
80
|
-
scale: 0,
|
|
81
|
-
opacity: 0,
|
|
82
|
-
translateX: distance,
|
|
83
|
-
transition: varTranExit({ durationOut, easeOut }),
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
// OUT
|
|
88
|
-
out: {
|
|
89
|
-
initial: { scale: 1, opacity: 1 },
|
|
90
|
-
animate: { scale: 0, opacity: 0, transition: varTranEnter({ durationIn, easeIn }) },
|
|
91
|
-
},
|
|
92
|
-
outUp: {
|
|
93
|
-
initial: { scale: 1, opacity: 1 },
|
|
94
|
-
animate: {
|
|
95
|
-
scale: 0,
|
|
96
|
-
opacity: 0,
|
|
97
|
-
translateY: -distance,
|
|
98
|
-
transition: varTranEnter({ durationIn, easeIn }),
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
outDown: {
|
|
102
|
-
initial: { scale: 1, opacity: 1 },
|
|
103
|
-
animate: {
|
|
104
|
-
scale: 0,
|
|
105
|
-
opacity: 0,
|
|
106
|
-
translateY: distance,
|
|
107
|
-
transition: varTranEnter({ durationIn, easeIn }),
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
outLeft: {
|
|
111
|
-
initial: { scale: 1, opacity: 1 },
|
|
112
|
-
animate: {
|
|
113
|
-
scale: 0,
|
|
114
|
-
opacity: 0,
|
|
115
|
-
translateX: -distance,
|
|
116
|
-
transition: varTranEnter({ durationIn, easeIn }),
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
outRight: {
|
|
120
|
-
initial: { scale: 1, opacity: 1 },
|
|
121
|
-
animate: {
|
|
122
|
-
scale: 0,
|
|
123
|
-
opacity: 0,
|
|
124
|
-
translateX: distance,
|
|
125
|
-
transition: varTranEnter({ durationIn, easeIn }),
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
};
|
|
129
|
-
};
|
|
@@ -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
|
-
}
|