@m3ui-vue/m3ui-vue 0.8.6 → 0.8.7
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 +4 -0
- package/dist/{MMenuItem-BmPLAyv5.js → MMenuItem-DmrsQrK7.js} +2 -2
- package/dist/{MMenuItem-BmPLAyv5.js.map → MMenuItem-DmrsQrK7.js.map} +1 -1
- package/dist/chart.js +5 -1
- package/dist/chart.js.map +1 -1
- package/dist/code-editor.js +1 -1
- package/dist/components/MBottomSheet.vue.d.ts +3 -3
- package/dist/components/MListDetail.vue.d.ts +31 -0
- package/dist/components/MNavigationRail.vue.d.ts +6 -3
- package/dist/components/MNavigationSuite.vue.d.ts +46 -0
- package/dist/components/MShortNavigationBar.vue.d.ts +6 -1
- package/dist/components/MSideSheet.vue.d.ts +4 -4
- package/dist/components/MSupportingPane.vue.d.ts +34 -0
- package/dist/components/MTransferList.vue.d.ts +55 -34
- package/dist/components/MWindow.vue.d.ts +39 -1
- package/dist/components/_MTransferPane.vue.d.ts +10 -3
- package/dist/composables/_useItemLink.d.ts +30 -0
- package/dist/composables/_useSheetMotion.d.ts +7 -0
- package/dist/composables/useLocale.d.ts +3 -0
- package/dist/composables/useWindowSizeClass.d.ts +19 -0
- package/dist/index.d.ts +6 -0
- package/dist/locales/index.js +28 -7
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +2357 -1868
- package/dist/m3ui.js.map +1 -1
- package/dist/rich-text-editor.js +2 -2
- package/dist/styles.css +1 -1
- package/dist/{useLocale-4afAzuuP.js → useLocale-Bircp823.js} +5 -2
- package/dist/useLocale-Bircp823.js.map +1 -0
- package/package.json +1 -1
- package/src/__tests__/MChart.test.ts +28 -0
- package/src/__tests__/MShortNavigationBar.test.ts +25 -0
- package/src/__tests__/MTransferList.test.ts +73 -0
- package/src/__tests__/MWindow.test.ts +258 -0
- package/src/__tests__/adaptiveLayouts.test.ts +191 -0
- package/src/__tests__/sheets.test.ts +76 -0
- package/src/components/MBottomSheet.vue +11 -57
- package/src/components/MChart.vue +2 -1
- package/src/components/MListDetail.vue +103 -0
- package/src/components/MNavigationRail.vue +13 -8
- package/src/components/MNavigationSuite.vue +89 -0
- package/src/components/MShortNavigationBar.vue +37 -17
- package/src/components/MSideSheet.vue +11 -56
- package/src/components/MSupportingPane.vue +70 -0
- package/src/components/MTransferList.vue +43 -9
- package/src/components/MWindow.vue +507 -108
- package/src/components/_MTransferPane.vue +113 -35
- package/src/composables/_useItemLink.ts +19 -0
- package/src/composables/_useSheetMotion.ts +181 -0
- package/src/composables/useLocale.ts +7 -0
- package/src/composables/useWindowSizeClass.ts +93 -0
- package/src/index.ts +6 -0
- 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/useLocale-4afAzuuP.js.map +0 -1
package/dist/chart.js
CHANGED
|
@@ -29,7 +29,11 @@ var p = /* @__PURE__ */ i({
|
|
|
29
29
|
v.value = _();
|
|
30
30
|
}), y.observe(document.documentElement, {
|
|
31
31
|
attributes: !0,
|
|
32
|
-
attributeFilter: [
|
|
32
|
+
attributeFilter: [
|
|
33
|
+
"class",
|
|
34
|
+
"style",
|
|
35
|
+
"data-palette"
|
|
36
|
+
]
|
|
33
37
|
}), document.fonts?.ready.then(() => {
|
|
34
38
|
v.value = _();
|
|
35
39
|
});
|
package/dist/chart.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart.js","names":[],"sources":["../src/components/MChart.vue","../src/components/MChart.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, watch, onMounted, onBeforeUnmount, shallowRef, type Component } from 'vue'\n\ntype ChartType = 'line' | 'bar' | 'pie' | 'doughnut' | 'radar'\n\nconst props = withDefaults(\n defineProps<{\n type: ChartType\n data: Record<string, any>\n options?: Record<string, any>\n height?: string\n }>(),\n { height: '300px' },\n)\n\nconst ready = ref(false)\nconst chartComponent = shallowRef<Component | null>(null)\nconst componentMap = shallowRef<Record<string, Component>>({})\n\nfunction getM3Colors() {\n const style = getComputedStyle(document.documentElement)\n const get = (v: string) => style.getPropertyValue(v).trim()\n return {\n primary: get('--color-primary'),\n onSurface: get('--color-on-surface'),\n onSurfaceVariant: get('--color-on-surface-variant'),\n outlineVariant: get('--color-outline-variant'),\n surface: get('--color-surface'),\n surfaceContainer: get('--color-surface-container'),\n // Canvas can't resolve CSS vars, so pass Chart.js the resolved font stack\n fontFamily: get('--font-sans') || \"'Roboto', system-ui, sans-serif\",\n }\n}\n\nconst m3Colors = ref(getM3Colors())\n\nlet themeObserver: MutationObserver | null = null\n\nonMounted(async () => {\n m3Colors.value = getM3Colors()\n\n themeObserver = new MutationObserver(() => { m3Colors.value = getM3Colors() })\n themeObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['class', 'style'] })\n // Canvas text drawn before a web font finishes loading keeps the fallback, so redraw once it has\n document.fonts?.ready.then(() => { m3Colors.value = getM3Colors() })\n\n const [chartjs, vueChartjs] = await Promise.all([\n import('chart.js'),\n import('vue-chartjs'),\n ])\n\n chartjs.Chart.register(\n chartjs.CategoryScale,\n chartjs.LinearScale,\n chartjs.PointElement,\n chartjs.LineElement,\n chartjs.BarElement,\n chartjs.ArcElement,\n chartjs.RadialLinearScale,\n chartjs.Filler,\n chartjs.Tooltip,\n chartjs.Legend,\n chartjs.Title,\n )\n\n componentMap.value = {\n line: vueChartjs.Line,\n bar: vueChartjs.Bar,\n pie: vueChartjs.Pie,\n doughnut: vueChartjs.Doughnut,\n radar: vueChartjs.Radar,\n }\n\n ready.value = true\n})\n\nonBeforeUnmount(() => { themeObserver?.disconnect() })\n\nwatch(() => props.type, () => {\n if (ready.value) chartComponent.value = componentMap.value[props.type] ?? null\n}, { immediate: true })\n\nwatch(ready, () => {\n chartComponent.value = componentMap.value[props.type] ?? null\n})\n\nconst mergedOptions = computed<Record<string, any>>(() => {\n const c = m3Colors.value\n const base: Record<string, any> = {\n responsive: true,\n maintainAspectRatio: false,\n plugins: {\n legend: {\n labels: {\n color: c.onSurface,\n font: { family: c.fontFamily, size: 12 },\n usePointStyle: true,\n pointStyle: 'circle',\n padding: 16,\n },\n },\n tooltip: {\n backgroundColor: c.surfaceContainer,\n titleColor: c.onSurface,\n bodyColor: c.onSurfaceVariant,\n borderColor: c.outlineVariant,\n borderWidth: 1,\n cornerRadius: 12,\n padding: 12,\n titleFont: { family: c.fontFamily, size: 13, weight: '600' as const },\n bodyFont: { family: c.fontFamily, size: 12 },\n displayColors: true,\n boxPadding: 4,\n },\n },\n }\n\n if (props.type !== 'pie' && props.type !== 'doughnut') {\n base.scales = {\n x: {\n grid: { color: c.outlineVariant + '40', drawTicks: false },\n ticks: { color: c.onSurfaceVariant, font: { family: c.fontFamily, size: 11 }, padding: 8 },\n border: { color: c.outlineVariant },\n },\n y: {\n grid: { color: c.outlineVariant + '40', drawTicks: false },\n ticks: { color: c.onSurfaceVariant, font: { family: c.fontFamily, size: 11 }, padding: 8 },\n border: { color: c.outlineVariant },\n },\n }\n }\n\n if (props.type === 'radar') {\n base.scales = {\n r: {\n grid: { color: c.outlineVariant + '40' },\n angleLines: { color: c.outlineVariant + '40' },\n pointLabels: { color: c.onSurfaceVariant, font: { family: c.fontFamily, size: 11 } },\n ticks: { color: c.onSurfaceVariant, backdropColor: 'transparent', font: { family: c.fontFamily } },\n },\n }\n }\n\n return deepMerge(base, props.options ?? {})\n})\n\nfunction deepMerge(target: any, source: any): any {\n const output = { ...target }\n for (const key of Object.keys(source)) {\n if (source[key] && typeof source[key] === 'object' && !Array.isArray(source[key])) {\n output[key] = deepMerge(target[key] ?? {}, source[key])\n } else {\n output[key] = source[key]\n }\n }\n return output\n}\n</script>\n\n<template>\n <div class=\"rounded-lg border border-outline-variant bg-surface p-4\" :style=\"{ height }\">\n <component\n v-if=\"ready && chartComponent\"\n :is=\"chartComponent\"\n :data=\"data\"\n :options=\"mergedOptions\"\n />\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref, watch, onMounted, onBeforeUnmount, shallowRef, type Component } from 'vue'\n\ntype ChartType = 'line' | 'bar' | 'pie' | 'doughnut' | 'radar'\n\nconst props = withDefaults(\n defineProps<{\n type: ChartType\n data: Record<string, any>\n options?: Record<string, any>\n height?: string\n }>(),\n { height: '300px' },\n)\n\nconst ready = ref(false)\nconst chartComponent = shallowRef<Component | null>(null)\nconst componentMap = shallowRef<Record<string, Component>>({})\n\nfunction getM3Colors() {\n const style = getComputedStyle(document.documentElement)\n const get = (v: string) => style.getPropertyValue(v).trim()\n return {\n primary: get('--color-primary'),\n onSurface: get('--color-on-surface'),\n onSurfaceVariant: get('--color-on-surface-variant'),\n outlineVariant: get('--color-outline-variant'),\n surface: get('--color-surface'),\n surfaceContainer: get('--color-surface-container'),\n // Canvas can't resolve CSS vars, so pass Chart.js the resolved font stack\n fontFamily: get('--font-sans') || \"'Roboto', system-ui, sans-serif\",\n }\n}\n\nconst m3Colors = ref(getM3Colors())\n\nlet themeObserver: MutationObserver | null = null\n\nonMounted(async () => {\n m3Colors.value = getM3Colors()\n\n themeObserver = new MutationObserver(() => { m3Colors.value = getM3Colors() })\n themeObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['class', 'style'] })\n // Canvas text drawn before a web font finishes loading keeps the fallback, so redraw once it has\n document.fonts?.ready.then(() => { m3Colors.value = getM3Colors() })\n\n const [chartjs, vueChartjs] = await Promise.all([\n import('chart.js'),\n import('vue-chartjs'),\n ])\n\n chartjs.Chart.register(\n chartjs.CategoryScale,\n chartjs.LinearScale,\n chartjs.PointElement,\n chartjs.LineElement,\n chartjs.BarElement,\n chartjs.ArcElement,\n chartjs.RadialLinearScale,\n chartjs.Filler,\n chartjs.Tooltip,\n chartjs.Legend,\n chartjs.Title,\n )\n\n componentMap.value = {\n line: vueChartjs.Line,\n bar: vueChartjs.Bar,\n pie: vueChartjs.Pie,\n doughnut: vueChartjs.Doughnut,\n radar: vueChartjs.Radar,\n }\n\n ready.value = true\n})\n\nonBeforeUnmount(() => { themeObserver?.disconnect() })\n\nwatch(() => props.type, () => {\n if (ready.value) chartComponent.value = componentMap.value[props.type] ?? null\n}, { immediate: true })\n\nwatch(ready, () => {\n chartComponent.value = componentMap.value[props.type] ?? null\n})\n\nconst mergedOptions = computed<Record<string, any>>(() => {\n const c = m3Colors.value\n const base: Record<string, any> = {\n responsive: true,\n maintainAspectRatio: false,\n plugins: {\n legend: {\n labels: {\n color: c.onSurface,\n font: { family: c.fontFamily, size: 12 },\n usePointStyle: true,\n pointStyle: 'circle',\n padding: 16,\n },\n },\n tooltip: {\n backgroundColor: c.surfaceContainer,\n titleColor: c.onSurface,\n bodyColor: c.onSurfaceVariant,\n borderColor: c.outlineVariant,\n borderWidth: 1,\n cornerRadius: 12,\n padding: 12,\n titleFont: { family: c.fontFamily, size: 13, weight: '600' as const },\n bodyFont: { family: c.fontFamily, size: 12 },\n displayColors: true,\n boxPadding: 4,\n },\n },\n }\n\n if (props.type !== 'pie' && props.type !== 'doughnut') {\n base.scales = {\n x: {\n grid: { color: c.outlineVariant + '40', drawTicks: false },\n ticks: { color: c.onSurfaceVariant, font: { family: c.fontFamily, size: 11 }, padding: 8 },\n border: { color: c.outlineVariant },\n },\n y: {\n grid: { color: c.outlineVariant + '40', drawTicks: false },\n ticks: { color: c.onSurfaceVariant, font: { family: c.fontFamily, size: 11 }, padding: 8 },\n border: { color: c.outlineVariant },\n },\n }\n }\n\n if (props.type === 'radar') {\n base.scales = {\n r: {\n grid: { color: c.outlineVariant + '40' },\n angleLines: { color: c.outlineVariant + '40' },\n pointLabels: { color: c.onSurfaceVariant, font: { family: c.fontFamily, size: 11 } },\n ticks: { color: c.onSurfaceVariant, backdropColor: 'transparent', font: { family: c.fontFamily } },\n },\n }\n }\n\n return deepMerge(base, props.options ?? {})\n})\n\nfunction deepMerge(target: any, source: any): any {\n const output = { ...target }\n for (const key of Object.keys(source)) {\n if (source[key] && typeof source[key] === 'object' && !Array.isArray(source[key])) {\n output[key] = deepMerge(target[key] ?? {}, source[key])\n } else {\n output[key] = source[key]\n }\n }\n return output\n}\n</script>\n\n<template>\n <div class=\"rounded-lg border border-outline-variant bg-surface p-4\" :style=\"{ height }\">\n <component\n v-if=\"ready && chartComponent\"\n :is=\"chartComponent\"\n :data=\"data\"\n :options=\"mergedOptions\"\n />\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;EAKA,IAAM,IAAQ,GAUR,IAAQ,EAAI,EAAK,GACjB,IAAiB,EAA6B,IAAI,GAClD,IAAe,EAAsC,CAAC,CAAC;EAE7D,SAAS,IAAc;GACrB,IAAM,IAAQ,iBAAiB,SAAS,eAAe,GACjD,KAAO,MAAc,EAAM,iBAAiB,CAAC,CAAC,CAAC,KAAK;GAC1D,OAAO;IACL,SAAS,EAAI,iBAAiB;IAC9B,WAAW,EAAI,oBAAoB;IACnC,kBAAkB,EAAI,4BAA4B;IAClD,gBAAgB,EAAI,yBAAyB;IAC7C,SAAS,EAAI,iBAAiB;IAC9B,kBAAkB,EAAI,2BAA2B;IAEjD,YAAY,EAAI,aAAa,KAAK;GACpC;EACF;EAEA,IAAM,IAAW,EAAI,EAAY,CAAC,GAE9B,IAAyC;EA8C7C,AA5CA,EAAU,YAAY;GAMpB,AALA,EAAS,QAAQ,EAAY,GAE7B,IAAgB,IAAI,uBAAuB;IAAE,EAAS,QAAQ,EAAY;GAAE,CAAC,GAC7E,EAAc,QAAQ,SAAS,iBAAiB;IAAE,YAAY;IAAM,iBAAiB,CAAC,SAAS,OAAO;GAAE,CAAC,GAEzG,SAAS,OAAO,MAAM,WAAW;IAAE,EAAS,QAAQ,EAAY;GAAE,CAAC;GAEnE,IAAM,CAAC,GAAS,KAAc,MAAM,QAAQ,IAAI,CAC9C,OAAO,aACP,OAAO,cACT,CAAC;GAwBD,AAtBA,EAAQ,MA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esContent":["<script setup lang=\"ts\">\nimport { computed, ref, watch, onMounted, onBeforeUnmount, shallowRef, type Component } from 'vue'\n\ntype ChartType = 'line' | 'bar' | 'pie' | 'doughnut' | 'radar'\n\nconst props = withDefaults(\n defineProps<{\n type: ChartType\n data: Record<string, any>\n options?: Record<string, any>\n height?: string\n }>(),\n { height: '300px' },\n)\n\nconst ready = ref(false)\nconst chartComponent = shallowRef<Component | null>(null)\nconst componentMap = shallowRef<Record<string, Component>>({})\n\nfunction getM3Colors() {\n const style = getComputedStyle(document.documentElement)\n const get = (v: string) => style.getPropertyValue(v).trim()\n return {\n primary: get('--color-primary'),\n onSurface: get('--color-on-surface'),\n onSurfaceVariant: get('--color-on-surface-variant'),\n outlineVariant: get('--color-outline-variant'),\n surface: get('--color-surface'),\n surfaceContainer: get('--color-surface-container'),\n // Canvas can't resolve CSS vars, so pass Chart.js the resolved font stack\n fontFamily: get('--font-sans') || \"'Roboto', system-ui, sans-serif\",\n }\n}\n\nconst m3Colors = ref(getM3Colors())\n\nlet themeObserver: MutationObserver | null = null\n\nonMounted(async () => {\n m3Colors.value = getM3Colors()\n\n themeObserver = new MutationObserver(() => { m3Colors.value = getM3Colors() })\n // `class` flips light/dark, `data-palette` switches the palette (useColorPalette / createM3UI).\n themeObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['class', 'style', 'data-palette'] })\n // Canvas text drawn before a web font finishes loading keeps the fallback, so redraw once it has\n document.fonts?.ready.then(() => { m3Colors.value = getM3Colors() })\n\n const [chartjs, vueChartjs] = await Promise.all([\n import('chart.js'),\n import('vue-chartjs'),\n ])\n\n chartjs.Chart.register(\n chartjs.CategoryScale,\n chartjs.LinearScale,\n chartjs.PointElement,\n chartjs.LineElement,\n chartjs.BarElement,\n chartjs.ArcElement,\n chartjs.RadialLinearScale,\n chartjs.Filler,\n chartjs.Tooltip,\n chartjs.Legend,\n chartjs.Title,\n )\n\n componentMap.value = {\n line: vueChartjs.Line,\n bar: vueChartjs.Bar,\n pie: vueChartjs.Pie,\n doughnut: vueChartjs.Doughnut,\n radar: vueChartjs.Radar,\n }\n\n ready.value = true\n})\n\nonBeforeUnmount(() => { themeObserver?.disconnect() })\n\nwatch(() => props.type, () => {\n if (ready.value) chartComponent.value = componentMap.value[props.type] ?? null\n}, { immediate: true })\n\nwatch(ready, () => {\n chartComponent.value = componentMap.value[props.type] ?? null\n})\n\nconst mergedOptions = computed<Record<string, any>>(() => {\n const c = m3Colors.value\n const base: Record<string, any> = {\n responsive: true,\n maintainAspectRatio: false,\n plugins: {\n legend: {\n labels: {\n color: c.onSurface,\n font: { family: c.fontFamily, size: 12 },\n usePointStyle: true,\n pointStyle: 'circle',\n padding: 16,\n },\n },\n tooltip: {\n backgroundColor: c.surfaceContainer,\n titleColor: c.onSurface,\n bodyColor: c.onSurfaceVariant,\n borderColor: c.outlineVariant,\n borderWidth: 1,\n cornerRadius: 12,\n padding: 12,\n titleFont: { family: c.fontFamily, size: 13, weight: '600' as const },\n bodyFont: { family: c.fontFamily, size: 12 },\n displayColors: true,\n boxPadding: 4,\n },\n },\n }\n\n if (props.type !== 'pie' && props.type !== 'doughnut') {\n base.scales = {\n x: {\n grid: { color: c.outlineVariant + '40', drawTicks: false },\n ticks: { color: c.onSurfaceVariant, font: { family: c.fontFamily, size: 11 }, padding: 8 },\n border: { color: c.outlineVariant },\n },\n y: {\n grid: { color: c.outlineVariant + '40', drawTicks: false },\n ticks: { color: c.onSurfaceVariant, font: { family: c.fontFamily, size: 11 }, padding: 8 },\n border: { color: c.outlineVariant },\n },\n }\n }\n\n if (props.type === 'radar') {\n base.scales = {\n r: {\n grid: { color: c.outlineVariant + '40' },\n angleLines: { color: c.outlineVariant + '40' },\n pointLabels: { color: c.onSurfaceVariant, font: { family: c.fontFamily, size: 11 } },\n ticks: { color: c.onSurfaceVariant, backdropColor: 'transparent', font: { family: c.fontFamily } },\n },\n }\n }\n\n return deepMerge(base, props.options ?? {})\n})\n\nfunction deepMerge(target: any, source: any): any {\n const output = { ...target }\n for (const key of Object.keys(source)) {\n if (source[key] && typeof source[key] === 'object' && !Array.isArray(source[key])) {\n output[key] = deepMerge(target[key] ?? {}, source[key])\n } else {\n output[key] = source[key]\n }\n }\n return output\n}\n</script>\n\n<template>\n <div class=\"rounded-lg border border-outline-variant bg-surface p-4\" :style=\"{ height }\">\n <component\n v-if=\"ready && chartComponent\"\n :is=\"chartComponent\"\n :data=\"data\"\n :options=\"mergedOptions\"\n />\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref, watch, onMounted, onBeforeUnmount, shallowRef, type Component } from 'vue'\n\ntype ChartType = 'line' | 'bar' | 'pie' | 'doughnut' | 'radar'\n\nconst props = withDefaults(\n defineProps<{\n type: ChartType\n data: Record<string, any>\n options?: Record<string, any>\n height?: string\n }>(),\n { height: '300px' },\n)\n\nconst ready = ref(false)\nconst chartComponent = shallowRef<Component | null>(null)\nconst componentMap = shallowRef<Record<string, Component>>({})\n\nfunction getM3Colors() {\n const style = getComputedStyle(document.documentElement)\n const get = (v: string) => style.getPropertyValue(v).trim()\n return {\n primary: get('--color-primary'),\n onSurface: get('--color-on-surface'),\n onSurfaceVariant: get('--color-on-surface-variant'),\n outlineVariant: get('--color-outline-variant'),\n surface: get('--color-surface'),\n surfaceContainer: get('--color-surface-container'),\n // Canvas can't resolve CSS vars, so pass Chart.js the resolved font stack\n fontFamily: get('--font-sans') || \"'Roboto', system-ui, sans-serif\",\n }\n}\n\nconst m3Colors = ref(getM3Colors())\n\nlet themeObserver: MutationObserver | null = null\n\nonMounted(async () => {\n m3Colors.value = getM3Colors()\n\n themeObserver = new MutationObserver(() => { m3Colors.value = getM3Colors() })\n // `class` flips light/dark, `data-palette` switches the palette (useColorPalette / createM3UI).\n themeObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['class', 'style', 'data-palette'] })\n // Canvas text drawn before a web font finishes loading keeps the fallback, so redraw once it has\n document.fonts?.ready.then(() => { m3Colors.value = getM3Colors() })\n\n const [chartjs, vueChartjs] = await Promise.all([\n import('chart.js'),\n import('vue-chartjs'),\n ])\n\n chartjs.Chart.register(\n chartjs.CategoryScale,\n chartjs.LinearScale,\n chartjs.PointElement,\n chartjs.LineElement,\n chartjs.BarElement,\n chartjs.ArcElement,\n chartjs.RadialLinearScale,\n chartjs.Filler,\n chartjs.Tooltip,\n chartjs.Legend,\n chartjs.Title,\n )\n\n componentMap.value = {\n line: vueChartjs.Line,\n bar: vueChartjs.Bar,\n pie: vueChartjs.Pie,\n doughnut: vueChartjs.Doughnut,\n radar: vueChartjs.Radar,\n }\n\n ready.value = true\n})\n\nonBeforeUnmount(() => { themeObserver?.disconnect() })\n\nwatch(() => props.type, () => {\n if (ready.value) chartComponent.value = componentMap.value[props.type] ?? null\n}, { immediate: true })\n\nwatch(ready, () => {\n chartComponent.value = componentMap.value[props.type] ?? null\n})\n\nconst mergedOptions = computed<Record<string, any>>(() => {\n const c = m3Colors.value\n const base: Record<string, any> = {\n responsive: true,\n maintainAspectRatio: false,\n plugins: {\n legend: {\n labels: {\n color: c.onSurface,\n font: { family: c.fontFamily, size: 12 },\n usePointStyle: true,\n pointStyle: 'circle',\n padding: 16,\n },\n },\n tooltip: {\n backgroundColor: c.surfaceContainer,\n titleColor: c.onSurface,\n bodyColor: c.onSurfaceVariant,\n borderColor: c.outlineVariant,\n borderWidth: 1,\n cornerRadius: 12,\n padding: 12,\n titleFont: { family: c.fontFamily, size: 13, weight: '600' as const },\n bodyFont: { family: c.fontFamily, size: 12 },\n displayColors: true,\n boxPadding: 4,\n },\n },\n }\n\n if (props.type !== 'pie' && props.type !== 'doughnut') {\n base.scales = {\n x: {\n grid: { color: c.outlineVariant + '40', drawTicks: false },\n ticks: { color: c.onSurfaceVariant, font: { family: c.fontFamily, size: 11 }, padding: 8 },\n border: { color: c.outlineVariant },\n },\n y: {\n grid: { color: c.outlineVariant + '40', drawTicks: false },\n ticks: { color: c.onSurfaceVariant, font: { family: c.fontFamily, size: 11 }, padding: 8 },\n border: { color: c.outlineVariant },\n },\n }\n }\n\n if (props.type === 'radar') {\n base.scales = {\n r: {\n grid: { color: c.outlineVariant + '40' },\n angleLines: { color: c.outlineVariant + '40' },\n pointLabels: { color: c.onSurfaceVariant, font: { family: c.fontFamily, size: 11 } },\n ticks: { color: c.onSurfaceVariant, backdropColor: 'transparent', font: { family: c.fontFamily } },\n },\n }\n }\n\n return deepMerge(base, props.options ?? {})\n})\n\nfunction deepMerge(target: any, source: any): any {\n const output = { ...target }\n for (const key of Object.keys(source)) {\n if (source[key] && typeof source[key] === 'object' && !Array.isArray(source[key])) {\n output[key] = deepMerge(target[key] ?? {}, source[key])\n } else {\n output[key] = source[key]\n }\n }\n return output\n}\n</script>\n\n<template>\n <div class=\"rounded-lg border border-outline-variant bg-surface p-4\" :style=\"{ height }\">\n <component\n v-if=\"ready && chartComponent\"\n :is=\"chartComponent\"\n :data=\"data\"\n :options=\"mergedOptions\"\n />\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;EAKA,IAAM,IAAQ,GAUR,IAAQ,EAAI,EAAK,GACjB,IAAiB,EAA6B,IAAI,GAClD,IAAe,EAAsC,CAAC,CAAC;EAE7D,SAAS,IAAc;GACrB,IAAM,IAAQ,iBAAiB,SAAS,eAAe,GACjD,KAAO,MAAc,EAAM,iBAAiB,CAAC,CAAC,CAAC,KAAK;GAC1D,OAAO;IACL,SAAS,EAAI,iBAAiB;IAC9B,WAAW,EAAI,oBAAoB;IACnC,kBAAkB,EAAI,4BAA4B;IAClD,gBAAgB,EAAI,yBAAyB;IAC7C,SAAS,EAAI,iBAAiB;IAC9B,kBAAkB,EAAI,2BAA2B;IAEjD,YAAY,EAAI,aAAa,KAAK;GACpC;EACF;EAEA,IAAM,IAAW,EAAI,EAAY,CAAC,GAE9B,IAAyC;EA+C7C,AA7CA,EAAU,YAAY;GAOpB,AANA,EAAS,QAAQ,EAAY,GAE7B,IAAgB,IAAI,uBAAuB;IAAE,EAAS,QAAQ,EAAY;GAAE,CAAC,GAE7E,EAAc,QAA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PD,OAAM;GAA2D,OAAK,EAAA,EAAA,QAAI,EAAA,OAAM,CAAA;EAE3E,GAAA,CAAA,EAAA,SAAS,EAAA,SADjB,EAAA,GAAA,EAKE,EAHK,EAAA,KAAc,GAAA;;GAClB,MAAM,EAAA;GACN,SAAS,EAAA"}
|
package/dist/code-editor.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as e } from "./useLocale-
|
|
1
|
+
import { r as e } from "./useLocale-Bircp823.js";
|
|
2
2
|
import { t } from "./MIcon-CaEooCmZ.js";
|
|
3
3
|
import { t as n } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
4
4
|
import { computed as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, normalizeClass as u, normalizeStyle as d, onBeforeUnmount as f, onMounted as p, openBlock as m, ref as h, renderSlot as g, toDisplayString as _, watch as v, withCtx as y } from "vue";
|
|
@@ -3,11 +3,11 @@ type __VLS_Props = {
|
|
|
3
3
|
title?: string;
|
|
4
4
|
fullHeight?: boolean;
|
|
5
5
|
};
|
|
6
|
-
declare var
|
|
6
|
+
declare var __VLS_21: {}, __VLS_23: {};
|
|
7
7
|
type __VLS_Slots = {} & {
|
|
8
|
-
default?: (props: typeof
|
|
8
|
+
default?: (props: typeof __VLS_21) => any;
|
|
9
9
|
} & {
|
|
10
|
-
actions?: (props: typeof
|
|
10
|
+
actions?: (props: typeof __VLS_23) => any;
|
|
11
11
|
};
|
|
12
12
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
13
|
"update:modelValue": (args_0: boolean) => any;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** Whether the detail is the current destination. One-pane layouts show it instead of the list. */
|
|
3
|
+
showDetail?: boolean;
|
|
4
|
+
/** List pane width in the two-pane layout. Defaults to M3's 360px (412px from the large width class). */
|
|
5
|
+
listWidth?: string;
|
|
6
|
+
};
|
|
7
|
+
type __VLS_Slots = {
|
|
8
|
+
list?: (props: {
|
|
9
|
+
twoPane: boolean;
|
|
10
|
+
}) => unknown;
|
|
11
|
+
/** `back()` returns to the list (sets `showDetail` to false). */
|
|
12
|
+
detail?: (props: {
|
|
13
|
+
twoPane: boolean;
|
|
14
|
+
back: () => void;
|
|
15
|
+
}) => unknown;
|
|
16
|
+
};
|
|
17
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
|
+
"update:showDetail": (args_0: boolean) => any;
|
|
19
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
20
|
+
"onUpdate:showDetail"?: ((args_0: boolean) => any) | undefined;
|
|
21
|
+
}>, {
|
|
22
|
+
showDetail: boolean;
|
|
23
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
25
|
+
declare const _default: typeof __VLS_export;
|
|
26
|
+
export default _default;
|
|
27
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
28
|
+
new (): {
|
|
29
|
+
$slots: S;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ItemLink } from '../composables/_useItemLink';
|
|
1
2
|
export interface NavRailItem {
|
|
2
3
|
value: string | number;
|
|
3
4
|
label: string;
|
|
@@ -5,6 +6,8 @@ export interface NavRailItem {
|
|
|
5
6
|
badge?: number;
|
|
6
7
|
badgeDot?: boolean;
|
|
7
8
|
disabled?: boolean;
|
|
9
|
+
/** Makes the item a link: a vue-router location (rendered as RouterLink), or a URL without vue-router. */
|
|
10
|
+
to?: ItemLink;
|
|
8
11
|
}
|
|
9
12
|
type __VLS_Props = {
|
|
10
13
|
modelValue: string | number;
|
|
@@ -21,11 +24,11 @@ type __VLS_Props = {
|
|
|
21
24
|
*/
|
|
22
25
|
modal?: boolean;
|
|
23
26
|
};
|
|
24
|
-
declare var __VLS_1: {},
|
|
27
|
+
declare var __VLS_1: {}, __VLS_53: {};
|
|
25
28
|
type __VLS_Slots = {} & {
|
|
26
29
|
fab?: (props: typeof __VLS_1) => any;
|
|
27
30
|
} & {
|
|
28
|
-
fab?: (props: typeof
|
|
31
|
+
fab?: (props: typeof __VLS_53) => any;
|
|
29
32
|
};
|
|
30
33
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
31
34
|
"update:modelValue": (args_0: string | number) => any;
|
|
@@ -34,8 +37,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
34
37
|
"onUpdate:modelValue"?: ((args_0: string | number) => any) | undefined;
|
|
35
38
|
"onUpdate:expanded"?: ((args_0: boolean) => any) | undefined;
|
|
36
39
|
}>, {
|
|
37
|
-
modal: boolean;
|
|
38
40
|
expanded: boolean;
|
|
41
|
+
modal: boolean;
|
|
39
42
|
alignment: "top" | "center" | "bottom";
|
|
40
43
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
41
44
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ItemLink } from '../composables/_useItemLink';
|
|
2
|
+
export interface NavigationSuiteItem {
|
|
3
|
+
value: string | number;
|
|
4
|
+
label: string;
|
|
5
|
+
icon: string;
|
|
6
|
+
badge?: number;
|
|
7
|
+
badgeDot?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
/** Makes the item a link: a vue-router location (rendered as RouterLink), or a URL without vue-router. */
|
|
10
|
+
to?: ItemLink;
|
|
11
|
+
}
|
|
12
|
+
/** The navigation component in use: a short bar (icons over labels, or beside them), or a rail. */
|
|
13
|
+
export type NavigationSuiteLayout = 'bar' | 'bar-medium' | 'rail' | 'rail-expanded' | 'none';
|
|
14
|
+
type __VLS_Props = {
|
|
15
|
+
modelValue: string | number;
|
|
16
|
+
items: NavigationSuiteItem[];
|
|
17
|
+
/**
|
|
18
|
+
* 'auto' picks by the component's own size, as M3's NavigationSuiteScaffold does
|
|
19
|
+
* (`navigationSuiteType`): compact width → short bar; compact height (a phone in landscape)
|
|
20
|
+
* → short bar with icons beside labels; anything else → collapsed rail. Set it to force one.
|
|
21
|
+
*/
|
|
22
|
+
layout?: 'auto' | NavigationSuiteLayout;
|
|
23
|
+
};
|
|
24
|
+
type __VLS_Slots = {
|
|
25
|
+
/** The app's content. Scrolls on its own, next to or above the navigation. */
|
|
26
|
+
default?: (props: {
|
|
27
|
+
layout: NavigationSuiteLayout;
|
|
28
|
+
}) => unknown;
|
|
29
|
+
/** Primary action (e.g. a FAB): the rail's header, or floating above the bar at the bottom end. */
|
|
30
|
+
fab?: () => unknown;
|
|
31
|
+
};
|
|
32
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
33
|
+
"update:modelValue": (args_0: string | number) => any;
|
|
34
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
35
|
+
"onUpdate:modelValue"?: ((args_0: string | number) => any) | undefined;
|
|
36
|
+
}>, {
|
|
37
|
+
layout: "auto" | NavigationSuiteLayout;
|
|
38
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
39
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
40
|
+
declare const _default: typeof __VLS_export;
|
|
41
|
+
export default _default;
|
|
42
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
43
|
+
new (): {
|
|
44
|
+
$slots: S;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import { type ItemLink } from '../composables/_useItemLink';
|
|
1
2
|
export interface ShortNavBarItem {
|
|
2
3
|
value: string | number;
|
|
3
4
|
label: string;
|
|
4
5
|
icon: string;
|
|
5
6
|
badge?: number;
|
|
6
7
|
badgeDot?: boolean;
|
|
8
|
+
/** Not selectable: icon and label at 38% of the unselected color, no hover. */
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/** Makes the item a link: a vue-router location (rendered as RouterLink), or a URL without vue-router. */
|
|
11
|
+
to?: ItemLink;
|
|
7
12
|
}
|
|
8
13
|
type __VLS_Props = {
|
|
9
14
|
modelValue: string | number;
|
|
@@ -27,8 +32,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
27
32
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
28
33
|
"onUpdate:modelValue"?: ((args_0: string | number) => any) | undefined;
|
|
29
34
|
}>, {
|
|
30
|
-
iconPosition: "top" | "start";
|
|
31
35
|
arrangement: "equal" | "centered";
|
|
36
|
+
iconPosition: "top" | "start";
|
|
32
37
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
33
38
|
declare const _default: typeof __VLS_export;
|
|
34
39
|
export default _default;
|
|
@@ -3,13 +3,13 @@ type __VLS_Props = {
|
|
|
3
3
|
title?: string;
|
|
4
4
|
width?: string;
|
|
5
5
|
};
|
|
6
|
-
declare var
|
|
6
|
+
declare var __VLS_16: {}, __VLS_23: {}, __VLS_25: {};
|
|
7
7
|
type __VLS_Slots = {} & {
|
|
8
|
-
header?: (props: typeof
|
|
8
|
+
header?: (props: typeof __VLS_16) => any;
|
|
9
9
|
} & {
|
|
10
|
-
default?: (props: typeof
|
|
10
|
+
default?: (props: typeof __VLS_23) => any;
|
|
11
11
|
} & {
|
|
12
|
-
actions?: (props: typeof
|
|
12
|
+
actions?: (props: typeof __VLS_25) => any;
|
|
13
13
|
};
|
|
14
14
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
15
|
"update:modelValue": (args_0: boolean) => any;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** Where the supporting pane goes when there's room for only one pane. */
|
|
3
|
+
singlePane?: 'below' | 'sheet';
|
|
4
|
+
/** With `singlePane="sheet"`: whether the sheet is open (v-model:open). */
|
|
5
|
+
open?: boolean;
|
|
6
|
+
/** With `singlePane="sheet"`: the sheet's title. */
|
|
7
|
+
sheetTitle?: string;
|
|
8
|
+
/** Supporting pane width in the two-pane layout. Defaults to M3's 360px (412px from the large width class). */
|
|
9
|
+
supportingWidth?: string;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_Slots = {
|
|
12
|
+
main?: (props: {
|
|
13
|
+
twoPane: boolean;
|
|
14
|
+
}) => unknown;
|
|
15
|
+
supporting?: (props: {
|
|
16
|
+
twoPane: boolean;
|
|
17
|
+
}) => unknown;
|
|
18
|
+
};
|
|
19
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
|
+
"update:open": (args_0: boolean) => any;
|
|
21
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
22
|
+
"onUpdate:open"?: ((args_0: boolean) => any) | undefined;
|
|
23
|
+
}>, {
|
|
24
|
+
open: boolean;
|
|
25
|
+
singlePane: "below" | "sheet";
|
|
26
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
28
|
+
declare const _default: typeof __VLS_export;
|
|
29
|
+
export default _default;
|
|
30
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
31
|
+
new (): {
|
|
32
|
+
$slots: S;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -5,41 +5,62 @@ export interface TransferItem {
|
|
|
5
5
|
/** Optional second line under the label (an email, a role, a short description). */
|
|
6
6
|
description?: string;
|
|
7
7
|
}
|
|
8
|
-
type Value = string | number;
|
|
9
|
-
type __VLS_Props = {
|
|
10
|
-
modelValue: Value[];
|
|
11
|
-
items: TransferItem[];
|
|
12
|
-
sourceTitle?: string;
|
|
13
|
-
targetTitle?: string;
|
|
14
|
-
filterable?: boolean;
|
|
15
|
-
searchPlaceholder?: string;
|
|
16
|
-
emptyText?: string;
|
|
17
|
-
moveAllRightLabel?: string;
|
|
18
|
-
moveRightLabel?: string;
|
|
19
|
-
moveLeftLabel?: string;
|
|
20
|
-
moveAllLeftLabel?: string;
|
|
21
|
-
/** Height of each list's scroll area (any CSS length). */
|
|
22
|
-
listHeight?: string;
|
|
23
|
-
};
|
|
24
|
-
declare var __VLS_13: {}, __VLS_55: {};
|
|
25
|
-
type __VLS_Slots = {} & {
|
|
26
|
-
'source-empty'?: (props: typeof __VLS_13) => any;
|
|
27
|
-
} & {
|
|
28
|
-
'target-empty'?: (props: typeof __VLS_55) => any;
|
|
29
|
-
};
|
|
30
|
-
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
31
|
-
"update:modelValue": (args_0: Value[]) => any;
|
|
32
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
33
|
-
"onUpdate:modelValue"?: ((args_0: Value[]) => any) | undefined;
|
|
34
|
-
}>, {
|
|
35
|
-
filterable: boolean;
|
|
36
|
-
listHeight: string;
|
|
37
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
38
|
-
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
39
8
|
declare const _default: typeof __VLS_export;
|
|
40
9
|
export default _default;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
10
|
+
declare const __VLS_export: <T extends TransferItem = TransferItem>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
11
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<{
|
|
12
|
+
modelValue: (string | number)[];
|
|
13
|
+
items: T[];
|
|
14
|
+
sourceTitle?: string;
|
|
15
|
+
targetTitle?: string;
|
|
16
|
+
filterable?: boolean;
|
|
17
|
+
searchPlaceholder?: string;
|
|
18
|
+
emptyText?: string;
|
|
19
|
+
moveAllRightLabel?: string;
|
|
20
|
+
moveRightLabel?: string;
|
|
21
|
+
moveLeftLabel?: string;
|
|
22
|
+
moveAllLeftLabel?: string;
|
|
23
|
+
/** Height of each list's scroll area (any CSS length). */
|
|
24
|
+
listHeight?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Fully custom rows: the `#item` slot draws the whole row (no checkbox, padding, min height
|
|
27
|
+
* or background). The row stays clickable, focusable (Space checks it, Enter moves it) and
|
|
28
|
+
* animated; use the slot's `checked` to style the checked state.
|
|
29
|
+
*/
|
|
30
|
+
bare?: boolean;
|
|
31
|
+
} & {
|
|
32
|
+
"onUpdate:modelValue"?: ((args_0: (string | number)[]) => any) | undefined;
|
|
33
|
+
}> & (typeof globalThis extends {
|
|
34
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
35
|
+
} ? P : {});
|
|
36
|
+
expose: (exposed: {}) => void;
|
|
37
|
+
attrs: any;
|
|
38
|
+
slots: {
|
|
39
|
+
/**
|
|
40
|
+
* Custom row content. Without `bare` it replaces the icon and text, keeping the checkbox,
|
|
41
|
+
* highlight and hover. Buttons, links, fields and `[data-transfer-action]` elements inside
|
|
42
|
+
* keep their own clicks instead of checking the row.
|
|
43
|
+
*/
|
|
44
|
+
item?: (props: {
|
|
45
|
+
/** Your item, with any extra fields it carries. */
|
|
46
|
+
item: T;
|
|
47
|
+
checked: boolean;
|
|
48
|
+
/** Which pane the row is in. */
|
|
49
|
+
side: "source" | "target";
|
|
50
|
+
/** Check or uncheck the row. */
|
|
51
|
+
toggle: () => void;
|
|
52
|
+
/** Send just this row to the other pane. */
|
|
53
|
+
move: () => void;
|
|
54
|
+
}) => unknown;
|
|
55
|
+
'source-empty'?: () => unknown;
|
|
56
|
+
'target-empty'?: () => unknown;
|
|
44
57
|
};
|
|
58
|
+
emit: (evt: "update:modelValue", args_0: (string | number)[]) => void;
|
|
59
|
+
}>) => import("vue").VNode & {
|
|
60
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
45
61
|
};
|
|
62
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
63
|
+
[K in keyof T]: T[K];
|
|
64
|
+
} : {
|
|
65
|
+
[K in keyof T as K]: T[K];
|
|
66
|
+
}) & {};
|
|
@@ -14,13 +14,33 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
14
14
|
draggable?: boolean;
|
|
15
15
|
closable?: boolean;
|
|
16
16
|
minimizable?: boolean;
|
|
17
|
+
/** Maximize button, and double-click on the title bar, to fill the parent and back. */
|
|
18
|
+
maximizable?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Edge snapping while dragging, like GNOME: hold the pointer at the parent's top edge to
|
|
21
|
+
* maximize, or at its left/right edge to fill that half. A preview shows where it will land.
|
|
22
|
+
*/
|
|
23
|
+
snap?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Lets the window be dragged partly out of its container, like a desktop: up to 3/4 of its
|
|
26
|
+
* width past either side, and down until only the title bar shows; never above the top.
|
|
27
|
+
* The container should clip it (`overflow: hidden`).
|
|
28
|
+
*/
|
|
29
|
+
offscreen?: boolean;
|
|
17
30
|
x?: number;
|
|
18
31
|
y?: number;
|
|
19
32
|
resetPosition?: boolean;
|
|
20
|
-
}, {
|
|
33
|
+
}, {
|
|
34
|
+
/** Brings the window to the front, e.g. from a taskbar. */
|
|
35
|
+
focus: () => void;
|
|
36
|
+
toggleMaximize: () => void;
|
|
37
|
+
toggleMinimize: () => void;
|
|
38
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
21
39
|
"update:modelValue": (value: boolean) => any;
|
|
22
40
|
close: () => any;
|
|
41
|
+
focus: () => any;
|
|
23
42
|
minimize: () => any;
|
|
43
|
+
maximize: (maximized: boolean) => any;
|
|
24
44
|
}, string, import("vue").PublicProps, Readonly<{
|
|
25
45
|
modelValue: boolean;
|
|
26
46
|
title?: string;
|
|
@@ -35,13 +55,28 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
35
55
|
draggable?: boolean;
|
|
36
56
|
closable?: boolean;
|
|
37
57
|
minimizable?: boolean;
|
|
58
|
+
/** Maximize button, and double-click on the title bar, to fill the parent and back. */
|
|
59
|
+
maximizable?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Edge snapping while dragging, like GNOME: hold the pointer at the parent's top edge to
|
|
62
|
+
* maximize, or at its left/right edge to fill that half. A preview shows where it will land.
|
|
63
|
+
*/
|
|
64
|
+
snap?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Lets the window be dragged partly out of its container, like a desktop: up to 3/4 of its
|
|
67
|
+
* width past either side, and down until only the title bar shows; never above the top.
|
|
68
|
+
* The container should clip it (`overflow: hidden`).
|
|
69
|
+
*/
|
|
70
|
+
offscreen?: boolean;
|
|
38
71
|
x?: number;
|
|
39
72
|
y?: number;
|
|
40
73
|
resetPosition?: boolean;
|
|
41
74
|
}> & Readonly<{
|
|
42
75
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
43
76
|
onClose?: (() => any) | undefined;
|
|
77
|
+
onFocus?: (() => any) | undefined;
|
|
44
78
|
onMinimize?: (() => any) | undefined;
|
|
79
|
+
onMaximize?: ((maximized: boolean) => any) | undefined;
|
|
45
80
|
}>, {
|
|
46
81
|
width: string;
|
|
47
82
|
height: string;
|
|
@@ -50,9 +85,12 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
50
85
|
y: number;
|
|
51
86
|
x: number;
|
|
52
87
|
minimizable: boolean;
|
|
88
|
+
maximizable: boolean;
|
|
53
89
|
minWidth: number;
|
|
54
90
|
draggable: boolean;
|
|
55
91
|
resizable: boolean;
|
|
92
|
+
snap: boolean;
|
|
93
|
+
offscreen: boolean;
|
|
56
94
|
resetPosition: boolean;
|
|
57
95
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
58
96
|
header?: (props: {}) => any;
|
|
@@ -13,10 +13,17 @@ type __VLS_Props = {
|
|
|
13
13
|
enterFrom: 'start' | 'end';
|
|
14
14
|
selectAllLabel: string;
|
|
15
15
|
clearSearchLabel: string;
|
|
16
|
+
/** The `#item` slot draws the whole row: no checkbox, padding, min height or background. */
|
|
17
|
+
bare: boolean;
|
|
16
18
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
type __VLS_Slots = {
|
|
20
|
+
item?: (props: {
|
|
21
|
+
item: TransferItem;
|
|
22
|
+
checked: boolean;
|
|
23
|
+
toggle: () => void;
|
|
24
|
+
move: () => void;
|
|
25
|
+
}) => unknown;
|
|
26
|
+
empty?: () => unknown;
|
|
20
27
|
};
|
|
21
28
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
29
|
toggle: (args_0: Value) => any;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** A navigation destination: a vue-router location, or a plain URL without vue-router. */
|
|
2
|
+
export type ItemLink = string | Record<string, unknown>;
|
|
3
|
+
export declare function useItemLink(): (item: {
|
|
4
|
+
to?: ItemLink;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}) => {
|
|
7
|
+
tag: string;
|
|
8
|
+
attrs: {
|
|
9
|
+
type: string;
|
|
10
|
+
disabled: true | undefined;
|
|
11
|
+
to?: undefined;
|
|
12
|
+
href?: undefined;
|
|
13
|
+
};
|
|
14
|
+
} | {
|
|
15
|
+
tag: string;
|
|
16
|
+
attrs: {
|
|
17
|
+
to: ItemLink;
|
|
18
|
+
type?: undefined;
|
|
19
|
+
disabled?: undefined;
|
|
20
|
+
href?: undefined;
|
|
21
|
+
};
|
|
22
|
+
} | {
|
|
23
|
+
tag: string;
|
|
24
|
+
attrs: {
|
|
25
|
+
href: string | undefined;
|
|
26
|
+
type?: undefined;
|
|
27
|
+
disabled?: undefined;
|
|
28
|
+
to?: undefined;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function useSheetMotion(axis: 'x' | 'y', onDismiss: () => void): {
|
|
2
|
+
onEnter: (el: Element, done: () => void) => void;
|
|
3
|
+
onLeave: (el: Element, done: () => void) => void;
|
|
4
|
+
onDragStart: (e: PointerEvent) => void;
|
|
5
|
+
onDragMove: (e: PointerEvent) => void;
|
|
6
|
+
onDragEnd: () => void;
|
|
7
|
+
};
|
|
@@ -101,6 +101,9 @@ export interface M3Locale {
|
|
|
101
101
|
selectAll: string;
|
|
102
102
|
clearSearch: string;
|
|
103
103
|
kanbanMoved: string;
|
|
104
|
+
windowMinimize: string;
|
|
105
|
+
windowMaximize: string;
|
|
106
|
+
windowRestore: string;
|
|
104
107
|
}
|
|
105
108
|
export declare const defaultLocale: M3Locale;
|
|
106
109
|
export declare const M3_LOCALE_KEY: InjectionKey<MaybeRef<Partial<M3Locale>>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type MaybeRefOrGetter, type Ref } from 'vue';
|
|
2
|
+
export type WidthSizeClass = 'compact' | 'medium' | 'expanded' | 'large' | 'extra-large';
|
|
3
|
+
export type HeightSizeClass = 'compact' | 'medium' | 'expanded';
|
|
4
|
+
export declare function widthSizeClass(width: number): WidthSizeClass;
|
|
5
|
+
export declare function heightSizeClass(height: number): HeightSizeClass;
|
|
6
|
+
export interface WindowSizeClassInfo {
|
|
7
|
+
width: Ref<number>;
|
|
8
|
+
height: Ref<number>;
|
|
9
|
+
widthClass: Ref<WidthSizeClass>;
|
|
10
|
+
heightClass: Ref<HeightSizeClass>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The M3 width/height size classes, reactive.
|
|
14
|
+
*
|
|
15
|
+
* With no argument it tracks the browser window. Pass an element (ref or getter) to classify
|
|
16
|
+
* that element's own size instead, which is what the adaptive layout components do, so they
|
|
17
|
+
* adapt to the space they actually get (a column, a dialog, a resizable panel).
|
|
18
|
+
*/
|
|
19
|
+
export declare function useWindowSizeClass(target?: MaybeRefOrGetter<HTMLElement | null | undefined>): WindowSizeClassInfo;
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export { useFieldBg } from './composables/useFieldBg';
|
|
|
10
10
|
export { useLocale, defaultLocale } from './composables/useLocale';
|
|
11
11
|
export type { M3Locale } from './composables/useLocale';
|
|
12
12
|
export { useDevice } from './composables/useDevice';
|
|
13
|
+
export { useWindowSizeClass, widthSizeClass, heightSizeClass } from './composables/useWindowSizeClass';
|
|
14
|
+
export type { WidthSizeClass, HeightSizeClass, WindowSizeClassInfo } from './composables/useWindowSizeClass';
|
|
13
15
|
export { useNotification } from './composables/useNotification';
|
|
14
16
|
export type { Notification, NotificationVariant, NotificationPosition, NotificationOptions } from './composables/useNotification';
|
|
15
17
|
export { useDebounce } from './composables/useDebounce';
|
|
@@ -94,6 +96,10 @@ export { default as MNavigationBar } from './components/MNavigationBar.vue';
|
|
|
94
96
|
export { default as MNumberField } from './components/MNumberField.vue';
|
|
95
97
|
export { default as MNavigationDrawer } from './components/MNavigationDrawer.vue';
|
|
96
98
|
export { default as MNavigationRail } from './components/MNavigationRail.vue';
|
|
99
|
+
export { default as MNavigationSuite } from './components/MNavigationSuite.vue';
|
|
100
|
+
export type { NavigationSuiteItem, NavigationSuiteLayout } from './components/MNavigationSuite.vue';
|
|
101
|
+
export { default as MListDetail } from './components/MListDetail.vue';
|
|
102
|
+
export { default as MSupportingPane } from './components/MSupportingPane.vue';
|
|
97
103
|
export { default as MOverlay } from './components/MOverlay.vue';
|
|
98
104
|
export { default as MPageProgress } from './components/MPageProgress.vue';
|
|
99
105
|
export { default as MPagination } from './components/MPagination.vue';
|