@m3ui-vue/m3ui-vue 1.8.0 → 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 +34 -19
- package/dist/MButton-LiZRRP4h.js +171 -0
- package/dist/MButton-LiZRRP4h.js.map +1 -0
- package/dist/{MColorPickerModal-H8nuX0Wu.js → MColorPickerModal-IjciC8zh.js} +185 -184
- package/dist/MColorPickerModal-IjciC8zh.js.map +1 -0
- package/dist/MDialog-BLpfgIA3.js +167 -0
- package/dist/MDialog-BLpfgIA3.js.map +1 -0
- 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-B5Q9Xs9d.js +1866 -0
- package/dist/MPdfViewer-B5Q9Xs9d.js.map +1 -0
- package/dist/MProgressBar-CPrZhQbA.js +179 -0
- package/dist/MProgressBar-CPrZhQbA.js.map +1 -0
- 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-Bqr-1R9f.js +140 -0
- package/dist/MSignaturePad-Bqr-1R9f.js.map +1 -0
- 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/MPdfSigner.vue.d.ts +1 -1
- 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 +11962 -12039
- 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.d.ts +3 -0
- package/dist/pdf-sign.js +548 -0
- package/dist/pdf-sign.js.map +1 -0
- package/dist/pdf.d.ts +0 -3
- package/dist/pdf.js +1 -2400
- package/dist/plugin.d.ts +8 -0
- package/dist/rich-text-editor.js +79 -77
- 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 +5 -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/MPdfSigner.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/pdfSign.ts +2 -2
- 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/pdf-sign.ts +5 -0
- package/src/pdf.ts +0 -3
- package/src/plugin.ts +10 -0
- package/src/styles/theme.css +13 -0
- package/dist/MColorPickerModal-H8nuX0Wu.js.map +0 -1
- package/dist/MDialog-B42Mhn8W.js +0 -331
- package/dist/MDialog-B42Mhn8W.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/MSignaturePad-BTqGaPXA.js +0 -313
- package/dist/MSignaturePad-BTqGaPXA.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/pdf.js.map +0 -1
- package/dist/useLocale-DL96OFgr.js.map +0 -1
|
@@ -10,6 +10,7 @@ import { ref, watch, onMounted, onBeforeUnmount, shallowRef, computed } from 'vu
|
|
|
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'
|
|
13
14
|
import MMenu from './MMenu.vue'
|
|
14
15
|
import MMenuItem from './MMenuItem.vue'
|
|
15
16
|
import MDialog from './MDialog.vue'
|
|
@@ -303,7 +304,7 @@ defineExpose({
|
|
|
303
304
|
<!-- Toolbar -->
|
|
304
305
|
<div v-if="ready" class="flex shrink-0 flex-wrap items-center gap-0.5 border-b border-outline-variant bg-surface-container px-2 py-1.5">
|
|
305
306
|
<!-- Heading menu -->
|
|
306
|
-
<MMenu align="
|
|
307
|
+
<MMenu align="start">
|
|
307
308
|
<template #trigger>
|
|
308
309
|
<button
|
|
309
310
|
type="button"
|
|
@@ -326,7 +327,8 @@ defineExpose({
|
|
|
326
327
|
v-for="btn in group"
|
|
327
328
|
:key="btn.icon"
|
|
328
329
|
type="button"
|
|
329
|
-
|
|
330
|
+
v-tooltip="btn.label"
|
|
331
|
+
:aria-label="btn.label"
|
|
330
332
|
class="flex h-8 w-8 cursor-pointer items-center justify-center rounded transition-colors duration-100"
|
|
331
333
|
:class="btn.active?.() ? 'bg-secondary-container text-on-secondary-container' : 'text-on-surface-variant hover:bg-on-surface/8'"
|
|
332
334
|
@click="btn.action"
|
|
@@ -340,7 +342,8 @@ defineExpose({
|
|
|
340
342
|
|
|
341
343
|
<button
|
|
342
344
|
type="button"
|
|
343
|
-
|
|
345
|
+
v-tooltip="l.link"
|
|
346
|
+
:aria-label="l.link"
|
|
344
347
|
class="flex h-8 w-8 cursor-pointer items-center justify-center rounded text-on-surface-variant transition-colors hover:bg-on-surface/8"
|
|
345
348
|
@click="openLinkDialog"
|
|
346
349
|
>
|
|
@@ -348,7 +351,8 @@ defineExpose({
|
|
|
348
351
|
</button>
|
|
349
352
|
<button
|
|
350
353
|
type="button"
|
|
351
|
-
|
|
354
|
+
v-tooltip="l.image"
|
|
355
|
+
:aria-label="l.image"
|
|
352
356
|
class="flex h-8 w-8 cursor-pointer items-center justify-center rounded text-on-surface-variant transition-colors hover:bg-on-surface/8"
|
|
353
357
|
@click="openImageDialog"
|
|
354
358
|
>
|
|
@@ -293,7 +293,7 @@ const eventColors: Record<string, string> = {
|
|
|
293
293
|
<MIconButton icon="chevron_right" :label="nextLabel ?? locale.next" :size="36" @click="navigate(1)" />
|
|
294
294
|
<button
|
|
295
295
|
type="button"
|
|
296
|
-
class="
|
|
296
|
+
class="ms-2 cursor-pointer rounded-full border border-outline px-3 py-1 text-label-medium text-on-surface transition-colors hover:bg-on-surface/8"
|
|
297
297
|
@click="setDate(new Date())"
|
|
298
298
|
>
|
|
299
299
|
{{ todayLabel ?? locale.today }}
|
|
@@ -320,12 +320,12 @@ const eventColors: Record<string, string> = {
|
|
|
320
320
|
<div class="min-w-fit">
|
|
321
321
|
<!-- Day headers -->
|
|
322
322
|
<div class="sticky top-0 z-20 grid border-b border-outline-variant bg-surface-container" :style="gridStyle">
|
|
323
|
-
<div class="border-
|
|
323
|
+
<div class="border-e border-outline-variant" />
|
|
324
324
|
<button
|
|
325
325
|
v-for="day in visibleDays"
|
|
326
326
|
:key="fmt(day)"
|
|
327
327
|
type="button"
|
|
328
|
-
class="border-
|
|
328
|
+
class="border-e border-outline-variant px-2 py-2 text-center last:border-e-0"
|
|
329
329
|
:class="[fmt(day) === todayKey ? 'bg-primary-container/30' : '', currentView === 'week' ? 'cursor-pointer hover:bg-on-surface/8' : 'cursor-default']"
|
|
330
330
|
:tabindex="currentView === 'week' ? 0 : -1"
|
|
331
331
|
@click="openDay(day)"
|
|
@@ -342,7 +342,7 @@ const eventColors: Record<string, string> = {
|
|
|
342
342
|
|
|
343
343
|
<!-- All-day row: all-day events and events spanning several days -->
|
|
344
344
|
<div v-if="laneCount" class="grid border-b border-outline-variant" :style="gridStyle" data-scheduler-all-day>
|
|
345
|
-
<div class="flex items-start justify-end border-
|
|
345
|
+
<div class="flex items-start justify-end border-e border-outline-variant px-2 py-1.5 text-end text-label-small text-on-surface-variant">
|
|
346
346
|
{{ allDayLabel ?? locale.allDay }}
|
|
347
347
|
</div>
|
|
348
348
|
<div
|
|
@@ -353,17 +353,17 @@ const eventColors: Record<string, string> = {
|
|
|
353
353
|
v-for="bar in bars"
|
|
354
354
|
:key="bar.event.id"
|
|
355
355
|
type="button"
|
|
356
|
-
class="mx-0.5 flex min-w-0 cursor-pointer items-center overflow-hidden border-
|
|
357
|
-
:class="[eventColors[bar.event.color ?? 'primary'], bar.clippedStart ? 'rounded-
|
|
356
|
+
class="mx-0.5 flex min-w-0 cursor-pointer items-center overflow-hidden border-s-[3px] px-2 text-start text-label-small font-medium transition-opacity hover:opacity-90"
|
|
357
|
+
:class="[eventColors[bar.event.color ?? 'primary'], bar.clippedStart ? 'rounded-e border-s-0' : 'rounded', bar.clippedEnd ? 'rounded-e-none' : '']"
|
|
358
358
|
:style="{ gridColumn: `${bar.from + 1} / ${bar.to + 2}`, gridRow: bar.lane + 1 }"
|
|
359
359
|
:aria-label="bar.event.title"
|
|
360
360
|
data-scheduler-bar
|
|
361
361
|
@click="emit('eventClick', bar.event)"
|
|
362
362
|
>
|
|
363
363
|
<slot name="event" :event="bar.event" :all-day="true">
|
|
364
|
-
<span v-if="bar.clippedStart" aria-hidden="true" class="
|
|
364
|
+
<span v-if="bar.clippedStart" aria-hidden="true" class="me-1">‹</span>
|
|
365
365
|
<span class="truncate">{{ bar.event.title }}</span>
|
|
366
|
-
<span v-if="bar.clippedEnd" aria-hidden="true" class="
|
|
366
|
+
<span v-if="bar.clippedEnd" aria-hidden="true" class="ms-auto ps-1">›</span>
|
|
367
367
|
</slot>
|
|
368
368
|
</button>
|
|
369
369
|
</div>
|
|
@@ -371,8 +371,8 @@ const eventColors: Record<string, string> = {
|
|
|
371
371
|
|
|
372
372
|
<!-- Time grid -->
|
|
373
373
|
<div class="grid" :style="gridStyle">
|
|
374
|
-
<div class="border-
|
|
375
|
-
<div v-for="hour in hours" :key="hour" class="relative
|
|
374
|
+
<div class="border-e border-outline-variant">
|
|
375
|
+
<div v-for="hour in hours" :key="hour" class="relative pe-2 text-end" :style="{ height: `${hourHeight}px` }">
|
|
376
376
|
<span v-if="hour !== startHour" class="relative -top-2 text-label-small text-on-surface-variant">{{ String(hour).padStart(2, '0') }}:00</span>
|
|
377
377
|
</div>
|
|
378
378
|
</div>
|
|
@@ -380,7 +380,7 @@ const eventColors: Record<string, string> = {
|
|
|
380
380
|
<div
|
|
381
381
|
v-for="day in visibleDays"
|
|
382
382
|
:key="fmt(day)"
|
|
383
|
-
class="relative cursor-pointer border-
|
|
383
|
+
class="relative cursor-pointer border-e border-outline-variant/50 last:border-e-0"
|
|
384
384
|
:class="fmt(day) === todayKey ? 'bg-primary-container/5' : ''"
|
|
385
385
|
:data-scheduler-day="fmt(day)"
|
|
386
386
|
@click="onColumnClick($event, day)"
|
|
@@ -391,12 +391,12 @@ const eventColors: Record<string, string> = {
|
|
|
391
391
|
v-for="b in blocksFor(day)"
|
|
392
392
|
:key="b.event.id"
|
|
393
393
|
type="button"
|
|
394
|
-
class="absolute z-5 cursor-pointer overflow-hidden rounded border-
|
|
394
|
+
class="absolute z-5 cursor-pointer overflow-hidden rounded border-s-[3px] px-2 py-1 text-start transition-opacity hover:opacity-90"
|
|
395
395
|
:class="eventColors[b.event.color ?? 'primary']"
|
|
396
396
|
:style="{
|
|
397
397
|
top: `${b.top + 1}px`,
|
|
398
398
|
height: `${b.height - 2}px`,
|
|
399
|
-
|
|
399
|
+
insetInlineStart: `calc(${(b.column / b.columns) * 100}% + 2px)`,
|
|
400
400
|
width: `calc(${100 / b.columns}% - 4px)`,
|
|
401
401
|
}"
|
|
402
402
|
:aria-label="`${b.event.title}, ${timeLabel(b.event)}`"
|
|
@@ -415,7 +415,7 @@ const eventColors: Record<string, string> = {
|
|
|
415
415
|
:style="{ top: `${nowTop}px` }"
|
|
416
416
|
data-scheduler-now
|
|
417
417
|
>
|
|
418
|
-
<span class="absolute -top-1 -
|
|
418
|
+
<span class="absolute -top-1 -start-1 h-2.5 w-2.5 rounded-full bg-error" />
|
|
419
419
|
</div>
|
|
420
420
|
</div>
|
|
421
421
|
</div>
|
|
@@ -115,7 +115,7 @@ defineExpose({
|
|
|
115
115
|
<button
|
|
116
116
|
v-if="clearable && modelValue && !disabled"
|
|
117
117
|
type="button"
|
|
118
|
-
class="-
|
|
118
|
+
class="-me-1 flex shrink-0 cursor-pointer rounded-full p-1 text-on-surface-variant hover:bg-on-surface/8"
|
|
119
119
|
:aria-label="locale.clearSearch"
|
|
120
120
|
@click="clear"
|
|
121
121
|
>
|
|
@@ -46,6 +46,7 @@ export type SeatState = 'available' | 'selected' | 'occupied' | 'blocked'
|
|
|
46
46
|
*/
|
|
47
47
|
import { computed, nextTick, ref } from 'vue'
|
|
48
48
|
import MIcon from './MIcon.vue'
|
|
49
|
+
import { vTooltip } from '../directives/vTooltip'
|
|
49
50
|
import { useLocale } from '../composables/useLocale'
|
|
50
51
|
|
|
51
52
|
const locale = useLocale()
|
|
@@ -332,7 +333,7 @@ const gap = computed(() => Math.max(3, Math.round(props.seatSize / 8)))
|
|
|
332
333
|
:disabled="!pickable(seat)"
|
|
333
334
|
:aria-pressed="stateOf(seat) === 'selected'"
|
|
334
335
|
:aria-label="seatLabel(seat)"
|
|
335
|
-
|
|
336
|
+
v-tooltip="seatLabel(seat)"
|
|
336
337
|
:data-seat="seat.id"
|
|
337
338
|
@click="toggle(seat)"
|
|
338
339
|
@keydown="onKeydown(seat, $event)"
|
|
@@ -115,7 +115,7 @@ function toggle(opt: SegmentedOption<V>, modelValue: M, multi: boolean) {
|
|
|
115
115
|
class="relative inline-flex grow items-center justify-center gap-2 text-label-large font-medium transition-[background-color,color] duration-150 outline-none before:pointer-events-none before:absolute before:inset-0 before:bg-current before:opacity-0 before:transition-opacity before:duration-150 enabled:hover:before:opacity-[0.08] enabled:active:before:opacity-[0.12]"
|
|
116
116
|
:class="[
|
|
117
117
|
density === 'compact' ? 'h-8 px-3' : density === 'comfortable' ? 'h-10 px-4' : 'h-10 px-6',
|
|
118
|
-
i > 0 ? (opt.disabled ? 'border-
|
|
118
|
+
i > 0 ? (opt.disabled ? 'border-s border-outline/12' : 'border-s border-outline') : '',
|
|
119
119
|
opt.disabled ? 'cursor-not-allowed' : 'cursor-pointer',
|
|
120
120
|
isSelected(opt.value, modelValue) && (
|
|
121
121
|
color === 'secondary' ? 'bg-secondary-container'
|
|
@@ -14,7 +14,7 @@ import { useLocale } from '../composables/useLocale'
|
|
|
14
14
|
import { useFollowAnchor } from '../composables/_useFollowAnchor'
|
|
15
15
|
import { useScrollLock } from '../composables/_useScrollLock'
|
|
16
16
|
import { useEscapeStack } from '../composables/_useEscapeStack'
|
|
17
|
-
import {
|
|
17
|
+
import { FIELD_PADDING_END, FIELD_VALUE, fieldLabelClasses, vOverflowTitle, type FieldEndInset } from '../composables/_fieldLayout'
|
|
18
18
|
|
|
19
19
|
export interface SelectOption {
|
|
20
20
|
label: string
|
|
@@ -209,15 +209,15 @@ onUnmounted(() => {
|
|
|
209
209
|
})
|
|
210
210
|
|
|
211
211
|
// The value and the label stop before the clear button and the arrow
|
|
212
|
-
const rightInset = computed<
|
|
212
|
+
const rightInset = computed<FieldEndInset>(() => (props.clearable ? 'end-16' : 'end-10'))
|
|
213
213
|
|
|
214
214
|
const triggerClasses = computed(() => {
|
|
215
|
-
const pl = props.leadingIcon ? '
|
|
215
|
+
const pl = props.leadingIcon ? 'ps-12' : 'ps-4'
|
|
216
216
|
const base = [
|
|
217
217
|
'flex w-full min-w-0 items-center text-body-large outline-none transition-[border-color,border-width] duration-150',
|
|
218
218
|
isDisabled.value ? 'cursor-not-allowed' : 'cursor-pointer',
|
|
219
219
|
pl,
|
|
220
|
-
|
|
220
|
+
FIELD_PADDING_END[rightInset.value],
|
|
221
221
|
]
|
|
222
222
|
|
|
223
223
|
if (props.variant === 'outlined') {
|
|
@@ -281,7 +281,7 @@ const onFocusOut = useFocusLeave(() => rootEl.value, () => {
|
|
|
281
281
|
<!-- Leading icon -->
|
|
282
282
|
<div
|
|
283
283
|
v-if="leadingIcon"
|
|
284
|
-
class="pointer-events-none absolute
|
|
284
|
+
class="pointer-events-none absolute start-3.5"
|
|
285
285
|
:class="[
|
|
286
286
|
variant === 'filled' ? 'top-4.5' : 'top-4',
|
|
287
287
|
isDisabled ? 'text-on-surface/38' : 'text-on-surface-variant',
|
|
@@ -323,14 +323,14 @@ const onFocusOut = useFocusLeave(() => rootEl.value, () => {
|
|
|
323
323
|
:aria-label="locale.clear"
|
|
324
324
|
v-if="clearable && hasValue && !isDisabled"
|
|
325
325
|
type="button"
|
|
326
|
-
class="absolute
|
|
326
|
+
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"
|
|
327
327
|
@click.stop="emit('update:modelValue', null); open = false"
|
|
328
328
|
>
|
|
329
329
|
<MIcon name="close" :size="18" />
|
|
330
330
|
</button>
|
|
331
331
|
|
|
332
332
|
<!-- Arrow icon -->
|
|
333
|
-
<div class="pointer-events-none absolute
|
|
333
|
+
<div class="pointer-events-none absolute end-2 top-1/2 -translate-y-1/2 flex h-6 items-center">
|
|
334
334
|
<MIcon
|
|
335
335
|
name="arrow_drop_down"
|
|
336
336
|
:size="24"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
/**
|
|
3
|
-
* A panel that slides in from the
|
|
3
|
+
* A panel that slides in from the end edge of the screen (the right, or the left in a right-to-left page).
|
|
4
|
+
* Supports drag-to-dismiss from its inner edge, or
|
|
4
5
|
* tapping the scrim.
|
|
5
6
|
*
|
|
6
7
|
* @slot header Replaces the default title text entirely — the close button stays
|
|
@@ -48,7 +49,7 @@ const motion = useSheetMotion('x', close)
|
|
|
48
49
|
>
|
|
49
50
|
<!-- Drag edge -->
|
|
50
51
|
<div
|
|
51
|
-
class="absolute top-0
|
|
52
|
+
class="absolute top-0 start-0 h-full w-3 cursor-ew-resize touch-none"
|
|
52
53
|
@pointerdown="motion.onDragStart"
|
|
53
54
|
@pointermove="motion.onDragMove"
|
|
54
55
|
@pointerup="motion.onDragEnd"
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
import { ref, computed, onMounted, onBeforeUnmount, watch, nextTick } from 'vue'
|
|
11
11
|
import MIcon from './MIcon.vue'
|
|
12
12
|
import { useLocale } from '../composables/useLocale'
|
|
13
|
+
import { isRtl, logicalKey } from '../composables/_rtl'
|
|
13
14
|
|
|
14
15
|
export interface SimpleCarouselItem {
|
|
15
16
|
src: string
|
|
@@ -78,7 +79,8 @@ const activePage = computed(() => {
|
|
|
78
79
|
const track = trackEl.value
|
|
79
80
|
if (track.scrollWidth <= track.clientWidth) return 0
|
|
80
81
|
const _ = scrollPos.value
|
|
81
|
-
|
|
82
|
+
// scrollLeft runs negative right to left
|
|
83
|
+
return Math.round(Math.abs(track.scrollLeft) / track.clientWidth)
|
|
82
84
|
})
|
|
83
85
|
const itemTransforms = ref<string[]>([])
|
|
84
86
|
const imageTransforms = ref<string[]>([])
|
|
@@ -90,6 +92,9 @@ function setItemRef(el: any, i: number) {
|
|
|
90
92
|
if (el) itemEls.value[i] = el as HTMLElement
|
|
91
93
|
}
|
|
92
94
|
|
|
95
|
+
// 1, or -1 when the track lays out right to left
|
|
96
|
+
const dirSign = () => (isRtl(trackEl.value) ? -1 : 1)
|
|
97
|
+
|
|
93
98
|
// ── Scroll handling (only transforms, never layout) ────────────
|
|
94
99
|
function onScroll() {
|
|
95
100
|
if (rafId) return
|
|
@@ -113,7 +118,9 @@ function updateTransforms() {
|
|
|
113
118
|
let closest = 0
|
|
114
119
|
let closestDist = Infinity
|
|
115
120
|
|
|
116
|
-
|
|
121
|
+
// Right to left, multi-browse items line up from the track's right edge
|
|
122
|
+
const rtl = dirSign() < 0
|
|
123
|
+
const refX = props.layout === 'multi-browse' ? (rtl ? trackRect.right : trackRect.left) : centerX
|
|
117
124
|
|
|
118
125
|
for (let i = 0; i < itemEls.value.length; i++) {
|
|
119
126
|
const el = itemEls.value[i]
|
|
@@ -121,7 +128,7 @@ function updateTransforms() {
|
|
|
121
128
|
const rect = el.getBoundingClientRect()
|
|
122
129
|
const itemCenterX = rect.left + rect.width / 2
|
|
123
130
|
const dist = props.layout === 'multi-browse'
|
|
124
|
-
? Math.abs(rect.left - refX)
|
|
131
|
+
? Math.abs((rtl ? rect.right : rect.left) - refX)
|
|
125
132
|
: Math.abs(itemCenterX - centerX)
|
|
126
133
|
const norm = Math.min(dist / (trackW * 0.5), 1)
|
|
127
134
|
|
|
@@ -191,19 +198,20 @@ function scrollToItem(index: number) {
|
|
|
191
198
|
if (!el || !trackEl.value) return
|
|
192
199
|
const track = trackEl.value
|
|
193
200
|
const scrollLeft = el.offsetLeft - (track.clientWidth - el.offsetWidth) / 2
|
|
194
|
-
|
|
201
|
+
// Right to left, scrollLeft is 0 at the right end and negative toward the left
|
|
202
|
+
track.scrollTo({ left: dirSign() < 0 ? scrollLeft - (track.scrollWidth - track.clientWidth) : scrollLeft, behavior: 'smooth' })
|
|
195
203
|
}
|
|
196
204
|
|
|
197
205
|
function scrollToPage(page: number) {
|
|
198
206
|
if (!trackEl.value) return
|
|
199
207
|
const track = trackEl.value
|
|
200
|
-
track.scrollTo({ left: page * track.clientWidth, behavior: 'smooth' })
|
|
208
|
+
track.scrollTo({ left: page * track.clientWidth * dirSign(), behavior: 'smooth' })
|
|
201
209
|
}
|
|
202
210
|
|
|
203
211
|
function next() {
|
|
204
212
|
if (isPageBased.value) {
|
|
205
213
|
if (!trackEl.value) return
|
|
206
|
-
trackEl.value.scrollBy({ left: trackEl.value.clientWidth, behavior: 'smooth' })
|
|
214
|
+
trackEl.value.scrollBy({ left: trackEl.value.clientWidth * dirSign(), behavior: 'smooth' })
|
|
207
215
|
} else {
|
|
208
216
|
const i = activeIndex.value < props.items.length - 1 ? activeIndex.value + 1 : 0
|
|
209
217
|
scrollToItem(i)
|
|
@@ -213,7 +221,7 @@ function next() {
|
|
|
213
221
|
function prev() {
|
|
214
222
|
if (isPageBased.value) {
|
|
215
223
|
if (!trackEl.value) return
|
|
216
|
-
trackEl.value.scrollBy({ left: -trackEl.value.clientWidth, behavior: 'smooth' })
|
|
224
|
+
trackEl.value.scrollBy({ left: -trackEl.value.clientWidth * dirSign(), behavior: 'smooth' })
|
|
217
225
|
} else {
|
|
218
226
|
const i = activeIndex.value > 0 ? activeIndex.value - 1 : props.items.length - 1
|
|
219
227
|
scrollToItem(i)
|
|
@@ -232,8 +240,9 @@ function stopAutoplay() {
|
|
|
232
240
|
}
|
|
233
241
|
|
|
234
242
|
function onKeydown(e: KeyboardEvent) {
|
|
235
|
-
|
|
236
|
-
|
|
243
|
+
const key = logicalKey(e, e.currentTarget as Element)
|
|
244
|
+
if (key === 'ArrowRight') next()
|
|
245
|
+
else if (key === 'ArrowLeft') prev()
|
|
237
246
|
}
|
|
238
247
|
|
|
239
248
|
const trackPadding = computed(() => {
|
|
@@ -306,7 +315,7 @@ defineExpose({
|
|
|
306
315
|
<button
|
|
307
316
|
:aria-label="locale.previous"
|
|
308
317
|
type="button"
|
|
309
|
-
class="absolute
|
|
318
|
+
class="absolute start-3 top-1/2 z-10 flex h-10 w-10 -translate-y-1/2 cursor-pointer items-center justify-center rounded-full bg-surface/80 text-on-surface shadow-elevation-1 opacity-0 backdrop-blur-sm transition-all duration-200 hover:bg-surface hover:shadow-elevation-2 group-hover:opacity-100"
|
|
310
319
|
@click="prev"
|
|
311
320
|
>
|
|
312
321
|
<MIcon name="chevron_left" :size="24" />
|
|
@@ -314,7 +323,7 @@ defineExpose({
|
|
|
314
323
|
<button
|
|
315
324
|
:aria-label="locale.next"
|
|
316
325
|
type="button"
|
|
317
|
-
class="absolute
|
|
326
|
+
class="absolute end-3 top-1/2 z-10 flex h-10 w-10 -translate-y-1/2 cursor-pointer items-center justify-center rounded-full bg-surface/80 text-on-surface shadow-elevation-1 opacity-0 backdrop-blur-sm transition-all duration-200 hover:bg-surface hover:shadow-elevation-2 group-hover:opacity-100"
|
|
318
327
|
@click="next"
|
|
319
328
|
>
|
|
320
329
|
<MIcon name="chevron_right" :size="24" />
|
|
@@ -11,6 +11,7 @@ import { computed, onBeforeUnmount, onMounted, ref } from 'vue'
|
|
|
11
11
|
import { useFieldValidation, useFocusLeave } from '../composables/_useFieldValidation'
|
|
12
12
|
import type { ValidateOn, ValidationRule } from '../composables/validation'
|
|
13
13
|
import MIcon from './MIcon.vue'
|
|
14
|
+
import { isRtl } from '../composables/_rtl'
|
|
14
15
|
import { useLocale } from '../composables/useLocale'
|
|
15
16
|
|
|
16
17
|
const props = withDefaults(
|
|
@@ -285,7 +286,9 @@ function ratioFromEvent(e: PointerEvent) {
|
|
|
285
286
|
if (!trackEl.value) return 0
|
|
286
287
|
const rect = trackEl.value.getBoundingClientRect()
|
|
287
288
|
if (isVertical.value) return 1 - Math.max(0, Math.min(1, (e.clientY - rect.top) / rect.height))
|
|
288
|
-
|
|
289
|
+
// Right to left, the horizontal track is drawn mirrored (m3-rtl:-scale-x-100), so its minimum is at the right
|
|
290
|
+
const x = isRtl(trackEl.value) ? rect.right - e.clientX : e.clientX - rect.left
|
|
291
|
+
return Math.max(0, Math.min(1, x / rect.width))
|
|
289
292
|
}
|
|
290
293
|
|
|
291
294
|
function valueFromEvent(e: PointerEvent) {
|
|
@@ -359,9 +362,16 @@ function onPointerUp() {
|
|
|
359
362
|
|
|
360
363
|
const KEY_DELTA: Record<string, number> = { ArrowRight: 1, ArrowUp: 1, ArrowLeft: -1, ArrowDown: -1 }
|
|
361
364
|
|
|
365
|
+
/** Step for a key: left and right swap on a mirrored (right-to-left) horizontal track, as in Compose's Slider */
|
|
366
|
+
function keyDelta(e: KeyboardEvent): number | undefined {
|
|
367
|
+
const d = KEY_DELTA[e.key]
|
|
368
|
+
if (d === undefined) return undefined
|
|
369
|
+
return (e.key === 'ArrowLeft' || e.key === 'ArrowRight') && !isVertical.value && isRtl(trackEl.value) ? -d : d
|
|
370
|
+
}
|
|
371
|
+
|
|
362
372
|
function onKeyDown(e: KeyboardEvent) {
|
|
363
373
|
if (isDisabled.value) return
|
|
364
|
-
const delta =
|
|
374
|
+
const delta = keyDelta(e)
|
|
365
375
|
if (delta !== undefined) {
|
|
366
376
|
e.preventDefault()
|
|
367
377
|
emit('update:modelValue', clamp((props.modelValue as number) + delta * props.step))
|
|
@@ -375,7 +385,7 @@ function onThumbKeyDown(idx: 0 | 1, e: KeyboardEvent) {
|
|
|
375
385
|
if (isDisabled.value) return
|
|
376
386
|
const { lo, hi } = val.value
|
|
377
387
|
const cur = idx === 0 ? lo : hi
|
|
378
|
-
const delta =
|
|
388
|
+
const delta = keyDelta(e)
|
|
379
389
|
let next: number | undefined
|
|
380
390
|
if (delta !== undefined) next = clamp(cur + delta * props.step)
|
|
381
391
|
else if (e.key === 'Home') next = idx === 0 ? props.min : lo
|
|
@@ -621,7 +631,7 @@ defineExpose({
|
|
|
621
631
|
:aria-describedby="errorMessage ? messageId : undefined"
|
|
622
632
|
:aria-orientation="isRange ? undefined : orientation"
|
|
623
633
|
class="group relative touch-none cursor-pointer outline-none"
|
|
624
|
-
:class="isDisabled && 'cursor-not-allowed'"
|
|
634
|
+
:class="[isDisabled && 'cursor-not-allowed', !isVertical && 'm3-rtl:-scale-x-100']"
|
|
625
635
|
:style="isVertical
|
|
626
636
|
? { width: `${s.hitArea}px`, minHeight: '160px', height: '100%' }
|
|
627
637
|
: { height: `${s.hitArea}px`, width: '100%' }
|
|
@@ -816,7 +826,7 @@ defineExpose({
|
|
|
816
826
|
class="pointer-events-none absolute z-10 flex h-7 min-w-7 items-center justify-center rounded-full bg-inverse-surface px-2 text-label-small tabular-nums text-inverse-on-surface"
|
|
817
827
|
:style="tooltipPos(tooltipPct)"
|
|
818
828
|
>
|
|
819
|
-
{{ tooltipValue }}
|
|
829
|
+
<span class="inline-block" :class="!isVertical && 'm3-rtl:-scale-x-100'">{{ tooltipValue }}</span>
|
|
820
830
|
</div>
|
|
821
831
|
</Transition>
|
|
822
832
|
</div>
|
|
@@ -99,7 +99,7 @@ const getVariantStyle = (variant: string): VariantStyle =>
|
|
|
99
99
|
<Transition name="m3-badge">
|
|
100
100
|
<span
|
|
101
101
|
v-if="t.count >= 2"
|
|
102
|
-
class="toast-count-badge absolute -top-1.5 -
|
|
102
|
+
class="toast-count-badge absolute -top-1.5 -end-1.5 z-10 flex h-5 min-w-5 items-center justify-center rounded-full bg-primary px-1 text-[10px] font-semibold leading-none text-on-primary shadow-elevation-1"
|
|
103
103
|
>
|
|
104
104
|
<Transition name="m3-count" mode="out-in">
|
|
105
105
|
<span :key="t.count">{{ t.count }}</span>
|
|
@@ -153,7 +153,7 @@ const getVariantStyle = (variant: string): VariantStyle =>
|
|
|
153
153
|
<!-- Countdown progress bar -->
|
|
154
154
|
<div
|
|
155
155
|
v-if="t.duration > 0"
|
|
156
|
-
class="absolute
|
|
156
|
+
class="absolute end-0 bottom-0 start-0 h-0.5 origin-left m3-rtl:origin-right"
|
|
157
157
|
:class="t.color ? 'bg-white/30' : getVariantStyle(t.variant).progress"
|
|
158
158
|
:style="{ animation: `m3-toast-progress ${t.duration}ms linear forwards` }"
|
|
159
159
|
/>
|
|
@@ -10,6 +10,7 @@ import { computed, onMounted, onUnmounted, ref } from 'vue'
|
|
|
10
10
|
import MIcon from './MIcon.vue'
|
|
11
11
|
import { vRipple } from '../directives/vRipple'
|
|
12
12
|
import { POPUP_MARGIN, dropdownX, fitPopup } from '../composables/_popupPosition'
|
|
13
|
+
import { isRtl } from '../composables/_rtl'
|
|
13
14
|
import { useLocale } from '../composables/useLocale'
|
|
14
15
|
|
|
15
16
|
export interface SplitButtonItem {
|
|
@@ -140,7 +141,7 @@ function placeMenu(el: Element) {
|
|
|
140
141
|
const menu = el as HTMLElement
|
|
141
142
|
const w = menu.offsetWidth
|
|
142
143
|
const h = menu.offsetHeight
|
|
143
|
-
const left = dropdownX(anchorRect, w, window.innerWidth, 'start')
|
|
144
|
+
const left = dropdownX(anchorRect, w, window.innerWidth, 'start', undefined, isRtl())
|
|
144
145
|
const top = fitPopup([anchorRect.bottom + 4, anchorRect.top - 4 - h], h, window.innerHeight)
|
|
145
146
|
menuStyle.value = { ...menuStyle.value, left: `${left}px`, top: `${top}px` }
|
|
146
147
|
menu.style.left = `${left}px`
|
|
@@ -246,7 +247,7 @@ onUnmounted(() => {
|
|
|
246
247
|
v-for="(item, i) in items"
|
|
247
248
|
:key="i"
|
|
248
249
|
type="button"
|
|
249
|
-
class="flex w-full cursor-pointer items-center gap-3 px-4 py-2.5 text-
|
|
250
|
+
class="flex w-full cursor-pointer items-center gap-3 px-4 py-2.5 text-start text-body-medium transition-colors"
|
|
250
251
|
:class="item.disabled ? 'cursor-not-allowed opacity-[0.38] text-on-surface' : 'text-on-surface hover:bg-on-surface/8'"
|
|
251
252
|
:disabled="item.disabled"
|
|
252
253
|
@click="selectItem(item)"
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { ref, computed, onBeforeUnmount } from 'vue'
|
|
10
10
|
import MDragHandle from './MDragHandle.vue'
|
|
11
|
+
import { isRtl, logicalKey } from '../composables/_rtl'
|
|
11
12
|
|
|
12
13
|
const props = withDefaults(
|
|
13
14
|
defineProps<{
|
|
@@ -52,8 +53,10 @@ function onKeydown(e: KeyboardEvent) {
|
|
|
52
53
|
const back = isHorizontal.value ? 'ArrowLeft' : 'ArrowUp'
|
|
53
54
|
const fwd = isHorizontal.value ? 'ArrowRight' : 'ArrowDown'
|
|
54
55
|
let next: number
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
// Right to left, the first pane is on the right: ArrowLeft grows it
|
|
57
|
+
const key = logicalKey(e, containerRef.value)
|
|
58
|
+
if (key === back) next = split.value - step
|
|
59
|
+
else if (key === fwd) next = split.value + step
|
|
57
60
|
else if (e.key === 'Home') next = props.min
|
|
58
61
|
else if (e.key === 'End') next = props.max
|
|
59
62
|
else return
|
|
@@ -68,7 +71,7 @@ function onPointerMove(e: PointerEvent) {
|
|
|
68
71
|
let pct: number
|
|
69
72
|
|
|
70
73
|
if (isHorizontal.value) {
|
|
71
|
-
pct = ((e.clientX - rect.left) / rect.width) * 100
|
|
74
|
+
pct = ((isRtl(containerRef.value) ? rect.right - e.clientX : e.clientX - rect.left) / rect.width) * 100
|
|
72
75
|
} else {
|
|
73
76
|
pct = ((e.clientY - rect.top) / rect.height) * 100
|
|
74
77
|
}
|
|
@@ -212,7 +212,7 @@ onBeforeUnmount(() => {
|
|
|
212
212
|
:key="item.id"
|
|
213
213
|
type="button"
|
|
214
214
|
:data-spot-active="results.indexOf(item) === activeIndex || undefined"
|
|
215
|
-
class="flex w-full cursor-pointer items-center gap-3 px-5 py-3 text-
|
|
215
|
+
class="flex w-full cursor-pointer items-center gap-3 px-5 py-3 text-start transition-colors"
|
|
216
216
|
:class="results.indexOf(item) === activeIndex ? 'bg-primary/12' : 'hover:bg-on-surface/4'"
|
|
217
217
|
@click="selectResult(item)"
|
|
218
218
|
@pointerenter="activeIndex = results.indexOf(item)"
|
|
@@ -135,7 +135,7 @@ const thumbScale = computed(() => {
|
|
|
135
135
|
// ON → spring cubic-bezier: overshoots ~2px then settles → satisfying "click"
|
|
136
136
|
// OFF → M3 standard decelerate: clean snap back, no undershoot
|
|
137
137
|
const thumbStyle = computed(() => ({
|
|
138
|
-
transform: `translateY(-50%) translateX(${props.modelValue ? 18 : 0}px) scale(${thumbScale.value})`,
|
|
138
|
+
transform: `translateY(-50%) translateX(calc(${props.modelValue ? 18 : 0}px * var(--m3-dir, 1))) scale(${thumbScale.value})`,
|
|
139
139
|
transition: props.modelValue
|
|
140
140
|
? 'transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1), background-color 280ms ease'
|
|
141
141
|
: 'transform 240ms cubic-bezier(0.2, 0, 0, 1), background-color 240ms ease',
|
|
@@ -147,7 +147,7 @@ const thumbStyle = computed(() => ({
|
|
|
147
147
|
// have a moving part). Base offset -4px accounts for the 40px circle being 8px taller/wider
|
|
148
148
|
// than the 32px track and 24px thumb it's centered on.
|
|
149
149
|
const stateLayerStyle = computed(() => ({
|
|
150
|
-
transform: `translateX(${props.modelValue ? 18 : 0}px)`,
|
|
150
|
+
transform: `translateX(calc(${props.modelValue ? 18 : 0}px * var(--m3-dir, 1)))`,
|
|
151
151
|
transition: props.modelValue
|
|
152
152
|
? 'transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1)'
|
|
153
153
|
: 'transform 240ms cubic-bezier(0.2, 0, 0, 1)',
|
|
@@ -193,19 +193,19 @@ defineExpose({
|
|
|
193
193
|
<!-- Hover/press/focus state layer + focus ring, both tracking the thumb's position (see stateLayerStyle doc above) -->
|
|
194
194
|
<span
|
|
195
195
|
v-if="!isDisabled"
|
|
196
|
-
class="pointer-events-none absolute top-1/2 -
|
|
196
|
+
class="pointer-events-none absolute top-1/2 -start-1 h-10 w-10 -translate-y-1/2 rounded-full opacity-0 transition-opacity duration-150 group-hover:opacity-[0.08] group-active:opacity-[0.12] peer-focus-visible:opacity-[0.08]"
|
|
197
197
|
:class="modelValue ? stateLayerBg[color] : 'bg-on-surface-variant'"
|
|
198
198
|
:style="stateLayerStyle"
|
|
199
199
|
/>
|
|
200
200
|
<span
|
|
201
201
|
v-if="!isDisabled"
|
|
202
|
-
class="pointer-events-none absolute top-1/2 -
|
|
202
|
+
class="pointer-events-none absolute top-1/2 -start-1 h-10 w-10 -translate-y-1/2 rounded-full ring-0 ring-secondary transition-[box-shadow] duration-150 peer-focus-visible:ring-2"
|
|
203
203
|
:style="stateLayerStyle"
|
|
204
204
|
/>
|
|
205
205
|
|
|
206
206
|
<!-- Thumb: position + size animated via inline style (allows per-direction easing) -->
|
|
207
207
|
<span
|
|
208
|
-
class="absolute
|
|
208
|
+
class="absolute start-1 top-1/2 flex h-6 w-6 items-center justify-center rounded-full will-change-transform"
|
|
209
209
|
:class="modelValue ? [thumbClasses[color], 'shadow-sm'] : unselectedThumbClasses"
|
|
210
210
|
:style="thumbStyle"
|
|
211
211
|
>
|
|
@@ -243,7 +243,7 @@ const extraCols = computed(
|
|
|
243
243
|
)
|
|
244
244
|
|
|
245
245
|
function alignClass(align?: string) {
|
|
246
|
-
return align === 'center' ? 'text-center' : align === 'right' ? 'text-
|
|
246
|
+
return align === 'center' ? 'text-center' : align === 'right' ? 'text-end' : 'text-start'
|
|
247
247
|
}
|
|
248
248
|
function skelWidth(ri: number, ci: number) {
|
|
249
249
|
return `${SKEL[(ri * 3 + ci) % SKEL.length]}%`
|
|
@@ -373,7 +373,7 @@ const hasActions = computed(() => !!slots['row-actions'])
|
|
|
373
373
|
/>
|
|
374
374
|
</td>
|
|
375
375
|
<td v-if="hasActions" class="px-4 py-3.5">
|
|
376
|
-
<div class="
|
|
376
|
+
<div class="ms-auto h-4 w-16 animate-pulse rounded-full bg-on-surface/10" />
|
|
377
377
|
</td>
|
|
378
378
|
</tr>
|
|
379
379
|
</template>
|
|
@@ -421,7 +421,7 @@ const hasActions = computed(() => !!slots['row-actions'])
|
|
|
421
421
|
{{ row[col.key] ?? '—' }}
|
|
422
422
|
</slot>
|
|
423
423
|
</td>
|
|
424
|
-
<td v-if="hasActions" class="px-4 py-3 text-
|
|
424
|
+
<td v-if="hasActions" class="px-4 py-3 text-end" @click.stop>
|
|
425
425
|
<slot name="row-actions" :row="row" />
|
|
426
426
|
</td>
|
|
427
427
|
</tr>
|
package/src/components/MTabs.vue
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { computed, nextTick, onMounted, onUnmounted, onUpdated, ref, watch } from 'vue'
|
|
9
9
|
import MIcon from './MIcon.vue'
|
|
10
|
+
import { isRtl } from '../composables/_rtl'
|
|
10
11
|
|
|
11
12
|
interface Tab {
|
|
12
13
|
value: string | number
|
|
@@ -109,7 +110,9 @@ function scrollToTab(rect: { left: number; width: number }, smooth: boolean) {
|
|
|
109
110
|
if (!props.scrollable || !row) return
|
|
110
111
|
const max = row.scrollWidth - row.clientWidth
|
|
111
112
|
if (max <= 0) return
|
|
112
|
-
const
|
|
113
|
+
const fromLeft = Math.round(Math.min(Math.max(rect.left + rect.width / 2 - row.clientWidth / 2, 0), max))
|
|
114
|
+
// Right to left, scrollLeft runs from 0 (scrolled to the right end, where the row starts) down to -max
|
|
115
|
+
const left = isRtl(row) ? fromLeft - max : fromLeft
|
|
113
116
|
if (Math.abs(left - row.scrollLeft) < 1) return
|
|
114
117
|
const reduce = typeof window !== 'undefined' && window.matchMedia?.('(prefers-reduced-motion: reduce)').matches
|
|
115
118
|
const behavior: ScrollBehavior = smooth && !reduce ? 'smooth' : 'auto'
|