ublo-lib 1.24.2 → 1.24.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"gesco-contact-form.d.ts","sourceRoot":"","sources":["../../../../src/common/components/gesco-contact-form/gesco-contact-form.tsx"],"names":[],"mappings":"AAgBA,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC5B,IAAI,CAAC,EACD,0CAA0C,GAC1C,sDAAsD,GACtD,8CAA8C,CAAC;IAEnD,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IACjC,iBAAiB,CAAC,EAAE;QAClB,EAAE,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC5B,EAAE,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC7B,CAAC;CACH,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,IAAW,EACX,OAAe,EACf,MAAM,EACN,QAAQ,EACR,UAAU,EACV,KAAgB,EAChB,IAAiD,EACjD,QAAQ,EACR,iBAAsB,GACvB,EAAE,KAAK,2CA4PP"}
1
+ {"version":3,"file":"gesco-contact-form.d.ts","sourceRoot":"","sources":["../../../../src/common/components/gesco-contact-form/gesco-contact-form.tsx"],"names":[],"mappings":"AAgBA,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC5B,IAAI,CAAC,EACD,0CAA0C,GAC1C,sDAAsD,GACtD,8CAA8C,CAAC;IAEnD,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IACjC,iBAAiB,CAAC,EAAE;QAClB,EAAE,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC5B,EAAE,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC7B,CAAC;CACH,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,IAAW,EACX,OAAe,EACf,MAAM,EACN,QAAQ,EACR,UAAU,EACV,KAAgB,EAChB,IAAiD,EACjD,QAAQ,EACR,iBAAsB,GACvB,EAAE,KAAK,2CA6PP"}
@@ -62,10 +62,10 @@ export default function GescoContactForm({ lang = "fr", channel = "ESF", resort,
62
62
  throw new Error(result.error);
63
63
  }
64
64
  onSubmit?.(payload);
65
+ Plausible.sendEvent(values, params);
65
66
  setSendSuccess(true);
66
67
  form.reset();
67
68
  setFormKey(formKey + 1);
68
- Plausible.sendEvent(values, params);
69
69
  }
