@pisell/private-materials 6.11.649 → 6.11.650
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.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/pro/skuDetailModal/flow/posAutoResolution.js +2 -2
- package/es/pro/skuDetailModal/index.js +11 -11
- package/lib/pro/skuDetailModal/flow/posAutoResolution.js +2 -2
- package/lib/pro/skuDetailModal/index.js +10 -10
- package/package.json +3 -3
|
@@ -23,6 +23,6 @@ const getPosAutoResolutionDraftKey = (draft) => {
|
|
|
23
23
|
capacity: (_draft$booking$capaci = draft.booking.capacity) !== null && _draft$booking$capaci !== void 0 ? _draft$booking$capaci : null
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
|
-
const
|
|
26
|
+
const shouldDirectlyConfirmPosSelectionFlow = ({ eligible, status, currentStepIndex }) => eligible && status === "resolved" && currentStepIndex === 0;
|
|
27
27
|
//#endregion
|
|
28
|
-
export { getPosAutoResolutionDraftKey, isPosCreateAutoResolutionCandidate,
|
|
28
|
+
export { getPosAutoResolutionDraftKey, isPosCreateAutoResolutionCandidate, shouldDirectlyConfirmPosSelectionFlow };
|
|
@@ -35,7 +35,7 @@ import resolveBookingPriceDisplayAmounts, { canOpenBookingManualPriceChange } fr
|
|
|
35
35
|
import { normalizeSelectionDuration } from "./flow/modules/time/index.js";
|
|
36
36
|
import { flowModuleRegistry } from "./flow/registry.js";
|
|
37
37
|
import SkuDetailSelectionFlowView from "./flow/SkuDetailSelectionFlowView.js";
|
|
38
|
-
import { getPosAutoResolutionDraftKey, isPosCreateAutoResolutionCandidate,
|
|
38
|
+
import { getPosAutoResolutionDraftKey, isPosCreateAutoResolutionCandidate, shouldDirectlyConfirmPosSelectionFlow } from "./flow/posAutoResolution.js";
|
|
39
39
|
import dayjs from "dayjs";
|
|
40
40
|
import React, { forwardRef, useCallback, useContext, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
41
41
|
import { locales } from "@pisell/utils";
|
|
@@ -716,24 +716,23 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, variant }, ref) => {
|
|
|
716
716
|
posAutoResolutionDraftKey,
|
|
717
717
|
selectionFlowInstanceKey
|
|
718
718
|
]);
|
|
719
|
-
const
|
|
719
|
+
const canDirectlyConfirmPosSelectionFlow = shouldDirectlyConfirmPosSelectionFlow({
|
|
720
720
|
eligible: isPosCreateAutoResolutionEligible,
|
|
721
721
|
status: posAutoResolutionStatus,
|
|
722
722
|
currentStepIndex: currentStep
|
|
723
723
|
});
|
|
724
|
-
const
|
|
725
|
-
const maxStepIndex = useMemo(() => Math.max(0, visibleProcedureSteps.length - 1), [visibleProcedureSteps]);
|
|
724
|
+
const maxStepIndex = useMemo(() => Math.max(0, procedureSteps.length - 1), [procedureSteps]);
|
|
726
725
|
useLayoutEffect(() => {
|
|
727
726
|
var _selectionFlowRef$cur4, _selectionFlowRef$cur5, _procedureRef$current, _procedureRef$current2;
|
|
728
|
-
if (
|
|
727
|
+
if (procedureSteps.length === 0) return;
|
|
729
728
|
const sourceStepIndex = isCustomSelectionFlow ? (_selectionFlowRef$cur4 = (_selectionFlowRef$cur5 = selectionFlowRef.current) === null || _selectionFlowRef$cur5 === void 0 ? void 0 : _selectionFlowRef$cur5.getState().currentStepIndex) !== null && _selectionFlowRef$cur4 !== void 0 ? _selectionFlowRef$cur4 : currentStep : currentStep;
|
|
730
|
-
const nextStepIndex = Math.min(Math.max(0, sourceStepIndex),
|
|
729
|
+
const nextStepIndex = Math.min(Math.max(0, sourceStepIndex), procedureSteps.length - 1);
|
|
731
730
|
if (currentStep !== nextStepIndex) setCurrentStep(nextStepIndex);
|
|
732
731
|
(_procedureRef$current = procedureRef.current) === null || _procedureRef$current === void 0 || (_procedureRef$current2 = _procedureRef$current.goToStep) === null || _procedureRef$current2 === void 0 || _procedureRef$current2.call(_procedureRef$current, nextStepIndex);
|
|
733
732
|
}, [
|
|
734
733
|
currentStep,
|
|
735
734
|
isCustomSelectionFlow,
|
|
736
|
-
|
|
735
|
+
procedureSteps
|
|
737
736
|
]);
|
|
738
737
|
/**
|
|
739
738
|
* @description: 格式化组合规格数据
|
|
@@ -1269,10 +1268,11 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, variant }, ref) => {
|
|
|
1269
1268
|
translationOriginal
|
|
1270
1269
|
]);
|
|
1271
1270
|
const pcConfirmButtonText = useMemo(() => {
|
|
1272
|
-
if (isCustomSelectionFlow) return currentStep < maxStepIndex ? locales.getText("pisell2.text.sku.detail.modal.btn.next") : locales.getText("pisell2.text.sku.detail.modal.btn.confirm");
|
|
1271
|
+
if (isCustomSelectionFlow) return currentStep < maxStepIndex && !canDirectlyConfirmPosSelectionFlow ? locales.getText("pisell2.text.sku.detail.modal.btn.next") : locales.getText("pisell2.text.sku.detail.modal.btn.confirm");
|
|
1273
1272
|
if (currentStep === 0 && hasSkuOptions) return locales.getText("pisell2.text.sku.detail.modal.btn.next");
|
|
1274
1273
|
return locales.getText("pisell2.text.sku.detail.modal.btn.confirm");
|
|
1275
1274
|
}, [
|
|
1275
|
+
canDirectlyConfirmPosSelectionFlow,
|
|
1276
1276
|
currentStep,
|
|
1277
1277
|
hasSkuOptions,
|
|
1278
1278
|
isCustomSelectionFlow,
|
|
@@ -1321,7 +1321,7 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, variant }, ref) => {
|
|
|
1321
1321
|
if (isCustomSelectionFlow && !flowDraft) {
|
|
1322
1322
|
const flow = selectionFlowRef.current;
|
|
1323
1323
|
if (!flow) return false;
|
|
1324
|
-
if (
|
|
1324
|
+
if (canDirectlyConfirmPosSelectionFlow) {
|
|
1325
1325
|
const openTaskId = openTaskIdRef.current;
|
|
1326
1326
|
const draftKey = getPosAutoResolutionDraftKey(flow.getState().draft);
|
|
1327
1327
|
const runId = posAutoResolutionRunRef.current + 1;
|
|
@@ -1876,11 +1876,11 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, variant }, ref) => {
|
|
|
1876
1876
|
};
|
|
1877
1877
|
const procedureHeaderProps = {
|
|
1878
1878
|
showBackOnFirstStep: (skuDetailConfig === null || skuDetailConfig === void 0 ? void 0 : skuDetailConfig.isShowProcedureSteps) !== false,
|
|
1879
|
-
showSteps: (skuDetailConfig === null || skuDetailConfig === void 0 ? void 0 : skuDetailConfig.isShowProcedureSteps) !== false &&
|
|
1879
|
+
showSteps: (skuDetailConfig === null || skuDetailConfig === void 0 ? void 0 : skuDetailConfig.isShowProcedureSteps) !== false && procedureSteps.length > 1,
|
|
1880
1880
|
left: (skuDetailConfig === null || skuDetailConfig === void 0 ? void 0 : skuDetailConfig.isShowProcedureSteps) !== false ? leftHeaderBack() : void 0,
|
|
1881
1881
|
right: leftHeaderClose(),
|
|
1882
1882
|
stepsProps: {
|
|
1883
|
-
items:
|
|
1883
|
+
items: procedureSteps,
|
|
1884
1884
|
mobileBreakpoint: 480,
|
|
1885
1885
|
clickable: isCustomSelectionFlow ? false : void 0
|
|
1886
1886
|
}
|
|
@@ -23,8 +23,8 @@ const getPosAutoResolutionDraftKey = (draft) => {
|
|
|
23
23
|
capacity: (_draft$booking$capaci = draft.booking.capacity) !== null && _draft$booking$capaci !== void 0 ? _draft$booking$capaci : null
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
|
-
const
|
|
26
|
+
const shouldDirectlyConfirmPosSelectionFlow = ({ eligible, status, currentStepIndex }) => eligible && status === "resolved" && currentStepIndex === 0;
|
|
27
27
|
//#endregion
|
|
28
28
|
exports.getPosAutoResolutionDraftKey = getPosAutoResolutionDraftKey;
|
|
29
29
|
exports.isPosCreateAutoResolutionCandidate = isPosCreateAutoResolutionCandidate;
|
|
30
|
-
exports.
|
|
30
|
+
exports.shouldDirectlyConfirmPosSelectionFlow = shouldDirectlyConfirmPosSelectionFlow;
|
|
@@ -722,24 +722,23 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, variant }, ref) => {
|
|
|
722
722
|
posAutoResolutionDraftKey,
|
|
723
723
|
selectionFlowInstanceKey
|
|
724
724
|
]);
|
|
725
|
-
const
|
|
725
|
+
const canDirectlyConfirmPosSelectionFlow = require_posAutoResolution.shouldDirectlyConfirmPosSelectionFlow({
|
|
726
726
|
eligible: isPosCreateAutoResolutionEligible,
|
|
727
727
|
status: posAutoResolutionStatus,
|
|
728
728
|
currentStepIndex: currentStep
|
|
729
729
|
});
|
|
730
|
-
const
|
|
731
|
-
const maxStepIndex = (0, react.useMemo)(() => Math.max(0, visibleProcedureSteps.length - 1), [visibleProcedureSteps]);
|
|
730
|
+
const maxStepIndex = (0, react.useMemo)(() => Math.max(0, procedureSteps.length - 1), [procedureSteps]);
|
|
732
731
|
(0, react.useLayoutEffect)(() => {
|
|
733
732
|
var _selectionFlowRef$cur4, _selectionFlowRef$cur5, _procedureRef$current, _procedureRef$current2;
|
|
734
|
-
if (
|
|
733
|
+
if (procedureSteps.length === 0) return;
|
|
735
734
|
const sourceStepIndex = isCustomSelectionFlow ? (_selectionFlowRef$cur4 = (_selectionFlowRef$cur5 = selectionFlowRef.current) === null || _selectionFlowRef$cur5 === void 0 ? void 0 : _selectionFlowRef$cur5.getState().currentStepIndex) !== null && _selectionFlowRef$cur4 !== void 0 ? _selectionFlowRef$cur4 : currentStep : currentStep;
|
|
736
|
-
const nextStepIndex = Math.min(Math.max(0, sourceStepIndex),
|
|
735
|
+
const nextStepIndex = Math.min(Math.max(0, sourceStepIndex), procedureSteps.length - 1);
|
|
737
736
|
if (currentStep !== nextStepIndex) setCurrentStep(nextStepIndex);
|
|
738
737
|
(_procedureRef$current = procedureRef.current) === null || _procedureRef$current === void 0 || (_procedureRef$current2 = _procedureRef$current.goToStep) === null || _procedureRef$current2 === void 0 || _procedureRef$current2.call(_procedureRef$current, nextStepIndex);
|
|
739
738
|
}, [
|
|
740
739
|
currentStep,
|
|
741
740
|
isCustomSelectionFlow,
|
|
742
|
-
|
|
741
|
+
procedureSteps
|
|
743
742
|
]);
|
|
744
743
|
/**
|
|
745
744
|
* @description: 格式化组合规格数据
|
|
@@ -1275,10 +1274,11 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, variant }, ref) => {
|
|
|
1275
1274
|
translationOriginal
|
|
1276
1275
|
]);
|
|
1277
1276
|
const pcConfirmButtonText = (0, react.useMemo)(() => {
|
|
1278
|
-
if (isCustomSelectionFlow) return currentStep < maxStepIndex ? _pisell_utils.locales.getText("pisell2.text.sku.detail.modal.btn.next") : _pisell_utils.locales.getText("pisell2.text.sku.detail.modal.btn.confirm");
|
|
1277
|
+
if (isCustomSelectionFlow) return currentStep < maxStepIndex && !canDirectlyConfirmPosSelectionFlow ? _pisell_utils.locales.getText("pisell2.text.sku.detail.modal.btn.next") : _pisell_utils.locales.getText("pisell2.text.sku.detail.modal.btn.confirm");
|
|
1279
1278
|
if (currentStep === 0 && hasSkuOptions) return _pisell_utils.locales.getText("pisell2.text.sku.detail.modal.btn.next");
|
|
1280
1279
|
return _pisell_utils.locales.getText("pisell2.text.sku.detail.modal.btn.confirm");
|
|
1281
1280
|
}, [
|
|
1281
|
+
canDirectlyConfirmPosSelectionFlow,
|
|
1282
1282
|
currentStep,
|
|
1283
1283
|
hasSkuOptions,
|
|
1284
1284
|
isCustomSelectionFlow,
|
|
@@ -1327,7 +1327,7 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, variant }, ref) => {
|
|
|
1327
1327
|
if (isCustomSelectionFlow && !flowDraft) {
|
|
1328
1328
|
const flow = selectionFlowRef.current;
|
|
1329
1329
|
if (!flow) return false;
|
|
1330
|
-
if (
|
|
1330
|
+
if (canDirectlyConfirmPosSelectionFlow) {
|
|
1331
1331
|
const openTaskId = openTaskIdRef.current;
|
|
1332
1332
|
const draftKey = require_posAutoResolution.getPosAutoResolutionDraftKey(flow.getState().draft);
|
|
1333
1333
|
const runId = posAutoResolutionRunRef.current + 1;
|
|
@@ -1882,11 +1882,11 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, variant }, ref) => {
|
|
|
1882
1882
|
};
|
|
1883
1883
|
const procedureHeaderProps = {
|
|
1884
1884
|
showBackOnFirstStep: (skuDetailConfig === null || skuDetailConfig === void 0 ? void 0 : skuDetailConfig.isShowProcedureSteps) !== false,
|
|
1885
|
-
showSteps: (skuDetailConfig === null || skuDetailConfig === void 0 ? void 0 : skuDetailConfig.isShowProcedureSteps) !== false &&
|
|
1885
|
+
showSteps: (skuDetailConfig === null || skuDetailConfig === void 0 ? void 0 : skuDetailConfig.isShowProcedureSteps) !== false && procedureSteps.length > 1,
|
|
1886
1886
|
left: (skuDetailConfig === null || skuDetailConfig === void 0 ? void 0 : skuDetailConfig.isShowProcedureSteps) !== false ? leftHeaderBack() : void 0,
|
|
1887
1887
|
right: leftHeaderClose(),
|
|
1888
1888
|
stepsProps: {
|
|
1889
|
-
items:
|
|
1889
|
+
items: procedureSteps,
|
|
1890
1890
|
mobileBreakpoint: 480,
|
|
1891
1891
|
clickable: isCustomSelectionFlow ? false : void 0
|
|
1892
1892
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "6.11.
|
|
3
|
+
"version": "6.11.650",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -70,10 +70,10 @@
|
|
|
70
70
|
"styled-components": "^6.0.0-rc.3",
|
|
71
71
|
"use-sync-external-store": "^1.6.0",
|
|
72
72
|
"@pisell/materials": "6.11.256",
|
|
73
|
-
"@pisell/
|
|
73
|
+
"@pisell/pi-payment-sdk": "0.0.3",
|
|
74
74
|
"@pisell/icon": "0.0.11",
|
|
75
75
|
"@pisell/utils": "3.0.4",
|
|
76
|
-
"@pisell/
|
|
76
|
+
"@pisell/date-picker": "3.0.10"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
79
|
"react": "^18.0.0",
|