@qite/tide-booking-component 1.3.4 → 1.3.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 (41) hide show
  1. package/build/build-cjs/booking-wizard/features/booking/booking-slice.d.ts +2 -1
  2. package/build/build-cjs/booking-wizard/features/booking/selectors.d.ts +1 -0
  3. package/build/build-cjs/booking-wizard/features/sidebar/sidebar-util.d.ts +3 -3
  4. package/build/build-cjs/booking-wizard/features/travelers-form/travelers-form-slice.d.ts +5 -5
  5. package/build/build-cjs/booking-wizard/types.d.ts +10 -1
  6. package/build/build-cjs/index.js +515 -293
  7. package/build/build-cjs/shared/utils/localization-util.d.ts +7 -0
  8. package/build/build-esm/booking-wizard/features/booking/booking-slice.d.ts +2 -1
  9. package/build/build-esm/booking-wizard/features/booking/selectors.d.ts +1 -0
  10. package/build/build-esm/booking-wizard/features/sidebar/sidebar-util.d.ts +3 -3
  11. package/build/build-esm/booking-wizard/features/travelers-form/travelers-form-slice.d.ts +5 -5
  12. package/build/build-esm/booking-wizard/types.d.ts +10 -1
  13. package/build/build-esm/index.js +517 -295
  14. package/build/build-esm/shared/utils/localization-util.d.ts +7 -0
  15. package/package.json +75 -75
  16. package/src/booking-product/components/product.tsx +316 -314
  17. package/src/booking-product/components/rooms.tsx +19 -15
  18. package/src/booking-wizard/components/print-offer-button.tsx +63 -63
  19. package/src/booking-wizard/features/booking/booking-self-contained.tsx +393 -389
  20. package/src/booking-wizard/features/booking/booking-slice.ts +668 -663
  21. package/src/booking-wizard/features/booking/booking.tsx +365 -361
  22. package/src/booking-wizard/features/booking/selectors.ts +445 -441
  23. package/src/booking-wizard/features/confirmation/confirmation.tsx +103 -97
  24. package/src/booking-wizard/features/flight-options/flight-utils.ts +522 -522
  25. package/src/booking-wizard/features/product-options/options-form.tsx +481 -481
  26. package/src/booking-wizard/features/sidebar/sidebar-util.ts +177 -177
  27. package/src/booking-wizard/features/summary/summary-booking-option-pax.tsx +25 -25
  28. package/src/booking-wizard/features/summary/summary.tsx +707 -674
  29. package/src/booking-wizard/features/travelers-form/travelers-form-slice.ts +164 -164
  30. package/src/booking-wizard/features/travelers-form/travelers-form.tsx +888 -754
  31. package/src/booking-wizard/settings-context.ts +62 -62
  32. package/src/booking-wizard/types.ts +289 -279
  33. package/src/booking-wizard/use-offer-printer.ts +117 -117
  34. package/src/shared/translations/en-GB.json +244 -237
  35. package/src/shared/translations/fr-BE.json +244 -238
  36. package/src/shared/translations/nl-BE.json +244 -237
  37. package/src/shared/utils/tide-api-utils.ts +36 -36
  38. package/styles/booking-wizard-variables.scss +873 -873
  39. package/styles/components/_booking.scss +879 -879
  40. package/styles/components/_dropdown.scss +72 -72
  41. package/styles/components/_form.scss +1583 -1583
@@ -1,5 +1,5 @@
1
1
  import { range } from "lodash";
2
- import React, { useContext, useState } from "react";
2
+ import React, { useContext, useEffect, useState } from "react";
3
3
  import { buildClassName } from "../../shared/utils/class-util";
4
4
  import { getTranslations } from "../../shared/utils/localization-util";
5
5
  import SettingsContext from "../settings-context";
