@m3ui-vue/m3ui-vue 1.2.2 → 1.3.1
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 +3010 -376
- package/dist/MButton-Bl_BSUep.js +172 -0
- package/dist/MButton-Bl_BSUep.js.map +1 -0
- package/dist/MDialog-D_Yik8ou.js +173 -0
- package/dist/MDialog-D_Yik8ou.js.map +1 -0
- package/dist/MIconButton-DoNotQ9v.js +282 -0
- package/dist/MIconButton-DoNotQ9v.js.map +1 -0
- package/dist/MListItem-BxifHJdU.js +824 -0
- package/dist/MListItem-BxifHJdU.js.map +1 -0
- package/dist/MLoadingIndicator-BxbFhSX6.js +115 -0
- package/dist/MLoadingIndicator-BxbFhSX6.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-BeN9QcB3.js +435 -0
- package/dist/MSeekBar-BeN9QcB3.js.map +1 -0
- package/dist/MSegmentedButton-DL9JtJFX.js +65 -0
- package/dist/MSegmentedButton-DL9JtJFX.js.map +1 -0
- package/dist/MSlider-BVSbJlGS.js +691 -0
- package/dist/MSlider-BVSbJlGS.js.map +1 -0
- package/dist/MSpinner-C2SUnWk4.js +65 -0
- package/dist/MSpinner-C2SUnWk4.js.map +1 -0
- package/dist/MTextField-CEkWSZ2v.js +296 -0
- package/dist/MTextField-CEkWSZ2v.js.map +1 -0
- package/dist/MTooltip-CodJGEO-.js +756 -0
- package/dist/MTooltip-CodJGEO-.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 +150 -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 +248 -0
- package/dist/components/MFloorPlanInspector.vue.d.ts +56 -0
- package/dist/components/MFloorPlanToolbar.vue.d.ts +51 -0
- package/dist/components/MFlow.vue.d.ts +318 -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/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 +2 -2
- 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/_flowPanel.d.ts +2 -0
- package/dist/composables/_flowSlot.d.ts +5 -0
- package/dist/composables/_ganttTime.d.ts +41 -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/useDrawing.d.ts +44 -0
- package/dist/composables/useFloorPlan.d.ts +58 -0
- package/dist/composables/useFlow.d.ts +266 -0
- package/dist/composables/useGantt.d.ts +87 -0
- package/dist/composables/useLocale.d.ts +204 -0
- package/dist/composables/useMediaPlayer.d.ts +101 -0
- package/dist/composables/usePdf.d.ts +119 -0
- package/dist/composables/useResourceTimeline.d.ts +70 -0
- package/dist/draw.d.ts +7 -0
- package/dist/draw.js +1702 -0
- package/dist/draw.js.map +1 -0
- package/dist/flow.d.ts +14 -0
- package/dist/flow.js +3547 -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 +9 -0
- package/dist/locales/index.js +1435 -7
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +8248 -7637
- package/dist/m3ui.js.map +1 -1
- package/dist/map.js +113 -108
- 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/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-CaWwi-b6.js} +206 -2
- package/dist/useLocale-CaWwi-b6.js.map +1 -0
- package/dist/{useThemeTokens-y0HZpyhL.js → useThemeTokens-DQQcaWbE.js} +40 -54
- 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 +118 -0
- package/src/__tests__/MFloorPlan.test.ts +299 -0
- package/src/__tests__/MFlow.test.ts +590 -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__/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__/useMediaPlayer.test.ts +182 -0
- package/src/__tests__/usePdf.test.ts +102 -0
- package/src/components/MAudioPlayer.vue +319 -0
- package/src/components/MDrawCanvas.vue +819 -0
- package/src/components/MDrawLayers.vue +114 -0
- package/src/components/MDrawToolbar.vue +171 -0
- package/src/components/MFloorPlan.vue +1080 -0
- package/src/components/MFloorPlanInspector.vue +169 -0
- package/src/components/MFloorPlanToolbar.vue +128 -0
- package/src/components/MFlow.vue +2060 -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/MMaskField.vue +13 -0
- package/src/components/MNumberField.vue +13 -0
- package/src/components/MPdfViewer.vue +1270 -0
- package/src/components/MResourceTimeline.vue +1020 -0
- package/src/components/MTagInput.vue +13 -0
- package/src/components/MTextField.vue +16 -0
- 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/_flowPanel.ts +13 -0
- package/src/composables/_flowSlot.ts +6 -0
- package/src/composables/_ganttTime.ts +200 -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/useDrawing.ts +53 -0
- package/src/composables/useFloorPlan.ts +73 -0
- package/src/composables/useFlow.ts +250 -0
- package/src/composables/useGantt.ts +92 -0
- package/src/composables/useLocale.ts +410 -0
- package/src/composables/useMediaPlayer.ts +406 -0
- package/src/composables/usePdf.ts +456 -0
- package/src/composables/useResourceTimeline.ts +76 -0
- package/src/draw.ts +25 -0
- package/src/flow.ts +26 -0
- package/src/gantt.ts +12 -0
- package/src/index.ts +9 -0
- package/src/locales/de.ts +204 -0
- package/src/locales/es.ts +204 -0
- package/src/locales/fr.ts +204 -0
- package/src/locales/ja.ts +204 -0
- package/src/locales/ko.ts +204 -0
- package/src/locales/pt.ts +204 -0
- package/src/locales/zh.ts +204 -0
- package/src/media.ts +5 -0
- package/src/pdf.ts +15 -0
- package/dist/MMenuItem-D4Gx_l3F.js +0 -929
- package/dist/MMenuItem-D4Gx_l3F.js.map +0 -1
- package/dist/MSlider-Dx_S3vJ9.js +0 -1506
- package/dist/MSlider-Dx_S3vJ9.js.map +0 -1
- package/dist/MTextField-Bz8JIsnl.js +0 -633
- package/dist/MTextField-Bz8JIsnl.js.map +0 -1
- package/dist/useLocale-JYxDDeXC.js.map +0 -1
- package/dist/useThemeTokens-y0HZpyhL.js.map +0 -1
package/dist/MSlider-Dx_S3vJ9.js
DELETED
|
@@ -1,1506 +0,0 @@
|
|
|
1
|
-
import { i as e } from "./useLocale-JYxDDeXC.js";
|
|
2
|
-
import { l as t, o as n, s as r } from "./MTextField-Bz8JIsnl.js";
|
|
3
|
-
import { t as i } from "./MIcon-Bxh9j135.js";
|
|
4
|
-
import { Fragment as a, Transition as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, getCurrentInstance as h, h as g, inject as _, mergeProps as v, nextTick as y, normalizeClass as b, normalizeStyle as x, onBeforeUnmount as S, onMounted as C, onUnmounted as w, onUpdated as T, openBlock as E, provide as D, ref as O, renderList as k, renderSlot as A, resolveDynamicComponent as ee, shallowRef as j, toDisplayString as M, unref as te, useId as N, useSlots as P, watch as F, withCtx as ne, withModifiers as I } from "vue";
|
|
5
|
-
//#endregion
|
|
6
|
-
//#region src/components/MAvatar.vue
|
|
7
|
-
var L = /* @__PURE__ */ m({
|
|
8
|
-
__name: "MAvatar",
|
|
9
|
-
props: {
|
|
10
|
-
name: {},
|
|
11
|
-
fallback: {},
|
|
12
|
-
size: { default: 40 }
|
|
13
|
-
},
|
|
14
|
-
setup(e) {
|
|
15
|
-
let t = e, n = s(() => {
|
|
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) => (E(), u("div", {
|
|
23
|
-
class: "inline-flex shrink-0 items-center justify-center rounded-full bg-primary-container font-medium text-on-primary-container",
|
|
24
|
-
style: x({
|
|
25
|
-
width: `${e.size}px`,
|
|
26
|
-
height: `${e.size}px`,
|
|
27
|
-
fontSize: `${Math.round(e.size * .4)}px`
|
|
28
|
-
})
|
|
29
|
-
}, M(n.value), 5));
|
|
30
|
-
}
|
|
31
|
-
}), R = [
|
|
32
|
-
"role",
|
|
33
|
-
"tabindex",
|
|
34
|
-
"aria-disabled"
|
|
35
|
-
], z = ["src", "alt"], B = {
|
|
36
|
-
key: 1,
|
|
37
|
-
class: "px-4 pt-4 pb-2"
|
|
38
|
-
}, re = {
|
|
39
|
-
key: 2,
|
|
40
|
-
class: "px-4 pt-4 pb-2"
|
|
41
|
-
}, ie = { class: "text-title-large font-medium text-on-surface" }, V = {
|
|
42
|
-
key: 0,
|
|
43
|
-
class: "mt-1 text-body-medium text-on-surface-variant"
|
|
44
|
-
}, H = {
|
|
45
|
-
key: 3,
|
|
46
|
-
class: "flex justify-end gap-2 px-4 pt-2 pb-4"
|
|
47
|
-
}, ae = "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]", oe = /* @__PURE__ */ m({
|
|
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 = s(() => 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 = s(() => (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
|
-
}, o = s(() => t.clickable && !t.disabled);
|
|
87
|
-
function c(e) {
|
|
88
|
-
o.value && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.currentTarget.click());
|
|
89
|
-
}
|
|
90
|
-
return (t, s) => (E(), u("div", {
|
|
91
|
-
class: b(["overflow-hidden rounded-md transition-shadow duration-150", [
|
|
92
|
-
i.value,
|
|
93
|
-
o.value ? [
|
|
94
|
-
"cursor-pointer",
|
|
95
|
-
a[n.value],
|
|
96
|
-
ae
|
|
97
|
-
] : "",
|
|
98
|
-
e.disabled ? "cursor-not-allowed pointer-events-none" : ""
|
|
99
|
-
]]),
|
|
100
|
-
style: x({ "--field-bg": r[n.value] }),
|
|
101
|
-
role: e.clickable ? "button" : void 0,
|
|
102
|
-
tabindex: o.value ? 0 : void 0,
|
|
103
|
-
"aria-disabled": e.clickable && e.disabled ? "true" : void 0,
|
|
104
|
-
onKeydown: c
|
|
105
|
-
}, [
|
|
106
|
-
e.image || t.$slots.media ? (E(), u("div", {
|
|
107
|
-
key: 0,
|
|
108
|
-
class: b(["w-full overflow-hidden", e.imageHeight ?? "h-48"])
|
|
109
|
-
}, [e.image ? (E(), u("img", {
|
|
110
|
-
key: 0,
|
|
111
|
-
src: e.image,
|
|
112
|
-
alt: e.imageAlt ?? "",
|
|
113
|
-
class: "h-full w-full object-cover"
|
|
114
|
-
}, null, 8, z)) : A(t.$slots, "media", {}, void 0, void 0, 1)], 2)) : l("", !0),
|
|
115
|
-
t.$slots.header ? (E(), u("div", B, [A(t.$slots, "header")])) : e.title ? (E(), u("div", re, [d("h3", ie, M(e.title), 1), e.subtitle ? (E(), u("p", V, M(e.subtitle), 1)) : l("", !0)])) : l("", !0),
|
|
116
|
-
A(t.$slots, "default"),
|
|
117
|
-
t.$slots.actions ? (E(), u("div", H, [A(t.$slots, "actions")])) : l("", !0)
|
|
118
|
-
], 46, R));
|
|
119
|
-
}
|
|
120
|
-
}), se = { class: "relative -m-[11px] inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full" }, U = [
|
|
121
|
-
"checked",
|
|
122
|
-
"disabled",
|
|
123
|
-
"aria-label"
|
|
124
|
-
], ce = {
|
|
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
|
-
}, le = /* @__PURE__ */ m({
|
|
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) => (E(), u("label", { class: b(["group inline-flex items-center gap-2 select-none", e.disabled ? "cursor-not-allowed" : "cursor-pointer"]) }, [d("span", se, [
|
|
157
|
-
d("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, U),
|
|
165
|
-
e.disabled ? l("", !0) : (E(), u("span", {
|
|
166
|
-
key: 0,
|
|
167
|
-
class: b(["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 ? l("", !0) : (E(), u("span", ce)),
|
|
170
|
-
d("span", { class: b(["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"]) }, [p(i, {
|
|
171
|
-
name: e.indeterminate ? "remove" : "check",
|
|
172
|
-
size: 18,
|
|
173
|
-
class: b(["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 ? (E(), u("span", {
|
|
176
|
-
key: 0,
|
|
177
|
-
class: b(["text-body-large", e.disabled ? "text-on-surface/38" : "text-on-surface"])
|
|
178
|
-
}, [A(t.$slots, "default", {}, () => [f(M(e.label), 1)])], 2)) : l("", !0)], 2));
|
|
179
|
-
}
|
|
180
|
-
}), ue = ["disabled", "aria-pressed"], W = { class: "whitespace-nowrap" }, de = ["aria-label", "disabled"], G = ["aria-label", "disabled"], fe = "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", pe = /* @__PURE__ */ m({
|
|
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: o }) {
|
|
214
|
-
let f = [
|
|
215
|
-
"neutral",
|
|
216
|
-
"primary",
|
|
217
|
-
"success",
|
|
218
|
-
"error",
|
|
219
|
-
"tertiary",
|
|
220
|
-
"secondary"
|
|
221
|
-
], m = a, h = o, g = e(), _ = P(), v = s(() => !!m.tone && !f.includes(m.tone)), y = s(() => {
|
|
222
|
-
if (v.value) return {
|
|
223
|
-
"--chip-bg": m.tone + "22",
|
|
224
|
-
"--chip-color": m.tone
|
|
225
|
-
};
|
|
226
|
-
}), S = s(() => {
|
|
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 = s(() => m.selected ? "rounded-full" : "rounded-md"), w = s(() => m.type === "filter" || m.type === "input"), T = s(() => m.type === "input" && !!_.avatar), D = s(() => !!m.trailingIcon || m.type === "input" && m.removable), k = s(() => {
|
|
240
|
-
let e = w.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
|
-
}), j = s(() => m.disabled ? "" : m.type === "assist" || m.type === "suggestion" ? "text-primary" : m.selected ? "text-on-secondary-container" : "text-on-surface-variant"), M = s(() => m.type === "input" ? [T.value ? "pl-1" : m.icon ? "pl-2" : "pl-3", D.value ? "pr-2" : "pr-3"] : [m.icon || R.value ? "pl-2" : "pl-4", D.value ? "pr-2" : "pr-4"]), N = O(!1), F = O(), L = O(), R = s(() => m.type === "filter" && !m.icon);
|
|
246
|
-
t(() => m.type === "filter" || m.type === "input" ? [N.value ? 8 : m.selected ? 16 : 12, R.value ? m.selected ? 26 : 8 : 0] : [], ([e, t]) => {
|
|
247
|
-
F.value && e !== void 0 && (F.value.style.borderRadius = `${e}px`), L.value && t !== void 0 && (L.value.style.width = `${t}px`);
|
|
248
|
-
}, r), t(() => 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 || (w.value && h("update:selected", !m.selected), h("click"));
|
|
253
|
-
}
|
|
254
|
-
return (e, t) => a.type ? (E(), u("span", {
|
|
255
|
-
key: 0,
|
|
256
|
-
ref_key: "typedEl",
|
|
257
|
-
ref: F,
|
|
258
|
-
class: b(["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", [k.value, a.type === "assist" || a.type === "suggestion" ? "rounded-sm" : "rounded-md"]])
|
|
259
|
-
}, [d("button", {
|
|
260
|
-
type: "button",
|
|
261
|
-
class: b(["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", [M.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": w.value ? a.selected : void 0,
|
|
264
|
-
onPointerdown: t[0] ||= (e) => N.value = !0,
|
|
265
|
-
onPointerup: t[1] ||= (e) => N.value = !1,
|
|
266
|
-
onPointerleave: t[2] ||= (e) => N.value = !1,
|
|
267
|
-
onPointercancel: t[3] ||= (e) => N.value = !1,
|
|
268
|
-
onClick: z
|
|
269
|
-
}, [
|
|
270
|
-
T.value ? (E(), u("span", {
|
|
271
|
-
key: 0,
|
|
272
|
-
class: b(["-my-1 flex h-6 w-6 shrink-0 items-center justify-center overflow-hidden rounded-full", a.disabled ? "opacity-38" : ""])
|
|
273
|
-
}, [A(e.$slots, "avatar")], 2)) : a.icon ? (E(), c(i, {
|
|
274
|
-
key: 1,
|
|
275
|
-
name: a.icon,
|
|
276
|
-
size: 18,
|
|
277
|
-
filled: a.type === "filter" && a.selected,
|
|
278
|
-
class: b(["shrink-0", j.value])
|
|
279
|
-
}, null, 8, [
|
|
280
|
-
"name",
|
|
281
|
-
"filled",
|
|
282
|
-
"class"
|
|
283
|
-
])) : R.value ? (E(), u("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
|
-
}, [p(i, {
|
|
294
|
-
name: "check",
|
|
295
|
-
size: 18,
|
|
296
|
-
class: b(["shrink-0", j.value])
|
|
297
|
-
}, null, 8, ["class"])], 512)) : l("", !0),
|
|
298
|
-
d("span", W, [A(e.$slots, "default")]),
|
|
299
|
-
a.trailingIcon ? (E(), c(i, {
|
|
300
|
-
key: 3,
|
|
301
|
-
name: a.trailingIcon,
|
|
302
|
-
size: 18,
|
|
303
|
-
class: b(["shrink-0", a.disabled ? "" : a.selected && w.value ? "text-on-secondary-container" : "text-on-surface-variant"])
|
|
304
|
-
}, null, 8, ["name", "class"])) : l("", !0)
|
|
305
|
-
], 42, ue), a.type === "input" && a.removable ? (E(), u("button", {
|
|
306
|
-
key: 0,
|
|
307
|
-
type: "button",
|
|
308
|
-
class: b(["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": te(g).remove,
|
|
310
|
-
disabled: a.disabled,
|
|
311
|
-
onClick: t[4] ||= I((e) => h("remove"), ["stop"])
|
|
312
|
-
}, [p(i, {
|
|
313
|
-
name: "close",
|
|
314
|
-
size: 18
|
|
315
|
-
})], 10, de)) : l("", !0)], 2)) : (E(), c(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: b(["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 ? fe : "",
|
|
323
|
-
a.disabled ? "cursor-not-allowed" : ""
|
|
324
|
-
]]),
|
|
325
|
-
style: x(y.value),
|
|
326
|
-
onClick: t[6] ||= (e) => a.clickable && !a.disabled && h("click")
|
|
327
|
-
}, {
|
|
328
|
-
default: ne(() => [
|
|
329
|
-
a.icon ? (E(), c(i, {
|
|
330
|
-
key: 0,
|
|
331
|
-
name: a.icon,
|
|
332
|
-
size: 18
|
|
333
|
-
}, null, 8, ["name"])) : l("", !0),
|
|
334
|
-
A(e.$slots, "default"),
|
|
335
|
-
a.removable ? (E(), u("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": te(g).remove,
|
|
340
|
-
disabled: a.disabled,
|
|
341
|
-
onClick: t[5] ||= I((e) => h("remove"), ["stop"])
|
|
342
|
-
}, [p(i, {
|
|
343
|
-
name: "close",
|
|
344
|
-
size: 16
|
|
345
|
-
})], 8, G)) : l("", !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 K(e) {
|
|
359
|
-
let t = j(/* @__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 C(() => {
|
|
369
|
-
n(), e.value && (r = new MutationObserver(n), r.observe(e.value, { childList: !0 }));
|
|
370
|
-
}), w(() => 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 q = ["role"], J = /* @__PURE__ */ m({
|
|
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 = O(), a = K(i);
|
|
403
|
-
D("m-list", {
|
|
404
|
-
segmentPosition: a,
|
|
405
|
-
dense: s(() => n.dense),
|
|
406
|
-
nav: s(() => n.nav),
|
|
407
|
-
segmented: s(() => n.segmented),
|
|
408
|
-
selectable: s(() => n.selectable),
|
|
409
|
-
selected: s(() => n.selected),
|
|
410
|
-
dividers: s(() => n.dividers),
|
|
411
|
-
lines: s(() => n.lines),
|
|
412
|
-
select: (e) => r("update:selected", e)
|
|
413
|
-
});
|
|
414
|
-
let o = () => [...i.value?.querySelectorAll("[role=\"option\"]") ?? []].filter((e) => e.getAttribute("aria-disabled") !== "true");
|
|
415
|
-
function c(e) {
|
|
416
|
-
if (!n.selectable) return;
|
|
417
|
-
let t = o(), 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 l() {
|
|
423
|
-
if (!n.selectable) return;
|
|
424
|
-
let e = o();
|
|
425
|
-
e.length && !e.some((e) => e.tabIndex === 0) && (e[0].tabIndex = 0);
|
|
426
|
-
}
|
|
427
|
-
C(l), T(() => y(l));
|
|
428
|
-
let d = s(() => [
|
|
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) => (E(), u("ul", {
|
|
434
|
-
ref_key: "listEl",
|
|
435
|
-
ref: i,
|
|
436
|
-
role: e.selectable ? "listbox" : "list",
|
|
437
|
-
class: b(d.value),
|
|
438
|
-
onKeydown: c
|
|
439
|
-
}, [A(t.$slots, "default")], 42, q));
|
|
440
|
-
}
|
|
441
|
-
}), me = { class: "relative -my-2 inline-flex h-12 shrink-0 items-center" }, he = ["checked", "disabled"], Y = {
|
|
442
|
-
key: 0,
|
|
443
|
-
class: "text-body-large text-on-surface"
|
|
444
|
-
}, ge = "bg-outline group-hover:bg-on-surface-variant group-active:bg-on-surface-variant peer-focus-visible:bg-on-surface-variant", _e = /* @__PURE__ */ m({
|
|
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, a = {
|
|
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
|
-
}, f = {
|
|
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 = O(!1);
|
|
482
|
-
function _() {
|
|
483
|
-
n.disabled || (g.value = !0);
|
|
484
|
-
}
|
|
485
|
-
function v() {
|
|
486
|
-
g.value = !1;
|
|
487
|
-
}
|
|
488
|
-
let y = s(() => g.value ? 28 / 24 : n.modelValue ? 1 : 16 / 24), S = s(() => ({
|
|
489
|
-
transform: `translateY(-50%) translateX(${n.modelValue ? 18 : 0}px) scale(${y.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 = s(() => ({
|
|
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) => (E(), u("label", {
|
|
496
|
-
class: b(["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
|
-
}, [d("span", me, [d("span", { class: b(["relative inline-flex h-8 w-[52px] items-center rounded-full border-2 transition-colors duration-200", e.modelValue ? a[e.color] : "border-outline bg-surface-container-highest"]) }, [
|
|
502
|
-
d("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, he),
|
|
509
|
-
e.disabled ? l("", !0) : (E(), u("span", {
|
|
510
|
-
key: 0,
|
|
511
|
-
class: b(["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: x(C.value)
|
|
513
|
-
}, null, 6)),
|
|
514
|
-
e.disabled ? l("", !0) : (E(), u("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: x(C.value)
|
|
518
|
-
}, null, 4)),
|
|
519
|
-
d("span", {
|
|
520
|
-
class: b(["absolute left-1 top-1/2 flex h-6 w-6 items-center justify-center rounded-full will-change-transform", e.modelValue ? [f[e.color], "shadow-sm"] : ge]),
|
|
521
|
-
style: x(S.value)
|
|
522
|
-
}, [p(o, {
|
|
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: ne(() => [e.modelValue && e.icon ? (E(), c(i, {
|
|
531
|
-
key: 0,
|
|
532
|
-
name: "check",
|
|
533
|
-
size: 14,
|
|
534
|
-
class: b(m[e.color])
|
|
535
|
-
}, null, 8, ["class"])) : l("", !0)]),
|
|
536
|
-
_: 1
|
|
537
|
-
})], 6)
|
|
538
|
-
], 2)]), e.label ? (E(), u("span", Y, M(e.label), 1)) : l("", !0)], 34));
|
|
539
|
-
}
|
|
540
|
-
}), ve = [
|
|
541
|
-
"tabindex",
|
|
542
|
-
"aria-expanded",
|
|
543
|
-
"aria-controls",
|
|
544
|
-
"aria-disabled"
|
|
545
|
-
], ye = { class: "min-w-0 flex-1" }, be = ["id"], xe = { class: "mli-expand-body" }, Se = ["src"], Ce = { class: "min-w-0 flex-1" }, we = 4, Te = 8, Ee = 16, De = /* @__PURE__ */ m({
|
|
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: n }) {
|
|
587
|
-
let r = e, a = n, f = h(), m = () => !!f?.vnode.props?.onClick, y = O(r.expanded ?? !1);
|
|
588
|
-
F(() => r.expanded, (e) => {
|
|
589
|
-
e !== void 0 && (y.value = e);
|
|
590
|
-
});
|
|
591
|
-
let x = s(() => y.value), S = _("m-list", null), C = s(() => r.lines ? r.lines : S?.lines.value ? S.lines.value : r.description || r.overline && r.subtitle ? 3 : r.subtitle || r.overline ? 2 : 1), w = s(() => r.clickable || r.href || r.to || m() || S?.selectable.value || r.expandable), T = s(() => !!S?.selectable.value && r.value != null && !r.href && !r.to && !r.expandable), D = s(() => !!(r.href || r.to)), k = s(() => !T.value && !D.value && !r.expandable && (r.clickable || m())), j = s(() => D.value || k.value), P = s(() => T.value ? "option" : k.value ? "button" : D.value ? void 0 : "listitem"), I = s(() => {
|
|
592
|
-
if (T.value) return z.value && !r.disabled ? 0 : -1;
|
|
593
|
-
if (k.value) return r.disabled ? -1 : 0;
|
|
594
|
-
});
|
|
595
|
-
function R(e) {
|
|
596
|
-
(T.value || k.value) && (e.key !== "Enter" && e.key !== " " || e.target !== e.currentTarget || (e.preventDefault(), Le(e)));
|
|
597
|
-
}
|
|
598
|
-
let z = s(() => r.active ? !0 : S?.selectable.value && r.value != null ? S.selected.value === r.value : !1), B = s(() => r.leading ? r.leading : r.icon ? "icon" : r.avatarName ? "avatar" : r.image ? "image" : null), re = s(() => r.expandable ? "expand" : r.trailing ? r.trailing : r.trailingIcon ? "icon" : r.trailingText ? "text" : null), ie = {
|
|
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
|
-
}, V = s(() => S?.dense.value ?? !1), H = s(() => S?.nav.value ?? !1), ae = s(() => S?.segmented.value ?? !1), oe = s(() => S?.dividers.value ?? !1), se = s(() => z.value ? "text-on-secondary-container" : "text-on-surface"), U = s(() => z.value ? "text-on-secondary-container" : "text-on-surface-variant"), ce = s(() => V.value ? "" : C.value === 3 ? "min-h-22" : C.value === 2 ? "min-h-18" : "min-h-14"), ue = s(() => [
|
|
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
|
-
V.value ? "py-1" : C.value === 3 ? "py-3" : "py-2",
|
|
608
|
-
ce.value,
|
|
609
|
-
w.value && !r.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
|
-
r.disabled && "opacity-[0.38] pointer-events-none"
|
|
612
|
-
]), W = O(null), de = O(null), G = (e, { slots: t }) => j.value ? g("li", {
|
|
613
|
-
role: "listitem",
|
|
614
|
-
ref: (e) => {
|
|
615
|
-
de.value = e;
|
|
616
|
-
}
|
|
617
|
-
}, t.default?.()) : t.default?.(), fe = O(null), pe = (e) => e && "$el" in e ? e.$el : e, K = O(!1), q = O(!1), J = O(!1), me = s(() => ae.value ? S?.segmentPosition(j.value ? de.value : pe(W.value)) : void 0), he = s(() => {
|
|
618
|
-
if (H.value) return [];
|
|
619
|
-
let e = w.value && !r.disabled, t = e && q.value || z.value || e && J.value ? Ee : e && K.value ? Te : null;
|
|
620
|
-
if (t !== null) return [
|
|
621
|
-
t,
|
|
622
|
-
t,
|
|
623
|
-
t,
|
|
624
|
-
t
|
|
625
|
-
];
|
|
626
|
-
let n = me.value, i = n === "first" || n === "single" ? Ee : we, a = n === "last" || n === "single" ? Ee : we;
|
|
627
|
-
return [
|
|
628
|
-
i,
|
|
629
|
-
i,
|
|
630
|
-
a,
|
|
631
|
-
a
|
|
632
|
-
];
|
|
633
|
-
}), { snap: Y } = t(() => he.value, (e) => {
|
|
634
|
-
let t = fe.value ?? pe(W.value);
|
|
635
|
-
t && (t.style.borderRadius = e.length ? e.map((e) => `${e}px`).join(" ") : "");
|
|
636
|
-
});
|
|
637
|
-
F([me, H], () => Y());
|
|
638
|
-
function ge(e) {
|
|
639
|
-
e.pointerType !== "touch" && (K.value = !0);
|
|
640
|
-
}
|
|
641
|
-
function De() {
|
|
642
|
-
K.value = !1, q.value = !1;
|
|
643
|
-
}
|
|
644
|
-
function Oe(e) {
|
|
645
|
-
e.button === 0 && (q.value = !0);
|
|
646
|
-
}
|
|
647
|
-
function ke() {
|
|
648
|
-
q.value = !1;
|
|
649
|
-
}
|
|
650
|
-
function Ae(e) {
|
|
651
|
-
J.value = e.currentTarget.matches(":focus-visible");
|
|
652
|
-
}
|
|
653
|
-
function je() {
|
|
654
|
-
J.value = !1;
|
|
655
|
-
}
|
|
656
|
-
let Me = s(() => r.href ? "a" : r.to ? "router-link" : k.value ? "div" : "li"), Ne = s(() => r.href ? { href: r.href } : r.to ? { to: r.to } : {}), Pe = N();
|
|
657
|
-
function Fe(e) {
|
|
658
|
-
(e.key === "Enter" || e.key === " ") && e.target === e.currentTarget && (e.preventDefault(), Le(e));
|
|
659
|
-
}
|
|
660
|
-
function Ie(e) {
|
|
661
|
-
r.disabled || (y.value = !y.value, a("update:expanded", y.value), a("click", e));
|
|
662
|
-
}
|
|
663
|
-
function Le(e) {
|
|
664
|
-
if (!r.disabled) {
|
|
665
|
-
if (r.expandable) {
|
|
666
|
-
Ie(e);
|
|
667
|
-
return;
|
|
668
|
-
}
|
|
669
|
-
S?.selectable.value && r.value != null && S.select(r.value), a("click", e);
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
|
-
function Re() {
|
|
673
|
-
a("update:trailingValue", !r.trailingValue);
|
|
674
|
-
}
|
|
675
|
-
return (t, n) => e.expandable ? (E(), u("li", v({
|
|
676
|
-
key: 0,
|
|
677
|
-
ref_key: "rootEl",
|
|
678
|
-
ref: W
|
|
679
|
-
}, t.$attrs, { role: "listitem" }), [d("div", {
|
|
680
|
-
ref_key: "shapeEl",
|
|
681
|
-
ref: fe,
|
|
682
|
-
role: "button",
|
|
683
|
-
tabindex: e.disabled ? -1 : 0,
|
|
684
|
-
"aria-expanded": x.value,
|
|
685
|
-
"aria-controls": te(Pe),
|
|
686
|
-
"aria-disabled": e.disabled || void 0,
|
|
687
|
-
class: b(["focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary", ue.value]),
|
|
688
|
-
onClick: Le,
|
|
689
|
-
onKeydown: Fe,
|
|
690
|
-
onFocus: Ae,
|
|
691
|
-
onBlur: je,
|
|
692
|
-
onPointerenter: ge,
|
|
693
|
-
onPointerleave: De,
|
|
694
|
-
onPointerdown: Oe,
|
|
695
|
-
onPointerup: ke,
|
|
696
|
-
onPointercancel: ke
|
|
697
|
-
}, [
|
|
698
|
-
A(t.$slots, "leading", {}, () => [B.value === "icon" ? (E(), c(i, {
|
|
699
|
-
key: 0,
|
|
700
|
-
name: e.icon,
|
|
701
|
-
size: 24,
|
|
702
|
-
class: b(["shrink-0", U.value])
|
|
703
|
-
}, null, 8, ["name", "class"])) : l("", !0)]),
|
|
704
|
-
d("div", ye, [A(t.$slots, "overline", {}, () => [e.overline ? (E(), u("p", {
|
|
705
|
-
key: 0,
|
|
706
|
-
class: b(["truncate text-label-small", U.value])
|
|
707
|
-
}, M(e.overline), 3)) : l("", !0)]), A(t.$slots, "default", {}, () => [d("p", { class: b(["truncate text-body-large", se.value]) }, M(e.title), 3), e.subtitle && C.value >= 2 ? (E(), u("p", {
|
|
708
|
-
key: 0,
|
|
709
|
-
class: b(["text-body-medium", [U.value, C.value === 2 && "truncate"]])
|
|
710
|
-
}, M(e.subtitle), 3)) : l("", !0)])]),
|
|
711
|
-
p(i, {
|
|
712
|
-
name: x.value ? "expand_less" : "expand_more",
|
|
713
|
-
size: 20,
|
|
714
|
-
class: b(["shrink-0", U.value])
|
|
715
|
-
}, null, 8, ["name", "class"])
|
|
716
|
-
], 42, ve), p(o, { name: "mli-expand" }, {
|
|
717
|
-
default: ne(() => [x.value ? (E(), u("div", {
|
|
718
|
-
key: 0,
|
|
719
|
-
id: te(Pe),
|
|
720
|
-
class: "mli-expand-grid"
|
|
721
|
-
}, [d("div", xe, [A(t.$slots, "children")])], 8, be)) : l("", !0)]),
|
|
722
|
-
_: 3
|
|
723
|
-
})], 16)) : (E(), c(G, { key: 1 }, {
|
|
724
|
-
default: ne(() => [(E(), c(ee(Me.value), v({
|
|
725
|
-
class: ue.value,
|
|
726
|
-
ref_key: "rootEl",
|
|
727
|
-
ref: W
|
|
728
|
-
}, {
|
|
729
|
-
...Ne.value,
|
|
730
|
-
...t.$attrs
|
|
731
|
-
}, {
|
|
732
|
-
role: P.value,
|
|
733
|
-
tabindex: I.value,
|
|
734
|
-
"aria-selected": T.value ? z.value : void 0,
|
|
735
|
-
"aria-disabled": (T.value || k.value) && e.disabled ? "true" : void 0,
|
|
736
|
-
onClick: Le,
|
|
737
|
-
onKeydown: R,
|
|
738
|
-
onPointerenter: ge,
|
|
739
|
-
onPointerleave: De,
|
|
740
|
-
onPointerdown: Oe,
|
|
741
|
-
onPointerup: ke,
|
|
742
|
-
onPointercancel: ke,
|
|
743
|
-
onFocus: Ae,
|
|
744
|
-
onBlur: je
|
|
745
|
-
}), {
|
|
746
|
-
default: ne(() => [
|
|
747
|
-
oe.value ? (E(), u("div", {
|
|
748
|
-
key: 0,
|
|
749
|
-
class: b(["absolute top-0 right-0 h-px bg-outline-variant", oe.value === "inset" ? "left-16" : "left-0"])
|
|
750
|
-
}, null, 2)) : l("", !0),
|
|
751
|
-
A(t.$slots, "leading", {}, () => [B.value === "icon" ? (E(), c(i, {
|
|
752
|
-
key: 0,
|
|
753
|
-
name: e.icon,
|
|
754
|
-
size: 24,
|
|
755
|
-
class: b(["shrink-0", U.value])
|
|
756
|
-
}, null, 8, ["name", "class"])) : B.value === "icon-container" ? (E(), u("div", {
|
|
757
|
-
key: 1,
|
|
758
|
-
class: b(["flex h-10 w-10 shrink-0 items-center justify-center rounded-full", ie[e.iconContainerColor || "primary"]])
|
|
759
|
-
}, [p(i, {
|
|
760
|
-
name: e.icon,
|
|
761
|
-
size: 24
|
|
762
|
-
}, null, 8, ["name"])], 2)) : B.value === "avatar" ? (E(), c(L, {
|
|
763
|
-
key: 2,
|
|
764
|
-
name: e.avatarName,
|
|
765
|
-
size: 40,
|
|
766
|
-
class: "shrink-0"
|
|
767
|
-
}, null, 8, ["name"])) : B.value === "image" ? (E(), u("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, Se)) : B.value === "checkbox" ? (E(), c(le, {
|
|
773
|
-
key: 4,
|
|
774
|
-
"model-value": z.value,
|
|
775
|
-
class: "shrink-0"
|
|
776
|
-
}, null, 8, ["model-value"])) : l("", !0)]),
|
|
777
|
-
d("div", Ce, [A(t.$slots, "overline", {}, () => [e.overline ? (E(), u("p", {
|
|
778
|
-
key: 0,
|
|
779
|
-
class: b(["truncate text-label-small", U.value])
|
|
780
|
-
}, M(e.overline), 3)) : l("", !0)]), A(t.$slots, "default", {}, () => [
|
|
781
|
-
d("p", { class: b(["truncate text-body-large", se.value]) }, M(e.title), 3),
|
|
782
|
-
e.subtitle && C.value >= 2 ? (E(), u("p", {
|
|
783
|
-
key: 0,
|
|
784
|
-
class: b(["text-body-medium", [U.value, C.value === 2 && "truncate"]])
|
|
785
|
-
}, M(e.subtitle), 3)) : l("", !0),
|
|
786
|
-
e.description && C.value >= 3 ? (E(), u("p", {
|
|
787
|
-
key: 1,
|
|
788
|
-
class: b(["line-clamp-2 text-body-small", U.value])
|
|
789
|
-
}, M(e.description), 3)) : l("", !0)
|
|
790
|
-
])]),
|
|
791
|
-
A(t.$slots, "trailing", {}, () => [re.value === "icon" ? (E(), c(i, {
|
|
792
|
-
key: 0,
|
|
793
|
-
name: e.trailingIcon,
|
|
794
|
-
size: 24,
|
|
795
|
-
class: b(["shrink-0", U.value])
|
|
796
|
-
}, null, 8, ["name", "class"])) : re.value === "text" ? (E(), u("span", {
|
|
797
|
-
key: 1,
|
|
798
|
-
class: b(["shrink-0 text-label-small", U.value])
|
|
799
|
-
}, M(e.trailingText), 3)) : re.value === "switch" ? (E(), c(_e, {
|
|
800
|
-
key: 2,
|
|
801
|
-
"model-value": !!e.trailingValue,
|
|
802
|
-
"onUpdate:modelValue": Re
|
|
803
|
-
}, null, 8, ["model-value"])) : re.value === "checkbox" ? (E(), c(le, {
|
|
804
|
-
key: 3,
|
|
805
|
-
"model-value": !!e.trailingValue,
|
|
806
|
-
"onUpdate:modelValue": Re
|
|
807
|
-
}, null, 8, ["model-value"])) : l("", !0)])
|
|
808
|
-
]),
|
|
809
|
-
_: 3
|
|
810
|
-
}, 16, [
|
|
811
|
-
"class",
|
|
812
|
-
"role",
|
|
813
|
-
"tabindex",
|
|
814
|
-
"aria-selected",
|
|
815
|
-
"aria-disabled"
|
|
816
|
-
]))]),
|
|
817
|
-
_: 3
|
|
818
|
-
}));
|
|
819
|
-
}
|
|
820
|
-
}), Oe = {
|
|
821
|
-
key: 0,
|
|
822
|
-
class: "flex items-center justify-between"
|
|
823
|
-
}, ke = {
|
|
824
|
-
key: 0,
|
|
825
|
-
class: "text-label-large text-on-surface"
|
|
826
|
-
}, Ae = {
|
|
827
|
-
key: 1,
|
|
828
|
-
class: "tabular-nums text-label-large text-on-surface-variant"
|
|
829
|
-
}, je = [
|
|
830
|
-
"role",
|
|
831
|
-
"tabindex",
|
|
832
|
-
"aria-label",
|
|
833
|
-
"aria-valuenow",
|
|
834
|
-
"aria-valuemin",
|
|
835
|
-
"aria-valuemax",
|
|
836
|
-
"aria-disabled",
|
|
837
|
-
"aria-orientation"
|
|
838
|
-
], Me = [
|
|
839
|
-
"tabindex",
|
|
840
|
-
"aria-label",
|
|
841
|
-
"aria-valuenow",
|
|
842
|
-
"aria-valuemin",
|
|
843
|
-
"aria-valuemax",
|
|
844
|
-
"aria-disabled",
|
|
845
|
-
"aria-orientation",
|
|
846
|
-
"onKeydown",
|
|
847
|
-
"onFocus"
|
|
848
|
-
], Ne = "color-mix(in srgb, var(--color-on-surface) 38%, transparent)", Pe = "color-mix(in srgb, var(--color-on-surface) 12%, transparent)", Fe = /* @__PURE__ */ m({
|
|
849
|
-
__name: "MSlider",
|
|
850
|
-
props: {
|
|
851
|
-
modelValue: {},
|
|
852
|
-
min: { default: 0 },
|
|
853
|
-
max: { default: 100 },
|
|
854
|
-
step: { default: 1 },
|
|
855
|
-
disabled: {
|
|
856
|
-
type: Boolean,
|
|
857
|
-
default: !1
|
|
858
|
-
},
|
|
859
|
-
label: {},
|
|
860
|
-
showValue: {
|
|
861
|
-
type: Boolean,
|
|
862
|
-
default: !1
|
|
863
|
-
},
|
|
864
|
-
showTooltip: {
|
|
865
|
-
type: Boolean,
|
|
866
|
-
default: !1
|
|
867
|
-
},
|
|
868
|
-
orientation: { default: "horizontal" },
|
|
869
|
-
size: { default: "xs" },
|
|
870
|
-
variant: { default: "standard" },
|
|
871
|
-
stops: {
|
|
872
|
-
type: Boolean,
|
|
873
|
-
default: !1
|
|
874
|
-
},
|
|
875
|
-
icon: {},
|
|
876
|
-
color: { default: "primary" },
|
|
877
|
-
fillColor: {},
|
|
878
|
-
thumbIcon: {},
|
|
879
|
-
thumbColor: {}
|
|
880
|
-
},
|
|
881
|
-
emits: ["update:modelValue"],
|
|
882
|
-
setup(t, { emit: n }) {
|
|
883
|
-
let r = t, f = n, m = e(), h = O(), g = O([]), _ = O(!1), v = O(!1), y = O(null), w = O(null), T = !1;
|
|
884
|
-
function D(e) {
|
|
885
|
-
T = !0, g.value[e]?.focus({ preventScroll: !0 }), T = !1;
|
|
886
|
-
}
|
|
887
|
-
function A(e) {
|
|
888
|
-
y.value = e, w.value = T ? null : e;
|
|
889
|
-
}
|
|
890
|
-
function ee() {
|
|
891
|
-
y.value = null, w.value = null;
|
|
892
|
-
}
|
|
893
|
-
let j = s(() => r.orientation === "vertical"), N = s(() => r.variant === "range");
|
|
894
|
-
s(() => r.variant === "centered");
|
|
895
|
-
let P = s(() => {
|
|
896
|
-
if (N.value) {
|
|
897
|
-
let e = r.modelValue;
|
|
898
|
-
return {
|
|
899
|
-
lo: Math.min(e[0], e[1]),
|
|
900
|
-
hi: Math.max(e[0], e[1])
|
|
901
|
-
};
|
|
902
|
-
}
|
|
903
|
-
return {
|
|
904
|
-
lo: r.modelValue,
|
|
905
|
-
hi: r.modelValue
|
|
906
|
-
};
|
|
907
|
-
});
|
|
908
|
-
function F(e) {
|
|
909
|
-
let t = r.max - r.min;
|
|
910
|
-
return t === 0 ? 0 : (e - r.min) / t * 100;
|
|
911
|
-
}
|
|
912
|
-
let I = O(null), L = s(() => !r.stops && _.value !== !1 && I.value !== null ? I.value * 100 : null), R = s(() => {
|
|
913
|
-
let e = L.value;
|
|
914
|
-
return e !== null && (_.value === "single" || _.value === 0) ? N.value ? Math.min(e, F(P.value.hi)) : e : F(P.value.lo);
|
|
915
|
-
}), z = s(() => {
|
|
916
|
-
let e = L.value;
|
|
917
|
-
return e !== null && _.value === 1 ? Math.max(e, F(P.value.lo)) : F(P.value.hi);
|
|
918
|
-
}), B = s(() => F(0)), re = s(() => se.value < W.value.dotInset + W.value.dot / 2 ? !0 : r.variant === "centered" ? Math.min(R.value, B.value) <= 0 : r.variant !== "range" || R.value <= 0), ie = s(() => U.value < W.value.dotInset + W.value.dot / 2 ? !0 : r.variant === "centered" ? Math.max(R.value, B.value) >= 100 : r.variant === "range" ? z.value >= 100 : R.value >= 100), V = O(0), H, ae = () => {
|
|
919
|
-
let e = h.value;
|
|
920
|
-
e && (V.value = j.value ? e.offsetHeight : e.offsetWidth);
|
|
921
|
-
};
|
|
922
|
-
C(() => {
|
|
923
|
-
ae(), !(typeof ResizeObserver > "u" || !h.value) && (H = new ResizeObserver(ae), H.observe(h.value));
|
|
924
|
-
}), S(() => H?.disconnect());
|
|
925
|
-
let oe = (e) => {
|
|
926
|
-
let t = W.value.thumbInset;
|
|
927
|
-
return Math.min(Math.max(e / 100 * V.value, t), V.value - t);
|
|
928
|
-
}, se = s(() => V.value && (r.variant === "range" || r.variant === "centered" && R.value <= B.value) ? oe(R.value) - G.value : Infinity), U = s(() => V.value ? r.variant === "range" ? V.value - oe(z.value) - G.value : r.variant === "centered" && R.value < B.value ? Infinity : V.value - oe(R.value) - G.value : Infinity), ce = s(() => se.value <= Z.value), le = s(() => U.value <= Z.value), ue = {
|
|
929
|
-
xs: {
|
|
930
|
-
track: 16,
|
|
931
|
-
thumbW: 4,
|
|
932
|
-
thumbH: 44,
|
|
933
|
-
dot: 4,
|
|
934
|
-
gap: 6,
|
|
935
|
-
hitArea: 46,
|
|
936
|
-
radius: 6,
|
|
937
|
-
dotInset: 12,
|
|
938
|
-
thumbInset: 5,
|
|
939
|
-
iconSize: 14,
|
|
940
|
-
thumbIconSize: 22
|
|
941
|
-
},
|
|
942
|
-
sm: {
|
|
943
|
-
track: 28,
|
|
944
|
-
thumbW: 4,
|
|
945
|
-
thumbH: 40,
|
|
946
|
-
dot: 5,
|
|
947
|
-
gap: 7,
|
|
948
|
-
hitArea: 46,
|
|
949
|
-
radius: 8,
|
|
950
|
-
dotInset: 13,
|
|
951
|
-
thumbInset: 6,
|
|
952
|
-
iconSize: 16,
|
|
953
|
-
thumbIconSize: 28
|
|
954
|
-
},
|
|
955
|
-
md: {
|
|
956
|
-
track: 54,
|
|
957
|
-
thumbW: 5,
|
|
958
|
-
thumbH: 62,
|
|
959
|
-
dot: 5,
|
|
960
|
-
gap: 8,
|
|
961
|
-
hitArea: 66,
|
|
962
|
-
radius: 12,
|
|
963
|
-
dotInset: 15,
|
|
964
|
-
thumbInset: 7,
|
|
965
|
-
iconSize: 20,
|
|
966
|
-
thumbIconSize: 42
|
|
967
|
-
},
|
|
968
|
-
lg: {
|
|
969
|
-
track: 72,
|
|
970
|
-
thumbW: 5,
|
|
971
|
-
thumbH: 78,
|
|
972
|
-
dot: 6,
|
|
973
|
-
gap: 10,
|
|
974
|
-
hitArea: 82,
|
|
975
|
-
radius: 14,
|
|
976
|
-
dotInset: 17,
|
|
977
|
-
thumbInset: 8,
|
|
978
|
-
iconSize: 24,
|
|
979
|
-
thumbIconSize: 52
|
|
980
|
-
},
|
|
981
|
-
xl: {
|
|
982
|
-
track: 96,
|
|
983
|
-
thumbW: 6,
|
|
984
|
-
thumbH: 98,
|
|
985
|
-
dot: 7,
|
|
986
|
-
gap: 10,
|
|
987
|
-
hitArea: 100,
|
|
988
|
-
radius: 18,
|
|
989
|
-
dotInset: 19,
|
|
990
|
-
thumbInset: 9,
|
|
991
|
-
iconSize: 28,
|
|
992
|
-
thumbIconSize: 66
|
|
993
|
-
}
|
|
994
|
-
}, W = s(() => ue[r.size] ?? ue.xs), de = s(() => W.value.thumbInset + W.value.thumbW / 2 + W.value.iconSize / 2 + 3), G = s(() => r.thumbIcon ? Math.max(W.value.gap, W.value.thumbIconSize / 2 + 4) : W.value.gap), fe = {
|
|
995
|
-
primary: "var(--color-primary)",
|
|
996
|
-
secondary: "var(--color-secondary)",
|
|
997
|
-
tertiary: "var(--color-tertiary)",
|
|
998
|
-
error: "var(--color-error)"
|
|
999
|
-
};
|
|
1000
|
-
function pe(e, t) {
|
|
1001
|
-
let n = e ?? t;
|
|
1002
|
-
return fe[n] ?? n;
|
|
1003
|
-
}
|
|
1004
|
-
let K = s(() => r.disabled ? {
|
|
1005
|
-
active: Ne,
|
|
1006
|
-
inactive: Pe
|
|
1007
|
-
} : {
|
|
1008
|
-
active: pe(r.fillColor, r.color),
|
|
1009
|
-
inactive: "var(--color-secondary-container)"
|
|
1010
|
-
}), q = s(() => r.disabled ? {
|
|
1011
|
-
active: Ne,
|
|
1012
|
-
inactive: Pe
|
|
1013
|
-
} : {
|
|
1014
|
-
active: pe(r.thumbColor, r.color),
|
|
1015
|
-
inactive: "var(--color-secondary-container)"
|
|
1016
|
-
});
|
|
1017
|
-
function J(e) {
|
|
1018
|
-
let t = Math.round((e - r.min) / r.step) * r.step + r.min;
|
|
1019
|
-
return Math.max(r.min, Math.min(r.max, +t.toFixed(10)));
|
|
1020
|
-
}
|
|
1021
|
-
function me(e) {
|
|
1022
|
-
if (!h.value) return 0;
|
|
1023
|
-
let t = h.value.getBoundingClientRect();
|
|
1024
|
-
return j.value ? 1 - Math.max(0, Math.min(1, (e.clientY - t.top) / t.height)) : Math.max(0, Math.min(1, (e.clientX - t.left) / t.width));
|
|
1025
|
-
}
|
|
1026
|
-
function he(e) {
|
|
1027
|
-
return J(r.min + me(e) * (r.max - r.min));
|
|
1028
|
-
}
|
|
1029
|
-
let Y = !1;
|
|
1030
|
-
function ge(e, t) {
|
|
1031
|
-
let { lo: n, hi: r } = P.value;
|
|
1032
|
-
return e === 0 ? [Math.min(t, r), r] : [n, Math.max(t, n)];
|
|
1033
|
-
}
|
|
1034
|
-
function _e(e) {
|
|
1035
|
-
if (r.disabled) return;
|
|
1036
|
-
e.preventDefault();
|
|
1037
|
-
let t = he(e);
|
|
1038
|
-
if (N.value) {
|
|
1039
|
-
let { lo: e, hi: n } = P.value;
|
|
1040
|
-
Y = !1;
|
|
1041
|
-
let r;
|
|
1042
|
-
t <= e && t < n ? r = 0 : t >= n && t > e ? r = 1 : e === n ? (r = 0, Y = !0) : r = Math.abs(t - e) <= Math.abs(t - n) ? 0 : 1, _.value = r, D(r), Y || f("update:modelValue", ge(r, t));
|
|
1043
|
-
} else _.value = "single", f("update:modelValue", t);
|
|
1044
|
-
I.value = Y ? null : me(e), window.addEventListener("pointermove", ve), window.addEventListener("pointerup", ye), window.addEventListener("pointercancel", ye);
|
|
1045
|
-
}
|
|
1046
|
-
function ve(e) {
|
|
1047
|
-
if (_.value === !1) return;
|
|
1048
|
-
let t = he(e);
|
|
1049
|
-
if (N.value) {
|
|
1050
|
-
if (Y) {
|
|
1051
|
-
if (t === P.value.lo) return;
|
|
1052
|
-
Y = !1, _.value = +(t > P.value.lo), D(_.value);
|
|
1053
|
-
}
|
|
1054
|
-
I.value = me(e), f("update:modelValue", ge(_.value, t));
|
|
1055
|
-
} else I.value = me(e), f("update:modelValue", t);
|
|
1056
|
-
}
|
|
1057
|
-
function ye() {
|
|
1058
|
-
_.value = !1, I.value = null, Y = !1, window.removeEventListener("pointermove", ve), window.removeEventListener("pointerup", ye), window.removeEventListener("pointercancel", ye);
|
|
1059
|
-
}
|
|
1060
|
-
let be = {
|
|
1061
|
-
ArrowRight: 1,
|
|
1062
|
-
ArrowUp: 1,
|
|
1063
|
-
ArrowLeft: -1,
|
|
1064
|
-
ArrowDown: -1
|
|
1065
|
-
};
|
|
1066
|
-
function xe(e) {
|
|
1067
|
-
if (r.disabled) return;
|
|
1068
|
-
let t = be[e.key];
|
|
1069
|
-
t !== void 0 && (e.preventDefault(), f("update:modelValue", J(r.modelValue + t * r.step))), e.key === "Home" && (e.preventDefault(), f("update:modelValue", r.min)), e.key === "End" && (e.preventDefault(), f("update:modelValue", r.max));
|
|
1070
|
-
}
|
|
1071
|
-
function Se(e, t) {
|
|
1072
|
-
if (r.disabled) return;
|
|
1073
|
-
let { lo: n, hi: i } = P.value, a = e === 0 ? n : i, o = be[t.key], s;
|
|
1074
|
-
o === void 0 ? t.key === "Home" ? s = e === 0 ? r.min : n : t.key === "End" && (s = e === 0 ? i : r.max) : s = J(a + o * r.step), s !== void 0 && (t.preventDefault(), w.value = e, f("update:modelValue", ge(e, s)));
|
|
1075
|
-
}
|
|
1076
|
-
S(() => {
|
|
1077
|
-
window.removeEventListener("pointermove", ve), window.removeEventListener("pointerup", ye), window.removeEventListener("pointercancel", ye);
|
|
1078
|
-
});
|
|
1079
|
-
let Ce = s(() => {
|
|
1080
|
-
if (!r.stops) return [];
|
|
1081
|
-
let e = [], t = r.max - r.min, n = r.icon ? (W.value.iconSize + W.value.radius) / 2 : 0;
|
|
1082
|
-
for (let i = r.min + r.step; i < r.max; i += r.step) {
|
|
1083
|
-
let a = (i - r.min) / t * 100;
|
|
1084
|
-
r.icon && a < n || e.push(a);
|
|
1085
|
-
}
|
|
1086
|
-
return e.length <= 28 ? e : [];
|
|
1087
|
-
});
|
|
1088
|
-
function we(e) {
|
|
1089
|
-
return `calc(${$(e)} - ${G.value}px)`;
|
|
1090
|
-
}
|
|
1091
|
-
function Te(e) {
|
|
1092
|
-
return le.value ? "0px" : `calc(100% - ${$(e)} - ${G.value}px)`;
|
|
1093
|
-
}
|
|
1094
|
-
function Ee() {
|
|
1095
|
-
return ce.value ? "0px" : `calc(${$(R.value)} - ${G.value}px)`;
|
|
1096
|
-
}
|
|
1097
|
-
function De() {
|
|
1098
|
-
return `calc(${$(R.value)} + ${G.value}px)`;
|
|
1099
|
-
}
|
|
1100
|
-
function Fe() {
|
|
1101
|
-
return `calc(${$(z.value)} - ${$(R.value)} - ${G.value * 2}px)`;
|
|
1102
|
-
}
|
|
1103
|
-
function Ie() {
|
|
1104
|
-
return le.value ? "0px" : `calc(100% - ${$(z.value)} - ${G.value}px)`;
|
|
1105
|
-
}
|
|
1106
|
-
function Le() {
|
|
1107
|
-
return R.value >= B.value ? `${B.value}%` : `calc(${$(R.value)} + ${G.value}px)`;
|
|
1108
|
-
}
|
|
1109
|
-
function Re() {
|
|
1110
|
-
return R.value >= B.value ? `calc(${$(R.value)} - ${B.value}% - ${G.value}px)` : `calc(${B.value}% - ${$(R.value)} - ${G.value}px)`;
|
|
1111
|
-
}
|
|
1112
|
-
function ze() {
|
|
1113
|
-
return le.value ? "0px" : R.value >= B.value ? `calc(100% - ${$(R.value)} - ${G.value}px)` : `calc(100% - ${B.value}% - ${G.value}px)`;
|
|
1114
|
-
}
|
|
1115
|
-
function Be() {
|
|
1116
|
-
return ce.value ? "0px" : R.value <= B.value ? `calc(${$(R.value)} - ${G.value}px)` : `calc(${B.value}% - ${G.value}px)`;
|
|
1117
|
-
}
|
|
1118
|
-
let Ve = s(() => W.value.radius), X = s(() => Math.max(2, Ve.value / 4)), Z = s(() => Ve.value * 1.3);
|
|
1119
|
-
function He() {
|
|
1120
|
-
return `${X.value}px`;
|
|
1121
|
-
}
|
|
1122
|
-
function Ue() {
|
|
1123
|
-
return j.value ? `${X.value}px ${X.value}px ${Z.value}px ${Z.value}px` : `${Z.value}px ${X.value}px ${X.value}px ${Z.value}px`;
|
|
1124
|
-
}
|
|
1125
|
-
function We() {
|
|
1126
|
-
return j.value ? `${Z.value}px ${Z.value}px ${X.value}px ${X.value}px` : `${X.value}px ${Z.value}px ${Z.value}px ${X.value}px`;
|
|
1127
|
-
}
|
|
1128
|
-
let Ge = s(() => _.value === !1), Q = s(() => Ge.value ? "75ms ease" : "0s");
|
|
1129
|
-
function $(e) {
|
|
1130
|
-
let t = W.value.thumbInset;
|
|
1131
|
-
return `clamp(${t}px, ${e}%, calc(100% - ${t}px))`;
|
|
1132
|
-
}
|
|
1133
|
-
function Ke(e, t = 0) {
|
|
1134
|
-
let n = j.value ? W.value.thumbH : W.value.thumbW, r = j.value ? W.value.thumbW : W.value.thumbH, i = Math.min(n, r) / 2, a = _.value !== !1, o = {
|
|
1135
|
-
position: "absolute",
|
|
1136
|
-
width: `${n}px`,
|
|
1137
|
-
height: `${r}px`,
|
|
1138
|
-
borderRadius: `${i}px`,
|
|
1139
|
-
backgroundColor: q.value.active,
|
|
1140
|
-
"--tw-ring-color": q.value.active,
|
|
1141
|
-
zIndex: "2",
|
|
1142
|
-
transition: Ge.value ? "left 75ms ease, bottom 75ms ease, transform 80ms ease" : "transform 80ms ease"
|
|
1143
|
-
}, s = N.value ? _.value === t || y.value === t : a || v.value, c = (N.value ? _.value === t : a) ? 1.08 : 1, l = s ? .5 : 1;
|
|
1144
|
-
return j.value ? (o.left = "50%", o.bottom = $(e), o.transform = `translateX(-50%) translateY(50%) scaleX(${c}) scaleY(${l})`) : (o.left = $(e), o.top = "50%", o.transform = `translateX(-50%) translateY(-50%) scaleY(${c}) scaleX(${l})`), o;
|
|
1145
|
-
}
|
|
1146
|
-
function qe(e) {
|
|
1147
|
-
let t = _.value === !1 ? 1 : 1.15, n = {
|
|
1148
|
-
position: "absolute",
|
|
1149
|
-
color: q.value.active,
|
|
1150
|
-
"--tw-ring-color": q.value.active,
|
|
1151
|
-
zIndex: "2",
|
|
1152
|
-
transition: Ge.value ? "left 75ms ease, bottom 75ms ease, transform 80ms ease" : "transform 80ms ease"
|
|
1153
|
-
};
|
|
1154
|
-
return j.value ? (n.left = "50%", n.bottom = $(e), n.transform = `translateX(-50%) translateY(50%) scale(${t})`) : (n.left = $(e), n.top = "50%", n.transform = `translateX(-50%) translateY(-50%) scale(${t})`), n;
|
|
1155
|
-
}
|
|
1156
|
-
function Je(e) {
|
|
1157
|
-
let t = W.value.track / 2 + 36, n = W.value.track / 2 + 40;
|
|
1158
|
-
return j.value ? {
|
|
1159
|
-
left: `calc(50% - ${n}px)`,
|
|
1160
|
-
bottom: $(e),
|
|
1161
|
-
transform: "translateY(50%)",
|
|
1162
|
-
transition: Ge.value ? "bottom " + Q.value : "none"
|
|
1163
|
-
} : {
|
|
1164
|
-
left: $(e),
|
|
1165
|
-
top: `calc(50% - ${t}px)`,
|
|
1166
|
-
transform: "translateX(-50%)",
|
|
1167
|
-
transition: Ge.value ? "left " + Q.value : "none"
|
|
1168
|
-
};
|
|
1169
|
-
}
|
|
1170
|
-
let Ye = s(() => N.value ? `${P.value.lo} – ${P.value.hi}` : String(r.modelValue)), Xe = s(() => N.value && typeof _.value == "number" ? _.value === 0 ? P.value.lo : P.value.hi : r.modelValue), Ze = s(() => N.value && typeof _.value == "number" ? _.value === 0 ? R.value : z.value : R.value);
|
|
1171
|
-
return (e, n) => (E(), u("div", { class: b(["flex select-none", j.value ? "h-full flex-col items-center" : "flex-col gap-1"]) }, [t.label || t.showValue ? (E(), u("div", Oe, [t.label ? (E(), u("span", ke, M(t.label), 1)) : l("", !0), t.showValue ? (E(), u("span", Ae, M(Ye.value), 1)) : l("", !0)])) : l("", !0), d("div", { class: b(["flex items-center", j.value ? "flex-1 flex-col" : ""]) }, [d("div", {
|
|
1172
|
-
ref_key: "trackEl",
|
|
1173
|
-
ref: h,
|
|
1174
|
-
role: N.value ? "group" : "slider",
|
|
1175
|
-
tabindex: N.value ? void 0 : 0,
|
|
1176
|
-
"aria-label": N.value ? t.label : void 0,
|
|
1177
|
-
"aria-valuenow": N.value ? void 0 : t.modelValue,
|
|
1178
|
-
"aria-valuemin": N.value ? void 0 : t.min,
|
|
1179
|
-
"aria-valuemax": N.value ? void 0 : t.max,
|
|
1180
|
-
"aria-disabled": t.disabled || void 0,
|
|
1181
|
-
"aria-orientation": N.value ? void 0 : t.orientation,
|
|
1182
|
-
class: b(["group relative touch-none cursor-pointer outline-none", t.disabled && "cursor-not-allowed"]),
|
|
1183
|
-
style: x(j.value ? {
|
|
1184
|
-
width: `${W.value.hitArea}px`,
|
|
1185
|
-
minHeight: "160px",
|
|
1186
|
-
height: "100%"
|
|
1187
|
-
} : {
|
|
1188
|
-
height: `${W.value.hitArea}px`,
|
|
1189
|
-
width: "100%"
|
|
1190
|
-
}),
|
|
1191
|
-
onPointerdown: _e,
|
|
1192
|
-
onKeydown: n[0] ||= (e) => !N.value && xe(e),
|
|
1193
|
-
onFocus: n[1] ||= (e) => v.value = !N.value,
|
|
1194
|
-
onBlur: n[2] ||= (e) => v.value = !1
|
|
1195
|
-
}, [
|
|
1196
|
-
d("div", {
|
|
1197
|
-
class: "absolute",
|
|
1198
|
-
style: x(j.value ? {
|
|
1199
|
-
left: "50%",
|
|
1200
|
-
top: "0",
|
|
1201
|
-
bottom: "0",
|
|
1202
|
-
width: `${W.value.track}px`,
|
|
1203
|
-
transform: "translateX(-50%)",
|
|
1204
|
-
borderRadius: `${Z.value}px`
|
|
1205
|
-
} : {
|
|
1206
|
-
top: "50%",
|
|
1207
|
-
left: "0",
|
|
1208
|
-
right: "0",
|
|
1209
|
-
height: `${W.value.track}px`,
|
|
1210
|
-
transform: "translateY(-50%)",
|
|
1211
|
-
borderRadius: `${Z.value}px`
|
|
1212
|
-
})
|
|
1213
|
-
}, [
|
|
1214
|
-
t.variant === "standard" ? (E(), u(a, { key: 0 }, [d("div", {
|
|
1215
|
-
class: "absolute",
|
|
1216
|
-
style: x({
|
|
1217
|
-
...j.value ? {
|
|
1218
|
-
left: 0,
|
|
1219
|
-
right: 0,
|
|
1220
|
-
bottom: 0,
|
|
1221
|
-
height: we(R.value)
|
|
1222
|
-
} : {
|
|
1223
|
-
top: 0,
|
|
1224
|
-
bottom: 0,
|
|
1225
|
-
left: 0,
|
|
1226
|
-
width: we(R.value)
|
|
1227
|
-
},
|
|
1228
|
-
borderRadius: Ue(),
|
|
1229
|
-
backgroundColor: K.value.active,
|
|
1230
|
-
transition: `all ${Q.value}`
|
|
1231
|
-
})
|
|
1232
|
-
}, null, 4), d("div", {
|
|
1233
|
-
class: "absolute",
|
|
1234
|
-
style: x({
|
|
1235
|
-
...j.value ? {
|
|
1236
|
-
left: 0,
|
|
1237
|
-
right: 0,
|
|
1238
|
-
top: 0,
|
|
1239
|
-
height: Te(R.value)
|
|
1240
|
-
} : {
|
|
1241
|
-
top: 0,
|
|
1242
|
-
bottom: 0,
|
|
1243
|
-
right: 0,
|
|
1244
|
-
width: Te(R.value)
|
|
1245
|
-
},
|
|
1246
|
-
borderRadius: We(),
|
|
1247
|
-
backgroundColor: K.value.inactive,
|
|
1248
|
-
transition: `all ${Q.value}`
|
|
1249
|
-
})
|
|
1250
|
-
}, null, 4)], 64)) : t.variant === "centered" ? (E(), u(a, { key: 1 }, [
|
|
1251
|
-
d("div", {
|
|
1252
|
-
class: "absolute",
|
|
1253
|
-
style: x({
|
|
1254
|
-
...j.value ? {
|
|
1255
|
-
left: 0,
|
|
1256
|
-
right: 0,
|
|
1257
|
-
bottom: Le(),
|
|
1258
|
-
height: Re()
|
|
1259
|
-
} : {
|
|
1260
|
-
top: 0,
|
|
1261
|
-
bottom: 0,
|
|
1262
|
-
left: Le(),
|
|
1263
|
-
width: Re()
|
|
1264
|
-
},
|
|
1265
|
-
borderRadius: He(),
|
|
1266
|
-
backgroundColor: K.value.active,
|
|
1267
|
-
transition: `all ${Q.value}`
|
|
1268
|
-
})
|
|
1269
|
-
}, null, 4),
|
|
1270
|
-
d("div", {
|
|
1271
|
-
class: "absolute",
|
|
1272
|
-
style: x({
|
|
1273
|
-
...j.value ? {
|
|
1274
|
-
left: 0,
|
|
1275
|
-
right: 0,
|
|
1276
|
-
top: 0,
|
|
1277
|
-
height: ze()
|
|
1278
|
-
} : {
|
|
1279
|
-
top: 0,
|
|
1280
|
-
bottom: 0,
|
|
1281
|
-
right: 0,
|
|
1282
|
-
width: ze()
|
|
1283
|
-
},
|
|
1284
|
-
borderRadius: We(),
|
|
1285
|
-
backgroundColor: K.value.inactive,
|
|
1286
|
-
transition: `all ${Q.value}`
|
|
1287
|
-
})
|
|
1288
|
-
}, null, 4),
|
|
1289
|
-
d("div", {
|
|
1290
|
-
class: "absolute",
|
|
1291
|
-
style: x({
|
|
1292
|
-
...j.value ? {
|
|
1293
|
-
left: 0,
|
|
1294
|
-
right: 0,
|
|
1295
|
-
bottom: 0,
|
|
1296
|
-
height: Be()
|
|
1297
|
-
} : {
|
|
1298
|
-
top: 0,
|
|
1299
|
-
bottom: 0,
|
|
1300
|
-
left: 0,
|
|
1301
|
-
width: Be()
|
|
1302
|
-
},
|
|
1303
|
-
borderRadius: Ue(),
|
|
1304
|
-
backgroundColor: K.value.inactive,
|
|
1305
|
-
transition: `all ${Q.value}`
|
|
1306
|
-
})
|
|
1307
|
-
}, null, 4)
|
|
1308
|
-
], 64)) : t.variant === "range" ? (E(), u(a, { key: 2 }, [
|
|
1309
|
-
d("div", {
|
|
1310
|
-
class: "absolute",
|
|
1311
|
-
style: x({
|
|
1312
|
-
...j.value ? {
|
|
1313
|
-
left: 0,
|
|
1314
|
-
right: 0,
|
|
1315
|
-
bottom: 0,
|
|
1316
|
-
height: Ee()
|
|
1317
|
-
} : {
|
|
1318
|
-
top: 0,
|
|
1319
|
-
bottom: 0,
|
|
1320
|
-
left: 0,
|
|
1321
|
-
width: Ee()
|
|
1322
|
-
},
|
|
1323
|
-
borderRadius: Ue(),
|
|
1324
|
-
backgroundColor: K.value.inactive,
|
|
1325
|
-
transition: `all ${Q.value}`
|
|
1326
|
-
})
|
|
1327
|
-
}, null, 4),
|
|
1328
|
-
d("div", {
|
|
1329
|
-
class: "absolute",
|
|
1330
|
-
style: x({
|
|
1331
|
-
...j.value ? {
|
|
1332
|
-
left: 0,
|
|
1333
|
-
right: 0,
|
|
1334
|
-
bottom: De(),
|
|
1335
|
-
height: Fe()
|
|
1336
|
-
} : {
|
|
1337
|
-
top: 0,
|
|
1338
|
-
bottom: 0,
|
|
1339
|
-
left: De(),
|
|
1340
|
-
width: Fe()
|
|
1341
|
-
},
|
|
1342
|
-
borderRadius: He(),
|
|
1343
|
-
backgroundColor: K.value.active,
|
|
1344
|
-
transition: `all ${Q.value}`
|
|
1345
|
-
})
|
|
1346
|
-
}, null, 4),
|
|
1347
|
-
d("div", {
|
|
1348
|
-
class: "absolute",
|
|
1349
|
-
style: x({
|
|
1350
|
-
...j.value ? {
|
|
1351
|
-
left: 0,
|
|
1352
|
-
right: 0,
|
|
1353
|
-
top: 0,
|
|
1354
|
-
height: Ie()
|
|
1355
|
-
} : {
|
|
1356
|
-
top: 0,
|
|
1357
|
-
bottom: 0,
|
|
1358
|
-
right: 0,
|
|
1359
|
-
width: Ie()
|
|
1360
|
-
},
|
|
1361
|
-
borderRadius: We(),
|
|
1362
|
-
backgroundColor: K.value.inactive,
|
|
1363
|
-
transition: `all ${Q.value}`
|
|
1364
|
-
})
|
|
1365
|
-
}, null, 4)
|
|
1366
|
-
], 64)) : l("", !0),
|
|
1367
|
-
t.icon ? (E(), c(i, {
|
|
1368
|
-
key: 3,
|
|
1369
|
-
name: t.icon,
|
|
1370
|
-
size: W.value.iconSize,
|
|
1371
|
-
class: "absolute z-[1]",
|
|
1372
|
-
style: x({
|
|
1373
|
-
color: t.variant === "standard" && R.value > 0 || t.variant === "range" && R.value > 0 ? K.value.inactive : K.value.active,
|
|
1374
|
-
...j.value ? {
|
|
1375
|
-
left: "50%",
|
|
1376
|
-
bottom: `${de.value}px`,
|
|
1377
|
-
transform: "translateX(-50%)"
|
|
1378
|
-
} : {
|
|
1379
|
-
top: "50%",
|
|
1380
|
-
left: `${de.value}px`,
|
|
1381
|
-
transform: "translateY(-50%)"
|
|
1382
|
-
},
|
|
1383
|
-
transition: "color 150ms ease"
|
|
1384
|
-
})
|
|
1385
|
-
}, null, 8, [
|
|
1386
|
-
"name",
|
|
1387
|
-
"size",
|
|
1388
|
-
"style"
|
|
1389
|
-
])) : t.stops ? l("", !0) : (E(), u("div", {
|
|
1390
|
-
key: 4,
|
|
1391
|
-
class: "absolute rounded-full",
|
|
1392
|
-
style: x({
|
|
1393
|
-
width: `${W.value.dot}px`,
|
|
1394
|
-
height: `${W.value.dot}px`,
|
|
1395
|
-
backgroundColor: K.value.active,
|
|
1396
|
-
opacity: +!re.value,
|
|
1397
|
-
...j.value ? {
|
|
1398
|
-
left: "50%",
|
|
1399
|
-
bottom: `${W.value.dotInset}px`,
|
|
1400
|
-
transform: "translateX(-50%)"
|
|
1401
|
-
} : {
|
|
1402
|
-
top: "50%",
|
|
1403
|
-
left: `${W.value.dotInset}px`,
|
|
1404
|
-
transform: "translateY(-50%)"
|
|
1405
|
-
},
|
|
1406
|
-
transition: "opacity 150ms ease"
|
|
1407
|
-
})
|
|
1408
|
-
}, null, 4)),
|
|
1409
|
-
t.stops ? l("", !0) : (E(), u("div", {
|
|
1410
|
-
key: 5,
|
|
1411
|
-
class: "absolute rounded-full",
|
|
1412
|
-
style: x({
|
|
1413
|
-
width: `${W.value.dot}px`,
|
|
1414
|
-
height: `${W.value.dot}px`,
|
|
1415
|
-
backgroundColor: K.value.active,
|
|
1416
|
-
opacity: +!ie.value,
|
|
1417
|
-
...j.value ? {
|
|
1418
|
-
left: "50%",
|
|
1419
|
-
top: `${W.value.dotInset}px`,
|
|
1420
|
-
transform: "translateX(-50%)"
|
|
1421
|
-
} : {
|
|
1422
|
-
top: "50%",
|
|
1423
|
-
right: `${W.value.dotInset}px`,
|
|
1424
|
-
transform: "translateY(-50%)"
|
|
1425
|
-
},
|
|
1426
|
-
transition: "opacity 150ms ease"
|
|
1427
|
-
})
|
|
1428
|
-
}, null, 4)),
|
|
1429
|
-
t.stops ? (E(!0), u(a, { key: 6 }, k(Ce.value, (e, t) => (E(), u("div", {
|
|
1430
|
-
key: t,
|
|
1431
|
-
class: "absolute rounded-full",
|
|
1432
|
-
style: x({
|
|
1433
|
-
width: `${W.value.dot}px`,
|
|
1434
|
-
height: `${W.value.dot}px`,
|
|
1435
|
-
backgroundColor: e <= R.value ? K.value.inactive : K.value.active,
|
|
1436
|
-
opacity: Math.abs(e - R.value) < .01 || N.value && Math.abs(e - z.value) < .01 ? 0 : 1,
|
|
1437
|
-
...j.value ? {
|
|
1438
|
-
left: "50%",
|
|
1439
|
-
bottom: `${e}%`,
|
|
1440
|
-
transform: "translateX(-50%) translateY(50%)"
|
|
1441
|
-
} : {
|
|
1442
|
-
top: "50%",
|
|
1443
|
-
left: `${e}%`,
|
|
1444
|
-
transform: "translateX(-50%) translateY(-50%)"
|
|
1445
|
-
}
|
|
1446
|
-
})
|
|
1447
|
-
}, null, 4))), 128)) : l("", !0)
|
|
1448
|
-
], 4),
|
|
1449
|
-
N.value ? (E(), u(a, { key: 1 }, k([0, 1], (e) => d("div", {
|
|
1450
|
-
key: e,
|
|
1451
|
-
ref_for: !0,
|
|
1452
|
-
ref: (t) => {
|
|
1453
|
-
t && (g.value[e] = t);
|
|
1454
|
-
},
|
|
1455
|
-
role: "slider",
|
|
1456
|
-
tabindex: t.disabled ? -1 : 0,
|
|
1457
|
-
"aria-label": e === 0 ? te(m).sliderRangeStart : te(m).sliderRangeEnd,
|
|
1458
|
-
"aria-valuenow": e === 0 ? P.value.lo : P.value.hi,
|
|
1459
|
-
"aria-valuemin": e === 0 ? t.min : P.value.lo,
|
|
1460
|
-
"aria-valuemax": e === 0 ? P.value.hi : t.max,
|
|
1461
|
-
"aria-disabled": t.disabled || void 0,
|
|
1462
|
-
"aria-orientation": t.orientation,
|
|
1463
|
-
class: b(["pointer-events-none flex items-center justify-center rounded-full outline-none", w.value === e && "ring-2 ring-offset-2 ring-offset-surface"]),
|
|
1464
|
-
style: x(t.thumbIcon ? qe(e === 0 ? R.value : z.value) : Ke(e === 0 ? R.value : z.value, e)),
|
|
1465
|
-
onKeydown: (t) => Se(e, t),
|
|
1466
|
-
onFocus: (t) => A(e),
|
|
1467
|
-
onBlur: ee
|
|
1468
|
-
}, [t.thumbIcon ? (E(), c(i, {
|
|
1469
|
-
key: 0,
|
|
1470
|
-
name: t.thumbIcon,
|
|
1471
|
-
size: W.value.thumbIconSize
|
|
1472
|
-
}, null, 8, ["name", "size"])) : l("", !0)], 46, Me)), 64)) : (E(), u(a, { key: 0 }, [t.thumbIcon ? (E(), c(i, {
|
|
1473
|
-
key: 0,
|
|
1474
|
-
name: t.thumbIcon,
|
|
1475
|
-
size: W.value.thumbIconSize,
|
|
1476
|
-
class: "pointer-events-none rounded-full group-focus-visible:ring-2 group-focus-visible:ring-offset-2 group-focus-visible:ring-offset-surface",
|
|
1477
|
-
style: x(qe(R.value))
|
|
1478
|
-
}, null, 8, [
|
|
1479
|
-
"name",
|
|
1480
|
-
"size",
|
|
1481
|
-
"style"
|
|
1482
|
-
])) : (E(), u("div", {
|
|
1483
|
-
key: 1,
|
|
1484
|
-
class: "pointer-events-none group-focus-visible:ring-2 group-focus-visible:ring-offset-2 group-focus-visible:ring-offset-surface",
|
|
1485
|
-
style: x(Ke(R.value))
|
|
1486
|
-
}, null, 4))], 64)),
|
|
1487
|
-
p(o, {
|
|
1488
|
-
"enter-active-class": "transition-opacity duration-100",
|
|
1489
|
-
"enter-from-class": "opacity-0",
|
|
1490
|
-
"leave-active-class": "transition-opacity duration-75",
|
|
1491
|
-
"leave-to-class": "opacity-0"
|
|
1492
|
-
}, {
|
|
1493
|
-
default: ne(() => [t.showTooltip && _.value !== !1 ? (E(), u("div", {
|
|
1494
|
-
key: 0,
|
|
1495
|
-
class: "pointer-events-none absolute z-10 flex h-7 min-w-7 items-center justify-center rounded-full bg-inverse-surface px-2 text-label-small tabular-nums text-inverse-on-surface",
|
|
1496
|
-
style: x(Je(Ze.value))
|
|
1497
|
-
}, M(Xe.value), 5)) : l("", !0)]),
|
|
1498
|
-
_: 1
|
|
1499
|
-
})
|
|
1500
|
-
], 46, je)], 2)], 2));
|
|
1501
|
-
}
|
|
1502
|
-
});
|
|
1503
|
-
//#endregion
|
|
1504
|
-
export { K as a, oe as c, J as i, L as l, De as n, pe as o, _e as r, le as s, Fe as t };
|
|
1505
|
-
|
|
1506
|
-
//# sourceMappingURL=MSlider-Dx_S3vJ9.js.map
|