70
70
  catch (e) {
71
71
  // eslint-disable-next-line no-console
@@ -75,10 +75,6 @@ export default function GescoContactForm({ lang = "fr", channel = "ESF", resort,
75
75
  finally {
76
76
  setSubmiting(false);
77
77
  }
78
- setTimeout(() => {
79
- setSubmiting(false);
80
- setSendSuccess(true);
81
- }, 3000);
82
78
  };
83
79
  const checkIfStayIsNeeded = (value) => {
84
80
  const subject = params?.subjects?.find((s) => String(s.id) === value);
@@ -102,5 +98,9 @@ export default function GescoContactForm({ lang = "fr", channel = "ESF", resort,
102
98
  }), disabled: Boolean(error) || loading, required: true }), _jsx(Input, { name: "lastname", type: "text", icon: "User", label: messages.lastname, pattern: ".{2,}", patternError: Messages.format(messages.lengthError, {
103
99
  label: messages.lastname,
104
100
  length: "1",
105
- }), disabled: Boolean(error) || loading, required: true }), _jsx(Input, { name: "email", type: "email", icon: "Mail", label: messages.email, pattern: "[^@\\s]+@[^@\\s]+\\.[^@\\s]+", patternError: messages.emailError, disabled: Boolean(error) || loading, required: true }), _jsxs("div", { className: styles.phoneGroup, children: [_jsx(PhoneCodeSelect, { messages: messages, disabled: Boolean(error) || loading }), _jsx(Input, { name: "phone", type: "phone", className: styles.phoneField, label: messages.phone, inputMode: "numeric", pattern: "[0-9 ]{9,15}$", patternError: messages.phoneError, disabled: Boolean(error) || loading, required: true })] }), _jsx(Select, { name: "country", icon: "Globe", label: messages.country, className: styles.fullWidthField, placeholder: messages.defaultCountry, options: countryOptions, disabled: Boolean(error) || loading, required: true }), needCategory && (_jsx(Select, { name: "category", icon: "Plane", label: messages.category, className: styles.fullWidthField, placeholder: messages.defaultCategory, options: categoryOptions, disabled: Boolean(error) || loading, required: true })), stayNeeded && (_jsxs(_Fragment, { children: [_jsx(Input, { name: "stayFrom", className: styles.stayField, type: "date", label: messages.stayFromDate, placeholder: messages.dateFormat, onValueChange: updateStayToMin, hint: stayFromMax, min: stayMin, max: stayFromMax, disabled: Boolean(error) || loading, extended: true, required: true }), _jsx(Input, { name: "stayTo", className: styles.stayField, type: "date", label: messages.stayToDate, placeholder: messages.dateFormat, onValueChange: updateStayFromMax, hint: stayToMin, min: stayToMin || stayMin, disabled: Boolean(error) || loading, extended: true, required: true })] })), _jsx(Textarea, { name: "message", className: styles.fullWidthField, label: messages.message, disabled: Boolean(error) || loading, required: true, autoSizing: true }), _jsx("div", { className: styles.send, children: _jsxs(Button, { type: "submit", disabled: Boolean(error) || loading || submiting, children: [submiting ? _jsx(Loader, { className: styles.loader }) : _jsx(Icons.Plane, {}), messages.submit] }) }), sendSuccess && (_jsx(Information, { className: styles.response, type: "success", close: hideSuccess, children: messages.sendSucesss })), sendError && (_jsx(Information, { className: styles.response, type: "error", close: hideError, children: messages.sendError })), error && (_jsx(Information, { className: styles.error, type: "warning", children: messages.parametersError }))] }, formKey));
101
+ }), disabled: Boolean(error) || loading, required: true }), _jsx(Input, { name: "email", type: "email", icon: "Mail", label: messages.email, pattern: "[^@\\s]+@[^@\\s]+\\.[^@\\s]+", patternError: messages.emailError, disabled: Boolean(error) || loading, required: true }), _jsxs("div", { className: styles.phoneGroup, children: [_jsx(PhoneCodeSelect, { messages: messages, disabled: Boolean(error) || loading }), _jsx(Input, { name: "phone", type: "phone", className: styles.phoneField, label: messages.phone, inputMode: "numeric", pattern: "[0-9 ]{9,15}$", patternError: messages.phoneError, disabled: Boolean(error) || loading, required: true })] }), _jsx(Select, { name: "country", icon: "Globe", label: messages.country, className: styles.fullWidthField, placeholder: messages.defaultCountry, options: countryOptions, disabled: Boolean(error) || loading, required: true }), needCategory && (_jsx(Select, { name: "category", icon: "Plane", label: messages.category, className: styles.fullWidthField, placeholder: messages.defaultCategory, options: categoryOptions, disabled: Boolean(error) || loading, required: true })), stayNeeded && (_jsxs(_Fragment, { children: [_jsx(Input, { name: "stayFrom", className: styles.stayField, type: "date", label: messages.stayFromDate, placeholder: messages.dateFormat, onValueChange: updateStayToMin, hint: stayFromMax, min: stayMin, max: stayFromMax, disabled: Boolean(error) || loading, patternError: Messages.format(messages.mandatoryError, {
102
+ label: messages.stayFrom,
103
+ }), extended: true, required: true }), _jsx(Input, { name: "stayTo", className: styles.stayField, type: "date", label: messages.stayToDate, placeholder: messages.dateFormat, onValueChange: updateStayFromMax, hint: stayToMin, min: stayToMin || stayMin, disabled: Boolean(error) || loading, patternError: Messages.format(messages.mandatoryError, {
104
+ label: messages.stayTo,
105
+ }), extended: true, required: true })] })), _jsx(Textarea, { name: "message", className: styles.fullWidthField, label: messages.message, disabled: Boolean(error) || loading, required: true, autoSizing: true }), _jsx("div", { className: styles.send, children: _jsxs(Button, { type: "submit", disabled: Boolean(error) || loading || submiting, children: [submiting ? _jsx(Loader, { className: styles.loader }) : _jsx(Icons.Plane, {}), messages.submit] }) }), sendSuccess && (_jsx(Information, { className: styles.response, type: "success", close: hideSuccess, children: messages.sendSucesss })), sendError && (_jsx(Information, { className: styles.response, type: "error", close: hideError, children: messages.sendError })), error && (_jsx(Information, { className: styles.error, type: "warning", children: messages.parametersError }))] }, formKey));
106
106
  }
