@pisell/materials 6.11.36 → 6.11.38

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 (200) 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/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +26 -56
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +26 -56
  11. package/es/components/PisellLayouts/index.d.ts +1 -1
  12. package/es/components/colorPicker/index.d.ts +0 -1
  13. package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
  14. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +2 -2
  15. package/es/components/dataSourceComponents/fields/RecordListWrapper/index.d.ts +1 -1
  16. package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
  17. package/es/components/dataSourceComponents/fields/Tabs/index.d.ts +1 -1
  18. package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
  19. package/es/components/dataSourceComponents/fields/index.d.ts +6 -6
  20. package/es/components/filter/components/items/index.d.ts +0 -1
  21. package/es/components/filter/components/items/text/Editor/index.d.ts +0 -1
  22. package/es/components/filter/components/items/text/Preview/index.d.ts +0 -1
  23. package/es/components/filter/components/items/text/index.d.ts +0 -1
  24. package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.d.ts +2 -1
  25. package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.js +47 -3
  26. package/es/components/pisellFloorMapLayout/types.d.ts +7 -7
  27. package/es/components/pisellFloorMapLayout/types.js +2 -2
  28. package/es/components/pisellRecordBoard/index.d.ts +1 -1
  29. package/es/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendar.d.ts +5 -0
  30. package/es/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendar.js +1039 -0
  31. package/es/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendar.less +323 -0
  32. package/es/components/pisellRecordBoard/shellFrame/Calendar/PisellRecordBoardCalendarView.d.ts +5 -1
  33. package/es/components/pisellRecordBoard/shellFrame/Calendar/PisellRecordBoardCalendarView.js +10 -10
  34. package/es/components/pisellRecordBoard/shellFrame/Calendar/bookingCalendarViewShared.d.ts +23 -0
  35. package/es/components/pisellRecordBoard/shellFrame/Calendar/bookingCalendarViewShared.js +287 -0
  36. package/es/components/pisellRecordBoard/shellFrame/Calendar/calendarI18n.d.ts +4 -0
  37. package/es/components/pisellRecordBoard/shellFrame/Calendar/calendarI18n.js +28 -0
  38. package/es/components/pisellRecordBoard/shellFrame/Calendar/calendarPersistGuard.d.ts +1 -1
  39. package/es/components/pisellRecordBoard/shellFrame/Calendar/const/bookingCalendarConstants.d.ts +36 -0
  40. package/es/components/pisellRecordBoard/shellFrame/Calendar/const/bookingCalendarConstants.js +38 -0
  41. package/es/components/pisellRecordBoard/shellFrame/Calendar/index.d.ts +3 -0
  42. package/es/components/pisellRecordBoard/shellFrame/Calendar/index.js +3 -0
  43. package/es/components/pisellRecordBoard/shellFrame/Calendar/modal/MoveConfirmModal.d.ts +17 -0
  44. package/es/components/pisellRecordBoard/shellFrame/Calendar/modal/MoveConfirmModal.js +197 -0
  45. package/es/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowListModal.d.ts +17 -0
  46. package/es/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowListModal.js +65 -0
  47. package/es/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowPopover.d.ts +9 -0
  48. package/es/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowPopover.js +52 -0
  49. package/es/components/pisellRecordBoard/shellFrame/Calendar/utils/BookingCalendarStyle.d.ts +10 -0
  50. package/es/components/pisellRecordBoard/shellFrame/Calendar/utils/BookingCalendarStyle.js +58 -0
  51. package/es/components/pisellRecordBoard/shellFrame/Calendar/utils/bookingCalendarDateUtils.d.ts +232 -0
  52. package/es/components/pisellRecordBoard/shellFrame/Calendar/utils/bookingCalendarDateUtils.js +735 -0
  53. package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarDaySelectionBar.d.ts +13 -0
  54. package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarDaySelectionBar.js +37 -0
  55. package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarDayView.d.ts +56 -0
  56. package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarDayView.js +682 -0
  57. package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarMonthView.d.ts +18 -0
  58. package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarMonthView.js +155 -0
  59. package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarWeekView.d.ts +27 -0
  60. package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarWeekView.js +259 -0
  61. package/es/components/pisellRecordBoard/shellFrame/Calendar/view/bookingCalendarDayViewContext.d.ts +12 -0
  62. package/es/components/pisellRecordBoard/shellFrame/Calendar/view/bookingCalendarDayViewContext.js +19 -0
  63. package/es/components/pisellRecordBoard/shellFrame/ResourceWall/NoteTicker.d.ts +2 -1
  64. package/es/components/pisellRecordBoard/shellFrame/ResourceWall/NoteTicker.js +44 -14
  65. package/es/components/pisellRecordBoard/shellFrame/ResourceWall/PisellRecordBoardResourceWallView.d.ts +4 -2
  66. package/es/components/pisellRecordBoard/shellFrame/ResourceWall/PisellRecordBoardResourceWallView.js +117 -125
  67. package/es/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallControlPanel.d.ts +3 -5
  68. package/es/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallControlPanel.js +71 -352
  69. package/es/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallControlPanelColorTab.d.ts +17 -0
  70. package/es/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallControlPanelColorTab.js +143 -0
  71. package/es/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallControlPanelLayoutTab.d.ts +28 -0
  72. package/es/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallControlPanelLayoutTab.js +128 -0
  73. package/es/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallViewport.less +8 -0
  74. package/es/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallViewportToolbar.d.ts +18 -0
  75. package/es/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallViewportToolbar.js +115 -0
  76. package/es/components/pisellRecordBoard/shellFrame/ResourceWall/VenueWallCard.d.ts +6 -4
  77. package/es/components/pisellRecordBoard/shellFrame/ResourceWall/VenueWallCard.js +63 -120
  78. package/es/components/pisellRecordBoard/shellFrame/ResourceWall/resourceWallConstants.d.ts +2 -0
  79. package/es/components/pisellRecordBoard/shellFrame/ResourceWall/resourceWallConstants.js +2 -0
  80. package/es/components/pisellRecordBoard/shellFrame/ResourceWall/venueWallCardPresentation.d.ts +42 -0
  81. package/es/components/pisellRecordBoard/shellFrame/ResourceWall/venueWallCardPresentation.js +114 -0
  82. package/es/components/pisellRecordBoard/shellFrame/ResourceWall/venueWallUtils.d.ts +26 -0
  83. package/es/components/pisellRecordBoard/shellFrame/ResourceWall/venueWallUtils.js +54 -1
  84. package/es/components/pisellRecordBoard/shellFrame/ToolBar/index.js +67 -12
  85. package/es/components/pisellRecordBoard/shellFrame/index.js +34 -7
  86. package/es/components/pisellRecordBoard/types.d.ts +97 -4
  87. package/es/components/pisellRecordBoard/types.js +18 -2
  88. package/es/components/pisellReservationScheduleBand/PisellReservationScheduleBand.less +34 -2
  89. package/es/components/pisellShellFrame/PisellShellFrame.less +5 -2
  90. package/es/components/table/Table/SelectField/index.d.ts +0 -1
  91. package/es/components/table/Table/tableConfig/summary/index.d.ts +0 -1
  92. package/es/hooks/useResponsive.d.ts +1 -1
  93. package/es/index.d.ts +1 -1
  94. package/es/locales/en-US.d.ts +74 -0
  95. package/es/locales/en-US.js +76 -1
  96. package/es/locales/ja.d.ts +74 -0
  97. package/es/locales/ja.js +75 -0
  98. package/es/locales/pt.d.ts +74 -0
  99. package/es/locales/pt.js +75 -0
  100. package/es/locales/zh-CN.d.ts +74 -0
  101. package/es/locales/zh-CN.js +76 -1
  102. package/es/locales/zh-TW.d.ts +74 -0
  103. package/es/locales/zh-TW.js +76 -1
  104. package/es/pisell-materials.tw.css +1 -1
  105. package/lib/components/PisellLayouts/index.d.ts +1 -1
  106. package/lib/components/colorPicker/index.d.ts +0 -1
  107. package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
  108. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +2 -2
  109. package/lib/components/dataSourceComponents/fields/RecordListWrapper/index.d.ts +1 -1
  110. package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
  111. package/lib/components/dataSourceComponents/fields/Tabs/index.d.ts +1 -1
  112. package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
  113. package/lib/components/dataSourceComponents/fields/index.d.ts +6 -6
  114. package/lib/components/filter/components/items/index.d.ts +0 -1
  115. package/lib/components/filter/components/items/text/Editor/index.d.ts +0 -1
  116. package/lib/components/filter/components/items/text/Preview/index.d.ts +0 -1
  117. package/lib/components/filter/components/items/text/index.d.ts +0 -1
  118. package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.d.ts +2 -1
  119. package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.js +1 -1
  120. package/lib/components/pisellFloorMapLayout/types.d.ts +7 -7
  121. package/lib/components/pisellRecordBoard/index.d.ts +1 -1
  122. package/lib/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendar.d.ts +5 -0
  123. package/lib/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendar.js +892 -0
  124. package/lib/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendar.less +323 -0
  125. package/lib/components/pisellRecordBoard/shellFrame/Calendar/PisellRecordBoardCalendarView.d.ts +5 -1
  126. package/lib/components/pisellRecordBoard/shellFrame/Calendar/PisellRecordBoardCalendarView.js +7 -6
  127. package/lib/components/pisellRecordBoard/shellFrame/Calendar/bookingCalendarViewShared.d.ts +23 -0
  128. package/lib/components/pisellRecordBoard/shellFrame/Calendar/bookingCalendarViewShared.js +268 -0
  129. package/lib/components/pisellRecordBoard/shellFrame/Calendar/calendarI18n.d.ts +4 -0
  130. package/lib/components/pisellRecordBoard/shellFrame/Calendar/calendarI18n.js +53 -0
  131. package/lib/components/pisellRecordBoard/shellFrame/Calendar/calendarPersistGuard.d.ts +1 -1
  132. package/lib/components/pisellRecordBoard/shellFrame/Calendar/const/bookingCalendarConstants.d.ts +36 -0
  133. package/lib/components/pisellRecordBoard/shellFrame/Calendar/const/bookingCalendarConstants.js +98 -0
  134. package/lib/components/pisellRecordBoard/shellFrame/Calendar/index.d.ts +3 -0
  135. package/lib/components/pisellRecordBoard/shellFrame/Calendar/modal/MoveConfirmModal.d.ts +17 -0
  136. package/lib/components/pisellRecordBoard/shellFrame/Calendar/modal/MoveConfirmModal.js +306 -0
  137. package/lib/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowListModal.d.ts +17 -0
  138. package/lib/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowListModal.js +111 -0
  139. package/lib/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowPopover.d.ts +9 -0
  140. package/lib/components/pisellRecordBoard/shellFrame/Calendar/modal/OverflowPopover.js +96 -0
  141. package/lib/components/pisellRecordBoard/shellFrame/Calendar/utils/BookingCalendarStyle.d.ts +10 -0
  142. package/lib/components/pisellRecordBoard/shellFrame/Calendar/utils/BookingCalendarStyle.js +92 -0
  143. package/lib/components/pisellRecordBoard/shellFrame/Calendar/utils/bookingCalendarDateUtils.d.ts +232 -0
  144. package/lib/components/pisellRecordBoard/shellFrame/Calendar/utils/bookingCalendarDateUtils.js +666 -0
  145. package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarDaySelectionBar.d.ts +13 -0
  146. package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarDaySelectionBar.js +90 -0
  147. package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarDayView.d.ts +56 -0
  148. package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarDayView.js +812 -0
  149. package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarMonthView.d.ts +18 -0
  150. package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarMonthView.js +219 -0
  151. package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarWeekView.d.ts +27 -0
  152. package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarWeekView.js +352 -0
  153. package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/bookingCalendarDayViewContext.d.ts +12 -0
  154. package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/bookingCalendarDayViewContext.js +57 -0
  155. package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/NoteTicker.d.ts +2 -1
  156. package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/NoteTicker.js +44 -9
  157. package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/PisellRecordBoardResourceWallView.d.ts +4 -2
  158. package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/PisellRecordBoardResourceWallView.js +60 -142
  159. package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallControlPanel.d.ts +3 -5
  160. package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallControlPanel.js +40 -269
  161. package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallControlPanelColorTab.d.ts +17 -0
  162. package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallControlPanelColorTab.js +163 -0
  163. package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallControlPanelLayoutTab.d.ts +28 -0
  164. package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallControlPanelLayoutTab.js +136 -0
  165. package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallViewport.less +8 -0
  166. package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallViewportToolbar.d.ts +18 -0
  167. package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/ResourceWallViewportToolbar.js +175 -0
  168. package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/VenueWallCard.d.ts +6 -4
  169. package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/VenueWallCard.js +61 -88
  170. package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/resourceWallConstants.d.ts +2 -0
  171. package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/resourceWallConstants.js +29 -0
  172. package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/venueWallCardPresentation.d.ts +42 -0
  173. package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/venueWallCardPresentation.js +139 -0
  174. package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/venueWallUtils.d.ts +26 -0
  175. package/lib/components/pisellRecordBoard/shellFrame/ResourceWall/venueWallUtils.js +31 -3
  176. package/lib/components/pisellRecordBoard/shellFrame/ToolBar/index.js +50 -5
  177. package/lib/components/pisellRecordBoard/shellFrame/index.js +29 -13
  178. package/lib/components/pisellRecordBoard/types.d.ts +97 -4
  179. package/lib/components/pisellReservationScheduleBand/PisellReservationScheduleBand.less +34 -2
  180. package/lib/components/pisellShellFrame/PisellShellFrame.less +5 -2
  181. package/lib/components/table/Table/SelectField/index.d.ts +0 -1
  182. package/lib/components/table/Table/tableConfig/summary/index.d.ts +0 -1
  183. package/lib/hooks/useResponsive.d.ts +1 -1
  184. package/lib/index.d.ts +1 -1
  185. package/lib/locales/en-US.d.ts +74 -0
  186. package/lib/locales/en-US.js +76 -1
  187. package/lib/locales/ja.d.ts +74 -0
  188. package/lib/locales/ja.js +75 -0
  189. package/lib/locales/pt.d.ts +74 -0
  190. package/lib/locales/pt.js +75 -0
  191. package/lib/locales/zh-CN.d.ts +74 -0
  192. package/lib/locales/zh-CN.js +76 -1
  193. package/lib/locales/zh-TW.d.ts +74 -0
  194. package/lib/locales/zh-TW.js +76 -1
  195. package/lib/pisell-materials.tw.css +1 -1
  196. package/package.json +3 -4
  197. package/es/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendarDemo.d.ts +0 -3
  198. package/es/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendarDemo.js +0 -6233
  199. package/lib/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendarDemo.d.ts +0 -3
  200. package/lib/components/pisellRecordBoard/shellFrame/Calendar/BookingCalendarDemo.js +0 -7079
