@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,4 +1,5 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
+
import { initOverlayScroll } from "../../utils/overlayScroll";
|
|
2
3
|
export class CoTransferList {
|
|
3
4
|
constructor() {
|
|
4
5
|
this.leftTitle = 'Available';
|
|
@@ -11,6 +12,7 @@ export class CoTransferList {
|
|
|
11
12
|
this.status = 'default';
|
|
12
13
|
this.leftChecked = new Set();
|
|
13
14
|
this.rightChecked = new Set();
|
|
15
|
+
this.osInstances = [];
|
|
14
16
|
this.toggleLeftCheck = (val) => {
|
|
15
17
|
const next = new Set(this.leftChecked);
|
|
16
18
|
if (next.has(val))
|
|
@@ -95,21 +97,31 @@ export class CoTransferList {
|
|
|
95
97
|
return map[this.status] || null;
|
|
96
98
|
}
|
|
97
99
|
renderList(items, checked, toggle, title) {
|
|
98
|
-
return (h("div", { class: "co-transfer-list__panel" }, h("div", { class: "co-transfer-list__panel-header" }, h("span", { class: "co-transfer-list__panel-title" }, title), h("span", { class: "co-transfer-list__panel-count" }, items.length)), h("div", { class: "co-transfer-list__panel-body" }, items.length === 0 ? (h("div", { class: "co-transfer-list__empty" }, "No items")) : (items.map(item => (h("div", { class: {
|
|
100
|
+
return (h("div", { class: "co-transfer-list__panel" }, h("div", { class: "co-transfer-list__panel-header" }, h("span", { class: "co-transfer-list__panel-title" }, title), h("span", { class: "co-transfer-list__panel-count" }, items.length)), h("div", { class: "co-transfer-list__panel-body" }, h("div", { class: "co-transfer-list__panel-scroll" }, items.length === 0 ? (h("div", { class: "co-transfer-list__empty" }, "No items")) : (items.map(item => (h("div", { class: {
|
|
99
101
|
'co-transfer-list__item': true,
|
|
100
102
|
'co-transfer-list__item--checked': checked.has(item.value),
|
|
101
103
|
'co-transfer-list__item--disabled': !!item.disabled,
|
|
102
104
|
}, onClick: () => !item.disabled && toggle(item.value) }, h("span", { class: {
|
|
103
105
|
'co-transfer-list__checkbox': true,
|
|
104
106
|
'co-transfer-list__checkbox--checked': checked.has(item.value),
|
|
105
|
-
} }, checked.has(item.value) && h("co-icon", { name: "check", size: 12 })), h("span", { class: "co-transfer-list__item-label" }, item.label))))))));
|
|
107
|
+
} }, checked.has(item.value) && h("co-icon", { name: "check", size: 12 })), h("span", { class: "co-transfer-list__item-label" }, item.label)))))))));
|
|
108
|
+
}
|
|
109
|
+
// Panels are always rendered, so init OverlayScrollbars once on both bodies.
|
|
110
|
+
componentDidLoad() {
|
|
111
|
+
var _a;
|
|
112
|
+
const bodies = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('.co-transfer-list__panel-body');
|
|
113
|
+
bodies === null || bodies === void 0 ? void 0 : bodies.forEach((b) => this.osInstances.push(initOverlayScroll(b)));
|
|
114
|
+
}
|
|
115
|
+
disconnectedCallback() {
|
|
116
|
+
this.osInstances.forEach((i) => i.destroy());
|
|
117
|
+
this.osInstances = [];
|
|
106
118
|
}
|
|
107
119
|
render() {
|
|
108
|
-
return (h("div", { key: '
|
|
120
|
+
return (h("div", { key: 'fd9cddc7be36b5acc9bc5852a9173b2ed950e529', class: {
|
|
109
121
|
'co-transfer-list': true,
|
|
110
122
|
'co-transfer-list--disabled': this.disabled,
|
|
111
123
|
[`co-transfer-list--${this.status}`]: this.status !== 'default',
|
|
112
|
-
} }, this.label && h("label", { key: '
|
|
124
|
+
} }, this.label && h("label", { key: '6bcde50bb852ee58443d44b43ce5d67ad425f013', class: "co-transfer-list__label" }, this.label), h("div", { key: '836b094c4ccf69d4cfbaace4283e87ec55c13d07', class: "co-transfer-list__body" }, this.renderList(this.leftItems, this.leftChecked, this.toggleLeftCheck, this.leftTitle), h("div", { key: '8222a5f1207514f500e222a175ce9aef20e9df5f', class: "co-transfer-list__actions" }, h("button", { key: '21b61c709b1b66f293289fb8ae6e2e40fcdc1fb6', class: "co-transfer-list__btn", disabled: this.disabled, onClick: this.moveAllRight, "aria-label": "Move all right" }, h("co-icon", { key: 'c575643b4988a6f36ce0b738a400d0f4270b339d', name: "caret-double-right", size: 16 })), h("button", { key: 'db88f4725eb0e8e0e9cd573bf4ee6613f9b752de', class: "co-transfer-list__btn", disabled: this.disabled || this.leftChecked.size === 0, onClick: this.moveRight, "aria-label": "Move selected right" }, h("co-icon", { key: '789e6f0b3934a1ce571b1b24f78d215f263793b9', name: "caret-right", size: 16 })), h("button", { key: '72c2829abff4dc3453ccebb9846fb4b5b423a044', class: "co-transfer-list__btn", disabled: this.disabled || this.rightChecked.size === 0, onClick: this.moveLeft, "aria-label": "Move selected left" }, h("co-icon", { key: '2a77ca393a41134dd0b8befa085c1ff0caa050ef', name: "caret-left", size: 16 })), h("button", { key: '292bf6d2cc097523c6ea14a694cd134ed5526935', class: "co-transfer-list__btn", disabled: this.disabled, onClick: this.moveAllLeft, "aria-label": "Move all left" }, h("co-icon", { key: 'fc5f1f90f4eec18a4a3db20301a787280f77ba92', name: "caret-double-left", size: 16 }))), this.renderList(this.rightItems, this.rightChecked, this.toggleRightCheck, this.rightTitle)), this.helperText && (h("div", { key: '112008f9b2f9ef0e72a4c3add8d89319fa5e1c89', class: `co-transfer-list__helper co-transfer-list__helper--${this.status}` }, this.statusIcon && h("co-icon", { key: '712da720169f753bc161922edac625a44ea5e6d2', name: this.statusIcon, size: 14, weight: "fill", class: "co-transfer-list__helper-icon" }), h("span", { key: 'ad424d40bad49265e88cf3c0a524f74b5213e406', class: "co-transfer-list__helper-text" }, this.helperText)))));
|
|
113
125
|
}
|
|
114
126
|
static get is() { return "co-transfer-list"; }
|
|
115
127
|
static get encapsulation() { return "shadow"; }
|
|
@@ -315,4 +327,5 @@ export class CoTransferList {
|
|
|
315
327
|
}
|
|
316
328
|
}];
|
|
317
329
|
}
|
|
330
|
+
static get elementRef() { return "el"; }
|
|
318
331
|
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in UI string dictionary for the date components (co-calendar,
|
|
3
|
+
* co-date-field, co-date-picker, co-date-range-picker).
|
|
4
|
+
*
|
|
5
|
+
* Strategy: the components ship es/en/pt strings keyed by the `locale` prop,
|
|
6
|
+
* with per-string prop overrides for full host control. Month/weekday NAMES and
|
|
7
|
+
* date order are NOT here — those come from `Intl` (locale-driven) in
|
|
8
|
+
* cobalt-date-utils. This dictionary is only for fixed UI text + aria labels.
|
|
9
|
+
*/
|
|
10
|
+
const DICT = {
|
|
11
|
+
es: {
|
|
12
|
+
prevMonth: 'Mes anterior',
|
|
13
|
+
nextMonth: 'Mes siguiente',
|
|
14
|
+
dateLabel: 'Fecha',
|
|
15
|
+
clearDate: 'Limpiar fecha',
|
|
16
|
+
today: 'Hoy',
|
|
17
|
+
yesterday: 'Ayer',
|
|
18
|
+
last7Days: 'Últimos 7 días',
|
|
19
|
+
last14Days: 'Últimos 14 días',
|
|
20
|
+
last30Days: 'Últimos 30 días',
|
|
21
|
+
last90Days: 'Últimos 90 días',
|
|
22
|
+
thisWeek: 'Esta semana',
|
|
23
|
+
thisMonth: 'Este mes',
|
|
24
|
+
lastMonth: 'Mes pasado',
|
|
25
|
+
thisYear: 'Este año',
|
|
26
|
+
lastYear: 'Año pasado',
|
|
27
|
+
custom: 'Personalizado',
|
|
28
|
+
apply: 'Aplicar',
|
|
29
|
+
cancel: 'Cancelar',
|
|
30
|
+
clear: 'Limpiar',
|
|
31
|
+
from: 'Desde',
|
|
32
|
+
to: 'Hasta',
|
|
33
|
+
selectDate: 'Seleccionar fecha',
|
|
34
|
+
setDate: 'Establecer fecha',
|
|
35
|
+
},
|
|
36
|
+
en: {
|
|
37
|
+
prevMonth: 'Previous month',
|
|
38
|
+
nextMonth: 'Next month',
|
|
39
|
+
dateLabel: 'Date',
|
|
40
|
+
clearDate: 'Clear date',
|
|
41
|
+
today: 'Today',
|
|
42
|
+
yesterday: 'Yesterday',
|
|
43
|
+
last7Days: 'Last 7 days',
|
|
44
|
+
last14Days: 'Last 14 days',
|
|
45
|
+
last30Days: 'Last 30 days',
|
|
46
|
+
last90Days: 'Last 90 days',
|
|
47
|
+
thisWeek: 'This week',
|
|
48
|
+
thisMonth: 'This month',
|
|
49
|
+
lastMonth: 'Last month',
|
|
50
|
+
thisYear: 'This year',
|
|
51
|
+
lastYear: 'Last year',
|
|
52
|
+
custom: 'Custom',
|
|
53
|
+
apply: 'Apply',
|
|
54
|
+
cancel: 'Cancel',
|
|
55
|
+
clear: 'Clear',
|
|
56
|
+
from: 'From',
|
|
57
|
+
to: 'To',
|
|
58
|
+
selectDate: 'Select date',
|
|
59
|
+
setDate: 'Set date',
|
|
60
|
+
},
|
|
61
|
+
pt: {
|
|
62
|
+
prevMonth: 'Mês anterior',
|
|
63
|
+
nextMonth: 'Próximo mês',
|
|
64
|
+
dateLabel: 'Data',
|
|
65
|
+
clearDate: 'Limpar data',
|
|
66
|
+
today: 'Hoje',
|
|
67
|
+
yesterday: 'Ontem',
|
|
68
|
+
last7Days: 'Últimos 7 dias',
|
|
69
|
+
last14Days: 'Últimos 14 dias',
|
|
70
|
+
last30Days: 'Últimos 30 dias',
|
|
71
|
+
last90Days: 'Últimos 90 dias',
|
|
72
|
+
thisWeek: 'Esta semana',
|
|
73
|
+
thisMonth: 'Este mês',
|
|
74
|
+
lastMonth: 'Mês passado',
|
|
75
|
+
thisYear: 'Este ano',
|
|
76
|
+
lastYear: 'Ano passado',
|
|
77
|
+
custom: 'Personalizado',
|
|
78
|
+
apply: 'Aplicar',
|
|
79
|
+
cancel: 'Cancelar',
|
|
80
|
+
clear: 'Limpar',
|
|
81
|
+
from: 'De',
|
|
82
|
+
to: 'Até',
|
|
83
|
+
selectDate: 'Selecionar data',
|
|
84
|
+
setDate: 'Definir data',
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
/** Map any BCP-47 locale (e.g. "es-CO") to a supported language; fallback 'en'. */
|
|
88
|
+
export function langFromLocale(locale) {
|
|
89
|
+
const l = (locale || '').toLowerCase();
|
|
90
|
+
if (l.startsWith('es'))
|
|
91
|
+
return 'es';
|
|
92
|
+
if (l.startsWith('pt'))
|
|
93
|
+
return 'pt';
|
|
94
|
+
if (l.startsWith('en'))
|
|
95
|
+
return 'en';
|
|
96
|
+
return 'en';
|
|
97
|
+
}
|
|
98
|
+
/** Resolve the built-in UI strings for a locale. */
|
|
99
|
+
export function getDateStrings(locale) {
|
|
100
|
+
return DICT[langFromLocale(locale)];
|
|
101
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in UI string dictionary for co-file-field.
|
|
3
|
+
*
|
|
4
|
+
* Strategy mirrors dateI18n: the component ships es/en/pt strings keyed by the
|
|
5
|
+
* `locale` prop, with per-string prop overrides (uploadButtonText, dropText,
|
|
6
|
+
* uploadedTitle, helperText) for full host control. Templates use `{n}` (max
|
|
7
|
+
* files) and `{x}` (formatted max size) placeholders.
|
|
8
|
+
*/
|
|
9
|
+
const DICT = {
|
|
10
|
+
es: {
|
|
11
|
+
uploadButton: 'Cargar archivo',
|
|
12
|
+
dropHint: 'Arrastra y suelta archivos aquí',
|
|
13
|
+
helperBoth: 'Puedes subir hasta {n} archivos, cada uno hasta {x}',
|
|
14
|
+
helperFiles: 'Puedes subir hasta {n} archivos',
|
|
15
|
+
helperBytes: 'Cada archivo hasta {x}',
|
|
16
|
+
uploadedTitle: 'Archivos subidos',
|
|
17
|
+
removeFile: 'Eliminar archivo',
|
|
18
|
+
copyUrl: 'Copiar enlace',
|
|
19
|
+
copied: 'Copiado',
|
|
20
|
+
dragToReorder: 'Arrastra para reordenar',
|
|
21
|
+
openPreview: 'Abrir vista previa',
|
|
22
|
+
errInvalidFormat: 'Formato no permitido: .{x}',
|
|
23
|
+
errTooLarge: 'Archivo demasiado grande: {x}',
|
|
24
|
+
errMaxFiles: 'Puedes subir hasta {n} archivos',
|
|
25
|
+
},
|
|
26
|
+
en: {
|
|
27
|
+
uploadButton: 'Upload file',
|
|
28
|
+
dropHint: 'Drag and drop files here',
|
|
29
|
+
helperBoth: 'You can upload up to {n} files, each up to {x}',
|
|
30
|
+
helperFiles: 'You can upload up to {n} files',
|
|
31
|
+
helperBytes: 'Each file up to {x}',
|
|
32
|
+
uploadedTitle: 'Uploaded files',
|
|
33
|
+
removeFile: 'Remove file',
|
|
34
|
+
copyUrl: 'Copy link',
|
|
35
|
+
copied: 'Copied',
|
|
36
|
+
dragToReorder: 'Drag to reorder',
|
|
37
|
+
openPreview: 'Open preview',
|
|
38
|
+
errInvalidFormat: 'Invalid format: .{x}',
|
|
39
|
+
errTooLarge: 'File too large: {x}',
|
|
40
|
+
errMaxFiles: 'You can upload up to {n} files',
|
|
41
|
+
},
|
|
42
|
+
pt: {
|
|
43
|
+
uploadButton: 'Carregar arquivo',
|
|
44
|
+
dropHint: 'Arraste e solte arquivos aqui',
|
|
45
|
+
helperBoth: 'Você pode enviar até {n} arquivos, cada um até {x}',
|
|
46
|
+
helperFiles: 'Você pode enviar até {n} arquivos',
|
|
47
|
+
helperBytes: 'Cada arquivo até {x}',
|
|
48
|
+
uploadedTitle: 'Arquivos enviados',
|
|
49
|
+
removeFile: 'Remover arquivo',
|
|
50
|
+
copyUrl: 'Copiar link',
|
|
51
|
+
copied: 'Copiado',
|
|
52
|
+
dragToReorder: 'Arraste para reordenar',
|
|
53
|
+
openPreview: 'Abrir pré-visualização',
|
|
54
|
+
errInvalidFormat: 'Formato inválido: .{x}',
|
|
55
|
+
errTooLarge: 'Arquivo muito grande: {x}',
|
|
56
|
+
errMaxFiles: 'Você pode enviar até {n} arquivos',
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
/** Map any BCP-47 locale (e.g. "es-CO") to a supported language; fallback 'en'. */
|
|
60
|
+
export function langFromLocale(locale) {
|
|
61
|
+
const l = (locale || '').toLowerCase();
|
|
62
|
+
if (l.startsWith('es'))
|
|
63
|
+
return 'es';
|
|
64
|
+
if (l.startsWith('pt'))
|
|
65
|
+
return 'pt';
|
|
66
|
+
return 'en';
|
|
67
|
+
}
|
|
68
|
+
/** Resolve the built-in UI strings for a locale. */
|
|
69
|
+
export function getFileStrings(locale) {
|
|
70
|
+
return DICT[langFromLocale(locale)];
|
|
71
|
+
}
|
|
72
|
+
/** Fill the `{n}` / `{x}` placeholders of a template string. */
|
|
73
|
+
export function fillTemplate(tpl, vars) {
|
|
74
|
+
var _a, _b;
|
|
75
|
+
return tpl.replace('{n}', String((_a = vars.n) !== null && _a !== void 0 ? _a : '')).replace('{x}', (_b = vars.x) !== null && _b !== void 0 ? _b : '');
|
|
76
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const CDN_BASE = 'https://cdn.jsdelivr.net/npm/@phosphor-icons/core@2.1.1/assets';
|
|
2
|
+
/**
|
|
3
|
+
* Override the base URL used by `<co-icon>` to resolve Phosphor SVG assets.
|
|
4
|
+
*
|
|
5
|
+
* Call once at app startup before any icon renders.
|
|
6
|
+
* The path should point to a directory containing `regular/`, `bold/`, `fill/`, etc.
|
|
7
|
+
* A trailing slash is optional — it will be normalized.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* // Serve icons from your own public folder:
|
|
11
|
+
* setIconBasePath('/phosphor')
|
|
12
|
+
*
|
|
13
|
+
* // Or from a custom CDN:
|
|
14
|
+
* setIconBasePath('https://my-cdn.com/phosphor-icons/2.1.1/assets')
|
|
15
|
+
*/
|
|
16
|
+
export function setIconBasePath(path) {
|
|
17
|
+
globalThis.__cobaltIconBasePath = path.endsWith('/') ? path.slice(0, -1) : path;
|
|
18
|
+
}
|
|
19
|
+
/** Returns the current icon base path (default: jsDelivr CDN). */
|
|
20
|
+
export function getIconBasePath() {
|
|
21
|
+
return globalThis.__cobaltIconBasePath || CDN_BASE;
|
|
22
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in UI string dictionary for co-lightbox (aria labels + tooltips).
|
|
3
|
+
* Same strategy as dateI18n/fileI18n: ships es/en/pt keyed by the `locale`
|
|
4
|
+
* prop. The `counter` template uses `{i}` / `{n}` placeholders.
|
|
5
|
+
*/
|
|
6
|
+
import { langFromLocale } from "./dateI18n";
|
|
7
|
+
const DICT = {
|
|
8
|
+
es: {
|
|
9
|
+
close: 'Cerrar visor',
|
|
10
|
+
prevImage: 'Imagen anterior',
|
|
11
|
+
nextImage: 'Imagen siguiente',
|
|
12
|
+
zoomIn: 'Acercar',
|
|
13
|
+
zoomOut: 'Alejar',
|
|
14
|
+
zoomReset: 'Restablecer zoom',
|
|
15
|
+
openOriginal: 'Abrir original',
|
|
16
|
+
counter: '{i} de {n}',
|
|
17
|
+
},
|
|
18
|
+
en: {
|
|
19
|
+
close: 'Close viewer',
|
|
20
|
+
prevImage: 'Previous image',
|
|
21
|
+
nextImage: 'Next image',
|
|
22
|
+
zoomIn: 'Zoom in',
|
|
23
|
+
zoomOut: 'Zoom out',
|
|
24
|
+
zoomReset: 'Reset zoom',
|
|
25
|
+
openOriginal: 'Open original',
|
|
26
|
+
counter: '{i} of {n}',
|
|
27
|
+
},
|
|
28
|
+
pt: {
|
|
29
|
+
close: 'Fechar visualizador',
|
|
30
|
+
prevImage: 'Imagem anterior',
|
|
31
|
+
nextImage: 'Próxima imagem',
|
|
32
|
+
zoomIn: 'Aproximar',
|
|
33
|
+
zoomOut: 'Afastar',
|
|
34
|
+
zoomReset: 'Redefinir zoom',
|
|
35
|
+
openOriginal: 'Abrir original',
|
|
36
|
+
counter: '{i} de {n}',
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
/** Resolve the built-in UI strings for a locale. */
|
|
40
|
+
export function getLightboxStrings(locale) {
|
|
41
|
+
return DICT[langFromLocale(locale)];
|
|
42
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text normalization for accent/case-insensitive matching, shared by every
|
|
3
|
+
* component that filters options by a typed query (co-select, co-combobox,
|
|
4
|
+
* co-sidebar-nav, co-command-search, co-phone-field, co-column-picker).
|
|
5
|
+
*
|
|
6
|
+
* Strips diacritics via NFD decomposition + combining-mark removal so "mexico"
|
|
7
|
+
* matches "México", "espana" matches "España" and "camerun" matches
|
|
8
|
+
* "Camerún", then lowercases. Single source of truth.
|
|
9
|
+
*/
|
|
10
|
+
export function normalizeText(str) {
|
|
11
|
+
return String(str !== null && str !== void 0 ? str : "")
|
|
12
|
+
.normalize("NFD")
|
|
13
|
+
.replace(/[\u0300-\u036f]/g, "")
|
|
14
|
+
.toLowerCase();
|
|
15
|
+
}
|
|
16
|
+
/** Diacritic/case-insensitive substring test (`needle` found in `haystack`). */
|
|
17
|
+
export function textIncludes(haystack, needle) {
|
|
18
|
+
return normalizeText(haystack).includes(normalizeText(needle));
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Relevance score of `query` against `label` (diacritic/case-insensitive):
|
|
22
|
+
* 4 = exact · 3 = label starts with query · 2 = a word in the label starts
|
|
23
|
+
* with query · 1 = substring anywhere · 0 = no match.
|
|
24
|
+
* An empty query scores 1 (neutral). Used to rank autocomplete results so
|
|
25
|
+
* "me" surfaces "México" above "Camerún".
|
|
26
|
+
*/
|
|
27
|
+
export function matchScore(label, query) {
|
|
28
|
+
const l = normalizeText(label);
|
|
29
|
+
const q = normalizeText(query).trim();
|
|
30
|
+
if (!q)
|
|
31
|
+
return 1;
|
|
32
|
+
if (l === q)
|
|
33
|
+
return 4;
|
|
34
|
+
if (l.startsWith(q))
|
|
35
|
+
return 3;
|
|
36
|
+
if (l.split(/[\s,/()\-]+/).some((w) => w.startsWith(q)))
|
|
37
|
+
return 2;
|
|
38
|
+
if (l.includes(q))
|
|
39
|
+
return 1;
|
|
40
|
+
return 0;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Split `label` into the segment before / matching / after the first
|
|
44
|
+
* (diacritic/case-insensitive) occurrence of `query`, for highlighting. The
|
|
45
|
+
* returned slices come from the ORIGINAL label (accents intact) — we map the
|
|
46
|
+
* match position from the normalized string back to original codepoints, since
|
|
47
|
+
* stripping diacritics can shift indices. Returns null when there is no match
|
|
48
|
+
* or the query is empty.
|
|
49
|
+
*/
|
|
50
|
+
export function highlightMatch(label, query) {
|
|
51
|
+
const q = normalizeText(query);
|
|
52
|
+
if (!q)
|
|
53
|
+
return null;
|
|
54
|
+
const chars = Array.from(String(label !== null && label !== void 0 ? label : '')); // codepoint-safe
|
|
55
|
+
let norm = '';
|
|
56
|
+
const map = []; // map[normIndex] -> original codepoint index
|
|
57
|
+
chars.forEach((ch, i) => {
|
|
58
|
+
const n = normalizeText(ch);
|
|
59
|
+
for (let k = 0; k < n.length; k++)
|
|
60
|
+
map.push(i);
|
|
61
|
+
norm += n;
|
|
62
|
+
});
|
|
63
|
+
const start = norm.indexOf(q);
|
|
64
|
+
if (start < 0)
|
|
65
|
+
return null;
|
|
66
|
+
const a = map[start];
|
|
67
|
+
const b = map[start + q.length - 1] + 1;
|
|
68
|
+
return {
|
|
69
|
+
pre: chars.slice(0, a).join(''),
|
|
70
|
+
match: chars.slice(a, b).join(''),
|
|
71
|
+
post: chars.slice(b).join(''),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Filter `items` to those matching `query` and sort by relevance (best first),
|
|
76
|
+
* stable within a score tier (original order preserved on ties). `getText`
|
|
77
|
+
* returns the text to match — a string, or an array of fields (the best score
|
|
78
|
+
* across them wins, e.g. a country's name + dial code + ISO). Empty query
|
|
79
|
+
* returns the list unchanged.
|
|
80
|
+
*/
|
|
81
|
+
export function rankByMatch(items, query, getText) {
|
|
82
|
+
if (!normalizeText(query).trim())
|
|
83
|
+
return items;
|
|
84
|
+
const scoreOf = (item) => {
|
|
85
|
+
const text = getText(item);
|
|
86
|
+
const fields = Array.isArray(text) ? text : [text];
|
|
87
|
+
return Math.max(0, ...fields.map((f) => matchScore(f, query)));
|
|
88
|
+
};
|
|
89
|
+
return items
|
|
90
|
+
.map((item, i) => ({ item, i, score: scoreOf(item) }))
|
|
91
|
+
.filter((s) => s.score > 0)
|
|
92
|
+
.sort((a, b) => b.score - a.score || a.i - b.i)
|
|
93
|
+
.map((s) => s.item);
|
|
94
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { OverlayScrollbars } from "overlayscrollbars";
|
|
2
|
+
/**
|
|
3
|
+
* Initialize a floating, auto-hide OverlayScrollbars instance on `target`.
|
|
4
|
+
* Shared by co-* components so the theme/behavior stays consistent and the
|
|
5
|
+
* fiddly init config lives in one place.
|
|
6
|
+
*
|
|
7
|
+
* The scrollbar overlays the content (no reserved gutter) and scrolls natively
|
|
8
|
+
* under the hood — so virtual/infinite scrolling keeps working. `onScroll`
|
|
9
|
+
* receives the OS viewport element: read `scrollTop` / `scrollHeight` /
|
|
10
|
+
* `clientHeight` from IT (OS moves the real scrolling there, so a native
|
|
11
|
+
* `onScroll` on the host no longer fires).
|
|
12
|
+
*
|
|
13
|
+
* Requires the OverlayScrollbars CSS + the `.os-scrollbar.os-theme-co` theme to
|
|
14
|
+
* be present in the component's shadow root (each co-* CSS @imports them).
|
|
15
|
+
*/
|
|
16
|
+
export function initOverlayScroll(target, onScroll) {
|
|
17
|
+
return OverlayScrollbars(target, { scrollbars: { theme: 'os-theme-co', autoHide: 'leave', autoHideDelay: 300 } }, onScroll
|
|
18
|
+
? { scroll: (instance) => onScroll(instance.elements().viewport) }
|
|
19
|
+
: undefined);
|
|
20
|
+
}
|
|
@@ -61,7 +61,7 @@ export function computePosition(triggerRect, panelRect, options) {
|
|
|
61
61
|
left = triggerRect.right + offset;
|
|
62
62
|
else
|
|
63
63
|
left = triggerRect.left - panelRect.width - offset;
|
|
64
|
-
const align = placement.split('-')[1] || '
|
|
64
|
+
const align = placement.split('-')[1] || 'center';
|
|
65
65
|
if (align === 'start')
|
|
66
66
|
top = triggerRect.top;
|
|
67
67
|
else if (align === 'end')
|
|
@@ -74,7 +74,7 @@ export function computePosition(triggerRect, panelRect, options) {
|
|
|
74
74
|
top = triggerRect.top - panelRect.height - offset;
|
|
75
75
|
else
|
|
76
76
|
top = triggerRect.bottom + offset;
|
|
77
|
-
const align = placement.split('-')[1] || '
|
|
77
|
+
const align = placement.split('-')[1] || 'center';
|
|
78
78
|
if (align === 'start')
|
|
79
79
|
left = triggerRect.left;
|
|
80
80
|
else if (align === 'end')
|
|
@@ -96,8 +96,8 @@ export function computePosition(triggerRect, panelRect, options) {
|
|
|
96
96
|
* Walk up the FLATTENED tree (after slot projection) to find the nearest
|
|
97
97
|
* ancestor that creates a containing block for `position: fixed`. Per CSS spec,
|
|
98
98
|
* `transform`, `perspective`, `filter`, `backdrop-filter`,
|
|
99
|
-
* `contain: paint|layout|strict|content`,
|
|
100
|
-
* `position: fixed`.
|
|
99
|
+
* `contain: paint|layout|strict|content`, `will-change: transform`, or
|
|
100
|
+
* `container-type` (size | inline-size) all trap `position: fixed`.
|
|
101
101
|
*
|
|
102
102
|
* The flattened tree differs from the DOM tree in two places:
|
|
103
103
|
* 1. Shadow boundaries: `parentElement` stops at the shadow root, so we
|
|
@@ -106,23 +106,30 @@ export function computePosition(triggerRect, panelRect, options) {
|
|
|
106
106
|
* INSIDE the host's shadow, not its DOM parent. We use `assignedSlot`
|
|
107
107
|
* to follow that projection.
|
|
108
108
|
*/
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
return parent;
|
|
120
|
-
const root = (_b = (_a = n).getRootNode) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
121
|
-
if (root instanceof ShadowRoot)
|
|
122
|
-
return root.host;
|
|
109
|
+
/**
|
|
110
|
+
* Step to the next ancestor in the FLATTENED tree (slot projection + shadow
|
|
111
|
+
* boundaries), so traversal works for elements slotted into a shadow-DOM host:
|
|
112
|
+
* 1. `assignedSlot` → the slot's parent inside the host's shadow (projection).
|
|
113
|
+
* 2. light-DOM `parentElement`.
|
|
114
|
+
* 3. at a shadow root top, cross to the host element.
|
|
115
|
+
*/
|
|
116
|
+
function flattenedParent(n) {
|
|
117
|
+
var _a, _b;
|
|
118
|
+
if (!n)
|
|
123
119
|
return null;
|
|
124
|
-
|
|
125
|
-
|
|
120
|
+
const assignedSlot = n.assignedSlot;
|
|
121
|
+
if (assignedSlot)
|
|
122
|
+
return assignedSlot.parentElement;
|
|
123
|
+
const parent = n.parentElement;
|
|
124
|
+
if (parent)
|
|
125
|
+
return parent;
|
|
126
|
+
const root = (_b = (_a = n).getRootNode) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
127
|
+
if (root instanceof ShadowRoot)
|
|
128
|
+
return root.host;
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
export function getOffsetAncestor(el) {
|
|
132
|
+
let node = flattenedParent(el);
|
|
126
133
|
while (node && node !== document.body && node !== document.documentElement) {
|
|
127
134
|
const style = getComputedStyle(node);
|
|
128
135
|
const transform = style.transform && style.transform !== 'none';
|
|
@@ -131,23 +138,31 @@ export function getOffsetAncestor(el) {
|
|
|
131
138
|
const backdropFilter = style.backdropFilter && style.backdropFilter !== 'none';
|
|
132
139
|
const willChange = (style.willChange || '').includes('transform');
|
|
133
140
|
const contain = /paint|layout|strict|content/.test(style.contain || '');
|
|
134
|
-
|
|
141
|
+
const containerType = style.containerType && style.containerType !== 'normal';
|
|
142
|
+
if (transform || perspective || filter || backdropFilter || willChange || contain || containerType) {
|
|
135
143
|
return node;
|
|
136
144
|
}
|
|
137
|
-
node =
|
|
145
|
+
node = flattenedParent(node);
|
|
138
146
|
}
|
|
139
147
|
return null;
|
|
140
148
|
}
|
|
141
149
|
/**
|
|
142
150
|
* Find the nearest ancestor of `start` that scrolls (overflow).
|
|
151
|
+
*
|
|
152
|
+
* Walks the FLATTENED tree (via {@link flattenedParent}) so it can reach a
|
|
153
|
+
* scroll container that lives in an ancestor's shadow DOM — e.g. `co-popover`
|
|
154
|
+
* slotted into a `<co-drawer>`/`<co-modal>` whose `__body` (the actual scroller)
|
|
155
|
+
* is inside the host's shadow. A plain `parentNode` walk never reaches it, which
|
|
156
|
+
* left popovers detached on modal-body scroll (scroll events are not composed,
|
|
157
|
+
* so the window capture listener never sees them either).
|
|
143
158
|
*/
|
|
144
159
|
export function findNearestScrollParent(start) {
|
|
145
|
-
let node = start
|
|
146
|
-
while (node && node !== document.body) {
|
|
160
|
+
let node = flattenedParent(start);
|
|
161
|
+
while (node && node !== document.body && node !== document.documentElement) {
|
|
147
162
|
if (node.scrollHeight > node.clientHeight || node.scrollWidth > node.clientWidth) {
|
|
148
163
|
return node;
|
|
149
164
|
}
|
|
150
|
-
node = node
|
|
165
|
+
node = flattenedParent(node);
|
|
151
166
|
}
|
|
152
167
|
return null;
|
|
153
168
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* Shared required-field indicator for every co-* form field, so they all render
|
|
4
|
+
* the same `* (required)` marker. The asterisk is literal; the "(required)"
|
|
5
|
+
* caption text comes from the `--co-field-required-text` CSS custom property
|
|
6
|
+
* (host app sets it per locale) with an English fallback. Styling lives in the
|
|
7
|
+
* `.co-field-required` / `.co-field-required__caption` rules each component's
|
|
8
|
+
* CSS carries (next to the `::before` content rule) — NOT inline, so hosts can
|
|
9
|
+
* restyle via `::part(required)`.
|
|
10
|
+
*/
|
|
11
|
+
export const RequiredMark = ({ required }) => required ? (h("span", { class: "co-field-required", part: "required" }, "*", h("span", { class: "co-field-required__caption" }))) : null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as
|
|
1
|
+
import{t as e,p as o,H as c,c as i,h as a}from"./index.js";import{d as t}from"./p-DPi_U-Kl.js";const n=o(class extends c{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.coToggle=i(this,"coToggle",7),this.open=!0,this.heading="",this.subheading="",this.disabled=!1,this.hasSubheadingSlot=!1,this.handleToggle=()=>{this.disabled||(this.open=!this.open,this.coToggle.emit(this.open))}}componentWillLoad(){this.hasSubheadingSlot=!!this.el.querySelector('[slot="subheading"]')}componentWillRender(){this.hasSubheadingSlot=!!this.el.querySelector('[slot="subheading"]')}get showSubheading(){return!(!this.subheading||!this.subheading.trim())||this.hasSubheadingSlot}render(){return a("div",{key:"6a6073c42e0e0d7c1949717e702af49a174c5cc7",class:{"co-accordion":!0,"co-accordion--open":this.open,"co-accordion--disabled":this.disabled},part:"accordion"},a("button",{key:"e69c8e0b9d9aacc0c4fea50a9b4e85d0bbeec961",class:"co-accordion__header",type:"button","aria-expanded":this.open?"true":"false",disabled:this.disabled,onClick:this.handleToggle,part:"header"},a("span",{key:"75037112bc403bf5887aec00bd815aff57b8d9f0",class:"co-accordion__heading-group"},a("span",{key:"f91d04da6b694bf7187a58d197e255c31e036d37",class:"co-accordion__heading",part:"heading"},a("slot",{key:"186f0c02cb8648d2d9d5e7b87684518d78f915e7",name:"header"},this.heading)),this.showSubheading&&a("span",{key:"6a44307de2f0f83b26b6e0f40460847f648cf868",class:"co-accordion__subheading",part:"subheading"},a("slot",{key:"0586b988ed182b936398c618ecc33d32e64e60e3",name:"subheading"},this.subheading))),a("span",{key:"a3665b1f92145c6b3d61a9814238635a8c269bdc",class:"co-accordion__caret",part:"caret"},a("co-icon",{key:"e1a4d45ae4fe6cdce335f609c737ca5647269733",name:"caret-up",size:20}))),a("div",{key:"fe2829a080e937dbd7c1dfd966b42e33ac0fb461",class:"co-accordion__body",part:"body"},a("div",{key:"499715f298ce7f6fa027702c3856e6eecf20c870",class:"co-accordion__body-inner",part:"body-inner"},a("slot",{key:"bfd0303f4c7bd1b47a5fce8bfe8acfcc77f0b6ff"}))))}get el(){return this}static get style(){return":host{display:block}.co-accordion{display:flex;flex-direction:column;width:100%}.co-accordion__header{display:flex;align-items:center;justify-content:space-between;width:100%;padding:0;border:none;background:transparent;cursor:pointer;font-family:var(--co-font-family-primary);color:var(--co-semantic-text-default);text-align:left}.co-accordion__heading-group{flex:1;min-width:0;display:flex;flex-direction:column;gap:var(--co-spacing-xxs, 2px)}.co-accordion__heading{font-size:var(--co-font-size-24);font-weight:500;line-height:1.25;letter-spacing:-0.03em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.co-accordion__subheading{font-size:var(--co-font-size-14);font-weight:400;line-height:1.3;letter-spacing:normal;color:var(--co-semantic-text-secondary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.co-accordion__caret{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;color:var(--co-semantic-text-default);transition:transform 0.2s ease;transform:rotate(180deg);}.co-accordion--open .co-accordion__caret{transform:rotate(0deg);}.co-accordion__body{display:grid;grid-template-rows:0fr;transition:grid-template-rows 0.25s ease}.co-accordion__body-inner{min-height:0;overflow:hidden;padding-top:var(--co-spacing-2xl);}.co-accordion--open .co-accordion__body{grid-template-rows:1fr}.co-accordion:not(.co-accordion--open) .co-accordion__body-inner{visibility:hidden;transition:visibility 0s linear 0.25s}.co-accordion--open .co-accordion__body-inner{visibility:visible;transition:visibility 0s linear 0s}.co-accordion__header:focus-visible{outline:2px solid var(--co-color-primary-azul, #2563eb);outline-offset:4px;border-radius:var(--co-border-radius-xs, 8px)}.co-accordion--disabled .co-accordion__header{opacity:0.5;cursor:not-allowed}"}},[257,"co-accordion",{open:[1540],heading:[1],subheading:[1],disabled:[4],hasSubheadingSlot:[32]}]);function s(){"undefined"!=typeof customElements&&["co-accordion","co-icon"].forEach((o=>{switch(o){case"co-accordion":customElements.get(e(o))||customElements.define(e(o),n);break;case"co-icon":customElements.get(e(o))||t()}}))}s();const r=n,d=s;export{r as CoAccordion,d as defineCustomElement}
|