@movalib/movalib-commons 1.68.17 → 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/dist/src/components/LinkedDocumentDialog.js +2 -2
- package/dist/src/components/MovaTableBack/MovaTableBack.js +2 -2
- package/dist/src/components/QrCodePLVContainer/QrCodePLVContainer.js +3 -2
- package/dist/src/components/vehicle/VehicleFullCard.js +5 -4
- package/package.json +1 -1
- package/src/components/LinkedDocumentDialog.tsx +1 -1
- package/src/components/MovaTableBack/MovaTableBack.tsx +1 -1
- package/src/components/QrCodePLVContainer/QrCodePLVContainer.tsx +3 -1
- package/src/components/vehicle/VehicleFullCard.tsx +3 -1
|
@@ -10,7 +10,7 @@ var Toolbar_1 = __importDefault(require("@mui/material/Toolbar"));
|
|
|
10
10
|
var theme_1 = __importDefault(require("../../theme"));
|
|
11
11
|
var DialogTitle_1 = __importDefault(require("@mui/material/DialogTitle"));
|
|
12
12
|
var Box_1 = __importDefault(require("@mui/material/Box"));
|
|
13
|
-
var
|
|
13
|
+
var FindInPage_1 = __importDefault(require("@mui/icons-material/FindInPage"));
|
|
14
14
|
var Typography_1 = __importDefault(require("@mui/material/Typography"));
|
|
15
15
|
var IconButton_1 = __importDefault(require("@mui/material/IconButton"));
|
|
16
16
|
var CloseRounded_1 = __importDefault(require("@mui/icons-material/CloseRounded"));
|
|
@@ -30,7 +30,7 @@ var LinkedDocumentDialog = function (_a) {
|
|
|
30
30
|
background: theme_1.default.palette.grey[200],
|
|
31
31
|
minHeight: 3,
|
|
32
32
|
p: 0,
|
|
33
|
-
}, children: (0, jsx_runtime_1.jsx)(DialogTitle_1.default, { id: 'search-dialog-title', children: (0, jsx_runtime_1.jsxs)(Box_1.default, { position: 'relative', sx: { display: 'flex', flexDirection: 'row', justifyContent: 'space-between' }, children: [(0, jsx_runtime_1.jsx)(
|
|
33
|
+
}, children: (0, jsx_runtime_1.jsx)(DialogTitle_1.default, { id: 'search-dialog-title', children: (0, jsx_runtime_1.jsxs)(Box_1.default, { position: 'relative', sx: { display: 'flex', flexDirection: 'row', justifyContent: 'space-between' }, children: [(0, jsx_runtime_1.jsx)(FindInPage_1.default, { sx: { height: '30px', width: '30px' } }), (0, jsx_runtime_1.jsx)(Typography_1.default, { variant: 'h6', sx: {
|
|
34
34
|
textTransform: 'uppercase',
|
|
35
35
|
fontStyle: 'bold',
|
|
36
36
|
textAlign: 'center',
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.default = MovaTableBack;
|
|
7
7
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
var
|
|
8
|
+
var Refresh_1 = __importDefault(require("@mui/icons-material/Refresh"));
|
|
9
9
|
var Search_1 = __importDefault(require("@mui/icons-material/Search"));
|
|
10
10
|
var material_1 = require("@mui/material");
|
|
11
11
|
var react_1 = require("react");
|
|
@@ -61,7 +61,7 @@ function MovaTableBack(_a) {
|
|
|
61
61
|
gap: 2,
|
|
62
62
|
}, children: [(0, jsx_runtime_1.jsx)(material_1.TextField, { size: "small", type: "search", onChange: handleSearchChange, inputProps: {
|
|
63
63
|
startAdornment: ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, { position: "start", children: (0, jsx_runtime_1.jsx)(Search_1.default, {}) })),
|
|
64
|
-
}, sx: { width: "100%" }, placeholder: "Rechercher" }), refresh && ((0, jsx_runtime_1.jsx)(material_1.Button, { size: "small", onClick: refresh, variant: "contained", children: (0, jsx_runtime_1.jsx)(
|
|
64
|
+
}, sx: { width: "100%" }, placeholder: "Rechercher" }), refresh && ((0, jsx_runtime_1.jsx)(material_1.Button, { size: "small", onClick: refresh, variant: "contained", children: (0, jsx_runtime_1.jsx)(Refresh_1.default, {}) }))] }), filterChildren && filterChildren, (0, jsx_runtime_1.jsx)(material_1.TableContainer, { sx: { height: "100%" }, component: material_1.Paper, children: (0, jsx_runtime_1.jsxs)(material_1.Table, { size: compact ? "small" : "medium", sx: { height: "100%" }, stickyHeader: true, children: [(0, jsx_runtime_1.jsx)(material_1.TableHead, { children: (0, jsx_runtime_1.jsx)(material_1.TableRow, { children: displayedColumns.map(function (column, index) { return ((0, jsx_runtime_1.jsx)(material_1.TableCell, { children: column.displayName }, index)); }) }) }), (0, jsx_runtime_1.jsxs)(material_1.TableBody, { sx: { overflowY: "auto" }, children: [isLoading && ((0, jsx_runtime_1.jsx)(material_1.TableRow, { children: (0, jsx_runtime_1.jsx)(material_1.TableCell, { colSpan: 5, sx: { padding: 0 }, children: (0, jsx_runtime_1.jsx)(material_1.LinearProgress, {}) }) })), (data === null || data === void 0 ? void 0 : data.length) !== 0 &&
|
|
65
65
|
(data === null || data === void 0 ? void 0 : data.map(function (element, index) { return ((0, jsx_runtime_1.jsx)(material_1.TableRow, { onDoubleClick: function () {
|
|
66
66
|
handleDoubleClick(element);
|
|
67
67
|
}, onClick: function () { return handleRowClick(element); }, onContextMenu: function (event) {
|
|
@@ -74,7 +74,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
74
74
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
75
75
|
exports.QrCodePLVContainer = exports.getPdfDocument = void 0;
|
|
76
76
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
77
|
-
var
|
|
77
|
+
var DocumentScanner_1 = __importDefault(require("@mui/icons-material/DocumentScanner"));
|
|
78
|
+
var QrCode2_1 = __importDefault(require("@mui/icons-material/QrCode2"));
|
|
78
79
|
var material_1 = require("@mui/material");
|
|
79
80
|
require("../../style/QRCode.css");
|
|
80
81
|
var html2canvas_1 = __importDefault(require("html2canvas"));
|
|
@@ -297,7 +298,7 @@ var QrCodePLVContainer = function (_a) {
|
|
|
297
298
|
printA3PLV,
|
|
298
299
|
printA4PLV,
|
|
299
300
|
]);
|
|
300
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", flexDirection: "column", alignItems: "center", gap: "24px", children: [urlA4 && ((0, jsx_runtime_1.jsx)(PLVComponent_1.PLVComponentV2, { ref: PLVrefA4, url: urlA4, printSize: PLVComponent_1.PrintSize.A4 })), urlA3 && ((0, jsx_runtime_1.jsx)(PLVComponent_1.PLVComponentV2, { ref: PLVrefA3, url: urlA3, printSize: PLVComponent_1.PrintSize.A3 })), (0, jsx_runtime_1.jsxs)(material_1.Grid, { container: true, justifyContent: "center", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 7, children: (0, jsx_runtime_1.jsxs)(material_1.FormControl, { fullWidth: true, size: "small", children: [(0, jsx_runtime_1.jsx)(material_1.InputLabel, { id: "qrcode-plv-select", children: "Choisissez votre support" }), (0, jsx_runtime_1.jsxs)(material_1.Select, { labelId: "qrcode-plv-select", label: "Choisissez votre support", id: "qrcode-plv-select", onChange: onChangeSelectedChoice, value: selectedChoice, children: [(0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "A4", children: "\uD83E\uDDFE\u00A0\u00A0PLV format A4" }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "A3", children: "\uD83E\uDDFE\u00A0\u00A0PLV format A3" }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "QR_Google", children: "QR Code format GoogleMyBusiness" }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "QR_Headless", children: "QR Code seul" })] })] }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 4, marginLeft: 3, children: (selectedChoice === "A3" || selectedChoice === "A4") && !isReady ? ((0, jsx_runtime_1.jsx)(material_1.CircularProgress, {})) : ((0, jsx_runtime_1.jsx)(material_1.Button, { startIcon: selectedChoice === "A3" || selectedChoice === "A4" ? ((0, jsx_runtime_1.jsx)(
|
|
301
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", flexDirection: "column", alignItems: "center", gap: "24px", children: [urlA4 && ((0, jsx_runtime_1.jsx)(PLVComponent_1.PLVComponentV2, { ref: PLVrefA4, url: urlA4, printSize: PLVComponent_1.PrintSize.A4 })), urlA3 && ((0, jsx_runtime_1.jsx)(PLVComponent_1.PLVComponentV2, { ref: PLVrefA3, url: urlA3, printSize: PLVComponent_1.PrintSize.A3 })), (0, jsx_runtime_1.jsxs)(material_1.Grid, { container: true, justifyContent: "center", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 7, children: (0, jsx_runtime_1.jsxs)(material_1.FormControl, { fullWidth: true, size: "small", children: [(0, jsx_runtime_1.jsx)(material_1.InputLabel, { id: "qrcode-plv-select", children: "Choisissez votre support" }), (0, jsx_runtime_1.jsxs)(material_1.Select, { labelId: "qrcode-plv-select", label: "Choisissez votre support", id: "qrcode-plv-select", onChange: onChangeSelectedChoice, value: selectedChoice, children: [(0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "A4", children: "\uD83E\uDDFE\u00A0\u00A0PLV format A4" }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "A3", children: "\uD83E\uDDFE\u00A0\u00A0PLV format A3" }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "QR_Google", children: "QR Code format GoogleMyBusiness" }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "QR_Headless", children: "QR Code seul" })] })] }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 4, marginLeft: 3, children: (selectedChoice === "A3" || selectedChoice === "A4") && !isReady ? ((0, jsx_runtime_1.jsx)(material_1.CircularProgress, {})) : ((0, jsx_runtime_1.jsx)(material_1.Button, { startIcon: selectedChoice === "A3" || selectedChoice === "A4" ? ((0, jsx_runtime_1.jsx)(DocumentScanner_1.default, {})) : ((0, jsx_runtime_1.jsx)(QrCode2_1.default, {})), onClick: onClickDownload, variant: "outlined", disabled: !selectedChoice ||
|
|
301
302
|
((selectedChoice === "A3" || selectedChoice === "A4") &&
|
|
302
303
|
!isReady), sx: {
|
|
303
304
|
color: (0, material_1.darken)(theme.palette.primary.main, 0.2),
|
|
@@ -51,7 +51,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
51
51
|
};
|
|
52
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
53
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
54
|
-
var
|
|
54
|
+
var ContentCopy_1 = __importDefault(require("@mui/icons-material/ContentCopy"));
|
|
55
|
+
var AttachFile_1 = __importDefault(require("@mui/icons-material/AttachFile"));
|
|
55
56
|
var CloseRounded_1 = __importDefault(require("@mui/icons-material/CloseRounded"));
|
|
56
57
|
var EditRounded_1 = __importDefault(require("@mui/icons-material/EditRounded"));
|
|
57
58
|
var material_1 = require("@mui/material");
|
|
@@ -280,7 +281,7 @@ var VehicleFullCard = function (_a) {
|
|
|
280
281
|
case 1: return [2 /*return*/, _a.sent()];
|
|
281
282
|
}
|
|
282
283
|
});
|
|
283
|
-
}); }, "aria-label": "Copier la plaque", children: (0, jsx_runtime_1.jsx)(
|
|
284
|
+
}); }, "aria-label": "Copier la plaque", children: (0, jsx_runtime_1.jsx)(ContentCopy_1.default, { sx: { fontSize: 14, color: "text.disabled" } }) })] })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { display: "flex", flexDirection: "row", alignItems: "flex-end", gap: 1 }, children: [onDelete && ((0, jsx_runtime_1.jsx)(material_1.Button, { variant: "outlined", color: "error", size: "small", onClick: function (e) { return handleOnClickDeleteVehicle(e); }, children: "Supprimer" })), !localEditMode && ((0, jsx_runtime_1.jsx)(material_1.Button, { onClick: handleOnClickEdit, size: "small", variant: "outlined", startIcon: (0, jsx_runtime_1.jsx)(EditRounded_1.default, { sx: { fontSize: "14px !important" } }), sx: {
|
|
284
285
|
fontSize: 12,
|
|
285
286
|
borderColor: "divider",
|
|
286
287
|
}, children: "Modifier" }))] })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { px: 2, py: 1.5, borderBottom: "0.5px solid", borderColor: "divider" }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", sx: sectionTitleSx, children: "Kilom\u00E9trage" }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 1 }, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { bgcolor: "grey.50", borderRadius: 1, p: 1.25 }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "caption", color: "text.secondary", display: "block", children: "Actuel" }), !localEditMode ? ((0, jsx_runtime_1.jsxs)(material_1.Typography, { variant: "body1", fontWeight: 500, children: [(_b = vehicle.currentMileage) !== null && _b !== void 0 ? _b : "-", " ", (0, jsx_runtime_1.jsx)(material_1.Typography, { component: "span", variant: "caption", color: "text.secondary", children: "km" })] })) : ((0, jsx_runtime_1.jsx)(material_1.TextField, { name: "currentMileage", variant: "standard", type: "number", required: true, value: (_c = form.currentMileage.value) !== null && _c !== void 0 ? _c : "", onChange: handleInputChange, error: Boolean(form.currentMileage.error), helperText: Boolean(form.currentMileage.error && form.currentMileage.value > 0)
|
|
@@ -290,7 +291,7 @@ var VehicleFullCard = function (_a) {
|
|
|
290
291
|
case 0: return [4 /*yield*/, navigator.clipboard.writeText(vehicle.vin)];
|
|
291
292
|
case 1: return [2 /*return*/, _a.sent()];
|
|
292
293
|
}
|
|
293
|
-
}); }); }, "aria-label": "Copier le VIN", children: (0, jsx_runtime_1.jsx)(
|
|
294
|
+
}); }); }, "aria-label": "Copier le VIN", children: (0, jsx_runtime_1.jsx)(ContentCopy_1.default, { sx: { fontSize: 13, color: "text.disabled" } }) })] })] })), vehicle.energy && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: rowSx, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", color: "text.secondary", children: "\u00C9nergie" }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", fontWeight: 500, children: vehicle.energy })] })), vehicle.gearboxType && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: rowSx, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", color: "text.secondary", children: "Type bo\u00EEte" }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", fontWeight: 500, children: vehicle.gearboxType })] })), vehicle.gearboxCode && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: rowSx, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", color: "text.secondary", children: "Code bo\u00EEte" }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", fontWeight: 500, children: vehicle.gearboxCode })] })), vehicle.engineCode && ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: rowSx, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", color: "text.secondary", children: "Code moteur" }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", fontWeight: 500, children: vehicle.engineCode })] }))] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { px: 2, py: 1.5, borderBottom: "0.5px solid", borderColor: "divider" }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", sx: sectionTitleSx, children: "Pneumatiques" }), !localEditMode ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: rowSx, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", color: "text.secondary", children: isVehicleSecondaryTireSizeDefined(vehicle) ? "Avant" : "Taille" }), isVehicleTireSizeDefined(vehicle) ? ((0, jsx_runtime_1.jsx)(material_1.Chip, { label: (0, Tools_1.formatVehicleTire)(vehicle.tireSize), size: "small", color: "primary", sx: {
|
|
294
295
|
fontWeight: 500,
|
|
295
296
|
fontSize: 12,
|
|
296
297
|
height: 24,
|
|
@@ -330,7 +331,7 @@ var VehicleFullCard = function (_a) {
|
|
|
330
331
|
px: 1.5,
|
|
331
332
|
py: 0.75,
|
|
332
333
|
mb: 0.75,
|
|
333
|
-
}, children: [(0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: invoice.originalFileName, children: (0, jsx_runtime_1.jsx)(material_1.Link, { href: invoice.fileSignedUrl, target: "_blank", rel: "noopener", underline: "hover", sx: { fontSize: 13, color: "#185FA5", flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", fontFamily: "Outfit" }, children: invoice.fileName }) }), (0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "small", disabled: !(invoice.ownerId.toString() === currentUser.id), onClick: function (e) { return handleDeleteDocument(e, invoice === null || invoice === void 0 ? void 0 : invoice.id); }, sx: { ml: 1, flexShrink: 0 }, children: (0, jsx_runtime_1.jsx)(CloseRounded_1.default, { sx: { fontSize: 16 } }) })] }, index + 1)); }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { mt: 1.5 }, children: [(0, jsx_runtime_1.jsx)("input", { accept: "image/*, application/pdf", type: "file", style: { display: "none" }, ref: invoiceInputRef, id: "raised-button-invoice", onChange: function (e) { return handleFileChange(e, docTypeCurrent.current); } }), (0, jsx_runtime_1.jsx)(material_1.Button, { fullWidth: true, size: "medium", disabled: currentUpload, onClick: function () { return setShowLinkedDocument(true); }, component: "span", variant: "outlined", startIcon: (0, jsx_runtime_1.jsx)(
|
|
334
|
+
}, children: [(0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: invoice.originalFileName, children: (0, jsx_runtime_1.jsx)(material_1.Link, { href: invoice.fileSignedUrl, target: "_blank", rel: "noopener", underline: "hover", sx: { fontSize: 13, color: "#185FA5", flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", fontFamily: "Outfit" }, children: invoice.fileName }) }), (0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "small", disabled: !(invoice.ownerId.toString() === currentUser.id), onClick: function (e) { return handleDeleteDocument(e, invoice === null || invoice === void 0 ? void 0 : invoice.id); }, sx: { ml: 1, flexShrink: 0 }, children: (0, jsx_runtime_1.jsx)(CloseRounded_1.default, { sx: { fontSize: 16 } }) })] }, index + 1)); }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { mt: 1.5 }, children: [(0, jsx_runtime_1.jsx)("input", { accept: "image/*, application/pdf", type: "file", style: { display: "none" }, ref: invoiceInputRef, id: "raised-button-invoice", onChange: function (e) { return handleFileChange(e, docTypeCurrent.current); } }), (0, jsx_runtime_1.jsx)(material_1.Button, { fullWidth: true, size: "medium", disabled: currentUpload, onClick: function () { return setShowLinkedDocument(true); }, component: "span", variant: "outlined", startIcon: (0, jsx_runtime_1.jsx)(AttachFile_1.default, {}), sx: {
|
|
334
335
|
border: "1.5px dashed",
|
|
335
336
|
borderColor: "divider",
|
|
336
337
|
color: "text.secondary",
|
package/package.json
CHANGED
|
@@ -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";
|