@pisell/private-materials 6.11.670 → 6.11.673
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.js +1 -1
- package/build/lowcode/render/default/view.js +3 -3
- package/build/lowcode/view.js +3 -3
- package/es/components/HDLKiosk/slices/payment/Screen/index.js +5 -3
- package/es/components/bigSale/components/BookingFloatingPanel/useBookingPanelController.js +1 -0
- package/es/components/bigSale/components/TimeBar/index.js +1 -0
- package/es/components/bigSale/dialog.js +1 -0
- package/es/components/bigSale/hooks/useBigSaleContext.js +1 -0
- package/es/components/bigSale/hooks/useSelectFloorMapResourceForBigSale.js +1 -0
- package/es/components/bigSale/index.js +1 -0
- package/es/components/bigSale/templates/Kiosk/index.js +1 -0
- package/es/components/sharedSecondaryBigSale/SharedSecondaryBigSaleReceiver.js +1 -0
- package/es/index.js +2 -0
- package/es/plus/multiCurrencySettlement/index.js +1 -1
- package/es/plus/noteModal/index.js +9 -0
- 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/index.js +17 -0
- package/es/plus/saasDevice/devicePasscodes/model.js +4 -4
- package/es/plus/saleDetail/Base.js +1 -0
- package/es/plus/saleDetail/components/Client/hooks/useClientSelectorProps.js +1 -0
- package/es/plus/saleDetail/components/DetailActions/index.js +1 -0
- package/es/plus/saleDetail/components/SummaryFinancialSections/index.js +1 -0
- package/es/plus/saleDetail/index.js +1 -0
- package/es/plus/saleDetail/tmpl/B/components/Dish/index.js +1 -0
- package/es/plus/saleDetail/tmpl/B/index.js +1 -0
- package/es/plus/salesSdk/index.js +53 -0
- 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 +1 -1
- package/es/plus/salesSdk/utils/enrichCartLineHolderDisplay.js +1 -1
- package/es/plus/walletPassGallery/components/timelineSection/index.js +4 -4
- 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/es/pro/skuDetailModal/flow/modules/time/index.js +28 -10
- package/es/pro/skuDetailModal/flow/modules/time/posCustomTime.js +16 -1
- package/lib/components/HDLKiosk/slices/payment/Screen/index.js +4 -2
- package/lib/plus/noteModal/index.js +9 -0
- package/lib/pro/skuDetailModal/flow/modules/time/index.js +27 -9
- package/lib/pro/skuDetailModal/flow/modules/time/posCustomTime.js +16 -0
- package/package.json +4 -4
- package/es/private-materials/lowcode/authmodal/meta.d.ts +0 -1
|
@@ -3,7 +3,7 @@ import PaymentResultToastV2_default from "../../../../checkout/components/Paymen
|
|
|
3
3
|
import { useHDLKioskBottomBar, useHDLKioskBottomBarController } from "../../../components/shell/HDLKioskBottomBarHost/index.js";
|
|
4
4
|
import { HDLKioskOrderSummary } from "../../../components/shell/HDLKioskOrderSummary/index.js";
|
|
5
5
|
import { RestartOrderDialog } from "../../../components/overlays/RestartOrderDialog/index.js";
|
|
6
|
-
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
6
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
7
7
|
import { locales } from "@pisell/utils";
|
|
8
8
|
import { Iconfont } from "@pisell/materials";
|
|
9
9
|
function BackIcon() {
|
|
@@ -47,6 +47,8 @@ function PaymentMethodIcon({ code, type }) {
|
|
|
47
47
|
}
|
|
48
48
|
function CheckoutScreen({ model, orderBar, send }) {
|
|
49
49
|
var _model$paymentFeedbac;
|
|
50
|
+
const sendRef = useRef(send);
|
|
51
|
+
sendRef.current = send;
|
|
50
52
|
const goBack = useCallback(() => send({
|
|
51
53
|
kind: "navigation",
|
|
52
54
|
direction: "back"
|
|
@@ -57,11 +59,11 @@ function CheckoutScreen({ model, orderBar, send }) {
|
|
|
57
59
|
const [restartOrderOpen, setRestartOrderOpen] = useState(false);
|
|
58
60
|
const [dismissedFeedbackKey, setDismissedFeedbackKey] = useState();
|
|
59
61
|
const [returnCountdown, setReturnCountdown] = useState(10);
|
|
60
|
-
const resetOrder = useCallback((source) =>
|
|
62
|
+
const resetOrder = useCallback((source) => sendRef.current({
|
|
61
63
|
kind: "session",
|
|
62
64
|
action: "reset",
|
|
63
65
|
source
|
|
64
|
-
}), [
|
|
66
|
+
}), []);
|
|
65
67
|
const bottomBar = useMemo(() => {
|
|
66
68
|
var _orderBar$cartItemCou;
|
|
67
69
|
return {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import useEngineContext from "../../../../hooks/useEngineContext.js";
|
|
2
2
|
import { subscribeBookingDateChange } from "../../../../plus/salesSdk/utils/bookingDate.js";
|
|
3
|
+
import "../../../../plus/salesSdk/index.js";
|
|
3
4
|
import dayjs from "dayjs";
|
|
4
5
|
import { useCallback, useEffect, useState } from "react";
|
|
5
6
|
//#region src/components/bigSale/components/BookingFloatingPanel/useBookingPanelController.ts
|
|
@@ -4,6 +4,7 @@ import withResponsive from "../../../../responsive/withResponsive.js";
|
|
|
4
4
|
import useInitLocalesOnce from "../../../../hooks/useInitLocalesOnce.js";
|
|
5
5
|
import { subscribeBookingDateChange } from "../../../../plus/salesSdk/utils/bookingDate.js";
|
|
6
6
|
import { useSalesSdkBookingContext } from "../../../../plus/salesSdk/context/SalesSdkBookingContext.js";
|
|
7
|
+
import "../../../../plus/salesSdk/index.js";
|
|
7
8
|
import locales_default from "../../locales/index.js";
|
|
8
9
|
import dayjs from "dayjs";
|
|
9
10
|
import React, { forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
@@ -5,6 +5,7 @@ import { buildInitBookingContextParams, collectBookingIdsFromTempOrder } from ".
|
|
|
5
5
|
import { useSalesSdk } from "../../plus/salesSdk/hooks/useSalesSdk.js";
|
|
6
6
|
import { useSalesSdkCart } from "../../plus/salesSdk/hooks/useSalesSdkCart.js";
|
|
7
7
|
import { SalesSdkPrepareOrderSwitchContext, SalesSdkRootRefreshContext } from "../../plus/salesSdk/context/SalesSdkProvider.js";
|
|
8
|
+
import "../../plus/salesSdk/index.js";
|
|
8
9
|
import { seedDineInReservationToCart } from "../../plus/pisellReservation/utils/seedDineInReservationToCart.js";
|
|
9
10
|
import { isPersistedBigSaleOrderId } from "./utils/orderIdentity.js";
|
|
10
11
|
import BigSale from "./index.js";
|
|
@@ -4,6 +4,7 @@ import { useSalesSdkCustomer } from "../../../plus/salesSdk/hooks/useSalesSdkCus
|
|
|
4
4
|
import { useSalesSdkBookingContext } from "../../../plus/salesSdk/context/SalesSdkBookingContext.js";
|
|
5
5
|
import { useSalesSdkSummary } from "../../../plus/salesSdk/hooks/useSalesSdkSummary.js";
|
|
6
6
|
import { useSalesSdkProducts } from "../../../plus/salesSdk/hooks/useSalesSdkProducts.js";
|
|
7
|
+
import "../../../plus/salesSdk/index.js";
|
|
7
8
|
import { useMemo } from "react";
|
|
8
9
|
//#region src/components/bigSale/hooks/useBigSaleContext.ts
|
|
9
10
|
/**
|
|
@@ -3,6 +3,7 @@ import useEngineContext from "../../../hooks/useEngineContext.js";
|
|
|
3
3
|
import { buildInitBookingContextParams, collectBookingIdsFromTempOrder } from "../../../plus/salesSdk/utils/buildDefaultLoadProductsParams.js";
|
|
4
4
|
import { useSalesSdkUIHosts } from "../../../plus/salesSdk/context/SalesSdkUIHostsContext.js";
|
|
5
5
|
import { SalesSdkRootRefreshContext } from "../../../plus/salesSdk/context/SalesSdkProvider.js";
|
|
6
|
+
import "../../../plus/salesSdk/index.js";
|
|
6
7
|
import { resolveOrderIdForHostActions } from "../../../plus/pisellReservation/components/bookingDetailModal/bookingDetailHostActions.js";
|
|
7
8
|
import { usePicoCodingOpenData } from "../../../plus/pisellReservation/hooks/usePicoCodingOpenData.js";
|
|
8
9
|
import { buildReplacementBookingResourcesFromReservationRow } from "../../../plus/pisellReservation/utils/reservationTicketBookingHostParams.js";
|
|
@@ -8,6 +8,7 @@ import { useSalesSdk } from "../../plus/salesSdk/hooks/useSalesSdk.js";
|
|
|
8
8
|
import { useSalesSdkCustomer } from "../../plus/salesSdk/hooks/useSalesSdkCustomer.js";
|
|
9
9
|
import { SalesSdkProvider } from "../../plus/salesSdk/context/SalesSdkProvider.js";
|
|
10
10
|
import { SalesSdkBookingContextProvider } from "../../plus/salesSdk/context/SalesSdkBookingContext.js";
|
|
11
|
+
import "../../plus/salesSdk/index.js";
|
|
11
12
|
import { ResponsiveBigSaleBase } from "./Base.js";
|
|
12
13
|
import { isBigSaleProductSelectionFlowScene, resolveBigSaleSelectionFlowConfig } from "./selectionFlowConfig.js";
|
|
13
14
|
import { isKioskPresentation } from "./templateCapabilities.js";
|
|
@@ -9,6 +9,7 @@ import { resolvePaymentResultToastV2ViewModel } from "../../../checkout/componen
|
|
|
9
9
|
import PaymentResultToastV2_default from "../../../checkout/components/PaymentResultToastV2/index.js";
|
|
10
10
|
import { freePayApi } from "../../../Sales/Checkout/serve.js";
|
|
11
11
|
import { useSalesSdk } from "../../../../plus/salesSdk/hooks/useSalesSdk.js";
|
|
12
|
+
import "../../../../plus/salesSdk/index.js";
|
|
12
13
|
import { usePickSaleDetailContext } from "../../hooks/usePickSaleDetailContext.js";
|
|
13
14
|
import { resolveBigSaleAutoProductListPreferences } from "../../utils/productListPreferences.js";
|
|
14
15
|
import { resolveBigSaleProductDisplayConfig } from "../../hooks/useBigSaleProductListConfig.js";
|
|
@@ -2,6 +2,7 @@ import { _asyncToGenerator } from "../../_virtual/_@oxc-project_runtime@0.122.0/
|
|
|
2
2
|
import useEngineContext from "../../hooks/useEngineContext.js";
|
|
3
3
|
import { useSalesSdk } from "../../plus/salesSdk/hooks/useSalesSdk.js";
|
|
4
4
|
import { getTempOrderSyncPayload, shouldApplySharedTempOrderPayload } from "../../plus/salesSdk/tempOrderSync.js";
|
|
5
|
+
import "../../plus/salesSdk/index.js";
|
|
5
6
|
import { useEffect, useRef } from "react";
|
|
6
7
|
import { useMemoizedFn } from "ahooks";
|
|
7
8
|
//#region src/components/sharedSecondaryBigSale/SharedSecondaryBigSaleReceiver.tsx
|
package/es/index.js
CHANGED
|
@@ -86,6 +86,7 @@ import { useSalesSdkProducts } from "./plus/salesSdk/hooks/useSalesSdkProducts.j
|
|
|
86
86
|
import SalesSdkDemo from "./plus/salesSdk/demo/index.js";
|
|
87
87
|
import { useSalesSdkDish } from "./plus/salesSdk/hooks/useSalesSdkDish.js";
|
|
88
88
|
import { useSyncOsModule } from "./plus/salesSdk/hooks/useSyncOsModule.js";
|
|
89
|
+
import "./plus/salesSdk/index.js";
|
|
89
90
|
import BigSaleRightActionPanel from "./components/BigSaleRightActionPanel/index.js";
|
|
90
91
|
import ResponsiveWrapper from "./components/list/ResponsiveWrapper.js";
|
|
91
92
|
import { resolveBigSaleSelectionFlowConfig } from "./components/bigSale/selectionFlowConfig.js";
|
|
@@ -139,6 +140,7 @@ import PisellVenueControlPage from "./plus/pisellReservation/PisellVenueControlP
|
|
|
139
140
|
import PisellVenueWallPage from "./plus/pisellReservation/PisellVenueWallPage.js";
|
|
140
141
|
import PisellReservationTablePage from "./plus/pisellReservation/PisellReservationTablePage.js";
|
|
141
142
|
import SelectFloorMapResourceDialog from "./plus/pisellReservation/components/SelectFloorMapResourceDialog.js";
|
|
143
|
+
import "./plus/pisellReservation/index.js";
|
|
142
144
|
import { PisellTopology, PisellTopologyCore } from "./plus/pisellTopology/PisellTopology.js";
|
|
143
145
|
import cupProject_default from "./components/ecocup/cupProject/index.js";
|
|
144
146
|
import CupList from "./components/ecocup/cupList/index.js";
|
|
@@ -280,4 +280,4 @@ function attachSelectedSettlement(item, selectedSettlement) {
|
|
|
280
280
|
});
|
|
281
281
|
}
|
|
282
282
|
//#endregion
|
|
283
|
-
export { attachSelectedSettlement, buildSettlementPriceRows, createVirtualOnlySkuDisplayProduct, formatSettlementAmount, formatSettlementSelectionTotal, formatTempOrderSettlementAmount, getSettlementKey, getSettlementOptions, hasSettlementOptions, hasSufficientVirtualCurrencyBalance, isVirtualOnlySettlementProduct, isVirtualSettlementTempOrder, resolveConfiguredUnavailableReason, resolveLegalSettlementAddOnUnitPrice, resolveSettlementOptionEntries, resolveVirtualSettlementErrorMessage, showVirtualSettlementErrorToast };
|
|
283
|
+
export { attachSelectedSettlement, buildSettlementPriceRows, createVirtualOnlySkuDisplayProduct, findFirstVirtualCurrencyAsset, formatSettlementAmount, formatSettlementSelectionTotal, formatTempOrderSettlementAmount, getReservedVirtualSettlementAmount, getSettlementKey, getSettlementOptions, hasSettlementOptions, hasSufficientVirtualCurrencyBalance, isVirtualOnlySettlementProduct, isVirtualSettlementTempOrder, resolveConfiguredUnavailableReason, resolveLegalSettlementAddOnUnitPrice, resolveSettlementOptionEntries, resolveVirtualSettlementErrorMessage, showVirtualSettlementErrorToast };
|
|
@@ -40,6 +40,14 @@ function normalizeMultilingualNoteValue(value, maxLength) {
|
|
|
40
40
|
function hasMultilingualNoteValue(value) {
|
|
41
41
|
return Object.values(value).some((text) => text.trim());
|
|
42
42
|
}
|
|
43
|
+
function dismissVirtualKeyboard() {
|
|
44
|
+
if (typeof document === "undefined") return;
|
|
45
|
+
try {
|
|
46
|
+
var _activeElement$blur;
|
|
47
|
+
const activeElement = document.activeElement;
|
|
48
|
+
activeElement === null || activeElement === void 0 || (_activeElement$blur = activeElement.blur) === null || _activeElement$blur === void 0 || _activeElement$blur.call(activeElement);
|
|
49
|
+
} catch (_unused) {}
|
|
50
|
+
}
|
|
43
51
|
const NoteModalContent = ({ open = false, title = "", value = "", maxLength = DEFAULT_NOTE_MAX_LENGTH, onConfirm, onDelete, onCancel, zIndex, variant, modalClassName, multilingual = false }) => {
|
|
44
52
|
var _context$engine;
|
|
45
53
|
const context = useEngineContext();
|
|
@@ -87,6 +95,7 @@ const NoteModalContent = ({ open = false, title = "", value = "", maxLength = DE
|
|
|
87
95
|
saveTemplates(templates.filter((_, templateIndex) => templateIndex !== index));
|
|
88
96
|
};
|
|
89
97
|
const handleConfirm = () => {
|
|
98
|
+
dismissVirtualKeyboard();
|
|
90
99
|
if (multilingual) {
|
|
91
100
|
onConfirm === null || onConfirm === void 0 || onConfirm(normalizeMultilingualNoteValue(multilingualNoteValue, resolvedMaxLength));
|
|
92
101
|
return;
|
|
@@ -259,4 +259,4 @@ function bookingListToReservationTableRows(bookings) {
|
|
|
259
259
|
return rows;
|
|
260
260
|
}
|
|
261
261
|
//#endregion
|
|
262
|
-
export { applyHostResourceShellToBaseRow, bookingListToReservationTableRows, customerBrief, extractResourceRecordIds, filterBookingsByResourceIds, hostBookingUiPatchFromRecord, mergeBookingsForResourceRecord };
|
|
262
|
+
export { applyHostResourceShellToBaseRow, bookingListToReservationTableRows, customerBrief, extractResourceRecordIds, filterBookingsByResourceIds, hostBookingStatusToCardStatus, 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, ensureShopFloorPlanByCode, saveViewConfigToShopFloorPlan, shopLayoutToSceneElements$1 as shopLayoutToSceneElements, toastFloorPlanLoadError, toastFloorPlanSaveError, unsubscribeShopFloorPlanCodeQuery };
|
|
81
|
+
export { PISELL_RESERVATION_FLOOR_PLAN_CODE, buildDefaultReservationFloorPlanPostBody, ensureShopFloorPlanByCode, putShopFloorPlan, 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, defaultReservationTableRows, getDefaultReservationFloorMapConfig, getReservationDataSourceFormColumns, getReservationFloorMapShellConfig, mergeFloorMapElementKindCategoriesWithDefaults, mergeFloorMapElementKindsWithDefaults };
|
|
930
|
+
export { RESERVATION_BOUND_ROUND_TABLE_ELEMENT_KIND, RESERVATION_BOUND_TABLE_ELEMENT_KIND, applyReservationFloorMapLiveLabels, defaultReservationSceneElements, defaultReservationTableRows, getDefaultReservationFloorMapConfig, getReservationDataSourceFormColumns, getReservationFloorMapShellConfig, mergeFloorMapElementKindCategoriesWithDefaults, mergeFloorMapElementKindsWithDefaults };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "./serve/formResourcePage.js";
|
|
2
|
+
import "./floorRoomCard/mapRowToFloorRoomCardData.js";
|
|
3
|
+
import "./floorRoomCard/ReservationFloorRoomCard.js";
|
|
4
|
+
import "./floorMap/reservationMock.js";
|
|
5
|
+
import "./floorMap/floorPlanApi.js";
|
|
6
|
+
import "./reservationConstants.js";
|
|
7
|
+
import "./data/bookingToReservationTables.js";
|
|
8
|
+
import "./data/formResourceToReservationTables.js";
|
|
9
|
+
import "./data/salesEmbeddedResourceToTableRows.js";
|
|
10
|
+
import "./floorMap/reservationCards.js";
|
|
11
|
+
import "./PisellReservation.js";
|
|
12
|
+
import "./PisellReservationBookingPage.js";
|
|
13
|
+
import "./PisellVenueControlPage.js";
|
|
14
|
+
import "./PisellVenueWallPage.js";
|
|
15
|
+
import "./PisellReservationTablePage.js";
|
|
16
|
+
import "./components/SelectFloorMapResourceDialog.js";
|
|
17
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
2
2
|
import dayjs from "dayjs";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import timezone from "dayjs/plugin/timezone";
|
|
4
|
+
import utc from "dayjs/plugin/utc";
|
|
5
5
|
//#region src/plus/saasDevice/devicePasscodes/model.ts
|
|
6
|
-
dayjs.extend(
|
|
7
|
-
dayjs.extend(
|
|
6
|
+
dayjs.extend(utc);
|
|
7
|
+
dayjs.extend(timezone);
|
|
8
8
|
const INITIAL_DEVICE_PASSCODE_STATE = {
|
|
9
9
|
deviceIds: [],
|
|
10
10
|
devicesById: {}
|
|
@@ -11,6 +11,7 @@ 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";
|
|
14
15
|
import locales_default from "./locales.js";
|
|
15
16
|
import locales_default$1 from "./components/LineItem/locales.js";
|
|
16
17
|
import { SaleOrderActionBoundary } from "./actions/index.js";
|
|
@@ -1,6 +1,7 @@
|
|
|
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";
|
|
4
5
|
import { useMemo } from "react";
|
|
5
6
|
import { useMemoizedFn } from "ahooks";
|
|
6
7
|
//#region src/plus/saleDetail/components/Client/hooks/useClientSelectorProps.ts
|
|
@@ -10,6 +10,7 @@ import { useSalesSdk } from "../../../salesSdk/hooks/useSalesSdk.js";
|
|
|
10
10
|
import { useSalesSdkCart } from "../../../salesSdk/hooks/useSalesSdkCart.js";
|
|
11
11
|
import { useSalesSdkGlobalScanActivity } from "../../../salesSdk/context/SalesSdkGlobalScanActivityContext.js";
|
|
12
12
|
import { useSalesSdkSummary } from "../../../salesSdk/hooks/useSalesSdkSummary.js";
|
|
13
|
+
import "../../../salesSdk/index.js";
|
|
13
14
|
import { resolveSaleDetailTempOrder } from "../../utils.js";
|
|
14
15
|
import { getNumericAmount, getSalesHostModule, resolveSaleDetailOrderIdFromSales, resolveSaleDetailOrderIdFromSalesResult, shouldCloseDialogAfterCheckout, updateLocalOrder } from "./utils.js";
|
|
15
16
|
import { getRemotePrintActions, getWristbandList } from "../../serve.js";
|
|
@@ -5,6 +5,7 @@ import { isAppliedPaymentRecord } from "../../../salesSdk/utils/paymentStatus.js
|
|
|
5
5
|
import { useSalesSdk } from "../../../salesSdk/hooks/useSalesSdk.js";
|
|
6
6
|
import { useSalesSdkCart } from "../../../salesSdk/hooks/useSalesSdkCart.js";
|
|
7
7
|
import { useSalesSdkSummary } from "../../../salesSdk/hooks/useSalesSdkSummary.js";
|
|
8
|
+
import "../../../salesSdk/index.js";
|
|
8
9
|
import { resolveSaleDetailTempOrder } from "../../utils.js";
|
|
9
10
|
import React, { memo, useMemo } from "react";
|
|
10
11
|
import { formatAmount, locales } from "@pisell/utils";
|
|
@@ -4,6 +4,7 @@ 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";
|
|
7
8
|
import Base_default from "./Base.js";
|
|
8
9
|
import React, { forwardRef, useImperativeHandle } from "react";
|
|
9
10
|
//#region src/plus/saleDetail/index.tsx
|
|
@@ -1,6 +1,7 @@
|
|
|
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";
|
|
4
5
|
import { SaleDetailStatusOverview } from "../shared/StatusOverview.js";
|
|
5
6
|
import { DishGroupView } from "./DishGroupView.js";
|
|
6
7
|
import dayjs from "dayjs";
|
|
@@ -1,6 +1,7 @@
|
|
|
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";
|
|
4
5
|
import { getInternalNotesByScheduleEvent } from "../../serve.js";
|
|
5
6
|
import { TEMPLATE_B_PAY_ACTIONS, TEMPLATE_B_SUMMARY_ACTIONS } from "../../components/DetailActions/configs/index.js";
|
|
6
7
|
import { DetailActions } from "../../components/DetailActions/index.js";
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import "./hosts/createInstanceHostBridge.js";
|
|
2
|
+
import "./holderConfirm/createHolderConfirmBridge.js";
|
|
3
|
+
import "./giftSelect/createGiftSelectBridge.js";
|
|
4
|
+
import "./context/SalesSdkHostBridgesContext.js";
|
|
5
|
+
import "./utils/formatHolderOptions.js";
|
|
6
|
+
import "./utils/enrichCartLineHolderDisplay.js";
|
|
7
|
+
import "./context/SalesSdkHolderContext.js";
|
|
8
|
+
import "../multiCurrencySettlement/index.js";
|
|
9
|
+
import "./utils/appendPromotionTags.js";
|
|
10
|
+
import "./context/SalesSdkUIHostsContext.js";
|
|
11
|
+
import "./utils/runAddProductFlow.js";
|
|
12
|
+
import "./components/showAddToCartToast.js";
|
|
13
|
+
import "./utils/resolveAddProductDebounceKey.js";
|
|
14
|
+
import "./utils/productSkuOptions.js";
|
|
15
|
+
import "./utils/identity.js";
|
|
16
|
+
import "./utils/resolveInCartQuantityForAddToast.js";
|
|
17
|
+
import "./utils/addProductWithFlowDebounced.js";
|
|
18
|
+
import "./utils/customerAuthGate.js";
|
|
19
|
+
import "./utils/bookingDate.js";
|
|
20
|
+
import "./utils/holderSubmitValidation.js";
|
|
21
|
+
import "./utils/removeOrderProducts.js";
|
|
22
|
+
import "./selectors.js";
|
|
23
|
+
import "./utils/enrich.js";
|
|
24
|
+
import "./giftSelect/createOpenGiftSelectHost.js";
|
|
25
|
+
import "./utils/ensureHoldersBeforeSubmit.js";
|
|
26
|
+
import "./hooks/useSalesSdk.js";
|
|
27
|
+
import "./bookingEditService/BookingEditServiceDrawer.js";
|
|
28
|
+
import "./hosts/BookingEditHostRenderer.js";
|
|
29
|
+
import "./hosts/CustomerAuthHostRenderer.js";
|
|
30
|
+
import "./hooks/useSalesSdkCart.js";
|
|
31
|
+
import "./hooks/useSalesSdkCustomer.js";
|
|
32
|
+
import "./normalProductDetail/NormalProductDetailHostRenderer.js";
|
|
33
|
+
import "./hosts/createOpenBookingEditHost.js";
|
|
34
|
+
import "./hosts/createOpenMultiDaySelectHost.js";
|
|
35
|
+
import "./hosts/createOpenHolderSelectHost.js";
|
|
36
|
+
import "./hosts/createOpenCustomerAuthHost.js";
|
|
37
|
+
import "./demo/hosts/legacyOpenProductDetail.js";
|
|
38
|
+
import "./hosts/createCompositeOpenProductDetailHost.js";
|
|
39
|
+
import "./normalProductDetail/createOpenNormalProductDetailHost.js";
|
|
40
|
+
import "./normalProductDetail/createOpenBookingSelectionFlowHost.js";
|
|
41
|
+
import "./giftSelect/GiftSelectModal.js";
|
|
42
|
+
import "./giftSelect/GiftSelectHostRenderer.js";
|
|
43
|
+
import "./allergy/AllergySelectionModal.js";
|
|
44
|
+
import "./context/SalesSdkProvider.js";
|
|
45
|
+
import "./context/SalesSdkDishContext.js";
|
|
46
|
+
import "./context/SalesSdkBookingContext.js";
|
|
47
|
+
import "./hooks/useSalesSdkSummary.js";
|
|
48
|
+
import "./hooks/useSalesSdkProducts.js";
|
|
49
|
+
import "./demo/index.js";
|
|
50
|
+
import "./hooks/useSalesSdkDish.js";
|
|
51
|
+
import "./hooks/useCurrentSalesSdkDish.js";
|
|
52
|
+
import "./hooks/useSyncOsModule.js";
|
|
53
|
+
export {};
|
|
@@ -31,4 +31,4 @@ function subscribeBookingDateChange(bookingTicket, callback) {
|
|
|
31
31
|
return typeof off === "function" ? off : () => {};
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|
|
34
|
-
export { formatBookingDateTime, subscribeBookingDateChange };
|
|
34
|
+
export { BOOKING_CONTEXT_DATE_EVENT, formatBookingDateTime, subscribeBookingDateChange };
|
|
@@ -59,4 +59,4 @@ function normalizeCustomerAuthCustomer(value) {
|
|
|
59
59
|
return null;
|
|
60
60
|
}
|
|
61
61
|
//#endregion
|
|
62
|
-
export { isValidOrderCustomerId, normalizeCustomerAuthCustomer, resolveCustomerAuthCurrentCustomerId, shouldPromptCustomerAuthForProduct };
|
|
62
|
+
export { isHolderRequiredProduct, isValidOrderCustomerId, normalizeCustomerAuthCustomer, resolveCustomerAuthCurrentCustomerId, shouldPromptCustomerAuthForProduct };
|
|
@@ -71,4 +71,4 @@ function buildHolderListRequestKey(params) {
|
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
//#endregion
|
|
74
|
-
export { buildHolderListRequestKey, buildHolderListRequestParams, enrichCartBookingHolderDisplay, resolveHolderDisplayConfig };
|
|
74
|
+
export { buildHolderListRequestKey, buildHolderListRequestParams, enrichCartBookingHolderDisplay, pickHolderIdFromBooking, resolveHolderDisplayConfig };
|
|
@@ -5,12 +5,12 @@ import React, { useCallback, useEffect, useMemo, useRef } from "react";
|
|
|
5
5
|
import { locales } from "@pisell/utils";
|
|
6
6
|
import { Button, PisellEmpty, PisellModal, PisellStatisticList, Skeleton, Timeline, usePisellConfig } from "@pisell/materials";
|
|
7
7
|
import { useRequest } from "ahooks";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
8
|
+
import timezone from "dayjs/plugin/timezone";
|
|
9
|
+
import utc from "dayjs/plugin/utc";
|
|
10
10
|
import "./index.less";
|
|
11
11
|
//#region src/plus/walletPassGallery/components/timelineSection/index.tsx
|
|
12
|
-
dayjs.extend(
|
|
13
|
-
dayjs.extend(
|
|
12
|
+
dayjs.extend(timezone);
|
|
13
|
+
dayjs.extend(utc);
|
|
14
14
|
const stateTimeUnix = 1723255863;
|
|
15
15
|
const POLL_INTERVAL = 2e3;
|
|
16
16
|
const POLL_MAX_TIMES = 5;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthMethodType, VerificationMethod } from "./shared/types.js";
|
|
1
|
+
import { AuthMethodType, EmailAuthConfig, EmailRegistrationVerification, LoginFormData, OAuthConfig, PhoneAuthConfig, RegisterFormData, UIConfig, VerificationMethod } from "./shared/types.js";
|
|
2
2
|
import { Login2, Login2Config, Login2Events, Login2Props } from "./Login2.js";
|
|
3
3
|
import { Register2, Register2Config, Register2Events, Register2Props } from "./Register2.js";
|
|
4
|
-
import { AuthModal
|
|
4
|
+
import { AuthModal } from "./AuthModal.js";
|
|
@@ -226,4 +226,4 @@ interface RegisterFormData {
|
|
|
226
226
|
verification_token?: string;
|
|
227
227
|
}
|
|
228
228
|
//#endregion
|
|
229
|
-
export { AuthMethodType, EmailAuthConfig, LegalTermsConfig, LoginFormData, LoginMethodItem, OAuthConfig, PhoneAuthConfig, RegisterFormData, RegistrationMethodItem, UIConfig, VerificationMethod };
|
|
229
|
+
export { AuthMethodType, EmailAuthConfig, EmailRegistrationVerification, LegalTermsConfig, LoginFormData, LoginMethodItem, OAuthConfig, PhoneAuthConfig, RegisterFormData, RegistrationMethodItem, UIConfig, VerificationMethod };
|
|
@@ -11,7 +11,7 @@ import { buildDraftCacheItem, getModuleOptions, getUnsupportedBookingFlowReason,
|
|
|
11
11
|
import TimeResourceSelector from "../../../../../components/eventBooking/components/timeResourceSelector/index.js";
|
|
12
12
|
import { resolveAvailabilityStatus } from "../../../../../components/eventBooking/components/bookingAvailabilityCalendar/utils.js";
|
|
13
13
|
import { validateAvailabilityTimeAutoResolution } from "../autoResolution.js";
|
|
14
|
-
import { getAvailabilityCandidateDurationMinutes, getPosFlexibleDurationPresetCandidates, getSessionPresetCandidates, isFlexibleDurationValue, isSameAvailabilityCandidateRange, resolvePosCustomTimeBaseMinutes, resolvePosCustomTimeCandidate, resolvePosCustomTimeDefaultDurationMinutes, resolvePosCustomTimeDefaultStartTime, resolvePosFlexibleDurationInitialCandidate, resolvePosFlexibleDurationRequestIntent, shouldApplyPosFlexibleDurationOverride, shouldResetPosFlexibleTimeForDate, shouldShowPosCustomTimeCandidateCards } from "./posCustomTime.js";
|
|
14
|
+
import { getAvailabilityCandidateDurationMinutes, getPosFlexibleDurationPresetCandidates, getSessionPresetCandidates, isFlexibleDurationValue, isSameAvailabilityCandidateRange, resolveAvailabilityInitialCandidate, resolvePosCustomTimeBaseMinutes, resolvePosCustomTimeCandidate, resolvePosCustomTimeDefaultDurationMinutes, resolvePosCustomTimeDefaultStartTime, resolvePosFlexibleDurationInitialCandidate, resolvePosFlexibleDurationRequestIntent, shouldApplyPosFlexibleDurationOverride, shouldResetPosFlexibleTimeForDate, shouldShowPosCustomTimeCandidateCards } from "./posCustomTime.js";
|
|
15
15
|
import dayjs from "dayjs";
|
|
16
16
|
import React, { useEffect, useMemo } from "react";
|
|
17
17
|
import { Alert, Space } from "antd";
|
|
@@ -164,8 +164,8 @@ const finalizeCandidateWithoutResourceStep = function() {
|
|
|
164
164
|
}();
|
|
165
165
|
const refreshAvailabilityTimes = function() {
|
|
166
166
|
var _ref5 = _asyncToGenerator(function* (context, module, options = {}) {
|
|
167
|
-
var _context$getModuleDat2, _ref4;
|
|
168
|
-
const { durationOverride, startTimeOverride, selectionIntent = "restore" } = options;
|
|
167
|
+
var _previousTimeData$sel, _context$getModuleDat2, _ref4;
|
|
168
|
+
const { durationOverride, startTimeOverride, selectionIntent = "restore", selectionOrigin: selectionOriginOverride } = options;
|
|
169
169
|
const availability = context.services.availability;
|
|
170
170
|
const allowUnavailable = context.services.allowUnavailableBookingSelection === true;
|
|
171
171
|
const posDurationAvailability = isPosDurationAvailabilityContext(context);
|
|
@@ -176,6 +176,7 @@ const refreshAvailabilityTimes = function() {
|
|
|
176
176
|
const selectedDate = context.draft.booking.startDate.format("YYYY-MM-DD");
|
|
177
177
|
const requestId = Date.now() + Math.random();
|
|
178
178
|
const previousTimeData = context.getModuleData(module.key);
|
|
179
|
+
const availabilitySelectionOrigin = selectionOriginOverride || ((previousTimeData === null || previousTimeData === void 0 ? void 0 : previousTimeData.availabilitySelectionOrigin) === "user" && ((_previousTimeData$sel = previousTimeData.selectedCandidate) === null || _previousTimeData$sel === void 0 ? void 0 : _previousTimeData$sel.date) === selectedDate ? "user" : "automatic");
|
|
179
180
|
const posCustomTimeHydrationKey = posCustomTimeAvailability && draftRequestedDuration && draftRequestedStartTime ? `${selectedDate}|${draftRequestedStartTime}|${draftRequestedDuration}` : void 0;
|
|
180
181
|
const product = context.draft.productData;
|
|
181
182
|
const effectiveSelectionIntent = resolvePosFlexibleDurationRequestIntent({
|
|
@@ -194,7 +195,8 @@ const refreshAvailabilityTimes = function() {
|
|
|
194
195
|
requestId,
|
|
195
196
|
timeSlots: [],
|
|
196
197
|
posCustomTimeHydrationKey,
|
|
197
|
-
posCustomTimeSelectionIntent: effectiveSelectionIntent === "restore" ? void 0 : effectiveSelectionIntent
|
|
198
|
+
posCustomTimeSelectionIntent: effectiveSelectionIntent === "restore" ? void 0 : effectiveSelectionIntent,
|
|
199
|
+
availabilitySelectionOrigin
|
|
198
200
|
});
|
|
199
201
|
const group = (yield availability.getProductTimeRanges(availability.contextId, _objectSpread2({
|
|
200
202
|
productIds: [availability.productId],
|
|
@@ -247,7 +249,8 @@ const refreshAvailabilityTimes = function() {
|
|
|
247
249
|
selectedCandidate: void 0,
|
|
248
250
|
slotStepMinutes: group === null || group === void 0 ? void 0 : group.slotStepMinutes,
|
|
249
251
|
posCustomTimeHydrationKey,
|
|
250
|
-
posCustomTimeSelectionIntent: effectiveSelectionIntent === "restore" ? void 0 : effectiveSelectionIntent
|
|
252
|
+
posCustomTimeSelectionIntent: effectiveSelectionIntent === "restore" ? void 0 : effectiveSelectionIntent,
|
|
253
|
+
availabilitySelectionOrigin
|
|
251
254
|
});
|
|
252
255
|
return;
|
|
253
256
|
}
|
|
@@ -302,13 +305,22 @@ const refreshAvailabilityTimes = function() {
|
|
|
302
305
|
const displayCandidates = posSessionAvailability ? getSessionPresetCandidates(times) : posDurationAvailability && isFlexibleDurationValue(product === null || product === void 0 ? void 0 : product.duration) ? getPosFlexibleDurationPresetCandidates(times, requestedCustomRange, customSelectionIntent, Boolean(!customSelectionIntent && existingCandidate && existingCandidate.date === selectedDate && (previousTimeData === null || previousTimeData === void 0 ? void 0 : previousTimeData.timeSlots.some((slot) => String(slot.id) === String(existingCandidate.key))))) : times;
|
|
303
306
|
const fallbackCandidate = shouldPreserveRequestedPosStart ? void 0 : selectableCandidates[0];
|
|
304
307
|
const preferPosFlexiblePreset = posDurationAvailability && isFlexibleDurationValue(product === null || product === void 0 ? void 0 : product.duration) && !customSelectionIntent && context.services.selectionFlowMode !== "edit" && (selectionIntent === "fallback" || !existingCandidate || existingCandidate.date !== selectedDate);
|
|
305
|
-
const
|
|
308
|
+
const preferredCandidate = posDurationAvailability && isFlexibleDurationValue(product === null || product === void 0 ? void 0 : product.duration) ? resolvePosFlexibleDurationInitialCandidate({
|
|
306
309
|
presetCandidates: displayCandidates,
|
|
307
310
|
restoredCandidate,
|
|
308
311
|
fallbackCandidate,
|
|
309
312
|
preferPreset: preferPosFlexiblePreset,
|
|
310
313
|
allowRestoredFallback: fallbackSelectionIntent
|
|
311
314
|
}) : restoredCandidate || fallbackCandidate;
|
|
315
|
+
const initialCandidate = resolveAvailabilityInitialCandidate({
|
|
316
|
+
preferredCandidate,
|
|
317
|
+
normallySelectableCandidates,
|
|
318
|
+
normalFallbackCandidate: displayCandidates.find((candidate) => isAvailabilityCandidateSelectable(candidate)) || normallySelectableCandidates[0],
|
|
319
|
+
unavailableFallbackCandidates: displayCandidates.length > 0 ? displayCandidates : times,
|
|
320
|
+
allowUnavailableSelection: allowUnavailable,
|
|
321
|
+
preserveUnavailablePreferredCandidate: context.services.selectionFlowMode === "edit" || availabilitySelectionOrigin === "user"
|
|
322
|
+
});
|
|
323
|
+
const nextAvailabilitySelectionOrigin = availabilitySelectionOrigin === "user" && preferredCandidate && initialCandidate && String(preferredCandidate.key) === String(initialCandidate.key) ? "user" : "automatic";
|
|
312
324
|
context.setModuleData(module.key, {
|
|
313
325
|
requestId,
|
|
314
326
|
slotStepMinutes: group === null || group === void 0 ? void 0 : group.slotStepMinutes,
|
|
@@ -323,7 +335,8 @@ const refreshAvailabilityTimes = function() {
|
|
|
323
335
|
})),
|
|
324
336
|
selectedCandidate: initialCandidate,
|
|
325
337
|
posCustomTimeHydrationKey,
|
|
326
|
-
posCustomTimeSelectionIntent: effectiveSelectionIntent === "restore" ? void 0 : effectiveSelectionIntent
|
|
338
|
+
posCustomTimeSelectionIntent: effectiveSelectionIntent === "restore" ? void 0 : effectiveSelectionIntent,
|
|
339
|
+
availabilitySelectionOrigin: nextAvailabilitySelectionOrigin
|
|
327
340
|
});
|
|
328
341
|
const shouldWriteInitialCandidate = Boolean(initialCandidate) && (posCustomTimeAvailability || !existingCandidate || initialCandidate.key !== existingCandidate.key);
|
|
329
342
|
if (initialCandidate && shouldWriteInitialCandidate) {
|
|
@@ -542,7 +555,10 @@ const TimeFlowModuleComponent = ({ context, module, registerHandle }) => {
|
|
|
542
555
|
const durationProps = runtime.durationProps;
|
|
543
556
|
const applyAvailabilityCandidate = (candidate) => {
|
|
544
557
|
if (!availabilityData) return;
|
|
545
|
-
context.setModuleData(module.key, _objectSpread2(_objectSpread2({}, availabilityData), {}, {
|
|
558
|
+
context.setModuleData(module.key, _objectSpread2(_objectSpread2({}, availabilityData), {}, {
|
|
559
|
+
selectedCandidate: candidate,
|
|
560
|
+
availabilitySelectionOrigin: "user"
|
|
561
|
+
}));
|
|
546
562
|
if (!candidate) return;
|
|
547
563
|
const startAt = dayjs(candidate.startAt);
|
|
548
564
|
const endAt = dayjs(candidate.endAt);
|
|
@@ -717,7 +733,8 @@ const TimeFlowModuleComponent = ({ context, module, registerHandle }) => {
|
|
|
717
733
|
refreshAvailabilityTimes(context, module, {
|
|
718
734
|
durationOverride: duration,
|
|
719
735
|
startTimeOverride: nextStartTime,
|
|
720
|
-
selectionIntent: "custom"
|
|
736
|
+
selectionIntent: "custom",
|
|
737
|
+
selectionOrigin: "user"
|
|
721
738
|
}).then(() => context.setModuleStatus(module.key, "ready")).catch((error) => context.setModuleStatus(module.key, "error", error instanceof Error ? error.message : String(error), error));
|
|
722
739
|
}
|
|
723
740
|
}), /* @__PURE__ */ React.createElement("div", { style: { fontWeight: 500 } }, selectionFlowText("pisell2.text.duration")), /* @__PURE__ */ React.createElement(Duration, _objectSpread2(_objectSpread2(_objectSpread2({}, durationProps), options.durationProps), {}, {
|
|
@@ -744,7 +761,8 @@ const TimeFlowModuleComponent = ({ context, module, registerHandle }) => {
|
|
|
744
761
|
refreshAvailabilityTimes(context, module, {
|
|
745
762
|
durationOverride: nextDuration,
|
|
746
763
|
startTimeOverride: startTime,
|
|
747
|
-
selectionIntent: "custom"
|
|
764
|
+
selectionIntent: "custom",
|
|
765
|
+
selectionOrigin: "user"
|
|
748
766
|
}).then(() => context.setModuleStatus(module.key, "ready")).catch((error) => context.setModuleStatus(module.key, "error", error instanceof Error ? error.message : String(error), error));
|
|
749
767
|
}
|
|
750
768
|
})));
|
|
@@ -63,6 +63,21 @@ const resolvePosCustomTimeCandidate = (params) => {
|
|
|
63
63
|
}
|
|
64
64
|
return params.restoredDraftCandidate || params.restoredExistingCandidate || params.fallbackCandidate;
|
|
65
65
|
};
|
|
66
|
+
/**
|
|
67
|
+
* Availability 刷新后,优先保留仍然正常可用的原候选。只有编辑态或用户
|
|
68
|
+
* 明确选择过时间时,才允许已满候选继续压过后续正常候选。若当天已经
|
|
69
|
+
* 没有正常候选,POS 仍可保留一个不可用候选进入人工处理流程。
|
|
70
|
+
*/
|
|
71
|
+
const resolveAvailabilityInitialCandidate = (params) => {
|
|
72
|
+
var _params$unavailableFa;
|
|
73
|
+
const preferredCandidate = params.preferredCandidate;
|
|
74
|
+
const refreshedPreferredCandidate = preferredCandidate ? params.normallySelectableCandidates.find((candidate) => String(candidate.key) === String(preferredCandidate.key)) : void 0;
|
|
75
|
+
if (refreshedPreferredCandidate) return refreshedPreferredCandidate;
|
|
76
|
+
if (preferredCandidate && params.preserveUnavailablePreferredCandidate === true) return preferredCandidate;
|
|
77
|
+
if (params.normalFallbackCandidate) return params.normalFallbackCandidate;
|
|
78
|
+
if (params.allowUnavailableSelection !== true) return void 0;
|
|
79
|
+
return preferredCandidate || ((_params$unavailableFa = params.unavailableFallbackCandidates) === null || _params$unavailableFa === void 0 ? void 0 : _params$unavailableFa[0]);
|
|
80
|
+
};
|
|
66
81
|
const getSessionPresetCandidates = (candidates) => candidates.filter((candidate) => candidate.source === "session_schedule");
|
|
67
82
|
const getPosFlexibleDurationPresetCandidates = (candidates, requestedCustomRange, customSelectionIntent = false, preserveRequestedRange = false) => {
|
|
68
83
|
if (!requestedCustomRange) return [...candidates];
|
|
@@ -77,4 +92,4 @@ const resolvePosFlexibleDurationInitialCandidate = (params) => {
|
|
|
77
92
|
return params.restoredCandidate || params.fallbackCandidate;
|
|
78
93
|
};
|
|
79
94
|
//#endregion
|
|
80
|
-
export { getAvailabilityCandidateDurationMinutes, getPosFlexibleDurationPresetCandidates, getSessionPresetCandidates, isFlexibleDurationValue, isSameAvailabilityCandidateRange, resolvePosCustomTimeBaseMinutes, resolvePosCustomTimeCandidate, resolvePosCustomTimeDefaultDurationMinutes, resolvePosCustomTimeDefaultStartTime, resolvePosFlexibleDurationInitialCandidate, resolvePosFlexibleDurationRequestIntent, shouldApplyPosFlexibleDurationOverride, shouldResetPosFlexibleTimeForDate, shouldShowPosCustomTimeCandidateCards };
|
|
95
|
+
export { getAvailabilityCandidateDurationMinutes, getPosFlexibleDurationPresetCandidates, getSessionPresetCandidates, isFlexibleDurationValue, isSameAvailabilityCandidateRange, resolveAvailabilityInitialCandidate, resolvePosCustomTimeBaseMinutes, resolvePosCustomTimeCandidate, resolvePosCustomTimeDefaultDurationMinutes, resolvePosCustomTimeDefaultStartTime, resolvePosFlexibleDurationInitialCandidate, resolvePosFlexibleDurationRequestIntent, shouldApplyPosFlexibleDurationOverride, shouldResetPosFlexibleTimeForDate, shouldShowPosCustomTimeCandidateCards };
|
|
@@ -49,6 +49,8 @@ function PaymentMethodIcon({ code, type }) {
|
|
|
49
49
|
}
|
|
50
50
|
function CheckoutScreen({ model, orderBar, send }) {
|
|
51
51
|
var _model$paymentFeedbac;
|
|
52
|
+
const sendRef = (0, react.useRef)(send);
|
|
53
|
+
sendRef.current = send;
|
|
52
54
|
const goBack = (0, react.useCallback)(() => send({
|
|
53
55
|
kind: "navigation",
|
|
54
56
|
direction: "back"
|
|
@@ -59,11 +61,11 @@ function CheckoutScreen({ model, orderBar, send }) {
|
|
|
59
61
|
const [restartOrderOpen, setRestartOrderOpen] = (0, react.useState)(false);
|
|
60
62
|
const [dismissedFeedbackKey, setDismissedFeedbackKey] = (0, react.useState)();
|
|
61
63
|
const [returnCountdown, setReturnCountdown] = (0, react.useState)(10);
|
|
62
|
-
const resetOrder = (0, react.useCallback)((source) =>
|
|
64
|
+
const resetOrder = (0, react.useCallback)((source) => sendRef.current({
|
|
63
65
|
kind: "session",
|
|
64
66
|
action: "reset",
|
|
65
67
|
source
|
|
66
|
-
}), [
|
|
68
|
+
}), []);
|
|
67
69
|
const bottomBar = (0, react.useMemo)(() => {
|
|
68
70
|
var _orderBar$cartItemCou;
|
|
69
71
|
return {
|
|
@@ -43,6 +43,14 @@ function normalizeMultilingualNoteValue(value, maxLength) {
|
|
|
43
43
|
function hasMultilingualNoteValue(value) {
|
|
44
44
|
return Object.values(value).some((text) => text.trim());
|
|
45
45
|
}
|
|
46
|
+
function dismissVirtualKeyboard() {
|
|
47
|
+
if (typeof document === "undefined") return;
|
|
48
|
+
try {
|
|
49
|
+
var _activeElement$blur;
|
|
50
|
+
const activeElement = document.activeElement;
|
|
51
|
+
activeElement === null || activeElement === void 0 || (_activeElement$blur = activeElement.blur) === null || _activeElement$blur === void 0 || _activeElement$blur.call(activeElement);
|
|
52
|
+
} catch (_unused) {}
|
|
53
|
+
}
|
|
46
54
|
const NoteModalContent = ({ open = false, title = "", value = "", maxLength = DEFAULT_NOTE_MAX_LENGTH, onConfirm, onDelete, onCancel, zIndex, variant, modalClassName, multilingual = false }) => {
|
|
47
55
|
var _context$engine;
|
|
48
56
|
const context = require_useEngineContext.default();
|
|
@@ -90,6 +98,7 @@ const NoteModalContent = ({ open = false, title = "", value = "", maxLength = DE
|
|
|
90
98
|
saveTemplates(templates.filter((_, templateIndex) => templateIndex !== index));
|
|
91
99
|
};
|
|
92
100
|
const handleConfirm = () => {
|
|
101
|
+
dismissVirtualKeyboard();
|
|
93
102
|
if (multilingual) {
|
|
94
103
|
onConfirm === null || onConfirm === void 0 || onConfirm(normalizeMultilingualNoteValue(multilingualNoteValue, resolvedMaxLength));
|
|
95
104
|
return;
|