@licklist/design 0.44.550-dev.4 → 0.44.550-dev.6

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 (72) hide show
  1. package/dist/events/event-venue-map/components/MapPoint/MapPoint.d.ts +1 -1
  2. package/dist/events/event-venue-map/components/MapPoint/MapPoint.d.ts.map +1 -1
  3. package/dist/iframe/event/event-booking-products/EventBookingProducts.d.ts +4 -2
  4. package/dist/iframe/event/event-booking-products/EventBookingProducts.d.ts.map +1 -1
  5. package/dist/iframe/event/event-booking-products/components/AccordionItem/AccordionItem.d.ts +4 -2
  6. package/dist/iframe/event/event-booking-products/components/AccordionItem/AccordionItem.d.ts.map +1 -1
  7. package/dist/iframe/event/event-order-summary/EventOrderSummary.d.ts +1 -1
  8. package/dist/iframe/event/event-order-summary/EventOrderSummary.d.ts.map +1 -1
  9. package/dist/iframe/order-process/components/BookingSummary/BookingSummary.d.ts.map +1 -1
  10. package/dist/iframe/order-process/components/BookingSummary/BookingSummary.js +1 -1
  11. package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.d.ts +10 -0
  12. package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.d.ts.map +1 -0
  13. package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.js +1 -0
  14. package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/index.d.ts +2 -0
  15. package/dist/iframe/order-process/components/BookingSummary/components/ProductSummary/index.d.ts.map +1 -0
  16. package/dist/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.d.ts +4 -3
  17. package/dist/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.d.ts.map +1 -1
  18. package/dist/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.js +1 -1
  19. package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts +3 -4
  20. package/dist/iframe/order-process/components/BookingSummary/types/index.d.ts.map +1 -1
  21. package/dist/iframe/order-process/components/BookingSummary/utils/index.d.ts +4 -2
  22. package/dist/iframe/order-process/components/BookingSummary/utils/index.d.ts.map +1 -1
  23. package/dist/iframe/order-process/components/BookingSummary/utils/index.js +1 -1
  24. package/dist/iframe/order-process/components/CalendarStepsForm/components/Category.d.ts +1 -1
  25. package/dist/iframe/order-process/components/CalendarStepsForm/components/Category.d.ts.map +1 -1
  26. package/dist/iframe/order-process/components/CalendarStepsForm/components/CategoryProductModal.d.ts +1 -1
  27. package/dist/iframe/order-process/components/CalendarStepsForm/components/CategoryProductModal.d.ts.map +1 -1
  28. package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.d.ts +1 -1
  29. package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.d.ts.map +1 -1
  30. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts +1 -1
  31. package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.d.ts.map +1 -1
  32. package/dist/iframe/order-process/components/utils/useCategoryVerification.d.ts +2 -2
  33. package/dist/iframe/order-process/components/utils/useCategoryVerification.d.ts.map +1 -1
  34. package/dist/iframe/payment/payment-page/PaymentPage.d.ts.map +1 -1
  35. package/dist/iframe/payment/payment-page/PaymentPage.js +1 -1
  36. package/dist/iframe/payment/payment-status-page/PaymentStatusPage.d.ts +2 -2
  37. package/dist/iframe/payment/payment-status-page/PaymentStatusPage.d.ts.map +1 -1
  38. package/dist/iframe/payment/payment-status-page/PaymentStatusPage.js +1 -1
  39. package/dist/iframe/payment/payment-status-page/component/PaymentStatusBody.d.ts +2 -2
  40. package/dist/iframe/payment/payment-status-page/component/PaymentStatusBody.d.ts.map +1 -1
  41. package/dist/product-set/control/DateAndRecurrenceInput.d.ts.map +1 -1
  42. package/dist/sales/manual-booking/number-input-horizontal/NumberInputHorizontal.d.ts +2 -1
  43. package/dist/sales/manual-booking/number-input-horizontal/NumberInputHorizontal.d.ts.map +1 -1
  44. package/dist/sales/manual-booking/number-input-horizontal/NumberInputHorizontal.js +1 -1
  45. package/dist/styles/iframe-order-process/IframeOrderProcess.scss +6 -4
  46. package/dist/types/iframe.d.ts +2 -50
  47. package/dist/types/iframe.d.ts.map +1 -1
  48. package/package.json +1 -1
  49. package/src/events/event-venue-map/components/MapPoint/MapPoint.tsx +1 -1
  50. package/src/iframe/event/event-booking-products/EventBookingProducts.tsx +4 -3
  51. package/src/iframe/event/event-booking-products/components/AccordionItem/AccordionItem.tsx +8 -4
  52. package/src/iframe/event/event-order-summary/EventOrderSummary.tsx +0 -2
  53. package/src/iframe/order-process/components/BookingSummary/BookingSummary.stories.tsx +46 -31
  54. package/src/iframe/order-process/components/BookingSummary/BookingSummary.tsx +12 -19
  55. package/src/iframe/order-process/components/BookingSummary/components/ProductSummary/ProductSummary.tsx +43 -0
  56. package/src/iframe/order-process/components/BookingSummary/components/ProductSummary/index.ts +1 -0
  57. package/src/iframe/order-process/components/BookingSummary/components/ProductsByMenuStep/ProductsByMenuStep.tsx +48 -66
  58. package/src/iframe/order-process/components/BookingSummary/types/index.ts +3 -4
  59. package/src/iframe/order-process/components/BookingSummary/utils/index.ts +11 -2
  60. package/src/iframe/order-process/components/CalendarStepsForm/components/Category.tsx +1 -1
  61. package/src/iframe/order-process/components/CalendarStepsForm/components/CategoryProductModal.tsx +4 -1
  62. package/src/iframe/order-process/components/CategoryProduct/CategoryProduct.tsx +4 -1
  63. package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +4 -1
  64. package/src/iframe/order-process/components/utils/useCategoryVerification.ts +3 -2
  65. package/src/iframe/payment/payment-page/PaymentPage.tsx +5 -6
  66. package/src/iframe/payment/payment-status-page/PaymentStatusPage.tsx +13 -26
  67. package/src/iframe/payment/payment-status-page/component/PaymentStatusBody.tsx +2 -2
  68. package/src/product-set/control/DateAndRecurrenceInput.tsx +2 -1
  69. package/src/sales/manual-booking/number-input-horizontal/NumberInputHorizontal.stories.tsx +48 -0
  70. package/src/sales/manual-booking/number-input-horizontal/NumberInputHorizontal.tsx +14 -4
  71. package/src/styles/iframe-order-process/IframeOrderProcess.scss +6 -4
  72. package/src/types/iframe.ts +2 -58
