@zealakit/chrono-react 0.0.0-stage → 1.0.0-beta.2

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 (363) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +625 -2
  3. package/dist/calendar/components.d.ts +346 -0
  4. package/dist/calendar/components.js +243 -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 +51 -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 +154 -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 +193 -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 +164 -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/defined-options.d.ts +18 -0
  52. package/dist/shared/defined-options.js +9 -0
  53. package/dist/shared/merge-props.d.ts +9 -0
  54. package/dist/shared/merge-props.js +31 -0
  55. package/dist/shared/modifiers.d.ts +7 -0
  56. package/dist/shared/modifiers.js +6 -0
  57. package/dist/shared/part.d.ts +10 -0
  58. package/dist/shared/part.js +9 -0
  59. package/dist/shared/slot.d.ts +12 -0
  60. package/dist/shared/slot.js +57 -0
  61. package/dist/shared/style-properties.d.ts +8 -0
  62. package/dist/shared/style-properties.js +13 -0
  63. package/dist/shared/to-react-props.d.ts +11 -0
  64. package/dist/shared/to-react-props.js +27 -0
  65. package/dist/time/bind-panel.d.ts +19 -0
  66. package/dist/time/bind-panel.js +97 -0
  67. package/dist/time/components.d.ts +183 -0
  68. package/dist/time/components.js +169 -0
  69. package/dist/time/context.d.ts +24 -0
  70. package/dist/time/context.js +19 -0
  71. package/dist/time/index.d.ts +4 -0
  72. package/dist/time/index.js +4 -0
  73. package/dist/time/options.d.ts +5 -0
  74. package/dist/time/options.js +85 -0
  75. package/dist/time/use-time-input.d.ts +43 -0
  76. package/dist/time/use-time-input.js +138 -0
  77. package/dist/time/use-time-panel.d.ts +37 -0
  78. package/dist/time/use-time-panel.js +18 -0
  79. package/dist/time/utilities.d.ts +4 -0
  80. package/dist/time/utilities.js +4 -0
  81. package/dist/vendor/core/calendar/availability.d.ts +39 -0
  82. package/dist/vendor/core/calendar/availability.js +73 -0
  83. package/dist/vendor/core/calendar/controllers/calendar-controller.d.ts +251 -0
  84. package/dist/vendor/core/calendar/controllers/calendar-controller.js +1396 -0
  85. package/dist/vendor/core/calendar/controllers/drag-engine.d.ts +99 -0
  86. package/dist/vendor/core/calendar/controllers/drag-engine.js +363 -0
  87. package/dist/vendor/core/calendar/controllers/mini-calendar-controller.d.ts +66 -0
  88. package/dist/vendor/core/calendar/controllers/mini-calendar-controller.js +171 -0
  89. package/dist/vendor/core/calendar/controllers/shared.d.ts +33 -0
  90. package/dist/vendor/core/calendar/controllers/shared.js +82 -0
  91. package/dist/vendor/core/calendar/events/agenda-layout.d.ts +21 -0
  92. package/dist/vendor/core/calendar/events/agenda-layout.js +72 -0
  93. package/dist/vendor/core/calendar/events/all-day-row.d.ts +22 -0
  94. package/dist/vendor/core/calendar/events/all-day-row.js +93 -0
  95. package/dist/vendor/core/calendar/events/background-layout.d.ts +66 -0
  96. package/dist/vendor/core/calendar/events/background-layout.js +106 -0
  97. package/dist/vendor/core/calendar/events/index.d.ts +17 -0
  98. package/dist/vendor/core/calendar/events/index.js +8 -0
  99. package/dist/vendor/core/calendar/events/month-layout.d.ts +13 -0
  100. package/dist/vendor/core/calendar/events/month-layout.js +157 -0
  101. package/dist/vendor/core/calendar/events/normalize.d.ts +33 -0
  102. package/dist/vendor/core/calendar/events/normalize.js +156 -0
  103. package/dist/vendor/core/calendar/events/now-indicator.d.ts +18 -0
  104. package/dist/vendor/core/calendar/events/now-indicator.js +19 -0
  105. package/dist/vendor/core/calendar/events/overflow.d.ts +36 -0
  106. package/dist/vendor/core/calendar/events/overflow.js +112 -0
  107. package/dist/vendor/core/calendar/events/sort.d.ts +21 -0
  108. package/dist/vendor/core/calendar/events/sort.js +35 -0
  109. package/dist/vendor/core/calendar/events/time-grid-layout.d.ts +22 -0
  110. package/dist/vendor/core/calendar/events/time-grid-layout.js +177 -0
  111. package/dist/vendor/core/calendar/events/types.d.ts +141 -0
  112. package/dist/vendor/core/calendar/events/types.js +1 -0
  113. package/dist/vendor/core/calendar/index.d.ts +70 -0
  114. package/dist/vendor/core/calendar/index.js +37 -0
  115. package/dist/vendor/core/calendar/interaction/auto-scroll.d.ts +11 -0
  116. package/dist/vendor/core/calendar/interaction/auto-scroll.js +37 -0
  117. package/dist/vendor/core/calendar/interaction/drag-geometry.d.ts +52 -0
  118. package/dist/vendor/core/calendar/interaction/drag-geometry.js +122 -0
  119. package/dist/vendor/core/calendar/interaction/drag-keyboard.d.ts +38 -0
  120. package/dist/vendor/core/calendar/interaction/drag-keyboard.js +53 -0
  121. package/dist/vendor/core/calendar/interaction/drag-pointer.d.ts +24 -0
  122. package/dist/vendor/core/calendar/interaction/drag-pointer.js +43 -0
  123. package/dist/vendor/core/calendar/interaction/event-focus.d.ts +28 -0
  124. package/dist/vendor/core/calendar/interaction/event-focus.js +44 -0
  125. package/dist/vendor/core/calendar/interaction/gesture-handle.d.ts +17 -0
  126. package/dist/vendor/core/calendar/interaction/gesture-handle.js +26 -0
  127. package/dist/vendor/core/calendar/interaction/hit-test.d.ts +17 -0
  128. package/dist/vendor/core/calendar/interaction/hit-test.js +26 -0
  129. package/dist/vendor/core/calendar/interaction/pending.d.ts +17 -0
  130. package/dist/vendor/core/calendar/interaction/pending.js +17 -0
  131. package/dist/vendor/core/calendar/interaction/pointer.d.ts +21 -0
  132. package/dist/vendor/core/calendar/interaction/pointer.js +169 -0
  133. package/dist/vendor/core/calendar/interaction/selection.d.ts +29 -0
  134. package/dist/vendor/core/calendar/interaction/selection.js +47 -0
  135. package/dist/vendor/core/calendar/internal/equal.d.ts +3 -0
  136. package/dist/vendor/core/calendar/internal/equal.js +43 -0
  137. package/dist/vendor/core/calendar/navigation/navigate.d.ts +33 -0
  138. package/dist/vendor/core/calendar/navigation/navigate.js +81 -0
  139. package/dist/vendor/core/calendar/navigation/range.d.ts +15 -0
  140. package/dist/vendor/core/calendar/navigation/range.js +52 -0
  141. package/dist/vendor/core/calendar/navigation/title.d.ts +12 -0
  142. package/dist/vendor/core/calendar/navigation/title.js +39 -0
  143. package/dist/vendor/core/calendar/navigation/view-definition.d.ts +39 -0
  144. package/dist/vendor/core/calendar/navigation/view-definition.js +62 -0
  145. package/dist/vendor/core/calendar/navigation/zoom.d.ts +5 -0
  146. package/dist/vendor/core/calendar/navigation/zoom.js +11 -0
  147. package/dist/vendor/core/calendar/recurrence/apply.d.ts +50 -0
  148. package/dist/vendor/core/calendar/recurrence/apply.js +206 -0
  149. package/dist/vendor/core/calendar/recurrence/expand.d.ts +27 -0
  150. package/dist/vendor/core/calendar/recurrence/expand.js +298 -0
  151. package/dist/vendor/core/calendar/recurrence/pack.d.ts +3 -0
  152. package/dist/vendor/core/calendar/recurrence/pack.js +248 -0
  153. package/dist/vendor/core/calendar/recurrence/rrule-types.d.ts +30 -0
  154. package/dist/vendor/core/calendar/recurrence/rrule-types.js +8 -0
  155. package/dist/vendor/core/calendar/recurrence/rrule.d.ts +12 -0
  156. package/dist/vendor/core/calendar/recurrence/rrule.js +278 -0
  157. package/dist/vendor/core/calendar/recurrence/series.d.ts +25 -0
  158. package/dist/vendor/core/calendar/recurrence/series.js +163 -0
  159. package/dist/vendor/core/calendar/recurrence/types.d.ts +30 -0
  160. package/dist/vendor/core/calendar/recurrence/types.js +1 -0
  161. package/dist/vendor/core/calendar/resources/keys.d.ts +2 -0
  162. package/dist/vendor/core/calendar/resources/keys.js +2 -0
  163. package/dist/vendor/core/calendar/resources/resource-time-grid.d.ts +7 -0
  164. package/dist/vendor/core/calendar/resources/resource-time-grid.js +129 -0
  165. package/dist/vendor/core/calendar/resources/timeline-axis.d.ts +10 -0
  166. package/dist/vendor/core/calendar/resources/timeline-axis.js +98 -0
  167. package/dist/vendor/core/calendar/resources/timeline-layout.d.ts +7 -0
  168. package/dist/vendor/core/calendar/resources/timeline-layout.js +109 -0
  169. package/dist/vendor/core/calendar/resources/tree.d.ts +10 -0
  170. package/dist/vendor/core/calendar/resources/tree.js +86 -0
  171. package/dist/vendor/core/calendar/resources/types.d.ts +177 -0
  172. package/dist/vendor/core/calendar/resources/types.js +1 -0
  173. package/dist/vendor/core/calendar/resources/views.d.ts +7 -0
  174. package/dist/vendor/core/calendar/resources/views.js +45 -0
  175. package/dist/vendor/core/calendar/resources/windowing.d.ts +11 -0
  176. package/dist/vendor/core/calendar/resources/windowing.js +17 -0
  177. package/dist/vendor/core/calendar/views/day.d.ts +37 -0
  178. package/dist/vendor/core/calendar/views/day.js +36 -0
  179. package/dist/vendor/core/calendar/views/list-layout.d.ts +8 -0
  180. package/dist/vendor/core/calendar/views/list-layout.js +5 -0
  181. package/dist/vendor/core/calendar/views/mini-calendar.d.ts +23 -0
  182. package/dist/vendor/core/calendar/views/mini-calendar.js +31 -0
  183. package/dist/vendor/core/calendar/views/month-layout.d.ts +30 -0
  184. package/dist/vendor/core/calendar/views/month-layout.js +63 -0
  185. package/dist/vendor/core/calendar/views/time-grid-layout.d.ts +26 -0
  186. package/dist/vendor/core/calendar/views/time-grid-layout.js +27 -0
  187. package/dist/vendor/core/date/index.d.ts +9 -0
  188. package/dist/vendor/core/date/index.js +9 -0
  189. package/dist/vendor/core/date/input/date-input-controller.d.ts +97 -0
  190. package/dist/vendor/core/date/input/date-input-controller.js +466 -0
  191. package/dist/vendor/core/date/input/date-range-input-controller.d.ts +43 -0
  192. package/dist/vendor/core/date/input/date-range-input-controller.js +186 -0
  193. package/dist/vendor/core/date/input/parse.d.ts +22 -0
  194. package/dist/vendor/core/date/input/parse.js +78 -0
  195. package/dist/vendor/core/date/input/validity.d.ts +6 -0
  196. package/dist/vendor/core/date/input/validity.js +13 -0
  197. package/dist/vendor/core/date/panel/panel-controller.d.ts +176 -0
  198. package/dist/vendor/core/date/panel/panel-controller.js +704 -0
  199. package/dist/vendor/core/date/presets.d.ts +22 -0
  200. package/dist/vendor/core/date/presets.js +103 -0
  201. package/dist/vendor/core/date/selection/multiple.d.ts +7 -0
  202. package/dist/vendor/core/date/selection/multiple.js +29 -0
  203. package/dist/vendor/core/date/selection/range.d.ts +29 -0
  204. package/dist/vendor/core/date/selection/range.js +35 -0
  205. package/dist/vendor/core/date/types.d.ts +12 -0
  206. package/dist/vendor/core/date/types.js +1 -0
  207. package/dist/vendor/core/datetime/compose.d.ts +24 -0
  208. package/dist/vendor/core/datetime/compose.js +49 -0
  209. package/dist/vendor/core/datetime/constraints.d.ts +42 -0
  210. package/dist/vendor/core/datetime/constraints.js +56 -0
  211. package/dist/vendor/core/datetime/index.d.ts +9 -0
  212. package/dist/vendor/core/datetime/index.js +9 -0
  213. package/dist/vendor/core/datetime/input/datetime-input-controller.d.ts +96 -0
  214. package/dist/vendor/core/datetime/input/datetime-input-controller.js +380 -0
  215. package/dist/vendor/core/datetime/input/datetime-range-input-controller.d.ts +46 -0
  216. package/dist/vendor/core/datetime/input/datetime-range-input-controller.js +171 -0
  217. package/dist/vendor/core/datetime/input/parse.d.ts +20 -0
  218. package/dist/vendor/core/datetime/input/parse.js +56 -0
  219. package/dist/vendor/core/datetime/panel/controller.d.ts +64 -0
  220. package/dist/vendor/core/datetime/panel/controller.js +191 -0
  221. package/dist/vendor/core/datetime/panel/range-controller.d.ts +71 -0
  222. package/dist/vendor/core/datetime/panel/range-controller.js +205 -0
  223. package/dist/vendor/core/datetime/types.d.ts +12 -0
  224. package/dist/vendor/core/datetime/types.js +1 -0
  225. package/dist/vendor/core/datetime/zone/day-instants.d.ts +19 -0
  226. package/dist/vendor/core/datetime/zone/day-instants.js +52 -0
  227. package/dist/vendor/core/datetime/zone/resolve.d.ts +16 -0
  228. package/dist/vendor/core/datetime/zone/resolve.js +24 -0
  229. package/dist/vendor/core/dom/auto-scroll.d.ts +37 -0
  230. package/dist/vendor/core/dom/auto-scroll.js +57 -0
  231. package/dist/vendor/core/dom/drag-session.d.ts +25 -0
  232. package/dist/vendor/core/dom/drag-session.js +257 -0
  233. package/dist/vendor/core/foundation/a11y/announcer.d.ts +12 -0
  234. package/dist/vendor/core/foundation/a11y/announcer.js +24 -0
  235. package/dist/vendor/core/foundation/a11y/grid-navigation.d.ts +19 -0
  236. package/dist/vendor/core/foundation/a11y/grid-navigation.js +76 -0
  237. package/dist/vendor/core/foundation/a11y/index.d.ts +8 -0
  238. package/dist/vendor/core/foundation/a11y/index.js +5 -0
  239. package/dist/vendor/core/foundation/a11y/labels.d.ts +21 -0
  240. package/dist/vendor/core/foundation/a11y/labels.js +43 -0
  241. package/dist/vendor/core/foundation/a11y/messages.d.ts +80 -0
  242. package/dist/vendor/core/foundation/a11y/messages.js +74 -0
  243. package/dist/vendor/core/foundation/a11y/roving-focus.d.ts +18 -0
  244. package/dist/vendor/core/foundation/a11y/roving-focus.js +73 -0
  245. package/dist/vendor/core/foundation/constraints/availability-rules.d.ts +52 -0
  246. package/dist/vendor/core/foundation/constraints/availability-rules.js +64 -0
  247. package/dist/vendor/core/foundation/constraints/availability.d.ts +93 -0
  248. package/dist/vendor/core/foundation/constraints/availability.js +480 -0
  249. package/dist/vendor/core/foundation/constraints/date.d.ts +21 -0
  250. package/dist/vendor/core/foundation/constraints/date.js +41 -0
  251. package/dist/vendor/core/foundation/constraints/index.d.ts +9 -0
  252. package/dist/vendor/core/foundation/constraints/index.js +4 -0
  253. package/dist/vendor/core/foundation/constraints/range.d.ts +44 -0
  254. package/dist/vendor/core/foundation/constraints/range.js +70 -0
  255. package/dist/vendor/core/foundation/constraints/time.d.ts +30 -0
  256. package/dist/vendor/core/foundation/constraints/time.js +56 -0
  257. package/dist/vendor/core/foundation/grid/index.d.ts +8 -0
  258. package/dist/vendor/core/foundation/grid/index.js +4 -0
  259. package/dist/vendor/core/foundation/grid/month-grid.d.ts +33 -0
  260. package/dist/vendor/core/foundation/grid/month-grid.js +52 -0
  261. package/dist/vendor/core/foundation/grid/time-axis.d.ts +25 -0
  262. package/dist/vendor/core/foundation/grid/time-axis.js +32 -0
  263. package/dist/vendor/core/foundation/grid/weekday-headers.d.ts +17 -0
  264. package/dist/vendor/core/foundation/grid/weekday-headers.js +26 -0
  265. package/dist/vendor/core/foundation/grid/year-grid.d.ts +29 -0
  266. package/dist/vendor/core/foundation/grid/year-grid.js +40 -0
  267. package/dist/vendor/core/foundation/index.d.ts +8 -0
  268. package/dist/vendor/core/foundation/index.js +8 -0
  269. package/dist/vendor/core/foundation/input/form.d.ts +7 -0
  270. package/dist/vendor/core/foundation/input/form.js +10 -0
  271. package/dist/vendor/core/foundation/input/index.d.ts +6 -0
  272. package/dist/vendor/core/foundation/input/index.js +3 -0
  273. package/dist/vendor/core/foundation/input/segment-engine.d.ts +33 -0
  274. package/dist/vendor/core/foundation/input/segment-engine.js +45 -0
  275. package/dist/vendor/core/foundation/input/tokenize.d.ts +19 -0
  276. package/dist/vendor/core/foundation/input/tokenize.js +24 -0
  277. package/dist/vendor/core/foundation/locale/digits.d.ts +6 -0
  278. package/dist/vendor/core/foundation/locale/digits.js +35 -0
  279. package/dist/vendor/core/foundation/locale/direction.d.ts +1 -0
  280. package/dist/vendor/core/foundation/locale/direction.js +25 -0
  281. package/dist/vendor/core/foundation/locale/format.d.ts +31 -0
  282. package/dist/vendor/core/foundation/locale/format.js +77 -0
  283. package/dist/vendor/core/foundation/locale/hour-cycle.d.ts +12 -0
  284. package/dist/vendor/core/foundation/locale/hour-cycle.js +41 -0
  285. package/dist/vendor/core/foundation/locale/index.d.ts +10 -0
  286. package/dist/vendor/core/foundation/locale/index.js +8 -0
  287. package/dist/vendor/core/foundation/locale/names.d.ts +6 -0
  288. package/dist/vendor/core/foundation/locale/names.js +30 -0
  289. package/dist/vendor/core/foundation/locale/resolve.d.ts +7 -0
  290. package/dist/vendor/core/foundation/locale/resolve.js +39 -0
  291. package/dist/vendor/core/foundation/locale/week-info.d.ts +5 -0
  292. package/dist/vendor/core/foundation/locale/week-info.js +60 -0
  293. package/dist/vendor/core/foundation/locale/zone-label.d.ts +6 -0
  294. package/dist/vendor/core/foundation/locale/zone-label.js +24 -0
  295. package/dist/vendor/core/foundation/ranges/date-range.d.ts +18 -0
  296. package/dist/vendor/core/foundation/ranges/date-range.js +40 -0
  297. package/dist/vendor/core/foundation/ranges/index.d.ts +4 -0
  298. package/dist/vendor/core/foundation/ranges/index.js +2 -0
  299. package/dist/vendor/core/foundation/ranges/interval.d.ts +24 -0
  300. package/dist/vendor/core/foundation/ranges/interval.js +54 -0
  301. package/dist/vendor/core/foundation/store/attributes.d.ts +19 -0
  302. package/dist/vendor/core/foundation/store/attributes.js +43 -0
  303. package/dist/vendor/core/foundation/store/controllable.d.ts +19 -0
  304. package/dist/vendor/core/foundation/store/controllable.js +50 -0
  305. package/dist/vendor/core/foundation/store/env.d.ts +1 -0
  306. package/dist/vendor/core/foundation/store/env.js +3 -0
  307. package/dist/vendor/core/foundation/store/ids.d.ts +9 -0
  308. package/dist/vendor/core/foundation/store/ids.js +12 -0
  309. package/dist/vendor/core/foundation/store/index.d.ts +11 -0
  310. package/dist/vendor/core/foundation/store/index.js +7 -0
  311. package/dist/vendor/core/foundation/store/store.d.ts +7 -0
  312. package/dist/vendor/core/foundation/store/store.js +25 -0
  313. package/dist/vendor/core/foundation/store/ticker.d.ts +11 -0
  314. package/dist/vendor/core/foundation/store/ticker.js +27 -0
  315. package/dist/vendor/core/foundation/store/with-optional.d.ts +15 -0
  316. package/dist/vendor/core/foundation/store/with-optional.js +3 -0
  317. package/dist/vendor/core/foundation/values/clock.d.ts +4 -0
  318. package/dist/vendor/core/foundation/values/clock.js +21 -0
  319. package/dist/vendor/core/foundation/values/compare.d.ts +16 -0
  320. package/dist/vendor/core/foundation/values/compare.js +70 -0
  321. package/dist/vendor/core/foundation/values/convert.d.ts +31 -0
  322. package/dist/vendor/core/foundation/values/convert.js +108 -0
  323. package/dist/vendor/core/foundation/values/epoch-day.d.ts +15 -0
  324. package/dist/vendor/core/foundation/values/epoch-day.js +43 -0
  325. package/dist/vendor/core/foundation/values/index.d.ts +14 -0
  326. package/dist/vendor/core/foundation/values/index.js +10 -0
  327. package/dist/vendor/core/foundation/values/iso.d.ts +24 -0
  328. package/dist/vendor/core/foundation/values/iso.js +111 -0
  329. package/dist/vendor/core/foundation/values/plain-date-time.d.ts +8 -0
  330. package/dist/vendor/core/foundation/values/plain-date-time.js +25 -0
  331. package/dist/vendor/core/foundation/values/plain-date.d.ts +33 -0
  332. package/dist/vendor/core/foundation/values/plain-date.js +105 -0
  333. package/dist/vendor/core/foundation/values/plain-time.d.ts +15 -0
  334. package/dist/vendor/core/foundation/values/plain-time.js +43 -0
  335. package/dist/vendor/core/foundation/values/types.d.ts +37 -0
  336. package/dist/vendor/core/foundation/values/types.js +1 -0
  337. package/dist/vendor/core/foundation/values/week.d.ts +9 -0
  338. package/dist/vendor/core/foundation/values/week.js +31 -0
  339. package/dist/vendor/core/foundation/values/year-month.d.ts +10 -0
  340. package/dist/vendor/core/foundation/values/year-month.js +19 -0
  341. package/dist/vendor/core/foundation/values/zoned.d.ts +16 -0
  342. package/dist/vendor/core/foundation/values/zoned.js +152 -0
  343. package/dist/vendor/core/index.d.ts +5 -0
  344. package/dist/vendor/core/index.js +5 -0
  345. package/dist/vendor/core/time/index.d.ts +8 -0
  346. package/dist/vendor/core/time/index.js +8 -0
  347. package/dist/vendor/core/time/input/parse.d.ts +19 -0
  348. package/dist/vendor/core/time/input/parse.js +82 -0
  349. package/dist/vendor/core/time/input/time-input-controller.d.ts +102 -0
  350. package/dist/vendor/core/time/input/time-input-controller.js +547 -0
  351. package/dist/vendor/core/time/input/time-range-input-controller.d.ts +49 -0
  352. package/dist/vendor/core/time/input/time-range-input-controller.js +178 -0
  353. package/dist/vendor/core/time/input/validity.d.ts +7 -0
  354. package/dist/vendor/core/time/input/validity.js +16 -0
  355. package/dist/vendor/core/time/panel/time-panel-controller.d.ts +163 -0
  356. package/dist/vendor/core/time/panel/time-panel-controller.js +809 -0
  357. package/dist/vendor/core/time/selection/range.d.ts +25 -0
  358. package/dist/vendor/core/time/selection/range.js +35 -0
  359. package/dist/vendor/core/time/selection/slots.d.ts +46 -0
  360. package/dist/vendor/core/time/selection/slots.js +76 -0
  361. package/dist/vendor/core/time/types.d.ts +11 -0
  362. package/dist/vendor/core/time/types.js +1 -0
  363. package/package.json +83 -4
