@m3ui-vue/m3ui-vue 0.8.8 → 0.9.1

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 (375) hide show
  1. package/README.md +25 -5
  2. package/dist/API.md +3661 -0
  3. package/dist/MIcon-CaEooCmZ.js.map +1 -1
  4. package/dist/{MMenuItem-5xojJYAL.js → MTextField-pJU1vFaR.js} +374 -364
  5. package/dist/MTextField-pJU1vFaR.js.map +1 -0
  6. package/dist/api.json +1 -0
  7. package/dist/barcode.js +9 -11
  8. package/dist/barcode.js.map +1 -1
  9. package/dist/chart.js.map +1 -1
  10. package/dist/code-editor.js +2 -2
  11. package/dist/code-editor.js.map +1 -1
  12. package/dist/components/MAbsolute.vue.d.ts +12 -0
  13. package/dist/components/MAlert.vue.d.ts +4 -0
  14. package/dist/components/MAppBar.vue.d.ts +12 -0
  15. package/dist/components/MAppLayout.vue.d.ts +2 -0
  16. package/dist/components/MAspectRatio.vue.d.ts +1 -0
  17. package/dist/components/MAutocomplete.vue.d.ts +18 -0
  18. package/dist/components/MAvatar.vue.d.ts +3 -0
  19. package/dist/components/MBadge.vue.d.ts +6 -0
  20. package/dist/components/MBar.vue.d.ts +5 -0
  21. package/dist/components/MBarcode.vue.d.ts +9 -0
  22. package/dist/components/MBottomSheet.vue.d.ts +3 -0
  23. package/dist/components/MBox.vue.d.ts +6 -0
  24. package/dist/components/MBreadcrumbs.vue.d.ts +2 -0
  25. package/dist/components/MButton.vue.d.ts +14 -4
  26. package/dist/components/MButtonGroup.vue.d.ts +7 -0
  27. package/dist/components/MCalendar.vue.d.ts +8 -0
  28. package/dist/components/MCard.vue.d.ts +17 -0
  29. package/dist/components/MCarousel.vue.d.ts +61 -36
  30. package/dist/components/MCenter.vue.d.ts +1 -0
  31. package/dist/components/MChart.vue.d.ts +7 -0
  32. package/dist/components/MChatBubble.vue.d.ts +10 -0
  33. package/dist/components/MCheckbox.vue.d.ts +5 -0
  34. package/dist/components/MChip.vue.d.ts +9 -0
  35. package/dist/components/MCircleProgressBar.vue.d.ts +7 -0
  36. package/dist/components/MCodeEditor.vue.d.ts +9 -0
  37. package/dist/components/MColorPicker.vue.d.ts +8 -0
  38. package/dist/components/MColorPickerModal.vue.d.ts +4 -0
  39. package/dist/components/MCommandPalette.vue.d.ts +8 -0
  40. package/dist/components/MConfirmDialog.vue.d.ts +7 -0
  41. package/dist/components/MContainer.vue.d.ts +4 -0
  42. package/dist/components/MContextMenu.vue.d.ts +3 -6
  43. package/dist/components/MCopyButton.vue.d.ts +10 -0
  44. package/dist/components/MDataTable.vue.d.ts +33 -12
  45. package/dist/components/MDatePicker.vue.d.ts +16 -0
  46. package/dist/components/MDatePickerModal.vue.d.ts +9 -0
  47. package/dist/components/MDateRangePicker.vue.d.ts +18 -0
  48. package/dist/components/MDateRangePickerModal.vue.d.ts +9 -0
  49. package/dist/components/MDialog.vue.d.ts +10 -6
  50. package/dist/components/MDivider.vue.d.ts +6 -0
  51. package/dist/components/MDragDropList.vue.d.ts +6 -0
  52. package/dist/components/MEmoji.vue.d.ts +6 -0
  53. package/dist/components/MEmojiButton.vue.d.ts +5 -0
  54. package/dist/components/MEmojiSelector.vue.d.ts +21 -5
  55. package/dist/components/MEmptyState.vue.d.ts +4 -0
  56. package/dist/components/MExpansionPanel.vue.d.ts +9 -0
  57. package/dist/components/MExportButton.vue.d.ts +8 -0
  58. package/dist/components/MFab.vue.d.ts +9 -0
  59. package/dist/components/MFabMenu.vue.d.ts +15 -1
  60. package/dist/components/MFileUpload.vue.d.ts +8 -0
  61. package/dist/components/MFixed.vue.d.ts +10 -0
  62. package/dist/components/MFlex.vue.d.ts +7 -1
  63. package/dist/components/MFooter.vue.d.ts +11 -0
  64. package/dist/components/MFullscreen.vue.d.ts +2 -0
  65. package/dist/components/MGrid.vue.d.ts +7 -0
  66. package/dist/components/MHotkeys.vue.d.ts +4 -0
  67. package/dist/components/MIcon.vue.d.ts +2 -0
  68. package/dist/components/MIconButton.vue.d.ts +10 -0
  69. package/dist/components/MInfiniteScroll.vue.d.ts +6 -0
  70. package/dist/components/MJsonEditor.vue.d.ts +8 -0
  71. package/dist/components/MJsonViewer.vue.d.ts +4 -0
  72. package/dist/components/MKanban.vue.d.ts +2 -0
  73. package/dist/components/MKbd.vue.d.ts +2 -0
  74. package/dist/components/MLightbox.vue.d.ts +19 -5
  75. package/dist/components/MList.vue.d.ts +7 -0
  76. package/dist/components/MListItem.vue.d.ts +24 -0
  77. package/dist/components/MListSubheader.vue.d.ts +6 -0
  78. package/dist/components/MLoadingIndicator.vue.d.ts +10 -0
  79. package/dist/components/MLoadingOverlay.vue.d.ts +5 -0
  80. package/dist/components/MMarkdown.vue.d.ts +3 -0
  81. package/dist/components/MMaskField.vue.d.ts +15 -0
  82. package/dist/components/MMasonry.vue.d.ts +5 -0
  83. package/dist/components/MMenu.vue.d.ts +3 -6
  84. package/dist/components/MMenuDivider.vue.d.ts +4 -0
  85. package/dist/components/MMenuItem.vue.d.ts +5 -0
  86. package/dist/components/MMultiAutocomplete.vue.d.ts +20 -0
  87. package/dist/components/MMultiSelect.vue.d.ts +21 -0
  88. package/dist/components/MNavigationBar.vue.d.ts +2 -0
  89. package/dist/components/MNavigationDrawer.vue.d.ts +11 -0
  90. package/dist/components/MNavigationRail.vue.d.ts +9 -6
  91. package/dist/components/MNavigationSuite.vue.d.ts +5 -3
  92. package/dist/components/MNumberField.vue.d.ts +17 -0
  93. package/dist/components/MOverlay.vue.d.ts +3 -0
  94. package/dist/components/MPageProgress.vue.d.ts +3 -0
  95. package/dist/components/MPagination.vue.d.ts +3 -0
  96. package/dist/components/MPasswordMeter.vue.d.ts +1 -0
  97. package/dist/components/MPinInput.vue.d.ts +11 -0
  98. package/dist/components/MProgressBar.vue.d.ts +6 -0
  99. package/dist/components/MPullToRefresh.vue.d.ts +8 -0
  100. package/dist/components/MQRCode.vue.d.ts +6 -0
  101. package/dist/components/MRadio.vue.d.ts +5 -0
  102. package/dist/components/MRadioGroup.vue.d.ts +6 -0
  103. package/dist/components/MRating.vue.d.ts +11 -0
  104. package/dist/components/MRelativeTime.vue.d.ts +1 -0
  105. package/dist/components/MResponsive.vue.d.ts +3 -0
  106. package/dist/components/MResult.vue.d.ts +6 -0
  107. package/dist/components/MRichTextEditor.vue.d.ts +8 -0
  108. package/dist/components/MScheduler.vue.d.ts +48 -1
  109. package/dist/components/MScrollable.vue.d.ts +3 -0
  110. package/dist/components/MSearchBar.vue.d.ts +6 -0
  111. package/dist/components/MSection.vue.d.ts +5 -0
  112. package/dist/components/MSegmentedButton.vue.d.ts +5 -0
  113. package/dist/components/MSelect.vue.d.ts +17 -0
  114. package/dist/components/MShader.vue.d.ts +1 -0
  115. package/dist/components/MShape.vue.d.ts +1 -1
  116. package/dist/components/MShortNavigationBar.vue.d.ts +8 -9
  117. package/dist/components/MSideSheet.vue.d.ts +3 -0
  118. package/dist/components/MSignaturePad.vue.d.ts +7 -0
  119. package/dist/components/MSimpleCarousel.vue.d.ts +12 -2
  120. package/dist/components/MSkeleton.vue.d.ts +8 -0
  121. package/dist/components/MSlider.vue.d.ts +15 -1
  122. package/dist/components/MSnackbar.vue.d.ts +1 -0
  123. package/dist/components/MSpinner.vue.d.ts +6 -0
  124. package/dist/components/MSplitButton.vue.d.ts +7 -0
  125. package/dist/components/MSplitter.vue.d.ts +4 -0
  126. package/dist/components/MSpotlightSearch.vue.d.ts +18 -0
  127. package/dist/components/MStack.vue.d.ts +8 -1
  128. package/dist/components/MStatCard.vue.d.ts +7 -0
  129. package/dist/components/MStepper.vue.d.ts +7 -0
  130. package/dist/components/MSticky.vue.d.ts +2 -0
  131. package/dist/components/MSubtitle.vue.d.ts +4 -0
  132. package/dist/components/MSwitch.vue.d.ts +5 -6
  133. package/dist/components/MTable.vue.d.ts +17 -4
  134. package/dist/components/MTabs.vue.d.ts +6 -0
  135. package/dist/components/MTagInput.vue.d.ts +17 -0
  136. package/dist/components/MTerminal.vue.d.ts +4 -0
  137. package/dist/components/MText.vue.d.ts +10 -0
  138. package/dist/components/MTextField.vue.d.ts +18 -0
  139. package/dist/components/MTimePicker.vue.d.ts +10 -0
  140. package/dist/components/MTimePickerModal.vue.d.ts +5 -0
  141. package/dist/components/MTimeline.vue.d.ts +3 -0
  142. package/dist/components/MTitle.vue.d.ts +4 -0
  143. package/dist/components/MToggleButton.vue.d.ts +4 -0
  144. package/dist/components/MToolbar.vue.d.ts +6 -1
  145. package/dist/components/MTooltip.vue.d.ts +7 -0
  146. package/dist/components/MTopAppBar.vue.d.ts +8 -0
  147. package/dist/components/MTour.vue.d.ts +5 -0
  148. package/dist/components/MTransferList.vue.d.ts +11 -0
  149. package/dist/components/MTree.vue.d.ts +11 -0
  150. package/dist/components/MTreeTable.vue.d.ts +7 -0
  151. package/dist/components/MVirtualTable.vue.d.ts +6 -0
  152. package/dist/components/MWindow.vue.d.ts +33 -1
  153. package/dist/composables/_carouselStrategy.d.ts +101 -0
  154. package/dist/composables/useLocale.d.ts +21 -0
  155. package/dist/data/emoji-names/emoji-names-de.d.ts +2 -0
  156. package/dist/data/emoji-names/emoji-names-en.d.ts +2 -0
  157. package/dist/data/emoji-names/emoji-names-es.d.ts +2 -0
  158. package/dist/data/emoji-names/emoji-names-fr.d.ts +2 -0
  159. package/dist/data/emoji-names/emoji-names-ja.d.ts +2 -0
  160. package/dist/data/emoji-names/emoji-names-ko.d.ts +2 -0
  161. package/dist/data/emoji-names/emoji-names-pt.d.ts +2 -0
  162. package/dist/data/emoji-names/emoji-names-zh.d.ts +2 -0
  163. package/dist/data/emojis.d.ts +7 -1
  164. package/dist/emoji-names-de-BphO5XpV.js +1877 -0
  165. package/dist/emoji-names-de-BphO5XpV.js.map +1 -0
  166. package/dist/emoji-names-en-9ZvMRvzi.js +1877 -0
  167. package/dist/emoji-names-en-9ZvMRvzi.js.map +1 -0
  168. package/dist/emoji-names-es-DvfWU3Pj.js +1877 -0
  169. package/dist/emoji-names-es-DvfWU3Pj.js.map +1 -0
  170. package/dist/emoji-names-fr-B-jhUlsP.js +1877 -0
  171. package/dist/emoji-names-fr-B-jhUlsP.js.map +1 -0
  172. package/dist/emoji-names-ja-l8cMFJo1.js +1877 -0
  173. package/dist/emoji-names-ja-l8cMFJo1.js.map +1 -0
  174. package/dist/emoji-names-ko-YP-o9G0c.js +1877 -0
  175. package/dist/emoji-names-ko-YP-o9G0c.js.map +1 -0
  176. package/dist/emoji-names-pt-DGj_Js4M.js +1877 -0
  177. package/dist/emoji-names-pt-DGj_Js4M.js.map +1 -0
  178. package/dist/emoji-names-zh-Dzecwtw_.js +1877 -0
  179. package/dist/emoji-names-zh-Dzecwtw_.js.map +1 -0
  180. package/dist/index.d.ts +2 -2
  181. package/dist/locales/index.js +140 -7
  182. package/dist/locales/index.js.map +1 -1
  183. package/dist/m3ui-vue.css +1 -1
  184. package/dist/m3ui.js +6642 -5160
  185. package/dist/m3ui.js.map +1 -1
  186. package/dist/markdown.js +1 -1
  187. package/dist/markdown.js.map +1 -1
  188. package/dist/plugin.d.ts +6 -0
  189. package/dist/qrcode.js.map +1 -1
  190. package/dist/rich-text-editor.js +10 -10
  191. package/dist/rich-text-editor.js.map +1 -1
  192. package/dist/styles.css +1 -1
  193. package/dist/terminal.js +34 -27
  194. package/dist/terminal.js.map +1 -1
  195. package/dist/{useLocale-D3ZWZ8jY.js → useLocale-Drihe5G2.js} +33 -11
  196. package/dist/useLocale-Drihe5G2.js.map +1 -0
  197. package/package.json +4 -2
  198. package/src/__tests__/MCarousel.test.ts +183 -21
  199. package/src/__tests__/MDialog.test.ts +18 -0
  200. package/src/__tests__/MEmojiSelector.test.ts +138 -0
  201. package/src/__tests__/MHotkeys.test.ts +57 -0
  202. package/src/__tests__/MLightbox.test.ts +313 -5
  203. package/src/__tests__/MScheduler.test.ts +122 -0
  204. package/src/__tests__/MTerminal.test.ts +63 -0
  205. package/src/__tests__/attrsFallthrough.test.ts +65 -0
  206. package/src/__tests__/hostLocale.test.ts +57 -0
  207. package/src/__tests__/plugin.test.ts +28 -1
  208. package/src/components/MAbsolute.vue +18 -0
  209. package/src/components/MAlert.vue +12 -0
  210. package/src/components/MAppBar.vue +12 -0
  211. package/src/components/MAppLayout.vue +11 -0
  212. package/src/components/MAspectRatio.vue +6 -0
  213. package/src/components/MAutocomplete.vue +24 -0
  214. package/src/components/MAvatar.vue +12 -1
  215. package/src/components/MBadge.vue +11 -0
  216. package/src/components/MBar.vue +19 -0
  217. package/src/components/MBarcode.vue +18 -2
  218. package/src/components/MBottomSheet.vue +13 -1
  219. package/src/components/MBox.vue +12 -0
  220. package/src/components/MBreadcrumbs.vue +7 -0
  221. package/src/components/MButton.vue +22 -4
  222. package/src/components/MButtonGroup.vue +13 -0
  223. package/src/components/MCalendar.vue +14 -0
  224. package/src/components/MCard.vue +26 -0
  225. package/src/components/MCarousel.vue +542 -200
  226. package/src/components/MCenter.vue +6 -0
  227. package/src/components/MChart.vue +12 -0
  228. package/src/components/MChatBubble.vue +17 -0
  229. package/src/components/MCheckbox.vue +11 -0
  230. package/src/components/MChip.vue +17 -0
  231. package/src/components/MCircleProgressBar.vue +13 -0
  232. package/src/components/MCodeEditor.vue +18 -2
  233. package/src/components/MColorPicker.vue +13 -0
  234. package/src/components/MColorPickerModal.vue +12 -0
  235. package/src/components/MCommandPalette.vue +17 -1
  236. package/src/components/MConfirmDialog.vue +15 -0
  237. package/src/components/MContainer.vue +9 -0
  238. package/src/components/MContextMenu.vue +20 -7
  239. package/src/components/MCopyButton.vue +16 -0
  240. package/src/components/MDataTable.vue +58 -12
  241. package/src/components/MDatePicker.vue +21 -0
  242. package/src/components/MDatePickerModal.vue +17 -1
  243. package/src/components/MDateRangePicker.vue +23 -0
  244. package/src/components/MDateRangePickerModal.vue +17 -1
  245. package/src/components/MDialog.vue +43 -10
  246. package/src/components/MDivider.vue +6 -0
  247. package/src/components/MDragDropList.vue +18 -0
  248. package/src/components/MEmoji.vue +6 -0
  249. package/src/components/MEmojiButton.vue +11 -0
  250. package/src/components/MEmojiSelector.vue +486 -78
  251. package/src/components/MEmptyState.vue +9 -0
  252. package/src/components/MExpansionPanel.vue +17 -0
  253. package/src/components/MExportButton.vue +15 -0
  254. package/src/components/MFab.vue +20 -1
  255. package/src/components/MFabMenu.vue +20 -0
  256. package/src/components/MFileUpload.vue +19 -0
  257. package/src/components/MFixed.vue +16 -0
  258. package/src/components/MFlex.vue +11 -0
  259. package/src/components/MFooter.vue +11 -0
  260. package/src/components/MFullscreen.vue +8 -0
  261. package/src/components/MGrid.vue +12 -0
  262. package/src/components/MHotkeys.vue +20 -13
  263. package/src/components/MIcon.vue +10 -1
  264. package/src/components/MIconButton.vue +13 -0
  265. package/src/components/MInfiniteScroll.vue +16 -0
  266. package/src/components/MJsonEditor.vue +13 -0
  267. package/src/components/MJsonViewer.vue +7 -0
  268. package/src/components/MKanban.vue +18 -0
  269. package/src/components/MKbd.vue +6 -0
  270. package/src/components/MLightbox.vue +766 -268
  271. package/src/components/MList.vue +15 -0
  272. package/src/components/MListDetail.vue +11 -0
  273. package/src/components/MListItem.vue +37 -0
  274. package/src/components/MListSubheader.vue +6 -0
  275. package/src/components/MLoadingIndicator.vue +15 -0
  276. package/src/components/MLoadingOverlay.vue +18 -1
  277. package/src/components/MMarkdown.vue +7 -0
  278. package/src/components/MMaskField.vue +21 -0
  279. package/src/components/MMasonry.vue +11 -0
  280. package/src/components/MMenu.vue +19 -7
  281. package/src/components/MMenuDivider.vue +4 -0
  282. package/src/components/MMenuItem.vue +16 -0
  283. package/src/components/MMultiAutocomplete.vue +26 -0
  284. package/src/components/MMultiSelect.vue +27 -0
  285. package/src/components/MNavigationBar.vue +7 -0
  286. package/src/components/MNavigationDrawer.vue +30 -1
  287. package/src/components/MNavigationRail.vue +27 -6
  288. package/src/components/MNavigationSuite.vue +20 -3
  289. package/src/components/MNotificationHost.vue +3 -0
  290. package/src/components/MNumberField.vue +24 -0
  291. package/src/components/MOverlay.vue +11 -0
  292. package/src/components/MPageProgress.vue +7 -0
  293. package/src/components/MPagination.vue +15 -1
  294. package/src/components/MPasswordMeter.vue +7 -0
  295. package/src/components/MPinInput.vue +19 -0
  296. package/src/components/MProgressBar.vue +9 -0
  297. package/src/components/MPullToRefresh.vue +17 -0
  298. package/src/components/MQRCode.vue +12 -0
  299. package/src/components/MRadio.vue +11 -0
  300. package/src/components/MRadioGroup.vue +11 -0
  301. package/src/components/MRating.vue +19 -0
  302. package/src/components/MRelative.vue +8 -0
  303. package/src/components/MRelativeTime.vue +6 -0
  304. package/src/components/MResponsive.vue +9 -0
  305. package/src/components/MResult.vue +14 -0
  306. package/src/components/MRichTextEditor.vue +14 -0
  307. package/src/components/MScheduler.vue +303 -115
  308. package/src/components/MScrollable.vue +8 -0
  309. package/src/components/MSearchBar.vue +17 -0
  310. package/src/components/MSection.vue +13 -0
  311. package/src/components/MSegmentedButton.vue +10 -0
  312. package/src/components/MSelect.vue +22 -0
  313. package/src/components/MShader.vue +13 -0
  314. package/src/components/MShape.vue +6 -0
  315. package/src/components/MShortNavigationBar.vue +23 -9
  316. package/src/components/MSideSheet.vue +14 -1
  317. package/src/components/MSignaturePad.vue +15 -0
  318. package/src/components/MSimpleCarousel.vue +18 -0
  319. package/src/components/MSkeleton.vue +8 -0
  320. package/src/components/MSlider.vue +21 -0
  321. package/src/components/MSnackbar.vue +5 -0
  322. package/src/components/MSpacer.vue +6 -0
  323. package/src/components/MSpinner.vue +10 -0
  324. package/src/components/MSplitButton.vue +17 -1
  325. package/src/components/MSplitter.vue +10 -0
  326. package/src/components/MSpotlightSearch.vue +28 -1
  327. package/src/components/MStack.vue +12 -0
  328. package/src/components/MStatCard.vue +13 -0
  329. package/src/components/MStepper.vue +12 -0
  330. package/src/components/MSticky.vue +7 -0
  331. package/src/components/MSubtitle.vue +9 -0
  332. package/src/components/MSupportingPane.vue +10 -0
  333. package/src/components/MSwitch.vue +14 -6
  334. package/src/components/MTable.vue +33 -4
  335. package/src/components/MTabs.vue +12 -0
  336. package/src/components/MTagInput.vue +23 -0
  337. package/src/components/MTerminal.vue +33 -10
  338. package/src/components/MText.vue +15 -0
  339. package/src/components/MTextField.vue +26 -0
  340. package/src/components/MTimePicker.vue +15 -0
  341. package/src/components/MTimePickerModal.vue +13 -1
  342. package/src/components/MTimeline.vue +7 -0
  343. package/src/components/MTitle.vue +9 -0
  344. package/src/components/MToggleButton.vue +12 -0
  345. package/src/components/MToolbar.vue +12 -0
  346. package/src/components/MTooltip.vue +18 -0
  347. package/src/components/MTopAppBar.vue +18 -0
  348. package/src/components/MTour.vue +15 -2
  349. package/src/components/MTransferList.vue +24 -0
  350. package/src/components/MTree.vue +11 -0
  351. package/src/components/MTreeTable.vue +15 -0
  352. package/src/components/MVirtualTable.vue +12 -0
  353. package/src/components/MWindow.vue +34 -0
  354. package/src/composables/_carouselStrategy.ts +712 -0
  355. package/src/composables/useLocale.ts +54 -3
  356. package/src/data/emoji-names/emoji-names-de.ts +1875 -0
  357. package/src/data/emoji-names/emoji-names-en.ts +1875 -0
  358. package/src/data/emoji-names/emoji-names-es.ts +1875 -0
  359. package/src/data/emoji-names/emoji-names-fr.ts +1875 -0
  360. package/src/data/emoji-names/emoji-names-ja.ts +1875 -0
  361. package/src/data/emoji-names/emoji-names-ko.ts +1875 -0
  362. package/src/data/emoji-names/emoji-names-pt.ts +1875 -0
  363. package/src/data/emoji-names/emoji-names-zh.ts +1875 -0
  364. package/src/data/emojis.ts +29 -198
  365. package/src/index.ts +2 -2
  366. package/src/locales/de.ts +19 -0
  367. package/src/locales/es.ts +19 -0
  368. package/src/locales/fr.ts +19 -0
  369. package/src/locales/ja.ts +19 -0
  370. package/src/locales/ko.ts +19 -0
  371. package/src/locales/pt.ts +19 -0
  372. package/src/locales/zh.ts +19 -0
  373. package/src/plugin.ts +14 -2
  374. package/dist/MMenuItem-5xojJYAL.js.map +0 -1
  375. package/dist/useLocale-D3ZWZ8jY.js.map +0 -1
