@rupe/v-datepicker 1.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (639) hide show
  1. package/LICENSE +21 -0
  2. package/dist/components/Calendar/CalendarCell.d.ts +17 -0
  3. package/dist/components/Calendar/CalendarCell.vue.js +34 -0
  4. package/dist/components/Calendar/CalendarCell.vue.js.map +1 -0
  5. package/dist/components/Calendar/CalendarCell.vue2.js +5 -0
  6. package/dist/components/Calendar/CalendarCell.vue2.js.map +1 -0
  7. package/dist/components/Calendar/CalendarCellTrigger.d.ts +72 -0
  8. package/dist/components/Calendar/CalendarCellTrigger.vue.js +159 -0
  9. package/dist/components/Calendar/CalendarCellTrigger.vue.js.map +1 -0
  10. package/dist/components/Calendar/CalendarCellTrigger.vue2.js +5 -0
  11. package/dist/components/Calendar/CalendarCellTrigger.vue2.js.map +1 -0
  12. package/dist/components/Calendar/CalendarGrid.d.ts +13 -0
  13. package/dist/components/Calendar/CalendarGrid.vue.js +40 -0
  14. package/dist/components/Calendar/CalendarGrid.vue.js.map +1 -0
  15. package/dist/components/Calendar/CalendarGrid.vue2.js +5 -0
  16. package/dist/components/Calendar/CalendarGrid.vue2.js.map +1 -0
  17. package/dist/components/Calendar/CalendarGridBody.d.ts +13 -0
  18. package/dist/components/Calendar/CalendarGridBody.vue.js +25 -0
  19. package/dist/components/Calendar/CalendarGridBody.vue.js.map +1 -0
  20. package/dist/components/Calendar/CalendarGridBody.vue2.js +5 -0
  21. package/dist/components/Calendar/CalendarGridBody.vue2.js.map +1 -0
  22. package/dist/components/Calendar/CalendarGridHead.d.ts +13 -0
  23. package/dist/components/Calendar/CalendarGridHead.vue.js +25 -0
  24. package/dist/components/Calendar/CalendarGridHead.vue.js.map +1 -0
  25. package/dist/components/Calendar/CalendarGridHead.vue2.js +5 -0
  26. package/dist/components/Calendar/CalendarGridHead.vue2.js.map +1 -0
  27. package/dist/components/Calendar/CalendarGridRow.d.ts +13 -0
  28. package/dist/components/Calendar/CalendarGridRow.vue.js +25 -0
  29. package/dist/components/Calendar/CalendarGridRow.vue.js.map +1 -0
  30. package/dist/components/Calendar/CalendarGridRow.vue2.js +5 -0
  31. package/dist/components/Calendar/CalendarGridRow.vue2.js.map +1 -0
  32. package/dist/components/Calendar/CalendarHeadCell.d.ts +13 -0
  33. package/dist/components/Calendar/CalendarHeadCell.vue.js +25 -0
  34. package/dist/components/Calendar/CalendarHeadCell.vue.js.map +1 -0
  35. package/dist/components/Calendar/CalendarHeadCell.vue2.js +5 -0
  36. package/dist/components/Calendar/CalendarHeadCell.vue2.js.map +1 -0
  37. package/dist/components/Calendar/CalendarHeader.d.ts +13 -0
  38. package/dist/components/Calendar/CalendarHeader.vue.js +25 -0
  39. package/dist/components/Calendar/CalendarHeader.vue.js.map +1 -0
  40. package/dist/components/Calendar/CalendarHeader.vue2.js +5 -0
  41. package/dist/components/Calendar/CalendarHeader.vue2.js.map +1 -0
  42. package/dist/components/Calendar/CalendarHeading.d.ts +21 -0
  43. package/dist/components/Calendar/CalendarHeading.vue.js +33 -0
  44. package/dist/components/Calendar/CalendarHeading.vue.js.map +1 -0
  45. package/dist/components/Calendar/CalendarHeading.vue2.js +5 -0
  46. package/dist/components/Calendar/CalendarHeading.vue2.js.map +1 -0
  47. package/dist/components/Calendar/CalendarMonthHeading.d.ts +22 -0
  48. package/dist/components/Calendar/CalendarMonthHeading.vue.js +49 -0
  49. package/dist/components/Calendar/CalendarMonthHeading.vue.js.map +1 -0
  50. package/dist/components/Calendar/CalendarMonthHeading.vue2.js +5 -0
  51. package/dist/components/Calendar/CalendarMonthHeading.vue2.js.map +1 -0
  52. package/dist/components/Calendar/CalendarMonthYearOverlay.d.ts +27 -0
  53. package/dist/components/Calendar/CalendarMonthYearOverlay.vue.js +61 -0
  54. package/dist/components/Calendar/CalendarMonthYearOverlay.vue.js.map +1 -0
  55. package/dist/components/Calendar/CalendarMonthYearOverlay.vue2.js +5 -0
  56. package/dist/components/Calendar/CalendarMonthYearOverlay.vue2.js.map +1 -0
  57. package/dist/components/Calendar/CalendarNext.d.ts +21 -0
  58. package/dist/components/Calendar/CalendarNext.vue.js +42 -0
  59. package/dist/components/Calendar/CalendarNext.vue.js.map +1 -0
  60. package/dist/components/Calendar/CalendarNext.vue2.js +5 -0
  61. package/dist/components/Calendar/CalendarNext.vue2.js.map +1 -0
  62. package/dist/components/Calendar/CalendarOverlayItem.d.ts +24 -0
  63. package/dist/components/Calendar/CalendarOverlayItem.vue.js +34 -0
  64. package/dist/components/Calendar/CalendarOverlayItem.vue.js.map +1 -0
  65. package/dist/components/Calendar/CalendarOverlayItem.vue2.js +5 -0
  66. package/dist/components/Calendar/CalendarOverlayItem.vue2.js.map +1 -0
  67. package/dist/components/Calendar/CalendarPrev.d.ts +21 -0
  68. package/dist/components/Calendar/CalendarPrev.vue.js +42 -0
  69. package/dist/components/Calendar/CalendarPrev.vue.js.map +1 -0
  70. package/dist/components/Calendar/CalendarPrev.vue2.js +5 -0
  71. package/dist/components/Calendar/CalendarPrev.vue2.js.map +1 -0
  72. package/dist/components/Calendar/CalendarRoot.d.ts +210 -0
  73. package/dist/components/Calendar/CalendarRoot.vue.js +253 -0
  74. package/dist/components/Calendar/CalendarRoot.vue.js.map +1 -0
  75. package/dist/components/Calendar/CalendarRoot.vue2.js +8 -0
  76. package/dist/components/Calendar/CalendarRoot.vue2.js.map +1 -0
  77. package/dist/components/Calendar/CalendarYearHeading.d.ts +22 -0
  78. package/dist/components/Calendar/CalendarYearHeading.vue.js +49 -0
  79. package/dist/components/Calendar/CalendarYearHeading.vue.js.map +1 -0
  80. package/dist/components/Calendar/CalendarYearHeading.vue2.js +5 -0
  81. package/dist/components/Calendar/CalendarYearHeading.vue2.js.map +1 -0
  82. package/dist/components/Calendar/index.d.ts +15 -0
  83. package/dist/components/Calendar/useCalendar.d.ts +50 -0
  84. package/dist/components/Calendar/useCalendar.js +317 -0
  85. package/dist/components/Calendar/useCalendar.js.map +1 -0
  86. package/dist/components/ConfigProvider/ConfigProvider.d.ts +51 -0
  87. package/dist/components/ConfigProvider/ConfigProvider.vue.js +7 -0
  88. package/dist/components/ConfigProvider/ConfigProvider.vue.js.map +1 -0
  89. package/dist/components/ConfigProvider/index.d.ts +1 -0
  90. package/dist/components/DateField/DateFieldInput.d.ts +15 -0
  91. package/dist/components/DateField/DateFieldInput.vue.js +70 -0
  92. package/dist/components/DateField/DateFieldInput.vue.js.map +1 -0
  93. package/dist/components/DateField/DateFieldInput.vue2.js +5 -0
  94. package/dist/components/DateField/DateFieldInput.vue2.js.map +1 -0
  95. package/dist/components/DateField/DateFieldRoot.d.ts +151 -0
  96. package/dist/components/DateField/DateFieldRoot.vue.js +237 -0
  97. package/dist/components/DateField/DateFieldRoot.vue.js.map +1 -0
  98. package/dist/components/DateField/DateFieldRoot.vue2.js +8 -0
  99. package/dist/components/DateField/DateFieldRoot.vue2.js.map +1 -0
  100. package/dist/components/DateField/index.d.ts +2 -0
  101. package/dist/components/DatePicker/DatePickerAnchor.d.ts +11 -0
  102. package/dist/components/DatePicker/DatePickerAnchor.vue.js +29 -0
  103. package/dist/components/DatePicker/DatePickerAnchor.vue.js.map +1 -0
  104. package/dist/components/DatePicker/DatePickerAnchor.vue2.js +5 -0
  105. package/dist/components/DatePicker/DatePickerAnchor.vue2.js.map +1 -0
  106. package/dist/components/DatePicker/DatePickerArrow.d.ts +11 -0
  107. package/dist/components/DatePicker/DatePickerArrow.vue.js +31 -0
  108. package/dist/components/DatePicker/DatePickerArrow.vue.js.map +1 -0
  109. package/dist/components/DatePicker/DatePickerArrow.vue2.js +5 -0
  110. package/dist/components/DatePicker/DatePickerArrow.vue2.js.map +1 -0
  111. package/dist/components/DatePicker/DatePickerCalendar.d.ts +17 -0
  112. package/dist/components/DatePicker/DatePickerCalendar.vue.js +60 -0
  113. package/dist/components/DatePicker/DatePickerCalendar.vue.js.map +1 -0
  114. package/dist/components/DatePicker/DatePickerCalendar.vue2.js +5 -0
  115. package/dist/components/DatePicker/DatePickerCalendar.vue2.js.map +1 -0
  116. package/dist/components/DatePicker/DatePickerCell.d.ts +11 -0
  117. package/dist/components/DatePicker/DatePickerCell.vue.js +28 -0
  118. package/dist/components/DatePicker/DatePickerCell.vue.js.map +1 -0
  119. package/dist/components/DatePicker/DatePickerCell.vue2.js +5 -0
  120. package/dist/components/DatePicker/DatePickerCell.vue2.js.map +1 -0
  121. package/dist/components/DatePicker/DatePickerCellTrigger.d.ts +10 -0
  122. package/dist/components/DatePicker/DatePickerCellTrigger.vue.js +29 -0
  123. package/dist/components/DatePicker/DatePickerCellTrigger.vue.js.map +1 -0
  124. package/dist/components/DatePicker/DatePickerCellTrigger.vue2.js +5 -0
  125. package/dist/components/DatePicker/DatePickerCellTrigger.vue2.js.map +1 -0
  126. package/dist/components/DatePicker/DatePickerClose.d.ts +11 -0
  127. package/dist/components/DatePicker/DatePickerClose.vue.js +28 -0
  128. package/dist/components/DatePicker/DatePickerClose.vue.js.map +1 -0
  129. package/dist/components/DatePicker/DatePickerClose.vue2.js +5 -0
  130. package/dist/components/DatePicker/DatePickerClose.vue2.js.map +1 -0
  131. package/dist/components/DatePicker/DatePickerContent.d.ts +31 -0
  132. package/dist/components/DatePicker/DatePickerContent.vue.js +69 -0
  133. package/dist/components/DatePicker/DatePickerContent.vue.js.map +1 -0
  134. package/dist/components/DatePicker/DatePickerContent.vue2.js +5 -0
  135. package/dist/components/DatePicker/DatePickerContent.vue2.js.map +1 -0
  136. package/dist/components/DatePicker/DatePickerField.d.ts +16 -0
  137. package/dist/components/DatePicker/DatePickerField.vue.js +55 -0
  138. package/dist/components/DatePicker/DatePickerField.vue.js.map +1 -0
  139. package/dist/components/DatePicker/DatePickerField.vue2.js +5 -0
  140. package/dist/components/DatePicker/DatePickerField.vue2.js.map +1 -0
  141. package/dist/components/DatePicker/DatePickerGrid.d.ts +11 -0
  142. package/dist/components/DatePicker/DatePickerGrid.vue.js +27 -0
  143. package/dist/components/DatePicker/DatePickerGrid.vue.js.map +1 -0
  144. package/dist/components/DatePicker/DatePickerGrid.vue2.js +5 -0
  145. package/dist/components/DatePicker/DatePickerGrid.vue2.js.map +1 -0
  146. package/dist/components/DatePicker/DatePickerGridBody.d.ts +11 -0
  147. package/dist/components/DatePicker/DatePickerGridBody.vue.js +27 -0
  148. package/dist/components/DatePicker/DatePickerGridBody.vue.js.map +1 -0
  149. package/dist/components/DatePicker/DatePickerGridBody.vue2.js +5 -0
  150. package/dist/components/DatePicker/DatePickerGridBody.vue2.js.map +1 -0
  151. package/dist/components/DatePicker/DatePickerGridHead.d.ts +11 -0
  152. package/dist/components/DatePicker/DatePickerGridHead.vue.js +27 -0
  153. package/dist/components/DatePicker/DatePickerGridHead.vue.js.map +1 -0
  154. package/dist/components/DatePicker/DatePickerGridHead.vue2.js +5 -0
  155. package/dist/components/DatePicker/DatePickerGridHead.vue2.js.map +1 -0
  156. package/dist/components/DatePicker/DatePickerGridRow.d.ts +11 -0
  157. package/dist/components/DatePicker/DatePickerGridRow.vue.js +27 -0
  158. package/dist/components/DatePicker/DatePickerGridRow.vue.js.map +1 -0
  159. package/dist/components/DatePicker/DatePickerGridRow.vue2.js +5 -0
  160. package/dist/components/DatePicker/DatePickerGridRow.vue2.js.map +1 -0
  161. package/dist/components/DatePicker/DatePickerHeadCell.d.ts +11 -0
  162. package/dist/components/DatePicker/DatePickerHeadCell.vue.js +27 -0
  163. package/dist/components/DatePicker/DatePickerHeadCell.vue.js.map +1 -0
  164. package/dist/components/DatePicker/DatePickerHeadCell.vue2.js +5 -0
  165. package/dist/components/DatePicker/DatePickerHeadCell.vue2.js.map +1 -0
  166. package/dist/components/DatePicker/DatePickerHeader.d.ts +11 -0
  167. package/dist/components/DatePicker/DatePickerHeader.vue.js +27 -0
  168. package/dist/components/DatePicker/DatePickerHeader.vue.js.map +1 -0
  169. package/dist/components/DatePicker/DatePickerHeader.vue2.js +5 -0
  170. package/dist/components/DatePicker/DatePickerHeader.vue2.js.map +1 -0
  171. package/dist/components/DatePicker/DatePickerHeading.d.ts +19 -0
  172. package/dist/components/DatePicker/DatePickerHeading.vue.js +29 -0
  173. package/dist/components/DatePicker/DatePickerHeading.vue.js.map +1 -0
  174. package/dist/components/DatePicker/DatePickerHeading.vue2.js +5 -0
  175. package/dist/components/DatePicker/DatePickerHeading.vue2.js.map +1 -0
  176. package/dist/components/DatePicker/DatePickerInput.d.ts +11 -0
  177. package/dist/components/DatePicker/DatePickerInput.vue.js +27 -0
  178. package/dist/components/DatePicker/DatePickerInput.vue.js.map +1 -0
  179. package/dist/components/DatePicker/DatePickerInput.vue2.js +5 -0
  180. package/dist/components/DatePicker/DatePickerInput.vue2.js.map +1 -0
  181. package/dist/components/DatePicker/DatePickerMonthHeading.d.ts +13 -0
  182. package/dist/components/DatePicker/DatePickerMonthHeading.vue.js +27 -0
  183. package/dist/components/DatePicker/DatePickerMonthHeading.vue.js.map +1 -0
  184. package/dist/components/DatePicker/DatePickerMonthHeading.vue2.js +5 -0
  185. package/dist/components/DatePicker/DatePickerMonthHeading.vue2.js.map +1 -0
  186. package/dist/components/DatePicker/DatePickerMonthYearOverlay.d.ts +24 -0
  187. package/dist/components/DatePicker/DatePickerMonthYearOverlay.vue.js +30 -0
  188. package/dist/components/DatePicker/DatePickerMonthYearOverlay.vue.js.map +1 -0
  189. package/dist/components/DatePicker/DatePickerMonthYearOverlay.vue2.js +5 -0
  190. package/dist/components/DatePicker/DatePickerMonthYearOverlay.vue2.js.map +1 -0
  191. package/dist/components/DatePicker/DatePickerNext.d.ts +10 -0
  192. package/dist/components/DatePicker/DatePickerNext.vue.js +28 -0
  193. package/dist/components/DatePicker/DatePickerNext.vue.js.map +1 -0
  194. package/dist/components/DatePicker/DatePickerNext.vue2.js +5 -0
  195. package/dist/components/DatePicker/DatePickerNext.vue2.js.map +1 -0
  196. package/dist/components/DatePicker/DatePickerOverlayItem.d.ts +19 -0
  197. package/dist/components/DatePicker/DatePickerOverlayItem.vue.js +25 -0
  198. package/dist/components/DatePicker/DatePickerOverlayItem.vue.js.map +1 -0
  199. package/dist/components/DatePicker/DatePickerOverlayItem.vue2.js +5 -0
  200. package/dist/components/DatePicker/DatePickerOverlayItem.vue2.js.map +1 -0
  201. package/dist/components/DatePicker/DatePickerPrev.d.ts +10 -0
  202. package/dist/components/DatePicker/DatePickerPrev.vue.js +28 -0
  203. package/dist/components/DatePicker/DatePickerPrev.vue.js.map +1 -0
  204. package/dist/components/DatePicker/DatePickerPrev.vue2.js +5 -0
  205. package/dist/components/DatePicker/DatePickerPrev.vue2.js.map +1 -0
  206. package/dist/components/DatePicker/DatePickerRoot.d.ts +84 -0
  207. package/dist/components/DatePicker/DatePickerRoot.vue.js +169 -0
  208. package/dist/components/DatePicker/DatePickerRoot.vue.js.map +1 -0
  209. package/dist/components/DatePicker/DatePickerRoot.vue2.js +8 -0
  210. package/dist/components/DatePicker/DatePickerRoot.vue2.js.map +1 -0
  211. package/dist/components/DatePicker/DatePickerTrigger.d.ts +11 -0
  212. package/dist/components/DatePicker/DatePickerTrigger.vue.js +37 -0
  213. package/dist/components/DatePicker/DatePickerTrigger.vue.js.map +1 -0
  214. package/dist/components/DatePicker/DatePickerTrigger.vue2.js +5 -0
  215. package/dist/components/DatePicker/DatePickerTrigger.vue2.js.map +1 -0
  216. package/dist/components/DatePicker/DatePickerYearHeading.d.ts +13 -0
  217. package/dist/components/DatePicker/DatePickerYearHeading.vue.js +27 -0
  218. package/dist/components/DatePicker/DatePickerYearHeading.vue.js.map +1 -0
  219. package/dist/components/DatePicker/DatePickerYearHeading.vue2.js +5 -0
  220. package/dist/components/DatePicker/DatePickerYearHeading.vue2.js.map +1 -0
  221. package/dist/components/DatePicker/index.d.ts +24 -0
  222. package/dist/components/DismissableLayer/DismissableLayer.d.ts +67 -0
  223. package/dist/components/DismissableLayer/DismissableLayer.vue.js +118 -0
  224. package/dist/components/DismissableLayer/DismissableLayer.vue.js.map +1 -0
  225. package/dist/components/DismissableLayer/DismissableLayer.vue2.js +7 -0
  226. package/dist/components/DismissableLayer/DismissableLayer.vue2.js.map +1 -0
  227. package/dist/components/DismissableLayer/DismissableLayerBranch.d.ts +11 -0
  228. package/dist/components/DismissableLayer/index.d.ts +3 -0
  229. package/dist/components/DismissableLayer/utils.d.ts +28 -0
  230. package/dist/components/DismissableLayer/utils.js +112 -0
  231. package/dist/components/DismissableLayer/utils.js.map +1 -0
  232. package/dist/components/FocusScope/FocusScope.d.ts +82 -0
  233. package/dist/components/FocusScope/FocusScope.test.d.ts +1 -0
  234. package/dist/components/FocusScope/FocusScope.vue.js +149 -0
  235. package/dist/components/FocusScope/FocusScope.vue.js.map +1 -0
  236. package/dist/components/FocusScope/FocusScope.vue2.js +5 -0
  237. package/dist/components/FocusScope/FocusScope.vue2.js.map +1 -0
  238. package/dist/components/FocusScope/index.d.ts +1 -0
  239. package/dist/components/FocusScope/stack.d.ts +12 -0
  240. package/dist/components/FocusScope/stack.js +38 -0
  241. package/dist/components/FocusScope/stack.js.map +1 -0
  242. package/dist/components/FocusScope/utils.d.ts +46 -0
  243. package/dist/components/FocusScope/utils.js +70 -0
  244. package/dist/components/FocusScope/utils.js.map +1 -0
  245. package/dist/components/Popover/PopoverAnchor.d.ts +11 -0
  246. package/dist/components/Popover/PopoverAnchor.vue.js +37 -0
  247. package/dist/components/Popover/PopoverAnchor.vue.js.map +1 -0
  248. package/dist/components/Popover/PopoverAnchor.vue2.js +5 -0
  249. package/dist/components/Popover/PopoverAnchor.vue2.js.map +1 -0
  250. package/dist/components/Popover/PopoverArrow.d.ts +15 -0
  251. package/dist/components/Popover/PopoverArrow.vue.js +31 -0
  252. package/dist/components/Popover/PopoverArrow.vue.js.map +1 -0
  253. package/dist/components/Popover/PopoverArrow.vue2.js +5 -0
  254. package/dist/components/Popover/PopoverArrow.vue2.js.map +1 -0
  255. package/dist/components/Popover/PopoverClose.d.ts +13 -0
  256. package/dist/components/Popover/PopoverClose.vue.js +34 -0
  257. package/dist/components/Popover/PopoverClose.vue.js.map +1 -0
  258. package/dist/components/Popover/PopoverClose.vue2.js +5 -0
  259. package/dist/components/Popover/PopoverClose.vue2.js.map +1 -0
  260. package/dist/components/Popover/PopoverContent.d.ts +32 -0
  261. package/dist/components/Popover/PopoverContent.vue.js +61 -0
  262. package/dist/components/Popover/PopoverContent.vue.js.map +1 -0
  263. package/dist/components/Popover/PopoverContent.vue2.js +5 -0
  264. package/dist/components/Popover/PopoverContent.vue2.js.map +1 -0
  265. package/dist/components/Popover/PopoverContentImpl.d.ts +47 -0
  266. package/dist/components/Popover/PopoverContentImpl.vue.js +97 -0
  267. package/dist/components/Popover/PopoverContentImpl.vue.js.map +1 -0
  268. package/dist/components/Popover/PopoverContentImpl.vue2.js +5 -0
  269. package/dist/components/Popover/PopoverContentImpl.vue2.js.map +1 -0
  270. package/dist/components/Popover/PopoverContentNonModal.d.ts +32 -0
  271. package/dist/components/Popover/PopoverContentNonModal.vue.js +78 -0
  272. package/dist/components/Popover/PopoverContentNonModal.vue.js.map +1 -0
  273. package/dist/components/Popover/PopoverContentNonModal.vue2.js +5 -0
  274. package/dist/components/Popover/PopoverContentNonModal.vue2.js.map +1 -0
  275. package/dist/components/Popover/PopoverPortal.d.ts +11 -0
  276. package/dist/components/Popover/PopoverPortal.vue.js +26 -0
  277. package/dist/components/Popover/PopoverPortal.vue.js.map +1 -0
  278. package/dist/components/Popover/PopoverPortal.vue2.js +5 -0
  279. package/dist/components/Popover/PopoverPortal.vue2.js.map +1 -0
  280. package/dist/components/Popover/PopoverRoot.d.ts +55 -0
  281. package/dist/components/Popover/PopoverRoot.vue.js +55 -0
  282. package/dist/components/Popover/PopoverRoot.vue.js.map +1 -0
  283. package/dist/components/Popover/PopoverRoot.vue2.js +8 -0
  284. package/dist/components/Popover/PopoverRoot.vue2.js.map +1 -0
  285. package/dist/components/Popover/PopoverTrigger.d.ts +13 -0
  286. package/dist/components/Popover/PopoverTrigger.vue.js +51 -0
  287. package/dist/components/Popover/PopoverTrigger.vue.js.map +1 -0
  288. package/dist/components/Popover/PopoverTrigger.vue2.js +5 -0
  289. package/dist/components/Popover/PopoverTrigger.vue2.js.map +1 -0
  290. package/dist/components/Popover/index.d.ts +7 -0
  291. package/dist/components/Popper/PopperAnchor.d.ts +19 -0
  292. package/dist/components/Popper/PopperAnchor.vue.js +37 -0
  293. package/dist/components/Popper/PopperAnchor.vue.js.map +1 -0
  294. package/dist/components/Popper/PopperAnchor.vue2.js +5 -0
  295. package/dist/components/Popper/PopperAnchor.vue2.js.map +1 -0
  296. package/dist/components/Popper/PopperArrow.d.ts +15 -0
  297. package/dist/components/Popper/PopperArrow.vue.js +76 -0
  298. package/dist/components/Popper/PopperArrow.vue.js.map +1 -0
  299. package/dist/components/Popper/PopperArrow.vue2.js +5 -0
  300. package/dist/components/Popper/PopperArrow.vue2.js.map +1 -0
  301. package/dist/components/Popper/PopperContent.d.ts +179 -0
  302. package/dist/components/Popper/PopperContent.vue.js +9 -0
  303. package/dist/components/Popper/PopperContent.vue.js.map +1 -0
  304. package/dist/components/Popper/PopperContent.vue2.js +230 -0
  305. package/dist/components/Popper/PopperContent.vue2.js.map +1 -0
  306. package/dist/components/Popper/PopperRoot.d.ts +19 -0
  307. package/dist/components/Popper/PopperRoot.vue.js +25 -0
  308. package/dist/components/Popper/PopperRoot.vue.js.map +1 -0
  309. package/dist/components/Popper/PopperRoot.vue2.js +8 -0
  310. package/dist/components/Popper/PopperRoot.vue2.js.map +1 -0
  311. package/dist/components/Popper/index.d.ts +5 -0
  312. package/dist/components/Popper/utils.d.ts +12 -0
  313. package/dist/components/Popper/utils.js +46 -0
  314. package/dist/components/Popper/utils.js.map +1 -0
  315. package/dist/components/Presence/Presence.d.ts +43 -0
  316. package/dist/components/Presence/Presence.js +61 -0
  317. package/dist/components/Presence/Presence.js.map +1 -0
  318. package/dist/components/Presence/index.d.ts +1 -0
  319. package/dist/components/Presence/usePresence.d.ts +4 -0
  320. package/dist/components/Presence/usePresence.js +131 -0
  321. package/dist/components/Presence/usePresence.js.map +1 -0
  322. package/dist/components/Primitive/Primitive.d.ts +39 -0
  323. package/dist/components/Primitive/Primitive.js +29 -0
  324. package/dist/components/Primitive/Primitive.js.map +1 -0
  325. package/dist/components/Primitive/Slot.d.ts +5 -0
  326. package/dist/components/Primitive/Slot.js +30 -0
  327. package/dist/components/Primitive/Slot.js.map +1 -0
  328. package/dist/components/Primitive/index.d.ts +3 -0
  329. package/dist/components/Primitive/usePrimitiveElement.d.ts +5 -0
  330. package/dist/components/Primitive/usePrimitiveElement.js +14 -0
  331. package/dist/components/Primitive/usePrimitiveElement.js.map +1 -0
  332. package/dist/components/Teleport/Teleport.d.ts +37 -0
  333. package/dist/components/Teleport/Teleport.vue.js +28 -0
  334. package/dist/components/Teleport/Teleport.vue.js.map +1 -0
  335. package/dist/components/Teleport/Teleport.vue2.js +5 -0
  336. package/dist/components/Teleport/Teleport.vue2.js.map +1 -0
  337. package/dist/components/Teleport/index.d.ts +1 -0
  338. package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +16 -0
  339. package/dist/components/VisuallyHidden/VisuallyHidden.vue.js +49 -0
  340. package/dist/components/VisuallyHidden/VisuallyHidden.vue.js.map +1 -0
  341. package/dist/components/VisuallyHidden/VisuallyHidden.vue2.js +5 -0
  342. package/dist/components/VisuallyHidden/VisuallyHidden.vue2.js.map +1 -0
  343. package/dist/components/VisuallyHidden/VisuallyHiddenInput.d.ts +14 -0
  344. package/dist/components/VisuallyHidden/VisuallyHiddenInputBubble.d.ts +22 -0
  345. package/dist/components/VisuallyHidden/index.d.ts +2 -0
  346. package/dist/date/calendar.d.ts +59 -0
  347. package/dist/date/calendar.js +90 -0
  348. package/dist/date/calendar.js.map +1 -0
  349. package/dist/date/comparators.d.ts +80 -0
  350. package/dist/date/comparators.js +61 -0
  351. package/dist/date/comparators.js.map +1 -0
  352. package/dist/date/index.d.ts +3 -0
  353. package/dist/date/types.d.ts +28 -0
  354. package/dist/date/utils.d.ts +12 -0
  355. package/dist/date/utils.js +10 -0
  356. package/dist/date/utils.js.map +1 -0
  357. package/dist/index.cjs +9097 -0
  358. package/dist/index.cjs.map +1 -0
  359. package/dist/index.d.ts +27 -0
  360. package/dist/index.js +54 -0
  361. package/dist/index.js.map +1 -0
  362. package/dist/node_modules/.pnpm/@floating-ui_core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.js +722 -0
  363. package/dist/node_modules/.pnpm/@floating-ui_core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.js.map +1 -0
  364. package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +626 -0
  365. package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.js.map +1 -0
  366. package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +174 -0
  367. package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +1 -0
  368. package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +155 -0
  369. package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.js.map +1 -0
  370. package/dist/node_modules/.pnpm/@floating-ui_vue@1.1.9_vue@3.5.26_typescript@5.9.3_/node_modules/@floating-ui/vue/dist/floating-ui.vue.js +180 -0
  371. package/dist/node_modules/.pnpm/@floating-ui_vue@1.1.9_vue@3.5.26_typescript@5.9.3_/node_modules/@floating-ui/vue/dist/floating-ui.vue.js.map +1 -0
  372. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/BuddhistCalendar.js +34 -0
  373. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/BuddhistCalendar.js.map +1 -0
  374. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/CalendarDate.js +213 -0
  375. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/CalendarDate.js.map +1 -0
  376. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/DateFormatter.js +116 -0
  377. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/DateFormatter.js.map +1 -0
  378. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/EthiopicCalendar.js +129 -0
  379. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/EthiopicCalendar.js.map +1 -0
  380. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/GregorianCalendar.js +123 -0
  381. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/GregorianCalendar.js.map +1 -0
  382. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/HebrewCalendar.js +114 -0
  383. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/HebrewCalendar.js.map +1 -0
  384. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/IndianCalendar.js +77 -0
  385. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/IndianCalendar.js.map +1 -0
  386. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/IslamicCalendar.js +141 -0
  387. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/IslamicCalendar.js.map +1 -0
  388. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/JapaneseCalendar.js +155 -0
  389. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/JapaneseCalendar.js.map +1 -0
  390. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/PersianCalendar.js +59 -0
  391. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/PersianCalendar.js.map +1 -0
  392. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/TaiwanCalendar.js +59 -0
  393. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/TaiwanCalendar.js.map +1 -0
  394. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/conversion.js +170 -0
  395. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/conversion.js.map +1 -0
  396. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/createCalendar.js +44 -0
  397. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/createCalendar.js.map +1 -0
  398. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/manipulation.js +301 -0
  399. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/manipulation.js.map +1 -0
  400. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/queries.js +141 -0
  401. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/queries.js.map +1 -0
  402. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/string.js +35 -0
  403. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/string.js.map +1 -0
  404. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/utils.js +7 -0
  405. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/utils.js.map +1 -0
  406. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/weekStartData.js +101 -0
  407. package/dist/node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/dist/weekStartData.js.map +1 -0
  408. package/dist/node_modules/.pnpm/@swc_helpers@0.5.18/node_modules/@swc/helpers/esm/_check_private_redeclaration.js +9 -0
  409. package/dist/node_modules/.pnpm/@swc_helpers@0.5.18/node_modules/@swc/helpers/esm/_check_private_redeclaration.js.map +1 -0
  410. package/dist/node_modules/.pnpm/@swc_helpers@0.5.18/node_modules/@swc/helpers/esm/_class_private_field_init.js +9 -0
  411. package/dist/node_modules/.pnpm/@swc_helpers@0.5.18/node_modules/@swc/helpers/esm/_class_private_field_init.js.map +1 -0
  412. package/dist/node_modules/.pnpm/@vueuse_core@14.1.0_vue@3.5.26_typescript@5.9.3_/node_modules/@vueuse/core/dist/index.js +140 -0
  413. package/dist/node_modules/.pnpm/@vueuse_core@14.1.0_vue@3.5.26_typescript@5.9.3_/node_modules/@vueuse/core/dist/index.js.map +1 -0
  414. package/dist/node_modules/.pnpm/@vueuse_shared@14.1.0_vue@3.5.26_typescript@5.9.3_/node_modules/@vueuse/shared/dist/index.js +88 -0
  415. package/dist/node_modules/.pnpm/@vueuse_shared@14.1.0_vue@3.5.26_typescript@5.9.3_/node_modules/@vueuse/shared/dist/index.js.map +1 -0
  416. package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.js +60 -0
  417. package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.js.map +1 -0
  418. package/dist/shared/arrays.d.ts +37 -0
  419. package/dist/shared/component/Arrow.d.ts +34 -0
  420. package/dist/shared/component/Arrow.vue.js +45 -0
  421. package/dist/shared/component/Arrow.vue.js.map +1 -0
  422. package/dist/shared/component/Arrow.vue2.js +5 -0
  423. package/dist/shared/component/Arrow.vue2.js.map +1 -0
  424. package/dist/shared/component/BaseSeparator.d.ts +26 -0
  425. package/dist/shared/component/index.d.ts +2 -0
  426. package/dist/shared/constant/countryList.d.ts +1 -0
  427. package/dist/shared/constant/index.d.ts +1 -0
  428. package/dist/shared/createContext.d.ts +8 -0
  429. package/dist/shared/createContext.js +26 -0
  430. package/dist/shared/createContext.js.map +1 -0
  431. package/dist/shared/date/comparators.d.ts +27 -0
  432. package/dist/shared/date/comparators.js +27 -0
  433. package/dist/shared/date/comparators.js.map +1 -0
  434. package/dist/shared/date/index.d.ts +8 -0
  435. package/dist/shared/date/parser.d.ts +37 -0
  436. package/dist/shared/date/parser.js +161 -0
  437. package/dist/shared/date/parser.js.map +1 -0
  438. package/dist/shared/date/parts.d.ts +12 -0
  439. package/dist/shared/date/parts.js +17 -0
  440. package/dist/shared/date/parts.js.map +1 -0
  441. package/dist/shared/date/placeholders.d.ts +8 -0
  442. package/dist/shared/date/placeholders.js +196 -0
  443. package/dist/shared/date/placeholders.js.map +1 -0
  444. package/dist/shared/date/segment.d.ts +5 -0
  445. package/dist/shared/date/segment.js +44 -0
  446. package/dist/shared/date/segment.js.map +1 -0
  447. package/dist/shared/date/types.d.ts +37 -0
  448. package/dist/shared/date/useDateField.d.ts +142 -0
  449. package/dist/shared/date/useDateField.js +618 -0
  450. package/dist/shared/date/useDateField.js.map +1 -0
  451. package/dist/shared/date/utils.d.ts +11 -0
  452. package/dist/shared/date/utils.js +76 -0
  453. package/dist/shared/date/utils.js.map +1 -0
  454. package/dist/shared/getActiveElement.d.ts +1 -0
  455. package/dist/shared/getActiveElement.js +14 -0
  456. package/dist/shared/getActiveElement.js.map +1 -0
  457. package/dist/shared/handleAndDispatchCustomEvent.d.ts +3 -0
  458. package/dist/shared/handleAndDispatchCustomEvent.js +15 -0
  459. package/dist/shared/handleAndDispatchCustomEvent.js.map +1 -0
  460. package/dist/shared/index.d.ts +22 -0
  461. package/dist/shared/nullish.d.ts +1 -0
  462. package/dist/shared/nullish.js +7 -0
  463. package/dist/shared/nullish.js.map +1 -0
  464. package/dist/shared/onFocusOutside.d.ts +2 -0
  465. package/dist/shared/renderSlotFragments.d.ts +2 -0
  466. package/dist/shared/renderSlotFragments.js +14 -0
  467. package/dist/shared/renderSlotFragments.js.map +1 -0
  468. package/dist/shared/trap-focus.d.ts +1 -0
  469. package/dist/shared/types.d.ts +48 -0
  470. package/dist/shared/useDateFormatter.d.ts +30 -0
  471. package/dist/shared/useDateFormatter.js +121 -0
  472. package/dist/shared/useDateFormatter.js.map +1 -0
  473. package/dist/shared/useDirection.d.ts +8 -0
  474. package/dist/shared/useDirection.js +12 -0
  475. package/dist/shared/useDirection.js.map +1 -0
  476. package/dist/shared/useEmitAsProps.d.ts +10 -0
  477. package/dist/shared/useEmitAsProps.js +19 -0
  478. package/dist/shared/useEmitAsProps.js.map +1 -0
  479. package/dist/shared/useFocusGuards.d.ts +5 -0
  480. package/dist/shared/useFocusGuards.js +39 -0
  481. package/dist/shared/useFocusGuards.js.map +1 -0
  482. package/dist/shared/useForwardExpose.d.ts +6 -0
  483. package/dist/shared/useForwardExpose.js +49 -0
  484. package/dist/shared/useForwardExpose.js.map +1 -0
  485. package/dist/shared/useForwardProps.d.ts +9 -0
  486. package/dist/shared/useForwardProps.js +27 -0
  487. package/dist/shared/useForwardProps.js.map +1 -0
  488. package/dist/shared/useForwardPropsEmits.d.ts +14 -0
  489. package/dist/shared/useForwardPropsEmits.js +15 -0
  490. package/dist/shared/useForwardPropsEmits.js.map +1 -0
  491. package/dist/shared/useId.d.ts +9 -0
  492. package/dist/shared/useId.js +19 -0
  493. package/dist/shared/useId.js.map +1 -0
  494. package/dist/shared/useIsUsingKeyboard.d.ts +3 -0
  495. package/dist/shared/useKbd.d.ts +78 -0
  496. package/dist/shared/useKbd.js +42 -0
  497. package/dist/shared/useKbd.js.map +1 -0
  498. package/dist/shared/useLocale.d.ts +7 -0
  499. package/dist/shared/useLocale.js +12 -0
  500. package/dist/shared/useLocale.js.map +1 -0
  501. package/dist/shared/useNonce.d.ts +2 -0
  502. package/dist/shared/useSize.d.ts +5 -0
  503. package/dist/shared/useSize.js +44 -0
  504. package/dist/shared/useSize.js.map +1 -0
  505. package/dist/shared/useStateMachine.d.ts +25 -0
  506. package/dist/shared/useStateMachine.js +19 -0
  507. package/dist/shared/useStateMachine.js.map +1 -0
  508. package/dist/shared/withDefault.d.ts +22 -0
  509. package/package.json +72 -0
  510. package/src/components/Calendar/CalendarCell.vue +39 -0
  511. package/src/components/Calendar/CalendarCellTrigger.vue +206 -0
  512. package/src/components/Calendar/CalendarGrid.vue +35 -0
  513. package/src/components/Calendar/CalendarGridBody.vue +19 -0
  514. package/src/components/Calendar/CalendarGridHead.vue +19 -0
  515. package/src/components/Calendar/CalendarGridRow.vue +17 -0
  516. package/src/components/Calendar/CalendarHeadCell.vue +17 -0
  517. package/src/components/Calendar/CalendarHeader.vue +17 -0
  518. package/src/components/Calendar/CalendarHeading.vue +32 -0
  519. package/src/components/Calendar/CalendarMonthHeading.vue +65 -0
  520. package/src/components/Calendar/CalendarMonthYearOverlay.vue +48 -0
  521. package/src/components/Calendar/CalendarNext.vue +51 -0
  522. package/src/components/Calendar/CalendarOverlayItem.vue +30 -0
  523. package/src/components/Calendar/CalendarPrev.vue +51 -0
  524. package/src/components/Calendar/CalendarRoot.vue +394 -0
  525. package/src/components/Calendar/CalendarYearHeading.vue +63 -0
  526. package/src/components/Calendar/index.ts +63 -0
  527. package/src/components/Calendar/useCalendar.ts +453 -0
  528. package/src/components/ConfigProvider/ConfigProvider.vue +73 -0
  529. package/src/components/ConfigProvider/index.ts +5 -0
  530. package/src/components/DateField/DateFieldInput.vue +72 -0
  531. package/src/components/DateField/DateFieldRoot.vue +359 -0
  532. package/src/components/DateField/index.ts +10 -0
  533. package/src/components/DatePicker/DatePickerAnchor.vue +16 -0
  534. package/src/components/DatePicker/DatePickerArrow.vue +16 -0
  535. package/src/components/DatePicker/DatePickerCalendar.vue +62 -0
  536. package/src/components/DatePicker/DatePickerCell.vue +16 -0
  537. package/src/components/DatePicker/DatePickerCellTrigger.vue +18 -0
  538. package/src/components/DatePicker/DatePickerClose.vue +16 -0
  539. package/src/components/DatePicker/DatePickerContent.vue +50 -0
  540. package/src/components/DatePicker/DatePickerField.vue +53 -0
  541. package/src/components/DatePicker/DatePickerGrid.vue +16 -0
  542. package/src/components/DatePicker/DatePickerGridBody.vue +16 -0
  543. package/src/components/DatePicker/DatePickerGridHead.vue +16 -0
  544. package/src/components/DatePicker/DatePickerGridRow.vue +16 -0
  545. package/src/components/DatePicker/DatePickerHeadCell.vue +16 -0
  546. package/src/components/DatePicker/DatePickerHeader.vue +16 -0
  547. package/src/components/DatePicker/DatePickerHeading.vue +24 -0
  548. package/src/components/DatePicker/DatePickerInput.vue +16 -0
  549. package/src/components/DatePicker/DatePickerMonthHeading.vue +19 -0
  550. package/src/components/DatePicker/DatePickerMonthYearOverlay.vue +13 -0
  551. package/src/components/DatePicker/DatePickerNext.vue +19 -0
  552. package/src/components/DatePicker/DatePickerOverlayItem.vue +16 -0
  553. package/src/components/DatePicker/DatePickerPrev.vue +18 -0
  554. package/src/components/DatePicker/DatePickerRoot.vue +216 -0
  555. package/src/components/DatePicker/DatePickerTrigger.vue +29 -0
  556. package/src/components/DatePicker/DatePickerYearHeading.vue +19 -0
  557. package/src/components/DatePicker/index.ts +92 -0
  558. package/src/components/DismissableLayer/DismissableLayer.vue +175 -0
  559. package/src/components/DismissableLayer/DismissableLayerBranch.vue +28 -0
  560. package/src/components/DismissableLayer/index.ts +7 -0
  561. package/src/components/DismissableLayer/utils.ts +194 -0
  562. package/src/components/FocusScope/FocusScope.vue +220 -0
  563. package/src/components/FocusScope/index.ts +5 -0
  564. package/src/components/FocusScope/stack.ts +49 -0
  565. package/src/components/FocusScope/utils.ts +108 -0
  566. package/src/components/Popover/PopoverAnchor.vue +30 -0
  567. package/src/components/Popover/PopoverArrow.vue +23 -0
  568. package/src/components/Popover/PopoverClose.vue +29 -0
  569. package/src/components/Popover/PopoverContent.vue +41 -0
  570. package/src/components/Popover/PopoverContentImpl.vue +97 -0
  571. package/src/components/Popover/PopoverContentNonModal.vue +74 -0
  572. package/src/components/Popover/PopoverPortal.vue +17 -0
  573. package/src/components/Popover/PopoverRoot.vue +83 -0
  574. package/src/components/Popover/PopoverTrigger.vue +48 -0
  575. package/src/components/Popover/index.ts +31 -0
  576. package/src/components/Popper/PopperAnchor.vue +36 -0
  577. package/src/components/Popper/PopperArrow.vue +81 -0
  578. package/src/components/Popper/PopperContent.vue +399 -0
  579. package/src/components/Popper/PopperRoot.vue +36 -0
  580. package/src/components/Popper/index.ts +15 -0
  581. package/src/components/Popper/utils.ts +63 -0
  582. package/src/components/Presence/Presence.ts +91 -0
  583. package/src/components/Presence/index.ts +1 -0
  584. package/src/components/Presence/usePresence.ts +175 -0
  585. package/src/components/Primitive/Primitive.ts +66 -0
  586. package/src/components/Primitive/Slot.ts +40 -0
  587. package/src/components/Primitive/index.ts +3 -0
  588. package/src/components/Primitive/usePrimitiveElement.ts +13 -0
  589. package/src/components/Teleport/Teleport.vue +49 -0
  590. package/src/components/Teleport/index.ts +1 -0
  591. package/src/components/VisuallyHidden/VisuallyHidden.vue +47 -0
  592. package/src/components/VisuallyHidden/VisuallyHiddenInput.vue +67 -0
  593. package/src/components/VisuallyHidden/VisuallyHiddenInputBubble.vue +56 -0
  594. package/src/components/VisuallyHidden/index.ts +2 -0
  595. package/src/date/calendar.ts +242 -0
  596. package/src/date/comparators.ts +199 -0
  597. package/src/date/index.ts +3 -0
  598. package/src/date/types.ts +37 -0
  599. package/src/date/utils.ts +18 -0
  600. package/src/index.ts +78 -0
  601. package/src/shared/arrays.ts +66 -0
  602. package/src/shared/component/Arrow.vue +55 -0
  603. package/src/shared/component/BaseSeparator.vue +57 -0
  604. package/src/shared/component/index.ts +2 -0
  605. package/src/shared/constant/countryList.ts +251 -0
  606. package/src/shared/constant/index.ts +1 -0
  607. package/src/shared/createContext.ts +57 -0
  608. package/src/shared/date/comparators.ts +74 -0
  609. package/src/shared/date/index.ts +42 -0
  610. package/src/shared/date/parser.ts +252 -0
  611. package/src/shared/date/parts.ts +32 -0
  612. package/src/shared/date/placeholders.ts +221 -0
  613. package/src/shared/date/segment.ts +50 -0
  614. package/src/shared/date/types.ts +50 -0
  615. package/src/shared/date/useDateField.ts +998 -0
  616. package/src/shared/date/utils.ts +84 -0
  617. package/src/shared/getActiveElement.ts +12 -0
  618. package/src/shared/handleAndDispatchCustomEvent.ts +21 -0
  619. package/src/shared/index.ts +27 -0
  620. package/src/shared/nullish.ts +3 -0
  621. package/src/shared/onFocusOutside.ts +29 -0
  622. package/src/shared/renderSlotFragments.ts +13 -0
  623. package/src/shared/trap-focus.ts +45 -0
  624. package/src/shared/types.ts +64 -0
  625. package/src/shared/useDateFormatter.ts +186 -0
  626. package/src/shared/useDirection.ts +16 -0
  627. package/src/shared/useEmitAsProps.ts +32 -0
  628. package/src/shared/useFocusGuards.ts +46 -0
  629. package/src/shared/useForwardExpose.ts +66 -0
  630. package/src/shared/useForwardProps.ts +43 -0
  631. package/src/shared/useForwardPropsEmits.ts +26 -0
  632. package/src/shared/useId.ts +34 -0
  633. package/src/shared/useIsUsingKeyboard.ts +22 -0
  634. package/src/shared/useKbd.ts +58 -0
  635. package/src/shared/useLocale.ts +15 -0
  636. package/src/shared/useNonce.ts +10 -0
  637. package/src/shared/useSize.ts +64 -0
  638. package/src/shared/useStateMachine.ts +48 -0
  639. package/src/shared/withDefault.ts +61 -0
