@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,17 +1,95 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
ModalDisplayPlugin,
|
|
3
|
+
createDisplayPlugin,
|
|
4
|
+
hideModal
|
|
5
|
+
} from "./chunk-B55LWKBM.mjs";
|
|
4
6
|
import {
|
|
5
7
|
FormSelect
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import {
|
|
8
|
-
Utils
|
|
9
|
-
} from "./chunk-M372EDXD.mjs";
|
|
8
|
+
} from "./chunk-XJPMW5SP.mjs";
|
|
10
9
|
import {
|
|
11
10
|
Component
|
|
12
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-EB2V4OKL.mjs";
|
|
12
|
+
import {
|
|
13
|
+
Utils,
|
|
14
|
+
afterFormReset,
|
|
15
|
+
pickerFooter
|
|
16
|
+
} from "./chunk-67UNY7RH.mjs";
|
|
13
17
|
|
|
14
18
|
// src/ts/components/datepicker.ts
|
|
19
|
+
var MONTHS = Array.from({ length: 12 }, (_, month) => new Date(Date.UTC(2023, month, 1)));
|
|
20
|
+
var WEEKDAYS = Array.from({ length: 7 }, (_, day) => new Date(Date.UTC(2023, 0, 1 + day)));
|
|
21
|
+
function localeDates(locale) {
|
|
22
|
+
const names = (dates, options) => {
|
|
23
|
+
const format = new Intl.DateTimeFormat(locale, { ...options, calendar: "gregory", timeZone: "UTC" });
|
|
24
|
+
return dates.map((date) => format.format(date));
|
|
25
|
+
};
|
|
26
|
+
const intl = new Intl.Locale(locale);
|
|
27
|
+
const week = intl.getWeekInfo?.() ?? intl.weekInfo;
|
|
28
|
+
return {
|
|
29
|
+
week: week ? { firstDay: week.firstDay % 7 } : {},
|
|
30
|
+
i18n: {
|
|
31
|
+
months: names(MONTHS, { month: "long" }),
|
|
32
|
+
monthsShort: names(MONTHS, { month: "short" }),
|
|
33
|
+
weekdays: names(WEEKDAYS, { weekday: "long" }),
|
|
34
|
+
weekdaysShort: names(WEEKDAYS, { weekday: "short" }),
|
|
35
|
+
weekdaysAbbrev: names(WEEKDAYS, { weekday: "narrow" })
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
var escapeRegExp = (text) => text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
40
|
+
var NUMBER = "(\\d{1,2})";
|
|
41
|
+
var named = (names, key) => [
|
|
42
|
+
`(${names.map(escapeRegExp).join("|")})`,
|
|
43
|
+
(parts, text) => key && (parts[key] = names.findIndex((name) => name.toLowerCase() === text.toLowerCase()))
|
|
44
|
+
];
|
|
45
|
+
var READERS = {
|
|
46
|
+
d: () => [NUMBER, (parts, text) => parts.day = +text],
|
|
47
|
+
dd: () => [NUMBER, (parts, text) => parts.day = +text],
|
|
48
|
+
ddd: (i18n) => named(i18n.weekdaysShort),
|
|
49
|
+
dddd: (i18n) => named(i18n.weekdays),
|
|
50
|
+
m: () => [NUMBER, (parts, text) => parts.month = +text - 1],
|
|
51
|
+
mm: () => [NUMBER, (parts, text) => parts.month = +text - 1],
|
|
52
|
+
mmm: (i18n) => named(i18n.monthsShort, "month"),
|
|
53
|
+
mmmm: (i18n) => named(i18n.months, "month"),
|
|
54
|
+
// As Date.parse reads them: 00 to 49 in this century, 50 to 99 in the last.
|
|
55
|
+
yy: () => ["(\\d{2})", (parts, text) => parts.year = +text + (+text < 50 ? 2e3 : 1900)],
|
|
56
|
+
yyyy: () => ["(\\d{4})", (parts, text) => parts.year = +text]
|
|
57
|
+
};
|
|
58
|
+
var pad = (n) => String(n).padStart(2, "0");
|
|
59
|
+
var FORMATS = {
|
|
60
|
+
d: (date) => date.getDate(),
|
|
61
|
+
dd: (date) => pad(date.getDate()),
|
|
62
|
+
ddd: (date, i18n) => i18n.weekdaysShort[date.getDay()],
|
|
63
|
+
dddd: (date, i18n) => i18n.weekdays[date.getDay()],
|
|
64
|
+
m: (date) => date.getMonth() + 1,
|
|
65
|
+
mm: (date) => pad(date.getMonth() + 1),
|
|
66
|
+
mmm: (date, i18n) => i18n.monthsShort[date.getMonth()],
|
|
67
|
+
mmmm: (date, i18n) => i18n.months[date.getMonth()],
|
|
68
|
+
yy: (date) => String(date.getFullYear()).slice(2),
|
|
69
|
+
yyyy: (date) => date.getFullYear()
|
|
70
|
+
};
|
|
71
|
+
function readDate(value, format, i18n) {
|
|
72
|
+
const readers = [];
|
|
73
|
+
const pattern = format.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g).map((token) => {
|
|
74
|
+
const reader = READERS[token]?.(i18n);
|
|
75
|
+
if (reader) readers.push(reader);
|
|
76
|
+
return reader ? reader[0] : escapeRegExp(token);
|
|
77
|
+
});
|
|
78
|
+
const match = new RegExp(`^\\s*${pattern.join("")}\\s*$`, "iu").exec(value);
|
|
79
|
+
if (!match) return null;
|
|
80
|
+
const parts = {};
|
|
81
|
+
readers.forEach(([, set], i) => set(parts, match[i + 1]));
|
|
82
|
+
const date = new Date(2e3, 0, 1);
|
|
83
|
+
date.setFullYear(parts.year, parts.month, parts.day);
|
|
84
|
+
const same = [date.getFullYear(), date.getMonth(), date.getDate()].join() === [parts.year, parts.month, parts.day].join();
|
|
85
|
+
return same ? date : null;
|
|
86
|
+
}
|
|
87
|
+
function withLocale(el, options = {}) {
|
|
88
|
+
const locale = Utils.locale(el);
|
|
89
|
+
if (!locale) return options;
|
|
90
|
+
const { week, i18n } = localeDates(locale);
|
|
91
|
+
return { ...week, ...options, i18n: { ...i18n, ...options.i18n } };
|
|
92
|
+
}
|
|
15
93
|
var _defaults = {
|
|
16
94
|
// the default output format for the input field value
|
|
17
95
|
format: "mmm dd, yyyy",
|
|
@@ -46,8 +124,6 @@ var _defaults = {
|
|
|
46
124
|
maxYear: 9999,
|
|
47
125
|
minMonth: void 0,
|
|
48
126
|
maxMonth: void 0,
|
|
49
|
-
startRange: null,
|
|
50
|
-
endRange: null,
|
|
51
127
|
isRTL: false,
|
|
52
128
|
yearRangeReverse: false,
|
|
53
129
|
// Render the month after year in the calendar title
|
|
@@ -67,8 +143,8 @@ var _defaults = {
|
|
|
67
143
|
cancel: "Cancel",
|
|
68
144
|
clear: "Clear",
|
|
69
145
|
done: "Ok",
|
|
70
|
-
previousMonth: "
|
|
71
|
-
nextMonth: "
|
|
146
|
+
previousMonth: "Previous month",
|
|
147
|
+
nextMonth: "Next month",
|
|
72
148
|
months: [
|
|
73
149
|
"January",
|
|
74
150
|
"February",
|
|
@@ -114,12 +190,14 @@ var _defaults = {
|
|
|
114
190
|
};
|
|
115
191
|
var _Datepicker = class _Datepicker extends Component {
|
|
116
192
|
constructor(el, options) {
|
|
117
|
-
|
|
193
|
+
options = withLocale(el, options);
|
|
194
|
+
super(el, options);
|
|
118
195
|
this.multiple = false;
|
|
119
196
|
/** What setInputValue last wrote, so reading it back does not depend on the parser. */
|
|
120
197
|
this._writtenInputs = /* @__PURE__ */ new WeakMap();
|
|
121
|
-
|
|
122
|
-
|
|
198
|
+
this._resetDates = /* @__PURE__ */ new WeakMap();
|
|
199
|
+
// Counts selections, so a callback that selects again silences the stale event.
|
|
200
|
+
this._selection = 0;
|
|
123
201
|
/** Nesting depth of {@link _batchDraws}; > 0 means draws are being collected. */
|
|
124
202
|
this._drawDepth = 0;
|
|
125
203
|
/** Whether a draw was requested while batching. */
|
|
@@ -129,18 +207,20 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
129
207
|
/** id linking the controls element to the table's aria-labelledby. */
|
|
130
208
|
this._randId = null;
|
|
131
209
|
this._focusedDate = null;
|
|
210
|
+
// Bound to the date inputs only, so the target is one of them.
|
|
132
211
|
this._handleInputClick = (e) => {
|
|
133
|
-
|
|
212
|
+
const input = e.target;
|
|
213
|
+
if (input.type == "date" && (this.options.openByDefault || this.options.container)) e.preventDefault();
|
|
134
214
|
this._batchDraws(() => {
|
|
135
|
-
this.setDateFromInput(
|
|
215
|
+
this.setDateFromInput(input);
|
|
136
216
|
this.draw();
|
|
137
|
-
this.gotoDate(
|
|
217
|
+
this.gotoDate(input === this.el ? this.date : this.endDate);
|
|
138
218
|
});
|
|
139
|
-
|
|
219
|
+
this._showDisplay();
|
|
140
220
|
if (this.options.onInputInteraction) this.options.onInputInteraction.call(this);
|
|
141
221
|
};
|
|
142
|
-
this._handleInputKeydown = (e) => {
|
|
143
|
-
if (e.key ===
|
|
222
|
+
this._handleInputKeydown = Utils.ignoringComposition((e) => {
|
|
223
|
+
if (e.key === "Enter") {
|
|
144
224
|
e.preventDefault();
|
|
145
225
|
this._batchDraws(() => {
|
|
146
226
|
this.setDateFromInput(e.target);
|
|
@@ -151,7 +231,7 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
151
231
|
this._syncCalendarFocus(true);
|
|
152
232
|
if (this.options.onInputInteraction) this.options.onInputInteraction.call(this);
|
|
153
233
|
}
|
|
154
|
-
};
|
|
234
|
+
});
|
|
155
235
|
this._handleCalendarFocus = (event) => {
|
|
156
236
|
const button = event.target;
|
|
157
237
|
if (!button.matches(".datepicker-day-button")) return;
|
|
@@ -160,7 +240,7 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
160
240
|
};
|
|
161
241
|
this._handleCalendarKeydown = (event) => {
|
|
162
242
|
const button = event.target;
|
|
163
|
-
if (!button.matches(".datepicker-day-button") ||
|
|
243
|
+
if (!button.matches(".datepicker-day-button") || !Utils.plainKey(event)) return;
|
|
164
244
|
const date = this._dayDate(button);
|
|
165
245
|
const weekday = (date.getDay() - this.options.firstDay + 7) % 7;
|
|
166
246
|
const offsets = {
|
|
@@ -192,13 +272,13 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
192
272
|
};
|
|
193
273
|
this._handleCalendarClick = (e) => {
|
|
194
274
|
const target = e.target;
|
|
195
|
-
if (target.
|
|
275
|
+
if (target.closest(".is-disabled")) return;
|
|
196
276
|
this._batchDraws(() => {
|
|
197
277
|
if (target.classList.contains("datepicker-day-button") && !target.classList.contains("is-empty") && !target.parentElement.classList.contains("is-disabled") && !target.parentElement.classList.contains("is-selection-disabled")) {
|
|
198
278
|
const selectedDate = new Date(
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
279
|
+
Number(target.getAttribute("data-year")),
|
|
280
|
+
Number(target.getAttribute("data-month")),
|
|
281
|
+
Number(target.getAttribute("data-day"))
|
|
202
282
|
);
|
|
203
283
|
if (!this.multiple || this.options.isMultipleSelection) {
|
|
204
284
|
this.setDate(selectedDate);
|
|
@@ -216,18 +296,17 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
216
296
|
};
|
|
217
297
|
this._handleDateRangeCalendarClick = (date) => {
|
|
218
298
|
if (this.endDate == null || !_Datepicker._compareDates(date, this.endDate)) {
|
|
219
|
-
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
this.setDate(date, false, _Datepicker._isDate(this.date));
|
|
299
|
+
this.setDate(date, false, _Datepicker._isDate(this.date) && date >= this.date);
|
|
223
300
|
return;
|
|
224
301
|
}
|
|
225
302
|
this._clearDates();
|
|
226
303
|
this.draw();
|
|
227
304
|
};
|
|
305
|
+
// Like a day click: a picker with Ok and Cancel, which a modal always is,
|
|
306
|
+
// writes the cleared input on Ok, so Cancel keeps the value.
|
|
228
307
|
this._handleClearClick = () => {
|
|
229
308
|
this._clearDates();
|
|
230
|
-
this.
|
|
309
|
+
if (this.options.autoSubmit) this._finishSelection();
|
|
231
310
|
};
|
|
232
311
|
this._clearDates = () => {
|
|
233
312
|
this.date = null;
|
|
@@ -241,8 +320,16 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
241
320
|
this._handleYearChange = (e) => {
|
|
242
321
|
this.gotoYear(e.target.value);
|
|
243
322
|
};
|
|
323
|
+
// A reset restores the inputs' values after its event, without a change
|
|
324
|
+
// event. Drop the inputs added for extra dates and read the selection back
|
|
325
|
+
// from what the reset left.
|
|
326
|
+
this._readBack = () => {
|
|
327
|
+
if (this.options.isMultipleSelection) this._readBackMultiple();
|
|
328
|
+
else this._readBackSingle();
|
|
329
|
+
this.draw();
|
|
330
|
+
};
|
|
244
331
|
this._handleInputChange = (e) => {
|
|
245
|
-
if (e
|
|
332
|
+
if (e instanceof CustomEvent && e.detail?.firedBy === this) return;
|
|
246
333
|
this.setDateFromInput(e.target);
|
|
247
334
|
};
|
|
248
335
|
this._finishSelection = () => {
|
|
@@ -250,21 +337,15 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
250
337
|
};
|
|
251
338
|
this._confirm = () => {
|
|
252
339
|
this._finishSelection();
|
|
253
|
-
|
|
340
|
+
hideModal(this.displayPlugin);
|
|
341
|
+
this._notify("confirm", this.options.onConfirm, { args: [] });
|
|
254
342
|
};
|
|
255
343
|
this._cancel = () => {
|
|
256
|
-
|
|
344
|
+
hideModal(this.displayPlugin);
|
|
345
|
+
this._notify("cancel", this.options.onCancel, { args: [] });
|
|
257
346
|
};
|
|
258
|
-
this.
|
|
259
|
-
this.
|
|
260
|
-
..._Datepicker.defaults,
|
|
261
|
-
...options
|
|
262
|
-
};
|
|
263
|
-
if (!!options && options.hasOwnProperty("i18n") && typeof options.i18n === "object") {
|
|
264
|
-
this.options.i18n = { ..._Datepicker.defaults.i18n, ...options.i18n };
|
|
265
|
-
}
|
|
266
|
-
if (this.options.minDate) this.options.minDate.setHours(0, 0, 0, 0);
|
|
267
|
-
if (this.options.maxDate) this.options.maxDate.setHours(0, 0, 0, 0);
|
|
347
|
+
if (this.options.displayPlugin === "modal") Object.assign(this.options, { openByDefault: true, autoSubmit: false });
|
|
348
|
+
this._setDateBounds();
|
|
268
349
|
this.id = Utils.guid();
|
|
269
350
|
if (this.options.isMultipleSelection) {
|
|
270
351
|
this.multiple = true;
|
|
@@ -274,7 +355,8 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
274
355
|
this._setupVariables();
|
|
275
356
|
this._insertHTMLIntoDOM();
|
|
276
357
|
this._setupEventHandlers();
|
|
277
|
-
|
|
358
|
+
const fromValue = !this.options.defaultDate;
|
|
359
|
+
if (fromValue) {
|
|
278
360
|
this.options.defaultDate = this._parseInput(this.el.value);
|
|
279
361
|
}
|
|
280
362
|
const defDate = this.options.defaultDate;
|
|
@@ -282,11 +364,13 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
282
364
|
if (this.options.setDefaultDate) {
|
|
283
365
|
this.setDate(defDate, true);
|
|
284
366
|
this.setInputValue(this.el, defDate);
|
|
367
|
+
} else if (fromValue && this._isSelectableDay(defDate)) {
|
|
368
|
+
this.setDate(defDate, true);
|
|
285
369
|
} else {
|
|
286
|
-
this.gotoDate(defDate);
|
|
370
|
+
this.gotoDate(this._withinBounds(defDate));
|
|
287
371
|
}
|
|
288
372
|
} else {
|
|
289
|
-
this.gotoDate(/* @__PURE__ */ new Date());
|
|
373
|
+
this.gotoDate(this._withinBounds(/* @__PURE__ */ new Date()));
|
|
290
374
|
}
|
|
291
375
|
if (this.options.isDateRange) {
|
|
292
376
|
this.multiple = true;
|
|
@@ -298,21 +382,19 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
298
382
|
}
|
|
299
383
|
}
|
|
300
384
|
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
385
|
+
this.displayPlugin = createDisplayPlugin(this.options.displayPlugin, this.el, this.containerEl, this.options.displayPluginOptions, this._cancel);
|
|
386
|
+
if (this.endDateEl) this.displayPlugin?.triggers.push(this.endDateEl);
|
|
387
|
+
for (const input of [this.el, this.endDateEl]) this._rememberResetDate(input);
|
|
388
|
+
}
|
|
389
|
+
// Only a default the picker wrote needs this: any other default text parses
|
|
390
|
+
// at reset exactly as it did here.
|
|
391
|
+
_rememberResetDate(input) {
|
|
392
|
+
const written = input && this._writtenInputs.get(input);
|
|
393
|
+
if (written && written.value === input.defaultValue) this._resetDates.set(input, written);
|
|
304
394
|
}
|
|
305
395
|
static get defaults() {
|
|
306
396
|
return _defaults;
|
|
307
397
|
}
|
|
308
|
-
/**
|
|
309
|
-
* Initializes instances of Datepicker.
|
|
310
|
-
* @param els HTML elements.
|
|
311
|
-
* @param options Component options.
|
|
312
|
-
*/
|
|
313
|
-
static init(els, options = {}) {
|
|
314
|
-
return super.init(els, options, _Datepicker);
|
|
315
|
-
}
|
|
316
398
|
/**
|
|
317
399
|
* Escape a value for interpolation into the calendar markup.
|
|
318
400
|
*
|
|
@@ -328,65 +410,55 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
328
410
|
static _isDate(obj) {
|
|
329
411
|
return /Date/.test(Object.prototype.toString.call(obj)) && !isNaN(obj.getTime());
|
|
330
412
|
}
|
|
413
|
+
/**
|
|
414
|
+
* A value read without a custom parser: in the picker's own string format
|
|
415
|
+
* with its names, or else as an ISO date or by the browser.
|
|
416
|
+
*/
|
|
417
|
+
_readDefault(value, el) {
|
|
418
|
+
const { format, i18n } = this.options;
|
|
419
|
+
const read = typeof format === "string" && el.type !== "date" ? readDate(value, format, i18n) : null;
|
|
420
|
+
return read ?? _Datepicker._parseDate(value);
|
|
421
|
+
}
|
|
331
422
|
static _parseDate(value) {
|
|
332
423
|
value = value.trim();
|
|
333
424
|
if (!/^\d{4}-\d{2}-\d{2}$/.test(value)) return new Date(Date.parse(value));
|
|
334
425
|
const date = /* @__PURE__ */ new Date(value + "T00:00:00");
|
|
335
426
|
return date.getDate() === Number(value.slice(-2)) ? date : /* @__PURE__ */ new Date(NaN);
|
|
336
427
|
}
|
|
337
|
-
_parseInput(value) {
|
|
338
|
-
if (!value.trim() || !this.options.parse) return
|
|
428
|
+
_parseInput(value, el = this.el) {
|
|
429
|
+
if (!value.trim() || !this.options.parse) return this._readDefault(value, el);
|
|
339
430
|
return this.options.parse(
|
|
340
431
|
value,
|
|
341
432
|
typeof this.options.format === "string" ? this.options.format : ""
|
|
342
433
|
);
|
|
343
434
|
}
|
|
344
|
-
static _isWeekend(date) {
|
|
345
|
-
const day = date.getDay();
|
|
346
|
-
return day === 0 || day === 6;
|
|
347
|
-
}
|
|
348
435
|
/**
|
|
349
436
|
* @deprecated as this function has no effect without any return statement or global parameter setter.
|
|
350
437
|
*/
|
|
351
438
|
static _setToStartOfDay(date) {
|
|
352
439
|
if (_Datepicker._isDate(date)) date.setHours(0, 0, 0, 0);
|
|
353
440
|
}
|
|
354
|
-
static _getDaysInMonth(year, month) {
|
|
355
|
-
return [31, _Datepicker._isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month];
|
|
356
|
-
}
|
|
357
|
-
static _isLeapYear(year) {
|
|
358
|
-
return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
|
|
359
|
-
}
|
|
360
441
|
static _compareDates(a, b) {
|
|
361
442
|
return a.getTime() === b.getTime();
|
|
362
443
|
}
|
|
363
|
-
static _compareWithinRange(day, date, dateEnd) {
|
|
364
|
-
return day.getTime() > date.getTime() && day.getTime() < dateEnd.getTime();
|
|
365
|
-
}
|
|
366
|
-
static _comparePastDate(a, b) {
|
|
367
|
-
return a.getTime() < b.getTime();
|
|
368
|
-
}
|
|
369
|
-
static getInstance(el) {
|
|
370
|
-
return el["Expressive_Datepicker"];
|
|
371
|
-
}
|
|
372
444
|
destroy() {
|
|
373
|
-
this.
|
|
445
|
+
this._events.abort();
|
|
374
446
|
this.dateEls?.slice(1).forEach((input) => this._removeDateInput(input));
|
|
375
447
|
if (!this.options.dateRangeEndEl && this.endDateEl) this._removeDateInput(this.endDateEl);
|
|
376
448
|
this.displayPlugin?.destroy();
|
|
377
449
|
this.containerEl.remove();
|
|
378
450
|
this.destroySelects();
|
|
379
|
-
this.
|
|
451
|
+
this._removeDateOverlay();
|
|
452
|
+
super.destroy();
|
|
453
|
+
}
|
|
454
|
+
// CSS paints data-date over a native date input's own text.
|
|
455
|
+
_removeDateOverlay() {
|
|
456
|
+
this.el.classList.remove("datepicker-date-input");
|
|
457
|
+
for (const input of [this.el, this.endDateEl]) if (input?.type === "date") input.removeAttribute("data-date");
|
|
380
458
|
}
|
|
381
459
|
destroySelects() {
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
FormSelect.getInstance(oldYearSelect).destroy();
|
|
385
|
-
}
|
|
386
|
-
const oldMonthSelect = this.calendarEl.querySelector(".orig-select-month");
|
|
387
|
-
if (oldMonthSelect) {
|
|
388
|
-
FormSelect.getInstance(oldMonthSelect).destroy();
|
|
389
|
-
}
|
|
460
|
+
this._formSelect(".orig-select-year")?.destroy();
|
|
461
|
+
this._formSelect(".orig-select-month")?.destroy();
|
|
390
462
|
}
|
|
391
463
|
_insertHTMLIntoDOM() {
|
|
392
464
|
if (this.el.type == "date") {
|
|
@@ -399,7 +471,7 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
399
471
|
this.endDateEl = this.createDateInput();
|
|
400
472
|
this.endDateEl.classList.add("datepicker-end-date");
|
|
401
473
|
} else {
|
|
402
|
-
this.endDateEl =
|
|
474
|
+
this.endDateEl = Utils.querySelector(this.el, this.options.dateRangeEndEl);
|
|
403
475
|
if (!this.endDateEl) {
|
|
404
476
|
console.warn("Specified date range end input element in dateRangeEndEl not found");
|
|
405
477
|
} else {
|
|
@@ -407,14 +479,12 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
407
479
|
}
|
|
408
480
|
}
|
|
409
481
|
}
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
this.options.container = optEl instanceof HTMLElement ? optEl : document.querySelector(optEl);
|
|
417
|
-
this.options.container.append(this.containerEl);
|
|
482
|
+
pickerFooter(this.footer, this.options, "datepicker-clear", this._handleClearClick, this._confirm, this._cancel);
|
|
483
|
+
const optEl = this.options.container;
|
|
484
|
+
const container = typeof optEl === "string" ? Utils.querySelector(this.el, optEl) : optEl;
|
|
485
|
+
if (container) {
|
|
486
|
+
this.options.container = container;
|
|
487
|
+
container.append(this.containerEl);
|
|
418
488
|
} else {
|
|
419
489
|
const appendTo = !this.endDateEl ? this.el : this.endDateEl;
|
|
420
490
|
if (!this.options.openByDefault) this.containerEl.setAttribute("style", "display: none; visibility: hidden;");
|
|
@@ -444,29 +514,44 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
444
514
|
*/
|
|
445
515
|
formatDate(date, format) {
|
|
446
516
|
const formatArray = format.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g);
|
|
447
|
-
return formatArray.map((label) =>
|
|
517
|
+
return formatArray.map((label) => FORMATS[label] ? FORMATS[label](date, this.options.i18n) : label).join("");
|
|
448
518
|
}
|
|
449
519
|
/**
|
|
450
520
|
* Sets date from input field.
|
|
451
521
|
*/
|
|
452
522
|
setDateFromInput(el) {
|
|
453
|
-
|
|
523
|
+
this._syncDataDate(el);
|
|
454
524
|
if ((this.options.isDateRange || !this.options.isMultipleSelection) && !el.value.trim()) {
|
|
455
525
|
this.setSingleDate(null, el === this.endDateEl);
|
|
456
526
|
this.draw();
|
|
457
527
|
return;
|
|
458
528
|
}
|
|
459
|
-
const
|
|
460
|
-
const parsedDate = written && written.value === el.value ? written.date : this._parseInput(el.value);
|
|
529
|
+
const parsedDate = this._dateInInput(el);
|
|
461
530
|
if (!_Datepicker._isDate(parsedDate)) return;
|
|
462
531
|
const date = new Date(parsedDate.getTime());
|
|
463
532
|
_Datepicker._setToStartOfDay(date);
|
|
464
533
|
const isEndDate = el === this.endDateEl;
|
|
465
|
-
|
|
466
|
-
|
|
534
|
+
const outOfOrder = this.options.isDateRange && (isEndDate ? this.date && date < this.date : this.endDate && date > this.endDate);
|
|
535
|
+
if (outOfOrder || this._isDisabledDay(date)) {
|
|
536
|
+
this.setInputValue(el, this._selectedDateFor(el));
|
|
467
537
|
return;
|
|
468
538
|
}
|
|
469
|
-
this.
|
|
539
|
+
const unchanged = this._shows(el, date);
|
|
540
|
+
this._selectTypedMultiDate(el, date);
|
|
541
|
+
this.setDate(date, unchanged, isEndDate, true);
|
|
542
|
+
}
|
|
543
|
+
/** Whether `date` is the date already selected for `el`. */
|
|
544
|
+
_shows(el, date) {
|
|
545
|
+
return this._selectedDateFor(el)?.getTime() === date.getTime();
|
|
546
|
+
}
|
|
547
|
+
// setDate does not toggle a typed date into a multiple selection, so it goes
|
|
548
|
+
// in here, in place of the date its input showed. Re-reading an input on
|
|
549
|
+
// click leaves the selection as it was.
|
|
550
|
+
_selectTypedMultiDate(el, date) {
|
|
551
|
+
if (!this.options.isMultipleSelection) return;
|
|
552
|
+
const shown = this._selectedDateFor(el);
|
|
553
|
+
this.dates = this.dates.filter((day) => day !== shown && day.getTime() !== date.getTime());
|
|
554
|
+
this.setMultiDate(date);
|
|
470
555
|
}
|
|
471
556
|
/**
|
|
472
557
|
* Set a date on the datepicker.
|
|
@@ -481,12 +566,12 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
481
566
|
return;
|
|
482
567
|
}
|
|
483
568
|
_Datepicker._setToStartOfDay(selectedDate);
|
|
569
|
+
const selection = ++this._selection;
|
|
484
570
|
if (!this.options.isMultipleSelection) this.setSingleDate(selectedDate, isEndDate);
|
|
485
571
|
else if (!fromUserInput) this.setMultiDate(selectedDate);
|
|
486
572
|
this.gotoDate(selectedDate);
|
|
487
|
-
if (
|
|
488
|
-
|
|
489
|
-
}
|
|
573
|
+
if (preventOnSelect) return;
|
|
574
|
+
this._notify("select", this.options.onSelect, { args: [selectedDate], detail: { date: selectedDate }, current: () => selection === this._selection });
|
|
490
575
|
}
|
|
491
576
|
validateDate(date) {
|
|
492
577
|
if (!date) {
|
|
@@ -499,6 +584,10 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
499
584
|
if (!_Datepicker._isDate(date)) {
|
|
500
585
|
return;
|
|
501
586
|
}
|
|
587
|
+
return this._withinBounds(date);
|
|
588
|
+
}
|
|
589
|
+
/** A copy of `date`, moved to minDate or maxDate when it falls outside them. */
|
|
590
|
+
_withinBounds(date) {
|
|
502
591
|
const min = this.options.minDate, max = this.options.maxDate;
|
|
503
592
|
if (_Datepicker._isDate(min) && date < min) {
|
|
504
593
|
date = min;
|
|
@@ -507,6 +596,38 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
507
596
|
}
|
|
508
597
|
return new Date(date.getTime());
|
|
509
598
|
}
|
|
599
|
+
/**
|
|
600
|
+
* The date an input holds. Without a custom parser, Date.parse reads
|
|
601
|
+
* "05/10/2026" from a dd/mm/yyyy format as 10 May, so reuse the date behind
|
|
602
|
+
* a value the picker wrote, or behind the value the input resets to.
|
|
603
|
+
*/
|
|
604
|
+
_dateInInput(el) {
|
|
605
|
+
const known = !this.options.parse && [this._writtenInputs.get(el), this._resetDates.get(el)].find((entry) => entry?.value === el.value);
|
|
606
|
+
return known ? known.date : this._parseInput(el.value, el);
|
|
607
|
+
}
|
|
608
|
+
/** The selected date an input shows: its place in `dates` for a multiple selection. */
|
|
609
|
+
_selectedDateFor(el) {
|
|
610
|
+
if (this.options.isMultipleSelection) return this.dates[this.dateEls.indexOf(el)] ?? null;
|
|
611
|
+
return el === this.endDateEl ? this.endDate : this.date;
|
|
612
|
+
}
|
|
613
|
+
/** `_isDisabledDay` for a date that may carry a time of day. */
|
|
614
|
+
_isSelectableDay(date) {
|
|
615
|
+
const day = new Date(date.getTime());
|
|
616
|
+
_Datepicker._setToStartOfDay(day);
|
|
617
|
+
return !this._isDisabledDay(day);
|
|
618
|
+
}
|
|
619
|
+
/** Whether the calendar shows `day` as disabled: outside the bounds, or refused by an option. */
|
|
620
|
+
_isDisabledDay(day) {
|
|
621
|
+
return this._isOutOfBounds(day) || this._isRefusedDay(day);
|
|
622
|
+
}
|
|
623
|
+
_isOutOfBounds(day) {
|
|
624
|
+
const { minDate, maxDate } = this.options;
|
|
625
|
+
return minDate && day < minDate || maxDate && day > maxDate;
|
|
626
|
+
}
|
|
627
|
+
_isRefusedDay(day) {
|
|
628
|
+
const { disableWeekends, disableDayFn } = this.options;
|
|
629
|
+
return disableWeekends && [0, 6].includes(day.getDay()) || !!disableDayFn?.(day);
|
|
630
|
+
}
|
|
510
631
|
/**
|
|
511
632
|
* Set a single date on the datepicker.
|
|
512
633
|
* @param date Date to set on the datepicker.
|
|
@@ -530,7 +651,7 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
530
651
|
} else {
|
|
531
652
|
this.dates.splice(index, 1);
|
|
532
653
|
}
|
|
533
|
-
this.dates.sort((a, b) => a.getTime()
|
|
654
|
+
this.dates.sort((a, b) => a.getTime() - b.getTime());
|
|
534
655
|
}
|
|
535
656
|
/**
|
|
536
657
|
* Sets the data-date attribute on the date input field
|
|
@@ -645,7 +766,7 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
645
766
|
this.adjustCalendars();
|
|
646
767
|
}
|
|
647
768
|
render(year, month, randId) {
|
|
648
|
-
const now = /* @__PURE__ */ new Date(), days =
|
|
769
|
+
const now = /* @__PURE__ */ new Date(), days = new Date(year, month + 1, 0).getDate(), data = [];
|
|
649
770
|
let before = new Date(year, month, 1).getDay(), row = [];
|
|
650
771
|
_Datepicker._setToStartOfDay(now);
|
|
651
772
|
if (this.options.firstDay > 0) {
|
|
@@ -654,10 +775,10 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
654
775
|
before += 7;
|
|
655
776
|
}
|
|
656
777
|
}
|
|
657
|
-
const previousMonth = month === 0 ? 11 : month - 1, nextMonth = month === 11 ? 0 : month + 1, yearOfPreviousMonth = month === 0 ? year - 1 : year, yearOfNextMonth = month === 11 ? year + 1 : year, daysInPreviousMonth =
|
|
778
|
+
const previousMonth = month === 0 ? 11 : month - 1, nextMonth = month === 11 ? 0 : month + 1, yearOfPreviousMonth = month === 0 ? year - 1 : year, yearOfNextMonth = month === 11 ? year + 1 : year, daysInPreviousMonth = new Date(year, month, 0).getDate();
|
|
658
779
|
const cells = Math.ceil((days + before) / 7) * 7;
|
|
659
780
|
for (let i = 0, r = 0; i < cells; i++) {
|
|
660
|
-
const day = new Date(year, month, 1 + (i - before)), isToday = _Datepicker._compareDates(day, now), hasEvent = this.options.events.indexOf(day.toDateString()) !== -1, isEmpty = i < before || i >= days + before,
|
|
781
|
+
const day = new Date(year, month, 1 + (i - before)), isToday = _Datepicker._compareDates(day, now), hasEvent = this.options.events.indexOf(day.toDateString()) !== -1, isEmpty = i < before || i >= days + before, isDisabled = this._isDisabledDay(day), isDateRangeStart = this.options.isDateRange && this.date && this.endDate && _Datepicker._compareDates(this.date, day), isDateRangeEnd = this.options.isDateRange && this.endDate && _Datepicker._compareDates(this.endDate, day), isDateRange = this.options.isDateRange && [this.date, this.endDate].every(_Datepicker._isDate) && day > this.date && day < this.endDate;
|
|
661
782
|
let dayNumber = 1 + (i - before), monthNumber = month, yearNumber = year;
|
|
662
783
|
let isSelected = false;
|
|
663
784
|
if (_Datepicker._isDate(this.date)) {
|
|
@@ -689,9 +810,6 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
689
810
|
isToday,
|
|
690
811
|
isDisabled,
|
|
691
812
|
isEmpty,
|
|
692
|
-
isStartRange,
|
|
693
|
-
isEndRange,
|
|
694
|
-
isInRange,
|
|
695
813
|
showDaysInNextAndPreviousMonths: this.options.showDaysInNextAndPreviousMonths,
|
|
696
814
|
isDateRangeStart,
|
|
697
815
|
isDateRangeEnd,
|
|
@@ -712,9 +830,6 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
712
830
|
isToday: "is-today",
|
|
713
831
|
isSelected: "is-selected",
|
|
714
832
|
hasEvent: "has-event",
|
|
715
|
-
isInRange: "is-inrange",
|
|
716
|
-
isStartRange: "is-startrange",
|
|
717
|
-
isEndRange: "is-endrange",
|
|
718
833
|
isDateRangeStart: "is-daterange-start",
|
|
719
834
|
isDateRangeEnd: "is-daterange-end",
|
|
720
835
|
isDateRange: "is-daterange"
|
|
@@ -728,7 +843,7 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
728
843
|
}
|
|
729
844
|
}
|
|
730
845
|
for (const [property, className] of Object.entries(classMap)) {
|
|
731
|
-
if (opts
|
|
846
|
+
if (opts[property]) {
|
|
732
847
|
arr.push(className);
|
|
733
848
|
}
|
|
734
849
|
}
|
|
@@ -740,7 +855,6 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
740
855
|
/** Assemble calendar cells; reject unsupported elements and attributes. */
|
|
741
856
|
renderRow(days, isRTL, isRowSelected) {
|
|
742
857
|
const row = '<tr class="datepicker-row' + (isRowSelected ? " is-selected" : "") + '">' + _Datepicker._calendarMarkup((isRTL ? days.reverse() : days).join(""), "tr") + "</tr>";
|
|
743
|
-
this._checkedRows.add(row);
|
|
744
858
|
return row;
|
|
745
859
|
}
|
|
746
860
|
/** Assemble calendar rows; reject unsupported elements and attributes. */
|
|
@@ -761,7 +875,6 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
761
875
|
renderBody(rows) {
|
|
762
876
|
const html = rows.join("");
|
|
763
877
|
const safeHtml = _Datepicker._calendarMarkup(html, "tbody");
|
|
764
|
-
this._checkedRows.clear();
|
|
765
878
|
return "<tbody>" + safeHtml + "</tbody>";
|
|
766
879
|
}
|
|
767
880
|
static _calendarMarkup(html, parent) {
|
|
@@ -802,6 +915,24 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
802
915
|
* Depends on the month, which is deliberately *not* part of the controls
|
|
803
916
|
* cache key - so the reuse path has to recompute and reapply it.
|
|
804
917
|
*/
|
|
918
|
+
/**
|
|
919
|
+
* Removes the time from minDate and maxDate, on copies: the caller's Date
|
|
920
|
+
* objects are theirs. Each also sets the month and year bounds, which the
|
|
921
|
+
* arrows, the month and year lists and PageUp/PageDown read. They used to
|
|
922
|
+
* stay at their defaults, so the calendar paged into months where every
|
|
923
|
+
* day was disabled.
|
|
924
|
+
*/
|
|
925
|
+
_setDateBounds() {
|
|
926
|
+
const { minDate, maxDate } = this.options;
|
|
927
|
+
if (minDate) {
|
|
928
|
+
this.options.minDate = new Date(new Date(minDate.getTime()).setHours(0, 0, 0, 0));
|
|
929
|
+
Object.assign(this.options, { minYear: minDate.getFullYear(), minMonth: minDate.getMonth() });
|
|
930
|
+
}
|
|
931
|
+
if (maxDate) {
|
|
932
|
+
this.options.maxDate = new Date(new Date(maxDate.getTime()).setHours(0, 0, 0, 0));
|
|
933
|
+
Object.assign(this.options, { maxYear: maxDate.getFullYear(), maxMonth: maxDate.getMonth() });
|
|
934
|
+
}
|
|
935
|
+
}
|
|
805
936
|
_arrowState(year, month) {
|
|
806
937
|
const opts = this.options;
|
|
807
938
|
const isMinYear = year === opts.minYear;
|
|
@@ -857,7 +988,7 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
857
988
|
if (opts.yearRangeReverse) arr.reverse();
|
|
858
989
|
const yearHtml = `<select class="datepicker-select orig-select-year" tabindex="-1">${arr.join("")}</select>`;
|
|
859
990
|
const leftArrow = '<svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"/><path d="M0-.5h24v24H0z" fill="none"/></svg>';
|
|
860
|
-
html += `<button class="month-prev${prev ? "" : " is-disabled"}" type="button">${leftArrow}</button>`;
|
|
991
|
+
html += `<button class="month-prev${prev ? "" : " is-disabled"}" type="button" aria-label="${_Datepicker._escape(opts.i18n.previousMonth)}">${leftArrow}</button>`;
|
|
861
992
|
html += '<div class="selects-container">';
|
|
862
993
|
if (opts.showMonthAfterYear) {
|
|
863
994
|
html += yearHtml + monthHtml;
|
|
@@ -866,7 +997,7 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
866
997
|
}
|
|
867
998
|
html += "</div>";
|
|
868
999
|
const rightArrow = '<svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"/><path d="M0-.25h24v24H0z" fill="none"/></svg>';
|
|
869
|
-
html += `<button class="month-next${next ? "" : " is-disabled"}" type="button">${rightArrow}</button>`;
|
|
1000
|
+
html += `<button class="month-next${next ? "" : " is-disabled"}" type="button" aria-label="${_Datepicker._escape(opts.i18n.nextMonth)}">${rightArrow}</button>`;
|
|
870
1001
|
return html += "</div>";
|
|
871
1002
|
}
|
|
872
1003
|
/**
|
|
@@ -906,6 +1037,7 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
906
1037
|
const active = this.calendarEl.getRootNode().activeElement;
|
|
907
1038
|
const restoreDayFocus = active?.matches(".datepicker-day-button") && this.calendarEl.contains(active);
|
|
908
1039
|
const restoreArrow = this.calendarEl.contains(active) && active?.matches(".month-prev, .month-next") ? active.classList.contains("month-prev") ? ".month-prev" : ".month-next" : null;
|
|
1040
|
+
const restoreSelect = this._selectFocusRestorer(active);
|
|
909
1041
|
const year = this.calendars[0].year;
|
|
910
1042
|
const month = this.calendars[0].month;
|
|
911
1043
|
this._renderDateDisplay(this.date, this.endDate);
|
|
@@ -920,10 +1052,27 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
920
1052
|
this._renderCalendarTable(year, month);
|
|
921
1053
|
this._syncCalendarFocus(!!restoreDayFocus);
|
|
922
1054
|
if (restoreArrow) this.calendarEl.querySelector(restoreArrow)?.focus();
|
|
1055
|
+
restoreSelect();
|
|
923
1056
|
if (typeof this.options.onDraw === "function") {
|
|
924
1057
|
this.options.onDraw.call(this);
|
|
925
1058
|
}
|
|
926
1059
|
}
|
|
1060
|
+
_formSelect(selector) {
|
|
1061
|
+
const el = this.calendarEl.querySelector(selector);
|
|
1062
|
+
return el ? FormSelect.getInstance(el) : void 0;
|
|
1063
|
+
}
|
|
1064
|
+
/**
|
|
1065
|
+
* Picking a year rebuilds both selects under the focus, which is on the old
|
|
1066
|
+
* input or in its menu. The returned callback, run after the redraw, gives
|
|
1067
|
+
* focus to the matching new input if the old one went with the rebuild.
|
|
1068
|
+
*/
|
|
1069
|
+
_selectFocusRestorer(active) {
|
|
1070
|
+
const holdsFocus = (select) => !!select && (select.input === active || !!select.menuEl?.contains(active));
|
|
1071
|
+
const selector = [".orig-select-year", ".orig-select-month"].find((s) => holdsFocus(this._formSelect(s)));
|
|
1072
|
+
return () => {
|
|
1073
|
+
if (selector && !active.isConnected) this._formSelect(selector)?.input.focus();
|
|
1074
|
+
};
|
|
1075
|
+
}
|
|
927
1076
|
/** Tear down the two FormSelects and render the controls from scratch. */
|
|
928
1077
|
_rebuildControls(year, month) {
|
|
929
1078
|
this.destroySelects();
|
|
@@ -965,78 +1114,37 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
965
1114
|
_setupEventHandlers() {
|
|
966
1115
|
this._addInputEventHandlers(this.el);
|
|
967
1116
|
if (this.endDateEl) this._addInputEventHandlers(this.endDateEl);
|
|
968
|
-
|
|
969
|
-
this.
|
|
970
|
-
this.calendarEl.addEventListener("
|
|
1117
|
+
const { signal } = this._events;
|
|
1118
|
+
afterFormReset(this.el, this._readBack, signal);
|
|
1119
|
+
this.calendarEl.addEventListener("click", this._handleCalendarClick, { signal });
|
|
1120
|
+
this.calendarEl.addEventListener("keydown", this._handleCalendarKeydown, { signal });
|
|
1121
|
+
this.calendarEl.addEventListener("focusin", this._handleCalendarFocus, { signal });
|
|
971
1122
|
}
|
|
972
1123
|
_setupVariables() {
|
|
973
1124
|
const template = document.createElement("template");
|
|
974
1125
|
template.innerHTML = _Datepicker._template.trim();
|
|
975
1126
|
this.containerEl = template.content.firstChild;
|
|
976
1127
|
this.calendarEl = this.containerEl.querySelector(".datepicker-calendar");
|
|
977
|
-
this.yearTextEl = this.containerEl.querySelector(".year-text");
|
|
978
1128
|
this.dateTextEl = this.containerEl.querySelector(".date-text");
|
|
979
1129
|
this.footer = this.containerEl.querySelector(".datepicker-footer");
|
|
980
|
-
this.formats = {
|
|
981
|
-
d: (date) => {
|
|
982
|
-
return date.getDate();
|
|
983
|
-
},
|
|
984
|
-
dd: (date) => {
|
|
985
|
-
const d = date.getDate();
|
|
986
|
-
return (d < 10 ? "0" : "") + d;
|
|
987
|
-
},
|
|
988
|
-
ddd: (date) => {
|
|
989
|
-
return this.options.i18n.weekdaysShort[date.getDay()];
|
|
990
|
-
},
|
|
991
|
-
dddd: (date) => {
|
|
992
|
-
return this.options.i18n.weekdays[date.getDay()];
|
|
993
|
-
},
|
|
994
|
-
m: (date) => {
|
|
995
|
-
return date.getMonth() + 1;
|
|
996
|
-
},
|
|
997
|
-
mm: (date) => {
|
|
998
|
-
const m = date.getMonth() + 1;
|
|
999
|
-
return (m < 10 ? "0" : "") + m;
|
|
1000
|
-
},
|
|
1001
|
-
mmm: (date) => {
|
|
1002
|
-
return this.options.i18n.monthsShort[date.getMonth()];
|
|
1003
|
-
},
|
|
1004
|
-
mmmm: (date) => {
|
|
1005
|
-
return this.options.i18n.months[date.getMonth()];
|
|
1006
|
-
},
|
|
1007
|
-
yy: (date) => {
|
|
1008
|
-
return ("" + date.getFullYear()).slice(2);
|
|
1009
|
-
},
|
|
1010
|
-
yyyy: (date) => {
|
|
1011
|
-
return date.getFullYear();
|
|
1012
|
-
}
|
|
1013
|
-
};
|
|
1014
|
-
}
|
|
1015
|
-
_removeEventHandlers() {
|
|
1016
|
-
for (const input of this.dateEls ?? [this.el]) this._removeInputEventHandlers(input);
|
|
1017
|
-
this.calendarEl.removeEventListener("click", this._handleCalendarClick);
|
|
1018
|
-
this.calendarEl.removeEventListener("keydown", this._handleCalendarKeydown);
|
|
1019
|
-
this.calendarEl.removeEventListener("focusin", this._handleCalendarFocus);
|
|
1020
|
-
if (this.options.isDateRange && this.endDateEl) {
|
|
1021
|
-
this._removeInputEventHandlers(this.endDateEl);
|
|
1022
|
-
}
|
|
1023
1130
|
}
|
|
1131
|
+
/** A date input's listeners. An input the picker removes keeps them, but no event reaches it then. */
|
|
1024
1132
|
_addInputEventHandlers(input) {
|
|
1025
|
-
|
|
1026
|
-
input.addEventListener("
|
|
1027
|
-
input.addEventListener("
|
|
1028
|
-
|
|
1029
|
-
_removeInputEventHandlers(input) {
|
|
1030
|
-
input.removeEventListener("click", this._handleInputClick);
|
|
1031
|
-
input.removeEventListener("keydown", this._handleInputKeydown);
|
|
1032
|
-
input.removeEventListener("change", this._handleInputChange);
|
|
1133
|
+
const { signal } = this._events;
|
|
1134
|
+
input.addEventListener("click", this._handleInputClick, { signal });
|
|
1135
|
+
input.addEventListener("keydown", this._handleInputKeydown, { signal });
|
|
1136
|
+
input.addEventListener("change", this._handleInputChange, { signal });
|
|
1033
1137
|
}
|
|
1034
1138
|
_removeDateInput(input) {
|
|
1035
1139
|
const focused = input.getRootNode().activeElement === input;
|
|
1036
|
-
this._removeInputEventHandlers(input);
|
|
1037
1140
|
input.remove();
|
|
1038
1141
|
if (focused && document.activeElement === document.body) this.el.focus();
|
|
1039
1142
|
}
|
|
1143
|
+
/** Shows a docked or modal calendar. A modal takes focus from the input, so the selected day gets it. */
|
|
1144
|
+
_showDisplay() {
|
|
1145
|
+
this.displayPlugin?.show();
|
|
1146
|
+
if (this.displayPlugin instanceof ModalDisplayPlugin) this._syncCalendarFocus(true);
|
|
1147
|
+
}
|
|
1040
1148
|
_dayDate(button) {
|
|
1041
1149
|
const date = /* @__PURE__ */ new Date(0);
|
|
1042
1150
|
date.setFullYear(Number(button.dataset.year), Number(button.dataset.month), Number(button.dataset.day));
|
|
@@ -1046,7 +1154,7 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
1046
1154
|
_syncCalendarFocus(restore = false) {
|
|
1047
1155
|
const buttons = [...this.calendarEl.querySelectorAll(".datepicker-day-button")];
|
|
1048
1156
|
const current = buttons.filter((button) => !button.parentElement.classList.contains("is-selection-disabled"));
|
|
1049
|
-
const preferred = this._focusedDate || this.date || /* @__PURE__ */ new Date();
|
|
1157
|
+
const preferred = this._focusedDate || this.date || new Date((/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0));
|
|
1050
1158
|
const target = current.find((button) => _Datepicker._compareDates(this._dayDate(button), preferred)) || current.find((button) => button.parentElement.classList.contains("is-selected")) || current.find((button) => !button.parentElement.classList.contains("is-disabled")) || current[0];
|
|
1051
1159
|
for (const button of buttons) {
|
|
1052
1160
|
button.tabIndex = button === target ? 0 : -1;
|
|
@@ -1059,18 +1167,34 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
1059
1167
|
}
|
|
1060
1168
|
// change view to a specific month (zero-index, e.g. 0: January)
|
|
1061
1169
|
gotoMonth(month) {
|
|
1062
|
-
if (!isNaN(month)) {
|
|
1063
|
-
this.calendars[0].month = parseInt(month, 10);
|
|
1170
|
+
if (!isNaN(Number(month))) {
|
|
1171
|
+
this.calendars[0].month = parseInt(String(month), 10);
|
|
1064
1172
|
this.adjustCalendars();
|
|
1065
1173
|
}
|
|
1066
1174
|
}
|
|
1067
1175
|
// change view to a specific full year (e.g. "2012")
|
|
1068
1176
|
gotoYear(year) {
|
|
1069
|
-
if (!isNaN(year)) {
|
|
1070
|
-
this.calendars[0].year = parseInt(year, 10);
|
|
1177
|
+
if (!isNaN(Number(year))) {
|
|
1178
|
+
this.calendars[0].year = parseInt(String(year), 10);
|
|
1071
1179
|
this.adjustCalendars();
|
|
1072
1180
|
}
|
|
1073
1181
|
}
|
|
1182
|
+
_readBackMultiple() {
|
|
1183
|
+
for (const input of this.dateEls.splice(1)) this._removeDateInput(input);
|
|
1184
|
+
this.dates = [];
|
|
1185
|
+
this._syncDataDate(this.el);
|
|
1186
|
+
const date = this._dateInInput(this.el);
|
|
1187
|
+
if (_Datepicker._isDate(date) && this._isSelectableDay(date)) this.setDate(date, true);
|
|
1188
|
+
}
|
|
1189
|
+
/** A native date input's overlay text follows its value, including an empty one. */
|
|
1190
|
+
_syncDataDate(el) {
|
|
1191
|
+
if (el.type === "date") this.setDataDate(el, _Datepicker._parseDate(el.value));
|
|
1192
|
+
}
|
|
1193
|
+
_readBackSingle() {
|
|
1194
|
+
this.setSingleDate(null, false);
|
|
1195
|
+
this.setSingleDate(null, true);
|
|
1196
|
+
for (const input of [this.el, this.endDateEl]) if (input) this.setDateFromInput(input);
|
|
1197
|
+
}
|
|
1074
1198
|
renderDayName(opts, day, abbr = false) {
|
|
1075
1199
|
day += opts.firstDay;
|
|
1076
1200
|
while (day >= 7) {
|
|
@@ -1087,10 +1211,10 @@ var _Datepicker = class _Datepicker extends Component {
|
|
|
1087
1211
|
return dateInput;
|
|
1088
1212
|
}
|
|
1089
1213
|
};
|
|
1214
|
+
_Datepicker.key = "Expressive_Datepicker";
|
|
1090
1215
|
_Datepicker._template = `
|
|
1091
1216
|
<div class="datepicker-container">
|
|
1092
1217
|
<div class="datepicker-date-display">
|
|
1093
|
-
<span class="year-text"></span>
|
|
1094
1218
|
<span class="date-text"></span>
|
|
1095
1219
|
</div>
|
|
1096
1220
|
<div class="datepicker-calendar-container">
|
|
@@ -1101,6 +1225,7 @@ _Datepicker._template = `
|
|
|
1101
1225
|
var Datepicker = _Datepicker;
|
|
1102
1226
|
|
|
1103
1227
|
export {
|
|
1228
|
+
readDate,
|
|
1104
1229
|
Datepicker
|
|
1105
1230
|
};
|
|
1106
|
-
//# sourceMappingURL=chunk-
|
|
1231
|
+
//# sourceMappingURL=chunk-H6YIKFAQ.mjs.map
|