@licklist/design 0.44.551-dev.8 → 0.44.551

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 (138) hide show
  1. package/dist/calendar/components/CalendarDates/CalendarDates.d.ts.map +1 -1
  2. package/dist/calendar/components/CalendarDates/CalendarDates.js +1 -1
  3. package/dist/date-time-button/DateContent.d.ts +2 -2
  4. package/dist/date-time-button/DateContent.d.ts.map +1 -1
  5. package/dist/date-time-button/DateContent.js +1 -1
  6. package/dist/date-time-button/DateTimeButton.d.ts +6 -10
  7. package/dist/date-time-button/DateTimeButton.d.ts.map +1 -1
  8. package/dist/date-time-button/DateTimeButton.js +1 -1
  9. package/dist/events/event-venue-map/components/MapPoint/MapPoint.d.ts +1 -1
  10. package/dist/events/event-venue-map/components/MapPoint/MapPoint.d.ts.map +1 -1
  11. package/dist/iframe/event/event-booking-products/EventBookingProducts.d.ts +2 -4
  12. package/dist/iframe/event/event-booking-products/EventBookingProducts.d.ts.map +1 -1
  13. package/dist/iframe/event/event-booking-products/components/AccordionItem/AccordionItem.d.ts +2 -4
  14. package/dist/iframe/event/event-booking-products/components/AccordionItem/AccordionItem.d.ts.map +1 -1
  15. package/dist/iframe/event/event-order-summary/EventOrderSummary.d.ts +1 -1
  16. package/dist/iframe/event/event-order-summary/EventOrderSummary.d.ts.map +1 -1
  17. package/dist/iframe/order-process/components/BookingSummary/BookingSummary.d.ts.map +1 -1
  18. package/dist/iframe/order-process/components/BookingSummary/BookingSummary.js +1 -1
  19. package/dist/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.d.ts +3 -4
  20. package/dist/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.d.ts.map +1 -1
  21. package/dist/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.js +1 -1
  22. package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts +4 -3
  23. package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts.map +1 -1
  24. package/dist/iframe/order-process/components/BookingSummary/utils/index.d.ts +2 -4
  25. package/dist/iframe/order-process/components/BookingSummary/utils/index.d.ts.map +1 -1
  26. package/dist/iframe/order-process/components/BookingSummary/utils/index.js +1 -1
  27. package/dist/iframe/order-process/components/CalendarStepsForm/components/Category.d.ts +1 -1
  28. package/dist/iframe/order-process/components/CalendarStepsForm/components/Category.d.ts.map +1 -1
  29. package/dist/iframe/order-process/components/CalendarStepsForm/components/CategoryProductModal.d.ts +1 -1
  30. package/dist/iframe/order-process/components/CalendarStepsForm/components/CategoryProductModal.d.ts.map +1 -1
  31. package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.d.ts +1 -1
  32. package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.d.ts.map +1 -1
  33. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts +1 -1
  34. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts.map +1 -1
  35. package/dist/iframe/order-process/components/utils/useCategoryVerification.d.ts +2 -2
  36. package/dist/iframe/order-process/components/utils/useCategoryVerification.d.ts.map +1 -1
  37. package/dist/iframe/payment/payment-page/PaymentPage.d.ts.map +1 -1
  38. package/dist/iframe/payment/payment-page/PaymentPage.js +1 -1
  39. package/dist/iframe/payment/payment-status-page/PaymentStatusPage.d.ts +2 -2
  40. package/dist/iframe/payment/payment-status-page/PaymentStatusPage.d.ts.map +1 -1
  41. package/dist/iframe/payment/payment-status-page/PaymentStatusPage.js +1 -1
  42. package/dist/iframe/payment/payment-status-page/component/PaymentStatusBody.d.ts +2 -2
  43. package/dist/iframe/payment/payment-status-page/component/PaymentStatusBody.d.ts.map +1 -1
  44. package/dist/index.js +1 -1
  45. package/dist/product-set/control/DateAndRecurrenceInput.d.ts.map +1 -1
  46. package/dist/report/index.d.ts +0 -3
  47. package/dist/report/index.d.ts.map +1 -1
  48. package/dist/sales/manual-booking/number-input-horizontal/NumberInputHorizontal.d.ts +1 -4
  49. package/dist/sales/manual-booking/number-input-horizontal/NumberInputHorizontal.d.ts.map +1 -1
  50. package/dist/sales/manual-booking/number-input-horizontal/NumberInputHorizontal.js +1 -1
  51. package/dist/static/switch/BooleanSwitch.d.ts +1 -3
  52. package/dist/static/switch/BooleanSwitch.d.ts.map +1 -1
  53. package/dist/static/switch/BooleanSwitch.js +1 -1
  54. package/dist/styles/date-time-button/DateTimeButton.scss +4 -0
  55. package/dist/styles/iframe-order-process/IframeOrderProcess.scss +4 -6
  56. package/dist/styles/iframe-page/PageBody.scss +3 -3
  57. package/dist/styles/report/_index.scss +1 -3
  58. package/dist/styles/sales/BookingFilter.scss +1 -3
  59. package/dist/styles/sales/BookingResults.scss +1 -1
  60. package/dist/styles/sales/ManualBooking.scss +4 -1
  61. package/dist/styles/static/Switch.scss +0 -1
  62. package/dist/table/TableHelperComponent.d.ts +1 -2
  63. package/dist/table/TableHelperComponent.d.ts.map +1 -1
  64. package/dist/table/TableHelperComponent.js +1 -1
  65. package/dist/types/iframe.d.ts +50 -2
  66. package/dist/types/iframe.d.ts.map +1 -1
  67. package/package.json +3 -3
  68. package/src/calendar/components/CalendarDates/CalendarDates.tsx +4 -3
  69. package/src/date-time-button/DateContent.tsx +9 -27
  70. package/src/date-time-button/DateTimeButton.stories.tsx +14 -13
  71. package/src/date-time-button/DateTimeButton.tsx +26 -35
  72. package/src/events/event-venue-map/components/MapPoint/MapPoint.tsx +1 -1
  73. package/src/iframe/event/event-booking-products/EventBookingProducts.tsx +3 -4
  74. package/src/iframe/event/event-booking-products/components/AccordionItem/AccordionItem.tsx +4 -8
  75. package/src/iframe/event/event-order-summary/EventOrderSummary.tsx +2 -0
  76. package/src/iframe/order-process/components/BookingSummary/BookingSummary.stories.tsx +31 -46
  77. package/src/iframe/order-process/components/BookingSummary/BookingSummary.tsx +19 -12
  78. package/src/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.tsx +66 -48
  79. package/src/iframe/order-process/components/BookingSummary/types/index.ts +4 -3
  80. package/src/iframe/order-process/components/BookingSummary/utils/index.ts +2 -11
  81. package/src/iframe/order-process/components/CalendarStepsForm/components/Category.tsx +1 -1
  82. package/src/iframe/order-process/components/CalendarStepsForm/components/CategoryProductModal.tsx +1 -4
  83. package/src/iframe/order-process/components/CategoryProduct/CategoryProduct.tsx +1 -4
  84. package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +1 -4
  85. package/src/iframe/order-process/components/utils/useCategoryVerification.ts +2 -3
  86. package/src/iframe/payment/payment-page/PaymentPage.tsx +6 -5
  87. package/src/iframe/payment/payment-status-page/PaymentStatusPage.tsx +26 -13
  88. package/src/iframe/payment/payment-status-page/component/PaymentStatusBody.tsx +2 -2
  89. package/src/product-set/control/DateAndRecurrenceInput.tsx +1 -2
  90. package/src/report/index.ts +0 -3
  91. package/src/sales/manual-booking/number-input-horizontal/NumberInputHorizontal.tsx +5 -19
  92. package/src/static/switch/BooleanSwitch.tsx +2 -6
  93. package/src/styles/date-time-button/DateTimeButton.scss +4 -0
  94. package/src/styles/iframe-order-process/IframeOrderProcess.scss +4 -6
  95. package/src/styles/iframe-page/PageBody.scss +3 -3
  96. package/src/styles/report/_index.scss +1 -3
  97. package/src/styles/sales/BookingFilter.scss +1 -3
  98. package/src/styles/sales/BookingResults.scss +1 -1
  99. package/src/styles/sales/ManualBooking.scss +4 -1
  100. package/src/styles/static/Switch.scss +0 -1
  101. package/src/table/TableHelperComponent.tsx +3 -18
  102. package/src/types/iframe.ts +58 -2
  103. package/dist/assets/dashboard/info.svg +0 -8
  104. package/dist/assets/dashboard/info.svg.js +0 -1
  105. package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.d.ts +0 -10
  106. package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.d.ts.map +0 -1
  107. package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.js +0 -1
  108. package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/index.d.ts +0 -2
  109. package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/index.d.ts.map +0 -1
  110. package/dist/report/DataFieldsSelector/DataFieldsSelector.d.ts +0 -13
  111. package/dist/report/DataFieldsSelector/DataFieldsSelector.d.ts.map +0 -1
  112. package/dist/report/DataFieldsSelector/DataFieldsSelector.js +0 -1
  113. package/dist/report/DataFieldsSelector/index.d.ts +0 -2
  114. package/dist/report/DataFieldsSelector/index.d.ts.map +0 -1
  115. package/dist/report/ReportRunnerModal/ReportRunnerModal.d.ts +0 -22
  116. package/dist/report/ReportRunnerModal/ReportRunnerModal.d.ts.map +0 -1
  117. package/dist/report/ReportRunnerModal/ReportRunnerModal.js +0 -1
  118. package/dist/report/ReportRunnerModal/index.d.ts +0 -2
  119. package/dist/report/ReportRunnerModal/index.d.ts.map +0 -1
  120. package/dist/report/ReportTypeSelect/ReportTypeSelect.d.ts +0 -3
  121. package/dist/report/ReportTypeSelect/ReportTypeSelect.d.ts.map +0 -1
  122. package/dist/report/ReportTypeSelect/ReportTypeSelect.js +0 -1
  123. package/dist/report/ReportTypeSelect/index.d.ts +0 -2
  124. package/dist/report/ReportTypeSelect/index.d.ts.map +0 -1
  125. package/dist/styles/report/ReportEditorModal.scss +0 -98
  126. package/dist/styles/report/ReportRunnerModal.scss +0 -95
  127. package/src/assets/dashboard/info.svg +0 -8
  128. package/src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx +0 -43
  129. package/src/iframe/order-process/components/BookingSummary/components/ProductSummary/index.ts +0 -1
  130. package/src/report/DataFieldsSelector/DataFieldsSelector.tsx +0 -112
  131. package/src/report/DataFieldsSelector/index.ts +0 -1
  132. package/src/report/ReportRunnerModal/ReportRunnerModal.tsx +0 -187
  133. package/src/report/ReportRunnerModal/index.ts +0 -1
  134. package/src/report/ReportTypeSelect/ReportTypeSelect.tsx +0 -68
  135. package/src/report/ReportTypeSelect/index.ts +0 -1
  136. package/src/sales/manual-booking/number-input-horizontal/NumberInputHorizontal.stories.tsx +0 -48
  137. package/src/styles/report/ReportEditorModal.scss +0 -98
  138. package/src/styles/report/ReportRunnerModal.scss +0 -95
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { PointProduct } from "@licklist/core/dist/DataMapper/Product/PointProductDataMapper";
3
3
  import { QuantityCheckProductInfo } from "@licklist/plugins/dist/types/Api/verifyStock";
