@expressivecss/expressive 0.15.0 → 0.16.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 +1502 -1
- package/README.md +9 -8
- package/dist/css/expressive.css +19247 -11923
- 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-2CS6TITK.mjs +219 -0
- package/dist/js/chunks/chunk-2CS6TITK.mjs.map +7 -0
- package/dist/js/chunks/chunk-2RLBDFH4.mjs +108 -0
- package/dist/js/chunks/chunk-2RLBDFH4.mjs.map +7 -0
- package/dist/js/chunks/chunk-3L3QIYLC.mjs +85 -0
- package/dist/js/chunks/chunk-3L3QIYLC.mjs.map +7 -0
- package/dist/js/chunks/chunk-4EWGD4V2.mjs +75 -0
- package/dist/js/chunks/chunk-4EWGD4V2.mjs.map +7 -0
- package/dist/js/chunks/chunk-4IKVPCSU.mjs +7 -0
- package/dist/js/chunks/chunk-4IKVPCSU.mjs.map +7 -0
- package/dist/js/chunks/chunk-4PIXLDNJ.mjs +127 -0
- package/dist/js/chunks/chunk-4PIXLDNJ.mjs.map +7 -0
- package/dist/js/chunks/{chunk-KVJAVDBC.mjs → chunk-4QUCNFSD.mjs} +64 -113
- package/dist/js/chunks/chunk-4QUCNFSD.mjs.map +7 -0
- package/dist/js/chunks/{chunk-UETTGDLI.mjs → chunk-4TRZ2AER.mjs} +35 -41
- package/dist/js/chunks/chunk-4TRZ2AER.mjs.map +7 -0
- package/dist/js/chunks/{chunk-C6CHEWYP.mjs → chunk-5KIHWJI2.mjs} +40 -26
- package/dist/js/chunks/chunk-5KIHWJI2.mjs.map +7 -0
- package/dist/js/chunks/{chunk-L27Q6ZMI.mjs → chunk-67ZPPKXS.mjs} +20 -33
- package/dist/js/chunks/chunk-67ZPPKXS.mjs.map +7 -0
- package/dist/js/chunks/{chunk-XAEAEHIX.mjs → chunk-6FSEUFVW.mjs} +39 -26
- package/dist/js/chunks/chunk-6FSEUFVW.mjs.map +7 -0
- package/dist/js/chunks/chunk-752ADW4M.mjs +225 -0
- package/dist/js/chunks/chunk-752ADW4M.mjs.map +7 -0
- package/dist/js/chunks/{chunk-CK2XCICY.mjs → chunk-75E5EDJF.mjs} +3 -11
- package/dist/js/chunks/chunk-75E5EDJF.mjs.map +7 -0
- package/dist/js/chunks/{chunk-KHXZ2A4K.mjs → chunk-7NLUI3RR.mjs} +139 -66
- package/dist/js/chunks/chunk-7NLUI3RR.mjs.map +7 -0
- package/dist/js/chunks/chunk-7W7TV6NY.mjs +108 -0
- package/dist/js/chunks/chunk-7W7TV6NY.mjs.map +7 -0
- package/dist/js/chunks/chunk-7YQBHTK3.mjs +225 -0
- package/dist/js/chunks/chunk-7YQBHTK3.mjs.map +7 -0
- package/dist/js/chunks/chunk-7YZ5CN3V.mjs +33 -0
- package/dist/js/chunks/chunk-7YZ5CN3V.mjs.map +7 -0
- package/dist/js/chunks/chunk-AI73GJKG.mjs +28 -0
- package/dist/js/chunks/chunk-AI73GJKG.mjs.map +7 -0
- package/dist/js/chunks/{chunk-LQWUDNHZ.mjs → chunk-ANKFWNWT.mjs} +21 -45
- package/dist/js/chunks/chunk-ANKFWNWT.mjs.map +7 -0
- package/dist/js/chunks/{chunk-5CEAOLUA.mjs → chunk-B7DQFHA5.mjs} +30 -47
- package/dist/js/chunks/chunk-B7DQFHA5.mjs.map +7 -0
- package/dist/js/chunks/chunk-BIGU5RCJ.mjs +153 -0
- package/dist/js/chunks/chunk-BIGU5RCJ.mjs.map +7 -0
- package/dist/js/chunks/{chunk-VGNYF6FB.mjs → chunk-BPF3I2MN.mjs} +109 -24
- package/dist/js/chunks/chunk-BPF3I2MN.mjs.map +7 -0
- package/dist/js/chunks/chunk-CMGXGYUC.mjs +74 -0
- package/dist/js/chunks/chunk-CMGXGYUC.mjs.map +7 -0
- package/dist/js/chunks/{chunk-NUHMOAOY.mjs → chunk-CSYWKEK3.mjs} +310 -196
- package/dist/js/chunks/chunk-CSYWKEK3.mjs.map +7 -0
- package/dist/js/chunks/chunk-CZSQHXEV.mjs +227 -0
- package/dist/js/chunks/chunk-CZSQHXEV.mjs.map +7 -0
- package/dist/js/chunks/chunk-DZYVU75J.mjs +121 -0
- package/dist/js/chunks/chunk-DZYVU75J.mjs.map +7 -0
- package/dist/js/chunks/{chunk-74MXKKLN.mjs → chunk-EC26RU2D.mjs} +11 -29
- package/dist/js/chunks/chunk-EC26RU2D.mjs.map +7 -0
- package/dist/js/chunks/{chunk-WDK4T63U.mjs → chunk-EVCVFEV3.mjs} +235 -146
- package/dist/js/chunks/chunk-EVCVFEV3.mjs.map +7 -0
- package/dist/js/chunks/chunk-FCNF4GRJ.mjs +445 -0
- package/dist/js/chunks/chunk-FCNF4GRJ.mjs.map +7 -0
- package/dist/js/chunks/chunk-GCWWEZKO.mjs +342 -0
- package/dist/js/chunks/chunk-GCWWEZKO.mjs.map +7 -0
- package/dist/js/chunks/chunk-GNRSYMVH.mjs +1 -0
- package/dist/js/chunks/chunk-GVZQH2H5.mjs +54 -0
- package/dist/js/chunks/chunk-GVZQH2H5.mjs.map +7 -0
- package/dist/js/chunks/chunk-GWZ76SR4.mjs +435 -0
- package/dist/js/chunks/chunk-GWZ76SR4.mjs.map +7 -0
- package/dist/js/chunks/{chunk-PDG64UHF.mjs → chunk-ILDRRG7T.mjs} +21 -23
- package/dist/js/chunks/chunk-ILDRRG7T.mjs.map +7 -0
- package/dist/js/chunks/chunk-INLZWHLY.mjs +80 -0
- package/dist/js/chunks/chunk-INLZWHLY.mjs.map +7 -0
- package/dist/js/chunks/chunk-JUKBBN6P.mjs +175 -0
- package/dist/js/chunks/chunk-JUKBBN6P.mjs.map +7 -0
- package/dist/js/chunks/chunk-KYIEG4U3.mjs +730 -0
- package/dist/js/chunks/chunk-KYIEG4U3.mjs.map +7 -0
- package/dist/js/chunks/{chunk-BGZLF6JZ.mjs → chunk-KZPSAXIU.mjs} +142 -32
- package/dist/js/chunks/chunk-KZPSAXIU.mjs.map +7 -0
- package/dist/js/chunks/chunk-LDXCC2L3.mjs +438 -0
- package/dist/js/chunks/chunk-LDXCC2L3.mjs.map +7 -0
- package/dist/js/chunks/chunk-NAC72P7R.mjs +137 -0
- package/dist/js/chunks/chunk-NAC72P7R.mjs.map +7 -0
- package/dist/js/chunks/chunk-NBJAUGPP.mjs +244 -0
- package/dist/js/chunks/chunk-NBJAUGPP.mjs.map +7 -0
- package/dist/js/chunks/chunk-NNHVANQA.mjs +113 -0
- package/dist/js/chunks/chunk-NNHVANQA.mjs.map +7 -0
- package/dist/js/chunks/chunk-NVQ5EHCU.mjs +376 -0
- package/dist/js/chunks/chunk-NVQ5EHCU.mjs.map +7 -0
- package/dist/js/chunks/{chunk-DXGRXYYL.mjs → chunk-OP43LLIC.mjs} +28 -45
- package/dist/js/chunks/chunk-OP43LLIC.mjs.map +7 -0
- package/dist/js/chunks/chunk-OUCHKSAW.mjs +63 -0
- package/dist/js/chunks/chunk-OUCHKSAW.mjs.map +7 -0
- package/dist/js/chunks/{chunk-TSZYSW7F.mjs → chunk-OYNUDOHR.mjs} +19 -47
- package/dist/js/chunks/chunk-OYNUDOHR.mjs.map +7 -0
- package/dist/js/chunks/{chunk-UAZSDUVP.mjs → chunk-P6DRQ6KS.mjs} +36 -30
- package/dist/js/chunks/chunk-P6DRQ6KS.mjs.map +7 -0
- package/dist/js/chunks/chunk-PA7NU5AK.mjs +99 -0
- package/dist/js/chunks/chunk-PA7NU5AK.mjs.map +7 -0
- package/dist/js/chunks/chunk-QACZ6TUP.mjs +224 -0
- package/dist/js/chunks/chunk-QACZ6TUP.mjs.map +7 -0
- package/dist/js/chunks/{chunk-GJL6GCIU.mjs → chunk-QXKWVHBD.mjs} +265 -161
- package/dist/js/chunks/chunk-QXKWVHBD.mjs.map +7 -0
- package/dist/js/chunks/{chunk-X4ISMKE2.mjs → chunk-ROH2HDB4.mjs} +7 -6
- package/dist/js/chunks/chunk-ROH2HDB4.mjs.map +7 -0
- package/dist/js/chunks/chunk-S23RJ3XY.mjs +86 -0
- package/dist/js/chunks/chunk-S23RJ3XY.mjs.map +7 -0
- package/dist/js/chunks/{chunk-SMY7GJSS.mjs → chunk-SPPHF7YZ.mjs} +36 -29
- package/dist/js/chunks/chunk-SPPHF7YZ.mjs.map +7 -0
- package/dist/js/chunks/chunk-T3BNSRP3.mjs +152 -0
- package/dist/js/chunks/chunk-T3BNSRP3.mjs.map +7 -0
- package/dist/js/chunks/chunk-TFABTUAZ.mjs +108 -0
- package/dist/js/chunks/chunk-TFABTUAZ.mjs.map +7 -0
- package/dist/js/chunks/chunk-U4B3VHFS.mjs +507 -0
- package/dist/js/chunks/chunk-U4B3VHFS.mjs.map +7 -0
- package/dist/js/chunks/chunk-UGJHCHXG.mjs +341 -0
- package/dist/js/chunks/chunk-UGJHCHXG.mjs.map +7 -0
- package/dist/js/chunks/chunk-VFV75DHF.mjs +70 -0
- package/dist/js/chunks/chunk-VFV75DHF.mjs.map +7 -0
- package/dist/js/chunks/{chunk-ZX6M7SWO.mjs → chunk-VGY4M57S.mjs} +266 -120
- package/dist/js/chunks/chunk-VGY4M57S.mjs.map +7 -0
- package/dist/js/chunks/chunk-VH4BMAZS.mjs +167 -0
- package/dist/js/chunks/chunk-VH4BMAZS.mjs.map +7 -0
- package/dist/js/chunks/chunk-VJVQIXHC.mjs +123 -0
- package/dist/js/chunks/chunk-VJVQIXHC.mjs.map +7 -0
- package/dist/js/chunks/{chunk-SFI2U4YW.mjs → chunk-VMY55K2X.mjs} +76 -109
- package/dist/js/chunks/chunk-VMY55K2X.mjs.map +7 -0
- package/dist/js/chunks/{chunk-KUFHW3DS.mjs → chunk-VR3L2WN5.mjs} +11 -17
- package/dist/js/chunks/chunk-VR3L2WN5.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-WU7XJ4RR.mjs +450 -0
- package/dist/js/chunks/chunk-WU7XJ4RR.mjs.map +7 -0
- package/dist/js/chunks/chunk-X7SDA2J5.mjs +116 -0
- package/dist/js/chunks/chunk-X7SDA2J5.mjs.map +7 -0
- package/dist/js/chunks/chunk-Y6H2X7ZC.mjs +209 -0
- package/dist/js/chunks/chunk-Y6H2X7ZC.mjs.map +7 -0
- package/dist/js/chunks/chunk-Y6TLRA3U.mjs +129 -0
- package/dist/js/chunks/chunk-Y6TLRA3U.mjs.map +7 -0
- package/dist/js/chunks/chunk-Z4GICXR2.mjs +190 -0
- package/dist/js/chunks/chunk-Z4GICXR2.mjs.map +7 -0
- package/dist/js/chunks/chunk-Z4OARDZ7.mjs +442 -0
- package/dist/js/chunks/chunk-Z4OARDZ7.mjs.map +7 -0
- package/dist/js/chunks/{chunk-FM5CZOUB.mjs → chunk-ZJNLAGY5.mjs} +19 -30
- package/dist/js/chunks/chunk-ZJNLAGY5.mjs.map +7 -0
- package/dist/js/chunks/chunk-ZKWUWBUB.mjs +81 -0
- package/dist/js/chunks/chunk-ZKWUWBUB.mjs.map +7 -0
- package/dist/js/chunks/chunk-ZM3XBHWV.mjs +746 -0
- package/dist/js/chunks/chunk-ZM3XBHWV.mjs.map +7 -0
- package/dist/js/chunks/chunk-ZO6ZLHFF.mjs +48 -0
- package/dist/js/chunks/chunk-ZO6ZLHFF.mjs.map +7 -0
- package/dist/js/chunks/chunk-ZVLOUDIJ.mjs +251 -0
- package/dist/js/chunks/chunk-ZVLOUDIJ.mjs.map +7 -0
- package/dist/js/expressive.cjs +10613 -4327
- package/dist/js/expressive.cjs.map +4 -4
- package/dist/js/expressive.js +10613 -4327
- 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 +182 -71
- 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 +10 -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 +4 -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 +6 -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 +11 -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 -66
- 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 +25 -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 +59 -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 +4 -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 +13 -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 +2 -1
- package/dist/js/internal/core/formControl.mjs +12 -0
- package/dist/js/internal/core/formControl.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 +11 -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 +173 -71
- package/dist/types/behaviors/bottomSheets.d.ts +19 -3
- package/dist/types/behaviors/copy.d.ts +18 -0
- package/dist/types/behaviors/dataTables.d.ts +129 -0
- package/dist/types/behaviors/dialogs.d.ts +27 -1
- package/dist/types/behaviors/forms.d.ts +68 -2
- package/dist/types/behaviors/imageCompare.d.ts +12 -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 +51 -0
- package/dist/types/components/appBar.d.ts +5 -6
- package/dist/types/components/autocomplete.d.ts +91 -17
- 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 +9 -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 +65 -19
- package/dist/types/components/colorPicker.d.ts +42 -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 +59 -0
- package/dist/types/components/datepicker.d.ts +56 -32
- package/dist/types/components/expandingCard.d.ts +4 -6
- package/dist/types/components/funnelChart.d.ts +38 -0
- package/dist/types/components/heatmapChart.d.ts +39 -8
- package/dist/types/components/hoverCard.d.ts +58 -0
- package/dist/types/components/index.d.ts +16 -1
- package/dist/types/components/inputMask.d.ts +30 -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 +172 -10
- package/dist/types/components/loadingOverlay.d.ts +42 -0
- package/dist/types/components/mapView.d.ts +26 -17
- package/dist/types/components/menu.d.ts +60 -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 +8 -4
- package/dist/types/components/pieChart.d.ts +32 -7
- 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 +6 -14
- 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 +43 -30
- package/dist/types/components/showMore.d.ts +51 -0
- package/dist/types/components/slider.d.ts +3 -15
- package/dist/types/components/snackbar.d.ts +61 -0
- package/dist/types/components/swipeActions.d.ts +81 -0
- package/dist/types/components/tabs.d.ts +89 -27
- package/dist/types/components/timepicker.d.ts +113 -21
- package/dist/types/components/tooltip.d.ts +56 -20
- 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 +43 -25
- package/dist/types/core/formControl.d.ts +21 -0
- package/dist/types/core/spring.d.ts +20 -0
- package/dist/types/core/utils.d.ts +85 -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 +32 -0
- package/package.json +10 -8
- 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 +422 -36
- package/src/sass/abstracts/_spring.scss +63 -0
- package/src/sass/abstracts/_variables.scss +39 -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 +9 -16
- package/src/sass/components/_alert.scss +102 -0
- package/src/sass/components/_aura.scss +8 -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 +41 -19
- package/src/sass/components/_bottom-sheet.scss +44 -16
- package/src/sass/components/_breadcrumb.scss +8 -1
- package/src/sass/components/_button-groups.scss +15 -25
- package/src/sass/components/_buttons.scss +156 -63
- package/src/sass/components/_calendar.scss +246 -0
- package/src/sass/components/_cards.scss +36 -44
- package/src/sass/components/_carousel.scss +27 -103
- package/src/sass/components/_cascader.scss +142 -0
- package/src/sass/components/_chips.scss +36 -46
- package/src/sass/components/_column-chart.scss +19 -12
- package/src/sass/components/_command-palette.scss +4 -7
- package/src/sass/components/_confetti.scss +0 -2
- package/src/sass/components/_countdown.scss +1 -1
- package/src/sass/components/_data-table.scss +162 -25
- package/src/sass/components/_datepicker.scss +54 -40
- package/src/sass/components/_description-list.scss +85 -0
- package/src/sass/components/_dialog.scss +42 -41
- 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 +20 -9
- package/src/sass/components/_fab-menu.scss +44 -32
- package/src/sass/components/_funnel-chart.scss +124 -0
- package/src/sass/components/_heatmap-chart.scss +111 -22
- package/src/sass/components/_icon-buttons.scss +7 -7
- 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 +16 -2
- 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 +33 -11
- package/src/sass/components/_marquee.scss +3 -2
- package/src/sass/components/_mega-menu.scss +137 -0
- package/src/sass/components/_menu.scss +143 -123
- package/src/sass/components/_menubar.scss +59 -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 +37 -9
- package/src/sass/components/_modal-display.scss +21 -0
- package/src/sass/components/_navbar.scss +34 -20
- package/src/sass/components/_navigation-bar.scss +15 -77
- package/src/sass/components/_navigation-rail.scss +151 -92
- package/src/sass/components/_org-chart.scss +192 -0
- package/src/sass/components/_page-footer.scss +1 -1
- package/src/sass/components/_pagination.scss +6 -13
- package/src/sass/components/_panes.scss +32 -26
- package/src/sass/components/_particles.scss +0 -2
- package/src/sass/components/_pie-chart.scss +91 -11
- package/src/sass/components/_popover.scss +18 -5
- package/src/sass/components/_progress.scss +152 -31
- 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 +38 -10
- package/src/sass/components/_radial-chart.scss +113 -5
- package/src/sass/components/_rich-text-editor.scss +2 -2
- package/src/sass/components/_sankey-chart.scss +114 -0
- package/src/sass/components/_scatter-chart.scss +153 -0
- package/src/sass/components/_scrim.scss +0 -2
- package/src/sass/components/_scrollspy.scss +0 -2
- package/src/sass/components/_search.scss +26 -22
- package/src/sass/components/_show-more.scss +8 -0
- package/src/sass/components/_side-sheet.scss +23 -37
- package/src/sass/components/_skeleton.scss +2 -4
- package/src/sass/components/_snackbar.scss +27 -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/_tabs.scss +51 -32
- package/src/sass/components/_timeline.scss +12 -12
- package/src/sass/components/_timepicker.scss +109 -78
- package/src/sass/components/_toolbar.scss +35 -43
- package/src/sass/components/_tooltip.scss +21 -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 +3 -16
- package/src/sass/components/_treemap-chart.scss +122 -0
- package/src/sass/components/forms/_checkboxes.scss +106 -24
- 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 +15 -9
- package/src/sass/components/forms/_fieldset.scss +7 -7
- package/src/sass/components/forms/_file-input.scss +6 -8
- package/src/sass/components/forms/_index.scss +3 -1
- package/src/sass/components/forms/_input-fields.scss +254 -90
- package/src/sass/components/forms/_radio-buttons.scss +33 -94
- package/src/sass/components/forms/_rating.scss +2 -32
- package/src/sass/components/forms/_select.scss +199 -20
- package/src/sass/components/forms/_slider.scss +91 -94
- package/src/sass/components/forms/_switches.scss +53 -164
- 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 +183 -26
- 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 +47 -76
- 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.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
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Utils
|
|
3
|
-
} from "./chunk-M372EDXD.mjs";
|
|
4
1
|
import {
|
|
5
2
|
Component
|
|
6
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CMGXGYUC.mjs";
|
|
4
|
+
import {
|
|
5
|
+
Utils
|
|
6
|
+
} from "./chunk-ZVLOUDIJ.mjs";
|
|
7
7
|
|
|
8
8
|
// src/ts/components/slider.ts
|
|
9
9
|
var _defaults = {};
|
|
10
10
|
var _authored = /* @__PURE__ */ new WeakMap();
|
|
11
|
-
var
|
|
11
|
+
var _Slider = class _Slider extends Component {
|
|
12
12
|
constructor(el, options) {
|
|
13
|
-
super(el, options
|
|
13
|
+
super(el, options);
|
|
14
14
|
this._resizeObserver = null;
|
|
15
|
+
// The reset event fires before the browser restores the values.
|
|
16
|
+
this._handleFormReset = () => {
|
|
17
|
+
setTimeout(() => {
|
|
18
|
+
if (_Slider.getInstance(this.el) === this) this._sync();
|
|
19
|
+
});
|
|
20
|
+
};
|
|
15
21
|
this._handleRangeChange = () => {
|
|
16
22
|
this._clampDual();
|
|
17
23
|
this._sync();
|
|
@@ -41,39 +47,21 @@ var Slider = class _Slider extends Component {
|
|
|
41
47
|
this.thumb.classList.remove("active");
|
|
42
48
|
}
|
|
43
49
|
};
|
|
44
|
-
this.el["Expressive_Slider"] = this;
|
|
45
|
-
this.options = {
|
|
46
|
-
..._Slider.defaults,
|
|
47
|
-
...options
|
|
48
|
-
};
|
|
49
50
|
this._pointerDown = false;
|
|
50
51
|
this._setupThumb();
|
|
51
52
|
this._sync();
|
|
52
53
|
this._setupEventHandlers();
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
54
|
+
this._resizeObserver = new ResizeObserver(() => this._sync());
|
|
55
|
+
this._resizeObserver.observe(this.el);
|
|
56
|
+
if (this.el.parentElement) this._resizeObserver.observe(this.el.parentElement);
|
|
57
57
|
}
|
|
58
58
|
static get defaults() {
|
|
59
59
|
return _defaults;
|
|
60
60
|
}
|
|
61
|
-
/**
|
|
62
|
-
* Initializes instances of Slider.
|
|
63
|
-
* @param els HTML elements.
|
|
64
|
-
* @param options Component options.
|
|
65
|
-
*/
|
|
66
|
-
static init(els, options = {}) {
|
|
67
|
-
return super.init(els, options, _Slider);
|
|
68
|
-
}
|
|
69
|
-
static getInstance(el) {
|
|
70
|
-
return el["Expressive_Slider"];
|
|
71
|
-
}
|
|
72
61
|
destroy() {
|
|
73
62
|
this._resizeObserver?.disconnect();
|
|
74
|
-
this._removeEventHandlers();
|
|
75
63
|
this._removeThumb();
|
|
76
|
-
|
|
64
|
+
super.destroy();
|
|
77
65
|
const host = this._host();
|
|
78
66
|
for (const el of [this.el, host]) {
|
|
79
67
|
for (const name in _authored.get(el)) el.style.setProperty(name, _authored.get(el)[name]);
|
|
@@ -91,22 +79,15 @@ var Slider = class _Slider extends Component {
|
|
|
91
79
|
// twice - once for mouse, once for touch. One of the touch spellings,
|
|
92
80
|
// `touchleave`, was never implemented by any browser at all.
|
|
93
81
|
_setupEventHandlers() {
|
|
94
|
-
|
|
95
|
-
this.el.addEventListener("
|
|
96
|
-
this.el.addEventListener("
|
|
97
|
-
this.el.addEventListener("
|
|
98
|
-
this.el.addEventListener("
|
|
99
|
-
this.el.addEventListener("
|
|
100
|
-
this.el.addEventListener("
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
this.el.removeEventListener("change", this._handleRangeChange);
|
|
104
|
-
this.el.removeEventListener("pointerdown", this._handleRangePointerDown);
|
|
105
|
-
this.el.removeEventListener("input", this._handleRangeInput);
|
|
106
|
-
this.el.removeEventListener("pointerup", this._handleRangePointerUp);
|
|
107
|
-
this.el.removeEventListener("pointercancel", this._handleRangePointerUp);
|
|
108
|
-
this.el.removeEventListener("blur", this._handleRangeRelease);
|
|
109
|
-
this.el.removeEventListener("mouseout", this._handleRangeRelease);
|
|
82
|
+
const { signal } = this._events;
|
|
83
|
+
this.el.addEventListener("change", this._handleRangeChange, { signal });
|
|
84
|
+
this.el.addEventListener("pointerdown", this._handleRangePointerDown, { signal });
|
|
85
|
+
this.el.addEventListener("input", this._handleRangeInput, { signal });
|
|
86
|
+
this.el.addEventListener("pointerup", this._handleRangePointerUp, { signal });
|
|
87
|
+
this.el.addEventListener("pointercancel", this._handleRangePointerUp, { signal });
|
|
88
|
+
this.el.addEventListener("blur", this._handleRangeRelease, { signal });
|
|
89
|
+
this.el.addEventListener("mouseout", this._handleRangeRelease, { signal });
|
|
90
|
+
this.el.form?.addEventListener("reset", this._handleFormReset, { signal });
|
|
110
91
|
}
|
|
111
92
|
_setupThumb() {
|
|
112
93
|
this.thumb = document.createElement("span");
|
|
@@ -123,7 +104,7 @@ var Slider = class _Slider extends Component {
|
|
|
123
104
|
return !!this.el.closest(".vertical");
|
|
124
105
|
}
|
|
125
106
|
_host() {
|
|
126
|
-
return this.el.closest(".slider,
|
|
107
|
+
return this.el.closest(".slider, label");
|
|
127
108
|
}
|
|
128
109
|
_clampDual() {
|
|
129
110
|
const host = this._host();
|
|
@@ -193,12 +174,14 @@ var Slider = class _Slider extends Component {
|
|
|
193
174
|
*/
|
|
194
175
|
static Init() {
|
|
195
176
|
Utils.onDocumentReady(() => {
|
|
196
|
-
_Slider.init(document.querySelectorAll("input[type=range]"));
|
|
177
|
+
_Slider.init(document.querySelectorAll("input[type=range]:not(.image-compare > input, .color-picker-hue)"));
|
|
197
178
|
});
|
|
198
179
|
}
|
|
199
180
|
};
|
|
181
|
+
_Slider.key = "Expressive_Slider";
|
|
182
|
+
var Slider = _Slider;
|
|
200
183
|
|
|
201
184
|
export {
|
|
202
185
|
Slider
|
|
203
186
|
};
|
|
204
|
-
//# sourceMappingURL=chunk-
|
|
187
|
+
//# sourceMappingURL=chunk-B7DQFHA5.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/ts/components/slider.ts"],
|
|
4
|
+
"sourcesContent": ["import { Component, BaseOptions } from '../core/component';\nimport { Utils } from '../core/utils';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface SliderOptions extends BaseOptions {}\n\nconst _defaults: SliderOptions = {};\n\n// Inline values _set() replaced, per element, so destroy() can put back what\n// an author wrote. Per element, not per instance: both handles of a range\n// write the same host properties.\nconst _authored = new WeakMap<HTMLElement, Record<string, string>>();\n\nexport class Slider extends Component<SliderOptions> {\n declare el: HTMLInputElement;\n private _pointerDown: boolean;\n private _resizeObserver: ResizeObserver | null = null;\n value: HTMLElement;\n thumb: HTMLElement;\n\n constructor(el: HTMLInputElement, options: Partial<SliderOptions>) {\n super(el, options);\n\n this._pointerDown = false;\n this._setupThumb();\n this._sync();\n this._setupEventHandlers();\n this._resizeObserver = new ResizeObserver(() => this._sync());\n this._resizeObserver.observe(this.el);\n // The bubble and stop row are placed from the input's offsets, which\n // move when the host resizes around an input that keeps its size.\n if (this.el.parentElement) this._resizeObserver.observe(this.el.parentElement);\n }\n\n static get defaults(): SliderOptions {\n return _defaults;\n }\n\n static key = 'Expressive_Slider';\n\n destroy() {\n this._resizeObserver?.disconnect();\n this._removeThumb();\n super.destroy();\n const host = this._host();\n for (const el of [this.el, host]) {\n for (const name in _authored.get(el)) el.style.setProperty(name, _authored.get(el)[name]);\n _authored.delete(el);\n }\n // The other handle of a range writes the shared host properties again.\n host?.querySelectorAll('input[type=\"range\"]').forEach((el) => el['Expressive_Slider']?._sync());\n }\n\n _set(el: HTMLElement, name: string, value: string) {\n const authored = _authored.get(el) ?? {};\n _authored.set(el, authored);\n authored[name] ??= el.style.getPropertyValue(name);\n el.style.setProperty(name, value);\n }\n\n // Eleven listeners used to cover four stages, because each one was written\n // twice - once for mouse, once for touch. One of the touch spellings,\n // `touchleave`, was never implemented by any browser at all.\n _setupEventHandlers() {\n const { signal } = this._events;\n this.el.addEventListener('change', this._handleRangeChange, { signal });\n this.el.addEventListener('pointerdown', this._handleRangePointerDown, { signal });\n // `input` alone tracks a drag. A `pointermove` sync used to run as well,\n // twice per frame, and before the browser had moved the value.\n this.el.addEventListener('input', this._handleRangeInput, { signal });\n this.el.addEventListener('pointerup', this._handleRangePointerUp, { signal });\n this.el.addEventListener('pointercancel', this._handleRangePointerUp, { signal });\n this.el.addEventListener('blur', this._handleRangeRelease, { signal });\n // `mouseout`, not `pointerout`: this used to be a `mouseout`/`touchleave`\n // pair, and `touchleave` was never implemented by any browser, so the\n // handler has only ever run for a mouse. `pointerout` also fires when a\n // touch lifts, which would clear the thumb's active state at a moment\n // nothing cleared it before.\n this.el.addEventListener('mouseout', this._handleRangeRelease, { signal });\n // A form reset restores the value without an input event.\n this.el.form?.addEventListener('reset', this._handleFormReset, { signal });\n }\n\n // The reset event fires before the browser restores the values.\n _handleFormReset = () => {\n setTimeout(() => {\n if (Slider.getInstance(this.el) === this) this._sync();\n });\n };\n\n _handleRangeChange = () => {\n this._clampDual();\n this._sync();\n this.thumb.classList.add('active');\n };\n\n _handleRangePointerDown = (e: PointerEvent) => {\n if (!e.isPrimary) return;\n if (e.pointerType === 'mouse' && e.button !== 0) return;\n this._pointerDown = true;\n this.el.classList.add('active');\n this._clampDual();\n this._sync();\n // An `e.type !== 'input'` guard used to sit here. This handler is only ever\n // bound to a press, so it was never anything but true.\n this.thumb.classList.add('active');\n };\n\n _handleRangeInput = () => {\n this._clampDual();\n this._sync();\n this.thumb.classList.add('active');\n };\n\n _handleRangePointerUp = (e: PointerEvent) => {\n if (!e.isPrimary) return;\n this._pointerDown = false;\n this.el.classList.remove('active');\n };\n\n _handleRangeRelease = () => {\n if (!this._pointerDown) {\n this.thumb.classList.remove('active');\n }\n };\n\n _setupThumb() {\n this.thumb = document.createElement('span');\n this.value = document.createElement('span');\n this.thumb.classList.add('thumb');\n this.value.classList.add('value');\n this.thumb.append(this.value);\n this.el.after(this.thumb);\n }\n\n _removeThumb() {\n this.thumb.remove();\n }\n\n _isVertical(): boolean {\n return !!this.el.closest('.vertical');\n }\n\n _host(): HTMLElement | null {\n // `.slider` is the documented host now; without it here a dual-handle\n // control could not find its wrapper, so the handles never clamped and the\n // shared start/end fractions never tracked the interval.\n return this.el.closest('.slider, label');\n }\n\n _clampDual() {\n const host = this._host();\n const peers = host?.querySelectorAll('input[type=\"range\"]');\n if (!peers || peers.length !== 2) return;\n const start = peers[0] as HTMLInputElement;\n const end = peers[1] as HTMLInputElement;\n if (this.el === start && +start.value > +end.value) start.value = end.value;\n if (this.el === end && +end.value < +start.value) end.value = start.value;\n }\n\n /** The input's range, defaulting like the browser does: 0 to 100. */\n private _bounds(el: HTMLInputElement) {\n const parsedMax = parseFloat(el.max);\n return { max: Number.isNaN(parsedMax) ? 100 : parsedMax, min: parseFloat(el.min) || 0 };\n }\n\n _fraction(el: HTMLInputElement): number {\n const { max, min } = this._bounds(el);\n const val = parseFloat(el.value) || 0;\n return max === min ? 0 : (val - min) / (max - min);\n }\n\n _sync() {\n const percent = this._fraction(this.el);\n const fraction = `${percent * 100}%`;\n\n // Read before writing. This runs on every pointer move during a drag, and\n // setting the custom property first made each of the four offset reads\n // below flush a fresh layout.\n const left = this.el.offsetLeft;\n const top = this.el.offsetTop;\n const width = this.el.offsetWidth;\n const height = this.el.offsetHeight;\n const style = getComputedStyle(this.el);\n const rtl = style.direction === 'rtl';\n const vertical = this._isVertical();\n const handle = parseFloat(style.getPropertyValue('--md-comp-slider-handle-width')) || 4;\n const length = vertical ? height : width;\n const position = handle / 2 + percent * (length - handle);\n\n this._set(this.el, '--md-comp-slider-active-fraction', fraction);\n this._set(this.el, '--md-comp-slider-active-position', `${position}px`);\n\n const host = this._host();\n const peers = host?.querySelectorAll('input[type=\"range\"]');\n if (host && peers && peers.length === 2) {\n const nums = Array.from(peers).map((el) => this._fraction(el as HTMLInputElement));\n this._set(host, '--md-comp-slider-start-fraction', `${Math.min(...nums) * 100}%`);\n this._set(host, '--md-comp-slider-end-fraction', `${Math.max(...nums) * 100}%`);\n this._set(host, '--md-comp-slider-start-position', `${handle / 2 + Math.min(...nums) * (length - handle)}px`);\n this._set(host, '--md-comp-slider-end-position', `${handle / 2 + Math.max(...nums) * (length - handle)}px`);\n }\n if (host?.classList.contains('stops')) {\n const { max, min } = this._bounds(this.el);\n const step = parseFloat(this.el.step);\n // Stops sit at min + k * step up to max, so a step that does not divide\n // the range ends short of max. No step, `any`, zero or a negative step\n // clears the spacing, and the host paints no dots.\n const stops = step > 0 && Number.isFinite(step) && max > min;\n this._set(host, '--md-comp-slider-stop-count', stops ? String(Math.floor((max - min) / step + 1e-9) + 1) : '');\n this._set(host, '--md-comp-slider-stop-spacing', stops ? `${((length - handle) * step) / (max - min)}px` : '');\n // The tick row is the host's ::after, which cannot read the input's\n // properties. A dual host has no single position.\n if (peers?.length === 1) {\n this._set(host, '--md-comp-slider-active-position', `${position}px`);\n this._set(host, '--md-comp-slider-track-center', `${top + height / 2}px`);\n }\n }\n\n this.value.textContent = this.el.value;\n if (vertical) {\n this.thumb.style.left = `${left + width / 2}px`;\n this.thumb.style.top = `${top + height - position}px`;\n } else {\n this.thumb.style.left = `${left + (rtl ? width - position : position)}px`;\n this.thumb.style.top = `${top}px`;\n }\n }\n\n /**\n * Initializes every range input in the current document.\n */\n static Init() {\n // Deferred like every other Init(): this ran at import time, so a bundle\n // loaded in <head> found no inputs at all.\n Utils.onDocumentReady(() => {\n // An image compare's range is invisible and drawn by its container; a\n // color picker's hue range paints its own track.\n Slider.init(document.querySelectorAll<HTMLInputElement>('input[type=range]:not(.image-compare > input, .color-picker-hue)'));\n });\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAMA,IAAM,YAA2B,CAAC;AAKlC,IAAM,YAAY,oBAAI,QAA6C;AAE5D,IAAM,UAAN,MAAM,gBAAe,UAAyB;AAAA,EAOnD,YAAY,IAAsB,SAAiC;AACjE,UAAM,IAAI,OAAO;AALnB,SAAQ,kBAAyC;AAoEjD;AAAA,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AQ,OAAO,KAAK,OAAO,MAAM,OAAO,OAAO,IAAI,IAAI,CAAC,IAAI,EAAE;AAC7G,WAAK,KAAK,MAAM,iCAAiC,QAAQ,IAAK,SAAS,UAAU,QAAS,MAAM,IAAI,OAAO,EAAE;AAG7G,UAAI,OAAO,WAAW,GAAG;AACvB,aAAK,KAAK,MAAM,oCAAoC,GAAG,QAAQ,IAAI;AACnE,aAAK,KAAK,MAAM,iCAAiC,GAAG,MAAM,SAAS,CAAC,IAAI;AAAA,MAC1E;AAAA,IACF;AAEA,SAAK,MAAM,cAAc,KAAK,GAAG;AACjC,QAAI,UAAU;AACZ,WAAK,MAAM,MAAM,OAAO,GAAG,OAAO,QAAQ,CAAC;AAC3C,WAAK,MAAM,MAAM,MAAM,GAAG,MAAM,SAAS,QAAQ;AAAA,IACnD,OAAO;AACL,WAAK,MAAM,MAAM,OAAO,GAAG,QAAQ,MAAM,QAAQ,WAAW,SAAS;AACrE,WAAK,MAAM,MAAM,MAAM,GAAG,GAAG;AAAA,IAC/B;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,OAAO;AAGZ,UAAM,gBAAgB,MAAM;AAG1B,cAAO,KAAK,SAAS,iBAAmC,kEAAkE,CAAC;AAAA,IAC7H,CAAC;AAAA,EACH;AACF;AApOa,QAyBJ,MAAM;AAzBR,IAAM,SAAN;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Component
|
|
3
|
+
} from "./chunk-CMGXGYUC.mjs";
|
|
4
|
+
import {
|
|
5
|
+
Utils
|
|
6
|
+
} from "./chunk-ZVLOUDIJ.mjs";
|
|
7
|
+
|
|
8
|
+
// src/ts/components/hoverCard.ts
|
|
9
|
+
var _defaults = {
|
|
10
|
+
enterDelay: 500,
|
|
11
|
+
exitDelay: 300
|
|
12
|
+
};
|
|
13
|
+
var owners = /* @__PURE__ */ new WeakMap();
|
|
14
|
+
var HoverCard = class extends Component {
|
|
15
|
+
constructor(el, options) {
|
|
16
|
+
super(el, options);
|
|
17
|
+
/** Whether the instance has the card showing. */
|
|
18
|
+
this._shown = false;
|
|
19
|
+
/** What keeps the card wanted: the pointer, keyboard focus, or both. */
|
|
20
|
+
this._holds = /* @__PURE__ */ new Set();
|
|
21
|
+
/** The anchor name the card is placed against while this link shows it. */
|
|
22
|
+
this._anchorName = `--hover-card-${Utils.guid()}`;
|
|
23
|
+
/**
|
|
24
|
+
* Show the card now, without enterDelay.
|
|
25
|
+
*/
|
|
26
|
+
this.open = () => {
|
|
27
|
+
clearTimeout(this._timeout);
|
|
28
|
+
if (!this.cardEl || this._shown) return;
|
|
29
|
+
owners.get(this.cardEl)?.close();
|
|
30
|
+
this.cardEl.showPopover.call(this.cardEl, { source: this.el });
|
|
31
|
+
owners.set(this.cardEl, this);
|
|
32
|
+
this._shown = true;
|
|
33
|
+
this._listenForEscape(true);
|
|
34
|
+
this._anchor(true);
|
|
35
|
+
this._notify("open");
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Hide the card now, without exitDelay.
|
|
39
|
+
*/
|
|
40
|
+
this.close = () => {
|
|
41
|
+
clearTimeout(this._timeout);
|
|
42
|
+
if (!this._shown) return;
|
|
43
|
+
this.cardEl.hidePopover();
|
|
44
|
+
this._hidden();
|
|
45
|
+
this._notify("close");
|
|
46
|
+
};
|
|
47
|
+
// A touch is a tap that follows the link, never a hover; pointer events
|
|
48
|
+
// say so, and the mouse events a tap sends afterwards are not listened to.
|
|
49
|
+
this._handlePointerEnter = (e) => {
|
|
50
|
+
if (e.pointerType !== "touch") this._hold("pointer");
|
|
51
|
+
};
|
|
52
|
+
this._handlePointerLeave = (e) => {
|
|
53
|
+
if (e.pointerType !== "touch") this._release("pointer");
|
|
54
|
+
};
|
|
55
|
+
// A pointer press also focuses the link, and the hover already covers it,
|
|
56
|
+
// so only keyboard focus holds the card from the link.
|
|
57
|
+
this._handleLinkFocus = () => {
|
|
58
|
+
if (this.el.matches(":focus-visible")) this._hold("focus");
|
|
59
|
+
};
|
|
60
|
+
this._handleCardFocus = () => this._hold("focus");
|
|
61
|
+
this._handleFocusOut = (e) => {
|
|
62
|
+
const next = e.relatedTarget;
|
|
63
|
+
if (!next || !(this.el.contains(next) || this.cardEl.contains(next))) this._release("focus");
|
|
64
|
+
};
|
|
65
|
+
// Escape always hides the card, but it is only the card's key when focus is
|
|
66
|
+
// on the link or in the card; otherwise it still reaches the dialog or menu
|
|
67
|
+
// that has focus. An engine that does not know popover="hint" treats the
|
|
68
|
+
// card as manual, which Escape would not close.
|
|
69
|
+
this._handleKeydown = (e) => {
|
|
70
|
+
if (e.key !== "Escape" || Utils.isComposing(e)) return;
|
|
71
|
+
if (Utils.focusIsIn(this.el, this.cardEl)) this._takeEscape(e);
|
|
72
|
+
this.close();
|
|
73
|
+
};
|
|
74
|
+
this._handleToggle = (e) => {
|
|
75
|
+
if (e.newState !== "closed" || !this._shown) return;
|
|
76
|
+
this._hidden();
|
|
77
|
+
this._notify("close");
|
|
78
|
+
};
|
|
79
|
+
this.cardEl = Utils.getElementById(el, el.getAttribute("aria-details") ?? "");
|
|
80
|
+
if (!this.cardEl) {
|
|
81
|
+
console.error(`HoverCard: aria-details names no element; the link shows no card.`);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const { signal } = this._events;
|
|
85
|
+
this.cardEl.addEventListener("toggle", this._handleToggle, { signal });
|
|
86
|
+
for (const target of [this.el, this.cardEl]) {
|
|
87
|
+
target.addEventListener("pointerenter", this._handlePointerEnter, { signal });
|
|
88
|
+
target.addEventListener("pointerleave", this._handlePointerLeave, { signal });
|
|
89
|
+
target.addEventListener("focusout", this._handleFocusOut, { signal });
|
|
90
|
+
}
|
|
91
|
+
this.el.addEventListener("focus", this._handleLinkFocus, { signal });
|
|
92
|
+
this.cardEl.addEventListener("focusin", this._handleCardFocus, { signal });
|
|
93
|
+
}
|
|
94
|
+
static get defaults() {
|
|
95
|
+
return _defaults;
|
|
96
|
+
}
|
|
97
|
+
destroy() {
|
|
98
|
+
clearTimeout(this._timeout);
|
|
99
|
+
if (this._shown) {
|
|
100
|
+
this.cardEl.hidePopover();
|
|
101
|
+
this._hidden();
|
|
102
|
+
}
|
|
103
|
+
super.destroy();
|
|
104
|
+
}
|
|
105
|
+
_hidden() {
|
|
106
|
+
this._shown = false;
|
|
107
|
+
this._listenForEscape(false);
|
|
108
|
+
this._anchor(false);
|
|
109
|
+
}
|
|
110
|
+
// `source` anchors the card too, but Firefox keeps the first source's
|
|
111
|
+
// anchor for good, so a card two links share would stay at the first. A
|
|
112
|
+
// named anchor, set only while the card shows, follows the link that shows it.
|
|
113
|
+
_anchor(on) {
|
|
114
|
+
Utils.setAnchorName(this.el, this._anchorName, on);
|
|
115
|
+
if (on) this.cardEl.style.setProperty("position-anchor", this._anchorName);
|
|
116
|
+
else this.cardEl.style.removeProperty("position-anchor");
|
|
117
|
+
for (const el of [this.el, this.cardEl]) if (!el.getAttribute("style")) el.removeAttribute("style");
|
|
118
|
+
}
|
|
119
|
+
/** Wanted cards show after enterDelay; once nothing holds the card, it hides after exitDelay. */
|
|
120
|
+
_schedule() {
|
|
121
|
+
clearTimeout(this._timeout);
|
|
122
|
+
const wanted = this._holds.size > 0;
|
|
123
|
+
if (wanted === this._shown) return;
|
|
124
|
+
const [change, delay] = wanted ? [this.open, this.options.enterDelay] : [this.close, this.options.exitDelay];
|
|
125
|
+
this._timeout = setTimeout(change, delay);
|
|
126
|
+
}
|
|
127
|
+
_hold(by) {
|
|
128
|
+
this._holds.add(by);
|
|
129
|
+
this._schedule();
|
|
130
|
+
}
|
|
131
|
+
_release(by) {
|
|
132
|
+
this._holds.delete(by);
|
|
133
|
+
this._schedule();
|
|
134
|
+
}
|
|
135
|
+
/** Escape is listened for only while the card shows. close() removes it, and destroy() through the signal. */
|
|
136
|
+
_listenForEscape(on) {
|
|
137
|
+
const doc = this.el.ownerDocument;
|
|
138
|
+
if (on) doc.addEventListener("keydown", this._handleKeydown, { capture: true, signal: this._events.signal });
|
|
139
|
+
else doc.removeEventListener("keydown", this._handleKeydown, true);
|
|
140
|
+
}
|
|
141
|
+
/** Keeps Escape from the page and, when focus is in the card, takes it back to the link before the card hides. */
|
|
142
|
+
_takeEscape(e) {
|
|
143
|
+
e.preventDefault();
|
|
144
|
+
e.stopPropagation();
|
|
145
|
+
if (Utils.focusIsIn(this.cardEl)) this.el.focus();
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
HoverCard.key = "Expressive_HoverCard";
|
|
149
|
+
|
|
150
|
+
export {
|
|
151
|
+
HoverCard
|
|
152
|
+
};
|
|
153
|
+
//# sourceMappingURL=chunk-BIGU5RCJ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/ts/components/hoverCard.ts"],
|
|
4
|
+
"sourcesContent": ["import { Utils } from '../core/utils';\nimport { Component, BaseOptions } from '../core/component';\n\nexport interface HoverCardOptions extends BaseOptions {\n /**\n * How long the pointer or keyboard focus rests on the link before the card shows.\n * @default 500\n */\n enterDelay: number;\n /**\n * How long the card stays after the pointer and focus leave the link and the card.\n * @default 300\n */\n exitDelay: number;\n}\n\nconst _defaults: HoverCardOptions = {\n enterDelay: 500,\n exitDelay: 300\n};\n\n// Links can share one card, such as a name mentioned twice; the link that\n// last showed it owns it, and the next one takes it over.\nconst owners = new WeakMap<HTMLElement, HoverCard>();\n\n/**\n * Hover card. A `.hover-card-trigger` link names its card, a `.popover` with\n * `popover=\"hint\"`, in `aria-details`. The card shows against the link after\n * `enterDelay` and stays while the pointer or focus is on either.\n */\nexport class HoverCard extends Component<HoverCardOptions> {\n /** The card the link's `aria-details` names, or null when it names none. */\n cardEl: HTMLElement | null;\n /** Whether the instance has the card showing. */\n private _shown = false;\n /** What keeps the card wanted: the pointer, keyboard focus, or both. */\n private _holds = new Set<'pointer' | 'focus'>();\n private _timeout: ReturnType<typeof setTimeout>;\n /** The anchor name the card is placed against while this link shows it. */\n private _anchorName = `--hover-card-${Utils.guid()}`;\n\n constructor(el: HTMLElement, options: Partial<HoverCardOptions>) {\n super(el, options);\n this.cardEl = Utils.getElementById(el, el.getAttribute('aria-details') ?? '');\n if (!this.cardEl) {\n console.error(`HoverCard: aria-details names no element; the link shows no card.`);\n return;\n }\n // The browser hides a hint card itself on a click elsewhere, on Escape\n // and when another hint opens.\n const { signal } = this._events;\n this.cardEl.addEventListener('toggle', this._handleToggle, { signal });\n for (const target of [this.el, this.cardEl]) {\n target.addEventListener('pointerenter', this._handlePointerEnter, { signal });\n target.addEventListener('pointerleave', this._handlePointerLeave, { signal });\n target.addEventListener('focusout', this._handleFocusOut, { signal });\n }\n this.el.addEventListener('focus', this._handleLinkFocus, { signal });\n this.cardEl.addEventListener('focusin', this._handleCardFocus, { signal });\n }\n\n static get defaults(): HoverCardOptions {\n return _defaults;\n }\n\n static key = 'Expressive_HoverCard';\n\n destroy() {\n clearTimeout(this._timeout);\n if (this._shown) {\n this.cardEl.hidePopover();\n this._hidden();\n }\n super.destroy();\n }\n\n /**\n * Show the card now, without enterDelay.\n */\n open = () => {\n clearTimeout(this._timeout);\n if (!this.cardEl || this._shown) return;\n owners.get(this.cardEl)?.close();\n // `source` makes the link the card's anchor and invoker, so Tab moves from\n // the link into the card. It throws for a card without the popover\n // attribute, before any state changes.\n (this.cardEl.showPopover as (options?: { source?: Element }) => void).call(this.cardEl, { source: this.el });\n owners.set(this.cardEl, this);\n this._shown = true;\n this._listenForEscape(true);\n this._anchor(true);\n this._notify('open');\n };\n\n /**\n * Hide the card now, without exitDelay.\n */\n close = () => {\n clearTimeout(this._timeout);\n if (!this._shown) return;\n this.cardEl.hidePopover();\n this._hidden();\n this._notify('close');\n };\n\n private _hidden() {\n this._shown = false;\n this._listenForEscape(false);\n this._anchor(false);\n }\n\n // `source` anchors the card too, but Firefox keeps the first source's\n // anchor for good, so a card two links share would stay at the first. A\n // named anchor, set only while the card shows, follows the link that shows it.\n private _anchor(on: boolean) {\n Utils.setAnchorName(this.el, this._anchorName, on);\n if (on) this.cardEl.style.setProperty('position-anchor', this._anchorName);\n else this.cardEl.style.removeProperty('position-anchor');\n for (const el of [this.el, this.cardEl]) if (!el.getAttribute('style')) el.removeAttribute('style');\n }\n\n /** Wanted cards show after enterDelay; once nothing holds the card, it hides after exitDelay. */\n private _schedule() {\n clearTimeout(this._timeout);\n const wanted = this._holds.size > 0;\n if (wanted === this._shown) return;\n const [change, delay] = wanted ? [this.open, this.options.enterDelay] as const : [this.close, this.options.exitDelay] as const;\n this._timeout = setTimeout(change, delay);\n }\n\n private _hold(by: 'pointer' | 'focus') {\n this._holds.add(by);\n this._schedule();\n }\n\n private _release(by: 'pointer' | 'focus') {\n this._holds.delete(by);\n this._schedule();\n }\n\n // A touch is a tap that follows the link, never a hover; pointer events\n // say so, and the mouse events a tap sends afterwards are not listened to.\n private _handlePointerEnter = (e: PointerEvent) => {\n if (e.pointerType !== 'touch') this._hold('pointer');\n };\n\n private _handlePointerLeave = (e: PointerEvent) => {\n if (e.pointerType !== 'touch') this._release('pointer');\n };\n\n // A pointer press also focuses the link, and the hover already covers it,\n // so only keyboard focus holds the card from the link.\n private _handleLinkFocus = () => {\n if (this.el.matches(':focus-visible')) this._hold('focus');\n };\n\n private _handleCardFocus = () => this._hold('focus');\n\n private _handleFocusOut = (e: FocusEvent) => {\n const next = e.relatedTarget as Node | null;\n if (!next || !(this.el.contains(next) || this.cardEl.contains(next))) this._release('focus');\n };\n\n /** Escape is listened for only while the card shows. close() removes it, and destroy() through the signal. */\n private _listenForEscape(on: boolean) {\n const doc = this.el.ownerDocument;\n if (on) doc.addEventListener('keydown', this._handleKeydown, { capture: true, signal: this._events.signal });\n else doc.removeEventListener('keydown', this._handleKeydown, true);\n }\n\n // Escape always hides the card, but it is only the card's key when focus is\n // on the link or in the card; otherwise it still reaches the dialog or menu\n // that has focus. An engine that does not know popover=\"hint\" treats the\n // card as manual, which Escape would not close.\n private _handleKeydown = (e: KeyboardEvent) => {\n if (e.key !== 'Escape' || Utils.isComposing(e)) return;\n if (Utils.focusIsIn(this.el, this.cardEl)) this._takeEscape(e);\n this.close();\n };\n\n /** Keeps Escape from the page and, when focus is in the card, takes it back to the link before the card hides. */\n private _takeEscape(e: KeyboardEvent) {\n e.preventDefault();\n e.stopPropagation();\n if (Utils.focusIsIn(this.cardEl)) this.el.focus();\n }\n\n private _handleToggle = (e: Event) => {\n if ((e as ToggleEvent).newState !== 'closed' || !this._shown) return;\n this._hidden();\n this._notify('close');\n };\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAgBA,IAAM,YAA8B;AAAA,EAClC,YAAY;AAAA,EACZ,WAAW;AACb;AAIA,IAAM,SAAS,oBAAI,QAAgC;AAO5C,IAAM,YAAN,cAAwB,UAA4B;AAAA,EAWzD,YAAY,IAAiB,SAAoC;AAC/D,UAAM,IAAI,OAAO;AARnB;AAAA,SAAQ,SAAS;AAEjB;AAAA,SAAQ,SAAS,oBAAI,IAAyB;AAG9C;AAAA,SAAQ,cAAc,gBAAgB,MAAM,KAAK,CAAC;AAwClD;AAAA;AAAA;AAAA,gBAAO,MAAM;AACX,mBAAa,KAAK,QAAQ;AAC1B,UAAI,CAAC,KAAK,UAAU,KAAK,OAAQ;AACjC,aAAO,IAAI,KAAK,MAAM,GAAG,MAAM;AAI/B,MAAC,KAAK,OAAO,YAAyD,KAAK,KAAK,QAAQ,EAAE,QAAQ,KAAK,GAAG,CAAC;AAC3G,aAAO,IAAI,KAAK,QAAQ,IAAI;AAC5B,WAAK,SAAS;AACd,WAAK,iBAAiB,IAAI;AAC1B,WAAK,QAAQ,IAAI;AACjB,WAAK,QAAQ,MAAM;AAAA,IACrB;AAKA;AAAA;AAAA;AAAA,iBAAQ,MAAM;AACZ,mBAAa,KAAK,QAAQ;AAC1B,UAAI,CAAC,KAAK,OAAQ;AAClB,WAAK,OAAO,YAAY;AACxB,WAAK,QAAQ;AACb,WAAK,QAAQ,OAA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,KAAK;AAAA,EAC1C;AAAA,EAEQ,MAAM,IAAyB;AACrC,SAAK,OAAO,IAAI,EAAE;AAClB,SAAK,UAAU;AAAA,EACjB;AAAA,EAEQ,SAAS,IAAyB;AACxC,SAAK,OAAO,OAAO,EAAE;AACrB,SAAK,UAAU;AAAA,EACjB;AAAA;AAAA,EA0BQ,iBAAiB,IAAa;AACpC,UAAM,MAAM,KAAK,GAAG;AACpB,QAAI,GAAI,KAAI,iBAAiB,WAAW,KAAK,gBAAgB,EAAE,SAAS,MAAM,QAAQ,KAAK,QAAQ,OAAO,CAAC;AAAA,QACtG,KAAI,oBAAoB,WAAW,KAAK,gBAAgB,IAAI;AAAA,EACnE;AAAA;AAAA,EAaQ,YAAY,GAAkB;AACpC,MAAE,eAAe;AACjB,MAAE,gBAAgB;AAClB,QAAI,MAAM,UAAU,KAAK,MAAM,EAAG,MAAK,GAAG,MAAM;AAAA,EAClD;AAOF;AAlKa,UAmCJ,MAAM;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,30 +1,63 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LineChart
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZM3XBHWV.mjs";
|
|
4
4
|
|
|
5
5
|
// src/ts/components/heatmapChart.ts
|
|
6
|
+
function band(level, steps) {
|
|
7
|
+
return Math.sign(level) * Math.min(steps - 1, Math.floor(Math.abs(level) * steps)) / (steps - 1);
|
|
8
|
+
}
|
|
6
9
|
var HeatmapChart = class extends LineChart {
|
|
7
10
|
get _type() {
|
|
8
11
|
return "heatmap-chart";
|
|
9
12
|
}
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
/** Color carries the value, so there is no value axis. */
|
|
14
|
+
get _axis() {
|
|
15
|
+
return false;
|
|
12
16
|
}
|
|
13
|
-
|
|
14
|
-
return
|
|
17
|
+
get _count() {
|
|
18
|
+
return this.labels.length * this.series.length;
|
|
15
19
|
}
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
/** Redraws the grid, scrolled where it was. */
|
|
21
|
+
update() {
|
|
22
|
+
const left = this._scroll?.scrollLeft;
|
|
23
|
+
super.update();
|
|
24
|
+
if (this._scroll && left) this._scroll.scrollLeft = left;
|
|
18
25
|
}
|
|
19
26
|
/** Highlights one cell, numbered row by row. Pass -1 to hide the tooltip. */
|
|
20
27
|
show(index) {
|
|
21
28
|
if (!this._tooltip || index === this.activeIndex) return;
|
|
22
|
-
|
|
23
|
-
|
|
29
|
+
this._activate(this._cells[index], index);
|
|
30
|
+
}
|
|
31
|
+
_activate(cell, index) {
|
|
32
|
+
const box = cell ? this._box(cell) : null;
|
|
24
33
|
this._cells[this.activeIndex]?.classList.remove("active");
|
|
25
34
|
this.activeIndex = index;
|
|
26
|
-
this._tooltip.hidden = !
|
|
35
|
+
this._tooltip.hidden = !box;
|
|
36
|
+
if (box) this._fill(cell, index, box);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A cell's left, top and width in the plot, past any scrolling of the
|
|
40
|
+
* grid, and the plot's width. A key can move to a cell scrolled out of a
|
|
41
|
+
* wide grid, so it scrolls into view first.
|
|
42
|
+
*/
|
|
43
|
+
_box(cell) {
|
|
44
|
+
if (this._plot.matches(":focus-visible")) cell.scrollIntoView({ block: "nearest", inline: "nearest" });
|
|
45
|
+
return this._measure(cell);
|
|
46
|
+
}
|
|
47
|
+
_measure(cell) {
|
|
48
|
+
const [box, plot] = [cell.getBoundingClientRect(), this._plot.getBoundingClientRect()];
|
|
49
|
+
return [box.left - plot.left, box.top - plot.top, box.width, this._plot.clientWidth];
|
|
50
|
+
}
|
|
51
|
+
/** Keeps the tooltip on its cell as the grid scrolls, and hides it once the cell scrolls out. */
|
|
52
|
+
_follow(scroll) {
|
|
53
|
+
const cell = this._cells[this.activeIndex];
|
|
27
54
|
if (!cell) return;
|
|
55
|
+
const [view, box] = [scroll.getBoundingClientRect(), cell.getBoundingClientRect()];
|
|
56
|
+
if (box.right <= view.left || box.left >= view.right) this.show(-1);
|
|
57
|
+
else this._position(this._measure(cell));
|
|
58
|
+
}
|
|
59
|
+
/** Marks the cell and fills the tooltip beside it, on the side with more room. */
|
|
60
|
+
_fill(cell, index, [left, top, width, plotWidth]) {
|
|
28
61
|
cell.classList.add("active");
|
|
29
62
|
const columns = this.series.length;
|
|
30
63
|
const [row, series] = [Math.floor(index / columns), this.series[index % columns]];
|
|
@@ -36,6 +69,9 @@ var HeatmapChart = class extends LineChart {
|
|
|
36
69
|
else name.style.setProperty("--level", String(this._levels[index]));
|
|
37
70
|
text.textContent = series.text[row];
|
|
38
71
|
this._tooltip.replaceChildren(title, name, text);
|
|
72
|
+
this._position([left, top, width, plotWidth]);
|
|
73
|
+
}
|
|
74
|
+
_position([left, top, width, plotWidth]) {
|
|
39
75
|
const end = left + width / 2 > plotWidth / 2;
|
|
40
76
|
this._tooltip.classList.toggle("end", end);
|
|
41
77
|
this._tooltip.style.left = `${left + (end ? 0 : width)}px`;
|
|
@@ -73,10 +109,15 @@ var HeatmapChart = class extends LineChart {
|
|
|
73
109
|
const last = this._cells[this._cells.length - 1].getBoundingClientRect();
|
|
74
110
|
const [left, right] = [Math.min(first.left, last.left), Math.max(first.right, last.right)];
|
|
75
111
|
const [x, y] = [e.clientX, e.clientY];
|
|
76
|
-
if (x
|
|
77
|
-
const
|
|
78
|
-
const column =
|
|
79
|
-
return
|
|
112
|
+
if (this._off(x, y, [left, right, first.top, last.bottom])) return -1;
|
|
113
|
+
const band2 = (offset, size, count) => Math.min(count - 1, Math.floor(offset / (size || 1) * count));
|
|
114
|
+
const column = band2(x - left, right - left, columns);
|
|
115
|
+
return band2(y - first.top, last.bottom - first.top, rows) * columns + (this._reversed ? columns - 1 - column : column);
|
|
116
|
+
}
|
|
117
|
+
/** Whether a point is off the cells, or on cells scrolled out of view under the row labels. */
|
|
118
|
+
_off(x, y, [left, right, top, bottom]) {
|
|
119
|
+
const view = this._scroll.getBoundingClientRect();
|
|
120
|
+
return x < Math.max(left, view.left) || x > Math.min(right, view.right) || y < top || y > bottom;
|
|
80
121
|
}
|
|
81
122
|
/**
|
|
82
123
|
* The legend: a gradient from the lowest cell's shade to the highest's,
|
|
@@ -91,11 +132,43 @@ var HeatmapChart = class extends LineChart {
|
|
|
91
132
|
[low.textContent, high.textContent] = this._ends;
|
|
92
133
|
scale.className = "heatmap-chart-scale";
|
|
93
134
|
if (this._reversed) scale.style.setProperty("--heatmap-chart-to", "left");
|
|
94
|
-
|
|
95
|
-
scale.style.setProperty("--
|
|
135
|
+
const [from, to] = this._endLevels;
|
|
136
|
+
scale.style.setProperty("--low", String(from));
|
|
137
|
+
scale.style.setProperty("--high", String(to));
|
|
138
|
+
scale.classList.toggle("diverging", from < 0 && to > 0);
|
|
139
|
+
scale.style.setProperty("--mid", `${-from / (to - from || 1) * 100}%`);
|
|
140
|
+
scale.append(...this._bands().filter((level) => level >= from && level <= to).map((level) => {
|
|
141
|
+
const swatch = document.createElement("span");
|
|
142
|
+
swatch.style.setProperty("--level", String(level));
|
|
143
|
+
return swatch;
|
|
144
|
+
}));
|
|
96
145
|
legend.append(low, scale, high);
|
|
97
146
|
return [legend];
|
|
98
147
|
}
|
|
148
|
+
/** With data-steps, every band's shade from the lowest to the highest; otherwise none. */
|
|
149
|
+
_bands() {
|
|
150
|
+
const steps = this._steps;
|
|
151
|
+
if (!steps) return [];
|
|
152
|
+
return Array.from({ length: 2 * steps - 1 }, (_, k) => (k - steps + 1) / (steps - 1));
|
|
153
|
+
}
|
|
154
|
+
/** The number of bands data-steps asks for, or 0 for a smooth scale. */
|
|
155
|
+
get _steps() {
|
|
156
|
+
const steps = Math.round(this._number("steps") ?? 0);
|
|
157
|
+
return steps > 1 ? steps : 0;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* How a value shades its cell: from 0 at the scale's low end to 1 at its
|
|
161
|
+
* high end, or with data-mid from -1 to 1 either side of that midpoint,
|
|
162
|
+
* as far as the further end. With data-steps the shades fall into bands.
|
|
163
|
+
*/
|
|
164
|
+
_shade(low, high) {
|
|
165
|
+
const option = (name, fallback) => this._number(name) ?? this.options[name] ?? fallback;
|
|
166
|
+
const [min, max, mid] = [option("min", low), option("max", high), this._number("mid")];
|
|
167
|
+
const clamp = (value, floor) => Math.min(1, Math.max(floor, value));
|
|
168
|
+
const level = mid === null ? (value) => clamp((value - min) / (max - min || 1), 0) : (value) => clamp((Math.min(max, Math.max(min, value)) - mid) / (Math.max(max - mid, mid - min) || 1), -1);
|
|
169
|
+
const steps = this._steps;
|
|
170
|
+
return steps ? (value) => band(level(value), steps) : level;
|
|
171
|
+
}
|
|
99
172
|
/**
|
|
100
173
|
* A grid of the row headers and cells, row by row, with the column headers
|
|
101
174
|
* below. Each cell's --level shades it in CSS.
|
|
@@ -109,9 +182,7 @@ var HeatmapChart = class extends LineChart {
|
|
|
109
182
|
if (value < low) [low, this._ends[0]] = [value, series.text[row]];
|
|
110
183
|
if (value > high) [high, this._ends[1]] = [value, series.text[row]];
|
|
111
184
|
}));
|
|
112
|
-
const
|
|
113
|
-
const [min, max] = [option("min") ?? low, option("max") ?? high];
|
|
114
|
-
const shade = (value) => Math.min(1, Math.max(0, (value - min) / (max - min || 1)));
|
|
185
|
+
const shade = this._shade(low, high);
|
|
115
186
|
this._endLevels = [shade(low), shade(high)];
|
|
116
187
|
const grid = document.createElement("div");
|
|
117
188
|
grid.className = "heatmap-chart-grid";
|
|
@@ -128,8 +199,11 @@ var HeatmapChart = class extends LineChart {
|
|
|
128
199
|
const values = this.el.classList.contains("values");
|
|
129
200
|
this._cells = [];
|
|
130
201
|
this._levels = [];
|
|
202
|
+
const [rows, cells] = [document.createElement("div"), document.createElement("div")];
|
|
203
|
+
rows.className = "heatmap-chart-rows";
|
|
204
|
+
cells.className = "heatmap-chart-cells";
|
|
131
205
|
this.labels.forEach((_, row) => {
|
|
132
|
-
|
|
206
|
+
rows.append(span("heatmap-chart-row", label(this._rows[row].cells[0])));
|
|
133
207
|
this.series.forEach((series) => {
|
|
134
208
|
const value = series.values[row];
|
|
135
209
|
const level = value === null ? null : shade(value);
|
|
@@ -138,24 +212,35 @@ var HeatmapChart = class extends LineChart {
|
|
|
138
212
|
else cell.style.setProperty("--level", String(level));
|
|
139
213
|
this._cells.push(cell);
|
|
140
214
|
this._levels.push(level);
|
|
141
|
-
|
|
215
|
+
cells.append(cell);
|
|
142
216
|
});
|
|
143
217
|
});
|
|
144
218
|
const labels = this._header.slice(1, columns + 1).map(label);
|
|
219
|
+
const columnLabels = [];
|
|
145
220
|
labels.forEach((text, column) => {
|
|
146
221
|
if (!text) return;
|
|
147
222
|
let end = column + 1;
|
|
148
223
|
while (end < columns && !labels[end]) end++;
|
|
149
224
|
const element = span("heatmap-chart-column", text);
|
|
150
225
|
element.classList.toggle("run", end > column + 1);
|
|
151
|
-
element.style.gridArea = `${this.labels.length + 1} / ${column +
|
|
152
|
-
|
|
226
|
+
element.style.gridArea = `${this.labels.length + 1} / ${column + 1} / auto / ${end + 1}`;
|
|
227
|
+
cells.append(element);
|
|
228
|
+
columnLabels.push(element);
|
|
153
229
|
});
|
|
230
|
+
this._observeLabels(cells, columnLabels.some((element) => element.classList.contains("run")) ? [] : columnLabels);
|
|
231
|
+
const scroll = this._scroll = document.createElement("div");
|
|
232
|
+
scroll.className = "heatmap-chart-scroll";
|
|
233
|
+
scroll.tabIndex = -1;
|
|
234
|
+
scroll.addEventListener("focus", () => this._plot.focus());
|
|
235
|
+
scroll.addEventListener("scroll", () => this._follow(scroll), { passive: true });
|
|
236
|
+
scroll.append(cells);
|
|
237
|
+
grid.append(rows, scroll);
|
|
154
238
|
return grid;
|
|
155
239
|
}
|
|
156
240
|
};
|
|
241
|
+
HeatmapChart.key = "Expressive_HeatmapChart";
|
|
157
242
|
|
|
158
243
|
export {
|
|
159
244
|
HeatmapChart
|
|
160
245
|
};
|
|
161
|
-
//# sourceMappingURL=chunk-
|
|
246
|
+
//# sourceMappingURL=chunk-BPF3I2MN.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/ts/components/heatmapChart.ts"],
|
|
4
|
+
"sourcesContent": ["import { LineChart, LineChartOptions } from './lineChart';\n\nexport type HeatmapChartOptions = LineChartOptions;\n\n/**\n * A shade in one of `steps` bands, each side of zero on a diverging scale:\n * the lowest band is the empty color, and the highest is the full color.\n */\nfunction band(level: number, steps: number) {\n return (Math.sign(level) * Math.min(steps - 1, Math.floor(Math.abs(level) * steps))) / (steps - 1);\n}\n\n/**\n * Heatmap chart. It reads its <table> like LineChart, but draws every cell\n * as a square of the grid, shaded from the lowest value to the highest, with\n * the row headers beside it and the column headers below. A `data-label` on\n * a header cell replaces its text on the grid; an empty one hides it. The\n * tooltip shows one cell, and the arrow keys move round the grid. With\n * `data-mid` the scale diverges either side of that value, and with\n * `data-steps` the shades fall into that many bands.\n *\n * Call `update()` after changing the table, or start it with `watch` or\n * `data-watch`.\n */\nexport class HeatmapChart extends LineChart {\n // No initializers: LineChart's constructor draws before they would run.\n /** Every cell, row by row. */\n private _cells: HTMLElement[];\n /** Each cell's shade from 0 to 1, or -1 to 1 on a diverging scale, or null for a gap. */\n private _levels: (number | null)[];\n /** The text of the lowest and highest cells, for the legend. */\n private _ends: [string, string];\n /** The shades of the lowest and highest cells, where the legend's gradient runs. */\n private _endLevels: [number, number];\n /** The box the cells scroll in, beside the row labels. */\n private _scroll: HTMLElement;\n\n protected get _type() {\n return 'heatmap-chart';\n }\n\n /** Color carries the value, so there is no value axis. */\n protected get _axis() {\n return false;\n }\n\n static key = 'Expressive_HeatmapChart';\n\n protected get _count() {\n return this.labels.length * this.series.length;\n }\n\n /** Redraws the grid, scrolled where it was. */\n update() {\n const left = this._scroll?.scrollLeft;\n super.update();\n if (this._scroll && left) this._scroll.scrollLeft = left;\n }\n\n /** Highlights one cell, numbered row by row. Pass -1 to hide the tooltip. */\n show(index: number) {\n if (!this._tooltip || index === this.activeIndex) return;\n this._activate(this._cells[index], index);\n }\n\n private _activate(cell: HTMLElement | undefined, index: number) {\n // Measure before the writes below, which would otherwise force a layout.\n const box = cell ? this._box(cell) : null;\n this._cells[this.activeIndex]?.classList.remove('active');\n this.activeIndex = index;\n this._tooltip.hidden = !box;\n if (box) this._fill(cell!, index, box);\n }\n\n /**\n * A cell's left, top and width in the plot, past any scrolling of the\n * grid, and the plot's width. A key can move to a cell scrolled out of a\n * wide grid, so it scrolls into view first.\n */\n private _box(cell: HTMLElement) {\n if (this._plot.matches(':focus-visible')) cell.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n return this._measure(cell);\n }\n\n private _measure(cell: HTMLElement) {\n const [box, plot] = [cell.getBoundingClientRect(), this._plot.getBoundingClientRect()];\n return [box.left - plot.left, box.top - plot.top, box.width, this._plot.clientWidth];\n }\n\n /** Keeps the tooltip on its cell as the grid scrolls, and hides it once the cell scrolls out. */\n private _follow(scroll: HTMLElement) {\n const cell = this._cells[this.activeIndex];\n if (!cell) return;\n const [view, box] = [scroll.getBoundingClientRect(), cell.getBoundingClientRect()];\n if (box.right <= view.left || box.left >= view.right) this.show(-1);\n else this._position(this._measure(cell));\n }\n\n /** Marks the cell and fills the tooltip beside it, on the side with more room. */\n private _fill(cell: HTMLElement, index: number, [left, top, width, plotWidth]: number[]) {\n cell.classList.add('active');\n const columns = this.series.length;\n const [row, series] = [Math.floor(index / columns), this.series[index % columns]];\n const title = document.createElement('strong');\n title.textContent = this.labels[row];\n const [name, text] = [document.createElement('span'), document.createElement('span')];\n name.textContent = series.name;\n // A gap's swatch is outlined like its cell.\n if (this._levels[index] === null) name.className = 'gap';\n else name.style.setProperty('--level', String(this._levels[index]));\n text.textContent = series.text[row];\n this._tooltip.replaceChildren(title, name, text);\n this._position([left, top, width, plotWidth]);\n }\n\n private _position([left, top, width, plotWidth]: number[]) {\n const end = left + width / 2 > plotWidth / 2;\n this._tooltip.classList.toggle('end', end);\n this._tooltip.style.left = `${left + (end ? 0 : width)}px`;\n this._tooltip.style.top = `${top}px`;\n }\n\n /** Arrows move the way they point, so left and right swap in RTL. */\n protected _keyTarget(key: string): number | undefined {\n // With nothing shown, Escape is left to a dialog or sheet around the chart.\n if (key === 'Escape') return this.activeIndex < 0 ? undefined : -1;\n const [columns, last] = [this.series.length, this.labels.length - 1];\n const index = Math.max(0, this.activeIndex);\n const [row, column] = [Math.floor(index / columns), index % columns];\n const [next, back] = this._reversed ? ['ArrowLeft', 'ArrowRight'] : ['ArrowRight', 'ArrowLeft'];\n const to = {\n [next]: [row, column + 1],\n [back]: [row, column - 1],\n ArrowDown: [row + 1, column],\n ArrowUp: [row - 1, column],\n Home: [row, 0],\n End: [row, columns - 1]\n }[key];\n if (!to) return undefined;\n // The first key after focus or Escape shows the first cell.\n if (this.activeIndex < 0) return 0;\n const clamp = (value: number, max: number) => Math.min(max, Math.max(0, value));\n return clamp(to[0], last) * columns + clamp(to[1], columns - 1);\n }\n\n /**\n * The cell under the pointer by its position, or -1 off the grid. A touch\n * keeps its first target while it drags, so the target cannot be used. The\n * cells and gaps are even, so each band's edge falls in a gap and a gap\n * counts as the nearer cell.\n */\n protected _indexAt(e: PointerEvent) {\n const [columns, rows] = [this.series.length, this.labels.length];\n const first = this._cells[0].getBoundingClientRect();\n const last = this._cells[this._cells.length - 1].getBoundingClientRect();\n const [left, right] = [Math.min(first.left, last.left), Math.max(first.right, last.right)];\n const [x, y] = [e.clientX, e.clientY];\n if (this._off(x, y, [left, right, first.top, last.bottom])) return -1;\n const band = (offset: number, size: number, count: number) =>\n Math.min(count - 1, Math.floor((offset / (size || 1)) * count));\n const column = band(x - left, right - left, columns);\n return band(y - first.top, last.bottom - first.top, rows) * columns + (this._reversed ? columns - 1 - column : column);\n }\n\n /** Whether a point is off the cells, or on cells scrolled out of view under the row labels. */\n private _off(x: number, y: number, [left, right, top, bottom]: number[]) {\n const view = this._scroll.getBoundingClientRect();\n return x < Math.max(left, view.left) || x > Math.min(right, view.right) || y < top || y > bottom;\n }\n\n /**\n * The legend: a gradient from the lowest cell's shade to the highest's,\n * labelled with their text. A fixed scale wider than the data shows only\n * the part the data uses.\n */\n protected _guides(): Element[] {\n const legend = document.createElement('div');\n legend.className = 'heatmap-chart-legend';\n legend.setAttribute('aria-hidden', 'true');\n const [low, scale, high] = ['span', 'span', 'span'].map((tag) => document.createElement(tag));\n [low.textContent, high.textContent] = this._ends;\n scale.className = 'heatmap-chart-scale';\n if (this._reversed) scale.style.setProperty('--heatmap-chart-to', 'left');\n const [from, to] = this._endLevels;\n scale.style.setProperty('--low', String(from));\n scale.style.setProperty('--high', String(to));\n // A diverging scale whose data crosses the midpoint passes its empty color.\n scale.classList.toggle('diverging', from < 0 && to > 0);\n scale.style.setProperty('--mid', `${(-from / (to - from || 1)) * 100}%`);\n scale.append(...this._bands().filter((level) => level >= from && level <= to).map((level) => {\n const swatch = document.createElement('span');\n swatch.style.setProperty('--level', String(level));\n return swatch;\n }));\n legend.append(low, scale, high);\n return [legend];\n }\n\n /** With data-steps, every band's shade from the lowest to the highest; otherwise none. */\n private _bands() {\n const steps = this._steps;\n if (!steps) return [];\n return Array.from({ length: 2 * steps - 1 }, (_, k) => (k - steps + 1) / (steps - 1));\n }\n\n /** The number of bands data-steps asks for, or 0 for a smooth scale. */\n private get _steps() {\n const steps = Math.round(this._number('steps') ?? 0);\n return steps > 1 ? steps : 0;\n }\n\n /**\n * How a value shades its cell: from 0 at the scale's low end to 1 at its\n * high end, or with data-mid from -1 to 1 either side of that midpoint,\n * as far as the further end. With data-steps the shades fall into bands.\n */\n private _shade(low: number, high: number) {\n const option = (name: 'min' | 'max', fallback: number) => this._number(name) ?? this.options[name] ?? fallback;\n const [min, max, mid] = [option('min', low), option('max', high), this._number('mid')];\n const clamp = (value: number, floor: number) => Math.min(1, Math.max(floor, value));\n const level = mid === null\n ? (value: number) => clamp((value - min) / (max - min || 1), 0)\n : (value: number) => clamp((Math.min(max, Math.max(min, value)) - mid) / (Math.max(max - mid, mid - min) || 1), -1);\n const steps = this._steps;\n return steps ? (value: number) => band(level(value), steps) : level;\n }\n\n /**\n * A grid of the row headers and cells, row by row, with the column headers\n * below. Each cell's --level shades it in CSS.\n */\n protected _draw(): Element {\n const columns = this.series.length;\n let [low, high] = [Infinity, -Infinity];\n this._ends = ['', ''];\n this.series.forEach((series) => series.values.forEach((value, row) => {\n if (value === null) return;\n if (value < low) [low, this._ends[0]] = [value, series.text[row]];\n if (value > high) [high, this._ends[1]] = [value, series.text[row]];\n }));\n const shade = this._shade(low, high);\n this._endLevels = [shade(low), shade(high)];\n\n const grid = document.createElement('div');\n grid.className = 'heatmap-chart-grid';\n grid.setAttribute('aria-hidden', 'true');\n grid.style.setProperty('--columns', String(columns));\n grid.style.setProperty('--rows', String(this.labels.length));\n const span = (className: string, text = '') => {\n const element = document.createElement('span');\n element.className = className;\n element.textContent = text;\n return element;\n };\n const label = (cell: HTMLTableCellElement | undefined) =>\n cell?.dataset.label ?? cell?.textContent.trim() ?? '';\n const values = this.el.classList.contains('values');\n\n this._cells = [];\n this._levels = [];\n // The row labels stay put beside the cells, which scroll when they are too narrow.\n const [rows, cells] = [document.createElement('div'), document.createElement('div')];\n rows.className = 'heatmap-chart-rows';\n cells.className = 'heatmap-chart-cells';\n this.labels.forEach((_, row) => {\n rows.append(span('heatmap-chart-row', label(this._rows[row].cells[0])));\n this.series.forEach((series) => {\n const value = series.values[row];\n const level = value === null ? null : shade(value);\n const cell = span('heatmap-chart-cell', values ? series.text[row] : '');\n if (level === null) cell.classList.add('gap');\n else cell.style.setProperty('--level', String(level));\n this._cells.push(cell);\n this._levels.push(level);\n cells.append(cell);\n });\n });\n\n // A column label runs on over the empty labels after it.\n const labels = this._header.slice(1, columns + 1).map(label);\n const columnLabels: HTMLElement[] = [];\n labels.forEach((text, column) => {\n if (!text) return;\n let end = column + 1;\n while (end < columns && !labels[end]) end++;\n const element = span('heatmap-chart-column', text);\n element.classList.toggle('run', end > column + 1);\n element.style.gridArea = `${this.labels.length + 1} / ${column + 1} / auto / ${end + 1}`;\n cells.append(element);\n columnLabels.push(element);\n });\n // Labels the author already spaced out with empty ones are left as written.\n this._observeLabels(cells, columnLabels.some((element) => element.classList.contains('run')) ? [] : columnLabels);\n\n // The plot is the one Tab stop, so the scroll box is not another, and a\n // press that focuses it hands focus on to the plot.\n const scroll = (this._scroll = document.createElement('div'));\n scroll.className = 'heatmap-chart-scroll';\n scroll.tabIndex = -1;\n scroll.addEventListener('focus', () => this._plot.focus());\n scroll.addEventListener('scroll', () => this._follow(scroll), { passive: true });\n scroll.append(cells);\n grid.append(rows, scroll);\n return grid;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AAQA,SAAS,KAAK,OAAe,OAAe;AAC1C,SAAQ,KAAK,KAAK,KAAK,IAAI,KAAK,IAAI,QAAQ,GAAG,KAAK,MAAM,KAAK,IAAI,KAAK,IAAI,KAAK,CAAC,KAAM,QAAQ;AAClG;AAcO,IAAM,eAAN,cAA2B,UAAU;AAAA,EAa1C,IAAc,QAAQ;AACpB,WAAO;AAAA,EACT;AAAA;AAAA,EAGA,IAAc,QAAQ;AACpB,WAAO;AAAA,EACT;AAAA,EAIA,IAAc,SAAS;AACrB,WAAO,KAAK,OAAO,SAAS,KAAK,OAAO;AAAA,EAC1C;AAAA;AAAA,EAGA,SAAS;AACP,UAAM,OAAO,KAAK,SAAS;AAC3B,UAAM,OAAO;AACb,QAAI,KAAK,WAAW,KAAM,MAAK,QAAQ,aAAa;AAAA,EACtD;AAAA;AAAA,EAGA,KAAK,OAAe;AAClB,QAAI,CAAC,KAAK,YAAY,UAAU,KAAK,YAAa;AAClD,SAAK,UAAU,KAAK,OAAO,KAAK,GAAG,KAAK;AAAA,EAC1C;AAAA,EAEQ,UAAU,MAA+B,OAAe;AAE9D,UAAM,MAAM,OAAO,KAAK,KAAK,IAAI,IAAI;AACrC,SAAK,OAAO,KAAK,WAAW,GAAG,UAAU,OAAO,QAAQ;AACxD,SAAK,cAAc;AACnB,SAAK,SAAS,SAAS,CAAC;AACxB,QAAI,IAAK,MAA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