@@ -0,0 +1,735 @@
1
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
2
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
7
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
8
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
9
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
10
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
11
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
+ import dayjs from 'dayjs';
13
+ import { buildCalendarTimelineSlotStartsFromRange } from "../../../../pisellTimeNavigator/utils";
14
+ import { tCal } from "../calendarI18n";
15
+ import { DAY_OVERLAY_VISIBLE_BOOKING_CAP, dayRowHeight, DEFAULT_CALENDAR_TIMELINE, timeSliceMinutes } from "../const/bookingCalendarConstants";
16
+
17
+ /**
18
+ * 日历日期与时间轴纯函数:`fmtDate`、占用矩阵、月格、overlay 分段、周范围等,供 BookingCalendar 三视图共用。
19
+ */
20
+
21
+ /** 与 {@link RecordBoardCalendarBookingLike} 一致,并支持跨日 endDate */
22
+
23
+ export function fmtDate(date) {
24
+ var y = date.getFullYear();
25
+ var m = "".concat(date.getMonth() + 1).padStart(2, '0');
26
+ var d = "".concat(date.getDate()).padStart(2, '0');
27
+ return "".concat(y, "-").concat(m, "-").concat(d);
28
+ }
29
+
30
+ /** 本地当前日期键与「日历时」小数小时,用于状态徽标与当前时刻线 */
31
+ export function getViewNowReference() {
32
+ var d = new Date();
33
+ return {
34
+ dateKey: fmtDate(d),
35
+ hourFloat: d.getHours() + d.getMinutes() / 60 + d.getSeconds() / 3600
36
+ };
37
+ }
38
+ export function parseDate(str) {
39
+ var _str$split$map = str.split('-').map(Number),
40
+ _str$split$map2 = _slicedToArray(_str$split$map, 3),
41
+ y = _str$split$map2[0],
42
+ m = _str$split$map2[1],
43
+ d = _str$split$map2[2];
44
+ return new Date(y, m - 1, d);
45
+ }
46
+ export function addDays(date, n) {
47
+ var next = new Date(date);
48
+ next.setDate(next.getDate() + n);
49
+ return next;
50
+ }
51
+ export function startOfWeek(date) {
52
+ var d = new Date(date);
53
+ var day = d.getDay();
54
+ var diff = day === 0 ? -6 : 1 - day;
55
+ d.setDate(d.getDate() + diff);
56
+ d.setHours(0, 0, 0, 0);
57
+ return d;
58
+ }
59
+ export function rangeDays(anchor) {
60
+ var start = startOfWeek(anchor);
61
+ return Array.from({
62
+ length: 7
63
+ }, function (_, i) {
64
+ return addDays(start, i);
65
+ });
66
+ }
67
+ export function isHourInTimelineSlots(hour, hourSlots) {
68
+ if (!(hourSlots !== null && hourSlots !== void 0 && hourSlots.length)) return false;
69
+ return hourSlots.some(function (x) {
70
+ return Math.abs(x - hour) < 1e-6;
71
+ });
72
+ }
73
+ export function formatHourLabel(hour) {
74
+ var totalMin = Math.round(hour * 60);
75
+ var h = Math.floor(totalMin / 60);
76
+ var m = totalMin % 60;
77
+ var clockH = (h % 24 + 24) % 24;
78
+ return "".concat(String(clockH).padStart(2, '0'), ":").concat(String(m).padStart(2, '0'));
79
+ }
80
+ export function buildTimeOptions() {
81
+ var start = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 8;
82
+ var end = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 20;
83
+ var sliceMinutes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : timeSliceMinutes;
84
+ var out = [];
85
+ for (var m = start * 60; m <= end * 60; m += sliceMinutes) out.push(m / 60);
86
+ return out;
87
+ }
88
+ export function monthGrid(date, bookings) {
89
+ var courtsList = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
90
+ var hourSlotsIn = arguments.length > 3 ? arguments[3] : undefined;
91
+ var slotStepHours = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
92
+ var hourSlots = hourSlotsIn && hourSlotsIn.length ? hourSlotsIn : buildCalendarTimelineSlotStartsFromRange(DEFAULT_CALENDAR_TIMELINE, date, 60);
93
+ var year = date.getFullYear();
94
+ var month = date.getMonth();
95
+ var first = new Date(year, month, 1);
96
+ var start = startOfWeek(first);
97
+ var days = Array.from({
98
+ length: 35
99
+ }, function (_, i) {
100
+ return addDays(start, i);
101
+ });
102
+ return days.map(function (day) {
103
+ var key = fmtDate(day);
104
+ var dayBookings = bookings.filter(function (b) {
105
+ return b.date === key && b.kind === 'booking';
106
+ });
107
+ var blocks = bookings.filter(function (b) {
108
+ return b.date === key && b.kind === 'block';
109
+ });
110
+ var fullyBookedCourts = courtsList.filter(function (court) {
111
+ var _hourSlots$length;
112
+ var items = bookings.filter(function (b) {
113
+ return b.courtId === court.id && b.date === key;
114
+ });
115
+ var occupied = new Set();
116
+ items.forEach(function (b) {
117
+ (hourSlots || []).forEach(function (slotStart) {
118
+ var seg = getBookingSegmentForDate(b, key);
119
+ if (seg && seg.startHour < slotStart + slotStepHours && seg.endHour > slotStart) {
120
+ occupied.add(slotStart);
121
+ }
122
+ });
123
+ });
124
+ var slotCount = (_hourSlots$length = hourSlots === null || hourSlots === void 0 ? void 0 : hourSlots.length) !== null && _hourSlots$length !== void 0 ? _hourSlots$length : 14;
125
+ return occupied.size >= slotCount;
126
+ }).length;
127
+ return {
128
+ date: day,
129
+ key: key,
130
+ inMonth: day.getMonth() === month,
131
+ bookingCount: dayBookings.length,
132
+ blockCount: blocks.length,
133
+ fullyBooked: fullyBookedCourts >= courtsList.length
134
+ };
135
+ });
136
+ }
137
+ export function getBookingSegmentForDate(item, dateKey) {
138
+ if (!item.endDate || item.endDate === item.date) {
139
+ if (item.date !== dateKey) return null;
140
+ return {
141
+ startHour: item.startHour,
142
+ endHour: item.endHour,
143
+ continuesPrev: false,
144
+ continuesNext: false
145
+ };
146
+ }
147
+ if (dateKey < item.date || dateKey > item.endDate) return null;
148
+ if (dateKey === item.date) return {
149
+ startHour: item.startHour,
150
+ endHour: 24,
151
+ continuesPrev: false,
152
+ continuesNext: true
153
+ };
154
+ if (dateKey === item.endDate) return {
155
+ startHour: 0,
156
+ endHour: item.endHour,
157
+ continuesPrev: true,
158
+ continuesNext: false
159
+ };
160
+ return {
161
+ startHour: 0,
162
+ endHour: 24,
163
+ continuesPrev: true,
164
+ continuesNext: true
165
+ };
166
+ }
167
+ export function dayOccupancy(courtId, dateKey, bookings, hourSlots, slotStepHours) {
168
+ var items = bookings.filter(function (b) {
169
+ return b.courtId === courtId && getBookingSegmentForDate(b, dateKey);
170
+ });
171
+ var map = {};
172
+ var stepH = slotStepHours > 0 ? slotStepHours : 1;
173
+ (hourSlots || []).forEach(function (hour) {
174
+ map[hour] = items.find(function (b) {
175
+ var seg = getBookingSegmentForDate(b, dateKey);
176
+ return seg && seg.startHour < hour + stepH && seg.endHour > hour;
177
+ }) || null;
178
+ });
179
+ return map;
180
+ }
181
+ export function groupSelectedSlots(slots) {
182
+ var slotStepHours = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
183
+ var stepH = slotStepHours > 0 ? slotStepHours : 1;
184
+ var sorted = _toConsumableArray(slots).sort(function (a, b) {
185
+ if (a.date !== b.date) return a.date.localeCompare(b.date);
186
+ if (a.courtId !== b.courtId) return a.courtId.localeCompare(b.courtId);
187
+ return a.hour - b.hour;
188
+ });
189
+ var groups = [];
190
+ sorted.forEach(function (slot) {
191
+ var prev = groups[groups.length - 1];
192
+ if (prev && prev.courtId === slot.courtId && prev.date === slot.date && Math.abs(prev.endHour - slot.hour) < 1e-6) prev.endHour = slot.hour + stepH;else groups.push({
193
+ courtId: slot.courtId,
194
+ date: slot.date,
195
+ startHour: slot.hour,
196
+ endHour: slot.hour + stepH
197
+ });
198
+ });
199
+ return groups;
200
+ }
201
+
202
+ /**
203
+ * 日视图空闲格:仅当全部为同一 court、同一日,且时间上首尾相接成一段时返回 true(与 {@link groupSelectedSlots} 合并规则一致)。
204
+ */
205
+ export function isFreeSelectionContiguousSameResource(slots) {
206
+ var slotStepHours = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
207
+ if (!Array.isArray(slots) || slots.length === 0) return false;
208
+ return groupSelectedSlots(slots, slotStepHours).length === 1;
209
+ }
210
+ export function hasConflict(bookings, courtId, date, startHour, endHour) {
211
+ var ignoreId = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;
212
+ return bookings.some(function (b) {
213
+ if (b.id === ignoreId) return false;
214
+ if (b.kind !== 'booking') return false;
215
+ if (b.courtId !== courtId || b.date !== date) return false;
216
+ return !(endHour <= b.startHour || startHour >= b.endHour);
217
+ });
218
+ }
219
+ export function overlappingBookings(bookings, courtId, date, startHour, endHour) {
220
+ return bookings.filter(function (b) {
221
+ if (b.kind !== 'booking') return false;
222
+ if (b.courtId !== courtId || b.date !== date) return false;
223
+ return !(endHour <= b.startHour || startHour >= b.endHour);
224
+ });
225
+ }
226
+ export function courtDaySummary(courtId, dateKey, bookings, hourSlots, slotStepHours) {
227
+ var _hourSlots$length2;
228
+ var occ = dayOccupancy(courtId, dateKey, bookings, hourSlots, slotStepHours);
229
+ var items = bookings.filter(function (b) {
230
+ return b.courtId === courtId && b.date === dateKey;
231
+ }).sort(function (a, b) {
232
+ return a.startHour - b.startHour;
233
+ });
234
+ var occupiedHours = (hourSlots || []).filter(function (h) {
235
+ return occ[h] && isHourInTimelineSlots(h, hourSlots);
236
+ });
237
+ var hasBlock = occupiedHours.some(function (h) {
238
+ var _occ$h;
239
+ return ((_occ$h = occ[h]) === null || _occ$h === void 0 ? void 0 : _occ$h.kind) === 'block';
240
+ });
241
+ var slotCount = (_hourSlots$length2 = hourSlots === null || hourSlots === void 0 ? void 0 : hourSlots.length) !== null && _hourSlots$length2 !== void 0 ? _hourSlots$length2 : 0;
242
+ var fullyBooked = slotCount > 0 && occupiedHours.length >= slotCount;
243
+ return {
244
+ occupiedHours: occupiedHours,
245
+ hasBlock: hasBlock,
246
+ fullyBooked: fullyBooked,
247
+ items: items
248
+ };
249
+ }
250
+ export function sameSlot(a, b) {
251
+ return a.courtId === b.courtId && a.date === b.date && a.hour === b.hour;
252
+ }
253
+
254
+ /** 营业日 `dateStr` + 浮点小时(含半格)→ dayjs */
255
+ export function dayAndHourToDayjs(dateStr, hourFloat) {
256
+ var h = Math.floor(hourFloat);
257
+ var m = Math.round((hourFloat - h) * 60);
258
+ var mm = Math.min(59, Math.max(0, m));
259
+ return dayjs("".concat(dateStr, " ").concat(String(h).padStart(2, '0'), ":").concat(String(mm).padStart(2, '0')), 'YYYY-MM-DD HH:mm');
260
+ }
261
+ export function getDisplayStatusTag(item, dateKey) {
262
+ if (item.kind !== 'booking') return item.statusTag || null;
263
+ if (item.statusTag === 'checked_in' || item.statusTag === 'cancel') return item.statusTag;
264
+ var _getViewNowReference = getViewNowReference(),
265
+ todayKey = _getViewNowReference.dateKey,
266
+ nowHour = _getViewNowReference.hourFloat;
267
+ if (dateKey !== todayKey) return item.statusTag || null;
268
+ var seg = getBookingSegmentForDate(item, dateKey);
269
+ if (!seg) return item.statusTag || null;
270
+ var lateThreshold = item.startHour + 5 / 60;
271
+ if (nowHour > seg.endHour) return 'no_show';
272
+ if (nowHour > lateThreshold) return 'late';
273
+ return item.statusTag || null;
274
+ }
275
+ export function getLateMinutes(item, dateKey) {
276
+ if (getDisplayStatusTag(item, dateKey) !== 'late') return null;
277
+ var seg = getBookingSegmentForDate(item, dateKey);
278
+ if (!seg) return null;
279
+ var lateThreshold = seg.startHour + 5 / 60;
280
+ var _getViewNowReference2 = getViewNowReference(),
281
+ nowHour = _getViewNowReference2.hourFloat;
282
+ return Math.max(1, Math.floor((nowHour - lateThreshold) * 60));
283
+ }
284
+ export function currentTimeLabel() {
285
+ var d = new Date();
286
+ return "".concat(String(d.getHours()).padStart(2, '0'), ":").concat(String(d.getMinutes()).padStart(2, '0'));
287
+ }
288
+ export function formatDateLoose(str) {
289
+ if (!str) return '';
290
+ var d = parseDate(str);
291
+ return "".concat(d.getFullYear(), " ").concat(String(d.getMonth() + 1).padStart(2, '0'), " ").concat(String(d.getDate()).padStart(2, '0'));
292
+ }
293
+ export function formatTimelineStamp(value) {
294
+ if (!value) return {
295
+ date: '--',
296
+ time: '--'
297
+ };
298
+ var normalized = String(value).replace('T', ' ');
299
+ var _normalized$split = normalized.split(' '),
300
+ _normalized$split2 = _slicedToArray(_normalized$split, 2),
301
+ _normalized$split2$ = _normalized$split2[0],
302
+ date = _normalized$split2$ === void 0 ? '--' : _normalized$split2$,
303
+ _normalized$split2$2 = _normalized$split2[1],
304
+ time = _normalized$split2$2 === void 0 ? '--' : _normalized$split2$2;
305
+ return {
306
+ date: date,
307
+ time: time.slice(0, 5) || '--'
308
+ };
309
+ }
310
+
311
+ /** 日视图 overlay 条(可原地写入 lane) */
312
+
313
+ /**
314
+ * 同一 court 上时间重叠的 overlay 分配纵向 lane,避免多张卡片完全叠在同一矩形里。
315
+ * 使用按开始时间排序 + 贪心:每条预约放入「上一条已结束时间不晚于本段开始」的最小编号线。
316
+ */
317
+ export function assignDayOverlapLanesInPlace(overlays) {
318
+ var byCourt = new Map();
319
+ var _iterator = _createForOfIteratorHelper(overlays),
320
+ _step;
321
+ try {
322
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
323
+ var _o3 = _step.value;
324
+ var _list = byCourt.get(_o3.courtId);
325
+ if (_list) _list.push(_o3);else byCourt.set(_o3.courtId, [_o3]);
326
+ }
327
+ } catch (err) {
328
+ _iterator.e(err);
329
+ } finally {
330
+ _iterator.f();
331
+ }
332
+ for (var _i = 0, _Array$from = Array.from(byCourt.values()); _i < _Array$from.length; _i++) {
333
+ var list = _Array$from[_i];
334
+ list.sort(function (a, b) {
335
+ if (a.start !== b.start) return a.start - b.start;
336
+ return b.span - a.span;
337
+ });
338
+ var laneEnds = [];
339
+ var _iterator2 = _createForOfIteratorHelper(list),
340
+ _step2;
341
+ try {
342
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
343
+ var o = _step2.value;
344
+ var oEnd = o.start + o.span;
345
+ var _lane = 0;
346
+ while (_lane < laneEnds.length && laneEnds[_lane] > o.start) {
347
+ _lane++;
348
+ }
349
+ if (_lane === laneEnds.length) {
350
+ laneEnds.push(oEnd);
351
+ } else {
352
+ laneEnds[_lane] = oEnd;
353
+ }
354
+ o.lane = _lane;
355
+ }
356
+ } catch (err) {
357
+ _iterator2.e(err);
358
+ } finally {
359
+ _iterator2.f();
360
+ }
361
+ var maxL = 0;
362
+ var _iterator3 = _createForOfIteratorHelper(list),
363
+ _step3;
364
+ try {
365
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
366
+ var _o$lane;
367
+ var _o = _step3.value;
368
+ maxL = Math.max(maxL, (_o$lane = _o.lane) !== null && _o$lane !== void 0 ? _o$lane : 0);
369
+ }
370
+ } catch (err) {
371
+ _iterator3.e(err);
372
+ } finally {
373
+ _iterator3.f();
374
+ }
375
+ var laneCount = Math.max(1, maxL + 1);
376
+ var _iterator4 = _createForOfIteratorHelper(list),
377
+ _step4;
378
+ try {
379
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
380
+ var _o2 = _step4.value;
381
+ _o2.laneCount = laneCount;
382
+ }
383
+ } catch (err) {
384
+ _iterator4.e(err);
385
+ } finally {
386
+ _iterator4.f();
387
+ }
388
+ }
389
+ }
390
+
391
+ /** 扫描时间轴:同一 court 在任一时刻的最大并行条数(用于行高,与分 lane 一致) */
392
+ export function maxConcurrentBookingsOnCourt(overlays, courtId) {
393
+ var ev = [];
394
+ var _iterator5 = _createForOfIteratorHelper(overlays),
395
+ _step5;
396
+ try {
397
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
398
+ var o = _step5.value;
399
+ if (o.courtId !== courtId) continue;
400
+ ev.push({
401
+ t: o.start,
402
+ d: 1
403
+ });
404
+ ev.push({
405
+ t: o.start + o.span,
406
+ d: -1
407
+ });
408
+ }
409
+ } catch (err) {
410
+ _iterator5.e(err);
411
+ } finally {
412
+ _iterator5.f();
413
+ }
414
+ ev.sort(function (a, b) {
415
+ if (a.t !== b.t) return a.t - b.t;
416
+ return b.d - a.d;
417
+ });
418
+ var c = 0;
419
+ var m = 0;
420
+ for (var _i2 = 0, _ev = ev; _i2 < _ev.length; _i2++) {
421
+ var e = _ev[_i2];
422
+ c += e.d;
423
+ m = Math.max(m, c);
424
+ }
425
+ return Math.max(1, m);
426
+ }
427
+
428
+ /** 并行超过 cap 时:cap 条内容 + 1 行「+N」占位 */
429
+ export function effectiveDayOverlayDisplayLaneCount(rawConcurrent) {
430
+ if (rawConcurrent <= DAY_OVERLAY_VISIBLE_BOOKING_CAP) return Math.max(1, rawConcurrent);
431
+ return DAY_OVERLAY_VISIBLE_BOOKING_CAP + 1;
432
+ }
433
+
434
+ /** 同一 court 下时间轴区间相交的 overlay 归为一簇(用于 3+N 合并展示) */
435
+ export function clusterDayCourtOverlaysByOverlap(overlays, courtId) {
436
+ var list = overlays.filter(function (o) {
437
+ return o.courtId === courtId;
438
+ });
439
+ if (!list.length) return [];
440
+ var sorted = _toConsumableArray(list).sort(function (a, b) {
441
+ if (a.start !== b.start) return a.start - b.start;
442
+ return a.start + a.span - (b.start + b.span);
443
+ });
444
+ var clusters = [];
445
+ var cur = [];
446
+ var curMaxEnd = -Infinity;
447
+ var _iterator6 = _createForOfIteratorHelper(sorted),
448
+ _step6;
449
+ try {
450
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
451
+ var o = _step6.value;
452
+ var oe = o.start + o.span;
453
+ if (!cur.length) {
454
+ cur = [o];
455
+ curMaxEnd = oe;
456
+ continue;
457
+ }
458
+ if (o.start < curMaxEnd - 1e-9) {
459
+ cur.push(o);
460
+ curMaxEnd = Math.max(curMaxEnd, oe);
461
+ } else {
462
+ clusters.push(cur);
463
+ cur = [o];
464
+ curMaxEnd = oe;
465
+ }
466
+ }
467
+ } catch (err) {
468
+ _iterator6.e(err);
469
+ } finally {
470
+ _iterator6.f();
471
+ }
472
+ if (cur.length) clusters.push(cur);
473
+ return clusters;
474
+ }
475
+ export function dayOverlayHiddenKey(item, dayKey, courtId) {
476
+ var id = (item === null || item === void 0 ? void 0 : item.id) != null ? String(item.id) : '';
477
+ return "".concat(String(courtId), "\0").concat(id, "\0").concat(dayKey);
478
+ }
479
+
480
+ /**
481
+ * 将 totalInner 像素整数分给 n 条竖向 lane(含缝),保证 Σheight + Σgap === totalInner,消除底部留白缝。
482
+ */
483
+ export function dayOverlayLaneMetrics(totalInner, laneCount, gap) {
484
+ var n = Math.max(1, laneCount);
485
+ if (n === 1) {
486
+ return {
487
+ topFor: function topFor() {
488
+ return 0;
489
+ },
490
+ heightFor: function heightFor() {
491
+ return totalInner;
492
+ }
493
+ };
494
+ }
495
+ var gapsTotal = (n - 1) * gap;
496
+ var body = Math.max(0, totalInner - gapsTotal);
497
+ var base = Math.floor(body / n);
498
+ var rem = body % n;
499
+ var heights = [];
500
+ for (var i = 0; i < n; i += 1) {
501
+ heights.push(base + (i < rem ? 1 : 0));
502
+ }
503
+ var offsets = [0];
504
+ for (var _i3 = 1; _i3 < n; _i3 += 1) {
505
+ offsets.push(offsets[_i3 - 1] + heights[_i3 - 1] + gap);
506
+ }
507
+ return {
508
+ topFor: function topFor(lane) {
509
+ var _offsets$Math$min;
510
+ return (_offsets$Math$min = offsets[Math.min(lane, n - 1)]) !== null && _offsets$Math$min !== void 0 ? _offsets$Math$min : 0;
511
+ },
512
+ heightFor: function heightFor(lane) {
513
+ var _heights$Math$min;
514
+ return (_heights$Math$min = heights[Math.min(lane, n - 1)]) !== null && _heights$Math$min !== void 0 ? _heights$Math$min : base;
515
+ }
516
+ };
517
+ }
518
+ export function buildOverlayBookings(visibleCourtRows, dayKey, bookings) {
519
+ var rowTopMap = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
520
+ var hourSlots = arguments.length > 4 ? arguments[4] : undefined;
521
+ var dayRowHeights = arguments.length > 5 ? arguments[5] : undefined;
522
+ var slotStepHours = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 1;
523
+ var courtRowIndexMap = new Map();
524
+ visibleCourtRows.forEach(function (row, index) {
525
+ if (row.kind === 'court') courtRowIndexMap.set(row.id, index);
526
+ });
527
+ var stepH = slotStepHours > 0 ? slotStepHours : 1;
528
+ var gridMin = hourSlots !== null && hourSlots !== void 0 && hourSlots.length ? hourSlots[0] : 0;
529
+ var gridMaxExclusive = hourSlots !== null && hourSlots !== void 0 && hourSlots.length ? hourSlots[hourSlots.length - 1] + stepH : 24;
530
+ var seen = new Set();
531
+ var out = [];
532
+ var _loop = function _loop() {
533
+ var _dayRowHeights$i;
534
+ var row = visibleCourtRows[i];
535
+ if (row.kind !== 'court') return 1; // continue
536
+ var rowHeight = (_dayRowHeights$i = dayRowHeights[i]) !== null && _dayRowHeights$i !== void 0 ? _dayRowHeights$i : dayRowHeight;
537
+ var _iterator7 = _createForOfIteratorHelper(bookings.filter(function (b) {
538
+ return b.courtId === row.id;
539
+ })),
540
+ _step7;
541
+ try {
542
+ for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
543
+ var _item$id;
544
+ var item = _step7.value;
545
+ var dedupeKey = "".concat(row.id, "\0").concat((_item$id = item.id) !== null && _item$id !== void 0 ? _item$id : '', "\0").concat(dayKey);
546
+ if (seen.has(dedupeKey)) continue;
547
+ var seg = getBookingSegmentForDate(item, dayKey);
548
+ if (!seg) continue;
549
+ var start = Math.max(seg.startHour, gridMin);
550
+ var end = Math.min(seg.endHour, gridMaxExclusive);
551
+ if (end <= start) continue;
552
+ seen.add(dedupeKey);
553
+ out.push({
554
+ item: item,
555
+ rowIndex: courtRowIndexMap.get(row.id) || 0,
556
+ rowTop: rowTopMap[row.id] || 0,
557
+ rowHeight: rowHeight,
558
+ courtId: row.id,
559
+ start: start,
560
+ end: end,
561
+ span: end - start,
562
+ continuesNext: seg.continuesNext,
563
+ continuesPrev: seg.continuesPrev
564
+ });
565
+ }
566
+ } catch (err) {
567
+ _iterator7.e(err);
568
+ } finally {
569
+ _iterator7.f();
570
+ }
571
+ };
572
+ for (var i = 0; i < visibleCourtRows.length; i++) {
573
+ if (_loop()) continue;
574
+ }
575
+ assignDayOverlapLanesInPlace(out);
576
+ return out;
577
+ }
578
+
579
+ /** 日视图:按行高累加每行 rowTop(court / group) */
580
+ export function buildDayRowTopMap(visibleCourtRows, heights) {
581
+ var acc = 0;
582
+ var map = {};
583
+ visibleCourtRows.forEach(function (row, index) {
584
+ var _heights$index;
585
+ map[row.id] = acc;
586
+ acc += (_heights$index = heights[index]) !== null && _heights$index !== void 0 ? _heights$index : dayRowHeight;
587
+ });
588
+ return map;
589
+ }
590
+
591
+ /** 日历状态徽标:返回 i18n key + className;文案在 UI 层通过 tCal 解析,便于 utils 单测 */
592
+ export function statusTagMetaParts(tag) {
593
+ switch (tag) {
594
+ case 'cancel':
595
+ return {
596
+ labelI18nKey: 'pisell2.recordBoard.calendar.status.cancel',
597
+ className: 'bg-red-600/88 text-white border border-red-300/35'
598
+ };
599
+ case 'change':
600
+ return {
601
+ labelI18nKey: 'pisell2.recordBoard.calendar.status.change',
602
+ className: 'bg-amber-500/88 text-white border border-amber-200/35'
603
+ };
604
+ case 'checked_in':
605
+ return {
606
+ labelI18nKey: 'pisell2.recordBoard.calendar.status.checkedIn',
607
+ className: 'bg-zinc-500/88 text-white border border-zinc-300/30'
608
+ };
609
+ case 'pending':
610
+ return {
611
+ labelI18nKey: 'pisell2.recordBoard.calendar.status.pending',
612
+ className: 'bg-cyan-600/88 text-white border border-cyan-300/35'
613
+ };
614
+ case 'new':
615
+ return {
616
+ labelI18nKey: 'pisell2.recordBoard.calendar.status.new',
617
+ className: 'bg-emerald-600/88 text-white border border-emerald-300/35'
618
+ };
619
+ case 'late':
620
+ return {
621
+ labelI18nKey: 'pisell2.recordBoard.calendar.status.late',
622
+ className: 'bg-amber-500/88 text-white border border-amber-200/35'
623
+ };
624
+ case 'no_show':
625
+ return {
626
+ labelI18nKey: 'pisell2.recordBoard.calendar.status.noShow',
627
+ className: 'bg-red-700/92 text-white border border-red-300/35'
628
+ };
629
+ default:
630
+ return null;
631
+ }
632
+ }
633
+ export function getBookingDetailData(item) {
634
+ var _item$courtId, _item$id2, _item$id3, _item$id4;
635
+ var courtsList = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
636
+ var court = courtsList.find(function (c) {
637
+ return c.id === item.courtId;
638
+ });
639
+ var resourceLabel = (court === null || court === void 0 ? void 0 : court.name) != null && String(court.name).trim() !== '' ? String(court.name) : String((_item$courtId = item.courtId) !== null && _item$courtId !== void 0 ? _item$courtId : '—');
640
+ var startTime = formatHourLabel(item.startHour);
641
+ var endTime = formatHourLabel(item.endHour);
642
+ var endDate = item.endDate || item.date;
643
+ var isBlock = item.kind === 'block';
644
+ var customerName = isBlock ? item.blockBy || tCal('pisell2.recordBoard.calendar.detail.staff') : item.name || '—';
645
+ var noteText = item.note ? String(item.note) : '';
646
+ var orderNotes = noteText ? [{
647
+ id: "".concat(item.id, "-note-order"),
648
+ label: tCal('pisell2.recordBoard.calendar.detail.orderNote'),
649
+ text: noteText
650
+ }] : [];
651
+ return {
652
+ rawSales: null,
653
+ bookingId: String((_item$id2 = item.id) !== null && _item$id2 !== void 0 ? _item$id2 : '').toUpperCase(),
654
+ orderNumber: String((_item$id3 = item.id) !== null && _item$id3 !== void 0 ? _item$id3 : ''),
655
+ shopOrderNumber: String((_item$id4 = item.id) !== null && _item$id4 !== void 0 ? _item$id4 : ''),
656
+ orderStatus: 'normal',
657
+ appointmentStatus: isBlock ? 'blocked' : 'confirmed',
658
+ paymentStatus: 'payment_processing',
659
+ customer: {
660
+ id: null,
661
+ name: customerName,
662
+ email: '',
663
+ phone: item.phone ? String(item.phone) : ''
664
+ },
665
+ guestCount: 0,
666
+ checkedInCount: 0,
667
+ guests: [],
668
+ schedule: {
669
+ startDate: item.date,
670
+ startTime: startTime,
671
+ endDate: endDate,
672
+ endTime: endTime,
673
+ duration: Math.max(0, (item.endHour - item.startHour) * 60),
674
+ arrivedAt: null,
675
+ completedAt: null
676
+ },
677
+ resources: [],
678
+ summaryItems: [],
679
+ items: [],
680
+ note: noteText,
681
+ files: {
682
+ form: [],
683
+ uploaded: [],
684
+ invoice: []
685
+ },
686
+ payments: [],
687
+ history: [],
688
+ summary: {},
689
+ paymentSummary: {
690
+ totalAmount: 0,
691
+ paidAmount: 0,
692
+ balanceAmount: 0,
693
+ currencySymbol: '$',
694
+ isFullyPaid: false
695
+ },
696
+ itemSummary: {
697
+ itemCount: 0,
698
+ itemQtyTotal: 0
699
+ },
700
+ headerSummary: {
701
+ customerName: customerName,
702
+ guestCount: 0,
703
+ checkedInCount: 0,
704
+ timeLabel: "".concat(item.date, " \xB7 ").concat(startTime, " - ").concat(endTime),
705
+ resourceLabel: resourceLabel
706
+ },
707
+ headerTags: {
708
+ paymentTag: 'Unpaid',
709
+ fulfillmentTag: 'Open',
710
+ hasNote: Boolean(noteText),
711
+ paymentStatus: 'payment_processing',
712
+ orderStatus: 'normal'
713
+ },
714
+ fileCount: 0,
715
+ canChangeCustomer: !isBlock,
716
+ noteCount: orderNotes.length,
717
+ noteGroups: {
718
+ internal: [],
719
+ order: orderNotes,
720
+ item: []
721
+ },
722
+ metaFlags: {
723
+ itemsChanged: false,
724
+ paymentsChanged: false,
725
+ guestChanged: false,
726
+ filesChanged: false,
727
+ notesChanged: false,
728
+ formChanged: false,
729
+ uploadedChanged: false,
730
+ invoiceChanged: false,
731
+ historyChanged: false
732
+ },
733
+ actions: []
734
+ };
735
+ }