@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
|
@@ -17,7 +17,7 @@ import { useDebounce } from '../composables/useDebounce'
|
|
|
17
17
|
import type { SelectOption } from './MSelect.vue'
|
|
18
18
|
import { useScrollLock } from '../composables/_useScrollLock'
|
|
19
19
|
import { useEscapeStack } from '../composables/_useEscapeStack'
|
|
20
|
-
import {
|
|
20
|
+
import { FIELD_PADDING_END, fieldLabelClasses, vOverflowTitle, type FieldEndInset } from '../composables/_fieldLayout'
|
|
21
21
|
|
|
22
22
|
// Root is a fragment (field div + a sibling Teleport for the dropdown panel), so Vue can't
|
|
23
23
|
// auto-apply a consumer's class/attrs to either one — forward them onto the field div below.
|
|
@@ -309,14 +309,14 @@ const displayValue = computed(() => {
|
|
|
309
309
|
})
|
|
310
310
|
|
|
311
311
|
// The text and the label stop before the clear button and the arrow
|
|
312
|
-
const rightInset = computed<
|
|
312
|
+
const rightInset = computed<FieldEndInset>(() => (props.clearable ? 'end-16' : 'end-10'))
|
|
313
313
|
|
|
314
314
|
const triggerClasses = computed(() => {
|
|
315
|
-
const pl = props.leadingIcon ? '
|
|
315
|
+
const pl = props.leadingIcon ? 'ps-12' : 'ps-4'
|
|
316
316
|
const base = [
|
|
317
317
|
'flex w-full min-w-0 items-center text-body-large transition-[border-color,border-width] duration-150',
|
|
318
318
|
pl,
|
|
319
|
-
|
|
319
|
+
FIELD_PADDING_END[rightInset.value],
|
|
320
320
|
]
|
|
321
321
|
|
|
322
322
|
if (props.variant === 'outlined') {
|
|
@@ -381,7 +381,7 @@ const onFocusOut = useFocusLeave(() => rootEl.value, () => {
|
|
|
381
381
|
<!-- Leading icon -->
|
|
382
382
|
<div
|
|
383
383
|
v-if="leadingIcon"
|
|
384
|
-
class="pointer-events-none absolute
|
|
384
|
+
class="pointer-events-none absolute start-3.5"
|
|
385
385
|
:class="[
|
|
386
386
|
variant === 'filled' ? 'top-4.5' : 'top-4',
|
|
387
387
|
isDisabled ? 'text-on-surface/38' : 'text-on-surface-variant',
|
|
@@ -431,14 +431,14 @@ const onFocusOut = useFocusLeave(() => rootEl.value, () => {
|
|
|
431
431
|
:aria-label="locale.clear"
|
|
432
432
|
v-if="clearable && hasValue && !isDisabled"
|
|
433
433
|
type="button"
|
|
434
|
-
class="absolute
|
|
434
|
+
class="absolute end-9 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"
|
|
435
435
|
@click.stop="emit('update:modelValue', null); closeDropdown()"
|
|
436
436
|
>
|
|
437
437
|
<MIcon name="close" :size="18" />
|
|
438
438
|
</button>
|
|
439
439
|
|
|
440
440
|
<!-- Arrow icon -->
|
|
441
|
-
<div class="pointer-events-none absolute
|
|
441
|
+
<div class="pointer-events-none absolute end-2 top-1/2 -translate-y-1/2 flex h-6 items-center">
|
|
442
442
|
<MIcon
|
|
443
443
|
name="arrow_drop_down"
|
|
444
444
|
:size="24"
|
|
@@ -17,6 +17,7 @@ import { computed, nextTick, ref, watch } from 'vue'
|
|
|
17
17
|
import MIconButton from './MIconButton.vue'
|
|
18
18
|
import MButton from './MButton.vue'
|
|
19
19
|
import { useLocale } from '../composables/useLocale'
|
|
20
|
+
import { logicalKey } from '../composables/_rtl'
|
|
20
21
|
|
|
21
22
|
const locale = useLocale()
|
|
22
23
|
|
|
@@ -285,7 +286,8 @@ function ensureVisible(k: string) {
|
|
|
285
286
|
async function onKeydown(e: KeyboardEvent, k: string) {
|
|
286
287
|
const moves: Record<string, number> = { ArrowLeft: -1, ArrowRight: 1, ArrowUp: -7, ArrowDown: 7 }
|
|
287
288
|
let next: string | null = null
|
|
288
|
-
|
|
289
|
+
const pressed = logicalKey(e, e.currentTarget as Element)
|
|
290
|
+
if (pressed in moves) next = addDays(k, moves[pressed]!)
|
|
289
291
|
else if (e.key === 'PageUp' || e.key === 'PageDown') {
|
|
290
292
|
const d = parse(k)
|
|
291
293
|
d.setMonth(d.getMonth() + (e.key === 'PageUp' ? -1 : 1))
|
|
@@ -425,10 +427,10 @@ defineExpose({ nights, total, clear })
|
|
|
425
427
|
background: color-mix(in srgb, var(--color-secondary-container) 55%, transparent);
|
|
426
428
|
}
|
|
427
429
|
.m3-availability__cell[data-state='start']::before {
|
|
428
|
-
|
|
430
|
+
inset-inline-start: 50%;
|
|
429
431
|
}
|
|
430
432
|
.m3-availability__cell[data-state='end']::before {
|
|
431
|
-
|
|
433
|
+
inset-inline-end: 50%;
|
|
432
434
|
}
|
|
433
435
|
/* A lone check-in (no check-out yet, none previewed) has no band */
|
|
434
436
|
.m3-availability__cell[data-lone]::before {
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { computed } from 'vue'
|
|
8
8
|
|
|
9
|
-
export type BadgePosition =
|
|
9
|
+
export type BadgePosition =
|
|
10
|
+
| 'top-end' | 'top-start' | 'bottom-end' | 'bottom-start'
|
|
11
|
+
| 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'
|
|
10
12
|
export type BadgeOverlap = 'inside' | 'outside' | 'edge'
|
|
11
13
|
|
|
12
14
|
const props = withDefaults(
|
|
@@ -19,7 +21,7 @@ const props = withDefaults(
|
|
|
19
21
|
color?: 'primary' | 'error' | 'secondary' | 'tertiary'
|
|
20
22
|
/** Max value before showing "N+" */
|
|
21
23
|
max?: number
|
|
22
|
-
/** Corner where the badge is placed */
|
|
24
|
+
/** Corner where the badge is placed. `start`/`end` follow the reading direction (`top-end` is the top right, or the top left in a right-to-left page); `left`/`right` don't */
|
|
23
25
|
position?: BadgePosition
|
|
24
26
|
/** How much the badge overlaps the content */
|
|
25
27
|
overlap?: BadgeOverlap
|
|
@@ -27,7 +29,7 @@ const props = withDefaults(
|
|
|
27
29
|
{
|
|
28
30
|
color: 'error',
|
|
29
31
|
max: 99,
|
|
30
|
-
position: 'top-
|
|
32
|
+
position: 'top-end',
|
|
31
33
|
overlap: 'edge',
|
|
32
34
|
},
|
|
33
35
|
)
|
|
@@ -54,7 +56,14 @@ const positionStyle = computed(() => {
|
|
|
54
56
|
}
|
|
55
57
|
const o = offsets[props.overlap]
|
|
56
58
|
|
|
59
|
+
// The logical corners move by the reading direction's sign (--m3-dir, -1 right to left)
|
|
60
|
+
const out = 'calc(50% * var(--m3-dir, 1))'
|
|
61
|
+
const back = 'calc(-50% * var(--m3-dir, 1))'
|
|
57
62
|
const map: Record<BadgePosition, Record<string, string>> = {
|
|
63
|
+
'top-end': { top: o, insetInlineEnd: o, translate: `${out} -50%` },
|
|
64
|
+
'top-start': { top: o, insetInlineStart: o, translate: `${back} -50%` },
|
|
65
|
+
'bottom-end': { bottom: o, insetInlineEnd: o, translate: `${out} 50%` },
|
|
66
|
+
'bottom-start': { bottom: o, insetInlineStart: o, translate: `${back} 50%` },
|
|
58
67
|
'top-right': { top: o, right: o, translate: '50% -50%' },
|
|
59
68
|
'top-left': { top: o, left: o, translate: '-50% -50%' },
|
|
60
69
|
'bottom-right': { bottom: o, right: o, translate: '50% 50%' },
|
package/src/components/MBar.vue
CHANGED
|
@@ -171,7 +171,7 @@ watch(() => [props.scrollBehavior, props.scrollTarget], attach)
|
|
|
171
171
|
<slot />
|
|
172
172
|
</div>
|
|
173
173
|
<!-- FAB 12dp from the top and 16dp from the end edge -->
|
|
174
|
-
<div v-if="$slots.fab" class="flex h-full shrink-0 items-start pt-2
|
|
174
|
+
<div v-if="$slots.fab" class="flex h-full shrink-0 items-start pt-2 pe-3">
|
|
175
175
|
<slot name="fab" />
|
|
176
176
|
</div>
|
|
177
177
|
</template>
|
|
@@ -152,10 +152,10 @@ const eventColor: Record<string, string> = {
|
|
|
152
152
|
<div
|
|
153
153
|
v-for="(day, i) in calendarDays"
|
|
154
154
|
:key="i"
|
|
155
|
-
class="flex min-h-[80px] cursor-pointer flex-col border-b border-
|
|
155
|
+
class="flex min-h-[80px] cursor-pointer flex-col border-b border-e border-outline-variant/50 p-1.5 transition-colors hover:bg-on-surface/3"
|
|
156
156
|
:class="[
|
|
157
157
|
!day.current ? 'bg-surface-container-lowest/50' : 'bg-surface',
|
|
158
|
-
(i + 1) % 7 === 0 ? 'border-
|
|
158
|
+
(i + 1) % 7 === 0 ? 'border-e-0' : '',
|
|
159
159
|
i >= 35 ? 'border-b-0' : '',
|
|
160
160
|
]"
|
|
161
161
|
@click="emit('dateClick', day.iso)"
|
|
@@ -180,7 +180,7 @@ const eventColor: Record<string, string> = {
|
|
|
180
180
|
v-for="ev in day.events.slice(0, 2)"
|
|
181
181
|
:key="ev.id"
|
|
182
182
|
type="button"
|
|
183
|
-
class="flex w-full cursor-pointer items-center gap-1 truncate rounded px-1 py-0.5 text-
|
|
183
|
+
class="flex w-full cursor-pointer items-center gap-1 truncate rounded px-1 py-0.5 text-start text-label-small transition-opacity hover:opacity-80"
|
|
184
184
|
:class="eventColor[ev.color ?? 'primary']"
|
|
185
185
|
@click.stop="emit('eventClick', ev)"
|
|
186
186
|
>
|
|
@@ -261,7 +261,7 @@ const step = computed(() => props.cellSize + props.gap)
|
|
|
261
261
|
<!-- Weekday names -->
|
|
262
262
|
<div
|
|
263
263
|
v-if="dayLabels"
|
|
264
|
-
class="grid shrink-0
|
|
264
|
+
class="grid shrink-0 pe-2 text-label-small"
|
|
265
265
|
:style="{ gridTemplateRows: `repeat(7, ${cellSize}px)`, rowGap: `${gap}px`, marginTop: monthLabels ? '20px' : undefined }"
|
|
266
266
|
aria-hidden="true"
|
|
267
267
|
>
|
|
@@ -310,14 +310,14 @@ const step = computed(() => props.cellSize + props.gap)
|
|
|
310
310
|
|
|
311
311
|
<!-- Legend -->
|
|
312
312
|
<div v-if="legend" class="flex items-center justify-end gap-1 text-label-small" aria-hidden="true">
|
|
313
|
-
<span class="
|
|
313
|
+
<span class="me-1">{{ t.heatmapLess }}</span>
|
|
314
314
|
<span
|
|
315
315
|
v-for="l in legendLevels"
|
|
316
316
|
:key="l"
|
|
317
317
|
class="rounded-[3px]"
|
|
318
318
|
:style="{ width: `${cellSize}px`, height: `${cellSize}px`, backgroundColor: levelColor(l) }"
|
|
319
319
|
/>
|
|
320
|
-
<span class="
|
|
320
|
+
<span class="ms-1">{{ t.heatmapMore }}</span>
|
|
321
321
|
</div>
|
|
322
322
|
|
|
323
323
|
<!-- Tooltip: M3 plain tooltip (inverse surface, extra-small corners) -->
|
|
@@ -78,10 +78,10 @@ const bubbleClasses = computed(() => {
|
|
|
78
78
|
if (isRight.value) {
|
|
79
79
|
const c = colorMap[props.color]!
|
|
80
80
|
classes.push(c.bg, c.text)
|
|
81
|
-
if (props.tail) classes.push('rounded-
|
|
81
|
+
if (props.tail) classes.push('rounded-ee-sm')
|
|
82
82
|
} else {
|
|
83
83
|
classes.push('bg-surface-container-high', 'text-on-surface')
|
|
84
|
-
if (props.tail) classes.push('rounded-
|
|
84
|
+
if (props.tail) classes.push('rounded-es-sm')
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
return classes
|
|
@@ -114,7 +114,7 @@ const typingLabel = computed(() => (props.typing === 'audio' ? t.chatRecordingAu
|
|
|
114
114
|
/>
|
|
115
115
|
|
|
116
116
|
<div class="w-fit" :style="{ maxWidth: maxWidth }">
|
|
117
|
-
<p v-if="sender && !isRight" class="text-label-small font-medium text-on-surface-variant mb-0.5
|
|
117
|
+
<p v-if="sender && !isRight" class="text-label-small font-medium text-on-surface-variant mb-0.5 ms-1">
|
|
118
118
|
{{ sender }}
|
|
119
119
|
</p>
|
|
120
120
|
|
package/src/components/MChip.vue
CHANGED
|
@@ -147,10 +147,10 @@ const leadingIconClass = computed(() => {
|
|
|
147
147
|
// avatar, 8dp next to an icon, 12dp (4 + the label's 8) otherwise
|
|
148
148
|
const typedPadding = computed(() => {
|
|
149
149
|
if (props.type === 'input') {
|
|
150
|
-
return [hasAvatar.value ? '
|
|
150
|
+
return [hasAvatar.value ? 'ps-1' : props.icon ? 'ps-2' : 'ps-3', hasTrailing.value ? 'pe-2' : 'pe-3']
|
|
151
151
|
}
|
|
152
152
|
// A filter chip's sliding check carries its own spacing (see checkEl), so its padding stays put
|
|
153
|
-
return [props.icon || slidingCheck.value ? '
|
|
153
|
+
return [props.icon || slidingCheck.value ? 'ps-2' : 'ps-4', hasTrailing.value ? 'pe-2' : 'pe-4']
|
|
154
154
|
})
|
|
155
155
|
|
|
156
156
|
const pressed = ref(false)
|
|
@@ -214,8 +214,8 @@ const interactiveClasses =
|
|
|
214
214
|
<slot name="avatar" />
|
|
215
215
|
</span>
|
|
216
216
|
<MIcon v-else-if="icon" :name="icon" :size="18" :filled="type === 'filter' && selected" class="shrink-0" :class="leadingIconClass" />
|
|
217
|
-
<!-- -
|
|
218
|
-
<span v-else-if="slidingCheck" ref="checkEl" class="-
|
|
217
|
+
<!-- -me-2 cancels the gap while the check is closed -->
|
|
218
|
+
<span v-else-if="slidingCheck" ref="checkEl" class="-me-2 flex shrink-0 overflow-hidden" style="width: 8px; opacity: 0" aria-hidden="true">
|
|
219
219
|
<MIcon name="check" :size="18" class="shrink-0" :class="leadingIconClass" />
|
|
220
220
|
</span>
|
|
221
221
|
<span class="whitespace-nowrap"><slot /></span>
|
|
@@ -224,7 +224,7 @@ const interactiveClasses =
|
|
|
224
224
|
<button
|
|
225
225
|
v-if="type === 'input' && removable"
|
|
226
226
|
type="button"
|
|
227
|
-
class="relative -
|
|
227
|
+
class="relative -ms-1 me-2 flex h-6 w-6 shrink-0 items-center justify-center rounded-full outline-none hover:bg-on-surface/8 focus-visible:ring-2 focus-visible:ring-secondary"
|
|
228
228
|
:class="disabled ? 'cursor-not-allowed' : 'cursor-pointer'"
|
|
229
229
|
:aria-label="locale.remove"
|
|
230
230
|
:disabled="disabled"
|
|
@@ -254,7 +254,7 @@ const interactiveClasses =
|
|
|
254
254
|
<button
|
|
255
255
|
v-if="removable"
|
|
256
256
|
type="button"
|
|
257
|
-
class="-
|
|
257
|
+
class="-me-1 ms-0.5 inline-flex items-center justify-center rounded-full hover:bg-on-surface/12"
|
|
258
258
|
:aria-label="locale.remove"
|
|
259
259
|
:disabled="disabled"
|
|
260
260
|
@click.stop="emit('remove')"
|
|
@@ -10,6 +10,8 @@ import { ref, watch, onMounted, onBeforeUnmount, computed } from 'vue'
|
|
|
10
10
|
import { useFieldValidation, useFocusLeave } from '../composables/_useFieldValidation'
|
|
11
11
|
import type { ValidateOn, ValidationRule } from '../composables/validation'
|
|
12
12
|
import MIcon from './MIcon.vue'
|
|
13
|
+
import { vTooltip } from '../directives/vTooltip'
|
|
14
|
+
import { useLocale } from '../composables/useLocale'
|
|
13
15
|
|
|
14
16
|
type Language = 'javascript' | 'typescript' | 'json' | 'html' | 'css' | 'python' | 'vue' | 'c' | 'cpp' | 'rust' | 'asm' | 'plain'
|
|
15
17
|
|
|
@@ -88,6 +90,7 @@ const onFocusOut = useFocusLeave(() => rootEl.value, () => {
|
|
|
88
90
|
emit('blur')
|
|
89
91
|
})
|
|
90
92
|
let cmModules: any = null
|
|
93
|
+
const t = useLocale()
|
|
91
94
|
const copied = ref(false)
|
|
92
95
|
|
|
93
96
|
async function copyCode() {
|
|
@@ -269,7 +272,7 @@ defineExpose({
|
|
|
269
272
|
</script>
|
|
270
273
|
|
|
271
274
|
<template>
|
|
272
|
-
<div
|
|
275
|
+
<div dir="ltr"
|
|
273
276
|
ref="rootEl"
|
|
274
277
|
v-bind="$attrs"
|
|
275
278
|
class="flex flex-col overflow-hidden rounded-lg border"
|
|
@@ -286,11 +289,12 @@ defineExpose({
|
|
|
286
289
|
<button
|
|
287
290
|
type="button"
|
|
288
291
|
class="flex h-7 cursor-pointer items-center gap-1.5 rounded-md px-2 text-label-medium text-on-surface-variant transition-colors hover:bg-on-surface/8"
|
|
289
|
-
|
|
292
|
+
v-tooltip="copied ? undefined : t.codeCopy"
|
|
293
|
+
:aria-label="copied ? t.codeCopied : t.codeCopy"
|
|
290
294
|
@click="copyCode"
|
|
291
295
|
>
|
|
292
296
|
<MIcon :name="copied ? 'check' : 'content_copy'" :size="16" :class="copied ? 'text-primary' : ''" />
|
|
293
|
-
<span v-if="copied" class="text-primary">
|
|
297
|
+
<span v-if="copied" class="text-primary">{{ t.codeCopied }}</span>
|
|
294
298
|
</button>
|
|
295
299
|
</div>
|
|
296
300
|
</div>
|
|
@@ -186,7 +186,7 @@ const onFocusOut = useFocusLeave(() => rootEl.value, () => {
|
|
|
186
186
|
aria-haspopup="dialog"
|
|
187
187
|
:aria-expanded="open"
|
|
188
188
|
:disabled="isDisabled"
|
|
189
|
-
class="flex h-14 w-full items-center gap-3 rounded-xs border bg-transparent px-4 text-
|
|
189
|
+
class="flex h-14 w-full items-center gap-3 rounded-xs border bg-transparent px-4 text-start text-body-large outline-none transition-[border-color,border-width] duration-150"
|
|
190
190
|
:class="[
|
|
191
191
|
isDisabled ? 'cursor-not-allowed border-on-surface/12' : 'cursor-pointer',
|
|
192
192
|
!isDisabled && (open
|
|
@@ -180,7 +180,7 @@ onBeforeUnmount(() => document.removeEventListener('keydown', onGlobalKeydown))
|
|
|
180
180
|
:key="item.id"
|
|
181
181
|
type="button"
|
|
182
182
|
:data-cmd-active="filtered.indexOf(item) === activeIndex || undefined"
|
|
183
|
-
class="flex w-full cursor-pointer items-center gap-3 px-4 py-2.5 text-
|
|
183
|
+
class="flex w-full cursor-pointer items-center gap-3 px-4 py-2.5 text-start transition-colors"
|
|
184
184
|
:class="filtered.indexOf(item) === activeIndex ? 'bg-primary/12 text-primary' : 'text-on-surface hover:bg-on-surface/4'"
|
|
185
185
|
@click="selectItem(item)"
|
|
186
186
|
@pointerenter="activeIndex = filtered.indexOf(item)"
|
|
@@ -27,7 +27,7 @@ const props = withDefaults(defineProps<{
|
|
|
27
27
|
controller?: ContainerTransformController<T>
|
|
28
28
|
/**
|
|
29
29
|
* Where the expanded view opens: over the whole screen, as a centered panel (wider screens), or `custom`: the
|
|
30
|
-
* classes you give the component place and size it (`bottom-4
|
|
30
|
+
* classes you give the component place and size it (`bottom-4 end-4 w-80 h-96`, `inset-y-0 end-0 w-96`…),
|
|
31
31
|
* anywhere over the page
|
|
32
32
|
*/
|
|
33
33
|
mode?: 'fullscreen' | 'dialog' | 'custom'
|
|
@@ -357,7 +357,7 @@ onUnmounted(() => {
|
|
|
357
357
|
<!-- Back: a header row in the menu's own item metrics, labelled like an M3 menu group, then a divider -->
|
|
358
358
|
<button
|
|
359
359
|
type="button"
|
|
360
|
-
class="flex w-full items-center gap-3 px-4 py-2.5 text-
|
|
360
|
+
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"
|
|
361
361
|
@click="popNav"
|
|
362
362
|
>
|
|
363
363
|
<MIcon name="arrow_back" :size="20" class="shrink-0" />
|
|
@@ -291,7 +291,7 @@ function isExpanded(row: Record<string, any>) { return expanded.value.has(rowId(
|
|
|
291
291
|
function extraCols() {
|
|
292
292
|
return (props.selectable ? 1 : 0) + (hasActions() ? 1 : 0) + (hasExpand() ? 1 : 0)
|
|
293
293
|
}
|
|
294
|
-
function alignClass(a?: string) { return a === 'center' ? 'text-center' : a === 'right' ? 'text-
|
|
294
|
+
function alignClass(a?: string) { return a === 'center' ? 'text-center' : a === 'right' ? 'text-end' : 'text-start' }
|
|
295
295
|
function skelWidth(ri: number, ci: number) { return `${SKEL[(ri * 3 + ci) % SKEL.length]}%` }
|
|
296
296
|
|
|
297
297
|
// Alto aproximado de una fila de datos y del thead, en px — usado sólo para calcular cuántas
|
|
@@ -427,7 +427,7 @@ function colStyle(col: DataTableColumn) {
|
|
|
427
427
|
<!-- Column toggle -->
|
|
428
428
|
<div v-if="columnToggle" class="relative">
|
|
429
429
|
<MIconButton icon="view_column" :label="columnsLabel ?? locale.columns" :size="36" @click="showColMenu = !showColMenu" />
|
|
430
|
-
<div v-if="showColMenu" class="absolute
|
|
430
|
+
<div v-if="showColMenu" class="absolute end-0 top-full z-10 mt-1 min-w-40 rounded-lg bg-surface-container py-2 shadow-elevation-3">
|
|
431
431
|
<label v-for="col in columns" :key="col.key" class="flex cursor-pointer items-center gap-2 px-3 py-1.5 hover:bg-on-surface/4">
|
|
432
432
|
<MCheckbox
|
|
433
433
|
:model-value="!hiddenCols.has(col.key)"
|
|
@@ -473,7 +473,7 @@ function colStyle(col: DataTableColumn) {
|
|
|
473
473
|
<!-- Resize handle -->
|
|
474
474
|
<div
|
|
475
475
|
v-if="col.resizable"
|
|
476
|
-
class="absolute
|
|
476
|
+
class="absolute end-0 top-0 h-full w-1 cursor-col-resize hover:bg-primary/30"
|
|
477
477
|
@pointerdown="onResizeDown($event, col)"
|
|
478
478
|
/>
|
|
479
479
|
</th>
|
|
@@ -493,7 +493,7 @@ function colStyle(col: DataTableColumn) {
|
|
|
493
493
|
<div class="h-4 animate-pulse rounded-full bg-on-surface/10" :style="{ width: skelWidth(ri, ci) }" />
|
|
494
494
|
</td>
|
|
495
495
|
<td v-if="hasActions()" :class="dense ? 'px-4 py-2' : 'px-4 py-3.5'">
|
|
496
|
-
<div class="
|
|
496
|
+
<div class="ms-auto h-4 w-16 animate-pulse rounded-full bg-on-surface/10" />
|
|
497
497
|
</td>
|
|
498
498
|
</tr>
|
|
499
499
|
</template>
|
|
@@ -550,7 +550,7 @@ function colStyle(col: DataTableColumn) {
|
|
|
550
550
|
{{ row[col.key] ?? '—' }}
|
|
551
551
|
</slot>
|
|
552
552
|
</td>
|
|
553
|
-
<td v-if="hasActions()" class="text-
|
|
553
|
+
<td v-if="hasActions()" class="text-end" :class="dense ? 'px-4 py-1' : 'px-4 py-3'" @click.stop>
|
|
554
554
|
<slot name="row-actions" :row="row" />
|
|
555
555
|
</td>
|
|
556
556
|
</tr>
|
|
@@ -15,6 +15,7 @@ import { useFieldBg } from '../composables/useFieldBg'
|
|
|
15
15
|
import { useLocale } from '../composables/useLocale'
|
|
16
16
|
import { useFollowAnchor } from '../composables/_useFollowAnchor'
|
|
17
17
|
import { POPUP_MARGIN, dropdownX, fitPopup } from '../composables/_popupPosition'
|
|
18
|
+
import { isRtl } from '../composables/_rtl'
|
|
18
19
|
import { useCalendarMonth } from '../composables/_useCalendarMonth'
|
|
19
20
|
import { OUTLINED_FLOATED_LABEL, vOverflowTitle } from '../composables/_fieldLayout'
|
|
20
21
|
|
|
@@ -163,7 +164,7 @@ function placeDrop(el: Element) {
|
|
|
163
164
|
const panel = el as HTMLElement
|
|
164
165
|
const w = panel.offsetWidth
|
|
165
166
|
const h = panel.offsetHeight
|
|
166
|
-
const left = dropdownX(anchorRect, w, window.innerWidth, 'start')
|
|
167
|
+
const left = dropdownX(anchorRect, w, window.innerWidth, 'start', undefined, isRtl())
|
|
167
168
|
const top = fitPopup([anchorRect.bottom + 4, anchorRect.top - 4 - h], h, window.innerHeight)
|
|
168
169
|
dropPos.value = { ...dropPos.value, left: `${left}px`, top: `${top}px` }
|
|
169
170
|
panel.style.left = `${left}px`
|
|
@@ -222,7 +223,7 @@ const onFocusOut = useFocusLeave(() => rootEl.value, () => {
|
|
|
222
223
|
:aria-invalid="hasError || undefined"
|
|
223
224
|
:aria-describedby="errorMessage || hint ? messageId : undefined"
|
|
224
225
|
type="button"
|
|
225
|
-
class="flex h-14 w-full items-center gap-2 rounded-xs border bg-transparent px-4 text-
|
|
226
|
+
class="flex h-14 w-full items-center gap-2 rounded-xs border bg-transparent px-4 text-start text-body-large transition-[border-color,border-width] duration-150"
|
|
226
227
|
:class="[
|
|
227
228
|
isDisabled ? 'pointer-events-none cursor-not-allowed border-on-surface/12' : 'cursor-pointer',
|
|
228
229
|
!isDisabled && (open
|
|
@@ -15,6 +15,7 @@ import { useFieldBg } from '../composables/useFieldBg'
|
|
|
15
15
|
import { useLocale } from '../composables/useLocale'
|
|
16
16
|
import { useFollowAnchor } from '../composables/_useFollowAnchor'
|
|
17
17
|
import { POPUP_MARGIN, dropdownX, fitPopup } from '../composables/_popupPosition'
|
|
18
|
+
import { isRtl } from '../composables/_rtl'
|
|
18
19
|
import { isoDate as fmt, useCalendarMonth } from '../composables/_useCalendarMonth'
|
|
19
20
|
import { OUTLINED_FLOATED_LABEL, vOverflowTitle } from '../composables/_fieldLayout'
|
|
20
21
|
|
|
@@ -199,7 +200,7 @@ function placeDrop(el: Element) {
|
|
|
199
200
|
const panel = el as HTMLElement
|
|
200
201
|
const w = panel.offsetWidth
|
|
201
202
|
const h = panel.offsetHeight
|
|
202
|
-
const left = dropdownX(anchorRect, w, window.innerWidth, 'start')
|
|
203
|
+
const left = dropdownX(anchorRect, w, window.innerWidth, 'start', undefined, isRtl())
|
|
203
204
|
const top = fitPopup([anchorRect.bottom + 4, anchorRect.top - 4 - h], h, window.innerHeight)
|
|
204
205
|
dropPos.value = { ...dropPos.value, left: `${left}px`, top: `${top}px` }
|
|
205
206
|
panel.style.left = `${left}px`
|
|
@@ -258,7 +259,7 @@ const onFocusOut = useFocusLeave(() => rootEl.value, () => {
|
|
|
258
259
|
:aria-invalid="hasError || undefined"
|
|
259
260
|
:aria-describedby="errorMessage || hint ? messageId : undefined"
|
|
260
261
|
type="button"
|
|
261
|
-
class="flex h-14 w-full items-center gap-2 rounded-xs border bg-transparent px-4 text-
|
|
262
|
+
class="flex h-14 w-full items-center gap-2 rounded-xs border bg-transparent px-4 text-start text-body-large transition-[border-color,border-width] duration-150"
|
|
262
263
|
:class="[
|
|
263
264
|
isDisabled ? 'pointer-events-none cursor-not-allowed border-on-surface/12' : 'cursor-pointer',
|
|
264
265
|
!isDisabled && (open
|
|
@@ -176,20 +176,20 @@ onUnmounted(() => {
|
|
|
176
176
|
-->
|
|
177
177
|
<div class="relative px-6 pt-6 pb-2">
|
|
178
178
|
<!--
|
|
179
|
-
Wrapped in a plain div rather than passing `absolute
|
|
179
|
+
Wrapped in a plain div rather than passing `absolute end-4 top-4` straight to
|
|
180
180
|
MIconButton: its root already carries its own `relative` (for the ripple span),
|
|
181
181
|
and Tailwind resolves conflicting position utilities by source order in the
|
|
182
182
|
compiled CSS, not by order in the class attribute — so an external `absolute`
|
|
183
183
|
can silently lose to that internal `relative` instead of overriding it.
|
|
184
184
|
-->
|
|
185
|
-
<div v-if="closable && !persistent" class="absolute
|
|
185
|
+
<div v-if="closable && !persistent" class="absolute end-4 top-4">
|
|
186
186
|
<MIconButton icon="close" :label="closeLabel ?? locale.close" @click="close" />
|
|
187
187
|
</div>
|
|
188
188
|
<!--
|
|
189
189
|
Icon slot: M3 AlertDialog's optional `icon` param (IconColor=Secondary,
|
|
190
190
|
IconSize=24dp expected from the slot content, IconPadding bottom=16dp below it),
|
|
191
191
|
which per spec also centers the title ("Align the title to the center when an
|
|
192
|
-
icon is present") — reserving `
|
|
192
|
+
icon is present") — reserving `pe-10` on the title only when the close button is
|
|
193
193
|
also showing, so a centered title doesn't collide with it.
|
|
194
194
|
-->
|
|
195
195
|
<div v-if="$slots.icon" class="mb-4 flex justify-center text-secondary">
|
|
@@ -199,8 +199,8 @@ onUnmounted(() => {
|
|
|
199
199
|
:id="titleId"
|
|
200
200
|
class="text-headline-small text-on-surface"
|
|
201
201
|
:class="[
|
|
202
|
-
$slots.icon ? 'text-center' : 'text-
|
|
203
|
-
closable && !persistent ? ($slots.icon ? 'px-10' : '
|
|
202
|
+
$slots.icon ? 'text-center' : 'text-start',
|
|
203
|
+
closable && !persistent ? ($slots.icon ? 'px-10' : 'pe-10') : '',
|
|
204
204
|
]"
|
|
205
205
|
>
|
|
206
206
|
<slot name="title">{{ title }}</slot>
|
|
@@ -145,7 +145,7 @@ const modeOptions = computed(() => [
|
|
|
145
145
|
</script>
|
|
146
146
|
|
|
147
147
|
<template>
|
|
148
|
-
<div ref="root" class="m3-diff overflow-hidden rounded-md border border-outline-variant bg-surface text-on-surface">
|
|
148
|
+
<div ref="root" dir="ltr" class="m3-diff overflow-hidden rounded-md border border-outline-variant bg-surface text-on-surface">
|
|
149
149
|
<!-- Header: names, counts, the toggle -->
|
|
150
150
|
<div class="flex flex-wrap items-center gap-x-4 gap-y-2 border-b border-outline-variant bg-surface-container-low px-4 py-2">
|
|
151
151
|
<div class="flex min-w-0 flex-1 items-center gap-2 text-label-large">
|
|
@@ -523,7 +523,7 @@ onBeforeUnmount(() => {
|
|
|
523
523
|
v-if="handle && !bare"
|
|
524
524
|
type="button"
|
|
525
525
|
data-drag-handle
|
|
526
|
-
class="relative -
|
|
526
|
+
class="relative -ms-2 flex h-10 w-10 shrink-0 touch-none items-center justify-center rounded-full text-on-surface-variant outline-none transition-colors hover:bg-on-surface/8 focus-visible:ring-2 focus-visible:ring-secondary"
|
|
527
527
|
:class="disabled ? 'cursor-default' : draggingId === item.id ? 'cursor-grabbing' : 'cursor-grab'"
|
|
528
528
|
:aria-label="t.reorderHandle"
|
|
529
529
|
:aria-pressed="grabbedId === item.id"
|
|
@@ -17,9 +17,11 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import { computed, nextTick, onBeforeUnmount, onMounted, ref, shallowRef, watch } from 'vue'
|
|
19
19
|
import MIcon from './MIcon.vue'
|
|
20
|
+
import { vTooltip } from '../directives/vTooltip'
|
|
20
21
|
import { useLocale, type M3Locale } from '../composables/useLocale'
|
|
21
22
|
import { emojiCategories, toneableEmojis, withSkinTone, type EmojiCategory } from '../data/emojis'
|
|
22
23
|
import { storageKey } from '../composables/_storageKeys'
|
|
24
|
+
import { logicalKey } from '../composables/_rtl'
|
|
23
25
|
|
|
24
26
|
const props = withDefaults(
|
|
25
27
|
defineProps<{
|
|
@@ -261,8 +263,9 @@ function onGridKeydown(e: KeyboardEvent) {
|
|
|
261
263
|
}, undefined)
|
|
262
264
|
const rowOf = (from: HTMLElement[], top: number) => from.filter((el) => Math.abs(el.getBoundingClientRect().top - top) < 2)
|
|
263
265
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
+
const key = logicalKey(e, e.currentTarget as Element)
|
|
267
|
+
if (key === 'ArrowRight') focusButton(list[i + 1])
|
|
268
|
+
else if (key === 'ArrowLeft') focusButton(list[i - 1])
|
|
266
269
|
else if (e.key === 'ArrowDown') {
|
|
267
270
|
const next = list.slice(i + 1).find((el) => el.getBoundingClientRect().top > rect.top + 2)
|
|
268
271
|
if (next) focusButton(sameColumnIn(rowOf(list.slice(i + 1), next.getBoundingClientRect().top)))
|
|
@@ -321,8 +324,9 @@ function chooseTone(i: number) {
|
|
|
321
324
|
function onToneKeydown(e: KeyboardEvent) {
|
|
322
325
|
const opts = Array.from(rootEl.value?.querySelectorAll<HTMLElement>('[data-tone-option]') ?? [])
|
|
323
326
|
const i = opts.indexOf(document.activeElement as HTMLElement)
|
|
324
|
-
|
|
325
|
-
|
|
327
|
+
const key = logicalKey(e, e.currentTarget as Element)
|
|
328
|
+
if (key === 'ArrowRight') opts[Math.min(i + 1, opts.length - 1)]?.focus()
|
|
329
|
+
else if (key === 'ArrowLeft') opts[Math.max(i - 1, 0)]?.focus()
|
|
326
330
|
else if (e.key === 'Escape') {
|
|
327
331
|
e.stopPropagation()
|
|
328
332
|
tonePicker.value = null
|
|
@@ -420,7 +424,7 @@ defineExpose({ focus: () => (searchEl.value ?? buttons()[0])?.focus() })
|
|
|
420
424
|
role="tab"
|
|
421
425
|
:aria-selected="activeSection === s.id"
|
|
422
426
|
:aria-label="s.label"
|
|
423
|
-
|
|
427
|
+
v-tooltip="s.label"
|
|
424
428
|
class="flex h-9 min-w-9 flex-1 shrink-0 cursor-pointer items-center justify-center rounded-full transition-colors duration-150"
|
|
425
429
|
:class="activeSection === s.id ? 'bg-secondary-container text-on-secondary-container' : 'text-on-surface-variant hover:bg-on-surface/8'"
|
|
426
430
|
@click="scrollToSection(s.id)"
|
|
@@ -471,7 +475,7 @@ defineExpose({ focus: () => (searchEl.value ?? buttons()[0])?.focus() })
|
|
|
471
475
|
<span
|
|
472
476
|
v-if="skinTones && s.id !== 'recent' && toneableEmojis.has(emoji)"
|
|
473
477
|
aria-hidden="true"
|
|
474
|
-
class="absolute
|
|
478
|
+
class="absolute end-1 bottom-1 h-1.5 w-1.5 bg-on-surface-variant/50 [clip-path:polygon(100%_0,100%_100%,0_100%)]"
|
|
475
479
|
/>
|
|
476
480
|
</button>
|
|
477
481
|
</div>
|
|
@@ -494,7 +498,7 @@ defineExpose({ focus: () => (searchEl.value ?? buttons()[0])?.focus() })
|
|
|
494
498
|
type="button"
|
|
495
499
|
class="flex h-10 w-10 shrink-0 cursor-pointer items-center justify-center rounded-full text-[22px] leading-none hover:bg-on-surface/8"
|
|
496
500
|
:aria-label="`${t.emojiSkinTone}: ${toneLabels[tone] ?? ''}`"
|
|
497
|
-
|
|
501
|
+
v-tooltip="t.emojiSkinTone"
|
|
498
502
|
@click="openTones(null, $event.currentTarget as HTMLElement)"
|
|
499
503
|
>
|
|
500
504
|
{{ withSkinTone('✋', tone) }}
|
|
@@ -71,7 +71,7 @@ const wrapperClass = computed(() => {
|
|
|
71
71
|
<component
|
|
72
72
|
:is="expandable ? 'button' : 'div'"
|
|
73
73
|
:type="expandable ? 'button' : undefined"
|
|
74
|
-
class="flex w-full items-center gap-4 px-5 py-4 text-
|
|
74
|
+
class="flex w-full items-center gap-4 px-5 py-4 text-start transition-colors duration-150 focus-visible:outline-none focus-visible:bg-on-surface/10"
|
|
75
75
|
:class="expandable ? [
|
|
76
76
|
disabled ? 'cursor-not-allowed opacity-[0.38]' : 'cursor-pointer hover:bg-on-surface/4',
|
|
77
77
|
isOpen ? 'bg-on-surface/4' : '',
|
package/src/components/MFab.vue
CHANGED
|
@@ -117,10 +117,10 @@ const colorMap: Record<string, string> = {
|
|
|
117
117
|
// IconLabelSpace is marked incorrect there).
|
|
118
118
|
const EXTENDED = {
|
|
119
119
|
// lead: the box's start padding (its pl-/px- class)
|
|
120
|
-
regular: { px: 56, icon: 24, lead: 16, gap: '
|
|
121
|
-
small: { px: 56, icon: 24, lead: 16, gap: '
|
|
122
|
-
medium: { px: 80, icon: 28, lead: 26, gap: '
|
|
123
|
-
large: { px: 96, icon: 32, lead: 28, gap: '
|
|
120
|
+
regular: { px: 56, icon: 24, lead: 16, gap: 'ps-3', box: 'h-14 min-w-20 rounded-2xl ps-4 pe-5', text: 'text-label-large font-medium' },
|
|
121
|
+
small: { px: 56, icon: 24, lead: 16, gap: 'ps-2', box: 'h-14 min-w-14 rounded-2xl px-4', text: 'text-title-medium font-medium' },
|
|
122
|
+
medium: { px: 80, icon: 28, lead: 26, gap: 'ps-3', box: 'h-20 min-w-20 rounded-lg-increased px-[26px]', text: 'text-title-large' },
|
|
123
|
+
large: { px: 96, icon: 32, lead: 28, gap: 'ps-4', box: 'h-24 min-w-24 rounded-xl px-7', text: 'text-headline-small' },
|
|
124
124
|
} as const
|
|
125
125
|
// In a toolbar the FAB is always the square one: its label only names it
|
|
126
126
|
const extended = computed(() => (props.label && !inToolbar ? EXTENDED[props.size] : null))
|
|
@@ -171,7 +171,7 @@ const initialButtonStyle = startCollapsed
|
|
|
171
171
|
? {
|
|
172
172
|
width: `${extended.value!.px}px`,
|
|
173
173
|
minWidth: '0',
|
|
174
|
-
...(collapsedLead(extended.value!) !== extended.value!.lead && {
|
|
174
|
+
...(collapsedLead(extended.value!) !== extended.value!.lead && { paddingInlineStart: `${collapsedLead(extended.value!)}px` }),
|
|
175
175
|
}
|
|
176
176
|
: undefined
|
|
177
177
|
const initialLabelStyle = startCollapsed ? { display: 'none', opacity: '0' } : undefined
|