@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
|
@@ -1,633 +0,0 @@
|
|
|
1
|
-
import { i as e } from "./useLocale-JYxDDeXC.js";
|
|
2
|
-
import { i as t, t as n } from "./motion-DZiXG09o.js";
|
|
3
|
-
import { t as r } from "./MIcon-Bxh9j135.js";
|
|
4
|
-
import { computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, getCurrentInstance as f, normalizeClass as p, normalizeStyle as m, onBeforeUnmount as h, onMounted as g, onUnmounted as _, openBlock as v, ref as y, renderSlot as b, resolveDynamicComponent as x, toDisplayString as S, toValue as C, unref as w, useId as T, useSlots as E, watch as D, withCtx as O, withDirectives as k } from "vue";
|
|
5
|
-
//#region src/directives/vRipple.ts
|
|
6
|
-
function A(e) {
|
|
7
|
-
return e === !1 ? { disabled: !0 } : typeof e == "string" ? { color: e } : e === !0 || e == null ? {} : e;
|
|
8
|
-
}
|
|
9
|
-
function j(e, t, n) {
|
|
10
|
-
let r = e.getBoundingClientRect(), i = Math.max(r.width, r.height) * 2, a = document.createElement("span");
|
|
11
|
-
a.className = "m3-ripple-layer";
|
|
12
|
-
let o = document.createElement("span");
|
|
13
|
-
o.className = "m3-ripple", o.style.cssText = `width:${i}px;height:${i}px;top:${t.clientY - r.top - i / 2}px;left:${t.clientX - r.left - i / 2}px`, n && (o.style.background = n), a.appendChild(o), e.appendChild(a), o.addEventListener("animationend", () => a.remove(), { once: !0 });
|
|
14
|
-
}
|
|
15
|
-
var M = /* @__PURE__ */ new WeakMap(), N = {
|
|
16
|
-
mounted(e, t) {
|
|
17
|
-
let n = {
|
|
18
|
-
options: A(t.value),
|
|
19
|
-
onPointerDown(t) {
|
|
20
|
-
if (n.options.disabled || t.button !== 0) return;
|
|
21
|
-
let { position: r } = getComputedStyle(e);
|
|
22
|
-
(!r || r === "static") && (e.style.position = "relative"), j(e, t, n.options.color);
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
M.set(e, n), e.addEventListener("pointerdown", n.onPointerDown);
|
|
26
|
-
},
|
|
27
|
-
updated(e, t) {
|
|
28
|
-
let n = M.get(e);
|
|
29
|
-
n && (n.options = A(t.value));
|
|
30
|
-
},
|
|
31
|
-
beforeUnmount(e) {
|
|
32
|
-
let t = M.get(e);
|
|
33
|
-
t && e.removeEventListener("pointerdown", t.onPointerDown), M.delete(e);
|
|
34
|
-
}
|
|
35
|
-
}, P = 1e3 / 60, F = .004;
|
|
36
|
-
function ee(e, t, n, r, i) {
|
|
37
|
-
let a = [e], o = e, s = n, c = 2 * r.dampingRatio * Math.sqrt(r.stiffness);
|
|
38
|
-
for (let e = 0; e < 600; e++) {
|
|
39
|
-
for (let e = P / 1e3; e > 1e-9; e -= F) {
|
|
40
|
-
let n = Math.min(F, e);
|
|
41
|
-
s += (-r.stiffness * (o - t) - c * s) * n, o += s * n;
|
|
42
|
-
}
|
|
43
|
-
if (a.push(o), Math.abs(o - t) < i && Math.abs(s) < i * 10) break;
|
|
44
|
-
}
|
|
45
|
-
return a[a.length - 1] = t, a;
|
|
46
|
-
}
|
|
47
|
-
function I(e, t) {
|
|
48
|
-
let n = Number(t ?? 0) / P, r = Math.floor(n);
|
|
49
|
-
return r >= e.length - 1 ? e[e.length - 1] : r < 0 ? e[0] : e[r] + (e[r + 1] - e[r]) * (n - r);
|
|
50
|
-
}
|
|
51
|
-
var L = (e) => (e.length - 1) * P;
|
|
52
|
-
function R(e, t, n, r = 0) {
|
|
53
|
-
if (!e || typeof e.animate != "function" || t.length < 2) return null;
|
|
54
|
-
let i = e.animate(t.map(n), {
|
|
55
|
-
duration: L(t),
|
|
56
|
-
delay: r,
|
|
57
|
-
easing: "linear"
|
|
58
|
-
});
|
|
59
|
-
return i.finished.catch(() => {}), i;
|
|
60
|
-
}
|
|
61
|
-
var te = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, ne = ["aria-label"], re = {
|
|
62
|
-
key: 0,
|
|
63
|
-
class: "block h-full w-full animate-spin rounded-full border-2 border-current border-t-transparent"
|
|
64
|
-
}, ie = [
|
|
65
|
-
"width",
|
|
66
|
-
"height",
|
|
67
|
-
"viewBox"
|
|
68
|
-
], ae = ["d", "stroke-dasharray"], z = 3, B = 9, V = /* @__PURE__ */ d({
|
|
69
|
-
__name: "MSpinner",
|
|
70
|
-
props: {
|
|
71
|
-
size: { default: 20 },
|
|
72
|
-
wavy: {
|
|
73
|
-
type: Boolean,
|
|
74
|
-
default: !1
|
|
75
|
-
},
|
|
76
|
-
label: {}
|
|
77
|
-
},
|
|
78
|
-
setup(t) {
|
|
79
|
-
let n = t, r = e(), a = i(() => (n.size / 2 - 1 - z / 2) / 1.25), o = i(() => n.size / 2), l = i(() => {
|
|
80
|
-
let e = o.value, t = a.value, n = t * .08, r = [], i = 0, s = 0, c = 0;
|
|
81
|
-
for (let a = 0; a <= 216; a++) {
|
|
82
|
-
let o = 2 * Math.PI * a / 216 - Math.PI / 2, l = t + n * Math.sin(B * o), u = e + l * Math.cos(o), d = e + l * Math.sin(o);
|
|
83
|
-
a > 0 && (i += Math.sqrt((u - s) ** 2 + (d - c) ** 2)), r.push(`${a === 0 ? "M" : "L"}${u.toFixed(2)},${d.toFixed(2)}`), s = u, c = d;
|
|
84
|
-
}
|
|
85
|
-
let l = i * .58, u = i - l, d = `${l.toFixed(1)} ${u.toFixed(1)}`;
|
|
86
|
-
return {
|
|
87
|
-
path: r.join("") + "Z",
|
|
88
|
-
dash: d,
|
|
89
|
-
len: i.toFixed(1)
|
|
90
|
-
};
|
|
91
|
-
});
|
|
92
|
-
return (e, n) => (v(), s("span", {
|
|
93
|
-
class: "inline-flex shrink-0 items-center justify-center",
|
|
94
|
-
style: m({
|
|
95
|
-
width: `${t.size}px`,
|
|
96
|
-
height: `${t.size}px`
|
|
97
|
-
}),
|
|
98
|
-
role: "status",
|
|
99
|
-
"aria-label": t.label ?? w(r).loading
|
|
100
|
-
}, [t.wavy ? (v(), s("svg", {
|
|
101
|
-
key: 1,
|
|
102
|
-
width: t.size,
|
|
103
|
-
height: t.size,
|
|
104
|
-
viewBox: `0 0 ${t.size} ${t.size}`,
|
|
105
|
-
fill: "none",
|
|
106
|
-
class: "animate-[m3-wavy-spin_2.8s_linear_infinite]",
|
|
107
|
-
style: m(`transform-origin: ${o.value}px ${o.value}px`)
|
|
108
|
-
}, [c("path", {
|
|
109
|
-
d: l.value.path,
|
|
110
|
-
stroke: "currentColor",
|
|
111
|
-
"stroke-width": z,
|
|
112
|
-
"stroke-linecap": "round",
|
|
113
|
-
"stroke-dasharray": l.value.dash,
|
|
114
|
-
class: "animate-[m3-wavy-travel_2s_linear_infinite]",
|
|
115
|
-
style: m({ "--m3-wave-len": l.value.len })
|
|
116
|
-
}, null, 12, ae)], 12, ie)) : (v(), s("span", re))], 12, ne));
|
|
117
|
-
}
|
|
118
|
-
}), H = [
|
|
119
|
-
"bg-surface-container-highest",
|
|
120
|
-
"bg-surface-container-high",
|
|
121
|
-
"bg-surface-container-low",
|
|
122
|
-
"bg-surface-container-lowest",
|
|
123
|
-
"bg-surface-container",
|
|
124
|
-
"bg-surface-variant",
|
|
125
|
-
"bg-surface-bright",
|
|
126
|
-
"bg-surface-dim",
|
|
127
|
-
"bg-surface",
|
|
128
|
-
"bg-background",
|
|
129
|
-
"bg-inverse-surface",
|
|
130
|
-
"bg-primary-container",
|
|
131
|
-
"bg-secondary-container",
|
|
132
|
-
"bg-tertiary-container",
|
|
133
|
-
"bg-error-container",
|
|
134
|
-
"bg-primary-fixed",
|
|
135
|
-
"bg-primary-fixed-dim",
|
|
136
|
-
"bg-secondary-fixed",
|
|
137
|
-
"bg-secondary-fixed-dim",
|
|
138
|
-
"bg-tertiary-fixed",
|
|
139
|
-
"bg-tertiary-fixed-dim",
|
|
140
|
-
"bg-primary",
|
|
141
|
-
"bg-secondary",
|
|
142
|
-
"bg-tertiary",
|
|
143
|
-
"bg-error"
|
|
144
|
-
];
|
|
145
|
-
function U(e) {
|
|
146
|
-
for (let t of H) if (e.classList.contains(t)) return `var(--color-${t.slice(3)})`;
|
|
147
|
-
return null;
|
|
148
|
-
}
|
|
149
|
-
function W(e) {
|
|
150
|
-
if (!e || e === "transparent") return !0;
|
|
151
|
-
let t = e.match(/^rgba?\(([^)]+)\)$/);
|
|
152
|
-
if (t) {
|
|
153
|
-
let e = t[1].split(",").map((e) => e.trim());
|
|
154
|
-
if (e.length === 4 && parseFloat(e[3]) === 0) return !0;
|
|
155
|
-
}
|
|
156
|
-
return !1;
|
|
157
|
-
}
|
|
158
|
-
function G(e, t) {
|
|
159
|
-
let n = y("var(--color-surface)");
|
|
160
|
-
function r(r) {
|
|
161
|
-
n.value = r, e.value?.style.setProperty("--field-bg", t() ?? r);
|
|
162
|
-
}
|
|
163
|
-
function a() {
|
|
164
|
-
let t = e.value?.parentElement ?? null;
|
|
165
|
-
for (; t;) {
|
|
166
|
-
let e = U(t);
|
|
167
|
-
if (e) {
|
|
168
|
-
r(e);
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
if (t === document.body) {
|
|
172
|
-
r("var(--color-surface)");
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
let n = getComputedStyle(t).backgroundColor;
|
|
176
|
-
if (!W(n)) {
|
|
177
|
-
r(n);
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
t = t.parentElement;
|
|
181
|
-
}
|
|
182
|
-
r("var(--color-surface)");
|
|
183
|
-
}
|
|
184
|
-
let o = null;
|
|
185
|
-
return g(() => {
|
|
186
|
-
a(), o = new MutationObserver(() => a()), o.observe(document.documentElement, {
|
|
187
|
-
attributes: !0,
|
|
188
|
-
attributeFilter: [
|
|
189
|
-
"class",
|
|
190
|
-
"style",
|
|
191
|
-
"data-theme"
|
|
192
|
-
]
|
|
193
|
-
});
|
|
194
|
-
}), h(() => o?.disconnect()), { resolvedFieldBg: i(() => t() ?? n.value) };
|
|
195
|
-
}
|
|
196
|
-
//#endregion
|
|
197
|
-
//#region src/composables/useAutoGrow.ts
|
|
198
|
-
function K(e, t = {}) {
|
|
199
|
-
let n = null, r = null, i = 0;
|
|
200
|
-
function a() {
|
|
201
|
-
if (!n) return;
|
|
202
|
-
let e = getComputedStyle(n), r = (e) => parseFloat(e) || 0, i = r(e.lineHeight) || r(e.fontSize) * 1.5 || 24, a = r(e.paddingTop) + r(e.paddingBottom), o = e.boxSizing === "border-box" ? r(e.borderTopWidth) + r(e.borderBottomWidth) : 0, s = (e.boxSizing === "border-box" ? a : 0) + o, c = (C(t.minRows) ?? 1) * i + s, l = C(t.maxRows), u = l ? l * i + s : Infinity;
|
|
203
|
-
n.style.height = "auto";
|
|
204
|
-
let d = n.scrollHeight + o + (e.boxSizing === "border-box" ? 0 : -a), f = Math.min(u, Math.max(c, d));
|
|
205
|
-
n.style.height = `${f}px`, n.style.overflowY = d > u ? "auto" : "hidden";
|
|
206
|
-
}
|
|
207
|
-
function o(e) {
|
|
208
|
-
n && (n.removeEventListener("input", a), r?.disconnect(), n.style.height = "", n.style.overflowY = ""), n = e ?? null, n && (n.addEventListener("input", a), typeof ResizeObserver < "u" && (r ??= new ResizeObserver(([e]) => {
|
|
209
|
-
let t = e.contentRect.width;
|
|
210
|
-
t !== i && (i = t, a());
|
|
211
|
-
}), r.observe(n)), a());
|
|
212
|
-
}
|
|
213
|
-
return D(() => C(e), o, {
|
|
214
|
-
immediate: !0,
|
|
215
|
-
flush: "post"
|
|
216
|
-
}), D([() => C(t.minRows), () => C(t.maxRows)], () => a(), { flush: "post" }), t.value && D(t.value, () => a(), { flush: "post" }), f() && h(() => o(null)), { resize: a };
|
|
217
|
-
}
|
|
218
|
-
//#endregion
|
|
219
|
-
//#region src/composables/useDebounce.ts
|
|
220
|
-
function q(e, t) {
|
|
221
|
-
let n = null;
|
|
222
|
-
function r(...r) {
|
|
223
|
-
n && clearTimeout(n), n = setTimeout(() => {
|
|
224
|
-
n = null, e(...r);
|
|
225
|
-
}, t);
|
|
226
|
-
}
|
|
227
|
-
function i() {
|
|
228
|
-
n &&= (clearTimeout(n), null);
|
|
229
|
-
}
|
|
230
|
-
return h(i), {
|
|
231
|
-
debounced: r,
|
|
232
|
-
cancel: i
|
|
233
|
-
};
|
|
234
|
-
}
|
|
235
|
-
//#endregion
|
|
236
|
-
//#region src/composables/_useSpring.ts
|
|
237
|
-
var J = t.standard.fastSpatial, oe = t.standard.fastEffects, Y = t.standard.defaultEffects, se = t.standard.defaultSpatial, ce = .004;
|
|
238
|
-
function X(e, t, n = J) {
|
|
239
|
-
let r = [...e()], i = r.map(() => 0), a = 0, o = 0;
|
|
240
|
-
function s(c) {
|
|
241
|
-
let l = Math.min((c - o) / 1e3, 1 / 30);
|
|
242
|
-
o = c;
|
|
243
|
-
let u = e();
|
|
244
|
-
u.length !== r.length && (r = [...u], i = u.map(() => 0));
|
|
245
|
-
let d = n.stiffness, f = 2 * n.dampingRatio * Math.sqrt(d);
|
|
246
|
-
for (; l > 0;) {
|
|
247
|
-
let e = Math.min(l, ce);
|
|
248
|
-
l -= e;
|
|
249
|
-
for (let t = 0; t < u.length; t++) i[t] += (-d * (r[t] - u[t]) - f * i[t]) * e, r[t] += i[t] * e;
|
|
250
|
-
}
|
|
251
|
-
let p = u.every((e, t) => Math.abs(e - r[t]) < .05 && Math.abs(i[t]) < .05);
|
|
252
|
-
p && (r = [...u], i = u.map(() => 0)), t(r), a = p ? 0 : requestAnimationFrame(s);
|
|
253
|
-
}
|
|
254
|
-
function c() {
|
|
255
|
-
a ||= (o = performance.now(), requestAnimationFrame(s));
|
|
256
|
-
}
|
|
257
|
-
function l() {
|
|
258
|
-
cancelAnimationFrame(a), a = 0, r = [...e()], i = r.map(() => 0), t(r);
|
|
259
|
-
}
|
|
260
|
-
return D(() => e().join(","), c), g(() => t(r)), _(() => cancelAnimationFrame(a)), { snap: l };
|
|
261
|
-
}
|
|
262
|
-
var le = n(.4, 0, .2, 1), ue = "relative inline-flex shrink-0 items-center justify-center overflow-hidden transition-colors duration-150 cursor-pointer disabled:cursor-not-allowed disabled:text-on-surface/38 before:content-[''] before:pointer-events-none before:absolute before:inset-0 before:bg-current before:opacity-0 before:transition-opacity before:duration-150 enabled:hover:before:opacity-[0.08] enabled:active:before:opacity-[0.12]", de = /* @__PURE__ */ d({
|
|
263
|
-
__name: "MIconButton",
|
|
264
|
-
props: {
|
|
265
|
-
icon: {},
|
|
266
|
-
label: {},
|
|
267
|
-
variant: { default: "standard" },
|
|
268
|
-
color: {},
|
|
269
|
-
contentColor: {},
|
|
270
|
-
shape: { default: "rounded" },
|
|
271
|
-
size: { default: "sm" },
|
|
272
|
-
disabled: {
|
|
273
|
-
type: Boolean,
|
|
274
|
-
default: !1
|
|
275
|
-
},
|
|
276
|
-
to: {},
|
|
277
|
-
rippleColor: {},
|
|
278
|
-
checked: {
|
|
279
|
-
type: Boolean,
|
|
280
|
-
default: void 0
|
|
281
|
-
},
|
|
282
|
-
checkedIcon: {},
|
|
283
|
-
iconFilled: { type: Boolean }
|
|
284
|
-
},
|
|
285
|
-
emits: ["update:checked"],
|
|
286
|
-
setup(e, { emit: t }) {
|
|
287
|
-
let n = e, o = t, s = i(() => n.checked !== void 0), c = [
|
|
288
|
-
"primary",
|
|
289
|
-
"secondary",
|
|
290
|
-
"tertiary",
|
|
291
|
-
"error"
|
|
292
|
-
], l = /^(on-)?(primary|secondary|tertiary|error|surface|surface-variant|inverse-surface|inverse-primary)(-container|-variant)?$/, d = i(() => {
|
|
293
|
-
let e = f(), t = n.contentColor;
|
|
294
|
-
return !t || n.disabled || s.value ? e : {
|
|
295
|
-
...e,
|
|
296
|
-
color: l.test(t) ? `var(--color-${t})` : t
|
|
297
|
-
};
|
|
298
|
-
});
|
|
299
|
-
function f() {
|
|
300
|
-
let e = n.color;
|
|
301
|
-
if (!e || n.disabled || s.value) return;
|
|
302
|
-
let t = c.includes(e), r = t ? `var(--color-${e})` : e;
|
|
303
|
-
switch (n.variant) {
|
|
304
|
-
case "filled": return {
|
|
305
|
-
backgroundColor: r,
|
|
306
|
-
color: t ? `var(--color-on-${e})` : "#fff"
|
|
307
|
-
};
|
|
308
|
-
case "tonal": return t ? {
|
|
309
|
-
backgroundColor: `var(--color-${e}-container)`,
|
|
310
|
-
color: `var(--color-on-${e}-container)`
|
|
311
|
-
} : {
|
|
312
|
-
backgroundColor: `color-mix(in srgb, ${e} 20%, transparent)`,
|
|
313
|
-
color: e
|
|
314
|
-
};
|
|
315
|
-
default: return { color: r };
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
let h = i(() => n.to && !s.value ? "RouterLink" : "button"), g = {
|
|
319
|
-
xs: {
|
|
320
|
-
px: 32,
|
|
321
|
-
icon: 20,
|
|
322
|
-
squareRadius: "rounded-md",
|
|
323
|
-
square: 12,
|
|
324
|
-
pressed: 8,
|
|
325
|
-
checkedRound: 12
|
|
326
|
-
},
|
|
327
|
-
sm: {
|
|
328
|
-
px: 40,
|
|
329
|
-
icon: 24,
|
|
330
|
-
squareRadius: "rounded-md",
|
|
331
|
-
square: 12,
|
|
332
|
-
pressed: 8,
|
|
333
|
-
checkedRound: 12
|
|
334
|
-
},
|
|
335
|
-
md: {
|
|
336
|
-
px: 56,
|
|
337
|
-
icon: 24,
|
|
338
|
-
squareRadius: "rounded-lg",
|
|
339
|
-
square: 16,
|
|
340
|
-
pressed: 12,
|
|
341
|
-
checkedRound: 16
|
|
342
|
-
},
|
|
343
|
-
lg: {
|
|
344
|
-
px: 96,
|
|
345
|
-
icon: 32,
|
|
346
|
-
squareRadius: "rounded-xl",
|
|
347
|
-
square: 28,
|
|
348
|
-
pressed: 16,
|
|
349
|
-
checkedRound: 28
|
|
350
|
-
},
|
|
351
|
-
xl: {
|
|
352
|
-
px: 136,
|
|
353
|
-
icon: 40,
|
|
354
|
-
squareRadius: "rounded-xl",
|
|
355
|
-
square: 28,
|
|
356
|
-
pressed: 16,
|
|
357
|
-
checkedRound: 28
|
|
358
|
-
}
|
|
359
|
-
}, _ = i(() => typeof n.size == "number" ? {
|
|
360
|
-
px: n.size,
|
|
361
|
-
icon: Math.round(n.size * .55),
|
|
362
|
-
squareRadius: "rounded-md",
|
|
363
|
-
square: 12,
|
|
364
|
-
pressed: 8,
|
|
365
|
-
checkedRound: 12
|
|
366
|
-
} : g[n.size] ?? g.sm), b = y(null), S = y(!1);
|
|
367
|
-
function C() {
|
|
368
|
-
let e = _.value, t = e.px / 2;
|
|
369
|
-
return S.value ? e.pressed : n.checked ? n.shape === "squared" ? t : e.checkedRound : n.shape === "squared" ? e.square : t;
|
|
370
|
-
}
|
|
371
|
-
X(() => s.value ? [C()] : [], (e) => {
|
|
372
|
-
b.value instanceof HTMLElement && (b.value.style.borderRadius = e.length ? `${e[0]}px` : "");
|
|
373
|
-
}, Y);
|
|
374
|
-
function T() {
|
|
375
|
-
s.value && !n.disabled && (S.value = !0);
|
|
376
|
-
}
|
|
377
|
-
function E() {
|
|
378
|
-
S.value = !1;
|
|
379
|
-
}
|
|
380
|
-
function D() {
|
|
381
|
-
s.value && !n.disabled && o("update:checked", !n.checked);
|
|
382
|
-
}
|
|
383
|
-
let A = i(() => {
|
|
384
|
-
if (n.variant === "outlined" && n.checked) return "disabled:bg-on-surface/10";
|
|
385
|
-
switch (n.variant) {
|
|
386
|
-
case "filled":
|
|
387
|
-
case "tonal": return "disabled:bg-on-surface/10";
|
|
388
|
-
default: return "";
|
|
389
|
-
}
|
|
390
|
-
}), j = i(() => n.shape === "squared" ? _.value.squareRadius : "rounded-full"), M = i(() => {
|
|
391
|
-
let e = n.checked;
|
|
392
|
-
switch (n.variant) {
|
|
393
|
-
case "filled": return e ? "bg-primary text-on-primary" : "bg-surface-container text-on-surface-variant";
|
|
394
|
-
case "tonal": return e ? "bg-secondary text-on-secondary" : "bg-secondary-container text-on-secondary-container";
|
|
395
|
-
case "outlined": return e ? "bg-inverse-surface text-inverse-on-surface" : "border border-current text-on-surface-variant";
|
|
396
|
-
default: return e ? "text-primary" : "text-on-surface-variant";
|
|
397
|
-
}
|
|
398
|
-
}), P = i(() => {
|
|
399
|
-
if (s.value) return M.value;
|
|
400
|
-
switch (n.variant) {
|
|
401
|
-
case "filled": return "bg-primary text-on-primary";
|
|
402
|
-
case "tonal": return "bg-secondary-container text-on-secondary-container";
|
|
403
|
-
case "outlined": return "border border-current text-on-surface-variant";
|
|
404
|
-
default: return "text-on-surface-variant";
|
|
405
|
-
}
|
|
406
|
-
});
|
|
407
|
-
return (t, n) => k((v(), a(x(h.value), {
|
|
408
|
-
ref_key: "rootEl",
|
|
409
|
-
ref: b,
|
|
410
|
-
to: h.value === "RouterLink" ? e.to : void 0,
|
|
411
|
-
type: h.value === "RouterLink" ? void 0 : "button",
|
|
412
|
-
"aria-label": e.label || void 0,
|
|
413
|
-
"aria-pressed": s.value ? e.checked : void 0,
|
|
414
|
-
disabled: e.disabled,
|
|
415
|
-
class: p([
|
|
416
|
-
ue,
|
|
417
|
-
j.value,
|
|
418
|
-
P.value,
|
|
419
|
-
A.value
|
|
420
|
-
]),
|
|
421
|
-
style: m([{
|
|
422
|
-
width: `${_.value.px}px`,
|
|
423
|
-
height: `${_.value.px}px`
|
|
424
|
-
}, d.value]),
|
|
425
|
-
onPointerdown: T,
|
|
426
|
-
onPointerup: E,
|
|
427
|
-
onPointerleave: E,
|
|
428
|
-
onPointercancel: E,
|
|
429
|
-
onClick: D
|
|
430
|
-
}, {
|
|
431
|
-
default: O(() => [u(r, {
|
|
432
|
-
name: e.checked && e.checkedIcon ? e.checkedIcon : e.icon,
|
|
433
|
-
size: _.value.icon,
|
|
434
|
-
filled: !!e.checked || e.iconFilled
|
|
435
|
-
}, null, 8, [
|
|
436
|
-
"name",
|
|
437
|
-
"size",
|
|
438
|
-
"filled"
|
|
439
|
-
])]),
|
|
440
|
-
_: 1
|
|
441
|
-
}, 40, [
|
|
442
|
-
"to",
|
|
443
|
-
"type",
|
|
444
|
-
"aria-label",
|
|
445
|
-
"aria-pressed",
|
|
446
|
-
"disabled",
|
|
447
|
-
"class",
|
|
448
|
-
"style"
|
|
449
|
-
])), [[w(N), {
|
|
450
|
-
disabled: e.disabled,
|
|
451
|
-
color: e.rippleColor
|
|
452
|
-
}]]);
|
|
453
|
-
}
|
|
454
|
-
}), Z = [];
|
|
455
|
-
function Q(e) {
|
|
456
|
-
e.key === "Escape" && Z.length && (e.preventDefault(), Z[Z.length - 1]());
|
|
457
|
-
}
|
|
458
|
-
function fe(e, t) {
|
|
459
|
-
let n = () => t();
|
|
460
|
-
function r(e) {
|
|
461
|
-
if (typeof document > "u") return;
|
|
462
|
-
let t = Z.indexOf(n);
|
|
463
|
-
e && t < 0 ? (Z.push(n), Z.length === 1 && document.addEventListener("keydown", Q)) : !e && t >= 0 && (Z.splice(t, 1), Z.length || document.removeEventListener("keydown", Q));
|
|
464
|
-
}
|
|
465
|
-
D(e, (e) => r(!!e), { immediate: !0 }), f() && h(() => r(!1));
|
|
466
|
-
}
|
|
467
|
-
//#endregion
|
|
468
|
-
//#region src/components/MTextField.vue?vue&type=script&setup=true&lang.ts
|
|
469
|
-
var pe = { class: "flex flex-col gap-1" }, me = [
|
|
470
|
-
"id",
|
|
471
|
-
"value",
|
|
472
|
-
"rows",
|
|
473
|
-
"disabled",
|
|
474
|
-
"required"
|
|
475
|
-
], he = [
|
|
476
|
-
"id",
|
|
477
|
-
"type",
|
|
478
|
-
"value",
|
|
479
|
-
"disabled",
|
|
480
|
-
"required",
|
|
481
|
-
"autocomplete"
|
|
482
|
-
], ge = ["for"], $ = {
|
|
483
|
-
key: 0,
|
|
484
|
-
class: "text-error"
|
|
485
|
-
}, _e = {
|
|
486
|
-
key: 3,
|
|
487
|
-
class: "absolute right-2 top-1/2 -translate-y-1/2"
|
|
488
|
-
}, ve = ["aria-label"], ye = {
|
|
489
|
-
key: 0,
|
|
490
|
-
class: "px-4 text-body-small text-error"
|
|
491
|
-
}, be = {
|
|
492
|
-
key: 1,
|
|
493
|
-
class: "px-4 text-body-small text-on-surface-variant"
|
|
494
|
-
}, xe = /* @__PURE__ */ d({
|
|
495
|
-
__name: "MTextField",
|
|
496
|
-
props: {
|
|
497
|
-
modelValue: {},
|
|
498
|
-
label: {},
|
|
499
|
-
type: { default: "text" },
|
|
500
|
-
variant: { default: "filled" },
|
|
501
|
-
error: { type: Boolean },
|
|
502
|
-
errorLabel: {},
|
|
503
|
-
hint: {},
|
|
504
|
-
disabled: { type: Boolean },
|
|
505
|
-
required: { type: Boolean },
|
|
506
|
-
multiline: { type: Boolean },
|
|
507
|
-
rows: { default: 3 },
|
|
508
|
-
autoGrow: { type: Boolean },
|
|
509
|
-
maxRows: {},
|
|
510
|
-
autocomplete: {},
|
|
511
|
-
leadingIcon: {},
|
|
512
|
-
clearable: {
|
|
513
|
-
type: Boolean,
|
|
514
|
-
default: !1
|
|
515
|
-
},
|
|
516
|
-
fieldBg: {},
|
|
517
|
-
debounce: { default: 0 }
|
|
518
|
-
},
|
|
519
|
-
emits: ["update:modelValue", "debounced"],
|
|
520
|
-
setup(t, { emit: n }) {
|
|
521
|
-
let a = e(), d = t, f = n, h = T(), g = E(), _ = y(null), { resolvedFieldBg: x } = G(_, () => d.fieldBg), { debounced: C, cancel: D } = q((e) => f("debounced", e), d.debounce), O = y(null);
|
|
522
|
-
K(() => d.multiline && d.autoGrow ? O.value : null, {
|
|
523
|
-
minRows: () => d.rows,
|
|
524
|
-
maxRows: () => d.maxRows,
|
|
525
|
-
value: () => d.modelValue
|
|
526
|
-
});
|
|
527
|
-
let k = i(() => d.clearable && String(d.modelValue).length > 0 && !d.disabled), A = i(() => {
|
|
528
|
-
let e = !!g.trailing || d.clearable, t = d.leadingIcon ? "pl-12" : "pl-4", n = e ? "pr-12" : "pr-4", r = d.multiline ? d.autoGrow ? "resize-none min-h-[56px]" : "resize-y min-h-[56px]" : "h-14", i = [
|
|
529
|
-
"peer block w-full text-body-large text-on-surface outline-none placeholder:text-transparent",
|
|
530
|
-
"transition-[border-color,border-width] duration-150",
|
|
531
|
-
"disabled:cursor-not-allowed disabled:text-on-surface/38",
|
|
532
|
-
d.error ? "caret-error" : "caret-primary",
|
|
533
|
-
r,
|
|
534
|
-
t,
|
|
535
|
-
n
|
|
536
|
-
];
|
|
537
|
-
return d.variant === "outlined" ? [
|
|
538
|
-
...i,
|
|
539
|
-
"rounded-xs border bg-transparent py-4",
|
|
540
|
-
d.error ? "border-error focus:border-2 focus:border-error" : "border-outline hover:border-on-surface focus:border-2 focus:border-primary",
|
|
541
|
-
"disabled:border-on-surface/12"
|
|
542
|
-
].join(" ") : [
|
|
543
|
-
...i,
|
|
544
|
-
d.multiline ? "rounded-t-xs bg-surface-container-highest border-b border-t-24 border-t-transparent pb-2" : "rounded-t-xs bg-surface-container-highest border-b pt-6 pb-2",
|
|
545
|
-
d.error ? "border-b-error focus:border-b-2 focus:border-b-error" : "border-b-on-surface-variant hover:border-b-on-surface focus:border-b-2 focus:border-b-primary",
|
|
546
|
-
"disabled:border-b-on-surface/38 disabled:bg-[color-mix(in_srgb,var(--color-on-surface)_4%,var(--color-surface-container-highest))]"
|
|
547
|
-
].join(" ");
|
|
548
|
-
}), j = i(() => {
|
|
549
|
-
let e = [
|
|
550
|
-
"pointer-events-none absolute truncate transition-all duration-200",
|
|
551
|
-
d.leadingIcon ? d.variant === "outlined" ? "left-11" : "left-12" : d.variant === "outlined" ? "left-3" : "left-4",
|
|
552
|
-
"right-4",
|
|
553
|
-
`${d.variant === "filled" ? "top-[53%]" : "top-1/2"} -translate-y-1/2 text-body-large`
|
|
554
|
-
];
|
|
555
|
-
return d.variant === "outlined" ? [
|
|
556
|
-
...e,
|
|
557
|
-
"peer-focus:-top-2.5 peer-focus:translate-y-0 peer-focus:text-label-small peer-focus:right-auto peer-focus:max-w-[calc(100%-1.5rem)] peer-focus:bg-[var(--field-bg)] peer-focus:px-1",
|
|
558
|
-
"peer-[&:not(:placeholder-shown)]:-top-2.5 peer-[&:not(:placeholder-shown)]:translate-y-0 peer-[&:not(:placeholder-shown)]:right-auto peer-[&:not(:placeholder-shown)]:max-w-[calc(100%-1.5rem)]",
|
|
559
|
-
"peer-[&:not(:placeholder-shown)]:text-label-small peer-[&:not(:placeholder-shown)]:bg-[var(--field-bg)] peer-[&:not(:placeholder-shown)]:px-1",
|
|
560
|
-
d.error ? "text-error peer-focus:text-error" : "text-on-surface-variant peer-focus:text-primary",
|
|
561
|
-
"peer-disabled:text-on-surface/38"
|
|
562
|
-
].join(" ") : [
|
|
563
|
-
...e,
|
|
564
|
-
"peer-focus:top-2 peer-focus:translate-y-0 peer-focus:text-label-small",
|
|
565
|
-
"peer-[&:not(:placeholder-shown)]:top-2 peer-[&:not(:placeholder-shown)]:translate-y-0 peer-[&:not(:placeholder-shown)]:text-label-small",
|
|
566
|
-
d.error ? "text-error peer-focus:text-error" : "text-on-surface-variant peer-focus:text-primary",
|
|
567
|
-
"peer-disabled:text-on-surface/38"
|
|
568
|
-
].join(" ");
|
|
569
|
-
});
|
|
570
|
-
function M(e) {
|
|
571
|
-
let t = e.target;
|
|
572
|
-
f("update:modelValue", t.value), d.debounce > 0 && C(t.value);
|
|
573
|
-
}
|
|
574
|
-
return (e, n) => (v(), s("div", pe, [c("div", {
|
|
575
|
-
ref_key: "fieldBgEl",
|
|
576
|
-
ref: _,
|
|
577
|
-
class: p(["relative", t.variant === "outlined" ? "mt-2" : ""]),
|
|
578
|
-
style: m(t.variant === "outlined" ? { "--field-bg": w(x) } : void 0)
|
|
579
|
-
}, [
|
|
580
|
-
t.leadingIcon ? (v(), s("div", {
|
|
581
|
-
key: 0,
|
|
582
|
-
class: p(["pointer-events-none absolute left-3.5", [t.multiline ? "top-[55%] -translate-y-1/2" : t.variant === "filled" ? "top-4.5" : "top-4", t.disabled ? "text-on-surface/38" : "text-on-surface-variant"]])
|
|
583
|
-
}, [u(r, {
|
|
584
|
-
name: t.leadingIcon,
|
|
585
|
-
size: 24
|
|
586
|
-
}, null, 8, ["name"])], 2)) : o("", !0),
|
|
587
|
-
t.multiline ? (v(), s("textarea", {
|
|
588
|
-
key: 1,
|
|
589
|
-
ref_key: "textareaEl",
|
|
590
|
-
ref: O,
|
|
591
|
-
id: w(h),
|
|
592
|
-
value: String(t.modelValue),
|
|
593
|
-
rows: t.rows,
|
|
594
|
-
disabled: t.disabled,
|
|
595
|
-
required: t.required,
|
|
596
|
-
placeholder: " ",
|
|
597
|
-
class: p(A.value),
|
|
598
|
-
onInput: M
|
|
599
|
-
}, null, 42, me)) : (v(), s("input", {
|
|
600
|
-
key: 2,
|
|
601
|
-
id: w(h),
|
|
602
|
-
type: t.type,
|
|
603
|
-
value: t.modelValue,
|
|
604
|
-
disabled: t.disabled,
|
|
605
|
-
required: t.required,
|
|
606
|
-
autocomplete: t.autocomplete,
|
|
607
|
-
placeholder: " ",
|
|
608
|
-
class: p(A.value),
|
|
609
|
-
onInput: M
|
|
610
|
-
}, null, 42, he)),
|
|
611
|
-
c("label", {
|
|
612
|
-
for: w(h),
|
|
613
|
-
class: p(j.value)
|
|
614
|
-
}, [l(S(t.label), 1), t.required ? (v(), s("span", $, "\xA0*")) : o("", !0)], 10, ge),
|
|
615
|
-
e.$slots.trailing ? (v(), s("div", _e, [b(e.$slots, "trailing")])) : k.value ? (v(), s("button", {
|
|
616
|
-
key: 4,
|
|
617
|
-
"aria-label": w(a).clear,
|
|
618
|
-
type: "button",
|
|
619
|
-
class: "absolute right-3 top-1/2 -translate-y-1/2 flex h-6 w-6 cursor-pointer items-center justify-center rounded-full text-on-surface-variant transition-colors hover:bg-on-surface/8 hover:text-on-surface",
|
|
620
|
-
onClick: n[0] ||= (e) => {
|
|
621
|
-
w(D)(), f("update:modelValue", "");
|
|
622
|
-
}
|
|
623
|
-
}, [u(r, {
|
|
624
|
-
name: "close",
|
|
625
|
-
size: 18
|
|
626
|
-
})], 8, ve)) : o("", !0)
|
|
627
|
-
], 6), t.error && t.errorLabel ? (v(), s("p", ye, S(t.errorLabel), 1)) : t.hint ? (v(), s("p", be, S(t.hint), 1)) : o("", !0)]));
|
|
628
|
-
}
|
|
629
|
-
});
|
|
630
|
-
//#endregion
|
|
631
|
-
export { I as _, se as a, le as c, K as d, G as f, te as g, R as h, Y as i, X as l, P as m, fe as n, oe as o, V as p, de as r, J as s, xe as t, q as u, ee as v, N as y };
|
|
632
|
-
|
|
633
|
-
//# sourceMappingURL=MTextField-Bz8JIsnl.js.map
|