@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
package/src/components/MList.vue
CHANGED
|
@@ -1,14 +1,29 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A vertical list container (MList) with rich, flexible rows (MListItem) and optional section headers
|
|
4
|
+
* (MListSubheader) — one-line to three-line items, leading/trailing elements, selection, navigation, segmented,
|
|
5
|
+
* and expandable variants.
|
|
6
|
+
*
|
|
7
|
+
* @slot default MListItem / MListSubheader children
|
|
8
|
+
* @event update:selected Fires when a selectable item is clicked (via v-model:selected)
|
|
9
|
+
*/
|
|
2
10
|
import { computed, provide } from 'vue'
|
|
3
11
|
|
|
4
12
|
const props = withDefaults(
|
|
5
13
|
defineProps<{
|
|
14
|
+
/** Compact vertical padding on child items */
|
|
6
15
|
dense?: boolean
|
|
16
|
+
/** Show separators between items — 'inset' aligns the line past a leading icon/avatar */
|
|
7
17
|
dividers?: boolean | 'inset'
|
|
18
|
+
/** Navigation variant with rounded (pill) active items, ideal for drawers */
|
|
8
19
|
nav?: boolean
|
|
20
|
+
/** Segmented style — items each get an individual rounded background instead of a flat list */
|
|
9
21
|
segmented?: boolean
|
|
22
|
+
/** Enable single-item selection — items compare their value prop against selected */
|
|
10
23
|
selectable?: boolean
|
|
24
|
+
/** Currently selected item value (v-model:selected) */
|
|
11
25
|
selected?: string | number | null
|
|
26
|
+
/** Default line count for child items that don't set their own lines prop */
|
|
12
27
|
lines?: 1 | 2 | 3
|
|
13
28
|
}>(),
|
|
14
29
|
{ dense: false, dividers: false, nav: false, segmented: false, selectable: false },
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Material 3's list-detail layout: a list of items and the details of the selected one. When there's room
|
|
4
|
+
* (840px and up, the expanded width class) both panes sit side by side; on smaller screens only one shows, the
|
|
5
|
+
* detail sliding in over the list when you open an item and back out on `back()`. It measures its own width, so
|
|
6
|
+
* it adapts inside a column or a dialog too. Both panes stay mounted, so the list keeps its scroll position. It
|
|
7
|
+
* has no default size: give it a height so each pane scrolls on its own.
|
|
8
|
+
*
|
|
9
|
+
* @slot list The list pane. Scrolls on its own and keeps its scroll position while the detail is open
|
|
10
|
+
* @slot detail The detail pane. back() returns to the list; show a back button only when !twoPane
|
|
11
|
+
* @event update:showDetail Emitted with false when the detail slot calls back()
|
|
12
|
+
*/
|
|
2
13
|
import { computed, ref } from 'vue'
|
|
3
14
|
import { useWindowSizeClass } from '../composables/useWindowSizeClass'
|
|
4
15
|
|
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A row of an MList: headline with optional overline, supporting text, a leading icon, avatar or image, and
|
|
4
|
+
* trailing text, icon, checkbox or switch. It can be a link, be clickable or expand to show nested items.
|
|
5
|
+
*
|
|
6
|
+
* @slot leading Custom leading element, replacing the icon/avatar/image/icon-container
|
|
7
|
+
* @slot overline Custom overline content, replacing the overline prop
|
|
8
|
+
* @slot default Custom content replacing the title/subtitle/description text block
|
|
9
|
+
* @slot children Nested content revealed when expandable is set and the item is expanded
|
|
10
|
+
* @slot trailing Custom trailing element, replacing the icon/text/switch/checkbox
|
|
11
|
+
* @event click Fires on any click, including on an expandable item (right before it toggles)
|
|
12
|
+
* @event update:trailingValue Fires when a trailing switch/checkbox is toggled (trailing='switch' | 'checkbox')
|
|
13
|
+
* @event update:expanded Fires when an expandable item is toggled open/closed
|
|
14
|
+
*/
|
|
2
15
|
import { computed, inject, ref, useAttrs, watch } from 'vue'
|
|
3
16
|
import type { ComputedRef } from 'vue'
|
|
4
17
|
import MIcon from './MIcon.vue'
|
|
@@ -11,27 +24,51 @@ export type ListItemTrailing = 'icon' | 'text' | 'switch' | 'checkbox'
|
|
|
11
24
|
|
|
12
25
|
const props = withDefaults(
|
|
13
26
|
defineProps<{
|
|
27
|
+
/** Primary text (headline) */
|
|
14
28
|
title?: string
|
|
29
|
+
/** Small label above the title */
|
|
15
30
|
overline?: string
|
|
31
|
+
/** Secondary text (line 2) */
|
|
16
32
|
subtitle?: string
|
|
33
|
+
/** Tertiary text (line 3) */
|
|
17
34
|
description?: string
|
|
35
|
+
/** Number of text lines — auto-detected from which text props/parent MList lines are set when omitted */
|
|
18
36
|
lines?: 1 | 2 | 3
|
|
37
|
+
/** Leading Material Symbol icon */
|
|
19
38
|
icon?: string
|
|
39
|
+
/**
|
|
40
|
+
* Leading element type — auto-resolves to 'icon'/'avatar'/'image' from icon/avatarName/image when omitted
|
|
41
|
+
*/
|
|
20
42
|
leading?: ListItemLeading
|
|
43
|
+
/** Name for the avatar (when leading='avatar') */
|
|
21
44
|
avatarName?: string
|
|
45
|
+
/** Image URL (when leading='image') */
|
|
22
46
|
image?: string
|
|
47
|
+
/** Icon container background color (when leading='icon-container') */
|
|
23
48
|
iconContainerColor?: 'primary' | 'secondary' | 'tertiary' | 'error' | 'success'
|
|
49
|
+
/** Trailing icon name */
|
|
24
50
|
trailingIcon?: string
|
|
51
|
+
/** Trailing text label */
|
|
25
52
|
trailingText?: string
|
|
53
|
+
/** Trailing element type — auto-resolves from trailingIcon/trailingText when omitted */
|
|
26
54
|
trailing?: ListItemTrailing
|
|
55
|
+
/** Value for a trailing switch/checkbox (v-model:trailingValue) */
|
|
27
56
|
trailingValue?: boolean
|
|
57
|
+
/** Selection value — compared against the parent MList selected prop */
|
|
28
58
|
value?: string | number
|
|
59
|
+
/** Force the active/highlighted state regardless of parent list selection */
|
|
29
60
|
active?: boolean
|
|
61
|
+
/** Disabled state (38% opacity, blocks interaction) */
|
|
30
62
|
disabled?: boolean
|
|
63
|
+
/** Force interactive styling/behavior (auto-true when href, to, @click, selectable, or expandable apply) */
|
|
31
64
|
clickable?: boolean
|
|
65
|
+
/** Link URL — renders the item as an `<a>` */
|
|
32
66
|
href?: string
|
|
67
|
+
/** Vue Router destination — renders the item as a router-link */
|
|
33
68
|
to?: string | object
|
|
69
|
+
/** Show an expand/collapse chevron revealing the #children slot */
|
|
34
70
|
expandable?: boolean
|
|
71
|
+
/** Control the expanded state (v-model:expanded) — otherwise managed internally */
|
|
35
72
|
expanded?: boolean
|
|
36
73
|
}>(),
|
|
37
74
|
{ active: false, disabled: false, expandable: false },
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A small heading that labels a group of items inside an MList.
|
|
4
|
+
*
|
|
5
|
+
* @slot default Subheader text/content
|
|
6
|
+
*/
|
|
2
7
|
withDefaults(
|
|
3
8
|
defineProps<{
|
|
9
|
+
/** Align with items that have a leading icon (adds left padding) */
|
|
4
10
|
inset?: boolean
|
|
5
11
|
}>(),
|
|
6
12
|
{ inset: false },
|
|
@@ -1,12 +1,27 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* The M3 Expressive loading indicator — continuously morphs between rounded shapes (soft burst, cookie,
|
|
4
|
+
* pentagon, pill, sunny, oval) via an underdamped spring while slowly rotating. Comes in a plain and a
|
|
5
|
+
* contained (circle-backed) variant.
|
|
6
|
+
*/
|
|
2
7
|
import { computed, onMounted, onUnmounted, ref } from "vue";
|
|
3
8
|
import { useLocale } from '../composables/useLocale';
|
|
4
9
|
|
|
5
10
|
const props = withDefaults(
|
|
6
11
|
defineProps<{
|
|
12
|
+
/**
|
|
13
|
+
* Overall footprint in px. The active shape sits inset within it (38/48 ratio) unless contained, where it
|
|
14
|
+
* scales to 55% of size.
|
|
15
|
+
*/
|
|
7
16
|
size?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Wraps the shape in a filled container circle, and recolors the shape to the OnXContainer role instead of
|
|
19
|
+
* the bare X role
|
|
20
|
+
*/
|
|
8
21
|
contained?: boolean;
|
|
22
|
+
/** Active shape (and container, when contained) color */
|
|
9
23
|
color?: "primary" | "secondary" | "tertiary" | "error";
|
|
24
|
+
/** Aria label for the indicator's status role — falls back to the locale string ('Loading') when omitted */
|
|
10
25
|
label?: string;
|
|
11
26
|
}>(),
|
|
12
27
|
{ size: 48, contained: false, color: "primary" },
|
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A spinner-and-text overlay, either layered on top of a piece of content via the `#content` slot, or covering
|
|
4
|
+
* the whole viewport with `fullscreen`.
|
|
5
|
+
*
|
|
6
|
+
* @slot default Extra content shown below the spinner/text, in either mode
|
|
7
|
+
* @slot content The content the overlay is layered on top of (only used when fullscreen is false)
|
|
8
|
+
*/
|
|
2
9
|
import MSpinner from './MSpinner.vue'
|
|
3
10
|
|
|
11
|
+
defineOptions({ inheritAttrs: false })
|
|
12
|
+
|
|
4
13
|
withDefaults(defineProps<{
|
|
14
|
+
/** Show/hide the overlay */
|
|
5
15
|
visible: boolean
|
|
16
|
+
/** Loading text message shown below the spinner */
|
|
6
17
|
text?: string
|
|
18
|
+
/** Cover the entire viewport via Teleport, instead of overlaying just the #content slot */
|
|
7
19
|
fullscreen?: boolean
|
|
20
|
+
/** Solid surface background instead of a translucent, blurred one */
|
|
8
21
|
opaque?: boolean
|
|
22
|
+
/** Spinner size in px */
|
|
9
23
|
spinnerSize?: number
|
|
10
24
|
}>(), { fullscreen: false, opaque: false, spinnerSize: 40 })
|
|
11
25
|
</script>
|
|
@@ -13,6 +27,7 @@ withDefaults(defineProps<{
|
|
|
13
27
|
<template>
|
|
14
28
|
<Teleport v-if="fullscreen" to="body">
|
|
15
29
|
<Transition
|
|
30
|
+
appear
|
|
16
31
|
enter-active-class="transition-opacity duration-200"
|
|
17
32
|
enter-from-class="opacity-0"
|
|
18
33
|
leave-active-class="transition-opacity duration-150"
|
|
@@ -20,6 +35,7 @@ withDefaults(defineProps<{
|
|
|
20
35
|
>
|
|
21
36
|
<div
|
|
22
37
|
v-if="visible"
|
|
38
|
+
v-bind="$attrs"
|
|
23
39
|
class="fixed inset-0 z-300 flex flex-col items-center justify-center gap-4"
|
|
24
40
|
:class="opaque ? 'bg-surface' : 'bg-surface/80 backdrop-blur-sm'"
|
|
25
41
|
>
|
|
@@ -30,9 +46,10 @@ withDefaults(defineProps<{
|
|
|
30
46
|
</Transition>
|
|
31
47
|
</Teleport>
|
|
32
48
|
|
|
33
|
-
<div v-else class="relative">
|
|
49
|
+
<div v-else v-bind="$attrs" class="relative">
|
|
34
50
|
<slot name="content" />
|
|
35
51
|
<Transition
|
|
52
|
+
appear
|
|
36
53
|
enter-active-class="transition-opacity duration-200"
|
|
37
54
|
enter-from-class="opacity-0"
|
|
38
55
|
leave-active-class="transition-opacity duration-150"
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Renders markdown source as styled HTML — headings, lists, tables, blockquotes, links, and fenced code blocks
|
|
4
|
+
* with optional syntax highlighting, line highlighting, and a copy button.
|
|
5
|
+
*/
|
|
2
6
|
import { computed, ref, onMounted } from 'vue'
|
|
3
7
|
|
|
4
8
|
const props = withDefaults(
|
|
5
9
|
defineProps<{
|
|
10
|
+
/** Markdown source text */
|
|
6
11
|
source: string
|
|
12
|
+
/** Convert single newlines to `<br>` */
|
|
7
13
|
breaks?: boolean
|
|
14
|
+
/** Auto-detect bare URLs and turn them into links */
|
|
8
15
|
linkify?: boolean
|
|
9
16
|
}>(),
|
|
10
17
|
{ breaks: true, linkify: true },
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A text field with a formatting mask — built-in presets or a custom pattern where `#` stands for a digit.
|
|
4
|
+
*
|
|
5
|
+
* @event update:modelValue Emitted on every keystroke — powers v-model
|
|
6
|
+
* @event debounced Emitted debounce ms after the user stops typing (only when debounce > 0)
|
|
7
|
+
*/
|
|
2
8
|
import { computed, ref, useId, watch } from 'vue'
|
|
3
9
|
import MIcon from './MIcon.vue'
|
|
4
10
|
import { useFieldBg } from '../composables/useFieldBg'
|
|
@@ -18,18 +24,33 @@ const PRESETS: Record<MaskPreset, string> = {
|
|
|
18
24
|
|
|
19
25
|
const props = withDefaults(
|
|
20
26
|
defineProps<{
|
|
27
|
+
/** Masked value (v-model) */
|
|
21
28
|
modelValue: string
|
|
29
|
+
/** Field label */
|
|
22
30
|
label: string
|
|
31
|
+
/** Mask pattern (# = digit) or a built-in preset name (see `MaskPreset`) */
|
|
23
32
|
mask: string | MaskPreset
|
|
33
|
+
/** Visual style */
|
|
24
34
|
variant?: 'filled' | 'outlined'
|
|
35
|
+
/** Error state */
|
|
25
36
|
error?: boolean
|
|
37
|
+
/** Error message shown when error is true */
|
|
26
38
|
errorLabel?: string
|
|
39
|
+
/** Hint text */
|
|
27
40
|
hint?: string
|
|
41
|
+
/** Disables the field */
|
|
28
42
|
disabled?: boolean
|
|
43
|
+
/** Marks as required — adds a red asterisk after the label */
|
|
29
44
|
required?: boolean
|
|
45
|
+
/** Material Symbol icon */
|
|
30
46
|
leadingIcon?: string
|
|
47
|
+
/** Show clear button */
|
|
31
48
|
clearable?: boolean
|
|
49
|
+
/**
|
|
50
|
+
* Overrides the auto-detected background color used to cut the floating label out of the outlined border
|
|
51
|
+
*/
|
|
32
52
|
fieldBg?: string
|
|
53
|
+
/** Delay (ms) before firing the @debounced event */
|
|
33
54
|
debounce?: number
|
|
34
55
|
}>(),
|
|
35
56
|
{
|
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Pinterest-style column layout that fills the shortest column first. Re-lays out on container resize via
|
|
4
|
+
* `ResizeObserver` and when the slotted content changes.
|
|
5
|
+
*
|
|
6
|
+
* @slot default The items, laid out in columns.
|
|
7
|
+
*/
|
|
2
8
|
import { ref, computed, onMounted, onBeforeUnmount, watch, nextTick, useSlots } from 'vue'
|
|
3
9
|
|
|
4
10
|
const props = withDefaults(
|
|
5
11
|
defineProps<{
|
|
12
|
+
/** Default column count */
|
|
6
13
|
cols?: number
|
|
14
|
+
/** Columns at sm breakpoint (640px) */
|
|
7
15
|
smCols?: number
|
|
16
|
+
/** Columns at md breakpoint (768px) */
|
|
8
17
|
mdCols?: number
|
|
18
|
+
/** Columns at lg breakpoint (1024px) */
|
|
9
19
|
lgCols?: number
|
|
20
|
+
/** Gap between items */
|
|
10
21
|
gap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
11
22
|
}>(),
|
|
12
23
|
{ cols: 2, gap: 'md' },
|
package/src/components/MMenu.vue
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A trigger-based dropdown menu, composed with `MMenuItem` and `MMenuDivider`. Items support unlimited-depth
|
|
4
|
+
* nested submenus via the `#children` slot.
|
|
5
|
+
*
|
|
6
|
+
* @slot trigger The element that opens the menu when clicked; `open` tells whether it's open.
|
|
7
|
+
* @slot default The menu's items (MMenuItem, MMenuDivider or your own markup); `close()` closes the menu.
|
|
8
|
+
*/
|
|
2
9
|
import { computed, Fragment, inject, nextTick, onMounted, onUnmounted, provide, ref, useSlots, watch, type VNode } from 'vue'
|
|
3
10
|
import MIcon from './MIcon.vue'
|
|
4
11
|
import MMenuDivider from './MMenuDivider.vue'
|
|
5
12
|
|
|
13
|
+
defineOptions({ inheritAttrs: false })
|
|
14
|
+
|
|
6
15
|
const props = withDefaults(
|
|
7
16
|
defineProps<{
|
|
8
17
|
/** Which edge of the trigger the dropdown aligns to. */
|
|
@@ -15,13 +24,16 @@ const props = withDefaults(
|
|
|
15
24
|
*/
|
|
16
25
|
submenuMode?: 'flyout' | 'push'
|
|
17
26
|
/**
|
|
18
|
-
*
|
|
19
|
-
* (
|
|
20
|
-
*
|
|
21
|
-
* (`SegmentedMenuTokens.ContainerShape`/`CornerLarge`). Combine with
|
|
22
|
-
* `<MMenuDivider gap />` to split the panel into independently-rounded
|
|
23
|
-
* groups with a visible gap between them, instead of a plain line.
|
|
27
|
+
* 'standard' is M3's baseline menu (4dp corners). 'expressive' is M3's rounder 'vertical menu' styling
|
|
28
|
+
* (16dp corners) — combine with `<MMenuDivider gap />` to split the panel into independently-rounded groups
|
|
29
|
+
* with a visible gap, instead of a plain divider line.
|
|
24
30
|
*/
|
|
31
|
+
// `'standard'` is M3's baseline menu — square-ish 4dp corners
|
|
32
|
+
// (`MenuTokens.ContainerShape`/`CornerExtraSmall`).
|
|
33
|
+
// `'expressive'` is M3's rounder "vertical menu" styling — 16dp corners
|
|
34
|
+
// (`SegmentedMenuTokens.ContainerShape`/`CornerLarge`). Combine with
|
|
35
|
+
// `<MMenuDivider gap />` to split the panel into independently-rounded
|
|
36
|
+
// groups with a visible gap between them, instead of a plain line.
|
|
25
37
|
variant?: 'standard' | 'expressive'
|
|
26
38
|
}>(),
|
|
27
39
|
{ align: 'right', submenuMode: 'flyout', variant: 'standard' },
|
|
@@ -385,7 +397,7 @@ const origin = computed(() =>
|
|
|
385
397
|
</script>
|
|
386
398
|
|
|
387
399
|
<template>
|
|
388
|
-
<div ref="triggerEl" class="inline-block" @click="toggle">
|
|
400
|
+
<div ref="triggerEl" v-bind="$attrs" class="inline-block" @click="toggle">
|
|
389
401
|
<slot name="trigger" :open="open" />
|
|
390
402
|
</div>
|
|
391
403
|
|
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* An item of an MMenu or MContextMenu: icon, label and a shortcut hint. Put more items in its `#children` slot
|
|
4
|
+
* to make it open a submenu.
|
|
5
|
+
*
|
|
6
|
+
* @slot default Item label text.
|
|
7
|
+
* @slot children Nested submenu items. In the parent MMenu's default 'flyout' mode, clicking or hovering (mouse
|
|
8
|
+
* only) the item opens a side panel — supports unlimited nesting depth. In 'push' mode, clicking the item
|
|
9
|
+
* instead swaps the whole menu panel to the submenu with a back header; hover does nothing.
|
|
10
|
+
* @event click Emitted when a leaf item (no #children) is clicked. Not emitted for disabled items or for items
|
|
11
|
+
* with #children, since clicking those just opens/toggles the submenu instead.
|
|
12
|
+
*/
|
|
2
13
|
import { computed, inject, ref, useSlots } from 'vue'
|
|
3
14
|
import MIcon from './MIcon.vue'
|
|
4
15
|
|
|
5
16
|
const props = withDefaults(defineProps<{
|
|
17
|
+
/** Material Symbol icon name */
|
|
6
18
|
icon?: string
|
|
19
|
+
/** Keyboard shortcut hint displayed on the right (e.g. "Ctrl+C") — hidden when the item has #children */
|
|
7
20
|
shortcut?: string
|
|
21
|
+
/** Vue Router destination — renders as RouterLink instead of button */
|
|
8
22
|
to?: string | Record<string, any>
|
|
23
|
+
/** Disables the item */
|
|
9
24
|
disabled?: boolean
|
|
25
|
+
/** Danger/destructive styling (error color) */
|
|
10
26
|
danger?: boolean
|
|
11
27
|
/** Keep the menu open after this item is clicked (e.g. checkable/toggle items). */
|
|
12
28
|
keepOpen?: boolean
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Multi-value autocomplete with inline search. Type to filter, Enter to toggle, Backspace to remove last chip.
|
|
4
|
+
*
|
|
5
|
+
* @event update:modelValue Emitted on selection change — powers v-model
|
|
6
|
+
* @event debounced Emitted debounce ms after the user stops typing the search query (only when debounce > 0)
|
|
7
|
+
*/
|
|
2
8
|
import { computed, ref, useId, onMounted, onUnmounted, watch, nextTick } from 'vue'
|
|
3
9
|
import MIcon from './MIcon.vue'
|
|
4
10
|
import MIconButton from './MIconButton.vue'
|
|
@@ -14,23 +20,43 @@ defineOptions({ inheritAttrs: false })
|
|
|
14
20
|
|
|
15
21
|
const props = withDefaults(
|
|
16
22
|
defineProps<{
|
|
23
|
+
/** Selected values (v-model) */
|
|
17
24
|
modelValue: unknown[]
|
|
25
|
+
/** The options to choose from; see `MultiSelectOption`. */
|
|
18
26
|
options: MultiSelectOption[]
|
|
27
|
+
/** Floating label text */
|
|
19
28
|
label?: string
|
|
29
|
+
/** Input placeholder */
|
|
20
30
|
placeholder?: string
|
|
31
|
+
/** Field style */
|
|
21
32
|
variant?: 'filled' | 'outlined'
|
|
33
|
+
/** Dropdown mode: docked (inline) or modal (dialog) */
|
|
22
34
|
mode?: 'docked' | 'modal'
|
|
35
|
+
/** Disables the field */
|
|
23
36
|
disabled?: boolean
|
|
37
|
+
/** Error state */
|
|
24
38
|
error?: boolean
|
|
39
|
+
/** Error message shown when error is true */
|
|
25
40
|
errorLabel?: string
|
|
41
|
+
/** Helper text below field */
|
|
26
42
|
hint?: string
|
|
43
|
+
/** Marks as required — adds a red asterisk after the label */
|
|
27
44
|
required?: boolean
|
|
45
|
+
/** Material Symbol icon name */
|
|
28
46
|
leadingIcon?: string
|
|
47
|
+
/**
|
|
48
|
+
* Overrides the auto-detected background color used to cut the floating label out of the outlined border
|
|
49
|
+
*/
|
|
29
50
|
fieldBg?: string
|
|
51
|
+
/** Show a clear-all button */
|
|
30
52
|
clearable?: boolean
|
|
53
|
+
/** Max visible chips before "+N" */
|
|
31
54
|
maxChips?: number
|
|
55
|
+
/** Text when no options match */
|
|
32
56
|
noResultsText?: string
|
|
57
|
+
/** Remove already-selected options from the dropdown */
|
|
33
58
|
hideSelected?: boolean
|
|
59
|
+
/** Delay (ms) before filtering and firing @debounced. Selection is always instant */
|
|
34
60
|
debounce?: number
|
|
35
61
|
}>(),
|
|
36
62
|
{
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Select multiple values with removable chips and an optional in-dropdown search.
|
|
4
|
+
*
|
|
5
|
+
* @slot no-results Custom content shown in the dropdown when no options match the search query
|
|
6
|
+
* @event update:modelValue Emitted with the new array of selected values.
|
|
7
|
+
*/
|
|
2
8
|
import { computed, ref, useId, onMounted, onUnmounted, nextTick, watch } from 'vue'
|
|
3
9
|
import MIcon from './MIcon.vue'
|
|
4
10
|
import MIconButton from './MIconButton.vue'
|
|
@@ -20,24 +26,45 @@ defineOptions({ inheritAttrs: false })
|
|
|
20
26
|
|
|
21
27
|
const props = withDefaults(
|
|
22
28
|
defineProps<{
|
|
29
|
+
/** Selected values (any type — v-model) */
|
|
23
30
|
modelValue: unknown[]
|
|
31
|
+
/** The options to choose from; see `MultiSelectOption`. */
|
|
24
32
|
options: MultiSelectOption[]
|
|
33
|
+
/** Field label */
|
|
25
34
|
label?: string
|
|
35
|
+
/** Placeholder when nothing selected */
|
|
26
36
|
placeholder?: string
|
|
37
|
+
/** Visual style */
|
|
27
38
|
variant?: 'filled' | 'outlined'
|
|
39
|
+
/** Dropdown mode: docked (inline) or modal (dialog) */
|
|
28
40
|
mode?: 'docked' | 'modal'
|
|
41
|
+
/** Disables the field */
|
|
29
42
|
disabled?: boolean
|
|
43
|
+
/** Error state */
|
|
30
44
|
error?: boolean
|
|
45
|
+
/** Error message shown when error is true */
|
|
31
46
|
errorLabel?: string
|
|
47
|
+
/** Hint text below the field */
|
|
32
48
|
hint?: string
|
|
49
|
+
/** Marks as required — adds a red asterisk after the label */
|
|
33
50
|
required?: boolean
|
|
51
|
+
/** Material Symbol shown before the trigger */
|
|
34
52
|
leadingIcon?: string
|
|
53
|
+
/**
|
|
54
|
+
* Overrides the auto-detected background color used to cut the floating label out of the outlined border
|
|
55
|
+
*/
|
|
35
56
|
fieldBg?: string
|
|
57
|
+
/** Show search in dropdown */
|
|
36
58
|
searchable?: boolean
|
|
59
|
+
/** Max visible chips before "+N" */
|
|
37
60
|
maxChips?: number
|
|
61
|
+
/** Show a clear button to reset all selections */
|
|
38
62
|
clearable?: boolean
|
|
63
|
+
/** Placeholder for search input in dropdown — defaults to the current locale's string */
|
|
39
64
|
searchPlaceholder?: string
|
|
65
|
+
/** Text when no options match search — defaults to the current locale's string */
|
|
40
66
|
noResultsText?: string
|
|
67
|
+
/** Remove already-selected options from the dropdown */
|
|
41
68
|
hideSelected?: boolean
|
|
42
69
|
}>(),
|
|
43
70
|
{
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A mobile bottom navigation bar with a pill indicator and badge support.
|
|
4
|
+
*
|
|
5
|
+
* @event update:modelValue Emitted when an item is clicked — powers v-model
|
|
6
|
+
*/
|
|
2
7
|
import MIcon from './MIcon.vue'
|
|
3
8
|
import MBadge from './MBadge.vue'
|
|
4
9
|
|
|
@@ -11,7 +16,9 @@ export interface NavBarItem {
|
|
|
11
16
|
}
|
|
12
17
|
|
|
13
18
|
withDefaults(defineProps<{
|
|
19
|
+
/** Active item value, v-model */
|
|
14
20
|
modelValue: string | number
|
|
21
|
+
/** Array of nav bar items (see `NavBarItem`) */
|
|
15
22
|
items: NavBarItem[]
|
|
16
23
|
}>(), {})
|
|
17
24
|
|
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A slide-out or inline drawer of grouped, badge-able, optionally-nested navigation items — modal (Teleported,
|
|
4
|
+
* scrim-backed) or inline (participates in layout, supports a collapsed icon-only mode).
|
|
5
|
+
*
|
|
6
|
+
* @slot header Custom header content (e.g. profile card, logo). Fully generic, no positioning constraints
|
|
7
|
+
* applied — overrides the title prop.
|
|
8
|
+
* @slot default Free content rendered at the end of the scrollable area, after all sections. Use for footers,
|
|
9
|
+
* logout buttons, or any custom content.
|
|
10
|
+
* @slot toggle Collapse/expand toggle button area (inline variant only). Renders inside a 72px centered
|
|
11
|
+
* container with a bottom border that aligns with MTopAppBar (64px height). The icon stays anchored in the
|
|
12
|
+
* same position during collapse/expand transitions.
|
|
13
|
+
* @event update:modelValue Open/closed state for v-model
|
|
14
|
+
* @event select Fires when an item is clicked — use to track the selected item
|
|
15
|
+
*/
|
|
2
16
|
import { ref, reactive, watch, provide, computed } from "vue";
|
|
3
17
|
import MIcon from "./MIcon.vue";
|
|
4
18
|
import MDrawerItemList from "./_MDrawerItemList.vue";
|
|
@@ -24,15 +38,28 @@ export interface DrawerSection {
|
|
|
24
38
|
collapsible?: boolean;
|
|
25
39
|
}
|
|
26
40
|
|
|
41
|
+
defineOptions({ inheritAttrs: false })
|
|
42
|
+
|
|
27
43
|
const props = withDefaults(
|
|
28
44
|
defineProps<{
|
|
45
|
+
/** Open/closed state (v-model) */
|
|
29
46
|
modelValue: boolean;
|
|
47
|
+
/** Currently selected item value */
|
|
30
48
|
selected?: string | number;
|
|
49
|
+
/** Array of sections (see the types below) */
|
|
31
50
|
sections: DrawerSection[];
|
|
51
|
+
/** Drawer header title (ignored if the #header slot is used) */
|
|
32
52
|
title?: string;
|
|
53
|
+
/** Modal with a Teleported scrim overlay, or an inline sidebar that participates in normal layout flow */
|
|
33
54
|
modal?: boolean;
|
|
55
|
+
/** Compact mode (72px) showing only icons — inline variant only */
|
|
34
56
|
collapsed?: boolean;
|
|
57
|
+
/** Custom drawer width (e.g. "320px", "25rem"). Defaults to 22.5rem (360px) */
|
|
35
58
|
width?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Which side the drawer opens from. Top/bottom are only available for the modal variant — the inline
|
|
61
|
+
* variant always renders on left or right.
|
|
62
|
+
*/
|
|
36
63
|
side?: 'left' | 'right' | 'top' | 'bottom';
|
|
37
64
|
}>(),
|
|
38
65
|
{ modal: true, side: 'left' },
|
|
@@ -131,7 +158,7 @@ watch(
|
|
|
131
158
|
<template>
|
|
132
159
|
<!-- ── Modal variant ──────────────────────────────────────── -->
|
|
133
160
|
<Teleport v-if="modal" to="body">
|
|
134
|
-
<Transition name="nd" :duration="{ enter: 300, leave: 280 }">
|
|
161
|
+
<Transition name="nd" :duration="{ enter: 300, leave: 280 }" appear>
|
|
135
162
|
<div
|
|
136
163
|
v-if="modelValue"
|
|
137
164
|
class="fixed inset-0 z-100 flex"
|
|
@@ -144,6 +171,7 @@ watch(
|
|
|
144
171
|
<div class="nd-scrim absolute inset-0 bg-scrim/32" @click="close" />
|
|
145
172
|
|
|
146
173
|
<nav
|
|
174
|
+
v-bind="$attrs"
|
|
147
175
|
:class="[
|
|
148
176
|
'nd-panel relative flex flex-col bg-surface-container-low shadow-elevation-1',
|
|
149
177
|
`nd-panel-${side}`,
|
|
@@ -270,6 +298,7 @@ watch(
|
|
|
270
298
|
<!-- ── Standard (inline) variant ──────────────────────────── -->
|
|
271
299
|
<template v-else>
|
|
272
300
|
<nav
|
|
301
|
+
v-bind="$attrs"
|
|
273
302
|
class="nd-inline flex h-full shrink-0 flex-col bg-surface"
|
|
274
303
|
:class="[
|
|
275
304
|
inlineSide === 'right' ? 'border-l border-outline-variant rounded-l-lg' : 'border-r border-outline-variant rounded-r-lg',
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Compact vertical navigation for desktop/tablet layouts with a pill indicator, an optional wide "expanded"
|
|
4
|
+
* state, and an optional modal (flyout) variant.
|
|
5
|
+
*
|
|
6
|
+
* @slot fab A FAB (or MFabMenu) at the top of the rail, above the items.
|
|
7
|
+
* @event update:modelValue Emitted when an item is clicked — powers v-model
|
|
8
|
+
* @event update:expanded Emitted when the modal panel closes (modal mode only) — pair with :expanded for
|
|
9
|
+
* v-model:expanded
|
|
10
|
+
*/
|
|
2
11
|
import { computed, ref, watch, onUnmounted } from 'vue'
|
|
3
12
|
import MIcon from './MIcon.vue'
|
|
4
13
|
import MBadge from './MBadge.vue'
|
|
@@ -15,19 +24,30 @@ export interface NavRailItem {
|
|
|
15
24
|
to?: ItemLink
|
|
16
25
|
}
|
|
17
26
|
|
|
27
|
+
defineOptions({ inheritAttrs: false })
|
|
28
|
+
|
|
18
29
|
const props = withDefaults(defineProps<{
|
|
30
|
+
/** Active item value, v-model */
|
|
19
31
|
modelValue: string | number
|
|
32
|
+
/** Array of rail items (see `NavRailItem`) */
|
|
20
33
|
items: NavRailItem[]
|
|
34
|
+
/** Vertical alignment of items within the rail */
|
|
21
35
|
alignment?: 'top' | 'center' | 'bottom'
|
|
22
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* Widens the rail (220px) and shows each item's icon beside its label in a full-width pill, instead of the icon
|
|
38
|
+
* over the label. Toggle it from your own menu button.
|
|
39
|
+
*/
|
|
40
|
+
// M3 `WideNavigationRail`'s expanded state: items become icon+label side by side in a full-width pill instead of icon-over-label in a narrow centered one.
|
|
23
41
|
expanded?: boolean
|
|
24
42
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* collapsed/expanded, the collapsed rail stays on screen exactly as-is (so it never
|
|
28
|
-
* affects the app's layout grid — `ModalWideNavigationRail`'s whole point) and `expanded`
|
|
29
|
-
* instead opens a Teleported, scrim-backed panel that floats above the rest of the app.
|
|
43
|
+
* Keeps the rail collapsed and opens the expanded rail as a panel over the app, with a scrim, instead of
|
|
44
|
+
* widening in place. It closes on a scrim click, Escape or picking an item, emitting `update:expanded`.
|
|
30
45
|
*/
|
|
46
|
+
// M3 `ModalWideNavigationRail` (default `hideOnCollapse = false` variant — not the
|
|
47
|
+
// dismissible, slide-from-offscreen one). Instead of this rail itself resizing between
|
|
48
|
+
// collapsed/expanded, the collapsed rail stays on screen exactly as-is (so it never
|
|
49
|
+
// affects the app's layout grid — `ModalWideNavigationRail`'s whole point) and `expanded`
|
|
50
|
+
// instead opens a Teleported, scrim-backed panel that floats above the rest of the app.
|
|
31
51
|
modal?: boolean
|
|
32
52
|
}>(), { alignment: 'top', expanded: false, modal: false })
|
|
33
53
|
|
|
@@ -173,6 +193,7 @@ onUnmounted(() => {
|
|
|
173
193
|
that actually reacts to `expanded` when `modal` is set.
|
|
174
194
|
-->
|
|
175
195
|
<nav
|
|
196
|
+
v-bind="$attrs"
|
|
176
197
|
class="flex h-full flex-col border-r border-outline-variant bg-surface transition-[width] duration-200"
|
|
177
198
|
:class="railExpanded ? 'w-[220px]' : 'w-20'"
|
|
178
199
|
>
|