@expressivecss/expressive 0.15.0 → 0.17.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/CHANGELOG.md +1807 -1
- package/README.md +9 -8
- package/dist/css/expressive.css +19176 -11958
- package/dist/css/expressive.css.map +1 -1
- package/dist/css/expressive.min.css +1 -1
- package/dist/css/expressive.min.css.map +1 -1
- package/dist/fonts/LICENSE-noto-sans-arabic +93 -0
- package/dist/fonts/LICENSE-noto-sans-hebrew +93 -0
- package/dist/fonts/LICENSE-noto-sans-thai +93 -0
- package/dist/fonts/material-symbols-outlined.woff2 +0 -0
- package/dist/fonts/material-symbols-rounded.woff2 +0 -0
- package/dist/fonts/material-symbols-sharp.woff2 +0 -0
- package/dist/fonts/noto-sans-arabic-arabic-400.woff2 +0 -0
- package/dist/fonts/noto-sans-arabic-arabic-500.woff2 +0 -0
- package/dist/fonts/noto-sans-arabic-arabic-700.woff2 +0 -0
- package/dist/fonts/noto-sans-cyrillic-400.woff2 +0 -0
- package/dist/fonts/noto-sans-cyrillic-500.woff2 +0 -0
- package/dist/fonts/noto-sans-cyrillic-700.woff2 +0 -0
- package/dist/fonts/noto-sans-cyrillic-ext-400.woff2 +0 -0
- package/dist/fonts/noto-sans-cyrillic-ext-500.woff2 +0 -0
- package/dist/fonts/noto-sans-cyrillic-ext-700.woff2 +0 -0
- package/dist/fonts/noto-sans-devanagari-400.woff2 +0 -0
- package/dist/fonts/noto-sans-devanagari-500.woff2 +0 -0
- package/dist/fonts/noto-sans-devanagari-700.woff2 +0 -0
- package/dist/fonts/noto-sans-greek-400.woff2 +0 -0
- package/dist/fonts/noto-sans-greek-500.woff2 +0 -0
- package/dist/fonts/noto-sans-greek-700.woff2 +0 -0
- package/dist/fonts/noto-sans-greek-ext-400.woff2 +0 -0
- package/dist/fonts/noto-sans-greek-ext-500.woff2 +0 -0
- package/dist/fonts/noto-sans-greek-ext-700.woff2 +0 -0
- package/dist/fonts/noto-sans-hebrew-hebrew-400.woff2 +0 -0
- package/dist/fonts/noto-sans-hebrew-hebrew-500.woff2 +0 -0
- package/dist/fonts/noto-sans-hebrew-hebrew-700.woff2 +0 -0
- package/dist/fonts/noto-sans-latin-700.woff2 +0 -0
- package/dist/fonts/noto-sans-latin-ext-400.woff2 +0 -0
- package/dist/fonts/noto-sans-latin-ext-500.woff2 +0 -0
- package/dist/fonts/noto-sans-latin-ext-700.woff2 +0 -0
- package/dist/fonts/noto-sans-thai-thai-400.woff2 +0 -0
- package/dist/fonts/noto-sans-thai-thai-500.woff2 +0 -0
- package/dist/fonts/noto-sans-thai-thai-700.woff2 +0 -0
- package/dist/fonts/noto-sans-vietnamese-400.woff2 +0 -0
- package/dist/fonts/noto-sans-vietnamese-500.woff2 +0 -0
- package/dist/fonts/noto-sans-vietnamese-700.woff2 +0 -0
- package/dist/fonts/roboto-cyrillic-400.woff2 +0 -0
- package/dist/fonts/roboto-cyrillic-500.woff2 +0 -0
- package/dist/fonts/roboto-cyrillic-700.woff2 +0 -0
- package/dist/fonts/roboto-cyrillic-ext-400.woff2 +0 -0
- package/dist/fonts/roboto-cyrillic-ext-500.woff2 +0 -0
- package/dist/fonts/roboto-cyrillic-ext-700.woff2 +0 -0
- package/dist/fonts/roboto-greek-400.woff2 +0 -0
- package/dist/fonts/roboto-greek-500.woff2 +0 -0
- package/dist/fonts/roboto-greek-700.woff2 +0 -0
- package/dist/fonts/roboto-greek-ext-400.woff2 +0 -0
- package/dist/fonts/roboto-greek-ext-500.woff2 +0 -0
- package/dist/fonts/roboto-greek-ext-700.woff2 +0 -0
- package/dist/fonts/roboto-latin-700.woff2 +0 -0
- package/dist/fonts/roboto-latin-ext-400.woff2 +0 -0
- package/dist/fonts/roboto-latin-ext-500.woff2 +0 -0
- package/dist/fonts/roboto-latin-ext-700.woff2 +0 -0
- package/dist/fonts/roboto-vietnamese-400.woff2 +0 -0
- package/dist/fonts/roboto-vietnamese-500.woff2 +0 -0
- package/dist/fonts/roboto-vietnamese-700.woff2 +0 -0
- package/dist/js/chunks/chunk-26VUH75M.mjs +102 -0
- package/dist/js/chunks/chunk-26VUH75M.mjs.map +7 -0
- package/dist/js/chunks/chunk-2LFCOGC3.mjs +233 -0
- package/dist/js/chunks/chunk-2LFCOGC3.mjs.map +7 -0
- package/dist/js/chunks/{chunk-DXGRXYYL.mjs → chunk-36GELQGX.mjs} +29 -46
- package/dist/js/chunks/chunk-36GELQGX.mjs.map +7 -0
- package/dist/js/chunks/{chunk-74MXKKLN.mjs → chunk-3FKWIRHW.mjs} +15 -29
- package/dist/js/chunks/chunk-3FKWIRHW.mjs.map +7 -0
- package/dist/js/chunks/chunk-3KF65KGL.mjs +209 -0
- package/dist/js/chunks/chunk-3KF65KGL.mjs.map +7 -0
- package/dist/js/chunks/{chunk-KVJAVDBC.mjs → chunk-3KLZRQZI.mjs} +88 -116
- package/dist/js/chunks/chunk-3KLZRQZI.mjs.map +7 -0
- package/dist/js/chunks/{chunk-CK2XCICY.mjs → chunk-3XORNED5.mjs} +3 -11
- package/dist/js/chunks/chunk-3XORNED5.mjs.map +7 -0
- package/dist/js/chunks/chunk-4WBGAQN3.mjs +113 -0
- package/dist/js/chunks/chunk-4WBGAQN3.mjs.map +7 -0
- package/dist/js/chunks/{chunk-FM5CZOUB.mjs → chunk-5F4URJHL.mjs} +19 -30
- package/dist/js/chunks/chunk-5F4URJHL.mjs.map +7 -0
- package/dist/js/chunks/chunk-67UNY7RH.mjs +299 -0
- package/dist/js/chunks/chunk-67UNY7RH.mjs.map +7 -0
- package/dist/js/chunks/chunk-7CXNATJS.mjs +97 -0
- package/dist/js/chunks/chunk-7CXNATJS.mjs.map +7 -0
- package/dist/js/chunks/{chunk-UETTGDLI.mjs → chunk-7X44MKEQ.mjs} +43 -48
- package/dist/js/chunks/chunk-7X44MKEQ.mjs.map +7 -0
- package/dist/js/chunks/chunk-7ZAMOMGY.mjs +440 -0
- package/dist/js/chunks/chunk-7ZAMOMGY.mjs.map +7 -0
- package/dist/js/chunks/chunk-AEG6LOAJ.mjs +54 -0
- package/dist/js/chunks/chunk-AEG6LOAJ.mjs.map +7 -0
- package/dist/js/chunks/chunk-AQNFCJJ5.mjs +135 -0
- package/dist/js/chunks/chunk-AQNFCJJ5.mjs.map +7 -0
- package/dist/js/chunks/chunk-B55LWKBM.mjs +75 -0
- package/dist/js/chunks/chunk-B55LWKBM.mjs.map +7 -0
- package/dist/js/chunks/chunk-BB5VXYXT.mjs +28 -0
- package/dist/js/chunks/chunk-BB5VXYXT.mjs.map +7 -0
- package/dist/js/chunks/chunk-BDATLH3H.mjs +108 -0
- package/dist/js/chunks/chunk-BDATLH3H.mjs.map +7 -0
- package/dist/js/chunks/chunk-CWMQOT4O.mjs +232 -0
- package/dist/js/chunks/chunk-CWMQOT4O.mjs.map +7 -0
- package/dist/js/chunks/chunk-CY2CTOVM.mjs +81 -0
- package/dist/js/chunks/chunk-CY2CTOVM.mjs.map +7 -0
- package/dist/js/chunks/{chunk-NUHMOAOY.mjs → chunk-DWA5UYLJ.mjs} +363 -218
- package/dist/js/chunks/chunk-DWA5UYLJ.mjs.map +7 -0
- package/dist/js/chunks/chunk-EB2V4OKL.mjs +79 -0
- package/dist/js/chunks/chunk-EB2V4OKL.mjs.map +7 -0
- package/dist/js/chunks/chunk-EWO662ZC.mjs +188 -0
- package/dist/js/chunks/chunk-EWO662ZC.mjs.map +7 -0
- package/dist/js/chunks/{chunk-ZX6M7SWO.mjs → chunk-F7LAKFMX.mjs} +320 -141
- package/dist/js/chunks/chunk-F7LAKFMX.mjs.map +7 -0
- package/dist/js/chunks/{chunk-L27Q6ZMI.mjs → chunk-FNIIH2LU.mjs} +20 -33
- package/dist/js/chunks/chunk-FNIIH2LU.mjs.map +7 -0
- package/dist/js/chunks/chunk-GE3YMFS6.mjs +15 -0
- package/dist/js/chunks/chunk-GE3YMFS6.mjs.map +7 -0
- package/dist/js/chunks/chunk-GFWYMWYN.mjs +125 -0
- package/dist/js/chunks/chunk-GFWYMWYN.mjs.map +7 -0
- package/dist/js/chunks/chunk-GNRSYMVH.mjs +1 -0
- package/dist/js/chunks/chunk-H5ISU45X.mjs +87 -0
- package/dist/js/chunks/chunk-H5ISU45X.mjs.map +7 -0
- package/dist/js/chunks/{chunk-GJL6GCIU.mjs → chunk-H6YIKFAQ.mjs} +311 -186
- package/dist/js/chunks/chunk-H6YIKFAQ.mjs.map +7 -0
- package/dist/js/chunks/{chunk-BGZLF6JZ.mjs → chunk-HEH7E3KO.mjs} +155 -35
- package/dist/js/chunks/chunk-HEH7E3KO.mjs.map +7 -0
- package/dist/js/chunks/chunk-HQRLBTNM.mjs +152 -0
- package/dist/js/chunks/chunk-HQRLBTNM.mjs.map +7 -0
- package/dist/js/chunks/chunk-I2F7MLUU.mjs +137 -0
- package/dist/js/chunks/chunk-I2F7MLUU.mjs.map +7 -0
- package/dist/js/chunks/chunk-IQOTGGHX.mjs +797 -0
- package/dist/js/chunks/chunk-IQOTGGHX.mjs.map +7 -0
- package/dist/js/chunks/chunk-JH3YWKA6.mjs +225 -0
- package/dist/js/chunks/chunk-JH3YWKA6.mjs.map +7 -0
- package/dist/js/chunks/chunk-JOLJAYIJ.mjs +7 -0
- package/dist/js/chunks/chunk-JOLJAYIJ.mjs.map +7 -0
- package/dist/js/chunks/{chunk-VGNYF6FB.mjs → chunk-KOTGMCMI.mjs} +116 -24
- package/dist/js/chunks/chunk-KOTGMCMI.mjs.map +7 -0
- package/dist/js/chunks/{chunk-LQWUDNHZ.mjs → chunk-LC4O5LFS.mjs} +21 -45
- package/dist/js/chunks/chunk-LC4O5LFS.mjs.map +7 -0
- package/dist/js/chunks/chunk-LEF33SCP.mjs +127 -0
- package/dist/js/chunks/chunk-LEF33SCP.mjs.map +7 -0
- package/dist/js/chunks/{chunk-PDG64UHF.mjs → chunk-LFORZRPH.mjs} +21 -23
- package/dist/js/chunks/chunk-LFORZRPH.mjs.map +7 -0
- package/dist/js/chunks/chunk-LWLNV5EC.mjs +451 -0
- package/dist/js/chunks/chunk-LWLNV5EC.mjs.map +7 -0
- package/dist/js/chunks/chunk-LXRHUQAX.mjs +491 -0
- package/dist/js/chunks/chunk-LXRHUQAX.mjs.map +7 -0
- package/dist/js/chunks/{chunk-SFI2U4YW.mjs → chunk-MA2SZZFB.mjs} +82 -111
- package/dist/js/chunks/chunk-MA2SZZFB.mjs.map +7 -0
- package/dist/js/chunks/chunk-MDBZAMIV.mjs +121 -0
- package/dist/js/chunks/chunk-MDBZAMIV.mjs.map +7 -0
- package/dist/js/chunks/chunk-NODZ5VAD.mjs +75 -0
- package/dist/js/chunks/chunk-NODZ5VAD.mjs.map +7 -0
- package/dist/js/chunks/chunk-O2WJB6TH.mjs +365 -0
- package/dist/js/chunks/chunk-O2WJB6TH.mjs.map +7 -0
- package/dist/js/chunks/chunk-PCABY5BN.mjs +35 -0
- package/dist/js/chunks/chunk-PCABY5BN.mjs.map +7 -0
- package/dist/js/chunks/chunk-PWKYVMND.mjs +120 -0
- package/dist/js/chunks/chunk-PWKYVMND.mjs.map +7 -0
- package/dist/js/chunks/{chunk-SMY7GJSS.mjs → chunk-QHZZT7YO.mjs} +66 -38
- package/dist/js/chunks/chunk-QHZZT7YO.mjs.map +7 -0
- package/dist/js/chunks/chunk-QND56EW2.mjs +439 -0
- package/dist/js/chunks/chunk-QND56EW2.mjs.map +7 -0
- package/dist/js/chunks/chunk-QNODAANY.mjs +376 -0
- package/dist/js/chunks/chunk-QNODAANY.mjs.map +7 -0
- package/dist/js/chunks/{chunk-KHXZ2A4K.mjs → chunk-QRO5FV3I.mjs} +156 -73
- package/dist/js/chunks/chunk-QRO5FV3I.mjs.map +7 -0
- package/dist/js/chunks/chunk-R7A7JRC5.mjs +440 -0
- package/dist/js/chunks/chunk-R7A7JRC5.mjs.map +7 -0
- package/dist/js/chunks/chunk-RKG2CBFE.mjs +74 -0
- package/dist/js/chunks/chunk-RKG2CBFE.mjs.map +7 -0
- package/dist/js/chunks/{chunk-XAEAEHIX.mjs → chunk-RSNS5OYS.mjs} +38 -25
- package/dist/js/chunks/chunk-RSNS5OYS.mjs.map +7 -0
- package/dist/js/chunks/{chunk-X4ISMKE2.mjs → chunk-RUDYMEJ3.mjs} +7 -6
- package/dist/js/chunks/chunk-RUDYMEJ3.mjs.map +7 -0
- package/dist/js/chunks/chunk-STJR62SU.mjs +161 -0
- package/dist/js/chunks/chunk-STJR62SU.mjs.map +7 -0
- package/dist/js/chunks/chunk-SUSD4UTN.mjs +220 -0
- package/dist/js/chunks/chunk-SUSD4UTN.mjs.map +7 -0
- package/dist/js/chunks/{chunk-5CEAOLUA.mjs → chunk-SYBOA5HC.mjs} +26 -48
- package/dist/js/chunks/chunk-SYBOA5HC.mjs.map +7 -0
- package/dist/js/chunks/chunk-T4MOBP3J.mjs +108 -0
- package/dist/js/chunks/chunk-T4MOBP3J.mjs.map +7 -0
- package/dist/js/chunks/chunk-TM7HPGTV.mjs +342 -0
- package/dist/js/chunks/chunk-TM7HPGTV.mjs.map +7 -0
- package/dist/js/chunks/{chunk-C6CHEWYP.mjs → chunk-TMQDZSDC.mjs} +71 -35
- package/dist/js/chunks/chunk-TMQDZSDC.mjs.map +7 -0
- package/dist/js/chunks/chunk-TVSX5YA2.mjs +48 -0
- package/dist/js/chunks/chunk-TVSX5YA2.mjs.map +7 -0
- package/dist/js/chunks/chunk-UHO5CV6K.mjs +80 -0
- package/dist/js/chunks/chunk-UHO5CV6K.mjs.map +7 -0
- package/dist/js/chunks/chunk-UKCNELUN.mjs +223 -0
- package/dist/js/chunks/chunk-UKCNELUN.mjs.map +7 -0
- package/dist/js/chunks/chunk-UKQK5GWR.mjs +167 -0
- package/dist/js/chunks/chunk-UKQK5GWR.mjs.map +7 -0
- package/dist/js/chunks/{chunk-TSZYSW7F.mjs → chunk-UTSLYQ65.mjs} +21 -48
- package/dist/js/chunks/chunk-UTSLYQ65.mjs.map +7 -0
- package/dist/js/chunks/chunk-VS5OJBOD.mjs +108 -0
- package/dist/js/chunks/chunk-VS5OJBOD.mjs.map +7 -0
- package/dist/js/chunks/chunk-VZMROW5A.mjs +759 -0
- package/dist/js/chunks/chunk-VZMROW5A.mjs.map +7 -0
- package/dist/js/chunks/chunk-W6FAL3TI.mjs +38 -0
- package/dist/js/chunks/chunk-W6FAL3TI.mjs.map +7 -0
- package/dist/js/chunks/chunk-XB6Y7P5W.mjs +69 -0
- package/dist/js/chunks/chunk-XB6Y7P5W.mjs.map +7 -0
- package/dist/js/chunks/chunk-XDAMOMVD.mjs +226 -0
- package/dist/js/chunks/chunk-XDAMOMVD.mjs.map +7 -0
- package/dist/js/chunks/{chunk-WDK4T63U.mjs → chunk-XJPMW5SP.mjs} +247 -172
- package/dist/js/chunks/chunk-XJPMW5SP.mjs.map +7 -0
- package/dist/js/chunks/{chunk-KUFHW3DS.mjs → chunk-YKANQILZ.mjs} +16 -21
- package/dist/js/chunks/chunk-YKANQILZ.mjs.map +7 -0
- package/dist/js/chunks/chunk-YLZOJLDI.mjs +175 -0
- package/dist/js/chunks/chunk-YLZOJLDI.mjs.map +7 -0
- package/dist/js/chunks/chunk-ZK7YY322.mjs +514 -0
- package/dist/js/chunks/chunk-ZK7YY322.mjs.map +7 -0
- package/dist/js/expressive.cjs +10266 -3628
- package/dist/js/expressive.cjs.map +4 -4
- package/dist/js/expressive.js +10266 -3628
- package/dist/js/expressive.js.map +4 -4
- package/dist/js/expressive.min.js +23 -22
- package/dist/js/expressive.min.js.map +4 -4
- package/dist/js/expressive.mjs +181 -69
- package/dist/js/expressive.mjs.map +2 -2
- package/dist/js/internal/behaviors/bottomSheets.mjs +4 -3
- package/dist/js/internal/behaviors/copy.mjs +9 -0
- package/dist/js/internal/behaviors/copy.mjs.map +7 -0
- package/dist/js/internal/behaviors/dataTables.mjs +8 -0
- package/dist/js/internal/behaviors/dataTables.mjs.map +7 -0
- package/dist/js/internal/behaviors/dialogs.mjs +2 -2
- package/dist/js/internal/behaviors/forms.mjs +2 -2
- package/dist/js/internal/behaviors/imageCompare.mjs +8 -0
- package/dist/js/internal/behaviors/imageCompare.mjs.map +7 -0
- package/dist/js/internal/behaviors/lists.mjs +8 -0
- package/dist/js/internal/behaviors/lists.mjs.map +7 -0
- package/dist/js/internal/behaviors/paneResize.mjs +8 -0
- package/dist/js/internal/behaviors/paneResize.mjs.map +7 -0
- package/dist/js/internal/behaviors/sheetDrag.mjs +7 -2
- package/dist/js/internal/behaviors/sideSheets.mjs +4 -3
- package/dist/js/internal/behaviors/sortable.mjs +8 -0
- package/dist/js/internal/behaviors/sortable.mjs.map +7 -0
- package/dist/js/internal/behaviors/theme.mjs +8 -0
- package/dist/js/internal/behaviors/theme.mjs.map +7 -0
- package/dist/js/internal/behaviors/tour.mjs +8 -0
- package/dist/js/internal/behaviors/tour.mjs.map +7 -0
- package/dist/js/internal/behaviors/transferList.mjs +8 -0
- package/dist/js/internal/behaviors/transferList.mjs.map +7 -0
- package/dist/js/internal/components/appBar.mjs +3 -2
- package/dist/js/internal/components/autocomplete.mjs +5 -4
- package/dist/js/internal/components/backToTop.mjs +9 -0
- package/dist/js/internal/components/backToTop.mjs.map +7 -0
- package/dist/js/internal/components/barChart.mjs +5 -4
- package/dist/js/internal/components/buttonGroup.mjs +3 -2
- package/dist/js/internal/components/buttons.mjs +3 -3
- package/dist/js/internal/components/cards.mjs +3 -3
- package/dist/js/internal/components/carousel.mjs +3 -3
- package/dist/js/internal/components/cascader.mjs +10 -0
- package/dist/js/internal/components/cascader.mjs.map +7 -0
- package/dist/js/internal/components/characterCounter.mjs +3 -2
- package/dist/js/internal/components/chips.mjs +7 -5
- package/dist/js/internal/components/colorPicker.mjs +9 -0
- package/dist/js/internal/components/colorPicker.mjs.map +7 -0
- package/dist/js/internal/components/columnChart.mjs +4 -3
- package/dist/js/internal/components/commandPalette.mjs +3 -3
- package/dist/js/internal/components/confetti.mjs +3 -2
- package/dist/js/internal/components/currencyInput.mjs +9 -0
- package/dist/js/internal/components/currencyInput.mjs.map +7 -0
- package/dist/js/internal/components/datepicker.mjs +12 -8
- package/dist/js/internal/components/expandingCard.mjs +3 -3
- package/dist/js/internal/components/funnelChart.mjs +10 -0
- package/dist/js/internal/components/funnelChart.mjs.map +7 -0
- package/dist/js/internal/components/heatmapChart.mjs +4 -3
- package/dist/js/internal/components/hoverCard.mjs +9 -0
- package/dist/js/internal/components/hoverCard.mjs.map +7 -0
- package/dist/js/internal/components/index.mjs +131 -65
- package/dist/js/internal/components/inputMask.mjs +9 -0
- package/dist/js/internal/components/inputMask.mjs.map +7 -0
- package/dist/js/internal/components/keypad.mjs +3 -3
- package/dist/js/internal/components/lightbox.mjs +3 -3
- package/dist/js/internal/components/lineChart.mjs +41 -4
- package/dist/js/internal/components/loadingOverlay.mjs +9 -0
- package/dist/js/internal/components/loadingOverlay.mjs.map +7 -0
- package/dist/js/internal/components/mapView.mjs +3 -3
- package/dist/js/internal/components/menu.mjs +3 -3
- package/dist/js/internal/components/menubar.mjs +10 -0
- package/dist/js/internal/components/menubar.mjs.map +7 -0
- package/dist/js/internal/components/messageScroller.mjs +3 -3
- package/dist/js/internal/components/mixedChart.mjs +5 -4
- package/dist/js/internal/components/navigationRail.mjs +3 -2
- package/dist/js/internal/components/particles.mjs +3 -2
- package/dist/js/internal/components/pieChart.mjs +4 -3
- package/dist/js/internal/components/pullToRefresh.mjs +9 -0
- package/dist/js/internal/components/pullToRefresh.mjs.map +7 -0
- package/dist/js/internal/components/questionnaire.mjs +3 -3
- package/dist/js/internal/components/radarChart.mjs +4 -3
- package/dist/js/internal/components/radialChart.mjs +4 -3
- package/dist/js/internal/components/registry.mjs +60 -41
- package/dist/js/internal/components/richTextEditor.mjs +3 -3
- package/dist/js/internal/components/sankeyChart.mjs +10 -0
- package/dist/js/internal/components/sankeyChart.mjs.map +7 -0
- package/dist/js/internal/components/scatterChart.mjs +10 -0
- package/dist/js/internal/components/scatterChart.mjs.map +7 -0
- package/dist/js/internal/components/scrollspy.mjs +3 -2
- package/dist/js/internal/components/select.mjs +5 -4
- package/dist/js/internal/components/showMore.mjs +9 -0
- package/dist/js/internal/components/showMore.mjs.map +7 -0
- package/dist/js/internal/components/slider.mjs +3 -3
- package/dist/js/internal/components/snackbar.mjs +2 -2
- package/dist/js/internal/components/swipeActions.mjs +9 -0
- package/dist/js/internal/components/swipeActions.mjs.map +7 -0
- package/dist/js/internal/components/tabs.mjs +3 -4
- package/dist/js/internal/components/timepicker.mjs +5 -4
- package/dist/js/internal/components/tooltip.mjs +3 -3
- package/dist/js/internal/components/treeSelect.mjs +14 -0
- package/dist/js/internal/components/treeSelect.mjs.map +7 -0
- package/dist/js/internal/components/treemapChart.mjs +10 -0
- package/dist/js/internal/components/treemapChart.mjs.map +7 -0
- package/dist/js/internal/core/component.mjs +6 -3
- package/dist/js/internal/core/formControl.mjs +12 -0
- package/dist/js/internal/core/formControl.mjs.map +7 -0
- package/dist/js/internal/core/imageURL.mjs +7 -0
- package/dist/js/internal/core/imageURL.mjs.map +7 -0
- package/dist/js/internal/core/spring.mjs +11 -0
- package/dist/js/internal/core/spring.mjs.map +7 -0
- package/dist/js/internal/core/utils.mjs +21 -3
- package/dist/js/internal/plugins/dockedDisplayPlugin.mjs +2 -2
- package/dist/js/internal/plugins/modalDisplayPlugin.mjs +13 -0
- package/dist/js/internal/plugins/modalDisplayPlugin.mjs.map +7 -0
- package/dist/js/modular.mjs +172 -69
- package/dist/types/behaviors/bottomSheets.d.ts +23 -5
- package/dist/types/behaviors/copy.d.ts +18 -0
- package/dist/types/behaviors/dataTables.d.ts +125 -0
- package/dist/types/behaviors/dialogs.d.ts +27 -1
- package/dist/types/behaviors/forms.d.ts +70 -4
- package/dist/types/behaviors/imageCompare.d.ts +13 -0
- package/dist/types/behaviors/lists.d.ts +12 -0
- package/dist/types/behaviors/paneResize.d.ts +29 -0
- package/dist/types/behaviors/sheetDrag.d.ts +18 -0
- package/dist/types/behaviors/sideSheets.d.ts +1 -1
- package/dist/types/behaviors/sortable.d.ts +28 -0
- package/dist/types/behaviors/theme.d.ts +22 -0
- package/dist/types/behaviors/tour.d.ts +36 -0
- package/dist/types/behaviors/transferList.d.ts +53 -0
- package/dist/types/components/appBar.d.ts +5 -6
- package/dist/types/components/autocomplete.d.ts +105 -20
- package/dist/types/components/backToTop.d.ts +36 -0
- package/dist/types/components/barChart.d.ts +3 -6
- package/dist/types/components/buttonGroup.d.ts +2 -4
- package/dist/types/components/buttons.d.ts +5 -5
- package/dist/types/components/cards.d.ts +3 -16
- package/dist/types/components/carousel.d.ts +16 -15
- package/dist/types/components/cascader.d.ts +130 -0
- package/dist/types/components/characterCounter.d.ts +2 -15
- package/dist/types/components/chips.d.ts +80 -19
- package/dist/types/components/colorPicker.d.ts +56 -0
- package/dist/types/components/columnChart.d.ts +23 -10
- package/dist/types/components/commandPalette.d.ts +11 -16
- package/dist/types/components/confetti.d.ts +2 -4
- package/dist/types/components/currencyInput.d.ts +60 -0
- package/dist/types/components/datepicker.d.ts +107 -56
- package/dist/types/components/expandingCard.d.ts +4 -6
- package/dist/types/components/funnelChart.d.ts +35 -0
- package/dist/types/components/heatmapChart.d.ts +42 -8
- package/dist/types/components/hoverCard.d.ts +59 -0
- package/dist/types/components/index.d.ts +16 -1
- package/dist/types/components/inputMask.d.ts +28 -0
- package/dist/types/components/keypad.d.ts +38 -6
- package/dist/types/components/lightbox.d.ts +14 -20
- package/dist/types/components/lineChart.d.ts +212 -12
- package/dist/types/components/loadingOverlay.d.ts +42 -0
- package/dist/types/components/mapView.d.ts +138 -27
- package/dist/types/components/menu.d.ts +74 -22
- package/dist/types/components/menubar.d.ts +37 -0
- package/dist/types/components/messageScroller.d.ts +2 -14
- package/dist/types/components/mixedChart.d.ts +15 -6
- package/dist/types/components/navigationRail.d.ts +16 -5
- package/dist/types/components/particles.d.ts +22 -5
- package/dist/types/components/pieChart.d.ts +33 -9
- package/dist/types/components/pullToRefresh.d.ts +80 -0
- package/dist/types/components/questionnaire.d.ts +58 -16
- package/dist/types/components/radarChart.d.ts +10 -6
- package/dist/types/components/radialChart.d.ts +58 -7
- package/dist/types/components/registry.d.ts +73 -3
- package/dist/types/components/richTextEditor.d.ts +45 -22
- package/dist/types/components/sankeyChart.d.ts +72 -0
- package/dist/types/components/scatterChart.d.ts +102 -0
- package/dist/types/components/scrollspy.d.ts +3 -5
- package/dist/types/components/select.d.ts +44 -33
- package/dist/types/components/showMore.d.ts +53 -0
- package/dist/types/components/slider.d.ts +2 -15
- package/dist/types/components/snackbar.d.ts +68 -1
- package/dist/types/components/swipeActions.d.ts +81 -0
- package/dist/types/components/tabs.d.ts +92 -30
- package/dist/types/components/timepicker.d.ts +128 -27
- package/dist/types/components/tooltip.d.ts +57 -21
- package/dist/types/components/treeSelect.d.ts +106 -0
- package/dist/types/components/treemapChart.d.ts +56 -0
- package/dist/types/core/component.d.ts +49 -25
- package/dist/types/core/formControl.d.ts +21 -0
- package/dist/types/core/imageURL.d.ts +2 -0
- package/dist/types/core/spring.d.ts +20 -0
- package/dist/types/core/utils.d.ts +123 -72
- package/dist/types/modular.d.ts +33 -1
- package/dist/types/plugins/dockedDisplayPlugin.d.ts +10 -8
- package/dist/types/plugins/modalDisplayPlugin.d.ts +39 -0
- package/package.json +17 -13
- package/src/sass/README.md +27 -18
- package/src/sass/abstracts/_elevation.scss +13 -7
- package/src/sass/abstracts/_index.scss +1 -0
- package/src/sass/abstracts/_mixins.scss +864 -78
- package/src/sass/abstracts/_spring.scss +63 -0
- package/src/sass/abstracts/_variables.scss +64 -21
- package/src/sass/base/_fonts.scss +61 -48
- package/src/sass/base/_global.scss +104 -24
- package/src/sass/base/_index.scss +2 -0
- package/src/sass/base/_normalize.scss +59 -114
- package/src/sass/base/_print.scss +21 -0
- package/src/sass/base/_prose.scss +68 -0
- package/src/sass/base/_typography.scss +9 -5
- package/src/sass/components/_accordion.scss +10 -19
- package/src/sass/components/_alert.scss +102 -0
- package/src/sass/components/_aura.scss +9 -3
- package/src/sass/components/_avatar.scss +3 -3
- package/src/sass/components/_back-to-top.scss +38 -0
- package/src/sass/components/_badges.scss +6 -5
- package/src/sass/components/_bar-chart.scss +31 -90
- package/src/sass/components/_bottom-sheet.scss +51 -16
- package/src/sass/components/_breadcrumb.scss +8 -7
- package/src/sass/components/_button-groups.scss +30 -63
- package/src/sass/components/_buttons.scss +137 -94
- package/src/sass/components/_calendar.scss +244 -0
- package/src/sass/components/_cards.scss +36 -44
- package/src/sass/components/_carousel.scss +37 -113
- package/src/sass/components/_cascader.scss +131 -0
- package/src/sass/components/_chips.scss +36 -46
- package/src/sass/components/_column-chart.scss +15 -26
- package/src/sass/components/_command-palette.scss +4 -7
- package/src/sass/components/_confetti.scss +1 -4
- package/src/sass/components/_countdown.scss +1 -1
- package/src/sass/components/_data-table.scss +172 -25
- package/src/sass/components/_datepicker.scss +54 -40
- package/src/sass/components/_description-list.scss +85 -0
- package/src/sass/components/_dialog.scss +48 -55
- package/src/sass/components/_docked-display.scss +1 -3
- package/src/sass/components/_drag-handle.scss +16 -20
- package/src/sass/components/_expanding-card.scss +21 -14
- package/src/sass/components/_fab-menu.scss +43 -39
- package/src/sass/components/_funnel-chart.scss +63 -0
- package/src/sass/components/_heatmap-chart.scss +114 -29
- package/src/sass/components/_icon-buttons.scss +8 -11
- package/src/sass/components/_icons-material-design.scss +2 -2
- package/src/sass/components/_image-compare.scss +108 -0
- package/src/sass/components/_index.scss +20 -0
- package/src/sass/components/_keypad.scss +39 -19
- package/src/sass/components/_kpi.scss +6 -11
- package/src/sass/components/_lightbox.scss +24 -13
- package/src/sass/components/_line-chart.scss +9 -63
- package/src/sass/components/_list.scss +59 -14
- package/src/sass/components/_loading-indicator.scss +1 -0
- package/src/sass/components/_loading-overlay.scss +105 -0
- package/src/sass/components/_map.scss +37 -11
- package/src/sass/components/_marquee.scss +4 -3
- package/src/sass/components/_mega-menu.scss +128 -0
- package/src/sass/components/_menu.scss +146 -127
- package/src/sass/components/_menubar.scss +47 -0
- package/src/sass/components/_message-scroller.scss +2 -2
- package/src/sass/components/_message.scss +3 -3
- package/src/sass/components/_mixed-chart.scss +27 -35
- package/src/sass/components/_modal-display.scss +21 -0
- package/src/sass/components/_navbar.scss +45 -36
- package/src/sass/components/_navigation-bar.scss +12 -77
- package/src/sass/components/_navigation-rail.scss +161 -92
- package/src/sass/components/_org-chart.scss +192 -0
- package/src/sass/components/_page-footer.scss +2 -4
- package/src/sass/components/_pagination.scss +9 -27
- package/src/sass/components/_panes.scss +35 -42
- package/src/sass/components/_particles.scss +1 -4
- package/src/sass/components/_pie-chart.scss +86 -68
- package/src/sass/components/_popover.scss +18 -5
- package/src/sass/components/_progress.scss +183 -44
- package/src/sass/components/_pull-to-refresh.scss +90 -0
- package/src/sass/components/_questionnaire.scss +74 -3
- package/src/sass/components/_radar-chart.scss +40 -42
- package/src/sass/components/_radial-chart.scss +108 -46
- package/src/sass/components/_rich-text-editor.scss +2 -2
- package/src/sass/components/_sankey-chart.scss +91 -0
- package/src/sass/components/_scatter-chart.scss +144 -0
- package/src/sass/components/_scrim.scss +0 -2
- package/src/sass/components/_scrollspy.scss +0 -2
- package/src/sass/components/_search.scss +27 -26
- package/src/sass/components/_show-more.scss +8 -0
- package/src/sass/components/_side-sheet.scss +32 -51
- package/src/sass/components/_skeleton.scss +26 -19
- package/src/sass/components/_snackbar.scss +25 -21
- package/src/sass/components/_split-button.scss +5 -5
- package/src/sass/components/_stat.scss +3 -8
- package/src/sass/components/_stepper.scss +1 -1
- package/src/sass/components/_swipe-actions.scss +71 -0
- package/src/sass/components/_table_of_contents.scss +1 -3
- package/src/sass/components/_tabs.scss +49 -46
- package/src/sass/components/_timeline.scss +12 -12
- package/src/sass/components/_timepicker.scss +111 -79
- package/src/sass/components/_toolbar.scss +36 -47
- package/src/sass/components/_tooltip.scss +25 -12
- package/src/sass/components/_tour.scss +89 -0
- package/src/sass/components/_transfer-list.scss +73 -0
- package/src/sass/components/_transitions.scss +4 -4
- package/src/sass/components/_tree.scss +7 -32
- package/src/sass/components/_treemap-chart.scss +98 -0
- package/src/sass/components/forms/_checkboxes.scss +107 -44
- package/src/sass/components/forms/_color-picker.scss +135 -0
- package/src/sass/components/forms/_color-swatches.scss +85 -0
- package/src/sass/components/forms/_drop-zone.scss +16 -13
- package/src/sass/components/forms/_fieldset.scss +4 -7
- package/src/sass/components/forms/_file-input.scss +12 -8
- package/src/sass/components/forms/_index.scss +3 -1
- package/src/sass/components/forms/_input-fields.scss +271 -90
- package/src/sass/components/forms/_radio-buttons.scss +34 -117
- package/src/sass/components/forms/_rating.scss +2 -32
- package/src/sass/components/forms/_select.scss +198 -20
- package/src/sass/components/forms/_slider.scss +92 -98
- package/src/sass/components/forms/_switches.scss +62 -180
- package/src/sass/custom.scss +10 -1
- package/src/sass/expressive.scss +3 -63
- package/src/sass/tokens/_contrast.scss +94 -0
- package/src/sass/tokens/_elevation.scss +16 -0
- package/src/sass/tokens/_index.scss +5 -0
- package/src/sass/tokens/_motion.scss +109 -0
- package/src/sass/tokens/_reference.scss +72 -141
- package/src/sass/tokens/_shape.scss +38 -0
- package/src/sass/tokens/_stacking.scss +27 -0
- package/src/sass/tokens/_state.scss +0 -2
- package/src/sass/tokens/_theme.scss +10 -1
- package/src/sass/tokens/_vibrant.scss +2 -5
- package/src/sass/utilities/_defer-render.scss +17 -0
- package/src/sass/utilities/_helpers.scss +184 -27
- package/src/sass/utilities/_index.scss +1 -0
- package/src/sass/utilities/_scroll-area.scss +0 -2
- package/src/sass/utilities/_spacing.scss +52 -34
- package/src/sass/utilities/_typescale.scss +8 -1
- package/src/sass/utilities/_visibility.scss +46 -77
- package/src/sass/utilities/_z-depth.scss +7 -4
- package/dist/js/chunks/chunk-33QVDDGR.mjs +0 -270
- package/dist/js/chunks/chunk-33QVDDGR.mjs.map +0 -7
- package/dist/js/chunks/chunk-45FER6RI.mjs +0 -59
- package/dist/js/chunks/chunk-45FER6RI.mjs.map +0 -7
- package/dist/js/chunks/chunk-5CEAOLUA.mjs.map +0 -7
- package/dist/js/chunks/chunk-6VATUZC6.mjs +0 -295
- package/dist/js/chunks/chunk-6VATUZC6.mjs.map +0 -7
- package/dist/js/chunks/chunk-74MXKKLN.mjs.map +0 -7
- package/dist/js/chunks/chunk-AIURVCG6.mjs +0 -55
- package/dist/js/chunks/chunk-AIURVCG6.mjs.map +0 -7
- package/dist/js/chunks/chunk-BGZLF6JZ.mjs.map +0 -7
- package/dist/js/chunks/chunk-C6CHEWYP.mjs.map +0 -7
- package/dist/js/chunks/chunk-CK2XCICY.mjs.map +0 -7
- package/dist/js/chunks/chunk-CXXM2L4F.mjs +0 -344
- package/dist/js/chunks/chunk-CXXM2L4F.mjs.map +0 -7
- package/dist/js/chunks/chunk-DXGRXYYL.mjs.map +0 -7
- package/dist/js/chunks/chunk-FM5CZOUB.mjs.map +0 -7
- package/dist/js/chunks/chunk-GJL6GCIU.mjs.map +0 -7
- package/dist/js/chunks/chunk-K3HZMFMD.mjs +0 -135
- package/dist/js/chunks/chunk-K3HZMFMD.mjs.map +0 -7
- package/dist/js/chunks/chunk-KHXZ2A4K.mjs.map +0 -7
- package/dist/js/chunks/chunk-KQACNQ22.mjs +0 -7
- package/dist/js/chunks/chunk-KQACNQ22.mjs.map +0 -7
- package/dist/js/chunks/chunk-KUFHW3DS.mjs.map +0 -7
- package/dist/js/chunks/chunk-KVJAVDBC.mjs.map +0 -7
- package/dist/js/chunks/chunk-L27Q6ZMI.mjs.map +0 -7
- package/dist/js/chunks/chunk-LQWUDNHZ.mjs.map +0 -7
- package/dist/js/chunks/chunk-M372EDXD.mjs +0 -322
- package/dist/js/chunks/chunk-M372EDXD.mjs.map +0 -7
- package/dist/js/chunks/chunk-M3MURWMB.mjs +0 -82
- package/dist/js/chunks/chunk-M3MURWMB.mjs.map +0 -7
- package/dist/js/chunks/chunk-NUHMOAOY.mjs.map +0 -7
- package/dist/js/chunks/chunk-OWG3LMUL.mjs +0 -169
- package/dist/js/chunks/chunk-OWG3LMUL.mjs.map +0 -7
- package/dist/js/chunks/chunk-PD6HYHAE.mjs +0 -48
- package/dist/js/chunks/chunk-PD6HYHAE.mjs.map +0 -7
- package/dist/js/chunks/chunk-PDG64UHF.mjs.map +0 -7
- package/dist/js/chunks/chunk-PO3AXVR3.mjs +0 -546
- package/dist/js/chunks/chunk-PO3AXVR3.mjs.map +0 -7
- package/dist/js/chunks/chunk-QYGK36OG.mjs +0 -181
- package/dist/js/chunks/chunk-QYGK36OG.mjs.map +0 -7
- package/dist/js/chunks/chunk-SFI2U4YW.mjs.map +0 -7
- package/dist/js/chunks/chunk-SMY7GJSS.mjs.map +0 -7
- package/dist/js/chunks/chunk-TCCA2HDG.mjs +0 -414
- package/dist/js/chunks/chunk-TCCA2HDG.mjs.map +0 -7
- package/dist/js/chunks/chunk-TSZYSW7F.mjs.map +0 -7
- package/dist/js/chunks/chunk-UAZSDUVP.mjs +0 -90
- package/dist/js/chunks/chunk-UAZSDUVP.mjs.map +0 -7
- package/dist/js/chunks/chunk-UBRZZWRA.mjs +0 -127
- package/dist/js/chunks/chunk-UBRZZWRA.mjs.map +0 -7
- package/dist/js/chunks/chunk-UCOE7ZDL.mjs +0 -287
- package/dist/js/chunks/chunk-UCOE7ZDL.mjs.map +0 -7
- package/dist/js/chunks/chunk-UETTGDLI.mjs.map +0 -7
- package/dist/js/chunks/chunk-UNCRDLP6.mjs +0 -136
- package/dist/js/chunks/chunk-UNCRDLP6.mjs.map +0 -7
- package/dist/js/chunks/chunk-VGNYF6FB.mjs.map +0 -7
- package/dist/js/chunks/chunk-VGPGBNGL.mjs +0 -68
- package/dist/js/chunks/chunk-VGPGBNGL.mjs.map +0 -7
- package/dist/js/chunks/chunk-VKAUVTQY.mjs +0 -1
- package/dist/js/chunks/chunk-VM4FTS7L.mjs +0 -48
- package/dist/js/chunks/chunk-VM4FTS7L.mjs.map +0 -7
- package/dist/js/chunks/chunk-WDK4T63U.mjs.map +0 -7
- package/dist/js/chunks/chunk-WOCCTVUF.mjs +0 -185
- package/dist/js/chunks/chunk-WOCCTVUF.mjs.map +0 -7
- package/dist/js/chunks/chunk-WQYN5L4E.mjs +0 -107
- package/dist/js/chunks/chunk-WQYN5L4E.mjs.map +0 -7
- package/dist/js/chunks/chunk-X4ISMKE2.mjs.map +0 -7
- package/dist/js/chunks/chunk-XAEAEHIX.mjs.map +0 -7
- package/dist/js/chunks/chunk-ZX6M7SWO.mjs.map +0 -7
- /package/dist/js/chunks/{chunk-VKAUVTQY.mjs.map → chunk-GNRSYMVH.mjs.map} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/ts/components/menu.ts"],
|
|
4
|
+
"sourcesContent": ["import { Utils, controllerFor, restoreAttribute } from '../core/utils';\nimport { Component, BaseOptions } from '../core/component';\n\n// CSS anchor positioning, where the browser has it. A menu opened from its\n// trigger is anchored there and flips at the viewport edges in CSS; context\n// menus open at a point and cover-trigger menus overlap their trigger, so\n// both keep the measured placement, as do menus under a transformed\n// ancestor and every browser without anchors.\n// Either way the open menu is a manual popover in the top layer, so no\n// ancestor clips it or contains it, and its bounds are the viewport's.\n\n/** An element's parent, or its shadow root's host. */\nconst parentOf = (el: Element): Element | null => el.parentElement ?? ((el.getRootNode() as ShadowRoot).host || null);\n\n/**\n * Whether an ancestor of `el`, across shadow roots, moves it with a\n * transform. Firefox anchors a top-layer menu to the trigger's box as laid\n * out, before transforms, so a menu under one is measured instead, as in a\n * floating toolbar centred with `translateX(-50%)`.\n */\n// Computed values of the individual transform properties that move nothing,\n// such as a side sheet's resting `translate: 0px`.\nconst IDENTITY = { translate: /^(none|0px( 0px){0,2})$/, rotate: /^(none|(\\S+ )*0deg)$/, scale: /^(none|1( 1){0,2})$/ };\n\nfunction transformed(el: Element) {\n for (let node = parentOf(el); node; node = parentOf(node)) {\n const style = getComputedStyle(node);\n // An identity transform, often a translateZ(0) layer hint, moves nothing.\n if (!new DOMMatrixReadOnly(style.transform).isIdentity) return true;\n if (Object.entries(IDENTITY).some(([property, identity]) => !identity.test(style.getPropertyValue(property)))) return true;\n }\n return false;\n}\n\n/** The shadow roots an element sits in, nearest first. */\nfunction shadowRoots(el: Element) {\n const roots: ShadowRoot[] = [];\n for (let root = el.getRootNode(); 'host' in root; root = (root as ShadowRoot).host.getRootNode()) roots.push(root as ShadowRoot);\n return roots;\n}\n\n/**\n * The room a measured menu has in the viewport when aligned at each edge of\n * its trigger `el`. Aligned at `top` it starts `offset` below the trigger's\n * top edge, and at `bottom` it ends `offset` above its bottom edge. Negative\n * room means the menu does not fit that way.\n */\nfunction room(el: HTMLElement, menu: Pick<DOMRect, 'width' | 'height'>, offset: number) {\n const rect = el.getBoundingClientRect();\n return {\n left: window.innerWidth - (rect.left + menu.width),\n right: rect.right - menu.width,\n top: window.innerHeight - (rect.top + menu.height + offset),\n bottom: rect.bottom - (menu.height + offset)\n };\n}\n\n/** The keys that move between rows. Home and End go to the ends. */\nconst STEPS = { ArrowUp: -1, ArrowDown: 1 };\n// A list's rows: its own items, and the items of each <li role=\"none\"><ul\n// role=\"group\"> inside it.\nconst ROWS = ':scope > li, :scope > li > ul[role=\"group\"] > li';\n\nconst anchorSupported = typeof CSS !== 'undefined' && !!CSS.supports?.('anchor-name: --a');\n\n// The anchored inline properties, cleared together when the menu is reset.\nconst ANCHOR_STYLES = ['position', 'inset', 'max-height', 'position-anchor', 'position-area', 'position-try-fallbacks'];\n\nexport interface MenuOptions extends BaseOptions {\n /**\n * Defines the edge the menu is aligned to.\n * @default 'left'\n */\n alignment: 'left' | 'right';\n /**\n * If true, automatically focus menu el for keyboard.\n * @default true\n */\n autoFocus: boolean;\n /**\n * If true, constrainWidth to the size of the menu activator.\n *\n * A trigger narrower than the surface's own 112dp minimum cannot be\n * honoured, so such a menu is sized to its content instead - see\n * MIN_SURFACE_WIDTH.\n * @default true\n */\n constrainWidth: boolean;\n /**\n * Provide an element that will be the bounding container of the menu.\n * @default null\n */\n container: Element | ShadowRoot;\n /**\n * If false, the menu will show below the trigger.\n * That is the M3 placement. Pass `true` to cover the trigger.\n * @default false\n */\n coverTrigger: boolean;\n /**\n * The side of the trigger the menu opens on when there is room, such as\n * 'top' for a trigger in a bottom bar. It flips when there is not.\n * @default 'bottom'\n */\n placement: 'bottom' | 'top';\n /**\n * If true, close menu on item click.\n * @default true\n */\n closeOnClick: boolean;\n /**\n * If true, the menu will open on hover.\n * @default false\n */\n hover: boolean;\n /**\n * If true, the trigger is a region and the menu is its context menu: it\n * opens at the pointer on right-click, long-press or the keyboard context\n * menu key instead of on click. `data-context-menu` on the trigger sets it.\n * @default false\n */\n contextMenu: boolean;\n /**\n * The duration of the transition enter in milliseconds.\n * @default 150\n */\n inDuration: number;\n /**\n * The duration of the transition out in milliseconds.\n * @default 250\n */\n outDuration: number;\n /**\n * Function called when menu starts entering.\n * @default null\n */\n onOpenStart: (el: HTMLElement) => void;\n /**\n * Function called when menu finishes entering.\n * @default null\n */\n onOpenEnd: (el: HTMLElement) => void;\n /**\n * Function called when menu starts exiting.\n * @default null\n */\n onCloseStart: (el: HTMLElement) => void;\n /**\n * Function called when menu finishes exiting.\n * @default null\n */\n onCloseEnd: (el: HTMLElement) => void;\n /**\n * Function called when item is clicked.\n * @default null\n */\n onItemClick: (el: HTMLLIElement) => void;\n}\n\n// The menu surface's own width bounds, stated in `components/_menu.scss` and\n// restated here because the constraint below has to reason about them.\nconst MIN_SURFACE_WIDTH = 112;\nconst MAX_SURFACE_WIDTH = 280;\n\nconst _defaults: MenuOptions = {\n alignment: 'left',\n autoFocus: true,\n constrainWidth: true,\n container: null,\n coverTrigger: false,\n placement: 'bottom',\n closeOnClick: true,\n hover: false,\n contextMenu: false,\n inDuration: 150,\n outDuration: 250,\n onOpenStart: null,\n onOpenEnd: null,\n onCloseStart: null,\n onCloseEnd: null,\n onItemClick: null\n};\n\nconst SPACE = ' ';\n\nexport class Menu extends Component<MenuOptions> {\n static _menus: Menu[] = [];\n /** ID of the menu element. */\n id: string;\n /** The DOM element of the menu. */\n menuEl: HTMLElement;\n /** If the menu is open. */\n isOpen: boolean;\n /** If the menu content is scrollable. */\n isScrollable: boolean;\n isTouchMoving: boolean;\n /** The index of the item focused. */\n focusedIndex: number;\n filterQuery: string[];\n filterTimeout: ReturnType<typeof setTimeout>;\n private _pendingTimers = new Set<ReturnType<typeof setTimeout>>();\n private _transition = 0;\n /** Removes the listeners an open menu adds. */\n private _openEvents: AbortController | undefined;\n private _originalInert: string | null;\n private _menuClickTargets = new WeakMap<Event, HTMLElement>();\n // True while Space activates a row, so the click it sends can keep a radio\n // menu open.\n private _spaceActivation = false;\n /** Whether the pointer opened the menu, so opening leaves focus where it was. */\n private _openedByHover = false;\n /**\n * Viewport point the open context menu belongs to. Null outside a\n * right-click, so a keyboard or programmatic open uses the region's corner\n * rather than an old pointer position.\n */\n private _contextPoint: { x: number; y: number } | null = null;\n /** What had focus when a context menu opened; focus goes back there. */\n private _contextReturn: HTMLElement | null = null;\n /** Each attribute setup wrote, with the value it had before, for destroy(). */\n private _originalAttributes = new Map<Element, Map<string, string | null>>();\n /** Where the menu was before it moved next to the trigger. */\n private _originalPlace: { parent: Node | null; next: Node | null } = { parent: null, next: null };\n\n constructor(el: HTMLElement, options: Partial<MenuOptions>) {\n super(el, { contextMenu: el.hasAttribute('data-context-menu'), ...options });\n\n Menu._menus.push(this);\n this.id = Utils.getIdFromTrigger(el);\n this.menuEl = Utils.getElementById(el, this.id);\n\n this.isOpen = false;\n this.isScrollable = false;\n this.isTouchMoving = false;\n this.focusedIndex = -1;\n this.filterQuery = [];\n // A context region is content, not a button: expanded, haspopup and\n // controls are not valid on it, and the menu key is how it is discovered.\n if (!this.options.contextMenu) {\n this._setAttribute(this.el, 'aria-expanded', 'false');\n if (!this.el.hasAttribute('aria-haspopup')) this._setAttribute(this.el, 'aria-haspopup', 'menu');\n if (this.id && !this.el.hasAttribute('aria-controls'))\n this._setAttribute(this.el, 'aria-controls', this.id);\n }\n\n // Without a menu, moving it inserts a literal \"null\" text node and the\n // trigger's handlers would cancel its own clicks and keys to open nothing.\n if (!this.menuEl) {\n console.warn(`Menu skipped: no element matches target \"${this.id}\".`, el);\n return;\n }\n this._originalInert = this.menuEl.getAttribute('inert');\n // Keep the menu next to the trigger so positioning stays local.\n this._moveMenuToElement();\n this._setupAccessibility();\n this._makeMenuFocusable();\n this._setupSubmenus();\n this._setupEventHandlers();\n }\n\n static get defaults(): MenuOptions {\n return _defaults;\n }\n\n static key = 'Expressive_Menu';\n\n destroy() {\n this._clearPendingTimers();\n this.isOpen = false;\n this._setExpanded(false);\n if (this.menuEl) Utils.setAnchorName(this.el, `--menu-${this.menuEl.id}`, false);\n clearTimeout(this.filterTimeout);\n this._resetMenuStyles();\n this._restoreInert();\n this._restoreSetup();\n this._events.abort();\n this._openEvents?.abort();\n const index = Menu._menus.indexOf(this);\n if (index >= 0) Menu._menus.splice(index, 1);\n super.destroy();\n }\n\n _setupEventHandlers() {\n const { signal } = this._events;\n // Trigger keydown handler\n this.el.addEventListener('keydown', this._handleTriggerKeydown, { signal });\n // Item click handler\n this.menuEl?.addEventListener('click', this._handleMenuClick, { signal });\n if (this.menuEl?.querySelector(':scope > li > menu')) {\n this.menuEl.addEventListener('mouseover', this._handleSubmenuAlign, { signal });\n }\n if (this.options.contextMenu) {\n this.el.addEventListener('contextmenu', this._handleContextMenu, { signal });\n } else if (this.options.hover) {\n // Hover event handlers\n this.el.addEventListener('mouseenter', this._handleMouseEnter, { signal });\n this.el.addEventListener('mouseleave', this._handleMouseLeave, { signal });\n this.menuEl.addEventListener('mouseleave', this._handleMouseLeave, { signal });\n // Click event handlers\n } else {\n this.el.addEventListener('click', this._handleClick, { signal });\n }\n }\n\n _setupTemporaryEventHandlers() {\n this._openEvents?.abort();\n this._openEvents = controllerFor(this.el);\n const { signal } = this._openEvents;\n const passive = { passive: true, signal };\n document.addEventListener('click', this._handleDocumentClick, { signal });\n this.menuEl?.addEventListener('pointerdown', this._handleMenuPointerdown, passive);\n this.menuEl?.addEventListener('touchmove', this._handleDocumentTouchmove, passive);\n document.addEventListener('touchmove', this._handleDocumentTouchmove, passive);\n this.menuEl?.addEventListener('keydown', this._handleMenuKeydown, { signal });\n document.addEventListener('keydown', this._handleDocumentKeydown, { signal });\n window.addEventListener('resize', this._handleWindowResize, { signal });\n // A scroll inside a shadow root stays there, so each root around the\n // trigger is heard as well as the window.\n for (const target of [window, ...shadowRoots(this.el)]) {\n target.addEventListener('scroll', this._reanchor, { capture: true, passive: true, signal });\n }\n // A right-click elsewhere fires no click, so it would leave the menu open.\n if (this.options.contextMenu) document.addEventListener('contextmenu', this._handleDocumentContextMenu, { signal });\n }\n\n _handleContextMenu = (e: MouseEvent) => {\n // A nested region already answered this right-click; this one closes so\n // two menus never stack.\n if (e.defaultPrevented) {\n this.close();\n return;\n }\n // A right-click on another open menu inside this region belongs to that\n // menu, which keeps itself open.\n const path = e.composedPath();\n if (Menu._menus.some((menu) => menu !== this && menu.isOpen && path.includes(menu.menuEl))) return;\n e.preventDefault();\n if (!this.isOpen) {\n const root = this.el.getRootNode() as Document | ShadowRoot;\n this._contextReturn = root.activeElement instanceof HTMLElement ? root.activeElement : null;\n }\n // The menu key and Shift+F10 fire this too, with a point that may sit\n // outside the region (0, 0 in some engines). Those leave the point unset\n // and open at the region's start corner.\n const rect = this.el.getBoundingClientRect();\n const fromPointer =\n (e.clientX !== 0 || e.clientY !== 0) &&\n e.clientX >= rect.left && e.clientX <= rect.right &&\n e.clientY >= rect.top && e.clientY <= rect.bottom;\n this._contextPoint = fromPointer ? { x: e.clientX, y: e.clientY } : null;\n if (this.isOpen) this.recalculateDimensions();\n else this.open();\n };\n\n _handleDocumentContextMenu = (e: MouseEvent) => {\n const path = e.composedPath();\n // A right-click on the menu itself keeps it open and the browser's own\n // menu shut.\n if (path.includes(this.menuEl)) {\n e.preventDefault();\n return;\n }\n if (!path.includes(this.el)) this.close();\n };\n\n _handleClick = (e: MouseEvent) => {\n e.preventDefault();\n if (this.isOpen) {\n this.close();\n } else {\n this.open();\n }\n };\n\n _handleMouseEnter = () => {\n if (this.isOpen) return;\n // A pointer passing over the trigger must not pull focus out of whatever\n // the user is typing in, so a hover-opened menu leaves focus alone.\n this._openedByHover = true;\n this.open();\n };\n\n // A hover menu stays open while the pointer moves onto its content or onto\n // the trigger of an open menu. relatedTarget is null when the pointer\n // leaves the window entirely.\n _handleMouseLeave = (e: MouseEvent) => {\n const toEl = e.relatedTarget as HTMLElement | null;\n if (toEl && (this.menuEl?.contains(toEl) || Menu._inOpenTrigger(toEl))) return;\n this.close();\n };\n\n private static _inOpenTrigger(el: Element) {\n const trigger = el.closest('.menu-trigger');\n return Boolean(trigger && Menu.getInstance(trigger)?.isOpen);\n }\n\n _handleDocumentClick = (e: MouseEvent) => {\n const path = e.composedPath();\n const menuTarget = this._menuClickTargets.get(e);\n this._menuClickTargets.delete(e);\n // A click on the trigger belongs to the trigger's own click handler (which\n // toggles), not to outside dismissal: an Autocomplete input has no toggle,\n // so moving the caret closed its list. A context region still closes on a\n // left click, since that is how its menu is dismissed.\n if (!menuTarget && !this.options.contextMenu && path.includes(this.el)) {\n this.isTouchMoving = false;\n return;\n }\n const target = menuTarget ?? <HTMLElement>(path[0] || e.target);\n const inside = !!menuTarget || path.includes(this.menuEl) || this.menuEl?.contains(target);\n if (this._isSubmenuTriggerClick(target)) return;\n if (inside && this._closesOnClick(target)) {\n this.close();\n } else if (!inside) {\n // Do this one frame later so that if the element clicked also triggers _handleClick\n // For example, if a label for a select was clicked, that we don't close/open the menu\n this._schedule(() => this.close(), 0);\n }\n this.isTouchMoving = false;\n };\n\n // A hover-opened menu does not hold focus, so its own keydown handler never\n // sees Escape. Close it from wherever focus is, without moving focus, and\n // take the key only when it was pressed on the trigger.\n _handleDocumentKeydown = (e: KeyboardEvent) => {\n if (e.key !== 'Escape' || !this._openedByHover) return;\n if (Utils.focusIsIn(this.el)) e.preventDefault();\n this.close();\n };\n\n _handleTriggerKeydown = (e: KeyboardEvent) => {\n // A context region keeps its keys for its own content; the browser turns\n // the menu key and Shift+F10 into a contextmenu event.\n if (this.options.contextMenu) return;\n // Opening focus is delayed, so Escape must work while the trigger still owns it.\n if (e.key === 'Escape' && this.isOpen && Utils.plainKey(e) && !Utils.isComposing(e)) {\n e.preventDefault();\n this.close();\n return;\n }\n // M3: Space, Enter, Arrow Down, and Arrow Up open a closed menu.\n const opensMenu = [SPACE, 'Enter', 'ArrowDown', 'ArrowUp'].includes(e.key);\n if (!opensMenu) return;\n if (!this.isOpen) {\n e.preventDefault();\n this.open();\n } else if (this._openedByHover) {\n // The keyboard takes over a menu the pointer opened.\n e.preventDefault();\n this._openedByHover = false;\n this._focusInitialItem();\n }\n };\n\n // A scroll ends without a click, which is the only other place the flag is\n // cleared, so a new gesture has to clear it or the next tap is ignored.\n _handleMenuPointerdown = () => {\n this.isTouchMoving = false;\n };\n\n _handleDocumentTouchmove = (e: TouchEvent) => {\n const target = <HTMLElement>e.target;\n if (e.composedPath().includes(this.menuEl) || this.menuEl?.contains(target)) {\n this.isTouchMoving = true;\n }\n };\n\n _handleMenuClick = (e: MouseEvent) => {\n const target = <HTMLElement>e.target;\n // Closed shadow roots hide the original target from document listeners.\n this._menuClickTargets.set(e, target);\n const li = target.closest('li');\n // Neither a disabled row nor one that is not an item is a choice.\n if (li?.matches('.disabled, [aria-disabled=\"true\"], .divider, .gap, .label, .optgroup')) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n if (li && this._isSubmenuTriggerClick(target)) {\n e.preventDefault();\n e.stopPropagation();\n this._toggleSubmenu(li);\n return;\n }\n if (li) this._activateItem(li);\n };\n\n private _activateItem(li: HTMLLIElement) {\n const checked = this._toggleChecked(li);\n if (!this._notify('select', this.options.onItemClick, { args: [li], detail: { item: li } })) return;\n if (checked !== null) this._notify('change', null, { detail: { item: li, checked } });\n }\n\n // A menuitemcheckbox flips aria-checked, and a menuitemradio checks itself\n // and unchecks its group, before anyone hears of the click. Any other row,\n // or a radio that was already checked, returns null.\n private _toggleChecked(li: HTMLElement): boolean | null {\n const role = li.getAttribute('role');\n if (role === 'menuitemradio') return this._checkRadio(li);\n if (role !== 'menuitemcheckbox') return null;\n const checked = li.getAttribute('aria-checked') !== 'true';\n li.setAttribute('aria-checked', String(checked));\n return checked;\n }\n\n // A radio's group is its parent list: a <ul role=\"group\">, or for radio\n // rows outside any group, their menu.\n private _checkRadio(li: HTMLElement): true | null {\n if (li.getAttribute('aria-checked') === 'true') return null;\n li.parentElement.querySelectorAll(':scope > li[role=\"menuitemradio\"]').forEach((radio) => {\n radio.setAttribute('aria-checked', String(radio === li));\n });\n return true;\n }\n\n private _isCheckboxRow(el: Element | null | undefined) {\n return el?.closest('li')?.getAttribute('role') === 'menuitemcheckbox';\n }\n\n // isTouchMoving: a scroll on mobile is not a choice.\n private _closesOnClick(target: HTMLElement) {\n return this.options.closeOnClick && !this.isTouchMoving && !this._keepsOpen(target);\n }\n\n // Click and Space keep a checkbox menu open so several items can be\n // toggled. Space keeps a radio menu open too; a click on a radio closes it.\n private _keepsOpen(target: HTMLElement) {\n const role = target.closest('li')?.getAttribute('role');\n if (role === 'menuitemcheckbox') return true;\n return this._spaceActivation && role === 'menuitemradio';\n }\n\n // Enter toggles a checkbox item and then closes, as it does on any item.\n private _closeAfterEnter(e: KeyboardEvent, row: Element | undefined) {\n if (e.key === 'Enter' && this.options.closeOnClick && this._isCheckboxRow(row)) this.close();\n }\n\n private _setupAccessibility() {\n if (!this.menuEl) return;\n if (!this.menuEl.hasAttribute('role')) this._setAttribute(this.menuEl, 'role', 'menu');\n\n const menus = [this.menuEl, ...this.menuEl.querySelectorAll('menu')];\n menus.forEach((menu) => {\n if (!menu.hasAttribute('role')) this._setAttribute(menu, 'role', 'menu');\n if (menu.getAttribute('role') !== 'menu') return;\n\n menu.querySelectorAll(ROWS).forEach((li) => {\n if (li.classList.contains('divider')) {\n if (!li.hasAttribute('role')) this._setAttribute(li, 'role', 'separator');\n return;\n }\n if (li.classList.contains('gap')) {\n this._setAttribute(li, 'aria-hidden', 'true');\n return;\n }\n if (li.classList.contains('label') || li.classList.contains('optgroup')) {\n if (!li.hasAttribute('role')) this._setAttribute(li, 'role', 'presentation');\n return;\n }\n if (!li.hasAttribute('role')) this._setAttribute(li, 'role', 'menuitem');\n if (li.classList.contains('disabled') && !li.hasAttribute('aria-disabled')) {\n this._setAttribute(li, 'aria-disabled', 'true');\n }\n });\n });\n }\n\n private _isSubmenuTriggerClick(target: HTMLElement) {\n if (!this.menuEl) return false;\n const li = target.closest('li');\n if (!li || !this.menuEl.contains(li)) return false;\n const submenu = li.querySelector(':scope > menu');\n if (!submenu) return false;\n return !submenu.contains(target);\n }\n\n private _setupSubmenus() {\n this.menuEl?.querySelectorAll('li').forEach((li) => {\n if (!li.querySelector(':scope > menu')) return;\n const trigger = li.querySelector(':scope > a, :scope > button, :scope > span') ?? li;\n this._setAttribute(trigger, 'aria-haspopup', 'menu');\n this._setAttribute(trigger, 'aria-expanded', 'false');\n });\n }\n\n private _toggleSubmenu(li: HTMLElement) {\n const open = !li.classList.contains('open');\n li.parentElement?.querySelectorAll(':scope > li.open').forEach((other) => {\n if (other !== li) this._closeSubmenu(other as HTMLElement);\n });\n li.classList.toggle('open', open);\n if (open) this._alignSubmenu(li);\n this._syncSubmenuAria(li, open);\n }\n\n private _syncSubmenuAria(li: HTMLElement, open: boolean) {\n const trigger = li.querySelector(':scope > a, :scope > button, :scope > span') ?? li;\n trigger.setAttribute('aria-expanded', open ? 'true' : 'false');\n }\n\n private _handleSubmenuAlign = (e: MouseEvent) => {\n const target = e.target;\n if (!(target instanceof Element)) return;\n const li = target.closest('li');\n if (li?.querySelector(':scope > menu') && this.menuEl?.contains(li)) {\n this._alignSubmenu(li as HTMLElement);\n }\n };\n\n private _alignSubmenu(li: HTMLElement) {\n const menu = li.querySelector(':scope > menu') as HTMLElement | null;\n if (!menu) return;\n // Flyouts stay `display: block` (visibility/opacity hide them) so the\n // rect is readable without temporarily painting the menu.\n li.classList.remove('submenu-start');\n const rect = menu.getBoundingClientRect();\n if (rect.left < 8 || rect.right > window.innerWidth - 8) li.classList.add('submenu-start');\n }\n\n private _closeSubmenu(li: HTMLElement) {\n li.classList.remove('open', 'submenu-start');\n this._syncSubmenuAria(li, false);\n }\n\n private _closeSubmenus() {\n this.menuEl?.querySelectorAll('li.open').forEach((li) => this._closeSubmenu(li as HTMLElement));\n }\n\n private _containingSubmenu(e: Event): HTMLElement | null {\n const target = e.target;\n if (!(target instanceof Element)) return null;\n const submenu = target.closest('li > menu');\n if (submenu instanceof HTMLElement && this.menuEl?.contains(submenu)) return submenu;\n return null;\n }\n\n private _focusedRow(e: Event): HTMLElement | null {\n const target = e.target;\n if (!(target instanceof Element)) return null;\n const li = target.closest('li');\n if (li instanceof HTMLElement && this.menuEl?.contains(li)) return li;\n return null;\n }\n\n _handleMenuKeydown = (e: KeyboardEvent) => {\n if (!this.isOpen || !Utils.plainKey(e) || Utils.isComposing(e)) return;\n const list = this._containingSubmenu(e) ?? this.menuEl;\n const rtl = getComputedStyle(list).direction === 'rtl';\n const openKey = rtl ? 'ArrowLeft' : 'ArrowRight';\n const backKey = rtl ? 'ArrowRight' : 'ArrowLeft';\n if ([openKey, backKey, 'ArrowUp', 'ArrowDown', 'Escape', 'Tab'].includes(e.key)) {\n clearTimeout(this.filterTimeout);\n this._resetFilterQuery();\n }\n if (e.key === 'Tab') {\n e.preventDefault();\n this.close();\n } else if (e.key === openKey) {\n const li = this._focusedRow(e);\n if (li?.querySelector(':scope > menu') && !li.matches('.disabled, [aria-disabled=\"true\"]')) {\n e.preventDefault();\n li.classList.add('open');\n this._alignSubmenu(li);\n this._syncSubmenuAria(li, true);\n const first = Array.from(li.querySelector(':scope > menu').children).find(\n child => child instanceof HTMLElement && child.tabIndex !== -1\n ) as HTMLElement | undefined;\n if (first) this._focusRow(first);\n }\n } else if (e.key === backKey) {\n const submenu = this._containingSubmenu(e);\n if (submenu) {\n e.preventDefault();\n const parentLi = submenu.parentElement as HTMLElement;\n this._closeSubmenu(parentLi);\n this._focusRow(parentLi);\n }\n }\n // Up and Down move a row, Home and End to the ends.\n else if (this._moveFocus(list, e)) {\n e.preventDefault();\n }\n // SPACE OR ENTER selects the focused item.\n else if (e.key === 'Enter' || e.key === SPACE) {\n const li = this._focusedRow(e);\n e.preventDefault();\n if (li?.matches('.disabled, [aria-disabled=\"true\"]')) return;\n if (li?.querySelector(':scope > menu')) {\n this._toggleSubmenu(li);\n return;\n }\n const focusedElement = li ?? this.menuEl.children[this.focusedIndex];\n const activatableElement = <HTMLElement>focusedElement?.querySelector(':scope > a, :scope > button');\n this._spaceActivation = e.key === SPACE;\n if (!!activatableElement) {\n activatableElement.click();\n } else if (focusedElement instanceof HTMLElement) {\n focusedElement.click();\n }\n this._spaceActivation = false;\n this._closeAfterEnter(e, focusedElement);\n }\n // Close menu on ESC\n else if (e.key === 'Escape') {\n e.preventDefault();\n const openSub = this._containingSubmenu(e)?.parentElement ??\n Array.from(this.menuEl.querySelectorAll('li.open')).reverse()[0];\n if (openSub) {\n this._closeSubmenu(openSub as HTMLElement);\n this._focusRow(openSub as HTMLElement);\n } else {\n this.close();\n }\n }\n\n const keyText = e.key.toLowerCase();\n if (e.key.length === 1 && e.key !== SPACE) {\n this.filterQuery.push(keyText);\n const string = this.filterQuery.join('');\n // textContent rather than innerText: this scans every item on every\n // keystroke, and innerText forces a layout flush per item.\n const newOptionEl = this._rows(list).find(\n (el) => !el.matches('.disabled, [aria-disabled=\"true\"]') &&\n Array.from(el.childNodes).filter(node => !(node instanceof Element && node.matches('menu')))\n .map(node => node.textContent).join('').trim().toLowerCase().startsWith(string)\n );\n if (newOptionEl) {\n this._focusRow(newOptionEl as HTMLElement);\n }\n // Re-arm rather than stack: without the clear, every keystroke left a live\n // timer behind and the query could reset while the user was still typing.\n clearTimeout(this.filterTimeout);\n this.filterTimeout = setTimeout(this._resetFilterQuery, 1000);\n }\n };\n\n _handleWindowResize = () => {\n // Only re-place the menu if it's still visible\n // Accounts for elements hiding via media queries\n if (this.el.offsetParent) {\n this.recalculateDimensions();\n }\n };\n\n _resetFilterQuery = () => {\n this.filterQuery = [];\n };\n\n private _restoreInert() {\n if (this.menuEl) restoreAttribute(this.menuEl, 'inert', this._originalInert);\n }\n\n // focusedIndex is reset on close and only covers one list, so clearing by\n // index left an old highlight behind after reopening or a typeahead jump.\n private _clearActive() {\n this.menuEl?.querySelectorAll('li.active').forEach((li) => li.classList.remove('active'));\n }\n\n private _focusRow(item: HTMLElement) {\n this._clearActive();\n this.focusedIndex = Array.from(item.parentElement.children).indexOf(item);\n item.focus({ preventScroll: true });\n item.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n }\n\n _resetMenuStyles() {\n // destroy() runs this even when the menu target was never found.\n if (!this.menuEl) return;\n // A no-op unless open, so a removed menu does not throw. A second\n // destroy() finds the popover attribute already put back and skips it.\n if (this.menuEl.popover) this.menuEl.hidePopover();\n this._resetMenuPositioningStyles();\n this.menuEl.style.transform = '';\n this.menuEl.style.opacity = '';\n }\n\n _resetMenuPositioningStyles() {\n this.menuEl.style.width = '';\n this.menuEl.style.height = '';\n this.menuEl.style.left = '';\n this.menuEl.style.top = '';\n this.menuEl.style.transformOrigin = '';\n for (const property of ANCHOR_STYLES) this.menuEl.style.removeProperty(property);\n this._stopReanchoring();\n }\n\n _moveMenuToElement() {\n this._originalPlace = { parent: this.menuEl.parentNode, next: this.menuEl.nextSibling };\n if (this.options.container) this.options.container.append(this.menuEl);\n else this.el.after(this.menuEl);\n }\n\n /** Keeps the value an attribute had before setup first changed it, which destroy() puts back. */\n private _keepAttribute(el: Element, name: string) {\n const saved = this._originalAttributes.get(el) ?? new Map<string, string | null>();\n if (!saved.has(name)) saved.set(name, el.getAttribute(name));\n this._originalAttributes.set(el, saved);\n }\n\n private _setAttribute(el: Element, name: string, value: string) {\n this._keepAttribute(el, name);\n el.setAttribute(name, value);\n }\n\n /**\n * Puts back the attributes setup wrote and the menu where it was, so a\n * destroyed trigger is no longer announced as a menu button. The place is\n * only used while it is still in the page.\n */\n private _restoreSetup() {\n this._originalAttributes.forEach((saved, el) => saved.forEach((value, name) => restoreAttribute(el, name, value)));\n this._originalAttributes.clear();\n const { parent, next } = this._originalPlace;\n if (parent?.isConnected) parent.insertBefore(this.menuEl, next?.parentNode === parent ? next : null);\n }\n\n _makeMenuFocusable() {\n if (!this.menuEl) return;\n // Manual: Menu keeps its own light dismiss and Escape. An auto popover\n // would close an Autocomplete list when its input is clicked, close any\n // other open popover, and leave the top layer before the exit fade where\n // `overlay` is missing (Firefox, WebKit).\n this._keepAttribute(this.menuEl, 'popover');\n this.menuEl.popover = 'manual';\n // Focus moves directly to menu items; the surface itself is not a stop.\n this._setAttribute(this.menuEl, 'tabindex', '-1');\n // Only set tabindex if it hasn't been set by user\n this.menuEl.querySelectorAll(':scope li').forEach((el) => {\n if (el.matches('.divider, .gap, .label, .optgroup, [role=\"none\"]')) {\n this._setAttribute(el, 'tabindex', '-1');\n return;\n }\n if (!el.getAttribute('tabindex')) this._setAttribute(el, 'tabindex', '0');\n });\n }\n\n /**\n * Moves focus for Up, Down, Home or End among the list's focusable rows,\n * without wrapping, and says whether the key was one of those.\n */\n private _moveFocus(list: Element, e: KeyboardEvent) {\n const rows = this._rows(list);\n const from = this._focusedRow(e) ?? list.children[this.focusedIndex];\n const index = Utils._keyIndex(e.key, rows.indexOf(from as HTMLElement), rows.length, STEPS);\n if (Number.isNaN(index)) return false;\n const row = rows[index];\n if (row) {\n this._focusRow(row);\n row.classList.add('active');\n }\n return true;\n }\n\n /** The list's rows that take focus, in document order. */\n private _rows(list: Element) {\n return Array.from(list.querySelectorAll(ROWS)).filter(\n (row): row is HTMLElement => row instanceof HTMLElement && row.tabIndex !== -1\n );\n }\n\n private _focusInitialItem() {\n if (!this.menuEl || !this.options.autoFocus) return;\n const first = this._rows(this.menuEl)[0];\n if (!first) return;\n this._clearActive();\n this.focusedIndex = Array.from(first.parentElement.children).indexOf(first);\n first.focus({ preventScroll: true });\n }\n\n _focusFocusedItem() {\n if (\n this.focusedIndex >= 0 &&\n this.focusedIndex < this.menuEl.children.length &&\n this.options.autoFocus\n ) {\n (this.menuEl.children[this.focusedIndex] as HTMLElement).focus({\n preventScroll: true\n });\n this.menuEl.children[this.focusedIndex].scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n inline: 'nearest'\n });\n }\n }\n\n /**\n * Whether a measured menu opens upward: when there is no room below, or\n * when placement 'top' asks for it and there is room above.\n */\n private _opensUp(space: { top: number; bottom: number }) {\n return space.top < 0 || (this.options.placement === 'top' && space.bottom >= 0);\n }\n\n _getMenuPosition() {\n const triggerBRect = this.el.getBoundingClientRect();\n const menuBRect = this.menuEl.getBoundingClientRect();\n\n let idealHeight = menuBRect.height;\n let idealWidth = menuBRect.width;\n let idealXPos = triggerBRect.left - menuBRect.left;\n let idealYPos = triggerBRect.top - menuBRect.top;\n\n const space = room(this.el, menuBRect, this.options.coverTrigger ? 0 : triggerBRect.height);\n\n let verticalAlignment = 'top';\n let horizontalAlignment = this.options.alignment;\n idealYPos += this.options.coverTrigger ? 0 : triggerBRect.height;\n\n // Reset isScrollable\n this.isScrollable = false;\n\n if (this._opensUp(space)) {\n if (space.bottom >= 0) {\n verticalAlignment = 'bottom';\n\n if (!this.options.coverTrigger) {\n idealYPos -= triggerBRect.height;\n }\n } else {\n this.isScrollable = true;\n\n // Determine which side has most space and cutoff at correct height\n idealHeight -= 20; // Add padding when cutoff\n if (space.bottom > space.top) {\n verticalAlignment = 'bottom';\n idealHeight += space.bottom;\n idealYPos -= this.options.coverTrigger\n ? space.bottom - 20\n : space.bottom - 20 + triggerBRect.height;\n } else {\n idealHeight += space.top;\n }\n }\n }\n\n // If preferred horizontal alignment is possible\n if (space[horizontalAlignment] < 0) {\n const oppositeAlignment = horizontalAlignment === 'left' ? 'right' : 'left';\n if (space[oppositeAlignment] >= 0) {\n horizontalAlignment = oppositeAlignment;\n } else {\n // Determine which side has most space and cutoff at correct height\n if (space.right > space.left) {\n horizontalAlignment = 'right';\n idealWidth += space.right;\n idealXPos -= space.right;\n } else {\n horizontalAlignment = 'left';\n idealWidth += space.left;\n }\n }\n }\n\n if (verticalAlignment === 'bottom') {\n idealYPos =\n idealYPos - menuBRect.height + (this.options.coverTrigger ? triggerBRect.height : 0);\n }\n if (horizontalAlignment === 'right') {\n idealXPos = idealXPos - menuBRect.width + triggerBRect.width;\n }\n return {\n x: idealXPos,\n y: idealYPos,\n verticalAlignment: verticalAlignment,\n horizontalAlignment: horizontalAlignment,\n height: idealHeight,\n width: idealWidth\n };\n }\n\n private _schedule(callback: () => void, delay: number) {\n const timer = setTimeout(() => {\n this._pendingTimers.delete(timer);\n callback();\n }, delay);\n this._pendingTimers.add(timer);\n }\n\n private _clearPendingTimers() {\n for (const timer of this._pendingTimers) clearTimeout(timer);\n this._pendingTimers.clear();\n return ++this._transition;\n }\n\n _animateIn() {\n const transition = this._transition;\n // Decided now: a hover open leaves focus alone, and if the keyboard takes\n // the menu over before the animation ends it has already placed focus,\n // so the delayed call must not pull it back to the first item.\n const focusOnOpen = !this._openedByHover;\n const duration = this.options.inDuration;\n this.menuEl.style.transition = 'none';\n // from\n this.menuEl.style.opacity = '0';\n this.menuEl.style.transform = 'scale(0.85)';\n this._schedule(() => {\n this.menuEl.style.transition = `opacity ${duration}ms ease, transform ${duration}ms ease`;\n this.menuEl.style.opacity = '1';\n this.menuEl.style.transform = 'scale(1)';\n }, 1);\n this._schedule(() => {\n if (focusOnOpen) this._focusInitialItem();\n if (transition !== this._transition) return;\n this._notify('opened', this.options.onOpenEnd, { current: () => transition === this._transition });\n }, duration);\n }\n\n _animateOut() {\n const transition = this._transition;\n const duration = this.options.outDuration;\n // easeOutQuad (opacity) & easeOutQuint\n this.menuEl.style.transition = `opacity ${duration}ms ease, transform ${duration}ms ease`;\n // to\n this.menuEl.style.opacity = '0';\n this.menuEl.style.transform = 'scale(0.85)';\n this._schedule(() => {\n this._resetMenuStyles();\n this._notify('closed', this.options.onCloseEnd, { current: () => transition === this._transition });\n }, duration);\n }\n\n _placeMenu() {\n // Set width before calculating positionInfo. Both callers reset the\n // positioning styles first, so this reads the surface's natural width.\n const natural = this.menuEl.getBoundingClientRect().width;\n // A trigger narrower than the surface's own minimum is not a constraint\n // the menu can honour: the width is written and `min-width` overrides it,\n // leaving the surface at the floor with every item inside it wrapped. So\n // constrain only to a trigger wide enough to mean something, and size by\n // content otherwise. An icon button and a split button's chevron are both\n // that case - 40dp and 48dp against a 112dp floor.\n const triggerWidth = this.el.getBoundingClientRect().width;\n const idealWidth =\n this.options.constrainWidth && !this.options.contextMenu && triggerWidth >= MIN_SURFACE_WIDTH\n ? triggerWidth\n : Math.min(MAX_SURFACE_WIDTH, Math.max(MIN_SURFACE_WIDTH, natural));\n this.menuEl.style.width = idealWidth + 'px';\n\n if (this.options.contextMenu) {\n this._placeMenuAtPoint(this._contextPoint ?? this._regionCorner());\n return;\n }\n\n if (anchorSupported && !this.options.coverTrigger && !transformed(this.el)) this._anchorMenu();\n else this._placeByCoordinates();\n }\n\n /**\n * The side an anchored menu opens on: the one asked for when the whole\n * menu fits there, or else the roomier one. The anchored height is capped\n * to its side, so a menu that would only shrink never sets off the\n * flip-block fallback, and the choice is made here.\n */\n private _side(): 'top' | 'bottom' {\n const rect = this.el.getBoundingClientRect();\n const room = { top: rect.top, bottom: window.innerHeight - rect.bottom };\n const [asked, other] = this.options.placement === 'top' ? ['top', 'bottom'] as const : ['bottom', 'top'] as const;\n return room[asked] >= this.menuEl.scrollHeight || room[asked] >= room[other] ? asked : other;\n }\n\n // Below the trigger, or above it for placement 'top', starting at its left\n // edge for alignment 'left' or its right edge for 'right', with the flips\n // position-try-fallbacks offers.\n // The height is capped to the room on the chosen side, so a long menu\n // scrolls there, as in the measured path.\n private _reanchorFrame = 0;\n\n private _anchorMenu() {\n const name = `--menu-${this.menuEl.id}`;\n Utils.setAnchorName(this.el, name, true);\n const style = this.menuEl.style;\n style.position = 'fixed';\n style.inset = 'auto';\n style.maxHeight = '100%';\n style.setProperty('position-anchor', name);\n this._placeAnchored();\n }\n\n /**\n * At most once a frame while the menu is open and something outside it\n * scrolls, an anchored menu chooses its side again and a measured one\n * follows its trigger, keeping its own scroll position. A context menu\n * stays where it opened, and the menu's own scrolling moves nothing.\n */\n private _reanchor = (event: Event) => {\n if (this._reanchorFrame || this.options.contextMenu || this.menuEl.contains(event.target as Node)) return;\n this._reanchorFrame = requestAnimationFrame(() => {\n this._reanchorFrame = 0;\n if (!this.isOpen) return;\n if (this.menuEl.style.getPropertyValue('position-anchor')) return this._placeAnchored();\n // Re-measuring clears the height, which would reset the scroll position.\n const { scrollTop } = this.menuEl;\n this.recalculateDimensions();\n this.menuEl.scrollTop = scrollTop;\n });\n };\n\n private _stopReanchoring() {\n cancelAnimationFrame(this._reanchorFrame);\n this._reanchorFrame = 0;\n }\n\n /** The anchored menu's side, the edge it starts from and its growth origin. */\n private _placeAnchored() {\n const style = this.menuEl.style;\n const [side, edge] = [this._side(), this.options.alignment === 'right' ? 'left' : 'right'];\n style.setProperty('position-area', `${side} span-${edge}`);\n style.setProperty('position-try-fallbacks', 'flip-block, flip-inline, flip-block flip-inline');\n style.transformOrigin = `${edge === 'left' ? '100%' : '0'} ${side === 'top' ? '100%' : '0'}`;\n this.isScrollable = this.menuEl.scrollHeight > this.menuEl.clientHeight;\n }\n\n private _placeByCoordinates() {\n const positionInfo = this._getMenuPosition();\n this.menuEl.style.left = positionInfo.x + 'px';\n this.menuEl.style.top = positionInfo.y + 'px';\n this.menuEl.style.height = positionInfo.height + 'px';\n this.menuEl.style.width = positionInfo.width + 'px';\n this.menuEl.style.transformOrigin = `${\n positionInfo.horizontalAlignment === 'left' ? '0' : '100%'\n } ${positionInfo.verticalAlignment === 'top' ? '0' : '100%'}`;\n }\n\n /** Where a context menu opens without a pointer: the region's start corner. */\n private _regionCorner() {\n const rect = this.el.getBoundingClientRect();\n const rtl = getComputedStyle(this.el).direction === 'rtl';\n return { x: rtl ? rect.right : rect.left, y: rect.bottom };\n }\n\n /**\n * Places a context menu with its start corner on the point, flipping to\n * the other side of the point where it would not fit. The bounds are the\n * viewport; a menu taller than it gets its height and scrolls.\n *\n * The menu rests at left/top 0 of its containing block, so its rect is the\n * offset to subtract - the same trick _getMenuPosition uses. It is measured\n * without the entry animation's scale, which a second right-click can catch.\n */\n private _placeMenuAtPoint({ x, y }: { x: number; y: number }) {\n // A running transition would still report the interpolated scale, so it\n // is suspended for the read; the target transform is unchanged after.\n const { transform, transition } = this.menuEl.style;\n this.menuEl.style.transition = 'none';\n this.menuEl.style.transform = 'none';\n const menu = this.menuEl.getBoundingClientRect();\n this.menuEl.style.transform = transform;\n this.menuEl.style.transition = transition;\n\n const bounds = { left: 0, top: 0, right: window.innerWidth, bottom: window.innerHeight };\n const width = menu.width;\n const height = Math.min(menu.height, bounds.bottom - bounds.top);\n this.isScrollable = height < menu.height;\n if (this.isScrollable) this.menuEl.style.height = height + 'px';\n\n const rtl = getComputedStyle(this.el).direction === 'rtl';\n const fitsRight = x + width <= bounds.right;\n const fitsLeft = x - width >= bounds.left;\n const leftward = rtl ? fitsLeft || !fitsRight : !fitsRight && fitsLeft;\n const upward = y + height > bounds.bottom && y - height >= bounds.top;\n const clamp = (value: number, min: number, max: number) => Math.max(min, Math.min(value, max));\n const left = clamp(leftward ? x - width : x, bounds.left, bounds.right - width);\n const top = clamp(upward ? y - height : y, bounds.top, bounds.bottom - height);\n this.menuEl.style.left = left - menu.left + 'px';\n this.menuEl.style.top = top - menu.top + 'px';\n this.menuEl.style.transformOrigin = `${leftward ? '100%' : '0'} ${upward ? '100%' : '0'}`;\n }\n\n private _setExpanded(expanded: boolean) {\n if (!this.options.contextMenu) this.el.ariaExpanded = String(expanded);\n }\n\n // A trigger whose target never resolved has no menu to open.\n private get _canOpen() {\n return !this.isOpen && !!this.menuEl && Menu.getInstance(this.el) === this;\n }\n\n /**\n * Open menu.\n */\n open = () => {\n if (!this._canOpen) return;\n const transition = this._clearPendingTimers();\n this.isOpen = true;\n // onOpenStart callback\n if (!this._notify('open', this.options.onOpenStart, { current: () => transition === this._transition })) return;\n // Reset styles\n this._resetMenuStyles();\n // The top layer: no ancestor clips or contains the open menu.\n if (this.menuEl.isConnected) this.menuEl.showPopover();\n this._restoreInert();\n this._placeMenu();\n // Do this one frame later so that we don't bind an event handler that's immediately\n // called when the event bubbles up to the document and closes the menu\n this._schedule(() => this._setupTemporaryEventHandlers(), 0);\n // Queue handlers before initial focus, including zero-duration entry.\n this._animateIn();\n this._setExpanded(true);\n };\n\n /**\n * Close menu.\n */\n close = () => {\n if (!this.isOpen) return;\n const transition = this._clearPendingTimers();\n const root = this.menuEl.getRootNode() as Document | ShadowRoot;\n const focused = root.activeElement;\n this.isOpen = false;\n this._openedByHover = false;\n this.menuEl.setAttribute('inert', '');\n clearTimeout(this.filterTimeout);\n this._resetFilterQuery();\n this.focusedIndex = -1;\n this._clearActive();\n this._closeSubmenus();\n // onCloseStart callback\n if (!this._notify('close', this.options.onCloseStart, { current: () => transition === this._transition })) return;\n this._animateOut();\n this._openEvents?.abort();\n this._setExpanded(false);\n if (this.options.autoFocus && this.menuEl.contains(focused) &&\n (root.activeElement === focused || this.el.ownerDocument.activeElement === this.el.ownerDocument.body)) {\n // A context region may not take focus itself; return to what had it.\n const back = this._contextReturn;\n (back?.isConnected && back !== this.el.ownerDocument.body ? back : this.el).focus();\n }\n this._contextReturn = null;\n this._contextPoint = null;\n };\n\n /**\n * While menu is open, you can recalculate its dimensions if its contents have changed.\n */\n recalculateDimensions = () => {\n if (this.isOpen) {\n this._resetMenuPositioningStyles();\n this._placeMenu();\n }\n };\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;AAYA,IAAM,WAAW,CAAC,OAAgC,GAAG,kBAAmB,GAAG,YAAY,EAAiB,QAAQ;AAUhH,IAAM,WAAW,EAAE,WAAW,2BAA2B,QAAQ,wBAAwB,OAAO,sBAAsB;AAEtH,SAAS,YAAY,IAAa;AAChC,WAAS,OAAO,SAAS,EAAE,GAAG,MAAM,OAAO,SAAS,IAAI,GAAG;AACzD,UAAM,QAAQ,iBAAiB,IAAI;AAEnC,QAAI,CAAC,IAAI,kBAAkB,MAAM,SAAS,EAAE,WAAY,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AiEF;AAhiCa,MACJ,SAAiB,CAAC;AADd,MA+EJ,MAAM;AA/ER,IAAM,OAAN;",
|
|
6
|
+
"names": ["room"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Utils,
|
|
3
|
+
controllerFor
|
|
4
|
+
} from "./chunk-67UNY7RH.mjs";
|
|
5
|
+
|
|
6
|
+
// src/ts/core/component.ts
|
|
7
|
+
var defined = (options) => options && Object.fromEntries(Object.entries(options).filter(([, value]) => value !== void 0));
|
|
8
|
+
var Component = class {
|
|
9
|
+
/**
|
|
10
|
+
* Destroys any instance already on `el`, then spreads `options` over the
|
|
11
|
+
* class defaults, and `options.i18n` over the default strings, so passing
|
|
12
|
+
* one string keeps the rest. A subclass passes options it reads from
|
|
13
|
+
* markup in `options`.
|
|
14
|
+
*/
|
|
15
|
+
constructor(el, options) {
|
|
16
|
+
if (!(el instanceof HTMLElement)) {
|
|
17
|
+
console.error(Error(el + " is not an HTML Element"));
|
|
18
|
+
}
|
|
19
|
+
new.target.getInstance(el)?.destroy();
|
|
20
|
+
this.el = el;
|
|
21
|
+
const defaults = new.target.defaults;
|
|
22
|
+
const given = defined(options);
|
|
23
|
+
const i18n = defaults.i18n ? { i18n: { ...defaults.i18n, ...defined(given?.i18n ?? {}) } } : {};
|
|
24
|
+
this.options = { ...defaults, ...given, ...i18n };
|
|
25
|
+
this._events = controllerFor(el);
|
|
26
|
+
Reflect.set(el, new.target.key, this);
|
|
27
|
+
}
|
|
28
|
+
static init(els, options = {}) {
|
|
29
|
+
const create = (el) => new this(el, options);
|
|
30
|
+
if (els instanceof Element) return create(els);
|
|
31
|
+
return els ? Array.from(els, create) : null;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @returns default options for component instance.
|
|
35
|
+
*/
|
|
36
|
+
static get defaults() {
|
|
37
|
+
return {};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Retrieves the instance of the class it is called on for the given element,
|
|
41
|
+
* or undefined before init and after destroy.
|
|
42
|
+
* @param el Associated HTML Element.
|
|
43
|
+
*/
|
|
44
|
+
static getInstance(el) {
|
|
45
|
+
return Reflect.get(el, this.key);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Runs an `on…` option callback, then fires `expressive:<type>` from the
|
|
49
|
+
* element, so pages can listen instead of passing options. The callback gets
|
|
50
|
+
* `args` (the element by default) and the event carries `detail`.
|
|
51
|
+
*
|
|
52
|
+
* A callback or listener may close, reopen or destroy the component. Pass
|
|
53
|
+
* `current` to tell whether the state `type` names still holds; the event
|
|
54
|
+
* is skipped once it does not, or once the instance is destroyed, and the
|
|
55
|
+
* result says whether to carry on.
|
|
56
|
+
*/
|
|
57
|
+
_notify(type, callback, { args = [this.el], detail, current = () => true } = {}) {
|
|
58
|
+
const live = () => this.constructor.getInstance(this.el) === this && current();
|
|
59
|
+
if (typeof callback === "function") Reflect.apply(callback, this, args);
|
|
60
|
+
if (!live()) return false;
|
|
61
|
+
Utils.emit(this.el, type, detail);
|
|
62
|
+
return live();
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Destroy plugin instance and teardown. A subclass tears down its own state
|
|
66
|
+
* and calls this to remove its listeners and release the element.
|
|
67
|
+
*/
|
|
68
|
+
destroy() {
|
|
69
|
+
this._events.abort();
|
|
70
|
+
const { key } = this.constructor;
|
|
71
|
+
if (Reflect.get(this.el, key) === this) Reflect.set(this.el, key, void 0);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export {
|
|
76
|
+
defined,
|
|
77
|
+
Component
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=chunk-EB2V4OKL.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/ts/core/component.ts"],
|
|
4
|
+
"sourcesContent": ["import { Utils, controllerFor } from './utils';\n\n/**\n * Base options for component initialization.\n */\nexport interface BaseOptions {}\n\nexport type InitElement = HTMLElement | Element;\nexport type InitElements<T extends InitElement> = NodeListOf<T> | HTMLCollectionOf<T>;\n/** Any component class; `init` reads its element, options and instance types. */\ntype ComponentClass = (new (el: never, options: never) => Component<BaseOptions>) & { key: string };\n/** The element a component class is constructed on. */\ntype ElementOf<C extends ComponentClass> = C extends new (el: infer E, options: never) => unknown ? E : never;\n/** The options `init` accepts for a component class. */\ntype InitOptions<C extends ComponentClass> = Partial<InstanceType<C>['options']>;\n\nexport interface I18nOptions {\n cancel: string;\n clear: string;\n done: string;\n}\n\n/** What {@link Component._notify} passes on, and when it stops. */\nexport interface NotifyOptions {\n args?: unknown[];\n detail?: unknown;\n current?: () => boolean;\n}\n\n/**\n * `options` without its keys set to `undefined`, so those keep their\n * defaults: `{ i18n: { tooShort: t.missing } }` must not erase a message.\n */\nexport const defined = <T extends object>(options: T): T =>\n options && (Object.fromEntries(Object.entries(options).filter(([, value]) => value !== undefined)) as T);\n\n/**\n * Base class implementation for Expressive components.\n */\nexport class Component<O extends BaseOptions> {\n /**\n * The element property that holds an instance, `Expressive_<Name>`, so page\n * code can read `el.Expressive_Tabs` as well as call `Tabs.getInstance(el)`.\n */\n static key: string;\n /**\n * The DOM element the plugin was initialized with.\n */\n el: HTMLElement;\n /**\n * The options the instance was initialized with.\n */\n options: O;\n /** Aborted by destroy(), which removes every listener added with its signal. */\n protected _events: AbortController;\n\n /**\n * Destroys any instance already on `el`, then spreads `options` over the\n * class defaults, and `options.i18n` over the default strings, so passing\n * one string keeps the rest. A subclass passes options it reads from\n * markup in `options`.\n */\n constructor(el: HTMLElement, options: Partial<O>) {\n // Display error if el is not a valid HTML Element\n if (!(el instanceof HTMLElement)) {\n console.error(Error(el + ' is not an HTML Element'));\n }\n new.target.getInstance(el)?.destroy();\n this.el = el;\n const defaults: Partial<O> & { i18n?: object } = new.target.defaults;\n const given = defined(options) as typeof defaults;\n const i18n = defaults.i18n ? { i18n: { ...defaults.i18n, ...defined(given?.i18n ?? {}) } } : {};\n this.options = { ...defaults, ...given, ...i18n } as O;\n this._events = controllerFor(el);\n Reflect.set(el, new.target.key, this);\n }\n\n /**\n * Initializes an instance of the class it is called on.\n * @param el HTML element.\n * @param options Component options.\n */\n static init<C extends ComponentClass>(this: C, el: ElementOf<C>, options?: InitOptions<C>): InstanceType<C>;\n /**\n * Initializes an instance of the class it is called on for each element.\n * @param els HTML elements.\n * @param options Component options.\n */\n static init<C extends ComponentClass>(\n this: C,\n els: InitElements<InitElement>,\n options?: InitOptions<C>\n ): InstanceType<C>[];\n static init<C extends ComponentClass>(\n this: C,\n els: ElementOf<C> | InitElements<InitElement>,\n options: InitOptions<C> = {}\n ): InstanceType<C> | InstanceType<C>[] | null {\n const create = (el: unknown) => new this(el as never, options as never) as InstanceType<C>;\n if (els instanceof Element) return create(els);\n return els ? Array.from(els as InitElements<InitElement>, create) : null;\n }\n\n /**\n * @returns default options for component instance.\n */\n static get defaults(): BaseOptions {\n return {};\n }\n\n /**\n * Retrieves the instance of the class it is called on for the given element,\n * or undefined before init and after destroy.\n * @param el Associated HTML Element.\n */\n static getInstance<C extends ComponentClass>(this: C, el: Element): InstanceType<C> | undefined {\n return Reflect.get(el, this.key);\n }\n\n /**\n * Runs an `on\u2026` option callback, then fires `expressive:<type>` from the\n * element, so pages can listen instead of passing options. The callback gets\n * `args` (the element by default) and the event carries `detail`.\n *\n * A callback or listener may close, reopen or destroy the component. Pass\n * `current` to tell whether the state `type` names still holds; the event\n * is skipped once it does not, or once the instance is destroyed, and the\n * result says whether to carry on.\n */\n protected _notify(\n type: string,\n callback?: ((...args: never[]) => unknown) | null,\n { args = [this.el], detail, current = () => true }: NotifyOptions = {}\n ): boolean {\n const live = () => (this.constructor as typeof Component).getInstance(this.el) === this && current();\n if (typeof callback === 'function') Reflect.apply(callback, this, args);\n if (!live()) return false;\n Utils.emit(this.el, type, detail);\n return live();\n }\n\n /**\n * Destroy plugin instance and teardown. A subclass tears down its own state\n * and calls this to remove its listeners and release the element.\n */\n destroy(): void {\n this._events.abort();\n // A stale instance, replaced by a later init on the same element, must\n // not unregister the instance that replaced it.\n const { key } = this.constructor as typeof Component;\n if (Reflect.get(this.el, key) === this) Reflect.set(this.el, key, undefined);\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;AAiCO,IAAM,UAAU,CAAmB,YACxC,WAAY,OAAO,YAAY,OAAO,QAAQ,OAAO,EAAE,OAAO,CAAC,CAAC,EAAE,KAAK,MAAM,UAAU,MAAS,CAAC;AAK5F,IAAM,YAAN,MAAuC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAuB5C,YAAY,IAAiB,SAAqB;AAEhD,QAAI,EAAE,cAAc,cAAc;AAChC,cAAQ,MAAM,MAAM,KAAK,yBAAyB,CAAC;AAAA,IACrD;AACA,eAAW,YAAY,EAAE,GAAG,QAAQ;AACpC,SAAK,KAAK;AACV,UAAM,WAA2C,WAAW;AAC5D,UAAM,QAAQ,QAAQ,OAAO;AAC7B,UAAM,OAAO,SAAS,OAAO,EAAE,MAAM,EAAE,GAAG,SAAS,MAAM,GAAG,QAAQ,OAAO,QAAQ,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC;AAC9F,SAAK,UAAU,EAAE,GAAG,UAAU,GAAG,OAAO,GAAG,KAAK;AAChD,SAAK,UAAU,cAAc,EAAE;AAC/B,YAAQ,IAAI,IAAI,WAAW,KAAK,IAAI;AAAA,EACtC;AAAA,EAkBA,OAAO,KAEL,KACA,UAA0B,CAAC,GACiB;AAC5C,UAAM,SAAS,CAAC,OAAgB,IAAI,KAAK,IAAa,OAAgB;AACtE,QAAI,eAAe,QAAS,QAAO,OAAO,GAAG;AAC7C,WAAO,MAAM,MAAM,KAAK,KAAkC,MAAM,IAAI;AAAA,EACtE;AAAA;AAAA;AAAA;AAAA,EAKA,WAAW,WAAwB;AACjC,WAAO,CAAC;AAAA,EACV;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,OAAO,YAA+C,IAA0C;AAC9F,WAAO,QAAQ,IAAI,IAAI,KAAK,GAAG;AAAA,EACjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYU,QACR,MACA,UACA,EAAE,OAAO,CAAC,KAAK,EAAE,GAAG,QAAQ,UAAU,MAAM,KAAK,IAAmB,CAAC,GAC5D;AACT,UAAM,OAAO,MAAO,KAAK,YAAiC,YAAY,KAAK,EAAE,MAAM,QAAQ,QAAQ;AACnG,QAAI,OAAO,aAAa,WAAY,SAAQ,MAAM,UAAU,MAAM,IAAI;AACtE,QAAI,CAAC,KAAK,EAAG,QAAO;AACpB,UAAM,KAAK,KAAK,IAAI,MAAM,MAAM;AAChC,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,UAAgB;AACd,SAAK,QAAQ,MAAM;AAGnB,UAAM,EAAE,IAAI,IAAI,KAAK;AACrB,QAAI,QAAQ,IAAI,KAAK,IAAI,GAAG,MAAM,KAAM,SAAQ,IAAI,KAAK,IAAI,KAAK,MAAS;AAAA,EAC7E;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Component
|
|
3
|
+
} from "./chunk-EB2V4OKL.mjs";
|
|
4
|
+
import {
|
|
5
|
+
deepActiveElement
|
|
6
|
+
} from "./chunk-67UNY7RH.mjs";
|
|
7
|
+
|
|
8
|
+
// src/ts/components/navigationRail.ts
|
|
9
|
+
var _defaults = {
|
|
10
|
+
onOpenStart: null,
|
|
11
|
+
onOpenEnd: null,
|
|
12
|
+
onCloseStart: null,
|
|
13
|
+
onCloseEnd: null
|
|
14
|
+
};
|
|
15
|
+
var COMPACT = "(width < 600px)";
|
|
16
|
+
var HOVER_DELAY = 200;
|
|
17
|
+
var NavigationRail = class extends Component {
|
|
18
|
+
constructor(el, options) {
|
|
19
|
+
super(el, options);
|
|
20
|
+
this._hoverPanel = null;
|
|
21
|
+
/**
|
|
22
|
+
* Expands the rail. On compact windows the overlay (scrim) is CSS.
|
|
23
|
+
*/
|
|
24
|
+
this.expand = () => {
|
|
25
|
+
if (this.isExpanded) return;
|
|
26
|
+
if (!this._notify("open", this.options.onOpenStart, { current: () => !this.isExpanded })) return;
|
|
27
|
+
this.isExpanded = true;
|
|
28
|
+
this.el.classList.add("expanded");
|
|
29
|
+
this._sync();
|
|
30
|
+
this._notify("opened", this.options.onOpenEnd, { current: () => this.isExpanded });
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Collapses the rail.
|
|
34
|
+
*/
|
|
35
|
+
this.collapse = () => {
|
|
36
|
+
if (!this.isExpanded) return;
|
|
37
|
+
if (!this._notify("close", this.options.onCloseStart, { current: () => this.isExpanded })) return;
|
|
38
|
+
this.isExpanded = false;
|
|
39
|
+
this.el.classList.remove("expanded");
|
|
40
|
+
this._sync();
|
|
41
|
+
this._notify("closed", this.options.onCloseEnd, { current: () => !this.isExpanded });
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Toggles expanded / collapsed.
|
|
45
|
+
*/
|
|
46
|
+
this.toggle = () => {
|
|
47
|
+
if (this.isExpanded) this.collapse();
|
|
48
|
+
else this.expand();
|
|
49
|
+
};
|
|
50
|
+
this._onPointerOver = (e) => {
|
|
51
|
+
if (e.pointerType !== "mouse") return;
|
|
52
|
+
clearTimeout(this._hoverTimer);
|
|
53
|
+
const target = e.target;
|
|
54
|
+
const panel = this._panelAt(target);
|
|
55
|
+
if (!panel) this._hoverClose(target);
|
|
56
|
+
else if (panel !== this._hoverPanel) {
|
|
57
|
+
this._hoverTimer = setTimeout(() => this._hoverOpen(target), HOVER_DELAY);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
// The panel is a descendant, so moving onto it does not leave the rail.
|
|
61
|
+
this._onPointerLeave = (e) => {
|
|
62
|
+
if (e.pointerType !== "mouse") return;
|
|
63
|
+
clearTimeout(this._hoverTimer);
|
|
64
|
+
this._hoverClose();
|
|
65
|
+
};
|
|
66
|
+
this._onClick = (e) => {
|
|
67
|
+
const target = e.target;
|
|
68
|
+
if (!(target instanceof Node) || this._pinPanel(e)) return;
|
|
69
|
+
if (this._toggle?.contains(target)) {
|
|
70
|
+
this.toggle();
|
|
71
|
+
e.preventDefault();
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (this._isScrimClick(e) && this.isExpanded && this._isModal()) {
|
|
75
|
+
this.collapse();
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
this._onKeyDown = (e) => {
|
|
79
|
+
if (e.key !== "Escape" || e.defaultPrevented || this._escapePanel(e)) return;
|
|
80
|
+
if (this.isExpanded && this._isModal()) {
|
|
81
|
+
const root = this.el.getRootNode();
|
|
82
|
+
const restoreFocus = this.el.contains(root.activeElement);
|
|
83
|
+
const focused = deepActiveElement(root);
|
|
84
|
+
this.collapse();
|
|
85
|
+
if (!this.isExpanded && restoreFocus && deepActiveElement(root) === focused) {
|
|
86
|
+
this._toggle?.focus();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
this._toggle = this._findToggle();
|
|
91
|
+
this._mql = window.matchMedia(COMPACT);
|
|
92
|
+
this.isExpanded = this.el.classList.contains("expanded");
|
|
93
|
+
this._sync();
|
|
94
|
+
const { signal } = this._events;
|
|
95
|
+
this.el.addEventListener("click", this._onClick, { signal });
|
|
96
|
+
this.el.addEventListener("pointerover", this._onPointerOver, { signal });
|
|
97
|
+
this.el.addEventListener("pointerleave", this._onPointerLeave, { signal });
|
|
98
|
+
document.addEventListener("keydown", this._onKeyDown, { signal });
|
|
99
|
+
}
|
|
100
|
+
static get defaults() {
|
|
101
|
+
return _defaults;
|
|
102
|
+
}
|
|
103
|
+
destroy() {
|
|
104
|
+
clearTimeout(this._hoverTimer);
|
|
105
|
+
super.destroy();
|
|
106
|
+
}
|
|
107
|
+
_findToggle() {
|
|
108
|
+
const first = this.el.querySelector(":scope > button:not(.button, [popovertarget])");
|
|
109
|
+
return first instanceof HTMLButtonElement ? first : null;
|
|
110
|
+
}
|
|
111
|
+
_isCompact() {
|
|
112
|
+
return this._mql.matches;
|
|
113
|
+
}
|
|
114
|
+
_isModal() {
|
|
115
|
+
return this.el.classList.contains("modal") || this._isCompact();
|
|
116
|
+
}
|
|
117
|
+
_sync() {
|
|
118
|
+
this.el.setAttribute("aria-expanded", this.isExpanded ? "true" : "false");
|
|
119
|
+
this._toggle?.setAttribute("aria-expanded", this.isExpanded ? "true" : "false");
|
|
120
|
+
}
|
|
121
|
+
/** The side panel of the enabled destination around `target`, if any. */
|
|
122
|
+
_panelAt(target) {
|
|
123
|
+
const trigger = target instanceof Element ? target.closest("button[popovertarget]:enabled") : null;
|
|
124
|
+
const panel = trigger?.popoverTargetElement;
|
|
125
|
+
return panel?.classList.contains("navigation-rail-panel") ? panel : null;
|
|
126
|
+
}
|
|
127
|
+
// Looks the panel up again because the trigger can be disabled during the delay.
|
|
128
|
+
_hoverOpen(target) {
|
|
129
|
+
const panel = this._panelAt(target);
|
|
130
|
+
if (!panel || panel.matches(":popover-open")) return;
|
|
131
|
+
panel.showPopover.call(panel, {
|
|
132
|
+
source: target.closest("button[popovertarget]")
|
|
133
|
+
});
|
|
134
|
+
this._hoverPanel = panel;
|
|
135
|
+
}
|
|
136
|
+
// Closes the hover-opened panel after the delay, unless the pointer is still inside it.
|
|
137
|
+
_hoverClose(target = null) {
|
|
138
|
+
const panel = this._hoverPanel;
|
|
139
|
+
if (!panel || panel.contains(target)) return;
|
|
140
|
+
this._hoverTimer = setTimeout(() => {
|
|
141
|
+
const root = this.el.getRootNode();
|
|
142
|
+
if (panel.matches(":popover-open") && !panel.contains(root.activeElement)) panel.hidePopover();
|
|
143
|
+
if (this._hoverPanel === panel) this._hoverPanel = null;
|
|
144
|
+
}, HOVER_DELAY);
|
|
145
|
+
}
|
|
146
|
+
// Clicking a hover-opened panel's trigger keeps it open instead of toggling
|
|
147
|
+
// it shut; either way the panel no longer follows the pointer.
|
|
148
|
+
_pinPanel(e) {
|
|
149
|
+
const panel = this._panelAt(e.target);
|
|
150
|
+
if (!panel) return false;
|
|
151
|
+
clearTimeout(this._hoverTimer);
|
|
152
|
+
if (panel === this._hoverPanel && panel.matches(":popover-open")) e.preventDefault();
|
|
153
|
+
this._hoverPanel = null;
|
|
154
|
+
return true;
|
|
155
|
+
}
|
|
156
|
+
// Escape closes an open side panel before the rail, and reports whether a
|
|
157
|
+
// panel took the key. A hover-opened panel has no focus to return to, so
|
|
158
|
+
// focus inside it goes back to its trigger.
|
|
159
|
+
_escapePanel(e) {
|
|
160
|
+
clearTimeout(this._hoverTimer);
|
|
161
|
+
this._hoverPanel = null;
|
|
162
|
+
const panel = Array.from(this.el.querySelectorAll(".navigation-rail-panel")).find(
|
|
163
|
+
(el) => el.matches(":popover-open")
|
|
164
|
+
);
|
|
165
|
+
if (!panel) return false;
|
|
166
|
+
if (panel.querySelector(":popover-open")) return true;
|
|
167
|
+
const root = this.el.getRootNode();
|
|
168
|
+
const hadFocus = panel.contains(root.activeElement);
|
|
169
|
+
panel.hidePopover();
|
|
170
|
+
if (hadFocus) panel.previousElementSibling?.focus();
|
|
171
|
+
e.preventDefault();
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
174
|
+
// The scrim is the rail's own ::before, so a click on blank space inside the
|
|
175
|
+
// rail targets the rail just as a scrim click does. Only a click beside the
|
|
176
|
+
// rail's box landed on the scrim; a modal rail spans the full height.
|
|
177
|
+
_isScrimClick(e) {
|
|
178
|
+
if (e.target !== this.el) return false;
|
|
179
|
+
const { left, right } = this.el.getBoundingClientRect();
|
|
180
|
+
return e.clientX < left || e.clientX > right;
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
NavigationRail.key = "Expressive_NavigationRail";
|
|
184
|
+
|
|
185
|
+
export {
|
|
186
|
+
NavigationRail
|
|
187
|
+
};
|
|
188
|
+
//# sourceMappingURL=chunk-EWO662ZC.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/ts/components/navigationRail.ts"],
|
|
4
|
+
"sourcesContent": ["import { Component, BaseOptions } from '../core/component';\nimport { deepActiveElement } from '../core/utils';\n\nexport interface NavigationRailOptions extends BaseOptions {\n /**\n * Called before the rail expands.\n */\n onOpenStart: (el: HTMLElement) => void;\n /**\n * Called after the rail expands.\n */\n onOpenEnd: (el: HTMLElement) => void;\n /**\n * Called before the rail collapses.\n */\n onCloseStart: (el: HTMLElement) => void;\n /**\n * Called after the rail collapses.\n */\n onCloseEnd: (el: HTMLElement) => void;\n}\n\nconst _defaults: NavigationRailOptions = {\n onOpenStart: null,\n onOpenEnd: null,\n onCloseStart: null,\n onCloseEnd: null\n};\n\nconst COMPACT = '(width < 600px)';\n// Delay before a hovered destination opens its panel, and before the panel\n// closes once the pointer leaves; it covers the trip across the rail's padding.\nconst HOVER_DELAY = 200;\n\n/**\n * Navigation rail. Layout is CSS (collapsed / .expanded). This class\n * toggles that class from the menu button, closes a compact overlay on\n * Escape or a scrim tap, and keeps aria-expanded in sync. A destination's\n * .navigation-rail-panel is a native popover; this class also opens it on\n * mouse hover.\n */\nexport class NavigationRail extends Component<NavigationRailOptions> {\n isExpanded: boolean;\n private _toggle: HTMLButtonElement | null;\n private _mql: MediaQueryList;\n private _hoverPanel: HTMLElement | null = null;\n private _hoverTimer: ReturnType<typeof setTimeout> | undefined;\n\n constructor(el: HTMLElement, options: Partial<NavigationRailOptions>) {\n super(el, options);\n\n this._toggle = this._findToggle();\n this._mql = window.matchMedia(COMPACT);\n this.isExpanded = this.el.classList.contains('expanded');\n this._sync();\n const { signal } = this._events;\n this.el.addEventListener('click', this._onClick, { signal });\n this.el.addEventListener('pointerover', this._onPointerOver, { signal });\n this.el.addEventListener('pointerleave', this._onPointerLeave, { signal });\n document.addEventListener('keydown', this._onKeyDown, { signal });\n }\n\n static get defaults(): NavigationRailOptions {\n return _defaults;\n }\n\n static key = 'Expressive_NavigationRail';\n\n destroy() {\n clearTimeout(this._hoverTimer);\n super.destroy();\n }\n\n /**\n * Expands the rail. On compact windows the overlay (scrim) is CSS.\n */\n expand = () => {\n if (this.isExpanded) return;\n if (!this._notify('open', this.options.onOpenStart, { current: () => !this.isExpanded })) return;\n this.isExpanded = true;\n this.el.classList.add('expanded');\n this._sync();\n this._notify('opened', this.options.onOpenEnd, { current: () => this.isExpanded });\n };\n\n /**\n * Collapses the rail.\n */\n collapse = () => {\n if (!this.isExpanded) return;\n if (!this._notify('close', this.options.onCloseStart, { current: () => this.isExpanded })) return;\n this.isExpanded = false;\n this.el.classList.remove('expanded');\n this._sync();\n this._notify('closed', this.options.onCloseEnd, { current: () => !this.isExpanded });\n };\n\n /**\n * Toggles expanded / collapsed.\n */\n toggle = () => {\n if (this.isExpanded) this.collapse();\n else this.expand();\n };\n\n private _findToggle(): HTMLButtonElement | null {\n const first = this.el.querySelector(':scope > button:not(.button, [popovertarget])');\n return first instanceof HTMLButtonElement ? first : null;\n }\n\n private _isCompact() {\n return this._mql.matches;\n }\n\n private _isModal() {\n return this.el.classList.contains('modal') || this._isCompact();\n }\n\n private _sync() {\n this.el.setAttribute('aria-expanded', this.isExpanded ? 'true' : 'false');\n this._toggle?.setAttribute('aria-expanded', this.isExpanded ? 'true' : 'false');\n }\n\n /** The side panel of the enabled destination around `target`, if any. */\n private _panelAt(target: EventTarget | null): HTMLElement | null {\n const trigger = target instanceof Element ? target.closest('button[popovertarget]:enabled') : null;\n const panel = (trigger as HTMLButtonElement | null)?.popoverTargetElement;\n return panel?.classList.contains('navigation-rail-panel') ? (panel as HTMLElement) : null;\n }\n\n // Looks the panel up again because the trigger can be disabled during the delay.\n private _hoverOpen(target: Element) {\n const panel = this._panelAt(target);\n if (!panel || panel.matches(':popover-open')) return;\n // `source` makes the trigger the panel's anchor and invoker, as a click would.\n (panel.showPopover as (options?: { source?: Element | null }) => void).call(panel, {\n source: target.closest('button[popovertarget]')\n });\n this._hoverPanel = panel;\n }\n\n // Closes the hover-opened panel after the delay, unless the pointer is still inside it.\n private _hoverClose(target: Element | null = null) {\n const panel = this._hoverPanel;\n if (!panel || panel.contains(target)) return;\n this._hoverTimer = setTimeout(() => {\n // Keyboard focus inside the panel keeps it open, as a click would.\n const root = this.el.getRootNode() as Document | ShadowRoot;\n if (panel.matches(':popover-open') && !panel.contains(root.activeElement)) panel.hidePopover();\n if (this._hoverPanel === panel) this._hoverPanel = null;\n }, HOVER_DELAY);\n }\n\n private _onPointerOver = (e: PointerEvent) => {\n if (e.pointerType !== 'mouse') return;\n clearTimeout(this._hoverTimer);\n const target = e.target as Element;\n const panel = this._panelAt(target);\n if (!panel) this._hoverClose(target);\n // Hovering the open panel's own trigger leaves it as it is.\n else if (panel !== this._hoverPanel) {\n this._hoverTimer = setTimeout(() => this._hoverOpen(target), HOVER_DELAY);\n }\n };\n\n // The panel is a descendant, so moving onto it does not leave the rail.\n private _onPointerLeave = (e: PointerEvent) => {\n if (e.pointerType !== 'mouse') return;\n clearTimeout(this._hoverTimer);\n this._hoverClose();\n };\n\n // Clicking a hover-opened panel's trigger keeps it open instead of toggling\n // it shut; either way the panel no longer follows the pointer.\n private _pinPanel(e: MouseEvent): boolean {\n const panel = this._panelAt(e.target);\n if (!panel) return false;\n clearTimeout(this._hoverTimer);\n if (panel === this._hoverPanel && panel.matches(':popover-open')) e.preventDefault();\n this._hoverPanel = null;\n return true;\n }\n\n private _onClick = (e: MouseEvent) => {\n const target = e.target;\n if (!(target instanceof Node) || this._pinPanel(e)) return;\n if (this._toggle?.contains(target)) {\n this.toggle();\n e.preventDefault();\n return;\n }\n if (this._isScrimClick(e) && this.isExpanded && this._isModal()) {\n this.collapse();\n }\n };\n\n // Escape closes an open side panel before the rail, and reports whether a\n // panel took the key. A hover-opened panel has no focus to return to, so\n // focus inside it goes back to its trigger.\n private _escapePanel(e: KeyboardEvent): boolean {\n // A pending hover would reopen a panel Escape just dismissed.\n clearTimeout(this._hoverTimer);\n this._hoverPanel = null;\n const panel = Array.from(this.el.querySelectorAll<HTMLElement>('.navigation-rail-panel')).find(\n (el) => el.matches(':popover-open')\n );\n if (!panel) return false;\n // A popover open inside the panel is on top; the browser closes it first.\n if (panel.querySelector(':popover-open')) return true;\n const root = this.el.getRootNode() as Document | ShadowRoot;\n const hadFocus = panel.contains(root.activeElement);\n panel.hidePopover();\n if (hadFocus) (panel.previousElementSibling as HTMLElement | null)?.focus();\n e.preventDefault();\n return true;\n }\n\n // The scrim is the rail's own ::before, so a click on blank space inside the\n // rail targets the rail just as a scrim click does. Only a click beside the\n // rail's box landed on the scrim; a modal rail spans the full height.\n private _isScrimClick(e: MouseEvent) {\n if (e.target !== this.el) return false;\n const { left, right } = this.el.getBoundingClientRect();\n return e.clientX < left || e.clientX > right;\n }\n\n private _onKeyDown = (e: KeyboardEvent) => {\n if (e.key !== 'Escape' || e.defaultPrevented || this._escapePanel(e)) return;\n if (this.isExpanded && this._isModal()) {\n const root = this.el.getRootNode() as Document | ShadowRoot;\n const restoreFocus = this.el.contains(root.activeElement);\n const focused = deepActiveElement(root);\n this.collapse();\n if (!this.isExpanded && restoreFocus && deepActiveElement(root) === focused) {\n this._toggle?.focus();\n }\n }\n };\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAsBA,IAAM,YAAmC;AAAA,EACvC,aAAa;AAAA,EACb,WAAW;AAAA,EACX,cAAc;AAAA,EACd,YAAY;AACd;AAEA,IAAM,UAAU;AAGhB,IAAM,cAAc;AASb,IAAM,iBAAN,cAA6B,UAAiC;AAAA,EAOnE,YAAY,IAAiB,SAAyC;AACpE,UAAM,IAAI,OAAO;AAJnB,SAAQ,cAAkC;AA+B1C;AAAA;AAAA;AAAA,kBAAS,MAAM;AACb,UAAI,KAAK,WAAY;AACrB,UAAI,CAAC,KAAK,QAAQ,QAAQ,KAAK,QAAQ,aAAa,EAAE,SAAS,MAAM,CAAC,KAAK,WAAW,CAAC,EAAG;AAC1F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