@movalib/movalib-commons 1.68.16 → 1.68.18
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/devIndex.tsx +5 -3
- package/dist/devIndex.js +29 -30
- package/dist/src/AccountValidation.js +11 -11
- package/dist/src/AddressFields.js +1 -12
- package/dist/src/ConfirmationDialog.js +3 -3
- package/dist/src/DialogForgotPassword.js +4 -15
- package/dist/src/DownloadedQRCode.js +4 -15
- package/dist/src/GaragePLV.js +3 -14
- package/dist/src/GenderSelector.js +1 -1
- package/dist/src/IbanInput.js +1 -1
- package/dist/src/Loader.js +1 -12
- package/dist/src/MovaCopyright.js +1 -1
- package/dist/src/MovaDialog.js +2 -2
- package/dist/src/MovaLogin.js +9 -9
- package/dist/src/MovaSignUp.js +12 -12
- package/dist/src/MovaSnackbar.js +1 -12
- package/dist/src/QRCode.js +5 -16
- package/dist/src/ScheduleFields.js +5 -5
- package/dist/src/components/LinkedDocumentDialog.d.ts +0 -1
- package/dist/src/components/LinkedDocumentDialog.js +6 -17
- package/dist/src/components/MovaTable/MovaTable.js +2 -2
- package/dist/src/components/MovaTableBack/MovaTableBack.js +9 -20
- package/dist/src/components/QrCodePLVContainer/PLVComponent.js +6 -17
- package/dist/src/components/QrCodePLVContainer/QrCodePLVContainer.js +28 -28
- package/dist/src/components/singup/ActivateAccount.js +3 -3
- package/dist/src/components/vehicle/VehicleFullCard.js +23 -22
- package/dist/src/components/vehicle/VehiclePlateField.js +4 -15
- package/dist/src/helpers/DateUtils.d.ts +1 -0
- package/dist/src/helpers/DateUtils.js +4 -4
- package/dist/src/helpers/Enums.js +27 -27
- package/dist/src/helpers/Tools.js +5 -5
- package/dist/src/helpers/Validator.js +3 -4
- package/dist/src/models/Garage.js +2 -3
- package/dist/src/models/Settings.js +1 -1
- package/dist/src/services/AuthenticationService.js +2 -2
- package/dist/src/services/UserService.js +2 -2
- package/dist/src/style/styled.d.ts +4 -6
- package/dist/src/style/styled.js +1 -0
- package/dist/src/style/styled.ts +11 -3
- package/dist/src/utils/DialogPrint.js +1 -2
- package/dist/src/utils/getQRCodeBase64.d.ts +1 -3
- package/dist/src/utils/getQRCodeBase64.js +2 -2
- package/dist/theme.js +2 -2
- package/package.json +15 -22
- package/src/GaragePLV.tsx +3 -3
- package/src/components/LinkedDocumentDialog.tsx +1 -1
- package/src/components/MovaTableBack/MovaTableBack.tsx +1 -1
- package/src/components/QrCodePLVContainer/QrCodePLVContainer.tsx +6 -4
- package/src/components/vehicle/VehicleFullCard.tsx +3 -1
- package/src/helpers/DateUtils.ts +3 -3
- package/src/react-app-env.d.ts +34 -1
- package/src/style/styled.ts +11 -3
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.validatePhoneNumber = validatePhoneNumber;
|
|
4
|
+
exports.validateText = validateText;
|
|
5
|
+
exports.validateEmail = validateEmail;
|
|
4
6
|
var Tools_1 = require("./Tools");
|
|
5
7
|
/**
|
|
6
8
|
* Un email valide
|
|
@@ -37,18 +39,15 @@ function validatePhoneNumber(phoneNumber) {
|
|
|
37
39
|
}
|
|
38
40
|
return !(0, Tools_1.isInvalidPhoneNumber)(phoneNumber);
|
|
39
41
|
}
|
|
40
|
-
exports.validatePhoneNumber = validatePhoneNumber;
|
|
41
42
|
function validateText(text) {
|
|
42
43
|
if (text === null || text === undefined) {
|
|
43
44
|
return false;
|
|
44
45
|
}
|
|
45
46
|
return textRegex.test(text);
|
|
46
47
|
}
|
|
47
|
-
exports.validateText = validateText;
|
|
48
48
|
function validateEmail(email) {
|
|
49
49
|
if (email === null || email === undefined) {
|
|
50
50
|
return false;
|
|
51
51
|
}
|
|
52
52
|
return emailRegex.test(email);
|
|
53
53
|
}
|
|
54
|
-
exports.validateEmail = validateEmail;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isStockActive = isStockActive;
|
|
4
|
+
exports.getSetting = getSetting;
|
|
4
5
|
var Settings_1 = require("./Settings");
|
|
5
6
|
var Garage = /** @class */ (function () {
|
|
6
7
|
function Garage(id, adminId, name, address, workforce, prestations, schedules, contactPhone, prestationCategories, dayPeriodFastServiceExcluded, loanerVehicleFastServiceExcluded, fastServiceThreshold, timezone, settings, vehicles, contactEmail, logo, suppliers, documents, subscriptions, loanerVehicleActive, loanerVehicleRequestActive, customStyle, subscription, partialWorkforce, mailCustomization, billingActive, billingToken, legacyQuoteActive, appId, establishmentRegistrationNumber, companyRegistrationNumber, reopeningDate, targetMargin, demoBillingActive, onlyBilling, newDocumentEditor, googleReviewUrl, isOnlineAppointment, isOnlineQuote) {
|
|
@@ -57,9 +58,7 @@ function isStockActive(g) {
|
|
|
57
58
|
}
|
|
58
59
|
return (_b = (_a = g.settings.find(function (s) { return s.code === Settings_1.SettingsEnumCode.STOCK_MODULE_ENABLED; })) === null || _a === void 0 ? void 0 : _a.valueBoolean) !== null && _b !== void 0 ? _b : false;
|
|
59
60
|
}
|
|
60
|
-
exports.isStockActive = isStockActive;
|
|
61
61
|
function getSetting(settings, code) {
|
|
62
62
|
var _a, _b;
|
|
63
63
|
return (_b = (_a = settings.find(function (s) { return s.code === code; })) === null || _a === void 0 ? void 0 : _a.valueText) !== null && _b !== void 0 ? _b : null;
|
|
64
64
|
}
|
|
65
|
-
exports.getSetting = getSetting;
|
|
@@ -4,7 +4,7 @@ exports.SettingsEnumCode = void 0;
|
|
|
4
4
|
var SettingsEnumCode;
|
|
5
5
|
(function (SettingsEnumCode) {
|
|
6
6
|
SettingsEnumCode["STOCK_MODULE_ENABLED"] = "STOCK_MODULE_ENABLED";
|
|
7
|
-
})(SettingsEnumCode
|
|
7
|
+
})(SettingsEnumCode || (exports.SettingsEnumCode = SettingsEnumCode = {}));
|
|
8
8
|
var Settings = /** @class */ (function () {
|
|
9
9
|
function Settings(code, valueBoolean, valueText, valueNumber) {
|
|
10
10
|
this.code = code;
|
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
import { ToggleButtonProps, ToggleButtonGroupProps } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
3
3
|
interface StyledToggleButtonProps extends ToggleButtonProps {
|
|
4
4
|
customSelectedBackgroundColor?: string;
|
|
5
5
|
customBackgroundColor?: string;
|
|
6
6
|
customHoverColor?: string;
|
|
7
7
|
}
|
|
8
|
-
export declare const StyledToggleButton:
|
|
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, {}, {}>;
|
|
8
|
+
export declare const StyledToggleButton: React.FC<StyledToggleButtonProps>;
|
|
11
9
|
/**
|
|
12
10
|
* Personnalisation du style des Toogle Buttons
|
|
13
11
|
* Note : il n'est posssible de le personnaliser directement au niveau
|
|
14
12
|
* de l'objet "components" du theme.
|
|
15
13
|
*/
|
|
16
|
-
export declare const StyledToggleButtonGroup:
|
|
14
|
+
export declare const StyledToggleButtonGroup: React.ComponentType<ToggleButtonGroupProps>;
|
|
17
15
|
export {};
|
package/dist/src/style/styled.js
CHANGED
package/dist/src/style/styled.ts
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
ToggleButtonProps,
|
|
3
|
+
ToggleButton,
|
|
4
|
+
styled,
|
|
5
|
+
ToggleButtonGroup,
|
|
6
|
+
lighten,
|
|
7
|
+
ToggleButtonGroupProps
|
|
8
|
+
} from "@mui/material";
|
|
9
|
+
import React from "react";
|
|
2
10
|
|
|
3
11
|
interface StyledToggleButtonProps extends ToggleButtonProps {
|
|
4
12
|
customSelectedBackgroundColor?: string;
|
|
@@ -6,7 +14,7 @@ interface StyledToggleButtonProps extends ToggleButtonProps {
|
|
|
6
14
|
customHoverColor?: string;
|
|
7
15
|
}
|
|
8
16
|
|
|
9
|
-
|
|
17
|
+
export const StyledToggleButton: React.FC<StyledToggleButtonProps> = styled(ToggleButton)<StyledToggleButtonProps>(
|
|
10
18
|
({ theme, customSelectedBackgroundColor, customBackgroundColor, customHoverColor }) => ({
|
|
11
19
|
padding: theme.spacing(1),
|
|
12
20
|
marginBottom: theme.spacing(2),
|
|
@@ -67,4 +75,4 @@ export const StyledToggleButtonGroup = styled(ToggleButtonGroup)(({ theme }) =>
|
|
|
67
75
|
backgroundColor: theme.palette.primary.light, // Modifier la couleur de fond au survol
|
|
68
76
|
},
|
|
69
77
|
},
|
|
70
|
-
}))
|
|
78
|
+
}))as React.ComponentType<ToggleButtonGroupProps>;;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.openDialogPrint =
|
|
3
|
+
exports.openDialogPrint = openDialogPrint;
|
|
4
4
|
function openDialogPrint(url) {
|
|
5
5
|
// Créer un iframe pour charger le document Blob => url
|
|
6
6
|
var iframe = document.createElement('iframe');
|
|
@@ -20,4 +20,3 @@ function openDialogPrint(url) {
|
|
|
20
20
|
URL.revokeObjectURL(url);
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
exports.openDialogPrint = openDialogPrint;
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
export declare const getQrCodeBase64: (url: string, dotsColor: string, cornerColor: string) => Promise<Blob | Buffer | null>;
|
|
1
|
+
export declare const getQrCodeBase64: (url: string, dotsColor: string, cornerColor: string) => Promise<Blob | Buffer<ArrayBufferLike> | null>;
|
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g =
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
package/dist/theme.js
CHANGED
|
@@ -7,11 +7,11 @@ var theme = (0, styles_1.createTheme)({
|
|
|
7
7
|
paper: '#F0F0F0',
|
|
8
8
|
},
|
|
9
9
|
primary: {
|
|
10
|
-
main: '#BCD46C',
|
|
10
|
+
main: '#BCD46C', // Définissez votre couleur primaire
|
|
11
11
|
light: '#D2EDAB'
|
|
12
12
|
},
|
|
13
13
|
secondary: {
|
|
14
|
-
main: '#FFD25C',
|
|
14
|
+
main: '#FFD25C', //'#F29ABA', // Définissez votre couleur secondaire // FFC700
|
|
15
15
|
light: '#FEE08E' //'#F1C0D9'
|
|
16
16
|
},
|
|
17
17
|
success: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@movalib/movalib-commons",
|
|
3
|
-
"version": "1.68.
|
|
3
|
+
"version": "1.68.18",
|
|
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",
|
|
@@ -19,50 +19,43 @@
|
|
|
19
19
|
"license": "ISC",
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@types/react-router-dom": "^5.3.0",
|
|
22
|
-
"date-fns": "^
|
|
23
|
-
"date-fns-tz": "^2.0
|
|
24
|
-
"file-loader": "^6.2.0",
|
|
22
|
+
"date-fns": "^3.6.0",
|
|
23
|
+
"date-fns-tz": "^3.2.0",
|
|
25
24
|
"html2canvas": "^1.4.1",
|
|
26
25
|
"js-cookie": "^3.0.5",
|
|
27
26
|
"lodash": "^4.17.21",
|
|
28
27
|
"moment": "^2.30.1",
|
|
29
28
|
"moment-timezone": "^0.5.48",
|
|
30
29
|
"pdf-lib": "^1.17.1",
|
|
31
|
-
"pdfjs-dist": "^4.
|
|
30
|
+
"pdfjs-dist": "^4.8.69",
|
|
32
31
|
"qr-code-styling": "^1.4.4",
|
|
33
32
|
"react-input-mask": "^2.0.4",
|
|
34
33
|
"react-router-dom": "^5.1.2",
|
|
35
|
-
"react-
|
|
36
|
-
"react-to-print": "^2.14.15"
|
|
37
|
-
},
|
|
38
|
-
"eslintConfig": {
|
|
39
|
-
"extends": [
|
|
40
|
-
"react-app"
|
|
41
|
-
]
|
|
34
|
+
"react-to-print": "^3.0.2"
|
|
42
35
|
},
|
|
43
36
|
"peerDependencies": {
|
|
44
|
-
"
|
|
37
|
+
"@emotion/react": "^11.14.0",
|
|
38
|
+
"@emotion/styled": "^11.14.0",
|
|
45
39
|
"@mui/icons-material": "^6.0.0",
|
|
46
|
-
"@mui/x-date-pickers": "^7.0.0",
|
|
47
40
|
"@mui/lab": "6.0.1-beta.34",
|
|
48
41
|
"@mui/material": "^6.0.0",
|
|
49
|
-
"
|
|
50
|
-
"react-dom": "^18.2.0",
|
|
51
|
-
"react-router-dom": "^5.1.2",
|
|
52
|
-
"typescript": "^4.9.5",
|
|
42
|
+
"@mui/x-date-pickers": "^7.0.0",
|
|
53
43
|
"@types/react": "^18.2.22",
|
|
54
44
|
"@types/react-dom": "^18.2.7",
|
|
55
|
-
"
|
|
56
|
-
|
|
45
|
+
"libphonenumber-js": "^1.11.0",
|
|
46
|
+
"react": "^18.2.0",
|
|
47
|
+
"react-dom": "^18.2.0",
|
|
48
|
+
"react-router-dom": "^5.1.2"
|
|
57
49
|
},
|
|
58
50
|
"devDependencies": {
|
|
51
|
+
"@date-io/date-fns": "^3.2.1",
|
|
59
52
|
"@types/js-cookie": "^3.0.4",
|
|
60
53
|
"@types/lodash": "^4.17.17",
|
|
61
|
-
"@types/pdfjs-dist": "^2.10.377",
|
|
62
54
|
"@types/react-input-mask": "^3.0.5",
|
|
63
55
|
"html-webpack-plugin": "^5.5.3",
|
|
64
|
-
"libphonenumber-js": "1.
|
|
56
|
+
"libphonenumber-js": "^1.11.0",
|
|
65
57
|
"ts-loader": "^9.4.4",
|
|
58
|
+
"typescript": "^5.5.0",
|
|
66
59
|
"webpack-cli": "^5.1.4"
|
|
67
60
|
}
|
|
68
61
|
}
|
package/src/GaragePLV.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Button, darken, useTheme } from '@mui/material';
|
|
2
|
-
import { type FC, useRef } from 'react';
|
|
2
|
+
import React, { type FC, useRef } from 'react';
|
|
3
3
|
import { useReactToPrint } from 'react-to-print';
|
|
4
4
|
import { PLVComponent, PrintSize } from './components/QrCodePLVContainer/PLVComponent';
|
|
5
5
|
import { flexCenter } from './helpers/Tools';
|
|
@@ -14,12 +14,12 @@ const GaragePLV: FC<GaragePLVProps> = ({ url }) => {
|
|
|
14
14
|
const theme = useTheme();
|
|
15
15
|
|
|
16
16
|
const handleA4Print = useReactToPrint({
|
|
17
|
-
|
|
17
|
+
contentRef: PLVrefA4 as unknown as React.RefObject<HTMLElement>,
|
|
18
18
|
documentTitle: 'Movalib_PLV_A4',
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
const handleA3Print = useReactToPrint({
|
|
22
|
-
|
|
22
|
+
contentRef: PLVrefA3 as unknown as React.RefObject<HTMLElement>,
|
|
23
23
|
documentTitle: 'Movalib_PLV_A3',
|
|
24
24
|
});
|
|
25
25
|
|
|
@@ -3,7 +3,7 @@ import Toolbar from "@mui/material/Toolbar";
|
|
|
3
3
|
import theme from "../../theme";
|
|
4
4
|
import DialogTitle from "@mui/material/DialogTitle";
|
|
5
5
|
import Box from "@mui/material/Box";
|
|
6
|
-
import
|
|
6
|
+
import FindInPage from "@mui/icons-material/FindInPage";
|
|
7
7
|
import Typography from "@mui/material/Typography";
|
|
8
8
|
import IconButton from "@mui/material/IconButton";
|
|
9
9
|
import CloseRounded from "@mui/icons-material/CloseRounded";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import DocumentScanner from "@mui/icons-material/DocumentScanner";
|
|
2
|
+
import QrCode2 from "@mui/icons-material/QrCode2";
|
|
3
|
+
|
|
2
4
|
import {
|
|
3
5
|
Box,
|
|
4
6
|
Button,
|
|
@@ -141,7 +143,7 @@ export const QrCodePLVContainer = ({ data }: { data: string }) => {
|
|
|
141
143
|
const modifiedPdfBytes = await pdfDoc.save();
|
|
142
144
|
|
|
143
145
|
// Convertir les bytes en Blob puis en URL
|
|
144
|
-
|
|
146
|
+
const blob = new Blob([modifiedPdfBytes.buffer as ArrayBuffer], { type: "application/pdf" });
|
|
145
147
|
const url = URL.createObjectURL(blob);
|
|
146
148
|
|
|
147
149
|
// étape nécesssaire pour utiliser reactToPrint pour pouvoir nommer le document
|
|
@@ -236,12 +238,12 @@ export const QrCodePLVContainer = ({ data }: { data: string }) => {
|
|
|
236
238
|
};
|
|
237
239
|
|
|
238
240
|
const printA3PLV = useReactToPrint({
|
|
239
|
-
|
|
241
|
+
contentRef: PLVrefA3 as unknown as React.RefObject<HTMLElement>,
|
|
240
242
|
documentTitle: "Movalib_PLV_A3",
|
|
241
243
|
});
|
|
242
244
|
|
|
243
245
|
const printA4PLV = useReactToPrint({
|
|
244
|
-
|
|
246
|
+
contentRef: PLVrefA4 as unknown as React.RefObject<HTMLElement>,
|
|
245
247
|
documentTitle: "Movalib_PLV_A4",
|
|
246
248
|
});
|
|
247
249
|
|
package/src/helpers/DateUtils.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { format,
|
|
2
|
-
import { fr } from 'date-fns/locale';
|
|
1
|
+
import { format, toZonedTime } from 'date-fns-tz';
|
|
2
|
+
import { fr, Locale } from 'date-fns/locale';
|
|
3
3
|
import { DateFormatTypes } from './Enums';
|
|
4
4
|
import { capitalizeFirstLetter } from './Tools';
|
|
5
5
|
|
|
@@ -19,7 +19,7 @@ export const toUTCToLocaleDate = (date: "" | Date | null, timeZone: string): Da
|
|
|
19
19
|
if(date){
|
|
20
20
|
|
|
21
21
|
// Convertir la date UTC en date du fuseau horaire local
|
|
22
|
-
zonedDate =
|
|
22
|
+
zonedDate = toZonedTime(date, timeZone);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
return zonedDate;
|
package/src/react-app-env.d.ts
CHANGED
|
@@ -1 +1,34 @@
|
|
|
1
|
-
/// <reference types="
|
|
1
|
+
/// <reference types="vite/client" />
|
|
2
|
+
|
|
3
|
+
declare module "*.png" {
|
|
4
|
+
const src: string;
|
|
5
|
+
export default src;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
declare module "*.jpg" {
|
|
9
|
+
const src: string;
|
|
10
|
+
export default src;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
declare module "*.jpeg" {
|
|
14
|
+
const src: string;
|
|
15
|
+
export default src;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
declare module "*.svg" {
|
|
19
|
+
import * as React from "react";
|
|
20
|
+
export const ReactComponent: React.FunctionComponent
|
|
21
|
+
React.SVGProps<SVGSVGElement>
|
|
22
|
+
const src: string;
|
|
23
|
+
export default src;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
declare module "*.gif" {
|
|
27
|
+
const src: string;
|
|
28
|
+
export default src;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
declare module "*.webp" {
|
|
32
|
+
const src: string;
|
|
33
|
+
export default src;
|
|
34
|
+
}
|
package/src/style/styled.ts
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
ToggleButtonProps,
|
|
3
|
+
ToggleButton,
|
|
4
|
+
styled,
|
|
5
|
+
ToggleButtonGroup,
|
|
6
|
+
lighten,
|
|
7
|
+
ToggleButtonGroupProps
|
|
8
|
+
} from "@mui/material";
|
|
9
|
+
import React from "react";
|
|
2
10
|
|
|
3
11
|
interface StyledToggleButtonProps extends ToggleButtonProps {
|
|
4
12
|
customSelectedBackgroundColor?: string;
|
|
@@ -6,7 +14,7 @@ interface StyledToggleButtonProps extends ToggleButtonProps {
|
|
|
6
14
|
customHoverColor?: string;
|
|
7
15
|
}
|
|
8
16
|
|
|
9
|
-
|
|
17
|
+
export const StyledToggleButton: React.FC<StyledToggleButtonProps> = styled(ToggleButton)<StyledToggleButtonProps>(
|
|
10
18
|
({ theme, customSelectedBackgroundColor, customBackgroundColor, customHoverColor }) => ({
|
|
11
19
|
padding: theme.spacing(1),
|
|
12
20
|
marginBottom: theme.spacing(2),
|
|
@@ -67,4 +75,4 @@ export const StyledToggleButtonGroup = styled(ToggleButtonGroup)(({ theme }) =>
|
|
|
67
75
|
backgroundColor: theme.palette.primary.light, // Modifier la couleur de fond au survol
|
|
68
76
|
},
|
|
69
77
|
},
|
|
70
|
-
}))
|
|
78
|
+
}))as React.ComponentType<ToggleButtonGroupProps>;;
|