@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,232 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Component
|
|
3
|
+
} from "./chunk-EB2V4OKL.mjs";
|
|
4
|
+
import {
|
|
5
|
+
Utils,
|
|
6
|
+
afterFormReset,
|
|
7
|
+
controllerFor
|
|
8
|
+
} from "./chunk-67UNY7RH.mjs";
|
|
9
|
+
|
|
10
|
+
// src/ts/components/colorPicker.ts
|
|
11
|
+
var _defaults = {
|
|
12
|
+
onChange: null,
|
|
13
|
+
i18n: {
|
|
14
|
+
area: "Saturation and brightness",
|
|
15
|
+
value: (saturation, brightness) => `Saturation ${saturation}%, brightness ${brightness}%`,
|
|
16
|
+
hue: "Hue",
|
|
17
|
+
hex: "Hex color"
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
var clamp = (n) => Math.min(1, Math.max(0, n));
|
|
21
|
+
function hueOf(r, g, b) {
|
|
22
|
+
const max = Math.max(r, g, b);
|
|
23
|
+
const range = max - Math.min(r, g, b);
|
|
24
|
+
if (!range) return 0;
|
|
25
|
+
const sector = max === r ? (g - b) / range : max === g ? (b - r) / range + 2 : (r - g) / range + 4;
|
|
26
|
+
return (sector * 60 + 360) % 360;
|
|
27
|
+
}
|
|
28
|
+
function toHsv(hex) {
|
|
29
|
+
const match = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(hex.trim());
|
|
30
|
+
if (!match) return null;
|
|
31
|
+
const digits = match[1].length === 3 ? [...match[1]].map((c) => c + c).join("") : match[1];
|
|
32
|
+
const [r, g, b] = [0, 2, 4].map((i) => parseInt(digits.slice(i, i + 2), 16) / 255);
|
|
33
|
+
const max = Math.max(r, g, b);
|
|
34
|
+
return { h: hueOf(r, g, b), s: max ? (max - Math.min(r, g, b)) / max : 0, v: max };
|
|
35
|
+
}
|
|
36
|
+
function toHex({ h, s, v }) {
|
|
37
|
+
const channel = (n) => {
|
|
38
|
+
const k = (n + h / 60) % 6;
|
|
39
|
+
return v - v * s * Math.max(0, Math.min(k, 4 - k, 1));
|
|
40
|
+
};
|
|
41
|
+
return "#" + [5, 3, 1].map((n) => Math.round(channel(n) * 255).toString(16).padStart(2, "0")).join("");
|
|
42
|
+
}
|
|
43
|
+
var KEY_STEPS = {
|
|
44
|
+
ArrowRight: [1, 0],
|
|
45
|
+
ArrowLeft: [-1, 0],
|
|
46
|
+
ArrowUp: [0, 1],
|
|
47
|
+
ArrowDown: [0, -1],
|
|
48
|
+
PageUp: [0, 10],
|
|
49
|
+
PageDown: [0, -10],
|
|
50
|
+
Home: [-100, 0],
|
|
51
|
+
End: [100, 0]
|
|
52
|
+
};
|
|
53
|
+
var ColorPicker = class extends Component {
|
|
54
|
+
constructor(el, options) {
|
|
55
|
+
super(el, options);
|
|
56
|
+
this._hsv = { h: 0, s: 0, v: 0 };
|
|
57
|
+
this._area = null;
|
|
58
|
+
this._thumb = null;
|
|
59
|
+
this._hue = null;
|
|
60
|
+
this._hex = null;
|
|
61
|
+
// Set while the picker writes the native input, so its own events are not
|
|
62
|
+
// read back as an outside change.
|
|
63
|
+
this._writing = false;
|
|
64
|
+
// The person used the browser's own picker on the native input.
|
|
65
|
+
this._onNativeInput = () => {
|
|
66
|
+
if (this._writing || !this.input) return;
|
|
67
|
+
const hsv = toHsv(this.input.value);
|
|
68
|
+
if (!hsv) return;
|
|
69
|
+
this._hsv = hsv;
|
|
70
|
+
this._render();
|
|
71
|
+
};
|
|
72
|
+
this._onHex = () => {
|
|
73
|
+
const hsv = toHsv(this._hex.value);
|
|
74
|
+
if (hsv && toHex(hsv) !== this.input.value) this._set(hsv);
|
|
75
|
+
this._hex.value = toHex(this._hsv);
|
|
76
|
+
};
|
|
77
|
+
this._onPointerDown = (e) => {
|
|
78
|
+
if (e.button || this.input.disabled) return;
|
|
79
|
+
const area = this._area;
|
|
80
|
+
e.preventDefault();
|
|
81
|
+
this._thumb.focus();
|
|
82
|
+
area.setPointerCapture(e.pointerId);
|
|
83
|
+
this._fromPoint(e, false);
|
|
84
|
+
const move = (ev) => this._fromPoint(ev, false);
|
|
85
|
+
const drag = controllerFor(area);
|
|
86
|
+
const up = (ev) => {
|
|
87
|
+
drag.abort();
|
|
88
|
+
this._fromPoint(ev, true);
|
|
89
|
+
};
|
|
90
|
+
const { signal } = drag;
|
|
91
|
+
area.addEventListener("pointermove", move, { signal });
|
|
92
|
+
area.addEventListener("pointerup", up, { signal });
|
|
93
|
+
area.addEventListener("pointercancel", up, { signal });
|
|
94
|
+
};
|
|
95
|
+
// Left and right change saturation, up and down brightness; see KEY_STEPS.
|
|
96
|
+
this._onKeyDown = (e) => {
|
|
97
|
+
const steps = this._keySteps(e);
|
|
98
|
+
if (!steps) return;
|
|
99
|
+
e.preventDefault();
|
|
100
|
+
const unit = e.shiftKey ? 0.1 : 0.01;
|
|
101
|
+
const { s, v } = this._hsv;
|
|
102
|
+
this._set({ ...this._hsv, s: clamp(s + steps[0] * unit), v: clamp(v + steps[1] * unit) });
|
|
103
|
+
};
|
|
104
|
+
this.input = el.querySelector(':scope > input[type="color"]');
|
|
105
|
+
if (!this.input) return;
|
|
106
|
+
this._hsv = toHsv(this.input.value) ?? this._hsv;
|
|
107
|
+
this._build();
|
|
108
|
+
this.input.addEventListener("input", this._onNativeInput, { signal: this._events.signal });
|
|
109
|
+
afterFormReset(this.input, this._onNativeInput, this._events.signal);
|
|
110
|
+
this._render();
|
|
111
|
+
}
|
|
112
|
+
static get defaults() {
|
|
113
|
+
return _defaults;
|
|
114
|
+
}
|
|
115
|
+
destroy() {
|
|
116
|
+
for (const part of [this._area, this._hue, this._hex]) part?.remove();
|
|
117
|
+
this._area = this._thumb = this._hue = this._hex = null;
|
|
118
|
+
this.el.style.removeProperty("--_color-picker-hue");
|
|
119
|
+
super.destroy();
|
|
120
|
+
}
|
|
121
|
+
/** The current color as `#rrggbb`. Setting it fires no events, as with a native input. */
|
|
122
|
+
get value() {
|
|
123
|
+
return this.input?.value ?? "";
|
|
124
|
+
}
|
|
125
|
+
set value(hex) {
|
|
126
|
+
const hsv = toHsv(hex);
|
|
127
|
+
if (!hsv || !this.input) return;
|
|
128
|
+
this._hsv = hsv;
|
|
129
|
+
this._writing = true;
|
|
130
|
+
this.input.value = toHex(hsv);
|
|
131
|
+
this._writing = false;
|
|
132
|
+
this._render();
|
|
133
|
+
}
|
|
134
|
+
_build() {
|
|
135
|
+
const disabled = this.input.disabled;
|
|
136
|
+
const { i18n } = this.options;
|
|
137
|
+
const area = document.createElement("div");
|
|
138
|
+
area.className = "color-picker-area";
|
|
139
|
+
const thumb = document.createElement("div");
|
|
140
|
+
thumb.className = "color-picker-thumb";
|
|
141
|
+
thumb.setAttribute("role", "slider");
|
|
142
|
+
thumb.setAttribute("aria-label", i18n.area);
|
|
143
|
+
thumb.setAttribute("aria-valuemin", "0");
|
|
144
|
+
thumb.setAttribute("aria-valuemax", "100");
|
|
145
|
+
thumb.tabIndex = disabled ? -1 : 0;
|
|
146
|
+
if (disabled) thumb.setAttribute("aria-disabled", "true");
|
|
147
|
+
area.append(thumb);
|
|
148
|
+
const hue = document.createElement("input");
|
|
149
|
+
hue.type = "range";
|
|
150
|
+
hue.className = "color-picker-hue";
|
|
151
|
+
hue.min = "0";
|
|
152
|
+
hue.max = "359";
|
|
153
|
+
hue.setAttribute("aria-label", i18n.hue);
|
|
154
|
+
hue.disabled = disabled;
|
|
155
|
+
const hex = document.createElement("input");
|
|
156
|
+
hex.type = "text";
|
|
157
|
+
hex.className = "color-picker-hex";
|
|
158
|
+
hex.setAttribute("aria-label", i18n.hex);
|
|
159
|
+
hex.autocomplete = "off";
|
|
160
|
+
hex.spellcheck = false;
|
|
161
|
+
hex.maxLength = 7;
|
|
162
|
+
hex.disabled = disabled;
|
|
163
|
+
this.input.before(area, hue);
|
|
164
|
+
this.input.after(hex);
|
|
165
|
+
this._area = area;
|
|
166
|
+
this._thumb = thumb;
|
|
167
|
+
this._hue = hue;
|
|
168
|
+
this._hex = hex;
|
|
169
|
+
area.addEventListener("pointerdown", this._onPointerDown);
|
|
170
|
+
thumb.addEventListener("keydown", this._onKeyDown);
|
|
171
|
+
hue.addEventListener("input", () => this._set({ ...this._hsv, h: Number(hue.value) }, false));
|
|
172
|
+
hue.addEventListener("change", () => this._commit());
|
|
173
|
+
hex.addEventListener("change", this._onHex);
|
|
174
|
+
hex.addEventListener("keydown", (e) => {
|
|
175
|
+
if (e.key === "Enter" && !Utils.isComposing(e)) {
|
|
176
|
+
e.preventDefault();
|
|
177
|
+
this._onHex();
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
_render() {
|
|
182
|
+
const { h, s, v } = this._hsv;
|
|
183
|
+
const hex = toHex(this._hsv);
|
|
184
|
+
const thumb = this._thumb;
|
|
185
|
+
this.el.style.setProperty("--_color-picker-hue", String(Math.round(h)));
|
|
186
|
+
thumb.style.setProperty("--_color-picker-x", String(s));
|
|
187
|
+
thumb.style.setProperty("--_color-picker-y", String(1 - v));
|
|
188
|
+
thumb.style.setProperty("--_color-picker-color", hex);
|
|
189
|
+
thumb.setAttribute("aria-valuenow", String(Math.round(s * 100)));
|
|
190
|
+
thumb.setAttribute("aria-valuetext", this.options.i18n.value(Math.round(s * 100), Math.round(v * 100)));
|
|
191
|
+
this._hue.value = String(Math.round(h));
|
|
192
|
+
this._hex.value = hex;
|
|
193
|
+
}
|
|
194
|
+
// Store the color, write it to the native input and fire `input`; with
|
|
195
|
+
// `commit`, also fire `change` and onChange.
|
|
196
|
+
// Only reached from the built controls, which a disabled input disables.
|
|
197
|
+
_set(hsv, commit = true) {
|
|
198
|
+
const input = this.input;
|
|
199
|
+
this._hsv = hsv;
|
|
200
|
+
const hex = toHex(hsv);
|
|
201
|
+
const changed = input.value !== hex;
|
|
202
|
+
this._writing = true;
|
|
203
|
+
input.value = hex;
|
|
204
|
+
if (changed) input.dispatchEvent(new Event("input", { bubbles: true, composed: true }));
|
|
205
|
+
this._writing = false;
|
|
206
|
+
this._render();
|
|
207
|
+
if (commit) this._commit();
|
|
208
|
+
}
|
|
209
|
+
_commit() {
|
|
210
|
+
if (!this.input) return;
|
|
211
|
+
this._writing = true;
|
|
212
|
+
this.input.dispatchEvent(new Event("change", { bubbles: true }));
|
|
213
|
+
this._writing = false;
|
|
214
|
+
this.options.onChange?.(this.input.value);
|
|
215
|
+
}
|
|
216
|
+
_fromPoint(e, commit) {
|
|
217
|
+
const box = this._area.getBoundingClientRect();
|
|
218
|
+
const s = clamp((e.clientX - box.left) / box.width);
|
|
219
|
+
const v = 1 - clamp((e.clientY - box.top) / box.height);
|
|
220
|
+
this._set({ ...this._hsv, s, v }, commit);
|
|
221
|
+
}
|
|
222
|
+
/** How a key moves the point. Shift is the larger step; Alt, Ctrl and Meta stay the browser's. */
|
|
223
|
+
_keySteps(e) {
|
|
224
|
+
return Utils.plainKey(e) && !this.input.disabled ? KEY_STEPS[e.key] : void 0;
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
ColorPicker.key = "Expressive_ColorPicker";
|
|
228
|
+
|
|
229
|
+
export {
|
|
230
|
+
ColorPicker
|
|
231
|
+
};
|
|
232
|
+
//# sourceMappingURL=chunk-CWMQOT4O.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/ts/components/colorPicker.ts"],
|
|
4
|
+
"sourcesContent": ["import { Component, BaseOptions } from '../core/component';\nimport { Utils, afterFormReset, controllerFor } from '../core/utils';\n\nexport interface ColorPickerI18n {\n /** The name of the saturation and brightness area. */\n area: string;\n /** What the area reports as its value, from two whole percentages. */\n value: (saturation: number, brightness: number) => string;\n /** The name of the hue slider. */\n hue: string;\n /** The name of the hex field. */\n hex: string;\n}\n\nexport interface ColorPickerOptions extends BaseOptions {\n /**\n * Called with the new `#rrggbb` value when a change is committed: the end\n * of a drag, a key press, a hue release or a typed hex value.\n * @default null\n */\n onChange: ((value: string) => void) | null;\n /** The accessible names, for a page in another language. */\n i18n: Partial<ColorPickerI18n>;\n}\n\nconst _defaults: ColorPickerOptions = {\n onChange: null,\n i18n: {\n area: 'Saturation and brightness',\n value: (saturation, brightness) => `Saturation ${saturation}%, brightness ${brightness}%`,\n hue: 'Hue',\n hex: 'Hex color'\n }\n};\n\n/** Hue in degrees, saturation and value from 0 to 1. */\ninterface Hsv { h: number; s: number; v: number }\n\nconst clamp = (n: number) => Math.min(1, Math.max(0, n));\n\n// Hue in degrees of an RGB color with channels from 0 to 1.\nfunction hueOf(r: number, g: number, b: number): number {\n const max = Math.max(r, g, b);\n const range = max - Math.min(r, g, b);\n if (!range) return 0;\n const sector = max === r ? (g - b) / range : max === g ? (b - r) / range + 2 : (r - g) / range + 4;\n return (sector * 60 + 360) % 360;\n}\n\nfunction toHsv(hex: string): Hsv | null {\n const match = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(hex.trim());\n if (!match) return null;\n const digits = match[1].length === 3 ? [...match[1]].map((c) => c + c).join('') : match[1];\n const [r, g, b] = [0, 2, 4].map((i) => parseInt(digits.slice(i, i + 2), 16) / 255);\n const max = Math.max(r, g, b);\n return { h: hueOf(r, g, b), s: max ? (max - Math.min(r, g, b)) / max : 0, v: max };\n}\n\nfunction toHex({ h, s, v }: Hsv): string {\n const channel = (n: number) => {\n const k = (n + h / 60) % 6;\n return v - v * s * Math.max(0, Math.min(k, 4 - k, 1));\n };\n return '#' + [5, 3, 1].map((n) => Math.round(channel(n) * 255).toString(16).padStart(2, '0')).join('');\n}\n\n// Area keys as [saturation, brightness] steps of 1%; Shift takes ten of them.\n// Home and End overshoot so the clamp lands on the ends of saturation.\nconst KEY_STEPS: Record<string, [number, number]> = {\n ArrowRight: [1, 0],\n ArrowLeft: [-1, 0],\n ArrowUp: [0, 1],\n ArrowDown: [0, -1],\n PageUp: [0, 10],\n PageDown: [0, -10],\n Home: [-100, 0],\n End: [100, 0]\n};\n\n/**\n * Color picker. Enhances a `.color-picker` holding an `<input type=\"color\">`\n * with a saturation and brightness area, a hue slider and a hex field. The\n * native input stays the form value and the preview, so the browser's own\n * picker still opens from it, and it fires `input` and `change` as it would\n * if the person had used that picker.\n */\nexport class ColorPicker extends Component<ColorPickerOptions> {\n /** The native color input that holds the value. */\n input: HTMLInputElement | null;\n private _hsv: Hsv = { h: 0, s: 0, v: 0 };\n private _area: HTMLDivElement | null = null;\n private _thumb: HTMLDivElement | null = null;\n private _hue: HTMLInputElement | null = null;\n private _hex: HTMLInputElement | null = null;\n // Set while the picker writes the native input, so its own events are not\n // read back as an outside change.\n private _writing = false;\n\n constructor(el: HTMLElement, options: Partial<ColorPickerOptions>) {\n super(el, options);\n this.input = el.querySelector<HTMLInputElement>(':scope > input[type=\"color\"]');\n if (!this.input) return;\n this._hsv = toHsv(this.input.value) ?? this._hsv;\n this._build();\n this.input.addEventListener('input', this._onNativeInput, { signal: this._events.signal });\n // A form reset restores the native value without an input event.\n afterFormReset(this.input, this._onNativeInput, this._events.signal);\n this._render();\n }\n\n static get defaults(): ColorPickerOptions {\n return _defaults;\n }\n\n static key = 'Expressive_ColorPicker';\n\n destroy() {\n for (const part of [this._area, this._hue, this._hex]) part?.remove();\n this._area = this._thumb = this._hue = this._hex = null;\n this.el.style.removeProperty('--_color-picker-hue');\n super.destroy();\n }\n\n /** The current color as `#rrggbb`. Setting it fires no events, as with a native input. */\n get value(): string {\n return this.input?.value ?? '';\n }\n\n set value(hex: string) {\n const hsv = toHsv(hex);\n if (!hsv || !this.input) return;\n this._hsv = hsv;\n this._writing = true;\n this.input.value = toHex(hsv);\n this._writing = false;\n this._render();\n }\n\n private _build() {\n const disabled = this.input!.disabled;\n const { i18n } = this.options;\n\n const area = document.createElement('div');\n area.className = 'color-picker-area';\n const thumb = document.createElement('div');\n thumb.className = 'color-picker-thumb';\n thumb.setAttribute('role', 'slider');\n thumb.setAttribute('aria-label', i18n.area!);\n thumb.setAttribute('aria-valuemin', '0');\n thumb.setAttribute('aria-valuemax', '100');\n thumb.tabIndex = disabled ? -1 : 0;\n if (disabled) thumb.setAttribute('aria-disabled', 'true');\n area.append(thumb);\n\n const hue = document.createElement('input');\n hue.type = 'range';\n hue.className = 'color-picker-hue';\n hue.min = '0';\n hue.max = '359';\n hue.setAttribute('aria-label', i18n.hue!);\n hue.disabled = disabled;\n\n const hex = document.createElement('input');\n hex.type = 'text';\n hex.className = 'color-picker-hex';\n hex.setAttribute('aria-label', i18n.hex!);\n hex.autocomplete = 'off';\n hex.spellcheck = false;\n hex.maxLength = 7;\n hex.disabled = disabled;\n\n // Area and hue before the native input, the hex field after it.\n this.input!.before(area, hue);\n this.input!.after(hex);\n this._area = area;\n this._thumb = thumb;\n this._hue = hue;\n this._hex = hex;\n\n area.addEventListener('pointerdown', this._onPointerDown);\n thumb.addEventListener('keydown', this._onKeyDown);\n hue.addEventListener('input', () => this._set({ ...this._hsv, h: Number(hue.value) }, false));\n hue.addEventListener('change', () => this._commit());\n hex.addEventListener('change', this._onHex);\n hex.addEventListener('keydown', (e) => {\n // Enter in a text field would submit the form; take it as \"apply\".\n if (e.key === 'Enter' && !Utils.isComposing(e)) {\n e.preventDefault();\n this._onHex();\n }\n });\n }\n\n private _render() {\n const { h, s, v } = this._hsv;\n const hex = toHex(this._hsv);\n const thumb = this._thumb!;\n this.el.style.setProperty('--_color-picker-hue', String(Math.round(h)));\n thumb.style.setProperty('--_color-picker-x', String(s));\n thumb.style.setProperty('--_color-picker-y', String(1 - v));\n thumb.style.setProperty('--_color-picker-color', hex);\n thumb.setAttribute('aria-valuenow', String(Math.round(s * 100)));\n thumb.setAttribute('aria-valuetext', this.options.i18n.value!(Math.round(s * 100), Math.round(v * 100)));\n this._hue!.value = String(Math.round(h));\n // The hex field only commits on change, so rewriting it never fights typing.\n this._hex!.value = hex;\n }\n\n // Store the color, write it to the native input and fire `input`; with\n // `commit`, also fire `change` and onChange.\n // Only reached from the built controls, which a disabled input disables.\n private _set(hsv: Hsv, commit = true) {\n const input = this.input!;\n this._hsv = hsv;\n const hex = toHex(hsv);\n const changed = input.value !== hex;\n this._writing = true;\n input.value = hex;\n if (changed) input.dispatchEvent(new Event('input', { bubbles: true, composed: true }));\n this._writing = false;\n this._render();\n if (commit) this._commit();\n }\n\n private _commit() {\n if (!this.input) return;\n this._writing = true;\n this.input.dispatchEvent(new Event('change', { bubbles: true }));\n this._writing = false;\n this.options.onChange?.(this.input.value);\n }\n\n // The person used the browser's own picker on the native input.\n private _onNativeInput = () => {\n if (this._writing || !this.input) return;\n const hsv = toHsv(this.input.value);\n if (!hsv) return;\n this._hsv = hsv;\n this._render();\n };\n\n private _onHex = () => {\n const hsv = toHsv(this._hex!.value);\n if (hsv && toHex(hsv) !== this.input!.value) this._set(hsv);\n // An invalid entry goes back to the current color.\n this._hex!.value = toHex(this._hsv);\n };\n\n private _fromPoint(e: PointerEvent, commit: boolean) {\n const box = this._area!.getBoundingClientRect();\n const s = clamp((e.clientX - box.left) / box.width);\n const v = 1 - clamp((e.clientY - box.top) / box.height);\n this._set({ ...this._hsv, s, v }, commit);\n }\n\n private _onPointerDown = (e: PointerEvent) => {\n if (e.button || this.input!.disabled) return;\n const area = this._area!;\n e.preventDefault();\n this._thumb!.focus();\n area.setPointerCapture(e.pointerId);\n this._fromPoint(e, false);\n const move = (ev: PointerEvent) => this._fromPoint(ev, false);\n const drag = controllerFor(area);\n const up = (ev: PointerEvent) => {\n drag.abort();\n this._fromPoint(ev, true);\n };\n const { signal } = drag;\n area.addEventListener('pointermove', move, { signal });\n area.addEventListener('pointerup', up, { signal });\n area.addEventListener('pointercancel', up, { signal });\n };\n\n // Left and right change saturation, up and down brightness; see KEY_STEPS.\n private _onKeyDown = (e: KeyboardEvent) => {\n const steps = this._keySteps(e);\n if (!steps) return;\n e.preventDefault();\n const unit = e.shiftKey ? 0.1 : 0.01;\n const { s, v } = this._hsv;\n this._set({ ...this._hsv, s: clamp(s + steps[0] * unit), v: clamp(v + steps[1] * unit) });\n };\n\n /** How a key moves the point. Shift is the larger step; Alt, Ctrl and Meta stay the browser's. */\n private _keySteps(e: KeyboardEvent) {\n return Utils.plainKey(e) && !this.input!.disabled ? KEY_STEPS[e.key] : undefined;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;AAyBA,IAAM,YAAgC;AAAA,EACpC,UAAU;AAAA,EACV,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,OAAO,CAAC,YAAY,eAAe,cAAc,UAAU,iBAAiB,UAAU;AAAA,IACtF,KAAK;AAAA,IACL,KAAK;AAAA,EACP;AACF;AAKA,IAAM,QAAQ,CAAC,MAAc,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,CAAC,CAAC;AAGvD,SAAS,MAAM,GAAW,GAAW,GAAmB;AACtD,QAAM,MAAM,KAAK,IAAI,GAAG,GAAG,CAAC;AAC5B,QAAM,QAAQ,MAAM,KAAK,IAAI,GAAG,GAAG,CAAC;AACpC,MAAI,CAAC,MAAO,QAAO;AACnB,QAAM,SAAS,QAAQ,KAAK,IAAI,KAAK,QAAQ,QAAQ,KAAK,IAAI,KAAK,QAAQ,KAAK,IAAI,KAAK,QAAQ;AACjG,UAAQ,SAAS,KAAK,OAAO;AAC/B;AAEA,SAAS,MAAM,KAAyB;AACtC,QAAM,QAAQ,iCAAiC,KAAK,IAAI,KAAK,CAAC;AAC9D,MAAI,CAAC,MAAO,QAAO;AACnB,QAAM,SAAS,MAAM,CAAC,EAAE,WAAW,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,MAAM,CAAC;AACzF,QAAM,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,EAAE,IAAI,CAAC,MAAM,SAAS,O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AM,IAAI,IAAI,OAAO,EAAE,UAAU,IAAI,OAAO,IAAI,MAAM;AACtD,SAAK,KAAK,EAAE,GAAG,KAAK,MAAM,GAAG,EAAE,GAAG,MAAM;AAAA,EAC1C;AAAA;AAAA,EAgCQ,UAAU,GAAkB;AAClC,WAAO,MAAM,SAAS,CAAC,KAAK,CAAC,KAAK,MAAO,WAAW,UAAU,EAAE,GAAG,IAAI;AAAA,EACzE;AACF;AA1Ma,YA4BJ,MAAM;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Utils
|
|
3
|
+
} from "./chunk-67UNY7RH.mjs";
|
|
4
|
+
|
|
5
|
+
// src/ts/plugins/dockedDisplayPlugin.ts
|
|
6
|
+
var _defaults = {
|
|
7
|
+
margin: 5,
|
|
8
|
+
transition: 10,
|
|
9
|
+
duration: 250,
|
|
10
|
+
align: "left"
|
|
11
|
+
};
|
|
12
|
+
var DockedDisplayPlugin = class {
|
|
13
|
+
constructor(el, container, options) {
|
|
14
|
+
this._handleDocumentClick = (e) => {
|
|
15
|
+
if (!this.visible) return;
|
|
16
|
+
const path = e.composedPath();
|
|
17
|
+
if (![...this.triggers, this.container].some((inside) => path.includes(inside))) this.hide();
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Tears the plugin down. While shown, the document listener holds a
|
|
21
|
+
* reference to this instance - and through it the whole picker subtree - so
|
|
22
|
+
* the owning component must call this from its own destroy().
|
|
23
|
+
*/
|
|
24
|
+
this.destroy = () => {
|
|
25
|
+
document.removeEventListener("click", this._handleDocumentClick);
|
|
26
|
+
this.container.remove();
|
|
27
|
+
};
|
|
28
|
+
this.show = () => {
|
|
29
|
+
if (this.visible) return;
|
|
30
|
+
this.visible = true;
|
|
31
|
+
document.addEventListener("click", this._handleDocumentClick);
|
|
32
|
+
this._place();
|
|
33
|
+
this.container.style.visibility = "visible";
|
|
34
|
+
this._animate(this.options.transition, "1");
|
|
35
|
+
};
|
|
36
|
+
this.hide = () => {
|
|
37
|
+
if (!this.visible) return;
|
|
38
|
+
this.visible = false;
|
|
39
|
+
document.removeEventListener("click", this._handleDocumentClick);
|
|
40
|
+
this.container.removeAttribute("style");
|
|
41
|
+
this._animate(0, "0");
|
|
42
|
+
};
|
|
43
|
+
this.el = el;
|
|
44
|
+
this.triggers = [el];
|
|
45
|
+
this.options = {
|
|
46
|
+
..._defaults,
|
|
47
|
+
...options
|
|
48
|
+
};
|
|
49
|
+
this.container = document.createElement("div");
|
|
50
|
+
this.container.classList.add("display-docked");
|
|
51
|
+
this.container.append(container);
|
|
52
|
+
el.parentElement.append(this.container);
|
|
53
|
+
}
|
|
54
|
+
/** Eases the container to `y` pixels down and to `opacity`. */
|
|
55
|
+
_animate(y, opacity) {
|
|
56
|
+
const { duration } = this.options;
|
|
57
|
+
this.container.style.transition = `transform ${duration}ms ease-out, opacity ${duration}ms ease-out`;
|
|
58
|
+
setTimeout(() => {
|
|
59
|
+
this.container.style.transform = `translateX(0px) translateY(${y}px)`;
|
|
60
|
+
this.container.style.opacity = opacity;
|
|
61
|
+
}, 1);
|
|
62
|
+
}
|
|
63
|
+
/** Places the container below the element, kept on screen. */
|
|
64
|
+
_place() {
|
|
65
|
+
const { margin, transition, align } = this.options;
|
|
66
|
+
const { offsetHeight, offsetWidth } = this.el;
|
|
67
|
+
const width = this.container.offsetWidth;
|
|
68
|
+
const rect = this.el.getBoundingClientRect();
|
|
69
|
+
let left = rect.left + window.scrollX;
|
|
70
|
+
if (align === "center") left += offsetWidth / 2 - width / 2;
|
|
71
|
+
else if (align === "right") left += offsetWidth - width - margin;
|
|
72
|
+
const top = rect.top + window.scrollY + offsetHeight + margin;
|
|
73
|
+
const coordinates = Utils._repositionWithinScreen(left, top, width, this.container.offsetHeight, margin, transition, align);
|
|
74
|
+
Utils._placeInOffsetParent(this.container, coordinates);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export {
|
|
79
|
+
DockedDisplayPlugin
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=chunk-CY2CTOVM.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/ts/plugins/dockedDisplayPlugin.ts"],
|
|
4
|
+
"sourcesContent": ["import { Utils } from '../core/utils';\n\nexport interface DockedDisplayPluginOptions {\n /**\n * Margin between element and docked container\n */\n margin: number,\n /**\n * Transition movement\n */\n transition: number,\n /**\n * Transition duration\n */\n duration: number,\n /**\n * The alignment of the docked container\n */\n align: string\n}\n\nconst _defaults: DockedDisplayPluginOptions = {\n margin: 5,\n transition: 10,\n duration: 250,\n align: 'left'\n}\n\nexport class DockedDisplayPlugin {\n private readonly el: HTMLElement;\n private readonly container: HTMLDivElement;\n private options: Partial<DockedDisplayPluginOptions>;\n private visible: boolean;\n /**\n * Elements whose clicks count as inside, beside the container: the element\n * the container docks to, and any other control that opens it, such as a\n * date range's end input. A click on one of those must not close it.\n */\n readonly triggers: HTMLElement[];\n\n constructor(el: HTMLElement, container: HTMLElement, options: Partial<DockedDisplayPluginOptions>) {\n this.el = el;\n this.triggers = [el];\n this.options = {\n ..._defaults,\n ...options\n };\n\n this.container = document.createElement('div');\n this.container.classList.add('display-docked');\n this.container.append(container);\n el.parentElement.append(this.container);\n }\n\n private _handleDocumentClick = (e: MouseEvent) => {\n if (!this.visible) return;\n const path = e.composedPath();\n if (![...this.triggers, this.container].some((inside) => path.includes(inside))) this.hide();\n };\n\n /** Eases the container to `y` pixels down and to `opacity`. */\n private _animate(y: number, opacity: string) {\n const { duration } = this.options;\n this.container.style.transition = `transform ${duration}ms ease-out, opacity ${duration}ms ease-out`;\n setTimeout(() => {\n this.container.style.transform = `translateX(0px) translateY(${y}px)`;\n this.container.style.opacity = opacity;\n }, 1);\n }\n\n /** Places the container below the element, kept on screen. */\n private _place() {\n const { margin, transition, align } = this.options;\n const { offsetHeight, offsetWidth } = this.el;\n const width = this.container.offsetWidth;\n const rect = this.el.getBoundingClientRect();\n let left = rect.left + window.scrollX;\n if (align === 'center') left += offsetWidth / 2 - width / 2;\n else if (align === 'right') left += offsetWidth - width - margin;\n const top = rect.top + window.scrollY + offsetHeight + margin;\n const coordinates = Utils._repositionWithinScreen(left, top, width, this.container.offsetHeight, margin, transition, align);\n Utils._placeInOffsetParent(this.container, coordinates);\n }\n\n /**\n * Tears the plugin down. While shown, the document listener holds a\n * reference to this instance - and through it the whole picker subtree - so\n * the owning component must call this from its own destroy().\n */\n destroy = () => {\n document.removeEventListener('click', this._handleDocumentClick);\n this.container.remove();\n };\n\n show = () => {\n if (this.visible) return;\n this.visible = true;\n document.addEventListener('click', this._handleDocumentClick);\n this._place();\n this.container.style.visibility = 'visible';\n this._animate(this.options.transition, '1');\n };\n\n hide = () => {\n if (!this.visible) return;\n this.visible = false;\n document.removeEventListener('click', this._handleDocumentClick);\n this.container.removeAttribute('style');\n this._animate(0, '0');\n };\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AAqBA,IAAM,YAAwC;AAAA,EAC5C,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,OAAO;AACT;AAEO,IAAM,sBAAN,MAA0B;AAAA,EAY/B,YAAY,IAAiB,WAAwB,SAA8C;AAcnG,SAAQ,uBAAuB,CAAC,MAAkB;AAChD,UAAI,CAAC,KAAK,QAAS;AACnB,YAAM,OAAO,EAAE,aAAa;AAC5B,UAAI,CAAC,CAAC,GAAG,KAAK,UAAU,KAAK,SAAS,EAAE,KAAK,CAAC,WAAW,KAAK,SAAS,MAAM,CAAC,EAAG,MAAK,KAAK;AAAA,IAC7F;AA+BA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAU,MAAM;AACd,eAAS,oBAAoB,SAAS,KAAK,oBAAoB;AAC/D,WAAK,UAAU,OAAO;AAAA,IACxB;AAEA,gBAAO,MAAM;AACX,UAAI,KAAK,QAAS;AAClB,WAAK,UAAU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