@m3ui-vue/m3ui-vue 1.2.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. package/dist/API.md +2914 -348
  2. package/dist/MButton-CuNzpoxm.js +172 -0
  3. package/dist/MButton-CuNzpoxm.js.map +1 -0
  4. package/dist/MDialog-HxEL-m58.js +173 -0
  5. package/dist/MDialog-HxEL-m58.js.map +1 -0
  6. package/dist/MIconButton-DoNotQ9v.js +282 -0
  7. package/dist/MIconButton-DoNotQ9v.js.map +1 -0
  8. package/dist/MListItem-DnPtv-hY.js +824 -0
  9. package/dist/MListItem-DnPtv-hY.js.map +1 -0
  10. package/dist/MLoadingIndicator-BQMNX6Dx.js +115 -0
  11. package/dist/MLoadingIndicator-BQMNX6Dx.js.map +1 -0
  12. package/dist/MMenuItem-Bih0h4-n.js +604 -0
  13. package/dist/MMenuItem-Bih0h4-n.js.map +1 -0
  14. package/dist/MProgressBar-BCoruxA-.js +184 -0
  15. package/dist/MProgressBar-BCoruxA-.js.map +1 -0
  16. package/dist/MSeekBar-LURE1Ah7.js +435 -0
  17. package/dist/MSeekBar-LURE1Ah7.js.map +1 -0
  18. package/dist/MSegmentedButton-DL9JtJFX.js +65 -0
  19. package/dist/MSegmentedButton-DL9JtJFX.js.map +1 -0
  20. package/dist/MSlider-_J4IS2_z.js +691 -0
  21. package/dist/MSlider-_J4IS2_z.js.map +1 -0
  22. package/dist/MSpinner-BhkMYKOM.js +65 -0
  23. package/dist/MSpinner-BhkMYKOM.js.map +1 -0
  24. package/dist/MTextField-CkzwNBWS.js +296 -0
  25. package/dist/MTextField-CkzwNBWS.js.map +1 -0
  26. package/dist/MTooltip-B67ZDSGp.js +756 -0
  27. package/dist/MTooltip-B67ZDSGp.js.map +1 -0
  28. package/dist/_storageKeys-CYXsUBwK.js +18 -0
  29. package/dist/_storageKeys-CYXsUBwK.js.map +1 -0
  30. package/dist/_useEscapeStack-CjndQhqg.js +19 -0
  31. package/dist/_useEscapeStack-CjndQhqg.js.map +1 -0
  32. package/dist/api.json +1 -1
  33. package/dist/chart.js +1 -1
  34. package/dist/code-editor.js +1 -1
  35. package/dist/components/MAudioPlayer.vue.d.ts +115 -0
  36. package/dist/components/MBadge.vue.d.ts +1 -1
  37. package/dist/components/MBottomSheetScaffold.vue.d.ts +1 -1
  38. package/dist/components/MBox.vue.d.ts +1 -1
  39. package/dist/components/MButton.vue.d.ts +1 -1
  40. package/dist/components/MConfirmDialog.vue.d.ts +1 -1
  41. package/dist/components/MCopyButton.vue.d.ts +2 -2
  42. package/dist/components/MDataTable.vue.d.ts +2 -2
  43. package/dist/components/MDialog.vue.d.ts +2 -2
  44. package/dist/components/MDivider.vue.d.ts +1 -1
  45. package/dist/components/MDragHandle.vue.d.ts +1 -1
  46. package/dist/components/MDrawCanvas.vue.d.ts +148 -0
  47. package/dist/components/MDrawLayers.vue.d.ts +3 -0
  48. package/dist/components/MDrawToolbar.vue.d.ts +34 -0
  49. package/dist/components/MExportButton.vue.d.ts +1 -1
  50. package/dist/components/MFab.vue.d.ts +2 -2
  51. package/dist/components/MFabMenu.vue.d.ts +2 -2
  52. package/dist/components/MFixed.vue.d.ts +1 -1
  53. package/dist/components/MFlex.vue.d.ts +2 -2
  54. package/dist/components/MFloorPlan.vue.d.ts +160 -0
  55. package/dist/components/MFlow.vue.d.ts +305 -0
  56. package/dist/components/MFlowControls.vue.d.ts +33 -0
  57. package/dist/components/MFlowHandle.vue.d.ts +16 -0
  58. package/dist/components/MFlowMinimap.vue.d.ts +22 -0
  59. package/dist/components/MFlowNode.vue.d.ts +35 -0
  60. package/dist/components/MGantt.vue.d.ts +141 -0
  61. package/dist/components/MGanttControls.vue.d.ts +32 -0
  62. package/dist/components/MIconButton.vue.d.ts +3 -1
  63. package/dist/components/MImageCropper.vue.d.ts +110 -0
  64. package/dist/components/MInfiniteScroll.vue.d.ts +1 -1
  65. package/dist/components/MLightbox.vue.d.ts +2 -2
  66. package/dist/components/MList.vue.d.ts +1 -1
  67. package/dist/components/MLoadingOverlay.vue.d.ts +1 -1
  68. package/dist/components/MMap.vue.d.ts +1 -1
  69. package/dist/components/MMapControl.vue.d.ts +1 -1
  70. package/dist/components/MMapSearch.vue.d.ts +1 -1
  71. package/dist/components/MMaskField.vue.d.ts +12 -1
  72. package/dist/components/MMenu.vue.d.ts +1 -1
  73. package/dist/components/MNavigationDrawer.vue.d.ts +1 -1
  74. package/dist/components/MNumberField.vue.d.ts +11 -2
  75. package/dist/components/MPdfViewer.vue.d.ts +174 -0
  76. package/dist/components/MPullToRefresh.vue.d.ts +1 -1
  77. package/dist/components/MResourceTimeline.vue.d.ts +149 -0
  78. package/dist/components/MScheduler.vue.d.ts +3 -3
  79. package/dist/components/MScheme.vue.d.ts +1 -1
  80. package/dist/components/MSearchField.vue.d.ts +1 -1
  81. package/dist/components/MSeekBar.vue.d.ts +1 -1
  82. package/dist/components/MSimpleCarousel.vue.d.ts +1 -1
  83. package/dist/components/MSkeleton.vue.d.ts +1 -1
  84. package/dist/components/MSlider.vue.d.ts +4 -4
  85. package/dist/components/MSparkline.vue.d.ts +1 -1
  86. package/dist/components/MSplitter.vue.d.ts +1 -1
  87. package/dist/components/MStack.vue.d.ts +2 -2
  88. package/dist/components/MSwipeToDismiss.vue.d.ts +1 -1
  89. package/dist/components/MSwitch.vue.d.ts +1 -1
  90. package/dist/components/MTable.vue.d.ts +1 -1
  91. package/dist/components/MTagInput.vue.d.ts +12 -1
  92. package/dist/components/MTextField.vue.d.ts +13 -2
  93. package/dist/components/MToolbar.vue.d.ts +1 -1
  94. package/dist/components/MTree.vue.d.ts +2 -2
  95. package/dist/components/MVideoPlayer.vue.d.ts +253 -0
  96. package/dist/components/MVirtualTable.vue.d.ts +1 -1
  97. package/dist/components/MWindow.vue.d.ts +3 -3
  98. package/dist/components/_MFlowEdge.vue.d.ts +9 -0
  99. package/dist/components/_MFlowEdgeLabel.vue.d.ts +9 -0
  100. package/dist/components/_MFlowNodeShell.vue.d.ts +9 -0
  101. package/dist/components/_MPdfPage.vue.d.ts +76 -0
  102. package/dist/components/_MTimeBackground.vue.d.ts +14 -0
  103. package/dist/components/_MTimeHeader.vue.d.ts +20 -0
  104. package/dist/composables/_effectCanvas.d.ts +23 -0
  105. package/dist/composables/_flowPanel.d.ts +2 -0
  106. package/dist/composables/_flowSlot.d.ts +5 -0
  107. package/dist/composables/_ganttTime.d.ts +41 -0
  108. package/dist/composables/_storageKeys.d.ts +9 -0
  109. package/dist/composables/_useTimeAxis.d.ts +90 -0
  110. package/dist/composables/drawGeometry.d.ts +119 -0
  111. package/dist/composables/flowFormats.d.ts +79 -0
  112. package/dist/composables/flowLayout.d.ts +45 -0
  113. package/dist/composables/flowPaths.d.ts +53 -0
  114. package/dist/composables/ganttFormats.d.ts +52 -0
  115. package/dist/composables/ganttSchedule.d.ts +99 -0
  116. package/dist/composables/themeInitScript.d.ts +2 -0
  117. package/dist/composables/useConfetti.d.ts +19 -8
  118. package/dist/composables/useDrawing.d.ts +44 -0
  119. package/dist/composables/useFireworks.d.ts +37 -0
  120. package/dist/composables/useFlow.d.ts +266 -0
  121. package/dist/composables/useGantt.d.ts +87 -0
  122. package/dist/composables/useLocale.d.ts +163 -0
  123. package/dist/composables/useMediaPlayer.d.ts +101 -0
  124. package/dist/composables/usePdf.d.ts +119 -0
  125. package/dist/composables/useReactions.d.ts +32 -0
  126. package/dist/composables/useResourceTimeline.d.ts +70 -0
  127. package/dist/composables/viewportHints.d.ts +2 -0
  128. package/dist/directives/vSparkle.d.ts +27 -0
  129. package/dist/draw.d.ts +7 -0
  130. package/dist/draw.js +1700 -0
  131. package/dist/draw.js.map +1 -0
  132. package/dist/flow.d.ts +14 -0
  133. package/dist/flow.js +3542 -0
  134. package/dist/flow.js.map +1 -0
  135. package/dist/flowPaths-CUc6X373.js +161 -0
  136. package/dist/flowPaths-CUc6X373.js.map +1 -0
  137. package/dist/gantt.d.ts +12 -0
  138. package/dist/gantt.js +3575 -0
  139. package/dist/gantt.js.map +1 -0
  140. package/dist/index.d.ts +11 -1
  141. package/dist/locales/index.js +1148 -7
  142. package/dist/locales/index.js.map +1 -1
  143. package/dist/m3ui-vue.css +1 -1
  144. package/dist/m3ui.js +7822 -7809
  145. package/dist/m3ui.js.map +1 -1
  146. package/dist/map.js +593 -588
  147. package/dist/map.js.map +1 -1
  148. package/dist/media.d.ts +5 -0
  149. package/dist/media.js +1311 -0
  150. package/dist/media.js.map +1 -0
  151. package/dist/pdf.d.ts +4 -0
  152. package/dist/pdf.js +1871 -0
  153. package/dist/pdf.js.map +1 -0
  154. package/dist/plugin.d.ts +10 -0
  155. package/dist/rich-text-editor.js +28 -26
  156. package/dist/rich-text-editor.js.map +1 -1
  157. package/dist/styles.css +1 -1
  158. package/dist/{useLocale-JYxDDeXC.js → useLocale-BpGxplLV.js} +165 -2
  159. package/dist/useLocale-BpGxplLV.js.map +1 -0
  160. package/dist/{useThemeTokens-Bv-Uv8eX.js → useThemeTokens-DQQcaWbE.js} +41 -40
  161. package/dist/useThemeTokens-DQQcaWbE.js.map +1 -0
  162. package/package.json +29 -5
  163. package/src/__tests__/MAudioPlayer.test.ts +75 -0
  164. package/src/__tests__/MDrawCanvas.test.ts +110 -0
  165. package/src/__tests__/MFloorPlan.test.ts +97 -0
  166. package/src/__tests__/MFlow.test.ts +575 -0
  167. package/src/__tests__/MGantt.test.ts +130 -0
  168. package/src/__tests__/MImageCropper.test.ts +89 -0
  169. package/src/__tests__/MPdfViewer.test.ts +235 -0
  170. package/src/__tests__/MResourceTimeline.test.ts +102 -0
  171. package/src/__tests__/MSlider.test.ts +36 -0
  172. package/src/__tests__/MVideoPlayer.test.ts +201 -0
  173. package/src/__tests__/drawGeometry.test.ts +58 -0
  174. package/src/__tests__/fieldExpose.test.ts +30 -0
  175. package/src/__tests__/flowFormats.test.ts +185 -0
  176. package/src/__tests__/flowLayout.test.ts +113 -0
  177. package/src/__tests__/ganttFormats.test.ts +76 -0
  178. package/src/__tests__/ganttSchedule.test.ts +136 -0
  179. package/src/__tests__/pdfMock.ts +83 -0
  180. package/src/__tests__/plugin.test.ts +56 -1
  181. package/src/__tests__/ssr.test.ts +1 -1
  182. package/src/__tests__/themeInitScript.test.ts +10 -0
  183. package/src/__tests__/useConfetti.test.ts +33 -2
  184. package/src/__tests__/useFireworks.test.ts +104 -0
  185. package/src/__tests__/useMediaPlayer.test.ts +182 -0
  186. package/src/__tests__/usePdf.test.ts +102 -0
  187. package/src/__tests__/useReactions.test.ts +51 -0
  188. package/src/__tests__/vSparkle.test.ts +83 -0
  189. package/src/components/MAudioPlayer.vue +319 -0
  190. package/src/components/MDrawCanvas.vue +813 -0
  191. package/src/components/MDrawLayers.vue +114 -0
  192. package/src/components/MDrawToolbar.vue +171 -0
  193. package/src/components/MEmojiSelector.vue +3 -2
  194. package/src/components/MFloorPlan.vue +581 -0
  195. package/src/components/MFlow.vue +2049 -0
  196. package/src/components/MFlowControls.vue +110 -0
  197. package/src/components/MFlowHandle.vue +60 -0
  198. package/src/components/MFlowMinimap.vue +134 -0
  199. package/src/components/MFlowNode.vue +98 -0
  200. package/src/components/MGantt.vue +1609 -0
  201. package/src/components/MGanttControls.vue +77 -0
  202. package/src/components/MIconButton.vue +3 -1
  203. package/src/components/MImageCropper.vue +507 -0
  204. package/src/components/MMap.vue +3 -2
  205. package/src/components/MMaskField.vue +13 -0
  206. package/src/components/MNumberField.vue +13 -0
  207. package/src/components/MPdfViewer.vue +1269 -0
  208. package/src/components/MResourceTimeline.vue +1020 -0
  209. package/src/components/MSlider.vue +22 -4
  210. package/src/components/MTagInput.vue +13 -0
  211. package/src/components/MTextField.vue +24 -4
  212. package/src/components/MVideoPlayer.vue +839 -0
  213. package/src/components/_MFlowEdge.vue +100 -0
  214. package/src/components/_MFlowEdgeLabel.vue +56 -0
  215. package/src/components/_MFlowNodeShell.vue +111 -0
  216. package/src/components/_MPdfPage.vue +456 -0
  217. package/src/components/_MTimeBackground.vue +16 -0
  218. package/src/components/_MTimeHeader.vue +31 -0
  219. package/src/composables/_colorUtils.ts +4 -2
  220. package/src/composables/_effectCanvas.ts +109 -0
  221. package/src/composables/_flowPanel.ts +13 -0
  222. package/src/composables/_flowSlot.ts +6 -0
  223. package/src/composables/_ganttTime.ts +200 -0
  224. package/src/composables/_ssrState.ts +2 -2
  225. package/src/composables/_storageKeys.ts +28 -0
  226. package/src/composables/_useTimeAxis.ts +224 -0
  227. package/src/composables/drawGeometry.ts +405 -0
  228. package/src/composables/flowFormats.ts +916 -0
  229. package/src/composables/flowLayout.ts +297 -0
  230. package/src/composables/flowPaths.ts +239 -0
  231. package/src/composables/ganttFormats.ts +366 -0
  232. package/src/composables/ganttSchedule.ts +403 -0
  233. package/src/composables/themeInitScript.ts +5 -2
  234. package/src/composables/useColorPalette.ts +36 -8
  235. package/src/composables/useConfetti.ts +84 -107
  236. package/src/composables/useDrawing.ts +53 -0
  237. package/src/composables/useFireworks.ts +360 -0
  238. package/src/composables/useFlow.ts +250 -0
  239. package/src/composables/useGantt.ts +92 -0
  240. package/src/composables/useLocale.ts +328 -0
  241. package/src/composables/useMediaPlayer.ts +406 -0
  242. package/src/composables/usePdf.ts +456 -0
  243. package/src/composables/useReactions.ts +131 -0
  244. package/src/composables/useResourceTimeline.ts +76 -0
  245. package/src/composables/useTheme.ts +21 -4
  246. package/src/composables/viewportHints.ts +6 -5
  247. package/src/directives/vSparkle.ts +180 -0
  248. package/src/draw.ts +25 -0
  249. package/src/flow.ts +26 -0
  250. package/src/gantt.ts +12 -0
  251. package/src/index.ts +11 -1
  252. package/src/locales/de.ts +163 -0
  253. package/src/locales/es.ts +163 -0
  254. package/src/locales/fr.ts +163 -0
  255. package/src/locales/ja.ts +163 -0
  256. package/src/locales/ko.ts +163 -0
  257. package/src/locales/pt.ts +163 -0
  258. package/src/locales/zh.ts +163 -0
  259. package/src/media.ts +5 -0
  260. package/src/pdf.ts +15 -0
  261. package/src/plugin.ts +21 -5
  262. package/dist/MMenuItem-DI351kIf.js +0 -929
  263. package/dist/MMenuItem-DI351kIf.js.map +0 -1
  264. package/dist/MSlider-BnEy5ieZ.js +0 -1500
  265. package/dist/MSlider-BnEy5ieZ.js.map +0 -1
  266. package/dist/MTextField-BBmkaIbO.js +0 -633
  267. package/dist/MTextField-BBmkaIbO.js.map +0 -1
  268. package/dist/useLocale-JYxDDeXC.js.map +0 -1
  269. package/dist/useThemeTokens-Bv-Uv8eX.js.map +0 -1
