@zealakit/chrono-react 0.0.0-stage → 1.0.0-beta.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 (355) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +624 -2
  3. package/dist/calendar/components.d.ts +346 -0
  4. package/dist/calendar/components.js +245 -0
  5. package/dist/calendar/context.d.ts +636 -0
  6. package/dist/calendar/context.js +21 -0
  7. package/dist/calendar/index.d.ts +6 -0
  8. package/dist/calendar/index.js +6 -0
  9. package/dist/calendar/mini-calendar.d.ts +60 -0
  10. package/dist/calendar/mini-calendar.js +50 -0
  11. package/dist/calendar/options.d.ts +4 -0
  12. package/dist/calendar/options.js +98 -0
  13. package/dist/calendar/use-calendar.d.ts +340 -0
  14. package/dist/calendar/use-calendar.js +156 -0
  15. package/dist/calendar/use-mini-calendar.d.ts +302 -0
  16. package/dist/calendar/use-mini-calendar.js +56 -0
  17. package/dist/calendar/utilities.d.ts +9 -0
  18. package/dist/calendar/utilities.js +8 -0
  19. package/dist/date/bind-panel.d.ts +30 -0
  20. package/dist/date/bind-panel.js +125 -0
  21. package/dist/date/components.d.ts +197 -0
  22. package/dist/date/components.js +202 -0
  23. package/dist/date/context.d.ts +34 -0
  24. package/dist/date/context.js +19 -0
  25. package/dist/date/index.d.ts +4 -0
  26. package/dist/date/index.js +4 -0
  27. package/dist/date/options.d.ts +7 -0
  28. package/dist/date/options.js +91 -0
  29. package/dist/date/use-date-input.d.ts +43 -0
  30. package/dist/date/use-date-input.js +138 -0
  31. package/dist/date/use-date-panel.d.ts +81 -0
  32. package/dist/date/use-date-panel.js +21 -0
  33. package/dist/date/utilities.d.ts +4 -0
  34. package/dist/date/utilities.js +4 -0
  35. package/dist/datetime/components.d.ts +121 -0
  36. package/dist/datetime/components.js +169 -0
  37. package/dist/datetime/context.d.ts +8 -0
  38. package/dist/datetime/context.js +18 -0
  39. package/dist/datetime/index.d.ts +4 -0
  40. package/dist/datetime/index.js +4 -0
  41. package/dist/datetime/options.d.ts +5 -0
  42. package/dist/datetime/options.js +99 -0
  43. package/dist/datetime/use-datetime-input.d.ts +44 -0
  44. package/dist/datetime/use-datetime-input.js +145 -0
  45. package/dist/datetime/use-datetime-panel.d.ts +128 -0
  46. package/dist/datetime/use-datetime-panel.js +60 -0
  47. package/dist/datetime/utilities.d.ts +4 -0
  48. package/dist/datetime/utilities.js +4 -0
  49. package/dist/index.d.ts +4 -0
  50. package/dist/index.js +4 -0
  51. package/dist/shared/merge-props.d.ts +9 -0
  52. package/dist/shared/merge-props.js +33 -0
  53. package/dist/shared/modifiers.d.ts +7 -0
  54. package/dist/shared/modifiers.js +6 -0
  55. package/dist/shared/part.d.ts +10 -0
  56. package/dist/shared/part.js +9 -0
  57. package/dist/shared/slot.d.ts +12 -0
  58. package/dist/shared/slot.js +60 -0
  59. package/dist/shared/style-properties.d.ts +8 -0
  60. package/dist/shared/style-properties.js +13 -0
  61. package/dist/shared/to-react-props.d.ts +11 -0
  62. package/dist/shared/to-react-props.js +27 -0
  63. package/dist/time/bind-panel.d.ts +19 -0
  64. package/dist/time/bind-panel.js +97 -0
  65. package/dist/time/components.d.ts +183 -0
  66. package/dist/time/components.js +174 -0
  67. package/dist/time/context.d.ts +24 -0
  68. package/dist/time/context.js +19 -0
  69. package/dist/time/index.d.ts +4 -0
  70. package/dist/time/index.js +4 -0
  71. package/dist/time/options.d.ts +5 -0
  72. package/dist/time/options.js +85 -0
  73. package/dist/time/use-time-input.d.ts +43 -0
  74. package/dist/time/use-time-input.js +138 -0
  75. package/dist/time/use-time-panel.d.ts +37 -0
  76. package/dist/time/use-time-panel.js +18 -0
  77. package/dist/time/utilities.d.ts +4 -0
  78. package/dist/time/utilities.js +4 -0
  79. package/dist/vendor/core/calendar/availability.d.ts +39 -0
  80. package/dist/vendor/core/calendar/availability.js +74 -0
  81. package/dist/vendor/core/calendar/controllers/calendar-controller.d.ts +251 -0
  82. package/dist/vendor/core/calendar/controllers/calendar-controller.js +1448 -0
  83. package/dist/vendor/core/calendar/controllers/drag-engine.d.ts +99 -0
  84. package/dist/vendor/core/calendar/controllers/drag-engine.js +382 -0
  85. package/dist/vendor/core/calendar/controllers/mini-calendar-controller.d.ts +66 -0
  86. package/dist/vendor/core/calendar/controllers/mini-calendar-controller.js +170 -0
  87. package/dist/vendor/core/calendar/controllers/shared.d.ts +29 -0
  88. package/dist/vendor/core/calendar/controllers/shared.js +82 -0
  89. package/dist/vendor/core/calendar/events/agenda-layout.d.ts +21 -0
  90. package/dist/vendor/core/calendar/events/agenda-layout.js +71 -0
  91. package/dist/vendor/core/calendar/events/all-day-row.d.ts +22 -0
  92. package/dist/vendor/core/calendar/events/all-day-row.js +93 -0
  93. package/dist/vendor/core/calendar/events/background-layout.d.ts +66 -0
  94. package/dist/vendor/core/calendar/events/background-layout.js +107 -0
  95. package/dist/vendor/core/calendar/events/index.d.ts +17 -0
  96. package/dist/vendor/core/calendar/events/index.js +8 -0
  97. package/dist/vendor/core/calendar/events/month-layout.d.ts +13 -0
  98. package/dist/vendor/core/calendar/events/month-layout.js +156 -0
  99. package/dist/vendor/core/calendar/events/normalize.d.ts +33 -0
  100. package/dist/vendor/core/calendar/events/normalize.js +159 -0
  101. package/dist/vendor/core/calendar/events/now-indicator.d.ts +18 -0
  102. package/dist/vendor/core/calendar/events/now-indicator.js +19 -0
  103. package/dist/vendor/core/calendar/events/overflow.d.ts +36 -0
  104. package/dist/vendor/core/calendar/events/overflow.js +112 -0
  105. package/dist/vendor/core/calendar/events/sort.d.ts +21 -0
  106. package/dist/vendor/core/calendar/events/sort.js +35 -0
  107. package/dist/vendor/core/calendar/events/time-grid-layout.d.ts +22 -0
  108. package/dist/vendor/core/calendar/events/time-grid-layout.js +184 -0
  109. package/dist/vendor/core/calendar/events/types.d.ts +141 -0
  110. package/dist/vendor/core/calendar/events/types.js +1 -0
  111. package/dist/vendor/core/calendar/index.d.ts +70 -0
  112. package/dist/vendor/core/calendar/index.js +37 -0
  113. package/dist/vendor/core/calendar/interaction/auto-scroll.d.ts +19 -0
  114. package/dist/vendor/core/calendar/interaction/auto-scroll.js +64 -0
  115. package/dist/vendor/core/calendar/interaction/drag-geometry.d.ts +52 -0
  116. package/dist/vendor/core/calendar/interaction/drag-geometry.js +125 -0
  117. package/dist/vendor/core/calendar/interaction/drag-keyboard.d.ts +38 -0
  118. package/dist/vendor/core/calendar/interaction/drag-keyboard.js +56 -0
  119. package/dist/vendor/core/calendar/interaction/drag-pointer.d.ts +23 -0
  120. package/dist/vendor/core/calendar/interaction/drag-pointer.js +203 -0
  121. package/dist/vendor/core/calendar/interaction/event-focus.d.ts +28 -0
  122. package/dist/vendor/core/calendar/interaction/event-focus.js +44 -0
  123. package/dist/vendor/core/calendar/interaction/hit-test.d.ts +17 -0
  124. package/dist/vendor/core/calendar/interaction/hit-test.js +26 -0
  125. package/dist/vendor/core/calendar/interaction/pending.d.ts +17 -0
  126. package/dist/vendor/core/calendar/interaction/pending.js +17 -0
  127. package/dist/vendor/core/calendar/interaction/pointer.d.ts +21 -0
  128. package/dist/vendor/core/calendar/interaction/pointer.js +119 -0
  129. package/dist/vendor/core/calendar/interaction/selection.d.ts +29 -0
  130. package/dist/vendor/core/calendar/interaction/selection.js +47 -0
  131. package/dist/vendor/core/calendar/internal/equal.d.ts +3 -0
  132. package/dist/vendor/core/calendar/internal/equal.js +43 -0
  133. package/dist/vendor/core/calendar/navigation/navigate.d.ts +33 -0
  134. package/dist/vendor/core/calendar/navigation/navigate.js +83 -0
  135. package/dist/vendor/core/calendar/navigation/range.d.ts +15 -0
  136. package/dist/vendor/core/calendar/navigation/range.js +52 -0
  137. package/dist/vendor/core/calendar/navigation/title.d.ts +12 -0
  138. package/dist/vendor/core/calendar/navigation/title.js +39 -0
  139. package/dist/vendor/core/calendar/navigation/view-definition.d.ts +39 -0
  140. package/dist/vendor/core/calendar/navigation/view-definition.js +61 -0
  141. package/dist/vendor/core/calendar/navigation/zoom.d.ts +5 -0
  142. package/dist/vendor/core/calendar/navigation/zoom.js +11 -0
  143. package/dist/vendor/core/calendar/recurrence/apply.d.ts +50 -0
  144. package/dist/vendor/core/calendar/recurrence/apply.js +207 -0
  145. package/dist/vendor/core/calendar/recurrence/expand.d.ts +27 -0
  146. package/dist/vendor/core/calendar/recurrence/expand.js +302 -0
  147. package/dist/vendor/core/calendar/recurrence/pack.d.ts +3 -0
  148. package/dist/vendor/core/calendar/recurrence/pack.js +251 -0
  149. package/dist/vendor/core/calendar/recurrence/rrule-types.d.ts +30 -0
  150. package/dist/vendor/core/calendar/recurrence/rrule-types.js +8 -0
  151. package/dist/vendor/core/calendar/recurrence/rrule.d.ts +12 -0
  152. package/dist/vendor/core/calendar/recurrence/rrule.js +288 -0
  153. package/dist/vendor/core/calendar/recurrence/series.d.ts +25 -0
  154. package/dist/vendor/core/calendar/recurrence/series.js +165 -0
  155. package/dist/vendor/core/calendar/recurrence/types.d.ts +30 -0
  156. package/dist/vendor/core/calendar/recurrence/types.js +1 -0
  157. package/dist/vendor/core/calendar/resources/keys.d.ts +2 -0
  158. package/dist/vendor/core/calendar/resources/keys.js +2 -0
  159. package/dist/vendor/core/calendar/resources/resource-time-grid.d.ts +7 -0
  160. package/dist/vendor/core/calendar/resources/resource-time-grid.js +130 -0
  161. package/dist/vendor/core/calendar/resources/timeline-axis.d.ts +10 -0
  162. package/dist/vendor/core/calendar/resources/timeline-axis.js +98 -0
  163. package/dist/vendor/core/calendar/resources/timeline-layout.d.ts +7 -0
  164. package/dist/vendor/core/calendar/resources/timeline-layout.js +111 -0
  165. package/dist/vendor/core/calendar/resources/tree.d.ts +10 -0
  166. package/dist/vendor/core/calendar/resources/tree.js +86 -0
  167. package/dist/vendor/core/calendar/resources/types.d.ts +177 -0
  168. package/dist/vendor/core/calendar/resources/types.js +1 -0
  169. package/dist/vendor/core/calendar/resources/views.d.ts +7 -0
  170. package/dist/vendor/core/calendar/resources/views.js +45 -0
  171. package/dist/vendor/core/calendar/resources/windowing.d.ts +11 -0
  172. package/dist/vendor/core/calendar/resources/windowing.js +17 -0
  173. package/dist/vendor/core/calendar/views/day.d.ts +37 -0
  174. package/dist/vendor/core/calendar/views/day.js +39 -0
  175. package/dist/vendor/core/calendar/views/list-layout.d.ts +8 -0
  176. package/dist/vendor/core/calendar/views/list-layout.js +5 -0
  177. package/dist/vendor/core/calendar/views/mini-calendar.d.ts +23 -0
  178. package/dist/vendor/core/calendar/views/mini-calendar.js +31 -0
  179. package/dist/vendor/core/calendar/views/month-layout.d.ts +30 -0
  180. package/dist/vendor/core/calendar/views/month-layout.js +63 -0
  181. package/dist/vendor/core/calendar/views/time-grid-layout.d.ts +26 -0
  182. package/dist/vendor/core/calendar/views/time-grid-layout.js +30 -0
  183. package/dist/vendor/core/date/index.d.ts +9 -0
  184. package/dist/vendor/core/date/index.js +9 -0
  185. package/dist/vendor/core/date/input/date-input-controller.d.ts +97 -0
  186. package/dist/vendor/core/date/input/date-input-controller.js +478 -0
  187. package/dist/vendor/core/date/input/date-range-input-controller.d.ts +43 -0
  188. package/dist/vendor/core/date/input/date-range-input-controller.js +189 -0
  189. package/dist/vendor/core/date/input/parse.d.ts +22 -0
  190. package/dist/vendor/core/date/input/parse.js +84 -0
  191. package/dist/vendor/core/date/input/validity.d.ts +6 -0
  192. package/dist/vendor/core/date/input/validity.js +13 -0
  193. package/dist/vendor/core/date/panel/panel-controller.d.ts +176 -0
  194. package/dist/vendor/core/date/panel/panel-controller.js +726 -0
  195. package/dist/vendor/core/date/presets.d.ts +22 -0
  196. package/dist/vendor/core/date/presets.js +104 -0
  197. package/dist/vendor/core/date/selection/multiple.d.ts +7 -0
  198. package/dist/vendor/core/date/selection/multiple.js +32 -0
  199. package/dist/vendor/core/date/selection/range.d.ts +29 -0
  200. package/dist/vendor/core/date/selection/range.js +39 -0
  201. package/dist/vendor/core/date/types.d.ts +12 -0
  202. package/dist/vendor/core/date/types.js +1 -0
  203. package/dist/vendor/core/datetime/compose.d.ts +24 -0
  204. package/dist/vendor/core/datetime/compose.js +49 -0
  205. package/dist/vendor/core/datetime/constraints.d.ts +42 -0
  206. package/dist/vendor/core/datetime/constraints.js +56 -0
  207. package/dist/vendor/core/datetime/index.d.ts +9 -0
  208. package/dist/vendor/core/datetime/index.js +9 -0
  209. package/dist/vendor/core/datetime/input/datetime-input-controller.d.ts +96 -0
  210. package/dist/vendor/core/datetime/input/datetime-input-controller.js +395 -0
  211. package/dist/vendor/core/datetime/input/datetime-range-input-controller.d.ts +46 -0
  212. package/dist/vendor/core/datetime/input/datetime-range-input-controller.js +182 -0
  213. package/dist/vendor/core/datetime/input/parse.d.ts +20 -0
  214. package/dist/vendor/core/datetime/input/parse.js +59 -0
  215. package/dist/vendor/core/datetime/panel/controller.d.ts +64 -0
  216. package/dist/vendor/core/datetime/panel/controller.js +197 -0
  217. package/dist/vendor/core/datetime/panel/range-controller.d.ts +71 -0
  218. package/dist/vendor/core/datetime/panel/range-controller.js +217 -0
  219. package/dist/vendor/core/datetime/types.d.ts +12 -0
  220. package/dist/vendor/core/datetime/types.js +1 -0
  221. package/dist/vendor/core/datetime/zone/day-instants.d.ts +19 -0
  222. package/dist/vendor/core/datetime/zone/day-instants.js +54 -0
  223. package/dist/vendor/core/datetime/zone/resolve.d.ts +16 -0
  224. package/dist/vendor/core/datetime/zone/resolve.js +26 -0
  225. package/dist/vendor/core/foundation/a11y/announcer.d.ts +7 -0
  226. package/dist/vendor/core/foundation/a11y/announcer.js +36 -0
  227. package/dist/vendor/core/foundation/a11y/grid-navigation.d.ts +19 -0
  228. package/dist/vendor/core/foundation/a11y/grid-navigation.js +86 -0
  229. package/dist/vendor/core/foundation/a11y/index.d.ts +8 -0
  230. package/dist/vendor/core/foundation/a11y/index.js +5 -0
  231. package/dist/vendor/core/foundation/a11y/labels.d.ts +21 -0
  232. package/dist/vendor/core/foundation/a11y/labels.js +43 -0
  233. package/dist/vendor/core/foundation/a11y/messages.d.ts +80 -0
  234. package/dist/vendor/core/foundation/a11y/messages.js +74 -0
  235. package/dist/vendor/core/foundation/a11y/roving-focus.d.ts +18 -0
  236. package/dist/vendor/core/foundation/a11y/roving-focus.js +52 -0
  237. package/dist/vendor/core/foundation/constraints/availability-rules.d.ts +52 -0
  238. package/dist/vendor/core/foundation/constraints/availability-rules.js +66 -0
  239. package/dist/vendor/core/foundation/constraints/availability.d.ts +93 -0
  240. package/dist/vendor/core/foundation/constraints/availability.js +490 -0
  241. package/dist/vendor/core/foundation/constraints/date.d.ts +21 -0
  242. package/dist/vendor/core/foundation/constraints/date.js +41 -0
  243. package/dist/vendor/core/foundation/constraints/index.d.ts +9 -0
  244. package/dist/vendor/core/foundation/constraints/index.js +4 -0
  245. package/dist/vendor/core/foundation/constraints/range.d.ts +44 -0
  246. package/dist/vendor/core/foundation/constraints/range.js +70 -0
  247. package/dist/vendor/core/foundation/constraints/time.d.ts +30 -0
  248. package/dist/vendor/core/foundation/constraints/time.js +56 -0
  249. package/dist/vendor/core/foundation/grid/index.d.ts +8 -0
  250. package/dist/vendor/core/foundation/grid/index.js +4 -0
  251. package/dist/vendor/core/foundation/grid/month-grid.d.ts +33 -0
  252. package/dist/vendor/core/foundation/grid/month-grid.js +52 -0
  253. package/dist/vendor/core/foundation/grid/time-axis.d.ts +25 -0
  254. package/dist/vendor/core/foundation/grid/time-axis.js +32 -0
  255. package/dist/vendor/core/foundation/grid/weekday-headers.d.ts +17 -0
  256. package/dist/vendor/core/foundation/grid/weekday-headers.js +26 -0
  257. package/dist/vendor/core/foundation/grid/year-grid.d.ts +29 -0
  258. package/dist/vendor/core/foundation/grid/year-grid.js +40 -0
  259. package/dist/vendor/core/foundation/index.d.ts +8 -0
  260. package/dist/vendor/core/foundation/index.js +8 -0
  261. package/dist/vendor/core/foundation/input/form.d.ts +7 -0
  262. package/dist/vendor/core/foundation/input/form.js +10 -0
  263. package/dist/vendor/core/foundation/input/index.d.ts +6 -0
  264. package/dist/vendor/core/foundation/input/index.js +3 -0
  265. package/dist/vendor/core/foundation/input/segment-engine.d.ts +33 -0
  266. package/dist/vendor/core/foundation/input/segment-engine.js +49 -0
  267. package/dist/vendor/core/foundation/input/tokenize.d.ts +19 -0
  268. package/dist/vendor/core/foundation/input/tokenize.js +24 -0
  269. package/dist/vendor/core/foundation/locale/digits.d.ts +6 -0
  270. package/dist/vendor/core/foundation/locale/digits.js +35 -0
  271. package/dist/vendor/core/foundation/locale/direction.d.ts +1 -0
  272. package/dist/vendor/core/foundation/locale/direction.js +37 -0
  273. package/dist/vendor/core/foundation/locale/format.d.ts +31 -0
  274. package/dist/vendor/core/foundation/locale/format.js +79 -0
  275. package/dist/vendor/core/foundation/locale/hour-cycle.d.ts +12 -0
  276. package/dist/vendor/core/foundation/locale/hour-cycle.js +45 -0
  277. package/dist/vendor/core/foundation/locale/index.d.ts +10 -0
  278. package/dist/vendor/core/foundation/locale/index.js +8 -0
  279. package/dist/vendor/core/foundation/locale/names.d.ts +6 -0
  280. package/dist/vendor/core/foundation/locale/names.js +30 -0
  281. package/dist/vendor/core/foundation/locale/resolve.d.ts +7 -0
  282. package/dist/vendor/core/foundation/locale/resolve.js +29 -0
  283. package/dist/vendor/core/foundation/locale/week-info.d.ts +5 -0
  284. package/dist/vendor/core/foundation/locale/week-info.js +61 -0
  285. package/dist/vendor/core/foundation/locale/zone-label.d.ts +6 -0
  286. package/dist/vendor/core/foundation/locale/zone-label.js +24 -0
  287. package/dist/vendor/core/foundation/ranges/date-range.d.ts +18 -0
  288. package/dist/vendor/core/foundation/ranges/date-range.js +40 -0
  289. package/dist/vendor/core/foundation/ranges/index.d.ts +4 -0
  290. package/dist/vendor/core/foundation/ranges/index.js +2 -0
  291. package/dist/vendor/core/foundation/ranges/interval.d.ts +24 -0
  292. package/dist/vendor/core/foundation/ranges/interval.js +56 -0
  293. package/dist/vendor/core/foundation/store/attributes.d.ts +19 -0
  294. package/dist/vendor/core/foundation/store/attributes.js +43 -0
  295. package/dist/vendor/core/foundation/store/controllable.d.ts +19 -0
  296. package/dist/vendor/core/foundation/store/controllable.js +50 -0
  297. package/dist/vendor/core/foundation/store/env.d.ts +1 -0
  298. package/dist/vendor/core/foundation/store/env.js +3 -0
  299. package/dist/vendor/core/foundation/store/global-state.d.ts +1 -0
  300. package/dist/vendor/core/foundation/store/global-state.js +21 -0
  301. package/dist/vendor/core/foundation/store/ids.d.ts +2 -0
  302. package/dist/vendor/core/foundation/store/ids.js +7 -0
  303. package/dist/vendor/core/foundation/store/index.d.ts +11 -0
  304. package/dist/vendor/core/foundation/store/index.js +7 -0
  305. package/dist/vendor/core/foundation/store/store.d.ts +7 -0
  306. package/dist/vendor/core/foundation/store/store.js +25 -0
  307. package/dist/vendor/core/foundation/store/ticker.d.ts +11 -0
  308. package/dist/vendor/core/foundation/store/ticker.js +27 -0
  309. package/dist/vendor/core/foundation/values/clock.d.ts +4 -0
  310. package/dist/vendor/core/foundation/values/clock.js +21 -0
  311. package/dist/vendor/core/foundation/values/compare.d.ts +16 -0
  312. package/dist/vendor/core/foundation/values/compare.js +70 -0
  313. package/dist/vendor/core/foundation/values/convert.d.ts +31 -0
  314. package/dist/vendor/core/foundation/values/convert.js +112 -0
  315. package/dist/vendor/core/foundation/values/epoch-day.d.ts +15 -0
  316. package/dist/vendor/core/foundation/values/epoch-day.js +47 -0
  317. package/dist/vendor/core/foundation/values/index.d.ts +14 -0
  318. package/dist/vendor/core/foundation/values/index.js +10 -0
  319. package/dist/vendor/core/foundation/values/iso.d.ts +24 -0
  320. package/dist/vendor/core/foundation/values/iso.js +113 -0
  321. package/dist/vendor/core/foundation/values/plain-date-time.d.ts +8 -0
  322. package/dist/vendor/core/foundation/values/plain-date-time.js +25 -0
  323. package/dist/vendor/core/foundation/values/plain-date.d.ts +33 -0
  324. package/dist/vendor/core/foundation/values/plain-date.js +105 -0
  325. package/dist/vendor/core/foundation/values/plain-time.d.ts +15 -0
  326. package/dist/vendor/core/foundation/values/plain-time.js +45 -0
  327. package/dist/vendor/core/foundation/values/types.d.ts +37 -0
  328. package/dist/vendor/core/foundation/values/types.js +1 -0
  329. package/dist/vendor/core/foundation/values/week.d.ts +9 -0
  330. package/dist/vendor/core/foundation/values/week.js +31 -0
  331. package/dist/vendor/core/foundation/values/year-month.d.ts +10 -0
  332. package/dist/vendor/core/foundation/values/year-month.js +19 -0
  333. package/dist/vendor/core/foundation/values/zoned.d.ts +16 -0
  334. package/dist/vendor/core/foundation/values/zoned.js +155 -0
  335. package/dist/vendor/core/index.d.ts +5 -0
  336. package/dist/vendor/core/index.js +5 -0
  337. package/dist/vendor/core/time/index.d.ts +8 -0
  338. package/dist/vendor/core/time/index.js +8 -0
  339. package/dist/vendor/core/time/input/parse.d.ts +19 -0
  340. package/dist/vendor/core/time/input/parse.js +84 -0
  341. package/dist/vendor/core/time/input/time-input-controller.d.ts +102 -0
  342. package/dist/vendor/core/time/input/time-input-controller.js +562 -0
  343. package/dist/vendor/core/time/input/time-range-input-controller.d.ts +49 -0
  344. package/dist/vendor/core/time/input/time-range-input-controller.js +185 -0
  345. package/dist/vendor/core/time/input/validity.d.ts +7 -0
  346. package/dist/vendor/core/time/input/validity.js +16 -0
  347. package/dist/vendor/core/time/panel/time-panel-controller.d.ts +163 -0
  348. package/dist/vendor/core/time/panel/time-panel-controller.js +839 -0
  349. package/dist/vendor/core/time/selection/range.d.ts +25 -0
  350. package/dist/vendor/core/time/selection/range.js +35 -0
  351. package/dist/vendor/core/time/selection/slots.d.ts +46 -0
  352. package/dist/vendor/core/time/selection/slots.js +78 -0
  353. package/dist/vendor/core/time/types.d.ts +11 -0
  354. package/dist/vendor/core/time/types.js +1 -0
  355. package/package.json +90 -4
