@soybeanjs/headless 0.15.4 → 0.16.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 (436) hide show
  1. package/dist/components/autocomplete/autocomplete-compact.js +1 -1
  2. package/dist/components/autocomplete/autocomplete-input.js +1 -1
  3. package/dist/components/autocomplete/autocomplete-input.vue.d.ts +2 -2
  4. package/dist/components/autocomplete/autocomplete-root.js +1 -1
  5. package/dist/components/autocomplete/autocomplete-root.vue.d.ts +12 -2
  6. package/dist/components/autocomplete/context.d.ts +2 -2
  7. package/dist/components/autocomplete/context.js +1 -1
  8. package/dist/components/autocomplete/index.d.ts +17 -13
  9. package/dist/components/autocomplete/index.js +1 -1
  10. package/dist/components/autocomplete/types.d.ts +18 -32
  11. package/dist/components/bottom-sheet/bottom-sheet-root-nested.vue.d.ts +2 -2
  12. package/dist/components/calendar/calendar-cell-trigger.js +1 -0
  13. package/dist/components/calendar/calendar-cell-trigger.vue.d.ts +28 -0
  14. package/dist/components/calendar/calendar-cell.js +1 -0
  15. package/dist/components/{autocomplete/autocomplete-anchor.vue.d.ts → calendar/calendar-cell.vue.d.ts} +3 -3
  16. package/dist/components/calendar/calendar-compact.js +1 -0
  17. package/dist/components/calendar/calendar-compact.vue.d.ts +23 -0
  18. package/dist/components/calendar/calendar-grid-body.js +1 -0
  19. package/dist/components/{combobox/combobox-item-indicator.vue.d.ts → calendar/calendar-grid-body.vue.d.ts} +3 -3
  20. package/dist/components/calendar/calendar-grid-head.js +1 -0
  21. package/dist/components/calendar/calendar-grid-head.vue.d.ts +21 -0
  22. package/dist/components/calendar/calendar-grid-row.js +1 -0
  23. package/dist/components/calendar/calendar-grid-row.vue.d.ts +21 -0
  24. package/dist/components/calendar/calendar-grid.js +1 -0
  25. package/dist/components/calendar/calendar-grid.vue.d.ts +21 -0
  26. package/dist/components/calendar/calendar-head-cell.js +1 -0
  27. package/dist/components/calendar/calendar-head-cell.vue.d.ts +21 -0
  28. package/dist/components/calendar/calendar-header.js +1 -0
  29. package/dist/components/calendar/calendar-header.vue.d.ts +21 -0
  30. package/dist/components/calendar/calendar-heading.js +1 -0
  31. package/dist/components/calendar/calendar-heading.vue.d.ts +22 -0
  32. package/dist/components/calendar/calendar-next.js +1 -0
  33. package/dist/components/calendar/calendar-next.vue.d.ts +24 -0
  34. package/dist/components/calendar/calendar-prev.js +1 -0
  35. package/dist/components/calendar/calendar-prev.vue.d.ts +24 -0
  36. package/dist/components/calendar/calendar-root.js +1 -0
  37. package/dist/components/calendar/calendar-root.vue.d.ts +25 -0
  38. package/dist/components/calendar/context.d.ts +9 -0
  39. package/dist/components/calendar/context.js +1 -0
  40. package/dist/components/calendar/index.d.ts +16 -0
  41. package/dist/components/calendar/index.js +1 -0
  42. package/dist/components/calendar/types.d.ts +165 -0
  43. package/dist/components/calendar/use-calendar.d.ts +45 -0
  44. package/dist/components/calendar/use-calendar.js +1 -0
  45. package/dist/components/card/card-compact.js +1 -0
  46. package/dist/components/card/card-compact.vue.d.ts +19 -0
  47. package/dist/components/card/card-root.vue.d.ts +1 -1
  48. package/dist/components/card/index.d.ts +10 -9
  49. package/dist/components/card/index.js +1 -1
  50. package/dist/components/card/types.d.ts +22 -1
  51. package/dist/components/carousel/carousel-root.vue.d.ts +39 -2
  52. package/dist/components/carousel/index.d.ts +4 -2
  53. package/dist/components/carousel/types.d.ts +8 -8
  54. package/dist/components/checkbox/checkbox-group-root.js +1 -1
  55. package/dist/components/checkbox/checkbox-root.js +1 -1
  56. package/dist/components/checkbox/checkbox-root.vue.d.ts +1 -1
  57. package/dist/components/collapsible/collapsible-root.vue.d.ts +1 -1
  58. package/dist/components/color-area/color-area-root.vue.d.ts +2 -2
  59. package/dist/components/color-picker/color-picker-root.vue.d.ts +2 -2
  60. package/dist/components/color-slider/color-slider-root.vue.d.ts +2 -2
  61. package/dist/components/combobox/combobox-arrow.js +1 -1
  62. package/dist/components/combobox/combobox-arrow.vue.d.ts +2 -2
  63. package/dist/components/combobox/combobox-compact.js +1 -1
  64. package/dist/components/combobox/combobox-compact.vue.d.ts +2 -2
  65. package/dist/components/combobox/combobox-content-impl.js +1 -1
  66. package/dist/components/combobox/combobox-content.vue.d.ts +1 -1
  67. package/dist/components/combobox/combobox-group.vue.d.ts +2 -2
  68. package/dist/components/combobox/combobox-input.js +1 -1
  69. package/dist/components/combobox/combobox-item.js +1 -1
  70. package/dist/components/combobox/combobox-root.js +1 -1
  71. package/dist/components/combobox/combobox-trigger.js +1 -1
  72. package/dist/components/combobox/combobox-virtualizer.js +1 -1
  73. package/dist/components/combobox/context.js +1 -1
  74. package/dist/components/combobox/index.d.ts +12 -10
  75. package/dist/components/combobox/index.js +1 -1
  76. package/dist/components/combobox/types.d.ts +10 -20
  77. package/dist/components/command/command-compact.js +1 -1
  78. package/dist/components/command/types.d.ts +1 -1
  79. package/dist/components/config-provider/config-provider.vue.d.ts +1 -1
  80. package/dist/components/context-menu/context-menu-checkbox-compact.js +1 -1
  81. package/dist/components/context-menu/context-menu-checkbox-compact.vue.d.ts +2 -2
  82. package/dist/components/context-menu/context-menu-compact.js +1 -1
  83. package/dist/components/context-menu/context-menu-compact.vue.d.ts +2 -2
  84. package/dist/components/context-menu/context-menu-content.vue.d.ts +2 -2
  85. package/dist/components/context-menu/context-menu-radio-compact.js +1 -1
  86. package/dist/components/context-menu/context-menu-radio-compact.vue.d.ts +2 -2
  87. package/dist/components/context-menu/context-menu-wrapper-compact.js +1 -1
  88. package/dist/components/context-menu/context-menu-wrapper-compact.vue.d.ts +2 -2
  89. package/dist/components/context-menu/index.d.ts +2 -2
  90. package/dist/components/context-menu/index.js +1 -1
  91. package/dist/components/date-field/context.d.ts +9 -0
  92. package/dist/components/date-field/context.js +1 -0
  93. package/dist/components/date-field/date-field-compact.js +1 -0
  94. package/dist/components/date-field/date-field-compact.vue.d.ts +15 -0
  95. package/dist/components/date-field/date-field-input.js +1 -0
  96. package/dist/components/date-field/date-field-input.vue.d.ts +21 -0
  97. package/dist/components/date-field/date-field-root.js +1 -0
  98. package/dist/components/date-field/date-field-root.vue.d.ts +42 -0
  99. package/dist/components/date-field/index.d.ts +6 -0
  100. package/dist/components/date-field/index.js +1 -0
  101. package/dist/components/date-field/types.d.ts +67 -0
  102. package/dist/components/date-picker/context.d.ts +9 -0
  103. package/dist/components/date-picker/context.js +1 -0
  104. package/dist/components/date-picker/date-picker-popup.js +1 -0
  105. package/dist/components/date-picker/date-picker-popup.vue.d.ts +21 -0
  106. package/dist/components/date-picker/date-picker-root.js +1 -0
  107. package/dist/components/date-picker/date-picker-root.vue.d.ts +43 -0
  108. package/dist/components/date-picker/date-picker-trigger.js +1 -0
  109. package/dist/components/date-picker/date-picker-trigger.vue.d.ts +21 -0
  110. package/dist/components/date-picker/index.d.ts +6 -0
  111. package/dist/components/date-picker/index.js +1 -0
  112. package/dist/components/date-picker/types.d.ts +64 -0
  113. package/dist/components/date-range-field/context.d.ts +9 -0
  114. package/dist/components/date-range-field/context.js +1 -0
  115. package/dist/components/date-range-field/date-range-field-compact.js +1 -0
  116. package/dist/components/date-range-field/date-range-field-compact.vue.d.ts +29 -0
  117. package/dist/components/date-range-field/date-range-field-input.js +1 -0
  118. package/dist/components/date-range-field/date-range-field-input.vue.d.ts +22 -0
  119. package/dist/components/date-range-field/date-range-field-root.js +1 -0
  120. package/dist/components/date-range-field/date-range-field-root.vue.d.ts +55 -0
  121. package/dist/components/date-range-field/index.d.ts +6 -0
  122. package/dist/components/date-range-field/index.js +1 -0
  123. package/dist/components/date-range-field/types.d.ts +88 -0
  124. package/dist/components/date-range-picker/context.d.ts +9 -0
  125. package/dist/components/date-range-picker/context.js +1 -0
  126. package/dist/components/date-range-picker/date-range-picker-compact.js +1 -0
  127. package/dist/components/date-range-picker/date-range-picker-compact.vue.d.ts +31 -0
  128. package/dist/components/date-range-picker/date-range-picker-popup.js +1 -0
  129. package/dist/components/date-range-picker/date-range-picker-popup.vue.d.ts +21 -0
  130. package/dist/components/date-range-picker/date-range-picker-root.js +1 -0
  131. package/dist/components/date-range-picker/date-range-picker-root.vue.d.ts +50 -0
  132. package/dist/components/date-range-picker/date-range-picker-trigger.js +1 -0
  133. package/dist/components/date-range-picker/date-range-picker-trigger.vue.d.ts +21 -0
  134. package/dist/components/date-range-picker/index.d.ts +7 -0
  135. package/dist/components/date-range-picker/index.js +1 -0
  136. package/dist/components/date-range-picker/types.d.ts +93 -0
  137. package/dist/components/dialog/dialog-compact.vue.d.ts +6 -6
  138. package/dist/components/dropdown-menu/dropdown-menu-checkbox-compact.js +1 -1
  139. package/dist/components/dropdown-menu/dropdown-menu-checkbox-compact.vue.d.ts +2 -2
  140. package/dist/components/dropdown-menu/dropdown-menu-compact.js +1 -1
  141. package/dist/components/dropdown-menu/dropdown-menu-compact.vue.d.ts +2 -2
  142. package/dist/components/dropdown-menu/dropdown-menu-content.vue.d.ts +2 -2
  143. package/dist/components/dropdown-menu/dropdown-menu-radio-compact.js +1 -1
  144. package/dist/components/dropdown-menu/dropdown-menu-radio-compact.vue.d.ts +2 -2
  145. package/dist/components/dropdown-menu/dropdown-menu-root.vue.d.ts +1 -1
  146. package/dist/components/dropdown-menu/dropdown-menu-wrapper-compact.js +1 -1
  147. package/dist/components/dropdown-menu/dropdown-menu-wrapper-compact.vue.d.ts +2 -2
  148. package/dist/components/dropdown-menu/index.d.ts +2 -2
  149. package/dist/components/dropdown-menu/index.js +1 -1
  150. package/dist/components/editable/editable-compact.js +1 -0
  151. package/dist/components/editable/editable-compact.vue.d.ts +23 -0
  152. package/dist/components/editable/editable-root.vue.d.ts +2 -2
  153. package/dist/components/editable/index.d.ts +8 -7
  154. package/dist/components/editable/index.js +1 -1
  155. package/dist/components/editable/types.d.ts +28 -2
  156. package/dist/components/hover-card/hover-card-compact.js +1 -0
  157. package/dist/components/hover-card/hover-card-compact.vue.d.ts +30 -0
  158. package/dist/components/hover-card/hover-card-positioner.js +1 -1
  159. package/dist/components/hover-card/hover-card-positioner.vue.d.ts +1 -0
  160. package/dist/components/hover-card/hover-card-root.vue.d.ts +1 -1
  161. package/dist/components/hover-card/index.d.ts +8 -7
  162. package/dist/components/hover-card/index.js +1 -1
  163. package/dist/components/hover-card/types.d.ts +15 -1
  164. package/dist/components/input/input-root.js +1 -1
  165. package/dist/components/input-otp/input-otp-compact.vue.d.ts +2 -2
  166. package/dist/components/input-otp/input-otp-root.vue.d.ts +2 -2
  167. package/dist/components/layout/layout-classic-compact.js +1 -1
  168. package/dist/components/layout/layout-classic-compact.vue.d.ts +1 -1
  169. package/dist/components/layout/layout-classic-root.js +1 -1
  170. package/dist/components/layout/layout-compact.vue.d.ts +1 -1
  171. package/dist/components/layout/layout-root.vue.d.ts +2 -2
  172. package/dist/components/layout/types.d.ts +0 -30
  173. package/dist/components/link/link.vue.d.ts +1 -1
  174. package/dist/components/listbox/index.js +1 -1
  175. package/dist/components/listbox/listbox-root.js +1 -1
  176. package/dist/components/menu/hooks.js +1 -1
  177. package/dist/components/menu/index.d.ts +2 -2
  178. package/dist/components/menu/index.js +1 -1
  179. package/dist/components/menu/menu-checkbox-options-compact.js +1 -1
  180. package/dist/components/menu/menu-content.vue.d.ts +2 -2
  181. package/dist/components/menu/menu-option-compact.js +1 -1
  182. package/dist/components/menu/menu-option-compact.vue.d.ts +2 -2
  183. package/dist/components/menu/menu-options-compact.js +1 -1
  184. package/dist/components/menu/menu-options-compact.vue.d.ts +2 -2
  185. package/dist/components/menu/menu-radio-options-compact.js +1 -1
  186. package/dist/components/menu/menu-sub-content.vue.d.ts +2 -2
  187. package/dist/components/menu/types.d.ts +1 -1
  188. package/dist/components/menubar/index.js +1 -1
  189. package/dist/components/menubar/menubar-compact.js +1 -1
  190. package/dist/components/menubar/menubar-compact.vue.d.ts +2 -2
  191. package/dist/components/menubar/menubar-content.vue.d.ts +2 -2
  192. package/dist/components/menubar/menubar-sub-content.vue.d.ts +2 -2
  193. package/dist/components/month-picker/context.d.ts +9 -0
  194. package/dist/components/month-picker/context.js +1 -0
  195. package/dist/components/month-picker/index.d.ts +6 -0
  196. package/dist/components/month-picker/index.js +1 -0
  197. package/dist/components/month-picker/month-picker-popup.js +1 -0
  198. package/dist/components/month-picker/month-picker-popup.vue.d.ts +36 -0
  199. package/dist/components/month-picker/month-picker-root.js +1 -0
  200. package/dist/components/month-picker/month-picker-root.vue.d.ts +39 -0
  201. package/dist/components/month-picker/month-picker-trigger.js +1 -0
  202. package/dist/components/{autocomplete/autocomplete-trigger.vue.d.ts → month-picker/month-picker-trigger.vue.d.ts} +3 -3
  203. package/dist/components/month-picker/types.d.ts +61 -0
  204. package/dist/components/month-range-picker/context.d.ts +9 -0
  205. package/dist/components/month-range-picker/context.js +1 -0
  206. package/dist/components/month-range-picker/index.d.ts +6 -0
  207. package/dist/components/month-range-picker/index.js +1 -0
  208. package/dist/components/month-range-picker/month-range-picker-popup.js +1 -0
  209. package/dist/components/month-range-picker/month-range-picker-popup.vue.d.ts +39 -0
  210. package/dist/components/month-range-picker/month-range-picker-root.js +1 -0
  211. package/dist/components/month-range-picker/month-range-picker-root.vue.d.ts +43 -0
  212. package/dist/components/month-range-picker/month-range-picker-trigger.js +1 -0
  213. package/dist/components/month-range-picker/month-range-picker-trigger.vue.d.ts +21 -0
  214. package/dist/components/month-range-picker/types.d.ts +69 -0
  215. package/dist/components/navigation-menu/index.d.ts +12 -11
  216. package/dist/components/navigation-menu/index.js +1 -1
  217. package/dist/components/navigation-menu/navigation-menu-compact.js +1 -0
  218. package/dist/components/navigation-menu/navigation-menu-compact.vue.d.ts +34 -0
  219. package/dist/components/navigation-menu/navigation-menu-root.vue.d.ts +1 -1
  220. package/dist/components/navigation-menu/types.d.ts +66 -2
  221. package/dist/components/pagination/index.d.ts +11 -10
  222. package/dist/components/pagination/index.js +1 -1
  223. package/dist/components/pagination/pagination-compact.js +1 -0
  224. package/dist/components/pagination/pagination-compact.vue.d.ts +23 -0
  225. package/dist/components/pagination/types.d.ts +21 -1
  226. package/dist/components/popover/index.d.ts +8 -7
  227. package/dist/components/popover/index.js +1 -1
  228. package/dist/components/popover/popover-compact.js +1 -0
  229. package/dist/components/popover/popover-compact.vue.d.ts +36 -0
  230. package/dist/components/popover/popover-root.vue.d.ts +1 -1
  231. package/dist/components/popover/types.d.ts +19 -2
  232. package/dist/components/popper/index.js +1 -1
  233. package/dist/components/popper/popper-anchor.js +1 -1
  234. package/dist/components/popper/popper-positioner.vue.d.ts +1 -1
  235. package/dist/components/popper/types.d.ts +1 -1
  236. package/dist/components/range-calendar/context.d.ts +9 -0
  237. package/dist/components/range-calendar/context.js +1 -0
  238. package/dist/components/range-calendar/index.d.ts +16 -0
  239. package/dist/components/range-calendar/index.js +1 -0
  240. package/dist/components/range-calendar/range-calendar-cell-trigger.js +1 -0
  241. package/dist/components/range-calendar/range-calendar-cell-trigger.vue.d.ts +33 -0
  242. package/dist/components/range-calendar/range-calendar-cell.js +1 -0
  243. package/dist/components/range-calendar/range-calendar-cell.vue.d.ts +21 -0
  244. package/dist/components/range-calendar/range-calendar-compact.js +1 -0
  245. package/dist/components/range-calendar/range-calendar-compact.vue.d.ts +25 -0
  246. package/dist/components/range-calendar/range-calendar-grid-body.js +1 -0
  247. package/dist/components/range-calendar/range-calendar-grid-body.vue.d.ts +21 -0
  248. package/dist/components/range-calendar/range-calendar-grid-head.js +1 -0
  249. package/dist/components/range-calendar/range-calendar-grid-head.vue.d.ts +21 -0
  250. package/dist/components/range-calendar/range-calendar-grid-row.js +1 -0
  251. package/dist/components/range-calendar/range-calendar-grid-row.vue.d.ts +21 -0
  252. package/dist/components/range-calendar/range-calendar-grid.js +1 -0
  253. package/dist/components/range-calendar/range-calendar-grid.vue.d.ts +21 -0
  254. package/dist/components/range-calendar/range-calendar-head-cell.js +1 -0
  255. package/dist/components/range-calendar/range-calendar-head-cell.vue.d.ts +21 -0
  256. package/dist/components/range-calendar/range-calendar-header.js +1 -0
  257. package/dist/components/range-calendar/range-calendar-header.vue.d.ts +21 -0
  258. package/dist/components/range-calendar/range-calendar-heading.js +1 -0
  259. package/dist/components/range-calendar/range-calendar-heading.vue.d.ts +22 -0
  260. package/dist/components/range-calendar/range-calendar-next.js +1 -0
  261. package/dist/components/range-calendar/range-calendar-next.vue.d.ts +24 -0
  262. package/dist/components/range-calendar/range-calendar-prev.js +1 -0
  263. package/dist/components/range-calendar/range-calendar-prev.vue.d.ts +24 -0
  264. package/dist/components/range-calendar/range-calendar-root.js +1 -0
  265. package/dist/components/range-calendar/range-calendar-root.vue.d.ts +55 -0
  266. package/dist/components/range-calendar/types.d.ts +158 -0
  267. package/dist/components/range-calendar/use-range-calendar.js +1 -0
  268. package/dist/components/roving-focus/roving-focus-group.vue.d.ts +1 -1
  269. package/dist/components/select/select-content.vue.d.ts +1 -1
  270. package/dist/components/splitter/splitter-panel.vue.d.ts +2 -2
  271. package/dist/components/stepper/index.d.ts +10 -9
  272. package/dist/components/stepper/index.js +1 -1
  273. package/dist/components/stepper/stepper-compact.js +1 -0
  274. package/dist/components/stepper/stepper-compact.vue.d.ts +19 -0
  275. package/dist/components/stepper/types.d.ts +40 -2
  276. package/dist/components/tabs/tabs-root.vue.d.ts +1 -1
  277. package/dist/components/tags-input/tags-input-root.vue.d.ts +2 -2
  278. package/dist/components/time-field/context.d.ts +9 -0
  279. package/dist/components/time-field/context.js +1 -0
  280. package/dist/components/time-field/index.d.ts +5 -0
  281. package/dist/components/time-field/index.js +1 -0
  282. package/dist/components/time-field/time-field-input.js +1 -0
  283. package/dist/components/time-field/time-field-input.vue.d.ts +21 -0
  284. package/dist/components/time-field/time-field-root.js +1 -0
  285. package/dist/components/time-field/time-field-root.vue.d.ts +43 -0
  286. package/dist/components/time-field/types.d.ts +63 -0
  287. package/dist/components/time-picker/context.d.ts +9 -0
  288. package/dist/components/time-picker/context.js +1 -0
  289. package/dist/components/time-picker/index.d.ts +6 -0
  290. package/dist/components/time-picker/index.js +1 -0
  291. package/dist/components/time-picker/time-picker-popup.js +1 -0
  292. package/dist/components/time-picker/time-picker-popup.vue.d.ts +27 -0
  293. package/dist/components/time-picker/time-picker-root.js +1 -0
  294. package/dist/components/time-picker/time-picker-root.vue.d.ts +45 -0
  295. package/dist/components/time-picker/time-picker-trigger.js +1 -0
  296. package/dist/components/time-picker/time-picker-trigger.vue.d.ts +21 -0
  297. package/dist/components/time-picker/types.d.ts +68 -0
  298. package/dist/components/time-range-field/context.d.ts +9 -0
  299. package/dist/components/time-range-field/context.js +1 -0
  300. package/dist/components/time-range-field/index.d.ts +6 -0
  301. package/dist/components/time-range-field/index.js +1 -0
  302. package/dist/components/time-range-field/time-range-field-compact.js +1 -0
  303. package/dist/components/time-range-field/time-range-field-compact.vue.d.ts +29 -0
  304. package/dist/components/time-range-field/time-range-field-input.js +1 -0
  305. package/dist/components/time-range-field/time-range-field-input.vue.d.ts +22 -0
  306. package/dist/components/time-range-field/time-range-field-root.js +1 -0
  307. package/dist/components/time-range-field/time-range-field-root.vue.d.ts +53 -0
  308. package/dist/components/time-range-field/types.d.ts +88 -0
  309. package/dist/components/time-range-picker/context.d.ts +9 -0
  310. package/dist/components/time-range-picker/context.js +1 -0
  311. package/dist/components/time-range-picker/index.d.ts +7 -0
  312. package/dist/components/time-range-picker/index.js +1 -0
  313. package/dist/components/time-range-picker/time-range-picker-compact.js +1 -0
  314. package/dist/components/time-range-picker/time-range-picker-compact.vue.d.ts +31 -0
  315. package/dist/components/time-range-picker/time-range-picker-popup.js +1 -0
  316. package/dist/components/time-range-picker/time-range-picker-popup.vue.d.ts +30 -0
  317. package/dist/components/time-range-picker/time-range-picker-root.js +1 -0
  318. package/dist/components/time-range-picker/time-range-picker-root.vue.d.ts +50 -0
  319. package/dist/components/time-range-picker/time-range-picker-trigger.js +1 -0
  320. package/dist/components/time-range-picker/time-range-picker-trigger.vue.d.ts +21 -0
  321. package/dist/components/time-range-picker/types.d.ts +103 -0
  322. package/dist/components/toast/shared.js +1 -1
  323. package/dist/components/toast/toaster.vue.d.ts +1 -1
  324. package/dist/components/tooltip/index.js +1 -1
  325. package/dist/components/tooltip/tooltip-popup.js +1 -1
  326. package/dist/components/tooltip/tooltip-root.vue.d.ts +1 -1
  327. package/dist/components/year-picker/context.d.ts +9 -0
  328. package/dist/components/year-picker/context.js +1 -0
  329. package/dist/components/year-picker/index.d.ts +6 -0
  330. package/dist/components/year-picker/index.js +1 -0
  331. package/dist/components/year-picker/types.d.ts +63 -0
  332. package/dist/components/year-picker/year-picker-popup.js +1 -0
  333. package/dist/components/year-picker/year-picker-popup.vue.d.ts +36 -0
  334. package/dist/components/year-picker/year-picker-root.js +1 -0
  335. package/dist/components/year-picker/year-picker-root.vue.d.ts +39 -0
  336. package/dist/components/year-picker/year-picker-trigger.js +1 -0
  337. package/dist/components/year-picker/year-picker-trigger.vue.d.ts +21 -0
  338. package/dist/components/year-range-picker/context.d.ts +9 -0
  339. package/dist/components/year-range-picker/context.js +1 -0
  340. package/dist/components/year-range-picker/index.d.ts +6 -0
  341. package/dist/components/year-range-picker/index.js +1 -0
  342. package/dist/components/year-range-picker/types.d.ts +71 -0
  343. package/dist/components/year-range-picker/year-range-picker-popup.js +1 -0
  344. package/dist/components/year-range-picker/year-range-picker-popup.vue.d.ts +39 -0
  345. package/dist/components/year-range-picker/year-range-picker-root.js +1 -0
  346. package/dist/components/year-range-picker/year-range-picker-root.vue.d.ts +43 -0
  347. package/dist/components/year-range-picker/year-range-picker-trigger.js +1 -0
  348. package/dist/components/year-range-picker/year-range-picker-trigger.vue.d.ts +21 -0
  349. package/dist/composables/use-hide-others.d.ts +2 -1
  350. package/dist/composables/use-hide-others.js +1 -1
  351. package/dist/constants/components.d.ts +14 -0
  352. package/dist/constants/components.js +1 -1
  353. package/dist/date/comparators.d.ts +24 -14
  354. package/dist/date/comparators.js +1 -1
  355. package/dist/date/formatter.d.ts +27 -0
  356. package/dist/date/formatter.js +1 -0
  357. package/dist/date/index.d.ts +10 -4
  358. package/dist/date/index.js +1 -1
  359. package/dist/date/parser.d.ts +34 -0
  360. package/dist/date/parser.js +1 -0
  361. package/dist/date/parts.d.ts +15 -0
  362. package/dist/date/parts.js +1 -0
  363. package/dist/date/placeholders.d.ts +23 -0
  364. package/dist/date/placeholders.js +1 -0
  365. package/dist/date/segment.d.ts +7 -0
  366. package/dist/date/segment.js +1 -0
  367. package/dist/date/types.d.ts +34 -21
  368. package/dist/date/use-date-field.d.ts +50 -0
  369. package/dist/date/use-date-field.js +1 -0
  370. package/dist/date/utils.d.ts +15 -1
  371. package/dist/date/utils.js +1 -1
  372. package/dist/index.d.ts +419 -335
  373. package/dist/index.js +1 -1
  374. package/dist/namespaced/index.d.ts +871 -717
  375. package/dist/namespaced/index.js +1 -1
  376. package/dist/node_modules/.pnpm/@soybeanjs_utils@0.1.1/node_modules/@soybeanjs/utils/dist/index.js +1 -0
  377. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Alignment.d.ts +4 -0
  378. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Animations.d.ts +11 -0
  379. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Axis.d.ts +16 -0
  380. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Counter.d.ts +9 -0
  381. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/DragHandler.d.ts +13 -0
  382. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/DragTracker.d.ts +4 -0
  383. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/EmblaCarousel.d.ts +31 -0
  384. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Engine.d.ts +67 -0
  385. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/EventHandler.d.ts +29 -0
  386. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/EventStore.d.ts +10 -0
  387. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Limit.d.ts +13 -0
  388. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/NodeRects.d.ts +11 -0
  389. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Options.d.ts +43 -0
  390. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/OptionsHandler.d.ts +11 -0
  391. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/PercentOfView.d.ts +6 -0
  392. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Plugins.d.ts +20 -0
  393. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ResizeHandler.d.ts +11 -0
  394. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ScrollBody.d.ts +14 -0
  395. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ScrollBounds.d.ts +8 -0
  396. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ScrollContain.d.ts +4 -0
  397. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ScrollLooper.d.ts +6 -0
  398. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ScrollProgress.d.ts +6 -0
  399. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ScrollTarget.d.ts +12 -0
  400. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/ScrollTo.d.ts +7 -0
  401. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/SlideFocus.d.ts +10 -0
  402. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/SlideLooper.d.ts +19 -0
  403. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/SlideRegistry.d.ts +6 -0
  404. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/SlidesHandler.d.ts +11 -0
  405. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/SlidesInView.d.ts +9 -0
  406. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/SlidesToScroll.d.ts +7 -0
  407. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Translate.d.ts +8 -0
  408. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/Vector1d.d.ts +9 -0
  409. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/components/utils.d.ts +4 -0
  410. package/dist/shared/index.d.ts +2 -1
  411. package/dist/shared/index.js +1 -1
  412. package/dist/shared/time-picker.d.ts +30 -0
  413. package/dist/shared/time-picker.js +1 -0
  414. package/package.json +8 -8
  415. package/dist/components/autocomplete/autocomplete-anchor.js +0 -1
  416. package/dist/components/autocomplete/autocomplete-content.js +0 -1
  417. package/dist/components/autocomplete/autocomplete-content.vue.d.ts +0 -24
  418. package/dist/components/autocomplete/autocomplete-group-label.js +0 -1
  419. package/dist/components/autocomplete/autocomplete-group-label.vue.d.ts +0 -18
  420. package/dist/components/autocomplete/autocomplete-group.js +0 -1
  421. package/dist/components/autocomplete/autocomplete-group.vue.d.ts +0 -18
  422. package/dist/components/autocomplete/autocomplete-item-indicator.js +0 -1
  423. package/dist/components/autocomplete/autocomplete-item-indicator.vue.d.ts +0 -18
  424. package/dist/components/autocomplete/autocomplete-item.js +0 -1
  425. package/dist/components/autocomplete/autocomplete-item.vue.d.ts +0 -26
  426. package/dist/components/autocomplete/autocomplete-separator.js +0 -1
  427. package/dist/components/autocomplete/autocomplete-separator.vue.d.ts +0 -18
  428. package/dist/components/autocomplete/autocomplete-trigger.js +0 -1
  429. package/dist/components/autocomplete/autocomplete-viewport.js +0 -1
  430. package/dist/components/autocomplete/autocomplete-viewport.vue.d.ts +0 -18
  431. package/dist/components/combobox/combobox-anchor.js +0 -1
  432. package/dist/components/combobox/combobox-anchor.vue.d.ts +0 -18
  433. package/dist/components/combobox/combobox-group-label.js +0 -1
  434. package/dist/components/combobox/combobox-group-label.vue.d.ts +0 -18
  435. package/dist/components/combobox/combobox-item-indicator.js +0 -1
  436. package/dist/node_modules/.pnpm/@soybeanjs_utils@0.1.0/node_modules/@soybeanjs/utils/dist/index.js +0 -1
