@movalib/movalib-commons 1.59.17 → 1.59.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.
@@ -8,6 +8,7 @@ type ConfirmationDialogProps = DialogProps & {
8
8
  closeLabel?: string;
9
9
  title?: React.ReactNode;
10
10
  message?: React.ReactNode;
11
+ autoFocus?: boolean;
11
12
  };
12
13
  declare const ConfirmationDialog: FunctionComponent<ConfirmationDialogProps>;
13
14
  export default ConfirmationDialog;
@@ -35,7 +35,7 @@ var Button_1 = __importDefault(require("@mui/material/Button"));
35
35
  var material_1 = require("@mui/material");
36
36
  var Tools_1 = require("./helpers/Tools");
37
37
  var ConfirmationDialog = function (_a) {
38
- var open = _a.open, onClose = _a.onClose, onConfirm = _a.onConfirm, title = _a.title, message = _a.message, _b = _a.showConfirm, showConfirm = _b === void 0 ? true : _b, confirmLabel = _a.confirmLabel, closeLabel = _a.closeLabel, dialogProps = __rest(_a, ["open", "onClose", "onConfirm", "title", "message", "showConfirm", "confirmLabel", "closeLabel"]);
38
+ var open = _a.open, onClose = _a.onClose, onConfirm = _a.onConfirm, title = _a.title, message = _a.message, _b = _a.showConfirm, showConfirm = _b === void 0 ? true : _b, confirmLabel = _a.confirmLabel, closeLabel = _a.closeLabel, _c = _a.autoFocus, autoFocus = _c === void 0 ? true : _c, dialogProps = __rest(_a, ["open", "onClose", "onConfirm", "title", "message", "showConfirm", "confirmLabel", "closeLabel", "autoFocus"]);
39
39
  var theme = (0, material_1.useTheme)();
40
40
  var defaultMessage = "Êtes-vous sûr de vouloir continuer ?";
41
41
  var defaultTitle = "Confirmation";
@@ -46,6 +46,6 @@ var ConfirmationDialog = function (_a) {
46
46
  }, style: Tools_1.flexLeftRow }, { children: title || defaultTitle })), (0, jsx_runtime_1.jsx)(DialogContent_1.default, __assign({ sx: { textAlign: 'center' } }, { children: (0, jsx_runtime_1.jsx)(DialogContentText_1.default, __assign({ id: "alert-dialog-description", sx: { pt: 2 } }, { children: message || defaultMessage })) })), (0, jsx_runtime_1.jsxs)(DialogActions_1.default, __assign({ sx: {
47
47
  py: 1,
48
48
  backgroundColor: theme.palette.grey[200]
49
- } }, { children: [showConfirm && (0, jsx_runtime_1.jsx)(Button_1.default, __assign({ onClick: onConfirm, color: "inherit", autoFocus: true, sx: { ml: 1 } }, { children: (0, jsx_runtime_1.jsx)("b", { children: confirmLabel || defaultConfirmLabel }) })), (0, jsx_runtime_1.jsx)(Button_1.default, __assign({ onClick: onClose, color: "inherit" }, { children: closeLabel || defaultCloseLabel }))] }))] })));
49
+ } }, { children: [showConfirm && (0, jsx_runtime_1.jsx)(Button_1.default, __assign({ onClick: onConfirm, color: "inherit", autoFocus: autoFocus, sx: { ml: 1 } }, { children: (0, jsx_runtime_1.jsx)("b", { children: confirmLabel || defaultConfirmLabel }) })), (0, jsx_runtime_1.jsx)(Button_1.default, __assign({ onClick: onClose, color: "inherit" }, { children: closeLabel || defaultCloseLabel }))] }))] })));
50
50
  };
51
51
  exports.default = ConfirmationDialog;
