@prolibu-suite/cobalt-core 0.1.2 → 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 +4 -4
- 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-ff6a647c.entry.js → p-0bf288cd.entry.js} +1 -1
- 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 +788 -21
- 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.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-FBICWTuN.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 +4 -4
- 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-1d91ec93.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-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-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
|
@@ -1,286 +1,39 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* with optional preset chips + a single-month calendar.
|
|
3
|
+
* @deprecated Use `<co-date-range-picker>` instead.
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* - hover over a day with `from` set → previews the range
|
|
11
|
-
*
|
|
12
|
-
* `value` is a JSON string `{"from":"YYYY-MM-DD","to":"YYYY-MM-DD"}` (or empty
|
|
13
|
-
* for unset) so it survives JSX attribute serialization. `coChange` fires
|
|
14
|
-
* with `{from, to}` only when the user clicks "Apply".
|
|
5
|
+
* Thin compatibility shim kept for one release: it renders the canonical
|
|
6
|
+
* `<co-date-range-picker>` (accessible, manual input, presets, timezone-safe)
|
|
7
|
+
* and re-emits its `coApply` as the legacy `coChange`. The legacy per-preset
|
|
8
|
+
* label props are no longer honored — preset labels now come from `locale`.
|
|
15
9
|
*/
|
|
16
10
|
export class CoDateRange {
|
|
17
11
|
constructor() {
|
|
18
|
-
/** JSON `{from,
|
|
12
|
+
/** JSON `{from,to}` or empty string. */
|
|
19
13
|
this.value = '';
|
|
20
14
|
this.label = '';
|
|
21
15
|
this.placeholder = 'Select range';
|
|
22
16
|
this.disabled = false;
|
|
23
17
|
this.clearable = true;
|
|
24
18
|
this.presets = true;
|
|
25
|
-
this.status = 'default';
|
|
26
19
|
this.helperText = '';
|
|
27
|
-
/** BCP-47 locale
|
|
20
|
+
/** BCP-47 locale. */
|
|
28
21
|
this.locale = 'es';
|
|
29
|
-
|
|
30
|
-
this.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
this.presetLast30DaysLabel = 'Last 30 days';
|
|
34
|
-
this.presetLast90DaysLabel = 'Last 90 days';
|
|
35
|
-
this.presetThisYearLabel = 'This year';
|
|
36
|
-
this.applyLabel = 'Apply';
|
|
37
|
-
this.clearLabel = 'Clear';
|
|
38
|
-
this.isOpen = false;
|
|
39
|
-
this.draftFrom = null;
|
|
40
|
-
this.draftTo = null;
|
|
41
|
-
this.hoverDay = null;
|
|
42
|
-
this.viewMonth = new Date().getMonth();
|
|
43
|
-
this.viewYear = new Date().getFullYear();
|
|
44
|
-
this.handleTriggerClick = () => {
|
|
45
|
-
if (this.disabled)
|
|
46
|
-
return;
|
|
47
|
-
this.isOpen = !this.isOpen;
|
|
48
|
-
};
|
|
49
|
-
this.handleDocumentClick = (e) => {
|
|
50
|
-
if (!this.isOpen)
|
|
51
|
-
return;
|
|
52
|
-
const path = e.composedPath();
|
|
53
|
-
if (!path.includes(this.el)) {
|
|
54
|
-
e.stopPropagation();
|
|
55
|
-
this.handleCancel();
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
this.handleCancel = () => {
|
|
59
|
-
this.isOpen = false;
|
|
60
|
-
const parsed = this.parseValue();
|
|
61
|
-
this.draftFrom = parsed.from;
|
|
62
|
-
this.draftTo = parsed.to;
|
|
63
|
-
};
|
|
64
|
-
this.handleDayClick = (day) => {
|
|
65
|
-
if (!this.draftFrom || (this.draftFrom && this.draftTo)) {
|
|
66
|
-
this.draftFrom = day;
|
|
67
|
-
this.draftTo = null;
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
if (this.draftFrom && !this.draftTo) {
|
|
71
|
-
if (day < this.draftFrom) {
|
|
72
|
-
this.draftTo = this.draftFrom;
|
|
73
|
-
this.draftFrom = day;
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
this.draftTo = day;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
this.handleDayHover = (day) => {
|
|
81
|
-
this.hoverDay = day;
|
|
82
|
-
};
|
|
83
|
-
this.handlePresetClick = (preset) => {
|
|
84
|
-
const today = new Date();
|
|
85
|
-
today.setHours(0, 0, 0, 0);
|
|
86
|
-
let from = null;
|
|
87
|
-
let to = null;
|
|
88
|
-
if (preset === 'today') {
|
|
89
|
-
from = today;
|
|
90
|
-
to = today;
|
|
91
|
-
}
|
|
92
|
-
else if (preset === 'thisWeek') {
|
|
93
|
-
const dow = today.getDay() === 0 ? 7 : today.getDay();
|
|
94
|
-
from = new Date(today);
|
|
95
|
-
from.setDate(today.getDate() - (dow - 1));
|
|
96
|
-
to = new Date(from);
|
|
97
|
-
to.setDate(from.getDate() + 6);
|
|
98
|
-
}
|
|
99
|
-
else if (preset === 'thisMonth') {
|
|
100
|
-
from = new Date(today.getFullYear(), today.getMonth(), 1);
|
|
101
|
-
to = new Date(today.getFullYear(), today.getMonth() + 1, 0);
|
|
102
|
-
}
|
|
103
|
-
else if (preset === 'last30Days') {
|
|
104
|
-
to = today;
|
|
105
|
-
from = new Date(today);
|
|
106
|
-
from.setDate(today.getDate() - 29);
|
|
107
|
-
}
|
|
108
|
-
else if (preset === 'last90Days') {
|
|
109
|
-
to = today;
|
|
110
|
-
from = new Date(today);
|
|
111
|
-
from.setDate(today.getDate() - 89);
|
|
112
|
-
}
|
|
113
|
-
else if (preset === 'thisYear') {
|
|
114
|
-
from = new Date(today.getFullYear(), 0, 1);
|
|
115
|
-
to = new Date(today.getFullYear(), 11, 31);
|
|
116
|
-
}
|
|
117
|
-
if (!from || !to)
|
|
118
|
-
return;
|
|
119
|
-
this.draftFrom = this.formatISO(from);
|
|
120
|
-
this.draftTo = this.formatISO(to);
|
|
121
|
-
this.viewYear = from.getFullYear();
|
|
122
|
-
this.viewMonth = from.getMonth();
|
|
123
|
-
};
|
|
124
|
-
this.handleApply = () => {
|
|
125
|
-
this.value = JSON.stringify({ from: this.draftFrom, to: this.draftTo });
|
|
126
|
-
this.coChange.emit({ from: this.draftFrom, to: this.draftTo });
|
|
127
|
-
this.isOpen = false;
|
|
128
|
-
};
|
|
129
|
-
this.handleClear = () => {
|
|
130
|
-
this.draftFrom = null;
|
|
131
|
-
this.draftTo = null;
|
|
132
|
-
this.value = '';
|
|
133
|
-
this.coClear.emit();
|
|
134
|
-
this.coChange.emit({ from: null, to: null });
|
|
135
|
-
this.isOpen = false;
|
|
136
|
-
};
|
|
137
|
-
this.prevMonth = () => {
|
|
138
|
-
if (this.viewMonth === 0) {
|
|
139
|
-
this.viewMonth = 11;
|
|
140
|
-
this.viewYear--;
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
this.viewMonth--;
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
this.nextMonth = () => {
|
|
147
|
-
if (this.viewMonth === 11) {
|
|
148
|
-
this.viewMonth = 0;
|
|
149
|
-
this.viewYear++;
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
this.viewMonth++;
|
|
153
|
-
}
|
|
22
|
+
this.warned = false;
|
|
23
|
+
this.handleApply = (e) => {
|
|
24
|
+
this.value = JSON.stringify(e.detail);
|
|
25
|
+
this.coChange.emit(e.detail);
|
|
154
26
|
};
|
|
155
27
|
}
|
|
156
|
-
onValueChange() {
|
|
157
|
-
const parsed = this.parseValue();
|
|
158
|
-
this.draftFrom = parsed.from;
|
|
159
|
-
this.draftTo = parsed.to;
|
|
160
|
-
}
|
|
161
|
-
componentWillLoad() {
|
|
162
|
-
const parsed = this.parseValue();
|
|
163
|
-
this.draftFrom = parsed.from;
|
|
164
|
-
this.draftTo = parsed.to;
|
|
165
|
-
if (parsed.from) {
|
|
166
|
-
const d = new Date(parsed.from);
|
|
167
|
-
this.viewMonth = d.getMonth();
|
|
168
|
-
this.viewYear = d.getFullYear();
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
28
|
connectedCallback() {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
parseValue() {
|
|
178
|
-
if (!this.value)
|
|
179
|
-
return { from: null, to: null };
|
|
180
|
-
try {
|
|
181
|
-
const v = JSON.parse(this.value);
|
|
182
|
-
return { from: v.from || null, to: v.to || null };
|
|
29
|
+
if (!this.warned) {
|
|
30
|
+
this.warned = true;
|
|
31
|
+
// eslint-disable-next-line no-console
|
|
32
|
+
console.warn('[cobalt] <co-date-range> is deprecated — use <co-date-range-picker>.');
|
|
183
33
|
}
|
|
184
|
-
catch (_a) {
|
|
185
|
-
return { from: null, to: null };
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
formatISO(d) {
|
|
189
|
-
const y = d.getFullYear();
|
|
190
|
-
const m = String(d.getMonth() + 1).padStart(2, '0');
|
|
191
|
-
const day = String(d.getDate()).padStart(2, '0');
|
|
192
|
-
return `${y}-${m}-${day}`;
|
|
193
|
-
}
|
|
194
|
-
renderTriggerLabel() {
|
|
195
|
-
if (!this.draftFrom && !this.draftTo)
|
|
196
|
-
return this.placeholder;
|
|
197
|
-
if (this.draftFrom && this.draftTo)
|
|
198
|
-
return `${this.draftFrom} → ${this.draftTo}`;
|
|
199
|
-
if (this.draftFrom)
|
|
200
|
-
return `${this.draftFrom} → …`;
|
|
201
|
-
return this.placeholder;
|
|
202
|
-
}
|
|
203
|
-
inRange(day) {
|
|
204
|
-
if (!day || !this.draftFrom)
|
|
205
|
-
return false;
|
|
206
|
-
if (this.draftFrom && this.draftTo) {
|
|
207
|
-
return day >= this.draftFrom && day <= this.draftTo;
|
|
208
|
-
}
|
|
209
|
-
if (this.draftFrom && this.hoverDay) {
|
|
210
|
-
const start = this.draftFrom < this.hoverDay ? this.draftFrom : this.hoverDay;
|
|
211
|
-
const end = this.draftFrom < this.hoverDay ? this.hoverDay : this.draftFrom;
|
|
212
|
-
return day >= start && day <= end;
|
|
213
|
-
}
|
|
214
|
-
return false;
|
|
215
|
-
}
|
|
216
|
-
renderCalendar() {
|
|
217
|
-
const monthName = new Intl.DateTimeFormat(this.locale, { month: 'long', year: 'numeric' })
|
|
218
|
-
.format(new Date(this.viewYear, this.viewMonth, 1));
|
|
219
|
-
const firstDay = new Date(this.viewYear, this.viewMonth, 1);
|
|
220
|
-
// Monday-first grid
|
|
221
|
-
const startDow = firstDay.getDay() === 0 ? 6 : firstDay.getDay() - 1;
|
|
222
|
-
const lastDay = new Date(this.viewYear, this.viewMonth + 1, 0).getDate();
|
|
223
|
-
// Day-of-week labels (Mon..Sun in the active locale).
|
|
224
|
-
const monStart = new Date(this.viewYear, this.viewMonth, 1);
|
|
225
|
-
while (monStart.getDay() !== 1)
|
|
226
|
-
monStart.setDate(monStart.getDate() - 1);
|
|
227
|
-
const dowLabels = [];
|
|
228
|
-
for (let i = 0; i < 7; i++) {
|
|
229
|
-
const d = new Date(monStart);
|
|
230
|
-
d.setDate(monStart.getDate() + i);
|
|
231
|
-
const lbl = new Intl.DateTimeFormat(this.locale, { weekday: 'short' }).format(d);
|
|
232
|
-
dowLabels.push(lbl.charAt(0).toUpperCase() + lbl.slice(1, 2));
|
|
233
|
-
}
|
|
234
|
-
// Day cells (with leading blanks for alignment)
|
|
235
|
-
const cells = [];
|
|
236
|
-
for (let i = 0; i < startDow; i++)
|
|
237
|
-
cells.push(null);
|
|
238
|
-
for (let d = 1; d <= lastDay; d++) {
|
|
239
|
-
cells.push(this.formatISO(new Date(this.viewYear, this.viewMonth, d)));
|
|
240
|
-
}
|
|
241
|
-
while (cells.length % 7 !== 0)
|
|
242
|
-
cells.push(null);
|
|
243
|
-
return (h("div", { class: "co-date-range__calendar" }, h("div", { class: "co-date-range__cal-header" }, h("button", { class: "co-date-range__nav", type: "button", onClick: this.prevMonth, "aria-label": "Previous month" }, h("co-icon", { name: "caret-left", size: 16 })), h("span", { class: "co-date-range__month-label" }, monthName), h("button", { class: "co-date-range__nav", type: "button", onClick: this.nextMonth, "aria-label": "Next month" }, h("co-icon", { name: "caret-right", size: 16 }))), h("div", { class: "co-date-range__dow" }, dowLabels.map((l, i) => h("span", { key: i }, l))), h("div", { class: "co-date-range__days" }, cells.map((day, idx) => {
|
|
244
|
-
if (!day)
|
|
245
|
-
return h("span", { class: "co-date-range__day co-date-range__day--empty", key: idx });
|
|
246
|
-
const isStart = day === this.draftFrom;
|
|
247
|
-
const isEnd = day === this.draftTo;
|
|
248
|
-
const isRange = this.inRange(day);
|
|
249
|
-
return (h("button", { key: idx, type: "button", class: {
|
|
250
|
-
'co-date-range__day': true,
|
|
251
|
-
'co-date-range__day--start': isStart,
|
|
252
|
-
'co-date-range__day--end': isEnd,
|
|
253
|
-
'co-date-range__day--in-range': isRange && !isStart && !isEnd,
|
|
254
|
-
}, onClick: () => this.handleDayClick(day), onMouseEnter: () => this.handleDayHover(day), onMouseLeave: () => this.handleDayHover(null) }, parseInt(day.split('-')[2], 10)));
|
|
255
|
-
}))));
|
|
256
|
-
}
|
|
257
|
-
renderPresets() {
|
|
258
|
-
if (!this.presets)
|
|
259
|
-
return null;
|
|
260
|
-
const items = [
|
|
261
|
-
{ id: 'today', label: this.presetTodayLabel },
|
|
262
|
-
{ id: 'thisWeek', label: this.presetThisWeekLabel },
|
|
263
|
-
{ id: 'thisMonth', label: this.presetThisMonthLabel },
|
|
264
|
-
{ id: 'last30Days', label: this.presetLast30DaysLabel },
|
|
265
|
-
{ id: 'last90Days', label: this.presetLast90DaysLabel },
|
|
266
|
-
{ id: 'thisYear', label: this.presetThisYearLabel },
|
|
267
|
-
];
|
|
268
|
-
return (h("div", { class: "co-date-range__presets" }, items.map(p => (h("button", { key: p.id, type: "button", class: "co-date-range__preset", onClick: () => this.handlePresetClick(p.id) }, p.label)))));
|
|
269
34
|
}
|
|
270
35
|
render() {
|
|
271
|
-
|
|
272
|
-
return (h("div", { key: 'd7045dc55fad85c14ea8ed05278f11a91c894e8b', class: "co-date-range", part: "root" }, this.label && h("label", { key: '9a48cd7d9498138ccb1acac2ac8b664c5543b6d1', class: "co-date-range__label", part: "label" }, this.label), h("div", { key: '09379d7ac693bce51da6e131cb60c61d3d16d226', class: {
|
|
273
|
-
'co-date-range__trigger': true,
|
|
274
|
-
'co-date-range__trigger--open': this.isOpen,
|
|
275
|
-
'co-date-range__trigger--disabled': this.disabled,
|
|
276
|
-
[`co-date-range__trigger--${this.status}`]: this.status !== 'default',
|
|
277
|
-
}, onClick: this.handleTriggerClick, part: "trigger", tabIndex: this.disabled ? -1 : 0, role: "button" }, h("co-icon", { key: '8f0cf20d2e9e39eb625112bd31b13e03e9723fa3', name: "calendar", size: 16, class: "co-date-range__icon" }), h("span", { key: '394050d776116d98e3f585bb2521b726308cd57c', class: {
|
|
278
|
-
'co-date-range__trigger-text': true,
|
|
279
|
-
'co-date-range__trigger-text--placeholder': !hasValue,
|
|
280
|
-
} }, this.renderTriggerLabel()), this.clearable && hasValue && !this.disabled && (h("button", { key: '6af816bd7d5e1e677943692b2540d5cc1547d230', class: "co-date-range__clear", type: "button", onClick: (e) => { e.stopPropagation(); this.handleClear(); }, "aria-label": "Clear" }, h("co-icon", { key: 'aeb54016fc5b9616e2c4c9656cde0a07cc784d99', name: "x-circle", weight: "fill", size: 16 }))), h("co-icon", { key: '474e9a4b815f977ffaf444f6c568c6adbce393dd', name: "caret-down", size: 14, class: "co-date-range__caret" })), this.helperText && (h("span", { key: 'afc70e80268864a59c7c93623db3542560a08ca7', class: {
|
|
281
|
-
'co-date-range__helper': true,
|
|
282
|
-
[`co-date-range__helper--${this.status}`]: this.status !== 'default',
|
|
283
|
-
}, part: "helper" }, this.helperText)), this.isOpen && (h("div", { key: 'fbfdaf36083d09423e22a578ccead616a7bab704', class: "co-date-range__popover", part: "popover" }, h("div", { key: '43275ecd90419bc6625c9bd59b3fde2fb58f2fb0', class: "co-date-range__popover-body" }, this.renderPresets(), this.renderCalendar()), h("div", { key: 'b32a4217c1f15860ae2f767a1135f35e5f9e4bb8', class: "co-date-range__footer" }, h("button", { key: 'c0c07ad3017a318184bcae0011c3713b6924b16c', type: "button", class: "co-date-range__btn co-date-range__btn--ghost", onClick: this.handleClear }, this.clearLabel), h("button", { key: '234d87a5de1e7c04cad86b50130081bcf9fa17b1', type: "button", class: "co-date-range__btn co-date-range__btn--primary", onClick: this.handleApply, disabled: !this.draftFrom || !this.draftTo }, this.applyLabel))))));
|
|
36
|
+
return (h("co-date-range-picker", { key: '52a80ab59ff863209e62f5dcddbc674ea32a662c', value: this.value, label: this.label, placeholder: this.placeholder, disabled: this.disabled, clearable: this.clearable, presets: this.presets, helperText: this.helperText, locale: this.locale, applyLabel: this.applyLabel, clearLabel: this.clearLabel, onCoApply: this.handleApply, onCoClear: () => this.coClear.emit() }));
|
|
284
37
|
}
|
|
285
38
|
static get is() { return "co-date-range"; }
|
|
286
39
|
static get encapsulation() { return "shadow"; }
|
|
@@ -308,7 +61,7 @@ export class CoDateRange {
|
|
|
308
61
|
"optional": false,
|
|
309
62
|
"docs": {
|
|
310
63
|
"tags": [],
|
|
311
|
-
"text": "JSON `{from,
|
|
64
|
+
"text": "JSON `{from,to}` or empty string."
|
|
312
65
|
},
|
|
313
66
|
"getter": false,
|
|
314
67
|
"setter": false,
|
|
@@ -416,26 +169,6 @@ export class CoDateRange {
|
|
|
416
169
|
"attribute": "presets",
|
|
417
170
|
"defaultValue": "true"
|
|
418
171
|
},
|
|
419
|
-
"status": {
|
|
420
|
-
"type": "string",
|
|
421
|
-
"mutable": false,
|
|
422
|
-
"complexType": {
|
|
423
|
-
"original": "'default' | 'error' | 'success'",
|
|
424
|
-
"resolved": "\"default\" | \"error\" | \"success\"",
|
|
425
|
-
"references": {}
|
|
426
|
-
},
|
|
427
|
-
"required": false,
|
|
428
|
-
"optional": false,
|
|
429
|
-
"docs": {
|
|
430
|
-
"tags": [],
|
|
431
|
-
"text": ""
|
|
432
|
-
},
|
|
433
|
-
"getter": false,
|
|
434
|
-
"setter": false,
|
|
435
|
-
"reflect": false,
|
|
436
|
-
"attribute": "status",
|
|
437
|
-
"defaultValue": "'default'"
|
|
438
|
-
},
|
|
439
172
|
"helperText": {
|
|
440
173
|
"type": "string",
|
|
441
174
|
"mutable": false,
|
|
@@ -468,7 +201,7 @@ export class CoDateRange {
|
|
|
468
201
|
"optional": false,
|
|
469
202
|
"docs": {
|
|
470
203
|
"tags": [],
|
|
471
|
-
"text": "BCP-47 locale
|
|
204
|
+
"text": "BCP-47 locale."
|
|
472
205
|
},
|
|
473
206
|
"getter": false,
|
|
474
207
|
"setter": false,
|
|
@@ -476,136 +209,16 @@ export class CoDateRange {
|
|
|
476
209
|
"attribute": "locale",
|
|
477
210
|
"defaultValue": "'es'"
|
|
478
211
|
},
|
|
479
|
-
"presetTodayLabel": {
|
|
480
|
-
"type": "string",
|
|
481
|
-
"mutable": false,
|
|
482
|
-
"complexType": {
|
|
483
|
-
"original": "string",
|
|
484
|
-
"resolved": "string",
|
|
485
|
-
"references": {}
|
|
486
|
-
},
|
|
487
|
-
"required": false,
|
|
488
|
-
"optional": false,
|
|
489
|
-
"docs": {
|
|
490
|
-
"tags": [],
|
|
491
|
-
"text": ""
|
|
492
|
-
},
|
|
493
|
-
"getter": false,
|
|
494
|
-
"setter": false,
|
|
495
|
-
"reflect": false,
|
|
496
|
-
"attribute": "preset-today-label",
|
|
497
|
-
"defaultValue": "'Today'"
|
|
498
|
-
},
|
|
499
|
-
"presetThisWeekLabel": {
|
|
500
|
-
"type": "string",
|
|
501
|
-
"mutable": false,
|
|
502
|
-
"complexType": {
|
|
503
|
-
"original": "string",
|
|
504
|
-
"resolved": "string",
|
|
505
|
-
"references": {}
|
|
506
|
-
},
|
|
507
|
-
"required": false,
|
|
508
|
-
"optional": false,
|
|
509
|
-
"docs": {
|
|
510
|
-
"tags": [],
|
|
511
|
-
"text": ""
|
|
512
|
-
},
|
|
513
|
-
"getter": false,
|
|
514
|
-
"setter": false,
|
|
515
|
-
"reflect": false,
|
|
516
|
-
"attribute": "preset-this-week-label",
|
|
517
|
-
"defaultValue": "'This week'"
|
|
518
|
-
},
|
|
519
|
-
"presetThisMonthLabel": {
|
|
520
|
-
"type": "string",
|
|
521
|
-
"mutable": false,
|
|
522
|
-
"complexType": {
|
|
523
|
-
"original": "string",
|
|
524
|
-
"resolved": "string",
|
|
525
|
-
"references": {}
|
|
526
|
-
},
|
|
527
|
-
"required": false,
|
|
528
|
-
"optional": false,
|
|
529
|
-
"docs": {
|
|
530
|
-
"tags": [],
|
|
531
|
-
"text": ""
|
|
532
|
-
},
|
|
533
|
-
"getter": false,
|
|
534
|
-
"setter": false,
|
|
535
|
-
"reflect": false,
|
|
536
|
-
"attribute": "preset-this-month-label",
|
|
537
|
-
"defaultValue": "'This month'"
|
|
538
|
-
},
|
|
539
|
-
"presetLast30DaysLabel": {
|
|
540
|
-
"type": "string",
|
|
541
|
-
"mutable": false,
|
|
542
|
-
"complexType": {
|
|
543
|
-
"original": "string",
|
|
544
|
-
"resolved": "string",
|
|
545
|
-
"references": {}
|
|
546
|
-
},
|
|
547
|
-
"required": false,
|
|
548
|
-
"optional": false,
|
|
549
|
-
"docs": {
|
|
550
|
-
"tags": [],
|
|
551
|
-
"text": ""
|
|
552
|
-
},
|
|
553
|
-
"getter": false,
|
|
554
|
-
"setter": false,
|
|
555
|
-
"reflect": false,
|
|
556
|
-
"attribute": "preset-last-3-0-days-label",
|
|
557
|
-
"defaultValue": "'Last 30 days'"
|
|
558
|
-
},
|
|
559
|
-
"presetLast90DaysLabel": {
|
|
560
|
-
"type": "string",
|
|
561
|
-
"mutable": false,
|
|
562
|
-
"complexType": {
|
|
563
|
-
"original": "string",
|
|
564
|
-
"resolved": "string",
|
|
565
|
-
"references": {}
|
|
566
|
-
},
|
|
567
|
-
"required": false,
|
|
568
|
-
"optional": false,
|
|
569
|
-
"docs": {
|
|
570
|
-
"tags": [],
|
|
571
|
-
"text": ""
|
|
572
|
-
},
|
|
573
|
-
"getter": false,
|
|
574
|
-
"setter": false,
|
|
575
|
-
"reflect": false,
|
|
576
|
-
"attribute": "preset-last-9-0-days-label",
|
|
577
|
-
"defaultValue": "'Last 90 days'"
|
|
578
|
-
},
|
|
579
|
-
"presetThisYearLabel": {
|
|
580
|
-
"type": "string",
|
|
581
|
-
"mutable": false,
|
|
582
|
-
"complexType": {
|
|
583
|
-
"original": "string",
|
|
584
|
-
"resolved": "string",
|
|
585
|
-
"references": {}
|
|
586
|
-
},
|
|
587
|
-
"required": false,
|
|
588
|
-
"optional": false,
|
|
589
|
-
"docs": {
|
|
590
|
-
"tags": [],
|
|
591
|
-
"text": ""
|
|
592
|
-
},
|
|
593
|
-
"getter": false,
|
|
594
|
-
"setter": false,
|
|
595
|
-
"reflect": false,
|
|
596
|
-
"attribute": "preset-this-year-label",
|
|
597
|
-
"defaultValue": "'This year'"
|
|
598
|
-
},
|
|
599
212
|
"applyLabel": {
|
|
600
213
|
"type": "string",
|
|
601
214
|
"mutable": false,
|
|
602
215
|
"complexType": {
|
|
603
216
|
"original": "string",
|
|
604
|
-
"resolved": "string",
|
|
217
|
+
"resolved": "string | undefined",
|
|
605
218
|
"references": {}
|
|
606
219
|
},
|
|
607
220
|
"required": false,
|
|
608
|
-
"optional":
|
|
221
|
+
"optional": true,
|
|
609
222
|
"docs": {
|
|
610
223
|
"tags": [],
|
|
611
224
|
"text": ""
|
|
@@ -613,19 +226,18 @@ export class CoDateRange {
|
|
|
613
226
|
"getter": false,
|
|
614
227
|
"setter": false,
|
|
615
228
|
"reflect": false,
|
|
616
|
-
"attribute": "apply-label"
|
|
617
|
-
"defaultValue": "'Apply'"
|
|
229
|
+
"attribute": "apply-label"
|
|
618
230
|
},
|
|
619
231
|
"clearLabel": {
|
|
620
232
|
"type": "string",
|
|
621
233
|
"mutable": false,
|
|
622
234
|
"complexType": {
|
|
623
235
|
"original": "string",
|
|
624
|
-
"resolved": "string",
|
|
236
|
+
"resolved": "string | undefined",
|
|
625
237
|
"references": {}
|
|
626
238
|
},
|
|
627
239
|
"required": false,
|
|
628
|
-
"optional":
|
|
240
|
+
"optional": true,
|
|
629
241
|
"docs": {
|
|
630
242
|
"tags": [],
|
|
631
243
|
"text": ""
|
|
@@ -633,21 +245,10 @@ export class CoDateRange {
|
|
|
633
245
|
"getter": false,
|
|
634
246
|
"setter": false,
|
|
635
247
|
"reflect": false,
|
|
636
|
-
"attribute": "clear-label"
|
|
637
|
-
"defaultValue": "'Clear'"
|
|
248
|
+
"attribute": "clear-label"
|
|
638
249
|
}
|
|
639
250
|
};
|
|
640
251
|
}
|
|
641
|
-
static get states() {
|
|
642
|
-
return {
|
|
643
|
-
"isOpen": {},
|
|
644
|
-
"draftFrom": {},
|
|
645
|
-
"draftTo": {},
|
|
646
|
-
"hoverDay": {},
|
|
647
|
-
"viewMonth": {},
|
|
648
|
-
"viewYear": {}
|
|
649
|
-
};
|
|
650
|
-
}
|
|
651
252
|
static get events() {
|
|
652
253
|
return [{
|
|
653
254
|
"method": "coChange",
|
|
@@ -657,16 +258,17 @@ export class CoDateRange {
|
|
|
657
258
|
"composed": true,
|
|
658
259
|
"docs": {
|
|
659
260
|
"tags": [],
|
|
660
|
-
"text": ""
|
|
261
|
+
"text": "Fires (with `{from,to}`) when the user applies a range."
|
|
661
262
|
},
|
|
662
263
|
"complexType": {
|
|
663
264
|
"original": "DateRangeValue",
|
|
664
265
|
"resolved": "DateRangeValue",
|
|
665
266
|
"references": {
|
|
666
267
|
"DateRangeValue": {
|
|
667
|
-
"location": "
|
|
668
|
-
"path": "
|
|
669
|
-
"id": "src/components/co-date-range/co-date-range.tsx::DateRangeValue"
|
|
268
|
+
"location": "import",
|
|
269
|
+
"path": "../co-date-range-picker/co-date-range-picker",
|
|
270
|
+
"id": "src/components/co-date-range-picker/co-date-range-picker.tsx::DateRangeValue",
|
|
271
|
+
"referenceLocation": "DateRangeValue"
|
|
670
272
|
}
|
|
671
273
|
}
|
|
672
274
|
}
|
|
@@ -688,10 +290,4 @@ export class CoDateRange {
|
|
|
688
290
|
}];
|
|
689
291
|
}
|
|
690
292
|
static get elementRef() { return "el"; }
|
|
691
|
-
static get watchers() {
|
|
692
|
-
return [{
|
|
693
|
-
"propName": "value",
|
|
694
|
-
"methodName": "onValueChange"
|
|
695
|
-
}];
|
|
696
|
-
}
|
|
697
293
|
}
|