@licklist/design 0.44.485-dev.88 → 0.44.485-dev.89
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/CategoryProduct/CategoryProduct.js +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts +2 -2
- 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/iframe/page/components/PageBody/PageBody.js +1 -1
- package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.js +1 -1
- package/dist/styles/iframe-order-process/IframeOrderProcess.scss +5 -0
- package/package.json +1 -1
- package/src/iframe/order-process/components/CategoryProduct/CategoryProduct.tsx +1 -1
- package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +4 -4
- package/src/iframe/page/components/PageBody/PageBody.tsx +1 -1
- package/src/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.tsx +1 -1
- package/src/product-set/product/constants.ts +1 -1
- package/src/sortable-fields/index.ts +1 -1
- package/src/styles/iframe-order-process/IframeOrderProcess.scss +5 -0
|
@@ -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"),a=require("react-i18next"),c=require("react-hook-form"),o=e(require("@licklist/plugins/dist/services/Form/HookFormService")),u=e(require("clsx")),s=require("react-intl"),d=require("../../../event/ticket-description/TicketDescription.js"),l=require("./components/ProductQuantityInput/ProductQuantityInput.js");exports.CategoryProduct=function(e){var m=e.product,p=e.category,y=e.canExpandDescription,v=void 0===y||y,f=e.productsWithErrors,g=e.soldOutProducts,E=s.useIntl().formatNumber,q=a.useTranslation(["Design","Validation"]).t,_=c.useFormContext(),x=_.control,N=_.clearErrors,
|
|
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"),a=require("react-i18next"),c=require("react-hook-form"),o=e(require("@licklist/plugins/dist/services/Form/HookFormService")),u=e(require("clsx")),s=require("react-intl"),d=require("../../../event/ticket-description/TicketDescription.js"),l=require("./components/ProductQuantityInput/ProductQuantityInput.js");exports.CategoryProduct=function(e){var m=e.product,p=e.category,y=e.canExpandDescription,v=void 0===y||y,f=e.productsWithErrors,g=e.soldOutProducts,E=s.useIntl().formatNumber,q=a.useTranslation(["Design","Validation"]).t,_=c.useFormContext(),x=_.control,N=_.clearErrors,C=_.setError,S=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]),A=t.useMemo((function(){if(p.allowDeposits&&m.deposit&&!(null==m?void 0:m.isSoldOut)&&!(m.deposit>=m.price))return m.deposit}),[p,m]),P=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(){S&&C("".concat(m.id),{message:S,type:"validate"})}),[S,m.id]),i.createElement(c.Controller,{control:x,name:"".concat(m.id),rules:{required:m.isRequired,validate:function(e){var r,t=m.isRequired,i=void 0!==t&&t,a=m.maxAmount,c=void 0===a?0:a,o=m.minAmount,u=void 0===o?0:o,s=m.minSpend,d=m.price,l=null!==(r=null==e?void 0:e.quantity)&&void 0!==r?r:0;return s&&l*d<s?q("Design:minimumSpendSumValidation",{minSpend:E(s,{style:"currency",currency:n.Currency.GBP})}):!e||(!l&&!i||(!l&&i?q("Design:pleaseSelectAtLeastFrom",{min:1,type:"item",from:"this category"}):l<u?q("Validation:fieldMinNumber",{min:m.minAmount,attribute:m.name}):!(c&&l>=u&&c<l)||q("Validation:quantityMaxNumber",{max:m.maxAmount})))}},render:function(e){var t=e.field,a=t.onChange,c=t.value,s=void 0===c?{}:c,y=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:u("iframe-event__product",g&&"error")},i.createElement(d.TicketDescription,{title:m.name,description:m.description,className:u("iframe-event__product-description"),images:m.images,isRequired:m.isRequired,canExpand:v})),i.createElement("div",{className:"iframe-event__product-price-wrapper"},i.createElement("span",{className:"product-price"},E(null!=A?A:m.price,{style:"currency",currency:n.Currency.GBP})),i.createElement(l.ProductQuantityInput,{onChange:a,productInfo:s,refCallback:y,clearErrors:N,product:r.__assign(r.__assign({},m),{isSoldOut:(null==m?void 0:m.isSoldOut)||P()}),category:p,invalid:g,deposit:A})),A&&!(null==p?void 0:p.remainderExpireAfter)&&i.createElement("div",{className:"mt-4"},q("Design:payNowAndUponArrival",{deposit:E(A,{style:"currency",currency:n.Currency.GBP}),remainder:E(m.price-A,{style:"currency",currency:n.Currency.GBP})})),A&&(null==p?void 0:p.remainderExpireAfter)>0&&i.createElement("div",{className:"mt-4"},q("Design:payNowAndReminderDays",{deposit:E(A,{style:"currency",currency:n.Currency.GBP}),remainder:E(m.price-A,{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"},o.hasError(_,"required")&&q("Design:pleaseSelectAtLeastFrom",{min:1,type:"item",from:"this category"}),o.hasError(_,"validate")&&_.message)))}})};
|
|
@@ -15,10 +15,10 @@ interface ProductQuantityInputProps {
|
|
|
15
15
|
clearErrors: UseFormClearErrors<FieldValues>;
|
|
16
16
|
onChange: (value: FormOrderItem) => void;
|
|
17
17
|
deposit?: number;
|
|
18
|
-
|
|
18
|
+
refCallback: RefCallBack;
|
|
19
19
|
invalid: boolean;
|
|
20
20
|
productInfo: FormOrderItem;
|
|
21
21
|
}
|
|
22
|
-
export declare const ProductQuantityInput: ({ product, category, onChange, clearErrors,
|
|
22
|
+
export declare const ProductQuantityInput: ({ product, category, onChange, clearErrors, refCallback, productInfo, invalid, deposit, }: ProductQuantityInputProps) => JSX.Element;
|
|
23
23
|
export {};
|
|
24
24
|
//# 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;AAE/E,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAEnE,UAAU,aAAa;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;CAClB;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,
|
|
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;AAE/E,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAEnE,UAAU,aAAa;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;CAClB;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,8FAS9B,yBAAyB,gBAiF3B,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"),i=require("react-bootstrap"),r=e(require("clsx")),o=require("../NumberInput/NumberInput.js");exports.ProductQuantityInput=function(e){var u=e.product,a=e.category,d=e.onChange,c=e.clearErrors,l=e.
|
|
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"),i=require("react-bootstrap"),r=e(require("clsx")),o=require("../NumberInput/NumberInput.js");exports.ProductQuantityInput=function(e){var u=e.product,a=e.category,d=e.onChange,c=e.clearErrors,l=e.refCallback,s=e.productInfo,p=e.invalid,m=e.deposit,y=n.useTranslation("Design").t;return u.isSoldOut?t.createElement("div",{className:"iframe-event__sold-out-wrapper"},y("Design:soldOut")):1===(null==u?void 0:u.maxAmount)?t.createElement(i.Button,{ref:l,disabled:u.isSoldOut,className:r("iframe-event__".concat((null==s?void 0:s.quantity)?"unselect-product":"select-product"),p&&"error"),onClick:function(){d({id:u.id,name:u.name,deposit:m,price:u.price,productsCategoryId:a.id,quantity:(null==s?void 0:s.quantity)?0:1})}},y("Design:".concat((null==s?void 0:s.quantity)?"unselect":"select"))):t.createElement(o.NumberInput,{ref:l,onChange:function(e){d({id:u.id,name:u.name,deposit:m,price:u.price,productsCategoryId:a.id,quantity:e||null}),c("".concat(u.id))},onArrowDown:function(){d({id:u.id,name:u.name,deposit:m,price:u.price,productsCategoryId:a.id,quantity:(null==s?void 0:s.quantity)-1||0}),c("".concat(u.id))},onArrowUp:function(){var e;d({id:u.id,name:u.name,deposit:m,price:u.price,productsCategoryId:a.id,quantity:(null!==(e=null==s?void 0:s.quantity)&&void 0!==e?e:0)+1}),c("".concat(u.id))},min:0,placeholder:"0",disabled:u.isSoldOut,value:null==s?void 0:s.quantity,className:r(p&&"error")})};
|
|
@@ -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=e(require("react")),c=e(require("clsx")),l=require("./components/RightBlock/RightBlock.js"),o=require("./components/LeftBlock/LeftBlock.js"),i=function(e){var l=e.leftBlock,o=e.rightBlock,i=e.className,s=e.children,a=t.__rest(e,["leftBlock","rightBlock","className","children"]);return r.createElement("div",t.__assign({className:c("page-body",i)},a),s,l,o
|
|
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=e(require("react")),c=e(require("clsx")),l=require("./components/RightBlock/RightBlock.js"),o=require("./components/LeftBlock/LeftBlock.js"),i=function(e){var l=e.leftBlock,o=e.rightBlock,i=e.className,s=e.children,a=t.__rest(e,["leftBlock","rightBlock","className","children"]);return r.createElement("div",t.__assign({className:c("page-body",i)},a),s,l,o)};i.LeftBlock=o.LeftBlock,i.RightBlock=l.RightBlock,exports.PageBody=i;
|
|
@@ -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"),l=e(require("react")),s=e(require("clsx")),a=require("../../constants.js"),
|
|
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"),l=e(require("react")),s=e(require("clsx")),a=require("../../constants.js"),i=require("@licklist/plugins/dist/context/page/PageContext"),r=require("../../hooks/useResizePageBody.js");exports.LeftBlock=function(e){var n=e.pageTitle,c=e.children,o=e.className,u=e.component,d=e.childrenClassName,m=t.__rest(e,["pageTitle","children","className","component","childrenClassName"]),f=r.useResizePageBody(),g=f.leftBlockStyles,p=f.leftBlockContainerSizes;return l.createElement("div",t.__assign({className:s("left-block",o)},m),n&&l.createElement("div",{className:"navigation"},l.createElement("div",{className:"title"},n),u),l.createElement("div",{className:s("left-block-container",d),style:g,id:a.PAGE_LEFT_BLOCK_CONTAINER_ID},l.createElement(i.PageContextProvider,{leftBlockContainerSizes:p},c)))};
|
package/package.json
CHANGED
|
@@ -21,7 +21,7 @@ interface ProductQuantityInputProps {
|
|
|
21
21
|
clearErrors: UseFormClearErrors<FieldValues>;
|
|
22
22
|
onChange: (value: FormOrderItem) => void;
|
|
23
23
|
deposit?: number;
|
|
24
|
-
|
|
24
|
+
refCallback: RefCallBack;
|
|
25
25
|
invalid: boolean;
|
|
26
26
|
productInfo: FormOrderItem;
|
|
27
27
|
}
|
|
@@ -31,7 +31,7 @@ export const ProductQuantityInput = ({
|
|
|
31
31
|
category,
|
|
32
32
|
onChange,
|
|
33
33
|
clearErrors,
|
|
34
|
-
|
|
34
|
+
refCallback,
|
|
35
35
|
productInfo,
|
|
36
36
|
invalid,
|
|
37
37
|
deposit,
|
|
@@ -59,7 +59,7 @@ export const ProductQuantityInput = ({
|
|
|
59
59
|
if (product?.maxAmount === 1) {
|
|
60
60
|
return (
|
|
61
61
|
<Button
|
|
62
|
-
ref={
|
|
62
|
+
ref={refCallback}
|
|
63
63
|
disabled={product.isSoldOut}
|
|
64
64
|
className={clsx(
|
|
65
65
|
`iframe-event__${
|
|
@@ -75,7 +75,7 @@ export const ProductQuantityInput = ({
|
|
|
75
75
|
}
|
|
76
76
|
return (
|
|
77
77
|
<NumberInput
|
|
78
|
-
ref={
|
|
78
|
+
ref={refCallback}
|
|
79
79
|
onChange={(val) => {
|
|
80
80
|
onChange({
|
|
81
81
|
id: product.id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const MAX_PRODUCT_DESCRIPTION_CHARACTERS_LENGTH = 1000;
|
|
1
|
+
export const MAX_PRODUCT_DESCRIPTION_CHARACTERS_LENGTH = 1000;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { SortableFieldList } from "./SortableFieldList";
|
|
1
|
+
export { SortableFieldList } from "./SortableFieldList";
|