@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,22 @@
1
+ import { type DateRange, type DayOfWeek, type PlainDate } from "../foundation/index.js";
2
+ export type PresetContext = {
3
+ today: PlainDate;
4
+ weekStartsOn?: DayOfWeek;
5
+ /** Month a fiscal year starts in (1-12, default 1). */
6
+ fiscalYearStartMonth?: number;
7
+ };
8
+ export type NamedPreset = "today" | "yesterday" | "last7Days" | "last30Days" | "thisWeek" | "lastWeek" | "thisMonth" | "lastMonth" | "thisQuarter" | "lastQuarter" | "yearToDate" | "thisYear" | "lastYear";
9
+ /** `rolling`: the last `amount` units ending today. `calendar`: `amount` whole units ending with the current one. */
10
+ export type CustomPreset = {
11
+ unit: "day" | "week" | "month" | "quarter" | "year";
12
+ amount: number;
13
+ align: "rolling" | "calendar";
14
+ };
15
+ export type DatePreset = NamedPreset | CustomPreset;
16
+ /** The inclusive range a preset stands for (plan 06 A21). Pure: pass `today` yourself. */
17
+ export declare function getPresetRange(preset: DatePreset, ctx: PresetContext): DateRange;
18
+ /** The first preset equal to `value`, for `aria-pressed` on the app's preset buttons. */
19
+ export declare function matchPreset<P extends DatePreset>(value: {
20
+ start: PlainDate | null;
21
+ end: PlainDate | null;
22
+ } | null, presets: readonly P[], ctx: PresetContext): P | null;
@@ -0,0 +1,103 @@
1
+ import { addDays, addMonths, addYears, endOfMonth, endOfWeek, isSameDay, plainDate, startOfMonth, startOfWeek, } from "../foundation/index.js";
2
+ function fiscalYearStart(date, startMonth) {
3
+ return plainDate(date.month >= startMonth ? date.year : date.year - 1, startMonth, 1);
4
+ }
5
+ function quarterStart(date, startMonth) {
6
+ const first = fiscalYearStart(date, startMonth);
7
+ const months = (date.year - first.year) * 12 + (date.month - first.month);
8
+ return addMonths(first, Math.floor(months / 3) * 3);
9
+ }
10
+ const quarterOf = (start) => ({
11
+ start,
12
+ end: addDays(addMonths(start, 3), -1),
13
+ });
14
+ function unitRange(unit, at, ctx) {
15
+ const weekStartsOn = ctx.weekStartsOn ?? 1;
16
+ const fiscal = ctx.fiscalYearStartMonth ?? 1;
17
+ switch (unit) {
18
+ case "day":
19
+ return { start: at, end: at };
20
+ case "week":
21
+ return {
22
+ start: startOfWeek(at, weekStartsOn),
23
+ end: endOfWeek(at, weekStartsOn),
24
+ };
25
+ case "month":
26
+ return { start: startOfMonth(at), end: endOfMonth(at) };
27
+ case "quarter":
28
+ return quarterOf(quarterStart(at, fiscal));
29
+ default: {
30
+ const start = fiscalYearStart(at, fiscal);
31
+ return { start, end: addDays(addYears(start, 1), -1) };
32
+ }
33
+ }
34
+ }
35
+ function shift(at, unit, amount) {
36
+ switch (unit) {
37
+ case "day":
38
+ return addDays(at, amount);
39
+ case "week":
40
+ return addDays(at, amount * 7);
41
+ case "month":
42
+ return addMonths(at, amount);
43
+ case "quarter":
44
+ return addMonths(at, amount * 3);
45
+ default:
46
+ return addYears(at, amount);
47
+ }
48
+ }
49
+ /** The inclusive range a preset stands for (plan 06 A21). Pure: pass `today` yourself. */
50
+ export function getPresetRange(preset, ctx) {
51
+ const { today } = ctx;
52
+ if (typeof preset === "object") {
53
+ if (preset.align === "rolling") {
54
+ const start = addDays(shift(today, preset.unit, -preset.amount), 1);
55
+ return { start, end: today };
56
+ }
57
+ const current = unitRange(preset.unit, today, ctx);
58
+ const first = unitRange(preset.unit, shift(today, preset.unit, -(preset.amount - 1)), ctx);
59
+ return { start: first.start, end: current.end };
60
+ }
61
+ switch (preset) {
62
+ case "today":
63
+ return { start: today, end: today };
64
+ case "yesterday": {
65
+ const day = addDays(today, -1);
66
+ return { start: day, end: day };
67
+ }
68
+ case "last7Days":
69
+ return { start: addDays(today, -6), end: today };
70
+ case "last30Days":
71
+ return { start: addDays(today, -29), end: today };
72
+ case "thisWeek":
73
+ return unitRange("week", today, ctx);
74
+ case "lastWeek":
75
+ return unitRange("week", addDays(today, -7), ctx);
76
+ case "thisMonth":
77
+ return unitRange("month", today, ctx);
78
+ case "lastMonth":
79
+ return unitRange("month", addMonths(startOfMonth(today), -1), ctx);
80
+ case "thisQuarter":
81
+ return unitRange("quarter", today, ctx);
82
+ case "lastQuarter":
83
+ return unitRange("quarter", addMonths(today, -3), ctx);
84
+ case "yearToDate":
85
+ return { start: unitRange("year", today, ctx).start, end: today };
86
+ case "thisYear":
87
+ return unitRange("year", today, ctx);
88
+ default:
89
+ return unitRange("year", addYears(today, -1), ctx);
90
+ }
91
+ }
92
+ /** The first preset equal to `value`, for `aria-pressed` on the app's preset buttons. */
93
+ export function matchPreset(value, presets, ctx) {
94
+ if (!value?.start || !value.end)
95
+ return null;
96
+ for (const preset of presets) {
97
+ const range = getPresetRange(preset, ctx);
98
+ if (isSameDay(range.start, value.start) && isSameDay(range.end, value.end)) {
99
+ return preset;
100
+ }
101
+ }
102
+ return null;
103
+ }
@@ -0,0 +1,7 @@
1
+ import { type DateConstraints, type PlainDate } from "../../foundation/index.js";
2
+ import type { MultiDateValue } from "../types.js";
3
+ export declare const sortUnique: (dates: readonly PlainDate[]) => PlainDate[];
4
+ /** Toggle one day. A full selection (`maxSelected`) still lets a day be removed. */
5
+ export declare function toggleDate(value: MultiDateValue, date: PlainDate, constraints: DateConstraints, maxSelected?: number): MultiDateValue;
6
+ /** Add every selectable day between `from` and `to` (either direction), stopping at `maxSelected`. */
7
+ export declare function addBetween(value: MultiDateValue, from: PlainDate, to: PlainDate, constraints: DateConstraints, maxSelected?: number): MultiDateValue;
@@ -0,0 +1,29 @@
1
+ import { compare, eachDay, getDateStatus, isSameDay, } from "../../foundation/index.js";
2
+ export const sortUnique = (dates) => {
3
+ const sorted = [...dates].sort(compare);
4
+ return sorted.filter((date, index) => index === 0 || !isSameDay(date, sorted[index - 1]));
5
+ };
6
+ /** Toggle one day. A full selection (`maxSelected`) still lets a day be removed. */
7
+ export function toggleDate(value, date, constraints, maxSelected) {
8
+ if (value.some((item) => isSameDay(item, date))) {
9
+ return value.filter((item) => !isSameDay(item, date));
10
+ }
11
+ if (!getDateStatus(date, constraints).selectable)
12
+ return value;
13
+ if (maxSelected !== undefined && value.length >= maxSelected)
14
+ return value;
15
+ return sortUnique([...value, date]);
16
+ }
17
+ /** Add every selectable day between `from` and `to` (either direction), stopping at `maxSelected`. */
18
+ export function addBetween(value, from, to, constraints, maxSelected) {
19
+ const range = compare(from, to) <= 0 ? { start: from, end: to } : { start: to, end: from };
20
+ const next = [...value];
21
+ for (const day of eachDay(range)) {
22
+ if (maxSelected !== undefined && next.length >= maxSelected)
23
+ break;
24
+ if (getDateStatus(day, constraints).selectable && !next.some((item) => isSameDay(item, day))) {
25
+ next.push(day);
26
+ }
27
+ }
28
+ return sortUnique(next);
29
+ }
@@ -0,0 +1,29 @@
1
+ import { type DateRange, type DateRangeConstraints, type DateRangeReason, type PlainDate } from "../../foundation/index.js";
2
+ import type { DateRangeValue } from "../types.js";
3
+ /** Range constraints whose day limits may depend on the start (plan 06 A23). */
4
+ export type PickConstraints = Omit<DateRangeConstraints, "minDays" | "maxDays"> & {
5
+ minDays?: number | ((start: PlainDate) => number) | undefined;
6
+ maxDays?: number | ((start: PlainDate) => number) | undefined;
7
+ };
8
+ export type RangeReason = DateRangeReason | "end-before-start";
9
+ export type PickResult = {
10
+ kind: "draft";
11
+ value: {
12
+ start: PlainDate;
13
+ end: null;
14
+ };
15
+ } | {
16
+ kind: "complete";
17
+ value: DateRange;
18
+ } | {
19
+ kind: "invalid";
20
+ reason: RangeReason;
21
+ };
22
+ /** Check an ordered range with the limits evaluated for its start. */
23
+ export declare function checkPicked(range: DateRange, constraints: PickConstraints): import("../../foundation/index.js").DateRangeCheck;
24
+ /** The range state machine of plan 06 §13.2. */
25
+ export declare function pickRange(value: DateRangeValue, date: PlainDate, constraints: PickConstraints): PickResult;
26
+ /** True when `day` cannot end a range that starts at `start` (plan 06 A6). */
27
+ export declare function isBlocked(start: PlainDate, day: PlainDate, constraints: PickConstraints): boolean;
28
+ /** The previewed range for a draft, or null when the target is blocked. */
29
+ export declare function previewRange(start: PlainDate, target: PlainDate, constraints: PickConstraints): DateRange | null;
@@ -0,0 +1,35 @@
1
+ import { checkDateRange, compare, getDateStatus, } from "../../foundation/index.js";
2
+ const resolve = (limit, start) => (typeof limit === "function" ? limit(start) : limit);
3
+ /** Check an ordered range with the limits evaluated for its start. */
4
+ export function checkPicked(range, constraints) {
5
+ return checkDateRange(range, {
6
+ ...constraints,
7
+ minDays: resolve(constraints.minDays, range.start),
8
+ maxDays: resolve(constraints.maxDays, range.start),
9
+ });
10
+ }
11
+ /** The range state machine of plan 06 §13.2. */
12
+ export function pickRange(value, date, constraints) {
13
+ const start = value?.start;
14
+ if (!start || value?.end) {
15
+ // idle or complete: the pick always starts a new draft.
16
+ return getDateStatus(date, constraints).selectable
17
+ ? { kind: "draft", value: { start: date, end: null } }
18
+ : { kind: "invalid", reason: "start-invalid" };
19
+ }
20
+ const range = compare(date, start) < 0 ? { start: date, end: start } : { start, end: date };
21
+ const check = checkPicked(range, constraints);
22
+ return check.valid
23
+ ? { kind: "complete", value: range }
24
+ : { kind: "invalid", reason: check.reason };
25
+ }
26
+ /** True when `day` cannot end a range that starts at `start` (plan 06 A6). */
27
+ export function isBlocked(start, day, constraints) {
28
+ const range = compare(day, start) < 0 ? { start: day, end: start } : { start, end: day };
29
+ return !checkPicked(range, constraints).valid;
30
+ }
31
+ /** The previewed range for a draft, or null when the target is blocked. */
32
+ export function previewRange(start, target, constraints) {
33
+ const range = compare(target, start) < 0 ? { start: target, end: start } : { start, end: target };
34
+ return checkPicked(range, constraints).valid ? range : null;
35
+ }
@@ -0,0 +1,12 @@
1
+ import type { PlainDate } from "../foundation/index.js";
2
+ /** A single date, or `null` when empty (plan 06 A1). `null` is a real controlled value. */
3
+ export type DateValue = PlainDate | null;
4
+ /** Inclusive range. `{ start, end: null }` is the partial state while picking. */
5
+ export type DateRangeValue = {
6
+ start: PlainDate | null;
7
+ end: PlainDate | null;
8
+ } | null;
9
+ /** Sorted, unique. */
10
+ export type MultiDateValue = readonly PlainDate[];
11
+ export type PanelLevel = "day" | "month" | "year";
12
+ export type PartName = "day" | "month" | "year";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,24 @@
1
+ import { type Disambiguation, type PlainDate, type PlainDateTime, type PlainTime, type ZonedDateTime } from "../foundation/index.js";
2
+ import type { DateTimeValue } from "./types.js";
3
+ export type Draft = {
4
+ date: PlainDate | null;
5
+ time: PlainTime | null;
6
+ };
7
+ export type Zone = {
8
+ timeZone?: string | undefined;
9
+ valueTimeZone?: string | undefined;
10
+ disambiguation?: Disambiguation | undefined;
11
+ };
12
+ export type Composed = {
13
+ value: PlainDateTime | ZonedDateTime | null;
14
+ adjusted: boolean;
15
+ /** A gap or overlap rejected by `disambiguation: "reject"`. */
16
+ nonexistent: boolean;
17
+ };
18
+ /** Date and time of a value as the user sees them (in the display zone). */
19
+ export declare function decompose(value: DateTimeValue, zone: Zone): Draft;
20
+ /** The value for a date and a time: plain without a `timeZone`, zoned with one. */
21
+ export declare function compose(draft: Draft, zone: Zone): Composed;
22
+ /** Equality: instants for zoned values, wall fields for plain ones. */
23
+ export declare function sameDateTime(a: DateTimeValue, b: DateTimeValue): boolean;
24
+ export declare const sameDraft: (a: Draft, b: Draft) => boolean;
@@ -0,0 +1,49 @@
1
+ import { isSameDay, isSameTime, plainDate, plainDateTime, plainTime, toInstant, toPlainDateTime, } from "../foundation/index.js";
2
+ import { resolveWall, toValueZone } from "./zone/resolve.js";
3
+ /** Date and time of a value as the user sees them (in the display zone). */
4
+ export function decompose(value, zone) {
5
+ if (!value)
6
+ return { date: null, time: null };
7
+ const wall = toPlainDateTime(value, zone.timeZone ?? "UTC");
8
+ return {
9
+ date: plainDate(wall.year, wall.month, wall.day),
10
+ time: plainTime(wall.hour, wall.minute, wall.second),
11
+ };
12
+ }
13
+ /** The value for a date and a time: plain without a `timeZone`, zoned with one. */
14
+ export function compose(draft, zone) {
15
+ if (!draft.date || !draft.time) {
16
+ return { value: null, adjusted: false, nonexistent: false };
17
+ }
18
+ const wall = plainDateTime(draft.date, draft.time);
19
+ if (zone.timeZone === undefined) {
20
+ return { value: wall, adjusted: false, nonexistent: false };
21
+ }
22
+ try {
23
+ const resolved = resolveWall(wall, zone.timeZone, zone.disambiguation);
24
+ return {
25
+ value: toValueZone(resolved.zoned, zone.valueTimeZone),
26
+ adjusted: resolved.adjusted,
27
+ nonexistent: false,
28
+ };
29
+ }
30
+ catch (error) {
31
+ if (error instanceof RangeError) {
32
+ return { value: null, adjusted: false, nonexistent: true };
33
+ }
34
+ throw error;
35
+ }
36
+ }
37
+ const fields = (v) => `${v.year}-${v.month}-${v.day}T${v.hour}:${v.minute}:${v.second}`;
38
+ /** Equality: instants for zoned values, wall fields for plain ones. */
39
+ export function sameDateTime(a, b) {
40
+ if (a === b)
41
+ return true;
42
+ if (!a || !b)
43
+ return false;
44
+ if ("timeZone" in a && "timeZone" in b)
45
+ return toInstant(a) === toInstant(b);
46
+ return fields(a) === fields(b);
47
+ }
48
+ export const sameDraft = (a, b) => (a.date === b.date || (!!a.date && !!b.date && isSameDay(a.date, b.date))) &&
49
+ (a.time === b.time || (!!a.time && !!b.time && isSameTime(a.time, b.time)));
@@ -0,0 +1,42 @@
1
+ import { type DateTimeInput, type PlainDate, type PlainDateTime, type PlainTime, type ZonedDateTime } from "../foundation/index.js";
2
+ export type BoundsOptions = {
3
+ min?: DateTimeInput | undefined;
4
+ max?: DateTimeInput | undefined;
5
+ /** `min` becomes now in `timeZone` (plan 08 X5). */
6
+ disablePast?: boolean | undefined;
7
+ /** The display zone; plain values are read in it, zoned ones converted to it. */
8
+ timeZone?: string | undefined;
9
+ now?: number | undefined;
10
+ };
11
+ /** Wall-time bounds in the display zone. Both ends are inclusive. */
12
+ export type Bounds = {
13
+ min?: PlainDateTime | undefined;
14
+ max?: PlainDateTime | undefined;
15
+ };
16
+ export declare function getBounds(options: BoundsOptions): Bounds;
17
+ /** A day outside `[min.day, max.day]` is disabled; boundary days stay enabled. */
18
+ export declare function isDayDisabled(date: PlainDate, bounds: Bounds): boolean;
19
+ /** On the boundary days only the times past `min` / before `max` are allowed. */
20
+ export declare function timeBoundsFor(date: PlainDate, bounds: Bounds): {
21
+ min?: PlainTime;
22
+ max?: PlainTime;
23
+ };
24
+ export type DateTimeRangeReason = "start-invalid" | "end-invalid" | "end-before-start" | "too-short" | "too-long";
25
+ export type DateTimeRangeCheck = {
26
+ valid: true;
27
+ duration: number;
28
+ } | {
29
+ valid: false;
30
+ reason: DateTimeRangeReason;
31
+ };
32
+ export type DateTimeRangeLimits = {
33
+ /** Minutes. */
34
+ minDuration?: number | undefined;
35
+ maxDuration?: number | undefined;
36
+ bounds?: Bounds;
37
+ };
38
+ /**
39
+ * Check a half-open date-time range. Zoned values compare as instants, plain ones as
40
+ * wall times. `duration` is in minutes.
41
+ */
42
+ export declare function checkDateTimeRange(start: PlainDateTime | ZonedDateTime, end: PlainDateTime | ZonedDateTime, limits?: DateTimeRangeLimits): DateTimeRangeCheck;
@@ -0,0 +1,56 @@
1
+ import { compare, isSameDay, nowZoned, plainDateTime, plainTime, toEpochDay, toInstant, toPlainDateTime, toSecondOfDay, } from "../foundation/index.js";
2
+ const wallOf = (value) => toEpochDay(value) * 86400 + toSecondOfDay(value);
3
+ export function getBounds(options) {
4
+ const zone = options.timeZone ?? "UTC";
5
+ let min = options.min === undefined ? undefined : toPlainDateTime(options.min, zone);
6
+ const max = options.max === undefined ? undefined : toPlainDateTime(options.max, zone);
7
+ if (options.disablePast) {
8
+ const now = nowZoned(zone, options.now);
9
+ const wall = plainDateTime(now, plainTime(now.hour, now.minute, now.second));
10
+ if (!min || wallOf(wall) > wallOf(min))
11
+ min = wall;
12
+ }
13
+ return { min, max };
14
+ }
15
+ /** A day outside `[min.day, max.day]` is disabled; boundary days stay enabled. */
16
+ export function isDayDisabled(date, bounds) {
17
+ return ((bounds.min !== undefined && compare(date, bounds.min) < 0) ||
18
+ (bounds.max !== undefined && compare(date, bounds.max) > 0));
19
+ }
20
+ /** On the boundary days only the times past `min` / before `max` are allowed. */
21
+ export function timeBoundsFor(date, bounds) {
22
+ const result = {};
23
+ if (bounds.min && isSameDay(date, bounds.min)) {
24
+ result.min = plainTime(bounds.min.hour, bounds.min.minute, bounds.min.second);
25
+ }
26
+ if (bounds.max && isSameDay(date, bounds.max)) {
27
+ result.max = plainTime(bounds.max.hour, bounds.max.minute, bounds.max.second);
28
+ }
29
+ return result;
30
+ }
31
+ /**
32
+ * Check a half-open date-time range. Zoned values compare as instants, plain ones as
33
+ * wall times. `duration` is in minutes.
34
+ */
35
+ export function checkDateTimeRange(start, end, limits = {}) {
36
+ const seconds = (value) => "timeZone" in value ? Math.round(toInstant(value) / 1000) : wallOf(value);
37
+ const from = seconds(start);
38
+ const to = seconds(end);
39
+ const { min, max } = limits.bounds ?? {};
40
+ if (min && wallOf(plainDateTime(start, start)) < wallOf(min)) {
41
+ return { valid: false, reason: "start-invalid" };
42
+ }
43
+ if (max && wallOf(plainDateTime(end, end)) > wallOf(max)) {
44
+ return { valid: false, reason: "end-invalid" };
45
+ }
46
+ if (to <= from)
47
+ return { valid: false, reason: "end-before-start" };
48
+ const duration = Math.round((to - from) / 60);
49
+ if (limits.minDuration !== undefined && duration < limits.minDuration) {
50
+ return { valid: false, reason: "too-short" };
51
+ }
52
+ if (limits.maxDuration !== undefined && duration > limits.maxDuration) {
53
+ return { valid: false, reason: "too-long" };
54
+ }
55
+ return { valid: true, duration };
56
+ }
@@ -0,0 +1,9 @@
1
+ export * from "./types.js";
2
+ export * from "./constraints.js";
3
+ export * from "./zone/resolve.js";
4
+ export * from "./zone/day-instants.js";
5
+ export * from "./input/parse.js";
6
+ export * from "./input/datetime-input-controller.js";
7
+ export * from "./input/datetime-range-input-controller.js";
8
+ export * from "./panel/controller.js";
9
+ export * from "./panel/range-controller.js";
@@ -0,0 +1,9 @@
1
+ export * from "./types.js";
2
+ export * from "./constraints.js";
3
+ export * from "./zone/resolve.js";
4
+ export * from "./zone/day-instants.js";
5
+ export * from "./input/parse.js";
6
+ export * from "./input/datetime-input-controller.js";
7
+ export * from "./input/datetime-range-input-controller.js";
8
+ export * from "./panel/controller.js";
9
+ export * from "./panel/range-controller.js";
@@ -0,0 +1,96 @@
1
+ import { type Attributes, type Availability, type AvailabilitySpec, type DateTimeInput, type HiddenInput, type Messages, type PlainDate, type PlainTime } from "../../foundation/index.js";
2
+ import { type DateInputController, type DateInputState, type SegmentView } from "../../date/index.js";
3
+ import { type TimeInputController, type TimeInputOptions, type TimeInputState, type TimeSegmentView } from "../../time/index.js";
4
+ import { type Zone } from "../compose.js";
5
+ import type { DateTimeValue } from "../types.js";
6
+ type Part = SegmentView["type"] | TimeSegmentView["type"];
7
+ type KeyMods = {
8
+ shift: boolean;
9
+ ctrl: boolean;
10
+ meta: boolean;
11
+ };
12
+ export type DateTimeSegmentView = SegmentView | TimeSegmentView;
13
+ export type DateTimeInputOptions = {
14
+ id?: string;
15
+ value?: DateTimeValue;
16
+ defaultValue?: DateTimeValue | undefined;
17
+ onValueChange?: (value: DateTimeValue, info: {
18
+ adjusted: boolean;
19
+ }) => void;
20
+ /** On blur or Enter with a valid value. */
21
+ onValueCommit?: (value: NonNullable<DateTimeValue>) => void;
22
+ /** Segmented: one group of parts. Text: a date field and a time field. */
23
+ mode?: "segmented" | "text";
24
+ timeZone?: string;
25
+ valueTimeZone?: string;
26
+ disambiguation?: Zone["disambiguation"];
27
+ granularity?: TimeInputOptions["granularity"];
28
+ hourCycle?: TimeInputOptions["hourCycle"];
29
+ step?: TimeInputOptions["step"];
30
+ min?: DateTimeInput;
31
+ max?: DateTimeInput;
32
+ disablePast?: boolean;
33
+ isDateDisabled?: (date: PlainDate) => boolean;
34
+ isDateUnavailable?: (date: PlainDate) => boolean;
35
+ isTimeDisabled?: (time: PlainTime, date: PlainDate) => boolean;
36
+ /** Availability model (plan 11 V7–V8): dates and times of the draft day. */
37
+ availability?: AvailabilitySpec | Availability;
38
+ onInvalidInput?: (text: string) => void;
39
+ name?: string | undefined;
40
+ /** Replaces the hidden input's value (for example to send UTC). */
41
+ formValue?: (value: NonNullable<DateTimeValue>) => string;
42
+ required?: boolean;
43
+ readOnly?: boolean;
44
+ disabled?: boolean;
45
+ locale?: string;
46
+ now?: number;
47
+ messages?: Partial<Messages>;
48
+ /** Internal: focus tried to leave the first or last part of the whole input. */
49
+ onFocusEdge?: (direction: 1 | -1) => void;
50
+ };
51
+ export type DateTimeValidity = "empty" | "incomplete" | "valid" | "invalid-date" | "before-min" | "after-max" | "disabled" | "unavailable" | "off-step" | "nonexistent-time";
52
+ export type DateTimeInputState = {
53
+ id: string;
54
+ mode: "segmented" | "text";
55
+ /** Date parts, a separator and time parts, in one tab order (segmented mode). */
56
+ segments: DateTimeSegmentView[];
57
+ dateField: DateInputState;
58
+ timeField: TimeInputState;
59
+ value: DateTimeValue;
60
+ validity: DateTimeValidity;
61
+ adjusted: boolean;
62
+ focusedPart: Part;
63
+ /** "Vietnam Time" for a display zone, otherwise `null`. */
64
+ zoneLabel: string | null;
65
+ required: boolean;
66
+ readOnly: boolean;
67
+ disabled: boolean;
68
+ direction: "ltr" | "rtl";
69
+ locale?: string;
70
+ messages: Messages;
71
+ hidden: HiddenInput[];
72
+ };
73
+ export type DateTimeInputController = {
74
+ getState(): DateTimeInputState;
75
+ subscribe(listener: (state: DateTimeInputState) => void): () => void;
76
+ setOptions(options: Partial<DateTimeInputOptions>): void;
77
+ getDate(): DateInputController;
78
+ getTime(): TimeInputController;
79
+ handleKeyDown(part: Part, key: string, modifiers: KeyMods): boolean;
80
+ focusPart(part: Part): void;
81
+ settle(): void;
82
+ /** A pasted date-time fills both parts; a bare date or time fills only its own. */
83
+ paste(text: string): boolean;
84
+ commit(): void;
85
+ clear(): void;
86
+ reset(): void;
87
+ getRootAttributes(): Attributes;
88
+ getSegmentAttributes(segment: DateTimeSegmentView): Attributes;
89
+ getDateFieldAttributes(): Attributes;
90
+ getTimeFieldAttributes(): Attributes;
91
+ getClearButtonAttributes(): Attributes;
92
+ destroy(): void;
93
+ };
94
+ /** A date and a time input composed by one controller (plan 08 X10). */
95
+ export declare function createDateTimeInputController(initial?: DateTimeInputOptions): DateTimeInputController;
96
+ export {};