@campxdev/shared 1.5.5 → 1.5.7
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/package.json
CHANGED
|
@@ -16,6 +16,7 @@ export interface IDatePicker {
|
|
|
16
16
|
onChange: (value: Date) => void
|
|
17
17
|
placeholder?: string
|
|
18
18
|
inputProps?: TextFieldProps
|
|
19
|
+
size?: 'medium' | 'small'
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
export default function FormDatePicker({
|
|
@@ -26,6 +27,7 @@ export default function FormDatePicker({
|
|
|
26
27
|
value,
|
|
27
28
|
onChange,
|
|
28
29
|
placeholder,
|
|
30
|
+
size = 'medium',
|
|
29
31
|
required = false,
|
|
30
32
|
...rest
|
|
31
33
|
}: IDatePicker) {
|
|
@@ -38,6 +40,7 @@ export default function FormDatePicker({
|
|
|
38
40
|
dateFormat: 'd-m-Y',
|
|
39
41
|
minDate,
|
|
40
42
|
maxDate,
|
|
43
|
+
allowInput: true,
|
|
41
44
|
}}
|
|
42
45
|
value={value || null}
|
|
43
46
|
render={(
|
|
@@ -46,6 +49,7 @@ export default function FormDatePicker({
|
|
|
46
49
|
) => {
|
|
47
50
|
return (
|
|
48
51
|
<TextField
|
|
52
|
+
size={size}
|
|
49
53
|
placeholder={placeholder}
|
|
50
54
|
label={label}
|
|
51
55
|
name={name}
|
|
@@ -18,6 +18,7 @@ export interface IDateTimePicker {
|
|
|
18
18
|
placeholder?: string
|
|
19
19
|
inputProps?: TextFieldProps
|
|
20
20
|
enableTime?: boolean
|
|
21
|
+
size?: 'medium' | 'small'
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
export default function DateTimePicker({
|
|
@@ -32,6 +33,7 @@ export default function DateTimePicker({
|
|
|
32
33
|
value,
|
|
33
34
|
placeholder,
|
|
34
35
|
enableTime = true,
|
|
36
|
+
size = 'medium',
|
|
35
37
|
...rest
|
|
36
38
|
}: IDateTimePicker) {
|
|
37
39
|
return (
|
|
@@ -43,6 +45,7 @@ export default function DateTimePicker({
|
|
|
43
45
|
maxDate,
|
|
44
46
|
minTime,
|
|
45
47
|
maxTime,
|
|
48
|
+
allowInput: true,
|
|
46
49
|
}}
|
|
47
50
|
onChange={(dates: Date[]) => {
|
|
48
51
|
if (onChange) onChange(dates[0])
|
|
@@ -54,6 +57,7 @@ export default function DateTimePicker({
|
|
|
54
57
|
) => {
|
|
55
58
|
return (
|
|
56
59
|
<TextField
|
|
60
|
+
size={size}
|
|
57
61
|
placeholder={placeholder}
|
|
58
62
|
label={label}
|
|
59
63
|
name={name}
|
|
@@ -15,6 +15,7 @@ export interface ITimePicker {
|
|
|
15
15
|
onChange: (value: Date) => void
|
|
16
16
|
placeholder?: string
|
|
17
17
|
inputProps?: TextFieldProps
|
|
18
|
+
size?: 'medium' | 'small'
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
export default function TimePicker({
|
|
@@ -26,6 +27,7 @@ export default function TimePicker({
|
|
|
26
27
|
onChange,
|
|
27
28
|
value,
|
|
28
29
|
placeholder,
|
|
30
|
+
size = 'medium',
|
|
29
31
|
...rest
|
|
30
32
|
}: ITimePicker) {
|
|
31
33
|
return (
|
|
@@ -36,6 +38,7 @@ export default function TimePicker({
|
|
|
36
38
|
dateFormat: 'h:i K',
|
|
37
39
|
minTime,
|
|
38
40
|
maxTime,
|
|
41
|
+
allowInput: true,
|
|
39
42
|
}}
|
|
40
43
|
onChange={(dates: Date[]) => {
|
|
41
44
|
if (onChange) onChange(dates[0])
|
|
@@ -47,6 +50,7 @@ export default function TimePicker({
|
|
|
47
50
|
) => {
|
|
48
51
|
return (
|
|
49
52
|
<TextField
|
|
53
|
+
size={size}
|
|
50
54
|
placeholder={placeholder}
|
|
51
55
|
label={label}
|
|
52
56
|
name={name}
|
|
@@ -1,26 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Box,
|
|
3
|
-
Button,
|
|
4
|
-
Dialog,
|
|
5
|
-
DialogActions,
|
|
6
|
-
DialogContent,
|
|
7
|
-
DialogTitle,
|
|
8
|
-
styled,
|
|
9
|
-
Typography,
|
|
10
|
-
} from '@mui/material'
|
|
1
|
+
import { Box, Button, Dialog, styled, Typography } from '@mui/material'
|
|
11
2
|
import useConfirm from './useConfirm'
|
|
12
3
|
const animatedImage = require('./animation.gif')
|
|
4
|
+
|
|
13
5
|
const StyledImage = styled((props: any) => (
|
|
14
6
|
<Box>
|
|
15
7
|
<img {...props} />
|
|
16
8
|
</Box>
|
|
17
9
|
))(({ theme }) => ({
|
|
18
10
|
width: '154px',
|
|
19
|
-
height: '172px',
|
|
20
|
-
display: 'flex',
|
|
21
|
-
alignItems: 'center',
|
|
22
|
-
justifyContent: 'center',
|
|
23
|
-
|
|
24
11
|
'> img': {
|
|
25
12
|
width: '100%',
|
|
26
13
|
height: '100%',
|
|
@@ -37,17 +24,20 @@ const StyledDialogContent = styled(Box)(({ theme }) => ({
|
|
|
37
24
|
flexDirection: 'column',
|
|
38
25
|
}))
|
|
39
26
|
|
|
40
|
-
const StyledCancel = styled(Button)(() => ({
|
|
41
|
-
color: 'rgba(18, 18, 18, 0.5)',
|
|
42
|
-
border: '0.5px solid #12121280',
|
|
43
|
-
height: '40px',
|
|
44
|
-
}))
|
|
45
|
-
|
|
46
27
|
const PopupConfirm = () => {
|
|
47
28
|
const { prompt = '', isOpen = false, proceed, cancel } = useConfirm()
|
|
48
29
|
return (
|
|
49
30
|
<Dialog
|
|
50
|
-
|
|
31
|
+
PaperProps={{
|
|
32
|
+
elevation: 2,
|
|
33
|
+
sx: {
|
|
34
|
+
borderRadius: '10px',
|
|
35
|
+
},
|
|
36
|
+
}}
|
|
37
|
+
sx={{
|
|
38
|
+
'& .MuiBackdrop-root': { backgroundColor: 'rgba(0, 0, 0, 0.4)' },
|
|
39
|
+
zIndex: 1600,
|
|
40
|
+
}}
|
|
51
41
|
keepMounted
|
|
52
42
|
maxWidth="sm"
|
|
53
43
|
fullWidth
|
|
@@ -56,21 +46,18 @@ const PopupConfirm = () => {
|
|
|
56
46
|
>
|
|
57
47
|
<StyledDialogContent>
|
|
58
48
|
<Box sx={{ marginBottom: '20px' }}>
|
|
59
|
-
{' '}
|
|
60
49
|
<StyledImage src={animatedImage} alt="Upload Image" />
|
|
61
50
|
</Box>
|
|
62
51
|
|
|
63
|
-
<Typography
|
|
64
|
-
sx={{ fontSize: '16px', fontFamily: 'Poppins', fontWeight: '500' }}
|
|
65
|
-
>
|
|
52
|
+
<Typography variant="h6" sx={{ minHeight: '30px' }}>
|
|
66
53
|
{prompt}
|
|
67
54
|
</Typography>
|
|
68
55
|
<Box sx={{ display: 'flex', gap: '20px', marginTop: '30px' }}>
|
|
69
|
-
<
|
|
56
|
+
<Button color="secondary" variant="outlined" onClick={cancel}>
|
|
70
57
|
No, Cancel
|
|
71
|
-
</
|
|
58
|
+
</Button>
|
|
72
59
|
<Button variant="outlined" onClick={proceed} sx={{ height: '40px' }}>
|
|
73
|
-
Yes, I
|
|
60
|
+
Yes, I'm. Sure
|
|
74
61
|
</Button>
|
|
75
62
|
</Box>
|
|
76
63
|
</StyledDialogContent>
|