@pisell/private-materials 6.11.672 → 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
|
@@ -168,8 +168,8 @@ const finalizeCandidateWithoutResourceStep = function() {
|
|
|
168
168
|
}();
|
|
169
169
|
const refreshAvailabilityTimes = function() {
|
|
170
170
|
var _ref5 = require_asyncToGenerator._asyncToGenerator(function* (context, module, options = {}) {
|
|
171
|
-
var _context$getModuleDat2, _ref4;
|
|
172
|
-
const { durationOverride, startTimeOverride, selectionIntent = "restore" } = options;
|
|
171
|
+
var _previousTimeData$sel, _context$getModuleDat2, _ref4;
|
|
172
|
+
const { durationOverride, startTimeOverride, selectionIntent = "restore", selectionOrigin: selectionOriginOverride } = options;
|
|
173
173
|
const availability = context.services.availability;
|
|
174
174
|
const allowUnavailable = context.services.allowUnavailableBookingSelection === true;
|
|
175
175
|
const posDurationAvailability = isPosDurationAvailabilityContext(context);
|
|
@@ -180,6 +180,7 @@ const refreshAvailabilityTimes = function() {
|
|
|
180
180
|
const selectedDate = context.draft.booking.startDate.format("YYYY-MM-DD");
|
|
181
181
|
const requestId = Date.now() + Math.random();
|
|
182
182
|
const previousTimeData = context.getModuleData(module.key);
|
|
183
|
+
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");
|
|
183
184
|
const posCustomTimeHydrationKey = posCustomTimeAvailability && draftRequestedDuration && draftRequestedStartTime ? `${selectedDate}|${draftRequestedStartTime}|${draftRequestedDuration}` : void 0;
|
|
184
185
|
const product = context.draft.productData;
|
|
185
186
|
const effectiveSelectionIntent = require_posCustomTime.resolvePosFlexibleDurationRequestIntent({
|
|
@@ -198,7 +199,8 @@ const refreshAvailabilityTimes = function() {
|
|
|
198
199
|
requestId,
|
|
199
200
|
timeSlots: [],
|
|
200
201
|
posCustomTimeHydrationKey,
|
|
201
|
-
posCustomTimeSelectionIntent: effectiveSelectionIntent === "restore" ? void 0 : effectiveSelectionIntent
|
|
202
|
+
posCustomTimeSelectionIntent: effectiveSelectionIntent === "restore" ? void 0 : effectiveSelectionIntent,
|
|
203
|
+
availabilitySelectionOrigin
|
|
202
204
|
});
|
|
203
205
|
const group = (yield availability.getProductTimeRanges(availability.contextId, require_objectSpread2._objectSpread2({
|
|
204
206
|
productIds: [availability.productId],
|
|
@@ -251,7 +253,8 @@ const refreshAvailabilityTimes = function() {
|
|
|
251
253
|
selectedCandidate: void 0,
|
|
252
254
|
slotStepMinutes: group === null || group === void 0 ? void 0 : group.slotStepMinutes,
|
|
253
255
|
posCustomTimeHydrationKey,
|
|
254
|
-
posCustomTimeSelectionIntent: effectiveSelectionIntent === "restore" ? void 0 : effectiveSelectionIntent
|
|
256
|
+
posCustomTimeSelectionIntent: effectiveSelectionIntent === "restore" ? void 0 : effectiveSelectionIntent,
|
|
257
|
+
availabilitySelectionOrigin
|
|
255
258
|
});
|
|
256
259
|
return;
|
|
257
260
|
}
|
|
@@ -306,13 +309,22 @@ const refreshAvailabilityTimes = function() {
|
|
|
306
309
|
const displayCandidates = posSessionAvailability ? require_posCustomTime.getSessionPresetCandidates(times) : posDurationAvailability && require_posCustomTime.isFlexibleDurationValue(product === null || product === void 0 ? void 0 : product.duration) ? require_posCustomTime.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;
|
|
307
310
|
const fallbackCandidate = shouldPreserveRequestedPosStart ? void 0 : selectableCandidates[0];
|
|
308
311
|
const preferPosFlexiblePreset = posDurationAvailability && require_posCustomTime.isFlexibleDurationValue(product === null || product === void 0 ? void 0 : product.duration) && !customSelectionIntent && context.services.selectionFlowMode !== "edit" && (selectionIntent === "fallback" || !existingCandidate || existingCandidate.date !== selectedDate);
|
|
309
|
-
const
|
|
312
|
+
const preferredCandidate = posDurationAvailability && require_posCustomTime.isFlexibleDurationValue(product === null || product === void 0 ? void 0 : product.duration) ? require_posCustomTime.resolvePosFlexibleDurationInitialCandidate({
|
|
310
313
|
presetCandidates: displayCandidates,
|
|
311
314
|
restoredCandidate,
|
|
312
315
|
fallbackCandidate,
|
|
313
316
|
preferPreset: preferPosFlexiblePreset,
|
|
314
317
|
allowRestoredFallback: fallbackSelectionIntent
|
|
315
318
|
}) : restoredCandidate || fallbackCandidate;
|
|
319
|
+
const initialCandidate = require_posCustomTime.resolveAvailabilityInitialCandidate({
|
|
320
|
+
preferredCandidate,
|
|
321
|
+
normallySelectableCandidates,
|
|
322
|
+
normalFallbackCandidate: displayCandidates.find((candidate) => isAvailabilityCandidateSelectable(candidate)) || normallySelectableCandidates[0],
|
|
323
|
+
unavailableFallbackCandidates: displayCandidates.length > 0 ? displayCandidates : times,
|
|
324
|
+
allowUnavailableSelection: allowUnavailable,
|
|
325
|
+
preserveUnavailablePreferredCandidate: context.services.selectionFlowMode === "edit" || availabilitySelectionOrigin === "user"
|
|
326
|
+
});
|
|
327
|
+
const nextAvailabilitySelectionOrigin = availabilitySelectionOrigin === "user" && preferredCandidate && initialCandidate && String(preferredCandidate.key) === String(initialCandidate.key) ? "user" : "automatic";
|
|
316
328
|
context.setModuleData(module.key, {
|
|
317
329
|
requestId,
|
|
318
330
|
slotStepMinutes: group === null || group === void 0 ? void 0 : group.slotStepMinutes,
|
|
@@ -327,7 +339,8 @@ const refreshAvailabilityTimes = function() {
|
|
|
327
339
|
})),
|
|
328
340
|
selectedCandidate: initialCandidate,
|
|
329
341
|
posCustomTimeHydrationKey,
|
|
330
|
-
posCustomTimeSelectionIntent: effectiveSelectionIntent === "restore" ? void 0 : effectiveSelectionIntent
|
|
342
|
+
posCustomTimeSelectionIntent: effectiveSelectionIntent === "restore" ? void 0 : effectiveSelectionIntent,
|
|
343
|
+
availabilitySelectionOrigin: nextAvailabilitySelectionOrigin
|
|
331
344
|
});
|
|
332
345
|
const shouldWriteInitialCandidate = Boolean(initialCandidate) && (posCustomTimeAvailability || !existingCandidate || initialCandidate.key !== existingCandidate.key);
|
|
333
346
|
if (initialCandidate && shouldWriteInitialCandidate) {
|
|
@@ -546,7 +559,10 @@ const TimeFlowModuleComponent = ({ context, module, registerHandle }) => {
|
|
|
546
559
|
const durationProps = runtime.durationProps;
|
|
547
560
|
const applyAvailabilityCandidate = (candidate) => {
|
|
548
561
|
if (!availabilityData) return;
|
|
549
|
-
context.setModuleData(module.key, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, availabilityData), {}, {
|
|
562
|
+
context.setModuleData(module.key, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, availabilityData), {}, {
|
|
563
|
+
selectedCandidate: candidate,
|
|
564
|
+
availabilitySelectionOrigin: "user"
|
|
565
|
+
}));
|
|
550
566
|
if (!candidate) return;
|
|
551
567
|
const startAt = (0, dayjs.default)(candidate.startAt);
|
|
552
568
|
const endAt = (0, dayjs.default)(candidate.endAt);
|
|
@@ -721,7 +737,8 @@ const TimeFlowModuleComponent = ({ context, module, registerHandle }) => {
|
|
|
721
737
|
refreshAvailabilityTimes(context, module, {
|
|
722
738
|
durationOverride: duration,
|
|
723
739
|
startTimeOverride: nextStartTime,
|
|
724
|
-
selectionIntent: "custom"
|
|
740
|
+
selectionIntent: "custom",
|
|
741
|
+
selectionOrigin: "user"
|
|
725
742
|
}).then(() => context.setModuleStatus(module.key, "ready")).catch((error) => context.setModuleStatus(module.key, "error", error instanceof Error ? error.message : String(error), error));
|
|
726
743
|
}
|
|
727
744
|
}), /* @__PURE__ */ react.default.createElement("div", { style: { fontWeight: 500 } }, require_i18n.selectionFlowText("pisell2.text.duration")), /* @__PURE__ */ react.default.createElement(require_index.default, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, durationProps), options.durationProps), {}, {
|
|
@@ -748,7 +765,8 @@ const TimeFlowModuleComponent = ({ context, module, registerHandle }) => {
|
|
|
748
765
|
refreshAvailabilityTimes(context, module, {
|
|
749
766
|
durationOverride: nextDuration,
|
|
750
767
|
startTimeOverride: startTime,
|
|
751
|
-
selectionIntent: "custom"
|
|
768
|
+
selectionIntent: "custom",
|
|
769
|
+
selectionOrigin: "user"
|
|
752
770
|
}).then(() => context.setModuleStatus(module.key, "ready")).catch((error) => context.setModuleStatus(module.key, "error", error instanceof Error ? error.message : String(error), error));
|
|
753
771
|
}
|
|
754
772
|
})));
|
|
@@ -65,6 +65,21 @@ const resolvePosCustomTimeCandidate = (params) => {
|
|
|
65
65
|
}
|
|
66
66
|
return params.restoredDraftCandidate || params.restoredExistingCandidate || params.fallbackCandidate;
|
|
67
67
|
};
|
|
68
|
+
/**
|
|
69
|
+
* Availability 刷新后,优先保留仍然正常可用的原候选。只有编辑态或用户
|
|
70
|
+
* 明确选择过时间时,才允许已满候选继续压过后续正常候选。若当天已经
|
|
71
|
+
* 没有正常候选,POS 仍可保留一个不可用候选进入人工处理流程。
|
|
72
|
+
*/
|
|
73
|
+
const resolveAvailabilityInitialCandidate = (params) => {
|
|
74
|
+
var _params$unavailableFa;
|
|
75
|
+
const preferredCandidate = params.preferredCandidate;
|
|
76
|
+
const refreshedPreferredCandidate = preferredCandidate ? params.normallySelectableCandidates.find((candidate) => String(candidate.key) === String(preferredCandidate.key)) : void 0;
|
|
77
|
+
if (refreshedPreferredCandidate) return refreshedPreferredCandidate;
|
|
78
|
+
if (preferredCandidate && params.preserveUnavailablePreferredCandidate === true) return preferredCandidate;
|
|
79
|
+
if (params.normalFallbackCandidate) return params.normalFallbackCandidate;
|
|
80
|
+
if (params.allowUnavailableSelection !== true) return void 0;
|
|
81
|
+
return preferredCandidate || ((_params$unavailableFa = params.unavailableFallbackCandidates) === null || _params$unavailableFa === void 0 ? void 0 : _params$unavailableFa[0]);
|
|
82
|
+
};
|
|
68
83
|
const getSessionPresetCandidates = (candidates) => candidates.filter((candidate) => candidate.source === "session_schedule");
|
|
69
84
|
const getPosFlexibleDurationPresetCandidates = (candidates, requestedCustomRange, customSelectionIntent = false, preserveRequestedRange = false) => {
|
|
70
85
|
if (!requestedCustomRange) return [...candidates];
|
|
@@ -84,6 +99,7 @@ exports.getPosFlexibleDurationPresetCandidates = getPosFlexibleDurationPresetCan
|
|
|
84
99
|
exports.getSessionPresetCandidates = getSessionPresetCandidates;
|
|
85
100
|
exports.isFlexibleDurationValue = isFlexibleDurationValue;
|
|
86
101
|
exports.isSameAvailabilityCandidateRange = isSameAvailabilityCandidateRange;
|
|
102
|
+
exports.resolveAvailabilityInitialCandidate = resolveAvailabilityInitialCandidate;
|
|
87
103
|
exports.resolvePosCustomTimeBaseMinutes = resolvePosCustomTimeBaseMinutes;
|
|
88
104
|
exports.resolvePosCustomTimeCandidate = resolvePosCustomTimeCandidate;
|
|
89
105
|
exports.resolvePosCustomTimeDefaultDurationMinutes = resolvePosCustomTimeDefaultDurationMinutes;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "6.11.
|
|
3
|
+
"version": "6.11.673",
|
|
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/pi-payment-sdk": "0.0.3",
|
|
73
|
-
"@pisell/utils": "3.0.4",
|
|
74
73
|
"@pisell/icon": "0.0.11",
|
|
75
|
-
"@pisell/
|
|
76
|
-
"@pisell/
|
|
74
|
+
"@pisell/date-picker": "3.0.10",
|
|
75
|
+
"@pisell/utils": "3.0.4",
|
|
76
|
+
"@pisell/materials": "6.11.261"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
79
|
"react": "^18.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|