@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,22 +1,43 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* The M3 slider — vertical bar thumb, rounded track with gap, standard/centered/range variants, horizontal or
|
|
4
|
+
* vertical.
|
|
5
|
+
*
|
|
6
|
+
* @event update:modelValue Emitted while dragging and on key presses, with the new value (a `[low, high]` pair
|
|
7
|
+
* for the range variant).
|
|
8
|
+
*/
|
|
2
9
|
import { computed, onBeforeUnmount, ref } from 'vue'
|
|
3
10
|
import MIcon from './MIcon.vue'
|
|
4
11
|
|
|
5
12
|
const props = withDefaults(
|
|
6
13
|
defineProps<{
|
|
14
|
+
/** Current value — a tuple when variant is range */
|
|
7
15
|
modelValue: number | [number, number]
|
|
16
|
+
/** Minimum value */
|
|
8
17
|
min?: number
|
|
18
|
+
/** Maximum value */
|
|
9
19
|
max?: number
|
|
20
|
+
/** Step increment */
|
|
10
21
|
step?: number
|
|
22
|
+
/** Disables the slider */
|
|
11
23
|
disabled?: boolean
|
|
24
|
+
/** Label text */
|
|
12
25
|
label?: string
|
|
26
|
+
/** Show current value beside label */
|
|
13
27
|
showValue?: boolean
|
|
28
|
+
/** Show value tooltip while dragging */
|
|
14
29
|
showTooltip?: boolean
|
|
30
|
+
/** Slider orientation */
|
|
15
31
|
orientation?: 'horizontal' | 'vertical'
|
|
32
|
+
/** Track and thumb size */
|
|
16
33
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
34
|
+
/** Standard, centered (from middle), or range (two thumbs) */
|
|
17
35
|
variant?: 'standard' | 'centered' | 'range'
|
|
36
|
+
/** Show stop dots at each step (max 30 visible) */
|
|
18
37
|
stops?: boolean
|
|
38
|
+
/** Material Symbol icon shown before the slider — hides once the fill reaches it */
|
|
19
39
|
icon?: string
|
|
40
|
+
/** Base color — used for the fill and thumb unless overridden by fillColor/thumbColor */
|
|
20
41
|
color?: 'primary' | 'secondary' | 'tertiary' | 'error'
|
|
21
42
|
/** Custom color (hex, rgb(), a CSS var, etc.) for the filled/active portion of the track and the corner dot. Defaults to `color`'s M3 token. */
|
|
22
43
|
fillColor?: string
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Renders the toasts shown with `useToast()`. It's mounted for you the first time `useToast()` is called, so you
|
|
4
|
+
* don't place it yourself; its position comes from `useToast().position`.
|
|
5
|
+
*/
|
|
2
6
|
import { computed } from "vue";
|
|
3
7
|
import { useToast } from "../composables/useToast";
|
|
4
8
|
import MIcon from "./MIcon.vue";
|
|
@@ -6,6 +10,7 @@ import MSpinner from "./MSpinner.vue";
|
|
|
6
10
|
import { useLocale } from '../composables/useLocale';
|
|
7
11
|
|
|
8
12
|
const props = defineProps<{
|
|
13
|
+
/** Accessible label of each toast's close button. Defaults to the locale's "Close". */
|
|
9
14
|
closeAriaLabel?: string
|
|
10
15
|
}>()
|
|
11
16
|
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A small circular loading spinner — a standard ring, or the M3 Expressive wavy variant. For a larger,
|
|
4
|
+
* shape-morphing loading affordance, see MLoadingIndicator.
|
|
5
|
+
*/
|
|
2
6
|
import { computed } from "vue";
|
|
3
7
|
import { useLocale } from '../composables/useLocale';
|
|
4
8
|
|
|
5
9
|
const props = withDefaults(
|
|
6
10
|
defineProps<{
|
|
11
|
+
/** Size in px */
|
|
7
12
|
size?: number;
|
|
13
|
+
/**
|
|
14
|
+
* M3 Expressive wavy animation style — the ring rotates while a wave travels along its stroke, instead of a
|
|
15
|
+
* plain spin
|
|
16
|
+
*/
|
|
8
17
|
wavy?: boolean;
|
|
18
|
+
/** Aria label for the spinner's status role — falls back to the locale string ('Loading') when omitted */
|
|
9
19
|
label?: string;
|
|
10
20
|
}>(),
|
|
11
21
|
{ size: 20, wavy: false },
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A button split into a main action and a dropdown toggle — click the main part for the primary action, the
|
|
4
|
+
* arrow for alternatives.
|
|
5
|
+
*
|
|
6
|
+
* @slot menu Custom dropdown content. Used instead of items. Call close() to dismiss.
|
|
7
|
+
* @event click Emitted when the main (left) button is clicked
|
|
8
|
+
*/
|
|
2
9
|
import { computed, onMounted, onUnmounted, ref } from 'vue'
|
|
3
10
|
import MIcon from './MIcon.vue'
|
|
4
11
|
|
|
@@ -12,12 +19,19 @@ export interface SplitButtonItem {
|
|
|
12
19
|
defineOptions({ inheritAttrs: false })
|
|
13
20
|
|
|
14
21
|
const props = withDefaults(defineProps<{
|
|
22
|
+
/** Main button label */
|
|
15
23
|
label: string
|
|
24
|
+
/** Main button icon */
|
|
16
25
|
icon?: string
|
|
26
|
+
/** Visual style */
|
|
17
27
|
variant?: 'filled' | 'tonal' | 'outlined' | 'elevated'
|
|
28
|
+
/** Color scheme */
|
|
18
29
|
color?: 'primary' | 'secondary' | 'tertiary'
|
|
30
|
+
/** Button size */
|
|
19
31
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
32
|
+
/** Disables both parts */
|
|
20
33
|
disabled?: boolean
|
|
34
|
+
/** Dropdown menu items; see `SplitButtonItem` */
|
|
21
35
|
items?: SplitButtonItem[]
|
|
22
36
|
}>(), {
|
|
23
37
|
variant: 'tonal',
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Two resizable panels divided by a draggable handle.
|
|
4
|
+
*
|
|
5
|
+
* @slot first Content for the first (left/top) panel
|
|
6
|
+
* @slot second Content for the second (right/bottom) panel
|
|
7
|
+
*/
|
|
2
8
|
import { ref, computed, onBeforeUnmount } from 'vue'
|
|
3
9
|
|
|
4
10
|
const props = withDefaults(
|
|
5
11
|
defineProps<{
|
|
12
|
+
/** Split direction */
|
|
6
13
|
direction?: 'horizontal' | 'vertical'
|
|
14
|
+
/** Initial split percentage */
|
|
7
15
|
initialSplit?: number
|
|
16
|
+
/** Minimum panel percentage */
|
|
8
17
|
min?: number
|
|
18
|
+
/** Maximum panel percentage */
|
|
9
19
|
max?: number
|
|
10
20
|
}>(),
|
|
11
21
|
{ direction: 'horizontal', initialSplit: 50, min: 10, max: 90 },
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A spotlight-style search overlay. Unlike MCommandPalette, it doesn't filter internally — you own the results
|
|
4
|
+
* array and update it from the search event, which makes it a natural fit for async/remote search.
|
|
5
|
+
*
|
|
6
|
+
* @event update:modelValue Emitted on open/close — powers v-model
|
|
7
|
+
* @event select Emitted when a result is chosen (click, or Enter)
|
|
8
|
+
* @event search Emitted as the query changes (debounced by the debounce prop) — drive your own filtering and
|
|
9
|
+
* update results in response
|
|
10
|
+
*/
|
|
2
11
|
import { ref, computed, watch, nextTick, onMounted, onBeforeUnmount } from 'vue'
|
|
3
12
|
import MIcon from './MIcon.vue'
|
|
4
13
|
import MSpinner from './MSpinner.vue'
|
|
@@ -16,15 +25,33 @@ export interface SpotlightResult {
|
|
|
16
25
|
|
|
17
26
|
const props = withDefaults(
|
|
18
27
|
defineProps<{
|
|
28
|
+
/** Open/closed state (v-model). Required — there is no default. */
|
|
19
29
|
modelValue: boolean
|
|
30
|
+
/**
|
|
31
|
+
* Results to render — the component does no filtering itself, it just displays whatever you pass via the
|
|
32
|
+
* search event handler
|
|
33
|
+
*/
|
|
20
34
|
results?: SpotlightResult[]
|
|
35
|
+
/** Search input placeholder — falls back to the locale's own string when unset */
|
|
21
36
|
placeholder?: string
|
|
37
|
+
/** Shows a spinner in place of the clear button, e.g. while an async search is in flight */
|
|
22
38
|
loading?: boolean
|
|
39
|
+
/** Empty-state text — falls back to the locale's own string when unset */
|
|
23
40
|
noResultsText?: string
|
|
41
|
+
/**
|
|
42
|
+
* Global keyboard shortcut key (no modifier) to open the search — ignored while focus is in a text
|
|
43
|
+
* input/textarea/contenteditable
|
|
44
|
+
*/
|
|
24
45
|
hotkey?: string
|
|
46
|
+
/**
|
|
47
|
+
* Delay in ms before the search event fires after the query changes; 0 fires immediately on every keystroke
|
|
48
|
+
*/
|
|
25
49
|
debounce?: number
|
|
50
|
+
/** Footer hint text for the arrow keys — falls back to the locale's own string when unset */
|
|
26
51
|
navigateHint?: string
|
|
52
|
+
/** Footer hint text for Enter — falls back to the locale's own string when unset */
|
|
27
53
|
openHint?: string
|
|
54
|
+
/** Footer hint text for Escape — falls back to the locale's own string when unset */
|
|
28
55
|
closeHint?: string
|
|
29
56
|
}>(),
|
|
30
57
|
{
|
|
@@ -1,14 +1,26 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Flex stack with gap, alignment, and optional dividers between items.
|
|
4
|
+
*
|
|
5
|
+
* @slot default The stacked items.
|
|
6
|
+
*/
|
|
2
7
|
import { computed } from 'vue'
|
|
3
8
|
|
|
4
9
|
const props = withDefaults(
|
|
5
10
|
defineProps<{
|
|
11
|
+
/** Stack direction */
|
|
6
12
|
direction?: 'column' | 'row'
|
|
13
|
+
/** Gap between items (ignored when divider is true) */
|
|
7
14
|
gap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
15
|
+
/** Cross-axis alignment */
|
|
8
16
|
align?: 'start' | 'center' | 'end' | 'stretch' | 'baseline'
|
|
17
|
+
/** Main-axis alignment */
|
|
9
18
|
justify?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly'
|
|
19
|
+
/** Allow items to wrap */
|
|
10
20
|
wrap?: boolean
|
|
21
|
+
/** Show dividers between items instead of a gap */
|
|
11
22
|
divider?: boolean
|
|
23
|
+
/** Use inline-flex */
|
|
12
24
|
inline?: boolean
|
|
13
25
|
}>(),
|
|
14
26
|
{ direction: 'column', gap: 'md', align: 'stretch', justify: 'start', wrap: false, divider: false, inline: false },
|
|
@@ -1,14 +1,27 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A compact metric card — title, value, optional icon, and a trend indicator, with a built-in loading skeleton.
|
|
4
|
+
*
|
|
5
|
+
* @slot footer Extra content appended after the trend indicator/label row (only rendered when trend,
|
|
6
|
+
* trendLabel, or this slot is present)
|
|
7
|
+
*/
|
|
2
8
|
import { computed } from 'vue'
|
|
3
9
|
import MIcon from './MIcon.vue'
|
|
4
10
|
|
|
5
11
|
const props = withDefaults(defineProps<{
|
|
12
|
+
/** Stat label text — required */
|
|
6
13
|
title: string
|
|
14
|
+
/** Main stat value — required */
|
|
7
15
|
value: string | number
|
|
16
|
+
/** Material Symbol icon shown in a colored container on the right */
|
|
8
17
|
icon?: string
|
|
18
|
+
/** Percentage change — positive shows green/up, negative red/down, zero neutral/flat */
|
|
9
19
|
trend?: number
|
|
20
|
+
/** Text next to the trend indicator (e.g. "vs last month") */
|
|
10
21
|
trendLabel?: string
|
|
22
|
+
/** Icon container color */
|
|
11
23
|
color?: 'primary' | 'secondary' | 'tertiary' | 'error' | 'success'
|
|
24
|
+
/** Show a skeleton placeholder instead of the value */
|
|
12
25
|
loading?: boolean
|
|
13
26
|
}>(), { color: 'primary' })
|
|
14
27
|
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A multi-step wizard, horizontal or vertical, with icons, descriptions, and optional/error states.
|
|
4
|
+
*
|
|
5
|
+
* @event update:modelValue Emitted with the new current step index.
|
|
6
|
+
*/
|
|
2
7
|
import { computed } from 'vue'
|
|
3
8
|
import MIcon from './MIcon.vue'
|
|
4
9
|
|
|
@@ -11,9 +16,16 @@ export interface StepItem {
|
|
|
11
16
|
}
|
|
12
17
|
|
|
13
18
|
const props = withDefaults(defineProps<{
|
|
19
|
+
/** Step definitions (see `StepItem`) */
|
|
14
20
|
steps: StepItem[]
|
|
21
|
+
/** Active step index (0-based), v-model */
|
|
15
22
|
modelValue: number
|
|
23
|
+
/** Layout direction */
|
|
16
24
|
direction?: 'horizontal' | 'vertical'
|
|
25
|
+
/**
|
|
26
|
+
* When true, steps are not clickable — only the active step changes via v-model from outside. When false, any
|
|
27
|
+
* non-active step can be clicked to jump to it.
|
|
28
|
+
*/
|
|
17
29
|
linear?: boolean
|
|
18
30
|
}>(), { direction: 'horizontal', linear: true })
|
|
19
31
|
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Sticks content to the top of its scroll container using `position: sticky`.
|
|
4
|
+
*
|
|
5
|
+
* @slot default The content that sticks.
|
|
6
|
+
*/
|
|
2
7
|
import { computed } from 'vue'
|
|
3
8
|
|
|
4
9
|
const props = withDefaults(
|
|
5
10
|
defineProps<{
|
|
11
|
+
/** Sticky offset from top (number = px) */
|
|
6
12
|
top?: string | number
|
|
13
|
+
/** Z-index value */
|
|
7
14
|
zIndex?: number
|
|
8
15
|
}>(),
|
|
9
16
|
{ top: 0, zIndex: 40 },
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Secondary text component with muted color by default — a thin wrapper around `MText`.
|
|
4
|
+
*
|
|
5
|
+
* @slot default The subtitle 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
|
+
/** Subtitle size (maps to body-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: 'on-surface-variant' },
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Material 3's supporting pane layout: main content plus a narrower pane that supports it, like related videos
|
|
4
|
+
* next to a player, a cart next to a product or comments next to a document. With room for two panes (840px and
|
|
5
|
+
* up) the supporting pane sits beside the main one; on smaller screens it moves under it, or into a bottom
|
|
6
|
+
* sheet with `single-pane="sheet"`. It measures its own width, not the window's.
|
|
7
|
+
*
|
|
8
|
+
* @slot main The main content
|
|
9
|
+
* @slot supporting Content that supports the main pane: related items, a summary, details, tools
|
|
10
|
+
* @event update:open Emitted when the sheet is dismissed, or closed because both panes fit again
|
|
11
|
+
*/
|
|
2
12
|
import { computed, ref, watch } from 'vue'
|
|
3
13
|
import MBottomSheet from './MBottomSheet.vue'
|
|
4
14
|
import { useWindowSizeClass } from '../composables/useWindowSizeClass'
|
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A toggle switch with an optional label, 4 semantic colors, and both M3 icon variants.
|
|
4
|
+
*
|
|
5
|
+
* @event update:modelValue Emitted with the new on/off state.
|
|
6
|
+
*/
|
|
2
7
|
import { computed, ref } from 'vue'
|
|
3
8
|
import MIcon from './MIcon.vue'
|
|
4
9
|
|
|
5
10
|
const props = withDefaults(
|
|
6
11
|
defineProps<{
|
|
12
|
+
/** Toggle state (v-model) */
|
|
7
13
|
modelValue: boolean
|
|
14
|
+
/** Disables the switch */
|
|
8
15
|
disabled?: boolean
|
|
16
|
+
/** Label text */
|
|
9
17
|
label?: string
|
|
18
|
+
/** Track/thumb color when on */
|
|
10
19
|
color?: 'primary' | 'secondary' | 'tertiary' | 'error'
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*/
|
|
20
|
+
/** Shows a check icon in the thumb while on. Set to `false` for M3's plain switch without an icon. */
|
|
21
|
+
// M3 officially has two Switch variants: with a check icon inside the thumb (the
|
|
22
|
+
// `thumbContent` slot filled), and without (Compose's actual default — `thumbContent`
|
|
23
|
+
// defaults to `null`). Defaults to `true` here to keep this component's existing look;
|
|
24
|
+
// pass `false` for the plain/no-icon variant.
|
|
17
25
|
icon?: boolean
|
|
18
26
|
}>(),
|
|
19
27
|
{ disabled: false, color: 'primary', icon: true },
|
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A simple, general-purpose data table — sortable columns, built-in search, pagination, and optional row
|
|
4
|
+
* selection, with an escape hatch to delegate all three to your backend via serverSide.
|
|
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
|
+
* @event update:modelValue Emitted when the selection changes — powers v-model
|
|
10
|
+
* @event update:page Emitted when the page changes — powers v-model:page
|
|
11
|
+
* @event rowClick Emitted with the row's data when you click a row (unless `selectOnRowClick` makes the click
|
|
12
|
+
* select it).
|
|
13
|
+
* @event fetch Emitted instead of filtering locally when serverSide is true
|
|
14
|
+
*/
|
|
2
15
|
import { computed, onMounted, ref, watch } from 'vue'
|
|
3
16
|
import MCheckbox from './MCheckbox.vue'
|
|
4
17
|
import MIcon from './MIcon.vue'
|
|
@@ -28,25 +41,41 @@ const SKEL = [65, 80, 50, 75, 90, 55, 70, 85, 60, 78, 88, 52, 70, 83, 58]
|
|
|
28
41
|
|
|
29
42
|
const props = withDefaults(
|
|
30
43
|
defineProps<{
|
|
44
|
+
/** Column definitions: { key, label, sortable?, width?, align? } */
|
|
31
45
|
columns: TableColumn[]
|
|
46
|
+
/** Table data rows */
|
|
32
47
|
rows: Record<string, any>[]
|
|
48
|
+
/** Show skeleton loading state */
|
|
33
49
|
loading?: boolean
|
|
50
|
+
/** Text when no rows (defaults to the locale string) */
|
|
34
51
|
emptyText?: string
|
|
52
|
+
/** Unique key field in each row */
|
|
35
53
|
rowKey?: string
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
*
|
|
39
|
-
* `rowClick`, así una tabla puede seleccionar filas y a la vez abrirlas al click.
|
|
54
|
+
/**
|
|
55
|
+
* Enable row selection with checkboxes (by default only the checkbox toggles a row; clicking the row itself
|
|
56
|
+
* still emits row-click)
|
|
40
57
|
*/
|
|
58
|
+
selectable?: boolean
|
|
59
|
+
/** With selectable, clicking anywhere on a row toggles its selection instead of emitting row-click */
|
|
60
|
+
// Con `selectable`, que el click en cualquier parte de la fila la marque/desmarque (en vez de
|
|
61
|
+
// emitir `rowClick`). Default false: sólo el checkbox selecciona y el click en la fila emite
|
|
62
|
+
// `rowClick`, así una tabla puede seleccionar filas y a la vez abrirlas al click.
|
|
41
63
|
selectOnRowClick?: boolean
|
|
64
|
+
/** Selected rows (v-model) */
|
|
42
65
|
modelValue?: Record<string, any>[]
|
|
66
|
+
/** Rows per page */
|
|
43
67
|
perPage?: number
|
|
68
|
+
/** Show search input */
|
|
44
69
|
searchable?: boolean
|
|
45
70
|
/** Emit `fetch` instead of filtering locally. Requires :total. */
|
|
46
71
|
serverSide?: boolean
|
|
72
|
+
/** Total rows (for server-side pagination) */
|
|
47
73
|
total?: number
|
|
74
|
+
/** Current page (v-model via update:page) */
|
|
48
75
|
page?: number
|
|
76
|
+
/** Placeholder for search input (defaults to the locale string) */
|
|
49
77
|
searchPlaceholder?: string
|
|
78
|
+
/** Text for selected count badge, pluralized with 's' (defaults to the locale string) */
|
|
50
79
|
selectedText?: string
|
|
51
80
|
}>(),
|
|
52
81
|
{
|
package/src/components/MTabs.vue
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Switches between different views or content sections. The indicator animates via two independent springs
|
|
4
|
+
* (offset and width), not a CSS transition — see the component source for details.
|
|
5
|
+
*
|
|
6
|
+
* @event update:modelValue Emitted with the value of the tab you picked.
|
|
7
|
+
*/
|
|
2
8
|
import { nextTick, onMounted, onUnmounted, ref, watch } from 'vue'
|
|
3
9
|
import MIcon from './MIcon.vue'
|
|
4
10
|
|
|
@@ -10,8 +16,14 @@ interface Tab {
|
|
|
10
16
|
}
|
|
11
17
|
|
|
12
18
|
const props = withDefaults(defineProps<{
|
|
19
|
+
/** Active tab value (v-model) */
|
|
13
20
|
modelValue: string | number
|
|
21
|
+
/** Tab definitions */
|
|
14
22
|
tabs: Tab[]
|
|
23
|
+
/**
|
|
24
|
+
* Primary: short sliding underline shorter than the tab with a stretch animation. Secondary: full-width
|
|
25
|
+
* underline spanning the entire tab, text-only.
|
|
26
|
+
*/
|
|
15
27
|
variant?: 'primary' | 'secondary'
|
|
16
28
|
/** Fixed (default, M3 `TabRow`): tabs evenly share the available width, no scrolling — use for 2-5 tabs. Scrollable (M3 `ScrollableTabRow`): tabs keep their natural width and the row scrolls horizontally when they overflow — use for many tabs. */
|
|
17
29
|
scrollable?: boolean
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Type and press Enter or comma to add a free-form tag. Backspace on an empty input removes the last tag.
|
|
4
|
+
*
|
|
5
|
+
* @event update:modelValue Emitted whenever a tag is added or removed — powers v-model
|
|
6
|
+
* @event debounced Emitted debounce ms after the tag list stops changing (only when debounce > 0)
|
|
7
|
+
*/
|
|
2
8
|
import { computed, ref, useId } from 'vue'
|
|
3
9
|
import MIcon from './MIcon.vue'
|
|
4
10
|
import { useFieldBg } from '../composables/useFieldBg'
|
|
@@ -6,20 +12,37 @@ import { useDebounce } from '../composables/useDebounce'
|
|
|
6
12
|
|
|
7
13
|
const props = withDefaults(
|
|
8
14
|
defineProps<{
|
|
15
|
+
/** Array of tags (v-model) */
|
|
9
16
|
modelValue: string[]
|
|
17
|
+
/** Floating label text */
|
|
10
18
|
label?: string
|
|
19
|
+
/** Input placeholder */
|
|
11
20
|
placeholder?: string
|
|
21
|
+
/** Field style */
|
|
12
22
|
variant?: 'filled' | 'outlined'
|
|
23
|
+
/** Disables the field */
|
|
13
24
|
disabled?: boolean
|
|
25
|
+
/** Error state */
|
|
14
26
|
error?: boolean
|
|
27
|
+
/** Error message shown when error is true */
|
|
15
28
|
errorLabel?: string
|
|
29
|
+
/** Helper text below field */
|
|
16
30
|
hint?: string
|
|
31
|
+
/** Marks as required — adds a red asterisk after the label */
|
|
17
32
|
required?: boolean
|
|
33
|
+
/** Material Symbol icon name */
|
|
18
34
|
leadingIcon?: string
|
|
35
|
+
/**
|
|
36
|
+
* Overrides the auto-detected background color used to cut the floating label out of the outlined border
|
|
37
|
+
*/
|
|
19
38
|
fieldBg?: string
|
|
39
|
+
/** Max number of tags allowed */
|
|
20
40
|
maxTags?: number
|
|
41
|
+
/** Allow duplicate tags */
|
|
21
42
|
duplicates?: boolean
|
|
43
|
+
/** Show a clear-all button */
|
|
22
44
|
clearable?: boolean
|
|
45
|
+
/** Delay (ms) before firing the @debounced event */
|
|
23
46
|
debounce?: number
|
|
24
47
|
}>(),
|
|
25
48
|
{
|
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* A terminal emulator built on xterm.js — pre-filled static output, or fully interactive keyboard input.
|
|
4
|
+
*
|
|
5
|
+
* @event line Emitted with the buffered text once the user presses Enter — the usual event to handle a
|
|
6
|
+
* submitted command
|
|
7
|
+
* @event input Emitted for every raw keystroke/data chunk xterm receives (not readonly)
|
|
8
|
+
*/
|
|
2
9
|
import { ref, onMounted, onBeforeUnmount, watch } from 'vue'
|
|
3
10
|
import MIcon from './MIcon.vue'
|
|
4
11
|
|
|
5
12
|
const props = withDefaults(
|
|
6
13
|
defineProps<{
|
|
14
|
+
/** Initial lines to display */
|
|
7
15
|
lines?: string[]
|
|
16
|
+
/** Disable input */
|
|
8
17
|
readonly?: boolean
|
|
18
|
+
/** Title bar text */
|
|
9
19
|
title?: string
|
|
20
|
+
/** Minimum height */
|
|
10
21
|
minHeight?: string
|
|
11
22
|
}>(),
|
|
12
23
|
{
|
package/src/components/MText.vue
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Renders any of the 15 Material 3 typography variants, with an auto-selected semantic HTML tag.
|
|
4
|
+
*
|
|
5
|
+
* @slot default The text.
|
|
6
|
+
*/
|
|
2
7
|
import { computed } from 'vue'
|
|
3
8
|
|
|
4
9
|
export type TextVariant =
|
|
@@ -10,12 +15,22 @@ export type TextVariant =
|
|
|
10
15
|
|
|
11
16
|
const props = withDefaults(
|
|
12
17
|
defineProps<{
|
|
18
|
+
/** Typography variant from the Material 3 type scale */
|
|
13
19
|
variant?: TextVariant
|
|
20
|
+
/**
|
|
21
|
+
* HTML tag to render (auto-selected based on variant — h1/h2/h3 for display/headline, p for title/body,
|
|
22
|
+
* span for label)
|
|
23
|
+
*/
|
|
14
24
|
tag?: string
|
|
25
|
+
/** Text color */
|
|
15
26
|
color?: 'on-surface' | 'on-surface-variant' | 'primary' | 'secondary' | 'tertiary' | 'error' | 'inherit'
|
|
27
|
+
/** Text alignment */
|
|
16
28
|
align?: 'left' | 'center' | 'right'
|
|
29
|
+
/** Truncate text with ellipsis on overflow */
|
|
17
30
|
truncate?: boolean
|
|
31
|
+
/** Clamp text to a specific number of lines */
|
|
18
32
|
lines?: 1 | 2 | 3 | 4 | 5 | 6
|
|
33
|
+
/** Font weight override */
|
|
19
34
|
weight?: 'regular' | 'medium' | 'bold'
|
|
20
35
|
}>(),
|
|
21
36
|
{ variant: 'body-medium', color: 'inherit', align: 'left' },
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* The standard single- or multi-line text input, filled or outlined, with floating label.
|
|
4
|
+
*
|
|
5
|
+
* @slot trailing Custom trailing content (e.g. an icon button) — replaces the built-in clear button when
|
|
6
|
+
* present
|
|
7
|
+
* @event update:modelValue Emitted on every keystroke — powers v-model
|
|
8
|
+
* @event debounced Emitted debounce ms after the user stops typing (only when debounce > 0)
|
|
9
|
+
*/
|
|
2
10
|
import { computed, ref, useId, useSlots } from "vue";
|
|
3
11
|
import MIcon from "./MIcon.vue";
|
|
4
12
|
import { useFieldBg } from "../composables/useFieldBg";
|
|
@@ -6,21 +14,39 @@ import { useDebounce } from "../composables/useDebounce";
|
|
|
6
14
|
|
|
7
15
|
const props = withDefaults(
|
|
8
16
|
defineProps<{
|
|
17
|
+
/** Bound value (v-model) */
|
|
9
18
|
modelValue: string | number;
|
|
19
|
+
/** Field label */
|
|
10
20
|
label: string;
|
|
21
|
+
/** HTML input type */
|
|
11
22
|
type?: string;
|
|
23
|
+
/** Visual style */
|
|
12
24
|
variant?: "filled" | "outlined";
|
|
25
|
+
/** Puts the field in error state (red border and label) */
|
|
13
26
|
error?: boolean;
|
|
27
|
+
/** Error message shown below the field (only visible when error is true) */
|
|
14
28
|
errorLabel?: string;
|
|
29
|
+
/** Hint text shown below the field */
|
|
15
30
|
hint?: string;
|
|
31
|
+
/** Disables the field */
|
|
16
32
|
disabled?: boolean;
|
|
33
|
+
/** Marks as required — adds a red asterisk after the label */
|
|
17
34
|
required?: boolean;
|
|
35
|
+
/** Renders a textarea instead of an input */
|
|
18
36
|
multiline?: boolean;
|
|
37
|
+
/** Textarea rows (when multiline) */
|
|
19
38
|
rows?: number;
|
|
39
|
+
/** Passed through to the native autocomplete attribute */
|
|
20
40
|
autocomplete?: string;
|
|
41
|
+
/** Material Symbol shown before the input */
|
|
21
42
|
leadingIcon?: string;
|
|
43
|
+
/** Show a clear button when the field has a value */
|
|
22
44
|
clearable?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Overrides the auto-detected background color used to cut the floating label out of the outlined border
|
|
47
|
+
*/
|
|
23
48
|
fieldBg?: string;
|
|
49
|
+
/** Delay (ms) before firing the @debounced event. v-model always updates immediately */
|
|
24
50
|
debounce?: number;
|
|
25
51
|
}>(),
|
|
26
52
|
{
|
|
@@ -1,19 +1,34 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* An inline, dropdown-anchored hour/minute picker with 12h/24h format support.
|
|
4
|
+
*
|
|
5
|
+
* @event update:modelValue Emitted with the picked time.
|
|
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
|
import { useLocale } from '../composables/useLocale'
|
|
6
11
|
|
|
7
12
|
const props = withDefaults(defineProps<{
|
|
13
|
+
/** Selected time (HH:MM, v-model) */
|
|
8
14
|
modelValue: string | null
|
|
15
|
+
/** Field label */
|
|
9
16
|
label?: string
|
|
17
|
+
/** Placeholder shown when no time is selected — falls back to label, then the current locale's string */
|
|
10
18
|
placeholder?: string
|
|
19
|
+
/** Disables the picker */
|
|
11
20
|
disabled?: boolean
|
|
21
|
+
/** Error state */
|
|
12
22
|
error?: boolean
|
|
23
|
+
/** Error message shown when error is true */
|
|
13
24
|
errorLabel?: string
|
|
25
|
+
/** Hint text below the field */
|
|
14
26
|
hint?: string
|
|
27
|
+
/** Minute increment step */
|
|
15
28
|
minuteStep?: number
|
|
29
|
+
/** Use 24-hour format */
|
|
16
30
|
use24h?: boolean
|
|
31
|
+
/** Overrides the auto-detected background color used to cut the floating label out of the border */
|
|
17
32
|
fieldBg?: string
|
|
18
33
|
}>(), { minuteStep: 5, use24h: true })
|
|
19
34
|
|