@m3ui-vue/m3ui-vue 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/API.md +2914 -348
- package/dist/MButton-CuNzpoxm.js +172 -0
- package/dist/MButton-CuNzpoxm.js.map +1 -0
- package/dist/MDialog-HxEL-m58.js +173 -0
- package/dist/MDialog-HxEL-m58.js.map +1 -0
- package/dist/MIconButton-DoNotQ9v.js +282 -0
- package/dist/MIconButton-DoNotQ9v.js.map +1 -0
- package/dist/MListItem-DnPtv-hY.js +824 -0
- package/dist/MListItem-DnPtv-hY.js.map +1 -0
- package/dist/MLoadingIndicator-BQMNX6Dx.js +115 -0
- package/dist/MLoadingIndicator-BQMNX6Dx.js.map +1 -0
- package/dist/MMenuItem-Bih0h4-n.js +604 -0
- package/dist/MMenuItem-Bih0h4-n.js.map +1 -0
- package/dist/MProgressBar-BCoruxA-.js +184 -0
- package/dist/MProgressBar-BCoruxA-.js.map +1 -0
- package/dist/MSeekBar-LURE1Ah7.js +435 -0
- package/dist/MSeekBar-LURE1Ah7.js.map +1 -0
- package/dist/MSegmentedButton-DL9JtJFX.js +65 -0
- package/dist/MSegmentedButton-DL9JtJFX.js.map +1 -0
- package/dist/MSlider-_J4IS2_z.js +691 -0
- package/dist/MSlider-_J4IS2_z.js.map +1 -0
- package/dist/MSpinner-BhkMYKOM.js +65 -0
- package/dist/MSpinner-BhkMYKOM.js.map +1 -0
- package/dist/MTextField-CkzwNBWS.js +296 -0
- package/dist/MTextField-CkzwNBWS.js.map +1 -0
- package/dist/MTooltip-B67ZDSGp.js +756 -0
- package/dist/MTooltip-B67ZDSGp.js.map +1 -0
- package/dist/_storageKeys-CYXsUBwK.js +18 -0
- package/dist/_storageKeys-CYXsUBwK.js.map +1 -0
- package/dist/_useEscapeStack-CjndQhqg.js +19 -0
- package/dist/_useEscapeStack-CjndQhqg.js.map +1 -0
- package/dist/api.json +1 -1
- package/dist/chart.js +1 -1
- package/dist/code-editor.js +1 -1
- package/dist/components/MAudioPlayer.vue.d.ts +115 -0
- package/dist/components/MBadge.vue.d.ts +1 -1
- package/dist/components/MBottomSheetScaffold.vue.d.ts +1 -1
- package/dist/components/MBox.vue.d.ts +1 -1
- package/dist/components/MButton.vue.d.ts +1 -1
- package/dist/components/MConfirmDialog.vue.d.ts +1 -1
- package/dist/components/MCopyButton.vue.d.ts +2 -2
- package/dist/components/MDataTable.vue.d.ts +2 -2
- package/dist/components/MDialog.vue.d.ts +2 -2
- package/dist/components/MDivider.vue.d.ts +1 -1
- package/dist/components/MDragHandle.vue.d.ts +1 -1
- package/dist/components/MDrawCanvas.vue.d.ts +148 -0
- package/dist/components/MDrawLayers.vue.d.ts +3 -0
- package/dist/components/MDrawToolbar.vue.d.ts +34 -0
- package/dist/components/MExportButton.vue.d.ts +1 -1
- package/dist/components/MFab.vue.d.ts +2 -2
- package/dist/components/MFabMenu.vue.d.ts +2 -2
- package/dist/components/MFixed.vue.d.ts +1 -1
- package/dist/components/MFlex.vue.d.ts +2 -2
- package/dist/components/MFloorPlan.vue.d.ts +160 -0
- package/dist/components/MFlow.vue.d.ts +305 -0
- package/dist/components/MFlowControls.vue.d.ts +33 -0
- package/dist/components/MFlowHandle.vue.d.ts +16 -0
- package/dist/components/MFlowMinimap.vue.d.ts +22 -0
- package/dist/components/MFlowNode.vue.d.ts +35 -0
- package/dist/components/MGantt.vue.d.ts +141 -0
- package/dist/components/MGanttControls.vue.d.ts +32 -0
- package/dist/components/MIconButton.vue.d.ts +3 -1
- package/dist/components/MImageCropper.vue.d.ts +110 -0
- package/dist/components/MInfiniteScroll.vue.d.ts +1 -1
- package/dist/components/MLightbox.vue.d.ts +2 -2
- package/dist/components/MList.vue.d.ts +1 -1
- package/dist/components/MLoadingOverlay.vue.d.ts +1 -1
- package/dist/components/MMap.vue.d.ts +1 -1
- package/dist/components/MMapControl.vue.d.ts +1 -1
- package/dist/components/MMapSearch.vue.d.ts +1 -1
- package/dist/components/MMaskField.vue.d.ts +12 -1
- package/dist/components/MMenu.vue.d.ts +1 -1
- package/dist/components/MNavigationDrawer.vue.d.ts +1 -1
- package/dist/components/MNumberField.vue.d.ts +11 -2
- package/dist/components/MPdfViewer.vue.d.ts +174 -0
- package/dist/components/MPullToRefresh.vue.d.ts +1 -1
- package/dist/components/MResourceTimeline.vue.d.ts +149 -0
- package/dist/components/MScheduler.vue.d.ts +3 -3
- package/dist/components/MScheme.vue.d.ts +1 -1
- package/dist/components/MSearchField.vue.d.ts +1 -1
- package/dist/components/MSeekBar.vue.d.ts +1 -1
- package/dist/components/MSimpleCarousel.vue.d.ts +1 -1
- package/dist/components/MSkeleton.vue.d.ts +1 -1
- package/dist/components/MSlider.vue.d.ts +4 -4
- package/dist/components/MSparkline.vue.d.ts +1 -1
- package/dist/components/MSplitter.vue.d.ts +1 -1
- package/dist/components/MStack.vue.d.ts +2 -2
- package/dist/components/MSwipeToDismiss.vue.d.ts +1 -1
- package/dist/components/MSwitch.vue.d.ts +1 -1
- package/dist/components/MTable.vue.d.ts +1 -1
- package/dist/components/MTagInput.vue.d.ts +12 -1
- package/dist/components/MTextField.vue.d.ts +13 -2
- package/dist/components/MToolbar.vue.d.ts +1 -1
- package/dist/components/MTree.vue.d.ts +2 -2
- package/dist/components/MVideoPlayer.vue.d.ts +253 -0
- package/dist/components/MVirtualTable.vue.d.ts +1 -1
- package/dist/components/MWindow.vue.d.ts +3 -3
- package/dist/components/_MFlowEdge.vue.d.ts +9 -0
- package/dist/components/_MFlowEdgeLabel.vue.d.ts +9 -0
- package/dist/components/_MFlowNodeShell.vue.d.ts +9 -0
- package/dist/components/_MPdfPage.vue.d.ts +76 -0
- package/dist/components/_MTimeBackground.vue.d.ts +14 -0
- package/dist/components/_MTimeHeader.vue.d.ts +20 -0
- package/dist/composables/_effectCanvas.d.ts +23 -0
- package/dist/composables/_flowPanel.d.ts +2 -0
- package/dist/composables/_flowSlot.d.ts +5 -0
- package/dist/composables/_ganttTime.d.ts +41 -0
- package/dist/composables/_storageKeys.d.ts +9 -0
- package/dist/composables/_useTimeAxis.d.ts +90 -0
- package/dist/composables/drawGeometry.d.ts +119 -0
- package/dist/composables/flowFormats.d.ts +79 -0
- package/dist/composables/flowLayout.d.ts +45 -0
- package/dist/composables/flowPaths.d.ts +53 -0
- package/dist/composables/ganttFormats.d.ts +52 -0
- package/dist/composables/ganttSchedule.d.ts +99 -0
- package/dist/composables/themeInitScript.d.ts +2 -0
- package/dist/composables/useConfetti.d.ts +19 -8
- package/dist/composables/useDrawing.d.ts +44 -0
- package/dist/composables/useFireworks.d.ts +37 -0
- package/dist/composables/useFlow.d.ts +266 -0
- package/dist/composables/useGantt.d.ts +87 -0
- package/dist/composables/useLocale.d.ts +163 -0
- package/dist/composables/useMediaPlayer.d.ts +101 -0
- package/dist/composables/usePdf.d.ts +119 -0
- package/dist/composables/useReactions.d.ts +32 -0
- package/dist/composables/useResourceTimeline.d.ts +70 -0
- package/dist/composables/viewportHints.d.ts +2 -0
- package/dist/directives/vSparkle.d.ts +27 -0
- package/dist/draw.d.ts +7 -0
- package/dist/draw.js +1700 -0
- package/dist/draw.js.map +1 -0
- package/dist/flow.d.ts +14 -0
- package/dist/flow.js +3542 -0
- package/dist/flow.js.map +1 -0
- package/dist/flowPaths-CUc6X373.js +161 -0
- package/dist/flowPaths-CUc6X373.js.map +1 -0
- package/dist/gantt.d.ts +12 -0
- package/dist/gantt.js +3575 -0
- package/dist/gantt.js.map +1 -0
- package/dist/index.d.ts +11 -1
- package/dist/locales/index.js +1148 -7
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +7822 -7809
- package/dist/m3ui.js.map +1 -1
- package/dist/map.js +593 -588
- package/dist/map.js.map +1 -1
- package/dist/media.d.ts +5 -0
- package/dist/media.js +1311 -0
- package/dist/media.js.map +1 -0
- package/dist/pdf.d.ts +4 -0
- package/dist/pdf.js +1871 -0
- package/dist/pdf.js.map +1 -0
- package/dist/plugin.d.ts +10 -0
- package/dist/rich-text-editor.js +28 -26
- package/dist/rich-text-editor.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/{useLocale-JYxDDeXC.js → useLocale-BpGxplLV.js} +165 -2
- package/dist/useLocale-BpGxplLV.js.map +1 -0
- package/dist/{useThemeTokens-Bv-Uv8eX.js → useThemeTokens-DQQcaWbE.js} +41 -40
- package/dist/useThemeTokens-DQQcaWbE.js.map +1 -0
- package/package.json +29 -5
- package/src/__tests__/MAudioPlayer.test.ts +75 -0
- package/src/__tests__/MDrawCanvas.test.ts +110 -0
- package/src/__tests__/MFloorPlan.test.ts +97 -0
- package/src/__tests__/MFlow.test.ts +575 -0
- package/src/__tests__/MGantt.test.ts +130 -0
- package/src/__tests__/MImageCropper.test.ts +89 -0
- package/src/__tests__/MPdfViewer.test.ts +235 -0
- package/src/__tests__/MResourceTimeline.test.ts +102 -0
- package/src/__tests__/MSlider.test.ts +36 -0
- package/src/__tests__/MVideoPlayer.test.ts +201 -0
- package/src/__tests__/drawGeometry.test.ts +58 -0
- package/src/__tests__/fieldExpose.test.ts +30 -0
- package/src/__tests__/flowFormats.test.ts +185 -0
- package/src/__tests__/flowLayout.test.ts +113 -0
- package/src/__tests__/ganttFormats.test.ts +76 -0
- package/src/__tests__/ganttSchedule.test.ts +136 -0
- package/src/__tests__/pdfMock.ts +83 -0
- package/src/__tests__/plugin.test.ts +56 -1
- package/src/__tests__/ssr.test.ts +1 -1
- package/src/__tests__/themeInitScript.test.ts +10 -0
- package/src/__tests__/useConfetti.test.ts +33 -2
- package/src/__tests__/useFireworks.test.ts +104 -0
- package/src/__tests__/useMediaPlayer.test.ts +182 -0
- package/src/__tests__/usePdf.test.ts +102 -0
- package/src/__tests__/useReactions.test.ts +51 -0
- package/src/__tests__/vSparkle.test.ts +83 -0
- package/src/components/MAudioPlayer.vue +319 -0
- package/src/components/MDrawCanvas.vue +813 -0
- package/src/components/MDrawLayers.vue +114 -0
- package/src/components/MDrawToolbar.vue +171 -0
- package/src/components/MEmojiSelector.vue +3 -2
- package/src/components/MFloorPlan.vue +581 -0
- package/src/components/MFlow.vue +2049 -0
- package/src/components/MFlowControls.vue +110 -0
- package/src/components/MFlowHandle.vue +60 -0
- package/src/components/MFlowMinimap.vue +134 -0
- package/src/components/MFlowNode.vue +98 -0
- package/src/components/MGantt.vue +1609 -0
- package/src/components/MGanttControls.vue +77 -0
- package/src/components/MIconButton.vue +3 -1
- package/src/components/MImageCropper.vue +507 -0
- package/src/components/MMap.vue +3 -2
- package/src/components/MMaskField.vue +13 -0
- package/src/components/MNumberField.vue +13 -0
- package/src/components/MPdfViewer.vue +1269 -0
- package/src/components/MResourceTimeline.vue +1020 -0
- package/src/components/MSlider.vue +22 -4
- package/src/components/MTagInput.vue +13 -0
- package/src/components/MTextField.vue +24 -4
- package/src/components/MVideoPlayer.vue +839 -0
- package/src/components/_MFlowEdge.vue +100 -0
- package/src/components/_MFlowEdgeLabel.vue +56 -0
- package/src/components/_MFlowNodeShell.vue +111 -0
- package/src/components/_MPdfPage.vue +456 -0
- package/src/components/_MTimeBackground.vue +16 -0
- package/src/components/_MTimeHeader.vue +31 -0
- package/src/composables/_colorUtils.ts +4 -2
- package/src/composables/_effectCanvas.ts +109 -0
- package/src/composables/_flowPanel.ts +13 -0
- package/src/composables/_flowSlot.ts +6 -0
- package/src/composables/_ganttTime.ts +200 -0
- package/src/composables/_ssrState.ts +2 -2
- package/src/composables/_storageKeys.ts +28 -0
- package/src/composables/_useTimeAxis.ts +224 -0
- package/src/composables/drawGeometry.ts +405 -0
- package/src/composables/flowFormats.ts +916 -0
- package/src/composables/flowLayout.ts +297 -0
- package/src/composables/flowPaths.ts +239 -0
- package/src/composables/ganttFormats.ts +366 -0
- package/src/composables/ganttSchedule.ts +403 -0
- package/src/composables/themeInitScript.ts +5 -2
- package/src/composables/useColorPalette.ts +36 -8
- package/src/composables/useConfetti.ts +84 -107
- package/src/composables/useDrawing.ts +53 -0
- package/src/composables/useFireworks.ts +360 -0
- package/src/composables/useFlow.ts +250 -0
- package/src/composables/useGantt.ts +92 -0
- package/src/composables/useLocale.ts +328 -0
- package/src/composables/useMediaPlayer.ts +406 -0
- package/src/composables/usePdf.ts +456 -0
- package/src/composables/useReactions.ts +131 -0
- package/src/composables/useResourceTimeline.ts +76 -0
- package/src/composables/useTheme.ts +21 -4
- package/src/composables/viewportHints.ts +6 -5
- package/src/directives/vSparkle.ts +180 -0
- package/src/draw.ts +25 -0
- package/src/flow.ts +26 -0
- package/src/gantt.ts +12 -0
- package/src/index.ts +11 -1
- package/src/locales/de.ts +163 -0
- package/src/locales/es.ts +163 -0
- package/src/locales/fr.ts +163 -0
- package/src/locales/ja.ts +163 -0
- package/src/locales/ko.ts +163 -0
- package/src/locales/pt.ts +163 -0
- package/src/locales/zh.ts +163 -0
- package/src/media.ts +5 -0
- package/src/pdf.ts +15 -0
- package/src/plugin.ts +21 -5
- package/dist/MMenuItem-DI351kIf.js +0 -929
- package/dist/MMenuItem-DI351kIf.js.map +0 -1
- package/dist/MSlider-BnEy5ieZ.js +0 -1500
- package/dist/MSlider-BnEy5ieZ.js.map +0 -1
- package/dist/MTextField-BBmkaIbO.js +0 -633
- package/dist/MTextField-BBmkaIbO.js.map +0 -1
- package/dist/useLocale-JYxDDeXC.js.map +0 -1
- package/dist/useThemeTokens-Bv-Uv8eX.js.map +0 -1
|
@@ -0,0 +1,824 @@
|
|
|
1
|
+
import { i as e } from "./useLocale-BpGxplLV.js";
|
|
2
|
+
import { a as t, i as n, s as r } from "./MIconButton-DoNotQ9v.js";
|
|
3
|
+
import { t as i } from "./MIcon-Bxh9j135.js";
|
|
4
|
+
import { Transition as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, getCurrentInstance as m, h, inject as g, mergeProps as _, nextTick as v, normalizeClass as y, normalizeStyle as b, onMounted as x, onUnmounted as S, onUpdated as C, openBlock as w, provide as T, ref as E, renderSlot as D, resolveDynamicComponent as ee, shallowRef as O, toDisplayString as k, unref as A, useId as te, useSlots as j, watch as M, withCtx as N, withModifiers as P } from "vue";
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/components/MAvatar.vue
|
|
7
|
+
var ne = /* @__PURE__ */ p({
|
|
8
|
+
__name: "MAvatar",
|
|
9
|
+
props: {
|
|
10
|
+
name: {},
|
|
11
|
+
fallback: {},
|
|
12
|
+
size: { default: 40 }
|
|
13
|
+
},
|
|
14
|
+
setup(e) {
|
|
15
|
+
let t = e, n = o(() => {
|
|
16
|
+
if (t.name) {
|
|
17
|
+
let e = t.name.trim().split(/\s+/).filter(Boolean);
|
|
18
|
+
return ((e[0]?.[0] ?? "") + (e.length > 1 ? e[e.length - 1]?.[0] ?? "" : "")).toUpperCase() || t.fallback || "?";
|
|
19
|
+
}
|
|
20
|
+
return t.fallback || "?";
|
|
21
|
+
});
|
|
22
|
+
return (t, r) => (w(), l("div", {
|
|
23
|
+
class: "inline-flex shrink-0 items-center justify-center rounded-full bg-primary-container font-medium text-on-primary-container",
|
|
24
|
+
style: b({
|
|
25
|
+
width: `${e.size}px`,
|
|
26
|
+
height: `${e.size}px`,
|
|
27
|
+
fontSize: `${Math.round(e.size * .4)}px`
|
|
28
|
+
})
|
|
29
|
+
}, k(n.value), 5));
|
|
30
|
+
}
|
|
31
|
+
}), F = [
|
|
32
|
+
"role",
|
|
33
|
+
"tabindex",
|
|
34
|
+
"aria-disabled"
|
|
35
|
+
], I = ["src", "alt"], L = {
|
|
36
|
+
key: 1,
|
|
37
|
+
class: "px-4 pt-4 pb-2"
|
|
38
|
+
}, R = {
|
|
39
|
+
key: 2,
|
|
40
|
+
class: "px-4 pt-4 pb-2"
|
|
41
|
+
}, z = { class: "text-title-large font-medium text-on-surface" }, B = {
|
|
42
|
+
key: 0,
|
|
43
|
+
class: "mt-1 text-body-medium text-on-surface-variant"
|
|
44
|
+
}, V = {
|
|
45
|
+
key: 3,
|
|
46
|
+
class: "flex justify-end gap-2 px-4 pt-2 pb-4"
|
|
47
|
+
}, re = "relative before:content-[''] before:pointer-events-none before:absolute before:inset-0 before:bg-on-surface before:opacity-0 before:transition-opacity before:duration-150 hover:before:opacity-[0.08] active:before:opacity-[0.12]", ie = /* @__PURE__ */ p({
|
|
48
|
+
__name: "MCard",
|
|
49
|
+
props: {
|
|
50
|
+
variant: { default: "elevated" },
|
|
51
|
+
clickable: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: !1
|
|
54
|
+
},
|
|
55
|
+
elevated: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: !1
|
|
58
|
+
},
|
|
59
|
+
disabled: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: !1
|
|
62
|
+
},
|
|
63
|
+
image: {},
|
|
64
|
+
imageAlt: {},
|
|
65
|
+
imageHeight: {},
|
|
66
|
+
title: {},
|
|
67
|
+
subtitle: {}
|
|
68
|
+
},
|
|
69
|
+
setup(e) {
|
|
70
|
+
let t = e, n = o(() => t.elevated ? "elevated" : t.variant), r = {
|
|
71
|
+
elevated: "var(--color-surface-container-low)",
|
|
72
|
+
filled: "var(--color-surface-container-highest)",
|
|
73
|
+
outlined: "var(--color-surface)"
|
|
74
|
+
}, i = o(() => (t.disabled ? {
|
|
75
|
+
elevated: "bg-surface/38 shadow-none",
|
|
76
|
+
filled: "bg-surface-variant/38",
|
|
77
|
+
outlined: "bg-surface border border-outline/12"
|
|
78
|
+
} : {
|
|
79
|
+
elevated: "bg-surface-container-low shadow-elevation-1",
|
|
80
|
+
filled: "bg-surface-container-highest",
|
|
81
|
+
outlined: "bg-surface border border-outline-variant"
|
|
82
|
+
})[n.value]), a = {
|
|
83
|
+
elevated: "hover:shadow-elevation-2 active:shadow-elevation-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-secondary",
|
|
84
|
+
filled: "hover:shadow-elevation-1 active:shadow-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-secondary",
|
|
85
|
+
outlined: "hover:shadow-elevation-1 active:shadow-none focus-visible:outline-none focus-visible:border-on-surface"
|
|
86
|
+
}, s = o(() => t.clickable && !t.disabled);
|
|
87
|
+
function d(e) {
|
|
88
|
+
s.value && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.currentTarget.click());
|
|
89
|
+
}
|
|
90
|
+
return (t, o) => (w(), l("div", {
|
|
91
|
+
class: y(["overflow-hidden rounded-md transition-shadow duration-150", [
|
|
92
|
+
i.value,
|
|
93
|
+
s.value ? [
|
|
94
|
+
"cursor-pointer",
|
|
95
|
+
a[n.value],
|
|
96
|
+
re
|
|
97
|
+
] : "",
|
|
98
|
+
e.disabled ? "cursor-not-allowed pointer-events-none" : ""
|
|
99
|
+
]]),
|
|
100
|
+
style: b({ "--field-bg": r[n.value] }),
|
|
101
|
+
role: e.clickable ? "button" : void 0,
|
|
102
|
+
tabindex: s.value ? 0 : void 0,
|
|
103
|
+
"aria-disabled": e.clickable && e.disabled ? "true" : void 0,
|
|
104
|
+
onKeydown: d
|
|
105
|
+
}, [
|
|
106
|
+
e.image || t.$slots.media ? (w(), l("div", {
|
|
107
|
+
key: 0,
|
|
108
|
+
class: y(["w-full overflow-hidden", e.imageHeight ?? "h-48"])
|
|
109
|
+
}, [e.image ? (w(), l("img", {
|
|
110
|
+
key: 0,
|
|
111
|
+
src: e.image,
|
|
112
|
+
alt: e.imageAlt ?? "",
|
|
113
|
+
class: "h-full w-full object-cover"
|
|
114
|
+
}, null, 8, I)) : D(t.$slots, "media", {}, void 0, void 0, 1)], 2)) : c("", !0),
|
|
115
|
+
t.$slots.header ? (w(), l("div", L, [D(t.$slots, "header")])) : e.title ? (w(), l("div", R, [u("h3", z, k(e.title), 1), e.subtitle ? (w(), l("p", B, k(e.subtitle), 1)) : c("", !0)])) : c("", !0),
|
|
116
|
+
D(t.$slots, "default"),
|
|
117
|
+
t.$slots.actions ? (w(), l("div", V, [D(t.$slots, "actions")])) : c("", !0)
|
|
118
|
+
], 46, F));
|
|
119
|
+
}
|
|
120
|
+
}), H = { class: "relative -m-[11px] inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full" }, ae = [
|
|
121
|
+
"checked",
|
|
122
|
+
"disabled",
|
|
123
|
+
"aria-label"
|
|
124
|
+
], oe = {
|
|
125
|
+
key: 1,
|
|
126
|
+
class: "pointer-events-none absolute inset-0 rounded-full ring-0 ring-secondary transition-[box-shadow] duration-150 peer-focus-visible:ring-2"
|
|
127
|
+
}, U = /* @__PURE__ */ p({
|
|
128
|
+
__name: "MCheckbox",
|
|
129
|
+
props: {
|
|
130
|
+
modelValue: { type: Boolean },
|
|
131
|
+
indeterminate: {
|
|
132
|
+
type: Boolean,
|
|
133
|
+
default: !1
|
|
134
|
+
},
|
|
135
|
+
disabled: {
|
|
136
|
+
type: Boolean,
|
|
137
|
+
default: !1
|
|
138
|
+
},
|
|
139
|
+
label: {},
|
|
140
|
+
color: { default: "primary" },
|
|
141
|
+
ariaLabel: {}
|
|
142
|
+
},
|
|
143
|
+
emits: ["update:modelValue"],
|
|
144
|
+
setup(e, { emit: t }) {
|
|
145
|
+
let n = t, r = {
|
|
146
|
+
primary: "border-primary bg-primary text-on-primary",
|
|
147
|
+
secondary: "border-secondary bg-secondary text-on-secondary",
|
|
148
|
+
tertiary: "border-tertiary bg-tertiary text-on-tertiary",
|
|
149
|
+
error: "border-error bg-error text-on-error"
|
|
150
|
+
}, a = {
|
|
151
|
+
primary: "bg-primary",
|
|
152
|
+
secondary: "bg-secondary",
|
|
153
|
+
tertiary: "bg-tertiary",
|
|
154
|
+
error: "bg-error"
|
|
155
|
+
};
|
|
156
|
+
return (t, o) => (w(), l("label", { class: y(["group inline-flex items-center gap-2 select-none", e.disabled ? "cursor-not-allowed" : "cursor-pointer"]) }, [u("span", H, [
|
|
157
|
+
u("input", {
|
|
158
|
+
type: "checkbox",
|
|
159
|
+
class: "peer sr-only",
|
|
160
|
+
checked: e.modelValue,
|
|
161
|
+
disabled: e.disabled,
|
|
162
|
+
"aria-label": e.ariaLabel,
|
|
163
|
+
onChange: o[0] ||= (t) => n("update:modelValue", !e.modelValue)
|
|
164
|
+
}, null, 40, ae),
|
|
165
|
+
e.disabled ? c("", !0) : (w(), l("span", {
|
|
166
|
+
key: 0,
|
|
167
|
+
class: y(["pointer-events-none absolute inset-0 rounded-full opacity-0 transition-opacity duration-150 group-hover:opacity-[0.08] group-active:opacity-[0.12]", e.modelValue || e.indeterminate ? a[e.color] : "bg-on-surface"])
|
|
168
|
+
}, null, 2)),
|
|
169
|
+
e.disabled ? c("", !0) : (w(), l("span", oe)),
|
|
170
|
+
u("span", { class: y(["relative inline-flex h-4.5 w-4.5 items-center justify-center rounded-[2px] border-2 transition-colors", e.disabled ? e.modelValue || e.indeterminate ? "border-on-surface/38 bg-on-surface/38 text-surface" : "border-on-surface/38 text-transparent" : e.modelValue || e.indeterminate ? r[e.color] : "border-on-surface-variant text-transparent group-hover:border-on-surface group-active:border-on-surface"]) }, [f(i, {
|
|
171
|
+
name: e.indeterminate ? "remove" : "check",
|
|
172
|
+
size: 18,
|
|
173
|
+
class: y(["transition-[opacity,transform] duration-150", e.modelValue || e.indeterminate ? "scale-100 opacity-100" : "scale-0 opacity-0"])
|
|
174
|
+
}, null, 8, ["name", "class"])], 2)
|
|
175
|
+
]), e.label || t.$slots.default ? (w(), l("span", {
|
|
176
|
+
key: 0,
|
|
177
|
+
class: y(["text-body-large", e.disabled ? "text-on-surface/38" : "text-on-surface"])
|
|
178
|
+
}, [D(t.$slots, "default", {}, () => [d(k(e.label), 1)])], 2)) : c("", !0)], 2));
|
|
179
|
+
}
|
|
180
|
+
}), W = ["disabled", "aria-pressed"], G = { class: "whitespace-nowrap" }, se = ["aria-label", "disabled"], K = ["aria-label", "disabled"], q = "relative cursor-pointer before:content-[''] before:pointer-events-none before:absolute before:inset-0 before:bg-current before:opacity-0 before:transition-opacity before:duration-150 hover:before:opacity-[0.08] active:before:opacity-[0.12] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary", J = /* @__PURE__ */ p({
|
|
181
|
+
__name: "MChip",
|
|
182
|
+
props: {
|
|
183
|
+
tone: { default: "neutral" },
|
|
184
|
+
selected: {
|
|
185
|
+
type: Boolean,
|
|
186
|
+
default: !1
|
|
187
|
+
},
|
|
188
|
+
removable: {
|
|
189
|
+
type: Boolean,
|
|
190
|
+
default: !1
|
|
191
|
+
},
|
|
192
|
+
clickable: {
|
|
193
|
+
type: Boolean,
|
|
194
|
+
default: !1
|
|
195
|
+
},
|
|
196
|
+
disabled: {
|
|
197
|
+
type: Boolean,
|
|
198
|
+
default: !1
|
|
199
|
+
},
|
|
200
|
+
icon: {},
|
|
201
|
+
type: {},
|
|
202
|
+
elevated: {
|
|
203
|
+
type: Boolean,
|
|
204
|
+
default: !1
|
|
205
|
+
},
|
|
206
|
+
trailingIcon: {}
|
|
207
|
+
},
|
|
208
|
+
emits: [
|
|
209
|
+
"click",
|
|
210
|
+
"remove",
|
|
211
|
+
"update:selected"
|
|
212
|
+
],
|
|
213
|
+
setup(a, { emit: d }) {
|
|
214
|
+
let p = [
|
|
215
|
+
"neutral",
|
|
216
|
+
"primary",
|
|
217
|
+
"success",
|
|
218
|
+
"error",
|
|
219
|
+
"tertiary",
|
|
220
|
+
"secondary"
|
|
221
|
+
], m = a, h = d, g = e(), _ = j(), v = o(() => !!m.tone && !p.includes(m.tone)), x = o(() => {
|
|
222
|
+
if (v.value) return {
|
|
223
|
+
"--chip-bg": m.tone + "22",
|
|
224
|
+
"--chip-color": m.tone
|
|
225
|
+
};
|
|
226
|
+
}), S = o(() => {
|
|
227
|
+
if (m.disabled) return m.tone === "neutral" && !m.selected && !v.value ? "border border-on-surface/10 bg-transparent text-on-surface/38" : "border border-transparent bg-on-surface/12 text-on-surface/38";
|
|
228
|
+
if (v.value) return "border border-transparent bg-[var(--chip-bg)] text-[var(--chip-color)]";
|
|
229
|
+
if (m.tone === "neutral" && !m.selected) return "border border-outline-variant bg-transparent text-on-surface-variant";
|
|
230
|
+
let e = {
|
|
231
|
+
neutral: "border border-transparent bg-secondary-container text-on-secondary-container",
|
|
232
|
+
primary: "border border-transparent bg-primary-container text-on-primary-container",
|
|
233
|
+
secondary: "border border-transparent bg-secondary-container text-on-secondary-container",
|
|
234
|
+
success: "border border-transparent bg-success-container text-on-success-container",
|
|
235
|
+
error: "border border-transparent bg-error-container text-on-error-container",
|
|
236
|
+
tertiary: "border border-transparent bg-tertiary-container text-on-tertiary-container"
|
|
237
|
+
};
|
|
238
|
+
return e[m.tone ?? "neutral"] ?? e.neutral;
|
|
239
|
+
}), C = o(() => m.selected ? "rounded-full" : "rounded-md"), T = o(() => m.type === "filter" || m.type === "input"), O = o(() => m.type === "input" && !!_.avatar), k = o(() => !!m.trailingIcon || m.type === "input" && m.removable), te = o(() => {
|
|
240
|
+
let e = T.value && m.selected;
|
|
241
|
+
if (m.disabled) return e || m.elevated && m.type !== "input" ? "bg-on-surface/12 text-on-surface/38" : "border border-on-surface/12 text-on-surface/38";
|
|
242
|
+
if (e) return ["bg-secondary-container text-on-secondary-container", m.elevated ? "shadow-elevation-1 hover:shadow-elevation-2" : ""];
|
|
243
|
+
let t = m.type === "assist" ? "text-on-surface" : "text-on-surface-variant";
|
|
244
|
+
return m.elevated && m.type !== "input" ? ["bg-surface-container-low shadow-elevation-1 hover:shadow-elevation-2", t] : ["border border-outline-variant", t];
|
|
245
|
+
}), M = o(() => m.disabled ? "" : m.type === "assist" || m.type === "suggestion" ? "text-primary" : m.selected ? "text-on-secondary-container" : "text-on-surface-variant"), ne = o(() => m.type === "input" ? [O.value ? "pl-1" : m.icon ? "pl-2" : "pl-3", k.value ? "pr-2" : "pr-3"] : [m.icon || R.value ? "pl-2" : "pl-4", k.value ? "pr-2" : "pr-4"]), F = E(!1), I = E(), L = E(), R = o(() => m.type === "filter" && !m.icon);
|
|
246
|
+
r(() => m.type === "filter" || m.type === "input" ? [F.value ? 8 : m.selected ? 16 : 12, R.value ? m.selected ? 26 : 8 : 0] : [], ([e, t]) => {
|
|
247
|
+
I.value && e !== void 0 && (I.value.style.borderRadius = `${e}px`), L.value && t !== void 0 && (L.value.style.width = `${t}px`);
|
|
248
|
+
}, t), r(() => R.value ? [+!!m.selected] : [], ([e]) => {
|
|
249
|
+
L.value && e !== void 0 && (L.value.style.opacity = String(e));
|
|
250
|
+
}, n);
|
|
251
|
+
function z() {
|
|
252
|
+
m.disabled || (T.value && h("update:selected", !m.selected), h("click"));
|
|
253
|
+
}
|
|
254
|
+
return (e, t) => a.type ? (w(), l("span", {
|
|
255
|
+
key: 0,
|
|
256
|
+
ref_key: "typedEl",
|
|
257
|
+
ref: I,
|
|
258
|
+
class: y(["relative inline-flex h-8 items-center overflow-hidden align-middle text-label-large transition-[background-color,box-shadow,color] has-[button:focus-visible]:ring-2 has-[button:focus-visible]:ring-inset has-[button:focus-visible]:ring-secondary", [te.value, a.type === "assist" || a.type === "suggestion" ? "rounded-sm" : "rounded-md"]])
|
|
259
|
+
}, [u("button", {
|
|
260
|
+
type: "button",
|
|
261
|
+
class: y(["flex h-full items-center gap-2 outline-none before:pointer-events-none before:absolute before:inset-0 before:bg-current before:opacity-0 before:transition-opacity", [ne.value, a.disabled ? "cursor-not-allowed" : "cursor-pointer hover:before:opacity-[0.08] active:before:opacity-[0.12]"]]),
|
|
262
|
+
disabled: a.disabled,
|
|
263
|
+
"aria-pressed": T.value ? a.selected : void 0,
|
|
264
|
+
onPointerdown: t[0] ||= (e) => F.value = !0,
|
|
265
|
+
onPointerup: t[1] ||= (e) => F.value = !1,
|
|
266
|
+
onPointerleave: t[2] ||= (e) => F.value = !1,
|
|
267
|
+
onPointercancel: t[3] ||= (e) => F.value = !1,
|
|
268
|
+
onClick: z
|
|
269
|
+
}, [
|
|
270
|
+
O.value ? (w(), l("span", {
|
|
271
|
+
key: 0,
|
|
272
|
+
class: y(["-my-1 flex h-6 w-6 shrink-0 items-center justify-center overflow-hidden rounded-full", a.disabled ? "opacity-38" : ""])
|
|
273
|
+
}, [D(e.$slots, "avatar")], 2)) : a.icon ? (w(), s(i, {
|
|
274
|
+
key: 1,
|
|
275
|
+
name: a.icon,
|
|
276
|
+
size: 18,
|
|
277
|
+
filled: a.type === "filter" && a.selected,
|
|
278
|
+
class: y(["shrink-0", M.value])
|
|
279
|
+
}, null, 8, [
|
|
280
|
+
"name",
|
|
281
|
+
"filled",
|
|
282
|
+
"class"
|
|
283
|
+
])) : R.value ? (w(), l("span", {
|
|
284
|
+
key: 2,
|
|
285
|
+
ref_key: "checkEl",
|
|
286
|
+
ref: L,
|
|
287
|
+
class: "-mr-2 flex shrink-0 overflow-hidden",
|
|
288
|
+
style: {
|
|
289
|
+
width: "8px",
|
|
290
|
+
opacity: "0"
|
|
291
|
+
},
|
|
292
|
+
"aria-hidden": "true"
|
|
293
|
+
}, [f(i, {
|
|
294
|
+
name: "check",
|
|
295
|
+
size: 18,
|
|
296
|
+
class: y(["shrink-0", M.value])
|
|
297
|
+
}, null, 8, ["class"])], 512)) : c("", !0),
|
|
298
|
+
u("span", G, [D(e.$slots, "default")]),
|
|
299
|
+
a.trailingIcon ? (w(), s(i, {
|
|
300
|
+
key: 3,
|
|
301
|
+
name: a.trailingIcon,
|
|
302
|
+
size: 18,
|
|
303
|
+
class: y(["shrink-0", a.disabled ? "" : a.selected && T.value ? "text-on-secondary-container" : "text-on-surface-variant"])
|
|
304
|
+
}, null, 8, ["name", "class"])) : c("", !0)
|
|
305
|
+
], 42, W), a.type === "input" && a.removable ? (w(), l("button", {
|
|
306
|
+
key: 0,
|
|
307
|
+
type: "button",
|
|
308
|
+
class: y(["relative -ml-1 mr-2 flex h-6 w-6 shrink-0 items-center justify-center rounded-full outline-none hover:bg-on-surface/8 focus-visible:ring-2 focus-visible:ring-secondary", a.disabled ? "cursor-not-allowed" : "cursor-pointer"]),
|
|
309
|
+
"aria-label": A(g).remove,
|
|
310
|
+
disabled: a.disabled,
|
|
311
|
+
onClick: t[4] ||= P((e) => h("remove"), ["stop"])
|
|
312
|
+
}, [f(i, {
|
|
313
|
+
name: "close",
|
|
314
|
+
size: 18
|
|
315
|
+
})], 10, se)) : c("", !0)], 2)) : (w(), s(ee(a.clickable ? "button" : "span"), {
|
|
316
|
+
key: 1,
|
|
317
|
+
type: a.clickable ? "button" : void 0,
|
|
318
|
+
disabled: a.clickable && a.disabled ? !0 : void 0,
|
|
319
|
+
class: y(["inline-flex h-8 items-center gap-1.5 overflow-hidden px-3 text-label-large transition-colors", [
|
|
320
|
+
C.value,
|
|
321
|
+
S.value,
|
|
322
|
+
a.clickable && !a.disabled ? q : "",
|
|
323
|
+
a.disabled ? "cursor-not-allowed" : ""
|
|
324
|
+
]]),
|
|
325
|
+
style: b(x.value),
|
|
326
|
+
onClick: t[6] ||= (e) => a.clickable && !a.disabled && h("click")
|
|
327
|
+
}, {
|
|
328
|
+
default: N(() => [
|
|
329
|
+
a.icon ? (w(), s(i, {
|
|
330
|
+
key: 0,
|
|
331
|
+
name: a.icon,
|
|
332
|
+
size: 18
|
|
333
|
+
}, null, 8, ["name"])) : c("", !0),
|
|
334
|
+
D(e.$slots, "default"),
|
|
335
|
+
a.removable ? (w(), l("button", {
|
|
336
|
+
key: 1,
|
|
337
|
+
type: "button",
|
|
338
|
+
class: "-mr-1 ml-0.5 inline-flex items-center justify-center rounded-full hover:bg-on-surface/12",
|
|
339
|
+
"aria-label": A(g).remove,
|
|
340
|
+
disabled: a.disabled,
|
|
341
|
+
onClick: t[5] ||= P((e) => h("remove"), ["stop"])
|
|
342
|
+
}, [f(i, {
|
|
343
|
+
name: "close",
|
|
344
|
+
size: 16
|
|
345
|
+
})], 8, K)) : c("", !0)
|
|
346
|
+
]),
|
|
347
|
+
_: 3
|
|
348
|
+
}, 8, [
|
|
349
|
+
"type",
|
|
350
|
+
"disabled",
|
|
351
|
+
"class",
|
|
352
|
+
"style"
|
|
353
|
+
]));
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
//#endregion
|
|
357
|
+
//#region src/composables/_useSegmentRuns.ts
|
|
358
|
+
function ce(e) {
|
|
359
|
+
let t = O(/* @__PURE__ */ new Map());
|
|
360
|
+
function n() {
|
|
361
|
+
let n = /* @__PURE__ */ new Map(), r = [], i = () => {
|
|
362
|
+
r.forEach((e, t) => n.set(e, r.length === 1 ? "single" : t === 0 ? "first" : t === r.length - 1 ? "last" : "middle")), r = [];
|
|
363
|
+
};
|
|
364
|
+
for (let t of e.value?.children ?? []) t.getAttribute("role") === "listitem" ? r.push(t) : i();
|
|
365
|
+
i(), t.value = n;
|
|
366
|
+
}
|
|
367
|
+
let r;
|
|
368
|
+
return x(() => {
|
|
369
|
+
n(), e.value && (r = new MutationObserver(n), r.observe(e.value, { childList: !0 }));
|
|
370
|
+
}), S(() => r?.disconnect()), (e) => e ? t.value.get(e) : void 0;
|
|
371
|
+
}
|
|
372
|
+
//#endregion
|
|
373
|
+
//#region src/components/MList.vue?vue&type=script&setup=true&lang.ts
|
|
374
|
+
var le = ["role"], ue = /* @__PURE__ */ p({
|
|
375
|
+
__name: "MList",
|
|
376
|
+
props: {
|
|
377
|
+
dense: {
|
|
378
|
+
type: Boolean,
|
|
379
|
+
default: !1
|
|
380
|
+
},
|
|
381
|
+
dividers: {
|
|
382
|
+
type: [Boolean, String],
|
|
383
|
+
default: !1
|
|
384
|
+
},
|
|
385
|
+
nav: {
|
|
386
|
+
type: Boolean,
|
|
387
|
+
default: !1
|
|
388
|
+
},
|
|
389
|
+
segmented: {
|
|
390
|
+
type: Boolean,
|
|
391
|
+
default: !1
|
|
392
|
+
},
|
|
393
|
+
selectable: {
|
|
394
|
+
type: Boolean,
|
|
395
|
+
default: !1
|
|
396
|
+
},
|
|
397
|
+
selected: {},
|
|
398
|
+
lines: {}
|
|
399
|
+
},
|
|
400
|
+
emits: ["update:selected"],
|
|
401
|
+
setup(e, { emit: t }) {
|
|
402
|
+
let n = e, r = t, i = E(), a = ce(i);
|
|
403
|
+
T("m-list", {
|
|
404
|
+
segmentPosition: a,
|
|
405
|
+
dense: o(() => n.dense),
|
|
406
|
+
nav: o(() => n.nav),
|
|
407
|
+
segmented: o(() => n.segmented),
|
|
408
|
+
selectable: o(() => n.selectable),
|
|
409
|
+
selected: o(() => n.selected),
|
|
410
|
+
dividers: o(() => n.dividers),
|
|
411
|
+
lines: o(() => n.lines),
|
|
412
|
+
select: (e) => r("update:selected", e)
|
|
413
|
+
});
|
|
414
|
+
let s = () => [...i.value?.querySelectorAll("[role=\"option\"]") ?? []].filter((e) => e.getAttribute("aria-disabled") !== "true");
|
|
415
|
+
function c(e) {
|
|
416
|
+
if (!n.selectable) return;
|
|
417
|
+
let t = s(), r = t.indexOf(document.activeElement);
|
|
418
|
+
if (r < 0) return;
|
|
419
|
+
let i = e.key === "ArrowDown" ? t[r + 1] : e.key === "ArrowUp" ? t[r - 1] : e.key === "Home" ? t[0] : e.key === "End" ? t[t.length - 1] : void 0;
|
|
420
|
+
i && (e.preventDefault(), i.focus());
|
|
421
|
+
}
|
|
422
|
+
function u() {
|
|
423
|
+
if (!n.selectable) return;
|
|
424
|
+
let e = s();
|
|
425
|
+
e.length && !e.some((e) => e.tabIndex === 0) && (e[0].tabIndex = 0);
|
|
426
|
+
}
|
|
427
|
+
x(u), C(() => v(u));
|
|
428
|
+
let d = o(() => [
|
|
429
|
+
"flex flex-col",
|
|
430
|
+
n.segmented ? "gap-0.5 p-2" : "py-2",
|
|
431
|
+
n.nav && !n.segmented && "gap-0.5 px-3"
|
|
432
|
+
]);
|
|
433
|
+
return (t, n) => (w(), l("ul", {
|
|
434
|
+
ref_key: "listEl",
|
|
435
|
+
ref: i,
|
|
436
|
+
role: e.selectable ? "listbox" : "list",
|
|
437
|
+
class: y(d.value),
|
|
438
|
+
onKeydown: c
|
|
439
|
+
}, [D(t.$slots, "default")], 42, le));
|
|
440
|
+
}
|
|
441
|
+
}), Y = { class: "relative -my-2 inline-flex h-12 shrink-0 items-center" }, X = ["checked", "disabled"], Z = {
|
|
442
|
+
key: 0,
|
|
443
|
+
class: "text-body-large text-on-surface"
|
|
444
|
+
}, de = "bg-outline group-hover:bg-on-surface-variant group-active:bg-on-surface-variant peer-focus-visible:bg-on-surface-variant", fe = /* @__PURE__ */ p({
|
|
445
|
+
__name: "MSwitch",
|
|
446
|
+
props: {
|
|
447
|
+
modelValue: { type: Boolean },
|
|
448
|
+
disabled: {
|
|
449
|
+
type: Boolean,
|
|
450
|
+
default: !1
|
|
451
|
+
},
|
|
452
|
+
label: {},
|
|
453
|
+
color: { default: "primary" },
|
|
454
|
+
icon: {
|
|
455
|
+
type: Boolean,
|
|
456
|
+
default: !0
|
|
457
|
+
}
|
|
458
|
+
},
|
|
459
|
+
emits: ["update:modelValue"],
|
|
460
|
+
setup(e, { emit: t }) {
|
|
461
|
+
let n = e, r = t, d = {
|
|
462
|
+
primary: "border-primary bg-primary",
|
|
463
|
+
secondary: "border-secondary bg-secondary",
|
|
464
|
+
tertiary: "border-tertiary bg-tertiary",
|
|
465
|
+
error: "border-error bg-error"
|
|
466
|
+
}, p = {
|
|
467
|
+
primary: "bg-on-primary group-hover:bg-primary-container group-active:bg-primary-container peer-focus-visible:bg-primary-container",
|
|
468
|
+
secondary: "bg-on-secondary group-hover:bg-secondary-container group-active:bg-secondary-container peer-focus-visible:bg-secondary-container",
|
|
469
|
+
tertiary: "bg-on-tertiary group-hover:bg-tertiary-container group-active:bg-tertiary-container peer-focus-visible:bg-tertiary-container",
|
|
470
|
+
error: "bg-on-error group-hover:bg-error-container group-active:bg-error-container peer-focus-visible:bg-error-container"
|
|
471
|
+
}, m = {
|
|
472
|
+
primary: "text-on-primary-container",
|
|
473
|
+
secondary: "text-on-secondary-container",
|
|
474
|
+
tertiary: "text-on-tertiary-container",
|
|
475
|
+
error: "text-on-error-container"
|
|
476
|
+
}, h = {
|
|
477
|
+
primary: "bg-primary",
|
|
478
|
+
secondary: "bg-secondary",
|
|
479
|
+
tertiary: "bg-tertiary",
|
|
480
|
+
error: "bg-error"
|
|
481
|
+
}, g = E(!1);
|
|
482
|
+
function _() {
|
|
483
|
+
n.disabled || (g.value = !0);
|
|
484
|
+
}
|
|
485
|
+
function v() {
|
|
486
|
+
g.value = !1;
|
|
487
|
+
}
|
|
488
|
+
let x = o(() => g.value ? 28 / 24 : n.modelValue ? 1 : 16 / 24), S = o(() => ({
|
|
489
|
+
transform: `translateY(-50%) translateX(${n.modelValue ? 18 : 0}px) scale(${x.value})`,
|
|
490
|
+
transition: n.modelValue ? "transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1), background-color 280ms ease" : "transform 240ms cubic-bezier(0.2, 0, 0, 1), background-color 240ms ease"
|
|
491
|
+
})), C = o(() => ({
|
|
492
|
+
transform: `translateX(${n.modelValue ? 18 : 0}px)`,
|
|
493
|
+
transition: n.modelValue ? "transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1)" : "transform 240ms cubic-bezier(0.2, 0, 0, 1)"
|
|
494
|
+
}));
|
|
495
|
+
return (t, n) => (w(), l("label", {
|
|
496
|
+
class: y(["group inline-flex items-center gap-3 select-none", e.disabled ? "cursor-not-allowed opacity-[0.38]" : "cursor-pointer"]),
|
|
497
|
+
onPointerdown: _,
|
|
498
|
+
onPointerup: v,
|
|
499
|
+
onPointerleave: v,
|
|
500
|
+
onPointercancel: v
|
|
501
|
+
}, [u("span", Y, [u("span", { class: y(["relative inline-flex h-8 w-[52px] items-center rounded-full border-2 transition-colors duration-200", e.modelValue ? d[e.color] : "border-outline bg-surface-container-highest"]) }, [
|
|
502
|
+
u("input", {
|
|
503
|
+
type: "checkbox",
|
|
504
|
+
class: "peer sr-only",
|
|
505
|
+
checked: e.modelValue,
|
|
506
|
+
disabled: e.disabled,
|
|
507
|
+
onChange: n[0] ||= (t) => r("update:modelValue", !e.modelValue)
|
|
508
|
+
}, null, 40, X),
|
|
509
|
+
e.disabled ? c("", !0) : (w(), l("span", {
|
|
510
|
+
key: 0,
|
|
511
|
+
class: y(["pointer-events-none absolute top-1/2 -left-1 h-10 w-10 -translate-y-1/2 rounded-full opacity-0 transition-opacity duration-150 group-hover:opacity-[0.08] group-active:opacity-[0.12] peer-focus-visible:opacity-[0.08]", e.modelValue ? h[e.color] : "bg-on-surface-variant"]),
|
|
512
|
+
style: b(C.value)
|
|
513
|
+
}, null, 6)),
|
|
514
|
+
e.disabled ? c("", !0) : (w(), l("span", {
|
|
515
|
+
key: 1,
|
|
516
|
+
class: "pointer-events-none absolute top-1/2 -left-1 h-10 w-10 -translate-y-1/2 rounded-full ring-0 ring-secondary transition-[box-shadow] duration-150 peer-focus-visible:ring-2",
|
|
517
|
+
style: b(C.value)
|
|
518
|
+
}, null, 4)),
|
|
519
|
+
u("span", {
|
|
520
|
+
class: y(["absolute left-1 top-1/2 flex h-6 w-6 items-center justify-center rounded-full will-change-transform", e.modelValue ? [p[e.color], "shadow-sm"] : de]),
|
|
521
|
+
style: b(S.value)
|
|
522
|
+
}, [f(a, {
|
|
523
|
+
"enter-active-class": "transition-opacity duration-150 delay-[120ms]",
|
|
524
|
+
"enter-from-class": "opacity-0",
|
|
525
|
+
"enter-to-class": "opacity-100",
|
|
526
|
+
"leave-active-class": "transition-opacity duration-75",
|
|
527
|
+
"leave-from-class": "opacity-100",
|
|
528
|
+
"leave-to-class": "opacity-0"
|
|
529
|
+
}, {
|
|
530
|
+
default: N(() => [e.modelValue && e.icon ? (w(), s(i, {
|
|
531
|
+
key: 0,
|
|
532
|
+
name: "check",
|
|
533
|
+
size: 14,
|
|
534
|
+
class: y(m[e.color])
|
|
535
|
+
}, null, 8, ["class"])) : c("", !0)]),
|
|
536
|
+
_: 1
|
|
537
|
+
})], 6)
|
|
538
|
+
], 2)]), e.label ? (w(), l("span", Z, k(e.label), 1)) : c("", !0)], 34));
|
|
539
|
+
}
|
|
540
|
+
}), pe = [
|
|
541
|
+
"tabindex",
|
|
542
|
+
"aria-expanded",
|
|
543
|
+
"aria-controls",
|
|
544
|
+
"aria-disabled"
|
|
545
|
+
], me = { class: "min-w-0 flex-1" }, he = ["id"], ge = { class: "mli-expand-body" }, _e = ["src"], ve = { class: "min-w-0 flex-1" }, ye = 4, be = 8, xe = 16, Se = /* @__PURE__ */ p({
|
|
546
|
+
inheritAttrs: !1,
|
|
547
|
+
__name: "MListItem",
|
|
548
|
+
props: {
|
|
549
|
+
title: {},
|
|
550
|
+
overline: {},
|
|
551
|
+
subtitle: {},
|
|
552
|
+
description: {},
|
|
553
|
+
lines: {},
|
|
554
|
+
icon: {},
|
|
555
|
+
leading: {},
|
|
556
|
+
avatarName: {},
|
|
557
|
+
image: {},
|
|
558
|
+
iconContainerColor: {},
|
|
559
|
+
trailingIcon: {},
|
|
560
|
+
trailingText: {},
|
|
561
|
+
trailing: {},
|
|
562
|
+
trailingValue: { type: Boolean },
|
|
563
|
+
value: {},
|
|
564
|
+
active: {
|
|
565
|
+
type: Boolean,
|
|
566
|
+
default: !1
|
|
567
|
+
},
|
|
568
|
+
disabled: {
|
|
569
|
+
type: Boolean,
|
|
570
|
+
default: !1
|
|
571
|
+
},
|
|
572
|
+
clickable: { type: Boolean },
|
|
573
|
+
href: {},
|
|
574
|
+
to: {},
|
|
575
|
+
expandable: {
|
|
576
|
+
type: Boolean,
|
|
577
|
+
default: !1
|
|
578
|
+
},
|
|
579
|
+
expanded: { type: Boolean }
|
|
580
|
+
},
|
|
581
|
+
emits: [
|
|
582
|
+
"click",
|
|
583
|
+
"update:trailingValue",
|
|
584
|
+
"update:expanded"
|
|
585
|
+
],
|
|
586
|
+
setup(e, { emit: t }) {
|
|
587
|
+
let n = e, d = t, p = m(), v = () => !!p?.vnode.props?.onClick, b = E(n.expanded ?? !1);
|
|
588
|
+
M(() => n.expanded, (e) => {
|
|
589
|
+
e !== void 0 && (b.value = e);
|
|
590
|
+
});
|
|
591
|
+
let x = o(() => b.value), S = g("m-list", null), C = o(() => n.lines ? n.lines : S?.lines.value ? S.lines.value : n.description || n.overline && n.subtitle ? 3 : n.subtitle || n.overline ? 2 : 1), T = o(() => n.clickable || n.href || n.to || v() || S?.selectable.value || n.expandable), O = o(() => !!S?.selectable.value && n.value != null && !n.href && !n.to && !n.expandable), j = o(() => !!(n.href || n.to)), P = o(() => !O.value && !j.value && !n.expandable && (n.clickable || v())), F = o(() => j.value || P.value), I = o(() => O.value ? "option" : P.value ? "button" : j.value ? void 0 : "listitem"), L = o(() => {
|
|
592
|
+
if (O.value) return z.value && !n.disabled ? 0 : -1;
|
|
593
|
+
if (P.value) return n.disabled ? -1 : 0;
|
|
594
|
+
});
|
|
595
|
+
function R(e) {
|
|
596
|
+
(O.value || P.value) && (e.key !== "Enter" && e.key !== " " || e.target !== e.currentTarget || (e.preventDefault(), $(e)));
|
|
597
|
+
}
|
|
598
|
+
let z = o(() => n.active ? !0 : S?.selectable.value && n.value != null ? S.selected.value === n.value : !1), B = o(() => n.leading ? n.leading : n.icon ? "icon" : n.avatarName ? "avatar" : n.image ? "image" : null), V = o(() => n.expandable ? "expand" : n.trailing ? n.trailing : n.trailingIcon ? "icon" : n.trailingText ? "text" : null), re = {
|
|
599
|
+
primary: "bg-primary-container text-on-primary-container",
|
|
600
|
+
secondary: "bg-secondary-container text-on-secondary-container",
|
|
601
|
+
tertiary: "bg-tertiary-container text-on-tertiary-container",
|
|
602
|
+
error: "bg-error-container text-on-error-container",
|
|
603
|
+
success: "bg-success-container text-on-success-container"
|
|
604
|
+
}, ie = o(() => S?.dense.value ?? !1), H = o(() => S?.nav.value ?? !1), ae = o(() => S?.segmented.value ?? !1), oe = o(() => S?.dividers.value ?? !1), W = o(() => z.value ? "text-on-secondary-container" : "text-on-surface"), G = o(() => z.value ? "text-on-secondary-container" : "text-on-surface-variant"), se = o(() => ie.value ? "" : C.value === 3 ? "min-h-22" : C.value === 2 ? "min-h-18" : "min-h-14"), K = o(() => [
|
|
605
|
+
"mli-row relative flex w-full items-center gap-4 text-left",
|
|
606
|
+
ae.value ? "bg-surface-container px-4" : H.value ? "rounded-full px-4" : "px-4",
|
|
607
|
+
ie.value ? "py-1" : C.value === 3 ? "py-3" : "py-2",
|
|
608
|
+
se.value,
|
|
609
|
+
T.value && !n.disabled && "cursor-pointer transition-colors duration-150 hover:bg-on-surface/8 active:bg-on-surface/12",
|
|
610
|
+
z.value && "bg-secondary-container text-on-secondary-container",
|
|
611
|
+
n.disabled && "opacity-[0.38] pointer-events-none"
|
|
612
|
+
]), q = E(null), J = E(null), ce = (e, { slots: t }) => F.value ? h("li", {
|
|
613
|
+
role: "listitem",
|
|
614
|
+
ref: (e) => {
|
|
615
|
+
J.value = e;
|
|
616
|
+
}
|
|
617
|
+
}, t.default?.()) : t.default?.(), le = E(null), ue = (e) => e && "$el" in e ? e.$el : e, Y = E(!1), X = E(!1), Z = E(!1), de = o(() => ae.value ? S?.segmentPosition(F.value ? J.value : ue(q.value)) : void 0), Se = o(() => {
|
|
618
|
+
if (H.value) return [];
|
|
619
|
+
let e = T.value && !n.disabled, t = e && X.value || z.value || e && Z.value ? xe : e && Y.value ? be : null;
|
|
620
|
+
if (t !== null) return [
|
|
621
|
+
t,
|
|
622
|
+
t,
|
|
623
|
+
t,
|
|
624
|
+
t
|
|
625
|
+
];
|
|
626
|
+
let r = de.value, i = r === "first" || r === "single" ? xe : ye, a = r === "last" || r === "single" ? xe : ye;
|
|
627
|
+
return [
|
|
628
|
+
i,
|
|
629
|
+
i,
|
|
630
|
+
a,
|
|
631
|
+
a
|
|
632
|
+
];
|
|
633
|
+
}), { snap: Ce } = r(() => Se.value, (e) => {
|
|
634
|
+
let t = le.value ?? ue(q.value);
|
|
635
|
+
t && (t.style.borderRadius = e.length ? e.map((e) => `${e}px`).join(" ") : "");
|
|
636
|
+
});
|
|
637
|
+
M([de, H], () => Ce());
|
|
638
|
+
function we(e) {
|
|
639
|
+
e.pointerType !== "touch" && (Y.value = !0);
|
|
640
|
+
}
|
|
641
|
+
function Te() {
|
|
642
|
+
Y.value = !1, X.value = !1;
|
|
643
|
+
}
|
|
644
|
+
function Ee(e) {
|
|
645
|
+
e.button === 0 && (X.value = !0);
|
|
646
|
+
}
|
|
647
|
+
function Q() {
|
|
648
|
+
X.value = !1;
|
|
649
|
+
}
|
|
650
|
+
function De(e) {
|
|
651
|
+
Z.value = e.currentTarget.matches(":focus-visible");
|
|
652
|
+
}
|
|
653
|
+
function Oe() {
|
|
654
|
+
Z.value = !1;
|
|
655
|
+
}
|
|
656
|
+
let ke = o(() => n.href ? "a" : n.to ? "router-link" : P.value ? "div" : "li"), Ae = o(() => n.href ? { href: n.href } : n.to ? { to: n.to } : {}), je = te();
|
|
657
|
+
function Me(e) {
|
|
658
|
+
(e.key === "Enter" || e.key === " ") && e.target === e.currentTarget && (e.preventDefault(), $(e));
|
|
659
|
+
}
|
|
660
|
+
function Ne(e) {
|
|
661
|
+
n.disabled || (b.value = !b.value, d("update:expanded", b.value), d("click", e));
|
|
662
|
+
}
|
|
663
|
+
function $(e) {
|
|
664
|
+
if (!n.disabled) {
|
|
665
|
+
if (n.expandable) {
|
|
666
|
+
Ne(e);
|
|
667
|
+
return;
|
|
668
|
+
}
|
|
669
|
+
S?.selectable.value && n.value != null && S.select(n.value), d("click", e);
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
function Pe() {
|
|
673
|
+
d("update:trailingValue", !n.trailingValue);
|
|
674
|
+
}
|
|
675
|
+
return (t, n) => e.expandable ? (w(), l("li", _({
|
|
676
|
+
key: 0,
|
|
677
|
+
ref_key: "rootEl",
|
|
678
|
+
ref: q
|
|
679
|
+
}, t.$attrs, { role: "listitem" }), [u("div", {
|
|
680
|
+
ref_key: "shapeEl",
|
|
681
|
+
ref: le,
|
|
682
|
+
role: "button",
|
|
683
|
+
tabindex: e.disabled ? -1 : 0,
|
|
684
|
+
"aria-expanded": x.value,
|
|
685
|
+
"aria-controls": A(je),
|
|
686
|
+
"aria-disabled": e.disabled || void 0,
|
|
687
|
+
class: y(["focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary", K.value]),
|
|
688
|
+
onClick: $,
|
|
689
|
+
onKeydown: Me,
|
|
690
|
+
onFocus: De,
|
|
691
|
+
onBlur: Oe,
|
|
692
|
+
onPointerenter: we,
|
|
693
|
+
onPointerleave: Te,
|
|
694
|
+
onPointerdown: Ee,
|
|
695
|
+
onPointerup: Q,
|
|
696
|
+
onPointercancel: Q
|
|
697
|
+
}, [
|
|
698
|
+
D(t.$slots, "leading", {}, () => [B.value === "icon" ? (w(), s(i, {
|
|
699
|
+
key: 0,
|
|
700
|
+
name: e.icon,
|
|
701
|
+
size: 24,
|
|
702
|
+
class: y(["shrink-0", G.value])
|
|
703
|
+
}, null, 8, ["name", "class"])) : c("", !0)]),
|
|
704
|
+
u("div", me, [D(t.$slots, "overline", {}, () => [e.overline ? (w(), l("p", {
|
|
705
|
+
key: 0,
|
|
706
|
+
class: y(["truncate text-label-small", G.value])
|
|
707
|
+
}, k(e.overline), 3)) : c("", !0)]), D(t.$slots, "default", {}, () => [u("p", { class: y(["truncate text-body-large", W.value]) }, k(e.title), 3), e.subtitle && C.value >= 2 ? (w(), l("p", {
|
|
708
|
+
key: 0,
|
|
709
|
+
class: y(["text-body-medium", [G.value, C.value === 2 && "truncate"]])
|
|
710
|
+
}, k(e.subtitle), 3)) : c("", !0)])]),
|
|
711
|
+
f(i, {
|
|
712
|
+
name: x.value ? "expand_less" : "expand_more",
|
|
713
|
+
size: 20,
|
|
714
|
+
class: y(["shrink-0", G.value])
|
|
715
|
+
}, null, 8, ["name", "class"])
|
|
716
|
+
], 42, pe), f(a, { name: "mli-expand" }, {
|
|
717
|
+
default: N(() => [x.value ? (w(), l("div", {
|
|
718
|
+
key: 0,
|
|
719
|
+
id: A(je),
|
|
720
|
+
class: "mli-expand-grid"
|
|
721
|
+
}, [u("div", ge, [D(t.$slots, "children")])], 8, he)) : c("", !0)]),
|
|
722
|
+
_: 3
|
|
723
|
+
})], 16)) : (w(), s(ce, { key: 1 }, {
|
|
724
|
+
default: N(() => [(w(), s(ee(ke.value), _({
|
|
725
|
+
class: K.value,
|
|
726
|
+
ref_key: "rootEl",
|
|
727
|
+
ref: q
|
|
728
|
+
}, {
|
|
729
|
+
...Ae.value,
|
|
730
|
+
...t.$attrs
|
|
731
|
+
}, {
|
|
732
|
+
role: I.value,
|
|
733
|
+
tabindex: L.value,
|
|
734
|
+
"aria-selected": O.value ? z.value : void 0,
|
|
735
|
+
"aria-disabled": (O.value || P.value) && e.disabled ? "true" : void 0,
|
|
736
|
+
onClick: $,
|
|
737
|
+
onKeydown: R,
|
|
738
|
+
onPointerenter: we,
|
|
739
|
+
onPointerleave: Te,
|
|
740
|
+
onPointerdown: Ee,
|
|
741
|
+
onPointerup: Q,
|
|
742
|
+
onPointercancel: Q,
|
|
743
|
+
onFocus: De,
|
|
744
|
+
onBlur: Oe
|
|
745
|
+
}), {
|
|
746
|
+
default: N(() => [
|
|
747
|
+
oe.value ? (w(), l("div", {
|
|
748
|
+
key: 0,
|
|
749
|
+
class: y(["absolute top-0 right-0 h-px bg-outline-variant", oe.value === "inset" ? "left-16" : "left-0"])
|
|
750
|
+
}, null, 2)) : c("", !0),
|
|
751
|
+
D(t.$slots, "leading", {}, () => [B.value === "icon" ? (w(), s(i, {
|
|
752
|
+
key: 0,
|
|
753
|
+
name: e.icon,
|
|
754
|
+
size: 24,
|
|
755
|
+
class: y(["shrink-0", G.value])
|
|
756
|
+
}, null, 8, ["name", "class"])) : B.value === "icon-container" ? (w(), l("div", {
|
|
757
|
+
key: 1,
|
|
758
|
+
class: y(["flex h-10 w-10 shrink-0 items-center justify-center rounded-full", re[e.iconContainerColor || "primary"]])
|
|
759
|
+
}, [f(i, {
|
|
760
|
+
name: e.icon,
|
|
761
|
+
size: 24
|
|
762
|
+
}, null, 8, ["name"])], 2)) : B.value === "avatar" ? (w(), s(ne, {
|
|
763
|
+
key: 2,
|
|
764
|
+
name: e.avatarName,
|
|
765
|
+
size: 40,
|
|
766
|
+
class: "shrink-0"
|
|
767
|
+
}, null, 8, ["name"])) : B.value === "image" ? (w(), l("img", {
|
|
768
|
+
key: 3,
|
|
769
|
+
src: e.image,
|
|
770
|
+
alt: "",
|
|
771
|
+
class: "h-14 w-14 shrink-0 rounded-md object-cover"
|
|
772
|
+
}, null, 8, _e)) : B.value === "checkbox" ? (w(), s(U, {
|
|
773
|
+
key: 4,
|
|
774
|
+
"model-value": z.value,
|
|
775
|
+
class: "shrink-0"
|
|
776
|
+
}, null, 8, ["model-value"])) : c("", !0)]),
|
|
777
|
+
u("div", ve, [D(t.$slots, "overline", {}, () => [e.overline ? (w(), l("p", {
|
|
778
|
+
key: 0,
|
|
779
|
+
class: y(["truncate text-label-small", G.value])
|
|
780
|
+
}, k(e.overline), 3)) : c("", !0)]), D(t.$slots, "default", {}, () => [
|
|
781
|
+
u("p", { class: y(["truncate text-body-large", W.value]) }, k(e.title), 3),
|
|
782
|
+
e.subtitle && C.value >= 2 ? (w(), l("p", {
|
|
783
|
+
key: 0,
|
|
784
|
+
class: y(["text-body-medium", [G.value, C.value === 2 && "truncate"]])
|
|
785
|
+
}, k(e.subtitle), 3)) : c("", !0),
|
|
786
|
+
e.description && C.value >= 3 ? (w(), l("p", {
|
|
787
|
+
key: 1,
|
|
788
|
+
class: y(["line-clamp-2 text-body-small", G.value])
|
|
789
|
+
}, k(e.description), 3)) : c("", !0)
|
|
790
|
+
])]),
|
|
791
|
+
D(t.$slots, "trailing", {}, () => [V.value === "icon" ? (w(), s(i, {
|
|
792
|
+
key: 0,
|
|
793
|
+
name: e.trailingIcon,
|
|
794
|
+
size: 24,
|
|
795
|
+
class: y(["shrink-0", G.value])
|
|
796
|
+
}, null, 8, ["name", "class"])) : V.value === "text" ? (w(), l("span", {
|
|
797
|
+
key: 1,
|
|
798
|
+
class: y(["shrink-0 text-label-small", G.value])
|
|
799
|
+
}, k(e.trailingText), 3)) : V.value === "switch" ? (w(), s(fe, {
|
|
800
|
+
key: 2,
|
|
801
|
+
"model-value": !!e.trailingValue,
|
|
802
|
+
"onUpdate:modelValue": Pe
|
|
803
|
+
}, null, 8, ["model-value"])) : V.value === "checkbox" ? (w(), s(U, {
|
|
804
|
+
key: 3,
|
|
805
|
+
"model-value": !!e.trailingValue,
|
|
806
|
+
"onUpdate:modelValue": Pe
|
|
807
|
+
}, null, 8, ["model-value"])) : c("", !0)])
|
|
808
|
+
]),
|
|
809
|
+
_: 3
|
|
810
|
+
}, 16, [
|
|
811
|
+
"class",
|
|
812
|
+
"role",
|
|
813
|
+
"tabindex",
|
|
814
|
+
"aria-selected",
|
|
815
|
+
"aria-disabled"
|
|
816
|
+
]))]),
|
|
817
|
+
_: 3
|
|
818
|
+
}));
|
|
819
|
+
}
|
|
820
|
+
});
|
|
821
|
+
//#endregion
|
|
822
|
+
export { J as a, ne as c, ce as i, fe as n, U as o, ue as r, ie as s, Se as t };
|
|
823
|
+
|
|
824
|
+
//# sourceMappingURL=MListItem-DnPtv-hY.js.map
|