@licklist/design 0.54.0 → 0.56.0
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.
- package/dist/iframe/order-process/components/BookingSummary/BookingSummary.d.ts +1 -1
- package/dist/iframe/order-process/components/BookingSummary/BookingSummary.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/BookingSummary.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.d.ts +2 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.d.ts +2 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts +1 -0
- package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/utils/index.d.ts.map +1 -1
- package/dist/iframe/order-process/components/BookingSummary/utils/index.js +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.js +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts +2 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.js +1 -1
- package/dist/styles/snippet-templates/SnippetTemplate.scss +17 -11
- package/package.json +3 -3
- package/src/iframe/order-process/components/BookingSummary/BookingSummary.tsx +2 -0
- package/src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx +12 -6
- package/src/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.tsx +3 -0
- package/src/iframe/order-process/components/BookingSummary/types/index.ts +1 -0
- package/src/iframe/order-process/components/BookingSummary/utils/index.ts +2 -4
- package/src/iframe/order-process/components/CategoryProduct/CategoryProduct.tsx +13 -23
- package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +10 -3
- package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +9 -3
- package/src/styles/snippet-templates/SnippetTemplate.scss +17 -11
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { BookingSummaryProps } from "./types";
|
|
3
3
|
export declare const BookingSummary: {
|
|
4
|
-
({ date, time, menuSteps, formValues, shouldHidePeopleAmount, eventName, transactionFee, productsWithErrors, isLoading, hasPeopleInput, peopleAmount, }: Omit<BookingSummaryProps, "totallWithDiscount">): JSX.Element;
|
|
4
|
+
({ date, time, menuSteps, formValues, shouldHidePeopleAmount, eventName, transactionFee, productsWithErrors, isLoading, hasPeopleInput, isPaymentLink, peopleAmount, }: Omit<BookingSummaryProps, "totallWithDiscount">): JSX.Element;
|
|
5
5
|
SummaryTotal: ({ formValues, totalWithDiscount, transactionFee, isFreePayment, }: Pick<BookingSummaryProps, "formValues" | "totalWithDiscount" | "transactionFee" | "isFreePayment">) => JSX.Element;
|
|
6
6
|
Accordion: ({ children, title, showTitleOnlyOnMobile, hasPeopleInput, }: import("./components/BookingSummaryAccordion").BookingSummaryAccordionProps) => JSX.Element;
|
|
7
7
|
};
|
|
@@ -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;
|
|
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;4KAaxB,KAAK,mBAAmB,EAAE,oBAAoB,CAAC;;;CAuEjD,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 c=require("lodash"),o=require("react-intl");require("./components/SummaryTotal/components/SummaryTotalBlock.js");var
|
|
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 c=require("lodash"),o=require("react-intl");require("./components/SummaryTotal/components/SummaryTotalBlock.js");var s=require("./components/ProductsByMenuStep/ProductsByMenuStep.js"),l=require("./components/SummaryTotal/SummaryTotal.js"),i=require("./components/BookingSummaryAccordion/BookingSummaryAccordion.js"),u=function(e){var t,l=e.date,u=e.time,d=e.menuSteps,p=e.formValues,y=void 0===p?{}:p,E=e.shouldHidePeopleAmount,v=e.eventName,N=e.transactionFee,S=void 0===N?0:N,f=e.productsWithErrors,g=void 0===f?[]:f,k=e.isLoading,q=e.hasPeopleInput,B=e.isPaymentLink,h=e.peopleAmount,j=m.useTranslation("Design").t,P=o.useIntl().formatNumber;return k?r.createElement("div",{className:"payment-booking-summary"},r.createElement(n.LoaderIndicator,{isLoaded:!1})):r.createElement("div",{className:"payment-booking-summary"},r.createElement(i.BookingSummaryAccordion,{hasPeopleInput:q},r.createElement("div",{className:"event-info"},r.createElement("p",{className:"m-0 title event-name"},v),r.createElement("p",{className:"m-0"},l),u&&r.createElement("p",{className:"m-0"},u)),r.createElement("hr",null),(null===(t=c.values(y))||void 0===t?void 0:t.length)>0?r.createElement("div",null,r.createElement("div",{className:"cart-items"},r.createElement("div",{className:"products-by-menu-step"},d.map((function(e){return r.createElement(s.ProductsByMenuStep,{isPaymentLink:B,key:e.id,orderItems:y,step:e,productsWithErrors:g})}))),!E&&h>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"},j("people"),":"),r.createElement("p",{className:"price"},h))),!!S&&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"},j("transactionFee"),":"),r.createElement("p",{className:"price"},P(S,{style:"currency",currency:a.Currency.GBP})))))):r.createElement("div",{className:"cart-items"},r.createElement("p",{className:"empty-cart"},j("emptyBasket")))))};u.SummaryTotal=l.SummaryTotal,u.Accordion=i.BookingSummaryAccordion,exports.BookingSummary=u;
|
|
@@ -4,7 +4,8 @@ type ProductSummaryProps = {
|
|
|
4
4
|
name?: string;
|
|
5
5
|
productQuantityError?: string;
|
|
6
6
|
orderProduct: OrderItem;
|
|
7
|
+
isPaymentLink?: boolean;
|
|
7
8
|
};
|
|
8
|
-
export declare const ProductSummary: ({ name, productQuantityError, orderProduct, }: ProductSummaryProps) => JSX.Element;
|
|
9
|
+
export declare const ProductSummary: ({ name, productQuantityError, orderProduct, isPaymentLink, }: ProductSummaryProps) => JSX.Element;
|
|
9
10
|
export {};
|
|
10
11
|
//# sourceMappingURL=ProductSummary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductSummary.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,wDAAwD,CAAC;AAEnF,KAAK,mBAAmB,GAAG;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,YAAY,EAAE,SAAS,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"ProductSummary.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,wDAAwD,CAAC;AAEnF,KAAK,mBAAmB,GAAG;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,YAAY,EAAE,SAAS,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,cAAc,iEAKxB,mBAAmB,gBA8BrB,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("react-i18next"),l=require("react-intl");exports.ProductSummary=function(e){var t=e.name,
|
|
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("react-i18next"),l=require("react-intl");exports.ProductSummary=function(e){var t=e.name,i=e.productQuantityError,u=e.orderProduct,c=e.isPaymentLink,s=n.useTranslation("Design").t,o=(0,l.useIntl().formatNumber)((!c&&(null==u?void 0:u.hasDeposit)?null==u?void 0:u.deposit:null==u?void 0:u.price)*(null==u?void 0:u.quantity),{style:"currency",currency:a.Currency.GBP});return r.createElement("div",{className:"product"},r.createElement("p",{className:"m-0 name"},null!=t?t:null==u?void 0:u.name),r.createElement("div",{className:"d-flex justify-content-between"},r.createElement("p",{className:"m-0"},s("shortQuantity"),": ",null==u?void 0:u.quantity),r.createElement("p",{className:"price"},o)),i&&r.createElement("p",{className:"iframe-event__message-error"},i))};
|
|
@@ -6,6 +6,7 @@ export type ProductsByMenuStepsProps = {
|
|
|
6
6
|
orderItems: OrderItems;
|
|
7
7
|
step: MenuStep;
|
|
8
8
|
productsWithErrors?: QuantityCheckProductInfo[];
|
|
9
|
+
isPaymentLink?: boolean;
|
|
9
10
|
};
|
|
10
|
-
export declare const ProductsByMenuStep: ({ orderItems, step, productsWithErrors, }: ProductsByMenuStepsProps) => JSX.Element;
|
|
11
|
+
export declare const ProductsByMenuStep: ({ orderItems, step, productsWithErrors, isPaymentLink, }: ProductsByMenuStepsProps) => JSX.Element;
|
|
11
12
|
//# sourceMappingURL=ProductsByMenuStep.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductsByMenuStep.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAEL,UAAU,EACX,MAAM,wDAAwD,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,qDAAqD,CAAC;AAqB/E,MAAM,MAAM,wBAAwB,GAAG;IACrC,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,QAAQ,CAAC;IACf,kBAAkB,CAAC,EAAE,wBAAwB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"ProductsByMenuStep.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAEL,UAAU,EACX,MAAM,wDAAwD,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,qDAAqD,CAAC;AAqB/E,MAAM,MAAM,wBAAwB,GAAG;IACrC,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,QAAQ,CAAC;IACf,kBAAkB,CAAC,EAAE,wBAAwB,EAAE,CAAC;IAChD,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,kBAAkB,6DAK5B,wBAAwB,gBAwC1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("react"),t=(e=r)&&"object"==typeof e&&"default"in e?e.default:e,u=require("lodash"),n=require("../ProductSummary/ProductSummary.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("react"),t=(e=r)&&"object"==typeof e&&"default"in e?e.default:e,u=require("lodash"),n=require("../ProductSummary/ProductSummary.js"),a=require("../../utils/index.js");exports.ProductsByMenuStep=function(e){var r=e.orderItems,o=e.step,i=e.productsWithErrors,c=void 0===i?[]:i,d=e.isPaymentLink,s=o.productCategories;return function(e,r){var t=r.productCategories.map((function(e){return e.id}));return u.values(e).filter((function(e){return t.includes(e.productCategoryId)})).length>0}(r,o)?t.createElement("div",{className:"categories"},s.map((function(e){var o=function(e,r){return u.values(e).filter((function(e){return e.productCategoryId===r}))}(r,e.id);return 0===o.length?null:t.createElement("div",{key:e.id,className:"products"},t.createElement("p",{className:"m-0 title"},e.name),o.map((function(e){var r=a.getProductError(c,e.id);return t.createElement(n.ProductSummary,{isPaymentLink:d,key:e.id,name:e.name,productQuantityError:r,orderProduct:e})})))}))):null};
|
|
@@ -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,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,wDAAwD,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,qDAAqD,CAAC;AAE/E,eAAO,MAAM,YAAY,MAAM,CAAC;AAChC,eAAO,MAAM,aAAa,oBAAoB,CAAC;AAE/C,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,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,wBAAwB,EAAE,CAAC;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,wDAAwD,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,qDAAqD,CAAC;AAE/E,eAAO,MAAM,YAAY,MAAM,CAAC;AAChC,eAAO,MAAM,aAAa,oBAAoB,CAAC;AAE/C,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,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,wBAAwB,EAAE,CAAC;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,SAAS,EAAE,MAAM,wDAAwD,CAAC;AAEnF,eAAO,MAAM,sBAAsB,mBAAoB,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,SAAS,EAAE,MAAM,wDAAwD,CAAC;AAEnF,eAAO,MAAM,sBAAsB,mBAAoB,SAAS,EAAE,WASjE,CAAC;AAEF,eAAO,MAAM,eAAe,uBACN,wBAAwB,EAAE,aACnC,SAAS,CAAC,IAAI,CAAC,KACzB,MAAM,GAAG,SAGA,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.cartSumByOrderProducts=function(r){return r&&r.length?r.reduce((function(r,e){return e?r+((null==e?void 0:e.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.cartSumByOrderProducts=function(r){return r&&r.length?r.reduce((function(r,e){return e?r+((null==e?void 0:e.hasDeposit)?null==e?void 0:e.deposit:null==e?void 0:e.price)*e.quantity:0}),0):0},exports.getProductError=function(r,e){var t;return null===(t=r.find((function(r){return r.product_id===e})))||void 0===t?void 0:t.message};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CategoryProduct.d.ts","sourceRoot":"","sources":["../../../../../src/iframe/order-process/components/CategoryProduct/CategoryProduct.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EACL,OAAO,EACP,eAAe,EAChB,MAAM,qDAAqD,CAAC;AAI7D,UAAU,oBAAoB;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,kBAAkB,CAAC,EAAE,wBAAwB,EAAE,CAAC;IAChD,eAAe,CAAC,EAAE,wBAAwB,EAAE,CAAC;CAC9C;AAED,eAAO,MAAM,eAAe,sFAMzB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"CategoryProduct.d.ts","sourceRoot":"","sources":["../../../../../src/iframe/order-process/components/CategoryProduct/CategoryProduct.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EACL,OAAO,EACP,eAAe,EAChB,MAAM,qDAAqD,CAAC;AAI7D,UAAU,oBAAoB;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,kBAAkB,CAAC,EAAE,wBAAwB,EAAE,CAAC;IAChD,eAAe,CAAC,EAAE,wBAAwB,EAAE,CAAC;CAC9C;AAED,eAAO,MAAM,eAAe,sFAMzB,oBAAoB,gBAgLtB,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("tslib"),t=require("react"),i=e(t),n=require("@licklist/core/dist/Config"),
|
|
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("tslib"),t=require("react"),i=e(t),n=require("@licklist/core/dist/Config"),o=require("react-i18next"),a=require("react-hook-form"),c=e(require("@licklist/plugins/dist/services/Form/HookFormService")),s=e(require("clsx")),u=require("react-intl"),l=require("../../../event/ticket-description/TicketDescription.js"),d=require("./components/ProductQuantityInput/ProductQuantityInput.js");exports.CategoryProduct=function(e){var m=e.product,p=e.category,v=e.canExpandDescription,y=void 0===v||v,f=e.productsWithErrors,g=e.soldOutProducts,E=u.useIntl().formatNumber,q=o.useTranslation(["Design","Validation"]).t,_=a.useFormContext(),x=_.control,N=_.clearErrors,A=_.setError,C=t.useMemo((function(){if(f){var e=f.find((function(e){return e.product_id===m.id}));return null==e?void 0:e.message}}),[f,m.id]),D=function(){if(g&&!(null==m?void 0:m.isSoldOut)){var e=g.find((function(e){return e.product_id===m.id}));return!!(null==e?void 0:e.message)}};return t.useEffect((function(){C&&A("".concat(m.id),{message:C,type:"validate"})}),[C,m.id]),i.createElement(a.Controller,{control:x,name:"".concat(m.id),rules:{required:m.isRequired,validate:function(e){var r,t=m.isRequired,i=void 0!==t&&t,n=m.maxAmount,o=void 0===n?0:n,a=m.minAmount,c=void 0===a?0:a,s=null!==(r=null==e?void 0:e.quantity)&&void 0!==r?r:0;return!e||(!s&&!i||(!s&&i?q("Design:pleaseSelectAtLeastFrom",{min:1,type:"item",from:"this category"}):s<c?q("Validation:fieldMinNumber",{min:m.minAmount,attribute:m.name}):!(o&&s>=c&&o<s)||q("Validation:quantityMaxNumber",{max:m.maxAmount})))}},render:function(e){var t=e.field,o=t.onChange,a=t.value,u=void 0===a?{}:a,v=t.ref,f=e.fieldState,g=f.invalid,_=f.error;return i.createElement("div",{id:String(m.id),className:"iframe-event__category-product"},i.createElement("div",{className:s("iframe-event__product",g&&"error")},i.createElement(l.TicketDescription,{title:m.name,description:m.description,className:s("iframe-event__product-description"),images:m.images,isRequired:m.isRequired,canExpand:y})),i.createElement("div",{className:"iframe-event__product-price-wrapper"},i.createElement("span",{className:"product-price"},E(p.allowDeposits?null==m?void 0:m.deposit:m.price,{style:"currency",currency:n.Currency.GBP})),i.createElement(d.ProductQuantityInput,{onChange:o,productInfo:u,refCallback:v,clearErrors:N,product:r.__assign(r.__assign({},m),{isSoldOut:(null==m?void 0:m.isSoldOut)||D()}),category:p,invalid:g})),p.allowDeposits&&!(null==p?void 0:p.remainderExpireAfter)&&i.createElement("div",{className:"mt-4"},q("Design:payNowAndUponArrival",{deposit:E(null==m?void 0:m.deposit,{style:"currency",currency:n.Currency.GBP}),remainder:E(m.price-(null==m?void 0:m.deposit),{style:"currency",currency:n.Currency.GBP})})),p.allowDeposits&&(null==p?void 0:p.remainderExpireAfter)>0&&i.createElement("div",{className:"mt-4"},q("Design:payNowAndReminderDays",{deposit:E(null==m?void 0:m.deposit,{style:"currency",currency:n.Currency.GBP}),remainder:E(m.price-(null==m?void 0:m.deposit),{style:"currency",currency:n.Currency.GBP}),days:null==p?void 0:p.remainderExpireAfter})),g&&i.createElement("div",{className:"d-flex mt-3 w-100"},i.createElement("p",{className:"iframe-event__message-error"},c.hasError(_,"required")&&q("Design:pleaseSelectAtLeastFrom",{min:1,type:"item",from:"this category"}),c.hasError(_,"validate")&&_.message)))}})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAI1C,UAAU,gBAAgB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAI1C,UAAU,gBAAgB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,WAAW,2FA4EvB,CAAC"}
|
package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js
CHANGED
|
@@ -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("react"),n=e(t),
|
|
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("react"),n=e(t),a=require("react-bootstrap"),r=e(require("clsx")),u=t.forwardRef((function(e,t){var u=e.className,o=void 0===u?"":u,i=e.value,l=e.onChange,d=e.onArrowDown,c=e.onArrowUp,m=e.min,b=e.max,p=e.placeholder,s=e.defaultValue,f=e.disabled,v=!i,y=void 0!==b&&i===b,N=r("payment-number-input",o);return n.createElement("div",{className:N},n.createElement("button",{type:"button",onClick:function(){void 0!==m&&i>m&&d(i-1),void 0===m&&c(i-1)},className:"payment-number-input__btn-down ".concat(v&&"disabled-number-input-button"),disabled:f},"−"),n.createElement(a.FormControl,{type:"number",onChange:function(e){return l(Number(e.target.value))},value:i,min:m,max:b,defaultValue:s,placeholder:p,height:"5rem",disabled:f,ref:t}),n.createElement("button",{type:"button",onClick:function(){void 0!==b&&(i||0)<b&&c(i+1),void 0===b&&c(i+1)},className:"payment-number-input__btn-up ".concat(y&&"disabled-number-input-button"),disabled:f},"+"))}));u.displayName="NumberInput",exports.NumberInput=u;
|
|
@@ -7,6 +7,7 @@ interface FormOrderItem {
|
|
|
7
7
|
name: string;
|
|
8
8
|
price: number;
|
|
9
9
|
productCategoryId: number;
|
|
10
|
+
hasDeposit?: boolean;
|
|
10
11
|
zoneId?: Zone["id"];
|
|
11
12
|
deposit?: number | null;
|
|
12
13
|
quantity: number;
|
|
@@ -22,6 +23,6 @@ interface ProductQuantityInputProps {
|
|
|
22
23
|
invalid: boolean;
|
|
23
24
|
productInfo: FormOrderItem;
|
|
24
25
|
}
|
|
25
|
-
export declare const ProductQuantityInput: ({ product, category, onChange: _onChange, clearErrors, refCallback, productInfo, invalid,
|
|
26
|
+
export declare const ProductQuantityInput: ({ product, category, onChange: _onChange, clearErrors, refCallback, productInfo, invalid, }: ProductQuantityInputProps) => JSX.Element;
|
|
26
27
|
export {};
|
|
27
28
|
//# sourceMappingURL=ProductQuantityInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductQuantityInput.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAE,IAAI,EAAE,MAAM,wDAAwD,CAAC;AAC9E,OAAO,EACL,OAAO,EACP,eAAe,EAChB,MAAM,qDAAqD,CAAC;AAG7D,UAAU,aAAa;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,UAAU,yBAAyB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,WAAW,EAAE,kBAAkB,CAAC,WAAW,CAAC,CAAC;IAC7C,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,aAAa,CAAC;CAC5B;AAED,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"ProductQuantityInput.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAE,IAAI,EAAE,MAAM,wDAAwD,CAAC;AAC9E,OAAO,EACL,OAAO,EACP,eAAe,EAChB,MAAM,qDAAqD,CAAC;AAG7D,UAAU,aAAa;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,UAAU,yBAAyB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,WAAW,EAAE,kBAAkB,CAAC,WAAW,CAAC,CAAC;IAC7C,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,aAAa,CAAC;CAC5B;AAED,eAAO,MAAM,oBAAoB,gGAQ9B,yBAAyB,gBAsE3B,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 t=e(require("react")),n=require("react-i18next"),
|
|
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=e(require("react")),n=require("react-i18next"),o=require("react-bootstrap"),u=e(require("clsx")),i=require("../NumberInput/NumberInput.js");exports.ProductQuantityInput=function(e){var r=e.product,l=e.category,a=e.onChange,c=e.clearErrors,d=e.refCallback,s=e.productInfo,m=e.invalid,v=n.useTranslation("Design").t,p=function(e){var t,n=e;(null==r?void 0:r.maxAmount)&&e>(null==r?void 0:r.maxAmount)&&(n=null==r?void 0:r.maxAmount),a({id:r.id,name:r.name,deposit:null==r?void 0:r.deposit,hasDeposit:l.allowDeposits,price:r.price,productCategoryId:l.id,zoneId:null===(t=l.zone)||void 0===t?void 0:t.id,quantity:n,capacity:null==r?void 0:r.capacity})};return r.isSoldOut?t.createElement("div",{className:"iframe-event__sold-out-wrapper"},v("Design:soldOut")):1===(null==r?void 0:r.maxAmount)?t.createElement(o.Button,{ref:d,disabled:r.isSoldOut,className:u("iframe-event__".concat((null==s?void 0:s.quantity)?"unselect-product":"select-product"),m&&"error"),onClick:function(){return p((null==s?void 0:s.quantity)?0:1)}},v("Design:".concat((null==s?void 0:s.quantity)?"unselect":"select"))):t.createElement(i.NumberInput,{ref:d,onChange:function(e){p(e||null),c("".concat(r.id))},onArrowDown:function(){p((null==s?void 0:s.quantity)-1||0),c("".concat(r.id))},onArrowUp:function(){var e;p((null!==(e=null==s?void 0:s.quantity)&&void 0!==e?e:0)+1),c("".concat(r.id))},min:0,max:(null==r?void 0:r.maxAmount)?Number(null==r?void 0:r.maxAmount):void 0,placeholder:"0",disabled:r.isSoldOut,value:null==s?void 0:s.quantity,className:u(m&&"error")})};
|
|
@@ -59,7 +59,8 @@
|
|
|
59
59
|
color: $snippet-elements-button-color;
|
|
60
60
|
border: none;
|
|
61
61
|
background-color: $snippet-elements-button-background-color;
|
|
62
|
-
box-shadow: 0 0 0 $input-btn-focus-width
|
|
62
|
+
box-shadow: 0 0 0 $input-btn-focus-width
|
|
63
|
+
$snippet-elements-button-background-color;
|
|
63
64
|
}
|
|
64
65
|
|
|
65
66
|
&:disabled {
|
|
@@ -72,14 +73,14 @@
|
|
|
72
73
|
&:focus,
|
|
73
74
|
&.focus {
|
|
74
75
|
&:not(:disabled) {
|
|
75
|
-
opacity: .7;
|
|
76
|
+
opacity: 0.7;
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
79
|
|
|
79
80
|
&:active,
|
|
80
81
|
&.active {
|
|
81
82
|
&:not(:disabled) {
|
|
82
|
-
opacity: .8;
|
|
83
|
+
opacity: 0.8;
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
86
|
}
|
|
@@ -90,7 +91,7 @@
|
|
|
90
91
|
}
|
|
91
92
|
|
|
92
93
|
&__label {
|
|
93
|
-
font-size: .8rem;
|
|
94
|
+
font-size: 0.8rem;
|
|
94
95
|
margin-top: 1rem;
|
|
95
96
|
margin-bottom: 0.2rem;
|
|
96
97
|
}
|
|
@@ -103,8 +104,8 @@
|
|
|
103
104
|
position: absolute;
|
|
104
105
|
top: 0;
|
|
105
106
|
right: 0;
|
|
106
|
-
margin-right: .5rem;
|
|
107
|
-
margin-top: .5rem;
|
|
107
|
+
margin-right: 0.5rem;
|
|
108
|
+
margin-top: 0.5rem;
|
|
108
109
|
}
|
|
109
110
|
|
|
110
111
|
.form-label {
|
|
@@ -181,7 +182,8 @@
|
|
|
181
182
|
color: $snippet-elements-button-color;
|
|
182
183
|
border: none;
|
|
183
184
|
background-color: $snippet-elements-button-background-color;
|
|
184
|
-
box-shadow: 0 0 0 $input-btn-focus-width
|
|
185
|
+
box-shadow: 0 0 0 $input-btn-focus-width
|
|
186
|
+
$snippet-elements-button-background-color;
|
|
185
187
|
}
|
|
186
188
|
|
|
187
189
|
&:disabled {
|
|
@@ -194,14 +196,14 @@
|
|
|
194
196
|
&:focus,
|
|
195
197
|
&.focus {
|
|
196
198
|
&:not(:disabled) {
|
|
197
|
-
opacity:
|
|
199
|
+
opacity: 0.7;
|
|
198
200
|
}
|
|
199
201
|
}
|
|
200
202
|
|
|
201
203
|
&:active,
|
|
202
204
|
&.active {
|
|
203
205
|
&:not(:disabled) {
|
|
204
|
-
opacity: .8;
|
|
206
|
+
opacity: 0.8;
|
|
205
207
|
}
|
|
206
208
|
}
|
|
207
209
|
}
|
|
@@ -336,7 +338,8 @@
|
|
|
336
338
|
}
|
|
337
339
|
}
|
|
338
340
|
|
|
339
|
-
.bottom-wrapper,
|
|
341
|
+
.bottom-wrapper,
|
|
342
|
+
.snippet-template__form {
|
|
340
343
|
.btn {
|
|
341
344
|
border-radius: 0.25rem;
|
|
342
345
|
width: 100%;
|
|
@@ -381,6 +384,10 @@
|
|
|
381
384
|
}
|
|
382
385
|
}
|
|
383
386
|
|
|
387
|
+
.disabled-number-input-button {
|
|
388
|
+
background-color: $snippet-calendar-disabled-button-font-color !important;
|
|
389
|
+
border-color: $snippet-calendar-disabled-button-font-color !important;
|
|
390
|
+
}
|
|
384
391
|
.color-picker {
|
|
385
392
|
&__color {
|
|
386
393
|
position: absolute;
|
|
@@ -442,7 +449,6 @@
|
|
|
442
449
|
}
|
|
443
450
|
}
|
|
444
451
|
}
|
|
445
|
-
|
|
446
452
|
}
|
|
447
453
|
|
|
448
454
|
@include media-breakpoint-down(xs) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@licklist/design",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.56.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"@fortawesome/free-brands-svg-icons": "5.15.2",
|
|
54
54
|
"@fortawesome/free-solid-svg-icons": "5.15.2",
|
|
55
55
|
"@fortawesome/react-fontawesome": "0.1.9",
|
|
56
|
-
"@licklist/core": "^0.
|
|
56
|
+
"@licklist/core": "^0.20.0",
|
|
57
57
|
"@licklist/eslint-config": "0.3.4",
|
|
58
|
-
"@licklist/plugins": "^0.
|
|
58
|
+
"@licklist/plugins": "^0.26.0",
|
|
59
59
|
"@mdx-js/react": "1.6.22",
|
|
60
60
|
"@popperjs/core": "2.11.8",
|
|
61
61
|
"@react-aria/utils": "3.9.0",
|
|
@@ -20,6 +20,7 @@ export const BookingSummary = ({
|
|
|
20
20
|
productsWithErrors = [],
|
|
21
21
|
isLoading,
|
|
22
22
|
hasPeopleInput,
|
|
23
|
+
isPaymentLink,
|
|
23
24
|
peopleAmount,
|
|
24
25
|
}: Omit<BookingSummaryProps, "totallWithDiscount">) => {
|
|
25
26
|
const { t } = useTranslation("Design");
|
|
@@ -49,6 +50,7 @@ export const BookingSummary = ({
|
|
|
49
50
|
<div className="products-by-menu-step">
|
|
50
51
|
{menuSteps.map((menuStep) => (
|
|
51
52
|
<ProductsByMenuStep
|
|
53
|
+
isPaymentLink={isPaymentLink}
|
|
52
54
|
key={menuStep.id}
|
|
53
55
|
orderItems={formValues}
|
|
54
56
|
step={menuStep}
|
|
@@ -8,21 +8,27 @@ type ProductSummaryProps = {
|
|
|
8
8
|
name?: string;
|
|
9
9
|
productQuantityError?: string;
|
|
10
10
|
orderProduct: OrderItem;
|
|
11
|
+
isPaymentLink?: boolean;
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
export const ProductSummary = ({
|
|
14
15
|
name,
|
|
15
16
|
productQuantityError,
|
|
16
17
|
orderProduct,
|
|
18
|
+
isPaymentLink,
|
|
17
19
|
}: ProductSummaryProps) => {
|
|
18
20
|
const { t } = useTranslation("Design");
|
|
19
21
|
const { formatNumber } = useIntl();
|
|
20
22
|
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
orderProduct?.
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
const priceForOneProduct =
|
|
24
|
+
!isPaymentLink && orderProduct?.hasDeposit
|
|
25
|
+
? orderProduct?.deposit
|
|
26
|
+
: orderProduct?.price;
|
|
27
|
+
|
|
28
|
+
const fullPrice = formatNumber(priceForOneProduct * orderProduct?.quantity, {
|
|
29
|
+
style: "currency",
|
|
30
|
+
currency: Config.Currency.GBP,
|
|
31
|
+
});
|
|
26
32
|
|
|
27
33
|
return (
|
|
28
34
|
<div className="product">
|
|
@@ -32,7 +38,7 @@ export const ProductSummary = ({
|
|
|
32
38
|
{t("shortQuantity")}: {orderProduct?.quantity}
|
|
33
39
|
</p>
|
|
34
40
|
|
|
35
|
-
<p className="price">{
|
|
41
|
+
<p className="price">{fullPrice}</p>
|
|
36
42
|
</div>
|
|
37
43
|
|
|
38
44
|
{productQuantityError && (
|
|
@@ -29,12 +29,14 @@ export type ProductsByMenuStepsProps = {
|
|
|
29
29
|
orderItems: OrderItems;
|
|
30
30
|
step: MenuStep;
|
|
31
31
|
productsWithErrors?: QuantityCheckProductInfo[];
|
|
32
|
+
isPaymentLink?: boolean;
|
|
32
33
|
};
|
|
33
34
|
|
|
34
35
|
export const ProductsByMenuStep = ({
|
|
35
36
|
orderItems,
|
|
36
37
|
step,
|
|
37
38
|
productsWithErrors = [],
|
|
39
|
+
isPaymentLink,
|
|
38
40
|
}: ProductsByMenuStepsProps) => {
|
|
39
41
|
const { productCategories } = step;
|
|
40
42
|
|
|
@@ -62,6 +64,7 @@ export const ProductsByMenuStep = ({
|
|
|
62
64
|
|
|
63
65
|
return (
|
|
64
66
|
<ProductSummary
|
|
67
|
+
isPaymentLink={isPaymentLink}
|
|
65
68
|
key={orderItem.id}
|
|
66
69
|
name={orderItem.name}
|
|
67
70
|
productQuantityError={productQuantityError}
|
|
@@ -7,10 +7,8 @@ export const cartSumByOrderProducts = (orderProducts?: OrderItem[]) => {
|
|
|
7
7
|
}
|
|
8
8
|
return orderProducts.reduce((prevSumValue: number, product) => {
|
|
9
9
|
if (!product) return 0;
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
prevSumValue + (product?.deposit || product?.price) * product.quantity
|
|
13
|
-
);
|
|
10
|
+
const price = product?.hasDeposit ? product?.deposit : product?.price;
|
|
11
|
+
return prevSumValue + price * product.quantity;
|
|
14
12
|
}, 0);
|
|
15
13
|
};
|
|
16
14
|
|
|
@@ -42,18 +42,6 @@ export const CategoryProduct = ({
|
|
|
42
42
|
return error?.message;
|
|
43
43
|
}, [productsWithErrors, product.id]);
|
|
44
44
|
|
|
45
|
-
const deposit = useMemo(() => {
|
|
46
|
-
if (
|
|
47
|
-
!category.allowDeposits ||
|
|
48
|
-
!product.deposit ||
|
|
49
|
-
product?.isSoldOut ||
|
|
50
|
-
product.deposit >= product.price
|
|
51
|
-
) {
|
|
52
|
-
return undefined;
|
|
53
|
-
}
|
|
54
|
-
return product.deposit;
|
|
55
|
-
}, [category, product]);
|
|
56
|
-
|
|
57
45
|
const checkIfSoldOutProduct = () => {
|
|
58
46
|
if (!soldOutProducts || product?.isSoldOut) {
|
|
59
47
|
return undefined;
|
|
@@ -146,10 +134,13 @@ export const CategoryProduct = ({
|
|
|
146
134
|
</div>
|
|
147
135
|
<div className="iframe-event__product-price-wrapper">
|
|
148
136
|
<span className="product-price">
|
|
149
|
-
{formatNumber(
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
137
|
+
{formatNumber(
|
|
138
|
+
category.allowDeposits ? product?.deposit : product.price,
|
|
139
|
+
{
|
|
140
|
+
style: "currency",
|
|
141
|
+
currency: Config.Currency.GBP,
|
|
142
|
+
}
|
|
143
|
+
)}
|
|
153
144
|
</span>
|
|
154
145
|
<ProductQuantityInput
|
|
155
146
|
onChange={onChange}
|
|
@@ -162,17 +153,16 @@ export const CategoryProduct = ({
|
|
|
162
153
|
}}
|
|
163
154
|
category={category}
|
|
164
155
|
invalid={invalid}
|
|
165
|
-
deposit={deposit}
|
|
166
156
|
/>
|
|
167
157
|
</div>
|
|
168
|
-
{
|
|
158
|
+
{category.allowDeposits && !category?.remainderExpireAfter && (
|
|
169
159
|
<div className="mt-4">
|
|
170
160
|
{t("Design:payNowAndUponArrival", {
|
|
171
|
-
deposit: formatNumber(deposit, {
|
|
161
|
+
deposit: formatNumber(product?.deposit, {
|
|
172
162
|
style: "currency",
|
|
173
163
|
currency: Config.Currency.GBP,
|
|
174
164
|
}),
|
|
175
|
-
remainder: formatNumber(product.price - deposit, {
|
|
165
|
+
remainder: formatNumber(product.price - product?.deposit, {
|
|
176
166
|
style: "currency",
|
|
177
167
|
currency: Config.Currency.GBP,
|
|
178
168
|
}),
|
|
@@ -180,14 +170,14 @@ export const CategoryProduct = ({
|
|
|
180
170
|
</div>
|
|
181
171
|
)}
|
|
182
172
|
|
|
183
|
-
{
|
|
173
|
+
{category.allowDeposits && category?.remainderExpireAfter > 0 && (
|
|
184
174
|
<div className="mt-4">
|
|
185
175
|
{t("Design:payNowAndReminderDays", {
|
|
186
|
-
deposit: formatNumber(deposit, {
|
|
176
|
+
deposit: formatNumber(product?.deposit, {
|
|
187
177
|
style: "currency",
|
|
188
178
|
currency: Config.Currency.GBP,
|
|
189
179
|
}),
|
|
190
|
-
remainder: formatNumber(product.price - deposit, {
|
|
180
|
+
remainder: formatNumber(product.price - product?.deposit, {
|
|
191
181
|
style: "currency",
|
|
192
182
|
currency: Config.Currency.GBP,
|
|
193
183
|
}),
|
package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx
CHANGED
|
@@ -31,8 +31,11 @@ export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>(
|
|
|
31
31
|
},
|
|
32
32
|
ref
|
|
33
33
|
) => {
|
|
34
|
+
const minusButtonGreyedOut = !value;
|
|
35
|
+
const plusButtonGreyedOut = max !== undefined && value === max;
|
|
36
|
+
|
|
34
37
|
const handleArrowUpClick = () => {
|
|
35
|
-
if (max !== undefined && value < max) {
|
|
38
|
+
if (max !== undefined && (value || 0) < max) {
|
|
36
39
|
onArrowUp(value + 1);
|
|
37
40
|
}
|
|
38
41
|
if (max === undefined) {
|
|
@@ -56,7 +59,9 @@ export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>(
|
|
|
56
59
|
<button
|
|
57
60
|
type="button"
|
|
58
61
|
onClick={handleArrowDownClick}
|
|
59
|
-
className=
|
|
62
|
+
className={`payment-number-input__btn-down ${
|
|
63
|
+
minusButtonGreyedOut && "disabled-number-input-button"
|
|
64
|
+
}`}
|
|
60
65
|
disabled={disabled}
|
|
61
66
|
>
|
|
62
67
|
−
|
|
@@ -76,7 +81,9 @@ export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>(
|
|
|
76
81
|
<button
|
|
77
82
|
type="button"
|
|
78
83
|
onClick={handleArrowUpClick}
|
|
79
|
-
className=
|
|
84
|
+
className={`payment-number-input__btn-up ${
|
|
85
|
+
plusButtonGreyedOut && "disabled-number-input-button"
|
|
86
|
+
}`}
|
|
80
87
|
disabled={disabled}
|
|
81
88
|
>
|
|
82
89
|
+
|
|
@@ -15,6 +15,7 @@ interface FormOrderItem {
|
|
|
15
15
|
name: string;
|
|
16
16
|
price: number;
|
|
17
17
|
productCategoryId: number;
|
|
18
|
+
hasDeposit?: boolean;
|
|
18
19
|
zoneId?: Zone["id"];
|
|
19
20
|
deposit?: number | null;
|
|
20
21
|
quantity: number;
|
|
@@ -40,19 +41,23 @@ export const ProductQuantityInput = ({
|
|
|
40
41
|
refCallback,
|
|
41
42
|
productInfo,
|
|
42
43
|
invalid,
|
|
43
|
-
deposit,
|
|
44
44
|
}: ProductQuantityInputProps) => {
|
|
45
45
|
const { t } = useTranslation("Design");
|
|
46
46
|
|
|
47
47
|
const onChange = (quantity: number | null) => {
|
|
48
|
+
let productQuantity = quantity;
|
|
49
|
+
if (product?.maxAmount && quantity > product?.maxAmount) {
|
|
50
|
+
productQuantity = product?.maxAmount;
|
|
51
|
+
}
|
|
48
52
|
_onChange({
|
|
49
53
|
id: product.id,
|
|
50
54
|
name: product.name,
|
|
51
|
-
deposit,
|
|
55
|
+
deposit: product?.deposit,
|
|
56
|
+
hasDeposit: category.allowDeposits,
|
|
52
57
|
price: product.price,
|
|
53
58
|
productCategoryId: category.id,
|
|
54
59
|
zoneId: category.zone?.id,
|
|
55
|
-
quantity,
|
|
60
|
+
quantity: productQuantity,
|
|
56
61
|
capacity: product?.capacity,
|
|
57
62
|
});
|
|
58
63
|
};
|
|
@@ -99,6 +104,7 @@ export const ProductQuantityInput = ({
|
|
|
99
104
|
clearErrors(`${product.id}` as const);
|
|
100
105
|
}}
|
|
101
106
|
min={0}
|
|
107
|
+
max={product?.maxAmount ? Number(product?.maxAmount) : undefined}
|
|
102
108
|
placeholder="0"
|
|
103
109
|
disabled={product.isSoldOut}
|
|
104
110
|
value={productInfo?.quantity}
|
|
@@ -59,7 +59,8 @@
|
|
|
59
59
|
color: $snippet-elements-button-color;
|
|
60
60
|
border: none;
|
|
61
61
|
background-color: $snippet-elements-button-background-color;
|
|
62
|
-
box-shadow: 0 0 0 $input-btn-focus-width
|
|
62
|
+
box-shadow: 0 0 0 $input-btn-focus-width
|
|
63
|
+
$snippet-elements-button-background-color;
|
|
63
64
|
}
|
|
64
65
|
|
|
65
66
|
&:disabled {
|
|
@@ -72,14 +73,14 @@
|
|
|
72
73
|
&:focus,
|
|
73
74
|
&.focus {
|
|
74
75
|
&:not(:disabled) {
|
|
75
|
-
opacity: .7;
|
|
76
|
+
opacity: 0.7;
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
79
|
|
|
79
80
|
&:active,
|
|
80
81
|
&.active {
|
|
81
82
|
&:not(:disabled) {
|
|
82
|
-
opacity: .8;
|
|
83
|
+
opacity: 0.8;
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
86
|
}
|
|
@@ -90,7 +91,7 @@
|
|
|
90
91
|
}
|
|
91
92
|
|
|
92
93
|
&__label {
|
|
93
|
-
font-size: .8rem;
|
|
94
|
+
font-size: 0.8rem;
|
|
94
95
|
margin-top: 1rem;
|
|
95
96
|
margin-bottom: 0.2rem;
|
|
96
97
|
}
|
|
@@ -103,8 +104,8 @@
|
|
|
103
104
|
position: absolute;
|
|
104
105
|
top: 0;
|
|
105
106
|
right: 0;
|
|
106
|
-
margin-right: .5rem;
|
|
107
|
-
margin-top: .5rem;
|
|
107
|
+
margin-right: 0.5rem;
|
|
108
|
+
margin-top: 0.5rem;
|
|
108
109
|
}
|
|
109
110
|
|
|
110
111
|
.form-label {
|
|
@@ -181,7 +182,8 @@
|
|
|
181
182
|
color: $snippet-elements-button-color;
|
|
182
183
|
border: none;
|
|
183
184
|
background-color: $snippet-elements-button-background-color;
|
|
184
|
-
box-shadow: 0 0 0 $input-btn-focus-width
|
|
185
|
+
box-shadow: 0 0 0 $input-btn-focus-width
|
|
186
|
+
$snippet-elements-button-background-color;
|
|
185
187
|
}
|
|
186
188
|
|
|
187
189
|
&:disabled {
|
|
@@ -194,14 +196,14 @@
|
|
|
194
196
|
&:focus,
|
|
195
197
|
&.focus {
|
|
196
198
|
&:not(:disabled) {
|
|
197
|
-
opacity:
|
|
199
|
+
opacity: 0.7;
|
|
198
200
|
}
|
|
199
201
|
}
|
|
200
202
|
|
|
201
203
|
&:active,
|
|
202
204
|
&.active {
|
|
203
205
|
&:not(:disabled) {
|
|
204
|
-
opacity: .8;
|
|
206
|
+
opacity: 0.8;
|
|
205
207
|
}
|
|
206
208
|
}
|
|
207
209
|
}
|
|
@@ -336,7 +338,8 @@
|
|
|
336
338
|
}
|
|
337
339
|
}
|
|
338
340
|
|
|
339
|
-
.bottom-wrapper,
|
|
341
|
+
.bottom-wrapper,
|
|
342
|
+
.snippet-template__form {
|
|
340
343
|
.btn {
|
|
341
344
|
border-radius: 0.25rem;
|
|
342
345
|
width: 100%;
|
|
@@ -381,6 +384,10 @@
|
|
|
381
384
|
}
|
|
382
385
|
}
|
|
383
386
|
|
|
387
|
+
.disabled-number-input-button {
|
|
388
|
+
background-color: $snippet-calendar-disabled-button-font-color !important;
|
|
389
|
+
border-color: $snippet-calendar-disabled-button-font-color !important;
|
|
390
|
+
}
|
|
384
391
|
.color-picker {
|
|
385
392
|
&__color {
|
|
386
393
|
position: absolute;
|
|
@@ -442,7 +449,6 @@
|
|
|
442
449
|
}
|
|
443
450
|
}
|
|
444
451
|
}
|
|
445
|
-
|
|
446
452
|
}
|
|
447
453
|
|
|
448
454
|
@include media-breakpoint-down(xs) {
|