ublo-lib 1.38.43 → 1.38.45

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.
@@ -31,9 +31,6 @@
31
31
  gap: 8px;
32
32
  }
33
33
 
34
- .action {
35
- }
36
-
37
34
  .products {
38
35
  --ds-loader-spinner-size: 17px;
39
36
  --ds-loader-thickness: 2px;
@@ -47,6 +44,10 @@
47
44
  margin-right: auto;
48
45
  }
49
46
 
47
+ .loader {
48
+ flex: 0 0 auto;
49
+ }
50
+
50
51
  .popover {
51
52
  padding: 0;
52
53
  }
@@ -12,7 +12,8 @@ type Props = {
12
12
  fr?: Record<string, string>;
13
13
  en?: Record<string, string>;
14
14
  };
15
+ hideOptionalStayFields?: boolean;
15
16
  };
16
- export default function GescoContactForm({ lang, channel, resort, merchant, categories, subject, facet, host, onSubmit, messagesOverrides, }: Props): import("react/jsx-runtime").JSX.Element;
17
+ export default function GescoContactForm({ lang, channel, resort, merchant, categories, subject, facet, host, onSubmit, messagesOverrides, hideOptionalStayFields, }: Props): import("react/jsx-runtime").JSX.Element;
17
18
  export {};
18
19
  //# sourceMappingURL=gesco-contact-form.d.ts.map
@@ -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,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC5B,IAAI,CAAC,EACD,0CAA0C,GAC1C,sDAAsD,GACtD,8CAA8C,CAAC;IACnD,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,KAAK,IAAI,CAAC;IACvE,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,OAAO,EACP,KAAgB,EAChB,IAAiD,EACjD,QAAQ,EACR,iBAAsB,GACvB,EAAE,KAAK,2CAgQP"}
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,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC5B,IAAI,CAAC,EACD,0CAA0C,GAC1C,sDAAsD,GACtD,8CAA8C,CAAC;IACnD,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,KAAK,IAAI,CAAC;IACvE,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;IACF,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,IAAW,EACX,OAAe,EACf,MAAM,EACN,QAAQ,EACR,UAAU,EACV,OAAO,EACP,KAAgB,EAChB,IAAiD,EACjD,QAAQ,EACR,iBAAsB,EACtB,sBAAsB,GACvB,EAAE,KAAK,2CAkQP"}
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import Select, { formatOptions } from "dt-design-system/es/select";
4
4
  import Input from "dt-design-system/es/input";
@@ -14,7 +14,7 @@ import * as Form from "./services/form";
14
14
  import * as API from "./services/api";
15
15
  import * as Plausible from "./services/plausible";
16
16
  import styles from "./gesco-contact-form.module.css";
17
- export default function GescoContactForm({ lang = "fr", channel = "ESF", resort, merchant, categories, subject, facet = "WINTER", host = "https://admin.mon-sejour-en-montagne.com", onSubmit, messagesOverrides = {}, }) {
17
+ export default function GescoContactForm({ lang = "fr", channel = "ESF", resort, merchant, categories, subject, facet = "WINTER", host = "https://admin.mon-sejour-en-montagne.com", onSubmit, messagesOverrides = {}, hideOptionalStayFields, }) {
18
18
  const { params, error } = useParams({
19
19
  lang,
20
20
  channel,
@@ -100,9 +100,9 @@ export default function GescoContactForm({ lang = "fr", channel = "ESF", resort,
100
100
  }), disabled: Boolean(error) || loading, required: true }), _jsx(Input, { name: "lastname", type: "text", icon: "User", label: messages.lastname, pattern: ".{2,}", patternError: Messages.format(messages.lengthError, {
101
101
  label: messages.lastname,
102
102
  length: "1",
103
- }), 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 })), _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, {
104
- label: messages.stayFrom,
105
- }), required: true, extended: 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, {
106
- label: messages.stayTo,
107
- }), required: true, extended: 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));
103
+ }), 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 })), !hideOptionalStayFields && (_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, {
104
+ label: messages.stayFrom,
105
+ }), required: stayNeeded, extended: 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, {
106
+ label: messages.stayTo,
107
+ }), required: stayNeeded, extended: 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));
108
108
  }
@@ -1,33 +1,15 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import Button from "dt-design-system/es/button";
4
- import Input from "dt-design-system/es/input";
5
4
  import { useUbloContext } from "ublo/with-ublo";
6
5
  import Message, { message } from "./message";
7
6
  import { useContext } from "./context";
8
7
  import styles from "./connexion.module.css";
9
8
  export default function Connexion({ logo }) {
10
9
  const { lang } = useUbloContext();
11
- const { partnerID } = useContext();
12
- const [error, setError] = React.useState("");
13
- const submitForm = async (e) => {
14
- e.preventDefault();
15
- const password = e.target[0].value;
16
- setCookie("password", password, 365);
17
- setError(undefined);
18
- window.location.href = `/espace-prive/${partnerID}/tunnel`;
19
- };
20
- React.useEffect(() => {
21
- const { searchParams } = new URL(window.location.href);
22
- const error = searchParams.get("error") === "1";
23
- if (error) {
24
- setError(message(lang, "partner-space-login-error"));
25
- eraseCookie("password");
26
- }
27
- }, [lang]);
28
10
  return (_jsxs("main", { className: styles.main, children: [_jsx("header", { className: styles.header, children: _jsx("div", { className: styles.logo, children: logo }) }), _jsxs("div", { className: styles.login, children: [_jsx("div", { className: styles.loginTitle, children: _jsx(Message, { id: "partner-space-login-title" }) }), _jsx("div", { className: styles.loginMessage, dangerouslySetInnerHTML: {
29
11
  __html: message(lang, "partner-space-login-message"),
30
- } }), _jsxs("form", { className: styles.loginForm, onSubmit: submitForm, children: [_jsx(Input, { className: styles.loginInput, type: "password" }), _jsx(Button, { type: "submit", className: styles.loginFormButton, children: _jsx(Message, { id: "partner-space-login-button" }) }), error && _jsx("div", { className: styles.loginFormError, children: error })] })] })] }));
12
+ } })] })] }));
31
13
  }
32
14
  function setCookie(name, value, days) {
33
15
  let expires = "";
@@ -1,8 +1,8 @@
1
1
  import { useUbloContext } from "ublo/with-ublo";
2
2
  const messages = {
3
3
  fr: {
4
- "partner-space-login-title": "Espace partenaire",
5
- "partner-space-login-message": "Connectez-vous avec le mot de passe qui vous a été fourni pour accéder aux informations de l'espace partenaire. Vous n'avez pas le mot de passe ? <a href='/contact'>Contactez-nous</a>.",
4
+ "partner-space-login-title": "Espace privé",
5
+ "partner-space-login-message": 'Votre offre partenaire a déjà été utilisée. En cas de besoin, merci de <a href="/contact">contacter votre esf</a>.',
6
6
  "partner-space-login-button": "Je me connecte",
7
7
  "partner-space-login-error": "Mot de passe incorrect",
8
8
  "go-to-cart": "Aller au panier",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ublo-lib",
3
- "version": "1.38.43",
3
+ "version": "1.38.45",
4
4
  "peerDependencies": {
5
5
  "dt-design-system": "^3.10.8",
6
6
  "leaflet": "^1.9.1",