@@ -0,0 +1,184 @@
1
+ import { compare, splitIntervalByDay, toEpochDay, toSecondOfDay, } from "../../foundation/index.js";
2
+ import { wallSecondsOf } from "./normalize.js";
3
+ import { compareEventIds } from "./sort.js";
4
+ const SECONDS_PER_DAY = 86400;
5
+ function secondsInDay(value, date) {
6
+ return wallSecondsOf(value) - toEpochDay(date) * SECONDS_PER_DAY;
7
+ }
8
+ function compareTimed(a, b) {
9
+ if (a.startSec !== b.startSec) {
10
+ return a.startSec - b.startSec;
11
+ }
12
+ const da = wallSecondsOf(a.end) - wallSecondsOf(a.start);
13
+ const db = wallSecondsOf(b.end) - wallSecondsOf(b.start);
14
+ if (da !== db) {
15
+ return db - da;
16
+ }
17
+ return compareEventIds(a.event.id, b.event.id);
18
+ }
19
+ /**
20
+ * Assign overlap columns within a cluster and expand each event rightward
21
+ * (plan 05 E8). Members must be sorted by `compareTimed`.
22
+ */
23
+ function assignColumns(members) {
24
+ const columnEnds = [];
25
+ for (const item of members) {
26
+ let column = 0;
27
+ while (column < columnEnds.length &&
28
+ columnEnds[column] > item.startSec) {
29
+ column += 1;
30
+ }
31
+ if (column === columnEnds.length) {
32
+ columnEnds.push(item.endSec);
33
+ }
34
+ else {
35
+ columnEnds[column] = item.endSec;
36
+ }
37
+ item.column = column;
38
+ }
39
+ const columns = columnEnds.length;
40
+ for (const item of members) {
41
+ item.columns = columns;
42
+ let span = 1;
43
+ while (item.column + span < columns) {
44
+ const column = item.column + span;
45
+ const overlap = members.some((other) => other.column === column &&
46
+ other.startSec < item.endSec &&
47
+ item.startSec < other.endSec);
48
+ if (overlap) {
49
+ break;
50
+ }
51
+ span += 1;
52
+ }
53
+ item.span = span;
54
+ }
55
+ }
56
+ /**
57
+ * The timed area of a week / work week / day time grid (plan 05 §2.4): split
58
+ * each event per day, clip to the axis, lay out overlapping events into
59
+ * columns with rightward expansion. All-day and long events are handled by
60
+ * `layoutAllDayRow`, not here.
61
+ */
62
+ export function layoutTimeGridEvents(events, days, options = {}) {
63
+ const axisStart = options.dayStart ? toSecondOfDay(options.dayStart) : 0;
64
+ const axisEnd = options.dayEnd
65
+ ? toSecondOfDay(options.dayEnd)
66
+ : SECONDS_PER_DAY;
67
+ const axisLength = axisEnd - axisStart;
68
+ const minDuration = (options.minEventDuration ?? 15) * 60;
69
+ const longEvents = options.longEventsInAllDayRow ?? true;
70
+ const now = options.now;
71
+ const columnByDay = new Map();
72
+ for (let index = 0; index < days.length; index += 1) {
73
+ columnByDay.set(toEpochDay(days[index].date), index);
74
+ }
75
+ const byDay = new Map();
76
+ for (const event of events) {
77
+ if (event.allDay) {
78
+ continue;
79
+ }
80
+ if (longEvents &&
81
+ wallSecondsOf(event.end) - wallSecondsOf(event.start) >= SECONDS_PER_DAY) {
82
+ continue;
83
+ }
84
+ // `splitIntervalByDay` returns nothing for an empty interval, so a
85
+ // zero-length event (no `end`) becomes one piece by hand.
86
+ const pieces = compare(event.start, event.end) === 0
87
+ ? [
88
+ {
89
+ date: event.start,
90
+ start: event.start,
91
+ end: event.end,
92
+ continuesBefore: false,
93
+ continuesAfter: false,
94
+ },
95
+ ]
96
+ : splitIntervalByDay({ start: event.start, end: event.end });
97
+ for (const piece of pieces) {
98
+ const dayIndex = columnByDay.get(toEpochDay(piece.date));
99
+ if (dayIndex === undefined) {
100
+ continue;
101
+ }
102
+ const dayKey = days[dayIndex]?.key;
103
+ const startSec = secondsInDay(piece.start, piece.date);
104
+ const endSec = secondsInDay(piece.end, piece.date);
105
+ const clippedStart = Math.max(startSec, axisStart);
106
+ const clippedEnd = Math.min(endSec, axisEnd);
107
+ // A zero-length event (no `end`) is kept when it starts inside the axis
108
+ // and drawn at the minimum height; anything else must overlap the axis.
109
+ const zeroLength = startSec === endSec;
110
+ if (zeroLength
111
+ ? startSec < axisStart || startSec >= axisEnd
112
+ : clippedEnd <= clippedStart) {
113
+ continue;
114
+ }
115
+ const realHeight = (clippedEnd - clippedStart) / axisLength;
116
+ const timed = {
117
+ key: `${event.key}:${dayKey}`,
118
+ event: event.event,
119
+ start: event.start,
120
+ end: event.end,
121
+ dayKey,
122
+ top: (clippedStart - axisStart) / axisLength,
123
+ height: Math.max(realHeight, minDuration / axisLength),
124
+ continuesBefore: piece.continuesBefore,
125
+ continuesAfter: piece.continuesAfter,
126
+ past: now !== undefined && compare(event.end, now) <= 0,
127
+ recurrence: event.recurrence,
128
+ startSec: clippedStart,
129
+ // Overlap follows the drawn extent, so minimum-height events never
130
+ // sit on top of their neighbours.
131
+ endSec: Math.max(clippedEnd, clippedStart + minDuration),
132
+ column: 0,
133
+ columns: 1,
134
+ span: 1,
135
+ };
136
+ const list = byDay.get(dayKey);
137
+ if (list) {
138
+ list.push(timed);
139
+ }
140
+ else {
141
+ byDay.set(dayKey, [timed]);
142
+ }
143
+ }
144
+ }
145
+ const result = [];
146
+ for (const group of byDay.values()) {
147
+ group.sort(compareTimed);
148
+ // Cluster transitively overlapping events (sorted order keeps this linear).
149
+ const clusters = [];
150
+ for (const item of group) {
151
+ const cluster = clusters.find((c) => c.end > item.startSec);
152
+ if (!cluster) {
153
+ clusters.push({ members: [item], end: item.endSec });
154
+ }
155
+ else {
156
+ cluster.members.push(item);
157
+ cluster.end = Math.max(cluster.end, item.endSec);
158
+ }
159
+ }
160
+ for (const cluster of clusters) {
161
+ assignColumns(cluster.members);
162
+ }
163
+ for (const item of group) {
164
+ result.push({
165
+ key: item.key,
166
+ event: item.event,
167
+ start: item.start,
168
+ end: item.end,
169
+ allDay: false,
170
+ continuesBefore: item.continuesBefore,
171
+ continuesAfter: item.continuesAfter,
172
+ past: item.past,
173
+ recurrence: item.recurrence,
174
+ dayKey: item.dayKey,
175
+ top: item.top,
176
+ height: item.height,
177
+ column: item.column,
178
+ columns: item.columns,
179
+ span: item.span,
180
+ });
181
+ }
182
+ }
183
+ return result;
184
+ }
@@ -0,0 +1,141 @@
1
+ import type { DateInput, DateTimeInput, PlainDate, PlainDateTime, ZonedDateTime } from "../../foundation/index.js";
2
+ import type { RRule } from "../recurrence/rrule-types.js";
3
+ /** An event id: a string or a number (plan 05 E1). */
4
+ export type EventId = string | number;
5
+ /**
6
+ * The month grid structure the event layout reads: per month, per week row,
7
+ * the visible days in column order. `MonthLayout` (the controller's state)
8
+ * satisfies this shape.
9
+ */
10
+ export type MonthEventLayout = {
11
+ months: {
12
+ weeks: {
13
+ days: {
14
+ date: PlainDate;
15
+ hidden: boolean;
16
+ outsideMonth: boolean;
17
+ /** ISO date, the cell's `data-chrono-key`. */
18
+ key: string;
19
+ }[];
20
+ }[];
21
+ }[];
22
+ };
23
+ /**
24
+ * What the app passes for one event (plan 05 E1). The app's own fields pass
25
+ * through untouched on the original object; Chrono only reads these keys.
26
+ */
27
+ export type CalendarEventInput = {
28
+ id: EventId;
29
+ /** `DateTimeInput` when timed, `DateInput` when `allDay`. */
30
+ start: DateTimeInput | DateInput;
31
+ end: DateTimeInput | DateInput;
32
+ allDay?: boolean;
33
+ recurringId?: string | number;
34
+ calendarId?: string | number;
35
+ /** RFC 5545 rule or parsed rule: the event is a series (plan 12 RR1). */
36
+ rrule?: string | RRule;
37
+ /** Occurrence starts removed from the rule (RR1). */
38
+ exdates?: readonly (DateTimeInput | DateInput)[];
39
+ /** Extra occurrence starts (RR1). */
40
+ rdates?: readonly (DateTimeInput | DateInput)[];
41
+ /** With `recurringId`: the original occurrence this event replaces (RR6). */
42
+ recurrenceId?: DateTimeInput | DateInput;
43
+ /** Resource(s) the event belongs to, for resource views (plan 10 R2). */
44
+ resourceId?: EventId | readonly EventId[];
45
+ /** Per-event edit permissions (plan 09 M1); `false` wins over the calendar option. */
46
+ editable?: boolean;
47
+ movable?: boolean;
48
+ resizable?: boolean;
49
+ };
50
+ /** The series occurrence an event replaces or belongs to (plan 12 RR7). */
51
+ export type RecurrenceInfo<TEvent extends CalendarEventInput> = {
52
+ recurringId: EventId;
53
+ /** Original occurrence start, wall time in the display zone. */
54
+ occurrenceStart: PlainDateTime;
55
+ isOverride: boolean;
56
+ /** The series object, so render callbacks can read its app fields. */
57
+ series: TEvent;
58
+ };
59
+ /**
60
+ * An event after parsing and zone conversion (plan 05 §2.2). `start`/`end` are
61
+ * wall time in the display zone, half-open `[start, end)`; all-day events run
62
+ * from midnight of the first day to midnight of the exclusive end day (E3).
63
+ * `key` is the unique internal id (dedupe suffix on repeated ids).
64
+ */
65
+ export type NormalizedEvent<TEvent extends CalendarEventInput = CalendarEventInput> = {
66
+ id: EventId;
67
+ key: string;
68
+ /** The app's original object, unchanged. */
69
+ event: TEvent;
70
+ start: PlainDateTime;
71
+ end: PlainDateTime;
72
+ allDay: boolean;
73
+ recurringId?: string | number;
74
+ calendarId?: string | number;
75
+ /** Resource ids the event is shown in (empty or missing outside resource views). */
76
+ resourceIds?: readonly EventId[];
77
+ /** Series/override identity (plan 12 RR7). */
78
+ recurrence?: RecurrenceInfo<TEvent>;
79
+ };
80
+ /** Fields every layout segment shares (plan 05 §2.2). */
81
+ export type EventSegmentBase<TEvent extends CalendarEventInput = CalendarEventInput> = {
82
+ /** `${normalized.key}:${firstDayKey}` — unique per segment. */
83
+ key: string;
84
+ event: TEvent;
85
+ /** Real values in the display zone (not clipped to the segment). */
86
+ start: PlainDateTime;
87
+ end: PlainDateTime;
88
+ allDay: boolean;
89
+ continuesBefore: boolean;
90
+ continuesAfter: boolean;
91
+ /** The whole event ended before `now`. */
92
+ past: boolean;
93
+ /** Series/override identity (plan 12 RR7). */
94
+ recurrence?: RecurrenceInfo<TEvent>;
95
+ };
96
+ /** A piece of an event in the month view (plan 05 §2.2). */
97
+ export type MonthSegment<TEvent extends CalendarEventInput = CalendarEventInput> = EventSegmentBase<TEvent> & {
98
+ /** Index into the month layout's `months`. */
99
+ month: number;
100
+ /** Index into that month's `weeks`. */
101
+ week: number;
102
+ /** First visible column the piece occupies. */
103
+ startColumn: number;
104
+ /** Number of visible columns it occupies. */
105
+ days: number;
106
+ lane: number;
107
+ hidden: boolean;
108
+ };
109
+ /** A piece of an event in a time-grid day (plan 05 §2.2). */
110
+ export type TimeGridSegment<TEvent extends CalendarEventInput = CalendarEventInput> = EventSegmentBase<TEvent> & {
111
+ dayKey: string;
112
+ /** Fractions 0–1 of the visible axis. */
113
+ top: number;
114
+ height: number;
115
+ column: number;
116
+ columns: number;
117
+ span: number;
118
+ };
119
+ /** A piece of an event in the time-grid all-day row (plan 05 §2.4). */
120
+ export type AllDayRowSegment<TEvent extends CalendarEventInput = CalendarEventInput> = EventSegmentBase<TEvent> & {
121
+ /** ISO date of the first covered day. */
122
+ dayKey: string;
123
+ startColumn: number;
124
+ days: number;
125
+ lane: number;
126
+ hidden: boolean;
127
+ };
128
+ /** One event of one agenda day (plan 05 §2.2). */
129
+ export type AgendaItem<TEvent extends CalendarEventInput = CalendarEventInput> = EventSegmentBase<TEvent> & {
130
+ dayKey: string;
131
+ };
132
+ /** A proposed range creation (plan 05 E14, §2.6). */
133
+ export type SelectionProposal = {
134
+ kind: "create";
135
+ start: PlainDateTime | ZonedDateTime | PlainDate;
136
+ end: PlainDateTime | ZonedDateTime | PlainDate;
137
+ allDay: boolean;
138
+ source: "pointer" | "keyboard";
139
+ };
140
+ /** The segments of the active layout (plan 05 §2.6). */
141
+ export type CalendarEvents<TEvent extends CalendarEventInput = CalendarEventInput> = MonthSegment<TEvent>[] | TimeGridSegment<TEvent>[] | AgendaItem<TEvent>[];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,70 @@
1
+ export { type CustomViews, type ViewDefinition, type ViewLayout, type ViewLength, getBuiltInViews, getMonthCount, resolveView, resolveViews, } from "./navigation/view-definition.js";
2
+ export { getRange, getVisibleRange } from "./navigation/range.js";
3
+ export type { RangeContext } from "./navigation/range.js";
4
+ export { canNavigate, firstVisibleDay, getDefinition, getHiddenDays, navigate, } from "./navigation/navigate.js";
5
+ export type { NavigationAction, NavigationContext, NavigationState, } from "./navigation/navigate.js";
6
+ export { getCalendarTitle } from "./navigation/title.js";
7
+ export type { CalendarTitle } from "./navigation/title.js";
8
+ export type { CalendarDay, DayContext } from "./views/day.js";
9
+ export { getMonthLayout } from "./views/month-layout.js";
10
+ export type { CalendarWeek, LayoutContext, MonthGridModel, MonthLayout, } from "./views/month-layout.js";
11
+ export { getTimeGridLayout } from "./views/time-grid-layout.js";
12
+ export type { TimeGridLayout, TimeGridOptions, } from "./views/time-grid-layout.js";
13
+ export { getListLayout } from "./views/list-layout.js";
14
+ export type { ListLayout } from "./views/list-layout.js";
15
+ export { getMiniCalendarLayout } from "./views/mini-calendar.js";
16
+ export type { MiniCalendarLayoutOptions } from "./views/mini-calendar.js";
17
+ export { createCalendarController } from "./controllers/calendar-controller.js";
18
+ export type { CalendarController, CalendarLayout, CalendarMessages, CalendarOptions, CalendarState, } from "./controllers/calendar-controller.js";
19
+ export { createMiniCalendarController } from "./controllers/mini-calendar-controller.js";
20
+ export type { MiniCalendarController, MiniCalendarOptions, MiniCalendarState, MonthValue, } from "./controllers/mini-calendar-controller.js";
21
+ export type { Modifiers } from "./controllers/shared.js";
22
+ export { normalizeEvents, coveredDays, wallSecondsOf, } from "./events/normalize.js";
23
+ export type { NormalizeOptions } from "./events/normalize.js";
24
+ export { compareEventIds, compareMonthSegments } from "./events/sort.js";
25
+ export type { SortableSegment } from "./events/sort.js";
26
+ export { layoutMonthEvents } from "./events/month-layout.js";
27
+ export type { MonthLayoutEventsOptions } from "./events/month-layout.js";
28
+ export { layoutAllDayRow } from "./events/all-day-row.js";
29
+ export type { AllDayRowOptions } from "./events/all-day-row.js";
30
+ export { layoutTimeGridEvents } from "./events/time-grid-layout.js";
31
+ export type { TimeGridEventsOptions } from "./events/time-grid-layout.js";
32
+ export { getNowIndicator } from "./events/now-indicator.js";
33
+ export type { NowIndicator, NowIndicatorDay } from "./events/now-indicator.js";
34
+ export { layoutAgenda } from "./events/agenda-layout.js";
35
+ export type { AgendaDay, AgendaOptions } from "./events/agenda-layout.js";
36
+ export { enterCell, isExitKey, stepFocus } from "./interaction/event-focus.js";
37
+ export type { FocusItems, FocusMode, FocusState, } from "./interaction/event-focus.js";
38
+ export { computeSelection, selectionPieces } from "./interaction/selection.js";
39
+ export type { SelectionCell, SelectionOptions, SelectionRange, } from "./interaction/selection.js";
40
+ export { applyEventLimit, applyPieceLimit } from "./events/overflow.js";
41
+ export type { DayOverflow, OverflowResult } from "./events/overflow.js";
42
+ export type { AgendaItem, AllDayRowSegment, CalendarEventInput, CalendarEvents, EventId, EventSegmentBase, MonthEventLayout, MonthSegment, NormalizedEvent, SelectionProposal, TimeGridSegment, } from "./events/types.js";
43
+ export { autoScrollSpeed, createAutoScroll, } from "./interaction/auto-scroll.js";
44
+ export type { AutoScroll } from "./interaction/auto-scroll.js";
45
+ export { moveEvent, nudgeEvent, resizeEvent, snapTo, } from "./interaction/drag-geometry.js";
46
+ export type { DragTarget, EditValue, GeometryOptions, Grab, } from "./interaction/drag-geometry.js";
47
+ export { editStep, matchShortcut } from "./interaction/drag-keyboard.js";
48
+ export type { EditKind, KeyStep, Shortcuts, } from "./interaction/drag-keyboard.js";
49
+ export type { PendingChange } from "./interaction/pending.js";
50
+ export type { ChangeValue, DragState, EventChangeProposal, } from "./controllers/drag-engine.js";
51
+ export { resourceViews } from "./resources/views.js";
52
+ export { resourceCellKey } from "./resources/keys.js";
53
+ export { buildResourceTree } from "./resources/tree.js";
54
+ export { layoutResourceTimeGrid } from "./resources/resource-time-grid.js";
55
+ export { layoutTimeline } from "./resources/timeline-layout.js";
56
+ export { buildTimelineAxis, slotKeyOf } from "./resources/timeline-axis.js";
57
+ export { clampWindow } from "./resources/windowing.js";
58
+ export { zoomTarget } from "./navigation/zoom.js";
59
+ export type { ResourceAllDayPiece, ResourceBuildContext, ResourceColumn, ResourceGrouping, ResourceGroupHeader, ResourceId, ResourceInput, ResourceLayout, ResourceRow, ResourceTimeGridLayout, ResourceTimeGridPiece, ResourceWindowInfo, TimelineAxis, TimelineHeaderCell, TimelineLayout, TimelinePiece, TimelineRow, TimelineSlot, TimelineSlotDuration, TimelineUnit, WindowRange, } from "./resources/types.js";
60
+ export type { ResourcePieceLike } from "./controllers/calendar-controller.js";
61
+ export { availabilityFromEvents, resolveCalendarAvailability, wallIso, } from "./availability.js";
62
+ export type { AvailabilityContext, AvailabilityFromEventsOptions, CalendarAvailabilityInput, } from "./availability.js";
63
+ export { backgroundAttributes, layoutBackgrounds, layoutTimelineBackgrounds, } from "./events/background-layout.js";
64
+ export type { BackgroundDay, BackgroundLayoutOptions, BackgroundMode, BackgroundPiece, BackgroundStatus, TimelineBackgroundOptions, TimelineBackgroundPiece, } from "./events/background-layout.js";
65
+ export { parseRRule, stringifyRRule } from "./recurrence/rrule.js";
66
+ export { expandRecurrence } from "./recurrence/series.js";
67
+ export { recurrence } from "./recurrence/pack.js";
68
+ export { applyRecurrenceChange, applyRecurrenceDelete, } from "./recurrence/apply.js";
69
+ export type { ApplyRecurrenceOptions, RecurrenceChangeResult, RecurrenceDeleteResult, RecurrenceOverride, RecurrenceScope, } from "./recurrence/apply.js";
70
+ export type { RRule, RRuleByDay, RRuleError, RRuleErrorCode, RRuleFreq, RRuleUntil, RecurrenceErrorHandler, RecurrenceExpandOptions, RecurrenceInfo, RecurrenceOccurrence, RecurrencePack, } from "./recurrence/types.js";
@@ -0,0 +1,37 @@
1
+ export { getBuiltInViews, getMonthCount, resolveView, resolveViews, } from "./navigation/view-definition.js";
2
+ export { getRange, getVisibleRange } from "./navigation/range.js";
3
+ export { canNavigate, firstVisibleDay, getDefinition, getHiddenDays, navigate, } from "./navigation/navigate.js";
4
+ export { getCalendarTitle } from "./navigation/title.js";
5
+ export { getMonthLayout } from "./views/month-layout.js";
6
+ export { getTimeGridLayout } from "./views/time-grid-layout.js";
7
+ export { getListLayout } from "./views/list-layout.js";
8
+ export { getMiniCalendarLayout } from "./views/mini-calendar.js";
9
+ export { createCalendarController } from "./controllers/calendar-controller.js";
10
+ export { createMiniCalendarController } from "./controllers/mini-calendar-controller.js";
11
+ export { normalizeEvents, coveredDays, wallSecondsOf, } from "./events/normalize.js";
12
+ export { compareEventIds, compareMonthSegments } from "./events/sort.js";
13
+ export { layoutMonthEvents } from "./events/month-layout.js";
14
+ export { layoutAllDayRow } from "./events/all-day-row.js";
15
+ export { layoutTimeGridEvents } from "./events/time-grid-layout.js";
16
+ export { getNowIndicator } from "./events/now-indicator.js";
17
+ export { layoutAgenda } from "./events/agenda-layout.js";
18
+ export { enterCell, isExitKey, stepFocus } from "./interaction/event-focus.js";
19
+ export { computeSelection, selectionPieces } from "./interaction/selection.js";
20
+ export { applyEventLimit, applyPieceLimit } from "./events/overflow.js";
21
+ export { autoScrollSpeed, createAutoScroll, } from "./interaction/auto-scroll.js";
22
+ export { moveEvent, nudgeEvent, resizeEvent, snapTo, } from "./interaction/drag-geometry.js";
23
+ export { editStep, matchShortcut } from "./interaction/drag-keyboard.js";
24
+ export { resourceViews } from "./resources/views.js";
25
+ export { resourceCellKey } from "./resources/keys.js";
26
+ export { buildResourceTree } from "./resources/tree.js";
27
+ export { layoutResourceTimeGrid } from "./resources/resource-time-grid.js";
28
+ export { layoutTimeline } from "./resources/timeline-layout.js";
29
+ export { buildTimelineAxis, slotKeyOf } from "./resources/timeline-axis.js";
30
+ export { clampWindow } from "./resources/windowing.js";
31
+ export { zoomTarget } from "./navigation/zoom.js";
32
+ export { availabilityFromEvents, resolveCalendarAvailability, wallIso, } from "./availability.js";
33
+ export { backgroundAttributes, layoutBackgrounds, layoutTimelineBackgrounds, } from "./events/background-layout.js";
34
+ export { parseRRule, stringifyRRule } from "./recurrence/rrule.js";
35
+ export { expandRecurrence } from "./recurrence/series.js";
36
+ export { recurrence } from "./recurrence/pack.js";
37
+ export { applyRecurrenceChange, applyRecurrenceDelete, } from "./recurrence/apply.js";
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Auto-scroll while a drag is near an edge of the scroll container (plan 09 M12).
3
+ * `speed(d) = d >= 40 ? 0 : round(20 · (1 − d / 40))` pixels per frame.
4
+ */
5
+ export declare const EDGE = 40;
6
+ export declare const MAX_SPEED = 20;
7
+ export declare function autoScrollSpeed(distance: number): number;
8
+ export type AutoScroll = {
9
+ /** Start the loop for the pointer position; call again to move the point. */
10
+ update(point: {
11
+ x: number;
12
+ y: number;
13
+ }): void;
14
+ stop(): void;
15
+ };
16
+ /** The nearest scrollable ancestor of `element`, or `null`. */
17
+ export declare function scrollParent(element: Element | null): HTMLElement | null;
18
+ /** A rAF loop that scrolls `getContainer()` toward the pointer; stops when asked. */
19
+ export declare function createAutoScroll(getContainer: () => HTMLElement | null): AutoScroll;
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Auto-scroll while a drag is near an edge of the scroll container (plan 09 M12).
3
+ * `speed(d) = d >= 40 ? 0 : round(20 · (1 − d / 40))` pixels per frame.
4
+ */
5
+ export const EDGE = 40;
6
+ export const MAX_SPEED = 20;
7
+ export function autoScrollSpeed(distance) {
8
+ const d = Math.max(0, distance);
9
+ return d >= EDGE ? 0 : Math.round(MAX_SPEED * (1 - d / EDGE));
10
+ }
11
+ const hasFrames = typeof requestAnimationFrame === "function";
12
+ const frame = (callback) => hasFrames
13
+ ? requestAnimationFrame(callback)
14
+ : setTimeout(callback, 16);
15
+ const unframe = (handle) => hasFrames
16
+ ? cancelAnimationFrame(handle)
17
+ : clearTimeout(handle);
18
+ /** The nearest scrollable ancestor of `element`, or `null`. */
19
+ export function scrollParent(element) {
20
+ let node = element?.parentElement ?? null;
21
+ while (node) {
22
+ const style = getComputedStyle(node);
23
+ if (/(auto|scroll)/.test(`${style.overflowY} ${style.overflowX}`)) {
24
+ return node;
25
+ }
26
+ node = node.parentElement;
27
+ }
28
+ return null;
29
+ }
30
+ /** A rAF loop that scrolls `getContainer()` toward the pointer; stops when asked. */
31
+ export function createAutoScroll(getContainer) {
32
+ let point = null;
33
+ let handle = 0;
34
+ const tick = () => {
35
+ handle = 0;
36
+ const container = getContainer();
37
+ if (!point || !container)
38
+ return;
39
+ const rect = container.getBoundingClientRect();
40
+ const dy = autoScrollSpeed(point.y - rect.top) * -1 +
41
+ autoScrollSpeed(rect.bottom - point.y);
42
+ const dx = autoScrollSpeed(point.x - rect.left) * -1 +
43
+ autoScrollSpeed(rect.right - point.x);
44
+ if (dx !== 0 || dy !== 0) {
45
+ container.scrollLeft += dx;
46
+ container.scrollTop += dy;
47
+ }
48
+ handle = frame(tick);
49
+ };
50
+ return {
51
+ update(next) {
52
+ point = next;
53
+ if (handle === 0)
54
+ handle = frame(tick);
55
+ },
56
+ stop() {
57
+ point = null;
58
+ if (handle !== 0) {
59
+ unframe(handle);
60
+ handle = 0;
61
+ }
62
+ },
63
+ };
64
+ }
@@ -0,0 +1,52 @@
1
+ import { type PlainDate, type PlainDateTime, type PlainTime } from "../../foundation/index.js";
2
+ /** An event position in display-zone wall time; all-day ends are exclusive midnights (plan 05 E3). */
3
+ export type EditValue = {
4
+ start: PlainDateTime;
5
+ end: PlainDateTime;
6
+ allDay: boolean;
7
+ };
8
+ /** Where the pointer is: a day, a time-grid slot, or the all-day row. */
9
+ export type DragTarget = {
10
+ date: PlainDate;
11
+ /** Start of the slot under the pointer (time grid). */
12
+ time?: PlainTime;
13
+ allDayRow?: boolean;
14
+ };
15
+ /** What part of the event the pointer grabbed (plan 09 §13.2). */
16
+ export type Grab = {
17
+ /** Month / all-day row: which day of the event, 0-based. */
18
+ dayOffset: number;
19
+ /** Time grid: minutes from the event's start to the grabbed slot. */
20
+ minuteOffset: number;
21
+ };
22
+ export type GeometryOptions = {
23
+ view: "month" | "time-grid";
24
+ /** Minutes. */
25
+ snap: number;
26
+ /** The grid's slot length in minutes (a resize to a slot reaches the slot's end). */
27
+ slot: number;
28
+ allowAllDayConversion: boolean;
29
+ /** Minutes. */
30
+ defaultTimedDuration: number;
31
+ };
32
+ export declare const toSeconds: (value: PlainDateTime) => number;
33
+ export declare function fromSeconds(seconds: number): PlainDateTime;
34
+ /** Nearest multiple of `size`; an exact tie rounds up (plan 09 §13.2). */
35
+ export declare const snapTo: (seconds: number, size: number) => number;
36
+ /** How far into the event (in days / minutes) the press happened. */
37
+ export declare function grabOf(value: EditValue, target: DragTarget): Grab;
38
+ /**
39
+ * Move an event so the grabbed part follows the pointer (plan 09 M4, M6). Returns
40
+ * `null` when the target is not allowed (all-day conversion switched off).
41
+ */
42
+ export declare function moveEvent(from: EditValue, grab: Grab, target: DragTarget, options: GeometryOptions): EditValue | null;
43
+ /**
44
+ * Move one edge to the pointer (plan 09 M5). The edge never crosses the other one:
45
+ * it stops one snap unit (one day for all-day) away.
46
+ */
47
+ export declare function resizeEvent(from: EditValue, edge: "start" | "end", target: DragTarget, options: GeometryOptions): EditValue;
48
+ /** A keyboard step (plan 09 M10): shift by days and minutes. */
49
+ export declare function nudgeEvent(from: EditValue, kind: "move" | "resize-start" | "resize-end", step: {
50
+ days: number;
51
+ minutes: number;
52
+ }, options: GeometryOptions): EditValue;