@expressivecss/expressive 0.15.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1502 -1
- package/README.md +9 -8
- package/dist/css/expressive.css +19247 -11923
- package/dist/css/expressive.css.map +1 -1
- package/dist/css/expressive.min.css +1 -1
- package/dist/css/expressive.min.css.map +1 -1
- package/dist/fonts/LICENSE-noto-sans-arabic +93 -0
- package/dist/fonts/LICENSE-noto-sans-hebrew +93 -0
- package/dist/fonts/LICENSE-noto-sans-thai +93 -0
- package/dist/fonts/material-symbols-outlined.woff2 +0 -0
- package/dist/fonts/material-symbols-rounded.woff2 +0 -0
- package/dist/fonts/material-symbols-sharp.woff2 +0 -0
- package/dist/fonts/noto-sans-arabic-arabic-400.woff2 +0 -0
- package/dist/fonts/noto-sans-arabic-arabic-500.woff2 +0 -0
- package/dist/fonts/noto-sans-arabic-arabic-700.woff2 +0 -0
- package/dist/fonts/noto-sans-cyrillic-400.woff2 +0 -0
- package/dist/fonts/noto-sans-cyrillic-500.woff2 +0 -0
- package/dist/fonts/noto-sans-cyrillic-700.woff2 +0 -0
- package/dist/fonts/noto-sans-cyrillic-ext-400.woff2 +0 -0
- package/dist/fonts/noto-sans-cyrillic-ext-500.woff2 +0 -0
- package/dist/fonts/noto-sans-cyrillic-ext-700.woff2 +0 -0
- package/dist/fonts/noto-sans-devanagari-400.woff2 +0 -0
- package/dist/fonts/noto-sans-devanagari-500.woff2 +0 -0
- package/dist/fonts/noto-sans-devanagari-700.woff2 +0 -0
- package/dist/fonts/noto-sans-greek-400.woff2 +0 -0
- package/dist/fonts/noto-sans-greek-500.woff2 +0 -0
- package/dist/fonts/noto-sans-greek-700.woff2 +0 -0
- package/dist/fonts/noto-sans-greek-ext-400.woff2 +0 -0
- package/dist/fonts/noto-sans-greek-ext-500.woff2 +0 -0
- package/dist/fonts/noto-sans-greek-ext-700.woff2 +0 -0
- package/dist/fonts/noto-sans-hebrew-hebrew-400.woff2 +0 -0
- package/dist/fonts/noto-sans-hebrew-hebrew-500.woff2 +0 -0
- package/dist/fonts/noto-sans-hebrew-hebrew-700.woff2 +0 -0
- package/dist/fonts/noto-sans-latin-700.woff2 +0 -0
- package/dist/fonts/noto-sans-latin-ext-400.woff2 +0 -0
- package/dist/fonts/noto-sans-latin-ext-500.woff2 +0 -0
- package/dist/fonts/noto-sans-latin-ext-700.woff2 +0 -0
- package/dist/fonts/noto-sans-thai-thai-400.woff2 +0 -0
- package/dist/fonts/noto-sans-thai-thai-500.woff2 +0 -0
- package/dist/fonts/noto-sans-thai-thai-700.woff2 +0 -0
- package/dist/fonts/noto-sans-vietnamese-400.woff2 +0 -0
- package/dist/fonts/noto-sans-vietnamese-500.woff2 +0 -0
- package/dist/fonts/noto-sans-vietnamese-700.woff2 +0 -0
- package/dist/fonts/roboto-cyrillic-400.woff2 +0 -0
- package/dist/fonts/roboto-cyrillic-500.woff2 +0 -0
- package/dist/fonts/roboto-cyrillic-700.woff2 +0 -0
- package/dist/fonts/roboto-cyrillic-ext-400.woff2 +0 -0
- package/dist/fonts/roboto-cyrillic-ext-500.woff2 +0 -0
- package/dist/fonts/roboto-cyrillic-ext-700.woff2 +0 -0
- package/dist/fonts/roboto-greek-400.woff2 +0 -0
- package/dist/fonts/roboto-greek-500.woff2 +0 -0
- package/dist/fonts/roboto-greek-700.woff2 +0 -0
- package/dist/fonts/roboto-greek-ext-400.woff2 +0 -0
- package/dist/fonts/roboto-greek-ext-500.woff2 +0 -0
- package/dist/fonts/roboto-greek-ext-700.woff2 +0 -0
- package/dist/fonts/roboto-latin-700.woff2 +0 -0
- package/dist/fonts/roboto-latin-ext-400.woff2 +0 -0
- package/dist/fonts/roboto-latin-ext-500.woff2 +0 -0
- package/dist/fonts/roboto-latin-ext-700.woff2 +0 -0
- package/dist/fonts/roboto-vietnamese-400.woff2 +0 -0
- package/dist/fonts/roboto-vietnamese-500.woff2 +0 -0
- package/dist/fonts/roboto-vietnamese-700.woff2 +0 -0
- package/dist/js/chunks/chunk-2CS6TITK.mjs +219 -0
- package/dist/js/chunks/chunk-2CS6TITK.mjs.map +7 -0
- package/dist/js/chunks/chunk-2RLBDFH4.mjs +108 -0
- package/dist/js/chunks/chunk-2RLBDFH4.mjs.map +7 -0
- package/dist/js/chunks/chunk-3L3QIYLC.mjs +85 -0
- package/dist/js/chunks/chunk-3L3QIYLC.mjs.map +7 -0
- package/dist/js/chunks/chunk-4EWGD4V2.mjs +75 -0
- package/dist/js/chunks/chunk-4EWGD4V2.mjs.map +7 -0
- package/dist/js/chunks/chunk-4IKVPCSU.mjs +7 -0
- package/dist/js/chunks/chunk-4IKVPCSU.mjs.map +7 -0
- package/dist/js/chunks/chunk-4PIXLDNJ.mjs +127 -0
- package/dist/js/chunks/chunk-4PIXLDNJ.mjs.map +7 -0
- package/dist/js/chunks/{chunk-KVJAVDBC.mjs → chunk-4QUCNFSD.mjs} +64 -113
- package/dist/js/chunks/chunk-4QUCNFSD.mjs.map +7 -0
- package/dist/js/chunks/{chunk-UETTGDLI.mjs → chunk-4TRZ2AER.mjs} +35 -41
- package/dist/js/chunks/chunk-4TRZ2AER.mjs.map +7 -0
- package/dist/js/chunks/{chunk-C6CHEWYP.mjs → chunk-5KIHWJI2.mjs} +40 -26
- package/dist/js/chunks/chunk-5KIHWJI2.mjs.map +7 -0
- package/dist/js/chunks/{chunk-L27Q6ZMI.mjs → chunk-67ZPPKXS.mjs} +20 -33
- package/dist/js/chunks/chunk-67ZPPKXS.mjs.map +7 -0
- package/dist/js/chunks/{chunk-XAEAEHIX.mjs → chunk-6FSEUFVW.mjs} +39 -26
- package/dist/js/chunks/chunk-6FSEUFVW.mjs.map +7 -0
- package/dist/js/chunks/chunk-752ADW4M.mjs +225 -0
- package/dist/js/chunks/chunk-752ADW4M.mjs.map +7 -0
- package/dist/js/chunks/{chunk-CK2XCICY.mjs → chunk-75E5EDJF.mjs} +3 -11
- package/dist/js/chunks/chunk-75E5EDJF.mjs.map +7 -0
- package/dist/js/chunks/{chunk-KHXZ2A4K.mjs → chunk-7NLUI3RR.mjs} +139 -66
- package/dist/js/chunks/chunk-7NLUI3RR.mjs.map +7 -0
- package/dist/js/chunks/chunk-7W7TV6NY.mjs +108 -0
- package/dist/js/chunks/chunk-7W7TV6NY.mjs.map +7 -0
- package/dist/js/chunks/chunk-7YQBHTK3.mjs +225 -0
- package/dist/js/chunks/chunk-7YQBHTK3.mjs.map +7 -0
- package/dist/js/chunks/chunk-7YZ5CN3V.mjs +33 -0
- package/dist/js/chunks/chunk-7YZ5CN3V.mjs.map +7 -0
- package/dist/js/chunks/chunk-AI73GJKG.mjs +28 -0
- package/dist/js/chunks/chunk-AI73GJKG.mjs.map +7 -0
- package/dist/js/chunks/{chunk-LQWUDNHZ.mjs → chunk-ANKFWNWT.mjs} +21 -45
- package/dist/js/chunks/chunk-ANKFWNWT.mjs.map +7 -0
- package/dist/js/chunks/{chunk-5CEAOLUA.mjs → chunk-B7DQFHA5.mjs} +30 -47
- package/dist/js/chunks/chunk-B7DQFHA5.mjs.map +7 -0
- package/dist/js/chunks/chunk-BIGU5RCJ.mjs +153 -0
- package/dist/js/chunks/chunk-BIGU5RCJ.mjs.map +7 -0
- package/dist/js/chunks/{chunk-VGNYF6FB.mjs → chunk-BPF3I2MN.mjs} +109 -24
- package/dist/js/chunks/chunk-BPF3I2MN.mjs.map +7 -0
- package/dist/js/chunks/chunk-CMGXGYUC.mjs +74 -0
- package/dist/js/chunks/chunk-CMGXGYUC.mjs.map +7 -0
- package/dist/js/chunks/{chunk-NUHMOAOY.mjs → chunk-CSYWKEK3.mjs} +310 -196
- package/dist/js/chunks/chunk-CSYWKEK3.mjs.map +7 -0
- package/dist/js/chunks/chunk-CZSQHXEV.mjs +227 -0
- package/dist/js/chunks/chunk-CZSQHXEV.mjs.map +7 -0
- package/dist/js/chunks/chunk-DZYVU75J.mjs +121 -0
- package/dist/js/chunks/chunk-DZYVU75J.mjs.map +7 -0
- package/dist/js/chunks/{chunk-74MXKKLN.mjs → chunk-EC26RU2D.mjs} +11 -29
- package/dist/js/chunks/chunk-EC26RU2D.mjs.map +7 -0
- package/dist/js/chunks/{chunk-WDK4T63U.mjs → chunk-EVCVFEV3.mjs} +235 -146
- package/dist/js/chunks/chunk-EVCVFEV3.mjs.map +7 -0
- package/dist/js/chunks/chunk-FCNF4GRJ.mjs +445 -0
- package/dist/js/chunks/chunk-FCNF4GRJ.mjs.map +7 -0
- package/dist/js/chunks/chunk-GCWWEZKO.mjs +342 -0
- package/dist/js/chunks/chunk-GCWWEZKO.mjs.map +7 -0
- package/dist/js/chunks/chunk-GNRSYMVH.mjs +1 -0
- package/dist/js/chunks/chunk-GVZQH2H5.mjs +54 -0
- package/dist/js/chunks/chunk-GVZQH2H5.mjs.map +7 -0
- package/dist/js/chunks/chunk-GWZ76SR4.mjs +435 -0
- package/dist/js/chunks/chunk-GWZ76SR4.mjs.map +7 -0
- package/dist/js/chunks/{chunk-PDG64UHF.mjs → chunk-ILDRRG7T.mjs} +21 -23
- package/dist/js/chunks/chunk-ILDRRG7T.mjs.map +7 -0
- package/dist/js/chunks/chunk-INLZWHLY.mjs +80 -0
- package/dist/js/chunks/chunk-INLZWHLY.mjs.map +7 -0
- package/dist/js/chunks/chunk-JUKBBN6P.mjs +175 -0
- package/dist/js/chunks/chunk-JUKBBN6P.mjs.map +7 -0
- package/dist/js/chunks/chunk-KYIEG4U3.mjs +730 -0
- package/dist/js/chunks/chunk-KYIEG4U3.mjs.map +7 -0
- package/dist/js/chunks/{chunk-BGZLF6JZ.mjs → chunk-KZPSAXIU.mjs} +142 -32
- package/dist/js/chunks/chunk-KZPSAXIU.mjs.map +7 -0
- package/dist/js/chunks/chunk-LDXCC2L3.mjs +438 -0
- package/dist/js/chunks/chunk-LDXCC2L3.mjs.map +7 -0
- package/dist/js/chunks/chunk-NAC72P7R.mjs +137 -0
- package/dist/js/chunks/chunk-NAC72P7R.mjs.map +7 -0
- package/dist/js/chunks/chunk-NBJAUGPP.mjs +244 -0
- package/dist/js/chunks/chunk-NBJAUGPP.mjs.map +7 -0
- package/dist/js/chunks/chunk-NNHVANQA.mjs +113 -0
- package/dist/js/chunks/chunk-NNHVANQA.mjs.map +7 -0
- package/dist/js/chunks/chunk-NVQ5EHCU.mjs +376 -0
- package/dist/js/chunks/chunk-NVQ5EHCU.mjs.map +7 -0
- package/dist/js/chunks/{chunk-DXGRXYYL.mjs → chunk-OP43LLIC.mjs} +28 -45
- package/dist/js/chunks/chunk-OP43LLIC.mjs.map +7 -0
- package/dist/js/chunks/chunk-OUCHKSAW.mjs +63 -0
- package/dist/js/chunks/chunk-OUCHKSAW.mjs.map +7 -0
- package/dist/js/chunks/{chunk-TSZYSW7F.mjs → chunk-OYNUDOHR.mjs} +19 -47
- package/dist/js/chunks/chunk-OYNUDOHR.mjs.map +7 -0
- package/dist/js/chunks/{chunk-UAZSDUVP.mjs → chunk-P6DRQ6KS.mjs} +36 -30
- package/dist/js/chunks/chunk-P6DRQ6KS.mjs.map +7 -0
- package/dist/js/chunks/chunk-PA7NU5AK.mjs +99 -0
- package/dist/js/chunks/chunk-PA7NU5AK.mjs.map +7 -0
- package/dist/js/chunks/chunk-QACZ6TUP.mjs +224 -0
- package/dist/js/chunks/chunk-QACZ6TUP.mjs.map +7 -0
- package/dist/js/chunks/{chunk-GJL6GCIU.mjs → chunk-QXKWVHBD.mjs} +265 -161
- package/dist/js/chunks/chunk-QXKWVHBD.mjs.map +7 -0
- package/dist/js/chunks/{chunk-X4ISMKE2.mjs → chunk-ROH2HDB4.mjs} +7 -6
- package/dist/js/chunks/chunk-ROH2HDB4.mjs.map +7 -0
- package/dist/js/chunks/chunk-S23RJ3XY.mjs +86 -0
- package/dist/js/chunks/chunk-S23RJ3XY.mjs.map +7 -0
- package/dist/js/chunks/{chunk-SMY7GJSS.mjs → chunk-SPPHF7YZ.mjs} +36 -29
- package/dist/js/chunks/chunk-SPPHF7YZ.mjs.map +7 -0
- package/dist/js/chunks/chunk-T3BNSRP3.mjs +152 -0
- package/dist/js/chunks/chunk-T3BNSRP3.mjs.map +7 -0
- package/dist/js/chunks/chunk-TFABTUAZ.mjs +108 -0
- package/dist/js/chunks/chunk-TFABTUAZ.mjs.map +7 -0
- package/dist/js/chunks/chunk-U4B3VHFS.mjs +507 -0
- package/dist/js/chunks/chunk-U4B3VHFS.mjs.map +7 -0
- package/dist/js/chunks/chunk-UGJHCHXG.mjs +341 -0
- package/dist/js/chunks/chunk-UGJHCHXG.mjs.map +7 -0
- package/dist/js/chunks/chunk-VFV75DHF.mjs +70 -0
- package/dist/js/chunks/chunk-VFV75DHF.mjs.map +7 -0
- package/dist/js/chunks/{chunk-ZX6M7SWO.mjs → chunk-VGY4M57S.mjs} +266 -120
- package/dist/js/chunks/chunk-VGY4M57S.mjs.map +7 -0
- package/dist/js/chunks/chunk-VH4BMAZS.mjs +167 -0
- package/dist/js/chunks/chunk-VH4BMAZS.mjs.map +7 -0
- package/dist/js/chunks/chunk-VJVQIXHC.mjs +123 -0
- package/dist/js/chunks/chunk-VJVQIXHC.mjs.map +7 -0
- package/dist/js/chunks/{chunk-SFI2U4YW.mjs → chunk-VMY55K2X.mjs} +76 -109
- package/dist/js/chunks/chunk-VMY55K2X.mjs.map +7 -0
- package/dist/js/chunks/{chunk-KUFHW3DS.mjs → chunk-VR3L2WN5.mjs} +11 -17
- package/dist/js/chunks/chunk-VR3L2WN5.mjs.map +7 -0
- package/dist/js/chunks/chunk-W6FAL3TI.mjs +38 -0
- package/dist/js/chunks/chunk-W6FAL3TI.mjs.map +7 -0
- package/dist/js/chunks/chunk-WU7XJ4RR.mjs +450 -0
- package/dist/js/chunks/chunk-WU7XJ4RR.mjs.map +7 -0
- package/dist/js/chunks/chunk-X7SDA2J5.mjs +116 -0
- package/dist/js/chunks/chunk-X7SDA2J5.mjs.map +7 -0
- package/dist/js/chunks/chunk-Y6H2X7ZC.mjs +209 -0
- package/dist/js/chunks/chunk-Y6H2X7ZC.mjs.map +7 -0
- package/dist/js/chunks/chunk-Y6TLRA3U.mjs +129 -0
- package/dist/js/chunks/chunk-Y6TLRA3U.mjs.map +7 -0
- package/dist/js/chunks/chunk-Z4GICXR2.mjs +190 -0
- package/dist/js/chunks/chunk-Z4GICXR2.mjs.map +7 -0
- package/dist/js/chunks/chunk-Z4OARDZ7.mjs +442 -0
- package/dist/js/chunks/chunk-Z4OARDZ7.mjs.map +7 -0
- package/dist/js/chunks/{chunk-FM5CZOUB.mjs → chunk-ZJNLAGY5.mjs} +19 -30
- package/dist/js/chunks/chunk-ZJNLAGY5.mjs.map +7 -0
- package/dist/js/chunks/chunk-ZKWUWBUB.mjs +81 -0
- package/dist/js/chunks/chunk-ZKWUWBUB.mjs.map +7 -0
- package/dist/js/chunks/chunk-ZM3XBHWV.mjs +746 -0
- package/dist/js/chunks/chunk-ZM3XBHWV.mjs.map +7 -0
- package/dist/js/chunks/chunk-ZO6ZLHFF.mjs +48 -0
- package/dist/js/chunks/chunk-ZO6ZLHFF.mjs.map +7 -0
- package/dist/js/chunks/chunk-ZVLOUDIJ.mjs +251 -0
- package/dist/js/chunks/chunk-ZVLOUDIJ.mjs.map +7 -0
- package/dist/js/expressive.cjs +10613 -4327
- package/dist/js/expressive.cjs.map +4 -4
- package/dist/js/expressive.js +10613 -4327
- package/dist/js/expressive.js.map +4 -4
- package/dist/js/expressive.min.js +23 -22
- package/dist/js/expressive.min.js.map +4 -4
- package/dist/js/expressive.mjs +182 -71
- package/dist/js/expressive.mjs.map +2 -2
- package/dist/js/internal/behaviors/bottomSheets.mjs +4 -3
- package/dist/js/internal/behaviors/copy.mjs +9 -0
- package/dist/js/internal/behaviors/copy.mjs.map +7 -0
- package/dist/js/internal/behaviors/dataTables.mjs +10 -0
- package/dist/js/internal/behaviors/dataTables.mjs.map +7 -0
- package/dist/js/internal/behaviors/dialogs.mjs +2 -2
- package/dist/js/internal/behaviors/forms.mjs +2 -2
- package/dist/js/internal/behaviors/imageCompare.mjs +8 -0
- package/dist/js/internal/behaviors/imageCompare.mjs.map +7 -0
- package/dist/js/internal/behaviors/lists.mjs +8 -0
- package/dist/js/internal/behaviors/lists.mjs.map +7 -0
- package/dist/js/internal/behaviors/paneResize.mjs +8 -0
- package/dist/js/internal/behaviors/paneResize.mjs.map +7 -0
- package/dist/js/internal/behaviors/sheetDrag.mjs +7 -2
- package/dist/js/internal/behaviors/sideSheets.mjs +4 -3
- package/dist/js/internal/behaviors/sortable.mjs +8 -0
- package/dist/js/internal/behaviors/sortable.mjs.map +7 -0
- package/dist/js/internal/behaviors/theme.mjs +8 -0
- package/dist/js/internal/behaviors/theme.mjs.map +7 -0
- package/dist/js/internal/behaviors/tour.mjs +8 -0
- package/dist/js/internal/behaviors/tour.mjs.map +7 -0
- package/dist/js/internal/behaviors/transferList.mjs +8 -0
- package/dist/js/internal/behaviors/transferList.mjs.map +7 -0
- package/dist/js/internal/components/appBar.mjs +3 -2
- package/dist/js/internal/components/autocomplete.mjs +4 -4
- package/dist/js/internal/components/backToTop.mjs +9 -0
- package/dist/js/internal/components/backToTop.mjs.map +7 -0
- package/dist/js/internal/components/barChart.mjs +5 -4
- package/dist/js/internal/components/buttonGroup.mjs +3 -2
- package/dist/js/internal/components/buttons.mjs +3 -3
- package/dist/js/internal/components/cards.mjs +3 -3
- package/dist/js/internal/components/carousel.mjs +3 -3
- package/dist/js/internal/components/cascader.mjs +10 -0
- package/dist/js/internal/components/cascader.mjs.map +7 -0
- package/dist/js/internal/components/characterCounter.mjs +3 -2
- package/dist/js/internal/components/chips.mjs +6 -5
- package/dist/js/internal/components/colorPicker.mjs +9 -0
- package/dist/js/internal/components/colorPicker.mjs.map +7 -0
- package/dist/js/internal/components/columnChart.mjs +4 -3
- package/dist/js/internal/components/commandPalette.mjs +3 -3
- package/dist/js/internal/components/confetti.mjs +3 -2
- package/dist/js/internal/components/currencyInput.mjs +9 -0
- package/dist/js/internal/components/currencyInput.mjs.map +7 -0
- package/dist/js/internal/components/datepicker.mjs +11 -8
- package/dist/js/internal/components/expandingCard.mjs +3 -3
- package/dist/js/internal/components/funnelChart.mjs +10 -0
- package/dist/js/internal/components/funnelChart.mjs.map +7 -0
- package/dist/js/internal/components/heatmapChart.mjs +4 -3
- package/dist/js/internal/components/hoverCard.mjs +9 -0
- package/dist/js/internal/components/hoverCard.mjs.map +7 -0
- package/dist/js/internal/components/index.mjs +131 -66
- package/dist/js/internal/components/inputMask.mjs +9 -0
- package/dist/js/internal/components/inputMask.mjs.map +7 -0
- package/dist/js/internal/components/keypad.mjs +3 -3
- package/dist/js/internal/components/lightbox.mjs +3 -3
- package/dist/js/internal/components/lineChart.mjs +25 -4
- package/dist/js/internal/components/loadingOverlay.mjs +9 -0
- package/dist/js/internal/components/loadingOverlay.mjs.map +7 -0
- package/dist/js/internal/components/mapView.mjs +3 -3
- package/dist/js/internal/components/menu.mjs +3 -3
- package/dist/js/internal/components/menubar.mjs +10 -0
- package/dist/js/internal/components/menubar.mjs.map +7 -0
- package/dist/js/internal/components/messageScroller.mjs +3 -3
- package/dist/js/internal/components/mixedChart.mjs +5 -4
- package/dist/js/internal/components/navigationRail.mjs +3 -2
- package/dist/js/internal/components/particles.mjs +3 -2
- package/dist/js/internal/components/pieChart.mjs +4 -3
- package/dist/js/internal/components/pullToRefresh.mjs +9 -0
- package/dist/js/internal/components/pullToRefresh.mjs.map +7 -0
- package/dist/js/internal/components/questionnaire.mjs +3 -3
- package/dist/js/internal/components/radarChart.mjs +4 -3
- package/dist/js/internal/components/radialChart.mjs +4 -3
- package/dist/js/internal/components/registry.mjs +59 -41
- package/dist/js/internal/components/richTextEditor.mjs +3 -3
- package/dist/js/internal/components/sankeyChart.mjs +10 -0
- package/dist/js/internal/components/sankeyChart.mjs.map +7 -0
- package/dist/js/internal/components/scatterChart.mjs +10 -0
- package/dist/js/internal/components/scatterChart.mjs.map +7 -0
- package/dist/js/internal/components/scrollspy.mjs +3 -2
- package/dist/js/internal/components/select.mjs +4 -4
- package/dist/js/internal/components/showMore.mjs +9 -0
- package/dist/js/internal/components/showMore.mjs.map +7 -0
- package/dist/js/internal/components/slider.mjs +3 -3
- package/dist/js/internal/components/snackbar.mjs +2 -2
- package/dist/js/internal/components/swipeActions.mjs +9 -0
- package/dist/js/internal/components/swipeActions.mjs.map +7 -0
- package/dist/js/internal/components/tabs.mjs +3 -4
- package/dist/js/internal/components/timepicker.mjs +5 -4
- package/dist/js/internal/components/tooltip.mjs +3 -3
- package/dist/js/internal/components/treeSelect.mjs +13 -0
- package/dist/js/internal/components/treeSelect.mjs.map +7 -0
- package/dist/js/internal/components/treemapChart.mjs +10 -0
- package/dist/js/internal/components/treemapChart.mjs.map +7 -0
- package/dist/js/internal/core/component.mjs +2 -1
- package/dist/js/internal/core/formControl.mjs +12 -0
- package/dist/js/internal/core/formControl.mjs.map +7 -0
- package/dist/js/internal/core/spring.mjs +11 -0
- package/dist/js/internal/core/spring.mjs.map +7 -0
- package/dist/js/internal/core/utils.mjs +11 -3
- package/dist/js/internal/plugins/dockedDisplayPlugin.mjs +2 -2
- package/dist/js/internal/plugins/modalDisplayPlugin.mjs +13 -0
- package/dist/js/internal/plugins/modalDisplayPlugin.mjs.map +7 -0
- package/dist/js/modular.mjs +173 -71
- package/dist/types/behaviors/bottomSheets.d.ts +19 -3
- package/dist/types/behaviors/copy.d.ts +18 -0
- package/dist/types/behaviors/dataTables.d.ts +129 -0
- package/dist/types/behaviors/dialogs.d.ts +27 -1
- package/dist/types/behaviors/forms.d.ts +68 -2
- package/dist/types/behaviors/imageCompare.d.ts +12 -0
- package/dist/types/behaviors/lists.d.ts +12 -0
- package/dist/types/behaviors/paneResize.d.ts +29 -0
- package/dist/types/behaviors/sheetDrag.d.ts +18 -0
- package/dist/types/behaviors/sideSheets.d.ts +1 -1
- package/dist/types/behaviors/sortable.d.ts +28 -0
- package/dist/types/behaviors/theme.d.ts +22 -0
- package/dist/types/behaviors/tour.d.ts +36 -0
- package/dist/types/behaviors/transferList.d.ts +51 -0
- package/dist/types/components/appBar.d.ts +5 -6
- package/dist/types/components/autocomplete.d.ts +91 -17
- package/dist/types/components/backToTop.d.ts +36 -0
- package/dist/types/components/barChart.d.ts +3 -6
- package/dist/types/components/buttonGroup.d.ts +2 -4
- package/dist/types/components/buttons.d.ts +5 -5
- package/dist/types/components/cards.d.ts +3 -16
- package/dist/types/components/carousel.d.ts +9 -15
- package/dist/types/components/cascader.d.ts +130 -0
- package/dist/types/components/characterCounter.d.ts +2 -15
- package/dist/types/components/chips.d.ts +65 -19
- package/dist/types/components/colorPicker.d.ts +42 -0
- package/dist/types/components/columnChart.d.ts +23 -10
- package/dist/types/components/commandPalette.d.ts +11 -16
- package/dist/types/components/confetti.d.ts +2 -4
- package/dist/types/components/currencyInput.d.ts +59 -0
- package/dist/types/components/datepicker.d.ts +56 -32
- package/dist/types/components/expandingCard.d.ts +4 -6
- package/dist/types/components/funnelChart.d.ts +38 -0
- package/dist/types/components/heatmapChart.d.ts +39 -8
- package/dist/types/components/hoverCard.d.ts +58 -0
- package/dist/types/components/index.d.ts +16 -1
- package/dist/types/components/inputMask.d.ts +30 -0
- package/dist/types/components/keypad.d.ts +38 -6
- package/dist/types/components/lightbox.d.ts +14 -20
- package/dist/types/components/lineChart.d.ts +172 -10
- package/dist/types/components/loadingOverlay.d.ts +42 -0
- package/dist/types/components/mapView.d.ts +26 -17
- package/dist/types/components/menu.d.ts +60 -22
- package/dist/types/components/menubar.d.ts +37 -0
- package/dist/types/components/messageScroller.d.ts +2 -14
- package/dist/types/components/mixedChart.d.ts +15 -6
- package/dist/types/components/navigationRail.d.ts +16 -5
- package/dist/types/components/particles.d.ts +8 -4
- package/dist/types/components/pieChart.d.ts +32 -7
- package/dist/types/components/pullToRefresh.d.ts +80 -0
- package/dist/types/components/questionnaire.d.ts +58 -16
- package/dist/types/components/radarChart.d.ts +10 -6
- package/dist/types/components/radialChart.d.ts +58 -7
- package/dist/types/components/registry.d.ts +73 -3
- package/dist/types/components/richTextEditor.d.ts +6 -14
- package/dist/types/components/sankeyChart.d.ts +72 -0
- package/dist/types/components/scatterChart.d.ts +102 -0
- package/dist/types/components/scrollspy.d.ts +3 -5
- package/dist/types/components/select.d.ts +43 -30
- package/dist/types/components/showMore.d.ts +51 -0
- package/dist/types/components/slider.d.ts +3 -15
- package/dist/types/components/snackbar.d.ts +61 -0
- package/dist/types/components/swipeActions.d.ts +81 -0
- package/dist/types/components/tabs.d.ts +89 -27
- package/dist/types/components/timepicker.d.ts +113 -21
- package/dist/types/components/tooltip.d.ts +56 -20
- package/dist/types/components/treeSelect.d.ts +106 -0
- package/dist/types/components/treemapChart.d.ts +56 -0
- package/dist/types/core/component.d.ts +43 -25
- package/dist/types/core/formControl.d.ts +21 -0
- package/dist/types/core/spring.d.ts +20 -0
- package/dist/types/core/utils.d.ts +85 -72
- package/dist/types/modular.d.ts +33 -1
- package/dist/types/plugins/dockedDisplayPlugin.d.ts +10 -8
- package/dist/types/plugins/modalDisplayPlugin.d.ts +32 -0
- package/package.json +10 -8
- package/src/sass/README.md +27 -18
- package/src/sass/abstracts/_elevation.scss +13 -7
- package/src/sass/abstracts/_index.scss +1 -0
- package/src/sass/abstracts/_mixins.scss +422 -36
- package/src/sass/abstracts/_spring.scss +63 -0
- package/src/sass/abstracts/_variables.scss +39 -21
- package/src/sass/base/_fonts.scss +61 -48
- package/src/sass/base/_global.scss +104 -24
- package/src/sass/base/_index.scss +2 -0
- package/src/sass/base/_normalize.scss +59 -114
- package/src/sass/base/_print.scss +21 -0
- package/src/sass/base/_prose.scss +68 -0
- package/src/sass/base/_typography.scss +9 -5
- package/src/sass/components/_accordion.scss +9 -16
- package/src/sass/components/_alert.scss +102 -0
- package/src/sass/components/_aura.scss +8 -3
- package/src/sass/components/_avatar.scss +3 -3
- package/src/sass/components/_back-to-top.scss +38 -0
- package/src/sass/components/_badges.scss +6 -5
- package/src/sass/components/_bar-chart.scss +41 -19
- package/src/sass/components/_bottom-sheet.scss +44 -16
- package/src/sass/components/_breadcrumb.scss +8 -1
- package/src/sass/components/_button-groups.scss +15 -25
- package/src/sass/components/_buttons.scss +156 -63
- package/src/sass/components/_calendar.scss +246 -0
- package/src/sass/components/_cards.scss +36 -44
- package/src/sass/components/_carousel.scss +27 -103
- package/src/sass/components/_cascader.scss +142 -0
- package/src/sass/components/_chips.scss +36 -46
- package/src/sass/components/_column-chart.scss +19 -12
- package/src/sass/components/_command-palette.scss +4 -7
- package/src/sass/components/_confetti.scss +0 -2
- package/src/sass/components/_countdown.scss +1 -1
- package/src/sass/components/_data-table.scss +162 -25
- package/src/sass/components/_datepicker.scss +54 -40
- package/src/sass/components/_description-list.scss +85 -0
- package/src/sass/components/_dialog.scss +42 -41
- package/src/sass/components/_docked-display.scss +1 -3
- package/src/sass/components/_drag-handle.scss +16 -20
- package/src/sass/components/_expanding-card.scss +20 -9
- package/src/sass/components/_fab-menu.scss +44 -32
- package/src/sass/components/_funnel-chart.scss +124 -0
- package/src/sass/components/_heatmap-chart.scss +111 -22
- package/src/sass/components/_icon-buttons.scss +7 -7
- package/src/sass/components/_icons-material-design.scss +2 -2
- package/src/sass/components/_image-compare.scss +108 -0
- package/src/sass/components/_index.scss +20 -0
- package/src/sass/components/_keypad.scss +39 -19
- package/src/sass/components/_kpi.scss +6 -11
- package/src/sass/components/_lightbox.scss +24 -13
- package/src/sass/components/_line-chart.scss +16 -2
- package/src/sass/components/_list.scss +59 -14
- package/src/sass/components/_loading-indicator.scss +1 -0
- package/src/sass/components/_loading-overlay.scss +105 -0
- package/src/sass/components/_map.scss +33 -11
- package/src/sass/components/_marquee.scss +3 -2
- package/src/sass/components/_mega-menu.scss +137 -0
- package/src/sass/components/_menu.scss +143 -123
- package/src/sass/components/_menubar.scss +59 -0
- package/src/sass/components/_message-scroller.scss +2 -2
- package/src/sass/components/_message.scss +3 -3
- package/src/sass/components/_mixed-chart.scss +37 -9
- package/src/sass/components/_modal-display.scss +21 -0
- package/src/sass/components/_navbar.scss +34 -20
- package/src/sass/components/_navigation-bar.scss +15 -77
- package/src/sass/components/_navigation-rail.scss +151 -92
- package/src/sass/components/_org-chart.scss +192 -0
- package/src/sass/components/_page-footer.scss +1 -1
- package/src/sass/components/_pagination.scss +6 -13
- package/src/sass/components/_panes.scss +32 -26
- package/src/sass/components/_particles.scss +0 -2
- package/src/sass/components/_pie-chart.scss +91 -11
- package/src/sass/components/_popover.scss +18 -5
- package/src/sass/components/_progress.scss +152 -31
- package/src/sass/components/_pull-to-refresh.scss +90 -0
- package/src/sass/components/_questionnaire.scss +74 -3
- package/src/sass/components/_radar-chart.scss +38 -10
- package/src/sass/components/_radial-chart.scss +113 -5
- package/src/sass/components/_rich-text-editor.scss +2 -2
- package/src/sass/components/_sankey-chart.scss +114 -0
- package/src/sass/components/_scatter-chart.scss +153 -0
- package/src/sass/components/_scrim.scss +0 -2
- package/src/sass/components/_scrollspy.scss +0 -2
- package/src/sass/components/_search.scss +26 -22
- package/src/sass/components/_show-more.scss +8 -0
- package/src/sass/components/_side-sheet.scss +23 -37
- package/src/sass/components/_skeleton.scss +2 -4
- package/src/sass/components/_snackbar.scss +27 -21
- package/src/sass/components/_split-button.scss +5 -5
- package/src/sass/components/_stat.scss +3 -8
- package/src/sass/components/_stepper.scss +1 -1
- package/src/sass/components/_swipe-actions.scss +71 -0
- package/src/sass/components/_tabs.scss +51 -32
- package/src/sass/components/_timeline.scss +12 -12
- package/src/sass/components/_timepicker.scss +109 -78
- package/src/sass/components/_toolbar.scss +35 -43
- package/src/sass/components/_tooltip.scss +21 -12
- package/src/sass/components/_tour.scss +89 -0
- package/src/sass/components/_transfer-list.scss +73 -0
- package/src/sass/components/_transitions.scss +4 -4
- package/src/sass/components/_tree.scss +3 -16
- package/src/sass/components/_treemap-chart.scss +122 -0
- package/src/sass/components/forms/_checkboxes.scss +106 -24
- package/src/sass/components/forms/_color-picker.scss +135 -0
- package/src/sass/components/forms/_color-swatches.scss +85 -0
- package/src/sass/components/forms/_drop-zone.scss +15 -9
- package/src/sass/components/forms/_fieldset.scss +7 -7
- package/src/sass/components/forms/_file-input.scss +6 -8
- package/src/sass/components/forms/_index.scss +3 -1
- package/src/sass/components/forms/_input-fields.scss +254 -90
- package/src/sass/components/forms/_radio-buttons.scss +33 -94
- package/src/sass/components/forms/_rating.scss +2 -32
- package/src/sass/components/forms/_select.scss +199 -20
- package/src/sass/components/forms/_slider.scss +91 -94
- package/src/sass/components/forms/_switches.scss +53 -164
- package/src/sass/custom.scss +10 -1
- package/src/sass/expressive.scss +3 -63
- package/src/sass/tokens/_contrast.scss +94 -0
- package/src/sass/tokens/_elevation.scss +16 -0
- package/src/sass/tokens/_index.scss +5 -0
- package/src/sass/tokens/_motion.scss +109 -0
- package/src/sass/tokens/_reference.scss +72 -141
- package/src/sass/tokens/_shape.scss +38 -0
- package/src/sass/tokens/_stacking.scss +27 -0
- package/src/sass/tokens/_state.scss +0 -2
- package/src/sass/tokens/_theme.scss +10 -1
- package/src/sass/tokens/_vibrant.scss +2 -5
- package/src/sass/utilities/_defer-render.scss +17 -0
- package/src/sass/utilities/_helpers.scss +183 -26
- package/src/sass/utilities/_index.scss +1 -0
- package/src/sass/utilities/_scroll-area.scss +0 -2
- package/src/sass/utilities/_spacing.scss +52 -34
- package/src/sass/utilities/_typescale.scss +8 -1
- package/src/sass/utilities/_visibility.scss +47 -76
- package/src/sass/utilities/_z-depth.scss +7 -4
- package/dist/js/chunks/chunk-33QVDDGR.mjs +0 -270
- package/dist/js/chunks/chunk-33QVDDGR.mjs.map +0 -7
- package/dist/js/chunks/chunk-45FER6RI.mjs +0 -59
- package/dist/js/chunks/chunk-45FER6RI.mjs.map +0 -7
- package/dist/js/chunks/chunk-5CEAOLUA.mjs.map +0 -7
- package/dist/js/chunks/chunk-6VATUZC6.mjs +0 -295
- package/dist/js/chunks/chunk-6VATUZC6.mjs.map +0 -7
- package/dist/js/chunks/chunk-74MXKKLN.mjs.map +0 -7
- package/dist/js/chunks/chunk-AIURVCG6.mjs +0 -55
- package/dist/js/chunks/chunk-AIURVCG6.mjs.map +0 -7
- package/dist/js/chunks/chunk-BGZLF6JZ.mjs.map +0 -7
- package/dist/js/chunks/chunk-C6CHEWYP.mjs.map +0 -7
- package/dist/js/chunks/chunk-CK2XCICY.mjs.map +0 -7
- package/dist/js/chunks/chunk-CXXM2L4F.mjs +0 -344
- package/dist/js/chunks/chunk-CXXM2L4F.mjs.map +0 -7
- package/dist/js/chunks/chunk-DXGRXYYL.mjs.map +0 -7
- package/dist/js/chunks/chunk-FM5CZOUB.mjs.map +0 -7
- package/dist/js/chunks/chunk-GJL6GCIU.mjs.map +0 -7
- package/dist/js/chunks/chunk-K3HZMFMD.mjs +0 -135
- package/dist/js/chunks/chunk-K3HZMFMD.mjs.map +0 -7
- package/dist/js/chunks/chunk-KHXZ2A4K.mjs.map +0 -7
- package/dist/js/chunks/chunk-KQACNQ22.mjs +0 -7
- package/dist/js/chunks/chunk-KQACNQ22.mjs.map +0 -7
- package/dist/js/chunks/chunk-KUFHW3DS.mjs.map +0 -7
- package/dist/js/chunks/chunk-KVJAVDBC.mjs.map +0 -7
- package/dist/js/chunks/chunk-L27Q6ZMI.mjs.map +0 -7
- package/dist/js/chunks/chunk-LQWUDNHZ.mjs.map +0 -7
- package/dist/js/chunks/chunk-M372EDXD.mjs +0 -322
- package/dist/js/chunks/chunk-M372EDXD.mjs.map +0 -7
- package/dist/js/chunks/chunk-M3MURWMB.mjs +0 -82
- package/dist/js/chunks/chunk-M3MURWMB.mjs.map +0 -7
- package/dist/js/chunks/chunk-NUHMOAOY.mjs.map +0 -7
- package/dist/js/chunks/chunk-OWG3LMUL.mjs +0 -169
- package/dist/js/chunks/chunk-OWG3LMUL.mjs.map +0 -7
- package/dist/js/chunks/chunk-PD6HYHAE.mjs +0 -48
- package/dist/js/chunks/chunk-PD6HYHAE.mjs.map +0 -7
- package/dist/js/chunks/chunk-PDG64UHF.mjs.map +0 -7
- package/dist/js/chunks/chunk-PO3AXVR3.mjs +0 -546
- package/dist/js/chunks/chunk-PO3AXVR3.mjs.map +0 -7
- package/dist/js/chunks/chunk-QYGK36OG.mjs +0 -181
- package/dist/js/chunks/chunk-QYGK36OG.mjs.map +0 -7
- package/dist/js/chunks/chunk-SFI2U4YW.mjs.map +0 -7
- package/dist/js/chunks/chunk-SMY7GJSS.mjs.map +0 -7
- package/dist/js/chunks/chunk-TCCA2HDG.mjs +0 -414
- package/dist/js/chunks/chunk-TCCA2HDG.mjs.map +0 -7
- package/dist/js/chunks/chunk-TSZYSW7F.mjs.map +0 -7
- package/dist/js/chunks/chunk-UAZSDUVP.mjs.map +0 -7
- package/dist/js/chunks/chunk-UBRZZWRA.mjs +0 -127
- package/dist/js/chunks/chunk-UBRZZWRA.mjs.map +0 -7
- package/dist/js/chunks/chunk-UCOE7ZDL.mjs +0 -287
- package/dist/js/chunks/chunk-UCOE7ZDL.mjs.map +0 -7
- package/dist/js/chunks/chunk-UETTGDLI.mjs.map +0 -7
- package/dist/js/chunks/chunk-UNCRDLP6.mjs +0 -136
- package/dist/js/chunks/chunk-UNCRDLP6.mjs.map +0 -7
- package/dist/js/chunks/chunk-VGNYF6FB.mjs.map +0 -7
- package/dist/js/chunks/chunk-VGPGBNGL.mjs +0 -68
- package/dist/js/chunks/chunk-VGPGBNGL.mjs.map +0 -7
- package/dist/js/chunks/chunk-VKAUVTQY.mjs +0 -1
- package/dist/js/chunks/chunk-VM4FTS7L.mjs +0 -48
- package/dist/js/chunks/chunk-VM4FTS7L.mjs.map +0 -7
- package/dist/js/chunks/chunk-WDK4T63U.mjs.map +0 -7
- package/dist/js/chunks/chunk-WOCCTVUF.mjs +0 -185
- package/dist/js/chunks/chunk-WOCCTVUF.mjs.map +0 -7
- package/dist/js/chunks/chunk-WQYN5L4E.mjs +0 -107
- package/dist/js/chunks/chunk-WQYN5L4E.mjs.map +0 -7
- package/dist/js/chunks/chunk-X4ISMKE2.mjs.map +0 -7
- package/dist/js/chunks/chunk-XAEAEHIX.mjs.map +0 -7
- package/dist/js/chunks/chunk-ZX6M7SWO.mjs.map +0 -7
- /package/dist/js/chunks/{chunk-VKAUVTQY.mjs.map → chunk-GNRSYMVH.mjs.map} +0 -0
|
@@ -0,0 +1,730 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createDisplayPlugin,
|
|
3
|
+
hideModal
|
|
4
|
+
} from "./chunk-OUCHKSAW.mjs";
|
|
5
|
+
import {
|
|
6
|
+
Component
|
|
7
|
+
} from "./chunk-CMGXGYUC.mjs";
|
|
8
|
+
import {
|
|
9
|
+
Utils,
|
|
10
|
+
controllerFor,
|
|
11
|
+
pickerFooter,
|
|
12
|
+
svgNode
|
|
13
|
+
} from "./chunk-ZVLOUDIJ.mjs";
|
|
14
|
+
|
|
15
|
+
// src/ts/components/timepicker.ts
|
|
16
|
+
var UNITS = ["hours", "minutes", "seconds"];
|
|
17
|
+
var STEPS = { ArrowUp: 1, ArrowDown: -1, PageUp: 5, PageDown: -5 };
|
|
18
|
+
var dayHour = (hours, pm) => hours % 12 + (pm ? 12 : 0);
|
|
19
|
+
var SPANS = { hours: [3600, 24], minutes: [60, 60], seconds: [1, 60] };
|
|
20
|
+
var ringHour = (position, inner) => {
|
|
21
|
+
const hour = position % 12 + (inner ? 0 : 12);
|
|
22
|
+
return hour % 12 ? hour : 12 - hour;
|
|
23
|
+
};
|
|
24
|
+
var DAY_END = 24 * 3600 - 1;
|
|
25
|
+
var pad2 = (n) => String(n).padStart(2, "0");
|
|
26
|
+
function readTime(text, fromNow) {
|
|
27
|
+
const upper = text.trim().toUpperCase();
|
|
28
|
+
if (upper.split(":")[0] === "NOW") {
|
|
29
|
+
const now = new Date(+/* @__PURE__ */ new Date() + fromNow);
|
|
30
|
+
return [now.getHours(), now.getMinutes(), now.getSeconds()];
|
|
31
|
+
}
|
|
32
|
+
const period = /AM|PM/.exec(upper)?.[0];
|
|
33
|
+
const parts = upper.replace(/AM|PM/, "").split(":");
|
|
34
|
+
const [hours, minutes, seconds] = [0, 1, 2].map((i) => +parts[i] || 0);
|
|
35
|
+
return [period ? dayHour(hours, period === "PM") : hours, minutes, seconds];
|
|
36
|
+
}
|
|
37
|
+
var daySeconds = ([hours, minutes, seconds]) => hours * 3600 + minutes * 60 + seconds;
|
|
38
|
+
function localeClock(el) {
|
|
39
|
+
const locale = Utils.locale(el);
|
|
40
|
+
if (!locale) return {};
|
|
41
|
+
const cycle = new Intl.DateTimeFormat(locale, { hour: "numeric" }).resolvedOptions().hourCycle;
|
|
42
|
+
return { twelveHour: cycle === "h11" || cycle === "h12" };
|
|
43
|
+
}
|
|
44
|
+
var _defaults = {
|
|
45
|
+
dialRadius: 135,
|
|
46
|
+
outerRadius: 105,
|
|
47
|
+
innerRadius: 70,
|
|
48
|
+
tickRadius: 20,
|
|
49
|
+
duration: 350,
|
|
50
|
+
container: null,
|
|
51
|
+
defaultTime: "now",
|
|
52
|
+
// default time, 'now' or '13:14' e.g.
|
|
53
|
+
fromNow: 0,
|
|
54
|
+
// Millisecond offset from the defaultTime
|
|
55
|
+
showClearBtn: false,
|
|
56
|
+
autoSubmit: true,
|
|
57
|
+
// internationalization
|
|
58
|
+
i18n: {
|
|
59
|
+
cancel: "Cancel",
|
|
60
|
+
clear: "Clear",
|
|
61
|
+
done: "Ok",
|
|
62
|
+
hours: "Hours",
|
|
63
|
+
minutes: "Minutes",
|
|
64
|
+
seconds: "Seconds"
|
|
65
|
+
},
|
|
66
|
+
twelveHour: true,
|
|
67
|
+
// change to 12 hour AM/PM clock from 24 hour
|
|
68
|
+
showSeconds: false,
|
|
69
|
+
minTime: null,
|
|
70
|
+
maxTime: null,
|
|
71
|
+
vibrate: true,
|
|
72
|
+
// vibrate the device when dragging clock hand
|
|
73
|
+
// Callbacks
|
|
74
|
+
onSelect: null,
|
|
75
|
+
onInputInteraction: null,
|
|
76
|
+
onDone: null,
|
|
77
|
+
onCancel: null,
|
|
78
|
+
displayPlugin: null,
|
|
79
|
+
displayPluginOptions: null
|
|
80
|
+
};
|
|
81
|
+
var _Timepicker = class _Timepicker extends Component {
|
|
82
|
+
constructor(el, options) {
|
|
83
|
+
var _a;
|
|
84
|
+
super(el, { ...localeClock(el), ...options });
|
|
85
|
+
/** Which pointer is dragging the clock hand; a second finger is ignored. */
|
|
86
|
+
this._dragPointerId = null;
|
|
87
|
+
/** Removes the document listeners of the drag in progress. */
|
|
88
|
+
this._drag = null;
|
|
89
|
+
/** Whether the dial (ticks + SVG + AM/PM buttons) has been built yet. */
|
|
90
|
+
this._clockBuilt = false;
|
|
91
|
+
/** Whether the pointer last pointed at a value outside the range. */
|
|
92
|
+
this._handRefused = false;
|
|
93
|
+
/** The first and last allowed second of the day. */
|
|
94
|
+
this._limits = [0, DAY_END];
|
|
95
|
+
this._handleInputClick = () => {
|
|
96
|
+
this._updateTimeFromInput();
|
|
97
|
+
this._ensureClockBuilt();
|
|
98
|
+
if (this.displayPlugin) this.displayPlugin.show();
|
|
99
|
+
this.inputHours.focus();
|
|
100
|
+
if (typeof this.options.onInputInteraction === "function") this.options.onInputInteraction.call(this);
|
|
101
|
+
};
|
|
102
|
+
this._handleInputKeydown = Utils.ignoringComposition((e) => {
|
|
103
|
+
if (e.key === "Enter") {
|
|
104
|
+
e.preventDefault();
|
|
105
|
+
this._handleInputClick();
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
this._handleClockClickStart = (e) => {
|
|
109
|
+
if (!e.isPrimary) return;
|
|
110
|
+
if (e.pointerType === "mouse" && e.button !== 0) return;
|
|
111
|
+
e.preventDefault();
|
|
112
|
+
this._ensureClockBuilt();
|
|
113
|
+
const clockPlateBR = this.plate.getBoundingClientRect();
|
|
114
|
+
const offset = { x: clockPlateBR.left, y: clockPlateBR.top };
|
|
115
|
+
this.x0 = offset.x + this.options.dialRadius;
|
|
116
|
+
this.y0 = offset.y + this.options.dialRadius;
|
|
117
|
+
this.moved = false;
|
|
118
|
+
this._dragPointerId = e.pointerId;
|
|
119
|
+
this.dx = e.clientX - this.x0;
|
|
120
|
+
this.dy = e.clientY - this.y0;
|
|
121
|
+
this.setHand(this.dx, this.dy, false);
|
|
122
|
+
this._drag?.abort();
|
|
123
|
+
this._drag = controllerFor(this.el);
|
|
124
|
+
const { signal } = this._drag;
|
|
125
|
+
document.addEventListener("pointermove", this._handleDocumentClickMove, { signal });
|
|
126
|
+
document.addEventListener("pointerup", this._handleDocumentClickEnd, { signal });
|
|
127
|
+
document.addEventListener("pointercancel", this._handleDocumentClickCancel, { signal });
|
|
128
|
+
};
|
|
129
|
+
this._handleDocumentClickMove = (e) => {
|
|
130
|
+
if (e.pointerId !== this._dragPointerId) return;
|
|
131
|
+
e.preventDefault();
|
|
132
|
+
const x = e.clientX - this.x0;
|
|
133
|
+
const y = e.clientY - this.y0;
|
|
134
|
+
this.moved = true;
|
|
135
|
+
this.setHand(x, y, false);
|
|
136
|
+
};
|
|
137
|
+
this._handleDocumentClickEnd = (e) => {
|
|
138
|
+
if (e.pointerId !== this._dragPointerId) return;
|
|
139
|
+
this._dragPointerId = null;
|
|
140
|
+
e.preventDefault();
|
|
141
|
+
this._drag.abort();
|
|
142
|
+
const x = e.clientX - this.x0;
|
|
143
|
+
const y = e.clientY - this.y0;
|
|
144
|
+
if (this.moved && x === this.dx && y === this.dy) {
|
|
145
|
+
this.setHand(x, y);
|
|
146
|
+
}
|
|
147
|
+
if (!this._handRefused) this._chooseHand();
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* A cancelled pointer is not a completed selection. The browser or the OS
|
|
151
|
+
* took the gesture over, so this only lets go of the drag - it must not run
|
|
152
|
+
* the pointer-up path, which advances hours to minutes, fires `onSelect`,
|
|
153
|
+
* and under `autoSubmit` closes the picker on a time the user never chose.
|
|
154
|
+
*/
|
|
155
|
+
this._handleDocumentClickCancel = (e) => {
|
|
156
|
+
if (e.pointerId !== this._dragPointerId) return;
|
|
157
|
+
this._dragPointerId = null;
|
|
158
|
+
this.moved = false;
|
|
159
|
+
this._drag.abort();
|
|
160
|
+
};
|
|
161
|
+
this._handleAmPmClick = (e) => {
|
|
162
|
+
this._handleAmPmInteraction(e.target);
|
|
163
|
+
};
|
|
164
|
+
this._handleAmPmInteraction = (e) => {
|
|
165
|
+
this.amOrPm = e.classList.contains("am-btn") ? "AM" : "PM";
|
|
166
|
+
this._updateAmPmView();
|
|
167
|
+
this._afterChange();
|
|
168
|
+
this.resetClock(null);
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* Show hours or minutes view on timepicker.
|
|
172
|
+
* @param view The name of the view you want to switch to, 'hours' or 'minutes'.
|
|
173
|
+
* @param delay
|
|
174
|
+
*/
|
|
175
|
+
this.showView = (view, delay = null) => {
|
|
176
|
+
this._ensureClockBuilt();
|
|
177
|
+
const isHours = view === "hours", nextView = isHours ? this.hoursView : this.minutesView, hideView = isHours ? this.minutesView : this.hoursView;
|
|
178
|
+
this.currentView = view;
|
|
179
|
+
hideView.classList.add("timepicker-dial-out");
|
|
180
|
+
nextView.style.visibility = "visible";
|
|
181
|
+
nextView.classList.remove("timepicker-dial-out");
|
|
182
|
+
this.resetClock(delay);
|
|
183
|
+
clearTimeout(this.toggleViewTimer);
|
|
184
|
+
this.toggleViewTimer = setTimeout(() => {
|
|
185
|
+
hideView.style.visibility = "hidden";
|
|
186
|
+
}, this.options.duration);
|
|
187
|
+
};
|
|
188
|
+
/**
|
|
189
|
+
* Enter in the hour or minute field commits the typed time. The dial ticks
|
|
190
|
+
* are pointer targets only, and under `autoSubmit` there is no Ok button,
|
|
191
|
+
* so without this a keyboard user could type a time but never set it.
|
|
192
|
+
* Cancelling also keeps Enter from submitting a surrounding form. The
|
|
193
|
+
* listener's column holds only the fields; AM/PM is a separate column.
|
|
194
|
+
*/
|
|
195
|
+
this._handleDigitalKeydown = Utils.ignoringComposition((event) => {
|
|
196
|
+
if (event.key in STEPS) return this._step(event);
|
|
197
|
+
if (event.key !== "Enter") return;
|
|
198
|
+
event.preventDefault();
|
|
199
|
+
this._formatFields();
|
|
200
|
+
if (this.options.autoSubmit) this.done();
|
|
201
|
+
else this.confirm();
|
|
202
|
+
});
|
|
203
|
+
this._inputFromTextField = (event) => {
|
|
204
|
+
const input = event.target;
|
|
205
|
+
const unit = this._unitOf(input);
|
|
206
|
+
if (!unit) return;
|
|
207
|
+
if (unit !== "seconds") this._cancelClockReset();
|
|
208
|
+
const value = this._fieldValue(unit, input.value);
|
|
209
|
+
if (Number.isNaN(value)) return;
|
|
210
|
+
this[unit] = value;
|
|
211
|
+
this._afterChange(input);
|
|
212
|
+
this._moveHand(unit, value);
|
|
213
|
+
};
|
|
214
|
+
this.done = (clearValue = null) => {
|
|
215
|
+
const last = this.el.value;
|
|
216
|
+
let value = clearValue ? "" : this._clockTime(this.hours);
|
|
217
|
+
this.time = value;
|
|
218
|
+
if (!clearValue) value = this._inputValue(value);
|
|
219
|
+
this.el.value = value;
|
|
220
|
+
if (value !== last) {
|
|
221
|
+
this.el.dispatchEvent(
|
|
222
|
+
new Event("change", { bubbles: true, cancelable: true, composed: true })
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
this.confirm = () => {
|
|
227
|
+
this.done();
|
|
228
|
+
hideModal(this.displayPlugin);
|
|
229
|
+
this._notify("confirm", this.options.onDone, { args: [] });
|
|
230
|
+
};
|
|
231
|
+
this.cancel = () => {
|
|
232
|
+
hideModal(this.displayPlugin);
|
|
233
|
+
this._notify("cancel", this.options.onCancel, { args: [] });
|
|
234
|
+
};
|
|
235
|
+
this.clear = () => {
|
|
236
|
+
this.done(true);
|
|
237
|
+
};
|
|
238
|
+
(_a = this.options).autoSubmit && (_a.autoSubmit = this.options.displayPlugin !== "modal");
|
|
239
|
+
this.id = Utils.guid();
|
|
240
|
+
this._readLimits();
|
|
241
|
+
this._insertHTMLIntoDOM();
|
|
242
|
+
this._setupVariables();
|
|
243
|
+
this._setupEventHandlers();
|
|
244
|
+
this._pickerSetup();
|
|
245
|
+
this.displayPlugin = createDisplayPlugin(this.options.displayPlugin, this.el, this.containerEl, this.options.displayPluginOptions, this.cancel);
|
|
246
|
+
}
|
|
247
|
+
static get defaults() {
|
|
248
|
+
return _defaults;
|
|
249
|
+
}
|
|
250
|
+
destroy() {
|
|
251
|
+
clearTimeout(this._autoSubmitTimer);
|
|
252
|
+
clearTimeout(this.toggleViewTimer);
|
|
253
|
+
clearTimeout(this.vibrateTimer);
|
|
254
|
+
this._cancelClockReset();
|
|
255
|
+
this._drag?.abort();
|
|
256
|
+
this.displayPlugin?.destroy();
|
|
257
|
+
this.containerEl.remove();
|
|
258
|
+
super.destroy();
|
|
259
|
+
}
|
|
260
|
+
_setupEventHandlers() {
|
|
261
|
+
const { signal } = this._events;
|
|
262
|
+
this.el.addEventListener("click", this._handleInputClick, { signal });
|
|
263
|
+
this.el.addEventListener("keydown", this._handleInputKeydown, { signal });
|
|
264
|
+
this.plate.addEventListener("pointerdown", this._handleClockClickStart);
|
|
265
|
+
this.digitalClock.addEventListener("input", this._inputFromTextField, { signal });
|
|
266
|
+
this.digitalClock.addEventListener("keydown", this._handleDigitalKeydown, { signal });
|
|
267
|
+
this.inputHours.addEventListener("focus", () => this.showView("hours"));
|
|
268
|
+
this.inputHours.addEventListener("focusout", () => this.formatHours());
|
|
269
|
+
this.inputMinutes.addEventListener("focus", () => this.showView("minutes"));
|
|
270
|
+
this.inputMinutes.addEventListener("focusout", () => this.formatMinutes());
|
|
271
|
+
this.inputSeconds?.addEventListener("focusout", () => this.formatSeconds());
|
|
272
|
+
}
|
|
273
|
+
/** Take the value under the hand: move on to the minutes, or submit. */
|
|
274
|
+
_chooseHand() {
|
|
275
|
+
if (this.currentView === "hours") {
|
|
276
|
+
this.inputMinutes.focus();
|
|
277
|
+
this.showView("minutes", this.options.duration / 2);
|
|
278
|
+
} else {
|
|
279
|
+
clearTimeout(this._autoSubmitTimer);
|
|
280
|
+
this._autoSubmitTimer = setTimeout(() => {
|
|
281
|
+
this._autoSubmitTimer = null;
|
|
282
|
+
if (this.options.autoSubmit) this.done();
|
|
283
|
+
}, this.options.duration / 2);
|
|
284
|
+
}
|
|
285
|
+
const { hours, minutes } = this;
|
|
286
|
+
this._notify("select", this.options.onSelect, { args: [hours, minutes], detail: { hours, minutes }, current: () => this.hours === hours && this.minutes === minutes });
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Read `minTime` and `maxTime` as seconds of the day. Without a seconds
|
|
290
|
+
* field the picker writes whole minutes, so the bounds round inward to a
|
|
291
|
+
* whole minute: `maxTime` takes in every second of its minute, and the
|
|
292
|
+
* hidden seconds never clamp.
|
|
293
|
+
*/
|
|
294
|
+
_readLimits() {
|
|
295
|
+
const { minTime, maxTime, showSeconds, fromNow } = this.options;
|
|
296
|
+
const read = (time, fallback) => time ? daySeconds(readTime(time, fromNow)) : fallback;
|
|
297
|
+
let [min, max] = [read(minTime, 0), read(maxTime, DAY_END)];
|
|
298
|
+
if (!showSeconds) [min, max] = [Math.ceil(min / 60) * 60, Math.floor(max / 60) * 60 + 59];
|
|
299
|
+
if (min > max) return console.warn("Timepicker ignored minTime and maxTime: minTime is after maxTime.", this.el);
|
|
300
|
+
this._limits = [min, max];
|
|
301
|
+
}
|
|
302
|
+
_insertHTMLIntoDOM() {
|
|
303
|
+
const template = document.createElement("template");
|
|
304
|
+
template.innerHTML = _Timepicker._template.trim();
|
|
305
|
+
this.containerEl = template.content.firstChild;
|
|
306
|
+
this.containerEl.id = "container-" + this.id;
|
|
307
|
+
const optEl = this.options.container;
|
|
308
|
+
const containerEl = optEl instanceof HTMLElement ? optEl : document.querySelector(optEl);
|
|
309
|
+
if (this.options.container && !!containerEl) {
|
|
310
|
+
containerEl.append(this.containerEl);
|
|
311
|
+
} else {
|
|
312
|
+
this.el.parentElement.appendChild(this.containerEl);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
_setupVariables() {
|
|
316
|
+
this.currentView = "hours";
|
|
317
|
+
this.canVibrate = typeof navigator.vibrate === "function";
|
|
318
|
+
this._canvas = this.containerEl.querySelector(".timepicker-canvas");
|
|
319
|
+
this.plate = this.containerEl.querySelector(".timepicker-plate");
|
|
320
|
+
this.digitalClock = this.containerEl.querySelector(".timepicker-display-column");
|
|
321
|
+
this.hoursView = this.containerEl.querySelector(".timepicker-hours");
|
|
322
|
+
this.minutesView = this.containerEl.querySelector(".timepicker-minutes");
|
|
323
|
+
this.inputHours = this.containerEl.querySelector(".timepicker-input-hours");
|
|
324
|
+
this.inputMinutes = this.containerEl.querySelector(".timepicker-input-minutes");
|
|
325
|
+
this.inputSeconds = this.containerEl.querySelector(".timepicker-input-seconds");
|
|
326
|
+
if (!this.options.showSeconds) this._removeSecondsField();
|
|
327
|
+
for (const unit of this._units()) {
|
|
328
|
+
const [min, max] = this._bounds(unit);
|
|
329
|
+
const attributes = { role: "spinbutton", "aria-valuemin": min, "aria-valuemax": max, "aria-label": this.options.i18n[unit] };
|
|
330
|
+
Object.entries(attributes).forEach(([name, value]) => this._input(unit).setAttribute(name, String(value)));
|
|
331
|
+
}
|
|
332
|
+
this.spanAmPm = this.containerEl.querySelector(".timepicker-span-am-pm");
|
|
333
|
+
this.footer = this.containerEl.querySelector(".timepicker-footer");
|
|
334
|
+
this.amOrPm = "PM";
|
|
335
|
+
}
|
|
336
|
+
_removeSecondsField() {
|
|
337
|
+
this.containerEl.querySelectorAll(".timepicker-seconds-divider, .timepicker-input-seconds-wrapper").forEach((el) => el.remove());
|
|
338
|
+
this.inputSeconds = null;
|
|
339
|
+
}
|
|
340
|
+
_input(unit) {
|
|
341
|
+
return { hours: this.inputHours, minutes: this.inputMinutes, seconds: this.inputSeconds }[unit];
|
|
342
|
+
}
|
|
343
|
+
/** The units that have a field. */
|
|
344
|
+
_units() {
|
|
345
|
+
return UNITS.filter((unit) => this._input(unit));
|
|
346
|
+
}
|
|
347
|
+
/** Which unit's field `target` is, if any. */
|
|
348
|
+
_unitOf(target) {
|
|
349
|
+
return this._units().find((unit) => this._input(unit) === target);
|
|
350
|
+
}
|
|
351
|
+
_pickerSetup() {
|
|
352
|
+
pickerFooter(this.footer, this.options, "timepicker-clear", this.clear, this.confirm, this.cancel);
|
|
353
|
+
this._updateTimeFromInput();
|
|
354
|
+
if (!this.options.displayPlugin) this.showView("hours");
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Build the dial, once. Cheap to call repeatedly - every entry point that
|
|
358
|
+
* touches the clock calls it first, so the picker cannot be interacted with
|
|
359
|
+
* before it exists.
|
|
360
|
+
*/
|
|
361
|
+
_ensureClockBuilt() {
|
|
362
|
+
if (this._clockBuilt) return;
|
|
363
|
+
this._clockBuilt = true;
|
|
364
|
+
this._clockSetup();
|
|
365
|
+
this._updateAmPmView();
|
|
366
|
+
this._updateRanges();
|
|
367
|
+
}
|
|
368
|
+
_clockSetup() {
|
|
369
|
+
if (this.options.twelveHour) {
|
|
370
|
+
this._amBtn = document.createElement("button");
|
|
371
|
+
this._amBtn.type = "button";
|
|
372
|
+
this._amBtn.classList.add("am-btn");
|
|
373
|
+
this._amBtn.innerText = "AM";
|
|
374
|
+
this._amBtn.addEventListener("click", this._handleAmPmClick);
|
|
375
|
+
this.spanAmPm.appendChild(this._amBtn);
|
|
376
|
+
this._pmBtn = document.createElement("button");
|
|
377
|
+
this._pmBtn.type = "button";
|
|
378
|
+
this._pmBtn.classList.add("pm-btn");
|
|
379
|
+
this._pmBtn.innerText = "PM";
|
|
380
|
+
this._pmBtn.addEventListener("click", this._handleAmPmClick);
|
|
381
|
+
this.spanAmPm.appendChild(this._pmBtn);
|
|
382
|
+
}
|
|
383
|
+
this._buildHoursView();
|
|
384
|
+
this._buildMinutesView();
|
|
385
|
+
this._buildSVGClock();
|
|
386
|
+
}
|
|
387
|
+
_buildSVGClock() {
|
|
388
|
+
const dialRadius = this.options.dialRadius;
|
|
389
|
+
const tickRadius = this.options.tickRadius;
|
|
390
|
+
const diameter = dialRadius * 2;
|
|
391
|
+
this.plate.style.width = this.plate.style.height = diameter + "px";
|
|
392
|
+
const svg = svgNode("svg", { class: "timepicker-svg", width: String(diameter), height: String(diameter) });
|
|
393
|
+
const g = svgNode("g", { transform: `translate(${dialRadius},${dialRadius})` });
|
|
394
|
+
const bearing = svgNode("circle", { class: "timepicker-canvas-bearing", cx: "0", cy: "0", r: "4" });
|
|
395
|
+
const hand = svgNode("line", { x1: "0", y1: "0" });
|
|
396
|
+
const bg = svgNode("circle", { class: "timepicker-canvas-bg", r: String(tickRadius) });
|
|
397
|
+
g.appendChild(hand);
|
|
398
|
+
g.appendChild(bg);
|
|
399
|
+
g.appendChild(bearing);
|
|
400
|
+
svg.appendChild(g);
|
|
401
|
+
this._canvas.appendChild(svg);
|
|
402
|
+
this.hand = hand;
|
|
403
|
+
this.bg = bg;
|
|
404
|
+
this.g = g;
|
|
405
|
+
}
|
|
406
|
+
_buildHoursView() {
|
|
407
|
+
if (this.options.twelveHour) {
|
|
408
|
+
for (let i = 1; i < 13; i += 1) {
|
|
409
|
+
const radian = i / 6 * Math.PI;
|
|
410
|
+
const radius = this.options.outerRadius;
|
|
411
|
+
this._buildHoursTick(i, radian, radius);
|
|
412
|
+
}
|
|
413
|
+
} else {
|
|
414
|
+
for (let i = 0; i < 24; i += 1) {
|
|
415
|
+
const radian = i / 6 * Math.PI;
|
|
416
|
+
const inner = i > 0 && i < 13;
|
|
417
|
+
const radius = inner ? this.options.innerRadius : this.options.outerRadius;
|
|
418
|
+
this._buildHoursTick(i, radian, radius);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
_buildHoursTick(i, radian, radius) {
|
|
423
|
+
this._placeTick(this.hoursView, radian, radius, i === 0 ? "00" : i.toString());
|
|
424
|
+
}
|
|
425
|
+
_buildMinutesView() {
|
|
426
|
+
for (let i = 0; i < 60; i += 5) {
|
|
427
|
+
const radian = i / 30 * Math.PI;
|
|
428
|
+
this._placeTick(this.minutesView, radian, this.options.outerRadius, pad2(i));
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
_placeTick(view, radian, radius, text) {
|
|
432
|
+
const tick = document.createElement("div");
|
|
433
|
+
tick.classList.add("timepicker-tick");
|
|
434
|
+
tick.style.left = this.options.dialRadius + Math.sin(radian) * radius - this.options.tickRadius + "px";
|
|
435
|
+
tick.style.top = this.options.dialRadius - Math.cos(radian) * radius - this.options.tickRadius + "px";
|
|
436
|
+
tick.textContent = text;
|
|
437
|
+
view.appendChild(tick);
|
|
438
|
+
}
|
|
439
|
+
_updateAmPmView() {
|
|
440
|
+
if (!this._amBtn || !this._pmBtn) return;
|
|
441
|
+
this._amBtn.setAttribute("aria-pressed", String(this.amOrPm === "AM"));
|
|
442
|
+
this._pmBtn.setAttribute("aria-pressed", String(this.amOrPm === "PM"));
|
|
443
|
+
this._amBtn.classList.toggle("outlined", this.amOrPm !== "AM");
|
|
444
|
+
this._pmBtn.classList.toggle("outlined", this.amOrPm !== "PM");
|
|
445
|
+
if (this.options.twelveHour) {
|
|
446
|
+
if (this.amOrPm === "PM") {
|
|
447
|
+
this._amBtn.classList.remove("filled");
|
|
448
|
+
this._pmBtn.classList.add("filled");
|
|
449
|
+
} else if (this.amOrPm === "AM") {
|
|
450
|
+
this._amBtn.classList.add("filled");
|
|
451
|
+
this._pmBtn.classList.remove("filled");
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
_updateTimeFromInput() {
|
|
456
|
+
this._cancelClockReset();
|
|
457
|
+
const [hours, minutes, seconds] = readTime(`${this.el.value || this.options.defaultTime || ""}`, this.options.fromNow);
|
|
458
|
+
[this.minutes, this.seconds] = [minutes, seconds];
|
|
459
|
+
this._setHours24(hours);
|
|
460
|
+
this._clamp();
|
|
461
|
+
this._writeFields();
|
|
462
|
+
this._updateAmPmView();
|
|
463
|
+
this._updateRanges();
|
|
464
|
+
}
|
|
465
|
+
/** Show the time in every field but `except`, which the person is typing in. */
|
|
466
|
+
_writeFields(except) {
|
|
467
|
+
this._units().forEach((unit) => {
|
|
468
|
+
if (this._input(unit) !== except) this._input(unit).value = pad2(this[unit]);
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
/** After a change to the time: keep it in range and update what depends on it. */
|
|
472
|
+
_afterChange(except) {
|
|
473
|
+
if (this._clamp()) this._writeFields(except);
|
|
474
|
+
this._updateRanges();
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Give each field the allowed range of values, and disable a period with
|
|
478
|
+
* no allowed time.
|
|
479
|
+
*/
|
|
480
|
+
_updateRanges() {
|
|
481
|
+
for (const unit of this._units()) {
|
|
482
|
+
const [min, max] = this._range(unit);
|
|
483
|
+
this._input(unit).setAttribute("aria-valuemin", String(min));
|
|
484
|
+
this._input(unit).setAttribute("aria-valuemax", String(max));
|
|
485
|
+
}
|
|
486
|
+
const [first, last] = this._dayRange("hours");
|
|
487
|
+
if (this._amBtn) [this._amBtn.disabled, this._pmBtn.disabled] = [first > 11, last < 12];
|
|
488
|
+
this._disableTicks(this.hoursView, "hours");
|
|
489
|
+
this._disableTicks(this.minutesView, "minutes");
|
|
490
|
+
}
|
|
491
|
+
/** Mark the ticks of a dial view that are outside the range. */
|
|
492
|
+
_disableTicks(view, unit) {
|
|
493
|
+
view.querySelectorAll(".timepicker-tick").forEach((tick) => {
|
|
494
|
+
tick.classList.toggle("is-disabled", !this._allows(unit, Number(tick.textContent)));
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
/** The hour on the 24-hour clock, setting AM or PM on a 12-hour one. */
|
|
498
|
+
_setHours24(hour) {
|
|
499
|
+
if (!this.options.twelveHour) return void (this.hours = hour);
|
|
500
|
+
this.amOrPm = hour >= 12 ? "PM" : "AM";
|
|
501
|
+
this.hours = hour % 12 || 12;
|
|
502
|
+
this._updateAmPmView();
|
|
503
|
+
}
|
|
504
|
+
/** The time as seconds of the day. */
|
|
505
|
+
_time() {
|
|
506
|
+
return daySeconds([this._dayValue("hours", this.hours), this.minutes, this.seconds]);
|
|
507
|
+
}
|
|
508
|
+
/** Move the time to the nearest allowed time, and say whether it moved. */
|
|
509
|
+
_clamp() {
|
|
510
|
+
const time = this._time();
|
|
511
|
+
const clamped = Math.min(Math.max(time, this._limits[0]), this._limits[1]);
|
|
512
|
+
if (clamped === time) return false;
|
|
513
|
+
this._setHours24(Math.floor(clamped / 3600));
|
|
514
|
+
[this.minutes, this.seconds] = [Math.floor(clamped / 60) % 60, clamped % 60];
|
|
515
|
+
return true;
|
|
516
|
+
}
|
|
517
|
+
_cancelClockReset() {
|
|
518
|
+
clearTimeout(this._clockResetTimer);
|
|
519
|
+
this._clockResetTimer = null;
|
|
520
|
+
this._canvas?.classList.remove("timepicker-canvas-out");
|
|
521
|
+
}
|
|
522
|
+
resetClock(delay) {
|
|
523
|
+
this._cancelClockReset();
|
|
524
|
+
const view = this.currentView, value = this[view], isHours = view === "hours", unit = Math.PI / (isHours ? 6 : 30), radian = value * unit, radius = isHours && value > 0 && value < 13 ? this.options.innerRadius : this.options.outerRadius, x = Math.sin(radian) * radius, y = -Math.cos(radian) * radius;
|
|
525
|
+
if (delay) {
|
|
526
|
+
this._canvas?.classList.add("timepicker-canvas-out");
|
|
527
|
+
this._clockResetTimer = setTimeout(() => {
|
|
528
|
+
this.setHand(x, y);
|
|
529
|
+
}, delay);
|
|
530
|
+
} else {
|
|
531
|
+
this.setHand(x, y);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
/** The lowest and highest value a field can show. */
|
|
535
|
+
_bounds(unit) {
|
|
536
|
+
if (unit !== "hours") return [0, 59];
|
|
537
|
+
return this.options.twelveHour ? [1, 12] : [0, 23];
|
|
538
|
+
}
|
|
539
|
+
/** The lowest and highest allowed value of a field, given the others. */
|
|
540
|
+
_range(unit) {
|
|
541
|
+
const [min, max] = this._bounds(unit);
|
|
542
|
+
const allowed = Array.from({ length: max - min + 1 }, (_, i) => min + i).filter((value) => this._allows(unit, value));
|
|
543
|
+
return allowed.length ? [Math.min(...allowed), Math.max(...allowed)] : [min, max];
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* The first and last allowed value of a field, given the fields before it,
|
|
547
|
+
* with hours on the 24-hour clock. An hour is allowed when any second of
|
|
548
|
+
* it is, and so is a minute.
|
|
549
|
+
*/
|
|
550
|
+
_dayRange(unit) {
|
|
551
|
+
const [size, count] = SPANS[unit];
|
|
552
|
+
const start = this._time() - this._time() % (size * count);
|
|
553
|
+
return this._limits.map((limit) => Math.min(Math.max(Math.floor((limit - start) / size), 0), count - 1));
|
|
554
|
+
}
|
|
555
|
+
/** A field's value with hours on the 24-hour clock. */
|
|
556
|
+
_dayValue(unit, value) {
|
|
557
|
+
return unit === "hours" && this.options.twelveHour ? dayHour(value, this.amOrPm === "PM") : value;
|
|
558
|
+
}
|
|
559
|
+
/** Whether a field can take `value` within the range. */
|
|
560
|
+
_allows(unit, value) {
|
|
561
|
+
const [first, last] = this._dayRange(unit);
|
|
562
|
+
const day = this._dayValue(unit, value);
|
|
563
|
+
return Math.min(Math.max(day, first), last) === day;
|
|
564
|
+
}
|
|
565
|
+
/** The whole number typed in a field, or NaN when the field can't take it. */
|
|
566
|
+
_fieldValue(unit, text) {
|
|
567
|
+
const value = Number(text.trim() || NaN);
|
|
568
|
+
return this._takes(unit, value) ? value : NaN;
|
|
569
|
+
}
|
|
570
|
+
/** Whether a field can show `value` and the range allows it. */
|
|
571
|
+
_takes(unit, value) {
|
|
572
|
+
const [min, max] = this._bounds(unit);
|
|
573
|
+
return Number.isInteger(value) && Math.min(Math.max(value, min), max) === value && this._allows(unit, value);
|
|
574
|
+
}
|
|
575
|
+
/** Point the hand at an hour or minute. Seconds have no dial view. */
|
|
576
|
+
_moveHand(unit, value) {
|
|
577
|
+
if (unit === "seconds") return;
|
|
578
|
+
this._cancelClockReset();
|
|
579
|
+
this.drawClockFromTimeInput(value, unit === "hours");
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* Up and Down step a field by one, Page Up and Page Down by five, round
|
|
583
|
+
* the dial: past 59 minutes comes 00. The hand follows hours and minutes.
|
|
584
|
+
* Hours step round the day, so in 12-hour time passing 12 switches AM and
|
|
585
|
+
* PM. Minutes and seconds wrap without carrying. With `minTime` or
|
|
586
|
+
* `maxTime`, a field that is not wholly allowed stops at its last allowed
|
|
587
|
+
* value instead of wrapping.
|
|
588
|
+
*/
|
|
589
|
+
_step(event) {
|
|
590
|
+
const input = event.target;
|
|
591
|
+
const unit = this._unitOf(input);
|
|
592
|
+
if (!unit) return;
|
|
593
|
+
event.preventDefault();
|
|
594
|
+
const value = this._stepValue(unit, STEPS[event.key]);
|
|
595
|
+
if (unit === "hours") this._setHours24(value);
|
|
596
|
+
else this[unit] = value;
|
|
597
|
+
this._afterChange();
|
|
598
|
+
input.value = pad2(this[unit]);
|
|
599
|
+
this._moveHand(unit, this[unit]);
|
|
600
|
+
}
|
|
601
|
+
/** A field's value `step` on, with hours on the 24-hour clock. */
|
|
602
|
+
_stepValue(unit, step) {
|
|
603
|
+
const [first, last] = this._dayRange(unit);
|
|
604
|
+
const count = SPANS[unit][1];
|
|
605
|
+
const next = this._dayValue(unit, this[unit]) + step;
|
|
606
|
+
return first === 0 && last === count - 1 ? (next + count) % count : Math.min(Math.max(next, first), last);
|
|
607
|
+
}
|
|
608
|
+
drawClockFromTimeInput(value, isHours) {
|
|
609
|
+
const unit = Math.PI / (isHours ? 6 : 30);
|
|
610
|
+
const radian = value * unit;
|
|
611
|
+
let radius;
|
|
612
|
+
if (this.options.twelveHour) {
|
|
613
|
+
radius = this.options.outerRadius;
|
|
614
|
+
} else {
|
|
615
|
+
radius = isHours && value > 0 && value < 13 ? this.options.innerRadius : this.options.outerRadius;
|
|
616
|
+
}
|
|
617
|
+
this.setClockAttributes(radian, radius);
|
|
618
|
+
}
|
|
619
|
+
setHand(x, y, roundBy5 = false) {
|
|
620
|
+
this._cancelClockReset();
|
|
621
|
+
const isHours = this.currentView === "hours", unit = Math.PI / (isHours || roundBy5 ? 6 : 30), z = Math.sqrt(x * x + y * y), inner = isHours && z < (this.options.outerRadius + this.options.innerRadius) / 2;
|
|
622
|
+
const radius = inner && !this.options.twelveHour ? this.options.innerRadius : this.options.outerRadius;
|
|
623
|
+
let radian = Math.atan2(x, -y);
|
|
624
|
+
if (radian < 0) {
|
|
625
|
+
radian = Math.PI * 2 + radian;
|
|
626
|
+
}
|
|
627
|
+
const position = Math.round(radian / unit);
|
|
628
|
+
radian = position * unit;
|
|
629
|
+
const value = isHours ? this._hourAt(position, inner) : (roundBy5 ? position * 5 : position) % 60;
|
|
630
|
+
this._handRefused = !this._allows(this.currentView, value);
|
|
631
|
+
if (this._handRefused) return;
|
|
632
|
+
if (this[this.currentView] !== value && this.canVibrate && this.options.vibrate && !this.vibrateTimer) {
|
|
633
|
+
navigator.vibrate(10);
|
|
634
|
+
this.vibrateTimer = setTimeout(() => {
|
|
635
|
+
this.vibrateTimer = null;
|
|
636
|
+
}, 100);
|
|
637
|
+
}
|
|
638
|
+
this[this.currentView] = value;
|
|
639
|
+
(isHours ? this.inputHours : this.inputMinutes).value = pad2(value);
|
|
640
|
+
this.setClockAttributes(radian, radius);
|
|
641
|
+
this._afterChange();
|
|
642
|
+
}
|
|
643
|
+
/** The hour at a dial position, 0 to 12 from the top. */
|
|
644
|
+
_hourAt(position, inner) {
|
|
645
|
+
return this.options.twelveHour ? position % 12 || 12 : ringHour(position, inner);
|
|
646
|
+
}
|
|
647
|
+
setClockAttributes(radian, radius) {
|
|
648
|
+
if (!this.hand || !this.bg) return;
|
|
649
|
+
const cx1 = Math.sin(radian) * (radius - this.options.tickRadius), cy1 = -Math.cos(radian) * (radius - this.options.tickRadius), cx2 = Math.sin(radian) * radius, cy2 = -Math.cos(radian) * radius;
|
|
650
|
+
this.hand.setAttribute("x2", cx1.toString());
|
|
651
|
+
this.hand.setAttribute("y2", cy1.toString());
|
|
652
|
+
this.bg.setAttribute("cx", cx2.toString());
|
|
653
|
+
this.bg.setAttribute("cy", cy2.toString());
|
|
654
|
+
}
|
|
655
|
+
formatHours() {
|
|
656
|
+
if (this.inputHours.value == "") this.setHoursDefault();
|
|
657
|
+
this.inputHours.value = pad2(this.hours);
|
|
658
|
+
}
|
|
659
|
+
formatMinutes() {
|
|
660
|
+
if (this.inputMinutes.value == "") this.minutes = (/* @__PURE__ */ new Date()).getMinutes();
|
|
661
|
+
this.inputMinutes.value = pad2(this.minutes);
|
|
662
|
+
}
|
|
663
|
+
formatSeconds() {
|
|
664
|
+
if (this.inputSeconds.value == "") this.seconds = (/* @__PURE__ */ new Date()).getSeconds();
|
|
665
|
+
this.inputSeconds.value = pad2(this.seconds);
|
|
666
|
+
}
|
|
667
|
+
/** Normalize every field, as leaving it would. */
|
|
668
|
+
_formatFields() {
|
|
669
|
+
this.formatHours();
|
|
670
|
+
this.formatMinutes();
|
|
671
|
+
if (this.inputSeconds) this.formatSeconds();
|
|
672
|
+
}
|
|
673
|
+
setHoursDefault() {
|
|
674
|
+
this.hours = (/* @__PURE__ */ new Date()).getHours();
|
|
675
|
+
if (this.options.twelveHour) this.hours = this.hours % 12 || 12;
|
|
676
|
+
this.inputHours.value = this.hours.toString();
|
|
677
|
+
}
|
|
678
|
+
/** `HH:MM` for the given hour, or `HH:MM:SS` with a seconds field. */
|
|
679
|
+
_clockTime(hours) {
|
|
680
|
+
const parts = this.inputSeconds ? [hours, this.minutes, this.seconds] : [hours, this.minutes];
|
|
681
|
+
return parts.map(pad2).join(":");
|
|
682
|
+
}
|
|
683
|
+
// A time input accepts only 24-hour HH:mm or HH:mm:ss and empties itself
|
|
684
|
+
// on anything else, so it never gets the AM/PM a text input shows.
|
|
685
|
+
_inputValue(time) {
|
|
686
|
+
if (this.el.type === "time") return this._clockTime(this._dayValue("hours", this.hours));
|
|
687
|
+
return this.options.twelveHour ? `${time} ${this.amOrPm}` : time;
|
|
688
|
+
}
|
|
689
|
+
};
|
|
690
|
+
_Timepicker.key = "Expressive_Timepicker";
|
|
691
|
+
_Timepicker._template = `<div class="timepicker-container">
|
|
692
|
+
<div class="timepicker-digital-display">
|
|
693
|
+
<div class="timepicker-text-container">
|
|
694
|
+
<div class="timepicker-display-column timepicker-display-digital-clock">
|
|
695
|
+
<div class="timepicker-input-hours-wrapper">
|
|
696
|
+
<input type="text" maxlength="2" class="timepicker-input-hours" />
|
|
697
|
+
</div>
|
|
698
|
+
<div class="timepicker-input-divider-wrapper">
|
|
699
|
+
<span class="timepicker-input-divider">:</span>
|
|
700
|
+
</div>
|
|
701
|
+
<div class="timepicker-input-minutes-wrapper">
|
|
702
|
+
<input type="text" maxlength="2" class="timepicker-input-minutes" />
|
|
703
|
+
</div>
|
|
704
|
+
<div class="timepicker-input-divider-wrapper timepicker-seconds-divider">
|
|
705
|
+
<span class="timepicker-input-divider">:</span>
|
|
706
|
+
</div>
|
|
707
|
+
<div class="timepicker-input-seconds-wrapper">
|
|
708
|
+
<input type="text" maxlength="2" class="timepicker-input-seconds" />
|
|
709
|
+
</div>
|
|
710
|
+
</div>
|
|
711
|
+
<div class="timepicker-display-column timepicker-display-am-pm">
|
|
712
|
+
<div class="timepicker-span-am-pm"></div>
|
|
713
|
+
</div>
|
|
714
|
+
</div>
|
|
715
|
+
</div>
|
|
716
|
+
<div class="timepicker-analog-display">
|
|
717
|
+
<div class="timepicker-plate">
|
|
718
|
+
<div class="timepicker-canvas"></div>
|
|
719
|
+
<div class="timepicker-dial timepicker-hours"></div>
|
|
720
|
+
<div class="timepicker-dial timepicker-minutes timepicker-dial-out"></div>
|
|
721
|
+
</div>
|
|
722
|
+
<div class="timepicker-footer"></div>
|
|
723
|
+
</div>
|
|
724
|
+
</div>`;
|
|
725
|
+
var Timepicker = _Timepicker;
|
|
726
|
+
|
|
727
|
+
export {
|
|
728
|
+
Timepicker
|
|
729
|
+
};
|
|
730
|
+
//# sourceMappingURL=chunk-KYIEG4U3.mjs.map
|