@@ -1,5 +1,16 @@
1
1
  <script setup lang="ts">
2
- import { ref, computed } from 'vue'
2
+ /**
3
+ * A week or day calendar grid. Events sit at their exact times, overlapping ones share the width, and anything
4
+ * that lasts all day or spans several days runs across the all-day row. Click a day header to open that day.
5
+ * Dates and times follow the app's locale.
6
+ *
7
+ * @slot event Content of each event block; allDay is true in the all-day row
8
+ * @event eventClick An event (in the grid or the all-day row) was clicked
9
+ * @event slotClick An empty spot in the grid was clicked
10
+ * @event update:date Navigation changed the date shown (YYYY-MM-DD)
11
+ * @event update:view The Day/Week toggle (or a day header) changed the view
12
+ */
13
+ import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue'
3
14
  import MIconButton from './MIconButton.vue'
4
15
  import { useLocale } from '../composables/useLocale'
5
16
 
@@ -8,129 +19,260 @@ const locale = useLocale()
8
19
  export interface SchedulerEvent {
9
20
  id: string | number
10
21
  title: string
22
+ /**
23
+ * Start: a datetime (`2026-10-17T09:30`, or ISO with a zone). For an all-day event, a date
24
+ * (`2026-10-17`).
25
+ */
11
26
  start: string
27
+ /** End: a datetime (exclusive). For an all-day event, the last day (inclusive). */
12
28
  end: string
29
+ /** Shown in the all-day row instead of the time grid. Events that span days go there too. */
30
+ allDay?: boolean
13
31
  color?: 'primary' | 'secondary' | 'tertiary' | 'error' | 'success'
14
32
  }
