@m3ui-vue/m3ui-vue 1.2.2 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/API.md +2776 -351
- package/dist/MButton-CuNzpoxm.js +172 -0
- package/dist/MButton-CuNzpoxm.js.map +1 -0
- package/dist/MDialog-HxEL-m58.js +173 -0
- package/dist/MDialog-HxEL-m58.js.map +1 -0
- package/dist/MIconButton-DoNotQ9v.js +282 -0
- package/dist/MIconButton-DoNotQ9v.js.map +1 -0
- package/dist/MListItem-DnPtv-hY.js +824 -0
- package/dist/MListItem-DnPtv-hY.js.map +1 -0
- package/dist/MLoadingIndicator-BQMNX6Dx.js +115 -0
- package/dist/MLoadingIndicator-BQMNX6Dx.js.map +1 -0
- package/dist/MMenuItem-Bih0h4-n.js +604 -0
- package/dist/MMenuItem-Bih0h4-n.js.map +1 -0
- package/dist/MProgressBar-BCoruxA-.js +184 -0
- package/dist/MProgressBar-BCoruxA-.js.map +1 -0
- package/dist/MSeekBar-LURE1Ah7.js +435 -0
- package/dist/MSeekBar-LURE1Ah7.js.map +1 -0
- package/dist/MSegmentedButton-DL9JtJFX.js +65 -0
- package/dist/MSegmentedButton-DL9JtJFX.js.map +1 -0
- package/dist/MSlider-_J4IS2_z.js +691 -0
- package/dist/MSlider-_J4IS2_z.js.map +1 -0
- package/dist/MSpinner-BhkMYKOM.js +65 -0
- package/dist/MSpinner-BhkMYKOM.js.map +1 -0
- package/dist/MTextField-CkzwNBWS.js +296 -0
- package/dist/MTextField-CkzwNBWS.js.map +1 -0
- package/dist/MTooltip-B67ZDSGp.js +756 -0
- package/dist/MTooltip-B67ZDSGp.js.map +1 -0
- package/dist/_storageKeys-CYXsUBwK.js +18 -0
- package/dist/_storageKeys-CYXsUBwK.js.map +1 -0
- package/dist/_useEscapeStack-CjndQhqg.js +19 -0
- package/dist/_useEscapeStack-CjndQhqg.js.map +1 -0
- package/dist/api.json +1 -1
- package/dist/chart.js +1 -1
- package/dist/code-editor.js +1 -1
- package/dist/components/MAudioPlayer.vue.d.ts +115 -0
- package/dist/components/MBadge.vue.d.ts +1 -1
- package/dist/components/MBottomSheetScaffold.vue.d.ts +1 -1
- package/dist/components/MBox.vue.d.ts +1 -1
- package/dist/components/MButton.vue.d.ts +1 -1
- package/dist/components/MConfirmDialog.vue.d.ts +1 -1
- package/dist/components/MCopyButton.vue.d.ts +2 -2
- package/dist/components/MDataTable.vue.d.ts +2 -2
- package/dist/components/MDialog.vue.d.ts +2 -2
- package/dist/components/MDivider.vue.d.ts +1 -1
- package/dist/components/MDragHandle.vue.d.ts +1 -1
- package/dist/components/MDrawCanvas.vue.d.ts +148 -0
- package/dist/components/MDrawLayers.vue.d.ts +3 -0
- package/dist/components/MDrawToolbar.vue.d.ts +34 -0
- package/dist/components/MExportButton.vue.d.ts +1 -1
- package/dist/components/MFab.vue.d.ts +2 -2
- package/dist/components/MFabMenu.vue.d.ts +2 -2
- package/dist/components/MFixed.vue.d.ts +1 -1
- package/dist/components/MFlex.vue.d.ts +2 -2
- package/dist/components/MFloorPlan.vue.d.ts +160 -0
- package/dist/components/MFlow.vue.d.ts +305 -0
- package/dist/components/MFlowControls.vue.d.ts +33 -0
- package/dist/components/MFlowHandle.vue.d.ts +16 -0
- package/dist/components/MFlowMinimap.vue.d.ts +22 -0
- package/dist/components/MFlowNode.vue.d.ts +35 -0
- package/dist/components/MGantt.vue.d.ts +141 -0
- package/dist/components/MGanttControls.vue.d.ts +32 -0
- package/dist/components/MIconButton.vue.d.ts +3 -1
- package/dist/components/MImageCropper.vue.d.ts +110 -0
- package/dist/components/MInfiniteScroll.vue.d.ts +1 -1
- package/dist/components/MLightbox.vue.d.ts +2 -2
- package/dist/components/MList.vue.d.ts +1 -1
- package/dist/components/MLoadingOverlay.vue.d.ts +1 -1
- package/dist/components/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/useFlow.d.ts +266 -0
- package/dist/composables/useGantt.d.ts +87 -0
- package/dist/composables/useLocale.d.ts +163 -0
- package/dist/composables/useMediaPlayer.d.ts +101 -0
- package/dist/composables/usePdf.d.ts +119 -0
- package/dist/composables/useResourceTimeline.d.ts +70 -0
- package/dist/draw.d.ts +7 -0
- package/dist/draw.js +1700 -0
- package/dist/draw.js.map +1 -0
- package/dist/flow.d.ts +14 -0
- package/dist/flow.js +3542 -0
- package/dist/flow.js.map +1 -0
- package/dist/flowPaths-CUc6X373.js +161 -0
- package/dist/flowPaths-CUc6X373.js.map +1 -0
- package/dist/gantt.d.ts +12 -0
- package/dist/gantt.js +3575 -0
- package/dist/gantt.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/locales/index.js +1148 -7
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +7286 -7654
- 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-BpGxplLV.js} +165 -2
- package/dist/useLocale-BpGxplLV.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 +110 -0
- package/src/__tests__/MFloorPlan.test.ts +97 -0
- package/src/__tests__/MFlow.test.ts +575 -0
- package/src/__tests__/MGantt.test.ts +130 -0
- package/src/__tests__/MImageCropper.test.ts +89 -0
- package/src/__tests__/MPdfViewer.test.ts +235 -0
- package/src/__tests__/MResourceTimeline.test.ts +102 -0
- package/src/__tests__/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 +813 -0
- package/src/components/MDrawLayers.vue +114 -0
- package/src/components/MDrawToolbar.vue +171 -0
- package/src/components/MFloorPlan.vue +581 -0
- package/src/components/MFlow.vue +2049 -0
- package/src/components/MFlowControls.vue +110 -0
- package/src/components/MFlowHandle.vue +60 -0
- package/src/components/MFlowMinimap.vue +134 -0
- package/src/components/MFlowNode.vue +98 -0
- package/src/components/MGantt.vue +1609 -0
- package/src/components/MGanttControls.vue +77 -0
- package/src/components/MIconButton.vue +3 -1
- package/src/components/MImageCropper.vue +507 -0
- package/src/components/MMaskField.vue +13 -0
- package/src/components/MNumberField.vue +13 -0
- package/src/components/MPdfViewer.vue +1269 -0
- package/src/components/MResourceTimeline.vue +1020 -0
- package/src/components/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/useFlow.ts +250 -0
- package/src/composables/useGantt.ts +92 -0
- package/src/composables/useLocale.ts +328 -0
- package/src/composables/useMediaPlayer.ts +406 -0
- package/src/composables/usePdf.ts +456 -0
- package/src/composables/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 +4 -0
- package/src/locales/de.ts +163 -0
- package/src/locales/es.ts +163 -0
- package/src/locales/fr.ts +163 -0
- package/src/locales/ja.ts +163 -0
- package/src/locales/ko.ts +163 -0
- package/src/locales/pt.ts +163 -0
- package/src/locales/zh.ts +163 -0
- package/src/media.ts +5 -0
- package/src/pdf.ts +15 -0
- package/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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MSlider-_J4IS2_z.js","names":[],"sources":["../src/components/MSlider.vue","../src/components/MSlider.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * The M3 slider — vertical bar thumb, rounded track with gap, standard/centered/range variants, horizontal or\n * vertical.\n *\n * @event update:modelValue Emitted while dragging and on key presses, with the new value (a `[low, high]` pair\n * for the range variant).\n */\nimport { computed, onBeforeUnmount, onMounted, ref } from 'vue'\nimport MIcon from './MIcon.vue'\nimport { useLocale } from '../composables/useLocale'\n\nconst props = withDefaults(\n defineProps<{\n /** Current value — a tuple when variant is range */\n modelValue: number | [number, number]\n /** Minimum value */\n min?: number\n /** Maximum value */\n max?: number\n /** Step increment: the values emitted snap to it; while dragging (without stops) the thumb still follows the pointer smoothly and settles on its step when released */\n step?: number\n /** Disables the slider */\n disabled?: boolean\n /** Label text */\n label?: string\n /** Show current value beside label */\n showValue?: boolean\n /** Show value tooltip while dragging */\n showTooltip?: boolean\n /** Slider orientation */\n orientation?: 'horizontal' | 'vertical'\n /** Track and thumb size */\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n /** Standard, centered (from middle), or range (two thumbs) */\n variant?: 'standard' | 'centered' | 'range'\n /** Show stop dots at each step (max 30 visible), and make a dragged thumb snap from step to step instead of following the pointer smoothly (a discrete slider) */\n stops?: boolean\n /** Material Symbol icon shown before the slider — hides once the fill reaches it */\n icon?: string\n /** Base color — used for the fill and thumb unless overridden by fillColor/thumbColor */\n color?: 'primary' | 'secondary' | 'tertiary' | 'error'\n /** Custom color (hex, rgb(), a CSS var, etc.) for the filled/active portion of the track and the corner dot. Defaults to `color`'s M3 token. */\n fillColor?: string\n /** Replaces the draggable bar thumb with an icon. */\n thumbIcon?: string\n /** Custom color (hex, rgb(), a CSS var, etc.) for the thumb (bar or icon). Defaults to `color`'s M3 token. */\n thumbColor?: string\n }>(),\n {\n min: 0,\n max: 100,\n step: 1,\n disabled: false,\n showValue: false,\n showTooltip: false,\n orientation: 'horizontal',\n size: 'xs',\n variant: 'standard',\n stops: false,\n color: 'primary',\n },\n)\n\nconst emit = defineEmits<{ 'update:modelValue': [number | [number, number]] }>()\n\nconst t = useLocale()\nconst trackEl = ref<HTMLElement>()\nconst thumbEls = ref<HTMLElement[]>([])\n// Range: 0 = the start (low) thumb, 1 = the end (high) one\nconst dragging = ref<false | 'single' | 0 | 1>(false)\nconst focused = ref(false)\nconst focusedThumb = ref<0 | 1 | null>(null)\n// Range: a press focuses the thumb it moves (so the arrows move that one next), from script, which browsers take as\n// :focus-visible. The ring is ours instead: only for focus from the keyboard, or once the keys are used after a press\nconst keyboardThumb = ref<0 | 1 | null>(null)\nlet focusingFromPointer = false\nfunction focusThumb(idx: 0 | 1) {\n focusingFromPointer = true\n thumbEls.value[idx]?.focus({ preventScroll: true })\n focusingFromPointer = false\n}\nfunction onThumbFocus(idx: 0 | 1) {\n focusedThumb.value = idx\n keyboardThumb.value = focusingFromPointer ? null : idx\n}\nfunction onThumbBlur() {\n focusedThumb.value = null\n keyboardThumb.value = null\n}\nconst isVertical = computed(() => props.orientation === 'vertical')\nconst isRange = computed(() => props.variant === 'range')\nconst isCentered = computed(() => props.variant === 'centered')\n\nconst val = computed(() => {\n if (isRange.value) {\n const v = props.modelValue as [number, number]\n return { lo: Math.min(v[0], v[1]), hi: Math.max(v[0], v[1]) }\n }\n return { lo: props.modelValue as number, hi: props.modelValue as number }\n})\n\nfunction toPct(v: number) {\n const range = props.max - props.min\n return range === 0 ? 0 : ((v - props.min) / range) * 100\n}\n\n// Where the pointer is along the track (0–1) while dragging. Without stops the dragged thumb follows it smoothly\n// instead of jumping from step to step (the value emitted still snaps to `step`) and settles on its step when\n// released; with stops it snaps as it goes, like Compose's discrete slider\nconst pointerRatio = ref<number | null>(null)\nconst freePct = computed(() => (!props.stops && dragging.value !== false && pointerRatio.value !== null ? pointerRatio.value * 100 : null))\nconst pctLo = computed(() => {\n const f = freePct.value\n if (f !== null && (dragging.value === 'single' || dragging.value === 0)) return isRange.value ? Math.min(f, toPct(val.value.hi)) : f\n return toPct(val.value.lo)\n})\nconst pctHi = computed(() => {\n const f = freePct.value\n if (f !== null && dragging.value === 1) return Math.max(f, toPct(val.value.lo))\n return toPct(val.value.hi)\n})\nconst centerPct = computed(() => toPct(0))\n\n// Start/end anchor dots hide once the fill has actually covered their spot —\n// visible while that corner is still \"unreached\" track, hidden once passed.\n// Standard never gets a start indicator at all (matches the official M3\n// slider: only the far/unreached end is ever marked).\nconst startDotHidden = computed(() => {\n if (startLen.value < s.value.dotInset + s.value.dot / 2) return true\n if (props.variant === 'centered') return Math.min(pctLo.value, centerPct.value) <= 0\n if (props.variant === 'range') return pctLo.value <= 0\n return true\n})\nconst endDotHidden = computed(() => {\n if (endLen.value < s.value.dotInset + s.value.dot / 2) return true\n if (props.variant === 'centered') return Math.max(pctLo.value, centerPct.value) >= 100\n if (props.variant === 'range') return pctHi.value >= 100\n return pctLo.value >= 100\n})\n\n// Near the ends, the inactive piece between a thumb and the track's end gets shorter than its own corner: like\n// Compose's Slider (drawTrack only draws an inactive piece longer than its corner radius, with its stop indicator),\n// it goes, and the dot goes as soon as it no longer fits inside it (it was left floating in the thumb's gap).\n// Needs the track's length in px, measured; before that (server render) both behave as before.\nconst trackLen = ref(0)\nlet resizeObserver: ResizeObserver | undefined\nconst measureTrack = () => {\n const el = trackEl.value\n if (el) trackLen.value = isVertical.value ? el.offsetHeight : el.offsetWidth\n}\nonMounted(() => {\n measureTrack()\n if (typeof ResizeObserver === 'undefined' || !trackEl.value) return\n resizeObserver = new ResizeObserver(measureTrack)\n resizeObserver.observe(trackEl.value)\n})\nonBeforeUnmount(() => resizeObserver?.disconnect())\n/** A thumb's clamped position (clampedPos) in px from the start */\nconst posPx = (pct: number) => {\n const inset = s.value.thumbInset\n return Math.min(Math.max((pct / 100) * trackLen.value, inset), trackLen.value - inset)\n}\n// Length of the inactive piece at each end that a thumb bounds (Infinity where no thumb does, or before measuring)\nconst startLen = computed(() => {\n if (!trackLen.value) return Infinity\n if (props.variant === 'range') return posPx(pctLo.value) - gap.value\n if (props.variant === 'centered' && pctLo.value <= centerPct.value) return posPx(pctLo.value) - gap.value\n return Infinity\n})\nconst endLen = computed(() => {\n if (!trackLen.value) return Infinity\n if (props.variant === 'range') return trackLen.value - posPx(pctHi.value) - gap.value\n if (props.variant === 'centered' && pctLo.value < centerPct.value) return Infinity\n return trackLen.value - posPx(pctLo.value) - gap.value\n})\nconst startPieceHidden = computed(() => startLen.value <= fullR.value)\nconst endPieceHidden = computed(() => endLen.value <= fullR.value)\n\nconst sizeMap = {\n // thumbH 44 matches SliderTokens.HandleHeight exactly — hitArea bumped from\n // 38 to 46 to keep containing it (was sized for the old 32px handle).\n xs: { track: 16, thumbW: 4, thumbH: 44, dot: 4, gap: 6, hitArea: 46, radius: 6, dotInset: 12, thumbInset: 5, iconSize: 14, thumbIconSize: 22 },\n sm: { track: 28, thumbW: 4, thumbH: 40, dot: 5, gap: 7, hitArea: 46, radius: 8, dotInset: 13, thumbInset: 6, iconSize: 16, thumbIconSize: 28 },\n md: { track: 54, thumbW: 5, thumbH: 62, dot: 5, gap: 8, hitArea: 66, radius: 12, dotInset: 15, thumbInset: 7, iconSize: 20, thumbIconSize: 42 },\n lg: { track: 72, thumbW: 5, thumbH: 78, dot: 6, gap: 10, hitArea: 82, radius: 14, dotInset: 17, thumbInset: 8, iconSize: 24, thumbIconSize: 52 },\n xl: { track: 96, thumbW: 6, thumbH: 98, dot: 7, gap: 10, hitArea: 100, radius: 18, dotInset: 19, thumbInset: 9, iconSize: 28, thumbIconSize: 66 },\n}\n\nconst s = computed(() => sizeMap[props.size] ?? sizeMap.xs)\n\n// The corner `icon` is much bigger than the plain dot, so dotInset alone\n// isn't enough clearance from the thumb's resting spot — it reads as jammed\n// into the corner right at 0%/100%. Give it its own, thumb-aware inset. This\n// only meaningfully changes the \"not yet reached\" look; once the thumb has\n// moved past, it's already far away regardless of the exact inset.\nconst iconInset = computed(() => s.value.thumbInset + s.value.thumbW / 2 + s.value.iconSize / 2 + 3)\n\n// A thumbIcon is much wider along the travel axis than the plain bar, so the\n// fixed track gap isn't enough to clear it — it'd visually touch the fill on\n// both sides. Widen the gap to the icon's own half-width when thumbIcon is set.\nconst gap = computed(() => {\n if (!props.thumbIcon) return s.value.gap\n return Math.max(s.value.gap, s.value.thumbIconSize / 2 + 4)\n})\n\nconst activeColorMap: Record<string, string> = {\n primary: 'var(--color-primary)',\n secondary: 'var(--color-secondary)',\n tertiary: 'var(--color-tertiary)',\n error: 'var(--color-error)',\n}\n// `fillColor`/`thumbColor` accept a custom CSS color (hex, rgb(), a var, …) —\n// not just an M3 role — that's the point of a \"custom color\" prop, otherwise\n// it'd just duplicate `color`. A known role name still works as a shortcut.\nfunction resolveActive(custom: string | undefined, base: 'primary' | 'secondary' | 'tertiary' | 'error') {\n const value = custom ?? base\n return activeColorMap[value] ?? value\n}\n\n// M3's SliderTokens fix the inactive track/stop-indicator color to\n// secondary-container regardless of the active track's color (Inactive/Focus/\n// Pressed TrackColor are all SecondaryContainer) — never derived from the\n// active hue the way MCheckbox/MChip's containers are. Disabled state also\n// isn't a single blanket opacity: DisabledActiveTrackOpacity/DisabledHandleOpacity\n// = 38% on-surface, DisabledInactiveTrackOpacity = 12% on-surface.\nconst DISABLED_ACTIVE = 'color-mix(in srgb, var(--color-on-surface) 38%, transparent)'\nconst DISABLED_INACTIVE = 'color-mix(in srgb, var(--color-on-surface) 12%, transparent)'\n\n// `ct` (fill + corner dot) and `thumbCt` (thumb bar/icon) each fall back to the\n// base `color` prop, but can be overridden independently via `fillColor`/`thumbColor`.\nconst ct = computed(() => props.disabled\n ? { active: DISABLED_ACTIVE, inactive: DISABLED_INACTIVE }\n : { active: resolveActive(props.fillColor, props.color), inactive: 'var(--color-secondary-container)' })\nconst thumbCt = computed(() => props.disabled\n ? { active: DISABLED_ACTIVE, inactive: DISABLED_INACTIVE }\n : { active: resolveActive(props.thumbColor, props.color), inactive: 'var(--color-secondary-container)' })\n\nfunction clamp(v: number) {\n const stepped = Math.round((v - props.min) / props.step) * props.step + props.min\n return Math.max(props.min, Math.min(props.max, +stepped.toFixed(10)))\n}\n\nfunction ratioFromEvent(e: PointerEvent) {\n if (!trackEl.value) return 0\n const rect = trackEl.value.getBoundingClientRect()\n if (isVertical.value) return 1 - Math.max(0, Math.min(1, (e.clientY - rect.top) / rect.height))\n return Math.max(0, Math.min(1, (e.clientX - rect.left) / rect.width))\n}\n\nfunction valueFromEvent(e: PointerEvent) {\n return clamp(props.min + ratioFromEvent(e) * (props.max - props.min))\n}\n\n// Range: like Compose's RangeSlider, a thumb never passes the other (start ∈ [min, end], end ∈ [start, max]), so\n// the emitted pair is always [low, high]. A press takes the thumb on its side; on two overlapping thumbs, the\n// first move's direction picks one (Compose's fix for taps and drags when thumbs overlap).\nlet overlapPress = false\nfunction rangeValue(idx: 0 | 1, v: number): [number, number] {\n const { lo, hi } = val.value\n return idx === 0 ? [Math.min(v, hi), hi] : [lo, Math.max(v, lo)]\n}\n\nfunction onPointerDown(e: PointerEvent) {\n if (props.disabled) return\n e.preventDefault()\n const v = valueFromEvent(e)\n if (isRange.value) {\n const { lo, hi } = val.value\n overlapPress = false\n let idx: 0 | 1\n if (v <= lo && v < hi) idx = 0\n else if (v >= hi && v > lo) idx = 1\n else if (lo === hi) {\n // Right on two overlapping thumbs: wait for the drag's direction\n idx = 0\n overlapPress = true\n } else idx = Math.abs(v - lo) <= Math.abs(v - hi) ? 0 : 1\n dragging.value = idx\n focusThumb(idx)\n if (!overlapPress) emit('update:modelValue', rangeValue(idx, v))\n } else {\n dragging.value = 'single'\n emit('update:modelValue', v)\n }\n // Two overlapping thumbs follow the pointer only once its direction has picked one\n pointerRatio.value = overlapPress ? null : ratioFromEvent(e)\n window.addEventListener('pointermove', onPointerMove)\n window.addEventListener('pointerup', onPointerUp)\n window.addEventListener('pointercancel', onPointerUp)\n}\n\nfunction onPointerMove(e: PointerEvent) {\n if (dragging.value === false) return\n const v = valueFromEvent(e)\n if (isRange.value) {\n if (overlapPress) {\n if (v === val.value.lo) return\n overlapPress = false\n dragging.value = v > val.value.lo ? 1 : 0\n focusThumb(dragging.value)\n }\n pointerRatio.value = ratioFromEvent(e)\n emit('update:modelValue', rangeValue(dragging.value as 0 | 1, v))\n } else {\n pointerRatio.value = ratioFromEvent(e)\n emit('update:modelValue', v)\n }\n}\n\nfunction onPointerUp() {\n dragging.value = false\n pointerRatio.value = null\n overlapPress = false\n window.removeEventListener('pointermove', onPointerMove)\n window.removeEventListener('pointerup', onPointerUp)\n window.removeEventListener('pointercancel', onPointerUp)\n}\n\nconst KEY_DELTA: Record<string, number> = { ArrowRight: 1, ArrowUp: 1, ArrowLeft: -1, ArrowDown: -1 }\n\nfunction onKeyDown(e: KeyboardEvent) {\n if (props.disabled) return\n const delta = KEY_DELTA[e.key]\n if (delta !== undefined) {\n e.preventDefault()\n emit('update:modelValue', clamp((props.modelValue as number) + delta * props.step))\n }\n if (e.key === 'Home') { e.preventDefault(); emit('update:modelValue', props.min) }\n if (e.key === 'End') { e.preventDefault(); emit('update:modelValue', props.max) }\n}\n\n// Range: each thumb is a slider of its own, moved by its keys within the other thumb\nfunction onThumbKeyDown(idx: 0 | 1, e: KeyboardEvent) {\n if (props.disabled) return\n const { lo, hi } = val.value\n const cur = idx === 0 ? lo : hi\n const delta = KEY_DELTA[e.key]\n let next: number | undefined\n if (delta !== undefined) next = clamp(cur + delta * props.step)\n else if (e.key === 'Home') next = idx === 0 ? props.min : lo\n else if (e.key === 'End') next = idx === 0 ? hi : props.max\n if (next === undefined) return\n e.preventDefault()\n keyboardThumb.value = idx\n emit('update:modelValue', rangeValue(idx, next))\n}\n\nonBeforeUnmount(() => {\n window.removeEventListener('pointermove', onPointerMove)\n window.removeEventListener('pointerup', onPointerUp)\n window.removeEventListener('pointercancel', onPointerUp)\n})\n\nconst stopPositions = computed(() => {\n if (!props.stops) return []\n const positions: number[] = []\n const range = props.max - props.min\n const iconClearPct = props.icon ? (s.value.iconSize + s.value.radius) / 2 : 0\n for (let v = props.min + props.step; v < props.max; v += props.step) {\n const pct = ((v - props.min) / range) * 100\n if (props.icon && pct < iconClearPct) continue\n positions.push(pct)\n }\n return positions.length <= 28 ? positions : []\n})\n\n// Standard variant: the fill pill always keeps a gap on the side facing the\n// thumb, even at 0%/100% — matches the official M3 slider, which never lets\n// the track touch the handle.\n// Standard variant fill edges must track the thumb's *clamped* position, not\n// the raw pct — otherwise, near 0%/100% where the thumb is pinned by\n// thumbInset, the pill (still sized off the raw value) creeps past the pinned\n// thumb and swallows the gap that's supposed to stay visible there.\nfunction fillActiveSize(pct: number) {\n return `calc(${clampedPos(pct)} - ${gap.value}px)`\n}\nfunction fillInactiveSize(pct: number) {\n if (endPieceHidden.value) return '0px'\n return `calc(100% - ${clampedPos(pct)} - ${gap.value}px)`\n}\n\n// Range & centered variants: same fix as above — any fill edge that sits at a\n// real draggable thumb must anchor to its clamped (thumbInset-aware) position,\n// not the raw pct, or the fill creeps past a thumb pinned near 0%/100% and\n// swallows the gap that's supposed to stay visible there.\n\n// Range: both pctLo and pctHi are thumbs.\nfunction rangeInactiveBeforeSize() {\n if (startPieceHidden.value) return '0px'\n return `calc(${clampedPos(pctLo.value)} - ${gap.value}px)`\n}\nfunction rangeActiveStart() {\n return `calc(${clampedPos(pctLo.value)} + ${gap.value}px)`\n}\nfunction rangeActiveSize() {\n return `calc(${clampedPos(pctHi.value)} - ${clampedPos(pctLo.value)} - ${gap.value * 2}px)`\n}\nfunction rangeInactiveAfterSize() {\n if (endPieceHidden.value) return '0px'\n return `calc(100% - ${clampedPos(pctHi.value)} - ${gap.value}px)`\n}\n\n// Centered: only pctLo is a thumb — centerPct is a fixed anchor, never inset.\nfunction centeredActiveStart() {\n return pctLo.value >= centerPct.value\n ? `${centerPct.value}%`\n : `calc(${clampedPos(pctLo.value)} + ${gap.value}px)`\n}\nfunction centeredActiveSize() {\n return pctLo.value >= centerPct.value\n ? `calc(${clampedPos(pctLo.value)} - ${centerPct.value}% - ${gap.value}px)`\n : `calc(${centerPct.value}% - ${clampedPos(pctLo.value)} - ${gap.value}px)`\n}\nfunction centeredFarInactiveSize() {\n if (endPieceHidden.value) return '0px'\n return pctLo.value >= centerPct.value\n ? `calc(100% - ${clampedPos(pctLo.value)} - ${gap.value}px)`\n : `calc(100% - ${centerPct.value}% - ${gap.value}px)`\n}\nfunction centeredNearInactiveSize() {\n if (startPieceHidden.value) return '0px'\n return pctLo.value <= centerPct.value\n ? `calc(${clampedPos(pctLo.value)} - ${gap.value}px)`\n : `calc(${centerPct.value}% - ${gap.value}px)`\n}\n\nconst r = computed(() => s.value.radius)\nconst smallR = computed(() => Math.max(2, r.value / 4))\n// Outer track-end corners: the original `r` shape-scale token, just a touch\n// softer/rounder than the plain token value.\nconst fullR = computed(() => r.value * 1.3)\n\n// A segment bounded by a gap on *both* sides — range's middle (active)\n// segment between the two thumbs, and centered's active segment (its far\n// side sits at the fixed center junction, its near side at the thumb gap;\n// it never touches a real track end since the near/far inactive segments\n// always cover those) — goes square on every corner, never a rounded cap.\nfunction pillRadiusSquareBoth() {\n return `${smallR.value}px`\n}\n\n// The pill's outer end (away from the thumb/gap) stays a full stadium cap;\n// the end facing a thumb-gap goes square, matching the official M3 slider's\n// track segments.\nfunction pillRadiusOuterStart() {\n return isVertical.value\n ? `${smallR.value}px ${smallR.value}px ${fullR.value}px ${fullR.value}px`\n : `${fullR.value}px ${smallR.value}px ${smallR.value}px ${fullR.value}px`\n}\nfunction pillRadiusOuterEnd() {\n return isVertical.value\n ? `${fullR.value}px ${fullR.value}px ${smallR.value}px ${smallR.value}px`\n : `${smallR.value}px ${fullR.value}px ${fullR.value}px ${smallR.value}px`\n}\nconst nd = computed(() => dragging.value === false)\nconst tr = computed(() => nd.value ? '75ms ease' : '0s')\n\n// Keeps the thumb from ever touching the very ends of the track. Sits closer\n// to the edge than the corner dot (dot stays visible further in, toward\n// center) — only bites near 0%/100%; elsewhere it's a no-op (thumb still\n// tracks pct% exactly, staying flush with the fill edge as always).\nfunction clampedPos(pct: number) {\n const inset = s.value.thumbInset\n return `clamp(${inset}px, ${pct}%, calc(100% - ${inset}px))`\n}\n\nfunction thumbPos(pct: number, idx: 0 | 1 = 0) {\n const tw = isVertical.value ? s.value.thumbH : s.value.thumbW\n const th = isVertical.value ? s.value.thumbW : s.value.thumbH\n const br = Math.min(tw, th) / 2\n const isDragging = dragging.value !== false\n const base: Record<string, string> = {\n position: 'absolute',\n width: `${tw}px`,\n height: `${th}px`,\n borderRadius: `${br}px`,\n backgroundColor: thumbCt.value.active,\n // The keyboard focus ring takes the thumb's color (color, thumbColor), not a fixed primary\n '--tw-ring-color': thumbCt.value.active,\n zIndex: '2',\n transition: nd.value ? 'left 75ms ease, bottom 75ms ease, transform 80ms ease' : 'transform 80ms ease',\n }\n // Pressed state pinches the thumb thinner along the travel axis (like the\n // official M3 slider handle) while slightly growing the cross axis. Exact\n // ratio matches SliderTokens.PressedHandleWidth/FocusHandleWidth = 2dp,\n // i.e. half of the base 4dp width — applies on keyboard focus too, not\n // just an active pointer drag (Compose's isFocused covers both).\n const isNarrowed = isRange.value ? dragging.value === idx || focusedThumb.value === idx : isDragging || focused.value\n const grow = (isRange.value ? dragging.value === idx : isDragging) ? 1.08 : 1\n const narrow = isNarrowed ? 0.5 : 1\n if (isVertical.value) {\n base.left = '50%'\n base.bottom = clampedPos(pct)\n base.transform = `translateX(-50%) translateY(50%) scaleX(${grow}) scaleY(${narrow})`\n } else {\n base.left = clampedPos(pct)\n base.top = '50%'\n base.transform = `translateX(-50%) translateY(-50%) scaleY(${grow}) scaleX(${narrow})`\n }\n return base\n}\n\n// Icon-thumb variant: same clamped position, but grows slightly on press\n// instead of pinching thin (an icon can't sensibly narrow).\nfunction thumbIconPos(pct: number) {\n const isDragging = dragging.value !== false\n const scale = isDragging ? 1.15 : 1\n const base: Record<string, string> = {\n position: 'absolute',\n color: thumbCt.value.active,\n '--tw-ring-color': thumbCt.value.active,\n zIndex: '2',\n transition: nd.value ? 'left 75ms ease, bottom 75ms ease, transform 80ms ease' : 'transform 80ms ease',\n }\n if (isVertical.value) {\n base.left = '50%'\n base.bottom = clampedPos(pct)\n base.transform = `translateX(-50%) translateY(50%) scale(${scale})`\n } else {\n base.left = clampedPos(pct)\n base.top = '50%'\n base.transform = `translateX(-50%) translateY(-50%) scale(${scale})`\n }\n return base\n}\n\nfunction tooltipPos(pct: number) {\n const offsetH = s.value.track / 2 + 36\n const offsetV = s.value.track / 2 + 40\n if (isVertical.value) {\n return { left: `calc(50% - ${offsetV}px)`, bottom: clampedPos(pct), transform: 'translateY(50%)', transition: nd.value ? 'bottom ' + tr.value : 'none' }\n }\n return { left: clampedPos(pct), top: `calc(50% - ${offsetH}px)`, transform: 'translateX(-50%)', transition: nd.value ? 'left ' + tr.value : 'none' }\n}\n\nconst displayValue = computed(() => {\n if (isRange.value) return `${val.value.lo} – ${val.value.hi}`\n return String(props.modelValue)\n})\n\nconst tooltipValue = computed(() => {\n if (isRange.value && typeof dragging.value === 'number')\n return dragging.value === 0 ? val.value.lo : val.value.hi\n return props.modelValue\n})\n\nconst tooltipPct = computed(() => {\n if (isRange.value && typeof dragging.value === 'number')\n return dragging.value === 0 ? pctLo.value : pctHi.value\n return pctLo.value\n})\n</script>\n\n<template>\n <div class=\"flex select-none\" :class=\"isVertical ? 'h-full flex-col items-center' : 'flex-col gap-1'\">\n <div v-if=\"label || showValue\" class=\"flex items-center justify-between\">\n <span v-if=\"label\" class=\"text-label-large text-on-surface\">{{ label }}</span>\n <span v-if=\"showValue\" class=\"tabular-nums text-label-large text-on-surface-variant\">{{ displayValue }}</span>\n </div>\n\n <div class=\"flex items-center\" :class=\"isVertical ? 'flex-1 flex-col' : ''\">\n <!-- Track area -->\n <div\n ref=\"trackEl\"\n :role=\"isRange ? 'group' : 'slider'\"\n :tabindex=\"isRange ? undefined : 0\"\n :aria-label=\"isRange ? label : undefined\"\n :aria-valuenow=\"isRange ? undefined : (modelValue as number)\"\n :aria-valuemin=\"isRange ? undefined : min\"\n :aria-valuemax=\"isRange ? undefined : max\"\n :aria-disabled=\"disabled || undefined\"\n :aria-orientation=\"isRange ? undefined : orientation\"\n class=\"group relative touch-none cursor-pointer outline-none\"\n :class=\"disabled && 'cursor-not-allowed'\"\n :style=\"isVertical\n ? { width: `${s.hitArea}px`, minHeight: '160px', height: '100%' }\n : { height: `${s.hitArea}px`, width: '100%' }\n \"\n @pointerdown=\"onPointerDown\"\n @keydown=\"!isRange && onKeyDown($event)\"\n @focus=\"focused = !isRange\"\n @blur=\"focused = false\"\n >\n <!-- Track container -->\n <div\n class=\"absolute\"\n :style=\"isVertical\n ? { left: '50%', top: '0', bottom: '0', width: `${s.track}px`, transform: 'translateX(-50%)', borderRadius: `${fullR}px` }\n : { top: '50%', left: '0', right: '0', height: `${s.track}px`, transform: 'translateY(-50%)', borderRadius: `${fullR}px` }\n \"\n >\n <!-- Standard: active from left/bottom -->\n <template v-if=\"variant === 'standard'\">\n <div class=\"absolute\" :style=\"{\n ...(isVertical\n ? { left: 0, right: 0, bottom: 0, height: fillActiveSize(pctLo) }\n : { top: 0, bottom: 0, left: 0, width: fillActiveSize(pctLo) }\n ),\n borderRadius: pillRadiusOuterStart(), backgroundColor: ct.active, transition: `all ${tr}`,\n }\" />\n <div class=\"absolute\" :style=\"{\n ...(isVertical\n ? { left: 0, right: 0, top: 0, height: fillInactiveSize(pctLo) }\n : { top: 0, bottom: 0, right: 0, width: fillInactiveSize(pctLo) }\n ),\n borderRadius: pillRadiusOuterEnd(), backgroundColor: ct.inactive, transition: `all ${tr}`,\n }\" />\n </template>\n\n <!-- Centered: active from center -->\n <template v-else-if=\"variant === 'centered'\">\n <!-- Active: from center to thumb (thumb edge uses its clamped position) -->\n <div class=\"absolute\" :style=\"{\n ...(isVertical\n ? { left: 0, right: 0, bottom: centeredActiveStart(), height: centeredActiveSize() }\n : { top: 0, bottom: 0, left: centeredActiveStart(), width: centeredActiveSize() }\n ),\n borderRadius: pillRadiusSquareBoth(), backgroundColor: ct.active, transition: `all ${tr}`,\n }\" />\n <!-- Inactive: above/right of thumb -->\n <div class=\"absolute\" :style=\"{\n ...(isVertical\n ? { left: 0, right: 0, top: 0, height: centeredFarInactiveSize() }\n : { top: 0, bottom: 0, right: 0, width: centeredFarInactiveSize() }\n ),\n borderRadius: pillRadiusOuterEnd(), backgroundColor: ct.inactive, transition: `all ${tr}`,\n }\" />\n <!-- Inactive: below/left of thumb -->\n <div class=\"absolute\" :style=\"{\n ...(isVertical\n ? { left: 0, right: 0, bottom: 0, height: centeredNearInactiveSize() }\n : { top: 0, bottom: 0, left: 0, width: centeredNearInactiveSize() }\n ),\n borderRadius: pillRadiusOuterStart(), backgroundColor: ct.inactive, transition: `all ${tr}`,\n }\" />\n </template>\n\n <!-- Range: active between thumbs (both edges use their clamped position) -->\n <template v-else-if=\"variant === 'range'\">\n <div class=\"absolute\" :style=\"{\n ...(isVertical\n ? { left: 0, right: 0, bottom: 0, height: rangeInactiveBeforeSize() }\n : { top: 0, bottom: 0, left: 0, width: rangeInactiveBeforeSize() }\n ),\n borderRadius: pillRadiusOuterStart(), backgroundColor: ct.inactive, transition: `all ${tr}`,\n }\" />\n <div class=\"absolute\" :style=\"{\n ...(isVertical\n ? { left: 0, right: 0, bottom: rangeActiveStart(), height: rangeActiveSize() }\n : { top: 0, bottom: 0, left: rangeActiveStart(), width: rangeActiveSize() }\n ),\n borderRadius: pillRadiusSquareBoth(), backgroundColor: ct.active, transition: `all ${tr}`,\n }\" />\n <div class=\"absolute\" :style=\"{\n ...(isVertical\n ? { left: 0, right: 0, top: 0, height: rangeInactiveAfterSize() }\n : { top: 0, bottom: 0, right: 0, width: rangeInactiveAfterSize() }\n ),\n borderRadius: pillRadiusOuterEnd(), backgroundColor: ct.inactive, transition: `all ${tr}`,\n }\" />\n </template>\n\n <!-- Start dot / icon -->\n <MIcon\n v-if=\"icon\"\n :name=\"icon\"\n :size=\"s.iconSize\"\n class=\"absolute z-[1]\"\n :style=\"{\n color: (variant === 'standard' && pctLo > 0) || (variant === 'range' && pctLo > 0) ? ct.inactive : ct.active,\n ...(isVertical\n ? { left: '50%', bottom: `${iconInset}px`, transform: 'translateX(-50%)' }\n : { top: '50%', left: `${iconInset}px`, transform: 'translateY(-50%)' }\n ),\n transition: 'color 150ms ease',\n }\"\n />\n <div\n v-else-if=\"!stops\"\n class=\"absolute rounded-full\"\n :style=\"{\n width: `${s.dot}px`, height: `${s.dot}px`,\n backgroundColor: ct.active,\n opacity: startDotHidden ? 0 : 1,\n ...(isVertical\n ? { left: '50%', bottom: `${s.dotInset}px`, transform: 'translateX(-50%)' }\n : { top: '50%', left: `${s.dotInset}px`, transform: 'translateY(-50%)' }\n ),\n transition: 'opacity 150ms ease',\n }\"\n />\n <!-- End dot -->\n <div\n v-if=\"!stops\"\n class=\"absolute rounded-full\"\n :style=\"{\n width: `${s.dot}px`, height: `${s.dot}px`,\n backgroundColor: ct.active,\n opacity: endDotHidden ? 0 : 1,\n ...(isVertical\n ? { left: '50%', top: `${s.dotInset}px`, transform: 'translateX(-50%)' }\n : { top: '50%', right: `${s.dotInset}px`, transform: 'translateY(-50%)' }\n ),\n transition: 'opacity 150ms ease',\n }\"\n />\n\n <!-- Stops (skip first and last to avoid duplicating end dots) -->\n <template v-if=\"stops\">\n <div\n v-for=\"(pos, i) in stopPositions\"\n :key=\"i\"\n class=\"absolute rounded-full\"\n :style=\"{\n width: `${s.dot}px`, height: `${s.dot}px`,\n backgroundColor: pos <= pctLo ? ct.inactive : ct.active,\n opacity: Math.abs(pos - pctLo) < 0.01 || (isRange && Math.abs(pos - pctHi) < 0.01) ? 0 : 1,\n ...(isVertical\n ? { left: '50%', bottom: `${pos}%`, transform: 'translateX(-50%) translateY(50%)' }\n : { top: '50%', left: `${pos}%`, transform: 'translateX(-50%) translateY(-50%)' }\n ),\n }\"\n />\n </template>\n </div>\n\n <!-- Thumb(s). Standard/centered: the track is the slider and its focus rings the thumb. Range: each thumb\n is a slider of its own (Compose's two semantics nodes), focusable, with its own keys and ring. -->\n <template v-if=\"!isRange\">\n <MIcon v-if=\"thumbIcon\" :name=\"thumbIcon\" :size=\"s.thumbIconSize\" class=\"pointer-events-none rounded-full group-focus-visible:ring-2 group-focus-visible:ring-offset-2 group-focus-visible:ring-offset-surface\" :style=\"thumbIconPos(pctLo)\" />\n <div v-else class=\"pointer-events-none group-focus-visible:ring-2 group-focus-visible:ring-offset-2 group-focus-visible:ring-offset-surface\" :style=\"thumbPos(pctLo)\" />\n </template>\n <template v-else>\n <div\n v-for=\"idx in ([0, 1] as const)\"\n :key=\"idx\"\n :ref=\"(el) => { if (el) thumbEls[idx] = el as HTMLElement }\"\n role=\"slider\"\n :tabindex=\"disabled ? -1 : 0\"\n :aria-label=\"idx === 0 ? t.sliderRangeStart : t.sliderRangeEnd\"\n :aria-valuenow=\"idx === 0 ? val.lo : val.hi\"\n :aria-valuemin=\"idx === 0 ? min : val.lo\"\n :aria-valuemax=\"idx === 0 ? val.hi : max\"\n :aria-disabled=\"disabled || undefined\"\n :aria-orientation=\"orientation\"\n class=\"pointer-events-none flex items-center justify-center rounded-full outline-none\"\n :class=\"keyboardThumb === idx && 'ring-2 ring-offset-2 ring-offset-surface'\"\n :style=\"thumbIcon ? thumbIconPos(idx === 0 ? pctLo : pctHi) : thumbPos(idx === 0 ? pctLo : pctHi, idx)\"\n @keydown=\"onThumbKeyDown(idx, $event)\"\n @focus=\"onThumbFocus(idx)\"\n @blur=\"onThumbBlur\"\n >\n <MIcon v-if=\"thumbIcon\" :name=\"thumbIcon\" :size=\"s.thumbIconSize\" />\n </div>\n </template>\n\n <!-- Tooltip -->\n <Transition\n enter-active-class=\"transition-opacity duration-100\"\n enter-from-class=\"opacity-0\"\n leave-active-class=\"transition-opacity duration-75\"\n leave-to-class=\"opacity-0\"\n >\n <div\n v-if=\"showTooltip && dragging !== false\"\n 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\"\n :style=\"tooltipPos(tooltipPct)\"\n >\n {{ tooltipValue }}\n </div>\n </Transition>\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/**\n * The M3 slider — vertical bar thumb, rounded track with gap, standard/centered/range variants, horizontal or\n * vertical.\n *\n * @event update:modelValue Emitted while dragging and on key presses, with the new value (a `[low, high]` pair\n * for the range variant).\n */\nimport { computed, onBeforeUnmount, onMounted, ref } from 'vue'\nimport MIcon from './MIcon.vue'\nimport { useLocale } from '../composables/useLocale'\n\nconst props = withDefaults(\n defineProps<{\n /** Current value — a tuple when variant is range */\n modelValue: number | [number, number]\n /** Minimum value */\n min?: number\n /** Maximum value */\n max?: number\n /** Step increment: the values emitted snap to it; while dragging (without stops) the thumb still follows the pointer smoothly and settles on its step when released */\n step?: number\n /** Disables the slider */\n disabled?: boolean\n /** Label text */\n label?: string\n /** Show current value beside label */\n showValue?: boolean\n /** Show value tooltip while dragging */\n showTooltip?: boolean\n /** Slider orientation */\n orientation?: 'horizontal' | 'vertical'\n /** Track and thumb size */\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n /** Standard, centered (from middle), or range (two thumbs) */\n variant?: 'standard' | 'centered' | 'range'\n /** Show stop dots at each step (max 30 visible), and make a dragged thumb snap from step to step instead of following the pointer smoothly (a discrete slider) */\n stops?: boolean\n /** Material Symbol icon shown before the slider — hides once the fill reaches it */\n icon?: string\n /** Base color — used for the fill and thumb unless overridden by fillColor/thumbColor */\n color?: 'primary' | 'secondary' | 'tertiary' | 'error'\n /** Custom color (hex, rgb(), a CSS var, etc.) for the filled/active portion of the track and the corner dot. Defaults to `color`'s M3 token. */\n fillColor?: string\n /** Replaces the draggable bar thumb with an icon. */\n thumbIcon?: string\n /** Custom color (hex, rgb(), a CSS var, etc.) for the thumb (bar or icon). Defaults to `color`'s M3 token. */\n thumbColor?: string\n }>(),\n {\n min: 0,\n max: 100,\n step: 1,\n disabled: false,\n showValue: false,\n showTooltip: false,\n orientation: 'horizontal',\n size: 'xs',\n variant: 'standard',\n stops: false,\n color: 'primary',\n },\n)\n\nconst emit = defineEmits<{ 'update:modelValue': [number | [number, number]] }>()\n\nconst t = useLocale()\nconst trackEl = ref<HTMLElement>()\nconst thumbEls = ref<HTMLElement[]>([])\n// Range: 0 = the start (low) thumb, 1 = the end (high) one\nconst dragging = ref<false | 'single' | 0 | 1>(false)\nconst focused = ref(false)\nconst focusedThumb = ref<0 | 1 | null>(null)\n// Range: a press focuses the thumb it moves (so the arrows move that one next), from script, which browsers take as\n// :focus-visible. The ring is ours instead: only for focus from the keyboard, or once the keys are used after a press\nconst keyboardThumb = ref<0 | 1 | null>(null)\nlet focusingFromPointer = false\nfunction focusThumb(idx: 0 | 1) {\n focusingFromPointer = true\n thumbEls.value[idx]?.focus({ preventScroll: true })\n focusingFromPointer = false\n}\nfunction onThumbFocus(idx: 0 | 1) {\n focusedThumb.value = idx\n keyboardThumb.value = focusingFromPointer ? null : idx\n}\nfunction onThumbBlur() {\n focusedThumb.value = null\n keyboardThumb.value = null\n}\nconst isVertical = computed(() => props.orientation === 'vertical')\nconst isRange = computed(() => props.variant === 'range')\nconst isCentered = computed(() => props.variant === 'centered')\n\nconst val = computed(() => {\n if (isRange.value) {\n const v = props.modelValue as [number, number]\n return { lo: Math.min(v[0], v[1]), hi: Math.max(v[0], v[1]) }\n }\n return { lo: props.modelValue as number, hi: props.modelValue as number }\n})\n\nfunction toPct(v: number) {\n const range = props.max - props.min\n return range === 0 ? 0 : ((v - props.min) / range) * 100\n}\n\n// Where the pointer is along the track (0–1) while dragging. Without stops the dragged thumb follows it smoothly\n// instead of jumping from step to step (the value emitted still snaps to `step`) and settles on its step when\n// released; with stops it snaps as it goes, like Compose's discrete slider\nconst pointerRatio = ref<number | null>(null)\nconst freePct = computed(() => (!props.stops && dragging.value !== false && pointerRatio.value !== null ? pointerRatio.value * 100 : null))\nconst pctLo = computed(() => {\n const f = freePct.value\n if (f !== null && (dragging.value === 'single' || dragging.value === 0)) return isRange.value ? Math.min(f, toPct(val.value.hi)) : f\n return toPct(val.value.lo)\n})\nconst pctHi = computed(() => {\n const f = freePct.value\n if (f !== null && dragging.value === 1) return Math.max(f, toPct(val.value.lo))\n return toPct(val.value.hi)\n})\nconst centerPct = computed(() => toPct(0))\n\n// Start/end anchor dots hide once the fill has actually covered their spot —\n// visible while that corner is still \"unreached\" track, hidden once passed.\n// Standard never gets a start indicator at all (matches the official M3\n// slider: only the far/unreached end is ever marked).\nconst startDotHidden = computed(() => {\n if (startLen.value < s.value.dotInset + s.value.dot / 2) return true\n if (props.variant === 'centered') return Math.min(pctLo.value, centerPct.value) <= 0\n if (props.variant === 'range') return pctLo.value <= 0\n return true\n})\nconst endDotHidden = computed(() => {\n if (endLen.value < s.value.dotInset + s.value.dot / 2) return true\n if (props.variant === 'centered') return Math.max(pctLo.value, centerPct.value) >= 100\n if (props.variant === 'range') return pctHi.value >= 100\n return pctLo.value >= 100\n})\n\n// Near the ends, the inactive piece between a thumb and the track's end gets shorter than its own corner: like\n// Compose's Slider (drawTrack only draws an inactive piece longer than its corner radius, with its stop indicator),\n// it goes, and the dot goes as soon as it no longer fits inside it (it was left floating in the thumb's gap).\n// Needs the track's length in px, measured; before that (server render) both behave as before.\nconst trackLen = ref(0)\nlet resizeObserver: ResizeObserver | undefined\nconst measureTrack = () => {\n const el = trackEl.value\n if (el) trackLen.value = isVertical.value ? el.offsetHeight : el.offsetWidth\n}\nonMounted(() => {\n measureTrack()\n if (typeof ResizeObserver === 'undefined' || !trackEl.value) return\n resizeObserver = new ResizeObserver(measureTrack)\n resizeObserver.observe(trackEl.value)\n})\nonBeforeUnmount(() => resizeObserver?.disconnect())\n/** A thumb's clamped position (clampedPos) in px from the start */\nconst posPx = (pct: number) => {\n const inset = s.value.thumbInset\n return Math.min(Math.max((pct / 100) * trackLen.value, inset), trackLen.value - inset)\n}\n// Length of the inactive piece at each end that a thumb bounds (Infinity where no thumb does, or before measuring)\nconst startLen = computed(() => {\n if (!trackLen.value) return Infinity\n if (props.variant === 'range') return posPx(pctLo.value) - gap.value\n if (props.variant === 'centered' && pctLo.value <= centerPct.value) return posPx(pctLo.value) - gap.value\n return Infinity\n})\nconst endLen = computed(() => {\n if (!trackLen.value) return Infinity\n if (props.variant === 'range') return trackLen.value - posPx(pctHi.value) - gap.value\n if (props.variant === 'centered' && pctLo.value < centerPct.value) return Infinity\n return trackLen.value - posPx(pctLo.value) - gap.value\n})\nconst startPieceHidden = computed(() => startLen.value <= fullR.value)\nconst endPieceHidden = computed(() => endLen.value <= fullR.value)\n\nconst sizeMap = {\n // thumbH 44 matches SliderTokens.HandleHeight exactly — hitArea bumped from\n // 38 to 46 to keep containing it (was sized for the old 32px handle).\n xs: { track: 16, thumbW: 4, thumbH: 44, dot: 4, gap: 6, hitArea: 46, radius: 6, dotInset: 12, thumbInset: 5, iconSize: 14, thumbIconSize: 22 },\n sm: { track: 28, thumbW: 4, thumbH: 40, dot: 5, gap: 7, hitArea: 46, radius: 8, dotInset: 13, thumbInset: 6, iconSize: 16, thumbIconSize: 28 },\n md: { track: 54, thumbW: 5, thumbH: 62, dot: 5, gap: 8, hitArea: 66, radius: 12, dotInset: 15, thumbInset: 7, iconSize: 20, thumbIconSize: 42 },\n lg: { track: 72, thumbW: 5, thumbH: 78, dot: 6, gap: 10, hitArea: 82, radius: 14, dotInset: 17, thumbInset: 8, iconSize: 24, thumbIconSize: 52 },\n xl: { track: 96, thumbW: 6, thumbH: 98, dot: 7, gap: 10, hitArea: 100, radius: 18, dotInset: 19, thumbInset: 9, iconSize: 28, thumbIconSize: 66 },\n}\n\nconst s = computed(() => sizeMap[props.size] ?? sizeMap.xs)\n\n// The corner `icon` is much bigger than the plain dot, so dotInset alone\n// isn't enough clearance from the thumb's resting spot — it reads as jammed\n// into the corner right at 0%/100%. Give it its own, thumb-aware inset. This\n// only meaningfully changes the \"not yet reached\" look; once the thumb has\n// moved past, it's already far away regardless of the exact inset.\nconst iconInset = computed(() => s.value.thumbInset + s.value.thumbW / 2 + s.value.iconSize / 2 + 3)\n\n// A thumbIcon is much wider along the travel axis than the plain bar, so the\n// fixed track gap isn't enough to clear it — it'd visually touch the fill on\n// both sides. Widen the gap to the icon's own half-width when thumbIcon is set.\nconst gap = computed(() => {\n if (!props.thumbIcon) return s.value.gap\n return Math.max(s.value.gap, s.value.thumbIconSize / 2 + 4)\n})\n\nconst activeColorMap: Record<string, string> = {\n primary: 'var(--color-primary)',\n secondary: 'var(--color-secondary)',\n tertiary: 'var(--color-tertiary)',\n error: 'var(--color-error)',\n}\n// `fillColor`/`thumbColor` accept a custom CSS color (hex, rgb(), a var, …) —\n// not just an M3 role — that's the point of a \"custom color\" prop, otherwise\n// it'd just duplicate `color`. A known role name still works as a shortcut.\nfunction resolveActive(custom: string | undefined, base: 'primary' | 'secondary' | 'tertiary' | 'error') {\n const value = custom ?? base\n return activeColorMap[value] ?? value\n}\n\n// M3's SliderTokens fix the inactive track/stop-indicator color to\n// secondary-container regardless of the active track's color (Inactive/Focus/\n// Pressed TrackColor are all SecondaryContainer) — never derived from the\n// active hue the way MCheckbox/MChip's containers are. Disabled state also\n// isn't a single blanket opacity: DisabledActiveTrackOpacity/DisabledHandleOpacity\n// = 38% on-surface, DisabledInactiveTrackOpacity = 12% on-surface.\nconst DISABLED_ACTIVE = 'color-mix(in srgb, var(--color-on-surface) 38%, transparent)'\nconst DISABLED_INACTIVE = 'color-mix(in srgb, var(--color-on-surface) 12%, transparent)'\n\n// `ct` (fill + corner dot) and `thumbCt` (thumb bar/icon) each fall back to the\n// base `color` prop, but can be overridden independently via `fillColor`/`thumbColor`.\nconst ct = computed(() => props.disabled\n ? { active: DISABLED_ACTIVE, inactive: DISABLED_INACTIVE }\n : { active: resolveActive(props.fillColor, props.color), inactive: 'var(--color-secondary-container)' })\nconst thumbCt = computed(() => props.disabled\n ? { active: DISABLED_ACTIVE, inactive: DISABLED_INACTIVE }\n : { active: resolveActive(props.thumbColor, props.color), inactive: 'var(--color-secondary-container)' })\n\nfunction clamp(v: number) {\n const stepped = Math.round((v - props.min) / props.step) * props.step + props.min\n return Math.max(props.min, Math.min(props.max, +stepped.toFixed(10)))\n}\n\nfunction ratioFromEvent(e: PointerEvent) {\n if (!trackEl.value) return 0\n const rect = trackEl.value.getBoundingClientRect()\n if (isVertical.value) return 1 - Math.max(0, Math.min(1, (e.clientY - rect.top) / rect.height))\n return Math.max(0, Math.min(1, (e.clientX - rect.left) / rect.width))\n}\n\nfunction valueFromEvent(e: PointerEvent) {\n return clamp(props.min + ratioFromEvent(e) * (props.max - props.min))\n}\n\n// Range: like Compose's RangeSlider, a thumb never passes the other (start ∈ [min, end], end ∈ [start, max]), so\n// the emitted pair is always [low, high]. A press takes the thumb on its side; on two overlapping thumbs, the\n// first move's direction picks one (Compose's fix for taps and drags when thumbs overlap).\nlet overlapPress = false\nfunction rangeValue(idx: 0 | 1, v: number): [number, number] {\n const { lo, hi } = val.value\n return idx === 0 ? [Math.min(v, hi), hi] : [lo, Math.max(v, lo)]\n}\n\nfunction onPointerDown(e: PointerEvent) {\n if (props.disabled) return\n e.preventDefault()\n const v = valueFromEvent(e)\n if (isRange.value) {\n const { lo, hi } = val.value\n overlapPress = false\n let idx: 0 | 1\n if (v <= lo && v < hi) idx = 0\n else if (v >= hi && v > lo) idx = 1\n else if (lo === hi) {\n // Right on two overlapping thumbs: wait for the drag's direction\n idx = 0\n overlapPress = true\n } else idx = Math.abs(v - lo) <= Math.abs(v - hi) ? 0 : 1\n dragging.value = idx\n focusThumb(idx)\n if (!overlapPress) emit('update:modelValue', rangeValue(idx, v))\n } else {\n dragging.value = 'single'\n emit('update:modelValue', v)\n }\n // Two overlapping thumbs follow the pointer only once its direction has picked one\n pointerRatio.value = overlapPress ? null : ratioFromEvent(e)\n window.addEventListener('pointermove', onPointerMove)\n window.addEventListener('pointerup', onPointerUp)\n window.addEventListener('pointercancel', onPointerUp)\n}\n\nfunction onPointerMove(e: PointerEvent) {\n if (dragging.value === false) return\n const v = valueFromEvent(e)\n if (isRange.value) {\n if (overlapPress) {\n if (v === val.value.lo) return\n overlapPress = false\n dragging.value = v > val.value.lo ? 1 : 0\n focusThumb(dragging.value)\n }\n pointerRatio.value = ratioFromEvent(e)\n emit('update:modelValue', rangeValue(dragging.value as 0 | 1, v))\n } else {\n pointerRatio.value = ratioFromEvent(e)\n emit('update:modelValue', v)\n }\n}\n\nfunction onPointerUp() {\n dragging.value = false\n pointerRatio.value = null\n overlapPress = false\n window.removeEventListener('pointermove', onPointerMove)\n window.removeEventListener('pointerup', onPointerUp)\n window.removeEventListener('pointercancel', onPointerUp)\n}\n\nconst KEY_DELTA: Record<string, number> = { ArrowRight: 1, ArrowUp: 1, ArrowLeft: -1, ArrowDown: -1 }\n\nfunction onKeyDown(e: KeyboardEvent) {\n if (props.disabled) return\n const delta = KEY_DELTA[e.key]\n if (delta !== undefined) {\n e.preventDefault()\n emit('update:modelValue', clamp((props.modelValue as number) + delta * props.step))\n }\n if (e.key === 'Home') { e.preventDefault(); emit('update:modelValue', props.min) }\n if (e.key === 'End') { e.preventDefault(); emit('update:modelValue', props.max) }\n}\n\n// Range: each thumb is a slider of its own, moved by its keys within the other thumb\nfunction onThumbKeyDown(idx: 0 | 1, e: KeyboardEvent) {\n if (props.disabled) return\n const { lo, hi } = val.value\n const cur = idx === 0 ? lo : hi\n const delta = KEY_DELTA[e.key]\n let next: number | undefined\n if (delta !== undefined) next = clamp(cur + delta * props.step)\n else if (e.key === 'Home') next = idx === 0 ? props.min : lo\n else if (e.key === 'End') next = idx === 0 ? hi : props.max\n if (next === undefined) return\n e.preventDefault()\n keyboardThumb.value = idx\n emit('update:modelValue', rangeValue(idx, next))\n}\n\nonBeforeUnmount(() => {\n window.removeEventListener('pointermove', onPointerMove)\n window.removeEventListener('pointerup', onPointerUp)\n window.removeEventListener('pointercancel', onPointerUp)\n})\n\nconst stopPositions = computed(() => {\n if (!props.stops) return []\n const positions: number[] = []\n const range = props.max - props.min\n const iconClearPct = props.icon ? (s.value.iconSize + s.value.radius) / 2 : 0\n for (let v = props.min + props.step; v < props.max; v += props.step) {\n const pct = ((v - props.min) / range) * 100\n if (props.icon && pct < iconClearPct) continue\n positions.push(pct)\n }\n return positions.length <= 28 ? positions : []\n})\n\n// Standard variant: the fill pill always keeps a gap on the side facing the\n// thumb, even at 0%/100% — matches the official M3 slider, which never lets\n// the track touch the handle.\n// Standard variant fill edges must track the thumb's *clamped* position, not\n// the raw pct — otherwise, near 0%/100% where the thumb is pinned by\n// thumbInset, the pill (still sized off the raw value) creeps past the pinned\n// thumb and swallows the gap that's supposed to stay visible there.\nfunction fillActiveSize(pct: number) {\n return `calc(${clampedPos(pct)} - ${gap.value}px)`\n}\nfunction fillInactiveSize(pct: number) {\n if (endPieceHidden.value) return '0px'\n return `calc(100% - ${clampedPos(pct)} - ${gap.value}px)`\n}\n\n// Range & centered variants: same fix as above — any fill edge that sits at a\n// real draggable thumb must anchor to its clamped (thumbInset-aware) position,\n// not the raw pct, or the fill creeps past a thumb pinned near 0%/100% and\n// swallows the gap that's supposed to stay visible there.\n\n// Range: both pctLo and pctHi are thumbs.\nfunction rangeInactiveBeforeSize() {\n if (startPieceHidden.value) return '0px'\n return `calc(${clampedPos(pctLo.value)} - ${gap.value}px)`\n}\nfunction rangeActiveStart() {\n return `calc(${clampedPos(pctLo.value)} + ${gap.value}px)`\n}\nfunction rangeActiveSize() {\n return `calc(${clampedPos(pctHi.value)} - ${clampedPos(pctLo.value)} - ${gap.value * 2}px)`\n}\nfunction rangeInactiveAfterSize() {\n if (endPieceHidden.value) return '0px'\n return `calc(100% - ${clampedPos(pctHi.value)} - ${gap.value}px)`\n}\n\n// Centered: only pctLo is a thumb — centerPct is a fixed anchor, never inset.\nfunction centeredActiveStart() {\n return pctLo.value >= centerPct.value\n ? `${centerPct.value}%`\n : `calc(${clampedPos(pctLo.value)} + ${gap.value}px)`\n}\nfunction centeredActiveSize() {\n return pctLo.value >= centerPct.value\n ? `calc(${clampedPos(pctLo.value)} - ${centerPct.value}% - ${gap.value}px)`\n : `calc(${centerPct.value}% - ${clampedPos(pctLo.value)} - ${gap.value}px)`\n}\nfunction centeredFarInactiveSize() {\n if (endPieceHidden.value) return '0px'\n return pctLo.value >= centerPct.value\n ? `calc(100% - ${clampedPos(pctLo.value)} - ${gap.value}px)`\n : `calc(100% - ${centerPct.value}% - ${gap.value}px)`\n}\nfunction centeredNearInactiveSize() {\n if (startPieceHidden.value) return '0px'\n return pctLo.value <= centerPct.value\n ? `calc(${clampedPos(pctLo.value)} - ${gap.value}px)`\n : `calc(${centerPct.value}% - ${gap.value}px)`\n}\n\nconst r = computed(() => s.value.radius)\nconst smallR = computed(() => Math.max(2, r.value / 4))\n// Outer track-end corners: the original `r` shape-scale token, just a touch\n// softer/rounder than the plain token value.\nconst fullR = computed(() => r.value * 1.3)\n\n// A segment bounded by a gap on *both* sides — range's middle (active)\n// segment between the two thumbs, and centered's active segment (its far\n// side sits at the fixed center junction, its near side at the thumb gap;\n// it never touches a real track end since the near/far inactive segments\n// always cover those) — goes square on every corner, never a rounded cap.\nfunction pillRadiusSquareBoth() {\n return `${smallR.value}px`\n}\n\n// The pill's outer end (away from the thumb/gap) stays a full stadium cap;\n// the end facing a thumb-gap goes square, matching the official M3 slider's\n// track segments.\nfunction pillRadiusOuterStart() {\n return isVertical.value\n ? `${smallR.value}px ${smallR.value}px ${fullR.value}px ${fullR.value}px`\n : `${fullR.value}px ${smallR.value}px ${smallR.value}px ${fullR.value}px`\n}\nfunction pillRadiusOuterEnd() {\n return isVertical.value\n ? `${fullR.value}px ${fullR.value}px ${smallR.value}px ${smallR.value}px`\n : `${smallR.value}px ${fullR.value}px ${fullR.value}px ${smallR.value}px`\n}\nconst nd = computed(() => dragging.value === false)\nconst tr = computed(() => nd.value ? '75ms ease' : '0s')\n\n// Keeps the thumb from ever touching the very ends of the track. Sits closer\n// to the edge than the corner dot (dot stays visible further in, toward\n// center) — only bites near 0%/100%; elsewhere it's a no-op (thumb still\n// tracks pct% exactly, staying flush with the fill edge as always).\nfunction clampedPos(pct: number) {\n const inset = s.value.thumbInset\n return `clamp(${inset}px, ${pct}%, calc(100% - ${inset}px))`\n}\n\nfunction thumbPos(pct: number, idx: 0 | 1 = 0) {\n const tw = isVertical.value ? s.value.thumbH : s.value.thumbW\n const th = isVertical.value ? s.value.thumbW : s.value.thumbH\n const br = Math.min(tw, th) / 2\n const isDragging = dragging.value !== false\n const base: Record<string, string> = {\n position: 'absolute',\n width: `${tw}px`,\n height: `${th}px`,\n borderRadius: `${br}px`,\n backgroundColor: thumbCt.value.active,\n // The keyboard focus ring takes the thumb's color (color, thumbColor), not a fixed primary\n '--tw-ring-color': thumbCt.value.active,\n zIndex: '2',\n transition: nd.value ? 'left 75ms ease, bottom 75ms ease, transform 80ms ease' : 'transform 80ms ease',\n }\n // Pressed state pinches the thumb thinner along the travel axis (like the\n // official M3 slider handle) while slightly growing the cross axis. Exact\n // ratio matches SliderTokens.PressedHandleWidth/FocusHandleWidth = 2dp,\n // i.e. half of the base 4dp width — applies on keyboard focus too, not\n // just an active pointer drag (Compose's isFocused covers both).\n const isNarrowed = isRange.value ? dragging.value === idx || focusedThumb.value === idx : isDragging || focused.value\n const grow = (isRange.value ? dragging.value === idx : isDragging) ? 1.08 : 1\n const narrow = isNarrowed ? 0.5 : 1\n if (isVertical.value) {\n base.left = '50%'\n base.bottom = clampedPos(pct)\n base.transform = `translateX(-50%) translateY(50%) scaleX(${grow}) scaleY(${narrow})`\n } else {\n base.left = clampedPos(pct)\n base.top = '50%'\n base.transform = `translateX(-50%) translateY(-50%) scaleY(${grow}) scaleX(${narrow})`\n }\n return base\n}\n\n// Icon-thumb variant: same clamped position, but grows slightly on press\n// instead of pinching thin (an icon can't sensibly narrow).\nfunction thumbIconPos(pct: number) {\n const isDragging = dragging.value !== false\n const scale = isDragging ? 1.15 : 1\n const base: Record<string, string> = {\n position: 'absolute',\n color: thumbCt.value.active,\n '--tw-ring-color': thumbCt.value.active,\n zIndex: '2',\n transition: nd.value ? 'left 75ms ease, bottom 75ms ease, transform 80ms ease' : 'transform 80ms ease',\n }\n if (isVertical.value) {\n base.left = '50%'\n base.bottom = clampedPos(pct)\n base.transform = `translateX(-50%) translateY(50%) scale(${scale})`\n } else {\n base.left = clampedPos(pct)\n base.top = '50%'\n base.transform = `translateX(-50%) translateY(-50%) scale(${scale})`\n }\n return base\n}\n\nfunction tooltipPos(pct: number) {\n const offsetH = s.value.track / 2 + 36\n const offsetV = s.value.track / 2 + 40\n if (isVertical.value) {\n return { left: `calc(50% - ${offsetV}px)`, bottom: clampedPos(pct), transform: 'translateY(50%)', transition: nd.value ? 'bottom ' + tr.value : 'none' }\n }\n return { left: clampedPos(pct), top: `calc(50% - ${offsetH}px)`, transform: 'translateX(-50%)', transition: nd.value ? 'left ' + tr.value : 'none' }\n}\n\nconst displayValue = computed(() => {\n if (isRange.value) return `${val.value.lo} – ${val.value.hi}`\n return String(props.modelValue)\n})\n\nconst tooltipValue = computed(() => {\n if (isRange.value && typeof dragging.value === 'number')\n return dragging.value === 0 ? val.value.lo : val.value.hi\n return props.modelValue\n})\n\nconst tooltipPct = computed(() => {\n if (isRange.value && typeof dragging.value === 'number')\n return dragging.value === 0 ? pctLo.value : pctHi.value\n return pctLo.value\n})\n</script>\n\n<template>\n <div class=\"flex select-none\" :class=\"isVertical ? 'h-full flex-col items-center' : 'flex-col gap-1'\">\n <div v-if=\"label || showValue\" class=\"flex items-center justify-between\">\n <span v-if=\"label\" class=\"text-label-large text-on-surface\">{{ label }}</span>\n <span v-if=\"showValue\" class=\"tabular-nums text-label-large text-on-surface-variant\">{{ displayValue }}</span>\n </div>\n\n <div class=\"flex items-center\" :class=\"isVertical ? 'flex-1 flex-col' : ''\">\n <!-- Track area -->\n <div\n ref=\"trackEl\"\n :role=\"isRange ? 'group' : 'slider'\"\n :tabindex=\"isRange ? undefined : 0\"\n :aria-label=\"isRange ? label : undefined\"\n :aria-valuenow=\"isRange ? undefined : (modelValue as number)\"\n :aria-valuemin=\"isRange ? undefined : min\"\n :aria-valuemax=\"isRange ? undefined : max\"\n :aria-disabled=\"disabled || undefined\"\n :aria-orientation=\"isRange ? undefined : orientation\"\n class=\"group relative touch-none cursor-pointer outline-none\"\n :class=\"disabled && 'cursor-not-allowed'\"\n :style=\"isVertical\n ? { width: `${s.hitArea}px`, minHeight: '160px', height: '100%' }\n : { height: `${s.hitArea}px`, width: '100%' }\n \"\n @pointerdown=\"onPointerDown\"\n @keydown=\"!isRange && onKeyDown($event)\"\n @focus=\"focused = !isRange\"\n @blur=\"focused = false\"\n >\n <!-- Track container -->\n <div\n class=\"absolute\"\n :style=\"isVertical\n ? { left: '50%', top: '0', bottom: '0', width: `${s.track}px`, transform: 'translateX(-50%)', borderRadius: `${fullR}px` }\n : { top: '50%', left: '0', right: '0', height: `${s.track}px`, transform: 'translateY(-50%)', borderRadius: `${fullR}px` }\n \"\n >\n <!-- Standard: active from left/bottom -->\n <template v-if=\"variant === 'standard'\">\n <div class=\"absolute\" :style=\"{\n ...(isVertical\n ? { left: 0, right: 0, bottom: 0, height: fillActiveSize(pctLo) }\n : { top: 0, bottom: 0, left: 0, width: fillActiveSize(pctLo) }\n ),\n borderRadius: pillRadiusOuterStart(), backgroundColor: ct.active, transition: `all ${tr}`,\n }\" />\n <div class=\"absolute\" :style=\"{\n ...(isVertical\n ? { left: 0, right: 0, top: 0, height: fillInactiveSize(pctLo) }\n : { top: 0, bottom: 0, right: 0, width: fillInactiveSize(pctLo) }\n ),\n borderRadius: pillRadiusOuterEnd(), backgroundColor: ct.inactive, transition: `all ${tr}`,\n }\" />\n </template>\n\n <!-- Centered: active from center -->\n <template v-else-if=\"variant === 'centered'\">\n <!-- Active: from center to thumb (thumb edge uses its clamped position) -->\n <div class=\"absolute\" :style=\"{\n ...(isVertical\n ? { left: 0, right: 0, bottom: centeredActiveStart(), height: centeredActiveSize() }\n : { top: 0, bottom: 0, left: centeredActiveStart(), width: centeredActiveSize() }\n ),\n borderRadius: pillRadiusSquareBoth(), backgroundColor: ct.active, transition: `all ${tr}`,\n }\" />\n <!-- Inactive: above/right of thumb -->\n <div class=\"absolute\" :style=\"{\n ...(isVertical\n ? { left: 0, right: 0, top: 0, height: centeredFarInactiveSize() }\n : { top: 0, bottom: 0, right: 0, width: centeredFarInactiveSize() }\n ),\n borderRadius: pillRadiusOuterEnd(), backgroundColor: ct.inactive, transition: `all ${tr}`,\n }\" />\n <!-- Inactive: below/left of thumb -->\n <div class=\"absolute\" :style=\"{\n ...(isVertical\n ? { left: 0, right: 0, bottom: 0, height: centeredNearInactiveSize() }\n : { top: 0, bottom: 0, left: 0, width: centeredNearInactiveSize() }\n ),\n borderRadius: pillRadiusOuterStart(), backgroundColor: ct.inactive, transition: `all ${tr}`,\n }\" />\n </template>\n\n <!-- Range: active between thumbs (both edges use their clamped position) -->\n <template v-else-if=\"variant === 'range'\">\n <div class=\"absolute\" :style=\"{\n ...(isVertical\n ? { left: 0, right: 0, bottom: 0, height: rangeInactiveBeforeSize() }\n : { top: 0, bottom: 0, left: 0, width: rangeInactiveBeforeSize() }\n ),\n borderRadius: pillRadiusOuterStart(), backgroundColor: ct.inactive, transition: `all ${tr}`,\n }\" />\n <div class=\"absolute\" :style=\"{\n ...(isVertical\n ? { left: 0, right: 0, bottom: rangeActiveStart(), height: rangeActiveSize() }\n : { top: 0, bottom: 0, left: rangeActiveStart(), width: rangeActiveSize() }\n ),\n borderRadius: pillRadiusSquareBoth(), backgroundColor: ct.active, transition: `all ${tr}`,\n }\" />\n <div class=\"absolute\" :style=\"{\n ...(isVertical\n ? { left: 0, right: 0, top: 0, height: rangeInactiveAfterSize() }\n : { top: 0, bottom: 0, right: 0, width: rangeInactiveAfterSize() }\n ),\n borderRadius: pillRadiusOuterEnd(), backgroundColor: ct.inactive, transition: `all ${tr}`,\n }\" />\n </template>\n\n <!-- Start dot / icon -->\n <MIcon\n v-if=\"icon\"\n :name=\"icon\"\n :size=\"s.iconSize\"\n class=\"absolute z-[1]\"\n :style=\"{\n color: (variant === 'standard' && pctLo > 0) || (variant === 'range' && pctLo > 0) ? ct.inactive : ct.active,\n ...(isVertical\n ? { left: '50%', bottom: `${iconInset}px`, transform: 'translateX(-50%)' }\n : { top: '50%', left: `${iconInset}px`, transform: 'translateY(-50%)' }\n ),\n transition: 'color 150ms ease',\n }\"\n />\n <div\n v-else-if=\"!stops\"\n class=\"absolute rounded-full\"\n :style=\"{\n width: `${s.dot}px`, height: `${s.dot}px`,\n backgroundColor: ct.active,\n opacity: startDotHidden ? 0 : 1,\n ...(isVertical\n ? { left: '50%', bottom: `${s.dotInset}px`, transform: 'translateX(-50%)' }\n : { top: '50%', left: `${s.dotInset}px`, transform: 'translateY(-50%)' }\n ),\n transition: 'opacity 150ms ease',\n }\"\n />\n <!-- End dot -->\n <div\n v-if=\"!stops\"\n class=\"absolute rounded-full\"\n :style=\"{\n width: `${s.dot}px`, height: `${s.dot}px`,\n backgroundColor: ct.active,\n opacity: endDotHidden ? 0 : 1,\n ...(isVertical\n ? { left: '50%', top: `${s.dotInset}px`, transform: 'translateX(-50%)' }\n : { top: '50%', right: `${s.dotInset}px`, transform: 'translateY(-50%)' }\n ),\n transition: 'opacity 150ms ease',\n }\"\n />\n\n <!-- Stops (skip first and last to avoid duplicating end dots) -->\n <template v-if=\"stops\">\n <div\n v-for=\"(pos, i) in stopPositions\"\n :key=\"i\"\n class=\"absolute rounded-full\"\n :style=\"{\n width: `${s.dot}px`, height: `${s.dot}px`,\n backgroundColor: pos <= pctLo ? ct.inactive : ct.active,\n opacity: Math.abs(pos - pctLo) < 0.01 || (isRange && Math.abs(pos - pctHi) < 0.01) ? 0 : 1,\n ...(isVertical\n ? { left: '50%', bottom: `${pos}%`, transform: 'translateX(-50%) translateY(50%)' }\n : { top: '50%', left: `${pos}%`, transform: 'translateX(-50%) translateY(-50%)' }\n ),\n }\"\n />\n </template>\n </div>\n\n <!-- Thumb(s). Standard/centered: the track is the slider and its focus rings the thumb. Range: each thumb\n is a slider of its own (Compose's two semantics nodes), focusable, with its own keys and ring. -->\n <template v-if=\"!isRange\">\n <MIcon v-if=\"thumbIcon\" :name=\"thumbIcon\" :size=\"s.thumbIconSize\" class=\"pointer-events-none rounded-full group-focus-visible:ring-2 group-focus-visible:ring-offset-2 group-focus-visible:ring-offset-surface\" :style=\"thumbIconPos(pctLo)\" />\n <div v-else class=\"pointer-events-none group-focus-visible:ring-2 group-focus-visible:ring-offset-2 group-focus-visible:ring-offset-surface\" :style=\"thumbPos(pctLo)\" />\n </template>\n <template v-else>\n <div\n v-for=\"idx in ([0, 1] as const)\"\n :key=\"idx\"\n :ref=\"(el) => { if (el) thumbEls[idx] = el as HTMLElement }\"\n role=\"slider\"\n :tabindex=\"disabled ? -1 : 0\"\n :aria-label=\"idx === 0 ? t.sliderRangeStart : t.sliderRangeEnd\"\n :aria-valuenow=\"idx === 0 ? val.lo : val.hi\"\n :aria-valuemin=\"idx === 0 ? min : val.lo\"\n :aria-valuemax=\"idx === 0 ? val.hi : max\"\n :aria-disabled=\"disabled || undefined\"\n :aria-orientation=\"orientation\"\n class=\"pointer-events-none flex items-center justify-center rounded-full outline-none\"\n :class=\"keyboardThumb === idx && 'ring-2 ring-offset-2 ring-offset-surface'\"\n :style=\"thumbIcon ? thumbIconPos(idx === 0 ? pctLo : pctHi) : thumbPos(idx === 0 ? pctLo : pctHi, idx)\"\n @keydown=\"onThumbKeyDown(idx, $event)\"\n @focus=\"onThumbFocus(idx)\"\n @blur=\"onThumbBlur\"\n >\n <MIcon v-if=\"thumbIcon\" :name=\"thumbIcon\" :size=\"s.thumbIconSize\" />\n </div>\n </template>\n\n <!-- Tooltip -->\n <Transition\n enter-active-class=\"transition-opacity duration-100\"\n enter-from-class=\"opacity-0\"\n leave-active-class=\"transition-opacity duration-75\"\n leave-to-class=\"opacity-0\"\n >\n <div\n v-if=\"showTooltip && dragging !== false\"\n 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\"\n :style=\"tooltipPos(tooltipPct)\"\n >\n {{ tooltipValue }}\n </div>\n </Transition>\n </div>\n </div>\n </div>\n</template>\n"],"mapp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EAAA,YAAY,GAAa,MAAG,IAAS,EAAA,QAAQ,EAAA,KAAK,IAAI,GAAS,MAAG,IAAS,EAAA,QAAQ,EAAA,OAAO,CAAG,CAAA;IACpG,YAAO,MAAE,GAAe,GAAK,CAAM;IACnC,UAAK,MAAE,GAAa,CAAG;IACvB,QAAM;GAEM,GAAA,CAAA,EAAA,aAAb,EAAA,GAAA,EAAoE,GAAA;;IAA3C,MAAM,EAAA;IAAY,MAAM,EAAA,MAAE;kEAxBvD,EAAA,GAAA,EAGW,GAAA,EAAA,KAAA,EAAA,GAAA,CAFI,EAAA,aAAb,EAAA,GAAA,EAA+O,GAAA;;IAAtN,MAAM,EAAA;IAAY,MAAM,EAAA,MAAE;IAAe,OAAM;IAAyI,OAAK,EAAE,GAAa,EAAA,KAAK,CAAA;;;;;GAC1O,CAAA,MAAA,EAAA,GAAA,EAAwK,OAAA;;IAA5J,OAAM;IAA4H,OAAK,EAAE,GAAS,EAAA,KAAK,CAAA;GAGnK,GAAA,MAAA,CAAA,EAAA,GAAA,EAAA;GAwBF,EAaa,GAAA;IAZX,sBAAmB;IACnB,oBAAiB;IACjB,sBAAmB;IACnB,kBAAe;;IAEf,SAAA,SAMM,CALE,EAAA,eAAe,EAAA,UAAQ,MAD/B,EAAA,GAAA,EAMM,OAAA;;KAJJ,OAAM;KACL,OAAK,EAAE,GAAW,GAAA,KAAU,CAAA;IAE1B,GAAA,EAAA,GAAA,KAAY,GAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { i as e } from "./useLocale-BpGxplLV.js";
|
|
2
|
+
import { computed as t, createElementBlock as n, createElementVNode as r, defineComponent as i, normalizeStyle as a, openBlock as o, unref as s } from "vue";
|
|
3
|
+
//#region src/components/MSpinner.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var c = ["aria-label"], l = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "block h-full w-full animate-spin rounded-full border-2 border-current border-t-transparent"
|
|
7
|
+
}, u = [
|
|
8
|
+
"width",
|
|
9
|
+
"height",
|
|
10
|
+
"viewBox"
|
|
11
|
+
], d = ["d", "stroke-dasharray"], f = 3, p = 9, m = /* @__PURE__ */ i({
|
|
12
|
+
__name: "MSpinner",
|
|
13
|
+
props: {
|
|
14
|
+
size: { default: 20 },
|
|
15
|
+
wavy: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: !1
|
|
18
|
+
},
|
|
19
|
+
label: {}
|
|
20
|
+
},
|
|
21
|
+
setup(i) {
|
|
22
|
+
let m = i, h = e(), g = t(() => (m.size / 2 - 1 - f / 2) / 1.25), _ = t(() => m.size / 2), v = t(() => {
|
|
23
|
+
let e = _.value, t = g.value, n = t * .08, r = [], i = 0, a = 0, o = 0;
|
|
24
|
+
for (let s = 0; s <= 216; s++) {
|
|
25
|
+
let c = 2 * Math.PI * s / 216 - Math.PI / 2, l = t + n * Math.sin(p * c), u = e + l * Math.cos(c), d = e + l * Math.sin(c);
|
|
26
|
+
s > 0 && (i += Math.sqrt((u - a) ** 2 + (d - o) ** 2)), r.push(`${s === 0 ? "M" : "L"}${u.toFixed(2)},${d.toFixed(2)}`), a = u, o = d;
|
|
27
|
+
}
|
|
28
|
+
let s = i * .58, c = i - s, l = `${s.toFixed(1)} ${c.toFixed(1)}`;
|
|
29
|
+
return {
|
|
30
|
+
path: r.join("") + "Z",
|
|
31
|
+
dash: l,
|
|
32
|
+
len: i.toFixed(1)
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
return (e, t) => (o(), n("span", {
|
|
36
|
+
class: "inline-flex shrink-0 items-center justify-center",
|
|
37
|
+
style: a({
|
|
38
|
+
width: `${i.size}px`,
|
|
39
|
+
height: `${i.size}px`
|
|
40
|
+
}),
|
|
41
|
+
role: "status",
|
|
42
|
+
"aria-label": i.label ?? s(h).loading
|
|
43
|
+
}, [i.wavy ? (o(), n("svg", {
|
|
44
|
+
key: 1,
|
|
45
|
+
width: i.size,
|
|
46
|
+
height: i.size,
|
|
47
|
+
viewBox: `0 0 ${i.size} ${i.size}`,
|
|
48
|
+
fill: "none",
|
|
49
|
+
class: "animate-[m3-wavy-spin_2.8s_linear_infinite]",
|
|
50
|
+
style: a(`transform-origin: ${_.value}px ${_.value}px`)
|
|
51
|
+
}, [r("path", {
|
|
52
|
+
d: v.value.path,
|
|
53
|
+
stroke: "currentColor",
|
|
54
|
+
"stroke-width": f,
|
|
55
|
+
"stroke-linecap": "round",
|
|
56
|
+
"stroke-dasharray": v.value.dash,
|
|
57
|
+
class: "animate-[m3-wavy-travel_2s_linear_infinite]",
|
|
58
|
+
style: a({ "--m3-wave-len": v.value.len })
|
|
59
|
+
}, null, 12, d)], 12, u)) : (o(), n("span", l))], 12, c));
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
//#endregion
|
|
63
|
+
export { m as t };
|
|
64
|
+
|
|
65
|
+
//# sourceMappingURL=MSpinner-BhkMYKOM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MSpinner-BhkMYKOM.js","names":[],"sources":["../src/components/MSpinner.vue","../src/components/MSpinner.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A small circular loading spinner — a standard ring, or the M3 Expressive wavy variant. For a larger,\n * shape-morphing loading affordance, see MLoadingIndicator.\n */\nimport { computed } from \"vue\";\nimport { useLocale } from '../composables/useLocale';\n\nconst props = withDefaults(\n defineProps<{\n /** Size in px */\n size?: number;\n /**\n * M3 Expressive wavy animation style — the ring rotates while a wave travels along its stroke, instead of a\n * plain spin\n */\n wavy?: boolean;\n /** Aria label for the spinner's status role — falls back to the locale string ('Loading') when omitted */\n label?: string;\n }>(),\n { size: 20, wavy: false },\n);\n\nconst locale = useLocale();\n\nconst STROKE = 3;\nconst BUMPS = 9;\n\n// amp fraction of r = 0.25 → max radius = r * 1.25\n// Constrain so that max_r + STROKE/2 ≤ size/2 - 1 (1px margin from edge)\nconst r = computed(() => (props.size / 2 - 1 - STROKE / 2) / 1.25);\nconst cx = computed(() => props.size / 2);\n\n// Build the full bumpy-circle path and its total length.\nconst wavyData = computed(() => {\n const CX = cx.value;\n const R = r.value;\n const amp = R * 0.08;\n const segs = BUMPS * 24; // smooth curve\n\n const pts: string[] = [];\n let len = 0;\n let px = 0,\n py = 0;\n\n for (let i = 0; i <= segs; i++) {\n const theta = (2 * Math.PI * i) / segs - Math.PI / 2;\n const rr = R + amp * Math.sin(BUMPS * theta);\n const x = CX + rr * Math.cos(theta);\n const y = CX + rr * Math.sin(theta);\n if (i > 0) len += Math.sqrt((x - px) ** 2 + (y - py) ** 2);\n pts.push(`${i === 0 ? \"M\" : \"L\"}${x.toFixed(2)},${y.toFixed(2)}`);\n px = x;\n py = y;\n }\n\n // Visible arc ~58% of the circumference, gap fills the rest.\n const visible = len * 0.58;\n const gap = len - visible;\n const dash = `${visible.toFixed(1)} ${gap.toFixed(1)}`;\n\n // The wave \"travels\" by shifting dashoffset over exactly one full length,\n // so the crests slide around the path independently of the rotation.\n return { path: pts.join(\"\") + \"Z\", dash, len: len.toFixed(1) };\n});\n</script>\n\n<template>\n <span\n class=\"inline-flex shrink-0 items-center justify-center\"\n :style=\"{ width: `${size}px`, height: `${size}px` }\"\n role=\"status\"\n :aria-label=\"label ?? locale.loading\"\n >\n <!-- Standard circular spinner -->\n <span\n v-if=\"!wavy\"\n class=\"block h-full w-full animate-spin rounded-full border-2 border-current border-t-transparent\"\n />\n\n <!-- Wavy spinner (M3 Expressive): the whole shape rotates AND the wave\n travels along the stroke via dashoffset, giving the snake-like flow. -->\n <svg\n v-else\n :width=\"size\"\n :height=\"size\"\n :viewBox=\"`0 0 ${size} ${size}`\"\n fill=\"none\"\n class=\"animate-[m3-wavy-spin_2.8s_linear_infinite]\"\n :style=\"`transform-origin: ${cx}px ${cx}px`\"\n >\n <path\n :d=\"wavyData.path\"\n stroke=\"currentColor\"\n :stroke-width=\"STROKE\"\n stroke-linecap=\"round\"\n :stroke-dasharray=\"wavyData.dash\"\n class=\"animate-[m3-wavy-travel_2s_linear_infinite]\"\n :style=\"{ '--m3-wave-len': wavyData.len }\"\n />\n </svg>\n </span>\n</template>\n\n<style>\n/* The SVG element rotates the whole bumpy circle. */\n@keyframes m3-wavy-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n\n/* The stroke's dashoffset slides by one full path length, so the crests\n appear to crawl along the circle — the \"snake\" motion of M3 Expressive.\n Negative direction makes the wave travel forward relative to the spin. */\n@keyframes m3-wavy-travel {\n from {\n stroke-dashoffset: 0;\n }\n to {\n stroke-dashoffset: calc(var(--m3-wave-len) * -1px);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .animate-\\[m3-wavy-spin_2\\.8s_linear_infinite\\] {\n animation: m3-wavy-spin 2.8s linear infinite;\n }\n .animate-\\[m3-wavy-travel_2s_linear_infinite\\] {\n animation: none !important;\n }\n}\n</style>\n","<script setup lang=\"ts\">\n/**\n * A small circular loading spinner — a standard ring, or the M3 Expressive wavy variant. For a larger,\n * shape-morphing loading affordance, see MLoadingIndicator.\n */\nimport { computed } from \"vue\";\nimport { useLocale } from '../composables/useLocale';\n\nconst props = withDefaults(\n defineProps<{\n /** Size in px */\n size?: number;\n /**\n * M3 Expressive wavy animation style — the ring rotates while a wave travels along its stroke, instead of a\n * plain spin\n */\n wavy?: boolean;\n /** Aria label for the spinner's status role — falls back to the locale string ('Loading') when omitted */\n label?: string;\n }>(),\n { size: 20, wavy: false },\n);\n\nconst locale = useLocale();\n\nconst STROKE = 3;\nconst BUMPS = 9;\n\n// amp fraction of r = 0.25 → max radius = r * 1.25\n// Constrain so that max_r + STROKE/2 ≤ size/2 - 1 (1px margin from edge)\nconst r = computed(() => (props.size / 2 - 1 - STROKE / 2) / 1.25);\nconst cx = computed(() => props.size / 2);\n\n// Build the full bumpy-circle path and its total length.\nconst wavyData = computed(() => {\n const CX = cx.value;\n const R = r.value;\n const amp = R * 0.08;\n const segs = BUMPS * 24; // smooth curve\n\n const pts: string[] = [];\n let len = 0;\n let px = 0,\n py = 0;\n\n for (let i = 0; i <= segs; i++) {\n const theta = (2 * Math.PI * i) / segs - Math.PI / 2;\n const rr = R + amp * Math.sin(BUMPS * theta);\n const x = CX + rr * Math.cos(theta);\n const y = CX + rr * Math.sin(theta);\n if (i > 0) len += Math.sqrt((x - px) ** 2 + (y - py) ** 2);\n pts.push(`${i === 0 ? \"M\" : \"L\"}${x.toFixed(2)},${y.toFixed(2)}`);\n px = x;\n py = y;\n }\n\n // Visible arc ~58% of the circumference, gap fills the rest.\n const visible = len * 0.58;\n const gap = len - visible;\n const dash = `${visible.toFixed(1)} ${gap.toFixed(1)}`;\n\n // The wave \"travels\" by shifting dashoffset over exactly one full length,\n // so the crests slide around the path independently of the rotation.\n return { path: pts.join(\"\") + \"Z\", dash, len: len.toFixed(1) };\n});\n</script>\n\n<template>\n <span\n class=\"inline-flex shrink-0 items-center justify-center\"\n :style=\"{ width: `${size}px`, height: `${size}px` }\"\n role=\"status\"\n :aria-label=\"label ?? locale.loading\"\n >\n <!-- Standard circular spinner -->\n <span\n v-if=\"!wavy\"\n class=\"block h-full w-full animate-spin rounded-full border-2 border-current border-t-transparent\"\n />\n\n <!-- Wavy spinner (M3 Expressive): the whole shape rotates AND the wave\n travels along the stroke via dashoffset, giving the snake-like flow. -->\n <svg\n v-else\n :width=\"size\"\n :height=\"size\"\n :viewBox=\"`0 0 ${size} ${size}`\"\n fill=\"none\"\n class=\"animate-[m3-wavy-spin_2.8s_linear_infinite]\"\n :style=\"`transform-origin: ${cx}px ${cx}px`\"\n >\n <path\n :d=\"wavyData.path\"\n stroke=\"currentColor\"\n :stroke-width=\"STROKE\"\n stroke-linecap=\"round\"\n :stroke-dasharray=\"wavyData.dash\"\n class=\"animate-[m3-wavy-travel_2s_linear_infinite]\"\n :style=\"{ '--m3-wave-len': wavyData.len }\"\n />\n </svg>\n </span>\n</template>\n\n<style>\n/* The SVG element rotates the whole bumpy circle. */\n@keyframes m3-wavy-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n\n/* The stroke's dashoffset slides by one full path length, so the crests\n appear to crawl along the circle — the \"snake\" motion of M3 Expressive.\n Negative direction makes the wave travel forward relative to the spin. */\n@keyframes m3-wavy-travel {\n from {\n stroke-dashoffset: 0;\n }\n to {\n stroke-dashoffset: calc(var(--m3-wave-len) * -1px);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .animate-\\[m3-wavy-spin_2\\.8s_linear_infinite\\] {\n animation: m3-wavy-spin 2.8s linear infinite;\n }\n .animate-\\[m3-wavy-travel_2s_linear_infinite\\] {\n animation: none !important;\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;kCAyBM,IAAS,GACT,IAAQ;;;;;;;;;;;EAlBd,IAAM,IAAQ,GAeR,IAAS,EAAU,GAOnB,IAAI,SAAgB,EAAM,OAAO,IAAI,IAAI,IAAS,KAAK,IAAI,GAC3D,IAAK,QAAe,EAAM,OAAO,CAAC,GAGlC,IAAW,QAAe;GAC9B,IAAM,IAAK,EAAG,OACR,IAAI,EAAE,OACN,IAAM,IAAI,KAGV,IAAgB,CAAC,GACnB,IAAM,GACN,IAAK,GACP,IAAK;GAEP,KAAK,IAAI,IAAI,GAAG,KAAK,KAAM,KAAK;IAC9B,IAAM,IAAS,IAAI,KAAK,KAAK,IAAK,MAAO,KAAK,KAAK,GAC7C,IAAK,IAAI,IAAM,KAAK,IAAI,IAAQ,CAAK,GACrC,IAAI,IAAK,IAAK,KAAK,IAAI,CAAK,GAC5B,IAAI,IAAK,IAAK,KAAK,IAAI,CAAK;IAIlC,AAHI,IAAI,MAAG,KAAO,KAAK,MAAM,IAAI,MAAO,KAAK,IAAI,MAAO,CAAC,IACzD,EAAI,KAAK,GAAG,MAAM,IAAI,MAAM,MAAM,EAAE,QAAQ,CAAC,EAAE,GAAG,EAAE,QAAQ,CAAC,GAAG,GAChE,IAAK,GACL,IAAK;GACP;GAGA,IAAM,IAAU,IAAM,KAChB,IAAM,IAAM,GACZ,IAAO,GAAG,EAAQ,QAAQ,CAAC,EAAE,GAAG,EAAI,QAAQ,CAAC;GAInD,OAAO;IAAE,MAAM,EAAI,KAAK,EAAE,IAAI;IAAK;IAAM,KAAK,EAAI,QAAQ,CAAC;GAAE;EAC/D,CAAC;oBAIC,EAAA,GAAA,EAiCO,QAAA;GAhCL,OAAM;GACL,OAAK,EAAA;IAAA,OAAA,GAAc,EAAA,KAAI;IAAA,QAAA,GAAiB,EAAA,KAAI;GAAA,CAAA;GAC7C,MAAK;GACJ,cAAY,EAAA,SAAS,EAAA,CAAA,CAAM,CAAC;EAIpB,GAAA,CAAA,EAAA,QAMT,EAAA,GAAA,EAkBM,OAAA;;GAhBH,OAAO,EAAA;GACP,QAAQ,EAAA;GACR,SAAO,OAAS,EAAA,KAAI,GAAI,EAAA;GACzB,MAAK;GACL,OAAM;GACL,OAAK,EAAA,qBAAuB,EAAA,MAAE,KAAM,EAAA,MAAE,GAAA;EAEvC,GAAA,CAAA,EAQE,QAAA;GAPC,GAAG,EAAA,MAAS;GACb,QAAO;GACN,gBAAc;GACf,kBAAe;GACd,oBAAkB,EAAA,MAAS;GAC5B,OAAM;GACL,OAAK,EAAA,EAAA,iBAAqB,EAAA,MAAS,IAAG,CAAA;+BAvB3C,EAAA,GAAA,EAGE,QAHF,CAGE"}
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import { i as e } from "./useLocale-BpGxplLV.js";
|
|
2
|
+
import { t } from "./MIcon-Bxh9j135.js";
|
|
3
|
+
import { computed as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, getCurrentInstance as l, normalizeClass as u, normalizeStyle as d, onBeforeUnmount as f, onMounted as p, openBlock as m, ref as h, renderSlot as g, toDisplayString as _, toValue as v, unref as y, useId as b, useSlots as x, watch as S } from "vue";
|
|
4
|
+
//#region src/composables/useFieldBg.ts
|
|
5
|
+
var C = [
|
|
6
|
+
"bg-surface-container-highest",
|
|
7
|
+
"bg-surface-container-high",
|
|
8
|
+
"bg-surface-container-low",
|
|
9
|
+
"bg-surface-container-lowest",
|
|
10
|
+
"bg-surface-container",
|
|
11
|
+
"bg-surface-variant",
|
|
12
|
+
"bg-surface-bright",
|
|
13
|
+
"bg-surface-dim",
|
|
14
|
+
"bg-surface",
|
|
15
|
+
"bg-background",
|
|
16
|
+
"bg-inverse-surface",
|
|
17
|
+
"bg-primary-container",
|
|
18
|
+
"bg-secondary-container",
|
|
19
|
+
"bg-tertiary-container",
|
|
20
|
+
"bg-error-container",
|
|
21
|
+
"bg-primary-fixed",
|
|
22
|
+
"bg-primary-fixed-dim",
|
|
23
|
+
"bg-secondary-fixed",
|
|
24
|
+
"bg-secondary-fixed-dim",
|
|
25
|
+
"bg-tertiary-fixed",
|
|
26
|
+
"bg-tertiary-fixed-dim",
|
|
27
|
+
"bg-primary",
|
|
28
|
+
"bg-secondary",
|
|
29
|
+
"bg-tertiary",
|
|
30
|
+
"bg-error"
|
|
31
|
+
];
|
|
32
|
+
function w(e) {
|
|
33
|
+
for (let t of C) if (e.classList.contains(t)) return `var(--color-${t.slice(3)})`;
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
function T(e) {
|
|
37
|
+
if (!e || e === "transparent") return !0;
|
|
38
|
+
let t = e.match(/^rgba?\(([^)]+)\)$/);
|
|
39
|
+
if (t) {
|
|
40
|
+
let e = t[1].split(",").map((e) => e.trim());
|
|
41
|
+
if (e.length === 4 && parseFloat(e[3]) === 0) return !0;
|
|
42
|
+
}
|
|
43
|
+
return !1;
|
|
44
|
+
}
|
|
45
|
+
function E(e, t) {
|
|
46
|
+
let r = h("var(--color-surface)");
|
|
47
|
+
function i(n) {
|
|
48
|
+
r.value = n, e.value?.style.setProperty("--field-bg", t() ?? n);
|
|
49
|
+
}
|
|
50
|
+
function a() {
|
|
51
|
+
let t = e.value?.parentElement ?? null;
|
|
52
|
+
for (; t;) {
|
|
53
|
+
let e = w(t);
|
|
54
|
+
if (e) {
|
|
55
|
+
i(e);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (t === document.body) {
|
|
59
|
+
i("var(--color-surface)");
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
let n = getComputedStyle(t).backgroundColor;
|
|
63
|
+
if (!T(n)) {
|
|
64
|
+
i(n);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
t = t.parentElement;
|
|
68
|
+
}
|
|
69
|
+
i("var(--color-surface)");
|
|
70
|
+
}
|
|
71
|
+
let o = null;
|
|
72
|
+
return p(() => {
|
|
73
|
+
a(), o = new MutationObserver(() => a()), o.observe(document.documentElement, {
|
|
74
|
+
attributes: !0,
|
|
75
|
+
attributeFilter: [
|
|
76
|
+
"class",
|
|
77
|
+
"style",
|
|
78
|
+
"data-theme"
|
|
79
|
+
]
|
|
80
|
+
});
|
|
81
|
+
}), f(() => o?.disconnect()), { resolvedFieldBg: n(() => t() ?? r.value) };
|
|
82
|
+
}
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/composables/useAutoGrow.ts
|
|
85
|
+
function D(e, t = {}) {
|
|
86
|
+
let n = null, r = null, i = 0;
|
|
87
|
+
function a() {
|
|
88
|
+
if (!n) return;
|
|
89
|
+
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 = (v(t.minRows) ?? 1) * i + s, l = v(t.maxRows), u = l ? l * i + s : Infinity;
|
|
90
|
+
n.style.height = "auto";
|
|
91
|
+
let d = n.scrollHeight + o + (e.boxSizing === "border-box" ? 0 : -a), f = Math.min(u, Math.max(c, d));
|
|
92
|
+
n.style.height = `${f}px`, n.style.overflowY = d > u ? "auto" : "hidden";
|
|
93
|
+
}
|
|
94
|
+
function o(e) {
|
|
95
|
+
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]) => {
|
|
96
|
+
let t = e.contentRect.width;
|
|
97
|
+
t !== i && (i = t, a());
|
|
98
|
+
}), r.observe(n)), a());
|
|
99
|
+
}
|
|
100
|
+
return S(() => v(e), o, {
|
|
101
|
+
immediate: !0,
|
|
102
|
+
flush: "post"
|
|
103
|
+
}), S([() => v(t.minRows), () => v(t.maxRows)], () => a(), { flush: "post" }), t.value && S(t.value, () => a(), { flush: "post" }), l() && f(() => o(null)), { resize: a };
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region src/composables/useDebounce.ts
|
|
107
|
+
function O(e, t) {
|
|
108
|
+
let n = null;
|
|
109
|
+
function r(...r) {
|
|
110
|
+
n && clearTimeout(n), n = setTimeout(() => {
|
|
111
|
+
n = null, e(...r);
|
|
112
|
+
}, t);
|
|
113
|
+
}
|
|
114
|
+
function i() {
|
|
115
|
+
n &&= (clearTimeout(n), null);
|
|
116
|
+
}
|
|
117
|
+
return f(i), {
|
|
118
|
+
debounced: r,
|
|
119
|
+
cancel: i
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region src/components/MTextField.vue?vue&type=script&setup=true&lang.ts
|
|
124
|
+
var k = { class: "flex flex-col gap-1" }, A = [
|
|
125
|
+
"id",
|
|
126
|
+
"value",
|
|
127
|
+
"rows",
|
|
128
|
+
"disabled",
|
|
129
|
+
"required"
|
|
130
|
+
], j = [
|
|
131
|
+
"id",
|
|
132
|
+
"type",
|
|
133
|
+
"value",
|
|
134
|
+
"disabled",
|
|
135
|
+
"required",
|
|
136
|
+
"autocomplete"
|
|
137
|
+
], M = ["for"], N = {
|
|
138
|
+
key: 0,
|
|
139
|
+
class: "text-error"
|
|
140
|
+
}, P = {
|
|
141
|
+
key: 3,
|
|
142
|
+
class: "absolute right-2 top-1/2 -translate-y-1/2"
|
|
143
|
+
}, F = ["aria-label"], I = {
|
|
144
|
+
key: 0,
|
|
145
|
+
class: "px-4 text-body-small text-error"
|
|
146
|
+
}, L = {
|
|
147
|
+
key: 1,
|
|
148
|
+
class: "px-4 text-body-small text-on-surface-variant"
|
|
149
|
+
}, R = /* @__PURE__ */ c({
|
|
150
|
+
__name: "MTextField",
|
|
151
|
+
props: {
|
|
152
|
+
modelValue: {},
|
|
153
|
+
label: {},
|
|
154
|
+
type: { default: "text" },
|
|
155
|
+
variant: { default: "filled" },
|
|
156
|
+
error: { type: Boolean },
|
|
157
|
+
errorLabel: {},
|
|
158
|
+
hint: {},
|
|
159
|
+
disabled: { type: Boolean },
|
|
160
|
+
required: { type: Boolean },
|
|
161
|
+
multiline: { type: Boolean },
|
|
162
|
+
rows: { default: 3 },
|
|
163
|
+
autoGrow: { type: Boolean },
|
|
164
|
+
maxRows: {},
|
|
165
|
+
autocomplete: {},
|
|
166
|
+
leadingIcon: {},
|
|
167
|
+
clearable: {
|
|
168
|
+
type: Boolean,
|
|
169
|
+
default: !1
|
|
170
|
+
},
|
|
171
|
+
fieldBg: {},
|
|
172
|
+
debounce: { default: 0 }
|
|
173
|
+
},
|
|
174
|
+
emits: ["update:modelValue", "debounced"],
|
|
175
|
+
setup(c, { expose: l, emit: f }) {
|
|
176
|
+
let p = e(), v = c, S = f, C = b(), w = x(), T = h(null), { resolvedFieldBg: R } = E(T, () => v.fieldBg), { debounced: z, cancel: B } = O((e) => S("debounced", e), v.debounce), V = h(null), H = h(null), U = n(() => V.value ?? H.value);
|
|
177
|
+
D(() => v.multiline && v.autoGrow ? V.value : null, {
|
|
178
|
+
minRows: () => v.rows,
|
|
179
|
+
maxRows: () => v.maxRows,
|
|
180
|
+
value: () => v.modelValue
|
|
181
|
+
});
|
|
182
|
+
let W = n(() => v.clearable && String(v.modelValue).length > 0 && !v.disabled), G = n(() => {
|
|
183
|
+
let e = !!w.trailing || v.clearable, t = v.leadingIcon ? "pl-12" : "pl-4", n = e ? "pr-12" : "pr-4", r = v.multiline ? v.autoGrow ? "resize-none min-h-[56px]" : "resize-y min-h-[56px]" : "h-14", i = [
|
|
184
|
+
"peer block w-full text-body-large text-on-surface outline-none placeholder:text-transparent",
|
|
185
|
+
"transition-[border-color,border-width] duration-150",
|
|
186
|
+
"disabled:cursor-not-allowed disabled:text-on-surface/38",
|
|
187
|
+
v.error ? "caret-error" : "caret-primary",
|
|
188
|
+
r,
|
|
189
|
+
t,
|
|
190
|
+
n
|
|
191
|
+
];
|
|
192
|
+
return v.variant === "outlined" ? [
|
|
193
|
+
...i,
|
|
194
|
+
"rounded-xs border bg-transparent py-4",
|
|
195
|
+
v.error ? "border-error focus:border-2 focus:border-error" : "border-outline hover:border-on-surface focus:border-2 focus:border-primary",
|
|
196
|
+
"disabled:border-on-surface/12"
|
|
197
|
+
].join(" ") : [
|
|
198
|
+
...i,
|
|
199
|
+
v.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",
|
|
200
|
+
v.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",
|
|
201
|
+
"disabled:border-b-on-surface/38 disabled:bg-[color-mix(in_srgb,var(--color-on-surface)_4%,var(--color-surface-container-highest))]"
|
|
202
|
+
].join(" ");
|
|
203
|
+
}), K = n(() => {
|
|
204
|
+
let e = [
|
|
205
|
+
"pointer-events-none absolute truncate transition-all duration-200",
|
|
206
|
+
v.leadingIcon ? v.variant === "outlined" ? "left-11" : "left-12" : v.variant === "outlined" ? "left-3" : "left-4",
|
|
207
|
+
"right-4",
|
|
208
|
+
`${v.variant === "filled" ? "top-[53%]" : "top-1/2"} -translate-y-1/2 text-body-large`
|
|
209
|
+
];
|
|
210
|
+
return v.variant === "outlined" ? [
|
|
211
|
+
...e,
|
|
212
|
+
"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",
|
|
213
|
+
"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)]",
|
|
214
|
+
"peer-[&:not(:placeholder-shown)]:text-label-small peer-[&:not(:placeholder-shown)]:bg-[var(--field-bg)] peer-[&:not(:placeholder-shown)]:px-1",
|
|
215
|
+
v.error ? "text-error peer-focus:text-error" : "text-on-surface-variant peer-focus:text-primary",
|
|
216
|
+
"peer-disabled:text-on-surface/38"
|
|
217
|
+
].join(" ") : [
|
|
218
|
+
...e,
|
|
219
|
+
"peer-focus:top-2 peer-focus:translate-y-0 peer-focus:text-label-small",
|
|
220
|
+
"peer-[&:not(:placeholder-shown)]:top-2 peer-[&:not(:placeholder-shown)]:translate-y-0 peer-[&:not(:placeholder-shown)]:text-label-small",
|
|
221
|
+
v.error ? "text-error peer-focus:text-error" : "text-on-surface-variant peer-focus:text-primary",
|
|
222
|
+
"peer-disabled:text-on-surface/38"
|
|
223
|
+
].join(" ");
|
|
224
|
+
});
|
|
225
|
+
function q(e) {
|
|
226
|
+
let t = e.target;
|
|
227
|
+
S("update:modelValue", t.value), v.debounce > 0 && z(t.value);
|
|
228
|
+
}
|
|
229
|
+
return l({
|
|
230
|
+
inputEl: U,
|
|
231
|
+
focus: (e) => U.value?.focus(e),
|
|
232
|
+
blur: () => U.value?.blur(),
|
|
233
|
+
select: () => U.value?.select(),
|
|
234
|
+
setSelectionRange: (e, t, n) => U.value?.setSelectionRange(e, t, n)
|
|
235
|
+
}), (e, n) => (m(), i("div", k, [a("div", {
|
|
236
|
+
ref_key: "fieldBgEl",
|
|
237
|
+
ref: T,
|
|
238
|
+
class: u(["relative", c.variant === "outlined" ? "mt-2" : ""]),
|
|
239
|
+
style: d(c.variant === "outlined" ? { "--field-bg": y(R) } : void 0)
|
|
240
|
+
}, [
|
|
241
|
+
c.leadingIcon ? (m(), i("div", {
|
|
242
|
+
key: 0,
|
|
243
|
+
class: u(["pointer-events-none absolute left-3.5", [c.multiline ? "top-[55%] -translate-y-1/2" : c.variant === "filled" ? "top-4.5" : "top-4", c.disabled ? "text-on-surface/38" : "text-on-surface-variant"]])
|
|
244
|
+
}, [s(t, {
|
|
245
|
+
name: c.leadingIcon,
|
|
246
|
+
size: 24
|
|
247
|
+
}, null, 8, ["name"])], 2)) : r("", !0),
|
|
248
|
+
c.multiline ? (m(), i("textarea", {
|
|
249
|
+
key: 1,
|
|
250
|
+
ref_key: "textareaEl",
|
|
251
|
+
ref: V,
|
|
252
|
+
id: y(C),
|
|
253
|
+
value: String(c.modelValue),
|
|
254
|
+
rows: c.rows,
|
|
255
|
+
disabled: c.disabled,
|
|
256
|
+
required: c.required,
|
|
257
|
+
placeholder: " ",
|
|
258
|
+
class: u(G.value),
|
|
259
|
+
onInput: q
|
|
260
|
+
}, null, 42, A)) : (m(), i("input", {
|
|
261
|
+
key: 2,
|
|
262
|
+
ref_key: "inputOnlyEl",
|
|
263
|
+
ref: H,
|
|
264
|
+
id: y(C),
|
|
265
|
+
type: c.type,
|
|
266
|
+
value: c.modelValue,
|
|
267
|
+
disabled: c.disabled,
|
|
268
|
+
required: c.required,
|
|
269
|
+
autocomplete: c.autocomplete,
|
|
270
|
+
placeholder: " ",
|
|
271
|
+
class: u(G.value),
|
|
272
|
+
onInput: q
|
|
273
|
+
}, null, 42, j)),
|
|
274
|
+
a("label", {
|
|
275
|
+
for: y(C),
|
|
276
|
+
class: u(K.value)
|
|
277
|
+
}, [o(_(c.label), 1), c.required ? (m(), i("span", N, "\xA0*")) : r("", !0)], 10, M),
|
|
278
|
+
e.$slots.trailing ? (m(), i("div", P, [g(e.$slots, "trailing")])) : W.value ? (m(), i("button", {
|
|
279
|
+
key: 4,
|
|
280
|
+
"aria-label": y(p).clear,
|
|
281
|
+
type: "button",
|
|
282
|
+
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",
|
|
283
|
+
onClick: n[0] ||= (e) => {
|
|
284
|
+
y(B)(), S("update:modelValue", "");
|
|
285
|
+
}
|
|
286
|
+
}, [s(t, {
|
|
287
|
+
name: "close",
|
|
288
|
+
size: 18
|
|
289
|
+
})], 8, F)) : r("", !0)
|
|
290
|
+
], 6), c.error && c.errorLabel ? (m(), i("p", I, _(c.errorLabel), 1)) : c.hint ? (m(), i("p", L, _(c.hint), 1)) : r("", !0)]));
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
//#endregion
|
|
294
|
+
export { E as i, O as n, D as r, R as t };
|
|
295
|
+
|
|
296
|
+
//# sourceMappingURL=MTextField-CkzwNBWS.js.map
|