@movalib/movalib-commons 1.65.0 → 1.65.1
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.
|
@@ -56,6 +56,7 @@ var CloseRounded_1 = __importDefault(require("@mui/icons-material/CloseRounded")
|
|
|
56
56
|
var EditRounded_1 = __importDefault(require("@mui/icons-material/EditRounded"));
|
|
57
57
|
var material_1 = require("@mui/material");
|
|
58
58
|
var x_date_pickers_1 = require("@mui/x-date-pickers");
|
|
59
|
+
var moment_1 = __importDefault(require("moment"));
|
|
59
60
|
var react_1 = require("react");
|
|
60
61
|
var car_plate_bg_png_1 = __importDefault(require("../../assets/images/car_plate_bg.png"));
|
|
61
62
|
var ConfirmationDialog_1 = __importDefault(require("../../ConfirmationDialog"));
|
|
@@ -339,9 +340,19 @@ var VehicleFullCard = function (_a) {
|
|
|
339
340
|
"& input": { textTransform: "uppercase" }, // CSS pour forcer les majuscules dans l'input
|
|
340
341
|
} }) }))), !localEditMode && ((0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, textAlign: "justify", sx: { pt: 2 } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 8 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: "Dernier contr\u00F4le technique :" })) })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 4, sx: { textAlign: "right" } }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: (0, jsx_runtime_1.jsx)("b", { children: (0, DateUtils_1.formatDateByTimezone)(vehicle.lastInspectionDate, "Europe/Paris", Enums_1.DateFormatTypes.SHORT_FORMAT_DATE) !== ""
|
|
341
342
|
? (0, DateUtils_1.formatDateByTimezone)(vehicle.lastInspectionDate, "Europe/Paris", Enums_1.DateFormatTypes.SHORT_FORMAT_DATE)
|
|
342
|
-
: "-" }) })) }))] }))), localEditMode && ((0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12 }, { children: (0, jsx_runtime_1.jsx)(material_1.FormControl, __assign({ fullWidth: true, sx: { marginTop: 2 } }, { children: (0, jsx_runtime_1.jsx)(x_date_pickers_1.DatePicker, { label: "Dernier contrôle technique", name: "lastInspectionDate", value: form.lastInspectionDate.value
|
|
343
|
+
: "-" }) })) }))] }))), localEditMode && ((0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12 }, { children: (0, jsx_runtime_1.jsx)(material_1.FormControl, __assign({ fullWidth: true, sx: { marginTop: 2 } }, { children: (0, jsx_runtime_1.jsx)(x_date_pickers_1.DatePicker, { label: "Dernier contrôle technique", name: "lastInspectionDate", value: form.lastInspectionDate.value
|
|
344
|
+
? (0, moment_1.default)(form.lastInspectionDate.value)
|
|
345
|
+
: null, format: "DD/MM/YYYY", formatDensity: "dense", views: ["day"], displayWeekNumber: true, onChange: function (e) {
|
|
346
|
+
var _a;
|
|
347
|
+
return handleChange("lastInspectionDate", (_a = e === null || e === void 0 ? void 0 : e.toDate()) !== null && _a !== void 0 ? _a : null);
|
|
348
|
+
} }) })) }))), !localEditMode && ((0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, textAlign: "justify", sx: { pt: 2 } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 8 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: "Dernier entretien :" })) })), (0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 4, sx: { textAlign: "right" } }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "body1", color: "text.secondary" }, { children: (0, jsx_runtime_1.jsx)("b", { children: (0, DateUtils_1.formatDateByTimezone)(vehicle.lastMaintenanceDate, "Europe/Paris", Enums_1.DateFormatTypes.SHORT_FORMAT_DATE) !== ""
|
|
343
349
|
? (0, DateUtils_1.formatDateByTimezone)(vehicle.lastMaintenanceDate, "Europe/Paris", Enums_1.DateFormatTypes.SHORT_FORMAT_DATE)
|
|
344
|
-
: "-" }) })) }))] }))), localEditMode && ((0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12 }, { children: (0, jsx_runtime_1.jsx)(material_1.FormControl, __assign({ fullWidth: true, sx: { marginTop: 2 } }, { children: (0, jsx_runtime_1.jsx)(x_date_pickers_1.DatePicker, { label: "Dernier entretien", name: "lastMaintenanceDate", value: form.lastMaintenanceDate.value
|
|
350
|
+
: "-" }) })) }))] }))), localEditMode && ((0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12 }, { children: (0, jsx_runtime_1.jsx)(material_1.FormControl, __assign({ fullWidth: true, sx: { marginTop: 2 } }, { children: (0, jsx_runtime_1.jsx)(x_date_pickers_1.DatePicker, { label: "Dernier entretien", name: "lastMaintenanceDate", value: form.lastMaintenanceDate.value
|
|
351
|
+
? (0, moment_1.default)(form.lastMaintenanceDate.value)
|
|
352
|
+
: null, format: "DD/MM/YYYY", formatDensity: "dense", views: ["day"], displayWeekNumber: true, onChange: function (e) {
|
|
353
|
+
var _a;
|
|
354
|
+
return handleChange("lastMaintenanceDate", (_a = e === null || e === void 0 ? void 0 : e.toDate()) !== null && _a !== void 0 ? _a : null);
|
|
355
|
+
} }) })) })))] })), !localEditMode && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Grid, __assign({ item: true, xs: 12 }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, __assign({ variant: "h6", component: "div", align: "center", sx: { mt: 3, mb: 1 }, color: (0, material_1.darken)(theme.palette.primary.main, 0.2) }, { children: "CARNET DU V\u00C9HICULE" })) })), vehicle.documents &&
|
|
345
356
|
((_b = vehicle.documents) === null || _b === void 0 ? void 0 : _b.filter(function (doc) { return doc.fileSignedUrl; }).map(function (invoice, index) { return ((0, jsx_runtime_1.jsxs)(material_1.Grid, __assign({ container: true, sx: {
|
|
346
357
|
justifyContent: "space-between",
|
|
347
358
|
alignItems: "center",
|
package/package.json
CHANGED
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
useTheme,
|
|
28
28
|
} from "@mui/material";
|
|
29
29
|
import { DatePicker } from "@mui/x-date-pickers";
|
|
30
|
+
import moment from "moment";
|
|
30
31
|
import { useEffect, useRef, useState, type FC } from "react";
|
|
31
32
|
import CatPlateBg from "../../assets/images/car_plate_bg.png";
|
|
32
33
|
import ConfirmationDialog from "../../ConfirmationDialog";
|
|
@@ -824,12 +825,21 @@ const VehicleFullCard: FC<VehicleFullCardProps> = ({
|
|
|
824
825
|
<DatePicker
|
|
825
826
|
label={"Dernier contrôle technique"}
|
|
826
827
|
name={"lastInspectionDate"}
|
|
827
|
-
value={
|
|
828
|
-
|
|
828
|
+
value={
|
|
829
|
+
form.lastInspectionDate.value
|
|
830
|
+
? moment(form.lastInspectionDate.value)
|
|
831
|
+
: null
|
|
832
|
+
}
|
|
833
|
+
format="DD/MM/YYYY"
|
|
829
834
|
formatDensity="dense"
|
|
830
835
|
views={["day"]}
|
|
831
836
|
displayWeekNumber
|
|
832
|
-
onChange={(e) =>
|
|
837
|
+
onChange={(e) =>
|
|
838
|
+
handleChange(
|
|
839
|
+
"lastInspectionDate",
|
|
840
|
+
(e?.toDate() as any) ?? null
|
|
841
|
+
)
|
|
842
|
+
}
|
|
833
843
|
/>
|
|
834
844
|
</FormControl>
|
|
835
845
|
</Grid>
|
|
@@ -868,12 +878,21 @@ const VehicleFullCard: FC<VehicleFullCardProps> = ({
|
|
|
868
878
|
<DatePicker
|
|
869
879
|
label={"Dernier entretien"}
|
|
870
880
|
name={"lastMaintenanceDate"}
|
|
871
|
-
value={
|
|
872
|
-
|
|
881
|
+
value={
|
|
882
|
+
form.lastMaintenanceDate.value
|
|
883
|
+
? moment(form.lastMaintenanceDate.value)
|
|
884
|
+
: null
|
|
885
|
+
}
|
|
886
|
+
format="DD/MM/YYYY"
|
|
873
887
|
formatDensity="dense"
|
|
874
888
|
views={["day"]}
|
|
875
889
|
displayWeekNumber
|
|
876
|
-
onChange={(e) =>
|
|
890
|
+
onChange={(e) =>
|
|
891
|
+
handleChange(
|
|
892
|
+
"lastMaintenanceDate",
|
|
893
|
+
(e?.toDate() as any) ?? null
|
|
894
|
+
)
|
|
895
|
+
}
|
|
877
896
|
/>
|
|
878
897
|
</FormControl>
|
|
879
898
|
</Grid>
|