4
- import { ProductCategory } from "@licklist/plugins/dist/types/context/sale/menuSteps";
4
+ import { ProductCategory } from "../../../../../types";
5
5
  import { CategoryProductModal } from "./CategoryProductModal";
6
6
 
7
7
  export type CategoryProps = {
@@ -3,10 +3,7 @@ import clsx from "clsx";
3
3
  import { Button } from "react-bootstrap";
4
4
  import { PointProduct } from "@licklist/core/dist/DataMapper/Product/PointProductDataMapper";
5
5
  import { QuantityCheckProductInfo } from "@licklist/plugins/dist/types/Api/verifyStock";
6
- import {
7
- Product,
8
- ProductCategory,
9
- } from "@licklist/plugins/dist/types/context/sale/menuSteps";
6
+ import { ProductCategory, Product } from "../../../../../types";
10
7
  import { CategoryProduct } from "../../CategoryProduct";
11
8
  import Icon from "../../../../../static/Icon";
12
9
 
@@ -6,11 +6,8 @@ import { useIntl } from "react-intl";
6
6
  import * as Config from "@licklist/core/dist/Config";
7
7
  import HookFormService from "@licklist/plugins/dist/services/Form/HookFormService";
8
8
  import { QuantityCheckProductInfo } from "@licklist/plugins/dist/types/Api/verifyStock";
9
- import {
10
- Product,
11
- ProductCategory,
12
- } from "@licklist/plugins/dist/types/context/sale/menuSteps";
13
9
  import { TicketDescription } from "../../../event/ticket-description";
10
+ import { ProductCategory, Product } from "../../../../types";
14
11
  import { ProductQuantityInput } from "./components/ProductQuantityInput";
15
12
 
16
13
  interface CategoryProductProps {
@@ -4,11 +4,8 @@ import { Button } from "react-bootstrap";
4
4
  import { useTranslation } from "react-i18next";
5
5
  import { FieldValues, RefCallBack, UseFormClearErrors } from "react-hook-form";
6
6
  import { Zone } from "@licklist/core/dist/DataMapper/Provider/ZoneDataMapper";
7
- import {
8
- Product,
9
- ProductCategory,
10
- } from "@licklist/plugins/dist/types/context/sale/menuSteps";
11
7
  import { NumberInput } from "../NumberInput";
8
+ import { Product, ProductCategory } from "../../../../../../types";
12
9
 
13
10
  interface FormOrderItem {
14
11
  id: number;
@@ -2,7 +2,7 @@ import { ProductCategory } from "@licklist/core/dist/DataMapper/Product/ProductC
2
2
  import { Currency } from "@licklist/core/dist/Config";
3
3
  import { useIntl } from "react-intl";
4
4
  import { useTranslation } from "react-i18next";
5
- import { OrderItems } from "@licklist/plugins/dist/types/context/Iframe/orderItems";
5
+ import { Order } from "src/types";
6
6
 
7
7
  interface CategoryError {
8
8
  message: string;
@@ -13,9 +13,8 @@ interface CategoryError {
13
13
  export const useCategoryVerification = () => {
14
14
  const { t } = useTranslation("Validation");
15
15
  const { formatNumber } = useIntl();
16
-
17
16
  return (
18
- values: OrderItems,
17
+ values: Record<Order["id"], Order>,
19
18
  productCategories?: ProductCategory[],
20
19
  isLastPage?: boolean
21
20
  ): CategoryError | void => {
@@ -49,7 +49,7 @@ export const PaymentPage = ({
49
49
  );
50
50
 
51
51
  const onCloseWindow = () => {
52
- // TODO discuss redirect to site
52
+ // @TODO discuss redirect to site
53
53
  window.location.href = "https://booked.it/";
54
54
  };
55
55
 
@@ -101,13 +101,14 @@ export const PaymentPage = ({
101
101
  }
102
102
 
103
103
  const orderTotalAmountByFormValues = cartSumByOrderProducts(
104
- bookingSummaryProps?.formValues &&
105
- Object.values(bookingSummaryProps?.formValues)
104
+ bookingSummaryProps && bookingSummaryProps?.formValues
105
+ ? Object.values(bookingSummaryProps?.formValues)
106
+ : undefined
106
107
  );
107
108
 
108
109
  // User can fill promo code only in iframe application.
109
- // It isn't possible via payment link. This check will
110
- // be applied when there is no metadata and in case when
110
+ // It didn't possible via payment link. This check will
111
+ // be applied when there are no metadata and in case when
111
112
  // orderValues sum is greater than amount in order.
112
113
  const isCalculatedAmountGreaterThanOrderAmount =
113
114
  orderTotalAmountByFormValues > data?.amount;
@@ -1,5 +1,7 @@
1
+ // eslint-disable-next-line max-len
1
2
  import React, { ReactNode } from "react";
2
3
  import { useTranslation } from "react-i18next";
4
+
3
5
  import { PaymentStatusBody } from "./component";
4
6
  import { LoaderIndicator } from "../../../static/loader/LoaderIndicator";
5
7
  import { Page, PageBody } from "../../page";
@@ -14,7 +16,7 @@ export const ORDER_STATUS_FAILED = "failed";
14
16
  export const ORDER_STATUS_SUCCESS = "success";
15
17
  export const ORDER_STATUS_PENDING = "pending";
16
18
 
17
- export type OrderStatus =
19
+ export type OrderStatusPrefix =
18
20
  | typeof ORDER_STATUS_SUCCESS
19
21
  | typeof ORDER_STATUS_FAILED
20
22
  | typeof ORDER_STATUS_PENDING;
@@ -24,7 +26,7 @@ interface PaymentStatusComponentProps {
24
26
  onBack?: () => void;
25
27
  onTryAgain?: () => void;
26
28
  isLoading?: boolean;
27
- status: OrderStatus;
29
+ status: OrderStatusPrefix;
28
30
  isAppUsingInIframe?: boolean;
29
31
  bookingSummaryProps?: BookingSummaryProps;
30
32
  EventCardComponent?: ReactNode;
@@ -34,12 +36,6 @@ interface PaymentStatusComponentProps {
34
36
  paymentMetadata?: PaymentMetadata;
35
37
  }
36
38
 
37
- const titles: Record<OrderStatus, string> = {
38
- [ORDER_STATUS_SUCCESS]: "purchaseSuccessful",
39
- [ORDER_STATUS_PENDING]: "pendingPayment",
40
- [ORDER_STATUS_FAILED]: "purchaseFailed",
41
- };
42
-
43
39
  // @TODO In future think, how to reuse this component in Iframe Pending, Success and Failed Pages
44
40
  export const PaymentStatusPage = ({
45
41
  onCloseWindow,
@@ -57,10 +53,27 @@ export const PaymentStatusPage = ({
57
53
  }: PaymentStatusComponentProps) => {
58
54
  const { t } = useTranslation("Design");
59
55
 
60
- if (isLoading) return <LoaderIndicator isLoaded={false} />;
56
+ const getTitle = () => {
57
+ switch (status) {
58
+ case ORDER_STATUS_SUCCESS:
59
+ return t("purchaseSuccessful");
60
+ case ORDER_STATUS_PENDING:
61
+ return t("pendingPayment");
62
+ default:
63
+ return t("purchaseFailed");
64
+ }
65
+ };
66
+
67
+ const title = getTitle();
68
+
69
+ if (isLoading) {
70
+ return <LoaderIndicator isLoaded={false} />;
71
+ }
61
72
 
62
73
  const orderTotalAmounByFormValues = cartSumByOrderProducts(
63
- Object.values(bookingSummaryProps?.formValues ?? {})
74
+ bookingSummaryProps && bookingSummaryProps?.formValues
75
+ ? Object.values(bookingSummaryProps?.formValues)
76
+ : undefined
64
77
  );
65
78
 
66
79
  // User can fill promocode only in iframe appcliation.
@@ -75,7 +88,6 @@ export const PaymentStatusPage = ({
75
88
  return (
76
89
  <Page
77
90
  className="payment-status-page"
78
- isAppUsingInIframe={isAppUsingInIframe}
79
91
  headerBlock={
80
92
  <PaymentStatusHeader
81
93
  success={status !== ORDER_STATUS_FAILED}
@@ -86,10 +98,11 @@ export const PaymentStatusPage = ({
86
98
  }
87
99
  />
88
100
  }
101
+ isAppUsingInIframe={isAppUsingInIframe}
89
102
  >
90
103
  <PageBody
91
104
  leftBlock={
92
- <PageBody.LeftBlock title={t(titles[status])}>
105
+ <PageBody.LeftBlock title={title}>
93
106
  <div>
94
107
  {EventCardComponent}
95
108
  <PaymentStatusBody
@@ -155,7 +168,7 @@ export const PaymentStatusPage = ({
155
168
  {bookingSummaryProps ? (
156
169
  <BookingSummary {...bookingSummaryProps} />
157
170
  ) : (
158
- <h6>{t(titles[status])}</h6>
171
+ <h6>{title}</h6>
159
172
  )}
160
173
  </PageBody.RightBlock>
161
174
  }
@@ -3,12 +3,12 @@ import { useTranslation } from "react-i18next";
3
3
  import {
4
4
  ORDER_STATUS_PENDING,
5
5
  ORDER_STATUS_SUCCESS,
6
- OrderStatus,
6
+ OrderStatusPrefix,
7
7
  } from "../PaymentStatusPage";
8
8
  import { StatusBody } from "../../status-body/StatusBody";
9
9
 
10
10
  interface PaymentStatusBodyProps {
11
- status: OrderStatus;
11
+ status: OrderStatusPrefix;
12
12
  onBack: () => void;
13
13
  onTryAgain?: () => void;
14
14
  email?: string;
@@ -126,8 +126,7 @@ export const DateAndRecurrenceInput = ({
126
126
  }
127
127
  }
128
128
 
129
- const availableTime =
130
- availableTimesFormRef?.current?.getValues()?.availableTimes || null;
129
+ const availableTime = availableTimesFormRef?.current?.getValues()?.availableTimes || null;
131
130
 
132
131
  const values = {
133
132
  rrule: next.rrule,
@@ -1,5 +1,2 @@
1
1
  export * from "./card";
2
2
  export * from "./form";
3
- export * from "./ReportTypeSelect";
4
- export * from "./DataFieldsSelector";
5
- export * from "./ReportRunnerModal";
@@ -1,5 +1,5 @@
1
1
  import clsx from "clsx";
2
- import React, { SyntheticEvent, forwardRef } from "react";
2
+ import React, { forwardRef } from "react";
3
3
  import { FormControl } from "react-bootstrap";
4
4
  import { useTranslation } from "react-i18next";
5
5
  import { Icon } from "../../../static";
@@ -13,15 +13,12 @@ interface NumberInputHorizontalProps {
13
13
  onChange: (value: number) => void;
14
14
  onPlusClick: (value: number) => void;
15
15
  onMinusClick: (value: number) => void;
16
- onSelect?: (e: SyntheticEvent) => void;
17
- step?: number;
18
16
  min?: number;
19
17
  max?: number;
20
18
  size?: Sizes;
21
19
  defaultValue?: number;
22
20
  hasCurrency?: boolean;
23
21
  isLoading?: boolean;
24
- shouldHideButtons?: boolean;
25
22
  }
26
23
 
27
24
  export const NumberInputHorizontal = forwardRef<
@@ -31,16 +28,13 @@ export const NumberInputHorizontal = forwardRef<
31
28
  (
32
29
  {
33
30
  disabled = false,
34
- shouldHideButtons,
35
31
  className = "",
36
32
  value,
37
- step,
38
33
  size = "small",
39
34
  hasCurrency,
40
35
  onChange,
41
36
  onPlusClick,
42
37
  onMinusClick,
43
- onSelect,
44
38
  min,
45
39
  max,
46
40
  defaultValue,
@@ -60,12 +54,7 @@ export const NumberInputHorizontal = forwardRef<
60
54
  }
61
55
  };
62
56
 
63
- const onClick = (e) => {
64
- if (onSelect) {
65
- onSelect(e);
66
- }
67
- e.target.select();
68
- };
57
+ const onClick = (e) => e.target.select();
69
58
 
70
59
  const handleArrowDownClick = () => {
71
60
  if (min !== undefined && value > min) {
@@ -90,7 +79,7 @@ export const NumberInputHorizontal = forwardRef<
90
79
  "licklist-number-input-horizontal__btn-minus",
91
80
  hasBigSize ? "big-sizes-btn" : "small-sizes-btn",
92
81
  ].join(" ")}
93
- disabled={disabled || shouldHideButtons}
82
+ disabled={disabled}
94
83
  >
95
84
  <Icon
96
85
  type="minus"
@@ -109,14 +98,11 @@ export const NumberInputHorizontal = forwardRef<
109
98
  ref={ref}
110
99
  onClick={onClick}
111
100
  type={disabled && hasBigSize ? "text" : "number"}
112
- className={clsx(
113
- hasBigSize ? "big-sizes-input" : "small-sizes-input"
114
- )}
101
+ className={hasBigSize ? "big-sizes-input" : "small-sizes-input"}
115
102
  onChange={(e) => onChange(Number(e.target.value))}
116
103
  value={disabled && hasBigSize && !isLoading ? soldOut : value}
117
104
  min={min}
118
105
  max={max}
119
- step={step}
120
106
  defaultValue={defaultValue}
121
107
  disabled={disabled}
122
108
  />
@@ -128,7 +114,7 @@ export const NumberInputHorizontal = forwardRef<
128
114
  "licklist-number-input-horizontal__btn-plus",
129
115
  hasBigSize ? "big-sizes-btn" : "small-sizes-btn",
130
116
  ].join(" ")}
131
- disabled={disabled || shouldHideButtons}
117
+ disabled={disabled}
132
118
  >
133
119
  <Icon
134
120
  type="plus"
@@ -8,8 +8,6 @@ export interface BooleanSwitchProps {
8
8
  value?: boolean;
9
9
  disabled?: boolean;
10
10
  onChange: (value: boolean) => void;
11
- firstValueTitle?: string;
12
- secondValueTitle?: string;
13
11
  }
14
12
 
15
13
  export function BooleanSwitch({
@@ -17,14 +15,12 @@ export function BooleanSwitch({
17
15
  value,
18
16
  disabled,
19
17
  onChange,
20
- firstValueTitle,
21
- secondValueTitle,
22
18
  }: BooleanSwitchProps) {
23
19
  const { t } = useTranslation("Design");
24
20
 
25
21
  const options: SelectItem[] = [
26
- { id: 1, value: firstValueTitle ?? t("yes") },
27
- { id: 0, value: secondValueTitle ?? t("no") },
22
+ { id: 1, value: t("yes") },
23
+ { id: 0, value: t("no") },
28
24
  ];
29
25
 
30
26
  const handleChange = useCallback(
@@ -31,6 +31,10 @@
31
31
  font-size: 0.7rem;
32
32
  }
33
33
 
34
+ &.today:first-of-type {
35
+ min-width: 7.5rem;
36
+ }
37
+
34
38
  &.disabled {
35
39
  border: 2px solid $snippet-calendar-disabled-button-border-color;
36
40
  background-color: $snippet-calendar-disabled-button-background-color;
@@ -131,12 +131,6 @@
131
131
  font-weight: 500;
132
132
  }
133
133
 
134
- .categories {
135
- &:not(:last-child) {
136
- border-bottom: 2px solid $separator-color;
137
- }
138
- }
139
-
140
134
  .products {
141
135
  margin-top: 0.5rem;
142
136
 
@@ -150,6 +144,10 @@
150
144
  margin-bottom: 0.5rem;
151
145
  }
152
146
  }
147
+
148
+ &:not(:last-child) {
149
+ border-bottom: 2px solid $separator-color;
150
+ }
153
151
  }
154
152
 
155
153
  &:not(:last-child) {
@@ -60,9 +60,9 @@
60
60
 
61
61
  .left-block-container {
62
62
  height: calc(100svh - 12rem);
63
- overflow-y: auto;
64
- overflow-x: hidden;
65
- scrollbar-width: thin;
63
+ scrollbar-width: none;
64
+ overflow: scroll;
65
+
66
66
  .iframe-event-card {
67
67
  border-bottom: 2px solid $separator-color;
68
68
  }
@@ -1,3 +1 @@
1
- @import "./ReportCard.scss";
2
- @import "./ReportRunnerModal.scss";
3
- @import "./ReportEditorModal.scss";
1
+ @import "./ReportCard.scss";
@@ -164,12 +164,10 @@
164
164
 
165
165
  @include media-breakpoint-down(md) {
166
166
  flex-wrap: wrap;
167
-
168
167
  .date-container {
169
168
  width: 100%;
170
169
  flex: 1;
171
170
  }
172
-
173
171
  .btn-primary {
174
172
  margin-top: 1rem;
175
173
  }
@@ -232,4 +230,4 @@
232
230
  }
233
231
  }
234
232
  }
235
- }
233
+ }
@@ -5,7 +5,7 @@
5
5
  flex-wrap: wrap;
6
6
 
7
7
  .result-card {
8
- height: 14rem;
8
+ height: 14.25rem;
9
9
  border: 1px solid $gray-400;
10
10
  max-width: calc(50% - 0.75rem);
11
11
  flex: 0 0 calc(50% - 0.75rem);
@@ -291,7 +291,10 @@
291
291
  width: 7rem;
292
292
  height: 2.6rem;
293
293
  }
294
-
294
+ .small-sizes-input:disabled {
295
+ border: none;
296
+ background-color: white !important;
297
+ }
295
298
  .big-sizes-input {
296
299
  height: 3.75rem;
297
300
  font-size: 1.7rem;
@@ -27,7 +27,6 @@ $btn-switch-option-padding-y: calc(#{$btn-padding-y} - #{sp(1)}) !default;
27
27
  border-radius: $btn-switch-option-border-radius;
28
28
  margin: 0;
29
29
  padding: $btn-switch-option-padding-y $btn-switch-option-padding-x;
30
- min-width: 4.25rem;
31
30
 
32
31
  &:hover,
33
32
  &:active,
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable @typescript-eslint/ban-types */
2
- import React, { SetStateAction, useEffect, useState } from "react";
2
+ import React, { useEffect, useState } from "react";
3
3
  import { Col, Row, Table } from "react-bootstrap";
4
4
  import { useLocation } from "react-router-dom";
5
5
  import { isEqual } from "lodash";
@@ -30,7 +30,6 @@ export interface TableHelperComponentProps {
30
30
  displayShowingSection?: boolean;
31
31
  externalFilters?: { [key: string]: any };
32
32
  initialOptions?: Partial<ITableProps>;
33
- filteredOrdersOptions?: (value: SetStateAction<ITableProps>) => void;
34
33
  }
35
34
 
36
35
  // @TODO Refactor? component to get less complexity
@@ -63,7 +62,6 @@ function TableHelperComponent(props: TableHelperComponentProps) {
63
62
  displayShowingSection = true,
64
63
  externalFilters = {},
65
64
  initialOptions = {},
66
- filteredOrdersOptions,
67
65
  } = props;
68
66
 
69
67
  const query = useQuery();
@@ -99,9 +97,8 @@ function TableHelperComponent(props: TableHelperComponentProps) {
99
97
  useEffect(
100
98
  () => {
101
99
  if (
102
- (isEqual(optionsCache, options) &&
103
- isEqual(cachedExtFilters, externalFilters)) ||
104
- !!filteredOrdersOptions
100
+ isEqual(optionsCache, options) &&
101
+ isEqual(cachedExtFilters, externalFilters)
105
102
  )
106
103
  return;
107
104
 
@@ -169,12 +166,6 @@ function TableHelperComponent(props: TableHelperComponentProps) {
169
166
  };
170
167
 
171
168
  const onPerPageChange = (nextPerPage: number) => {
172
- if (filteredOrdersOptions) {
173
- filteredOrdersOptions((prevOptions) => ({
174
- ...prevOptions,
175
- page: nextPerPage,
176
- }));
177
- }
178
169
  setOptions((prevOptions) => ({
179
170
  ...prevOptions,
180
171
  perPage: nextPerPage,
@@ -182,12 +173,6 @@ function TableHelperComponent(props: TableHelperComponentProps) {
182
173
  };
183
174
 
184
175
  const onPageChange = (nextPage: number) => {
185
- if (filteredOrdersOptions) {
186
- filteredOrdersOptions((prevOptions) => ({
187
- ...prevOptions,
188
- page: nextPage,
189
- }));
190
- }
191
176
  setOptions((prevOptions) => ({
192
177
  ...prevOptions,
193
178
  page: nextPage,
@@ -1,5 +1,61 @@
1
- import { OrderItems } from "@licklist/plugins/dist/types/context/Iframe/orderItems";
1
+ import { Product as CoreProduct } from "@licklist/core/dist/DataMapper/Product/ProductDataMapper";
2
+ import { Zone } from "@licklist/core/dist/DataMapper/Provider/ZoneDataMapper";
3
+
4
+ export interface Product {
5
+ id: number;
6
+ name: string;
7
+ description: string;
8
+ deposit: number;
9
+ price: number;
10
+ minSub?: number;
11
+ minAmount?: number;
12
+ maxAmount?: number;
13
+ minSpend?: number | null;
14
+ isSoldOut?: boolean;
15
+ isRequired?: boolean;
16
+ isUnlimited?: boolean;
17
+ images: CoreProduct["images"];
18
+ capacity?: number | null;
19
+ uuid: string;
20
+ }
21
+
22
+ export interface ProductCategory {
23
+ id: number;
24
+ name: string;
25
+ allowDeposits?: boolean;
26
+ remainderExpireAfter?: number | null;
27
+ minSubItems: number | null;
28
+ maxSubItems: number | null;
29
+ products?: Product[];
30
+ zone?: Zone | null;
31
+ }
32
+
33
+ export interface MenuStep {
34
+ id: number;
35
+ name: string;
36
+ productCategories?: ProductCategory[];
37
+ }
38
+
39
+ export interface Menu {
40
+ id: number;
41
+ menuSteps: MenuStep[];
42
+ }
43
+
44
+ // TODO similar type exists in iframe app
45
+ // remove this when components are moved to iframe
46
+ export interface Order {
47
+ id: number;
48
+ quantity: number;
49
+ price: number;
50
+ name: string;
51
+ productsCategoryId: number;
52
+ deposit?: number | null;
53
+ }
2
54
 
3
55
  export type SetOrderFn = (
4
- val: OrderItems | ((prevVar: OrderItems) => OrderItems)
56
+ val:
57
+ | Record<number, Order>
58
+ | ((prevVar: Record<number, Order>) => Record<number, Order>)
5
59
  ) => void;
60
+
61
+ export type WizardFormValues = { [key: string]: any };
@@ -1,8 +0,0 @@
1
- <svg width="20" height="20" viewBox="0 0 20 20" fill="none"
2
- xmlns="http://www.w3.org/2000/svg">
3
- <g id="Info icon">
4
- <circle id="Oval" cx="10" cy="6" r="1.25" fill="#0E8CE2"/>
5
- <rect id="Rectangle" x="9" y="8" width="2" height="7" fill="#0E8CE2"/>
6
- <circle id="Oval_2" cx="10" cy="10" r="9" stroke="#0E8CE2" stroke-width="2"/>
7
- </g>
8
- </svg>
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t,r,n,c=require("react");(e=c)&&"object"==typeof e&&"default"in e&&e.default;function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},l.apply(this,arguments)}exports.ReactComponent=function(e){return c.createElement("svg",l({width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),t||(t=c.createElement("circle",{cx:10,cy:6,r:1.25,fill:"#0E8CE2"})),r||(r=c.createElement("path",{fill:"#0E8CE2",d:"M9 8h2v7H9z"})),n||(n=c.createElement("circle",{cx:10,cy:10,r:9,stroke:"#0E8CE2",strokeWidth:2})))};
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- import { OrderItem } from "@licklist/plugins/dist/types/context/Iframe/orderItems";
3
- type ProductSummaryProps = {
4
- name?: string;
5
- productQuantityError?: string;
6
- orderProduct: OrderItem;
7
- };
8
- export declare const ProductSummary: ({ name, productQuantityError, orderProduct, }: ProductSummaryProps) => JSX.Element;
9
- export {};
10
- //# sourceMappingURL=ProductSummary.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ProductSummary.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,wDAAwD,CAAC;AAEnF,KAAK,mBAAmB,GAAG;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,YAAY,EAAE,SAAS,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,cAAc,kDAIxB,mBAAmB,gBA0BrB,CAAC"}
@@ -1 +0,0 @@
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,a=require("@licklist/core/dist/Config"),n=require("react-i18next"),l=require("react-intl");exports.ProductSummary=function(e){var t=e.name,c=e.productQuantityError,u=e.orderProduct,i=n.useTranslation("Design").t,s=(0,l.useIntl().formatNumber)(((null==u?void 0:u.deposit)||(null==u?void 0:u.price)||0)*(null==u?void 0:u.quantity),{style:"currency",currency:a.Currency.GBP});return r.createElement("div",{className:"product"},r.createElement("p",{className:"m-0 name"},null!=t?t:null==u?void 0:u.name),r.createElement("div",{className:"d-flex justify-content-between"},r.createElement("p",{className:"m-0"},i("shortQuantity"),": ",null==u?void 0:u.quantity),r.createElement("p",{className:"price"},s)),c&&r.createElement("p",{className:"iframe-event__message-error"},c))};
@@ -1,2 +0,0 @@
1
- export * from "./ProductSummary";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/iframe/order-process/components/BookingSummary/components/ProductSummary/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
@@ -1,13 +0,0 @@
1
- /// <reference types="react" />
2
- type ReportField = {
3
- id: number;
4
- key: string;
5
- title: string;
6
- };
7
- interface DataFieldsSelectorType {
8
- reportFields: ReportField[];
9
- isLoading?: boolean;
10
- }
11
- export declare const DataFieldsSelector: ({ reportFields, isLoading, }: DataFieldsSelectorType) => JSX.Element;
12
- export {};
13
- //# sourceMappingURL=DataFieldsSelector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DataFieldsSelector.d.ts","sourceRoot":"","sources":["../../../src/report/DataFieldsSelector/DataFieldsSelector.tsx"],"names":[],"mappings":";AAQA,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,UAAU,sBAAsB;IAC9B,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,kBAAkB,iCAG5B,sBAAsB,gBAkExB,CAAC"}
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("react"),t=(e=r)&&"object"==typeof e&&"default"in e?e.default:e,l=require("../../static/loader/LoaderIndicator.js"),a=require("react-i18next"),n=require("react-bootstrap"),o=require("react-hook-form"),u=require("@react-aria/utils"),c=require("lodash"),i=function(e){var r=e.onChange,l=e.value,a=e.label,o=e.checked,c=u.useId();return t.createElement(n.Form.Group,{controlId:c,className:"custom-checkbox"},t.createElement(n.Form.Check,{label:a,value:l,onChange:r,checked:o,custom:!0}))};exports.DataFieldsSelector=function(e){var r,u,d=e.reportFields,s=e.isLoading,m=a.useTranslation(["App","Design"]).t,v=o.useFormContext(),f=v.control,p=v.formState.errors;return t.createElement(t.Fragment,null,s&&t.createElement("div",{className:"report-fields-loader"},t.createElement(l.LoaderIndicator,null)),!s&&t.createElement(t.Fragment,null,t.createElement(n.Form.Label,{className:"mt-4"},m("dataFields")),t.createElement(n.Row,null,t.createElement(o.Controller,{name:"reportFieldValues","data-testid":"report-field-values-select",control:f,rules:{validate:function(e){return e.length>0||m("dataFieldRequired")}},render:function(e){var r=e.field,l=function(e){r.onChange(c.xor(r.value,[Number(e.target.value)]))};return t.createElement(t.Fragment,null,null==d?void 0:d.map((function(e){return t.createElement(n.Col,{key:e.id,lg:6},t.createElement(i,{value:e.id,onChange:l,label:e.title,checked:r.value.includes(e.id)}))})))}})),(null===(r=p.reportFieldValues)||void 0===r?void 0:r.message)&&t.createElement(n.Row,null,t.createElement(n.Col,null,t.createElement("div",{className:"invalid-feedback field-values-error"},null===(u=p.reportFieldValues)||void 0===u?void 0:u.message)))))};
@@ -1,2 +0,0 @@
1
- export * from "./DataFieldsSelector";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/report/DataFieldsSelector/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}