@@ -26,6 +26,7 @@ declare const fr: {
26
26
  emailError: string;
27
27
  phoneError: string;
28
28
  lengthError: string;
29
+ mandatoryError: string;
29
30
  };
30
31
  export declare function get(lang: "fr" | "en", overrides?: {}): Record<keyof typeof fr, string>;
31
32
  export declare function format(value: string, params: Record<string, string>): string;
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../../../src/common/components/gesco-contact-form/services/messages.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BP,CAAC;AAmCF,wBAAgB,GAAG,CACjB,IAAI,EAAE,IAAI,GAAG,IAAI,EACjB,SAAS,KAAK,GACb,MAAM,CAAC,MAAM,OAAO,EAAE,EAAE,MAAM,CAAC,CAKjC;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,UAKnE"}
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../../../src/common/components/gesco-contact-form/services/messages.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BP,CAAC;AAoCF,wBAAgB,GAAG,CACjB,IAAI,EAAE,IAAI,GAAG,IAAI,EACjB,SAAS,KAAK,GACb,MAAM,CAAC,MAAM,OAAO,EAAE,EAAE,MAAM,CAAC,CAKjC;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,UAKnE"}
@@ -26,6 +26,7 @@ const fr = {
26
26
  emailError: 'L\'email doit être au format "john.doe@domaine.com"',
27
27
  phoneError: 'Le téléphone doit être au format "0612345678"',
28
28
  lengthError: '"{label}" doit contenir au moins {length} caractère(s)',
29
+ mandatoryError: '"{label}" est obligatoire',
29
30
  };
30
31
  const en = {
31
32
  subject: "Subject",
@@ -55,6 +56,7 @@ const en = {
55
56
  emailError: 'The email must be in the format "john.doe@domain.com"',
56
57
  phoneError: 'The phone number must be in the following formats: "0612345678" or "555 555 555',
57
58
  lengthError: '"{label}" must contain at least {length} character(s)',
59
+ mandatoryError: '"{label}" is mandatory',
58
60
  };
59
61
  export function get(lang, overrides = {}) {
60
62
  const locale = lang === "fr" ? fr : en;
@@ -26,6 +26,7 @@ svg.controlIcon {
26
26
  overflow: auto;
27
27
  scroll-behavior: smooth;
28
28
  scrollbar-width: thin;
29
+ scrollbar-width: none;
29
30
  -webkit-overflow-scrolling: touch;
30
31
  }
31
32
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ublo-lib",
3
- "version": "1.24.2",
3
+ "version": "1.24.4",
4
4
  "peerDependencies": {
5
5
  "dt-design-system": "^3.1.5",
6
6
  "leaflet": "^1.9.1",
@@ -42,7 +42,7 @@
42
42
  "classnames": "2.5.1",
43
43
  "cors": "2.8.5",
44
44
  "cpx2": "4.2.3",
45
- "dt-design-system": "3.7.4",
45
+ "dt-design-system": "3.7.6",
46
46
  "eslint": "8.56.0",
47
47
  "eslint-config-prettier": "9.1.0",
48
48
  "eslint-config-standard": "17.1.0",