@blukavantui/community 0.0.0-stage → 1.0.1
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/LICENSE.txt +103 -0
- package/README.md +171 -2
- package/THIRD_PARTY_NOTICES.txt +58 -0
- package/assets/fonts/dm-sans-LICENSE.txt +93 -0
- package/assets/fonts/dm-sans-latin-ext-wght-italic.woff2 +0 -0
- package/assets/fonts/dm-sans-latin-ext-wght-normal.woff2 +0 -0
- package/assets/fonts/dm-sans-latin-wght-italic.woff2 +0 -0
- package/assets/fonts/dm-sans-latin-wght-normal.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-LICENSE.txt +93 -0
- package/assets/fonts/ibm-plex-mono-latin-100-italic.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-100-normal.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-200-italic.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-200-normal.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-300-italic.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-300-normal.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-400-italic.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-400-normal.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-500-italic.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-500-normal.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-600-italic.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-600-normal.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-700-italic.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-700-normal.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-ext-100-italic.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-ext-100-normal.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-ext-200-italic.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-ext-200-normal.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-ext-300-italic.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-ext-300-normal.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-ext-400-italic.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-ext-400-normal.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-ext-500-italic.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-ext-500-normal.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-ext-600-italic.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-ext-600-normal.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-ext-700-italic.woff2 +0 -0
- package/assets/fonts/ibm-plex-mono-latin-ext-700-normal.woff2 +0 -0
- package/assets/fonts/inter-LICENSE.txt +93 -0
- package/assets/fonts/inter-latin-ext-wght-italic.woff2 +0 -0
- package/assets/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
- package/assets/fonts/inter-latin-wght-italic.woff2 +0 -0
- package/assets/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/assets/fonts/jetbrains-mono-LICENSE.txt +93 -0
- package/assets/fonts/jetbrains-mono-latin-ext-wght-italic.woff2 +0 -0
- package/assets/fonts/jetbrains-mono-latin-ext-wght-normal.woff2 +0 -0
- package/assets/fonts/jetbrains-mono-latin-wght-italic.woff2 +0 -0
- package/assets/fonts/jetbrains-mono-latin-wght-normal.woff2 +0 -0
- package/assets/fonts/lora-LICENSE.txt +93 -0
- package/assets/fonts/lora-latin-ext-wght-italic.woff2 +0 -0
- package/assets/fonts/lora-latin-ext-wght-normal.woff2 +0 -0
- package/assets/fonts/lora-latin-wght-italic.woff2 +0 -0
- package/assets/fonts/lora-latin-wght-normal.woff2 +0 -0
- package/assets/fonts/manifest.json +618 -0
- package/assets/fonts/manrope-LICENSE.txt +93 -0
- package/assets/fonts/manrope-latin-ext-wght-normal.woff2 +0 -0
- package/assets/fonts/manrope-latin-wght-normal.woff2 +0 -0
- package/assets/fonts/merriweather-LICENSE.txt +93 -0
- package/assets/fonts/merriweather-latin-ext-wght-italic.woff2 +0 -0
- package/assets/fonts/merriweather-latin-ext-wght-normal.woff2 +0 -0
- package/assets/fonts/merriweather-latin-wght-italic.woff2 +0 -0
- package/assets/fonts/merriweather-latin-wght-normal.woff2 +0 -0
- package/assets/fonts/montserrat-LICENSE.txt +93 -0
- package/assets/fonts/montserrat-latin-ext-wght-italic.woff2 +0 -0
- package/assets/fonts/montserrat-latin-ext-wght-normal.woff2 +0 -0
- package/assets/fonts/montserrat-latin-wght-italic.woff2 +0 -0
- package/assets/fonts/montserrat-latin-wght-normal.woff2 +0 -0
- package/assets/fonts/playfair-display-LICENSE.txt +93 -0
- package/assets/fonts/playfair-display-latin-ext-wght-italic.woff2 +0 -0
- package/assets/fonts/playfair-display-latin-ext-wght-normal.woff2 +0 -0
- package/assets/fonts/playfair-display-latin-wght-italic.woff2 +0 -0
- package/assets/fonts/playfair-display-latin-wght-normal.woff2 +0 -0
- package/assets/fonts/roboto-LICENSE.txt +93 -0
- package/assets/fonts/roboto-latin-ext-wght-italic.woff2 +0 -0
- package/assets/fonts/roboto-latin-ext-wght-normal.woff2 +0 -0
- package/assets/fonts/roboto-latin-wght-italic.woff2 +0 -0
- package/assets/fonts/roboto-latin-wght-normal.woff2 +0 -0
- package/assets/fonts/source-sans-3-LICENSE.txt +93 -0
- package/assets/fonts/source-sans-3-latin-ext-wght-italic.woff2 +0 -0
- package/assets/fonts/source-sans-3-latin-ext-wght-normal.woff2 +0 -0
- package/assets/fonts/source-sans-3-latin-wght-italic.woff2 +0 -0
- package/assets/fonts/source-sans-3-latin-wght-normal.woff2 +0 -0
- package/dist/advanced-types.d.ts +114 -0
- package/dist/app-layout.css +115 -0
- package/dist/app-layout.d.ts +2 -0
- package/dist/app-layout.js +1 -0
- package/dist/badge.css +131 -0
- package/dist/badge.d.ts +2 -0
- package/dist/badge.js +1 -0
- package/dist/bluui-community-grid.js +72 -0
- package/dist/bluui-community.js +1 -0
- package/dist/breadcrumbs.css +77 -0
- package/dist/breadcrumbs.d.ts +2 -0
- package/dist/breadcrumbs.js +1 -0
- package/dist/build-audit.json +388 -0
- package/dist/button.css +625 -0
- package/dist/button.d.ts +2 -0
- package/dist/button.js +1 -0
- package/dist/card.css +119 -0
- package/dist/card.d.ts +2 -0
- package/dist/card.js +1 -0
- package/dist/cascader.css +152 -0
- package/dist/cascader.d.ts +2 -0
- package/dist/cascader.js +1 -0
- package/dist/chat-widget.css +121 -0
- package/dist/chat-widget.d.ts +2 -0
- package/dist/chat-widget.js +1 -0
- package/dist/chat.css +66 -0
- package/dist/chat.d.ts +2 -0
- package/dist/chat.js +1 -0
- package/dist/chip-group.css +44 -0
- package/dist/chip-group.d.ts +2 -0
- package/dist/chip-group.js +1 -0
- package/dist/chip.css +191 -0
- package/dist/chip.d.ts +2 -0
- package/dist/chip.js +1 -0
- package/dist/chunk-2HFI6CC6.js +0 -0
- package/dist/chunk-2MQNFEGJ.js +1 -0
- package/dist/chunk-2TCNAQC6.js +1 -0
- package/dist/chunk-3LWXPCWY.js +1 -0
- package/dist/chunk-3ZS5YITP.js +1 -0
- package/dist/chunk-4RM3B4L7.js +1 -0
- package/dist/chunk-4USJBOSC.js +1 -0
- package/dist/chunk-5TEIXA4R.js +1 -0
- package/dist/chunk-64LOE3FU.js +1 -0
- package/dist/chunk-6EHKOVZK.js +1 -0
- package/dist/chunk-6EJIIQNF.js +1 -0
- package/dist/chunk-6XOMFIPU.js +1 -0
- package/dist/chunk-75BQYII5.js +1 -0
- package/dist/chunk-7HXX66DB.js +3 -0
- package/dist/chunk-7KMRDQZG.js +0 -0
- package/dist/chunk-AICXIQKD.js +1 -0
- package/dist/chunk-BLDXIO7P.js +1 -0
- package/dist/chunk-C3CLLZH2.js +1 -0
- package/dist/chunk-CTLZIWMX.js +1 -0
- package/dist/chunk-CZXYS6CY.js +1 -0
- package/dist/chunk-GEG3TNB4.js +1 -0
- package/dist/chunk-GK3INPAZ.js +1 -0
- package/dist/chunk-H5IEGCAK.js +72 -0
- package/dist/chunk-H7ETPJVW.js +1 -0
- package/dist/chunk-IHKCC6WJ.js +1 -0
- package/dist/chunk-IIKSMXQE.js +1 -0
- package/dist/chunk-J7BV4KHG.js +1 -0
- package/dist/chunk-K2P2BHV5.js +1 -0
- package/dist/chunk-KBOMPMSI.js +1 -0
- package/dist/chunk-KR3UUTB2.js +1 -0
- package/dist/chunk-LGJVLEAH.js +1 -0
- package/dist/chunk-LJ4O6YTN.js +1 -0
- package/dist/chunk-MBC4UVTS.js +1 -0
- package/dist/chunk-MCVO25PZ.js +1 -0
- package/dist/chunk-MEEQNPGM.js +1 -0
- package/dist/chunk-MHHJZYXW.js +1 -0
- package/dist/chunk-MSMNEIWA.js +0 -0
- package/dist/chunk-MZBB5ROJ.js +1 -0
- package/dist/chunk-NB5PGEDY.js +1 -0
- package/dist/chunk-NTFHNL7T.js +1 -0
- package/dist/chunk-O3MRWAI5.js +1 -0
- package/dist/chunk-RGTLYBOY.js +3 -0
- package/dist/chunk-RZ5YSY7Y.js +0 -0
- package/dist/chunk-SDMH2EVD.js +1 -0
- package/dist/chunk-SEJUHKS5.js +1 -0
- package/dist/chunk-SIU7DSOA.js +1 -0
- package/dist/chunk-T45UAWNI.js +3 -0
- package/dist/chunk-TIXCZTJ7.js +0 -0
- package/dist/chunk-U4ZP73V4.js +1 -0
- package/dist/chunk-U73BNLZ3.js +1 -0
- package/dist/chunk-UEOCR2C3.js +2 -0
- package/dist/chunk-UUZ4HU7L.js +0 -0
- package/dist/chunk-VBRSAI3K.js +1 -0
- package/dist/chunk-W27NAI62.js +1 -0
- package/dist/chunk-W4SW4RWX.js +1 -0
- package/dist/chunk-WHA6UO5X.js +1 -0
- package/dist/chunk-XDYBNO4P.js +1 -0
- package/dist/chunk-XIOI5PKM.js +1 -0
- package/dist/chunk-Y4TCT2K6.js +1 -0
- package/dist/chunk-Y4WEMSE4.js +0 -0
- package/dist/collection-layout.css +30 -0
- package/dist/collection-layout.d.ts +2 -0
- package/dist/collection-layout.js +1 -0
- package/dist/colors.d.ts +2 -0
- package/dist/command-palette.css +35 -0
- package/dist/command-palette.d.ts +2 -0
- package/dist/command-palette.js +1 -0
- package/dist/component-factories/app-layout.d.ts +2 -0
- package/dist/component-factories/breadcrumbs.d.ts +2 -0
- package/dist/component-factories/cascader.d.ts +2 -0
- package/dist/component-factories/chat-widget.d.ts +2 -0
- package/dist/component-factories/chat.d.ts +2 -0
- package/dist/component-factories/collection-layout.d.ts +2 -0
- package/dist/component-factories/command-palette.d.ts +2 -0
- package/dist/component-factories/content-carousel.d.ts +2 -0
- package/dist/component-factories/dashboard-canvas.d.ts +3 -0
- package/dist/component-factories/dashboard-panel.d.ts +3 -0
- package/dist/component-factories/date-picker.d.ts +2 -0
- package/dist/component-factories/date-range-picker.d.ts +2 -0
- package/dist/component-factories/date-time-picker.d.ts +2 -0
- package/dist/component-factories/descriptions.d.ts +2 -0
- package/dist/component-factories/drawer.d.ts +2 -0
- package/dist/component-factories/float-button.d.ts +2 -0
- package/dist/component-factories/font-provider.d.ts +2 -0
- package/dist/component-factories/hero-section.d.ts +2 -0
- package/dist/component-factories/image-compare.d.ts +2 -0
- package/dist/component-factories/logo-cloud.d.ts +2 -0
- package/dist/component-factories/media-card.d.ts +2 -0
- package/dist/component-factories/media-image.d.ts +2 -0
- package/dist/component-factories/modal.d.ts +2 -0
- package/dist/component-factories/notification-center.d.ts +3 -0
- package/dist/component-factories/notification.d.ts +5 -0
- package/dist/component-factories/page-header.d.ts +2 -0
- package/dist/component-factories/page-layout.d.ts +2 -0
- package/dist/component-factories/pagination.d.ts +2 -0
- package/dist/component-factories/profile-card.d.ts +2 -0
- package/dist/component-factories/qr-code.d.ts +2 -0
- package/dist/component-factories/quote-card.d.ts +2 -0
- package/dist/component-factories/shape-mask.d.ts +2 -0
- package/dist/component-factories/sidebar.d.ts +2 -0
- package/dist/component-factories/sparkline.d.ts +2 -0
- package/dist/component-factories/split-section.d.ts +2 -0
- package/dist/component-factories/splitter.d.ts +2 -0
- package/dist/component-factories/statistic.d.ts +2 -0
- package/dist/component-factories/text-highlight.d.ts +2 -0
- package/dist/component-factories/time-picker.d.ts +2 -0
- package/dist/component-factories/timeline.d.ts +2 -0
- package/dist/component-factories/tour.d.ts +2 -0
- package/dist/component-factories/transfer-list.d.ts +2 -0
- package/dist/component-factories/tree-select.d.ts +2 -0
- package/dist/component-factories/tree-view.d.ts +2 -0
- package/dist/component-factories/upload-manager.d.ts +2 -0
- package/dist/component-factories/video-lightbox.d.ts +2 -0
- package/dist/component-factories/video-player.d.ts +2 -0
- package/dist/component-runtime.d.ts +2 -0
- package/dist/content-carousel.css +34 -0
- package/dist/content-carousel.d.ts +2 -0
- package/dist/content-carousel.js +1 -0
- package/dist/content.css +2085 -0
- package/dist/content.d.ts +13 -0
- package/dist/content.js +1 -0
- package/dist/core.css +1070 -0
- package/dist/core.d.ts +6 -0
- package/dist/core.js +1 -0
- package/dist/dashboard-canvas.css +49 -0
- package/dist/dashboard-canvas.d.ts +2 -0
- package/dist/dashboard-canvas.js +1 -0
- package/dist/dashboard-panel.css +2 -0
- package/dist/dashboard-panel.d.ts +2 -0
- package/dist/dashboard-panel.js +1 -0
- package/dist/data.css +813 -0
- package/dist/data.d.ts +9 -0
- package/dist/data.js +1 -0
- package/dist/date-picker.css +78 -0
- package/dist/date-picker.d.ts +2 -0
- package/dist/date-picker.js +1 -0
- package/dist/date-range-picker.css +78 -0
- package/dist/date-range-picker.d.ts +2 -0
- package/dist/date-range-picker.js +1 -0
- package/dist/date-time-picker.css +78 -0
- package/dist/date-time-picker.d.ts +2 -0
- package/dist/date-time-picker.js +1 -0
- package/dist/descriptions.css +113 -0
- package/dist/descriptions.d.ts +2 -0
- package/dist/descriptions.js +1 -0
- package/dist/dom.d.ts +7 -0
- package/dist/drawer.css +215 -0
- package/dist/drawer.d.ts +2 -0
- package/dist/drawer.js +1 -0
- package/dist/empty-state.css +110 -0
- package/dist/empty-state.d.ts +2 -0
- package/dist/empty-state.js +1 -0
- package/dist/essentials.css +1295 -0
- package/dist/essentials.d.ts +11 -0
- package/dist/essentials.js +1 -0
- package/dist/feedback.css +1136 -0
- package/dist/feedback.d.ts +10 -0
- package/dist/feedback.js +1 -0
- package/dist/float-button.css +28 -0
- package/dist/float-button.d.ts +2 -0
- package/dist/float-button.js +1 -0
- package/dist/font-provider.css +5 -0
- package/dist/font-provider.d.ts +2 -0
- package/dist/font-provider.js +1 -0
- package/dist/fonts/dm-sans-LICENSE.txt +93 -0
- package/dist/fonts/dm-sans-latin-ext-wght-italic.woff2 +0 -0
- package/dist/fonts/dm-sans-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/dm-sans-latin-wght-italic.woff2 +0 -0
- package/dist/fonts/dm-sans-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-LICENSE.txt +93 -0
- package/dist/fonts/ibm-plex-mono-latin-100-italic.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-100-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-200-italic.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-200-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-300-italic.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-300-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-400-italic.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-400-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-500-italic.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-500-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-600-italic.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-600-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-700-italic.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-700-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-100-italic.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-100-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-200-italic.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-200-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-300-italic.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-300-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-400-italic.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-400-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-500-italic.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-500-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-600-italic.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-600-normal.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-700-italic.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-700-normal.woff2 +0 -0
- package/dist/fonts/inter-LICENSE.txt +93 -0
- package/dist/fonts/inter-latin-ext-wght-italic.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-wght-italic.woff2 +0 -0
- package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-LICENSE.txt +93 -0
- package/dist/fonts/jetbrains-mono-latin-ext-wght-italic.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-latin-wght-italic.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/lora-LICENSE.txt +93 -0
- package/dist/fonts/lora-latin-ext-wght-italic.woff2 +0 -0
- package/dist/fonts/lora-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/lora-latin-wght-italic.woff2 +0 -0
- package/dist/fonts/lora-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/manifest.json +618 -0
- package/dist/fonts/manrope-LICENSE.txt +93 -0
- package/dist/fonts/manrope-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/manrope-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/merriweather-LICENSE.txt +93 -0
- package/dist/fonts/merriweather-latin-ext-wght-italic.woff2 +0 -0
- package/dist/fonts/merriweather-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/merriweather-latin-wght-italic.woff2 +0 -0
- package/dist/fonts/merriweather-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/montserrat-LICENSE.txt +93 -0
- package/dist/fonts/montserrat-latin-ext-wght-italic.woff2 +0 -0
- package/dist/fonts/montserrat-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/montserrat-latin-wght-italic.woff2 +0 -0
- package/dist/fonts/montserrat-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/playfair-display-LICENSE.txt +93 -0
- package/dist/fonts/playfair-display-latin-ext-wght-italic.woff2 +0 -0
- package/dist/fonts/playfair-display-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/playfair-display-latin-wght-italic.woff2 +0 -0
- package/dist/fonts/playfair-display-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/roboto-LICENSE.txt +93 -0
- package/dist/fonts/roboto-latin-ext-wght-italic.woff2 +0 -0
- package/dist/fonts/roboto-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/roboto-latin-wght-italic.woff2 +0 -0
- package/dist/fonts/roboto-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/source-sans-3-LICENSE.txt +93 -0
- package/dist/fonts/source-sans-3-latin-ext-wght-italic.woff2 +0 -0
- package/dist/fonts/source-sans-3-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/source-sans-3-latin-wght-italic.woff2 +0 -0
- package/dist/fonts/source-sans-3-latin-wght-normal.woff2 +0 -0
- package/dist/grid-basic.css +12 -0
- package/dist/grid-basic.d.ts +10 -0
- package/dist/grid-basic.js +1 -0
- package/dist/grid-spec.d.ts +37 -0
- package/dist/grid.css +12 -0
- package/dist/grid.d.ts +1 -0
- package/dist/grid.js +1 -0
- package/dist/hero-section.css +41 -0
- package/dist/hero-section.d.ts +2 -0
- package/dist/hero-section.js +1 -0
- package/dist/image-compare.css +35 -0
- package/dist/image-compare.d.ts +2 -0
- package/dist/image-compare.js +1 -0
- package/dist/index.d.ts +56 -0
- package/dist/index.js +1 -0
- package/dist/inputs.css +1524 -0
- package/dist/inputs.d.ts +8 -0
- package/dist/inputs.js +1 -0
- package/dist/layout.css +844 -0
- package/dist/layout.d.ts +8 -0
- package/dist/layout.js +1 -0
- package/dist/logo-cloud.css +33 -0
- package/dist/logo-cloud.d.ts +2 -0
- package/dist/logo-cloud.js +1 -0
- package/dist/marketing-template-layout.css +30 -0
- package/dist/media-card.css +41 -0
- package/dist/media-card.d.ts +2 -0
- package/dist/media-card.js +1 -0
- package/dist/media-image.css +531 -0
- package/dist/media-image.d.ts +2 -0
- package/dist/media-image.js +1 -0
- package/dist/modal.css +210 -0
- package/dist/modal.d.ts +2 -0
- package/dist/modal.js +1 -0
- package/dist/native/app-layout.js +1 -0
- package/dist/native/cascader.js +1 -0
- package/dist/native/chat-widget.js +3 -0
- package/dist/native/chat.js +3 -0
- package/dist/native/collection-layout.js +1 -0
- package/dist/native/command-palette.js +1 -0
- package/dist/native/content-carousel.js +1 -0
- package/dist/native/dashboard-canvas.js +1 -0
- package/dist/native/date-picker.js +1 -0
- package/dist/native/date-range-picker.js +1 -0
- package/dist/native/date-time-picker.js +1 -0
- package/dist/native/descriptions.js +1 -0
- package/dist/native/drawer.js +1 -0
- package/dist/native/float-button.js +1 -0
- package/dist/native/font-provider.js +1 -0
- package/dist/native/hero-section.js +1 -0
- package/dist/native/image-compare.js +1 -0
- package/dist/native/logo-cloud.js +1 -0
- package/dist/native/media-card.js +1 -0
- package/dist/native/media-image.js +1 -0
- package/dist/native/modal.js +1 -0
- package/dist/native/notification-center.js +1 -0
- package/dist/native/notification.js +2 -0
- package/dist/native/page-layout.js +1 -0
- package/dist/native/pagination.js +1 -0
- package/dist/native/profile-card.js +1 -0
- package/dist/native/qr-code.js +3 -0
- package/dist/native/quote-card.js +1 -0
- package/dist/native/shape-mask.js +1 -0
- package/dist/native/sparkline.js +1 -0
- package/dist/native/split-section.js +1 -0
- package/dist/native/splitter.js +1 -0
- package/dist/native/statistic.js +1 -0
- package/dist/native/text-highlight.js +1 -0
- package/dist/native/time-picker.js +1 -0
- package/dist/native/timeline.js +1 -0
- package/dist/native/tour.js +1 -0
- package/dist/native/transfer-list.js +1 -0
- package/dist/native/tree-select.js +1 -0
- package/dist/native/tree-view.js +1 -0
- package/dist/native/upload-manager.js +1 -0
- package/dist/native/video-lightbox.js +1 -0
- package/dist/native/video-player.js +1 -0
- package/dist/native-base.d.ts +1 -0
- package/dist/native-components/app-layout.d.ts +1 -0
- package/dist/native-components/cascader.d.ts +1 -0
- package/dist/native-components/chat-widget.d.ts +1 -0
- package/dist/native-components/chat.d.ts +1 -0
- package/dist/native-components/collection-layout.d.ts +1 -0
- package/dist/native-components/command-palette.d.ts +1 -0
- package/dist/native-components/content-carousel.d.ts +1 -0
- package/dist/native-components/dashboard-canvas.d.ts +1 -0
- package/dist/native-components/date-picker.d.ts +1 -0
- package/dist/native-components/date-range-picker.d.ts +1 -0
- package/dist/native-components/date-time-picker.d.ts +1 -0
- package/dist/native-components/descriptions.d.ts +1 -0
- package/dist/native-components/drawer.d.ts +1 -0
- package/dist/native-components/float-button.d.ts +1 -0
- package/dist/native-components/font-provider.d.ts +1 -0
- package/dist/native-components/hero-section.d.ts +1 -0
- package/dist/native-components/image-compare.d.ts +1 -0
- package/dist/native-components/logo-cloud.d.ts +1 -0
- package/dist/native-components/media-card.d.ts +1 -0
- package/dist/native-components/media-image.d.ts +1 -0
- package/dist/native-components/modal.d.ts +1 -0
- package/dist/native-components/notification-center.d.ts +1 -0
- package/dist/native-components/notification.d.ts +1 -0
- package/dist/native-components/page-layout.d.ts +1 -0
- package/dist/native-components/pagination.d.ts +1 -0
- package/dist/native-components/profile-card.d.ts +1 -0
- package/dist/native-components/qr-code.d.ts +1 -0
- package/dist/native-components/quote-card.d.ts +1 -0
- package/dist/native-components/shape-mask.d.ts +1 -0
- package/dist/native-components/sparkline.d.ts +1 -0
- package/dist/native-components/split-section.d.ts +1 -0
- package/dist/native-components/splitter.d.ts +1 -0
- package/dist/native-components/statistic.d.ts +1 -0
- package/dist/native-components/text-highlight.d.ts +1 -0
- package/dist/native-components/time-picker.d.ts +1 -0
- package/dist/native-components/timeline.d.ts +1 -0
- package/dist/native-components/tour.d.ts +1 -0
- package/dist/native-components/transfer-list.d.ts +1 -0
- package/dist/native-components/tree-select.d.ts +1 -0
- package/dist/native-components/tree-view.d.ts +1 -0
- package/dist/native-components/upload-manager.d.ts +1 -0
- package/dist/native-components/video-lightbox.d.ts +1 -0
- package/dist/native-components/video-player.d.ts +1 -0
- package/dist/native-grid.d.ts +1 -0
- package/dist/native.d.ts +1 -0
- package/dist/notification-center.css +49 -0
- package/dist/notification-center.d.ts +2 -0
- package/dist/notification-center.js +1 -0
- package/dist/notification.css +155 -0
- package/dist/notification.d.ts +2 -0
- package/dist/notification.js +1 -0
- package/dist/page-header.css +184 -0
- package/dist/page-header.d.ts +2 -0
- package/dist/page-header.js +1 -0
- package/dist/page-layout.css +117 -0
- package/dist/page-layout.d.ts +2 -0
- package/dist/page-layout.js +1 -0
- package/dist/pagination.css +127 -0
- package/dist/pagination.d.ts +2 -0
- package/dist/pagination.js +1 -0
- package/dist/primitives.d.ts +1 -0
- package/dist/profile-card.css +484 -0
- package/dist/profile-card.d.ts +2 -0
- package/dist/profile-card.js +1 -0
- package/dist/qr-code.css +125 -0
- package/dist/qr-code.d.ts +2 -0
- package/dist/qr-code.js +1 -0
- package/dist/quote-card.css +30 -0
- package/dist/quote-card.d.ts +2 -0
- package/dist/quote-card.js +1 -0
- package/dist/shape-mask.css +10 -0
- package/dist/shape-mask.d.ts +2 -0
- package/dist/shape-mask.js +1 -0
- package/dist/sidebar.css +183 -0
- package/dist/sidebar.d.ts +2 -0
- package/dist/sidebar.js +1 -0
- package/dist/sizes.json +1012 -0
- package/dist/skeleton.css +69 -0
- package/dist/skeleton.d.ts +2 -0
- package/dist/skeleton.js +1 -0
- package/dist/sparkline.css +38 -0
- package/dist/sparkline.d.ts +2 -0
- package/dist/sparkline.js +1 -0
- package/dist/split-section.css +34 -0
- package/dist/split-section.d.ts +2 -0
- package/dist/split-section.js +1 -0
- package/dist/splitter.css +32 -0
- package/dist/splitter.d.ts +2 -0
- package/dist/splitter.js +1 -0
- package/dist/statistic.css +107 -0
- package/dist/statistic.d.ts +2 -0
- package/dist/statistic.js +1 -0
- package/dist/styles.css +8882 -0
- package/dist/text-highlight.css +49 -0
- package/dist/text-highlight.d.ts +2 -0
- package/dist/text-highlight.js +1 -0
- package/dist/theme-runtime.d.ts +1 -0
- package/dist/theme.css +1391 -0
- package/dist/theme.d.ts +10 -0
- package/dist/theme.js +1 -0
- package/dist/time-picker.css +78 -0
- package/dist/time-picker.d.ts +2 -0
- package/dist/time-picker.js +1 -0
- package/dist/timeline.css +126 -0
- package/dist/timeline.d.ts +2 -0
- package/dist/timeline.js +1 -0
- package/dist/tour.css +138 -0
- package/dist/tour.d.ts +2 -0
- package/dist/tour.js +1 -0
- package/dist/transfer-list.css +878 -0
- package/dist/transfer-list.d.ts +2 -0
- package/dist/transfer-list.js +1 -0
- package/dist/tree-select.css +135 -0
- package/dist/tree-select.d.ts +2 -0
- package/dist/tree-select.js +1 -0
- package/dist/tree-view.css +118 -0
- package/dist/tree-view.d.ts +2 -0
- package/dist/tree-view.js +1 -0
- package/dist/types.d.ts +1284 -0
- package/dist/upload-manager.css +40 -0
- package/dist/upload-manager.d.ts +2 -0
- package/dist/upload-manager.js +1 -0
- package/dist/video-lightbox.css +639 -0
- package/dist/video-lightbox.d.ts +2 -0
- package/dist/video-lightbox.js +1 -0
- package/dist/video-player.css +92 -0
- package/dist/video-player.d.ts +2 -0
- package/dist/video-player.js +1 -0
- package/docs/PUBLISHING.md +25 -0
- package/edition.json +245 -0
- package/npm-shrinkwrap.json +554 -0
- package/package.json +391 -4
- package/scripts/build.mjs +34 -0
- package/scripts/verify-package.mjs +136 -0
- package/src/advanced-types.ts +89 -0
- package/src/app-layout.ts +2 -0
- package/src/badge.ts +2 -0
- package/src/breadcrumbs.ts +2 -0
- package/src/button.ts +2 -0
- package/src/card.ts +2 -0
- package/src/cascader.ts +2 -0
- package/src/chat-widget.ts +2 -0
- package/src/chat.ts +2 -0
- package/src/chip-group.ts +2 -0
- package/src/chip.ts +2 -0
- package/src/collection-layout.ts +2 -0
- package/src/colors.ts +3 -0
- package/src/command-palette.ts +2 -0
- package/src/component-factories/app-layout.ts +8 -0
- package/src/component-factories/breadcrumbs.ts +45 -0
- package/src/component-factories/cascader.ts +11 -0
- package/src/component-factories/chat-widget.ts +12 -0
- package/src/component-factories/chat.ts +10 -0
- package/src/component-factories/collection-layout.ts +5 -0
- package/src/component-factories/command-palette.ts +79 -0
- package/src/component-factories/content-carousel.ts +5 -0
- package/src/component-factories/dashboard-canvas.ts +11 -0
- package/src/component-factories/dashboard-panel.ts +9 -0
- package/src/component-factories/date-picker.ts +6 -0
- package/src/component-factories/date-range-picker.ts +6 -0
- package/src/component-factories/date-time-picker.ts +6 -0
- package/src/component-factories/descriptions.ts +11 -0
- package/src/component-factories/drawer.ts +12 -0
- package/src/component-factories/float-button.ts +7 -0
- package/src/component-factories/font-provider.ts +6 -0
- package/src/component-factories/hero-section.ts +5 -0
- package/src/component-factories/image-compare.ts +5 -0
- package/src/component-factories/logo-cloud.ts +5 -0
- package/src/component-factories/media-card.ts +5 -0
- package/src/component-factories/media-image.ts +5 -0
- package/src/component-factories/modal.ts +12 -0
- package/src/component-factories/notification-center.ts +13 -0
- package/src/component-factories/notification.ts +16 -0
- package/src/component-factories/page-header.ts +73 -0
- package/src/component-factories/page-layout.ts +8 -0
- package/src/component-factories/pagination.ts +11 -0
- package/src/component-factories/profile-card.ts +5 -0
- package/src/component-factories/qr-code.ts +11 -0
- package/src/component-factories/quote-card.ts +5 -0
- package/src/component-factories/shape-mask.ts +6 -0
- package/src/component-factories/sidebar.ts +98 -0
- package/src/component-factories/sparkline.ts +8 -0
- package/src/component-factories/split-section.ts +5 -0
- package/src/component-factories/splitter.ts +105 -0
- package/src/component-factories/statistic.ts +10 -0
- package/src/component-factories/text-highlight.ts +5 -0
- package/src/component-factories/time-picker.ts +6 -0
- package/src/component-factories/timeline.ts +11 -0
- package/src/component-factories/tour.ts +13 -0
- package/src/component-factories/transfer-list.ts +159 -0
- package/src/component-factories/tree-select.ts +83 -0
- package/src/component-factories/tree-view.ts +115 -0
- package/src/component-factories/upload-manager.ts +76 -0
- package/src/component-factories/video-lightbox.ts +5 -0
- package/src/component-factories/video-player.ts +5 -0
- package/src/component-runtime.ts +20 -0
- package/src/content-carousel.ts +2 -0
- package/src/content.ts +13 -0
- package/src/core.ts +6 -0
- package/src/dashboard-canvas.ts +2 -0
- package/src/dashboard-panel.ts +2 -0
- package/src/data.ts +9 -0
- package/src/date-picker.ts +2 -0
- package/src/date-range-picker.ts +2 -0
- package/src/date-time-picker.ts +2 -0
- package/src/descriptions.ts +2 -0
- package/src/dom.ts +65 -0
- package/src/drawer.ts +2 -0
- package/src/empty-state.ts +2 -0
- package/src/essentials.ts +180 -0
- package/src/feedback.ts +10 -0
- package/src/float-button.ts +2 -0
- package/src/font-provider.ts +2 -0
- package/src/grid-basic.ts +46 -0
- package/src/grid-spec.ts +93 -0
- package/src/grid.ts +1 -0
- package/src/hero-section.ts +2 -0
- package/src/image-compare.ts +2 -0
- package/src/index.ts +56 -0
- package/src/inputs.ts +8 -0
- package/src/layout.ts +8 -0
- package/src/logo-cloud.ts +2 -0
- package/src/media-card.ts +2 -0
- package/src/media-image.ts +2 -0
- package/src/modal.ts +2 -0
- package/src/native-base.ts +20 -0
- package/src/native-components/app-layout.ts +2 -0
- package/src/native-components/cascader.ts +2 -0
- package/src/native-components/chat-widget.ts +2 -0
- package/src/native-components/chat.ts +2 -0
- package/src/native-components/collection-layout.ts +2 -0
- package/src/native-components/command-palette.ts +2 -0
- package/src/native-components/content-carousel.ts +2 -0
- package/src/native-components/dashboard-canvas.ts +2 -0
- package/src/native-components/date-picker.ts +2 -0
- package/src/native-components/date-range-picker.ts +2 -0
- package/src/native-components/date-time-picker.ts +2 -0
- package/src/native-components/descriptions.ts +2 -0
- package/src/native-components/drawer.ts +2 -0
- package/src/native-components/float-button.ts +2 -0
- package/src/native-components/font-provider.ts +2 -0
- package/src/native-components/hero-section.ts +2 -0
- package/src/native-components/image-compare.ts +2 -0
- package/src/native-components/logo-cloud.ts +2 -0
- package/src/native-components/media-card.ts +2 -0
- package/src/native-components/media-image.ts +2 -0
- package/src/native-components/modal.ts +2 -0
- package/src/native-components/notification-center.ts +2 -0
- package/src/native-components/notification.ts +2 -0
- package/src/native-components/page-layout.ts +2 -0
- package/src/native-components/pagination.ts +2 -0
- package/src/native-components/profile-card.ts +2 -0
- package/src/native-components/qr-code.ts +2 -0
- package/src/native-components/quote-card.ts +2 -0
- package/src/native-components/shape-mask.ts +2 -0
- package/src/native-components/sparkline.ts +2 -0
- package/src/native-components/split-section.ts +2 -0
- package/src/native-components/splitter.ts +2 -0
- package/src/native-components/statistic.ts +2 -0
- package/src/native-components/text-highlight.ts +2 -0
- package/src/native-components/time-picker.ts +2 -0
- package/src/native-components/timeline.ts +2 -0
- package/src/native-components/tour.ts +2 -0
- package/src/native-components/transfer-list.ts +2 -0
- package/src/native-components/tree-select.ts +2 -0
- package/src/native-components/tree-view.ts +2 -0
- package/src/native-components/upload-manager.ts +2 -0
- package/src/native-components/video-lightbox.ts +2 -0
- package/src/native-components/video-player.ts +2 -0
- package/src/native-grid.ts +3 -0
- package/src/native.ts +3 -0
- package/src/notification-center.ts +2 -0
- package/src/notification.ts +2 -0
- package/src/page-header.ts +2 -0
- package/src/page-layout.ts +2 -0
- package/src/pagination.ts +2 -0
- package/src/primitives.ts +1 -0
- package/src/profile-card.ts +2 -0
- package/src/qr-code.ts +2 -0
- package/src/quote-card.ts +2 -0
- package/src/runtime/app-layout.d.ts +1 -0
- package/src/runtime/app-layout.js +168 -0
- package/src/runtime/cascader.d.ts +1 -0
- package/src/runtime/cascader.js +381 -0
- package/src/runtime/chat-widget.d.ts +1 -0
- package/src/runtime/chat-widget.js +630 -0
- package/src/runtime/chat.d.ts +1 -0
- package/src/runtime/chat.js +461 -0
- package/src/runtime/collection-layout.d.ts +1 -0
- package/src/runtime/collection-layout.js +269 -0
- package/src/runtime/command-palette.d.ts +1 -0
- package/src/runtime/command-palette.js +302 -0
- package/src/runtime/content-carousel.d.ts +1 -0
- package/src/runtime/content-carousel.js +282 -0
- package/src/runtime/dashboard-canvas.d.ts +1 -0
- package/src/runtime/dashboard-canvas.js +493 -0
- package/src/runtime/date-picker.d.ts +1 -0
- package/src/runtime/date-picker.js +817 -0
- package/src/runtime/date-range-picker.d.ts +1 -0
- package/src/runtime/date-range-picker.js +817 -0
- package/src/runtime/date-time-picker.d.ts +1 -0
- package/src/runtime/date-time-picker.js +817 -0
- package/src/runtime/descriptions.d.ts +1 -0
- package/src/runtime/descriptions.js +220 -0
- package/src/runtime/drawer.d.ts +1 -0
- package/src/runtime/drawer.js +287 -0
- package/src/runtime/empty-state.d.ts +1 -0
- package/src/runtime/empty-state.js +178 -0
- package/src/runtime/float-button.d.ts +1 -0
- package/src/runtime/float-button.js +171 -0
- package/src/runtime/font-provider.d.ts +1 -0
- package/src/runtime/font-provider.js +694 -0
- package/src/runtime/hero-section.d.ts +1 -0
- package/src/runtime/hero-section.js +186 -0
- package/src/runtime/image-compare.d.ts +1 -0
- package/src/runtime/image-compare.js +242 -0
- package/src/runtime/kernel.js +8 -0
- package/src/runtime/logo-cloud.d.ts +1 -0
- package/src/runtime/logo-cloud.js +163 -0
- package/src/runtime/media-card.d.ts +1 -0
- package/src/runtime/media-card.js +189 -0
- package/src/runtime/media-image.d.ts +1 -0
- package/src/runtime/media-image.js +480 -0
- package/src/runtime/modal.d.ts +1 -0
- package/src/runtime/modal.js +287 -0
- package/src/runtime/notification-center.d.ts +1 -0
- package/src/runtime/notification-center.js +417 -0
- package/src/runtime/notification.d.ts +1 -0
- package/src/runtime/notification.js +347 -0
- package/src/runtime/page-layout.d.ts +1 -0
- package/src/runtime/page-layout.js +105 -0
- package/src/runtime/pagination.d.ts +1 -0
- package/src/runtime/pagination.js +274 -0
- package/src/runtime/profile-card.d.ts +1 -0
- package/src/runtime/profile-card.js +512 -0
- package/src/runtime/qr-code.d.ts +1 -0
- package/src/runtime/qr-code.js +1942 -0
- package/src/runtime/quote-card.d.ts +1 -0
- package/src/runtime/quote-card.js +153 -0
- package/src/runtime/shape-mask.d.ts +1 -0
- package/src/runtime/shape-mask.js +211 -0
- package/src/runtime/sparkline.d.ts +1 -0
- package/src/runtime/sparkline.js +197 -0
- package/src/runtime/split-section.d.ts +1 -0
- package/src/runtime/split-section.js +148 -0
- package/src/runtime/splitter.d.ts +1 -0
- package/src/runtime/splitter.js +278 -0
- package/src/runtime/statistic.d.ts +1 -0
- package/src/runtime/statistic.js +204 -0
- package/src/runtime/text-highlight.d.ts +1 -0
- package/src/runtime/text-highlight.js +194 -0
- package/src/runtime/time-picker.d.ts +1 -0
- package/src/runtime/time-picker.js +817 -0
- package/src/runtime/timeline.d.ts +1 -0
- package/src/runtime/timeline.js +213 -0
- package/src/runtime/tour.d.ts +1 -0
- package/src/runtime/tour.js +412 -0
- package/src/runtime/transfer.d.ts +1 -0
- package/src/runtime/transfer.js +88 -0
- package/src/runtime/tree-select.d.ts +1 -0
- package/src/runtime/tree-select.js +420 -0
- package/src/runtime/tree.d.ts +1 -0
- package/src/runtime/tree.js +302 -0
- package/src/runtime/upload-manager.d.ts +1 -0
- package/src/runtime/upload-manager.js +408 -0
- package/src/runtime/video-lightbox.d.ts +1 -0
- package/src/runtime/video-lightbox.js +1117 -0
- package/src/runtime/video-player.d.ts +1 -0
- package/src/runtime/video-player.js +770 -0
- package/src/shape-mask.ts +2 -0
- package/src/sidebar.ts +2 -0
- package/src/skeleton.ts +2 -0
- package/src/sparkline.ts +2 -0
- package/src/split-section.ts +2 -0
- package/src/splitter.ts +2 -0
- package/src/statistic.ts +2 -0
- package/src/text-highlight.ts +2 -0
- package/src/theme-runtime.ts +70 -0
- package/src/theme.ts +32 -0
- package/src/time-picker.ts +2 -0
- package/src/timeline.ts +2 -0
- package/src/tour.ts +2 -0
- package/src/transfer-list.ts +2 -0
- package/src/tree-select.ts +2 -0
- package/src/tree-view.ts +2 -0
- package/src/types.ts +1299 -0
- package/src/upload-manager.ts +2 -0
- package/src/video-lightbox.ts +2 -0
- package/src/video-player.ts +2 -0
- package/styles/app-layout.css +115 -0
- package/styles/badge.css +131 -0
- package/styles/breadcrumbs.css +77 -0
- package/styles/button.css +625 -0
- package/styles/card.css +119 -0
- package/styles/cascader.css +152 -0
- package/styles/chat-widget.css +121 -0
- package/styles/chat.css +66 -0
- package/styles/chip-group.css +44 -0
- package/styles/chip.css +191 -0
- package/styles/collection-layout.css +30 -0
- package/styles/command-palette.css +35 -0
- package/styles/content-carousel.css +34 -0
- package/styles/dashboard-canvas.css +49 -0
- package/styles/dashboard-panel.css +2 -0
- package/styles/date-picker.css +78 -0
- package/styles/date-range-picker.css +78 -0
- package/styles/date-time-picker.css +78 -0
- package/styles/descriptions.css +113 -0
- package/styles/drawer.css +215 -0
- package/styles/empty-state.css +110 -0
- package/styles/float-button.css +28 -0
- package/styles/font-provider.css +5 -0
- package/styles/grid-basic.css +12 -0
- package/styles/hero-section.css +41 -0
- package/styles/image-compare.css +35 -0
- package/styles/logo-cloud.css +33 -0
- package/styles/marketing-template-layout.css +30 -0
- package/styles/media-card.css +41 -0
- package/styles/media-image.css +531 -0
- package/styles/modal.css +210 -0
- package/styles/notification-center.css +49 -0
- package/styles/notification.css +155 -0
- package/styles/page-header.css +184 -0
- package/styles/page-layout.css +117 -0
- package/styles/pagination.css +127 -0
- package/styles/profile-card.css +484 -0
- package/styles/qr-code.css +125 -0
- package/styles/quote-card.css +30 -0
- package/styles/shape-mask.css +10 -0
- package/styles/sidebar.css +183 -0
- package/styles/skeleton.css +69 -0
- package/styles/sparkline.css +38 -0
- package/styles/split-section.css +34 -0
- package/styles/splitter.css +32 -0
- package/styles/statistic.css +107 -0
- package/styles/text-highlight.css +49 -0
- package/styles/theme.css +1391 -0
- package/styles/time-picker.css +78 -0
- package/styles/timeline.css +126 -0
- package/styles/tour.css +138 -0
- package/styles/transfer-list.css +878 -0
- package/styles/tree-select.css +135 -0
- package/styles/tree-view.css +118 -0
- package/styles/upload-manager.css +40 -0
- package/styles/video-lightbox.css +639 -0
- package/styles/video-player.css +92 -0
- package/test/contracts.test.mjs +8 -0
- package/test/isolation.test.mjs +36 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,817 @@
|
|
|
1
|
+
// ../blu-grid/docs/scripts/advanced/shared.js
|
|
2
|
+
import { state, register } from "./kernel.js";
|
|
3
|
+
var shared = state("advanced", () => ({ instances: /* @__PURE__ */ new Map(), serial: 0 }));
|
|
4
|
+
var uid = () => `blu-advanced-${++shared.serial}`;
|
|
5
|
+
function node(tag, cls, text) {
|
|
6
|
+
const el = document.createElement(tag);
|
|
7
|
+
if (cls) el.className = cls;
|
|
8
|
+
if (text !== void 0) el.textContent = String(text);
|
|
9
|
+
return el;
|
|
10
|
+
}
|
|
11
|
+
function attr(el, name, value) {
|
|
12
|
+
if (value === null || value === void 0) el.removeAttribute(name);
|
|
13
|
+
else el.setAttribute(name, String(value));
|
|
14
|
+
return el;
|
|
15
|
+
}
|
|
16
|
+
function button(text, action, cls = "blu-picker__button") {
|
|
17
|
+
const el = node("button", cls, text);
|
|
18
|
+
el.type = "button";
|
|
19
|
+
el.addEventListener("click", action);
|
|
20
|
+
return el;
|
|
21
|
+
}
|
|
22
|
+
function emit(s, name, ...args) {
|
|
23
|
+
if (s.dead) return;
|
|
24
|
+
try {
|
|
25
|
+
Promise.resolve(s.events[name]?.(...args)).catch((e) => report(s, e));
|
|
26
|
+
} catch (e) {
|
|
27
|
+
report(s, e);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function report(s, error) {
|
|
31
|
+
if (s.dead) return;
|
|
32
|
+
const message = error?.message || String(error);
|
|
33
|
+
s.notice.textContent = message;
|
|
34
|
+
if (s.lastError !== message) {
|
|
35
|
+
s.lastError = message;
|
|
36
|
+
emit(s, "Error", message);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function list(value, name) {
|
|
40
|
+
const items = typeof value === "string" ? JSON.parse(value || "[]") : value || [];
|
|
41
|
+
if (!Array.isArray(items)) throw Error(name + " must be a list.");
|
|
42
|
+
return items;
|
|
43
|
+
}
|
|
44
|
+
function createAPI(kind, init2, update2) {
|
|
45
|
+
const destroy = (key) => {
|
|
46
|
+
const s = shared.instances.get(key);
|
|
47
|
+
if (!s || s.kind !== kind) return;
|
|
48
|
+
s.dead = true;
|
|
49
|
+
s.dispose?.();
|
|
50
|
+
s.root.remove();
|
|
51
|
+
s.notice.remove();
|
|
52
|
+
if (s.host._bluAdvancedOwner === key) delete s.host._bluAdvancedOwner;
|
|
53
|
+
shared.instances.delete(key);
|
|
54
|
+
};
|
|
55
|
+
return register(kind, () => ({ sync(id, options = {}, events = {}, owner) {
|
|
56
|
+
const host = document.getElementById(id);
|
|
57
|
+
if (!host) return kind + " host was not found.";
|
|
58
|
+
const key = owner || id;
|
|
59
|
+
let s = shared.instances.get(key);
|
|
60
|
+
if (s && (s.host !== host || s.kind !== kind)) {
|
|
61
|
+
s.destroy(s.key);
|
|
62
|
+
s = null;
|
|
63
|
+
}
|
|
64
|
+
const previous = shared.instances.get(host._bluAdvancedOwner);
|
|
65
|
+
if (previous && previous !== s) previous.destroy(previous.key);
|
|
66
|
+
if (!s) {
|
|
67
|
+
s = { key, host, kind, uid: uid(), options, events, dead: false, destroy };
|
|
68
|
+
s.root = node("div");
|
|
69
|
+
s.notice = attr(node("div", "blu-advanced-sr"), "role", "status");
|
|
70
|
+
attr(s.notice, "aria-atomic", "true");
|
|
71
|
+
host.append(s.root, s.notice);
|
|
72
|
+
shared.instances.set(key, s);
|
|
73
|
+
host._bluAdvancedOwner = key;
|
|
74
|
+
try {
|
|
75
|
+
init2(s);
|
|
76
|
+
} catch (e) {
|
|
77
|
+
destroy(key);
|
|
78
|
+
throw e;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
s.options = options;
|
|
82
|
+
s.events = events;
|
|
83
|
+
try {
|
|
84
|
+
update2(s);
|
|
85
|
+
host.dataset.bluRuntimeReady = "true";
|
|
86
|
+
return "";
|
|
87
|
+
} catch (e) {
|
|
88
|
+
report(s, e);
|
|
89
|
+
return e.message || String(e);
|
|
90
|
+
}
|
|
91
|
+
}, destroy }));
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// ../blu-grid/docs/scripts/advanced/date-utils.js
|
|
95
|
+
var pad = (n) => String(n).padStart(2, "0");
|
|
96
|
+
function dateValue(d) {
|
|
97
|
+
return String(d.getFullYear()).padStart(4, "0") + "-" + pad(d.getMonth() + 1) + "-" + pad(d.getDate());
|
|
98
|
+
}
|
|
99
|
+
function dateObject(value) {
|
|
100
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(String(value));
|
|
101
|
+
if (!match || +match[1] < 1 || +match[1] > 9999) return null;
|
|
102
|
+
const date = new Date(2e3, +match[2] - 1, +match[3], 12);
|
|
103
|
+
date.setFullYear(+match[1]);
|
|
104
|
+
return dateValue(date) === value ? date : null;
|
|
105
|
+
}
|
|
106
|
+
function timeValue(value) {
|
|
107
|
+
const m = /^(\d{2}):(\d{2})$/.exec(String(value));
|
|
108
|
+
return m && +m[1] < 24 && +m[2] < 60 ? m[1] + ":" + m[2] : null;
|
|
109
|
+
}
|
|
110
|
+
function parseDate(text, format = "YYYY-MM-DD") {
|
|
111
|
+
text = String(text).trim();
|
|
112
|
+
if (!text) return "";
|
|
113
|
+
let value = text;
|
|
114
|
+
if (format !== "YYYY-MM-DD") {
|
|
115
|
+
const m = /^(\d{1,2})\/(\d{1,2})\/(\d{4})$/.exec(text);
|
|
116
|
+
if (!m) return null;
|
|
117
|
+
value = m[3] + "-" + pad(+(format === "DD/MM/YYYY" ? m[2] : m[1])) + "-" + pad(+(format === "DD/MM/YYYY" ? m[1] : m[2]));
|
|
118
|
+
}
|
|
119
|
+
return dateObject(value) ? value : null;
|
|
120
|
+
}
|
|
121
|
+
function formatDate(value, format = "YYYY-MM-DD") {
|
|
122
|
+
if (!value) return "";
|
|
123
|
+
const parts = value.split("-");
|
|
124
|
+
return format === "MM/DD/YYYY" ? parts[1] + "/" + parts[2] + "/" + parts[0] : format === "DD/MM/YYYY" ? parts[2] + "/" + parts[1] + "/" + parts[0] : value;
|
|
125
|
+
}
|
|
126
|
+
function parseTime(text, cycle = 24) {
|
|
127
|
+
text = String(text).trim();
|
|
128
|
+
if (!text) return "";
|
|
129
|
+
const m = /^(\d{1,2}):(\d{2})(?:\s*(AM|PM))?$/i.exec(text);
|
|
130
|
+
if (!m || +m[2] > 59 || (cycle === 12 ? !m[3] || +m[1] < 1 || +m[1] > 12 : !!m[3] || +m[1] > 23)) return null;
|
|
131
|
+
return pad(m[3] ? +m[1] % 12 + (m[3].toUpperCase() === "PM" ? 12 : 0) : +m[1]) + ":" + m[2];
|
|
132
|
+
}
|
|
133
|
+
function formatTime(value, cycle = 24) {
|
|
134
|
+
if (!value) return "";
|
|
135
|
+
const [h, m] = value.split(":").map(Number);
|
|
136
|
+
return cycle === 12 ? (h % 12 || 12) + ":" + pad(m) + " " + (h < 12 ? "AM" : "PM") : pad(h) + ":" + pad(m);
|
|
137
|
+
}
|
|
138
|
+
function addDays(value, count) {
|
|
139
|
+
const date = dateObject(value);
|
|
140
|
+
date.setDate(date.getDate() + count);
|
|
141
|
+
return dateValue(date);
|
|
142
|
+
}
|
|
143
|
+
function addMonths(value, count) {
|
|
144
|
+
const date = dateObject(value), day = date.getDate();
|
|
145
|
+
date.setDate(1);
|
|
146
|
+
date.setMonth(date.getMonth() + count);
|
|
147
|
+
date.setDate(Math.min(day, new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate()));
|
|
148
|
+
return dateValue(date);
|
|
149
|
+
}
|
|
150
|
+
function daysBetween(start, end) {
|
|
151
|
+
const a = dateObject(start), b = dateObject(end);
|
|
152
|
+
return Math.round((b.getTime() - a.getTime()) / 864e5);
|
|
153
|
+
}
|
|
154
|
+
function validateDate(value, min, max, disabled) {
|
|
155
|
+
if (!dateObject(value)) return "Enter a real calendar date.";
|
|
156
|
+
if (min && value < min) return "Choose " + min + " or later.";
|
|
157
|
+
if (max && value > max) return "Choose " + max + " or earlier.";
|
|
158
|
+
if (disabled?.has(value)) return "This date is unavailable.";
|
|
159
|
+
return "";
|
|
160
|
+
}
|
|
161
|
+
function validateRange(start, end, options = {}) {
|
|
162
|
+
if (!start || !end) return "Choose both a start date and an end date.";
|
|
163
|
+
const issue = validateDate(start, options.Min, options.Max, options.disabled) || validateDate(end, options.Min, options.Max, options.disabled);
|
|
164
|
+
if (issue) return issue;
|
|
165
|
+
if (end < start) return "End date must be on or after start date.";
|
|
166
|
+
const length = daysBetween(start, end) + 1;
|
|
167
|
+
if (options.MinRangeDays && length < options.MinRangeDays) return "Choose at least " + options.MinRangeDays + " days.";
|
|
168
|
+
if (options.MaxRangeDays && length > options.MaxRangeDays) return "Choose no more than " + options.MaxRangeDays + " days.";
|
|
169
|
+
if (options.disabled) {
|
|
170
|
+
for (const day of options.disabled) if (day >= start && day <= end) return "The range includes an unavailable date.";
|
|
171
|
+
}
|
|
172
|
+
return "";
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// ../blu-grid/docs/scripts/advanced/pickers.js
|
|
176
|
+
var formatOptions = ["YYYY-MM-DD", "MM/DD/YYYY", "DD/MM/YYYY"];
|
|
177
|
+
var today = () => dateValue(/* @__PURE__ */ new Date());
|
|
178
|
+
var datePart = (value) => String(value || "").split("T")[0];
|
|
179
|
+
var timePart = (value) => String(value || "").split("T")[1] || "";
|
|
180
|
+
function labelDate(s, value) {
|
|
181
|
+
const date = dateObject(value);
|
|
182
|
+
return date ? new Intl.DateTimeFormat(s.locale, { dateStyle: "full" }).format(date) : value;
|
|
183
|
+
}
|
|
184
|
+
function setError(s, message, fields = s.fields) {
|
|
185
|
+
s.error.textContent = message;
|
|
186
|
+
s.error.hidden = !message || s.isOpen;
|
|
187
|
+
if (s.dialogError) s.dialogError.textContent = s.isOpen ? message : "";
|
|
188
|
+
for (const field of s.fields) attr(field.input, "aria-invalid", message && fields.includes(field) ? "true" : null);
|
|
189
|
+
const valid = !message;
|
|
190
|
+
if (s.valid !== valid || s.validationMessage !== message) {
|
|
191
|
+
s.valid = valid;
|
|
192
|
+
s.validationMessage = message;
|
|
193
|
+
emit(s, "ValidationChanged", valid, message);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
function calendarIssue(s, date) {
|
|
197
|
+
return validateDate(date, datePart(s.options.Min), datePart(s.options.Max), s.disabledDates);
|
|
198
|
+
}
|
|
199
|
+
function timeIssue(s, time, date) {
|
|
200
|
+
if (!timeValue(time)) return "Enter a valid time.";
|
|
201
|
+
const value = s.dateTime ? date + "T" + time : time, min = s.options.Min, max = s.options.Max;
|
|
202
|
+
if (min && value < min) return "Choose " + min + " or later.";
|
|
203
|
+
if (max && value > max) return "Choose " + max + " or earlier.";
|
|
204
|
+
return "";
|
|
205
|
+
}
|
|
206
|
+
function validate(s, first, end, time) {
|
|
207
|
+
if (s.range) {
|
|
208
|
+
if (!first && !end && !s.options.IsRequired) return "";
|
|
209
|
+
return validateRange(first, end, { ...s.options, disabled: s.disabledDates });
|
|
210
|
+
}
|
|
211
|
+
if (!first && !time) return s.options.IsRequired ? "A " + (s.timeOnly ? "time" : "date") + " is required." : "";
|
|
212
|
+
if (!s.timeOnly) {
|
|
213
|
+
if (!first) return "Choose a date.";
|
|
214
|
+
const issue = calendarIssue(s, first);
|
|
215
|
+
if (issue) return issue;
|
|
216
|
+
}
|
|
217
|
+
if (s.hasTime) {
|
|
218
|
+
if (!time) return "Choose a time.";
|
|
219
|
+
return timeIssue(s, time, first);
|
|
220
|
+
}
|
|
221
|
+
return "";
|
|
222
|
+
}
|
|
223
|
+
function paintInputs(s) {
|
|
224
|
+
if (s.timeOnly) s.fields[0].input.value = formatTime(s.value, s.cycle);
|
|
225
|
+
else {
|
|
226
|
+
s.fields[0].input.value = formatDate(s.range ? s.start : datePart(s.value), s.format);
|
|
227
|
+
if (s.range) s.fields[1].input.value = formatDate(s.end, s.format);
|
|
228
|
+
if (s.dateTime) s.fields[1].input.value = formatTime(timePart(s.value), s.cycle);
|
|
229
|
+
}
|
|
230
|
+
const selected = s.range ? [s.start, s.end].filter(Boolean).join(" to ") : s.value;
|
|
231
|
+
s.typedDirty = false;
|
|
232
|
+
s.clearButton.hidden = s.options.ShowClear === false || !selected;
|
|
233
|
+
}
|
|
234
|
+
function close(s, restore = true) {
|
|
235
|
+
if (!s.isOpen) return;
|
|
236
|
+
s.isOpen = false;
|
|
237
|
+
if (s.dialog.hidePopover && s.dialog.matches(":popover-open")) s.dialog.hidePopover();
|
|
238
|
+
s.dialog.hidden = true;
|
|
239
|
+
s.error.hidden = !s.validationMessage;
|
|
240
|
+
for (const { input } of s.fields) attr(input, "aria-expanded", "false");
|
|
241
|
+
if (restore && s.anchor?.isConnected && !s.anchor.disabled) s.anchor.focus({ preventScroll: true });
|
|
242
|
+
emit(s, "OpenChanged", false);
|
|
243
|
+
}
|
|
244
|
+
function positionPopup(s) {
|
|
245
|
+
if (!s.isOpen || s.dead) return;
|
|
246
|
+
const anchor = s.anchor.getBoundingClientRect(), view = window.visualViewport;
|
|
247
|
+
const left = view?.offsetLeft || 0, top = view?.offsetTop || 0, width = view?.width || document.documentElement.clientWidth, height = view?.height || window.innerHeight, gap = 6, edge = 8;
|
|
248
|
+
if (anchor.bottom <= top || anchor.top >= top + height || anchor.right <= left || anchor.left >= left + width) {
|
|
249
|
+
close(s, false);
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
const panel = s.dialog, panelWidth = Math.min(s.timeOnly ? 300 : 344, width - edge * 2);
|
|
253
|
+
panel.dataset.compact = String(height < 420);
|
|
254
|
+
panel.style.width = panelWidth + "px";
|
|
255
|
+
panel.style.maxHeight = "none";
|
|
256
|
+
const below = Math.max(0, top + height - edge - anchor.bottom - gap), above = Math.max(0, anchor.top - gap - top - edge);
|
|
257
|
+
const natural = panel.scrollHeight + 2, up = natural > below && above > below, room = Math.max(0, height - edge * 2);
|
|
258
|
+
panel.style.maxHeight = room + "px";
|
|
259
|
+
panel.style.left = Math.max(left + edge, Math.min(anchor.left, left + width - edge - panelWidth)) + "px";
|
|
260
|
+
const preferred = up ? anchor.top - gap - natural : anchor.bottom + gap;
|
|
261
|
+
panel.style.top = Math.max(top + edge, Math.min(preferred, top + height - edge - Math.min(natural, room))) + "px";
|
|
262
|
+
panel.dataset.placement = up ? "top" : "bottom";
|
|
263
|
+
}
|
|
264
|
+
function focusPopup(s) {
|
|
265
|
+
const timeField = s.timeOnly || s.dateTime && s.anchor === s.fields[1].input;
|
|
266
|
+
(timeField ? s.hours : s.calendar.querySelector('[data-date="' + s.focusDate + '"]') || s.monthSelect).focus();
|
|
267
|
+
}
|
|
268
|
+
function commit(s, first, end, time, keepOpen = false) {
|
|
269
|
+
const issue = validate(s, first, end, time);
|
|
270
|
+
setError(s, issue);
|
|
271
|
+
if (issue) {
|
|
272
|
+
s.dialogError.textContent = issue;
|
|
273
|
+
return false;
|
|
274
|
+
}
|
|
275
|
+
const returnToInput = document.activeElement === s.clearButton && !first && !end && !time;
|
|
276
|
+
const value = s.timeOnly ? time : s.dateTime ? first ? first + "T" + time : "" : first;
|
|
277
|
+
const changed = s.range ? s.start !== first || s.end !== end : s.value !== value;
|
|
278
|
+
if (s.range) {
|
|
279
|
+
s.start = first;
|
|
280
|
+
s.end = end;
|
|
281
|
+
s.options.StartDate = first;
|
|
282
|
+
s.options.EndDate = end;
|
|
283
|
+
} else {
|
|
284
|
+
s.value = value;
|
|
285
|
+
s.options.Value = value;
|
|
286
|
+
}
|
|
287
|
+
s.inputSignature = JSON.stringify(s.range ? [s.start, s.end] : [s.value]);
|
|
288
|
+
paintInputs(s);
|
|
289
|
+
if (!keepOpen) close(s);
|
|
290
|
+
if (returnToInput) s.fields[0].input.focus();
|
|
291
|
+
s.notice.textContent = s.range ? first ? labelDate(s, first) + " to " + labelDate(s, end) : "Date range cleared" : value ? "Selected " + (s.timeOnly ? formatTime(value, s.cycle) : labelDate(s, first) + (s.hasTime ? " at " + formatTime(time, s.cycle) : "")) : "Selection cleared";
|
|
292
|
+
if (changed) {
|
|
293
|
+
if (s.range) emit(s, "Change", first, end);
|
|
294
|
+
else emit(s, "Change", value);
|
|
295
|
+
}
|
|
296
|
+
return true;
|
|
297
|
+
}
|
|
298
|
+
function typed(s, keepOpen = false) {
|
|
299
|
+
if (s.options.IsDisabled || s.options.IsReadOnly) return;
|
|
300
|
+
const first = s.timeOnly ? "" : parseDate(s.fields[0].input.value, s.format), end = s.range ? parseDate(s.fields[1].input.value, s.format) : "";
|
|
301
|
+
const time = s.hasTime ? parseTime(s.fields[s.timeOnly ? 0 : 1].input.value, s.cycle) : "";
|
|
302
|
+
if (first === null || end === null) {
|
|
303
|
+
setError(s, "Enter a real date using " + s.format + ".");
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
if (time === null) {
|
|
307
|
+
setError(s, s.cycle === 12 ? "Enter a time such as 9:15 AM." : "Enter a time such as 14:30.");
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
if (commit(s, first, end, time, keepOpen) && keepOpen) {
|
|
311
|
+
s.draftStart = first;
|
|
312
|
+
s.draftEnd = end;
|
|
313
|
+
s.draftTime = time;
|
|
314
|
+
if (first) {
|
|
315
|
+
s.focusDate = first;
|
|
316
|
+
s.month = first.slice(0, 7);
|
|
317
|
+
}
|
|
318
|
+
paintCalendar(s);
|
|
319
|
+
paintTimes(s);
|
|
320
|
+
paintDraft(s);
|
|
321
|
+
positionPopup(s);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
function buildFields(s) {
|
|
325
|
+
const count = s.range || s.dateTime ? 2 : 1;
|
|
326
|
+
s.fields = [];
|
|
327
|
+
for (let i = 0; i < count; i++) {
|
|
328
|
+
const field = node("div", "blu-picker__field"), label = node("label"), input = node("input", "blu-picker__input");
|
|
329
|
+
input.type = "text";
|
|
330
|
+
input.id = s.uid + "-input-" + i;
|
|
331
|
+
label.htmlFor = input.id;
|
|
332
|
+
input.autocomplete = "off";
|
|
333
|
+
input.spellcheck = false;
|
|
334
|
+
attr(input, "role", "combobox");
|
|
335
|
+
attr(input, "aria-haspopup", "dialog");
|
|
336
|
+
attr(input, "aria-expanded", "false");
|
|
337
|
+
attr(input, "aria-autocomplete", "none");
|
|
338
|
+
attr(input, "aria-controls", s.uid + "-dialog");
|
|
339
|
+
attr(input, "aria-describedby", s.uid + "-hint " + s.uid + "-error " + s.uid + "-keyboard");
|
|
340
|
+
input.addEventListener("input", () => {
|
|
341
|
+
s.typedDirty = true;
|
|
342
|
+
});
|
|
343
|
+
input.addEventListener("change", () => typed(s, s.isOpen));
|
|
344
|
+
input.addEventListener("pointerdown", (event) => {
|
|
345
|
+
if (event.pointerType === "mouse") {
|
|
346
|
+
s.touchOpen = false;
|
|
347
|
+
input.inputMode = "text";
|
|
348
|
+
}
|
|
349
|
+
if ((event.pointerType === "touch" || event.pointerType === "pen") && s.manualInput !== input && !s.options.IsDisabled && !s.options.IsReadOnly) {
|
|
350
|
+
event.preventDefault();
|
|
351
|
+
s.touchOpen = true;
|
|
352
|
+
input.inputMode = "none";
|
|
353
|
+
open(s, input, true);
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
input.addEventListener("click", (event) => {
|
|
357
|
+
if (s.manualInput === input) return;
|
|
358
|
+
if (s.touchOpen) {
|
|
359
|
+
event.preventDefault();
|
|
360
|
+
open(s, input, true);
|
|
361
|
+
} else open(s, input, false);
|
|
362
|
+
});
|
|
363
|
+
input.addEventListener("blur", () => {
|
|
364
|
+
if (s.manualInput === input) s.manualInput = null;
|
|
365
|
+
});
|
|
366
|
+
input.addEventListener("keydown", (event) => {
|
|
367
|
+
if (event.ctrlKey || event.metaKey || event.shiftKey) return;
|
|
368
|
+
if (event.key === "ArrowDown") {
|
|
369
|
+
event.preventDefault();
|
|
370
|
+
open(s, input, true);
|
|
371
|
+
}
|
|
372
|
+
if (event.key === "Enter") {
|
|
373
|
+
event.preventDefault();
|
|
374
|
+
if (!s.isOpen && !s.typedDirty) open(s, input, true);
|
|
375
|
+
else typed(s);
|
|
376
|
+
}
|
|
377
|
+
if (event.key === "Tab") close(s, false);
|
|
378
|
+
});
|
|
379
|
+
const control = node("div", "blu-picker__field-control"), icon = attr(node("span", "blu-picker__field-icon"), "aria-hidden", "true");
|
|
380
|
+
icon.innerHTML = s.timeOnly || s.dateTime && i ? '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><circle cx="12" cy="12" r="8.5"/><path d="M12 7v5l3 2"/></svg>' : '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><rect x="4" y="5" width="16" height="16" rx="3"/><path d="M8 3v4m8-4v4M4 10h16m-11 4h2m3 0h2m-7 3h2"/></svg>';
|
|
381
|
+
control.append(input, icon);
|
|
382
|
+
field.append(label, control);
|
|
383
|
+
s.fields.push({ field, label, input });
|
|
384
|
+
s.fieldRow.append(field);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
function appendOption(select, value, label) {
|
|
388
|
+
const option = node("option", "", label);
|
|
389
|
+
option.value = String(value);
|
|
390
|
+
select.append(option);
|
|
391
|
+
return option;
|
|
392
|
+
}
|
|
393
|
+
function selectField(s, label, name) {
|
|
394
|
+
const wrap = node("label", "blu-picker__select-field"), caption = node("span", "", label), select = node("select", "blu-picker__input");
|
|
395
|
+
select.id = s.uid + "-" + name;
|
|
396
|
+
wrap.append(caption, select);
|
|
397
|
+
return { wrap, select };
|
|
398
|
+
}
|
|
399
|
+
function focusDay(s, value) {
|
|
400
|
+
const min = datePart(s.options.Min) || "0001-01-01", max = datePart(s.options.Max) || "9999-12-31";
|
|
401
|
+
value = value < min ? min : value > max ? max : value;
|
|
402
|
+
if (!dateObject(value)) return;
|
|
403
|
+
s.focusDate = value;
|
|
404
|
+
s.month = value.slice(0, 7);
|
|
405
|
+
paintCalendar(s);
|
|
406
|
+
s.calendar.querySelector('[data-date="' + value + '"]')?.focus();
|
|
407
|
+
}
|
|
408
|
+
function keyDay(s, event, value) {
|
|
409
|
+
if (event.altKey || event.ctrlKey || event.metaKey) return;
|
|
410
|
+
let next;
|
|
411
|
+
const offsets = { ArrowLeft: -1, ArrowRight: 1, ArrowUp: -7, ArrowDown: 7 };
|
|
412
|
+
if (event.key in offsets) next = addDays(value, offsets[event.key]);
|
|
413
|
+
else if (event.key === "Home" || event.key === "End") {
|
|
414
|
+
const day = (dateObject(value).getDay() - s.firstDay + 7) % 7;
|
|
415
|
+
next = addDays(value, event.key === "Home" ? -day : 6 - day);
|
|
416
|
+
} else if (event.key === "PageUp" || event.key === "PageDown") next = addMonths(value, (event.key === "PageUp" ? -1 : 1) * (event.shiftKey ? 12 : 1));
|
|
417
|
+
if (next) {
|
|
418
|
+
event.preventDefault();
|
|
419
|
+
focusDay(s, next);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
function chooseDay(s, value) {
|
|
423
|
+
if (calendarIssue(s, value)) return;
|
|
424
|
+
s.dialogError.textContent = "";
|
|
425
|
+
s.focusDate = value;
|
|
426
|
+
if (s.range) {
|
|
427
|
+
if (s.rangeNext === "start") {
|
|
428
|
+
s.draftStart = value;
|
|
429
|
+
s.draftEnd = "";
|
|
430
|
+
s.rangeNext = "end";
|
|
431
|
+
} else {
|
|
432
|
+
if (value < s.draftStart) {
|
|
433
|
+
s.draftEnd = s.draftStart;
|
|
434
|
+
s.draftStart = value;
|
|
435
|
+
} else s.draftEnd = value;
|
|
436
|
+
s.rangeNext = "start";
|
|
437
|
+
}
|
|
438
|
+
} else s.draftStart = value;
|
|
439
|
+
if (!s.hasTime && !s.range) {
|
|
440
|
+
commit(s, value, "", "");
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
paintCalendar(s);
|
|
444
|
+
s.calendar.querySelector('[data-date="' + value + '"]')?.focus();
|
|
445
|
+
paintDraft(s);
|
|
446
|
+
}
|
|
447
|
+
function paintDraft(s) {
|
|
448
|
+
const full = s.range ? s.draftStart ? labelDate(s, s.draftStart) + (s.draftEnd ? " to " + labelDate(s, s.draftEnd) : " \u2014 choose an end date") : "Choose a start date" : s.hasTime ? (s.draftStart ? labelDate(s, s.draftStart) + " \xB7 " : "") + formatTime(s.draftTime, s.cycle) : "";
|
|
449
|
+
const short = (value) => dateObject(value) ? new Intl.DateTimeFormat(s.locale, { month: "short", day: "numeric" }).format(dateObject(value)) : "";
|
|
450
|
+
s.selectionSpeech.textContent = full;
|
|
451
|
+
s.selectionVisual.textContent = s.range ? s.draftStart ? short(s.draftStart) + (s.draftEnd ? " \u2013 " + short(s.draftEnd) : " \u2014 choose end") : "Choose start date" : s.dateTime ? short(s.draftStart) + " \xB7 " + formatTime(s.draftTime, s.cycle) : s.timeOnly ? formatTime(s.draftTime, s.cycle) : "";
|
|
452
|
+
s.selection.hidden = !full;
|
|
453
|
+
}
|
|
454
|
+
function paintCalendar(s) {
|
|
455
|
+
const date = dateObject(s.month + "-01");
|
|
456
|
+
if (!date) return;
|
|
457
|
+
const year = date.getFullYear(), month = date.getMonth(), minYear = Number(datePart(s.options.Min).slice(0, 4)) || 1, maxYear = Number(datePart(s.options.Max).slice(0, 4)) || 9999;
|
|
458
|
+
s.monthSelect.value = String(month);
|
|
459
|
+
s.yearInput.value = String(year);
|
|
460
|
+
attr(s.yearInput, "aria-invalid", null);
|
|
461
|
+
s.yearInput.min = String(minYear);
|
|
462
|
+
s.yearInput.max = String(maxYear);
|
|
463
|
+
const caption = new Intl.DateTimeFormat(s.locale, { month: "long", year: "numeric" }).format(date);
|
|
464
|
+
if (s.caption.textContent !== caption) s.caption.textContent = caption;
|
|
465
|
+
const offset = (date.getDay() - s.firstDay + 7) % 7, last = new Date(year, month + 1, 0).getDate();
|
|
466
|
+
if (!s.focusDate.startsWith(s.month)) s.focusDate = s.month + "-01";
|
|
467
|
+
if (!s.dayCells) {
|
|
468
|
+
const body = node("tbody");
|
|
469
|
+
s.dayCells = [];
|
|
470
|
+
for (let row = 0; row < 6; row++) {
|
|
471
|
+
const tr = node("tr");
|
|
472
|
+
for (let col = 0; col < 7; col++) {
|
|
473
|
+
const td = node("td"), b = button("", () => chooseDay(s, b.dataset.date), "blu-picker__day");
|
|
474
|
+
b.addEventListener("keydown", (e) => keyDay(s, e, b.dataset.date));
|
|
475
|
+
b.addEventListener("focus", () => {
|
|
476
|
+
s.focusDate = b.dataset.date;
|
|
477
|
+
for (const other of s.dayCells) other.button.tabIndex = other.button === b ? 0 : -1;
|
|
478
|
+
});
|
|
479
|
+
td.append(b);
|
|
480
|
+
tr.append(td);
|
|
481
|
+
s.dayCells.push({ cell: td, button: b });
|
|
482
|
+
}
|
|
483
|
+
body.append(tr);
|
|
484
|
+
}
|
|
485
|
+
s.calendar.append(body);
|
|
486
|
+
}
|
|
487
|
+
for (let i = 0; i < s.dayCells.length; i++) {
|
|
488
|
+
const { cell: td, button: b } = s.dayCells[i], day = i - offset + 1, inMonth = day > 0 && day <= last;
|
|
489
|
+
b.hidden = !inMonth;
|
|
490
|
+
if (!inMonth) {
|
|
491
|
+
b.tabIndex = -1;
|
|
492
|
+
delete b.dataset.date;
|
|
493
|
+
attr(td, "aria-selected", null);
|
|
494
|
+
continue;
|
|
495
|
+
}
|
|
496
|
+
const value = s.month + "-" + pad(day), chosen = value === s.draftStart || s.range && value === s.draftEnd, between = s.range && s.draftStart && s.draftEnd && value > s.draftStart && value < s.draftEnd;
|
|
497
|
+
const unavailable = calendarIssue(s, value), selected = !!(chosen || between);
|
|
498
|
+
const rangeContext = s.range && chosen ? value === s.draftStart ? s.draftEnd ? ", range starts here; " + labelDate(s, s.draftStart) + " to " + labelDate(s, s.draftEnd) : ", start date; choose an end date" : ", range ends here; " + labelDate(s, s.draftStart) + " to " + labelDate(s, s.draftEnd) : "";
|
|
499
|
+
const name = labelDate(s, value) + (selected ? ", selected" : "") + rangeContext + (unavailable ? ", unavailable" : "");
|
|
500
|
+
b.dataset.date = value;
|
|
501
|
+
b.tabIndex = value === s.focusDate ? 0 : -1;
|
|
502
|
+
if (b.textContent !== String(day)) b.textContent = String(day);
|
|
503
|
+
if (b.getAttribute("aria-label") !== name) attr(b, "aria-label", name);
|
|
504
|
+
attr(td, "aria-selected", String(selected));
|
|
505
|
+
attr(b, "aria-disabled", unavailable ? "true" : null);
|
|
506
|
+
attr(b, "aria-current", value === today() ? "date" : null);
|
|
507
|
+
b.dataset.selected = String(chosen);
|
|
508
|
+
b.dataset.between = String(!!between);
|
|
509
|
+
}
|
|
510
|
+
for (let row = 0; row < 6; row++) s.dayCells[row * 7].cell.parentElement.hidden = row * 7 - offset + 1 > last;
|
|
511
|
+
const min = datePart(s.options.Min), max = datePart(s.options.Max);
|
|
512
|
+
s.prev.disabled = !!min && s.month <= min.slice(0, 7) || year === 1 && month === 0;
|
|
513
|
+
s.next.disabled = !!max && s.month >= max.slice(0, 7) || year === 9999 && month === 11;
|
|
514
|
+
s.todayButton.hidden = s.timeOnly || s.options.ShowToday === false;
|
|
515
|
+
s.todayButton.disabled = !!calendarIssue(s, today());
|
|
516
|
+
}
|
|
517
|
+
function paintTimes(s) {
|
|
518
|
+
if (!s.hasTime) return;
|
|
519
|
+
const [h, m] = (s.draftTime || "09:00").split(":").map(Number);
|
|
520
|
+
s.hours.replaceChildren();
|
|
521
|
+
s.minutes.replaceChildren();
|
|
522
|
+
for (let i = 0; i < (s.cycle === 12 ? 12 : 24); i++) appendOption(s.hours, s.cycle === 12 ? i + 1 : i, pad(s.cycle === 12 ? i + 1 : i));
|
|
523
|
+
for (let i = 0; i < 60; i += s.step) appendOption(s.minutes, i, pad(i));
|
|
524
|
+
if (m % s.step) appendOption(s.minutes, m, pad(m) + " (entered)");
|
|
525
|
+
s.hours.value = String(s.cycle === 12 ? h % 12 || 12 : h);
|
|
526
|
+
s.minutes.value = String(m);
|
|
527
|
+
s.period.value = h < 12 ? "AM" : "PM";
|
|
528
|
+
s.periodField.hidden = s.cycle !== 12;
|
|
529
|
+
paintDraft(s);
|
|
530
|
+
}
|
|
531
|
+
function open(s, input = s.fields[0].input, moveFocus = true) {
|
|
532
|
+
if (s.options.IsDisabled || s.options.IsReadOnly) return;
|
|
533
|
+
s.anchor = input;
|
|
534
|
+
s.manualInput = null;
|
|
535
|
+
s.typeButton.hidden = !s.touchOpen;
|
|
536
|
+
if (s.isOpen) {
|
|
537
|
+
if (s.range) s.rangeNext = input === s.fields[1].input && s.draftStart ? "end" : "start";
|
|
538
|
+
positionPopup(s);
|
|
539
|
+
if (moveFocus) focusPopup(s);
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
s.draftStart = s.timeOnly ? "" : s.range ? s.start : datePart(s.value);
|
|
543
|
+
s.draftEnd = s.end || "";
|
|
544
|
+
s.draftTime = s.timeOnly ? s.value : timePart(s.value);
|
|
545
|
+
if (s.hasTime && !timeValue(s.draftTime)) s.draftTime = "09:00";
|
|
546
|
+
s.rangeNext = "start";
|
|
547
|
+
if (s.range && input === s.fields[1].input && s.draftStart) s.rangeNext = "end";
|
|
548
|
+
const chosen = s.range && s.rangeNext === "end" ? s.draftEnd : s.draftStart;
|
|
549
|
+
s.focusDate = dateObject(chosen) ? chosen : dateObject(s.draftStart) ? s.draftStart : today();
|
|
550
|
+
const min = datePart(s.options.Min), max = datePart(s.options.Max);
|
|
551
|
+
if (!s.timeOnly) {
|
|
552
|
+
if (min && s.focusDate < min) s.focusDate = min;
|
|
553
|
+
if (max && s.focusDate > max) s.focusDate = max;
|
|
554
|
+
}
|
|
555
|
+
s.month = s.focusDate.slice(0, 7);
|
|
556
|
+
s.dialogError.textContent = "";
|
|
557
|
+
paintCalendar(s);
|
|
558
|
+
paintTimes(s);
|
|
559
|
+
paintDraft(s);
|
|
560
|
+
s.isOpen = true;
|
|
561
|
+
s.dialog.hidden = false;
|
|
562
|
+
if (s.dialog.showPopover) s.dialog.showPopover();
|
|
563
|
+
s.dialog.scrollTop = 0;
|
|
564
|
+
for (const { input: field } of s.fields) attr(field, "aria-expanded", "true");
|
|
565
|
+
positionPopup(s);
|
|
566
|
+
if (moveFocus && s.isOpen) focusPopup(s);
|
|
567
|
+
emit(s, "OpenChanged", true);
|
|
568
|
+
}
|
|
569
|
+
function init(s) {
|
|
570
|
+
s.range = s.kind === "DateRangePicker";
|
|
571
|
+
s.timeOnly = s.kind === "TimePicker";
|
|
572
|
+
s.dateTime = s.kind === "DateTimePicker";
|
|
573
|
+
s.hasTime = s.timeOnly || s.dateTime;
|
|
574
|
+
s.root.className = "blu-picker";
|
|
575
|
+
s.fieldRow = node("div", "blu-picker__fields");
|
|
576
|
+
s.error = attr(node("div", "blu-picker__error"), "role", "alert");
|
|
577
|
+
s.error.id = s.uid + "-error";
|
|
578
|
+
s.error.hidden = true;
|
|
579
|
+
s.hint = node("div", "blu-picker__hint");
|
|
580
|
+
s.hint.id = s.uid + "-hint";
|
|
581
|
+
s.actions = node("div", "blu-picker__actions");
|
|
582
|
+
s.clearButton = button("Clear", () => commit(s, "", "", ""));
|
|
583
|
+
s.actions.append(s.clearButton);
|
|
584
|
+
s.root.append(s.fieldRow, s.hint, s.actions, s.error);
|
|
585
|
+
buildFields(s);
|
|
586
|
+
const keyboard = node("span", "blu-advanced-sr", "Click the field or press Down Arrow to browse. Escape closes the popup.");
|
|
587
|
+
keyboard.id = s.uid + "-keyboard";
|
|
588
|
+
s.root.append(keyboard);
|
|
589
|
+
s.dialog = node("div", "blu-picker__dialog blu-picker__popup");
|
|
590
|
+
s.dialog.id = s.uid + "-dialog";
|
|
591
|
+
s.dialog.hidden = true;
|
|
592
|
+
attr(s.dialog, "role", "dialog");
|
|
593
|
+
attr(s.dialog, "aria-labelledby", s.uid + "-title");
|
|
594
|
+
attr(s.dialog, "aria-modal", "false");
|
|
595
|
+
if (s.dialog.showPopover) attr(s.dialog, "popover", "manual");
|
|
596
|
+
s.root.append(s.dialog);
|
|
597
|
+
s.title = node("h2", "blu-advanced-sr");
|
|
598
|
+
s.title.id = s.uid + "-title";
|
|
599
|
+
s.dialog.append(s.title);
|
|
600
|
+
s.presets = node("div", "blu-picker__presets");
|
|
601
|
+
s.dialog.append(s.presets);
|
|
602
|
+
s.calendarArea = node("div", "blu-picker__calendar-area");
|
|
603
|
+
s.calendarArea.hidden = s.timeOnly;
|
|
604
|
+
s.dialog.append(s.calendarArea);
|
|
605
|
+
const nav = node("div", "blu-picker__calendar-nav");
|
|
606
|
+
const month = selectField(s, "Month", "month");
|
|
607
|
+
s.monthSelect = month.select;
|
|
608
|
+
const year = node("label", "blu-picker__select-field");
|
|
609
|
+
year.append(node("span", "", "Year"));
|
|
610
|
+
s.yearInput = node("input", "blu-picker__input");
|
|
611
|
+
s.yearInput.type = "number";
|
|
612
|
+
s.yearInput.step = "1";
|
|
613
|
+
year.append(s.yearInput);
|
|
614
|
+
const move = (delta) => {
|
|
615
|
+
const candidate = addMonths(s.focusDate, delta);
|
|
616
|
+
focusDay(s, candidate);
|
|
617
|
+
};
|
|
618
|
+
s.prev = button("\u2039", () => move(-1));
|
|
619
|
+
attr(s.prev, "aria-label", "Previous month");
|
|
620
|
+
s.next = button("\u203A", () => move(1));
|
|
621
|
+
attr(s.next, "aria-label", "Next month");
|
|
622
|
+
nav.append(s.prev, month.wrap, year, s.next);
|
|
623
|
+
s.calendarArea.append(nav);
|
|
624
|
+
s.monthSelect.addEventListener("change", () => focusDay(s, String(s.yearInput.value).padStart(4, "0") + "-" + pad(+s.monthSelect.value + 1) + "-01"));
|
|
625
|
+
s.yearInput.addEventListener("change", () => {
|
|
626
|
+
const y = Number(s.yearInput.value);
|
|
627
|
+
if (!Number.isInteger(y) || y < +s.yearInput.min || y > +s.yearInput.max) {
|
|
628
|
+
s.dialogError.textContent = "Enter a year from " + s.yearInput.min + " to " + s.yearInput.max + ".";
|
|
629
|
+
attr(s.yearInput, "aria-invalid", "true");
|
|
630
|
+
return;
|
|
631
|
+
}
|
|
632
|
+
attr(s.yearInput, "aria-invalid", null);
|
|
633
|
+
s.dialogError.textContent = "";
|
|
634
|
+
focusDay(s, String(y).padStart(4, "0") + "-" + pad(+s.monthSelect.value + 1) + "-01");
|
|
635
|
+
});
|
|
636
|
+
s.caption = attr(node("h3", "blu-picker__caption blu-advanced-sr"), "aria-live", "polite");
|
|
637
|
+
s.caption.id = s.uid + "-caption";
|
|
638
|
+
s.calendarArea.append(s.caption);
|
|
639
|
+
s.calendar = attr(node("table", "blu-picker__calendar"), "role", "grid");
|
|
640
|
+
attr(s.calendar, "aria-labelledby", s.caption.id);
|
|
641
|
+
if (s.range) attr(s.calendar, "aria-multiselectable", "true");
|
|
642
|
+
s.calendarArea.append(s.calendar);
|
|
643
|
+
s.todayButton = button("Today", () => {
|
|
644
|
+
s.focusDate = today();
|
|
645
|
+
s.month = s.focusDate.slice(0, 7);
|
|
646
|
+
chooseDay(s, s.focusDate);
|
|
647
|
+
});
|
|
648
|
+
s.calendarArea.append(node("p", "blu-advanced-sr", "Arrow keys move by day or week. Home/End move within the week. Page Up/Down change month; hold Shift to change year."));
|
|
649
|
+
s.timeArea = node("div", "blu-picker__time-area");
|
|
650
|
+
s.timeArea.hidden = !s.hasTime;
|
|
651
|
+
s.dialog.append(s.timeArea);
|
|
652
|
+
const h = selectField(s, "Hour", "hour"), m = selectField(s, "Minute", "minute"), p = selectField(s, "AM / PM", "period");
|
|
653
|
+
s.hours = h.select;
|
|
654
|
+
s.minutes = m.select;
|
|
655
|
+
s.period = p.select;
|
|
656
|
+
s.periodField = p.wrap;
|
|
657
|
+
appendOption(s.period, "AM", "AM");
|
|
658
|
+
appendOption(s.period, "PM", "PM");
|
|
659
|
+
s.timeArea.append(h.wrap, m.wrap, p.wrap);
|
|
660
|
+
for (const el of [s.hours, s.minutes, s.period]) el.addEventListener("change", () => {
|
|
661
|
+
let hour = +s.hours.value;
|
|
662
|
+
if (s.cycle === 12) hour = hour % 12 + (s.period.value === "PM" ? 12 : 0);
|
|
663
|
+
s.draftTime = pad(hour) + ":" + pad(+s.minutes.value);
|
|
664
|
+
s.dialogError.textContent = "";
|
|
665
|
+
paintDraft(s);
|
|
666
|
+
});
|
|
667
|
+
s.selection = attr(node("div", "blu-picker__selection"), "role", "status");
|
|
668
|
+
attr(s.selection, "aria-atomic", "true");
|
|
669
|
+
s.selectionSpeech = node("span", "blu-advanced-sr");
|
|
670
|
+
s.selectionVisual = attr(node("span"), "aria-hidden", "true");
|
|
671
|
+
s.selection.append(s.selectionSpeech, s.selectionVisual);
|
|
672
|
+
s.dialogError = attr(node("div", "blu-picker__error"), "role", "alert");
|
|
673
|
+
s.dialogError.id = s.uid + "-dialog-error";
|
|
674
|
+
attr(s.yearInput, "aria-describedby", s.dialogError.id);
|
|
675
|
+
s.apply = button("Apply", () => commit(s, s.draftStart, s.draftEnd, s.draftTime), "blu-picker__button blu-picker__button--primary");
|
|
676
|
+
s.apply.hidden = !s.range && !s.hasTime;
|
|
677
|
+
s.typeButton = button("Type", () => {
|
|
678
|
+
const input = s.anchor;
|
|
679
|
+
close(s, false);
|
|
680
|
+
s.manualInput = input;
|
|
681
|
+
input.inputMode = "text";
|
|
682
|
+
input.focus({ preventScroll: true });
|
|
683
|
+
});
|
|
684
|
+
attr(s.typeButton, "aria-label", "Type a date or time");
|
|
685
|
+
s.typeButton.hidden = true;
|
|
686
|
+
const footer = node("div", "blu-picker__popup-actions");
|
|
687
|
+
footer.append(s.typeButton, s.todayButton, button("Cancel", () => close(s)), s.apply);
|
|
688
|
+
s.dialog.append(s.selection, s.dialogError, footer);
|
|
689
|
+
const outside = (event) => {
|
|
690
|
+
if (s.isOpen && !s.root.contains(event.target)) close(s, false);
|
|
691
|
+
};
|
|
692
|
+
const escape = (event) => {
|
|
693
|
+
if (s.isOpen && event.key === "Escape" && !event.defaultPrevented) {
|
|
694
|
+
event.preventDefault();
|
|
695
|
+
event.stopPropagation();
|
|
696
|
+
close(s);
|
|
697
|
+
}
|
|
698
|
+
};
|
|
699
|
+
const reposition = (event) => {
|
|
700
|
+
if (!s.isOpen || s.dialog.contains(event?.target)) return;
|
|
701
|
+
cancelAnimationFrame(s.positionFrame);
|
|
702
|
+
s.positionFrame = requestAnimationFrame(() => positionPopup(s));
|
|
703
|
+
};
|
|
704
|
+
document.addEventListener("pointerdown", outside, true);
|
|
705
|
+
document.addEventListener("focusin", outside);
|
|
706
|
+
s.root.addEventListener("keydown", escape);
|
|
707
|
+
window.addEventListener("resize", reposition);
|
|
708
|
+
document.addEventListener("scroll", reposition, true);
|
|
709
|
+
window.visualViewport?.addEventListener("resize", reposition);
|
|
710
|
+
window.visualViewport?.addEventListener("scroll", reposition);
|
|
711
|
+
if (window.ResizeObserver) {
|
|
712
|
+
s.popupObserver = new ResizeObserver(() => reposition());
|
|
713
|
+
s.popupObserver.observe(s.fieldRow);
|
|
714
|
+
s.popupObserver.observe(s.dialog);
|
|
715
|
+
}
|
|
716
|
+
s.dispose = () => {
|
|
717
|
+
close(s, false);
|
|
718
|
+
cancelAnimationFrame(s.positionFrame);
|
|
719
|
+
s.popupObserver?.disconnect();
|
|
720
|
+
document.removeEventListener("pointerdown", outside, true);
|
|
721
|
+
document.removeEventListener("focusin", outside);
|
|
722
|
+
s.root.removeEventListener("keydown", escape);
|
|
723
|
+
window.removeEventListener("resize", reposition);
|
|
724
|
+
document.removeEventListener("scroll", reposition, true);
|
|
725
|
+
window.visualViewport?.removeEventListener("resize", reposition);
|
|
726
|
+
window.visualViewport?.removeEventListener("scroll", reposition);
|
|
727
|
+
};
|
|
728
|
+
}
|
|
729
|
+
function update(s) {
|
|
730
|
+
const renderSignature = JSON.stringify(s.options);
|
|
731
|
+
if (s.renderSignature === renderSignature) return;
|
|
732
|
+
const active = s.isOpen ? document.activeElement : null, focusDate = active?.dataset?.date, focusId = active?.id;
|
|
733
|
+
const o = s.options;
|
|
734
|
+
s.label = String(o.Label || { DatePicker: "Date", TimePicker: "Time", DateTimePicker: "Date and time", DateRangePicker: "Date range" }[s.kind]);
|
|
735
|
+
s.locale = String(o.Locale || "en-US");
|
|
736
|
+
new Intl.DateTimeFormat(s.locale);
|
|
737
|
+
s.format = formatOptions.includes(o.DateFormat) ? o.DateFormat : "YYYY-MM-DD";
|
|
738
|
+
s.cycle = Number(o.HourCycle) === 12 ? 12 : 24;
|
|
739
|
+
s.step = Number(o.MinuteStep ?? 15);
|
|
740
|
+
if (!Number.isInteger(s.step) || s.step < 1 || s.step > 60) throw Error("MinuteStep must be a whole number from 1 to 60.");
|
|
741
|
+
s.firstDay = Number(o.FirstDayOfWeek ?? 1);
|
|
742
|
+
if (!Number.isInteger(s.firstDay) || s.firstDay < 0 || s.firstDay > 6) throw Error("FirstDayOfWeek must be 0\u20136.");
|
|
743
|
+
s.disabledDates = new Set(list(o.DisabledDatesJson ?? o.DisabledDates, "DisabledDates").map((item) => typeof item === "string" ? item : item.Date));
|
|
744
|
+
for (const d of s.disabledDates) if (!dateObject(d)) throw Error("DisabledDates must contain ISO calendar dates.");
|
|
745
|
+
for (const name of ["Min", "Max"]) if (o[name] && !(s.timeOnly ? timeValue(o[name]) : dateObject(datePart(o[name])) && (!s.dateTime || timeValue(timePart(o[name]))))) throw Error(name + " must use the documented ISO value format.");
|
|
746
|
+
if (o.Min && o.Max && o.Min > o.Max) throw Error("Min must be on or before Max.");
|
|
747
|
+
for (const field of ["MinRangeDays", "MaxRangeDays"]) if (o[field] !== void 0 && (!Number.isInteger(Number(o[field])) || Number(o[field]) < 0)) throw Error(field + " must be a non-negative whole number.");
|
|
748
|
+
if (o.MinRangeDays && o.MaxRangeDays && Number(o.MinRangeDays) > Number(o.MaxRangeDays)) throw Error("MinRangeDays must not exceed MaxRangeDays.");
|
|
749
|
+
const next = s.range ? [String(o.StartDate || ""), String(o.EndDate || "")] : [String(o.Value || "")];
|
|
750
|
+
const signature = JSON.stringify(next), changed = signature !== s.inputSignature;
|
|
751
|
+
s.inputSignature = signature;
|
|
752
|
+
if (s.range) {
|
|
753
|
+
s.start = next[0];
|
|
754
|
+
s.end = next[1];
|
|
755
|
+
} else s.value = next[0];
|
|
756
|
+
s.fields.forEach((field, index) => {
|
|
757
|
+
field.label.textContent = s.range ? s.label + (index ? " \u2014 end" : " \u2014 start") : s.dateTime ? s.label + (index ? " \u2014 time" : " \u2014 date") : s.label;
|
|
758
|
+
field.input.disabled = !!o.IsDisabled;
|
|
759
|
+
field.input.readOnly = !!o.IsReadOnly;
|
|
760
|
+
field.input.required = !!o.IsRequired;
|
|
761
|
+
field.input.placeholder = String(o.Placeholder || (s.timeOnly || s.dateTime && index ? s.cycle === 12 ? "9:00 AM" : "09:00" : s.format));
|
|
762
|
+
});
|
|
763
|
+
s.hint.textContent = s.timeOnly ? (s.cycle === 12 ? "h:mm AM/PM" : "HH:mm") + " \xB7 local time" : s.format + (s.dateTime ? " \xB7 " + (s.cycle === 12 ? "h:mm AM/PM" : "HH:mm") + " local time" : "");
|
|
764
|
+
s.title.textContent = s.label;
|
|
765
|
+
s.clearButton.disabled = !!o.IsDisabled || !!o.IsReadOnly;
|
|
766
|
+
if (changed || s.previousFormat !== s.format || s.previousCycle !== s.cycle) {
|
|
767
|
+
paintInputs(s);
|
|
768
|
+
const hasValue = next.some(Boolean);
|
|
769
|
+
setError(s, hasValue ? validate(s, s.timeOnly ? "" : s.range ? s.start : datePart(s.value), s.end || "", s.timeOnly ? s.value : timePart(s.value)) : "");
|
|
770
|
+
s.previousFormat = s.format;
|
|
771
|
+
s.previousCycle = s.cycle;
|
|
772
|
+
}
|
|
773
|
+
s.monthSelect.replaceChildren();
|
|
774
|
+
for (let m = 0; m < 12; m++) appendOption(s.monthSelect, m, new Intl.DateTimeFormat(s.locale, { month: "long" }).format(new Date(2024, m, 1)));
|
|
775
|
+
s.calendar.tHead?.remove();
|
|
776
|
+
const thead = node("thead"), tr = node("tr");
|
|
777
|
+
for (let i = 0; i < 7; i++) {
|
|
778
|
+
const d = new Date(2024, 0, 7 + (i + s.firstDay) % 7), th = node("th", "", new Intl.DateTimeFormat(s.locale, { weekday: "short" }).format(d));
|
|
779
|
+
th.scope = "col";
|
|
780
|
+
th.abbr = new Intl.DateTimeFormat(s.locale, { weekday: "long" }).format(d);
|
|
781
|
+
tr.append(th);
|
|
782
|
+
}
|
|
783
|
+
thead.append(tr);
|
|
784
|
+
s.calendar.prepend(thead);
|
|
785
|
+
s.presets.replaceChildren();
|
|
786
|
+
s.presets.hidden = !s.range;
|
|
787
|
+
if (s.range) for (const preset of list(o.PresetsJson ?? o.Presets, "Presets")) {
|
|
788
|
+
if (!preset.Label || !dateObject(preset.StartDate) || !dateObject(preset.EndDate)) throw Error("Presets need Label, StartDate and EndDate.");
|
|
789
|
+
const b = button(preset.Label, () => {
|
|
790
|
+
s.draftStart = preset.StartDate;
|
|
791
|
+
s.draftEnd = preset.EndDate;
|
|
792
|
+
s.rangeNext = "start";
|
|
793
|
+
s.focusDate = s.draftStart;
|
|
794
|
+
s.month = s.focusDate.slice(0, 7);
|
|
795
|
+
s.dialogError.textContent = "";
|
|
796
|
+
paintCalendar(s);
|
|
797
|
+
paintDraft(s);
|
|
798
|
+
});
|
|
799
|
+
b.disabled = !!validateRange(preset.StartDate, preset.EndDate, { ...o, disabled: s.disabledDates });
|
|
800
|
+
s.presets.append(b);
|
|
801
|
+
}
|
|
802
|
+
if (s.isOpen) {
|
|
803
|
+
if (o.IsDisabled || o.IsReadOnly || changed) close(s);
|
|
804
|
+
else {
|
|
805
|
+
paintCalendar(s);
|
|
806
|
+
paintTimes(s);
|
|
807
|
+
if (focusDate) s.calendar.querySelector('[data-date="' + focusDate + '"]')?.focus();
|
|
808
|
+
else if (focusId) document.getElementById(focusId)?.focus();
|
|
809
|
+
positionPopup(s);
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
s.renderSignature = renderSignature;
|
|
813
|
+
}
|
|
814
|
+
var installDateRangePicker = () => createAPI("DateRangePicker", init, update);
|
|
815
|
+
export {
|
|
816
|
+
installDateRangePicker
|
|
817
|
+
};
|