@m3ui-vue/m3ui-vue 0.8.8 → 0.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/README.md +13 -3
- package/dist/{MMenuItem-5xojJYAL.js → MTextField-B0wGv1Mx.js} +374 -364
- package/dist/MTextField-B0wGv1Mx.js.map +1 -0
- package/dist/barcode.js +9 -11
- package/dist/barcode.js.map +1 -1
- package/dist/code-editor.js +2 -2
- package/dist/code-editor.js.map +1 -1
- package/dist/components/MCarousel.vue.d.ts +55 -36
- package/dist/components/MDialog.vue.d.ts +4 -2
- package/dist/components/MEmojiSelector.vue.d.ts +21 -5
- package/dist/components/MFabMenu.vue.d.ts +1 -1
- package/dist/components/MFlex.vue.d.ts +1 -1
- package/dist/components/MLightbox.vue.d.ts +15 -5
- package/dist/components/MScheduler.vue.d.ts +38 -1
- package/dist/components/MShape.vue.d.ts +1 -1
- package/dist/components/MSimpleCarousel.vue.d.ts +2 -2
- package/dist/components/MSlider.vue.d.ts +1 -1
- package/dist/components/MStack.vue.d.ts +1 -1
- package/dist/components/MToolbar.vue.d.ts +1 -1
- package/dist/components/MWindow.vue.d.ts +1 -1
- package/dist/composables/_carouselStrategy.d.ts +101 -0
- package/dist/composables/useLocale.d.ts +19 -0
- package/dist/data/emoji-names/emoji-names-de.d.ts +2 -0
- package/dist/data/emoji-names/emoji-names-en.d.ts +2 -0
- package/dist/data/emoji-names/emoji-names-es.d.ts +2 -0
- package/dist/data/emoji-names/emoji-names-fr.d.ts +2 -0
- package/dist/data/emoji-names/emoji-names-ja.d.ts +2 -0
- package/dist/data/emoji-names/emoji-names-ko.d.ts +2 -0
- package/dist/data/emoji-names/emoji-names-pt.d.ts +2 -0
- package/dist/data/emoji-names/emoji-names-zh.d.ts +2 -0
- package/dist/data/emojis.d.ts +7 -1
- package/dist/emoji-names-de-BphO5XpV.js +1877 -0
- package/dist/emoji-names-de-BphO5XpV.js.map +1 -0
- package/dist/emoji-names-en-9ZvMRvzi.js +1877 -0
- package/dist/emoji-names-en-9ZvMRvzi.js.map +1 -0
- package/dist/emoji-names-es-DvfWU3Pj.js +1877 -0
- package/dist/emoji-names-es-DvfWU3Pj.js.map +1 -0
- package/dist/emoji-names-fr-B-jhUlsP.js +1877 -0
- package/dist/emoji-names-fr-B-jhUlsP.js.map +1 -0
- package/dist/emoji-names-ja-l8cMFJo1.js +1877 -0
- package/dist/emoji-names-ja-l8cMFJo1.js.map +1 -0
- package/dist/emoji-names-ko-YP-o9G0c.js +1877 -0
- package/dist/emoji-names-ko-YP-o9G0c.js.map +1 -0
- package/dist/emoji-names-pt-DGj_Js4M.js +1877 -0
- package/dist/emoji-names-pt-DGj_Js4M.js.map +1 -0
- package/dist/emoji-names-zh-Dzecwtw_.js +1877 -0
- package/dist/emoji-names-zh-Dzecwtw_.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/locales/index.js +140 -7
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +3885 -2400
- package/dist/m3ui.js.map +1 -1
- package/dist/plugin.d.ts +6 -0
- package/dist/rich-text-editor.js +9 -9
- package/dist/styles.css +1 -1
- package/dist/terminal.js +34 -27
- package/dist/terminal.js.map +1 -1
- package/dist/{useLocale-D3ZWZ8jY.js → useLocale-CmI675Ab.js} +21 -2
- package/dist/useLocale-CmI675Ab.js.map +1 -0
- package/package.json +1 -1
- package/src/__tests__/MCarousel.test.ts +183 -21
- package/src/__tests__/MDialog.test.ts +18 -0
- package/src/__tests__/MEmojiSelector.test.ts +138 -0
- package/src/__tests__/MLightbox.test.ts +313 -5
- package/src/__tests__/MScheduler.test.ts +122 -0
- package/src/__tests__/MTerminal.test.ts +63 -0
- package/src/__tests__/attrsFallthrough.test.ts +65 -0
- package/src/__tests__/plugin.test.ts +28 -1
- package/src/components/MBarcode.vue +4 -2
- package/src/components/MBottomSheet.vue +1 -1
- package/src/components/MCarousel.vue +526 -200
- package/src/components/MCodeEditor.vue +3 -2
- package/src/components/MCommandPalette.vue +1 -1
- package/src/components/MContextMenu.vue +3 -1
- package/src/components/MDatePickerModal.vue +1 -1
- package/src/components/MDateRangePickerModal.vue +1 -1
- package/src/components/MDialog.vue +19 -6
- package/src/components/MEmojiSelector.vue +479 -78
- package/src/components/MFab.vue +3 -1
- package/src/components/MLightbox.vue +750 -268
- package/src/components/MLoadingOverlay.vue +6 -1
- package/src/components/MMenu.vue +3 -1
- package/src/components/MNavigationDrawer.vue +5 -1
- package/src/components/MNavigationRail.vue +3 -0
- package/src/components/MOverlay.vue +1 -0
- package/src/components/MScheduler.vue +282 -115
- package/src/components/MSideSheet.vue +1 -1
- package/src/components/MSplitButton.vue +3 -1
- package/src/components/MSpotlightSearch.vue +1 -1
- package/src/components/MTerminal.vue +22 -10
- package/src/components/MTimePickerModal.vue +1 -1
- package/src/components/MTooltip.vue +3 -0
- package/src/components/MTour.vue +2 -2
- package/src/composables/_carouselStrategy.ts +712 -0
- package/src/composables/useLocale.ts +38 -0
- package/src/data/emoji-names/emoji-names-de.ts +1875 -0
- package/src/data/emoji-names/emoji-names-en.ts +1875 -0
- package/src/data/emoji-names/emoji-names-es.ts +1875 -0
- package/src/data/emoji-names/emoji-names-fr.ts +1875 -0
- package/src/data/emoji-names/emoji-names-ja.ts +1875 -0
- package/src/data/emoji-names/emoji-names-ko.ts +1875 -0
- package/src/data/emoji-names/emoji-names-pt.ts +1875 -0
- package/src/data/emoji-names/emoji-names-zh.ts +1875 -0
- package/src/data/emojis.ts +29 -198
- package/src/index.ts +2 -2
- package/src/locales/de.ts +19 -0
- package/src/locales/es.ts +19 -0
- package/src/locales/fr.ts +19 -0
- package/src/locales/ja.ts +19 -0
- package/src/locales/ko.ts +19 -0
- package/src/locales/pt.ts +19 -0
- package/src/locales/zh.ts +19 -0
- package/src/plugin.ts +12 -1
- package/dist/MMenuItem-5xojJYAL.js.map +0 -1
- package/dist/useLocale-D3ZWZ8jY.js.map +0 -1
|
@@ -256,7 +256,6 @@ onBeforeUnmount(() => view?.destroy())
|
|
|
256
256
|
flex: 1;
|
|
257
257
|
min-height: 0;
|
|
258
258
|
font-size: 0.8125rem;
|
|
259
|
-
line-height: 1.6;
|
|
260
259
|
}
|
|
261
260
|
|
|
262
261
|
.code-editor-container :deep(.cm-editor.cm-focused) {
|
|
@@ -277,8 +276,10 @@ onBeforeUnmount(() => view?.destroy())
|
|
|
277
276
|
the first place. */
|
|
278
277
|
align-items: stretch !important;
|
|
279
278
|
/* Set here, not on .cm-editor: CodeMirror's base theme declares
|
|
280
|
-
font-family: monospace on .cm-scroller itself,
|
|
279
|
+
font-family: monospace and line-height: 1.4 on .cm-scroller itself,
|
|
280
|
+
which beats inheritance */
|
|
281
281
|
font-family: var(--font-mono, 'Roboto Mono', monospace);
|
|
282
|
+
line-height: 1.6;
|
|
282
283
|
}
|
|
283
284
|
|
|
284
285
|
.code-editor-container :deep(.cm-content) {
|
|
@@ -130,7 +130,7 @@ onBeforeUnmount(() => document.removeEventListener('keydown', onGlobalKeydown))
|
|
|
130
130
|
|
|
131
131
|
<template>
|
|
132
132
|
<Teleport to="body">
|
|
133
|
-
<Transition name="m3-cmd">
|
|
133
|
+
<Transition name="m3-cmd" appear>
|
|
134
134
|
<div
|
|
135
135
|
v-if="modelValue"
|
|
136
136
|
class="fixed inset-0 z-50 flex items-start justify-center bg-scrim/32 pt-[15vh]"
|
|
@@ -3,6 +3,8 @@ import { computed, Fragment, inject, nextTick, onMounted, onUnmounted, provide,
|
|
|
3
3
|
import MIcon from './MIcon.vue'
|
|
4
4
|
import MMenuDivider from './MMenuDivider.vue'
|
|
5
5
|
|
|
6
|
+
defineOptions({ inheritAttrs: false })
|
|
7
|
+
|
|
6
8
|
const props = withDefaults(
|
|
7
9
|
defineProps<{
|
|
8
10
|
/**
|
|
@@ -337,7 +339,7 @@ onUnmounted(() => {
|
|
|
337
339
|
</script>
|
|
338
340
|
|
|
339
341
|
<template>
|
|
340
|
-
<div @contextmenu="show">
|
|
342
|
+
<div v-bind="$attrs" @contextmenu="show">
|
|
341
343
|
<slot name="trigger" />
|
|
342
344
|
</div>
|
|
343
345
|
|
|
@@ -157,7 +157,7 @@ function onKeydown(e: KeyboardEvent) { if (e.key === 'Escape') cancel() }
|
|
|
157
157
|
|
|
158
158
|
<template>
|
|
159
159
|
<Teleport to="body">
|
|
160
|
-
<Transition name="m3-dp-modal">
|
|
160
|
+
<Transition name="m3-dp-modal" appear>
|
|
161
161
|
<div
|
|
162
162
|
v-if="show"
|
|
163
163
|
class="fixed inset-0 z-50 flex items-center justify-center bg-scrim/32 p-4"
|
|
@@ -161,7 +161,7 @@ function onKeydown(e: KeyboardEvent) { if (e.key === 'Escape') cancel() }
|
|
|
161
161
|
|
|
162
162
|
<template>
|
|
163
163
|
<Teleport to="body">
|
|
164
|
-
<Transition name="m3-drp-modal">
|
|
164
|
+
<Transition name="m3-drp-modal" appear>
|
|
165
165
|
<div
|
|
166
166
|
v-if="show"
|
|
167
167
|
class="fixed inset-0 z-50 flex items-center justify-center bg-scrim/32 p-4"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { nextTick, onUnmounted, ref, watch } from 'vue'
|
|
2
|
+
import { computed, nextTick, onUnmounted, ref, watch } from 'vue'
|
|
3
3
|
import MIconButton from './MIconButton.vue'
|
|
4
4
|
import { useLocale } from '../composables/useLocale'
|
|
5
5
|
|
|
@@ -7,10 +7,12 @@ const props = withDefaults(
|
|
|
7
7
|
defineProps<{
|
|
8
8
|
modelValue: boolean
|
|
9
9
|
title?: string
|
|
10
|
+
/** A Tailwind class (`max-w-sm`) or a CSS value (`420px`, `min(90vw, 40rem)`). */
|
|
10
11
|
maxWidth?: string
|
|
11
12
|
/**
|
|
12
|
-
*
|
|
13
|
-
* default here is a library-chosen
|
|
13
|
+
* A Tailwind class (`max-h-[80vh]`) or a CSS value (`600px`). M3's `AlertDialogDefaults` has
|
|
14
|
+
* no max-height token at all (only `DialogMaxWidth`) — the default here is a library-chosen
|
|
15
|
+
* viewport-relative cap, not a spec value.
|
|
14
16
|
*/
|
|
15
17
|
maxHeight?: string
|
|
16
18
|
persistent?: boolean
|
|
@@ -36,6 +38,15 @@ const props = withDefaults(
|
|
|
36
38
|
|
|
37
39
|
const locale = useLocale()
|
|
38
40
|
|
|
41
|
+
// maxWidth/maxHeight take either a Tailwind class or a CSS value: a bare length or a CSS function
|
|
42
|
+
// can't be a class, so those go to inline style instead.
|
|
43
|
+
const isCssValue = (v: string) => /^-?[\d.]+[a-z%]*$|^(calc|min|max|clamp|var)\(/i.test(v.trim())
|
|
44
|
+
const sizeClasses = computed(() => [props.maxWidth, props.maxHeight].filter((v) => !isCssValue(v)))
|
|
45
|
+
const sizeStyle = computed(() => ({
|
|
46
|
+
...(isCssValue(props.maxWidth) ? { maxWidth: props.maxWidth } : {}),
|
|
47
|
+
...(isCssValue(props.maxHeight) ? { maxHeight: props.maxHeight } : {}),
|
|
48
|
+
}))
|
|
49
|
+
|
|
39
50
|
const emit = defineEmits<{ 'update:modelValue': [boolean] }>()
|
|
40
51
|
|
|
41
52
|
function close() {
|
|
@@ -95,7 +106,8 @@ onUnmounted(() => {
|
|
|
95
106
|
<template>
|
|
96
107
|
<Teleport to="body">
|
|
97
108
|
<!-- Basic dialog -->
|
|
98
|
-
|
|
109
|
+
<!-- appear: a dialog mounted already open (v-if + modelValue in the same tick) animates in too -->
|
|
110
|
+
<Transition v-if="!fullscreen" name="m3-dialog" appear>
|
|
99
111
|
<div
|
|
100
112
|
v-if="modelValue"
|
|
101
113
|
class="fixed inset-0 z-50 flex items-center justify-center bg-scrim/32 p-4"
|
|
@@ -103,7 +115,8 @@ onUnmounted(() => {
|
|
|
103
115
|
>
|
|
104
116
|
<div
|
|
105
117
|
class="dialog-box flex min-w-[280px] w-full flex-col rounded-xl bg-surface-container-high shadow-elevation-3"
|
|
106
|
-
:class="
|
|
118
|
+
:class="sizeClasses"
|
|
119
|
+
:style="sizeStyle"
|
|
107
120
|
>
|
|
108
121
|
<!--
|
|
109
122
|
AlertDialogDefaults.dialogPadding is 24dp on all four sides of the whole content
|
|
@@ -167,7 +180,7 @@ onUnmounted(() => {
|
|
|
167
180
|
</Transition>
|
|
168
181
|
|
|
169
182
|
<!-- Fullscreen dialog -->
|
|
170
|
-
<Transition v-else name="m3-dialog-fs">
|
|
183
|
+
<Transition v-else name="m3-dialog-fs" appear>
|
|
171
184
|
<div
|
|
172
185
|
v-if="modelValue"
|
|
173
186
|
class="dialog-fs fixed inset-0 z-50 flex flex-col bg-surface"
|