@baishuyun/ui-base 6.3.2 → 6.4.1

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 (264) hide show
  1. package/dist/Amap/AmapProvider/index.js +3 -3
  2. package/dist/Amap/{AmapProvider-CTn2CH8s.js → AmapProvider-CwKdpmCg.js} +1 -1
  3. package/dist/Amap/index.js +3 -3
  4. package/dist/Calendar/{AllDaySection-DS0Frx1p.js → AllDaySection-CseF1DuB.js} +3 -3
  5. package/dist/Calendar/{Calendar-BIjk9zys.js → Calendar-Yu2HfA5D.js} +85 -95
  6. package/dist/Calendar/{CurrentTimeIndicator-DaIywtIA.js → CurrentTimeIndicator-CUeblc9r.js} +2 -2
  7. package/dist/Calendar/{EventCard-D_VeOVDQ.js → EventCard-L6jaKgEw.js} +3 -2
  8. package/dist/Calendar/{TimeAxis-gKb8dTwY.js → TimeAxis-cK2_3FeM.js} +1 -1
  9. package/dist/Calendar/{TimeGrid-D8Du5vFP.js → TimeGrid-B8lvUb1W.js} +2 -2
  10. package/dist/Calendar/index.js +15 -16
  11. package/dist/Calendar/{layout-DvWx_7gn.js → layout-CaPxiRd-.js} +94 -96
  12. package/dist/Calendar/subcomponents/AllDaySection/index.js +8 -0
  13. package/dist/Calendar/subcomponents/CurrentTimeIndicator/index.js +5 -0
  14. package/dist/Calendar/subcomponents/EventCard/index.js +6 -0
  15. package/dist/Calendar/subcomponents/TimeAxis/index.js +4 -0
  16. package/dist/Calendar/subcomponents/TimeGrid/index.js +4 -0
  17. package/dist/Calendar/{style-hCRKx3m1.js → theme-BzNDRi0U.js} +19 -3
  18. package/dist/Calendar/utils/index.js +37 -41
  19. package/dist/Calendar/utils/layout/index.js +2 -2
  20. package/dist/Calendar/utils/theme/index.js +2 -0
  21. package/dist/ColorPicker/{ColorPicker-BNPxmfw_.js → ColorPicker-By-Y8Tyz.js} +3 -3
  22. package/dist/ColorPicker/index.js +4 -4
  23. package/dist/ConfigProvider/index.js +2 -2
  24. package/dist/DatePicker/DatePicker-PCdNachD.js +115 -0
  25. package/dist/DatePicker/{DatePickerPanel-BaVC1tq2.js → DatePickerPanel-HoxXteK0.js} +13 -12
  26. package/dist/DatePicker/{ensureDayjsPlugins-DZjJnZgo.js → ensureDayjsPlugins-C3aqki6i.js} +3 -4
  27. package/dist/DatePicker/index.js +5 -5
  28. package/dist/DropDown/{DropDown-m3HT_eex.js → DropDown-CvQAbsEo.js} +11 -11
  29. package/dist/DropDown/index.js +4 -4
  30. package/dist/Editor/{Buttons-BB3xV8ku.js → Buttons-DmSUkHWl.js} +4 -4
  31. package/dist/Editor/ToolbarPlugin/Buttons/index.js +8 -8
  32. package/dist/Editor/index.js +8 -8
  33. package/dist/Gantt/GanttChart/index.js +15 -0
  34. package/dist/Gantt/GanttChart-DJA8pG9U.js +2139 -0
  35. package/dist/Gantt/GanttHighlightContext-AIpN3-af.js +12 -0
  36. package/dist/Gantt/GanttTable/index.js +10 -0
  37. package/dist/Gantt/GanttTable-Di_p-0M1.js +83 -0
  38. package/dist/Gantt/GanttToolBar/index.js +11 -0
  39. package/dist/Gantt/GanttToolBar-D5pQdrzv.js +105 -0
  40. package/dist/Gantt/collapseKeys-C8139wvy.js +160 -0
  41. package/dist/Gantt/columnResize-By_1E48E.js +46 -0
  42. package/dist/Gantt/constants-D4ur8WRs.js +39 -0
  43. package/dist/Gantt/highlightTarget-DmzCIiQb.js +25 -0
  44. package/dist/Gantt/index.js +374 -0
  45. package/dist/Gantt/timelineViewConfig-BXl2UkN8.js +118 -0
  46. package/dist/Gantt/utils/index.js +6 -0
  47. package/dist/Modal/{Modal-CrK8gFOn.js → Modal-D3LFqIV4.js} +3 -3
  48. package/dist/Modal/index.js +1 -1
  49. package/dist/Select/{Select-Dz_xr4my.js → Select-OjCjCogR.js} +144 -138
  50. package/dist/Select/{SelectInputSearch-GHYAmQ3A.js → SelectInputSearch-DXPTGSc2.js} +1 -1
  51. package/dist/Select/index.js +5 -5
  52. package/dist/Table/Table-3-kFIm5v.js +543 -0
  53. package/dist/Table/constants-CKqc9Os_.js +25 -0
  54. package/dist/Table/hooks/index.js +2 -0
  55. package/dist/Table/hooks-CJ2CnSep.js +108 -0
  56. package/dist/Table/index.js +7 -0
  57. package/dist/Table/processRowspan-BCzfI5un.js +144 -0
  58. package/dist/Table/utils/index.js +2 -0
  59. package/dist/Tabs/{Tabs-CPRNkfMo.js → Tabs-DVQcB3YG.js} +1 -1
  60. package/dist/Tabs/index.js +1 -1
  61. package/dist/Tooltip/Tooltip-DW_XP13m.js +171 -0
  62. package/dist/Tooltip/index.js +1 -1
  63. package/dist/Tree/index.js +1 -1
  64. package/dist/animations/index.d.ts +2 -2
  65. package/dist/components/Amap/__tests__/helpers.d.ts +6 -0
  66. package/dist/components/Calendar/__tests__/helpers/testFormatMessage.d.ts +1 -1
  67. package/dist/components/Calendar/context/CalendarContext.d.ts +2 -1
  68. package/dist/components/Calendar/index.d.ts +2 -2
  69. package/dist/components/Calendar/{shared → subcomponents}/AllDaySection/AllDaySection.d.ts +1 -1
  70. package/dist/components/Calendar/subcomponents/DayView/DayView.d.ts +3 -0
  71. package/dist/components/Calendar/{shared → subcomponents}/EventCard/EventCard.d.ts +1 -1
  72. package/dist/components/Calendar/{panels/MonthPanel → subcomponents}/MonthCell/MonthCellPopover/MonthCellPopover.d.ts +1 -1
  73. package/dist/components/Calendar/subcomponents/MonthView/MonthView.d.ts +3 -0
  74. package/dist/components/Calendar/{panels/WeekPanel → subcomponents}/WeekAllDaySection/WeekAllDaySection.d.ts +1 -1
  75. package/dist/components/Calendar/{panels/MonthPanel → subcomponents}/WeekEventLayer/MoreButton.d.ts +1 -1
  76. package/dist/components/Calendar/{panels/MonthPanel → subcomponents}/WeekEventLayer/WeekEventLayer.d.ts +1 -1
  77. package/dist/components/Calendar/subcomponents/WeekView/WeekView.d.ts +3 -0
  78. package/dist/components/Calendar/utils/dateUtils.d.ts +2 -1
  79. package/dist/components/Calendar/utils/eventUtils.d.ts +1 -1
  80. package/dist/components/Calendar/utils/layout/dayLayoutAlgorithm.d.ts +1 -1
  81. package/dist/components/Calendar/utils/localeKey.d.ts +2 -0
  82. package/dist/components/Calendar/utils/normalizeData.d.ts +1 -1
  83. package/dist/components/Calendar/{style → utils/theme}/index.d.ts +1 -0
  84. package/dist/components/Calendar/{adapters → utils/theme}/platformTheme.d.ts +1 -1
  85. package/dist/components/Calendar/{style → utils/theme}/resolveCalendarThemeVars.d.ts +1 -1
  86. package/dist/components/Calendar/{style → utils/theme}/resolveSubcomponentThemes.d.ts +3 -3
  87. package/dist/components/Calendar/utils/weekTimedLayout.d.ts +1 -1
  88. package/dist/components/DatePicker/__tests__/DatePicker.getPopupContainer.test.d.ts +1 -0
  89. package/dist/components/DatePicker/__tests__/DatePicker.triggerActiveClassName.test.d.ts +1 -0
  90. package/dist/components/DatePicker/interface.d.ts +7 -0
  91. package/dist/components/Gantt/Gantt.d.ts +11 -0
  92. package/dist/components/Gantt/GanttChart/GanttBarTooltip/GanttBarTooltip.d.ts +3 -0
  93. package/dist/components/Gantt/GanttChart/GanttChart.d.ts +8 -0
  94. package/dist/components/Gantt/GanttChart/GanttChartCanvas.d.ts +4 -0
  95. package/dist/components/Gantt/GanttChart/GanttChartCanvasBackground.d.ts +4 -0
  96. package/dist/components/Gantt/GanttChart/GanttInteractionContext.d.ts +4 -0
  97. package/dist/components/Gantt/GanttChart/GanttSummaryBar/GanttSummaryBar.d.ts +4 -0
  98. package/dist/components/Gantt/GanttChart/GanttTaskBar/GanttTaskBar.d.ts +4 -0
  99. package/dist/components/Gantt/GanttChart/GanttTaskBar/useTaskBarPointer.d.ts +9 -0
  100. package/dist/components/Gantt/GanttChart/GanttTimelineContext.d.ts +4 -0
  101. package/dist/components/Gantt/GanttChart/GanttTimelineHeader/GanttTimelineHeader.d.ts +4 -0
  102. package/dist/components/Gantt/GanttChart/OffscreenTaskIndicators/OffscreenTaskIndicators.d.ts +4 -0
  103. package/dist/components/Gantt/GanttChart/OffscreenTaskIndicators/__tests__/OffscreenTaskIndicators.test.d.ts +1 -0
  104. package/dist/components/Gantt/GanttChart/TodayIndicator/TodayIndicator.d.ts +3 -0
  105. package/dist/components/Gantt/GanttChart/hooks/__tests__/timelineFocus.contract.test.d.ts +1 -0
  106. package/dist/components/Gantt/GanttChart/hooks/__tests__/useGanttColumnVirtual.test.d.ts +1 -0
  107. package/dist/components/Gantt/GanttChart/hooks/__tests__/useGanttDrag.clippedQuarterMonth.test.d.ts +0 -0
  108. package/dist/components/Gantt/GanttChart/hooks/__tests__/useOffscreenIndicators.test.d.ts +1 -0
  109. package/dist/components/Gantt/GanttChart/hooks/__tests__/useTimelineViewportController.test.d.ts +0 -0
  110. package/dist/components/Gantt/GanttChart/hooks/useBarTooltipHover.d.ts +19 -0
  111. package/dist/components/Gantt/GanttChart/hooks/useEdgeScroll.d.ts +6 -0
  112. package/dist/components/Gantt/GanttChart/hooks/useGanttColumnVirtual.d.ts +21 -0
  113. package/dist/components/Gantt/GanttChart/hooks/useGanttDrag.d.ts +15 -0
  114. package/dist/components/Gantt/GanttChart/hooks/useGanttRowVirtualScroll.d.ts +12 -0
  115. package/dist/components/Gantt/GanttChart/hooks/useGanttScrollbars.d.ts +2 -0
  116. package/dist/components/Gantt/GanttChart/hooks/useNormalizedItems.d.ts +11 -0
  117. package/dist/components/Gantt/GanttChart/hooks/useOffscreenIndicators.d.ts +11 -0
  118. package/dist/components/Gantt/GanttChart/hooks/useRowHoverHighlight.d.ts +10 -0
  119. package/dist/components/Gantt/GanttChart/hooks/useTimelineViewportController.d.ts +26 -0
  120. package/dist/components/Gantt/GanttChart/hooks/useTodayMs.d.ts +4 -0
  121. package/dist/components/Gantt/GanttChart/index.d.ts +1 -0
  122. package/dist/components/Gantt/GanttChart/utils/__tests__/dateRangeNormalizer.subday.test.d.ts +1 -0
  123. package/dist/components/Gantt/GanttChart/utils/__tests__/dragEngine.quarterMonth.test.d.ts +1 -0
  124. package/dist/components/Gantt/GanttChart/utils/__tests__/dragEngine.subday.test.d.ts +1 -0
  125. package/dist/components/Gantt/GanttChart/utils/__tests__/headerBuilder.quarterMonth.test.d.ts +1 -0
  126. package/dist/components/Gantt/GanttChart/utils/__tests__/headerBuilder.subday.test.d.ts +1 -0
  127. package/dist/components/Gantt/GanttChart/utils/__tests__/quarterMonthScale.test.d.ts +1 -0
  128. package/dist/components/Gantt/GanttChart/utils/__tests__/subdayScale.contract.test.d.ts +1 -0
  129. package/dist/components/Gantt/GanttChart/utils/__tests__/timelineMarkers.test.d.ts +1 -0
  130. package/dist/components/Gantt/GanttChart/utils/__tests__/timelineRange.test.d.ts +1 -0
  131. package/dist/components/Gantt/GanttChart/utils/__tests__/timelineViewConfig.test.d.ts +1 -0
  132. package/dist/components/Gantt/GanttChart/utils/__tests__/timelineViewportEngine.test.d.ts +1 -0
  133. package/dist/components/Gantt/GanttChart/utils/buildSummaryBarTooltipContent.d.ts +6 -0
  134. package/dist/components/Gantt/GanttChart/utils/constants.d.ts +102 -0
  135. package/dist/components/Gantt/GanttChart/utils/dateRangeNormalizer.d.ts +18 -0
  136. package/dist/components/Gantt/GanttChart/utils/dragEngine.d.ts +62 -0
  137. package/dist/components/Gantt/GanttChart/utils/headerBuilder.d.ts +14 -0
  138. package/dist/components/Gantt/GanttChart/utils/quarterMonthScale.d.ts +9 -0
  139. package/dist/components/Gantt/GanttChart/utils/taskBarUtils.d.ts +3 -0
  140. package/dist/components/Gantt/GanttChart/utils/timeScale.d.ts +35 -0
  141. package/dist/components/Gantt/GanttChart/utils/timelineFocus.d.ts +8 -0
  142. package/dist/components/Gantt/GanttChart/utils/timelineMarkers.d.ts +2 -0
  143. package/dist/components/Gantt/GanttChart/utils/timelineRange.d.ts +8 -0
  144. package/dist/components/Gantt/GanttChart/utils/timelineViewConfig.d.ts +106 -0
  145. package/dist/components/Gantt/GanttChart/utils/timelineViewportEngine.d.ts +44 -0
  146. package/dist/components/Gantt/GanttChart/utils/timezoneUtils.d.ts +11 -0
  147. package/dist/components/Gantt/GanttHighlightContext.d.ts +3 -0
  148. package/dist/components/Gantt/GanttResizeIndicator.d.ts +3 -0
  149. package/dist/components/Gantt/GanttTable/GanttTable.d.ts +7 -0
  150. package/dist/components/Gantt/GanttTable/hooks/useGanttTableHighlightDomSync.d.ts +2 -0
  151. package/dist/components/Gantt/GanttTable/hooks/useGanttTableLinkedScroll.d.ts +7 -0
  152. package/dist/components/Gantt/GanttTable/index.d.ts +1 -0
  153. package/dist/components/Gantt/GanttTable/utils/mapGanttColumns.d.ts +13 -0
  154. package/dist/components/Gantt/GanttToolBar/GanttToolBar.d.ts +3 -0
  155. package/dist/components/Gantt/GanttToolBar/index.d.ts +1 -0
  156. package/dist/components/Gantt/__tests__/Gantt.contract.test.d.ts +0 -0
  157. package/dist/components/Gantt/__tests__/Gantt.grouped.contract.test.d.ts +0 -0
  158. package/dist/components/Gantt/__tests__/GanttBars.renderWindow.test.d.ts +1 -0
  159. package/dist/components/Gantt/__tests__/GanttChart.contract.test.d.ts +0 -0
  160. package/dist/components/Gantt/__tests__/GanttSummaryBar.tooltip.test.d.ts +1 -0
  161. package/dist/components/Gantt/__tests__/GanttToolBar.test.d.ts +1 -0
  162. package/dist/components/Gantt/__tests__/filterItemsByCollapse.test.d.ts +1 -0
  163. package/dist/components/Gantt/__tests__/helpers/ganttDomSetup.d.ts +1 -0
  164. package/dist/components/Gantt/__tests__/helpers/ganttTestFixtures.d.ts +7 -0
  165. package/dist/components/Gantt/__tests__/helpers/ganttTestMocks.d.ts +8 -0
  166. package/dist/components/Gantt/__tests__/helpers/renderWithLocale.d.ts +3 -0
  167. package/dist/components/Gantt/__tests__/helpers/testFormatMessage.d.ts +2 -0
  168. package/dist/components/Gantt/__tests__/interface.contract.types.test.d.ts +1 -0
  169. package/dist/components/Gantt/__tests__/timezoneUtils.test.d.ts +1 -0
  170. package/dist/components/Gantt/__tests__/useBarTooltipHover.test.d.ts +1 -0
  171. package/dist/components/Gantt/__tests__/useGanttHighlight.test.d.ts +1 -0
  172. package/dist/components/Gantt/__tests__/useTaskBarPointer.test.d.ts +1 -0
  173. package/dist/components/Gantt/hooks/useGanttCollapseState.d.ts +6 -0
  174. package/dist/components/Gantt/hooks/useGanttHighlight.d.ts +10 -0
  175. package/dist/components/Gantt/hooks/useGanttLayout.d.ts +7 -0
  176. package/dist/components/Gantt/hooks/useLinkedVerticalScroll.d.ts +6 -0
  177. package/dist/components/Gantt/index.d.ts +9 -0
  178. package/dist/components/Gantt/interface.d.ts +140 -0
  179. package/dist/components/Gantt/internal/GanttLayout.d.ts +8 -0
  180. package/dist/components/Gantt/internal/GanttTableShell.d.ts +3 -0
  181. package/dist/components/Gantt/types.internal.d.ts +327 -0
  182. package/dist/components/Gantt/utils/collapseKeys.d.ts +4 -0
  183. package/dist/components/Gantt/utils/columnResize.d.ts +19 -0
  184. package/dist/components/Gantt/utils/constants.d.ts +4 -0
  185. package/dist/components/Gantt/utils/filterItemsByCollapse.d.ts +9 -0
  186. package/dist/components/Gantt/utils/highlightTarget.d.ts +13 -0
  187. package/dist/components/Gantt/utils/index.d.ts +8 -0
  188. package/dist/components/Gantt/utils/localeKey.d.ts +2 -0
  189. package/dist/components/Gantt/utils/tableWidthStorage.d.ts +3 -0
  190. package/dist/components/Select/__tests__/Select.getPopupContainer.test.d.ts +1 -0
  191. package/dist/components/Select/interface.d.ts +4 -0
  192. package/dist/components/Table/Table.d.ts +4 -0
  193. package/dist/components/Table/__tests__/HeaderCell.test.d.ts +1 -0
  194. package/dist/components/Table/__tests__/TableBody.test.d.ts +1 -0
  195. package/dist/components/Table/__tests__/processRowspan.test.d.ts +1 -0
  196. package/dist/components/Table/components/HeaderCell.d.ts +16 -0
  197. package/dist/components/Table/components/TableBody.d.ts +45 -0
  198. package/dist/components/Table/components/TableFooter.d.ts +18 -0
  199. package/dist/components/Table/components/TableHeader.d.ts +14 -0
  200. package/dist/components/Table/constants.d.ts +29 -0
  201. package/dist/components/Table/hooks/index.d.ts +2 -0
  202. package/dist/components/Table/hooks/useColumnResize.d.ts +11 -0
  203. package/dist/components/Table/hooks/useTableVirtual.d.ts +19 -0
  204. package/dist/components/Table/index.d.ts +9 -0
  205. package/dist/components/Table/interface.d.ts +114 -0
  206. package/dist/components/Table/utils/flattenColumns.d.ts +17 -0
  207. package/dist/components/Table/utils/index.d.ts +3 -0
  208. package/dist/components/Table/utils/processRowspan.d.ts +16 -0
  209. package/dist/components/Table/utils/tableUtils.d.ts +22 -0
  210. package/dist/components/Tooltip/Tooltip.type.d.ts +2 -0
  211. package/dist/components/index.d.ts +4 -2
  212. package/dist/hooks/useLatchedPopupPortalRoot.d.ts +11 -0
  213. package/dist/index.js +26 -25
  214. package/dist/locale/lang/en-US.json.d.ts +63 -0
  215. package/dist/locale/lang/zh-CN.json.d.ts +63 -0
  216. package/dist/locale/lang/zh-TW.json.d.ts +63 -0
  217. package/dist/style.css +1 -1
  218. package/dist/vendors/{ConfigProvider-DCm-93oJ.js → ConfigProvider-DwmA94S2.js} +128 -1
  219. package/dist/vendors/{LocaleContext-CRlzP8UO.js → LocaleContext-BJdHS0sH.js} +61 -0
  220. package/dist/vendors/{Tree-DJpkMB5u.js → Tree-C7BgkjCQ.js} +1 -1
  221. package/dist/vendors/{animations-BmT0HT5q.js → animations-BeI8JZp1.js} +7 -3
  222. package/dist/vendors/{useFloatingOverlay-uxlI1G-V.js → useFloatingOverlay-3KB88hpZ.js} +1 -0
  223. package/dist/vendors/{useLocale-D9kAzQlB.js → useLocale-BTz4slNW.js} +1 -1
  224. package/dist/vitest-matchers.d.ts +1 -0
  225. package/package.json +3 -2
  226. package/dist/Calendar/adapters/index.js +0 -2
  227. package/dist/Calendar/adapters-zYR7CgzD.js +0 -20
  228. package/dist/Calendar/shared/AllDaySection/index.js +0 -8
  229. package/dist/Calendar/shared/CurrentTimeIndicator/index.js +0 -5
  230. package/dist/Calendar/shared/EventCard/index.js +0 -6
  231. package/dist/Calendar/shared/TimeAxis/index.js +0 -4
  232. package/dist/Calendar/shared/TimeGrid/index.js +0 -4
  233. package/dist/Calendar/style/index.js +0 -2
  234. package/dist/DatePicker/DatePicker-B2skjsiQ.js +0 -91
  235. package/dist/Tooltip/Tooltip-RkD8fs0B.js +0 -169
  236. package/dist/components/Calendar/adapters/index.d.ts +0 -1
  237. package/dist/components/Calendar/panels/DayPanel/DayPanel.d.ts +0 -3
  238. package/dist/components/Calendar/panels/MonthPanel/MonthPanel.d.ts +0 -3
  239. package/dist/components/Calendar/panels/WeekPanel/WeekPanel.d.ts +0 -3
  240. /package/dist/components/Calendar/{shared → subcomponents}/AllDaySection/index.d.ts +0 -0
  241. /package/dist/components/Calendar/{Header → subcomponents}/CalendarHeader/CalendarHeader.d.ts +0 -0
  242. /package/dist/components/Calendar/{Header → subcomponents}/CalendarHeaderLeft/CalendarHeaderLeft.d.ts +0 -0
  243. /package/dist/components/Calendar/{shared → subcomponents}/CurrentTimeIndicator/CurrentTimeIndicator.d.ts +0 -0
  244. /package/dist/components/Calendar/{shared → subcomponents}/CurrentTimeIndicator/index.d.ts +0 -0
  245. /package/dist/components/Calendar/{Header → subcomponents}/DateDisplay/DateDisplay.d.ts +0 -0
  246. /package/dist/components/Calendar/{Header → subcomponents}/DateDisplay/__tests__/DateDisplay.weekPicker.test.d.ts +0 -0
  247. /package/dist/components/Calendar/{panels/DayPanel → subcomponents/DayView}/__tests__/CalendarDay.dayFilter.test.d.ts +0 -0
  248. /package/dist/components/Calendar/{shared → subcomponents}/EventCard/__tests__/EventCard.tooltip.test.d.ts +0 -0
  249. /package/dist/components/Calendar/{shared → subcomponents}/EventCard/index.d.ts +0 -0
  250. /package/dist/components/Calendar/{panels/MonthPanel → subcomponents}/MonthCell/MonthCell.d.ts +0 -0
  251. /package/dist/components/Calendar/{panels/MonthPanel → subcomponents}/MonthHeader/MonthHeader.d.ts +0 -0
  252. /package/dist/components/Calendar/{Header → subcomponents}/NavButton/NavButton.d.ts +0 -0
  253. /package/dist/components/Calendar/{shared → subcomponents}/TimeAxis/TimeAxis.d.ts +0 -0
  254. /package/dist/components/Calendar/{shared → subcomponents}/TimeAxis/index.d.ts +0 -0
  255. /package/dist/components/Calendar/{shared → subcomponents}/TimeGrid/TimeGrid.d.ts +0 -0
  256. /package/dist/components/Calendar/{shared → subcomponents}/TimeGrid/index.d.ts +0 -0
  257. /package/dist/components/Calendar/{Header → subcomponents}/TodayButton/TodayButton.d.ts +0 -0
  258. /package/dist/components/Calendar/{panels/WeekPanel → subcomponents}/WeekHeader/WeekHeader.d.ts +0 -0
  259. /package/dist/components/Calendar/{internalTypes.d.ts → types.internal.d.ts} +0 -0
  260. /package/dist/components/Calendar/{adapters → utils/theme}/__tests__/platformTheme.test.d.ts +0 -0
  261. /package/dist/components/Calendar/{style → utils/theme}/__tests__/resolveCalendarThemeVars.test.d.ts +0 -0
  262. /package/dist/components/Calendar/{style → utils/theme}/__tests__/resolveScheduleColorVars.test.d.ts +0 -0
  263. /package/dist/components/Calendar/{style → utils/theme}/__tests__/resolveSubcomponentThemes.test.d.ts +0 -0
  264. /package/dist/components/Calendar/{style → utils/theme}/resolveScheduleColorVars.d.ts +0 -0