@@ -0,0 +1,178 @@
1
+ import { createControllable, createId, getHiddenInputs, isSameTime, } from "../../foundation/index.js";
2
+ import { checkTimeRangeValue, } from "../selection/range.js";
3
+ import { createTimeInputController, } from "./time-input-controller.js";
4
+ import { isTimeInvalid } from "./validity.js";
5
+ const same = (a, b) => a === b || (a !== null && b !== null && isSameTime(a, b));
6
+ const sameRange = (a, b) => a === b || (a !== null && b !== null && same(a.start, b.start) && same(a.end, b.end));
7
+ const iso = (time, seconds) => time
8
+ ? `${String(time.hour).padStart(2, "0")}:${String(time.minute).padStart(2, "0")}${seconds ? `:${String(time.second).padStart(2, "0")}` : ""}`
9
+ : null;
10
+ export function createTimeRangeInputController(initial = {}) {
11
+ let options = initial;
12
+ const id = options.id ?? createId("chrono-time-range-input");
13
+ const control = createControllable({
14
+ value: options.value,
15
+ defaultValue: options.defaultValue ?? null,
16
+ onChange: (value) => options.onValueChange?.(value),
17
+ equals: sameRange,
18
+ });
19
+ let lastCommitted = control.get();
20
+ const childOptions = () => {
21
+ const { value: _v, defaultValue: _d, onValueChange: _c, onValueCommit: _m, name: _n, startName: _s, endName: _e, allowOvernight: _o, minDuration: _a, maxDuration: _b, ...shared } = options;
22
+ return shared;
23
+ };
24
+ const combine = (start, end) => start === null && end === null ? null : { start, end };
25
+ const setSide = (side, value) => {
26
+ const current = control.get();
27
+ control.set(combine(side === "start" ? value : (current?.start ?? null), side === "end" ? value : (current?.end ?? null)));
28
+ propagate();
29
+ refresh();
30
+ };
31
+ const startController = createTimeInputController({
32
+ ...childOptions(),
33
+ id: `${id}-start`,
34
+ value: control.get()?.start ?? null,
35
+ defaultValue: undefined,
36
+ onValueChange: (value) => setSide("start", value),
37
+ });
38
+ const endController = createTimeInputController({
39
+ ...childOptions(),
40
+ id: `${id}-end`,
41
+ value: control.get()?.end ?? null,
42
+ defaultValue: undefined,
43
+ onValueChange: (value) => setSide("end", value),
44
+ });
45
+ function propagate() {
46
+ const value = control.get();
47
+ startController.setOptions({ value: value?.start ?? null });
48
+ endController.setOptions({ value: value?.end ?? null });
49
+ }
50
+ let state;
51
+ const listeners = new Set();
52
+ const limits = () => ({
53
+ allowOvernight: options.allowOvernight,
54
+ minDuration: options.minDuration,
55
+ maxDuration: options.maxDuration,
56
+ });
57
+ const compute = () => {
58
+ const start = startController.getState();
59
+ const end = endController.getState();
60
+ let validity;
61
+ let duration = null;
62
+ let crossesMidnight = false;
63
+ if (start.validity === "empty" && end.validity === "empty")
64
+ validity = "empty";
65
+ else if (start.validity !== "valid" && start.validity !== "empty")
66
+ validity = start.validity;
67
+ else if (end.validity !== "valid" && end.validity !== "empty")
68
+ validity = end.validity;
69
+ else if (start.validity === "empty" || end.validity === "empty")
70
+ validity = "incomplete";
71
+ else {
72
+ const check = checkTimeRangeValue(start.value, end.value, limits());
73
+ if (check.valid) {
74
+ validity = "valid";
75
+ duration = check.duration;
76
+ crossesMidnight = check.crossesMidnight;
77
+ }
78
+ else {
79
+ validity = check.reason === "start-invalid" ? "disabled" : check.reason;
80
+ }
81
+ }
82
+ const value = control.get();
83
+ const seconds = start.granularity === "second";
84
+ const name = options.name;
85
+ return {
86
+ id,
87
+ value,
88
+ validity,
89
+ start,
90
+ end,
91
+ duration,
92
+ crossesMidnight,
93
+ disabled: start.disabled,
94
+ readOnly: start.readOnly,
95
+ hidden: getHiddenInputs([
96
+ [options.startName ?? (name ? `${name}-start` : undefined), iso(value?.start, seconds)],
97
+ [options.endName ?? (name ? `${name}-end` : undefined), iso(value?.end, seconds)],
98
+ ]),
99
+ messages: start.messages,
100
+ };
101
+ };
102
+ const refresh = () => {
103
+ const next = compute();
104
+ if (state && JSON.stringify(state) === JSON.stringify(next))
105
+ return;
106
+ state = next;
107
+ for (const listener of [...listeners])
108
+ listener(state);
109
+ };
110
+ state = compute();
111
+ startController.subscribe(refresh);
112
+ endController.subscribe(refresh);
113
+ const controller = {
114
+ getState: () => state,
115
+ subscribe(listener) {
116
+ listeners.add(listener);
117
+ return () => {
118
+ listeners.delete(listener);
119
+ };
120
+ },
121
+ setOptions(next) {
122
+ options = { ...options, ...next };
123
+ control.sync({ value: options.value });
124
+ const shared = childOptions();
125
+ startController.setOptions({
126
+ ...shared,
127
+ value: control.get()?.start ?? null,
128
+ });
129
+ endController.setOptions({
130
+ ...shared,
131
+ value: control.get()?.end ?? null,
132
+ });
133
+ refresh();
134
+ },
135
+ getStart: () => startController,
136
+ getEnd: () => endController,
137
+ commit() {
138
+ const value = control.get();
139
+ if (state.validity === "valid" &&
140
+ value?.start &&
141
+ value.end &&
142
+ !sameRange(value, lastCommitted)) {
143
+ lastCommitted = value;
144
+ options.onValueCommit?.({ start: value.start, end: value.end });
145
+ }
146
+ },
147
+ clear() {
148
+ startController.clear();
149
+ endController.clear();
150
+ lastCommitted = null;
151
+ },
152
+ reset() {
153
+ const value = options.defaultValue ?? null;
154
+ control.set(value);
155
+ propagate();
156
+ startController.reset();
157
+ endController.reset();
158
+ lastCommitted = value;
159
+ refresh();
160
+ },
161
+ getRootAttributes: () => ({
162
+ role: "group",
163
+ "data-chrono-time-range-input": true,
164
+ "data-mode": state.start.mode,
165
+ "data-disabled": state.disabled,
166
+ "data-readonly": state.readOnly,
167
+ "data-invalid": isTimeInvalid(state.validity),
168
+ "aria-disabled": state.disabled ? "true" : undefined,
169
+ dir: state.start.direction,
170
+ }),
171
+ destroy() {
172
+ listeners.clear();
173
+ startController.destroy();
174
+ endController.destroy();
175
+ },
176
+ };
177
+ return controller;
178
+ }
@@ -0,0 +1,7 @@
1
+ import { type PlainTime, type TimeConstraints } from "../../foundation/index.js";
2
+ export type TimeValidity = "empty" | "incomplete" | "valid" | "before-min" | "after-max" | "disabled" | "unavailable" | "off-step";
3
+ /** `filled` is how many of the `required` parts hold a value. */
4
+ export declare function getTimeValidity(filled: number, required: number, time: PlainTime | null, constraints: TimeConstraints & {
5
+ isTimeUnavailable?: (time: PlainTime) => boolean;
6
+ }): TimeValidity;
7
+ export declare const isTimeInvalid: (validity: string) => boolean;
@@ -0,0 +1,16 @@
1
+ import { getTimeStatus } from "../../foundation/index.js";
2
+ /** `filled` is how many of the `required` parts hold a value. */
3
+ export function getTimeValidity(filled, required, time, constraints) {
4
+ if (filled === 0)
5
+ return "empty";
6
+ if (filled < required || !time)
7
+ return "incomplete";
8
+ const status = getTimeStatus(time, constraints);
9
+ if (!status.selectable) {
10
+ return status.reason === "disabled-range" || status.reason === "disabled"
11
+ ? "disabled"
12
+ : status.reason;
13
+ }
14
+ return constraints.isTimeUnavailable?.(time) ? "unavailable" : "valid";
15
+ }
16
+ export const isTimeInvalid = (validity) => validity !== "valid" && validity !== "empty";
@@ -0,0 +1,163 @@
1
+ import { type Attributes, type Availability, type AvailabilitySpec, type Messages, type PlainTime, type TimeInput } from "../../foundation/index.js";
2
+ import { type TimeRangeInvalidReason } from "../selection/range.js";
3
+ import { type BookingSlot, type BookingSlotInput } from "../selection/slots.js";
4
+ import type { HourCycle, TimeGranularity, TimePartName, TimeRangeValue, TimeValue } from "../types.js";
5
+ export type TimePanelModifiers = {
6
+ shift: boolean;
7
+ ctrl: boolean;
8
+ meta: boolean;
9
+ };
10
+ export type TimePanelKind = "single" | "range";
11
+ export type TimePanelBaseOptions = {
12
+ id?: string;
13
+ granularity?: TimeGranularity;
14
+ hourCycle?: HourCycle;
15
+ step?: {
16
+ minutes?: number;
17
+ seconds?: number;
18
+ };
19
+ /** List layout: first entry (default 00:00). */
20
+ start?: TimeInput;
21
+ /** List layout: exclusive end (default end of day). */
22
+ end?: TimeInput;
23
+ /** Minutes: each entry becomes a slot `[start, start + slotDuration)`. */
24
+ slotDuration?: number;
25
+ slots?: readonly BookingSlotInput[];
26
+ groupBy?: false | "hour" | "dayPeriod" | ((time: PlainTime) => {
27
+ key: string;
28
+ label: string;
29
+ });
30
+ min?: TimeInput | undefined;
31
+ max?: TimeInput | undefined;
32
+ disabledRanges?: readonly {
33
+ start: TimeInput;
34
+ end: TimeInput;
35
+ }[];
36
+ isTimeDisabled?: ((time: PlainTime) => boolean) | undefined;
37
+ isTimeUnavailable?: ((time: PlainTime) => boolean) | undefined;
38
+ /**
39
+ * Availability model (plan 11 V6, V8). Time-only components use `daily`
40
+ * rules only; other rule types are ignored with a development warning.
41
+ */
42
+ availability?: AvailabilitySpec | Availability;
43
+ scrollToSelected?: boolean;
44
+ autoFocus?: boolean;
45
+ readOnly?: boolean | undefined;
46
+ disabled?: boolean | undefined;
47
+ locale?: string | undefined;
48
+ timeZone?: string | undefined;
49
+ now?: number | undefined;
50
+ messages?: Partial<Messages> | undefined;
51
+ /** Clock for type-ahead (milliseconds). Default `Date.now`. */
52
+ timer?: () => number;
53
+ };
54
+ export type TimePanelOptions = TimePanelBaseOptions & {
55
+ layout?: "columns" | "list";
56
+ value?: TimeValue;
57
+ defaultValue?: TimeValue;
58
+ onValueChange?: (value: TimeValue, info: {
59
+ slot?: BookingSlot;
60
+ }) => void;
61
+ onValueCommit?: ((value: PlainTime, info: {
62
+ slot?: BookingSlot;
63
+ }) => void) | undefined;
64
+ };
65
+ export type TimeRangePanelOptions = TimePanelBaseOptions & {
66
+ layout?: "list" | "columns";
67
+ value?: TimeRangeValue;
68
+ defaultValue?: TimeRangeValue;
69
+ onValueChange?: (value: TimeRangeValue) => void;
70
+ onValueCommit?: (value: {
71
+ start: PlainTime;
72
+ end: PlainTime;
73
+ }) => void;
74
+ onRangePreviewChange?: (preview: {
75
+ start: PlainTime;
76
+ end: PlainTime;
77
+ } | null) => void;
78
+ onInvalidRange?: (reason: TimeRangeInvalidReason) => void;
79
+ allowOvernight?: boolean;
80
+ /** Minutes. */
81
+ minDuration?: number;
82
+ maxDuration?: number;
83
+ };
84
+ export type TimePanelOptionState = {
85
+ key: string;
86
+ text: string;
87
+ label: string;
88
+ /** Columns: the part value; list: seconds since midnight of the start. */
89
+ value: number;
90
+ selected: boolean;
91
+ disabled: boolean;
92
+ unavailable: boolean;
93
+ focused: boolean;
94
+ now: boolean;
95
+ rangeStart: boolean;
96
+ rangeEnd: boolean;
97
+ inRange: boolean;
98
+ preview: boolean;
99
+ blocked: boolean;
100
+ };
101
+ export type TimePanelColumnState = {
102
+ key: string;
103
+ part: TimePartName;
104
+ label: string;
105
+ options: TimePanelOptionState[];
106
+ };
107
+ export type TimePanelSetState = {
108
+ key: "value" | "start" | "end";
109
+ label: string;
110
+ columns: TimePanelColumnState[];
111
+ };
112
+ export type TimePanelGroupState = {
113
+ key: string;
114
+ label: string;
115
+ options: TimePanelOptionState[];
116
+ };
117
+ export type TimePanelState = {
118
+ id: string;
119
+ kind: TimePanelKind;
120
+ layout: "columns" | "list";
121
+ value: TimeValue | TimeRangeValue;
122
+ draft: boolean;
123
+ preview: {
124
+ start: PlainTime;
125
+ end: PlainTime;
126
+ } | null;
127
+ sets: TimePanelSetState[];
128
+ groups: TimePanelGroupState[];
129
+ focusKey: string;
130
+ crossesMidnight: boolean;
131
+ /** Minutes of a complete range. */
132
+ duration: number | null;
133
+ readOnly: boolean;
134
+ disabled: boolean;
135
+ autoFocus: boolean;
136
+ scrollToSelected: boolean;
137
+ direction: "ltr" | "rtl";
138
+ locale?: string;
139
+ messages: Messages;
140
+ };
141
+ export type TimePanelController<V, O> = {
142
+ getState(): TimePanelState;
143
+ subscribe(listener: (state: TimePanelState) => void): () => void;
144
+ setOptions(options: Partial<O>): void;
145
+ getValue(): V;
146
+ getSlot(key: string): BookingSlot | undefined;
147
+ pick(key: string, source: "pointer" | "keyboard"): void;
148
+ setPreview(key: string | null): void;
149
+ cancelDraft(): void;
150
+ clear(): void;
151
+ commit(): void;
152
+ focusOption(key: string): void;
153
+ handleKeyDown(key: string, modifiers: TimePanelModifiers): boolean;
154
+ getRootAttributes(): Attributes;
155
+ getSetAttributes(set: TimePanelSetState): Attributes;
156
+ getColumnAttributes(column: TimePanelColumnState): Attributes;
157
+ getGroupAttributes(group: TimePanelGroupState): Attributes;
158
+ getListAttributes(): Attributes;
159
+ getOptionAttributes(option: TimePanelOptionState): Attributes;
160
+ destroy(): void;
161
+ };
162
+ export declare const createTimePanelController: (options?: TimePanelOptions) => TimePanelController<TimeValue, TimePanelOptions>;
163
+ export declare const createTimeRangePanelController: (options?: TimeRangePanelOptions) => TimePanelController<TimeRangeValue, TimeRangePanelOptions>;