@@ -0,0 +1,34 @@
1
+ import { TimeValue } from "./comparators.js";
2
+ import { DateValue, Granularity, HourCycle, SegmentContentObj, SegmentPart, SegmentValueObj } from "./types.js";
3
+ import { Formatter } from "./formatter.js";
4
+ import { Ref } from "vue";
5
+
6
+ //#region src/date/parser.d.ts
7
+ type CreateContentProps = {
8
+ granularity: Granularity;
9
+ dateRef: DateValue | TimeValue;
10
+ formatter: Formatter;
11
+ hideTimeZone: boolean;
12
+ hourCycle: HourCycle;
13
+ segmentValues: SegmentValueObj;
14
+ locale: Ref<string>;
15
+ isTimeValue?: boolean;
16
+ };
17
+ declare function syncTimeSegmentValues(props: {
18
+ value: DateValue | TimeValue;
19
+ formatter: Formatter;
20
+ }): SegmentValueObj;
21
+ declare function syncSegmentValues(props: {
22
+ value: DateValue;
23
+ formatter: Formatter;
24
+ }): SegmentValueObj;
25
+ declare function initializeSegmentValues(granularity: Granularity): SegmentValueObj;
26
+ declare function createContent(props: CreateContentProps): {
27
+ obj: SegmentContentObj;
28
+ arr: {
29
+ part: SegmentPart;
30
+ value: string;
31
+ }[];
32
+ };
33
+ //#endregion
34
+ export { createContent, initializeSegmentValues, syncSegmentValues, syncTimeSegmentValues };
@@ -0,0 +1 @@
1
+ import{isTime as e,isZonedDateTime as t,toDate as n}from"./comparators.js";import{getOptsByGranularity as r,normalizeHourCycle as i}from"./utils.js";import{DATE_SEGMENT_PARTS as a,EDITABLE_SEGMENT_PARTS as o,TIME_SEGMENT_PARTS as s,isDateSegmentPart as c,isSegmentPart as l}from"./parts.js";import{getPlaceholder as u}from"./placeholders.js";function d(e){return Object.fromEntries(s.map(t=>t===`dayPeriod`?[t,e.formatter.dayPeriod(n(e.value))]:[t,e.value[t]]))}function f(e){let t=a.map(t=>[t,e.value[t]]);return`hour`in e.value?{...Object.fromEntries(t),...d(e)}:Object.fromEntries(t)}function p(e){let t=[`hour`,`minute`,`second`],n=o.map(e=>e===`dayPeriod`?[e,`AM`]:[e,null]).filter(([n])=>e===`minute`&&n===`second`||e===`hour`&&(n===`second`||n===`minute`)?!1:e===`day`?!t.includes(n)&&n!==`dayPeriod`:!0);return Object.fromEntries(n)}function m(e){let t=e.segmentValues,n=n=>{if(`hour`in e.segmentValues){let r=t[n];return r===null?u(n,``,e.locale.value):n===`day`?e.formatter.part(e.dateRef.set({[n]:r,month:`month`in e.segmentValues?e.segmentValues.month??1:1}),n,{hourCycle:i(e.hourCycle)}):e.formatter.part(e.dateRef.set({[n]:r}),n,{hourCycle:i(e.hourCycle)})}if(c(n)){let r=t[n];return r===null?u(n,``,e.locale.value):n===`day`?e.formatter.part(e.dateRef.set({[n]:r,month:e.segmentValues.month??1}),n):e.formatter.part(e.dateRef.set({[n]:r}),n)}return``};return Object.keys(e.segmentValues).reduce((t,r)=>l(r)?`hour`in e.segmentValues&&r===`dayPeriod`?(t[r]=e.segmentValues[r]??u(r,`AM`,e.locale.value),t):(t[r]=h(r,n),t):t,{})}function h(e,t){return t(e)}function g(n){let i=m(n);return{obj:i,arr:n.formatter.toParts(n.dateRef,r(n.granularity,n.hourCycle,n.isTimeValue)).map(e=>e.type===`literal`||e.type===`timeZoneName`||e.type===null||!l(e.type)?{part:e.type,value:e.value}:{part:e.type,value:i[e.type]}).filter(r=>!(r.part===null||r.value===null||r.part===`timeZoneName`&&(e(n.dateRef)||!t(n.dateRef))||r.part===`timeZoneName`&&n.hideTimeZone))}}export{g as createContent,p as initializeSegmentValues,f as syncSegmentValues,d as syncTimeSegmentValues};
@@ -0,0 +1,15 @@
1
+ import { DateSegmentPart, EditableSegmentPart, SegmentPart, TimeSegmentPart } from "./types.js";
2
+
3
+ //#region src/date/parts.d.ts
4
+ declare const DATE_SEGMENT_PARTS: readonly ["day", "month", "year"];
5
+ declare const TIME_SEGMENT_PARTS: readonly ["hour", "minute", "second", "dayPeriod"];
6
+ declare const NON_EDITABLE_SEGMENT_PARTS: readonly ["literal", "timeZoneName"];
7
+ declare const EDITABLE_SEGMENT_PARTS: readonly ["day", "month", "year", "hour", "minute", "second", "dayPeriod"];
8
+ declare const ALL_SEGMENT_PARTS: readonly ["day", "month", "year", "hour", "minute", "second", "dayPeriod", "literal", "timeZoneName"];
9
+ declare const ALL_EXCEPT_LITERAL_PARTS: ("day" | "hour" | "minute" | "second" | "month" | "year" | "dayPeriod" | "timeZoneName")[];
10
+ declare function isDateSegmentPart(part: unknown): part is DateSegmentPart;
11
+ declare function isTimeSegmentPart(part: unknown): part is TimeSegmentPart;
12
+ declare function isSegmentPart(part: string): part is EditableSegmentPart;
13
+ declare function isAnySegmentPart(part: unknown): part is SegmentPart;
14
+ //#endregion
15
+ export { ALL_EXCEPT_LITERAL_PARTS, ALL_SEGMENT_PARTS, DATE_SEGMENT_PARTS, EDITABLE_SEGMENT_PARTS, NON_EDITABLE_SEGMENT_PARTS, TIME_SEGMENT_PARTS, isAnySegmentPart, isDateSegmentPart, isSegmentPart, isTimeSegmentPart };
@@ -0,0 +1 @@
1
+ const e=[`day`,`month`,`year`],t=[`hour`,`minute`,`second`,`dayPeriod`],n=[`literal`,`timeZoneName`],r=[...e,...t],i=[...r,...n],a=i.filter(e=>e!==`literal`);function o(t){return e.includes(t)}function s(e){return t.includes(e)}function c(e){return r.includes(e)}function l(e){return i.includes(e)}export{a as ALL_EXCEPT_LITERAL_PARTS,i as ALL_SEGMENT_PARTS,e as DATE_SEGMENT_PARTS,r as EDITABLE_SEGMENT_PARTS,n as NON_EDITABLE_SEGMENT_PARTS,t as TIME_SEGMENT_PARTS,l as isAnySegmentPart,o as isDateSegmentPart,c as isSegmentPart,s as isTimeSegmentPart};
@@ -0,0 +1,23 @@
1
+ //#region src/date/placeholders.d.ts
2
+ declare const placeholders: {
3
+ readonly en: {
4
+ readonly year: "yyyy";
5
+ readonly month: "mm";
6
+ readonly day: "dd";
7
+ };
8
+ readonly 'zh-CN': {
9
+ readonly year: "年";
10
+ readonly month: "月";
11
+ readonly day: "日";
12
+ };
13
+ readonly 'zh-TW': {
14
+ readonly year: "年";
15
+ readonly month: "月";
16
+ readonly day: "日";
17
+ };
18
+ };
19
+ type PlaceholderField = 'year' | 'month' | 'day';
20
+ type SupportedLocale = keyof typeof placeholders;
21
+ declare function getPlaceholder(field: PlaceholderField | 'era' | 'hour' | 'minute' | 'second' | 'dayPeriod', value: string, locale: string): string;
22
+ //#endregion
23
+ export { SupportedLocale, getPlaceholder };
@@ -0,0 +1 @@
1
+ const e={en:{year:`yyyy`,month:`mm`,day:`dd`},"zh-CN":{year:`年`,month:`月`,day:`日`},"zh-TW":{year:`年`,month:`月`,day:`日`}};function t(t){if(t in e)return t;let n=t.split(`-`)[0];return n in e?n:`en`}function n(n,r,i){return n===`year`||n===`month`||n===`day`?e[t(i)][n]:n===`era`||n===`dayPeriod`?r:`––`}export{n as getPlaceholder};
@@ -0,0 +1,7 @@
1
+ //#region src/date/segment.d.ts
2
+ declare function isSegmentNavigationKey(key: string): key is "ArrowLeft" | "ArrowRight";
3
+ declare function isNumberString(value: string): boolean;
4
+ declare function isAcceptableSegmentKey(key: string): boolean;
5
+ declare function getSegmentElements(parentElement: HTMLElement): Element[];
6
+ //#endregion
7
+ export { getSegmentElements, isAcceptableSegmentKey, isNumberString, isSegmentNavigationKey };
@@ -0,0 +1 @@
1
+ function e(e){return e===`ArrowRight`||e===`ArrowLeft`}function t(e){return!Number.isNaN(Number.parseInt(e))}function n(e){return[`Enter`,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Backspace`,` `,`a`,`A`,`p`,`P`].includes(e)||t(e)}function r(e){return Array.from(e.querySelectorAll(`[data-soybean-date-field-segment]`)).filter(e=>e.getAttribute(`data-soybean-date-field-segment`)!==`literal`)}export{r as getSegmentElements,n as isAcceptableSegmentKey,t as isNumberString,e as isSegmentNavigationKey};
@@ -1,36 +1,49 @@
1
+ import { TimeValue } from "./comparators.js";
2
+ import { DATE_SEGMENT_PARTS, EDITABLE_SEGMENT_PARTS, NON_EDITABLE_SEGMENT_PARTS, TIME_SEGMENT_PARTS } from "./parts.js";
1
3
  import { DateValue as DateValue$1 } from "@internationalized/date";
2
4
 
3
5
  //#region src/date/types.d.ts
4
6
  type DayOfWeek = 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat';
5
7
  type Matcher = (date: DateValue$1) => boolean;
8
+ type TimeMatcher = (time: TimeValue) => boolean;
6
9
  interface DateRange {
7
10
  start?: DateValue$1;
8
11
  end?: DateValue$1;
9
12
  }
13
+ interface TimeRange {
14
+ start?: TimeValue;
15
+ end?: TimeValue;
16
+ }
10
17
  interface Grid<T> {
11
- /**
12
- * A `DateValue` used to represent the month. Since days
13
- * from the previous and next months may be included in the
14
- * calendar grid, we need a source of truth for the value
15
- * the grid is representing.
16
- */
17
18
  value: DateValue$1;
18
- /**
19
- * An array of arrays representing the weeks in the calendar.
20
- * Each sub-array represents a week, and contains the dates for each
21
- * day in that week. This structure is useful for rendering the calendar
22
- * grid using a table, where each row represents a week and each cell
23
- * represents a day.
24
- */
25
19
  rows: T[][];
26
- /**
27
- * An array of all the dates in the current month, including dates from
28
- * the previous and next months that are used to fill out the calendar grid.
29
- * This array is useful for rendering the calendar grid in a customizable way,
30
- * as it provides all the dates that should be displayed in the grid in a flat
31
- * array.
32
- */
33
20
  cells: T[];
34
21
  }
22
+ interface DateStep {
23
+ year?: number;
24
+ month?: number;
25
+ day?: number;
26
+ hour?: number;
27
+ minute?: number;
28
+ second?: number;
29
+ millisecond?: number;
30
+ }
31
+ type HourCycle = 12 | 24 | undefined;
32
+ type DateSegmentPart = (typeof DATE_SEGMENT_PARTS)[number];
33
+ type TimeSegmentPart = (typeof TIME_SEGMENT_PARTS)[number];
34
+ type EditableSegmentPart = (typeof EDITABLE_SEGMENT_PARTS)[number];
35
+ type NonEditableSegmentPart = (typeof NON_EDITABLE_SEGMENT_PARTS)[number];
36
+ type SegmentPart = EditableSegmentPart | NonEditableSegmentPart;
37
+ type AnyExceptLiteral = Exclude<SegmentPart, 'literal'>;
38
+ type DayPeriod = 'AM' | 'PM' | null;
39
+ type DateSegmentObj = { [K in DateSegmentPart]: number | null };
40
+ type TimeSegmentObj = { [K in TimeSegmentPart]: K extends 'dayPeriod' ? DayPeriod : number | null };
41
+ type DateAndTimeSegmentObj = DateSegmentObj & TimeSegmentObj;
42
+ type SegmentValueObj = DateSegmentObj | DateAndTimeSegmentObj;
43
+ type SegmentContentObj = Record<EditableSegmentPart, string>;
44
+ type DateInputType = 'date' | 'datetime-local';
45
+ type TimeInputType = 'time';
46
+ type Granularity = 'day' | 'hour' | 'minute' | 'second';
47
+ type TimeGranularity = 'hour' | 'minute' | 'second';
35
48
  //#endregion
36
- export { DateRange, type DateValue$1 as DateValue, DayOfWeek, Grid, Matcher };
49
+ export { AnyExceptLiteral, DateAndTimeSegmentObj, DateInputType, DateRange, DateSegmentObj, DateSegmentPart, DateStep, type DateValue$1 as DateValue, DayOfWeek, DayPeriod, EditableSegmentPart, Granularity, Grid, HourCycle, Matcher, NonEditableSegmentPart, SegmentContentObj, SegmentPart, SegmentValueObj, TimeGranularity, TimeInputType, TimeMatcher, TimeRange, TimeSegmentObj, TimeSegmentPart };
@@ -0,0 +1,50 @@
1
+ import { TimeValue } from "./comparators.js";
2
+ import { DateStep, HourCycle, SegmentPart, SegmentValueObj } from "./types.js";
3
+ import { Formatter } from "./formatter.js";
4
+ import * as _$vue from "vue";
5
+ import { Ref } from "vue";
6
+ import { DateValue } from "@internationalized/date";
7
+
8
+ //#region src/date/use-date-field.d.ts
9
+ type UseDateFieldProps = {
10
+ hasLeftFocus: Ref<boolean>;
11
+ lastKeyZero: Ref<boolean>;
12
+ placeholder: Ref<DateValue | TimeValue>;
13
+ hourCycle: HourCycle;
14
+ step: Ref<DateStep>;
15
+ formatter: Formatter;
16
+ segmentValues: Ref<SegmentValueObj>;
17
+ disabled: Ref<boolean>;
18
+ readonly: Ref<boolean>;
19
+ part: SegmentPart;
20
+ modelValue: Ref<DateValue | TimeValue | undefined>;
21
+ focusNext: () => void;
22
+ };
23
+ declare function useDateField(props: UseDateFieldProps): {
24
+ attributes: _$vue.ComputedRef<{
25
+ inputmode: string;
26
+ 'aria-label': string;
27
+ 'aria-valuetext': string | null | undefined;
28
+ role: string;
29
+ contenteditable: boolean;
30
+ tabindex: number | undefined;
31
+ spellcheck: boolean;
32
+ autocorrect: string;
33
+ enterkeyhint: string;
34
+ style: string;
35
+ } | {
36
+ 'aria-hidden': boolean;
37
+ 'data-segment': string;
38
+ } | {
39
+ role: string;
40
+ tabindex: number | undefined;
41
+ 'aria-label': string;
42
+ 'data-readonly': boolean;
43
+ style: string;
44
+ }>;
45
+ handleSegmentClick: (event: MouseEvent) => void;
46
+ handleSegmentFocusOut: () => void;
47
+ handleSegmentKeydown: (event: KeyboardEvent) => void;
48
+ };
49
+ //#endregion
50
+ export { UseDateFieldProps, useDateField };
@@ -0,0 +1 @@
1
+ import{getDaysInMonth as e}from"./comparators.js";import{isAcceptableSegmentKey as t,isNumberString as n,isSegmentNavigationKey as r}from"./segment.js";import{computed as i}from"vue";import{DateFormatter as a}from"@internationalized/date";const o=e=>({role:`spinbutton`,contenteditable:!0,tabindex:e.disabled?void 0:0,spellcheck:!1,inputmode:`numeric`,autocorrect:`off`,enterkeyhint:`next`,style:`caret-color: transparent;`}),s=(e,t)=>{if(e!==void 0)return e===12;let n=new a(t,{hour:`numeric`}).resolvedOptions().hourCycle;return n===`h11`||n===`h12`},c=e=>{let t=`hour`in e.placeholder?e.placeholder.hour:0;return s(e.hourCycle,e.formatter.getLocale())?t%12||12:t},l={day:{attrs:t=>({...o(t),"aria-label":`day,`,"aria-valuemin":1,"aria-valuemax":e(t.placeholder),"aria-valuenow":t.placeholder.day,"aria-valuetext":t.segmentValues.day===null?`Empty`:`${t.placeholder.day}`,"data-placeholder":t.segmentValues.day===null?``:void 0})},month:{attrs:e=>({...o(e),"aria-label":`month, `,"aria-valuemin":1,"aria-valuemax":12,"aria-valuenow":e.placeholder.month,"aria-valuetext":e.segmentValues.month===null?`Empty`:`${e.placeholder.month} - ${e.formatter.fullMonth(e.placeholder.toDate(`UTC`))}`,"data-placeholder":e.segmentValues.month===null?``:void 0})},year:{attrs:e=>({...o(e),"aria-label":`year, `,"aria-valuemin":1,"aria-valuemax":9999,"aria-valuenow":e.placeholder.year,"aria-valuetext":e.segmentValues.year===null?`Empty`:`${e.placeholder.year}`,"data-placeholder":e.segmentValues.year===null?``:void 0})},hour:{attrs:e=>({...o(e),"aria-label":`hour, `,"aria-valuemin":+!!s(e.hourCycle,e.formatter.getLocale()),"aria-valuemax":s(e.hourCycle,e.formatter.getLocale())?12:23,"aria-valuenow":c(e),"aria-valuetext":`hour`in e.segmentValues&&e.segmentValues.hour===null?`Empty`:`${c(e)}`,"data-placeholder":`hour`in e.segmentValues&&e.segmentValues.hour===null?``:void 0})},minute:{attrs:e=>({...o(e),"aria-label":`minute, `,"aria-valuemin":0,"aria-valuemax":59,"aria-valuenow":`minute`in e.placeholder?e.placeholder.minute:0,"aria-valuetext":`minute`in e.segmentValues&&e.segmentValues.minute===null?`Empty`:`${`minute`in e.placeholder?e.placeholder.minute:0}`,"data-placeholder":`minute`in e.segmentValues&&e.segmentValues.minute===null?``:void 0})},second:{attrs:e=>({...o(e),"aria-label":`second, `,"aria-valuemin":0,"aria-valuemax":59,"aria-valuenow":`second`in e.placeholder?e.placeholder.second:0,"aria-valuetext":`second`in e.segmentValues&&e.segmentValues.second===null?`Empty`:`${`second`in e.placeholder?e.placeholder.second:0}`,"data-placeholder":`second`in e.segmentValues&&e.segmentValues.second===null?``:void 0})},dayPeriod:{attrs:e=>({...o(e),inputmode:`text`,"aria-label":`AM/PM, `,"aria-valuetext":`dayPeriod`in e.segmentValues&&e.segmentValues.dayPeriod===null?`Empty`:`dayPeriod`in e.segmentValues?e.segmentValues.dayPeriod:void 0})},literal:{attrs:()=>({"aria-hidden":!0,"data-segment":`literal`})},timeZoneName:{attrs:e=>({role:`textbox`,tabindex:e.disabled?void 0:0,"aria-label":`time zone, `,"data-readonly":!0,style:`caret-color: transparent;`})}};function u(a){let o=i(()=>l[a.part]?.attrs({disabled:a.disabled.value,placeholder:a.placeholder.value,hourCycle:a.hourCycle,segmentValues:a.segmentValues.value,formatter:a.formatter})??{}),c=e=>{if(a.hasLeftFocus.value=!1,e===null)return e;let t=e.toString();return t.length===1?(a.modelValue.value=void 0,null):Number.parseInt(t.slice(0,-1))},u=(e,t,n,r)=>{let i=a.step.value[t]??1,o=e.key===`ArrowUp`?i:-i;return r===null?o>0?0:59:n.set({[t]:r}).cycle(t,o)[t]},d=(e,t,n,r)=>{let i=a.step.value[t]??1,o=e.key===`ArrowUp`?i:-i;if(r===null){if(t===`hour`&&`hour`in n)return n.hour;let e=n;return t===`day`?e.day:t===`month`?e.month:e.year}if(t===`hour`&&`hour`in n)return n.set({[t]:r}).cycle(t,o)[t];let s=n;return t===`day`?s.set({[t]:r,month:a.segmentValues.value.month??1}).cycle(t,o)[t]:t===`month`?s.set({month:r}).cycle(`month`,o).month:s.set({year:r}).cycle(`year`,o).year},f=(e,t,n)=>{let r=!1,i=Math.floor(e/10);if(a.hasLeftFocus.value&&(a.hasLeftFocus.value=!1,a.lastKeyZero.value=!1,n=null),n===null)return t===0?(a.lastKeyZero.value=!0,{moveToNext:r,value:null}):((a.lastKeyZero.value||t>i)&&(r=!0),a.lastKeyZero.value=!1,{moveToNext:r,value:t});let o=n.toString().length,s=Number.parseInt(n.toString()+t.toString());return o===2||s>e?((t>i||s>e)&&(r=!0),{moveToNext:r,value:t}):(r=!0,{moveToNext:r,value:s})},p=(e,t)=>{let n=!1;if(a.hasLeftFocus.value&&(a.hasLeftFocus.value=!1,a.lastKeyZero.value=!1,t=null),t===null)return e===0?(a.lastKeyZero.value=!0,{moveToNext:n,value:0}):((a.lastKeyZero.value||e>5)&&(n=!0),a.lastKeyZero.value=!1,{moveToNext:n,value:e});let r=t.toString().length,i=Number.parseInt(t.toString()+e.toString());return r===2||i>59?(e>5&&(n=!0),{moveToNext:n,value:e}):(n=!0,{moveToNext:n,value:i})},m=(e,t,n)=>{let r=!1,i=Math.floor(e/10);if(a.hasLeftFocus.value&&(a.hasLeftFocus.value=!1,a.lastKeyZero.value=!1,n=null),n===null)return t===0?(a.lastKeyZero.value=!0,{moveToNext:r,value:0}):((a.lastKeyZero.value||t>i)&&(r=!0),a.lastKeyZero.value=!1,{moveToNext:r,value:t});let o=n.toString().length,s=Number.parseInt(n.toString()+t.toString());return o===2||s>e?(t>i&&(r=!0),{moveToNext:r,value:t}):(r=!0,{moveToNext:r,value:s})},h=(e,t)=>{let n=!1;if(a.hasLeftFocus.value&&(a.hasLeftFocus.value=!1,t=null),t===null)return{moveToNext:n,value:e===0?1:e};let r=t.toString()+e.toString();return r.length>4?{moveToNext:n,value:e===0?1:e}:(r.length===4&&(n=!0),{moveToNext:n,value:Number.parseInt(r)})},g=i=>{if(!t(i.key)||r(i.key))return;let o=a.segmentValues.value.day;if(i.key===`ArrowDown`||i.key===`ArrowUp`){a.segmentValues.value.day=d(i,`day`,a.placeholder.value,o);return}if(n(i.key)){let t=Number.parseInt(i.key),n=a.segmentValues.value.month,{moveToNext:r,value:s}=f(n?e(a.placeholder.value.set({month:n})):31,t,o);a.segmentValues.value.day=s,r&&a.focusNext()}i.key===`Backspace`&&(a.segmentValues.value.day=c(o))},_=e=>{if(!t(e.key)||r(e.key))return;let i=a.segmentValues.value.month;if(e.key===`ArrowDown`||e.key===`ArrowUp`){a.segmentValues.value.month=d(e,`month`,a.placeholder.value,i);return}if(n(e.key)){let{moveToNext:t,value:n}=f(12,Number.parseInt(e.key),i);a.segmentValues.value.month=n,t&&a.focusNext()}e.key===`Backspace`&&(a.segmentValues.value.month=c(i))},v=e=>{if(!t(e.key)||r(e.key))return;let i=a.segmentValues.value.year;if(e.key===`ArrowDown`||e.key===`ArrowUp`){a.segmentValues.value.year=d(e,`year`,a.placeholder.value,i);return}if(n(e.key)){let{moveToNext:t,value:n}=h(Number.parseInt(e.key),i);a.segmentValues.value.year=n,t&&a.focusNext()}e.key===`Backspace`&&(a.segmentValues.value.year=c(i))},y=e=>{if(!t(e.key)||r(e.key)||!(`hour`in a.placeholder.value)||!(`hour`in a.segmentValues.value))return;let i=a.segmentValues.value.hour;if(e.key===`ArrowDown`||e.key===`ArrowUp`){let t=d(e,`hour`,a.placeholder.value,i);a.segmentValues.value.hour=t,`dayPeriod`in a.segmentValues.value&&t!==null&&(a.segmentValues.value.dayPeriod=t>=12?`PM`:`AM`);return}if(n(e.key)){let t=Number.parseInt(e.key),n=s(a.hourCycle,a.formatter.getLocale()),r=n?12:24,o=i;n&&i!==null&&(o=i%12==0?0:i>12?i-12:i);let{moveToNext:c,value:l}=m(r,t,o),u=l;if(n&&l!==null&&`dayPeriod`in a.segmentValues.value){let e=a.segmentValues.value.dayPeriod||`AM`;u=l===12?e===`AM`?0:12:e===`PM`?l+12:l}a.segmentValues.value.hour=u,c&&a.focusNext()}e.key===`Backspace`&&(a.segmentValues.value.hour=c(i))},b=e=>{if(!t(e.key)||r(e.key)||!(`minute`in a.placeholder.value)||!(`minute`in a.segmentValues.value))return;let i=a.segmentValues.value.minute;if(e.key===`ArrowDown`||e.key===`ArrowUp`){a.segmentValues.value.minute=u(e,`minute`,a.placeholder.value,i);return}if(n(e.key)){let{moveToNext:t,value:n}=p(Number.parseInt(e.key),i);a.segmentValues.value.minute=n,t&&a.focusNext()}e.key===`Backspace`&&(a.segmentValues.value.minute=c(i))},x=e=>{if(!t(e.key)||r(e.key)||!(`second`in a.placeholder.value)||!(`second`in a.segmentValues.value))return;let i=a.segmentValues.value.second;if(e.key===`ArrowDown`||e.key===`ArrowUp`){a.segmentValues.value.second=u(e,`second`,a.placeholder.value,i);return}if(n(e.key)){let{moveToNext:t,value:n}=p(Number.parseInt(e.key),i);a.segmentValues.value.second=n,t&&a.focusNext()}e.key===`Backspace`&&(a.segmentValues.value.second=c(i))},S=e=>{if(!((!t(e.key)||r(e.key))&&![`a`,`A`,`p`,`P`].includes(e.key)||!(`hour`in a.placeholder.value)||!(`dayPeriod`in a.segmentValues.value))){if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(a.segmentValues.value.dayPeriod===`AM`){a.segmentValues.value.dayPeriod=`PM`,a.segmentValues.value.hour=(a.segmentValues.value.hour??0)+12;return}a.segmentValues.value.dayPeriod=`AM`,a.segmentValues.value.hour=(a.segmentValues.value.hour??12)-12;return}if([`a`,`A`].includes(e.key)&&a.segmentValues.value.dayPeriod!==`AM`){a.segmentValues.value.dayPeriod=`AM`,a.segmentValues.value.hour=(a.segmentValues.value.hour??12)-12;return}[`p`,`P`].includes(e.key)&&a.segmentValues.value.dayPeriod!==`PM`&&(a.segmentValues.value.dayPeriod=`PM`,a.segmentValues.value.hour=(a.segmentValues.value.hour??0)+12)}};return{attributes:o,handleSegmentClick:e=>{a.disabled.value&&e.preventDefault()},handleSegmentFocusOut:()=>{if(!Object.values(a.segmentValues.value).every(e=>e!==null))return;let e=a.placeholder.value.set({...a.segmentValues.value});a.modelValue.value=e.copy()},handleSegmentKeydown:e=>{if(a.disabled.value||a.readonly.value)return;e.key!==`Tab`&&e.preventDefault();let n={day:g,dayPeriod:S,hour:y,minute:b,month:_,second:x,timeZoneName:()=>void 0,year:v};a.part!==`literal`&&(n[a.part](e),![`ArrowLeft`,`ArrowRight`,`Shift`,`Tab`].includes(e.key)&&t(e.key)&&Object.values(a.segmentValues.value).every(e=>e!==null)&&(a.modelValue.value=a.placeholder.value.set({...a.segmentValues.value}).copy()))}}}export{u as useDateField};
@@ -1,4 +1,18 @@
1
+ import { TimeValue } from "./comparators.js";
2
+ import { DateStep, DateValue, Granularity, HourCycle, TimeGranularity, TimeInputType } from "./types.js";
3
+
1
4
  //#region src/date/utils.d.ts
2
5
  declare function chunk<T>(array: T[], size: number): T[][];
6
+ declare function getOptsByGranularity(granularity: Granularity, hourCycle: HourCycle, isTimeValue?: boolean): Intl.DateTimeFormatOptions;
7
+ declare function normalizeDateStep(props?: {
8
+ step?: DateStep;
9
+ }): DateStep;
10
+ declare function handleCalendarInitialFocus(calendar: HTMLElement): void;
11
+ declare function normalizeHourCycle(hourCycle: HourCycle): "h23" | "h11" | undefined;
12
+ declare function normalizeHour12(hourCycle: HourCycle): boolean | undefined;
13
+ declare function getInputType(granularity: Granularity): "date" | "datetime-local";
14
+ declare function normalizeInputValue(date: DateValue | undefined, granularity: Granularity): string;
15
+ declare function getTimeInputType(_granularity: TimeGranularity): TimeInputType;
16
+ declare function normalizeTimeInputValue(time: TimeValue | undefined, granularity: TimeGranularity): string;
3
17
  //#endregion
4
- export { chunk };
18
+ export { chunk, getInputType, getOptsByGranularity, getTimeInputType, handleCalendarInitialFocus, normalizeDateStep, normalizeHour12, normalizeHourCycle, normalizeInputValue, normalizeTimeInputValue };
@@ -1 +1 @@
1
- function e(e,t){if(t<=0)throw RangeError(`chunk size must be greater than 0`);let n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n}export{e as chunk};
1
+ function e(e,t){if(t<=0)throw RangeError(`chunk size must be greater than 0`);let n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n}function t(e,t,n=!1){let r={year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,timeZoneName:`short`,hourCycle:i(t),hour12:a(t)};return n&&(delete r.year,delete r.month,delete r.day),e===`day`&&(delete r.hour,delete r.minute,delete r.second,delete r.timeZoneName),e===`hour`&&(delete r.minute,delete r.second),e===`minute`&&delete r.second,r}function n(e){return{year:e?.step?.year??1,month:e?.step?.month??1,day:e?.step?.day??1,hour:e?.step?.hour??1,minute:e?.step?.minute??1,second:e?.step?.second??1,millisecond:e?.step?.millisecond??1}}function r(e){let t=e.querySelector(`[data-selected]`);if(t){t.focus();return}let n=e.querySelector(`[data-today]`);if(n){n.focus();return}e.querySelector(`[data-slot="cell-trigger"]:not([data-disabled]):not([data-unavailable])`)?.focus()}function i(e){if(e===24)return`h23`;if(e===12)return`h11`}function a(e){if(e===24)return!1;if(e===12)return!0}function o(e){return e===`day`?`date`:`datetime-local`}function s(e,t){if(!e)return``;let n=o(t),r=String(e.year).padStart(4,`0`),i=String(e.month).padStart(2,`0`),a=String(e.day).padStart(2,`0`);if(n===`date`)return`${r}-${i}-${a}`;let s=String(`hour`in e?e.hour:0).padStart(2,`0`),c=String(`minute`in e?e.minute:0).padStart(2,`0`);return t===`second`?`${r}-${i}-${a}T${s}:${c}:${String(`second`in e?e.second:0).padStart(2,`0`)}`:`${r}-${i}-${a}T${s}:${c}`}function c(e){return`time`}function l(e,t){if(!e)return``;let n=String(e.hour).padStart(2,`0`),r=String(e.minute).padStart(2,`0`);return t===`second`?`${n}:${r}:${String(e.second).padStart(2,`0`)}`:`${n}:${r}`}export{e as chunk,o as getInputType,t as getOptsByGranularity,c as getTimeInputType,r as handleCalendarInitialFocus,n as normalizeDateStep,a as normalizeHour12,i as normalizeHourCycle,s as normalizeInputValue,l as normalizeTimeInputValue};