@licklist/design 0.44.468 → 0.44.469
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.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.js +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts +24 -0
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts.map +1 -0
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.js +1 -0
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/index.d.ts +2 -0
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/index.d.ts.map +1 -0
- package/dist/styles/iframe-events/Event.scss +32 -14
- package/package.json +1 -1
- package/src/iframe/order-process/OrderProcess.stories.tsx +3 -0
- package/src/iframe/order-process/components/CategoryProduct/CategoryProduct.tsx +11 -47
- package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +118 -0
- package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/index.ts +1 -0
- package/src/styles/iframe-events/Event.scss +32 -14
|
@@ -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;
|
|
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 +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"),
|
|
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)))}})};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FieldValues, RefCallBack, UseFormClearErrors } from "react-hook-form";
|
|
3
|
+
import { Product, ProductCategory } from "../../../../../../types";
|
|
4
|
+
interface FormOrderItem {
|
|
5
|
+
id: number;
|
|
6
|
+
name: string;
|
|
7
|
+
price: number;
|
|
8
|
+
productsCategoryId: number;
|
|
9
|
+
deposit?: number | null;
|
|
10
|
+
quantity: number;
|
|
11
|
+
}
|
|
12
|
+
interface ProductQuantityInputProps {
|
|
13
|
+
product: Product;
|
|
14
|
+
category: ProductCategory;
|
|
15
|
+
clearErrors: UseFormClearErrors<FieldValues>;
|
|
16
|
+
onChange: (value: FormOrderItem) => void;
|
|
17
|
+
deposit?: number;
|
|
18
|
+
ref: RefCallBack;
|
|
19
|
+
invalid: boolean;
|
|
20
|
+
productInfo: FormOrderItem;
|
|
21
|
+
}
|
|
22
|
+
export declare const ProductQuantityInput: ({ product, category, onChange, clearErrors, ref, productInfo, invalid, deposit, }: ProductQuantityInputProps) => JSX.Element;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=ProductQuantityInput.d.ts.map
|
|
@@ -0,0 +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,GAAG,EAAE,WAAW,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,aAAa,CAAC;CAC5B;AAED,eAAO,MAAM,oBAAoB,sFAS9B,yBAAyB,gBAgF3B,CAAC"}
|
|
@@ -0,0 +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")),i=require("react-i18next"),n=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.ref,s=e.productInfo,p=e.invalid,m=e.deposit,y=i.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(n.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}),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,disabled:u.isSoldOut,value:(null==s?void 0:s.quantity)||0,className:r(p&&"error")})};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
.iframe-event__category-product {
|
|
66
66
|
margin-top: 1rem;
|
|
67
67
|
padding-bottom: 1rem;
|
|
68
|
-
|
|
68
|
+
|
|
69
69
|
border-bottom: 2px solid $separator-color;
|
|
70
70
|
|
|
71
71
|
&:first-child {
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
&:not(:first-child){
|
|
76
|
+
&:not(:first-child) {
|
|
77
77
|
.iframe-event__name {
|
|
78
78
|
margin: 1rem 0;
|
|
79
79
|
}
|
|
@@ -89,6 +89,24 @@
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
&__select-product {
|
|
93
|
+
width: 10.5rem !important;
|
|
94
|
+
margin-top: 1rem;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&__unselect-product {
|
|
98
|
+
margin-top: 1rem;
|
|
99
|
+
width: 10.5rem !important;
|
|
100
|
+
background-color: $snippet-elements-button-color !important;
|
|
101
|
+
color: $snippet-elements-button-background-color !important;
|
|
102
|
+
border: 1px solid $snippet-elements-button-background-color !important;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&__unselect-product.error,
|
|
106
|
+
&__select-product.error {
|
|
107
|
+
border: 1px solid red !important;
|
|
108
|
+
}
|
|
109
|
+
|
|
92
110
|
&__product-price-wrapper {
|
|
93
111
|
display: flex;
|
|
94
112
|
align-items: center;
|
|
@@ -143,7 +161,7 @@
|
|
|
143
161
|
border-radius: $iframe-border-radius;
|
|
144
162
|
font-size: 0.875rem;
|
|
145
163
|
height: 2.25rem;
|
|
146
|
-
|
|
164
|
+
|
|
147
165
|
&:active,
|
|
148
166
|
&.active,
|
|
149
167
|
&:hover,
|
|
@@ -156,25 +174,25 @@
|
|
|
156
174
|
background-color: $snippet-elements-button-background-color;
|
|
157
175
|
box-shadow: 0 0 0 $input-btn-focus-width $snippet-elements-button-background-color;
|
|
158
176
|
}
|
|
159
|
-
|
|
177
|
+
|
|
160
178
|
&:disabled {
|
|
161
179
|
border: none;
|
|
162
180
|
}
|
|
163
181
|
}
|
|
164
|
-
|
|
182
|
+
|
|
165
183
|
&:hover,
|
|
166
184
|
&.hover,
|
|
167
185
|
&:focus,
|
|
168
186
|
&.focus {
|
|
169
187
|
&:not(:disabled) {
|
|
170
|
-
opacity: .7;
|
|
188
|
+
opacity: 0.7;
|
|
171
189
|
}
|
|
172
190
|
}
|
|
173
|
-
|
|
191
|
+
|
|
174
192
|
&:active,
|
|
175
193
|
&.active {
|
|
176
194
|
&:not(:disabled) {
|
|
177
|
-
opacity: .8;
|
|
195
|
+
opacity: 0.8;
|
|
178
196
|
}
|
|
179
197
|
}
|
|
180
198
|
}
|
|
@@ -223,19 +241,19 @@
|
|
|
223
241
|
&:focus,
|
|
224
242
|
&.focus {
|
|
225
243
|
&:not(:disabled) {
|
|
226
|
-
opacity: .7;
|
|
244
|
+
opacity: 0.7;
|
|
227
245
|
}
|
|
228
246
|
}
|
|
229
247
|
|
|
230
248
|
&:active,
|
|
231
249
|
&.active {
|
|
232
250
|
&:not(:disabled) {
|
|
233
|
-
opacity: .8;
|
|
251
|
+
opacity: 0.8;
|
|
234
252
|
}
|
|
235
253
|
}
|
|
236
254
|
}
|
|
237
255
|
|
|
238
|
-
&__book-now{
|
|
256
|
+
&__book-now {
|
|
239
257
|
margin: 1rem 0;
|
|
240
258
|
position: fixed;
|
|
241
259
|
left: 0;
|
|
@@ -260,15 +278,15 @@
|
|
|
260
278
|
justify-content: center;
|
|
261
279
|
width: 10.5rem;
|
|
262
280
|
height: 2rem;
|
|
263
|
-
color: #
|
|
264
|
-
background-color: #
|
|
281
|
+
color: #9d9d9d;
|
|
282
|
+
background-color: #f3f3f3;
|
|
265
283
|
border-radius: $iframe-border-radius;
|
|
266
284
|
}
|
|
267
285
|
}
|
|
268
286
|
|
|
269
287
|
.people-input {
|
|
270
288
|
.input-wrapper {
|
|
271
|
-
justify-content: center
|
|
289
|
+
justify-content: center;
|
|
272
290
|
}
|
|
273
291
|
|
|
274
292
|
.iframe-event {
|
package/package.json
CHANGED
|
@@ -7,8 +7,8 @@ import * as Config from "@licklist/core/dist/Config";
|
|
|
7
7
|
import HookFormService from "@licklist/plugins/dist/services/Form/HookFormService";
|
|
8
8
|
import { TicketDescription } from "../../../event/ticket-description";
|
|
9
9
|
import { ProductCategory, Product } from "../../../../types";
|
|
10
|
-
import { NumberInput } from "./components/NumberInput";
|
|
11
10
|
import { StepsFormProps } from "../StepsForm/StepsForm";
|
|
11
|
+
import { ProductQuantityInput } from "./components/ProductQuantityInput";
|
|
12
12
|
|
|
13
13
|
interface CategoryProductProps {
|
|
14
14
|
product: Product;
|
|
@@ -126,52 +126,16 @@ export const CategoryProduct = ({
|
|
|
126
126
|
currency: Config.Currency.GBP,
|
|
127
127
|
})}
|
|
128
128
|
</span>
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
name: product.name,
|
|
140
|
-
deposit,
|
|
141
|
-
price: product.price,
|
|
142
|
-
productsCategoryId: category.id,
|
|
143
|
-
quantity: val,
|
|
144
|
-
});
|
|
145
|
-
clearErrors(`${product.id}` as const);
|
|
146
|
-
}}
|
|
147
|
-
onArrowDown={() => {
|
|
148
|
-
onChange({
|
|
149
|
-
id: product.id,
|
|
150
|
-
name: product.name,
|
|
151
|
-
deposit,
|
|
152
|
-
price: product.price,
|
|
153
|
-
productsCategoryId: category.id,
|
|
154
|
-
quantity: productInfo?.quantity - 1 || 0,
|
|
155
|
-
});
|
|
156
|
-
clearErrors(`${product.id}` as const);
|
|
157
|
-
}}
|
|
158
|
-
onArrowUp={() => {
|
|
159
|
-
onChange({
|
|
160
|
-
id: product.id,
|
|
161
|
-
name: product.name,
|
|
162
|
-
deposit,
|
|
163
|
-
price: product.price,
|
|
164
|
-
productsCategoryId: category.id,
|
|
165
|
-
quantity: (productInfo?.quantity ?? 0) + 1,
|
|
166
|
-
});
|
|
167
|
-
clearErrors(`${product.id}` as const);
|
|
168
|
-
}}
|
|
169
|
-
min={0}
|
|
170
|
-
disabled={product.isSoldOut}
|
|
171
|
-
value={productInfo?.quantity || 0}
|
|
172
|
-
className={clsx(invalid && "error")}
|
|
173
|
-
/>
|
|
174
|
-
)}
|
|
129
|
+
<ProductQuantityInput
|
|
130
|
+
onChange={onChange}
|
|
131
|
+
productInfo={productInfo}
|
|
132
|
+
ref={ref}
|
|
133
|
+
clearErrors={clearErrors}
|
|
134
|
+
product={product}
|
|
135
|
+
category={category}
|
|
136
|
+
invalid={invalid}
|
|
137
|
+
deposit={deposit}
|
|
138
|
+
/>
|
|
175
139
|
</div>
|
|
176
140
|
{deposit && !category?.remainderExpireAfter && (
|
|
177
141
|
<div className="mt-4">
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { Button } from "react-bootstrap";
|
|
4
|
+
import { useTranslation } from "react-i18next";
|
|
5
|
+
import { FieldValues, RefCallBack, UseFormClearErrors } from "react-hook-form";
|
|
6
|
+
import { NumberInput } from "../NumberInput";
|
|
7
|
+
import { Product, ProductCategory } from "../../../../../../types";
|
|
8
|
+
|
|
9
|
+
interface FormOrderItem {
|
|
10
|
+
id: number;
|
|
11
|
+
name: string;
|
|
12
|
+
price: number;
|
|
13
|
+
productsCategoryId: number;
|
|
14
|
+
deposit?: number | null;
|
|
15
|
+
quantity: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface ProductQuantityInputProps {
|
|
19
|
+
product: Product;
|
|
20
|
+
category: ProductCategory;
|
|
21
|
+
clearErrors: UseFormClearErrors<FieldValues>;
|
|
22
|
+
onChange: (value: FormOrderItem) => void;
|
|
23
|
+
deposit?: number;
|
|
24
|
+
ref: RefCallBack;
|
|
25
|
+
invalid: boolean;
|
|
26
|
+
productInfo: FormOrderItem;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const ProductQuantityInput = ({
|
|
30
|
+
product,
|
|
31
|
+
category,
|
|
32
|
+
onChange,
|
|
33
|
+
clearErrors,
|
|
34
|
+
ref,
|
|
35
|
+
productInfo,
|
|
36
|
+
invalid,
|
|
37
|
+
deposit,
|
|
38
|
+
}: ProductQuantityInputProps) => {
|
|
39
|
+
const { t } = useTranslation("Design");
|
|
40
|
+
|
|
41
|
+
const onClick = () => {
|
|
42
|
+
onChange({
|
|
43
|
+
id: product.id,
|
|
44
|
+
name: product.name,
|
|
45
|
+
deposit,
|
|
46
|
+
price: product.price,
|
|
47
|
+
productsCategoryId: category.id,
|
|
48
|
+
quantity: productInfo?.quantity ? 0 : 1,
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
if (product.isSoldOut) {
|
|
53
|
+
return (
|
|
54
|
+
<div className="iframe-event__sold-out-wrapper">
|
|
55
|
+
{t("Design:soldOut")}
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
if (product?.maxAmount === 1) {
|
|
60
|
+
return (
|
|
61
|
+
<Button
|
|
62
|
+
ref={ref}
|
|
63
|
+
disabled={product.isSoldOut}
|
|
64
|
+
className={clsx(
|
|
65
|
+
`iframe-event__${
|
|
66
|
+
productInfo?.quantity ? "unselect-product" : "select-product"
|
|
67
|
+
}`,
|
|
68
|
+
invalid && "error"
|
|
69
|
+
)}
|
|
70
|
+
onClick={onClick}
|
|
71
|
+
>
|
|
72
|
+
{t(`Design:${productInfo?.quantity ? "unselect" : "select"}`)}
|
|
73
|
+
</Button>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
return (
|
|
77
|
+
<NumberInput
|
|
78
|
+
ref={ref}
|
|
79
|
+
onChange={(val) => {
|
|
80
|
+
onChange({
|
|
81
|
+
id: product.id,
|
|
82
|
+
name: product.name,
|
|
83
|
+
deposit,
|
|
84
|
+
price: product.price,
|
|
85
|
+
productsCategoryId: category.id,
|
|
86
|
+
quantity: val,
|
|
87
|
+
});
|
|
88
|
+
clearErrors(`${product.id}` as const);
|
|
89
|
+
}}
|
|
90
|
+
onArrowDown={() => {
|
|
91
|
+
onChange({
|
|
92
|
+
id: product.id,
|
|
93
|
+
name: product.name,
|
|
94
|
+
deposit,
|
|
95
|
+
price: product.price,
|
|
96
|
+
productsCategoryId: category.id,
|
|
97
|
+
quantity: productInfo?.quantity - 1 || 0,
|
|
98
|
+
});
|
|
99
|
+
clearErrors(`${product.id}` as const);
|
|
100
|
+
}}
|
|
101
|
+
onArrowUp={() => {
|
|
102
|
+
onChange({
|
|
103
|
+
id: product.id,
|
|
104
|
+
name: product.name,
|
|
105
|
+
deposit,
|
|
106
|
+
price: product.price,
|
|
107
|
+
productsCategoryId: category.id,
|
|
108
|
+
quantity: (productInfo?.quantity ?? 0) + 1,
|
|
109
|
+
});
|
|
110
|
+
clearErrors(`${product.id}` as const);
|
|
111
|
+
}}
|
|
112
|
+
min={0}
|
|
113
|
+
disabled={product.isSoldOut}
|
|
114
|
+
value={productInfo?.quantity || 0}
|
|
115
|
+
className={clsx(invalid && "error")}
|
|
116
|
+
/>
|
|
117
|
+
);
|
|
118
|
+
};
|
package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ProductQuantityInput } from "./ProductQuantityInput";
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
.iframe-event__category-product {
|
|
66
66
|
margin-top: 1rem;
|
|
67
67
|
padding-bottom: 1rem;
|
|
68
|
-
|
|
68
|
+
|
|
69
69
|
border-bottom: 2px solid $separator-color;
|
|
70
70
|
|
|
71
71
|
&:first-child {
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
&:not(:first-child){
|
|
76
|
+
&:not(:first-child) {
|
|
77
77
|
.iframe-event__name {
|
|
78
78
|
margin: 1rem 0;
|
|
79
79
|
}
|
|
@@ -89,6 +89,24 @@
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
&__select-product {
|
|
93
|
+
width: 10.5rem !important;
|
|
94
|
+
margin-top: 1rem;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&__unselect-product {
|
|
98
|
+
margin-top: 1rem;
|
|
99
|
+
width: 10.5rem !important;
|
|
100
|
+
background-color: $snippet-elements-button-color !important;
|
|
101
|
+
color: $snippet-elements-button-background-color !important;
|
|
102
|
+
border: 1px solid $snippet-elements-button-background-color !important;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&__unselect-product.error,
|
|
106
|
+
&__select-product.error {
|
|
107
|
+
border: 1px solid red !important;
|
|
108
|
+
}
|
|
109
|
+
|
|
92
110
|
&__product-price-wrapper {
|
|
93
111
|
display: flex;
|
|
94
112
|
align-items: center;
|
|
@@ -143,7 +161,7 @@
|
|
|
143
161
|
border-radius: $iframe-border-radius;
|
|
144
162
|
font-size: 0.875rem;
|
|
145
163
|
height: 2.25rem;
|
|
146
|
-
|
|
164
|
+
|
|
147
165
|
&:active,
|
|
148
166
|
&.active,
|
|
149
167
|
&:hover,
|
|
@@ -156,25 +174,25 @@
|
|
|
156
174
|
background-color: $snippet-elements-button-background-color;
|
|
157
175
|
box-shadow: 0 0 0 $input-btn-focus-width $snippet-elements-button-background-color;
|
|
158
176
|
}
|
|
159
|
-
|
|
177
|
+
|
|
160
178
|
&:disabled {
|
|
161
179
|
border: none;
|
|
162
180
|
}
|
|
163
181
|
}
|
|
164
|
-
|
|
182
|
+
|
|
165
183
|
&:hover,
|
|
166
184
|
&.hover,
|
|
167
185
|
&:focus,
|
|
168
186
|
&.focus {
|
|
169
187
|
&:not(:disabled) {
|
|
170
|
-
opacity: .7;
|
|
188
|
+
opacity: 0.7;
|
|
171
189
|
}
|
|
172
190
|
}
|
|
173
|
-
|
|
191
|
+
|
|
174
192
|
&:active,
|
|
175
193
|
&.active {
|
|
176
194
|
&:not(:disabled) {
|
|
177
|
-
opacity: .8;
|
|
195
|
+
opacity: 0.8;
|
|
178
196
|
}
|
|
179
197
|
}
|
|
180
198
|
}
|
|
@@ -223,19 +241,19 @@
|
|
|
223
241
|
&:focus,
|
|
224
242
|
&.focus {
|
|
225
243
|
&:not(:disabled) {
|
|
226
|
-
opacity: .7;
|
|
244
|
+
opacity: 0.7;
|
|
227
245
|
}
|
|
228
246
|
}
|
|
229
247
|
|
|
230
248
|
&:active,
|
|
231
249
|
&.active {
|
|
232
250
|
&:not(:disabled) {
|
|
233
|
-
opacity: .8;
|
|
251
|
+
opacity: 0.8;
|
|
234
252
|
}
|
|
235
253
|
}
|
|
236
254
|
}
|
|
237
255
|
|
|
238
|
-
&__book-now{
|
|
256
|
+
&__book-now {
|
|
239
257
|
margin: 1rem 0;
|
|
240
258
|
position: fixed;
|
|
241
259
|
left: 0;
|
|
@@ -260,15 +278,15 @@
|
|
|
260
278
|
justify-content: center;
|
|
261
279
|
width: 10.5rem;
|
|
262
280
|
height: 2rem;
|
|
263
|
-
color: #
|
|
264
|
-
background-color: #
|
|
281
|
+
color: #9d9d9d;
|
|
282
|
+
background-color: #f3f3f3;
|
|
265
283
|
border-radius: $iframe-border-radius;
|
|
266
284
|
}
|
|
267
285
|
}
|
|
268
286
|
|
|
269
287
|
.people-input {
|
|
270
288
|
.input-wrapper {
|
|
271
|
-
justify-content: center
|
|
289
|
+
justify-content: center;
|
|
272
290
|
}
|
|
273
291
|
|
|
274
292
|
.iframe-event {
|