@pisell/private-materials 6.12.175 → 6.12.177
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/preview.css +1 -1
- package/build/lowcode/preview.js +1 -1
- package/build/lowcode/render/default/view.js +21 -21
- package/build/lowcode/view.js +21 -21
- package/es/components/appointmentBooking/deposit/index.d.ts +2 -1
- package/es/components/appointmentBooking/index.d.ts +2 -1
- package/es/components/bigSale/components/BookingFloatingPanel/useBookingPanelController.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/useSelectFloorMapResourceForBigSale.js +0 -1
- package/es/components/bigSale/index.js +1 -1
- package/es/components/bigSale/templates/Kiosk/index.js +104 -48
- package/es/components/booking/deposit/index.d.ts +3 -1
- package/es/components/booking/info/addServiceVariant/index.d.ts +3 -1
- package/es/components/booking/info/index.d.ts +2 -1
- package/es/components/booking/materiels/contacts/index.d.ts +2 -1
- package/es/components/booking/materiels/duration/index.d.ts +2 -1
- package/es/components/booking/materiels/startTime/index.d.ts +2 -1
- package/es/components/ecocup/cupList/index.d.ts +2 -1
- package/es/components/ecocup/customerList/index.d.ts +2 -2
- package/es/components/eftpos/index.d.ts +2 -1
- package/es/components/eftposPay/index.d.ts +2 -1
- package/es/components/eventBooking/index.d.ts +2 -1
- package/es/components/kioskSale/index.d.ts +2 -2
- package/es/components/kioskSale/index.js +1 -1
- package/es/components/kioskSkuDetail/index.d.ts +1 -1
- package/es/components/login/index.d.ts +2 -1
- package/es/components/pisellSelectCustomerModal/index.d.ts +2 -1
- package/es/components/productExtension/index.d.ts +2 -1
- package/es/components/ruleSetting/index.d.ts +2 -1
- package/es/components/scanOrder/index.d.ts +2 -2
- package/es/components/sharedSecondaryBigSale/SharedSecondaryBigSaleReceiver.js +0 -1
- package/es/components/sharedSecondaryBigSale/index.d.ts +2 -2
- package/es/components/shoppingCart/index.d.ts +2 -1
- package/es/components/subTotal/index.d.ts +1 -1
- package/es/components/taxSelect/index.d.ts +2 -1
- package/es/components/ticketBooking/index.d.ts +1 -1
- package/es/components/venueBooking/index.d.ts +2 -2
- package/es/components/walletList/index.d.ts +2 -1
- package/es/index.js +0 -2
- package/es/plus/orderList/index.d.ts +1 -1
- package/es/plus/pisellProResourcePickerModal/PisellFloorMapPaletteViewAllModal.d.ts +1 -1
- package/es/plus/pisellProResourcePickerModal/PisellProResourcePickerModal.d.ts +2 -2
- package/es/plus/pisellReservation/components/SelectFloorMapResourceDialog.d.ts +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/pisellReservation/floorRoomCard/FloorRoomCardFromData.d.ts +1 -1
- package/es/plus/pisellReservation/floorRoomCard/ReservationFloorRoomCard.d.ts +1 -1
- package/es/plus/pisellReservation/floorRoomCard/mapFloorRoomCardViewProps.d.ts +1 -0
- package/es/plus/pisellReservation/floorRoomCard/views/RoomCardHeaderView.d.ts +1 -0
- package/es/plus/pisellSalesManagement/index.d.ts +1 -1
- package/es/plus/pisellTopology/PisellTopology.d.ts +2 -2
- package/es/plus/pisellTopology/TopologyDeviceCard.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/index.d.ts +7 -5
- package/es/plus/saasCreateOrganization/index.d.ts +2 -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/index.js +0 -1
- package/es/plus/saleDetail/components/PromotionWalletPanels/index.d.ts +1 -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/bookingEditService/BookingEditHolderField.js +6 -6
- package/es/plus/salesSdk/components/SalesSdkConfirmHolderModal.js +2 -4
- package/es/plus/salesSdk/context/SalesSdkCartContext.js +28 -21
- package/es/plus/salesSdk/context/SalesSdkHolderContext.js +104 -22
- package/es/plus/salesSdk/context/SalesSdkProvider.js +3 -12
- package/es/plus/salesSdk/hosts/ConfirmHolderHostRenderer.js +14 -5
- package/es/plus/salesSdk/normalProductDetail/NormalProductDetailHostRenderer.js +5 -2
- package/es/plus/salesSdk/types.d.ts +16 -1
- package/es/plus/salesSdk/utils/addProductWithFlowDebounced.js +1 -1
- package/es/plus/salesSdk/utils/bookingDate.js +1 -1
- package/es/plus/salesSdk/utils/customerAuthGate.js +2 -5
- package/es/plus/salesSdk/utils/enrichCacheItemBeforeAdd.js +1 -1
- package/es/plus/salesSdk/utils/enrichCartLineHolderDisplay.js +1 -1
- package/es/plus/salesSdk/utils/ensureCustomerAuthBeforeAdd.js +6 -6
- package/es/plus/salesSdk/utils/holderSubmitValidation.js +3 -4
- package/es/plus/salesSdk/utils/productHolderConfig.js +3 -17
- package/es/plus/salesSdk/utils/runAddProductFlow.js +14 -5
- package/es/plus/walletPassGallery/components/passDetail/index.d.ts +2 -1
- package/es/plus/walletPassGallery/index.d.ts +2 -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 +1 -2
- package/es/pro/Login2.0/shared/types.d.ts +1 -1
- package/es/pro/Selector/Item.d.ts +1 -1
- package/es/pro/numberKeyboard/index.d.ts +1 -1
- package/es/pro/pisellPhoneKeyboard/index.d.ts +2 -1
- package/es/pro/skuDetailModal/components/weighing/index.d.ts +2 -1
- package/es/pro/skuDetailModal/flow/modules/holder/index.js +4 -1
- package/lib/components/appointmentBooking/deposit/index.d.ts +2 -2
- package/lib/components/appointmentBooking/index.d.ts +2 -2
- package/lib/components/bigSale/index.js +1 -0
- package/lib/components/bigSale/templates/Kiosk/index.js +104 -47
- package/lib/components/booking/deposit/index.d.ts +3 -2
- package/lib/components/booking/info/addServiceVariant/index.d.ts +3 -2
- package/lib/components/booking/info/index.d.ts +2 -2
- package/lib/components/booking/materiels/contacts/index.d.ts +2 -2
- package/lib/components/booking/materiels/duration/index.d.ts +2 -2
- package/lib/components/booking/materiels/startTime/index.d.ts +2 -2
- package/lib/components/ecocup/cupList/index.d.ts +2 -2
- package/lib/components/ecocup/customerList/index.d.ts +2 -2
- package/lib/components/eftpos/index.d.ts +2 -2
- package/lib/components/eftposPay/index.d.ts +2 -2
- package/lib/components/eventBooking/index.d.ts +2 -2
- package/lib/components/kioskSale/index.d.ts +2 -2
- package/lib/components/kioskSale/index.js +1 -1
- package/lib/components/kioskSkuDetail/index.d.ts +1 -1
- package/lib/components/login/index.d.ts +2 -2
- package/lib/components/pisellSelectCustomerModal/index.d.ts +2 -2
- package/lib/components/productExtension/index.d.ts +2 -2
- package/lib/components/ruleSetting/index.d.ts +2 -2
- package/lib/components/scanOrder/index.d.ts +2 -2
- package/lib/components/sharedSecondaryBigSale/index.d.ts +2 -2
- package/lib/components/shoppingCart/index.d.ts +2 -2
- package/lib/components/subTotal/index.d.ts +1 -1
- package/lib/components/taxSelect/index.d.ts +2 -2
- package/lib/components/ticketBooking/index.d.ts +1 -1
- package/lib/components/venueBooking/index.d.ts +2 -2
- package/lib/components/walletList/index.d.ts +2 -2
- package/lib/plus/orderList/index.d.ts +1 -1
- package/lib/plus/pisellProResourcePickerModal/PisellFloorMapPaletteViewAllModal.d.ts +1 -1
- package/lib/plus/pisellProResourcePickerModal/PisellProResourcePickerModal.d.ts +2 -2
- package/lib/plus/pisellReservation/components/SelectFloorMapResourceDialog.d.ts +1 -1
- package/lib/plus/pisellReservation/floorRoomCard/FloorRoomCardFromData.d.ts +1 -1
- package/lib/plus/pisellReservation/floorRoomCard/ReservationFloorRoomCard.d.ts +1 -1
- package/lib/plus/pisellReservation/floorRoomCard/mapFloorRoomCardViewProps.d.ts +1 -0
- package/lib/plus/pisellReservation/floorRoomCard/views/RoomCardHeaderView.d.ts +1 -0
- package/lib/plus/pisellSalesManagement/index.d.ts +1 -1
- package/lib/plus/pisellTopology/PisellTopology.d.ts +2 -2
- package/lib/plus/pisellTopology/TopologyDeviceCard.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/index.d.ts +7 -6
- package/lib/plus/saasCreateOrganization/index.d.ts +2 -2
- package/lib/plus/saleDetail/components/PromotionWalletPanels/index.d.ts +1 -1
- package/lib/plus/salesSdk/bookingEditService/BookingEditHolderField.js +5 -5
- package/lib/plus/salesSdk/components/SalesSdkConfirmHolderModal.js +2 -4
- package/lib/plus/salesSdk/context/SalesSdkCartContext.js +28 -21
- package/lib/plus/salesSdk/context/SalesSdkHolderContext.js +104 -22
- package/lib/plus/salesSdk/context/SalesSdkProvider.js +3 -12
- package/lib/plus/salesSdk/hosts/ConfirmHolderHostRenderer.js +14 -5
- package/lib/plus/salesSdk/normalProductDetail/NormalProductDetailHostRenderer.js +5 -2
- package/lib/plus/salesSdk/types.d.ts +16 -1
- package/lib/plus/salesSdk/utils/customerAuthGate.js +1 -4
- package/lib/plus/salesSdk/utils/enrichCacheItemBeforeAdd.js +1 -1
- package/lib/plus/salesSdk/utils/ensureCustomerAuthBeforeAdd.js +6 -6
- package/lib/plus/salesSdk/utils/holderSubmitValidation.js +3 -4
- package/lib/plus/salesSdk/utils/productHolderConfig.js +3 -17
- package/lib/plus/salesSdk/utils/runAddProductFlow.js +14 -5
- package/lib/plus/walletPassGallery/components/passDetail/index.d.ts +2 -2
- package/lib/plus/walletPassGallery/index.d.ts +2 -2
- package/lib/pro/Selector/Item.d.ts +1 -1
- package/lib/pro/numberKeyboard/index.d.ts +1 -1
- package/lib/pro/pisellPhoneKeyboard/index.d.ts +2 -2
- package/lib/pro/skuDetailModal/components/weighing/index.d.ts +2 -2
- package/lib/pro/skuDetailModal/flow/modules/holder/index.js +4 -1
- package/package.json +4 -4
- package/es/plus/pisellReservation/index.js +0 -17
- package/es/plus/salesSdk/index.js +0 -51
package/es/index.js
CHANGED
|
@@ -85,7 +85,6 @@ import { useSalesSdkProducts } from "./plus/salesSdk/hooks/useSalesSdkProducts.j
|
|
|
85
85
|
import SalesSdkDemo from "./plus/salesSdk/demo/index.js";
|
|
86
86
|
import { useSalesSdkDish } from "./plus/salesSdk/hooks/useSalesSdkDish.js";
|
|
87
87
|
import { useSyncOsModule } from "./plus/salesSdk/hooks/useSyncOsModule.js";
|
|
88
|
-
import "./plus/salesSdk/index.js";
|
|
89
88
|
import BigSaleRightActionPanel from "./components/BigSaleRightActionPanel/index.js";
|
|
90
89
|
import { resolveBigSaleSelectionFlowConfig } from "./components/bigSale/selectionFlowConfig.js";
|
|
91
90
|
import BigSale from "./components/bigSale/index.js";
|
|
@@ -138,7 +137,6 @@ import PisellVenueControlPage from "./plus/pisellReservation/PisellVenueControlP
|
|
|
138
137
|
import PisellVenueWallPage from "./plus/pisellReservation/PisellVenueWallPage.js";
|
|
139
138
|
import PisellReservationTablePage from "./plus/pisellReservation/PisellReservationTablePage.js";
|
|
140
139
|
import SelectFloorMapResourceDialog from "./plus/pisellReservation/components/SelectFloorMapResourceDialog.js";
|
|
141
|
-
import "./plus/pisellReservation/index.js";
|
|
142
140
|
import { PisellTopology, PisellTopologyCore } from "./plus/pisellTopology/PisellTopology.js";
|
|
143
141
|
import cupProject_default from "./components/ecocup/cupProject/index.js";
|
|
144
142
|
import CupList from "./components/ecocup/cupList/index.js";
|
|
@@ -23,6 +23,6 @@ interface PisellFloorMapPaletteViewAllModalProps {
|
|
|
23
23
|
/** 容器平台:透传到 PisellProResourcePickerModal,手机请传 'h5' */
|
|
24
24
|
platform?: 'pc' | 'h5' | 'ipad';
|
|
25
25
|
}
|
|
26
|
-
declare function PisellFloorMapPaletteViewAllModal(props: PisellFloorMapPaletteViewAllModalProps): JSX.Element;
|
|
26
|
+
declare function PisellFloorMapPaletteViewAllModal(props: PisellFloorMapPaletteViewAllModalProps): React.JSX.Element;
|
|
27
27
|
//#endregion
|
|
28
28
|
export { PisellFloorMapPaletteViewAllModal };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { PisellProResourcePickerModalProps } from "./types.js";
|
|
2
|
+
import React from "react";
|
|
3
3
|
//#region src/plus/pisellProResourcePickerModal/PisellProResourcePickerModal.d.ts
|
|
4
|
-
declare function PisellProResourcePickerModal(props: PisellProResourcePickerModalProps): JSX.Element;
|
|
4
|
+
declare function PisellProResourcePickerModal(props: PisellProResourcePickerModalProps): React.JSX.Element;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { PisellProResourcePickerModal };
|
|
@@ -259,4 +259,4 @@ function bookingListToReservationTableRows(bookings) {
|
|
|
259
259
|
return rows;
|
|
260
260
|
}
|
|
261
261
|
//#endregion
|
|
262
|
-
export { applyHostResourceShellToBaseRow, bookingListToReservationTableRows, customerBrief, extractResourceRecordIds, filterBookingsByResourceIds,
|
|
262
|
+
export { applyHostResourceShellToBaseRow, bookingListToReservationTableRows, customerBrief, extractResourceRecordIds, filterBookingsByResourceIds, hostBookingUiPatchFromRecord, mergeBookingsForResourceRecord };
|
|
@@ -78,4 +78,4 @@ function toastFloorPlanLoadError(err) {
|
|
|
78
78
|
PisellToast({ content: err instanceof Error ? err.message : String(err) });
|
|
79
79
|
}
|
|
80
80
|
//#endregion
|
|
81
|
-
export { PISELL_RESERVATION_FLOOR_PLAN_CODE,
|
|
81
|
+
export { PISELL_RESERVATION_FLOOR_PLAN_CODE, ensureShopFloorPlanByCode, saveViewConfigToShopFloorPlan, shopLayoutToSceneElements$1 as shopLayoutToSceneElements, toastFloorPlanLoadError, toastFloorPlanSaveError, unsubscribeShopFloorPlanCodeQuery };
|
|
@@ -927,4 +927,4 @@ function getReservationDataSourceFormColumns() {
|
|
|
927
927
|
];
|
|
928
928
|
}
|
|
929
929
|
//#endregion
|
|
930
|
-
export { RESERVATION_BOUND_ROUND_TABLE_ELEMENT_KIND, RESERVATION_BOUND_TABLE_ELEMENT_KIND, applyReservationFloorMapLiveLabels,
|
|
930
|
+
export { RESERVATION_BOUND_ROUND_TABLE_ELEMENT_KIND, RESERVATION_BOUND_TABLE_ELEMENT_KIND, applyReservationFloorMapLiveLabels, defaultReservationTableRows, getDefaultReservationFloorMapConfig, getReservationDataSourceFormColumns, getReservationFloorMapShellConfig, mergeFloorMapElementKindCategoriesWithDefaults, mergeFloorMapElementKindsWithDefaults };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import React from "react";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { PisellTopologyProps } from "./types.js";
|
|
2
|
+
import React from "react";
|
|
3
3
|
//#region src/plus/pisellTopology/PisellTopology.d.ts
|
|
4
|
-
declare function PisellTopology(props: PisellTopologyProps): JSX.Element;
|
|
4
|
+
declare function PisellTopology(props: PisellTopologyProps): React.JSX.Element;
|
|
5
5
|
declare const PisellTopologyCore: typeof PisellTopology;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { PisellTopology, PisellTopologyCore };
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
1
3
|
//#region src/plus/productSelect/ProductCard/SkuCard/index.d.ts
|
|
2
4
|
declare const SkuCard: {
|
|
3
|
-
(props: any): JSX.Element | null;
|
|
4
|
-
A1: (props: any) => JSX.Element;
|
|
5
|
-
A2: (props: any) => JSX.Element;
|
|
6
|
-
A5: (props: any) => JSX.Element;
|
|
7
|
-
A9: (props: any) => JSX.Element;
|
|
5
|
+
(props: any): React.JSX.Element | null;
|
|
6
|
+
A1: (props: any) => React.JSX.Element;
|
|
7
|
+
A2: (props: any) => React.JSX.Element;
|
|
8
|
+
A5: (props: any) => React.JSX.Element;
|
|
9
|
+
A9: (props: any) => React.JSX.Element;
|
|
8
10
|
};
|
|
9
11
|
//#endregion
|
|
10
12
|
export { SkuCard };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SCOProps } from "./types.js";
|
|
2
|
+
import React from "react";
|
|
2
3
|
//#region src/plus/saasCreateOrganization/index.d.ts
|
|
3
|
-
declare const SaasCreateOrganization: (props: SCOProps) => JSX.Element;
|
|
4
|
+
declare const SaasCreateOrganization: (props: SCOProps) => React.JSX.Element;
|
|
4
5
|
//#endregion
|
|
5
6
|
export { SaasCreateOrganization };
|
|
@@ -11,7 +11,6 @@ import { useSalesSdkCart } from "../salesSdk/hooks/useSalesSdkCart.js";
|
|
|
11
11
|
import { useSalesSdkCustomer } from "../salesSdk/hooks/useSalesSdkCustomer.js";
|
|
12
12
|
import { useSalesSdkBookingContext } from "../salesSdk/context/SalesSdkBookingContext.js";
|
|
13
13
|
import { useSalesSdkSummary } from "../salesSdk/hooks/useSalesSdkSummary.js";
|
|
14
|
-
import "../salesSdk/index.js";
|
|
15
14
|
import locales_default from "./locales.js";
|
|
16
15
|
import locales_default$1 from "./components/LineItem/locales.js";
|
|
17
16
|
import { SaleOrderActionBoundary } from "./actions/index.js";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
2
2
|
import useEngineContext from "../../../../../hooks/useEngineContext.js";
|
|
3
3
|
import { useSalesSdkBookingContext } from "../../../../salesSdk/context/SalesSdkBookingContext.js";
|
|
4
|
-
import "../../../../salesSdk/index.js";
|
|
5
4
|
import { useMemo } from "react";
|
|
6
5
|
import { useMemoizedFn } from "ahooks";
|
|
7
6
|
//#region src/plus/saleDetail/components/Client/hooks/useClientSelectorProps.ts
|
|
@@ -9,7 +9,6 @@ import { useSalesSdk } from "../../../salesSdk/hooks/useSalesSdk.js";
|
|
|
9
9
|
import { useSalesSdkCart } from "../../../salesSdk/hooks/useSalesSdkCart.js";
|
|
10
10
|
import { useSalesSdkGlobalScanActivity } from "../../../salesSdk/context/SalesSdkGlobalScanActivityContext.js";
|
|
11
11
|
import { useSalesSdkSummary } from "../../../salesSdk/hooks/useSalesSdkSummary.js";
|
|
12
|
-
import "../../../salesSdk/index.js";
|
|
13
12
|
import { getNumericAmount, getSalesHostModule, resolveSaleDetailOrderIdFromSales, resolveSaleDetailOrderIdFromSalesResult, shouldCloseDialogAfterCheckout, updateLocalOrder } from "./utils.js";
|
|
14
13
|
import { getRemotePrintActions, getWristbandList } from "../../serve.js";
|
|
15
14
|
import { deriveSaleOrderSubmitState } from "../../actions/state.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Key, ReactNode, Ref } from "react";
|
|
1
|
+
import React, { Key, ReactNode, Ref } from "react";
|
|
2
2
|
//#region src/plus/saleDetail/components/PromotionWalletPanels/index.d.ts
|
|
3
3
|
type SaleDetailPromotionWalletPanelTone = 'default' | 'success' | 'warning' | 'danger';
|
|
4
4
|
type PromotionWalletPanelsAppearance = 'dark' | 'light';
|
|
@@ -3,7 +3,6 @@ import { resolvePaymentMethodName, usePaymentMethodNameMap } from "../../../pise
|
|
|
3
3
|
import { useSalesSdk } from "../../../salesSdk/hooks/useSalesSdk.js";
|
|
4
4
|
import { useSalesSdkCart } from "../../../salesSdk/hooks/useSalesSdkCart.js";
|
|
5
5
|
import { useSalesSdkSummary } from "../../../salesSdk/hooks/useSalesSdkSummary.js";
|
|
6
|
-
import "../../../salesSdk/index.js";
|
|
7
6
|
import React, { memo, useMemo } from "react";
|
|
8
7
|
import { formatAmount, locales } from "@pisell/utils";
|
|
9
8
|
import Decimal from "decimal.js";
|
|
@@ -4,7 +4,6 @@ import { useSalesSdk } from "../salesSdk/hooks/useSalesSdk.js";
|
|
|
4
4
|
import { SalesSdkProvider } from "../salesSdk/context/SalesSdkProvider.js";
|
|
5
5
|
import { SalesSdkDishProvider } from "../salesSdk/context/SalesSdkDishContext.js";
|
|
6
6
|
import { SalesSdkBookingContextProvider } from "../salesSdk/context/SalesSdkBookingContext.js";
|
|
7
|
-
import "../salesSdk/index.js";
|
|
8
7
|
import Base_default from "./Base.js";
|
|
9
8
|
import React, { forwardRef, useImperativeHandle } from "react";
|
|
10
9
|
//#region src/plus/saleDetail/index.tsx
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import useStableInstanceId from "../../../../../../hooks/useStableInstanceId.js";
|
|
2
2
|
import { useSalesSdkDish } from "../../../../../salesSdk/hooks/useSalesSdkDish.js";
|
|
3
3
|
import { useCurrentSalesSdkDish } from "../../../../../salesSdk/hooks/useCurrentSalesSdkDish.js";
|
|
4
|
-
import "../../../../../salesSdk/index.js";
|
|
5
4
|
import { SaleDetailStatusOverview } from "../shared/StatusOverview.js";
|
|
6
5
|
import { DishGroupView } from "./DishGroupView.js";
|
|
7
6
|
import dayjs from "dayjs";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
2
2
|
import useEngineContext from "../../../../hooks/useEngineContext.js";
|
|
3
3
|
import { useCurrentSalesSdkDish } from "../../../salesSdk/hooks/useCurrentSalesSdkDish.js";
|
|
4
|
-
import "../../../salesSdk/index.js";
|
|
5
4
|
import { getInternalNotesByScheduleEvent } from "../../serve.js";
|
|
6
5
|
import { TEMPLATE_B_PAY_ACTIONS, TEMPLATE_B_SUMMARY_ACTIONS } from "../../components/DetailActions/configs/index.js";
|
|
7
6
|
import { DetailActions } from "../../components/DetailActions/index.js";
|
|
@@ -7,7 +7,7 @@ import HolderList from "../../selectHolder/components/HolderList/index.js";
|
|
|
7
7
|
import { getCachedWaiverFormDetail } from "../../../components/booking/utils/waiverFormDetailCache.js";
|
|
8
8
|
import { getPetsData } from "../../../components/ticketBooking/serve.js";
|
|
9
9
|
import { useSalesSdkHostBridges } from "../context/SalesSdkHostBridgesContext.js";
|
|
10
|
-
import { ensureProductHolderFormId, getProductHolderFormId } from "../utils/productHolderConfig.js";
|
|
10
|
+
import { ensureProductHolderFormId, getProductHolderFormId, isProductHolderRequired } from "../utils/productHolderConfig.js";
|
|
11
11
|
import { buildHolderListRequestParams } from "../utils/enrichCartLineHolderDisplay.js";
|
|
12
12
|
import { useSalesSdkHolderOptional } from "../context/SalesSdkHolderContext.js";
|
|
13
13
|
import { SalesSdkSelectHolderModal } from "../components/SalesSdkSelectHolderModal.js";
|
|
@@ -30,7 +30,7 @@ function hasHolderFormFields(formDataConfig) {
|
|
|
30
30
|
return Array.isArray(formDataConfig === null || formDataConfig === void 0 ? void 0 : formDataConfig.field) || Array.isArray(formDataConfig === null || formDataConfig === void 0 ? void 0 : formDataConfig.form_field);
|
|
31
31
|
}
|
|
32
32
|
const BookingEditHolderField = ({ state, cacheItem, required, value, onChange, getCurrentCacheItem, presentation = "modal" }) => {
|
|
33
|
-
var _context$appHelper, _state$bookingConfig, _holderConfig$form,
|
|
33
|
+
var _context$appHelper, _state$bookingConfig, _holderConfig$form, _currentCacheItem$_ex, _cacheItem$_extend, _state$pet5, _state$pet6, _state$pet7, _state$bookingConfig3, _inlineState$bookingC2, _inlineState$pet2, _state$client2, _inlineState$client5;
|
|
34
34
|
const bridges = useSalesSdkHostBridges();
|
|
35
35
|
const platform = usePlatform();
|
|
36
36
|
const context = useEngineContext();
|
|
@@ -39,8 +39,8 @@ const BookingEditHolderField = ({ state, cacheItem, required, value, onChange, g
|
|
|
39
39
|
const isInline = presentation === "inline";
|
|
40
40
|
const holderConfig = (state === null || state === void 0 || (_state$bookingConfig = state.bookingConfig) === null || _state$bookingConfig === void 0 ? void 0 : _state$bookingConfig.holder) || {};
|
|
41
41
|
const title = (holderConfig === null || holderConfig === void 0 || (_holderConfig$form = holderConfig.form) === null || _holderConfig$form === void 0 ? void 0 : _holderConfig$form.title) || (holderConfig === null || holderConfig === void 0 ? void 0 : holderConfig.title) || locales.getText("pisell2.text.holder");
|
|
42
|
-
const isRequired = required !== null && required !== void 0 ? required : (state === null || state === void 0 || (_state$bookingConfig2 = state.bookingConfig) === null || _state$bookingConfig2 === void 0 || (_state$bookingConfig2 = _state$bookingConfig2.config) === null || _state$bookingConfig2 === void 0 || (_state$bookingConfig2 = _state$bookingConfig2.basic) === null || _state$bookingConfig2 === void 0 ? void 0 : _state$bookingConfig2.subject_require) === "require";
|
|
43
42
|
const currentCacheItem = (getCurrentCacheItem === null || getCurrentCacheItem === void 0 ? void 0 : getCurrentCacheItem()) || cacheItem;
|
|
43
|
+
const isRequired = required !== null && required !== void 0 ? required : isProductHolderRequired(currentCacheItem);
|
|
44
44
|
const maxSelectedCount = (holderConfig === null || holderConfig === void 0 ? void 0 : holderConfig.maxSelectedCount) || (currentCacheItem === null || currentCacheItem === void 0 || (_currentCacheItem$_ex = currentCacheItem._extend) === null || _currentCacheItem$_ex === void 0 ? void 0 : _currentCacheItem$_ex.quantity) || (cacheItem === null || cacheItem === void 0 || (_cacheItem$_extend = cacheItem._extend) === null || _cacheItem$_extend === void 0 ? void 0 : _cacheItem$_extend.quantity) || 1;
|
|
45
45
|
const selectType = maxSelectedCount > 1 ? "multiple" : "single";
|
|
46
46
|
const liveHolderOptions = getHolderOptionsForSource(currentCacheItem);
|
|
@@ -51,16 +51,16 @@ const BookingEditHolderField = ({ state, cacheItem, required, value, onChange, g
|
|
|
51
51
|
setSelectedValues(normalizeHolderFieldValue(value));
|
|
52
52
|
}, [value]);
|
|
53
53
|
const stateHolderRawList = useMemo(() => {
|
|
54
|
-
var _state$pet, _ref, _ref2, _state$pet$formData$, _state$pet2, _state$pet3, _state$
|
|
54
|
+
var _state$pet, _ref, _ref2, _state$pet$formData$, _state$pet2, _state$pet3, _state$bookingConfig2, _state$pet4;
|
|
55
55
|
const holdersFromState = Array.isArray(state === null || state === void 0 || (_state$pet = state.pet) === null || _state$pet === void 0 ? void 0 : _state$pet.holders) ? state.pet.holders : [];
|
|
56
|
-
const formId = (_ref = (_ref2 = (_state$pet$formData$ = state === null || state === void 0 || (_state$pet2 = state.pet) === null || _state$pet2 === void 0 || (_state$pet2 = _state$pet2.formData) === null || _state$pet2 === void 0 || (_state$pet2 = _state$pet2[0]) === null || _state$pet2 === void 0 ? void 0 : _state$pet2.form_id) !== null && _state$pet$formData$ !== void 0 ? _state$pet$formData$ : state === null || state === void 0 || (_state$pet3 = state.pet) === null || _state$pet3 === void 0 || (_state$pet3 = _state$pet3.formData) === null || _state$pet3 === void 0 || (_state$pet3 = _state$pet3[0]) === null || _state$pet3 === void 0 ? void 0 : _state$pet3.id) !== null && _ref2 !== void 0 ? _ref2 : state === null || state === void 0 || (_state$
|
|
56
|
+
const formId = (_ref = (_ref2 = (_state$pet$formData$ = state === null || state === void 0 || (_state$pet2 = state.pet) === null || _state$pet2 === void 0 || (_state$pet2 = _state$pet2.formData) === null || _state$pet2 === void 0 || (_state$pet2 = _state$pet2[0]) === null || _state$pet2 === void 0 ? void 0 : _state$pet2.form_id) !== null && _state$pet$formData$ !== void 0 ? _state$pet$formData$ : state === null || state === void 0 || (_state$pet3 = state.pet) === null || _state$pet3 === void 0 || (_state$pet3 = _state$pet3.formData) === null || _state$pet3 === void 0 || (_state$pet3 = _state$pet3[0]) === null || _state$pet3 === void 0 ? void 0 : _state$pet3.id) !== null && _ref2 !== void 0 ? _ref2 : state === null || state === void 0 || (_state$bookingConfig2 = state.bookingConfig) === null || _state$bookingConfig2 === void 0 || (_state$bookingConfig2 = _state$bookingConfig2.config) === null || _state$bookingConfig2 === void 0 || (_state$bookingConfig2 = _state$bookingConfig2.basic) === null || _state$bookingConfig2 === void 0 || (_state$bookingConfig2 = _state$bookingConfig2.appointment_subject) === null || _state$bookingConfig2 === void 0 ? void 0 : _state$bookingConfig2.form_id) !== null && _ref !== void 0 ? _ref : 0;
|
|
57
57
|
const holdersFromValue = Array.isArray(state === null || state === void 0 || (_state$pet4 = state.pet) === null || _state$pet4 === void 0 || (_state$pet4 = _state$pet4.value) === null || _state$pet4 === void 0 ? void 0 : _state$pet4[formId]) ? state.pet.value[formId] : [];
|
|
58
58
|
return holdersFromState.length > 0 ? holdersFromState : holdersFromValue;
|
|
59
59
|
}, [
|
|
60
60
|
state === null || state === void 0 || (_state$pet5 = state.pet) === null || _state$pet5 === void 0 ? void 0 : _state$pet5.formData,
|
|
61
61
|
state === null || state === void 0 || (_state$pet6 = state.pet) === null || _state$pet6 === void 0 ? void 0 : _state$pet6.holders,
|
|
62
62
|
state === null || state === void 0 || (_state$pet7 = state.pet) === null || _state$pet7 === void 0 ? void 0 : _state$pet7.value,
|
|
63
|
-
state === null || state === void 0 || (_state$
|
|
63
|
+
state === null || state === void 0 || (_state$bookingConfig3 = state.bookingConfig) === null || _state$bookingConfig3 === void 0 ? void 0 : _state$bookingConfig3.config
|
|
64
64
|
]);
|
|
65
65
|
const inlineHolders = useMemo(() => {
|
|
66
66
|
if (Array.isArray(inlinePet.holders)) return inlinePet.holders;
|
|
@@ -50,11 +50,9 @@ const STATUS_OPTIONS = [
|
|
|
50
50
|
/**
|
|
51
51
|
* SalesSdk 版「预约主体未分配」弹窗,UI 与交互对齐 booking ConfirmHolderModal。
|
|
52
52
|
*/
|
|
53
|
-
function SalesSdkConfirmHolderModalContent({ open, lines, liveUnassignedCount,
|
|
54
|
-
var _bookingConfig$config;
|
|
53
|
+
function SalesSdkConfirmHolderModalContent({ open, lines, liveUnassignedCount, canSkip, onAssign, onConfirm, onSkip, onDismissConfirmed, variant }) {
|
|
55
54
|
const isPhoneVariant = variant === "phone";
|
|
56
55
|
const [modal, contextHolder] = Modal.useModal();
|
|
57
|
-
const isSubjectOptional = (bookingConfig === null || bookingConfig === void 0 || (_bookingConfig$config = bookingConfig.config) === null || _bookingConfig$config === void 0 || (_bookingConfig$config = _bookingConfig$config.basic) === null || _bookingConfig$config === void 0 ? void 0 : _bookingConfig$config.subject_require) !== "require";
|
|
58
56
|
const statusOptions = useMemo(() => STATUS_OPTIONS.map((option) => ({
|
|
59
57
|
key: option.key,
|
|
60
58
|
label: locales.getText(option.labelKey),
|
|
@@ -129,7 +127,7 @@ function SalesSdkConfirmHolderModalContent({ open, lines, liveUnassignedCount, b
|
|
|
129
127
|
onPromotion: () => {},
|
|
130
128
|
onGift: () => {}
|
|
131
129
|
});
|
|
132
|
-
})), /* @__PURE__ */ React.createElement("div", { className: "confirm-holder-modal-footer" },
|
|
130
|
+
})), /* @__PURE__ */ React.createElement("div", { className: "confirm-holder-modal-footer" }, canSkip && onSkip ? /* @__PURE__ */ React.createElement(Button, {
|
|
133
131
|
onClick: onSkip,
|
|
134
132
|
className: "skip-button",
|
|
135
133
|
size: "large"
|
|
@@ -304,7 +304,7 @@ function readSnapshot(bookingTicket, getHolderOptionsForSource = () => [], shoul
|
|
|
304
304
|
return EMPTY_SNAPSHOT;
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
|
-
const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingLinesForDisplay = true }) => {
|
|
307
|
+
const SalesSdkCartProvider = ({ children, deferHolderAuthOnClose = false, shouldMergeProductLines, mergeBookingLinesForDisplay = true }) => {
|
|
308
308
|
var _sales$bookingTicket;
|
|
309
309
|
const sales = useContext(SalesSdkContext);
|
|
310
310
|
const productsCtx = useContext(SalesSdkProductContext);
|
|
@@ -315,7 +315,7 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
|
|
|
315
315
|
const refreshSummary = useContext(SalesSdkSummaryRefreshContext);
|
|
316
316
|
const prepareSummary = useContext(SalesSdkSummaryPrepareContext);
|
|
317
317
|
const refreshRoot = useContext(SalesSdkRootRefreshContext);
|
|
318
|
-
const { holderOptions, getHolderOptionsForSource, ensureHolderOptionsForSource, reload: reloadHolderOptions } = useSalesSdkHolderOptional();
|
|
318
|
+
const { holderOptions, getHolderOptionsForSource, ensureHolderOptionsForSource, prepareHolderOptionsForSource, reload: reloadHolderOptions } = useSalesSdkHolderOptional();
|
|
319
319
|
const Toast = useToast();
|
|
320
320
|
const toastRef = useRef(Toast);
|
|
321
321
|
toastRef.current = Toast;
|
|
@@ -935,7 +935,7 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
|
|
|
935
935
|
const runDirectAddFromCacheItem = function() {
|
|
936
936
|
var _ref11 = _asyncToGenerator(function* (rawCacheItem) {
|
|
937
937
|
const cacheItemForEnrich = mergeCatalogDurationIntoCacheItem(applyExplicitAddQuantityToCacheItem(rawCacheItem, addQty), product);
|
|
938
|
-
const shouldPrepareHolderOptions = shouldPromptHolderOnAddCart({
|
|
938
|
+
const shouldPrepareHolderOptions = !(options === null || options === void 0 ? void 0 : options.deferHolderUntilSubmit) && shouldPromptHolderOnAddCart({
|
|
939
939
|
cacheItem: cacheItemForEnrich,
|
|
940
940
|
bookingConfig: flowCtx.bookingConfig,
|
|
941
941
|
productSource: product,
|
|
@@ -949,6 +949,7 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
|
|
|
949
949
|
}, flowCtx), {}, {
|
|
950
950
|
initialHolderIds: options === null || options === void 0 ? void 0 : options.initialHolderIds,
|
|
951
951
|
holderOptions: holderOptionsForProduct,
|
|
952
|
+
deferHolderUntilSubmit: options === null || options === void 0 ? void 0 : options.deferHolderUntilSubmit,
|
|
952
953
|
mode: "direct"
|
|
953
954
|
})) : {
|
|
954
955
|
status: "ok",
|
|
@@ -1027,7 +1028,7 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
|
|
|
1027
1028
|
*/
|
|
1028
1029
|
const confirmDetail = useMemoizedFn(function() {
|
|
1029
1030
|
var _ref15 = _asyncToGenerator(function* (input) {
|
|
1030
|
-
var _flowCtx$date7, _flowCtx$bookingConfi4, _input$options, _input$
|
|
1031
|
+
var _flowCtx$date7, _flowCtx$bookingConfi4, _input$options, _input$options5, _input$options6, _input$options7;
|
|
1031
1032
|
if (!bookingTicket) throw new Error("[SalesSdk] Cart: bookingTicket 未初始化");
|
|
1032
1033
|
if (typeof bookingTicket.transformDetailToProductAndBooking !== "function") throw new Error("[SalesSdk] Cart: bookingTicket.transformDetailToProductAndBooking 不可用");
|
|
1033
1034
|
const confirmQuantity = resolveConfirmDetailQuantity(input);
|
|
@@ -1048,7 +1049,7 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
|
|
|
1048
1049
|
if ((_input$options = input.options) === null || _input$options === void 0 ? void 0 : _input$options.multiDayRange) cacheItem = patchCacheItemDateRange(cacheItem, input.options.multiDayRange);
|
|
1049
1050
|
else cacheItem = applyDefaultMultiDayRangeIfNeeded(cacheItem, catalogItem, flowCtx.date);
|
|
1050
1051
|
if (typeof bookingTicket.decideAfterDetail === "function") {
|
|
1051
|
-
var _flowCtx$date8, _flowCtx$bookingConfi5, _input$options2;
|
|
1052
|
+
var _flowCtx$date8, _flowCtx$bookingConfi5, _input$options2, _input$options3, _input$options4;
|
|
1052
1053
|
const decision = bookingTicket.decideAfterDetail(cacheItem, {
|
|
1053
1054
|
quantity: confirmQuantity,
|
|
1054
1055
|
customerId: flowCtx.customerId,
|
|
@@ -1070,14 +1071,15 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
|
|
|
1070
1071
|
})
|
|
1071
1072
|
};
|
|
1072
1073
|
}
|
|
1073
|
-
const holderOptionsForProduct = yield ensureHolderOptionsForSource(input.item);
|
|
1074
|
+
const holderOptionsForProduct = ((_input$options2 = input.options) === null || _input$options2 === void 0 ? void 0 : _input$options2.deferHolderUntilSubmit) ? getHolderOptionsForSource(input.item) : yield ensureHolderOptionsForSource(input.item);
|
|
1074
1075
|
const enriched = yield enrichCacheItemBeforeAdd(_objectSpread2(_objectSpread2({
|
|
1075
1076
|
cacheItem: decision.cacheItem,
|
|
1076
1077
|
catalogItem: input.item,
|
|
1077
1078
|
uiHosts
|
|
1078
1079
|
}, flowCtx), {}, {
|
|
1079
|
-
initialHolderIds: (_input$
|
|
1080
|
+
initialHolderIds: (_input$options3 = input.options) === null || _input$options3 === void 0 ? void 0 : _input$options3.initialHolderIds,
|
|
1080
1081
|
holderOptions: holderOptionsForProduct,
|
|
1082
|
+
deferHolderUntilSubmit: (_input$options4 = input.options) === null || _input$options4 === void 0 ? void 0 : _input$options4.deferHolderUntilSubmit,
|
|
1081
1083
|
mode: "direct"
|
|
1082
1084
|
}));
|
|
1083
1085
|
if (enriched.status !== "ok") throw new Error("[SalesSdk] confirmDetail: 加车前校验未通过(Holder / 跨日 Host 未配置或用户取消)");
|
|
@@ -1086,14 +1088,15 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
|
|
|
1086
1088
|
products: yield addProductToOrderFromCache(input.item, enriched.cacheItem, { quantity: resolveAddQuantityFromCacheItem(enriched.cacheItem, confirmQuantity) })
|
|
1087
1089
|
};
|
|
1088
1090
|
}
|
|
1089
|
-
const holderOptionsForProduct = yield ensureHolderOptionsForSource(input.item);
|
|
1091
|
+
const holderOptionsForProduct = ((_input$options5 = input.options) === null || _input$options5 === void 0 ? void 0 : _input$options5.deferHolderUntilSubmit) ? getHolderOptionsForSource(input.item) : yield ensureHolderOptionsForSource(input.item);
|
|
1090
1092
|
const enriched = yield enrichCacheItemBeforeAdd(_objectSpread2(_objectSpread2({
|
|
1091
1093
|
cacheItem,
|
|
1092
1094
|
catalogItem: input.item,
|
|
1093
1095
|
uiHosts
|
|
1094
1096
|
}, flowCtx), {}, {
|
|
1095
|
-
initialHolderIds: (_input$
|
|
1097
|
+
initialHolderIds: (_input$options6 = input.options) === null || _input$options6 === void 0 ? void 0 : _input$options6.initialHolderIds,
|
|
1096
1098
|
holderOptions: holderOptionsForProduct,
|
|
1099
|
+
deferHolderUntilSubmit: (_input$options7 = input.options) === null || _input$options7 === void 0 ? void 0 : _input$options7.deferHolderUntilSubmit,
|
|
1097
1100
|
mode: "direct"
|
|
1098
1101
|
}));
|
|
1099
1102
|
if (enriched.status !== "ok") throw new Error("[SalesSdk] confirmDetail: 加车前校验未通过(Holder / 跨日 Host 未配置或用户取消)");
|
|
@@ -1109,9 +1112,9 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
|
|
|
1109
1112
|
/** 资源 / 时间抽屉确认后加车。 */
|
|
1110
1113
|
const confirmBookingEdit = useMemoizedFn(function() {
|
|
1111
1114
|
var _ref16 = _asyncToGenerator(function* (input) {
|
|
1112
|
-
var _input$
|
|
1115
|
+
var _input$options8;
|
|
1113
1116
|
if (!bookingTicket) throw new Error("[SalesSdk] Cart: bookingTicket 未初始化");
|
|
1114
|
-
const products = yield addProductToOrderFromCache(input.cacheItem, input.cacheItem, { quantity: resolveAddQuantityFromCacheItem(input.cacheItem, (_input$
|
|
1117
|
+
const products = yield addProductToOrderFromCache(input.cacheItem, input.cacheItem, { quantity: resolveAddQuantityFromCacheItem(input.cacheItem, (_input$options8 = input.options) === null || _input$options8 === void 0 ? void 0 : _input$options8.quantity) });
|
|
1115
1118
|
reloadHolderOptions();
|
|
1116
1119
|
return { products };
|
|
1117
1120
|
});
|
|
@@ -1125,13 +1128,20 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
|
|
|
1125
1128
|
/** 无防抖的加车编排(规格 / 资源弹窗链)。 */
|
|
1126
1129
|
const runAddProductFlowBase = useMemoizedFn(function() {
|
|
1127
1130
|
var _ref17 = _asyncToGenerator(function* (product, options) {
|
|
1128
|
-
|
|
1131
|
+
let deferHolderUntilSubmit = (options === null || options === void 0 ? void 0 : options.deferHolderUntilSubmit) === true;
|
|
1132
|
+
let holderOptionsForProduct = deferHolderUntilSubmit ? getHolderOptionsForSource(product) : [];
|
|
1133
|
+
if (!deferHolderUntilSubmit) {
|
|
1134
|
+
const preparedHolderOptions = yield prepareHolderOptionsForSource(product, { allowBoundCustomerAccess: deferHolderAuthOnClose });
|
|
1135
|
+
holderOptionsForProduct = preparedHolderOptions.options;
|
|
1136
|
+
if (deferHolderAuthOnClose && preparedHolderOptions.loginClosed) deferHolderUntilSubmit = true;
|
|
1137
|
+
}
|
|
1129
1138
|
return runAddProductFlow({
|
|
1130
1139
|
addProduct,
|
|
1131
1140
|
confirmDetail,
|
|
1132
1141
|
confirmBookingEdit
|
|
1133
1142
|
}, uiHosts, product, _objectSpread2(_objectSpread2(_objectSpread2({}, options), getAddFlowContext()), {}, {
|
|
1134
1143
|
holderOptions: holderOptionsForProduct,
|
|
1144
|
+
deferHolderUntilSubmit,
|
|
1135
1145
|
onBookingSelectionCommitted: syncCommittedBookingSelection
|
|
1136
1146
|
}));
|
|
1137
1147
|
});
|
|
@@ -1242,24 +1252,21 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
|
|
|
1242
1252
|
*/
|
|
1243
1253
|
const addProductWithFlow = useMemoizedFn(function() {
|
|
1244
1254
|
var _ref20 = _asyncToGenerator(function* (product, options) {
|
|
1245
|
-
var _ticket$
|
|
1255
|
+
var _ticket$getTempOrder, _ticket$getTempOrder2, _ticket$getOrderCusto, _ticket$getOrderCusto2, _liveTempOrder$custom, _liveTempOrder$_exten, _liveTempOrder$_exten2, _flowCtx$tempOrder, _flowCtx$tempOrder2, _flowCtx$tempOrder3, _flowCtx$tempOrder4, _uiHostsRef$current2, _ticket$setOrderCusto;
|
|
1246
1256
|
if (!bookingTicketRef.current) throw new Error("[SalesSdk] Cart: bookingTicket 未初始化");
|
|
1247
1257
|
const ticket = bookingTicketRef.current;
|
|
1248
1258
|
const flowCtx = getAddFlowContextRef.current();
|
|
1249
|
-
const otherParams = yield Promise.resolve(((_ticket$getOtherParam = ticket.getOtherParams) === null || _ticket$getOtherParam === void 0 ? void 0 : _ticket$getOtherParam.call(ticket)) || {});
|
|
1250
1259
|
const liveTempOrder = (_ticket$getTempOrder = (_ticket$getTempOrder2 = ticket.getTempOrder) === null || _ticket$getTempOrder2 === void 0 ? void 0 : _ticket$getTempOrder2.call(ticket)) !== null && _ticket$getTempOrder !== void 0 ? _ticket$getTempOrder : null;
|
|
1251
1260
|
const orderCustomerSnapshot = (_ticket$getOrderCusto = (_ticket$getOrderCusto2 = ticket.getOrderCustomerSnapshot) === null || _ticket$getOrderCusto2 === void 0 ? void 0 : _ticket$getOrderCusto2.call(ticket)) !== null && _ticket$getOrderCusto !== void 0 ? _ticket$getOrderCusto : null;
|
|
1252
|
-
const
|
|
1253
|
-
if (!(yield ensureCustomerAuthBeforeAdd({
|
|
1261
|
+
const flowOptions = (yield ensureCustomerAuthBeforeAdd({
|
|
1254
1262
|
product,
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
currentCustomerId,
|
|
1263
|
+
enabled: deferHolderAuthOnClose,
|
|
1264
|
+
currentCustomerId: resolveCustomerAuthCurrentCustomerId(liveTempOrder === null || liveTempOrder === void 0 ? void 0 : liveTempOrder.customer_id, liveTempOrder === null || liveTempOrder === void 0 || (_liveTempOrder$custom = liveTempOrder.customer) === null || _liveTempOrder$custom === void 0 ? void 0 : _liveTempOrder$custom.id, liveTempOrder === null || liveTempOrder === void 0 || (_liveTempOrder$_exten = liveTempOrder._extend) === null || _liveTempOrder$_exten === void 0 || (_liveTempOrder$_exten = _liveTempOrder$_exten.customerSnapshot) === null || _liveTempOrder$_exten === void 0 ? void 0 : _liveTempOrder$_exten.customer_id, liveTempOrder === null || liveTempOrder === void 0 || (_liveTempOrder$_exten2 = liveTempOrder._extend) === null || _liveTempOrder$_exten2 === void 0 || (_liveTempOrder$_exten2 = _liveTempOrder$_exten2.customerSnapshot) === null || _liveTempOrder$_exten2 === void 0 ? void 0 : _liveTempOrder$_exten2.id, orderCustomerSnapshot === null || orderCustomerSnapshot === void 0 ? void 0 : orderCustomerSnapshot.customer_id, orderCustomerSnapshot === null || orderCustomerSnapshot === void 0 ? void 0 : orderCustomerSnapshot.id, flowCtx.customerId, (_flowCtx$tempOrder = flowCtx.tempOrder) === null || _flowCtx$tempOrder === void 0 ? void 0 : _flowCtx$tempOrder.customer_id, (_flowCtx$tempOrder2 = flowCtx.tempOrder) === null || _flowCtx$tempOrder2 === void 0 || (_flowCtx$tempOrder2 = _flowCtx$tempOrder2.customer) === null || _flowCtx$tempOrder2 === void 0 ? void 0 : _flowCtx$tempOrder2.id, (_flowCtx$tempOrder3 = flowCtx.tempOrder) === null || _flowCtx$tempOrder3 === void 0 || (_flowCtx$tempOrder3 = _flowCtx$tempOrder3._extend) === null || _flowCtx$tempOrder3 === void 0 || (_flowCtx$tempOrder3 = _flowCtx$tempOrder3.customerSnapshot) === null || _flowCtx$tempOrder3 === void 0 ? void 0 : _flowCtx$tempOrder3.customer_id, (_flowCtx$tempOrder4 = flowCtx.tempOrder) === null || _flowCtx$tempOrder4 === void 0 || (_flowCtx$tempOrder4 = _flowCtx$tempOrder4._extend) === null || _flowCtx$tempOrder4 === void 0 || (_flowCtx$tempOrder4 = _flowCtx$tempOrder4.customerSnapshot) === null || _flowCtx$tempOrder4 === void 0 ? void 0 : _flowCtx$tempOrder4.id),
|
|
1258
1265
|
openCustomerAuth: (_uiHostsRef$current2 = uiHostsRef.current) === null || _uiHostsRef$current2 === void 0 ? void 0 : _uiHostsRef$current2.openCustomerAuth,
|
|
1259
1266
|
setOrderCustomer: (_ticket$setOrderCusto = ticket.setOrderCustomer) === null || _ticket$setOrderCusto === void 0 ? void 0 : _ticket$setOrderCusto.bind(ticket)
|
|
1260
|
-
})))
|
|
1267
|
+
})).status === "deferred" ? _objectSpread2(_objectSpread2({}, options), {}, { deferHolderUntilSubmit: true }) : options;
|
|
1261
1268
|
const productLineMergeEnabled = resolveProductLineMergeEnabled(shouldMergeProductLines);
|
|
1262
|
-
return debouncedAddRef.current.addProductWithFlow(product, productLineMergeEnabled ?
|
|
1269
|
+
return debouncedAddRef.current.addProductWithFlow(product, productLineMergeEnabled ? flowOptions : _objectSpread2(_objectSpread2({}, flowOptions), {}, { debounceMs: 0 }));
|
|
1263
1270
|
});
|
|
1264
1271
|
return function(_x20, _x21) {
|
|
1265
1272
|
return _ref20.apply(this, arguments);
|