@licklist/design 0.44.485-dev.28 → 0.44.485-dev.30
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/events/event-venue-map/components/MapPoint/components/ProductTooltip/ProductTooltip.d.ts.map +1 -1
- package/dist/events/event-venue-map/components/MapPoint/components/ProductTooltip/ProductTooltip.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/product-set/product/price/ProductPriceControl.d.ts.map +1 -1
- package/dist/product-set/product/price/ProductPriceControl.js +1 -1
- package/dist/types/iframe.d.ts +1 -0
- package/dist/types/iframe.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/events/event-venue-map/components/MapPoint/components/ProductTooltip/ProductTooltip.tsx +1 -0
- package/src/iframe/order-process/components/CategoryProduct/CategoryProduct.tsx +20 -16
- package/src/product-set/product/price/ProductPriceControl.tsx +2 -1
- package/src/types/iframe.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductTooltip.d.ts","sourceRoot":"","sources":["../../../../../../src/events/event-venue-map/components/MapPoint/components/ProductTooltip/ProductTooltip.tsx"],"names":[],"mappings":";AAkBA,KAAK,mBAAmB,GAAG;IACzB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,cAAc,mBAAoB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"ProductTooltip.d.ts","sourceRoot":"","sources":["../../../../../../src/events/event-venue-map/components/MapPoint/components/ProductTooltip/ProductTooltip.tsx"],"names":[],"mappings":";AAkBA,KAAK,mBAAmB,GAAG;IACzB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,cAAc,mBAAoB,mBAAmB,gBA4CjE,CAAC"}
|
package/dist/events/event-venue-map/components/MapPoint/components/ProductTooltip/ProductTooltip.js
CHANGED
|
@@ -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,i=require("react-konva"),l="#000";exports.ProductTooltip=function(e){var t=e.x,o=e.y,c=e.text;return r.createElement(i.Group,{width:60,height:20,x:t+30,y:o-1},r.createElement(i.Rect,{x:-5,y:5,sceneFunc:function(e){e.beginPath(),e.moveTo(0,5),e.lineTo(5,0),e.lineTo(5,10),e.closePath(),e.fill()},fill:l,borderColor:l,opacity:.8}),r.createElement(i.Rect,{x:0,y:0,width:60,height:20,fill:l,cornerRadius:5,opacity:.8}),r.createElement(i.Text,{y:4,text:c,strokeWidth:5,width:60,align:"center",verticalAlign:"middle",fill:"#FFF"}))};
|
|
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,i=require("react-konva"),l="#000";exports.ProductTooltip=function(e){var t=e.x,o=e.y,c=e.text;return r.createElement(i.Group,{zIndex:5,width:60,height:20,x:t+30,y:o-1},r.createElement(i.Rect,{x:-5,y:5,sceneFunc:function(e){e.beginPath(),e.moveTo(0,5),e.lineTo(5,0),e.lineTo(5,10),e.closePath(),e.fill()},fill:l,borderColor:l,opacity:.8}),r.createElement(i.Rect,{x:0,y:0,width:60,height:20,fill:l,cornerRadius:5,opacity:.8}),r.createElement(i.Text,{y:4,text:c,strokeWidth:5,width:60,align:"center",verticalAlign:"middle",fill:"#FFF"}))};
|
|
@@ -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;IAC1D,eAAe,CAAC,EAAE,cAAc,CAAC,oBAAoB,CAAC,CAAC;CACxD;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":";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;IAC1D,eAAe,CAAC,EAAE,cAAc,CAAC,oBAAoB,CAAC,CAAC;CACxD;AAED,eAAO,MAAM,eAAe,sFAMzB,oBAAoB,gBAwMtB,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"),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,S=_.setError,A=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]),C=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(){A&&S("".concat(m.id),{message:A,type:"validate"})}),[A,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!=C?C:m.price,{style:"currency",currency:n.Currency.GBP})),i.createElement(l.ProductQuantityInput,{onChange:a,productInfo:s,ref:y,clearErrors:N,product:r.__assign(r.__assign({},m),{isSoldOut:(null==m?void 0:m.isSoldOut)||P()}),category:p,invalid:g,deposit:C})),C&&!(null==p?void 0:p.remainderExpireAfter)&&i.createElement("div",{className:"mt-4"},q("Design:payNowAndUponArrival",{deposit:E(C,{style:"currency",currency:n.Currency.GBP}),remainder:E(m.price-C,{style:"currency",currency:n.Currency.GBP})})),C&&(null==p?void 0:p.remainderExpireAfter)>0&&i.createElement("div",{className:"mt-4"},q("Design:payNowAndReminderDays",{deposit:E(C,{style:"currency",currency:n.Currency.GBP}),remainder:E(m.price-C,{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)))}})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductPriceControl.d.ts","sourceRoot":"","sources":["../../../../src/product-set/product/price/ProductPriceControl.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,8DAA8D,CAAC;AAK1F,OAAO,EAAc,IAAI,EAAkB,MAAM,iBAAiB,CAAC;AAInE,MAAM,WAAW,yBAA0B,SAAQ,UAAU;IAC3D,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,wBAAwB,CAAC,CAAC;IACzC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,UAAU,EAAE,EACxD,SAAiB,EACjB,eAAe,EACf,KAAK,EACL,aAAa,EACb,UAAiB,EACjB,cAAc,GACf,EAAE,wBAAwB,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"ProductPriceControl.d.ts","sourceRoot":"","sources":["../../../../src/product-set/product/price/ProductPriceControl.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,8DAA8D,CAAC;AAK1F,OAAO,EAAc,IAAI,EAAkB,MAAM,iBAAiB,CAAC;AAInE,MAAM,WAAW,yBAA0B,SAAQ,UAAU;IAC3D,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,wBAAwB,CAAC,CAAC;IACzC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,UAAU,EAAE,EACxD,SAAiB,EACjB,eAAe,EACf,KAAK,EACL,aAAa,EACb,UAAiB,EACjB,cAAc,GACf,EAAE,wBAAwB,CAAC,CAAC,CAAC,eAgG7B"}
|
|
@@ -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=e(require("react")),t=require("react-i18next"),a=e(require("react-bootstrap/Col")),i=require("react-bootstrap"),n=require("../../../static/Icon.js"),o=require("react-hook-form"),l=e(require("@licklist/plugins/dist/services/Form/HookFormService")),u=require("@react-aria/utils"),s=e(require("react-bootstrap/InputGroup"));exports.ProductPriceControl=function(e){var c=e.isLoading,m=void 0!==c&&c,d=e.fieldNamePrefix,p=e.title,f=e.allowDeposits,v=e.isRequired,b=void 0===v||v,q=e.isMoreThanZero,x=o.useFormContext(),E=x.control,g=x.formState.errors,C=t.useTranslation("Design").t,F=null!=p?p:C("price"),N=u.useId();return r.createElement(a,{xs:f?12:void 0,sm:f?6:void 0,className:!f&&"p-0"},r.createElement(i.Form.Group,{controlId:N},r.createElement(i.Form.Label,null,F),r.createElement(s,{hasValidation:!0},r.createElement(s.Prepend,null,r.createElement(s.Text,null,r.createElement(n.default,{type:"pound-sign",width:".6rem",className:"p-0"}))),r.createElement(o.Controller,{render:function(e){var t=e.field,a=t.value,n=t.onChange,o=t.name,u=t.ref;return r.createElement(i.Form.Control,{ref:u,type:"number",min:0,max:999999.99,step:"0.01",value:a,name:o,onChange:n,isInvalid:l.isInvalid("".concat(d),g),disabled:m})},control:E,name:"".concat(d),rules:{required:!!b&&C("Validation:fieldRequired",{attribute:F}),min:q?void 0:{value:0,message:C("Validation:fieldMinNumber",{attribute:F,min:0})},max:{value:999999.99,message:C("Validation:fieldMaxNumber",{attribute:F,max:999999.99})},validate:function(e){return!!(!q||q&&null==e||q&&Number(e)>0)||C("Validation:fieldGreaterMinNumber",{attribute:F,min:0})}}}),r.createElement(i.Form.Control.Feedback,{type:"invalid"},l.getErrors("".concat(d),g)))))};
|
|
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=e(require("react")),t=require("react-i18next"),a=e(require("react-bootstrap/Col")),i=require("react-bootstrap"),n=require("../../../static/Icon.js"),o=require("react-hook-form"),l=e(require("@licklist/plugins/dist/services/Form/HookFormService")),u=require("@react-aria/utils"),s=e(require("react-bootstrap/InputGroup"));exports.ProductPriceControl=function(e){var c=e.isLoading,m=void 0!==c&&c,d=e.fieldNamePrefix,p=e.title,f=e.allowDeposits,v=e.isRequired,b=void 0===v||v,q=e.isMoreThanZero,x=o.useFormContext(),E=x.control,g=x.formState.errors,C=t.useTranslation("Design").t,F=null!=p?p:C("price"),N=u.useId();return r.createElement(a,{xs:f?12:void 0,sm:f?6:void 0,className:!f&&"p-0"},r.createElement(i.Form.Group,{controlId:N},r.createElement(i.Form.Label,null,F),r.createElement(s,{hasValidation:!0},r.createElement(s.Prepend,null,r.createElement(s.Text,null,r.createElement(n.default,{type:"pound-sign",width:".6rem",className:"p-0"}))),r.createElement(o.Controller,{render:function(e){var t=e.field,a=t.value,n=t.onChange,o=t.name,u=t.ref;return r.createElement(i.Form.Control,{ref:u,type:"number",min:0,max:999999.99,step:"0.01",value:a,name:o,onChange:n,isInvalid:l.isInvalid("".concat(d),g),disabled:m})},control:E,name:"".concat(d),rules:{required:!!b&&C("Validation:fieldRequired",{attribute:F}),min:q?void 0:{value:0,message:C("Validation:fieldMinNumber",{attribute:F,min:0})},max:{value:999999.99,message:C("Validation:fieldMaxNumber",{attribute:F,max:999999.99})},validate:function(e){return!!(!q||q&&(null==e||""===e)||q&&Number(e)>0)||C("Validation:fieldGreaterMinNumber",{attribute:F,min:0})}}}),r.createElement(i.Form.Control.Feedback,{type:"invalid"},l.getErrors("".concat(d),g)))))};
|
package/dist/types/iframe.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iframe.d.ts","sourceRoot":"","sources":["../../src/types/iframe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0DAA0D,CAAC;AAElG,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAA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AAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,MAAM,UAAU,GAAG,CACvB,GAAG,EACC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GACrB,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,KAC5D,IAAI,CAAC;AAEV,MAAM,MAAM,gBAAgB,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@licklist/design",
|
|
3
|
-
"version": "0.44.485-dev.
|
|
3
|
+
"version": "0.44.485-dev.30",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
|
|
@@ -53,7 +53,7 @@
|
|
|
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.15.27-dev.0 <
|
|
56
|
+
"@licklist/core": ">=0.15.27-dev.0 < 0.15.27",
|
|
57
57
|
"@licklist/eslint-config": "0.3.4",
|
|
58
58
|
"@licklist/plugins": ">=0.20.133-dev.5 < 0.20.133",
|
|
59
59
|
"@mdx-js/react": "1.6.22",
|
|
@@ -83,23 +83,32 @@ export const CategoryProduct = ({
|
|
|
83
83
|
// One case when no value is that we have product,
|
|
84
84
|
// but didn't click on number input.
|
|
85
85
|
// If it will be required then required check fired firstly.
|
|
86
|
-
if (!value) return true;
|
|
87
86
|
|
|
88
87
|
const {
|
|
89
88
|
isRequired = false,
|
|
90
89
|
maxAmount = 0,
|
|
91
90
|
minAmount = 0,
|
|
92
|
-
|
|
91
|
+
minSpend,
|
|
93
92
|
price,
|
|
94
93
|
} = product;
|
|
95
94
|
|
|
96
|
-
const
|
|
95
|
+
const currentQuantity = value?.quantity ?? 0;
|
|
96
|
+
if (minSpend && currentQuantity * price < minSpend) {
|
|
97
|
+
return t("Design:minimumSpendSumValidation", {
|
|
98
|
+
minSpend: formatNumber(minSpend, {
|
|
99
|
+
style: "currency",
|
|
100
|
+
currency: Config.Currency.GBP,
|
|
101
|
+
}),
|
|
102
|
+
}) as string;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (!value) return true;
|
|
97
106
|
|
|
98
|
-
if (!
|
|
107
|
+
if (!currentQuantity && !isRequired) {
|
|
99
108
|
return true;
|
|
100
109
|
}
|
|
101
110
|
|
|
102
|
-
if (!
|
|
111
|
+
if (!currentQuantity && isRequired) {
|
|
103
112
|
return t("Design:pleaseSelectAtLeastFrom", {
|
|
104
113
|
min: 1,
|
|
105
114
|
type: "item",
|
|
@@ -107,23 +116,18 @@ export const CategoryProduct = ({
|
|
|
107
116
|
}) as string;
|
|
108
117
|
}
|
|
109
118
|
|
|
110
|
-
if (
|
|
119
|
+
if (currentQuantity < minAmount) {
|
|
111
120
|
return t("Validation:fieldMinNumber", {
|
|
112
121
|
min: product.minAmount,
|
|
113
122
|
attribute: product.name,
|
|
114
123
|
}) as string;
|
|
115
124
|
}
|
|
116
125
|
|
|
117
|
-
if (
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}),
|
|
123
|
-
}) as string;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
if (maxAmount && quantity >= minAmount && maxAmount < quantity) {
|
|
126
|
+
if (
|
|
127
|
+
maxAmount &&
|
|
128
|
+
currentQuantity >= minAmount &&
|
|
129
|
+
maxAmount < currentQuantity
|
|
130
|
+
) {
|
|
127
131
|
return t("Validation:quantityMaxNumber", {
|
|
128
132
|
max: product.maxAmount,
|
|
129
133
|
}) as string;
|
|
@@ -100,7 +100,8 @@ export function ProductPriceControl<T extends FormValues>({
|
|
|
100
100
|
validate: (value) => {
|
|
101
101
|
if (
|
|
102
102
|
!isMoreThanZero ||
|
|
103
|
-
(isMoreThanZero &&
|
|
103
|
+
(isMoreThanZero &&
|
|
104
|
+
(value === undefined || value === null || value === "")) ||
|
|
104
105
|
(isMoreThanZero && Number(value) > 0)
|
|
105
106
|
) {
|
|
106
107
|
return true;
|