@licklist/design 0.58.3 → 0.58.4-dev.1

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.
Files changed (147) hide show
  1. package/dist/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.d.ts.map +1 -1
  2. package/dist/events/edit-event-modal/utils/getDefaultProductSet.js +1 -1
  3. package/dist/iframe/event/event-card/IframeEventCard.d.ts +2 -1
  4. package/dist/iframe/event/event-card/IframeEventCard.d.ts.map +1 -1
  5. package/dist/iframe/event/event-card/IframeEventCard.js +1 -1
  6. package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.d.ts.map +1 -1
  7. package/dist/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.js +1 -1
  8. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts.map +1 -1
  9. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.js +1 -1
  10. package/dist/iframe/order-process/components/utils/useCategoryVerification.d.ts +2 -2
  11. package/dist/iframe/order-process/components/utils/useCategoryVerification.d.ts.map +1 -1
  12. package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.d.ts.map +1 -1
  13. package/dist/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.js +1 -1
  14. package/dist/iframe/payment/order-items-table/utils/paymentSummary.d.ts.map +1 -1
  15. package/dist/iframe/payment/order-items-table/utils/paymentSummary.js +1 -1
  16. package/dist/index.js +1 -1
  17. package/dist/product-set/card/ProductSetCard.d.ts +2 -1
  18. package/dist/product-set/card/ProductSetCard.d.ts.map +1 -1
  19. package/dist/product-set/card/ProductSetCard.js +1 -1
  20. package/dist/product-set/control/DateInput.d.ts +17 -0
  21. package/dist/product-set/control/DateInput.d.ts.map +1 -0
  22. package/dist/product-set/control/DateInput.js +1 -0
  23. package/dist/product-set/control/ProductSetControl.d.ts +3 -2
  24. package/dist/product-set/control/ProductSetControl.d.ts.map +1 -1
  25. package/dist/product-set/control/ProductSetControl.js +1 -1
  26. package/dist/product-set/control/ProductSetRecurrenceOverridesControl.d.ts +11 -0
  27. package/dist/product-set/control/ProductSetRecurrenceOverridesControl.d.ts.map +1 -0
  28. package/dist/product-set/control/ProductSetRecurrenceOverridesControl.js +1 -0
  29. package/dist/product-set/control/TutorialGifCard.d.ts +2 -1
  30. package/dist/product-set/control/TutorialGifCard.d.ts.map +1 -1
  31. package/dist/product-set/control/TutorialGifCard.js +1 -1
  32. package/dist/product-set/form/ProductCategoriesControl.d.ts +2 -1
  33. package/dist/product-set/form/ProductCategoriesControl.d.ts.map +1 -1
  34. package/dist/product-set/form/ProductCategoriesControl.js +1 -1
  35. package/dist/product-set/form/ProductSetForm.d.ts +8 -3
  36. package/dist/product-set/form/ProductSetForm.d.ts.map +1 -1
  37. package/dist/product-set/form/ProductSetForm.js +1 -1
  38. package/dist/product-set/form/ProductsControl.d.ts +2 -1
  39. package/dist/product-set/form/ProductsControl.d.ts.map +1 -1
  40. package/dist/product-set/form/ProductsControl.js +1 -1
  41. package/dist/product-set/form/StepsControl.d.ts +2 -1
  42. package/dist/product-set/form/StepsControl.d.ts.map +1 -1
  43. package/dist/product-set/form/StepsControl.js +1 -1
  44. package/dist/product-set/form/SubProductsControl.d.ts +2 -1
  45. package/dist/product-set/form/SubProductsControl.d.ts.map +1 -1
  46. package/dist/product-set/form/SubProductsControl.js +1 -1
  47. package/dist/product-set/hooks/useSortableTreeFunctions.d.ts +2 -1
  48. package/dist/product-set/hooks/useSortableTreeFunctions.d.ts.map +1 -1
  49. package/dist/product-set/hooks/useSortableTreeFunctions.js +1 -1
  50. package/dist/product-set/item/CreateProductSetItem.d.ts +2 -1
  51. package/dist/product-set/item/CreateProductSetItem.d.ts.map +1 -1
  52. package/dist/product-set/item/CreateProductSetItem.js +1 -1
  53. package/dist/product-set/product/ProductControl.d.ts +2 -1
  54. package/dist/product-set/product/ProductControl.d.ts.map +1 -1
  55. package/dist/product-set/product/ProductControl.js +1 -1
  56. package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.d.ts +4 -2
  57. package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.d.ts.map +1 -1
  58. package/dist/product-set/product/fixed-duration-fields/FixedDurationOptions.js +1 -1
  59. package/dist/product-set/product/quantity/ProductQuantityControl.d.ts +1 -0
  60. package/dist/product-set/product/quantity/ProductQuantityControl.d.ts.map +1 -1
  61. package/dist/product-set/product/quantity/ProductQuantityControl.js +1 -1
  62. package/dist/product-set/product-category/ProductCategoryControl.d.ts +2 -1
  63. package/dist/product-set/product-category/ProductCategoryControl.d.ts.map +1 -1
  64. package/dist/product-set/product-category/ProductCategoryControl.js +1 -1
  65. package/dist/recurring-date-picker-input/DatePickerInput.d.ts +19 -0
  66. package/dist/recurring-date-picker-input/DatePickerInput.d.ts.map +1 -0
  67. package/dist/recurring-date-picker-input/DatePickerInput.js +1 -0
  68. package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.d.ts +15 -0
  69. package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.d.ts.map +1 -0
  70. package/dist/recurring-date-picker-input/RecurrenceAndFrequencyInput.js +1 -0
  71. package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts +2 -0
  72. package/dist/recurring-date-picker-input/RecurringDatePickerInput.d.ts.map +1 -1
  73. package/dist/recurring-date-picker-input/RecurringDatePickerInput.js +1 -1
  74. package/dist/report/ReportRunnerModal/ReportRunnerModal.d.ts.map +1 -1
  75. package/dist/report/ReportRunnerModal/ReportRunnerModal.js +1 -1
  76. package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
  77. package/dist/sortable-list/SortableList.d.ts +2 -1
  78. package/dist/sortable-list/SortableList.d.ts.map +1 -1
  79. package/dist/sortable-list/SortableList.js +1 -1
  80. package/dist/sortable-tree/SortableTreeItem.d.ts +3 -1
  81. package/dist/sortable-tree/SortableTreeItem.d.ts.map +1 -1
  82. package/dist/sortable-tree/SortableTreeItem.js +1 -1
  83. package/dist/static/manual-date-picker/ManualDatePicker.js +1 -1
  84. package/dist/static/manual-date-picker/constants/index.d.ts +4 -1
  85. package/dist/static/manual-date-picker/constants/index.d.ts.map +1 -1
  86. package/dist/static/manual-date-picker/constants/index.js +1 -1
  87. package/dist/static/manual-date-picker/utils/index.d.ts +4 -0
  88. package/dist/static/manual-date-picker/utils/index.d.ts.map +1 -1
  89. package/dist/static/manual-date-picker/utils/index.js +1 -1
  90. package/dist/styles/availability-indicator/AvailabilityIndicator.scss +10 -0
  91. package/dist/styles/iframe-events/Card.scss +24 -8
  92. package/dist/styles/iframe-events/PoweredBy.scss +2 -2
  93. package/dist/styles/iframe-order-process/IframeOrderProcess.scss +0 -2
  94. package/dist/styles/iframe-page/Page.scss +1 -0
  95. package/dist/styles/iframe-page/PageBody.scss +32 -11
  96. package/dist/styles/iframe-page/PageHeader.scss +41 -39
  97. package/dist/styles/product-set/EditVenueMapSetModal.scss +1 -1
  98. package/dist/styles/report/ReportRunnerModal.scss +88 -82
  99. package/dist/styles/sales/BookingResults.scss +1 -1
  100. package/package.json +3 -3
  101. package/src/calendar/Calendar.stories.tsx +9 -2
  102. package/src/events/edit-event-modal/component/SelectEventProductSet/component/EditEventProductSet.tsx +0 -1
  103. package/src/events/edit-event-modal/utils/getDefaultProductSet.ts +14 -14
  104. package/src/iframe/event/event-card/IframeEventCard.stories.tsx +1 -0
  105. package/src/iframe/event/event-card/IframeEventCard.tsx +7 -8
  106. package/src/iframe/order-process/components/CategoryProduct/components/NumberInput/NumberInput.tsx +30 -10
  107. package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +8 -12
  108. package/src/iframe/order-process/components/utils/useCategoryVerification.ts +5 -3
  109. package/src/iframe/page/components/PageBody/components/LeftBlock/LeftBlock.tsx +3 -1
  110. package/src/iframe/payment/order-items-table/utils/paymentSummary.tsx +6 -1
  111. package/src/product-set/card/ProductSetCard.tsx +10 -1
  112. package/src/product-set/control/DateInput.tsx +311 -0
  113. package/src/product-set/control/ProductSetControl.tsx +47 -25
  114. package/src/product-set/control/ProductSetRecurrenceOverridesControl.tsx +63 -0
  115. package/src/product-set/control/TutorialGifCard.tsx +11 -3
  116. package/src/product-set/form/ProductCategoriesControl.tsx +12 -1
  117. package/src/product-set/form/ProductSetForm.tsx +11 -2
  118. package/src/product-set/form/ProductsControl.tsx +10 -0
  119. package/src/product-set/form/StepsControl.tsx +8 -2
  120. package/src/product-set/form/SubProductsControl.tsx +3 -0
  121. package/src/product-set/hooks/useSortableTreeFunctions.ts +4 -0
  122. package/src/product-set/item/CreateProductSetItem.tsx +3 -0
  123. package/src/product-set/product/ProductControl.tsx +23 -12
  124. package/src/product-set/product/fixed-duration-fields/FixedDurationOptions.tsx +10 -2
  125. package/src/product-set/product/quantity/ProductQuantityControl.tsx +4 -3
  126. package/src/product-set/product-category/ProductCategoryControl.tsx +12 -8
  127. package/src/recurring-date-picker-input/DatePickerInput.tsx +93 -0
  128. package/src/recurring-date-picker-input/RecurrenceAndFrequencyInput.tsx +137 -0
  129. package/src/recurring-date-picker-input/RecurringDatePickerInput.tsx +4 -1
  130. package/src/report/ReportRunnerModal/ReportRunnerModal.tsx +35 -4
  131. package/src/sales/booking/results/components/ResultCard.tsx +0 -3
  132. package/src/sortable-list/SortableList.tsx +3 -0
  133. package/src/sortable-tree/SortableTreeItem.tsx +7 -1
  134. package/src/static/manual-date-picker/ManualDatePicker.tsx +3 -3
  135. package/src/static/manual-date-picker/constants/index.ts +6 -2
  136. package/src/static/manual-date-picker/utils/index.ts +11 -0
  137. package/src/static/switch/BooleanSwitch.tsx +1 -1
  138. package/src/styles/availability-indicator/AvailabilityIndicator.scss +10 -0
  139. package/src/styles/iframe-events/Card.scss +24 -8
  140. package/src/styles/iframe-events/PoweredBy.scss +2 -2
  141. package/src/styles/iframe-order-process/IframeOrderProcess.scss +0 -2
  142. package/src/styles/iframe-page/Page.scss +1 -0
  143. package/src/styles/iframe-page/PageBody.scss +32 -11
  144. package/src/styles/iframe-page/PageHeader.scss +41 -39
  145. package/src/styles/product-set/EditVenueMapSetModal.scss +1 -1
  146. package/src/styles/report/ReportRunnerModal.scss +88 -82
  147. package/src/styles/sales/BookingResults.scss +1 -1
