@m3ui-vue/m3ui-vue 1.8.1 → 1.9.0
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/dist/API.md +26 -11
- package/dist/{MButton-B6eZTfFV.js → MButton-LiZRRP4h.js} +4 -4
- package/dist/{MButton-B6eZTfFV.js.map → MButton-LiZRRP4h.js.map} +1 -1
- package/dist/{MColorPickerModal-Dajjf6tH.js → MColorPickerModal-IjciC8zh.js} +185 -185
- package/dist/MColorPickerModal-IjciC8zh.js.map +1 -0
- package/dist/{MDialog-DQvE_JBv.js → MDialog-BLpfgIA3.js} +7 -7
- package/dist/{MDialog-DQvE_JBv.js.map → MDialog-BLpfgIA3.js.map} +1 -1
- package/dist/MIcon-BSsJZhK7.js +116 -0
- package/dist/MIcon-BSsJZhK7.js.map +1 -0
- package/dist/{MIconButton-BBggVwBV.js → MIconButton-CNjN0xwW.js} +18 -18
- package/dist/{MIconButton-BBggVwBV.js.map → MIconButton-CNjN0xwW.js.map} +1 -1
- package/dist/{MListItem-DiOAxaN7.js → MListItem-BBQ-6i3v.js} +139 -139
- package/dist/MListItem-BBQ-6i3v.js.map +1 -0
- package/dist/{MLoadingIndicator-CuTZYFFj.js → MLoadingIndicator-dejdXpu8.js} +2 -2
- package/dist/{MLoadingIndicator-CuTZYFFj.js.map → MLoadingIndicator-dejdXpu8.js.map} +1 -1
- package/dist/MMenuItem-E31tMzOt.js +577 -0
- package/dist/MMenuItem-E31tMzOt.js.map +1 -0
- package/dist/{MPdfViewer-C5ngKPRM.js → MPdfViewer-B5Q9Xs9d.js} +9 -9
- package/dist/{MPdfViewer-C5ngKPRM.js.map → MPdfViewer-B5Q9Xs9d.js.map} +1 -1
- package/dist/{MProgressBar-BWly1UKN.js → MProgressBar-CPrZhQbA.js} +3 -3
- package/dist/{MProgressBar-BWly1UKN.js.map → MProgressBar-CPrZhQbA.js.map} +1 -1
- package/dist/{MSeekBar-BCDQTx2t.js → MSeekBar-NwkuAzx-.js} +2 -2
- package/dist/{MSeekBar-BCDQTx2t.js.map → MSeekBar-NwkuAzx-.js.map} +1 -1
- package/dist/{MSegmentedButton-BXzRsg1S.js → MSegmentedButton-DZuZLBML.js} +4 -4
- package/dist/{MSegmentedButton-BXzRsg1S.js.map → MSegmentedButton-DZuZLBML.js.map} +1 -1
- package/dist/{MSignaturePad-CxOtelzE.js → MSignaturePad-Bqr-1R9f.js} +2 -2
- package/dist/{MSignaturePad-CxOtelzE.js.map → MSignaturePad-Bqr-1R9f.js.map} +1 -1
- package/dist/MSlider-B7dIcHVn.js +745 -0
- package/dist/MSlider-B7dIcHVn.js.map +1 -0
- package/dist/{MSpinner-UCdtSOHP.js → MSpinner-CXLY7lWw.js} +2 -2
- package/dist/{MSpinner-UCdtSOHP.js.map → MSpinner-CXLY7lWw.js.map} +1 -1
- package/dist/{MTextField-CYk9yFvi.js → MTextField-CryHMs8-.js} +18 -18
- package/dist/MTextField-CryHMs8-.js.map +1 -0
- package/dist/MTooltip-Cn_DYm9M.js +90 -0
- package/dist/MTooltip-Cn_DYm9M.js.map +1 -0
- package/dist/{_popupPosition-nL8SVKPK.js → _popupPosition-C_lxj9qU.js} +7 -7
- package/dist/_popupPosition-C_lxj9qU.js.map +1 -0
- package/dist/{_useFieldValidation-B0B44M_t.js → _useFieldValidation-CvZnZfl-.js} +2 -2
- package/dist/{_useFieldValidation-B0B44M_t.js.map → _useFieldValidation-CvZnZfl-.js.map} +1 -1
- package/dist/api.json +1 -1
- package/dist/code-editor.js +129 -128
- package/dist/code-editor.js.map +1 -1
- package/dist/components/MAddressField.vue.d.ts +1 -1
- package/dist/components/MAudioPlayer.vue.d.ts +1 -1
- package/dist/components/MAutocomplete.vue.d.ts +1 -1
- package/dist/components/MAvailabilityCalendar.vue.d.ts +3 -3
- package/dist/components/MBadge.vue.d.ts +2 -2
- package/dist/components/MBar.vue.d.ts +1 -1
- package/dist/components/MBeforeAfter.vue.d.ts +3 -3
- package/dist/components/MButton.vue.d.ts +1 -1
- package/dist/components/MCalendarHeatmap.vue.d.ts +1 -1
- package/dist/components/MChatBubble.vue.d.ts +1 -1
- package/dist/components/MCodeEditor.vue.d.ts +1 -1
- package/dist/components/MContainerTransform.vue.d.ts +1 -1
- package/dist/components/MCopyButton.vue.d.ts +2 -2
- package/dist/components/MCountrySelect.vue.d.ts +1 -1
- package/dist/components/MCreditCardInput.vue.d.ts +2 -2
- package/dist/components/MDiffViewer.vue.d.ts +1 -1
- package/dist/components/MDrawCanvas.vue.d.ts +2 -2
- package/dist/components/MExpansionPanel.vue.d.ts +1 -1
- package/dist/components/MExportButton.vue.d.ts +1 -1
- package/dist/components/MFab.vue.d.ts +1 -1
- package/dist/components/MFilterBuilder.vue.d.ts +1 -1
- package/dist/components/MFlex.vue.d.ts +2 -2
- package/dist/components/MFloorPlan.vue.d.ts +2 -2
- package/dist/components/MFlow.vue.d.ts +2 -2
- package/dist/components/MFormRenderer.vue.d.ts +2 -2
- package/dist/components/MGantt.vue.d.ts +2 -2
- package/dist/components/MGanttControls.vue.d.ts +1 -1
- package/dist/components/MGrid.vue.d.ts +1 -1
- package/dist/components/MIcon.vue.d.ts +3 -5
- package/dist/components/MIconButton.vue.d.ts +1 -1
- package/dist/components/MLightbox.vue.d.ts +2 -2
- package/dist/components/MMapMeasure.vue.d.ts +2 -2
- package/dist/components/MMenu.vue.d.ts +6 -3
- package/dist/components/MMortgageCalculator.vue.d.ts +2 -2
- package/dist/components/MMultiAutocomplete.vue.d.ts +1 -1
- package/dist/components/MMultiSelect.vue.d.ts +1 -1
- package/dist/components/MNavigationDrawer.vue.d.ts +5 -4
- package/dist/components/MNavigationRail.vue.d.ts +1 -1
- package/dist/components/MNumberField.vue.d.ts +1 -1
- package/dist/components/MOdontogram.vue.d.ts +2 -2
- package/dist/components/MPhoneInput.vue.d.ts +2 -2
- package/dist/components/MPinInput.vue.d.ts +3 -3
- package/dist/components/MPosKeypad.vue.d.ts +1 -1
- package/dist/components/MProductConfigurator.vue.d.ts +1 -1
- package/dist/components/MResourceTimeline.vue.d.ts +2 -2
- package/dist/components/MRichTextEditor.vue.d.ts +1 -1
- package/dist/components/MScheme.vue.d.ts +1 -1
- package/dist/components/MSearchBar.vue.d.ts +2 -2
- package/dist/components/MSearchField.vue.d.ts +1 -1
- package/dist/components/MSeatMap.vue.d.ts +1 -1
- package/dist/components/MSeekBar.vue.d.ts +2 -2
- package/dist/components/MSelect.vue.d.ts +1 -1
- package/dist/components/MShortNavigationBar.vue.d.ts +1 -1
- package/dist/components/MSkeleton.vue.d.ts +1 -1
- package/dist/components/MSpreadsheet.vue.d.ts +2 -2
- package/dist/components/MStack.vue.d.ts +2 -2
- package/dist/components/MSubtitle.vue.d.ts +1 -1
- package/dist/components/MSwipeToDismiss.vue.d.ts +1 -1
- package/dist/components/MSwitch.vue.d.ts +1 -1
- package/dist/components/MTagInput.vue.d.ts +1 -1
- package/dist/components/MText.vue.d.ts +1 -1
- package/dist/components/MTextField.vue.d.ts +3 -3
- package/dist/components/MTimeScroll.vue.d.ts +1 -1
- package/dist/components/MTimezoneSelect.vue.d.ts +1 -1
- package/dist/components/MTitle.vue.d.ts +1 -1
- package/dist/components/MToolbar.vue.d.ts +1 -1
- package/dist/components/MTooltip.vue.d.ts +1 -1
- package/dist/components/MTopAppBar.vue.d.ts +2 -2
- package/dist/components/MVitalsChart.vue.d.ts +1 -1
- package/dist/components/MWindow.vue.d.ts +3 -3
- package/dist/components/_MDrawerItemList.vue.d.ts +8 -1
- package/dist/composables/_fieldLayout.d.ts +8 -8
- package/dist/composables/_popupPosition.d.ts +3 -2
- package/dist/composables/_rtl.d.ts +26 -0
- package/dist/composables/useColorPalette.d.ts +1 -1
- package/dist/composables/useLocale.d.ts +4 -0
- package/dist/draw.js +5 -5
- package/dist/flow.js +2 -2
- package/dist/gantt.js +3 -3
- package/dist/locales/ar.d.ts +6 -0
- package/dist/locales/index.d.ts +1 -0
- package/dist/locales/index.js +768 -1
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +11961 -12040
- package/dist/m3ui.js.map +1 -1
- package/dist/map.js +1127 -1149
- package/dist/map.js.map +1 -1
- package/dist/markdown.js +1 -1
- package/dist/markdown.js.map +1 -1
- package/dist/media.js +7 -7
- package/dist/pdf-sign.js +9 -9
- package/dist/pdf.js +1 -1
- package/dist/plugin.d.ts +8 -0
- package/dist/rich-text-editor.js +79 -78
- package/dist/rich-text-editor.js.map +1 -1
- package/dist/styles/theme.css +13 -0
- package/dist/styles.css +1 -1
- package/dist/terminal.js +5 -2
- package/dist/terminal.js.map +1 -1
- package/dist/{useLocale-DL96OFgr.js → useLocale-ybIju59R.js} +3 -1
- package/dist/useLocale-ybIju59R.js.map +1 -0
- package/dist/vTooltip-xESB2YOb.js +154 -0
- package/dist/vTooltip-xESB2YOb.js.map +1 -0
- package/package.json +1 -1
- package/src/__tests__/MAddressField.test.ts +1 -1
- package/src/__tests__/MChip.test.ts +3 -3
- package/src/__tests__/MFab.test.ts +6 -6
- package/src/__tests__/MListItemNestedControl.test.ts +2 -2
- package/src/__tests__/MScheduler.test.ts +1 -1
- package/src/__tests__/MTrackingTimeline.test.ts +1 -1
- package/src/__tests__/MWindow.test.ts +16 -0
- package/src/__tests__/fieldOverflow.test.ts +9 -9
- package/src/__tests__/hydration.test.ts +39 -0
- package/src/__tests__/localePresets.test.ts +2 -0
- package/src/__tests__/rtl.test.ts +167 -0
- package/src/__tests__/ssr.test.ts +6 -0
- package/src/components/MAlert.vue +1 -1
- package/src/components/MAutocomplete.vue +7 -7
- package/src/components/MAvailabilityCalendar.vue +5 -3
- package/src/components/MBadge.vue +12 -3
- package/src/components/MBar.vue +1 -1
- package/src/components/MBottomAppBar.vue +1 -1
- package/src/components/MCalendar.vue +3 -3
- package/src/components/MCalendarHeatmap.vue +3 -3
- package/src/components/MChatBubble.vue +3 -3
- package/src/components/MChip.vue +6 -6
- package/src/components/MCodeEditor.vue +7 -3
- package/src/components/MColorPicker.vue +1 -1
- package/src/components/MCommandPalette.vue +1 -1
- package/src/components/MContainerTransform.vue +1 -1
- package/src/components/MContextMenu.vue +1 -1
- package/src/components/MDataTable.vue +5 -5
- package/src/components/MDatePicker.vue +3 -2
- package/src/components/MDateRangePicker.vue +3 -2
- package/src/components/MDialog.vue +5 -5
- package/src/components/MDiffViewer.vue +1 -1
- package/src/components/MDivider.vue +1 -1
- package/src/components/MDragDropList.vue +1 -1
- package/src/components/MEmojiSelector.vue +11 -7
- package/src/components/MExpansionPanel.vue +1 -1
- package/src/components/MFab.vue +5 -5
- package/src/components/MFormBuilder.vue +3 -3
- package/src/components/MIcon.vue +14 -2
- package/src/components/MJsonEditor.vue +1 -3
- package/src/components/MJsonViewer.vue +1 -1
- package/src/components/MKanban.vue +2 -1
- package/src/components/MListDetail.vue +2 -2
- package/src/components/MListGroup.vue +1 -1
- package/src/components/MListItem.vue +5 -5
- package/src/components/MListSubheader.vue +1 -1
- package/src/components/MMapDraw.vue +3 -2
- package/src/components/MMapHover.vue +2 -1
- package/src/components/MMapMeasure.vue +2 -1
- package/src/components/MMapRoute.vue +2 -1
- package/src/components/MMarkdown.vue +9 -6
- package/src/components/MMaskField.vue +6 -6
- package/src/components/MMenu.vue +13 -6
- package/src/components/MMenuItem.vue +8 -6
- package/src/components/MMultiAutocomplete.vue +9 -8
- package/src/components/MMultiSelect.vue +9 -8
- package/src/components/MNavigationDrawer.vue +39 -27
- package/src/components/MNavigationRail.vue +28 -19
- package/src/components/MNavigationSuite.vue +1 -1
- package/src/components/MNotificationCenter.vue +1 -1
- package/src/components/MNotificationHost.vue +1 -1
- package/src/components/MNumberField.vue +6 -6
- package/src/components/MOrderTicket.vue +1 -1
- package/src/components/MPageProgress.vue +1 -1
- package/src/components/MPhoneInput.vue +5 -4
- package/src/components/MPinInput.vue +3 -2
- package/src/components/MPosKeypad.vue +2 -1
- package/src/components/MProductConfigurator.vue +2 -1
- package/src/components/MProgressBar.vue +2 -2
- package/src/components/MRichTextEditor.vue +8 -4
- package/src/components/MScheduler.vue +14 -14
- package/src/components/MSearchField.vue +1 -1
- package/src/components/MSeatMap.vue +2 -1
- package/src/components/MSegmentedButton.vue +1 -1
- package/src/components/MSelect.vue +7 -7
- package/src/components/MSideSheet.vue +3 -2
- package/src/components/MSimpleCarousel.vue +20 -11
- package/src/components/MSlider.vue +15 -5
- package/src/components/MSnackbar.vue +2 -2
- package/src/components/MSplitButton.vue +3 -2
- package/src/components/MSplitter.vue +6 -3
- package/src/components/MSpotlightSearch.vue +1 -1
- package/src/components/MSwitch.vue +5 -5
- package/src/components/MTable.vue +3 -3
- package/src/components/MTabs.vue +4 -1
- package/src/components/MTagInput.vue +6 -6
- package/src/components/MTerminal.vue +1 -1
- package/src/components/MText.vue +1 -1
- package/src/components/MTextField.vue +7 -7
- package/src/components/MTimePicker.vue +3 -2
- package/src/components/MTimePickerModal.vue +2 -2
- package/src/components/MTimeScroll.vue +1 -1
- package/src/components/MTimeline.vue +12 -12
- package/src/components/MToolbar.vue +3 -3
- package/src/components/MTrackingTimeline.vue +3 -2
- package/src/components/MTransition.vue +8 -3
- package/src/components/MTreeTable.vue +1 -1
- package/src/components/MTypewriter.vue +1 -1
- package/src/components/MVirtualTable.vue +2 -2
- package/src/components/MWindow.vue +4 -3
- package/src/components/_MColorPanel.vue +5 -4
- package/src/components/_MDrawerItemList.vue +9 -5
- package/src/components/_MMapAttribution.vue +2 -1
- package/src/components/_MMonthYearButton.vue +1 -1
- package/src/components/_MTransferPane.vue +8 -1
- package/src/components/_MTreeNode.vue +3 -3
- package/src/components/_MYearGrid.vue +4 -2
- package/src/composables/_fieldLayout.ts +19 -19
- package/src/composables/_popupPosition.ts +5 -3
- package/src/composables/_rtl.ts +76 -0
- package/src/composables/_useMenuNav.ts +24 -17
- package/src/composables/_useSheetMotion.ts +10 -3
- package/src/composables/useLocale.ts +6 -0
- package/src/locales/ar.ts +798 -0
- package/src/locales/de.ts +2 -0
- package/src/locales/es.ts +2 -0
- package/src/locales/fr.ts +2 -0
- package/src/locales/index.ts +1 -0
- package/src/locales/ja.ts +2 -0
- package/src/locales/ko.ts +2 -0
- package/src/locales/pt.ts +2 -0
- package/src/locales/zh.ts +2 -0
- package/src/plugin.ts +10 -0
- package/src/styles/theme.css +13 -0
- package/dist/MColorPickerModal-Dajjf6tH.js.map +0 -1
- package/dist/MIcon-DpajuUTJ.js +0 -33
- package/dist/MIcon-DpajuUTJ.js.map +0 -1
- package/dist/MListItem-DiOAxaN7.js.map +0 -1
- package/dist/MMenuItem-BuxYoASE.js +0 -574
- package/dist/MMenuItem-BuxYoASE.js.map +0 -1
- package/dist/MSlider-D_O8J9YH.js +0 -739
- package/dist/MSlider-D_O8J9YH.js.map +0 -1
- package/dist/MTextField-CYk9yFvi.js.map +0 -1
- package/dist/MTooltip-CK39Zon4.js +0 -183
- package/dist/MTooltip-CK39Zon4.js.map +0 -1
- package/dist/_popupPosition-nL8SVKPK.js.map +0 -1
- package/dist/useLocale-DL96OFgr.js.map +0 -1
|
@@ -254,14 +254,14 @@ defineExpose({
|
|
|
254
254
|
|
|
255
255
|
<!-- Edit: palette, fields, inspector -->
|
|
256
256
|
<div v-if="view === 'edit'" class="grid min-h-0 flex-1 grid-cols-1 @3xl:grid-cols-[13rem_1fr_19rem]">
|
|
257
|
-
<section class="border-b border-outline-variant p-3 @3xl:border-
|
|
257
|
+
<section class="border-b border-outline-variant p-3 @3xl:border-e @3xl:border-b-0" :aria-label="locale.formBuilderAddField">
|
|
258
258
|
<h3 class="mb-2 px-1 text-title-small text-on-surface-variant">{{ locale.formBuilderAddField }}</h3>
|
|
259
259
|
<div class="flex flex-wrap gap-1 @3xl:flex-col @3xl:flex-nowrap">
|
|
260
260
|
<button
|
|
261
261
|
v-for="t in palette"
|
|
262
262
|
:key="t.type"
|
|
263
263
|
type="button"
|
|
264
|
-
class="flex items-center gap-2 rounded-full px-3 py-1.5 text-
|
|
264
|
+
class="flex items-center gap-2 rounded-full px-3 py-1.5 text-start text-label-large text-on-surface-variant transition-colors hover:bg-on-surface/8 focus-visible:outline-2 focus-visible:outline-primary @3xl:rounded-lg"
|
|
265
265
|
:data-type="t.type"
|
|
266
266
|
@click="add(t.type)"
|
|
267
267
|
>
|
|
@@ -308,7 +308,7 @@ defineExpose({
|
|
|
308
308
|
</MDragDropList>
|
|
309
309
|
</section>
|
|
310
310
|
|
|
311
|
-
<section class="flex flex-col gap-4 border-t border-outline-variant p-4 @3xl:border-t-0 @3xl:border-
|
|
311
|
+
<section class="flex flex-col gap-4 border-t border-outline-variant p-4 @3xl:border-t-0 @3xl:border-s">
|
|
312
312
|
<template v-if="selected">
|
|
313
313
|
<h3 class="flex items-center gap-2 text-title-small text-on-surface-variant">
|
|
314
314
|
<MIcon :name="typeInfo(selected.field.type).icon" :size="20" /> {{ typeName(selected.field.type) }}
|
package/src/components/MIcon.vue
CHANGED
|
@@ -3,8 +3,15 @@
|
|
|
3
3
|
* Renders a Material Symbols Outlined glyph by name. Color follows the surrounding text color (set it with a
|
|
4
4
|
* Tailwind text-* class). Decorative by default: hidden from assistive technology, which would otherwise read the
|
|
5
5
|
* glyph's ligature text (its name, e.g. "arrow_drop_down"). Give it a `label` when the icon says something on its own.
|
|
6
|
+
*
|
|
7
|
+
* In a right-to-left layout (`dir="rtl"` on the page or any ancestor), icons that point along the reading
|
|
8
|
+
* direction (`arrow_back`, `chevron_right`, `send`, `undo`…, see `MIRRORED_ICONS`) are drawn mirrored, as
|
|
9
|
+
* Android's auto-mirrored icons are; `mirror` forces it on or off for one icon.
|
|
6
10
|
*/
|
|
7
|
-
|
|
11
|
+
import { computed } from 'vue'
|
|
12
|
+
import { MIRRORED_ICONS } from '../composables/_rtl'
|
|
13
|
+
|
|
14
|
+
const props = withDefaults(defineProps<{
|
|
8
15
|
/** Material Symbol name (e.g. "settings", "favorite") */
|
|
9
16
|
name: string
|
|
10
17
|
/** Icon size in px */
|
|
@@ -13,12 +20,17 @@ withDefaults(defineProps<{
|
|
|
13
20
|
filled?: boolean
|
|
14
21
|
/** What the icon means, when nothing next to it says so: makes it an image with this name instead of decoration */
|
|
15
22
|
label?: string
|
|
16
|
-
|
|
23
|
+
/** Mirror the glyph in a right-to-left layout. By default, only the directional icons in `MIRRORED_ICONS` are */
|
|
24
|
+
mirror?: boolean
|
|
25
|
+
}>(), { size: 24, filled: false, mirror: undefined })
|
|
26
|
+
|
|
27
|
+
const mirrored = computed(() => props.mirror ?? MIRRORED_ICONS.has(props.name))
|
|
17
28
|
</script>
|
|
18
29
|
|
|
19
30
|
<template>
|
|
20
31
|
<span
|
|
21
32
|
class="material-symbols-outlined leading-none"
|
|
33
|
+
:class="mirrored && 'm3-rtl:-scale-x-100'"
|
|
22
34
|
:role="label ? 'img' : undefined"
|
|
23
35
|
:aria-label="label"
|
|
24
36
|
:aria-hidden="label ? undefined : 'true'"
|
|
@@ -157,7 +157,7 @@ defineExpose({
|
|
|
157
157
|
</script>
|
|
158
158
|
|
|
159
159
|
<template>
|
|
160
|
-
<div ref="rootEl" class="flex flex-col gap-0" @focusout="onFocusOut">
|
|
160
|
+
<div ref="rootEl" dir="ltr" class="flex flex-col gap-0" @focusout="onFocusOut">
|
|
161
161
|
<MCodeEditor
|
|
162
162
|
:model-value="rawText"
|
|
163
163
|
language="json"
|
|
@@ -181,7 +181,6 @@ defineExpose({
|
|
|
181
181
|
<button
|
|
182
182
|
v-if="!readonly"
|
|
183
183
|
type="button"
|
|
184
|
-
:title="l.format"
|
|
185
184
|
class="flex h-7 cursor-pointer items-center gap-1 rounded px-2 text-label-medium text-on-surface-variant transition-colors hover:bg-on-surface/8"
|
|
186
185
|
@click="formatJson"
|
|
187
186
|
>
|
|
@@ -191,7 +190,6 @@ defineExpose({
|
|
|
191
190
|
<button
|
|
192
191
|
v-if="!readonly"
|
|
193
192
|
type="button"
|
|
194
|
-
:title="l.minify"
|
|
195
193
|
class="flex h-7 cursor-pointer items-center gap-1 rounded px-2 text-label-medium text-on-surface-variant transition-colors hover:bg-on-surface/8"
|
|
196
194
|
@click="minifyJson"
|
|
197
195
|
>
|
|
@@ -79,7 +79,7 @@ function formatValue(val: unknown) {
|
|
|
79
79
|
</script>
|
|
80
80
|
|
|
81
81
|
<template>
|
|
82
|
-
<div class="font-mono text-body-small leading-relaxed" :class="{ 'rounded-lg border border-outline-variant bg-surface-container-lowest p-3': _depth === 0 }">
|
|
82
|
+
<div dir="ltr" class="font-mono text-body-small leading-relaxed" :class="{ 'rounded-lg border border-outline-variant bg-surface-container-lowest p-3': _depth === 0 }">
|
|
83
83
|
<!-- Expandable node -->
|
|
84
84
|
<template v-if="isExpandable">
|
|
85
85
|
<button
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
import { ref, onBeforeUpdate, onUpdated, onMounted, onBeforeUnmount } from 'vue'
|
|
19
19
|
import MIcon from './MIcon.vue'
|
|
20
20
|
import { useLocale } from '../composables/useLocale'
|
|
21
|
+
import { logicalKey } from '../composables/_rtl'
|
|
21
22
|
|
|
22
23
|
export interface KanbanCard {
|
|
23
24
|
id: string | number
|
|
@@ -616,7 +617,7 @@ function onCardKeydown(e: KeyboardEvent, card: KanbanCard, column: KanbanColumn)
|
|
|
616
617
|
if (e.key === 'ArrowUp') toIndex = here.index - 1
|
|
617
618
|
else if (e.key === 'ArrowDown') toIndex = here.index + 1
|
|
618
619
|
else if (e.key === 'ArrowLeft' || e.key === 'ArrowRight') {
|
|
619
|
-
const next = cols[ci + (e.
|
|
620
|
+
const next = cols[ci + (logicalKey(e, e.currentTarget as Element) === 'ArrowLeft' ? -1 : 1)]
|
|
620
621
|
if (!next) return e.preventDefault()
|
|
621
622
|
toCol = next
|
|
622
623
|
toIndex = Math.min(here.index, next.cards.length)
|
|
@@ -98,10 +98,10 @@ const detailHidden = computed(() => !twoPane.value && !props.showDetail)
|
|
|
98
98
|
opacity 0.2s linear 0.2s,
|
|
99
99
|
visibility 0s 0.4s;
|
|
100
100
|
}
|
|
101
|
-
|
|
101
|
+
.m3-ld-list-hidden:dir(rtl) {
|
|
102
102
|
transform: translateX(12%);
|
|
103
103
|
}
|
|
104
|
-
|
|
104
|
+
.m3-ld-detail-hidden:dir(rtl) {
|
|
105
105
|
transform: translateX(-100%);
|
|
106
106
|
}
|
|
107
107
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -38,7 +38,7 @@ const titleId = `m3-list-group-${useId()}`
|
|
|
38
38
|
v-if="title || $slots.title"
|
|
39
39
|
:id="titleId"
|
|
40
40
|
class="px-4 pb-2 text-label-medium font-medium text-on-surface-variant"
|
|
41
|
-
:class="[segmented ? 'pt-2' : 'pt-4', inset && '
|
|
41
|
+
:class="[segmented ? 'pt-2' : 'pt-4', inset && 'ps-16']"
|
|
42
42
|
>
|
|
43
43
|
<slot name="title">{{ title }}</slot>
|
|
44
44
|
</div>
|
|
@@ -186,7 +186,7 @@ const minHeightClass = computed(() => {
|
|
|
186
186
|
})
|
|
187
187
|
|
|
188
188
|
const containerClasses = computed(() => [
|
|
189
|
-
'mli-row relative flex w-full items-center gap-4 text-
|
|
189
|
+
'mli-row relative flex w-full items-center gap-4 text-start',
|
|
190
190
|
// Corner radius: a pill in nav lists, otherwise sprung by expressiveRadii below
|
|
191
191
|
isSegmented.value ? 'bg-surface-container px-4' : isNav.value ? 'rounded-full px-4' : 'px-4',
|
|
192
192
|
isDense.value
|
|
@@ -272,7 +272,7 @@ const stateLayerOpacity = computed(() => {
|
|
|
272
272
|
return pressed.value ? 0.12 : hovered.value ? 0.08 : 0
|
|
273
273
|
})
|
|
274
274
|
const indentStyle = computed(() =>
|
|
275
|
-
props.indent === undefined ? undefined : {
|
|
275
|
+
props.indent === undefined ? undefined : { paddingInlineStart: typeof props.indent === 'number' ? `${props.indent}px` : props.indent },
|
|
276
276
|
)
|
|
277
277
|
function onFocus(e: FocusEvent) { focused.value = (e.currentTarget as Element).matches(':focus-visible') }
|
|
278
278
|
function onBlur() { focused.value = false }
|
|
@@ -425,8 +425,8 @@ function handleTrailingToggle() {
|
|
|
425
425
|
<!-- Divider -->
|
|
426
426
|
<div
|
|
427
427
|
v-if="hasDivider"
|
|
428
|
-
class="absolute top-0
|
|
429
|
-
:class="hasDivider === 'inset' ? '
|
|
428
|
+
class="absolute top-0 end-0 h-px bg-outline-variant"
|
|
429
|
+
:class="hasDivider === 'inset' ? 'start-16' : 'start-0'"
|
|
430
430
|
/>
|
|
431
431
|
|
|
432
432
|
<!-- Leading -->
|
|
@@ -499,7 +499,7 @@ function handleTrailingToggle() {
|
|
|
499
499
|
.mli-expand-body {
|
|
500
500
|
min-height: 0;
|
|
501
501
|
overflow: hidden;
|
|
502
|
-
padding-
|
|
502
|
+
padding-inline-start: 2rem;
|
|
503
503
|
}
|
|
504
504
|
|
|
505
505
|
.mli-expand-enter-active {
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import { computed, onBeforeUnmount, ref, useId, watch } from 'vue'
|
|
17
17
|
import type * as Maplibre from 'maplibre-gl'
|
|
18
18
|
import MIcon from './MIcon.vue'
|
|
19
|
+
import { vTooltip } from '../directives/vTooltip'
|
|
19
20
|
import MMapControl from './MMapControl.vue'
|
|
20
21
|
import { useLocale } from '../composables/useLocale'
|
|
21
22
|
import { useMap } from '../composables/useMap'
|
|
@@ -578,7 +579,7 @@ defineExpose({
|
|
|
578
579
|
:key="m"
|
|
579
580
|
type="button"
|
|
580
581
|
class="grid place-items-center"
|
|
581
|
-
|
|
582
|
+
v-tooltip="titles[m]"
|
|
582
583
|
:aria-label="titles[m]"
|
|
583
584
|
:aria-pressed="mode === m"
|
|
584
585
|
@click="start(m)"
|
|
@@ -589,7 +590,7 @@ defineExpose({
|
|
|
589
590
|
v-if="editable"
|
|
590
591
|
type="button"
|
|
591
592
|
class="grid place-items-center"
|
|
592
|
-
|
|
593
|
+
v-tooltip="t.mapDeleteFeature"
|
|
593
594
|
:aria-label="t.mapDeleteFeature"
|
|
594
595
|
:disabled="selected === null"
|
|
595
596
|
@click="remove()"
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import { computed, onBeforeUnmount, ref, shallowRef, watch } from 'vue'
|
|
10
10
|
import type * as Maplibre from 'maplibre-gl'
|
|
11
11
|
import MIcon from './MIcon.vue'
|
|
12
|
+
import { vTooltip } from '../directives/vTooltip'
|
|
12
13
|
import MMapControl from './MMapControl.vue'
|
|
13
14
|
import MMapPopup from './MMapPopup.vue'
|
|
14
15
|
import { useLocale } from '../composables/useLocale'
|
|
@@ -94,7 +95,7 @@ const corner = computed(() => (props.control === true ? 'top-right' : props.cont
|
|
|
94
95
|
<button
|
|
95
96
|
type="button"
|
|
96
97
|
class="grid place-items-center"
|
|
97
|
-
|
|
98
|
+
v-tooltip="t.mapHoverInfo"
|
|
98
99
|
:aria-label="t.mapHoverInfo"
|
|
99
100
|
:aria-pressed="modelValue"
|
|
100
101
|
@click="emit('update:modelValue', !modelValue)"
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
import { computed, onBeforeUnmount, ref, shallowRef, useId, watch } from 'vue'
|
|
14
14
|
import type * as Maplibre from 'maplibre-gl'
|
|
15
15
|
import MIcon from './MIcon.vue'
|
|
16
|
+
import { vTooltip } from '../directives/vTooltip'
|
|
16
17
|
import MMapControl from './MMapControl.vue'
|
|
17
18
|
import MMapMarker from './MMapMarker.vue'
|
|
18
19
|
import { useLocale } from '../composables/useLocale'
|
|
@@ -442,7 +443,7 @@ defineExpose({ start, finish, clear, remove })
|
|
|
442
443
|
type="button"
|
|
443
444
|
class="pointer-events-auto grid size-5 cursor-pointer place-items-center rounded-full hover:bg-on-primary/12 focus-visible:outline-2 focus-visible:outline-on-primary"
|
|
444
445
|
:aria-label="t.mapDeleteMeasurement"
|
|
445
|
-
|
|
446
|
+
v-tooltip="t.mapDeleteMeasurement"
|
|
446
447
|
@click.stop="remove(label.m)"
|
|
447
448
|
@pointerdown.stop
|
|
448
449
|
@mousedown.stop
|
|
@@ -35,6 +35,7 @@ export interface MapRouteStop {
|
|
|
35
35
|
import { computed, onBeforeUnmount, onMounted, ref, shallowRef, useId, useSlots, watch } from 'vue'
|
|
36
36
|
import type * as Maplibre from 'maplibre-gl'
|
|
37
37
|
import MIcon from './MIcon.vue'
|
|
38
|
+
import { vTooltip } from '../directives/vTooltip'
|
|
38
39
|
import MMapMarker from './MMapMarker.vue'
|
|
39
40
|
import { useMap } from '../composables/useMap'
|
|
40
41
|
import { useThemeTokens } from '../composables/useThemeTokens'
|
|
@@ -484,7 +485,7 @@ defineExpose({
|
|
|
484
485
|
<span
|
|
485
486
|
role="img"
|
|
486
487
|
:aria-label="stopName(stop, i)"
|
|
487
|
-
|
|
488
|
+
v-tooltip="stopName(stop, i)"
|
|
488
489
|
class="m3-map-route-stop flex h-7 w-7 items-center justify-center rounded-full border-2 text-label-medium font-medium shadow-elevation-1 transition-colors duration-300"
|
|
489
490
|
:class="stopDone(i) ? 'border-transparent bg-primary text-on-primary' : 'border-primary bg-surface text-primary'"
|
|
490
491
|
:style="color ? (stopDone(i) ? { background: color } : { borderColor: color, color }) : undefined"
|
|
@@ -142,17 +142,20 @@ function onContainerClick(e: MouseEvent) {
|
|
|
142
142
|
.m3-markdown :deep(strong) { font-weight: 600; color: var(--color-on-surface); }
|
|
143
143
|
.m3-markdown :deep(em) { font-style: italic; }
|
|
144
144
|
|
|
145
|
-
.m3-markdown :deep(ul) { list-style-type: disc; padding-
|
|
146
|
-
.m3-markdown :deep(ol) { list-style-type: decimal; padding-
|
|
145
|
+
.m3-markdown :deep(ul) { list-style-type: disc; padding-inline-start: 1.5em; margin: 0.5em 0; }
|
|
146
|
+
.m3-markdown :deep(ol) { list-style-type: decimal; padding-inline-start: 1.5em; margin: 0.5em 0; }
|
|
147
147
|
.m3-markdown :deep(li) { margin: 0.25em 0; }
|
|
148
148
|
.m3-markdown :deep(li::marker) { color: var(--color-on-surface-variant); }
|
|
149
149
|
|
|
150
150
|
.m3-markdown :deep(blockquote) {
|
|
151
|
-
border-
|
|
151
|
+
border-inline-start: 3px solid var(--color-primary);
|
|
152
152
|
padding: 0.5em 1em;
|
|
153
153
|
margin: 0.75em 0;
|
|
154
154
|
background: var(--color-surface-container);
|
|
155
|
-
border-radius: 0
|
|
155
|
+
border-start-start-radius: 0;
|
|
156
|
+
border-end-start-radius: 0;
|
|
157
|
+
border-start-end-radius: 8px;
|
|
158
|
+
border-end-end-radius: 8px;
|
|
156
159
|
color: var(--color-on-surface-variant);
|
|
157
160
|
}
|
|
158
161
|
|
|
@@ -222,7 +225,7 @@ function onContainerClick(e: MouseEvent) {
|
|
|
222
225
|
.m3-markdown :deep(.hljs-params) { color: var(--color-on-surface); }
|
|
223
226
|
|
|
224
227
|
/* Code block wrapper */
|
|
225
|
-
.m3-markdown :deep(.m3-code-block) { position: relative; }
|
|
228
|
+
.m3-markdown :deep(.m3-code-block) { position: relative; direction: ltr; }
|
|
226
229
|
|
|
227
230
|
/* Copy button */
|
|
228
231
|
.m3-markdown :deep(.m3-code-copy) {
|
|
@@ -270,7 +273,7 @@ function onContainerClick(e: MouseEvent) {
|
|
|
270
273
|
.m3-markdown :deep(th) {
|
|
271
274
|
background: var(--color-surface-container);
|
|
272
275
|
font-weight: 600;
|
|
273
|
-
text-align:
|
|
276
|
+
text-align: start;
|
|
274
277
|
padding: 0.5em 0.75em;
|
|
275
278
|
border-bottom: 2px solid var(--color-outline-variant);
|
|
276
279
|
font-size: var(--text-label-large);
|
|
@@ -12,7 +12,7 @@ import MIcon from './MIcon.vue'
|
|
|
12
12
|
import { useFieldBg } from '../composables/useFieldBg'
|
|
13
13
|
import { useDebounce } from '../composables/useDebounce'
|
|
14
14
|
import { useLocale } from '../composables/useLocale'
|
|
15
|
-
import {
|
|
15
|
+
import { FIELD_PADDING_END, fieldLabelClasses, vOverflowTitle, type FieldEndInset } from '../composables/_fieldLayout'
|
|
16
16
|
|
|
17
17
|
export type MaskPreset = 'credit-card' | 'phone' | 'date' | 'time' | 'cpf' | 'cnpj' | 'zip'
|
|
18
18
|
|
|
@@ -166,11 +166,11 @@ function onKeydown(e: KeyboardEvent) {
|
|
|
166
166
|
const hasTrailing = computed(() => props.clearable)
|
|
167
167
|
|
|
168
168
|
// The label and the text both stop before the trailing controls
|
|
169
|
-
const rightInset = computed<
|
|
169
|
+
const rightInset = computed<FieldEndInset>(() => (hasTrailing.value ? 'end-12' : 'end-4'))
|
|
170
170
|
|
|
171
171
|
const inputClasses = computed(() => {
|
|
172
|
-
const pl = props.leadingIcon ? '
|
|
173
|
-
const pr =
|
|
172
|
+
const pl = props.leadingIcon ? 'ps-12' : 'ps-4'
|
|
173
|
+
const pr = FIELD_PADDING_END[rightInset.value]
|
|
174
174
|
const base = [
|
|
175
175
|
'peer block w-full text-body-large text-on-surface outline-none placeholder:text-transparent',
|
|
176
176
|
'transition-[border-color,border-width] duration-150',
|
|
@@ -237,7 +237,7 @@ defineExpose({
|
|
|
237
237
|
>
|
|
238
238
|
<div
|
|
239
239
|
v-if="leadingIcon"
|
|
240
|
-
class="pointer-events-none absolute
|
|
240
|
+
class="pointer-events-none absolute start-3.5"
|
|
241
241
|
:class="[
|
|
242
242
|
variant === 'filled' ? 'top-4.5' : 'top-4',
|
|
243
243
|
isDisabled ? 'text-on-surface/38' : 'text-on-surface-variant',
|
|
@@ -271,7 +271,7 @@ defineExpose({
|
|
|
271
271
|
:aria-label="locale.clear"
|
|
272
272
|
v-if="showClear"
|
|
273
273
|
type="button"
|
|
274
|
-
class="absolute
|
|
274
|
+
class="absolute end-3 top-1/2 -translate-y-1/2 flex h-6 w-6 cursor-pointer items-center justify-center rounded-full text-on-surface-variant transition-colors hover:bg-on-surface/8 hover:text-on-surface"
|
|
275
275
|
@click="cancelDebounce(); emit('update:modelValue', '')"
|
|
276
276
|
>
|
|
277
277
|
<MIcon name="close" :size="18" />
|
package/src/components/MMenu.vue
CHANGED
|
@@ -12,13 +12,17 @@ import MMenuDivider from './MMenuDivider.vue'
|
|
|
12
12
|
import { useEscapeStack } from '../composables/_useEscapeStack'
|
|
13
13
|
import { useMenuNav } from '../composables/_useMenuNav'
|
|
14
14
|
import { POPUP_MARGIN, dropdownX } from '../composables/_popupPosition'
|
|
15
|
+
import { isRtl } from '../composables/_rtl'
|
|
15
16
|
|
|
16
17
|
defineOptions({ inheritAttrs: false })
|
|
17
18
|
|
|
18
19
|
const props = withDefaults(
|
|
19
20
|
defineProps<{
|
|
20
|
-
/**
|
|
21
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Which edge of the trigger the dropdown aligns to. `start`/`end` follow the reading direction (`end` is the
|
|
23
|
+
* right edge, or the left one in a right-to-left page)
|
|
24
|
+
*/
|
|
25
|
+
align?: 'start' | 'end' | 'left' | 'right'
|
|
22
26
|
/**
|
|
23
27
|
* How items with a `#children` slot behave.
|
|
24
28
|
* `'flyout'` opens a hover-positioned side panel (desktop).
|
|
@@ -39,7 +43,7 @@ const props = withDefaults(
|
|
|
39
43
|
// groups with a visible gap between them, instead of a plain line.
|
|
40
44
|
variant?: 'standard' | 'expressive'
|
|
41
45
|
}>(),
|
|
42
|
-
{ align: '
|
|
46
|
+
{ align: 'end', submenuMode: 'flyout', variant: 'standard' },
|
|
43
47
|
)
|
|
44
48
|
|
|
45
49
|
const slots = useSlots()
|
|
@@ -261,11 +265,14 @@ function computePos() {
|
|
|
261
265
|
// Keeps the panel on screen (Compose's DropdownMenuPositionProvider, see _popupPosition.ts): aligned with the
|
|
262
266
|
// trigger's `align` edge if it fits there, else its other edge, else against the window edge on its side. The
|
|
263
267
|
// animation grows from the trigger, wherever the panel ended up.
|
|
264
|
-
const originX = ref(props.align === 'right' ? 'right' : 'left')
|
|
268
|
+
const originX = ref(props.align === 'right' || (props.align === 'end' && !isRtl()) || (props.align === 'start' && isRtl()) ? 'right' : 'left')
|
|
265
269
|
function placeX(el: HTMLElement) {
|
|
266
270
|
if (!anchorRect) return
|
|
267
271
|
const width = el.offsetWidth
|
|
268
|
-
|
|
272
|
+
// left/right are physical: in RTL they ask for the opposite logical edge
|
|
273
|
+
const rtl = isRtl()
|
|
274
|
+
const logical = props.align === 'left' ? (rtl ? 'end' : 'start') : props.align === 'right' ? (rtl ? 'start' : 'end') : props.align
|
|
275
|
+
const x = dropdownX(anchorRect, width, window.innerWidth, logical, undefined, rtl)
|
|
269
276
|
const pivot = Math.min(width, Math.max(0, (anchorRect.left + anchorRect.right) / 2 - x))
|
|
270
277
|
const fromEdge = Math.abs(x - anchorRect.left) < 1 ? 'left' : Math.abs(x + width - anchorRect.right) < 1 ? 'right' : `${pivot}px`
|
|
271
278
|
originX.value = fromEdge
|
|
@@ -409,7 +416,7 @@ const origin = computed(() => `${originX.value} ${openAbove.value ? 'bottom' : '
|
|
|
409
416
|
<!-- Back: a header row in the menu's own item metrics, labelled like an M3 menu group, then a divider -->
|
|
410
417
|
<button
|
|
411
418
|
type="button"
|
|
412
|
-
class="flex w-full items-center gap-3 px-4 py-2.5 text-
|
|
419
|
+
class="flex w-full items-center gap-3 px-4 py-2.5 text-start text-label-large text-on-surface-variant outline-none transition-colors hover:bg-on-surface/8 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary"
|
|
413
420
|
@click="popNav"
|
|
414
421
|
>
|
|
415
422
|
<MIcon name="arrow_back" :size="20" class="shrink-0" />
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import { computed, inject, nextTick, onMounted, onUnmounted, ref, useSlots, watch } from 'vue'
|
|
19
19
|
import MIcon from './MIcon.vue'
|
|
20
|
+
import { isRtl } from '../composables/_rtl'
|
|
20
21
|
import { FAST_EFFECTS, FAST_SPATIAL, useSpring } from '../composables/_useSpring'
|
|
21
22
|
import { POPUP_MARGIN, fitPopup } from '../composables/_popupPosition'
|
|
22
23
|
|
|
@@ -126,7 +127,7 @@ const iconSlotEl = ref<HTMLElement>()
|
|
|
126
127
|
const showSub = ref(false)
|
|
127
128
|
const subStyle = ref<Record<string, string>>({})
|
|
128
129
|
|
|
129
|
-
// To the item's right, else its left, else clamped on screen (see _popupPosition.ts); placeSub() settles it once
|
|
130
|
+
// To the item's right, else its left (the other way round in RTL), else clamped on screen (see _popupPosition.ts); placeSub() settles it once
|
|
130
131
|
// the submenu is in the DOM and its size is known, before it paints
|
|
131
132
|
function positionSub() {
|
|
132
133
|
if (!itemEl.value) return
|
|
@@ -148,7 +149,8 @@ function placeSub(el: Element) {
|
|
|
148
149
|
sub.style.left = '0px'
|
|
149
150
|
const w = sub.offsetWidth
|
|
150
151
|
const h = sub.offsetHeight
|
|
151
|
-
|
|
152
|
+
// Right to left, a submenu opens toward the left first
|
|
153
|
+
const left = fitPopup(isRtl(itemEl.value) ? [rect.left - w, rect.right] : [rect.right, rect.left - w], w, window.innerWidth)
|
|
152
154
|
const top = fitPopup([rect.top, rect.bottom - h], h, window.innerHeight)
|
|
153
155
|
subStyle.value = { ...subStyle.value, left: `${left}px`, top: `${top}px` }
|
|
154
156
|
sub.style.left = `${left}px`
|
|
@@ -222,7 +224,7 @@ function onSubPointerLeave(e: PointerEvent) {
|
|
|
222
224
|
:type="to ? undefined : 'button'"
|
|
223
225
|
:role="selectable ? (checkable ? 'menuitemcheckbox' : 'menuitemradio') : undefined"
|
|
224
226
|
:aria-checked="selectable ? on : undefined"
|
|
225
|
-
class="flex items-center gap-3 py-2.5 text-
|
|
227
|
+
class="flex items-center gap-3 py-2.5 text-start text-body-large transition-colors outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary"
|
|
226
228
|
:class="selectable
|
|
227
229
|
? [
|
|
228
230
|
'relative mx-1 w-[calc(100%-0.5rem)] px-3 duration-150 before:pointer-events-none before:absolute before:inset-0 before:rounded-[inherit] before:bg-current before:opacity-0 before:transition-opacity',
|
|
@@ -240,8 +242,8 @@ function onSubPointerLeave(e: PointerEvent) {
|
|
|
240
242
|
:aria-expanded="hasChildren ? showSub : undefined"
|
|
241
243
|
@click="handleClick"
|
|
242
244
|
>
|
|
243
|
-
<!-- -
|
|
244
|
-
<span v-if="slidingIcon" ref="iconSlotEl" class="-
|
|
245
|
+
<!-- -me-3 cancels the flex gap, so the label sits flush while the slot is closed -->
|
|
246
|
+
<span v-if="slidingIcon" ref="iconSlotEl" class="-me-3 flex shrink-0 overflow-hidden" style="width: 0; opacity: 0">
|
|
245
247
|
<MIcon :name="onIcon!" :size="20" class="shrink-0" />
|
|
246
248
|
</span>
|
|
247
249
|
<span
|
|
@@ -260,7 +262,7 @@ function onSubPointerLeave(e: PointerEvent) {
|
|
|
260
262
|
:class="selectable ? (on ? '' : 'text-on-surface-variant') : danger ? 'text-error' : 'text-on-surface-variant'"
|
|
261
263
|
/>
|
|
262
264
|
<span class="flex-1"><slot /></span>
|
|
263
|
-
<span v-if="shortcut && !hasChildren" class="
|
|
265
|
+
<span v-if="shortcut && !hasChildren" class="ms-4 shrink-0 text-label-small text-on-surface-variant opacity-60">{{ shortcut }}</span>
|
|
264
266
|
<MIcon v-if="hasChildren" name="chevron_right" :size="18" class="shrink-0 text-on-surface-variant" />
|
|
265
267
|
</component>
|
|
266
268
|
|
|
@@ -9,6 +9,7 @@ import { computed, ref, useId, onMounted, onUnmounted, watch, nextTick } from 'v
|
|
|
9
9
|
import { useFieldValidation, useFocusLeave } from '../composables/_useFieldValidation'
|
|
10
10
|
import type { ValidateOn, ValidationRule } from '../composables/validation'
|
|
11
11
|
import MIcon from './MIcon.vue'
|
|
12
|
+
import { vTooltip } from '../directives/vTooltip'
|
|
12
13
|
import MIconButton from './MIconButton.vue'
|
|
13
14
|
import MCheckbox from './MCheckbox.vue'
|
|
14
15
|
import { useFieldBg } from '../composables/useFieldBg'
|
|
@@ -18,7 +19,7 @@ import { useDebounce } from '../composables/useDebounce'
|
|
|
18
19
|
import type { MultiSelectOption } from './MMultiSelect.vue'
|
|
19
20
|
import { useScrollLock } from '../composables/_useScrollLock'
|
|
20
21
|
import { useEscapeStack } from '../composables/_useEscapeStack'
|
|
21
|
-
import {
|
|
22
|
+
import { FIELD_PADDING_END, fieldLabelClasses, vOverflowTitle, type FieldEndInset } from '../composables/_fieldLayout'
|
|
22
23
|
|
|
23
24
|
// Root is a fragment (field div + a sibling Teleport for the dropdown panel), so Vue can't
|
|
24
25
|
// auto-apply a consumer's class/attrs to either one — forward them onto the field div below.
|
|
@@ -353,14 +354,14 @@ watch(filteredOptions, () => {
|
|
|
353
354
|
const isFloated = computed(() => hasValue.value || open.value)
|
|
354
355
|
|
|
355
356
|
// Chips wrap before the trailing controls; the label stops there too
|
|
356
|
-
const rightInset = computed<
|
|
357
|
+
const rightInset = computed<FieldEndInset>(() => (props.clearable ? 'end-16' : 'end-10'))
|
|
357
358
|
|
|
358
359
|
const triggerClasses = computed(() => {
|
|
359
360
|
const base = [
|
|
360
361
|
'flex min-h-[56px] w-full min-w-0 items-center gap-1.5 flex-wrap',
|
|
361
362
|
'transition-[border-color,border-width] duration-150',
|
|
362
|
-
props.leadingIcon ? '
|
|
363
|
-
|
|
363
|
+
props.leadingIcon ? 'ps-12' : 'ps-4',
|
|
364
|
+
FIELD_PADDING_END[rightInset.value],
|
|
364
365
|
]
|
|
365
366
|
|
|
366
367
|
if (props.variant === 'outlined') {
|
|
@@ -422,7 +423,7 @@ const onFocusOut = useFocusLeave(() => rootEl.value, () => {
|
|
|
422
423
|
<!-- Leading icon -->
|
|
423
424
|
<div
|
|
424
425
|
v-if="leadingIcon"
|
|
425
|
-
class="pointer-events-none absolute
|
|
426
|
+
class="pointer-events-none absolute start-3.5"
|
|
426
427
|
:class="[
|
|
427
428
|
variant === 'filled' ? 'top-4.5' : 'top-4',
|
|
428
429
|
isDisabled ? 'text-on-surface/38' : 'text-on-surface-variant',
|
|
@@ -459,7 +460,7 @@ const onFocusOut = useFocusLeave(() => rootEl.value, () => {
|
|
|
459
460
|
</span>
|
|
460
461
|
<span
|
|
461
462
|
v-if="overflowCount > 0 && !chipsExpanded"
|
|
462
|
-
|
|
463
|
+
v-tooltip="overflowLabels"
|
|
463
464
|
class="cursor-pointer rounded-full bg-surface-container-high px-2 py-0.5 text-label-small text-on-surface-variant transition-colors hover:bg-on-surface/12"
|
|
464
465
|
@click.stop="chipsExpanded = true"
|
|
465
466
|
>
|
|
@@ -511,14 +512,14 @@ const onFocusOut = useFocusLeave(() => rootEl.value, () => {
|
|
|
511
512
|
:aria-label="locale.clear"
|
|
512
513
|
v-if="clearable && hasValue && !disabled"
|
|
513
514
|
type="button"
|
|
514
|
-
class="absolute
|
|
515
|
+
class="absolute end-9 top-4 flex h-6 w-6 cursor-pointer items-center justify-center rounded-full text-on-surface-variant transition-colors hover:bg-on-surface/8 hover:text-on-surface"
|
|
515
516
|
@click.stop="emit('update:modelValue', []); closeDropdown()"
|
|
516
517
|
>
|
|
517
518
|
<MIcon name="close" :size="18" />
|
|
518
519
|
</button>
|
|
519
520
|
|
|
520
521
|
<!-- Arrow icon -->
|
|
521
|
-
<div class="pointer-events-none absolute
|
|
522
|
+
<div class="pointer-events-none absolute end-2 top-4">
|
|
522
523
|
<MIcon
|
|
523
524
|
name="arrow_drop_down"
|
|
524
525
|
:size="24"
|
|
@@ -9,13 +9,14 @@ import { computed, ref, useId, onMounted, onUnmounted, nextTick, watch } from 'v
|
|
|
9
9
|
import { useFieldValidation, useFocusLeave } from '../composables/_useFieldValidation'
|
|
10
10
|
import type { ValidateOn, ValidationRule } from '../composables/validation'
|
|
11
11
|
import MIcon from './MIcon.vue'
|
|
12
|
+
import { vTooltip } from '../directives/vTooltip'
|
|
12
13
|
import MIconButton from './MIconButton.vue'
|
|
13
14
|
import MCheckbox from './MCheckbox.vue'
|
|
14
15
|
import { useFieldBg } from '../composables/useFieldBg'
|
|
15
16
|
import { useLocale } from '../composables/useLocale'
|
|
16
17
|
import { useFollowAnchor } from '../composables/_useFollowAnchor'
|
|
17
18
|
import { useScrollLock } from '../composables/_useScrollLock'
|
|
18
|
-
import {
|
|
19
|
+
import { FIELD_PADDING_END, FIELD_VALUE, fieldLabelClasses, vOverflowTitle, type FieldEndInset } from '../composables/_fieldLayout'
|
|
19
20
|
|
|
20
21
|
const locale = useLocale()
|
|
21
22
|
|
|
@@ -253,15 +254,15 @@ onUnmounted(() => {
|
|
|
253
254
|
})
|
|
254
255
|
|
|
255
256
|
// Chips wrap before the trailing controls; the label stops there too
|
|
256
|
-
const rightInset = computed<
|
|
257
|
+
const rightInset = computed<FieldEndInset>(() => (props.clearable ? 'end-16' : 'end-10'))
|
|
257
258
|
|
|
258
259
|
const triggerClasses = computed(() => {
|
|
259
260
|
const base = [
|
|
260
261
|
'flex min-h-[56px] w-full min-w-0 items-center gap-1.5 flex-wrap outline-none',
|
|
261
262
|
'transition-[border-color,border-width] duration-150',
|
|
262
263
|
isDisabled.value ? 'cursor-not-allowed' : 'cursor-pointer',
|
|
263
|
-
props.leadingIcon ? '
|
|
264
|
-
|
|
264
|
+
props.leadingIcon ? 'ps-12' : 'ps-4',
|
|
265
|
+
FIELD_PADDING_END[rightInset.value],
|
|
265
266
|
]
|
|
266
267
|
|
|
267
268
|
if (props.variant === 'outlined') {
|
|
@@ -328,7 +329,7 @@ const onFocusOut = useFocusLeave(() => rootEl.value, () => {
|
|
|
328
329
|
>
|
|
329
330
|
<div
|
|
330
331
|
v-if="leadingIcon"
|
|
331
|
-
class="pointer-events-none absolute
|
|
332
|
+
class="pointer-events-none absolute start-3.5"
|
|
332
333
|
:class="[
|
|
333
334
|
variant === 'filled' ? 'top-4.5' : 'top-4',
|
|
334
335
|
isDisabled ? 'text-on-surface/38' : 'text-on-surface-variant',
|
|
@@ -376,7 +377,7 @@ const onFocusOut = useFocusLeave(() => rootEl.value, () => {
|
|
|
376
377
|
</span>
|
|
377
378
|
<span
|
|
378
379
|
v-if="overflowCount > 0 && !chipsExpanded"
|
|
379
|
-
|
|
380
|
+
v-tooltip="overflowLabels"
|
|
380
381
|
class="cursor-pointer rounded-full bg-surface-container-high px-2 py-0.5 text-label-small text-on-surface-variant transition-colors hover:bg-on-surface/12"
|
|
381
382
|
@click.stop="chipsExpanded = true"
|
|
382
383
|
>
|
|
@@ -403,13 +404,13 @@ const onFocusOut = useFocusLeave(() => rootEl.value, () => {
|
|
|
403
404
|
:aria-label="locale.clear"
|
|
404
405
|
v-if="clearable && hasValue && !disabled"
|
|
405
406
|
type="button"
|
|
406
|
-
class="absolute
|
|
407
|
+
class="absolute end-9 top-4 flex h-6 w-6 cursor-pointer items-center justify-center rounded-full text-on-surface-variant transition-colors hover:bg-on-surface/8 hover:text-on-surface"
|
|
407
408
|
@click.stop="emit('update:modelValue', []); close()"
|
|
408
409
|
>
|
|
409
410
|
<MIcon name="close" :size="18" />
|
|
410
411
|
</button>
|
|
411
412
|
|
|
412
|
-
<div class="pointer-events-none absolute
|
|
413
|
+
<div class="pointer-events-none absolute end-2 top-4">
|
|
413
414
|
<MIcon
|
|
414
415
|
name="arrow_drop_down"
|
|
415
416
|
:size="24"
|