@movalib/movalib-commons 1.41.0 → 1.42.0

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 CHANGED
@@ -44,7 +44,7 @@ export type { APIRequest, APIResponse } from './src/helpers/ApiHelper';
44
44
  export type { DaySchedule, DayInterval } from './src/ScheduleFields';
45
45
  export type { MovaFormField, MovaLoginForm, MovaUserSignUpForm, MovaInterval, MovaVehicleForm, AddressFieldName } from './src/helpers/Types';
46
46
  export { readCookie, deleteCookie } from './src/helpers/CookieUtils';
47
- export { validateField, formatVehicleTire, formatFrenchVehiclePlate, isEmpty, getApplicationShortLabel, capitalizeFirstLetter, flexLeftRow, formatPhoneNumber, getFormattedSchedule, getFormattedIntervals, findScheduleByDayOfWeek, getDayOfWeekLabel, isSafariOniOS } from './src/helpers/Tools';
47
+ export { validateField, formatVehicleTire, formatFrenchVehiclePlate, isEmpty, getApplicationShortLabel, capitalizeFirstLetter, flexLeftRow, formatPhoneNumber, getFormattedSchedule, getFormattedIntervals, findScheduleByDayOfWeek, getDayOfWeekLabel, isSafariOniOS, getApplicationsShortLabels } from './src/helpers/Tools';
48
48
  export { validatePhoneNumber, validateText, validateEmail } from './src/helpers/Validator';
49
49
  export { formatDateByCountryCode, getLongFormattedDateTime } from './src/helpers/DateUtils';
50
50
  export { request, API_BASE_URL, } from './src/helpers/ApiHelper';
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  };
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.capitalizeFirstLetter = 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.Employee = exports.Absence = exports.Subscription = 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.AccountValidation = exports.GaragePLV = exports.IbanInput = exports.DialogForgotPassword = exports.UserService = exports.GarageService = exports.AuthenticationService = exports.VehicleService = void 0;
8
- exports.APIMethod = exports.SubscriptionType = exports.SubscriptionState = exports.CountryCode = exports.PrestationState = exports.PrestationType = exports.RegistrationState = exports.SubscriptionPaymentInterval = exports.VehiclePlateType = exports.SlotAlgorithm = exports.OrderState = exports.OrderPreference = exports.ProductType = exports.PartsApplicationType = exports.DateFormatTypes = exports.Gender = exports.DocumentState = exports.DigitalPassportIndex = exports.DocumentType = exports.EventType = exports.EventState = exports.DayOfWeek = exports.MovaAppType = exports.RoleType = exports.API_BASE_URL = exports.request = exports.getLongFormattedDateTime = exports.formatDateByCountryCode = exports.validateEmail = exports.validateText = exports.validatePhoneNumber = exports.isSafariOniOS = exports.getDayOfWeekLabel = exports.findScheduleByDayOfWeek = exports.getFormattedIntervals = exports.getFormattedSchedule = exports.formatPhoneNumber = exports.flexLeftRow = void 0;
8
+ exports.APIMethod = exports.SubscriptionType = exports.SubscriptionState = exports.CountryCode = exports.PrestationState = exports.PrestationType = exports.RegistrationState = exports.SubscriptionPaymentInterval = exports.VehiclePlateType = exports.SlotAlgorithm = exports.OrderState = exports.OrderPreference = exports.ProductType = exports.PartsApplicationType = exports.DateFormatTypes = exports.Gender = exports.DocumentState = exports.DigitalPassportIndex = exports.DocumentType = exports.EventType = exports.EventState = exports.DayOfWeek = exports.MovaAppType = exports.RoleType = exports.API_BASE_URL = exports.request = exports.getLongFormattedDateTime = exports.formatDateByCountryCode = exports.validateEmail = exports.validateText = exports.validatePhoneNumber = exports.getApplicationsShortLabels = exports.isSafariOniOS = exports.getDayOfWeekLabel = exports.findScheduleByDayOfWeek = exports.getFormattedIntervals = exports.getFormattedSchedule = exports.formatPhoneNumber = exports.flexLeftRow = void 0;
9
9
  // Export des services