@@ -1,7 +1,5 @@
1
- // eslint-disable-next-line max-len
2
1
  import React, { ReactNode } from "react";
3
2
  import { useTranslation } from "react-i18next";
4
-
5
3
  import { PaymentStatusBody } from "./component";
6
4
  import { LoaderIndicator } from "../../../static/loader/LoaderIndicator";
7
5
  import { Page, PageBody } from "../../page";
@@ -16,7 +14,7 @@ export const ORDER_STATUS_FAILED = "failed";
16
14
  export const ORDER_STATUS_SUCCESS = "success";
17
15
  export const ORDER_STATUS_PENDING = "pending";
18
16
 
19
- export type OrderStatusPrefix =
17
+ export type OrderStatus =
20
18
  | typeof ORDER_STATUS_SUCCESS
21
19
  | typeof ORDER_STATUS_FAILED
22
20
  | typeof ORDER_STATUS_PENDING;
@@ -26,7 +24,7 @@ interface PaymentStatusComponentProps {
26
24
  onBack?: () => void;
27
25
  onTryAgain?: () => void;
28
26
  isLoading?: boolean;
29
- status: OrderStatusPrefix;
27
+ status: OrderStatus;
30
28
  isAppUsingInIframe?: boolean;
31
29
  bookingSummaryProps?: BookingSummaryProps;
32
30
  EventCardComponent?: ReactNode;
@@ -36,6 +34,12 @@ interface PaymentStatusComponentProps {
36
34
  paymentMetadata?: PaymentMetadata;
37
35
  }
38
36
 
37
+ const titles: Record<OrderStatus, string> = {
38
+ [ORDER_STATUS_SUCCESS]: "purchaseSuccessful",
39
+ [ORDER_STATUS_PENDING]: "pendingPayment",
40
+ [ORDER_STATUS_FAILED]: "purchaseFailed",
41
+ };
42
+
39
43
  // @TODO In future think, how to reuse this component in Iframe Pending, Success and Failed Pages
40
44
  export const PaymentStatusPage = ({
41
45
  onCloseWindow,
@@ -53,27 +57,10 @@ export const PaymentStatusPage = ({
53
57
  }: PaymentStatusComponentProps) => {
54
58
  const { t } = useTranslation("Design");
55
59
 
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
- }
60
+ if (isLoading) return <LoaderIndicator isLoaded={false} />;
72
61
 
73
62
  const orderTotalAmounByFormValues = cartSumByOrderProducts(
74
- bookingSummaryProps && bookingSummaryProps?.formValues
75
- ? Object.values(bookingSummaryProps?.formValues)
76
- : undefined
63
+ Object.values(bookingSummaryProps?.formValues ?? {})
77
64
  );
78
65
 
79
66
  // User can fill promocode only in iframe appcliation.
@@ -88,6 +75,7 @@ export const PaymentStatusPage = ({
88
75
  return (
89
76
  <Page
90
77
  className="payment-status-page"
78
+ isAppUsingInIframe={isAppUsingInIframe}
91
79
  headerBlock={
92
80
  <PaymentStatusHeader
93
81
  success={status !== ORDER_STATUS_FAILED}
@@ -98,11 +86,10 @@ export const PaymentStatusPage = ({
98
86
  }
99
87
  />
100
88
  }
101
- isAppUsingInIframe={isAppUsingInIframe}
102
89
  >
103
90
  <PageBody
104
91
  leftBlock={
105
- <PageBody.LeftBlock title={title}>
92
+ <PageBody.LeftBlock title={t(titles[status])}>
106
93
  <div>
107
94
  {EventCardComponent}
108
95
  <PaymentStatusBody
@@ -168,7 +155,7 @@ export const PaymentStatusPage = ({
168
155
  {bookingSummaryProps ? (
169
156
  <BookingSummary {...bookingSummaryProps} />
170
157
  ) : (
171
- <h6>{title}</h6>
158
+ <h6>{t(titles[status])}</h6>
172
159
  )}
173
160
  </PageBody.RightBlock>
174
161
  }
@@ -3,12 +3,12 @@ import { useTranslation } from "react-i18next";
3
3
  import {
4
4
  ORDER_STATUS_PENDING,
5
5
  ORDER_STATUS_SUCCESS,
6
- OrderStatusPrefix,
6
+ OrderStatus,
7
7
  } from "../PaymentStatusPage";
8
8
  import { StatusBody } from "../../status-body/StatusBody";
9
9
 
10
10
  interface PaymentStatusBodyProps {
11
- status: OrderStatusPrefix;
11
+ status: OrderStatus;
12
12
  onBack: () => void;
13
13
  onTryAgain?: () => void;
14
14
  email?: string;
@@ -126,7 +126,8 @@ export const DateAndRecurrenceInput = ({
126
126
  }
127
127
  }
128
128
 
129
- const availableTime = availableTimesFormRef?.current?.getValues()?.availableTimes || null;
129
+ const availableTime =
130
+ availableTimesFormRef?.current?.getValues()?.availableTimes || null;
130
131
 
131
132
  const values = {
132
133
  rrule: next.rrule,
@@ -0,0 +1,48 @@
1
+ import React, { useRef, useState } from "react";
2
+ import { Meta, Story } from "@storybook/react";
3
+ import { NumberInputHorizontal } from "./NumberInputHorizontal";
4
+
5
+ export default {
6
+ title: "Manual Booking/NumberInputHorizontal",
7
+ } as Meta;
8
+
9
+ export const Default: Story<any> = (args) => {
10
+ const ref = useRef(null);
11
+ const [value, setValue] = useState(0);
12
+ const [isDisabled, setDisabled] = useState(true);
13
+
14
+ const onPriceClick = (e) => {
15
+ if (!isDisabled) {
16
+ return;
17
+ }
18
+ console.log("click");
19
+ setDisabled(false);
20
+ };
21
+
22
+ return (
23
+ <div
24
+ role="button"
25
+ tabIndex={0}
26
+ onClick={onPriceClick}
27
+ onKeyDown={onPriceClick}
28
+ style={{ height: "250px", width: "370px" }}
29
+ >
30
+ <NumberInputHorizontal
31
+ ref={ref}
32
+ hasCurrency
33
+ onSelect={onPriceClick}
34
+ onChange={(val) => {
35
+ setValue(val);
36
+ }}
37
+ onMinusClick={() => {
38
+ setValue(value - 1 || 0);
39
+ }}
40
+ onPlusClick={() => {
41
+ setValue((value ?? 0) + 1);
42
+ }}
43
+ value={value}
44
+ disabled={isDisabled}
45
+ />
46
+ </div>
47
+ );
48
+ };
@@ -1,5 +1,5 @@
1
1
  import clsx from "clsx";
2
- import React, { forwardRef } from "react";
2
+ import React, { SyntheticEvent, forwardRef } from "react";
3
3
  import { FormControl } from "react-bootstrap";
4
4
  import { useTranslation } from "react-i18next";
5
5
  import { Icon } from "../../../static";
@@ -13,6 +13,7 @@ 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;
16
17
  min?: number;
17
18
  max?: number;
18
19
  size?: Sizes;
@@ -35,6 +36,7 @@ export const NumberInputHorizontal = forwardRef<
35
36
  onChange,
36
37
  onPlusClick,
37
38
  onMinusClick,
39
+ onSelect,
38
40
  min,
39
41
  max,
40
42
  defaultValue,
@@ -54,7 +56,12 @@ export const NumberInputHorizontal = forwardRef<
54
56
  }
55
57
  };
56
58
 
57
- const onClick = (e) => e.target.select();
59
+ const onClick = (e) => {
60
+ if (onSelect) {
61
+ onSelect(e);
62
+ }
63
+ e.target.select();
64
+ };
58
65
 
59
66
  const handleArrowDownClick = () => {
60
67
  if (min !== undefined && value > min) {
@@ -98,13 +105,16 @@ export const NumberInputHorizontal = forwardRef<
98
105
  ref={ref}
99
106
  onClick={onClick}
100
107
  type={disabled && hasBigSize ? "text" : "number"}
101
- className={hasBigSize ? "big-sizes-input" : "small-sizes-input"}
108
+ className={clsx(
109
+ hasBigSize ? "big-sizes-input" : "small-sizes-input",
110
+ disabled && "border-0"
111
+ )}
102
112
  onChange={(e) => onChange(Number(e.target.value))}
103
113
  value={disabled && hasBigSize && !isLoading ? soldOut : value}
104
114
  min={min}
105
115
  max={max}
106
116
  defaultValue={defaultValue}
107
- disabled={disabled}
117
+ disabled={disabled && !onSelect}
108
118
  />
109
119
  </div>
110
120
  <button
@@ -131,6 +131,12 @@
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
+
134
140
  .products {
135
141
  margin-top: 0.5rem;
136
142
 
@@ -144,10 +150,6 @@
144
150
  margin-bottom: 0.5rem;
145
151
  }
146
152
  }
147
-
148
- &:not(:last-child) {
149
- border-bottom: 2px solid $separator-color;
150
- }
151
153
  }
152
154
 
153
155
  &:not(:last-child) {
@@ -1,61 +1,5 @@
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
- }
1
+ import { OrderItems } from "@licklist/plugins/dist/types/context/Iframe/orderItems";
54
2
 
55
3
  export type SetOrderFn = (
56
- val:
57
- | Record<number, Order>
58
- | ((prevVar: Record<number, Order>) => Record<number, Order>)
4
+ val: OrderItems | ((prevVar: OrderItems) => OrderItems)
59
5
  ) => void;
60
-
61
- export type WizardFormValues = { [key: string]: any };