@licklist/design 0.58.3 → 0.58.4-dev.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/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts.map +1 -1
- package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +1 -1
- package/dist/iframe/event/event-card/IframeEventCard.d.ts +2 -1
- package/dist/iframe/event/event-card/IframeEventCard.d.ts.map +1 -1
- package/dist/iframe/event/event-card/IframeEventCard.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.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.js +1 -1
- package/dist/iframe/order-process/components/utils/useCategoryVerification.d.ts +2 -2
- package/dist/iframe/order-process/components/utils/useCategoryVerification.d.ts.map +1 -1
- package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.d.ts.map +1 -1
- package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.js +1 -1
- package/dist/iframe/payment/order-items-table/utils/paymentSummary.d.ts.map +1 -1
- package/dist/iframe/payment/order-items-table/utils/paymentSummary.js +1 -1
- package/dist/product-set/control/ProductSetControl.d.ts +1 -1
- package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
- package/dist/product-set/form/ProductSetForm.d.ts +5 -2
- package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
- package/dist/report/ReportRunnerModal/ReportRunnerModal.d.ts.map +1 -1
- package/dist/report/ReportRunnerModal/ReportRunnerModal.js +1 -1
- package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
- package/dist/static/manual-date-picker/ManualDatePicker.js +1 -1
- package/dist/static/manual-date-picker/constants/index.d.ts +4 -1
- package/dist/static/manual-date-picker/constants/index.d.ts.map +1 -1
- package/dist/static/manual-date-picker/constants/index.js +1 -1
- package/dist/static/manual-date-picker/utils/index.d.ts +4 -0
- package/dist/static/manual-date-picker/utils/index.d.ts.map +1 -1
- package/dist/static/manual-date-picker/utils/index.js +1 -1
- package/dist/styles/availability-indicator/AvailabilityIndicator.scss +10 -0
- package/dist/styles/iframe-events/Card.scss +24 -8
- package/dist/styles/iframe-events/PoweredBy.scss +2 -2
- package/dist/styles/iframe-order-process/IframeOrderProcess.scss +0 -2
- package/dist/styles/iframe-page/Page.scss +1 -0
- package/dist/styles/iframe-page/PageBody.scss +32 -11
- package/dist/styles/iframe-page/PageHeader.scss +41 -39
- package/dist/styles/report/ReportRunnerModal.scss +88 -82
- package/dist/styles/sales/BookingResults.scss +1 -1
- package/package.json +3 -3
- package/src/calendar/Calendar.stories.tsx +9 -2
- package/src/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.tsx +0 -1
- package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +14 -14
- package/src/iframe/event/event-card/IframeEventCard.stories.tsx +1 -0
- package/src/iframe/event/event-card/IframeEventCard.tsx +7 -8
- package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +30 -10
- package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +8 -12
- package/src/iframe/order-process/components/utils/useCategoryVerification.ts +5 -3
- package/src/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.tsx +3 -1
- package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +6 -1
- package/src/product-set/control/ProductSetControl.tsx +1 -1
- package/src/product-set/form/ProductSetForm.tsx +6 -2
- package/src/report/ReportRunnerModal/ReportRunnerModal.tsx +35 -4
- package/src/sales/booking/results/components/ResultCard.tsx +0 -3
- package/src/static/manual-date-picker/ManualDatePicker.tsx +3 -3
- package/src/static/manual-date-picker/constants/index.ts +6 -2
- package/src/static/manual-date-picker/utils/index.ts +11 -0
- package/src/static/switch/BooleanSwitch.tsx +1 -1
- package/src/styles/availability-indicator/AvailabilityIndicator.scss +10 -0
- package/src/styles/iframe-events/Card.scss +24 -8
- package/src/styles/iframe-events/PoweredBy.scss +2 -2
- package/src/styles/iframe-order-process/IframeOrderProcess.scss +0 -2
- package/src/styles/iframe-page/Page.scss +1 -0
- package/src/styles/iframe-page/PageBody.scss +32 -11
- package/src/styles/iframe-page/PageHeader.scss +41 -39
- package/src/styles/report/ReportRunnerModal.scss +88 -82
- package/src/styles/sales/BookingResults.scss +1 -1
|
@@ -20,55 +20,57 @@ $base-height: 2.5rem;
|
|
|
20
20
|
transition: $color-transition;
|
|
21
21
|
border: 0;
|
|
22
22
|
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
23
25
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
.iframe-page {
|
|
27
|
+
.button-wrapper {
|
|
28
|
+
background-color: $snippet-page-header-steps-close-button-background-color;
|
|
29
|
+
height: $base-height;
|
|
30
|
+
width: $base-height;
|
|
31
|
+
border-radius: $base-height;
|
|
32
|
+
transition: $color-transition;
|
|
33
|
+
|
|
34
|
+
.close-button {
|
|
35
|
+
font-size: 1.25rem;
|
|
27
36
|
width: $base-height;
|
|
28
|
-
|
|
37
|
+
height: $base-height;
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
color: $snippet-page-header-steps-close-button-border-color;
|
|
29
42
|
transition: $color-transition;
|
|
30
43
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
width: $base-height;
|
|
34
|
-
height: $base-height;
|
|
35
|
-
display: flex;
|
|
36
|
-
align-items: center;
|
|
37
|
-
justify-content: center;
|
|
38
|
-
color: $snippet-page-header-steps-close-button-border-color;
|
|
39
|
-
transition: $color-transition;
|
|
40
|
-
|
|
41
|
-
&:hover {
|
|
42
|
-
cursor: pointer;
|
|
43
|
-
}
|
|
44
|
+
&:hover {
|
|
45
|
+
cursor: pointer;
|
|
44
46
|
}
|
|
47
|
+
}
|
|
45
48
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
&.close-button {
|
|
50
|
+
margin-left: 1rem;
|
|
51
|
+
}
|
|
49
52
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
.back-button {
|
|
54
|
+
font-size: 2rem;
|
|
55
|
+
width: $base-height;
|
|
56
|
+
height: $base-height;
|
|
57
|
+
display: flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
justify-content: center;
|
|
60
|
+
font-weight: lighter;
|
|
61
|
+
color: $snippet-page-header-steps-close-button-border-color;
|
|
62
|
+
transition: $color-transition;
|
|
60
63
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
+
&:hover {
|
|
65
|
+
cursor: pointer;
|
|
64
66
|
}
|
|
67
|
+
}
|
|
65
68
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
69
|
+
&.back-button {
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
justify-content: center;
|
|
73
|
+
margin-right: 1rem;
|
|
72
74
|
}
|
|
73
75
|
}
|
|
74
76
|
}
|
|
@@ -1,95 +1,101 @@
|
|
|
1
1
|
.report-runner-modal {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
max-width: 45rem;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.modal-content {
|
|
2
|
+
.modal-dialog {
|
|
3
|
+
@include media-breakpoint-up(sm) {
|
|
9
4
|
max-width: 45rem;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
font-size: 0.875rem;
|
|
30
|
-
font-weight: 600;
|
|
31
|
-
color: #0e8ce2;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.data-fields {
|
|
36
|
-
display: flex;
|
|
37
|
-
flex-wrap: wrap;
|
|
38
|
-
|
|
39
|
-
span {
|
|
40
|
-
position: relative;
|
|
41
|
-
font-size: 0.875rem;
|
|
42
|
-
font-weight: 500;
|
|
43
|
-
|
|
44
|
-
&:after {
|
|
45
|
-
content: "|";
|
|
46
|
-
margin: 0 0.25rem;
|
|
47
|
-
color: #dcdcdc;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
&:last-child:after {
|
|
51
|
-
display: none;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.modal-content {
|
|
9
|
+
max-width: 45rem;
|
|
10
|
+
margin: 0 auto;
|
|
11
|
+
padding: 1.25rem 1.5rem;
|
|
12
|
+
|
|
13
|
+
header {
|
|
14
|
+
display: flex;
|
|
15
|
+
justify-content: space-between;
|
|
16
|
+
align-items: center;
|
|
17
|
+
margin-bottom: 1rem;
|
|
18
|
+
border-bottom: 2px solid #dcdcdc;
|
|
19
|
+
|
|
20
|
+
h5 {
|
|
21
|
+
margin-bottom: 0;
|
|
22
|
+
font-size: 1.125rem;
|
|
23
|
+
font-weight: 500;
|
|
54
24
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
padding: 0;
|
|
25
|
+
|
|
26
|
+
button {
|
|
27
|
+
padding-top: 0.5rem;
|
|
28
|
+
padding-bottom: 0.5rem;
|
|
58
29
|
font-size: 0.875rem;
|
|
59
30
|
font-weight: 600;
|
|
60
31
|
color: #0e8ce2;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.data-fields {
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-wrap: wrap;
|
|
38
|
+
|
|
39
|
+
span {
|
|
40
|
+
position: relative;
|
|
41
|
+
font-size: 0.875rem;
|
|
42
|
+
font-weight: 500;
|
|
43
|
+
|
|
44
|
+
&:after {
|
|
45
|
+
content: "|";
|
|
46
|
+
margin: 0 0.25rem;
|
|
47
|
+
color: #dcdcdc;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&:last-child:after {
|
|
51
|
+
display: none;
|
|
65
52
|
}
|
|
66
53
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.edit-button {
|
|
57
|
+
padding: 0;
|
|
58
|
+
font-size: 0.875rem;
|
|
59
|
+
font-weight: 600;
|
|
60
|
+
color: #0e8ce2;
|
|
61
|
+
text-decoration: underline;
|
|
62
|
+
|
|
63
|
+
&:focus {
|
|
64
|
+
box-shadow: none;
|
|
70
65
|
}
|
|
71
|
-
|
|
72
|
-
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
input {
|
|
69
|
+
border-radius: 0.5rem;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
form {
|
|
73
|
+
margin-top: 1.25rem;
|
|
74
|
+
|
|
75
|
+
.period-by {
|
|
76
|
+
display: flex;
|
|
77
|
+
gap: 2rem;
|
|
73
78
|
margin-top: 1.25rem;
|
|
74
|
-
|
|
75
|
-
.controls {
|
|
76
|
-
display: flex;
|
|
77
|
-
gap: 2rem;
|
|
78
|
-
align-items: flex-start;
|
|
79
|
-
flex-wrap: wrap;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.form-group {
|
|
83
|
-
flex: 1;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
button[type="submit"] {
|
|
87
|
-
white-space: nowrap;
|
|
88
|
-
}
|
|
89
79
|
}
|
|
90
|
-
|
|
91
|
-
.
|
|
92
|
-
|
|
80
|
+
|
|
81
|
+
.controls {
|
|
82
|
+
display: flex;
|
|
83
|
+
gap: 2rem;
|
|
84
|
+
align-items: flex-start;
|
|
85
|
+
flex-wrap: wrap;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.form-group {
|
|
89
|
+
flex: 1;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
button[type="submit"] {
|
|
93
|
+
white-space: nowrap;
|
|
93
94
|
}
|
|
94
95
|
}
|
|
95
|
-
|
|
96
|
+
|
|
97
|
+
.loader {
|
|
98
|
+
height: 10rem;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@licklist/design",
|
|
3
|
-
"version": "0.58.
|
|
3
|
+
"version": "0.58.4-dev.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": "
|
|
56
|
+
"@licklist/core": ">=0.22.1-dev.3 < 0.22.1",
|
|
57
57
|
"@licklist/eslint-config": "0.3.4",
|
|
58
|
-
"@licklist/plugins": "
|
|
58
|
+
"@licklist/plugins": ">=0.27.1-dev.0 < 0.27.1",
|
|
59
59
|
"@mdx-js/react": "1.6.22",
|
|
60
60
|
"@popperjs/core": "2.11.8",
|
|
61
61
|
"@react-aria/utils": "3.9.0",
|
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { DateTime } from "luxon";
|
|
3
3
|
import { Meta, Story } from "@storybook/react";
|
|
4
4
|
import { Calendar, CalendarProps } from "./Calendar";
|
|
5
|
+
import { getMonthCalendarDates } from "./utils/index";
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
8
|
title: "Iframe/Event/Calendar",
|
|
@@ -24,10 +25,16 @@ const now = DateTime.now().set({
|
|
|
24
25
|
});
|
|
25
26
|
|
|
26
27
|
Default.args = {
|
|
27
|
-
disabledDates: [now.minus({ day: 2 }), now, now.plus({ day: 2 })],
|
|
28
28
|
isLoading: false,
|
|
29
29
|
fromPrice: "from £10",
|
|
30
30
|
selectedDate: null,
|
|
31
31
|
setSelectedDate: () => null,
|
|
32
|
-
calendarDates:
|
|
32
|
+
calendarDates: getMonthCalendarDates(now),
|
|
33
|
+
currentDate: now,
|
|
34
|
+
getDateTimeButtonProps: () => ({
|
|
35
|
+
resources: [],
|
|
36
|
+
showResources: false,
|
|
37
|
+
shouldCalculateResources: false,
|
|
38
|
+
isDisabled: false,
|
|
39
|
+
}),
|
|
33
40
|
};
|
|
@@ -2,7 +2,6 @@ import React, { useEffect, useMemo } from "react";
|
|
|
2
2
|
import { Button, Form } from "react-bootstrap";
|
|
3
3
|
import { FormProvider, useForm } from "react-hook-form";
|
|
4
4
|
import { isEqual } from "lodash";
|
|
5
|
-
|
|
6
5
|
import { useParams } from "react-router-dom";
|
|
7
6
|
import { useEventEditProductSetContext } from "@licklist/plugins/dist/context/event/EventEditProductSetContext";
|
|
8
7
|
import { useTranslation } from "react-i18next";
|
|
@@ -29,22 +29,22 @@ export const getDefaultValues = (
|
|
|
29
29
|
steps:
|
|
30
30
|
productSet?.steps?.map(({ productCategories, ...step }) => ({
|
|
31
31
|
...step,
|
|
32
|
-
productCategories:
|
|
33
|
-
({ products, ...productCategory }) => ({
|
|
32
|
+
productCategories:
|
|
33
|
+
productCategories?.map(({ products, ...productCategory }) => ({
|
|
34
34
|
...productCategory,
|
|
35
|
-
products:
|
|
36
|
-
...product
|
|
37
|
-
|
|
38
|
-
...subProducts
|
|
35
|
+
products:
|
|
36
|
+
products?.map(({ zoneId, subProducts, ...product }) => ({
|
|
37
|
+
...product,
|
|
38
|
+
subProducts: subProducts?.map(({ zoneId, ...subProducts }) => ({
|
|
39
|
+
...subProducts,
|
|
40
|
+
productCategoryId: undefined,
|
|
41
|
+
zoneId,
|
|
42
|
+
})),
|
|
39
43
|
productCategoryId: undefined,
|
|
40
|
-
zoneId
|
|
41
|
-
})),
|
|
42
|
-
|
|
43
|
-
zoneId: zoneId as number,
|
|
44
|
-
})),
|
|
45
|
-
})
|
|
46
|
-
),
|
|
44
|
+
zoneId,
|
|
45
|
+
})) ?? [],
|
|
46
|
+
})) ?? [],
|
|
47
47
|
venueMapSetId: step?.venueMapSet ? step?.venueMapSet?.id : null,
|
|
48
|
-
})) ??
|
|
48
|
+
})) ?? [],
|
|
49
49
|
menuRecurrences: hasNoRecurrences ? [] : productSet?.menuRecurrences ?? [],
|
|
50
50
|
});
|
|
@@ -29,6 +29,7 @@ interface IframeEventCardProps {
|
|
|
29
29
|
titleId?: string;
|
|
30
30
|
descriptionId?: string;
|
|
31
31
|
imageClassName?: string;
|
|
32
|
+
showMoreInfo?: boolean;
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
export function IframeEventCard({
|
|
@@ -46,6 +47,7 @@ export function IframeEventCard({
|
|
|
46
47
|
titleId,
|
|
47
48
|
descriptionId,
|
|
48
49
|
imageClassName,
|
|
50
|
+
showMoreInfo,
|
|
49
51
|
}: IframeEventCardProps) {
|
|
50
52
|
const { formatNumber } = useIntl();
|
|
51
53
|
const { t } = useTranslation("Design");
|
|
@@ -70,6 +72,7 @@ export function IframeEventCard({
|
|
|
70
72
|
)}
|
|
71
73
|
onClick={goToDetails ? onClick : undefined}
|
|
72
74
|
>
|
|
75
|
+
{showMoreInfo && <div className="iframe-event-card__info-icon">i</div>}
|
|
73
76
|
{imageSrc && (
|
|
74
77
|
<Card.Img
|
|
75
78
|
className={imageClassName ?? "card-image"}
|
|
@@ -91,12 +94,8 @@ export function IframeEventCard({
|
|
|
91
94
|
<div className="icon-wrapper">
|
|
92
95
|
<CalendarSvg />
|
|
93
96
|
</div>
|
|
94
|
-
<p className="
|
|
95
|
-
|
|
96
|
-
</p>
|
|
97
|
-
<p className="iframe-event-card__bold m-0 grid-view-hided">
|
|
98
|
-
{shortDate}
|
|
99
|
-
</p>
|
|
97
|
+
<p className="m-0 list-view-hided">{date}</p>
|
|
98
|
+
<p className="m-0 grid-view-hided">{shortDate}</p>
|
|
100
99
|
</div>
|
|
101
100
|
</Card.Text>
|
|
102
101
|
|
|
@@ -106,7 +105,7 @@ export function IframeEventCard({
|
|
|
106
105
|
<div className="icon-wrapper">
|
|
107
106
|
<ClockSvg />
|
|
108
107
|
</div>
|
|
109
|
-
<p className="
|
|
108
|
+
<p className="m-0">{type}</p>
|
|
110
109
|
</div>
|
|
111
110
|
</Card.Text>
|
|
112
111
|
)}
|
|
@@ -117,7 +116,7 @@ export function IframeEventCard({
|
|
|
117
116
|
<div className="icon-wrapper">
|
|
118
117
|
<TicketSvg />
|
|
119
118
|
</div>
|
|
120
|
-
<p className="
|
|
119
|
+
<p className="m-0">
|
|
121
120
|
{t("from")}{" "}
|
|
122
121
|
{formatNumber(cost, { style: "currency", currency: "GBP" })}
|
|
123
122
|
</p>
|
package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx
CHANGED
|
@@ -32,24 +32,44 @@ export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>(
|
|
|
32
32
|
ref
|
|
33
33
|
) => {
|
|
34
34
|
const minusButtonGreyedOut = !value;
|
|
35
|
-
const plusButtonGreyedOut = max
|
|
35
|
+
const plusButtonGreyedOut = max > 0 && value === max;
|
|
36
|
+
|
|
37
|
+
const handleChangeValue = (val: number) => {
|
|
38
|
+
if (max > 0 && val > max) {
|
|
39
|
+
onChange(max);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (min > 0 && val && val < min) {
|
|
44
|
+
onChange(min);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
onChange(val);
|
|
48
|
+
};
|
|
36
49
|
|
|
37
50
|
const handleArrowUpClick = () => {
|
|
38
|
-
if (max
|
|
39
|
-
|
|
51
|
+
if (max > 0 && value === max) {
|
|
52
|
+
return;
|
|
40
53
|
}
|
|
41
|
-
|
|
42
|
-
|
|
54
|
+
|
|
55
|
+
if (min > 0 && (value || 0) < min) {
|
|
56
|
+
onArrowUp(min);
|
|
57
|
+
return;
|
|
43
58
|
}
|
|
59
|
+
|
|
60
|
+
onArrowUp((value || 0) + 1);
|
|
44
61
|
};
|
|
45
62
|
|
|
46
63
|
const handleArrowDownClick = () => {
|
|
47
|
-
if (
|
|
48
|
-
|
|
64
|
+
if (!value) {
|
|
65
|
+
return;
|
|
49
66
|
}
|
|
50
|
-
if (min ===
|
|
51
|
-
|
|
67
|
+
if (min > 0 && (value || 0) === min) {
|
|
68
|
+
onArrowDown(0);
|
|
69
|
+
return;
|
|
52
70
|
}
|
|
71
|
+
|
|
72
|
+
onArrowUp(value - 1);
|
|
53
73
|
};
|
|
54
74
|
|
|
55
75
|
const inputWrapperClasses = clsx("payment-number-input", className);
|
|
@@ -68,7 +88,7 @@ export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>(
|
|
|
68
88
|
</button>
|
|
69
89
|
<FormControl
|
|
70
90
|
type="number"
|
|
71
|
-
onChange={(e) =>
|
|
91
|
+
onChange={(e) => handleChangeValue(Number(e.target.value))}
|
|
72
92
|
value={value}
|
|
73
93
|
min={min}
|
|
74
94
|
max={max}
|
|
@@ -45,10 +45,6 @@ export const ProductQuantityInput = ({
|
|
|
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
|
-
}
|
|
52
48
|
_onChange({
|
|
53
49
|
id: product.id,
|
|
54
50
|
name: product.name,
|
|
@@ -57,7 +53,7 @@ export const ProductQuantityInput = ({
|
|
|
57
53
|
price: product.price,
|
|
58
54
|
productCategoryId: category.id,
|
|
59
55
|
zoneId: category.zone?.id,
|
|
60
|
-
quantity
|
|
56
|
+
quantity,
|
|
61
57
|
capacity: product?.capacity,
|
|
62
58
|
});
|
|
63
59
|
};
|
|
@@ -92,19 +88,19 @@ export const ProductQuantityInput = ({
|
|
|
92
88
|
<NumberInput
|
|
93
89
|
ref={refCallback}
|
|
94
90
|
onChange={(val) => {
|
|
95
|
-
onChange(val
|
|
91
|
+
onChange(val);
|
|
96
92
|
clearErrors(`${product.id}` as const);
|
|
97
93
|
}}
|
|
98
|
-
onArrowDown={() => {
|
|
99
|
-
onChange(
|
|
94
|
+
onArrowDown={(val) => {
|
|
95
|
+
onChange(val || 0);
|
|
100
96
|
clearErrors(`${product.id}` as const);
|
|
101
97
|
}}
|
|
102
|
-
onArrowUp={() => {
|
|
103
|
-
onChange(
|
|
98
|
+
onArrowUp={(val) => {
|
|
99
|
+
onChange(val || 0);
|
|
104
100
|
clearErrors(`${product.id}` as const);
|
|
105
101
|
}}
|
|
106
|
-
min={0}
|
|
107
|
-
max={product?.maxAmount ? Number(product
|
|
102
|
+
min={product?.minAmount ? Number(product.minAmount) : 0}
|
|
103
|
+
max={product?.maxAmount ? Number(product.maxAmount) : undefined}
|
|
108
104
|
placeholder="0"
|
|
109
105
|
disabled={product.isSoldOut}
|
|
110
106
|
value={productInfo?.quantity}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ProductCategory } from "@licklist/core/dist/DataMapper/Product/ProductCategoryDataMapper";
|
|
2
1
|
import { Currency } from "@licklist/core/dist/Config";
|
|
3
2
|
import { useIntl } from "react-intl";
|
|
4
3
|
import { useTranslation } from "react-i18next";
|
|
5
4
|
import { OrderItems } from "@licklist/plugins/dist/types/context/Iframe/orderItems";
|
|
5
|
+
import { ProductCategory } from "@licklist/plugins/dist/types/context/sale/menuSteps";
|
|
6
6
|
|
|
7
7
|
interface CategoryError {
|
|
8
8
|
message: string;
|
|
@@ -15,14 +15,16 @@ export const useCategoryVerification = () => {
|
|
|
15
15
|
const { formatNumber } = useIntl();
|
|
16
16
|
|
|
17
17
|
return (
|
|
18
|
-
|
|
18
|
+
orderItems: OrderItems,
|
|
19
19
|
productCategories?: ProductCategory[],
|
|
20
20
|
isLastPage?: boolean
|
|
21
21
|
): CategoryError | void => {
|
|
22
22
|
let errorMessage: { id?: number; message: string } | void;
|
|
23
|
-
|
|
23
|
+
|
|
24
|
+
const productArray = Object.values(orderItems).filter(
|
|
24
25
|
(product) => product?.quantity > 0
|
|
25
26
|
);
|
|
27
|
+
|
|
26
28
|
const sumOfMinSpends = productCategories.reduce((acc, productCategory) => {
|
|
27
29
|
const { products } = productCategory;
|
|
28
30
|
const selectedProducts = products.filter((product) =>
|
|
@@ -63,7 +63,12 @@ const processedPaymentSummary = ({
|
|
|
63
63
|
const total = calculateTotalPrice(order, externalPaymentDetail);
|
|
64
64
|
|
|
65
65
|
const totalDiscount = calculateTotalDiscount(order.payments);
|
|
66
|
-
|
|
66
|
+
|
|
67
|
+
const totalWithDiscount = order.orderPayments.reduce(
|
|
68
|
+
(acc, payment) => acc + payment.amount + payment.discountAmount,
|
|
69
|
+
0
|
|
70
|
+
);
|
|
71
|
+
|
|
67
72
|
let summaryItems: SummaryItem[] = [
|
|
68
73
|
{
|
|
69
74
|
translateKey: AMOUNT_TOTAL,
|
|
@@ -61,7 +61,7 @@ export interface ProductSetControlValues extends DateAndRecurrenceInputValues {
|
|
|
61
61
|
productGroups?: SelectItem[];
|
|
62
62
|
relyOnPeopleType?: RelyOnPeopleType | null;
|
|
63
63
|
fieldSetId?: number;
|
|
64
|
-
steps
|
|
64
|
+
steps: Step[];
|
|
65
65
|
emailTemplates?: TemplateItem[];
|
|
66
66
|
smsTemplates?: TemplateItem[];
|
|
67
67
|
}
|
|
@@ -26,14 +26,18 @@ import { checkAvailableTimesErrors, getFilteredTemplates } from "../utils";
|
|
|
26
26
|
export interface WithIsLoading {
|
|
27
27
|
isLoading: boolean;
|
|
28
28
|
}
|
|
29
|
+
export interface WithIdOptional {
|
|
30
|
+
id?: number;
|
|
31
|
+
}
|
|
32
|
+
|
|
29
33
|
export interface WithId {
|
|
30
34
|
id: number;
|
|
31
35
|
}
|
|
32
36
|
export interface ProductSetFormValues
|
|
33
37
|
extends FormValues,
|
|
34
|
-
|
|
38
|
+
WithIdOptional,
|
|
35
39
|
ProductSetControlValues {
|
|
36
|
-
steps
|
|
40
|
+
steps: Step[];
|
|
37
41
|
}
|
|
38
42
|
|
|
39
43
|
export interface ProductSetFormProps
|