@licklist/design 0.44.471 → 0.44.472

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":"CategoryProduct.d.ts","sourceRoot":"","sources":["../../../../../src/iframe/order-process/components/CategoryProduct/CategoryProduct.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGxD,UAAU,oBAAoB;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,kBAAkB,CAAC,EAAE,cAAc,CAAC,oBAAoB,CAAC,CAAC;CAC3D;AAED,eAAO,MAAM,eAAe,qEAKzB,oBAAoB,gBAmKtB,CAAC"}
1
+ {"version":3,"file":"CategoryProduct.d.ts","sourceRoot":"","sources":["../../../../../src/iframe/order-process/components/CategoryProduct/CategoryProduct.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGxD,UAAU,oBAAoB;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,kBAAkB,CAAC,EAAE,cAAc,CAAC,oBAAoB,CAAC,CAAC;CAC3D;AAED,eAAO,MAAM,eAAe,qEAKzB,oBAAoB,gBAwKtB,CAAC"}
@@ -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 r=require("react"),t=e(r),i=require("@licklist/core/dist/Config"),n=require("react-i18next"),a=require("react-hook-form"),c=e(require("@licklist/plugins/dist/services/Form/HookFormService")),o=e(require("clsx")),s=require("react-intl"),u=require("../../../event/ticket-description/TicketDescription.js"),d=require("./components/ProductQuantityInput/ProductQuantityInput.js");exports.CategoryProduct=function(e){var l=e.product,m=e.category,p=e.canExpandDescription,y=void 0===p||p,f=e.productsWithErrors,v=s.useIntl().formatNumber,E=n.useTranslation(["Design","Validation"]).t,g=a.useFormContext(),q=g.control,x=g.clearErrors,N=g.setError,_=r.useMemo((function(){if(f){var e=f.find((function(e){return e.product_id===l.id}));return null==e?void 0:e.message}}),[f,l.id]),A=r.useMemo((function(){if(m.allowDeposits&&l.deposit&&!(null==l?void 0:l.isSoldOut))return l.deposit}),[m,l]);return r.useEffect((function(){_&&N("".concat(l.id),{message:_,type:"validate"})}),[_,l.id]),t.createElement(a.Controller,{control:q,name:"".concat(l.id),rules:{required:l.isRequired,validate:function(e){if(!e)return!0;var r=l.isRequired,t=void 0!==r&&r,i=l.maxAmount,n=void 0===i?0:i,a=l.minAmount,c=void 0===a?0:a,o=e.quantity,s=void 0===o?0:o;return!s&&!t||(!s&&t?E("Design:pleaseSelectAtLeastFrom",{min:1,type:"item",from:"this category"}):s<c?E("Validation:fieldMinNumber",{min:l.minAmount,attribute:l.name}):!(n&&s>=c&&n<s)||E("Validation:quantityMaxNumber",{max:l.maxAmount}))}},render:function(e){var r=e.field,n=r.onChange,a=r.value,s=void 0===a?{}:a,p=r.ref,f=e.fieldState,g=f.invalid,q=f.error;return t.createElement("div",{id:String(l.id),className:"iframe-event__category-product"},t.createElement("div",{className:o("iframe-event__product",g&&"error")},t.createElement(u.TicketDescription,{title:l.name,description:l.description,className:o("iframe-event__product-description"),images:l.images,isRequired:l.isRequired,canExpand:y})),t.createElement("div",{className:"iframe-event__product-price-wrapper"},t.createElement("span",{className:"product-price"},v(null!=A?A:l.price,{style:"currency",currency:i.Currency.GBP})),t.createElement(d.ProductQuantityInput,{onChange:n,productInfo:s,ref:p,clearErrors:x,product:l,category:m,invalid:g,deposit:A})),A&&!(null==m?void 0:m.remainderExpireAfter)&&t.createElement("div",{className:"mt-4"},E("Design:payNowAndUponArrival",{deposit:v(A,{style:"currency",currency:i.Currency.GBP}),remainder:v(l.price-A,{style:"currency",currency:i.Currency.GBP})})),A&&(null==m?void 0:m.remainderExpireAfter)>0&&t.createElement("div",{className:"mt-4"},E("Design:payNowAndReminderDays",{deposit:v(A,{style:"currency",currency:i.Currency.GBP}),remainder:v(l.price-A,{style:"currency",currency:i.Currency.GBP}),days:null==m?void 0:m.remainderExpireAfter})),g&&t.createElement("div",{className:"d-flex mt-3 w-100"},t.createElement("p",{className:"iframe-event__message-error"},c.hasError(q,"required")&&E("Design:pleaseSelectAtLeastFrom",{min:1,type:"item",from:"this category"}),c.hasError(q,"validate")&&q.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 r=require("react"),t=e(r),i=require("@licklist/core/dist/Config"),n=require("react-i18next"),a=require("react-hook-form"),c=e(require("@licklist/plugins/dist/services/Form/HookFormService")),o=e(require("clsx")),s=require("react-intl"),u=require("../../../event/ticket-description/TicketDescription.js"),d=require("./components/ProductQuantityInput/ProductQuantityInput.js");exports.CategoryProduct=function(e){var l=e.product,m=e.category,p=e.canExpandDescription,y=void 0===p||p,f=e.productsWithErrors,v=s.useIntl().formatNumber,E=n.useTranslation(["Design","Validation"]).t,g=a.useFormContext(),q=g.control,x=g.clearErrors,N=g.setError,_=r.useMemo((function(){if(f){var e=f.find((function(e){return e.product_id===l.id}));return null==e?void 0:e.message}}),[f,l.id]),A=r.useMemo((function(){if(m.allowDeposits&&l.deposit&&!(null==l?void 0:l.isSoldOut)&&!(l.deposit>=l.price))return l.deposit}),[m,l]);return r.useEffect((function(){_&&N("".concat(l.id),{message:_,type:"validate"})}),[_,l.id]),t.createElement(a.Controller,{control:q,name:"".concat(l.id),rules:{required:l.isRequired,validate:function(e){if(!e)return!0;var r=l.isRequired,t=void 0!==r&&r,i=l.maxAmount,n=void 0===i?0:i,a=l.minAmount,c=void 0===a?0:a,o=e.quantity,s=void 0===o?0:o;return!s&&!t||(!s&&t?E("Design:pleaseSelectAtLeastFrom",{min:1,type:"item",from:"this category"}):s<c?E("Validation:fieldMinNumber",{min:l.minAmount,attribute:l.name}):!(n&&s>=c&&n<s)||E("Validation:quantityMaxNumber",{max:l.maxAmount}))}},render:function(e){var r=e.field,n=r.onChange,a=r.value,s=void 0===a?{}:a,p=r.ref,f=e.fieldState,g=f.invalid,q=f.error;return t.createElement("div",{id:String(l.id),className:"iframe-event__category-product"},t.createElement("div",{className:o("iframe-event__product",g&&"error")},t.createElement(u.TicketDescription,{title:l.name,description:l.description,className:o("iframe-event__product-description"),images:l.images,isRequired:l.isRequired,canExpand:y})),t.createElement("div",{className:"iframe-event__product-price-wrapper"},t.createElement("span",{className:"product-price"},v(null!=A?A:l.price,{style:"currency",currency:i.Currency.GBP})),t.createElement(d.ProductQuantityInput,{onChange:n,productInfo:s,ref:p,clearErrors:x,product:l,category:m,invalid:g,deposit:A})),A&&!(null==m?void 0:m.remainderExpireAfter)&&t.createElement("div",{className:"mt-4"},E("Design:payNowAndUponArrival",{deposit:v(A,{style:"currency",currency:i.Currency.GBP}),remainder:v(l.price-A,{style:"currency",currency:i.Currency.GBP})})),A&&(null==m?void 0:m.remainderExpireAfter)>0&&t.createElement("div",{className:"mt-4"},E("Design:payNowAndReminderDays",{deposit:v(A,{style:"currency",currency:i.Currency.GBP}),remainder:v(l.price-A,{style:"currency",currency:i.Currency.GBP}),days:null==m?void 0:m.remainderExpireAfter})),g&&t.createElement("div",{className:"d-flex mt-3 w-100"},t.createElement("p",{className:"iframe-event__message-error"},c.hasError(q,"required")&&E("Design:pleaseSelectAtLeastFrom",{min:1,type:"item",from:"this category"}),c.hasError(q,"validate")&&q.message)))}})};
@@ -2,13 +2,18 @@
2
2
  import { PaymentLinkResponse } from "@licklist/plugins/dist/hooks/Api/usePaymentApi";
3
3
  import { BookingSummaryProps } from "src/iframe/order-process/components/BookingSummary/types";
4
4
  import { RyftPaymentFormProps } from "../../ryft/RyftPaymentForm";
5
+ export interface PaymentMetadata {
6
+ total: number;
7
+ paid: number;
8
+ }
5
9
  interface PaymentProps extends RyftPaymentFormProps {
6
10
  onCloseIframePayment?: () => void;
7
11
  onFailIframePayment?: () => void;
8
12
  data?: PaymentLinkResponse;
9
13
  isLoading: boolean;
10
14
  bookingSummaryProps: Omit<BookingSummaryProps, "totallWithDiscount">;
15
+ paymentMetadata?: PaymentMetadata;
11
16
  }
12
- export declare const PaymentPage: ({ onCloseIframePayment, onFailIframePayment, data, isLoading, bookingSummaryProps, ...ryftPaymentFormProps }: PaymentProps) => JSX.Element;
17
+ export declare const PaymentPage: ({ onCloseIframePayment, onFailIframePayment, data, isLoading, bookingSummaryProps, paymentMetadata, ...ryftPaymentFormProps }: PaymentProps) => JSX.Element;
13
18
  export {};
14
19
  //# sourceMappingURL=PaymentPage.d.ts.map
@@ -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,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;CACtE;AAED,eAAO,MAAM,WAAW,iHAOrB,YAAY,gBAyGd,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,gBAqHd,CAAC"}
@@ -1 +1 @@
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,n=require("react-router-dom"),a=require("../../../static/loader/LoaderIndicator.js"),s=require("react-i18next"),i=require("react-bootstrap");require("../../../static/index.js"),require("../../order-process/components/NavigationFooter/NavigationFooter.js");var m=require("../../page/components/PageHeader/PageHeader.js"),c=require("@licklist/plugins/dist/context/payment/PaymentSessionContext"),l=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=t.__rest(e,["onCloseIframePayment","onFailIframePayment","data","isLoading","bookingSummaryProps"]),j=s.useTranslation("Design").t,v=n.useLocation().search,x=o.useContext(c.PaymentSessionContext).isPaymentSessionExpired,C=Boolean(new URLSearchParams(v).get("isIframePayment")),w=function(){window.close()};return o.useEffect((function(){C&&B&&window.addEventListener("beforeunload",(function(){B()}))}),[]),o.useEffect((function(){x&&C&&P&&P()}),[x]),E?r.createElement(a.LoaderIndicator,{isLoaded:!1}):null===k?r.createElement(f.Page,null,r.createElement(y.PageBody,{leftBlock:r.createElement(y.PageBody.LeftBlock,null,r.createElement("div",{className:"d-flex h-100 w-100 justify-content-center align-items-center flex-column"},r.createElement("h6",null,j("linkNotActiveOrExpired")),r.createElement(i.Col,{xs:12,md:3},r.createElement(i.Button,{className:"mt-5 w-20",onClick:function(){window.location.href="https://booked.it/"}},j("backToSite")))))})):r.createElement(f.Page,{className:"payment_link",headerBlock:r.createElement(m.PageHeader,{showBackButton:C,onBackButtonClick:C?w:void 0,showCloseButton:C,onCloseButtonClick:C?w:void 0},C&&r.createElement(g.PaymentTimer,null),r.createElement("div",{className:"d-flex align-items-center justify-content-center w-100"},j("paymentDetails")))},r.createElement(y.PageBody,{leftBlock:r.createElement(y.PageBody.LeftBlock,null,r.createElement(u.RyftPaymentForm,t.__assign({},q))),rightBlock:r.createElement(y.PageBody.RightBlock,{bottomBlock:r.createElement(p.BookingSummaryFooter,{showButton:!1},r.createElement("div",{className:"d-flex flex-column justify-content-between"},r.createElement(l.SummaryTotalBlock,{label:j("total"),amount:(null==k?void 0:k.amount)||0})))},r.createElement("h6",null,j("paymentDetails")),r.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,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},b&&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)))}))};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.44.471",
3
+ "version": "0.44.472",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
@@ -38,7 +38,12 @@ export const CategoryProduct = ({
38
38
  }, [productsWithErrors, product.id]);
39
39
 
40
40
  const deposit = useMemo(() => {
41
- if (!category.allowDeposits || !product.deposit || product?.isSoldOut) {
41
+ if (
42
+ !category.allowDeposits ||
43
+ !product.deposit ||
44
+ product?.isSoldOut ||
45
+ product.deposit >= product.price
46
+ ) {
42
47
  return undefined;
43
48
  }
44
49
  return product.deposit;
@@ -16,12 +16,18 @@ import { PaymentTimer } from "./PaymentTimer";
16
16
  import { Page, PageBody, PageHeader } from "../../page";
17
17
  import { BookingSummary, BookingSummaryFooter } from "../../order-process";
18
18
 
19
+ export interface PaymentMetadata {
20
+ total: number;
21
+ paid: number;
22
+ }
23
+
19
24
  interface PaymentProps extends RyftPaymentFormProps {
20
25
  onCloseIframePayment?: () => void;
21
26
  onFailIframePayment?: () => void;
22
27
  data?: PaymentLinkResponse;
23
28
  isLoading: boolean;
24
29
  bookingSummaryProps: Omit<BookingSummaryProps, "totallWithDiscount">;
30
+ paymentMetadata?: PaymentMetadata;
25
31
  }
26
32
 
27
33
  export const PaymentPage = ({
@@ -30,6 +36,7 @@ export const PaymentPage = ({
30
36
  data,
31
37
  isLoading,
32
38
  bookingSummaryProps,
39
+ paymentMetadata,
33
40
  ...ryftPaymentFormProps
34
41
  }: PaymentProps) => {
35
42
  const { t } = useTranslation("Design");
@@ -121,8 +128,20 @@ export const PaymentPage = ({
121
128
  bottomBlock={
122
129
  <BookingSummaryFooter showButton={false}>
123
130
  <div className="d-flex flex-column justify-content-between">
131
+ {paymentMetadata && (
132
+ <>
133
+ <SummaryTotalBlock
134
+ label={t("total")}
135
+ amount={paymentMetadata.total || 0}
136
+ />
137
+ <SummaryTotalBlock
138
+ label={t("paidSum")}
139
+ amount={paymentMetadata.paid || 0}
140
+ />
141
+ </>
142
+ )}
124
143
  <SummaryTotalBlock
125
- label={t("total")}
144
+ label={t(paymentMetadata ? "remaining" : "total")}
126
145
  amount={data?.amount || 0}
127
146
  />
128
147
  </div>