@mantine/schedule 9.5.1 → 9.6.0

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 (222) hide show
  1. package/cjs/_virtual/_rolldown/runtime.cjs +1 -1
  2. package/cjs/components/AgendaView/AgendaView.cjs +7 -6
  3. package/cjs/components/AgendaView/AgendaView.cjs.map +1 -1
  4. package/cjs/components/AgendaView/get-agenda-view-events.cjs.map +1 -1
  5. package/cjs/components/CurrentTimeIndicator/CurrentTimeIndicator.cjs +3 -2
  6. package/cjs/components/CurrentTimeIndicator/CurrentTimeIndicator.cjs.map +1 -1
  7. package/cjs/components/DayView/DayView.cjs +144 -78
  8. package/cjs/components/DayView/DayView.cjs.map +1 -1
  9. package/cjs/components/DayView/DayView.module.cjs +2 -1
  10. package/cjs/components/DayView/DayView.module.cjs.map +1 -1
  11. package/cjs/components/DayView/get-day-view-events/get-day-view-events.cjs.map +1 -1
  12. package/cjs/components/DragContext/DragContext.cjs.map +1 -1
  13. package/cjs/components/MobileMonthView/MobileMonthView.cjs +7 -6
  14. package/cjs/components/MobileMonthView/MobileMonthView.cjs.map +1 -1
  15. package/cjs/components/MobileMonthView/get-mobile-month-view-events.cjs.map +1 -1
  16. package/cjs/components/MonthView/MonthView.cjs +24 -34
  17. package/cjs/components/MonthView/MonthView.cjs.map +1 -1
  18. package/cjs/components/MonthView/MonthView.module.cjs.map +1 -1
  19. package/cjs/components/MonthView/get-month-view-events/find-available-row.cjs.map +1 -1
  20. package/cjs/components/MonthView/get-month-view-events/get-month-positioned-events.cjs +4 -2
  21. package/cjs/components/MonthView/get-month-view-events/get-month-positioned-events.cjs.map +1 -1
  22. package/cjs/components/MonthView/get-month-view-events/get-month-view-events.cjs.map +1 -1
  23. package/cjs/components/MonthView/get-month-view-events/get-weeks-in-range.cjs +3 -2
  24. package/cjs/components/MonthView/get-month-view-events/get-weeks-in-range.cjs.map +1 -1
  25. package/cjs/components/MonthView/get-renderable-month-event-segments.cjs +1 -1
  26. package/cjs/components/MonthView/get-renderable-month-event-segments.cjs.map +1 -1
  27. package/cjs/components/MoreEvents/MoreEvents.cjs.map +1 -1
  28. package/cjs/components/ResourcesDayView/ResourcesDayView.cjs +136 -52
  29. package/cjs/components/ResourcesDayView/ResourcesDayView.cjs.map +1 -1
  30. package/cjs/components/ResourcesDayView/ResourcesDayView.module.cjs +2 -1
  31. package/cjs/components/ResourcesDayView/ResourcesDayView.module.cjs.map +1 -1
  32. package/cjs/components/ResourcesDayView/ResourcesDayViewColumn.cjs.map +1 -1
  33. package/cjs/components/ResourcesDayView/get-resources-day-view-events/get-resources-day-view-events.cjs.map +1 -1
  34. package/cjs/components/ResourcesMonthView/ResourcesMonthView.cjs.map +1 -1
  35. package/cjs/components/ResourcesSchedule/ResourcesSchedule.cjs +3 -1
  36. package/cjs/components/ResourcesSchedule/ResourcesSchedule.cjs.map +1 -1
  37. package/cjs/components/ResourcesWeekView/ResourcesWeekView.cjs +150 -59
  38. package/cjs/components/ResourcesWeekView/ResourcesWeekView.cjs.map +1 -1
  39. package/cjs/components/ResourcesWeekView/ResourcesWeekView.module.cjs +2 -1
  40. package/cjs/components/ResourcesWeekView/ResourcesWeekView.module.cjs.map +1 -1
  41. package/cjs/components/ResourcesWeekView/ResourcesWeekViewRow.cjs.map +1 -1
  42. package/cjs/components/ResourcesWeekView/get-resources-week-view-events/get-resources-week-view-events.cjs +6 -3
  43. package/cjs/components/ResourcesWeekView/get-resources-week-view-events/get-resources-week-view-events.cjs.map +1 -1
  44. package/cjs/components/Schedule/Schedule.cjs +4 -1
  45. package/cjs/components/Schedule/Schedule.cjs.map +1 -1
  46. package/cjs/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.cjs +53 -0
  47. package/cjs/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.cjs.map +1 -0
  48. package/cjs/components/ScheduleEvent/ScheduleEvent.cjs.map +1 -1
  49. package/cjs/components/ScheduleHeader/HeaderControl/HeaderControl.cjs +15 -14
  50. package/cjs/components/ScheduleHeader/HeaderControl/HeaderControl.cjs.map +1 -1
  51. package/cjs/components/ScheduleHeader/MonthYearSelect/MonthYearSelect.cjs.map +1 -1
  52. package/cjs/components/ScheduleHeader/ScheduleHeader.cjs.map +1 -1
  53. package/cjs/components/ScheduleHeader/ScheduleHeaderBase.cjs.map +1 -1
  54. package/cjs/components/ScheduleHeader/ScheduleHeaderContext.cjs.map +1 -1
  55. package/cjs/components/ScheduleHeader/ViewSelect/ViewSelect.cjs.map +1 -1
  56. package/cjs/components/WeekView/WeekView.cjs +159 -82
  57. package/cjs/components/WeekView/WeekView.cjs.map +1 -1
  58. package/cjs/components/WeekView/WeekView.module.cjs +2 -1
  59. package/cjs/components/WeekView/WeekView.module.cjs.map +1 -1
  60. package/cjs/components/WeekView/WeekViewDay.cjs.map +1 -1
  61. package/cjs/components/WeekView/get-week-label/get-week-label.cjs.map +1 -1
  62. package/cjs/components/WeekView/get-week-view-events/calculate-all-day-event-offset.cjs.map +1 -1
  63. package/cjs/components/WeekView/get-week-view-events/calculate-all-day-event-width.cjs.map +1 -1
  64. package/cjs/components/WeekView/get-week-view-events/calculate-event-days.cjs.map +1 -1
  65. package/cjs/components/WeekView/get-week-view-events/find-available-column.cjs +5 -10
  66. package/cjs/components/WeekView/get-week-view-events/find-available-column.cjs.map +1 -1
  67. package/cjs/components/WeekView/get-week-view-events/get-event-end-date.cjs.map +1 -1
  68. package/cjs/components/WeekView/get-week-view-events/get-hanging-status.cjs.map +1 -1
  69. package/cjs/components/WeekView/get-week-view-events/get-week-positioned-events.cjs +5 -3
  70. package/cjs/components/WeekView/get-week-view-events/get-week-positioned-events.cjs.map +1 -1
  71. package/cjs/components/YearView/YearView.cjs +7 -6
  72. package/cjs/components/YearView/YearView.cjs.map +1 -1
  73. package/cjs/components/YearView/YearViewMonth.cjs.map +1 -1
  74. package/cjs/components/YearView/get-visible-week-days.cjs.map +1 -1
  75. package/cjs/components/YearView/get-year-view-events/get-year-view-events.cjs.map +1 -1
  76. package/cjs/hooks/use-auto-scroll-on-drag.cjs.map +1 -1
  77. package/cjs/hooks/use-day-grid-event-resize.cjs.map +1 -1
  78. package/cjs/hooks/use-drag-drop-handlers.cjs +13 -2
  79. package/cjs/hooks/use-drag-drop-handlers.cjs.map +1 -1
  80. package/cjs/hooks/use-drag-state.cjs.map +1 -1
  81. package/cjs/hooks/use-event-resize.cjs +30 -15
  82. package/cjs/hooks/use-event-resize.cjs.map +1 -1
  83. package/cjs/hooks/use-horizontal-event-resize.cjs +30 -15
  84. package/cjs/hooks/use-horizontal-event-resize.cjs.map +1 -1
  85. package/cjs/hooks/use-slot-drag-select.cjs.map +1 -1
  86. package/cjs/index.cjs +2 -0
  87. package/cjs/utils/calculate-drop-time/calculate-drop-time.cjs +25 -4
  88. package/cjs/utils/calculate-drop-time/calculate-drop-time.cjs.map +1 -1
  89. package/cjs/utils/calculate-month-drop-date/calculate-month-drop-date.cjs.map +1 -1
  90. package/cjs/utils/calculate-month-resize-dates/calculate-month-resize-dates.cjs.map +1 -1
  91. package/cjs/utils/expand-recurring-events/expand-recurring-events.cjs +20 -8
  92. package/cjs/utils/expand-recurring-events/expand-recurring-events.cjs.map +1 -1
  93. package/cjs/utils/format-date/format-date.cjs.map +1 -1
  94. package/cjs/utils/get-current-time-position/get-current-time-position.cjs.map +1 -1
  95. package/cjs/utils/get-day-position/get-day-position.cjs.map +1 -1
  96. package/cjs/utils/get-end-of-week/get-end-of-week.cjs.map +1 -1
  97. package/cjs/utils/get-month-days/get-month-days.cjs +4 -2
  98. package/cjs/utils/get-month-days/get-month-days.cjs.map +1 -1
  99. package/cjs/utils/get-month-range/get-month-range.cjs.map +1 -1
  100. package/cjs/utils/get-months-by-quarter/get-months-by-quarter.cjs.map +1 -1
  101. package/cjs/utils/get-months-list/get-months-list.cjs.map +1 -1
  102. package/cjs/utils/get-start-of-week/get-start-of-week.cjs.map +1 -1
  103. package/cjs/utils/get-week-days/get-week-days.cjs.map +1 -1
  104. package/cjs/utils/get-week-number/get-week-number.cjs +4 -1
  105. package/cjs/utils/get-week-number/get-week-number.cjs.map +1 -1
  106. package/cjs/utils/get-weekdays-names/get-weekdays-names.cjs.map +1 -1
  107. package/cjs/utils/is-after-min-date/is-after-min-date.cjs.map +1 -1
  108. package/cjs/utils/is-all-day-event/is-all-day-event.cjs.map +1 -1
  109. package/cjs/utils/is-before-max-date/is-before-max-date.cjs.map +1 -1
  110. package/cjs/utils/is-event-in-time-range/is-event-in-time-range.cjs.map +1 -1
  111. package/cjs/utils/is-events-overlap/is-events-overlap.cjs +16 -4
  112. package/cjs/utils/is-events-overlap/is-events-overlap.cjs.map +1 -1
  113. package/cjs/utils/is-in-time-range/is-in-time-range.cjs.map +1 -1
  114. package/cjs/utils/is-multiday-event/is-multiday-event.cjs.map +1 -1
  115. package/cjs/utils/is-same-month/is-same-month.cjs.map +1 -1
  116. package/cjs/utils/is-within-week/is-within-week.cjs.map +1 -1
  117. package/cjs/utils/next-week/next-week.cjs.map +1 -1
  118. package/cjs/utils/previous-week/previous-week.cjs.map +1 -1
  119. package/cjs/utils/sort-events/sort-events.cjs.map +1 -1
  120. package/cjs/utils/to-date-string/to-date-string.cjs.map +1 -1
  121. package/cjs/utils/validate-event/validate-event.cjs.map +1 -1
  122. package/esm/components/AgendaView/AgendaView.mjs +7 -6
  123. package/esm/components/AgendaView/AgendaView.mjs.map +1 -1
  124. package/esm/components/CurrentTimeIndicator/CurrentTimeIndicator.mjs +4 -3
  125. package/esm/components/CurrentTimeIndicator/CurrentTimeIndicator.mjs.map +1 -1
  126. package/esm/components/DayView/DayView.mjs +145 -79
  127. package/esm/components/DayView/DayView.mjs.map +1 -1
  128. package/esm/components/DayView/DayView.module.mjs +2 -1
  129. package/esm/components/DayView/DayView.module.mjs.map +1 -1
  130. package/esm/components/MobileMonthView/MobileMonthView.mjs +7 -6
  131. package/esm/components/MobileMonthView/MobileMonthView.mjs.map +1 -1
  132. package/esm/components/MonthView/MonthView.mjs +25 -35
  133. package/esm/components/MonthView/MonthView.mjs.map +1 -1
  134. package/esm/components/MonthView/MonthView.module.mjs.map +1 -1
  135. package/esm/components/MonthView/get-month-view-events/get-month-positioned-events.mjs +4 -2
  136. package/esm/components/MonthView/get-month-view-events/get-month-positioned-events.mjs.map +1 -1
  137. package/esm/components/MonthView/get-month-view-events/get-weeks-in-range.mjs +3 -2
  138. package/esm/components/MonthView/get-month-view-events/get-weeks-in-range.mjs.map +1 -1
  139. package/esm/components/MonthView/get-renderable-month-event-segments.mjs +1 -1
  140. package/esm/components/MonthView/get-renderable-month-event-segments.mjs.map +1 -1
  141. package/esm/components/MoreEvents/MoreEvents.mjs.map +1 -1
  142. package/esm/components/ResourcesDayView/ResourcesDayView.mjs +138 -54
  143. package/esm/components/ResourcesDayView/ResourcesDayView.mjs.map +1 -1
  144. package/esm/components/ResourcesDayView/ResourcesDayView.module.mjs +2 -1
  145. package/esm/components/ResourcesDayView/ResourcesDayView.module.mjs.map +1 -1
  146. package/esm/components/ResourcesDayView/ResourcesDayViewColumn.mjs.map +1 -1
  147. package/esm/components/ResourcesMonthView/ResourcesMonthView.mjs.map +1 -1
  148. package/esm/components/ResourcesSchedule/ResourcesSchedule.mjs +3 -1
  149. package/esm/components/ResourcesSchedule/ResourcesSchedule.mjs.map +1 -1
  150. package/esm/components/ResourcesWeekView/ResourcesWeekView.mjs +152 -61
  151. package/esm/components/ResourcesWeekView/ResourcesWeekView.mjs.map +1 -1
  152. package/esm/components/ResourcesWeekView/ResourcesWeekView.module.mjs +2 -1
  153. package/esm/components/ResourcesWeekView/ResourcesWeekView.module.mjs.map +1 -1
  154. package/esm/components/ResourcesWeekView/ResourcesWeekViewRow.mjs.map +1 -1
  155. package/esm/components/ResourcesWeekView/get-resources-week-view-events/get-resources-week-view-events.mjs +6 -3
  156. package/esm/components/ResourcesWeekView/get-resources-week-view-events/get-resources-week-view-events.mjs.map +1 -1
  157. package/esm/components/Schedule/Schedule.mjs +4 -1
  158. package/esm/components/Schedule/Schedule.mjs.map +1 -1
  159. package/esm/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.mjs +53 -0
  160. package/esm/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.mjs.map +1 -0
  161. package/esm/components/ScheduleEvent/ScheduleEvent.mjs.map +1 -1
  162. package/esm/components/ScheduleHeader/HeaderControl/HeaderControl.mjs +15 -14
  163. package/esm/components/ScheduleHeader/HeaderControl/HeaderControl.mjs.map +1 -1
  164. package/esm/components/ScheduleHeader/MonthYearSelect/MonthYearSelect.mjs.map +1 -1
  165. package/esm/components/ScheduleHeader/ScheduleHeader.mjs.map +1 -1
  166. package/esm/components/ScheduleHeader/ScheduleHeaderBase.mjs.map +1 -1
  167. package/esm/components/ScheduleHeader/ViewSelect/ViewSelect.mjs.map +1 -1
  168. package/esm/components/WeekView/WeekView.mjs +160 -83
  169. package/esm/components/WeekView/WeekView.mjs.map +1 -1
  170. package/esm/components/WeekView/WeekView.module.mjs +2 -1
  171. package/esm/components/WeekView/WeekView.module.mjs.map +1 -1
  172. package/esm/components/WeekView/WeekViewDay.mjs.map +1 -1
  173. package/esm/components/WeekView/get-week-view-events/find-available-column.mjs +5 -10
  174. package/esm/components/WeekView/get-week-view-events/find-available-column.mjs.map +1 -1
  175. package/esm/components/WeekView/get-week-view-events/get-week-positioned-events.mjs +5 -3
  176. package/esm/components/WeekView/get-week-view-events/get-week-positioned-events.mjs.map +1 -1
  177. package/esm/components/YearView/YearView.mjs +7 -6
  178. package/esm/components/YearView/YearView.mjs.map +1 -1
  179. package/esm/components/YearView/YearViewMonth.mjs.map +1 -1
  180. package/esm/hooks/use-drag-drop-handlers.mjs +13 -2
  181. package/esm/hooks/use-drag-drop-handlers.mjs.map +1 -1
  182. package/esm/hooks/use-event-resize.mjs +30 -15
  183. package/esm/hooks/use-event-resize.mjs.map +1 -1
  184. package/esm/hooks/use-horizontal-event-resize.mjs +30 -15
  185. package/esm/hooks/use-horizontal-event-resize.mjs.map +1 -1
  186. package/esm/index.mjs +2 -1
  187. package/esm/utils/calculate-drop-time/calculate-drop-time.mjs +25 -4
  188. package/esm/utils/calculate-drop-time/calculate-drop-time.mjs.map +1 -1
  189. package/esm/utils/expand-recurring-events/expand-recurring-events.mjs +20 -8
  190. package/esm/utils/expand-recurring-events/expand-recurring-events.mjs.map +1 -1
  191. package/esm/utils/get-month-days/get-month-days.mjs +4 -2
  192. package/esm/utils/get-month-days/get-month-days.mjs.map +1 -1
  193. package/esm/utils/get-week-number/get-week-number.mjs +4 -1
  194. package/esm/utils/get-week-number/get-week-number.mjs.map +1 -1
  195. package/esm/utils/is-events-overlap/is-events-overlap.mjs +16 -4
  196. package/esm/utils/is-events-overlap/is-events-overlap.mjs.map +1 -1
  197. package/lib/components/DayView/DayView.d.ts +7 -1
  198. package/lib/components/MonthView/MonthView.d.ts +2 -0
  199. package/lib/components/ResourcesDayView/ResourcesDayView.d.ts +7 -1
  200. package/lib/components/ResourcesDayView/ResourcesDayViewColumn.d.ts +1 -1
  201. package/lib/components/ResourcesSchedule/ResourcesSchedule.d.ts +3 -1
  202. package/lib/components/ResourcesWeekView/ResourcesWeekView.d.ts +7 -1
  203. package/lib/components/ResourcesWeekView/ResourcesWeekViewRow.d.ts +1 -1
  204. package/lib/components/Schedule/Schedule.d.ts +3 -1
  205. package/lib/components/ScheduleBackgroundEvent/ScheduleBackgroundEvent.d.ts +19 -0
  206. package/lib/components/ScheduleBackgroundEvent/index.d.ts +2 -0
  207. package/lib/components/ScheduleHeader/HeaderControl/HeaderControl.d.ts +3 -3
  208. package/lib/components/ScheduleHeader/ScheduleHeaderBase.d.ts +1 -1
  209. package/lib/components/WeekView/WeekView.d.ts +7 -1
  210. package/lib/components/WeekView/WeekViewDay.d.ts +1 -1
  211. package/lib/components/WeekView/get-week-view-events/find-available-column.d.ts +7 -3
  212. package/lib/components/YearView/YearViewMonth.d.ts +1 -1
  213. package/lib/hooks/use-drag-drop-handlers.d.ts +10 -1
  214. package/lib/hooks/use-event-resize.d.ts +2 -1
  215. package/lib/hooks/use-horizontal-event-resize.d.ts +2 -1
  216. package/lib/index.d.mts +1 -0
  217. package/lib/index.d.ts +1 -0
  218. package/lib/types.d.ts +1 -1
  219. package/lib/utils/calculate-drop-time/calculate-drop-time.d.ts +11 -1
  220. package/package.json +8 -5
  221. package/styles.css +160 -0
  222. package/styles.layer.css +160 -0
