@m3ui-vue/m3ui-vue 1.8.1 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/API.md +26 -11
- package/dist/{MButton-B6eZTfFV.js → MButton-LiZRRP4h.js} +4 -4
- package/dist/{MButton-B6eZTfFV.js.map → MButton-LiZRRP4h.js.map} +1 -1
- package/dist/{MColorPickerModal-Dajjf6tH.js → MColorPickerModal-IjciC8zh.js} +185 -185
- package/dist/MColorPickerModal-IjciC8zh.js.map +1 -0
- package/dist/{MDialog-DQvE_JBv.js → MDialog-BLpfgIA3.js} +7 -7
- package/dist/{MDialog-DQvE_JBv.js.map → MDialog-BLpfgIA3.js.map} +1 -1
- package/dist/MIcon-BSsJZhK7.js +116 -0
- package/dist/MIcon-BSsJZhK7.js.map +1 -0
- package/dist/{MIconButton-BBggVwBV.js → MIconButton-CNjN0xwW.js} +18 -18
- package/dist/{MIconButton-BBggVwBV.js.map → MIconButton-CNjN0xwW.js.map} +1 -1
- package/dist/{MListItem-DiOAxaN7.js → MListItem-BBQ-6i3v.js} +139 -139
- package/dist/MListItem-BBQ-6i3v.js.map +1 -0
- package/dist/{MLoadingIndicator-CuTZYFFj.js → MLoadingIndicator-dejdXpu8.js} +2 -2
- package/dist/{MLoadingIndicator-CuTZYFFj.js.map → MLoadingIndicator-dejdXpu8.js.map} +1 -1
- package/dist/MMenuItem-E31tMzOt.js +577 -0
- package/dist/MMenuItem-E31tMzOt.js.map +1 -0
- package/dist/{MPdfViewer-C5ngKPRM.js → MPdfViewer-B5Q9Xs9d.js} +9 -9
- package/dist/{MPdfViewer-C5ngKPRM.js.map → MPdfViewer-B5Q9Xs9d.js.map} +1 -1
- package/dist/{MProgressBar-BWly1UKN.js → MProgressBar-CPrZhQbA.js} +3 -3
- package/dist/{MProgressBar-BWly1UKN.js.map → MProgressBar-CPrZhQbA.js.map} +1 -1
- package/dist/{MSeekBar-BCDQTx2t.js → MSeekBar-NwkuAzx-.js} +2 -2
- package/dist/{MSeekBar-BCDQTx2t.js.map → MSeekBar-NwkuAzx-.js.map} +1 -1
- package/dist/{MSegmentedButton-BXzRsg1S.js → MSegmentedButton-DZuZLBML.js} +4 -4
- package/dist/{MSegmentedButton-BXzRsg1S.js.map → MSegmentedButton-DZuZLBML.js.map} +1 -1
- package/dist/{MSignaturePad-CxOtelzE.js → MSignaturePad-Bqr-1R9f.js} +2 -2
- package/dist/{MSignaturePad-CxOtelzE.js.map → MSignaturePad-Bqr-1R9f.js.map} +1 -1
- package/dist/MSlider-B7dIcHVn.js +745 -0
- package/dist/MSlider-B7dIcHVn.js.map +1 -0
- package/dist/{MSpinner-UCdtSOHP.js → MSpinner-CXLY7lWw.js} +2 -2
- package/dist/{MSpinner-UCdtSOHP.js.map → MSpinner-CXLY7lWw.js.map} +1 -1
- package/dist/{MTextField-CYk9yFvi.js → MTextField-CryHMs8-.js} +18 -18
- package/dist/MTextField-CryHMs8-.js.map +1 -0
- package/dist/MTooltip-Cn_DYm9M.js +90 -0
- package/dist/MTooltip-Cn_DYm9M.js.map +1 -0
- package/dist/{_popupPosition-nL8SVKPK.js → _popupPosition-C_lxj9qU.js} +7 -7
- package/dist/_popupPosition-C_lxj9qU.js.map +1 -0
- package/dist/{_useFieldValidation-B0B44M_t.js → _useFieldValidation-CvZnZfl-.js} +2 -2
- package/dist/{_useFieldValidation-B0B44M_t.js.map → _useFieldValidation-CvZnZfl-.js.map} +1 -1
- package/dist/api.json +1 -1
- package/dist/code-editor.js +129 -128
- package/dist/code-editor.js.map +1 -1
- package/dist/components/MAddressField.vue.d.ts +1 -1
- package/dist/components/MAudioPlayer.vue.d.ts +1 -1
- package/dist/components/MAutocomplete.vue.d.ts +1 -1
- package/dist/components/MAvailabilityCalendar.vue.d.ts +3 -3
- package/dist/components/MBadge.vue.d.ts +2 -2
- package/dist/components/MBar.vue.d.ts +1 -1
- package/dist/components/MBeforeAfter.vue.d.ts +3 -3
- package/dist/components/MButton.vue.d.ts +1 -1
- package/dist/components/MCalendarHeatmap.vue.d.ts +1 -1
- package/dist/components/MChatBubble.vue.d.ts +1 -1
- package/dist/components/MCodeEditor.vue.d.ts +1 -1
- package/dist/components/MContainerTransform.vue.d.ts +1 -1
- package/dist/components/MCopyButton.vue.d.ts +2 -2
- package/dist/components/MCountrySelect.vue.d.ts +1 -1
- package/dist/components/MCreditCardInput.vue.d.ts +2 -2
- package/dist/components/MDiffViewer.vue.d.ts +1 -1
- package/dist/components/MDrawCanvas.vue.d.ts +2 -2
- package/dist/components/MExpansionPanel.vue.d.ts +1 -1
- package/dist/components/MExportButton.vue.d.ts +1 -1
- package/dist/components/MFab.vue.d.ts +1 -1
- package/dist/components/MFilterBuilder.vue.d.ts +1 -1
- package/dist/components/MFlex.vue.d.ts +2 -2
- package/dist/components/MFloorPlan.vue.d.ts +2 -2
- package/dist/components/MFlow.vue.d.ts +2 -2
- package/dist/components/MFormRenderer.vue.d.ts +2 -2
- package/dist/components/MGantt.vue.d.ts +2 -2
- package/dist/components/MGanttControls.vue.d.ts +1 -1
- package/dist/components/MGrid.vue.d.ts +1 -1
- package/dist/components/MIcon.vue.d.ts +3 -5
- package/dist/components/MIconButton.vue.d.ts +1 -1
- package/dist/components/MLightbox.vue.d.ts +2 -2
- package/dist/components/MMapMeasure.vue.d.ts +2 -2
- package/dist/components/MMenu.vue.d.ts +6 -3
- package/dist/components/MMortgageCalculator.vue.d.ts +2 -2
- package/dist/components/MMultiAutocomplete.vue.d.ts +1 -1
- package/dist/components/MMultiSelect.vue.d.ts +1 -1
- package/dist/components/MNavigationDrawer.vue.d.ts +5 -4
- package/dist/components/MNavigationRail.vue.d.ts +1 -1
- package/dist/components/MNumberField.vue.d.ts +1 -1
- package/dist/components/MOdontogram.vue.d.ts +2 -2
- package/dist/components/MPhoneInput.vue.d.ts +2 -2
- package/dist/components/MPinInput.vue.d.ts +3 -3
- package/dist/components/MPosKeypad.vue.d.ts +1 -1
- package/dist/components/MProductConfigurator.vue.d.ts +1 -1
- package/dist/components/MResourceTimeline.vue.d.ts +2 -2
- package/dist/components/MRichTextEditor.vue.d.ts +1 -1
- package/dist/components/MScheme.vue.d.ts +1 -1
- package/dist/components/MSearchBar.vue.d.ts +2 -2
- package/dist/components/MSearchField.vue.d.ts +1 -1
- package/dist/components/MSeatMap.vue.d.ts +1 -1
- package/dist/components/MSeekBar.vue.d.ts +2 -2
- package/dist/components/MSelect.vue.d.ts +1 -1
- package/dist/components/MShortNavigationBar.vue.d.ts +1 -1
- package/dist/components/MSkeleton.vue.d.ts +1 -1
- package/dist/components/MSpreadsheet.vue.d.ts +2 -2
- package/dist/components/MStack.vue.d.ts +2 -2
- package/dist/components/MSubtitle.vue.d.ts +1 -1
- package/dist/components/MSwipeToDismiss.vue.d.ts +1 -1
- package/dist/components/MSwitch.vue.d.ts +1 -1
- package/dist/components/MTagInput.vue.d.ts +1 -1
- package/dist/components/MText.vue.d.ts +1 -1
- package/dist/components/MTextField.vue.d.ts +3 -3
- package/dist/components/MTimeScroll.vue.d.ts +1 -1
- package/dist/components/MTimezoneSelect.vue.d.ts +1 -1
- package/dist/components/MTitle.vue.d.ts +1 -1
- package/dist/components/MToolbar.vue.d.ts +1 -1
- package/dist/components/MTooltip.vue.d.ts +1 -1
- package/dist/components/MTopAppBar.vue.d.ts +2 -2
- package/dist/components/MVitalsChart.vue.d.ts +1 -1
- package/dist/components/MWindow.vue.d.ts +3 -3
- package/dist/components/_MDrawerItemList.vue.d.ts +8 -1
- package/dist/composables/_fieldLayout.d.ts +8 -8
- package/dist/composables/_popupPosition.d.ts +3 -2
- package/dist/composables/_rtl.d.ts +26 -0
- package/dist/composables/useColorPalette.d.ts +1 -1
- package/dist/composables/useLocale.d.ts +4 -0
- package/dist/draw.js +5 -5
- package/dist/flow.js +2 -2
- package/dist/gantt.js +3 -3
- package/dist/locales/ar.d.ts +6 -0
- package/dist/locales/index.d.ts +1 -0
- package/dist/locales/index.js +768 -1
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +11961 -12040
- package/dist/m3ui.js.map +1 -1
- package/dist/map.js +1127 -1149
- package/dist/map.js.map +1 -1
- package/dist/markdown.js +1 -1
- package/dist/markdown.js.map +1 -1
- package/dist/media.js +7 -7
- package/dist/pdf-sign.js +9 -9
- package/dist/pdf.js +1 -1
- package/dist/plugin.d.ts +8 -0
- package/dist/rich-text-editor.js +79 -78
- package/dist/rich-text-editor.js.map +1 -1
- package/dist/styles/theme.css +13 -0
- package/dist/styles.css +1 -1
- package/dist/terminal.js +5 -2
- package/dist/terminal.js.map +1 -1
- package/dist/{useLocale-DL96OFgr.js → useLocale-ybIju59R.js} +3 -1
- package/dist/useLocale-ybIju59R.js.map +1 -0
- package/dist/vTooltip-xESB2YOb.js +154 -0
- package/dist/vTooltip-xESB2YOb.js.map +1 -0
- package/package.json +1 -1
- package/src/__tests__/MAddressField.test.ts +1 -1
- package/src/__tests__/MChip.test.ts +3 -3
- package/src/__tests__/MFab.test.ts +6 -6
- package/src/__tests__/MListItemNestedControl.test.ts +2 -2
- package/src/__tests__/MScheduler.test.ts +1 -1
- package/src/__tests__/MTrackingTimeline.test.ts +1 -1
- package/src/__tests__/MWindow.test.ts +16 -0
- package/src/__tests__/fieldOverflow.test.ts +9 -9
- package/src/__tests__/hydration.test.ts +39 -0
- package/src/__tests__/localePresets.test.ts +2 -0
- package/src/__tests__/rtl.test.ts +167 -0
- package/src/__tests__/ssr.test.ts +6 -0
- package/src/components/MAlert.vue +1 -1
- package/src/components/MAutocomplete.vue +7 -7
- package/src/components/MAvailabilityCalendar.vue +5 -3
- package/src/components/MBadge.vue +12 -3
- package/src/components/MBar.vue +1 -1
- package/src/components/MBottomAppBar.vue +1 -1
- package/src/components/MCalendar.vue +3 -3
- package/src/components/MCalendarHeatmap.vue +3 -3
- package/src/components/MChatBubble.vue +3 -3
- package/src/components/MChip.vue +6 -6
- package/src/components/MCodeEditor.vue +7 -3
- package/src/components/MColorPicker.vue +1 -1
- package/src/components/MCommandPalette.vue +1 -1
- package/src/components/MContainerTransform.vue +1 -1
- package/src/components/MContextMenu.vue +1 -1
- package/src/components/MDataTable.vue +5 -5
- package/src/components/MDatePicker.vue +3 -2
- package/src/components/MDateRangePicker.vue +3 -2
- package/src/components/MDialog.vue +5 -5
- package/src/components/MDiffViewer.vue +1 -1
- package/src/components/MDivider.vue +1 -1
- package/src/components/MDragDropList.vue +1 -1
- package/src/components/MEmojiSelector.vue +11 -7
- package/src/components/MExpansionPanel.vue +1 -1
- package/src/components/MFab.vue +5 -5
- package/src/components/MFormBuilder.vue +3 -3
- package/src/components/MIcon.vue +14 -2
- package/src/components/MJsonEditor.vue +1 -3
- package/src/components/MJsonViewer.vue +1 -1
- package/src/components/MKanban.vue +2 -1
- package/src/components/MListDetail.vue +2 -2
- package/src/components/MListGroup.vue +1 -1
- package/src/components/MListItem.vue +5 -5
- package/src/components/MListSubheader.vue +1 -1
- package/src/components/MMapDraw.vue +3 -2
- package/src/components/MMapHover.vue +2 -1
- package/src/components/MMapMeasure.vue +2 -1
- package/src/components/MMapRoute.vue +2 -1
- package/src/components/MMarkdown.vue +9 -6
- package/src/components/MMaskField.vue +6 -6
- package/src/components/MMenu.vue +13 -6
- package/src/components/MMenuItem.vue +8 -6
- package/src/components/MMultiAutocomplete.vue +9 -8
- package/src/components/MMultiSelect.vue +9 -8
- package/src/components/MNavigationDrawer.vue +39 -27
- package/src/components/MNavigationRail.vue +28 -19
- package/src/components/MNavigationSuite.vue +1 -1
- package/src/components/MNotificationCenter.vue +1 -1
- package/src/components/MNotificationHost.vue +1 -1
- package/src/components/MNumberField.vue +6 -6
- package/src/components/MOrderTicket.vue +1 -1
- package/src/components/MPageProgress.vue +1 -1
- package/src/components/MPhoneInput.vue +5 -4
- package/src/components/MPinInput.vue +3 -2
- package/src/components/MPosKeypad.vue +2 -1
- package/src/components/MProductConfigurator.vue +2 -1
- package/src/components/MProgressBar.vue +2 -2
- package/src/components/MRichTextEditor.vue +8 -4
- package/src/components/MScheduler.vue +14 -14
- package/src/components/MSearchField.vue +1 -1
- package/src/components/MSeatMap.vue +2 -1
- package/src/components/MSegmentedButton.vue +1 -1
- package/src/components/MSelect.vue +7 -7
- package/src/components/MSideSheet.vue +3 -2
- package/src/components/MSimpleCarousel.vue +20 -11
- package/src/components/MSlider.vue +15 -5
- package/src/components/MSnackbar.vue +2 -2
- package/src/components/MSplitButton.vue +3 -2
- package/src/components/MSplitter.vue +6 -3
- package/src/components/MSpotlightSearch.vue +1 -1
- package/src/components/MSwitch.vue +5 -5
- package/src/components/MTable.vue +3 -3
- package/src/components/MTabs.vue +4 -1
- package/src/components/MTagInput.vue +6 -6
- package/src/components/MTerminal.vue +1 -1
- package/src/components/MText.vue +1 -1
- package/src/components/MTextField.vue +7 -7
- package/src/components/MTimePicker.vue +3 -2
- package/src/components/MTimePickerModal.vue +2 -2
- package/src/components/MTimeScroll.vue +1 -1
- package/src/components/MTimeline.vue +12 -12
- package/src/components/MToolbar.vue +3 -3
- package/src/components/MTrackingTimeline.vue +3 -2
- package/src/components/MTransition.vue +8 -3
- package/src/components/MTreeTable.vue +1 -1
- package/src/components/MTypewriter.vue +1 -1
- package/src/components/MVirtualTable.vue +2 -2
- package/src/components/MWindow.vue +4 -3
- package/src/components/_MColorPanel.vue +5 -4
- package/src/components/_MDrawerItemList.vue +9 -5
- package/src/components/_MMapAttribution.vue +2 -1
- package/src/components/_MMonthYearButton.vue +1 -1
- package/src/components/_MTransferPane.vue +8 -1
- package/src/components/_MTreeNode.vue +3 -3
- package/src/components/_MYearGrid.vue +4 -2
- package/src/composables/_fieldLayout.ts +19 -19
- package/src/composables/_popupPosition.ts +5 -3
- package/src/composables/_rtl.ts +76 -0
- package/src/composables/_useMenuNav.ts +24 -17
- package/src/composables/_useSheetMotion.ts +10 -3
- package/src/composables/useLocale.ts +6 -0
- package/src/locales/ar.ts +798 -0
- package/src/locales/de.ts +2 -0
- package/src/locales/es.ts +2 -0
- package/src/locales/fr.ts +2 -0
- package/src/locales/index.ts +1 -0
- package/src/locales/ja.ts +2 -0
- package/src/locales/ko.ts +2 -0
- package/src/locales/pt.ts +2 -0
- package/src/locales/zh.ts +2 -0
- package/src/plugin.ts +10 -0
- package/src/styles/theme.css +13 -0
- package/dist/MColorPickerModal-Dajjf6tH.js.map +0 -1
- package/dist/MIcon-DpajuUTJ.js +0 -33
- package/dist/MIcon-DpajuUTJ.js.map +0 -1
- package/dist/MListItem-DiOAxaN7.js.map +0 -1
- package/dist/MMenuItem-BuxYoASE.js +0 -574
- package/dist/MMenuItem-BuxYoASE.js.map +0 -1
- package/dist/MSlider-D_O8J9YH.js +0 -739
- package/dist/MSlider-D_O8J9YH.js.map +0 -1
- package/dist/MTextField-CYk9yFvi.js.map +0 -1
- package/dist/MTooltip-CK39Zon4.js +0 -183
- package/dist/MTooltip-CK39Zon4.js.map +0 -1
- package/dist/_popupPosition-nL8SVKPK.js.map +0 -1
- package/dist/useLocale-DL96OFgr.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MSlider-D_O8J9YH.js","names":["_openBlock","_createElementBlock","_normalizeClass","_unref","_createTextVNode","_toDisplayString","_createElementVNode","_normalizeStyle","_Fragment","_createBlock","MIcon","_renderList","_createVNode","_Transition","_withCtx","useFieldValidation","useFocusLeave","MIcon_default","useLocale","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","DISABLED_ACTIVE","DISABLED_INACTIVE","MSlider_default","defineComponent","__expose","__emit","props","__props","emit","t","trackEl","ref","thumbEls","rootEl","validation","isRange","v","isDisabled","errorMessage","onFocusOut","dragging","focused","focusedThumb","keyboardThumb","focusingFromPointer","focusThumb","idx","onThumbFocus","onThumbBlur","isVertical","computed","val","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","_cache","args","unref","hasError","createTextVNode","toDisplayString","createCommentVNode","createElementVNode","messageId","normalizeStyle","$event","Fragment","createBlock","renderList","i","pos","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 * @event blur Emitted when focus leaves the slider (both thumbs, for a range)\n */\nimport { computed, onBeforeUnmount, onMounted, ref } from 'vue'\nimport { useFieldValidation, useFocusLeave } from '../composables/_useFieldValidation'\nimport type { ValidateOn, ValidationRule } from '../composables/validation'\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 /** Error state. A string is also the message */\n error?: boolean | string\n /** Error message shown when `error` is true */\n errorLabel?: string\n /** Marks it as required (asterisk); a slider always has a value, so use `rules` (e.g. `min(1)`) for limits */\n required?: boolean\n /** Validation rules (functions or a Standard Schema); see `MForm` */\n rules?: ValidationRule | ValidationRule[]\n /** When the rules are checked and shown: on leaving it (default), on change, or only on submit */\n validateOn?: ValidateOn\n /** Wait this long (ms) after the value stops changing before re-checking (one request for an async rule, not one per key). Defaults to its `MForm`'s */\n validateDebounce?: number\n /** The key of this field in its `MForm` */\n name?: 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]]; blur: [] }>()\n\nconst t = useLocale()\nconst trackEl = ref<HTMLElement>()\nconst thumbEls = ref<HTMLElement[]>([])\nconst rootEl = ref<HTMLElement | null>(null)\n\nconst validation = useFieldValidation({\n value: () => props.modelValue,\n rules: () => props.rules,\n required: () => props.required,\n error: () => props.error,\n errorLabel: () => props.errorLabel,\n name: () => props.name,\n validateOn: () => props.validateOn,\n validateDebounce: () => props.validateDebounce,\n disabled: () => props.disabled,\n focus: () => { (isRange.value ? thumbEls.value[0] : trackEl.value)?.focus() },\n el: () => rootEl.value,\n setValue: (v) => emit('update:modelValue', v as number | [number, number]),\n})\n/** Its own `disabled` or its MForm's */\nconst isDisabled = validation.disabled\nconst { hasError, message: errorMessage, messageId } = validation\nconst onFocusOut = useFocusLeave(() => rootEl.value, () => {\n validation.onBlur()\n emit('blur')\n})\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(() => isDisabled.value\n ? { active: DISABLED_ACTIVE, inactive: DISABLED_INACTIVE }\n : { active: resolveActive(props.fillColor, props.color), inactive: 'var(--color-secondary-container)' })\nconst thumbCt = computed(() => isDisabled.value\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 (isDisabled.value) 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 (isDisabled.value) 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 (isDisabled.value) 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\ndefineExpose({\n /** Checks its rules and shows the result; resolves to whether they pass */\n validate: validation.validate,\n /** Hides its validation error (until the next check) */\n resetValidation: validation.resetValidation,\n})\n</script>\n\n<template>\n <div ref=\"rootEl\" class=\"flex select-none\" :class=\"isVertical ? 'h-full flex-col items-center' : 'flex-col gap-1'\" @focusout=\"onFocusOut\">\n <div v-if=\"label || showValue\" class=\"flex items-center justify-between\">\n <span v-if=\"label\" class=\"text-label-large\" :class=\"hasError ? 'text-error' : 'text-on-surface'\">{{ label }}<span v-if=\"required\" class=\"text-error\"> *</span></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=\"isDisabled || undefined\"\n :aria-invalid=\"hasError || undefined\"\n :aria-describedby=\"errorMessage ? messageId : undefined\"\n :aria-orientation=\"isRange ? undefined : orientation\"\n class=\"group relative touch-none cursor-pointer outline-none\"\n :class=\"isDisabled && '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 <!-- M3's slider has no error state: only the message says so -->\n <p v-if=\"errorMessage\" :id=\"messageId\" role=\"alert\" class=\"text-body-small text-error\">{{ errorMessage }}</p>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A,gBA0QMyB,KAAkB,gEAClBC,KAAoB,gE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA5P1B,IAAMK,IAAQC,GAkERC,IAAOH,IAEPI,KAAIhB,EAAU,GACdiB,IAAUC,EAAiB,GAC3BC,IAAWD,EAAmB,CAAC,CAAC,GAChCE,IAASF,EAAwB,IAAI,GAErCG,IAAaxB,EAAmB;GACpC,aAAagB,EAAM;GACnB,aAAaA,EAAM;GACnB,gBAAgBA,EAAM;GACtB,aAAaA,EAAM;GACnB,kBAAkBA,EAAM;GACxB,YAAYA,EAAM;GAClB,kBAAkBA,EAAM;GACxB,wBAAwBA,EAAM;GAC9B,gBAAgBA,EAAM;GACtB,aAAa;IAAE,CAACS,EAAQ,QAAQH,EAAS,MAA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KAEf,SAAAC,SAMM,CALEkB,EAAA,eAAea,EAAA,UAAQ,MAD/B7C,EAAA,GAAAC,EAMM,OAAA;;MAJJ,OAAM;MACL,OAAKM,EAAEuI,GAAWK,GAAA,KAAU,CAAA;KAE1B,GAAA9I,EAAA6I,GAAA,KAAY,GAAA,CAAA,K;;;;GAMd/I,EAAAwC,CAAA,KAAT3C,EAAA,GAAAC,EAA6G,KAAA;;IAArF,IAAIE,EAAA4J,EAAA;IAAW,MAAK;IAAQ,OAAM;GAAgC,GAAA1J,EAAAF,EAAAwC,CAAA,CAAY,GAAA,GAAAnB,EAAA,K"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MTextField-CYk9yFvi.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","validation","useFieldValidation","errorMessage","isDisabled","onBlur","event","showClear","rightInset","inputClasses","pl","pr","size","hasError","labelClasses","onInput","start","end","direction","openBlock","createElementBlock","createElementVNode","normalizeClass","normalizeStyle","unref","resolvedFieldBg","createVNode","createCommentVNode","messageId","_cache","$event","withDirectives","createTextVNode","toDisplayString","_ctx","renderSlot"],"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 * @event blur Emitted when the field loses focus (wire vee-validate's `handleBlur` / Vuelidate's `$touch` here)\n * @event focus Emitted when the field gains focus\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 { useFieldValidation } from '../composables/_useFieldValidation'\nimport type { ValidateOn, ValidationRule } from '../composables/validation'\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 /**\n * Puts the field in error state (red border and label). A string is also the message, so a validation\n * library's error plugs straight in: `:error=\"errors.email\"`\n */\n error?: boolean | string;\n /** Error message shown below the field (only visible when error is true) */\n errorLabel?: string;\n /**\n * Validation rules: functions `(value, ctx) => true | 'message'` (may be async; see the built-in `required`,\n * `email`, `minLength`…) or a Standard Schema (zod, valibot…). Checked in order; the first failure is shown\n */\n rules?: ValidationRule | ValidationRule[];\n /** When the rules are checked and shown: on leaving the field (default; live after that), while typing, or only on submit (`MForm`) */\n validateOn?: ValidateOn;\n /** Wait this long (ms) after the value stops changing before re-checking (one request for an async rule, not one per key). Defaults to its `MForm`'s */\n validateDebounce?: number;\n /** Native `name`; also the key of this field in its `MForm`'s values, errors and schema */\n name?: 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; inside an `MForm` or with `rules`, also validates it */\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]; blur: [FocusEvent]; focus: [FocusEvent] }>();\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);\n\nconst validation = useFieldValidation({\n value: () => props.modelValue,\n rules: () => props.rules,\n required: () => props.required,\n error: () => props.error,\n errorLabel: () => props.errorLabel,\n name: () => props.name,\n validateOn: () => props.validateOn,\n validateDebounce: () => props.validateDebounce,\n disabled: () => props.disabled,\n focus: () => fieldEl.value?.focus(),\n el: () => fieldEl.value,\n setValue: (v) => emit(\"update:modelValue\", v as string),\n});\nconst { hasError, message: errorMessage, messageId } = validation;\nconst isDisabled = validation.disabled;\n\nfunction onBlur(event: FocusEvent) {\n validation.onBlur();\n emit(\"blur\", event);\n}\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 && !isDisabled.value)\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 hasError.value ? \"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 hasError.value\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 hasError.value\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 hasError.value ? '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 /** Checks its rules and shows the result; resolves to whether they pass */\n validate: validation.validate,\n /** Hides its validation error (until the next check) */\n resetValidation: validation.resetValidation,\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 isDisabled ? '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 :name=\"name\"\n :disabled=\"isDisabled\"\n :required=\"required\"\n :aria-invalid=\"hasError || undefined\"\n :aria-describedby=\"errorMessage || hint ? messageId : undefined\"\n placeholder=\" \"\n :class=\"inputClasses\"\n @input=\"onInput\"\n @blur=\"onBlur\"\n @focus=\"emit('focus', $event)\"\n />\n <input\n v-else\n ref=\"inputOnlyEl\"\n :id=\"id\"\n :type=\"type\"\n :value=\"modelValue\"\n :name=\"name\"\n :disabled=\"isDisabled\"\n :required=\"required\"\n :aria-invalid=\"hasError || undefined\"\n :aria-describedby=\"errorMessage || hint ? messageId : undefined\"\n :autocomplete=\"autocomplete\"\n placeholder=\" \"\n :class=\"inputClasses\"\n v-overflow-title\n @input=\"onInput\"\n @blur=\"onBlur\"\n @focus=\"emit('focus', $event)\"\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=\"errorMessage\" :id=\"messageId\" role=\"alert\" class=\"px-4 text-body-small text-error\">{{ errorMessage }}</p>\n <p v-else-if=\"hint\" :id=\"messageId\" 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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9E,EAAwBqI,EAAA,QAAA,UAAA,C,MAIb3B,GAAA,SAFbrH,EAAA,GAAAC,EAQS,UAAA;;IAPN,cAAYI,EAAA4F,CAAA,CAAM,CAAC;IAEpB,MAAK;IACL,OAAM;IACL,SAAK,AAAA0C,EAAA,QAAA,MAAA;KAAoB,AAAlBL,EAAA3B,CAAA,CAAc,CAAA,GAAIP,EAAI,qBAAA,EAAA;IAAA;G,IAE9B9F,EAAiCC,GAAA;IAA1B,MAAK;IAAS,MAAM;;E,OAItBF,EAAA4G,CAAA,KAATjH,EAAA,GAAAC,EAAkH,KAAA;;GAA1F,IAAII,EAAAqI,CAAA;GAAW,MAAK;GAAQ,OAAM;EAAqC,GAAAhI,EAAAL,EAAA4G,CAAA,CAAY,GAAA,GAAAtB,CAAA,KAC7FQ,EAAA,QAAdnG,EAAA,GAAAC,EAAuG,KAAA;;GAAlF,IAAII,EAAAqI,CAAA;GAAW,OAAM;EAAkD,GAAAhI,EAAAyF,EAAA,IAAI,GAAA,GAAAP,CAAA,K"}
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import { Fragment as e, Teleport as t, Transition as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, mergeProps as l, nextTick as u, normalizeStyle as d, onMounted as f, onUnmounted as p, openBlock as m, ref as h, renderSlot as g, toDisplayString as _, withCtx as v } from "vue";
|
|
2
|
-
// src/composables/_tooltipTrigger.ts
|
|
3
|
-
var y = 500, b = 1500, x = 120, S = 4, C = 6;
|
|
4
|
-
function w(e, t, n) {
|
|
5
|
-
let r = e.getBoundingClientRect(), i = t.getBoundingClientRect(), a = 0, o = 0;
|
|
6
|
-
switch (n) {
|
|
7
|
-
case "top":
|
|
8
|
-
a = r.top - i.height - S, o = r.left + (r.width - i.width) / 2;
|
|
9
|
-
break;
|
|
10
|
-
case "bottom":
|
|
11
|
-
a = r.bottom + S, o = r.left + (r.width - i.width) / 2;
|
|
12
|
-
break;
|
|
13
|
-
case "left":
|
|
14
|
-
a = r.top + (r.height - i.height) / 2, o = r.left - i.width - S;
|
|
15
|
-
break;
|
|
16
|
-
case "right": a = r.top + (r.height - i.height) / 2, o = r.right + S;
|
|
17
|
-
}
|
|
18
|
-
return a = Math.max(C, Math.min(a, window.innerHeight - i.height - C)), o = Math.max(C, Math.min(o, window.innerWidth - i.width - C)), {
|
|
19
|
-
top: a,
|
|
20
|
-
left: o
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
function T(e, t) {
|
|
24
|
-
let n, r, i = null, a = !1, o = () => t.rich?.() ?? !1;
|
|
25
|
-
function s() {
|
|
26
|
-
clearTimeout(n), clearTimeout(r);
|
|
27
|
-
}
|
|
28
|
-
function c() {
|
|
29
|
-
s(), n = setTimeout(t.open, t.delay());
|
|
30
|
-
}
|
|
31
|
-
function l() {
|
|
32
|
-
s(), o() ? r = setTimeout(t.close, x) : t.close();
|
|
33
|
-
}
|
|
34
|
-
function u() {
|
|
35
|
-
s(), t.close();
|
|
36
|
-
}
|
|
37
|
-
function d(e) {
|
|
38
|
-
e.pointerType === "mouse" && c();
|
|
39
|
-
}
|
|
40
|
-
function f(e) {
|
|
41
|
-
e.pointerType === "mouse" && l();
|
|
42
|
-
}
|
|
43
|
-
function p() {
|
|
44
|
-
i && clearTimeout(i.timer), i = null, window.removeEventListener("pointermove", h), window.removeEventListener("pointerup", g), window.removeEventListener("pointercancel", v);
|
|
45
|
-
}
|
|
46
|
-
function m(e) {
|
|
47
|
-
e.pointerType !== "mouse" && (p(), a = !1, i = {
|
|
48
|
-
id: e.pointerId,
|
|
49
|
-
x: e.clientX,
|
|
50
|
-
y: e.clientY,
|
|
51
|
-
timer: setTimeout(() => {
|
|
52
|
-
a = !0, s(), t.open();
|
|
53
|
-
}, y)
|
|
54
|
-
}, window.addEventListener("pointermove", h), window.addEventListener("pointerup", g), window.addEventListener("pointercancel", v));
|
|
55
|
-
}
|
|
56
|
-
function h(e) {
|
|
57
|
-
i && e.pointerId === i.id && Math.hypot(e.clientX - i.x, e.clientY - i.y) > 10 && p();
|
|
58
|
-
}
|
|
59
|
-
function g(e) {
|
|
60
|
-
i && e.pointerId === i.id && (p(), a && (s(), o() ? document.addEventListener("pointerdown", _, !0) : r = setTimeout(t.close, b)));
|
|
61
|
-
}
|
|
62
|
-
function _(n) {
|
|
63
|
-
let r = n.target;
|
|
64
|
-
t.tip()?.contains(r) || e.contains(r) || (document.removeEventListener("pointerdown", _, !0), t.close());
|
|
65
|
-
}
|
|
66
|
-
function v(e) {
|
|
67
|
-
i && e.pointerId === i.id && (p(), a && l());
|
|
68
|
-
}
|
|
69
|
-
function S(e) {
|
|
70
|
-
a && (a = !1, e.preventDefault(), e.stopPropagation());
|
|
71
|
-
}
|
|
72
|
-
function C(e) {
|
|
73
|
-
(i || a) && e.preventDefault();
|
|
74
|
-
}
|
|
75
|
-
function w(e) {
|
|
76
|
-
let t = !0;
|
|
77
|
-
try {
|
|
78
|
-
t = e.target.matches(":focus-visible");
|
|
79
|
-
} catch {}
|
|
80
|
-
t && c();
|
|
81
|
-
}
|
|
82
|
-
function T(e) {
|
|
83
|
-
e.key === "Escape" && t.visible() && (e.stopPropagation(), u());
|
|
84
|
-
}
|
|
85
|
-
function E() {
|
|
86
|
-
t.visible() && u();
|
|
87
|
-
}
|
|
88
|
-
return e.addEventListener("pointerenter", d), e.addEventListener("pointerleave", f), e.addEventListener("pointerdown", m), e.addEventListener("click", S, !0), e.addEventListener("contextmenu", C), e.addEventListener("focusin", w), e.addEventListener("focusout", l), e.addEventListener("keydown", T), window.addEventListener("scroll", E, !0), {
|
|
89
|
-
cancel: s,
|
|
90
|
-
closeNow: u,
|
|
91
|
-
destroy() {
|
|
92
|
-
s(), p(), document.removeEventListener("pointerdown", _, !0), e.removeEventListener("pointerenter", d), e.removeEventListener("pointerleave", f), e.removeEventListener("pointerdown", m), e.removeEventListener("click", S, !0), e.removeEventListener("contextmenu", C), e.removeEventListener("focusin", w), e.removeEventListener("focusout", l), e.removeEventListener("keydown", T), window.removeEventListener("scroll", E, !0);
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
// src/components/MTooltip.vue?vue&type=script&setup=true&lang.ts
|
|
97
|
-
var E = {
|
|
98
|
-
key: 0,
|
|
99
|
-
class: "px-4 pt-3 pb-1 text-title-small font-medium text-on-surface-variant"
|
|
100
|
-
}, D = { class: "px-4 py-2 text-body-medium text-on-surface-variant" }, O = {
|
|
101
|
-
key: 1,
|
|
102
|
-
class: "flex justify-end gap-2 px-4 pb-3"
|
|
103
|
-
}, k = /* @__PURE__ */ c({
|
|
104
|
-
inheritAttrs: !1,
|
|
105
|
-
__name: "MTooltip",
|
|
106
|
-
props: {
|
|
107
|
-
text: {},
|
|
108
|
-
placement: { default: "top" },
|
|
109
|
-
delay: { default: 600 },
|
|
110
|
-
rich: {
|
|
111
|
-
type: Boolean,
|
|
112
|
-
default: !1
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
setup(c) {
|
|
116
|
-
let y = c, b = h(!1), x = h(), S = h(), C = h({}), k;
|
|
117
|
-
async function A() {
|
|
118
|
-
b.value = !0, await u(), N();
|
|
119
|
-
}
|
|
120
|
-
function j() {
|
|
121
|
-
y.rich && k?.cancel();
|
|
122
|
-
}
|
|
123
|
-
function M() {
|
|
124
|
-
y.rich && k?.closeNow();
|
|
125
|
-
}
|
|
126
|
-
function N() {
|
|
127
|
-
if (!S.value || !x.value) return;
|
|
128
|
-
let { top: e, left: t } = w(S.value, x.value, y.placement);
|
|
129
|
-
C.value = {
|
|
130
|
-
top: `${e}px`,
|
|
131
|
-
left: `${t}px`
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
return f(() => {
|
|
135
|
-
k = T(S.value, {
|
|
136
|
-
delay: () => y.delay,
|
|
137
|
-
rich: () => y.rich,
|
|
138
|
-
visible: () => b.value,
|
|
139
|
-
open: A,
|
|
140
|
-
close: () => {
|
|
141
|
-
b.value = !1;
|
|
142
|
-
},
|
|
143
|
-
tip: () => x.value
|
|
144
|
-
});
|
|
145
|
-
}), p(() => k?.destroy()), (u, f) => (m(), a(e, null, [o("span", l({
|
|
146
|
-
ref_key: "triggerEl",
|
|
147
|
-
ref: S
|
|
148
|
-
}, u.$attrs, { class: "inline-flex" }), [g(u.$slots, "default")], 16), (m(), r(t, { to: "body" }, [s(n, {
|
|
149
|
-
"enter-active-class": "transition-opacity duration-150",
|
|
150
|
-
"enter-from-class": "opacity-0",
|
|
151
|
-
"enter-to-class": "opacity-100",
|
|
152
|
-
"leave-active-class": "transition-opacity duration-100",
|
|
153
|
-
"leave-from-class": "opacity-100",
|
|
154
|
-
"leave-to-class": "opacity-0"
|
|
155
|
-
}, {
|
|
156
|
-
default: v(() => [b.value && !c.rich && c.text ? (m(), a("div", {
|
|
157
|
-
key: 0,
|
|
158
|
-
ref_key: "tipEl",
|
|
159
|
-
ref: x,
|
|
160
|
-
class: "pointer-events-none fixed z-400 min-h-6 min-w-10 max-w-[200px] rounded bg-inverse-surface px-2 py-1 text-body-small text-inverse-on-surface",
|
|
161
|
-
style: d(C.value),
|
|
162
|
-
role: "tooltip"
|
|
163
|
-
}, _(c.text), 5)) : b.value && c.rich ? (m(), a("div", {
|
|
164
|
-
key: 1,
|
|
165
|
-
ref_key: "tipEl",
|
|
166
|
-
ref: x,
|
|
167
|
-
class: "fixed z-400 max-w-[320px] rounded-xl bg-surface-container shadow-elevation-2",
|
|
168
|
-
style: d(C.value),
|
|
169
|
-
role: "tooltip",
|
|
170
|
-
onMouseenter: j,
|
|
171
|
-
onMouseleave: M
|
|
172
|
-
}, [
|
|
173
|
-
c.text ? (m(), a("div", E, _(c.text), 1)) : i("", !0),
|
|
174
|
-
o("div", D, [g(u.$slots, "content")]),
|
|
175
|
-
u.$slots.actions ? (m(), a("div", O, [g(u.$slots, "actions")])) : i("", !0)
|
|
176
|
-
], 36)) : i("", !0)]),
|
|
177
|
-
_: 3
|
|
178
|
-
})]))], 64));
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
export { T as n, w as r, k as t };
|
|
182
|
-
|
|
183
|
-
//# sourceMappingURL=MTooltip-CK39Zon4.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MTooltip-CK39Zon4.js","names":["$attrs","$slots","_openBlock","_createElementBlock","_createElementVNode","_mergeProps","_renderSlot","_createBlock","_Teleport","_createVNode","_Transition","_withCtx","_normalizeStyle","_toDisplayString","LONG_PRESS","TOUCH_DURATION","RICH_HIDE_DELAY","GAP","MARGIN","placeTooltip","tr","trigger","tt","tip","top","left","placement","createTooltipTrigger","showTimer","hideTimer","press","longPressed","rich","o","cancel","show","hide","closeNow","onPointerEnter","onPointerLeave","endPress","onPressMove","onPressUp","onPressCancel","onPointerDown","onOutsideTouch","t","e","el","onClickCapture","onContextMenu","onFocusIn","keyboard","onKeyDown","onScroll","_hoisted_1","_hoisted_2","_hoisted_3","MTooltip_default","defineComponent","props","__props","visible","ref","tipEl","triggerEl","tipStyle","open","nextTick","reposition","onTipEnter","onTipLeave","onMounted","onUnmounted","openBlock","createElementBlock","Fragment","createElementVNode","mergeProps","_ctx","renderSlot","createBlock","Teleport","createVNode","Transition","withCtx","normalizeStyle","toDisplayString","createCommentVNode"],"sources":["../src/composables/_tooltipTrigger.ts","../src/components/MTooltip.vue"],"sourcesContent":["/*\n * Internal (not exported from index.ts): what opens and closes a tooltip, shared by MTooltip and v-tooltip.\n *\n * Input as Compose's BasicTooltip: a mouse shows it on hover after `delay`; touch and pen on a long press, which\n * also swallows the click it would end in (a long-pressed button doesn't fire) and hides it TOUCH_DURATION after\n * the finger lifts (BasicTooltipDefaults.TooltipDuration); focus only from the keyboard. Escape hides it (and\n * stops there, so a dialog around it stays open), and so does any scroll. A rich tooltip closes a moment after\n * the pointer leaves (so it can move onto the tooltip), and after a long press stays until a touch outside it.\n */\n\nexport type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right'\n\nconst LONG_PRESS = 500\nconst TOUCH_DURATION = 1500\nconst RICH_HIDE_DELAY = 120\nconst GAP = 4\nconst MARGIN = 6\n\n/** Where `tip` goes next to `trigger`, kept 6px inside the window */\nexport function placeTooltip(trigger: HTMLElement, tip: HTMLElement, placement: TooltipPlacement) {\n const tr = trigger.getBoundingClientRect()\n const tt = tip.getBoundingClientRect()\n let top = 0\n let left = 0\n switch (placement) {\n case 'top': top = tr.top - tt.height - GAP; left = tr.left + (tr.width - tt.width) / 2; break\n case 'bottom': top = tr.bottom + GAP; left = tr.left + (tr.width - tt.width) / 2; break\n case 'left': top = tr.top + (tr.height - tt.height) / 2; left = tr.left - tt.width - GAP; break\n case 'right': top = tr.top + (tr.height - tt.height) / 2; left = tr.right + GAP; break\n }\n top = Math.max(MARGIN, Math.min(top, window.innerHeight - tt.height - MARGIN))\n left = Math.max(MARGIN, Math.min(left, window.innerWidth - tt.width - MARGIN))\n return { top, left }\n}\n\nexport interface TooltipTriggerOptions {\n delay: () => number\n rich?: () => boolean\n visible: () => boolean\n open: () => void\n close: () => void\n /** The tooltip's element while shown: a touch on it doesn't close a rich tooltip */\n tip: () => HTMLElement | null | undefined\n}\n\nexport function createTooltipTrigger(el: HTMLElement, o: TooltipTriggerOptions) {\n let showTimer: ReturnType<typeof setTimeout> | undefined\n let hideTimer: ReturnType<typeof setTimeout> | undefined\n let press: { id: number, x: number, y: number, timer: ReturnType<typeof setTimeout> } | null = null\n let longPressed = false\n const rich = () => o.rich?.() ?? false\n\n function cancel() {\n clearTimeout(showTimer)\n clearTimeout(hideTimer)\n }\n function show() {\n cancel()\n showTimer = setTimeout(o.open, o.delay())\n }\n function hide() {\n cancel()\n if (rich()) hideTimer = setTimeout(o.close, RICH_HIDE_DELAY)\n else o.close()\n }\n function closeNow() {\n cancel()\n o.close()\n }\n\n function onPointerEnter(e: PointerEvent) {\n if (e.pointerType === 'mouse') show()\n }\n function onPointerLeave(e: PointerEvent) {\n if (e.pointerType === 'mouse') hide()\n }\n\n function endPress() {\n if (press) clearTimeout(press.timer)\n press = null\n window.removeEventListener('pointermove', onPressMove)\n window.removeEventListener('pointerup', onPressUp)\n window.removeEventListener('pointercancel', onPressCancel)\n }\n function onPointerDown(e: PointerEvent) {\n if (e.pointerType === 'mouse') return\n endPress()\n longPressed = false\n press = {\n id: e.pointerId,\n x: e.clientX,\n y: e.clientY,\n timer: setTimeout(() => {\n longPressed = true\n cancel()\n o.open()\n }, LONG_PRESS),\n }\n window.addEventListener('pointermove', onPressMove)\n window.addEventListener('pointerup', onPressUp)\n window.addEventListener('pointercancel', onPressCancel)\n }\n function onPressMove(e: PointerEvent) {\n if (press && e.pointerId === press.id && Math.hypot(e.clientX - press.x, e.clientY - press.y) > 10) endPress()\n }\n function onPressUp(e: PointerEvent) {\n if (!press || e.pointerId !== press.id) return\n endPress()\n if (!longPressed) return\n cancel()\n // A rich tooltip may hold actions to tap: it stays until a touch outside it (Compose's persistent tooltips)\n if (rich()) document.addEventListener('pointerdown', onOutsideTouch, true)\n else hideTimer = setTimeout(o.close, TOUCH_DURATION)\n }\n function onOutsideTouch(e: PointerEvent) {\n const t = e.target as Node\n if (o.tip()?.contains(t) || el.contains(t)) return\n document.removeEventListener('pointerdown', onOutsideTouch, true)\n o.close()\n }\n // The browser took the touch (a scroll)\n function onPressCancel(e: PointerEvent) {\n if (!press || e.pointerId !== press.id) return\n endPress()\n if (longPressed) hide()\n }\n // The click a long press ends in, and the context menu it may open, belong to the tooltip\n function onClickCapture(e: MouseEvent) {\n if (!longPressed) return\n longPressed = false\n e.preventDefault()\n e.stopPropagation()\n }\n function onContextMenu(e: Event) {\n if (press || longPressed) e.preventDefault()\n }\n\n function onFocusIn(e: FocusEvent) {\n let keyboard = true\n try { keyboard = (e.target as Element).matches(':focus-visible') } catch { /* no :focus-visible: show */ }\n if (keyboard) show()\n }\n function onKeyDown(e: KeyboardEvent) {\n if (e.key === 'Escape' && o.visible()) {\n // Hiding the tooltip uses the key: a dialog around it stays open\n e.stopPropagation()\n closeNow()\n }\n }\n function onScroll() {\n if (o.visible()) closeNow()\n }\n\n el.addEventListener('pointerenter', onPointerEnter)\n el.addEventListener('pointerleave', onPointerLeave)\n el.addEventListener('pointerdown', onPointerDown)\n el.addEventListener('click', onClickCapture, true)\n el.addEventListener('contextmenu', onContextMenu)\n el.addEventListener('focusin', onFocusIn)\n el.addEventListener('focusout', hide)\n el.addEventListener('keydown', onKeyDown)\n window.addEventListener('scroll', onScroll, true)\n\n return {\n /** Keeps it open (the pointer moved onto a rich tooltip) */\n cancel,\n /** Closes it at once */\n closeNow,\n destroy() {\n cancel()\n endPress()\n document.removeEventListener('pointerdown', onOutsideTouch, true)\n el.removeEventListener('pointerenter', onPointerEnter)\n el.removeEventListener('pointerleave', onPointerLeave)\n el.removeEventListener('pointerdown', onPointerDown)\n el.removeEventListener('click', onClickCapture, true)\n el.removeEventListener('contextmenu', onContextMenu)\n el.removeEventListener('focusin', onFocusIn)\n el.removeEventListener('focusout', hide)\n el.removeEventListener('keydown', onKeyDown)\n window.removeEventListener('scroll', onScroll, true)\n },\n }\n}\n","<script setup lang=\"ts\">\n/**\n * A hover/focus-triggered label — plain text, or a rich variant with a title, detailed content, and action\n * buttons.\n *\n * @slot default The trigger element the tooltip is anchored to\n * @slot content Rich-tooltip body content (only used when rich is true)\n * @slot actions Rich-tooltip action buttons row (only used when rich is true)\n */\nimport { nextTick, onMounted, onUnmounted, ref } from 'vue'\nimport { createTooltipTrigger, placeTooltip } from '../composables/_tooltipTrigger'\n\ndefineOptions({ inheritAttrs: false })\n\nconst props = withDefaults(defineProps<{\n /** Tooltip text (plain variant), or the rich variant's title line */\n text?: string\n /** Tooltip position relative to the trigger */\n placement?: 'top' | 'bottom' | 'left' | 'right'\n /** Show delay in ms after hover/focus */\n delay?: number\n /**\n * Rich tooltip with a #content slot and optional #actions. Stays open when hovering the tooltip itself\n * instead of closing immediately.\n */\n rich?: boolean\n}>(), { placement: 'top', delay: 600, rich: false })\n\nconst visible = ref(false)\nconst tipEl = ref<HTMLElement>()\nconst triggerEl = ref<HTMLElement>()\nconst tipStyle = ref<Record<string, string>>({})\n\n// Hover, long press, keyboard focus, Escape and scroll: see _tooltipTrigger.ts (shared with v-tooltip)\nlet trigger: ReturnType<typeof createTooltipTrigger> | undefined\n\nasync function open() {\n visible.value = true\n await nextTick()\n reposition()\n}\n\nfunction onTipEnter() {\n if (props.rich) trigger?.cancel()\n}\n\nfunction onTipLeave() {\n if (props.rich) trigger?.closeNow()\n}\n\nfunction reposition() {\n if (!triggerEl.value || !tipEl.value) return\n const { top, left } = placeTooltip(triggerEl.value, tipEl.value, props.placement)\n tipStyle.value = { top: `${top}px`, left: `${left}px` }\n}\n\nonMounted(() => {\n trigger = createTooltipTrigger(triggerEl.value!, {\n delay: () => props.delay,\n rich: () => props.rich,\n visible: () => visible.value,\n open,\n close: () => { visible.value = false },\n tip: () => tipEl.value,\n })\n})\nonUnmounted(() => trigger?.destroy())\n</script>\n\n<template>\n <span\n ref=\"triggerEl\"\n v-bind=\"$attrs\"\n class=\"inline-flex\"\n >\n <slot />\n </span>\n\n <Teleport to=\"body\">\n <Transition\n enter-active-class=\"transition-opacity duration-150\"\n enter-from-class=\"opacity-0\"\n enter-to-class=\"opacity-100\"\n leave-active-class=\"transition-opacity duration-100\"\n leave-from-class=\"opacity-100\"\n leave-to-class=\"opacity-0\"\n >\n <!-- Plain tooltip -->\n <div\n v-if=\"visible && !rich && text\"\n ref=\"tipEl\"\n class=\"pointer-events-none fixed z-400 min-h-6 min-w-10 max-w-[200px] rounded bg-inverse-surface px-2 py-1 text-body-small text-inverse-on-surface\"\n :style=\"tipStyle\"\n role=\"tooltip\"\n >\n {{ text }}\n </div>\n\n <!-- Rich tooltip -->\n <div\n v-else-if=\"visible && rich\"\n ref=\"tipEl\"\n class=\"fixed z-400 max-w-[320px] rounded-xl bg-surface-container shadow-elevation-2\"\n :style=\"tipStyle\"\n role=\"tooltip\"\n @mouseenter=\"onTipEnter\"\n @mouseleave=\"onTipLeave\"\n >\n <div v-if=\"text\" class=\"px-4 pt-3 pb-1 text-title-small font-medium text-on-surface-variant\">\n {{ text }}\n </div>\n <div class=\"px-4 py-2 text-body-medium text-on-surface-variant\">\n <slot name=\"content\" />\n </div>\n <div v-if=\"$slots.actions\" class=\"flex justify-end gap-2 px-4 pb-3\">\n <slot name=\"actions\" />\n </div>\n </div>\n </Transition>\n </Teleport>\n</template>\n"],"mappings":";;AAYA,IAAMc,IAAa,KACbC,IAAiB,MACjBC,IAAkB,KAClBC,IAAM,GACNC,IAAS;AAGf,SAAgBC,EAAa,GAAsB,GAAkB,GAA6B;CAChG,IAAMC,IAAKC,EAAQ,sBAAsB,GACnCC,IAAKC,EAAI,sBAAsB,GACjCC,IAAM,GACNC,IAAO;CACX,QAAQC,GAAR;EACE,KAAK;GAAuC,AAAhC,IAAMN,EAAG,MAAME,EAAG,SAASL,GAAK,IAAOG,EAAG,QAAQA,EAAG,QAAQE,EAAG,SAAS;GAAG;EACxF,KAAK;GAAiC,AAAvB,IAAMF,EAAG,SAASH,GAAK,IAAOG,EAAG,QAAQA,EAAG,QAAQE,EAAG,SAAS;GAAG;EAClF,KAAK;GAAoD,AAA5C,IAAMF,EAAG,OAAOA,EAAG,SAASE,EAAG,UAAU,GAAG,IAAOF,EAAG,OAAOE,EAAG,QAAQL;GAAK;EAC1F,KAAK,SAAqD,AAA5C,IAAMG,EAAG,OAAOA,EAAG,SAASE,EAAG,UAAU,GAAG,IAAOF,EAAG,QAAQH;CAC9E;CAGA,OAFA,IAAM,KAAK,IAAIC,GAAQ,KAAK,IAAIM,GAAK,OAAO,cAAcF,EAAG,SAASJ,CAAM,CAAC,GAC7E,IAAO,KAAK,IAAIA,GAAQ,KAAK,IAAIO,GAAM,OAAO,aAAaH,EAAG,QAAQJ,CAAM,CAAC,GACtE;EAAE;EAAK;CAAK;AACrB;AAYA,SAAgBS,EAAqB,GAAiB,GAA0B;CAC9E,IAAIC,GACAC,GACAC,IAA2F,MAC3FC,IAAc,IACZC,UAAaC,EAAE,OAAO,KAA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WE,EAAM;GACnB,CAAC;EACH,CAAC,GACDS,QAAkBpD,GAAS,QAAQ,CAAC,I,2BAIlCjB,EAMO,QANPC,EAMO;GALD,SAAA;GAAJ,KAAI4D;EACIjE,GAAAA,EAAAA,QAAM,EACd,OAAM,cAAa,CAAA,GAAA,CAEnBM,EAAQyE,EAAA,QAAA,SAAA,C,SAGV7E,EAAA,GAAAK,EAyCWC,GAAA,EAzCD,IAAG,OAAM,GAAA,CACjBC,EAuCaC,GAAA;GAtCX,sBAAmB;GACnB,oBAAiB;GACjB,kBAAe;GACf,sBAAmB;GACnB,oBAAiB;GACjB,kBAAe;;GAGf,SAAAC,QAQM,CAPEmD,EAAA,SAAO,CAAKD,EAAA,QAAQA,EAAA,QAD5B3D,EAAA,GAAAC,EAQM,OAAA;;IANA,SAAA;IAAJ,KAAI6D;IACJ,OAAM;IACL,OAAKpD,EAAEsD,EAAA,KAAQ;IAChB,MAAK;GAEF,GAAArD,EAAAgD,EAAA,IAAI,GAAA,CAAA,KAKIC,EAAA,SAAWD,EAAA,QADxB3D,EAAA,GAAAC,EAkBM,OAAA;;IAhBA,SAAA;IAAJ,KAAI6D;IACJ,OAAM;IACL,OAAKpD,EAAEsD,EAAA,KAAQ;IAChB,MAAK;IACJ,cAAYI;IACZ,cAAYC;;IAEFV,EAAA,QAAX3D,EAAA,GAAAC,EAEM,OAFNoD,GAEM1C,EADDgD,EAAA,IAAI,GAAA,CAAA,K;IAETzD,EAEM,OAFNoD,GAEM,CADJlD,EAAuByE,EAAA,QAAA,SAAA,C;IAEd9E,EAAAA,OAAO,WAAlBC,EAAA,GAAAC,EAEM,OAFNsD,GAEM,CADJnD,EAAuByE,EAAA,QAAA,SAAA,C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_popupPosition-nL8SVKPK.js","names":["stack","onKeydown","useEscapeStack","entry","onEscape","set","i","on","watch","active","getCurrentInstance","onBeforeUnmount","fitPopup","x","candidates","margin","size","viewport","last","dropdownX","start","anchor","end","width","windowSide","align"],"sources":["../src/composables/_useEscapeStack.ts","../src/composables/_popupPosition.ts"],"sourcesContent":["import { getCurrentInstance, onBeforeUnmount, watch, type WatchSource } from 'vue'\n\n/*\n * Internal (not exported from index.ts): Escape for stacked modal surfaces. Each MDialog used to listen on document\n * itself, so with a dialog opened over another (a date picker over a form) one Escape closed them all. Open\n * surfaces go on a stack, and one listener hands Escape to the top one only. A persistent dialog on top takes it and\n * does nothing, so the one under it stays.\n */\n\nconst stack: (() => void)[] = []\n\nfunction onKeydown(e: KeyboardEvent) {\n if (e.key !== 'Escape' || !stack.length) return\n // Handled: the browser then doesn't also run a close watcher with it (MContainerTransform's, under a dialog)\n e.preventDefault()\n stack[stack.length - 1]!()\n}\n\n/** Calls `onEscape` on Escape while `active`, unless something opened later is on top of it. */\nexport function useEscapeStack(active: WatchSource<boolean>, onEscape: () => void) {\n const entry = () => onEscape()\n function set(on: boolean) {\n if (typeof document === 'undefined') return\n const i = stack.indexOf(entry)\n if (on && i < 0) {\n stack.push(entry)\n if (stack.length === 1) document.addEventListener('keydown', onKeydown)\n } else if (!on && i >= 0) {\n stack.splice(i, 1)\n if (!stack.length) document.removeEventListener('keydown', onKeydown)\n }\n }\n watch(active, (on) => set(!!on), { immediate: true })\n if (getCurrentInstance()) onBeforeUnmount(() => set(false))\n}\n","/*\n * Internal (not exported from index.ts): keeps a popup on screen along one axis, after Compose's\n * DropdownMenuPositionProvider (material3/internal/MenuPosition.kt). The candidates are tried in order and the\n * first that fits inside the window, MARGIN in from its edges (MenuHorizontalMargin), wins; when none does, a\n * popup wider than the window minus the margins is centered, anything else is clamped inside them.\n *\n * Measure the popup with nothing constraining its width (no `right`, no narrow `left`) before calling this:\n * a fixed element anchored on its right shrinks to the space on its left, which is the very overflow to avoid.\n */\n\n/** Compose's MenuHorizontalMargin (8dp). */\nexport const POPUP_MARGIN = 8\n\n/** The first candidate start position that keeps `size` inside `viewport`, else centered or clamped. */\nexport function fitPopup(candidates: number[], size: number, viewport: number, margin = POPUP_MARGIN): number {\n for (const x of candidates) {\n if (x >= margin && x + size <= viewport - margin) return x\n }\n if (size >= viewport - 2 * margin) return (viewport - size) / 2\n const last = candidates[candidates.length - 1] ?? margin\n return Math.min(viewport - margin - size, Math.max(margin, last))\n}\n\n/**\n * A dropdown's left edge: aligned with the anchor's start or end edge (`align` picks which is tried first), else\n * against the window edge on the anchor's side (MenuAnchorPosition.Below's xCandidates).\n */\nexport function dropdownX(\n anchor: { left: number; right: number },\n width: number,\n viewport: number,\n align: 'start' | 'end',\n margin = POPUP_MARGIN,\n): number {\n const start = anchor.left\n const end = anchor.right - width\n const windowSide = (anchor.left + anchor.right) / 2 < viewport / 2 ? margin : viewport - margin - width\n return fitPopup(align === 'start' ? [start, end, windowSide] : [end, start, windowSide], width, viewport, margin)\n}\n"],"mappings":";;AASA,IAAMA,IAAwB,CAAC;AAE/B,SAASC,EAAU,GAAkB;CACnC,AAAI,EAAE,QAAQ,YAAaD,EAAM,WAEjC,EAAE,eAAe,GACjBA,EAAMA,EAAM,SAAS,EAAE,CAAE;AAC3B;AAGA,SAAgBE,EAAe,GAA8B,GAAsB;CACjF,IAAMC,UAAcC,EAAS;CAC7B,SAASC,EAAI,GAAa;EACxB,IAAI,OAAO,WAAa,KAAa;EACrC,IAAMC,IAAIN,EAAM,QAAQG,CAAK;EAC7B,AAAII,KAAMD,IAAI,KACZN,EAAM,KAAKG,CAAK,GACZH,EAAM,WAAW,KAAG,SAAS,iBAAiB,WAAWC,CAAS,KAC7D,CAACM,KAAMD,KAAK,MACrBN,EAAM,OAAOM,GAAG,CAAC,GACZN,EAAM,UAAQ,SAAS,oBAAoB,WAAWC,CAAS;CAExE;CAEA,AADAO,EAAMC,IAAS,MAAOJ,EAAI,CAAC,CAACE,CAAE,GAAG,EAAE,WAAW,GAAK,CAAC,GAChDG,EAAmB,KAAGC,QAAsBN,EAAI,EAAK,CAAC;AAC5D;ACpBA,SAAgBO,EAAS,GAAsB,GAAc,GAAkB,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