@m3ui-vue/m3ui-vue 1.1.2 → 1.1.3
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 +135 -5
- package/dist/{MIcon-DLOkQduI.js → MIcon-Bxh9j135.js} +15 -8
- package/dist/MIcon-Bxh9j135.js.map +1 -0
- package/dist/{MMenuItem-DVxKEv1W.js → MMenuItem-BckcR0nW.js} +4 -4
- package/dist/{MMenuItem-DVxKEv1W.js.map → MMenuItem-BckcR0nW.js.map} +1 -1
- package/dist/{MSlider-BXsBv0ox.js → MSlider-LyH_gy8D.js} +56 -47
- package/dist/MSlider-LyH_gy8D.js.map +1 -0
- package/dist/{MTextField-rML9jnXs.js → MTextField-FCPOTB0o.js} +65 -64
- package/dist/{MTextField-rML9jnXs.js.map → MTextField-FCPOTB0o.js.map} +1 -1
- package/dist/api.json +1 -1
- package/dist/code-editor.js +2 -2
- package/dist/components/MAnimatedNumber.vue.d.ts +27 -0
- package/dist/components/MIcon.vue.d.ts +2 -0
- package/dist/components/MListGroup.vue.d.ts +23 -0
- package/dist/components/MScheduler.vue.d.ts +2 -2
- package/dist/components/MScheme.vue.d.ts +60 -0
- package/dist/components/MSparkline.vue.d.ts +41 -0
- package/dist/components/MWindow.vue.d.ts +2 -2
- package/dist/components/_MDrawerItemList.vue.d.ts +2 -0
- package/dist/composables/_useSegmentRuns.d.ts +8 -0
- package/dist/composables/dynamicColor.d.ts +11 -0
- package/dist/composables/useColorPalette.d.ts +3 -1
- package/dist/composables/useConfetti.d.ts +32 -0
- package/dist/composables/useLocale.d.ts +6 -0
- package/dist/index.d.ts +7 -1
- package/dist/locales/index.js +21 -0
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +16187 -15377
- package/dist/m3ui.js.map +1 -1
- package/dist/map.js +45 -45
- package/dist/{material-color-utilities-Cktu8DBU.js → material-color-utilities-C_iikgRm.js} +928 -603
- package/dist/material-color-utilities-C_iikgRm.js.map +1 -0
- package/dist/rich-text-editor.js +4 -4
- package/dist/styles.css +1 -1
- package/dist/terminal.js +1 -1
- package/dist/{useLocale-CqQrhWFl.js → useLocale-SfQHnJfp.js} +4 -1
- package/dist/useLocale-SfQHnJfp.js.map +1 -0
- package/package.json +1 -1
- package/src/__tests__/MAnimatedNumber.test.ts +106 -0
- package/src/__tests__/MIcon.test.ts +19 -0
- package/src/__tests__/MListItemShape.test.ts +34 -0
- package/src/__tests__/MScheme.test.ts +107 -0
- package/src/__tests__/MSparkline.test.ts +96 -0
- package/src/__tests__/iconButtonNames.test.ts +124 -0
- package/src/__tests__/ssr.test.ts +1 -0
- package/src/__tests__/useConfetti.test.ts +81 -0
- package/src/components/MAnimatedNumber.vue +301 -0
- package/src/components/MAutocomplete.vue +34 -4
- package/src/components/MBottomSheet.vue +1 -0
- package/src/components/MDataTable.vue +1 -1
- package/src/components/MIcon.vue +11 -4
- package/src/components/MList.vue +8 -30
- package/src/components/MListGroup.vue +66 -0
- package/src/components/MMaskField.vue +3 -0
- package/src/components/MMultiAutocomplete.vue +5 -1
- package/src/components/MMultiSelect.vue +19 -9
- package/src/components/MScheme.vue +162 -0
- package/src/components/MSearchBar.vue +2 -0
- package/src/components/MSelect.vue +44 -10
- package/src/components/MSideSheet.vue +3 -0
- package/src/components/MSimpleCarousel.vue +6 -0
- package/src/components/MSparkline.vue +250 -0
- package/src/components/MSplitButton.vue +3 -0
- package/src/components/MSpotlightSearch.vue +1 -0
- package/src/components/MTable.vue +1 -0
- package/src/components/MTagInput.vue +4 -0
- package/src/components/MTextField.vue +3 -0
- package/src/components/MTour.vue +1 -0
- package/src/components/MTreeTable.vue +1 -0
- package/src/components/_MTreeNode.vue +3 -0
- package/src/composables/_useSegmentRuns.ts +39 -0
- package/src/composables/dynamicColor.ts +66 -0
- package/src/composables/useColorPalette.ts +2 -2
- package/src/composables/useConfetti.ts +204 -0
- package/src/composables/useLocale.ts +9 -0
- package/src/index.ts +7 -1
- package/src/locales/de.ts +3 -0
- package/src/locales/es.ts +3 -0
- package/src/locales/fr.ts +3 -0
- package/src/locales/ja.ts +3 -0
- package/src/locales/ko.ts +3 -0
- package/src/locales/pt.ts +3 -0
- package/src/locales/zh.ts +3 -0
- package/dist/MIcon-DLOkQduI.js.map +0 -1
- package/dist/MSlider-BXsBv0ox.js.map +0 -1
- package/dist/material-color-utilities-Cktu8DBU.js.map +0 -1
- package/dist/useLocale-CqQrhWFl.js.map +0 -1
|
@@ -83,3 +83,69 @@ export function schemeToCss(scheme: GeneratedScheme, id: string): string {
|
|
|
83
83
|
Object.entries(tokens).map(([k, v]) => ` --color-${k}: ${v};`).join('\n')
|
|
84
84
|
return `[data-palette='${id}'] {\n${block(scheme.light)}\n}\n[data-palette='${id}'].dark {\n color-scheme: dark;\n${block(scheme.dark)}\n}\n`
|
|
85
85
|
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The seed color of an image's pixels (RGBA bytes, as `ImageData.data`): its colors quantized and scored the way
|
|
89
|
+
* Android picks a wallpaper's source color (QuantizerCelebi + Score). Fully transparent pixels are skipped.
|
|
90
|
+
*/
|
|
91
|
+
export async function seedFromPixels(rgba: ArrayLike<number>): Promise<string> {
|
|
92
|
+
const mcu = await import('@material/material-color-utilities')
|
|
93
|
+
// QuantizerWsmeans starts from Math.random() cluster assignments, so the same image could give a different seed
|
|
94
|
+
// on every read. Android's Java version seeds its Random with 0x42688: run it on a generator seeded the same way
|
|
95
|
+
// (the quantization is synchronous, so nothing else sees the swap).
|
|
96
|
+
const random = Math.random
|
|
97
|
+
let state = 0x42688
|
|
98
|
+
Math.random = () => {
|
|
99
|
+
state = (state + 0x6d2b79f5) | 0
|
|
100
|
+
let t = Math.imul(state ^ (state >>> 15), state | 1)
|
|
101
|
+
t ^= t + Math.imul(t ^ (t >>> 7), t | 61)
|
|
102
|
+
return ((t ^ (t >>> 14)) >>> 0) / 4294967296
|
|
103
|
+
}
|
|
104
|
+
try {
|
|
105
|
+
return mcu.hexFromArgb(mcu.sourceColorFromImageBytes(rgba as Uint8ClampedArray))
|
|
106
|
+
} finally {
|
|
107
|
+
Math.random = random
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Android's WallpaperColors scales a wallpaper down to about this many pixels before quantizing: plenty for
|
|
112
|
+
// picking a color, and fast whatever the image's size.
|
|
113
|
+
const EXTRACTION_AREA = 112 * 112
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* The seed color of an image, for `generateScheme`, `useColorPalette().setSeed()` or `MScheme`: what Android does
|
|
117
|
+
* with the wallpaper. Takes a URL (cross-origin images need CORS headers, or the canvas can't be read), an `<img>`,
|
|
118
|
+
* an `ImageBitmap` or a `Blob` (a file the user picked). Browser only.
|
|
119
|
+
*/
|
|
120
|
+
export async function seedFromImage(source: string | HTMLImageElement | ImageBitmap | Blob): Promise<string> {
|
|
121
|
+
let image: CanvasImageSource & { width: number; height: number }
|
|
122
|
+
let objectUrl: string | undefined
|
|
123
|
+
if (typeof source === 'string' || source instanceof Blob) {
|
|
124
|
+
// A Blob goes through an <img> too: createImageBitmap decodes colors differently (another seed for the same
|
|
125
|
+
// file than its URL gives)
|
|
126
|
+
if (typeof source !== 'string') objectUrl = URL.createObjectURL(source)
|
|
127
|
+
const img = new Image()
|
|
128
|
+
img.crossOrigin = 'anonymous'
|
|
129
|
+
img.src = objectUrl ?? (source as string)
|
|
130
|
+
try {
|
|
131
|
+
await img.decode()
|
|
132
|
+
} finally {
|
|
133
|
+
if (objectUrl) URL.revokeObjectURL(objectUrl)
|
|
134
|
+
}
|
|
135
|
+
image = img
|
|
136
|
+
} else {
|
|
137
|
+
if (source instanceof HTMLImageElement && !source.complete) await source.decode()
|
|
138
|
+
image = source
|
|
139
|
+
}
|
|
140
|
+
const w = (image as HTMLImageElement).naturalWidth || image.width
|
|
141
|
+
const h = (image as HTMLImageElement).naturalHeight || image.height
|
|
142
|
+
if (!w || !h) throw new Error('seedFromImage: the image has no size')
|
|
143
|
+
const scale = Math.min(1, Math.sqrt(EXTRACTION_AREA / (w * h)))
|
|
144
|
+
const canvas = document.createElement('canvas')
|
|
145
|
+
canvas.width = Math.max(1, Math.round(w * scale))
|
|
146
|
+
canvas.height = Math.max(1, Math.round(h * scale))
|
|
147
|
+
const ctx = canvas.getContext('2d', { willReadFrequently: true })
|
|
148
|
+
if (!ctx) throw new Error('seedFromImage: no 2D canvas')
|
|
149
|
+
ctx.drawImage(image, 0, 0, canvas.width, canvas.height)
|
|
150
|
+
return seedFromPixels(ctx.getImageData(0, 0, canvas.width, canvas.height).data)
|
|
151
|
+
}
|
|
@@ -159,8 +159,8 @@ function injectCss(css: string) {
|
|
|
159
159
|
el.textContent = css
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
/** Whether a stylesheet (other than our generated one) already styles `[data-palette='<id>']`. */
|
|
163
|
-
function hasPaletteCss(id: string): boolean {
|
|
162
|
+
/** Whether a stylesheet (other than our generated one) already styles `[data-palette='<id>']`. Also used by MScheme; not exported from index.ts. */
|
|
163
|
+
export function hasPaletteCss(id: string): boolean {
|
|
164
164
|
if (typeof document === 'undefined') return false
|
|
165
165
|
const needles = [`[data-palette="${id}"]`, `[data-palette='${id}']`, `[data-palette=${id}]`]
|
|
166
166
|
const scan = (rules: CSSRuleList): boolean => {
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
// Confetti: a burst of Material 3's expressive shapes (MShape's) in the theme's colors, for the end of a flow (an
|
|
2
|
+
// order placed, a task done). One shared canvas over the page, created on the first burst and removed when the last
|
|
3
|
+
// piece has fallen; it never takes pointer events and assistive technology ignores it. Simple physics (gravity, air
|
|
4
|
+
// drag, spin and a flip that flattens each piece as it turns) in a rAF loop. Nothing happens under reduced motion.
|
|
5
|
+
import { getShape, toSvgPath, type ShapeName } from 'shape-morph'
|
|
6
|
+
|
|
7
|
+
export interface ConfettiOptions {
|
|
8
|
+
/** How many pieces (default 80; 160 for `from: 'top'`) */
|
|
9
|
+
count?: number
|
|
10
|
+
/** Shapes to pick from (MShape's names) */
|
|
11
|
+
shapes?: ShapeName[]
|
|
12
|
+
/** Any CSS colors. Default: the theme's primary, secondary and tertiary roles and their containers, read at the origin */
|
|
13
|
+
colors?: string[]
|
|
14
|
+
/** Burst from a point (default) or rain from the top of the screen */
|
|
15
|
+
from?: 'point' | 'top'
|
|
16
|
+
/** Burst angle in degrees, 0 = up (default 0) */
|
|
17
|
+
angle?: number
|
|
18
|
+
/** Cone the pieces leave in, in degrees (default 70) */
|
|
19
|
+
spread?: number
|
|
20
|
+
/** Launch speed in px/s (default 950) */
|
|
21
|
+
velocity?: number
|
|
22
|
+
/** Piece size in px (default 14) */
|
|
23
|
+
size?: number
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Where a burst starts: the pointer of an event, an element's center, or a point in viewport pixels */
|
|
27
|
+
export type ConfettiOrigin = MouseEvent | PointerEvent | Element | { x: number; y: number }
|
|
28
|
+
|
|
29
|
+
const DEFAULT_SHAPES: ShapeName[] = ['Cookie4Sided', 'Sunny', 'Clover4Leaf', 'Heart', 'Pill', 'Triangle', 'SoftBurst', 'Circle', 'Gem', 'Flower']
|
|
30
|
+
const ROLES = ['primary', 'secondary', 'tertiary', 'primary-container', 'tertiary-container']
|
|
31
|
+
const GRAVITY = 1500
|
|
32
|
+
const DRAG = 1.6
|
|
33
|
+
const SIZE = 100
|
|
34
|
+
|
|
35
|
+
interface Piece {
|
|
36
|
+
x: number
|
|
37
|
+
y: number
|
|
38
|
+
vx: number
|
|
39
|
+
vy: number
|
|
40
|
+
rot: number
|
|
41
|
+
spin: number
|
|
42
|
+
flip: number
|
|
43
|
+
flipSpeed: number
|
|
44
|
+
size: number
|
|
45
|
+
path: Path2D
|
|
46
|
+
color: string
|
|
47
|
+
age: number
|
|
48
|
+
life: number
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const paths = new Map<string, Path2D>()
|
|
52
|
+
function pathFor(shape: ShapeName) {
|
|
53
|
+
let path = paths.get(shape)
|
|
54
|
+
if (!path) {
|
|
55
|
+
path = new Path2D(toSvgPath(getShape(shape), SIZE))
|
|
56
|
+
paths.set(shape, path)
|
|
57
|
+
}
|
|
58
|
+
return path
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
let canvas: HTMLCanvasElement | null = null
|
|
62
|
+
let ctx: CanvasRenderingContext2D | null = null
|
|
63
|
+
let pieces: Piece[] = []
|
|
64
|
+
let raf = 0
|
|
65
|
+
let last = 0
|
|
66
|
+
|
|
67
|
+
function ensureCanvas() {
|
|
68
|
+
if (canvas) return ctx
|
|
69
|
+
canvas = document.createElement('canvas')
|
|
70
|
+
canvas.setAttribute('aria-hidden', 'true')
|
|
71
|
+
canvas.style.cssText = 'position:fixed;inset:0;width:100vw;height:100vh;pointer-events:none;z-index:2147483000'
|
|
72
|
+
document.body.appendChild(canvas)
|
|
73
|
+
ctx = canvas.getContext('2d')
|
|
74
|
+
if (!ctx) {
|
|
75
|
+
teardown()
|
|
76
|
+
return null
|
|
77
|
+
}
|
|
78
|
+
resize()
|
|
79
|
+
window.addEventListener('resize', resize)
|
|
80
|
+
return ctx
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function resize() {
|
|
84
|
+
if (!canvas) return
|
|
85
|
+
const dpr = window.devicePixelRatio || 1
|
|
86
|
+
canvas.width = Math.round(window.innerWidth * dpr)
|
|
87
|
+
canvas.height = Math.round(window.innerHeight * dpr)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function teardown() {
|
|
91
|
+
cancelAnimationFrame(raf)
|
|
92
|
+
raf = 0
|
|
93
|
+
window.removeEventListener('resize', resize)
|
|
94
|
+
canvas?.remove()
|
|
95
|
+
canvas = null
|
|
96
|
+
ctx = null
|
|
97
|
+
pieces = []
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function frame(now: number) {
|
|
101
|
+
const dt = Math.min((now - last) / 1000, 1 / 30)
|
|
102
|
+
last = now
|
|
103
|
+
const height = window.innerHeight
|
|
104
|
+
pieces = pieces.filter((p) => p.age < p.life && p.y < height + 60)
|
|
105
|
+
if (!pieces.length || !ctx || !canvas) {
|
|
106
|
+
teardown()
|
|
107
|
+
return
|
|
108
|
+
}
|
|
109
|
+
const dpr = canvas.width / window.innerWidth
|
|
110
|
+
ctx.setTransform(1, 0, 0, 1, 0, 0)
|
|
111
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height)
|
|
112
|
+
for (const p of pieces) {
|
|
113
|
+
p.age += dt
|
|
114
|
+
p.vx -= p.vx * DRAG * dt
|
|
115
|
+
p.vy += (GRAVITY - p.vy * DRAG) * dt
|
|
116
|
+
p.x += p.vx * dt
|
|
117
|
+
p.y += p.vy * dt
|
|
118
|
+
p.rot += p.spin * dt
|
|
119
|
+
p.flip += p.flipSpeed * dt
|
|
120
|
+
const fade = Math.min(1, (p.life - p.age) / 0.6)
|
|
121
|
+
ctx.globalAlpha = Math.max(0, fade)
|
|
122
|
+
ctx.fillStyle = p.color
|
|
123
|
+
const scale = (p.size / SIZE) * dpr
|
|
124
|
+
ctx.setTransform(scale * Math.cos(p.rot), scale * Math.sin(p.rot), -scale * Math.sin(p.rot) * Math.cos(p.flip), scale * Math.cos(p.rot) * Math.cos(p.flip), p.x * dpr, p.y * dpr)
|
|
125
|
+
ctx.translate(-SIZE / 2, -SIZE / 2)
|
|
126
|
+
ctx.fill(p.path)
|
|
127
|
+
}
|
|
128
|
+
raf = requestAnimationFrame(frame)
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function originPoint(origin: ConfettiOrigin | undefined): { x: number; y: number; el: Element } {
|
|
132
|
+
if (origin && 'clientX' in origin) {
|
|
133
|
+
const el = (origin.currentTarget as Element | null) ?? (origin.target as Element | null) ?? document.documentElement
|
|
134
|
+
// A click from the keyboard (Enter, Space) has no pointer position: burst from the element instead
|
|
135
|
+
if (origin.detail === 0 && origin.clientX === 0 && origin.clientY === 0) return originPoint(el)
|
|
136
|
+
return { x: origin.clientX, y: origin.clientY, el }
|
|
137
|
+
}
|
|
138
|
+
if (origin instanceof Element) {
|
|
139
|
+
const r = origin.getBoundingClientRect()
|
|
140
|
+
return { x: r.left + r.width / 2, y: r.top + r.height / 2, el: origin }
|
|
141
|
+
}
|
|
142
|
+
if (origin) return { ...origin, el: document.documentElement }
|
|
143
|
+
return { x: window.innerWidth / 2, y: window.innerHeight * 0.6, el: document.documentElement }
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function themeColors(el: Element) {
|
|
147
|
+
const style = getComputedStyle(el)
|
|
148
|
+
const colors = ROLES.map((role) => style.getPropertyValue(`--color-${role}`).trim()).filter(Boolean)
|
|
149
|
+
return colors.length ? colors : ['#6750a4', '#625b71', '#7d5260', '#eaddff', '#ffd8e4']
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/** Fires a burst of confetti. Browser only; does nothing under reduced motion. */
|
|
153
|
+
export function fireConfetti(origin?: ConfettiOrigin, options: ConfettiOptions = {}) {
|
|
154
|
+
if (typeof window === 'undefined') return
|
|
155
|
+
if (window.matchMedia?.('(prefers-reduced-motion: reduce)').matches) return
|
|
156
|
+
const top = options.from === 'top'
|
|
157
|
+
const point = originPoint(origin)
|
|
158
|
+
const colors = options.colors?.length ? options.colors : themeColors(point.el)
|
|
159
|
+
const shapes = options.shapes?.length ? options.shapes : DEFAULT_SHAPES
|
|
160
|
+
const count = options.count ?? (top ? 160 : 80)
|
|
161
|
+
const spread = ((options.spread ?? 70) * Math.PI) / 180
|
|
162
|
+
const angle = ((options.angle ?? 0) * Math.PI) / 180
|
|
163
|
+
const speed = options.velocity ?? 950
|
|
164
|
+
const size = options.size ?? 14
|
|
165
|
+
if (!ensureCanvas()) return
|
|
166
|
+
for (let i = 0; i < count; i++) {
|
|
167
|
+
const dir = angle + (Math.random() - 0.5) * spread
|
|
168
|
+
const v = top ? 100 + Math.random() * 200 : speed * (0.55 + Math.random() * 0.6)
|
|
169
|
+
pieces.push({
|
|
170
|
+
x: top ? Math.random() * window.innerWidth : point.x,
|
|
171
|
+
y: top ? -20 - Math.random() * window.innerHeight * 0.4 : point.y,
|
|
172
|
+
vx: top ? (Math.random() - 0.5) * 200 : Math.sin(dir) * v,
|
|
173
|
+
vy: top ? v : -Math.cos(dir) * v,
|
|
174
|
+
rot: Math.random() * Math.PI * 2,
|
|
175
|
+
spin: (Math.random() - 0.5) * 12,
|
|
176
|
+
flip: Math.random() * Math.PI * 2,
|
|
177
|
+
flipSpeed: 4 + Math.random() * 8,
|
|
178
|
+
size: size * (0.7 + Math.random() * 0.6),
|
|
179
|
+
path: pathFor(shapes[Math.floor(Math.random() * shapes.length)]!),
|
|
180
|
+
color: colors[Math.floor(Math.random() * colors.length)]!,
|
|
181
|
+
age: 0,
|
|
182
|
+
life: top ? 4 + Math.random() * 1.5 : 2.4 + Math.random() * 1.2,
|
|
183
|
+
})
|
|
184
|
+
}
|
|
185
|
+
if (!raf) {
|
|
186
|
+
last = performance.now()
|
|
187
|
+
raf = requestAnimationFrame(frame)
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/** Confetti for a component: `fire(event)` from the pointer, `fire(el)` from an element, `fire({ from: 'top' })`. */
|
|
192
|
+
export function useConfetti() {
|
|
193
|
+
function fire(origin?: ConfettiOrigin | ConfettiOptions, options?: ConfettiOptions) {
|
|
194
|
+
const isOrigin = origin instanceof Event || (typeof Element !== 'undefined' && origin instanceof Element) || (origin && 'x' in origin && 'y' in origin && !('from' in origin))
|
|
195
|
+
if (isOrigin) fireConfetti(origin as ConfettiOrigin, options)
|
|
196
|
+
else fireConfetti(undefined, { ...(origin as ConfettiOptions | undefined), ...options })
|
|
197
|
+
}
|
|
198
|
+
return { fire }
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/** Stops every burst and removes the canvas. Internal, for tests; not exported from index.ts. */
|
|
202
|
+
export function __resetConfetti() {
|
|
203
|
+
teardown()
|
|
204
|
+
}
|
|
@@ -23,6 +23,10 @@ export interface M3Locale {
|
|
|
23
23
|
selectedCount: string
|
|
24
24
|
recordCount: string
|
|
25
25
|
expand: string
|
|
26
|
+
/** Collapses an expanded item (the opposite of `expand`) */
|
|
27
|
+
collapse: string
|
|
28
|
+
/** Clears a field's value (the × at its end) */
|
|
29
|
+
clear: string
|
|
26
30
|
columns: string
|
|
27
31
|
exportCsv: string
|
|
28
32
|
noGroup: string
|
|
@@ -195,6 +199,8 @@ export interface M3Locale {
|
|
|
195
199
|
nextPage: string
|
|
196
200
|
carousel: string
|
|
197
201
|
carouselItem: string
|
|
202
|
+
/** MSparkline's summary for screen readers: {first}, {last}, {min}, {max} */
|
|
203
|
+
sparklineSummary: string
|
|
198
204
|
// MMap (maplibre controls)
|
|
199
205
|
mapTitle: string
|
|
200
206
|
mapMarker: string
|
|
@@ -247,6 +253,8 @@ export const defaultLocale: M3Locale = {
|
|
|
247
253
|
selectedCount: 'selected',
|
|
248
254
|
recordCount: 'record',
|
|
249
255
|
expand: 'Expand',
|
|
256
|
+
collapse: 'Collapse',
|
|
257
|
+
clear: 'Clear',
|
|
250
258
|
columns: 'Columns',
|
|
251
259
|
exportCsv: 'Export CSV',
|
|
252
260
|
noGroup: 'No group',
|
|
@@ -406,6 +414,7 @@ export const defaultLocale: M3Locale = {
|
|
|
406
414
|
nextPage: 'Next page',
|
|
407
415
|
carousel: 'Carousel',
|
|
408
416
|
carouselItem: '{index} of {count}',
|
|
417
|
+
sparklineSummary: 'From {first} to {last}, low {min}, high {max}',
|
|
409
418
|
// MMap (maplibre controls)
|
|
410
419
|
mapTitle: 'Map',
|
|
411
420
|
mapMarker: 'Map marker',
|
package/src/index.ts
CHANGED
|
@@ -7,11 +7,13 @@ export type { M3InitialState } from './composables/_ssrState'
|
|
|
7
7
|
export { useTheme } from './composables/useTheme'
|
|
8
8
|
export type { Theme } from './composables/useTheme'
|
|
9
9
|
export { useColorPalette, palettes } from './composables/useColorPalette'
|
|
10
|
+
export { useConfetti, fireConfetti } from './composables/useConfetti'
|
|
11
|
+
export type { ConfettiOptions, ConfettiOrigin } from './composables/useConfetti'
|
|
10
12
|
export type { Palette, PaletteId, ActiveSeed, ContrastLevel } from './composables/useColorPalette'
|
|
11
13
|
export { SEED_PALETTE } from './composables/useColorPalette'
|
|
12
14
|
export { themeInitScript } from './composables/themeInitScript'
|
|
13
15
|
export type { ThemeInitOptions } from './composables/themeInitScript'
|
|
14
|
-
export { generateScheme, schemeToCss, schemeRoles } from './composables/dynamicColor'
|
|
16
|
+
export { generateScheme, schemeToCss, schemeRoles, seedFromImage, seedFromPixels } from './composables/dynamicColor'
|
|
15
17
|
export type { SchemeVariant, SeedOptions, GeneratedScheme } from './composables/dynamicColor'
|
|
16
18
|
export { useToast } from './composables/useToast'
|
|
17
19
|
export type { Toast, ToastVariant, ToastPosition, ToastAction, ToastOptions } from './composables/useToast'
|
|
@@ -36,6 +38,7 @@ export type { RippleOptions, RippleValue } from './directives/vRipple'
|
|
|
36
38
|
// Components
|
|
37
39
|
export { default as MAbsolute } from './components/MAbsolute.vue'
|
|
38
40
|
export { default as MAlert } from './components/MAlert.vue'
|
|
41
|
+
export { default as MAnimatedNumber } from './components/MAnimatedNumber.vue'
|
|
39
42
|
export { default as MAutocomplete } from './components/MAutocomplete.vue'
|
|
40
43
|
export { default as MAppBar } from './components/MAppBar.vue'
|
|
41
44
|
export { default as MAppBarWithSearch } from './components/MAppBarWithSearch.vue'
|
|
@@ -107,6 +110,7 @@ export type { LightboxItem } from './components/MLightbox.vue'
|
|
|
107
110
|
export { default as MList } from './components/MList.vue'
|
|
108
111
|
export { default as MListItem } from './components/MListItem.vue'
|
|
109
112
|
export { default as MListSubheader } from './components/MListSubheader.vue'
|
|
113
|
+
export { default as MListGroup } from './components/MListGroup.vue'
|
|
110
114
|
export { default as MLoadingIndicator } from './components/MLoadingIndicator.vue'
|
|
111
115
|
export { default as MLoadingOverlay } from './components/MLoadingOverlay.vue'
|
|
112
116
|
// MMarkdown — import from '@m3ui-vue/m3ui-vue/markdown'
|
|
@@ -144,6 +148,7 @@ export { default as MResponsive } from './components/MResponsive.vue'
|
|
|
144
148
|
export { default as MResult } from './components/MResult.vue'
|
|
145
149
|
// MRichTextEditor — import from '@m3ui-vue/m3ui-vue/rich-text-editor'
|
|
146
150
|
export { default as MScheduler } from './components/MScheduler.vue'
|
|
151
|
+
export { default as MScheme } from './components/MScheme.vue'
|
|
147
152
|
export { default as MScrollable } from './components/MScrollable.vue'
|
|
148
153
|
export { default as MSearchBar } from './components/MSearchBar.vue'
|
|
149
154
|
export { default as MSection } from './components/MSection.vue'
|
|
@@ -165,6 +170,7 @@ export type { SimpleCarouselItem } from './components/MSimpleCarousel.vue'
|
|
|
165
170
|
export { default as MSkeleton } from './components/MSkeleton.vue'
|
|
166
171
|
export { default as MSlider } from './components/MSlider.vue'
|
|
167
172
|
export { default as MSnackbar } from './components/MSnackbar.vue'
|
|
173
|
+
export { default as MSparkline } from './components/MSparkline.vue'
|
|
168
174
|
export { default as MSpacer } from './components/MSpacer.vue'
|
|
169
175
|
export { default as MSpinner } from './components/MSpinner.vue'
|
|
170
176
|
export { default as MSplitButton } from './components/MSplitButton.vue'
|
package/src/locales/de.ts
CHANGED
|
@@ -22,6 +22,8 @@ export const deLocale: M3Locale = {
|
|
|
22
22
|
selectedCount: 'ausgewählt',
|
|
23
23
|
recordCount: 'Datensatz',
|
|
24
24
|
expand: 'Erweitern',
|
|
25
|
+
collapse: 'Einklappen',
|
|
26
|
+
clear: 'Löschen',
|
|
25
27
|
columns: 'Spalten',
|
|
26
28
|
exportCsv: 'CSV exportieren',
|
|
27
29
|
noGroup: 'Keine Gruppe',
|
|
@@ -191,6 +193,7 @@ export const deLocale: M3Locale = {
|
|
|
191
193
|
nextPage: 'Nächste Seite',
|
|
192
194
|
carousel: 'Karussell',
|
|
193
195
|
carouselItem: '{index} von {count}', // MMap (maplibre controls)
|
|
196
|
+
sparklineSummary: 'Von {first} bis {last}, Minimum {min}, Maximum {max}',
|
|
194
197
|
mapTitle: 'Karte',
|
|
195
198
|
mapMarker: 'Kartenmarkierung',
|
|
196
199
|
mapZoomIn: 'Vergrößern',
|
package/src/locales/es.ts
CHANGED
|
@@ -22,6 +22,8 @@ export const esLocale: M3Locale = {
|
|
|
22
22
|
selectedCount: 'seleccionados',
|
|
23
23
|
recordCount: 'registro',
|
|
24
24
|
expand: 'Expandir',
|
|
25
|
+
collapse: 'Contraer',
|
|
26
|
+
clear: 'Borrar',
|
|
25
27
|
columns: 'Columnas',
|
|
26
28
|
exportCsv: 'Exportar CSV',
|
|
27
29
|
noGroup: 'Sin grupo',
|
|
@@ -191,6 +193,7 @@ export const esLocale: M3Locale = {
|
|
|
191
193
|
nextPage: 'Página siguiente',
|
|
192
194
|
carousel: 'Carrusel',
|
|
193
195
|
carouselItem: '{index} de {count}', // MMap (maplibre controls)
|
|
196
|
+
sparklineSummary: 'De {first} a {last}, mínimo {min}, máximo {max}',
|
|
194
197
|
mapTitle: 'Mapa',
|
|
195
198
|
mapMarker: 'Marcador del mapa',
|
|
196
199
|
mapZoomIn: 'Acercar',
|
package/src/locales/fr.ts
CHANGED
|
@@ -22,6 +22,8 @@ export const frLocale: M3Locale = {
|
|
|
22
22
|
selectedCount: 'sélectionnés',
|
|
23
23
|
recordCount: 'enregistrement',
|
|
24
24
|
expand: 'Développer',
|
|
25
|
+
collapse: 'Réduire',
|
|
26
|
+
clear: 'Effacer',
|
|
25
27
|
columns: 'Colonnes',
|
|
26
28
|
exportCsv: 'Exporter CSV',
|
|
27
29
|
noGroup: 'Sans groupe',
|
|
@@ -191,6 +193,7 @@ export const frLocale: M3Locale = {
|
|
|
191
193
|
nextPage: 'Page suivante',
|
|
192
194
|
carousel: 'Carrousel',
|
|
193
195
|
carouselItem: '{index} sur {count}', // MMap (maplibre controls)
|
|
196
|
+
sparklineSummary: 'De {first} à {last}, minimum {min}, maximum {max}',
|
|
194
197
|
mapTitle: 'Carte',
|
|
195
198
|
mapMarker: 'Marqueur de carte',
|
|
196
199
|
mapZoomIn: 'Zoom avant',
|
package/src/locales/ja.ts
CHANGED
|
@@ -22,6 +22,8 @@ export const jaLocale: M3Locale = {
|
|
|
22
22
|
selectedCount: '件選択中',
|
|
23
23
|
recordCount: '件',
|
|
24
24
|
expand: '展開',
|
|
25
|
+
collapse: '折りたたむ',
|
|
26
|
+
clear: 'クリア',
|
|
25
27
|
columns: '列',
|
|
26
28
|
exportCsv: 'CSV エクスポート',
|
|
27
29
|
noGroup: 'グループなし',
|
|
@@ -191,6 +193,7 @@ export const jaLocale: M3Locale = {
|
|
|
191
193
|
nextPage: '次のページ',
|
|
192
194
|
carousel: 'カルーセル',
|
|
193
195
|
carouselItem: '{count} 件中 {index} 件目', // MMap (maplibre controls)
|
|
196
|
+
sparklineSummary: '{first} から {last}、最小 {min}、最大 {max}',
|
|
194
197
|
mapTitle: '地図',
|
|
195
198
|
mapMarker: '地図のマーカー',
|
|
196
199
|
mapZoomIn: 'ズームイン',
|
package/src/locales/ko.ts
CHANGED
|
@@ -22,6 +22,8 @@ export const koLocale: M3Locale = {
|
|
|
22
22
|
selectedCount: '선택됨',
|
|
23
23
|
recordCount: '개 레코드',
|
|
24
24
|
expand: '펼치기',
|
|
25
|
+
collapse: '접기',
|
|
26
|
+
clear: '지우기',
|
|
25
27
|
columns: '열',
|
|
26
28
|
exportCsv: 'CSV 내보내기',
|
|
27
29
|
noGroup: '그룹 없음',
|
|
@@ -191,6 +193,7 @@ export const koLocale: M3Locale = {
|
|
|
191
193
|
nextPage: '다음 페이지',
|
|
192
194
|
carousel: '캐러셀',
|
|
193
195
|
carouselItem: '{count}개 중 {index}번째', // MMap (maplibre controls)
|
|
196
|
+
sparklineSummary: '{first}에서 {last}, 최소 {min}, 최대 {max}',
|
|
194
197
|
mapTitle: '지도',
|
|
195
198
|
mapMarker: '지도 마커',
|
|
196
199
|
mapZoomIn: '확대',
|
package/src/locales/pt.ts
CHANGED
|
@@ -22,6 +22,8 @@ export const ptLocale: M3Locale = {
|
|
|
22
22
|
selectedCount: 'selecionados',
|
|
23
23
|
recordCount: 'registro',
|
|
24
24
|
expand: 'Expandir',
|
|
25
|
+
collapse: 'Recolher',
|
|
26
|
+
clear: 'Limpar',
|
|
25
27
|
columns: 'Colunas',
|
|
26
28
|
exportCsv: 'Exportar CSV',
|
|
27
29
|
noGroup: 'Sem grupo',
|
|
@@ -191,6 +193,7 @@ export const ptLocale: M3Locale = {
|
|
|
191
193
|
nextPage: 'Próxima página',
|
|
192
194
|
carousel: 'Carrossel',
|
|
193
195
|
carouselItem: '{index} de {count}', // MMap (maplibre controls)
|
|
196
|
+
sparklineSummary: 'De {first} a {last}, mínimo {min}, máximo {max}',
|
|
194
197
|
mapTitle: 'Mapa',
|
|
195
198
|
mapMarker: 'Marcador do mapa',
|
|
196
199
|
mapZoomIn: 'Aproximar',
|
package/src/locales/zh.ts
CHANGED
|
@@ -22,6 +22,8 @@ export const zhLocale: M3Locale = {
|
|
|
22
22
|
selectedCount: '已选择',
|
|
23
23
|
recordCount: '条记录',
|
|
24
24
|
expand: '展开',
|
|
25
|
+
collapse: '收起',
|
|
26
|
+
clear: '清除',
|
|
25
27
|
columns: '列',
|
|
26
28
|
exportCsv: '导出 CSV',
|
|
27
29
|
noGroup: '无分组',
|
|
@@ -191,6 +193,7 @@ export const zhLocale: M3Locale = {
|
|
|
191
193
|
nextPage: '下一页',
|
|
192
194
|
carousel: '轮播',
|
|
193
195
|
carouselItem: '第 {index} 项,共 {count} 项', // MMap (maplibre controls)
|
|
196
|
+
sparklineSummary: '从 {first} 到 {last},最低 {min},最高 {max}',
|
|
194
197
|
mapTitle: '地图',
|
|
195
198
|
mapMarker: '地图标记',
|
|
196
199
|
mapZoomIn: '放大',
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MIcon-DLOkQduI.js","names":[],"sources":["../src/components/MIcon.vue","../src/components/MIcon.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Renders a Material Symbols Outlined glyph by name. Color follows the surrounding text color (set it with a\n * Tailwind text-* class).\n */\nwithDefaults(defineProps<{\n /** Material Symbol name (e.g. \"settings\", \"favorite\") */\n name: string\n /** Icon size in px */\n size?: number\n /** Filled glyph (the Material Symbols FILL axis), as M3 draws a selected icon */\n filled?: boolean\n}>(), { size: 24, filled: false })\n</script>\n\n<template>\n <span class=\"material-symbols-outlined leading-none\" :style=\"{ fontSize: `${size}px`, fontVariationSettings: filled ? `'FILL' 1` : undefined }\">{{\n name\n }}</span>\n</template>\n","<script setup lang=\"ts\">\n/**\n * Renders a Material Symbols Outlined glyph by name. Color follows the surrounding text color (set it with a\n * Tailwind text-* class).\n */\nwithDefaults(defineProps<{\n /** Material Symbol name (e.g. \"settings\", \"favorite\") */\n name: string\n /** Icon size in px */\n size?: number\n /** Filled glyph (the Material Symbols FILL axis), as M3 draws a selected icon */\n filled?: boolean\n}>(), { size: 24, filled: false })\n</script>\n\n<template>\n <span class=\"material-symbols-outlined leading-none\" :style=\"{ fontSize: `${size}px`, fontVariationSettings: filled ? `'FILL' 1` : undefined }\">{{\n name\n }}</span>\n</template>\n"],"mappings":";;;;;;;;;;;;;;oBAgBE,EAAA,GAAA,EAES,QAAA;GAFH,OAAM;GAA0C,OAAK,EAAA;IAAA,UAAA,GAAiB,EAAA,KAAI;IAAA,uBAA6B,EAAA,SAAM,aAAgB,KAAA;GAAS,CAAA;EAC1I,GAAA,EAAA,EAAA,IAAI,GAAA,CAAA"}
|