@@ -1 +1 @@
1
- {"version":3,"file":"ResourcesDayView.module.cjs","names":[],"sources":["../../../src/components/ResourcesDayView/ResourcesDayView.module.css"],"sourcesContent":[".resourcesDayView {\n --resources-day-view-radius: var(--schedule-radius, var(--mantine-radius-default));\n --resources-day-view-resource-label-width: 120px;\n --resources-day-view-slot-width: 80px;\n --resources-day-view-row-height: 64px;\n --resources-day-view-group-label-width: 80px;\n --resources-day-view-all-day-height: 20px;\n\n @mixin where-light {\n --resources-day-view-border-color: var(--mantine-color-gray-3);\n --resources-day-view-business-hours-bg: var(--mantine-color-white);\n --resources-day-view-non-business-hours-bg: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n --resources-day-view-border-color: var(--mantine-color-dark-4);\n --resources-day-view-business-hours-bg: var(--mantine-color-dark-7);\n --resources-day-view-non-business-hours-bg: var(--mantine-color-dark-6);\n }\n}\n\n.resourcesDayViewRoot {\n border: 1px solid var(--resources-day-view-border-color);\n border-radius: var(--resources-day-view-radius);\n overflow: hidden;\n max-width: fit-content;\n position: relative;\n}\n\n.resourcesDayViewScrollArea {\n :where([data-mantine-scrollbar]) {\n z-index: 20;\n }\n\n :where([data-scrollarea-viewport]) {\n overscroll-behavior-x: none;\n }\n}\n\n.resourcesDayViewInner {\n display: inline-flex;\n flex-direction: column;\n position: relative;\n}\n\n.resourcesDayViewTimeLabelsRow {\n display: flex;\n position: sticky;\n top: 0;\n z-index: 5;\n background-color: var(--mantine-color-body);\n border-bottom: 1px solid var(--resources-day-view-border-color);\n margin-bottom: -1px;\n transition: box-shadow 100ms ease;\n\n &:where([data-scrolled]) {\n box-shadow: var(--mantine-shadow-sm);\n }\n}\n\n.resourcesDayViewCorner {\n flex: 0 0 var(--resources-day-view-resource-label-width);\n min-width: var(--resources-day-view-resource-label-width);\n border-inline-end: 1px solid var(--resources-day-view-border-color);\n position: sticky;\n left: 0;\n z-index: 11;\n background-color: var(--mantine-color-body);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n}\n\n.resourcesDayViewTimeLabel {\n flex: 0 0 var(--resources-day-view-slot-width);\n min-width: var(--resources-day-view-slot-width);\n max-width: var(--resources-day-view-slot-width);\n height: 36px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-sm);\n user-select: none;\n cursor: default;\n font-variant-numeric: tabular-nums;\n text-transform: uppercase;\n border-inline-end: 1px solid var(--resources-day-view-border-color);\n\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n\n &:where([data-business-hours]) {\n background-color: var(--resources-day-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--resources-day-view-non-business-hours-bg);\n }\n}\n\n.resourcesDayViewRow {\n display: flex;\n border-top: 1px solid var(--resources-day-view-border-color);\n}\n\n.resourcesDayViewResourceLabel {\n flex: 0 0 var(--resources-day-view-resource-label-width);\n min-width: var(--resources-day-view-resource-label-width);\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 4px 8px;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n border-inline-end: 1px solid var(--resources-day-view-border-color);\n min-height: var(--resources-day-view-row-height);\n position: sticky;\n left: 0;\n z-index: 11;\n background-color: var(--mantine-color-body);\n transition: box-shadow 100ms ease;\n\n &:where([data-scrolled-x]) {\n box-shadow: var(--mantine-shadow-sm);\n }\n\n &:where([data-has-groups]) {\n left: var(--resources-day-view-group-label-width);\n }\n}\n\n.resourcesDayViewGroupColumn {\n flex: 0 0 var(--resources-day-view-group-label-width);\n min-width: var(--resources-day-view-group-label-width);\n min-height: var(--resources-day-view-row-height);\n position: sticky;\n left: 0;\n z-index: 12;\n background-color: var(--mantine-color-body);\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n overflow-wrap: break-word;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n border-inline-end: 1px solid var(--resources-day-view-border-color);\n overflow: visible;\n\n &:where([data-group-position='first']),\n &:where([data-group-position='only']) {\n z-index: 13;\n }\n\n &:where([data-group-position='middle']),\n &:where([data-group-position='last']) {\n margin-top: -1px;\n min-height: calc(var(--resources-day-view-row-height) + 1px);\n }\n}\n\n.resourcesDayViewGroupColumnEmpty {\n flex: 0 0 var(--resources-day-view-group-label-width);\n min-width: var(--resources-day-view-group-label-width);\n min-height: var(--resources-day-view-row-height);\n position: sticky;\n left: 0;\n z-index: 12;\n background-color: var(--mantine-color-body);\n border-inline-end: 1px solid var(--resources-day-view-border-color);\n}\n\n.resourcesDayViewRowSlots {\n display: flex;\n position: relative;\n min-height: var(--resources-day-view-row-height);\n}\n\n.resourcesDayViewRowSlot {\n flex: 0 0 var(--resources-day-view-slot-width);\n min-width: var(--resources-day-view-slot-width);\n max-width: var(--resources-day-view-slot-width);\n min-height: var(--resources-day-view-row-height);\n border-inline-end: 1px solid var(--resources-day-view-border-color);\n cursor: pointer;\n position: relative;\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-1);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n }\n\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n\n &:where(:focus) {\n z-index: 1;\n }\n\n &:where([data-business-hours]) {\n background-color: var(--resources-day-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--resources-day-view-non-business-hours-bg);\n }\n\n &:where([data-drop-target]) {\n @mixin where-light {\n background-color: var(--mantine-color-blue-1);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 2;\n border: 1px solid;\n border-radius: 2px;\n\n @mixin where-light {\n border-color: var(--mantine-color-blue-4);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-blue-6);\n }\n }\n }\n\n &:where([data-drag-selected]) {\n &,\n &:hover {\n background-color: var(--mantine-primary-color-light);\n }\n\n &::before {\n content: '';\n position: absolute;\n inset: -1px;\n pointer-events: none;\n z-index: 2;\n border: 1px solid;\n\n @mixin where-light {\n border-color: var(--mantine-primary-color-2);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-primary-color-9);\n }\n }\n }\n\n &:where([data-drag-slot-index]) {\n touch-action: none;\n }\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.resourcesDayViewCurrentTimeIndicator {\n --_indicator-color: var(--resources-day-view-indicator-color, var(--mantine-color-red-7));\n --_time-bubble-height: 18px;\n --_thumb-size: 12px;\n\n position: absolute;\n pointer-events: none;\n top: 37px;\n bottom: 0;\n left: var(--indicator-left-offset);\n width: 2px;\n z-index: 3;\n\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n background-color: var(--_indicator-color);\n opacity: 0.2;\n }\n}\n\n.resourcesDayViewCurrentTimeIndicatorLine {\n width: 100%;\n position: absolute;\n top: 0;\n bottom: 0;\n background-color: var(--_indicator-color);\n}\n\n.resourcesDayViewCurrentTimeIndicatorThumb {\n position: absolute;\n top: calc(-1 * (var(--_thumb-size) / 2 - 1px));\n width: var(--_thumb-size);\n height: var(--_thumb-size);\n border-radius: 50%;\n border: 1px solid var(--mantine-color-body);\n background-color: var(--_indicator-color);\n left: calc(-1 * (var(--_thumb-size) / 2 - 1px));\n}\n\n.resourcesDayViewCurrentTimeIndicatorTimeBubble {\n position: absolute;\n height: var(--_time-bubble-height);\n width: var(--_time-bubble-width);\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 1000px;\n background-color: var(--_indicator-color);\n color: var(--mantine-color-white);\n font-size: var(--mantine-font-size-xs);\n font-weight: var(--mantine-font-weight-bold);\n box-shadow: var(--mantine-shadow-sm);\n white-space: nowrap;\n font-variant-numeric: tabular-nums;\n text-transform: uppercase;\n top: 0;\n left: calc(-1 * (var(--_time-bubble-width) / 2 - 1px));\n z-index: 3;\n}\n\n.resourcesDayViewBackgroundEvent {\n position: absolute;\n pointer-events: none;\n z-index: 2;\n border-radius: var(--resources-day-view-radius);\n background-color: var(--bg-event-bg);\n overflow: hidden;\n font-size: 12px;\n font-weight: var(--mantine-font-weight-medium);\n padding: 3px 4px;\n color: var(--bg-event-color);\n}\n\n.resourcesDayViewAllDayEvent {\n position: absolute;\n inset-inline: 1px;\n height: var(--resources-day-view-all-day-height);\n z-index: 3;\n}\n\n.resourcesDayViewResizeHandle {\n position: absolute;\n top: 20%;\n width: 4px;\n height: 60%;\n cursor: ew-resize;\n z-index: 5;\n border-radius: 2px;\n opacity: 0;\n transition: opacity 100ms ease;\n pointer-events: all;\n background-color: var(--event-color);\n\n &::before {\n content: '';\n position: absolute;\n inset: -4px -6px;\n }\n\n &:where([data-edge='start']) {\n left: -2px;\n }\n\n &:where([data-edge='end']) {\n right: -2px;\n }\n}\n\n.resourcesDayViewEventWrapper {\n position: absolute;\n z-index: 3;\n\n &:hover .resourcesDayViewResizeHandle {\n opacity: 0.5;\n }\n\n & .resourcesDayViewResizeHandle:hover {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesDayViewResizeHandle:where([data-active]) {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesDayViewResizeHandle:not([data-active]) {\n opacity: 0;\n pointer-events: none;\n }\n}\n\n.resourcesDayView:where([data-event-interaction]) .resourcesDayViewRowSlot {\n pointer-events: none;\n}\n\n.resourcesDayView:where([data-resizing]) {\n & * {\n cursor: ew-resize !important;\n }\n\n & .resourcesDayViewEventWrapper:not([data-resizing]) {\n pointer-events: none;\n\n & .resourcesDayViewResizeHandle {\n opacity: 0;\n }\n }\n}\n"],"mappings":""}
1
+ {"version":3,"file":"ResourcesDayView.module.cjs","names":[],"sources":["../../../src/components/ResourcesDayView/ResourcesDayView.module.css"],"sourcesContent":[".resourcesDayView {\n --resources-day-view-radius: var(--schedule-radius, var(--mantine-radius-default));\n --resources-day-view-resource-label-width: 120px;\n --resources-day-view-slot-width: 80px;\n --resources-day-view-row-height: 64px;\n --resources-day-view-group-label-width: 80px;\n --resources-day-view-all-day-height: 20px;\n\n @mixin where-light {\n --resources-day-view-border-color: var(--mantine-color-gray-3);\n --resources-day-view-business-hours-bg: var(--mantine-color-white);\n --resources-day-view-non-business-hours-bg: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n --resources-day-view-border-color: var(--mantine-color-dark-4);\n --resources-day-view-business-hours-bg: var(--mantine-color-dark-7);\n --resources-day-view-non-business-hours-bg: var(--mantine-color-dark-6);\n }\n}\n\n.resourcesDayViewRoot {\n border: 1px solid var(--resources-day-view-border-color);\n border-radius: var(--resources-day-view-radius);\n overflow: hidden;\n max-width: fit-content;\n position: relative;\n}\n\n.resourcesDayViewScrollArea {\n :where([data-mantine-scrollbar]) {\n z-index: 20;\n }\n\n :where([data-scrollarea-viewport]) {\n overscroll-behavior-x: none;\n }\n}\n\n.resourcesDayViewInner {\n display: inline-flex;\n flex-direction: column;\n position: relative;\n}\n\n.resourcesDayViewTimeLabelsRow {\n display: flex;\n position: sticky;\n top: 0;\n z-index: 5;\n background-color: var(--mantine-color-body);\n border-bottom: 1px solid var(--resources-day-view-border-color);\n margin-bottom: -1px;\n transition: box-shadow 100ms ease;\n\n &:where([data-scrolled]) {\n box-shadow: var(--mantine-shadow-sm);\n }\n}\n\n.resourcesDayViewCorner {\n flex: 0 0 var(--resources-day-view-resource-label-width);\n min-width: var(--resources-day-view-resource-label-width);\n border-inline-end: 1px solid var(--resources-day-view-border-color);\n position: sticky;\n left: 0;\n z-index: 11;\n background-color: var(--mantine-color-body);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n}\n\n.resourcesDayViewTimeLabel {\n flex: 0 0 var(--resources-day-view-slot-width);\n min-width: var(--resources-day-view-slot-width);\n max-width: var(--resources-day-view-slot-width);\n height: 36px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: var(--mantine-font-size-sm);\n user-select: none;\n cursor: default;\n font-variant-numeric: tabular-nums;\n text-transform: uppercase;\n border-inline-end: 1px solid var(--resources-day-view-border-color);\n\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n\n &:where([data-business-hours]) {\n background-color: var(--resources-day-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--resources-day-view-non-business-hours-bg);\n }\n}\n\n.resourcesDayViewRow {\n display: flex;\n border-top: 1px solid var(--resources-day-view-border-color);\n}\n\n.resourcesDayViewResourceLabel {\n flex: 0 0 var(--resources-day-view-resource-label-width);\n min-width: var(--resources-day-view-resource-label-width);\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 4px 8px;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n border-inline-end: 1px solid var(--resources-day-view-border-color);\n min-height: var(--resources-day-view-row-height);\n position: sticky;\n left: 0;\n z-index: 11;\n background-color: var(--mantine-color-body);\n transition: box-shadow 100ms ease;\n\n &:where([data-scrolled-x]) {\n box-shadow: var(--mantine-shadow-sm);\n }\n\n &:where([data-has-groups]) {\n left: var(--resources-day-view-group-label-width);\n }\n}\n\n.resourcesDayViewGroupColumn {\n flex: 0 0 var(--resources-day-view-group-label-width);\n min-width: var(--resources-day-view-group-label-width);\n min-height: var(--resources-day-view-row-height);\n position: sticky;\n left: 0;\n z-index: 12;\n background-color: var(--mantine-color-body);\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n overflow-wrap: break-word;\n font-size: var(--mantine-font-size-sm);\n font-weight: var(--mantine-font-weight-medium);\n user-select: none;\n border-inline-end: 1px solid var(--resources-day-view-border-color);\n overflow: visible;\n\n &:where([data-group-position='first']),\n &:where([data-group-position='only']) {\n z-index: 13;\n }\n\n &:where([data-group-position='middle']),\n &:where([data-group-position='last']) {\n margin-top: -1px;\n min-height: calc(var(--resources-day-view-row-height) + 1px);\n }\n}\n\n.resourcesDayViewGroupColumnEmpty {\n flex: 0 0 var(--resources-day-view-group-label-width);\n min-width: var(--resources-day-view-group-label-width);\n min-height: var(--resources-day-view-row-height);\n position: sticky;\n left: 0;\n z-index: 12;\n background-color: var(--mantine-color-body);\n border-inline-end: 1px solid var(--resources-day-view-border-color);\n}\n\n.resourcesDayViewRowSlots {\n display: flex;\n position: relative;\n min-height: var(--resources-day-view-row-height);\n}\n\n.resourcesDayViewRowSlot {\n flex: 0 0 var(--resources-day-view-slot-width);\n min-width: var(--resources-day-view-slot-width);\n max-width: var(--resources-day-view-slot-width);\n min-height: var(--resources-day-view-row-height);\n border-inline-end: 1px solid var(--resources-day-view-border-color);\n cursor: pointer;\n position: relative;\n\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-1);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n }\n\n &:where(:last-of-type) {\n border-inline-end: none;\n }\n\n &:where(:focus) {\n z-index: 1;\n }\n\n &:where([data-business-hours]) {\n background-color: var(--resources-day-view-business-hours-bg);\n }\n\n &:where([data-non-business-hours]) {\n background-color: var(--resources-day-view-non-business-hours-bg);\n }\n\n &:where([data-drop-target]) {\n @mixin where-light {\n background-color: var(--mantine-color-blue-1);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-5);\n }\n\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 2;\n border: 1px solid;\n border-radius: 2px;\n\n @mixin where-light {\n border-color: var(--mantine-color-blue-4);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-blue-6);\n }\n }\n }\n\n &:where([data-drag-selected]) {\n &,\n &:hover {\n background-color: var(--mantine-primary-color-light);\n }\n\n &::before {\n content: '';\n position: absolute;\n inset: -1px;\n pointer-events: none;\n z-index: 2;\n border: 1px solid;\n\n @mixin where-light {\n border-color: var(--mantine-primary-color-2);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-primary-color-9);\n }\n }\n }\n\n &:where([data-drag-slot-index]) {\n touch-action: none;\n }\n\n &:where([data-static]) {\n cursor: default;\n pointer-events: none;\n }\n}\n\n.resourcesDayViewCurrentTimeIndicator {\n --_indicator-color: var(--resources-day-view-indicator-color, var(--mantine-color-red-7));\n --_time-bubble-height: 18px;\n --_thumb-size: 12px;\n\n position: absolute;\n pointer-events: none;\n top: 37px;\n bottom: 0;\n left: var(--indicator-left-offset);\n width: 2px;\n z-index: 3;\n\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n background-color: var(--_indicator-color);\n opacity: 0.2;\n }\n}\n\n.resourcesDayViewCurrentTimeIndicatorLine {\n width: 100%;\n position: absolute;\n top: 0;\n bottom: 0;\n background-color: var(--_indicator-color);\n}\n\n.resourcesDayViewCurrentTimeIndicatorThumb {\n position: absolute;\n top: calc(-1 * (var(--_thumb-size) / 2 - 1px));\n width: var(--_thumb-size);\n height: var(--_thumb-size);\n border-radius: 50%;\n border: 1px solid var(--mantine-color-body);\n background-color: var(--_indicator-color);\n left: calc(-1 * (var(--_thumb-size) / 2 - 1px));\n}\n\n.resourcesDayViewCurrentTimeIndicatorTimeBubble {\n position: absolute;\n height: var(--_time-bubble-height);\n width: var(--_time-bubble-width);\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 1000px;\n background-color: var(--_indicator-color);\n color: var(--mantine-color-white);\n font-size: var(--mantine-font-size-xs);\n font-weight: var(--mantine-font-weight-bold);\n box-shadow: var(--mantine-shadow-sm);\n white-space: nowrap;\n font-variant-numeric: tabular-nums;\n text-transform: uppercase;\n top: 0;\n left: calc(-1 * (var(--_time-bubble-width) / 2 - 1px));\n z-index: 3;\n}\n\n.resourcesDayViewBackgroundEvent {\n position: absolute;\n pointer-events: none;\n z-index: 2;\n border-radius: var(--resources-day-view-radius);\n background-color: var(--bg-event-bg);\n overflow: hidden;\n font-size: 12px;\n font-weight: var(--mantine-font-weight-medium);\n padding: 3px 4px;\n color: var(--bg-event-color);\n\n &:where([data-interactive]) {\n pointer-events: auto;\n cursor: pointer;\n user-select: none;\n\n @mixin hover {\n background-color: var(--bg-event-hover);\n }\n }\n}\n\n.resourcesDayViewAllDayEvent {\n position: absolute;\n inset-inline: 1px;\n height: var(--resources-day-view-all-day-height);\n z-index: 3;\n}\n\n.resourcesDayViewResizeHandle {\n position: absolute;\n top: 20%;\n width: 4px;\n height: 60%;\n cursor: ew-resize;\n z-index: 5;\n border-radius: 2px;\n opacity: 0;\n transition: opacity 100ms ease;\n pointer-events: all;\n background-color: var(--event-color);\n\n &::before {\n content: '';\n position: absolute;\n inset: -4px -6px;\n }\n\n &:where([data-edge='start']) {\n left: -2px;\n }\n\n &:where([data-edge='end']) {\n right: -2px;\n }\n}\n\n.resourcesDayViewEventWrapper {\n position: absolute;\n z-index: 3;\n\n &:hover .resourcesDayViewResizeHandle {\n opacity: 0.5;\n }\n\n & .resourcesDayViewResizeHandle:hover {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesDayViewResizeHandle:where([data-active]) {\n opacity: 0.8;\n }\n\n &:where([data-resizing]) .resourcesDayViewResizeHandle:not([data-active]) {\n opacity: 0;\n pointer-events: none;\n }\n}\n\n.resourcesDayView:where([data-event-interaction]) .resourcesDayViewRowSlot {\n pointer-events: none;\n}\n\n.resourcesDayView:where([data-event-interaction], [data-slot-dragging])\n .resourcesDayViewBackgroundEvent {\n pointer-events: none;\n}\n\n.resourcesDayView:where([data-resizing]) {\n & * {\n cursor: ew-resize !important;\n }\n\n & .resourcesDayViewEventWrapper:not([data-resizing]) {\n pointer-events: none;\n\n & .resourcesDayViewResizeHandle {\n opacity: 0;\n }\n }\n}\n\n.resourcesDayViewDragPreview {\n pointer-events: none;\n z-index: 3;\n border-radius: var(--resources-day-view-radius);\n border: 1px dashed var(--mantine-color-blue-filled);\n background-color: var(--mantine-color-blue-light);\n opacity: 0.6;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"ResourcesDayViewColumn.cjs","names":["UnstyledButton","getBusinessHoursMod","getLabel","Box"],"sources":["../../../src/components/ResourcesDayView/ResourcesDayViewColumn.tsx"],"sourcesContent":["import { Box, GetStylesApi, UnstyledButton } from '@mantine/core';\nimport { getLabel, ScheduleLabelsOverride } from '../../labels';\nimport { ScheduleMode, ScheduleResourceData, ScheduleResourceGroup } from '../../types';\nimport {\n DayTimeInterval,\n getBusinessHoursMod,\n ResourceGroupInfo,\n ResourcesGridControlsRef,\n} from '../../utils';\nimport type { ResourcesDayViewFactory } from './ResourcesDayView';\n\nexport interface ResourcesDayViewRowProps {\n resource: ScheduleResourceData;\n resourceIndex: number;\n date: string;\n slots: DayTimeInterval[];\n getStyles: GetStylesApi<ResourcesDayViewFactory>;\n children?: React.ReactNode;\n labels?: ScheduleLabelsOverride;\n highlightBusinessHours?: boolean;\n businessHours?: [string, string];\n withEventsDragAndDrop?: boolean;\n onRowSlotsDragOver?: (\n e: React.DragEvent<HTMLDivElement>,\n resourceId: string | number,\n resourceIndex: number\n ) => void;\n onRowSlotsDragLeave?: () => void;\n onRowSlotsDrop?: (\n e: React.DragEvent<HTMLDivElement>,\n resourceId: string | number,\n resourceIndex: number\n ) => void;\n onSlotClick?: (\n resourceId: string | number,\n slotTime: string,\n event: React.MouseEvent<HTMLButtonElement>\n ) => void;\n dropTargetSlotIndex?: number;\n mode?: ScheduleMode;\n slotsRef?: ResourcesGridControlsRef;\n firstSlotIndex?: { resourceIndex: number; slotIndex: number };\n onSlotKeyDown?: (\n event: React.KeyboardEvent<HTMLButtonElement>,\n resourceIndex: number,\n slotIndex: number\n ) => void;\n withDragSlotSelect?: boolean;\n onSlotPointerDown?: (\n event: React.PointerEvent<HTMLButtonElement>,\n index: number,\n group: string\n ) => void;\n isSlotDragSelected?: (index: number, group: string) => boolean;\n rowSlotsContainerRef?: (node: HTMLDivElement | null) => void;\n renderResourceLabel?: (resource: ScheduleResourceData) => React.ReactNode;\n renderGroupLabel?: (group: ScheduleResourceGroup) => React.ReactNode;\n scrolledX?: boolean;\n groupInfo?: ResourceGroupInfo | null;\n allDayCount?: number;\n}\n\nexport function ResourcesDayViewRow({\n resource,\n resourceIndex,\n date,\n slots,\n getStyles,\n children,\n labels,\n highlightBusinessHours,\n businessHours,\n withEventsDragAndDrop,\n onRowSlotsDragOver,\n onRowSlotsDragLeave,\n onRowSlotsDrop,\n onSlotClick,\n dropTargetSlotIndex,\n mode,\n slotsRef,\n firstSlotIndex,\n onSlotKeyDown,\n withDragSlotSelect,\n onSlotPointerDown,\n isSlotDragSelected,\n rowSlotsContainerRef,\n renderResourceLabel,\n renderGroupLabel,\n scrolledX,\n groupInfo,\n allDayCount,\n}: ResourcesDayViewRowProps) {\n const slotGroup = String(resource.id);\n\n const items = slots.map((slot, slotIndex) => {\n const isDropTarget = dropTargetSlotIndex === slotIndex;\n const isFirstSlot =\n firstSlotIndex?.resourceIndex === resourceIndex && firstSlotIndex?.slotIndex === slotIndex;\n const isDragSelected = isSlotDragSelected?.(slotIndex, slotGroup) || false;\n\n return (\n <UnstyledButton\n key={slot.startTime}\n ref={(node) => {\n if (!slotsRef?.current) {\n return;\n }\n if (!slotsRef.current[resourceIndex]) {\n slotsRef.current[resourceIndex] = [];\n }\n const row = slotsRef.current[resourceIndex];\n if (node) {\n row[slotIndex] = node;\n } else {\n delete row[slotIndex];\n while (row.length > 0 && row[row.length - 1] == null) {\n row.length -= 1;\n }\n }\n }}\n {...getStyles('resourcesDayViewRowSlot')}\n mod={{\n 'hour-start': slot.isHourStart,\n ...getBusinessHoursMod({\n time: slot.startTime,\n businessHours,\n highlightBusinessHours,\n }),\n 'drop-target': isDropTarget,\n 'drag-selected': isDragSelected,\n static: mode === 'static',\n }}\n aria-label={`${getLabel('resourceSlot', labels)} ${resource.label} ${date} ${slot.startTime} - ${slot.endTime}`}\n tabIndex={mode === 'static' ? -1 : isFirstSlot ? 0 : -1}\n data-drag-slot-index={withDragSlotSelect && mode !== 'static' ? slotIndex : undefined}\n data-drag-slot-group={withDragSlotSelect && mode !== 'static' ? slotGroup : undefined}\n onKeyDown={(e) => {\n if (onSlotKeyDown) {\n onSlotKeyDown(e, resourceIndex, slotIndex);\n }\n }}\n onPointerDown={\n withDragSlotSelect && mode !== 'static'\n ? (e) => onSlotPointerDown?.(e, slotIndex, slotGroup)\n : undefined\n }\n onClick={\n mode === 'static' || !onSlotClick\n ? undefined\n : (e) => onSlotClick(resource.id, slot.startTime, e)\n }\n onDragOver={\n withEventsDragAndDrop && mode !== 'static' ? (e) => e.preventDefault() : undefined\n }\n />\n );\n });\n\n const isGroupStart = groupInfo?.position === 'first' || groupInfo?.position === 'only';\n const groupCell =\n groupInfo !== undefined ? (\n groupInfo !== null ? (\n <Box\n {...getStyles('resourcesDayViewGroupColumn')}\n mod={{ 'scrolled-x': scrolledX, 'group-position': groupInfo.position }}\n >\n {isGroupStart && (\n <span\n style={\n groupInfo.count > 1\n ? {\n transform: `translateY(calc((${groupInfo.count - 1} * (var(--resources-day-view-row-height) + 1px)) / 2))`,\n }\n : undefined\n }\n >\n {renderGroupLabel ? renderGroupLabel(groupInfo.group) : groupInfo.group.label}\n </span>\n )}\n </Box>\n ) : (\n <Box {...getStyles('resourcesDayViewGroupColumnEmpty')} mod={{ 'scrolled-x': scrolledX }} />\n )\n ) : null;\n\n return (\n <Box {...getStyles('resourcesDayViewRow')}>\n {groupCell}\n <Box\n {...getStyles('resourcesDayViewResourceLabel')}\n mod={{ 'scrolled-x': scrolledX, 'has-groups': groupInfo !== undefined }}\n >\n {renderResourceLabel ? renderResourceLabel(resource) : resource.label}\n </Box>\n <Box\n ref={rowSlotsContainerRef}\n {...getStyles('resourcesDayViewRowSlots', {\n style: allDayCount\n ? {\n minHeight: `max(var(--resources-day-view-row-height), calc(${allDayCount} * (var(--resources-day-view-all-day-height) + 2px) + 4px))`,\n }\n : undefined,\n })}\n onDragOver={\n withEventsDragAndDrop && mode !== 'static'\n ? (e) => onRowSlotsDragOver?.(e, resource.id, resourceIndex)\n : undefined\n }\n onDragLeave={withEventsDragAndDrop && mode !== 'static' ? onRowSlotsDragLeave : undefined}\n onDrop={\n withEventsDragAndDrop && mode !== 'static'\n ? (e) => onRowSlotsDrop?.(e, resource.id, resourceIndex)\n : undefined\n }\n >\n {children}\n {items}\n </Box>\n </Box>\n );\n}\n"],"mappings":";;;;;;AA8DA,SAAgB,oBAAoB,EAClC,UACA,eACA,MACA,OACA,WACA,UACA,QACA,wBACA,eACA,uBACA,oBACA,qBACA,gBACA,aACA,qBACA,MACA,UACA,gBACA,eACA,oBACA,mBACA,oBACA,sBACA,qBACA,kBACA,WACA,WACA,eAC2B;CAC3B,MAAM,YAAY,OAAO,SAAS,EAAE;CAEpC,MAAM,QAAQ,MAAM,KAAK,MAAM,cAAc;EAC3C,MAAM,eAAe,wBAAwB;EAC7C,MAAM,cACJ,gBAAgB,kBAAkB,iBAAiB,gBAAgB,cAAc;EACnF,MAAM,iBAAiB,qBAAqB,WAAW,SAAS,KAAK;EAErE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACA,cAAAA,gBAAD;GAEE,MAAM,SAAS;IACb,IAAI,CAAC,UAAU,SACb;IAEF,IAAI,CAAC,SAAS,QAAQ,gBACpB,SAAS,QAAQ,iBAAiB,CAAC;IAErC,MAAM,MAAM,SAAS,QAAQ;IAC7B,IAAI,MACF,IAAI,aAAa;SACZ;KACL,OAAO,IAAI;KACX,OAAO,IAAI,SAAS,KAAK,IAAI,IAAI,SAAS,MAAM,MAC9C,IAAI,UAAU;IAElB;GACF;GACA,GAAI,UAAU,yBAAyB;GACvC,KAAK;IACH,cAAc,KAAK;IACnB,GAAGC,+BAAAA,oBAAoB;KACrB,MAAM,KAAK;KACX;KACA;IACF,CAAC;IACD,eAAe;IACf,iBAAiB;IACjB,QAAQ,SAAS;GACnB;GACA,cAA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BAAA,GAAA,kBAAA,IAAA,CAACA,cAAAA,KAAD;IACE,GAAI,UAAU,+BAA+B;IAC7C,KAAK;KAAE,cAAc;KAAW,cAAc,cAAc,KAAA;IAAU;cAErE,sBAAsB,oBAAoB,QAAQ,IAAI,SAAS;GAC7D,CAAA;GACL,iBAAA,GAAA,kBAAA,KAAA,CAACA,cAAAA,KAAD;IACE,KAAK;IACL,GAAI,UAAU,4BAA4B,EACxC,OAAO,cACH,EACE,WAAW,kDAAkD,YAAY,6DAC3E,IACA,KAAA,EACN,CAAC;IACD,YACE,yBAAyB,SAAS,YAC7B,MAAM,qBAAqB,GAAG,SAAS,IAAI,aAAa,IACzD,KAAA;IAEN,aAAa,yBAAyB,SAAS,WAAW,sBAAsB,KAAA;IAChF,QACE,yBAAyB,SAAS,YAC7B,MAAM,iBAAiB,GAAG,SAAS,IAAI,aAAa,IACrD,KAAA;cAlBR,CAqBG,UACA,KACE;;EACF;;AAET"}
1
+ {"version":3,"file":"ResourcesDayViewColumn.cjs","names":["UnstyledButton","getBusinessHoursMod","getLabel","Box"],"sources":["../../../src/components/ResourcesDayView/ResourcesDayViewColumn.tsx"],"sourcesContent":["import { Box, GetStylesApi, UnstyledButton } from '@mantine/core';\nimport { getLabel, ScheduleLabelsOverride } from '../../labels';\nimport { ScheduleMode, ScheduleResourceData, ScheduleResourceGroup } from '../../types';\nimport {\n DayTimeInterval,\n getBusinessHoursMod,\n ResourceGroupInfo,\n ResourcesGridControlsRef,\n} from '../../utils';\nimport type { ResourcesDayViewFactory } from './ResourcesDayView';\n\nexport interface ResourcesDayViewRowProps {\n resource: ScheduleResourceData;\n resourceIndex: number;\n date: string;\n slots: DayTimeInterval[];\n getStyles: GetStylesApi<ResourcesDayViewFactory>;\n children?: React.ReactNode;\n labels?: ScheduleLabelsOverride;\n highlightBusinessHours?: boolean;\n businessHours?: [string, string];\n withEventsDragAndDrop?: boolean;\n onRowSlotsDragOver?: (\n e: React.DragEvent<HTMLDivElement>,\n resourceId: string | number,\n resourceIndex: number\n ) => void;\n onRowSlotsDragLeave?: () => void;\n onRowSlotsDrop?: (\n e: React.DragEvent<HTMLDivElement>,\n resourceId: string | number,\n resourceIndex: number\n ) => void;\n onSlotClick?: (\n resourceId: string | number,\n slotTime: string,\n event: React.MouseEvent<HTMLButtonElement>\n ) => void;\n dropTargetSlotIndex?: number;\n mode?: ScheduleMode;\n slotsRef?: ResourcesGridControlsRef;\n firstSlotIndex?: { resourceIndex: number; slotIndex: number };\n onSlotKeyDown?: (\n event: React.KeyboardEvent<HTMLButtonElement>,\n resourceIndex: number,\n slotIndex: number\n ) => void;\n withDragSlotSelect?: boolean;\n onSlotPointerDown?: (\n event: React.PointerEvent<HTMLButtonElement>,\n index: number,\n group: string\n ) => void;\n isSlotDragSelected?: (index: number, group: string) => boolean;\n rowSlotsContainerRef?: (node: HTMLDivElement | null) => void;\n renderResourceLabel?: (resource: ScheduleResourceData) => React.ReactNode;\n renderGroupLabel?: (group: ScheduleResourceGroup) => React.ReactNode;\n scrolledX?: boolean;\n groupInfo?: ResourceGroupInfo | null;\n allDayCount?: number;\n}\n\nexport function ResourcesDayViewRow({\n resource,\n resourceIndex,\n date,\n slots,\n getStyles,\n children,\n labels,\n highlightBusinessHours,\n businessHours,\n withEventsDragAndDrop,\n onRowSlotsDragOver,\n onRowSlotsDragLeave,\n onRowSlotsDrop,\n onSlotClick,\n dropTargetSlotIndex,\n mode,\n slotsRef,\n firstSlotIndex,\n onSlotKeyDown,\n withDragSlotSelect,\n onSlotPointerDown,\n isSlotDragSelected,\n rowSlotsContainerRef,\n renderResourceLabel,\n renderGroupLabel,\n scrolledX,\n groupInfo,\n allDayCount,\n}: ResourcesDayViewRowProps) {\n const slotGroup = String(resource.id);\n\n const items = slots.map((slot, slotIndex) => {\n const isDropTarget = dropTargetSlotIndex === slotIndex;\n const isFirstSlot =\n firstSlotIndex?.resourceIndex === resourceIndex && firstSlotIndex?.slotIndex === slotIndex;\n const isDragSelected = isSlotDragSelected?.(slotIndex, slotGroup) || false;\n\n return (\n <UnstyledButton\n key={slot.startTime}\n ref={(node) => {\n if (!slotsRef?.current) {\n return;\n }\n if (!slotsRef.current[resourceIndex]) {\n slotsRef.current[resourceIndex] = [];\n }\n const row = slotsRef.current[resourceIndex];\n if (node) {\n row[slotIndex] = node;\n } else {\n delete row[slotIndex];\n while (row.length > 0 && row[row.length - 1] == null) {\n row.length -= 1;\n }\n }\n }}\n {...getStyles('resourcesDayViewRowSlot')}\n mod={{\n 'hour-start': slot.isHourStart,\n ...getBusinessHoursMod({\n time: slot.startTime,\n businessHours,\n highlightBusinessHours,\n }),\n 'drop-target': isDropTarget,\n 'drag-selected': isDragSelected,\n static: mode === 'static',\n }}\n aria-label={`${getLabel('resourceSlot', labels)} ${resource.label} ${date} ${slot.startTime} - ${slot.endTime}`}\n tabIndex={mode === 'static' ? -1 : isFirstSlot ? 0 : -1}\n data-drag-slot-index={withDragSlotSelect && mode !== 'static' ? slotIndex : undefined}\n data-drag-slot-group={withDragSlotSelect && mode !== 'static' ? slotGroup : undefined}\n onKeyDown={(e) => {\n if (onSlotKeyDown) {\n onSlotKeyDown(e, resourceIndex, slotIndex);\n }\n }}\n onPointerDown={\n withDragSlotSelect && mode !== 'static'\n ? (e) => onSlotPointerDown?.(e, slotIndex, slotGroup)\n : undefined\n }\n onClick={\n mode === 'static' || !onSlotClick\n ? undefined\n : (e) => onSlotClick(resource.id, slot.startTime, e)\n }\n onDragOver={\n withEventsDragAndDrop && mode !== 'static' ? (e) => e.preventDefault() : undefined\n }\n />\n );\n });\n\n const isGroupStart = groupInfo?.position === 'first' || groupInfo?.position === 'only';\n const groupCell =\n groupInfo !== undefined ? (\n groupInfo !== null ? (\n <Box\n {...getStyles('resourcesDayViewGroupColumn')}\n mod={{ 'scrolled-x': scrolledX, 'group-position': groupInfo.position }}\n >\n {isGroupStart && (\n <span\n style={\n groupInfo.count > 1\n ? {\n transform: `translateY(calc((${groupInfo.count - 1} * (var(--resources-day-view-row-height) + 1px)) / 2))`,\n }\n : undefined\n }\n >\n {renderGroupLabel ? renderGroupLabel(groupInfo.group) : groupInfo.group.label}\n </span>\n )}\n </Box>\n ) : (\n <Box {...getStyles('resourcesDayViewGroupColumnEmpty')} mod={{ 'scrolled-x': scrolledX }} />\n )\n ) : null;\n\n return (\n <Box {...getStyles('resourcesDayViewRow')}>\n {groupCell}\n <Box\n {...getStyles('resourcesDayViewResourceLabel')}\n mod={{ 'scrolled-x': scrolledX, 'has-groups': groupInfo !== undefined }}\n >\n {renderResourceLabel ? renderResourceLabel(resource) : resource.label}\n </Box>\n <Box\n ref={rowSlotsContainerRef}\n {...getStyles('resourcesDayViewRowSlots', {\n style: allDayCount\n ? {\n minHeight: `max(var(--resources-day-view-row-height), calc(${allDayCount} * (var(--resources-day-view-all-day-height) + 2px) + 4px))`,\n }\n : undefined,\n })}\n onDragOver={\n withEventsDragAndDrop && mode !== 'static'\n ? (e) => onRowSlotsDragOver?.(e, resource.id, resourceIndex)\n : undefined\n }\n onDragLeave={withEventsDragAndDrop && mode !== 'static' ? onRowSlotsDragLeave : undefined}\n onDrop={\n withEventsDragAndDrop && mode !== 'static'\n ? (e) => onRowSlotsDrop?.(e, resource.id, resourceIndex)\n : undefined\n }\n >\n {children}\n {items}\n </Box>\n </Box>\n );\n}\n"],"mappings":";;;;;;AA8DA,SAAgB,oBAAoB,EAClC,UACA,eACA,MACA,OACA,WACA,UACA,QACA,wBACA,eACA,uBACA,oBACA,qBACA,gBACA,aACA,qBACA,MACA,UACA,gBACA,eACA,oBACA,mBACA,oBACA,sBACA,qBACA,kBACA,WACA,WACA,eAC2B;CAC3B,MAAM,YAAY,OAAO,SAAS,EAAE;CAEpC,MAAM,QAAQ,MAAM,KAAK,MAAM,cAAc;EAC3C,MAAM,eAAe,wBAAwB;EAC7C,MAAM,cACJ,gBAAgB,kBAAkB,iBAAiB,gBAAgB,cAAc;EACnF,MAAM,iBAAiB,qBAAqB,WAAW,SAAS,KAAK;EAErE,OACE,iBAAA,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AA6B;EAC3C,KAAK;GAAE,cAAc;GAAW,kBAAkB,UAAU;EAAS;EAEpE,UAAA,gBACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;GACE,OACE,UAAU,QAAQ,IACd,EACE,WAAW,oBAAoB,UAAU,QAAQ,EAAE,wDACrD,IACA,KAAA;GAGL,UAAA,mBAAmB,iBAAiB,UAAU,KAAK,IAAI,UAAU,MAAM;EACpE,CAAA;CAEL,CAAA,IAEL,iBAAA,GAAA,kBAAA,IAAA,CAACA,cAAAA,KAAD;EAAK,GAAI,UAAU,kCAAkC;EAAG,KAAK,EAAE,cAAc,UAAU;CAAI,CAAA,IAE3F;CAEN,OACE,iBAAA,GAAA,kBAAA,KAAA,CAACA,cAAAA,KAAD;EAAK,GAAI,UAAU,qBAAqB;EAAxC,UAAA;GACG;GACD,iBAAA,GAAA,kBAAA,IAAA,CAACA,cAAAA,KAAD;IACE,GAAI,UAAU,+BAA+B;IAC7C,KAAK;KAAE,cAAc;KAAW,cAAc,cAAc,KAAA;IAAU;IAErE,UAAA,sBAAsB,oBAAoB,QAAQ,IAAI,SAAS;GAC7D,CAAA;GACL,iBAAA,GAAA,kBAAA,KAAA,CAACA,cAAAA,KAAD;IACE,KAAK;IACL,GAAI,UAAU,4BAA4B,EACxC,OAAO,cACH,EACE,WAAW,kDAAkD,YAAY,6DAC3E,IACA,KAAA,EACN,CAAC;IACD,YACE,yBAAyB,SAAS,YAC7B,MAAM,qBAAqB,GAAG,SAAS,IAAI,aAAa,IACzD,KAAA;IAEN,aAAa,yBAAyB,SAAS,WAAW,sBAAsB,KAAA;IAChF,QACE,yBAAyB,SAAS,YAC7B,MAAM,iBAAiB,GAAG,SAAS,IAAI,aAAa,IACrD,KAAA;IAlBR,UAAA,CAqBG,UACA,KACE;;EACF;;AAET"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-resources-day-view-events.cjs","names":["isEventInTimeRange","validateEvent","getDayPositionedEvents","isAllDayEvent","getDayPosition"],"sources":["../../../../src/components/ResourcesDayView/get-resources-day-view-events/get-resources-day-view-events.ts"],"sourcesContent":["import dayjs from 'dayjs';\nimport {\n AnyDateValue,\n DayPositionedEventData,\n ScheduleEventData,\n ScheduleResourceData,\n} from '../../../types';\nimport { getDayPosition, isAllDayEvent, isEventInTimeRange, validateEvent } from '../../../utils';\nimport { getDayPositionedEvents } from '../../DayView/get-day-view-events/get-day-positioned-events';\n\ninterface GetResourcesDayViewEventsInput {\n events: ScheduleEventData[] | undefined;\n resources: ScheduleResourceData[];\n date: AnyDateValue;\n startTime?: string;\n endTime?: string;\n intervalMinutes?: number;\n}\n\nexport interface ResourcesDayViewEventsResult {\n regularEvents: Record<string | number, DayPositionedEventData[]>;\n allDayEvents: Record<string | number, DayPositionedEventData[]>;\n backgroundTimedEvents: Record<string | number, DayPositionedEventData[]>;\n backgroundAllDayEvents: Record<string | number, DayPositionedEventData[]>;\n}\n\nexport function getResourcesDayViewEvents({\n events,\n resources,\n date,\n startTime,\n endTime,\n intervalMinutes,\n}: GetResourcesDayViewEventsInput): ResourcesDayViewEventsResult {\n const result: ResourcesDayViewEventsResult = {\n regularEvents: {},\n allDayEvents: {},\n backgroundTimedEvents: {},\n backgroundAllDayEvents: {},\n };\n\n for (const resource of resources) {\n result.regularEvents[resource.id] = [];\n result.allDayEvents[resource.id] = [];\n result.backgroundTimedEvents[resource.id] = [];\n result.backgroundAllDayEvents[resource.id] = [];\n }\n\n if (events === undefined) {\n return result;\n }\n\n const dayStart = dayjs(date).startOf('day');\n const dayEnd = dayjs(date).endOf('day');\n\n const eventsByResource: Record<string | number, ScheduleEventData[]> = {};\n const backgroundByResource: Record<string | number, ScheduleEventData[]> = {};\n\n for (const resource of resources) {\n eventsByResource[resource.id] = [];\n backgroundByResource[resource.id] = [];\n }\n\n const ids = new Set<string | number>();\n\n for (const event of events) {\n if (event.resourceId === undefined) {\n continue;\n }\n\n if (!(event.resourceId in eventsByResource)) {\n continue;\n }\n\n const eventStart = dayjs(event.start);\n const eventEnd = dayjs(event.end);\n\n const isOnDay = eventStart.isSame(dayStart, 'day');\n const overlapsDay = eventStart.isBefore(dayEnd) && eventEnd.isAfter(dayStart);\n\n if (isOnDay || overlapsDay) {\n if (isOnDay && !isEventInTimeRange({ event, startTime, endTime })) {\n continue;\n }\n\n const validated = validateEvent(event);\n\n if (!ids.has(event.id)) {\n ids.add(event.id);\n } else {\n throw new Error(\n `[@mantine/schedule] ResourcesDayView: Duplicated event ids found: ${event.id}`\n );\n }\n\n if (event.display === 'background') {\n backgroundByResource[event.resourceId].push(validated);\n } else if (isOnDay) {\n eventsByResource[event.resourceId].push(validated);\n } else {\n const clippedStart = eventStart.isBefore(dayStart) ? dayStart : eventStart;\n const clippedEnd = eventEnd.isAfter(dayEnd) ? dayEnd : eventEnd;\n\n const clippedEvent = {\n ...validated,\n start: clippedStart.format('YYYY-MM-DD HH:mm:ss'),\n end: clippedEnd.format('YYYY-MM-DD HH:mm:ss'),\n };\n\n if (isEventInTimeRange({ event: clippedEvent, startTime, endTime })) {\n eventsByResource[event.resourceId].push(clippedEvent);\n }\n }\n }\n }\n\n for (const resource of resources) {\n const positioned = getDayPositionedEvents({\n events: eventsByResource[resource.id],\n startTime,\n endTime,\n date,\n intervalMinutes,\n });\n\n for (const event of positioned) {\n if (event.position.allDay) {\n result.allDayEvents[resource.id].push(event);\n } else {\n result.regularEvents[resource.id].push(event);\n }\n }\n\n for (const event of backgroundByResource[resource.id]) {\n const eventStart = dayjs(event.start);\n const eventEnd = dayjs(event.end);\n const clippedStart = eventStart.isBefore(dayStart) ? dayStart : eventStart;\n const clippedEnd = eventEnd.isAfter(dayEnd) ? dayEnd : eventEnd;\n\n const clippedEvent = {\n ...event,\n start: clippedStart.format('YYYY-MM-DD HH:mm:ss'),\n end: clippedEnd.format('YYYY-MM-DD HH:mm:ss'),\n };\n\n const allDay = isAllDayEvent({ event: clippedEvent, date });\n\n if (allDay) {\n result.backgroundAllDayEvents[resource.id].push({\n ...event,\n position: {\n top: 0,\n height: 100,\n allDay: true,\n width: 100,\n offset: 0,\n column: 0,\n overlaps: 1,\n },\n });\n } else {\n const { top, height } = getDayPosition({\n event: clippedEvent,\n startTime,\n endTime,\n intervalMinutes,\n });\n if (height <= 0) {\n continue;\n }\n result.backgroundTimedEvents[resource.id].push({\n ...event,\n position: { top, height, allDay: false, width: 100, offset: 0, column: 0, overlaps: 1 },\n });\n }\n }\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;AA0BA,SAAgB,0BAA0B,EACxC,QACA,WACA,MACA,WACA,SACA,mBAC+D;CAC/D,MAAM,SAAuC;EAC3C,eAAe,CAAC;EAChB,cAAc,CAAC;EACf,uBAAuB,CAAC;EACxB,wBAAwB,CAAC;CAC3B;CAEA,KAAK,MAAM,YAAY,WAAW;EAChC,OAAO,cAAc,SAAS,MAAM,CAAC;EACrC,OAAO,aAAa,SAAS,MAAM,CAAC;EACpC,OAAO,sBAAsB,SAAS,MAAM,CAAC;EAC7C,OAAO,uBAAuB,SAAS,MAAM,CAAC;CAChD;CAEA,IAAI,WAAW,KAAA,GACb,OAAO;CAGT,MAAM,YAAA,GAAA,MAAA,QAAA,CAAiB,IAAI,CAAC,CAAC,QAAQ,KAAK;CAC1C,MAAM,UAAA,GAAA,MAAA,QAAA,CAAe,IAAI,CAAC,CAAC,MAAM,KAAK;CAEtC,MAAM,mBAAiE,CAAC;CACxE,MAAM,uBAAqE,CAAC;CAE5E,KAAK,MAAM,YAAY,WAAW;EAChC,iBAAiB,SAAS,MAAM,CAAC;EACjC,qBAAqB,SAAS,MAAM,CAAC;CACvC;CAEA,MAAM,sBAAM,IAAI,IAAqB;CAErC,KAAK,MAAM,SAAS,QAAQ;EAC1B,IAAI,MAAM,eAAe,KAAA,GACvB;EAGF,IAAI,EAAE,MAAM,cAAc,mBACxB;EAGF,MAAM,cAAA,GAAA,MAAA,QAAA,CAAmB,MAAM,KAAK;EACpC,MAAM,YAAA,GAAA,MAAA,QAAA,CAAiB,MAAM,GAAG;EAEhC,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,MAAM,GAAG;GAChC,MAAM,eAAe,WAAW,SAAS,QAAQ,IAAI,WAAW;GAChE,MAAM,aAAa,SAAS,QAAQ,MAAM,IAAI,SAAS;GAEvD,MAAM,eAAe;IACnB,GAAG;IACH,OAAO,aAAa,OAAO,qBAAqB;IAChD,KAAK,WAAW,OAAO,qBAAqB;GAC9C;GAIA,IAFeC,yBAAAA,cAAc;IAAE,OAAO;IAAc;GAAK,CAEhD,GACP,OAAO,uBAAuB,SAAS,GAAG,CAAC,KAAK;IAC9C,GAAG;IACH,UAAU;KACR,KAAK;KACL,QAAQ;KACR,QAAQ;KACR,OAAO;KACP,QAAQ;KACR,QAAQ;KACR,UAAU;IACZ;GACF,CAAC;QACI;IACL,MAAM,EAAE,KAAK,WAAWC,yBAAAA,eAAe;KACrC,OAAO;KACP;KACA;KACA;IACF,CAAC;IACD,IAAI,UAAU,GACZ;IAEF,OAAO,sBAAsB,SAAS,GAAG,CAAC,KAAK;KAC7C,GAAG;KACH,UAAU;MAAE;MAAK;MAAQ,QAAQ;MAAO,OAAO;MAAK,QAAQ;MAAG,QAAQ;MAAG,UAAU;KAAE;IACxF,CAAC;GACH;EACF;CACF;CAEA,OAAO;AACT"}
1
+ {"version":3,"file":"get-resources-day-view-events.cjs","names":["isEventInTimeRange","validateEvent","getDayPositionedEvents","isAllDayEvent","getDayPosition"],"sources":["../../../../src/components/ResourcesDayView/get-resources-day-view-events/get-resources-day-view-events.ts"],"sourcesContent":["import dayjs from 'dayjs';\nimport {\n AnyDateValue,\n DayPositionedEventData,\n ScheduleEventData,\n ScheduleResourceData,\n} from '../../../types';\nimport { getDayPosition, isAllDayEvent, isEventInTimeRange, validateEvent } from '../../../utils';\nimport { getDayPositionedEvents } from '../../DayView/get-day-view-events/get-day-positioned-events';\n\ninterface GetResourcesDayViewEventsInput {\n events: ScheduleEventData[] | undefined;\n resources: ScheduleResourceData[];\n date: AnyDateValue;\n startTime?: string;\n endTime?: string;\n intervalMinutes?: number;\n}\n\nexport interface ResourcesDayViewEventsResult {\n regularEvents: Record<string | number, DayPositionedEventData[]>;\n allDayEvents: Record<string | number, DayPositionedEventData[]>;\n backgroundTimedEvents: Record<string | number, DayPositionedEventData[]>;\n backgroundAllDayEvents: Record<string | number, DayPositionedEventData[]>;\n}\n\nexport function getResourcesDayViewEvents({\n events,\n resources,\n date,\n startTime,\n endTime,\n intervalMinutes,\n}: GetResourcesDayViewEventsInput): ResourcesDayViewEventsResult {\n const result: ResourcesDayViewEventsResult = {\n regularEvents: {},\n allDayEvents: {},\n backgroundTimedEvents: {},\n backgroundAllDayEvents: {},\n };\n\n for (const resource of resources) {\n result.regularEvents[resource.id] = [];\n result.allDayEvents[resource.id] = [];\n result.backgroundTimedEvents[resource.id] = [];\n result.backgroundAllDayEvents[resource.id] = [];\n }\n\n if (events === undefined) {\n return result;\n }\n\n const dayStart = dayjs(date).startOf('day');\n const dayEnd = dayjs(date).endOf('day');\n\n const eventsByResource: Record<string | number, ScheduleEventData[]> = {};\n const backgroundByResource: Record<string | number, ScheduleEventData[]> = {};\n\n for (const resource of resources) {\n eventsByResource[resource.id] = [];\n backgroundByResource[resource.id] = [];\n }\n\n const ids = new Set<string | number>();\n\n for (const event of events) {\n if (event.resourceId === undefined) {\n continue;\n }\n\n if (!(event.resourceId in eventsByResource)) {\n continue;\n }\n\n const eventStart = dayjs(event.start);\n const eventEnd = dayjs(event.end);\n\n const isOnDay = eventStart.isSame(dayStart, 'day');\n const overlapsDay = eventStart.isBefore(dayEnd) && eventEnd.isAfter(dayStart);\n\n if (isOnDay || overlapsDay) {\n if (isOnDay && !isEventInTimeRange({ event, startTime, endTime })) {\n continue;\n }\n\n const validated = validateEvent(event);\n\n if (!ids.has(event.id)) {\n ids.add(event.id);\n } else {\n throw new Error(\n `[@mantine/schedule] ResourcesDayView: Duplicated event ids found: ${event.id}`\n );\n }\n\n if (event.display === 'background') {\n backgroundByResource[event.resourceId].push(validated);\n } else if (isOnDay) {\n eventsByResource[event.resourceId].push(validated);\n } else {\n const clippedStart = eventStart.isBefore(dayStart) ? dayStart : eventStart;\n const clippedEnd = eventEnd.isAfter(dayEnd) ? dayEnd : eventEnd;\n\n const clippedEvent = {\n ...validated,\n start: clippedStart.format('YYYY-MM-DD HH:mm:ss'),\n end: clippedEnd.format('YYYY-MM-DD HH:mm:ss'),\n };\n\n if (isEventInTimeRange({ event: clippedEvent, startTime, endTime })) {\n eventsByResource[event.resourceId].push(clippedEvent);\n }\n }\n }\n }\n\n for (const resource of resources) {\n const positioned = getDayPositionedEvents({\n events: eventsByResource[resource.id],\n startTime,\n endTime,\n date,\n intervalMinutes,\n });\n\n for (const event of positioned) {\n if (event.position.allDay) {\n result.allDayEvents[resource.id].push(event);\n } else {\n result.regularEvents[resource.id].push(event);\n }\n }\n\n for (const event of backgroundByResource[resource.id]) {\n const eventStart = dayjs(event.start);\n const eventEnd = dayjs(event.end);\n const clippedStart = eventStart.isBefore(dayStart) ? dayStart : eventStart;\n const clippedEnd = eventEnd.isAfter(dayEnd) ? dayEnd : eventEnd;\n\n const clippedEvent = {\n ...event,\n start: clippedStart.format('YYYY-MM-DD HH:mm:ss'),\n end: clippedEnd.format('YYYY-MM-DD HH:mm:ss'),\n };\n\n const allDay = isAllDayEvent({ event: clippedEvent, date });\n\n if (allDay) {\n result.backgroundAllDayEvents[resource.id].push({\n ...event,\n position: {\n top: 0,\n height: 100,\n allDay: true,\n width: 100,\n offset: 0,\n column: 0,\n overlaps: 1,\n },\n });\n } else {\n const { top, height } = getDayPosition({\n event: clippedEvent,\n startTime,\n endTime,\n intervalMinutes,\n });\n if (height <= 0) {\n continue;\n }\n result.backgroundTimedEvents[resource.id].push({\n ...event,\n position: { top, height, allDay: false, width: 100, offset: 0, column: 0, overlaps: 1 },\n });\n }\n }\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;AA0BA,SAAgB,0BAA0B,EACxC,QACA,WACA,MACA,WACA,SACA,mBAC+D;CAC/D,MAAM,SAAuC;EAC3C,eAAe,CAAC;EA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AQ;KACR,QAAQ;KACR,UAAU;IACZ;GACF,CAAC;QACI;IACL,MAAM,EAAE,KAAK,WAAWC,yBAAAA,eAAe;KACrC,OAAO;KACP;KACA;KACA;IACF,CAAC;IACD,IAAI,UAAU,GACZ;IAEF,OAAO,sBAAsB,SAAS,GAAG,CAAC,KAAK;KAC7C,GAAG;KACH,UAAU;MAAE;MAAK;MAAQ,QAAQ;MAAO,OAAO;MAAK,QAAQ;MAAG,QAAQ;MAAG,UAAU;KAAE;IACxF,CAAC;GACH;EACF;CACF;CAEA,OAAO;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"ResourcesMonthView.cjs","names":["getOrderedResources","expandRecurringEvents","useDayGridEventResize","useDragDropHandlers","calculateMonthDropDate","getGroupToResourceIdMap","useSlotDragSelect","Box","formatDate","getIndexFromDragPoint","ScheduleEvent","MoreEvents","UnstyledButton","ScheduleHeaderBase","toDateString","ScrollArea","getLabel","DragContext","classes"],"sources":["../../../src/components/ResourcesMonthView/ResourcesMonthView.tsx"],"sourcesContent":["import dayjs from 'dayjs';\nimport { useCallback, useMemo, useRef } from 'react';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n DataAttributes,\n ElementProps,\n factory,\n Factory,\n getRadius,\n MantineRadius,\n rem,\n ScrollArea,\n ScrollAreaProps,\n StylesApiProps,\n UnstyledButton,\n useMantineTheme,\n useProps,\n useResolvedStylesApi,\n useStyles,\n} from '@mantine/core';\nimport { useDatesContext } from '@mantine/dates';\nimport { useIsomorphicEffect, useMergedRef } from '@mantine/hooks';\nimport { useDayGridEventResize } from '../../hooks/use-day-grid-event-resize';\nimport { useDragDropHandlers } from '../../hooks/use-drag-drop-handlers';\nimport { useSlotDragSelect } from '../../hooks/use-slot-drag-select';\nimport { getLabel, ScheduleLabelsOverride } from '../../labels';\nimport {\n DateLabelFormat,\n DateStringValue,\n DateTimeStringValue,\n DayOfWeek,\n ScheduleEventData,\n ScheduleMode,\n ScheduleResourceData,\n ScheduleResourceGroup,\n ScheduleViewLevel,\n} from '../../types';\nimport {\n calculateMonthDropDate,\n expandRecurringEvents,\n formatDate,\n getGroupToResourceIdMap,\n getIndexFromDragPoint,\n getOrderedResources,\n toDateString,\n} from '../../utils';\nimport { DragContext } from '../DragContext/DragContext';\nimport { MoreEvents, MoreEventsProps, MoreEventsStylesNames } from '../MoreEvents/MoreEvents';\nimport { RenderEvent, RenderEventBody, ScheduleEvent } from '../ScheduleEvent/ScheduleEvent';\nimport { MonthYearSelectProps } from '../ScheduleHeader/MonthYearSelect/MonthYearSelect';\nimport { CombinedScheduleHeaderStylesNames } from '../ScheduleHeader/ScheduleHeader';\nimport { ScheduleHeaderBase } from '../ScheduleHeader/ScheduleHeaderBase';\nimport { ViewSelectProps } from '../ScheduleHeader/ViewSelect/ViewSelect';\nimport classes from './ResourcesMonthView.module.css';\n\nexport type ResourcesMonthViewStylesNames =\n | 'resourcesMonthView'\n | 'resourcesMonthViewRoot'\n | 'resourcesMonthViewScrollArea'\n | 'resourcesMonthViewDayLabelsRow'\n | 'resourcesMonthViewCorner'\n | 'resourcesMonthViewDayLabel'\n | 'resourcesMonthViewDayLabelWeekday'\n | 'resourcesMonthViewDayLabelNumber'\n | 'resourcesMonthViewRow'\n | 'resourcesMonthViewResourceLabel'\n | 'resourcesMonthViewRowSlots'\n | 'resourcesMonthViewCell'\n | 'resourcesMonthViewEventWrapper'\n | 'resourcesMonthViewResizeHandle'\n | 'resourcesMonthViewInner'\n | 'resourcesMonthViewGroupColumn'\n | 'resourcesMonthViewGroupColumnEmpty'\n | MoreEventsStylesNames\n | CombinedScheduleHeaderStylesNames;\n\nexport type ResourcesMonthViewCssVariables = {\n resourcesMonthView:\n | '--resources-month-view-radius'\n | '--resources-month-view-day-width'\n | '--resources-month-view-row-height'\n | '--resources-month-view-group-label-width';\n};\n\nexport interface ResourcesMonthViewProps\n extends BoxProps, StylesApiProps<ResourcesMonthViewFactory>, ElementProps<'div'> {\n __staticSelector?: string;\n\n /** Date to display, Date object or date string in `YYYY-MM-DD` format */\n date: Date | string;\n\n /** Called with the new date value when a date is selected */\n onDateChange?: (value: DateStringValue) => void;\n\n /** List of resources to display as rows */\n resources: ScheduleResourceData[];\n\n /** Locale passed down to dayjs */\n locale?: string;\n\n /** `dayjs` format for weekdays in day column headers @default 'dd' */\n weekdayFormat?: DateLabelFormat;\n\n /** Indices of weekend days */\n weekendDays?: DayOfWeek[];\n\n /** If set to false, weekend days are hidden @default true */\n withWeekendDays?: boolean;\n\n /** Date to scroll to on initial render, in `YYYY-MM-DD` format */\n startScrollDate?: string;\n\n /** Called when a cell is clicked, includes resourceId */\n onDayClick?: (data: {\n date: DateStringValue;\n nativeEvent: React.MouseEvent<HTMLButtonElement>;\n resourceId?: string | number;\n }) => void;\n\n /** If set, highlights the current day @default true */\n highlightToday?: boolean;\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius` @default theme.defaultRadius */\n radius?: MantineRadius;\n\n /** If set, the header is displayed @default true */\n withHeader?: boolean;\n\n /** Props passed down to `MonthYearSelect` component */\n monthYearSelectProps?: Partial<MonthYearSelectProps>;\n\n /** Called when view level select button is clicked */\n onViewChange?: (view: ScheduleViewLevel) => void;\n\n /** Props passed to previous control */\n previousControlProps?: React.ComponentProps<'button'> & DataAttributes;\n\n /** Props passed to next control */\n nextControlProps?: React.ComponentProps<'button'> & DataAttributes;\n\n /** Props passed to today control */\n todayControlProps?: React.ComponentProps<'button'> & DataAttributes;\n\n /** Props passed to view level select */\n viewSelectProps?: Partial<ViewSelectProps> & DataAttributes;\n\n /** Events to display */\n events?: ScheduleEventData[];\n\n /** Width of each day column @default 40px */\n dayWidth?: React.CSSProperties['width'];\n\n /** Height of each resource row @default 48px */\n rowHeight?: React.CSSProperties['height'];\n\n /** Function to customize event body */\n renderEventBody?: RenderEventBody;\n\n /** Function to fully customize event rendering */\n renderEvent?: RenderEvent;\n\n /** Function to customize resource label rendering */\n renderResourceLabel?: (resource: ScheduleResourceData) => React.ReactNode;\n\n /** List of resource groups to display as a column to the left of resource labels */\n groups?: ScheduleResourceGroup[];\n\n /** Function to customize group label rendering */\n renderGroupLabel?: (group: ScheduleResourceGroup) => React.ReactNode;\n\n /** Width of the group label column @default 80px */\n groupLabelWidth?: React.CSSProperties['width'];\n\n /** If true, events can be dragged and dropped @default false */\n withEventsDragAndDrop?: boolean;\n\n /** Called when event is dropped, includes target resourceId */\n onEventDrop?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n resourceId?: string | number;\n }) => void;\n\n /** Function to determine if event can be dragged */\n canDragEvent?: (event: ScheduleEventData) => boolean;\n\n /** Called when any event drag starts */\n onEventDragStart?: (event: ScheduleEventData) => void;\n\n /** Called when any event drag ends */\n onEventDragEnd?: () => void;\n\n /** If true, events can be resized by dragging their start and end edges, resizing snaps to whole days @default false */\n withEventResize?: boolean;\n\n /** Called when event is resized */\n onEventResize?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n }) => void;\n\n /** Function to determine if event can be resized */\n canResizeEvent?: (event: ScheduleEventData) => boolean;\n\n /** Called when event is clicked */\n onEventClick?: (event: ScheduleEventData, e: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** If set, enables drag-to-select day ranges @default false */\n withDragSlotSelect?: boolean;\n\n /** Called when a day range is selected by dragging, includes resourceId */\n onSlotDragEnd?: (data: {\n rangeStart: DateTimeStringValue;\n rangeEnd: DateTimeStringValue;\n resourceId?: string | number;\n }) => void;\n\n /** Labels override for i18n */\n labels?: ScheduleLabelsOverride;\n\n /** Interaction mode @default default */\n mode?: ScheduleMode;\n\n /** Props passed down to `ScrollArea` component */\n scrollAreaProps?: Partial<ScrollAreaProps> & DataAttributes;\n\n /** Called when an external item is dropped */\n onExternalEventDrop?: (data: {\n dataTransfer: DataTransfer;\n dropDateTime: DateTimeStringValue;\n resourceId?: string | number;\n }) => void;\n\n /** Maximum number of events visible per cell before \"+more\" indicator @default 2 */\n maxEventsPerTimeSlot?: number;\n\n /** Props passed down to `MoreEvents` component */\n moreEventsProps?: Partial<MoreEventsProps>;\n\n /** Max number of generated recurring instances @default 2000 */\n recurrenceExpansionLimit?: number;\n}\n\nexport type ResourcesMonthViewFactory = Factory<{\n props: ResourcesMonthViewProps;\n ref: HTMLDivElement;\n stylesNames: ResourcesMonthViewStylesNames;\n vars: ResourcesMonthViewCssVariables;\n}>;\n\nconst varsResolver = createVarsResolver<ResourcesMonthViewFactory>(\n (_theme, { radius, dayWidth, rowHeight, groupLabelWidth }) => ({\n resourcesMonthView: {\n '--resources-month-view-radius': radius ? getRadius(radius) : undefined,\n '--resources-month-view-day-width': rem(dayWidth),\n '--resources-month-view-row-height': rem(rowHeight),\n '--resources-month-view-group-label-width': rem(groupLabelWidth),\n },\n })\n);\n\nconst defaultProps = {\n __staticSelector: 'ResourcesMonthView',\n highlightToday: true,\n withHeader: true,\n weekdayFormat: 'ddd',\n withWeekendDays: true,\n withEventsDragAndDrop: false,\n withDragSlotSelect: false,\n withEventResize: false,\n mode: 'default',\n} satisfies Partial<ResourcesMonthViewProps>;\n\nfunction compareCellEvents(a: ScheduleEventData, b: ScheduleEventData): number {\n const aStart = dayjs(a.start);\n const bStart = dayjs(b.start);\n const aSpan = dayjs(a.end).startOf('day').diff(aStart.startOf('day'), 'day');\n const bSpan = dayjs(b.end).startOf('day').diff(bStart.startOf('day'), 'day');\n\n if (aSpan !== bSpan) {\n return bSpan - aSpan;\n }\n\n return aStart.valueOf() - bStart.valueOf();\n}\n\nfunction getFirstAvailableRow(usedRows: Set<number>, maxRows: number): number | null {\n for (let row = 0; row < maxRows; row += 1) {\n if (!usedRows.has(row)) {\n return row;\n }\n }\n\n return null;\n}\n\ninterface ResourcesMonthViewCellLayout {\n visible: { event: ScheduleEventData; row: number }[];\n hiddenCount: number;\n}\n\ninterface ResourcesMonthViewSegment {\n event: ScheduleEventData;\n startDayIndex: number;\n endDayIndex: number;\n row: number;\n clipStart: boolean;\n clipEnd: boolean;\n hanging: 'start' | 'end' | 'both' | 'none';\n\n /** True when any day the segment covers shows a \"+N more\" indicator (those days compress rows) */\n hiddenInSpan: boolean;\n}\n\ninterface ResourcesMonthViewResourceLayout {\n byDay: Record<string, ResourcesMonthViewCellLayout>;\n segments: ResourcesMonthViewSegment[];\n}\n\nfunction isMultiDayEvent(event: ScheduleEventData): boolean {\n return dayjs(event.end).startOf('day').isAfter(dayjs(event.start).startOf('day'));\n}\n\nexport const ResourcesMonthView = factory<ResourcesMonthViewFactory>((_props) => {\n const props = useProps('ResourcesMonthView', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n attributes,\n vars,\n mod,\n date,\n onDateChange,\n resources,\n locale,\n weekdayFormat,\n weekendDays,\n withWeekendDays,\n startScrollDate,\n __staticSelector,\n onDayClick,\n highlightToday,\n radius,\n withHeader,\n monthYearSelectProps,\n onViewChange,\n todayControlProps,\n nextControlProps,\n previousControlProps,\n viewSelectProps,\n events,\n dayWidth,\n rowHeight,\n renderResourceLabel,\n groups,\n renderGroupLabel,\n groupLabelWidth,\n renderEventBody,\n renderEvent,\n withEventsDragAndDrop,\n onEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n withEventResize,\n onEventResize,\n canResizeEvent,\n onEventClick,\n withDragSlotSelect,\n onSlotDragEnd,\n labels,\n mode,\n scrollAreaProps,\n onExternalEventDrop,\n maxEventsPerTimeSlot: _maxEventsPerTimeSlot,\n moreEventsProps,\n recurrenceExpansionLimit,\n ...others\n } = props;\n\n const maxEventsPerTimeSlot = Math.min(10, Math.max(1, _maxEventsPerTimeSlot ?? 2));\n\n const getStyles = useStyles<ResourcesMonthViewFactory>({\n name: __staticSelector,\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n rootSelector: 'resourcesMonthView',\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<ResourcesMonthViewFactory>({\n classNames,\n styles,\n props,\n });\n\n const stylesApiProps = {\n classNames: resolvedClassNames,\n styles: resolvedStyles,\n attributes,\n __staticSelector,\n radius,\n };\n\n const theme = useMantineTheme();\n const ctx = useDatesContext();\n const resolvedWeekendDays = ctx.getWeekendDays(weekendDays);\n const { orderedResources, groupRanges, resourceGroupMap } = useMemo(\n () => getOrderedResources(resources, groups),\n [resources, groups]\n );\n const hasGroups = groupRanges.length > 0;\n\n const monthDays = useMemo(() => {\n const start = dayjs(date).startOf('month');\n const daysCount = start.endOf('month').date();\n const weekendDayList = ctx.getWeekendDays(weekendDays);\n const days: string[] = [];\n for (let d = 1; d <= daysCount; d++) {\n const day = start.date(d);\n if (!withWeekendDays && weekendDayList.includes(day.day() as DayOfWeek)) {\n continue;\n }\n days.push(day.format('YYYY-MM-DD'));\n }\n return days;\n }, [date, withWeekendDays, weekendDays, ctx]);\n\n const viewportRef = useRef<HTMLDivElement>(null);\n const mergedViewportRef = useMergedRef(viewportRef, scrollAreaProps?.viewportRef);\n const dayLabelRefs = useRef<(HTMLDivElement | null)[]>([]);\n\n const resourceLabelRef = useRef<HTMLDivElement>(null);\n\n const scrollToDay = useCallback(\n (targetDate: string) => {\n if (!viewportRef.current) {\n return;\n }\n const targetIndex = monthDays.indexOf(targetDate);\n if (targetIndex < 0) {\n return;\n }\n const targetLabel = dayLabelRefs.current[targetIndex];\n if (!targetLabel) {\n return;\n }\n const labelRect = targetLabel.getBoundingClientRect();\n const viewportRect = viewportRef.current.getBoundingClientRect();\n const labelWidth = resourceLabelRef.current?.getBoundingClientRect().width ?? 0;\n viewportRef.current.scrollTo({\n left: labelRect.left - viewportRect.left - labelWidth,\n top: 0,\n });\n },\n [monthDays]\n );\n\n useIsomorphicEffect(() => {\n if (startScrollDate) {\n scrollToDay(startScrollDate);\n }\n }, []);\n\n const expandedEvents = useMemo(\n () =>\n expandRecurringEvents({\n events,\n rangeStart: dayjs(date).startOf('month').toDate(),\n rangeEnd: dayjs(date).endOf('month').toDate(),\n expansionLimit: recurrenceExpansionLimit,\n }),\n [events, date, recurrenceExpansionLimit]\n );\n\n const monthDaySet = useMemo(() => new Set(monthDays), [monthDays]);\n\n const eventResize = useDayGridEventResize({\n enabled: withEventResize,\n mode,\n onEventResize,\n canResizeEvent,\n });\n\n const { resizingEventId, previewStart, previewEnd } = eventResize;\n\n const layoutEvents = useMemo(() => {\n if (resizingEventId === null || previewStart === null || previewEnd === null) {\n return expandedEvents;\n }\n\n return expandedEvents.map((event) =>\n event.id === resizingEventId ? { ...event, start: previewStart, end: previewEnd } : event\n );\n }, [expandedEvents, resizingEventId, previewStart, previewEnd]);\n\n const { eventsByResourceAndDay, eventLayoutByResource } = useMemo(() => {\n const eventsByResourceAndDay: Record<string | number, Record<string, ScheduleEventData[]>> = {};\n for (const resource of resources) {\n eventsByResourceAndDay[resource.id] = {};\n for (const day of monthDays) {\n eventsByResourceAndDay[resource.id][day] = [];\n }\n }\n\n if (layoutEvents) {\n for (const event of layoutEvents) {\n if (event.resourceId === undefined || !(event.resourceId in eventsByResourceAndDay)) {\n continue;\n }\n\n const eventStart = dayjs(event.start);\n const eventEnd = dayjs(event.end);\n\n for (const day of monthDays) {\n const dayStart = dayjs(day).startOf('day');\n const dayEnd = dayjs(day).endOf('day');\n\n if (eventStart.isBefore(dayEnd) && eventEnd.isAfter(dayStart)) {\n eventsByResourceAndDay[event.resourceId][day].push(event);\n }\n }\n }\n }\n\n const eventLayoutByResource: Record<string | number, ResourcesMonthViewResourceLayout> = {};\n const monthRangeStart = dayjs(monthDays[0]).startOf('day');\n const monthEndExclusive = dayjs(monthDays[monthDays.length - 1])\n .add(1, 'day')\n .startOf('day');\n\n for (const resource of resources) {\n const byDay: Record<string, ResourcesMonthViewCellLayout> = {};\n const lastRow = new Map<string | number, number>();\n const rowByEventDay = new Map<string | number, Map<number, number>>();\n const overlapByEvent = new Map<\n string | number,\n { event: ScheduleEventData; days: number[] }\n >();\n\n monthDays.forEach((day, dayIndex) => {\n const dayEvents = eventsByResourceAndDay[resource.id][day];\n dayEvents.sort(compareCellEvents);\n\n for (const event of dayEvents) {\n const overlap = overlapByEvent.get(event.id);\n if (overlap) {\n overlap.days.push(dayIndex);\n } else {\n overlapByEvent.set(event.id, { event, days: [dayIndex] });\n }\n }\n\n const usedRows = new Set<number>();\n const visible: ResourcesMonthViewCellLayout['visible'] = [];\n let hiddenCount = 0;\n\n for (const event of dayEvents) {\n let row: number | null | undefined = lastRow.get(event.id);\n\n if (row === undefined || row >= maxEventsPerTimeSlot || usedRows.has(row)) {\n row = getFirstAvailableRow(usedRows, maxEventsPerTimeSlot);\n }\n\n if (row === null) {\n hiddenCount += 1;\n continue;\n }\n\n usedRows.add(row);\n visible.push({ event, row });\n if (!rowByEventDay.has(event.id)) {\n rowByEventDay.set(event.id, new Map());\n }\n rowByEventDay.get(event.id)!.set(dayIndex, row);\n lastRow.set(event.id, row);\n }\n\n byDay[day] = { visible, hiddenCount };\n });\n\n const segments: ResourcesMonthViewSegment[] = [];\n\n for (const { event, days } of overlapByEvent.values()) {\n if (!isMultiDayEvent(event)) {\n continue;\n }\n\n const firstOverlap = days[0];\n const lastOverlap = days[days.length - 1];\n const rows = rowByEventDay.get(event.id);\n const extendsBefore = dayjs(event.start).isBefore(monthRangeStart);\n const extendsAfter = dayjs(event.end).isAfter(monthEndExclusive);\n let run: { startDayIndex: number; endDayIndex: number; row: number } | null = null;\n\n const flushRun = () => {\n if (!run) {\n return;\n }\n const clipStart = run.startDayIndex > firstOverlap;\n const clipEnd = run.endDayIndex < lastOverlap;\n const hangStart = !clipStart && extendsBefore;\n const hangEnd = !clipEnd && extendsAfter;\n let hiddenInSpan = false;\n for (let dayIndex = run.startDayIndex; dayIndex <= run.endDayIndex; dayIndex += 1) {\n if ((byDay[monthDays[dayIndex]]?.hiddenCount ?? 0) > 0) {\n hiddenInSpan = true;\n break;\n }\n }\n segments.push({\n event,\n startDayIndex: run.startDayIndex,\n endDayIndex: run.endDayIndex,\n row: run.row,\n clipStart,\n clipEnd,\n hanging: hangStart && hangEnd ? 'both' : hangStart ? 'start' : hangEnd ? 'end' : 'none',\n hiddenInSpan,\n });\n run = null;\n };\n\n for (let dayIndex = firstOverlap; dayIndex <= lastOverlap; dayIndex += 1) {\n const row = rows?.get(dayIndex);\n\n if (row === undefined) {\n flushRun();\n continue;\n }\n\n if (run && run.row === row && run.endDayIndex === dayIndex - 1) {\n run.endDayIndex = dayIndex;\n } else {\n flushRun();\n run = { startDayIndex: dayIndex, endDayIndex: dayIndex, row };\n }\n }\n\n flushRun();\n }\n\n eventLayoutByResource[resource.id] = { byDay, segments };\n }\n\n return { eventsByResourceAndDay, eventLayoutByResource };\n }, [resources, monthDays, layoutEvents, maxEventsPerTimeSlot]);\n\n type DropTargetCell = { day: string; resourceId: string | number };\n\n const handleExternalDrop = useCallback(\n (e: React.DragEvent, target: DropTargetCell) => {\n if (!onExternalEventDrop) {\n return;\n }\n onExternalEventDrop({\n dataTransfer: e.dataTransfer,\n dropDateTime: `${dayjs(target.day).format('YYYY-MM-DD')} 00:00:00`,\n resourceId: target.resourceId,\n });\n },\n [onExternalEventDrop]\n );\n\n const dragDrop = useDragDropHandlers<DropTargetCell>({\n enabled: withEventsDragAndDrop,\n mode,\n onEventDrop: (data) => {\n onEventDrop?.({ ...data, resourceId: lastDropResourceId.current });\n },\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n calculateDropTarget: (target: DropTargetCell, draggedEvent: ScheduleEventData) => {\n lastDropResourceId.current = target.resourceId;\n return calculateMonthDropDate({ draggedEvent, targetDay: target.day });\n },\n onExternalDrop: onExternalEventDrop ? handleExternalDrop : undefined,\n });\n\n const lastDropResourceId = useRef<string | number | undefined>(undefined);\n\n const withDragHandlers = (withEventsDragAndDrop || !!onExternalEventDrop) && mode !== 'static';\n\n const groupToResourceId = useMemo(() => getGroupToResourceIdMap(resources), [resources]);\n\n const slotDragSelect = useSlotDragSelect({\n enabled: withDragSlotSelect && mode !== 'static',\n onDragEnd: (startIndex, endIndex, group) => {\n if (!onSlotDragEnd) {\n return;\n }\n const startDay = monthDays[startIndex];\n const endDay = monthDays[endIndex];\n if (startDay && endDay) {\n onSlotDragEnd({\n rangeStart: dayjs(startDay).startOf('day').format('YYYY-MM-DD HH:mm:ss'),\n rangeEnd: dayjs(endDay).endOf('day').format('YYYY-MM-DD HH:mm:ss'),\n resourceId: groupToResourceId.get(group) ?? group,\n });\n }\n },\n });\n\n const dayLabels = monthDays.map((day, dayIndex) => {\n const d = dayjs(day);\n const weekend = resolvedWeekendDays.includes(d.day() as DayOfWeek);\n const today = d.isSame(dayjs(), 'day') && highlightToday;\n\n return (\n <Box\n {...getStyles('resourcesMonthViewDayLabel')}\n key={day}\n mod={{ weekend, today }}\n ref={(node) => {\n dayLabelRefs.current[dayIndex] = node;\n }}\n >\n <span {...getStyles('resourcesMonthViewDayLabelWeekday')}>\n {formatDate({ date: d, locale: ctx.getLocale(locale), format: weekdayFormat })}\n </span>\n <span {...getStyles('resourcesMonthViewDayLabelNumber')}>{d.date()}</span>\n </Box>\n );\n });\n\n const cellsRef = useRef<HTMLButtonElement[][]>([]);\n\n const getDayIndexFromDragPoint = useCallback((event: React.DragEvent, resourceIndex: number) => {\n return getIndexFromDragPoint(cellsRef.current[resourceIndex] ?? [], event.clientX);\n }, []);\n\n const handleCellKeyDown = (\n event: React.KeyboardEvent<HTMLButtonElement>,\n resourceIndex: number,\n dayIndex: number\n ) => {\n const key = event.key;\n let nextResourceIndex = resourceIndex;\n let nextDayIndex = dayIndex;\n\n if (key === 'ArrowRight') {\n nextDayIndex = Math.min(dayIndex + 1, monthDays.length - 1);\n } else if (key === 'ArrowLeft') {\n nextDayIndex = Math.max(dayIndex - 1, 0);\n } else if (key === 'ArrowDown') {\n nextResourceIndex = Math.min(resourceIndex + 1, resources.length - 1);\n } else if (key === 'ArrowUp') {\n nextResourceIndex = Math.max(resourceIndex - 1, 0);\n } else {\n return;\n }\n\n event.preventDefault();\n cellsRef.current[nextResourceIndex]?.[nextDayIndex]?.focus();\n };\n\n const rowHeightPercent = 100 / maxEventsPerTimeSlot;\n\n const renderEventNode = ({\n key,\n event,\n resourceIndex,\n style,\n hanging,\n eventMod,\n withStartHandle,\n withEndHandle,\n }: {\n key: string;\n event: ScheduleEventData;\n resourceIndex: number;\n style: React.CSSProperties;\n hanging?: ResourcesMonthViewSegment['hanging'];\n eventMod?: Record<string, any>;\n withStartHandle: boolean;\n withEndHandle: boolean;\n }) => {\n const isResizable = eventResize.isResizableEvent(event);\n const isThisEventResizing = eventResize.resizingEventId === event.id;\n\n const eventEnd = dayjs(event.end);\n const endsAtMidnight =\n eventEnd.hour() === 0 && eventEnd.minute() === 0 && eventEnd.second() === 0;\n const lastDay = (endsAtMidnight ? eventEnd.subtract(1, 'day') : eventEnd).format('YYYY-MM-DD');\n\n const showStartHandle =\n withStartHandle && monthDaySet.has(dayjs(event.start).format('YYYY-MM-DD'));\n const showEndHandle = withEndHandle && monthDaySet.has(lastDay);\n\n const eventColors = isResizable\n ? theme.variantColorResolver({\n color: event.color || theme.primaryColor,\n theme,\n variant: event.variant || 'light',\n autoContrast: true,\n })\n : null;\n\n const getHandleProps = (edge: 'start' | 'end') => ({\n ...getStyles('resourcesMonthViewResizeHandle'),\n 'data-edge': edge,\n 'data-active': (isThisEventResizing && eventResize.resizingEdge === edge) || undefined,\n onPointerDown: (e: React.PointerEvent) =>\n eventResize.handleResizeStart({\n event,\n edge,\n cells: cellsRef.current[resourceIndex] ?? [],\n days: monthDays,\n pointerEvent: e,\n }),\n });\n\n return (\n <Box\n key={key}\n {...getStyles('resourcesMonthViewEventWrapper', {\n style: { position: 'absolute', zIndex: 3, ...style },\n })}\n __vars={eventColors ? { '--event-color': eventColors.color } : undefined}\n data-resizing={isThisEventResizing || undefined}\n >\n <ScheduleEvent\n event={event}\n nowrap\n autoSize\n size=\"sm\"\n hanging={hanging}\n mod={eventMod}\n draggable={dragDrop.isDraggableEvent(event)}\n isResizing={isThisEventResizing}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n radius={radius}\n mode={mode}\n onClick={\n onEventClick\n ? (e) => {\n if (!eventResize.wasResizing()) {\n onEventClick(event, e);\n }\n }\n : undefined\n }\n style={{ width: '100%', height: '100%' }}\n />\n {isResizable && showStartHandle && <div {...getHandleProps('start')} />}\n {isResizable && showEndHandle && <div {...getHandleProps('end')} />}\n </Box>\n );\n };\n\n const rows = orderedResources.map((resource, resourceIndex) => {\n if (!cellsRef.current[resourceIndex]) {\n cellsRef.current[resourceIndex] = [];\n }\n\n cellsRef.current[resourceIndex].length = monthDays.length;\n\n const slotGroup = String(resource.id);\n const dropTarget = dragDrop.dropTarget;\n\n const totalDays = monthDays.length;\n const eventNodes: React.ReactNode[] = [];\n const moreNodes: React.ReactNode[] = [];\n\n const cells = monthDays.map((day, dayIndex) => {\n const d = dayjs(day);\n const weekend = ctx.getWeekendDays(weekendDays).includes(d.day() as DayOfWeek);\n const isDropTarget =\n dropTarget !== null &&\n typeof dropTarget === 'object' &&\n 'day' in dropTarget &&\n (dropTarget as DropTargetCell).day === day &&\n (dropTarget as DropTargetCell).resourceId === resource.id;\n const isDragSelected = slotDragSelect.isSlotSelected(dayIndex, slotGroup);\n const dayEvents = eventsByResourceAndDay[resource.id]?.[day] || [];\n const layout = eventLayoutByResource[resource.id]?.byDay[day];\n const visibleEvents = layout?.visible ?? [];\n const hiddenEventsCount = layout?.hiddenCount ?? 0;\n const isFirstCell = resourceIndex === 0 && dayIndex === 0;\n const dayLeftPercent = (dayIndex / totalDays) * 100;\n const dayWidthPercent = 100 / totalDays;\n\n const hasHiddenEvents = hiddenEventsCount > 0 && mode !== 'static';\n\n visibleEvents.forEach(({ event, row }) => {\n if (isMultiDayEvent(event)) {\n return;\n }\n\n const topValue = hasHiddenEvents\n ? `calc((100% - 18px) * ${row} / ${maxEventsPerTimeSlot} + 1px)`\n : `calc(${row * rowHeightPercent}% + 1px)`;\n const heightValue = hasHiddenEvents\n ? `calc((100% - 18px) / ${maxEventsPerTimeSlot} - 2px)`\n : `calc(${rowHeightPercent}% - 2px)`;\n\n eventNodes.push(\n renderEventNode({\n key: `${event.id}-${day}`,\n event,\n resourceIndex,\n withStartHandle: true,\n withEndHandle: true,\n style: {\n top: topValue,\n left: `calc(${dayLeftPercent}% + 1px)`,\n width: `calc(${dayWidthPercent}% - 2px)`,\n height: heightValue,\n },\n })\n );\n });\n\n if (hiddenEventsCount > 0 && mode !== 'static') {\n moreNodes.push(\n <MoreEvents\n key={`more-${resource.id}-${day}`}\n events={dayEvents}\n moreEventsCount={hiddenEventsCount}\n mode={mode}\n labels={labels}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n onEventClick={onEventClick}\n style={{\n position: 'absolute',\n bottom: 1,\n left: `calc(${dayLeftPercent}% + 1px)`,\n width: `calc(${dayWidthPercent}% - 2px)`,\n height: 18,\n zIndex: 4,\n }}\n {...stylesApiProps}\n {...moreEventsProps}\n />\n );\n }\n\n return (\n <UnstyledButton\n key={day}\n ref={(node) => {\n if (node) {\n if (!cellsRef.current[resourceIndex]) {\n cellsRef.current[resourceIndex] = [];\n }\n cellsRef.current[resourceIndex][dayIndex] = node;\n }\n }}\n {...getStyles('resourcesMonthViewCell')}\n aria-label={`${resource.label} ${d.format('MMMM D, YYYY')}`}\n data-drag-slot-index={withDragSlotSelect && mode !== 'static' ? dayIndex : undefined}\n data-drag-slot-group={withDragSlotSelect && mode !== 'static' ? slotGroup : undefined}\n mod={{\n weekend,\n 'drop-target': isDropTarget,\n 'drag-selected': isDragSelected,\n static: mode === 'static',\n }}\n tabIndex={mode === 'static' ? -1 : isFirstCell ? 0 : -1}\n onClick={\n mode === 'static'\n ? undefined\n : (e) => onDayClick?.({ date: day, nativeEvent: e, resourceId: resource.id })\n }\n onKeyDown={\n mode === 'static' ? undefined : (e) => handleCellKeyDown(e, resourceIndex, dayIndex)\n }\n onPointerDown={\n withDragSlotSelect && mode !== 'static'\n ? (e) =>\n slotDragSelect.handleSlotPointerDown(\n e as React.PointerEvent<HTMLButtonElement>,\n dayIndex,\n slotGroup\n )\n : undefined\n }\n onDragOver={withDragHandlers ? (e) => e.preventDefault() : undefined}\n />\n );\n });\n\n const resourceSegments = eventLayoutByResource[resource.id]?.segments ?? [];\n\n resourceSegments.forEach((segment) => {\n const segmentLeftPercent = (segment.startDayIndex / totalDays) * 100;\n const segmentWidthPercent =\n ((segment.endDayIndex - segment.startDayIndex + 1) / totalDays) * 100;\n const compressed = segment.hiddenInSpan && mode !== 'static';\n const topValue = compressed\n ? `calc((100% - 18px) * ${segment.row} / ${maxEventsPerTimeSlot} + 1px)`\n : `calc(${segment.row * rowHeightPercent}% + 1px)`;\n const heightValue = compressed\n ? `calc((100% - 18px) / ${maxEventsPerTimeSlot} - 2px)`\n : `calc(${rowHeightPercent}% - 2px)`;\n\n eventNodes.push(\n renderEventNode({\n key: `${segment.event.id}-segment-${segment.startDayIndex}`,\n event: segment.event,\n resourceIndex,\n hanging: segment.hanging,\n eventMod: { 'clip-start': segment.clipStart, 'clip-end': segment.clipEnd },\n withStartHandle:\n !segment.clipStart && segment.hanging !== 'start' && segment.hanging !== 'both',\n withEndHandle:\n !segment.clipEnd && segment.hanging !== 'end' && segment.hanging !== 'both',\n style: {\n top: topValue,\n left: `calc(${segmentLeftPercent}% + 1px)`,\n width: `calc(${segmentWidthPercent}% - 2px)`,\n height: heightValue,\n },\n })\n );\n });\n\n const groupInfo = hasGroups ? resourceGroupMap[resourceIndex] : undefined;\n const isGroupStart = groupInfo?.position === 'first' || groupInfo?.position === 'only';\n\n const groupCell =\n groupInfo !== undefined ? (\n groupInfo !== null ? (\n <Box\n {...getStyles('resourcesMonthViewGroupColumn')}\n mod={{ 'group-position': groupInfo.position }}\n >\n {isGroupStart && (\n <span\n style={\n groupInfo.count > 1\n ? {\n transform: `translateY(calc((${groupInfo.count - 1} * (var(--resources-month-view-row-height) + 1px)) / 2))`,\n }\n : undefined\n }\n >\n {renderGroupLabel ? renderGroupLabel(groupInfo.group) : groupInfo.group.label}\n </span>\n )}\n </Box>\n ) : (\n <Box {...getStyles('resourcesMonthViewGroupColumnEmpty')} />\n )\n ) : null;\n\n return (\n <div {...getStyles('resourcesMonthViewRow')} key={resource.id}>\n {groupCell}\n <div\n {...getStyles('resourcesMonthViewResourceLabel')}\n data-has-groups={hasGroups || undefined}\n >\n {renderResourceLabel ? renderResourceLabel(resource) : resource.label}\n </div>\n <div\n {...getStyles('resourcesMonthViewRowSlots')}\n onDragOver={\n withDragHandlers\n ? (e) => {\n const dayIndex = getDayIndexFromDragPoint(e, resourceIndex);\n if (dayIndex !== null && monthDays[dayIndex]) {\n dragDrop.handleDragOver(e, {\n day: monthDays[dayIndex],\n resourceId: resource.id,\n });\n }\n }\n : undefined\n }\n onDragLeave={withDragHandlers ? dragDrop.handleDragLeave : undefined}\n onDrop={\n withDragHandlers\n ? (e) => {\n const dayIndex = getDayIndexFromDragPoint(e, resourceIndex);\n if (dayIndex !== null && monthDays[dayIndex]) {\n dragDrop.handleDrop(e, {\n day: monthDays[dayIndex],\n resourceId: resource.id,\n });\n }\n }\n : undefined\n }\n >\n {eventNodes}\n {moreNodes}\n {cells}\n </div>\n </div>\n );\n });\n\n const content = (\n <Box\n mod={[\n {\n static: mode === 'static',\n 'slot-dragging': slotDragSelect.isDragging,\n 'event-interaction': eventResize.isResizing || dragDrop.dragContextValue.isDragging,\n resizing: eventResize.isResizing,\n },\n mod,\n ]}\n {...getStyles('resourcesMonthView')}\n {...others}\n >\n {withHeader && (\n <ScheduleHeaderBase\n view=\"month\"\n navigationHandlers={{\n previous: () => toDateString(dayjs(date).subtract(1, 'month').startOf('month')),\n next: () => toDateString(dayjs(date).add(1, 'month').startOf('month')),\n today: () => {\n requestAnimationFrame(() => {\n scrollToDay(dayjs().format('YYYY-MM-DD'));\n });\n return toDateString(dayjs());\n },\n }}\n control={{\n monthYearSelect: {\n locale,\n yearValue: dayjs(date).get('year'),\n monthValue: dayjs(date).get('month'),\n onYearChange: (year) =>\n onDateChange?.(toDateString(dayjs(date).set('year', year).startOf('month'))),\n onMonthChange: (month) =>\n onDateChange?.(toDateString(dayjs(date).set('month', month).startOf('month'))),\n ...monthYearSelectProps,\n },\n }}\n labels={labels}\n onDateChange={onDateChange}\n onViewChange={onViewChange}\n previousControlProps={previousControlProps}\n nextControlProps={nextControlProps}\n todayControlProps={todayControlProps}\n viewSelectProps={{ views: ['day', 'week', 'month'] as const, ...viewSelectProps }}\n stylesApiProps={stylesApiProps}\n />\n )}\n\n <Box {...getStyles('resourcesMonthViewRoot')}>\n <ScrollArea\n scrollbars=\"x\"\n scrollbarSize={4}\n {...scrollAreaProps}\n {...getStyles('resourcesMonthViewScrollArea', {\n className: scrollAreaProps?.className,\n style: scrollAreaProps?.style,\n })}\n viewportRef={mergedViewportRef}\n >\n <div {...getStyles('resourcesMonthViewInner')}>\n <div {...getStyles('resourcesMonthViewDayLabelsRow')}>\n <div\n {...getStyles('resourcesMonthViewCorner')}\n key=\"corner\"\n ref={resourceLabelRef}\n style={\n hasGroups\n ? {\n flexBasis:\n 'calc(var(--resources-month-view-resource-label-width) + var(--resources-month-view-group-label-width))',\n minWidth:\n 'calc(var(--resources-month-view-resource-label-width) + var(--resources-month-view-group-label-width))',\n }\n : undefined\n }\n >\n {getLabel('resources', labels)}\n </div>\n {dayLabels}\n </div>\n\n {rows}\n </div>\n </ScrollArea>\n </Box>\n </Box>\n );\n\n if (withEventsDragAndDrop) {\n return <DragContext.Provider value={dragDrop.dragContextValue}>{content}</DragContext.Provider>;\n }\n\n return content;\n});\n\nResourcesMonthView.displayName = '@mantine/schedule/ResourcesMonthView';\nResourcesMonthView.classes = classes;\nResourcesMonthView.varsResolver = varsResolver;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAgQA,MAAM,gBAAA,GAAA,cAAA,mBAAA,EACH,QAAQ,EAAE,QAAQ,UAAU,WAAW,uBAAuB,EAC7D,oBAAoB;CAClB,iCAAiC,UAAA,GAAA,cAAA,UAAA,CAAmB,MAAM,IAAI,KAAA;CAC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ACF,UACE;OACJ,IACA,KAAA;MAIH,GADFC,eAAAA,SAAS,aAAa,MAAM,CAC1B,GACJ,SACE;SAEJ,IACE;;GACK,CAAA;EACT,CAAA,CACF;;CAGP,IAAI,uBACF,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACC,oBAAAA,YAAY,UAAb;EAAsB,OAAO,SAAS;YAAmB;CAA8B,CAAA;CAGhG,OAAO;AACT,CAAC;AAED,mBAAmB,cAAc;AACjC,mBAAmB,UAAUC,kCAAAA;AAC7B,mBAAmB,eAAe"}
1
+ {"version":3,"file":"ResourcesMonthView.cjs","names":["createVarsResolver","getRadius","rem","factory","useProps","useStyles","useResolvedStylesApi","useMantineTheme","useDatesContext","useMemo","getOrderedResources","useRef","useMergedRef","useCallback","expandRecurringEvents","useDayGridEventResize","useDragDropHandlers","calculateMonthDropDate","getGroupToResourceIdMap","useSlotDragSelect","Box","formatDate","getIndexFromDragPoint","ScheduleEvent","MoreEvents","UnstyledButton","ScheduleHeaderBase","toDateString","ScrollArea","getLabel","DragContext","classes"],"sources":["../../../src/components/ResourcesMonthView/ResourcesMonthView.tsx"],"sourcesContent":["import dayjs from 'dayjs';\nimport { useCallback, useMemo, useRef } from 'react';\nimport {\n Box,\n BoxProps,\n createVarsResolver,\n DataAttributes,\n ElementProps,\n factory,\n Factory,\n getRadius,\n MantineRadius,\n rem,\n ScrollArea,\n ScrollAreaProps,\n StylesApiProps,\n UnstyledButton,\n useMantineTheme,\n useProps,\n useResolvedStylesApi,\n useStyles,\n} from '@mantine/core';\nimport { useDatesContext } from '@mantine/dates';\nimport { useIsomorphicEffect, useMergedRef } from '@mantine/hooks';\nimport { useDayGridEventResize } from '../../hooks/use-day-grid-event-resize';\nimport { useDragDropHandlers } from '../../hooks/use-drag-drop-handlers';\nimport { useSlotDragSelect } from '../../hooks/use-slot-drag-select';\nimport { getLabel, ScheduleLabelsOverride } from '../../labels';\nimport {\n DateLabelFormat,\n DateStringValue,\n DateTimeStringValue,\n DayOfWeek,\n ScheduleEventData,\n ScheduleMode,\n ScheduleResourceData,\n ScheduleResourceGroup,\n ScheduleViewLevel,\n} from '../../types';\nimport {\n calculateMonthDropDate,\n expandRecurringEvents,\n formatDate,\n getGroupToResourceIdMap,\n getIndexFromDragPoint,\n getOrderedResources,\n toDateString,\n} from '../../utils';\nimport { DragContext } from '../DragContext/DragContext';\nimport { MoreEvents, MoreEventsProps, MoreEventsStylesNames } from '../MoreEvents/MoreEvents';\nimport { RenderEvent, RenderEventBody, ScheduleEvent } from '../ScheduleEvent/ScheduleEvent';\nimport { MonthYearSelectProps } from '../ScheduleHeader/MonthYearSelect/MonthYearSelect';\nimport { CombinedScheduleHeaderStylesNames } from '../ScheduleHeader/ScheduleHeader';\nimport { ScheduleHeaderBase } from '../ScheduleHeader/ScheduleHeaderBase';\nimport { ViewSelectProps } from '../ScheduleHeader/ViewSelect/ViewSelect';\nimport classes from './ResourcesMonthView.module.css';\n\nexport type ResourcesMonthViewStylesNames =\n | 'resourcesMonthView'\n | 'resourcesMonthViewRoot'\n | 'resourcesMonthViewScrollArea'\n | 'resourcesMonthViewDayLabelsRow'\n | 'resourcesMonthViewCorner'\n | 'resourcesMonthViewDayLabel'\n | 'resourcesMonthViewDayLabelWeekday'\n | 'resourcesMonthViewDayLabelNumber'\n | 'resourcesMonthViewRow'\n | 'resourcesMonthViewResourceLabel'\n | 'resourcesMonthViewRowSlots'\n | 'resourcesMonthViewCell'\n | 'resourcesMonthViewEventWrapper'\n | 'resourcesMonthViewResizeHandle'\n | 'resourcesMonthViewInner'\n | 'resourcesMonthViewGroupColumn'\n | 'resourcesMonthViewGroupColumnEmpty'\n | MoreEventsStylesNames\n | CombinedScheduleHeaderStylesNames;\n\nexport type ResourcesMonthViewCssVariables = {\n resourcesMonthView:\n | '--resources-month-view-radius'\n | '--resources-month-view-day-width'\n | '--resources-month-view-row-height'\n | '--resources-month-view-group-label-width';\n};\n\nexport interface ResourcesMonthViewProps\n extends BoxProps, StylesApiProps<ResourcesMonthViewFactory>, ElementProps<'div'> {\n __staticSelector?: string;\n\n /** Date to display, Date object or date string in `YYYY-MM-DD` format */\n date: Date | string;\n\n /** Called with the new date value when a date is selected */\n onDateChange?: (value: DateStringValue) => void;\n\n /** List of resources to display as rows */\n resources: ScheduleResourceData[];\n\n /** Locale passed down to dayjs */\n locale?: string;\n\n /** `dayjs` format for weekdays in day column headers @default 'dd' */\n weekdayFormat?: DateLabelFormat;\n\n /** Indices of weekend days */\n weekendDays?: DayOfWeek[];\n\n /** If set to false, weekend days are hidden @default true */\n withWeekendDays?: boolean;\n\n /** Date to scroll to on initial render, in `YYYY-MM-DD` format */\n startScrollDate?: string;\n\n /** Called when a cell is clicked, includes resourceId */\n onDayClick?: (data: {\n date: DateStringValue;\n nativeEvent: React.MouseEvent<HTMLButtonElement>;\n resourceId?: string | number;\n }) => void;\n\n /** If set, highlights the current day @default true */\n highlightToday?: boolean;\n\n /** Key of `theme.radius` or any valid CSS value to set `border-radius` @default theme.defaultRadius */\n radius?: MantineRadius;\n\n /** If set, the header is displayed @default true */\n withHeader?: boolean;\n\n /** Props passed down to `MonthYearSelect` component */\n monthYearSelectProps?: Partial<MonthYearSelectProps>;\n\n /** Called when view level select button is clicked */\n onViewChange?: (view: ScheduleViewLevel) => void;\n\n /** Props passed to previous control */\n previousControlProps?: React.ComponentProps<'button'> & DataAttributes;\n\n /** Props passed to next control */\n nextControlProps?: React.ComponentProps<'button'> & DataAttributes;\n\n /** Props passed to today control */\n todayControlProps?: React.ComponentProps<'button'> & DataAttributes;\n\n /** Props passed to view level select */\n viewSelectProps?: Partial<ViewSelectProps> & DataAttributes;\n\n /** Events to display */\n events?: ScheduleEventData[];\n\n /** Width of each day column @default 40px */\n dayWidth?: React.CSSProperties['width'];\n\n /** Height of each resource row @default 48px */\n rowHeight?: React.CSSProperties['height'];\n\n /** Function to customize event body */\n renderEventBody?: RenderEventBody;\n\n /** Function to fully customize event rendering */\n renderEvent?: RenderEvent;\n\n /** Function to customize resource label rendering */\n renderResourceLabel?: (resource: ScheduleResourceData) => React.ReactNode;\n\n /** List of resource groups to display as a column to the left of resource labels */\n groups?: ScheduleResourceGroup[];\n\n /** Function to customize group label rendering */\n renderGroupLabel?: (group: ScheduleResourceGroup) => React.ReactNode;\n\n /** Width of the group label column @default 80px */\n groupLabelWidth?: React.CSSProperties['width'];\n\n /** If true, events can be dragged and dropped @default false */\n withEventsDragAndDrop?: boolean;\n\n /** Called when event is dropped, includes target resourceId */\n onEventDrop?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n resourceId?: string | number;\n }) => void;\n\n /** Function to determine if event can be dragged */\n canDragEvent?: (event: ScheduleEventData) => boolean;\n\n /** Called when any event drag starts */\n onEventDragStart?: (event: ScheduleEventData) => void;\n\n /** Called when any event drag ends */\n onEventDragEnd?: () => void;\n\n /** If true, events can be resized by dragging their start and end edges, resizing snaps to whole days @default false */\n withEventResize?: boolean;\n\n /** Called when event is resized */\n onEventResize?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n }) => void;\n\n /** Function to determine if event can be resized */\n canResizeEvent?: (event: ScheduleEventData) => boolean;\n\n /** Called when event is clicked */\n onEventClick?: (event: ScheduleEventData, e: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** If set, enables drag-to-select day ranges @default false */\n withDragSlotSelect?: boolean;\n\n /** Called when a day range is selected by dragging, includes resourceId */\n onSlotDragEnd?: (data: {\n rangeStart: DateTimeStringValue;\n rangeEnd: DateTimeStringValue;\n resourceId?: string | number;\n }) => void;\n\n /** Labels override for i18n */\n labels?: ScheduleLabelsOverride;\n\n /** Interaction mode @default default */\n mode?: ScheduleMode;\n\n /** Props passed down to `ScrollArea` component */\n scrollAreaProps?: Partial<ScrollAreaProps> & DataAttributes;\n\n /** Called when an external item is dropped */\n onExternalEventDrop?: (data: {\n dataTransfer: DataTransfer;\n dropDateTime: DateTimeStringValue;\n resourceId?: string | number;\n }) => void;\n\n /** Maximum number of events visible per cell before \"+more\" indicator @default 2 */\n maxEventsPerTimeSlot?: number;\n\n /** Props passed down to `MoreEvents` component */\n moreEventsProps?: Partial<MoreEventsProps>;\n\n /** Max number of generated recurring instances @default 2000 */\n recurrenceExpansionLimit?: number;\n}\n\nexport type ResourcesMonthViewFactory = Factory<{\n props: ResourcesMonthViewProps;\n ref: HTMLDivElement;\n stylesNames: ResourcesMonthViewStylesNames;\n vars: ResourcesMonthViewCssVariables;\n}>;\n\nconst varsResolver = createVarsResolver<ResourcesMonthViewFactory>(\n (_theme, { radius, dayWidth, rowHeight, groupLabelWidth }) => ({\n resourcesMonthView: {\n '--resources-month-view-radius': radius ? getRadius(radius) : undefined,\n '--resources-month-view-day-width': rem(dayWidth),\n '--resources-month-view-row-height': rem(rowHeight),\n '--resources-month-view-group-label-width': rem(groupLabelWidth),\n },\n })\n);\n\nconst defaultProps = {\n __staticSelector: 'ResourcesMonthView',\n highlightToday: true,\n withHeader: true,\n weekdayFormat: 'ddd',\n withWeekendDays: true,\n withEventsDragAndDrop: false,\n withDragSlotSelect: false,\n withEventResize: false,\n mode: 'default',\n} satisfies Partial<ResourcesMonthViewProps>;\n\nfunction compareCellEvents(a: ScheduleEventData, b: ScheduleEventData): number {\n const aStart = dayjs(a.start);\n const bStart = dayjs(b.start);\n const aSpan = dayjs(a.end).startOf('day').diff(aStart.startOf('day'), 'day');\n const bSpan = dayjs(b.end).startOf('day').diff(bStart.startOf('day'), 'day');\n\n if (aSpan !== bSpan) {\n return bSpan - aSpan;\n }\n\n return aStart.valueOf() - bStart.valueOf();\n}\n\nfunction getFirstAvailableRow(usedRows: Set<number>, maxRows: number): number | null {\n for (let row = 0; row < maxRows; row += 1) {\n if (!usedRows.has(row)) {\n return row;\n }\n }\n\n return null;\n}\n\ninterface ResourcesMonthViewCellLayout {\n visible: { event: ScheduleEventData; row: number }[];\n hiddenCount: number;\n}\n\ninterface ResourcesMonthViewSegment {\n event: ScheduleEventData;\n startDayIndex: number;\n endDayIndex: number;\n row: number;\n clipStart: boolean;\n clipEnd: boolean;\n hanging: 'start' | 'end' | 'both' | 'none';\n\n /** True when any day the segment covers shows a \"+N more\" indicator (those days compress rows) */\n hiddenInSpan: boolean;\n}\n\ninterface ResourcesMonthViewResourceLayout {\n byDay: Record<string, ResourcesMonthViewCellLayout>;\n segments: ResourcesMonthViewSegment[];\n}\n\nfunction isMultiDayEvent(event: ScheduleEventData): boolean {\n return dayjs(event.end).startOf('day').isAfter(dayjs(event.start).startOf('day'));\n}\n\nexport const ResourcesMonthView = factory<ResourcesMonthViewFactory>((_props) => {\n const props = useProps('ResourcesMonthView', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n attributes,\n vars,\n mod,\n date,\n onDateChange,\n resources,\n locale,\n weekdayFormat,\n weekendDays,\n withWeekendDays,\n startScrollDate,\n __staticSelector,\n onDayClick,\n highlightToday,\n radius,\n withHeader,\n monthYearSelectProps,\n onViewChange,\n todayControlProps,\n nextControlProps,\n previousControlProps,\n viewSelectProps,\n events,\n dayWidth,\n rowHeight,\n renderResourceLabel,\n groups,\n renderGroupLabel,\n groupLabelWidth,\n renderEventBody,\n renderEvent,\n withEventsDragAndDrop,\n onEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n withEventResize,\n onEventResize,\n canResizeEvent,\n onEventClick,\n withDragSlotSelect,\n onSlotDragEnd,\n labels,\n mode,\n scrollAreaProps,\n onExternalEventDrop,\n maxEventsPerTimeSlot: _maxEventsPerTimeSlot,\n moreEventsProps,\n recurrenceExpansionLimit,\n ...others\n } = props;\n\n const maxEventsPerTimeSlot = Math.min(10, Math.max(1, _maxEventsPerTimeSlot ?? 2));\n\n const getStyles = useStyles<ResourcesMonthViewFactory>({\n name: __staticSelector,\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n attributes,\n vars,\n varsResolver,\n rootSelector: 'resourcesMonthView',\n });\n\n const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi<ResourcesMonthViewFactory>({\n classNames,\n styles,\n props,\n });\n\n const stylesApiProps = {\n classNames: resolvedClassNames,\n styles: resolvedStyles,\n attributes,\n __staticSelector,\n radius,\n };\n\n const theme = useMantineTheme();\n const ctx = useDatesContext();\n const resolvedWeekendDays = ctx.getWeekendDays(weekendDays);\n const { orderedResources, groupRanges, resourceGroupMap } = useMemo(\n () => getOrderedResources(resources, groups),\n [resources, groups]\n );\n const hasGroups = groupRanges.length > 0;\n\n const monthDays = useMemo(() => {\n const start = dayjs(date).startOf('month');\n const daysCount = start.endOf('month').date();\n const weekendDayList = ctx.getWeekendDays(weekendDays);\n const days: string[] = [];\n for (let d = 1; d <= daysCount; d++) {\n const day = start.date(d);\n if (!withWeekendDays && weekendDayList.includes(day.day() as DayOfWeek)) {\n continue;\n }\n days.push(day.format('YYYY-MM-DD'));\n }\n return days;\n }, [date, withWeekendDays, weekendDays, ctx]);\n\n const viewportRef = useRef<HTMLDivElement>(null);\n const mergedViewportRef = useMergedRef(viewportRef, scrollAreaProps?.viewportRef);\n const dayLabelRefs = useRef<(HTMLDivElement | null)[]>([]);\n\n const resourceLabelRef = useRef<HTMLDivElement>(null);\n\n const scrollToDay = useCallback(\n (targetDate: string) => {\n if (!viewportRef.current) {\n return;\n }\n const targetIndex = monthDays.indexOf(targetDate);\n if (targetIndex < 0) {\n return;\n }\n const targetLabel = dayLabelRefs.current[targetIndex];\n if (!targetLabel) {\n return;\n }\n const labelRect = targetLabel.getBoundingClientRect();\n const viewportRect = viewportRef.current.getBoundingClientRect();\n const labelWidth = resourceLabelRef.current?.getBoundingClientRect().width ?? 0;\n viewportRef.current.scrollTo({\n left: labelRect.left - viewportRect.left - labelWidth,\n top: 0,\n });\n },\n [monthDays]\n );\n\n useIsomorphicEffect(() => {\n if (startScrollDate) {\n scrollToDay(startScrollDate);\n }\n }, []);\n\n const expandedEvents = useMemo(\n () =>\n expandRecurringEvents({\n events,\n rangeStart: dayjs(date).startOf('month').toDate(),\n rangeEnd: dayjs(date).endOf('month').toDate(),\n expansionLimit: recurrenceExpansionLimit,\n }),\n [events, date, recurrenceExpansionLimit]\n );\n\n const monthDaySet = useMemo(() => new Set(monthDays), [monthDays]);\n\n const eventResize = useDayGridEventResize({\n enabled: withEventResize,\n mode,\n onEventResize,\n canResizeEvent,\n });\n\n const { resizingEventId, previewStart, previewEnd } = eventResize;\n\n const layoutEvents = useMemo(() => {\n if (resizingEventId === null || previewStart === null || previewEnd === null) {\n return expandedEvents;\n }\n\n return expandedEvents.map((event) =>\n event.id === resizingEventId ? { ...event, start: previewStart, end: previewEnd } : event\n );\n }, [expandedEvents, resizingEventId, previewStart, previewEnd]);\n\n const { eventsByResourceAndDay, eventLayoutByResource } = useMemo(() => {\n const eventsByResourceAndDay: Record<string | number, Record<string, ScheduleEventData[]>> = {};\n for (const resource of resources) {\n eventsByResourceAndDay[resource.id] = {};\n for (const day of monthDays) {\n eventsByResourceAndDay[resource.id][day] = [];\n }\n }\n\n if (layoutEvents) {\n for (const event of layoutEvents) {\n if (event.resourceId === undefined || !(event.resourceId in eventsByResourceAndDay)) {\n continue;\n }\n\n const eventStart = dayjs(event.start);\n const eventEnd = dayjs(event.end);\n\n for (const day of monthDays) {\n const dayStart = dayjs(day).startOf('day');\n const dayEnd = dayjs(day).endOf('day');\n\n if (eventStart.isBefore(dayEnd) && eventEnd.isAfter(dayStart)) {\n eventsByResourceAndDay[event.resourceId][day].push(event);\n }\n }\n }\n }\n\n const eventLayoutByResource: Record<string | number, ResourcesMonthViewResourceLayout> = {};\n const monthRangeStart = dayjs(monthDays[0]).startOf('day');\n const monthEndExclusive = dayjs(monthDays[monthDays.length - 1])\n .add(1, 'day')\n .startOf('day');\n\n for (const resource of resources) {\n const byDay: Record<string, ResourcesMonthViewCellLayout> = {};\n const lastRow = new Map<string | number, number>();\n const rowByEventDay = new Map<string | number, Map<number, number>>();\n const overlapByEvent = new Map<\n string | number,\n { event: ScheduleEventData; days: number[] }\n >();\n\n monthDays.forEach((day, dayIndex) => {\n const dayEvents = eventsByResourceAndDay[resource.id][day];\n dayEvents.sort(compareCellEvents);\n\n for (const event of dayEvents) {\n const overlap = overlapByEvent.get(event.id);\n if (overlap) {\n overlap.days.push(dayIndex);\n } else {\n overlapByEvent.set(event.id, { event, days: [dayIndex] });\n }\n }\n\n const usedRows = new Set<number>();\n const visible: ResourcesMonthViewCellLayout['visible'] = [];\n let hiddenCount = 0;\n\n for (const event of dayEvents) {\n let row: number | null | undefined = lastRow.get(event.id);\n\n if (row === undefined || row >= maxEventsPerTimeSlot || usedRows.has(row)) {\n row = getFirstAvailableRow(usedRows, maxEventsPerTimeSlot);\n }\n\n if (row === null) {\n hiddenCount += 1;\n continue;\n }\n\n usedRows.add(row);\n visible.push({ event, row });\n if (!rowByEventDay.has(event.id)) {\n rowByEventDay.set(event.id, new Map());\n }\n rowByEventDay.get(event.id)!.set(dayIndex, row);\n lastRow.set(event.id, row);\n }\n\n byDay[day] = { visible, hiddenCount };\n });\n\n const segments: ResourcesMonthViewSegment[] = [];\n\n for (const { event, days } of overlapByEvent.values()) {\n if (!isMultiDayEvent(event)) {\n continue;\n }\n\n const firstOverlap = days[0];\n const lastOverlap = days[days.length - 1];\n const rows = rowByEventDay.get(event.id);\n const extendsBefore = dayjs(event.start).isBefore(monthRangeStart);\n const extendsAfter = dayjs(event.end).isAfter(monthEndExclusive);\n let run: { startDayIndex: number; endDayIndex: number; row: number } | null = null;\n\n const flushRun = () => {\n if (!run) {\n return;\n }\n const clipStart = run.startDayIndex > firstOverlap;\n const clipEnd = run.endDayIndex < lastOverlap;\n const hangStart = !clipStart && extendsBefore;\n const hangEnd = !clipEnd && extendsAfter;\n let hiddenInSpan = false;\n for (let dayIndex = run.startDayIndex; dayIndex <= run.endDayIndex; dayIndex += 1) {\n if ((byDay[monthDays[dayIndex]]?.hiddenCount ?? 0) > 0) {\n hiddenInSpan = true;\n break;\n }\n }\n segments.push({\n event,\n startDayIndex: run.startDayIndex,\n endDayIndex: run.endDayIndex,\n row: run.row,\n clipStart,\n clipEnd,\n hanging: hangStart && hangEnd ? 'both' : hangStart ? 'start' : hangEnd ? 'end' : 'none',\n hiddenInSpan,\n });\n run = null;\n };\n\n for (let dayIndex = firstOverlap; dayIndex <= lastOverlap; dayIndex += 1) {\n const row = rows?.get(dayIndex);\n\n if (row === undefined) {\n flushRun();\n continue;\n }\n\n if (run && run.row === row && run.endDayIndex === dayIndex - 1) {\n run.endDayIndex = dayIndex;\n } else {\n flushRun();\n run = { startDayIndex: dayIndex, endDayIndex: dayIndex, row };\n }\n }\n\n flushRun();\n }\n\n eventLayoutByResource[resource.id] = { byDay, segments };\n }\n\n return { eventsByResourceAndDay, eventLayoutByResource };\n }, [resources, monthDays, layoutEvents, maxEventsPerTimeSlot]);\n\n type DropTargetCell = { day: string; resourceId: string | number };\n\n const handleExternalDrop = useCallback(\n (e: React.DragEvent, target: DropTargetCell) => {\n if (!onExternalEventDrop) {\n return;\n }\n onExternalEventDrop({\n dataTransfer: e.dataTransfer,\n dropDateTime: `${dayjs(target.day).format('YYYY-MM-DD')} 00:00:00`,\n resourceId: target.resourceId,\n });\n },\n [onExternalEventDrop]\n );\n\n const dragDrop = useDragDropHandlers<DropTargetCell>({\n enabled: withEventsDragAndDrop,\n mode,\n onEventDrop: (data) => {\n onEventDrop?.({ ...data, resourceId: lastDropResourceId.current });\n },\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n calculateDropTarget: (target: DropTargetCell, draggedEvent: ScheduleEventData) => {\n lastDropResourceId.current = target.resourceId;\n return calculateMonthDropDate({ draggedEvent, targetDay: target.day });\n },\n onExternalDrop: onExternalEventDrop ? handleExternalDrop : undefined,\n });\n\n const lastDropResourceId = useRef<string | number | undefined>(undefined);\n\n const withDragHandlers = (withEventsDragAndDrop || !!onExternalEventDrop) && mode !== 'static';\n\n const groupToResourceId = useMemo(() => getGroupToResourceIdMap(resources), [resources]);\n\n const slotDragSelect = useSlotDragSelect({\n enabled: withDragSlotSelect && mode !== 'static',\n onDragEnd: (startIndex, endIndex, group) => {\n if (!onSlotDragEnd) {\n return;\n }\n const startDay = monthDays[startIndex];\n const endDay = monthDays[endIndex];\n if (startDay && endDay) {\n onSlotDragEnd({\n rangeStart: dayjs(startDay).startOf('day').format('YYYY-MM-DD HH:mm:ss'),\n rangeEnd: dayjs(endDay).endOf('day').format('YYYY-MM-DD HH:mm:ss'),\n resourceId: groupToResourceId.get(group) ?? group,\n });\n }\n },\n });\n\n const dayLabels = monthDays.map((day, dayIndex) => {\n const d = dayjs(day);\n const weekend = resolvedWeekendDays.includes(d.day() as DayOfWeek);\n const today = d.isSame(dayjs(), 'day') && highlightToday;\n\n return (\n <Box\n {...getStyles('resourcesMonthViewDayLabel')}\n key={day}\n mod={{ weekend, today }}\n ref={(node) => {\n dayLabelRefs.current[dayIndex] = node;\n }}\n >\n <span {...getStyles('resourcesMonthViewDayLabelWeekday')}>\n {formatDate({ date: d, locale: ctx.getLocale(locale), format: weekdayFormat })}\n </span>\n <span {...getStyles('resourcesMonthViewDayLabelNumber')}>{d.date()}</span>\n </Box>\n );\n });\n\n const cellsRef = useRef<HTMLButtonElement[][]>([]);\n\n const getDayIndexFromDragPoint = useCallback((event: React.DragEvent, resourceIndex: number) => {\n return getIndexFromDragPoint(cellsRef.current[resourceIndex] ?? [], event.clientX);\n }, []);\n\n const handleCellKeyDown = (\n event: React.KeyboardEvent<HTMLButtonElement>,\n resourceIndex: number,\n dayIndex: number\n ) => {\n const key = event.key;\n let nextResourceIndex = resourceIndex;\n let nextDayIndex = dayIndex;\n\n if (key === 'ArrowRight') {\n nextDayIndex = Math.min(dayIndex + 1, monthDays.length - 1);\n } else if (key === 'ArrowLeft') {\n nextDayIndex = Math.max(dayIndex - 1, 0);\n } else if (key === 'ArrowDown') {\n nextResourceIndex = Math.min(resourceIndex + 1, resources.length - 1);\n } else if (key === 'ArrowUp') {\n nextResourceIndex = Math.max(resourceIndex - 1, 0);\n } else {\n return;\n }\n\n event.preventDefault();\n cellsRef.current[nextResourceIndex]?.[nextDayIndex]?.focus();\n };\n\n const rowHeightPercent = 100 / maxEventsPerTimeSlot;\n\n const renderEventNode = ({\n key,\n event,\n resourceIndex,\n style,\n hanging,\n eventMod,\n withStartHandle,\n withEndHandle,\n }: {\n key: string;\n event: ScheduleEventData;\n resourceIndex: number;\n style: React.CSSProperties;\n hanging?: ResourcesMonthViewSegment['hanging'];\n eventMod?: Record<string, any>;\n withStartHandle: boolean;\n withEndHandle: boolean;\n }) => {\n const isResizable = eventResize.isResizableEvent(event);\n const isThisEventResizing = eventResize.resizingEventId === event.id;\n\n const eventEnd = dayjs(event.end);\n const endsAtMidnight =\n eventEnd.hour() === 0 && eventEnd.minute() === 0 && eventEnd.second() === 0;\n const lastDay = (endsAtMidnight ? eventEnd.subtract(1, 'day') : eventEnd).format('YYYY-MM-DD');\n\n const showStartHandle =\n withStartHandle && monthDaySet.has(dayjs(event.start).format('YYYY-MM-DD'));\n const showEndHandle = withEndHandle && monthDaySet.has(lastDay);\n\n const eventColors = isResizable\n ? theme.variantColorResolver({\n color: event.color || theme.primaryColor,\n theme,\n variant: event.variant || 'light',\n autoContrast: true,\n })\n : null;\n\n const getHandleProps = (edge: 'start' | 'end') => ({\n ...getStyles('resourcesMonthViewResizeHandle'),\n 'data-edge': edge,\n 'data-active': (isThisEventResizing && eventResize.resizingEdge === edge) || undefined,\n onPointerDown: (e: React.PointerEvent) =>\n eventResize.handleResizeStart({\n event,\n edge,\n cells: cellsRef.current[resourceIndex] ?? [],\n days: monthDays,\n pointerEvent: e,\n }),\n });\n\n return (\n <Box\n key={key}\n {...getStyles('resourcesMonthViewEventWrapper', {\n style: { position: 'absolute', zIndex: 3, ...style },\n })}\n __vars={eventColors ? { '--event-color': eventColors.color } : undefined}\n data-resizing={isThisEventResizing || undefined}\n >\n <ScheduleEvent\n event={event}\n nowrap\n autoSize\n size=\"sm\"\n hanging={hanging}\n mod={eventMod}\n draggable={dragDrop.isDraggableEvent(event)}\n isResizing={isThisEventResizing}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n radius={radius}\n mode={mode}\n onClick={\n onEventClick\n ? (e) => {\n if (!eventResize.wasResizing()) {\n onEventClick(event, e);\n }\n }\n : undefined\n }\n style={{ width: '100%', height: '100%' }}\n />\n {isResizable && showStartHandle && <div {...getHandleProps('start')} />}\n {isResizable && showEndHandle && <div {...getHandleProps('end')} />}\n </Box>\n );\n };\n\n const rows = orderedResources.map((resource, resourceIndex) => {\n if (!cellsRef.current[resourceIndex]) {\n cellsRef.current[resourceIndex] = [];\n }\n\n cellsRef.current[resourceIndex].length = monthDays.length;\n\n const slotGroup = String(resource.id);\n const dropTarget = dragDrop.dropTarget;\n\n const totalDays = monthDays.length;\n const eventNodes: React.ReactNode[] = [];\n const moreNodes: React.ReactNode[] = [];\n\n const cells = monthDays.map((day, dayIndex) => {\n const d = dayjs(day);\n const weekend = ctx.getWeekendDays(weekendDays).includes(d.day() as DayOfWeek);\n const isDropTarget =\n dropTarget !== null &&\n typeof dropTarget === 'object' &&\n 'day' in dropTarget &&\n (dropTarget as DropTargetCell).day === day &&\n (dropTarget as DropTargetCell).resourceId === resource.id;\n const isDragSelected = slotDragSelect.isSlotSelected(dayIndex, slotGroup);\n const dayEvents = eventsByResourceAndDay[resource.id]?.[day] || [];\n const layout = eventLayoutByResource[resource.id]?.byDay[day];\n const visibleEvents = layout?.visible ?? [];\n const hiddenEventsCount = layout?.hiddenCount ?? 0;\n const isFirstCell = resourceIndex === 0 && dayIndex === 0;\n const dayLeftPercent = (dayIndex / totalDays) * 100;\n const dayWidthPercent = 100 / totalDays;\n\n const hasHiddenEvents = hiddenEventsCount > 0 && mode !== 'static';\n\n visibleEvents.forEach(({ event, row }) => {\n if (isMultiDayEvent(event)) {\n return;\n }\n\n const topValue = hasHiddenEvents\n ? `calc((100% - 18px) * ${row} / ${maxEventsPerTimeSlot} + 1px)`\n : `calc(${row * rowHeightPercent}% + 1px)`;\n const heightValue = hasHiddenEvents\n ? `calc((100% - 18px) / ${maxEventsPerTimeSlot} - 2px)`\n : `calc(${rowHeightPercent}% - 2px)`;\n\n eventNodes.push(\n renderEventNode({\n key: `${event.id}-${day}`,\n event,\n resourceIndex,\n withStartHandle: true,\n withEndHandle: true,\n style: {\n top: topValue,\n left: `calc(${dayLeftPercent}% + 1px)`,\n width: `calc(${dayWidthPercent}% - 2px)`,\n height: heightValue,\n },\n })\n );\n });\n\n if (hiddenEventsCount > 0 && mode !== 'static') {\n moreNodes.push(\n <MoreEvents\n key={`more-${resource.id}-${day}`}\n events={dayEvents}\n moreEventsCount={hiddenEventsCount}\n mode={mode}\n labels={labels}\n renderEventBody={renderEventBody}\n renderEvent={renderEvent}\n onEventClick={onEventClick}\n style={{\n position: 'absolute',\n bottom: 1,\n left: `calc(${dayLeftPercent}% + 1px)`,\n width: `calc(${dayWidthPercent}% - 2px)`,\n height: 18,\n zIndex: 4,\n }}\n {...stylesApiProps}\n {...moreEventsProps}\n />\n );\n }\n\n return (\n <UnstyledButton\n key={day}\n ref={(node) => {\n if (node) {\n if (!cellsRef.current[resourceIndex]) {\n cellsRef.current[resourceIndex] = [];\n }\n cellsRef.current[resourceIndex][dayIndex] = node;\n }\n }}\n {...getStyles('resourcesMonthViewCell')}\n aria-label={`${resource.label} ${d.format('MMMM D, YYYY')}`}\n data-drag-slot-index={withDragSlotSelect && mode !== 'static' ? dayIndex : undefined}\n data-drag-slot-group={withDragSlotSelect && mode !== 'static' ? slotGroup : undefined}\n mod={{\n weekend,\n 'drop-target': isDropTarget,\n 'drag-selected': isDragSelected,\n static: mode === 'static',\n }}\n tabIndex={mode === 'static' ? -1 : isFirstCell ? 0 : -1}\n onClick={\n mode === 'static'\n ? undefined\n : (e) => onDayClick?.({ date: day, nativeEvent: e, resourceId: resource.id })\n }\n onKeyDown={\n mode === 'static' ? undefined : (e) => handleCellKeyDown(e, resourceIndex, dayIndex)\n }\n onPointerDown={\n withDragSlotSelect && mode !== 'static'\n ? (e) =>\n slotDragSelect.handleSlotPointerDown(\n e as React.PointerEvent<HTMLButtonElement>,\n dayIndex,\n slotGroup\n )\n : undefined\n }\n onDragOver={withDragHandlers ? (e) => e.preventDefault() : undefined}\n />\n );\n });\n\n const resourceSegments = eventLayoutByResource[resource.id]?.segments ?? [];\n\n resourceSegments.forEach((segment) => {\n const segmentLeftPercent = (segment.startDayIndex / totalDays) * 100;\n const segmentWidthPercent =\n ((segment.endDayIndex - segment.startDayIndex + 1) / totalDays) * 100;\n const compressed = segment.hiddenInSpan && mode !== 'static';\n const topValue = compressed\n ? `calc((100% - 18px) * ${segment.row} / ${maxEventsPerTimeSlot} + 1px)`\n : `calc(${segment.row * rowHeightPercent}% + 1px)`;\n const heightValue = compressed\n ? `calc((100% - 18px) / ${maxEventsPerTimeSlot} - 2px)`\n : `calc(${rowHeightPercent}% - 2px)`;\n\n eventNodes.push(\n renderEventNode({\n key: `${segment.event.id}-segment-${segment.startDayIndex}`,\n event: segment.event,\n resourceIndex,\n hanging: segment.hanging,\n eventMod: { 'clip-start': segment.clipStart, 'clip-end': segment.clipEnd },\n withStartHandle:\n !segment.clipStart && segment.hanging !== 'start' && segment.hanging !== 'both',\n withEndHandle:\n !segment.clipEnd && segment.hanging !== 'end' && segment.hanging !== 'both',\n style: {\n top: topValue,\n left: `calc(${segmentLeftPercent}% + 1px)`,\n width: `calc(${segmentWidthPercent}% - 2px)`,\n height: heightValue,\n },\n })\n );\n });\n\n const groupInfo = hasGroups ? resourceGroupMap[resourceIndex] : undefined;\n const isGroupStart = groupInfo?.position === 'first' || groupInfo?.position === 'only';\n\n const groupCell =\n groupInfo !== undefined ? (\n groupInfo !== null ? (\n <Box\n {...getStyles('resourcesMonthViewGroupColumn')}\n mod={{ 'group-position': groupInfo.position }}\n >\n {isGroupStart && (\n <span\n style={\n groupInfo.count > 1\n ? {\n transform: `translateY(calc((${groupInfo.count - 1} * (var(--resources-month-view-row-height) + 1px)) / 2))`,\n }\n : undefined\n }\n >\n {renderGroupLabel ? renderGroupLabel(groupInfo.group) : groupInfo.group.label}\n </span>\n )}\n </Box>\n ) : (\n <Box {...getStyles('resourcesMonthViewGroupColumnEmpty')} />\n )\n ) : null;\n\n return (\n <div {...getStyles('resourcesMonthViewRow')} key={resource.id}>\n {groupCell}\n <div\n {...getStyles('resourcesMonthViewResourceLabel')}\n data-has-groups={hasGroups || undefined}\n >\n {renderResourceLabel ? renderResourceLabel(resource) : resource.label}\n </div>\n <div\n {...getStyles('resourcesMonthViewRowSlots')}\n onDragOver={\n withDragHandlers\n ? (e) => {\n const dayIndex = getDayIndexFromDragPoint(e, resourceIndex);\n if (dayIndex !== null && monthDays[dayIndex]) {\n dragDrop.handleDragOver(e, {\n day: monthDays[dayIndex],\n resourceId: resource.id,\n });\n }\n }\n : undefined\n }\n onDragLeave={withDragHandlers ? dragDrop.handleDragLeave : undefined}\n onDrop={\n withDragHandlers\n ? (e) => {\n const dayIndex = getDayIndexFromDragPoint(e, resourceIndex);\n if (dayIndex !== null && monthDays[dayIndex]) {\n dragDrop.handleDrop(e, {\n day: monthDays[dayIndex],\n resourceId: resource.id,\n });\n }\n }\n : undefined\n }\n >\n {eventNodes}\n {moreNodes}\n {cells}\n </div>\n </div>\n );\n });\n\n const content = (\n <Box\n mod={[\n {\n static: mode === 'static',\n 'slot-dragging': slotDragSelect.isDragging,\n 'event-interaction': eventResize.isResizing || dragDrop.dragContextValue.isDragging,\n resizing: eventResize.isResizing,\n },\n mod,\n ]}\n {...getStyles('resourcesMonthView')}\n {...others}\n >\n {withHeader && (\n <ScheduleHeaderBase\n view=\"month\"\n navigationHandlers={{\n previous: () => toDateString(dayjs(date).subtract(1, 'month').startOf('month')),\n next: () => toDateString(dayjs(date).add(1, 'month').startOf('month')),\n today: () => {\n requestAnimationFrame(() => {\n scrollToDay(dayjs().format('YYYY-MM-DD'));\n });\n return toDateString(dayjs());\n },\n }}\n control={{\n monthYearSelect: {\n locale,\n yearValue: dayjs(date).get('year'),\n monthValue: dayjs(date).get('month'),\n onYearChange: (year) =>\n onDateChange?.(toDateString(dayjs(date).set('year', year).startOf('month'))),\n onMonthChange: (month) =>\n onDateChange?.(toDateString(dayjs(date).set('month', month).startOf('month'))),\n ...monthYearSelectProps,\n },\n }}\n labels={labels}\n onDateChange={onDateChange}\n onViewChange={onViewChange}\n previousControlProps={previousControlProps}\n nextControlProps={nextControlProps}\n todayControlProps={todayControlProps}\n viewSelectProps={{ views: ['day', 'week', 'month'] as const, ...viewSelectProps }}\n stylesApiProps={stylesApiProps}\n />\n )}\n\n <Box {...getStyles('resourcesMonthViewRoot')}>\n <ScrollArea\n scrollbars=\"x\"\n scrollbarSize={4}\n {...scrollAreaProps}\n {...getStyles('resourcesMonthViewScrollArea', {\n className: scrollAreaProps?.className,\n style: scrollAreaProps?.style,\n })}\n viewportRef={mergedViewportRef}\n >\n <div {...getStyles('resourcesMonthViewInner')}>\n <div {...getStyles('resourcesMonthViewDayLabelsRow')}>\n <div\n {...getStyles('resourcesMonthViewCorner')}\n key=\"corner\"\n ref={resourceLabelRef}\n style={\n hasGroups\n ? {\n flexBasis:\n 'calc(var(--resources-month-view-resource-label-width) + var(--resources-month-view-group-label-width))',\n minWidth:\n 'calc(var(--resources-month-view-resource-label-width) + var(--resources-month-view-group-label-width))',\n }\n : undefined\n }\n >\n {getLabel('resources', labels)}\n </div>\n {dayLabels}\n </div>\n\n {rows}\n </div>\n </ScrollArea>\n </Box>\n </Box>\n );\n\n if (withEventsDragAndDrop) {\n return <DragContext.Provider value={dragDrop.dragContextValue}>{content}</DragContext.Provider>;\n }\n\n return content;\n});\n\nResourcesMonthView.displayName = '@mantine/schedule/ResourcesMonthView';\nResourcesMonthView.classes = classes;\nResourcesMonthView.varsResolver = varsResolver;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAgQA,MAAM,gBAAA,GAAeA,cAAAA,mBAAAA,EAClB,QAAQ,EAAE,QAAQ,UAAU,WAAW,uBAAuB,EAC7D,oBAAoB;C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yBAAyB;KAA5C,UAAA,CACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;MAAK,GAAI,UAAU,gCAAgC;MAAnD,UAAA,CACE,iBAAA,GAAA,MAAA,cAAA,CAAC,OAAD;OACE,GAAI,UAAU,0BAA0B;OACxC,KAAI;OACJ,KAAK;OACL,OACE,YACI;QACE,WACE;QACF,UACE;OACJ,IACA,KAAA;MAIH,GADFC,eAAAA,SAAS,aAAa,MAAM,CAC1B,GACJ,SACE;KAEJ,CAAA,GAAA,IACE;;GACK,CAAA;EACT,CAAA,CACF;;CAGP,IAAI,uBACF,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACC,oBAAAA,YAAY,UAAb;EAAsB,OAAO,SAAS;EAAmB,UAAA;CAA8B,CAAA;CAGhG,OAAO;AACT,CAAC;AAED,mBAAmB,cAAc;AACjC,mBAAmB,UAAUC,kCAAAA;AAC7B,mBAAmB,eAAe"}
@@ -13,7 +13,7 @@ const defaultProps = {
13
13
  };
14
14
  const ResourcesSchedule = (0, _mantine_core.factory)((_props) => {
15
15
  const props = (0, _mantine_core.useProps)("ResourcesSchedule", defaultProps, _props);
16
- const { classNames, className, style, styles, unstyled, vars, resources, date, defaultDate, onDateChange, view, defaultView, onViewChange, events, locale, radius, labels, renderEventBody, renderResourceLabel, withEventsDragAndDrop, onEventDrop, canDragEvent, onEventDragStart, onEventDragEnd, onTimeSlotClick, onDayClick, onEventClick, withDragSlotSelect, onSlotDragEnd, onExternalEventDrop, withEventResize, onEventResize, canResizeEvent, recurrenceExpansionLimit, mode, dayViewProps, weekViewProps, monthViewProps, __staticSelector, mod, ...others } = props;
16
+ const { classNames, className, style, styles, unstyled, vars, resources, date, defaultDate, onDateChange, view, defaultView, onViewChange, events, locale, radius, labels, renderEventBody, renderResourceLabel, withEventsDragAndDrop, onEventDrop, canDragEvent, onEventDragStart, onEventDragEnd, onTimeSlotClick, onDayClick, onEventClick, withDragSlotSelect, onSlotDragEnd, onExternalEventDrop, withEventResize, onEventResize, canResizeEvent, withInteractiveBackgroundEvents, recurrenceExpansionLimit, mode, dayViewProps, weekViewProps, monthViewProps, __staticSelector, mod, ...others } = props;
17
17
  const getStyles = (0, _mantine_core.useStyles)({
18
18
  name: __staticSelector || "ResourcesSchedule",
19
19
  classes: require_ResourcesSchedule_module.default,
@@ -72,6 +72,7 @@ const ResourcesSchedule = (0, _mantine_core.factory)((_props) => {
72
72
  withEventResize: mode === "static" ? false : withEventResize,
73
73
  onEventResize,
74
74
  canResizeEvent,
75
+ withInteractiveBackgroundEvents: mode === "static" ? false : withInteractiveBackgroundEvents,
75
76
  ...dayViewProps
76
77
  });
77
78
  case "week": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ResourcesWeekView.ResourcesWeekView, {
@@ -80,6 +81,7 @@ const ResourcesSchedule = (0, _mantine_core.factory)((_props) => {
80
81
  withEventResize: mode === "static" ? false : withEventResize,
81
82
  onEventResize,
82
83
  canResizeEvent,
84
+ withInteractiveBackgroundEvents: mode === "static" ? false : withInteractiveBackgroundEvents,
83
85
  ...weekViewProps
84
86
  });
85
87
  case "month": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ResourcesMonthView.ResourcesMonthView, {
@@ -1 +1 @@
1
- {"version":3,"file":"ResourcesSchedule.cjs","names":["ResourcesDayView","ResourcesWeekView","ResourcesMonthView","Box","classes"],"sources":["../../../src/components/ResourcesSchedule/ResourcesSchedule.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n ElementProps,\n factory,\n Factory,\n MantineRadius,\n StylesApiProps,\n useProps,\n useStyles,\n} from '@mantine/core';\nimport { useUncontrolled } from '@mantine/hooks';\nimport { ScheduleLabelsOverride } from '../../labels';\nimport {\n DateStringValue,\n DateTimeStringValue,\n ScheduleEventData,\n ScheduleMode,\n ScheduleResourceData,\n ScheduleViewLevel,\n} from '../../types';\nimport {\n ResourcesDayView,\n ResourcesDayViewProps,\n ResourcesDayViewStylesNames,\n} from '../ResourcesDayView/ResourcesDayView';\nimport {\n ResourcesMonthView,\n ResourcesMonthViewProps,\n ResourcesMonthViewStylesNames,\n} from '../ResourcesMonthView/ResourcesMonthView';\nimport {\n ResourcesWeekView,\n ResourcesWeekViewProps,\n ResourcesWeekViewStylesNames,\n} from '../ResourcesWeekView/ResourcesWeekView';\nimport { RenderEventBody } from '../ScheduleEvent/ScheduleEvent';\nimport classes from './ResourcesSchedule.module.css';\n\nexport type ResourcesScheduleStylesNames =\n | 'root'\n | ResourcesDayViewStylesNames\n | ResourcesWeekViewStylesNames\n | ResourcesMonthViewStylesNames;\n\nexport type ResourcesScheduleViewLevel = 'day' | 'week' | 'month';\n\ntype ResourcesScheduleCommonProps =\n | 'date'\n | 'onDateChange'\n | 'resources'\n | 'events'\n | 'locale'\n | 'radius'\n | 'labels'\n | 'renderEventBody'\n | 'renderResourceLabel'\n | 'withEventsDragAndDrop'\n | 'onEventDrop'\n | 'canDragEvent'\n | 'onEventDragStart'\n | 'onEventDragEnd'\n | 'onTimeSlotClick'\n | 'onEventClick'\n | 'onDayClick'\n | 'withDragSlotSelect'\n | 'onSlotDragEnd'\n | 'view'\n | 'onViewChange'\n | 'mode'\n | 'onExternalEventDrop'\n | 'withEventResize'\n | 'onEventResize'\n | 'canResizeEvent'\n | 'recurrenceExpansionLimit';\n\ntype ResourcesScheduleViewProps<T> = Partial<Omit<T, ResourcesScheduleCommonProps>>;\n\nexport interface ResourcesScheduleProps\n extends BoxProps, StylesApiProps<ResourcesScheduleFactory>, ElementProps<'div'> {\n __staticSelector?: string;\n\n /** List of resources to display */\n resources: ScheduleResourceData[];\n\n /** Current date to display (controlled) */\n date?: Date | DateStringValue;\n\n /** Default date (uncontrolled) */\n defaultDate?: Date | DateStringValue;\n\n /** Called when date changes via navigation */\n onDateChange?: (date: DateStringValue) => void;\n\n /** Current view level (controlled) */\n view?: ResourcesScheduleViewLevel;\n\n /** Default view level (uncontrolled) @default 'day' */\n defaultView?: ResourcesScheduleViewLevel;\n\n /** Called when view level changes */\n onViewChange?: (view: ResourcesScheduleViewLevel) => void;\n\n /** Events to display across all views */\n events?: ScheduleEventData[];\n\n /** Locale for date formatting */\n locale?: string;\n\n /** Key of theme.radius or any valid CSS value to set border-radius */\n radius?: MantineRadius;\n\n /** Labels override for i18n */\n labels?: ScheduleLabelsOverride;\n\n /** Custom event body renderer */\n renderEventBody?: RenderEventBody;\n\n /** Custom resource label renderer */\n renderResourceLabel?: (resource: ScheduleResourceData) => React.ReactNode;\n\n /** Enable drag and drop for events @default false */\n withEventsDragAndDrop?: boolean;\n\n /** Called when event is dropped */\n onEventDrop?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n resourceId?: string | number;\n }) => void;\n\n /** Function to determine if event can be dragged */\n canDragEvent?: (event: ScheduleEventData) => boolean;\n\n /** Called when any event drag starts */\n onEventDragStart?: (event: ScheduleEventData) => void;\n\n /** Called when any event drag ends */\n onEventDragEnd?: () => void;\n\n /** Called when time slot is clicked */\n onTimeSlotClick?: (data: {\n slotStart: DateTimeStringValue;\n slotEnd: DateTimeStringValue;\n nativeEvent: React.MouseEvent<HTMLButtonElement>;\n resourceId?: string | number;\n }) => void;\n\n /** Called when day is clicked in month view */\n onDayClick?: (data: {\n date: DateStringValue;\n nativeEvent: React.MouseEvent<HTMLButtonElement>;\n resourceId?: string | number;\n }) => void;\n\n /** Called when event is clicked */\n onEventClick?: (event: ScheduleEventData, e: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** If set, enables drag-to-select slot ranges @default false */\n withDragSlotSelect?: boolean;\n\n /** Called when a slot range is selected by dragging */\n onSlotDragEnd?: (data: {\n rangeStart: DateTimeStringValue;\n rangeEnd: DateTimeStringValue;\n resourceId?: string | number;\n }) => void;\n\n /** Interaction mode @default default */\n mode?: ScheduleMode;\n\n /** Called when an external item is dropped onto the schedule */\n onExternalEventDrop?: (data: {\n dataTransfer: DataTransfer;\n dropDateTime: DateTimeStringValue;\n resourceId?: string | number;\n }) => void;\n\n /** If true, events can be resized by dragging their edges, resizing snaps to whole days in month view @default false */\n withEventResize?: boolean;\n\n /** Called when event is resized */\n onEventResize?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n }) => void;\n\n /** Function to determine if event can be resized */\n canResizeEvent?: (event: ScheduleEventData) => boolean;\n\n /** Max number of generated recurring instances @default 2000 */\n recurrenceExpansionLimit?: number;\n\n /** Props specific to ResourcesDayView */\n dayViewProps?: ResourcesScheduleViewProps<ResourcesDayViewProps>;\n\n /** Props specific to ResourcesWeekView */\n weekViewProps?: ResourcesScheduleViewProps<ResourcesWeekViewProps>;\n\n /** Props specific to ResourcesMonthView */\n monthViewProps?: ResourcesScheduleViewProps<ResourcesMonthViewProps>;\n}\n\nexport type ResourcesScheduleFactory = Factory<{\n props: ResourcesScheduleProps;\n ref: HTMLDivElement;\n stylesNames: ResourcesScheduleStylesNames;\n}>;\n\nconst defaultProps: Partial<ResourcesScheduleProps> = {\n defaultView: 'day',\n mode: 'default',\n};\n\nexport const ResourcesSchedule = factory<ResourcesScheduleFactory>((_props) => {\n const props = useProps('ResourcesSchedule', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n resources,\n date,\n defaultDate,\n onDateChange,\n view,\n defaultView,\n onViewChange,\n events,\n locale,\n radius,\n labels,\n renderEventBody,\n renderResourceLabel,\n withEventsDragAndDrop,\n onEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n onTimeSlotClick,\n onDayClick,\n onEventClick,\n withDragSlotSelect,\n onSlotDragEnd,\n onExternalEventDrop,\n withEventResize,\n onEventResize,\n canResizeEvent,\n recurrenceExpansionLimit,\n mode,\n dayViewProps,\n weekViewProps,\n monthViewProps,\n __staticSelector,\n mod,\n ...others\n } = props;\n\n const getStyles = useStyles<ResourcesScheduleFactory>({\n name: __staticSelector || 'ResourcesSchedule',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n });\n\n const [_view, _setView] = useUncontrolled<ResourcesScheduleViewLevel>({\n value: view,\n defaultValue: defaultView,\n onChange: onViewChange,\n });\n\n const [_date, _setDate] = useUncontrolled<Date | DateStringValue>({\n value: date,\n defaultValue: defaultDate ?? new Date(),\n });\n\n const handleDateChange = (newDate: DateStringValue) => {\n _setDate(newDate);\n onDateChange?.(newDate);\n };\n\n const handleViewChange = (newView: ScheduleViewLevel) => {\n if (newView === 'day' || newView === 'week' || newView === 'month') {\n _setView(newView);\n }\n };\n\n const commonProps = {\n resources,\n date: _date,\n onDateChange: handleDateChange,\n onViewChange: handleViewChange,\n events,\n locale,\n radius,\n labels,\n renderEventBody,\n renderResourceLabel,\n withEventsDragAndDrop: mode === 'static' ? false : withEventsDragAndDrop,\n onEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n onEventClick,\n withDragSlotSelect,\n onSlotDragEnd,\n onExternalEventDrop,\n recurrenceExpansionLimit,\n mode,\n };\n\n const content = (() => {\n switch (_view) {\n case 'day':\n return (\n <ResourcesDayView\n {...commonProps}\n onTimeSlotClick={onTimeSlotClick}\n withEventResize={mode === 'static' ? false : withEventResize}\n onEventResize={onEventResize}\n canResizeEvent={canResizeEvent}\n {...dayViewProps}\n />\n );\n case 'week':\n return (\n <ResourcesWeekView\n {...commonProps}\n onTimeSlotClick={onTimeSlotClick}\n withEventResize={mode === 'static' ? false : withEventResize}\n onEventResize={onEventResize}\n canResizeEvent={canResizeEvent}\n {...weekViewProps}\n />\n );\n case 'month':\n return (\n <ResourcesMonthView\n {...commonProps}\n onDayClick={onDayClick}\n withEventResize={mode === 'static' ? false : withEventResize}\n onEventResize={onEventResize}\n canResizeEvent={canResizeEvent}\n {...monthViewProps}\n />\n );\n default:\n return null;\n }\n })();\n\n return (\n <Box {...getStyles('root')} mod={mod} {...others}>\n {content}\n </Box>\n );\n});\n\nResourcesSchedule.displayName = '@mantine/schedule/ResourcesSchedule';\nResourcesSchedule.classes = classes;\n\nexport namespace ResourcesSchedule {\n export type Props = ResourcesScheduleProps;\n export type StylesNames = ResourcesScheduleStylesNames;\n export type Factory = ResourcesScheduleFactory;\n export type ViewLevel = ResourcesScheduleViewLevel;\n}\n"],"mappings":";;;;;;;;;AAqNA,MAAM,eAAgD;CACpD,aAAa;CACb,MAAM;AACR;AAEA,MAAa,qBAAA,GAAA,cAAA,QAAA,EAAuD,WAAW;CAC7E,MAAM,SAAA,GAAA,cAAA,SAAA,CAAiB,qBAAqB,cAAc,MAAM;CAChE,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,WACA,MACA,aACA,cACA,MACA,aACA,cACA,QACA,QACA,QACA,QACA,iBACA,qBACA,uBACA,aACA,cACA,kBACA,gBACA,iBACA,YACA,cACA,oBACA,eACA,qBACA,iBACA,eACA,gBACA,0BACA,MACA,cACA,eACA,gBACA,kBACA,KACA,GAAG,WACD;CAEJ,MAAM,aAAA,GAAA,cAAA,UAAA,CAAgD;EACpD,MAAM,oBAAoB;EAC1B,SAAA,iCAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,MAAM,CAAC,OAAO,aAAA,GAAA,eAAA,gBAAA,CAAwD;EACpE,OAAO;EACP,cAAc;EACd,UAAU;CACZ,CAAC;CAED,MAAM,CAAC,OAAO,aAAA,GAAA,eAAA,gBAAA,CAAoD;EAChE,OAAO;EACP,cAAc,+BAAe,IAAI,KAAK;CACxC,CAAC;CAED,MAAM,oBAAoB,YAA6B;EACrD,SAAS,OAAO;EAChB,eAAe,OAAO;CACxB;CAEA,MAAM,oBAAoB,YAA+B;EACvD,IAAI,YAAY,SAAS,YAAY,UAAU,YAAY,SACzD,SAAS,OAAO;CAEpB;CAEA,MAAM,cAAc;EAClB;EACA,MAAM;EACN,cAAc;EACd,cAAc;EACd;EACA;EACA;EACA;EACA;EACA;EACA,uBAAuB,SAAS,WAAW,QAAQ;EACnD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CAEA,MAAM,iBAAiB;EACrB,QAAQ,OAAR;GACE,KAAK,OACH,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACA,yBAAAA,kBAAD;IACE,GAAI;IACa;IACjB,iBAAiB,SAAS,WAAW,QAAQ;IAC9B;IACC;IAChB,GAAI;GACL,CAAA;GAEL,KAAK,QACH,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,0BAAAA,mBAAD;IACE,GAAI;IACa;IACjB,iBAAiB,SAAS,WAAW,QAAQ;IAC9B;IACC;IAChB,GAAI;GACL,CAAA;GAEL,KAAK,SACH,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,2BAAAA,oBAAD;IACE,GAAI;IACQ;IACZ,iBAAiB,SAAS,WAAW,QAAQ;IAC9B;IACC;IAChB,GAAI;GACL,CAAA;GAEL,SACE,OAAO;EACX;CACF,EAAA,CAAG;CAEH,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,cAAAA,KAAD;EAAK,GAAI,UAAU,MAAM;EAAQ;EAAK,GAAI;YACvC;CACE,CAAA;AAET,CAAC;AAED,kBAAkB,cAAc;AAChC,kBAAkB,UAAUC,iCAAAA"}
1
+ {"version":3,"file":"ResourcesSchedule.cjs","names":["factory","useProps","useStyles","useUncontrolled","ResourcesDayView","ResourcesWeekView","ResourcesMonthView","Box","classes"],"sources":["../../../src/components/ResourcesSchedule/ResourcesSchedule.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n ElementProps,\n factory,\n Factory,\n MantineRadius,\n StylesApiProps,\n useProps,\n useStyles,\n} from '@mantine/core';\nimport { useUncontrolled } from '@mantine/hooks';\nimport { ScheduleLabelsOverride } from '../../labels';\nimport {\n DateStringValue,\n DateTimeStringValue,\n ScheduleEventData,\n ScheduleMode,\n ScheduleResourceData,\n ScheduleViewLevel,\n} from '../../types';\nimport {\n ResourcesDayView,\n ResourcesDayViewProps,\n ResourcesDayViewStylesNames,\n} from '../ResourcesDayView/ResourcesDayView';\nimport {\n ResourcesMonthView,\n ResourcesMonthViewProps,\n ResourcesMonthViewStylesNames,\n} from '../ResourcesMonthView/ResourcesMonthView';\nimport {\n ResourcesWeekView,\n ResourcesWeekViewProps,\n ResourcesWeekViewStylesNames,\n} from '../ResourcesWeekView/ResourcesWeekView';\nimport { RenderEventBody } from '../ScheduleEvent/ScheduleEvent';\nimport classes from './ResourcesSchedule.module.css';\n\nexport type ResourcesScheduleStylesNames =\n | 'root'\n | ResourcesDayViewStylesNames\n | ResourcesWeekViewStylesNames\n | ResourcesMonthViewStylesNames;\n\nexport type ResourcesScheduleViewLevel = 'day' | 'week' | 'month';\n\ntype ResourcesScheduleCommonProps =\n | 'date'\n | 'onDateChange'\n | 'resources'\n | 'events'\n | 'locale'\n | 'radius'\n | 'labels'\n | 'renderEventBody'\n | 'renderResourceLabel'\n | 'withEventsDragAndDrop'\n | 'onEventDrop'\n | 'canDragEvent'\n | 'onEventDragStart'\n | 'onEventDragEnd'\n | 'onTimeSlotClick'\n | 'onEventClick'\n | 'onDayClick'\n | 'withDragSlotSelect'\n | 'onSlotDragEnd'\n | 'view'\n | 'onViewChange'\n | 'mode'\n | 'onExternalEventDrop'\n | 'withEventResize'\n | 'onEventResize'\n | 'canResizeEvent'\n | 'recurrenceExpansionLimit'\n | 'withInteractiveBackgroundEvents';\n\ntype ResourcesScheduleViewProps<T> = Partial<Omit<T, ResourcesScheduleCommonProps>>;\n\nexport interface ResourcesScheduleProps\n extends BoxProps, StylesApiProps<ResourcesScheduleFactory>, ElementProps<'div'> {\n __staticSelector?: string;\n\n /** List of resources to display */\n resources: ScheduleResourceData[];\n\n /** Current date to display (controlled) */\n date?: Date | DateStringValue;\n\n /** Default date (uncontrolled) */\n defaultDate?: Date | DateStringValue;\n\n /** Called when date changes via navigation */\n onDateChange?: (date: DateStringValue) => void;\n\n /** Current view level (controlled) */\n view?: ResourcesScheduleViewLevel;\n\n /** Default view level (uncontrolled) @default 'day' */\n defaultView?: ResourcesScheduleViewLevel;\n\n /** Called when view level changes */\n onViewChange?: (view: ResourcesScheduleViewLevel) => void;\n\n /** Events to display across all views */\n events?: ScheduleEventData[];\n\n /** Locale for date formatting */\n locale?: string;\n\n /** Key of theme.radius or any valid CSS value to set border-radius */\n radius?: MantineRadius;\n\n /** Labels override for i18n */\n labels?: ScheduleLabelsOverride;\n\n /** Custom event body renderer */\n renderEventBody?: RenderEventBody;\n\n /** Custom resource label renderer */\n renderResourceLabel?: (resource: ScheduleResourceData) => React.ReactNode;\n\n /** Enable drag and drop for events @default false */\n withEventsDragAndDrop?: boolean;\n\n /** Called when event is dropped */\n onEventDrop?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n resourceId?: string | number;\n }) => void;\n\n /** Function to determine if event can be dragged */\n canDragEvent?: (event: ScheduleEventData) => boolean;\n\n /** Called when any event drag starts */\n onEventDragStart?: (event: ScheduleEventData) => void;\n\n /** Called when any event drag ends */\n onEventDragEnd?: () => void;\n\n /** Called when time slot is clicked */\n onTimeSlotClick?: (data: {\n slotStart: DateTimeStringValue;\n slotEnd: DateTimeStringValue;\n nativeEvent: React.MouseEvent<HTMLButtonElement>;\n resourceId?: string | number;\n }) => void;\n\n /** Called when day is clicked in month view */\n onDayClick?: (data: {\n date: DateStringValue;\n nativeEvent: React.MouseEvent<HTMLButtonElement>;\n resourceId?: string | number;\n }) => void;\n\n /** Called when event is clicked */\n onEventClick?: (event: ScheduleEventData, e: React.MouseEvent<HTMLButtonElement>) => void;\n\n /** If set, enables drag-to-select slot ranges @default false */\n withDragSlotSelect?: boolean;\n\n /** Called when a slot range is selected by dragging */\n onSlotDragEnd?: (data: {\n rangeStart: DateTimeStringValue;\n rangeEnd: DateTimeStringValue;\n resourceId?: string | number;\n }) => void;\n\n /** Interaction mode @default default */\n mode?: ScheduleMode;\n\n /** Called when an external item is dropped onto the schedule */\n onExternalEventDrop?: (data: {\n dataTransfer: DataTransfer;\n dropDateTime: DateTimeStringValue;\n resourceId?: string | number;\n }) => void;\n\n /** If true, events can be resized by dragging their edges, resizing snaps to whole days in month view @default false */\n withEventResize?: boolean;\n\n /** Called when event is resized */\n onEventResize?: (data: {\n eventId: string | number;\n newStart: DateTimeStringValue;\n newEnd: DateTimeStringValue;\n event: ScheduleEventData;\n }) => void;\n\n /** Function to determine if event can be resized */\n canResizeEvent?: (event: ScheduleEventData) => boolean;\n\n /** If set, background events (`display: 'background'`) can be clicked and trigger `onEventClick`. Applies to `day` and `week` views only – `ResourcesMonthView` does not render background events separately. @default false */\n withInteractiveBackgroundEvents?: boolean;\n\n /** Max number of generated recurring instances @default 2000 */\n recurrenceExpansionLimit?: number;\n\n /** Props specific to ResourcesDayView */\n dayViewProps?: ResourcesScheduleViewProps<ResourcesDayViewProps>;\n\n /** Props specific to ResourcesWeekView */\n weekViewProps?: ResourcesScheduleViewProps<ResourcesWeekViewProps>;\n\n /** Props specific to ResourcesMonthView */\n monthViewProps?: ResourcesScheduleViewProps<ResourcesMonthViewProps>;\n}\n\nexport type ResourcesScheduleFactory = Factory<{\n props: ResourcesScheduleProps;\n ref: HTMLDivElement;\n stylesNames: ResourcesScheduleStylesNames;\n}>;\n\nconst defaultProps: Partial<ResourcesScheduleProps> = {\n defaultView: 'day',\n mode: 'default',\n};\n\nexport const ResourcesSchedule = factory<ResourcesScheduleFactory>((_props) => {\n const props = useProps('ResourcesSchedule', defaultProps, _props);\n const {\n classNames,\n className,\n style,\n styles,\n unstyled,\n vars,\n resources,\n date,\n defaultDate,\n onDateChange,\n view,\n defaultView,\n onViewChange,\n events,\n locale,\n radius,\n labels,\n renderEventBody,\n renderResourceLabel,\n withEventsDragAndDrop,\n onEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n onTimeSlotClick,\n onDayClick,\n onEventClick,\n withDragSlotSelect,\n onSlotDragEnd,\n onExternalEventDrop,\n withEventResize,\n onEventResize,\n canResizeEvent,\n withInteractiveBackgroundEvents,\n recurrenceExpansionLimit,\n mode,\n dayViewProps,\n weekViewProps,\n monthViewProps,\n __staticSelector,\n mod,\n ...others\n } = props;\n\n const getStyles = useStyles<ResourcesScheduleFactory>({\n name: __staticSelector || 'ResourcesSchedule',\n classes,\n props,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n });\n\n const [_view, _setView] = useUncontrolled<ResourcesScheduleViewLevel>({\n value: view,\n defaultValue: defaultView,\n onChange: onViewChange,\n });\n\n const [_date, _setDate] = useUncontrolled<Date | DateStringValue>({\n value: date,\n defaultValue: defaultDate ?? new Date(),\n });\n\n const handleDateChange = (newDate: DateStringValue) => {\n _setDate(newDate);\n onDateChange?.(newDate);\n };\n\n const handleViewChange = (newView: ScheduleViewLevel) => {\n if (newView === 'day' || newView === 'week' || newView === 'month') {\n _setView(newView);\n }\n };\n\n const commonProps = {\n resources,\n date: _date,\n onDateChange: handleDateChange,\n onViewChange: handleViewChange,\n events,\n locale,\n radius,\n labels,\n renderEventBody,\n renderResourceLabel,\n withEventsDragAndDrop: mode === 'static' ? false : withEventsDragAndDrop,\n onEventDrop,\n canDragEvent,\n onEventDragStart,\n onEventDragEnd,\n onEventClick,\n withDragSlotSelect,\n onSlotDragEnd,\n onExternalEventDrop,\n recurrenceExpansionLimit,\n mode,\n };\n\n const content = (() => {\n switch (_view) {\n case 'day':\n return (\n <ResourcesDayView\n {...commonProps}\n onTimeSlotClick={onTimeSlotClick}\n withEventResize={mode === 'static' ? false : withEventResize}\n onEventResize={onEventResize}\n canResizeEvent={canResizeEvent}\n withInteractiveBackgroundEvents={\n mode === 'static' ? false : withInteractiveBackgroundEvents\n }\n {...dayViewProps}\n />\n );\n case 'week':\n return (\n <ResourcesWeekView\n {...commonProps}\n onTimeSlotClick={onTimeSlotClick}\n withEventResize={mode === 'static' ? false : withEventResize}\n onEventResize={onEventResize}\n canResizeEvent={canResizeEvent}\n withInteractiveBackgroundEvents={\n mode === 'static' ? false : withInteractiveBackgroundEvents\n }\n {...weekViewProps}\n />\n );\n case 'month':\n return (\n <ResourcesMonthView\n {...commonProps}\n onDayClick={onDayClick}\n withEventResize={mode === 'static' ? false : withEventResize}\n onEventResize={onEventResize}\n canResizeEvent={canResizeEvent}\n {...monthViewProps}\n />\n );\n default:\n return null;\n }\n })();\n\n return (\n <Box {...getStyles('root')} mod={mod} {...others}>\n {content}\n </Box>\n );\n});\n\nResourcesSchedule.displayName = '@mantine/schedule/ResourcesSchedule';\nResourcesSchedule.classes = classes;\n\nexport namespace ResourcesSchedule {\n export type Props = ResourcesScheduleProps;\n export type StylesNames = ResourcesScheduleStylesNames;\n export type Factory = ResourcesScheduleFactory;\n export type ViewLevel = ResourcesScheduleViewLevel;\n}\n"],"mappings":";;;;;;;;;AAyNA,MAAM,eAAgD;CACpD,aAAa;CACb,MAAM;AACR;AAEA,MAAa,qBAAA,GAAoBA,cAAAA,QAAAA,EAAmC,WAAW;CAC7E,MAAM,SAAA,GAAQC,cAAAA,SAAAA,CAAS,qBAAqB,cAAc,MAAM;CAChE,MAAM,EACJ,YACA,WACA,OACA,QACA,UACA,MACA,WACA,MACA,aACA,cACA,MACA,aACA,cACA,QACA,QACA,QACA,QACA,iBACA,qBACA,uBACA,aACA,cACA,kBACA,gBACA,iBACA,YACA,cACA,oBACA,eACA,qBACA,iBACA,eACA,gBACA,iCACA,0BACA,MACA,cACA,eACA,gBACA,kBACA,KACA,GAAG,WACD;CAEJ,MAAM,aAAA,GAAYC,cAAAA,UAAAA,CAAoC;EACpD,MAAM,oBAAoB;EAC1B,SAAA,iCAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,MAAM,CAAC,OAAO,aAAA,GAAYC,eAAAA,gBAAAA,CAA4C;EACpE,OAAO;EACP,cAAc;EACd,UAAU;CACZ,CAAC;CAED,MAAM,CAAC,OAAO,aAAA,GAAYA,eAAAA,gBAAAA,CAAwC;EAChE,OAAO;EACP,cAAc,+BAAe,IAAI,KAAK;CACxC,CAAC;CAED,MAAM,oBAAoB,YAA6B;EACrD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