@@ -1,95 +1,101 @@
1
1
  .report-runner-modal {
2
- .modal-dialog {
3
- @include media-breakpoint-up(sm) {
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
- 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;
24
- }
25
-
26
- button {
27
- padding-top: 0.5rem;
28
- padding-bottom: 0.5rem;
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
- .edit-button {
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
- text-decoration: underline;
62
-
63
- &:focus {
64
- box-shadow: none;
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
- input {
69
- border-radius: 0.5rem;
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
- form {
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
- .loader {
92
- height: 10rem;
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
+ }
@@ -5,7 +5,7 @@
5
5
  flex-wrap: wrap;
6
6
 
7
7
  .result-card {
8
- height: 14.25rem;
8
+ height: 14rem;
9
9
  border: 1px solid $gray-400;
10
10
  max-width: calc(50% - 0.75rem);
11
11
  flex: 0 0 calc(50% - 0.75rem);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@licklist/design",
3
- "version": "0.58.3",
3
+ "version": "0.58.4-dev.1",
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.20.0",
56
+ "@licklist/core": ">=0.22.1-dev.3 < 0.22.1",
57
57
  "@licklist/eslint-config": "0.3.4",
58
- "@licklist/plugins": "^0.26.0",
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: productCategories?.map(
33
- ({ products, ...productCategory }) => ({
32
+ productCategories:
33
+ productCategories?.map(({ products, ...productCategory }) => ({
34
34
  ...productCategory,
35
- products: products?.map(({ zoneId, subProducts, ...product }) => ({
36
- ...product,
37
- subProducts: subProducts?.map(({ zoneId, ...subProducts }) => ({
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: zoneId as number,
41
- })),
42
- productCategoryId: undefined,
43
- zoneId: zoneId as number,
44
- })),
45
- })
46
- ),
44
+ zoneId,
45
+ })) ?? [],
46
+ })) ?? [],
47
47
  venueMapSetId: step?.venueMapSet ? step?.venueMapSet?.id : null,
48
- })) ?? undefined,
48
+ })) ?? [],
49
49
  menuRecurrences: hasNoRecurrences ? [] : productSet?.menuRecurrences ?? [],
