@pisell/private-materials 6.12.397 → 6.12.398
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/bigSale/components/BookingFloatingPanel/useBookingPanelController.js +1 -0
- package/es/components/bigSale/components/ProductList/index.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/useBigSaleProductListConfig.js +0 -1
- 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/components/ticketBooking/components/addServiceVariant/addService.js +0 -1
- package/es/components/venueBookingSales/catalogPresentation.js +0 -1
- package/es/components/venueBookingSales/checkout/useVenueBookingCheckout.js +1 -0
- package/es/index.js +2 -0
- 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/pisellReservation/index.js +17 -0
- 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/PrintAction.js +1 -0
- package/es/plus/saleDetail/components/DetailActions/index.js +1 -0
- package/es/plus/saleDetail/components/DetailActions/index.less +3 -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/context/SalesSdkCartContext.js +8 -10
- package/es/plus/salesSdk/index.js +54 -0
- package/es/plus/salesSdk/normalProductDetail/NormalProductDetailHostRenderer.js +3 -3
- 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/plus/skuOptionsSelection/utils/transformValueToSelectorValue.js +18 -11
- 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/compensatedPisellContainer/floatingLayer/index.js +11 -2
- package/es/pro/compensatedPisellContainer/floatingLayer/observeTransitions.js +25 -1
- package/es/pro/skuDetailModal/flow/SkuDetailSelectionFlowView.js +3 -2
- package/es/pro/skuDetailModal/flow/registry.d.ts +1 -1
- package/es/pro/skuDetailModal/index.js +8 -5
- package/lib/plus/saleDetail/components/DetailActions/index.less +3 -0
- package/lib/plus/salesSdk/context/SalesSdkCartContext.js +8 -10
- package/lib/plus/salesSdk/normalProductDetail/NormalProductDetailHostRenderer.js +3 -3
- package/lib/plus/skuOptionsSelection/utils/transformValueToSelectorValue.js +17 -10
- package/lib/pro/compensatedPisellContainer/floatingLayer/index.js +11 -2
- package/lib/pro/compensatedPisellContainer/floatingLayer/observeTransitions.js +25 -1
- package/lib/pro/skuDetailModal/flow/SkuDetailSelectionFlowView.js +3 -2
- package/lib/pro/skuDetailModal/flow/registry.d.ts +1 -1
- package/lib/pro/skuDetailModal/index.js +8 -5
- package/package.json +1 -1
- package/es/components/ticketBooking/components/ProductDisplayAdapter/index.js +0 -3
- package/es/private-materials/lowcode/authmodal/meta.d.ts +0 -1
|
@@ -18,9 +18,10 @@ const SkuDetailSelectionFlowView = ({ controller, className, showSteps = true, s
|
|
|
18
18
|
role: "alert"
|
|
19
19
|
}, configurationError.issues.map((issue, index) => /* @__PURE__ */ React.createElement("div", { key: `${issue.code}-${index}` }, renderConfigurationIssue(issue))));
|
|
20
20
|
if (!currentStep) return null;
|
|
21
|
-
const
|
|
21
|
+
const renderedSteps = getVisibleSelectionFlowSteps(steps, controller.automaticModuleKeys || []);
|
|
22
|
+
const visibleSteps = renderedSteps.filter((step) => !isStepSkippable(step.index));
|
|
22
23
|
const presentationIndex = getPresentationStepIndex(visibleSteps, currentStepIndex);
|
|
23
|
-
const displayStep =
|
|
24
|
+
const displayStep = renderedSteps.find((step) => step.index === currentStepIndex) || visibleSteps[presentationIndex] || currentStep;
|
|
24
25
|
const isLastStep = visibleSteps.length === 0 || presentationIndex === visibleSteps.length - 1;
|
|
25
26
|
return /* @__PURE__ */ React.createElement("div", {
|
|
26
27
|
className: classNames("selection-flow", moduleSections && "selection-flow--sectioned", className),
|
|
@@ -19,7 +19,7 @@ declare const flowModuleRegistry: {
|
|
|
19
19
|
readonly Component: _$react.FC<FlowModuleProps<string>>;
|
|
20
20
|
readonly initializeWhileInactive: true;
|
|
21
21
|
readonly hardRequires: ("productData" | "booking.selectedCandidate")[];
|
|
22
|
-
readonly refreshOn: ("
|
|
22
|
+
readonly refreshOn: ("productData" | "skuValue" | "quantity" | "booking.customerId" | "booking.duration" | "booking.selectedCandidate")[];
|
|
23
23
|
readonly isApplicable: (context: _$_pisell_materials_src0.SelectionFlowContextValue<SelectionFlowDraft, SelectionFlowDraftUpdate, SelectionDraftField, string, SelectionFlowServices, unknown>) => boolean;
|
|
24
24
|
readonly canInitialize: (context: _$_pisell_materials_src0.SelectionFlowContextValue<SelectionFlowDraft, SelectionFlowDraftUpdate, SelectionDraftField, string, SelectionFlowServices, unknown>) => boolean;
|
|
25
25
|
readonly refresh: (context: SelectionFlowContextValue<string>, module: CompiledSelectionFlowModuleConfig<string>) => Promise<void>;
|
|
@@ -191,8 +191,8 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, resolveProductData, reso
|
|
|
191
191
|
const inventory = useContext(SalesInventoryContext);
|
|
192
192
|
const [baseProductData, setProductData] = useState(null);
|
|
193
193
|
const [detailLoading, setDetailLoading] = useState(false);
|
|
194
|
-
const [
|
|
195
|
-
const detailContentLoading = detailLoading || !
|
|
194
|
+
const [modalEnterStarted, setModalEnterStarted] = useState(false);
|
|
195
|
+
const detailContentLoading = detailLoading || !modalEnterStarted;
|
|
196
196
|
const [appearanceConfirmPending, setAppearanceConfirmPending] = useState(false);
|
|
197
197
|
const appearanceConfirmTaskRef = useRef(null);
|
|
198
198
|
const [note, setNote] = useState("");
|
|
@@ -1056,7 +1056,7 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, resolveProductData, reso
|
|
|
1056
1056
|
setInventorySelectorSnapshot(null);
|
|
1057
1057
|
flowDateHydrationVersionRef.current += 1;
|
|
1058
1058
|
const isCurrentOpenTask = () => openTaskIdRef.current === currentTaskId;
|
|
1059
|
-
if (!open)
|
|
1059
|
+
if (!open) setModalEnterStarted(false);
|
|
1060
1060
|
const showModalShellBeforeHydration = () => {
|
|
1061
1061
|
setProductData(null);
|
|
1062
1062
|
setDetailLoading(true);
|
|
@@ -1636,7 +1636,7 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, resolveProductData, reso
|
|
|
1636
1636
|
const resetModalStateAfterClose = useCallback(() => {
|
|
1637
1637
|
var _noteDiagnosticsRef$c4;
|
|
1638
1638
|
(_noteDiagnosticsRef$c4 = noteDiagnosticsRef.current) === null || _noteDiagnosticsRef$c4 === void 0 || _noteDiagnosticsRef$c4.stop();
|
|
1639
|
-
|
|
1639
|
+
setModalEnterStarted(false);
|
|
1640
1640
|
setProductData(null);
|
|
1641
1641
|
setDetailLoading(false);
|
|
1642
1642
|
setNote("");
|
|
@@ -1677,8 +1677,10 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, resolveProductData, reso
|
|
|
1677
1677
|
setNoteModalOpen(false);
|
|
1678
1678
|
setShowPriceAdjustModal(false);
|
|
1679
1679
|
};
|
|
1680
|
+
const handleModalEnterStart = useCallback(() => {
|
|
1681
|
+
setModalEnterStarted(true);
|
|
1682
|
+
}, []);
|
|
1680
1683
|
const handleModalOpenChange = useCallback((nextOpen) => {
|
|
1681
|
-
if (nextOpen) setModalEntered(true);
|
|
1682
1684
|
if (nextOpen && shownLogRef.current) {
|
|
1683
1685
|
const _shownLogRef$current = shownLogRef.current, { startedAt } = _shownLogRef$current, metadata = _objectWithoutProperties(_shownLogRef$current, _excluded);
|
|
1684
1686
|
shownLogRef.current = null;
|
|
@@ -2518,6 +2520,7 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, resolveProductData, reso
|
|
|
2518
2520
|
rootStyle: suspended ? { display: "none" } : void 0,
|
|
2519
2521
|
keyboard: !suspended,
|
|
2520
2522
|
onCancel: handleCancel,
|
|
2523
|
+
afterEnterStart: handleModalEnterStart,
|
|
2521
2524
|
afterOpenChange: handleModalOpenChange,
|
|
2522
2525
|
header: variant === "phone" ? drawerHeader : null,
|
|
2523
2526
|
headerDivider: false,
|
|
@@ -1125,24 +1125,22 @@ const SalesSdkCartProvider = ({ children, normalProductDetailConfig, resourceIdF
|
|
|
1125
1125
|
const preparedSelection = (_options$calendarSele = options === null || options === void 0 ? void 0 : options.calendarSelection) !== null && _options$calendarSele !== void 0 ? _options$calendarSele : options === null || options === void 0 ? void 0 : options.rememberedSelection;
|
|
1126
1126
|
options === null || options === void 0 || (_options$memoryCommit = options.memoryCommitLifecycle) === null || _options$memoryCommit === void 0 || _options$memoryCommit.beforeCommit();
|
|
1127
1127
|
if (preparedSelection) {
|
|
1128
|
-
var _options$rememberedTi, _sales$salesModule, _options$
|
|
1128
|
+
var _options$rememberedTi, _sales$salesModule, _options$salesNotes2, _committed$validation, _options$memoryCommit2, _committed$tempOrder, _bookingTicket$getTem11;
|
|
1129
1129
|
options === null || options === void 0 || (_options$rememberedTi = options.rememberedTimeGuard) === null || _options$rememberedTi === void 0 || _options$rememberedTi.call(options);
|
|
1130
1130
|
if (!(sales === null || sales === void 0 || (_sales$salesModule = sales.salesModule) === null || _sales$salesModule === void 0 ? void 0 : _sales$salesModule.commitAvailabilitySelection)) throw new Error("The current sales module cannot validate the booking.");
|
|
1131
|
-
const committed = yield sales.salesModule.commitAvailabilitySelection(preparedSelection.contextId, require_objectSpread2._objectSpread2({
|
|
1131
|
+
const committed = yield sales.salesModule.commitAvailabilitySelection(preparedSelection.contextId, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({
|
|
1132
1132
|
mode: "add",
|
|
1133
1133
|
orderProduct: require_resolveBookingCommitCount.normalizeAvailabilityOrderProductForCommit(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, cacheItemForTransform), orderLine), {}, { _extend: cacheItemForTransform._extend })),
|
|
1134
1134
|
candidate: preparedSelection.candidate,
|
|
1135
1135
|
requirementSelections: preparedSelection.requirementSelections,
|
|
1136
1136
|
partySize: preparedSelection.partySize,
|
|
1137
1137
|
bookingCount: preparedSelection.bookingCount,
|
|
1138
|
-
selectionIntent: (options === null || options === void 0 ? void 0 : options.calendarSelection) ? "manual" : "remembered"
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
}
|
|
1145
|
-
}, (options === null || options === void 0 || (_options$salesNotes2 = options.salesNotes) === null || _options$salesNotes2 === void 0 ? void 0 : _options$salesNotes2.length) ? { salesNotes: options.salesNotes } : {}));
|
|
1138
|
+
selectionIntent: (options === null || options === void 0 ? void 0 : options.calendarSelection) ? "manual" : "remembered"
|
|
1139
|
+
}, !(options === null || options === void 0 ? void 0 : options.calendarSelection) && (options === null || options === void 0 ? void 0 : options.rememberedSelection) ? { orderSessionId: options.rememberedSelection.orderSessionId } : {}), {}, { availabilityCommitGuard: () => {
|
|
1140
|
+
var _options$rememberedTi2;
|
|
1141
|
+
assertBookingCurrent();
|
|
1142
|
+
options === null || options === void 0 || (_options$rememberedTi2 = options.rememberedTimeGuard) === null || _options$rememberedTi2 === void 0 || _options$rememberedTi2.call(options);
|
|
1143
|
+
} }, (options === null || options === void 0 || (_options$salesNotes2 = options.salesNotes) === null || _options$salesNotes2 === void 0 ? void 0 : _options$salesNotes2.length) ? { salesNotes: options.salesNotes } : {}));
|
|
1146
1144
|
if (((_committed$validation = committed.validation) === null || _committed$validation === void 0 ? void 0 : _committed$validation.ok) === false) throw Object.assign(/* @__PURE__ */ new Error((options === null || options === void 0 ? void 0 : options.calendarSelection) ? "The calendar booking could not be saved." : "The remembered time is no longer available."), { code: "REVALIDATION_FAILED" });
|
|
1147
1145
|
options === null || options === void 0 || (_options$memoryCommit2 = options.memoryCommitLifecycle) === null || _options$memoryCommit2 === void 0 || _options$memoryCommit2.onCommitted();
|
|
1148
1146
|
const products = ((_committed$tempOrder = committed.tempOrder) === null || _committed$tempOrder === void 0 ? void 0 : _committed$tempOrder.products) || ((_bookingTicket$getTem11 = bookingTicket.getTempOrder) === null || _bookingTicket$getTem11 === void 0 || (_bookingTicket$getTem11 = _bookingTicket$getTem11.call(bookingTicket)) === null || _bookingTicket$getTem11 === void 0 ? void 0 : _bookingTicket$getTem11.products) || [];
|
|
@@ -428,14 +428,14 @@ const NormalProductDetailHostRenderer = ({ defaultSkuDetailConfig, resourceIdFro
|
|
|
428
428
|
};
|
|
429
429
|
const bookingPriceContextKey = JSON.stringify({
|
|
430
430
|
channel: productLoadChannel || "",
|
|
431
|
-
platform:
|
|
431
|
+
platform: pricingRuntimePlatform,
|
|
432
432
|
businessCode: businessCode || ""
|
|
433
433
|
});
|
|
434
434
|
const attachBookingPriceService = (options) => {
|
|
435
435
|
if (!usesUnifiedBookingSales) return;
|
|
436
436
|
selectionFlowServices = require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, selectionFlowServices), {}, { bookingPrice: require_bookingSelectionPrice.createBookingSelectionPriceService({
|
|
437
437
|
contextKey: bookingPriceContextKey,
|
|
438
|
-
runtimePlatform:
|
|
438
|
+
runtimePlatform: pricingRuntimePlatform,
|
|
439
439
|
channel: productLoadChannel,
|
|
440
440
|
initialSnapshot: options === null || options === void 0 ? void 0 : options.initialSnapshot,
|
|
441
441
|
pricingDuration: options === null || options === void 0 ? void 0 : options.pricingDuration,
|
|
@@ -857,7 +857,7 @@ const NormalProductDetailHostRenderer = ({ defaultSkuDetailConfig, resourceIdFro
|
|
|
857
857
|
booking: bookingPayload.booking || {},
|
|
858
858
|
customerId,
|
|
859
859
|
contextKey: bookingPriceContextKey,
|
|
860
|
-
runtimePlatform:
|
|
860
|
+
runtimePlatform: pricingRuntimePlatform,
|
|
861
861
|
quantity: Number(initialCacheItem === null || initialCacheItem === void 0 || (_initialCacheItem$_ex3 = initialCacheItem._extend) === null || _initialCacheItem$_ex3 === void 0 ? void 0 : _initialCacheItem$_ex3.quantity) || 1,
|
|
862
862
|
pricingDuration
|
|
863
863
|
}) : void 0
|
|
@@ -8,7 +8,8 @@ decimal_js = require_runtime.__toESM(decimal_js);
|
|
|
8
8
|
/** 接口详情与订单行可能分别返回 number/string,SKU 回填按业务 ID 比较。 */
|
|
9
9
|
const isSameId = (left, right) => left !== void 0 && left !== null && right !== void 0 && right !== null && String(left) === String(right);
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* 为唯一必选项或必须全选的固定套餐组补齐默认业务值。
|
|
12
|
+
* 仅初始化尚未选择的分组,所有默认项都必须可售且无内层配置。
|
|
12
13
|
* 同时返回本次补齐的分组 ID,供受控组件精确触发这些分组的校验。
|
|
13
14
|
*/
|
|
14
15
|
const resolveRequiredSoleBundleDefaults = (value, dataSource, options = {}) => {
|
|
@@ -21,23 +22,29 @@ const resolveRequiredSoleBundleDefaults = (value, dataSource, options = {}) => {
|
|
|
21
22
|
const defaults = [];
|
|
22
23
|
const defaultedGroupIds = [];
|
|
23
24
|
((dataSource === null || dataSource === void 0 ? void 0 : dataSource.bundle_group) || []).forEach((group) => {
|
|
24
|
-
var _item$option_group;
|
|
25
25
|
const minimum = require_normalizers.normalizeNonNegativeInteger(group === null || group === void 0 ? void 0 : group.min_quantity, 0);
|
|
26
26
|
const items = Array.isArray(group === null || group === void 0 ? void 0 : group.bundle_item) ? group.bundle_item : [];
|
|
27
|
-
if (minimum <= 0 || items.length
|
|
27
|
+
if (minimum <= 0 || items.length === 0 || !require_skuSemantics.isSkuRecordEnabled(group) || currentBundle.some((item) => {
|
|
28
28
|
var _item$group_id;
|
|
29
29
|
return isSameId((_item$group_id = item === null || item === void 0 ? void 0 : item.group_id) !== null && _item$group_id !== void 0 ? _item$group_id : item === null || item === void 0 ? void 0 : item.bundle_group_id, group === null || group === void 0 ? void 0 : group.id);
|
|
30
30
|
})) return;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
if (items.length === 1) {
|
|
32
|
+
var _item$option_group;
|
|
33
|
+
const [item] = items;
|
|
34
|
+
const maximums = [require_normalizers.normalizeNonNegativeInteger(group === null || group === void 0 ? void 0 : group.max_quantity, 0), require_normalizers.normalizeNonNegativeInteger(item === null || item === void 0 ? void 0 : item.max_quantity, 0)].filter((maximum) => maximum > 0);
|
|
35
|
+
if (minimum > (maximums.length ? Math.min(...maximums) : Infinity) || (item === null || item === void 0 || (_item$option_group = item.option_group) === null || _item$option_group === void 0 ? void 0 : _item$option_group.length) || !require_skuSemantics.isSkuRecordSellable(item, { overSold: options.overSold })) return;
|
|
36
|
+
} else if (items.length !== minimum || !require_skuSemantics.isWithinSkuBounds(minimum, group === null || group === void 0 ? void 0 : group.min_quantity, group === null || group === void 0 ? void 0 : group.max_quantity) || items.some((item) => {
|
|
37
|
+
var _item$option_group2;
|
|
38
|
+
return require_skuSemantics.parseSkuNumber(item === null || item === void 0 ? void 0 : item.max_quantity) !== 1 || !require_skuSemantics.isWithinSkuBounds(1, item === null || item === void 0 ? void 0 : item.min_quantity, item === null || item === void 0 ? void 0 : item.max_quantity) || (item === null || item === void 0 || (_item$option_group2 = item.option_group) === null || _item$option_group2 === void 0 ? void 0 : _item$option_group2.length) || !require_skuSemantics.isSkuRecordSellable(item, { overSold: options.overSold });
|
|
39
|
+
})) return;
|
|
40
|
+
const quantity = items.length === 1 ? minimum : 1;
|
|
41
|
+
defaults.push(...items.map((item) => require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, item || {}), {}, {
|
|
35
42
|
id: item === null || item === void 0 ? void 0 : item.id,
|
|
36
43
|
group_id: group === null || group === void 0 ? void 0 : group.id,
|
|
37
44
|
bundle_group_id: group === null || group === void 0 ? void 0 : group.id,
|
|
38
|
-
quantity
|
|
39
|
-
num:
|
|
40
|
-
}));
|
|
45
|
+
quantity,
|
|
46
|
+
num: quantity
|
|
47
|
+
})));
|
|
41
48
|
defaultedGroupIds.push(group === null || group === void 0 ? void 0 : group.id);
|
|
42
49
|
});
|
|
43
50
|
if (!defaults.length) return {
|
|
@@ -212,7 +212,7 @@ const getLegacyModalClass = (mode, suffix) => {
|
|
|
212
212
|
};
|
|
213
213
|
const TransformFloatingLayer = (props) => {
|
|
214
214
|
var _ref;
|
|
215
|
-
const { afterOpenChange, autoHideHeaderFooterOnScroll = false, bodyStyle, cancelButtonProps, cancelText = "Cancel", centered, children, className, classNames: layerClassNames, closeIcon, closable = true, confirmLoading, contentWrapperStyle, destroyOnClose, extra, footer, footerStyle, getContainer: customGetContainer, headerStyle, height, keyboard = true, mask = true, maskClosable = true, mode = "drawer", modalRender, okButtonProps, okText = "OK", onCancel, onClose, onOk, open, placement: rawPlacement, rootClassName, rootStyle, skipEnterMotion = false, size, style, styles, title, visible, width, wrapClassName, zIndex } = props;
|
|
215
|
+
const { afterEnterStart, afterOpenChange, autoHideHeaderFooterOnScroll = false, bodyStyle, cancelButtonProps, cancelText = "Cancel", centered, children, className, classNames: layerClassNames, closeIcon, closable = true, confirmLoading, contentWrapperStyle, destroyOnClose, extra, footer, footerStyle, getContainer: customGetContainer, headerStyle, height, keyboard = true, mask = true, maskClosable = true, mode = "drawer", modalRender, okButtonProps, okText = "OK", onCancel, onClose, onOk, open, placement: rawPlacement, rootClassName, rootStyle, skipEnterMotion = false, size, style, styles, title, visible, width, wrapClassName, zIndex } = props;
|
|
216
216
|
const placement = rawPlacement || (mode === "modal" ? "bottom" : "right");
|
|
217
217
|
const mergedOpen = Boolean(open !== null && open !== void 0 ? open : visible);
|
|
218
218
|
const showCloseButton = closable && closeIcon !== false;
|
|
@@ -256,10 +256,12 @@ const TransformFloatingLayer = (props) => {
|
|
|
256
256
|
const hasSettledHiddenRef = (0, react.useRef)(false);
|
|
257
257
|
const motionRunRef = (0, react.useRef)(0);
|
|
258
258
|
const motionOptionsRef = (0, react.useRef)({
|
|
259
|
+
afterEnterStart,
|
|
259
260
|
afterOpenChange,
|
|
260
261
|
shouldDestroyOnClose
|
|
261
262
|
});
|
|
262
263
|
motionOptionsRef.current = {
|
|
264
|
+
afterEnterStart,
|
|
263
265
|
afterOpenChange,
|
|
264
266
|
shouldDestroyOnClose
|
|
265
267
|
};
|
|
@@ -318,7 +320,14 @@ const TransformFloatingLayer = (props) => {
|
|
|
318
320
|
if (motionOptionsRef.current.shouldDestroyOnClose) setRendered(false);
|
|
319
321
|
}
|
|
320
322
|
(_motionOptionsRef$cur = (_motionOptionsRef$cur2 = motionOptionsRef.current).afterOpenChange) === null || _motionOptionsRef$cur === void 0 || _motionOptionsRef$cur.call(_motionOptionsRef$cur2, motion.open);
|
|
321
|
-
}
|
|
323
|
+
}, motion.open && wrapperRef.current ? {
|
|
324
|
+
element: wrapperRef.current,
|
|
325
|
+
onStarted: () => {
|
|
326
|
+
var _motionOptionsRef$cur3, _motionOptionsRef$cur4;
|
|
327
|
+
if (motion.id !== motionRunRef.current) return;
|
|
328
|
+
(_motionOptionsRef$cur3 = (_motionOptionsRef$cur4 = motionOptionsRef.current).afterEnterStart) === null || _motionOptionsRef$cur3 === void 0 || _motionOptionsRef$cur3.call(_motionOptionsRef$cur4);
|
|
329
|
+
}
|
|
330
|
+
} : void 0);
|
|
322
331
|
}, [motion, mergedOpen]);
|
|
323
332
|
(0, react.useEffect)(() => {
|
|
324
333
|
if (!mergedOpen || keyboard === false || typeof window === "undefined") return;
|
|
@@ -1,11 +1,30 @@
|
|
|
1
1
|
//#region src/pro/compensatedPisellContainer/floatingLayer/observeTransitions.ts
|
|
2
2
|
/** Observe only the shell's own transitions, never animations inside its content. */
|
|
3
|
-
const observeTransitions = (elements, onSettled) => {
|
|
3
|
+
const observeTransitions = (elements, onSettled, start) => {
|
|
4
4
|
let disposed = false;
|
|
5
5
|
let frame;
|
|
6
|
+
let startFrame;
|
|
7
|
+
let started = false;
|
|
6
8
|
const pendingEvents = /* @__PURE__ */ new Map();
|
|
7
9
|
const supportsAnimations = elements.every((element) => typeof element.getAnimations === "function");
|
|
8
10
|
const isMotionProperty = (property) => property === "opacity" || property === "transform";
|
|
11
|
+
const reportStart = () => {
|
|
12
|
+
if (disposed || started) return;
|
|
13
|
+
started = true;
|
|
14
|
+
if (startFrame !== void 0) cancelAnimationFrame(startFrame);
|
|
15
|
+
startFrame = void 0;
|
|
16
|
+
start === null || start === void 0 || start.onStarted();
|
|
17
|
+
};
|
|
18
|
+
const handleStart = (event) => {
|
|
19
|
+
const transition = event;
|
|
20
|
+
if (disposed || started || startFrame !== void 0 || event.target !== (start === null || start === void 0 ? void 0 : start.element) || !isMotionProperty(transition.propertyName)) return;
|
|
21
|
+
startFrame = requestAnimationFrame(() => {
|
|
22
|
+
startFrame = requestAnimationFrame(() => {
|
|
23
|
+
startFrame = void 0;
|
|
24
|
+
reportStart();
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
};
|
|
9
28
|
const check = () => {
|
|
10
29
|
if (disposed) return;
|
|
11
30
|
if (supportsAnimations) {
|
|
@@ -18,6 +37,8 @@ const observeTransitions = (elements, onSettled) => {
|
|
|
18
37
|
return;
|
|
19
38
|
}
|
|
20
39
|
} else if ([...pendingEvents.values()].some((properties) => properties.size)) return;
|
|
40
|
+
reportStart();
|
|
41
|
+
if (disposed) return;
|
|
21
42
|
disposed = true;
|
|
22
43
|
removeListeners();
|
|
23
44
|
onSettled();
|
|
@@ -38,12 +59,14 @@ const observeTransitions = (elements, onSettled) => {
|
|
|
38
59
|
}
|
|
39
60
|
};
|
|
40
61
|
const removeListeners = () => {
|
|
62
|
+
start === null || start === void 0 || start.element.removeEventListener("transitionstart", handleStart);
|
|
41
63
|
elements.forEach((element) => {
|
|
42
64
|
element.removeEventListener("transitionrun", handleTransition);
|
|
43
65
|
element.removeEventListener("transitionend", handleTransition);
|
|
44
66
|
element.removeEventListener("transitioncancel", handleTransition);
|
|
45
67
|
});
|
|
46
68
|
};
|
|
69
|
+
start === null || start === void 0 || start.element.addEventListener("transitionstart", handleStart);
|
|
47
70
|
elements.forEach((element) => {
|
|
48
71
|
pendingEvents.set(element, /* @__PURE__ */ new Set());
|
|
49
72
|
if (!supportsAnimations) {
|
|
@@ -58,6 +81,7 @@ const observeTransitions = (elements, onSettled) => {
|
|
|
58
81
|
return () => {
|
|
59
82
|
disposed = true;
|
|
60
83
|
if (frame !== void 0) cancelAnimationFrame(frame);
|
|
84
|
+
if (startFrame !== void 0) cancelAnimationFrame(startFrame);
|
|
61
85
|
removeListeners();
|
|
62
86
|
};
|
|
63
87
|
};
|
|
@@ -21,9 +21,10 @@ const SkuDetailSelectionFlowView = ({ controller, className, showSteps = true, s
|
|
|
21
21
|
role: "alert"
|
|
22
22
|
}, configurationError.issues.map((issue, index) => /* @__PURE__ */ react.default.createElement("div", { key: `${issue.code}-${index}` }, renderConfigurationIssue(issue))));
|
|
23
23
|
if (!currentStep) return null;
|
|
24
|
-
const
|
|
24
|
+
const renderedSteps = require_presentation.getVisibleSelectionFlowSteps(steps, controller.automaticModuleKeys || []);
|
|
25
|
+
const visibleSteps = renderedSteps.filter((step) => !isStepSkippable(step.index));
|
|
25
26
|
const presentationIndex = require_presentation.getPresentationStepIndex(visibleSteps, currentStepIndex);
|
|
26
|
-
const displayStep =
|
|
27
|
+
const displayStep = renderedSteps.find((step) => step.index === currentStepIndex) || visibleSteps[presentationIndex] || currentStep;
|
|
27
28
|
const isLastStep = visibleSteps.length === 0 || presentationIndex === visibleSteps.length - 1;
|
|
28
29
|
return /* @__PURE__ */ react.default.createElement("div", {
|
|
29
30
|
className: (0, classnames.default)("selection-flow", moduleSections && "selection-flow--sectioned", className),
|
|
@@ -19,7 +19,7 @@ declare const flowModuleRegistry: {
|
|
|
19
19
|
readonly Component: _$react.FC<FlowModuleProps<string>>;
|
|
20
20
|
readonly initializeWhileInactive: true;
|
|
21
21
|
readonly hardRequires: ("productData" | "booking.selectedCandidate")[];
|
|
22
|
-
readonly refreshOn: ("
|
|
22
|
+
readonly refreshOn: ("productData" | "skuValue" | "quantity" | "booking.customerId" | "booking.duration" | "booking.selectedCandidate")[];
|
|
23
23
|
readonly isApplicable: (context: _$_pisell_materials_src0.SelectionFlowContextValue<SelectionFlowDraft, SelectionFlowDraftUpdate, SelectionDraftField, string, SelectionFlowServices, unknown>) => boolean;
|
|
24
24
|
readonly canInitialize: (context: _$_pisell_materials_src0.SelectionFlowContextValue<SelectionFlowDraft, SelectionFlowDraftUpdate, SelectionDraftField, string, SelectionFlowServices, unknown>) => boolean;
|
|
25
25
|
readonly refresh: (context: SelectionFlowContextValue<string>, module: CompiledSelectionFlowModuleConfig<string>) => Promise<void>;
|
|
@@ -197,8 +197,8 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, resolveProductData, reso
|
|
|
197
197
|
const inventory = (0, react.useContext)(require_context.SalesInventoryContext);
|
|
198
198
|
const [baseProductData, setProductData] = (0, react.useState)(null);
|
|
199
199
|
const [detailLoading, setDetailLoading] = (0, react.useState)(false);
|
|
200
|
-
const [
|
|
201
|
-
const detailContentLoading = detailLoading || !
|
|
200
|
+
const [modalEnterStarted, setModalEnterStarted] = (0, react.useState)(false);
|
|
201
|
+
const detailContentLoading = detailLoading || !modalEnterStarted;
|
|
202
202
|
const [appearanceConfirmPending, setAppearanceConfirmPending] = (0, react.useState)(false);
|
|
203
203
|
const appearanceConfirmTaskRef = (0, react.useRef)(null);
|
|
204
204
|
const [note, setNote] = (0, react.useState)("");
|
|
@@ -1062,7 +1062,7 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, resolveProductData, reso
|
|
|
1062
1062
|
setInventorySelectorSnapshot(null);
|
|
1063
1063
|
flowDateHydrationVersionRef.current += 1;
|
|
1064
1064
|
const isCurrentOpenTask = () => openTaskIdRef.current === currentTaskId;
|
|
1065
|
-
if (!open)
|
|
1065
|
+
if (!open) setModalEnterStarted(false);
|
|
1066
1066
|
const showModalShellBeforeHydration = () => {
|
|
1067
1067
|
setProductData(null);
|
|
1068
1068
|
setDetailLoading(true);
|
|
@@ -1642,7 +1642,7 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, resolveProductData, reso
|
|
|
1642
1642
|
const resetModalStateAfterClose = (0, react.useCallback)(() => {
|
|
1643
1643
|
var _noteDiagnosticsRef$c4;
|
|
1644
1644
|
(_noteDiagnosticsRef$c4 = noteDiagnosticsRef.current) === null || _noteDiagnosticsRef$c4 === void 0 || _noteDiagnosticsRef$c4.stop();
|
|
1645
|
-
|
|
1645
|
+
setModalEnterStarted(false);
|
|
1646
1646
|
setProductData(null);
|
|
1647
1647
|
setDetailLoading(false);
|
|
1648
1648
|
setNote("");
|
|
@@ -1683,8 +1683,10 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, resolveProductData, reso
|
|
|
1683
1683
|
setNoteModalOpen(false);
|
|
1684
1684
|
setShowPriceAdjustModal(false);
|
|
1685
1685
|
};
|
|
1686
|
+
const handleModalEnterStart = (0, react.useCallback)(() => {
|
|
1687
|
+
setModalEnterStarted(true);
|
|
1688
|
+
}, []);
|
|
1686
1689
|
const handleModalOpenChange = (0, react.useCallback)((nextOpen) => {
|
|
1687
|
-
if (nextOpen) setModalEntered(true);
|
|
1688
1690
|
if (nextOpen && shownLogRef.current) {
|
|
1689
1691
|
const _shownLogRef$current = shownLogRef.current, { startedAt } = _shownLogRef$current, metadata = require_objectWithoutProperties._objectWithoutProperties(_shownLogRef$current, _excluded);
|
|
1690
1692
|
shownLogRef.current = null;
|
|
@@ -2524,6 +2526,7 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, resolveProductData, reso
|
|
|
2524
2526
|
rootStyle: suspended ? { display: "none" } : void 0,
|
|
2525
2527
|
keyboard: !suspended,
|
|
2526
2528
|
onCancel: handleCancel,
|
|
2529
|
+
afterEnterStart: handleModalEnterStart,
|
|
2527
2530
|
afterOpenChange: handleModalOpenChange,
|
|
2528
2531
|
header: variant === "phone" ? drawerHeader : null,
|
|
2529
2532
|
headerDivider: false,
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|