@@ -31,7 +31,6 @@ var MovaVehicleTireField = function (_a) {
31
31
  setError(!regex.test(value));
32
32
  // Vérifier si l'utilisateur est en train de supprimer un caractère
33
33
  var isDeleting = rawValue.length < lastLength;
34
- console.log(isDeleting);
35
34
  // Ajout du " / "
36
35
  if (value.length >= 3 && !(rawValue.length == 5 && isDeleting)) {
37
36
  value = "".concat(value.substring(0, 3), " / ").concat(value.substring(3));
@@ -68,18 +67,15 @@ var MovaVehicleTireField = function (_a) {
68
67
  }
69
68
  var parts = value.split(" ");
70
69
  setTireInfo(value);
71
- console.log(parts);
72
70
  if (value.length >= 16) {
73
71
  var width = parts[0], _separator = parts[1], height = parts[2], diameter = parts[3], speedIndex = parts[4];
74
72
  speedIndex = value.substring(13);
75
- console.log('YYY', width, height, diameter, speedIndex, _separator);
76
73
  var vehicleTire_1 = new VehicleTire_1.default(width, height, diameter, speedIndex);
77
74
  onChangeVehicleTire(vehicleTire_1, isValid);
78
75
  }
79
76
  else {
80
77
  var width = parts[0], _separator = parts[1], height = parts[2], diameter = parts[3], speedIndex = parts[4];
81
78
  speedIndex = value.substring(13);
82
- console.log('XXX', width, height, diameter, speedIndex, _separator);
83
79
  var vehicleTire_2 = new VehicleTire_1.default(width !== null && width !== void 0 ? width : '', height !== null && height !== void 0 ? height : '', diameter !== null && diameter !== void 0 ? diameter : '', speedIndex !== null && speedIndex !== void 0 ? speedIndex : '');
84
80
  onChangeVehicleTire(vehicleTire_2, isValid);
85
81
  }
@@ -17,7 +17,9 @@ export default class GarageService {
17
17
  static sendGarageMandate(garageId: string): Promise<APIResponse<string>>;
18
18
  static getGarageAllData(garageId: string): Promise<APIResponse<Garage>>;
19
19
  static createGaragePrestationRequest(garageId: string, req: any): Promise<APIResponse<string>>;
20
- static getGarageSettings(garageId: string): Promise<APIResponse<Garage>>;
20
+ static getGarageSettings({ garageId }: {
21
+ garageId: string;
22
+ }): Promise<APIResponse<Garage>>;
21
23
  static uploadLogo(garageId: string, formData: FormData): Promise<APIResponse<string>>;
22
24
  static sendAppointmentVehicleAvailable(garageId: string, eventId: string): Promise<APIResponse<string>>;
23
25
  static enableGaragePrestation(garageId: string, prestationId: string): Promise<APIResponse<string>>;
@@ -121,7 +121,8 @@ var GarageService = /** @class */ (function () {
121
121
  body: JSON.stringify(req),
122
122
  });
123
123
  };
124
- GarageService.getGarageSettings = function (garageId) {
124
+ GarageService.getGarageSettings = function (_a) {
125
+ var garageId = _a.garageId;
125
126
  return (0, ApiHelper_1.request)({
126
127
  url: "".concat(ApiHelper_1.API_BASE_URL, "/garage/").concat(garageId, "/settings"),
127
128
  method: Enums_1.APIMethod.GET,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movalib/movalib-commons",
3
- "version": "1.59.17",
3
+ "version": "1.59.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",
@@ -16,10 +16,11 @@ type ConfirmationDialogProps = DialogProps & {
16
16
  closeLabel?: string;
17
17
  title?: React.ReactNode;
18
18
  message?: React.ReactNode;
19
+ autoFocus?: boolean;
19
20
  }
20
21
 
21
22
  const ConfirmationDialog: FunctionComponent<ConfirmationDialogProps> = ({ open, onClose, onConfirm, title, message, showConfirm = true,
22
- confirmLabel, closeLabel, ...dialogProps }) => {
23
+ confirmLabel, closeLabel,autoFocus = true, ...dialogProps }) => {
23
24
 
24
25
  const theme = useTheme();
25
26
  const defaultMessage = "Êtes-vous sûr de vouloir continuer ?";
@@ -51,7 +52,7 @@ const ConfirmationDialog: FunctionComponent<ConfirmationDialogProps> = ({ open,
51
52
  backgroundColor: theme.palette.grey[200]
52
53
  }}
53
54
  >
54
- {showConfirm && <Button onClick={onConfirm} color="inherit" autoFocus sx={{ ml: 1}}>
55
+ {showConfirm && <Button onClick={onConfirm} color="inherit" autoFocus={autoFocus} sx={{ ml: 1}}>
55
56
  <b>{confirmLabel || defaultConfirmLabel}</b>
56
57
  </Button>}
57
58
  <Button onClick={onClose} color="inherit">
@@ -149,7 +149,7 @@ export default class GarageService {
149
149
  });
150
150
  }
151
151
 
152
- static getGarageSettings(garageId: string): Promise<APIResponse<Garage>> {
152
+ static getGarageSettings({garageId}: { garageId: string }): Promise<APIResponse<Garage>> {
153
153
  return request({
154
154
  url: `${API_BASE_URL}/garage/${garageId}/settings`,
155
155
  method: APIMethod.GET,