10
10
  var VehicleService_1 = require("./src/services/VehicleService");
11
11
  Object.defineProperty(exports, "VehicleService", { enumerable: true, get: function () { return __importDefault(VehicleService_1).default; } });
@@ -111,6 +111,7 @@ Object.defineProperty(exports, "getFormattedIntervals", { enumerable: true, get:
111
111
  Object.defineProperty(exports, "findScheduleByDayOfWeek", { enumerable: true, get: function () { return Tools_1.findScheduleByDayOfWeek; } });
112
112
  Object.defineProperty(exports, "getDayOfWeekLabel", { enumerable: true, get: function () { return Tools_1.getDayOfWeekLabel; } });
113
113
  Object.defineProperty(exports, "isSafariOniOS", { enumerable: true, get: function () { return Tools_1.isSafariOniOS; } });
114
+ Object.defineProperty(exports, "getApplicationsShortLabels", { enumerable: true, get: function () { return Tools_1.getApplicationsShortLabels; } });
114
115
  var Validator_1 = require("./src/helpers/Validator");
115
116
  Object.defineProperty(exports, "validatePhoneNumber", { enumerable: true, get: function () { return Validator_1.validatePhoneNumber; } });
116
117
  Object.defineProperty(exports, "validateText", { enumerable: true, get: function () { return Validator_1.validateText; } });
@@ -3,6 +3,7 @@ import { MovaFormField, MovaInterval } from "./Types";
3
3
  import { CSSProperties } from "react";
4
4
  import { DayOfWeek, PartsApplicationType } from "./Enums";
5
5
  import Schedule from "../models/Schedule";
6
+ export declare const getApplicationsShortLabels: (applications: PartsApplicationType[] | undefined) => string;
6
7
  export declare const flexStart: CSSProperties;
7
8
  export declare const isSafariOniOS: () => boolean;
8
9
  export declare const FR_WEEK_DAYS: string[];
@@ -1,7 +1,14 @@
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 = exports.getApplicationShortLabel = exports.capitalizeFirstLetter = exports.flexLeftRow = exports.getFrenchDayLabel = exports.getDayOfWeek = exports.findScheduleByDayOfWeek = exports.formatTime = exports.getFormattedIntervals = exports.getFormattedSchedule = exports.formatPhoneNumber = exports.getDayOfWeekIndex = exports.getDayOfWeekLabel = exports.FR_WEEK_DAYS = exports.isSafariOniOS = exports.flexStart = void 0;
3
+ exports.validateField = exports.formatVehicleTireStr = exports.formatVehicleTire = exports.formatFrenchVehiclePlate = exports.isEmpty = exports.flexCenter = exports.flexEnd = exports.getApplicationShortLabel = exports.capitalizeFirstLetter = exports.flexLeftRow = exports.getFrenchDayLabel = exports.getDayOfWeek = exports.findScheduleByDayOfWeek = exports.formatTime = exports.getFormattedIntervals = exports.getFormattedSchedule = exports.formatPhoneNumber = exports.getDayOfWeekIndex = exports.getDayOfWeekLabel = exports.FR_WEEK_DAYS = exports.isSafariOniOS = exports.flexStart = exports.getApplicationsShortLabels = void 0;
4
4
  var Enums_1 = require("./Enums");
5
+ var getApplicationsShortLabels = function (applications) {
6
+ if (!applications) {
7
+ return '';
8
+ }
9
+ return applications.map(exports.getApplicationShortLabel).join(' + ');
10
+ };
11
+ exports.getApplicationsShortLabels = getApplicationsShortLabels;
5
12
  exports.flexStart = {
6
13
  display: 'flex',
7
14
  justifyContent: 'start',
@@ -24,5 +24,6 @@ export default class Prestation {
24
24
  position: number;
25
25
  active: boolean;
26
26
  state: PrestationState;
27
- constructor(id: number, code: string, name: string, description: string, category: string, downtime: number, appointmentDelay: number, position: number, active: boolean, state: PrestationState, operations?: Operation[]);
27
+ multipleApplication: boolean;
28
+ constructor(id: number, code: string, name: string, description: string, category: string, downtime: number, appointmentDelay: number, position: number, active: boolean, state: PrestationState, multipleApplication: boolean, operations?: Operation[]);
28
29
  }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var Prestation = /** @class */ (function () {
4
- function Prestation(id, code, name, description, category, downtime, appointmentDelay, position, active, state, operations) {
4
+ function Prestation(id, code, name, description, category, downtime, appointmentDelay, position, active, state, multipleApplication, operations) {
5
5
  this.id = id;
6
6
  this.code = code;
7
7
  this.name = name;
@@ -11,6 +11,7 @@ var Prestation = /** @class */ (function () {
11
11
  this.appointmentDelay = appointmentDelay;
12
12
  this.position = position;
13
13
  this.active = active;
14
+ this.multipleApplication = multipleApplication;
14
15
  this.operations = operations;
15
16
  this.state = state;
16
17
  }
package/index.ts CHANGED
@@ -58,7 +58,7 @@ export type { MovaFormField, MovaLoginForm, MovaUserSignUpForm, MovaInterval,
58
58
  export { readCookie, deleteCookie } from './src/helpers/CookieUtils';
59
59
  export { validateField, formatVehicleTire, formatFrenchVehiclePlate, isEmpty, getApplicationShortLabel,
60
60
  capitalizeFirstLetter, flexLeftRow, formatPhoneNumber, getFormattedSchedule, getFormattedIntervals,
61
- findScheduleByDayOfWeek, getDayOfWeekLabel, isSafariOniOS } from './src/helpers/Tools';
61
+ findScheduleByDayOfWeek, getDayOfWeekLabel, isSafariOniOS, getApplicationsShortLabels } from './src/helpers/Tools';
62
62
  export { validatePhoneNumber, validateText, validateEmail } from './src/helpers/Validator';
63
63
  export { formatDateByCountryCode, getLongFormattedDateTime } from './src/helpers/DateUtils';
64
64
  export { request, API_BASE_URL, } from './src/helpers/ApiHelper';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movalib/movalib-commons",
3
- "version": "1.41.0",
3
+ "version": "1.42.0",
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",
@@ -5,6 +5,14 @@ import { CSSProperties } from "react";
5
5
  import { DayOfWeek, PartsApplicationType, VehiclePlateFormat } from "./Enums";
6
6
  import Schedule from "../models/Schedule";
7
7
 
8
+ export const getApplicationsShortLabels = (applications: PartsApplicationType[] | undefined): string => {
9
+ if(!applications) {
10
+ return '';
11
+ }
12
+
13
+ return applications.map(getApplicationShortLabel).join(' + ');
14
+ };
15
+
8
16
  export const flexStart:CSSProperties = {
9
17
  display: 'flex',
10
18
  justifyContent: 'start',
@@ -29,9 +29,11 @@ export default class Prestation {
29
29
  active:boolean;
30
30
 
31
31
  state: PrestationState;
32
+
33
+ multipleApplication: boolean;
32
34
 
33
35
  constructor(id:number, code: string, name:string, description: string, category:string,
34
- downtime:number, appointmentDelay: number, position: number, active: boolean, state: PrestationState, operations?: Operation[]) {
36
+ downtime:number, appointmentDelay: number, position: number, active: boolean, state: PrestationState, multipleApplication: boolean, operations?: Operation[]) {
35
37
  this.id = id;
36
38
  this.code = code;
37
39
  this.name = name;
@@ -41,6 +43,7 @@ export default class Prestation {
41
43
  this.appointmentDelay = appointmentDelay;
42
44
  this.position = position;
43
45
  this.active = active;
46
+ this.multipleApplication = multipleApplication;
44
47
  this.operations = operations;
45
48
  this.state = state;
46
49
  }