@@ -0,0 +1,998 @@
1
+ import type {
2
+ CalendarDateTime,
3
+ CycleTimeOptions,
4
+ DateFields,
5
+ DateValue,
6
+ TimeFields,
7
+ } from "@internationalized/date";
8
+ import type { Ref } from "vue";
9
+ import type {
10
+ AnyExceptLiteral,
11
+ DateStep,
12
+ HourCycle,
13
+ SegmentPart,
14
+ SegmentValueObj,
15
+ } from "./types";
16
+ import type { Formatter } from "..";
17
+ import { computed } from "vue";
18
+ import { getDaysInMonth, toDate } from "../../date";
19
+ import { useKbd } from "../useKbd";
20
+ import {
21
+ isAcceptableSegmentKey,
22
+ isNumberString,
23
+ isSegmentNavigationKey,
24
+ } from "./segment";
25
+
26
+ type MinuteSecondIncrementProps = {
27
+ e: KeyboardEvent;
28
+ part: keyof TimeFields;
29
+ dateRef: DateValue;
30
+ prevValue: number | null;
31
+ };
32
+
33
+ type DateTimeValueIncrementation = {
34
+ e: KeyboardEvent;
35
+ part: keyof Omit<DateFields, "era"> | keyof TimeFields;
36
+ dateRef: DateValue;
37
+ prevValue: number | null;
38
+ hourCycle?: HourCycle;
39
+ };
40
+
41
+ type SegmentAttrProps = {
42
+ disabled: boolean;
43
+ segmentValues: SegmentValueObj;
44
+ hourCycle: HourCycle;
45
+ placeholder: DateValue;
46
+ formatter: Formatter;
47
+ };
48
+
49
+ function commonSegmentAttrs(props: SegmentAttrProps) {
50
+ return {
51
+ role: "spinbutton",
52
+ contenteditable: true,
53
+ tabindex: props.disabled ? undefined : 0,
54
+ spellcheck: false,
55
+ inputmode: "numeric",
56
+ autocorrect: "off",
57
+ enterkeyhint: "next",
58
+ style: "caret-color: transparent;",
59
+ };
60
+ }
61
+
62
+ function daySegmentAttrs(props: SegmentAttrProps) {
63
+ const { segmentValues, placeholder } = props;
64
+ const isEmpty = segmentValues.day === null;
65
+ const date = segmentValues.day
66
+ ? placeholder.set({ day: segmentValues.day })
67
+ : placeholder;
68
+
69
+ const valueNow = date.day;
70
+ const valueMin = 1;
71
+ const valueMax = getDaysInMonth(date);
72
+ const valueText = isEmpty ? "Empty" : `${valueNow}`;
73
+
74
+ return {
75
+ ...commonSegmentAttrs(props),
76
+ "aria-label": "day,",
77
+ "aria-valuemin": valueMin,
78
+ "aria-valuemax": valueMax,
79
+ "aria-valuenow": valueNow,
80
+ "aria-valuetext": valueText,
81
+ "data-placeholder": isEmpty ? "" : undefined,
82
+ };
83
+ }
84
+
85
+ function monthSegmentAttrs(props: SegmentAttrProps) {
86
+ const { segmentValues, placeholder, formatter } = props;
87
+ const isEmpty = segmentValues.month === null;
88
+ const date = segmentValues.month
89
+ ? placeholder.set({ month: segmentValues.month })
90
+ : placeholder;
91
+ const valueNow = date.month;
92
+ const valueMin = 1;
93
+ const valueMax = 12;
94
+ const valueText = isEmpty
95
+ ? "Empty"
96
+ : `${valueNow} - ${formatter.fullMonth(toDate(date))}`;
97
+
98
+ return {
99
+ ...commonSegmentAttrs(props),
100
+ "aria-label": "month, ",
101
+ contenteditable: true,
102
+ "aria-valuemin": valueMin,
103
+ "aria-valuemax": valueMax,
104
+ "aria-valuenow": valueNow,
105
+ "aria-valuetext": valueText,
106
+ "data-placeholder": isEmpty ? "" : undefined,
107
+ };
108
+ }
109
+
110
+ function yearSegmentAttrs(props: SegmentAttrProps) {
111
+ const { segmentValues, placeholder } = props;
112
+ const isEmpty = segmentValues.year === null;
113
+ const date = segmentValues.year
114
+ ? placeholder.set({ year: segmentValues.year })
115
+ : placeholder;
116
+ const valueMin = 1;
117
+ const valueMax = 9999;
118
+ const valueNow = date.year;
119
+ const valueText = isEmpty ? "Empty" : `${valueNow}`;
120
+
121
+ return {
122
+ ...commonSegmentAttrs(props),
123
+ "aria-label": "year, ",
124
+ "aria-valuemin": valueMin,
125
+ "aria-valuemax": valueMax,
126
+ "aria-valuenow": valueNow,
127
+ "aria-valuetext": valueText,
128
+ "data-placeholder": isEmpty ? "" : undefined,
129
+ };
130
+ }
131
+
132
+ function hourSegmentAttrs(props: SegmentAttrProps) {
133
+ const { segmentValues, hourCycle, placeholder } = props;
134
+
135
+ if (!("hour" in segmentValues) || !("hour" in placeholder)) return {};
136
+ const isEmpty = segmentValues.hour === null;
137
+ const date = segmentValues.hour
138
+ ? placeholder.set({ hour: segmentValues.hour })
139
+ : placeholder;
140
+ const valueMin = hourCycle === 12 ? 1 : 0;
141
+ const valueMax = hourCycle === 12 ? 12 : 23;
142
+ const valueNow = date.hour;
143
+ const valueText = isEmpty
144
+ ? "Empty"
145
+ : `${valueNow} ${segmentValues.dayPeriod ?? ""}`;
146
+
147
+ return {
148
+ ...commonSegmentAttrs(props),
149
+ "aria-label": "hour, ",
150
+ "aria-valuemin": valueMin,
151
+ "aria-valuemax": valueMax,
152
+ "aria-valuenow": valueNow,
153
+ "aria-valuetext": valueText,
154
+ "data-placeholder": isEmpty ? "" : undefined,
155
+ };
156
+ }
157
+
158
+ function minuteSegmentAttrs(props: SegmentAttrProps) {
159
+ const { segmentValues, placeholder } = props;
160
+ if (!("minute" in segmentValues) || !("minute" in placeholder)) return {};
161
+ const isEmpty = segmentValues.minute === null;
162
+ const date = segmentValues.minute
163
+ ? placeholder.set({ minute: segmentValues.minute })
164
+ : placeholder;
165
+ const valueNow = date.minute;
166
+ const valueMin = 0;
167
+ const valueMax = 59;
168
+ const valueText = isEmpty ? "Empty" : `${valueNow}`;
169
+
170
+ return {
171
+ ...commonSegmentAttrs(props),
172
+ "aria-label": "minute, ",
173
+ "aria-valuemin": valueMin,
174
+ "aria-valuemax": valueMax,
175
+ "aria-valuenow": valueNow,
176
+ "aria-valuetext": valueText,
177
+ "data-placeholder": isEmpty ? "" : undefined,
178
+ };
179
+ }
180
+
181
+ function secondSegmentAttrs(props: SegmentAttrProps) {
182
+ const { segmentValues, placeholder } = props;
183
+ if (!("second" in segmentValues) || !("second" in placeholder)) return {};
184
+ const isEmpty = segmentValues.second === null;
185
+ const date = segmentValues.second
186
+ ? placeholder.set({ second: segmentValues.second })
187
+ : placeholder;
188
+ const valueNow = date.second;
189
+ const valueMin = 0;
190
+ const valueMax = 59;
191
+ const valueText = isEmpty ? "Empty" : `${valueNow}`;
192
+
193
+ return {
194
+ ...commonSegmentAttrs(props),
195
+ "aria-label": "second, ",
196
+ "aria-valuemin": valueMin,
197
+ "aria-valuemax": valueMax,
198
+ "aria-valuenow": valueNow,
199
+ "aria-valuetext": valueText,
200
+ "data-placeholder": isEmpty ? "" : undefined,
201
+ };
202
+ }
203
+
204
+ function dayPeriodSegmentAttrs(props: SegmentAttrProps) {
205
+ const { segmentValues } = props;
206
+ if (!("dayPeriod" in segmentValues)) return {};
207
+
208
+ const valueMin = 0;
209
+ const valueMax = 12;
210
+ const valueNow = segmentValues.hour
211
+ ? segmentValues.hour > 12
212
+ ? segmentValues.hour - 12
213
+ : segmentValues.hour
214
+ : 0;
215
+ const valueText = segmentValues.dayPeriod ?? "AM";
216
+
217
+ return {
218
+ ...commonSegmentAttrs(props),
219
+ inputmode: "text",
220
+ "aria-label": "AM/PM",
221
+ "aria-valuemin": valueMin,
222
+ "aria-valuemax": valueMax,
223
+ "aria-valuenow": valueNow,
224
+ "aria-valuetext": valueText,
225
+ };
226
+ }
227
+
228
+ function literalSegmentAttrs(_props: SegmentAttrProps) {
229
+ return {
230
+ "aria-hidden": true,
231
+ "data-segment": "literal",
232
+ };
233
+ }
234
+
235
+ function timeZoneSegmentAttrs(props: SegmentAttrProps) {
236
+ return {
237
+ role: "textbox",
238
+ "aria-label": "timezone, ",
239
+ "data-readonly": true,
240
+ "data-segment": "timeZoneName",
241
+ tabindex: props.disabled ? undefined : 0,
242
+ style: "caret-color: transparent;",
243
+ };
244
+ }
245
+
246
+ function eraSegmentAttrs(props: SegmentAttrProps) {
247
+ const { segmentValues, placeholder } = props;
248
+
249
+ const valueMin = 0;
250
+ const valueMax = 0;
251
+ const valueNow = 0;
252
+ const valueText =
253
+ "era" in segmentValues ? segmentValues.era : placeholder.era;
254
+
255
+ return {
256
+ ...commonSegmentAttrs(props),
257
+ "aria-label": "era",
258
+ "aria-valuemin": valueMin,
259
+ "aria-valuemax": valueMax,
260
+ "aria-valuenow": valueNow,
261
+ "aria-valuetext": valueText,
262
+ };
263
+ }
264
+
265
+ export const segmentBuilders = {
266
+ day: {
267
+ attrs: daySegmentAttrs,
268
+ },
269
+ month: {
270
+ attrs: monthSegmentAttrs,
271
+ },
272
+ year: {
273
+ attrs: yearSegmentAttrs,
274
+ },
275
+ hour: {
276
+ attrs: hourSegmentAttrs,
277
+ },
278
+ minute: {
279
+ attrs: minuteSegmentAttrs,
280
+ },
281
+ second: {
282
+ attrs: secondSegmentAttrs,
283
+ },
284
+ dayPeriod: {
285
+ attrs: dayPeriodSegmentAttrs,
286
+ },
287
+ literal: {
288
+ attrs: literalSegmentAttrs,
289
+ },
290
+ timeZoneName: {
291
+ attrs: timeZoneSegmentAttrs,
292
+ },
293
+ era: {
294
+ attrs: eraSegmentAttrs,
295
+ },
296
+ };
297
+
298
+ export type UseDateFieldProps = {
299
+ hasLeftFocus: Ref<boolean>;
300
+ lastKeyZero: Ref<boolean>;
301
+ placeholder: Ref<DateValue>;
302
+ hourCycle: HourCycle;
303
+ step: Ref<DateStep>;
304
+ formatter: Formatter;
305
+ segmentValues: Ref<SegmentValueObj>;
306
+ disabled: Ref<boolean>;
307
+ readonly: Ref<boolean>;
308
+ part: SegmentPart;
309
+ modelValue: Ref<DateValue | undefined>;
310
+ focusNext: () => void;
311
+ };
312
+
313
+ export function useDateField(props: UseDateFieldProps) {
314
+ const kbd = useKbd();
315
+
316
+ function minuteSecondIncrementation({
317
+ e,
318
+ part,
319
+ dateRef,
320
+ prevValue,
321
+ }: MinuteSecondIncrementProps): number {
322
+ const step = props.step.value[part] ?? 1;
323
+ const sign = e.key === kbd.ARROW_UP ? step : -step;
324
+ const min = 0;
325
+ const max = 59;
326
+
327
+ if (prevValue === null) return sign > 0 ? min : max;
328
+
329
+ const cycleArgs: [keyof TimeFields, number] = [part, sign];
330
+ return (dateRef as CalendarDateTime)
331
+ .set({ [part]: prevValue })
332
+ .cycle(...cycleArgs)[part];
333
+ }
334
+
335
+ function deleteValue(prevValue: number | null) {
336
+ props.hasLeftFocus.value = false;
337
+ if (prevValue === null) return prevValue;
338
+
339
+ const str = prevValue.toString();
340
+ if (str.length === 1) {
341
+ props.modelValue.value = undefined;
342
+ return null;
343
+ }
344
+
345
+ return Number.parseInt(str.slice(0, -1));
346
+ }
347
+ function dateTimeValueIncrementation({
348
+ e,
349
+ part,
350
+ dateRef,
351
+ prevValue,
352
+ hourCycle,
353
+ }: DateTimeValueIncrementation): number {
354
+ const step = props.step.value[part] ?? 1;
355
+ const sign = e.key === kbd.ARROW_UP ? step : -step;
356
+
357
+ if (prevValue === null)
358
+ return dateRef[part as keyof Omit<DateFields, "era">];
359
+
360
+ if (part === "hour" && "hour" in dateRef) {
361
+ const cycleArgs: [
362
+ keyof DateFields | keyof TimeFields,
363
+ number,
364
+ CycleTimeOptions?,
365
+ ] = [part, sign, { hourCycle }];
366
+ return dateRef
367
+ .set({ [part as keyof DateValue]: prevValue })
368
+ .cycle(...cycleArgs)[part];
369
+ }
370
+
371
+ const cycleArgs: [keyof DateFields, number] = [
372
+ part as keyof DateFields,
373
+ sign,
374
+ ];
375
+ if (part === "day") {
376
+ return dateRef
377
+ .set({
378
+ [part as keyof DateValue]: prevValue,
379
+ /**
380
+ * Edge case for the day field:
381
+ *
382
+ * 1. If the month is filled,
383
+ * we need to ensure that the day snaps to the maximum value of that month.
384
+ * 2. If the month is not filled,
385
+ * we default to the month with the maximum number of days (here just using January, 31 days),
386
+ * so that user can input any possible day.
387
+ */
388
+ month: props.segmentValues.value.month ?? 1,
389
+ })
390
+ .cycle(...cycleArgs)[part as keyof Omit<DateFields, "era">];
391
+ }
392
+
393
+ return dateRef
394
+ .set({ [part as keyof DateValue]: prevValue })
395
+ .cycle(...cycleArgs)[part as keyof Omit<DateFields, "era">];
396
+ }
397
+ function updateDayOrMonth(max: number, num: number, prev: number | null) {
398
+ let moveToNext = false;
399
+ const maxStart = Math.floor(max / 10);
400
+
401
+ /**
402
+ * If the user has left the segment, we want to reset the
403
+ * `prev` value so that we can start the segment over again
404
+ * when the user types a number.
405
+ */
406
+ if (props.hasLeftFocus.value) {
407
+ props.hasLeftFocus.value = false;
408
+ prev = null;
409
+ }
410
+
411
+ if (prev === null) {
412
+ /**
413
+ * If the user types a 0 as the first number, we want
414
+ * to keep track of that so that when they type the next
415
+ * number, we can move to the next segment.
416
+ */
417
+
418
+ if (num === 0) {
419
+ props.lastKeyZero.value = true;
420
+ return { value: null, moveToNext };
421
+ }
422
+ /**
423
+ * If the last key was a 0, or if the first number is
424
+ * greater than the max start digit (0-3 in most cases), then
425
+ * we want to move to the next segment, since it's not possible
426
+ * to continue typing a valid number in this segment.
427
+ */
428
+
429
+ if (props.lastKeyZero.value || num > maxStart) {
430
+ // move to next
431
+ moveToNext = true;
432
+ }
433
+ props.lastKeyZero.value = false;
434
+ /**
435
+ * If none of the above conditions are met, then we can just
436
+ * return the number as the segment value and continue typing
437
+ * in this segment.
438
+ */
439
+ return { value: num, moveToNext };
440
+ }
441
+
442
+ /**
443
+ * If the number of digits is 2, or if the total with the existing digit
444
+ * and the pressed digit is greater than the maximum value for this
445
+ * month, then we will reset the segment as if the user had pressed the
446
+ * backspace key and then typed the number.
447
+ */
448
+ const digits = prev.toString().length;
449
+ const total = Number.parseInt(prev.toString() + num.toString());
450
+ /**
451
+ * If the number of digits is 2, or if the total with the existing digit
452
+ * and the pressed digit is greater than the maximum value for this
453
+ * month, then we will reset the segment as if the user had pressed the
454
+ * backspace key and then typed the number.
455
+ */
456
+
457
+ if (digits === 2 || total > max) {
458
+ /**
459
+ * As we're doing elsewhere, we're checking if the number is greater
460
+ * than the max start digit (0-3 in most months), and if so, we're
461
+ * going to move to the next segment.
462
+ */
463
+ if (num > maxStart || total > max) {
464
+ // move to next
465
+ moveToNext = true;
466
+ }
467
+ return { value: num, moveToNext };
468
+ }
469
+ // move to next
470
+ moveToNext = true;
471
+ return { value: total, moveToNext };
472
+ }
473
+
474
+ function updateMinuteOrSecond(num: number, prev: number | null) {
475
+ const max = 59;
476
+ let moveToNext = false;
477
+ const maxStart = Math.floor(max / 10);
478
+
479
+ /**
480
+ * If the user has left the segment, we want to reset the
481
+ * `prev` value so that we can start the segment over again
482
+ * when the user types a number.
483
+ */
484
+ if (props.hasLeftFocus.value) {
485
+ props.hasLeftFocus.value = false;
486
+ prev = null;
487
+ }
488
+
489
+ if (prev === null) {
490
+ /**
491
+ * If the user types a 0 as the first number, we want
492
+ * to keep track of that so that when they type the next
493
+ * number, we can move to the next segment.
494
+ */
495
+
496
+ if (num === 0) {
497
+ props.lastKeyZero.value = true;
498
+ return { value: 0, moveToNext };
499
+ }
500
+ /**
501
+ * If the last key was a 0, or if the first number is
502
+ * greater than the max start digit (0-3 in most cases), then
503
+ * we want to move to the next segment, since it's not possible
504
+ * to continue typing a valid number in this segment.
505
+ */
506
+
507
+ if (props.lastKeyZero.value || num > maxStart) {
508
+ // move to next
509
+ moveToNext = true;
510
+ }
511
+ props.lastKeyZero.value = false;
512
+ /**
513
+ * If none of the above conditions are met, then we can just
514
+ * return the number as the segment value and continue typing
515
+ * in this segment.
516
+ */
517
+ return { value: num, moveToNext };
518
+ }
519
+
520
+ /**
521
+ * If the number of digits is 2, or if the total with the existing digit
522
+ * and the pressed digit is greater than the maximum value for this
523
+ * month, then we will reset the segment as if the user had pressed the
524
+ * backspace key and then typed the number.
525
+ */
526
+ const digits = prev.toString().length;
527
+ const total = Number.parseInt(prev.toString() + num.toString());
528
+
529
+ /**
530
+ * If the number of digits is 2, or if the total with the existing digit
531
+ * and the pressed digit is greater than the maximum value for this
532
+ * month, then we will reset the segment as if the user had pressed the
533
+ * backspace key and then typed the number.
534
+ */
535
+
536
+ if (digits === 2 || total > max) {
537
+ /**
538
+ * As we're doing elsewhere, we're checking if the number is greater
539
+ * than the max start digit (0-3 in most months), and if so, we're
540
+ * going to move to the next segment.
541
+ */
542
+ if (num > maxStart) {
543
+ // move to next
544
+ moveToNext = true;
545
+ }
546
+ return { value: num, moveToNext };
547
+ }
548
+ // move to next
549
+ moveToNext = true;
550
+ return { value: total, moveToNext };
551
+ }
552
+
553
+ function updateHour(num: number, prev: number | null) {
554
+ const max = 24;
555
+ let moveToNext = false;
556
+ const maxStart = Math.floor(max / 10);
557
+
558
+ /**
559
+ * If the user has left the segment, we want to reset the
560
+ * `prev` value so that we can start the segment over again
561
+ * when the user types a number.
562
+ */
563
+ // probably not implement, kind of weird
564
+ if (props.hasLeftFocus.value) {
565
+ props.hasLeftFocus.value = false;
566
+ prev = null;
567
+ }
568
+
569
+ if (prev === null) {
570
+ /**
571
+ * If the user types a 0 as the first number, we want
572
+ * to keep track of that so that when they type the next
573
+ * number, we can move to the next segment.
574
+ */
575
+
576
+ if (num === 0) {
577
+ props.lastKeyZero.value = true;
578
+ return { value: 0, moveToNext };
579
+ }
580
+ /**
581
+ * If the last key was a 0, or if the first number is
582
+ * greater than the max start digit (0-3 in most cases), then
583
+ * we want to move to the next segment, since it's not possible
584
+ * to continue typing a valid number in this segment.
585
+ */
586
+
587
+ if (props.lastKeyZero.value || num > maxStart) {
588
+ // move to next
589
+ moveToNext = true;
590
+ }
591
+ props.lastKeyZero.value = false;
592
+ /**
593
+ * If none of the above conditions are met, then we can just
594
+ * return the number as the segment value and continue typing
595
+ * in this segment.
596
+ */
597
+ return { value: num, moveToNext };
598
+ }
599
+
600
+ /**
601
+ * If the number of digits is 2, or if the total with the existing digit
602
+ * and the pressed digit is greater than the maximum value for this
603
+ * month, then we will reset the segment as if the user had pressed the
604
+ * backspace key and then typed the number.
605
+ */
606
+ const digits = prev.toString().length;
607
+ const total = Number.parseInt(prev.toString() + num.toString());
608
+
609
+ /**
610
+ * If the number of digits is 2, or if the total with the existing digit
611
+ * and the pressed digit is greater than the maximum value for this
612
+ * month, then we will reset the segment as if the user had pressed the
613
+ * backspace key and then typed the number.
614
+ */
615
+
616
+ if (digits === 2 || total > max) {
617
+ /**
618
+ * As we're doing elsewhere, we're checking if the number is greater
619
+ * than the max start digit (0-3 in most months), and if so, we're
620
+ * going to move to the next segment.
621
+ */
622
+ if (num > maxStart) {
623
+ // move to next
624
+ moveToNext = true;
625
+ }
626
+ return { value: num, moveToNext };
627
+ }
628
+ // move to next
629
+ moveToNext = true;
630
+ return { value: total, moveToNext };
631
+ }
632
+
633
+ function updateYear(num: number, prev: number | null) {
634
+ let moveToNext = false;
635
+
636
+ /**
637
+ * If the user has left the segment, we want to reset the
638
+ * `prev` value so that we can start the segment over again
639
+ * when the user types a number.
640
+ */
641
+ // probably not implement, kind of weird
642
+ if (props.hasLeftFocus.value) {
643
+ props.hasLeftFocus.value = false;
644
+ prev = null;
645
+ }
646
+
647
+ if (prev === null) return { value: num === 0 ? 1 : num, moveToNext };
648
+
649
+ const str = prev.toString() + num.toString();
650
+
651
+ if (str.length > 4) return { value: num === 0 ? 1 : num, moveToNext };
652
+
653
+ if (str.length === 4) moveToNext = true;
654
+
655
+ const int = Number.parseInt(str);
656
+ return { value: int, moveToNext };
657
+ }
658
+
659
+ const attributes = computed(
660
+ () =>
661
+ segmentBuilders[props.part]?.attrs({
662
+ disabled: props.disabled.value,
663
+ placeholder: props.placeholder.value,
664
+ hourCycle: props.hourCycle,
665
+ segmentValues: props.segmentValues.value,
666
+ formatter: props.formatter,
667
+ }) ?? {},
668
+ );
669
+
670
+ // TODO: look into abstracting segment keydown functions since they have the same structure (checks -> arrow_up, arrow_down update -> number string update -> move to next -> backspace update)
671
+ function handleDaySegmentKeydown(e: KeyboardEvent) {
672
+ if (!isAcceptableSegmentKey(e.key) || isSegmentNavigationKey(e.key)) return;
673
+
674
+ const prevValue = props.segmentValues.value.day;
675
+
676
+ if (e.key === kbd.ARROW_DOWN || e.key === kbd.ARROW_UP) {
677
+ props.segmentValues.value.day = dateTimeValueIncrementation({
678
+ e,
679
+ part: "day",
680
+ dateRef: props.placeholder.value,
681
+ prevValue,
682
+ });
683
+ return;
684
+ }
685
+
686
+ if (isNumberString(e.key)) {
687
+ const num = Number.parseInt(e.key);
688
+ const segmentMonthValue = props.segmentValues.value.month;
689
+
690
+ const daysInMonth = segmentMonthValue
691
+ ? getDaysInMonth(
692
+ props.placeholder.value.set({ month: segmentMonthValue }),
693
+ )
694
+ : // if the month is not set, we default to the maximum number of days in a month
695
+ // so that user can input any possible day
696
+ 31;
697
+
698
+ const { value, moveToNext } = updateDayOrMonth(
699
+ daysInMonth,
700
+ num,
701
+ prevValue,
702
+ );
703
+
704
+ props.segmentValues.value.day = value;
705
+
706
+ if (moveToNext) props.focusNext();
707
+ }
708
+
709
+ if (e.key === kbd.BACKSPACE) {
710
+ props.hasLeftFocus.value = false;
711
+ props.segmentValues.value.day = deleteValue(prevValue);
712
+ }
713
+ }
714
+
715
+ function handleMonthSegmentKeydown(e: KeyboardEvent) {
716
+ if (!isAcceptableSegmentKey(e.key) || isSegmentNavigationKey(e.key)) return;
717
+
718
+ const prevValue = props.segmentValues.value.month;
719
+
720
+ if (e.key === kbd.ARROW_DOWN || e.key === kbd.ARROW_UP) {
721
+ props.segmentValues.value.month = dateTimeValueIncrementation({
722
+ e,
723
+ part: "month",
724
+ dateRef: props.placeholder.value,
725
+ prevValue,
726
+ });
727
+ return;
728
+ }
729
+
730
+ if (isNumberString(e.key)) {
731
+ const num = Number.parseInt(e.key);
732
+ const { value, moveToNext } = updateDayOrMonth(12, num, prevValue);
733
+
734
+ props.segmentValues.value.month = value;
735
+
736
+ if (moveToNext) props.focusNext();
737
+ }
738
+
739
+ if (e.key === kbd.BACKSPACE) {
740
+ props.hasLeftFocus.value = false;
741
+ props.segmentValues.value.month = deleteValue(prevValue);
742
+ }
743
+ }
744
+
745
+ function handleYearSegmentKeydown(e: KeyboardEvent) {
746
+ if (!isAcceptableSegmentKey(e.key) || isSegmentNavigationKey(e.key)) return;
747
+
748
+ const prevValue = props.segmentValues.value.year;
749
+
750
+ if (e.key === kbd.ARROW_DOWN || e.key === kbd.ARROW_UP) {
751
+ props.segmentValues.value.year = dateTimeValueIncrementation({
752
+ e,
753
+ part: "year",
754
+ dateRef: props.placeholder.value,
755
+ prevValue,
756
+ });
757
+ return;
758
+ }
759
+
760
+ if (isNumberString(e.key)) {
761
+ const num = Number.parseInt(e.key);
762
+ const { value, moveToNext } = updateYear(num, prevValue);
763
+
764
+ props.segmentValues.value.year = value;
765
+
766
+ if (moveToNext) props.focusNext();
767
+ }
768
+
769
+ if (e.key === kbd.BACKSPACE) {
770
+ props.hasLeftFocus.value = false;
771
+ props.segmentValues.value.year = deleteValue(prevValue);
772
+ }
773
+ }
774
+
775
+ function handleHourSegmentKeydown(e: KeyboardEvent) {
776
+ const dateRef = props.placeholder.value;
777
+ if (
778
+ !isAcceptableSegmentKey(e.key) ||
779
+ isSegmentNavigationKey(e.key) ||
780
+ !("hour" in dateRef) ||
781
+ !("hour" in props.segmentValues.value)
782
+ )
783
+ return;
784
+
785
+ const prevValue = props.segmentValues.value.hour;
786
+
787
+ const hourCycle = props.hourCycle;
788
+
789
+ if (e.key === kbd.ARROW_UP || e.key === kbd.ARROW_DOWN) {
790
+ props.segmentValues.value.hour = dateTimeValueIncrementation({
791
+ e,
792
+ part: "hour",
793
+ dateRef: props.placeholder.value,
794
+ prevValue,
795
+ hourCycle,
796
+ });
797
+
798
+ if ("dayPeriod" in props.segmentValues.value) {
799
+ if (props.segmentValues.value.hour < 12)
800
+ props.segmentValues.value.dayPeriod = "AM";
801
+ else if (props.segmentValues.value.hour)
802
+ props.segmentValues.value.dayPeriod = "PM";
803
+ }
804
+
805
+ return;
806
+ }
807
+
808
+ if (isNumberString(e.key)) {
809
+ const num = Number.parseInt(e.key);
810
+ const { value, moveToNext } = updateHour(num, prevValue);
811
+
812
+ if ("dayPeriod" in props.segmentValues.value && value && value > 12)
813
+ props.segmentValues.value.dayPeriod = "PM";
814
+ else if ("dayPeriod" in props.segmentValues.value && value)
815
+ props.segmentValues.value.dayPeriod = "AM";
816
+
817
+ props.segmentValues.value.hour = value;
818
+
819
+ if (moveToNext) props.focusNext();
820
+ }
821
+
822
+ if (e.key === kbd.BACKSPACE) {
823
+ props.hasLeftFocus.value = false;
824
+ props.segmentValues.value.hour = deleteValue(prevValue);
825
+ }
826
+ }
827
+
828
+ function handleMinuteSegmentKeydown(e: KeyboardEvent) {
829
+ const dateRef = props.placeholder.value;
830
+
831
+ if (
832
+ !isAcceptableSegmentKey(e.key) ||
833
+ isSegmentNavigationKey(e.key) ||
834
+ !("minute" in dateRef) ||
835
+ !("minute" in props.segmentValues.value)
836
+ )
837
+ return;
838
+
839
+ const prevValue = props.segmentValues.value.minute;
840
+
841
+ if (e.key === kbd.ARROW_UP || e.key === kbd.ARROW_DOWN) {
842
+ props.segmentValues.value.minute = minuteSecondIncrementation({
843
+ e,
844
+ part: "minute",
845
+ dateRef: props.placeholder.value,
846
+ prevValue,
847
+ });
848
+ }
849
+
850
+ if (isNumberString(e.key)) {
851
+ const num = Number.parseInt(e.key);
852
+
853
+ const { value, moveToNext } = updateMinuteOrSecond(num, prevValue);
854
+
855
+ props.segmentValues.value.minute = value;
856
+
857
+ if (moveToNext) props.focusNext();
858
+ }
859
+
860
+ if (e.key === kbd.BACKSPACE) {
861
+ props.hasLeftFocus.value = false;
862
+ props.segmentValues.value.minute = deleteValue(prevValue);
863
+ }
864
+ }
865
+
866
+ function handleSecondSegmentKeydown(e: KeyboardEvent) {
867
+ const dateRef = props.placeholder.value;
868
+
869
+ if (
870
+ !isAcceptableSegmentKey(e.key) ||
871
+ isSegmentNavigationKey(e.key) ||
872
+ !("second" in dateRef) ||
873
+ !("second" in props.segmentValues.value)
874
+ )
875
+ return;
876
+
877
+ const prevValue = props.segmentValues.value.second;
878
+
879
+ if (e.key === kbd.ARROW_UP || e.key === kbd.ARROW_DOWN) {
880
+ props.segmentValues.value.second = minuteSecondIncrementation({
881
+ e,
882
+ part: "second",
883
+ dateRef: props.placeholder.value,
884
+ prevValue,
885
+ });
886
+ }
887
+
888
+ if (isNumberString(e.key)) {
889
+ const num = Number.parseInt(e.key);
890
+ const { value, moveToNext } = updateMinuteOrSecond(num, prevValue);
891
+
892
+ props.segmentValues.value.second = value;
893
+
894
+ if (moveToNext) props.focusNext();
895
+ }
896
+
897
+ if (e.key === kbd.BACKSPACE) {
898
+ props.hasLeftFocus.value = false;
899
+ props.segmentValues.value.second = deleteValue(prevValue);
900
+ }
901
+ }
902
+
903
+ function handleDayPeriodSegmentKeydown(e: KeyboardEvent) {
904
+ if (
905
+ ((!isAcceptableSegmentKey(e.key) || isSegmentNavigationKey(e.key)) &&
906
+ e.key !== "a" &&
907
+ e.key !== "p") ||
908
+ !("hour" in props.placeholder.value) ||
909
+ !("dayPeriod" in props.segmentValues.value)
910
+ )
911
+ return;
912
+
913
+ if (e.key === kbd.ARROW_UP || e.key === kbd.ARROW_DOWN) {
914
+ if (props.segmentValues.value.dayPeriod === "AM") {
915
+ props.segmentValues.value.dayPeriod = "PM";
916
+ props.segmentValues.value.hour = props.segmentValues.value.hour! + 12;
917
+ return;
918
+ }
919
+ props.segmentValues.value.dayPeriod = "AM";
920
+ props.segmentValues.value.hour = props.segmentValues.value.hour! - 12;
921
+ return;
922
+ }
923
+
924
+ if (
925
+ ["a", "A"].includes(e.key) &&
926
+ props.segmentValues.value.dayPeriod !== "AM"
927
+ ) {
928
+ props.segmentValues.value.dayPeriod = "AM";
929
+ props.segmentValues.value.hour = props.segmentValues.value.hour! - 12;
930
+ return;
931
+ }
932
+
933
+ if (
934
+ ["p", "P"].includes(e.key) &&
935
+ props.segmentValues.value.dayPeriod !== "PM"
936
+ ) {
937
+ props.segmentValues.value.dayPeriod = "PM";
938
+ props.segmentValues.value.hour = props.segmentValues.value.hour! + 12;
939
+ }
940
+ }
941
+
942
+ function handleSegmentClick(e: MouseEvent) {
943
+ const disabled = props.disabled.value;
944
+ if (disabled) e.preventDefault();
945
+ }
946
+
947
+ function handleSegmentKeydown(e: KeyboardEvent) {
948
+ const disabled = props.disabled.value;
949
+ const readonly = props.readonly.value;
950
+ if (e.key !== kbd.TAB) e.preventDefault();
951
+
952
+ if (disabled || readonly) return;
953
+ const segmentKeydownHandlers = {
954
+ day: handleDaySegmentKeydown,
955
+ month: handleMonthSegmentKeydown,
956
+ year: handleYearSegmentKeydown,
957
+ hour: handleHourSegmentKeydown,
958
+ minute: handleMinuteSegmentKeydown,
959
+ second: handleSecondSegmentKeydown,
960
+ dayPeriod: handleDayPeriodSegmentKeydown,
961
+ timeZoneName: () => {},
962
+ } as const;
963
+
964
+ segmentKeydownHandlers[props.part as keyof typeof segmentKeydownHandlers](
965
+ e,
966
+ );
967
+
968
+ if (
969
+ ![kbd.ARROW_LEFT, kbd.ARROW_RIGHT].includes(e.key) &&
970
+ e.key !== kbd.TAB &&
971
+ e.key !== kbd.SHIFT &&
972
+ isAcceptableSegmentKey(e.key)
973
+ ) {
974
+ if (
975
+ Object.values(props.segmentValues.value).every((item) => item !== null)
976
+ ) {
977
+ const updateObject = {
978
+ ...(props.segmentValues.value as Record<AnyExceptLiteral, number>),
979
+ };
980
+
981
+ let dateRef = props.placeholder.value.copy();
982
+
983
+ Object.keys(updateObject).forEach((part) => {
984
+ const value = updateObject[part as AnyExceptLiteral];
985
+ dateRef = dateRef.set({ [part]: value });
986
+ });
987
+
988
+ props.modelValue.value = dateRef.copy();
989
+ }
990
+ }
991
+ }
992
+
993
+ return {
994
+ handleSegmentClick,
995
+ handleSegmentKeydown,
996
+ attributes,
997
+ };
998
+ }