@@ -0,0 +1,2139 @@
1
+ import { t as e } from "../Icon/Icon-BQ3Whub2.js";
2
+ import { t } from "../vendors/useLocale-BTz4slNW.js";
3
+ import { t as n } from "../Tooltip/Tooltip-DW_XP13m.js";
4
+ import { a as r, f as i, g as a, i as o, m as s, n as c, o as l, r as u } from "./constants-D4ur8WRs.js";
5
+ import { t as d } from "./GanttHighlightContext-AIpN3-af.js";
6
+ import { n as f, r as p } from "./highlightTarget-DmzCIiQb.js";
7
+ import { a as m, d as h, i as g, n as _, r as v, t as y, u as b } from "./timelineViewConfig-BXl2UkN8.js";
8
+ import { _ as x, a as S, b as C, c as w, d as T, f as ee, g as E, h as D, i as O, l as k, m as A, o as j, p as M, r as N, s as te, t as ne, u as re, v as ie, x as ae, y as P } from "./collapseKeys-C8139wvy.js";
9
+ import { n as oe, t as F } from "./GanttToolBar-D5pQdrzv.js";
10
+ import { isFunction as I, isNumber as L, isString as R } from "lodash-es";
11
+ import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
12
+ import H, { forwardRef as U, memo as W, useCallback as G, useEffect as K, useImperativeHandle as se, useLayoutEffect as ce, useMemo as q, useRef as J, useState as Y } from "react";
13
+ import X from "clsx";
14
+ import { useDocumentVisibility as le, useSize as ue } from "ahooks";
15
+ import { createContext as de, useContextSelector as Z } from "use-context-selector";
16
+ import Q from "dayjs";
17
+ import fe from "dayjs/plugin/isoWeek";
18
+ import { useVirtualizer as pe } from "@tanstack/react-virtual";
19
+ import me from "dayjs/plugin/quarterOfYear";
20
+ import { OverlayScrollbars as he } from "overlayscrollbars";
21
+ //#region src/components/Gantt/GanttChart/utils/dragEngine.ts
22
+ var ge = (e) => e?.type === "task" && e?.draggable !== !1 && !e?.invalid, _e = {
23
+ canMove: !1,
24
+ canResizeStart: !1,
25
+ canResizeEnd: !1
26
+ }, ve = (e) => !e || e.invalid || e.type === "summary" || e.draggable === !1 ? _e : e.dragPermission ? {
27
+ canMove: e.dragPermission.canMove === !0,
28
+ canResizeStart: e.dragPermission.canResizeStart === !0,
29
+ canResizeEnd: e.dragPermission.canResizeEnd === !0
30
+ } : {
31
+ canMove: !0,
32
+ canResizeStart: !0,
33
+ canResizeEnd: !0
34
+ }, ye = (e, t) => ge(e) ? e?.dragPermission ? t === "move" ? e.dragPermission.canMove === !0 : t === "resize-start" ? e.dragPermission.canResizeStart === !0 : t === "resize-end" ? e.dragPermission.canResizeEnd === !0 : !1 : !0 : !1, be = (e, t) => !t || Math.abs(e) < Math.min(5, t) ? 0 : Math.round(e / t), xe = (e, t) => be(e, t), Se = (e, t, n = "round") => {
35
+ if (!t || !Number.isFinite(e)) return e;
36
+ let r = ae(e), i = Q(r).startOf("day").valueOf(), a = (r - i) / t, o;
37
+ return o = n === "floor" ? Math.floor(a) : n === "ceil" ? Math.ceil(a) : Math.round(a), ie(i + o * t);
38
+ }, Ce = (e, t, n) => ({
39
+ startMs: e + n,
40
+ endMs: t + n
41
+ }), we = ({ startMs: e, endMs: t, deltaMs: n, edge: r, minDurationMs: i }) => {
42
+ if (r === "start") {
43
+ let r = t - i;
44
+ return {
45
+ startMs: Math.min(e + n, r),
46
+ endMs: t
47
+ };
48
+ }
49
+ let a = e + i;
50
+ return {
51
+ startMs: e,
52
+ endMs: Math.max(t + n, a)
53
+ };
54
+ }, Te = (e, t, n, r) => {
55
+ let i = e.originStartMs, a = e.originEndMs, o = e.originAnchorPx ?? e.originLeftPx, c = e.originAnchorMs ?? n.timeAtX(o), l = o + t, u = n.timeAtX(l);
56
+ if (e.dragMode === "move") {
57
+ let t = Math.round((u - c) / s) * s;
58
+ i = e.originStartMs + t, a = e.originEndMs + t;
59
+ } else e.dragMode === "resize-start" ? (i = Se(u, r, "round"), a = e.originEndMs, a - i < r && (i = a - r)) : (a = Se(u, r, "round"), i = e.originStartMs, a - i < r && (a = i + r));
60
+ return {
61
+ deltaUnits: e.dragMode === "resize-end" ? Math.round((a - e.originEndMs) / r) : Math.round((i - e.originStartMs) / r),
62
+ previewStartMs: i,
63
+ previewEndMs: a,
64
+ previewLeftPx: e.dragMode === "resize-end" ? e.originLeftPx : l
65
+ };
66
+ };
67
+ function Ee(e) {
68
+ let t = {
69
+ taskId: String(e.item.id),
70
+ newStart: e.startMs,
71
+ newEnd: e.endMs,
72
+ deltaMs: e.deltaMs,
73
+ snapUnitMs: e.snapUnitMs,
74
+ changeType: e.changeType,
75
+ viewMode: e.viewMode
76
+ };
77
+ if (h(e.viewMode)) return {
78
+ taskId: t.taskId,
79
+ newStart: t.newStart,
80
+ newEnd: t.newEnd,
81
+ deltaMs: t.deltaMs,
82
+ snapUnitMs: t.snapUnitMs,
83
+ changeType: t.changeType,
84
+ viewMode: e.viewMode
85
+ };
86
+ let n = e;
87
+ return {
88
+ taskId: t.taskId,
89
+ newStart: t.newStart,
90
+ newEnd: t.newEnd,
91
+ deltaMs: t.deltaMs,
92
+ snapUnitMs: t.snapUnitMs,
93
+ changeType: t.changeType,
94
+ viewMode: n.viewMode,
95
+ deltaDays: n.deltaDays
96
+ };
97
+ }
98
+ var De = (e) => e && I(e.then) ? e : Promise.resolve(e);
99
+ //#endregion
100
+ //#region src/components/Gantt/GanttChart/hooks/useEdgeScroll.tsx
101
+ function Oe(e, t) {
102
+ let n = J(null), r = J(0), i = G(() => {
103
+ n.current !== null && (cancelAnimationFrame(n.current), n.current = null), r.current = 0;
104
+ }, []);
105
+ K(() => () => {
106
+ n.current !== null && cancelAnimationFrame(n.current);
107
+ }, []);
108
+ let a = G(() => {
109
+ if (n.current !== null) return;
110
+ let i = () => {
111
+ let a = e.current, o = r.current;
112
+ if (!a || o === 0) {
113
+ n.current = null;
114
+ return;
115
+ }
116
+ let s = a.scrollLeft, c = a.scrollWidth - a.clientWidth, l = Math.max(0, Math.min(c, s + o));
117
+ a.scrollLeft = l, l !== s && t?.current?.(), n.current = requestAnimationFrame(i);
118
+ };
119
+ n.current = requestAnimationFrame(i);
120
+ }, [e, t]);
121
+ return {
122
+ startEdgeDetection: G((t) => {
123
+ let i = e.current;
124
+ if (!i) return;
125
+ let o = i.getBoundingClientRect(), s = t - o.left, c = o.right - t, l = 0;
126
+ s < 0 ? (l = -10, a()) : c < 0 ? (l = 10, a()) : s < 60 ? (l = -(2 + 8 * (1 - s / 60)), a()) : c < 60 ? (l = 2 + 8 * (1 - c / 60), a()) : n.current !== null && (cancelAnimationFrame(n.current), n.current = null), r.current = l;
127
+ }, [e, a]),
128
+ stopEdgeScroll: i
129
+ };
130
+ }
131
+ //#endregion
132
+ //#region src/components/Gantt/GanttChart/hooks/useGanttDrag.tsx
133
+ function ke({ pixelsPerDay: e, viewMode: t, timelineCoords: n, onTaskTimeChange: i, containerRef: c, onDragInteractionChange: u }) {
134
+ let d = h(t), f = m(t), p = f / s * e, g = J(n);
135
+ g.current = n;
136
+ let [_, v] = Y({}), [y, b] = Y(null), x = J(null), S = J({
137
+ shouldSuppressClick: !1,
138
+ at: 0
139
+ }), C = J(0), w = J(null), { startEdgeDetection: T, stopEdgeScroll: ee } = Oe(c ?? { current: null }, w), E = J({});
140
+ K(() => {
141
+ x.current = y;
142
+ }, [y]), K(() => () => {
143
+ for (let e of Object.values(E.current)) e.timeoutId && clearTimeout(e.timeoutId);
144
+ }, []);
145
+ let D = G(() => {
146
+ v((e) => {
147
+ let t = Object.keys(E.current);
148
+ if (t.length === 0) return {};
149
+ let n = {};
150
+ for (let r of t) e[r] && (n[r] = e[r]);
151
+ return Object.keys(n).length === Object.keys(e).length ? e : n;
152
+ }), S.current = {
153
+ shouldSuppressClick: !1,
154
+ at: 0
155
+ };
156
+ }, []), O = G(() => {
157
+ for (let e of Object.values(E.current)) e.timeoutId && clearTimeout(e.timeoutId);
158
+ E.current = {}, v({}), S.current = {
159
+ shouldSuppressClick: !1,
160
+ at: 0
161
+ };
162
+ }, []), k = G((e, t, n, r, i = 1) => {
163
+ if (!ye(t, r) || t.invalid) return;
164
+ e.preventDefault(), e.stopPropagation();
165
+ let a = c?.current, o = a?.scrollLeft ?? 0, s = a?.getBoundingClientRect(), l = s ? e.clientX - s.left : 0, d = t.endMs ?? 0, f = t.startMs ?? 0, p = Math.max(1, i), m = r === "resize-end" ? n + p : n, h = l - (m - o), _ = {
166
+ taskId: t.id,
167
+ item: t,
168
+ startClientX: e.clientX,
169
+ grabOffsetInBar: h,
170
+ originLeftPx: n,
171
+ originWidthPx: p,
172
+ originAnchorPx: m,
173
+ originAnchorMs: g.current.timeAtX(m),
174
+ originStartMs: f,
175
+ originEndMs: d,
176
+ deltaUnits: 0,
177
+ dragMode: r,
178
+ previewLeftPx: n,
179
+ previewStartMs: f,
180
+ previewEndMs: d
181
+ };
182
+ S.current = {
183
+ shouldSuppressClick: !1,
184
+ at: 0
185
+ }, x.current = _, b(_), u?.(!0);
186
+ }, [c, u]), A = G((e, t, n, r) => {
187
+ k(e, t, n, o, r);
188
+ }, [k]), j = G((e, t, n, i, a) => {
189
+ k(e, t, n, i === "start" ? l : r, a);
190
+ }, [k]);
191
+ return K(() => {
192
+ if (!y?.taskId) return;
193
+ let e = (e) => {
194
+ let t = x.current;
195
+ if (!t) return;
196
+ let n = c?.current, r = n?.getBoundingClientRect(), i = n?.scrollLeft ?? 0, a = n?.clientWidth ?? 0, o = g.current, s = i + (r ? e - r.left : 0) - t.grabOffsetInBar, l = t.originWidthPx, u = l > a, m = s;
197
+ if (t.dragMode === "resize-end") m = t.originLeftPx;
198
+ else if (!u && a > 0) {
199
+ let e = i, n = i + Math.max(0, a - l);
200
+ t.dragMode === "move" && (m = Math.min(n, Math.max(e, s)));
201
+ }
202
+ let h = (t.dragMode === "resize-end" ? s : m) - t.originAnchorPx;
203
+ if (!d) {
204
+ let e = {
205
+ ...Te(t, h, o, f),
206
+ previewLeftPx: m
207
+ };
208
+ if (e.deltaUnits === t.deltaUnits && e.previewLeftPx === t.previewLeftPx && e.previewStartMs === t.previewStartMs && e.previewEndMs === t.previewEndMs) return;
209
+ let n = {
210
+ ...t,
211
+ ...e
212
+ };
213
+ x.current = n, b(n);
214
+ return;
215
+ }
216
+ let _ = xe(h, p), v = {
217
+ ...t,
218
+ deltaUnits: _,
219
+ previewLeftPx: t.dragMode === "resize-end" ? t.originLeftPx : m
220
+ };
221
+ if (t.dragMode === "move") {
222
+ let e = Ce(t.originStartMs, t.originEndMs, _ * f);
223
+ v.previewStartMs = e.startMs, v.previewEndMs = e.endMs;
224
+ } else {
225
+ let e = we({
226
+ startMs: t.originStartMs,
227
+ endMs: t.originEndMs,
228
+ deltaMs: _ * f,
229
+ edge: t.dragMode === "resize-start" ? "start" : "end",
230
+ minDurationMs: f
231
+ });
232
+ v.previewStartMs = e.startMs, v.previewEndMs = e.endMs, t.dragMode === "resize-start" && (v.previewLeftPx = m);
233
+ }
234
+ let y = Math.round((v.previewStartMs - t.originStartMs) / f), S = {
235
+ ...v,
236
+ deltaUnits: t.dragMode === "resize-end" ? Math.round((v.previewEndMs - t.originEndMs) / f) : y
237
+ };
238
+ S.deltaUnits === t.deltaUnits && S.previewLeftPx === t.previewLeftPx && S.previewStartMs === t.previewStartMs && S.previewEndMs === t.previewEndMs || (x.current = S, b(S));
239
+ };
240
+ w.current = () => e(C.current);
241
+ let n = (t) => {
242
+ C.current = t.clientX, T(t.clientX), e(t.clientX);
243
+ }, r = () => {
244
+ ee(), w.current = null, e(C.current);
245
+ let n = x.current;
246
+ if (u?.(!1), !n) return;
247
+ let r = n.previewStartMs !== n.originStartMs || n.previewEndMs !== n.originEndMs;
248
+ S.current = {
249
+ shouldSuppressClick: r,
250
+ at: Date.now()
251
+ };
252
+ let o = r;
253
+ if (!ye(n.item, n.dragMode) || !o || !i) {
254
+ x.current = null, b(null);
255
+ return;
256
+ }
257
+ let c = n.taskId;
258
+ v((e) => ({
259
+ ...e,
260
+ [c]: {
261
+ startMs: n.previewStartMs,
262
+ endMs: n.previewEndMs
263
+ }
264
+ })), x.current = null, b(null);
265
+ let l = (E.current[c]?.opId || 0) + 1;
266
+ E.current[c]?.timeoutId && clearTimeout(E.current[c].timeoutId);
267
+ let p = setTimeout(() => {
268
+ E.current[c]?.opId === l && (console.warn(`[GanttDrag] task ${c} op ${l} timed out (${a}ms)`), v((e) => {
269
+ let t = { ...e };
270
+ return delete t[c], t;
271
+ }), delete E.current[c]);
272
+ }, a);
273
+ E.current[c] = {
274
+ opId: l,
275
+ startedAt: Date.now(),
276
+ timeoutId: p
277
+ };
278
+ let m, g;
279
+ if (d) if (n.dragMode === "move") {
280
+ let e = Se(n.previewStartMs, f, "round"), t = e - n.previewStartMs;
281
+ m = e, g = n.previewEndMs + t;
282
+ } else n.dragMode === "resize-start" ? (m = Se(n.previewStartMs, f, "round"), g = n.previewEndMs) : (m = n.previewStartMs, g = Se(n.previewEndMs, f, "round"));
283
+ else {
284
+ let e = Number.isFinite(n.item.rawStartMs) && Number.isFinite(n.item.baseStartMs) && Number.isFinite(n.previewStartMs), t = Number.isFinite(n.item.rawEndMs) && Number.isFinite(n.item.baseEndMs) && Number.isFinite(n.previewEndMs), r = e ? Math.round((n.previewStartMs - (n.item.baseStartMs ?? 0)) / s) : 0, i = t ? Math.round((n.previewEndMs - (n.item.baseEndMs ?? 0)) / s) : 0;
285
+ m = e ? (n.item.rawStartMs ?? 0) + r * s : n.item.rawStartMs ?? 0, g = t ? (n.item.rawEndMs ?? 0) + i * s : n.item.rawEndMs ?? 0;
286
+ }
287
+ let _;
288
+ _ = h(t) ? Ee({
289
+ item: n.item,
290
+ startMs: m,
291
+ endMs: g,
292
+ deltaMs: n.deltaUnits * f,
293
+ snapUnitMs: f,
294
+ changeType: n.dragMode,
295
+ viewMode: t
296
+ }) : Ee({
297
+ item: n.item,
298
+ startMs: m,
299
+ endMs: g,
300
+ deltaDays: n.deltaUnits,
301
+ deltaMs: n.deltaUnits * f,
302
+ snapUnitMs: f,
303
+ changeType: n.dragMode,
304
+ viewMode: t
305
+ }), De(i(_)).catch((e) => {
306
+ console.error("[GanttChart] onTaskTimeChange rejected", e), E.current[c]?.opId === l && v((e) => {
307
+ let t = { ...e };
308
+ return delete t[c], t;
309
+ });
310
+ }).finally(() => {
311
+ E.current[c]?.opId === l && (clearTimeout(E.current[c].timeoutId), delete E.current[c]);
312
+ });
313
+ }, o = (e) => {
314
+ e.type === "visibilitychange" && document.visibilityState === "visible" || x.current && r();
315
+ };
316
+ return document.addEventListener("mousemove", n), document.addEventListener("mouseup", r), document.addEventListener("mouseleave", o), document.addEventListener("visibilitychange", o), window.addEventListener("blur", o), () => {
317
+ document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", r), document.removeEventListener("mouseleave", o), document.removeEventListener("visibilitychange", o), window.removeEventListener("blur", o), w.current = null;
318
+ };
319
+ }, [
320
+ y?.taskId,
321
+ d,
322
+ f,
323
+ p,
324
+ i,
325
+ e,
326
+ t,
327
+ T,
328
+ ee,
329
+ c,
330
+ u
331
+ ]), {
332
+ dragState: y,
333
+ committedRangeById: _,
334
+ resetCommittedRanges: D,
335
+ forceResetAllCommittedRanges: O,
336
+ handleTaskMouseDown: A,
337
+ handleResizeMouseDown: j,
338
+ consumeRecentDragResult: G(() => {
339
+ let { shouldSuppressClick: e, at: t } = S.current;
340
+ return S.current = {
341
+ shouldSuppressClick: !1,
342
+ at: 0
343
+ }, e ? Date.now() - t <= 400 : !1;
344
+ }, [])
345
+ };
346
+ }
347
+ //#endregion
348
+ //#region src/components/Gantt/GanttChart/utils/timelineFocus.ts
349
+ function Ae(e, t, n) {
350
+ let r = Number(t) > 0 ? Number(t) : 0, i = Number(n) > 0 ? Number(n) : 0, a = Math.max(0, i - r);
351
+ return Number.isFinite(e) ? Math.min(Math.max(0, e), a) : 0;
352
+ }
353
+ function je({ anchorMs: e, toX: t, viewportWidth: n, timelineWidth: r }) {
354
+ let i = Number(n) > 0 ? Number(n) : 0;
355
+ if (!Number.isFinite(e) || typeof t != "function" || i <= 0) return 0;
356
+ let a = t(e);
357
+ return Number.isFinite(a) ? Ae(a - i / 2, i, r) : 0;
358
+ }
359
+ //#endregion
360
+ //#region src/components/Gantt/GanttChart/hooks/useGanttColumnVirtual.ts
361
+ function Me(e) {
362
+ let t = Number(e);
363
+ return Math.max((Number.isFinite(t) && t > 0 ? t : 0) * 4, 240);
364
+ }
365
+ function Ne(e, t) {
366
+ if (!Array.isArray(e) || e.length === 0) return [];
367
+ let { scrollLeft: n = 0, viewportWidth: r = 0, pixelsPerDay: i } = t || {}, a = Me(Number(e[0]?.width) > 0 ? Number(e[0].width) : i), o = e[e.length - 1], s = Ae(n, r, Number(o?.left) + Number(o?.width) > 0 ? Number(o.left) + Number(o.width) : 0), c = Math.max(0, s - a), l = s + r + a, u = e.length, d = 0, f = u - 1, p = u;
368
+ for (; d <= f;) {
369
+ let t = d + f >> 1, n = e[t];
370
+ n.left + n.width > c ? (p = t, f = t - 1) : d = t + 1;
371
+ }
372
+ d = 0, f = u - 1;
373
+ let m = -1;
374
+ for (; d <= f;) {
375
+ let t = d + f >> 1;
376
+ e[t].left < l ? (m = t, d = t + 1) : f = t - 1;
377
+ }
378
+ if (p > m) return [];
379
+ let h = [];
380
+ for (let e = p; e <= m; e += 1) h.push({ index: e });
381
+ return h;
382
+ }
383
+ function Pe({ lowerSegments: e, pixelsPerDay: t, scrollLeft: n, viewportWidth: r, showWeekendHighlight: i, timelineStartMs: a, timelineWidth: o, viewMode: c }) {
384
+ return {
385
+ virtualColumns: q(() => Ne(e, {
386
+ scrollLeft: n,
387
+ viewportWidth: r,
388
+ pixelsPerDay: t
389
+ }), [
390
+ e,
391
+ t,
392
+ n,
393
+ r
394
+ ]),
395
+ weekendSegments: q(() => {
396
+ if (!i || o <= 0 || c !== "day") return [];
397
+ let e = Math.max(0, n - 120), l = n + r + 120, u = Math.max(0, Math.floor(e / t)), d = Math.ceil(l / t), f = [];
398
+ for (let e = u; e <= d; e += 1) {
399
+ let n = a + e * s, r = P(n);
400
+ (r === 0 || r === 6) && f.push({
401
+ id: `weekend-${n}`,
402
+ left: e * t,
403
+ width: t
404
+ });
405
+ }
406
+ return f;
407
+ }, [
408
+ i,
409
+ o,
410
+ n,
411
+ r,
412
+ t,
413
+ a,
414
+ c
415
+ ])
416
+ };
417
+ }
418
+ Q.extend(fe), Q.extend(me);
419
+ var Fe = {
420
+ day: {
421
+ amount: 1,
422
+ unit: "day"
423
+ },
424
+ week: {
425
+ amount: 1,
426
+ unit: "week"
427
+ },
428
+ month: {
429
+ amount: 1,
430
+ unit: "month"
431
+ },
432
+ quarter: {
433
+ amount: 1,
434
+ unit: "quarter"
435
+ },
436
+ quarterMonth: {
437
+ amount: 1,
438
+ unit: "month"
439
+ },
440
+ year: {
441
+ amount: 6,
442
+ unit: "month",
443
+ align: (e) => {
444
+ let t = e.month();
445
+ return t !== 0 && t !== 6 ? t < 6 ? e.startOf("year") : e.month(6).startOf("month") : e;
446
+ }
447
+ },
448
+ halfDay: {
449
+ amount: 12,
450
+ unit: "hour"
451
+ },
452
+ sixHour: {
453
+ amount: 6,
454
+ unit: "hour"
455
+ },
456
+ hour: {
457
+ amount: 1,
458
+ unit: "hour"
459
+ },
460
+ halfHour: {
461
+ amount: 30,
462
+ unit: "minute"
463
+ },
464
+ tenMinute: {
465
+ amount: 10,
466
+ unit: "minute"
467
+ },
468
+ oneMinute: {
469
+ amount: 1,
470
+ unit: "minute"
471
+ }
472
+ }, Ie = (e, t, n) => {
473
+ switch (t) {
474
+ case "halfDay": return e.hour() < 12 ? n("header.lower.halfDayAm") : n("header.lower.halfDayPm");
475
+ case "sixHour": {
476
+ let t = e.hour();
477
+ return n("header.lower.sixHourRange", {
478
+ start: t,
479
+ end: t + 6
480
+ });
481
+ }
482
+ case "hour": return String(e.hour());
483
+ case "halfHour": return e.format("HH:mm");
484
+ case "tenMinute": return String(e.minute());
485
+ case "oneMinute": return e.format("mm");
486
+ default: return e.format("DD");
487
+ }
488
+ }, Le = (e, t, n) => {
489
+ let r = C(e.valueOf());
490
+ switch (t) {
491
+ case "day": return r.format("DD");
492
+ case "week": return n("header.lower.week", { week: r.isoWeek() });
493
+ case "month":
494
+ case "quarterMonth": return D(e.valueOf(), n);
495
+ case "quarter": return n("header.lower.quarter", { quarter: r.quarter() });
496
+ case "year": return r.month() < 6 ? n("firstHalf") : n("secondHalf");
497
+ default: return Ie(r, t, n);
498
+ }
499
+ }, Re = (e, t) => {
500
+ let n = C(e.valueOf()), r = y(t).headerLayout;
501
+ return r === "dayNested" ? `day-${n.format("YYYY-MM-DD")}` : r === "hourNested" ? `hour-${n.format("YYYY-MM-DD-HH")}` : r === "quarterNested" ? `quarter-${n.format("YYYY")}-Q${n.quarter()}` : t === "day" || t === "week" ? `month-${n.format("YYYY-MM")}` : `year-${n.format("YYYY")}`;
502
+ }, ze = (e, t, n) => {
503
+ let r = C(e.valueOf()), i = y(t).headerLayout;
504
+ return i === "dayNested" ? n("header.top.monthDay", {
505
+ month: r.month() + 1,
506
+ day: r.date()
507
+ }) : i === "hourNested" ? r.hour() === 0 ? n("header.top.hourWithDate", {
508
+ month: r.month() + 1,
509
+ day: r.date(),
510
+ hour: 0
511
+ }) : n("header.top.hourOnly", { hour: r.hour() }) : i === "quarterNested" ? E(e.valueOf(), n) : t === "day" || t === "week" ? n("header.top.yearMonth", {
512
+ year: r.year(),
513
+ month: r.month() + 1
514
+ }) : n("header.top.year", { year: r.year() });
515
+ }, Be = (e, t, n, r, i, a, o) => {
516
+ let s = _(r), c = A ?? 100;
517
+ e.push({
518
+ id: `${r}-${t}`,
519
+ startMs: t,
520
+ endMs: n,
521
+ left: s ? e.length * c : M(t, i, a, r),
522
+ width: s ? c : Math.max(1, ee(t, n, a, r)),
523
+ label: Le(Q(t), r, o)
524
+ });
525
+ }, Ve = ({ viewMode: e, timelineStartMs: t, timelineEndMs: n, pixelsPerDay: r, formatMessage: i }) => {
526
+ let a = [], o = Fe[e] || Fe.day, s = Q(ae(t));
527
+ _(e) && (s = s.startOf("month"));
528
+ let c = Q(ae(n));
529
+ for (; s.isBefore(c);) {
530
+ o.align && (s = o.align(s));
531
+ let n = s.add(o.amount, o.unit);
532
+ Be(a, ie(s.valueOf()), ie(n.valueOf()), e, t, r, i), s = n;
533
+ }
534
+ return a;
535
+ }, He = ({ lowerSegments: e, viewMode: t, formatMessage: n }) => {
536
+ if (!Array.isArray(e) || e.length === 0) return [];
537
+ let r = [], i = null;
538
+ for (let a of e) {
539
+ let e = Q(a.startMs), o = Re(e, t);
540
+ if (!i || i.key !== o) {
541
+ i && r.push({
542
+ id: i.key,
543
+ left: i.left,
544
+ width: i.width,
545
+ label: i.label
546
+ }), i = {
547
+ key: o,
548
+ left: a.left,
549
+ width: a.width,
550
+ label: ze(e, t, n)
551
+ };
552
+ continue;
553
+ }
554
+ i.width += a.width;
555
+ }
556
+ return i !== null && r.push({
557
+ id: i.key,
558
+ left: i.left,
559
+ width: i.width,
560
+ label: i.label
561
+ }), r;
562
+ }, Ue = (e) => Number.isFinite(e.startMs) && Number.isFinite(e.endMs) && e.startMs < e.endMs, We = (e) => {
563
+ if (!Ue(e)) throw RangeError("Timeline range must be finite and satisfy startMs < endMs");
564
+ }, Ge = (e, t) => {
565
+ if (We(e), !Number.isFinite(t)) throw RangeError("Timeline time must be finite");
566
+ return e.startMs <= t && t < e.endMs;
567
+ }, Ke = (e, t) => (We(e), We(t), e.startMs < t.endMs && t.startMs < e.endMs), qe = (e, t) => {
568
+ We(e), We(t);
569
+ let n = Math.max(e.startMs, t.startMs), r = Math.min(e.endMs, t.endMs);
570
+ return n < r ? {
571
+ startMs: n,
572
+ endMs: r
573
+ } : null;
574
+ }, Je = (e, t) => {
575
+ if (!Number.isFinite(e) || e <= 0) throw RangeError(`${t} must be finite and greater than zero`);
576
+ }, Ye = (e, t) => {
577
+ if (Number.isFinite(e)) return e;
578
+ if (Number.isFinite(t)) return t;
579
+ throw RangeError("focusMs or fallbackFocusMs must be finite");
580
+ }, Xe = ({ startMs: e, endMs: t, viewMode: n, viewportWidth: r, pixelsPerDay: i }) => {
581
+ let a = (t - e) / s;
582
+ if (a * i >= r) return {
583
+ startMs: e,
584
+ endMs: t
585
+ };
586
+ let o = Math.ceil(r / i), c = Math.ceil((o - a) / 2) * s;
587
+ return S(e - c, t + c, n);
588
+ }, Ze = ({ range: e, focusMs: t, viewMode: n, viewportWidth: r, pixelsPerDay: i }) => {
589
+ let a = (r / 2 + 281) / i * s;
590
+ return Xe({
591
+ ...S(Math.min(e.startMs, t - a), Math.max(e.endMs, t + a), n),
592
+ viewMode: n,
593
+ viewportWidth: r,
594
+ pixelsPerDay: i
595
+ });
596
+ }, Qe = ({ renderWindow: e, timelineCoords: t, scrollLeft: n, viewportWidth: r }) => {
597
+ if (!Ue(e)) throw RangeError("renderWindow must be a valid timeline range");
598
+ if (!Number.isFinite(n) || n < 0) throw RangeError("scrollLeft must be finite and non-negative");
599
+ Je(r, "viewportWidth");
600
+ let i = {
601
+ startMs: t.timeAtX(n),
602
+ endMs: t.timeAtX(n + r)
603
+ };
604
+ if (!Ue(i)) throw RangeError("TimelineCoords must produce an increasing finite visible range");
605
+ let a = qe(i, e);
606
+ if (!a) throw RangeError("Visible range must intersect renderWindow");
607
+ let o = t.timeAtX(n + r / 2);
608
+ if (!Number.isFinite(o)) throw RangeError("TimelineCoords must produce a finite focus");
609
+ return {
610
+ renderWindow: e,
611
+ visibleRange: a,
612
+ focusMs: o
613
+ };
614
+ }, $e = ({ scrollLeft: e, viewportWidth: t, timelineWidth: n, guardBandPx: r }) => {
615
+ if (!Number.isFinite(e) || e < 0) throw RangeError("scrollLeft must be finite and non-negative");
616
+ if (Je(t, "viewportWidth"), Je(n, "timelineWidth"), !Number.isFinite(r) || r < 0) throw RangeError("guardBandPx must be finite and non-negative");
617
+ let i = Math.max(0, n - t);
618
+ if (i === 0) return null;
619
+ let a = Math.min(e, i), o = a <= r;
620
+ return o === i - a <= r ? null : o ? "left" : "right";
621
+ }, et = ({ focusMs: e, fallbackFocusMs: t, viewMode: n, timeRangeConfig: r, viewportWidth: i, pixelsPerDay: a }) => {
622
+ Je(i, "viewportWidth"), Je(a, "pixelsPerDay");
623
+ let o = Ye(e, t), s = Ze({
624
+ range: j(r, o),
625
+ focusMs: o,
626
+ viewMode: n,
627
+ viewportWidth: i,
628
+ pixelsPerDay: a
629
+ });
630
+ if (!Ue(s)) throw RangeError("Viewport engine produced an invalid render window");
631
+ return s;
632
+ }, tt = ({ focusMs: e, fallbackFocusMs: t, timelineCoords: n, viewportWidth: r, timelineWidth: i }) => {
633
+ let a = Ye(e, t);
634
+ return Je(r, "viewportWidth"), Je(i, "timelineWidth"), {
635
+ focusMs: a,
636
+ scrollLeft: je({
637
+ anchorMs: a,
638
+ toX: n.toX,
639
+ viewportWidth: r,
640
+ timelineWidth: i
641
+ })
642
+ };
643
+ }, nt = (e) => {
644
+ if (v(e)) {
645
+ let t = g(e);
646
+ return Se(Date.now(), t, "floor") + t / 2;
647
+ }
648
+ return T(Date.now()) + s / 2;
649
+ }, rt = (e, t) => {
650
+ if (v(t)) {
651
+ let n = g(t);
652
+ return Se(e, n, "floor") + n + 1;
653
+ }
654
+ return T(e) + s + 1;
655
+ }, it = (e) => {
656
+ let [t, n] = Y(() => nt(e)), r = J(null), i = G(() => {
657
+ r.current &&= (clearTimeout(r.current), null);
658
+ }, []), a = G(() => {
659
+ i();
660
+ let t = Date.now(), o = rt(t, e);
661
+ r.current = setTimeout(() => {
662
+ n(nt(e)), a();
663
+ }, Math.max(1, o - t));
664
+ }, [i, e]);
665
+ K(() => (n(nt(e)), a(), i), [
666
+ e,
667
+ a,
668
+ i
669
+ ]);
670
+ let o = le();
671
+ return K(() => {
672
+ o === "visible" && (n(nt(e)), a());
673
+ }, [
674
+ o,
675
+ a,
676
+ e
677
+ ]), t;
678
+ };
679
+ //#endregion
680
+ //#region src/components/Gantt/GanttChart/hooks/useTimelineViewportController.ts
681
+ function at({ timeRangeConfig: e, pixelsPerDayConfig: t, viewMode: n, contentRef: r, contentSize: i, headerTrackRef: a, formatMessage: o, isHorizontalScrollbarInteracting: s, isTaskBarInteracting: c = !1 }) {
682
+ let l = k(n, t), u = q(() => re(n, e), [n, e]), d = i?.width !== null && i?.width !== void 0 && Number(i.width) > 0 ? Number(i.width) : 0, f = J(!1), [p, m] = Y(!1), [h, g] = Y(d), _ = J(null), v = J(!1), y = J(!1), b = J(null), x = J(null), S = J(null), [C, w] = Y(0), T = G((e) => {
683
+ let t = S.current;
684
+ if (!t || !e) return !1;
685
+ let n = e.scrollLeft || 0;
686
+ return Math.abs(n - t.targetLeft) > 1;
687
+ }, []), ee = G((e) => {
688
+ let t = S.current;
689
+ t && Math.abs(e - t.targetLeft) <= 1 && (S.current = null);
690
+ }, []), E = G(() => {
691
+ x.current !== null && (cancelAnimationFrame(x.current), x.current = null), b.current = null;
692
+ }, []), D = G((e) => {
693
+ E();
694
+ let t = { left: e };
695
+ b.current = t, x.current = requestAnimationFrame(() => {
696
+ x.current = null, b.current === t && (b.current = null);
697
+ });
698
+ }, [E]), [O, A] = Y(0), j = J(0), M = J(0), N = J(null), ne = G((e) => {
699
+ M.current = e, N.current === null && (N.current = requestAnimationFrame(() => {
700
+ N.current = null;
701
+ let e = M.current;
702
+ A((t) => t === e ? t : e);
703
+ }));
704
+ }, []);
705
+ K(() => () => {
706
+ N.current !== null && cancelAnimationFrame(N.current), E();
707
+ }, [E]);
708
+ let [ie, ae] = Y(null), P = J(n), oe = P.current === n, F = oe ? ie : null, I = G(() => {
709
+ let e = _.current;
710
+ return e !== null && Number.isFinite(e) ? e : nt(n);
711
+ }, [n]), L = G((e) => {
712
+ Number.isFinite(e) && (_.current = e);
713
+ }, []), R = G((e) => {
714
+ S.current = null;
715
+ let t = et({
716
+ focusMs: e,
717
+ fallbackFocusMs: I(),
718
+ viewMode: n,
719
+ timeRangeConfig: u,
720
+ viewportWidth: h || 1e3,
721
+ pixelsPerDay: l
722
+ });
723
+ return ae(t), v.current = !0, t;
724
+ }, [
725
+ u,
726
+ l,
727
+ I,
728
+ n,
729
+ h
730
+ ]);
731
+ K(() => {
732
+ P.current = n, R(I());
733
+ }, [e?.bufferDaysBefore, e?.bufferDaysAfter]), ce(() => {
734
+ let e = i?.width !== null && i?.width !== void 0 && Number(i.width) > 0 ? Number(i.width) : 0, t = r.current?.clientWidth !== null && r.current?.clientWidth !== void 0 && Number(r.current.clientWidth) > 0 ? Number(r.current.clientWidth) : 0, n = e > 0 ? e : f.current ? t : 0;
735
+ n > 0 && n !== h && g(n);
736
+ }, [
737
+ r,
738
+ i?.width,
739
+ h
740
+ ]);
741
+ let z = q(() => F || et({
742
+ focusMs: I(),
743
+ viewMode: n,
744
+ timeRangeConfig: u,
745
+ viewportWidth: h || 1e3,
746
+ pixelsPerDay: l
747
+ }), [
748
+ F,
749
+ u,
750
+ l,
751
+ I,
752
+ n,
753
+ h
754
+ ]), { timelineStartMs: B, timelineEndMs: V } = q(() => ({
755
+ timelineStartMs: z.startMs,
756
+ timelineEndMs: z.endMs
757
+ }), [z]), H = q(() => Ve({
758
+ viewMode: n,
759
+ timelineStartMs: B,
760
+ timelineEndMs: V,
761
+ pixelsPerDay: l,
762
+ formatMessage: o
763
+ }), [
764
+ n,
765
+ B,
766
+ V,
767
+ l,
768
+ o
769
+ ]), U = q(() => te({
770
+ viewMode: n,
771
+ timelineStartMs: B,
772
+ timelineEndMs: V,
773
+ pixelsPerDay: l,
774
+ lowerSegments: H
775
+ }), [
776
+ n,
777
+ B,
778
+ V,
779
+ l,
780
+ H
781
+ ]), W = q(() => {
782
+ if (H.length === 0) return 0;
783
+ let e = H[H.length - 1];
784
+ return e.left + e.width;
785
+ }, [H]), se = G(() => v.current ? !1 : (R(I()), !0), [I, R]);
786
+ ce(() => {
787
+ P.current !== n && (P.current = n, R(I()));
788
+ }, [
789
+ n,
790
+ I,
791
+ R
792
+ ]);
793
+ let X = it(n), le = q(() => W <= 0 ? null : U.toX(X), [
794
+ X,
795
+ U,
796
+ W
797
+ ]), ue = G((e) => {
798
+ let t = a?.current;
799
+ t && t.style.setProperty("--gantt-scroll-left", `${e}px`);
800
+ }, [a]), de = G((e, t) => {
801
+ D(t), e.scrollLeft = t, ue(t), A(t), j.current = t;
802
+ }, [ue, D]), Z = G(() => {
803
+ let e = r.current, t = h;
804
+ if (!e || t <= 0 || W <= 0) return !1;
805
+ let { scrollLeft: n } = tt({
806
+ focusMs: _.current ?? NaN,
807
+ fallbackFocusMs: I(),
808
+ timelineCoords: U,
809
+ viewportWidth: t,
810
+ timelineWidth: W
811
+ });
812
+ return de(e, n), !0;
813
+ }, [
814
+ de,
815
+ r,
816
+ I,
817
+ U,
818
+ W,
819
+ h
820
+ ]), Q = G((e) => {
821
+ let t = e.currentTarget.scrollLeft, n = h, r = b.current, i = r !== null && Math.abs(t - r.left) <= 1;
822
+ r && E(), !i && f.current && (y.current = !0), ue(t);
823
+ let a = t !== j.current;
824
+ if (j.current = t, a && ne(t), n > 0 && !i) {
825
+ let e = Ae(t, n, W);
826
+ L(Qe({
827
+ renderWindow: {
828
+ startMs: B,
829
+ endMs: V
830
+ },
831
+ timelineCoords: U,
832
+ scrollLeft: e,
833
+ viewportWidth: n
834
+ }).focusMs);
835
+ }
836
+ ee(t);
837
+ }, [
838
+ ue,
839
+ E,
840
+ U,
841
+ h,
842
+ ne,
843
+ L,
844
+ ee,
845
+ V,
846
+ B,
847
+ W
848
+ ]), fe = G(() => {
849
+ let e = nt(n);
850
+ L(e), R(e);
851
+ }, [
852
+ R,
853
+ L,
854
+ n
855
+ ]), pe = G((e) => {
856
+ let t = r.current, n = e?.targetMs;
857
+ if (!t || !Number.isFinite(n)) return;
858
+ let i = t.clientWidth > 0 ? t.clientWidth : h;
859
+ if (n < B || n >= V) {
860
+ S.current = null, L(n), R(n);
861
+ return;
862
+ }
863
+ let a = je({
864
+ anchorMs: n,
865
+ toX: U.toX,
866
+ viewportWidth: i,
867
+ timelineWidth: W
868
+ }), o = t.scrollLeft || 0;
869
+ if (!(i > 0 && Math.abs(a - o) <= i * 1.5)) {
870
+ L(n), R(n);
871
+ return;
872
+ }
873
+ let s = typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth";
874
+ s === "smooth" ? S.current = { targetLeft: a } : (S.current = null, D(a)), t.scrollTo({
875
+ left: a,
876
+ behavior: s
877
+ }), L(n), s === "auto" && (ue(a), A(a), j.current = a);
878
+ }, [
879
+ ue,
880
+ r,
881
+ D,
882
+ R,
883
+ L,
884
+ U,
885
+ V,
886
+ B,
887
+ W,
888
+ h
889
+ ]);
890
+ K(() => {
891
+ if (!f.current || !h || !W || v.current || !y.current) return;
892
+ let e = r.current, t = e?.scrollLeft ?? O, n = $e({
893
+ scrollLeft: Math.max(0, t),
894
+ viewportWidth: h,
895
+ timelineWidth: W,
896
+ guardBandPx: 280
897
+ });
898
+ s || c || T(e) || (e && ee(e.scrollLeft || 0), n && se());
899
+ }, [
900
+ O,
901
+ W,
902
+ h,
903
+ r,
904
+ T,
905
+ ee,
906
+ se,
907
+ s,
908
+ c,
909
+ C
910
+ ]), ce(() => {
911
+ !f.current || h <= 0 || R(I());
912
+ }, [
913
+ I,
914
+ R,
915
+ h
916
+ ]), ce(() => {
917
+ v.current && (h <= 0 || W <= 0 || Z() && (v.current = !1, f.current || (f.current = !0, m(!0))));
918
+ }, [
919
+ Z,
920
+ W,
921
+ h,
922
+ ie
923
+ ]), ce(() => {
924
+ if (!f.current && h > 0 && W > 0) {
925
+ if (Number.isFinite(_.current ?? NaN) || L(nt(n)), !ie) {
926
+ R(I());
927
+ return;
928
+ }
929
+ v.current = !0, Z(), v.current = !1, f.current = !0, m(!0);
930
+ }
931
+ }, [
932
+ Z,
933
+ I,
934
+ R,
935
+ L,
936
+ ie,
937
+ W,
938
+ h,
939
+ n
940
+ ]);
941
+ let me = G((e) => {
942
+ let t = h;
943
+ t <= 0 || L(U.timeAtX(e + t / 2));
944
+ }, [
945
+ h,
946
+ U,
947
+ L
948
+ ]), he = G(() => {
949
+ let e = r.current;
950
+ if (!e) return;
951
+ let t = h, n = e.scrollLeft || 0, i = Math.max(0, n - t);
952
+ if (Math.abs(i - n) <= 1) {
953
+ S.current = null;
954
+ let e = U.timeAtX(n - t / 2);
955
+ L(e), R(e);
956
+ return;
957
+ }
958
+ S.current = { targetLeft: i }, e.scrollTo({
959
+ left: i,
960
+ behavior: "smooth"
961
+ }), me(i);
962
+ }, [
963
+ r,
964
+ R,
965
+ L,
966
+ U,
967
+ me,
968
+ h
969
+ ]), ge = G(() => {
970
+ let e = r.current;
971
+ if (!e) return;
972
+ let t = h, n = e.scrollLeft || 0, i = Math.max(0, W - t), a = Ae(n + t, t, W);
973
+ if (Math.abs(a - n) <= 1) {
974
+ if (S.current = null, a >= i - 1) {
975
+ let e = U.timeAtX(n + t * 1.5);
976
+ L(e), R(e);
977
+ }
978
+ return;
979
+ }
980
+ S.current = { targetLeft: a }, e.scrollTo({
981
+ left: a,
982
+ behavior: "smooth"
983
+ }), me(a);
984
+ }, [
985
+ r,
986
+ R,
987
+ L,
988
+ U,
989
+ h,
990
+ W,
991
+ me
992
+ ]);
993
+ K(() => {
994
+ let e = r.current;
995
+ if (!e) return;
996
+ let t = () => {
997
+ S.current && (S.current = null, w((e) => e + 1));
998
+ };
999
+ return e.addEventListener("scrollend", t), () => e.removeEventListener("scrollend", t);
1000
+ }, [r]);
1001
+ let _e = (!oe || v.current) && W > 0 && h > 0 ? tt({
1002
+ focusMs: _.current ?? NaN,
1003
+ fallbackFocusMs: I(),
1004
+ timelineCoords: U,
1005
+ viewportWidth: h,
1006
+ timelineWidth: W
1007
+ }).scrollLeft : O, { visibleStartMs: ve, visibleEndMs: ye } = q(() => {
1008
+ if (W <= 0 || h <= 0) return {
1009
+ visibleStartMs: B,
1010
+ visibleEndMs: B
1011
+ };
1012
+ let e = Ae(_e, h, W), { visibleRange: t } = Qe({
1013
+ renderWindow: {
1014
+ startMs: B,
1015
+ endMs: V
1016
+ },
1017
+ timelineCoords: U,
1018
+ scrollLeft: e,
1019
+ viewportWidth: h
1020
+ });
1021
+ return {
1022
+ visibleStartMs: t.startMs,
1023
+ visibleEndMs: t.endMs
1024
+ };
1025
+ }, [
1026
+ _e,
1027
+ U,
1028
+ V,
1029
+ B,
1030
+ W,
1031
+ h
1032
+ ]);
1033
+ return {
1034
+ pixelsPerDay: l,
1035
+ viewportWidth: h,
1036
+ scrollLeft: _e,
1037
+ timelineStartMs: B,
1038
+ timelineEndMs: V,
1039
+ visibleStartMs: ve,
1040
+ visibleEndMs: ye,
1041
+ lowerSegments: H,
1042
+ timelineCoords: U,
1043
+ timelineWidth: W,
1044
+ todayCenterMs: X,
1045
+ todayLineLeft: le,
1046
+ isInitialLayoutReady: p,
1047
+ handleContentScroll: Q,
1048
+ handleTodayClick: fe,
1049
+ handleOffscreenJump: pe,
1050
+ handleScrollPrev: he,
1051
+ handleScrollNext: ge
1052
+ };
1053
+ }
1054
+ //#endregion
1055
+ //#region src/components/Gantt/GanttChart/hooks/useNormalizedItems.ts
1056
+ function ot({ visibleItems: e, committedRangeById: t = {}, viewMode: n = "day" }) {
1057
+ return { normalizedItems: q(() => {
1058
+ let r = Array.isArray(e) ? e : [], i = [], a = b(n) ? n : "day";
1059
+ for (let e = 0; e < r.length; e++) {
1060
+ let n = r[e], o = String(n?.id ?? `row-${e}`), { rawStartMs: s, rawEndMs: c, baseStartMs: l, baseEndMs: u, invalid: d } = N(n?.start, n?.end), f = t[o], p = n?.type === "summary" ? !1 : d, m = O({
1061
+ rawStartMs: s,
1062
+ rawEndMs: c,
1063
+ baseStartMs: l,
1064
+ baseEndMs: u
1065
+ }, a), h = m.startMs, g = m.endMs;
1066
+ if (!p && f?.startMs && f?.endMs) {
1067
+ let e = f.startMs, t = f.endMs;
1068
+ Number.isFinite(e) && Number.isFinite(t) && t > e && (h = e, g = t);
1069
+ }
1070
+ i.push({
1071
+ ...n,
1072
+ id: o,
1073
+ rowIndex: e,
1074
+ parentId: n?.parentId ?? void 0,
1075
+ groupKey: n?.groupKey ?? void 0,
1076
+ recordId: n?.recordId ?? void 0,
1077
+ rawStartMs: s,
1078
+ rawEndMs: c,
1079
+ baseStartMs: l,
1080
+ baseEndMs: u,
1081
+ startMs: h,
1082
+ endMs: g,
1083
+ invalid: p,
1084
+ progress: n?.progress === null || n?.progress === void 0 ? null : w(n.progress)
1085
+ });
1086
+ }
1087
+ return i;
1088
+ }, [
1089
+ e,
1090
+ t,
1091
+ n
1092
+ ]) };
1093
+ }
1094
+ //#endregion
1095
+ //#region src/components/Gantt/GanttChart/hooks/useGanttScrollbars.tsx
1096
+ function st(e, t) {
1097
+ let [n, r] = Y(!1);
1098
+ return ce(() => {
1099
+ let n = e.current, i = t.current;
1100
+ if (!n || !i) return;
1101
+ let a = he({
1102
+ target: n,
1103
+ elements: { viewport: i }
1104
+ }, { scrollbars: {
1105
+ theme: "os-theme-bsy",
1106
+ autoHide: "leave",
1107
+ autoHideDelay: 600,
1108
+ clickScroll: !0
1109
+ } }), o = a.elements().scrollbarHorizontal.scrollbar, s = !1, c = null, l = (e) => {
1110
+ e.pointerType === "mouse" && e.button !== 0 || (s = !0, c = e.pointerId, r(!0));
1111
+ }, u = (e) => {
1112
+ if (!s) return;
1113
+ let t = e.pointerId, n = "pointerId" in e && L(t) ? t : null;
1114
+ n !== null && c !== null && n !== c || (s = !1, c = null, r(!1));
1115
+ }, d = { capture: !0 };
1116
+ return o.addEventListener("pointerdown", l, d), o.addEventListener("lostpointercapture", u, d), document.addEventListener("pointerup", u, d), document.addEventListener("pointercancel", u, d), document.addEventListener("lostpointercapture", u, d), window.addEventListener("blur", u), () => {
1117
+ o.removeEventListener("pointerdown", l, d), o.removeEventListener("lostpointercapture", u, d), document.removeEventListener("pointerup", u, d), document.removeEventListener("pointercancel", u, d), document.removeEventListener("lostpointercapture", u, d), window.removeEventListener("blur", u), a?.destroy();
1118
+ };
1119
+ }, [e, t]), n;
1120
+ }
1121
+ //#endregion
1122
+ //#region src/components/Gantt/GanttChart/utils/timelineMarkers.ts
1123
+ function ct(e, t, n, r, i) {
1124
+ return !!e && Number.isFinite(r) && Ge(i, r) && t !== null && Number.isFinite(t) && t >= 0 && t <= n;
1125
+ }
1126
+ var lt = H.memo(({ timelineWidth: e, viewportWidth: t = 0, scrollLeft: n, trackRef: r, virtualColumns: i, lowerSegments: a, todayLineLeft: o, todayCenterMs: s, showTodayLine: c, viewMode: l, availableModes: u, formatMessage: d, onViewModeChange: f, onTodayClick: p, onScrollPrev: m, onScrollNext: h }) => {
1127
+ let g = q(() => He({
1128
+ lowerSegments: a,
1129
+ viewMode: l,
1130
+ formatMessage: d
1131
+ }), [
1132
+ a,
1133
+ l,
1134
+ d
1135
+ ]), _ = q(() => {
1136
+ let r = Ae(n, t, e), i = r - 240, a = r + t + 240;
1137
+ return g.filter((e) => e.left < a && e.left + e.width > i);
1138
+ }, [
1139
+ g,
1140
+ n,
1141
+ t,
1142
+ e
1143
+ ]), v = q(() => a.length && a.find((e) => s != null && s >= e.startMs && s < e.endMs)?.id || null, [a, s]), y = a[0]?.startMs ?? 0, b = a[a.length - 1]?.endMs ?? 0, x = ct(c, o, e, s ?? NaN, {
1144
+ startMs: y,
1145
+ endMs: b
1146
+ });
1147
+ return /* @__PURE__ */ V("div", {
1148
+ className: "bsy-gantt-chart__calendar",
1149
+ children: [/* @__PURE__ */ V("div", {
1150
+ ref: r,
1151
+ className: "bsy-gantt-chart__calendar-track",
1152
+ style: { width: e },
1153
+ children: [
1154
+ i.map((e) => {
1155
+ let t = a[e.index];
1156
+ return t ? /* @__PURE__ */ B("div", {
1157
+ className: "bsy-gantt-chart__header-col-line",
1158
+ style: {
1159
+ left: t.left,
1160
+ top: 34,
1161
+ height: 34
1162
+ }
1163
+ }, `header-line-${t.id}`) : null;
1164
+ }),
1165
+ _.map((e) => /* @__PURE__ */ V(H.Fragment, { children: [/* @__PURE__ */ B("div", {
1166
+ className: "bsy-gantt-chart__header-cell bsy-gantt-chart__header-cell--top",
1167
+ style: {
1168
+ left: e.left,
1169
+ width: e.width,
1170
+ height: 34,
1171
+ "--segment-left": `${e.left}px`
1172
+ },
1173
+ children: /* @__PURE__ */ B("span", {
1174
+ className: "bsy-gantt-chart__header-cell-sticky-text",
1175
+ children: e.label
1176
+ })
1177
+ }), /* @__PURE__ */ B("div", {
1178
+ className: "bsy-gantt-chart__header-col-line",
1179
+ style: {
1180
+ left: e.left + e.width,
1181
+ top: 0,
1182
+ height: 34
1183
+ }
1184
+ })] }, `top-group-${e.id}`)),
1185
+ i.map((e) => {
1186
+ let t = a[e.index];
1187
+ return t ? /* @__PURE__ */ B("div", {
1188
+ className: X("bsy-gantt-chart__header-cell", "bsy-gantt-chart__header-cell--bottom", t.id === v && "bsy-gantt-chart__header-cell--bottom-active"),
1189
+ style: {
1190
+ left: t.left,
1191
+ width: t.width,
1192
+ height: 34,
1193
+ top: 34
1194
+ },
1195
+ children: t.label
1196
+ }, t.id) : null;
1197
+ }),
1198
+ x && /* @__PURE__ */ B("span", {
1199
+ className: "bsy-gantt-chart__today-indicator--header-dot",
1200
+ style: { left: o ?? void 0 }
1201
+ })
1202
+ ]
1203
+ }), /* @__PURE__ */ B("div", {
1204
+ className: "bsy-gantt-chart__calendar-toolbar",
1205
+ children: /* @__PURE__ */ B(F, {
1206
+ viewMode: l,
1207
+ availableModes: u,
1208
+ onViewModeChange: f,
1209
+ onTodayClick: p,
1210
+ onScrollPrev: m,
1211
+ onScrollNext: h
1212
+ })
1213
+ })]
1214
+ });
1215
+ });
1216
+ //#endregion
1217
+ //#region src/components/Gantt/GanttChart/hooks/useGanttRowVirtualScroll.ts
1218
+ function ut({ items: e, contentRef: t, safeRowHeight: n, viewportHeight: r, overscan: i = 4 }) {
1219
+ let [a, o] = Y(!1), s = pe({
1220
+ count: e.length,
1221
+ getScrollElement: () => t.current,
1222
+ estimateSize: () => n,
1223
+ overscan: i,
1224
+ onChange: (e) => {
1225
+ let t = !!e?.isScrolling;
1226
+ o((e) => e === t ? e : t);
1227
+ }
1228
+ });
1229
+ return {
1230
+ virtualRows: s.getVirtualItems(),
1231
+ canvasHeight: Math.max(s.getTotalSize(), r),
1232
+ isScrolling: a
1233
+ };
1234
+ }
1235
+ //#endregion
1236
+ //#region src/components/Gantt/GanttChart/hooks/useOffscreenIndicators.ts
1237
+ function dt({ virtualRows: e, normalizedItems: t, visibleStartMs: n, visibleEndMs: r, enabled: i = !0, excludeTaskId: a = null }) {
1238
+ return q(() => {
1239
+ if (!i || !Array.isArray(e) || !Array.isArray(t) || !Number.isFinite(n) || !Number.isFinite(r) || n >= r) return [];
1240
+ let o = [];
1241
+ return e.forEach((e) => {
1242
+ let i = t[e.index];
1243
+ if (!i || i.invalid || a !== null && i.id === a || i.type === "summary" || i.startMs === null || i.startMs === void 0 || i.endMs === null || i.endMs === void 0) return;
1244
+ let s = i.endMs <= n, c = i.startMs >= r;
1245
+ !s && !c || o.push({
1246
+ rowKey: `offscreen-${i.id}-${e.key}`,
1247
+ rowTop: e.start,
1248
+ rowHeight: e.size,
1249
+ showLeft: s,
1250
+ showRight: c,
1251
+ targetMs: i.startMs,
1252
+ taskId: i.id
1253
+ });
1254
+ }), o;
1255
+ }, [
1256
+ e,
1257
+ t,
1258
+ n,
1259
+ r,
1260
+ i,
1261
+ a
1262
+ ]);
1263
+ }
1264
+ //#endregion
1265
+ //#region src/components/Gantt/GanttChart/hooks/useRowHoverHighlight.ts
1266
+ function ft({ normalizedItems: e, safeRowHeight: t }) {
1267
+ let n = Z(d, (e) => e.setHighlightTarget), r = Z(d, (e) => e.subscribeHighlight), i = Z(d, (e) => e.getIsScrollActive), a = J(null), o = J(null), s = J(null), c = J(!1), l = q(() => {
1268
+ let t = /* @__PURE__ */ new Map(), n = 0;
1269
+ for (; n < e.length;) {
1270
+ let r = e[n]?.parentId;
1271
+ if (r) {
1272
+ let i = n;
1273
+ for (; i < e.length && e[i]?.parentId === r;) i += 1;
1274
+ for (let e = n; e < i; e += 1) t.set(e, {
1275
+ startIndex: n,
1276
+ endIndex: i - 1
1277
+ });
1278
+ n = i;
1279
+ } else t.set(n, null), n += 1;
1280
+ }
1281
+ return t;
1282
+ }, [e]), u = J(l);
1283
+ u.current = l;
1284
+ let m = G((e, n) => {
1285
+ let r = o.current;
1286
+ r && (r.style.top = `${e * t}px`, r.style.height = `${(n - e + 1) * t}px`, r.style.display = "block");
1287
+ }, [t]), h = G(() => {
1288
+ let e = o.current;
1289
+ e && (e.style.display = "none");
1290
+ }, []), g = G((t) => {
1291
+ if (!t) {
1292
+ h();
1293
+ return;
1294
+ }
1295
+ let n = t.type, r = t.id, i = -1, a = -1;
1296
+ for (let t = 0; t < e.length; t += 1) {
1297
+ let o = p(e[t]);
1298
+ o && o.type === n && o.id === r && (i === -1 && (i = t), a = t);
1299
+ }
1300
+ if (i === -1) {
1301
+ h();
1302
+ return;
1303
+ }
1304
+ m(i, a);
1305
+ }, [
1306
+ e,
1307
+ m,
1308
+ h
1309
+ ]), _ = G((r) => {
1310
+ if (i?.()) {
1311
+ a.current !== null && (a.current = null, h()), c.current = !1;
1312
+ return;
1313
+ }
1314
+ c.current = !0;
1315
+ let o = r.currentTarget, l = o.getBoundingClientRect(), d = r.clientY - l.top + o.scrollTop, g = Math.floor(d / t);
1316
+ if (g < 0 || g >= e.length) {
1317
+ a.current !== null && (a.current = null, h(), s.current !== null && (s.current = null, n?.(null)));
1318
+ return;
1319
+ }
1320
+ if (a.current !== g) {
1321
+ a.current = g;
1322
+ let t = u.current.get(g);
1323
+ m(t ? t.startIndex : g, t ? t.endIndex : g);
1324
+ let r = p(e[g]);
1325
+ f(s.current, r) || (s.current = r, n?.(r));
1326
+ }
1327
+ }, [
1328
+ t,
1329
+ e,
1330
+ n,
1331
+ m,
1332
+ h,
1333
+ i
1334
+ ]), v = G(() => {
1335
+ c.current = !1, a.current = null, h(), s.current !== null && (s.current = null, n?.(null));
1336
+ }, [n, h]);
1337
+ return K(() => {
1338
+ if (r) return r((e, t) => {
1339
+ if (t?.source === "table") {
1340
+ c.current = !1, a.current = null, s.current = e, g(e);
1341
+ return;
1342
+ }
1343
+ c.current || g(e);
1344
+ });
1345
+ }, [r, g]), {
1346
+ hoverBgRef: o,
1347
+ handleContentMouseMove: _,
1348
+ handleContentMouseLeave: v
1349
+ };
1350
+ }
1351
+ //#endregion
1352
+ //#region src/components/Gantt/GanttChart/GanttInteractionContext.ts
1353
+ var pt = de({
1354
+ tooltip: null,
1355
+ isScrolling: !1,
1356
+ collapsedKeys: void 0,
1357
+ onBarClick: () => {},
1358
+ onTaskMouseDown: () => {},
1359
+ onResizeMouseDown: () => {}
1360
+ }), mt = (e) => Z(pt, e), ht = de({
1361
+ viewMode: "day",
1362
+ pixelsPerDay: 1,
1363
+ timelineStartMs: 0,
1364
+ timelineEndMs: 0,
1365
+ visibleStartMs: 0,
1366
+ visibleEndMs: 0,
1367
+ timelineCoords: {
1368
+ toX: () => 0,
1369
+ toWidth: () => 0,
1370
+ timeAtX: () => 0
1371
+ },
1372
+ scrollLeft: 0,
1373
+ viewportWidth: 0,
1374
+ timelineWidth: 0,
1375
+ isInitialLayoutReady: !1
1376
+ }), $ = (e) => Z(ht, e), gt = (e, t) => {
1377
+ let n = e.replace("#", ""), r = n.length === 3 ? n.split("").map((e) => e + e).join("") : n;
1378
+ return `rgba(${parseInt(r.slice(0, 2), 16)}, ${parseInt(r.slice(2, 4), 16)}, ${parseInt(r.slice(4, 6), 16)}, ${t})`;
1379
+ }, _t = (e, t) => {
1380
+ if (!R(e)) return null;
1381
+ let n = e.trim();
1382
+ return i.test(n) ? gt(n, t) : null;
1383
+ }, vt = (e, t = 2.5) => {
1384
+ if (!e || !R(e)) return "#121211";
1385
+ let n, r, i;
1386
+ if (e.startsWith("#")) {
1387
+ let t = e.replace("#", ""), a = t.length === 3 ? [...t].map((e) => e + e) : [
1388
+ t.slice(0, 2),
1389
+ t.slice(2, 4),
1390
+ t.slice(4, 6)
1391
+ ];
1392
+ [n, r, i] = a.map((e) => parseInt(e, 16));
1393
+ } else {
1394
+ let t = (e.match(/\d+/g) || []).map(Number);
1395
+ if ([n, r, i] = t.slice(0, 3), n === void 0 || Number.isNaN(n)) return "#121211";
1396
+ }
1397
+ let a = (e) => {
1398
+ let t = e / 255;
1399
+ return t <= .04045 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
1400
+ };
1401
+ return 1.05 / (.2126 * a(n) + .7152 * a(r) + .0722 * a(i) + .05) >= t ? "#ffffff" : "#121211";
1402
+ }, yt, bt = () => {
1403
+ if (yt !== void 0) return yt;
1404
+ try {
1405
+ yt = document.createElement("canvas").getContext("2d");
1406
+ } catch {
1407
+ yt = null;
1408
+ }
1409
+ return yt;
1410
+ }, xt = (e, t = "12px -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, PingFang SC, Noto Sans, Noto Sans CJK SC, Microsoft YaHei, \"微软雅黑\", sans-serif") => {
1411
+ if (!e) return 0;
1412
+ let n = String(e), r = bt();
1413
+ return r ? (r.font = t, r.measureText(n).width + 20) : n.length * 12 + 20;
1414
+ };
1415
+ //#endregion
1416
+ //#region src/components/Gantt/GanttChart/hooks/useBarTooltipHover.ts
1417
+ function St() {
1418
+ let [e, t] = Y(null), n = J("idle"), r = G((e) => {
1419
+ n.current === "frozen" && (n.current = "open");
1420
+ let r = e.currentTarget.getBoundingClientRect();
1421
+ t({
1422
+ x: e.clientX,
1423
+ y: r.y,
1424
+ top: r.top,
1425
+ bottom: r.bottom,
1426
+ height: r.height
1427
+ });
1428
+ }, []), i = G(() => {
1429
+ n.current === "open" ? n.current = "frozen" : t(null);
1430
+ }, []), a = G((e) => {
1431
+ n.current = e ? "open" : "idle", e || t(null);
1432
+ }, []);
1433
+ return {
1434
+ virtualReference: q(() => {
1435
+ if (e) return { getBoundingClientRect: () => ({
1436
+ width: 0,
1437
+ height: e.height,
1438
+ x: e.x,
1439
+ y: e.y,
1440
+ top: e.top,
1441
+ bottom: e.bottom,
1442
+ left: e.x,
1443
+ right: e.x,
1444
+ toJSON: () => ({})
1445
+ }) };
1446
+ }, [e]),
1447
+ handleMouseMove: r,
1448
+ handleMouseLeave: i,
1449
+ handleTooltipVisibleChange: a
1450
+ };
1451
+ }
1452
+ //#endregion
1453
+ //#region src/components/Gantt/GanttChart/GanttBarTooltip/GanttBarTooltip.tsx
1454
+ var Ct = {
1455
+ borderRadius: "10px",
1456
+ padding: 0,
1457
+ backgroundColor: "#fff",
1458
+ boxShadow: "0 0 12px 0 rgba(0, 0, 0, 0.08)"
1459
+ }, wt = ({ item: e, tooltip: t, disabled: r = !1, children: i }) => {
1460
+ let { virtualReference: a, handleMouseMove: o, handleMouseLeave: s, handleTooltipVisibleChange: c } = St(), l = q(() => r || !t ? null : t(e), [
1461
+ r,
1462
+ t,
1463
+ e
1464
+ ]);
1465
+ return l ? /* @__PURE__ */ B(n, {
1466
+ content: l,
1467
+ placement: "bottom",
1468
+ showArrow: !1,
1469
+ hoverDelay: 300,
1470
+ moveToFloatingKeepOpen: !0,
1471
+ widthMode: "manual",
1472
+ maxWidth: 400,
1473
+ offset: 5,
1474
+ zIndex: 8001,
1475
+ virtualReference: a,
1476
+ onVisibleChange: c,
1477
+ style: Ct,
1478
+ children: i({
1479
+ onMouseMove: o,
1480
+ onMouseLeave: s
1481
+ })
1482
+ }) : /* @__PURE__ */ B(z, { children: i({
1483
+ onMouseMove: () => {},
1484
+ onMouseLeave: () => {}
1485
+ }) });
1486
+ }, Tt = (e, t, n) => ({
1487
+ ...e,
1488
+ clientX: t,
1489
+ clientY: n,
1490
+ preventDefault: () => e.preventDefault(),
1491
+ stopPropagation: () => e.stopPropagation()
1492
+ });
1493
+ function Et({ enabled: e, onTaskMouseDown: t, onBarClick: n }) {
1494
+ let r = J(null), i = J(null), a = J(t), o = J(n);
1495
+ K(() => {
1496
+ a.current = t, o.current = n;
1497
+ }, [t, n]);
1498
+ let s = G(() => {
1499
+ r.current = null;
1500
+ let e = i.current;
1501
+ e && (document.removeEventListener("mousemove", e.move), document.removeEventListener("mouseup", e.up), i.current = null);
1502
+ }, []);
1503
+ return K(() => () => s(), [s]), { handlePointerMouseDown: G((t, n, c, l = 1) => {
1504
+ if (!e) return;
1505
+ s();
1506
+ let u = {
1507
+ item: n,
1508
+ baseLeft: c,
1509
+ width: l,
1510
+ startClientX: t.clientX,
1511
+ startClientY: t.clientY,
1512
+ dragStarted: !1
1513
+ };
1514
+ r.current = u;
1515
+ let d = (e) => {
1516
+ if (r.current !== u || u.dragStarted) return;
1517
+ let t = e.clientX - u.startClientX, i = e.clientY - u.startClientY;
1518
+ Math.hypot(t, i) < 5 || (u.dragStarted = !0, s(), a.current?.(Tt(e, u.startClientX, u.startClientY), n, c, u.width));
1519
+ }, f = (e) => {
1520
+ r.current === u && (s(), u.dragStarted || o.current?.(e, n));
1521
+ };
1522
+ i.current = {
1523
+ move: d,
1524
+ up: f
1525
+ }, document.addEventListener("mousemove", d), document.addEventListener("mouseup", f);
1526
+ }, [e, s]) };
1527
+ }
1528
+ var Dt = H.memo(({ item: e, barTop: n, dragTaskId: r, dragPreview: i, dragPermission: a }) => {
1529
+ let { t: o } = t(), s = $((e) => e.viewMode), c = $((e) => e.timelineCoords), l = $((e) => e.timelineStartMs), u = $((e) => e.timelineEndMs), d = $((e) => e.timelineWidth), f = mt((e) => e.tooltip), p = mt((e) => e.isScrolling), m = mt((e) => e.onBarClick), h = mt((e) => e.onTaskMouseDown), g = mt((e) => e.onResizeMouseDown), _ = p ? null : f, v = r === e.id, y = v && i ? i.previewStartMs : e.startMs, b = v && i ? i.previewEndMs : e.endMs, S = q(() => {
1530
+ let t = e.color;
1531
+ return {
1532
+ baseColor: t,
1533
+ containerBgColor: _t(t, .2) || t,
1534
+ hoverBorderColor: _t(t, .5) || "transparent",
1535
+ insideLabelColor: vt(t)
1536
+ };
1537
+ }, [e.color]), C = q(() => {
1538
+ if (y == null || b == null || y >= b || l >= u) return null;
1539
+ let e = qe({
1540
+ startMs: y,
1541
+ endMs: b
1542
+ }, {
1543
+ startMs: l,
1544
+ endMs: u
1545
+ });
1546
+ if (!e) return null;
1547
+ let t = c.toX(e.startMs), n = c.toWidth(e.startMs, e.endMs), r = t + n, a = e.startMs !== y, o = e.endMs !== b, s = v && i && Number.isFinite(i.previewLeftPx), f = s && !a ? i.previewLeftPx : t, p = s && !o ? f + n : r, m = Math.max(0, f), h = Math.min(d, p);
1548
+ return m >= h ? null : {
1549
+ clippedRange: e,
1550
+ rawBarLeft: f,
1551
+ calculatedBarLeft: m,
1552
+ calculatedBarWidth: h - m,
1553
+ clippedStart: a || m !== f,
1554
+ clippedEnd: o || h !== p
1555
+ };
1556
+ }, [
1557
+ y,
1558
+ b,
1559
+ l,
1560
+ u,
1561
+ d,
1562
+ c,
1563
+ v,
1564
+ i
1565
+ ]), { baseColor: w, containerBgColor: T, hoverBorderColor: ee, insideLabelColor: E } = S, D = C?.calculatedBarWidth ?? 0, O = e.progress === null, k = !C || y === null || b === null ? 0 : Math.max(0, Math.min(1, (C.rawBarLeft + c.toWidth(C.clippedRange.startMs, Math.min(C.clippedRange.endMs, Math.max(C.clippedRange.startMs, y + (b - y) * Math.max(0, e.progress ?? 0)))) - C.calculatedBarLeft) / C.calculatedBarWidth)), A = O || k >= 1, j = A ? "100%" : `${k * 100}%`, M = a || _e, N = M.canMove, te = e.label ?? "", ne = typeof te == "string" ? te : "", re = D < 40, ie = Math.max(0, D - 10), ae = q(() => ne ? xt(ne) : 0, [ne]), P = !!ne && ae > ie && !!C && C.calculatedBarLeft + C.calculatedBarWidth + 4 + ae <= d, { handlePointerMouseDown: oe } = Et({
1566
+ enabled: N,
1567
+ onTaskMouseDown: h,
1568
+ onBarClick: m
1569
+ });
1570
+ if (!C) return null;
1571
+ let { calculatedBarLeft: F, clippedStart: I, clippedEnd: L } = C, R = F + D, H = F + Math.max(40, D + 12) <= d, U = y !== null && b !== null ? s === "quarterMonth" ? x(y, b) : c.toWidth(y, b) : D, W = U < 40 ? Math.max(40, U + 12) : U, G = R + 4 <= d, K = {
1572
+ left: F,
1573
+ top: n,
1574
+ width: `var(--bsy-gantt-bar-actual-width, ${D}px)`,
1575
+ height: 26,
1576
+ background: T,
1577
+ cursor: N ? "move" : "default",
1578
+ "--bsy-gantt-bar-fill-color": w,
1579
+ "--bsy-gantt-bar-hover-border-color": ee,
1580
+ "--bsy-gantt-bar-calc-width": `${D}px`,
1581
+ "--bsy-gantt-bar-label-color": E
1582
+ };
1583
+ return /* @__PURE__ */ B(wt, {
1584
+ item: e,
1585
+ tooltip: _,
1586
+ disabled: v,
1587
+ children: ({ onMouseMove: t, onMouseLeave: n }) => /* @__PURE__ */ V("div", {
1588
+ className: X("bsy-gantt-chart__bar", `bsy-gantt-chart__bar--${e.type || "task"}`, {
1589
+ "bsy-gantt-chart__bar--readonly": !N,
1590
+ "bsy-gantt-chart__bar--dragging": v,
1591
+ "bsy-gantt-chart__bar--micro": re && H
1592
+ }),
1593
+ style: K,
1594
+ onMouseDown: (t) => {
1595
+ N && oe(t, e, F, W);
1596
+ },
1597
+ onClick: (t) => {
1598
+ N || m(t, e);
1599
+ },
1600
+ onMouseMove: t,
1601
+ onMouseLeave: n,
1602
+ children: [
1603
+ e.type === "task" ? /* @__PURE__ */ B("div", {
1604
+ className: X("bsy-gantt-chart__bar-progress", { "bsy-gantt-chart__bar-progress--full": A }),
1605
+ style: { width: j }
1606
+ }) : null,
1607
+ /* @__PURE__ */ B("span", {
1608
+ className: X("bsy-gantt-chart__bar-label", { "bsy-gantt-chart__bar-label--hidden": P }),
1609
+ style: { color: "var(--bsy-gantt-bar-label-color)" },
1610
+ children: te
1611
+ }),
1612
+ P ? /* @__PURE__ */ B("span", {
1613
+ className: "bsy-gantt-chart__bar-label bsy-gantt-chart__bar-label--outside",
1614
+ style: { color: "#121211" },
1615
+ children: te
1616
+ }) : null,
1617
+ M.canResizeStart && !I || M.canResizeEnd && !L && G ? /* @__PURE__ */ V(z, { children: [M.canResizeStart && !I ? /* @__PURE__ */ B("button", {
1618
+ type: "button",
1619
+ className: "bsy-gantt-chart__bar-resize-handle bsy-gantt-chart__bar-resize-handle--left",
1620
+ onMouseDown: (t) => g(t, e, F, "start", D),
1621
+ "aria-label": o("gantt.timeBegin")
1622
+ }) : null, M.canResizeEnd && !L && G ? /* @__PURE__ */ B("button", {
1623
+ type: "button",
1624
+ className: "bsy-gantt-chart__bar-resize-handle bsy-gantt-chart__bar-resize-handle--right",
1625
+ onMouseDown: (t) => g(t, e, F, "end", D),
1626
+ "aria-label": o("gantt.timeEnd")
1627
+ }) : null] }) : null
1628
+ ]
1629
+ }, `bar-${e.id}`)
1630
+ });
1631
+ }, (e, t) => {
1632
+ if (e.barTop !== t.barTop || e.dragTaskId !== t.dragTaskId || e.dragPermission?.canMove !== t.dragPermission?.canMove || e.dragPermission?.canResizeStart !== t.dragPermission?.canResizeStart || e.dragPermission?.canResizeEnd !== t.dragPermission?.canResizeEnd || e.item !== t.item) return !1;
1633
+ let n = e.dragPreview, r = t.dragPreview;
1634
+ return !(n !== r && (!n || !r || n.previewStartMs !== r.previewStartMs || n.previewEndMs !== r.previewEndMs || n.previewLeftPx !== r.previewLeftPx));
1635
+ }), Ot = (e) => String(e).padStart(2, "0");
1636
+ function kt(e, t) {
1637
+ if (e == null) return t("summary.empty");
1638
+ let n = C(e);
1639
+ return t("summary.datetime", {
1640
+ year: n.year(),
1641
+ month: Ot(n.month() + 1),
1642
+ day: Ot(n.date()),
1643
+ hour: Ot(n.hour()),
1644
+ minute: Ot(n.minute()),
1645
+ second: Ot(n.second())
1646
+ });
1647
+ }
1648
+ function At(e, t) {
1649
+ let n = L(e?.progress), r = n ? Math.max(0, Math.min(1, e.progress ?? 0)) : 0, i = kt(e?.rawStartMs, t), a = kt(e?.rawEndMs, t);
1650
+ return /* @__PURE__ */ V("div", {
1651
+ className: "bsy-gantt-summary-tooltip",
1652
+ children: [
1653
+ /* @__PURE__ */ B("p", {
1654
+ className: "bsy-gantt-summary-tooltip__line",
1655
+ children: t("summary.startTime", { datetime: i })
1656
+ }),
1657
+ /* @__PURE__ */ B("p", {
1658
+ className: "bsy-gantt-summary-tooltip__line",
1659
+ children: t("summary.endTime", { datetime: a })
1660
+ }),
1661
+ n ? /* @__PURE__ */ B("p", {
1662
+ className: "bsy-gantt-summary-tooltip__line",
1663
+ children: t("summary.progress", { percent: Math.round(r * 100) })
1664
+ }) : null
1665
+ ]
1666
+ });
1667
+ }
1668
+ //#endregion
1669
+ //#region src/components/Gantt/GanttChart/GanttSummaryBar/GanttSummaryBar.tsx
1670
+ var jt = 24, Mt = {
1671
+ borderRadius: "6px",
1672
+ padding: 0,
1673
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
1674
+ boxShadow: "none"
1675
+ };
1676
+ function Nt(e, t) {
1677
+ return e == null || e === "__empty__" ? t : e;
1678
+ }
1679
+ var Pt = ({ item: r, barTop: i }) => {
1680
+ let { t: a } = t(), o = G((e, t) => a(oe(e), t), [a]), s = $((e) => e.timelineCoords), c = $((e) => e.timelineStartMs), l = $((e) => e.timelineEndMs), u = $((e) => e.timelineWidth), d = mt((e) => e.collapsedKeys), f = mt((e) => e.onBarClick), { virtualReference: p, handleMouseMove: m, handleMouseLeave: h, handleTooltipVisibleChange: g } = St(), _ = L(r.progress) ? Math.max(0, Math.min(1, r.progress ?? 0)) : 0, v = q(() => At({
1681
+ rawStartMs: r.rawStartMs,
1682
+ rawEndMs: r.rawEndMs,
1683
+ progress: r.progress
1684
+ }, o), [
1685
+ r.rawStartMs,
1686
+ r.rawEndMs,
1687
+ r.progress,
1688
+ o
1689
+ ]), y = q(() => {
1690
+ if (r.startMs === null || r.endMs === null || r.startMs >= r.endMs || c >= l) return null;
1691
+ let e = qe({
1692
+ startMs: r.startMs,
1693
+ endMs: r.endMs
1694
+ }, {
1695
+ startMs: c,
1696
+ endMs: l
1697
+ });
1698
+ return e ? {
1699
+ barLeft: s.toX(e.startMs),
1700
+ barWidth: s.toWidth(e.startMs, e.endMs),
1701
+ wrapperTop: i + (26 - jt) / 2,
1702
+ clippedEnd: e.endMs !== r.endMs,
1703
+ clippedRange: e,
1704
+ itemStartMs: r.startMs,
1705
+ itemEndMs: r.endMs
1706
+ } : null;
1707
+ }, [
1708
+ r.startMs,
1709
+ r.endMs,
1710
+ c,
1711
+ l,
1712
+ s,
1713
+ i
1714
+ ]);
1715
+ if (!y) return null;
1716
+ let { barLeft: b, barWidth: x, wrapperTop: S, clippedEnd: C, clippedRange: w, itemStartMs: T, itemEndMs: ee } = y, E = T + (ee - T) * _, D = Math.min(w.endMs, Math.max(w.startMs, E)), O = s.toWidth(w.startMs, D), k = `${Math.max(0, Math.min(1, O / x)) * 100}%`, A = Math.max(0, u - b), j = Nt(r.label, a("gantt.emptyGroup")), M = ne(d, r.groupKey);
1717
+ return /* @__PURE__ */ B(n, {
1718
+ content: v,
1719
+ placement: "bottom-start",
1720
+ showArrow: !1,
1721
+ hoverDelay: 300,
1722
+ moveToFloatingKeepOpen: !1,
1723
+ widthMode: "content",
1724
+ offset: 5,
1725
+ zIndex: 8001,
1726
+ virtualReference: p,
1727
+ onVisibleChange: g,
1728
+ style: Mt,
1729
+ children: /* @__PURE__ */ V("div", {
1730
+ className: "bsy-gantt-summary-bar",
1731
+ style: {
1732
+ left: b,
1733
+ top: S,
1734
+ width: x,
1735
+ overflow: C ? "hidden" : void 0
1736
+ },
1737
+ onClick: (e) => f?.(e, r),
1738
+ onMouseMove: m,
1739
+ onMouseLeave: h,
1740
+ children: [/* @__PURE__ */ V("div", {
1741
+ className: "bsy-gantt-summary-bar__label",
1742
+ style: {
1743
+ maxWidth: A,
1744
+ overflow: "hidden"
1745
+ },
1746
+ children: [/* @__PURE__ */ B(e, {
1747
+ name: "xiangxiazhankai1",
1748
+ size: 16,
1749
+ className: X("bsy-gantt-summary-bar__arrow", { "bsy-gantt-summary-bar__arrow--collapsed": M })
1750
+ }), /* @__PURE__ */ B("span", {
1751
+ className: "bsy-gantt-summary-bar__label-text",
1752
+ children: j
1753
+ })]
1754
+ }), /* @__PURE__ */ B("div", {
1755
+ className: "bsy-gantt-summary-bar__track",
1756
+ children: /* @__PURE__ */ B("div", {
1757
+ className: "bsy-gantt-summary-bar__progress",
1758
+ style: { width: k }
1759
+ })
1760
+ })]
1761
+ })
1762
+ });
1763
+ };
1764
+ function Ft(e, t) {
1765
+ return e.barTop === t.barTop && e.item === t.item;
1766
+ }
1767
+ var It = H.memo(Pt, Ft), Lt = H.memo(({ indicators: n = [], onJump: r }) => {
1768
+ let { t: i } = t();
1769
+ if (!Array.isArray(n) || n.length === 0) return null;
1770
+ let a = (e, t) => {
1771
+ e.preventDefault(), e.stopPropagation(), r?.({
1772
+ targetMs: t.targetMs,
1773
+ taskId: t.taskId
1774
+ });
1775
+ };
1776
+ return /* @__PURE__ */ B(z, { children: n.map((t) => /* @__PURE__ */ B("div", {
1777
+ className: "bsy-gantt-chart__offscreen-row",
1778
+ style: {
1779
+ top: t.rowTop,
1780
+ height: t.rowHeight
1781
+ },
1782
+ children: /* @__PURE__ */ V("div", {
1783
+ className: "bsy-gantt-chart__offscreen-track",
1784
+ children: [t.showLeft ? /* @__PURE__ */ B("button", {
1785
+ type: "button",
1786
+ className: "bsy-gantt-chart__offscreen-btn bsy-gantt-chart__offscreen-btn--left",
1787
+ "aria-label": i("gantt.aria.jumpLeft"),
1788
+ onClick: (e) => a(e, t),
1789
+ children: /* @__PURE__ */ B(e, {
1790
+ name: "left",
1791
+ size: 16
1792
+ })
1793
+ }) : null, t.showRight ? /* @__PURE__ */ B("button", {
1794
+ type: "button",
1795
+ className: "bsy-gantt-chart__offscreen-btn bsy-gantt-chart__offscreen-btn--right",
1796
+ "aria-label": i("gantt.aria.jumpRight"),
1797
+ onClick: (e) => a(e, t),
1798
+ children: /* @__PURE__ */ B(e, {
1799
+ name: "arrow-right",
1800
+ size: 16
1801
+ })
1802
+ }) : null]
1803
+ })
1804
+ }, t.rowKey)) });
1805
+ }), Rt = ({ left: e, height: t, className: n = "" }) => /* @__PURE__ */ B("div", {
1806
+ className: X("bsy-gantt-chart__today-indicator", n),
1807
+ style: {
1808
+ left: e,
1809
+ height: t
1810
+ },
1811
+ children: /* @__PURE__ */ B("span", { className: "bsy-gantt-chart__today-indicator-line" })
1812
+ }), zt = W(function({ canvasHeight: e, weekendSegments: t, virtualColumns: n, lowerSegments: r, shouldShowTodayMarker: i, todayLineLeft: a }) {
1813
+ return /* @__PURE__ */ V(z, { children: [
1814
+ t.map((t) => /* @__PURE__ */ B("div", {
1815
+ className: "bsy-gantt-chart__weekend-bg",
1816
+ style: {
1817
+ left: t.left,
1818
+ width: t.width,
1819
+ height: e
1820
+ }
1821
+ }, t.id)),
1822
+ n.map((t) => {
1823
+ let n = r[t.index];
1824
+ return n ? /* @__PURE__ */ B("div", {
1825
+ className: "bsy-gantt-chart__col-line",
1826
+ style: {
1827
+ left: n.left,
1828
+ height: e
1829
+ }
1830
+ }, `line-${n.id}`) : null;
1831
+ }),
1832
+ i ? /* @__PURE__ */ B(Rt, {
1833
+ left: a ?? 0,
1834
+ height: e,
1835
+ className: "bsy-gantt-chart__today-indicator--content-line"
1836
+ }) : null
1837
+ ] });
1838
+ }), Bt = ({ virtualRows: e, normalizedItems: t, dragState: n, dragPermissionById: r, timelineStartMs: i, timelineEndMs: a }) => {
1839
+ let o = n?.taskId ?? null;
1840
+ return e.map((e) => {
1841
+ let s = t[e.index];
1842
+ if (!s || s.invalid) return null;
1843
+ let c = o === s.id;
1844
+ if (!c && (s.startMs === null || s.endMs === null || s.startMs >= s.endMs || !Ke({
1845
+ startMs: s.startMs,
1846
+ endMs: s.endMs
1847
+ }, {
1848
+ startMs: i,
1849
+ endMs: a
1850
+ }))) return null;
1851
+ let l = e.start + (e.size - 26) / 2;
1852
+ return s.type === "summary" ? /* @__PURE__ */ B(It, {
1853
+ item: s,
1854
+ barTop: l
1855
+ }, `summary-${s.id}`) : /* @__PURE__ */ B(Dt, {
1856
+ item: s,
1857
+ barTop: l,
1858
+ dragTaskId: o,
1859
+ dragPreview: c ? n : null,
1860
+ dragPermission: r[s.id]
1861
+ }, `bar-${s.id}`);
1862
+ });
1863
+ }, Vt = W(function({ virtualRows: e, normalizedItems: t, dragState: n, dragPermissionById: r, handleOffscreenJump: i, hoverBgRef: a }) {
1864
+ let o = $((e) => e.timelineStartMs), s = $((e) => e.timelineEndMs), c = $((e) => e.visibleStartMs), l = $((e) => e.visibleEndMs), u = $((e) => e.isInitialLayoutReady), d = dt({
1865
+ virtualRows: e,
1866
+ normalizedItems: t,
1867
+ visibleStartMs: c,
1868
+ visibleEndMs: l,
1869
+ enabled: u,
1870
+ excludeTaskId: n?.taskId ?? null
1871
+ });
1872
+ return /* @__PURE__ */ V(z, { children: [
1873
+ e.map((e) => /* @__PURE__ */ B("div", {
1874
+ className: "bsy-gantt-chart__row-line",
1875
+ style: {
1876
+ top: e.start,
1877
+ height: e.size
1878
+ }
1879
+ }, `row-line-${e.key}`)),
1880
+ /* @__PURE__ */ B("div", {
1881
+ ref: a,
1882
+ className: "bsy-gantt-chart__row-hover-bg",
1883
+ style: { display: "none" }
1884
+ }),
1885
+ u && Bt({
1886
+ virtualRows: e,
1887
+ normalizedItems: t,
1888
+ dragState: n,
1889
+ dragPermissionById: r,
1890
+ timelineStartMs: o,
1891
+ timelineEndMs: s
1892
+ }),
1893
+ u ? /* @__PURE__ */ B(Lt, {
1894
+ indicators: d,
1895
+ onJump: i
1896
+ }) : null
1897
+ ] });
1898
+ }), Ht = W(function({ contentRef: e, normalizedItems: t, safeRowHeight: n, viewportHeight: r, lowerSegments: i, virtualColumns: a, weekendSegments: o, dragState: s, dragPermissionById: c, tooltip: l, handleTaskMouseDown: u, handleResizeMouseDown: d, handleBarClick: f, collapsedKeys: p, handleOffscreenJump: m, todayLineLeft: h, shouldShowTodayMarker: g }) {
1899
+ let _ = $((e) => e.timelineWidth), { virtualRows: v, canvasHeight: y, isScrolling: b } = ut({
1900
+ items: t,
1901
+ contentRef: e,
1902
+ safeRowHeight: n,
1903
+ viewportHeight: r
1904
+ }), { hoverBgRef: x, handleContentMouseMove: S, handleContentMouseLeave: C } = ft({
1905
+ normalizedItems: t,
1906
+ safeRowHeight: n
1907
+ }), w = q(() => ({
1908
+ width: _,
1909
+ height: y
1910
+ }), [_, y]), T = q(() => ({
1911
+ tooltip: l ?? null,
1912
+ isScrolling: b,
1913
+ collapsedKeys: p,
1914
+ onBarClick: f,
1915
+ onTaskMouseDown: u,
1916
+ onResizeMouseDown: d
1917
+ }), [
1918
+ l,
1919
+ b,
1920
+ p,
1921
+ f,
1922
+ u,
1923
+ d
1924
+ ]);
1925
+ return /* @__PURE__ */ V("div", {
1926
+ className: "bsy-gantt-chart__canvas",
1927
+ style: w,
1928
+ onMouseMove: S,
1929
+ onMouseLeave: C,
1930
+ children: [/* @__PURE__ */ B(zt, {
1931
+ canvasHeight: y,
1932
+ weekendSegments: o,
1933
+ virtualColumns: a,
1934
+ lowerSegments: i,
1935
+ shouldShowTodayMarker: g,
1936
+ todayLineLeft: h
1937
+ }), /* @__PURE__ */ B(pt.Provider, {
1938
+ value: T,
1939
+ children: /* @__PURE__ */ B(Vt, {
1940
+ virtualRows: v,
1941
+ normalizedItems: t,
1942
+ dragState: s,
1943
+ dragPermissionById: c,
1944
+ handleOffscreenJump: m,
1945
+ hoverBgRef: x
1946
+ })
1947
+ })]
1948
+ });
1949
+ });
1950
+ //#endregion
1951
+ //#region src/components/Gantt/GanttChart/GanttChart.tsx
1952
+ function Ut({ items: e = [], viewMode: n = "day", availableModes: r, onViewModeChange: i, timeRangeConfig: a = u, pixelsPerDayConfig: o = c, onTaskTimeChange: s, onRowClick: l, tooltip: d, verticalScrollController: f, showWeekendHighlight: p = !0, showTodayLine: m = !0, collapsedKeys: h, onToggleCollapse: g }, _) {
1953
+ let { t: v } = t(), y = G((e, t) => v(oe(e), t), [v]), b = J(null), x = J(null), S = J(null), C = ue(x), w = J(null), T = st(b, x), [ee, E] = Y(!1), { pixelsPerDay: D, viewportWidth: O, scrollLeft: k, timelineStartMs: A, timelineEndMs: j, visibleStartMs: M, visibleEndMs: N, lowerSegments: te, timelineCoords: ne, timelineWidth: re, todayCenterMs: ie, todayLineLeft: ae, isInitialLayoutReady: P, handleContentScroll: F, handleTodayClick: I, handleOffscreenJump: L, handleScrollPrev: R, handleScrollNext: z } = at({
1954
+ timeRangeConfig: a,
1955
+ pixelsPerDayConfig: o,
1956
+ viewMode: n,
1957
+ contentRef: x,
1958
+ contentSize: C,
1959
+ headerTrackRef: S,
1960
+ formatMessage: y,
1961
+ isHorizontalScrollbarInteracting: T,
1962
+ isTaskBarInteracting: ee
1963
+ });
1964
+ se(_, () => ({
1965
+ scrollToToday: I,
1966
+ scrollPrev: R,
1967
+ scrollNext: z
1968
+ }), [
1969
+ I,
1970
+ R,
1971
+ z
1972
+ ]);
1973
+ let { dragState: H, committedRangeById: U, resetCommittedRanges: W, forceResetAllCommittedRanges: ce, handleTaskMouseDown: X, handleResizeMouseDown: le, consumeRecentDragResult: de } = ke({
1974
+ pixelsPerDay: D,
1975
+ viewMode: n,
1976
+ timelineCoords: ne,
1977
+ onTaskTimeChange: s,
1978
+ containerRef: x,
1979
+ onDragInteractionChange: E
1980
+ });
1981
+ K(() => {
1982
+ let t = new Set((e || []).map((e) => String(e?.id ?? ""))), n = w.current, r = !1;
1983
+ if (n) {
1984
+ if (n.size !== t.size) r = !0;
1985
+ else for (let e of n) if (!t.has(e)) {
1986
+ r = !0;
1987
+ break;
1988
+ }
1989
+ }
1990
+ if (w.current = t, r) {
1991
+ ce();
1992
+ return;
1993
+ }
1994
+ W();
1995
+ }, [
1996
+ e,
1997
+ W,
1998
+ ce
1999
+ ]);
2000
+ let { normalizedItems: Z } = ot({
2001
+ visibleItems: e,
2002
+ committedRangeById: U,
2003
+ viewMode: n
2004
+ }), Q = q(() => {
2005
+ let e = {};
2006
+ return Z.forEach((t) => {
2007
+ e[t.id] = ve(t);
2008
+ }), e;
2009
+ }, [Z]), fe = G((e, t, n, r) => {
2010
+ let i = Q[t.id];
2011
+ i?.canMove && X(e, {
2012
+ ...t,
2013
+ dragPermission: i
2014
+ }, n, r);
2015
+ }, [Q, X]), pe = G((e, t, n, r, i) => {
2016
+ let a = Q[t.id];
2017
+ (r === "start" ? a?.canResizeStart : a?.canResizeEnd) && le(e, {
2018
+ ...t,
2019
+ dragPermission: a
2020
+ }, n, r, i);
2021
+ }, [Q, le]);
2022
+ K(() => {
2023
+ if (!f || !x.current) return;
2024
+ let e = x.current;
2025
+ return f.registerTimelineScroller({ setScrollTop: (t) => {
2026
+ e.scrollTop = t;
2027
+ } });
2028
+ }, [f]);
2029
+ let me = C?.height || 0, { virtualColumns: he, weekendSegments: ge } = Pe({
2030
+ lowerSegments: te,
2031
+ pixelsPerDay: D,
2032
+ scrollLeft: k,
2033
+ viewportWidth: O,
2034
+ showWeekendHighlight: p,
2035
+ timelineStartMs: A,
2036
+ timelineWidth: re,
2037
+ viewMode: n
2038
+ }), _e = ct(m, ae, re, ie, {
2039
+ startMs: A,
2040
+ endMs: j
2041
+ }), ye = G((e, t) => {
2042
+ if (!(e.target instanceof Element && e.target.closest(".bsy-gantt-chart__bar-resize-handle")) && !de()) {
2043
+ if (t?.type === "summary") {
2044
+ let e = t.groupKey;
2045
+ if (!e || !g) return;
2046
+ g(String(e));
2047
+ return;
2048
+ }
2049
+ l && l(t, t.rowIndex, e);
2050
+ }
2051
+ }, [
2052
+ de,
2053
+ l,
2054
+ g
2055
+ ]), be = q(() => ({
2056
+ viewMode: n,
2057
+ pixelsPerDay: D,
2058
+ timelineStartMs: A,
2059
+ timelineEndMs: j,
2060
+ visibleStartMs: M,
2061
+ visibleEndMs: N,
2062
+ timelineCoords: ne,
2063
+ scrollLeft: k,
2064
+ viewportWidth: O,
2065
+ timelineWidth: re,
2066
+ isInitialLayoutReady: P
2067
+ }), [
2068
+ n,
2069
+ D,
2070
+ A,
2071
+ j,
2072
+ M,
2073
+ N,
2074
+ ne,
2075
+ k,
2076
+ O,
2077
+ re,
2078
+ P
2079
+ ]);
2080
+ return /* @__PURE__ */ B(ht.Provider, {
2081
+ value: be,
2082
+ children: /* @__PURE__ */ V("div", {
2083
+ className: "bsy-gantt-chart",
2084
+ style: { visibility: P ? "visible" : "hidden" },
2085
+ children: [/* @__PURE__ */ B(lt, {
2086
+ timelineWidth: re,
2087
+ viewportWidth: O,
2088
+ scrollLeft: k,
2089
+ trackRef: S,
2090
+ virtualColumns: he,
2091
+ lowerSegments: te,
2092
+ todayLineLeft: ae,
2093
+ todayCenterMs: ie,
2094
+ showTodayLine: m,
2095
+ viewMode: n,
2096
+ availableModes: r,
2097
+ formatMessage: y,
2098
+ onViewModeChange: i,
2099
+ onTodayClick: I,
2100
+ onScrollPrev: R,
2101
+ onScrollNext: z
2102
+ }), /* @__PURE__ */ B("div", {
2103
+ ref: b,
2104
+ className: "bsy-gantt-chart__timeline-host",
2105
+ children: /* @__PURE__ */ B("div", {
2106
+ ref: x,
2107
+ className: "bsy-gantt-chart__timeline-content",
2108
+ role: "region",
2109
+ "aria-label": v("gantt.aria.timeline"),
2110
+ onScroll: (e) => {
2111
+ F(e), f && f.sync("timeline", e.currentTarget.scrollTop);
2112
+ },
2113
+ children: /* @__PURE__ */ B(Ht, {
2114
+ contentRef: x,
2115
+ normalizedItems: Z,
2116
+ safeRowHeight: 34,
2117
+ viewportHeight: me,
2118
+ lowerSegments: te,
2119
+ virtualColumns: he,
2120
+ weekendSegments: ge,
2121
+ dragState: H,
2122
+ dragPermissionById: Q,
2123
+ tooltip: d,
2124
+ handleTaskMouseDown: fe,
2125
+ handleResizeMouseDown: pe,
2126
+ handleBarClick: ye,
2127
+ collapsedKeys: h,
2128
+ handleOffscreenJump: L,
2129
+ todayLineLeft: ae,
2130
+ shouldShowTodayMarker: _e
2131
+ })
2132
+ })
2133
+ })]
2134
+ })
2135
+ });
2136
+ }
2137
+ var Wt = U(Ut);
2138
+ //#endregion
2139
+ export { Wt as t };