@@ -1,1500 +0,0 @@
1
- import { i as e } from "./useLocale-JYxDDeXC.js";
2
- import { l as t, o as n, s as r } from "./MTextField-BBmkaIbO.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
- }, V = {
39
- key: 2,
40
- class: "px-4 pt-4 pb-2"
41
- }, re = { class: "text-title-large font-medium text-on-surface" }, ie = {
42
- key: 0,
43
- class: "mt-1 text-body-medium text-on-surface-variant"
44
- }, ae = {
45
- key: 3,
46
- class: "flex justify-end gap-2 px-4 pt-2 pb-4"
47
- }, oe = "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]", se = /* @__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
- oe
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", V, [d("h3", re, M(e.title), 1), e.subtitle ? (E(), u("p", ie, M(e.subtitle), 1)) : l("", !0)])) : l("", !0),
116
- A(t.$slots, "default"),
117
- t.$slots.actions ? (E(), u("div", ae, [A(t.$slots, "actions")])) : l("", !0)
118
- ], 46, R));
119
- }
120
- }), ce = { class: "relative -m-[11px] inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full" }, H = [
121
- "checked",
122
- "disabled",
123
- "aria-label"
124
- ], le = {
125
- key: 1,
126
- class: "pointer-events-none absolute inset-0 rounded-full ring-0 ring-secondary transition-[box-shadow] duration-150 peer-focus-visible:ring-2"
127
- }, U = /* @__PURE__ */ 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", ce, [
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, H),
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", le)),
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"], fe = ["aria-label", "disabled"], G = "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", K = /* @__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 ? G : "",
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, fe)) : 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 q(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 pe = ["role"], me = /* @__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 = q(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, pe));
440
- }
441
- }), J = { class: "relative -my-2 inline-flex h-12 shrink-0 items-center" }, he = ["checked", "disabled"], ge = {
442
- key: 0,
443
- class: "text-body-large text-on-surface"
444
- }, _e = "bg-outline group-hover:bg-on-surface-variant group-active:bg-on-surface-variant peer-focus-visible:bg-on-surface-variant", Y = /* @__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", J, [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"] : _e]),
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", ge, 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), V = s(() => r.expandable ? "expand" : r.trailing ? r.trailing : r.trailingIcon ? "icon" : r.trailingText ? "text" : null), re = {
599
- primary: "bg-primary-container text-on-primary-container",
600
- secondary: "bg-secondary-container text-on-secondary-container",
601
- tertiary: "bg-tertiary-container text-on-tertiary-container",
602
- error: "bg-error-container text-on-error-container",
603
- success: "bg-success-container text-on-success-container"
604
- }, ie = s(() => S?.dense.value ?? !1), ae = s(() => S?.nav.value ?? !1), oe = s(() => S?.segmented.value ?? !1), se = s(() => S?.dividers.value ?? !1), ce = s(() => z.value ? "text-on-secondary-container" : "text-on-surface"), H = s(() => z.value ? "text-on-secondary-container" : "text-on-surface-variant"), le = s(() => ie.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
- oe.value ? "bg-surface-container px-4" : ae.value ? "rounded-full px-4" : "px-4",
607
- ie.value ? "py-1" : C.value === 3 ? "py-3" : "py-2",
608
- le.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), fe = (e, { slots: t }) => j.value ? g("li", {
613
- role: "listitem",
614
- ref: (e) => {
615
- de.value = e;
616
- }
617
- }, t.default?.()) : t.default?.(), G = O(null), K = (e) => e && "$el" in e ? e.$el : e, q = O(!1), pe = O(!1), me = O(!1), J = s(() => oe.value ? S?.segmentPosition(j.value ? de.value : K(W.value)) : void 0), he = s(() => {
618
- if (ae.value) return [];
619
- let e = w.value && !r.disabled, t = e && pe.value || z.value || e && me.value ? Ee : e && q.value ? Te : null;
620
- if (t !== null) return [
621
- t,
622
- t,
623
- t,
624
- t
625
- ];
626
- let n = J.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: ge } = t(() => he.value, (e) => {
634
- let t = G.value ?? K(W.value);
635
- t && (t.style.borderRadius = e.length ? e.map((e) => `${e}px`).join(" ") : "");
636
- });
637
- F([J, ae], () => ge());
638
- function _e(e) {
639
- e.pointerType !== "touch" && (q.value = !0);
640
- }
641
- function De() {
642
- q.value = !1, pe.value = !1;
643
- }
644
- function Oe(e) {
645
- e.button === 0 && (pe.value = !0);
646
- }
647
- function ke() {
648
- pe.value = !1;
649
- }
650
- function Ae(e) {
651
- me.value = e.currentTarget.matches(":focus-visible");
652
- }
653
- function je() {
654
- me.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: G,
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: _e,
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", H.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", H.value])
707
- }, M(e.overline), 3)) : l("", !0)]), A(t.$slots, "default", {}, () => [d("p", { class: b(["truncate text-body-large", ce.value]) }, M(e.title), 3), e.subtitle && C.value >= 2 ? (E(), u("p", {
708
- key: 0,
709
- class: b(["text-body-medium", [H.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", H.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(fe, { 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: _e,
739
- onPointerleave: De,
740
- onPointerdown: Oe,
741
- onPointerup: ke,
742
- onPointercancel: ke,
743
- onFocus: Ae,
744
- onBlur: je
745
- }), {
746
- default: ne(() => [
747
- se.value ? (E(), u("div", {
748
- key: 0,
749
- class: b(["absolute top-0 right-0 h-px bg-outline-variant", se.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", H.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", re[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(U, {
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", H.value])
780
- }, M(e.overline), 3)) : l("", !0)]), A(t.$slots, "default", {}, () => [
781
- d("p", { class: b(["truncate text-body-large", ce.value]) }, M(e.title), 3),
782
- e.subtitle && C.value >= 2 ? (E(), u("p", {
783
- key: 0,
784
- class: b(["text-body-medium", [H.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", H.value])
789
- }, M(e.description), 3)) : l("", !0)
790
- ])]),
791
- A(t.$slots, "trailing", {}, () => [V.value === "icon" ? (E(), c(i, {
792
- key: 0,
793
- name: e.trailingIcon,
794
- size: 24,
795
- class: b(["shrink-0", H.value])
796
- }, null, 8, ["name", "class"])) : V.value === "text" ? (E(), u("span", {
797
- key: 1,
798
- class: b(["shrink-0 text-label-small", H.value])
799
- }, M(e.trailingText), 3)) : V.value === "switch" ? (E(), c(Y, {
800
- key: 2,
801
- "model-value": !!e.trailingValue,
802
- "onUpdate:modelValue": Re
803
- }, null, 8, ["model-value"])) : V.value === "checkbox" ? (E(), c(U, {
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 = s(() => F(P.value.lo)), L = s(() => F(P.value.hi)), R = s(() => F(0)), z = s(() => oe.value < U.value.dotInset + U.value.dot / 2 ? !0 : r.variant === "centered" ? Math.min(I.value, R.value) <= 0 : r.variant !== "range" || I.value <= 0), B = s(() => se.value < U.value.dotInset + U.value.dot / 2 ? !0 : r.variant === "centered" ? Math.max(I.value, R.value) >= 100 : r.variant === "range" ? L.value >= 100 : I.value >= 100), V = O(0), re, ie = () => {
913
- let e = h.value;
914
- e && (V.value = j.value ? e.offsetHeight : e.offsetWidth);
915
- };
916
- C(() => {
917
- ie(), !(typeof ResizeObserver > "u" || !h.value) && (re = new ResizeObserver(ie), re.observe(h.value));
918
- }), S(() => re?.disconnect());
919
- let ae = (e) => {
920
- let t = U.value.thumbInset;
921
- return Math.min(Math.max(e / 100 * V.value, t), V.value - t);
922
- }, oe = s(() => V.value && (r.variant === "range" || r.variant === "centered" && I.value <= R.value) ? ae(I.value) - W.value : Infinity), se = s(() => V.value ? r.variant === "range" ? V.value - ae(L.value) - W.value : r.variant === "centered" && I.value < R.value ? Infinity : V.value - ae(I.value) - W.value : Infinity), ce = s(() => oe.value <= Z.value), H = s(() => se.value <= Z.value), le = {
923
- xs: {
924
- track: 16,
925
- thumbW: 4,
926
- thumbH: 44,
927
- dot: 4,
928
- gap: 6,
929
- hitArea: 46,
930
- radius: 6,
931
- dotInset: 12,
932
- thumbInset: 5,
933
- iconSize: 14,
934
- thumbIconSize: 22
935
- },
936
- sm: {
937
- track: 28,
938
- thumbW: 4,
939
- thumbH: 40,
940
- dot: 5,
941
- gap: 7,
942
- hitArea: 46,
943
- radius: 8,
944
- dotInset: 13,
945
- thumbInset: 6,
946
- iconSize: 16,
947
- thumbIconSize: 28
948
- },
949
- md: {
950
- track: 54,
951
- thumbW: 5,
952
- thumbH: 62,
953
- dot: 5,
954
- gap: 8,
955
- hitArea: 66,
956
- radius: 12,
957
- dotInset: 15,
958
- thumbInset: 7,
959
- iconSize: 20,
960
- thumbIconSize: 42
961
- },
962
- lg: {
963
- track: 72,
964
- thumbW: 5,
965
- thumbH: 78,
966
- dot: 6,
967
- gap: 10,
968
- hitArea: 82,
969
- radius: 14,
970
- dotInset: 17,
971
- thumbInset: 8,
972
- iconSize: 24,
973
- thumbIconSize: 52
974
- },
975
- xl: {
976
- track: 96,
977
- thumbW: 6,
978
- thumbH: 98,
979
- dot: 7,
980
- gap: 10,
981
- hitArea: 100,
982
- radius: 18,
983
- dotInset: 19,
984
- thumbInset: 9,
985
- iconSize: 28,
986
- thumbIconSize: 66
987
- }
988
- }, U = s(() => le[r.size] ?? le.xs), ue = s(() => U.value.thumbInset + U.value.thumbW / 2 + U.value.iconSize / 2 + 3), W = s(() => r.thumbIcon ? Math.max(U.value.gap, U.value.thumbIconSize / 2 + 4) : U.value.gap), de = {
989
- primary: "var(--color-primary)",
990
- secondary: "var(--color-secondary)",
991
- tertiary: "var(--color-tertiary)",
992
- error: "var(--color-error)"
993
- };
994
- function fe(e, t) {
995
- let n = e ?? t;
996
- return de[n] ?? n;
997
- }
998
- let G = s(() => r.disabled ? {
999
- active: Ne,
1000
- inactive: Pe
1001
- } : {
1002
- active: fe(r.fillColor, r.color),
1003
- inactive: "var(--color-secondary-container)"
1004
- }), K = s(() => r.disabled ? {
1005
- active: Ne,
1006
- inactive: Pe
1007
- } : {
1008
- active: fe(r.thumbColor, r.color),
1009
- inactive: "var(--color-secondary-container)"
1010
- });
1011
- function q(e) {
1012
- let t = Math.round((e - r.min) / r.step) * r.step + r.min;
1013
- return Math.max(r.min, Math.min(r.max, +t.toFixed(10)));
1014
- }
1015
- function pe(e) {
1016
- if (!h.value) return 0;
1017
- let t = h.value.getBoundingClientRect();
1018
- 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));
1019
- }
1020
- function me(e) {
1021
- return q(r.min + pe(e) * (r.max - r.min));
1022
- }
1023
- let J = !1;
1024
- function he(e, t) {
1025
- let { lo: n, hi: r } = P.value;
1026
- return e === 0 ? [Math.min(t, r), r] : [n, Math.max(t, n)];
1027
- }
1028
- function ge(e) {
1029
- if (r.disabled) return;
1030
- e.preventDefault();
1031
- let t = me(e);
1032
- if (N.value) {
1033
- let { lo: e, hi: n } = P.value;
1034
- J = !1;
1035
- let r;
1036
- t <= e && t < n ? r = 0 : t >= n && t > e ? r = 1 : e === n ? (r = 0, J = !0) : r = Math.abs(t - e) <= Math.abs(t - n) ? 0 : 1, _.value = r, D(r), J || f("update:modelValue", he(r, t));
1037
- } else _.value = "single", f("update:modelValue", t);
1038
- window.addEventListener("pointermove", _e), window.addEventListener("pointerup", Y), window.addEventListener("pointercancel", Y);
1039
- }
1040
- function _e(e) {
1041
- if (_.value === !1) return;
1042
- let t = me(e);
1043
- if (N.value) {
1044
- if (J) {
1045
- if (t === P.value.lo) return;
1046
- J = !1, _.value = +(t > P.value.lo), D(_.value);
1047
- }
1048
- f("update:modelValue", he(_.value, t));
1049
- } else f("update:modelValue", t);
1050
- }
1051
- function Y() {
1052
- _.value = !1, J = !1, window.removeEventListener("pointermove", _e), window.removeEventListener("pointerup", Y), window.removeEventListener("pointercancel", Y);
1053
- }
1054
- let ve = {
1055
- ArrowRight: 1,
1056
- ArrowUp: 1,
1057
- ArrowLeft: -1,
1058
- ArrowDown: -1
1059
- };
1060
- function ye(e) {
1061
- if (r.disabled) return;
1062
- let t = ve[e.key];
1063
- t !== void 0 && (e.preventDefault(), f("update:modelValue", q(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));
1064
- }
1065
- function be(e, t) {
1066
- if (r.disabled) return;
1067
- let { lo: n, hi: i } = P.value, a = e === 0 ? n : i, o = ve[t.key], s;
1068
- o === void 0 ? t.key === "Home" ? s = e === 0 ? r.min : n : t.key === "End" && (s = e === 0 ? i : r.max) : s = q(a + o * r.step), s !== void 0 && (t.preventDefault(), w.value = e, f("update:modelValue", he(e, s)));
1069
- }
1070
- S(() => {
1071
- window.removeEventListener("pointermove", _e), window.removeEventListener("pointerup", Y), window.removeEventListener("pointercancel", Y);
1072
- });
1073
- let xe = s(() => {
1074
- if (!r.stops) return [];
1075
- let e = [], t = r.max - r.min, n = r.icon ? (U.value.iconSize + U.value.radius) / 2 : 0;
1076
- for (let i = r.min + r.step; i < r.max; i += r.step) {
1077
- let a = (i - r.min) / t * 100;
1078
- r.icon && a < n || e.push(a);
1079
- }
1080
- return e.length <= 28 ? e : [];
1081
- });
1082
- function Se(e) {
1083
- return `calc(${$(e)} - ${W.value}px)`;
1084
- }
1085
- function Ce(e) {
1086
- return H.value ? "0px" : `calc(100% - ${$(e)} - ${W.value}px)`;
1087
- }
1088
- function we() {
1089
- return ce.value ? "0px" : `calc(${$(I.value)} - ${W.value}px)`;
1090
- }
1091
- function Te() {
1092
- return `calc(${$(I.value)} + ${W.value}px)`;
1093
- }
1094
- function Ee() {
1095
- return `calc(${$(L.value)} - ${$(I.value)} - ${W.value * 2}px)`;
1096
- }
1097
- function De() {
1098
- return H.value ? "0px" : `calc(100% - ${$(L.value)} - ${W.value}px)`;
1099
- }
1100
- function Fe() {
1101
- return I.value >= R.value ? `${R.value}%` : `calc(${$(I.value)} + ${W.value}px)`;
1102
- }
1103
- function Ie() {
1104
- return I.value >= R.value ? `calc(${$(I.value)} - ${R.value}% - ${W.value}px)` : `calc(${R.value}% - ${$(I.value)} - ${W.value}px)`;
1105
- }
1106
- function Le() {
1107
- return H.value ? "0px" : I.value >= R.value ? `calc(100% - ${$(I.value)} - ${W.value}px)` : `calc(100% - ${R.value}% - ${W.value}px)`;
1108
- }
1109
- function Re() {
1110
- return ce.value ? "0px" : I.value <= R.value ? `calc(${$(I.value)} - ${W.value}px)` : `calc(${R.value}% - ${W.value}px)`;
1111
- }
1112
- let ze = s(() => U.value.radius), X = s(() => Math.max(2, ze.value / 4)), Z = s(() => ze.value * 1.3);
1113
- function Be() {
1114
- return `${X.value}px`;
1115
- }
1116
- function Ve() {
1117
- 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`;
1118
- }
1119
- function He() {
1120
- 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`;
1121
- }
1122
- let Ue = s(() => _.value === !1), Q = s(() => Ue.value ? "75ms ease" : "0s");
1123
- function $(e) {
1124
- let t = U.value.thumbInset;
1125
- return `clamp(${t}px, ${e}%, calc(100% - ${t}px))`;
1126
- }
1127
- function We(e, t = 0) {
1128
- let n = j.value ? U.value.thumbH : U.value.thumbW, r = j.value ? U.value.thumbW : U.value.thumbH, i = Math.min(n, r) / 2, a = _.value !== !1, o = {
1129
- position: "absolute",
1130
- width: `${n}px`,
1131
- height: `${r}px`,
1132
- borderRadius: `${i}px`,
1133
- backgroundColor: K.value.active,
1134
- "--tw-ring-color": K.value.active,
1135
- zIndex: "2",
1136
- transition: Ue.value ? "left 75ms ease, bottom 75ms ease, transform 80ms ease" : "transform 80ms ease"
1137
- }, s = N.value ? _.value === t || y.value === t : a || v.value, c = (N.value ? _.value === t : a) ? 1.08 : 1, l = s ? .5 : 1;
1138
- 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;
1139
- }
1140
- function Ge(e) {
1141
- let t = _.value === !1 ? 1 : 1.15, n = {
1142
- position: "absolute",
1143
- color: K.value.active,
1144
- "--tw-ring-color": K.value.active,
1145
- zIndex: "2",
1146
- transition: Ue.value ? "left 75ms ease, bottom 75ms ease, transform 80ms ease" : "transform 80ms ease"
1147
- };
1148
- 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;
1149
- }
1150
- function Ke(e) {
1151
- let t = U.value.track / 2 + 36, n = U.value.track / 2 + 40;
1152
- return j.value ? {
1153
- left: `calc(50% - ${n}px)`,
1154
- bottom: $(e),
1155
- transform: "translateY(50%)",
1156
- transition: Ue.value ? "bottom " + Q.value : "none"
1157
- } : {
1158
- left: $(e),
1159
- top: `calc(50% - ${t}px)`,
1160
- transform: "translateX(-50%)",
1161
- transition: Ue.value ? "left " + Q.value : "none"
1162
- };
1163
- }
1164
- let qe = s(() => N.value ? `${P.value.lo} – ${P.value.hi}` : String(r.modelValue)), Je = s(() => N.value && typeof _.value == "number" ? _.value === 0 ? P.value.lo : P.value.hi : r.modelValue), Ye = s(() => N.value && typeof _.value == "number" ? _.value === 0 ? I.value : L.value : I.value);
1165
- 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(qe.value), 1)) : l("", !0)])) : l("", !0), d("div", { class: b(["flex items-center", j.value ? "flex-1 flex-col" : ""]) }, [d("div", {
1166
- ref_key: "trackEl",
1167
- ref: h,
1168
- role: N.value ? "group" : "slider",
1169
- tabindex: N.value ? void 0 : 0,
1170
- "aria-label": N.value ? t.label : void 0,
1171
- "aria-valuenow": N.value ? void 0 : t.modelValue,
1172
- "aria-valuemin": N.value ? void 0 : t.min,
1173
- "aria-valuemax": N.value ? void 0 : t.max,
1174
- "aria-disabled": t.disabled || void 0,
1175
- "aria-orientation": N.value ? void 0 : t.orientation,
1176
- class: b(["group relative touch-none cursor-pointer outline-none", t.disabled && "cursor-not-allowed"]),
1177
- style: x(j.value ? {
1178
- width: `${U.value.hitArea}px`,
1179
- minHeight: "160px",
1180
- height: "100%"
1181
- } : {
1182
- height: `${U.value.hitArea}px`,
1183
- width: "100%"
1184
- }),
1185
- onPointerdown: ge,
1186
- onKeydown: n[0] ||= (e) => !N.value && ye(e),
1187
- onFocus: n[1] ||= (e) => v.value = !N.value,
1188
- onBlur: n[2] ||= (e) => v.value = !1
1189
- }, [
1190
- d("div", {
1191
- class: "absolute",
1192
- style: x(j.value ? {
1193
- left: "50%",
1194
- top: "0",
1195
- bottom: "0",
1196
- width: `${U.value.track}px`,
1197
- transform: "translateX(-50%)",
1198
- borderRadius: `${Z.value}px`
1199
- } : {
1200
- top: "50%",
1201
- left: "0",
1202
- right: "0",
1203
- height: `${U.value.track}px`,
1204
- transform: "translateY(-50%)",
1205
- borderRadius: `${Z.value}px`
1206
- })
1207
- }, [
1208
- t.variant === "standard" ? (E(), u(a, { key: 0 }, [d("div", {
1209
- class: "absolute",
1210
- style: x({
1211
- ...j.value ? {
1212
- left: 0,
1213
- right: 0,
1214
- bottom: 0,
1215
- height: Se(I.value)
1216
- } : {
1217
- top: 0,
1218
- bottom: 0,
1219
- left: 0,
1220
- width: Se(I.value)
1221
- },
1222
- borderRadius: Ve(),
1223
- backgroundColor: G.value.active,
1224
- transition: `all ${Q.value}`
1225
- })
1226
- }, null, 4), d("div", {
1227
- class: "absolute",
1228
- style: x({
1229
- ...j.value ? {
1230
- left: 0,
1231
- right: 0,
1232
- top: 0,
1233
- height: Ce(I.value)
1234
- } : {
1235
- top: 0,
1236
- bottom: 0,
1237
- right: 0,
1238
- width: Ce(I.value)
1239
- },
1240
- borderRadius: He(),
1241
- backgroundColor: G.value.inactive,
1242
- transition: `all ${Q.value}`
1243
- })
1244
- }, null, 4)], 64)) : t.variant === "centered" ? (E(), u(a, { key: 1 }, [
1245
- d("div", {
1246
- class: "absolute",
1247
- style: x({
1248
- ...j.value ? {
1249
- left: 0,
1250
- right: 0,
1251
- bottom: Fe(),
1252
- height: Ie()
1253
- } : {
1254
- top: 0,
1255
- bottom: 0,
1256
- left: Fe(),
1257
- width: Ie()
1258
- },
1259
- borderRadius: Be(),
1260
- backgroundColor: G.value.active,
1261
- transition: `all ${Q.value}`
1262
- })
1263
- }, null, 4),
1264
- d("div", {
1265
- class: "absolute",
1266
- style: x({
1267
- ...j.value ? {
1268
- left: 0,
1269
- right: 0,
1270
- top: 0,
1271
- height: Le()
1272
- } : {
1273
- top: 0,
1274
- bottom: 0,
1275
- right: 0,
1276
- width: Le()
1277
- },
1278
- borderRadius: He(),
1279
- backgroundColor: G.value.inactive,
1280
- transition: `all ${Q.value}`
1281
- })
1282
- }, null, 4),
1283
- d("div", {
1284
- class: "absolute",
1285
- style: x({
1286
- ...j.value ? {
1287
- left: 0,
1288
- right: 0,
1289
- bottom: 0,
1290
- height: Re()
1291
- } : {
1292
- top: 0,
1293
- bottom: 0,
1294
- left: 0,
1295
- width: Re()
1296
- },
1297
- borderRadius: Ve(),
1298
- backgroundColor: G.value.inactive,
1299
- transition: `all ${Q.value}`
1300
- })
1301
- }, null, 4)
1302
- ], 64)) : t.variant === "range" ? (E(), u(a, { key: 2 }, [
1303
- d("div", {
1304
- class: "absolute",
1305
- style: x({
1306
- ...j.value ? {
1307
- left: 0,
1308
- right: 0,
1309
- bottom: 0,
1310
- height: we()
1311
- } : {
1312
- top: 0,
1313
- bottom: 0,
1314
- left: 0,
1315
- width: we()
1316
- },
1317
- borderRadius: Ve(),
1318
- backgroundColor: G.value.inactive,
1319
- transition: `all ${Q.value}`
1320
- })
1321
- }, null, 4),
1322
- d("div", {
1323
- class: "absolute",
1324
- style: x({
1325
- ...j.value ? {
1326
- left: 0,
1327
- right: 0,
1328
- bottom: Te(),
1329
- height: Ee()
1330
- } : {
1331
- top: 0,
1332
- bottom: 0,
1333
- left: Te(),
1334
- width: Ee()
1335
- },
1336
- borderRadius: Be(),
1337
- backgroundColor: G.value.active,
1338
- transition: `all ${Q.value}`
1339
- })
1340
- }, null, 4),
1341
- d("div", {
1342
- class: "absolute",
1343
- style: x({
1344
- ...j.value ? {
1345
- left: 0,
1346
- right: 0,
1347
- top: 0,
1348
- height: De()
1349
- } : {
1350
- top: 0,
1351
- bottom: 0,
1352
- right: 0,
1353
- width: De()
1354
- },
1355
- borderRadius: He(),
1356
- backgroundColor: G.value.inactive,
1357
- transition: `all ${Q.value}`
1358
- })
1359
- }, null, 4)
1360
- ], 64)) : l("", !0),
1361
- t.icon ? (E(), c(i, {
1362
- key: 3,
1363
- name: t.icon,
1364
- size: U.value.iconSize,
1365
- class: "absolute z-[1]",
1366
- style: x({
1367
- color: t.variant === "standard" && I.value > 0 || t.variant === "range" && I.value > 0 ? G.value.inactive : G.value.active,
1368
- ...j.value ? {
1369
- left: "50%",
1370
- bottom: `${ue.value}px`,
1371
- transform: "translateX(-50%)"
1372
- } : {
1373
- top: "50%",
1374
- left: `${ue.value}px`,
1375
- transform: "translateY(-50%)"
1376
- },
1377
- transition: "color 150ms ease"
1378
- })
1379
- }, null, 8, [
1380
- "name",
1381
- "size",
1382
- "style"
1383
- ])) : t.stops ? l("", !0) : (E(), u("div", {
1384
- key: 4,
1385
- class: "absolute rounded-full",
1386
- style: x({
1387
- width: `${U.value.dot}px`,
1388
- height: `${U.value.dot}px`,
1389
- backgroundColor: G.value.active,
1390
- opacity: +!z.value,
1391
- ...j.value ? {
1392
- left: "50%",
1393
- bottom: `${U.value.dotInset}px`,
1394
- transform: "translateX(-50%)"
1395
- } : {
1396
- top: "50%",
1397
- left: `${U.value.dotInset}px`,
1398
- transform: "translateY(-50%)"
1399
- },
1400
- transition: "opacity 150ms ease"
1401
- })
1402
- }, null, 4)),
1403
- t.stops ? l("", !0) : (E(), u("div", {
1404
- key: 5,
1405
- class: "absolute rounded-full",
1406
- style: x({
1407
- width: `${U.value.dot}px`,
1408
- height: `${U.value.dot}px`,
1409
- backgroundColor: G.value.active,
1410
- opacity: +!B.value,
1411
- ...j.value ? {
1412
- left: "50%",
1413
- top: `${U.value.dotInset}px`,
1414
- transform: "translateX(-50%)"
1415
- } : {
1416
- top: "50%",
1417
- right: `${U.value.dotInset}px`,
1418
- transform: "translateY(-50%)"
1419
- },
1420
- transition: "opacity 150ms ease"
1421
- })
1422
- }, null, 4)),
1423
- t.stops ? (E(!0), u(a, { key: 6 }, k(xe.value, (e, t) => (E(), u("div", {
1424
- key: t,
1425
- class: "absolute rounded-full",
1426
- style: x({
1427
- width: `${U.value.dot}px`,
1428
- height: `${U.value.dot}px`,
1429
- backgroundColor: e <= I.value ? G.value.inactive : G.value.active,
1430
- opacity: Math.abs(e - I.value) < .01 || N.value && Math.abs(e - L.value) < .01 ? 0 : 1,
1431
- ...j.value ? {
1432
- left: "50%",
1433
- bottom: `${e}%`,
1434
- transform: "translateX(-50%) translateY(50%)"
1435
- } : {
1436
- top: "50%",
1437
- left: `${e}%`,
1438
- transform: "translateX(-50%) translateY(-50%)"
1439
- }
1440
- })
1441
- }, null, 4))), 128)) : l("", !0)
1442
- ], 4),
1443
- N.value ? (E(), u(a, { key: 1 }, k([0, 1], (e) => d("div", {
1444
- key: e,
1445
- ref_for: !0,
1446
- ref: (t) => {
1447
- t && (g.value[e] = t);
1448
- },
1449
- role: "slider",
1450
- tabindex: t.disabled ? -1 : 0,
1451
- "aria-label": e === 0 ? te(m).sliderRangeStart : te(m).sliderRangeEnd,
1452
- "aria-valuenow": e === 0 ? P.value.lo : P.value.hi,
1453
- "aria-valuemin": e === 0 ? t.min : P.value.lo,
1454
- "aria-valuemax": e === 0 ? P.value.hi : t.max,
1455
- "aria-disabled": t.disabled || void 0,
1456
- "aria-orientation": t.orientation,
1457
- 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"]),
1458
- style: x(t.thumbIcon ? Ge(e === 0 ? I.value : L.value) : We(e === 0 ? I.value : L.value, e)),
1459
- onKeydown: (t) => be(e, t),
1460
- onFocus: (t) => A(e),
1461
- onBlur: ee
1462
- }, [t.thumbIcon ? (E(), c(i, {
1463
- key: 0,
1464
- name: t.thumbIcon,
1465
- size: U.value.thumbIconSize
1466
- }, null, 8, ["name", "size"])) : l("", !0)], 46, Me)), 64)) : (E(), u(a, { key: 0 }, [t.thumbIcon ? (E(), c(i, {
1467
- key: 0,
1468
- name: t.thumbIcon,
1469
- size: U.value.thumbIconSize,
1470
- class: "pointer-events-none rounded-full group-focus-visible:ring-2 group-focus-visible:ring-offset-2 group-focus-visible:ring-offset-surface",
1471
- style: x(Ge(I.value))
1472
- }, null, 8, [
1473
- "name",
1474
- "size",
1475
- "style"
1476
- ])) : (E(), u("div", {
1477
- key: 1,
1478
- class: "pointer-events-none group-focus-visible:ring-2 group-focus-visible:ring-offset-2 group-focus-visible:ring-offset-surface",
1479
- style: x(We(I.value))
1480
- }, null, 4))], 64)),
1481
- p(o, {
1482
- "enter-active-class": "transition-opacity duration-100",
1483
- "enter-from-class": "opacity-0",
1484
- "leave-active-class": "transition-opacity duration-75",
1485
- "leave-to-class": "opacity-0"
1486
- }, {
1487
- default: ne(() => [t.showTooltip && _.value !== !1 ? (E(), u("div", {
1488
- key: 0,
1489
- 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",
1490
- style: x(Ke(Ye.value))
1491
- }, M(Je.value), 5)) : l("", !0)]),
1492
- _: 1
1493
- })
1494
- ], 46, je)], 2)], 2));
1495
- }
1496
- });
1497
- //#endregion
1498
- export { q as a, se as c, me as i, L as l, De as n, K as o, Y as r, U as s, Fe as t };
1499
-
1500
- //# sourceMappingURL=MSlider-BnEy5ieZ.js.map