@m3ui-vue/m3ui-vue 0.9.0 → 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 +12 -2
- package/dist/API.md +3661 -0
- package/dist/MIcon-CaEooCmZ.js.map +1 -1
- package/dist/{MTextField-B0wGv1Mx.js → MTextField-pJU1vFaR.js} +3 -3
- package/dist/MTextField-pJU1vFaR.js.map +1 -0
- package/dist/api.json +1 -0
- 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 +7 -1
- 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 +9 -7
- 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/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 +14 -0
- 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 +6 -0
- 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 +4 -0
- 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 +10 -0
- 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/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 +10 -0
- package/dist/components/MSkeleton.vue.d.ts +8 -0
- package/dist/components/MSlider.vue.d.ts +14 -0
- 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 +7 -0
- 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 +5 -0
- 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 +32 -0
- package/dist/composables/useLocale.d.ts +2 -0
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +5239 -5242
- package/dist/m3ui.js.map +1 -1
- package/dist/markdown.js +1 -1
- package/dist/markdown.js.map +1 -1
- package/dist/qrcode.js.map +1 -1
- package/dist/rich-text-editor.js +3 -3
- package/dist/rich-text-editor.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/terminal.js.map +1 -1
- package/dist/{useLocale-CmI675Ab.js → useLocale-Drihe5G2.js} +13 -10
- package/dist/useLocale-Drihe5G2.js.map +1 -0
- package/package.json +4 -2
- package/src/__tests__/MHotkeys.test.ts +57 -0
- package/src/__tests__/hostLocale.test.ts +57 -0
- 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 +14 -0
- package/src/components/MBottomSheet.vue +12 -0
- 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 +17 -1
- 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 +15 -0
- package/src/components/MColorPicker.vue +13 -0
- package/src/components/MColorPickerModal.vue +12 -0
- package/src/components/MCommandPalette.vue +16 -0
- package/src/components/MConfirmDialog.vue +15 -0
- package/src/components/MContainer.vue +9 -0
- package/src/components/MContextMenu.vue +17 -6
- 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 +16 -0
- package/src/components/MDateRangePicker.vue +23 -0
- package/src/components/MDateRangePickerModal.vue +16 -0
- package/src/components/MDialog.vue +27 -7
- 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 +7 -0
- 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 +17 -0
- 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 +16 -0
- 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 +12 -0
- 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 +16 -6
- 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 +25 -0
- package/src/components/MNavigationRail.vue +24 -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 +10 -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 +21 -0
- 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 +13 -0
- 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 +14 -0
- package/src/components/MSplitter.vue +10 -0
- package/src/components/MSpotlightSearch.vue +27 -0
- 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 +11 -0
- 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 +12 -0
- 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 +15 -0
- package/src/components/MTopAppBar.vue +18 -0
- package/src/components/MTour.vue +13 -0
- 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/useLocale.ts +16 -3
- package/src/plugin.ts +2 -1
- package/dist/MTextField-B0wGv1Mx.js.map +0 -1
- package/dist/useLocale-CmI675Ab.js.map +0 -1
|
@@ -1,14 +1,26 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A modal, centered time picker with a clock dial and a keyboard input mode. Supports AM/PM toggle and 24h
|
|
4
|
+
* format — the sibling of MTimePicker, a fully separate component rather than a shared internal.
|
|
5
|
+
*
|
|
6
|
+
* @event update:modelValue Emitted when a time 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'
|
|
5
12
|
import { useLocale } from '../composables/useLocale'
|
|
6
13
|
|
|
7
14
|
const props = withDefaults(defineProps<{
|
|
15
|
+
/** Selected time in HH:MM format (v-model) */
|
|
8
16
|
modelValue: string | null
|
|
17
|
+
/** Controls dialog visibility (v-model:show) */
|
|
9
18
|
show?: boolean
|
|
19
|
+
/** Use 24-hour format (shows inner ring 13-23) */
|
|
10
20
|
use24h?: boolean
|
|
21
|
+
/** Minute increment step */
|
|
11
22
|
minuteStep?: number
|
|
23
|
+
/** Dialog title */
|
|
12
24
|
title?: string
|
|
13
25
|
}>(), {
|
|
14
26
|
modelValue: null,
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A vertical event timeline with icon dots, dates, and colors — standard single-column or alternating
|
|
4
|
+
* left/right layout.
|
|
5
|
+
*/
|
|
2
6
|
import MIcon from "./MIcon.vue";
|
|
3
7
|
|
|
4
8
|
export interface TimelineItem {
|
|
@@ -12,8 +16,11 @@ export interface TimelineItem {
|
|
|
12
16
|
|
|
13
17
|
withDefaults(
|
|
14
18
|
defineProps<{
|
|
19
|
+
/** Array of timeline entries — required */
|
|
15
20
|
items: TimelineItem[];
|
|
21
|
+
/** Compact spacing between items */
|
|
16
22
|
dense?: boolean;
|
|
23
|
+
/** Alternate items left/right of a central line instead of a single left-aligned column */
|
|
17
24
|
alternating?: boolean;
|
|
18
25
|
}>(),
|
|
19
26
|
{ dense: false, alternating: false },
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Semantic heading component in three sizes — a thin wrapper around `MText` at medium weight.
|
|
4
|
+
*
|
|
5
|
+
* @slot default The title text.
|
|
6
|
+
*/
|
|
2
7
|
import { computed } from 'vue'
|
|
3
8
|
import MText from './MText.vue'
|
|
4
9
|
import type { TextVariant } from './MText.vue'
|
|
5
10
|
|
|
6
11
|
const props = withDefaults(
|
|
7
12
|
defineProps<{
|
|
13
|
+
/** Title size (maps to headline-large/medium/small) */
|
|
8
14
|
size?: 'large' | 'medium' | 'small'
|
|
15
|
+
/** Text color */
|
|
9
16
|
color?: 'on-surface' | 'on-surface-variant' | 'primary' | 'secondary' | 'tertiary' | 'error' | 'inherit'
|
|
17
|
+
/** Text alignment */
|
|
10
18
|
align?: 'left' | 'center' | 'right'
|
|
19
|
+
/** Truncate text with ellipsis on overflow */
|
|
11
20
|
truncate?: boolean
|
|
12
21
|
}>(),
|
|
13
22
|
{ size: 'large', color: 'inherit' },
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* M3 Expressive's standalone toggle button — morphs its own shape between a pill and a squared corner on check,
|
|
4
|
+
* and squishes further while pressed, all on a real spring. Distinct from MSegmentedButton/MButtonGroup, which
|
|
5
|
+
* are groups of options — this is a single button.
|
|
6
|
+
*
|
|
7
|
+
* @slot default The button's label, after the icon.
|
|
8
|
+
* @event update:checked Emitted when clicked — powers v-model:checked
|
|
9
|
+
*/
|
|
2
10
|
import { computed, onMounted, onUnmounted, ref, watch } from 'vue'
|
|
3
11
|
import MIcon from './MIcon.vue'
|
|
4
12
|
|
|
@@ -6,9 +14,13 @@ const props = withDefaults(
|
|
|
6
14
|
defineProps<{
|
|
7
15
|
/** Whether the toggle button is checked/selected — v-model. */
|
|
8
16
|
checked: boolean
|
|
17
|
+
/** Visual style, matching MButton's naming */
|
|
9
18
|
variant?: 'filled' | 'tonal' | 'outlined' | 'elevated'
|
|
19
|
+
/** Disables interaction */
|
|
10
20
|
disabled?: boolean
|
|
21
|
+
/** Material Symbol icon name shown before the label */
|
|
11
22
|
icon?: string
|
|
23
|
+
/** Same 5-tier expressive sizing as MButton */
|
|
12
24
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
13
25
|
}>(),
|
|
14
26
|
{
|
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A container for grouping icon buttons and actions — docked to an edge or floating as a rounded pill,
|
|
4
|
+
* horizontal or vertical, with an optional paired FAB.
|
|
5
|
+
*
|
|
6
|
+
* @slot fab A FAB rendered alongside the toolbar body, positioned by fabPosition
|
|
7
|
+
* @slot default Toolbar items — typically MIconButton/MButton, separated with MDivider
|
|
8
|
+
*/
|
|
2
9
|
import { computed } from 'vue'
|
|
3
10
|
|
|
4
11
|
const props = withDefaults(defineProps<{
|
|
12
|
+
/** Docked (edge-attached, full width/height, bordered) or floating (rounded pill with shadow) */
|
|
5
13
|
variant?: 'docked' | 'floating'
|
|
14
|
+
/** Layout direction */
|
|
6
15
|
orientation?: 'horizontal' | 'vertical'
|
|
16
|
+
/** Background color scheme */
|
|
7
17
|
color?: 'surface' | 'primary' | 'secondary' | 'tertiary'
|
|
18
|
+
/** Where the #fab slot renders relative to the toolbar body */
|
|
8
19
|
fabPosition?: 'start' | 'end' | 'none'
|
|
20
|
+
/** Item alignment along the main axis */
|
|
9
21
|
align?: 'start' | 'center' | 'end' | 'between'
|
|
10
22
|
}>(), {
|
|
11
23
|
variant: 'docked',
|
|
@@ -1,12 +1,27 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A hover/focus-triggered label — plain text, or a rich variant with a title, detailed content, and action
|
|
4
|
+
* buttons.
|
|
5
|
+
*
|
|
6
|
+
* @slot default The trigger element the tooltip is anchored to
|
|
7
|
+
* @slot content Rich-tooltip body content (only used when rich is true)
|
|
8
|
+
* @slot actions Rich-tooltip action buttons row (only used when rich is true)
|
|
9
|
+
*/
|
|
2
10
|
import { nextTick, onMounted, onUnmounted, ref } from 'vue'
|
|
3
11
|
|
|
4
12
|
defineOptions({ inheritAttrs: false })
|
|
5
13
|
|
|
6
14
|
const props = withDefaults(defineProps<{
|
|
15
|
+
/** Tooltip text (plain variant), or the rich variant's title line */
|
|
7
16
|
text?: string
|
|
17
|
+
/** Tooltip position relative to the trigger */
|
|
8
18
|
placement?: 'top' | 'bottom' | 'left' | 'right'
|
|
19
|
+
/** Show delay in ms after hover/focus */
|
|
9
20
|
delay?: number
|
|
21
|
+
/**
|
|
22
|
+
* Rich tooltip with a #content slot and optional #actions. Stays open when hovering the tooltip itself
|
|
23
|
+
* instead of closing immediately.
|
|
24
|
+
*/
|
|
10
25
|
rich?: boolean
|
|
11
26
|
}>(), { placement: 'top', delay: 600, rich: false })
|
|
12
27
|
|
|
@@ -1,16 +1,34 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A top app bar in four M3 layouts — center-aligned, small, medium, and large — with a leading navigation icon
|
|
4
|
+
* and trailing actions.
|
|
5
|
+
*
|
|
6
|
+
* @slot navigation Custom leading area (default: an MIconButton built from the navigationIcon prop)
|
|
7
|
+
* @slot title Custom title content (default: renders the title prop)
|
|
8
|
+
* @slot actions Trailing action buttons
|
|
9
|
+
* @event navigation Emitted when the default navigation icon button is clicked (not emitted when the
|
|
10
|
+
* #navigation slot is overridden — that content is fully custom)
|
|
11
|
+
*/
|
|
2
12
|
import MIconButton from './MIconButton.vue'
|
|
3
13
|
import { useLocale } from '../composables/useLocale'
|
|
4
14
|
|
|
5
15
|
withDefaults(defineProps<{
|
|
16
|
+
/** App bar title */
|
|
6
17
|
title?: string
|
|
18
|
+
/** 64dp small/center-aligned row, or a 112dp medium / 152dp large two-row layout with the title below */
|
|
7
19
|
variant?: 'center' | 'small' | 'medium' | 'large'
|
|
20
|
+
/** Leading icon (e.g. menu, arrow_back) */
|
|
8
21
|
navigationIcon?: string
|
|
9
22
|
/** Accessible label for the navigation icon button — defaults to the
|
|
10
23
|
* locale's generic "Menu" label; override when navigationIcon is
|
|
11
24
|
* actually a back arrow rather than a drawer toggle. */
|
|
12
25
|
navigationLabel?: string
|
|
26
|
+
/**
|
|
27
|
+
* Swaps both container color (surface → surface-container) and elevation (level 0 → level 2), matching the
|
|
28
|
+
* real M3 on-scroll container tokens rather than just adding a shadow
|
|
29
|
+
*/
|
|
13
30
|
elevated?: boolean
|
|
31
|
+
/** Add a bottom border (border-outline-variant) */
|
|
14
32
|
bordered?: boolean
|
|
15
33
|
}>(), { variant: 'small' })
|
|
16
34
|
|
package/src/components/MTour.vue
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A guided, step-by-step walkthrough that highlights a page element per step with an auto-positioned tooltip
|
|
4
|
+
* and a dimming scrim.
|
|
5
|
+
*
|
|
6
|
+
* @event update:modelValue Emitted when the tour opens or closes (Escape-less — closed via the X button,
|
|
7
|
+
* clicking the scrim, or finishing) — powers v-model
|
|
8
|
+
* @event finish Emitted when the user completes the last step (clicks the finish button)
|
|
9
|
+
*/
|
|
2
10
|
import { ref, computed, watch, nextTick, onBeforeUnmount } from 'vue'
|
|
3
11
|
import MButton from './MButton.vue'
|
|
4
12
|
import MIcon from './MIcon.vue'
|
|
@@ -12,10 +20,15 @@ export interface TourStep {
|
|
|
12
20
|
}
|
|
13
21
|
|
|
14
22
|
const props = defineProps<{
|
|
23
|
+
/** Show/hide the tour (v-model) */
|
|
15
24
|
modelValue: boolean
|
|
25
|
+
/** Ordered list of steps; see `TourStep` */
|
|
16
26
|
steps: TourStep[]
|
|
27
|
+
/** Label for the Previous button (defaults to the locale string, 'Previous') */
|
|
17
28
|
prevLabel?: string
|
|
29
|
+
/** Label for the Next button (defaults to the locale string, 'Next') */
|
|
18
30
|
nextLabel?: string
|
|
31
|
+
/** Label for the final step's button (defaults to the locale string, 'Finish') */
|
|
19
32
|
finishLabel?: string
|
|
20
33
|
}>()
|
|
21
34
|
|
|
@@ -9,6 +9,19 @@ export interface TransferItem {
|
|
|
9
9
|
</script>
|
|
10
10
|
|
|
11
11
|
<script setup lang="ts" generic="T extends TransferItem = TransferItem">
|
|
12
|
+
/**
|
|
13
|
+
* Move items between two panes, with select-all, optional search and v-model on the values in the target pane.
|
|
14
|
+
* Check rows and use the arrows, or double-click a row (or press Enter on its checkbox) to send it straight
|
|
15
|
+
* across. When the component is narrow, the panes stack and the arrows point up and down.
|
|
16
|
+
*
|
|
17
|
+
* @slot item Custom row content. Without bare it replaces the icon and text and keeps the checkbox, highlight
|
|
18
|
+
* and hover; with bare it draws the whole row. side is 'source' or 'target', toggle() checks the row, move()
|
|
19
|
+
* sends it to the other pane. Buttons, links, fields and elements with data-transfer-action keep their own
|
|
20
|
+
* clicks
|
|
21
|
+
* @slot source-empty Custom content when the source pane is empty
|
|
22
|
+
* @slot target-empty Custom content when the target pane is empty
|
|
23
|
+
* @event update:modelValue Emitted whenever items move between panes (v-model)
|
|
24
|
+
*/
|
|
12
25
|
import { computed, ref } from 'vue'
|
|
13
26
|
import MIconButton from './MIconButton.vue'
|
|
14
27
|
import MTransferPane from './_MTransferPane.vue'
|
|
@@ -19,16 +32,27 @@ const locale = useLocale()
|
|
|
19
32
|
type Value = string | number
|
|
20
33
|
|
|
21
34
|
const props = withDefaults(defineProps<{
|
|
35
|
+
/** Values in the target (right or bottom) pane (v-model) */
|
|
22
36
|
modelValue: Value[]
|
|
37
|
+
/** Full list of items; see `TransferItem` (or your own type extending it) */
|
|
23
38
|
items: T[]
|
|
39
|
+
/** Source pane title (defaults to the locale string) */
|
|
24
40
|
sourceTitle?: string
|
|
41
|
+
/** Target pane title (defaults to the locale string) */
|
|
25
42
|
targetTitle?: string
|
|
43
|
+
/** Show a search field in each pane. It matches the label and the description */
|
|
26
44
|
filterable?: boolean
|
|
45
|
+
/** Search field placeholder (defaults to the locale string) */
|
|
27
46
|
searchPlaceholder?: string
|
|
47
|
+
/** Text when a pane is empty (defaults to the locale string) */
|
|
28
48
|
emptyText?: string
|
|
49
|
+
/** Aria label for the move-all-right button (defaults to the locale string) */
|
|
29
50
|
moveAllRightLabel?: string
|
|
51
|
+
/** Aria label for the move-selected-right button (defaults to the locale string) */
|
|
30
52
|
moveRightLabel?: string
|
|
53
|
+
/** Aria label for the move-selected-left button (defaults to the locale string) */
|
|
31
54
|
moveLeftLabel?: string
|
|
55
|
+
/** Aria label for the move-all-left button (defaults to the locale string) */
|
|
32
56
|
moveAllLeftLabel?: string
|
|
33
57
|
/** Height of each list's scroll area (any CSS length). */
|
|
34
58
|
listHeight?: string
|
package/src/components/MTree.vue
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A hierarchical tree view with expand/collapse, single-node selection, and optional cascading checkbox
|
|
4
|
+
* selection.
|
|
5
|
+
*
|
|
6
|
+
* @event update:selected Fires when a node is clicked, toggling selection (clicking the already-selected node
|
|
7
|
+
* clears it)
|
|
8
|
+
* @event update:checked Fires when a checkbox toggles a node (checkable mode)
|
|
9
|
+
* @event node-click Fires whenever a node row is clicked, alongside update:selected
|
|
10
|
+
*/
|
|
2
11
|
import { computed, provide, ref, type Ref } from 'vue'
|
|
3
12
|
import MTreeNode from './_MTreeNode.vue'
|
|
4
13
|
import MIcon from './MIcon.vue'
|
|
@@ -32,6 +41,7 @@ export interface TreeContext {
|
|
|
32
41
|
|
|
33
42
|
const props = withDefaults(
|
|
34
43
|
defineProps<{
|
|
44
|
+
/** Root nodes to render — required */
|
|
35
45
|
nodes: TreeNode[]
|
|
36
46
|
/** Currently selected node id (single-select). */
|
|
37
47
|
selected?: string | number | null
|
|
@@ -44,6 +54,7 @@ const props = withDefaults(
|
|
|
44
54
|
* 'all' | 'none' | array of ids (default: 'none').
|
|
45
55
|
*/
|
|
46
56
|
defaultExpanded?: (string | number)[] | 'all' | 'none'
|
|
57
|
+
/** Text shown when nodes is empty. Falls back to the app's configured locale's noItems string */
|
|
47
58
|
emptyText?: string
|
|
48
59
|
}>(),
|
|
49
60
|
{
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A hierarchical table for nested data like file systems or org charts — rows can carry a `children` array, and
|
|
4
|
+
* the first column renders the indent and expand/collapse toggle automatically.
|
|
5
|
+
*
|
|
6
|
+
* @slot toolbar Toolbar content above the table, only rendered when this slot is used — gets
|
|
7
|
+
* expandAll()/collapseAll() helpers
|
|
8
|
+
* @event rowClick Emitted with the row when you click it.
|
|
9
|
+
*/
|
|
2
10
|
import { computed, ref } from 'vue'
|
|
3
11
|
import MIcon from './MIcon.vue'
|
|
4
12
|
import { useLocale } from '../composables/useLocale'
|
|
@@ -16,12 +24,19 @@ export interface TreeTableRow {
|
|
|
16
24
|
}
|
|
17
25
|
|
|
18
26
|
const props = withDefaults(defineProps<{
|
|
27
|
+
/** Column definitions; see `TreeTableColumn` */
|
|
19
28
|
columns: TreeTableColumn[]
|
|
29
|
+
/** Hierarchical rows with an optional children array; see `TreeTableRow` */
|
|
20
30
|
rows: TreeTableRow[]
|
|
31
|
+
/** Unique key field */
|
|
21
32
|
rowKey?: string
|
|
33
|
+
/** Expand all nodes with children by default */
|
|
22
34
|
defaultExpanded?: boolean
|
|
35
|
+
/** Indentation per depth level, in px */
|
|
23
36
|
indent?: number
|
|
37
|
+
/** Compact row height */
|
|
24
38
|
dense?: boolean
|
|
39
|
+
/** Text shown when rows is empty. Falls back to the app's configured locale's noResults string */
|
|
25
40
|
emptyText?: string
|
|
26
41
|
}>(), {
|
|
27
42
|
rowKey: 'id',
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Renders only the rows currently in (or near) the viewport, so a table with thousands of rows stays smooth —
|
|
4
|
+
* no pagination needed. Trade-off: no built-in search/filtering, sort is a client-side full-array sort.
|
|
5
|
+
*
|
|
6
|
+
* @event rowClick Emitted with the row's data when you click a row.
|
|
7
|
+
*/
|
|
2
8
|
import { computed, onBeforeUnmount, onMounted, ref } from 'vue'
|
|
3
9
|
import MIcon from './MIcon.vue'
|
|
4
10
|
|
|
@@ -11,11 +17,17 @@ export interface VTableColumn {
|
|
|
11
17
|
}
|
|
12
18
|
|
|
13
19
|
const props = withDefaults(defineProps<{
|
|
20
|
+
/** Column definitions; see `VTableColumn` */
|
|
14
21
|
columns: VTableColumn[]
|
|
22
|
+
/** All rows — the full array is held in memory, only visible rows are rendered to the DOM */
|
|
15
23
|
rows: Record<string, any>[]
|
|
24
|
+
/** Fixed row height in px, used for the virtualization math */
|
|
16
25
|
rowHeight?: number
|
|
26
|
+
/** Unique key field */
|
|
17
27
|
rowKey?: string
|
|
28
|
+
/** Extra rows rendered above/below the visible viewport, to reduce blank flashes on fast scroll */
|
|
18
29
|
overscan?: number
|
|
30
|
+
/** Scrollable container height (any valid CSS height) */
|
|
19
31
|
maxHeight?: string
|
|
20
32
|
}>(), {
|
|
21
33
|
rowHeight: 44,
|
|
@@ -11,6 +11,24 @@ const activeWindowId = moduleRef<number | null>(null)
|
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
13
|
<script setup lang="ts">
|
|
14
|
+
/**
|
|
15
|
+
* A floating, draggable, resizable window — the building block for a desktop-style multi-window UI inside your
|
|
16
|
+
* app. Drag from the title bar, resize from any edge or corner, minimize to just the title bar, maximize (or
|
|
17
|
+
* double-click the title bar) to fill its container, and click any window to bring it to front. The window in
|
|
18
|
+
* front shows a stronger title bar and elevation, the others step back. Material 3 has no window component, so
|
|
19
|
+
* this one is built from M3 pieces: surface tones, elevation levels, 32dp icon buttons with state layers, and
|
|
20
|
+
* standard motion.
|
|
21
|
+
*
|
|
22
|
+
* @slot header Replaces the default icon + title, keeps drag behavior
|
|
23
|
+
* @slot actions Extra buttons in the title bar, before minimize/maximize/close. MIconButton size="xs" matches
|
|
24
|
+
* the built-in ones
|
|
25
|
+
* @slot default The window's content, under the title bar. Unmounted while the window is hidden.
|
|
26
|
+
* @event close Emitted when the close button is clicked
|
|
27
|
+
* @event update:modelValue Emitted when the window closes — powers v-model
|
|
28
|
+
* @event minimize Emitted when the minimize button is toggled (either direction)
|
|
29
|
+
* @event maximize Emitted when the window is maximized (true) or restored (false)
|
|
30
|
+
* @event focus Emitted when the window comes to the front.
|
|
31
|
+
*/
|
|
14
32
|
import { ref, computed, onMounted, onUnmounted, watch, nextTick } from 'vue'
|
|
15
33
|
import MIcon from './MIcon.vue'
|
|
16
34
|
import { useLocale } from '../composables/useLocale'
|
|
@@ -20,18 +38,31 @@ const id = ++nextId
|
|
|
20
38
|
|
|
21
39
|
const props = withDefaults(
|
|
22
40
|
defineProps<{
|
|
41
|
+
/** Visible state (v-model) */
|
|
23
42
|
modelValue: boolean
|
|
43
|
+
/** Window title in the title bar */
|
|
24
44
|
title?: string
|
|
45
|
+
/** Material Symbol icon in the title bar */
|
|
25
46
|
icon?: string
|
|
47
|
+
/** Initial width */
|
|
26
48
|
width?: string
|
|
49
|
+
/** Initial height */
|
|
27
50
|
height?: string
|
|
51
|
+
/** Minimum width in px */
|
|
28
52
|
minWidth?: number
|
|
53
|
+
/** Minimum height in px */
|
|
29
54
|
minHeight?: number
|
|
55
|
+
/** Maximum width in px */
|
|
30
56
|
maxWidth?: number
|
|
57
|
+
/** Maximum height in px */
|
|
31
58
|
maxHeight?: number
|
|
59
|
+
/** Allow resizing from edges and corners */
|
|
32
60
|
resizable?: boolean
|
|
61
|
+
/** Allow dragging from the title bar */
|
|
33
62
|
draggable?: boolean
|
|
63
|
+
/** Show close button */
|
|
34
64
|
closable?: boolean
|
|
65
|
+
/** Show minimize button (collapses to title bar) */
|
|
35
66
|
minimizable?: boolean
|
|
36
67
|
/** Maximize button, and double-click on the title bar, to fill the parent and back. */
|
|
37
68
|
maximizable?: boolean
|
|
@@ -46,8 +77,11 @@ const props = withDefaults(
|
|
|
46
77
|
* The container should clip it (`overflow: hidden`).
|
|
47
78
|
*/
|
|
48
79
|
offscreen?: boolean
|
|
80
|
+
/** Initial X position */
|
|
49
81
|
x?: number
|
|
82
|
+
/** Initial Y position */
|
|
50
83
|
y?: number
|
|
84
|
+
/** Reset position, size, and state when the window is closed */
|
|
51
85
|
resetPosition?: boolean
|
|
52
86
|
}>(),
|
|
53
87
|
{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { inject, reactive, watchEffect, toValue, type InjectionKey, type MaybeRef } from 'vue'
|
|
1
|
+
import { inject, reactive, shallowRef, watchEffect, toValue, type InjectionKey, type MaybeRef } from 'vue'
|
|
2
2
|
|
|
3
3
|
export interface M3Locale {
|
|
4
4
|
/** BCP-47 language tag (e.g. 'en', 'es', 'pt') — read by locale-aware components (MRelativeTime) that use Intl formatting. */
|
|
@@ -323,12 +323,25 @@ export const defaultLocale: M3Locale = {
|
|
|
323
323
|
|
|
324
324
|
export const M3_LOCALE_KEY: InjectionKey<MaybeRef<Partial<M3Locale>>> = Symbol('m3-locale')
|
|
325
325
|
|
|
326
|
+
/**
|
|
327
|
+
* The locale given to `createM3UI()`, for components rendered outside the app that installed it:
|
|
328
|
+
* `useToast()` and `useNotification()` mount their hosts with an app of their own, where the
|
|
329
|
+
* plugin's `provide` doesn't reach. Inside the user's app the provided locale still wins.
|
|
330
|
+
*/
|
|
331
|
+
// Wrapped in an object: a shallowRef holding a ref directly gets that ref unwrapped in its type.
|
|
332
|
+
const appLocale = shallowRef<{ locale: MaybeRef<Partial<M3Locale>> } | null>(null)
|
|
333
|
+
|
|
334
|
+
/** @internal Called by `createM3UI()`; not exported from the package. */
|
|
335
|
+
export function __setAppLocale(locale: MaybeRef<Partial<M3Locale>> | null) {
|
|
336
|
+
appLocale.value = locale ? { locale } : null
|
|
337
|
+
}
|
|
338
|
+
|
|
326
339
|
export function useLocale(): M3Locale {
|
|
327
|
-
const provided = inject(M3_LOCALE_KEY,
|
|
340
|
+
const provided = inject(M3_LOCALE_KEY, null)
|
|
328
341
|
const locale = reactive({ ...defaultLocale }) as M3Locale
|
|
329
342
|
|
|
330
343
|
watchEffect(() => {
|
|
331
|
-
Object.assign(locale, defaultLocale, toValue(provided))
|
|
344
|
+
Object.assign(locale, defaultLocale, toValue(provided ?? appLocale.value?.locale ?? {}))
|
|
332
345
|
})
|
|
333
346
|
|
|
334
347
|
return locale
|
package/src/plugin.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { App, MaybeRef } from 'vue'
|
|
|
2
2
|
import type { Palette } from './composables/useColorPalette'
|
|
3
3
|
import { __forcePalette, palettes } from './composables/useColorPalette'
|
|
4
4
|
import type { M3Locale } from './composables/useLocale'
|
|
5
|
-
import { M3_LOCALE_KEY } from './composables/useLocale'
|
|
5
|
+
import { M3_LOCALE_KEY, __setAppLocale } from './composables/useLocale'
|
|
6
6
|
|
|
7
7
|
export interface M3UIOptions {
|
|
8
8
|
palette?: string
|
|
@@ -44,6 +44,7 @@ export function createM3UI(options: M3UIOptions = {}) {
|
|
|
44
44
|
}
|
|
45
45
|
if (options.locale) {
|
|
46
46
|
app.provide(M3_LOCALE_KEY, options.locale)
|
|
47
|
+
__setAppLocale(options.locale)
|
|
47
48
|
}
|
|
48
49
|
},
|
|
49
50
|
}
|