akar 1.10.0 → 1.11.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 (1000) hide show
  1. package/dist/accordion/accordion-content.js +6 -952
  2. package/dist/accordion/accordion-content.js.map +1 -1
  3. package/dist/accordion/accordion-header.js +4 -1
  4. package/dist/accordion/accordion-header.js.map +1 -1
  5. package/dist/accordion/accordion-item.js +120 -0
  6. package/dist/accordion/accordion-item.js.map +1 -0
  7. package/dist/accordion/accordion-root.js +96 -0
  8. package/dist/accordion/accordion-root.js.map +1 -0
  9. package/dist/accordion/accordion-trigger.js +5 -54
  10. package/dist/accordion/accordion-trigger.js.map +1 -1
  11. package/dist/avatar/avatar-fallback.js +4 -37
  12. package/dist/avatar/avatar-fallback.js.map +1 -1
  13. package/dist/avatar/avatar-image.js +5 -50
  14. package/dist/avatar/avatar-image.js.map +1 -1
  15. package/dist/avatar/avatar-root.js +42 -0
  16. package/dist/avatar/avatar-root.js.map +1 -0
  17. package/dist/avatar/utils.js +51 -0
  18. package/dist/avatar/utils.js.map +1 -0
  19. package/dist/calendar/calendar-cell-trigger.js +6 -10
  20. package/dist/calendar/calendar-cell-trigger.js.map +1 -1
  21. package/dist/calendar/calendar-cell.js +4 -1072
  22. package/dist/calendar/calendar-cell.js.map +1 -1
  23. package/dist/calendar/calendar-grid-body.js +1 -1
  24. package/dist/calendar/calendar-grid-head.js +1 -1
  25. package/dist/calendar/calendar-grid-row.js +1 -1
  26. package/dist/calendar/calendar-grid.js +2 -2
  27. package/dist/calendar/calendar-head-cell.js +1 -1
  28. package/dist/calendar/calendar-header.js +1 -1
  29. package/dist/calendar/calendar-heading.js +2 -2
  30. package/dist/calendar/calendar-next.js +2 -2
  31. package/dist/calendar/calendar-prev.js +2 -2
  32. package/dist/calendar/calendar-root.js +311 -0
  33. package/dist/calendar/calendar-root.js.map +1 -0
  34. package/dist/calendar/calendar.utils.js +9 -0
  35. package/dist/calendar/calendar.utils.js.map +1 -0
  36. package/dist/calendar/use-calendar.js +253 -0
  37. package/dist/calendar/use-calendar.js.map +1 -0
  38. package/dist/checkbox/checkbox-group-root.js +10 -477
  39. package/dist/checkbox/checkbox-group-root.js.map +1 -1
  40. package/dist/checkbox/checkbox-indicator.js +7 -258
  41. package/dist/checkbox/checkbox-indicator.js.map +1 -1
  42. package/dist/checkbox/checkbox-root.js +156 -0
  43. package/dist/checkbox/checkbox-root.js.map +1 -0
  44. package/dist/checkbox/utils.js +12 -0
  45. package/dist/checkbox/utils.js.map +1 -0
  46. package/dist/collapsible/collapsible-content.js +113 -0
  47. package/dist/collapsible/collapsible-content.js.map +1 -0
  48. package/dist/collapsible/collapsible-root.js +86 -0
  49. package/dist/collapsible/collapsible-root.js.map +1 -0
  50. package/dist/collapsible/collapsible-trigger.js +59 -0
  51. package/dist/collapsible/collapsible-trigger.js.map +1 -0
  52. package/dist/collection/collection.js +75 -0
  53. package/dist/collection/collection.js.map +1 -0
  54. package/dist/combobox/combobox-anchor.js +5 -69
  55. package/dist/combobox/combobox-anchor.js.map +1 -1
  56. package/dist/combobox/combobox-arrow.js +6 -1960
  57. package/dist/combobox/combobox-arrow.js.map +1 -1
  58. package/dist/combobox/combobox-cancel.js +3 -2
  59. package/dist/combobox/combobox-cancel.js.map +1 -1
  60. package/dist/combobox/combobox-content-impl.js +198 -0
  61. package/dist/combobox/combobox-content-impl.js.map +1 -0
  62. package/dist/combobox/combobox-content.js +8 -50
  63. package/dist/combobox/combobox-content.js.map +1 -1
  64. package/dist/combobox/combobox-empty.js +2 -2
  65. package/dist/combobox/combobox-group.js +5 -35
  66. package/dist/combobox/combobox-group.js.map +1 -1
  67. package/dist/combobox/combobox-input.js +6 -103
  68. package/dist/combobox/combobox-input.js.map +1 -1
  69. package/dist/combobox/combobox-item-indicator.js +3 -39
  70. package/dist/combobox/combobox-item-indicator.js.map +1 -1
  71. package/dist/combobox/combobox-item.js +6 -111
  72. package/dist/combobox/combobox-item.js.map +1 -1
  73. package/dist/combobox/combobox-label.js +3 -1
  74. package/dist/combobox/combobox-label.js.map +1 -1
  75. package/dist/combobox/combobox-portal.js +3 -47
  76. package/dist/combobox/combobox-portal.js.map +1 -1
  77. package/dist/combobox/combobox-root.js +256 -0
  78. package/dist/combobox/combobox-root.js.map +1 -0
  79. package/dist/combobox/combobox-separator.js +2 -1
  80. package/dist/combobox/combobox-separator.js.map +1 -1
  81. package/dist/combobox/combobox-trigger.js +3 -2
  82. package/dist/combobox/combobox-trigger.js.map +1 -1
  83. package/dist/combobox/combobox-viewport.js +6 -11
  84. package/dist/combobox/combobox-viewport.js.map +1 -1
  85. package/dist/combobox/combobox-virtualizer.js +4 -236
  86. package/dist/combobox/combobox-virtualizer.js.map +1 -1
  87. package/dist/component/arrow.js +69 -0
  88. package/dist/component/arrow.js.map +1 -0
  89. package/dist/component/base-separator.js +1 -1
  90. package/dist/composables/use-window-splitter-behavior.js +5 -46
  91. package/dist/composables/use-window-splitter-behavior.js.map +1 -1
  92. package/dist/composables/use-window-splitter-panel-group-behavior.js +7 -314
  93. package/dist/composables/use-window-splitter-panel-group-behavior.js.map +1 -1
  94. package/dist/config-provider/config-provider.js +58 -0
  95. package/dist/config-provider/config-provider.js.map +1 -0
  96. package/dist/context-menu/context-menu-arrow.js +3 -44
  97. package/dist/context-menu/context-menu-arrow.js.map +1 -1
  98. package/dist/context-menu/context-menu-checkbox-item.js +5 -1028
  99. package/dist/context-menu/context-menu-checkbox-item.js.map +1 -1
  100. package/dist/context-menu/context-menu-content.js +6 -436
  101. package/dist/context-menu/context-menu-content.js.map +1 -1
  102. package/dist/context-menu/context-menu-group.js +4 -32
  103. package/dist/context-menu/context-menu-group.js.map +1 -1
  104. package/dist/context-menu/context-menu-item-indicator.js +2 -2
  105. package/dist/context-menu/context-menu-item.js +3 -3
  106. package/dist/context-menu/context-menu-label.js +3 -32
  107. package/dist/context-menu/context-menu-label.js.map +1 -1
  108. package/dist/context-menu/context-menu-portal.js +2 -39
  109. package/dist/context-menu/context-menu-portal.js.map +1 -1
  110. package/dist/context-menu/context-menu-radio-group.js +4 -49
  111. package/dist/context-menu/context-menu-radio-group.js.map +1 -1
  112. package/dist/context-menu/context-menu-radio-item.js +5 -60
  113. package/dist/context-menu/context-menu-radio-item.js.map +1 -1
  114. package/dist/context-menu/context-menu-root.js +74 -0
  115. package/dist/context-menu/context-menu-root.js.map +1 -0
  116. package/dist/context-menu/context-menu-separator.js +4 -35
  117. package/dist/context-menu/context-menu-separator.js.map +1 -1
  118. package/dist/context-menu/context-menu-sub-content.js +5 -157
  119. package/dist/context-menu/context-menu-sub-content.js.map +1 -1
  120. package/dist/context-menu/context-menu-sub-trigger.js +4 -185
  121. package/dist/context-menu/context-menu-sub-trigger.js.map +1 -1
  122. package/dist/context-menu/context-menu-sub.js +4 -63
  123. package/dist/context-menu/context-menu-sub.js.map +1 -1
  124. package/dist/context-menu/context-menu-trigger.js +6 -10
  125. package/dist/context-menu/context-menu-trigger.js.map +1 -1
  126. package/dist/context-menu/utils.js +8 -0
  127. package/dist/context-menu/utils.js.map +1 -0
  128. package/dist/date/calendar.date.js +150 -0
  129. package/dist/date/calendar.date.js.map +1 -0
  130. package/dist/date/comparators.date.js +146 -0
  131. package/dist/date/comparators.date.js.map +1 -0
  132. package/dist/date/comparators.js +42 -0
  133. package/dist/date/comparators.js.map +1 -0
  134. package/dist/date/parser.js +158 -0
  135. package/dist/date/parser.js.map +1 -0
  136. package/dist/date/parts.js +27 -0
  137. package/dist/date/parts.js.map +1 -0
  138. package/dist/date/placeholders.js +493 -0
  139. package/dist/date/placeholders.js.map +1 -0
  140. package/dist/date/segment.js +37 -0
  141. package/dist/date/segment.js.map +1 -0
  142. package/dist/date/use-date-field.js +701 -0
  143. package/dist/date/use-date-field.js.map +1 -0
  144. package/dist/date/utils.js +56 -0
  145. package/dist/date/utils.js.map +1 -0
  146. package/dist/date-field/date-field-input.js +5 -1664
  147. package/dist/date-field/date-field-input.js.map +1 -1
  148. package/dist/date-field/date-field-root.js +281 -0
  149. package/dist/date-field/date-field-root.js.map +1 -0
  150. package/dist/date-picker/date-picker-anchor.js +3 -109
  151. package/dist/date-picker/date-picker-anchor.js.map +1 -1
  152. package/dist/date-picker/date-picker-arrow.js +2 -48
  153. package/dist/date-picker/date-picker-arrow.js.map +1 -1
  154. package/dist/date-picker/date-picker-calendar.js +5 -20829
  155. package/dist/date-picker/date-picker-calendar.js.map +1 -1
  156. package/dist/date-picker/date-picker-cell-trigger.js +42 -0
  157. package/dist/date-picker/date-picker-cell-trigger.js.map +1 -0
  158. package/dist/date-picker/date-picker-cell.js +38 -0
  159. package/dist/date-picker/date-picker-cell.js.map +1 -0
  160. package/dist/date-picker/date-picker-close.js +34 -0
  161. package/dist/date-picker/date-picker-close.js.map +1 -0
  162. package/dist/date-picker/date-picker-content.js +148 -0
  163. package/dist/date-picker/date-picker-content.js.map +1 -0
  164. package/dist/date-picker/date-picker-field.js +58 -0
  165. package/dist/date-picker/date-picker-field.js.map +1 -0
  166. package/dist/date-picker/date-picker-grid-body.js +34 -0
  167. package/dist/date-picker/date-picker-grid-body.js.map +1 -0
  168. package/dist/date-picker/date-picker-grid-head.js +34 -0
  169. package/dist/date-picker/date-picker-grid-head.js.map +1 -0
  170. package/dist/date-picker/date-picker-grid-row.js +34 -0
  171. package/dist/date-picker/date-picker-grid-row.js.map +1 -0
  172. package/dist/date-picker/date-picker-grid.js +34 -0
  173. package/dist/date-picker/date-picker-grid.js.map +1 -0
  174. package/dist/date-picker/date-picker-head-cell.js +34 -0
  175. package/dist/date-picker/date-picker-head-cell.js.map +1 -0
  176. package/dist/date-picker/date-picker-header.js +34 -0
  177. package/dist/date-picker/date-picker-header.js.map +1 -0
  178. package/dist/date-picker/date-picker-heading.js +34 -0
  179. package/dist/date-picker/date-picker-heading.js.map +1 -0
  180. package/dist/date-picker/date-picker-input.js +38 -0
  181. package/dist/date-picker/date-picker-input.js.map +1 -0
  182. package/dist/date-picker/date-picker-next.js +38 -0
  183. package/dist/date-picker/date-picker-next.js.map +1 -0
  184. package/dist/date-picker/date-picker-prev.js +38 -0
  185. package/dist/date-picker/date-picker-prev.js.map +1 -0
  186. package/dist/date-picker/date-picker-root.js +252 -0
  187. package/dist/date-picker/date-picker-root.js.map +1 -0
  188. package/dist/date-picker/date-picker-trigger.js +41 -0
  189. package/dist/date-picker/date-picker-trigger.js.map +1 -0
  190. package/dist/date-range-field/date-range-field-input.js +96 -0
  191. package/dist/date-range-field/date-range-field-input.js.map +1 -0
  192. package/dist/date-range-field/date-range-field-root.js +347 -0
  193. package/dist/date-range-field/date-range-field-root.js.map +1 -0
  194. package/dist/date-range-picker/date-range-picker-anchor.js +38 -0
  195. package/dist/date-range-picker/date-range-picker-anchor.js.map +1 -0
  196. package/dist/date-range-picker/date-range-picker-arrow.js +46 -0
  197. package/dist/date-range-picker/date-range-picker-arrow.js.map +1 -0
  198. package/dist/date-range-picker/date-range-picker-calendar.js +66 -0
  199. package/dist/date-range-picker/date-range-picker-calendar.js.map +1 -0
  200. package/dist/date-range-picker/date-range-picker-cell-trigger.js +43 -0
  201. package/dist/date-range-picker/date-range-picker-cell-trigger.js.map +1 -0
  202. package/dist/date-range-picker/date-range-picker-cell.js +38 -0
  203. package/dist/date-range-picker/date-range-picker-cell.js.map +1 -0
  204. package/dist/date-range-picker/date-range-picker-close.js +34 -0
  205. package/dist/date-range-picker/date-range-picker-close.js.map +1 -0
  206. package/dist/date-range-picker/date-range-picker-content.js +148 -0
  207. package/dist/date-range-picker/date-range-picker-content.js.map +1 -0
  208. package/dist/date-range-picker/date-range-picker-field.js +57 -0
  209. package/dist/date-range-picker/date-range-picker-field.js.map +1 -0
  210. package/dist/date-range-picker/date-range-picker-grid-body.js +34 -0
  211. package/dist/date-range-picker/date-range-picker-grid-body.js.map +1 -0
  212. package/dist/date-range-picker/date-range-picker-grid-head.js +34 -0
  213. package/dist/date-range-picker/date-range-picker-grid-head.js.map +1 -0
  214. package/dist/date-range-picker/date-range-picker-grid-row.js +34 -0
  215. package/dist/date-range-picker/date-range-picker-grid-row.js.map +1 -0
  216. package/dist/date-range-picker/date-range-picker-grid.js +34 -0
  217. package/dist/date-range-picker/date-range-picker-grid.js.map +1 -0
  218. package/dist/date-range-picker/date-range-picker-head-cell.js +34 -0
  219. package/dist/date-range-picker/date-range-picker-head-cell.js.map +1 -0
  220. package/dist/date-range-picker/date-range-picker-header.js +34 -0
  221. package/dist/date-range-picker/date-range-picker-header.js.map +1 -0
  222. package/dist/date-range-picker/date-range-picker-heading.js +34 -0
  223. package/dist/date-range-picker/date-range-picker-heading.js.map +1 -0
  224. package/dist/date-range-picker/date-range-picker-input.js +42 -0
  225. package/dist/date-range-picker/date-range-picker-input.js.map +1 -0
  226. package/dist/date-range-picker/date-range-picker-next.js +38 -0
  227. package/dist/date-range-picker/date-range-picker-next.js.map +1 -0
  228. package/dist/date-range-picker/date-range-picker-prev.js +38 -0
  229. package/dist/date-range-picker/date-range-picker-prev.js.map +1 -0
  230. package/dist/date-range-picker/date-range-picker-root.js +290 -0
  231. package/dist/date-range-picker/date-range-picker-root.js.map +1 -0
  232. package/dist/date-range-picker/date-range-picker-trigger.js +41 -0
  233. package/dist/date-range-picker/date-range-picker-trigger.js.map +1 -0
  234. package/dist/date.js +3 -1
  235. package/dist/dialog/dialog-close.js +42 -0
  236. package/dist/dialog/dialog-close.js.map +1 -0
  237. package/dist/dialog/dialog-content-impl.js +111 -0
  238. package/dist/dialog/dialog-content-impl.js.map +1 -0
  239. package/dist/dialog/dialog-content-modal.js +85 -0
  240. package/dist/dialog/dialog-content-modal.js.map +1 -0
  241. package/dist/dialog/dialog-content-non-modal.js +87 -0
  242. package/dist/dialog/dialog-content-non-modal.js.map +1 -0
  243. package/dist/dialog/dialog-content.js +79 -0
  244. package/dist/dialog/dialog-content.js.map +1 -0
  245. package/dist/dialog/dialog-description.js +39 -0
  246. package/dist/dialog/dialog-description.js.map +1 -0
  247. package/dist/dialog/dialog-overlay-impl.js +48 -0
  248. package/dist/dialog/dialog-overlay-impl.js.map +1 -0
  249. package/dist/dialog/dialog-overlay.js +52 -0
  250. package/dist/dialog/dialog-overlay.js.map +1 -0
  251. package/dist/dialog/dialog-portal.js +42 -0
  252. package/dist/dialog/dialog-portal.js.map +1 -0
  253. package/dist/dialog/dialog-root.js +71 -0
  254. package/dist/dialog/dialog-root.js.map +1 -0
  255. package/dist/dialog/dialog-title.js +39 -0
  256. package/dist/dialog/dialog-title.js.map +1 -0
  257. package/dist/dialog/dialog-trigger.js +58 -0
  258. package/dist/dialog/dialog-trigger.js.map +1 -0
  259. package/dist/dialog/utils.js +26 -0
  260. package/dist/dialog/utils.js.map +1 -0
  261. package/dist/dismissable-layer/dismissable-layer-branch.js +43 -0
  262. package/dist/dismissable-layer/dismissable-layer-branch.js.map +1 -0
  263. package/dist/dismissable-layer/dismissable-layer.js +135 -0
  264. package/dist/dismissable-layer/dismissable-layer.js.map +1 -0
  265. package/dist/dismissable-layer/utils.js +136 -0
  266. package/dist/dismissable-layer/utils.js.map +1 -0
  267. package/dist/drawer/drawer-content.js +77 -0
  268. package/dist/drawer/drawer-content.js.map +1 -0
  269. package/dist/drawer/drawer-handle.js +91 -0
  270. package/dist/drawer/drawer-handle.js.map +1 -0
  271. package/dist/drawer/drawer-overlay.js +28 -0
  272. package/dist/drawer/drawer-overlay.js.map +1 -0
  273. package/dist/drawer/drawer-root-nested.js +127 -0
  274. package/dist/drawer/drawer-root-nested.js.map +1 -0
  275. package/dist/drawer/drawer-root.js +164 -0
  276. package/dist/drawer/drawer-root.js.map +1 -0
  277. package/dist/drawer/drawer.browser.js +8 -0
  278. package/dist/drawer/drawer.browser.js.map +1 -0
  279. package/dist/drawer/drawer.constants.js +21 -0
  280. package/dist/drawer/drawer.constants.js.map +1 -0
  281. package/dist/drawer/drawer.context.js +8 -0
  282. package/dist/drawer/drawer.context.js.map +1 -0
  283. package/dist/drawer/drawer.controls.js +390 -0
  284. package/dist/drawer/drawer.controls.js.map +1 -0
  285. package/dist/drawer/drawer.utils.js +67 -0
  286. package/dist/drawer/drawer.utils.js.map +1 -0
  287. package/dist/drawer/use-position-fixed.js +80 -0
  288. package/dist/drawer/use-position-fixed.js.map +1 -0
  289. package/dist/drawer/use-scale-background.js +53 -0
  290. package/dist/drawer/use-scale-background.js.map +1 -0
  291. package/dist/drawer/use-snap-points.js +159 -0
  292. package/dist/drawer/use-snap-points.js.map +1 -0
  293. package/dist/dropdown-menu/dropdown-menu-arrow.js +51 -0
  294. package/dist/dropdown-menu/dropdown-menu-arrow.js.map +1 -0
  295. package/dist/dropdown-menu/dropdown-menu-checkbox-item.js +55 -0
  296. package/dist/dropdown-menu/dropdown-menu-checkbox-item.js.map +1 -0
  297. package/dist/dropdown-menu/dropdown-menu-content.js +154 -0
  298. package/dist/dropdown-menu/dropdown-menu-content.js.map +1 -0
  299. package/dist/dropdown-menu/dropdown-menu-group.js +36 -0
  300. package/dist/dropdown-menu/dropdown-menu-group.js.map +1 -0
  301. package/dist/dropdown-menu/dropdown-menu-item-indicator.js +40 -0
  302. package/dist/dropdown-menu/dropdown-menu-item-indicator.js.map +1 -0
  303. package/dist/dropdown-menu/dropdown-menu-item.js +51 -0
  304. package/dist/dropdown-menu/dropdown-menu-item.js.map +1 -0
  305. package/dist/dropdown-menu/dropdown-menu-label.js +36 -0
  306. package/dist/dropdown-menu/dropdown-menu-label.js.map +1 -0
  307. package/dist/dropdown-menu/dropdown-menu-portal.js +42 -0
  308. package/dist/dropdown-menu/dropdown-menu-portal.js.map +1 -0
  309. package/dist/dropdown-menu/dropdown-menu-radio-group.js +47 -0
  310. package/dist/dropdown-menu/dropdown-menu-radio-group.js.map +1 -0
  311. package/dist/dropdown-menu/dropdown-menu-radio-item.js +52 -0
  312. package/dist/dropdown-menu/dropdown-menu-radio-item.js.map +1 -0
  313. package/dist/dropdown-menu/dropdown-menu-root.js +82 -0
  314. package/dist/dropdown-menu/dropdown-menu-root.js.map +1 -0
  315. package/dist/dropdown-menu/dropdown-menu-separator.js +36 -0
  316. package/dist/dropdown-menu/dropdown-menu-separator.js.map +1 -0
  317. package/dist/dropdown-menu/dropdown-menu-sub-content.js +122 -0
  318. package/dist/dropdown-menu/dropdown-menu-sub-content.js.map +1 -0
  319. package/dist/dropdown-menu/dropdown-menu-sub-trigger.js +44 -0
  320. package/dist/dropdown-menu/dropdown-menu-sub-trigger.js.map +1 -0
  321. package/dist/dropdown-menu/dropdown-menu-sub.js +47 -0
  322. package/dist/dropdown-menu/dropdown-menu-sub.js.map +1 -0
  323. package/dist/dropdown-menu/dropdown-menu-trigger.js +95 -0
  324. package/dist/dropdown-menu/dropdown-menu-trigger.js.map +1 -0
  325. package/dist/editable/editable-area.js +53 -0
  326. package/dist/editable/editable-area.js.map +1 -0
  327. package/dist/editable/editable-cancel-trigger.js +52 -0
  328. package/dist/editable/editable-cancel-trigger.js.map +1 -0
  329. package/dist/editable/editable-edit-trigger.js +52 -0
  330. package/dist/editable/editable-edit-trigger.js.map +1 -0
  331. package/dist/editable/editable-input.js +89 -0
  332. package/dist/editable/editable-input.js.map +1 -0
  333. package/dist/editable/editable-preview.js +62 -0
  334. package/dist/editable/editable-preview.js.map +1 -0
  335. package/dist/editable/editable-root.js +232 -0
  336. package/dist/editable/editable-root.js.map +1 -0
  337. package/dist/editable/editable-submit-trigger.js +52 -0
  338. package/dist/editable/editable-submit-trigger.js.map +1 -0
  339. package/dist/focus-scope/focus-scope.js +155 -0
  340. package/dist/focus-scope/focus-scope.js.map +1 -0
  341. package/dist/focus-scope/stack.js +37 -0
  342. package/dist/focus-scope/stack.js.map +1 -0
  343. package/dist/focus-scope/utils.js +79 -0
  344. package/dist/focus-scope/utils.js.map +1 -0
  345. package/dist/hover-card/hover-card-arrow.js +51 -0
  346. package/dist/hover-card/hover-card-arrow.js.map +1 -0
  347. package/dist/hover-card/hover-card-content-impl.js +193 -0
  348. package/dist/hover-card/hover-card-content-impl.js.map +1 -0
  349. package/dist/hover-card/hover-card-content.js +127 -0
  350. package/dist/hover-card/hover-card-content.js.map +1 -0
  351. package/dist/hover-card/hover-card-portal.js +42 -0
  352. package/dist/hover-card/hover-card-portal.js.map +1 -0
  353. package/dist/hover-card/hover-card-root.js +92 -0
  354. package/dist/hover-card/hover-card-root.js.map +1 -0
  355. package/dist/hover-card/hover-card-trigger.js +70 -0
  356. package/dist/hover-card/hover-card-trigger.js.map +1 -0
  357. package/dist/hover-card/utils.js +20 -0
  358. package/dist/hover-card/utils.js.map +1 -0
  359. package/dist/index.d.ts +63 -40
  360. package/dist/index.d.ts.map +1 -1
  361. package/dist/index.js +410 -24
  362. package/dist/index2.js +0 -0
  363. package/dist/label/label.js +43 -0
  364. package/dist/label/label.js.map +1 -0
  365. package/dist/listbox/listbox-content.js +77 -0
  366. package/dist/listbox/listbox-content.js.map +1 -0
  367. package/dist/listbox/listbox-filter.js +106 -0
  368. package/dist/listbox/listbox-filter.js.map +1 -0
  369. package/dist/listbox/listbox-group-label.js +41 -0
  370. package/dist/listbox/listbox-group-label.js.map +1 -0
  371. package/dist/listbox/listbox-group.js +39 -0
  372. package/dist/listbox/listbox-group.js.map +1 -0
  373. package/dist/listbox/listbox-item-indicator.js +42 -0
  374. package/dist/listbox/listbox-item-indicator.js.map +1 -0
  375. package/dist/listbox/listbox-item.js +117 -0
  376. package/dist/listbox/listbox-item.js.map +1 -0
  377. package/dist/listbox/listbox-root.js +357 -0
  378. package/dist/listbox/listbox-root.js.map +1 -0
  379. package/dist/{combobox/combobox-virtualizer.cjs → listbox/listbox-virtualizer.js} +49 -92
  380. package/dist/listbox/listbox-virtualizer.js.map +1 -0
  381. package/dist/listbox/utils.js +30 -0
  382. package/dist/listbox/utils.js.map +1 -0
  383. package/dist/menu/menu-anchor.js +38 -0
  384. package/dist/menu/menu-anchor.js.map +1 -0
  385. package/dist/menu/menu-arrow.js +46 -0
  386. package/dist/menu/menu-arrow.js.map +1 -0
  387. package/dist/menu/menu-checkbox-item.js +62 -0
  388. package/dist/menu/menu-checkbox-item.js.map +1 -0
  389. package/dist/menu/menu-content-impl.js +327 -0
  390. package/dist/menu/menu-content-impl.js.map +1 -0
  391. package/dist/menu/menu-content.js +139 -0
  392. package/dist/menu/menu-content.js.map +1 -0
  393. package/dist/menu/menu-group.js +34 -0
  394. package/dist/menu/menu-group.js.map +1 -0
  395. package/dist/menu/menu-item-impl.js +101 -0
  396. package/dist/menu/menu-item-impl.js.map +1 -0
  397. package/dist/menu/menu-item-indicator.js +54 -0
  398. package/dist/menu/menu-item-indicator.js.map +1 -0
  399. package/dist/menu/menu-item.js +90 -0
  400. package/dist/menu/menu-item.js.map +1 -0
  401. package/dist/menu/menu-label.js +35 -0
  402. package/dist/menu/menu-label.js.map +1 -0
  403. package/dist/menu/menu-portal.js +42 -0
  404. package/dist/menu/menu-portal.js.map +1 -0
  405. package/dist/menu/menu-radio-group.js +51 -0
  406. package/dist/menu/menu-radio-group.js.map +1 -0
  407. package/dist/menu/menu-radio-item.js +62 -0
  408. package/dist/menu/menu-radio-item.js.map +1 -0
  409. package/dist/menu/menu-root-content-modal.js +131 -0
  410. package/dist/menu/menu-root-content-modal.js.map +1 -0
  411. package/dist/menu/menu-root-content-non-modal.js +125 -0
  412. package/dist/menu/menu-root-content-non-modal.js.map +1 -0
  413. package/dist/menu/menu-root.js +71 -0
  414. package/dist/menu/menu-root.js.map +1 -0
  415. package/dist/menu/menu-separator.js +37 -0
  416. package/dist/menu/menu-separator.js.map +1 -0
  417. package/dist/menu/menu-sub-content.js +163 -0
  418. package/dist/menu/menu-sub-content.js.map +1 -0
  419. package/dist/menu/menu-sub-trigger.js +157 -0
  420. package/dist/menu/menu-sub-trigger.js.map +1 -0
  421. package/dist/menu/menu-sub.js +66 -0
  422. package/dist/menu/menu-sub.js.map +1 -0
  423. package/dist/menu/utils.js +70 -0
  424. package/dist/menu/utils.js.map +1 -0
  425. package/dist/navigation-menu/navigation-menu-content-impl.js +170 -0
  426. package/dist/navigation-menu/navigation-menu-content-impl.js.map +1 -0
  427. package/dist/navigation-menu/navigation-menu-content.js +95 -0
  428. package/dist/navigation-menu/navigation-menu-content.js.map +1 -0
  429. package/dist/navigation-menu/navigation-menu-indicator.js +85 -0
  430. package/dist/navigation-menu/navigation-menu-indicator.js.map +1 -0
  431. package/dist/navigation-menu/navigation-menu-item.js +125 -0
  432. package/dist/navigation-menu/navigation-menu-item.js.map +1 -0
  433. package/dist/navigation-menu/navigation-menu-link.js +75 -0
  434. package/dist/navigation-menu/navigation-menu-link.js.map +1 -0
  435. package/dist/navigation-menu/navigation-menu-list.js +57 -0
  436. package/dist/navigation-menu/navigation-menu-list.js.map +1 -0
  437. package/dist/navigation-menu/navigation-menu-root.js +181 -0
  438. package/dist/navigation-menu/navigation-menu-root.js.map +1 -0
  439. package/dist/navigation-menu/navigation-menu-sub.js +114 -0
  440. package/dist/navigation-menu/navigation-menu-sub.js.map +1 -0
  441. package/dist/navigation-menu/navigation-menu-trigger.js +150 -0
  442. package/dist/navigation-menu/navigation-menu-trigger.js.map +1 -0
  443. package/dist/navigation-menu/navigation-menu-viewport.js +159 -0
  444. package/dist/navigation-menu/navigation-menu-viewport.js.map +1 -0
  445. package/dist/navigation-menu/utils.js +61 -0
  446. package/dist/navigation-menu/utils.js.map +1 -0
  447. package/dist/number-field/number-field-decrement.js +69 -0
  448. package/dist/number-field/number-field-decrement.js.map +1 -0
  449. package/dist/number-field/number-field-increment.js +69 -0
  450. package/dist/number-field/number-field-increment.js.map +1 -0
  451. package/dist/number-field/number-field-input.js +117 -0
  452. package/dist/number-field/number-field-input.js.map +1 -0
  453. package/dist/number-field/number-field-root.js +250 -0
  454. package/dist/number-field/number-field-root.js.map +1 -0
  455. package/dist/number-field/utils.js +73 -0
  456. package/dist/number-field/utils.js.map +1 -0
  457. package/dist/pagination/pagination-ellipsis.js +36 -0
  458. package/dist/pagination/pagination-ellipsis.js.map +1 -0
  459. package/dist/pagination/pagination-first.js +45 -0
  460. package/dist/pagination/pagination-first.js.map +1 -0
  461. package/dist/pagination/pagination-last.js +45 -0
  462. package/dist/pagination/pagination-last.js.map +1 -0
  463. package/dist/pagination/pagination-list-item.js +59 -0
  464. package/dist/pagination/pagination-list-item.js.map +1 -0
  465. package/dist/pagination/pagination-list.js +42 -0
  466. package/dist/pagination/pagination-list.js.map +1 -0
  467. package/dist/pagination/pagination-next.js +45 -0
  468. package/dist/pagination/pagination-next.js.map +1 -0
  469. package/dist/pagination/pagination-prev.js +45 -0
  470. package/dist/pagination/pagination-prev.js.map +1 -0
  471. package/dist/pagination/pagination-root.js +96 -0
  472. package/dist/pagination/pagination-root.js.map +1 -0
  473. package/dist/pagination/utils.js +74 -0
  474. package/dist/pagination/utils.js.map +1 -0
  475. package/dist/pin-input/pin-input-input.js +217 -0
  476. package/dist/pin-input/pin-input-input.js.map +1 -0
  477. package/dist/pin-input/pin-input-root.js +146 -0
  478. package/dist/pin-input/pin-input-root.js.map +1 -0
  479. package/dist/popover/popover-anchor.js +48 -0
  480. package/dist/popover/popover-anchor.js.map +1 -0
  481. package/dist/popover/popover-arrow.js +51 -0
  482. package/dist/popover/popover-arrow.js.map +1 -0
  483. package/dist/popover/popover-close.js +48 -0
  484. package/dist/popover/popover-close.js.map +1 -0
  485. package/dist/popover/popover-content-impl.js +167 -0
  486. package/dist/popover/popover-content-impl.js.map +1 -0
  487. package/dist/popover/popover-content-modal.js +146 -0
  488. package/dist/popover/popover-content-modal.js.map +1 -0
  489. package/dist/popover/popover-content-non-modal.js +148 -0
  490. package/dist/popover/popover-content-non-modal.js.map +1 -0
  491. package/dist/popover/popover-content.js +139 -0
  492. package/dist/popover/popover-content.js.map +1 -0
  493. package/dist/popover/popover-portal.js +42 -0
  494. package/dist/popover/popover-portal.js.map +1 -0
  495. package/dist/popover/popover-root.js +70 -0
  496. package/dist/popover/popover-root.js.map +1 -0
  497. package/dist/popover/popover-trigger.js +68 -0
  498. package/dist/popover/popover-trigger.js.map +1 -0
  499. package/dist/popper/popper-anchor.js +49 -0
  500. package/dist/popper/popper-anchor.js.map +1 -0
  501. package/dist/popper/popper-arrow.js +96 -0
  502. package/dist/popper/popper-arrow.js.map +1 -0
  503. package/dist/popper/popper-content.js +267 -0
  504. package/dist/popper/popper-content.js.map +1 -0
  505. package/dist/popper/popper-root.js +29 -0
  506. package/dist/popper/popper-root.js.map +1 -0
  507. package/dist/popper/utils.js +52 -0
  508. package/dist/popper/utils.js.map +1 -0
  509. package/dist/presence/presence.js +53 -0
  510. package/dist/presence/presence.js.map +1 -0
  511. package/dist/presence/use-presence.js +127 -0
  512. package/dist/presence/use-presence.js.map +1 -0
  513. package/dist/primitive/primitive.js +33 -0
  514. package/dist/primitive/primitive.js.map +1 -0
  515. package/dist/primitive/slot-primitive.js +37 -0
  516. package/dist/primitive/slot-primitive.js.map +1 -0
  517. package/dist/primitive/use-primitive-element.js +16 -0
  518. package/dist/primitive/use-primitive-element.js.map +1 -0
  519. package/dist/progress/progress-indicator.js +46 -0
  520. package/dist/progress/progress-indicator.js.map +1 -0
  521. package/dist/progress/progress-root.js +123 -0
  522. package/dist/progress/progress-root.js.map +1 -0
  523. package/dist/radio-group/radio-group-indicator.js +57 -0
  524. package/dist/radio-group/radio-group-indicator.js.map +1 -0
  525. package/dist/radio-group/radio-group-item.js +132 -0
  526. package/dist/radio-group/radio-group-item.js.map +1 -0
  527. package/dist/radio-group/radio-group-root.js +138 -0
  528. package/dist/radio-group/radio-group-root.js.map +1 -0
  529. package/dist/radio-group/radio.js +126 -0
  530. package/dist/radio-group/radio.js.map +1 -0
  531. package/dist/radio-group/utils.js +19 -0
  532. package/dist/radio-group/utils.js.map +1 -0
  533. package/dist/range-calendar/range-calendar-cell-trigger.js +262 -0
  534. package/dist/range-calendar/range-calendar-cell-trigger.js.map +1 -0
  535. package/dist/range-calendar/range-calendar-cell.js +53 -0
  536. package/dist/range-calendar/range-calendar-cell.js.map +1 -0
  537. package/dist/range-calendar/range-calendar-grid-body.js +35 -0
  538. package/dist/range-calendar/range-calendar-grid-body.js.map +1 -0
  539. package/dist/range-calendar/range-calendar-grid-head.js +35 -0
  540. package/dist/range-calendar/range-calendar-grid-head.js.map +1 -0
  541. package/dist/range-calendar/range-calendar-grid-row.js +35 -0
  542. package/dist/range-calendar/range-calendar-grid-row.js.map +1 -0
  543. package/dist/range-calendar/range-calendar-grid.js +51 -0
  544. package/dist/range-calendar/range-calendar-grid.js.map +1 -0
  545. package/dist/range-calendar/range-calendar-head-cell.js +35 -0
  546. package/dist/range-calendar/range-calendar-head-cell.js.map +1 -0
  547. package/dist/range-calendar/range-calendar-header.js +35 -0
  548. package/dist/range-calendar/range-calendar-header.js.map +1 -0
  549. package/dist/range-calendar/range-calendar-heading.js +37 -0
  550. package/dist/range-calendar/range-calendar-heading.js.map +1 -0
  551. package/dist/range-calendar/range-calendar-next.js +54 -0
  552. package/dist/range-calendar/range-calendar-next.js.map +1 -0
  553. package/dist/range-calendar/range-calendar-prev.js +54 -0
  554. package/dist/range-calendar/range-calendar-prev.js.map +1 -0
  555. package/dist/range-calendar/range-calendar-root.js +375 -0
  556. package/dist/range-calendar/range-calendar-root.js.map +1 -0
  557. package/dist/range-calendar/use-range-calendar.js +125 -0
  558. package/dist/range-calendar/use-range-calendar.js.map +1 -0
  559. package/dist/roving-focus/roving-focus-group.js +145 -0
  560. package/dist/roving-focus/roving-focus-group.js.map +1 -0
  561. package/dist/roving-focus/roving-focus-item.js +111 -0
  562. package/dist/roving-focus/roving-focus-item.js.map +1 -0
  563. package/dist/roving-focus/utils.js +49 -0
  564. package/dist/roving-focus/utils.js.map +1 -0
  565. package/dist/scroll-area/scroll-area-corner-impl.js +53 -0
  566. package/dist/scroll-area/scroll-area-corner-impl.js.map +1 -0
  567. package/dist/scroll-area/scroll-area-corner.js +40 -0
  568. package/dist/scroll-area/scroll-area-corner.js.map +1 -0
  569. package/dist/scroll-area/scroll-area-root.js +128 -0
  570. package/dist/scroll-area/scroll-area-root.js.map +1 -0
  571. package/dist/scroll-area/scroll-area-scrollbar-auto.js +52 -0
  572. package/dist/scroll-area/scroll-area-scrollbar-auto.js.map +1 -0
  573. package/dist/scroll-area/scroll-area-scrollbar-hover.js +65 -0
  574. package/dist/scroll-area/scroll-area-scrollbar-hover.js.map +1 -0
  575. package/dist/scroll-area/scroll-area-scrollbar-impl.js +122 -0
  576. package/dist/scroll-area/scroll-area-scrollbar-impl.js.map +1 -0
  577. package/dist/scroll-area/scroll-area-scrollbar-scroll.js +88 -0
  578. package/dist/scroll-area/scroll-area-scrollbar-scroll.js.map +1 -0
  579. package/dist/scroll-area/scroll-area-scrollbar-visible.js +107 -0
  580. package/dist/scroll-area/scroll-area-scrollbar-visible.js.map +1 -0
  581. package/dist/scroll-area/scroll-area-scrollbar-x.js +45 -0
  582. package/dist/scroll-area/scroll-area-scrollbar-x.js.map +1 -0
  583. package/dist/scroll-area/scroll-area-scrollbar-y.js +46 -0
  584. package/dist/scroll-area/scroll-area-scrollbar-y.js.map +1 -0
  585. package/dist/scroll-area/scroll-area-scrollbar.js +92 -0
  586. package/dist/scroll-area/scroll-area-scrollbar.js.map +1 -0
  587. package/dist/scroll-area/scroll-area-thumb.js +98 -0
  588. package/dist/scroll-area/scroll-area-thumb.js.map +1 -0
  589. package/dist/scroll-area/scroll-area-viewport.js +76 -0
  590. package/dist/scroll-area/scroll-area-viewport.js.map +1 -0
  591. package/dist/scroll-area/utils.js +75 -0
  592. package/dist/scroll-area/utils.js.map +1 -0
  593. package/dist/select/bubble-select.js +86 -0
  594. package/dist/select/bubble-select.js.map +1 -0
  595. package/dist/select/select-arrow.js +53 -0
  596. package/dist/select/select-arrow.js.map +1 -0
  597. package/dist/select/select-content-impl.js +306 -0
  598. package/dist/select/select-content-impl.js.map +1 -0
  599. package/dist/select/select-content.js +161 -0
  600. package/dist/select/select-content.js.map +1 -0
  601. package/dist/select/select-group.js +39 -0
  602. package/dist/select/select-group.js.map +1 -0
  603. package/dist/select/select-icon.js +38 -0
  604. package/dist/select/select-icon.js.map +1 -0
  605. package/dist/select/select-item-aligned-position.js +170 -0
  606. package/dist/select/select-item-aligned-position.js.map +1 -0
  607. package/dist/select/select-item-indicator.js +40 -0
  608. package/dist/select/select-item-indicator.js.map +1 -0
  609. package/dist/select/select-item-text.js +66 -0
  610. package/dist/select/select-item-text.js.map +1 -0
  611. package/dist/select/select-item.js +157 -0
  612. package/dist/select/select-item.js.map +1 -0
  613. package/dist/select/select-label.js +41 -0
  614. package/dist/select/select-label.js.map +1 -0
  615. package/dist/select/select-popper-position.js +114 -0
  616. package/dist/select/select-popper-position.js.map +1 -0
  617. package/dist/select/select-portal.js +42 -0
  618. package/dist/select/select-portal.js.map +1 -0
  619. package/dist/select/select-provider.js +29 -0
  620. package/dist/select/select-provider.js.map +1 -0
  621. package/dist/select/select-root.js +185 -0
  622. package/dist/select/select-root.js.map +1 -0
  623. package/dist/select/select-scroll-button-impl.js +62 -0
  624. package/dist/select/select-scroll-button-impl.js.map +1 -0
  625. package/dist/select/select-scroll-down-button.js +62 -0
  626. package/dist/select/select-scroll-down-button.js.map +1 -0
  627. package/dist/select/select-scroll-up-button.js +61 -0
  628. package/dist/select/select-scroll-up-button.js.map +1 -0
  629. package/dist/select/select-separator.js +34 -0
  630. package/dist/select/select-separator.js.map +1 -0
  631. package/dist/select/select-trigger.js +135 -0
  632. package/dist/select/select-trigger.js.map +1 -0
  633. package/dist/select/select-value.js +74 -0
  634. package/dist/select/select-value.js.map +1 -0
  635. package/dist/select/select-viewport.js +97 -0
  636. package/dist/select/select-viewport.js.map +1 -0
  637. package/dist/select/utils.js +30 -0
  638. package/dist/select/utils.js.map +1 -0
  639. package/dist/separator/separator.js +43 -0
  640. package/dist/separator/separator.js.map +1 -0
  641. package/dist/shared/arrays.js +50 -0
  642. package/dist/shared/arrays.js.map +1 -0
  643. package/dist/shared/create-context.js +36 -0
  644. package/dist/shared/create-context.js.map +1 -0
  645. package/dist/shared/get-active-element.js +11 -0
  646. package/dist/shared/get-active-element.js.map +1 -0
  647. package/dist/shared/handle-and-dispatch-custom-event.js +15 -0
  648. package/dist/shared/handle-and-dispatch-custom-event.js.map +1 -0
  649. package/dist/shared/is-value-equal-or-exist.js +21 -0
  650. package/dist/shared/is-value-equal-or-exist.js.map +1 -0
  651. package/dist/shared/numbers.js +65 -0
  652. package/dist/shared/numbers.js.map +1 -0
  653. package/dist/shared/render-slot-fragments.js +14 -0
  654. package/dist/shared/render-slot-fragments.js.map +1 -0
  655. package/dist/shared/use-arrow-navigation.js +81 -0
  656. package/dist/shared/use-arrow-navigation.js.map +1 -0
  657. package/dist/shared/use-body-scroll-lock.js +99 -0
  658. package/dist/shared/use-body-scroll-lock.js.map +1 -0
  659. package/dist/shared/use-date-formatter.js +135 -0
  660. package/dist/shared/use-date-formatter.js.map +1 -0
  661. package/dist/shared/use-direction.js +12 -0
  662. package/dist/shared/use-direction.js.map +1 -0
  663. package/dist/shared/use-emit-as-props.js +26 -0
  664. package/dist/shared/use-emit-as-props.js.map +1 -0
  665. package/dist/shared/use-filter.js +58 -0
  666. package/dist/shared/use-filter.js.map +1 -0
  667. package/dist/shared/use-focus-guards.js +40 -0
  668. package/dist/shared/use-focus-guards.js.map +1 -0
  669. package/dist/shared/use-form-control.js +11 -0
  670. package/dist/shared/use-form-control.js.map +1 -0
  671. package/dist/shared/use-forward-expose.js +48 -0
  672. package/dist/shared/use-forward-expose.js.map +1 -0
  673. package/dist/shared/use-forward-props-emits.js +30 -0
  674. package/dist/shared/use-forward-props-emits.js.map +1 -0
  675. package/dist/shared/use-forward-props.js +38 -0
  676. package/dist/shared/use-forward-props.js.map +1 -0
  677. package/dist/shared/use-grace-area.js +206 -0
  678. package/dist/shared/use-grace-area.js.map +1 -0
  679. package/dist/shared/use-hide-others.js +26 -0
  680. package/dist/shared/use-hide-others.js.map +1 -0
  681. package/dist/shared/use-id.js +24 -0
  682. package/dist/shared/use-id.js.map +1 -0
  683. package/dist/shared/use-is-using-keyboard.js +27 -0
  684. package/dist/shared/use-is-using-keyboard.js.map +1 -0
  685. package/dist/shared/use-locale.js +12 -0
  686. package/dist/shared/use-locale.js.map +1 -0
  687. package/dist/shared/use-nonce.js +12 -0
  688. package/dist/shared/use-nonce.js.map +1 -0
  689. package/dist/shared/use-selection-behavior.js +65 -0
  690. package/dist/shared/use-selection-behavior.js.map +1 -0
  691. package/dist/shared/use-single-or-multiple-value.js +63 -0
  692. package/dist/shared/use-single-or-multiple-value.js.map +1 -0
  693. package/dist/shared/use-size.js +57 -0
  694. package/dist/shared/use-size.js.map +1 -0
  695. package/dist/shared/use-state-machine.js +32 -0
  696. package/dist/shared/use-state-machine.js.map +1 -0
  697. package/dist/shared/use-typeahead.js +68 -0
  698. package/dist/shared/use-typeahead.js.map +1 -0
  699. package/dist/slider/slider-horizontal.js +113 -0
  700. package/dist/slider/slider-horizontal.js.map +1 -0
  701. package/dist/slider/slider-impl.js +79 -0
  702. package/dist/slider/slider-impl.js.map +1 -0
  703. package/dist/slider/slider-range.js +58 -0
  704. package/dist/slider/slider-range.js.map +1 -0
  705. package/dist/slider/slider-root.js +220 -0
  706. package/dist/slider/slider-root.js.map +1 -0
  707. package/dist/slider/slider-thumb-impl.js +103 -0
  708. package/dist/slider/slider-thumb-impl.js.map +1 -0
  709. package/dist/slider/slider-thumb.js +40 -0
  710. package/dist/slider/slider-thumb.js.map +1 -0
  711. package/dist/slider/slider-track.js +48 -0
  712. package/dist/slider/slider-track.js.map +1 -0
  713. package/dist/slider/slider-vertical.js +108 -0
  714. package/dist/slider/slider-vertical.js.map +1 -0
  715. package/dist/slider/utils.js +132 -0
  716. package/dist/slider/utils.js.map +1 -0
  717. package/dist/splitter/splitter-group.js +411 -0
  718. package/dist/splitter/splitter-group.js.map +1 -0
  719. package/dist/splitter/splitter-panel.js +152 -0
  720. package/dist/splitter/splitter-panel.js.map +1 -0
  721. package/dist/splitter/splitter-resize-handle.js +154 -0
  722. package/dist/splitter/splitter-resize-handle.js.map +1 -0
  723. package/dist/stepper/stepper-description.js +39 -0
  724. package/dist/stepper/stepper-description.js.map +1 -0
  725. package/dist/stepper/stepper-indicator.js +38 -0
  726. package/dist/stepper/stepper-indicator.js.map +1 -0
  727. package/dist/stepper/stepper-item.js +94 -0
  728. package/dist/stepper/stepper-item.js.map +1 -0
  729. package/dist/stepper/stepper-root.js +172 -0
  730. package/dist/stepper/stepper-root.js.map +1 -0
  731. package/dist/stepper/stepper-separator.js +52 -0
  732. package/dist/stepper/stepper-separator.js.map +1 -0
  733. package/dist/stepper/stepper-title.js +39 -0
  734. package/dist/stepper/stepper-title.js.map +1 -0
  735. package/dist/stepper/stepper-trigger.js +118 -0
  736. package/dist/stepper/stepper-trigger.js.map +1 -0
  737. package/dist/switch/switch-root.js +133 -0
  738. package/dist/switch/switch-root.js.map +1 -0
  739. package/dist/switch/switch-thumb.js +48 -0
  740. package/dist/switch/switch-thumb.js.map +1 -0
  741. package/dist/tabs/tabs-content.js +84 -0
  742. package/dist/tabs/tabs-content.js.map +1 -0
  743. package/dist/tabs/tabs-indicator.js +64 -0
  744. package/dist/tabs/tabs-indicator.js.map +1 -0
  745. package/dist/tabs/tabs-list.js +68 -0
  746. package/dist/tabs/tabs-list.js.map +1 -0
  747. package/dist/tabs/tabs-root.js +99 -0
  748. package/dist/tabs/tabs-root.js.map +1 -0
  749. package/dist/tabs/tabs-trigger.js +93 -0
  750. package/dist/tabs/tabs-trigger.js.map +1 -0
  751. package/dist/tabs/utils.js +11 -0
  752. package/dist/tabs/utils.js.map +1 -0
  753. package/dist/tags-input/tags-input-clear.js +47 -0
  754. package/dist/tags-input/tags-input-clear.js.map +1 -0
  755. package/dist/tags-input/tags-input-input.js +147 -0
  756. package/dist/tags-input/tags-input-input.js.map +1 -0
  757. package/dist/tags-input/tags-input-item-delete.js +61 -0
  758. package/dist/tags-input/tags-input-item-delete.js.map +1 -0
  759. package/dist/tags-input/tags-input-item-text.js +41 -0
  760. package/dist/tags-input/tags-input-item-text.js.map +1 -0
  761. package/dist/tags-input/tags-input-item.js +78 -0
  762. package/dist/tags-input/tags-input-item.js.map +1 -0
  763. package/dist/tags-input/tags-input-root.js +260 -0
  764. package/dist/tags-input/tags-input-root.js.map +1 -0
  765. package/dist/teleport/teleport.js +49 -0
  766. package/dist/teleport/teleport.js.map +1 -0
  767. package/dist/time-field/time-field-input.js +90 -0
  768. package/dist/time-field/time-field-input.js.map +1 -0
  769. package/dist/time-field/time-field-root.js +301 -0
  770. package/dist/time-field/time-field-root.js.map +1 -0
  771. package/dist/toast/focus-proxy.js +36 -0
  772. package/dist/toast/focus-proxy.js.map +1 -0
  773. package/dist/toast/toast-action.js +53 -0
  774. package/dist/toast/toast-action.js.map +1 -0
  775. package/dist/toast/toast-announce-exclude.js +46 -0
  776. package/dist/toast/toast-announce-exclude.js.map +1 -0
  777. package/dist/toast/toast-announce.js +32 -0
  778. package/dist/toast/toast-announce.js.map +1 -0
  779. package/dist/toast/toast-close.js +47 -0
  780. package/dist/toast/toast-close.js.map +1 -0
  781. package/dist/toast/toast-description.js +36 -0
  782. package/dist/toast/toast-description.js.map +1 -0
  783. package/dist/toast/toast-portal.js +42 -0
  784. package/dist/toast/toast-portal.js.map +1 -0
  785. package/dist/toast/toast-provider.js +75 -0
  786. package/dist/toast/toast-provider.js.map +1 -0
  787. package/dist/toast/toast-root-impl.js +231 -0
  788. package/dist/toast/toast-root-impl.js.map +1 -0
  789. package/dist/toast/toast-root.js +144 -0
  790. package/dist/toast/toast-root.js.map +1 -0
  791. package/dist/toast/toast-title.js +36 -0
  792. package/dist/toast/toast-title.js.map +1 -0
  793. package/dist/toast/toast-viewport.js +180 -0
  794. package/dist/toast/toast-viewport.js.map +1 -0
  795. package/dist/toast/utils.js +47 -0
  796. package/dist/toast/utils.js.map +1 -0
  797. package/dist/toggle/toggle.js +110 -0
  798. package/dist/toggle/toggle.js.map +1 -0
  799. package/dist/toggle-group/toggle-group-item.js +64 -0
  800. package/dist/toggle-group/toggle-group-item.js.map +1 -0
  801. package/dist/toggle-group/toggle-group-root.js +128 -0
  802. package/dist/toggle-group/toggle-group-root.js.map +1 -0
  803. package/dist/tooltip/tooltip-arrow.js +47 -0
  804. package/dist/tooltip/tooltip-arrow.js.map +1 -0
  805. package/dist/tooltip/tooltip-content-hoverable.js +103 -0
  806. package/dist/tooltip/tooltip-content-hoverable.js.map +1 -0
  807. package/dist/tooltip/tooltip-content-impl.js +163 -0
  808. package/dist/tooltip/tooltip-content-impl.js.map +1 -0
  809. package/dist/tooltip/tooltip-content.js +104 -0
  810. package/dist/tooltip/tooltip-content.js.map +1 -0
  811. package/dist/tooltip/tooltip-portal.js +42 -0
  812. package/dist/tooltip/tooltip-portal.js.map +1 -0
  813. package/dist/tooltip/tooltip-provider.js +78 -0
  814. package/dist/tooltip/tooltip-provider.js.map +1 -0
  815. package/dist/tooltip/tooltip-root.js +132 -0
  816. package/dist/tooltip/tooltip-root.js.map +1 -0
  817. package/dist/tooltip/tooltip-trigger.js +114 -0
  818. package/dist/tooltip/tooltip-trigger.js.map +1 -0
  819. package/dist/tooltip/utils.js +6 -0
  820. package/dist/tooltip/utils.js.map +1 -0
  821. package/dist/tree/tree-item.js +183 -0
  822. package/dist/tree/tree-item.js.map +1 -0
  823. package/dist/tree/tree-root.js +259 -0
  824. package/dist/tree/tree-root.js.map +1 -0
  825. package/dist/tree/tree-virtualizer.js +177 -0
  826. package/dist/tree/tree-virtualizer.js.map +1 -0
  827. package/dist/tree/utils.js +12 -0
  828. package/dist/tree/utils.js.map +1 -0
  829. package/dist/utils/assert.js +11 -0
  830. package/dist/utils/assert.js.map +1 -0
  831. package/dist/utils/calculate.js +113 -0
  832. package/dist/utils/calculate.js.map +1 -0
  833. package/dist/utils/call-panel-callbacks.js +25 -0
  834. package/dist/utils/call-panel-callbacks.js.map +1 -0
  835. package/dist/utils/compare.js +17 -0
  836. package/dist/utils/compare.js.map +1 -0
  837. package/dist/utils/constants.js +6 -0
  838. package/dist/utils/constants.js.map +1 -0
  839. package/dist/utils/debounce.js +15 -0
  840. package/dist/utils/debounce.js.map +1 -0
  841. package/dist/utils/dom.js +38 -0
  842. package/dist/utils/dom.js.map +1 -0
  843. package/dist/utils/events.js +36 -0
  844. package/dist/utils/events.js.map +1 -0
  845. package/dist/utils/layout.js +137 -0
  846. package/dist/utils/layout.js.map +1 -0
  847. package/dist/utils/pivot.js +11 -0
  848. package/dist/utils/pivot.js.map +1 -0
  849. package/dist/utils/rects.js +9 -0
  850. package/dist/utils/rects.js.map +1 -0
  851. package/dist/utils/registry.js +183 -0
  852. package/dist/utils/registry.js.map +1 -0
  853. package/dist/utils/resize-panel.js +22 -0
  854. package/dist/utils/resize-panel.js.map +1 -0
  855. package/dist/utils/stacking-order.js +93 -0
  856. package/dist/utils/stacking-order.js.map +1 -0
  857. package/dist/utils/storage.js +61 -0
  858. package/dist/utils/storage.js.map +1 -0
  859. package/dist/utils/style.js +62 -0
  860. package/dist/utils/style.js.map +1 -0
  861. package/dist/utils/validation.js +53 -0
  862. package/dist/utils/validation.js.map +1 -0
  863. package/dist/viewport/viewport.js +62 -0
  864. package/dist/viewport/viewport.js.map +1 -0
  865. package/dist/visually-hidden/visually-hidden-input-bubble.js +73 -0
  866. package/dist/visually-hidden/visually-hidden-input-bubble.js.map +1 -0
  867. package/dist/visually-hidden/visually-hidden-input.js +87 -0
  868. package/dist/visually-hidden/visually-hidden-input.js.map +1 -0
  869. package/dist/visually-hidden/visually-hidden.js +64 -0
  870. package/dist/visually-hidden/visually-hidden.js.map +1 -0
  871. package/package.json +18 -14
  872. package/src/context-menu/context-menu-root.vue +12 -2
  873. package/src/context-menu/context-menu-trigger.vue +4 -1
  874. package/src/date-picker/date-picker-root.vue +12 -1
  875. package/src/date-range-picker/date-range-picker-root.vue +14 -1
  876. package/src/range-calendar/range-calendar-root.vue +30 -24
  877. package/src/select/select-root.vue +20 -3
  878. package/dist/accordion/accordion-content.cjs +0 -1137
  879. package/dist/accordion/accordion-content.cjs.map +0 -1
  880. package/dist/accordion/accordion-header.cjs +0 -56
  881. package/dist/accordion/accordion-header.cjs.map +0 -1
  882. package/dist/accordion/accordion-trigger.cjs +0 -129
  883. package/dist/accordion/accordion-trigger.cjs.map +0 -1
  884. package/dist/avatar/avatar-fallback.cjs +0 -110
  885. package/dist/avatar/avatar-fallback.cjs.map +0 -1
  886. package/dist/avatar/avatar-image.cjs +0 -125
  887. package/dist/avatar/avatar-image.cjs.map +0 -1
  888. package/dist/calendar/calendar-cell-trigger.cjs +0 -219
  889. package/dist/calendar/calendar-cell-trigger.cjs.map +0 -1
  890. package/dist/calendar/calendar-cell.cjs +0 -1343
  891. package/dist/calendar/calendar-cell.cjs.map +0 -1
  892. package/dist/calendar/calendar-grid-body.cjs +0 -41
  893. package/dist/calendar/calendar-grid-body.cjs.map +0 -1
  894. package/dist/calendar/calendar-grid-head.cjs +0 -41
  895. package/dist/calendar/calendar-grid-head.cjs.map +0 -1
  896. package/dist/calendar/calendar-grid-row.cjs +0 -41
  897. package/dist/calendar/calendar-grid-row.cjs.map +0 -1
  898. package/dist/calendar/calendar-grid.cjs +0 -57
  899. package/dist/calendar/calendar-grid.cjs.map +0 -1
  900. package/dist/calendar/calendar-head-cell.cjs +0 -41
  901. package/dist/calendar/calendar-head-cell.cjs.map +0 -1
  902. package/dist/calendar/calendar-header.cjs +0 -41
  903. package/dist/calendar/calendar-header.cjs.map +0 -1
  904. package/dist/calendar/calendar-heading.cjs +0 -43
  905. package/dist/calendar/calendar-heading.cjs.map +0 -1
  906. package/dist/calendar/calendar-next.cjs +0 -64
  907. package/dist/calendar/calendar-next.cjs.map +0 -1
  908. package/dist/calendar/calendar-prev.cjs +0 -64
  909. package/dist/calendar/calendar-prev.cjs.map +0 -1
  910. package/dist/checkbox/checkbox-group-root.cjs +0 -660
  911. package/dist/checkbox/checkbox-group-root.cjs.map +0 -1
  912. package/dist/checkbox/checkbox-indicator.cjs +0 -334
  913. package/dist/checkbox/checkbox-indicator.cjs.map +0 -1
  914. package/dist/combobox/combobox-anchor.cjs +0 -138
  915. package/dist/combobox/combobox-anchor.cjs.map +0 -1
  916. package/dist/combobox/combobox-arrow.cjs +0 -2171
  917. package/dist/combobox/combobox-arrow.cjs.map +0 -1
  918. package/dist/combobox/combobox-cancel.cjs +0 -54
  919. package/dist/combobox/combobox-cancel.cjs.map +0 -1
  920. package/dist/combobox/combobox-content.cjs +0 -200
  921. package/dist/combobox/combobox-content.cjs.map +0 -1
  922. package/dist/combobox/combobox-empty.cjs +0 -43
  923. package/dist/combobox/combobox-empty.cjs.map +0 -1
  924. package/dist/combobox/combobox-group.cjs +0 -116
  925. package/dist/combobox/combobox-group.cjs.map +0 -1
  926. package/dist/combobox/combobox-input.cjs +0 -243
  927. package/dist/combobox/combobox-input.cjs.map +0 -1
  928. package/dist/combobox/combobox-item-indicator.cjs +0 -83
  929. package/dist/combobox/combobox-item-indicator.cjs.map +0 -1
  930. package/dist/combobox/combobox-item.cjs +0 -212
  931. package/dist/combobox/combobox-item.cjs.map +0 -1
  932. package/dist/combobox/combobox-label.cjs +0 -52
  933. package/dist/combobox/combobox-label.cjs.map +0 -1
  934. package/dist/combobox/combobox-portal.cjs +0 -98
  935. package/dist/combobox/combobox-portal.cjs.map +0 -1
  936. package/dist/combobox/combobox-separator.cjs +0 -41
  937. package/dist/combobox/combobox-separator.cjs.map +0 -1
  938. package/dist/combobox/combobox-trigger.cjs +0 -73
  939. package/dist/combobox/combobox-trigger.cjs.map +0 -1
  940. package/dist/combobox/combobox-viewport.cjs +0 -81
  941. package/dist/combobox/combobox-viewport.cjs.map +0 -1
  942. package/dist/combobox/combobox-virtualizer.cjs.map +0 -1
  943. package/dist/component/base-separator.cjs +0 -67
  944. package/dist/component/base-separator.cjs.map +0 -1
  945. package/dist/composables/use-window-splitter-behavior.cjs +0 -135
  946. package/dist/composables/use-window-splitter-behavior.cjs.map +0 -1
  947. package/dist/composables/use-window-splitter-panel-group-behavior.cjs +0 -487
  948. package/dist/composables/use-window-splitter-panel-group-behavior.cjs.map +0 -1
  949. package/dist/constant/components.cjs +0 -368
  950. package/dist/constant/components.cjs.map +0 -1
  951. package/dist/constant.cjs +0 -5
  952. package/dist/constant.d.cts +0 -59
  953. package/dist/constant.d.cts.map +0 -1
  954. package/dist/context-menu/context-menu-arrow.cjs +0 -104
  955. package/dist/context-menu/context-menu-arrow.cjs.map +0 -1
  956. package/dist/context-menu/context-menu-checkbox-item.cjs +0 -1210
  957. package/dist/context-menu/context-menu-checkbox-item.cjs.map +0 -1
  958. package/dist/context-menu/context-menu-content.cjs +0 -586
  959. package/dist/context-menu/context-menu-content.cjs.map +0 -1
  960. package/dist/context-menu/context-menu-group.cjs +0 -76
  961. package/dist/context-menu/context-menu-group.cjs.map +0 -1
  962. package/dist/context-menu/context-menu-item-indicator.cjs +0 -46
  963. package/dist/context-menu/context-menu-item-indicator.cjs.map +0 -1
  964. package/dist/context-menu/context-menu-item.cjs +0 -57
  965. package/dist/context-menu/context-menu-item.cjs.map +0 -1
  966. package/dist/context-menu/context-menu-label.cjs +0 -77
  967. package/dist/context-menu/context-menu-label.cjs.map +0 -1
  968. package/dist/context-menu/context-menu-portal.cjs +0 -91
  969. package/dist/context-menu/context-menu-portal.cjs.map +0 -1
  970. package/dist/context-menu/context-menu-radio-group.cjs +0 -110
  971. package/dist/context-menu/context-menu-radio-group.cjs.map +0 -1
  972. package/dist/context-menu/context-menu-radio-item.cjs +0 -122
  973. package/dist/context-menu/context-menu-radio-item.cjs.map +0 -1
  974. package/dist/context-menu/context-menu-separator.cjs +0 -79
  975. package/dist/context-menu/context-menu-separator.cjs.map +0 -1
  976. package/dist/context-menu/context-menu-sub-content.cjs +0 -286
  977. package/dist/context-menu/context-menu-sub-content.cjs.map +0 -1
  978. package/dist/context-menu/context-menu-sub-trigger.cjs +0 -243
  979. package/dist/context-menu/context-menu-sub-trigger.cjs.map +0 -1
  980. package/dist/context-menu/context-menu-sub.cjs +0 -124
  981. package/dist/context-menu/context-menu-sub.cjs.map +0 -1
  982. package/dist/context-menu/context-menu-trigger.cjs +0 -134
  983. package/dist/context-menu/context-menu-trigger.cjs.map +0 -1
  984. package/dist/date-field/date-field-input.cjs +0 -1821
  985. package/dist/date-field/date-field-input.cjs.map +0 -1
  986. package/dist/date-picker/date-picker-anchor.cjs +0 -168
  987. package/dist/date-picker/date-picker-anchor.cjs.map +0 -1
  988. package/dist/date-picker/date-picker-arrow.cjs +0 -104
  989. package/dist/date-picker/date-picker-arrow.cjs.map +0 -1
  990. package/dist/date-picker/date-picker-calendar.cjs +0 -22288
  991. package/dist/date-picker/date-picker-calendar.cjs.map +0 -1
  992. package/dist/date.cjs +0 -27
  993. package/dist/date.d.cts +0 -2
  994. package/dist/index.cjs +0 -401
  995. package/dist/index.d.cts +0 -8381
  996. package/dist/index.d.cts.map +0 -1
  997. package/dist/index2.d.cts +0 -252
  998. package/dist/index2.d.cts.map +0 -1
  999. package/dist/rolldown-runtime.cjs +0 -30
  1000. /package/dist/{constant/index.cjs → date/index.js} +0 -0
