@movalib/movalib-commons 1.0.89 → 1.0.91
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/index.d.ts +1 -1
- package/dist/index.js +3 -2
- package/dist/src/helpers/Enums.d.ts +6 -6
- package/dist/src/helpers/Enums.js +6 -6
- package/dist/src/helpers/Tools.d.ts +2 -0
- package/dist/src/helpers/Tools.js +16 -1
- package/index.ts +1 -1
- package/package.json +1 -1
- package/src/helpers/Enums.ts +6 -6
- package/src/helpers/Tools.ts +15 -0
package/dist/index.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export type { APIRequest, APIResponse } from './src/helpers/ApiHelper';
|
|
|
36
36
|
export type { DaySchedule, DayInterval } from './src/ScheduleFields';
|
|
37
37
|
export type { MovaFormField, MovaLoginForm, MovaUserSignUpForm, MovaInterval, MovaVehicleForm, AddressFieldName } from './src/helpers/Types';
|
|
38
38
|
export { readCookie, deleteCookie } from './src/helpers/CookieUtils';
|
|
39
|
-
export { validateField, formatVehicleTire, formatFrenchVehiclePlate, isEmpty } from './src/helpers/Tools';
|
|
39
|
+
export { validateField, formatVehicleTire, formatFrenchVehiclePlate, isEmpty, getApplicationShortLabel } from './src/helpers/Tools';
|
|
40
40
|
export { validatePhoneNumber, validateText, validateEmail } from './src/helpers/Validator';
|
|
41
41
|
export { formatDateByCountryCode, getLongFormattedDateTime, capitalizeFirstLetter } from './src/helpers/DateUtils';
|
|
42
42
|
export { RoleType, MovaAppType, DayOfWeek, EventState, EventType, DocumentType, DigitalPassportIndex, DocumentState, Gender, DateFormatTypes, PartsApplicationType, ProductType, OrderPreference, OrderState } from './src/helpers/Enums';
|
package/dist/index.js
CHANGED
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
8
|
-
exports.OrderState = exports.OrderPreference = exports.ProductType = exports.PartsApplicationType = exports.DateFormatTypes = exports.Gender = exports.DocumentState = exports.DigitalPassportIndex = exports.DocumentType = exports.EventType = void 0;
|
|
7
|
+
exports.DayOfWeek = exports.MovaAppType = exports.RoleType = exports.capitalizeFirstLetter = exports.getLongFormattedDateTime = exports.formatDateByCountryCode = exports.validateEmail = exports.validateText = exports.validatePhoneNumber = exports.getApplicationShortLabel = exports.isEmpty = exports.formatFrenchVehiclePlate = exports.formatVehicleTire = exports.validateField = exports.deleteCookie = exports.readCookie = exports.VehicleTire = exports.Event = exports.Schedule = exports.Garage = exports.Document = exports.Vehicle = exports.Address = exports.Role = exports.User = exports.Customer = exports.Logger = exports.Operation = exports.Prestation = exports.Product = exports.Supplier = exports.GenderSelector = exports.ConfirmationDialog = exports.MovaVehicleTireField = exports.MovaCopyright = exports.MovaSignUp = exports.MovaLogin = exports.MovaSnackbar = exports.TestButton = exports.VehiclePlateField = exports.QRCode = exports.MovaDialog = exports.Loader = exports.MovaDigitalPassport = exports.VehicleFullCard = exports.ScheduleFields = exports.AddressFields = exports.UserService = exports.GarageService = exports.AuthenticationService = void 0;
|
|
8
|
+
exports.OrderState = exports.OrderPreference = exports.ProductType = exports.PartsApplicationType = exports.DateFormatTypes = exports.Gender = exports.DocumentState = exports.DigitalPassportIndex = exports.DocumentType = exports.EventType = exports.EventState = void 0;
|
|
9
9
|
// Export des services
|
|
10
10
|
var AuthenticationService_1 = require("./src/services/AuthenticationService");
|
|
11
11
|
Object.defineProperty(exports, "AuthenticationService", { enumerable: true, get: function () { return __importDefault(AuthenticationService_1).default; } });
|
|
@@ -86,6 +86,7 @@ Object.defineProperty(exports, "validateField", { enumerable: true, get: functio
|
|
|
86
86
|
Object.defineProperty(exports, "formatVehicleTire", { enumerable: true, get: function () { return Tools_1.formatVehicleTire; } });
|
|
87
87
|
Object.defineProperty(exports, "formatFrenchVehiclePlate", { enumerable: true, get: function () { return Tools_1.formatFrenchVehiclePlate; } });
|
|
88
88
|
Object.defineProperty(exports, "isEmpty", { enumerable: true, get: function () { return Tools_1.isEmpty; } });
|
|
89
|
+
Object.defineProperty(exports, "getApplicationShortLabel", { enumerable: true, get: function () { return Tools_1.getApplicationShortLabel; } });
|
|
89
90
|
var Validator_1 = require("./src/helpers/Validator");
|
|
90
91
|
Object.defineProperty(exports, "validatePhoneNumber", { enumerable: true, get: function () { return Validator_1.validatePhoneNumber; } });
|
|
91
92
|
Object.defineProperty(exports, "validateText", { enumerable: true, get: function () { return Validator_1.validateText; } });
|
|
@@ -15,12 +15,12 @@ export declare enum ProductType {
|
|
|
15
15
|
CONSUMABLE = "CONSUMABLE"
|
|
16
16
|
}
|
|
17
17
|
export declare enum PartsApplicationType {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
FRONT = "FT",
|
|
19
|
+
REAR = "RR",
|
|
20
|
+
FRONT_REAR = "FTRR",
|
|
21
|
+
LEFT = "LT",
|
|
22
|
+
RIGHT = "RT",
|
|
23
|
+
LEFT_RIGHT = "LTRT"
|
|
24
24
|
}
|
|
25
25
|
export declare enum APIMethod {
|
|
26
26
|
GET = "GET",
|
|
@@ -22,12 +22,12 @@ var ProductType;
|
|
|
22
22
|
})(ProductType = exports.ProductType || (exports.ProductType = {}));
|
|
23
23
|
var PartsApplicationType;
|
|
24
24
|
(function (PartsApplicationType) {
|
|
25
|
-
PartsApplicationType["
|
|
26
|
-
PartsApplicationType["
|
|
27
|
-
PartsApplicationType["
|
|
28
|
-
PartsApplicationType["
|
|
29
|
-
PartsApplicationType["
|
|
30
|
-
PartsApplicationType["
|
|
25
|
+
PartsApplicationType["FRONT"] = "FT";
|
|
26
|
+
PartsApplicationType["REAR"] = "RR";
|
|
27
|
+
PartsApplicationType["FRONT_REAR"] = "FTRR";
|
|
28
|
+
PartsApplicationType["LEFT"] = "LT";
|
|
29
|
+
PartsApplicationType["RIGHT"] = "RT";
|
|
30
|
+
PartsApplicationType["LEFT_RIGHT"] = "LTRT";
|
|
31
31
|
})(PartsApplicationType = exports.PartsApplicationType || (exports.PartsApplicationType = {}));
|
|
32
32
|
var APIMethod;
|
|
33
33
|
(function (APIMethod) {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import VehicleTire from "../models/VehicleTire";
|
|
2
2
|
import { MovaFormField } from "./Types";
|
|
3
3
|
import { CSSProperties } from "react";
|
|
4
|
+
import { PartsApplicationType } from "./Enums";
|
|
5
|
+
export declare const getApplicationShortLabel: (application: PartsApplicationType | undefined) => "" | "AV" | "AR" | "AV + AR" | "G" | "D" | "G + D";
|
|
4
6
|
export declare const flexEnd: CSSProperties;
|
|
5
7
|
export declare const flexCenter: CSSProperties;
|
|
6
8
|
export declare const isEmpty: (data: Object) => boolean;
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateField = exports.formatVehicleTireStr = exports.formatVehicleTire = exports.formatFrenchVehiclePlate = exports.isEmpty = exports.flexCenter = exports.flexEnd = void 0;
|
|
3
|
+
exports.validateField = exports.formatVehicleTireStr = exports.formatVehicleTire = exports.formatFrenchVehiclePlate = exports.isEmpty = exports.flexCenter = exports.flexEnd = exports.getApplicationShortLabel = void 0;
|
|
4
|
+
var Enums_1 = require("./Enums");
|
|
5
|
+
var getApplicationShortLabel = function (application) {
|
|
6
|
+
if (application) {
|
|
7
|
+
switch (application) {
|
|
8
|
+
case Enums_1.PartsApplicationType.FRONT: return "AV";
|
|
9
|
+
case Enums_1.PartsApplicationType.REAR: return "AR";
|
|
10
|
+
case Enums_1.PartsApplicationType.FRONT_REAR: return "AV + AR";
|
|
11
|
+
case Enums_1.PartsApplicationType.LEFT: return "G";
|
|
12
|
+
case Enums_1.PartsApplicationType.RIGHT: return "D";
|
|
13
|
+
case Enums_1.PartsApplicationType.LEFT_RIGHT: return "G + D";
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return "";
|
|
17
|
+
};
|
|
18
|
+
exports.getApplicationShortLabel = getApplicationShortLabel;
|
|
4
19
|
exports.flexEnd = {
|
|
5
20
|
display: 'flex',
|
|
6
21
|
justifyContent: 'end',
|
package/index.ts
CHANGED
|
@@ -48,7 +48,7 @@ export type { MovaFormField, MovaLoginForm, MovaUserSignUpForm, MovaInterval,
|
|
|
48
48
|
|
|
49
49
|
// Export des méthodes utilitaires
|
|
50
50
|
export { readCookie, deleteCookie } from './src/helpers/CookieUtils';
|
|
51
|
-
export { validateField, formatVehicleTire, formatFrenchVehiclePlate, isEmpty } from './src/helpers/Tools';
|
|
51
|
+
export { validateField, formatVehicleTire, formatFrenchVehiclePlate, isEmpty, getApplicationShortLabel } from './src/helpers/Tools';
|
|
52
52
|
export { validatePhoneNumber, validateText, validateEmail } from './src/helpers/Validator';
|
|
53
53
|
export { formatDateByCountryCode, getLongFormattedDateTime, capitalizeFirstLetter } from './src/helpers/DateUtils';
|
|
54
54
|
|
package/package.json
CHANGED
package/src/helpers/Enums.ts
CHANGED
|
@@ -18,12 +18,12 @@ export enum ProductType {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export enum PartsApplicationType {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
FRONT = 'FT',
|
|
22
|
+
REAR = 'RR',
|
|
23
|
+
FRONT_REAR = "FTRR",
|
|
24
|
+
LEFT = "LT",
|
|
25
|
+
RIGHT = "RT",
|
|
26
|
+
LEFT_RIGHT = "LTRT"
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export enum APIMethod {
|
package/src/helpers/Tools.ts
CHANGED
|
@@ -2,6 +2,21 @@ import Cookies from "js-cookie";
|
|
|
2
2
|
import VehicleTire from "../models/VehicleTire";
|
|
3
3
|
import { MovaFormField } from "./Types";
|
|
4
4
|
import { CSSProperties } from "react";
|
|
5
|
+
import { PartsApplicationType } from "./Enums";
|
|
6
|
+
|
|
7
|
+
export const getApplicationShortLabel = (application:PartsApplicationType | undefined) => {
|
|
8
|
+
if(application){
|
|
9
|
+
switch(application){
|
|
10
|
+
case PartsApplicationType.FRONT: return "AV";
|
|
11
|
+
case PartsApplicationType.REAR: return "AR";
|
|
12
|
+
case PartsApplicationType.FRONT_REAR: return "AV + AR";
|
|
13
|
+
case PartsApplicationType.LEFT: return "G";
|
|
14
|
+
case PartsApplicationType.RIGHT: return "D";
|
|
15
|
+
case PartsApplicationType.LEFT_RIGHT: return "G + D";
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return "";
|
|
19
|
+
}
|
|
5
20
|
|
|
6
21
|
export const flexEnd:CSSProperties = {
|
|
7
22
|
display: 'flex',
|