15
33
 
16
34
  const props = withDefaults(
17
35
  defineProps<{
36
+ /** Events to show (see `SchedulerEvent`) */
18
37
  events?: SchedulerEvent[]
38
+ /** 'week' or 'day'; use v-model:view to follow the header's toggle. */
19
39
  view?: 'week' | 'day'
40
+ /** The date shown (`YYYY-MM-DD`), today by default; use v-model:date to follow navigation. */
41
+ date?: string
42
+ /** First visible hour */
20
43
  startHour?: number
44
+ /** Hour the grid ends at */
21
45
  endHour?: number
46
+ /** First day of the week: 0 = Sunday, 1 = Monday. */
47
+ weekStartsOn?: 0 | 1
48
+ /** Height of one hour row, in px. */
49
+ hourHeight?: number
50
+ /** A line across today's column at the current time. */
51
+ nowIndicator?: boolean
52
+ /** Locale for dates and times (Intl). Falls back to the app's configured locale */
22
53
  locale?: string
54
+ /** Aria label of the previous button (defaults to the locale string) */
23
55
  prevLabel?: string
56
+ /** Aria label of the next button (defaults to the locale string) */
24
57
  nextLabel?: string
58
+ /** Label of the Today button (defaults to the locale string) */
25
59
  todayLabel?: string
60
+ /** Label of the Day toggle (defaults to the locale string) */
26
61
  dayViewLabel?: string
62
+ /** Label of the Week toggle (defaults to the locale string) */
27
63
  weekViewLabel?: string
64
+ /** Label of the all-day row (defaults to the locale string) */
65
+ allDayLabel?: string
28
66
  }>(),
29
67
  {
30
68
  events: () => [],
31
69
  view: 'week',
32
70
  startHour: 7,
33
71
  endHour: 22,
72
+ weekStartsOn: 1,
73
+ hourHeight: 56,
74
+ nowIndicator: true,
34
75
  },
35
76
  )