@@ -1,1821 +0,0 @@
1
- const require_rolldown_runtime = require('../rolldown-runtime.cjs');
2
- const require_accordion_accordion_content = require('../accordion/accordion-content.cjs');
3
- const require_checkbox_checkbox_group_root = require('../checkbox/checkbox-group-root.cjs');
4
- const require_calendar_calendar_cell = require('../calendar/calendar-cell.cjs');
5
- const vue = require_rolldown_runtime.__toESM(require("vue"));
6
- const __vueuse_core = require_rolldown_runtime.__toESM(require("@vueuse/core"));
7
- const __vinicunca_perkakas = require_rolldown_runtime.__toESM(require("@vinicunca/perkakas"));
8
-
9
- //#region src/shared/date/parser.ts
10
- const calendarDateTimeGranularities = [
11
- "hour",
12
- "minute",
13
- "second"
14
- ];
15
- function syncTimeSegmentValues(props) {
16
- return Object.fromEntries(TIME_SEGMENT_PARTS.map((part) => {
17
- if (part === "dayPeriod") return [part, props.formatter.dayPeriod(require_calendar_calendar_cell.toDate(props.value))];
18
- return [part, props.value[part]];
19
- }));
20
- }
21
- function syncSegmentValues(props) {
22
- const { formatter } = props;
23
- const dateValues = DATE_SEGMENT_PARTS.map((part) => {
24
- return [part, props.value[part]];
25
- });
26
- if ("hour" in props.value) {
27
- const timeValues = syncTimeSegmentValues({
28
- value: props.value,
29
- formatter
30
- });
31
- return {
32
- ...Object.fromEntries(dateValues),
33
- ...timeValues
34
- };
35
- }
36
- return Object.fromEntries(dateValues);
37
- }
38
- function initializeTimeSegmentValues(granularity) {
39
- return Object.fromEntries(TIME_SEGMENT_PARTS.map((part) => {
40
- if (part === "dayPeriod") return [part, "AM"];
41
- return [part, null];
42
- }).filter(([key]) => {
43
- if (key === "literal" || key === null) return false;
44
- if (granularity === "minute" && key === "second") return false;
45
- if (granularity === "hour" && (key === "second" || key === "minute")) return false;
46
- else return true;
47
- }));
48
- }
49
- function initializeSegmentValues(granularity) {
50
- const initialParts = EDITABLE_SEGMENT_PARTS.map((part) => {
51
- if (part === "dayPeriod") return [part, "AM"];
52
- return [part, null];
53
- }).filter(([key]) => {
54
- if (key === "literal" || key === null) return false;
55
- if (granularity === "minute" && key === "second") return false;
56
- if (granularity === "hour" && (key === "second" || key === "minute")) return false;
57
- if (granularity === "day") return !calendarDateTimeGranularities.includes(key) && key !== "dayPeriod";
58
- else return true;
59
- });
60
- return Object.fromEntries(initialParts);
61
- }
62
- function createContentObj(props) {
63
- const { segmentValues, formatter, locale } = props;
64
- function getPartContent(part) {
65
- if ("hour" in segmentValues) {
66
- const value = segmentValues[part];
67
- if (value !== null) {
68
- if (part === "day") return formatter.part({
69
- dateObj: props.dateRef.set({
70
- [part]: value,
71
- month: segmentValues.month ?? 1
72
- }),
73
- type: part,
74
- options: { hourCycle: props.hourCycle === 24 ? "h23" : void 0 }
75
- });
76
- return formatter.part({
77
- dateObj: props.dateRef.set({ [part]: value }),
78
- type: part,
79
- options: { hourCycle: props.hourCycle === 24 ? "h23" : void 0 }
80
- });
81
- } else return getPlaceholder(part, "", locale.value);
82
- } else {
83
- if (isDateSegmentPart(part)) {
84
- const value = segmentValues[part];
85
- if (value !== null) {
86
- if (part === "day" && segmentValues.month !== null) return formatter.part({
87
- dateObj: props.dateRef.set({
88
- [part]: value,
89
- month: segmentValues.month
90
- }),
91
- type: part
92
- });
93
- if (part === "day") return formatter.part({
94
- dateObj: props.dateRef.set({
95
- [part]: value,
96
- month: segmentValues.month ?? 1
97
- }),
98
- type: part
99
- });
100
- return formatter.part({
101
- dateObj: props.dateRef.set({ [part]: value }),
102
- type: part
103
- });
104
- } else return getPlaceholder(part, "", locale.value);
105
- }
106
- return "";
107
- }
108
- }
109
- const content = Object.keys(segmentValues).reduce((obj, part) => {
110
- if (!isSegmentPart(part)) return obj;
111
- if ("hour" in segmentValues && part === "dayPeriod") {
112
- const value = segmentValues[part];
113
- if (value !== null) obj[part] = value;
114
- else obj[part] = getPlaceholder(part, "AM", locale.value);
115
- } else obj[part] = getPartContent(part);
116
- return obj;
117
- }, {});
118
- return content;
119
- }
120
- function createContentArr(props) {
121
- const { granularity, formatter, contentObj, hideTimeZone, hourCycle, isTimeValue } = props;
122
- const parts = formatter.toParts({
123
- date: props.dateRef,
124
- options: require_calendar_calendar_cell.getOptsByGranularity(granularity, hourCycle, isTimeValue)
125
- });
126
- const segmentContentArr = parts.map((part) => {
127
- const defaultParts = [
128
- "literal",
129
- "timeZoneName",
130
- null
131
- ];
132
- if (defaultParts.includes(part.type) || !isSegmentPart(part.type)) return {
133
- part: part.type,
134
- value: part.value
135
- };
136
- return {
137
- part: part.type,
138
- value: contentObj[part.type]
139
- };
140
- }).filter((segment) => {
141
- if (segment.part === null || segment.value === null) return false;
142
- if (segment.part === "timeZoneName" && (!require_calendar_calendar_cell.isZonedDateTime(props.dateRef) || hideTimeZone)) return false;
143
- return true;
144
- });
145
- return segmentContentArr;
146
- }
147
- function createContent(props) {
148
- const contentObj = createContentObj(props);
149
- const contentArr = createContentArr({
150
- contentObj,
151
- ...props
152
- });
153
- return {
154
- obj: contentObj,
155
- arr: contentArr
156
- };
157
- }
158
-
159
- //#endregion
160
- //#region src/shared/date/parts.ts
161
- const DATE_SEGMENT_PARTS = [
162
- "day",
163
- "month",
164
- "year"
165
- ];
166
- const TIME_SEGMENT_PARTS = [
167
- "hour",
168
- "minute",
169
- "second",
170
- "dayPeriod"
171
- ];
172
- const NON_EDITABLE_SEGMENT_PARTS = ["literal", "timeZoneName"];
173
- const EDITABLE_SEGMENT_PARTS = [...DATE_SEGMENT_PARTS, ...TIME_SEGMENT_PARTS];
174
- const EDITABLE_TIME_SEGMENT_PARTS = [...TIME_SEGMENT_PARTS];
175
- const ALL_SEGMENT_PARTS = [...EDITABLE_SEGMENT_PARTS, ...NON_EDITABLE_SEGMENT_PARTS];
176
- const ALL_EXCEPT_LITERAL_PARTS = ALL_SEGMENT_PARTS.filter((part) => part !== "literal");
177
- function isDateSegmentPart(part) {
178
- return DATE_SEGMENT_PARTS.includes(part);
179
- }
180
- function isSegmentPart(part) {
181
- return EDITABLE_SEGMENT_PARTS.includes(part);
182
- }
183
-
184
- //#endregion
185
- //#region src/shared/date/placeholders.ts
186
- const supportedLocales = [
187
- "ach",
188
- "af",
189
- "am",
190
- "an",
191
- "ar",
192
- "ast",
193
- "az",
194
- "be",
195
- "bg",
196
- "bn",
197
- "br",
198
- "bs",
199
- "ca",
200
- "cak",
201
- "ckb",
202
- "cs",
203
- "cy",
204
- "da",
205
- "de",
206
- "dsb",
207
- "el",
208
- "en",
209
- "eo",
210
- "es",
211
- "et",
212
- "eu",
213
- "fa",
214
- "ff",
215
- "fi",
216
- "fr",
217
- "fy",
218
- "ga",
219
- "gd",
220
- "gl",
221
- "he",
222
- "hr",
223
- "hsb",
224
- "hu",
225
- "ia",
226
- "id",
227
- "it",
228
- "ja",
229
- "ka",
230
- "kk",
231
- "kn",
232
- "ko",
233
- "lb",
234
- "lo",
235
- "lt",
236
- "lv",
237
- "meh",
238
- "ml",
239
- "ms",
240
- "nl",
241
- "nn",
242
- "no",
243
- "oc",
244
- "pl",
245
- "pt",
246
- "rm",
247
- "ro",
248
- "ru",
249
- "sc",
250
- "scn",
251
- "sk",
252
- "sl",
253
- "sr",
254
- "sv",
255
- "szl",
256
- "tg",
257
- "th",
258
- "tr",
259
- "uk",
260
- "zh-CN",
261
- "zh-TW"
262
- ];
263
- const placeholderFields = [
264
- "year",
265
- "month",
266
- "day"
267
- ];
268
- const placeholders = {
269
- "ach": {
270
- year: "mwaka",
271
- month: "dwe",
272
- day: "nino"
273
- },
274
- "af": {
275
- year: "jjjj",
276
- month: "mm",
277
- day: "dd"
278
- },
279
- "am": {
280
- year: "ዓዓዓዓ",
281
- month: "ሚሜ",
282
- day: "ቀቀ"
283
- },
284
- "an": {
285
- year: "aaaa",
286
- month: "mm",
287
- day: "dd"
288
- },
289
- "ar": {
290
- year: "سنة",
291
- month: "شهر",
292
- day: "يوم"
293
- },
294
- "ast": {
295
- year: "aaaa",
296
- month: "mm",
297
- day: "dd"
298
- },
299
- "az": {
300
- year: "iiii",
301
- month: "aa",
302
- day: "gg"
303
- },
304
- "be": {
305
- year: "гггг",
306
- month: "мм",
307
- day: "дд"
308
- },
309
- "bg": {
310
- year: "гггг",
311
- month: "мм",
312
- day: "дд"
313
- },
314
- "bn": {
315
- year: "yyyy",
316
- month: "মিমি",
317
- day: "dd"
318
- },
319
- "br": {
320
- year: "bbbb",
321
- month: "mm",
322
- day: "dd"
323
- },
324
- "bs": {
325
- year: "gggg",
326
- month: "mm",
327
- day: "dd"
328
- },
329
- "ca": {
330
- year: "aaaa",
331
- month: "mm",
332
- day: "dd"
333
- },
334
- "cak": {
335
- year: "jjjj",
336
- month: "ii",
337
- day: "q'q'"
338
- },
339
- "ckb": {
340
- year: "ساڵ",
341
- month: "مانگ",
342
- day: "ڕۆژ"
343
- },
344
- "cs": {
345
- year: "rrrr",
346
- month: "mm",
347
- day: "dd"
348
- },
349
- "cy": {
350
- year: "bbbb",
351
- month: "mm",
352
- day: "dd"
353
- },
354
- "da": {
355
- year: "åååå",
356
- month: "mm",
357
- day: "dd"
358
- },
359
- "de": {
360
- year: "jjjj",
361
- month: "mm",
362
- day: "tt"
363
- },
364
- "dsb": {
365
- year: "llll",
366
- month: "mm",
367
- day: "źź"
368
- },
369
- "el": {
370
- year: "εεεε",
371
- month: "μμ",
372
- day: "ηη"
373
- },
374
- "en": {
375
- year: "yyyy",
376
- month: "mm",
377
- day: "dd"
378
- },
379
- "eo": {
380
- year: "jjjj",
381
- month: "mm",
382
- day: "tt"
383
- },
384
- "es": {
385
- year: "aaaa",
386
- month: "mm",
387
- day: "dd"
388
- },
389
- "et": {
390
- year: "aaaa",
391
- month: "kk",
392
- day: "pp"
393
- },
394
- "eu": {
395
- year: "uuuu",
396
- month: "hh",
397
- day: "ee"
398
- },
399
- "fa": {
400
- year: "سال",
401
- month: "ماه",
402
- day: "روز"
403
- },
404
- "ff": {
405
- year: "hhhh",
406
- month: "ll",
407
- day: "ññ"
408
- },
409
- "fi": {
410
- year: "vvvv",
411
- month: "kk",
412
- day: "pp"
413
- },
414
- "fr": {
415
- year: "aaaa",
416
- month: "mm",
417
- day: "jj"
418
- },
419
- "fy": {
420
- year: "jjjj",
421
- month: "mm",
422
- day: "dd"
423
- },
424
- "ga": {
425
- year: "bbbb",
426
- month: "mm",
427
- day: "ll"
428
- },
429
- "gd": {
430
- year: "bbbb",
431
- month: "mm",
432
- day: "ll"
433
- },
434
- "gl": {
435
- year: "aaaa",
436
- month: "mm",
437
- day: "dd"
438
- },
439
- "he": {
440
- year: "שנה",
441
- month: "חודש",
442
- day: "יום"
443
- },
444
- "hr": {
445
- year: "gggg",
446
- month: "mm",
447
- day: "dd"
448
- },
449
- "hsb": {
450
- year: "llll",
451
- month: "mm",
452
- day: "dd"
453
- },
454
- "hu": {
455
- year: "éééé",
456
- month: "hh",
457
- day: "nn"
458
- },
459
- "ia": {
460
- year: "aaaa",
461
- month: "mm",
462
- day: "dd"
463
- },
464
- "id": {
465
- year: "tttt",
466
- month: "bb",
467
- day: "hh"
468
- },
469
- "it": {
470
- year: "aaaa",
471
- month: "mm",
472
- day: "gg"
473
- },
474
- "ja": {
475
- year: " 年 ",
476
- month: "月",
477
- day: "日"
478
- },
479
- "ka": {
480
- year: "წწწწ",
481
- month: "თთ",
482
- day: "რრ"
483
- },
484
- "kk": {
485
- year: "жжжж",
486
- month: "аа",
487
- day: "кк"
488
- },
489
- "kn": {
490
- year: "ವವವವ",
491
- month: "ಮಿಮೀ",
492
- day: "ದಿದಿ"
493
- },
494
- "ko": {
495
- year: "연도",
496
- month: "월",
497
- day: "일"
498
- },
499
- "lb": {
500
- year: "jjjj",
501
- month: "mm",
502
- day: "dd"
503
- },
504
- "lo": {
505
- year: "ປປປປ",
506
- month: "ດດ",
507
- day: "ວວ"
508
- },
509
- "lt": {
510
- year: "mmmm",
511
- month: "mm",
512
- day: "dd"
513
- },
514
- "lv": {
515
- year: "gggg",
516
- month: "mm",
517
- day: "dd"
518
- },
519
- "meh": {
520
- year: "aaaa",
521
- month: "mm",
522
- day: "dd"
523
- },
524
- "ml": {
525
- year: "വർഷം",
526
- month: "മാസം",
527
- day: "തീയതി"
528
- },
529
- "ms": {
530
- year: "tttt",
531
- month: "mm",
532
- day: "hh"
533
- },
534
- "nl": {
535
- year: "jjjj",
536
- month: "mm",
537
- day: "dd"
538
- },
539
- "nn": {
540
- year: "åååå",
541
- month: "mm",
542
- day: "dd"
543
- },
544
- "no": {
545
- year: "åååå",
546
- month: "mm",
547
- day: "dd"
548
- },
549
- "oc": {
550
- year: "aaaa",
551
- month: "mm",
552
- day: "jj"
553
- },
554
- "pl": {
555
- year: "rrrr",
556
- month: "mm",
557
- day: "dd"
558
- },
559
- "pt": {
560
- year: "aaaa",
561
- month: "mm",
562
- day: "dd"
563
- },
564
- "rm": {
565
- year: "oooo",
566
- month: "mm",
567
- day: "dd"
568
- },
569
- "ro": {
570
- year: "aaaa",
571
- month: "ll",
572
- day: "zz"
573
- },
574
- "ru": {
575
- year: "гггг",
576
- month: "мм",
577
- day: "дд"
578
- },
579
- "sc": {
580
- year: "aaaa",
581
- month: "mm",
582
- day: "dd"
583
- },
584
- "scn": {
585
- year: "aaaa",
586
- month: "mm",
587
- day: "jj"
588
- },
589
- "sk": {
590
- year: "rrrr",
591
- month: "mm",
592
- day: "dd"
593
- },
594
- "sl": {
595
- year: "llll",
596
- month: "mm",
597
- day: "dd"
598
- },
599
- "sr": {
600
- year: "гггг",
601
- month: "мм",
602
- day: "дд"
603
- },
604
- "sv": {
605
- year: "åååå",
606
- month: "mm",
607
- day: "dd"
608
- },
609
- "szl": {
610
- year: "rrrr",
611
- month: "mm",
612
- day: "dd"
613
- },
614
- "tg": {
615
- year: "сссс",
616
- month: "мм",
617
- day: "рр"
618
- },
619
- "th": {
620
- year: "ปปปป",
621
- month: "ดด",
622
- day: "วว"
623
- },
624
- "tr": {
625
- year: "yyyy",
626
- month: "aa",
627
- day: "gg"
628
- },
629
- "uk": {
630
- year: "рррр",
631
- month: "мм",
632
- day: "дд"
633
- },
634
- "zh-CN": {
635
- year: "年",
636
- month: "月",
637
- day: "日"
638
- },
639
- "zh-TW": {
640
- year: "年",
641
- month: "月",
642
- day: "日"
643
- }
644
- };
645
- function getPlaceholderObj(locale) {
646
- if (!isSupportedLocale(locale)) {
647
- const localeLanguage = getLocaleLanguage(locale);
648
- if (!isSupportedLocale(localeLanguage)) return placeholders.en;
649
- else return placeholders[localeLanguage];
650
- } else return placeholders[locale];
651
- }
652
- function getPlaceholder(field, value, locale) {
653
- if (isPlaceholderField(field)) return getPlaceholderObj(locale)[field];
654
- if (isDefaultField(field)) return value;
655
- if (isTimeField(field)) return "––";
656
- return "";
657
- }
658
- function isSupportedLocale(locale) {
659
- return supportedLocales.includes(locale);
660
- }
661
- function isPlaceholderField(field) {
662
- return placeholderFields.includes(field);
663
- }
664
- function isTimeField(field) {
665
- return field === "hour" || field === "minute" || field === "second";
666
- }
667
- function isDefaultField(field) {
668
- return field === "era" || field === "dayPeriod";
669
- }
670
- function getLocaleLanguage(locale) {
671
- if (Intl.Locale) return new Intl.Locale(locale).language;
672
- return locale.split("-")[0];
673
- }
674
-
675
- //#endregion
676
- //#region src/shared/date/segment.ts
677
- function isSegmentNavigationKey(key) {
678
- return key === __vinicunca_perkakas.KEY_CODES.ARROW_RIGHT || key === __vinicunca_perkakas.KEY_CODES.ARROW_LEFT;
679
- }
680
- function isNumberString(value) {
681
- if (Number.isNaN(Number.parseInt(value))) return false;
682
- return true;
683
- }
684
- function isAcceptableSegmentKey(key) {
685
- const acceptableSegmentKeys = [
686
- __vinicunca_perkakas.KEY_CODES.ENTER,
687
- __vinicunca_perkakas.KEY_CODES.ARROW_UP,
688
- __vinicunca_perkakas.KEY_CODES.ARROW_DOWN,
689
- __vinicunca_perkakas.KEY_CODES.ARROW_LEFT,
690
- __vinicunca_perkakas.KEY_CODES.ARROW_RIGHT,
691
- __vinicunca_perkakas.KEY_CODES.BACKSPACE,
692
- __vinicunca_perkakas.KEY_CODES.SPACE,
693
- "a",
694
- "A",
695
- "p",
696
- "P"
697
- ];
698
- if (acceptableSegmentKeys.includes(key)) return true;
699
- return isNumberString(key);
700
- }
701
- function getSegmentElements(parentElement) {
702
- return Array.from(parentElement.querySelectorAll("[data-akar-date-field-segment]")).filter((item) => item.getAttribute("data-akar-date-field-segment") !== "literal");
703
- }
704
- function getTimeFieldSegmentElements(parentElement) {
705
- return Array.from(parentElement.querySelectorAll("[data-akar-time-field-segment]")).filter((item) => item.getAttribute("data-akar-time-field-segment") !== "literal");
706
- }
707
-
708
- //#endregion
709
- //#region src/shared/date/use-date-field.ts
710
- function commonSegmentAttrs(props) {
711
- return {
712
- role: "spinbutton",
713
- contenteditable: true,
714
- tabindex: props.disabled ? void 0 : 0,
715
- spellcheck: false,
716
- inputmode: "numeric",
717
- autocorrect: "off",
718
- enterkeyhint: "next",
719
- style: "caret-color: transparent;"
720
- };
721
- }
722
- function daySegmentAttrs(props) {
723
- const { segmentValues, placeholder } = props;
724
- const isEmpty = segmentValues.day === null;
725
- const date = segmentValues.day ? placeholder.set({ day: segmentValues.day }) : placeholder;
726
- const valueNow = date.day;
727
- const valueMin = 1;
728
- const valueMax = require_calendar_calendar_cell.getDaysInMonth(date);
729
- const valueText = isEmpty ? "Empty" : `${valueNow}`;
730
- return {
731
- ...commonSegmentAttrs(props),
732
- "aria-label": "day,",
733
- "aria-valuemin": valueMin,
734
- "aria-valuemax": valueMax,
735
- "aria-valuenow": valueNow,
736
- "aria-valuetext": valueText,
737
- "data-placeholder": isEmpty ? "" : void 0
738
- };
739
- }
740
- function monthSegmentAttrs(props) {
741
- const { segmentValues, placeholder, formatter } = props;
742
- const isEmpty = segmentValues.month === null;
743
- const date = segmentValues.month ? placeholder.set({ month: segmentValues.month }) : placeholder;
744
- const valueNow = date.month;
745
- const valueMin = 1;
746
- const valueMax = 12;
747
- const valueText = isEmpty ? "Empty" : `${valueNow} - ${formatter.fullMonth({ date: require_calendar_calendar_cell.toDate(date) })}`;
748
- return {
749
- ...commonSegmentAttrs(props),
750
- "aria-label": "month, ",
751
- "contenteditable": true,
752
- "aria-valuemin": valueMin,
753
- "aria-valuemax": valueMax,
754
- "aria-valuenow": valueNow,
755
- "aria-valuetext": valueText,
756
- "data-placeholder": isEmpty ? "" : void 0
757
- };
758
- }
759
- function yearSegmentAttrs(props) {
760
- const { segmentValues, placeholder } = props;
761
- const isEmpty = segmentValues.year === null;
762
- const date = segmentValues.year ? placeholder.set({ year: segmentValues.year }) : placeholder;
763
- const valueMin = 1;
764
- const valueMax = 9999;
765
- const valueNow = date.year;
766
- const valueText = isEmpty ? "Empty" : `${valueNow}`;
767
- return {
768
- ...commonSegmentAttrs(props),
769
- "aria-label": "year, ",
770
- "aria-valuemin": valueMin,
771
- "aria-valuemax": valueMax,
772
- "aria-valuenow": valueNow,
773
- "aria-valuetext": valueText,
774
- "data-placeholder": isEmpty ? "" : void 0
775
- };
776
- }
777
- function hourSegmentAttrs(props) {
778
- const { segmentValues, hourCycle, placeholder } = props;
779
- if (!("hour" in segmentValues) || !("hour" in placeholder)) return {};
780
- const isEmpty = segmentValues.hour === null;
781
- const date = segmentValues.hour ? placeholder.set({ hour: segmentValues.hour }) : placeholder;
782
- const valueMin = hourCycle === 12 ? 1 : 0;
783
- const valueMax = hourCycle === 12 ? 12 : 23;
784
- const valueNow = date.hour;
785
- const valueText = isEmpty ? "Empty" : `${valueNow} ${segmentValues.dayPeriod ?? ""}`;
786
- return {
787
- ...commonSegmentAttrs(props),
788
- "aria-label": "hour, ",
789
- "aria-valuemin": valueMin,
790
- "aria-valuemax": valueMax,
791
- "aria-valuenow": valueNow,
792
- "aria-valuetext": valueText,
793
- "data-placeholder": isEmpty ? "" : void 0
794
- };
795
- }
796
- function minuteSegmentAttrs(props) {
797
- const { segmentValues, placeholder } = props;
798
- if (!("minute" in segmentValues) || !("minute" in placeholder)) return {};
799
- const isEmpty = segmentValues.minute === null;
800
- const date = segmentValues.minute ? placeholder.set({ minute: segmentValues.minute }) : placeholder;
801
- const valueNow = date.minute;
802
- const valueMin = 0;
803
- const valueMax = 59;
804
- const valueText = isEmpty ? "Empty" : `${valueNow}`;
805
- return {
806
- ...commonSegmentAttrs(props),
807
- "aria-label": "minute, ",
808
- "aria-valuemin": valueMin,
809
- "aria-valuemax": valueMax,
810
- "aria-valuenow": valueNow,
811
- "aria-valuetext": valueText,
812
- "data-placeholder": isEmpty ? "" : void 0
813
- };
814
- }
815
- function secondSegmentAttrs(props) {
816
- const { segmentValues, placeholder } = props;
817
- if (!("second" in segmentValues) || !("second" in placeholder)) return {};
818
- const isEmpty = segmentValues.second === null;
819
- const date = segmentValues.second ? placeholder.set({ second: segmentValues.second }) : placeholder;
820
- const valueNow = date.second;
821
- const valueMin = 0;
822
- const valueMax = 59;
823
- const valueText = isEmpty ? "Empty" : `${valueNow}`;
824
- return {
825
- ...commonSegmentAttrs(props),
826
- "aria-label": "second, ",
827
- "aria-valuemin": valueMin,
828
- "aria-valuemax": valueMax,
829
- "aria-valuenow": valueNow,
830
- "aria-valuetext": valueText,
831
- "data-placeholder": isEmpty ? "" : void 0
832
- };
833
- }
834
- function dayPeriodSegmentAttrs(props) {
835
- const { segmentValues } = props;
836
- if (!("dayPeriod" in segmentValues)) return {};
837
- const valueMin = 0;
838
- const valueMax = 12;
839
- let valueNow;
840
- if (segmentValues.hour) valueNow = segmentValues.hour > 12 ? segmentValues.hour - 12 : segmentValues.hour;
841
- else valueNow = 0;
842
- const valueText = segmentValues.dayPeriod ?? "AM";
843
- return {
844
- ...commonSegmentAttrs(props),
845
- "inputmode": "text",
846
- "aria-label": "AM/PM",
847
- "aria-valuemin": valueMin,
848
- "aria-valuemax": valueMax,
849
- "aria-valuenow": valueNow,
850
- "aria-valuetext": valueText
851
- };
852
- }
853
- function literalSegmentAttrs(_props) {
854
- return {
855
- "aria-hidden": true,
856
- "data-segment": "literal"
857
- };
858
- }
859
- function timeZoneSegmentAttrs(props) {
860
- return {
861
- "role": "textbox",
862
- "aria-label": "timezone, ",
863
- "data-readonly": true,
864
- "data-segment": "timeZoneName",
865
- "tabindex": props.disabled ? void 0 : 0,
866
- "style": "caret-color: transparent;"
867
- };
868
- }
869
- function eraSegmentAttrs(props) {
870
- const { segmentValues, placeholder } = props;
871
- const valueMin = 0;
872
- const valueMax = 0;
873
- const valueNow = 0;
874
- const valueText = "era" in segmentValues ? segmentValues.era : placeholder.era;
875
- return {
876
- ...commonSegmentAttrs(props),
877
- "aria-label": "era",
878
- "aria-valuemin": valueMin,
879
- "aria-valuemax": valueMax,
880
- "aria-valuenow": valueNow,
881
- "aria-valuetext": valueText
882
- };
883
- }
884
- const segmentBuilders = {
885
- day: { attrs: daySegmentAttrs },
886
- month: { attrs: monthSegmentAttrs },
887
- year: { attrs: yearSegmentAttrs },
888
- hour: { attrs: hourSegmentAttrs },
889
- minute: { attrs: minuteSegmentAttrs },
890
- second: { attrs: secondSegmentAttrs },
891
- dayPeriod: { attrs: dayPeriodSegmentAttrs },
892
- literal: { attrs: literalSegmentAttrs },
893
- timeZoneName: { attrs: timeZoneSegmentAttrs },
894
- era: { attrs: eraSegmentAttrs }
895
- };
896
- function useDateField(props) {
897
- function minuteSecondIncrementation({ event, part, dateRef, prevValue }) {
898
- const step = props.step.value[part] ?? 1;
899
- const sign = event.key === __vinicunca_perkakas.KEY_CODES.ARROW_UP ? step : -step;
900
- const min = 0;
901
- const max = 59;
902
- if (prevValue === null) return sign > 0 ? min : max;
903
- const cycleArgs = [part, sign];
904
- return dateRef.set({ [part]: prevValue }).cycle(...cycleArgs)[part];
905
- }
906
- function deleteValue(prevValue) {
907
- props.hasLeftFocus.value = false;
908
- if (prevValue === null) return prevValue;
909
- const str = prevValue.toString();
910
- if (str.length === 1) {
911
- props.modelValue.value = void 0;
912
- return null;
913
- }
914
- return Number.parseInt(str.slice(0, -1));
915
- }
916
- function dateTimeValueIncrementation({ event, part, dateRef, prevValue, hourCycle }) {
917
- const step = props.step.value[part] ?? 1;
918
- const sign = event.key === __vinicunca_perkakas.KEY_CODES.ARROW_UP ? step : -step;
919
- if (prevValue === null) return dateRef[part];
920
- if (part === "hour" && "hour" in dateRef) {
921
- const cycleArgs$1 = [
922
- part,
923
- sign,
924
- { hourCycle }
925
- ];
926
- return dateRef.set({ [part]: prevValue }).cycle(...cycleArgs$1)[part];
927
- }
928
- const cycleArgs = [part, sign];
929
- if (part === "day") return dateRef.set({
930
- [part]: prevValue,
931
- month: props.segmentValues.value.month ?? 1
932
- }).cycle(...cycleArgs)[part];
933
- return dateRef.set({ [part]: prevValue }).cycle(...cycleArgs)[part];
934
- }
935
- function updateDayOrMonth(max, num, prev) {
936
- let moveToNext = false;
937
- const maxStart = Math.floor(max / 10);
938
- /**
939
- * If the user has left the segment, we want to reset the
940
- * `prev` value so that we can start the segment over again
941
- * when the user types a number.
942
- */
943
- if (props.hasLeftFocus.value) {
944
- props.hasLeftFocus.value = false;
945
- prev = null;
946
- }
947
- if (prev === null) {
948
- /**
949
- * If the user types a 0 as the first number, we want
950
- * to keep track of that so that when they type the next
951
- * number, we can move to the next segment.
952
- */
953
- if (num === 0) {
954
- props.lastKeyZero.value = true;
955
- return {
956
- value: null,
957
- moveToNext
958
- };
959
- }
960
- /**
961
- * If the last key was a 0, or if the first number is
962
- * greater than the max start digit (0-3 in most cases), then
963
- * we want to move to the next segment, since it's not possible
964
- * to continue typing a valid number in this segment.
965
- */
966
- if (props.lastKeyZero.value || num > maxStart) moveToNext = true;
967
- props.lastKeyZero.value = false;
968
- /**
969
- * If none of the above conditions are met, then we can just
970
- * return the number as the segment value and continue typing
971
- * in this segment.
972
- */
973
- return {
974
- value: num,
975
- moveToNext
976
- };
977
- }
978
- /**
979
- * If the number of digits is 2, or if the total with the existing digit
980
- * and the pressed digit is greater than the maximum value for this
981
- * month, then we will reset the segment as if the user had pressed the
982
- * backspace key and then typed the number.
983
- */
984
- const digits = prev.toString().length;
985
- const total = Number.parseInt(prev.toString() + num.toString());
986
- /**
987
- * If the number of digits is 2, or if the total with the existing digit
988
- * and the pressed digit is greater than the maximum value for this
989
- * month, then we will reset the segment as if the user had pressed the
990
- * backspace key and then typed the number.
991
- */
992
- if (digits === 2 || total > max) {
993
- /**
994
- * As we're doing elsewhere, we're checking if the number is greater
995
- * than the max start digit (0-3 in most months), and if so, we're
996
- * going to move to the next segment.
997
- */
998
- if (num > maxStart || total > max) moveToNext = true;
999
- return {
1000
- value: num,
1001
- moveToNext
1002
- };
1003
- }
1004
- moveToNext = true;
1005
- return {
1006
- value: total,
1007
- moveToNext
1008
- };
1009
- }
1010
- function updateMinuteOrSecond(num, prev) {
1011
- const max = 59;
1012
- let moveToNext = false;
1013
- const maxStart = Math.floor(max / 10);
1014
- /**
1015
- * If the user has left the segment, we want to reset the
1016
- * `prev` value so that we can start the segment over again
1017
- * when the user types a number.
1018
- */
1019
- if (props.hasLeftFocus.value) {
1020
- props.hasLeftFocus.value = false;
1021
- prev = null;
1022
- }
1023
- if (prev === null) {
1024
- /**
1025
- * If the user types a 0 as the first number, we want
1026
- * to keep track of that so that when they type the next
1027
- * number, we can move to the next segment.
1028
- */
1029
- if (num === 0) {
1030
- props.lastKeyZero.value = true;
1031
- return {
1032
- value: 0,
1033
- moveToNext
1034
- };
1035
- }
1036
- /**
1037
- * If the last key was a 0, or if the first number is
1038
- * greater than the max start digit (0-3 in most cases), then
1039
- * we want to move to the next segment, since it's not possible
1040
- * to continue typing a valid number in this segment.
1041
- */
1042
- if (props.lastKeyZero.value || num > maxStart) moveToNext = true;
1043
- props.lastKeyZero.value = false;
1044
- /**
1045
- * If none of the above conditions are met, then we can just
1046
- * return the number as the segment value and continue typing
1047
- * in this segment.
1048
- */
1049
- return {
1050
- value: num,
1051
- moveToNext
1052
- };
1053
- }
1054
- /**
1055
- * If the number of digits is 2, or if the total with the existing digit
1056
- * and the pressed digit is greater than the maximum value for this
1057
- * month, then we will reset the segment as if the user had pressed the
1058
- * backspace key and then typed the number.
1059
- */
1060
- const digits = prev.toString().length;
1061
- const total = Number.parseInt(prev.toString() + num.toString());
1062
- /**
1063
- * If the number of digits is 2, or if the total with the existing digit
1064
- * and the pressed digit is greater than the maximum value for this
1065
- * month, then we will reset the segment as if the user had pressed the
1066
- * backspace key and then typed the number.
1067
- */
1068
- if (digits === 2 || total > max) {
1069
- /**
1070
- * As we're doing elsewhere, we're checking if the number is greater
1071
- * than the max start digit (0-3 in most months), and if so, we're
1072
- * going to move to the next segment.
1073
- */
1074
- if (num > maxStart) moveToNext = true;
1075
- return {
1076
- value: num,
1077
- moveToNext
1078
- };
1079
- }
1080
- moveToNext = true;
1081
- return {
1082
- value: total,
1083
- moveToNext
1084
- };
1085
- }
1086
- function updateHour(num, prev) {
1087
- const max = 24;
1088
- let moveToNext = false;
1089
- const maxStart = Math.floor(max / 10);
1090
- /**
1091
- * If the user has left the segment, we want to reset the
1092
- * `prev` value so that we can start the segment over again
1093
- * when the user types a number.
1094
- */
1095
- if (props.hasLeftFocus.value) {
1096
- props.hasLeftFocus.value = false;
1097
- prev = null;
1098
- }
1099
- if (prev === null) {
1100
- /**
1101
- * If the user types a 0 as the first number, we want
1102
- * to keep track of that so that when they type the next
1103
- * number, we can move to the next segment.
1104
- */
1105
- if (num === 0) {
1106
- props.lastKeyZero.value = true;
1107
- return {
1108
- value: 0,
1109
- moveToNext
1110
- };
1111
- }
1112
- /**
1113
- * If the last key was a 0, or if the first number is
1114
- * greater than the max start digit (0-3 in most cases), then
1115
- * we want to move to the next segment, since it's not possible
1116
- * to continue typing a valid number in this segment.
1117
- */
1118
- if (props.lastKeyZero.value || num > maxStart) moveToNext = true;
1119
- props.lastKeyZero.value = false;
1120
- /**
1121
- * If none of the above conditions are met, then we can just
1122
- * return the number as the segment value and continue typing
1123
- * in this segment.
1124
- */
1125
- return {
1126
- value: num,
1127
- moveToNext
1128
- };
1129
- }
1130
- /**
1131
- * If the number of digits is 2, or if the total with the existing digit
1132
- * and the pressed digit is greater than the maximum value for this
1133
- * month, then we will reset the segment as if the user had pressed the
1134
- * backspace key and then typed the number.
1135
- */
1136
- const digits = prev.toString().length;
1137
- const total = Number.parseInt(prev.toString() + num.toString());
1138
- /**
1139
- * If the number of digits is 2, or if the total with the existing digit
1140
- * and the pressed digit is greater than the maximum value for this
1141
- * month, then we will reset the segment as if the user had pressed the
1142
- * backspace key and then typed the number.
1143
- */
1144
- if (digits === 2 || total > max) {
1145
- /**
1146
- * As we're doing elsewhere, we're checking if the number is greater
1147
- * than the max start digit (0-3 in most months), and if so, we're
1148
- * going to move to the next segment.
1149
- */
1150
- if (num > maxStart) moveToNext = true;
1151
- return {
1152
- value: num,
1153
- moveToNext
1154
- };
1155
- }
1156
- moveToNext = true;
1157
- return {
1158
- value: total,
1159
- moveToNext
1160
- };
1161
- }
1162
- function updateYear(num, prev) {
1163
- let moveToNext = false;
1164
- /**
1165
- * If the user has left the segment, we want to reset the
1166
- * `prev` value so that we can start the segment over again
1167
- * when the user types a number.
1168
- */
1169
- if (props.hasLeftFocus.value) {
1170
- props.hasLeftFocus.value = false;
1171
- prev = null;
1172
- }
1173
- if (prev === null) return {
1174
- value: num === 0 ? 1 : num,
1175
- moveToNext
1176
- };
1177
- const str = prev.toString() + num.toString();
1178
- if (str.length > 4) return {
1179
- value: num === 0 ? 1 : num,
1180
- moveToNext
1181
- };
1182
- if (str.length === 4) moveToNext = true;
1183
- const int = Number.parseInt(str);
1184
- return {
1185
- value: int,
1186
- moveToNext
1187
- };
1188
- }
1189
- const attributes = (0, vue.computed)(() => segmentBuilders[props.part]?.attrs({
1190
- disabled: props.disabled.value,
1191
- placeholder: props.placeholder.value,
1192
- hourCycle: props.hourCycle,
1193
- segmentValues: props.segmentValues.value,
1194
- formatter: props.formatter
1195
- }) ?? {});
1196
- function handleDaySegmentKeydown(event) {
1197
- if (!isAcceptableSegmentKey(event.key) || isSegmentNavigationKey(event.key)) return;
1198
- const prevValue = props.segmentValues.value.day;
1199
- if (event.key === __vinicunca_perkakas.KEY_CODES.ARROW_DOWN || event.key === __vinicunca_perkakas.KEY_CODES.ARROW_UP) {
1200
- props.segmentValues.value.day = dateTimeValueIncrementation({
1201
- event,
1202
- part: "day",
1203
- dateRef: props.placeholder.value,
1204
- prevValue
1205
- });
1206
- return;
1207
- }
1208
- if (isNumberString(event.key)) {
1209
- const num = Number.parseInt(event.key);
1210
- const segmentMonthValue = props.segmentValues.value.month;
1211
- const daysInMonth = segmentMonthValue ? require_calendar_calendar_cell.getDaysInMonth(props.placeholder.value.set({ month: segmentMonthValue })) : 31;
1212
- const { value, moveToNext } = updateDayOrMonth(daysInMonth, num, prevValue);
1213
- props.segmentValues.value.day = value;
1214
- if (moveToNext) props.focusNext();
1215
- }
1216
- if (event.key === __vinicunca_perkakas.KEY_CODES.BACKSPACE) {
1217
- props.hasLeftFocus.value = false;
1218
- props.segmentValues.value.day = deleteValue(prevValue);
1219
- }
1220
- }
1221
- function handleMonthSegmentKeydown(event) {
1222
- if (!isAcceptableSegmentKey(event.key) || isSegmentNavigationKey(event.key)) return;
1223
- const prevValue = props.segmentValues.value.month;
1224
- if (event.key === __vinicunca_perkakas.KEY_CODES.ARROW_DOWN || event.key === __vinicunca_perkakas.KEY_CODES.ARROW_UP) {
1225
- props.segmentValues.value.month = dateTimeValueIncrementation({
1226
- event,
1227
- part: "month",
1228
- dateRef: props.placeholder.value,
1229
- prevValue
1230
- });
1231
- return;
1232
- }
1233
- if (isNumberString(event.key)) {
1234
- const num = Number.parseInt(event.key);
1235
- const { value, moveToNext } = updateDayOrMonth(12, num, prevValue);
1236
- props.segmentValues.value.month = value;
1237
- if (moveToNext) props.focusNext();
1238
- }
1239
- if (event.key === __vinicunca_perkakas.KEY_CODES.BACKSPACE) {
1240
- props.hasLeftFocus.value = false;
1241
- props.segmentValues.value.month = deleteValue(prevValue);
1242
- }
1243
- }
1244
- function handleYearSegmentKeydown(event) {
1245
- if (!isAcceptableSegmentKey(event.key) || isSegmentNavigationKey(event.key)) return;
1246
- const prevValue = props.segmentValues.value.year;
1247
- if (event.key === __vinicunca_perkakas.KEY_CODES.ARROW_DOWN || event.key === __vinicunca_perkakas.KEY_CODES.ARROW_UP) {
1248
- props.segmentValues.value.year = dateTimeValueIncrementation({
1249
- event,
1250
- part: "year",
1251
- dateRef: props.placeholder.value,
1252
- prevValue
1253
- });
1254
- return;
1255
- }
1256
- if (isNumberString(event.key)) {
1257
- const num = Number.parseInt(event.key);
1258
- const { value, moveToNext } = updateYear(num, prevValue);
1259
- props.segmentValues.value.year = value;
1260
- if (moveToNext) props.focusNext();
1261
- }
1262
- if (event.key === __vinicunca_perkakas.KEY_CODES.BACKSPACE) {
1263
- props.hasLeftFocus.value = false;
1264
- props.segmentValues.value.year = deleteValue(prevValue);
1265
- }
1266
- }
1267
- function handleHourSegmentKeydown(event) {
1268
- const dateRef = props.placeholder.value;
1269
- if (!isAcceptableSegmentKey(event.key) || isSegmentNavigationKey(event.key) || !("hour" in dateRef) || !("hour" in props.segmentValues.value)) return;
1270
- const prevValue = props.segmentValues.value.hour;
1271
- const hourCycle = props.hourCycle;
1272
- if (event.key === __vinicunca_perkakas.KEY_CODES.ARROW_UP || event.key === __vinicunca_perkakas.KEY_CODES.ARROW_DOWN) {
1273
- props.segmentValues.value.hour = dateTimeValueIncrementation({
1274
- event,
1275
- part: "hour",
1276
- dateRef: props.placeholder.value,
1277
- prevValue,
1278
- hourCycle
1279
- });
1280
- if ("dayPeriod" in props.segmentValues.value) {
1281
- if (props.segmentValues.value.hour < 12) props.segmentValues.value.dayPeriod = "AM";
1282
- else if (props.segmentValues.value.hour) props.segmentValues.value.dayPeriod = "PM";
1283
- }
1284
- return;
1285
- }
1286
- if (isNumberString(event.key)) {
1287
- const num = Number.parseInt(event.key);
1288
- const { value, moveToNext } = updateHour(num, prevValue);
1289
- if ("dayPeriod" in props.segmentValues.value && value && value > 12) props.segmentValues.value.dayPeriod = "PM";
1290
- else if ("dayPeriod" in props.segmentValues.value && value) props.segmentValues.value.dayPeriod = "AM";
1291
- props.segmentValues.value.hour = value;
1292
- if (moveToNext) props.focusNext();
1293
- }
1294
- if (event.key === __vinicunca_perkakas.KEY_CODES.BACKSPACE) {
1295
- props.hasLeftFocus.value = false;
1296
- props.segmentValues.value.hour = deleteValue(prevValue);
1297
- }
1298
- }
1299
- function handleMinuteSegmentKeydown(event) {
1300
- const dateRef = props.placeholder.value;
1301
- if (!isAcceptableSegmentKey(event.key) || isSegmentNavigationKey(event.key) || !("minute" in dateRef) || !("minute" in props.segmentValues.value)) return;
1302
- const prevValue = props.segmentValues.value.minute;
1303
- if (event.key === __vinicunca_perkakas.KEY_CODES.ARROW_UP || event.key === __vinicunca_perkakas.KEY_CODES.ARROW_DOWN) props.segmentValues.value.minute = minuteSecondIncrementation({
1304
- event,
1305
- part: "minute",
1306
- dateRef: props.placeholder.value,
1307
- prevValue
1308
- });
1309
- if (isNumberString(event.key)) {
1310
- const num = Number.parseInt(event.key);
1311
- const { value, moveToNext } = updateMinuteOrSecond(num, prevValue);
1312
- props.segmentValues.value.minute = value;
1313
- if (moveToNext) props.focusNext();
1314
- }
1315
- if (event.key === __vinicunca_perkakas.KEY_CODES.BACKSPACE) {
1316
- props.hasLeftFocus.value = false;
1317
- props.segmentValues.value.minute = deleteValue(prevValue);
1318
- }
1319
- }
1320
- function handleSecondSegmentKeydown(event) {
1321
- const dateRef = props.placeholder.value;
1322
- if (!isAcceptableSegmentKey(event.key) || isSegmentNavigationKey(event.key) || !("second" in dateRef) || !("second" in props.segmentValues.value)) return;
1323
- const prevValue = props.segmentValues.value.second;
1324
- if (event.key === __vinicunca_perkakas.KEY_CODES.ARROW_UP || event.key === __vinicunca_perkakas.KEY_CODES.ARROW_DOWN) props.segmentValues.value.second = minuteSecondIncrementation({
1325
- event,
1326
- part: "second",
1327
- dateRef: props.placeholder.value,
1328
- prevValue
1329
- });
1330
- if (isNumberString(event.key)) {
1331
- const num = Number.parseInt(event.key);
1332
- const { value, moveToNext } = updateMinuteOrSecond(num, prevValue);
1333
- props.segmentValues.value.second = value;
1334
- if (moveToNext) props.focusNext();
1335
- }
1336
- if (event.key === __vinicunca_perkakas.KEY_CODES.BACKSPACE) {
1337
- props.hasLeftFocus.value = false;
1338
- props.segmentValues.value.second = deleteValue(prevValue);
1339
- }
1340
- }
1341
- function handleDayPeriodSegmentKeydown(event) {
1342
- if ((!isAcceptableSegmentKey(event.key) || isSegmentNavigationKey(event.key)) && event.key !== "a" && event.key !== "p" || !("hour" in props.placeholder.value) || !("dayPeriod" in props.segmentValues.value)) return;
1343
- if (event.key === __vinicunca_perkakas.KEY_CODES.ARROW_UP || event.key === __vinicunca_perkakas.KEY_CODES.ARROW_DOWN) {
1344
- if (props.segmentValues.value.dayPeriod === "AM") {
1345
- props.segmentValues.value.dayPeriod = "PM";
1346
- props.segmentValues.value.hour = props.segmentValues.value.hour + 12;
1347
- return;
1348
- }
1349
- props.segmentValues.value.dayPeriod = "AM";
1350
- props.segmentValues.value.hour = props.segmentValues.value.hour - 12;
1351
- return;
1352
- }
1353
- if (["a", "A"].includes(event.key) && props.segmentValues.value.dayPeriod !== "AM") {
1354
- props.segmentValues.value.dayPeriod = "AM";
1355
- props.segmentValues.value.hour = props.segmentValues.value.hour - 12;
1356
- return;
1357
- }
1358
- if (["p", "P"].includes(event.key) && props.segmentValues.value.dayPeriod !== "PM") {
1359
- props.segmentValues.value.dayPeriod = "PM";
1360
- props.segmentValues.value.hour = props.segmentValues.value.hour + 12;
1361
- }
1362
- }
1363
- function handleSegmentClick(event) {
1364
- const disabled = props.disabled.value;
1365
- if (disabled) event.preventDefault();
1366
- }
1367
- function handleSegmentKeydown(event) {
1368
- const disabled = props.disabled.value;
1369
- const readonly = props.readonly.value;
1370
- if (event.key !== __vinicunca_perkakas.KEY_CODES.TAB) event.preventDefault();
1371
- if (disabled || readonly) return;
1372
- const segmentKeydownHandlers = {
1373
- day: handleDaySegmentKeydown,
1374
- month: handleMonthSegmentKeydown,
1375
- year: handleYearSegmentKeydown,
1376
- hour: handleHourSegmentKeydown,
1377
- minute: handleMinuteSegmentKeydown,
1378
- second: handleSecondSegmentKeydown,
1379
- dayPeriod: handleDayPeriodSegmentKeydown,
1380
- timeZoneName: () => {}
1381
- };
1382
- segmentKeydownHandlers[props.part](event);
1383
- if (!(0, __vinicunca_perkakas.isIncludedIn)(event.key, [__vinicunca_perkakas.KEY_CODES.ARROW_LEFT, __vinicunca_perkakas.KEY_CODES.ARROW_RIGHT]) && event.key !== __vinicunca_perkakas.KEY_CODES.TAB && event.key !== __vinicunca_perkakas.KEY_CODES.SHIFT && isAcceptableSegmentKey(event.key)) {
1384
- if (Object.values(props.segmentValues.value).every((item) => item !== null)) {
1385
- const updateObject = { ...props.segmentValues.value };
1386
- let dateRef = props.placeholder.value.copy();
1387
- Object.keys(updateObject).forEach((part) => {
1388
- const value = updateObject[part];
1389
- dateRef = dateRef.set({ [part]: value });
1390
- });
1391
- props.modelValue.value = dateRef.copy();
1392
- }
1393
- }
1394
- }
1395
- return {
1396
- handleSegmentClick,
1397
- handleSegmentKeydown,
1398
- attributes
1399
- };
1400
- }
1401
-
1402
- //#endregion
1403
- //#region src/date-field/date-field-root.vue?vue&type=script&setup=true&lang.ts
1404
- const [injectADateFieldRootContext, provideDateFieldRootContext] = require_accordion_accordion_content.createContext("ADateFieldRoot");
1405
- var date_field_root_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
1406
- inheritAttrs: false,
1407
- __name: "date-field-root",
1408
- props: {
1409
- defaultValue: {
1410
- type: null,
1411
- required: false,
1412
- default: void 0
1413
- },
1414
- defaultPlaceholder: {
1415
- type: null,
1416
- required: false
1417
- },
1418
- placeholder: {
1419
- type: null,
1420
- required: false,
1421
- default: void 0
1422
- },
1423
- modelValue: {
1424
- type: null,
1425
- required: false
1426
- },
1427
- hourCycle: {
1428
- type: null,
1429
- required: false
1430
- },
1431
- step: {
1432
- type: Object,
1433
- required: false
1434
- },
1435
- granularity: {
1436
- type: String,
1437
- required: false
1438
- },
1439
- hideTimeZone: {
1440
- type: Boolean,
1441
- required: false
1442
- },
1443
- maxValue: {
1444
- type: null,
1445
- required: false
1446
- },
1447
- minValue: {
1448
- type: null,
1449
- required: false
1450
- },
1451
- locale: {
1452
- type: String,
1453
- required: false
1454
- },
1455
- disabled: {
1456
- type: Boolean,
1457
- required: false,
1458
- default: false
1459
- },
1460
- readonly: {
1461
- type: Boolean,
1462
- required: false,
1463
- default: false
1464
- },
1465
- isDateUnavailable: {
1466
- type: Function,
1467
- required: false,
1468
- default: void 0
1469
- },
1470
- id: {
1471
- type: String,
1472
- required: false
1473
- },
1474
- dir: {
1475
- type: String,
1476
- required: false
1477
- },
1478
- asChild: {
1479
- type: Boolean,
1480
- required: false
1481
- },
1482
- as: {
1483
- type: null,
1484
- required: false
1485
- },
1486
- name: {
1487
- type: String,
1488
- required: false
1489
- },
1490
- required: {
1491
- type: Boolean,
1492
- required: false
1493
- }
1494
- },
1495
- emits: ["update:modelValue", "update:placeholder"],
1496
- setup(__props, { expose: __expose, emit: __emit }) {
1497
- const props = __props;
1498
- const emits = __emit;
1499
- const { disabled, readonly, isDateUnavailable: propsIsDateUnavailable, granularity, defaultValue, dir: propDir, locale: propLocale } = (0, vue.toRefs)(props);
1500
- const locale = require_calendar_calendar_cell.useLocale(propLocale);
1501
- const dir = require_accordion_accordion_content.useDirection(propDir);
1502
- const formatter = require_calendar_calendar_cell.useDateFormatter(locale.value);
1503
- const { primitiveElement, currentElement: parentElement } = require_calendar_calendar_cell.usePrimitiveElement();
1504
- const segmentElements = (0, vue.ref)(/* @__PURE__ */ new Set());
1505
- (0, vue.onMounted)(() => {
1506
- getSegmentElements(parentElement.value).forEach((item) => {
1507
- segmentElements.value.add(item);
1508
- });
1509
- });
1510
- const modelValue = (0, __vueuse_core.useVModel)(props, "modelValue", emits, {
1511
- defaultValue: defaultValue.value,
1512
- passive: props.modelValue === void 0
1513
- });
1514
- const defaultDate = require_calendar_calendar_cell.getDefaultDate({
1515
- defaultPlaceholder: props.placeholder,
1516
- granularity: granularity.value,
1517
- defaultValue: modelValue.value,
1518
- locale: props.locale
1519
- });
1520
- const placeholder = (0, __vueuse_core.useVModel)(props, "placeholder", emits, {
1521
- defaultValue: props.defaultPlaceholder ?? defaultDate.copy(),
1522
- passive: props.placeholder === void 0
1523
- });
1524
- const step = (0, vue.computed)(() => require_calendar_calendar_cell.normalizeDateStep(props));
1525
- const inferredGranularity = (0, vue.computed)(() => {
1526
- if (props.granularity) return !require_calendar_calendar_cell.hasTime(placeholder.value) ? "day" : props.granularity;
1527
- return require_calendar_calendar_cell.hasTime(placeholder.value) ? "minute" : "day";
1528
- });
1529
- const isInvalid = (0, vue.computed)(() => {
1530
- if (!modelValue.value) return false;
1531
- if (propsIsDateUnavailable.value?.(modelValue.value)) return true;
1532
- if (props.minValue && require_calendar_calendar_cell.isDateBefore(modelValue.value, props.minValue)) return true;
1533
- return Boolean(props.maxValue && require_calendar_calendar_cell.isDateBefore(props.maxValue, modelValue.value));
1534
- });
1535
- const initialSegments = initializeSegmentValues(inferredGranularity.value);
1536
- const segmentValues = (0, vue.ref)(modelValue.value ? { ...syncSegmentValues({
1537
- value: modelValue.value,
1538
- formatter
1539
- }) } : { ...initialSegments });
1540
- const allSegmentContent = (0, vue.computed)(() => createContent({
1541
- granularity: inferredGranularity.value,
1542
- dateRef: placeholder.value,
1543
- formatter,
1544
- hideTimeZone: props.hideTimeZone,
1545
- hourCycle: props.hourCycle,
1546
- segmentValues: segmentValues.value,
1547
- locale
1548
- }));
1549
- const segmentContents = (0, vue.computed)(() => allSegmentContent.value.arr);
1550
- const editableSegmentContents = (0, vue.computed)(() => segmentContents.value.filter(({ part }) => part !== "literal"));
1551
- (0, vue.watch)(locale, (value) => {
1552
- if (formatter.getLocale() !== value) {
1553
- formatter.setLocale(value);
1554
- (0, vue.nextTick)(() => {
1555
- segmentElements.value.clear();
1556
- getSegmentElements(parentElement.value).forEach((item) => {
1557
- segmentElements.value.add(item);
1558
- });
1559
- });
1560
- }
1561
- });
1562
- (0, vue.watch)(modelValue, (modelValue_) => {
1563
- if (!(0, __vinicunca_perkakas.isNullish)(modelValue_) && placeholder.value.compare(modelValue_) !== 0) placeholder.value = modelValue_.copy();
1564
- });
1565
- (0, vue.watch)([modelValue, locale], ([modelValue_]) => {
1566
- if (!(0, __vinicunca_perkakas.isNullish)(modelValue_)) segmentValues.value = { ...syncSegmentValues({
1567
- value: modelValue_,
1568
- formatter
1569
- }) };
1570
- else if (Object.values(segmentValues.value).every((value) => value !== null) && (0, __vinicunca_perkakas.isNullish)(modelValue_)) segmentValues.value = { ...initialSegments };
1571
- });
1572
- const currentFocusedElement = (0, vue.ref)(null);
1573
- const currentSegmentIndex = (0, vue.computed)(() => Array.from(segmentElements.value).findIndex((el) => el.getAttribute("data-akar-date-field-segment") === currentFocusedElement.value?.getAttribute("data-akar-date-field-segment")));
1574
- const nextFocusableSegment = (0, vue.computed)(() => {
1575
- const sign = dir.value === "rtl" ? -1 : 1;
1576
- const nextCondition = sign < 0 ? currentSegmentIndex.value < 0 : currentSegmentIndex.value > segmentElements.value.size - 1;
1577
- if (nextCondition) return null;
1578
- const segmentToFocus = Array.from(segmentElements.value)[currentSegmentIndex.value + sign];
1579
- return segmentToFocus;
1580
- });
1581
- const prevFocusableSegment = (0, vue.computed)(() => {
1582
- const sign = dir.value === "rtl" ? -1 : 1;
1583
- const prevCondition = sign > 0 ? currentSegmentIndex.value < 0 : currentSegmentIndex.value > segmentElements.value.size - 1;
1584
- if (prevCondition) return null;
1585
- const segmentToFocus = Array.from(segmentElements.value)[currentSegmentIndex.value - sign];
1586
- return segmentToFocus;
1587
- });
1588
- function handleKeydown(event) {
1589
- if (!isSegmentNavigationKey(event.key)) return;
1590
- if (event.key === __vinicunca_perkakas.KEY_CODES.ARROW_LEFT) prevFocusableSegment.value?.focus();
1591
- if (event.key === __vinicunca_perkakas.KEY_CODES.ARROW_RIGHT) nextFocusableSegment.value?.focus();
1592
- }
1593
- function setFocusedElement(el) {
1594
- currentFocusedElement.value = el;
1595
- }
1596
- provideDateFieldRootContext({
1597
- isDateUnavailable: propsIsDateUnavailable.value,
1598
- locale,
1599
- modelValue,
1600
- placeholder,
1601
- disabled,
1602
- formatter,
1603
- hourCycle: props.hourCycle,
1604
- step,
1605
- readonly,
1606
- segmentValues,
1607
- isInvalid,
1608
- segmentContents: editableSegmentContents,
1609
- elements: segmentElements,
1610
- setFocusedElement,
1611
- focusNext() {
1612
- nextFocusableSegment.value?.focus();
1613
- }
1614
- });
1615
- __expose({ setFocusedElement });
1616
- return (_ctx, _cache) => {
1617
- return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(require_accordion_accordion_content.APrimitive), (0, vue.mergeProps)(_ctx.$attrs, {
1618
- ref_key: "primitiveElement",
1619
- ref: primitiveElement,
1620
- role: "group",
1621
- "aria-disabled": (0, vue.unref)(disabled) ? true : void 0,
1622
- "data-disabled": (0, vue.unref)(disabled) ? "" : void 0,
1623
- "data-readonly": (0, vue.unref)(readonly) ? "" : void 0,
1624
- "data-invalid": isInvalid.value ? "" : void 0,
1625
- dir: (0, vue.unref)(dir),
1626
- onKeydown: (0, vue.withKeys)(handleKeydown, ["left", "right"])
1627
- }), {
1628
- default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default", {
1629
- modelValue: (0, vue.unref)(modelValue),
1630
- segments: segmentContents.value,
1631
- isInvalid: isInvalid.value
1632
- }), (0, vue.createVNode)((0, vue.unref)(require_checkbox_checkbox_group_root.visually_hidden_default), {
1633
- id: _ctx.id,
1634
- as: "input",
1635
- feature: "focusable",
1636
- tabindex: "-1",
1637
- value: (0, vue.unref)(modelValue) ? (0, vue.unref)(modelValue).toString() : "",
1638
- name: _ctx.name,
1639
- disabled: (0, vue.unref)(disabled),
1640
- required: _ctx.required,
1641
- onFocus: _cache[0] || (_cache[0] = ($event) => Array.from(segmentElements.value)?.[0]?.focus())
1642
- }, null, 8, [
1643
- "id",
1644
- "value",
1645
- "name",
1646
- "disabled",
1647
- "required"
1648
- ])]),
1649
- _: 3
1650
- }, 16, [
1651
- "aria-disabled",
1652
- "data-disabled",
1653
- "data-readonly",
1654
- "data-invalid",
1655
- "dir"
1656
- ]);
1657
- };
1658
- }
1659
- });
1660
-
1661
- //#endregion
1662
- //#region src/date-field/date-field-root.vue
1663
- var date_field_root_default = date_field_root_vue_vue_type_script_setup_true_lang_default;
1664
-
1665
- //#endregion
1666
- //#region src/date-field/date-field-input.vue?vue&type=script&setup=true&lang.ts
1667
- var date_field_input_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
1668
- __name: "date-field-input",
1669
- props: {
1670
- part: {
1671
- type: null,
1672
- required: true
1673
- },
1674
- asChild: {
1675
- type: Boolean,
1676
- required: false
1677
- },
1678
- as: {
1679
- type: null,
1680
- required: false
1681
- }
1682
- },
1683
- setup(__props) {
1684
- const props = __props;
1685
- const rootContext = injectADateFieldRootContext();
1686
- const hasLeftFocus = (0, vue.ref)(true);
1687
- const lastKeyZero = (0, vue.ref)(false);
1688
- const { handleSegmentClick, handleSegmentKeydown, attributes } = useDateField({
1689
- hasLeftFocus,
1690
- lastKeyZero,
1691
- placeholder: rootContext.placeholder,
1692
- hourCycle: rootContext.hourCycle,
1693
- step: rootContext.step,
1694
- segmentValues: rootContext.segmentValues,
1695
- formatter: rootContext.formatter,
1696
- part: props.part,
1697
- disabled: rootContext.disabled,
1698
- readonly: rootContext.readonly,
1699
- focusNext: rootContext.focusNext,
1700
- modelValue: rootContext.modelValue
1701
- });
1702
- const disabled = (0, vue.computed)(() => rootContext.disabled.value);
1703
- const readonly = (0, vue.computed)(() => rootContext.readonly.value);
1704
- const isInvalid = (0, vue.computed)(() => rootContext.isInvalid.value);
1705
- return (_ctx, _cache) => {
1706
- return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(require_accordion_accordion_content.APrimitive), (0, vue.mergeProps)({
1707
- as: _ctx.as,
1708
- "as-child": _ctx.asChild
1709
- }, (0, vue.unref)(attributes), {
1710
- contenteditable: disabled.value || readonly.value ? false : _ctx.part !== "literal",
1711
- "data-akar-date-field-segment": _ctx.part,
1712
- "aria-disabled": disabled.value ? true : void 0,
1713
- "aria-readonly": readonly.value ? true : void 0,
1714
- "data-disabled": disabled.value ? "" : void 0,
1715
- "data-invalid": isInvalid.value ? "" : void 0,
1716
- "aria-invalid": isInvalid.value ? true : void 0
1717
- }, (0, vue.toHandlers)(_ctx.part !== "literal" ? {
1718
- mousedown: (0, vue.unref)(handleSegmentClick),
1719
- keydown: (0, vue.unref)(handleSegmentKeydown),
1720
- focusout: () => {
1721
- hasLeftFocus.value = true;
1722
- },
1723
- focusin: (event) => {
1724
- (0, vue.unref)(rootContext).setFocusedElement(event.target);
1725
- }
1726
- } : {})), {
1727
- default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
1728
- _: 3
1729
- }, 16, [
1730
- "as",
1731
- "as-child",
1732
- "contenteditable",
1733
- "data-akar-date-field-segment",
1734
- "aria-disabled",
1735
- "aria-readonly",
1736
- "data-disabled",
1737
- "data-invalid",
1738
- "aria-invalid"
1739
- ]);
1740
- };
1741
- }
1742
- });
1743
-
1744
- //#endregion
1745
- //#region src/date-field/date-field-input.vue
1746
- var date_field_input_default = date_field_input_vue_vue_type_script_setup_true_lang_default;
1747
-
1748
- //#endregion
1749
- Object.defineProperty(exports, 'createContent', {
1750
- enumerable: true,
1751
- get: function () {
1752
- return createContent;
1753
- }
1754
- });
1755
- Object.defineProperty(exports, 'date_field_input_default', {
1756
- enumerable: true,
1757
- get: function () {
1758
- return date_field_input_default;
1759
- }
1760
- });
1761
- Object.defineProperty(exports, 'date_field_root_default', {
1762
- enumerable: true,
1763
- get: function () {
1764
- return date_field_root_default;
1765
- }
1766
- });
1767
- Object.defineProperty(exports, 'getSegmentElements', {
1768
- enumerable: true,
1769
- get: function () {
1770
- return getSegmentElements;
1771
- }
1772
- });
1773
- Object.defineProperty(exports, 'getTimeFieldSegmentElements', {
1774
- enumerable: true,
1775
- get: function () {
1776
- return getTimeFieldSegmentElements;
1777
- }
1778
- });
1779
- Object.defineProperty(exports, 'initializeSegmentValues', {
1780
- enumerable: true,
1781
- get: function () {
1782
- return initializeSegmentValues;
1783
- }
1784
- });
1785
- Object.defineProperty(exports, 'initializeTimeSegmentValues', {
1786
- enumerable: true,
1787
- get: function () {
1788
- return initializeTimeSegmentValues;
1789
- }
1790
- });
1791
- Object.defineProperty(exports, 'injectADateFieldRootContext', {
1792
- enumerable: true,
1793
- get: function () {
1794
- return injectADateFieldRootContext;
1795
- }
1796
- });
1797
- Object.defineProperty(exports, 'isSegmentNavigationKey', {
1798
- enumerable: true,
1799
- get: function () {
1800
- return isSegmentNavigationKey;
1801
- }
1802
- });
1803
- Object.defineProperty(exports, 'syncSegmentValues', {
1804
- enumerable: true,
1805
- get: function () {
1806
- return syncSegmentValues;
1807
- }
1808
- });
1809
- Object.defineProperty(exports, 'syncTimeSegmentValues', {
1810
- enumerable: true,
1811
- get: function () {
1812
- return syncTimeSegmentValues;
1813
- }
1814
- });
1815
- Object.defineProperty(exports, 'useDateField', {
1816
- enumerable: true,
1817
- get: function () {
1818
- return useDateField;
1819
- }
1820
- });
1821
- //# sourceMappingURL=date-field-input.cjs.map