@m3ui-vue/m3ui-vue 1.6.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/API.md +940 -33
- package/dist/{MButton-CPghlKb0.js → MButton-OQ4wIERQ.js} +2 -2
- package/dist/{MButton-CPghlKb0.js.map → MButton-OQ4wIERQ.js.map} +1 -1
- package/dist/{MDialog-X50At1Gk.js → MDialog-DYMnaBlt.js} +3 -3
- package/dist/{MDialog-X50At1Gk.js.map → MDialog-DYMnaBlt.js.map} +1 -1
- package/dist/{MListItem-DVi1j1QI.js → MListItem-D2cNUyzP.js} +211 -168
- package/dist/MListItem-D2cNUyzP.js.map +1 -0
- package/dist/{MLoadingIndicator-vooA3110.js → MLoadingIndicator-DWUj0BAB.js} +2 -2
- package/dist/{MLoadingIndicator-vooA3110.js.map → MLoadingIndicator-DWUj0BAB.js.map} +1 -1
- package/dist/{MMenuItem-CRNZkVVr.js → MMenuItem-BuxYoASE.js} +133 -151
- package/dist/MMenuItem-BuxYoASE.js.map +1 -0
- package/dist/{MSeekBar-BL2W5_rD.js → MSeekBar-C4cn9RIF.js} +2 -2
- package/dist/{MSeekBar-BL2W5_rD.js.map → MSeekBar-C4cn9RIF.js.map} +1 -1
- package/dist/{MSlider-B9NcKTmZ.js → MSlider-BIkA6DiE.js} +2 -2
- package/dist/{MSlider-B9NcKTmZ.js.map → MSlider-BIkA6DiE.js.map} +1 -1
- package/dist/{MSpinner-_XpTRkAg.js → MSpinner-DZkXZJpc.js} +2 -2
- package/dist/{MSpinner-_XpTRkAg.js.map → MSpinner-DZkXZJpc.js.map} +1 -1
- package/dist/{MTextField-DpcPmR5B.js → MTextField-CNH-byir.js} +2 -2
- package/dist/{MTextField-DpcPmR5B.js.map → MTextField-CNH-byir.js.map} +1 -1
- package/dist/{MTooltip-BL3jPYPT.js → MTooltip-Dd5g2zhh.js} +4 -4
- package/dist/{MTooltip-BL3jPYPT.js.map → MTooltip-Dd5g2zhh.js.map} +1 -1
- package/dist/{_useEscapeStack-C5-BYr8y.js → _popupPosition-nL8SVKPK.js} +20 -2
- package/dist/_popupPosition-nL8SVKPK.js.map +1 -0
- package/dist/api.json +1 -1
- package/dist/code-editor.js +1 -1
- package/dist/components/MAddressField.vue.d.ts +54 -0
- package/dist/components/MAudioPlayer.vue.d.ts +1 -1
- package/dist/components/MAudioRecorder.vue.d.ts +51 -0
- package/dist/components/MAvailabilityCalendar.vue.d.ts +1 -1
- package/dist/components/MCameraCapture.vue.d.ts +51 -0
- package/dist/components/MCollapse.vue.d.ts +32 -0
- package/dist/components/MCountrySelect.vue.d.ts +41 -0
- package/dist/components/MCronField.vue.d.ts +26 -0
- package/dist/components/MDashboardGrid.vue.d.ts +65 -0
- package/dist/components/MDiffViewer.vue.d.ts +56 -0
- package/dist/components/MExpansionPanel.vue.d.ts +26 -3
- package/dist/components/MFilterBuilder.vue.d.ts +22 -0
- package/dist/components/MFlex.vue.d.ts +1 -1
- package/dist/components/MMapCluster.vue.d.ts +80 -0
- package/dist/components/MMapDraw.vue.d.ts +79 -0
- package/dist/components/MMentionField.vue.d.ts +102 -0
- package/dist/components/MNotificationCenter.vue.d.ts +57 -0
- package/dist/components/MQRScanner.vue.d.ts +52 -0
- package/dist/components/MQuiz.vue.d.ts +1 -1
- package/dist/components/MSimpleCarousel.vue.d.ts +1 -1
- package/dist/components/MStack.vue.d.ts +1 -1
- package/dist/components/MTimezoneSelect.vue.d.ts +39 -0
- package/dist/components/MToolbar.vue.d.ts +1 -1
- package/dist/components/MVideoPlayer.vue.d.ts +1 -1
- package/dist/components/_MFilterGroup.vue.d.ts +17 -0
- package/dist/composables/_caretPosition.d.ts +6 -0
- package/dist/composables/_useCamera.d.ts +16 -0
- package/dist/composables/_useFollowAnchor.d.ts +15 -0
- package/dist/composables/cron.d.ts +29 -0
- package/dist/composables/dashboardLayout.d.ts +28 -0
- package/dist/composables/filterBuilder.d.ts +55 -0
- package/dist/composables/mapAdapters.d.ts +6 -1
- package/dist/composables/mapSearch.d.ts +1 -0
- package/dist/composables/textDiff.d.ts +24 -0
- package/dist/composables/useLocale.d.ts +108 -0
- package/dist/draw.js +3 -3
- package/dist/flow.js +1 -1
- package/dist/gantt.js +1 -1
- package/dist/index.d.ts +25 -0
- package/dist/locales/index.js +749 -0
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +9888 -6940
- package/dist/m3ui.js.map +1 -1
- package/dist/map.d.ts +5 -0
- package/dist/map.js +1462 -576
- package/dist/map.js.map +1 -1
- package/dist/media.js +5 -5
- package/dist/pdf.js +5 -5
- package/dist/rich-text-editor.js +5 -5
- package/dist/styles.css +1 -1
- package/dist/{useLocale-COav9m8C.js → useLocale-DaVSTdm0.js} +108 -1
- package/dist/useLocale-DaVSTdm0.js.map +1 -0
- package/package.json +1 -1
- package/src/__tests__/MAddressField.test.ts +149 -0
- package/src/__tests__/MAudioRecorder.test.ts +125 -0
- package/src/__tests__/MCameraCapture.test.ts +154 -0
- package/src/__tests__/MCountrySelect.test.ts +67 -0
- package/src/__tests__/MCronField.test.ts +100 -0
- package/src/__tests__/MDashboardGrid.test.ts +122 -0
- package/src/__tests__/MDiffViewer.test.ts +68 -0
- package/src/__tests__/MExpansionPanel.test.ts +107 -0
- package/src/__tests__/MFilterBuilder.test.ts +130 -0
- package/src/__tests__/MMapCluster.test.ts +127 -0
- package/src/__tests__/MMapDraw.test.ts +188 -0
- package/src/__tests__/MMapLayers.test.ts +56 -0
- package/src/__tests__/MMentionField.test.ts +163 -0
- package/src/__tests__/MNotificationCenter.test.ts +94 -0
- package/src/__tests__/_fakeMaplibre.ts +14 -3
- package/src/__tests__/attrsFallthrough.test.ts +4 -0
- package/src/__tests__/cron.test.ts +68 -0
- package/src/__tests__/dashboardLayout.test.ts +45 -0
- package/src/__tests__/filterBuilder.test.ts +91 -0
- package/src/__tests__/followAnchor.test.ts +162 -0
- package/src/__tests__/ssr.test.ts +3 -0
- package/src/__tests__/textDiff.test.ts +37 -0
- package/src/components/MAddressField.vue +301 -0
- package/src/components/MAudioRecorder.vue +334 -0
- package/src/components/MAutocomplete.vue +3 -7
- package/src/components/MCameraCapture.vue +156 -0
- package/src/components/MCollapse.vue +91 -0
- package/src/components/MColorPicker.vue +4 -8
- package/src/components/MCountrySelect.vue +89 -0
- package/src/components/MCronField.vue +251 -0
- package/src/components/MDashboardGrid.vue +382 -0
- package/src/components/MDatePicker.vue +10 -7
- package/src/components/MDateRangePicker.vue +10 -7
- package/src/components/MDiffViewer.vue +234 -0
- package/src/components/MExpansionPanel.vue +56 -48
- package/src/components/MFilterBuilder.vue +47 -0
- package/src/components/MMapCluster.vue +295 -0
- package/src/components/MMapDraw.vue +601 -0
- package/src/components/MMapSearch.vue +1 -9
- package/src/components/MMentionField.vue +373 -0
- package/src/components/MMultiAutocomplete.vue +3 -7
- package/src/components/MMultiSelect.vue +3 -7
- package/src/components/MNotificationCenter.vue +252 -0
- package/src/components/MPhoneInput.vue +3 -10
- package/src/components/MQRScanner.vue +177 -0
- package/src/components/MSelect.vue +3 -7
- package/src/components/MTimePicker.vue +10 -7
- package/src/components/MTimezoneSelect.vue +116 -0
- package/src/components/_MFilterGroup.vue +210 -0
- package/src/composables/_caretPosition.ts +44 -0
- package/src/composables/_useCamera.ts +66 -0
- package/src/composables/_useFollowAnchor.ts +109 -0
- package/src/composables/cron.ts +179 -0
- package/src/composables/dashboardLayout.ts +94 -0
- package/src/composables/filterBuilder.ts +195 -0
- package/src/composables/mapAdapters.ts +29 -15
- package/src/composables/mapSearch.ts +10 -0
- package/src/composables/textDiff.ts +106 -0
- package/src/composables/useLocale.ts +215 -0
- package/src/index.ts +25 -0
- package/src/locales/de.ts +107 -0
- package/src/locales/es.ts +107 -0
- package/src/locales/fr.ts +107 -0
- package/src/locales/ja.ts +107 -0
- package/src/locales/ko.ts +107 -0
- package/src/locales/pt.ts +107 -0
- package/src/locales/zh.ts +107 -0
- package/src/map.ts +5 -0
- package/dist/MListItem-DVi1j1QI.js.map +0 -1
- package/dist/MMenuItem-CRNZkVVr.js.map +0 -1
- package/dist/_useEscapeStack-C5-BYr8y.js.map +0 -1
- package/dist/useLocale-COav9m8C.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MSlider-B9NcKTmZ.js","names":["_openBlock","_createElementBlock","_normalizeClass","_toDisplayString","_createElementVNode","_normalizeStyle","_Fragment","_createBlock","MIcon","_renderList","_unref","_createVNode","_Transition","_withCtx","MIcon_default","useLocale","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","DISABLED_ACTIVE","DISABLED_INACTIVE","MSlider_default","defineComponent","__emit","props","__props","emit","t","trackEl","ref","thumbEls","dragging","focused","focusedThumb","keyboardThumb","focusingFromPointer","focusThumb","idx","onThumbFocus","onThumbBlur","isVertical","computed","isRange","val","v","toPct","range","pointerRatio","freePct","pctLo","f","pctHi","centerPct","startDotHidden","startLen","s","endDotHidden","endLen","trackLen","resizeObserver","measureTrack","el","onMounted","onBeforeUnmount","posPx","inset","pct","gap","startPieceHidden","fullR","endPieceHidden","sizeMap","iconInset","activeColorMap","resolveActive","value","custom","base","ct","thumbCt","clamp","stepped","ratioFromEvent","rect","valueFromEvent","overlapPress","rangeValue","hi","lo","onPointerDown","onPointerMove","onPointerUp","KEY_DELTA","onKeyDown","delta","onThumbKeyDown","cur","e","next","stopPositions","positions","iconClearPct","fillActiveSize","clampedPos","fillInactiveSize","rangeInactiveBeforeSize","rangeActiveStart","rangeActiveSize","rangeInactiveAfterSize","centeredActiveStart","centeredActiveSize","centeredFarInactiveSize","centeredNearInactiveSize","r","smallR","pillRadiusSquareBoth","pillRadiusOuterStart","pillRadiusOuterEnd","nd","tr","thumbPos","tw","th","br","isDragging","isNarrowed","grow","narrow","thumbIconPos","scale","tooltipPos","offsetH","offsetV","displayValue","tooltipValue","tooltipPct","openBlock","createElementBlock","normalizeClass","toDisplayString","createCommentVNode","createElementVNode","normalizeStyle","_cache","$event","Fragment","createBlock","renderList","i","pos","unref","createVNode","Transition","withCtx"],"sources":["../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 :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C,EAAA,UAAkBG,KAAG,0CAAA,CAAA;IAC5B,OAAKlC,EAAEsB,EAAA,YAAYuG,GAAa3F,MAAG,IAASY,EAAA,QAAQE,EAAA,KAAK,IAAIqE,GAASnF,MAAG,IAASY,EAAA,QAAQE,EAAA,OAAOd,CAAG,CAAA;IACpG,YAAO,MAAE0D,GAAe1D,GAAK2G,CAAM;IACnC,UAAK,MAAE1G,GAAaD,CAAG;IACvB,QAAME;G,IAEMd,EAAA,aAAb3B,EAAA,GAAAO,EAAoEC,GAAA;;IAA3C,MAAMmB,EAAA;IAAY,MAAM8B,EAAA,MAAE;G,+DAxBvDzD,EAAA,GAAAC,EAGWK,GAAA,EAAA,KAAA,EAAA,GAAA,CAFIqB,EAAA,aAAb3B,EAAA,GAAAO,EAA+OC,GAAA;;IAAtN,MAAMmB,EAAA;IAAY,MAAM8B,EAAA,MAAE;IAAe,OAAM;IAAyI,OAAKpD,EAAE6H,GAAa/E,EAAA,KAAK,CAAA;;;;;G,OAC1OnD,EAAA,GAAAC,EAAwK,OAAA;;IAA5J,OAAM;IAA4H,OAAKI,EAAEqH,GAASvE,EAAA,KAAK,CAAA;;GA2BrKxC,EAaaC,GAAA;IAZX,sBAAmB;IACnB,oBAAiB;IACjB,sBAAmB;IACnB,kBAAe;;IAEf,SAAAC,SAMM,CALEc,EAAA,eAAeM,EAAA,UAAQ,MAD/BjC,EAAA,GAAAC,EAMM,OAAA;;KAJJ,OAAM;KACL,OAAKI,EAAE+H,GAAWK,GAAA,KAAU,CAAA;IAE1B,GAAAtI,EAAAqI,GAAA,KAAY,GAAA,CAAA,K"}
|
|
1
|
+
{"version":3,"file":"MSlider-BIkA6DiE.js","names":["_openBlock","_createElementBlock","_normalizeClass","_toDisplayString","_createElementVNode","_normalizeStyle","_Fragment","_createBlock","MIcon","_renderList","_unref","_createVNode","_Transition","_withCtx","MIcon_default","useLocale","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","DISABLED_ACTIVE","DISABLED_INACTIVE","MSlider_default","defineComponent","__emit","props","__props","emit","t","trackEl","ref","thumbEls","dragging","focused","focusedThumb","keyboardThumb","focusingFromPointer","focusThumb","idx","onThumbFocus","onThumbBlur","isVertical","computed","isRange","val","v","toPct","range","pointerRatio","freePct","pctLo","f","pctHi","centerPct","startDotHidden","startLen","s","endDotHidden","endLen","trackLen","resizeObserver","measureTrack","el","onMounted","onBeforeUnmount","posPx","inset","pct","gap","startPieceHidden","fullR","endPieceHidden","sizeMap","iconInset","activeColorMap","resolveActive","value","custom","base","ct","thumbCt","clamp","stepped","ratioFromEvent","rect","valueFromEvent","overlapPress","rangeValue","hi","lo","onPointerDown","onPointerMove","onPointerUp","KEY_DELTA","onKeyDown","delta","onThumbKeyDown","cur","e","next","stopPositions","positions","iconClearPct","fillActiveSize","clampedPos","fillInactiveSize","rangeInactiveBeforeSize","rangeActiveStart","rangeActiveSize","rangeInactiveAfterSize","centeredActiveStart","centeredActiveSize","centeredFarInactiveSize","centeredNearInactiveSize","r","smallR","pillRadiusSquareBoth","pillRadiusOuterStart","pillRadiusOuterEnd","nd","tr","thumbPos","tw","th","br","isDragging","isNarrowed","grow","narrow","thumbIconPos","scale","tooltipPos","offsetH","offsetV","displayValue","tooltipValue","tooltipPct","openBlock","createElementBlock","normalizeClass","toDisplayString","createCommentVNode","createElementVNode","normalizeStyle","_cache","$event","Fragment","createBlock","renderList","i","pos","unref","createVNode","Transition","withCtx"],"sources":["../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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A,GAkOMqB,KAAkB,gEAClBC,KAAoB,gE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAvN1B,IAAMI,IAAQC,GAoDRC,IAAOH,IAEPI,KAAId,EAAU,GACde,IAAUC,EAAiB,GAC3BC,KAAWD,EAAmB,CAAC,CAAC,GAEhCE,IAAWF,EAA8B,EAAK,GAC9CG,IAAUH,EAAI,EAAK,GACnBI,IAAeJ,EAAkB,IA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EAGWK,GAAA,EAAA,KAAA,EAAA,GAAA,CAFIqB,EAAA,aAAb3B,EAAA,GAAAO,EAA+OC,GAAA;;IAAtN,MAAMmB,EAAA;IAAY,MAAM8B,EAAA,MAAE;IAAe,OAAM;IAAyI,OAAKpD,EAAE6H,GAAa/E,EAAA,KAAK,CAAA;;;;;G,OAC1OnD,EAAA,GAAAC,EAAwK,OAAA;;IAA5J,OAAM;IAA4H,OAAKI,EAAEqH,GAASvE,EAAA,KAAK,CAAA;;GA2BrKxC,EAaaC,GAAA;IAZX,sBAAmB;IACnB,oBAAiB;IACjB,sBAAmB;IACnB,kBAAe;;IAEf,SAAAC,SAMM,CALEc,EAAA,eAAeM,EAAA,UAAQ,MAD/BjC,EAAA,GAAAC,EAMM,OAAA;;KAJJ,OAAM;KACL,OAAKI,EAAE+H,GAAWK,GAAA,KAAU,CAAA;IAE1B,GAAAtI,EAAAqI,GAAA,KAAY,GAAA,CAAA,K"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as e } from "./useLocale-
|
|
1
|
+
import { i as e } from "./useLocale-DaVSTdm0.js";
|
|
2
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
3
|
// src/components/MSpinner.vue?vue&type=script&setup=true&lang.ts
|
|
4
4
|
var c = ["aria-label"], l = {
|
|
@@ -61,4 +61,4 @@ var c = ["aria-label"], l = {
|
|
|
61
61
|
});
|
|
62
62
|
export { m as t };
|
|
63
63
|
|
|
64
|
-
//# sourceMappingURL=MSpinner-
|
|
64
|
+
//# sourceMappingURL=MSpinner-DZkXZJpc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MSpinner-
|
|
1
|
+
{"version":3,"file":"MSpinner-DZkXZJpc.js","names":["_openBlock","_createElementBlock","_normalizeStyle","_unref","_createElementVNode","useLocale","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","STROKE","BUMPS","MSpinner_default","defineComponent","props","__props","locale","r","computed","cx","wavyData","CX","R","amp","pts","len","px","py","i","theta","rr","x","y","visible","gap","dash","openBlock","createElementBlock","normalizeStyle","unref","createElementVNode"],"sources":["../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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A;GAC7C,MAAK;GACJ,cAAYA,EAAA,SAASZ,EAAAa,CAAA,CAAM,CAAC;E,IAIpBD,EAAA,QAMTf,EAAA,GAAAC,EAkBM,OAAA;;GAhBH,OAAOc,EAAA;GACP,QAAQA,EAAA;GACR,SAAO,OAASA,EAAA,KAAI,GAAIA,EAAA;GACzB,MAAK;GACL,OAAM;GACL,OAAKb,EAAA,qBAAuBiB,EAAA,MAAE,KAAMA,EAAA,MAAE,GAAA;E,IAEvCf,EAQE,QAAA;GAPC,GAAGgB,EAAA,MAAS;GACb,QAAO;GACN,gBAAcV;GACf,kBAAe;GACd,oBAAkBU,EAAA,MAAS;GAC5B,OAAM;GACL,OAAKlB,EAAA,EAAA,iBAAqBkB,EAAA,MAAS,IAAG,CAAA;E,6BAvB3CpB,EAAA,GAAAC,EAGE,QAHFM,CAGE,E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./MIcon-DpajuUTJ.js";
|
|
2
|
-
import { i as t } from "./useLocale-
|
|
2
|
+
import { i as t } from "./useLocale-DaVSTdm0.js";
|
|
3
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, withDirectives as C } from "vue";
|
|
4
4
|
// src/composables/useFieldBg.ts
|
|
5
5
|
var w = [
|
|
@@ -323,4 +323,4 @@ var I = /* @__PURE__ */ new WeakMap(), L = {
|
|
|
323
323
|
});
|
|
324
324
|
export { M as a, O as c, N as i, D as l, A as n, L as o, j as r, k as s, q as t };
|
|
325
325
|
|
|
326
|
-
//# sourceMappingURL=MTextField-
|
|
326
|
+
//# sourceMappingURL=MTextField-CNH-byir.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MTextField-DpcPmR5B.js","names":["$slots","_openBlock","_createElementBlock","_createElementVNode","_normalizeClass","_normalizeStyle","_unref","_createVNode","MIcon","_withDirectives","_createTextVNode","_toDisplayString","_renderSlot","MIcon_default","useLocale","M3_BG_CLASSES","findM3BgVar","cls","el","isTransparent","color","m","parts","s","useFieldBg","detectedBg","ref","applyFieldBg","value","containerEl","fieldBgProp","resolveBg","cssVar","bg","observer","onMounted","onBeforeUnmount","computed","useAutoGrow","lastWidth","resize","cs","px","v","lineHeight","padding","border","extra","min","toValue","options","maxRows","max","content","height","attach","next","entry","w","watch","target","getCurrentInstance","useDebounce","timer","debounced","args","fn","ms","cancel","FIELD_PADDING_RIGHT","FIELD_VALUE","fieldLabelClasses","outlined","o","base","rest","floatedPeer","floated","OUTLINED_FLOATED_LABEL","fullText","updateTitle","text","hoverHandlers","vOverflowTitle","handler","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","MTextField_default","defineComponent","__expose","__emit","locale","props","__props","emit","id","useId","slots","useSlots","fieldBgEl","emitDebounced","cancelDebounce","textareaEl","inputOnlyEl","fieldEl","showClear","rightInset","inputClasses","pl","pr","size","labelClasses","onInput","event","start","end","direction","openBlock","createElementBlock","createElementVNode","normalizeClass","normalizeStyle","unref","resolvedFieldBg","createVNode","createCommentVNode","withDirectives","createTextVNode","toDisplayString","_ctx","renderSlot","_cache"],"sources":["../src/composables/useFieldBg.ts","../src/composables/useAutoGrow.ts","../src/composables/useDebounce.ts","../src/composables/_fieldLayout.ts","../src/components/MTextField.vue"],"sourcesContent":["import { ref, computed, onMounted, onBeforeUnmount, type Ref } from 'vue'\n\nconst M3_BG_CLASSES = [\n 'bg-surface-container-highest',\n 'bg-surface-container-high',\n 'bg-surface-container-low',\n 'bg-surface-container-lowest',\n 'bg-surface-container',\n 'bg-surface-variant',\n 'bg-surface-bright',\n 'bg-surface-dim',\n 'bg-surface',\n 'bg-background',\n 'bg-inverse-surface',\n 'bg-primary-container',\n 'bg-secondary-container',\n 'bg-tertiary-container',\n 'bg-error-container',\n 'bg-primary-fixed',\n 'bg-primary-fixed-dim',\n 'bg-secondary-fixed',\n 'bg-secondary-fixed-dim',\n 'bg-tertiary-fixed',\n 'bg-tertiary-fixed-dim',\n 'bg-primary',\n 'bg-secondary',\n 'bg-tertiary',\n 'bg-error',\n] as const\n\nfunction findM3BgVar(el: HTMLElement): string | null {\n for (const cls of M3_BG_CLASSES) {\n if (el.classList.contains(cls)) return `var(--color-${cls.slice(3)})`\n }\n return null\n}\n\nfunction isTransparent(color: string): boolean {\n if (!color || color === 'transparent') return true\n const m = color.match(/^rgba?\\(([^)]+)\\)$/)\n if (m) {\n const parts = m[1]!.split(',').map((s) => s.trim())\n if (parts.length === 4 && parseFloat(parts[3]!) === 0) return true\n }\n return false\n}\n\n/**\n * Auto-detects the background behind `containerEl` and exposes it as `--field-bg`.\n * Prefers a CSS variable reference (e.g. var(--color-surface-container-low)) over a\n * raw computed color so the outlined label cutout transitions in sync with the rest\n * of the theme switch instead of lagging behind.\n *\n * @param containerEl The element that receives `--field-bg` as an inline style.\n * @param fieldBgProp Getter for the explicit `fieldBg` prop (overrides auto-detect).\n */\nexport function useFieldBg(\n containerEl: Ref<HTMLElement | null>,\n fieldBgProp: () => string | undefined,\n) {\n const detectedBg = ref<string>('var(--color-surface)')\n\n function applyFieldBg(value: string) {\n detectedBg.value = value\n containerEl.value?.style.setProperty('--field-bg', fieldBgProp() ?? value)\n }\n\n function resolveBg() {\n let el: HTMLElement | null = containerEl.value?.parentElement ?? null\n while (el) {\n const cssVar = findM3BgVar(el)\n if (cssVar) { applyFieldBg(cssVar); return }\n if (el === document.body) { applyFieldBg('var(--color-surface)'); return }\n const bg = getComputedStyle(el).backgroundColor\n if (!isTransparent(bg)) { applyFieldBg(bg); return }\n el = el.parentElement\n }\n applyFieldBg('var(--color-surface)')\n }\n\n let observer: MutationObserver | null = null\n\n onMounted(() => {\n resolveBg()\n observer = new MutationObserver(() => resolveBg())\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['class', 'style', 'data-theme'],\n })\n })\n\n onBeforeUnmount(() => observer?.disconnect())\n\n const resolvedFieldBg = computed(() => fieldBgProp() ?? detectedBg.value)\n\n return { resolvedFieldBg }\n}\n","import { getCurrentInstance, onBeforeUnmount, toValue, watch, type MaybeRefOrGetter, type WatchSource } from 'vue'\n\nexport interface AutoGrowOptions {\n /** Fewest rows it shrinks to (default 1) */\n minRows?: MaybeRefOrGetter<number | undefined>\n /** Most rows it grows to; past them it scrolls. Unset grows without limit */\n maxRows?: MaybeRefOrGetter<number | undefined>\n /**\n * The text, when it can change without typing (cleared after sending, an emoji inserted…): a ref or getter, so the\n * height follows. Typing is followed on its own\n */\n value?: WatchSource<unknown>\n}\n\n/**\n * Makes a `<textarea>` grow with its text, between `minRows` and `maxRows` rows, scrolling past the last one: a chat\n * composer, a comment box. Works on any textarea, styled however you like (rows are measured from its computed line\n * height, padding and border). It also follows width changes, which rewrap the text. Returns `resize()` for anything\n * else that changes the text.\n */\nexport function useAutoGrow(target: MaybeRefOrGetter<HTMLTextAreaElement | null | undefined>, options: AutoGrowOptions = {}) {\n let el: HTMLTextAreaElement | null = null\n let observer: ResizeObserver | null = null\n let lastWidth = 0\n\n function resize() {\n if (!el) return\n const cs = getComputedStyle(el)\n const px = (v: string) => parseFloat(v) || 0\n // `normal` line height has no number: about 1.5× the font size\n const lineHeight = px(cs.lineHeight) || px(cs.fontSize) * 1.5 || 24\n const padding = px(cs.paddingTop) + px(cs.paddingBottom)\n const border = cs.boxSizing === 'border-box' ? px(cs.borderTopWidth) + px(cs.borderBottomWidth) : 0\n const extra = (cs.boxSizing === 'border-box' ? padding : 0) + border\n const min = (toValue(options.minRows) ?? 1) * lineHeight + extra\n const maxRows = toValue(options.maxRows)\n const max = maxRows ? maxRows * lineHeight + extra : Infinity\n\n // Collapse first so scrollHeight measures the text, not the current height\n el.style.height = 'auto'\n const content = el.scrollHeight + border + (cs.boxSizing === 'border-box' ? 0 : -padding)\n const height = Math.min(max, Math.max(min, content))\n el.style.height = `${height}px`\n el.style.overflowY = content > max ? 'auto' : 'hidden'\n }\n\n function attach(next: HTMLTextAreaElement | null | undefined) {\n if (el) {\n el.removeEventListener('input', resize)\n observer?.disconnect()\n // Released (autoGrow turned off, another element): back to its own height\n el.style.height = ''\n el.style.overflowY = ''\n }\n el = next ?? null\n if (!el) return\n el.addEventListener('input', resize)\n if (typeof ResizeObserver !== 'undefined') {\n // Only width changes rewrap the text; our own height writes would otherwise loop\n observer ??= new ResizeObserver(([entry]) => {\n const w = entry!.contentRect.width\n if (w !== lastWidth) {\n lastWidth = w\n resize()\n }\n })\n observer.observe(el)\n }\n resize()\n }\n\n watch(() => toValue(target), attach, { immediate: true, flush: 'post' })\n watch([() => toValue(options.minRows), () => toValue(options.maxRows)], () => resize(), { flush: 'post' })\n if (options.value) watch(options.value, () => resize(), { flush: 'post' })\n if (getCurrentInstance()) onBeforeUnmount(() => attach(null))\n\n return { resize }\n}\n","import { onBeforeUnmount } from 'vue'\n\nexport function useDebounce(fn: (...args: any[]) => void, ms: number) {\n let timer: ReturnType<typeof setTimeout> | null = null\n\n function debounced(...args: any[]) {\n if (timer) clearTimeout(timer)\n timer = setTimeout(() => {\n timer = null\n fn(...args)\n }, ms)\n }\n\n function cancel() {\n if (timer) {\n clearTimeout(timer)\n timer = null\n }\n }\n\n onBeforeUnmount(cancel)\n\n return { debounced, cancel }\n}\n","import type { Directive } from 'vue'\n\n/**\n * Shared layout of the M3 text-field shell (internal, not exported from the package).\n *\n * Every field draws the same pieces: a 56px box, a label that floats from the middle of the box to its top\n * edge (filled) or onto the border (outlined), an optional leading icon and trailing buttons. The rules that\n * keep long content from running over those pieces live here, so a new field gets them by reusing this:\n *\n * - The label is inset from the right by as much as the box's own right padding (`right`), so it never runs\n * under a trailing button, floated (filled) or not. Floated on an outlined border, it shrinks to its own\n * text but stops 12px before the far corner, whatever its left offset (a leading icon moves it to 44px).\n * - A value shown as text in a fixed-height box (`FIELD_VALUE`) stays on one line and ends in \"…\", and\n * `vOverflowTitle` puts the whole of it in a tooltip only when it's cut. Screen readers get the full text\n * either way: the ellipsis is only visual.\n */\n\nexport type FieldVariant = 'filled' | 'outlined'\n\n/**\n * Right inset of the label, which must equal the field's right padding: `right-4` with nothing trailing,\n * `right-10` with a dropdown arrow, `right-12` with one trailing button, `right-16` with a clear button and\n * an arrow, `right-24` with two 32px buttons (MNumberField's stepper).\n */\nexport type FieldRightInset = 'right-4' | 'right-10' | 'right-12' | 'right-16' | 'right-24'\n\n/** Padding matching each inset, for the box itself */\nexport const FIELD_PADDING_RIGHT: Record<FieldRightInset, string> = {\n 'right-4': 'pr-4',\n 'right-10': 'pr-10',\n 'right-12': 'pr-12',\n 'right-16': 'pr-16',\n 'right-24': 'pr-24',\n}\n\n/** One line, cut with \"…\", allowed to shrink inside its flex row */\nexport const FIELD_VALUE = 'block min-w-0 flex-1 truncate'\n\nexport interface FieldLabelOptions {\n variant: FieldVariant\n /** There is a leading icon (the label starts after it) */\n leading?: boolean\n right: FieldRightInset\n /**\n * `true`/`false` when the component knows whether the label floats; `'peer'` to float it with CSS from\n * the preceding `.peer` input (focused, or its `placeholder=\" \"` not shown because it has a value)\n */\n floated: boolean | 'peer'\n /** Color classes (they depend on each component's notion of focus / error / disabled) */\n color: string\n}\n\nexport function fieldLabelClasses(o: FieldLabelOptions): string {\n const outlined = o.variant === 'outlined'\n const left = o.leading ? (outlined ? 'left-11' : 'left-12') : outlined ? 'left-3' : 'left-4'\n const base = ['pointer-events-none absolute truncate transition-all duration-200', left, o.right]\n const rest = outlined ? 'top-1/2 -translate-y-1/2 text-body-large' : 'top-[53%] -translate-y-1/2 text-body-large'\n\n if (o.floated === 'peer') {\n // Literal class names (Tailwind only sees complete strings)\n const floatedPeer = outlined\n ? o.leading\n ? '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%-3.5rem)] peer-focus:bg-[var(--field-bg)] peer-focus:px-1 ' +\n 'peer-[&:not(:placeholder-shown)]:-top-2.5 peer-[&:not(:placeholder-shown)]:translate-y-0 peer-[&:not(:placeholder-shown)]:text-label-small peer-[&:not(:placeholder-shown)]:right-auto peer-[&:not(:placeholder-shown)]:max-w-[calc(100%-3.5rem)] peer-[&:not(:placeholder-shown)]:bg-[var(--field-bg)] peer-[&:not(:placeholder-shown)]:px-1'\n : '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 ' +\n 'peer-[&:not(:placeholder-shown)]:-top-2.5 peer-[&:not(:placeholder-shown)]:translate-y-0 peer-[&:not(:placeholder-shown)]:text-label-small peer-[&:not(:placeholder-shown)]:right-auto peer-[&:not(:placeholder-shown)]:max-w-[calc(100%-1.5rem)] peer-[&:not(:placeholder-shown)]:bg-[var(--field-bg)] peer-[&:not(:placeholder-shown)]:px-1'\n : 'peer-focus:top-2 peer-focus:translate-y-0 peer-focus:text-label-small ' +\n 'peer-[&:not(:placeholder-shown)]:top-2 peer-[&:not(:placeholder-shown)]:translate-y-0 peer-[&:not(:placeholder-shown)]:text-label-small'\n return [...base, rest, floatedPeer, o.color].join(' ')\n }\n\n const floated = outlined\n ? `-top-2.5 translate-y-0 text-label-small bg-[var(--field-bg)] px-1 right-auto ${o.leading ? 'max-w-[calc(100%-3.5rem)]' : 'max-w-[calc(100%-1.5rem)]'}`\n : 'top-2 translate-y-0 text-label-small'\n return [...base, o.floated ? floated : rest, o.color].join(' ')\n}\n\n/** A label always floated on an outlined border (the picker triggers): cut before the far corner */\nexport const OUTLINED_FLOATED_LABEL =\n 'pointer-events-none absolute -top-2.5 left-3 max-w-[calc(100%-1.5rem)] truncate bg-(--field-bg) px-1 text-label-small'\n\nfunction fullText(el: HTMLElement): string {\n // By tag, not instanceof: the element may come from another realm (an iframe, a test DOM)\n return el.tagName === 'INPUT' || el.tagName === 'TEXTAREA'\n ? (el as HTMLInputElement).value\n : (el.textContent ?? '').trim()\n}\n\nfunction updateTitle(el: HTMLElement) {\n const cut = el.scrollWidth > el.clientWidth\n const text = cut ? fullText(el) : ''\n if (text) el.title = text\n else el.removeAttribute('title')\n}\n\nconst hoverHandlers = new WeakMap<HTMLElement, () => void>()\n\n/**\n * Puts the element's whole text (an input's value, or its text content) in `title` while it's cut by\n * overflow, measured when the pointer comes in, so a value that fits gets no redundant tooltip.\n */\nexport const vOverflowTitle: Directive<HTMLElement> = {\n mounted(el) {\n const handler = () => updateTitle(el)\n hoverHandlers.set(el, handler)\n el.addEventListener('pointerenter', handler)\n },\n updated(el) {\n // A value changed while hovered: keep the tooltip in step\n if (el.hasAttribute('title')) updateTitle(el)\n },\n beforeUnmount(el) {\n const handler = hoverHandlers.get(el)\n if (handler) el.removeEventListener('pointerenter', handler)\n hoverHandlers.delete(el)\n },\n}\n","<script setup lang=\"ts\">\n/**\n * The standard single- or multi-line text input, filled or outlined, with floating label.\n *\n * @slot trailing Custom trailing content (e.g. an icon button) — replaces the built-in clear button when\n * present\n * @event update:modelValue Emitted on every keystroke — powers v-model\n * @event debounced Emitted debounce ms after the user stops typing (only when debounce > 0)\n */\nimport { computed, ref, useId, useSlots } from \"vue\";\nimport MIcon from \"./MIcon.vue\";\nimport { useAutoGrow } from \"../composables/useAutoGrow\";\nimport { useFieldBg } from \"../composables/useFieldBg\";\nimport { useDebounce } from \"../composables/useDebounce\";\nimport { useLocale } from '../composables/useLocale'\nimport { FIELD_PADDING_RIGHT, fieldLabelClasses, vOverflowTitle, type FieldRightInset } from '../composables/_fieldLayout'\n\nconst locale = useLocale()\nconst props = withDefaults(\n defineProps<{\n /** Bound value (v-model) */\n modelValue: string | number;\n /** Field label */\n label: string;\n /** HTML input type */\n type?: string;\n /** Visual style */\n variant?: \"filled\" | \"outlined\";\n /** Puts the field in error state (red border and label) */\n error?: boolean;\n /** Error message shown below the field (only visible when error is true) */\n errorLabel?: string;\n /** Hint text shown below the field */\n hint?: string;\n /** Disables the field */\n disabled?: boolean;\n /** Marks as required — adds a red asterisk after the label */\n required?: boolean;\n /** Renders a textarea instead of an input */\n multiline?: boolean;\n /** Textarea rows (when multiline); with autoGrow, the fewest it shrinks to */\n rows?: number;\n /** Multiline only: grows with the text from `rows` up to `maxRows`, instead of a fixed height with a drag handle */\n autoGrow?: boolean;\n /** With autoGrow, the most rows it grows to before scrolling. Unset grows without limit */\n maxRows?: number;\n /** Passed through to the native autocomplete attribute */\n autocomplete?: string;\n /** Material Symbol shown before the input */\n leadingIcon?: string;\n /** Show a clear button when the field has a value */\n clearable?: boolean;\n /**\n * Overrides the auto-detected background color used to cut the floating label out of the outlined border\n */\n fieldBg?: string;\n /** Delay (ms) before firing the @debounced event. v-model always updates immediately */\n debounce?: number;\n }>(),\n {\n type: \"text\",\n variant: \"filled\",\n rows: 3,\n clearable: false,\n debounce: 0,\n },\n);\n\nconst emit = defineEmits<{ \"update:modelValue\": [string]; debounced: [string] }>();\n\nconst id = useId();\nconst slots = useSlots();\n\nconst fieldBgEl = ref<HTMLElement | null>(null);\nconst { resolvedFieldBg } = useFieldBg(fieldBgEl, () => props.fieldBg);\n\nconst { debounced: emitDebounced, cancel: cancelDebounce } = useDebounce((v: string) => emit(\"debounced\", v), props.debounce)\n\nconst textareaEl = ref<HTMLTextAreaElement | null>(null);\nconst inputOnlyEl = ref<HTMLInputElement | null>(null);\nconst fieldEl = computed(() => textareaEl.value ?? inputOnlyEl.value);\nuseAutoGrow(() => (props.multiline && props.autoGrow ? textareaEl.value : null), {\n minRows: () => props.rows,\n maxRows: () => props.maxRows,\n value: () => props.modelValue,\n});\n\nconst showClear = computed(() => props.clearable && String(props.modelValue).length > 0 && !props.disabled)\n\n// The label and the text both stop before a trailing button (the #trailing slot or the clear button)\nconst rightInset = computed<FieldRightInset>(() => (slots.trailing || props.clearable ? \"right-12\" : \"right-4\"));\n\nconst inputClasses = computed(() => {\n const pl = props.leadingIcon ? \"pl-12\" : \"pl-4\";\n const pr = FIELD_PADDING_RIGHT[rightInset.value];\n const size = props.multiline ? (props.autoGrow ? \"resize-none min-h-[56px]\" : \"resize-y min-h-[56px]\") : \"h-14\";\n const base = [\n \"peer block w-full text-body-large text-on-surface outline-none placeholder:text-transparent\",\n \"transition-[border-color,border-width] duration-150\",\n \"disabled:cursor-not-allowed disabled:text-on-surface/38\",\n props.error ? \"caret-error\" : \"caret-primary\",\n size,\n pl,\n pr,\n ];\n\n if (props.variant === \"outlined\") {\n return [\n ...base,\n \"rounded-xs border bg-transparent py-4\",\n props.error\n ? \"border-error focus:border-2 focus:border-error\"\n : \"border-outline hover:border-on-surface focus:border-2 focus:border-primary\",\n \"disabled:border-on-surface/12\",\n ].join(\" \");\n }\n\n return [\n ...base,\n // Multiline: the label's 24px band is a transparent top border rather than padding, so text scrolled up is\n // clipped below the label (at the padding box) instead of running behind it; the background still fills it\n props.multiline\n ? \"rounded-t-xs bg-surface-container-highest border-b border-t-24 border-t-transparent pb-2\"\n : \"rounded-t-xs bg-surface-container-highest border-b pt-6 pb-2\",\n props.error\n ? \"border-b-error focus:border-b-2 focus:border-b-error\"\n : \"border-b-on-surface-variant hover:border-b-on-surface focus:border-b-2 focus:border-b-primary\",\n \"disabled:border-b-on-surface/38 disabled:bg-[color-mix(in_srgb,var(--color-on-surface)_4%,var(--color-surface-container-highest))]\",\n ].join(\" \");\n});\n\nconst labelClasses = computed(() =>\n fieldLabelClasses({\n variant: props.variant,\n leading: !!props.leadingIcon,\n right: rightInset.value,\n floated: 'peer',\n color: [\n props.error ? 'text-error peer-focus:text-error' : 'text-on-surface-variant peer-focus:text-primary',\n 'peer-disabled:text-on-surface/38',\n ].join(' '),\n }),\n);\n\nfunction onInput(event: Event) {\n const target = event.target as HTMLInputElement | HTMLTextAreaElement;\n emit(\"update:modelValue\", target.value);\n if (props.debounce > 0) emitDebounced(target.value)\n}\n\ndefineExpose({\n /** The `<input>` (or `<textarea>`) element */\n inputEl: fieldEl,\n /** Focuses the field */\n focus: (options?: FocusOptions) => fieldEl.value?.focus(options),\n /** Takes focus away from the field */\n blur: () => fieldEl.value?.blur(),\n /** Selects all its text */\n select: () => fieldEl.value?.select(),\n /** Selects part of its text (e.g. a file name without its extension) */\n setSelectionRange: (start: number, end: number, direction?: 'forward' | 'backward' | 'none') => fieldEl.value?.setSelectionRange(start, end, direction),\n})\n</script>\n\n<template>\n <div class=\"flex flex-col gap-1\">\n <!--\n --field-bg: background behind the floating label in outlined mode, so it\n \"cuts through\" the border. Auto-detected from the nearest opaque ancestor\n (see resolveBg); overridable via the fieldBg prop; falls back to surface.\n -->\n <div\n ref=\"fieldBgEl\"\n class=\"relative\"\n :class=\"variant === 'outlined' ? 'mt-2' : ''\"\n :style=\"variant === 'outlined' ? { '--field-bg': resolvedFieldBg } : undefined\"\n >\n <div\n v-if=\"leadingIcon\"\n class=\"pointer-events-none absolute left-3.5\"\n :class=\"[\n multiline ? 'top-[55%] -translate-y-1/2' : variant === 'filled' ? 'top-4.5' : 'top-4',\n disabled ? 'text-on-surface/38' : 'text-on-surface-variant',\n ]\"\n >\n <MIcon :name=\"leadingIcon\" :size=\"24\" />\n </div>\n\n <textarea\n v-if=\"multiline\"\n ref=\"textareaEl\"\n :id=\"id\"\n :value=\"String(modelValue)\"\n :rows=\"rows\"\n :disabled=\"disabled\"\n :required=\"required\"\n placeholder=\" \"\n :class=\"inputClasses\"\n @input=\"onInput\"\n />\n <input\n v-else\n ref=\"inputOnlyEl\"\n :id=\"id\"\n :type=\"type\"\n :value=\"modelValue\"\n :disabled=\"disabled\"\n :required=\"required\"\n :autocomplete=\"autocomplete\"\n placeholder=\" \"\n :class=\"inputClasses\"\n v-overflow-title\n @input=\"onInput\"\n />\n\n <label :for=\"id\" :class=\"labelClasses\">\n {{ label }}<span v-if=\"required\" class=\"text-error\"> *</span>\n </label>\n\n <div v-if=\"$slots.trailing\" class=\"absolute right-2 top-1/2 -translate-y-1/2\">\n <slot name=\"trailing\" />\n </div>\n <button\n :aria-label=\"locale.clear\"\n v-else-if=\"showClear\"\n type=\"button\"\n 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\"\n @click=\"cancelDebounce(); emit('update:modelValue', '')\"\n >\n <MIcon name=\"close\" :size=\"18\" />\n </button>\n </div>\n\n <p v-if=\"error && errorLabel\" class=\"px-4 text-body-small text-error\">{{ errorLabel }}</p>\n <p v-else-if=\"hint\" class=\"px-4 text-body-small text-on-surface-variant\">{{ hint }}</p>\n </div>\n</template>\n"],"mappings":";;;;AAEA,IAAMe,IAAgB;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,SAASC,EAAY,GAAgC;CACnD,KAAK,IAAMC,KAAOF,GAChB,IAAIG,EAAG,UAAU,SAASD,CAAG,GAAG,OAAO,eAAeA,EAAI,MAAM,CAAC,EAAE;CAErE,OAAO;AACT;AAEA,SAASE,EAAc,GAAwB;CAC7C,IAAI,CAACC,KAASA,MAAU,eAAe,OAAO;CAC9C,IAAMC,IAAID,EAAM,MAAM,oBAAoB;CAC1C,IAAIC,GAAG;EACL,IAAMC,IAAQD,EAAE,EAAE,CAAE,MAAM,GAAG,CAAC,CAAC,KAAK,MAAME,EAAE,KAAK,CAAC;EAClD,IAAID,EAAM,WAAW,KAAK,WAAWA,EAAM,EAAG,MAAM,GAAG,OAAO;CAChE;CACA,OAAO;AACT;AAWA,SAAgBE,EACd,GACA,GACA;CACA,IAAMC,IAAaC,EAAY,sBAAsB;CAErD,SAASC,EAAa,GAAe;EAEnC,AADA,EAAW,QAAQC,GACnBC,EAAY,OAAO,MAAM,YAAY,cAAcC,EAAY,KAAKF,CAAK;CAC3E;CAEA,SAASG,IAAY;EACnB,IAAIb,I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,MAAM;;E,OAItB4F,EAAA,SAASA,EAAA,cAAlBnG,EAAA,GAAAC,EAA0F,KAA1F0F,GAA0FjF,EAAjByF,EAAA,UAAU,GAAA,CAAA,KACrEA,EAAA,QAAdnG,EAAA,GAAAC,EAAuF,KAAvF2F,GAAuFlF,EAAXyF,EAAA,IAAI,GAAA,CAAA,K"}
|
|
1
|
+
{"version":3,"file":"MTextField-CNH-byir.js","names":["$slots","_openBlock","_createElementBlock","_createElementVNode","_normalizeClass","_normalizeStyle","_unref","_createVNode","MIcon","_withDirectives","_createTextVNode","_toDisplayString","_renderSlot","MIcon_default","useLocale","M3_BG_CLASSES","findM3BgVar","cls","el","isTransparent","color","m","parts","s","useFieldBg","detectedBg","ref","applyFieldBg","value","containerEl","fieldBgProp","resolveBg","cssVar","bg","observer","onMounted","onBeforeUnmount","computed","useAutoGrow","lastWidth","resize","cs","px","v","lineHeight","padding","border","extra","min","toValue","options","maxRows","max","content","height","attach","next","entry","w","watch","target","getCurrentInstance","useDebounce","timer","debounced","args","fn","ms","cancel","FIELD_PADDING_RIGHT","FIELD_VALUE","fieldLabelClasses","outlined","o","base","rest","floatedPeer","floated","OUTLINED_FLOATED_LABEL","fullText","updateTitle","text","hoverHandlers","vOverflowTitle","handler","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","MTextField_default","defineComponent","__expose","__emit","locale","props","__props","emit","id","useId","slots","useSlots","fieldBgEl","emitDebounced","cancelDebounce","textareaEl","inputOnlyEl","fieldEl","showClear","rightInset","inputClasses","pl","pr","size","labelClasses","onInput","event","start","end","direction","openBlock","createElementBlock","createElementVNode","normalizeClass","normalizeStyle","unref","resolvedFieldBg","createVNode","createCommentVNode","withDirectives","createTextVNode","toDisplayString","_ctx","renderSlot","_cache"],"sources":["../src/composables/useFieldBg.ts","../src/composables/useAutoGrow.ts","../src/composables/useDebounce.ts","../src/composables/_fieldLayout.ts","../src/components/MTextField.vue"],"sourcesContent":["import { ref, computed, onMounted, onBeforeUnmount, type Ref } from 'vue'\n\nconst M3_BG_CLASSES = [\n 'bg-surface-container-highest',\n 'bg-surface-container-high',\n 'bg-surface-container-low',\n 'bg-surface-container-lowest',\n 'bg-surface-container',\n 'bg-surface-variant',\n 'bg-surface-bright',\n 'bg-surface-dim',\n 'bg-surface',\n 'bg-background',\n 'bg-inverse-surface',\n 'bg-primary-container',\n 'bg-secondary-container',\n 'bg-tertiary-container',\n 'bg-error-container',\n 'bg-primary-fixed',\n 'bg-primary-fixed-dim',\n 'bg-secondary-fixed',\n 'bg-secondary-fixed-dim',\n 'bg-tertiary-fixed',\n 'bg-tertiary-fixed-dim',\n 'bg-primary',\n 'bg-secondary',\n 'bg-tertiary',\n 'bg-error',\n] as const\n\nfunction findM3BgVar(el: HTMLElement): string | null {\n for (const cls of M3_BG_CLASSES) {\n if (el.classList.contains(cls)) return `var(--color-${cls.slice(3)})`\n }\n return null\n}\n\nfunction isTransparent(color: string): boolean {\n if (!color || color === 'transparent') return true\n const m = color.match(/^rgba?\\(([^)]+)\\)$/)\n if (m) {\n const parts = m[1]!.split(',').map((s) => s.trim())\n if (parts.length === 4 && parseFloat(parts[3]!) === 0) return true\n }\n return false\n}\n\n/**\n * Auto-detects the background behind `containerEl` and exposes it as `--field-bg`.\n * Prefers a CSS variable reference (e.g. var(--color-surface-container-low)) over a\n * raw computed color so the outlined label cutout transitions in sync with the rest\n * of the theme switch instead of lagging behind.\n *\n * @param containerEl The element that receives `--field-bg` as an inline style.\n * @param fieldBgProp Getter for the explicit `fieldBg` prop (overrides auto-detect).\n */\nexport function useFieldBg(\n containerEl: Ref<HTMLElement | null>,\n fieldBgProp: () => string | undefined,\n) {\n const detectedBg = ref<string>('var(--color-surface)')\n\n function applyFieldBg(value: string) {\n detectedBg.value = value\n containerEl.value?.style.setProperty('--field-bg', fieldBgProp() ?? value)\n }\n\n function resolveBg() {\n let el: HTMLElement | null = containerEl.value?.parentElement ?? null\n while (el) {\n const cssVar = findM3BgVar(el)\n if (cssVar) { applyFieldBg(cssVar); return }\n if (el === document.body) { applyFieldBg('var(--color-surface)'); return }\n const bg = getComputedStyle(el).backgroundColor\n if (!isTransparent(bg)) { applyFieldBg(bg); return }\n el = el.parentElement\n }\n applyFieldBg('var(--color-surface)')\n }\n\n let observer: MutationObserver | null = null\n\n onMounted(() => {\n resolveBg()\n observer = new MutationObserver(() => resolveBg())\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['class', 'style', 'data-theme'],\n })\n })\n\n onBeforeUnmount(() => observer?.disconnect())\n\n const resolvedFieldBg = computed(() => fieldBgProp() ?? detectedBg.value)\n\n return { resolvedFieldBg }\n}\n","import { getCurrentInstance, onBeforeUnmount, toValue, watch, type MaybeRefOrGetter, type WatchSource } from 'vue'\n\nexport interface AutoGrowOptions {\n /** Fewest rows it shrinks to (default 1) */\n minRows?: MaybeRefOrGetter<number | undefined>\n /** Most rows it grows to; past them it scrolls. Unset grows without limit */\n maxRows?: MaybeRefOrGetter<number | undefined>\n /**\n * The text, when it can change without typing (cleared after sending, an emoji inserted…): a ref or getter, so the\n * height follows. Typing is followed on its own\n */\n value?: WatchSource<unknown>\n}\n\n/**\n * Makes a `<textarea>` grow with its text, between `minRows` and `maxRows` rows, scrolling past the last one: a chat\n * composer, a comment box. Works on any textarea, styled however you like (rows are measured from its computed line\n * height, padding and border). It also follows width changes, which rewrap the text. Returns `resize()` for anything\n * else that changes the text.\n */\nexport function useAutoGrow(target: MaybeRefOrGetter<HTMLTextAreaElement | null | undefined>, options: AutoGrowOptions = {}) {\n let el: HTMLTextAreaElement | null = null\n let observer: ResizeObserver | null = null\n let lastWidth = 0\n\n function resize() {\n if (!el) return\n const cs = getComputedStyle(el)\n const px = (v: string) => parseFloat(v) || 0\n // `normal` line height has no number: about 1.5× the font size\n const lineHeight = px(cs.lineHeight) || px(cs.fontSize) * 1.5 || 24\n const padding = px(cs.paddingTop) + px(cs.paddingBottom)\n const border = cs.boxSizing === 'border-box' ? px(cs.borderTopWidth) + px(cs.borderBottomWidth) : 0\n const extra = (cs.boxSizing === 'border-box' ? padding : 0) + border\n const min = (toValue(options.minRows) ?? 1) * lineHeight + extra\n const maxRows = toValue(options.maxRows)\n const max = maxRows ? maxRows * lineHeight + extra : Infinity\n\n // Collapse first so scrollHeight measures the text, not the current height\n el.style.height = 'auto'\n const content = el.scrollHeight + border + (cs.boxSizing === 'border-box' ? 0 : -padding)\n const height = Math.min(max, Math.max(min, content))\n el.style.height = `${height}px`\n el.style.overflowY = content > max ? 'auto' : 'hidden'\n }\n\n function attach(next: HTMLTextAreaElement | null | undefined) {\n if (el) {\n el.removeEventListener('input', resize)\n observer?.disconnect()\n // Released (autoGrow turned off, another element): back to its own height\n el.style.height = ''\n el.style.overflowY = ''\n }\n el = next ?? null\n if (!el) return\n el.addEventListener('input', resize)\n if (typeof ResizeObserver !== 'undefined') {\n // Only width changes rewrap the text; our own height writes would otherwise loop\n observer ??= new ResizeObserver(([entry]) => {\n const w = entry!.contentRect.width\n if (w !== lastWidth) {\n lastWidth = w\n resize()\n }\n })\n observer.observe(el)\n }\n resize()\n }\n\n watch(() => toValue(target), attach, { immediate: true, flush: 'post' })\n watch([() => toValue(options.minRows), () => toValue(options.maxRows)], () => resize(), { flush: 'post' })\n if (options.value) watch(options.value, () => resize(), { flush: 'post' })\n if (getCurrentInstance()) onBeforeUnmount(() => attach(null))\n\n return { resize }\n}\n","import { onBeforeUnmount } from 'vue'\n\nexport function useDebounce(fn: (...args: any[]) => void, ms: number) {\n let timer: ReturnType<typeof setTimeout> | null = null\n\n function debounced(...args: any[]) {\n if (timer) clearTimeout(timer)\n timer = setTimeout(() => {\n timer = null\n fn(...args)\n }, ms)\n }\n\n function cancel() {\n if (timer) {\n clearTimeout(timer)\n timer = null\n }\n }\n\n onBeforeUnmount(cancel)\n\n return { debounced, cancel }\n}\n","import type { Directive } from 'vue'\n\n/**\n * Shared layout of the M3 text-field shell (internal, not exported from the package).\n *\n * Every field draws the same pieces: a 56px box, a label that floats from the middle of the box to its top\n * edge (filled) or onto the border (outlined), an optional leading icon and trailing buttons. The rules that\n * keep long content from running over those pieces live here, so a new field gets them by reusing this:\n *\n * - The label is inset from the right by as much as the box's own right padding (`right`), so it never runs\n * under a trailing button, floated (filled) or not. Floated on an outlined border, it shrinks to its own\n * text but stops 12px before the far corner, whatever its left offset (a leading icon moves it to 44px).\n * - A value shown as text in a fixed-height box (`FIELD_VALUE`) stays on one line and ends in \"…\", and\n * `vOverflowTitle` puts the whole of it in a tooltip only when it's cut. Screen readers get the full text\n * either way: the ellipsis is only visual.\n */\n\nexport type FieldVariant = 'filled' | 'outlined'\n\n/**\n * Right inset of the label, which must equal the field's right padding: `right-4` with nothing trailing,\n * `right-10` with a dropdown arrow, `right-12` with one trailing button, `right-16` with a clear button and\n * an arrow, `right-24` with two 32px buttons (MNumberField's stepper).\n */\nexport type FieldRightInset = 'right-4' | 'right-10' | 'right-12' | 'right-16' | 'right-24'\n\n/** Padding matching each inset, for the box itself */\nexport const FIELD_PADDING_RIGHT: Record<FieldRightInset, string> = {\n 'right-4': 'pr-4',\n 'right-10': 'pr-10',\n 'right-12': 'pr-12',\n 'right-16': 'pr-16',\n 'right-24': 'pr-24',\n}\n\n/** One line, cut with \"…\", allowed to shrink inside its flex row */\nexport const FIELD_VALUE = 'block min-w-0 flex-1 truncate'\n\nexport interface FieldLabelOptions {\n variant: FieldVariant\n /** There is a leading icon (the label starts after it) */\n leading?: boolean\n right: FieldRightInset\n /**\n * `true`/`false` when the component knows whether the label floats; `'peer'` to float it with CSS from\n * the preceding `.peer` input (focused, or its `placeholder=\" \"` not shown because it has a value)\n */\n floated: boolean | 'peer'\n /** Color classes (they depend on each component's notion of focus / error / disabled) */\n color: string\n}\n\nexport function fieldLabelClasses(o: FieldLabelOptions): string {\n const outlined = o.variant === 'outlined'\n const left = o.leading ? (outlined ? 'left-11' : 'left-12') : outlined ? 'left-3' : 'left-4'\n const base = ['pointer-events-none absolute truncate transition-all duration-200', left, o.right]\n const rest = outlined ? 'top-1/2 -translate-y-1/2 text-body-large' : 'top-[53%] -translate-y-1/2 text-body-large'\n\n if (o.floated === 'peer') {\n // Literal class names (Tailwind only sees complete strings)\n const floatedPeer = outlined\n ? o.leading\n ? '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%-3.5rem)] peer-focus:bg-[var(--field-bg)] peer-focus:px-1 ' +\n 'peer-[&:not(:placeholder-shown)]:-top-2.5 peer-[&:not(:placeholder-shown)]:translate-y-0 peer-[&:not(:placeholder-shown)]:text-label-small peer-[&:not(:placeholder-shown)]:right-auto peer-[&:not(:placeholder-shown)]:max-w-[calc(100%-3.5rem)] peer-[&:not(:placeholder-shown)]:bg-[var(--field-bg)] peer-[&:not(:placeholder-shown)]:px-1'\n : '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 ' +\n 'peer-[&:not(:placeholder-shown)]:-top-2.5 peer-[&:not(:placeholder-shown)]:translate-y-0 peer-[&:not(:placeholder-shown)]:text-label-small peer-[&:not(:placeholder-shown)]:right-auto peer-[&:not(:placeholder-shown)]:max-w-[calc(100%-1.5rem)] peer-[&:not(:placeholder-shown)]:bg-[var(--field-bg)] peer-[&:not(:placeholder-shown)]:px-1'\n : 'peer-focus:top-2 peer-focus:translate-y-0 peer-focus:text-label-small ' +\n 'peer-[&:not(:placeholder-shown)]:top-2 peer-[&:not(:placeholder-shown)]:translate-y-0 peer-[&:not(:placeholder-shown)]:text-label-small'\n return [...base, rest, floatedPeer, o.color].join(' ')\n }\n\n const floated = outlined\n ? `-top-2.5 translate-y-0 text-label-small bg-[var(--field-bg)] px-1 right-auto ${o.leading ? 'max-w-[calc(100%-3.5rem)]' : 'max-w-[calc(100%-1.5rem)]'}`\n : 'top-2 translate-y-0 text-label-small'\n return [...base, o.floated ? floated : rest, o.color].join(' ')\n}\n\n/** A label always floated on an outlined border (the picker triggers): cut before the far corner */\nexport const OUTLINED_FLOATED_LABEL =\n 'pointer-events-none absolute -top-2.5 left-3 max-w-[calc(100%-1.5rem)] truncate bg-(--field-bg) px-1 text-label-small'\n\nfunction fullText(el: HTMLElement): string {\n // By tag, not instanceof: the element may come from another realm (an iframe, a test DOM)\n return el.tagName === 'INPUT' || el.tagName === 'TEXTAREA'\n ? (el as HTMLInputElement).value\n : (el.textContent ?? '').trim()\n}\n\nfunction updateTitle(el: HTMLElement) {\n const cut = el.scrollWidth > el.clientWidth\n const text = cut ? fullText(el) : ''\n if (text) el.title = text\n else el.removeAttribute('title')\n}\n\nconst hoverHandlers = new WeakMap<HTMLElement, () => void>()\n\n/**\n * Puts the element's whole text (an input's value, or its text content) in `title` while it's cut by\n * overflow, measured when the pointer comes in, so a value that fits gets no redundant tooltip.\n */\nexport const vOverflowTitle: Directive<HTMLElement> = {\n mounted(el) {\n const handler = () => updateTitle(el)\n hoverHandlers.set(el, handler)\n el.addEventListener('pointerenter', handler)\n },\n updated(el) {\n // A value changed while hovered: keep the tooltip in step\n if (el.hasAttribute('title')) updateTitle(el)\n },\n beforeUnmount(el) {\n const handler = hoverHandlers.get(el)\n if (handler) el.removeEventListener('pointerenter', handler)\n hoverHandlers.delete(el)\n },\n}\n","<script setup lang=\"ts\">\n/**\n * The standard single- or multi-line text input, filled or outlined, with floating label.\n *\n * @slot trailing Custom trailing content (e.g. an icon button) — replaces the built-in clear button when\n * present\n * @event update:modelValue Emitted on every keystroke — powers v-model\n * @event debounced Emitted debounce ms after the user stops typing (only when debounce > 0)\n */\nimport { computed, ref, useId, useSlots } from \"vue\";\nimport MIcon from \"./MIcon.vue\";\nimport { useAutoGrow } from \"../composables/useAutoGrow\";\nimport { useFieldBg } from \"../composables/useFieldBg\";\nimport { useDebounce } from \"../composables/useDebounce\";\nimport { useLocale } from '../composables/useLocale'\nimport { FIELD_PADDING_RIGHT, fieldLabelClasses, vOverflowTitle, type FieldRightInset } from '../composables/_fieldLayout'\n\nconst locale = useLocale()\nconst props = withDefaults(\n defineProps<{\n /** Bound value (v-model) */\n modelValue: string | number;\n /** Field label */\n label: string;\n /** HTML input type */\n type?: string;\n /** Visual style */\n variant?: \"filled\" | \"outlined\";\n /** Puts the field in error state (red border and label) */\n error?: boolean;\n /** Error message shown below the field (only visible when error is true) */\n errorLabel?: string;\n /** Hint text shown below the field */\n hint?: string;\n /** Disables the field */\n disabled?: boolean;\n /** Marks as required — adds a red asterisk after the label */\n required?: boolean;\n /** Renders a textarea instead of an input */\n multiline?: boolean;\n /** Textarea rows (when multiline); with autoGrow, the fewest it shrinks to */\n rows?: number;\n /** Multiline only: grows with the text from `rows` up to `maxRows`, instead of a fixed height with a drag handle */\n autoGrow?: boolean;\n /** With autoGrow, the most rows it grows to before scrolling. Unset grows without limit */\n maxRows?: number;\n /** Passed through to the native autocomplete attribute */\n autocomplete?: string;\n /** Material Symbol shown before the input */\n leadingIcon?: string;\n /** Show a clear button when the field has a value */\n clearable?: boolean;\n /**\n * Overrides the auto-detected background color used to cut the floating label out of the outlined border\n */\n fieldBg?: string;\n /** Delay (ms) before firing the @debounced event. v-model always updates immediately */\n debounce?: number;\n }>(),\n {\n type: \"text\",\n variant: \"filled\",\n rows: 3,\n clearable: false,\n debounce: 0,\n },\n);\n\nconst emit = defineEmits<{ \"update:modelValue\": [string]; debounced: [string] }>();\n\nconst id = useId();\nconst slots = useSlots();\n\nconst fieldBgEl = ref<HTMLElement | null>(null);\nconst { resolvedFieldBg } = useFieldBg(fieldBgEl, () => props.fieldBg);\n\nconst { debounced: emitDebounced, cancel: cancelDebounce } = useDebounce((v: string) => emit(\"debounced\", v), props.debounce)\n\nconst textareaEl = ref<HTMLTextAreaElement | null>(null);\nconst inputOnlyEl = ref<HTMLInputElement | null>(null);\nconst fieldEl = computed(() => textareaEl.value ?? inputOnlyEl.value);\nuseAutoGrow(() => (props.multiline && props.autoGrow ? textareaEl.value : null), {\n minRows: () => props.rows,\n maxRows: () => props.maxRows,\n value: () => props.modelValue,\n});\n\nconst showClear = computed(() => props.clearable && String(props.modelValue).length > 0 && !props.disabled)\n\n// The label and the text both stop before a trailing button (the #trailing slot or the clear button)\nconst rightInset = computed<FieldRightInset>(() => (slots.trailing || props.clearable ? \"right-12\" : \"right-4\"));\n\nconst inputClasses = computed(() => {\n const pl = props.leadingIcon ? \"pl-12\" : \"pl-4\";\n const pr = FIELD_PADDING_RIGHT[rightInset.value];\n const size = props.multiline ? (props.autoGrow ? \"resize-none min-h-[56px]\" : \"resize-y min-h-[56px]\") : \"h-14\";\n const base = [\n \"peer block w-full text-body-large text-on-surface outline-none placeholder:text-transparent\",\n \"transition-[border-color,border-width] duration-150\",\n \"disabled:cursor-not-allowed disabled:text-on-surface/38\",\n props.error ? \"caret-error\" : \"caret-primary\",\n size,\n pl,\n pr,\n ];\n\n if (props.variant === \"outlined\") {\n return [\n ...base,\n \"rounded-xs border bg-transparent py-4\",\n props.error\n ? \"border-error focus:border-2 focus:border-error\"\n : \"border-outline hover:border-on-surface focus:border-2 focus:border-primary\",\n \"disabled:border-on-surface/12\",\n ].join(\" \");\n }\n\n return [\n ...base,\n // Multiline: the label's 24px band is a transparent top border rather than padding, so text scrolled up is\n // clipped below the label (at the padding box) instead of running behind it; the background still fills it\n props.multiline\n ? \"rounded-t-xs bg-surface-container-highest border-b border-t-24 border-t-transparent pb-2\"\n : \"rounded-t-xs bg-surface-container-highest border-b pt-6 pb-2\",\n props.error\n ? \"border-b-error focus:border-b-2 focus:border-b-error\"\n : \"border-b-on-surface-variant hover:border-b-on-surface focus:border-b-2 focus:border-b-primary\",\n \"disabled:border-b-on-surface/38 disabled:bg-[color-mix(in_srgb,var(--color-on-surface)_4%,var(--color-surface-container-highest))]\",\n ].join(\" \");\n});\n\nconst labelClasses = computed(() =>\n fieldLabelClasses({\n variant: props.variant,\n leading: !!props.leadingIcon,\n right: rightInset.value,\n floated: 'peer',\n color: [\n props.error ? 'text-error peer-focus:text-error' : 'text-on-surface-variant peer-focus:text-primary',\n 'peer-disabled:text-on-surface/38',\n ].join(' '),\n }),\n);\n\nfunction onInput(event: Event) {\n const target = event.target as HTMLInputElement | HTMLTextAreaElement;\n emit(\"update:modelValue\", target.value);\n if (props.debounce > 0) emitDebounced(target.value)\n}\n\ndefineExpose({\n /** The `<input>` (or `<textarea>`) element */\n inputEl: fieldEl,\n /** Focuses the field */\n focus: (options?: FocusOptions) => fieldEl.value?.focus(options),\n /** Takes focus away from the field */\n blur: () => fieldEl.value?.blur(),\n /** Selects all its text */\n select: () => fieldEl.value?.select(),\n /** Selects part of its text (e.g. a file name without its extension) */\n setSelectionRange: (start: number, end: number, direction?: 'forward' | 'backward' | 'none') => fieldEl.value?.setSelectionRange(start, end, direction),\n})\n</script>\n\n<template>\n <div class=\"flex flex-col gap-1\">\n <!--\n --field-bg: background behind the floating label in outlined mode, so it\n \"cuts through\" the border. Auto-detected from the nearest opaque ancestor\n (see resolveBg); overridable via the fieldBg prop; falls back to surface.\n -->\n <div\n ref=\"fieldBgEl\"\n class=\"relative\"\n :class=\"variant === 'outlined' ? 'mt-2' : ''\"\n :style=\"variant === 'outlined' ? { '--field-bg': resolvedFieldBg } : undefined\"\n >\n <div\n v-if=\"leadingIcon\"\n class=\"pointer-events-none absolute left-3.5\"\n :class=\"[\n multiline ? 'top-[55%] -translate-y-1/2' : variant === 'filled' ? 'top-4.5' : 'top-4',\n disabled ? 'text-on-surface/38' : 'text-on-surface-variant',\n ]\"\n >\n <MIcon :name=\"leadingIcon\" :size=\"24\" />\n </div>\n\n <textarea\n v-if=\"multiline\"\n ref=\"textareaEl\"\n :id=\"id\"\n :value=\"String(modelValue)\"\n :rows=\"rows\"\n :disabled=\"disabled\"\n :required=\"required\"\n placeholder=\" \"\n :class=\"inputClasses\"\n @input=\"onInput\"\n />\n <input\n v-else\n ref=\"inputOnlyEl\"\n :id=\"id\"\n :type=\"type\"\n :value=\"modelValue\"\n :disabled=\"disabled\"\n :required=\"required\"\n :autocomplete=\"autocomplete\"\n placeholder=\" \"\n :class=\"inputClasses\"\n v-overflow-title\n @input=\"onInput\"\n />\n\n <label :for=\"id\" :class=\"labelClasses\">\n {{ label }}<span v-if=\"required\" class=\"text-error\"> *</span>\n </label>\n\n <div v-if=\"$slots.trailing\" class=\"absolute right-2 top-1/2 -translate-y-1/2\">\n <slot name=\"trailing\" />\n </div>\n <button\n :aria-label=\"locale.clear\"\n v-else-if=\"showClear\"\n type=\"button\"\n 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\"\n @click=\"cancelDebounce(); emit('update:modelValue', '')\"\n >\n <MIcon name=\"close\" :size=\"18\" />\n </button>\n </div>\n\n <p v-if=\"error && errorLabel\" class=\"px-4 text-body-small text-error\">{{ errorLabel }}</p>\n <p v-else-if=\"hint\" class=\"px-4 text-body-small text-on-surface-variant\">{{ hint }}</p>\n </div>\n</template>\n"],"mappings":";;;;AAEA,IAAMe,IAAgB;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,SAASC,EAAY,GAAgC;CACnD,KAAK,IAAMC,KAAOF,GAChB,IAAIG,EAAG,UAAU,SAASD,CAAG,GAAG,OAAO,eAAeA,EAAI,MAAM,CAAC,EAAE;CAErE,OAAO;AACT;AAEA,SAASE,EAAc,GAAwB;CAC7C,IAAI,CAACC,KAASA,MAAU,eAAe,OAAO;CAC9C,IAAMC,IAAID,EAAM,MAAM,oBAAoB;CAC1C,IAAIC,GAAG;EACL,IAAMC,IAAQD,EAAE,EAAE,CAAE,MAAM,GAAG,CAAC,CAAC,KAAK,MAAME,EAAE,KAAK,CAAC;EAClD,IAAID,EAAM,WAAW,KAAK,WAAWA,E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EAAA,SAFb/G,EAAA,GAAAC,EAQS,UAAA;;IAPN,cAAYI,EAAA4F,CAAA,CAAM,CAAC;IAEpB,MAAK;IACL,OAAM;IACL,SAAK,AAAAwC,EAAA,QAAA,MAAA;KAAoB,AAAlBT,EAAArB,CAAA,CAAc,CAAA,GAAIP,EAAI,qBAAA,EAAA;IAAA;G,IAE9B9F,EAAiCC,GAAA;IAA1B,MAAK;IAAS,MAAM;;E,OAItB4F,EAAA,SAASA,EAAA,cAAlBnG,EAAA,GAAAC,EAA0F,KAA1F0F,GAA0FjF,EAAjByF,EAAA,UAAU,GAAA,CAAA,KACrEA,EAAA,QAAdnG,EAAA,GAAAC,EAAuF,KAAvF2F,GAAuFlF,EAAXyF,EAAA,IAAI,GAAA,CAAA,K"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { i as e, o as t } from "./_storageKeys-C4W_4xK4.js";
|
|
2
|
-
import { i as n } from "./useLocale-
|
|
2
|
+
import { i as n } from "./useLocale-DaVSTdm0.js";
|
|
3
3
|
import { t as r } from "./MIconButton-BBggVwBV.js";
|
|
4
4
|
import { t as i } from "./MIcon-DpajuUTJ.js";
|
|
5
5
|
import { t as a } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
|
|
6
|
-
import { t as o } from "./MDialog-
|
|
7
|
-
import { t as s } from "./MButton-
|
|
6
|
+
import { t as o } from "./MDialog-DYMnaBlt.js";
|
|
7
|
+
import { t as s } from "./MButton-OQ4wIERQ.js";
|
|
8
8
|
import { Fragment as c, Teleport as l, Transition as u, computed as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, createTextVNode as g, createVNode as _, defineComponent as v, mergeProps as y, nextTick as b, normalizeClass as x, normalizeStyle as S, onMounted as C, onUnmounted as w, openBlock as T, ref as E, renderList as ee, renderSlot as D, toDisplayString as O, unref as k, watch as te, withCtx as A, withKeys as ne } from "vue";
|
|
9
9
|
// src/composables/_tooltipTrigger.ts
|
|
10
10
|
var j = 500, M = 1500, N = 120, P = 4, F = 6;
|
|
@@ -751,4 +751,4 @@ var K = [
|
|
|
751
751
|
});
|
|
752
752
|
export { z as a, I as c, K as i, Y as n, G as o, J as r, L as s, Z as t };
|
|
753
753
|
|
|
754
|
-
//# sourceMappingURL=MTooltip-
|
|
754
|
+
//# sourceMappingURL=MTooltip-Dd5g2zhh.js.map
|