@prolibu-suite/cobalt-core 0.1.1 → 0.2.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/custom-elements.json +15359 -5571
- package/dist/cjs/co-accordion.cjs.entry.js +19 -4
- package/dist/cjs/co-app-shell.cjs.entry.js +1 -1
- package/dist/cjs/co-autocomplete.cjs.entry.js +51 -6
- package/dist/cjs/co-avatar.cjs.entry.js +40 -7
- package/dist/cjs/co-badge.cjs.entry.js +1 -1
- package/dist/cjs/co-button-group.cjs.entry.js +1 -1
- package/dist/cjs/co-button.cjs.entry.js +10 -5
- package/dist/cjs/co-calendar_3.cjs.entry.js +692 -0
- package/dist/cjs/co-card.cjs.entry.js +21 -4
- package/dist/cjs/co-checkbox-group.cjs.entry.js +7 -5
- package/dist/cjs/co-checkbox.cjs.entry.js +4 -4
- package/dist/cjs/co-chip.cjs.entry.js +3 -3
- package/dist/cjs/co-color-picker.cjs.entry.js +109 -0
- package/dist/cjs/co-column-picker.cjs.entry.js +443 -0
- package/dist/cjs/co-combobox.cjs.entry.js +51 -15
- package/dist/cjs/co-command-search.cjs.entry.js +14 -7
- package/dist/cjs/co-data-table-pagination.cjs.entry.js +5 -5
- package/dist/cjs/co-data-table.cjs.entry.js +17 -5
- package/dist/cjs/co-date-picker.cjs.entry.js +177 -0
- package/dist/cjs/co-date-range-picker.cjs.entry.js +378 -0
- package/dist/cjs/co-date-range.cjs.entry.js +13 -259
- package/dist/cjs/co-empty-state.cjs.entry.js +2 -2
- package/dist/cjs/co-fab.cjs.entry.js +3 -3
- package/dist/cjs/co-file-field.cjs.entry.js +498 -0
- package/dist/cjs/co-helper-text.cjs.entry.js +3 -3
- package/dist/cjs/co-icon-button.cjs.entry.js +4 -4
- package/dist/cjs/co-icon.cjs.entry.js +7 -4
- package/dist/cjs/co-input.cjs.entry.js +13 -8
- package/dist/cjs/co-json-field.cjs.entry.js +109 -0
- package/dist/cjs/co-lightbox.cjs.entry.js +344 -0
- package/dist/cjs/co-list-item.cjs.entry.js +14 -4
- package/dist/cjs/co-loader.cjs.entry.js +1 -1
- package/dist/cjs/co-menu-divider.cjs.entry.js +2 -2
- package/dist/cjs/co-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/co-menu.cjs.entry.js +2 -2
- package/dist/cjs/co-modal.cjs.entry.js +13 -3
- package/dist/cjs/co-navbar.cjs.entry.js +4 -4
- package/dist/cjs/co-number-field.cjs.entry.js +47 -11
- package/dist/cjs/co-overlay.cjs.entry.js +2 -2
- package/dist/cjs/co-page-header.cjs.entry.js +2 -2
- package/dist/cjs/co-phone-field.cjs.entry.js +376 -0
- package/dist/cjs/co-popover.cjs.entry.js +5 -5
- package/dist/cjs/co-progress-bar.cjs.entry.js +3 -3
- package/dist/cjs/co-progress-circle.cjs.entry.js +38 -0
- package/dist/cjs/co-radio-group.cjs.entry.js +7 -5
- package/dist/cjs/co-radio.cjs.entry.js +4 -4
- package/dist/cjs/co-rating.cjs.entry.js +4 -4
- package/dist/cjs/co-ref-field.cjs.entry.js +191 -21
- package/dist/cjs/co-rich-text-editor.cjs.entry.js +235 -0
- package/dist/cjs/co-rich-text-toolbar.cjs.entry.js +184 -0
- package/dist/cjs/co-rich-text-viewer.cjs.entry.js +82 -0
- package/dist/cjs/co-row.cjs.entry.js +3 -3
- package/dist/cjs/co-select.cjs.entry.js +119 -18
- package/dist/cjs/co-separator.cjs.entry.js +2 -2
- package/dist/cjs/co-sidebar-nav.cjs.entry.js +30 -5
- package/dist/cjs/co-sidebar.cjs.entry.js +3 -3
- package/dist/cjs/co-slider.cjs.entry.js +3 -3
- package/dist/cjs/co-switch.cjs.entry.js +9 -6
- package/dist/cjs/co-tab-group.cjs.entry.js +2 -2
- package/dist/cjs/co-tab.cjs.entry.js +3 -3
- package/dist/cjs/co-tags-field.cjs.entry.js +205 -0
- package/dist/cjs/co-textarea.cjs.entry.js +92 -0
- package/dist/cjs/co-toast.cjs.entry.js +2 -2
- package/dist/cjs/co-toggle-button-group.cjs.entry.js +7 -4
- package/dist/cjs/co-toggle-button.cjs.entry.js +4 -4
- package/dist/cjs/co-tooltip.cjs.entry.js +12 -6
- package/dist/cjs/co-transfer-list.cjs.entry.js +20 -6
- package/dist/cjs/cobalt.cjs.js +2 -2
- package/dist/cjs/dateI18n-BdiNAl0_.js +106 -0
- package/dist/cjs/dates-D8D-aS5d.js +432 -0
- package/dist/cjs/index-CaEJnpZe.js +27213 -0
- package/dist/cjs/{index-BEovErzl.js → index-DoFnrUVH.js} +79 -11
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/normalizeText-B-v-XPKf.js +96 -0
- package/dist/cjs/overlayScroll-ifzDNeyb.js +25 -0
- package/dist/cjs/overlayscrollbars-BlBHo2Xx.js +2842 -0
- package/dist/cjs/{positioning-DozpXyBd.js → positioning-DwHW399W.js} +40 -25
- package/dist/cjs/requiredMark-DA6y-4rp.js +16 -0
- package/dist/cjs/sanitizer-CjHZAkOm.js +1883 -0
- package/dist/cobalt/cobalt.css +1 -1
- package/dist/cobalt/cobalt.esm.js +1 -1
- package/dist/cobalt/{p-1021f612.entry.js → p-01fc77c4.entry.js} +1 -1
- package/dist/cobalt/p-0a6d8061.entry.js +1 -0
- package/dist/cobalt/p-0bf288cd.entry.js +1 -0
- package/dist/cobalt/p-136bdbd2.entry.js +1 -0
- package/dist/cobalt/{p-1b7d6808.entry.js → p-15708d32.entry.js} +1 -1
- package/dist/cobalt/{p-cc93ab05.entry.js → p-1578b019.entry.js} +1 -1
- package/dist/cobalt/{p-1b5c723a.entry.js → p-1e0282b8.entry.js} +1 -1
- package/dist/cobalt/p-23d48581.entry.js +1 -0
- package/dist/cobalt/p-2718ff27.entry.js +1 -0
- package/dist/cobalt/p-273afd93.entry.js +1 -0
- package/dist/cobalt/{p-c9b0e73f.entry.js → p-2b4d8535.entry.js} +1 -1
- package/dist/cobalt/p-3190d715.entry.js +1 -0
- package/dist/cobalt/p-3f9b3fcb.entry.js +1 -0
- package/dist/cobalt/p-41228dce.entry.js +1 -0
- package/dist/cobalt/{p-5a13e3a0.entry.js → p-44672953.entry.js} +1 -1
- package/dist/cobalt/{p-4cf6d1f4.entry.js → p-522fcdb7.entry.js} +1 -1
- package/dist/cobalt/p-53ce9023.entry.js +1 -0
- package/dist/cobalt/{p-4d8ff00a.entry.js → p-54f26e95.entry.js} +1 -1
- package/dist/cobalt/p-5d01bd4d.entry.js +1 -0
- package/dist/cobalt/p-5e7141aa.entry.js +1 -0
- package/dist/cobalt/p-5f905739.entry.js +1 -0
- package/dist/cobalt/{p-fb047df8.entry.js → p-6404bd21.entry.js} +1 -1
- package/dist/cobalt/p-654bbc2a.entry.js +1 -0
- package/dist/cobalt/p-6678ac0a.entry.js +1 -0
- package/dist/cobalt/{p-e808916c.entry.js → p-66a912dd.entry.js} +1 -1
- package/dist/cobalt/p-6759ee1c.entry.js +1 -0
- package/dist/cobalt/p-69a40bfd.entry.js +1 -0
- package/dist/cobalt/p-6a6a62cb.entry.js +1 -0
- package/dist/cobalt/p-6d43b6cd.entry.js +1 -0
- package/dist/cobalt/p-759c3dd0.entry.js +1 -0
- package/dist/cobalt/p-782f729f.entry.js +1 -0
- package/dist/cobalt/{p-ebd1555e.entry.js → p-7ef766c6.entry.js} +1 -1
- package/dist/cobalt/p-7f818368.entry.js +1 -0
- package/dist/cobalt/p-83b89bf8.entry.js +1 -0
- package/dist/cobalt/p-88dc561a.entry.js +1 -0
- package/dist/cobalt/{p-4905b51d.entry.js → p-8c27aff7.entry.js} +1 -1
- package/dist/cobalt/{p-a7fa4484.entry.js → p-95d14878.entry.js} +1 -1
- package/dist/cobalt/{p-1d7da33f.entry.js → p-97c20011.entry.js} +1 -1
- package/dist/cobalt/p-996179f7.entry.js +1 -0
- package/dist/cobalt/p-9c533830.entry.js +1 -0
- package/dist/cobalt/p-9d89bf47.entry.js +1 -0
- package/dist/cobalt/p-BKmfyPZK.js +2 -0
- package/dist/cobalt/p-BchB6Hdr.js +1 -0
- package/dist/cobalt/p-C1DCLOEl.js +1 -0
- package/dist/cobalt/p-C2mZ7x_Y.js +1 -0
- package/dist/cobalt/p-CQY6Ul7q.js +1 -0
- package/dist/cobalt/p-CyYF8IJE.js +1 -0
- package/dist/cobalt/p-DcK0GGZC.js +2 -0
- package/dist/cobalt/p-DqyWGweA.js +1 -0
- package/dist/cobalt/p-Qqq8fysz.js +1 -0
- package/dist/cobalt/p-aa17c70b.entry.js +1 -0
- package/dist/cobalt/{p-416bb5ae.entry.js → p-aa63812a.entry.js} +1 -1
- package/dist/cobalt/p-ad4c1b41.entry.js +1 -0
- package/dist/cobalt/p-ae4d3207.entry.js +1 -0
- package/dist/cobalt/p-af64da37.entry.js +1 -0
- package/dist/cobalt/p-b758c2e6.entry.js +1 -0
- package/dist/cobalt/p-bb07da22.entry.js +1 -0
- package/dist/cobalt/p-beb9c11d.entry.js +1 -0
- package/dist/cobalt/p-c6a242e4.entry.js +1 -0
- package/dist/cobalt/p-c87285b6.entry.js +1 -0
- package/dist/cobalt/p-cd57e8b4.entry.js +1 -0
- package/dist/cobalt/{p-4ffba5a3.entry.js → p-ce3a535f.entry.js} +1 -1
- package/dist/cobalt/p-d17e1444.entry.js +1 -0
- package/dist/cobalt/p-d958566a.entry.js +1 -0
- package/dist/cobalt/p-dd873bf8.entry.js +1 -0
- package/dist/cobalt/p-def448e4.entry.js +1 -0
- package/dist/cobalt/p-e4de8865.entry.js +1 -0
- package/dist/cobalt/{p-3b2f7959.entry.js → p-e8b58332.entry.js} +1 -1
- package/dist/cobalt/p-eba0bf7f.entry.js +1 -0
- package/dist/cobalt/p-f0e8fa7d.entry.js +1 -0
- package/dist/cobalt/{p-e50c4c6f.entry.js → p-f2c5cb74.entry.js} +1 -1
- package/dist/cobalt/p-f8728b21.entry.js +1 -0
- package/dist/cobalt/{p-697df797.entry.js → p-f97ad9ad.entry.js} +1 -1
- package/dist/cobalt/p-fad3605d.entry.js +1 -0
- package/dist/cobalt/{p-319937c3.entry.js → p-fe9e85b6.entry.js} +1 -1
- package/dist/cobalt/p-ff2690e5.entry.js +1 -0
- package/dist/cobalt/p-ox7HzCZn.js +10 -0
- package/dist/collection/collection-manifest.json +17 -1
- package/dist/collection/components/co-accordion/co-accordion.css +19 -1
- package/dist/collection/components/co-accordion/co-accordion.js +46 -4
- package/dist/collection/components/co-autocomplete/co-autocomplete.css +725 -7
- package/dist/collection/components/co-autocomplete/co-autocomplete.js +88 -4
- package/dist/collection/components/co-avatar/co-avatar.css +7 -0
- package/dist/collection/components/co-avatar/co-avatar.js +35 -6
- package/dist/collection/components/co-button/co-button.css +8 -5
- package/dist/collection/components/co-button/co-button.js +46 -3
- package/dist/collection/components/co-calendar/co-calendar.css +236 -0
- package/dist/collection/components/co-calendar/co-calendar.js +728 -0
- package/dist/collection/components/co-card/co-card.css +28 -5
- package/dist/collection/components/co-card/co-card.js +47 -4
- package/dist/collection/components/co-checkbox/co-checkbox.js +3 -3
- package/dist/collection/components/co-checkbox-group/co-checkbox-group.css +26 -0
- package/dist/collection/components/co-checkbox-group/co-checkbox-group.js +25 -3
- package/dist/collection/components/co-chip/co-chip.js +2 -2
- package/dist/collection/components/co-color-picker/co-color-picker.css +224 -0
- package/dist/collection/components/co-color-picker/co-color-picker.js +333 -0
- package/dist/collection/components/co-color-picker/presets.js +19 -0
- package/dist/collection/components/co-column-picker/co-column-picker.css +490 -0
- package/dist/collection/components/co-column-picker/co-column-picker.js +675 -0
- package/dist/collection/components/co-column-picker/column-picker-node.js +34 -0
- package/dist/collection/components/co-column-picker/utils/column-picker-tree.js +221 -0
- package/dist/collection/components/co-combobox/co-combobox.css +789 -22
- package/dist/collection/components/co-combobox/co-combobox.js +130 -15
- package/dist/collection/components/co-command-search/co-command-search.css +4 -0
- package/dist/collection/components/co-command-search/co-command-search.js +12 -5
- package/dist/collection/components/co-data-table/co-data-table.css +1 -1
- package/dist/collection/components/co-data-table/co-data-table.js +15 -3
- package/dist/collection/components/co-data-table-pagination/co-data-table-pagination.js +4 -4
- package/dist/collection/components/co-date-field/co-date-field.css +239 -0
- package/dist/collection/components/co-date-field/co-date-field.js +746 -0
- package/dist/collection/components/co-date-picker/co-date-picker.css +112 -0
- package/dist/collection/components/co-date-picker/co-date-picker.js +801 -0
- package/dist/collection/components/co-date-range/co-date-range.css +3 -254
- package/dist/collection/components/co-date-range/co-date-range.js +29 -433
- package/dist/collection/components/co-date-range-picker/co-date-range-picker.css +251 -0
- package/dist/collection/components/co-date-range-picker/co-date-range-picker.js +1142 -0
- package/dist/collection/components/co-drawer/co-drawer.css +19 -0
- package/dist/collection/components/co-drawer/co-drawer.js +46 -2
- package/dist/collection/components/co-empty-state/co-empty-state.js +1 -1
- package/dist/collection/components/co-fab/co-fab.js +2 -2
- package/dist/collection/components/co-file-field/co-file-field.css +389 -0
- package/dist/collection/components/co-file-field/co-file-field.js +841 -0
- package/dist/collection/components/co-file-field/co-file-field.utils.js +47 -0
- package/dist/collection/components/co-helper-text/co-helper-text.js +2 -2
- package/dist/collection/components/co-icon/co-icon.js +6 -3
- package/dist/collection/components/co-icon-button/co-icon-button.css +10 -0
- package/dist/collection/components/co-icon-button/co-icon-button.js +4 -4
- package/dist/collection/components/co-input/co-input.css +56 -10
- package/dist/collection/components/co-input/co-input.js +34 -9
- package/dist/collection/components/co-json-field/co-json-field.css +169 -0
- package/dist/collection/components/co-json-field/co-json-field.js +453 -0
- package/dist/collection/components/co-lightbox/co-lightbox.css +164 -0
- package/dist/collection/components/co-lightbox/co-lightbox.js +451 -0
- package/dist/collection/components/co-list-item/co-list-item.css +5 -0
- package/dist/collection/components/co-list-item/co-list-item.js +12 -2
- package/dist/collection/components/co-menu/co-menu.js +1 -1
- package/dist/collection/components/co-menu-divider/co-menu-divider.js +1 -1
- package/dist/collection/components/co-modal/co-modal.css +17 -3
- package/dist/collection/components/co-modal/co-modal.js +51 -1
- package/dist/collection/components/co-navbar/co-navbar.css +1 -1
- package/dist/collection/components/co-navbar/co-navbar.js +2 -2
- package/dist/collection/components/co-number-field/co-number-field.css +70 -0
- package/dist/collection/components/co-number-field/co-number-field.js +143 -13
- package/dist/collection/components/co-overlay/co-overlay.js +1 -1
- package/dist/collection/components/co-page-header/co-page-header.js +1 -1
- package/dist/collection/components/co-phone-field/co-phone-field.css +265 -0
- package/dist/collection/components/co-phone-field/co-phone-field.js +392 -0
- package/dist/collection/components/co-phone-field/dial-codes.js +208 -0
- package/dist/collection/components/co-popover/co-popover.css +1 -1
- package/dist/collection/components/co-popover/co-popover.js +2 -2
- package/dist/collection/components/co-progress-bar/co-progress-bar.js +2 -2
- package/dist/collection/components/co-progress-circle/co-progress-circle.css +50 -0
- package/dist/collection/components/co-progress-circle/co-progress-circle.js +148 -0
- package/dist/collection/components/co-radio/co-radio.js +3 -3
- package/dist/collection/components/co-radio-group/co-radio-group.css +26 -0
- package/dist/collection/components/co-radio-group/co-radio-group.js +25 -3
- package/dist/collection/components/co-rating/co-rating.js +3 -3
- package/dist/collection/components/co-ref-field/co-ref-field.css +816 -54
- package/dist/collection/components/co-ref-field/co-ref-field.js +0 -0
- package/dist/collection/components/co-rich-text-editor/co-rich-text-editor.css +238 -0
- package/dist/collection/components/co-rich-text-editor/co-rich-text-editor.js +868 -0
- package/dist/collection/components/co-rich-text-toolbar/co-rich-text-toolbar.css +55 -0
- package/dist/collection/components/co-rich-text-toolbar/co-rich-text-toolbar.js +289 -0
- package/dist/collection/components/co-rich-text-viewer/co-rich-text-viewer.css +78 -0
- package/dist/collection/components/co-rich-text-viewer/co-rich-text-viewer.js +232 -0
- package/dist/collection/components/co-row/co-row.js +2 -2
- package/dist/collection/components/co-select/co-select.css +845 -7
- package/dist/collection/components/co-select/co-select.js +240 -17
- package/dist/collection/components/co-separator/co-separator.js +1 -1
- package/dist/collection/components/co-sidebar/co-sidebar.js +2 -2
- package/dist/collection/components/co-sidebar-nav/co-sidebar-nav.js +29 -4
- package/dist/collection/components/co-slider/co-slider.js +2 -2
- package/dist/collection/components/co-switch/co-switch.css +17 -0
- package/dist/collection/components/co-switch/co-switch.js +27 -4
- package/dist/collection/components/co-tab/co-tab.js +2 -2
- package/dist/collection/components/co-tab-group/co-tab-group.js +1 -1
- package/dist/collection/components/co-tags-field/co-tags-field.css +272 -0
- package/dist/collection/components/co-tags-field/co-tags-field.js +590 -0
- package/dist/collection/components/co-textarea/co-textarea.css +261 -0
- package/dist/collection/components/co-textarea/co-textarea.js +484 -0
- package/dist/collection/components/co-toast/co-toast.js +1 -1
- package/dist/collection/components/co-toggle-button/co-toggle-button.css +6 -4
- package/dist/collection/components/co-toggle-button/co-toggle-button.js +2 -2
- package/dist/collection/components/co-toggle-button-group/co-toggle-button-group.css +16 -0
- package/dist/collection/components/co-toggle-button-group/co-toggle-button-group.js +25 -2
- package/dist/collection/components/co-tooltip/co-tooltip.css +16 -0
- package/dist/collection/components/co-tooltip/co-tooltip.js +9 -3
- package/dist/collection/components/co-transfer-list/co-transfer-list.css +683 -7
- package/dist/collection/components/co-transfer-list/co-transfer-list.js +17 -4
- package/dist/collection/utils/dateI18n.js +101 -0
- package/dist/collection/utils/fileI18n.js +76 -0
- package/dist/collection/utils/icon-config.js +22 -0
- package/dist/collection/utils/lightboxI18n.js +42 -0
- package/dist/collection/utils/normalizeText.js +94 -0
- package/dist/collection/utils/overlayScroll.js +20 -0
- package/dist/collection/utils/positioning.js +40 -25
- package/dist/collection/utils/requiredMark.js +11 -0
- package/dist/components/co-accordion.js +1 -1
- package/dist/components/co-autocomplete.js +1 -1
- package/dist/components/co-avatar.js +1 -1
- package/dist/components/co-button.js +1 -1
- package/dist/components/co-calendar.d.ts +11 -0
- package/dist/components/co-calendar.js +1 -0
- package/dist/components/co-card.js +1 -1
- package/dist/components/co-checkbox-group.js +1 -1
- package/dist/components/co-checkbox.js +1 -1
- package/dist/components/co-chip.js +1 -1
- package/dist/components/co-color-picker.d.ts +11 -0
- package/dist/components/co-color-picker.js +1 -0
- package/dist/components/co-column-picker.d.ts +11 -0
- package/dist/components/co-column-picker.js +1 -0
- package/dist/components/co-combobox.js +1 -1
- package/dist/components/co-command-search.js +1 -1
- package/dist/components/co-data-table-pagination.js +1 -1
- package/dist/components/co-data-table.js +1 -1
- package/dist/components/co-date-field.d.ts +11 -0
- package/dist/components/co-date-field.js +1 -0
- package/dist/components/co-date-picker.d.ts +11 -0
- package/dist/components/co-date-picker.js +1 -0
- package/dist/components/co-date-range-picker.d.ts +11 -0
- package/dist/components/co-date-range-picker.js +1 -0
- package/dist/components/co-date-range.js +1 -1
- package/dist/components/co-drawer.js +1 -1
- package/dist/components/co-empty-state.js +1 -1
- package/dist/components/co-fab.js +1 -1
- package/dist/components/co-file-field.d.ts +11 -0
- package/dist/components/co-file-field.js +1 -0
- package/dist/components/co-helper-text.js +1 -1
- package/dist/components/co-icon-button.js +1 -1
- package/dist/components/co-icon.js +1 -1
- package/dist/components/co-input.js +1 -1
- package/dist/components/co-json-field.d.ts +11 -0
- package/dist/components/co-json-field.js +1 -0
- package/dist/components/co-lightbox.d.ts +11 -0
- package/dist/components/co-lightbox.js +1 -0
- package/dist/components/co-list-item.js +1 -1
- package/dist/components/co-menu-divider.js +1 -1
- package/dist/components/co-menu-item.js +1 -1
- package/dist/components/co-menu.js +1 -1
- package/dist/components/co-modal.js +1 -1
- package/dist/components/co-navbar.js +1 -1
- package/dist/components/co-number-field.js +1 -1
- package/dist/components/co-overlay.js +1 -1
- package/dist/components/co-page-header.js +1 -1
- package/dist/components/co-phone-field.d.ts +11 -0
- package/dist/components/co-phone-field.js +1 -0
- package/dist/components/co-popover.js +1 -1
- package/dist/components/co-progress-bar.js +1 -1
- package/dist/components/co-progress-circle.d.ts +11 -0
- package/dist/components/co-progress-circle.js +1 -0
- package/dist/components/co-radio-group.js +1 -1
- package/dist/components/co-radio.js +1 -1
- package/dist/components/co-rating.js +1 -1
- package/dist/components/co-ref-field.js +1 -1
- package/dist/components/co-rich-text-editor.d.ts +11 -0
- package/dist/components/co-rich-text-editor.js +1 -0
- package/dist/components/co-rich-text-toolbar.d.ts +11 -0
- package/dist/components/co-rich-text-toolbar.js +1 -0
- package/dist/components/co-rich-text-viewer.d.ts +11 -0
- package/dist/components/co-rich-text-viewer.js +1 -0
- package/dist/components/co-row.js +1 -1
- package/dist/components/co-select.js +1 -1
- package/dist/components/co-separator.js +1 -1
- package/dist/components/co-sidebar-nav.js +1 -1
- package/dist/components/co-sidebar.js +1 -1
- package/dist/components/co-slider.js +1 -1
- package/dist/components/co-switch.js +1 -1
- package/dist/components/co-tab-group.js +1 -1
- package/dist/components/co-tab.js +1 -1
- package/dist/components/co-tags-field.d.ts +11 -0
- package/dist/components/co-tags-field.js +1 -0
- package/dist/components/co-textarea.d.ts +11 -0
- package/dist/components/co-textarea.js +1 -0
- package/dist/components/co-toast.js +1 -1
- package/dist/components/co-toggle-button-group.js +1 -1
- package/dist/components/co-toggle-button.js +1 -1
- package/dist/components/co-tooltip.js +1 -1
- package/dist/components/co-transfer-list.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-Dv_iMPy0.js → p-BXdfh__-.js} +1 -1
- package/dist/components/p-BchB6Hdr.js +1 -0
- package/dist/components/p-BeWXpX8I.js +1 -0
- package/dist/components/p-BiW0ubLs.js +1 -0
- package/dist/components/p-C1DCLOEl.js +1 -0
- package/dist/components/p-C2mZ7x_Y.js +1 -0
- package/dist/components/p-C9tHLXKS.js +1 -0
- package/dist/components/p-CQY6Ul7q.js +1 -0
- package/dist/components/p-CWneqh4n.js +1 -0
- package/dist/components/{p-B18FTYLq.js → p-CaMgu2_g.js} +1 -1
- package/dist/components/p-CyYF8IJE.js +1 -0
- package/dist/components/p-DBhNS7JD.js +1 -0
- package/dist/components/p-DObrQi5F.js +1 -0
- package/dist/components/p-DPi_U-Kl.js +1 -0
- package/dist/components/p-DcK0GGZC.js +2 -0
- package/dist/components/p-DqyWGweA.js +1 -0
- package/dist/components/{p-cpdUXBiS.js → p-MiSJXuBx.js} +1 -1
- package/dist/components/p-Sgn-2g8m.js +1 -0
- package/dist/components/{p-Cr8Yc0zj.js → p-jDjfGZJp.js} +1 -1
- package/dist/components/p-o8hrDIKe.js +1 -0
- package/dist/components/p-ox7HzCZn.js +10 -0
- package/dist/esm/co-accordion.entry.js +19 -4
- package/dist/esm/co-app-shell.entry.js +1 -1
- package/dist/esm/co-autocomplete.entry.js +51 -6
- package/dist/esm/co-avatar.entry.js +39 -6
- package/dist/esm/co-badge.entry.js +1 -1
- package/dist/esm/co-button-group.entry.js +1 -1
- package/dist/esm/co-button.entry.js +10 -5
- package/dist/esm/co-calendar_3.entry.js +688 -0
- package/dist/esm/co-card.entry.js +21 -4
- package/dist/esm/co-checkbox-group.entry.js +7 -5
- package/dist/esm/co-checkbox.entry.js +4 -4
- package/dist/esm/co-chip.entry.js +3 -3
- package/dist/esm/co-color-picker.entry.js +107 -0
- package/dist/esm/co-column-picker.entry.js +441 -0
- package/dist/esm/co-combobox.entry.js +51 -15
- package/dist/esm/co-command-search.entry.js +14 -7
- package/dist/esm/co-data-table-pagination.entry.js +5 -5
- package/dist/esm/co-data-table.entry.js +17 -5
- package/dist/esm/co-date-picker.entry.js +175 -0
- package/dist/esm/co-date-range-picker.entry.js +376 -0
- package/dist/esm/co-date-range.entry.js +13 -259
- package/dist/esm/co-empty-state.entry.js +2 -2
- package/dist/esm/co-fab.entry.js +3 -3
- package/dist/esm/co-file-field.entry.js +496 -0
- package/dist/esm/co-helper-text.entry.js +3 -3
- package/dist/esm/co-icon-button.entry.js +4 -4
- package/dist/esm/co-icon.entry.js +7 -4
- package/dist/esm/co-input.entry.js +13 -8
- package/dist/esm/co-json-field.entry.js +107 -0
- package/dist/esm/co-lightbox.entry.js +342 -0
- package/dist/esm/co-list-item.entry.js +14 -4
- package/dist/esm/co-loader.entry.js +1 -1
- package/dist/esm/co-menu-divider.entry.js +2 -2
- package/dist/esm/co-menu-item.entry.js +1 -1
- package/dist/esm/co-menu.entry.js +2 -2
- package/dist/esm/co-modal.entry.js +13 -3
- package/dist/esm/co-navbar.entry.js +4 -4
- package/dist/esm/co-number-field.entry.js +47 -11
- package/dist/esm/co-overlay.entry.js +2 -2
- package/dist/esm/co-page-header.entry.js +2 -2
- package/dist/esm/co-phone-field.entry.js +374 -0
- package/dist/esm/co-popover.entry.js +5 -5
- package/dist/esm/co-progress-bar.entry.js +3 -3
- package/dist/esm/co-progress-circle.entry.js +36 -0
- package/dist/esm/co-radio-group.entry.js +7 -5
- package/dist/esm/co-radio.entry.js +4 -4
- package/dist/esm/co-rating.entry.js +4 -4
- package/dist/esm/co-ref-field.entry.js +191 -21
- package/dist/esm/co-rich-text-editor.entry.js +233 -0
- package/dist/esm/co-rich-text-toolbar.entry.js +182 -0
- package/dist/esm/co-rich-text-viewer.entry.js +80 -0
- package/dist/esm/co-row.entry.js +3 -3
- package/dist/esm/co-select.entry.js +119 -18
- package/dist/esm/co-separator.entry.js +2 -2
- package/dist/esm/co-sidebar-nav.entry.js +30 -5
- package/dist/esm/co-sidebar.entry.js +3 -3
- package/dist/esm/co-slider.entry.js +3 -3
- package/dist/esm/co-switch.entry.js +9 -6
- package/dist/esm/co-tab-group.entry.js +2 -2
- package/dist/esm/co-tab.entry.js +3 -3
- package/dist/esm/co-tags-field.entry.js +203 -0
- package/dist/esm/co-textarea.entry.js +90 -0
- package/dist/esm/co-toast.entry.js +2 -2
- package/dist/esm/co-toggle-button-group.entry.js +7 -4
- package/dist/esm/co-toggle-button.entry.js +4 -4
- package/dist/esm/co-tooltip.entry.js +12 -6
- package/dist/esm/co-transfer-list.entry.js +20 -6
- package/dist/esm/cobalt.js +3 -3
- package/dist/esm/dateI18n-C1DCLOEl.js +103 -0
- package/dist/esm/dates-CyYF8IJE.js +416 -0
- package/dist/esm/{index-B0lqrhFo.js → index-BKmfyPZK.js} +79 -11
- package/dist/esm/index-BjAqSidM.js +27200 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/normalizeText-CQY6Ul7q.js +92 -0
- package/dist/esm/overlayScroll-Bpv882_z.js +23 -0
- package/dist/esm/overlayscrollbars-ox7HzCZn.js +2840 -0
- package/dist/esm/{positioning-Am-OlB8h.js → positioning-C2mZ7x_Y.js} +40 -25
- package/dist/esm/requiredMark-DFvtYtkE.js +14 -0
- package/dist/esm/sanitizer-DcK0GGZC.js +1880 -0
- package/dist/types/components/co-accordion/co-accordion.d.ts +12 -2
- package/dist/types/components/co-autocomplete/co-autocomplete.d.ts +11 -0
- package/dist/types/components/co-avatar/co-avatar.d.ts +6 -2
- package/dist/types/components/co-button/co-button.d.ts +4 -0
- package/dist/types/components/co-calendar/co-calendar.d.ts +108 -0
- package/dist/types/components/co-card/co-card.d.ts +10 -2
- package/dist/types/components/co-checkbox-group/co-checkbox-group.d.ts +2 -0
- package/dist/types/components/co-color-picker/co-color-picker.d.ts +48 -0
- package/dist/types/components/co-color-picker/presets.d.ts +10 -0
- package/dist/types/components/co-column-picker/co-column-picker.d.ts +60 -0
- package/dist/types/components/co-column-picker/column-picker-node.d.ts +18 -0
- package/dist/types/components/co-column-picker/utils/column-picker-tree.d.ts +37 -0
- package/dist/types/components/co-combobox/co-combobox.d.ts +14 -1
- package/dist/types/components/co-command-search/co-command-search.d.ts +2 -0
- package/dist/types/components/co-data-table/co-data-table.d.ts +1 -0
- package/dist/types/components/co-date-field/co-date-field.d.ts +96 -0
- package/dist/types/components/co-date-picker/co-date-picker.d.ts +92 -0
- package/dist/types/components/co-date-range/co-date-range.d.ts +12 -50
- package/dist/types/components/co-date-range-picker/co-date-range-picker.d.ts +112 -0
- package/dist/types/components/co-drawer/co-drawer.d.ts +4 -0
- package/dist/types/components/co-file-field/co-file-field.d.ts +146 -0
- package/dist/types/components/co-file-field/co-file-field.utils.d.ts +18 -0
- package/dist/types/components/co-icon-button/co-icon-button.d.ts +1 -1
- package/dist/types/components/co-input/co-input.d.ts +4 -1
- package/dist/types/components/co-json-field/co-json-field.d.ts +66 -0
- package/dist/types/components/co-lightbox/co-lightbox.d.ts +95 -0
- package/dist/types/components/co-list-item/co-list-item.d.ts +1 -0
- package/dist/types/components/co-modal/co-modal.d.ts +4 -0
- package/dist/types/components/co-number-field/co-number-field.d.ts +16 -2
- package/dist/types/components/co-phone-field/co-phone-field.d.ts +56 -0
- package/dist/types/components/co-phone-field/dial-codes.d.ts +14 -0
- package/dist/types/components/co-progress-circle/co-progress-circle.d.ts +16 -0
- package/dist/types/components/co-radio-group/co-radio-group.d.ts +2 -0
- package/dist/types/components/co-ref-field/co-ref-field.d.ts +54 -1
- package/dist/types/components/co-rich-text-editor/co-rich-text-editor.d.ts +94 -0
- package/dist/types/components/co-rich-text-toolbar/co-rich-text-toolbar.d.ts +42 -0
- package/dist/types/components/co-rich-text-viewer/co-rich-text-viewer.d.ts +32 -0
- package/dist/types/components/co-select/co-select.d.ts +31 -1
- package/dist/types/components/co-switch/co-switch.d.ts +2 -0
- package/dist/types/components/co-tags-field/co-tags-field.d.ts +82 -0
- package/dist/types/components/co-textarea/co-textarea.d.ts +65 -0
- package/dist/types/components/co-toggle-button-group/co-toggle-button-group.d.ts +2 -0
- package/dist/types/components/co-transfer-list/co-transfer-list.d.ts +4 -0
- package/dist/types/components.d.ts +3796 -422
- package/dist/types/utils/dateI18n.d.ts +39 -0
- package/dist/types/utils/fileI18n.d.ts +34 -0
- package/dist/types/utils/icon-config.d.ts +20 -0
- package/dist/types/utils/lightboxI18n.d.ts +12 -0
- package/dist/types/utils/normalizeText.d.ts +41 -0
- package/dist/types/utils/overlayScroll.d.ts +17 -0
- package/dist/types/utils/positioning.d.ts +7 -14
- package/dist/types/utils/requiredMark.d.ts +13 -0
- package/package.json +9 -1
- package/dist/cjs/co-drawer.cjs.entry.js +0 -75
- package/dist/cjs/color-YhUkm10t.js +0 -32
- package/dist/cobalt/p-08afdc51.entry.js +0 -1
- package/dist/cobalt/p-1d3338b6.entry.js +0 -1
- package/dist/cobalt/p-230a23f3.entry.js +0 -1
- package/dist/cobalt/p-31bc842d.entry.js +0 -1
- package/dist/cobalt/p-37c1f700.entry.js +0 -1
- package/dist/cobalt/p-4ce98a64.entry.js +0 -1
- package/dist/cobalt/p-4dd7499c.entry.js +0 -1
- package/dist/cobalt/p-4e7ce8ee.entry.js +0 -1
- package/dist/cobalt/p-6793c51e.entry.js +0 -1
- package/dist/cobalt/p-689e38b3.entry.js +0 -1
- package/dist/cobalt/p-7028880b.entry.js +0 -1
- package/dist/cobalt/p-72113ec2.entry.js +0 -1
- package/dist/cobalt/p-8e54e74d.entry.js +0 -1
- package/dist/cobalt/p-92c39eed.entry.js +0 -1
- package/dist/cobalt/p-9887b828.entry.js +0 -1
- package/dist/cobalt/p-9a5c6600.entry.js +0 -1
- package/dist/cobalt/p-Am-OlB8h.js +0 -1
- package/dist/cobalt/p-B0lqrhFo.js +0 -2
- package/dist/cobalt/p-BG4WRR22.js +0 -1
- package/dist/cobalt/p-a1b248ad.entry.js +0 -1
- package/dist/cobalt/p-a470b764.entry.js +0 -1
- package/dist/cobalt/p-a477d23a.entry.js +0 -1
- package/dist/cobalt/p-a4d55b1a.entry.js +0 -1
- package/dist/cobalt/p-b6840df4.entry.js +0 -1
- package/dist/cobalt/p-b89d54d9.entry.js +0 -1
- package/dist/cobalt/p-ba84631a.entry.js +0 -1
- package/dist/cobalt/p-c7517f86.entry.js +0 -1
- package/dist/cobalt/p-ca41eec2.entry.js +0 -1
- package/dist/cobalt/p-d29c77cb.entry.js +0 -1
- package/dist/cobalt/p-d9d8b10e.entry.js +0 -1
- package/dist/cobalt/p-da55678f.entry.js +0 -1
- package/dist/cobalt/p-dc5598d1.entry.js +0 -1
- package/dist/cobalt/p-e2c9cb00.entry.js +0 -1
- package/dist/cobalt/p-ebd68f56.entry.js +0 -1
- package/dist/cobalt/p-f051f44d.entry.js +0 -1
- package/dist/cobalt/p-fe1447a3.entry.js +0 -1
- package/dist/components/p-Am-OlB8h.js +0 -1
- package/dist/components/p-BG4WRR22.js +0 -1
- package/dist/components/p-wwWquAtm.js +0 -1
- package/dist/esm/co-drawer.entry.js +0 -73
- package/dist/esm/color-BG4WRR22.js +0 -30
|
@@ -0,0 +1,728 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { addDays, addMonths, compareYMD, getFullDateLabel, getMonthLabel, getMonthMatrix, getWeekdayLabels, isDisabled, isValidYMD, parseISO, startOfMonth, todayYMD, } from "@prolibu-suite/cobalt-date-utils";
|
|
3
|
+
import { getDateStrings } from "../../utils/dateI18n";
|
|
4
|
+
/**
|
|
5
|
+
* Accessible month calendar (single-date selection).
|
|
6
|
+
*
|
|
7
|
+
* Presentation + interaction only: it renders the month grid, handles month
|
|
8
|
+
* navigation and full keyboard support (WAI-ARIA grid pattern, roving
|
|
9
|
+
* tabindex), and distinguishes `today` from `selected`. It holds NO popover and
|
|
10
|
+
* NO text input — `co-date-picker` composes it with `co-date-field` + a popover.
|
|
11
|
+
*
|
|
12
|
+
* Value contract: date-only strings "YYYY-MM-DD". Emits `coSelect` with the
|
|
13
|
+
* chosen date. Today and selected are deliberately different visual states.
|
|
14
|
+
*
|
|
15
|
+
* @part root - The calendar container
|
|
16
|
+
* @part header - Month navigation header
|
|
17
|
+
* @part grid - The day grid
|
|
18
|
+
*/
|
|
19
|
+
export class CoCalendar {
|
|
20
|
+
constructor() {
|
|
21
|
+
/** Selection mode. */
|
|
22
|
+
this.mode = 'single';
|
|
23
|
+
/** BCP-47 locale used for month/weekday labels. */
|
|
24
|
+
this.locale = 'es-CO';
|
|
25
|
+
/** First day of the week: 0=Sunday .. 6=Saturday. Default 1 (Monday). */
|
|
26
|
+
this.firstDayOfWeek = 1;
|
|
27
|
+
/** Hovered day for range preview (range mode, pointer only). */
|
|
28
|
+
this.hoverDay = null;
|
|
29
|
+
/** Header view: day grid, month picker, or year picker. */
|
|
30
|
+
this.view = 'days';
|
|
31
|
+
/** When set, focus the matching day cell after the next render. */
|
|
32
|
+
this.shouldFocusGrid = false;
|
|
33
|
+
this.handleDayHover = (day) => {
|
|
34
|
+
if (this.mode === 'range')
|
|
35
|
+
this.hoverDay = day;
|
|
36
|
+
};
|
|
37
|
+
/** Header prev/next — steps by month (days), year (months) or decade (years). */
|
|
38
|
+
this.handlePrev = () => this.step(-1);
|
|
39
|
+
this.handleNext = () => this.step(1);
|
|
40
|
+
/** Title click zooms out: days → months → years; years → back to days. */
|
|
41
|
+
this.toggleView = () => {
|
|
42
|
+
this.view = this.view === 'days' ? 'months' : this.view === 'months' ? 'years' : 'days';
|
|
43
|
+
};
|
|
44
|
+
this.handleGridKeyDown = (e) => {
|
|
45
|
+
const cur = this.focused;
|
|
46
|
+
let handled = true;
|
|
47
|
+
switch (e.key) {
|
|
48
|
+
case 'ArrowLeft':
|
|
49
|
+
this.moveFocus(addDays(cur, -1));
|
|
50
|
+
break;
|
|
51
|
+
case 'ArrowRight':
|
|
52
|
+
this.moveFocus(addDays(cur, 1));
|
|
53
|
+
break;
|
|
54
|
+
case 'ArrowUp':
|
|
55
|
+
this.moveFocus(addDays(cur, -7));
|
|
56
|
+
break;
|
|
57
|
+
case 'ArrowDown':
|
|
58
|
+
this.moveFocus(addDays(cur, 7));
|
|
59
|
+
break;
|
|
60
|
+
case 'Home':
|
|
61
|
+
this.moveFocus(startOfWeek(cur, this.firstDayOfWeek));
|
|
62
|
+
break;
|
|
63
|
+
case 'End':
|
|
64
|
+
this.moveFocus(addDays(startOfWeek(cur, this.firstDayOfWeek), 6));
|
|
65
|
+
break;
|
|
66
|
+
case 'PageUp':
|
|
67
|
+
this.moveFocus(addMonths(cur, e.shiftKey ? -12 : -1));
|
|
68
|
+
break;
|
|
69
|
+
case 'PageDown':
|
|
70
|
+
this.moveFocus(addMonths(cur, e.shiftKey ? 12 : 1));
|
|
71
|
+
break;
|
|
72
|
+
case 'Enter':
|
|
73
|
+
case ' ':
|
|
74
|
+
this.selectDay(cur);
|
|
75
|
+
break;
|
|
76
|
+
default:
|
|
77
|
+
handled = false;
|
|
78
|
+
}
|
|
79
|
+
if (handled) {
|
|
80
|
+
// Stop Enter/Space from reaching an enclosing <form> and submitting,
|
|
81
|
+
// and stop arrows from scrolling the page.
|
|
82
|
+
e.preventDefault();
|
|
83
|
+
e.stopPropagation();
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
componentWillLoad() {
|
|
88
|
+
var _a;
|
|
89
|
+
const anchor = (_a = this.anchorValue) !== null && _a !== void 0 ? _a : todayYMD();
|
|
90
|
+
const a = parseISO(anchor);
|
|
91
|
+
this.viewYear = a.year;
|
|
92
|
+
this.viewMonth = a.month;
|
|
93
|
+
this.focused = this.initialFocus();
|
|
94
|
+
}
|
|
95
|
+
onValueChange() {
|
|
96
|
+
if (!this.selectedValue)
|
|
97
|
+
return;
|
|
98
|
+
const a = parseISO(this.selectedValue);
|
|
99
|
+
this.viewYear = a.year;
|
|
100
|
+
this.viewMonth = a.month;
|
|
101
|
+
this.focused = this.selectedValue;
|
|
102
|
+
}
|
|
103
|
+
/** Move keyboard focus into the grid (used by the picker when the popover opens). */
|
|
104
|
+
async focusGrid() {
|
|
105
|
+
this.shouldFocusGrid = true;
|
|
106
|
+
this.focusFocusedCell();
|
|
107
|
+
}
|
|
108
|
+
get selectedValue() {
|
|
109
|
+
return isValidYMD(this.value) ? this.value : null;
|
|
110
|
+
}
|
|
111
|
+
get rangeStartV() {
|
|
112
|
+
return isValidYMD(this.rangeStart) ? this.rangeStart : null;
|
|
113
|
+
}
|
|
114
|
+
get rangeEndV() {
|
|
115
|
+
return isValidYMD(this.rangeEnd) ? this.rangeEnd : null;
|
|
116
|
+
}
|
|
117
|
+
/** The date the grid should anchor on / focus first. */
|
|
118
|
+
get anchorValue() {
|
|
119
|
+
return this.mode === 'range' ? this.rangeStartV : this.selectedValue;
|
|
120
|
+
}
|
|
121
|
+
get disabledOpts() {
|
|
122
|
+
return {
|
|
123
|
+
min: this.min,
|
|
124
|
+
max: this.max,
|
|
125
|
+
disabledDates: normalizeStringArray(this.disabledDates),
|
|
126
|
+
disabledDaysOfWeek: normalizeNumberArray(this.disabledDaysOfWeek),
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
isDayDisabled(value) {
|
|
130
|
+
return isDisabled(value, this.disabledOpts);
|
|
131
|
+
}
|
|
132
|
+
/** Best initial focus: selected/start → today → first enabled day of view → 1st. */
|
|
133
|
+
initialFocus() {
|
|
134
|
+
const anchor = this.anchorValue;
|
|
135
|
+
if (anchor && !this.isDayDisabled(anchor))
|
|
136
|
+
return anchor;
|
|
137
|
+
const today = todayYMD();
|
|
138
|
+
const t = parseISO(today);
|
|
139
|
+
if (t.year === this.viewYear && t.month === this.viewMonth && !this.isDayDisabled(today)) {
|
|
140
|
+
return today;
|
|
141
|
+
}
|
|
142
|
+
const first = `${String(this.viewYear).padStart(4, '0')}-${String(this.viewMonth).padStart(2, '0')}-01`;
|
|
143
|
+
let cur = first;
|
|
144
|
+
for (let i = 0; i < 31; i++) {
|
|
145
|
+
const d = parseISO(cur);
|
|
146
|
+
if (!d || d.month !== this.viewMonth)
|
|
147
|
+
break;
|
|
148
|
+
if (!this.isDayDisabled(cur))
|
|
149
|
+
return cur;
|
|
150
|
+
cur = addDays(cur, 1);
|
|
151
|
+
}
|
|
152
|
+
return first;
|
|
153
|
+
}
|
|
154
|
+
selectDay(value) {
|
|
155
|
+
if (this.isDayDisabled(value))
|
|
156
|
+
return;
|
|
157
|
+
this.focused = value;
|
|
158
|
+
if (this.mode === 'range') {
|
|
159
|
+
this.selectRangeDay(value);
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
this.coSelect.emit(value);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Range click model (controlled by rangeStart/rangeEnd):
|
|
167
|
+
* - no start, or both set → start = day, end = null
|
|
168
|
+
* - start set, no end → second click sets end (swaps if before start)
|
|
169
|
+
*/
|
|
170
|
+
selectRangeDay(day) {
|
|
171
|
+
const start = this.rangeStartV;
|
|
172
|
+
const end = this.rangeEndV;
|
|
173
|
+
let next;
|
|
174
|
+
if (!start || (start && end)) {
|
|
175
|
+
next = { start: day, end: null };
|
|
176
|
+
}
|
|
177
|
+
else if (compareYMD(day, start) < 0) {
|
|
178
|
+
next = { start: day, end: start };
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
next = { start, end: day };
|
|
182
|
+
}
|
|
183
|
+
this.coRangeSelect.emit(next);
|
|
184
|
+
}
|
|
185
|
+
moveFocus(next) {
|
|
186
|
+
this.focused = next;
|
|
187
|
+
const n = parseISO(next);
|
|
188
|
+
if (n.year !== this.viewYear || n.month !== this.viewMonth) {
|
|
189
|
+
this.viewYear = n.year;
|
|
190
|
+
this.viewMonth = n.month;
|
|
191
|
+
}
|
|
192
|
+
this.shouldFocusGrid = true;
|
|
193
|
+
}
|
|
194
|
+
step(dir) {
|
|
195
|
+
if (this.view === 'days') {
|
|
196
|
+
const m = addMonths(`${this.viewYear}-${String(this.viewMonth).padStart(2, '0')}-01`, dir);
|
|
197
|
+
const p = parseISO(m);
|
|
198
|
+
this.viewYear = p.year;
|
|
199
|
+
this.viewMonth = p.month;
|
|
200
|
+
}
|
|
201
|
+
else if (this.view === 'months') {
|
|
202
|
+
this.viewYear += dir;
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
this.viewYear += dir * 10;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
selectMonth(month) {
|
|
209
|
+
this.viewMonth = month;
|
|
210
|
+
this.view = 'days';
|
|
211
|
+
}
|
|
212
|
+
selectYear(year) {
|
|
213
|
+
this.viewYear = year;
|
|
214
|
+
this.view = 'months';
|
|
215
|
+
}
|
|
216
|
+
get decadeStart() {
|
|
217
|
+
return Math.floor(this.viewYear / 10) * 10;
|
|
218
|
+
}
|
|
219
|
+
/** {year, month} of the active selection (single value or range start). */
|
|
220
|
+
get selectedYM() {
|
|
221
|
+
const v = this.mode === 'range' ? this.rangeStartV : this.selectedValue;
|
|
222
|
+
if (!v)
|
|
223
|
+
return null;
|
|
224
|
+
const ymd = parseISO(v);
|
|
225
|
+
return { year: ymd.year, month: ymd.month };
|
|
226
|
+
}
|
|
227
|
+
isMonthDisabled(year, month) {
|
|
228
|
+
const first = `${String(year).padStart(4, '0')}-${String(month).padStart(2, '0')}-01`;
|
|
229
|
+
const last = addDays(startOfMonth(addMonths(first, 1)), -1);
|
|
230
|
+
if (this.min && compareYMD(last, this.min) < 0)
|
|
231
|
+
return true;
|
|
232
|
+
if (this.max && compareYMD(first, this.max) > 0)
|
|
233
|
+
return true;
|
|
234
|
+
return false;
|
|
235
|
+
}
|
|
236
|
+
isYearDisabled(year) {
|
|
237
|
+
const first = `${String(year).padStart(4, '0')}-01-01`;
|
|
238
|
+
const last = `${String(year).padStart(4, '0')}-12-31`;
|
|
239
|
+
if (this.min && compareYMD(last, this.min) < 0)
|
|
240
|
+
return true;
|
|
241
|
+
if (this.max && compareYMD(first, this.max) > 0)
|
|
242
|
+
return true;
|
|
243
|
+
return false;
|
|
244
|
+
}
|
|
245
|
+
componentDidRender() {
|
|
246
|
+
if (this.shouldFocusGrid) {
|
|
247
|
+
this.shouldFocusGrid = false;
|
|
248
|
+
this.focusFocusedCell();
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
focusFocusedCell() {
|
|
252
|
+
var _a;
|
|
253
|
+
const cell = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(`[data-date="${this.focused}"]`);
|
|
254
|
+
cell === null || cell === void 0 ? void 0 : cell.focus();
|
|
255
|
+
}
|
|
256
|
+
/** Range endpoint/in-range flags for a cell, accounting for hover preview. */
|
|
257
|
+
rangeFlags(value) {
|
|
258
|
+
const start = this.rangeStartV;
|
|
259
|
+
const end = this.rangeEndV;
|
|
260
|
+
if (!start)
|
|
261
|
+
return { isStart: false, isEnd: false, inRange: false };
|
|
262
|
+
const previewTarget = end !== null && end !== void 0 ? end : (this.hoverDay && !end ? this.hoverDay : null);
|
|
263
|
+
if (!previewTarget) {
|
|
264
|
+
return { isStart: compareYMD(value, start) === 0, isEnd: false, inRange: false };
|
|
265
|
+
}
|
|
266
|
+
const lo = compareYMD(start, previewTarget) <= 0 ? start : previewTarget;
|
|
267
|
+
const hi = compareYMD(start, previewTarget) <= 0 ? previewTarget : start;
|
|
268
|
+
return {
|
|
269
|
+
isStart: compareYMD(value, lo) === 0,
|
|
270
|
+
isEnd: compareYMD(value, hi) === 0,
|
|
271
|
+
inRange: compareYMD(value, lo) > 0 && compareYMD(value, hi) < 0,
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
dayClass(value, inMonth, disabled) {
|
|
275
|
+
const isToday = compareYMD(value, todayYMD()) === 0;
|
|
276
|
+
if (this.mode === 'range') {
|
|
277
|
+
const { isStart, isEnd, inRange } = this.rangeFlags(value);
|
|
278
|
+
const isEndpoint = isStart || isEnd;
|
|
279
|
+
return {
|
|
280
|
+
'co-calendar__day': true,
|
|
281
|
+
'co-calendar__day--outside': !inMonth,
|
|
282
|
+
'co-calendar__day--today': isToday && !isEndpoint && !inRange,
|
|
283
|
+
'co-calendar__day--range-start': isStart,
|
|
284
|
+
'co-calendar__day--range-end': isEnd,
|
|
285
|
+
'co-calendar__day--in-range': inRange,
|
|
286
|
+
'co-calendar__day--disabled': disabled,
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
const selected = this.selectedValue;
|
|
290
|
+
const isSelected = !!selected && compareYMD(value, selected) === 0;
|
|
291
|
+
return {
|
|
292
|
+
'co-calendar__day': true,
|
|
293
|
+
'co-calendar__day--outside': !inMonth,
|
|
294
|
+
'co-calendar__day--today': isToday && !isSelected,
|
|
295
|
+
'co-calendar__day--selected': isSelected,
|
|
296
|
+
'co-calendar__day--disabled': disabled,
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
headerTitle() {
|
|
300
|
+
if (this.view === 'months')
|
|
301
|
+
return String(this.viewYear);
|
|
302
|
+
if (this.view === 'years')
|
|
303
|
+
return `${this.decadeStart}–${this.decadeStart + 9}`;
|
|
304
|
+
return getMonthLabel(this.viewYear, this.viewMonth, this.locale, 'long');
|
|
305
|
+
}
|
|
306
|
+
renderDays(t) {
|
|
307
|
+
const monthLabel = getMonthLabel(this.viewYear, this.viewMonth, this.locale, 'long');
|
|
308
|
+
const shortLabels = getWeekdayLabels(this.locale, this.firstDayOfWeek, 'short');
|
|
309
|
+
const longLabels = getWeekdayLabels(this.locale, this.firstDayOfWeek, 'long');
|
|
310
|
+
const matrix = getMonthMatrix(this.viewYear, this.viewMonth, this.firstDayOfWeek);
|
|
311
|
+
return (h("div", { class: "co-calendar__grid", part: "grid", role: "grid", "aria-label": monthLabel, onKeyDown: this.handleGridKeyDown }, h("div", { class: "co-calendar__row co-calendar__row--dow", role: "row" }, shortLabels.map((lbl, i) => (h("span", { class: "co-calendar__dow", role: "columnheader", "aria-label": longLabels[i] }, lbl)))), matrix.map((week) => (h("div", { class: "co-calendar__row", role: "row" }, week.map((cell) => {
|
|
312
|
+
const disabled = this.isDayDisabled(cell.value);
|
|
313
|
+
const isFocused = compareYMD(cell.value, this.focused) === 0;
|
|
314
|
+
const isToday = compareYMD(cell.value, todayYMD()) === 0;
|
|
315
|
+
let isSelectedAria;
|
|
316
|
+
if (this.mode === 'range') {
|
|
317
|
+
const { isStart, isEnd } = this.rangeFlags(cell.value);
|
|
318
|
+
isSelectedAria = isStart || isEnd;
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
const selected = this.selectedValue;
|
|
322
|
+
isSelectedAria = !!selected && compareYMD(cell.value, selected) === 0;
|
|
323
|
+
}
|
|
324
|
+
const dayNum = parseISO(cell.value).day;
|
|
325
|
+
return (h("button", { type: "button", role: "gridcell", "data-date": cell.value, class: this.dayClass(cell.value, cell.inMonth, disabled), tabIndex: isFocused ? 0 : -1, "aria-selected": isSelectedAria ? 'true' : 'false', "aria-current": isToday ? 'date' : undefined, "aria-disabled": disabled ? 'true' : undefined, "aria-label": getFullDateLabel(cell.value, this.locale), onClick: () => this.selectDay(cell.value), onMouseEnter: () => this.handleDayHover(cell.value), onMouseLeave: () => this.handleDayHover(null) }, dayNum));
|
|
326
|
+
}))))));
|
|
327
|
+
}
|
|
328
|
+
renderMonths() {
|
|
329
|
+
const sel = this.selectedYM;
|
|
330
|
+
const now = new Date();
|
|
331
|
+
return (h("div", { class: "co-calendar__panel", part: "grid" }, Array.from({ length: 12 }, (_, i) => {
|
|
332
|
+
const month = i + 1;
|
|
333
|
+
const name = new Intl.DateTimeFormat(this.locale, { month: 'short' }).format(new Date(this.viewYear, i, 1));
|
|
334
|
+
const disabled = this.isMonthDisabled(this.viewYear, month);
|
|
335
|
+
const isSelected = !!sel && sel.year === this.viewYear && sel.month === month;
|
|
336
|
+
const isCurrent = now.getFullYear() === this.viewYear && now.getMonth() === i;
|
|
337
|
+
return (h("button", { type: "button", class: {
|
|
338
|
+
'co-calendar__cell': true,
|
|
339
|
+
'co-calendar__cell--selected': isSelected,
|
|
340
|
+
'co-calendar__cell--today': isCurrent && !isSelected,
|
|
341
|
+
'co-calendar__cell--disabled': disabled,
|
|
342
|
+
}, disabled: disabled, "aria-current": isCurrent ? 'date' : undefined, onClick: () => this.selectMonth(month) }, name));
|
|
343
|
+
})));
|
|
344
|
+
}
|
|
345
|
+
renderYears() {
|
|
346
|
+
const sel = this.selectedYM;
|
|
347
|
+
const nowYear = new Date().getFullYear();
|
|
348
|
+
const start = this.decadeStart - 1;
|
|
349
|
+
return (h("div", { class: "co-calendar__panel", part: "grid" }, Array.from({ length: 12 }, (_, i) => {
|
|
350
|
+
const year = start + i;
|
|
351
|
+
const disabled = this.isYearDisabled(year);
|
|
352
|
+
const isSelected = !!sel && sel.year === year;
|
|
353
|
+
const isCurrent = nowYear === year;
|
|
354
|
+
return (h("button", { type: "button", class: {
|
|
355
|
+
'co-calendar__cell': true,
|
|
356
|
+
'co-calendar__cell--muted': year < this.decadeStart || year > this.decadeStart + 9,
|
|
357
|
+
'co-calendar__cell--selected': isSelected,
|
|
358
|
+
'co-calendar__cell--today': isCurrent && !isSelected,
|
|
359
|
+
'co-calendar__cell--disabled': disabled,
|
|
360
|
+
}, disabled: disabled, "aria-current": isCurrent ? 'date' : undefined, onClick: () => this.selectYear(year) }, year));
|
|
361
|
+
})));
|
|
362
|
+
}
|
|
363
|
+
render() {
|
|
364
|
+
var _a, _b;
|
|
365
|
+
const t = getDateStrings(this.locale);
|
|
366
|
+
return (h("div", { key: '38278f3489400b035c01cfcdb5e5afbcc5000b21', class: "co-calendar", part: "root" }, h("div", { key: '0bcd5c42678b1057fb327853cacad03a8b49cdd1', class: "co-calendar__header", part: "header" }, h("button", { key: '6e7210ea64062171c0f94f463251e6373c01c348', type: "button", class: "co-calendar__nav", onClick: this.handlePrev, "aria-label": (_a = this.prevMonthLabel) !== null && _a !== void 0 ? _a : t.prevMonth }, h("co-icon", { key: '053ff755d082dae52d5cce4b0338f795d56829b7', name: "caret-left", size: 16 })), h("button", { key: '70af310b739b910e850715ac626430c1a30e3479', type: "button", class: "co-calendar__title", "aria-live": "polite", onClick: this.toggleView }, this.headerTitle(), h("co-icon", { key: 'b06bc1fb2aa4c8c31e53fa68eebade370d8026f9', name: "caret-down", size: 12, class: "co-calendar__title-caret" })), h("button", { key: '0eee7bed8085c2d3fd495f8b4152b359c3e246ad', type: "button", class: "co-calendar__nav", onClick: this.handleNext, "aria-label": (_b = this.nextMonthLabel) !== null && _b !== void 0 ? _b : t.nextMonth }, h("co-icon", { key: 'ffc4ff19f0ba3e69cb6b04a2888bc2a093f090be', name: "caret-right", size: 16 }))), this.view === 'days' && this.renderDays(t), this.view === 'months' && this.renderMonths(), this.view === 'years' && this.renderYears()));
|
|
367
|
+
}
|
|
368
|
+
static get is() { return "co-calendar"; }
|
|
369
|
+
static get encapsulation() { return "shadow"; }
|
|
370
|
+
static get originalStyleUrls() {
|
|
371
|
+
return {
|
|
372
|
+
"$": ["co-calendar.css"]
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
static get styleUrls() {
|
|
376
|
+
return {
|
|
377
|
+
"$": ["co-calendar.css"]
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
static get properties() {
|
|
381
|
+
return {
|
|
382
|
+
"mode": {
|
|
383
|
+
"type": "string",
|
|
384
|
+
"mutable": false,
|
|
385
|
+
"complexType": {
|
|
386
|
+
"original": "'single' | 'range'",
|
|
387
|
+
"resolved": "\"range\" | \"single\"",
|
|
388
|
+
"references": {}
|
|
389
|
+
},
|
|
390
|
+
"required": false,
|
|
391
|
+
"optional": false,
|
|
392
|
+
"docs": {
|
|
393
|
+
"tags": [],
|
|
394
|
+
"text": "Selection mode."
|
|
395
|
+
},
|
|
396
|
+
"getter": false,
|
|
397
|
+
"setter": false,
|
|
398
|
+
"reflect": false,
|
|
399
|
+
"attribute": "mode",
|
|
400
|
+
"defaultValue": "'single'"
|
|
401
|
+
},
|
|
402
|
+
"value": {
|
|
403
|
+
"type": "string",
|
|
404
|
+
"mutable": false,
|
|
405
|
+
"complexType": {
|
|
406
|
+
"original": "string | null",
|
|
407
|
+
"resolved": "null | string | undefined",
|
|
408
|
+
"references": {}
|
|
409
|
+
},
|
|
410
|
+
"required": false,
|
|
411
|
+
"optional": true,
|
|
412
|
+
"docs": {
|
|
413
|
+
"tags": [],
|
|
414
|
+
"text": "Currently selected date (single mode), \"YYYY-MM-DD\" or null/empty."
|
|
415
|
+
},
|
|
416
|
+
"getter": false,
|
|
417
|
+
"setter": false,
|
|
418
|
+
"reflect": false,
|
|
419
|
+
"attribute": "value"
|
|
420
|
+
},
|
|
421
|
+
"rangeStart": {
|
|
422
|
+
"type": "string",
|
|
423
|
+
"mutable": false,
|
|
424
|
+
"complexType": {
|
|
425
|
+
"original": "string | null",
|
|
426
|
+
"resolved": "null | string | undefined",
|
|
427
|
+
"references": {}
|
|
428
|
+
},
|
|
429
|
+
"required": false,
|
|
430
|
+
"optional": true,
|
|
431
|
+
"docs": {
|
|
432
|
+
"tags": [],
|
|
433
|
+
"text": "Range start (range mode), \"YYYY-MM-DD\" or null."
|
|
434
|
+
},
|
|
435
|
+
"getter": false,
|
|
436
|
+
"setter": false,
|
|
437
|
+
"reflect": false,
|
|
438
|
+
"attribute": "range-start"
|
|
439
|
+
},
|
|
440
|
+
"rangeEnd": {
|
|
441
|
+
"type": "string",
|
|
442
|
+
"mutable": false,
|
|
443
|
+
"complexType": {
|
|
444
|
+
"original": "string | null",
|
|
445
|
+
"resolved": "null | string | undefined",
|
|
446
|
+
"references": {}
|
|
447
|
+
},
|
|
448
|
+
"required": false,
|
|
449
|
+
"optional": true,
|
|
450
|
+
"docs": {
|
|
451
|
+
"tags": [],
|
|
452
|
+
"text": "Range end (range mode), \"YYYY-MM-DD\" or null."
|
|
453
|
+
},
|
|
454
|
+
"getter": false,
|
|
455
|
+
"setter": false,
|
|
456
|
+
"reflect": false,
|
|
457
|
+
"attribute": "range-end"
|
|
458
|
+
},
|
|
459
|
+
"min": {
|
|
460
|
+
"type": "string",
|
|
461
|
+
"mutable": false,
|
|
462
|
+
"complexType": {
|
|
463
|
+
"original": "string",
|
|
464
|
+
"resolved": "string | undefined",
|
|
465
|
+
"references": {}
|
|
466
|
+
},
|
|
467
|
+
"required": false,
|
|
468
|
+
"optional": true,
|
|
469
|
+
"docs": {
|
|
470
|
+
"tags": [],
|
|
471
|
+
"text": "Earliest selectable date, \"YYYY-MM-DD\"."
|
|
472
|
+
},
|
|
473
|
+
"getter": false,
|
|
474
|
+
"setter": false,
|
|
475
|
+
"reflect": false,
|
|
476
|
+
"attribute": "min"
|
|
477
|
+
},
|
|
478
|
+
"max": {
|
|
479
|
+
"type": "string",
|
|
480
|
+
"mutable": false,
|
|
481
|
+
"complexType": {
|
|
482
|
+
"original": "string",
|
|
483
|
+
"resolved": "string | undefined",
|
|
484
|
+
"references": {}
|
|
485
|
+
},
|
|
486
|
+
"required": false,
|
|
487
|
+
"optional": true,
|
|
488
|
+
"docs": {
|
|
489
|
+
"tags": [],
|
|
490
|
+
"text": "Latest selectable date, \"YYYY-MM-DD\"."
|
|
491
|
+
},
|
|
492
|
+
"getter": false,
|
|
493
|
+
"setter": false,
|
|
494
|
+
"reflect": false,
|
|
495
|
+
"attribute": "max"
|
|
496
|
+
},
|
|
497
|
+
"disabledDates": {
|
|
498
|
+
"type": "string",
|
|
499
|
+
"mutable": false,
|
|
500
|
+
"complexType": {
|
|
501
|
+
"original": "string[] | string",
|
|
502
|
+
"resolved": "string | string[] | undefined",
|
|
503
|
+
"references": {}
|
|
504
|
+
},
|
|
505
|
+
"required": false,
|
|
506
|
+
"optional": true,
|
|
507
|
+
"docs": {
|
|
508
|
+
"tags": [],
|
|
509
|
+
"text": "Blocked dates. Accepts a string[] or a JSON/comma string for raw-HTML use."
|
|
510
|
+
},
|
|
511
|
+
"getter": false,
|
|
512
|
+
"setter": false,
|
|
513
|
+
"reflect": false,
|
|
514
|
+
"attribute": "disabled-dates"
|
|
515
|
+
},
|
|
516
|
+
"disabledDaysOfWeek": {
|
|
517
|
+
"type": "string",
|
|
518
|
+
"mutable": false,
|
|
519
|
+
"complexType": {
|
|
520
|
+
"original": "number[] | string",
|
|
521
|
+
"resolved": "number[] | string | undefined",
|
|
522
|
+
"references": {}
|
|
523
|
+
},
|
|
524
|
+
"required": false,
|
|
525
|
+
"optional": true,
|
|
526
|
+
"docs": {
|
|
527
|
+
"tags": [],
|
|
528
|
+
"text": "Blocked weekdays (0=Sun..6=Sat). Accepts number[] or a JSON/comma string."
|
|
529
|
+
},
|
|
530
|
+
"getter": false,
|
|
531
|
+
"setter": false,
|
|
532
|
+
"reflect": false,
|
|
533
|
+
"attribute": "disabled-days-of-week"
|
|
534
|
+
},
|
|
535
|
+
"locale": {
|
|
536
|
+
"type": "string",
|
|
537
|
+
"mutable": false,
|
|
538
|
+
"complexType": {
|
|
539
|
+
"original": "string",
|
|
540
|
+
"resolved": "string",
|
|
541
|
+
"references": {}
|
|
542
|
+
},
|
|
543
|
+
"required": false,
|
|
544
|
+
"optional": false,
|
|
545
|
+
"docs": {
|
|
546
|
+
"tags": [],
|
|
547
|
+
"text": "BCP-47 locale used for month/weekday labels."
|
|
548
|
+
},
|
|
549
|
+
"getter": false,
|
|
550
|
+
"setter": false,
|
|
551
|
+
"reflect": false,
|
|
552
|
+
"attribute": "locale",
|
|
553
|
+
"defaultValue": "'es-CO'"
|
|
554
|
+
},
|
|
555
|
+
"firstDayOfWeek": {
|
|
556
|
+
"type": "number",
|
|
557
|
+
"mutable": false,
|
|
558
|
+
"complexType": {
|
|
559
|
+
"original": "number",
|
|
560
|
+
"resolved": "number",
|
|
561
|
+
"references": {}
|
|
562
|
+
},
|
|
563
|
+
"required": false,
|
|
564
|
+
"optional": false,
|
|
565
|
+
"docs": {
|
|
566
|
+
"tags": [],
|
|
567
|
+
"text": "First day of the week: 0=Sunday .. 6=Saturday. Default 1 (Monday)."
|
|
568
|
+
},
|
|
569
|
+
"getter": false,
|
|
570
|
+
"setter": false,
|
|
571
|
+
"reflect": false,
|
|
572
|
+
"attribute": "first-day-of-week",
|
|
573
|
+
"defaultValue": "1"
|
|
574
|
+
},
|
|
575
|
+
"prevMonthLabel": {
|
|
576
|
+
"type": "string",
|
|
577
|
+
"mutable": false,
|
|
578
|
+
"complexType": {
|
|
579
|
+
"original": "string",
|
|
580
|
+
"resolved": "string | undefined",
|
|
581
|
+
"references": {}
|
|
582
|
+
},
|
|
583
|
+
"required": false,
|
|
584
|
+
"optional": true,
|
|
585
|
+
"docs": {
|
|
586
|
+
"tags": [],
|
|
587
|
+
"text": "Override the \"previous month\" button aria-label (defaults from `locale`)."
|
|
588
|
+
},
|
|
589
|
+
"getter": false,
|
|
590
|
+
"setter": false,
|
|
591
|
+
"reflect": false,
|
|
592
|
+
"attribute": "prev-month-label"
|
|
593
|
+
},
|
|
594
|
+
"nextMonthLabel": {
|
|
595
|
+
"type": "string",
|
|
596
|
+
"mutable": false,
|
|
597
|
+
"complexType": {
|
|
598
|
+
"original": "string",
|
|
599
|
+
"resolved": "string | undefined",
|
|
600
|
+
"references": {}
|
|
601
|
+
},
|
|
602
|
+
"required": false,
|
|
603
|
+
"optional": true,
|
|
604
|
+
"docs": {
|
|
605
|
+
"tags": [],
|
|
606
|
+
"text": "Override the \"next month\" button aria-label (defaults from `locale`)."
|
|
607
|
+
},
|
|
608
|
+
"getter": false,
|
|
609
|
+
"setter": false,
|
|
610
|
+
"reflect": false,
|
|
611
|
+
"attribute": "next-month-label"
|
|
612
|
+
}
|
|
613
|
+
};
|
|
614
|
+
}
|
|
615
|
+
static get states() {
|
|
616
|
+
return {
|
|
617
|
+
"viewYear": {},
|
|
618
|
+
"viewMonth": {},
|
|
619
|
+
"focused": {},
|
|
620
|
+
"hoverDay": {},
|
|
621
|
+
"view": {}
|
|
622
|
+
};
|
|
623
|
+
}
|
|
624
|
+
static get events() {
|
|
625
|
+
return [{
|
|
626
|
+
"method": "coSelect",
|
|
627
|
+
"name": "coSelect",
|
|
628
|
+
"bubbles": true,
|
|
629
|
+
"cancelable": true,
|
|
630
|
+
"composed": true,
|
|
631
|
+
"docs": {
|
|
632
|
+
"tags": [],
|
|
633
|
+
"text": "Emitted when the user selects a day (single mode). Detail = \"YYYY-MM-DD\"."
|
|
634
|
+
},
|
|
635
|
+
"complexType": {
|
|
636
|
+
"original": "string",
|
|
637
|
+
"resolved": "string",
|
|
638
|
+
"references": {}
|
|
639
|
+
}
|
|
640
|
+
}, {
|
|
641
|
+
"method": "coRangeSelect",
|
|
642
|
+
"name": "coRangeSelect",
|
|
643
|
+
"bubbles": true,
|
|
644
|
+
"cancelable": true,
|
|
645
|
+
"composed": true,
|
|
646
|
+
"docs": {
|
|
647
|
+
"tags": [],
|
|
648
|
+
"text": "Emitted on each range edit (range mode) with the draft endpoints."
|
|
649
|
+
},
|
|
650
|
+
"complexType": {
|
|
651
|
+
"original": "{ start: string | null; end: string | null }",
|
|
652
|
+
"resolved": "{ start: string | null; end: string | null; }",
|
|
653
|
+
"references": {}
|
|
654
|
+
}
|
|
655
|
+
}];
|
|
656
|
+
}
|
|
657
|
+
static get methods() {
|
|
658
|
+
return {
|
|
659
|
+
"focusGrid": {
|
|
660
|
+
"complexType": {
|
|
661
|
+
"signature": "() => Promise<void>",
|
|
662
|
+
"parameters": [],
|
|
663
|
+
"references": {
|
|
664
|
+
"Promise": {
|
|
665
|
+
"location": "global",
|
|
666
|
+
"id": "global::Promise"
|
|
667
|
+
}
|
|
668
|
+
},
|
|
669
|
+
"return": "Promise<void>"
|
|
670
|
+
},
|
|
671
|
+
"docs": {
|
|
672
|
+
"text": "Move keyboard focus into the grid (used by the picker when the popover opens).",
|
|
673
|
+
"tags": []
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
};
|
|
677
|
+
}
|
|
678
|
+
static get elementRef() { return "el"; }
|
|
679
|
+
static get watchers() {
|
|
680
|
+
return [{
|
|
681
|
+
"propName": "value",
|
|
682
|
+
"methodName": "onValueChange"
|
|
683
|
+
}];
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
/** Monday-first (or configurable) start-of-week for a date. */
|
|
687
|
+
function startOfWeek(value, firstDayOfWeek) {
|
|
688
|
+
const ymd = parseISO(value);
|
|
689
|
+
if (!ymd)
|
|
690
|
+
return value;
|
|
691
|
+
const dow = new Date(ymd.year, ymd.month - 1, ymd.day).getDay();
|
|
692
|
+
const back = (dow - firstDayOfWeek + 7) % 7;
|
|
693
|
+
return addDays(value, -back);
|
|
694
|
+
}
|
|
695
|
+
function normalizeStringArray(v) {
|
|
696
|
+
if (Array.isArray(v))
|
|
697
|
+
return v;
|
|
698
|
+
if (typeof v === 'string' && v.trim()) {
|
|
699
|
+
const t = v.trim();
|
|
700
|
+
try {
|
|
701
|
+
const parsed = JSON.parse(t);
|
|
702
|
+
if (Array.isArray(parsed))
|
|
703
|
+
return parsed.map(String);
|
|
704
|
+
}
|
|
705
|
+
catch (_a) {
|
|
706
|
+
/* not JSON — fall back to comma-split */
|
|
707
|
+
}
|
|
708
|
+
return t.split(',').map((s) => s.trim()).filter(Boolean);
|
|
709
|
+
}
|
|
710
|
+
return [];
|
|
711
|
+
}
|
|
712
|
+
function normalizeNumberArray(v) {
|
|
713
|
+
if (Array.isArray(v))
|
|
714
|
+
return v;
|
|
715
|
+
if (typeof v === 'string' && v.trim()) {
|
|
716
|
+
const t = v.trim();
|
|
717
|
+
try {
|
|
718
|
+
const parsed = JSON.parse(t);
|
|
719
|
+
if (Array.isArray(parsed))
|
|
720
|
+
return parsed.map(Number).filter((n) => !Number.isNaN(n));
|
|
721
|
+
}
|
|
722
|
+
catch (_a) {
|
|
723
|
+
/* not JSON */
|
|
724
|
+
}
|
|
725
|
+
return t.split(',').map((s) => Number(s.trim())).filter((n) => !Number.isNaN(n));
|
|
726
|
+
}
|
|
727
|
+
return [];
|
|
728
|
+
}
|