@pisell/private-materials 6.11.180 → 6.11.182

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.
Files changed (50) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/meta.js +1 -1
  5. package/build/lowcode/render/default/view.js +1 -1
  6. package/build/lowcode/view.js +1 -1
  7. package/es/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
  8. package/es/components/checkout/PaymentModal.js +2 -1
  9. package/es/components/eftposPay/amount.d.ts +1 -1
  10. package/es/components/eftposPay/app.d.ts +1 -1
  11. package/es/components/eftposPay/device.d.ts +1 -1
  12. package/es/components/ticketBooking/components/ticketBooking/index.d.ts +16 -0
  13. package/es/plus/pisellReservation/PisellReservation.js +126 -16
  14. package/es/plus/pisellReservation/PisellVenueWallPage.d.ts +1 -0
  15. package/es/plus/pisellReservation/PisellVenueWallPage.js +1 -0
  16. package/es/plus/pisellReservation/components/bookingDetailModal/ReservationBookingDetailModal.js +2 -2
  17. package/es/plus/pisellReservation/floorMap/useReservationFloorPlan.d.ts +0 -1
  18. package/es/plus/pisellReservation/hooks/useReservationSalesHostData.d.ts +5 -0
  19. package/es/plus/pisellReservation/hooks/useReservationSalesHostData.js +7 -3
  20. package/es/plus/pisellReservation/hooks/useReservationWallClockFollow.d.ts +7 -4
  21. package/es/plus/pisellReservation/hooks/useReservationWallClockFollow.js +54 -15
  22. package/es/plus/pisellReservation/types.d.ts +6 -0
  23. package/es/plus/pisellSalesManagement/config/booking.d.ts +6 -7
  24. package/es/plus/pisellSalesManagement/hooks/useBookingPerspective.js +3 -1
  25. package/es/plus/pisellSalesManagement/hooks/useSalesGridData.d.ts +0 -1
  26. package/es/plus/pisellSalesManagement/index.js +1 -1
  27. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
  28. package/lib/components/checkout/PaymentModal.js +2 -1
  29. package/lib/components/eftposPay/amount.d.ts +1 -1
  30. package/lib/components/eftposPay/app.d.ts +1 -1
  31. package/lib/components/eftposPay/device.d.ts +1 -1
  32. package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +16 -0
  33. package/lib/plus/pisellReservation/PisellReservation.js +21 -6
  34. package/lib/plus/pisellReservation/PisellVenueWallPage.d.ts +1 -0
  35. package/lib/plus/pisellReservation/components/bookingDetailModal/ReservationBookingDetailModal.js +2 -2
  36. package/lib/plus/pisellReservation/floorMap/useReservationFloorPlan.d.ts +0 -1
  37. package/lib/plus/pisellReservation/hooks/useReservationSalesHostData.d.ts +5 -0
  38. package/lib/plus/pisellReservation/hooks/useReservationSalesHostData.js +4 -2
  39. package/lib/plus/pisellReservation/hooks/useReservationWallClockFollow.d.ts +7 -4
  40. package/lib/plus/pisellReservation/hooks/useReservationWallClockFollow.js +47 -16
  41. package/lib/plus/pisellReservation/types.d.ts +6 -0
  42. package/lib/plus/pisellSalesManagement/config/booking.d.ts +6 -7
  43. package/lib/plus/pisellSalesManagement/hooks/useBookingPerspective.js +2 -1
  44. package/lib/plus/pisellSalesManagement/hooks/useSalesGridData.d.ts +0 -1
  45. package/lib/plus/pisellSalesManagement/index.js +1 -1
  46. package/package.json +4 -4
  47. package/es/plus/pisellReservation/docs/booking-detail-modal-data-ui-map.html +0 -357
  48. package/es/plus/pisellReservation/docs/floor-room-card-data-ui-map.html +0 -841
  49. package/lib/plus/pisellReservation/docs/booking-detail-modal-data-ui-map.html +0 -357
  50. package/lib/plus/pisellReservation/docs/floor-room-card-data-ui-map.html +0 -841
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const getBookingStatusMap: () => Record<string, string>;
3
2
  export declare const BOOKING_STATUS_COLOR_MAP: Record<string, string>;
4
3
  export declare const getBookingPlatformMap: () => Record<string, string>;
