@movalib/movalib-commons 1.59.13 → 1.59.15
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/.env.development +2 -0
- package/devIndex.tsx +1 -1
- package/dist/devIndex.js +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.js +14 -4
- package/dist/src/components/LinkedDocumentDialog.d.ts +11 -0
- package/dist/src/components/LinkedDocumentDialog.js +55 -0
- package/dist/src/{VehicleFullCard.d.ts → components/vehicle/VehicleFullCard.d.ts} +5 -2
- package/dist/src/{VehicleFullCard.js → components/vehicle/VehicleFullCard.js} +44 -22
- package/dist/src/components/vehicle/VehiclePlateField.d.ts +8 -0
- package/dist/src/components/vehicle/VehiclePlateField.js +122 -0
- package/dist/src/helpers/CookieUtils.js +2 -1
- package/dist/src/helpers/Enums.d.ts +10 -1
- package/dist/src/helpers/Enums.js +10 -1
- package/dist/src/helpers/Tools.d.ts +1 -0
- package/dist/src/helpers/Tools.js +10 -1
- package/dist/src/models/Garage.d.ts +2 -0
- package/dist/src/services/AuthenticationService.js +2 -0
- package/dist/src/services/GarageService.d.ts +8 -4
- package/dist/src/services/GarageService.js +75 -45
- package/dist/src/services/UserConnected.d.ts +9 -0
- package/dist/src/services/UserConnected.js +59 -0
- package/dist/src/services/UserService.d.ts +1 -1
- package/dist/src/services/VehicleService.d.ts +3 -0
- package/dist/src/services/VehicleService.js +22 -0
- package/dist/src/style/styled.d.ts +17 -0
- package/dist/src/style/styled.js +68 -0
- package/dist/src/style/styled.ts +70 -0
- package/index.ts +8 -3
- package/package.json +3 -2
- package/src/VehiclePlateField.tsx +1 -0
- package/src/components/LinkedDocumentDialog.tsx +200 -0
- package/src/components/vehicle/VehicleFullCard.tsx +549 -0
- package/src/components/vehicle/VehiclePlateField.tsx +164 -0
- package/src/helpers/CookieUtils.ts +2 -1
- package/src/helpers/Enums.ts +12 -1
- package/src/helpers/Tools.ts +5 -0
- package/src/models/Event.ts +1 -1
- package/src/models/Garage.ts +2 -0
- package/src/services/AuthenticationService.ts +2 -1
- package/src/services/GarageService.ts +557 -390
- package/src/services/UserConnected.ts +56 -0
- package/src/services/UserService.ts +1 -1
- package/src/services/VehicleService.ts +25 -0
- package/src/style/styled.ts +70 -0
- package/src/VehicleFullCard.tsx +0 -503
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ToggleButtonProps } from "@mui/material";
|
|
3
|
+
interface StyledToggleButtonProps extends ToggleButtonProps {
|
|
4
|
+
customSelectedBackgroundColor?: string;
|
|
5
|
+
customBackgroundColor?: string;
|
|
6
|
+
customHoverColor?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const StyledToggleButton: import("@emotion/styled").StyledComponent<import("@mui/material").ToggleButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
9
|
+
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
10
|
+
}, "color" | "children" | "sx" | "classes" | "className" | "style" | "tabIndex" | "onChange" | "onClick" | "fullWidth" | "size" | "disabled" | "value" | "action" | "selected" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & StyledToggleButtonProps, {}, {}>;
|
|
11
|
+
/**
|
|
12
|
+
* Personnalisation du style des Toogle Buttons
|
|
13
|
+
* Note : il n'est posssible de le personnaliser directement au niveau
|
|
14
|
+
* de l'objet "components" du theme.
|
|
15
|
+
*/
|
|
16
|
+
export declare const StyledToggleButtonGroup: import("@emotion/styled").StyledComponent<import("@mui/material").ToggleButtonGroupProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StyledToggleButtonGroup = exports.StyledToggleButton = void 0;
|
|
4
|
+
var material_1 = require("@mui/material");
|
|
5
|
+
exports.StyledToggleButton = (0, material_1.styled)(material_1.ToggleButton)(function (_a) {
|
|
6
|
+
var theme = _a.theme, customSelectedBackgroundColor = _a.customSelectedBackgroundColor, customBackgroundColor = _a.customBackgroundColor, customHoverColor = _a.customHoverColor;
|
|
7
|
+
return ({
|
|
8
|
+
padding: theme.spacing(1),
|
|
9
|
+
marginBottom: theme.spacing(2),
|
|
10
|
+
borderRadius: theme.shape.borderRadius,
|
|
11
|
+
'&:hover': {
|
|
12
|
+
backgroundColor: customHoverColor || theme.palette.warning.dark,
|
|
13
|
+
},
|
|
14
|
+
'&.Mui-selected': {
|
|
15
|
+
backgroundColor: customSelectedBackgroundColor || theme.palette.warning.main,
|
|
16
|
+
},
|
|
17
|
+
'&.Mui-selected:hover': {
|
|
18
|
+
backgroundColor: customHoverColor || theme.palette.warning.dark,
|
|
19
|
+
},
|
|
20
|
+
'&:not(:first-of-type)': {
|
|
21
|
+
borderRadius: theme.shape.borderRadius,
|
|
22
|
+
border: '1px solid rgba(0, 0, 0, 0.12)',
|
|
23
|
+
},
|
|
24
|
+
'&:first-of-type': {
|
|
25
|
+
borderRadius: theme.shape.borderRadius,
|
|
26
|
+
},
|
|
27
|
+
'&.Mui-disabled': {
|
|
28
|
+
border: 0,
|
|
29
|
+
backgroundColor: theme.palette.grey[100],
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* Personnalisation du style des Toogle Buttons
|
|
35
|
+
* Note : il n'est posssible de le personnaliser directement au niveau
|
|
36
|
+
* de l'objet "components" du theme.
|
|
37
|
+
*/
|
|
38
|
+
exports.StyledToggleButtonGroup = (0, material_1.styled)(material_1.ToggleButtonGroup)(function (_a) {
|
|
39
|
+
var theme = _a.theme;
|
|
40
|
+
return ({
|
|
41
|
+
'& .MuiToggleButtonGroup-grouped': {
|
|
42
|
+
padding: theme.spacing(1),
|
|
43
|
+
marginBottom: theme.spacing(2),
|
|
44
|
+
marginLeft: theme.spacing(1),
|
|
45
|
+
marginRight: theme.spacing(1),
|
|
46
|
+
'&.Mui-disabled': {
|
|
47
|
+
border: 0,
|
|
48
|
+
backgroundColor: theme.palette.grey[100],
|
|
49
|
+
},
|
|
50
|
+
'&.Mui-selected': {
|
|
51
|
+
backgroundColor: theme.palette.primary.light,
|
|
52
|
+
},
|
|
53
|
+
'&:not(:first-of-type)': {
|
|
54
|
+
borderRadius: theme.shape.borderRadius,
|
|
55
|
+
border: '1px solid rgba(0, 0, 0, 0.12)',
|
|
56
|
+
},
|
|
57
|
+
'&:first-of-type': {
|
|
58
|
+
borderRadius: theme.shape.borderRadius,
|
|
59
|
+
},
|
|
60
|
+
'&:hover': {
|
|
61
|
+
backgroundColor: (0, material_1.lighten)(theme.palette.primary.light, 0.3), // Modifier la couleur de fond au survol
|
|
62
|
+
},
|
|
63
|
+
'&.Mui-selected:hover': {
|
|
64
|
+
backgroundColor: theme.palette.primary.light, // Modifier la couleur de fond au survol
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ToggleButtonProps, ToggleButton, styled, ToggleButtonGroup, lighten } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
interface StyledToggleButtonProps extends ToggleButtonProps {
|
|
4
|
+
customSelectedBackgroundColor?: string;
|
|
5
|
+
customBackgroundColor?: string;
|
|
6
|
+
customHoverColor?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const StyledToggleButton = styled(ToggleButton)<StyledToggleButtonProps>(
|
|
10
|
+
({ theme, customSelectedBackgroundColor, customBackgroundColor, customHoverColor }) => ({
|
|
11
|
+
padding: theme.spacing(1),
|
|
12
|
+
marginBottom: theme.spacing(2),
|
|
13
|
+
borderRadius: theme.shape.borderRadius,
|
|
14
|
+
'&:hover': {
|
|
15
|
+
backgroundColor: customHoverColor || theme.palette.warning.dark,
|
|
16
|
+
},
|
|
17
|
+
'&.Mui-selected': {
|
|
18
|
+
backgroundColor: customSelectedBackgroundColor || theme.palette.warning.main,
|
|
19
|
+
},
|
|
20
|
+
'&.Mui-selected:hover': {
|
|
21
|
+
backgroundColor: customHoverColor || theme.palette.warning.dark,
|
|
22
|
+
},
|
|
23
|
+
'&:not(:first-of-type)': {
|
|
24
|
+
borderRadius: theme.shape.borderRadius,
|
|
25
|
+
border: '1px solid rgba(0, 0, 0, 0.12)',
|
|
26
|
+
},
|
|
27
|
+
'&:first-of-type': {
|
|
28
|
+
borderRadius: theme.shape.borderRadius,
|
|
29
|
+
},
|
|
30
|
+
'&.Mui-disabled': {
|
|
31
|
+
border: 0,
|
|
32
|
+
backgroundColor: theme.palette.grey[100],
|
|
33
|
+
},
|
|
34
|
+
}),
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Personnalisation du style des Toogle Buttons
|
|
40
|
+
* Note : il n'est posssible de le personnaliser directement au niveau
|
|
41
|
+
* de l'objet "components" du theme.
|
|
42
|
+
*/
|
|
43
|
+
export const StyledToggleButtonGroup = styled(ToggleButtonGroup)(({ theme }) => ({
|
|
44
|
+
'& .MuiToggleButtonGroup-grouped': {
|
|
45
|
+
padding: theme.spacing(1),
|
|
46
|
+
marginBottom: theme.spacing(2),
|
|
47
|
+
marginLeft: theme.spacing(1),
|
|
48
|
+
marginRight: theme.spacing(1),
|
|
49
|
+
'&.Mui-disabled': {
|
|
50
|
+
border: 0,
|
|
51
|
+
backgroundColor: theme.palette.grey[100],
|
|
52
|
+
},
|
|
53
|
+
'&.Mui-selected': {
|
|
54
|
+
backgroundColor: theme.palette.primary.light,
|
|
55
|
+
},
|
|
56
|
+
'&:not(:first-of-type)': {
|
|
57
|
+
borderRadius: theme.shape.borderRadius,
|
|
58
|
+
border: '1px solid rgba(0, 0, 0, 0.12)',
|
|
59
|
+
},
|
|
60
|
+
'&:first-of-type': {
|
|
61
|
+
borderRadius: theme.shape.borderRadius,
|
|
62
|
+
},
|
|
63
|
+
'&:hover': {
|
|
64
|
+
backgroundColor: lighten(theme.palette.primary.light, 0.3), // Modifier la couleur de fond au survol
|
|
65
|
+
},
|
|
66
|
+
'&.Mui-selected:hover': {
|
|
67
|
+
backgroundColor: theme.palette.primary.light, // Modifier la couleur de fond au survol
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
}));
|
package/index.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { default as VehicleService } from './src/services/VehicleService';
|
|
|
6
6
|
export { default as AuthenticationService } from './src/services/AuthenticationService';
|
|
7
7
|
export { default as GarageService } from './src/services/GarageService';
|
|
8
8
|
export { default as UserService } from './src/services/UserService';
|
|
9
|
-
|
|
9
|
+
export { default as UserConnected } from './src/services/UserConnected';
|
|
10
10
|
// Export des composants
|
|
11
11
|
export { default as DialogForgotPassword } from './src/DialogForgotPassword';
|
|
12
12
|
export { default as IbanInput } from './src/IbanInput';
|
|
@@ -14,12 +14,12 @@ export { default as GaragePLV } from './src/GaragePLV';
|
|
|
14
14
|
export { default as AccountValidation } from './src/AccountValidation';
|
|
15
15
|
export { default as AddressFields } from './src/AddressFields';
|
|
16
16
|
export { default as ScheduleFields } from './src/ScheduleFields';
|
|
17
|
-
export { default as VehicleFullCard } from './src/VehicleFullCard';
|
|
17
|
+
export { default as VehicleFullCard } from './src/components/vehicle/VehicleFullCard';
|
|
18
18
|
export { default as MovaDigitalPassport } from './src/MovaDigitalPassport';
|
|
19
19
|
export { default as Loader } from './src/Loader';
|
|
20
20
|
export { default as MovaDialog } from './src/MovaDialog';
|
|
21
21
|
export { default as QRCode } from './src/QRCode';
|
|
22
|
-
export { default as VehiclePlateField, regexPlate, oldRegexPlate } from './src/VehiclePlateField';
|
|
22
|
+
export { default as VehiclePlateField, regexPlate, oldRegexPlate } from './src/components/vehicle/VehiclePlateField';
|
|
23
23
|
export { default as TestButton } from './src/TestButton';
|
|
24
24
|
export { default as MovaSnackbar } from './src/MovaSnackbar';
|
|
25
25
|
export { default as MovaLogin } from './src/MovaLogin';
|
|
@@ -31,6 +31,7 @@ export { default as GenderSelector } from './src/GenderSelector';
|
|
|
31
31
|
export { default as ActivateAccount } from './src/components/singup/ActivateAccount';
|
|
32
32
|
export { QrCodePLVContainer } from './src/components/QrCodePLVContainer/QrCodePLVContainer';
|
|
33
33
|
export { PLVComponent, PrintSize } from './src/components/QrCodePLVContainer/PLVComponent';
|
|
34
|
+
export {LinkedDocumentDialog} from './src/components/LinkedDocumentDialog';
|
|
34
35
|
// Export des classes
|
|
35
36
|
export { default as Subscription } from './src/models/Subscription';
|
|
36
37
|
export { default as Absence } from './src/models/Absence';
|
|
@@ -80,6 +81,7 @@ export {
|
|
|
80
81
|
findScheduleByDayOfWeek,
|
|
81
82
|
getDayOfWeekLabel,
|
|
82
83
|
isSafariOniOS,
|
|
84
|
+
iAmOwner,
|
|
83
85
|
getApplicationsShortLabels,
|
|
84
86
|
} from './src/helpers/Tools';
|
|
85
87
|
export { validatePhoneNumber, validateText, validateEmail } from './src/helpers/Validator';
|
|
@@ -117,3 +119,6 @@ export {
|
|
|
117
119
|
|
|
118
120
|
// Export des utils
|
|
119
121
|
export { openDialogPrint } from './src/utils/DialogPrint';
|
|
122
|
+
|
|
123
|
+
// Export des styles
|
|
124
|
+
export { StyledToggleButton, StyledToggleButtonGroup} from './src/style/styled';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@movalib/movalib-commons",
|
|
3
|
-
"version": "1.59.
|
|
3
|
+
"version": "1.59.15",
|
|
4
4
|
"description": "Bibliothèque d'objets communs à l'ensemble des projets React de Movalib",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"build": "rm -rf dist && tsc && npm run copy-assets",
|
|
11
11
|
"copy-assets": "cp -r src/assets/ dist/src/assets/ && cp -r src/style/ dist/src/style/",
|
|
12
12
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
13
|
-
"clean": "rm -rf dist node_modules package-lock.json"
|
|
13
|
+
"clean": "rm -rf dist node_modules package-lock.json",
|
|
14
|
+
"build:dev" : "rm -rf dist && tsc && npm run copy-assets && npm pack"
|
|
14
15
|
},
|
|
15
16
|
"keywords": [],
|
|
16
17
|
"author": "",
|
|
@@ -49,6 +49,7 @@ const VehiclePlateField: FunctionComponent<VehiclePlateFieldProps> = ({ onValidV
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
|
|
52
53
|
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
53
54
|
|
|
54
55
|
let inputValue = e.target.value.toUpperCase().replace(/[^A-Z0-9]/g, ''); // Convertir en majuscules et supprimer les caractères non valides
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import Dialog from "@mui/material/Dialog";
|
|
2
|
+
import Toolbar from "@mui/material/Toolbar";
|
|
3
|
+
import theme from "../../theme";
|
|
4
|
+
import DialogTitle from "@mui/material/DialogTitle";
|
|
5
|
+
import Box from "@mui/material/Box";
|
|
6
|
+
import { FindInPage } from "@mui/icons-material";
|
|
7
|
+
import Typography from "@mui/material/Typography";
|
|
8
|
+
import IconButton from "@mui/material/IconButton";
|
|
9
|
+
import CloseRounded from "@mui/icons-material/CloseRounded";
|
|
10
|
+
import DialogContent from "@mui/material/DialogContent";
|
|
11
|
+
import DialogActions from "@mui/material/DialogActions";
|
|
12
|
+
import Button from "@mui/material/Button";
|
|
13
|
+
import { DocumentType, MovaAppType } from "../helpers/Enums";
|
|
14
|
+
import { useState } from "react";
|
|
15
|
+
import { ToggleButtonGroup, useMediaQuery } from "@mui/material";
|
|
16
|
+
import { StyledToggleButton } from "../style/styled";
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
type LinkedDocumentDialog = {
|
|
20
|
+
isShowLinkedDocument: boolean;
|
|
21
|
+
toggleShowLinkedDocument: (docType: DocumentType | null) => void;
|
|
22
|
+
isVehicle: boolean;
|
|
23
|
+
message?: JSX.Element;
|
|
24
|
+
appType: MovaAppType;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const LinkedDocumentDialog = ({
|
|
28
|
+
isShowLinkedDocument,
|
|
29
|
+
toggleShowLinkedDocument,
|
|
30
|
+
isVehicle,
|
|
31
|
+
message,
|
|
32
|
+
appType,
|
|
33
|
+
}: LinkedDocumentDialog) => {
|
|
34
|
+
|
|
35
|
+
const [selectedTypeDocument, setSelectedTypeDocument] = useState<DocumentType | null>(null);
|
|
36
|
+
const isMobile = useMediaQuery(theme.breakpoints.down('md'));
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<Dialog
|
|
40
|
+
open={isShowLinkedDocument}
|
|
41
|
+
fullWidth
|
|
42
|
+
maxWidth='md'
|
|
43
|
+
onClose={() => toggleShowLinkedDocument(null)}
|
|
44
|
+
aria-labelledby='alert-dialog-title'
|
|
45
|
+
aria-describedby='alert-dialog-description'
|
|
46
|
+
>
|
|
47
|
+
<Toolbar
|
|
48
|
+
disableGutters
|
|
49
|
+
sx={{
|
|
50
|
+
display: 'block',
|
|
51
|
+
background: theme.palette.grey[200],
|
|
52
|
+
minHeight: 3,
|
|
53
|
+
p: 0,
|
|
54
|
+
}}
|
|
55
|
+
>
|
|
56
|
+
<DialogTitle id='search-dialog-title'>
|
|
57
|
+
<Box position='relative' sx={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between' }}>
|
|
58
|
+
<FindInPage sx={{ height: '30px', width: '30px' }} />
|
|
59
|
+
<Typography
|
|
60
|
+
variant='h6'
|
|
61
|
+
sx={{
|
|
62
|
+
textTransform: 'uppercase',
|
|
63
|
+
fontStyle: 'bold',
|
|
64
|
+
textAlign: 'center',
|
|
65
|
+
}}
|
|
66
|
+
>
|
|
67
|
+
Quel type de document ?
|
|
68
|
+
</Typography>
|
|
69
|
+
<IconButton
|
|
70
|
+
size='small'
|
|
71
|
+
aria-label='close'
|
|
72
|
+
onClick={() => toggleShowLinkedDocument(null)}
|
|
73
|
+
title={'Fermer'}
|
|
74
|
+
>
|
|
75
|
+
<CloseRounded />
|
|
76
|
+
</IconButton>
|
|
77
|
+
</Box>
|
|
78
|
+
</DialogTitle>
|
|
79
|
+
</Toolbar>
|
|
80
|
+
<DialogContent sx={{ textAlign: 'center' }}>
|
|
81
|
+
<ToggleButtonGroup
|
|
82
|
+
orientation={isMobile ? 'vertical' : 'horizontal'}
|
|
83
|
+
size='small'
|
|
84
|
+
value={selectedTypeDocument}
|
|
85
|
+
exclusive
|
|
86
|
+
onChange={(_, value: DocumentType) => {
|
|
87
|
+
setSelectedTypeDocument(value);
|
|
88
|
+
}}
|
|
89
|
+
aria-label='update-scheduling-alert'
|
|
90
|
+
sx={{ gap: 3, flexWrap: 'wrap', justifyContent: 'center' }}
|
|
91
|
+
>
|
|
92
|
+
{isVehicle ? (
|
|
93
|
+
<>
|
|
94
|
+
<StyledToggleButton
|
|
95
|
+
size='small'
|
|
96
|
+
sx={{ width: '230px' }}
|
|
97
|
+
customSelectedBackgroundColor={theme.palette.primary.main}
|
|
98
|
+
customHoverColor={theme.palette.primary.light}
|
|
99
|
+
value={DocumentType.VEHICLE_TIRE_PHOTO}
|
|
100
|
+
selected={selectedTypeDocument === DocumentType.VEHICLE_TIRE_PHOTO}
|
|
101
|
+
aria-label='document tire'
|
|
102
|
+
>
|
|
103
|
+
<b>Photo pneu</b>
|
|
104
|
+
</StyledToggleButton>
|
|
105
|
+
{appType === MovaAppType.INDIVIDUAL && (
|
|
106
|
+
<StyledToggleButton
|
|
107
|
+
size='small'
|
|
108
|
+
sx={{ width: '230px' }}
|
|
109
|
+
customSelectedBackgroundColor={theme.palette.primary.main}
|
|
110
|
+
customHoverColor={theme.palette.primary.light}
|
|
111
|
+
value={DocumentType.VEHICLE_MAINTENANCE_INVOICE}
|
|
112
|
+
selected={selectedTypeDocument === DocumentType.VEHICLE_MAINTENANCE_INVOICE}
|
|
113
|
+
aria-label='invoice document'
|
|
114
|
+
>
|
|
115
|
+
<b>Facture</b>
|
|
116
|
+
</StyledToggleButton>
|
|
117
|
+
)}
|
|
118
|
+
<StyledToggleButton
|
|
119
|
+
size='small'
|
|
120
|
+
sx={{ width: '230px' }}
|
|
121
|
+
customSelectedBackgroundColor={theme.palette.primary.main}
|
|
122
|
+
customHoverColor={theme.palette.primary.light}
|
|
123
|
+
value={DocumentType.VEHICLE_INSPECTION}
|
|
124
|
+
selected={selectedTypeDocument === DocumentType.VEHICLE_INSPECTION}
|
|
125
|
+
aria-label='vehicule inspection docuemnt'
|
|
126
|
+
>
|
|
127
|
+
<b>Contrôle technique</b>
|
|
128
|
+
</StyledToggleButton>
|
|
129
|
+
|
|
130
|
+
<StyledToggleButton
|
|
131
|
+
size='small'
|
|
132
|
+
sx={{ width: '230px' }}
|
|
133
|
+
customSelectedBackgroundColor={theme.palette.primary.main}
|
|
134
|
+
customHoverColor={theme.palette.primary.light}
|
|
135
|
+
value={DocumentType.VEHICLE_OTHER}
|
|
136
|
+
selected={selectedTypeDocument === DocumentType.VEHICLE_OTHER}
|
|
137
|
+
aria-label='vehicule document other'
|
|
138
|
+
>
|
|
139
|
+
<b>Autre</b>
|
|
140
|
+
</StyledToggleButton>
|
|
141
|
+
</>
|
|
142
|
+
) : (
|
|
143
|
+
<>
|
|
144
|
+
{/* <StyledToggleButton
|
|
145
|
+
size='small'
|
|
146
|
+
sx={{ width: '230px' }}
|
|
147
|
+
customSelectedBackgroundColor={theme.palette.primary.main}
|
|
148
|
+
customHoverColor={theme.palette.primary.light}
|
|
149
|
+
value={DocumentType.EVENT_MAINTENANCE}
|
|
150
|
+
selected={selectedTypeDocument === DocumentType.EVENT_MAINTENANCE}
|
|
151
|
+
aria-label='event visual proof document'
|
|
152
|
+
>
|
|
153
|
+
<b>Maintenance</b>
|
|
154
|
+
</StyledToggleButton> */}
|
|
155
|
+
<StyledToggleButton
|
|
156
|
+
size='small'
|
|
157
|
+
sx={{ width: '230px' }}
|
|
158
|
+
customSelectedBackgroundColor={theme.palette.primary.main}
|
|
159
|
+
customHoverColor={theme.palette.primary.light}
|
|
160
|
+
value={DocumentType.EVENT_VISUAL_PROOFS}
|
|
161
|
+
selected={selectedTypeDocument === DocumentType.EVENT_VISUAL_PROOFS}
|
|
162
|
+
aria-label='event visual proof document'
|
|
163
|
+
>
|
|
164
|
+
<b>Photos et Preuves Visuelles</b>
|
|
165
|
+
</StyledToggleButton>
|
|
166
|
+
<StyledToggleButton
|
|
167
|
+
size='small'
|
|
168
|
+
sx={{ width: '230px' }}
|
|
169
|
+
customSelectedBackgroundColor={theme.palette.primary.main}
|
|
170
|
+
customHoverColor={theme.palette.primary.light}
|
|
171
|
+
value={DocumentType.EVENT_OTHER}
|
|
172
|
+
selected={selectedTypeDocument === DocumentType.EVENT_OTHER}
|
|
173
|
+
aria-label='event document other'
|
|
174
|
+
>
|
|
175
|
+
<b>Autre</b>
|
|
176
|
+
</StyledToggleButton>
|
|
177
|
+
</>
|
|
178
|
+
)}
|
|
179
|
+
</ToggleButtonGroup>
|
|
180
|
+
{message && (
|
|
181
|
+
<>{message}</>
|
|
182
|
+
)}
|
|
183
|
+
</DialogContent>
|
|
184
|
+
<DialogActions
|
|
185
|
+
sx={{
|
|
186
|
+
py: 1,
|
|
187
|
+
backgroundColor: theme.palette.grey[200],
|
|
188
|
+
}}
|
|
189
|
+
>
|
|
190
|
+
<Button color='inherit' onClick={() => toggleShowLinkedDocument(null)}>
|
|
191
|
+
Annuler
|
|
192
|
+
</Button>
|
|
193
|
+
<Box sx={{ flexGrow: 1 }} />
|
|
194
|
+
<Button color='primary' autoFocus sx={{ ml: 1 }} disabled={!selectedTypeDocument} onClick={() => toggleShowLinkedDocument(selectedTypeDocument)}>
|
|
195
|
+
<b>Valider</b>
|
|
196
|
+
</Button>
|
|
197
|
+
</DialogActions>
|
|
198
|
+
</Dialog>
|
|
199
|
+
);
|
|
200
|
+
};
|