@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.
- package/README.md +25 -5
- package/dist/API.md +3661 -0
- package/dist/MIcon-CaEooCmZ.js.map +1 -1
- package/dist/{MMenuItem-5xojJYAL.js → MTextField-pJU1vFaR.js} +374 -364
- package/dist/MTextField-pJU1vFaR.js.map +1 -0
- package/dist/api.json +1 -0
- package/dist/barcode.js +9 -11
- package/dist/barcode.js.map +1 -1
- package/dist/chart.js.map +1 -1
- package/dist/code-editor.js +2 -2
- package/dist/code-editor.js.map +1 -1
- package/dist/components/MAbsolute.vue.d.ts +12 -0
- package/dist/components/MAlert.vue.d.ts +4 -0
- package/dist/components/MAppBar.vue.d.ts +12 -0
- package/dist/components/MAppLayout.vue.d.ts +2 -0
- package/dist/components/MAspectRatio.vue.d.ts +1 -0
- package/dist/components/MAutocomplete.vue.d.ts +18 -0
- package/dist/components/MAvatar.vue.d.ts +3 -0
- package/dist/components/MBadge.vue.d.ts +6 -0
- package/dist/components/MBar.vue.d.ts +5 -0
- package/dist/components/MBarcode.vue.d.ts +9 -0
- package/dist/components/MBottomSheet.vue.d.ts +3 -0
- package/dist/components/MBox.vue.d.ts +6 -0
- package/dist/components/MBreadcrumbs.vue.d.ts +2 -0
- package/dist/components/MButton.vue.d.ts +14 -4
- package/dist/components/MButtonGroup.vue.d.ts +7 -0
- package/dist/components/MCalendar.vue.d.ts +8 -0
- package/dist/components/MCard.vue.d.ts +17 -0
- package/dist/components/MCarousel.vue.d.ts +61 -36
- package/dist/components/MCenter.vue.d.ts +1 -0
- package/dist/components/MChart.vue.d.ts +7 -0
- package/dist/components/MChatBubble.vue.d.ts +10 -0
- package/dist/components/MCheckbox.vue.d.ts +5 -0
- package/dist/components/MChip.vue.d.ts +9 -0
- package/dist/components/MCircleProgressBar.vue.d.ts +7 -0
- package/dist/components/MCodeEditor.vue.d.ts +9 -0
- package/dist/components/MColorPicker.vue.d.ts +8 -0
- package/dist/components/MColorPickerModal.vue.d.ts +4 -0
- package/dist/components/MCommandPalette.vue.d.ts +8 -0
- package/dist/components/MConfirmDialog.vue.d.ts +7 -0
- package/dist/components/MContainer.vue.d.ts +4 -0
- package/dist/components/MContextMenu.vue.d.ts +3 -6
- package/dist/components/MCopyButton.vue.d.ts +10 -0
- package/dist/components/MDataTable.vue.d.ts +33 -12
- package/dist/components/MDatePicker.vue.d.ts +16 -0
- package/dist/components/MDatePickerModal.vue.d.ts +9 -0
- package/dist/components/MDateRangePicker.vue.d.ts +18 -0
- package/dist/components/MDateRangePickerModal.vue.d.ts +9 -0
- package/dist/components/MDialog.vue.d.ts +10 -6
- package/dist/components/MDivider.vue.d.ts +6 -0
- package/dist/components/MDragDropList.vue.d.ts +6 -0
- package/dist/components/MEmoji.vue.d.ts +6 -0
- package/dist/components/MEmojiButton.vue.d.ts +5 -0
- package/dist/components/MEmojiSelector.vue.d.ts +21 -5
- package/dist/components/MEmptyState.vue.d.ts +4 -0
- package/dist/components/MExpansionPanel.vue.d.ts +9 -0
- package/dist/components/MExportButton.vue.d.ts +8 -0
- package/dist/components/MFab.vue.d.ts +9 -0
- package/dist/components/MFabMenu.vue.d.ts +15 -1
- package/dist/components/MFileUpload.vue.d.ts +8 -0
- package/dist/components/MFixed.vue.d.ts +10 -0
- package/dist/components/MFlex.vue.d.ts +7 -1
- package/dist/components/MFooter.vue.d.ts +11 -0
- package/dist/components/MFullscreen.vue.d.ts +2 -0
- package/dist/components/MGrid.vue.d.ts +7 -0
- package/dist/components/MHotkeys.vue.d.ts +4 -0
- package/dist/components/MIcon.vue.d.ts +2 -0
- package/dist/components/MIconButton.vue.d.ts +10 -0
- package/dist/components/MInfiniteScroll.vue.d.ts +6 -0
- package/dist/components/MJsonEditor.vue.d.ts +8 -0
- package/dist/components/MJsonViewer.vue.d.ts +4 -0
- package/dist/components/MKanban.vue.d.ts +2 -0
- package/dist/components/MKbd.vue.d.ts +2 -0
- package/dist/components/MLightbox.vue.d.ts +19 -5
- package/dist/components/MList.vue.d.ts +7 -0
- package/dist/components/MListItem.vue.d.ts +24 -0
- package/dist/components/MListSubheader.vue.d.ts +6 -0
- package/dist/components/MLoadingIndicator.vue.d.ts +10 -0
- package/dist/components/MLoadingOverlay.vue.d.ts +5 -0
- package/dist/components/MMarkdown.vue.d.ts +3 -0
- package/dist/components/MMaskField.vue.d.ts +15 -0
- package/dist/components/MMasonry.vue.d.ts +5 -0
- package/dist/components/MMenu.vue.d.ts +3 -6
- package/dist/components/MMenuDivider.vue.d.ts +4 -0
- package/dist/components/MMenuItem.vue.d.ts +5 -0
- package/dist/components/MMultiAutocomplete.vue.d.ts +20 -0
- package/dist/components/MMultiSelect.vue.d.ts +21 -0
- package/dist/components/MNavigationBar.vue.d.ts +2 -0
- package/dist/components/MNavigationDrawer.vue.d.ts +11 -0
- package/dist/components/MNavigationRail.vue.d.ts +9 -6
- package/dist/components/MNavigationSuite.vue.d.ts +5 -3
- package/dist/components/MNumberField.vue.d.ts +17 -0
- package/dist/components/MOverlay.vue.d.ts +3 -0
- package/dist/components/MPageProgress.vue.d.ts +3 -0
- package/dist/components/MPagination.vue.d.ts +3 -0
- package/dist/components/MPasswordMeter.vue.d.ts +1 -0
- package/dist/components/MPinInput.vue.d.ts +11 -0
- package/dist/components/MProgressBar.vue.d.ts +6 -0
- package/dist/components/MPullToRefresh.vue.d.ts +8 -0
- package/dist/components/MQRCode.vue.d.ts +6 -0
- package/dist/components/MRadio.vue.d.ts +5 -0
- package/dist/components/MRadioGroup.vue.d.ts +6 -0
- package/dist/components/MRating.vue.d.ts +11 -0
- package/dist/components/MRelativeTime.vue.d.ts +1 -0
- package/dist/components/MResponsive.vue.d.ts +3 -0
- package/dist/components/MResult.vue.d.ts +6 -0
- package/dist/components/MRichTextEditor.vue.d.ts +8 -0
- package/dist/components/MScheduler.vue.d.ts +48 -1
- package/dist/components/MScrollable.vue.d.ts +3 -0
- package/dist/components/MSearchBar.vue.d.ts +6 -0
- package/dist/components/MSection.vue.d.ts +5 -0
- package/dist/components/MSegmentedButton.vue.d.ts +5 -0
- package/dist/components/MSelect.vue.d.ts +17 -0
- package/dist/components/MShader.vue.d.ts +1 -0
- package/dist/components/MShape.vue.d.ts +1 -1
- package/dist/components/MShortNavigationBar.vue.d.ts +8 -9
- package/dist/components/MSideSheet.vue.d.ts +3 -0
- package/dist/components/MSignaturePad.vue.d.ts +7 -0
- package/dist/components/MSimpleCarousel.vue.d.ts +12 -2
- package/dist/components/MSkeleton.vue.d.ts +8 -0
- package/dist/components/MSlider.vue.d.ts +15 -1
- package/dist/components/MSnackbar.vue.d.ts +1 -0
- package/dist/components/MSpinner.vue.d.ts +6 -0
- package/dist/components/MSplitButton.vue.d.ts +7 -0
- package/dist/components/MSplitter.vue.d.ts +4 -0
- package/dist/components/MSpotlightSearch.vue.d.ts +18 -0
- package/dist/components/MStack.vue.d.ts +8 -1
- package/dist/components/MStatCard.vue.d.ts +7 -0
- package/dist/components/MStepper.vue.d.ts +7 -0
- package/dist/components/MSticky.vue.d.ts +2 -0
- package/dist/components/MSubtitle.vue.d.ts +4 -0
- package/dist/components/MSwitch.vue.d.ts +5 -6
- package/dist/components/MTable.vue.d.ts +17 -4
- package/dist/components/MTabs.vue.d.ts +6 -0
- package/dist/components/MTagInput.vue.d.ts +17 -0
- package/dist/components/MTerminal.vue.d.ts +4 -0
- package/dist/components/MText.vue.d.ts +10 -0
- package/dist/components/MTextField.vue.d.ts +18 -0
- package/dist/components/MTimePicker.vue.d.ts +10 -0
- package/dist/components/MTimePickerModal.vue.d.ts +5 -0
- package/dist/components/MTimeline.vue.d.ts +3 -0
- package/dist/components/MTitle.vue.d.ts +4 -0
- package/dist/components/MToggleButton.vue.d.ts +4 -0
- package/dist/components/MToolbar.vue.d.ts +6 -1
- package/dist/components/MTooltip.vue.d.ts +7 -0
- package/dist/components/MTopAppBar.vue.d.ts +8 -0
- package/dist/components/MTour.vue.d.ts +5 -0
- package/dist/components/MTransferList.vue.d.ts +11 -0
- package/dist/components/MTree.vue.d.ts +11 -0
- package/dist/components/MTreeTable.vue.d.ts +7 -0
- package/dist/components/MVirtualTable.vue.d.ts +6 -0
- package/dist/components/MWindow.vue.d.ts +33 -1
- package/dist/composables/_carouselStrategy.d.ts +101 -0
- package/dist/composables/useLocale.d.ts +21 -0
- package/dist/data/emoji-names/emoji-names-de.d.ts +2 -0
- package/dist/data/emoji-names/emoji-names-en.d.ts +2 -0
- package/dist/data/emoji-names/emoji-names-es.d.ts +2 -0
- package/dist/data/emoji-names/emoji-names-fr.d.ts +2 -0
- package/dist/data/emoji-names/emoji-names-ja.d.ts +2 -0
- package/dist/data/emoji-names/emoji-names-ko.d.ts +2 -0
- package/dist/data/emoji-names/emoji-names-pt.d.ts +2 -0
- package/dist/data/emoji-names/emoji-names-zh.d.ts +2 -0
- package/dist/data/emojis.d.ts +7 -1
- package/dist/emoji-names-de-BphO5XpV.js +1877 -0
- package/dist/emoji-names-de-BphO5XpV.js.map +1 -0
- package/dist/emoji-names-en-9ZvMRvzi.js +1877 -0
- package/dist/emoji-names-en-9ZvMRvzi.js.map +1 -0
- package/dist/emoji-names-es-DvfWU3Pj.js +1877 -0
- package/dist/emoji-names-es-DvfWU3Pj.js.map +1 -0
- package/dist/emoji-names-fr-B-jhUlsP.js +1877 -0
- package/dist/emoji-names-fr-B-jhUlsP.js.map +1 -0
- package/dist/emoji-names-ja-l8cMFJo1.js +1877 -0
- package/dist/emoji-names-ja-l8cMFJo1.js.map +1 -0
- package/dist/emoji-names-ko-YP-o9G0c.js +1877 -0
- package/dist/emoji-names-ko-YP-o9G0c.js.map +1 -0
- package/dist/emoji-names-pt-DGj_Js4M.js +1877 -0
- package/dist/emoji-names-pt-DGj_Js4M.js.map +1 -0
- package/dist/emoji-names-zh-Dzecwtw_.js +1877 -0
- package/dist/emoji-names-zh-Dzecwtw_.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/locales/index.js +140 -7
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +6642 -5160
- package/dist/m3ui.js.map +1 -1
- package/dist/markdown.js +1 -1
- package/dist/markdown.js.map +1 -1
- package/dist/plugin.d.ts +6 -0
- package/dist/qrcode.js.map +1 -1
- package/dist/rich-text-editor.js +10 -10
- package/dist/rich-text-editor.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/terminal.js +34 -27
- package/dist/terminal.js.map +1 -1
- package/dist/{useLocale-D3ZWZ8jY.js → useLocale-Drihe5G2.js} +33 -11
- package/dist/useLocale-Drihe5G2.js.map +1 -0
- package/package.json +4 -2
- package/src/__tests__/MCarousel.test.ts +183 -21
- package/src/__tests__/MDialog.test.ts +18 -0
- package/src/__tests__/MEmojiSelector.test.ts +138 -0
- package/src/__tests__/MHotkeys.test.ts +57 -0
- package/src/__tests__/MLightbox.test.ts +313 -5
- package/src/__tests__/MScheduler.test.ts +122 -0
- package/src/__tests__/MTerminal.test.ts +63 -0
- package/src/__tests__/attrsFallthrough.test.ts +65 -0
- package/src/__tests__/hostLocale.test.ts +57 -0
- package/src/__tests__/plugin.test.ts +28 -1
- package/src/components/MAbsolute.vue +18 -0
- package/src/components/MAlert.vue +12 -0
- package/src/components/MAppBar.vue +12 -0
- package/src/components/MAppLayout.vue +11 -0
- package/src/components/MAspectRatio.vue +6 -0
- package/src/components/MAutocomplete.vue +24 -0
- package/src/components/MAvatar.vue +12 -1
- package/src/components/MBadge.vue +11 -0
- package/src/components/MBar.vue +19 -0
- package/src/components/MBarcode.vue +18 -2
- package/src/components/MBottomSheet.vue +13 -1
- package/src/components/MBox.vue +12 -0
- package/src/components/MBreadcrumbs.vue +7 -0
- package/src/components/MButton.vue +22 -4
- package/src/components/MButtonGroup.vue +13 -0
- package/src/components/MCalendar.vue +14 -0
- package/src/components/MCard.vue +26 -0
- package/src/components/MCarousel.vue +542 -200
- package/src/components/MCenter.vue +6 -0
- package/src/components/MChart.vue +12 -0
- package/src/components/MChatBubble.vue +17 -0
- package/src/components/MCheckbox.vue +11 -0
- package/src/components/MChip.vue +17 -0
- package/src/components/MCircleProgressBar.vue +13 -0
- package/src/components/MCodeEditor.vue +18 -2
- package/src/components/MColorPicker.vue +13 -0
- package/src/components/MColorPickerModal.vue +12 -0
- package/src/components/MCommandPalette.vue +17 -1
- package/src/components/MConfirmDialog.vue +15 -0
- package/src/components/MContainer.vue +9 -0
- package/src/components/MContextMenu.vue +20 -7
- package/src/components/MCopyButton.vue +16 -0
- package/src/components/MDataTable.vue +58 -12
- package/src/components/MDatePicker.vue +21 -0
- package/src/components/MDatePickerModal.vue +17 -1
- package/src/components/MDateRangePicker.vue +23 -0
- package/src/components/MDateRangePickerModal.vue +17 -1
- package/src/components/MDialog.vue +43 -10
- package/src/components/MDivider.vue +6 -0
- package/src/components/MDragDropList.vue +18 -0
- package/src/components/MEmoji.vue +6 -0
- package/src/components/MEmojiButton.vue +11 -0
- package/src/components/MEmojiSelector.vue +486 -78
- package/src/components/MEmptyState.vue +9 -0
- package/src/components/MExpansionPanel.vue +17 -0
- package/src/components/MExportButton.vue +15 -0
- package/src/components/MFab.vue +20 -1
- package/src/components/MFabMenu.vue +20 -0
- package/src/components/MFileUpload.vue +19 -0
- package/src/components/MFixed.vue +16 -0
- package/src/components/MFlex.vue +11 -0
- package/src/components/MFooter.vue +11 -0
- package/src/components/MFullscreen.vue +8 -0
- package/src/components/MGrid.vue +12 -0
- package/src/components/MHotkeys.vue +20 -13
- package/src/components/MIcon.vue +10 -1
- package/src/components/MIconButton.vue +13 -0
- package/src/components/MInfiniteScroll.vue +16 -0
- package/src/components/MJsonEditor.vue +13 -0
- package/src/components/MJsonViewer.vue +7 -0
- package/src/components/MKanban.vue +18 -0
- package/src/components/MKbd.vue +6 -0
- package/src/components/MLightbox.vue +766 -268
- package/src/components/MList.vue +15 -0
- package/src/components/MListDetail.vue +11 -0
- package/src/components/MListItem.vue +37 -0
- package/src/components/MListSubheader.vue +6 -0
- package/src/components/MLoadingIndicator.vue +15 -0
- package/src/components/MLoadingOverlay.vue +18 -1
- package/src/components/MMarkdown.vue +7 -0
- package/src/components/MMaskField.vue +21 -0
- package/src/components/MMasonry.vue +11 -0
- package/src/components/MMenu.vue +19 -7
- package/src/components/MMenuDivider.vue +4 -0
- package/src/components/MMenuItem.vue +16 -0
- package/src/components/MMultiAutocomplete.vue +26 -0
- package/src/components/MMultiSelect.vue +27 -0
- package/src/components/MNavigationBar.vue +7 -0
- package/src/components/MNavigationDrawer.vue +30 -1
- package/src/components/MNavigationRail.vue +27 -6
- package/src/components/MNavigationSuite.vue +20 -3
- package/src/components/MNotificationHost.vue +3 -0
- package/src/components/MNumberField.vue +24 -0
- package/src/components/MOverlay.vue +11 -0
- package/src/components/MPageProgress.vue +7 -0
- package/src/components/MPagination.vue +15 -1
- package/src/components/MPasswordMeter.vue +7 -0
- package/src/components/MPinInput.vue +19 -0
- package/src/components/MProgressBar.vue +9 -0
- package/src/components/MPullToRefresh.vue +17 -0
- package/src/components/MQRCode.vue +12 -0
- package/src/components/MRadio.vue +11 -0
- package/src/components/MRadioGroup.vue +11 -0
- package/src/components/MRating.vue +19 -0
- package/src/components/MRelative.vue +8 -0
- package/src/components/MRelativeTime.vue +6 -0
- package/src/components/MResponsive.vue +9 -0
- package/src/components/MResult.vue +14 -0
- package/src/components/MRichTextEditor.vue +14 -0
- package/src/components/MScheduler.vue +303 -115
- package/src/components/MScrollable.vue +8 -0
- package/src/components/MSearchBar.vue +17 -0
- package/src/components/MSection.vue +13 -0
- package/src/components/MSegmentedButton.vue +10 -0
- package/src/components/MSelect.vue +22 -0
- package/src/components/MShader.vue +13 -0
- package/src/components/MShape.vue +6 -0
- package/src/components/MShortNavigationBar.vue +23 -9
- package/src/components/MSideSheet.vue +14 -1
- package/src/components/MSignaturePad.vue +15 -0
- package/src/components/MSimpleCarousel.vue +18 -0
- package/src/components/MSkeleton.vue +8 -0
- package/src/components/MSlider.vue +21 -0
- package/src/components/MSnackbar.vue +5 -0
- package/src/components/MSpacer.vue +6 -0
- package/src/components/MSpinner.vue +10 -0
- package/src/components/MSplitButton.vue +17 -1
- package/src/components/MSplitter.vue +10 -0
- package/src/components/MSpotlightSearch.vue +28 -1
- package/src/components/MStack.vue +12 -0
- package/src/components/MStatCard.vue +13 -0
- package/src/components/MStepper.vue +12 -0
- package/src/components/MSticky.vue +7 -0
- package/src/components/MSubtitle.vue +9 -0
- package/src/components/MSupportingPane.vue +10 -0
- package/src/components/MSwitch.vue +14 -6
- package/src/components/MTable.vue +33 -4
- package/src/components/MTabs.vue +12 -0
- package/src/components/MTagInput.vue +23 -0
- package/src/components/MTerminal.vue +33 -10
- package/src/components/MText.vue +15 -0
- package/src/components/MTextField.vue +26 -0
- package/src/components/MTimePicker.vue +15 -0
- package/src/components/MTimePickerModal.vue +13 -1
- package/src/components/MTimeline.vue +7 -0
- package/src/components/MTitle.vue +9 -0
- package/src/components/MToggleButton.vue +12 -0
- package/src/components/MToolbar.vue +12 -0
- package/src/components/MTooltip.vue +18 -0
- package/src/components/MTopAppBar.vue +18 -0
- package/src/components/MTour.vue +15 -2
- package/src/components/MTransferList.vue +24 -0
- package/src/components/MTree.vue +11 -0
- package/src/components/MTreeTable.vue +15 -0
- package/src/components/MVirtualTable.vue +12 -0
- package/src/components/MWindow.vue +34 -0
- package/src/composables/_carouselStrategy.ts +712 -0
- package/src/composables/useLocale.ts +54 -3
- package/src/data/emoji-names/emoji-names-de.ts +1875 -0
- package/src/data/emoji-names/emoji-names-en.ts +1875 -0
- package/src/data/emoji-names/emoji-names-es.ts +1875 -0
- package/src/data/emoji-names/emoji-names-fr.ts +1875 -0
- package/src/data/emoji-names/emoji-names-ja.ts +1875 -0
- package/src/data/emoji-names/emoji-names-ko.ts +1875 -0
- package/src/data/emoji-names/emoji-names-pt.ts +1875 -0
- package/src/data/emoji-names/emoji-names-zh.ts +1875 -0
- package/src/data/emojis.ts +29 -198
- package/src/index.ts +2 -2
- package/src/locales/de.ts +19 -0
- package/src/locales/es.ts +19 -0
- package/src/locales/fr.ts +19 -0
- package/src/locales/ja.ts +19 -0
- package/src/locales/ko.ts +19 -0
- package/src/locales/pt.ts +19 -0
- package/src/locales/zh.ts +19 -0
- package/src/plugin.ts +14 -2
- package/dist/MMenuItem-5xojJYAL.js.map +0 -1
- package/dist/useLocale-D3ZWZ8jY.js.map +0 -1
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Centers its children both horizontally and vertically.
|
|
4
|
+
*
|
|
5
|
+
* @slot default Content, centered.
|
|
6
|
+
*/
|
|
2
7
|
import { computed } from 'vue'
|
|
3
8
|
|
|
4
9
|
const props = withDefaults(
|
|
5
10
|
defineProps<{
|
|
11
|
+
/** Use inline-flex instead of flex */
|
|
6
12
|
inline?: boolean
|
|
7
13
|
}>(),
|
|
8
14
|
{ inline: false },
|
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A thin Chart.js wrapper — line, bar, pie, doughnut, and radar types, with legend/tooltip/axis colors that
|
|
4
|
+
* automatically track the active M3 theme (light/dark, and any palette swap). Available from the `/chart` entry
|
|
5
|
+
* point.
|
|
6
|
+
*/
|
|
2
7
|
import { computed, ref, watch, onMounted, onBeforeUnmount, shallowRef, type Component } from 'vue'
|
|
3
8
|
|
|
4
9
|
type ChartType = 'line' | 'bar' | 'pie' | 'doughnut' | 'radar'
|
|
5
10
|
|
|
6
11
|
const props = withDefaults(
|
|
7
12
|
defineProps<{
|
|
13
|
+
/** Chart type. Required — there is no default. */
|
|
8
14
|
type: ChartType
|
|
15
|
+
/** Chart.js data object with labels and datasets. Required — there is no default. */
|
|
9
16
|
data: Record<string, any>
|
|
17
|
+
/**
|
|
18
|
+
* Chart.js options, deep-merged on top of MChart's own M3-themed defaults (legend/tooltip/axis colors that
|
|
19
|
+
* track the active theme automatically)
|
|
20
|
+
*/
|
|
10
21
|
options?: Record<string, any>
|
|
22
|
+
/** Chart height */
|
|
11
23
|
height?: string
|
|
12
24
|
}>(),
|
|
13
25
|
{ height: '300px' },
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A chat message bubble — sender name, avatar, timestamp, and read status, for left (received) or right (sent)
|
|
4
|
+
* messages.
|
|
5
|
+
*
|
|
6
|
+
* @slot default Custom content inside the bubble, replacing the text prop — images, files, buttons, or any
|
|
7
|
+
* layout
|
|
8
|
+
*/
|
|
2
9
|
import { computed } from 'vue'
|
|
3
10
|
import MAvatar from './MAvatar.vue'
|
|
4
11
|
import MIcon from './MIcon.vue'
|
|
@@ -6,15 +13,25 @@ import { useLocale } from '../composables/useLocale'
|
|
|
6
13
|
|
|
7
14
|
const props = withDefaults(
|
|
8
15
|
defineProps<{
|
|
16
|
+
/** Message text (or use the default slot for custom content) */
|
|
9
17
|
text?: string
|
|
18
|
+
/** Sender name shown above the bubble (left-side only) */
|
|
10
19
|
sender?: string
|
|
20
|
+
/** Timestamp string (e.g. "10:32") */
|
|
11
21
|
time?: string
|
|
22
|
+
/** Left = received, right = sent */
|
|
12
23
|
side?: 'left' | 'right'
|
|
24
|
+
/** Avatar name — shows an MAvatar with these initials (left-side only) */
|
|
13
25
|
avatar?: string
|
|
26
|
+
/** Message status icon next to the timestamp (right-side only) */
|
|
14
27
|
status?: 'sent' | 'delivered' | 'read'
|
|
28
|
+
/** Bubble color for sent (right-side) messages */
|
|
15
29
|
color?: 'primary' | 'secondary' | 'tertiary'
|
|
30
|
+
/** Show the bubble tail (a sharper corner on the side nearest the sender) */
|
|
16
31
|
tail?: boolean
|
|
32
|
+
/** Text size (body-small / body-medium / body-large) */
|
|
17
33
|
size?: 'small' | 'medium' | 'large'
|
|
34
|
+
/** Max bubble width (px, %, or var()) — supports a CSS variable for responsive control */
|
|
18
35
|
maxWidth?: string
|
|
19
36
|
/** Shows a live indicator instead of the content: bouncing dots while the other person types, or a mic with a moving waveform while they record audio. */
|
|
20
37
|
typing?: 'text' | 'audio'
|
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A checkbox with checked, indeterminate, and disabled states, and 4 semantic color options.
|
|
4
|
+
*
|
|
5
|
+
* @slot default Custom label content — overrides the label prop when provided
|
|
6
|
+
* @event update:modelValue Emitted with the new checked state.
|
|
7
|
+
*/
|
|
2
8
|
import MIcon from "./MIcon.vue";
|
|
3
9
|
|
|
4
10
|
withDefaults(
|
|
5
11
|
defineProps<{
|
|
12
|
+
/** Checked state (v-model) */
|
|
6
13
|
modelValue: boolean;
|
|
14
|
+
/** Indeterminate state */
|
|
7
15
|
indeterminate?: boolean;
|
|
16
|
+
/** Disables the checkbox */
|
|
8
17
|
disabled?: boolean;
|
|
18
|
+
/** Label text — overridden by the default slot when present */
|
|
9
19
|
label?: string;
|
|
20
|
+
/** Checked/indeterminate color */
|
|
10
21
|
color?: "primary" | "secondary" | "tertiary" | "error";
|
|
11
22
|
/** Accessible name for the input when there's no visible label (e.g. a list row's checkbox). */
|
|
12
23
|
ariaLabel?: string;
|
package/src/components/MChip.vue
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Compact elements for filters, input, or actions — named semantic tones or any CSS color, with optional icon,
|
|
4
|
+
* click, selection, and removal support.
|
|
5
|
+
*
|
|
6
|
+
* @slot default The chip's label.
|
|
7
|
+
* @event click Emitted when a clickable, non-disabled chip is clicked
|
|
8
|
+
* @event remove Emitted when the remove (X) button is clicked (removable only)
|
|
9
|
+
*/
|
|
2
10
|
import { computed } from 'vue'
|
|
3
11
|
import MIcon from './MIcon.vue'
|
|
4
12
|
|
|
@@ -7,11 +15,20 @@ type NamedTone = (typeof NAMED_TONES)[number]
|
|
|
7
15
|
|
|
8
16
|
const props = withDefaults(
|
|
9
17
|
defineProps<{
|
|
18
|
+
/** Color tone or any CSS color string */
|
|
10
19
|
tone?: string // named tone OR CSS color string
|
|
20
|
+
/** Selected/active state — the chip's shape morphs from a rounded rect to a full pill when selected */
|
|
11
21
|
selected?: boolean
|
|
22
|
+
/** Show a remove (X) button */
|
|
12
23
|
removable?: boolean
|
|
24
|
+
/**
|
|
25
|
+
* Makes the chip an interactive `<button>` with hover/press/focus feedback (otherwise renders as a plain
|
|
26
|
+
* `<span>`)
|
|
27
|
+
*/
|
|
13
28
|
clickable?: boolean
|
|
29
|
+
/** Disables interaction */
|
|
14
30
|
disabled?: boolean
|
|
31
|
+
/** Leading Material Symbol icon */
|
|
15
32
|
icon?: string
|
|
16
33
|
}>(),
|
|
17
34
|
{
|
|
@@ -1,14 +1,27 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A circular progress indicator — a smooth arc, or the M3 Expressive wavy ring that fades between a circle and
|
|
4
|
+
* a bumpy wave near the extremes.
|
|
5
|
+
*
|
|
6
|
+
* @slot default Custom content centered inside the ring. When provided, the percentage label is hidden.
|
|
7
|
+
*/
|
|
2
8
|
import { computed, ref, watch, onMounted, onUnmounted, useId } from "vue";
|
|
3
9
|
|
|
4
10
|
const props = withDefaults(
|
|
5
11
|
defineProps<{
|
|
12
|
+
/** Progress 0–100 (omit when indeterminate) */
|
|
6
13
|
value?: number;
|
|
14
|
+
/** Spinning arc — no value needed. Identical for both variants. */
|
|
7
15
|
indeterminate?: boolean;
|
|
16
|
+
/** Ring color */
|
|
8
17
|
color?: "primary" | "secondary" | "tertiary" | "error";
|
|
18
|
+
/** wavy: animated bumpy ring that fades to circle near 0% and 100%; circle: smooth arc */
|
|
9
19
|
variant?: "circle" | "wavy";
|
|
20
|
+
/** Label text below the circle */
|
|
10
21
|
label?: string;
|
|
22
|
+
/** Diameter in px — matches the real M3 WaveSize/Size tokens per variant */
|
|
11
23
|
size?: number;
|
|
24
|
+
/** Stroke width of the ring/wave in px, matching the real M3 token */
|
|
12
25
|
thickness?: number;
|
|
13
26
|
}>(),
|
|
14
27
|
{
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A syntax-highlighted code editor built on CodeMirror 6, with a header bar, line numbers, and a copy button.
|
|
4
|
+
*
|
|
5
|
+
* @slot actions Extra controls rendered in the header bar, before the built-in copy button
|
|
6
|
+
* @event update:modelValue Emitted on every document change — powers v-model
|
|
7
|
+
*/
|
|
2
8
|
import { ref, watch, onMounted, onBeforeUnmount, computed } from 'vue'
|
|
3
9
|
import MIcon from './MIcon.vue'
|
|
4
10
|
|
|
@@ -6,14 +12,23 @@ type Language = 'javascript' | 'typescript' | 'json' | 'html' | 'css' | 'python'
|
|
|
6
12
|
|
|
7
13
|
const props = withDefaults(
|
|
8
14
|
defineProps<{
|
|
15
|
+
/** Editor content (v-model) */
|
|
9
16
|
modelValue: string
|
|
17
|
+
/** Syntax language */
|
|
10
18
|
language?: Language
|
|
19
|
+
/** Read-only mode */
|
|
11
20
|
readonly?: boolean
|
|
21
|
+
/** Show line numbers */
|
|
12
22
|
lineNumbers?: boolean
|
|
23
|
+
/** Color theme */
|
|
13
24
|
theme?: 'light' | 'dark'
|
|
25
|
+
/** Minimum editor height */
|
|
14
26
|
minHeight?: string
|
|
27
|
+
/** Maximum editor height */
|
|
15
28
|
maxHeight?: string
|
|
29
|
+
/** Placeholder text shown via CodeMirror when the editor is empty */
|
|
16
30
|
placeholder?: string
|
|
31
|
+
/** Word wrap */
|
|
17
32
|
wrap?: boolean
|
|
18
33
|
}>(),
|
|
19
34
|
{
|
|
@@ -256,7 +271,6 @@ onBeforeUnmount(() => view?.destroy())
|
|
|
256
271
|
flex: 1;
|
|
257
272
|
min-height: 0;
|
|
258
273
|
font-size: 0.8125rem;
|
|
259
|
-
line-height: 1.6;
|
|
260
274
|
}
|
|
261
275
|
|
|
262
276
|
.code-editor-container :deep(.cm-editor.cm-focused) {
|
|
@@ -277,8 +291,10 @@ onBeforeUnmount(() => view?.destroy())
|
|
|
277
291
|
the first place. */
|
|
278
292
|
align-items: stretch !important;
|
|
279
293
|
/* Set here, not on .cm-editor: CodeMirror's base theme declares
|
|
280
|
-
font-family: monospace on .cm-scroller itself,
|
|
294
|
+
font-family: monospace and line-height: 1.4 on .cm-scroller itself,
|
|
295
|
+
which beats inheritance */
|
|
281
296
|
font-family: var(--font-mono, 'Roboto Mono', monospace);
|
|
297
|
+
line-height: 1.6;
|
|
282
298
|
}
|
|
283
299
|
|
|
284
300
|
.code-editor-container :deep(.cm-content) {
|
|
@@ -1,16 +1,29 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* An inline, dropdown-anchored color picker — hue slider, saturation/brightness area, and preset swatches.
|
|
4
|
+
*
|
|
5
|
+
* @event update:modelValue Emitted with the picked color.
|
|
6
|
+
*/
|
|
2
7
|
import { computed, onMounted, onUnmounted, ref, watch } from 'vue'
|
|
3
8
|
import MIcon from './MIcon.vue'
|
|
4
9
|
import { useFieldBg } from '../composables/useFieldBg'
|
|
5
10
|
|
|
6
11
|
const props = withDefaults(defineProps<{
|
|
12
|
+
/** Selected color in hex format (v-model) */
|
|
7
13
|
modelValue: string
|
|
14
|
+
/** Field label */
|
|
8
15
|
label?: string
|
|
16
|
+
/** Preset color swatches shown in the panel */
|
|
9
17
|
presets?: string[]
|
|
18
|
+
/** Disables the picker */
|
|
10
19
|
disabled?: boolean
|
|
20
|
+
/** Error state */
|
|
11
21
|
error?: boolean
|
|
22
|
+
/** Error message shown when error is true */
|
|
12
23
|
errorLabel?: string
|
|
24
|
+
/** Hint text below the field */
|
|
13
25
|
hint?: string
|
|
26
|
+
/** Overrides the auto-detected background color used to cut the floating label out of the border */
|
|
14
27
|
fieldBg?: string
|
|
15
28
|
}>(), {
|
|
16
29
|
presets: () => [
|
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A modal, centered color picker with saturation/brightness area, hue slider, hex input, and preset swatches —
|
|
4
|
+
* the sibling of MColorPicker, a fully separate component rather than a shared internal. Only emits on confirm.
|
|
5
|
+
*
|
|
6
|
+
* @event update:modelValue Emitted when a color is confirmed — powers v-model. Only fires on confirm, not while
|
|
7
|
+
* dragging
|
|
8
|
+
* @event update:show Emitted when the dialog opens or closes — powers v-model:show
|
|
9
|
+
*/
|
|
2
10
|
import { computed, ref, watch } from 'vue'
|
|
3
11
|
import MButton from './MButton.vue'
|
|
4
12
|
import MIcon from './MIcon.vue'
|
|
5
13
|
import { useLocale } from '../composables/useLocale'
|
|
6
14
|
|
|
7
15
|
const props = withDefaults(defineProps<{
|
|
16
|
+
/** Selected color in hex format (v-model) */
|
|
8
17
|
modelValue: string
|
|
18
|
+
/** Controls dialog visibility (v-model:show) */
|
|
9
19
|
show?: boolean
|
|
20
|
+
/** Preset color swatches shown in the dialog */
|
|
10
21
|
presets?: string[]
|
|
22
|
+
/** Dialog title */
|
|
11
23
|
title?: string
|
|
12
24
|
}>(), {
|
|
13
25
|
show: false,
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A searchable, keyboard-driven command palette — grouped commands, fuzzy-free substring search, and a global
|
|
4
|
+
* hotkey (Cmd/Ctrl+K by default).
|
|
5
|
+
*
|
|
6
|
+
* @event update:modelValue Emitted on open/close — powers v-model
|
|
7
|
+
* @event select Emitted when an item is chosen (click, or Enter) — fires before the item's own onSelect
|
|
8
|
+
* callback runs
|
|
9
|
+
*/
|
|
2
10
|
import { ref, computed, watch, nextTick, onMounted, onBeforeUnmount } from 'vue'
|
|
3
11
|
import MIcon from './MIcon.vue'
|
|
4
12
|
import { useLocale } from '../composables/useLocale'
|
|
@@ -17,13 +25,21 @@ export interface CommandItem {
|
|
|
17
25
|
|
|
18
26
|
const props = withDefaults(
|
|
19
27
|
defineProps<{
|
|
28
|
+
/** Open/closed state (v-model). Required — there is no default. */
|
|
20
29
|
modelValue: boolean
|
|
30
|
+
/** Commands to search over (see `CommandItem`). Required — there is no default. */
|
|
21
31
|
items: CommandItem[]
|
|
32
|
+
/** Search input placeholder — falls back to the locale's own string when unset */
|
|
22
33
|
placeholder?: string
|
|
34
|
+
/** Empty-state text — falls back to the locale's own string when unset */
|
|
23
35
|
noResultsText?: string
|
|
36
|
+
/** Global keyboard shortcut key, combined with Cmd/Ctrl, to toggle the palette */
|
|
24
37
|
hotkey?: string
|
|
38
|
+
/** Footer hint text for the arrow keys — falls back to the locale's own string when unset */
|
|
25
39
|
navigateHint?: string
|
|
40
|
+
/** Footer hint text for Enter — falls back to the locale's own string when unset */
|
|
26
41
|
selectHint?: string
|
|
42
|
+
/** Footer hint text for Escape — falls back to the locale's own string when unset */
|
|
27
43
|
closeHint?: string
|
|
28
44
|
}>(),
|
|
29
45
|
{
|
|
@@ -130,7 +146,7 @@ onBeforeUnmount(() => document.removeEventListener('keydown', onGlobalKeydown))
|
|
|
130
146
|
|
|
131
147
|
<template>
|
|
132
148
|
<Teleport to="body">
|
|
133
|
-
<Transition name="m3-cmd">
|
|
149
|
+
<Transition name="m3-cmd" appear>
|
|
134
150
|
<div
|
|
135
151
|
v-if="modelValue"
|
|
136
152
|
class="fixed inset-0 z-50 flex items-start justify-center bg-scrim/32 pt-[15vh]"
|
|
@@ -1,16 +1,31 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A pre-built confirmation dialog on top of MDialog — title, message, cancel/confirm buttons, a danger color
|
|
4
|
+
* mode, and a loading state, so you don't have to hand-roll one for every "are you sure?" prompt.
|
|
5
|
+
*
|
|
6
|
+
* @event update:modelValue Emitted when the dialog should open/close — powers v-model
|
|
7
|
+
* @event confirm Emitted when the confirm button is clicked — the dialog stays open until the caller sets
|
|
8
|
+
* modelValue to false (or clears loading)
|
|
9
|
+
*/
|
|
2
10
|
import MDialog from './MDialog.vue'
|
|
3
11
|
import MButton from './MButton.vue'
|
|
4
12
|
import { useLocale } from '../composables/useLocale'
|
|
5
13
|
|
|
6
14
|
const props = withDefaults(
|
|
7
15
|
defineProps<{
|
|
16
|
+
/** Open/closed state (v-model) */
|
|
8
17
|
modelValue: boolean
|
|
18
|
+
/** Dialog title */
|
|
9
19
|
title: string
|
|
20
|
+
/** Confirmation message body */
|
|
10
21
|
message: string
|
|
22
|
+
/** Confirm button label — falls back to the locale string when omitted */
|
|
11
23
|
confirmLabel?: string
|
|
24
|
+
/** Cancel button label — falls back to the locale string when omitted */
|
|
12
25
|
cancelLabel?: string
|
|
26
|
+
/** Error color on the confirm button, for destructive actions */
|
|
13
27
|
danger?: boolean
|
|
28
|
+
/** Shows a spinner on the confirm button and disables cancel */
|
|
14
29
|
loading?: boolean
|
|
15
30
|
/** Passed straight through to MDialog's `closable` — show/hide the header close (X) button. */
|
|
16
31
|
closable?: boolean
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Constrains content width with responsive horizontal padding.
|
|
4
|
+
*
|
|
5
|
+
* @slot default Content.
|
|
6
|
+
*/
|
|
2
7
|
import { computed } from 'vue'
|
|
3
8
|
|
|
4
9
|
const props = withDefaults(
|
|
5
10
|
defineProps<{
|
|
11
|
+
/** Maximum width breakpoint */
|
|
6
12
|
maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full'
|
|
13
|
+
/** Full-width (no max constraint) */
|
|
7
14
|
fluid?: boolean
|
|
15
|
+
/** Center horizontally with mx-auto */
|
|
8
16
|
centered?: boolean
|
|
17
|
+
/** Add responsive horizontal padding */
|
|
9
18
|
padding?: boolean
|
|
10
19
|
}>(),
|
|
11
20
|
{ maxWidth: 'lg', fluid: false, centered: true, padding: true },
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A right-click context menu composed with MMenuItem — same item/divider/submenu building blocks as MMenu, but
|
|
4
|
+
* positioned at the cursor instead of anchored to a trigger element.
|
|
5
|
+
*
|
|
6
|
+
* @slot trigger The element(s) that respond to right-click. MContextMenu intercepts contextmenu events
|
|
7
|
+
* automatically and positions the panel at the cursor, clamped to stay on-screen.
|
|
8
|
+
* @slot default Menu items — use MMenuItem, MMenuDivider, or any element.
|
|
9
|
+
*/
|
|
2
10
|
import { computed, Fragment, inject, nextTick, onMounted, onUnmounted, provide, ref, useSlots, watch, type VNode } from 'vue'
|
|
3
11
|
import MIcon from './MIcon.vue'
|
|
4
12
|
import MMenuDivider from './MMenuDivider.vue'
|
|
5
13
|
|
|
14
|
+
defineOptions({ inheritAttrs: false })
|
|
15
|
+
|
|
6
16
|
const props = withDefaults(
|
|
7
17
|
defineProps<{
|
|
8
18
|
/**
|
|
@@ -13,13 +23,16 @@ const props = withDefaults(
|
|
|
13
23
|
*/
|
|
14
24
|
submenuMode?: 'flyout' | 'push'
|
|
15
25
|
/**
|
|
16
|
-
*
|
|
17
|
-
* (
|
|
18
|
-
*
|
|
19
|
-
* (`SegmentedMenuTokens.ContainerShape`/`CornerLarge`). Combine with
|
|
20
|
-
* `<MMenuDivider gap />` to split the panel into independently-rounded
|
|
21
|
-
* groups with a visible gap between them, instead of a plain line.
|
|
26
|
+
* 'standard' is M3's baseline menu (4dp corners). 'expressive' is M3's rounder 'vertical menu' styling
|
|
27
|
+
* (16dp corners) — combine with `<MMenuDivider gap />` to split the panel into independently-rounded groups
|
|
28
|
+
* with a visible gap, instead of a plain divider line.
|
|
22
29
|
*/
|
|
30
|
+
// `'standard'` is M3's baseline menu — square-ish 4dp corners
|
|
31
|
+
// (`MenuTokens.ContainerShape`/`CornerExtraSmall`).
|
|
32
|
+
// `'expressive'` is M3's rounder "vertical menu" styling — 16dp corners
|
|
33
|
+
// (`SegmentedMenuTokens.ContainerShape`/`CornerLarge`). Combine with
|
|
34
|
+
// `<MMenuDivider gap />` to split the panel into independently-rounded
|
|
35
|
+
// groups with a visible gap between them, instead of a plain line.
|
|
23
36
|
variant?: 'standard' | 'expressive'
|
|
24
37
|
}>(),
|
|
25
38
|
{ submenuMode: 'flyout', variant: 'standard' },
|
|
@@ -337,7 +350,7 @@ onUnmounted(() => {
|
|
|
337
350
|
</script>
|
|
338
351
|
|
|
339
352
|
<template>
|
|
340
|
-
<div @contextmenu="show">
|
|
353
|
+
<div v-bind="$attrs" @contextmenu="show">
|
|
341
354
|
<slot name="trigger" />
|
|
342
355
|
</div>
|
|
343
356
|
|
|
@@ -1,18 +1,34 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Wraps MIconButton and swaps to a checkmark for resetDelay ms after a successful copy.
|
|
4
|
+
*
|
|
5
|
+
* @event error Emitted if the browser refuses the clipboard write
|
|
6
|
+
* @event copied Emitted with the copied value after a successful clipboard write
|
|
7
|
+
*/
|
|
2
8
|
import { onUnmounted, ref } from 'vue'
|
|
3
9
|
import MIconButton from './MIconButton.vue'
|
|
4
10
|
|
|
5
11
|
const props = withDefaults(
|
|
6
12
|
defineProps<{
|
|
13
|
+
/** Text copied to the clipboard on click */
|
|
7
14
|
value: string
|
|
15
|
+
/** Icon shown in the idle state */
|
|
8
16
|
icon?: string
|
|
17
|
+
/** Icon shown right after a successful copy */
|
|
9
18
|
copiedIcon?: string
|
|
19
|
+
/** aria-label in the idle state */
|
|
10
20
|
label?: string
|
|
21
|
+
/** aria-label right after a successful copy */
|
|
11
22
|
copiedLabel?: string
|
|
23
|
+
/** Visual style (same as MIconButton) */
|
|
12
24
|
variant?: 'standard' | 'filled' | 'tonal' | 'outlined'
|
|
25
|
+
/** Button shape */
|
|
13
26
|
shape?: 'rounded' | 'squared'
|
|
27
|
+
/** Button size */
|
|
14
28
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number
|
|
29
|
+
/** Disables the button */
|
|
15
30
|
disabled?: boolean
|
|
31
|
+
/** Milliseconds before the icon reverts to idle after copying */
|
|
16
32
|
resetDelay?: number
|
|
17
33
|
}>(),
|
|
18
34
|
{
|
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A feature-rich data table — everything MTable has, plus column resize/pin/toggle, row grouping, striped/dense
|
|
4
|
+
* density, sticky header, expandable rows, and CSV export.
|
|
5
|
+
*
|
|
6
|
+
* @slot toolbar Extra content in the toolbar next to the search input (filters, buttons, etc.)
|
|
7
|
+
* @slot empty Custom empty-state content, replaces the default icon + text
|
|
8
|
+
* @slot row-actions Per-row action buttons — rendering this slot adds a trailing actions column
|
|
9
|
+
* @slot row-expand Expanded-row detail content, shown when expandable is true and the row is toggled open
|
|
10
|
+
* @event update:modelValue Emitted when the selection changes — powers v-model
|
|
11
|
+
* @event update:page Emitted when the page changes — powers v-model:page
|
|
12
|
+
* @event rowClick Emitted with the row's data when you click a row (unless `selectOnRowClick` makes the click
|
|
13
|
+
* select it).
|
|
14
|
+
* @event fetch Emitted instead of filtering locally when serverSide is true
|
|
15
|
+
*/
|
|
2
16
|
import { computed, ref, useSlots, watch, onMounted } from 'vue'
|
|
3
17
|
import MCheckbox from './MCheckbox.vue'
|
|
4
18
|
import MIcon from './MIcon.vue'
|
|
@@ -30,46 +44,78 @@ export interface DataTableGroup {
|
|
|
30
44
|
const SKEL = [65, 80, 50, 75, 90, 55, 70, 85, 60, 78]
|
|
31
45
|
|
|
32
46
|
const props = withDefaults(defineProps<{
|
|
47
|
+
/** Column definitions; see `DataTableColumn` */
|
|
33
48
|
columns: DataTableColumn[]
|
|
49
|
+
/** Table data rows */
|
|
34
50
|
rows: Record<string, any>[]
|
|
51
|
+
/** Show skeleton loading state */
|
|
35
52
|
loading?: boolean
|
|
53
|
+
/** Text when no rows (defaults to the locale string) */
|
|
36
54
|
emptyText?: string
|
|
55
|
+
/** Unique key field in each row */
|
|
37
56
|
rowKey?: string
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
*
|
|
41
|
-
* `rowClick`, así una tabla puede seleccionar filas y a la vez abrirlas al click.
|
|
57
|
+
/**
|
|
58
|
+
* Enable row selection with checkboxes (by default only the checkbox toggles a row; clicking the row itself
|
|
59
|
+
* still emits row-click)
|
|
42
60
|
*/
|
|
61
|
+
selectable?: boolean
|
|
62
|
+
/** With selectable, clicking anywhere on a row toggles its selection instead of emitting row-click */
|
|
63
|
+
// Con `selectable`, que el click en cualquier parte de la fila la marque/desmarque (en vez de
|
|
64
|
+
// emitir `rowClick`). Default false: sólo el checkbox selecciona y el click en la fila emite
|
|
65
|
+
// `rowClick`, así una tabla puede seleccionar filas y a la vez abrirlas al click.
|
|
43
66
|
selectOnRowClick?: boolean
|
|
67
|
+
/** Selected rows (v-model) */
|
|
44
68
|
modelValue?: Record<string, any>[]
|
|
69
|
+
/** Rows per page */
|
|
45
70
|
perPage?: number
|
|
71
|
+
/** Show search input */
|
|
46
72
|
searchable?: boolean
|
|
73
|
+
/** Enable row expansion (requires the row-expand slot) */
|
|
47
74
|
expandable?: boolean
|
|
75
|
+
/** Alternate row colors */
|
|
48
76
|
striped?: boolean
|
|
77
|
+
/** Compact row height */
|
|
49
78
|
dense?: boolean
|
|
79
|
+
/** Sticky table header */
|
|
50
80
|
stickyHeader?: boolean
|
|
81
|
+
/** Group rows by this column key */
|
|
51
82
|
groupBy?: string
|
|
83
|
+
/** Allow hiding/showing columns from a menu */
|
|
52
84
|
columnToggle?: boolean
|
|
85
|
+
/** Show an export-to-CSV button */
|
|
53
86
|
exportable?: boolean
|
|
87
|
+
/** Emit fetch instead of local filtering. Requires :total. */
|
|
54
88
|
serverSide?: boolean
|
|
89
|
+
/** Total rows (for server-side pagination) */
|
|
55
90
|
total?: number
|
|
91
|
+
/** Current page (v-model via update:page) */
|
|
56
92
|
page?: number
|
|
93
|
+
/** Placeholder for search input (defaults to the locale string) */
|
|
57
94
|
searchPlaceholder?: string
|
|
95
|
+
/** Text for selected count badge (defaults to the locale string) */
|
|
58
96
|
selectedText?: string
|
|
97
|
+
/** Text for total records count (defaults to the locale string) */
|
|
59
98
|
recordsText?: string
|
|
99
|
+
/** Aria label for the expand button (defaults to the locale string) */
|
|
60
100
|
expandLabel?: string
|
|
101
|
+
/** Label for the column-toggle button (defaults to the locale string) */
|
|
61
102
|
columnsLabel?: string
|
|
103
|
+
/** Label for the export button (defaults to the locale string) */
|
|
62
104
|
exportLabel?: string
|
|
105
|
+
/** Text for the ungrouped-rows bucket (defaults to the locale string) */
|
|
63
106
|
noGroupText?: string
|
|
64
|
-
/**
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* (default), la tabla vuelve a su comportamiento natural: alto según la cantidad real de filas,
|
|
68
|
-
* sin piso reservado — usalo sólo en tablas puntuales que necesiten ese piso (p. ej. una agenda
|
|
69
|
-
* diaria que suele tener pocos o cero elementos y no debería verse minúscula al filtrar a un día
|
|
70
|
-
* vacío). El estado vacío siempre reserva un mínimo propio independientemente de este prop, ver
|
|
71
|
-
* `emptyStateMinHeight`.
|
|
107
|
+
/**
|
|
108
|
+
* Reserves a fixed min-height for the table area (any valid CSS min-height value) so switching between
|
|
109
|
+
* loading/empty/loaded doesn't visibly resize the table. Off by default.
|
|
72
110
|
*/
|
|
111
|
+
// Alto mínimo del área de la tabla (cualquier valor CSS válido para `min-height`) — reserva
|
|
112
|
+
// espacio fijo para que pasar de "cargando" (skeleton) a "pocos o cero resultados" (o
|
|
113
|
+
// viceversa, al cambiar de filtro/página) no encoja/agrande la tabla visiblemente. Sin valor
|
|
114
|
+
// (default), la tabla vuelve a su comportamiento natural: alto según la cantidad real de filas,
|
|
115
|
+
// sin piso reservado — usalo sólo en tablas puntuales que necesiten ese piso (p. ej. una agenda
|
|
116
|
+
// diaria que suele tener pocos o cero elementos y no debería verse minúscula al filtrar a un día
|
|
117
|
+
// vacío). El estado vacío siempre reserva un mínimo propio independientemente de este prop, ver
|
|
118
|
+
// `emptyStateMinHeight`.
|
|
73
119
|
minHeight?: string
|
|
74
120
|
}>(), {
|
|
75
121
|
loading: false,
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* An inline, dropdown-anchored calendar date picker with locale support and min/max range clamping.
|
|
4
|
+
*
|
|
5
|
+
* @event update:modelValue Emitted with the picked date.
|
|
6
|
+
*/
|
|
2
7
|
import { computed, onMounted, onUnmounted, ref, watch } from 'vue'
|
|
3
8
|
import MIcon from './MIcon.vue'
|
|
4
9
|
import MIconButton from './MIconButton.vue'
|
|
@@ -6,18 +11,34 @@ import { useFieldBg } from '../composables/useFieldBg'
|
|
|
6
11
|
import { useLocale } from '../composables/useLocale'
|
|
7
12
|
|
|
8
13
|
const props = defineProps<{
|
|
14
|
+
/** Selected date (YYYY-MM-DD, v-model) */
|
|
9
15
|
modelValue: string | null
|
|
16
|
+
/** Field label */
|
|
10
17
|
label?: string
|
|
18
|
+
/** Placeholder shown when no date is selected — falls back to label, then the current locale's string */
|
|
11
19
|
placeholder?: string
|
|
20
|
+
/** Minimum selectable date (YYYY-MM-DD) */
|
|
12
21
|
min?: string
|
|
22
|
+
/** Maximum selectable date (YYYY-MM-DD) */
|
|
13
23
|
max?: string
|
|
24
|
+
/** Disables the picker */
|
|
14
25
|
disabled?: boolean
|
|
26
|
+
/** Error state */
|
|
15
27
|
error?: boolean
|
|
28
|
+
/** Error message shown when error is true */
|
|
16
29
|
errorLabel?: string
|
|
30
|
+
/** Hint text below the field */
|
|
17
31
|
hint?: string
|
|
32
|
+
/**
|
|
33
|
+
* Locale for month/day names. Falls back to the app's configured locale (createM3UI({ locale })) — same
|
|
34
|
+
* pattern as MRelativeTime
|
|
35
|
+
*/
|
|
18
36
|
locale?: string
|
|
37
|
+
/** Overrides the auto-detected background color used to cut the floating label out of the border */
|
|
19
38
|
fieldBg?: string
|
|
39
|
+
/** Aria label for the previous-month button — defaults to the current locale's string */
|
|
20
40
|
prevMonthLabel?: string
|
|
41
|
+
/** Aria label for the next-month button — defaults to the current locale's string */
|
|
21
42
|
nextMonthLabel?: string
|
|
22
43
|
}>()
|
|
23
44
|
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A modal, centered date picker with calendar and keyboard input modes. For a field that opens a dropdown
|
|
4
|
+
* calendar, use MDatePicker.
|
|
5
|
+
*
|
|
6
|
+
* @event update:modelValue Emitted when a date is confirmed — powers v-model
|
|
7
|
+
* @event update:show Emitted when the dialog opens or closes — powers v-model:show
|
|
8
|
+
*/
|
|
2
9
|
import { computed, ref, watch } from 'vue'
|
|
3
10
|
import MButton from './MButton.vue'
|
|
4
11
|
import MIconButton from './MIconButton.vue'
|
|
@@ -6,11 +13,20 @@ import MIcon from './MIcon.vue'
|
|
|
6
13
|
import { useLocale } from '../composables/useLocale'
|
|
7
14
|
|
|
8
15
|
const props = withDefaults(defineProps<{
|
|
16
|
+
/** Selected date in YYYY-MM-DD format (v-model) */
|
|
9
17
|
modelValue: string | null
|
|
18
|
+
/** Controls dialog visibility (v-model:show) */
|
|
10
19
|
show?: boolean
|
|
20
|
+
/** Minimum selectable date (YYYY-MM-DD) */
|
|
11
21
|
min?: string
|
|
22
|
+
/** Maximum selectable date (YYYY-MM-DD) */
|
|
12
23
|
max?: string
|
|
24
|
+
/**
|
|
25
|
+
* Locale for month/day names. Falls back to the app's configured locale (createM3UI({ locale })) — same
|
|
26
|
+
* pattern as MRelativeTime
|
|
27
|
+
*/
|
|
13
28
|
locale?: string
|
|
29
|
+
/** Dialog title */
|
|
14
30
|
title?: string
|
|
15
31
|
}>(), {
|
|
16
32
|
modelValue: null,
|
|
@@ -157,7 +173,7 @@ function onKeydown(e: KeyboardEvent) { if (e.key === 'Escape') cancel() }
|
|
|
157
173
|
|
|
158
174
|
<template>
|
|
159
175
|
<Teleport to="body">
|
|
160
|
-
<Transition name="m3-dp-modal">
|
|
176
|
+
<Transition name="m3-dp-modal" appear>
|
|
161
177
|
<div
|
|
162
178
|
v-if="show"
|
|
163
179
|
class="fixed inset-0 z-50 flex items-center justify-center bg-scrim/32 p-4"
|