36
77
 
37
78
  // Falls back to the app's own configured locale (via createM3UI/useLocale) rather than a
38
- // fixed default, matching the pattern MRelativeTime already uses — previously this defaulted
39
- // to a hardcoded 'es-ES' regardless of what locale the app actually provided.
79
+ // fixed default, matching the pattern MRelativeTime already uses.
40
80
  const resolvedLocale = computed(() => props.locale ?? locale.lang)
41
81
 
42
82
  const emit = defineEmits<{
43
83
  eventClick: [SchedulerEvent]
44
84
  slotClick: [{ date: string; hour: number }]
85
+ 'update:date': [string]
86
+ 'update:view': ['week' | 'day']
45
87
  }>()
46
88
 
47
- const currentDate = ref(new Date())
48
- const currentView = ref(props.view)
89
+ defineSlots<{
90
+ /** Content of an event block. */
91
+ event?: (scope: { event: SchedulerEvent; allDay: boolean }) => unknown
92
+ }>()
49
93
 
50
- const hours = computed(() =>
51
- Array.from({ length: props.endHour - props.startHour }, (_, i) => props.startHour + i),
52
- )
94
+ // ── Dates ─────────────────────────────────────────────────────────────────────────────────────
95
+
96
+ /** A date-only string is local midnight (`new Date('2026-10-17')` alone would be UTC). */
97
+ function parse(s: string) {
98
+ return /^\d{4}-\d{2}-\d{2}$/.test(s) ? new Date(`${s}T00:00`) : new Date(s)
99
+ }
100
+
101
+ function fmt(d: Date) {
102
+ return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`
103
+ }
104
+
105
+ function addDays(d: Date, n: number) {
106
+ const out = new Date(d)
107
+ out.setDate(out.getDate() + n)
108
+ return out
109
+ }
53
110
 
54
111
  function startOfWeek(d: Date) {
55
112
  const dt = new Date(d)
56
- const day = dt.getDay()
57
- const diff = day === 0 ? -6 : 1 - day
58
- dt.setDate(dt.getDate() + diff)
59
113
  dt.setHours(0, 0, 0, 0)
60
- return dt
114
+ const diff = (dt.getDay() - props.weekStartsOn + 7) % 7
115
+ return addDays(dt, -diff)
61
116
  }
62
117
 
63
- const weekDays = computed(() => {
64
- const start = startOfWeek(currentDate.value)
65
- return Array.from({ length: 7 }, (_, i) => {
66
- const d = new Date(start)
67
- d.setDate(d.getDate() + i)
68
- return d
69
- })
70
- })
71
-
72
- const visibleDays = computed(() =>
73
- currentView.value === 'day' ? [currentDate.value] : weekDays.value,
74
- )
118
+ const currentDate = ref(props.date ? parse(props.date) : new Date())
119
+ const currentView = ref(props.view)
120
+ watch(() => props.date, (d) => d && fmt(parse(d)) !== fmt(currentDate.value) && (currentDate.value = parse(d)))
121
+ watch(() => props.view, (v) => (currentView.value = v))
75
122
 
76
- const todayIso = (() => {
77
- const d = new Date()
78
- return fmt(d)
79
- })()
123
+ function setDate(d: Date) {
124
+ currentDate.value = d
125
+ emit('update:date', fmt(d))
126
+ }
80
127
 
81
- function fmt(d: Date) {
82
- return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`
128
+ function setView(v: 'week' | 'day') {
129
+ currentView.value = v
130
+ emit('update:view', v)
83
131
  }
84
132
 
133
+ const visibleDays = computed(() => {
134
+ if (currentView.value === 'day') {
135
+ const d = new Date(currentDate.value)
136
+ d.setHours(0, 0, 0, 0)
137
+ return [d]
138
+ }
139
+ const start = startOfWeek(currentDate.value)
140
+ return Array.from({ length: 7 }, (_, i) => addDays(start, i))
141
+ })
142
+ const visibleKeys = computed(() => visibleDays.value.map(fmt))
143
+
144
+ const now = ref(new Date())
145
+ let nowTimer: ReturnType<typeof setInterval> | null = null
146
+ onMounted(() => (nowTimer = setInterval(() => (now.value = new Date()), 60_000)))
147
+ onBeforeUnmount(() => nowTimer && clearInterval(nowTimer))
148
+ const todayKey = computed(() => fmt(now.value))
149
+
85
150
  const dayFormat = computed(() => new Intl.DateTimeFormat(resolvedLocale.value, { weekday: 'short' }))
86
151
  const dateFormat = computed(() => new Intl.DateTimeFormat(resolvedLocale.value, { day: 'numeric' }))
152
+ const timeFormat = computed(() => new Intl.DateTimeFormat(resolvedLocale.value, { hour: '2-digit', minute: '2-digit' }))
87
153
 
88
154
  const headerLabel = computed(() => {
89
155
  if (currentView.value === 'day') {
90
156
  return new Intl.DateTimeFormat(resolvedLocale.value, { weekday: 'long', day: 'numeric', month: 'long', year: 'numeric' })
91
157
  .format(currentDate.value)
92
158
  }
93
- const start = weekDays.value[0]!
94
- const end = weekDays.value[6]!
159
+ const start = visibleDays.value[0]!
160
+ const end = visibleDays.value[6]!
95
161
  const f = new Intl.DateTimeFormat(resolvedLocale.value, { day: 'numeric', month: 'short' })
96
162
  return `${f.format(start)} – ${f.format(end)}, ${end.getFullYear()}`
97
163
  })
98
164
 
99
165
  function navigate(delta: number) {
100
- const d = new Date(currentDate.value)
101
- if (currentView.value === 'week') d.setDate(d.getDate() + delta * 7)
102
- else d.setDate(d.getDate() + delta)
103
- currentDate.value = d
166
+ setDate(addDays(currentDate.value, delta * (currentView.value === 'week' ? 7 : 1)))
104
167
  }
105
168
 
106
- function goToday() { currentDate.value = new Date() }
107
-
108
- function eventsForDayHour(day: Date, hour: number) {
109
- const dayStr = fmt(day)
110
- return props.events.filter((ev) => {
111
- const start = new Date(ev.start)
112
- const end = new Date(ev.end)
113
- const evDay = fmt(start)
114
- if (evDay !== dayStr) return false
115
- const evStartHour = start.getHours()
116
- const evEndHour = end.getHours() + (end.getMinutes() > 0 ? 1 : 0)
117
- return hour >= evStartHour && hour < evEndHour
118
- })
169
+ function openDay(d: Date) {
170
+ if (currentView.value === 'day') return
171
+ setDate(d)
172
+ setView('day')
119
173
  }
120
174
 
121
- function isEventStart(ev: SchedulerEvent, hour: number) {
122
- return new Date(ev.start).getHours() === hour
175
+ // ── Layout ────────────────────────────────────────────────────────────────────────────────────
176
+
177
+ const hours = computed(() => Array.from({ length: props.endHour - props.startHour }, (_, i) => props.startHour + i))
178
+ const gridStyle = computed(() => ({
179
+ gridTemplateColumns: `4rem repeat(${visibleDays.value.length}, ${currentView.value === 'week' ? 'minmax(5.5rem, 1fr)' : 'minmax(0, 1fr)'})`,
180
+ }))
181
+
182
+ /** Everything that doesn't fit in one day's time grid goes to the all-day row. */
183
+ function isBandEvent(ev: SchedulerEvent) {
184
+ if (ev.allDay) return true
185
+ const start = parse(ev.start)
186
+ const lastInstant = new Date(parse(ev.end).getTime() - 1)
187
+ return fmt(start) !== fmt(lastInstant)
123
188
  }
124
189
 
125
- function eventDuration(ev: SchedulerEvent) {
126
- const start = new Date(ev.start)
127
- const end = new Date(ev.end)
128
- return Math.max(1, Math.ceil((end.getTime() - start.getTime()) / 3600000))
190
+ interface Bar { event: SchedulerEvent; from: number; to: number; lane: number; clippedStart: boolean; clippedEnd: boolean }
191
+
192
+ const bars = computed<Bar[]>(() => {
193
+ const keys = visibleKeys.value
194
+ const first = keys[0]!
195
+ const last = keys[keys.length - 1]!
196
+ const placed: Bar[] = []
197
+ const laneEnds: number[] = []
198
+ const candidates = props.events
199
+ .filter(isBandEvent)
200
+ .map((event) => {
201
+ const startKey = fmt(parse(event.start))
202
+ const endKey = event.allDay ? fmt(parse(event.end)) : fmt(new Date(parse(event.end).getTime() - 1))
203
+ return { event, startKey, endKey }
204
+ })
205
+ .filter(({ startKey, endKey }) => endKey >= first && startKey <= last)
206
+ .sort((a, b) => a.startKey.localeCompare(b.startKey) || b.endKey.localeCompare(a.endKey))
207
+ for (const { event, startKey, endKey } of candidates) {
208
+ const from = startKey < first ? 0 : keys.indexOf(startKey)
209
+ const to = endKey > last ? keys.length - 1 : keys.indexOf(endKey)
210
+ let lane = laneEnds.findIndex((end) => end < from)
211
+ if (lane === -1) lane = laneEnds.length
212
+ laneEnds[lane] = to
213
+ placed.push({ event, from, to, lane, clippedStart: startKey < first, clippedEnd: endKey > last })
214
+ }
215
+ return placed
216
+ })
217
+ const laneCount = computed(() => bars.value.reduce((n, b) => Math.max(n, b.lane + 1), 0))
218
+
219
+ interface Block { event: SchedulerEvent; top: number; height: number; column: number; columns: number; minutes: number }
220
+
221
+ /** Timed events of one day, placed in side-by-side columns where they overlap. */
222
+ function blocksFor(day: Date): Block[] {
223
+ const key = fmt(day)
224
+ const lo = props.startHour * 60
225
+ const hi = props.endHour * 60
226
+ const items = props.events
227
+ .filter((ev) => !isBandEvent(ev) && fmt(parse(ev.start)) === key)
228
+ .map((event) => {
229
+ const s = parse(event.start)
230
+ const e = parse(event.end)
231
+ const startMin = s.getHours() * 60 + s.getMinutes()
232
+ const endMin = fmt(e) === key ? e.getHours() * 60 + e.getMinutes() : 24 * 60
233
+ return { event, startMin, endMin: Math.max(endMin, startMin + 15) }
234
+ })
235
+ .filter((it) => it.endMin > lo && it.startMin < hi)
236
+ .sort((a, b) => a.startMin - b.startMin || b.endMin - a.endMin)
237
+
238
+ const blocks: Block[] = []
239
+ let cluster: { item: (typeof items)[number]; column: number }[] = []
240
+ let clusterEnd = -1
241
+ const flush = () => {
242
+ const columns = cluster.reduce((n, c) => Math.max(n, c.column + 1), 0)
243
+ for (const { item, column } of cluster) {
244
+ const top = ((Math.max(item.startMin, lo) - lo) / 60) * props.hourHeight
245
+ const bottom = ((Math.min(item.endMin, hi) - lo) / 60) * props.hourHeight
246
+ blocks.push({ event: item.event, top, height: Math.max(bottom - top, 20), column, columns, minutes: item.endMin - item.startMin })
247
+ }
248
+ cluster = []
249
+ }
250
+ for (const item of items) {
251
+ if (item.startMin >= clusterEnd && cluster.length) flush()
252
+ const taken = new Set(cluster.filter((c) => c.item.endMin > item.startMin).map((c) => c.column))
253
+ let column = 0
254
+ while (taken.has(column)) column++
255
+ cluster.push({ item, column })
256
+ clusterEnd = Math.max(clusterEnd, item.endMin)
257
+ }
258
+ if (cluster.length) flush()
259
+ return blocks
129
260
  }
130
261
 
262
+ const nowTop = computed(() => {
263
+ const min = now.value.getHours() * 60 + now.value.getMinutes()
264
+ if (min < props.startHour * 60 || min >= props.endHour * 60) return null
265
+ return ((min - props.startHour * 60) / 60) * props.hourHeight
266
+ })
267
+
131
268
  function timeLabel(ev: SchedulerEvent) {
132
- const f = new Intl.DateTimeFormat(resolvedLocale.value, { hour: '2-digit', minute: '2-digit' })
133
- return `${f.format(new Date(ev.start))} – ${f.format(new Date(ev.end))}`
269
+ return `${timeFormat.value.format(parse(ev.start))} – ${timeFormat.value.format(parse(ev.end))}`
270
+ }
271
+
272
+ function onColumnClick(e: MouseEvent, day: Date) {
273
+ const rect = (e.currentTarget as HTMLElement).getBoundingClientRect()
274
+ const hour = Math.min(props.startHour + Math.floor((e.clientY - rect.top) / props.hourHeight), props.endHour - 1)
275
+ emit('slotClick', { date: fmt(day), hour: Math.max(hour, props.startHour) })
134
276
  }
135
277
 
136
278
  const eventColors: Record<string, string> = {
@@ -145,14 +287,14 @@ const eventColors: Record<string, string> = {
145
287
  <template>
146
288
  <div class="flex flex-col overflow-hidden rounded-lg border border-outline-variant">
147
289
  <!-- Header -->
148
- <div class="flex items-center justify-between border-b border-outline-variant bg-surface-container px-4 py-3">
290
+ <div class="flex flex-wrap items-center justify-between gap-2 border-b border-outline-variant bg-surface-container px-4 py-3">
149
291
  <div class="flex items-center gap-1">
150
292
  <MIconButton icon="chevron_left" :label="prevLabel ?? locale.previous" :size="36" @click="navigate(-1)" />
151
293
  <MIconButton icon="chevron_right" :label="nextLabel ?? locale.next" :size="36" @click="navigate(1)" />
152
294
  <button
153
295
  type="button"
154
296
  class="ml-2 cursor-pointer rounded-full border border-outline px-3 py-1 text-label-medium text-on-surface transition-colors hover:bg-on-surface/8"
155
- @click="goToday"
297
+ @click="setDate(new Date())"
156
298
  >
157
299
  {{ todayLabel ?? locale.today }}
158
300
  </button>
@@ -167,71 +309,117 @@ const eventColors: Record<string, string> = {
167
309
  type="button"
168
310
  class="cursor-pointer rounded-full px-3 py-1 text-label-medium transition-all duration-150"
169
311
  :class="currentView === v ? 'bg-secondary-container text-on-secondary-container shadow-elevation-1' : 'text-on-surface-variant hover:bg-on-surface/8'"
170
- @click="currentView = v"
312
+ @click="setView(v)"
171
313
  >
172
314
  {{ v === 'day' ? (dayViewLabel ?? locale.dayView) : (weekViewLabel ?? locale.weekView) }}
173
315
  </button>
174
316
  </div>
175
317
  </div>
176
318
 
177
- <!-- Grid -->
178
- <div class="overflow-auto">
179
- <table class="w-full border-collapse">
319
+ <div class="min-h-0 flex-1 overflow-auto">
320
+ <div class="min-w-fit">
180
321
  <!-- Day headers -->
181
- <thead>
182
- <tr>
183
- <th class="sticky top-0 z-10 w-16 border-b border-r border-outline-variant bg-surface-container p-2" />
184
- <th
185
- v-for="day in visibleDays"
186
- :key="fmt(day)"
187
- class="sticky top-0 z-10 border-b border-r border-outline-variant bg-surface-container px-2 py-2 text-center last:border-r-0"
188
- :class="fmt(day) === todayIso ? 'bg-primary-container/30' : ''"
322
+ <div class="sticky top-0 z-20 grid border-b border-outline-variant bg-surface-container" :style="gridStyle">
323
+ <div class="border-r border-outline-variant" />
324
+ <button
325
+ v-for="day in visibleDays"
326
+ :key="fmt(day)"
327
+ type="button"
328
+ class="border-r border-outline-variant px-2 py-2 text-center last:border-r-0"
329
+ :class="[fmt(day) === todayKey ? 'bg-primary-container/30' : '', currentView === 'week' ? 'cursor-pointer hover:bg-on-surface/8' : 'cursor-default']"
330
+ :tabindex="currentView === 'week' ? 0 : -1"
331
+ @click="openDay(day)"
332
+ >
333
+ <span class="block text-label-small uppercase text-on-surface-variant">{{ dayFormat.format(day) }}</span>
334
+ <span
335
+ class="mx-auto mt-0.5 flex h-8 w-8 items-center justify-center rounded-full text-title-medium"
336
+ :class="fmt(day) === todayKey ? 'bg-primary font-medium text-on-primary' : 'text-on-surface'"
337
+ >
338
+ {{ dateFormat.format(day) }}
339
+ </span>
340
+ </button>
341
+ </div>
342
+
343
+ <!-- All-day row: all-day events and events spanning several days -->
344
+ <div v-if="laneCount" class="grid border-b border-outline-variant" :style="gridStyle" data-scheduler-all-day>
345
+ <div class="flex items-start justify-end border-r border-outline-variant px-2 py-1.5 text-right text-label-small text-on-surface-variant">
346
+ {{ allDayLabel ?? locale.allDay }}
347
+ </div>
348
+ <div
349
+ class="grid gap-y-1 py-1"
350
+ :style="{ gridColumn: `2 / span ${visibleDays.length}`, gridTemplateColumns: `repeat(${visibleDays.length}, minmax(0, 1fr))`, gridTemplateRows: `repeat(${laneCount}, 1.5rem)` }"
351
+ >
352
+ <button
353
+ v-for="bar in bars"
354
+ :key="bar.event.id"
355
+ type="button"
356
+ class="mx-0.5 flex min-w-0 cursor-pointer items-center overflow-hidden border-l-[3px] px-2 text-left text-label-small font-medium transition-opacity hover:opacity-90"
357
+ :class="[eventColors[bar.event.color ?? 'primary'], bar.clippedStart ? 'rounded-r border-l-0' : 'rounded', bar.clippedEnd ? 'rounded-r-none' : '']"
358
+ :style="{ gridColumn: `${bar.from + 1} / ${bar.to + 2}`, gridRow: bar.lane + 1 }"
359
+ :aria-label="bar.event.title"
360
+ data-scheduler-bar
361
+ @click="emit('eventClick', bar.event)"
189
362
  >
190
- <div class="text-label-small uppercase text-on-surface-variant">{{ dayFormat.format(day) }}</div>
191
- <div
192
- class="mx-auto mt-0.5 flex h-8 w-8 items-center justify-center rounded-full text-title-medium"
193
- :class="fmt(day) === todayIso ? 'bg-primary text-on-primary font-medium' : 'text-on-surface'"
194
- >
195
- {{ dateFormat.format(day) }}
196
- </div>
197
- </th>
198
- </tr>
199
- </thead>
200
-
201
- <tbody>
202
- <tr v-for="hour in hours" :key="hour">
203
- <!-- Hour label -->
204
- <td class="w-16 border-r border-b border-outline-variant/50 p-0 pr-2 text-right align-top">
205
- <span class="relative -top-2.5 text-label-small text-on-surface-variant">
206
- {{ String(hour).padStart(2, '0') }}:00
207
- </span>
208
- </td>
209
-
210
- <!-- Day cells -->
211
- <td
212
- v-for="day in visibleDays"
213
- :key="fmt(day)"
214
- class="relative h-14 border-r border-b border-outline-variant/50 p-0 last:border-r-0"
215
- :class="fmt(day) === todayIso ? 'bg-primary-container/5' : ''"
216
- @click="emit('slotClick', { date: fmt(day), hour })"
363
+ <slot name="event" :event="bar.event" :all-day="true">
364
+ <span v-if="bar.clippedStart" aria-hidden="true" class="mr-1">‹</span>
365
+ <span class="truncate">{{ bar.event.title }}</span>
366
+ <span v-if="bar.clippedEnd" aria-hidden="true" class="ml-auto pl-1">›</span>
367
+ </slot>
368
+ </button>
369
+ </div>
370
+ </div>
371
+
372
+ <!-- Time grid -->
373
+ <div class="grid" :style="gridStyle">
374
+ <div class="border-r border-outline-variant">
375
+ <div v-for="hour in hours" :key="hour" class="relative pr-2 text-right" :style="{ height: `${hourHeight}px` }">
376
+ <span v-if="hour !== startHour" class="relative -top-2 text-label-small text-on-surface-variant">{{ String(hour).padStart(2, '0') }}:00</span>
377
+ </div>
378
+ </div>
379
+
380
+ <div
381
+ v-for="day in visibleDays"
382
+ :key="fmt(day)"
383
+ class="relative cursor-pointer border-r border-outline-variant/50 last:border-r-0"
384
+ :class="fmt(day) === todayKey ? 'bg-primary-container/5' : ''"
385
+ :data-scheduler-day="fmt(day)"
386
+ @click="onColumnClick($event, day)"
387
+ >
388
+ <div v-for="hour in hours" :key="hour" class="border-b border-outline-variant/50" :style="{ height: `${hourHeight}px` }" />
389
+
390
+ <button
391
+ v-for="b in blocksFor(day)"
392
+ :key="b.event.id"
393
+ type="button"
394
+ class="absolute z-5 cursor-pointer overflow-hidden rounded border-l-[3px] px-2 py-1 text-left transition-opacity hover:opacity-90"
395
+ :class="eventColors[b.event.color ?? 'primary']"
396
+ :style="{
397
+ top: `${b.top + 1}px`,
398
+ height: `${b.height - 2}px`,
399
+ left: `calc(${(b.column / b.columns) * 100}% + 2px)`,
400
+ width: `calc(${100 / b.columns}% - 4px)`,
401
+ }"
402
+ :aria-label="`${b.event.title}, ${timeLabel(b.event)}`"
403
+ data-scheduler-event
404
+ @click.stop="emit('eventClick', b.event)"
217
405
  >
218
- <template v-for="ev in eventsForDayHour(day, hour)" :key="ev.id">
219
- <button
220
- v-if="isEventStart(ev, hour)"
221
- type="button"
222
- class="absolute inset-x-0.5 top-0.5 z-5 cursor-pointer overflow-hidden rounded border-l-[3px] px-2 py-1 text-left transition-opacity hover:opacity-90"
223
- :class="eventColors[ev.color ?? 'primary']"
224
- :style="{ height: `calc(${eventDuration(ev) * 100}% - 4px)` }"
225
- @click.stop="emit('eventClick', ev)"
226
- >
227
- <p class="truncate text-label-small font-medium">{{ ev.title }}</p>
228
- <p class="truncate text-label-small opacity-70">{{ timeLabel(ev) }}</p>
229
- </button>
230
- </template>
231
- </td>
232
- </tr>
233
- </tbody>
234
- </table>
406
+ <slot name="event" :event="b.event" :all-day="false">
407
+ <p class="truncate text-label-small font-medium">{{ b.event.title }}</p>
408
+ <p v-if="b.minutes >= 45" class="truncate text-label-small opacity-70">{{ timeLabel(b.event) }}</p>
409
+ </slot>
410
+ </button>
411
+
412
+ <div
413
+ v-if="nowIndicator && fmt(day) === todayKey && nowTop !== null"
414
+ class="pointer-events-none absolute inset-x-0 z-10 h-0.5 bg-error"
415
+ :style="{ top: `${nowTop}px` }"
416
+ data-scheduler-now
417
+ >
418
+ <span class="absolute -top-1 -left-1 h-2.5 w-2.5 rounded-full bg-error" />
419
+ </div>
420
+ </div>
421
+ </div>
422
+ </div>
235
423
  </div>
236
424
  </div>
237
425
  </template>
@@ -1,10 +1,18 @@
1
1
  <script setup lang="ts">
2
+ /**
3
+ * A constrained scroll area — vertical, horizontal, or both directions.
4
+ *
5
+ * @slot default The scrolling content.
6
+ */
2
7
  import { computed } from 'vue'
3
8
 
4
9
  const props = withDefaults(
5
10
  defineProps<{
11
+ /** Scroll direction */
6
12
  direction?: 'vertical' | 'horizontal' | 'both'
13
+ /** Fixed height (CSS value) */
7
14
  height?: string
15
+ /** Maximum height (CSS value) */
8
16
  maxHeight?: string
9
17
  }>(),
10
18
  { direction: 'vertical' },
@@ -1,4 +1,15 @@
1
1
  <script setup lang="ts">
2
+ /**
3
+ * A collapsed search field that expands into a docked panel or a fullscreen overlay, with results shown below
4
+ * the input.
5
+ *
6
+ * @slot leading Overrides the collapsed bar's leading icon
7
+ * @slot trailing Trailing content in both the collapsed bar and the expanded header (e.g. an avatar)
8
+ * @slot default Results/suggestions content, shown below the input while expanded
9
+ * @event update:modelValue Emitted on every input change — powers v-model
10
+ * @event search Emitted when Enter is pressed in the input, with the current query
11
+ * @event update:expanded Emitted when the expanded state changes — powers v-model:expanded
12
+ */
2
13
  import { computed, ref, watch, onMounted, onUnmounted, nextTick, useId } from 'vue'
3
14
  import MIcon from './MIcon.vue'
4
15
  import MIconButton from './MIconButton.vue'
@@ -11,14 +22,17 @@ defineOptions({ inheritAttrs: false })
11
22
 
12
23
  const props = withDefaults(
13
24
  defineProps<{
25
+ /** Search query (v-model) */
14
26
  modelValue?: string
15
27
  /** Controls the expanded/collapsed state — also works uncontrolled if omitted. */
16
28
  expanded?: boolean
29
+ /** Defaults to the locale's "Search..." */
17
30
  placeholder?: string
18
31
  /** 'docked' grows into a rounded panel anchored below the bar (default).
19
32
  * 'fullscreen' takes over the whole viewport, matching M3's mobile
20
33
  * search pattern — the leading icon becomes a back button either way. */
21
34
  variant?: 'docked' | 'fullscreen'
35
+ /** Icon shown in the collapsed bar */
22
36
  leadingIcon?: string
23
37
  /** Which side of the *collapsed* bar the leading icon sits on. The
24
38
  * expanded panel's back button always stays at the start regardless —
@@ -27,8 +41,11 @@ const props = withDefaults(
27
41
  /** Centers the input/placeholder text instead of the M3-standard start
28
42
  * alignment (an iOS-style look some apps use for the collapsed bar). */
29
43
  textAlign?: 'start' | 'center'
44
+ /** Shows a spinner in the expanded header instead of the clear button */
30
45
  loading?: boolean
46
+ /** Shows a clear (×) button once there is a query */
31
47
  clearable?: boolean
48
+ /** Disables the collapsed bar */
32
49
  disabled?: boolean
33
50
  }>(),
34
51
  {
@@ -1,13 +1,26 @@
1
1
  <script setup lang="ts">
2
+ /**
3
+ * A titled content section with optional subtitle, header actions, and divider.
4
+ *
5
+ * @slot title Custom title content (overrides title prop)
6
+ * @slot subtitle Custom subtitle content (overrides subtitle prop)
7
+ * @slot actions Action buttons displayed in the header row
8
+ * @slot default Main section content
9
+ */
2
10
  import { computed } from 'vue'
3
11
  import type { TextVariant } from './MText.vue'
4
12
 
5
13
  const props = withDefaults(
6
14
  defineProps<{
15
+ /** Section title text */
7
16
  title?: string
17
+ /** Section subtitle text */
8
18
  subtitle?: string
19
+ /** Show divider below header */
9
20
  divider?: boolean
21
+ /** Gap between header and content */
10
22
  gap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'
23
+ /** Typography variant for the title */
11
24
  titleVariant?: TextVariant
12
25
  }>(),
13
26
  { gap: 'md', divider: false, titleVariant: 'title-large' },
@@ -1,4 +1,9 @@
1
1
  <script setup lang="ts">
2
+ /**
3
+ * A row of joined segments for choosing between a small set of related options — single or multi select.
4
+ *
5
+ * @event update:modelValue Emitted on selection change — powers v-model
6
+ */
2
7
  import MIcon from './MIcon.vue'
3
8
 
4
9
  export interface SegmentedOption {
@@ -9,10 +14,15 @@ export interface SegmentedOption {
9
14
  }
10
15
 
11
16
  withDefaults(defineProps<{
17
+ /** Selected value(s) */
12
18
  modelValue: string | number | (string | number)[]
19
+ /** The options to choose from; see `SegmentedOption`. */
13
20
  options: SegmentedOption[]
21
+ /** Allow multiple selections */
14
22
  multiSelect?: boolean
23
+ /** Button density */
15
24
  density?: 'default' | 'comfortable' | 'compact'
25
+ /** Selected segment color */
16
26
  color?: 'primary' | 'secondary' | 'tertiary'
17
27
  }>(), { multiSelect: false, density: 'default', color: 'primary' })
18
28