@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.
- package/build/build-cjs/booking-wizard/features/booking/booking-slice.d.ts +2 -1
- package/build/build-cjs/booking-wizard/features/booking/selectors.d.ts +1 -0
- package/build/build-cjs/booking-wizard/features/sidebar/sidebar-util.d.ts +3 -3
- package/build/build-cjs/booking-wizard/features/travelers-form/travelers-form-slice.d.ts +5 -5
- package/build/build-cjs/booking-wizard/types.d.ts +10 -1
- package/build/build-cjs/index.js +515 -293
- package/build/build-cjs/shared/utils/localization-util.d.ts +7 -0
- package/build/build-esm/booking-wizard/features/booking/booking-slice.d.ts +2 -1
- package/build/build-esm/booking-wizard/features/booking/selectors.d.ts +1 -0
- package/build/build-esm/booking-wizard/features/sidebar/sidebar-util.d.ts +3 -3
- package/build/build-esm/booking-wizard/features/travelers-form/travelers-form-slice.d.ts +5 -5
- package/build/build-esm/booking-wizard/types.d.ts +10 -1
- package/build/build-esm/index.js +517 -295
- package/build/build-esm/shared/utils/localization-util.d.ts +7 -0
- package/package.json +75 -75
- package/src/booking-product/components/product.tsx +316 -314
- package/src/booking-product/components/rooms.tsx +19 -15
- package/src/booking-wizard/components/print-offer-button.tsx +63 -63
- package/src/booking-wizard/features/booking/booking-self-contained.tsx +393 -389
- package/src/booking-wizard/features/booking/booking-slice.ts +668 -663
- package/src/booking-wizard/features/booking/booking.tsx +365 -361
- package/src/booking-wizard/features/booking/selectors.ts +445 -441
- package/src/booking-wizard/features/confirmation/confirmation.tsx +103 -97
- package/src/booking-wizard/features/flight-options/flight-utils.ts +522 -522
- package/src/booking-wizard/features/product-options/options-form.tsx +481 -481
- package/src/booking-wizard/features/sidebar/sidebar-util.ts +177 -177
- package/src/booking-wizard/features/summary/summary-booking-option-pax.tsx +25 -25
- package/src/booking-wizard/features/summary/summary.tsx +707 -674
- package/src/booking-wizard/features/travelers-form/travelers-form-slice.ts +164 -164
- package/src/booking-wizard/features/travelers-form/travelers-form.tsx +888 -754
- package/src/booking-wizard/settings-context.ts +62 -62
- package/src/booking-wizard/types.ts +289 -279
- package/src/booking-wizard/use-offer-printer.ts +117 -117
- package/src/shared/translations/en-GB.json +244 -237
- package/src/shared/translations/fr-BE.json +244 -238
- package/src/shared/translations/nl-BE.json +244 -237
- package/src/shared/utils/tide-api-utils.ts +36 -36
- package/styles/booking-wizard-variables.scss +873 -873
- package/styles/components/_booking.scss +879 -879
- package/styles/components/_dropdown.scss +72 -72
- 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
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
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;
|