@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
|
@@ -1,16 +1,17 @@
|
|
|
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
|
+
afterFormReset
|
|
7
|
+
} from "./chunk-67UNY7RH.mjs";
|
|
7
8
|
|
|
8
9
|
// src/ts/components/slider.ts
|
|
9
10
|
var _defaults = {};
|
|
10
11
|
var _authored = /* @__PURE__ */ new WeakMap();
|
|
11
|
-
var
|
|
12
|
+
var _Slider = class _Slider extends Component {
|
|
12
13
|
constructor(el, options) {
|
|
13
|
-
super(el, options
|
|
14
|
+
super(el, options);
|
|
14
15
|
this._resizeObserver = null;
|
|
15
16
|
this._handleRangeChange = () => {
|
|
16
17
|
this._clampDual();
|
|
@@ -41,45 +42,27 @@ var Slider = class _Slider extends Component {
|
|
|
41
42
|
this.thumb.classList.remove("active");
|
|
42
43
|
}
|
|
43
44
|
};
|
|
44
|
-
this.el["Expressive_Slider"] = this;
|
|
45
|
-
this.options = {
|
|
46
|
-
..._Slider.defaults,
|
|
47
|
-
...options
|
|
48
|
-
};
|
|
49
45
|
this._pointerDown = false;
|
|
50
46
|
this._setupThumb();
|
|
51
47
|
this._sync();
|
|
52
48
|
this._setupEventHandlers();
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
49
|
+
this._resizeObserver = new ResizeObserver(() => this._sync());
|
|
50
|
+
this._resizeObserver.observe(this.el);
|
|
51
|
+
if (this.el.parentElement) this._resizeObserver.observe(this.el.parentElement);
|
|
57
52
|
}
|
|
58
53
|
static get defaults() {
|
|
59
54
|
return _defaults;
|
|
60
55
|
}
|
|
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
56
|
destroy() {
|
|
73
57
|
this._resizeObserver?.disconnect();
|
|
74
|
-
this._removeEventHandlers();
|
|
75
58
|
this._removeThumb();
|
|
76
|
-
|
|
59
|
+
super.destroy();
|
|
77
60
|
const host = this._host();
|
|
78
61
|
for (const el of [this.el, host]) {
|
|
79
62
|
for (const name in _authored.get(el)) el.style.setProperty(name, _authored.get(el)[name]);
|
|
80
63
|
_authored.delete(el);
|
|
81
64
|
}
|
|
82
|
-
host?.querySelectorAll('input[type="range"]').forEach((el) => el
|
|
65
|
+
host?.querySelectorAll('input[type="range"]').forEach((el) => _Slider.getInstance(el)?._sync());
|
|
83
66
|
}
|
|
84
67
|
_set(el, name, value) {
|
|
85
68
|
const authored = _authored.get(el) ?? {};
|
|
@@ -91,22 +74,15 @@ var Slider = class _Slider extends Component {
|
|
|
91
74
|
// twice - once for mouse, once for touch. One of the touch spellings,
|
|
92
75
|
// `touchleave`, was never implemented by any browser at all.
|
|
93
76
|
_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);
|
|
77
|
+
const { signal } = this._events;
|
|
78
|
+
this.el.addEventListener("change", this._handleRangeChange, { signal });
|
|
79
|
+
this.el.addEventListener("pointerdown", this._handleRangePointerDown, { signal });
|
|
80
|
+
this.el.addEventListener("input", this._handleRangeInput, { signal });
|
|
81
|
+
this.el.addEventListener("pointerup", this._handleRangePointerUp, { signal });
|
|
82
|
+
this.el.addEventListener("pointercancel", this._handleRangePointerUp, { signal });
|
|
83
|
+
this.el.addEventListener("blur", this._handleRangeRelease, { signal });
|
|
84
|
+
this.el.addEventListener("mouseout", this._handleRangeRelease, { signal });
|
|
85
|
+
afterFormReset(this.el, () => this._sync(), signal);
|
|
110
86
|
}
|
|
111
87
|
_setupThumb() {
|
|
112
88
|
this.thumb = document.createElement("span");
|
|
@@ -123,7 +99,7 @@ var Slider = class _Slider extends Component {
|
|
|
123
99
|
return !!this.el.closest(".vertical");
|
|
124
100
|
}
|
|
125
101
|
_host() {
|
|
126
|
-
return this.el.closest(".slider,
|
|
102
|
+
return this.el.closest(".slider, label");
|
|
127
103
|
}
|
|
128
104
|
_clampDual() {
|
|
129
105
|
const host = this._host();
|
|
@@ -193,12 +169,14 @@ var Slider = class _Slider extends Component {
|
|
|
193
169
|
*/
|
|
194
170
|
static Init() {
|
|
195
171
|
Utils.onDocumentReady(() => {
|
|
196
|
-
_Slider.init(document.querySelectorAll("input[type=range]"));
|
|
172
|
+
_Slider.init(document.querySelectorAll("input[type=range]:not(.image-compare > input, .color-picker-hue)"));
|
|
197
173
|
});
|
|
198
174
|
}
|
|
199
175
|
};
|
|
176
|
+
_Slider.key = "Expressive_Slider";
|
|
177
|
+
var Slider = _Slider;
|
|
200
178
|
|
|
201
179
|
export {
|
|
202
180
|
Slider
|
|
203
181
|
};
|
|
204
|
-
//# sourceMappingURL=chunk-
|
|
182
|
+
//# sourceMappingURL=chunk-SYBOA5HC.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, afterFormReset } 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) => Slider.getInstance(el)?._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 afterFormReset(this.el, () => this._sync(), signal);\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,Q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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;AA7Na,QAyBJ,MAAM;AAzBR,IAAM,SAAN;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Utils,
|
|
3
|
+
controllerFor
|
|
4
|
+
} from "./chunk-67UNY7RH.mjs";
|
|
5
|
+
|
|
6
|
+
// src/ts/behaviors/sortable.ts
|
|
7
|
+
var itemSelector = ".sortable > li";
|
|
8
|
+
var _Sortable = class _Sortable {
|
|
9
|
+
// A second Init adds nothing: addEventListener ignores a listener it has.
|
|
10
|
+
static Init() {
|
|
11
|
+
if (typeof document === "undefined") return;
|
|
12
|
+
document.addEventListener("click", _Sortable._onClick);
|
|
13
|
+
document.addEventListener("pointerdown", _Sortable._onPointerDown);
|
|
14
|
+
}
|
|
15
|
+
/** Moves an item to a zero-based position in its list, then announces it and fires `change`. */
|
|
16
|
+
static move(item, to) {
|
|
17
|
+
const list = item.parentElement;
|
|
18
|
+
const items = [...list.children];
|
|
19
|
+
const from = items.indexOf(item);
|
|
20
|
+
to = Math.min(Math.max(to, 0), items.length - 1);
|
|
21
|
+
if (to === from) return;
|
|
22
|
+
const active = item.getRootNode().activeElement;
|
|
23
|
+
const focused = item.contains(active) ? active : null;
|
|
24
|
+
list.insertBefore(item, items[to > from ? to + 1 : to] ?? null);
|
|
25
|
+
focused?.focus();
|
|
26
|
+
_Sortable._done(list, item, from, to);
|
|
27
|
+
}
|
|
28
|
+
static _done(list, item, from, to) {
|
|
29
|
+
let region = _Sortable._regions.get(list);
|
|
30
|
+
if (!region) {
|
|
31
|
+
region = document.createElement("div");
|
|
32
|
+
region.className = "visually-hidden";
|
|
33
|
+
region.setAttribute("aria-live", "polite");
|
|
34
|
+
list.after(region);
|
|
35
|
+
_Sortable._regions.set(list, region);
|
|
36
|
+
}
|
|
37
|
+
region.textContent = _Sortable.i18n.moved.replace("{position}", String(to + 1)).replace("{total}", String(list.children.length));
|
|
38
|
+
list.dispatchEvent(new CustomEvent("change", { bubbles: true, detail: { item, from, to } }));
|
|
39
|
+
}
|
|
40
|
+
static _onClick(e) {
|
|
41
|
+
const button = Utils.closestInPath(e, "[data-move]");
|
|
42
|
+
const item = button?.closest(itemSelector);
|
|
43
|
+
if (!item || button.matches(':disabled, [aria-disabled="true"]')) return;
|
|
44
|
+
const index = [...item.parentElement.children].indexOf(item);
|
|
45
|
+
const direction = button.getAttribute("data-move");
|
|
46
|
+
if (direction === "up") _Sortable.move(item, index - 1);
|
|
47
|
+
else if (direction === "down") _Sortable.move(item, index + 1);
|
|
48
|
+
}
|
|
49
|
+
static _onPointerDown(e) {
|
|
50
|
+
const handle = Utils.closestInPath(e, ".drag-handle");
|
|
51
|
+
const item = handle?.closest(itemSelector);
|
|
52
|
+
if (!item || e.button !== 0 || _Sortable._drag) return;
|
|
53
|
+
e.preventDefault();
|
|
54
|
+
const list = item.parentElement;
|
|
55
|
+
const events = controllerFor(item);
|
|
56
|
+
_Sortable._drag = { item, list, from: [...list.children].indexOf(item), pointerId: e.pointerId, events };
|
|
57
|
+
item.classList.add("dragged");
|
|
58
|
+
const { signal } = events;
|
|
59
|
+
document.addEventListener("pointermove", _Sortable._onPointerMove, { signal });
|
|
60
|
+
document.addEventListener("pointerup", _Sortable._onPointerEnd, { signal });
|
|
61
|
+
document.addEventListener("pointercancel", _Sortable._onPointerEnd, { signal });
|
|
62
|
+
document.addEventListener("keydown", _Sortable._onKeyDown, { signal });
|
|
63
|
+
}
|
|
64
|
+
static _onPointerMove(e) {
|
|
65
|
+
const drag = _Sortable._drag;
|
|
66
|
+
if (!drag || e.pointerId !== drag.pointerId) return;
|
|
67
|
+
const previous = drag.item.previousElementSibling;
|
|
68
|
+
const next = drag.item.nextElementSibling;
|
|
69
|
+
const middle = (el) => {
|
|
70
|
+
const rect = el.getBoundingClientRect();
|
|
71
|
+
return rect.top + rect.height / 2;
|
|
72
|
+
};
|
|
73
|
+
if (previous && e.clientY < middle(previous)) drag.list.insertBefore(drag.item, previous);
|
|
74
|
+
else if (next && e.clientY > middle(next)) drag.list.insertBefore(drag.item, next.nextElementSibling);
|
|
75
|
+
}
|
|
76
|
+
static _onPointerEnd(e) {
|
|
77
|
+
if (e.pointerId === _Sortable._drag?.pointerId) _Sortable._finish(e.type === "pointercancel");
|
|
78
|
+
}
|
|
79
|
+
// Listening only while a drag is active. preventDefault keeps the Escape
|
|
80
|
+
// from also closing a modal <dialog> the list sits in.
|
|
81
|
+
static _onKeyDown(e) {
|
|
82
|
+
if (e.key !== "Escape") return;
|
|
83
|
+
e.preventDefault();
|
|
84
|
+
_Sortable._finish(true);
|
|
85
|
+
}
|
|
86
|
+
static _finish(cancel) {
|
|
87
|
+
const drag = _Sortable._drag;
|
|
88
|
+
if (!drag) return;
|
|
89
|
+
_Sortable._drag = null;
|
|
90
|
+
drag.events.abort();
|
|
91
|
+
drag.item.classList.remove("dragged");
|
|
92
|
+
const to = [...drag.list.children].indexOf(drag.item);
|
|
93
|
+
if (cancel) {
|
|
94
|
+
drag.list.insertBefore(drag.item, drag.list.children[drag.from > to ? drag.from + 1 : drag.from] ?? null);
|
|
95
|
+
} else if (to !== drag.from) {
|
|
96
|
+
_Sortable._done(drag.list, drag.item, drag.from, to);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
_Sortable.i18n = { moved: "Moved to position {position} of {total}" };
|
|
101
|
+
_Sortable._drag = null;
|
|
102
|
+
_Sortable._regions = /* @__PURE__ */ new WeakMap();
|
|
103
|
+
var Sortable = _Sortable;
|
|
104
|
+
|
|
105
|
+
export {
|
|
106
|
+
Sortable
|
|
107
|
+
};
|
|
108
|
+
//# sourceMappingURL=chunk-T4MOBP3J.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/ts/behaviors/sortable.ts"],
|
|
4
|
+
"sourcesContent": ["import { Utils, controllerFor } from '../core/utils';\n\nconst itemSelector = '.sortable > li';\n\ninterface Drag {\n item: HTMLElement;\n list: HTMLElement;\n from: number;\n pointerId: number;\n /** Removes the document listeners of this drag. */\n events: AbortController;\n}\n\n/**\n * Sortable lists. In a `.sortable` list, an item moves by dragging its\n * `.drag-handle`, or with a `[data-move=\"up\"]` or `[data-move=\"down\"]` button\n * inside it. The buttons are the keyboard path and the single-pointer\n * alternative to dragging, so every sortable list needs them; they can sit in\n * the row or in a menu. Escape during a drag puts the item back.\n *\n * After each move the list fires a bubbling `change` event whose `detail`\n * holds `{ item, from, to }` (zero-based), and a polite live region beside the\n * list announces the new position. `Sortable.i18n.moved` holds that text.\n */\nexport class Sortable {\n static i18n = { moved: 'Moved to position {position} of {total}' };\n private static _drag: Drag | null = null;\n private static _regions = new WeakMap<HTMLElement, HTMLElement>();\n\n // A second Init adds nothing: addEventListener ignores a listener it has.\n static Init() {\n if (typeof document === 'undefined') return;\n document.addEventListener('click', Sortable._onClick);\n document.addEventListener('pointerdown', Sortable._onPointerDown);\n }\n\n /** Moves an item to a zero-based position in its list, then announces it and fires `change`. */\n static move(item: HTMLElement, to: number) {\n const list = item.parentElement;\n const items = [...list.children] as HTMLElement[];\n const from = items.indexOf(item);\n to = Math.min(Math.max(to, 0), items.length - 1);\n if (to === from) return;\n // Moving a node drops focus from inside it, so it is put back after.\n const active = (item.getRootNode() as Document | ShadowRoot).activeElement;\n const focused = item.contains(active) ? (active as HTMLElement) : null;\n list.insertBefore(item, items[to > from ? to + 1 : to] ?? null);\n focused?.focus();\n Sortable._done(list, item, from, to);\n }\n\n private static _done(list: HTMLElement, item: HTMLElement, from: number, to: number) {\n let region = Sortable._regions.get(list);\n if (!region) {\n region = document.createElement('div');\n region.className = 'visually-hidden';\n region.setAttribute('aria-live', 'polite');\n list.after(region);\n Sortable._regions.set(list, region);\n }\n region.textContent = Sortable.i18n.moved\n .replace('{position}', String(to + 1))\n .replace('{total}', String(list.children.length));\n list.dispatchEvent(new CustomEvent('change', { bubbles: true, detail: { item, from, to } }));\n }\n\n private static _onClick(e: MouseEvent) {\n const button = Utils.closestInPath(e, '[data-move]');\n const item = button?.closest<HTMLElement>(itemSelector);\n if (!item || button.matches(':disabled, [aria-disabled=\"true\"]')) return;\n const index = [...item.parentElement.children].indexOf(item);\n const direction = button.getAttribute('data-move');\n if (direction === 'up') Sortable.move(item, index - 1);\n else if (direction === 'down') Sortable.move(item, index + 1);\n }\n\n private static _onPointerDown(e: PointerEvent) {\n const handle = Utils.closestInPath(e, '.drag-handle');\n const item = handle?.closest<HTMLElement>(itemSelector);\n if (!item || e.button !== 0 || Sortable._drag) return;\n e.preventDefault();\n const list = item.parentElement;\n const events = controllerFor(item);\n Sortable._drag = { item, list, from: [...list.children].indexOf(item), pointerId: e.pointerId, events };\n item.classList.add('dragged');\n // On the document, not the handle: each swap moves the item in the DOM,\n // which releases any pointer capture the handle held.\n const { signal } = events;\n document.addEventListener('pointermove', Sortable._onPointerMove, { signal });\n document.addEventListener('pointerup', Sortable._onPointerEnd, { signal });\n document.addEventListener('pointercancel', Sortable._onPointerEnd, { signal });\n document.addEventListener('keydown', Sortable._onKeyDown, { signal });\n }\n\n private static _onPointerMove(e: PointerEvent) {\n const drag = Sortable._drag;\n if (!drag || e.pointerId !== drag.pointerId) return;\n // Swap with a neighbour once the pointer passes its middle.\n const previous = drag.item.previousElementSibling;\n const next = drag.item.nextElementSibling;\n const middle = (el: Element) => {\n const rect = el.getBoundingClientRect();\n return rect.top + rect.height / 2;\n };\n if (previous && e.clientY < middle(previous)) drag.list.insertBefore(drag.item, previous);\n else if (next && e.clientY > middle(next)) drag.list.insertBefore(drag.item, next.nextElementSibling);\n }\n\n private static _onPointerEnd(e: PointerEvent) {\n if (e.pointerId === Sortable._drag?.pointerId) Sortable._finish(e.type === 'pointercancel');\n }\n\n // Listening only while a drag is active. preventDefault keeps the Escape\n // from also closing a modal <dialog> the list sits in.\n private static _onKeyDown(e: KeyboardEvent) {\n if (e.key !== 'Escape') return;\n e.preventDefault();\n Sortable._finish(true);\n }\n\n private static _finish(cancel: boolean) {\n const drag = Sortable._drag;\n if (!drag) return;\n Sortable._drag = null;\n drag.events.abort();\n drag.item.classList.remove('dragged');\n const to = [...drag.list.children].indexOf(drag.item);\n if (cancel) {\n drag.list.insertBefore(drag.item, drag.list.children[drag.from > to ? drag.from + 1 : drag.from] ?? null);\n } else if (to !== drag.from) {\n Sortable._done(drag.list, drag.item, drag.from, to);\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;AAEA,IAAM,eAAe;AAsBd,IAAM,YAAN,MAAM,UAAS;AAAA;AAAA,EAMpB,OAAO,OAAO;AACZ,QAAI,OAAO,aAAa,YAAa;AACrC,aAAS,iBAAiB,SAAS,UAAS,QAAQ;AACp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Tree(options) {
|
|
10
|
+
const byValue = /* @__PURE__ */ new Map();
|
|
11
|
+
options.forEach((option) => {
|
|
12
|
+
if (!byValue.has(option.value)) byValue.set(option.value, option);
|
|
13
|
+
});
|
|
14
|
+
const parentOf = (option) => byValue.get(option.dataset.parent || void 0);
|
|
15
|
+
const loops = (option) => {
|
|
16
|
+
let parent = parentOf(option);
|
|
17
|
+
for (let steps = 0; parent && parent !== option && steps < options.length; steps++) parent = parentOf(parent);
|
|
18
|
+
return parent === option;
|
|
19
|
+
};
|
|
20
|
+
const nodes = new Map(options.map((option) => [option, { option, children: [] }]));
|
|
21
|
+
const roots = [];
|
|
22
|
+
options.forEach((option) => {
|
|
23
|
+
const parent = loops(option) ? void 0 : parentOf(option);
|
|
24
|
+
(parent ? nodes.get(parent).children : roots).push(nodes.get(option));
|
|
25
|
+
});
|
|
26
|
+
return roots;
|
|
27
|
+
}
|
|
28
|
+
var STEPS = { ArrowUp: -1, ArrowDown: 1 };
|
|
29
|
+
var move = (tree, _row, e) => tree._focusRow(Utils.focusTarget(tree._visibleRows(), e, STEPS));
|
|
30
|
+
var activate = (tree, row) => tree._activate(row);
|
|
31
|
+
var TREE_KEYS = {
|
|
32
|
+
ArrowDown: move,
|
|
33
|
+
ArrowUp: move,
|
|
34
|
+
Home: move,
|
|
35
|
+
End: move,
|
|
36
|
+
ArrowRight: (tree, row) => tree._openOrEnter(row),
|
|
37
|
+
ArrowLeft: (tree, row) => tree._closeOrLeave(row),
|
|
38
|
+
"*": (tree, row) => tree._openSiblings(row),
|
|
39
|
+
Enter: activate,
|
|
40
|
+
" ": activate
|
|
41
|
+
};
|
|
42
|
+
var typeahead = (tree, row, e) => tree._typeahead(row, e.key);
|
|
43
|
+
var MIRRORED = { ArrowLeft: "ArrowRight", ArrowRight: "ArrowLeft" };
|
|
44
|
+
var TreeSelect = class extends FormSelect {
|
|
45
|
+
constructor(el, options) {
|
|
46
|
+
super(el, options);
|
|
47
|
+
/** What typeahead has read so far, and the timer that clears it. */
|
|
48
|
+
this._typed = "";
|
|
49
|
+
this._handleTreeKeydown = Utils.ignoringComposition((e) => {
|
|
50
|
+
const row = Utils.eventTarget(e)?.closest('li[role="treeitem"]');
|
|
51
|
+
const action = row && this._keyFor(e);
|
|
52
|
+
if (!action) return;
|
|
53
|
+
e.preventDefault();
|
|
54
|
+
e.stopPropagation();
|
|
55
|
+
action(this, row, e);
|
|
56
|
+
});
|
|
57
|
+
// Only a row's label acts. A disabled row passes clicks through to its
|
|
58
|
+
// group, which must not toggle the branch around it.
|
|
59
|
+
this._handleTreeClick = (e) => {
|
|
60
|
+
const target = Utils.eventTarget(e);
|
|
61
|
+
if (!this.tree.contains(target)) return;
|
|
62
|
+
const label = target.closest('li[role="treeitem"] > span');
|
|
63
|
+
e.preventDefault();
|
|
64
|
+
e.stopPropagation();
|
|
65
|
+
if (label) this._activate(label.parentElement);
|
|
66
|
+
};
|
|
67
|
+
if (!this.menuEl) return;
|
|
68
|
+
const { signal } = this._events;
|
|
69
|
+
if (!this._searchInput) {
|
|
70
|
+
this.menuEl.setAttribute("role", "presentation");
|
|
71
|
+
this.input.setAttribute("aria-haspopup", "tree");
|
|
72
|
+
this.input.setAttribute("aria-controls", this.tree.id);
|
|
73
|
+
}
|
|
74
|
+
this.menuEl.removeAttribute("aria-multiselectable");
|
|
75
|
+
this._nameTree();
|
|
76
|
+
this._leaveImplicitBranch();
|
|
77
|
+
this._handleSelectChange();
|
|
78
|
+
if (!this._searchInput) this.menuEl.addEventListener("keydown", this._handleTreeKeydown, { signal, capture: true });
|
|
79
|
+
this.menuEl.addEventListener("click", this._handleTreeClick, { signal, capture: true });
|
|
80
|
+
}
|
|
81
|
+
_setValueToInput() {
|
|
82
|
+
if (this.isMultiple) this._branches.forEach((option) => {
|
|
83
|
+
option.selected = false;
|
|
84
|
+
});
|
|
85
|
+
super._setValueToInput();
|
|
86
|
+
}
|
|
87
|
+
_canSearch() {
|
|
88
|
+
return this.options.searchable;
|
|
89
|
+
}
|
|
90
|
+
_searchList() {
|
|
91
|
+
return this.tree;
|
|
92
|
+
}
|
|
93
|
+
_searchRows() {
|
|
94
|
+
return this._enabledRows();
|
|
95
|
+
}
|
|
96
|
+
_filterSearch(query) {
|
|
97
|
+
const matches = this._matchingRows(query);
|
|
98
|
+
this.tree.querySelectorAll('li[role="treeitem"]').forEach((row) => {
|
|
99
|
+
row.hidden = !matches.has(row);
|
|
100
|
+
});
|
|
101
|
+
this._searchExpansion(query);
|
|
102
|
+
}
|
|
103
|
+
_matchingRows(query) {
|
|
104
|
+
const matches = /* @__PURE__ */ new Set();
|
|
105
|
+
this._values.filter(({ el }) => el.textContent.trim().toLowerCase().includes(query)).forEach(({ optionEl }) => {
|
|
106
|
+
for (let row = optionEl; row; row = this._parentRow(row)) matches.add(row);
|
|
107
|
+
});
|
|
108
|
+
return matches;
|
|
109
|
+
}
|
|
110
|
+
_searchExpansion(query) {
|
|
111
|
+
if (query) {
|
|
112
|
+
this._searchOpen ?? (this._searchOpen = this._openValues());
|
|
113
|
+
this._branches.forEach((_option, row) => {
|
|
114
|
+
if (!row.hidden) this._setExpanded(row, true);
|
|
115
|
+
});
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
const saved = this._searchOpen;
|
|
119
|
+
this._searchOpen = void 0;
|
|
120
|
+
if (saved) this._branches.forEach((option, row) => this._setExpanded(row, saved.has(option.value)));
|
|
121
|
+
}
|
|
122
|
+
_searchNavigate(e) {
|
|
123
|
+
if (e.target === this._searchInput) super._searchNavigate(e);
|
|
124
|
+
else this._handleTreeKeydown(e);
|
|
125
|
+
}
|
|
126
|
+
destroy() {
|
|
127
|
+
clearTimeout(this._typedTimer);
|
|
128
|
+
this._restoreBranches();
|
|
129
|
+
super.destroy();
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Rebuilds the tree from the native options, keeping open each branch whose
|
|
133
|
+
* value is still there and, while the popup is open, focus on the same row.
|
|
134
|
+
*/
|
|
135
|
+
refresh() {
|
|
136
|
+
const focused = this._focusedOption();
|
|
137
|
+
this._keepOpen = this._searchOpen ?? this._openValues();
|
|
138
|
+
super.refresh();
|
|
139
|
+
this._keepOpen = void 0;
|
|
140
|
+
this._restoreOpenFocus(focused);
|
|
141
|
+
}
|
|
142
|
+
_restoreOpenFocus(option) {
|
|
143
|
+
if (option && this.menu?.isOpen) this._restoreFocus(option);
|
|
144
|
+
}
|
|
145
|
+
/** The option whose row has focus, if one does. */
|
|
146
|
+
_focusedOption() {
|
|
147
|
+
const root = this.menuEl?.getRootNode();
|
|
148
|
+
return this._optionOf(root?.activeElement?.closest('li[role="treeitem"]'));
|
|
149
|
+
}
|
|
150
|
+
/** The values of the open branches. */
|
|
151
|
+
_openValues() {
|
|
152
|
+
return new Set(Array.from(this._branches ?? [], ([li, option]) => li.ariaExpanded === "true" ? option.value : null));
|
|
153
|
+
}
|
|
154
|
+
/** Focuses the row for `option` again, or the first enabled row once it is gone or disabled, or the field. */
|
|
155
|
+
_restoreFocus(option) {
|
|
156
|
+
const row = this._rowOf(option);
|
|
157
|
+
this._expandTo(row);
|
|
158
|
+
const rows = this._enabledRows();
|
|
159
|
+
const target = rows.includes(row) ? row : rows[0];
|
|
160
|
+
if (target) this._focusRow(target);
|
|
161
|
+
else (this._searchInput ?? this.input).focus();
|
|
162
|
+
}
|
|
163
|
+
/** Names the tree as the field is named: aria-labelledby, then aria-label, then its labels. */
|
|
164
|
+
_nameTree() {
|
|
165
|
+
const { input } = this;
|
|
166
|
+
if (input.hasAttribute("aria-labelledby")) this.tree.setAttribute("aria-labelledby", input.getAttribute("aria-labelledby"));
|
|
167
|
+
else if (input.ariaLabel) this.tree.ariaLabel = input.ariaLabel;
|
|
168
|
+
else this._labelTree();
|
|
169
|
+
}
|
|
170
|
+
_labelTree() {
|
|
171
|
+
const ids = Array.from(this.input.labels ?? [], (label, index) => label.id || (label.id = `${this.input.id}-label-${index}`));
|
|
172
|
+
if (ids.length) this.tree.setAttribute("aria-labelledby", ids.join(" "));
|
|
173
|
+
}
|
|
174
|
+
// The tree takes its keys and clicks on the menu itself.
|
|
175
|
+
_setupOptionHandlers() {
|
|
176
|
+
}
|
|
177
|
+
_buildOptions() {
|
|
178
|
+
this._restoreBranches();
|
|
179
|
+
this._branches = /* @__PURE__ */ new Map();
|
|
180
|
+
this.selectOptions = this._nativeOptions();
|
|
181
|
+
this._values = [];
|
|
182
|
+
const options = this.selectOptions.filter((option) => option.tagName === "OPTION");
|
|
183
|
+
if (!this.tree) {
|
|
184
|
+
this.tree = document.createElement("ul");
|
|
185
|
+
this.tree.id = "select-tree-" + Utils.guid();
|
|
186
|
+
this.tree.setAttribute("role", "tree");
|
|
187
|
+
}
|
|
188
|
+
this.tree.ariaMultiSelectable = String(this.isMultiple);
|
|
189
|
+
this.tree.replaceChildren(...optionTree(options).map((node) => this._row(node)));
|
|
190
|
+
this.menuEl.append(this.tree);
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* A select with no selected option picks its first one, which is often a
|
|
194
|
+
* branch, and disabling the branch does not move the selection. Unless the
|
|
195
|
+
* markup selected it, move to the option a form reset would pick now that
|
|
196
|
+
* branches are disabled: the first enabled leaf, or none. Only on start:
|
|
197
|
+
* after that a selected branch is one a script chose.
|
|
198
|
+
*/
|
|
199
|
+
_leaveImplicitBranch() {
|
|
200
|
+
if (this.isMultiple || !this._browserPickedBranch()) return;
|
|
201
|
+
const leaf = Array.from(this.el.options).find((option) => !option.disabled);
|
|
202
|
+
if (leaf) leaf.selected = true;
|
|
203
|
+
else this.el.selectedIndex = -1;
|
|
204
|
+
}
|
|
205
|
+
/** Whether the selection is a branch this disabled, which the markup did not select. */
|
|
206
|
+
_browserPickedBranch() {
|
|
207
|
+
const chosen = this.el.selectedOptions[0];
|
|
208
|
+
return !!chosen && !chosen.defaultSelected && this._disabledBranches.has(chosen);
|
|
209
|
+
}
|
|
210
|
+
_row(node) {
|
|
211
|
+
const li = document.createElement("li");
|
|
212
|
+
li.id = "select-option-" + Utils.guid();
|
|
213
|
+
li.setAttribute("role", "treeitem");
|
|
214
|
+
li.tabIndex = -1;
|
|
215
|
+
const label = document.createElement("span");
|
|
216
|
+
label.textContent = node.option.textContent;
|
|
217
|
+
li.append(label);
|
|
218
|
+
if (node.children.length) this._branch(li, node);
|
|
219
|
+
else this._leaf(li, node.option);
|
|
220
|
+
return li;
|
|
221
|
+
}
|
|
222
|
+
_branch(li, node) {
|
|
223
|
+
const group = document.createElement("ul");
|
|
224
|
+
group.setAttribute("role", "group");
|
|
225
|
+
group.append(...node.children.map((child) => this._row(child)));
|
|
226
|
+
li.append(group);
|
|
227
|
+
this._setExpanded(li, !!this._keepOpen?.has(node.option.value));
|
|
228
|
+
this._branches.set(li, node.option);
|
|
229
|
+
if (node.option.disabled) return;
|
|
230
|
+
node.option.disabled = true;
|
|
231
|
+
this._disabledBranches.add(node.option);
|
|
232
|
+
}
|
|
233
|
+
_leaf(li, option) {
|
|
234
|
+
if (this.el.matches(":disabled") || option.disabled) {
|
|
235
|
+
li.classList.add("disabled");
|
|
236
|
+
li.ariaDisabled = "true";
|
|
237
|
+
}
|
|
238
|
+
this._values.push({ el: option, optionEl: li });
|
|
239
|
+
}
|
|
240
|
+
_restoreBranches() {
|
|
241
|
+
this._disabledBranches?.forEach((option) => {
|
|
242
|
+
option.disabled = false;
|
|
243
|
+
});
|
|
244
|
+
this._disabledBranches = /* @__PURE__ */ new Set();
|
|
245
|
+
}
|
|
246
|
+
_setExpanded(li, open) {
|
|
247
|
+
li.ariaExpanded = String(open);
|
|
248
|
+
li.querySelector(":scope > ul").hidden = !open;
|
|
249
|
+
}
|
|
250
|
+
/** The rows not inside a closed branch, in document order. */
|
|
251
|
+
_visibleRows() {
|
|
252
|
+
return Array.from(this.tree.querySelectorAll('li[role="treeitem"]')).filter((li) => !li.closest("[hidden]"));
|
|
253
|
+
}
|
|
254
|
+
_enabledRows() {
|
|
255
|
+
return this._visibleRows().filter((row) => !row.matches(".disabled"));
|
|
256
|
+
}
|
|
257
|
+
_focusRow(row) {
|
|
258
|
+
row?.focus({ preventScroll: true });
|
|
259
|
+
row?.scrollIntoView({ block: "nearest", inline: "nearest" });
|
|
260
|
+
}
|
|
261
|
+
/** Opens the chosen leaf's branches and focuses it, or the first row a person can choose or open. */
|
|
262
|
+
_focusSelected() {
|
|
263
|
+
if (!this.menu.options.autoFocus || Utils.focusIsIn(this.menuEl)) return;
|
|
264
|
+
const chosen = this._values.find(({ el, optionEl }) => el.selected && !optionEl.matches(".disabled"));
|
|
265
|
+
this._restoreFocus(chosen?.el);
|
|
266
|
+
}
|
|
267
|
+
/** Opens every branch around `row`. */
|
|
268
|
+
_expandTo(row) {
|
|
269
|
+
for (let branch = this._parentRow(row); branch; branch = this._parentRow(branch)) this._setExpanded(branch, true);
|
|
270
|
+
}
|
|
271
|
+
/** The branch row holding `row`, never an element outside the tree. */
|
|
272
|
+
_parentRow(row) {
|
|
273
|
+
const parent = row?.parentElement.closest('li[role="treeitem"]');
|
|
274
|
+
return this._branches.has(parent) ? parent : null;
|
|
275
|
+
}
|
|
276
|
+
_optionOf(row) {
|
|
277
|
+
return this._branches?.get(row) ?? this._values?.find(({ optionEl }) => optionEl === row)?.el;
|
|
278
|
+
}
|
|
279
|
+
_rowOf(option) {
|
|
280
|
+
const branch = Array.from(this._branches).find(([, branchOption]) => branchOption === option)?.[0];
|
|
281
|
+
return branch ?? this._values.find(({ el }) => el === option)?.optionEl;
|
|
282
|
+
}
|
|
283
|
+
/** Chooses a leaf, or opens or closes a branch. */
|
|
284
|
+
_activate(row) {
|
|
285
|
+
if (row.closest("[hidden]")) return;
|
|
286
|
+
if (this._branches.has(row)) this._toggle(row, row.ariaExpanded !== "true");
|
|
287
|
+
else this._selectOptionElement(row);
|
|
288
|
+
}
|
|
289
|
+
/** Opens a closed branch, or moves into an open one. */
|
|
290
|
+
_openOrEnter(row) {
|
|
291
|
+
if (!this._branches.has(row)) return;
|
|
292
|
+
if (row.ariaExpanded !== "true") this._toggle(row, true);
|
|
293
|
+
else this._focusRow(row.querySelector(":scope > ul > li:not(.disabled, [hidden])"));
|
|
294
|
+
}
|
|
295
|
+
/** Closes an open branch, or moves to the parent row. */
|
|
296
|
+
_closeOrLeave(row) {
|
|
297
|
+
if (row.ariaExpanded === "true") this._toggle(row, false);
|
|
298
|
+
else this._focusRow(this._parentRow(row));
|
|
299
|
+
}
|
|
300
|
+
/** Opens every branch beside `row`. */
|
|
301
|
+
_openSiblings(row) {
|
|
302
|
+
Array.from(row.parentElement.children).forEach((sibling) => {
|
|
303
|
+
if (this._branches.has(sibling) && !sibling.hasAttribute("hidden")) this._toggle(sibling, true);
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Moves to the next row whose text starts with the characters typed in the
|
|
308
|
+
* last second, as Menu's typeahead does. A repeated search starts on the
|
|
309
|
+
* focused row, so typing more of its text keeps it.
|
|
310
|
+
*/
|
|
311
|
+
_typeahead(row, key) {
|
|
312
|
+
clearTimeout(this._typedTimer);
|
|
313
|
+
this._typed += key.toLowerCase();
|
|
314
|
+
this._typedTimer = setTimeout(() => {
|
|
315
|
+
this._typed = "";
|
|
316
|
+
}, 1e3);
|
|
317
|
+
const rows = this._enabledRows();
|
|
318
|
+
const from = rows.indexOf(row) + (this._typed.length === 1 ? 1 : 0);
|
|
319
|
+
const match = [...rows.slice(from), ...rows.slice(0, from)].find((candidate) => candidate.firstChild.textContent.trim().toLowerCase().startsWith(this._typed));
|
|
320
|
+
this._focusRow(match);
|
|
321
|
+
}
|
|
322
|
+
_toggle(row, open) {
|
|
323
|
+
this._setExpanded(row, open);
|
|
324
|
+
if (this.menu?.isOpen) this.menu.recalculateDimensions();
|
|
325
|
+
}
|
|
326
|
+
_keyFor(e) {
|
|
327
|
+
if (!Utils.plainKey(e)) return void 0;
|
|
328
|
+
return TREE_KEYS[this._logicalKey(e.key)] ?? (e.key.length === 1 ? typeahead : void 0);
|
|
329
|
+
}
|
|
330
|
+
/** The key as in a left-to-right tree. */
|
|
331
|
+
_logicalKey(key) {
|
|
332
|
+
const rtl = getComputedStyle(this.tree).direction === "rtl";
|
|
333
|
+
return rtl && MIRRORED[key] || key;
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
TreeSelect.key = "Expressive_TreeSelect";
|
|
337
|
+
|
|
338
|
+
export {
|
|
339
|
+
optionTree,
|
|
340
|
+
TreeSelect
|
|
341
|
+
};
|
|
342
|
+
//# sourceMappingURL=chunk-TM7HPGTV.mjs.map
|