50
50
  });
@@ -16,6 +16,7 @@ export function Default() {
16
16
  return (
17
17
  <div>
18
18
  <IframeEventCard
19
+ showMoreInfo
19
20
  imageSrc={
20
21
  showImage
21
22
  ? // eslint-disable-next-line max-len
@@ -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="iframe-event-card__bold m-0 list-view-hided">
95
- {date}
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="iframe-event-card__bold m-0">{type}</p>
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="iframe-event-card__bold m-0">
119
+ <p className="m-0">
121
120
  {t("from")}{" "}
122
121
  {formatNumber(cost, { style: "currency", currency: "GBP" })}
123
122
  </p>
@@ -32,24 +32,44 @@ export const NumberInput = forwardRef<HTMLInputElement, NumberInputProps>(
32
32
  ref
33
33
  ) => {
34
34
  const minusButtonGreyedOut = !value;
35
- const plusButtonGreyedOut = max !== undefined && value === 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 !== undefined && (value || 0) < max) {
39
- onArrowUp(value + 1);
51
+ if (max > 0 && value === max) {
52
+ return;
40
53
  }
41
- if (max === undefined) {
42
- onArrowUp(value + 1);
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 (min !== undefined && value > min) {
48
- onArrowDown(value - 1);
64
+ if (!value) {
65
+ return;
49
66
  }
50
- if (min === undefined) {
51
- onArrowUp(value - 1);
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) => onChange(Number(e.target.value))}
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: productQuantity,
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 || null);
91
+ onChange(val);
96
92
  clearErrors(`${product.id}` as const);
97
93
  }}
98
- onArrowDown={() => {
99
- onChange(productInfo?.quantity - 1 || 0);
94
+ onArrowDown={(val) => {
95
+ onChange(val || 0);
100
96
  clearErrors(`${product.id}` as const);
101
97
  }}
102
- onArrowUp={() => {
103
- onChange((productInfo?.quantity ?? 0) + 1);
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?.maxAmount) : undefined}
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
- values: OrderItems,
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
- const productArray = Object.values(values).filter(
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) =>
@@ -28,7 +28,9 @@ export const LeftBlock = ({
28
28
  {pageTitle && (
29
29
  <>
30
30
  {typeof pageTitle === "string" ? (
31
- <div className="title">{pageTitle}</div>
31
+ <div className="title" id="navigation-title">
32
+ {pageTitle}
33
+ </div>
32
34
  ) : (
33
35
  pageTitle
34
36
  )}
@@ -63,7 +63,12 @@ const processedPaymentSummary = ({
63
63
  const total = calculateTotalPrice(order, externalPaymentDetail);
64
64
 
65
65
  const totalDiscount = calculateTotalDiscount(order.payments);
66
- const totalWithDiscount = total - Number(totalDiscount);
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,
@@ -18,6 +18,7 @@ export interface ProductSetCardProps extends HasPermissionProp {
18
18
  onCopy: () => void;
19
19
  onRemove: () => void;
20
20
  className?: string;
21
+ override?: number;
21
22
  }
22
23
 
23
24
  export function ProductSetCard({
@@ -28,6 +29,7 @@ export function ProductSetCard({
28
29
  onRemove,
29
30
  className = "",
30
31
  hasPermission = true,
32
+ override = 0,
31
33
  }: ProductSetCardProps) {
32
34
  const { t } = useTranslation("Design");
33
35
  const popoverId = useId();
@@ -44,7 +46,14 @@ export function ProductSetCard({
44
46
  >
45
47
  <div className={productSetCardClasses}>
46
48
  <div className="product-set-card-link">
47
- {name} {rrule && `(${RRule.fromString(rrule).toText()})`}
49
+ <div className="d-flex flex-column">
50
+ <div>
51
+ {name} {rrule && `(${RRule.fromString(rrule).toText()})`}
52
+ </div>
53
+ <div className="h6 bold ml-1">
54
+ {!!override && t("overridesAmount", { amount: override })}
55
+ </div>
56
+ </div>
48
57
  </div>
49
58
  <div className="d-flex">
50
59
  <div className="product-set-card-menu-eye-container">