@pisell/private-materials 6.12.405 → 6.12.406
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/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +2 -2
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +2 -2
- package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +13 -6
- package/es/components/appointmentBooking/components/Cart/ContinueButton/index.less +6 -0
- package/es/components/appointmentBooking/components/Date/index.js +103 -35
- package/es/components/appointmentBooking/components/Services/index.js +123 -58
- package/es/components/appointmentBooking/context.js +72 -10
- package/es/components/appointmentBooking/hooks.js +227 -172
- package/es/components/appointmentBooking/index.js +3 -2
- package/es/components/appointmentBooking/locales.js +10 -0
- package/es/components/bigSale/components/BookingFloatingPanel/useBookingPanelController.js +0 -1
- package/es/components/bigSale/components/ProductList/index.js +0 -1
- package/es/components/bigSale/components/TimeBar/index.js +0 -1
- package/es/components/bigSale/dialog.js +0 -1
- package/es/components/bigSale/hooks/useBigSaleContext.js +0 -1
- package/es/components/bigSale/hooks/useBigSaleProductListConfig.js +1 -0
- package/es/components/bigSale/hooks/useSelectFloorMapResourceForBigSale.js +0 -1
- package/es/components/bigSale/index.js +0 -1
- package/es/components/bigSale/templates/Kiosk/index.js +0 -1
- package/es/components/sharedSecondaryBigSale/SharedSecondaryBigSaleReceiver.js +0 -1
- package/es/components/ticketBooking/components/ProductDisplayAdapter/index.js +3 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +1 -0
- package/es/components/venueBookingSales/catalogPresentation.js +1 -0
- package/es/components/venueBookingSales/checkout/useVenueBookingCheckout.js +0 -1
- package/es/index.js +0 -2
- package/es/plus/multiCurrencySettlement/index.js +1 -1
- package/es/plus/pisellReservation/data/bookingToReservationTables.js +1 -1
- package/es/plus/pisellReservation/floorMap/floorPlanApi.js +1 -1
- package/es/plus/pisellReservation/floorMap/reservationMock.js +1 -1
- package/es/plus/saleDetail/Base.js +0 -1
- package/es/plus/saleDetail/components/Client/hooks/useClientSelectorProps.js +0 -1
- package/es/plus/saleDetail/components/DetailActions/PrintAction.js +0 -1
- package/es/plus/saleDetail/components/DetailActions/index.js +0 -1
- package/es/plus/saleDetail/components/SummaryFinancialSections/index.js +0 -1
- package/es/plus/saleDetail/index.js +0 -1
- package/es/plus/saleDetail/tmpl/B/components/Dish/index.js +0 -1
- package/es/plus/saleDetail/tmpl/B/index.js +0 -1
- package/es/plus/salesSdk/utils/addProductWithFlowDebounced.js +1 -1
- package/es/plus/salesSdk/utils/bookingDate.js +1 -1
- package/es/plus/salesSdk/utils/enrichCartLineHolderDisplay.js +1 -1
- package/es/private-materials/lowcode/authmodal/meta.d.ts +1 -0
- package/es/pro/Login2.0/AuthModal.d.ts +1 -1
- package/es/pro/Login2.0/index.d.ts +2 -2
- package/es/pro/Login2.0/shared/types.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +13 -6
- package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.less +6 -0
- package/lib/components/appointmentBooking/components/Date/index.js +102 -34
- package/lib/components/appointmentBooking/components/Services/index.js +122 -57
- package/lib/components/appointmentBooking/context.js +71 -9
- package/lib/components/appointmentBooking/hooks.js +227 -172
- package/lib/components/appointmentBooking/index.js +2 -1
- package/lib/components/appointmentBooking/locales.js +10 -0
- package/package.json +4 -4
- package/es/plus/pisellReservation/index.js +0 -17
- package/es/plus/salesSdk/index.js +0 -54
|
@@ -2,11 +2,11 @@ import useEngineContext from "../../hooks/useEngineContext.js";
|
|
|
2
2
|
import { getCartCurrentResourceData, sendAppointmentBookingLog } from "./utils.js";
|
|
3
3
|
import { useAppointmentBooking } from "./hooks.js";
|
|
4
4
|
import { TasksManager } from "../../utils/tasks/index.js";
|
|
5
|
-
import React, { createContext, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
5
|
+
import React, { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
6
6
|
//#region src/components/appointmentBooking/context.tsx
|
|
7
7
|
const AppointmentBookingContext = createContext(void 0);
|
|
8
8
|
const AppointmentBookingProvider = ({ children }) => {
|
|
9
|
-
var _appHelper$utils, _currentStep$
|
|
9
|
+
var _appHelper$utils, _currentStep$step2, _currentStep$step3, _appointmentBooking$s2, _currentStep$step5, _appointmentBooking$s3, _currentStep$step7;
|
|
10
10
|
const policyIdsRef = useRef([]);
|
|
11
11
|
const lastLoggedStepRef = useRef();
|
|
12
12
|
const appointmentBooking = useAppointmentBooking();
|
|
@@ -20,6 +20,27 @@ const AppointmentBookingProvider = ({ children }) => {
|
|
|
20
20
|
const [isAgreeDepositPolicy, setIsAgreeDepositPolicy] = useState(false);
|
|
21
21
|
const [currentResource, setCurrentResource] = useState(null);
|
|
22
22
|
const [loading, setLoading] = useState(false);
|
|
23
|
+
const [availabilityError, setAvailabilityError] = useState(false);
|
|
24
|
+
const bookingPreparationRef = useRef(null);
|
|
25
|
+
const stepTransitionRef = useRef({
|
|
26
|
+
generation: 0,
|
|
27
|
+
pending: null,
|
|
28
|
+
module: appointmentBooking
|
|
29
|
+
});
|
|
30
|
+
const runBookingPreparation = useCallback(() => {
|
|
31
|
+
const job = bookingPreparationRef.current;
|
|
32
|
+
if (!job) return Promise.resolve();
|
|
33
|
+
if (job.pending) return job.pending;
|
|
34
|
+
const pending = Promise.resolve().then(job.run);
|
|
35
|
+
job.pending = pending;
|
|
36
|
+
pending.then(() => {
|
|
37
|
+
if (bookingPreparationRef.current === job) bookingPreparationRef.current = null;
|
|
38
|
+
job.pending = null;
|
|
39
|
+
}, () => {
|
|
40
|
+
job.pending = null;
|
|
41
|
+
});
|
|
42
|
+
return pending;
|
|
43
|
+
}, []);
|
|
23
44
|
const [isErrorHolder, setIsErrorHolder] = useState(false);
|
|
24
45
|
const [tasksManager] = useState(() => new TasksManager());
|
|
25
46
|
const [policyParams, setPolicyParams] = useState(null);
|
|
@@ -28,7 +49,43 @@ const AppointmentBookingProvider = ({ children }) => {
|
|
|
28
49
|
const symbolic = appHelper === null || appHelper === void 0 || (_appHelper$utils = appHelper.utils) === null || _appHelper$utils === void 0 ? void 0 : _appHelper$utils.getSymbolic();
|
|
29
50
|
useEffect(() => {
|
|
30
51
|
setCurrentStep(appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.getCurrentStep());
|
|
31
|
-
}, []);
|
|
52
|
+
}, [appointmentBooking]);
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
var _currentStep$step;
|
|
55
|
+
const transition = stepTransitionRef.current;
|
|
56
|
+
const key = currentStep === null || currentStep === void 0 || (_currentStep$step = currentStep.step) === null || _currentStep$step === void 0 ? void 0 : _currentStep$step.key;
|
|
57
|
+
if (transition.sourceKey !== key) {
|
|
58
|
+
var _bookingPreparationRe;
|
|
59
|
+
const hadPendingTransition = !!transition.pending;
|
|
60
|
+
transition.generation += 1;
|
|
61
|
+
transition.pending = null;
|
|
62
|
+
transition.sourceKey = key;
|
|
63
|
+
if (hadPendingTransition && !((_bookingPreparationRe = bookingPreparationRef.current) === null || _bookingPreparationRe === void 0 ? void 0 : _bookingPreparationRe.pending)) setLoading(false);
|
|
64
|
+
}
|
|
65
|
+
setAvailabilityError(false);
|
|
66
|
+
}, [currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.key]);
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
var _bookingPreparationRe2;
|
|
69
|
+
const transition = stepTransitionRef.current;
|
|
70
|
+
if (((_bookingPreparationRe2 = bookingPreparationRef.current) === null || _bookingPreparationRe2 === void 0 ? void 0 : _bookingPreparationRe2.module) !== appointmentBooking) bookingPreparationRef.current = null;
|
|
71
|
+
if (transition.module !== appointmentBooking) {
|
|
72
|
+
var _bookingPreparationRe3;
|
|
73
|
+
transition.generation += 1;
|
|
74
|
+
transition.pending = null;
|
|
75
|
+
transition.sourceKey = void 0;
|
|
76
|
+
transition.module = appointmentBooking;
|
|
77
|
+
setAvailabilityError(false);
|
|
78
|
+
if (!((_bookingPreparationRe3 = bookingPreparationRef.current) === null || _bookingPreparationRe3 === void 0 ? void 0 : _bookingPreparationRe3.pending)) setLoading(false);
|
|
79
|
+
}
|
|
80
|
+
return () => {
|
|
81
|
+
var _bookingPreparationRe4;
|
|
82
|
+
if (transition.module === appointmentBooking) {
|
|
83
|
+
transition.generation += 1;
|
|
84
|
+
transition.pending = null;
|
|
85
|
+
}
|
|
86
|
+
if (((_bookingPreparationRe4 = bookingPreparationRef.current) === null || _bookingPreparationRe4 === void 0 ? void 0 : _bookingPreparationRe4.module) === appointmentBooking) bookingPreparationRef.current = null;
|
|
87
|
+
};
|
|
88
|
+
}, [appointmentBooking]);
|
|
32
89
|
useEffect(() => {
|
|
33
90
|
var _currentStep$index;
|
|
34
91
|
const step = currentStep === null || currentStep === void 0 ? void 0 : currentStep.step;
|
|
@@ -43,7 +100,7 @@ const AppointmentBookingProvider = ({ children }) => {
|
|
|
43
100
|
});
|
|
44
101
|
}, [
|
|
45
102
|
currentStep === null || currentStep === void 0 ? void 0 : currentStep.index,
|
|
46
|
-
currentStep === null || currentStep === void 0 || (_currentStep$
|
|
103
|
+
currentStep === null || currentStep === void 0 || (_currentStep$step3 = currentStep.step) === null || _currentStep$step3 === void 0 ? void 0 : _currentStep$step3.key,
|
|
47
104
|
carts
|
|
48
105
|
]);
|
|
49
106
|
/**
|
|
@@ -102,18 +159,18 @@ const AppointmentBookingProvider = ({ children }) => {
|
|
|
102
159
|
* @Date: 2025-05-10 15:18
|
|
103
160
|
*/
|
|
104
161
|
const isLastStep = useMemo(() => {
|
|
105
|
-
var _currentStep$step2;
|
|
106
|
-
return (currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.key) === "confirm-information";
|
|
107
|
-
}, [currentStep === null || currentStep === void 0 || (_currentStep$step3 = currentStep.step) === null || _currentStep$step3 === void 0 ? void 0 : _currentStep$step3.key, appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s3 = appointmentBooking.store) === null || _appointmentBooking$s3 === void 0 || (_appointmentBooking$s3 = _appointmentBooking$s3.step) === null || _appointmentBooking$s3 === void 0 || (_appointmentBooking$s3 = _appointmentBooking$s3.store) === null || _appointmentBooking$s3 === void 0 ? void 0 : _appointmentBooking$s3.stepList]);
|
|
108
|
-
const currentStepParams = useMemo(() => {
|
|
109
162
|
var _currentStep$step4;
|
|
110
|
-
|
|
163
|
+
return (currentStep === null || currentStep === void 0 || (_currentStep$step4 = currentStep.step) === null || _currentStep$step4 === void 0 ? void 0 : _currentStep$step4.key) === "confirm-information";
|
|
164
|
+
}, [currentStep === null || currentStep === void 0 || (_currentStep$step5 = currentStep.step) === null || _currentStep$step5 === void 0 ? void 0 : _currentStep$step5.key, appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s3 = appointmentBooking.store) === null || _appointmentBooking$s3 === void 0 || (_appointmentBooking$s3 = _appointmentBooking$s3.step) === null || _appointmentBooking$s3 === void 0 || (_appointmentBooking$s3 = _appointmentBooking$s3.store) === null || _appointmentBooking$s3 === void 0 ? void 0 : _appointmentBooking$s3.stepList]);
|
|
165
|
+
const currentStepParams = useMemo(() => {
|
|
166
|
+
var _currentStep$step6;
|
|
167
|
+
const key = currentStep === null || currentStep === void 0 || (_currentStep$step6 = currentStep.step) === null || _currentStep$step6 === void 0 ? void 0 : _currentStep$step6.key;
|
|
111
168
|
return {
|
|
112
169
|
key,
|
|
113
170
|
index: stepLists.findIndex((item) => item.key === key),
|
|
114
171
|
stepLists
|
|
115
172
|
};
|
|
116
|
-
}, [currentStep === null || currentStep === void 0 || (_currentStep$
|
|
173
|
+
}, [currentStep === null || currentStep === void 0 || (_currentStep$step7 = currentStep.step) === null || _currentStep$step7 === void 0 ? void 0 : _currentStep$step7.key, stepLists]);
|
|
117
174
|
useEffect(() => {
|
|
118
175
|
var _currentStepParams$ke, _currentStepParams$ke2;
|
|
119
176
|
if ((currentStepParams === null || currentStepParams === void 0 || (_currentStepParams$ke = currentStepParams.key) === null || _currentStepParams$ke === void 0 ? void 0 : _currentStepParams$ke.startsWith("select-resource")) || (currentStepParams === null || currentStepParams === void 0 || (_currentStepParams$ke2 = currentStepParams.key) === null || _currentStepParams$ke2 === void 0 ? void 0 : _currentStepParams$ke2.startsWith("fill-form"))) {
|
|
@@ -161,6 +218,11 @@ const AppointmentBookingProvider = ({ children }) => {
|
|
|
161
218
|
setCurrentResource,
|
|
162
219
|
loading,
|
|
163
220
|
setLoading,
|
|
221
|
+
availabilityError,
|
|
222
|
+
setAvailabilityError,
|
|
223
|
+
bookingPreparationRef,
|
|
224
|
+
runBookingPreparation,
|
|
225
|
+
stepTransitionRef,
|
|
164
226
|
isErrorHolder,
|
|
165
227
|
setIsErrorHolder,
|
|
166
228
|
isLastStep,
|