@licklist/design 0.44.492 → 0.44.494

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":"BookingSummary.d.ts","sourceRoot":"","sources":["../../../../../src/iframe/order-process/components/BookingSummary/BookingSummary.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAI9C,eAAO,MAAM,cAAc;uJAWxB,KAAK,mBAAmB,EAAE,oBAAoB,CAAC;;;CAyEjD,CAAC"}
1
+ {"version":3,"file":"BookingSummary.d.ts","sourceRoot":"","sources":["../../../../../src/iframe/order-process/components/BookingSummary/BookingSummary.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAI9C,eAAO,MAAM,cAAc;uJAWxB,KAAK,mBAAmB,EAAE,oBAAoB,CAAC;;;CA4EjD,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),r=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,a=require("@licklist/core/dist/Config"),n=require("../../../../static/loader/LoaderIndicator.js"),m=require("react-i18next");require("../../../../static/index.js");var o=require("react-intl");require("./components/SummaryTotal/components/SummaryTotalBlock.js");var c=require("./components/ProductsByMenuStep/ProductsByMenuStep.js"),l=require("./components/SummaryTotal/SummaryTotal.js"),s=require("./components/BookingSummaryAccordion/BookingSummaryAccordion.js"),i=function(e){var l=e.date,i=e.menuSteps,u=e.formValues,d=e.isNotShownPeopleAmount,p=e.eventName,y=e.transactionFee,E=void 0===y?0:y,v=e.productsWithErrors,f=e.isLoading,N=e.hasPeopleInput,S=e.peopleAmount,g=m.useTranslation("Design").t,B=o.useIntl().formatNumber,j=t.useMemo((function(){var e=Object.values(u).filter(Boolean);return null==e?void 0:e.filter((function(e){return 0!==(null==e?void 0:e.quantity)}))}),[u]);return f?r.createElement("div",{className:"payment-booking-summary"},r.createElement(n.LoaderIndicator,{isLoaded:!1})):r.createElement("div",{className:"payment-booking-summary"},r.createElement(s.BookingSummaryAccordion,{hasPeopleInput:N},r.createElement("div",{className:"event-info"},r.createElement("p",{className:"m-0 title event-name"},p),r.createElement("p",{className:"m-0"},l)),r.createElement("hr",null),j.length>0?r.createElement("div",null,r.createElement("div",{className:"cart-items"},i.map((function(e){return r.createElement(c.ProductsByMenuStep,{key:e.id,orderProducts:j,step:e,productsWithErrors:v})})),!d&&S>0&&r.createElement(r.Fragment,null,r.createElement("hr",null),r.createElement("div",{className:"d-flex justify-content-between mt-3"},r.createElement("p",{className:"m-0"},g("people"),":"),r.createElement("p",{className:"price"},S))),!!E&&r.createElement(r.Fragment,null,r.createElement("hr",null),r.createElement("div",{className:"d-flex justify-content-between mt-3"},r.createElement("p",{className:"m-0"},g("transactionFee"),":"),r.createElement("p",{className:"price"},B(E,{style:"currency",currency:a.Currency.GBP})))))):r.createElement("div",{className:"cart-items"},r.createElement("p",{className:"empty-cart"},g("emptyBasket")))))};i.SummaryTotal=l.SummaryTotal,i.Accordion=s.BookingSummaryAccordion,exports.BookingSummary=i;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),r=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,a=require("@licklist/core/dist/Config"),n=require("../../../../static/loader/LoaderIndicator.js"),o=require("react-i18next");require("../../../../static/index.js");var m=require("react-intl");require("./components/SummaryTotal/components/SummaryTotalBlock.js");var c=require("./components/ProductsByMenuStep/ProductsByMenuStep.js"),l=require("./components/SummaryTotal/SummaryTotal.js"),s=require("./components/BookingSummaryAccordion/BookingSummaryAccordion.js"),i=function(e){var l=e.date,i=e.menuSteps,u=e.formValues,d=e.isNotShownPeopleAmount,p=e.eventName,y=e.transactionFee,E=void 0===y?0:y,v=e.productsWithErrors,f=e.isLoading,N=e.hasPeopleInput,S=e.peopleAmount,g=o.useTranslation("Design").t,B=m.useIntl().formatNumber,j=t.useMemo((function(){if(u){var e=Object.values(u).filter(Boolean);return null==e?void 0:e.filter((function(e){return 0!==(null==e?void 0:e.quantity)}))}}),[u]);return f?r.createElement("div",{className:"payment-booking-summary"},r.createElement(n.LoaderIndicator,{isLoaded:!1})):r.createElement("div",{className:"payment-booking-summary"},r.createElement(s.BookingSummaryAccordion,{hasPeopleInput:N},r.createElement("div",{className:"event-info"},r.createElement("p",{className:"m-0 title event-name"},p),r.createElement("p",{className:"m-0"},l)),r.createElement("hr",null),(null==j?void 0:j.length)>0?r.createElement("div",null,r.createElement("div",{className:"cart-items"},i.map((function(e){return r.createElement(c.ProductsByMenuStep,{key:e.id,orderProducts:j,step:e,productsWithErrors:v})})),!d&&S>0&&r.createElement(r.Fragment,null,r.createElement("hr",null),r.createElement("div",{className:"d-flex justify-content-between mt-3"},r.createElement("p",{className:"m-0"},g("people"),":"),r.createElement("p",{className:"price"},S))),!!E&&r.createElement(r.Fragment,null,r.createElement("hr",null),r.createElement("div",{className:"d-flex justify-content-between mt-3"},r.createElement("p",{className:"m-0"},g("transactionFee"),":"),r.createElement("p",{className:"price"},B(E,{style:"currency",currency:a.Currency.GBP})))))):r.createElement("div",{className:"cart-items"},r.createElement("p",{className:"empty-cart"},g("emptyBasket")))))};i.SummaryTotal=l.SummaryTotal,i.Accordion=s.BookingSummaryAccordion,exports.BookingSummary=i;
@@ -4,13 +4,13 @@ export declare const MOBILE_WIDTH = 576;
4
4
  export declare const ACCORDION_KEY = "booking-summary";
5
5
  export declare type BookingSummaryProps = {
6
6
  date: string;
7
- menuSteps: MenuStep[];
8
- formValues: {
7
+ menuSteps?: MenuStep[];
8
+ formValues?: {
9
9
  [key: string]: Order;
10
10
  };
11
11
  totalWithDiscount?: number;
12
12
  isNotShownPeopleAmount?: boolean;
13
- eventName: string;
13
+ eventName?: string;
14
14
  hasPeopleInput?: boolean;
15
15
  transactionFee?: number;
16
16
  isFreePayment?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,8CAA8C,CAAC;AAC5F,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAEvD,eAAO,MAAM,YAAY,MAAM,CAAC;AAChC,eAAO,MAAM,aAAa,oBAAoB,CAAC;AAE/C,oBAAY,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,UAAU,EAAE;QACV,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC;KACtB,CAAC;IACF,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,kBAAkB,CAAC,EAAE,4BAA4B,CAAC,UAAU,CAAC,CAAC;IAC9D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,8CAA8C,CAAC;AAC5F,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAEvD,eAAO,MAAM,YAAY,MAAM,CAAC;AAChC,eAAO,MAAM,aAAa,oBAAoB,CAAC;AAE/C,oBAAY,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,UAAU,CAAC,EAAE;QACX,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC;KACtB,CAAC;IACF,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,kBAAkB,CAAC,EAAE,4BAA4B,CAAC,UAAU,CAAC,CAAC;IAC9D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"PaymentPage.d.ts","sourceRoot":"","sources":["../../../../src/iframe/payment/payment-page/PaymentPage.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,MAAM,0DAA0D,CAAC;AAI/F,OAAO,EAEL,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AAKpC,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,YAAa,SAAQ,oBAAoB;IACjD,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAC;IAClC,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,CAAC;IACrE,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;AAED,eAAO,MAAM,WAAW,kIAQrB,YAAY,gBAqHd,CAAC"}
1
+ {"version":3,"file":"PaymentPage.d.ts","sourceRoot":"","sources":["../../../../src/iframe/payment/payment-page/PaymentPage.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,MAAM,0DAA0D,CAAC;AAI/F,OAAO,EAEL,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AAKpC,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,YAAa,SAAQ,oBAAoB;IACjD,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAC;IAClC,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,CAAC;IACrE,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;AAED,eAAO,MAAM,WAAW,kIAQrB,YAAY,gBAuHd,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("tslib"),o=require("react"),a=(e=o)&&"object"==typeof e&&"default"in e?e.default:e,r=require("react-router-dom"),n=require("../../../static/loader/LoaderIndicator.js"),m=require("react-i18next"),s=require("react-bootstrap");require("../../../static/index.js"),require("../../order-process/components/NavigationFooter/NavigationFooter.js");var i=require("../../page/components/PageHeader/PageHeader.js"),l=require("@licklist/plugins/dist/context/payment/PaymentSessionContext"),c=require("../../order-process/components/BookingSummary/components/SummaryTotal/components/SummaryTotalBlock.js"),u=require("../../ryft/RyftPaymentForm.js"),d=require("../../order-process/components/BookingSummary/BookingSummary.js");require("../../order-process/components/NavigationSteps/NavigationSteps.js"),require("../../order-process/components/StepsForm/StepsForm.js"),require("../../order-process/components/Timer/Timer.js"),require("../../order-process/components/PaymentCard/PaymentCard.js");var p=require("../../order-process/components/BookingSummaryFooter/BookingSummaryFooter.js"),y=require("../../page/components/PageBody/PageBody.js");require("../../order-process/components/CalendarStepsForm/CalendarStepsForm.js");var g=require("./PaymentTimer.js"),f=require("../../page/Page.js");exports.PaymentPage=function(e){var B=e.onCloseIframePayment,P=e.onFailIframePayment,k=e.data,E=e.isLoading,S=e.bookingSummaryProps,q=e.paymentMetadata,j=t.__rest(e,["onCloseIframePayment","onFailIframePayment","data","isLoading","bookingSummaryProps","paymentMetadata"]),v=m.useTranslation("Design").t,x=r.useLocation().search,C=o.useContext(l.PaymentSessionContext).isPaymentSessionExpired,b=Boolean(new URLSearchParams(x).get("isIframePayment")),w=function(){window.close()};return o.useEffect((function(){b&&B&&window.addEventListener("beforeunload",(function(){B()}))}),[]),o.useEffect((function(){C&&b&&P&&P()}),[C]),E?a.createElement(n.LoaderIndicator,{isLoaded:!1}):null===k?a.createElement(f.Page,null,a.createElement(y.PageBody,{leftBlock:a.createElement(y.PageBody.LeftBlock,null,a.createElement("div",{className:"d-flex h-100 w-100 justify-content-center align-items-center flex-column"},a.createElement("h6",null,v("linkNotActiveOrExpired")),a.createElement(s.Col,{xs:12,md:3},a.createElement(s.Button,{className:"mt-5 w-20",onClick:function(){window.location.href="https://booked.it/"}},v("backToSite")))))})):a.createElement(f.Page,{className:"payment_link",headerBlock:a.createElement(i.PageHeader,{showBackButton:b,onBackButtonClick:b?w:void 0,showCloseButton:b,onCloseButtonClick:b?w:void 0},a.createElement(g.PaymentTimer,null),a.createElement("div",{className:"d-flex align-items-center justify-content-center w-100"},v("paymentDetails")))},a.createElement(y.PageBody,{leftBlock:a.createElement(y.PageBody.LeftBlock,null,a.createElement(u.RyftPaymentForm,t.__assign({},j))),rightBlock:a.createElement(y.PageBody.RightBlock,{bottomBlock:a.createElement(p.BookingSummaryFooter,{showButton:!1},a.createElement("div",{className:"d-flex flex-column justify-content-between"},q&&a.createElement(a.Fragment,null,a.createElement(c.SummaryTotalBlock,{label:v("total"),amount:q.total||0}),a.createElement(c.SummaryTotalBlock,{label:v("paidSum"),amount:q.paid||0})),a.createElement(c.SummaryTotalBlock,{label:v(q?"remaining":"total"),amount:(null==k?void 0:k.amount)||0})))},a.createElement("h6",null,v("paymentDetails")),a.createElement(d.BookingSummary,t.__assign({},S)))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("tslib"),o=require("react"),a=(e=o)&&"object"==typeof e&&"default"in e?e.default:e,r=require("react-router-dom"),n=require("../../../static/loader/LoaderIndicator.js"),m=require("react-i18next"),s=require("react-bootstrap");require("../../../static/index.js"),require("../../order-process/components/NavigationFooter/NavigationFooter.js");var i=require("../../page/components/PageHeader/PageHeader.js"),l=require("@licklist/plugins/dist/context/payment/PaymentSessionContext"),c=require("../../order-process/components/BookingSummary/components/SummaryTotal/components/SummaryTotalBlock.js"),u=require("../../ryft/RyftPaymentForm.js"),d=require("../../order-process/components/BookingSummary/BookingSummary.js");require("../../order-process/components/NavigationSteps/NavigationSteps.js"),require("../../order-process/components/StepsForm/StepsForm.js"),require("../../order-process/components/Timer/Timer.js"),require("../../order-process/components/PaymentCard/PaymentCard.js");var p=require("../../order-process/components/BookingSummaryFooter/BookingSummaryFooter.js"),y=require("../../page/components/PageBody/PageBody.js");require("../../order-process/components/CalendarStepsForm/CalendarStepsForm.js");var g=require("./PaymentTimer.js"),f=require("../../page/Page.js");exports.PaymentPage=function(e){var B=e.onCloseIframePayment,P=e.onFailIframePayment,k=e.data,E=e.isLoading,S=e.bookingSummaryProps,q=e.paymentMetadata,j=t.__rest(e,["onCloseIframePayment","onFailIframePayment","data","isLoading","bookingSummaryProps","paymentMetadata"]),v=m.useTranslation("Design").t,x=r.useLocation().search,C=o.useContext(l.PaymentSessionContext).isPaymentSessionExpired,F=Boolean(new URLSearchParams(x).get("isIframePayment")),b=function(){window.close()};return o.useEffect((function(){F&&B&&window.addEventListener("beforeunload",(function(){B()}))}),[]),o.useEffect((function(){C&&F&&P&&P()}),[C]),E?a.createElement(n.LoaderIndicator,{isLoaded:!1}):null===k?a.createElement(f.Page,null,a.createElement(y.PageBody,{leftBlock:a.createElement(y.PageBody.LeftBlock,null,a.createElement("div",{className:"d-flex h-100 w-100 justify-content-center align-items-center flex-column"},a.createElement("h6",null,v("linkNotActiveOrExpired")),a.createElement(s.Col,{xs:12,md:3},a.createElement(s.Button,{className:"mt-5 w-20",onClick:function(){window.location.href="https://booked.it/"}},v("backToSite")))))})):a.createElement(f.Page,{className:"payment_link",headerBlock:a.createElement(i.PageHeader,{showBackButton:F,onBackButtonClick:F?b:void 0,showCloseButton:F,onCloseButtonClick:F?b:void 0},a.createElement(g.PaymentTimer,null),a.createElement("div",{className:"d-flex align-items-center justify-content-center w-100"},v("paymentDetails")))},a.createElement(y.PageBody,{leftBlock:a.createElement(y.PageBody.LeftBlock,null,a.createElement(u.RyftPaymentForm,t.__assign({},j))),rightBlock:a.createElement(y.PageBody.RightBlock,{bottomBlock:a.createElement(p.BookingSummaryFooter,{showButton:!1},a.createElement("div",{className:"d-flex flex-column justify-content-between"},q&&a.createElement(a.Fragment,null,a.createElement(c.SummaryTotalBlock,{label:v("total"),amount:q.total||0}),a.createElement(c.SummaryTotalBlock,{label:v("paidSum"),amount:q.paid||0})),a.createElement(c.SummaryTotalBlock,{label:v(q?"remaining":"total"),amount:(null==k?void 0:k.amount)+((null==S?void 0:S.transactionFee)||0)})))},a.createElement("h6",null,v("paymentDetails")),a.createElement(d.BookingSummary,t.__assign({},S)))}))};
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from "react";
2
2
  import { BookingSummaryProps } from "../../order-process/components/BookingSummary/types";
3
+ import { PaymentMetadata } from "../payment-page/PaymentPage";
3
4
  export declare const ORDER_STATUS_FAILED = "failed";
4
5
  export declare const ORDER_STATUS_SUCCESS = "success";
5
6
  export declare const ORDER_STATUS_PENDING = "pending";
@@ -8,7 +9,6 @@ interface PaymentStatusComponentProps {
8
9
  onCloseWindow: () => void;
9
10
  onBack?: () => void;
10
11
  onTryAgain?: () => void;
11
- totalAmount?: number;
12
12
  isLoading?: boolean;
13
13
  status: OrderStatusPrefix;
14
14
  isAppUsingInIframe?: boolean;
@@ -16,7 +16,9 @@ interface PaymentStatusComponentProps {
16
16
  EventCardComponent?: ReactNode;
17
17
  showCloseButton?: boolean;
18
18
  email?: string;
19
+ totalAmount?: number;
20
+ paymentMetadata?: PaymentMetadata;
19
21
  }
20
- export declare const PaymentStatusPage: ({ onCloseWindow, onBack, onTryAgain, totalAmount, isLoading, status, isAppUsingInIframe, bookingSummaryProps, EventCardComponent, showCloseButton, email, }: PaymentStatusComponentProps) => JSX.Element;
22
+ export declare const PaymentStatusPage: ({ onCloseWindow, onBack, onTryAgain, isLoading, status, isAppUsingInIframe, bookingSummaryProps, EventCardComponent, showCloseButton, email, totalAmount, paymentMetadata, }: PaymentStatusComponentProps) => JSX.Element;
21
23
  export {};
22
24
  //# sourceMappingURL=PaymentStatusPage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PaymentStatusPage.d.ts","sourceRoot":"","sources":["../../../../src/iframe/payment/payment-status-page/PaymentStatusPage.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAE1F,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAC5C,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAC9C,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAE9C,oBAAY,iBAAiB,GACzB,OAAO,oBAAoB,GAC3B,OAAO,mBAAmB,GAC1B,OAAO,oBAAoB,CAAC;AAEhC,UAAU,2BAA2B;IACnC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,kBAAkB,CAAC,EAAE,SAAS,CAAC;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAGD,eAAO,MAAM,iBAAiB,gKAY3B,2BAA2B,gBA2E7B,CAAC"}
1
+ {"version":3,"file":"PaymentStatusPage.d.ts","sourceRoot":"","sources":["../../../../src/iframe/payment/payment-status-page/PaymentStatusPage.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAC5C,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAC9C,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAE9C,oBAAY,iBAAiB,GACzB,OAAO,oBAAoB,GAC3B,OAAO,mBAAmB,GAC1B,OAAO,oBAAoB,CAAC;AAEhC,UAAU,2BAA2B;IACnC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,kBAAkB,CAAC,EAAE,SAAS,CAAC;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;AAGD,eAAO,MAAM,iBAAiB,iLAa3B,2BAA2B,gBAqF7B,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,o=require("tslib"),r=require("react"),t=(e=r)&&"object"==typeof e&&"default"in e?e.default:e,a=require("../../../static/loader/LoaderIndicator.js"),n=require("react-i18next");require("../../order-process/components/NavigationFooter/NavigationFooter.js"),require("../../page/components/PageHeader/PageHeader.js");var s=require("../payment-status-header/PaymentStatusHeader.js"),m=require("../../order-process/components/BookingSummary/components/SummaryTotal/components/SummaryTotalBlock.js");require("../../order-process/components/BookingSummary/components/SummaryTotal/SummaryTotal.js");var i=require("../../order-process/components/BookingSummary/BookingSummary.js");require("../../order-process/components/NavigationSteps/NavigationSteps.js"),require("../../order-process/components/StepsForm/StepsForm.js"),require("../../order-process/components/Timer/Timer.js"),require("../../order-process/components/PaymentCard/PaymentCard.js");var u=require("../../order-process/components/BookingSummaryFooter/BookingSummaryFooter.js"),c=require("../../page/components/PageBody/PageBody.js");require("../../order-process/components/CalendarStepsForm/CalendarStepsForm.js");var l=require("../../page/Page.js"),p=require("./component/PaymentStatusBody.js"),d="failed",g="success",y="pending";exports.ORDER_STATUS_FAILED=d,exports.ORDER_STATUS_PENDING=y,exports.ORDER_STATUS_SUCCESS=g,exports.PaymentStatusPage=function(e){var r=e.onCloseWindow,S=e.onBack,B=e.onTryAgain,P=e.totalAmount,k=e.isLoading,E=e.status,q=e.isAppUsingInIframe,j=e.bookingSummaryProps,v=e.EventCardComponent,T=e.showCloseButton,f=void 0!==T&&T,C=e.email,h=n.useTranslation("Design").t,F=function(){switch(E){case g:return h("purchaseSuccessful");case y:return h("pendingPayment");default:return h("purchaseFailed")}}();return k?t.createElement(a.LoaderIndicator,{isLoaded:!1}):t.createElement(l.Page,{className:"payment-status-page",headerBlock:t.createElement(s.PaymentStatusHeader,{success:E!==d,showCloseButton:f,onCloseButtonClick:r,title:E===y?h("pendingPayment"):void 0}),isAppUsingInIframe:q},t.createElement(c.PageBody,{leftBlock:t.createElement(c.PageBody.LeftBlock,{title:F},t.createElement("div",null,v,t.createElement(p.PaymentStatusBody,{status:E,onBack:S||r,onTryAgain:B,email:C}))),rightBlock:t.createElement(c.PageBody.RightBlock,{bottomBlock:t.createElement(u.BookingSummaryFooter,{showButton:!1},(null==j?void 0:j.formValues)?t.createElement(i.BookingSummary.SummaryTotal,{formValues:null==j?void 0:j.formValues}):t.createElement(m.SummaryTotalBlock,{label:h("total"),amount:P||0}))},j?t.createElement(i.BookingSummary,o.__assign({},j)):t.createElement("h6",null,F))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("tslib"),o=require("react"),r=(e=o)&&"object"==typeof e&&"default"in e?e.default:e,a=require("../../../static/loader/LoaderIndicator.js"),n=require("react-i18next");require("../../order-process/components/NavigationFooter/NavigationFooter.js"),require("../../page/components/PageHeader/PageHeader.js");var s=require("../payment-status-header/PaymentStatusHeader.js"),m=require("../../order-process/components/BookingSummary/components/SummaryTotal/components/SummaryTotalBlock.js");require("../../order-process/components/BookingSummary/components/SummaryTotal/SummaryTotal.js");var i=require("../../order-process/components/BookingSummary/BookingSummary.js");require("../../order-process/components/NavigationSteps/NavigationSteps.js"),require("../../order-process/components/StepsForm/StepsForm.js"),require("../../order-process/components/Timer/Timer.js"),require("../../order-process/components/PaymentCard/PaymentCard.js");var c=require("../../order-process/components/BookingSummaryFooter/BookingSummaryFooter.js"),l=require("../../page/components/PageBody/PageBody.js");require("../../order-process/components/CalendarStepsForm/CalendarStepsForm.js");var u=require("../../page/Page.js"),p=require("./component/PaymentStatusBody.js"),d="failed",g="success",y="pending";exports.ORDER_STATUS_FAILED=d,exports.ORDER_STATUS_PENDING=y,exports.ORDER_STATUS_SUCCESS=g,exports.PaymentStatusPage=function(e){var o=e.onCloseWindow,S=e.onBack,B=e.onTryAgain,E=e.isLoading,k=e.status,P=e.isAppUsingInIframe,j=e.bookingSummaryProps,q=e.EventCardComponent,v=e.showCloseButton,T=void 0!==v&&v,f=e.email,C=e.totalAmount,F=void 0===C?0:C,h=e.paymentMetadata,_=n.useTranslation("Design").t,b=function(){switch(k){case g:return _("purchaseSuccessful");case y:return _("pendingPayment");default:return _("purchaseFailed")}}();return E?r.createElement(a.LoaderIndicator,{isLoaded:!1}):r.createElement(u.Page,{className:"payment-status-page",headerBlock:r.createElement(s.PaymentStatusHeader,{success:k!==d,showCloseButton:T,onCloseButtonClick:o,title:k===y?_("pendingPayment"):void 0}),isAppUsingInIframe:P},r.createElement(l.PageBody,{leftBlock:r.createElement(l.PageBody.LeftBlock,{title:b},r.createElement("div",null,q,r.createElement(p.PaymentStatusBody,{status:k,onBack:S||o,onTryAgain:B,email:f}))),rightBlock:r.createElement(l.PageBody.RightBlock,{bottomBlock:r.createElement(c.BookingSummaryFooter,{showButton:!1},r.createElement("div",{className:"d-flex flex-column justify-content-between"},h&&r.createElement(r.Fragment,null,r.createElement(m.SummaryTotalBlock,{label:_("total"),amount:h.total||0}),r.createElement(m.SummaryTotalBlock,{label:_("paidSum"),amount:h.paid||0})),r.createElement(m.SummaryTotalBlock,{label:_(h?"remaining":"total"),amount:F+((null==j?void 0:j.transactionFee)||0)})))},j?r.createElement(i.BookingSummary,t.__assign({},j)):r.createElement("h6",null,b))}))};
@@ -1 +1 @@
1
- {"version":3,"file":"StepsControl.d.ts","sourceRoot":"","sources":["../../../src/product-set/form/StepsControl.tsx"],"names":[],"mappings":";AAgBA,UAAU,iBAAiB;IACzB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,EAAE,SAAS,EAAE,EAAE,iBAAiB,eAgH5D"}
1
+ {"version":3,"file":"StepsControl.d.ts","sourceRoot":"","sources":["../../../src/product-set/form/StepsControl.tsx"],"names":[],"mappings":";AAgBA,UAAU,iBAAiB;IACzB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,EAAE,SAAS,EAAE,EAAE,iBAAiB,eAkI5D"}
@@ -1 +1 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),r=require("react"),a=e(r),o=require("react-i18next"),n=require("react-hook-form"),s=e(require("@licklist/plugins/dist/services/Form/HookFormService")),i=require("../../sortable-tree/SortableTreeItem.js"),l=require("../../sortable-tree/SortableTree.js"),d=e(require("react-bootstrap/Badge")),u=require("../item/CreateProductSetItem.js"),c=require("../step/StepControl.js"),p=require("./ProductCategoriesControl.js");exports.StepsControl=function(e){var m=e.isLoading,g=n.useFormContext(),v=o.useTranslation("Design").t,C=t.__read(r.useState(!1),2),b=C[0],f=C[1],S=g.control,E=g.formState,q=E.errors,I=E.isSubmitting,N=g.clearErrors,h=g.getValues,y=n.useFieldArray({name:"steps",control:S,keyName:"_id"}),j=y.fields,x=y.append,_=y.remove;r.useEffect((function(){I&&f(!I)}),[I]);var k=1===j.length;return a.createElement(a.Fragment,null,j.map((function(e,t){var r=h("steps.".concat(t));return a.createElement(n.Controller,{key:"step-".concat(e._id),name:"steps.".concat(t,".name"),control:S,rules:{required:v("Validation:fieldRequired",{attribute:v("name")})},render:function(o){var n,s,u=o.field,g=u.value,C=u.onChange;return a.createElement(l.SortableTree.Item,{id:e._id,title:g,badge:a.createElement(d,{className:"step-badge"},v("step")),isExpanded:k,isInvalid:!!(null===(n=q.steps)||void 0===n?void 0:n[t]),isIconInHeader:!1,modalLabel:v("addNewStep"),modalClass:i.ProductSetModalClasses.step,isNewAdded:b,subTitle:a.createElement("div",{className:"product-set-badges-container"},a.createElement("div",{className:"product-set-subtitle-dot product-set-subtitle-step-dot"}),a.createElement("span",null,null===(s=r.productCategories)||void 0===s?void 0:s.length," ",v("categories"))),treeLineIconColor:"#D52902",body:a.createElement(c.StepControl,{isLoading:m,stepIndex:t,stepName:g,onStepNameChange:C}),onDelete:function(){return _(t)},sortableItems:e.productCategories?e.productCategories.map((function(e){var t=e.id;return String(t)})):[]},a.createElement(p.ProductCategoriesControl,{isLoading:m,stepIndex:t}))}})})),a.createElement(u.CreateProductSetItem,{title:v("addStep"),onClick:function(){var e;x({id:null,name:"".concat(v("step")," ").concat(j.length+1),productCategories:[],weight:0,hasMap:!1,venueMapSetId:null}),f(!0),(null===(e=q.steps)||void 0===e?void 0:e.type)===s.manualErrorType&&N("steps")}}),a.createElement("div",{className:"manual-form-error"},q.steps&&q.steps.message))};
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),r=require("react"),o=e(r),a=require("react-i18next"),n=require("react-hook-form"),s=e(require("@licklist/plugins/dist/services/Form/HookFormService")),i=require("../../sortable-tree/SortableTreeItem.js"),l=require("../../sortable-tree/SortableTree.js"),d=e(require("react-bootstrap/Badge")),u=require("../item/CreateProductSetItem.js"),c=require("../step/StepControl.js"),m=require("./ProductCategoriesControl.js");exports.StepsControl=function(e){var p=e.isLoading,v=n.useFormContext(),g=a.useTranslation("Design").t,f=t.__read(r.useState(!1),2),C=f[0],b=f[1],S=v.control,E=v.formState,q=E.errors,I=E.isSubmitting,N=v.clearErrors,h=v.getValues,y=v.setFocus,j=n.useFieldArray({name:"steps",control:S,keyName:"_id"}),x=j.fields,P=j.append,_=j.remove;r.useEffect((function(){I&&b(!I)}),[I]);var k=1===x.length;return o.createElement(o.Fragment,null,x.map((function(e,t){var r="steps.".concat(t),a=h(r);return o.createElement(n.Controller,{key:"step-".concat(e._id),name:"".concat(r,".name"),control:S,rules:{required:g("Validation:fieldRequired",{attribute:g("name")})},render:function(n){var s,u,v=n.field,f=v.value,b=v.onChange;return o.createElement(l.SortableTree.Item,{id:e._id,title:f,badge:o.createElement(d,{className:"step-badge"},g("step")),isExpanded:k,isInvalid:!!(null===(s=q.steps)||void 0===s?void 0:s[t]),isIconInHeader:!1,modalLabel:g("addNewStep"),modalClass:i.ProductSetModalClasses.step,isNewAdded:C,subTitle:o.createElement("div",{className:"product-set-badges-container"},o.createElement("div",{className:"product-set-subtitle-dot product-set-subtitle-step-dot"}),o.createElement("span",null,null===(u=a.productCategories)||void 0===u?void 0:u.length," ",g("categories"))),treeLineIconColor:"#D52902",body:o.createElement(c.StepControl,{isLoading:p,stepIndex:t,stepName:f,onStepNameChange:b}),onDelete:function(){return _(t)},sortableItems:e.productCategories?e.productCategories.map((function(e){var t=e.id;return String(t)})):[],validate:function(){var e,o,a=null===(o=null===(e=q.steps)||void 0===e?void 0:e[t])||void 0===o?void 0:o.name;return a&&y("".concat(r,".name")),Promise.resolve(!a)}},o.createElement(m.ProductCategoriesControl,{isLoading:p,stepIndex:t}))}})})),o.createElement(u.CreateProductSetItem,{title:g("addStep"),onClick:function(){var e;P({id:null,name:"".concat(g("step")," ").concat(x.length+1),productCategories:[],weight:0,hasMap:!1,venueMapSetId:null}),b(!0),(null===(e=q.steps)||void 0===e?void 0:e.type)===s.manualErrorType&&N("steps")}}),o.createElement("div",{className:"manual-form-error"},q.steps&&q.steps.message))};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.44.492",
3
+ "version": "0.44.494",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -25,6 +25,9 @@ export const BookingSummary = ({
25
25
  const { formatNumber } = useIntl();
26
26
 
27
27
  const orderProducts = useMemo(() => {
28
+ if (!formValues) {
29
+ return undefined;
30
+ }
28
31
  const products = Object.values(formValues).filter(Boolean) as Order[];
29
32
 
30
33
  return products?.filter((prod) => prod?.quantity !== 0);
@@ -47,7 +50,7 @@ export const BookingSummary = ({
47
50
  </div>
48
51
  <hr />
49
52
 
50
- {orderProducts.length > 0 ? (
53
+ {orderProducts?.length > 0 ? (
51
54
  <div>
52
55
  <div className="cart-items">
53
56
  {menuSteps.map((menuStep: MenuStep) => {
@@ -6,13 +6,13 @@ export const ACCORDION_KEY = "booking-summary";
6
6
 
7
7
  export type BookingSummaryProps = {
8
8
  date: string;
9
- menuSteps: MenuStep[];
10
- formValues: {
9
+ menuSteps?: MenuStep[];
10
+ formValues?: {
11
11
  [key: string]: Order;
12
12
  };
13
13
  totalWithDiscount?: number;
14
14
  isNotShownPeopleAmount?: boolean;
15
- eventName: string;
15
+ eventName?: string;
16
16
  hasPeopleInput?: boolean;
17
17
  transactionFee?: number;
18
18
  isFreePayment?: boolean;
@@ -142,7 +142,9 @@ export const PaymentPage = ({
142
142
  )}
143
143
  <SummaryTotalBlock
144
144
  label={t(paymentMetadata ? "remaining" : "total")}
145
- amount={data?.amount || 0}
145
+ amount={
146
+ data?.amount + (bookingSummaryProps?.transactionFee || 0)
147
+ }
146
148
  />
147
149
  </div>
148
150
  </BookingSummaryFooter>
@@ -9,6 +9,7 @@ import { BookingSummary, BookingSummaryFooter } from "../../order-process";
9
9
  import { PaymentStatusHeader } from "../payment-status-header/PaymentStatusHeader";
10
10
  import { SummaryTotalBlock } from "../../order-process/components/BookingSummary/components/SummaryTotal";
11
11
  import { BookingSummaryProps } from "../../order-process/components/BookingSummary/types";
12
+ import { PaymentMetadata } from "../payment-page/PaymentPage";
12
13
 
13
14
  export const ORDER_STATUS_FAILED = "failed";
14
15
  export const ORDER_STATUS_SUCCESS = "success";
@@ -23,7 +24,6 @@ interface PaymentStatusComponentProps {
23
24
  onCloseWindow: () => void;
24
25
  onBack?: () => void;
25
26
  onTryAgain?: () => void;
26
- totalAmount?: number;
27
27
  isLoading?: boolean;
28
28
  status: OrderStatusPrefix;
29
29
  isAppUsingInIframe?: boolean;
@@ -31,6 +31,8 @@ interface PaymentStatusComponentProps {
31
31
  EventCardComponent?: ReactNode;
32
32
  showCloseButton?: boolean;
33
33
  email?: string;
34
+ totalAmount?: number;
35
+ paymentMetadata?: PaymentMetadata;
34
36
  }
35
37
 
36
38
  // @TODO In future think, how to reuse this component in Iframe Pending, Success and Failed Pages
@@ -38,7 +40,6 @@ export const PaymentStatusPage = ({
38
40
  onCloseWindow,
39
41
  onBack,
40
42
  onTryAgain,
41
- totalAmount,
42
43
  isLoading,
43
44
  status,
44
45
  isAppUsingInIframe,
@@ -46,6 +47,8 @@ export const PaymentStatusPage = ({
46
47
  EventCardComponent,
47
48
  showCloseButton = false,
48
49
  email,
50
+ totalAmount = 0,
51
+ paymentMetadata,
49
52
  }: PaymentStatusComponentProps) => {
50
53
  const { t } = useTranslation("Design");
51
54
 
@@ -98,16 +101,26 @@ export const PaymentStatusPage = ({
98
101
  <PageBody.RightBlock
99
102
  bottomBlock={
100
103
  <BookingSummaryFooter showButton={false}>
101
- {bookingSummaryProps?.formValues ? (
102
- <BookingSummary.SummaryTotal
103
- formValues={bookingSummaryProps?.formValues}
104
- />
105
- ) : (
104
+ <div className="d-flex flex-column justify-content-between">
105
+ {paymentMetadata && (
106
+ <>
107
+ <SummaryTotalBlock
108
+ label={t("total")}
109
+ amount={paymentMetadata.total || 0}
110
+ />
111
+ <SummaryTotalBlock
112
+ label={t("paidSum")}
113
+ amount={paymentMetadata.paid || 0}
114
+ />
115
+ </>
116
+ )}
106
117
  <SummaryTotalBlock
107
- label={t("total")}
108
- amount={totalAmount || 0}
118
+ label={t(paymentMetadata ? "remaining" : "total")}
119
+ amount={
120
+ totalAmount + (bookingSummaryProps?.transactionFee || 0)
121
+ }
109
122
  />
110
- )}
123
+ </div>
111
124
  </BookingSummaryFooter>
112
125
  }
113
126
  >
@@ -28,6 +28,7 @@ export function StepsControl({ isLoading }: StepsControlProps) {
28
28
  formState: { errors, isSubmitting },
29
29
  clearErrors,
30
30
  getValues,
31
+ setFocus,
31
32
  } = form;
32
33
 
33
34
  const { fields, append, remove } = useFieldArray({
@@ -57,12 +58,14 @@ export function StepsControl({ isLoading }: StepsControlProps) {
57
58
  return (
58
59
  <>
59
60
  {fields.map((step, index) => {
60
- const stepData: any = getValues(`steps.${index}` as const);
61
+ const stepFieldName = `steps.${index}` as const;
62
+
63
+ const stepData = getValues(stepFieldName);
61
64
 
62
65
  return (
63
66
  <Controller
64
67
  key={`step-${step._id}`}
65
- name={`steps.${index}.name` as const}
68
+ name={`${stepFieldName}.name` as const}
66
69
  control={control}
67
70
  rules={{
68
71
  required: t("Validation:fieldRequired", {
@@ -104,6 +107,21 @@ export function StepsControl({ isLoading }: StepsControlProps) {
104
107
  ? step.productCategories.map(({ id }) => String(id))
105
108
  : []
106
109
  }
110
+ validate={() => {
111
+ // @TODO investigate why form return true in case
112
+ // when required field not filled. Looks like
113
+ // we cann't use default hookForm trigger function
114
+ // because we have venueMap outside this form.
115
+ // So before closing we need to check directly by
116
+ // error on name field. Instead of run trugger.
117
+ const error = errors.steps?.[index]?.name;
118
+
119
+ if (error) {
120
+ setFocus(`${stepFieldName}.name` as const);
121
+ }
122
+
123
+ return Promise.resolve(!error);
124
+ }}
107
125
  >
108
126
  <ProductCategoriesControl
109
127
  isLoading={isLoading}