@pisell/materials 6.11.240 → 6.11.241

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 (194) 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/preview.js +4 -4
  6. package/build/lowcode/render/default/view.js +16 -16
  7. package/build/lowcode/view.js +15 -15
  8. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +1 -1
  9. package/es/components/dataSourceComponents/fields/index.d.ts +8 -8
  10. package/es/components/pisellFind/index.d.ts +2 -0
  11. package/es/components/pisellFind/index.js +11 -0
  12. package/es/components/pisellLookup/PisellLookup.js +22 -6
  13. package/es/components/pisellLookup/components/LookupResultHost.js +56 -38
  14. package/es/components/pisellLookup/components/LookupTrigger.js +2 -0
  15. package/es/components/pisellLookup/types.d.ts +36 -0
  16. package/es/index.d.ts +1 -1
  17. package/es/index.js +1 -1
  18. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +1 -1
  19. package/lib/components/dataSourceComponents/fields/index.d.ts +8 -8
  20. package/lib/components/pisellFind/index.d.ts +2 -0
  21. package/lib/components/pisellFind/index.js +19 -0
  22. package/lib/components/pisellLookup/PisellLookup.js +18 -4
  23. package/lib/components/pisellLookup/components/LookupResultHost.js +50 -35
  24. package/lib/components/pisellLookup/components/LookupTrigger.js +2 -0
  25. package/lib/components/pisellLookup/types.d.ts +36 -0
  26. package/lib/index.d.ts +1 -1
  27. package/lib/index.js +2 -0
  28. package/package.json +3 -3
  29. package/es/components/PisellGroupView/PisellGroupView.d.ts +0 -9
  30. package/es/components/PisellGroupView/PisellGroupView.stories.d.ts +0 -27
  31. package/es/components/PisellGroupView/index.d.ts +0 -6
  32. package/es/components/PisellGroupView/types.d.ts +0 -124
  33. package/es/components/PisellGroupView/utils/index.d.ts +0 -20
  34. package/es/components/PisellProcedure/PisellProcedure.stories.d.ts +0 -163
  35. package/es/components/PisellScrollView/PisellScrollView.d.ts +0 -5
  36. package/es/components/PisellScrollView/PisellScrollView.stories.d.ts +0 -87
  37. package/es/components/PisellScrollView/hooks/useScrollState.d.ts +0 -13
  38. package/es/components/PisellSteps/PisellSteps.stories.d.ts +0 -155
  39. package/es/components/PisellSuperTabs/PisellSuperTabs.d.ts +0 -8
  40. package/es/components/PisellTabbar/constants.d.ts +0 -47
  41. package/es/components/PisellTabbar/types.d.ts +0 -123
  42. package/es/components/buttonGroupPreview/index.d.ts +0 -19
  43. package/es/components/dataSourceComponents/fields/Translation/BaseTranslation.d.ts +0 -5
  44. package/es/components/dataSourceComponents/fields/Translation/type.d.ts +0 -22
  45. package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.d.ts +0 -13
  46. package/es/components/pisellFloorMapLayout/components/CanvasTabs.d.ts +0 -27
  47. package/es/components/pisellFloorMapLayout/components/EditableItemLayer.d.ts +0 -89
  48. package/es/components/pisellFloorMapLayout/components/FloorMapEditPanel.d.ts +0 -14
  49. package/es/components/pisellFloorMapLayout/components/FloorMapEditTopBar.d.ts +0 -64
  50. package/es/components/pisellFloorMapLayout/components/FloorMapOverview.d.ts +0 -49
  51. package/es/components/pisellFloorMapLayout/components/FloorMapSelectionZoneElement.d.ts +0 -13
  52. package/es/components/pisellFloorMapLayout/components/FloorMapToolbar.d.ts +0 -84
  53. package/es/components/pisellFloorMapLayout/components/FloorMapToolbarViewAllModal.d.ts +0 -20
  54. package/es/components/pisellFloorMapLayout/hooks/useFloorMapEditState.d.ts +0 -94
  55. package/es/components/pisellFloorMapLayout/index.d.ts +0 -39
  56. package/es/components/pisellFloorMapLayout/locales-ja.d.ts +0 -184
  57. package/es/components/pisellFloorMapLayout/locales-pt.d.ts +0 -184
  58. package/es/components/pisellFloorMapLayout/locales.d.ts +0 -969
  59. package/es/components/pisellFloorMapLayout/shopFloorPlan/shopFloorPlanClient.d.ts +0 -10
  60. package/es/components/pisellFloorMapLayout/shopFloorPlan/shopFloorPlanPure.d.ts +0 -22
  61. package/es/components/pisellFloorMapLayout/shopFloorPlan/shopFloorPlanTypes.d.ts +0 -80
  62. package/es/components/pisellFloorMapLayout/types.d.ts +0 -769
  63. package/es/components/pisellFloorMapLayout/utils/floorMapCanvasDisplay.d.ts +0 -27
  64. package/es/components/pisellFloorMapLayout/utils/floorMapConfigMerge.d.ts +0 -8
  65. package/es/components/pisellFloorMapLayout/utils/floorMapFallbackRender.d.ts +0 -11
  66. package/es/components/pisellFloorMapLayout/utils/floorMapResourcePickerDisplay.d.ts +0 -27
  67. package/es/components/pisellFloorMapLayout/utils/floorMapResourcePickerTypes.d.ts +0 -109
  68. package/es/components/pisellFloorMapLayout/utils/floorMapSelectionZone.d.ts +0 -24
  69. package/es/components/pisellRecordBoard/PisellRecordBoard.d.ts +0 -9
  70. package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.d.ts +0 -14
  71. package/es/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendar.d.ts +0 -9
  72. package/es/components/pisellRecordBoard/shellFrame/Calendar/bookingCalendarInternalTypes.d.ts +0 -43
  73. package/es/components/pisellRecordBoard/shellFrame/Calendar/bookingCalendarViewShared.d.ts +0 -34
  74. package/es/components/pisellRecordBoard/shellFrame/Calendar/const/bookingCalendarConstants.d.ts +0 -102
  75. package/es/components/pisellRecordBoard/shellFrame/Calendar/modal/BookingCalendarOverflowListLayer.d.ts +0 -18
  76. package/es/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowListModal.d.ts +0 -30
  77. package/es/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowPopover.d.ts +0 -9
  78. package/es/components/pisellRecordBoard/shellFrame/Calendar/utils/bookingCalendarAxis.d.ts +0 -32
  79. package/es/components/pisellRecordBoard/shellFrame/Calendar/utils/bookingCalendarDateUtils.d.ts +0 -330
  80. package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarDayView.d.ts +0 -52
  81. package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarMonthView.d.ts +0 -22
  82. package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarResourceView.d.ts +0 -57
  83. package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarWeekView.d.ts +0 -26
  84. package/es/components/pisellRecordBoard/shellFrame/Pagination/index.d.ts +0 -14
  85. package/es/components/pisellRecordBoard/types.d.ts +0 -899
  86. package/es/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.d.ts +0 -32
  87. package/es/components/pisellTimeRangeDisplay/components/TimeRangeBlock.d.ts +0 -36
  88. package/es/components/pisellTimeRangeDisplay/types.d.ts +0 -145
  89. package/es/components/productCard/cartSkuCard/components/AmountFooter/index.d.ts +0 -4
  90. package/es/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +0 -36
  91. package/es/components/productCard/cartSkuCard/components/inlineActions/index.d.ts +0 -15
  92. package/es/components/productCard/cartSkuCard/components/specs/index.d.ts +0 -22
  93. package/es/components/productCard/cartSkuCard/components/weighing/index.d.ts +0 -23
  94. package/es/components/productCard/cartSkuCard/index.d.ts +0 -15
  95. package/es/components/productCard/lineItem/BookingLineItem.d.ts +0 -23
  96. package/es/components/productCard/lineItem/components/Holders/index.d.ts +0 -10
  97. package/es/components/productCard/lineItem/components/Resources/index.d.ts +0 -7
  98. package/es/components/productCard/lineItem/index.d.ts +0 -72
  99. package/es/components/productCard/lineItem/locales.d.ts +0 -38
  100. package/es/components/productCard/types.d.ts +0 -98
  101. package/es/components/select-time/RightPanel/index.d.ts +0 -10
  102. package/es/components/select-time/index.d.ts +0 -16
  103. package/es/components/table/hooks/useTableSetting.d.ts +0 -21
  104. package/es/components/virtual-keyboard/Time/index.d.ts +0 -14
  105. package/es/components/virtual-keyboard/index.d.ts +0 -25
  106. package/es/hooks/useTranslationOriginal.d.ts +0 -4
  107. package/es/locales/en-US.d.ts +0 -566
  108. package/es/locales/ja.d.ts +0 -534
  109. package/es/locales/pt.d.ts +0 -534
  110. package/es/locales/zh-CN.d.ts +0 -561
  111. package/es/locales/zh-TW.d.ts +0 -561
  112. package/lib/components/PisellGroupView/PisellGroupView.d.ts +0 -9
  113. package/lib/components/PisellGroupView/PisellGroupView.stories.d.ts +0 -27
  114. package/lib/components/PisellGroupView/index.d.ts +0 -6
  115. package/lib/components/PisellGroupView/types.d.ts +0 -124
  116. package/lib/components/PisellGroupView/utils/index.d.ts +0 -20
  117. package/lib/components/PisellProcedure/PisellProcedure.stories.d.ts +0 -163
  118. package/lib/components/PisellScrollView/PisellScrollView.d.ts +0 -5
  119. package/lib/components/PisellScrollView/PisellScrollView.stories.d.ts +0 -87
  120. package/lib/components/PisellScrollView/hooks/useScrollState.d.ts +0 -13
  121. package/lib/components/PisellSteps/PisellSteps.stories.d.ts +0 -155
  122. package/lib/components/PisellSuperTabs/PisellSuperTabs.d.ts +0 -8
  123. package/lib/components/PisellTabbar/constants.d.ts +0 -47
  124. package/lib/components/PisellTabbar/types.d.ts +0 -123
  125. package/lib/components/buttonGroupPreview/index.d.ts +0 -19
  126. package/lib/components/dataSourceComponents/fields/Translation/BaseTranslation.d.ts +0 -5
  127. package/lib/components/dataSourceComponents/fields/Translation/type.d.ts +0 -22
  128. package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.d.ts +0 -13
  129. package/lib/components/pisellFloorMapLayout/components/CanvasTabs.d.ts +0 -27
  130. package/lib/components/pisellFloorMapLayout/components/EditableItemLayer.d.ts +0 -89
  131. package/lib/components/pisellFloorMapLayout/components/FloorMapEditPanel.d.ts +0 -14
  132. package/lib/components/pisellFloorMapLayout/components/FloorMapEditTopBar.d.ts +0 -64
  133. package/lib/components/pisellFloorMapLayout/components/FloorMapOverview.d.ts +0 -49
  134. package/lib/components/pisellFloorMapLayout/components/FloorMapSelectionZoneElement.d.ts +0 -13
  135. package/lib/components/pisellFloorMapLayout/components/FloorMapToolbar.d.ts +0 -84
  136. package/lib/components/pisellFloorMapLayout/components/FloorMapToolbarViewAllModal.d.ts +0 -20
  137. package/lib/components/pisellFloorMapLayout/hooks/useFloorMapEditState.d.ts +0 -94
  138. package/lib/components/pisellFloorMapLayout/index.d.ts +0 -39
  139. package/lib/components/pisellFloorMapLayout/locales-ja.d.ts +0 -184
  140. package/lib/components/pisellFloorMapLayout/locales-pt.d.ts +0 -184
  141. package/lib/components/pisellFloorMapLayout/locales.d.ts +0 -969
  142. package/lib/components/pisellFloorMapLayout/shopFloorPlan/shopFloorPlanClient.d.ts +0 -10
  143. package/lib/components/pisellFloorMapLayout/shopFloorPlan/shopFloorPlanPure.d.ts +0 -22
  144. package/lib/components/pisellFloorMapLayout/shopFloorPlan/shopFloorPlanTypes.d.ts +0 -80
  145. package/lib/components/pisellFloorMapLayout/types.d.ts +0 -769
  146. package/lib/components/pisellFloorMapLayout/utils/floorMapCanvasDisplay.d.ts +0 -27
  147. package/lib/components/pisellFloorMapLayout/utils/floorMapConfigMerge.d.ts +0 -8
  148. package/lib/components/pisellFloorMapLayout/utils/floorMapFallbackRender.d.ts +0 -11
  149. package/lib/components/pisellFloorMapLayout/utils/floorMapResourcePickerDisplay.d.ts +0 -27
  150. package/lib/components/pisellFloorMapLayout/utils/floorMapResourcePickerTypes.d.ts +0 -109
  151. package/lib/components/pisellFloorMapLayout/utils/floorMapSelectionZone.d.ts +0 -24
  152. package/lib/components/pisellRecordBoard/PisellRecordBoard.d.ts +0 -9
  153. package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.d.ts +0 -14
  154. package/lib/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendar.d.ts +0 -9
  155. package/lib/components/pisellRecordBoard/shellFrame/Calendar/bookingCalendarInternalTypes.d.ts +0 -43
  156. package/lib/components/pisellRecordBoard/shellFrame/Calendar/bookingCalendarViewShared.d.ts +0 -34
  157. package/lib/components/pisellRecordBoard/shellFrame/Calendar/const/bookingCalendarConstants.d.ts +0 -102
  158. package/lib/components/pisellRecordBoard/shellFrame/Calendar/modal/BookingCalendarOverflowListLayer.d.ts +0 -18
  159. package/lib/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowListModal.d.ts +0 -30
  160. package/lib/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowPopover.d.ts +0 -9
  161. package/lib/components/pisellRecordBoard/shellFrame/Calendar/utils/bookingCalendarAxis.d.ts +0 -32
  162. package/lib/components/pisellRecordBoard/shellFrame/Calendar/utils/bookingCalendarDateUtils.d.ts +0 -330
  163. package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarDayView.d.ts +0 -52
  164. package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarMonthView.d.ts +0 -22
  165. package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarResourceView.d.ts +0 -57
  166. package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarWeekView.d.ts +0 -26
  167. package/lib/components/pisellRecordBoard/shellFrame/Pagination/index.d.ts +0 -14
  168. package/lib/components/pisellRecordBoard/types.d.ts +0 -899
  169. package/lib/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.d.ts +0 -32
  170. package/lib/components/pisellTimeRangeDisplay/components/TimeRangeBlock.d.ts +0 -36
  171. package/lib/components/pisellTimeRangeDisplay/types.d.ts +0 -145
  172. package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.d.ts +0 -4
  173. package/lib/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +0 -36
  174. package/lib/components/productCard/cartSkuCard/components/inlineActions/index.d.ts +0 -15
  175. package/lib/components/productCard/cartSkuCard/components/specs/index.d.ts +0 -22
  176. package/lib/components/productCard/cartSkuCard/components/weighing/index.d.ts +0 -23
  177. package/lib/components/productCard/cartSkuCard/index.d.ts +0 -15
  178. package/lib/components/productCard/lineItem/BookingLineItem.d.ts +0 -23
  179. package/lib/components/productCard/lineItem/components/Holders/index.d.ts +0 -10
  180. package/lib/components/productCard/lineItem/components/Resources/index.d.ts +0 -7
  181. package/lib/components/productCard/lineItem/index.d.ts +0 -72
  182. package/lib/components/productCard/lineItem/locales.d.ts +0 -38
  183. package/lib/components/productCard/types.d.ts +0 -98
  184. package/lib/components/select-time/RightPanel/index.d.ts +0 -10
  185. package/lib/components/select-time/index.d.ts +0 -16
  186. package/lib/components/table/hooks/useTableSetting.d.ts +0 -21
  187. package/lib/components/virtual-keyboard/Time/index.d.ts +0 -14
  188. package/lib/components/virtual-keyboard/index.d.ts +0 -25
  189. package/lib/hooks/useTranslationOriginal.d.ts +0 -4
  190. package/lib/locales/en-US.d.ts +0 -566
  191. package/lib/locales/ja.d.ts +0 -534
  192. package/lib/locales/pt.d.ts +0 -534
  193. package/lib/locales/zh-CN.d.ts +0 -561
  194. package/lib/locales/zh-TW.d.ts +0 -561