@@ -24,6 +24,10 @@ const Rooms: React.FC<RoomsProps> = ({
24
24
  const [isTouched, setIsTouched] = useState<boolean>(false);
25
25
  const [currentRooms, setRoomState] = useState<ProductRoom[]>(rooms);
26
26
 
27
+ useEffect(() => {
28
+ setRoomState(rooms);
29
+ }, [rooms])
30
+
27
31
  const { language } = useContext(SettingsContext);
28
32
  const translations = getTranslations(language);
29
33
 
@@ -99,13 +103,13 @@ const Rooms: React.FC<RoomsProps> = ({
99
103
  currentRooms.map((room, i) =>
100
104
  i === roomIndex
101
105
  ? {
102
- ...room,
103
- children: value,
104
- childAges: range(0, value).map(
105
- (childIndex) =>
106
- room.childAges[childIndex] ?? 0
107
- ),
108
- }
106
+ ...room,
107
+ children: value,
108
+ childAges: range(0, value).map(
109
+ (childIndex) =>
110
+ room.childAges[childIndex] ?? 0
111
+ ),
112
+ }
109
113
  : room
110
114
  )
111
115
  );
@@ -131,13 +135,13 @@ const Rooms: React.FC<RoomsProps> = ({
131
135
  currentRooms.map((room, selectorRoomIndex) =>
132
136
  roomIndex === selectorRoomIndex
133
137
  ? {
134
- ...room,
135
- childAges: room.childAges
136
- .map((age, i) =>
137
- childIndex === i ? value : age
138
- )
139
- .sort((a, b) => b - a),
140
- }
138
+ ...room,
139
+ childAges: room.childAges
140
+ .map((age, i) =>
141
+ childIndex === i ? value : age
142
+ )
143
+ .sort((a, b) => b - a),
144
+ }
141
145
  : room
142
146
  )
143
147
  );
@@ -1,63 +1,63 @@
1
- import React from "react";
2
- import { BookingPackage, Pax } from "@qite/tide-client/build/types";
3
- import { useOfferPrinter } from "../use-offer-printer";
4
-
5
- interface PrintOfferButtonProps {
6
- bookingPackage?: BookingPackage;
7
-
8
- getPax: () => Pax[] | undefined;
9
-
10
- tagIds?: number[];
11
-
12
- printActionId?: number | null;
13
-
14
- onPrinted?: (pdfUrl: string) => void;
15
-
16
- labelIdle?: string;
17
- labelCreating?: string;
18
- labelPrinting?: string;
19
- disabled?: boolean;
20
- className?: string;
21
- loader?: React.ReactNode;
22
- }
23
-
24
- const PrintOfferButton: React.FC<PrintOfferButtonProps> = ({
25
- bookingPackage,
26
- getPax,
27
- tagIds,
28
- printActionId = null,
29
- onPrinted,
30
- labelIdle = "Print offer",
31
- labelCreating = "Generating offer…",
32
- labelPrinting = "Generating PDF…",
33
- disabled = false,
34
- className,
35
- }) => {
36
- const { handlePrint, stage, loading } = useOfferPrinter({
37
- bookingPackage,
38
- getPax,
39
- tagIds,
40
- onPrinted,
41
- printActionId,
42
- });
43
-
44
- const label =
45
- stage === "creating"
46
- ? labelCreating
47
- : stage === "printing"
48
- ? labelPrinting
49
- : labelIdle;
50
-
51
- return (
52
- <button
53
- type="button"
54
- onClick={handlePrint}
55
- disabled={disabled || loading}
56
- className={className}
57
- >
58
- {label}
59
- </button>
60
- );
61
- };
62
-
63
- export default PrintOfferButton;
1
+ import React from "react";
2
+ import { BookingPackage, Pax } from "@qite/tide-client/build/types";
3
+ import { useOfferPrinter } from "../use-offer-printer";
4
+
5
+ interface PrintOfferButtonProps {
6
+ bookingPackage?: BookingPackage;
7
+
8
+ getPax: () => Pax[] | undefined;
9
+
10
+ tagIds?: number[];
11
+
12
+ printActionId?: number | null;
13
+
14
+ onPrinted?: (pdfUrl: string) => void;
15
+
16
+ labelIdle?: string;
17
+ labelCreating?: string;
18
+ labelPrinting?: string;
19
+ disabled?: boolean;
20
+ className?: string;
21
+ loader?: React.ReactNode;
22
+ }
23
+
24
+ const PrintOfferButton: React.FC<PrintOfferButtonProps> = ({
25
+ bookingPackage,
26
+ getPax,
27
+ tagIds,
28
+ printActionId = null,
29
+ onPrinted,
30
+ labelIdle = "Print offer",
31
+ labelCreating = "Generating offer…",
32
+ labelPrinting = "Generating PDF…",
33
+ disabled = false,
34
+ className,
35
+ }) => {
36
+ const { handlePrint, stage, loading } = useOfferPrinter({
37
+ bookingPackage,
38
+ getPax,
39
+ tagIds,
40
+ onPrinted,
41
+ printActionId,
42
+ });
43
+
44
+ const label =
45
+ stage === "creating"
46
+ ? labelCreating
47
+ : stage === "printing"
48
+ ? labelPrinting
49
+ : labelIdle;
50
+
51
+ return (
52
+ <button
53
+ type="button"
54
+ onClick={handlePrint}
55
+ disabled={disabled || loading}
56
+ className={className}
57
+ >
58
+ {label}
59
+ </button>
60
+ );
61
+ };
62
+
63
+ export default PrintOfferButton;