@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,223 @@
|
|
|
1
|
+
import {
|
|
2
|
+
LineChart,
|
|
3
|
+
rowLegend,
|
|
4
|
+
seriesColor,
|
|
5
|
+
tintTooltip
|
|
6
|
+
} from "./chunk-IQOTGGHX.mjs";
|
|
7
|
+
import {
|
|
8
|
+
svgNode
|
|
9
|
+
} from "./chunk-67UNY7RH.mjs";
|
|
10
|
+
|
|
11
|
+
// src/ts/components/radialChart.ts
|
|
12
|
+
var RADIUS = 46;
|
|
13
|
+
var FILL = 0.8;
|
|
14
|
+
var RadialChart = class extends LineChart {
|
|
15
|
+
get _type() {
|
|
16
|
+
return "radial-chart";
|
|
17
|
+
}
|
|
18
|
+
/** The rings fill to data-max, so there is no value axis. */
|
|
19
|
+
get _axis() {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
get _points() {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
get _circular() {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
get _gauge() {
|
|
29
|
+
return this.el.classList.contains("gauge");
|
|
30
|
+
}
|
|
31
|
+
/** Whether .labels names the rings, which a sparkline never does. */
|
|
32
|
+
get _labeled() {
|
|
33
|
+
const list = this.el.classList;
|
|
34
|
+
return list.contains("labels") && !list.contains("sparkline");
|
|
35
|
+
}
|
|
36
|
+
/** How much of a circle a full ring spans. */
|
|
37
|
+
get _span() {
|
|
38
|
+
if (this._gauge) return 0.5;
|
|
39
|
+
return this._labeled ? 0.75 : 1;
|
|
40
|
+
}
|
|
41
|
+
/** The number of segments data-segments asks for, or 0 for whole rings. */
|
|
42
|
+
get _segments() {
|
|
43
|
+
const segments = Math.round(this._number("segments") ?? 0);
|
|
44
|
+
return segments > 1 ? segments : 0;
|
|
45
|
+
}
|
|
46
|
+
/** A share as drawn: with segments, to the nearest whole segment. */
|
|
47
|
+
_lit(fraction) {
|
|
48
|
+
const segments = this._segments;
|
|
49
|
+
return segments ? Math.round(fraction * segments) / segments : fraction;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* A ring's dash pattern for a share of its span. Round caps reach half the
|
|
53
|
+
* width past each end of a dash, so a capped dash is one width shorter and
|
|
54
|
+
* its gap one width longer; one shorter than the width is a dot. With
|
|
55
|
+
* segments, each lit segment is a dash with the ring gap after it, and
|
|
56
|
+
* the last gap runs out the circle so the pattern does not repeat.
|
|
57
|
+
*/
|
|
58
|
+
_dash(fraction, length, capped) {
|
|
59
|
+
const [cap, segments, span] = [capped ? this._width : 0, this._segments, this._span * length];
|
|
60
|
+
if (!segments) return `${Math.max(1e-3, fraction * span - cap).toFixed(3)} ${length.toFixed(3)}`;
|
|
61
|
+
const size = span / segments;
|
|
62
|
+
const dash = Math.max(1e-3, size - this._gap - cap);
|
|
63
|
+
const lit = Array.from({ length: Math.round(fraction * segments) }, () => `${dash.toFixed(3)} ${(size - dash).toFixed(3)}`);
|
|
64
|
+
return `${lit.join(" ").replace(/ [\d.]+$/, "") || 0} ${length.toFixed(3)}`;
|
|
65
|
+
}
|
|
66
|
+
/** The distance between rings' middles, or one ring's width. */
|
|
67
|
+
get _step() {
|
|
68
|
+
return this._radii.length > 1 ? this._radii[0] - this._radii[1] : this._width;
|
|
69
|
+
}
|
|
70
|
+
show(index) {
|
|
71
|
+
if (!this._tooltip || index === this.activeIndex) return;
|
|
72
|
+
super.show(index);
|
|
73
|
+
this._rings.forEach((ring, i) => ring.classList.toggle("active", i === index));
|
|
74
|
+
this._sweeps.forEach((sweep, i) => sweep?.classList.toggle("active", i === index));
|
|
75
|
+
if (this._tooltip.hidden) return;
|
|
76
|
+
tintTooltip(this._tooltip, seriesColor(index));
|
|
77
|
+
}
|
|
78
|
+
/** The tooltip sits where the ring's fill ends. */
|
|
79
|
+
_place(index) {
|
|
80
|
+
const turn = this._turn(this._fractions[index]);
|
|
81
|
+
const r = this._radii[index];
|
|
82
|
+
const [x, y] = [r * Math.sin(turn * 2 * Math.PI), -r * Math.cos(turn * 2 * Math.PI)];
|
|
83
|
+
this._tooltip.style.left = `${50 + x}%`;
|
|
84
|
+
this._tooltip.style.top = `${(50 + y) / (this._gauge ? 50 : 100) * 100}%`;
|
|
85
|
+
this._tooltip.classList.toggle("end", x > 0);
|
|
86
|
+
}
|
|
87
|
+
/** A fraction of the ring as a turn clockwise from the top. */
|
|
88
|
+
_turn(fraction) {
|
|
89
|
+
return fraction * this._span - (this._gauge ? 0.25 : 0);
|
|
90
|
+
}
|
|
91
|
+
/** For more than one row, a legend of every row with its color and cell. */
|
|
92
|
+
_guides() {
|
|
93
|
+
if (this.labels.length < 2) return [];
|
|
94
|
+
const text = this.series[0].text;
|
|
95
|
+
const colors = this.labels.map((_, i) => seriesColor(i));
|
|
96
|
+
return [rowLegend("radial-chart-legend", colors, this.labels.map((label, i) => [label, text[i]]))];
|
|
97
|
+
}
|
|
98
|
+
/** The ring under the pointer by its distance from the middle, or -1. */
|
|
99
|
+
_indexAt(e) {
|
|
100
|
+
const box = this._plot.getBoundingClientRect();
|
|
101
|
+
const [x, y] = [e.clientX - box.left - box.width / 2, e.clientY - box.top - box.width / 2];
|
|
102
|
+
if (this._gauge && y > 0) return this._nameAt(e);
|
|
103
|
+
const distance = this._distance(x, y, box.width);
|
|
104
|
+
return this._radii.findIndex((r) => Math.abs(distance - r) <= this._step / 2);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* How far a point is from the middle in the SVG's 100-unit box. In the
|
|
108
|
+
* top left quarter .labels leaves empty, the names run straight across,
|
|
109
|
+
* so only the height counts and a name picks its own ring.
|
|
110
|
+
*/
|
|
111
|
+
_distance(x, y, width) {
|
|
112
|
+
if (this._span === 0.75 && x < 0 && y < 0) return -y / width * 100;
|
|
113
|
+
return Math.hypot(x, y) / width * 100;
|
|
114
|
+
}
|
|
115
|
+
/** Under a gauge's base line, the ring whose name is under the pointer, or -1. */
|
|
116
|
+
_nameAt(e) {
|
|
117
|
+
const name = e.target.closest(".radial-chart-names > span");
|
|
118
|
+
return name ? [...name.parentElement.children].indexOf(name) : -1;
|
|
119
|
+
}
|
|
120
|
+
/** The rings' turn, from three o'clock to the top or, for a gauge, to nine, and the SVG's box. */
|
|
121
|
+
get _frame() {
|
|
122
|
+
return this._gauge ? ["rotate(180)", "-50 -50 100 50"] : ["rotate(-90)", "-50 -50 100 100"];
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* With .gradient, a ring's fill drawn again in HTML: a conic gradient from
|
|
126
|
+
* a tint of its colour at the ring's start to the full colour where the
|
|
127
|
+
* fill ends, masked to the fill's own dash, so it follows the ring round.
|
|
128
|
+
* An SVG stroke takes no conic gradient.
|
|
129
|
+
*/
|
|
130
|
+
_sweep(r, i, length) {
|
|
131
|
+
const fraction = this._fractions[i];
|
|
132
|
+
if (!fraction || !this.el.classList.contains("gradient")) return null;
|
|
133
|
+
const [transform, viewBox] = this._frame;
|
|
134
|
+
const width = this._width.toFixed(3);
|
|
135
|
+
const dash = this._dash(fraction, length, true);
|
|
136
|
+
const image = `<svg xmlns='http://www.w3.org/2000/svg' viewBox='${viewBox}'><circle r='${r.toFixed(3)}' stroke-width='${width}' transform='${transform}' stroke-dasharray='${dash}' stroke-dashoffset='${(-this._width / 2).toFixed(3)}' stroke-linecap='round' fill='none' stroke='black'/></svg>`;
|
|
137
|
+
const sweep = document.createElement("div");
|
|
138
|
+
sweep.className = "radial-chart-sweep";
|
|
139
|
+
sweep.dataset.series = seriesColor(i);
|
|
140
|
+
sweep.style.setProperty("--radial-chart-shape", `url("data:image/svg+xml,${encodeURIComponent(image)}")`);
|
|
141
|
+
sweep.style.setProperty("--radial-chart-from", `${this._turn(0)}turn`);
|
|
142
|
+
sweep.style.setProperty("--radial-chart-to", `${fraction * this._span}turn`);
|
|
143
|
+
return sweep;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* With .labels, each row's name left of its ring's start at the top,
|
|
147
|
+
* ending at the middle line. CSS shrinks the text to fit crowded rings.
|
|
148
|
+
* A gauge's names hang under its base line in a row each, innermost
|
|
149
|
+
* first, starting below their rings' starts.
|
|
150
|
+
*/
|
|
151
|
+
_names() {
|
|
152
|
+
if (!this._labeled) return [];
|
|
153
|
+
const count = this._radii.length;
|
|
154
|
+
const names = document.createElement("div");
|
|
155
|
+
names.className = "radial-chart-names";
|
|
156
|
+
names.style.setProperty("--radial-chart-step", this._step.toFixed(3));
|
|
157
|
+
this._plot.style.setProperty("--radial-chart-rows", String(count));
|
|
158
|
+
names.append(...this._radii.map((r, i) => {
|
|
159
|
+
const name = document.createElement("span");
|
|
160
|
+
name.style.setProperty("--radial-chart-at", `${(50 - r).toFixed(3)}%`);
|
|
161
|
+
name.style.setProperty("--radial-chart-row", String(count - 1 - i));
|
|
162
|
+
name.textContent = this.labels[i];
|
|
163
|
+
return name;
|
|
164
|
+
}));
|
|
165
|
+
return [names];
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* An SVG of rings in a -50 to 50 box, the top half for a gauge. Each row
|
|
169
|
+
* is a track circle and a fill circle whose dash is its share; CSS draws
|
|
170
|
+
* them from --radial-chart-dash. The total is HTML over it.
|
|
171
|
+
*/
|
|
172
|
+
_draw() {
|
|
173
|
+
const style = getComputedStyle(this.el);
|
|
174
|
+
const token = (name, fallback) => {
|
|
175
|
+
const value = parseFloat(style.getPropertyValue(`--md-comp-radial-chart-${name}`));
|
|
176
|
+
return Number.isFinite(value) ? value : fallback;
|
|
177
|
+
};
|
|
178
|
+
const count = this.labels.length;
|
|
179
|
+
let [width, gap] = [Math.max(0, token("thickness", 8)), Math.max(0, token("gap", 2))];
|
|
180
|
+
const scale = Math.min(1, RADIUS * FILL / (count * width + (count - 1) * gap || 1));
|
|
181
|
+
[width, gap] = [width * scale, gap * scale];
|
|
182
|
+
[this._width, this._gap] = [width, gap];
|
|
183
|
+
this._radii = this.labels.map((_, i) => RADIUS - width / 2 - i * (width + gap));
|
|
184
|
+
const max = [parseFloat(this.el.dataset.max ?? ""), this.options.max ?? NaN, 100].find((value) => value > 0);
|
|
185
|
+
this._fractions = this.series[0].values.map((value) => this._lit(Math.min(1, Math.max(0, (value ?? 0) / max))));
|
|
186
|
+
const [transform, viewBox] = this._frame;
|
|
187
|
+
const svg = svgNode("svg", { viewBox, focusable: "false" });
|
|
188
|
+
const span = this._span;
|
|
189
|
+
this._sweeps = [];
|
|
190
|
+
this._rings = this._radii.map((r, i) => {
|
|
191
|
+
const length = 2 * Math.PI * r;
|
|
192
|
+
const circle = (name, fraction, capped) => {
|
|
193
|
+
const ring2 = svgNode("circle", { class: name, r: r.toFixed(3), transform, "stroke-width": width.toFixed(3) });
|
|
194
|
+
ring2.style.setProperty("--radial-chart-dash", this._dash(fraction, length, capped));
|
|
195
|
+
if (capped) {
|
|
196
|
+
ring2.style.setProperty("--radial-chart-offset", (-width / 2).toFixed(3));
|
|
197
|
+
ring2.classList.add("capped");
|
|
198
|
+
}
|
|
199
|
+
return ring2;
|
|
200
|
+
};
|
|
201
|
+
const ring = circle("radial-chart-ring", this._fractions[i], true);
|
|
202
|
+
ring.dataset.series = seriesColor(i);
|
|
203
|
+
if (!this._fractions[i]) ring.classList.add("empty");
|
|
204
|
+
svg.append(circle("radial-chart-track", 1, span < 1 || !!this._segments), ring);
|
|
205
|
+
this._sweeps.push(this._sweep(r, i, length));
|
|
206
|
+
return ring;
|
|
207
|
+
});
|
|
208
|
+
const rings = document.createElement("div");
|
|
209
|
+
rings.className = "radial-chart-rings";
|
|
210
|
+
rings.setAttribute("aria-hidden", "true");
|
|
211
|
+
rings.style.setProperty("--radial-chart-middle", `${(this._radii[count - 1] - this._width / 2) * 2}%`);
|
|
212
|
+
rings.append(svg, ...this._sweeps.filter((sweep) => sweep !== null), ...this._names());
|
|
213
|
+
const total = this._total("radial-chart-total");
|
|
214
|
+
if (total) rings.append(total);
|
|
215
|
+
return rings;
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
RadialChart.key = "Expressive_RadialChart";
|
|
219
|
+
|
|
220
|
+
export {
|
|
221
|
+
RadialChart
|
|
222
|
+
};
|
|
223
|
+
//# sourceMappingURL=chunk-UKCNELUN.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/ts/components/radialChart.ts"],
|
|
4
|
+
"sourcesContent": ["import { LineChart, LineChartOptions, rowLegend, seriesColor, tintTooltip } from './lineChart';\nimport { svgNode as node } from '../core/utils';\n\nexport type RadialChartOptions = LineChartOptions;\n\n/** The outer ring's outer edge in a 100-unit box. */\nconst RADIUS = 46;\n/** The rings never fill more of the radius than this, leaving a middle. */\nconst FILL = 0.8;\n\n/**\n * Radial chart. It reads its <table> like LineChart, but draws each row of\n * the first value column as a ring, outermost first, filled clockwise from\n * the top as a share of `data-max` above zero (100 by default). With `.gauge` the rings\n * are half circles over the middle. With `.labels` they are three quarters\n * of a circle, leaving the top left quarter for each row's name at the\n * ring's start; a gauge's names hang under its base line instead.\n * `data-segments` splits each ring into that many segments, filled whole,\n * and `.gradient` shades each fill along the ring, from a light tint at its\n * start to its full color at its end. A <tfoot>\n * row shows in the middle, and\n * a legend lists the rows when there is more than one. Further columns show\n * in the tooltip.\n *\n * Call `update()` after changing the ring tokens, and after changing the table\n * unless it was started with `watch` or `data-watch`.\n */\nexport class RadialChart extends LineChart {\n // No initializers: LineChart's constructor draws before they would run.\n /** Each ring's middle radius, and their shared width. */\n private _radii: number[];\n private _width: number;\n /** The gap between rings, and between segments. */\n private _gap: number;\n /** Each row's share of the maximum, from 0 to 1. */\n private _fractions: number[];\n private _rings: SVGCircleElement[];\n /** With .gradient, each ring's fill drawn again as a conic gradient, or null for none. */\n private _sweeps: (HTMLElement | null)[];\n\n protected get _type() {\n return 'radial-chart';\n }\n\n /** The rings fill to data-max, so there is no value axis. */\n protected get _axis() {\n return false;\n }\n\n protected get _points() {\n return false;\n }\n\n protected get _circular() {\n return true;\n }\n\n private get _gauge() {\n return this.el.classList.contains('gauge');\n }\n\n /** Whether .labels names the rings, which a sparkline never does. */\n private get _labeled() {\n const list = this.el.classList;\n return list.contains('labels') && !list.contains('sparkline');\n }\n\n /** How much of a circle a full ring spans. */\n private get _span() {\n if (this._gauge) return 0.5;\n return this._labeled ? 0.75 : 1;\n }\n\n /** The number of segments data-segments asks for, or 0 for whole rings. */\n private get _segments() {\n const segments = Math.round(this._number('segments') ?? 0);\n return segments > 1 ? segments : 0;\n }\n\n /** A share as drawn: with segments, to the nearest whole segment. */\n private _lit(fraction: number) {\n const segments = this._segments;\n return segments ? Math.round(fraction * segments) / segments : fraction;\n }\n\n /**\n * A ring's dash pattern for a share of its span. Round caps reach half the\n * width past each end of a dash, so a capped dash is one width shorter and\n * its gap one width longer; one shorter than the width is a dot. With\n * segments, each lit segment is a dash with the ring gap after it, and\n * the last gap runs out the circle so the pattern does not repeat.\n */\n private _dash(fraction: number, length: number, capped: boolean) {\n const [cap, segments, span] = [capped ? this._width : 0, this._segments, this._span * length];\n if (!segments) return `${Math.max(0.001, fraction * span - cap).toFixed(3)} ${length.toFixed(3)}`;\n // A dash and its gap make one segment, even where a small ring leaves\n // too little room for the gap and the caps.\n const size = span / segments;\n const dash = Math.max(0.001, size - this._gap - cap);\n const lit = Array.from({ length: Math.round(fraction * segments) }, () => `${dash.toFixed(3)} ${(size - dash).toFixed(3)}`);\n return `${lit.join(' ').replace(/ [\\d.]+$/, '') || 0} ${length.toFixed(3)}`;\n }\n\n /** The distance between rings' middles, or one ring's width. */\n private get _step() {\n return this._radii.length > 1 ? this._radii[0] - this._radii[1] : this._width;\n }\n\n static key = 'Expressive_RadialChart';\n\n show(index: number) {\n if (!this._tooltip || index === this.activeIndex) return;\n super.show(index);\n this._rings.forEach((ring, i) => ring.classList.toggle('active', i === index));\n this._sweeps.forEach((sweep, i) => sweep?.classList.toggle('active', i === index));\n // LineChart hides the tooltip for -1 and for an index past the last row.\n if (this._tooltip.hidden) return;\n tintTooltip(this._tooltip, seriesColor(index));\n }\n\n /** The tooltip sits where the ring's fill ends. */\n protected _place(index: number) {\n const turn = this._turn(this._fractions[index]);\n const r = this._radii[index];\n const [x, y] = [r * Math.sin(turn * 2 * Math.PI), -r * Math.cos(turn * 2 * Math.PI)];\n this._tooltip.style.left = `${50 + x}%`;\n this._tooltip.style.top = `${((50 + y) / (this._gauge ? 50 : 100)) * 100}%`;\n // On the right half it opens leftwards, over the rings.\n this._tooltip.classList.toggle('end', x > 0);\n }\n\n /** A fraction of the ring as a turn clockwise from the top. */\n private _turn(fraction: number) {\n // A gauge starts at nine o'clock.\n return fraction * this._span - (this._gauge ? 0.25 : 0);\n }\n\n /** For more than one row, a legend of every row with its color and cell. */\n protected _guides(): Element[] {\n if (this.labels.length < 2) return [];\n const text = this.series[0].text;\n const colors = this.labels.map((_, i) => seriesColor(i));\n return [rowLegend('radial-chart-legend', colors, this.labels.map((label, i) => [label, text[i]]))];\n }\n\n /** The ring under the pointer by its distance from the middle, or -1. */\n protected _indexAt(e: PointerEvent) {\n const box = this._plot.getBoundingClientRect();\n // The middle is half the width down in both shapes.\n const [x, y] = [e.clientX - box.left - box.width / 2, e.clientY - box.top - box.width / 2];\n if (this._gauge && y > 0) return this._nameAt(e);\n // A gap belongs to a ring beside it.\n const distance = this._distance(x, y, box.width);\n return this._radii.findIndex((r) => Math.abs(distance - r) <= this._step / 2);\n }\n\n /**\n * How far a point is from the middle in the SVG's 100-unit box. In the\n * top left quarter .labels leaves empty, the names run straight across,\n * so only the height counts and a name picks its own ring.\n */\n private _distance(x: number, y: number, width: number) {\n // Only three-quarter rings leave that quarter empty.\n if (this._span === 0.75 && x < 0 && y < 0) return (-y / width) * 100;\n return (Math.hypot(x, y) / width) * 100;\n }\n\n /** Under a gauge's base line, the ring whose name is under the pointer, or -1. */\n private _nameAt(e: PointerEvent) {\n const name = (e.target as Element).closest('.radial-chart-names > span');\n return name ? [...name.parentElement!.children].indexOf(name) : -1;\n }\n\n /** The rings' turn, from three o'clock to the top or, for a gauge, to nine, and the SVG's box. */\n private get _frame(): [transform: string, viewBox: string] {\n return this._gauge ? ['rotate(180)', '-50 -50 100 50'] : ['rotate(-90)', '-50 -50 100 100'];\n }\n\n /**\n * With .gradient, a ring's fill drawn again in HTML: a conic gradient from\n * a tint of its colour at the ring's start to the full colour where the\n * fill ends, masked to the fill's own dash, so it follows the ring round.\n * An SVG stroke takes no conic gradient.\n */\n private _sweep(r: number, i: number, length: number) {\n const fraction = this._fractions[i];\n if (!fraction || !this.el.classList.contains('gradient')) return null;\n const [transform, viewBox] = this._frame;\n const width = this._width.toFixed(3);\n const dash = this._dash(fraction, length, true);\n const image = `<svg xmlns='http://www.w3.org/2000/svg' viewBox='${viewBox}'><circle r='${r.toFixed(3)}' stroke-width='${width}' transform='${transform}' stroke-dasharray='${dash}' stroke-dashoffset='${(-this._width / 2).toFixed(3)}' stroke-linecap='round' fill='none' stroke='black'/></svg>`;\n const sweep = document.createElement('div');\n sweep.className = 'radial-chart-sweep';\n sweep.dataset.series = seriesColor(i);\n sweep.style.setProperty('--radial-chart-shape', `url(\"data:image/svg+xml,${encodeURIComponent(image)}\")`);\n sweep.style.setProperty('--radial-chart-from', `${this._turn(0)}turn`);\n sweep.style.setProperty('--radial-chart-to', `${fraction * this._span}turn`);\n return sweep;\n }\n\n /**\n * With .labels, each row's name left of its ring's start at the top,\n * ending at the middle line. CSS shrinks the text to fit crowded rings.\n * A gauge's names hang under its base line in a row each, innermost\n * first, starting below their rings' starts.\n */\n private _names(): Element[] {\n if (!this._labeled) return [];\n const count = this._radii.length;\n const names = document.createElement('div');\n names.className = 'radial-chart-names';\n names.style.setProperty('--radial-chart-step', this._step.toFixed(3));\n // The plot leaves room under a gauge for the rows.\n this._plot.style.setProperty('--radial-chart-rows', String(count));\n names.append(...this._radii.map((r, i) => {\n const name = document.createElement('span');\n // The ring's top, or a gauge ring's start along the base line.\n name.style.setProperty('--radial-chart-at', `${(50 - r).toFixed(3)}%`);\n name.style.setProperty('--radial-chart-row', String(count - 1 - i));\n name.textContent = this.labels[i];\n return name;\n }));\n return [names];\n }\n\n /**\n * An SVG of rings in a -50 to 50 box, the top half for a gauge. Each row\n * is a track circle and a fill circle whose dash is its share; CSS draws\n * them from --radial-chart-dash. The total is HTML over it.\n */\n protected _draw(): Element {\n const style = getComputedStyle(this.el);\n const token = (name: string, fallback: number) => {\n const value = parseFloat(style.getPropertyValue(`--md-comp-radial-chart-${name}`));\n return Number.isFinite(value) ? value : fallback;\n };\n const count = this.labels.length;\n let [width, gap] = [Math.max(0, token('thickness', 8)), Math.max(0, token('gap', 2))];\n // Too many rings to leave a middle thin, with their gaps, to fit.\n // ponytail: past about 18 rings they are hairlines; that many values want a bar chart.\n const scale = Math.min(1, (RADIUS * FILL) / (count * width + (count - 1) * gap || 1));\n [width, gap] = [width * scale, gap * scale];\n [this._width, this._gap] = [width, gap];\n this._radii = this.labels.map((_, i) => RADIUS - width / 2 - i * (width + gap));\n // A maximum of zero or less means nothing, so it falls back.\n const max = [parseFloat(this.el.dataset.max ?? ''), this.options.max ?? NaN, 100].find((value) => value > 0)!;\n this._fractions = this.series[0].values.map((value) => this._lit(Math.min(1, Math.max(0, (value ?? 0) / max))));\n\n const [transform, viewBox] = this._frame;\n const svg = node('svg', { viewBox, focusable: 'false' });\n const span = this._span;\n this._sweeps = [];\n this._rings = this._radii.map((r, i) => {\n const length = 2 * Math.PI * r;\n // A capped dash starts half a width in, where its round cap ends.\n const circle = (name: string, fraction: number, capped: boolean) => {\n const ring = node('circle', { class: name, r: r.toFixed(3), transform, 'stroke-width': width.toFixed(3) });\n ring.style.setProperty('--radial-chart-dash', this._dash(fraction, length, capped));\n if (capped) {\n ring.style.setProperty('--radial-chart-offset', (-width / 2).toFixed(3));\n ring.classList.add('capped');\n }\n return ring;\n };\n const ring = circle('radial-chart-ring', this._fractions[i], true) as SVGCircleElement;\n ring.dataset.series = seriesColor(i);\n // An empty ring would still draw its round cap.\n if (!this._fractions[i]) ring.classList.add('empty');\n // Only a track short of a whole circle, or in segments, has ends to round.\n svg.append(circle('radial-chart-track', 1, span < 1 || !!this._segments), ring);\n this._sweeps.push(this._sweep(r, i, length));\n return ring;\n });\n\n const rings = document.createElement('div');\n rings.className = 'radial-chart-rings';\n rings.setAttribute('aria-hidden', 'true');\n rings.style.setProperty('--radial-chart-middle', `${(this._radii[count - 1] - this._width / 2) * 2}%`);\n rings.append(svg, ...this._sweeps.filter((sweep) => sweep !== null), ...this._names());\n\n const total = this._total('radial-chart-total');\n if (total) rings.append(total);\n return rings;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;AAMA,IAAM,SAAS;AAEf,IAAM,OAAO;AAmBN,IAAM,cAAN,cAA0B,UAAU;AAAA,EAazC,IAAc,QAAQ;AACpB,WAAO;AAAA,EACT;AAAA;AAAA,EAGA,IAAc,QAAQ;AACpB,WAAO;AAAA,EACT;AAAA,EAEA,IAAc,UAAU;AACtB,WAAO;AAAA,EACT;AAAA,EAEA,IAAc,YAAY;AACxB,WAAO;AAAA,EACT;AAAA,EAEA,IAAY,SAAS;AACnB,WAAO,KAAK,GAAG,UAAU,SAAS,OAAO;AAAA,EAC3C;AAAA;AAAA,EAGA,IAAY,WAAW;AACrB,UAAM,OAAO,KAAK,GAAG;AACrB,WAAO,KAAK,SAAS,QAAQ,KAAK,CAAC,KAAK,SAAS,WAAW;AAAA,EAC9D;AAAA;AAAA,EAGA,IAAY,QAAQ;AAClB,QAAI,KAAK,OAAQ,QAAO;AACxB,WAAO,KAAK,WAAW,OAAO;AAAA,EAChC;AAAA;AAAA,EAGA,IAAY,YAAY;AACtB,UAAM,WAAW,KAAK,MAAM,KAAK,QAAQ,UAAU,KAAK,CAAC;AACzD,WAAO,WAAW,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,CAAC,CAAC;AACvE,UAAAA,MAAK,UAAU,IAAI,QAAQ;AAAA,QAC7B;AACA,eAAOA;AAAA,MACT;AACA,YAAM,OAAO,OAAO,qBAAqB,KAAK,WAAW,CAAC,GAAG,IAAI;AACjE,WAAK,QAAQ,SAAS,YAAY,CAAC;AAEnC,UAAI,CAAC,KAAK,WAAW,CAAC,EAAG,MAAK,UAAU,IAAI,OAAO;AAEnD,UAAI,OAAO,OAAO,sBAAsB,GAAG,OAAO,KAAK,CAAC,CAAC,KAAK,SAAS,GAAG,IAAI;AAC9E,WAAK,QAAQ,KAAK,KAAK,OAAO,GAAG,GAAG,MAAM,CAAC;AAC3C,aAAO;AAAA,IACT,CAAC;AAED,UAAM,QAAQ,SAAS,cAAc,KAAK;AAC1C,UAAM,YAAY;AAClB,UAAM,aAAa,eAAe,MAAM;AACxC,UAAM,MAAM,YAAY,yBAAyB,IAAI,KAAK,OAAO,QAAQ,CAAC,IAAI,KAAK,SAAS,KAAK,CAAC,GAAG;AACrG,UAAM,OAAO,KAAK,GAAG,KAAK,QAAQ,OAAO,CAAC,UAAU,UAAU,IAAI,GAAG,GAAG,KAAK,OAAO,CAAC;AAErF,UAAM,QAAQ,KAAK,OAAO,oBAAoB;AAC9C,QAAI,MAAO,OAAM,OAAO,KAAK;AAC7B,WAAO;AAAA,EACT;AACF;AAjQa,YAiFJ,MAAM;",
|
|
6
|
+
"names": ["ring"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import {
|
|
2
|
+
LineChart,
|
|
3
|
+
ROW_COLORS,
|
|
4
|
+
percentLabel,
|
|
5
|
+
seriesColor
|
|
6
|
+
} from "./chunk-IQOTGGHX.mjs";
|
|
7
|
+
|
|
8
|
+
// src/ts/components/treemapChart.ts
|
|
9
|
+
var NEXT = ["ArrowRight", "ArrowDown"];
|
|
10
|
+
var PREVIOUS = ["ArrowLeft", "ArrowUp"];
|
|
11
|
+
var sum = (areas) => areas.reduce((total, area) => total + area, 0);
|
|
12
|
+
var flip = ([x, y, width, height]) => [y, x, height, width];
|
|
13
|
+
function worst(areas, side) {
|
|
14
|
+
const [total, squared] = [sum(areas) ** 2, side ** 2];
|
|
15
|
+
return Math.max(...areas.map((area) => Math.max(squared * area / total, total / (squared * area))));
|
|
16
|
+
}
|
|
17
|
+
function strip(areas, free) {
|
|
18
|
+
if (free[2] < free[3]) {
|
|
19
|
+
const [boxes2, rest] = strip(areas, flip(free));
|
|
20
|
+
return [boxes2.map(flip), flip(rest)];
|
|
21
|
+
}
|
|
22
|
+
const [x, y, width, height] = free;
|
|
23
|
+
const across = sum(areas) / height;
|
|
24
|
+
let top = y;
|
|
25
|
+
const boxes = areas.map((area) => {
|
|
26
|
+
const box = [x, top, across, area / across];
|
|
27
|
+
top += area / across;
|
|
28
|
+
return box;
|
|
29
|
+
});
|
|
30
|
+
return [boxes, [x + across, y, width - across, height]];
|
|
31
|
+
}
|
|
32
|
+
function squarify(areas, free) {
|
|
33
|
+
const boxes = [];
|
|
34
|
+
let row = [];
|
|
35
|
+
for (const area of areas) {
|
|
36
|
+
const side = Math.min(free[2], free[3]);
|
|
37
|
+
if (row.length && worst([...row, area], side) > worst(row, side)) {
|
|
38
|
+
const [laid, rest] = strip(row, free);
|
|
39
|
+
boxes.push(...laid);
|
|
40
|
+
[free, row] = [rest, []];
|
|
41
|
+
}
|
|
42
|
+
row.push(area);
|
|
43
|
+
}
|
|
44
|
+
return [...boxes, ...strip(row, free)[0]];
|
|
45
|
+
}
|
|
46
|
+
var inside = ([x, y, width, height], at, down) => at >= x && at < x + width && down >= y && down < y + height;
|
|
47
|
+
var hang = (y, height) => y + height / 2 > 0.5 ? { top: "auto", bottom: `${(1 - y - height) * 100}%` } : { top: `${y * 100}%`, bottom: "auto" };
|
|
48
|
+
var TreemapChart = class extends LineChart {
|
|
49
|
+
get _type() {
|
|
50
|
+
return "treemap-chart";
|
|
51
|
+
}
|
|
52
|
+
/** Area carries the value, so there is no value axis. */
|
|
53
|
+
get _axis() {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
get _points() {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Highlights one row: outlines its rectangle and fills the tooltip, with
|
|
61
|
+
* the row's share. A row with no rectangle passes to the next one with
|
|
62
|
+
* one, as when focus asks for the first row. Pass -1 to hide them.
|
|
63
|
+
*/
|
|
64
|
+
show(index) {
|
|
65
|
+
if (!this._tooltip) return;
|
|
66
|
+
const row = this._drawnFrom(index);
|
|
67
|
+
if (row === this.activeIndex) return;
|
|
68
|
+
this._boxes[this.activeIndex]?.classList.remove("active");
|
|
69
|
+
this._boxes[row]?.classList.add("active");
|
|
70
|
+
super.show(row);
|
|
71
|
+
}
|
|
72
|
+
/** The first row from `index` on with a rectangle, or -1. */
|
|
73
|
+
_drawnFrom(index) {
|
|
74
|
+
return index < 0 ? index : this._boxes.findIndex((box, i) => i >= index && box);
|
|
75
|
+
}
|
|
76
|
+
/** The row's share of the whole, written as the pie chart writes it. */
|
|
77
|
+
_share(row) {
|
|
78
|
+
return percentLabel(this.el, this._values[row] / sum(this._values));
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Opens the tooltip from the middle of the row's rectangle toward the
|
|
82
|
+
* middle of the plot.
|
|
83
|
+
*/
|
|
84
|
+
_place(index) {
|
|
85
|
+
const [x, y, width, height] = this._places[index];
|
|
86
|
+
const middle = x + width / 2;
|
|
87
|
+
const left = this._reversed ? 1 - middle : middle;
|
|
88
|
+
Object.assign(this._tooltip.style, { left: `${left * 100}%`, ...hang(y, height) });
|
|
89
|
+
this._tooltip.classList.toggle("end", left > 0.5);
|
|
90
|
+
}
|
|
91
|
+
/** The row whose rectangle is under the pointer, or -1. */
|
|
92
|
+
_indexAt(e) {
|
|
93
|
+
const box = this._plot.getBoundingClientRect();
|
|
94
|
+
const across = (e.clientX - box.left) / box.width;
|
|
95
|
+
const [at, down] = [this._reversed ? 1 - across : across, (e.clientY - box.top) / box.height];
|
|
96
|
+
return this._places.findIndex((place) => place && inside(place, at, down));
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* The arrows step through the rows with a rectangle in table order, which
|
|
100
|
+
* runs in no one direction on screen, so they do not swap in a
|
|
101
|
+
* right-to-left page. Home and End go to the first and last of them.
|
|
102
|
+
*/
|
|
103
|
+
_keyTarget(key) {
|
|
104
|
+
const drawn = this._boxes.flatMap((box, i) => box ? [i] : []);
|
|
105
|
+
const [at, last] = [drawn.indexOf(this.activeIndex), drawn.length - 1];
|
|
106
|
+
const step = NEXT.includes(key) ? Math.min(at + 1, last) : PREVIOUS.includes(key) ? Math.max(at - 1, 0) : { Home: 0, End: last }[key];
|
|
107
|
+
return step === void 0 ? super._keyTarget(key) : drawn[step];
|
|
108
|
+
}
|
|
109
|
+
destroy() {
|
|
110
|
+
this._sizes?.disconnect();
|
|
111
|
+
super.destroy();
|
|
112
|
+
}
|
|
113
|
+
/** Neither row labels nor a legend: each rectangle carries its name. */
|
|
114
|
+
_guides() {
|
|
115
|
+
return [];
|
|
116
|
+
}
|
|
117
|
+
/** One rectangle per positive row, in table order, placed by _layout(). */
|
|
118
|
+
_draw() {
|
|
119
|
+
this._values = this.series[0].values.map((value) => Math.max(0, value ?? 0));
|
|
120
|
+
const container = document.createElement("div");
|
|
121
|
+
container.className = "treemap-chart-boxes";
|
|
122
|
+
container.setAttribute("aria-hidden", "true");
|
|
123
|
+
let drawn = 0;
|
|
124
|
+
this._boxes = this._values.map((value, i) => {
|
|
125
|
+
if (!value) return null;
|
|
126
|
+
const box = document.createElement("div");
|
|
127
|
+
box.className = "treemap-chart-box";
|
|
128
|
+
box.dataset.series = seriesColor(drawn++, ROW_COLORS);
|
|
129
|
+
const [name, text] = [document.createElement("span"), document.createElement("span")];
|
|
130
|
+
[name.textContent, text.textContent] = [this.labels[i], this.series[0].text[i]];
|
|
131
|
+
box.append(name, text);
|
|
132
|
+
container.append(box);
|
|
133
|
+
return box;
|
|
134
|
+
});
|
|
135
|
+
this.el.append(this._plot);
|
|
136
|
+
this._layout();
|
|
137
|
+
this._sizes?.disconnect();
|
|
138
|
+
this._sizes = new ResizeObserver(() => this._layout());
|
|
139
|
+
this._sizes.observe(this._plot);
|
|
140
|
+
return container;
|
|
141
|
+
}
|
|
142
|
+
/** Squarifies the positive rows, largest first, equal values in table order, and places their rectangles. */
|
|
143
|
+
_layout() {
|
|
144
|
+
if (!this._plot) return this._sizes.disconnect();
|
|
145
|
+
const [width, height] = [this._plot.clientWidth || 1, this._plot.clientHeight || 1];
|
|
146
|
+
const rows = this._values.map((_, i) => i).filter((i) => this._values[i]).sort((a, b) => this._values[b] - this._values[a]);
|
|
147
|
+
const scale = width * height / sum(this._values);
|
|
148
|
+
const laid = squarify(rows.map((i) => this._values[i] * scale), [0, 0, width, height]);
|
|
149
|
+
this._places = [];
|
|
150
|
+
rows.forEach((row, k) => {
|
|
151
|
+
const [x, y, w, h] = laid[k];
|
|
152
|
+
const place = this._places[row] = [x / width, y / height, w / width, h / height];
|
|
153
|
+
Object.assign(this._boxes[row].style, {
|
|
154
|
+
insetInlineStart: `${place[0] * 100}%`,
|
|
155
|
+
top: `${place[1] * 100}%`,
|
|
156
|
+
width: `${place[2] * 100}%`,
|
|
157
|
+
height: `${place[3] * 100}%`
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
TreemapChart.key = "Expressive_TreemapChart";
|
|
163
|
+
|
|
164
|
+
export {
|
|
165
|
+
TreemapChart
|
|
166
|
+
};
|
|
167
|
+
//# sourceMappingURL=chunk-UKQK5GWR.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/ts/components/treemapChart.ts"],
|
|
4
|
+
"sourcesContent": ["import { LineChart, LineChartOptions, ROW_COLORS, percentLabel, seriesColor } from './lineChart';\n\nexport type TreemapChartOptions = LineChartOptions;\n\n/** A rectangle: its inline start, top, width and height. */\ntype Box = [x: number, y: number, width: number, height: number];\n\n// ponytail: rows past six repeat the colors, so neighbours can match.\n/** The keys that move to the next row and to the one before, in any direction. */\nconst NEXT = ['ArrowRight', 'ArrowDown'];\nconst PREVIOUS = ['ArrowLeft', 'ArrowUp'];\n\nconst sum = (areas: number[]) => areas.reduce((total, area) => total + area, 0);\n\n/** The box with its axes swapped, so one strip routine lays out both ways. */\nconst flip = ([x, y, width, height]: Box): Box => [y, x, height, width];\n\n/** How far the least square of `areas` is from square, in a strip along a side `side` long. */\nfunction worst(areas: number[], side: number) {\n const [total, squared] = [sum(areas) ** 2, side ** 2];\n return Math.max(...areas.map((area) => Math.max((squared * area) / total, total / (squared * area))));\n}\n\n/**\n * Lays `areas` out as one strip down the inline start of `free`, or across\n * its top when it is taller than wide, in order, and returns their boxes and\n * the space left beside the strip.\n */\nfunction strip(areas: number[], free: Box): [Box[], Box] {\n if (free[2] < free[3]) {\n const [boxes, rest] = strip(areas, flip(free));\n return [boxes.map(flip), flip(rest)];\n }\n const [x, y, width, height] = free;\n const across = sum(areas) / height;\n let top = y;\n const boxes = areas.map((area): Box => {\n const box: Box = [x, top, across, area / across];\n top += area / across;\n return box;\n });\n return [boxes, [x + across, y, width - across, height]];\n}\n\n/**\n * The squarified treemap of Bruls, Huizing and van Wijk: `areas`, largest\n * first and adding up to the free box's area, each join the current strip\n * while that keeps its rectangles nearer square, and the strip is laid down\n * when it would not.\n */\nfunction squarify(areas: number[], free: Box): Box[] {\n const boxes: Box[] = [];\n let row: number[] = [];\n for (const area of areas) {\n const side = Math.min(free[2], free[3]);\n if (row.length && worst([...row, area], side) > worst(row, side)) {\n const [laid, rest] = strip(row, free);\n boxes.push(...laid);\n [free, row] = [rest, []];\n }\n row.push(area);\n }\n return [...boxes, ...strip(row, free)[0]];\n}\n\n/** Whether a point, as fractions of the plot, lies in a box. */\nconst inside = ([x, y, width, height]: Box, at: number, down: number) =>\n at >= x && at < x + width && down >= y && down < y + height;\n\n/**\n * The tooltip's top or bottom for a box: from its top in the plot's upper\n * half, and up from its bottom in the lower half, so it stays in the plot.\n */\nconst hang = (y: number, height: number) => (y + height / 2 > 0.5\n ? { top: 'auto', bottom: `${(1 - y - height) * 100}%` }\n : { top: `${y * 100}%`, bottom: 'auto' });\n\n/**\n * Treemap chart. It reads its <table> like LineChart, but draws each row of\n * the first value column as a rectangle whose area is its share of the\n * whole, filling the plot, the largest at the top inline-start corner. Rows\n * with no positive value draw nothing. Further columns show in the tooltip.\n *\n * Call `update()` after changing the table, or start it with `watch` or\n * `data-watch`.\n */\nexport class TreemapChart extends LineChart {\n // No initializers: LineChart's constructor draws before they would run.\n /** Each row's positive value, or 0 for a row with no rectangle. */\n private _values: number[];\n /** Each row's rectangle, or null. */\n private _boxes: (HTMLElement | null)[];\n /** Each drawn row's place as fractions of the plot. */\n private _places: Box[];\n /** Lays the rectangles out again when the plot changes shape. */\n private _sizes: ResizeObserver;\n\n protected get _type() {\n return 'treemap-chart';\n }\n\n /** Area carries the value, so there is no value axis. */\n protected get _axis() {\n return false;\n }\n\n protected get _points() {\n return false;\n }\n\n static key = 'Expressive_TreemapChart';\n\n /**\n * Highlights one row: outlines its rectangle and fills the tooltip, with\n * the row's share. A row with no rectangle passes to the next one with\n * one, as when focus asks for the first row. Pass -1 to hide them.\n */\n show(index: number) {\n if (!this._tooltip) return;\n const row = this._drawnFrom(index);\n if (row === this.activeIndex) return;\n this._boxes[this.activeIndex]?.classList.remove('active');\n this._boxes[row]?.classList.add('active');\n super.show(row);\n }\n\n /** The first row from `index` on with a rectangle, or -1. */\n private _drawnFrom(index: number) {\n return index < 0 ? index : this._boxes.findIndex((box, i) => i >= index && box);\n }\n\n /** The row's share of the whole, written as the pie chart writes it. */\n protected _share(row: number) {\n return percentLabel(this.el, this._values[row] / sum(this._values));\n }\n\n /**\n * Opens the tooltip from the middle of the row's rectangle toward the\n * middle of the plot.\n */\n protected _place(index: number) {\n const [x, y, width, height] = this._places[index];\n const middle = x + width / 2;\n const left = this._reversed ? 1 - middle : middle;\n Object.assign(this._tooltip.style, { left: `${left * 100}%`, ...hang(y, height) });\n this._tooltip.classList.toggle('end', left > 0.5);\n }\n\n /** The row whose rectangle is under the pointer, or -1. */\n protected _indexAt(e: PointerEvent) {\n const box = this._plot.getBoundingClientRect();\n const across = (e.clientX - box.left) / box.width;\n const [at, down] = [this._reversed ? 1 - across : across, (e.clientY - box.top) / box.height];\n return this._places.findIndex((place) => place && inside(place, at, down));\n }\n\n /**\n * The arrows step through the rows with a rectangle in table order, which\n * runs in no one direction on screen, so they do not swap in a\n * right-to-left page. Home and End go to the first and last of them.\n */\n protected _keyTarget(key: string): number | undefined {\n const drawn = this._boxes.flatMap((box, i) => (box ? [i] : []));\n const [at, last] = [drawn.indexOf(this.activeIndex), drawn.length - 1];\n const step = NEXT.includes(key) ? Math.min(at + 1, last)\n : PREVIOUS.includes(key) ? Math.max(at - 1, 0)\n : ({ Home: 0, End: last } as Record<string, number>)[key];\n return step === undefined ? super._keyTarget(key) : drawn[step];\n }\n\n destroy() {\n this._sizes?.disconnect();\n super.destroy();\n }\n\n /** Neither row labels nor a legend: each rectangle carries its name. */\n protected _guides(): Element[] {\n return [];\n }\n\n /** One rectangle per positive row, in table order, placed by _layout(). */\n protected _draw(): Element {\n this._values = this.series[0].values.map((value) => Math.max(0, value ?? 0));\n const container = document.createElement('div');\n container.className = 'treemap-chart-boxes';\n container.setAttribute('aria-hidden', 'true');\n let drawn = 0;\n this._boxes = this._values.map((value, i) => {\n if (!value) return null;\n const box = document.createElement('div');\n box.className = 'treemap-chart-box';\n box.dataset.series = seriesColor(drawn++, ROW_COLORS);\n const [name, text] = [document.createElement('span'), document.createElement('span')];\n [name.textContent, text.textContent] = [this.labels[i], this.series[0].text[i]];\n box.append(name, text);\n container.append(box);\n return box;\n });\n // The squares depend on the plot's shape, so it goes in the page to be measured.\n this.el.append(this._plot);\n this._layout();\n this._sizes?.disconnect();\n this._sizes = new ResizeObserver(() => this._layout());\n this._sizes.observe(this._plot);\n return container;\n }\n\n /** Squarifies the positive rows, largest first, equal values in table order, and places their rectangles. */\n private _layout() {\n // update() with no rows drops the plot without drawing a new one, but\n // the old plot's observer still fires as that plot leaves the page.\n if (!this._plot) return this._sizes.disconnect();\n // A hidden plot has no size; lay it out as a square until it shows.\n const [width, height] = [this._plot.clientWidth || 1, this._plot.clientHeight || 1];\n const rows = this._values.map((_, i) => i).filter((i) => this._values[i]).sort((a, b) => this._values[b] - this._values[a]);\n const scale = (width * height) / sum(this._values);\n const laid = squarify(rows.map((i) => this._values[i] * scale), [0, 0, width, height]);\n this._places = [];\n rows.forEach((row, k) => {\n const [x, y, w, h] = laid[k];\n const place = (this._places[row] = [x / width, y / height, w / width, h / height]);\n Object.assign(this._boxes[row]!.style, {\n insetInlineStart: `${place[0] * 100}%`,\n top: `${place[1] * 100}%`,\n width: `${place[2] * 100}%`,\n height: `${place[3] * 100}%`\n });\n });\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AASA,IAAM,OAAO,CAAC,cAAc,WAAW;AACvC,IAAM,WAAW,CAAC,aAAa,SAAS;AAExC,IAAM,MAAM,CAAC,UAAoB,MAAM,OAAO,CAAC,OAAO,SAAS,QAAQ,MAAM,CAAC;AAG9E,IAAM,OAAO,CAAC,CAAC,GAAG,GAAG,OAAO,MAAM,MAAgB,CAAC,GAAG,GAAG,QAAQ,KAAK;AAGtE,SAAS,MAAM,OAAiB,MAAc;AAC5C,QAAM,CAAC,OAAO,OAAO,IAAI,CAAC,IAAI,KAAK,KAAK,GAAG,QAAQ,CAAC;AACpD,SAAO,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC,SAAS,KAAK,IAAK,UAAU,OAAQ,OAAO,SAAS,UAAU,KAAK,CAAC,CAAC;AACtG;AAOA,SAAS,MAAM,OAAiB,MAAyB;AACvD,MAAI,KAAK,CAAC,IAAI,KAAK,CAAC,GAAG;AACrB,UAAM,CAACA,QAAO,IAAI,IAAI,MAAM,OA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,IAAI,QAAQ,IAAI,OAAO,IAAI,MAAM;AAChF,aAAO,OAAO,KAAK,OAAO,GAAG,EAAG,OAAO;AAAA,QACrC,kBAAkB,GAAG,MAAM,CAAC,IAAI,GAAG;AAAA,QACnC,KAAK,GAAG,MAAM,CAAC,IAAI,GAAG;AAAA,QACtB,OAAO,GAAG,MAAM,CAAC,IAAI,GAAG;AAAA,QACxB,QAAQ,GAAG,MAAM,CAAC,IAAI,GAAG;AAAA,MAC3B,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;AA/Ia,aAwBJ,MAAM;",
|
|
6
|
+
"names": ["boxes"]
|
|
7
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Utils
|
|
3
|
-
} from "./chunk-M372EDXD.mjs";
|
|
4
1
|
import {
|
|
5
2
|
Component
|
|
6
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EB2V4OKL.mjs";
|
|
4
|
+
import {
|
|
5
|
+
Utils,
|
|
6
|
+
restoreAttribute
|
|
7
|
+
} from "./chunk-67UNY7RH.mjs";
|
|
7
8
|
|
|
8
9
|
// src/ts/components/cards.ts
|
|
9
10
|
var _defaults = {
|
|
@@ -17,7 +18,7 @@ function hasAccessibleName(trigger) {
|
|
|
17
18
|
if (label?.trim()) return true;
|
|
18
19
|
const labelledBy = trigger.getAttribute("aria-labelledby");
|
|
19
20
|
if (labelledBy) {
|
|
20
|
-
const referencedText = labelledBy.trim().split(/\s+/).map((id) =>
|
|
21
|
+
const referencedText = labelledBy.trim().split(/\s+/).map((id) => Utils.getElementById(trigger, id)?.textContent ?? "").join(" ").trim();
|
|
21
22
|
if (referencedText) return true;
|
|
22
23
|
}
|
|
23
24
|
const content = trigger.cloneNode(true);
|
|
@@ -35,24 +36,17 @@ function isCardReveal(el) {
|
|
|
35
36
|
el.querySelectorAll('button.card-reveal-trigger[type="button"]')
|
|
36
37
|
).some((trigger) => isUsableCardTrigger(trigger, el, panels[0]));
|
|
37
38
|
}
|
|
38
|
-
var
|
|
39
|
+
var _Cards = class _Cards extends Component {
|
|
39
40
|
constructor(el, options = {}) {
|
|
40
|
-
super(el, options
|
|
41
|
+
super(el, options);
|
|
41
42
|
this.isOpen = false;
|
|
42
43
|
this._ownsRevealInitializedClass = false;
|
|
43
44
|
this._initialAriaControls = /* @__PURE__ */ new Map();
|
|
44
45
|
this._lastActivator = null;
|
|
45
46
|
this._setupEventHandlers = () => {
|
|
46
|
-
this.
|
|
47
|
-
|
|
48
|
-
});
|
|
49
|
-
this.el.addEventListener("keydown", this._handleKeydownEvent);
|
|
50
|
-
};
|
|
51
|
-
this._removeEventHandlers = () => {
|
|
52
|
-
this._activators.forEach((activator) => {
|
|
53
|
-
activator.removeEventListener("click", this._handleClickInteraction);
|
|
54
|
-
});
|
|
55
|
-
this.el.removeEventListener("keydown", this._handleKeydownEvent);
|
|
47
|
+
const { signal } = this._events;
|
|
48
|
+
this._activators.forEach((activator) => activator.addEventListener("click", this._handleClickInteraction, { signal }));
|
|
49
|
+
this.el.addEventListener("keydown", this._handleKeydownEvent, { signal });
|
|
56
50
|
};
|
|
57
51
|
this._handleClickInteraction = (event) => {
|
|
58
52
|
this._lastActivator = event.currentTarget;
|
|
@@ -77,32 +71,24 @@ var Cards = class _Cards extends Component {
|
|
|
77
71
|
this.cardReveal.classList.add("open");
|
|
78
72
|
this.cardReveal.inert = false;
|
|
79
73
|
this._activators.forEach((activator) => activator.ariaExpanded = "true");
|
|
80
|
-
|
|
81
|
-
this.options.onOpen.call(this, this.el);
|
|
82
|
-
}
|
|
74
|
+
this._notify("open", this.options.onOpen, { current: () => this.isOpen });
|
|
83
75
|
};
|
|
84
76
|
/**
|
|
85
77
|
* Hide card reveal.
|
|
86
78
|
*/
|
|
87
79
|
this.close = () => {
|
|
88
80
|
if (!this.isOpen || !this.cardReveal) return;
|
|
89
|
-
const
|
|
81
|
+
const focused = this.el.getRootNode().activeElement;
|
|
82
|
+
const focusWasInside = this.cardReveal.contains(focused);
|
|
90
83
|
this.isOpen = false;
|
|
91
84
|
this.cardReveal.classList.remove("open");
|
|
92
85
|
this.cardReveal.inert = true;
|
|
93
86
|
this._activators.forEach((activator) => activator.ariaExpanded = "false");
|
|
94
|
-
|
|
95
|
-
this.options.onClose.call(this, this.el);
|
|
96
|
-
}
|
|
87
|
+
this._notify("close", this.options.onClose, { current: () => !this.isOpen });
|
|
97
88
|
if (focusWasInside) {
|
|
98
89
|
(this._lastActivator ?? this._activators[0])?.focus();
|
|
99
90
|
}
|
|
100
91
|
};
|
|
101
|
-
this.el["Expressive_Cards"] = this;
|
|
102
|
-
this.options = {
|
|
103
|
-
..._Cards.defaults,
|
|
104
|
-
...options
|
|
105
|
-
};
|
|
106
92
|
const cardReveals = this.el.querySelectorAll(":scope > aside");
|
|
107
93
|
const cardReveal = cardReveals.length === 1 ? cardReveals[0] : null;
|
|
108
94
|
const activators = cardReveal ? Array.from(
|
|
@@ -130,22 +116,10 @@ var Cards = class _Cards extends Component {
|
|
|
130
116
|
static get defaults() {
|
|
131
117
|
return _defaults;
|
|
132
118
|
}
|
|
133
|
-
/**
|
|
134
|
-
* Initializes instances of Cards.
|
|
135
|
-
* @param els HTML elements.
|
|
136
|
-
* @param options Component options.
|
|
137
|
-
*/
|
|
138
|
-
static init(els, options) {
|
|
139
|
-
return super.init(els, options, _Cards);
|
|
140
|
-
}
|
|
141
|
-
static getInstance(el) {
|
|
142
|
-
return el["Expressive_Cards"];
|
|
143
|
-
}
|
|
144
119
|
/**
|
|
145
120
|
* {@inheritDoc}
|
|
146
121
|
*/
|
|
147
122
|
destroy() {
|
|
148
|
-
this._removeEventHandlers();
|
|
149
123
|
if (this.cardReveal) {
|
|
150
124
|
this.cardReveal.classList.remove("open");
|
|
151
125
|
this.cardReveal.inert = false;
|
|
@@ -154,30 +128,29 @@ var Cards = class _Cards extends Component {
|
|
|
154
128
|
this._activators.forEach((activator) => {
|
|
155
129
|
activator.removeAttribute("aria-expanded");
|
|
156
130
|
const initialAriaControls = this._initialAriaControls.get(activator);
|
|
157
|
-
if (initialAriaControls
|
|
158
|
-
else if (initialAriaControls !== void 0) {
|
|
159
|
-
activator.setAttribute("aria-controls", initialAriaControls);
|
|
160
|
-
}
|
|
131
|
+
if (initialAriaControls !== void 0) restoreAttribute(activator, "aria-controls", initialAriaControls);
|
|
161
132
|
});
|
|
162
133
|
this.isOpen = false;
|
|
163
134
|
this._activators = [];
|
|
164
135
|
this._initialAriaControls.clear();
|
|
165
136
|
this._lastActivator = null;
|
|
166
|
-
|
|
137
|
+
super.destroy();
|
|
167
138
|
}
|
|
168
139
|
static Init() {
|
|
169
140
|
Utils.onDocumentReady(() => {
|
|
170
141
|
const cards = Array.from(document.querySelectorAll(CARDS_SELECTOR)).filter(isCardReveal);
|
|
171
142
|
cards.forEach((el) => {
|
|
172
|
-
if (el
|
|
143
|
+
if (!_Cards.getInstance(el)) this.init(el);
|
|
173
144
|
});
|
|
174
145
|
});
|
|
175
146
|
}
|
|
176
147
|
};
|
|
148
|
+
_Cards.key = "Expressive_Cards";
|
|
149
|
+
var Cards = _Cards;
|
|
177
150
|
|
|
178
151
|
export {
|
|
179
152
|
CARDS_SELECTOR,
|
|
180
153
|
isCardReveal,
|
|
181
154
|
Cards
|
|
182
155
|
};
|
|
183
|
-
//# sourceMappingURL=chunk-
|
|
156
|
+
//# sourceMappingURL=chunk-UTSLYQ65.mjs.map
|