@@ -21,7 +20,7 @@ export declare const getFilterButtonList: () => ({
21
20
  }[];
22
21
  minInputNumberProps?: undefined;
23
22
  maxInputNumberProps?: undefined;
24
- readonly component?: undefined;
23
+ component?: undefined;
25
24
  isSearchServer?: undefined;
26
25
  showSearch?: undefined;
27
26
  showTime?: undefined;
@@ -47,7 +46,7 @@ export declare const getFilterButtonList: () => ({
47
46
  mode?: undefined;
48
47
  maxTagCount?: undefined;
49
48
  options?: undefined;
50
- readonly component?: undefined;
49
+ component?: undefined;
51
50
  isSearchServer?: undefined;
52
51
  showSearch?: undefined;
53
52
  showTime?: undefined;
@@ -92,7 +91,7 @@ export declare const getFilterButtonList: () => ({
92
91
  options: () => Promise<any>;
93
92
  minInputNumberProps?: undefined;
94
93
  maxInputNumberProps?: undefined;
95
- readonly component?: undefined;
94
+ component?: undefined;
96
95
  isSearchServer?: undefined;
97
96
  showSearch?: undefined;
98
97
  showTime?: undefined;
@@ -112,7 +111,7 @@ export declare const getFilterButtonList: () => ({
112
111
  options?: undefined;
113
112
  minInputNumberProps?: undefined;
114
113
  maxInputNumberProps?: undefined;
115
- readonly component?: undefined;
114
+ component?: undefined;
116
115
  isSearchServer?: undefined;
117
116
  showSearch?: undefined;
118
117
  showTime?: undefined;
@@ -134,7 +133,7 @@ export declare const getFilterButtonList: () => ({
134
133
  maxTagCount?: undefined;
135
134
  minInputNumberProps?: undefined;
136
135
  maxInputNumberProps?: undefined;
137
- readonly component?: undefined;
136
+ component?: undefined;
138
137
  showTime?: undefined;
139
138
  };
140
139
  sort?: undefined;
@@ -153,7 +152,7 @@ export declare const getFilterButtonList: () => ({
153
152
  options?: undefined;
154
153
  minInputNumberProps?: undefined;
155
154
  maxInputNumberProps?: undefined;
156
- readonly component?: undefined;
155
+ component?: undefined;
157
156
  isSearchServer?: undefined;
158
157
  showSearch?: undefined;
159
158
  };
@@ -48,7 +48,9 @@ export var useBookingPerspective = function useBookingPerspective(params) {
48
48
  var bookingLabels = getBookingHeaderLabels();
49
49
  var _ref = params || {},
50
50
  relationTables = _ref.relationTables;
51
- var _relationTables = (relationTables || []).filter(function (item) {
51
+ /** API / 预览占位可能返回非数组 truthy 值(如 {}),不能用 `|| []` */
52
+ var relationTablesList = Array.isArray(relationTables) ? relationTables : [];
53
+ var _relationTables = relationTablesList.filter(function (item) {
52
54
  return ['appointment_booking', 'ticket', 'party_room', 'therapist', 'table-order', 'voucher_ticket', 'mobile_order'].includes(item.relation_type);
53
55
  });
54
56
  var uniqueTables = _relationTables.reduce(function (pre, cur) {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface UseSalesGridDataParams {
3
2
  perspective: 'monitor' | 'handle';
4
3
  extParams?: {
@@ -59,7 +59,7 @@ var PisellSalesManagement = function PisellSalesManagement(props) {
59
59
  };
60
60
  }, [props.biz, params === null || params === void 0 ? void 0 : params.biz, queryBusinessCode]);
61
61
  var perspectives = usePerspectives({
62
- relationTables: _getRelationTables.data || []
62
+ relationTables: Array.isArray(_getRelationTables.data) ? _getRelationTables.data : []
63
63
  });
64
64
  var gridDataProps = useSalesGridData({
65
65
  perspective: perspective,
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SendModalValues } from './index';
3
2
  declare const useSendModal: (bookingId?: number) => {
4
3
  open: boolean;
@@ -777,7 +777,7 @@ var PaymentContent = (0, import_react.forwardRef)(
777
777
  if (walletPassDetail.isShow) {
778
778
  const voucherItems = [];
779
779
  select.forEach((item) => {
780
- var _a, _b, _c, _d;
780
+ var _a, _b, _c, _d, _e;
781
781
  const mapCode = item.code ? import_constants.WALLET_PASS_CODE_MAP[item.code] : null;
782
782
  if (mapCode && walletPassDetail.map[mapCode]) {
783
783
  voucherItems.push({
@@ -792,6 +792,7 @@ var PaymentContent = (0, import_react.forwardRef)(
792
792
  /** 支付类型type,跟支付列表上对应的支付方式保持一致 */
793
793
  type: (_d = walletPassDetail.map[mapCode]) == null ? void 0 : _d.type,
794
794
  /** 代金券、充值卡、积分卡等wallet pass id */
795
+ custom_payment_id: Number((_e = walletPassDetail.map[mapCode]) == null ? void 0 : _e.id) || 0,
795
796
  voucher_id: item.voucher_id,
796
797
  wallet_pass_usage_unit: item.wallet_pass_usage_unit,
797
798
  wallet_pass_use_value: convertCurrencyAmountToWalletPassValue({
@@ -9,7 +9,7 @@ import { PosProps } from './const';
9
9
  */
10
10
  declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
11
11
  className?: string | undefined;
12
- onChange?: ((status: "print" | "page" | "success" | "fail" | "mark_tx_processed", params?: string | {
12
+ onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
13
13
  [keys: string]: unknown;
14
14
  } | undefined, other?: any) => void) | undefined;
15
15
  onClose: () => void;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { PosProps, RouteType } from './const';
3
- declare const App: ({ action, api, device_number, terminal, tyroUrl, tyroVersion, onChangeParams, isMobile, channel, formatAmount, ...props }: Omit<PosProps, "mode" | "type" | "getApi"> & {
3
+ declare const App: ({ action, api, device_number, terminal, tyroUrl, tyroVersion, onChangeParams, isMobile, channel, formatAmount, ...props }: Omit<PosProps, "type" | "mode" | "getApi"> & {
4
4
  action: RouteType;
5
5
  device_number: string | number;
6
6
  api: ReturnType<PosProps['getApi']>;
@@ -11,7 +11,7 @@ import './device.less';
11
11
  declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, containerStyle, }: {
12
12
  api: PayProps['api'];
13
13
  className?: string | undefined;
14
- onChange?: ((status: "print" | "page" | "success" | "fail" | "mark_tx_processed", params?: string | {
14
+ onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
15
15
  [keys: string]: unknown;
16
16
  } | undefined, other?: any) => void) | undefined;
17
17
  onClose: () => void;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { type TicketBookingSecondaryDisplayConfig } from './useTicketBookingSecondaryScreen';
3
+ import './index.less';
4
+ import { ProductDisplayConfig, ProductDisplayPresetKey } from '../ProductDisplayAdapter/types';
5
+ import { BaseResponsiveProps } from '../../../../responsive/type';
6
+ export declare const _formatBookingDetail: (data: any, modalState: any) => any;
7
+ interface TicketBookingProps {
8
+ onPrerenderComplete?: () => void;
9
+ productDisplayConfig?: ProductDisplayPresetKey | ProductDisplayConfig;
10
+ isShowTimeBar?: boolean;
11
+ isShowFloatButtons?: boolean;
12
+ /** 副屏展示:购物车列数、是否显示客户信息等 */
13
+ secondaryScreenDisplay?: TicketBookingSecondaryDisplayConfig;
14
+ }
15
+ declare const _default: React.ForwardRefExoticComponent<TicketBookingProps & BaseResponsiveProps & React.RefAttributes<unknown>>;
16
+ export default _default;
@@ -76,6 +76,13 @@ var import_useReservationHudDrawer = require("./hooks/useReservationHudDrawer");
76
76
  var import_useReservationResourceWallPersist = require("./hooks/useReservationResourceWallPersist");
77
77
  var import_useReservationDebugLoggers = require("./hooks/useReservationDebugLoggers");
78
78
  var import_ReservationHudDrawer = require("./components/ReservationHudDrawer");
79
+ var PREVIEW_HTTP_CLIENT = {
80
+ get: async () => ({ data: {} }),
81
+ post: async () => ({ data: {} }),
82
+ put: async () => ({ data: {} }),
83
+ remove: async () => ({ data: {} }),
84
+ custom: async () => ({ data: {} })
85
+ };
79
86
  var PisellReservationCore = (props) => {
80
87
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
81
88
  const {
@@ -118,6 +125,7 @@ var PisellReservationCore = (props) => {
118
125
  lockedBodyView,
119
126
  bodyViewStorageKey,
120
127
  floorMapHudTableDrawer = false,
128
+ forceFollowWallClock: forceFollowWallClockProp,
121
129
  ...rest
122
130
  } = props;
123
131
  const isInternalListData = (0, import_reservationDataUtils.shouldUseBuiltinReservationList)(
@@ -129,9 +137,7 @@ var PisellReservationCore = (props) => {
129
137
  const resolvedFloorPlanId = floorPlanIdProp === null ? null : floorPlanIdProp === void 0 ? import_floorPlanApi.RESERVATION_DEFAULT_FLOOR_PLAN_ID : floorPlanIdProp;
130
138
  const engineCtx = (0, import_useEngineContext.default)();
131
139
  const r = (_b = (_a = engineCtx == null ? void 0 : engineCtx.appHelper) == null ? void 0 : _a.utils) == null ? void 0 : _b.request;
132
- if (r) {
133
- import_utils2.request.setRequest(r);
134
- }
140
+ import_utils2.request.setRequest(r ?? PREVIEW_HTTP_CLIENT);
135
141
  const pisellos = (0, import_useEngineContext.usePisellOS)();
136
142
  const pisellosRef = (0, import_react.useRef)(pisellos);
137
143
  pisellosRef.current = pisellos;
@@ -204,6 +210,10 @@ var PisellReservationCore = (props) => {
204
210
  const [shellBodyView, setShellBodyView] = (0, import_react.useState)(
205
211
  () => (0, import_reservationDataUtils.readBodyViewFromStorageKey)(bodyViewStorageKey)
206
212
  );
213
+ const wallClockFollowLocked = (0, import_react.useMemo)(
214
+ () => Boolean(forceFollowWallClockProp) || lockedBodyView === "resourceWall" || shellBodyView === "resourceWall",
215
+ [forceFollowWallClockProp, lockedBodyView, shellBodyView]
216
+ );
207
217
  const { baseFloorConfig, floorPlanRemoteId, setRemoteFloorPlanView } = (0, import_useReservationFloorPlan.useReservationFloorPlan)({
208
218
  resolvedFloorPlanId,
209
219
  effectiveFloorPlanCode,
@@ -338,7 +348,8 @@ var PisellReservationCore = (props) => {
338
348
  scheduleValueProp,
339
349
  setInternalSchedule,
340
350
  flushCommittedSchedule,
341
- onScheduleChange
351
+ onScheduleChange,
352
+ wallClockFollowLocked
342
353
  );
343
354
  const prevCommittedDateRef = (0, import_react.useRef)(null);
344
355
  const { salesResourceBookings, salesTimelineHighlights } = (0, import_useReservationSalesHostData.useReservationSalesHostData)({
@@ -346,6 +357,7 @@ var PisellReservationCore = (props) => {
346
357
  pisellosRef,
347
358
  hasPisellosGetModule,
348
359
  debouncedSchedule,
360
+ followWallClock,
349
361
  resourceBoardLoading: resourceBoardData.loading,
350
362
  floorDayBookingLoading: floorDayBookingData.loading,
351
363
  floorDayBookingData: floorDayBookingData.data,
@@ -487,7 +499,9 @@ var PisellReservationCore = (props) => {
487
499
  ]);
488
500
  const handleScheduleChange = (0, import_react.useCallback)(
489
501
  (next) => {
490
- setFollowWallClock(false);
502
+ if (!wallClockFollowLocked) {
503
+ setFollowWallClock(false);
504
+ }
491
505
  if (scheduleValueProp === void 0) {
492
506
  setInternalSchedule(next);
493
507
  }
@@ -498,7 +512,8 @@ var PisellReservationCore = (props) => {
498
512
  scheduleValueProp,
499
513
  onScheduleChange,
500
514
  setFollowWallClock,
501
- queueCommittedSchedule
515
+ queueCommittedSchedule,
516
+ wallClockFollowLocked
502
517
  ]
503
518
  );
504
519
  const dataSources = (0, import_react.useMemo)(() => {
@@ -7,6 +7,7 @@ import type { PisellReservationProps } from './types';
7
7
  * - `lockedBodyView="resourceWall"`:锁定在大屏视图。
8
8
  *
9
9
  * **无需新增 props 类型**:沿用 {@link PisellReservationProps};可选行为与预约页相同(如 `toolBar`、`scheduleValue`、`floorMap` 等)。
10
+ * Core 在锁定大屏或预约页内 Segmented 切到「大屏」时(`shellBodyView === 'resourceWall'`)均 **强制跟随当前时间**(不可关闭)。
10
11
  * 默认使用 {@link PISELL_RESERVATION_VENUE_WALL_PAGE_STORAGE_KEY} 作为 `bodyViewStorageKey`,以便大屏筛选与主预约页 localStorage 隔离;可传入自定义 key 覆盖。
11
12
  */
12
13
  export declare const PisellVenueWallPage: React.FC<PisellReservationProps>;
@@ -154,7 +154,7 @@ function ReservationBookingDetailModal(props) {
154
154
  var _a;
155
155
  stopUiClick(e);
156
156
  if (!raw) return;
157
- const { action, NativePage } = ((_a = engineContext.appHelper) == null ? void 0 : _a.utils) || {};
157
+ const { action, NativePage } = ((_a = engineContext == null ? void 0 : engineContext.appHelper) == null ? void 0 : _a.utils) || {};
158
158
  const orderId = resolveOrderIdForHostActions(raw);
159
159
  switch (key) {
160
160
  case "action-edit":
@@ -217,7 +217,7 @@ function ReservationBookingDetailModal(props) {
217
217
  break;
218
218
  }
219
219
  },
220
- [raw, engineContext.appHelper, reservationBiz, associatedMenuListIds]
220
+ [raw, engineContext == null ? void 0 : engineContext.appHelper, reservationBiz, associatedMenuListIds]
221
221
  );
222
222
  return /* @__PURE__ */ import_react.default.createElement(
223
223
  import_materials.PisellModal,
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { FloorMapViewConfig } from '@pisell/materials';
3
2
  export declare function useReservationFloorPlan(options: {
4
3
  resolvedFloorPlanId: number | null;
@@ -10,12 +10,17 @@ declare type PisellOSLike = {
10
10
  * 内置列表且资源台 + floorDayBooking 均就绪后,向宿主 sales 拉两套数据:
11
11
  * - `getResourceBookingList`:游标时刻下的预约子集,参与合并进平面图 dataSources;
12
12
  * - `getTimelineHighlights`:时间轴密度折线(无则退回 PisellReservation 内本地计算)。
13
+ *
14
+ * **跟随当前**:`followWallClock === true` 时第三个参数 `currentTimeStr` 与 `timeStr` 相同(均来自 `debouncedSchedule.at`),
15
+ * 避免与墙钟 `dayjs()` 差一分钟;手动关闭跟随后仍传实时 `dayjs()`,保留「游标 vs 此刻」双通道语义。
13
16
  */
14
17
  export declare function useReservationSalesHostData(options: {
15
18
  isInternalListData: boolean;
16
19
  pisellosRef: MutableRefObject<PisellOSLike>;
17
20
  hasPisellosGetModule: boolean;
18
21
  debouncedSchedule: ReservationScheduleBandValue;
22
+ /** 顶栏「跟随当前时间」:为 true 时 `getResourceBookingList` 的 currentTime 与 timeStr 一致 */
23
+ followWallClock: boolean;
19
24
  resourceBoardLoading: boolean;
20
25
  floorDayBookingLoading: boolean;
21
26
  floorDayBookingData: unknown[];
@@ -42,6 +42,7 @@ function useReservationSalesHostData(options) {
42
42
  pisellosRef,
43
43
  hasPisellosGetModule,
44
44
  debouncedSchedule,
45
+ followWallClock,
45
46
  resourceBoardLoading,
46
47
  floorDayBookingLoading,
47
48
  floorDayBookingData,
@@ -104,7 +105,7 @@ function useReservationSalesHostData(options) {
104
105
  if (!Array.isArray(list)) {
105
106
  return;
106
107
  }
107
- const retryGateKey = `${debouncedAtMs ?? "na"}|${floorDayBookingDepKey}|v${floorDayBookingDataVersion}|${hasPisellosGetModule ? 1 : 0}`;
108
+ const retryGateKey = `${debouncedAtMs ?? "na"}|${floorDayBookingDepKey}|v${floorDayBookingDataVersion}|${hasPisellosGetModule ? 1 : 0}|fw${followWallClock ? 1 : 0}`;
108
109
  if (retryGateKey !== resourceListRetryGateRef.current) {
109
110
  resourceListRetryGateRef.current = retryGateKey;
110
111
  resourceListHostSkipRef.current = false;
@@ -129,7 +130,7 @@ function useReservationSalesHostData(options) {
129
130
  const timeStr = (0, import_dayjs.default)(debouncedSchedule.at).format(
130
131
  resourceBookingListTimeFormat
131
132
  );
132
- const currentTimeStr = (0, import_dayjs.default)().format(resourceBookingListTimeFormat);
133
+ const currentTimeStr = followWallClock ? timeStr : (0, import_dayjs.default)().format(resourceBookingListTimeFormat);
133
134
  const applyHostList = (raw) => {
134
135
  if (salesBookingRequestRef.current !== reqId) return;
135
136
  const normalized = (0, import_reservationTablesMerge.normalizeSalesResourceBookingListResult)(raw);
@@ -178,6 +179,7 @@ function useReservationSalesHostData(options) {
178
179
  */
179
180
  floorDayBookingDataVersion,
180
181
  debouncedAtMs,
182
+ followWallClock,
181
183
  pisellosRef
182
184
  ]);
183
185
  const [salesTimelineHighlights, setSalesTimelineHighlights] = (0, import_react.useState)(null);
@@ -1,12 +1,15 @@
1
- /// <reference types="react" />
1
+ import { type SetStateAction } from 'react';
2
2
  import type { ReservationScheduleBandValue } from '@pisell/materials';
3
3
  declare type OnScheduleChange = ((v: ReservationScheduleBandValue) => void) | undefined;
4
4
  /**
5
- * 顶栏「跟随当前时间」:30s 对齐日程,并通过 flushCommittedSchedule 触发防抖链。
5
+ * 顶栏「跟随当前时间」:在每自然分钟整点(*: * :00)对齐日程,`at` 使用当前分钟的 `startOf('minute')`,
6
+ * 并通过 flushCommittedSchedule 触发防抖链。
7
+ *
8
+ * @param wallClockFollowLocked 为 true 时(如大屏锁定 resourceWall):定时器始终运行,且不可通过交互关闭跟随。
6
9
  */
7
- export declare function useReservationWallClockFollow(scheduleValueProp: ReservationScheduleBandValue | undefined, setInternalSchedule: (v: ReservationScheduleBandValue) => void, flushCommittedSchedule: (v: ReservationScheduleBandValue) => void, onScheduleChange: OnScheduleChange): {
10
+ export declare function useReservationWallClockFollow(scheduleValueProp: ReservationScheduleBandValue | undefined, setInternalSchedule: (v: ReservationScheduleBandValue) => void, flushCommittedSchedule: (v: ReservationScheduleBandValue) => void, onScheduleChange: OnScheduleChange, wallClockFollowLocked?: boolean): {
8
11
  followWallClock: boolean;
9
- setFollowWallClock: import("react").Dispatch<import("react").SetStateAction<boolean>>;
12
+ setFollowWallClock: (value: SetStateAction<boolean>) => void;
10
13
  onFollowWallClockToggle: () => void;
11
14
  onTimeNavigatorUserInteraction: () => void;
12
15
  };
@@ -34,41 +34,72 @@ __export(useReservationWallClockFollow_exports, {
34
34
  module.exports = __toCommonJS(useReservationWallClockFollow_exports);
35
35
  var import_react = require("react");
36
36
  var import_dayjs = __toESM(require("dayjs"));
37
- function useReservationWallClockFollow(scheduleValueProp, setInternalSchedule, flushCommittedSchedule, onScheduleChange) {
38
- const [followWallClock, setFollowWallClock] = (0, import_react.useState)(true);
37
+ function useReservationWallClockFollow(scheduleValueProp, setInternalSchedule, flushCommittedSchedule, onScheduleChange, wallClockFollowLocked = false) {
38
+ const [followWallClock, setFollowWallClockInternal] = (0, import_react.useState)(true);
39
39
  const onScheduleChangeRef = (0, import_react.useRef)(onScheduleChange);
40
+ const scheduleValuePropRef = (0, import_react.useRef)(scheduleValueProp);
41
+ scheduleValuePropRef.current = scheduleValueProp;
42
+ const scheduleControlled = scheduleValueProp !== void 0;
43
+ const followWallClockEffective = wallClockFollowLocked || followWallClock;
44
+ (0, import_react.useEffect)(() => {
45
+ if (wallClockFollowLocked) setFollowWallClockInternal(true);
46
+ }, [wallClockFollowLocked]);
40
47
  (0, import_react.useEffect)(() => {
41
48
  onScheduleChangeRef.current = onScheduleChange;
42
49
  });
43
50
  (0, import_react.useEffect)(() => {
44
- if (!followWallClock) return;
51
+ if (!followWallClockEffective) return;
52
+ let timeoutId = null;
53
+ let cancelled = false;
54
+ const msUntilNextMinuteBoundary = () => {
55
+ const now = (0, import_dayjs.default)();
56
+ return Math.max(0, now.startOf("minute").add(1, "minute").diff(now));
57
+ };
45
58
  const tick = () => {
46
59
  var _a;
47
- const now = (0, import_dayjs.default)();
60
+ const now = (0, import_dayjs.default)().startOf("minute");
48
61
  const next = {
49
62
  date: now.startOf("day"),
50
63
  at: now
51
64
  };
52
- if (scheduleValueProp === void 0) {
65
+ if (scheduleValuePropRef.current === void 0) {
53
66
  setInternalSchedule(next);
54
67
  }
55
68
  (_a = onScheduleChangeRef.current) == null ? void 0 : _a.call(onScheduleChangeRef, next);
56
69
  flushCommittedSchedule(next);
57
70
  };
71
+ const scheduleNextBoundary = () => {
72
+ if (cancelled) return;
73
+ timeoutId = window.setTimeout(() => {
74
+ if (cancelled) return;
75
+ tick();
76
+ scheduleNextBoundary();
77
+ }, msUntilNextMinuteBoundary());
78
+ };
58
79
  tick();
59
- const id = window.setInterval(tick, 3e4);
60
- return () => window.clearInterval(id);
61
- }, [followWallClock, scheduleValueProp, flushCommittedSchedule]);
62
- const onFollowWallClockToggle = (0, import_react.useCallback)(
63
- () => setFollowWallClock((v) => !v),
64
- []
65
- );
66
- const onTimeNavigatorUserInteraction = (0, import_react.useCallback)(
67
- () => setFollowWallClock(false),
68
- []
80
+ scheduleNextBoundary();
81
+ return () => {
82
+ cancelled = true;
83
+ if (timeoutId != null) window.clearTimeout(timeoutId);
84
+ };
85
+ }, [followWallClockEffective, flushCommittedSchedule, scheduleControlled]);
86
+ const setFollowWallClock = (0, import_react.useCallback)(
87
+ (value) => {
88
+ if (wallClockFollowLocked) return;
89
+ setFollowWallClockInternal(value);
90
+ },
91
+ [wallClockFollowLocked]
69
92
  );
93
+ const onFollowWallClockToggle = (0, import_react.useCallback)(() => {
94
+ if (wallClockFollowLocked) return;
95
+ setFollowWallClockInternal((v) => !v);
96
+ }, [wallClockFollowLocked]);
97
+ const onTimeNavigatorUserInteraction = (0, import_react.useCallback)(() => {
98
+ if (wallClockFollowLocked) return;
99
+ setFollowWallClockInternal(false);
100
+ }, [wallClockFollowLocked]);
70
101
  return {
71
- followWallClock,
102
+ followWallClock: followWallClockEffective,
72
103
  setFollowWallClock,
73
104
  onFollowWallClockToggle,
74
105
  onTimeNavigatorUserInteraction
@@ -165,4 +165,10 @@ export interface PisellReservationProps extends Omit<RecordBoardProps, 'toolBar'
165
165
  bodyViewStorageKey?: string;
166
166
  /** 点击平面图左上角 HUD 打开窄屏表格抽屉(画布已绑定资源行) */
167
167
  floorMapHudTableDrawer?: boolean;
168
+ /**
169
+ * 强制「跟随当前时间」不可关闭(定时对齐墙钟、`getResourceBookingList` 与游标时间一致)。
170
+ * - **默认**:{@link lockedBodyView} 为 `resourceWall`,或用户在 RecordBoard 内**切换到「大屏 / resourceWall」子视图**时自动启用。
171
+ * - 设为 `true` 可在其它场景也强制跟随。
172
+ */
173
+ forceFollowWallClock?: boolean;
168
174
  }
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const getBookingStatusMap: () => Record<string, string>;
3
2
  export declare const BOOKING_STATUS_COLOR_MAP: Record<string, string>;
4
3
  export declare const getBookingPlatformMap: () => Record<string, string>;
@@ -21,7 +20,7 @@ export declare const getFilterButtonList: () => ({
21
20
  }[];
22
21
  minInputNumberProps?: undefined;
23
22
  maxInputNumberProps?: undefined;
24
- readonly component?: undefined;
23
+ component?: undefined;
25
24
  isSearchServer?: undefined;
26
25
  showSearch?: undefined;
27
26
  showTime?: undefined;
@@ -47,7 +46,7 @@ export declare const getFilterButtonList: () => ({
47
46
  mode?: undefined;
48
47
  maxTagCount?: undefined;
49
48
  options?: undefined;
50
- readonly component?: undefined;
49
+ component?: undefined;
51
50
  isSearchServer?: undefined;
52
51
  showSearch?: undefined;
53
52
  showTime?: undefined;
@@ -92,7 +91,7 @@ export declare const getFilterButtonList: () => ({
92
91
  options: () => Promise<any>;
93
92
  minInputNumberProps?: undefined;
94
93
  maxInputNumberProps?: undefined;
95
- readonly component?: undefined;
94
+ component?: undefined;
96
95
  isSearchServer?: undefined;
97
96
  showSearch?: undefined;
98
97
  showTime?: undefined;
@@ -112,7 +111,7 @@ export declare const getFilterButtonList: () => ({
112
111
  options?: undefined;
113
112
  minInputNumberProps?: undefined;
114
113
  maxInputNumberProps?: undefined;
115
- readonly component?: undefined;
114
+ component?: undefined;
116
115
  isSearchServer?: undefined;
117
116
  showSearch?: undefined;
118
117
  showTime?: undefined;
@@ -134,7 +133,7 @@ export declare const getFilterButtonList: () => ({
134
133
  maxTagCount?: undefined;
135
134
  minInputNumberProps?: undefined;
136
135
  maxInputNumberProps?: undefined;
137
- readonly component?: undefined;
136
+ component?: undefined;
138
137
  showTime?: undefined;
139
138
  };
140
139
  sort?: undefined;
@@ -153,7 +152,7 @@ export declare const getFilterButtonList: () => ({
153
152
  options?: undefined;
154
153
  minInputNumberProps?: undefined;
155
154
  maxInputNumberProps?: undefined;
156
- readonly component?: undefined;
155
+ component?: undefined;
157
156
  isSearchServer?: undefined;
158
157
  showSearch?: undefined;
159
158
  };
@@ -69,7 +69,8 @@ var useBookingPerspective = (params) => {
69
69
  const BUSINESS_LABEL_MAP = (0, import_config.getBusinessLabelMap)();
70
70
  const bookingLabels = (0, import_booking.getBookingHeaderLabels)();
71
71
  const { relationTables } = params || {};
72
- const _relationTables = (relationTables || []).filter(
72
+ const relationTablesList = Array.isArray(relationTables) ? relationTables : [];
73
+ const _relationTables = relationTablesList.filter(
73
74
  (item) => [
74
75
  "appointment_booking",
75
76
  "ticket",
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface UseSalesGridDataParams {
3
2
  perspective: 'monitor' | 'handle';
4
3
  extParams?: {
@@ -89,7 +89,7 @@ var PisellSalesManagement = (props) => {
89
89
  };
90
90
  }, [props.biz, params == null ? void 0 : params.biz, queryBusinessCode]);
91
91
  const perspectives = (0, import_usePerspectives.default)({
92
- relationTables: _getRelationTables.data || []
92
+ relationTables: Array.isArray(_getRelationTables.data) ? _getRelationTables.data : []
93
93
  });
94
94
  const gridDataProps = (0, import_useSalesGridData.useSalesGridData)({
95
95
  perspective,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.11.180",
3
+ "version": "6.11.182",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -67,10 +67,10 @@
67
67
  "react-infinite-scroll-component": "^6.1.0",
68
68
  "react-resizable": "^3.0.5",
69
69
  "styled-components": "^6.0.0-rc.3",
70
- "@pisell/utils": "3.0.2",
71
- "@pisell/materials": "6.11.57",
72
70
  "@pisell/icon": "0.0.11",
73
- "@pisell/date-picker": "3.0.8"
71
+ "@pisell/date-picker": "3.0.8",
72
+ "@pisell/materials": "6.11.57",
73
+ "@pisell/utils": "3.0.2"
74
74
  },
75
75
  "peerDependencies": {
76
76
  "react": "^18.0.0",