@@ -1,330 +0,0 @@
1
- import type { Dayjs } from 'dayjs';
2
- import type { RecordBoardCalendarBookingLike } from '../../../types';
3
- /**
4
- * 日历日期与时间轴纯函数:`fmtDate`、占用矩阵、月格、overlay 分段、周范围等,供 BookingCalendar 三视图共用。
5
- */
6
- /** 与 {@link RecordBoardCalendarBookingLike} 一致,并支持跨日 endDate */
7
- export declare type CalendarBookingSegmentInput = RecordBoardCalendarBookingLike & {
8
- endDate?: string;
9
- };
10
- export interface BookingSegmentForDate {
11
- startHour: number;
12
- endHour: number;
13
- continuesPrev: boolean;
14
- continuesNext: boolean;
15
- }
16
- export interface ViewNowReference {
17
- dateKey: string;
18
- hourFloat: number;
19
- }
20
- export declare function fmtDate(date: Date): string;
21
- /** 本地当前日期键与「日历时」小数小时,用于状态徽标与当前时刻线 */
22
- export declare function getViewNowReference(): ViewNowReference;
23
- export declare function parseDate(str: string): Date;
24
- export declare function addDays(date: Date, n: number): Date;
25
- export declare function startOfWeek(date: Date): Date;
26
- export declare function rangeDays(anchor: Date): Date[];
27
- /**
28
- * 锚定日所在自然月的每一天(1 号至月末),用于资源视图横向「日」列。
29
- */
30
- export declare function monthCalendarDays(anchor: Date): Date[];
31
- export declare function isHourInTimelineSlots(hour: number, hourSlots: number[] | undefined): boolean;
32
- export declare function formatHourLabel(hour: number): string;
33
- /**
34
- * `YYYY-MM-DD` → `M/D`,跨日 booking 的 pill 内时间行用这个短日期前缀,
35
- * 视觉上不挤占 pill 宽度(24px 左右)。
36
- */
37
- export declare function formatShortMonthDay(dateKey: string): string;
38
- export declare function buildTimeOptions(start?: number, end?: number, sliceMinutes?: number): number[];
39
- export declare function monthGrid(date: Date, bookings: CalendarBookingSegmentInput[], courtsList: {
40
- id: string;
41
- }[] | undefined, hourSlotsIn: number[] | undefined, slotStepHours?: number): {
42
- date: Date;
43
- key: string;
44
- inMonth: boolean;
45
- bookingCount: number;
46
- blockCount: number;
47
- fullyBooked: boolean;
48
- }[];
49
- export declare function getBookingSegmentForDate(item: CalendarBookingSegmentInput, dateKey: string): BookingSegmentForDate | null;
50
- /**
51
- * 是否跨自然日(`endDate` 存在且与 `date` 不同)。单日 booking 返回 false。
52
- */
53
- export declare function isCrossDayBooking(item: CalendarBookingSegmentInput): boolean;
54
- /**
55
- * 把 booking 整段转成绝对毫秒区间:
56
- * - `startMs = parseDate(date).setHours(...)`,按浮点小时拆出小时 / 分钟(30 min 步进)
57
- * - `endMs` 同理;`endHour = 24` 时归一为「次日 00:00」
58
- *
59
- * 用于跨视图统一的 lane 抢占与重叠判定,避免「按格切」假设。
60
- */
61
- export declare function getBookingFullSpanMs(item: CalendarBookingSegmentInput): {
62
- startMs: number;
63
- endMs: number;
64
- };
65
- /**
66
- * 同 court 内两条 booking 的时间区间是否相交(`[startMs, endMs)` 半开区间,端点相邻不算交)。
67
- * 跨 court 永远不算冲突(不同资源各画各的)。
68
- */
69
- export declare function bookingsOverlap(a: CalendarBookingSegmentInput, b: CalendarBookingSegmentInput): boolean;
70
- /**
71
- * 把 booking 整段转成「按日」的毫秒区间:
72
- * - `startMs = parseDate(date).getTime()`
73
- * - `endMs = parseDate(endDate ?? date).getTime() + 1 day`
74
- *
75
- * 用于资源 / 月视图这类「一格 = 一天」的视图:同一天内不同小时的两条 booking
76
- * 视觉上需要垂直 stack(占两个 lane),即使时间不重叠也不能合并到同一 lane。
77
- */
78
- export declare function getBookingDaySpanMs(item: CalendarBookingSegmentInput): {
79
- startMs: number;
80
- endMs: number;
81
- };
82
- /**
83
- * booking 的 day-span `[date, endDate]` 是否与 `[windowFirstKey, windowLastKey]` 相交。
84
- *
85
- * 用于 lane 抢占 / 行高计算阶段过滤掉与当前视口不相交的 booking:
86
- * 后端为支持跨日 banner 续画把 `booking_time_start_between` 的下界外推 30 天,
87
- * 这会把上月/前周的 booking 也带回 `bookings` 列表;视图层若直接用全量算 lane,
88
- * 切到「当月没数据但上月有」的资源行时会保留上月 lane 数 → 行高被撑高。
89
- *
90
- * 只比较 `YYYY-MM-DD` 字符串(同 `monthGrid` 的 key 格式),不构造 Date 对象。
91
- */
92
- export declare function bookingIntersectsDateWindow(item: {
93
- date?: unknown;
94
- endDate?: unknown;
95
- } | null | undefined, windowFirstKey: string, windowLastKey: string): boolean;
96
- /**
97
- * 将 booking 的 day-span 截断到窗口 `[windowFirstKey, windowLastKey]`,超出窗口的部分裁掉,
98
- * 用于月视图「按周独立 lane 抢占 + 跨周续画」:
99
- * - 与窗口完全不相交 → 返回 `null`;
100
- * - `date` 早于窗口 → 起点截到 `windowFirstKey`(视觉上 `clippedLeft`);
101
- * - `endDate` 晚于窗口 → 终点截到 `windowLastKey`(视觉上 `clippedRight`);
102
- * - 截断后只占一天的,回退为单日(`endDate` 设为 `undefined`)。
103
- *
104
- * 截断后的对象保留原 `id`、`courtId` 等字段,让 lane 抢占在窗口内独立判断重叠。
105
- */
106
- export declare function clipBookingDaySpanToWindow(item: CalendarBookingSegmentInput, windowFirstKey: string, windowLastKey: string): CalendarBookingSegmentInput | null;
107
- /**
108
- * 月 / 资源视图按日 lane:跨日 booking 在命中各日占**同一** lane;单日 booking 再逐日找空位。
109
- *
110
- * 1. 跨日优先(跨度长的先占),在 span 覆盖的每个自然日上取同一最小可用 lane;
111
- * 2. 单日 booking 仅在各自命中日抢剩余 lane,不影响跨日条的纵向对齐。
112
- */
113
- export declare function assignPerDateLanesCrossDayUnified(items: CalendarBookingSegmentInput[], dateKeysInOrder: string[]): {
114
- perDateLanes: Map<string, Map<string, number>>;
115
- laneCount: number;
116
- };
117
- /**
118
- * 通用 lane 分配:返回 `Map<itemId, laneIndex>` 与 `laneCount`。
119
- *
120
- * @param granularity
121
- * - `'hour'`(默认,周 / 日视图):用 `getBookingFullSpanMs`,同小时内不重叠的两条
122
- * booking 可以共享同一 lane(`bookingTime` 紧排)。
123
- * - `'day'`(资源 / 月视图):用 `getBookingDaySpanMs`,同一天的两条 booking 一定占两 lane,
124
- * 即使小时不重叠也要垂直 stack(一格只有一天宽,无法在水平方向区分)。
125
- *
126
- * 排序优先级(与设计约定一致):
127
- * 1. 跨日 booking 优先(先排,整段占顶 lane);
128
- * 2. 同类内按「跨度(endMs - startMs)降序」:跨度更长的先占 lane 0/1,
129
- * 保证视觉上"长 pill 顶贴",避免短 pill 把长 pill 推到下方造成"上方一周空白";
130
- * 3. 同跨度按 `startMs` 升序(更早开始的先占);
131
- * 4. 仍相同则按 `id` 字典序,保证渲染稳定。
132
- *
133
- * 然后逐条分配到第一个 `lastEndMs <= 当前 startMs` 的 lane(贪心区间着色)。
134
- */
135
- export declare function assignLanesByInterval(items: CalendarBookingSegmentInput[], granularity?: 'hour' | 'day'): {
136
- lanes: Map<string, number>;
137
- laneCount: number;
138
- };
139
- export declare function dayOccupancy(courtId: string, dateKey: string, bookings: CalendarBookingSegmentInput[], hourSlots: number[] | undefined, slotStepHours: number): Record<number, CalendarBookingSegmentInput | null>;
140
- export interface SelectedSlotLike {
141
- courtId: string;
142
- date: string;
143
- hour: number;
144
- }
145
- export declare function groupSelectedSlots(slots: SelectedSlotLike[], slotStepHours?: number): Array<{
146
- courtId: string;
147
- date: string;
148
- startHour: number;
149
- endHour: number;
150
- }>;
151
- /**
152
- * 日视图空闲格:仅当全部为同一 court、同一日,且时间上首尾相接成一段时返回 true(与 {@link groupSelectedSlots} 合并规则一致)。
153
- */
154
- export declare function isFreeSelectionContiguousSameResource(slots: SelectedSlotLike[], slotStepHours?: number): boolean;
155
- export declare function hasConflict(bookings: CalendarBookingSegmentInput[], courtId: string, date: string, startHour: number, endHour: number, ignoreId?: string | null): boolean;
156
- export declare function overlappingBookings(bookings: CalendarBookingSegmentInput[], courtId: string, date: string, startHour: number, endHour: number): CalendarBookingSegmentInput[];
157
- export declare function courtDaySummary(courtId: string, dateKey: string, bookings: CalendarBookingSegmentInput[], hourSlots: number[] | undefined, slotStepHours: number): {
158
- occupiedHours: number[];
159
- hasBlock: boolean;
160
- fullyBooked: boolean;
161
- items: CalendarBookingSegmentInput[];
162
- };
163
- export declare function sameSlot(a: SelectedSlotLike, b: SelectedSlotLike): boolean;
164
- /** 营业日 `dateStr` + 浮点小时(含半格)→ dayjs */
165
- export declare function dayAndHourToDayjs(dateStr: string, hourFloat: number): Dayjs;
166
- export declare function getDisplayStatusTag(item: CalendarBookingSegmentInput, dateKey: string): string | null;
167
- export declare function getLateMinutes(item: CalendarBookingSegmentInput, dateKey: string): number | null;
168
- export declare function currentTimeLabel(): string;
169
- export declare function formatDateLoose(str: string | undefined): string;
170
- export declare function formatTimelineStamp(value: string | undefined | null): {
171
- date: string;
172
- time: string;
173
- };
174
- /** 日视图 overlay 条(可原地写入 lane) */
175
- export declare type DayOverlayLaneMutable = {
176
- courtId: string;
177
- start: number;
178
- span: number;
179
- lane?: number;
180
- laneCount?: number;
181
- };
182
- /**
183
- * 同一 court 上时间重叠的 overlay 分配纵向 lane,避免多张卡片完全叠在同一矩形里。
184
- * 使用按开始时间排序 + 贪心:每条预约放入「上一条已结束时间不晚于本段开始」的最小编号线。
185
- */
186
- export declare function assignDayOverlapLanesInPlace(overlays: DayOverlayLaneMutable[]): void;
187
- /** 扫描时间轴:同一 court 在任一时刻的最大并行条数(用于行高,与分 lane 一致) */
188
- export declare function maxConcurrentBookingsOnCourt(overlays: Array<{
189
- courtId: string;
190
- start: number;
191
- span: number;
192
- }>, courtId: string): number;
193
- /** 并行超过 cap 时:cap 条内容 + 1 行「+N」占位 */
194
- export declare function effectiveDayOverlayDisplayLaneCount(rawConcurrent: number): number;
195
- /** 同一 court 下时间轴区间相交的 overlay 归为一簇(用于 3+N 合并展示) */
196
- export declare function clusterDayCourtOverlaysByOverlap<T extends {
197
- courtId: string;
198
- start: number;
199
- span: number;
200
- }>(overlays: T[], courtId: string): T[][];
201
- export declare function dayOverlayHiddenKey(item: {
202
- id?: string | number;
203
- } | null | undefined, dayKey: string, courtId: string): string;
204
- /**
205
- * 将 totalInner 像素整数分给 n 条竖向 lane(含缝),保证 Σheight + Σgap === totalInner,消除底部留白缝。
206
- */
207
- export declare function dayOverlayLaneMetrics(totalInner: number, laneCount: number, gap: number): {
208
- topFor: (lane: number) => number;
209
- heightFor: (lane: number) => number;
210
- };
211
- export interface BuildOverlayBookingRow {
212
- kind: string;
213
- id: string;
214
- }
215
- export interface BuiltDayOverlay {
216
- item: CalendarBookingSegmentInput;
217
- rowIndex: number;
218
- rowTop: number;
219
- rowHeight: number;
220
- courtId: string;
221
- start: number;
222
- end: number;
223
- span: number;
224
- continuesNext?: boolean;
225
- continuesPrev?: boolean;
226
- lane?: number;
227
- laneCount?: number;
228
- }
229
- export declare function buildOverlayBookings(visibleCourtRows: BuildOverlayBookingRow[], dayKey: string, bookings: CalendarBookingSegmentInput[], rowTopMap: Record<string, number> | undefined, hourSlots: number[] | undefined, dayRowHeights: number[], slotStepHours?: number): BuiltDayOverlay[];
230
- /** 日视图:按行高累加每行 rowTop(court / group) */
231
- export declare function buildDayRowTopMap(visibleCourtRows: Array<{
232
- id: string;
233
- }>, heights: number[]): Record<string, number>;
234
- /** 日历状态徽标:返回 i18n key + className;文案在 UI 层通过 tCal 解析,便于 utils 单测 */
235
- export declare function statusTagMetaParts(tag: string | null | undefined): {
236
- labelI18nKey: string;
237
- className: string;
238
- } | null;
239
- export declare type CalendarCourtNameRow = {
240
- id: string;
241
- name?: string | null;
242
- };
243
- export declare function getBookingDetailData(item: CalendarBookingSegmentInput, courtsList?: CalendarCourtNameRow[]): {
244
- rawSales: null;
245
- bookingId: string;
246
- orderNumber: string;
247
- shopOrderNumber: string;
248
- orderStatus: string;
249
- appointmentStatus: string;
250
- paymentStatus: string;
251
- customer: {
252
- id: null;
253
- name: string;
254
- email: string;
255
- phone: string;
256
- };
257
- guestCount: number;
258
- checkedInCount: number;
259
- guests: never[];
260
- schedule: {
261
- startDate: string;
262
- startTime: string;
263
- endDate: string;
264
- endTime: string;
265
- duration: number;
266
- arrivedAt: null;
267
- completedAt: null;
268
- };
269
- resources: never[];
270
- summaryItems: never[];
271
- items: never[];
272
- note: string;
273
- files: {
274
- form: never[];
275
- uploaded: never[];
276
- invoice: never[];
277
- };
278
- payments: never[];
279
- history: never[];
280
- summary: {};
281
- paymentSummary: {
282
- totalAmount: number;
283
- paidAmount: number;
284
- balanceAmount: number;
285
- currencySymbol: string;
286
- isFullyPaid: boolean;
287
- };
288
- itemSummary: {
289
- itemCount: number;
290
- itemQtyTotal: number;
291
- };
292
- headerSummary: {
293
- customerName: string;
294
- guestCount: number;
295
- checkedInCount: number;
296
- timeLabel: string;
297
- resourceLabel: string;
298
- };
299
- headerTags: {
300
- paymentTag: string;
301
- fulfillmentTag: string;
302
- hasNote: boolean;
303
- paymentStatus: string;
304
- orderStatus: string;
305
- };
306
- fileCount: number;
307
- canChangeCustomer: boolean;
308
- noteCount: number;
309
- noteGroups: {
310
- internal: never[];
311
- order: {
312
- id: string;
313
- label: string;
314
- text: string;
315
- }[];
316
- item: never[];
317
- };
318
- metaFlags: {
319
- itemsChanged: boolean;
320
- paymentsChanged: boolean;
321
- guestChanged: boolean;
322
- filesChanged: boolean;
323
- notesChanged: boolean;
324
- formChanged: boolean;
325
- uploadedChanged: boolean;
326
- invoiceChanged: boolean;
327
- historyChanged: boolean;
328
- };
329
- actions: never[];
330
- };
@@ -1,52 +0,0 @@
1
- /** 日视图:横向虚拟滚动时间轴 + 资源行,预约条按 lane 叠放与 +N 溢出 */
2
- import React from 'react';
3
- import { type TickFillMode } from '../utils/bookingCalendarAxis';
4
- import type { RecordBoardCalendarProps } from '../../../types';
5
- /** 日视图(含底部多选操作条) */
6
- export declare function BookingCalendarDayView(dayProps: {
7
- calendarProps: RecordBoardCalendarProps;
8
- isLight: boolean;
9
- view: string;
10
- anchorDate: Date;
11
- dayKey: string;
12
- hourSlots: number[];
13
- resolvedSlotMinutes: number;
14
- slotColWidth: number;
15
- firstTimelineHour: number;
16
- endTimelineExclusive: number;
17
- isBusinessHour: (h: number) => boolean;
18
- dayHourRemaining: Record<number, {
19
- remaining: number;
20
- total: number;
21
- ratio: number;
22
- }>;
23
- timelinePxPerHour: number;
24
- dayContentHeight: number;
25
- dayRowHeights: number[];
26
- visibleCourtRows: any[];
27
- overlayBookings: any[];
28
- dayOverlayOverflowPluses: any[];
29
- setCollapsedGroups: React.Dispatch<React.SetStateAction<any>>;
30
- visibleCourts: any[];
31
- bookings: any[];
32
- slotStepHours: number;
33
- isFreeSelected: (courtId: string, hour: number) => boolean;
34
- isBlockSelected: (courtId: string, hour: number) => boolean;
35
- toggleSlot: (courtId: string, hour: number) => void;
36
- handleDropMove: (courtId: string, date: string, hour: number) => void;
37
- hiddenDayOverlayIdSet: Set<string>;
38
- courtDayDisplayLaneCount: Record<string, number>;
39
- openBookingDetail: (item: any) => void;
40
- setDraggingItem: (item: any) => void;
41
- setNavDirection: (n: number) => void;
42
- commitAnchor: (d: Date) => void;
43
- setFocusedCourtId: (id: string | null) => void;
44
- setOverflowListModal: React.Dispatch<React.SetStateAction<any>>;
45
- selectedFreeSlots: any[];
46
- selectedBlockSlots: any[];
47
- focusedCourtId: string | null;
48
- /** >0 表示刚从周/月切入日视图,需将横向滚动对准「当前时间」(仅当 dayKey 为今天时生效) */
49
- dayTimelineScrollToNowToken: number;
50
- /** 预约条在主轴刻度上的填充方式(由 BookingCalendar 按视图默认解析后传入) */
51
- tickFillMode: TickFillMode;
52
- }): React.JSX.Element;
@@ -1,22 +0,0 @@
1
- import React from 'react';
2
- /**
3
- * 月视图:5 行 × 7 列。
4
- *
5
- * 跨日 booking 用 absolute overlay 跨日列 banner 渲染(M1:跨自然周边界续画 + 端部 ◀/▶):
6
- * - 每周内跨日 booking 占统一 lane,单日 booking 逐日填剩余空位;
7
- * - 行高内自适应 effectiveMaxLane,超出 → cell 级 `+N` tile;
8
- * - cell 层只负责日期 header / 点击跳日 / drop 改期,不再渲染 booking 列表(被 overlay 替代)。
9
- */
10
- export declare function BookingCalendarMonthView({ isLight, anchorDate, monthDays, bookings, goToDayFromCell, handleGridDropMove, setDraggingItem, openBookingDetail, setOverflowListModal, renderMonthWeekBooking, tickFillMode, }: {
11
- isLight: any;
12
- anchorDate: any;
13
- monthDays: any;
14
- bookings: any;
15
- goToDayFromCell: any;
16
- handleGridDropMove: any;
17
- setDraggingItem: any;
18
- openBookingDetail: any;
19
- setOverflowListModal: any;
20
- renderMonthWeekBooking: any;
21
- tickFillMode: any;
22
- }): React.JSX.Element;
@@ -1,57 +0,0 @@
1
- /**
2
- * 资源视图(按月):与日视图同款骨架——冻结左列 + 横向滚动 + sticky 顶部表头。
3
- *
4
- * 与日视图的唯一差异:
5
- * - 日视图:横轴 = 营业小时槽,cell = 一个小时;booking 通过 overlay 跨 cell 横铺。
6
- * - 资源视图:横轴 = 当月每一天,cell = 一个 (court, date);booking 通过 overlay 在 cell 内
7
- * 垂直 stack 渲染(最多 3 条 + `+N` 溢出 tile)。
8
- *
9
- * 性能策略(与日视图对齐):
10
- * - cell 是「轻 placeholder」:只渲染背景色 + selected ring + 空 dashed slot/Selected 文本。
11
- * - 所有 booking 卡片 / `+N` tile 由 `BookingOverlay` 单独 absolute 渲染,独立于 grid。
12
- * - 这样 grid 内 DOM 极轻,浏览器每帧 paint/layout 与日视图同档(cell 内含复杂 booking
13
- * 卡片时实测每列 ~7ms paint 成本,整月 30 列 → ~150ms;overlay 化后接近零)。
14
- *
15
- * 选中:与日视图 `toggleSlot(courtId, hour)` 等价的「`toggleResourceCell(courtId, dateKey)`」。
16
- * 选中态合并到 cell 自身 className(与日视图一致),不插入额外 grid item,避免 CSS Grid 整表 reflow。
17
- */
18
- import React from 'react';
19
- import { type TickFillMode } from '../utils/bookingCalendarAxis';
20
- import type { RecordBoardCalendarProps } from '../../../types';
21
- declare type ResourceCellPick = {
22
- courtId: string;
23
- dateKey: string;
24
- };
25
- export declare const BookingCalendarResourceView: React.MemoExoticComponent<typeof BookingCalendarResourceViewInner>;
26
- declare function BookingCalendarResourceViewInner({ calendarProps, isLight, anchorDate, monthDays, slotColWidth, bookings, visibleCourts, visibleCourtRows, hourSlots, slotStepHours, handleGridDropMove, openBookingDetail, setDraggingItem, setCollapsedGroups, setOverflowListModal, resourceMonthScrollToTodayToken, resourceDayHeaderRemaining, toggleResourceCell, selectedResourceCells, tickFillMode, }: {
27
- calendarProps: RecordBoardCalendarProps;
28
- isLight: boolean;
29
- anchorDate: Date;
30
- monthDays: Date[];
31
- slotColWidth: number;
32
- bookings: any[];
33
- visibleCourts: any[];
34
- visibleCourtRows: any[];
35
- hourSlots: number[];
36
- slotStepHours: number;
37
- handleGridDropMove: (dateKey: string, courtId?: string | null) => void;
38
- openBookingDetail: (item: any) => void;
39
- setDraggingItem: (item: any) => void;
40
- setCollapsedGroups: React.Dispatch<React.SetStateAction<any>>;
41
- setOverflowListModal: React.Dispatch<React.SetStateAction<any>>;
42
- /** 切入资源视图时递增,用于将横向滚动对准「今天」列 */
43
- resourceMonthScrollToTodayToken: number;
44
- /** 顶部表头当日空闲率(与日视图 freeRatio 同口径) */
45
- resourceDayHeaderRemaining: Record<string, {
46
- remaining: number;
47
- total: number;
48
- ratio: number;
49
- }>;
50
- /** 与日视图 `toggleSlot` 同义:点击 cell 切换 (court, date) 的整天选中态 */
51
- toggleResourceCell: (courtId: string, dateKey: string) => void;
52
- /** 当前所有「资源月视图」选中的 cell(同 court 连续多天 → SelectionBar 显示 Block/Create) */
53
- selectedResourceCells: ResourceCellPick[];
54
- /** 预约条在主轴刻度上的填充方式(由 BookingCalendar 按视图默认解析后传入) */
55
- tickFillMode: TickFillMode;
56
- }): React.JSX.Element;
57
- export {};
@@ -1,26 +0,0 @@
1
- import React from 'react';
2
- import type { RecordBoardCalendarProps } from '../../../types';
3
- import { type TickFillMode } from '../utils/bookingCalendarAxis';
4
- /**
5
- * 周视图:7 日网格 + 左侧分组(可折叠),单元格调起日视图;格内 drop 触发改期草稿。
6
- */
7
- export declare function BookingCalendarWeekView({ calendarProps, isLight, weekDays, bookings, courts, hourSlots, slotStepHours, visibleCourts, visibleCourtRows, isBusinessHour, goToDayFromCell, handleGridDropMove, openBookingDetail, setDraggingItem, setCollapsedGroups, setOverflowListModal, tickFillMode, }: {
8
- calendarProps: RecordBoardCalendarProps;
9
- isLight: boolean;
10
- weekDays: Date[];
11
- bookings: any[];
12
- courts: any[];
13
- hourSlots: number[];
14
- slotStepHours: number;
15
- visibleCourts: any[];
16
- visibleCourtRows: any[];
17
- isBusinessHour: (h: number) => boolean;
18
- goToDayFromCell: (d: Date, courtId: string | null, src: string) => void;
19
- handleGridDropMove: (dateKey: string, courtId?: string | null) => void;
20
- openBookingDetail: (item: any) => void;
21
- setDraggingItem: (item: any) => void;
22
- setCollapsedGroups: React.Dispatch<React.SetStateAction<any>>;
23
- setOverflowListModal: React.Dispatch<React.SetStateAction<any>>;
24
- /** 预约条在主轴刻度上的填充方式(由 BookingCalendar 按视图默认解析后传入) */
25
- tickFillMode: TickFillMode;
26
- }): React.JSX.Element;
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import './index.less';
3
- import type { RecordBoardContextValue } from '../../types';
4
- export interface RecordBoardPaginationProps extends Partial<Pick<RecordBoardContextValue, 'pagination' | 'total' | 'onPageChange' | 'loading'>> {
5
- className?: string;
6
- style?: React.CSSProperties;
7
- render?: (ctx: RecordBoardContextValue) => React.ReactNode;
8
- }
9
- /**
10
- * RecordBoard 下的分页:接入 packages/materials 的 Pagination,从 context 取 pagination / total / onPageChange;可透传 childComponentProps.pagination。
11
- * 当 context 中 pagination 缺失时使用默认分页,避免在 Storybook 或未完整注入 context 时报错。
12
- */
13
- declare const RecordBoardPagination: React.FC<RecordBoardPaginationProps>;
14
- export default RecordBoardPagination;