@m3ui-vue/m3ui-vue 1.5.1 → 1.6.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 +43 -32
- package/dist/{MButton-D_uxtJa-.js → MButton-CPghlKb0.js} +8 -9
- package/dist/MButton-CPghlKb0.js.map +1 -0
- package/dist/{MDialog-DT4KAPmn.js → MDialog-X50At1Gk.js} +38 -44
- package/dist/MDialog-X50At1Gk.js.map +1 -0
- package/dist/{MIcon-Bxh9j135.js → MIcon-DpajuUTJ.js} +2 -3
- package/dist/MIcon-DpajuUTJ.js.map +1 -0
- package/dist/{MIconButton-DoNotQ9v.js → MIconButton-BBggVwBV.js} +5 -6
- package/dist/MIconButton-BBggVwBV.js.map +1 -0
- package/dist/{MListItem-CwYrxpPZ.js → MListItem-DVi1j1QI.js} +8 -14
- package/dist/MListItem-DVi1j1QI.js.map +1 -0
- package/dist/{MLoadingIndicator-DhzECYRI.js → MLoadingIndicator-vooA3110.js} +3 -4
- package/dist/MLoadingIndicator-vooA3110.js.map +1 -0
- package/dist/{MMenuItem-Bih0h4-n.js → MMenuItem-CRNZkVVr.js} +13 -25
- package/dist/MMenuItem-CRNZkVVr.js.map +1 -0
- package/dist/{MProgressBar-BCoruxA-.js → MProgressBar-BWly1UKN.js} +3 -8
- package/dist/MProgressBar-BWly1UKN.js.map +1 -0
- package/dist/{MSeekBar-DQPF5FTp.js → MSeekBar-BL2W5_rD.js} +4 -5
- package/dist/MSeekBar-BL2W5_rD.js.map +1 -0
- package/dist/{MSegmentedButton-DL9JtJFX.js → MSegmentedButton-BEB4gXLA.js} +3 -4
- package/dist/MSegmentedButton-BEB4gXLA.js.map +1 -0
- package/dist/{MSlider-BvoMZTy9.js → MSlider-B9NcKTmZ.js} +22 -23
- package/dist/MSlider-B9NcKTmZ.js.map +1 -0
- package/dist/{MSpinner-CgcCQhS9.js → MSpinner-_XpTRkAg.js} +3 -4
- package/dist/MSpinner-_XpTRkAg.js.map +1 -0
- package/dist/{MTextField-BRntFeNR.js → MTextField-DpcPmR5B.js} +12 -16
- package/dist/MTextField-DpcPmR5B.js.map +1 -0
- package/dist/{MTooltip-YyF1CO75.js → MTooltip-BL3jPYPT.js} +10 -12
- package/dist/MTooltip-BL3jPYPT.js.map +1 -0
- package/dist/THIRD_PARTY_LICENSES.md +2 -2
- package/dist/{_plugin-vue_export-helper-B3ysoDQm.js → _plugin-vue_export-helper-Djzt4Yr7.js} +1 -2
- package/dist/{_storageKeys-CYXsUBwK.js → _storageKeys-C4W_4xK4.js} +2 -3
- package/dist/_storageKeys-C4W_4xK4.js.map +1 -0
- package/dist/{_useEscapeStack-CjndQhqg.js → _useEscapeStack-C5-BYr8y.js} +2 -3
- package/dist/_useEscapeStack-C5-BYr8y.js.map +1 -0
- package/dist/api.json +1 -1
- package/dist/barcode.js +1 -2
- package/dist/barcode.js.map +1 -1
- package/dist/chart.js +2 -4
- package/dist/chart.js.map +1 -1
- package/dist/code-editor.js +22 -23
- package/dist/code-editor.js.map +1 -1
- package/dist/{common-0dgrgaPL.js → common-kIb6A2Qu.js} +8 -37
- package/dist/common-kIb6A2Qu.js.map +1 -0
- package/dist/components/MAbsolute.vue.d.ts +5 -3
- package/dist/components/MAlert.vue.d.ts +8 -6
- package/dist/components/MAppBar.vue.d.ts +9 -7
- package/dist/components/MAppBarWithSearch.vue.d.ts +15 -13
- package/dist/components/MAppLayout.vue.d.ts +13 -11
- package/dist/components/MAspectRatio.vue.d.ts +5 -3
- package/dist/components/MAudioPlayer.vue.d.ts +22 -20
- package/dist/components/MAutocomplete.vue.d.ts +1 -1
- package/dist/components/MAvailabilityCalendar.vue.d.ts +19 -17
- package/dist/components/MBadge.vue.d.ts +6 -4
- package/dist/components/MBar.vue.d.ts +14 -12
- package/dist/components/MBarcode.vue.d.ts +5 -3
- package/dist/components/MBeforeAfter.vue.d.ts +12 -10
- package/dist/components/MBodyMap.vue.d.ts +1 -1
- package/dist/components/MBottomAppBar.vue.d.ts +10 -8
- package/dist/components/MBottomSheet.vue.d.ts +8 -6
- package/dist/components/MBottomSheetScaffold.vue.d.ts +9 -7
- package/dist/components/MBox.vue.d.ts +6 -4
- package/dist/components/MButton.vue.d.ts +7 -5
- package/dist/components/MCard.vue.d.ts +12 -10
- package/dist/components/MCenter.vue.d.ts +5 -3
- package/dist/components/MChatBubble.vue.d.ts +6 -4
- package/dist/components/MCheckbox.vue.d.ts +5 -3
- package/dist/components/MChip.vue.d.ts +9 -7
- package/dist/components/MCircleProgressBar.vue.d.ts +6 -4
- package/dist/components/MCodeEditor.vue.d.ts +5 -3
- package/dist/components/MContainer.vue.d.ts +6 -4
- package/dist/components/MContextMenu.vue.d.ts +8 -6
- package/dist/components/MCopyButton.vue.d.ts +1 -1
- package/dist/components/MDataTable.vue.d.ts +21 -19
- package/dist/components/MDialog.vue.d.ts +21 -19
- package/dist/components/MDragHandle.vue.d.ts +1 -1
- package/dist/components/MDrawCanvas.vue.d.ts +5 -3
- package/dist/components/MDrawToolbar.vue.d.ts +7 -5
- package/dist/components/MEmptyState.vue.d.ts +5 -3
- package/dist/components/MExpansionPanel.vue.d.ts +6 -4
- package/dist/components/MExportButton.vue.d.ts +7 -5
- package/dist/components/MFab.vue.d.ts +11 -9
- package/dist/components/MFabMenu.vue.d.ts +3 -3
- package/dist/components/MFixed.vue.d.ts +5 -3
- package/dist/components/MFlex.vue.d.ts +7 -5
- package/dist/components/MFloorPlan.vue.d.ts +3 -3
- package/dist/components/MFloorPlanInspector.vue.d.ts +32 -30
- package/dist/components/MFloorPlanToolbar.vue.d.ts +2 -2
- package/dist/components/MFlow.vue.d.ts +4 -4
- package/dist/components/MFlowControls.vue.d.ts +6 -4
- package/dist/components/MFlowHandle.vue.d.ts +1 -1
- package/dist/components/MFlowNode.vue.d.ts +11 -9
- package/dist/components/MFooter.vue.d.ts +12 -10
- package/dist/components/MFullscreen.vue.d.ts +5 -3
- package/dist/components/MGantt.vue.d.ts +33 -31
- package/dist/components/MGanttControls.vue.d.ts +8 -6
- package/dist/components/MGrid.vue.d.ts +6 -4
- package/dist/components/MIcon.vue.d.ts +5 -0
- package/dist/components/MIconButton.vue.d.ts +1 -1
- package/dist/components/MImageCropper.vue.d.ts +14 -12
- package/dist/components/MInfiniteScroll.vue.d.ts +11 -9
- package/dist/components/MList.vue.d.ts +5 -3
- package/dist/components/MListGroup.vue.d.ts +7 -5
- package/dist/components/MListItem.vue.d.ts +21 -19
- package/dist/components/MListSubheader.vue.d.ts +5 -3
- package/dist/components/MLoadingOverlay.vue.d.ts +10 -8
- package/dist/components/MMap.vue.d.ts +14 -6
- package/dist/components/MMapControl.vue.d.ts +12 -10
- package/dist/components/MMapFeatureInfo.vue.d.ts +11 -9
- package/dist/components/MMapIdentify.vue.d.ts +9 -7
- package/dist/components/MMapLayers.vue.d.ts +13 -11
- package/dist/components/MMapMarker.vue.d.ts +7 -5
- package/dist/components/MMapPopup.vue.d.ts +5 -3
- package/dist/components/MMasonry.vue.d.ts +5 -3
- package/dist/components/MMenu.vue.d.ts +12 -10
- package/dist/components/MMenuItem.vue.d.ts +11 -9
- package/dist/components/MMultiAutocomplete.vue.d.ts +1 -1
- package/dist/components/MMultiSelect.vue.d.ts +6 -4
- package/dist/components/MNavigationDrawer.vue.d.ts +14 -12
- package/dist/components/MNavigationRail.vue.d.ts +7 -5
- package/dist/components/MOdontogram.vue.d.ts +1 -1
- package/dist/components/MOrderBook.vue.d.ts +1 -1
- package/dist/components/MOverlay.vue.d.ts +5 -3
- package/dist/components/MPdfViewer.vue.d.ts +4 -4
- package/dist/components/MPhoneInput.vue.d.ts +11 -9
- package/dist/components/MPosKeypad.vue.d.ts +18 -16
- package/dist/components/MProgressBar.vue.d.ts +1 -1
- package/dist/components/MPullToRefresh.vue.d.ts +5 -3
- package/dist/components/MQRCode.vue.d.ts +7 -5
- package/dist/components/MRadioGroup.vue.d.ts +1 -1
- package/dist/components/MReceipt.vue.d.ts +2 -2
- package/dist/components/MRelative.vue.d.ts +5 -3
- package/dist/components/MResourceTimeline.vue.d.ts +31 -29
- package/dist/components/MResponsive.vue.d.ts +5 -3
- package/dist/components/MResult.vue.d.ts +7 -5
- package/dist/components/MScrollable.vue.d.ts +7 -5
- package/dist/components/MSearchBar.vue.d.ts +13 -11
- package/dist/components/MSearchField.vue.d.ts +7 -5
- package/dist/components/MSection.vue.d.ts +11 -9
- package/dist/components/MSeekBar.vue.d.ts +3 -3
- package/dist/components/MSelect.vue.d.ts +1 -1
- package/dist/components/MShader.vue.d.ts +11 -9
- package/dist/components/MShortNavigationBar.vue.d.ts +1 -1
- package/dist/components/MSideSheet.vue.d.ts +9 -7
- package/dist/components/MSimpleCarousel.vue.d.ts +1 -1
- package/dist/components/MSkeleton.vue.d.ts +2 -2
- package/dist/components/MSlider.vue.d.ts +3 -3
- package/dist/components/MSparkline.vue.d.ts +1 -1
- package/dist/components/MSplitButton.vue.d.ts +7 -5
- package/dist/components/MSplitter.vue.d.ts +9 -7
- package/dist/components/MSpotlightSearch.vue.d.ts +1 -1
- package/dist/components/MStack.vue.d.ts +8 -6
- package/dist/components/MStatCard.vue.d.ts +5 -3
- package/dist/components/MStepper.vue.d.ts +5 -3
- package/dist/components/MSticky.vue.d.ts +5 -3
- package/dist/components/MSubtitle.vue.d.ts +6 -4
- package/dist/components/MSwipeToDismiss.vue.d.ts +11 -9
- package/dist/components/MTable.vue.d.ts +17 -15
- package/dist/components/MText.vue.d.ts +5 -3
- package/dist/components/MTextField.vue.d.ts +6 -4
- package/dist/components/MTimePickerModal.vue.d.ts +1 -1
- package/dist/components/MTitle.vue.d.ts +6 -4
- package/dist/components/MToggleButton.vue.d.ts +5 -3
- package/dist/components/MToolbar.vue.d.ts +24 -22
- package/dist/components/MTooltip.vue.d.ts +10 -8
- package/dist/components/MTopAppBar.vue.d.ts +22 -20
- package/dist/components/MTour.vue.d.ts +28 -26
- package/dist/components/MTransition.vue.d.ts +5 -3
- package/dist/components/MTree.vue.d.ts +6 -4
- package/dist/components/MTreeTable.vue.d.ts +21 -19
- package/dist/components/MTypewriter.vue.d.ts +6 -4
- package/dist/components/MVirtualTable.vue.d.ts +8 -6
- package/dist/components/_MMapLayerItem.vue.d.ts +8 -6
- package/dist/components/_MPdfPage.vue.d.ts +2 -2
- package/dist/components/_MToolbarFab.vue.d.ts +5 -3
- package/dist/components/_MTreeNode.vue.d.ts +13 -11
- package/dist/composables/useMap.d.ts +8 -0
- package/dist/{dist-CrjSW5DN.js → dist-Bj5kEq8G.js} +4 -6
- package/dist/dist-Bj5kEq8G.js.map +1 -0
- package/dist/draw.js +62 -82
- package/dist/draw.js.map +1 -1
- package/dist/{emoji-names-de-BphO5XpV.js → emoji-names-de-Cu3OSpp6.js} +2 -3
- package/dist/emoji-names-de-Cu3OSpp6.js.map +1 -0
- package/dist/{emoji-names-en-9ZvMRvzi.js → emoji-names-en-BNX1pM9h.js} +2 -3
- package/dist/emoji-names-en-BNX1pM9h.js.map +1 -0
- package/dist/{emoji-names-es-DvfWU3Pj.js → emoji-names-es-C_Dafg4D.js} +2 -3
- package/dist/emoji-names-es-C_Dafg4D.js.map +1 -0
- package/dist/{emoji-names-fr-B-jhUlsP.js → emoji-names-fr-D4HTMFuM.js} +2 -3
- package/dist/emoji-names-fr-D4HTMFuM.js.map +1 -0
- package/dist/{emoji-names-ja-l8cMFJo1.js → emoji-names-ja-BCql-Sj6.js} +2 -3
- package/dist/emoji-names-ja-BCql-Sj6.js.map +1 -0
- package/dist/{emoji-names-ko-YP-o9G0c.js → emoji-names-ko-CT8L52nn.js} +2 -3
- package/dist/emoji-names-ko-CT8L52nn.js.map +1 -0
- package/dist/{emoji-names-pt-DGj_Js4M.js → emoji-names-pt-DHiwPiL-.js} +2 -3
- package/dist/emoji-names-pt-DHiwPiL-.js.map +1 -0
- package/dist/{emoji-names-zh-Dzecwtw_.js → emoji-names-zh-L3FXVief.js} +2 -3
- package/dist/emoji-names-zh-L3FXVief.js.map +1 -0
- package/dist/flow.js +351 -374
- package/dist/flow.js.map +1 -1
- package/dist/{flowPaths-CcWOKY4Z.js → flowPaths-BaH7yaUM.js} +3 -8
- package/dist/flowPaths-BaH7yaUM.js.map +1 -0
- package/dist/gantt.js +272 -333
- package/dist/gantt.js.map +1 -1
- package/dist/locales/index.js +1 -2
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui.js +168 -343
- package/dist/m3ui.js.map +1 -1
- package/dist/map.d.ts +1 -1
- package/dist/map.js +521 -520
- package/dist/map.js.map +1 -1
- package/dist/markdown.js +3 -4
- package/dist/markdown.js.map +1 -1
- package/dist/{material-color-utilities-C_iikgRm.js → material-color-utilities-CEFytLsr.js} +15 -32
- package/dist/material-color-utilities-CEFytLsr.js.map +1 -0
- package/dist/media.js +80 -94
- package/dist/media.js.map +1 -1
- package/dist/{motion-DZiXG09o.js → motion-BcejVTeX.js} +2 -3
- package/dist/motion-BcejVTeX.js.map +1 -0
- package/dist/pdf.js +103 -115
- package/dist/pdf.js.map +1 -1
- package/dist/qrcode.js +1 -2
- package/dist/qrcode.js.map +1 -1
- package/dist/rich-text-editor.js +33 -34
- package/dist/rich-text-editor.js.map +1 -1
- package/dist/terminal.js +2 -3
- package/dist/terminal.js.map +1 -1
- package/dist/{useLocale-DLcG3qPC.js → useLocale-COav9m8C.js} +2 -3
- package/dist/useLocale-COav9m8C.js.map +1 -0
- package/dist/{useThemeTokens-DQQcaWbE.js → useThemeTokens-DyAdPQB0.js} +6 -10
- package/dist/useThemeTokens-DyAdPQB0.js.map +1 -0
- package/package.json +32 -32
- package/src/__tests__/MFab.test.ts +10 -1
- package/src/__tests__/MMap.test.ts +16 -1
- package/src/__tests__/_fakeMaplibre.ts +2 -0
- package/src/components/MMap.vue +12 -3
- package/src/components/MMapMeasure.vue +3 -1
- package/src/composables/useMap.ts +17 -0
- package/src/composables/useMapLayers.ts +4 -1
- package/src/map.ts +1 -1
- package/dist/MButton-D_uxtJa-.js.map +0 -1
- package/dist/MDialog-DT4KAPmn.js.map +0 -1
- package/dist/MIcon-Bxh9j135.js.map +0 -1
- package/dist/MIconButton-DoNotQ9v.js.map +0 -1
- package/dist/MListItem-CwYrxpPZ.js.map +0 -1
- package/dist/MLoadingIndicator-DhzECYRI.js.map +0 -1
- package/dist/MMenuItem-Bih0h4-n.js.map +0 -1
- package/dist/MProgressBar-BCoruxA-.js.map +0 -1
- package/dist/MSeekBar-DQPF5FTp.js.map +0 -1
- package/dist/MSegmentedButton-DL9JtJFX.js.map +0 -1
- package/dist/MSlider-BvoMZTy9.js.map +0 -1
- package/dist/MSpinner-CgcCQhS9.js.map +0 -1
- package/dist/MTextField-BRntFeNR.js.map +0 -1
- package/dist/MTooltip-YyF1CO75.js.map +0 -1
- package/dist/_storageKeys-CYXsUBwK.js.map +0 -1
- package/dist/_useEscapeStack-CjndQhqg.js.map +0 -1
- package/dist/common-0dgrgaPL.js.map +0 -1
- package/dist/dist-CrjSW5DN.js.map +0 -1
- package/dist/emoji-names-de-BphO5XpV.js.map +0 -1
- package/dist/emoji-names-en-9ZvMRvzi.js.map +0 -1
- package/dist/emoji-names-es-DvfWU3Pj.js.map +0 -1
- package/dist/emoji-names-fr-B-jhUlsP.js.map +0 -1
- package/dist/emoji-names-ja-l8cMFJo1.js.map +0 -1
- package/dist/emoji-names-ko-YP-o9G0c.js.map +0 -1
- package/dist/emoji-names-pt-DGj_Js4M.js.map +0 -1
- package/dist/emoji-names-zh-Dzecwtw_.js.map +0 -1
- package/dist/flowPaths-CcWOKY4Z.js.map +0 -1
- package/dist/material-color-utilities-C_iikgRm.js.map +0 -1
- package/dist/motion-DZiXG09o.js.map +0 -1
- package/dist/useLocale-DLcG3qPC.js.map +0 -1
- package/dist/useThemeTokens-DQQcaWbE.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MMenuItem-CRNZkVVr.js","names":["_hoisted_1","_openBlock","_createElementBlock","$attrs","_hoisted_2","_hoisted_3","_hoisted_4","MMenuDivider","_openBlock","_createElementBlock","_Fragment","_createElementVNode","_mergeProps","_renderSlot","_createBlock","_Teleport","_createVNode","_Transition","_withCtx","_normalizeClass","_normalizeStyle","_unref","MIcon","_resolveDynamicComponent","_renderList","$slots","_openBlock","_createElementBlock","_createBlock","_resolveDynamicComponent","_normalizeClass","_withCtx","_createVNode","MIcon","_renderSlot","_createElementVNode","_toDisplayString","_unref","_Teleport","_Transition","_normalizeStyle","FAST_SPATIAL","sampleSpring","FAST_EFFECTS","playSamples","useSpring","prefersReducedMotion","motionSprings","MIcon_default","useEscapeStack","_hoisted_1$2","MMenuDivider_default","defineComponent","openBlock","createElementBlock","SHARED_AXIS_OFFSET","SLIDE_SETTLE_MS","SWIPE_SLOP","SWIPE_DISTANCE","SWIPE_VELOCITY","useMenuNav","navStack","ref","currentNav","computed","navDirection","navBox","leaveFromX","leaveFromOpacity","navSlideEnter","dir","anim","el","done","navSlideLeave","htmlEl","from","opacity","resizeAround","prevOverflow","restore","change","to","h","slide","r","pushNav","entry","nextTick","focusFirst","popNav","resetNav","swipe","levelEl","onNavPointerDown","level","onMove","onUp","onCancel","writeDrag","dx","dy","stopListening","a","dt","s","swallowClick","swallowTimer","stopSwallowing","settleBack","width","x","onUnmounted","fitPopup","candidates","margin","size","viewport","last","dropdownX","start","anchor","end","windowSide","align","_hoisted_1$1","_hoisted_2$1","_hoisted_3$1","_hoisted_4$1","_hoisted_5","trajectoryStep","MMenu_default","__expose","props","__props","slots","useSlots","flattenVNodes","out","vnode","vnodes","Fragment","isGapDivider","gap","groups","raw","result","g","isGrouped","focusFirstItem","cachedTrajectory","openTrajectory","samples","scale","scaleVel","alpha","alphaVel","t","currentIdx","cancelActive","finishLeave","playTrajectory","opening","step","frames","i","style","ended","complete","panelEnter","placeX","panelLeave","open","triggerEl","dropdownEl","dropStyle","panelRegistry","inject","provide","watch","oldEl","siblingGroup","anchorRect","openAbove","computePos","rect","spaceBelow","originX","pivot","fromEdge","focusableItems","moveFocus","items","idx","toggle","close","onOutsideClick","panel","onScroll","onKeydown","onMounted","origin","createElementVNode","mergeProps","_ctx","renderSlot","createBlock","Teleport","createVNode","Transition","withCtx","normalizeClass","normalizeStyle","unref","_cache","args","resolveDynamicComponent","renderList","group","createCommentVNode","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","ICON_SPACE","MMenuItem_default","__emit","emit","checkable","selectable","on","slidingIcon","onIcon","position","measurePosition","itemEl","choice","n","prev","next","radii","top","bottom","tl","tr","br","bl","controlEl","iconSlotEl","snap","siblingsObserver","parent","tag","hasChildren","menuClose","nav","showSub","subStyle","positionSub","placeSub","sub","w","left","toggleSub","handleClick","onPointerEnter","onPointerLeave","onSubPointerLeave","related","\"width\"","\"opacity\"","toDisplayString"],"sources":["../src/components/MMenuDivider.vue","../src/composables/_useMenuNav.ts","../src/composables/_popupPosition.ts","../src/components/MMenu.vue","../src/components/MMenuItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A line between groups of items in an MMenu or MContextMenu; with `gap` in an expressive menu it splits the\n * menu into separate rounded groups.\n */\nwithDefaults(\n defineProps<{\n /**\n * Marks this as a group boundary for `MMenu`/`MContextMenu`'s\n * `variant=\"expressive\"` — instead of rendering this divider in place,\n * the parent menu splits its panel into two independently-rounded group\n * boxes with a small gap between them. Has no effect outside an\n * `expressive` menu, where it renders as a normal divider line.\n */\n gap?: boolean\n }>(),\n { gap: false },\n)\n</script>\n\n<template>\n <hr class=\"my-1 border-outline-variant\" />\n</template>\n","import { computed, nextTick, onUnmounted, ref } from 'vue'\nimport { motionSprings } from './motion'\nimport { playSamples, prefersReducedMotion, sampleSpring } from './_springAnimation'\n\n/*\n * Internal (not exported from index.ts): the `submenuMode=\"push\"` navigation shared by MMenu and MContextMenu.\n * A stack of levels (one per opened MMenuItem with #children) shown one at a time in the panel's scroll\n * wrapper (`navBox`), with:\n * - M3's shared axis X between levels: a 30dp slide with a crossfade, the old level fading out quickly and the\n * new one fading in after it. Driven by the Web Animations API through a `:css=\"false\"` Transition: with\n * direction-dependent classes on a mode-less Transition, Vue's class swap unreliably never completed.\n * - the panel's height following the new level on a spring (Standard DefaultSpatial), measured before and\n * after the swap, with no scrollbar while the levels cross.\n * - swipe right to go back on touch: the level follows the finger and, released past a third of the panel\n * (or flung), leaves from where it is; otherwise it springs back.\n */\n\nexport type MenuNavEntry = { icon?: string, header?: () => any, content?: () => any }\n\nconst SHARED_AXIS_OFFSET = 30\n// Back to scrolling once the slide (60ms delay + 300ms) has settled\nconst SLIDE_SETTLE_MS = 380\n// A touch decides between a vertical scroll and a swipe once it has moved this far\nconst SWIPE_SLOP = 8\nconst SWIPE_DISTANCE = 1 / 3\nconst SWIPE_VELOCITY = 0.5 // px/ms\n\nexport function useMenuNav(focusFirst: () => void) {\n const navStack = ref<MenuNavEntry[]>([])\n const currentNav = computed(() => navStack.value[navStack.value.length - 1])\n const navDirection = ref<'forward' | 'backward'>('forward')\n const navBox = ref<HTMLElement>()\n\n // Where a swiped level was released, so its leave starts there instead of jumping back to 0\n let leaveFromX = 0\n let leaveFromOpacity = 1\n\n function navSlideEnter(el: Element, done: () => void) {\n const dir = navDirection.value === 'forward' ? 1 : -1\n const anim = (el as HTMLElement).animate(\n [\n { transform: `translateX(${dir * SHARED_AXIS_OFFSET}px)`, opacity: 0 },\n { transform: 'translateX(0)', opacity: 1 },\n ],\n { duration: 300, delay: 60, easing: 'cubic-bezier(0.05,0.7,0.1,1)', fill: 'backwards' },\n )\n anim.onfinish = done\n }\n\n function navSlideLeave(el: Element, done: () => void) {\n const dir = navDirection.value === 'forward' ? -1 : 1\n const htmlEl = el as HTMLElement\n htmlEl.style.position = 'absolute'\n htmlEl.style.insetInline = '0'\n htmlEl.style.top = '0'\n const from = leaveFromX\n const opacity = leaveFromOpacity\n leaveFromX = 0\n leaveFromOpacity = 1\n const anim = htmlEl.animate(\n [\n { transform: `translateX(${from}px)`, opacity },\n { transform: `translateX(${from + dir * SHARED_AXIS_OFFSET}px)`, opacity: 0 },\n ],\n { duration: 90, easing: 'cubic-bezier(0.3,0,0.8,0.15)', fill: 'forwards' },\n )\n anim.onfinish = done\n }\n\n function resizeAround(change: () => void) {\n const el = navBox.value\n const from = el?.offsetHeight ?? 0\n // Both levels overflow for a moment: no scrollbar until they settle, then the wrapper's own inline value\n const prevOverflow = el?.style.overflowY ?? ''\n if (el) el.style.overflowY = 'hidden'\n const restore = () => { if (el) el.style.overflowY = prevOverflow }\n change()\n if (!el || prefersReducedMotion()) return restore()\n nextTick(() => {\n const to = el.offsetHeight\n const anim = Math.abs(to - from) < 1 ? null\n : playSamples(el, sampleSpring(from, to, 0, motionSprings.standard.defaultSpatial, 0.5), (h) => ({ height: `${h}px` }))\n const slide = new Promise((r) => setTimeout(r, SLIDE_SETTLE_MS))\n Promise.all([slide, anim?.finished.catch(() => {})]).then(restore)\n })\n }\n\n function pushNav(entry: MenuNavEntry) {\n navDirection.value = 'forward'\n resizeAround(() => navStack.value.push(entry))\n nextTick(focusFirst)\n }\n\n function popNav() {\n navDirection.value = 'backward'\n resizeAround(() => navStack.value.pop())\n nextTick(focusFirst)\n }\n\n function resetNav() {\n navStack.value = []\n }\n\n // Swipe back. The wrapper has `touch-action: pan-y` while a level is pushed, so a sideways drag reaches us\n // as pointer events while vertical ones still scroll the list\n let swipe: { id: number, x: number, y: number, level: HTMLElement, width: number, active: boolean, lastX: number, lastT: number, vel: number } | null = null\n\n function levelEl() {\n // The level on screen (a level still leaving has another depth)\n return navBox.value?.querySelector<HTMLElement>(`:scope > [data-menu-level=\"${navStack.value.length}\"]`) ?? null\n }\n\n function onNavPointerDown(e: PointerEvent) {\n if (e.pointerType !== 'touch' || !navStack.value.length || swipe) return\n const level = levelEl()\n if (!level) return\n swipe = { id: e.pointerId, x: e.clientX, y: e.clientY, level, width: navBox.value!.clientWidth, active: false, lastX: e.clientX, lastT: e.timeStamp, vel: 0 }\n window.addEventListener('pointermove', onMove)\n window.addEventListener('pointerup', onUp)\n window.addEventListener('pointercancel', onCancel)\n }\n\n function writeDrag(dx: number) {\n if (!swipe) return\n swipe.level.style.transform = `translateX(${dx}px)`\n swipe.level.style.opacity = String(1 - 0.5 * Math.min(1, dx / swipe.width))\n }\n\n function onMove(e: PointerEvent) {\n if (!swipe || e.pointerId !== swipe.id) return\n const dx = e.clientX - swipe.x\n const dy = e.clientY - swipe.y\n if (!swipe.active) {\n if (Math.hypot(dx, dy) < SWIPE_SLOP) return\n // Vertical (a scroll) or leftwards: not ours\n if (Math.abs(dy) > Math.abs(dx) || dx < 0) return stopListening()\n swipe.active = true\n swipe.x = e.clientX\n swipe.level.getAnimations().forEach((a) => a.finish())\n }\n const dt = e.timeStamp - swipe.lastT\n if (dt > 0) swipe.vel = 0.8 * ((e.clientX - swipe.lastX) / dt) + 0.2 * swipe.vel\n swipe.lastX = e.clientX\n swipe.lastT = e.timeStamp\n writeDrag(Math.max(0, e.clientX - swipe.x))\n }\n\n function onUp(e: PointerEvent) {\n if (!swipe || e.pointerId !== swipe.id) return\n const s = swipe\n stopListening()\n if (!s.active) return\n // The finger lifted on an item: that's not a tap on it. The click comes in a later task, so the guard\n // waits for it a little while\n window.addEventListener('click', swallowClick, { capture: true, once: true })\n clearTimeout(swallowTimer)\n swallowTimer = setTimeout(stopSwallowing, 400)\n const dx = Math.max(0, e.clientX - s.x)\n if (dx > s.width * SWIPE_DISTANCE || s.vel > SWIPE_VELOCITY) {\n leaveFromX = dx\n leaveFromOpacity = Number(s.level.style.opacity || 1)\n popNav()\n }\n else settleBack(s.level, dx)\n }\n\n function onCancel(e: PointerEvent) {\n if (!swipe || e.pointerId !== swipe.id) return\n const s = swipe\n stopListening()\n if (s.active) settleBack(s.level, Math.max(0, s.lastX - s.x))\n }\n\n function settleBack(level: HTMLElement, dx: number) {\n level.style.transform = ''\n level.style.opacity = ''\n if (prefersReducedMotion() || dx < 1) return\n const width = navBox.value?.clientWidth || 1\n playSamples(level, sampleSpring(dx, 0, 0, motionSprings.standard.defaultSpatial, 0.5), (x) => ({\n transform: `translateX(${x}px)`,\n opacity: String(1 - 0.5 * Math.min(1, x / width)),\n }))\n }\n\n let swallowTimer: ReturnType<typeof setTimeout> | undefined\n function stopSwallowing() {\n clearTimeout(swallowTimer)\n window.removeEventListener('click', swallowClick, { capture: true })\n }\n\n function swallowClick(e: Event) {\n e.stopPropagation()\n e.preventDefault()\n }\n\n function stopListening() {\n swipe = null\n window.removeEventListener('pointermove', onMove)\n window.removeEventListener('pointerup', onUp)\n window.removeEventListener('pointercancel', onCancel)\n }\n\n onUnmounted(() => {\n stopListening()\n stopSwallowing()\n })\n\n return { navStack, currentNav, navBox, navSlideEnter, navSlideLeave, pushNav, popNav, resetNav, onNavPointerDown }\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","<script setup lang=\"ts\">\n/**\n * A trigger-based dropdown menu, composed with `MMenuItem` and `MMenuDivider`. Items support unlimited-depth\n * nested submenus via the `#children` slot.\n *\n * @slot trigger The element that opens the menu when clicked; `open` tells whether it's open.\n * @slot default The menu's items (MMenuItem, MMenuDivider or your own markup); `close()` closes the menu.\n */\nimport { computed, Fragment, inject, nextTick, onMounted, onUnmounted, provide, ref, useSlots, watch, type VNode } from 'vue'\nimport MIcon from './MIcon.vue'\nimport MMenuDivider from './MMenuDivider.vue'\nimport { useEscapeStack } from '../composables/_useEscapeStack'\nimport { useMenuNav } from '../composables/_useMenuNav'\nimport { POPUP_MARGIN, dropdownX } from '../composables/_popupPosition'\n\ndefineOptions({ inheritAttrs: false })\n\nconst props = withDefaults(\n defineProps<{\n /** Which edge of the trigger the dropdown aligns to. */\n align?: 'left' | 'right'\n /**\n * How items with a `#children` slot behave.\n * `'flyout'` opens a hover-positioned side panel (desktop).\n * `'push'` replaces the panel's own content with the submenu and a\n * back header — no positioning math, works with touch. Useful for mobile.\n */\n submenuMode?: 'flyout' | 'push'\n /**\n * 'standard' is M3's baseline menu (4dp corners). 'expressive' is M3's rounder 'vertical menu' styling\n * (16dp corners) — combine with `<MMenuDivider gap />` to split the panel into independently-rounded groups\n * with a visible gap, instead of a plain divider line.\n */\n // `'standard'` is M3's baseline menu — square-ish 4dp corners\n // (`MenuTokens.ContainerShape`/`CornerExtraSmall`).\n // `'expressive'` is M3's rounder \"vertical menu\" styling — 16dp corners\n // (`SegmentedMenuTokens.ContainerShape`/`CornerLarge`). Combine with\n // `<MMenuDivider gap />` to split the panel into independently-rounded\n // groups with a visible gap between them, instead of a plain line.\n variant?: 'standard' | 'expressive'\n }>(),\n { align: 'right', submenuMode: 'flyout', variant: 'standard' },\n)\n\nconst slots = useSlots()\n\nfunction flattenVNodes(vnodes: VNode[]): VNode[] {\n const out: VNode[] = []\n for (const vnode of vnodes) {\n if (vnode.type === Fragment && Array.isArray(vnode.children)) {\n out.push(...flattenVNodes(vnode.children as VNode[]))\n } else {\n out.push(vnode)\n }\n }\n return out\n}\n\nfunction isGapDivider(vnode: VNode): boolean {\n if (vnode.type !== MMenuDivider) return false\n const gap = (vnode.props as { gap?: unknown } | null)?.gap\n return gap === '' || gap === true || gap === 'true'\n}\n\n// Splits the default slot's content into groups at each `<MMenuDivider gap />`\n// — only used by the 'expressive' variant to render independently-rounded\n// group boxes. A plain `<MMenuDivider />` (no `gap`) stays a normal in-line\n// divider inside a single group, same as 'standard'.\nconst groups = computed(() => {\n if (props.variant !== 'expressive') return null\n const raw = flattenVNodes((slots.default?.({ close }) ?? []) as VNode[])\n const result: VNode[][] = [[]]\n for (const vnode of raw) {\n if (isGapDivider(vnode)) result.push([])\n else result[result.length - 1]!.push(vnode)\n }\n return result.filter(g => g.length > 0)\n})\nconst isGrouped = computed(() => !!groups.value && groups.value.length > 1)\n\nconst { navStack, currentNav, navBox, navSlideEnter, navSlideLeave, pushNav, popNav, onNavPointerDown } = useMenuNav(() => focusFirstItem())\n\n// The real DropdownMenuContent in Menu.kt animates scale (0.8 -> 1) and alpha\n// (0 -> 1) with actual springs (MotionSchemeKeyTokens.FastSpatial/FastEffects\n// on the Standard scheme, StandardMotionTokens: scale dampingRatio 0.9/\n// stiffness 1400, alpha dampingRatio 1.0/stiffness 3800) — not a duration+\n// easing tween, which is why a cubic-bezier stand-in read as an abrupt cut on\n// close (a bezier can't carry a spring's momentum). But running the *close*\n// as its own independent spring toward the opposite target isn't right\n// either: alpha (stiffness 3800) settles much faster than scale (stiffness\n// 1400), so on close the panel fades to invisible well before it finishes\n// shrinking — you never actually see the shrink. On open this isn't a\n// problem (it becomes visible early, *then* you watch it keep growing), but\n// close needs to be the literal time-reverse of open, not a forward\n// simulation toward reversed targets, so the shrink stays visible the whole\n// time and only the fade races ahead right at the very end (mirroring how\n// the fade led at the very start of open). Simulated once (open direction\n// only) and played back forwards for enter, backwards for leave.\n//\n// A damped spring approaches its target exponentially, so it keeps \"settling\"\n// long after the motion is visually done — with a tight (0.001) tolerance on\n// both position *and* velocity, roughly the last third of the recorded\n// trajectory is values within a fraction of a percent of the target, visually\n// indistinguishable from it. Reversed for close, that flat tail lands at the\n// *start* instead, so nothing visibly happens for the first ~80ms before the\n// close animation actually appears to begin. Trimmed on position alone with a\n// much looser tolerance instead, since that's what's actually visible.\nlet cachedTrajectory: { scale: number, alpha: number }[] | null = null\nconst trajectoryStep = 1 / 240\nfunction openTrajectory() {\n if (cachedTrajectory) return cachedTrajectory\n const samples: { scale: number, alpha: number }[] = []\n let scale = 0.8\n let scaleVel = 0\n let alpha = 0\n let alphaVel = 0\n const scaleDamping = 0.9\n const scaleStiffness = 1400\n const alphaDamping = 1.0\n const alphaStiffness = 3800\n for (let t = 0; t < 1; t += trajectoryStep) {\n samples.push({ scale, alpha })\n scaleVel += (-scaleStiffness * (scale - 1) - 2 * scaleDamping * Math.sqrt(scaleStiffness) * scaleVel) * trajectoryStep\n scale += scaleVel * trajectoryStep\n alphaVel += (-alphaStiffness * (alpha - 1) - 2 * alphaDamping * Math.sqrt(alphaStiffness) * alphaVel) * trajectoryStep\n alpha += alphaVel * trajectoryStep\n const visuallySettled = Math.abs(scale - 1) < 0.003 && Math.abs(alpha - 1) < 0.003\n if (visuallySettled) break\n }\n samples.push({ scale: 1, alpha: 1 })\n cachedTrajectory = samples\n return samples\n}\n\n// Vue interrupts and reverses this mid-flight when the menu is toggled\n// quickly (close while still opening, or vice versa) — it calls the other\n// hook on the same still-mounted element without waiting for `done()`. Both\n// `currentIdx` (how far along the trajectory we are, so a reversal continues\n// smoothly from wherever it currently is instead of snapping back to a fixed\n// start) and `cancelActive` (so the previous animation actually stops instead\n// of running alongside the new one, fighting over the same style) have to live outside this function to survive that interruption.\nlet currentIdx = 0\nlet cancelActive: (() => void) | null = null\n// Set only while a close is playing: stops the animation *and* calls its `done()`.\n// Used on unmount — a menu item that navigates away (e.g. \"Log out\" ->\n// router.push) unmounts this component mid-close, and Vue only removes the\n// Teleported panel from <body> inside the leave's `done()`, so merely\n// cancelling the animation there left the half-closed panel stranded on screen.\nlet finishLeave: (() => void) | null = null\n\nfunction playTrajectory(el: Element, done: () => void, opening: boolean) {\n cancelActive?.()\n const htmlEl = el as HTMLElement\n const samples = openTrajectory()\n const last = samples.length - 1\n const from = Math.round(Math.max(0, Math.min(last, currentIdx)))\n const to = opening ? last : 0\n const step = opening ? 1 : -1\n const frames: { scale: number, alpha: number }[] = []\n for (let i = from; opening ? i <= to : i >= to; i += step) frames.push(samples[i]!)\n const style = (s: { scale: number, alpha: number }) => ({\n transform: `scale(${s.scale})`,\n opacity: String(Math.min(1, Math.max(0, s.alpha))),\n })\n // Played as a Web Animation (see _springAnimation.ts), which the compositor runs, so the open isn't janked by\n // the panel's content mounting at the same moment. The end state goes inline underneath it.\n Object.assign(htmlEl.style, style(samples[to]!))\n let ended = false\n function complete() {\n if (ended) return\n ended = true\n currentIdx = to\n cancelActive = null\n finishLeave = null\n done()\n }\n if (frames.length < 2 || typeof htmlEl.animate !== 'function') return complete()\n const anim = htmlEl.animate(frames.map(style), { duration: (frames.length - 1) * trajectoryStep * 1000, easing: 'linear' })\n anim.finished.catch(() => {})\n anim.onfinish = complete\n cancelActive = () => {\n // Remember where it got to, so the reversal continues from there\n const t = Number(anim.currentTime ?? 0) / (trajectoryStep * 1000)\n currentIdx = Math.max(0, Math.min(last, from + step * t))\n ended = true\n anim.cancel()\n }\n finishLeave = opening ? null : () => { cancelActive?.(); cancelActive = null; finishLeave = null; done() }\n}\nfunction panelEnter(el: Element, done: () => void) {\n placeX(el as HTMLElement)\n playTrajectory(el, done, true)\n}\nfunction panelLeave(el: Element, done: () => void) {\n playTrajectory(el, done, false)\n}\n\nconst open = ref(false)\nconst triggerEl = ref<HTMLElement | null>(null)\nconst dropdownEl = ref<HTMLElement | null>(null)\nconst dropStyle = ref<Record<string, string>>({})\n\n// A menu can be nested inside another MMenu/MContextMenu's slot (e.g. a\n// \"Language\" picker menu inside a \"More options\" overflow menu) — since both\n// Teleport straight to <body>, the outer one's panel DOM never contains the\n// inner one's, so the outer's outside-click check would otherwise see a click\n// inside the nested menu as \"outside\" and close (unmount) itself on\n// mousedown, before the inner button's own click can fire. Sharing one\n// registry of open panel elements across the whole logical (not DOM) menu\n// tree via provide/inject fixes that for arbitrary nesting depth.\nconst panelRegistry = inject<Set<HTMLElement>>('m-menu-panel-registry', new Set())\nprovide('m-menu-panel-registry', panelRegistry)\n\nwatch(dropdownEl, (el, oldEl) => {\n if (oldEl) panelRegistry.delete(oldEl)\n if (el) panelRegistry.add(el)\n})\n\nonUnmounted(() => {\n if (dropdownEl.value) panelRegistry.delete(dropdownEl.value)\n})\n\n// Separate from panelRegistry above: that one is shared all the way down the\n// nesting chain so a click inside a descendant menu never closes an ancestor.\n// This one is scoped to just this menu's *direct* children (e.g. \"Language\"\n// and \"Color palette\", both nested inside the same \"More options\" menu) —\n// without it, opening one no longer closes the other (since panelRegistry now\n// treats a click on either as \"inside\" the shared ancestor), so two sibling\n// pickers could stay open at once. Only one child of the same parent open at\n// a time, like an accordion; doesn't affect unrelated top-level menus.\nconst siblingGroup = inject<{ current: (() => void) | null } | null>('m-menu-sibling-group', null)\nprovide('m-menu-sibling-group', { current: null })\n\n// The vertical side and height from the trigger alone; the horizontal position needs the panel's width, so\n// placeX() sets it once the panel is in the DOM (in its enter hook, before it paints). Until then it sits at the\n// window's left edge, where nothing narrows it while it's measured.\nlet anchorRect: DOMRect | null = null\nconst openAbove = ref(false)\nfunction computePos() {\n if (!triggerEl.value) return\n const rect = triggerEl.value.getBoundingClientRect()\n anchorRect = rect\n const spaceBelow = window.innerHeight - rect.bottom - 8\n openAbove.value = spaceBelow < 200 && rect.top > spaceBelow\n\n const style: Record<string, string> = {\n maxHeight: `${Math.min(openAbove.value ? rect.top - 12 : spaceBelow, 400)}px`,\n maxWidth: `${window.innerWidth - 2 * POPUP_MARGIN}px`,\n left: '0px',\n }\n\n if (openAbove.value) {\n style.bottom = `${window.innerHeight - rect.top + 4}px`\n } else {\n style.top = `${rect.bottom + 4}px`\n }\n\n dropStyle.value = style\n}\n\n// Keeps the panel on screen (Compose's DropdownMenuPositionProvider, see _popupPosition.ts): aligned with the\n// trigger's `align` edge if it fits there, else its other edge, else against the window edge on its side. The\n// animation grows from the trigger, wherever the panel ended up.\nconst originX = ref(props.align === 'right' ? 'right' : 'left')\nfunction placeX(el: HTMLElement) {\n if (!anchorRect) return\n const width = el.offsetWidth\n const x = dropdownX(anchorRect, width, window.innerWidth, props.align === 'right' ? 'end' : 'start')\n const pivot = Math.min(width, Math.max(0, (anchorRect.left + anchorRect.right) / 2 - x))\n const fromEdge = Math.abs(x - anchorRect.left) < 1 ? 'left' : Math.abs(x + width - anchorRect.right) < 1 ? 'right' : `${pivot}px`\n originX.value = fromEdge\n dropStyle.value = { ...dropStyle.value, left: `${x}px` }\n // Now, not on the next render: the enter animation starts this frame\n el.style.left = `${x}px`\n el.style.transformOrigin = `${fromEdge} ${openAbove.value ? 'bottom' : 'top'}`\n}\n\nfunction focusableItems() {\n if (!dropdownEl.value) return []\n return Array.from(\n dropdownEl.value.querySelectorAll<HTMLElement>('button:not(:disabled), a[href]'),\n )\n}\n\nfunction focusFirstItem() {\n nextTick(() => focusableItems()[0]?.focus())\n}\n\nfunction moveFocus(dir: 1 | -1) {\n const items = focusableItems()\n if (!items.length) return\n const idx = items.indexOf(document.activeElement as HTMLElement)\n const next = idx === -1\n ? (dir === 1 ? items[0] : items[items.length - 1])\n : items[(idx + dir + items.length) % items.length]\n next?.focus()\n}\n\nfunction toggle() {\n if (!open.value) {\n if (siblingGroup && siblingGroup.current && siblingGroup.current !== close) {\n siblingGroup.current()\n }\n if (siblingGroup) siblingGroup.current = close\n computePos()\n navStack.value = []\n } else if (siblingGroup?.current === close) {\n siblingGroup.current = null\n }\n open.value = !open.value\n if (open.value) focusFirstItem()\n}\n\nfunction close() {\n if (siblingGroup?.current === close) siblingGroup.current = null\n open.value = false\n}\n\nprovide('m-menu-close', close)\nprovide('m-menu-nav', { mode: props.submenuMode, push: pushNav })\ndefineExpose({ close, open })\n\nfunction onOutsideClick(e: MouseEvent) {\n const t = e.target as Node\n if (triggerEl.value?.contains(t)) return\n for (const panel of panelRegistry) {\n if (panel.contains(t)) return\n }\n if ((t as Element).closest?.('.m3-submenu')) return\n close()\n}\n\n// Scrolling inside any panel of this menu tree (own, or a nested menu's\n// Teleported panel) isn't an \"outside\" scroll — same registry as onOutsideClick\nfunction onScroll(e: Event) {\n if (!open.value) return\n const t = e.target as Node\n for (const panel of panelRegistry) {\n if (panel.contains(t)) return\n }\n if ((t as Element).closest?.('.m3-submenu')) return\n close()\n}\n\n// Escape goes through the library's stack, so a menu open in a dialog or an overlay closes alone (a pushed\n// submenu steps back first)\nuseEscapeStack(() => open.value, () => (navStack.value.length ? popNav() : close()))\n\nfunction onKeydown(e: KeyboardEvent) {\n if (!open.value) return\n if (e.key === 'ArrowDown') { e.preventDefault(); moveFocus(1) }\n else if (e.key === 'ArrowUp') { e.preventDefault(); moveFocus(-1) }\n}\n\nonMounted(() => {\n document.addEventListener('mousedown', onOutsideClick)\n document.addEventListener('keydown', onKeydown)\n window.addEventListener('scroll', onScroll, true)\n})\n\nonUnmounted(() => {\n document.removeEventListener('mousedown', onOutsideClick)\n document.removeEventListener('keydown', onKeydown)\n window.removeEventListener('scroll', onScroll, true)\n if (finishLeave) finishLeave()\n else cancelActive?.()\n})\n\nconst origin = computed(() => `${originX.value} ${openAbove.value ? 'bottom' : 'top'}`)\n</script>\n\n<template>\n <div ref=\"triggerEl\" v-bind=\"$attrs\" class=\"inline-block\" @click=\"toggle\">\n <slot name=\"trigger\" :open=\"open\" />\n </div>\n\n <Teleport to=\"body\">\n <Transition :css=\"false\" @enter=\"panelEnter\" @leave=\"panelLeave\">\n <div\n v-if=\"open\"\n ref=\"dropdownEl\"\n class=\"fixed z-500 min-w-48\"\n :class=\"[\n variant === 'expressive' ? 'rounded-lg' : 'rounded-xs',\n isGrouped ? '' : 'shadow-elevation-2',\n ]\"\n :style=\"{ ...dropStyle, transformOrigin: origin }\"\n >\n <!-- overflow-hidden (for the rounded-corner clip and to clip the push\n submenu's slide) lives on this inner wrapper, never together with\n shadow-elevation-2 on the same box — overflow-hidden clips an\n element's own box-shadow too, so the two have to be on separate\n elements or the shadow gets cut off -->\n <div\n class=\"overflow-hidden\"\n :class=\"[\n variant === 'expressive' ? 'rounded-lg' : 'rounded-xs',\n isGrouped ? '' : 'bg-surface-container',\n ]\"\n >\n <div\n ref=\"navBox\"\n class=\"relative overflow-x-hidden overflow-y-auto overscroll-contain py-1\"\n :style=\"{ maxHeight: dropStyle.maxHeight, touchAction: currentNav ? 'pan-y' : undefined }\"\n @pointerdown=\"onNavPointerDown\"\n >\n <Transition :css=\"false\" @enter=\"navSlideEnter\" @leave=\"navSlideLeave\">\n <div v-if=\"currentNav\" :key=\"navStack.length\" :data-menu-level=\"navStack.length\">\n <!-- Back: a header row in the menu's own item metrics, labelled like an M3 menu group, then a divider -->\n <button\n type=\"button\"\n class=\"flex w-full items-center gap-3 px-4 py-2.5 text-left text-label-large text-on-surface-variant outline-none transition-colors hover:bg-on-surface/8 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary\"\n @click=\"popNav\"\n >\n <MIcon name=\"arrow_back\" :size=\"20\" class=\"shrink-0\" />\n <span class=\"flex-1 truncate\"><component :is=\"() => currentNav?.header?.()\" /></span>\n </button>\n <hr class=\"my-1 border-outline-variant\" />\n <component :is=\"() => currentNav?.content?.()\" />\n </div>\n <div v-else key=\"root\">\n <div v-if=\"isGrouped\" class=\"flex flex-col gap-1 px-1.5\">\n <div v-for=\"(group, i) in groups\" :key=\"i\" class=\"rounded-lg shadow-elevation-2\">\n <div class=\"overflow-hidden rounded-lg bg-surface-container\">\n <component :is=\"() => group\" />\n </div>\n </div>\n </div>\n <slot v-else :close=\"close\" />\n </div>\n </Transition>\n </div>\n </div>\n </div>\n </Transition>\n </Teleport>\n</template>\n","<script setup lang=\"ts\">\n/**\n * An item of an MMenu or MContextMenu: icon, label and a shortcut hint. Put more items in its `#children` slot\n * to make it open a submenu. With `selected` it's one choice of several (Compose's SelectableDropdownMenuItem),\n * with `checked` an on/off setting (CheckableDropdownMenuItem): tertiary-container and rounder while on, with a\n * check that slides in.\n *\n * @slot default Item label text.\n * @slot icon Replaces the leading icon (an `MIcon` with a class, an image, an avatar…), `{ on }` while selected or\n * checked. It gets the icon's 20px box and color\n * @slot children Nested submenu items. In the parent MMenu's default 'flyout' mode, clicking or hovering (mouse\n * only) the item opens a side panel — supports unlimited nesting depth. In 'push' mode, clicking the item\n * instead swaps the whole menu panel to the submenu with a back header; hover does nothing.\n * @event click Emitted when a leaf item (no #children) is clicked. Not emitted for disabled items or for items\n * with #children, since clicking those just opens/toggles the submenu instead.\n * @event update:checked Emitted on click when `checked` is set, with the new value — powers v-model:checked\n */\nimport { computed, inject, nextTick, onMounted, onUnmounted, ref, useSlots, watch } from 'vue'\nimport MIcon from './MIcon.vue'\nimport { FAST_EFFECTS, FAST_SPATIAL, useSpring } from '../composables/_useSpring'\nimport { POPUP_MARGIN, fitPopup } from '../composables/_popupPosition'\n\nconst props = withDefaults(defineProps<{\n /** Material Symbol icon name */\n icon?: string\n /** Keyboard shortcut hint displayed on the right (e.g. \"Ctrl+C\") — hidden when the item has #children */\n shortcut?: string\n /** Vue Router destination — renders as RouterLink instead of button */\n to?: string | Record<string, any>\n /** Disables the item */\n disabled?: boolean\n /** Danger/destructive styling (error color) */\n danger?: boolean\n /** Keep the menu open after this item is clicked. Defaults to true for `checked` items, false otherwise */\n keepOpen?: boolean\n /** Makes it one choice of several (radio-like): selected look while true. Leave unset for a plain item */\n selected?: boolean\n /** Makes it an on/off setting (v-model:checked, checkbox-like): checked look while true. Leave unset for a plain item */\n checked?: boolean\n /**\n * Icon shown while selected or checked. Defaults to a check that slides in when the item has no `icon`;\n * with an `icon`, that icon stays and turns filled\n */\n selectedIcon?: string\n}>(), {\n disabled: false,\n danger: false,\n keepOpen: undefined,\n selected: undefined,\n checked: undefined,\n})\n\nconst emit = defineEmits<{ click: [], 'update:checked': [boolean] }>()\n\nconst slots = useSlots()\nconst checkable = computed(() => props.checked !== undefined)\nconst selectable = computed(() => checkable.value || props.selected !== undefined)\nconst on = computed(() => !!(props.checked ?? props.selected))\n// Without an `icon`, the selected icon (a check by default) only shows while on and slides the label aside\nconst slidingIcon = computed(() => selectable.value && !props.icon && !slots.icon)\nconst onIcon = computed(() => props.selectedIcon ?? (props.icon ? undefined : 'check'))\n\n// Where this item sits in a run of consecutive selectable/checkable siblings, MenuDefaults.itemShape(index,\n// count): the first rounds its top corners, the last its bottom ones, a lone one stays square-ish\nconst position = ref<'single' | 'first' | 'middle' | 'last'>('single')\nfunction measurePosition() {\n const el = itemEl.value\n if (!el || !selectable.value) return\n const choice = (n: Element | null) => !!n?.hasAttribute('data-m3-menu-choice')\n const prev = choice(el.previousElementSibling)\n const next = choice(el.nextElementSibling)\n position.value = prev && next ? 'middle' : prev ? 'last' : next ? 'first' : 'single'\n}\n\n// Item shapes (SegmentedMenuTokens, MenuDefaults' leading/middle/trailing/standalone item shapes): ItemShape\n// 4dp, CornerMedium 12dp on the group's outer corners, ItemSelectedShape 12dp all round; corners morph on\n// FastSpatial. The sliding icon expands on FastSpatial and fades on FastEffects (AnimatedVisibility's\n// expandHorizontally + fadeIn).\nconst ICON_SPACE = 32 // 20dp icon + 12dp to the label\nfunction radii(): number[] {\n if (on.value) return [12, 12, 12, 12]\n const top = position.value === 'first' ? 12 : 4\n const bottom = position.value === 'last' ? 12 : 4\n return [top, top, bottom, bottom]\n}\nconst { snap } = useSpring(\n () => (selectable.value ? [...radii(), slidingIcon.value && on.value ? ICON_SPACE : 0] : []),\n ([tl, tr, br, bl, width]) => {\n const el = controlEl.value instanceof HTMLElement ? controlEl.value : controlEl.value?.$el\n if (el && bl !== undefined) el.style.borderRadius = `${tl}px ${tr}px ${br}px ${bl}px`\n if (iconSlotEl.value && width !== undefined) iconSlotEl.value.style.width = `${width}px`\n },\n FAST_SPATIAL,\n)\n// A position change comes from the layout (items added, removed, the menu opening): jump, don't morph\nwatch(position, () => snap())\n\nlet siblingsObserver: MutationObserver | null = null\nonMounted(() => {\n measurePosition()\n const parent = itemEl.value?.parentElement\n if (!parent) return\n siblingsObserver = new MutationObserver(measurePosition)\n siblingsObserver.observe(parent, { childList: true })\n})\nonUnmounted(() => siblingsObserver?.disconnect())\nwatch(selectable, () => nextTick(measurePosition))\nuseSpring(\n () => (slidingIcon.value ? [on.value ? 1 : 0] : []),\n ([opacity]) => { if (iconSlotEl.value && opacity !== undefined) iconSlotEl.value.style.opacity = String(opacity) },\n FAST_EFFECTS,\n)\n\nconst tag = computed(() => props.to ? 'RouterLink' : 'button')\nconst hasChildren = computed(() => !!slots.children)\nconst menuClose = inject<(() => void) | null>('m-menu-close', null)\nconst nav = inject<{\n mode: 'flyout' | 'push'\n push: (entry: { icon?: string, header?: () => any, content?: () => any }) => void\n} | null>('m-menu-nav', null)\n\nconst itemEl = ref<HTMLElement>()\n// The button, or a RouterLink instance when `to` is set\nconst controlEl = ref<HTMLElement | { $el: HTMLElement }>()\nconst iconSlotEl = ref<HTMLElement>()\nconst showSub = ref(false)\nconst subStyle = ref<Record<string, string>>({})\n\n// To the item's right, else its left, else clamped on screen (see _popupPosition.ts); placeSub() settles it once\n// the submenu is in the DOM and its size is known, before it paints\nfunction positionSub() {\n if (!itemEl.value) return\n const rect = itemEl.value.getBoundingClientRect()\n subStyle.value = {\n position: 'fixed',\n top: `${rect.top}px`,\n left: `${rect.right}px`,\n maxWidth: `${window.innerWidth - 2 * POPUP_MARGIN}px`,\n zIndex: '501',\n }\n}\n\nfunction placeSub(el: Element) {\n if (!itemEl.value) return\n const sub = el as HTMLElement\n const rect = itemEl.value.getBoundingClientRect()\n // Measured at the window's left edge, where nothing narrows it\n sub.style.left = '0px'\n const w = sub.offsetWidth\n const h = sub.offsetHeight\n const left = fitPopup([rect.right, rect.left - w], w, window.innerWidth)\n const top = fitPopup([rect.top, rect.bottom - h], h, window.innerHeight)\n subStyle.value = { ...subStyle.value, left: `${left}px`, top: `${top}px` }\n sub.style.left = `${left}px`\n sub.style.top = `${top}px`\n}\n\nfunction toggleSub() {\n if (showSub.value) {\n showSub.value = false\n return\n }\n positionSub()\n showSub.value = true\n}\n\nfunction handleClick() {\n if (props.disabled) return\n\n if (hasChildren.value) {\n if (nav?.mode === 'push') {\n nav.push({ icon: props.icon, header: slots.default, content: slots.children })\n } else {\n toggleSub()\n }\n return\n }\n\n if (checkable.value) emit('update:checked', !props.checked)\n emit('click')\n if (!(props.keepOpen ?? checkable.value)) menuClose?.()\n}\n\n// Desktop hover convenience for the flyout variant — ignored on touch/pen so a\n// tap doesn't fire a spurious pointerleave (relatedTarget is null on touch)\n// and close the submenu before its click event can land.\nfunction onPointerEnter(e: PointerEvent) {\n if (e.pointerType !== 'mouse' || !hasChildren.value || props.disabled) return\n positionSub()\n showSub.value = true\n}\n\nfunction onPointerLeave(e: PointerEvent) {\n if (e.pointerType !== 'mouse') return\n const related = e.relatedTarget as Element | null\n if (related?.closest('.m3-submenu')) return\n showSub.value = false\n}\n\nfunction onSubPointerLeave(e: PointerEvent) {\n if (e.pointerType !== 'mouse') return\n const related = e.relatedTarget as Element | null\n if (related?.closest('.m3-submenu') || itemEl.value?.contains(related as Node)) return\n showSub.value = false\n}\n</script>\n\n<template>\n <div\n ref=\"itemEl\"\n :data-m3-menu-choice=\"selectable || undefined\"\n @pointerenter=\"onPointerEnter\"\n @pointerleave=\"onPointerLeave\"\n >\n <!-- Selectable/checkable items sit 4dp in from the edges (DropdownMenuSelectableItemPadding) with 12dp\n inside, so their label lines up with plain items; the state layer is a pseudo-element so it can\n tint the selected container too -->\n <component\n :is=\"tag\"\n ref=\"controlEl\"\n :to=\"to || undefined\"\n :type=\"to ? undefined : 'button'\"\n :role=\"selectable ? (checkable ? 'menuitemcheckbox' : 'menuitemradio') : undefined\"\n :aria-checked=\"selectable ? on : undefined\"\n class=\"flex items-center gap-3 py-2.5 text-left text-body-large transition-colors outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary\"\n :class=\"selectable\n ? [\n 'relative mx-1 w-[calc(100%-0.5rem)] px-3 duration-150 before:pointer-events-none before:absolute before:inset-0 before:rounded-[inherit] before:bg-current before:opacity-0 before:transition-opacity',\n on ? 'bg-tertiary-container text-on-tertiary-container' : 'text-on-surface',\n disabled ? 'cursor-not-allowed opacity-[0.38]' : 'cursor-pointer hover:before:opacity-[0.08] active:before:opacity-[0.12]',\n ]\n : [\n 'w-full px-4',\n disabled ? 'cursor-not-allowed opacity-[0.38] text-on-surface' : 'cursor-pointer',\n !disabled && danger ? 'text-error hover:bg-error/8' : '',\n !disabled && !danger ? 'text-on-surface hover:bg-on-surface/8' : '',\n ]\"\n :disabled=\"disabled || undefined\"\n :aria-haspopup=\"hasChildren ? 'menu' : undefined\"\n :aria-expanded=\"hasChildren ? showSub : undefined\"\n @click=\"handleClick\"\n >\n <!-- -mr-3 cancels the flex gap, so the label sits flush while the slot is closed -->\n <span v-if=\"slidingIcon\" ref=\"iconSlotEl\" class=\"-mr-3 flex shrink-0 overflow-hidden\" style=\"width: 0; opacity: 0\">\n <MIcon :name=\"onIcon!\" :size=\"20\" class=\"shrink-0\" />\n </span>\n <span\n v-else-if=\"$slots.icon\"\n class=\"flex size-5 shrink-0 items-center justify-center\"\n :class=\"selectable ? (on ? '' : 'text-on-surface-variant') : danger ? 'text-error' : 'text-on-surface-variant'\"\n >\n <slot name=\"icon\" :on=\"on\" />\n </span>\n <MIcon\n v-else-if=\"icon\"\n :name=\"on && onIcon ? onIcon : icon\"\n :filled=\"on && !onIcon\"\n :size=\"20\"\n class=\"shrink-0\"\n :class=\"selectable ? (on ? '' : 'text-on-surface-variant') : danger ? 'text-error' : 'text-on-surface-variant'\"\n />\n <span class=\"flex-1\"><slot /></span>\n <span v-if=\"shortcut && !hasChildren\" class=\"ml-4 shrink-0 text-label-small text-on-surface-variant opacity-60\">{{ shortcut }}</span>\n <MIcon v-if=\"hasChildren\" name=\"chevron_right\" :size=\"18\" class=\"shrink-0 text-on-surface-variant\" />\n </component>\n\n <!-- Submenu (flyout variant only — \"push\" mode is rendered by the root MMenu/MContextMenu panel) -->\n <Teleport v-if=\"hasChildren && nav?.mode !== 'push'\" to=\"body\">\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 @enter=\"placeSub\"\n >\n <div\n v-if=\"showSub\"\n class=\"m3-submenu min-w-44 rounded-xs shadow-elevation-2\"\n :style=\"subStyle\"\n @pointerleave=\"onSubPointerLeave\"\n >\n <!-- overflow-hidden lives here, separate from shadow-elevation-2 above —\n overflow-hidden clips an element's own box-shadow too -->\n <div class=\"overflow-hidden rounded-xs bg-surface-container py-1\">\n <slot name=\"children\" />\n </div>\n </div>\n </Transition>\n </Teleport>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;E,kBAqBEC,EAAA,GAAAC,EAA0C,MAA1CF,CAA0C;;A,ICFtCuD,KAAqB,IAErBC,KAAkB,KAElBC,IAAa,GACbC,KAAiB,IAAI,GACrBC,IAAiB;AAEvB,SAAgBC,GAAW,GAAwB;CACjD,IAAMC,IAAWC,EAAoB,CAAC,CAAC,GACjCC,IAAaC,QAAeH,EAAS,MAAMA,EAAS,MAAM,SAAS,EAAE,GACrEI,IAAeH,EAA4B,SAAS,GACpDI,IAASJ,EAAiB,GAG5BK,IAAa,GACbC,IAAmB;CAEvB,SAASC,EAAc,GAAa,GAAkB;EACpD,IAAMC,IAAML,EAAa,UAAU,YAAY,IAAI,IAC7CM,IAAQC,EAAmB,QAC/B,CACE;GAAE,WAAW,cAAcF,IAAMf,GAAmB;GAAM,SAAS;EAAE,GACrE;GAAE,WAAW;GAAiB,SAAS;EAAE,CAC3C,GACA;GAAE,UAAU;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BtE,EAAA,YAAQ,CAAKuH,EAAA,SAAzBnO,EAAA,GAAAC,EAAqI,QAArImM,GAAqI1L,EAAlBkG,EAAA,QAAQ,GAAA,CAAA,K;IAC9GuH,EAAA,SAAbnO,EAAA,GAAAE,EAAqGK,GAAA;;KAA3E,MAAK;KAAiB,MAAM;KAAI,OAAM;;;;;;;;;;;;;E,KAIlD4N,EAAA,SAAexN,EAAA0N,CAAA,CAAG,EAAE,SAAI,UAAxCrO,EAAA,GAAAE,EAqBWU,GAAA;;GArB0C,IAAG;E,IACtDN,EAmBaO,GAAA;GAlBX,sBAAmB;GACnB,oBAAiB;GACjB,sBAAmB;GACnB,kBAAe;GACd,SAAO4N;;GAER,SAAApO,SAWM,CAVEiO,EAAA,SADRtO,EAAA,GAAAC,EAWM,OAAA;;IATJ,OAAM;IACL,OAAKa,EAAEyN,EAAA,KAAQ;IACf,gBAAcU;G,IAIfxO,EAEM,OAFN4L,GAEM,CADJ7L,EAAwB0K,EAAA,QAAA,UAAA,C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, defineComponent as a, nextTick as o, normalizeClass as s, normalizeStyle as c, onMounted as l, onUnmounted as u, openBlock as d, ref as f, toDisplayString as p, unref as m, watch as h } from "vue";
|
|
2
|
-
|
|
2
|
+
// src/components/MProgressBar.vue?vue&type=script&setup=true&lang.ts
|
|
3
3
|
var g = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "text-label-small text-on-surface-variant"
|
|
@@ -46,11 +46,7 @@ var g = {
|
|
|
46
46
|
return e < .5 ? 2 * e * e : 1 - (-2 * e + 2) ** 2 / 2;
|
|
47
47
|
}
|
|
48
48
|
function U(e, t, n, r) {
|
|
49
|
-
|
|
50
|
-
e.t0 = -1, e.to = n;
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
e.from = t, e.to = n, e.t0 = r;
|
|
49
|
+
Math.abs(t - n) < .001 ? (e.t0 = -1, e.to = n) : (e.from = t, e.to = n, e.t0 = r);
|
|
54
50
|
}
|
|
55
51
|
function W(e, t) {
|
|
56
52
|
if (e.t0 < 0) return e.to;
|
|
@@ -178,7 +174,6 @@ var g = {
|
|
|
178
174
|
], 64))], 12, v))], 4));
|
|
179
175
|
}
|
|
180
176
|
});
|
|
181
|
-
//#endregion
|
|
182
177
|
export { O as t };
|
|
183
178
|
|
|
184
|
-
//# sourceMappingURL=MProgressBar-
|
|
179
|
+
//# sourceMappingURL=MProgressBar-BWly1UKN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MProgressBar-BWly1UKN.js","names":["_openBlock","_createElementBlock","_normalizeStyle","_toDisplayString","_normalizeClass","_Fragment","_createElementVNode","_unref","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","PERIOD","AMP","STEP","MARGIN_PX","WAVE_START","VALUE_TAU","MProgressBar_default","defineComponent","props","__props","isIndeterminate","computed","clampedValue","ROLES","roleOr","c","colorVars","effectiveThickness","waveMid","waveViewH","waveWidth","staticWavePath","d","x","y","displayedValue","appearanceF","animPhase","appearAnim","easeInOut","t","startAnim","from","to","now","tickAnim","a","v","waveClipEl","ref","trackEl","wavePath","lastTime","rafId","PHASE_PER_MS","buildWavePath","mid","pts","factor","ph","tick","dt","k","margin","dv","prev","initAndStart","stopRaf","onMounted","onUnmounted","watch","nextTick","openBlock","createElementBlock","normalizeStyle","toDisplayString","createCommentVNode","normalizeClass","Fragment","createElementVNode","unref","\"top\"","\"transform\""],"sources":["../src/components/MProgressBar.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A linear progress indicator — determinate, indeterminate, or the M3 Expressive wavy variant.\n */\nimport { computed, ref, watch, onMounted, onUnmounted, nextTick } from \"vue\";\n\nconst props = withDefaults(\n defineProps<{\n /** Progress 0–100 (omit for indeterminate) */\n value?: number;\n /** Indeterminate animation — also implied by omitting value */\n indeterminate?: boolean;\n /** Bar color: an M3 role or any CSS color (`#fff` over a photo, say) */\n color?: \"primary\" | \"secondary\" | \"tertiary\" | \"error\" | (string & {});\n /** Track color: an M3 role or any CSS color. Default the role's container, or the bar color at 24% for a CSS color */\n trackColor?: string;\n /** Bar style */\n variant?: \"linear\" | \"wavy\";\n /** Label text above the bar */\n label?: string;\n /** Stroke width in px. Defaults to 4dp, matching the real M3 token for both variants. */\n thickness?: number;\n }>(),\n { color: \"primary\", variant: \"linear\" },\n);\n\nconst isIndeterminate = computed(() => props.indeterminate || props.value === undefined);\nconst clampedValue = computed(() => Math.min(100, Math.max(0, props.value ?? 0)));\n\nconst ROLES = [\"primary\", \"secondary\", \"tertiary\", \"error\"];\nconst roleOr = (c: string) => (ROLES.includes(c) || c.endsWith(\"-container\") ? `var(--color-${c})` : c);\n// Both colors go through custom properties on the root, read by the bar/track/wave below.\nconst colorVars = computed(() => {\n const bar = roleOr(props.color);\n const track = props.trackColor\n ? roleOr(props.trackColor)\n : ROLES.includes(props.color)\n ? `var(--color-${props.color}-container)`\n : `color-mix(in srgb, ${props.color} 24%, transparent)`;\n return { \"--m3-progress-bar\": bar, \"--m3-progress-track\": track };\n});\n\n// ── Wave geometry ─────────────────────────────────────────────────────────\nconst PERIOD = 20;\nconst AMP = 2.5;\nconst PERIODS = 80;\nconst STEP = 2;\nconst MARGIN_PX = 4; // gap between wave right-end and track start\nconst WAVE_START = 10; // threshold % below which wave collapses to line\n\n// thickness-derived (computed so they react to prop changes)\nconst effectiveThickness = computed(() => props.thickness ?? 4);\nconst waveMid = computed(() => AMP + effectiveThickness.value / 2);\nconst waveViewH = computed(() => 2 * AMP + effectiveThickness.value);\n\nconst waveWidth = PERIOD * PERIODS; // 1600px — covers any container width\n\n// Static path for indeterminate — built once with the wavy default (thickness=3)\nconst STATIC_MID = AMP + 3 / 2; // = 4\nconst staticWavePath = (() => {\n let d = \"\";\n for (let x = 0; x <= waveWidth; x += STEP) {\n const y = STATIC_MID - AMP * Math.sin((x / PERIOD) * Math.PI * 2);\n d += `${x === 0 ? \"M\" : \"L\"}${x},${y.toFixed(2)} `;\n }\n return d.trim();\n})();\n\n// ── rAF state (plain JS — no Vue refs to avoid 60fps reactive overhead) ───\n//\n// Architecture mirrors MCircleProgressBar:\n// • displayedValue follows clampedValue with exponential smoothing (~300ms)\n// • appearanceF animates 0↔1 at the WAVE_START threshold and at 100%\n// • animPhase advances every frame to scroll the wave leftward\n// clip-path and track.left are written via direct DOM setAttribute/style\n// to avoid the CSS-transition vs rAF conflict.\nlet displayedValue = 0;\nlet appearanceF = 0;\nlet animPhase = 0;\n\ntype Anim = { from: number; to: number; t0: number; dur: number };\nconst appearAnim: Anim = { from: 0, to: 0, t0: -1, dur: 500 };\n\nfunction easeInOut(t: number) {\n return t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2;\n}\nfunction startAnim(a: Anim, from: number, to: number, now: number) {\n if (Math.abs(from - to) < 0.001) { a.t0 = -1; a.to = to; return; }\n a.from = from; a.to = to; a.t0 = now;\n}\nfunction tickAnim(a: Anim, now: number): number {\n if (a.t0 < 0) return a.to;\n const t = Math.min(1, (now - a.t0) / a.dur);\n const v = a.from + (a.to - a.from) * easeInOut(t);\n if (t >= 1) a.t0 = -1;\n return v;\n}\n\n// ── Template refs for direct DOM updates ─────────────────────────────────\nconst waveClipEl = ref<HTMLDivElement | null>(null);\nconst trackEl = ref<HTMLDivElement | null>(null);\nconst wavePath = ref(\"\"); // updated in tick → drives path's :d binding\n\n// ── rAF tick ─────────────────────────────────────────────────────────────\nlet lastTime: number | null = null;\nlet rafId = 0;\nconst PHASE_PER_MS = (2 * Math.PI) / 800; // one full PERIOD scroll per 800ms\nconst VALUE_TAU = 130; // exponential τ → ~300ms 90%-settle\n\nfunction buildWavePath(factor: number, ph: number): string {\n const mid = waveMid.value;\n const pts: string[] = [];\n for (let x = 0; x <= waveWidth; x += STEP) {\n const y = mid - AMP * factor * Math.sin((x / PERIOD) * Math.PI * 2 + ph);\n pts.push(`${x === 0 ? \"M\" : \"L\"}${x},${y.toFixed(2)}`);\n }\n return pts.join(\" \");\n}\n\nfunction tick(now: number) {\n const dt = lastTime !== null ? now - lastTime : 0;\n lastTime = now;\n\n // 1. Wave phase scrolls leftward\n animPhase -= dt * PHASE_PER_MS;\n\n // 2. Smooth displayed value (exponential interpolation)\n if (dt > 0) {\n const k = 1 - Math.exp(-dt / VALUE_TAU);\n displayedValue += (clampedValue.value - displayedValue) * k;\n }\n\n // 3. Advance appearance animation\n appearanceF = tickAnim(appearAnim, now);\n\n // 4. Update DOM directly\n const margin = MARGIN_PX * appearanceF;\n const dv = displayedValue;\n\n if (waveClipEl.value)\n waveClipEl.value.style.clipPath = `inset(0 ${(100 - dv).toFixed(3)}% 0 0)`;\n\n if (trackEl.value) {\n trackEl.value.style.left = `calc(${dv.toFixed(3)}% + ${margin.toFixed(2)}px)`;\n trackEl.value.style.height = `${effectiveThickness.value}px`;\n }\n\n // 5. Rebuild wave path (drives :d via Vue ref)\n wavePath.value = buildWavePath(appearanceF, animPhase);\n\n rafId = requestAnimationFrame(tick);\n}\n\n// ── Watchers ─────────────────────────────────────────────────────────────\nwatch(clampedValue, (v, prev) => {\n if (props.variant !== \"wavy\" || isIndeterminate.value) return;\n const now = performance.now();\n\n if (prev <= WAVE_START && v > WAVE_START && v < 100) startAnim(appearAnim, appearanceF, 1, now);\n else if (prev > WAVE_START && v <= WAVE_START) startAnim(appearAnim, appearanceF, 0, now);\n else if (v === 100) startAnim(appearAnim, appearanceF, 0, now);\n else if (prev === 100 && v > WAVE_START) startAnim(appearAnim, appearanceF, 1, now);\n});\n\nfunction initAndStart() {\n displayedValue = clampedValue.value;\n const v = clampedValue.value;\n appearanceF = (v > WAVE_START && v < 100) ? 1 : 0;\n appearAnim.to = appearanceF;\n appearAnim.t0 = -1;\n\n // Set initial DOM values immediately to avoid a one-frame flash\n const margin = MARGIN_PX * appearanceF;\n if (waveClipEl.value)\n waveClipEl.value.style.clipPath = `inset(0 ${(100 - v).toFixed(3)}% 0 0)`;\n if (trackEl.value) {\n trackEl.value.style.left = `calc(${v.toFixed(3)}% + ${margin.toFixed(2)}px)`;\n trackEl.value.style.height = `${effectiveThickness.value}px`;\n }\n wavePath.value = buildWavePath(appearanceF, animPhase);\n\n if (!rafId) rafId = requestAnimationFrame(tick);\n}\n\nfunction stopRaf() {\n cancelAnimationFrame(rafId);\n rafId = 0; lastTime = null;\n appearAnim.t0 = -1;\n}\n\nonMounted(() => {\n if (props.variant === \"wavy\" && !isIndeterminate.value) initAndStart();\n});\nonUnmounted(stopRaf);\n\nwatch(() => props.variant, async (v) => {\n if (v === \"wavy\" && !isIndeterminate.value) { await nextTick(); initAndStart(); }\n else stopRaf();\n});\nwatch(isIndeterminate, async (v) => {\n if (!v && props.variant === \"wavy\") { await nextTick(); initAndStart(); }\n else stopRaf();\n});\n</script>\n\n<template>\n <div class=\"flex flex-col gap-1\" :style=\"colorVars\">\n <span v-if=\"label\" class=\"text-label-small text-on-surface-variant\">{{ label }}</span>\n\n <!-- ── Linear variant ────────────────────────────────────────────────── -->\n <div\n v-if=\"variant === 'linear'\"\n class=\"relative w-full overflow-hidden rounded-full\"\n :class=\"isIndeterminate ? 'bg-(--m3-progress-track)' : ''\"\n :style=\"{ height: `${effectiveThickness}px` }\"\n role=\"progressbar\"\n :aria-valuenow=\"isIndeterminate ? undefined : clampedValue\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n >\n <!-- LinearProgressIndicatorTokens.TrackActiveSpace=4dp: the track starts\n a fixed gap after the active bar, not flush against it. -->\n <template v-if=\"!isIndeterminate\">\n <div\n class=\"absolute inset-y-0 left-0 rounded-full transition-[width] duration-300 ease-in-out bg-(--m3-progress-bar)\"\n :style=\"{ width: `${clampedValue}%` }\"\n />\n <div\n class=\"absolute inset-y-0 right-0 rounded-full transition-[left] duration-300 ease-in-out bg-(--m3-progress-track)\"\n :style=\"{ left: `calc(${clampedValue}% + 4px)` }\"\n />\n </template>\n <div\n v-else\n class=\"absolute inset-y-0 w-2/5 rounded-full animate-[m3-progress-indeterminate_1.6s_ease-in-out_infinite] bg-(--m3-progress-bar)\"\n />\n </div>\n\n <!-- ── Wavy variant ───────────────────────────────────────────────────── -->\n <div\n v-else\n class=\"relative w-full overflow-visible\"\n :style=\"{ height: `${waveViewH}px` }\"\n role=\"progressbar\"\n :aria-valuenow=\"isIndeterminate ? undefined : clampedValue\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n >\n <!-- DETERMINATE — rAF drives clip-path, track.left, and wave path -->\n <template v-if=\"!isIndeterminate\">\n <!-- Active wave, clipped to displayedValue% -->\n <div\n ref=\"waveClipEl\"\n class=\"absolute inset-0 overflow-hidden\"\n style=\"clip-path: inset(0 100% 0 0)\"\n >\n <svg\n class=\"absolute top-0 left-0 h-full text-(--m3-progress-bar)\"\n :width=\"waveWidth\"\n :height=\"waveViewH\"\n :viewBox=\"`0 0 ${waveWidth} ${waveViewH}`\"\n >\n <path\n :d=\"wavePath\"\n fill=\"none\"\n stroke=\"currentColor\"\n :stroke-width=\"effectiveThickness\"\n stroke-linecap=\"round\"\n />\n </svg>\n </div>\n\n <!-- Inactive track — rAF owns left and height; no Vue-managed left -->\n <div\n ref=\"trackEl\"\n class=\"absolute right-0 bg-(--m3-progress-track)\"\n style=\"border-radius: 9999px; top: 50%; transform: translateY(-50%);\"\n />\n\n <!-- Stop dot at far right -->\n <div\n class=\"absolute rounded-full bg-(--m3-progress-bar)\"\n :style=\"{\n right: '0',\n top: '50%',\n transform: 'translateY(-50%)',\n width: `${effectiveThickness}px`,\n height: `${effectiveThickness}px`,\n }\"\n />\n </template>\n\n <!-- INDETERMINATE — keeps original CSS-animated wide strip -->\n <div v-else class=\"absolute inset-0 overflow-hidden rounded-full\">\n <div\n class=\"absolute top-0 left-0 h-full animate-[m3-wave-flow_0.9s_linear_infinite] text-(--m3-progress-bar)\"\n :style=\"{ width: `${waveWidth}px` }\"\n >\n <svg\n :width=\"waveWidth\"\n :height=\"waveViewH\"\n :viewBox=\"`0 0 ${waveWidth} ${waveViewH}`\"\n class=\"h-full\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n :d=\"staticWavePath\"\n fill=\"none\"\n stroke=\"currentColor\"\n :stroke-width=\"effectiveThickness\"\n stroke-linecap=\"round\"\n />\n </svg>\n </div>\n </div>\n </div>\n </div>\n</template>\n\n<style>\n@keyframes m3-wave-flow {\n from { transform: translateX(0); }\n to { transform: translateX(-20px); }\n}\n\n@keyframes m3-progress-indeterminate {\n 0% { left: -40%; }\n 100% { left: 100%; }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .animate-\\[m3-wave-flow_1\\.2s_linear_infinite\\],\n .animate-\\[m3-wave-flow_0\\.9s_linear_infinite\\],\n .animate-\\[m3-progress-indeterminate_1\\.6s_ease-in-out_infinite\\] {\n animation: none !important;\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;A,0DA2CMiB,IAAa,IACbC,IAAa,KAEbC,IAAa,GACbC,IAAa,GACbC,IAAa,IA2DbC,IAAe,K;;;;;;;;;;;;EArGrB,IAAMG,IAAQC,GAoBRC,IAAkBC,QAAeH,EAAM,iBAAiBA,EAAM,UAAU,KAAA,CAAS,GACjFI,IAAkBD,QAAe,KAAK,IAAI,KAAK,KAAK,IAAI,GAAGH,EAAM,SAAS,CAAC,CAAC,CAAC,GAE7EK,IAAQ;GAAC;GAAW;GAAa;GAAY;EAAO,GACpDC,KAAU,MAAeD,EAAM,SAASE,CAAC,KAAKA,EAAE,SAAS,YAAY,IAAI,eAAeA,EAAE,KAAKA,GAE/FC,KAAYL,SAOT;GAAE,qBANGG,EAAON,EAAM,KAMK;GAAK,uBALrBA,EAAM,aAChBM,EAAON,EAAM,UAAU,IACvBK,EAAM,SAASL,EAAM,KAAK,IACxB,eAAeA,EAAM,MAAM,eAC3B,sBAAsBA,EAAM,MAAM;EACwB,EACjE,GAWKS,IAAqBN,QAAeH,EAAM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N,OAAM;E,IAEN9B,EAME,QAAA;GALC,GAAGC,EAAA+B,CAAA;GACJ,MAAK;GACL,QAAO;GACN,gBAAcJ,EAAA;GACf,kBAAe;E,oCA7DvBlC,EAAA,GAAAC,EAyCWI,GAAA,EAAA,KAAA,EAAA,GAAA;GAvCTC,EAmBM,OAAA;IAlBA,SAAA;IAAJ,KAAIiD;IACJ,OAAM;IACN,OAAA,EAAA,aAAA,oBAAA;G,KAEAvD,EAAA,GAAAC,EAaM,OAAA;IAZJ,OAAM;IACL,OAAOoC;IACP,QAAQD,EAAA;IACR,SAAO,OAASC,EAAS,GAAID,EAAA;G,IAE9B9B,EAME,QAAA;IALC,GAAGoD,EAAA;IACJ,MAAK;IACL,QAAO;IACN,gBAAcxB,EAAA;IACf,kBAAe;;GAMrB5B,EAIE,OAAA;IAHI,SAAA;IAAJ,KAAImD;IACJ,OAAM;IACN,OAAA;KAAA,iBAAA;KAAA+B,KAAA;KAAAC,WAAA;IAAA;;GAIFnF,EASE,OAAA;IARA,OAAM;IACL,OAAKJ,EAAA;;;;KAAqH,OAAA,GAAAgC,EAAA,MAAkB;KAA6B,QAAA,GAAAA,EAAA,MAAkB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as e } from "./useLocale-
|
|
1
|
+
import { i as e } from "./useLocale-COav9m8C.js";
|
|
2
2
|
import { Fragment as t, computed as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, defineComponent as o, normalizeClass as s, normalizeStyle as c, onBeforeUnmount as l, onMounted as ee, openBlock as u, ref as d, renderList as te, renderSlot as ne, toDisplayString as f, unref as p, watch as m } from "vue";
|
|
3
|
-
|
|
3
|
+
// src/components/MSeekBar.vue?vue&type=script&setup=true&lang.ts
|
|
4
4
|
var re = [
|
|
5
5
|
"tabindex",
|
|
6
6
|
"aria-label",
|
|
@@ -202,7 +202,7 @@ var re = [
|
|
|
202
202
|
};
|
|
203
203
|
}), F = d(null), I = n(() => h.preview && !b.value ? C.value ?? F.value : null), L = n(() => I.value === null ? null : ye(I.value)), Te = d(), R = d(0), z = null;
|
|
204
204
|
m(Te, (e) => {
|
|
205
|
-
z?.disconnect(),
|
|
205
|
+
z?.disconnect(), e && typeof ResizeObserver < "u" && (R.value = e.offsetWidth, z = new ResizeObserver(() => {
|
|
206
206
|
R.value = e.offsetWidth;
|
|
207
207
|
}), z.observe(e));
|
|
208
208
|
});
|
|
@@ -429,7 +429,6 @@ var re = [
|
|
|
429
429
|
], 2));
|
|
430
430
|
}
|
|
431
431
|
});
|
|
432
|
-
//#endregion
|
|
433
432
|
export { de as t };
|
|
434
433
|
|
|
435
|
-
//# sourceMappingURL=MSeekBar-
|
|
434
|
+
//# sourceMappingURL=MSeekBar-BL2W5_rD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MSeekBar-BL2W5_rD.js","names":["_openBlock","_createElementBlock","_normalizeClass","_normalizeStyle","_toDisplayString","_createElementVNode","_unref","_Fragment","_renderList","_renderSlot","useLocale","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","MSeekBar_default","defineComponent","__emit","props","__props","emit","locale","SIZES","s","computed","dur","inactive","ROLES","colors","active","pad","n","fmt","t","sec","h","m","scrubTime","ref","pos","current","showRemaining","v","toggleRemaining","timeStyle","startText","endText","valueText","chapterAt","found","c","trackEl","width","toPx","thumbX","x","inset","bufferedRanges","b","pieces","W","track","trackH","chapterGap","cuts","cx","gap","p","q","spans","at","c0","c1","full","small","playedTo","a","fills","t0","t1","l","r","stopDot","pressed","focused","hovered","thumbStyle","base","d","scale","dotIdle","narrow","hoverTime","previewTime","previewChapter","bubbleEl","bubbleW","bubbleObserver","el","previewX","half","press","timeAt","clientX","scrubTo","begin","commit","now","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","dx","dy","end","onHover","onLeave","onKeyDown","steps","baseAt","raf","last","amp","phase","wavePathEl","svgH","reducedMotion","ampTarget","advancing","syncPos","drawWave","path","wave","mid","k","length","px","frame","dt","kick","watch","resizeObserver","onMounted","onBeforeUnmount","openBlock","createElementBlock","normalizeClass","normalizeStyle","toDisplayString","createCommentVNode","createElementVNode","unref","_cache","Fragment","renderList","i","j","f","renderSlot","_ctx"],"sources":["../src/components/MSeekBar.vue"],"sourcesContent":["<script lang=\"ts\">\nexport interface SeekBarChapter {\n /** Where the chapter starts, in seconds */\n start: number\n /** Shown in the preview while the pointer is over it */\n title?: string\n}\n</script>\n\n<script setup lang=\"ts\">\n/**\n * A media seek bar (not an M3 spec component; Media3's ProgressSlider is a plain M3 Slider, which this follows in\n * its default look): the playback position on a track with the buffered part, optional chapters, elapsed and\n * total (or remaining) time, and a preview of the time under the pointer. Dragging scrubs locally and seeks once\n * on release (or live, with `live`); a tap or click seeks to that point. While `playing`, it advances on its own\n * between `modelValue` updates, so a 4Hz `timeupdate` still moves it smoothly.\n *\n * @slot preview Replaces the bubble shown above the pointer while hovering or dragging (a frame preview, say).\n * Props: `{ time, formatted, chapter }`\n * @event update:modelValue Emitted on a seek (and continuously while dragging with `live`) — powers v-model\n * @event seek Emitted once per seek with its time: on release of a drag, a tap or click, or a key press\n * @event scrub-start Emitted when a drag starts, with its time\n * @event scrub Emitted while dragging, with the time under the pointer\n * @event update:remaining Emitted when the end label is clicked to switch between total and remaining time\n */\nimport { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue'\nimport { useLocale } from '../composables/useLocale'\n\nconst props = withDefaults(defineProps<{\n /** Playback position in seconds (v-model) */\n modelValue: number\n /** Media length in seconds; 0, NaN or Infinity (not loaded yet, a live stream) disables seeking */\n duration: number\n /** How much is loaded: up to a time, or time ranges (`[[start, end], …]`, like a media element's `buffered`) */\n buffered?: number | [number, number][]\n /** Chapter starts, drawn as gaps in the track; their titles show in the preview */\n chapters?: SeekBarChapter[]\n /** The media is playing: the bar moves on its own between updates, and the wavy line waves */\n playing?: boolean\n /** Playback speed, for that motion between updates */\n playbackRate?: number\n /** Updates the v-model continuously while dragging (the media follows the thumb), not only on release */\n live?: boolean\n /** `slider`: the M3 slider (bar thumb with a gap around it). `line`: a plain line with a round thumb. `wavy`: the played part waves while playing */\n variant?: 'slider' | 'line' | 'wavy'\n /** Track thickness: `md` (16px, the smallest M3 slider), `sm` (8px) or `xs` (4px, over a video) */\n size?: 'xs' | 'sm' | 'md'\n /** Where the elapsed and total time go */\n time?: 'below' | 'sides' | 'none'\n /** The end label shows the remaining time (`-1:23`) instead of the total; clicking it switches (v-model:remaining) */\n remaining?: boolean\n /** Formats a time in seconds. Default `m:ss`, or `h:mm:ss` for media an hour or longer */\n format?: (seconds: number) => string\n /** Seconds the arrow keys move; Page Up/Down move 10% */\n keyStep?: number\n /** Shows the time (and chapter) above the pointer while hovering or dragging */\n preview?: boolean\n /** Played part and thumb: an M3 role (`primary`, `secondary`, `tertiary`, `error`) or any CSS color */\n color?: string\n /** Unplayed track: an M3 role or any CSS color. Default secondary-container */\n trackColor?: string\n /** The time labels' color, as a CSS color (white over a video, say). Default on-surface-variant */\n timeColor?: string\n /** Disables seeking */\n disabled?: boolean\n /** Accessible name. Default the locale's `seekBar` */\n label?: string\n}>(), {\n playing: false,\n playbackRate: 1,\n live: false,\n variant: 'slider',\n size: 'md',\n time: 'below',\n remaining: false,\n keyStep: 5,\n preview: true,\n color: 'primary',\n disabled: false,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [number]\n seek: [number]\n 'scrub-start': [number]\n scrub: [number]\n 'update:remaining': [boolean]\n}>()\n\nconst locale = useLocale()\n\n// track: thickness; thumbH: the bar thumb's height (md = MSlider xs, SliderTokens.HandleHeight); dot: the line\n// variant's round thumb under the pointer, dotIdle at rest (the thinner the line, the more it grows, as a\n// video player's does); gap: around the bar thumb; hit: the pointer target's height; wave/amp/length: the wavy line\nconst SIZES = {\n xs: { track: 4, thumbH: 16, dot: 21, dotIdle: 10, gap: 4, hit: 32, wave: 4, amp: 2.5, length: 18 },\n sm: { track: 8, thumbH: 28, dot: 20, dotIdle: 14, gap: 5, hit: 40, wave: 6, amp: 3, length: 22 },\n md: { track: 16, thumbH: 44, dot: 28, dotIdle: 21, gap: 6, hit: 46, wave: 8, amp: 4, length: 26 },\n}\nconst s = computed(() => SIZES[props.size] ?? SIZES.md)\n\nconst dur = computed(() => (Number.isFinite(props.duration) && props.duration > 0 ? props.duration : 0))\nconst inactive = computed(() => props.disabled || !dur.value)\n\n// ── Colors (as in MSlider: a role name or any CSS color; disabled per SliderTokens) ─────────────────────\nconst ROLES: Record<string, string> = {\n primary: 'var(--color-primary)',\n secondary: 'var(--color-secondary)',\n tertiary: 'var(--color-tertiary)',\n error: 'var(--color-error)',\n 'secondary-container': 'var(--color-secondary-container)',\n}\nconst colors = computed(() => {\n if (props.disabled) {\n return {\n active: 'color-mix(in srgb, var(--color-on-surface) 38%, transparent)',\n inactive: 'color-mix(in srgb, var(--color-on-surface) 12%, transparent)',\n buffered: 'color-mix(in srgb, var(--color-on-surface) 20%, transparent)',\n }\n }\n const active = ROLES[props.color] ?? props.color\n const inactive = props.trackColor ? ROLES[props.trackColor] ?? props.trackColor : 'var(--color-secondary-container)'\n return { active, inactive, buffered: `color-mix(in srgb, ${active} 35%, ${inactive})` }\n})\n\n// ── Time ────────────────────────────────────────────────────────────────────────────────────────────────\nconst pad = (n: number) => String(n).padStart(2, '0')\nfunction fmt(t: number) {\n if (props.format) return props.format(t)\n const sec = Math.max(0, Math.floor(t))\n const h = Math.floor(sec / 3600)\n const m = Math.floor((sec % 3600) / 60)\n return (dur.value >= 3600 ? `${h}:${pad(m)}` : String(h * 60 + m)) + ':' + pad(sec % 60)\n}\n\n// The shown position: the drag's while scrubbing, else `pos`, which follows modelValue and, while playing,\n// advances on its own (only written when it moves half a pixel or crosses a second, so it re-renders rarely)\nconst scrubTime = ref<number | null>(null)\nconst pos = ref(props.modelValue)\nconst current = computed(() => Math.min(dur.value || Infinity, Math.max(0, scrubTime.value ?? pos.value)))\n\nconst showRemaining = ref(props.remaining)\nwatch(() => props.remaining, (v) => { showRemaining.value = v })\nfunction toggleRemaining() {\n showRemaining.value = !showRemaining.value\n emit('update:remaining', showRemaining.value)\n}\nconst timeStyle = computed(() => (props.timeColor ? { color: props.timeColor } : undefined))\nconst startText = computed(() => fmt(current.value))\nconst endText = computed(() => {\n if (!dur.value) return '--:--'\n return showRemaining.value ? `-${fmt(dur.value - current.value)}` : fmt(dur.value)\n})\nconst valueText = computed(() =>\n locale.seekBarValue.replace('{position}', fmt(current.value)).replace('{duration}', dur.value ? fmt(dur.value) : '--:--'),\n)\n\nconst chapterAt = (t: number) => {\n let found: SeekBarChapter | null = null\n for (const c of props.chapters ?? []) if (c.start <= t && (!found || c.start >= found.start)) found = c\n return found\n}\n\n// ── Geometry (px, from the measured track width) ────────────────────────────────────────────────────────\nconst trackEl = ref<HTMLElement>()\nconst width = ref(0)\nconst toPx = (t: number) => (dur.value ? (width.value * Math.min(1, Math.max(0, t / dur.value))) : 0)\n\n// The bar thumb keeps clear of the track's ends, as MSlider's thumbInset; the round one may overhang them\nconst thumbX = computed(() => {\n const x = toPx(current.value)\n if (props.variant === 'line') return x\n const inset = Math.max(2, s.value.track * 0.3)\n return Math.min(width.value - inset, Math.max(inset, x))\n})\n\nconst bufferedRanges = computed<[number, number][]>(() => {\n const b = props.buffered\n if (b === undefined) return []\n return typeof b === 'number' ? [[0, b]] : b\n})\n\ninterface Piece { a: number; b: number; rl: number; rr: number; fills: { left: number; width: number; color: string }[] }\n\n// The track is drawn as pieces between cuts: chapter boundaries, the gap around the bar thumb and, for the wavy\n// line, everything before the thumb (drawn by the SVG). Outer ends get a full radius, cut ends a small one, as\n// the M3 slider's segments.\nconst pieces = computed<Piece[]>(() => {\n const W = width.value\n if (!W) return []\n const { gap } = s.value\n const track = trackH.value\n const x = thumbX.value\n const chapterGap = props.size === 'md' ? 4 : 2\n const cuts: [number, number][] = []\n for (const c of props.chapters ?? []) {\n if (c.start <= 0 || c.start >= dur.value) continue\n const cx = toPx(c.start)\n cuts.push([cx - chapterGap / 2, cx + chapterGap / 2])\n }\n if (props.variant === 'slider') cuts.push([x - gap, x + gap])\n if (props.variant === 'wavy') cuts.push([-Infinity, x + gap])\n cuts.sort((p, q) => p[0] - q[0])\n const spans: [number, number][] = []\n let at = 0\n for (const [c0, c1] of cuts) {\n if (c0 > at) spans.push([at, Math.min(c0, W)])\n at = Math.max(at, c1)\n }\n if (at < W) spans.push([at, W])\n\n const full = track / 2\n const small = Math.min(full, Math.max(1, track / 8))\n const playedTo = props.variant === 'line' ? toPx(current.value) : x\n return spans.filter(([a, b]) => b - a >= 0.5).map(([a, b]) => {\n const fills: Piece['fills'] = []\n for (const [t0, t1] of bufferedRanges.value) {\n const l = Math.max(a, toPx(t0))\n const r = Math.min(b, toPx(t1))\n if (r > l) fills.push({ left: l - a, width: r - l, color: colors.value.buffered })\n }\n if (playedTo > a) fills.push({ left: 0, width: Math.min(b, playedTo) - a, color: colors.value.active })\n return { a, b, rl: a <= 0.01 ? full : small, rr: b >= W - 0.01 ? full : small, fills }\n })\n})\n\n// M3's stop indicator at the far end of a (md) slider track, while the thumb hasn't reached it\nconst stopDot = computed(() => props.variant === 'slider' && props.size === 'md' && thumbX.value < width.value - 12 - s.value.gap)\n\n// ── Thumb ───────────────────────────────────────────────────────────────────────────────────────────────\nconst pressed = ref(false)\nconst focused = ref(false)\nconst hovered = ref(false)\n\n// The line thickens under the pointer, as a video player's does; the wavy line's unplayed part is as thick as the\n// wave's stroke (WavyProgressIndicatorDefaults: the same stroke for indicator and track)\nconst trackH = computed(() => {\n if (props.variant === 'wavy') return s.value.wave\n const t = s.value.track\n return props.variant === 'line' && !inactive.value && (hovered.value || pressed.value) ? t + Math.max(2, t / 4) : t\n})\nconst thumbStyle = computed(() => {\n const base = { left: `${thumbX.value}px`, backgroundColor: colors.value.active }\n if (props.variant === 'line') {\n const { dot: d, dotIdle } = s.value\n const scale = pressed.value || hovered.value || focused.value ? 1 : dotIdle / d\n return { ...base, width: `${d}px`, height: `${d}px`, borderRadius: '50%', transform: `translate(-50%, -50%) scale(${scale})` }\n }\n // Pinches to half its width while pressed or focused, as MSlider (SliderTokens.PressedHandleWidth)\n const narrow = pressed.value || focused.value ? 0.5 : 1\n return { ...base, width: '4px', height: `${s.value.thumbH}px`, borderRadius: '2px', transform: `translate(-50%, -50%) scaleX(${narrow})` }\n})\n\n// ── Preview bubble ──────────────────────────────────────────────────────────────────────────────────────\nconst hoverTime = ref<number | null>(null)\nconst previewTime = computed(() => (props.preview && !inactive.value ? scrubTime.value ?? hoverTime.value : null))\nconst previewChapter = computed(() => (previewTime.value === null ? null : chapterAt(previewTime.value)))\nconst bubbleEl = ref<HTMLElement>()\nconst bubbleW = ref(0)\nlet bubbleObserver: ResizeObserver | null = null\nwatch(bubbleEl, (el) => {\n bubbleObserver?.disconnect()\n if (!el || typeof ResizeObserver === 'undefined') return\n bubbleW.value = el.offsetWidth\n bubbleObserver = new ResizeObserver(() => { bubbleW.value = el.offsetWidth })\n bubbleObserver.observe(el)\n})\n// Centered over the time, but kept within the track\nconst previewX = computed(() => {\n const x = previewTime.value === null ? 0 : toPx(previewTime.value)\n const half = bubbleW.value / 2\n return half * 2 >= width.value ? width.value / 2 : Math.min(width.value - half, Math.max(half, x))\n})\n\n// ── Pointer: mouse/pen scrub from the press; a touch waits to see a horizontal move (touch-action pan-y leaves a\n// vertical one to the page), and a touch that doesn't move is a tap that seeks there ────────────────────────\nlet press: { id: number; x: number; y: number; touch: boolean; started: boolean } | null = null\n\nfunction timeAt(clientX: number) {\n const el = trackEl.value\n if (!el || !dur.value) return 0\n const r = el.getBoundingClientRect()\n return (Math.min(1, Math.max(0, (clientX - r.left) / (r.width || 1)))) * dur.value\n}\n\nfunction scrubTo(t: number) {\n scrubTime.value = t\n emit('scrub', t)\n if (props.live) emit('update:modelValue', t)\n}\n\nfunction begin(e: PointerEvent) {\n if (!press) return\n press.started = true\n pressed.value = true\n const t = timeAt(e.clientX)\n emit('scrub-start', t)\n scrubTo(t)\n}\n\nfunction commit(t: number) {\n emit('update:modelValue', t)\n emit('seek', t)\n // Show it at once; a later modelValue resyncs\n pos.value = t\n base = t\n baseAt = now()\n}\n\nfunction onPointerDown(e: PointerEvent) {\n if (inactive.value || e.button !== 0) return\n press = { id: e.pointerId, x: e.clientX, y: e.clientY, touch: e.pointerType === 'touch', started: false }\n window.addEventListener('pointermove', onPointerMove)\n window.addEventListener('pointerup', onPointerUp)\n window.addEventListener('pointercancel', onPointerCancel)\n if (!press.touch) {\n e.preventDefault()\n trackEl.value?.focus({ preventScroll: true })\n begin(e)\n }\n}\n\nfunction onPointerMove(e: PointerEvent) {\n if (!press || e.pointerId !== press.id) return\n if (!press.started) {\n const dx = Math.abs(e.clientX - press.x)\n const dy = Math.abs(e.clientY - press.y)\n if (dy > 8 && dy > dx) return end()\n if (dx < 4) return\n begin(e)\n }\n scrubTo(timeAt(e.clientX))\n}\n\nfunction onPointerUp(e: PointerEvent) {\n if (!press || e.pointerId !== press.id) return\n const t = press.started ? scrubTime.value ?? timeAt(e.clientX) : timeAt(e.clientX)\n end()\n commit(t)\n}\n\n// The browser took the touch (a scroll): a drag in progress still lands where it was\nfunction onPointerCancel(e: PointerEvent) {\n if (!press || e.pointerId !== press.id) return\n const t = press.started ? scrubTime.value : null\n end()\n if (t !== null) commit(t)\n}\n\nfunction end() {\n press = null\n pressed.value = false\n scrubTime.value = null\n window.removeEventListener('pointermove', onPointerMove)\n window.removeEventListener('pointerup', onPointerUp)\n window.removeEventListener('pointercancel', onPointerCancel)\n}\n\nfunction onHover(e: PointerEvent) {\n if (e.pointerType === 'touch') return\n hovered.value = true\n hoverTime.value = timeAt(e.clientX)\n}\nfunction onLeave() {\n hovered.value = false\n hoverTime.value = null\n}\n\nfunction onKeyDown(e: KeyboardEvent) {\n if (inactive.value) return\n const d = dur.value\n const steps: Record<string, number> = {\n ArrowRight: props.keyStep, ArrowUp: props.keyStep, ArrowLeft: -props.keyStep, ArrowDown: -props.keyStep,\n PageUp: d / 10, PageDown: -d / 10,\n }\n let t: number | null = null\n if (e.key in steps) t = current.value + steps[e.key]!\n else if (e.key === 'Home') t = 0\n else if (e.key === 'End') t = d\n if (t === null) return\n e.preventDefault()\n commit(Math.min(d, Math.max(0, t)))\n}\n\n// ── Motion between updates, and the wave (a rAF loop, only while either needs frames) ───────────────────\nconst now = () => (typeof performance !== 'undefined' ? performance.now() : 0)\nlet base = props.modelValue\nlet baseAt = now()\nlet raf = 0\nlet last = 0\nlet amp = 0\nlet phase = 0\nconst wavePathEl = ref<SVGPathElement>()\nconst svgH = computed(() => s.value.wave + 2 * s.value.amp + 2)\nconst reducedMotion = typeof window !== 'undefined' && !!window.matchMedia?.('(prefers-reduced-motion: reduce)').matches\n\nconst ampTarget = () => (props.variant === 'wavy' && props.playing && scrubTime.value === null ? s.value.amp : 0)\namp = ampTarget()\n\nfunction advancing() {\n return props.playing && scrubTime.value === null && !!dur.value\n}\n\nfunction syncPos(t: number) {\n const W = width.value\n const d = dur.value\n if (Math.floor(t) !== Math.floor(pos.value) || (d && (Math.abs(t - pos.value) * W) / d >= 0.5)) pos.value = t\n}\n\nfunction drawWave() {\n const path = wavePathEl.value\n if (!path) return\n const { wave, length, gap } = s.value\n const half = wave / 2\n const end = thumbX.value - gap - half\n if (end <= half) return path.setAttribute('d', '')\n const mid = svgH.value / 2\n const k = (2 * Math.PI) / length\n let d = ''\n for (let x = half; ; x += 2) {\n const px = Math.min(x, end)\n d += `${d ? 'L' : 'M'}${px.toFixed(1)},${(mid + amp * Math.sin(k * px + phase)).toFixed(2)}`\n if (px >= end) break\n }\n path.setAttribute('d', d)\n}\n\nfunction frame(t: number) {\n const dt = last ? Math.min(0.1, (t - last) / 1000) : 0\n last = t\n if (advancing()) syncPos(Math.min(dur.value, base + ((t - baseAt) / 1000) * props.playbackRate))\n if (props.variant === 'wavy') {\n amp += (ampTarget() - amp) * (1 - Math.exp(-dt / 0.12))\n if (Math.abs(ampTarget() - amp) < 0.01) amp = ampTarget()\n // The wave travels with the playback, one length every 1.25s\n if (props.playing && !reducedMotion) phase -= (dt * 2 * Math.PI) / 1.25\n drawWave()\n }\n if (advancing() || (props.variant === 'wavy' && (amp !== ampTarget() || (props.playing && !reducedMotion)))) {\n raf = requestAnimationFrame(frame)\n } else {\n raf = 0\n last = 0\n }\n}\n\nfunction kick() {\n if (raf || typeof requestAnimationFrame === 'undefined') return\n raf = requestAnimationFrame(frame)\n}\n\nwatch(() => props.modelValue, (v) => {\n base = v\n baseAt = now()\n pos.value = v\n kick()\n})\nwatch(() => props.playing, () => {\n base = pos.value\n baseAt = now()\n kick()\n})\nwatch(scrubTime, (v) => {\n if (v === null) {\n base = pos.value\n baseAt = now()\n }\n kick()\n})\n// Paused, the (flat) wave still follows the thumb\nwatch([thumbX, () => props.variant, () => props.size], () => {\n if (props.variant === 'wavy') drawWave()\n}, { flush: 'post' })\n\nlet resizeObserver: ResizeObserver | null = null\nonMounted(() => {\n const el = trackEl.value!\n width.value = el.clientWidth\n if (typeof ResizeObserver !== 'undefined') {\n resizeObserver = new ResizeObserver(() => { width.value = el.clientWidth })\n resizeObserver.observe(el)\n }\n drawWave()\n kick()\n})\nonBeforeUnmount(() => {\n cancelAnimationFrame(raf)\n resizeObserver?.disconnect()\n bubbleObserver?.disconnect()\n end()\n})\n</script>\n\n<template>\n <div class=\"flex min-w-0 select-none\" :class=\"time === 'sides' ? 'items-center gap-3' : 'flex-col'\">\n <span v-if=\"time === 'sides'\" class=\"min-w-[4ch] shrink-0 text-right text-label-medium tabular-nums\" :class=\"!timeColor && 'text-on-surface-variant'\" :style=\"timeStyle\">{{ startText }}</span>\n\n <div\n ref=\"trackEl\"\n role=\"slider\"\n :tabindex=\"inactive ? -1 : 0\"\n :aria-label=\"label ?? locale.seekBar\"\n aria-valuemin=\"0\"\n :aria-valuemax=\"Math.round(dur)\"\n :aria-valuenow=\"Math.round(current)\"\n :aria-valuetext=\"valueText\"\n :aria-disabled=\"inactive || undefined\"\n class=\"group relative min-w-0 shrink-0 touch-pan-y outline-none\"\n :class=\"[inactive ? 'cursor-default' : 'cursor-pointer', time === 'sides' && 'flex-1']\"\n :style=\"{ height: `${s.hit}px` }\"\n @pointerdown=\"onPointerDown\"\n @pointermove=\"onHover\"\n @pointerleave=\"onLeave\"\n @keydown=\"onKeyDown\"\n @focus=\"focused = true\"\n @blur=\"focused = false\"\n >\n <!-- A grace zone past the hit area (mostly above, where the preview opens), so the pointer doesn't have to\n land exactly on a thin line: its events reach the track like the track's own -->\n <div v-if=\"!inactive\" class=\"absolute inset-x-0 -top-3 -bottom-1\" />\n <div\n v-for=\"(p, i) in pieces\"\n :key=\"i\"\n class=\"absolute top-1/2 -translate-y-1/2 overflow-hidden transition-[height] duration-100\"\n :style=\"{\n left: `${p.a}px`, width: `${p.b - p.a}px`, height: `${trackH}px`,\n borderRadius: `${p.rl}px ${p.rr}px ${p.rr}px ${p.rl}px`, backgroundColor: colors.inactive,\n }\"\n >\n <div\n v-for=\"(f, j) in p.fills\"\n :key=\"j\"\n class=\"absolute inset-y-0\"\n :style=\"{ left: `${f.left}px`, width: `${f.width}px`, backgroundColor: f.color }\"\n />\n </div>\n\n <svg\n v-if=\"variant === 'wavy'\"\n class=\"pointer-events-none absolute top-1/2 left-0 -translate-y-1/2 overflow-visible\"\n :width=\"width\"\n :height=\"svgH\"\n aria-hidden=\"true\"\n >\n <path ref=\"wavePathEl\" fill=\"none\" :stroke=\"colors.active\" :stroke-width=\"s.wave\" stroke-linecap=\"round\" />\n </svg>\n\n <div\n v-if=\"stopDot\"\n class=\"pointer-events-none absolute top-1/2 right-3 size-1 -translate-y-1/2 rounded-full\"\n :style=\"{ backgroundColor: colors.active }\"\n />\n\n <div\n class=\"pointer-events-none absolute top-1/2 transition-transform duration-75 group-focus-visible:ring-2 group-focus-visible:ring-primary group-focus-visible:ring-offset-2 group-focus-visible:ring-offset-surface\"\n :style=\"thumbStyle\"\n />\n\n <div\n v-if=\"previewTime !== null\"\n ref=\"bubbleEl\"\n class=\"pointer-events-none absolute bottom-full z-10 mb-1 -translate-x-1/2\"\n :style=\"{ left: `${previewX}px` }\"\n >\n <slot name=\"preview\" :time=\"previewTime\" :formatted=\"fmt(previewTime)\" :chapter=\"previewChapter\">\n <div class=\"flex h-7 max-w-60 items-center gap-1 rounded-full bg-inverse-surface px-2.5 text-label-medium whitespace-nowrap text-inverse-on-surface tabular-nums\">\n <span v-if=\"previewChapter?.title\" class=\"truncate\">{{ previewChapter.title }} ·</span>\n <span>{{ fmt(previewTime) }}</span>\n </div>\n </slot>\n </div>\n </div>\n\n <div v-if=\"time === 'below'\" class=\"flex items-center justify-between text-label-medium tabular-nums\" :class=\"!timeColor && 'text-on-surface-variant'\" :style=\"timeStyle\">\n <span>{{ startText }}</span>\n <button\n type=\"button\"\n class=\"cursor-pointer rounded-sm outline-none focus-visible:ring-2 focus-visible:ring-secondary\"\n :aria-label=\"showRemaining ? locale.seekBarShowDuration : locale.seekBarShowRemaining\"\n @click=\"toggleRemaining\"\n >{{ endText }}</button>\n </div>\n <button\n v-else-if=\"time === 'sides'\"\n type=\"button\"\n class=\"min-w-[4ch] shrink-0 cursor-pointer rounded-sm text-left text-label-medium tabular-nums outline-none focus-visible:ring-2 focus-visible:ring-secondary\"\n :class=\"!timeColor && 'text-on-surface-variant'\"\n :style=\"timeStyle\"\n :aria-label=\"showRemaining ? locale.seekBarShowDuration : locale.seekBarShowRemaining\"\n @click=\"toggleRemaining\"\n >{{ endText }}</button>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BA,IAAMsB,IAAQC,GAqDRC,IAAOH,IAQPI,IAASf,EAAU,GAKnBgB,KAAQ;GACZ,IAAI;IAAE,OAAO;IAAG,QAAQ;IAAI,KAAK;IAAI,SAAS;IAAI,KAAK;IAAG,KAAK;IAAI,MAAM;IAAG,KAAK;IAAK,QAAQ;GAAG;GACjG,IAAI;IAAE,OAAO;IAAG,QAAQ;IAAI,KAAK;I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OAAKpB,EAAE6C,EAAA,KAAS;G,IACtK3C,EAA4B,QAAA,MAAAD,EAAnB6C,GAAA,KAAS,GAAA,CAAA,GAClB5C,EAKuB,UAAA;IAJrB,MAAK;IACL,OAAM;IACL,cAAYwC,EAAA,QAAgBvC,EAAAmB,CAAA,CAAM,CAAC,sBAAsBnB,EAAAmB,CAAA,CAAM,CAAC;IAChE,SAAOsB;GACN,GAAA3C,EAAA8C,GAAA,KAAO,GAAA,GAAAjC,EAAA,C,SAGAM,EAAA,SAAI,WADjBvB,EAAA,GAAAC,EAQuB,UAAA;;IANrB,MAAK;IACL,OAAKC,EAAA,CAAC,0JAAwJ,CACrJqB,EAAA,aAAS,yBAAA,CAAA;IACjB,OAAKpB,EAAE6C,EAAA,KAAS;IAChB,cAAYH,EAAA,QAAgBvC,EAAAmB,CAAA,CAAM,CAAC,sBAAsBnB,EAAAmB,CAAA,CAAM,CAAC;IAChE,SAAOsB;GACN,GAAA3C,EAAA8C,GAAA,KAAO,GAAA,IAAAhC,EAAA,K"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as e } from "./MIcon-
|
|
1
|
+
import { t as e } from "./MIcon-DpajuUTJ.js";
|
|
2
2
|
import { Fragment as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, defineComponent as o, normalizeClass as s, openBlock as c, renderList as l, toDisplayString as u } from "vue";
|
|
3
|
-
|
|
3
|
+
// src/components/MSegmentedButton.vue?vue&type=script&setup=true&lang.ts
|
|
4
4
|
var d = {
|
|
5
5
|
class: "inline-flex overflow-hidden rounded-full border border-outline",
|
|
6
6
|
role: "group"
|
|
@@ -59,7 +59,6 @@ var d = {
|
|
|
59
59
|
}, null, 8, ["name"])) : r("", !0), a("span", null, u(t.label), 1)], 10, f))), 128))]));
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
|
-
//#endregion
|
|
63
62
|
export { p as t };
|
|
64
63
|
|
|
65
|
-
//# sourceMappingURL=MSegmentedButton-
|
|
64
|
+
//# sourceMappingURL=MSegmentedButton-BEB4gXLA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MSegmentedButton-BEB4gXLA.js","names":["_openBlock","_createElementBlock","_Fragment","_renderList","_normalizeClass","_createBlock","MIcon","_createElementVNode","_toDisplayString","MIcon_default","_hoisted_1","_hoisted_2","MSegmentedButton_default","defineComponent","__emit","emit","isSelected","modelValue","value","toggle","multi","arr","idx","opt","openBlock","createElementBlock","Fragment","renderList","__props","normalizeClass","i","createBlock","createCommentVNode","createElementVNode","toDisplayString"],"sources":["../src/components/MSegmentedButton.vue"],"sourcesContent":["<script lang=\"ts\">\nexport interface SegmentedOption<V extends string | number = string | number> {\n value: V\n label: string\n icon?: string\n disabled?: boolean\n}\n</script>\n\n<script setup lang=\"ts\" generic=\"V extends string | number, M extends V | V[] = V\">\n/**\n * A row of joined segments for choosing between a small set of related options — single or multi select.\n *\n * @event update:modelValue Emitted on selection change — powers v-model\n */\nimport MIcon from './MIcon.vue'\n\nwithDefaults(defineProps<{\n /** Selected value, or values with `multiSelect` (v-model); typed after the options' values */\n modelValue: M\n /** The options to choose from; see `SegmentedOption`. */\n options: SegmentedOption<V>[]\n /** Allow multiple selections */\n multiSelect?: boolean\n /** Button density */\n density?: 'default' | 'comfortable' | 'compact'\n /** Selected segment color */\n color?: 'primary' | 'secondary' | 'tertiary'\n}>(), { multiSelect: false, density: 'default', color: 'primary' })\n\nconst emit = defineEmits<{ 'update:modelValue': [M] }>()\n\nfunction isSelected(value: V, modelValue: M) {\n return Array.isArray(modelValue) ? modelValue.includes(value) : modelValue === value\n}\n\nfunction toggle(opt: SegmentedOption<V>, modelValue: M, multi: boolean) {\n if (opt.disabled) return\n if (multi) {\n const arr: V[] = Array.isArray(modelValue) ? [...modelValue] : [modelValue as V]\n const idx = arr.indexOf(opt.value)\n if (idx >= 0) arr.splice(idx, 1)\n else arr.push(opt.value)\n emit('update:modelValue', arr as M)\n } else {\n emit('update:modelValue', opt.value as M)\n }\n}\n</script>\n\n<template>\n <div\n class=\"inline-flex overflow-hidden rounded-full border border-outline\"\n role=\"group\"\n >\n <button\n v-for=\"(opt, i) in options\"\n :key=\"opt.value\"\n type=\"button\"\n class=\"relative inline-flex grow items-center justify-center gap-2 text-label-large font-medium transition-[background-color,color] duration-150 outline-none before:pointer-events-none before:absolute before:inset-0 before:bg-current before:opacity-0 before:transition-opacity before:duration-150 enabled:hover:before:opacity-[0.08] enabled:active:before:opacity-[0.12]\"\n :class=\"[\n density === 'compact' ? 'h-8 px-3' : density === 'comfortable' ? 'h-10 px-4' : 'h-10 px-6',\n i > 0 ? (opt.disabled ? 'border-l border-outline/12' : 'border-l border-outline') : '',\n opt.disabled ? 'cursor-not-allowed' : 'cursor-pointer',\n isSelected(opt.value, modelValue) && (\n color === 'secondary' ? 'bg-secondary-container'\n : color === 'tertiary' ? 'bg-tertiary-container'\n : 'bg-primary-container'\n ),\n opt.disabled\n ? 'text-on-surface/38'\n : isSelected(opt.value, modelValue)\n ? color === 'secondary' ? 'text-on-secondary-container'\n : color === 'tertiary' ? 'text-on-tertiary-container'\n : 'text-on-primary-container'\n : 'text-on-surface',\n ]\"\n :disabled=\"opt.disabled\"\n :aria-pressed=\"isSelected(opt.value, modelValue)\"\n @click=\"toggle(opt, modelValue, multiSelect)\"\n >\n <MIcon\n v-if=\"isSelected(opt.value, modelValue)\"\n name=\"check\"\n :size=\"18\"\n class=\"transition-transform duration-150\"\n />\n <MIcon v-else-if=\"opt.icon\" :name=\"opt.icon\" :size=\"18\" />\n <span>{{ opt.label }}</span>\n </button>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EA8BA,IAAMe,IAAOD;EAEb,SAASE,EAAW,GAAU,GAAe;GAC3C,OAAO,MAAM,QAAQC,CAAU,IAAIA,EAAW,SAASC,CAAK,IAAID,MAAeC;EACjF;EAEA,SAASC,EAAO,GAAyB,GAAe,GAAgB;GACtE,IAAI,GAAI,UACR;QAAIC,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MAAAC,EAAnBe,EAAI,KAAK,GAAA,CAAA,C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "./
|
|
1
|
+
import { t as e } from "./MIcon-DpajuUTJ.js";
|
|
2
|
+
import { i as t } from "./useLocale-COav9m8C.js";
|
|
3
3
|
import { Fragment as n, Transition as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createVNode as l, defineComponent as u, normalizeClass as d, normalizeStyle as f, onBeforeUnmount as ee, onMounted as te, openBlock as p, ref as m, renderList as ne, toDisplayString as h, unref as re, withCtx as ie } from "vue";
|
|
4
|
-
|
|
4
|
+
// src/components/MSlider.vue?vue&type=script&setup=true&lang.ts
|
|
5
5
|
var ae = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "flex items-center justify-between"
|
|
@@ -65,7 +65,7 @@ var ae = {
|
|
|
65
65
|
},
|
|
66
66
|
emits: ["update:modelValue"],
|
|
67
67
|
setup(u, { emit: fe }) {
|
|
68
|
-
let g = u, _ = fe, pe =
|
|
68
|
+
let g = u, _ = fe, pe = t(), v = m(), me = m([]), y = m(!1), b = m(!1), x = m(null), S = m(null), C = !1;
|
|
69
69
|
function he(e) {
|
|
70
70
|
C = !0, me.value[e]?.focus({ preventScroll: !0 }), C = !1;
|
|
71
71
|
}
|
|
@@ -105,7 +105,7 @@ var ae = {
|
|
|
105
105
|
e && (M.value = w.value ? e.offsetHeight : e.offsetWidth);
|
|
106
106
|
};
|
|
107
107
|
te(() => {
|
|
108
|
-
xe(),
|
|
108
|
+
xe(), typeof ResizeObserver < "u" && v.value && (N = new ResizeObserver(xe), N.observe(v.value));
|
|
109
109
|
}), ee(() => N?.disconnect());
|
|
110
110
|
let P = (e) => {
|
|
111
111
|
let t = I.value.thumbInset;
|
|
@@ -353,7 +353,7 @@ var ae = {
|
|
|
353
353
|
};
|
|
354
354
|
}
|
|
355
355
|
let Ye = i(() => T.value ? `${E.value.lo} – ${E.value.hi}` : String(g.modelValue)), Xe = i(() => T.value && typeof y.value == "number" ? y.value === 0 ? E.value.lo : E.value.hi : g.modelValue), Ze = i(() => T.value && typeof y.value == "number" ? y.value === 0 ? k.value : A.value : k.value);
|
|
356
|
-
return (
|
|
356
|
+
return (t, i) => (p(), s("div", { class: d(["flex select-none", w.value ? "h-full flex-col items-center" : "flex-col gap-1"]) }, [u.label || u.showValue ? (p(), s("div", ae, [u.label ? (p(), s("span", oe, h(u.label), 1)) : o("", !0), u.showValue ? (p(), s("span", se, h(Ye.value), 1)) : o("", !0)])) : o("", !0), c("div", { class: d(["flex items-center", w.value ? "flex-1 flex-col" : ""]) }, [c("div", {
|
|
357
357
|
ref_key: "trackEl",
|
|
358
358
|
ref: v,
|
|
359
359
|
role: T.value ? "group" : "slider",
|
|
@@ -549,7 +549,7 @@ var ae = {
|
|
|
549
549
|
})
|
|
550
550
|
}, null, 4)
|
|
551
551
|
], 64)) : o("", !0),
|
|
552
|
-
u.icon ? (p(), a(
|
|
552
|
+
u.icon ? (p(), a(e, {
|
|
553
553
|
key: 3,
|
|
554
554
|
name: u.icon,
|
|
555
555
|
size: I.value.iconSize,
|
|
@@ -631,30 +631,30 @@ var ae = {
|
|
|
631
631
|
})
|
|
632
632
|
}, null, 4))), 128)) : o("", !0)
|
|
633
633
|
], 4),
|
|
634
|
-
T.value ? (p(), s(n, { key: 1 }, ne([0, 1], (
|
|
635
|
-
key:
|
|
634
|
+
T.value ? (p(), s(n, { key: 1 }, ne([0, 1], (t) => c("div", {
|
|
635
|
+
key: t,
|
|
636
636
|
ref_for: !0,
|
|
637
|
-
ref: (
|
|
638
|
-
|
|
637
|
+
ref: (e) => {
|
|
638
|
+
e && (me.value[t] = e);
|
|
639
639
|
},
|
|
640
640
|
role: "slider",
|
|
641
641
|
tabindex: u.disabled ? -1 : 0,
|
|
642
|
-
"aria-label":
|
|
643
|
-
"aria-valuenow":
|
|
644
|
-
"aria-valuemin":
|
|
645
|
-
"aria-valuemax":
|
|
642
|
+
"aria-label": t === 0 ? re(pe).sliderRangeStart : re(pe).sliderRangeEnd,
|
|
643
|
+
"aria-valuenow": t === 0 ? E.value.lo : E.value.hi,
|
|
644
|
+
"aria-valuemin": t === 0 ? u.min : E.value.lo,
|
|
645
|
+
"aria-valuemax": t === 0 ? E.value.hi : u.max,
|
|
646
646
|
"aria-disabled": u.disabled || void 0,
|
|
647
647
|
"aria-orientation": u.orientation,
|
|
648
|
-
class: d(["pointer-events-none flex items-center justify-center rounded-full outline-none", S.value ===
|
|
649
|
-
style: f(u.thumbIcon ? qe(
|
|
650
|
-
onKeydown: (
|
|
651
|
-
onFocus: (
|
|
648
|
+
class: d(["pointer-events-none flex items-center justify-center rounded-full outline-none", S.value === t && "ring-2 ring-offset-2 ring-offset-surface"]),
|
|
649
|
+
style: f(u.thumbIcon ? qe(t === 0 ? k.value : A.value) : Ke(t === 0 ? k.value : A.value, t)),
|
|
650
|
+
onKeydown: (e) => Me(t, e),
|
|
651
|
+
onFocus: (e) => ge(t),
|
|
652
652
|
onBlur: _e
|
|
653
|
-
}, [u.thumbIcon ? (p(), a(
|
|
653
|
+
}, [u.thumbIcon ? (p(), a(e, {
|
|
654
654
|
key: 0,
|
|
655
655
|
name: u.thumbIcon,
|
|
656
656
|
size: I.value.thumbIconSize
|
|
657
|
-
}, null, 8, ["name", "size"])) : o("", !0)], 46, le)), 64)) : (p(), s(n, { key: 0 }, [u.thumbIcon ? (p(), a(
|
|
657
|
+
}, null, 8, ["name", "size"])) : o("", !0)], 46, le)), 64)) : (p(), s(n, { key: 0 }, [u.thumbIcon ? (p(), a(e, {
|
|
658
658
|
key: 0,
|
|
659
659
|
name: u.thumbIcon,
|
|
660
660
|
size: I.value.thumbIconSize,
|
|
@@ -685,7 +685,6 @@ var ae = {
|
|
|
685
685
|
], 46, ce)], 2)], 2));
|
|
686
686
|
}
|
|
687
687
|
});
|
|
688
|
-
//#endregion
|
|
689
688
|
export { fe as t };
|
|
690
689
|
|
|
691
|
-
//# sourceMappingURL=MSlider-
|
|
690
|
+
//# sourceMappingURL=MSlider-B9NcKTmZ.js.map
|