ublo-lib 1.39.24 → 1.39.25

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,6 +1,7 @@
1
1
  export default CustomerForm;
2
- declare function CustomerForm({ lang, close, open, rows, setRows, voucher, setVoucher, disableVoucher, manualStay, channel, merchant, resort, integration, categoryCode, }: {
2
+ declare function CustomerForm({ lang, formTitle, close, open, rows, setRows, voucher, setVoucher, disableVoucher, manualStay, channel, merchant, resort, integration, categoryCode, }: {
3
3
  lang: any;
4
+ formTitle: any;
4
5
  close: any;
5
6
  open: any;
6
7
  rows: any;
@@ -1 +1 @@
1
- {"version":3,"file":"customer-form.d.ts","sourceRoot":"","sources":["../../../../../src/esf/components/loyal-customers/components/customer-form.js"],"names":[],"mappings":";AA4BA;;;;;;;;;;;;;;;4CAgGC"}
1
+ {"version":3,"file":"customer-form.d.ts","sourceRoot":"","sources":["../../../../../src/esf/components/loyal-customers/components/customer-form.js"],"names":[],"mappings":";AA4BA;;;;;;;;;;;;;;;;4CAkGC"}
@@ -19,7 +19,7 @@ const getInitialState = (fields) => Object.keys(fields).reduce((acc, key) => ({
19
19
  ...acc,
20
20
  [key]: { value: "", validator: !fields[key].required || false },
21
21
  }), {});
22
- const CustomerForm = ({ lang, close, open, rows, setRows, voucher, setVoucher, disableVoucher, manualStay, channel, merchant, resort, integration, categoryCode, }) => {
22
+ const CustomerForm = ({ lang, formTitle, close, open, rows, setRows, voucher, setVoucher, disableVoucher, manualStay, channel, merchant, resort, integration, categoryCode, }) => {
23
23
  const fields = manualStay
24
24
  ? { ...Data.stayFields, ...Data.customerFormFields }
25
25
  : Data.customerFormFields;
@@ -28,7 +28,7 @@ const CustomerForm = ({ lang, close, open, rows, setRows, voucher, setVoucher, d
28
28
  const isFormValid = Object.keys(customerData).every((key) => customerData[key].validator);
29
29
  const onSubmit = async () => {
30
30
  setResponse(RESPONSE.LOADING);
31
- const payload = Utils.buildPayload(lang, channel, resort, merchant, voucher, customerData, rows, disableVoucher, categoryCode);
31
+ const payload = Utils.buildPayload(lang, channel, resort, merchant, voucher, customerData, rows, disableVoucher, categoryCode, formTitle);
32
32
  const { error } = await Api.sendFile(payload, integration);
33
33
  if (error) {
34
34
  setResponse(RESPONSE.ERROR);
@@ -1,4 +1,4 @@
1
- export default function LoyalCustomers({ lang, cmsMode, selectors, levels, className, convertTableToSelect, handleVariants, manualStay, channel, merchant, resort, disableVoucher, integration, categoryCode, }: {
1
+ export default function LoyalCustomers({ lang, cmsMode, selectors, levels, className, convertTableToSelect, handleVariants, manualStay, channel, merchant, resort, disableVoucher, integration, categoryCode, formTitle, }: {
2
2
  lang: any;
3
3
  cmsMode: any;
4
4
  selectors: any;
@@ -13,5 +13,6 @@ export default function LoyalCustomers({ lang, cmsMode, selectors, levels, class
13
13
  disableVoucher: any;
14
14
  integration: any;
15
15
  categoryCode: any;
16
+ formTitle?: string;
16
17
  }): import("react/jsx-runtime").JSX.Element;
17
18
  //# sourceMappingURL=loyal-customers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"loyal-customers.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/loyal-customers/loyal-customers.js"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;;4CAyIC"}
1
+ {"version":3,"file":"loyal-customers.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/loyal-customers/loyal-customers.js"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;;;4CA2IC"}
@@ -11,7 +11,7 @@ import Button from "dt-design-system/es/button";
11
11
  import * as DTIcons from "dt-design-system/es/icons";
12
12
  import useStoredRows from "./hooks/use-stored-rows";
13
13
  import styles from "./loyal-customers.module.css";
14
- export default function LoyalCustomers({ lang, cmsMode, selectors, levels, className, convertTableToSelect, handleVariants, manualStay, channel = "ESF", merchant, resort, disableVoucher, integration, categoryCode, }) {
14
+ export default function LoyalCustomers({ lang, cmsMode, selectors, levels, className, convertTableToSelect, handleVariants, manualStay, channel = "ESF", merchant, resort, disableVoucher, integration, categoryCode, formTitle = "Clients fidèles", }) {
15
15
  const ref = React.useRef(null);
16
16
  const [rows, setRows] = useStoredRows([]);
17
17
  const [openedRow, setOpenedRow] = React.useState();
@@ -57,5 +57,5 @@ export default function LoyalCustomers({ lang, cmsMode, selectors, levels, class
57
57
  }
58
58
  }, [cleanup, cmsMode, init, selectors]);
59
59
  const classes = classNames(styles.index, className);
60
- return (_jsxs("div", { ref: ref, className: classes, children: [_jsx("div", { className: styles.title, children: Messages.get(lang, "title") }), _jsx(Rows, { lang: lang, rows: rows, setRows: setRows, openedRow: openedRow, setOpenedRow: setOpenedRow }), !disableVoucher && (_jsx(Voucher, { lang: lang, voucher: voucher, setVoucher: setVoucher })), _jsxs("div", { className: styles.overview, children: [_jsx("div", { className: styles.overviewTitle, children: Messages.get(lang, "total") }), _jsxs("div", { className: styles.overviewTotal, children: [total, " \u20AC"] })] }), _jsxs(Button, { className: styles.orderButton, disabled: !rows.length, onClick: openCustomerForm, children: [Messages.get(lang, "order"), _jsx(DTIcons.Check, {})] }), _jsx(StudentForm, { lang: lang, close: closeStudentForm, studentData: studentData, levels: levels, setRows: setRows, recapFormRef: ref }), _jsx(CustomerForm, { lang: lang, close: closeCustomerForm, open: customerFormOpen, rows: rows, setRows: setRows, voucher: voucher, setVoucher: setVoucher, disableVoucher: disableVoucher, manualStay: manualStay, channel: channel, merchant: merchant, resort: resort, integration: integration, categoryCode: categoryCode })] }));
60
+ return (_jsxs("div", { ref: ref, className: classes, children: [_jsx("div", { className: styles.title, children: Messages.get(lang, "title") }), _jsx(Rows, { lang: lang, rows: rows, setRows: setRows, openedRow: openedRow, setOpenedRow: setOpenedRow }), !disableVoucher && (_jsx(Voucher, { lang: lang, voucher: voucher, setVoucher: setVoucher })), _jsxs("div", { className: styles.overview, children: [_jsx("div", { className: styles.overviewTitle, children: Messages.get(lang, "total") }), _jsxs("div", { className: styles.overviewTotal, children: [total, " \u20AC"] })] }), _jsxs(Button, { className: styles.orderButton, disabled: !rows.length, onClick: openCustomerForm, children: [Messages.get(lang, "order"), _jsx(DTIcons.Check, {})] }), _jsx(StudentForm, { lang: lang, close: closeStudentForm, studentData: studentData, levels: levels, setRows: setRows, recapFormRef: ref }), _jsx(CustomerForm, { lang: lang, formTitle: formTitle, close: closeCustomerForm, open: customerFormOpen, rows: rows, setRows: setRows, voucher: voucher, setVoucher: setVoucher, disableVoucher: disableVoucher, manualStay: manualStay, channel: channel, merchant: merchant, resort: resort, integration: integration, categoryCode: categoryCode })] }));
61
61
  }
@@ -1,6 +1,6 @@
1
1
  export function validateField(type: any, value: any): any;
2
2
  export function formatDate(lang: any, date: any): string;
3
- export function buildPayload(lang: any, channel: any, resort: any, merchant: any, voucher: any, customerData: any, rows: any, disableVoucher: any, categoryCode: any): {
3
+ export function buildPayload(lang: any, channel: any, resort: any, merchant: any, voucher: any, customerData: any, rows: any, disableVoucher: any, categoryCode: any, formTitle: any): {
4
4
  channel: any;
5
5
  resort: any;
6
6
  merchant: any;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/loyal-customers/utils.js"],"names":[],"mappings":"AAEO,0DAGN;AAEM,yDAQN;AAEM;;;;;;;;;;;;;;;;;EA0DN"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/loyal-customers/utils.js"],"names":[],"mappings":"AAEO,0DAGN;AAEM,yDAQN;AAEM;;;;;;;;;;;;;;;;;EA2DN"}
@@ -12,7 +12,7 @@ export const formatDate = (lang, date) => {
12
12
  year: "numeric",
13
13
  });
14
14
  };
15
- export const buildPayload = (lang, channel, resort, merchant, voucher, customerData, rows, disableVoucher, categoryCode) => {
15
+ export const buildPayload = (lang, channel, resort, merchant, voucher, customerData, rows, disableVoucher, categoryCode, formTitle) => {
16
16
  const { comment, email, title, firstname, lastname, phone, stayFrom, stayTo, } = customerData;
17
17
  const storedStay = window.sessionStorage.getItem("stay");
18
18
  if ((!stayFrom || !stayTo) && !storedStay)
@@ -28,7 +28,7 @@ Date de naissance : ${formatDate(lang, birthDate.value)}`;
28
28
  return { label, description, price };
29
29
  }, []);
30
30
  const voucherMessage = disableVoucher ? "" : `Code promo : ${voucher}`;
31
- const message = `Envoyé depuis le formulaire "Clients fidèles".
31
+ const message = `Envoyé depuis le formulaire "${formTitle}".
32
32
  ${voucherMessage}
33
33
  Commentaire : ${comment.value}`;
34
34
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ublo-lib",
3
- "version": "1.39.24",
3
+ "version": "1.39.25",
4
4
  "peerDependencies": {
5
5
  "dt-design-system": "^3.10.8",
6
6
  "leaflet": "^1.9.1",