@prolibu-suite/cobalt-core 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +15359 -5571
- package/dist/cjs/co-accordion.cjs.entry.js +19 -4
- package/dist/cjs/co-app-shell.cjs.entry.js +1 -1
- package/dist/cjs/co-autocomplete.cjs.entry.js +51 -6
- package/dist/cjs/co-avatar.cjs.entry.js +40 -7
- package/dist/cjs/co-badge.cjs.entry.js +1 -1
- package/dist/cjs/co-button-group.cjs.entry.js +1 -1
- package/dist/cjs/co-button.cjs.entry.js +10 -5
- package/dist/cjs/co-calendar_3.cjs.entry.js +692 -0
- package/dist/cjs/co-card.cjs.entry.js +21 -4
- package/dist/cjs/co-checkbox-group.cjs.entry.js +7 -5
- package/dist/cjs/co-checkbox.cjs.entry.js +4 -4
- package/dist/cjs/co-chip.cjs.entry.js +3 -3
- package/dist/cjs/co-color-picker.cjs.entry.js +109 -0
- package/dist/cjs/co-column-picker.cjs.entry.js +443 -0
- package/dist/cjs/co-combobox.cjs.entry.js +51 -15
- package/dist/cjs/co-command-search.cjs.entry.js +14 -7
- package/dist/cjs/co-data-table-pagination.cjs.entry.js +5 -5
- package/dist/cjs/co-data-table.cjs.entry.js +17 -5
- package/dist/cjs/co-date-picker.cjs.entry.js +177 -0
- package/dist/cjs/co-date-range-picker.cjs.entry.js +378 -0
- package/dist/cjs/co-date-range.cjs.entry.js +13 -259
- package/dist/cjs/co-empty-state.cjs.entry.js +2 -2
- package/dist/cjs/co-fab.cjs.entry.js +3 -3
- package/dist/cjs/co-file-field.cjs.entry.js +498 -0
- package/dist/cjs/co-helper-text.cjs.entry.js +3 -3
- package/dist/cjs/co-icon-button.cjs.entry.js +4 -4
- package/dist/cjs/co-icon.cjs.entry.js +7 -4
- package/dist/cjs/co-input.cjs.entry.js +13 -8
- package/dist/cjs/co-json-field.cjs.entry.js +109 -0
- package/dist/cjs/co-lightbox.cjs.entry.js +344 -0
- package/dist/cjs/co-list-item.cjs.entry.js +14 -4
- package/dist/cjs/co-loader.cjs.entry.js +1 -1
- package/dist/cjs/co-menu-divider.cjs.entry.js +2 -2
- package/dist/cjs/co-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/co-menu.cjs.entry.js +2 -2
- package/dist/cjs/co-modal.cjs.entry.js +13 -3
- package/dist/cjs/co-navbar.cjs.entry.js +4 -4
- package/dist/cjs/co-number-field.cjs.entry.js +47 -11
- package/dist/cjs/co-overlay.cjs.entry.js +2 -2
- package/dist/cjs/co-page-header.cjs.entry.js +2 -2
- package/dist/cjs/co-phone-field.cjs.entry.js +376 -0
- package/dist/cjs/co-popover.cjs.entry.js +5 -5
- package/dist/cjs/co-progress-bar.cjs.entry.js +3 -3
- package/dist/cjs/co-progress-circle.cjs.entry.js +38 -0
- package/dist/cjs/co-radio-group.cjs.entry.js +7 -5
- package/dist/cjs/co-radio.cjs.entry.js +4 -4
- package/dist/cjs/co-rating.cjs.entry.js +4 -4
- package/dist/cjs/co-ref-field.cjs.entry.js +191 -21
- package/dist/cjs/co-rich-text-editor.cjs.entry.js +235 -0
- package/dist/cjs/co-rich-text-toolbar.cjs.entry.js +184 -0
- package/dist/cjs/co-rich-text-viewer.cjs.entry.js +82 -0
- package/dist/cjs/co-row.cjs.entry.js +3 -3
- package/dist/cjs/co-select.cjs.entry.js +119 -18
- package/dist/cjs/co-separator.cjs.entry.js +2 -2
- package/dist/cjs/co-sidebar-nav.cjs.entry.js +30 -5
- package/dist/cjs/co-sidebar.cjs.entry.js +3 -3
- package/dist/cjs/co-slider.cjs.entry.js +3 -3
- package/dist/cjs/co-switch.cjs.entry.js +9 -6
- package/dist/cjs/co-tab-group.cjs.entry.js +2 -2
- package/dist/cjs/co-tab.cjs.entry.js +3 -3
- package/dist/cjs/co-tags-field.cjs.entry.js +205 -0
- package/dist/cjs/co-textarea.cjs.entry.js +92 -0
- package/dist/cjs/co-toast.cjs.entry.js +2 -2
- package/dist/cjs/co-toggle-button-group.cjs.entry.js +7 -4
- package/dist/cjs/co-toggle-button.cjs.entry.js +4 -4
- package/dist/cjs/co-tooltip.cjs.entry.js +12 -6
- package/dist/cjs/co-transfer-list.cjs.entry.js +20 -6
- package/dist/cjs/cobalt.cjs.js +2 -2
- package/dist/cjs/dateI18n-BdiNAl0_.js +106 -0
- package/dist/cjs/dates-D8D-aS5d.js +432 -0
- package/dist/cjs/index-CaEJnpZe.js +27213 -0
- package/dist/cjs/{index-BEovErzl.js → index-DoFnrUVH.js} +79 -11
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/normalizeText-B-v-XPKf.js +96 -0
- package/dist/cjs/overlayScroll-ifzDNeyb.js +25 -0
- package/dist/cjs/overlayscrollbars-BlBHo2Xx.js +2842 -0
- package/dist/cjs/{positioning-DozpXyBd.js → positioning-DwHW399W.js} +40 -25
- package/dist/cjs/requiredMark-DA6y-4rp.js +16 -0
- package/dist/cjs/sanitizer-CjHZAkOm.js +1883 -0
- package/dist/cobalt/cobalt.css +1 -1
- package/dist/cobalt/cobalt.esm.js +1 -1
- package/dist/cobalt/{p-1021f612.entry.js → p-01fc77c4.entry.js} +1 -1
- package/dist/cobalt/p-0a6d8061.entry.js +1 -0
- package/dist/cobalt/p-0bf288cd.entry.js +1 -0
- package/dist/cobalt/p-136bdbd2.entry.js +1 -0
- package/dist/cobalt/{p-1b7d6808.entry.js → p-15708d32.entry.js} +1 -1
- package/dist/cobalt/{p-cc93ab05.entry.js → p-1578b019.entry.js} +1 -1
- package/dist/cobalt/{p-1b5c723a.entry.js → p-1e0282b8.entry.js} +1 -1
- package/dist/cobalt/p-23d48581.entry.js +1 -0
- package/dist/cobalt/p-2718ff27.entry.js +1 -0
- package/dist/cobalt/p-273afd93.entry.js +1 -0
- package/dist/cobalt/{p-c9b0e73f.entry.js → p-2b4d8535.entry.js} +1 -1
- package/dist/cobalt/p-3190d715.entry.js +1 -0
- package/dist/cobalt/p-3f9b3fcb.entry.js +1 -0
- package/dist/cobalt/p-41228dce.entry.js +1 -0
- package/dist/cobalt/{p-5a13e3a0.entry.js → p-44672953.entry.js} +1 -1
- package/dist/cobalt/{p-4cf6d1f4.entry.js → p-522fcdb7.entry.js} +1 -1
- package/dist/cobalt/p-53ce9023.entry.js +1 -0
- package/dist/cobalt/{p-4d8ff00a.entry.js → p-54f26e95.entry.js} +1 -1
- package/dist/cobalt/p-5d01bd4d.entry.js +1 -0
- package/dist/cobalt/p-5e7141aa.entry.js +1 -0
- package/dist/cobalt/p-5f905739.entry.js +1 -0
- package/dist/cobalt/{p-fb047df8.entry.js → p-6404bd21.entry.js} +1 -1
- package/dist/cobalt/p-654bbc2a.entry.js +1 -0
- package/dist/cobalt/p-6678ac0a.entry.js +1 -0
- package/dist/cobalt/{p-e808916c.entry.js → p-66a912dd.entry.js} +1 -1
- package/dist/cobalt/p-6759ee1c.entry.js +1 -0
- package/dist/cobalt/p-69a40bfd.entry.js +1 -0
- package/dist/cobalt/p-6a6a62cb.entry.js +1 -0
- package/dist/cobalt/p-6d43b6cd.entry.js +1 -0
- package/dist/cobalt/p-759c3dd0.entry.js +1 -0
- package/dist/cobalt/p-782f729f.entry.js +1 -0
- package/dist/cobalt/{p-ebd1555e.entry.js → p-7ef766c6.entry.js} +1 -1
- package/dist/cobalt/p-7f818368.entry.js +1 -0
- package/dist/cobalt/p-83b89bf8.entry.js +1 -0
- package/dist/cobalt/p-88dc561a.entry.js +1 -0
- package/dist/cobalt/{p-4905b51d.entry.js → p-8c27aff7.entry.js} +1 -1
- package/dist/cobalt/{p-a7fa4484.entry.js → p-95d14878.entry.js} +1 -1
- package/dist/cobalt/{p-1d7da33f.entry.js → p-97c20011.entry.js} +1 -1
- package/dist/cobalt/p-996179f7.entry.js +1 -0
- package/dist/cobalt/p-9c533830.entry.js +1 -0
- package/dist/cobalt/p-9d89bf47.entry.js +1 -0
- package/dist/cobalt/p-BKmfyPZK.js +2 -0
- package/dist/cobalt/p-BchB6Hdr.js +1 -0
- package/dist/cobalt/p-C1DCLOEl.js +1 -0
- package/dist/cobalt/p-C2mZ7x_Y.js +1 -0
- package/dist/cobalt/p-CQY6Ul7q.js +1 -0
- package/dist/cobalt/p-CyYF8IJE.js +1 -0
- package/dist/cobalt/p-DcK0GGZC.js +2 -0
- package/dist/cobalt/p-DqyWGweA.js +1 -0
- package/dist/cobalt/p-Qqq8fysz.js +1 -0
- package/dist/cobalt/p-aa17c70b.entry.js +1 -0
- package/dist/cobalt/{p-416bb5ae.entry.js → p-aa63812a.entry.js} +1 -1
- package/dist/cobalt/p-ad4c1b41.entry.js +1 -0
- package/dist/cobalt/p-ae4d3207.entry.js +1 -0
- package/dist/cobalt/p-af64da37.entry.js +1 -0
- package/dist/cobalt/p-b758c2e6.entry.js +1 -0
- package/dist/cobalt/p-bb07da22.entry.js +1 -0
- package/dist/cobalt/p-beb9c11d.entry.js +1 -0
- package/dist/cobalt/p-c6a242e4.entry.js +1 -0
- package/dist/cobalt/p-c87285b6.entry.js +1 -0
- package/dist/cobalt/p-cd57e8b4.entry.js +1 -0
- package/dist/cobalt/{p-4ffba5a3.entry.js → p-ce3a535f.entry.js} +1 -1
- package/dist/cobalt/p-d17e1444.entry.js +1 -0
- package/dist/cobalt/p-d958566a.entry.js +1 -0
- package/dist/cobalt/p-dd873bf8.entry.js +1 -0
- package/dist/cobalt/p-def448e4.entry.js +1 -0
- package/dist/cobalt/p-e4de8865.entry.js +1 -0
- package/dist/cobalt/{p-3b2f7959.entry.js → p-e8b58332.entry.js} +1 -1
- package/dist/cobalt/p-eba0bf7f.entry.js +1 -0
- package/dist/cobalt/p-f0e8fa7d.entry.js +1 -0
- package/dist/cobalt/{p-e50c4c6f.entry.js → p-f2c5cb74.entry.js} +1 -1
- package/dist/cobalt/p-f8728b21.entry.js +1 -0
- package/dist/cobalt/{p-697df797.entry.js → p-f97ad9ad.entry.js} +1 -1
- package/dist/cobalt/p-fad3605d.entry.js +1 -0
- package/dist/cobalt/{p-319937c3.entry.js → p-fe9e85b6.entry.js} +1 -1
- package/dist/cobalt/p-ff2690e5.entry.js +1 -0
- package/dist/cobalt/p-ox7HzCZn.js +10 -0
- package/dist/collection/collection-manifest.json +17 -1
- package/dist/collection/components/co-accordion/co-accordion.css +19 -1
- package/dist/collection/components/co-accordion/co-accordion.js +46 -4
- package/dist/collection/components/co-autocomplete/co-autocomplete.css +725 -7
- package/dist/collection/components/co-autocomplete/co-autocomplete.js +88 -4
- package/dist/collection/components/co-avatar/co-avatar.css +7 -0
- package/dist/collection/components/co-avatar/co-avatar.js +35 -6
- package/dist/collection/components/co-button/co-button.css +8 -5
- package/dist/collection/components/co-button/co-button.js +46 -3
- package/dist/collection/components/co-calendar/co-calendar.css +236 -0
- package/dist/collection/components/co-calendar/co-calendar.js +728 -0
- package/dist/collection/components/co-card/co-card.css +28 -5
- package/dist/collection/components/co-card/co-card.js +47 -4
- package/dist/collection/components/co-checkbox/co-checkbox.js +3 -3
- package/dist/collection/components/co-checkbox-group/co-checkbox-group.css +26 -0
- package/dist/collection/components/co-checkbox-group/co-checkbox-group.js +25 -3
- package/dist/collection/components/co-chip/co-chip.js +2 -2
- package/dist/collection/components/co-color-picker/co-color-picker.css +224 -0
- package/dist/collection/components/co-color-picker/co-color-picker.js +333 -0
- package/dist/collection/components/co-color-picker/presets.js +19 -0
- package/dist/collection/components/co-column-picker/co-column-picker.css +490 -0
- package/dist/collection/components/co-column-picker/co-column-picker.js +675 -0
- package/dist/collection/components/co-column-picker/column-picker-node.js +34 -0
- package/dist/collection/components/co-column-picker/utils/column-picker-tree.js +221 -0
- package/dist/collection/components/co-combobox/co-combobox.css +789 -22
- package/dist/collection/components/co-combobox/co-combobox.js +130 -15
- package/dist/collection/components/co-command-search/co-command-search.css +4 -0
- package/dist/collection/components/co-command-search/co-command-search.js +12 -5
- package/dist/collection/components/co-data-table/co-data-table.css +1 -1
- package/dist/collection/components/co-data-table/co-data-table.js +15 -3
- package/dist/collection/components/co-data-table-pagination/co-data-table-pagination.js +4 -4
- package/dist/collection/components/co-date-field/co-date-field.css +239 -0
- package/dist/collection/components/co-date-field/co-date-field.js +746 -0
- package/dist/collection/components/co-date-picker/co-date-picker.css +112 -0
- package/dist/collection/components/co-date-picker/co-date-picker.js +801 -0
- package/dist/collection/components/co-date-range/co-date-range.css +3 -254
- package/dist/collection/components/co-date-range/co-date-range.js +29 -433
- package/dist/collection/components/co-date-range-picker/co-date-range-picker.css +251 -0
- package/dist/collection/components/co-date-range-picker/co-date-range-picker.js +1142 -0
- package/dist/collection/components/co-drawer/co-drawer.css +19 -0
- package/dist/collection/components/co-drawer/co-drawer.js +46 -2
- package/dist/collection/components/co-empty-state/co-empty-state.js +1 -1
- package/dist/collection/components/co-fab/co-fab.js +2 -2
- package/dist/collection/components/co-file-field/co-file-field.css +389 -0
- package/dist/collection/components/co-file-field/co-file-field.js +841 -0
- package/dist/collection/components/co-file-field/co-file-field.utils.js +47 -0
- package/dist/collection/components/co-helper-text/co-helper-text.js +2 -2
- package/dist/collection/components/co-icon/co-icon.js +6 -3
- package/dist/collection/components/co-icon-button/co-icon-button.css +10 -0
- package/dist/collection/components/co-icon-button/co-icon-button.js +4 -4
- package/dist/collection/components/co-input/co-input.css +56 -10
- package/dist/collection/components/co-input/co-input.js +34 -9
- package/dist/collection/components/co-json-field/co-json-field.css +169 -0
- package/dist/collection/components/co-json-field/co-json-field.js +453 -0
- package/dist/collection/components/co-lightbox/co-lightbox.css +164 -0
- package/dist/collection/components/co-lightbox/co-lightbox.js +451 -0
- package/dist/collection/components/co-list-item/co-list-item.css +5 -0
- package/dist/collection/components/co-list-item/co-list-item.js +12 -2
- package/dist/collection/components/co-menu/co-menu.js +1 -1
- package/dist/collection/components/co-menu-divider/co-menu-divider.js +1 -1
- package/dist/collection/components/co-modal/co-modal.css +17 -3
- package/dist/collection/components/co-modal/co-modal.js +51 -1
- package/dist/collection/components/co-navbar/co-navbar.css +1 -1
- package/dist/collection/components/co-navbar/co-navbar.js +2 -2
- package/dist/collection/components/co-number-field/co-number-field.css +70 -0
- package/dist/collection/components/co-number-field/co-number-field.js +143 -13
- package/dist/collection/components/co-overlay/co-overlay.js +1 -1
- package/dist/collection/components/co-page-header/co-page-header.js +1 -1
- package/dist/collection/components/co-phone-field/co-phone-field.css +265 -0
- package/dist/collection/components/co-phone-field/co-phone-field.js +392 -0
- package/dist/collection/components/co-phone-field/dial-codes.js +208 -0
- package/dist/collection/components/co-popover/co-popover.css +1 -1
- package/dist/collection/components/co-popover/co-popover.js +2 -2
- package/dist/collection/components/co-progress-bar/co-progress-bar.js +2 -2
- package/dist/collection/components/co-progress-circle/co-progress-circle.css +50 -0
- package/dist/collection/components/co-progress-circle/co-progress-circle.js +148 -0
- package/dist/collection/components/co-radio/co-radio.js +3 -3
- package/dist/collection/components/co-radio-group/co-radio-group.css +26 -0
- package/dist/collection/components/co-radio-group/co-radio-group.js +25 -3
- package/dist/collection/components/co-rating/co-rating.js +3 -3
- package/dist/collection/components/co-ref-field/co-ref-field.css +816 -54
- package/dist/collection/components/co-ref-field/co-ref-field.js +0 -0
- package/dist/collection/components/co-rich-text-editor/co-rich-text-editor.css +238 -0
- package/dist/collection/components/co-rich-text-editor/co-rich-text-editor.js +868 -0
- package/dist/collection/components/co-rich-text-toolbar/co-rich-text-toolbar.css +55 -0
- package/dist/collection/components/co-rich-text-toolbar/co-rich-text-toolbar.js +289 -0
- package/dist/collection/components/co-rich-text-viewer/co-rich-text-viewer.css +78 -0
- package/dist/collection/components/co-rich-text-viewer/co-rich-text-viewer.js +232 -0
- package/dist/collection/components/co-row/co-row.js +2 -2
- package/dist/collection/components/co-select/co-select.css +845 -7
- package/dist/collection/components/co-select/co-select.js +240 -17
- package/dist/collection/components/co-separator/co-separator.js +1 -1
- package/dist/collection/components/co-sidebar/co-sidebar.js +2 -2
- package/dist/collection/components/co-sidebar-nav/co-sidebar-nav.js +29 -4
- package/dist/collection/components/co-slider/co-slider.js +2 -2
- package/dist/collection/components/co-switch/co-switch.css +17 -0
- package/dist/collection/components/co-switch/co-switch.js +27 -4
- package/dist/collection/components/co-tab/co-tab.js +2 -2
- package/dist/collection/components/co-tab-group/co-tab-group.js +1 -1
- package/dist/collection/components/co-tags-field/co-tags-field.css +272 -0
- package/dist/collection/components/co-tags-field/co-tags-field.js +590 -0
- package/dist/collection/components/co-textarea/co-textarea.css +261 -0
- package/dist/collection/components/co-textarea/co-textarea.js +484 -0
- package/dist/collection/components/co-toast/co-toast.js +1 -1
- package/dist/collection/components/co-toggle-button/co-toggle-button.css +6 -4
- package/dist/collection/components/co-toggle-button/co-toggle-button.js +2 -2
- package/dist/collection/components/co-toggle-button-group/co-toggle-button-group.css +16 -0
- package/dist/collection/components/co-toggle-button-group/co-toggle-button-group.js +25 -2
- package/dist/collection/components/co-tooltip/co-tooltip.css +16 -0
- package/dist/collection/components/co-tooltip/co-tooltip.js +9 -3
- package/dist/collection/components/co-transfer-list/co-transfer-list.css +683 -7
- package/dist/collection/components/co-transfer-list/co-transfer-list.js +17 -4
- package/dist/collection/utils/dateI18n.js +101 -0
- package/dist/collection/utils/fileI18n.js +76 -0
- package/dist/collection/utils/icon-config.js +22 -0
- package/dist/collection/utils/lightboxI18n.js +42 -0
- package/dist/collection/utils/normalizeText.js +94 -0
- package/dist/collection/utils/overlayScroll.js +20 -0
- package/dist/collection/utils/positioning.js +40 -25
- package/dist/collection/utils/requiredMark.js +11 -0
- package/dist/components/co-accordion.js +1 -1
- package/dist/components/co-autocomplete.js +1 -1
- package/dist/components/co-avatar.js +1 -1
- package/dist/components/co-button.js +1 -1
- package/dist/components/co-calendar.d.ts +11 -0
- package/dist/components/co-calendar.js +1 -0
- package/dist/components/co-card.js +1 -1
- package/dist/components/co-checkbox-group.js +1 -1
- package/dist/components/co-checkbox.js +1 -1
- package/dist/components/co-chip.js +1 -1
- package/dist/components/co-color-picker.d.ts +11 -0
- package/dist/components/co-color-picker.js +1 -0
- package/dist/components/co-column-picker.d.ts +11 -0
- package/dist/components/co-column-picker.js +1 -0
- package/dist/components/co-combobox.js +1 -1
- package/dist/components/co-command-search.js +1 -1
- package/dist/components/co-data-table-pagination.js +1 -1
- package/dist/components/co-data-table.js +1 -1
- package/dist/components/co-date-field.d.ts +11 -0
- package/dist/components/co-date-field.js +1 -0
- package/dist/components/co-date-picker.d.ts +11 -0
- package/dist/components/co-date-picker.js +1 -0
- package/dist/components/co-date-range-picker.d.ts +11 -0
- package/dist/components/co-date-range-picker.js +1 -0
- package/dist/components/co-date-range.js +1 -1
- package/dist/components/co-drawer.js +1 -1
- package/dist/components/co-empty-state.js +1 -1
- package/dist/components/co-fab.js +1 -1
- package/dist/components/co-file-field.d.ts +11 -0
- package/dist/components/co-file-field.js +1 -0
- package/dist/components/co-helper-text.js +1 -1
- package/dist/components/co-icon-button.js +1 -1
- package/dist/components/co-icon.js +1 -1
- package/dist/components/co-input.js +1 -1
- package/dist/components/co-json-field.d.ts +11 -0
- package/dist/components/co-json-field.js +1 -0
- package/dist/components/co-lightbox.d.ts +11 -0
- package/dist/components/co-lightbox.js +1 -0
- package/dist/components/co-list-item.js +1 -1
- package/dist/components/co-menu-divider.js +1 -1
- package/dist/components/co-menu-item.js +1 -1
- package/dist/components/co-menu.js +1 -1
- package/dist/components/co-modal.js +1 -1
- package/dist/components/co-navbar.js +1 -1
- package/dist/components/co-number-field.js +1 -1
- package/dist/components/co-overlay.js +1 -1
- package/dist/components/co-page-header.js +1 -1
- package/dist/components/co-phone-field.d.ts +11 -0
- package/dist/components/co-phone-field.js +1 -0
- package/dist/components/co-popover.js +1 -1
- package/dist/components/co-progress-bar.js +1 -1
- package/dist/components/co-progress-circle.d.ts +11 -0
- package/dist/components/co-progress-circle.js +1 -0
- package/dist/components/co-radio-group.js +1 -1
- package/dist/components/co-radio.js +1 -1
- package/dist/components/co-rating.js +1 -1
- package/dist/components/co-ref-field.js +1 -1
- package/dist/components/co-rich-text-editor.d.ts +11 -0
- package/dist/components/co-rich-text-editor.js +1 -0
- package/dist/components/co-rich-text-toolbar.d.ts +11 -0
- package/dist/components/co-rich-text-toolbar.js +1 -0
- package/dist/components/co-rich-text-viewer.d.ts +11 -0
- package/dist/components/co-rich-text-viewer.js +1 -0
- package/dist/components/co-row.js +1 -1
- package/dist/components/co-select.js +1 -1
- package/dist/components/co-separator.js +1 -1
- package/dist/components/co-sidebar-nav.js +1 -1
- package/dist/components/co-sidebar.js +1 -1
- package/dist/components/co-slider.js +1 -1
- package/dist/components/co-switch.js +1 -1
- package/dist/components/co-tab-group.js +1 -1
- package/dist/components/co-tab.js +1 -1
- package/dist/components/co-tags-field.d.ts +11 -0
- package/dist/components/co-tags-field.js +1 -0
- package/dist/components/co-textarea.d.ts +11 -0
- package/dist/components/co-textarea.js +1 -0
- package/dist/components/co-toast.js +1 -1
- package/dist/components/co-toggle-button-group.js +1 -1
- package/dist/components/co-toggle-button.js +1 -1
- package/dist/components/co-tooltip.js +1 -1
- package/dist/components/co-transfer-list.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-Dv_iMPy0.js → p-BXdfh__-.js} +1 -1
- package/dist/components/p-BchB6Hdr.js +1 -0
- package/dist/components/p-BeWXpX8I.js +1 -0
- package/dist/components/p-BiW0ubLs.js +1 -0
- package/dist/components/p-C1DCLOEl.js +1 -0
- package/dist/components/p-C2mZ7x_Y.js +1 -0
- package/dist/components/p-C9tHLXKS.js +1 -0
- package/dist/components/p-CQY6Ul7q.js +1 -0
- package/dist/components/p-CWneqh4n.js +1 -0
- package/dist/components/{p-B18FTYLq.js → p-CaMgu2_g.js} +1 -1
- package/dist/components/p-CyYF8IJE.js +1 -0
- package/dist/components/p-DBhNS7JD.js +1 -0
- package/dist/components/p-DObrQi5F.js +1 -0
- package/dist/components/p-DPi_U-Kl.js +1 -0
- package/dist/components/p-DcK0GGZC.js +2 -0
- package/dist/components/p-DqyWGweA.js +1 -0
- package/dist/components/{p-cpdUXBiS.js → p-MiSJXuBx.js} +1 -1
- package/dist/components/p-Sgn-2g8m.js +1 -0
- package/dist/components/{p-Cr8Yc0zj.js → p-jDjfGZJp.js} +1 -1
- package/dist/components/p-o8hrDIKe.js +1 -0
- package/dist/components/p-ox7HzCZn.js +10 -0
- package/dist/esm/co-accordion.entry.js +19 -4
- package/dist/esm/co-app-shell.entry.js +1 -1
- package/dist/esm/co-autocomplete.entry.js +51 -6
- package/dist/esm/co-avatar.entry.js +39 -6
- package/dist/esm/co-badge.entry.js +1 -1
- package/dist/esm/co-button-group.entry.js +1 -1
- package/dist/esm/co-button.entry.js +10 -5
- package/dist/esm/co-calendar_3.entry.js +688 -0
- package/dist/esm/co-card.entry.js +21 -4
- package/dist/esm/co-checkbox-group.entry.js +7 -5
- package/dist/esm/co-checkbox.entry.js +4 -4
- package/dist/esm/co-chip.entry.js +3 -3
- package/dist/esm/co-color-picker.entry.js +107 -0
- package/dist/esm/co-column-picker.entry.js +441 -0
- package/dist/esm/co-combobox.entry.js +51 -15
- package/dist/esm/co-command-search.entry.js +14 -7
- package/dist/esm/co-data-table-pagination.entry.js +5 -5
- package/dist/esm/co-data-table.entry.js +17 -5
- package/dist/esm/co-date-picker.entry.js +175 -0
- package/dist/esm/co-date-range-picker.entry.js +376 -0
- package/dist/esm/co-date-range.entry.js +13 -259
- package/dist/esm/co-empty-state.entry.js +2 -2
- package/dist/esm/co-fab.entry.js +3 -3
- package/dist/esm/co-file-field.entry.js +496 -0
- package/dist/esm/co-helper-text.entry.js +3 -3
- package/dist/esm/co-icon-button.entry.js +4 -4
- package/dist/esm/co-icon.entry.js +7 -4
- package/dist/esm/co-input.entry.js +13 -8
- package/dist/esm/co-json-field.entry.js +107 -0
- package/dist/esm/co-lightbox.entry.js +342 -0
- package/dist/esm/co-list-item.entry.js +14 -4
- package/dist/esm/co-loader.entry.js +1 -1
- package/dist/esm/co-menu-divider.entry.js +2 -2
- package/dist/esm/co-menu-item.entry.js +1 -1
- package/dist/esm/co-menu.entry.js +2 -2
- package/dist/esm/co-modal.entry.js +13 -3
- package/dist/esm/co-navbar.entry.js +4 -4
- package/dist/esm/co-number-field.entry.js +47 -11
- package/dist/esm/co-overlay.entry.js +2 -2
- package/dist/esm/co-page-header.entry.js +2 -2
- package/dist/esm/co-phone-field.entry.js +374 -0
- package/dist/esm/co-popover.entry.js +5 -5
- package/dist/esm/co-progress-bar.entry.js +3 -3
- package/dist/esm/co-progress-circle.entry.js +36 -0
- package/dist/esm/co-radio-group.entry.js +7 -5
- package/dist/esm/co-radio.entry.js +4 -4
- package/dist/esm/co-rating.entry.js +4 -4
- package/dist/esm/co-ref-field.entry.js +191 -21
- package/dist/esm/co-rich-text-editor.entry.js +233 -0
- package/dist/esm/co-rich-text-toolbar.entry.js +182 -0
- package/dist/esm/co-rich-text-viewer.entry.js +80 -0
- package/dist/esm/co-row.entry.js +3 -3
- package/dist/esm/co-select.entry.js +119 -18
- package/dist/esm/co-separator.entry.js +2 -2
- package/dist/esm/co-sidebar-nav.entry.js +30 -5
- package/dist/esm/co-sidebar.entry.js +3 -3
- package/dist/esm/co-slider.entry.js +3 -3
- package/dist/esm/co-switch.entry.js +9 -6
- package/dist/esm/co-tab-group.entry.js +2 -2
- package/dist/esm/co-tab.entry.js +3 -3
- package/dist/esm/co-tags-field.entry.js +203 -0
- package/dist/esm/co-textarea.entry.js +90 -0
- package/dist/esm/co-toast.entry.js +2 -2
- package/dist/esm/co-toggle-button-group.entry.js +7 -4
- package/dist/esm/co-toggle-button.entry.js +4 -4
- package/dist/esm/co-tooltip.entry.js +12 -6
- package/dist/esm/co-transfer-list.entry.js +20 -6
- package/dist/esm/cobalt.js +3 -3
- package/dist/esm/dateI18n-C1DCLOEl.js +103 -0
- package/dist/esm/dates-CyYF8IJE.js +416 -0
- package/dist/esm/{index-B0lqrhFo.js → index-BKmfyPZK.js} +79 -11
- package/dist/esm/index-BjAqSidM.js +27200 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/normalizeText-CQY6Ul7q.js +92 -0
- package/dist/esm/overlayScroll-Bpv882_z.js +23 -0
- package/dist/esm/overlayscrollbars-ox7HzCZn.js +2840 -0
- package/dist/esm/{positioning-Am-OlB8h.js → positioning-C2mZ7x_Y.js} +40 -25
- package/dist/esm/requiredMark-DFvtYtkE.js +14 -0
- package/dist/esm/sanitizer-DcK0GGZC.js +1880 -0
- package/dist/types/components/co-accordion/co-accordion.d.ts +12 -2
- package/dist/types/components/co-autocomplete/co-autocomplete.d.ts +11 -0
- package/dist/types/components/co-avatar/co-avatar.d.ts +6 -2
- package/dist/types/components/co-button/co-button.d.ts +4 -0
- package/dist/types/components/co-calendar/co-calendar.d.ts +108 -0
- package/dist/types/components/co-card/co-card.d.ts +10 -2
- package/dist/types/components/co-checkbox-group/co-checkbox-group.d.ts +2 -0
- package/dist/types/components/co-color-picker/co-color-picker.d.ts +48 -0
- package/dist/types/components/co-color-picker/presets.d.ts +10 -0
- package/dist/types/components/co-column-picker/co-column-picker.d.ts +60 -0
- package/dist/types/components/co-column-picker/column-picker-node.d.ts +18 -0
- package/dist/types/components/co-column-picker/utils/column-picker-tree.d.ts +37 -0
- package/dist/types/components/co-combobox/co-combobox.d.ts +14 -1
- package/dist/types/components/co-command-search/co-command-search.d.ts +2 -0
- package/dist/types/components/co-data-table/co-data-table.d.ts +1 -0
- package/dist/types/components/co-date-field/co-date-field.d.ts +96 -0
- package/dist/types/components/co-date-picker/co-date-picker.d.ts +92 -0
- package/dist/types/components/co-date-range/co-date-range.d.ts +12 -50
- package/dist/types/components/co-date-range-picker/co-date-range-picker.d.ts +112 -0
- package/dist/types/components/co-drawer/co-drawer.d.ts +4 -0
- package/dist/types/components/co-file-field/co-file-field.d.ts +146 -0
- package/dist/types/components/co-file-field/co-file-field.utils.d.ts +18 -0
- package/dist/types/components/co-icon-button/co-icon-button.d.ts +1 -1
- package/dist/types/components/co-input/co-input.d.ts +4 -1
- package/dist/types/components/co-json-field/co-json-field.d.ts +66 -0
- package/dist/types/components/co-lightbox/co-lightbox.d.ts +95 -0
- package/dist/types/components/co-list-item/co-list-item.d.ts +1 -0
- package/dist/types/components/co-modal/co-modal.d.ts +4 -0
- package/dist/types/components/co-number-field/co-number-field.d.ts +16 -2
- package/dist/types/components/co-phone-field/co-phone-field.d.ts +56 -0
- package/dist/types/components/co-phone-field/dial-codes.d.ts +14 -0
- package/dist/types/components/co-progress-circle/co-progress-circle.d.ts +16 -0
- package/dist/types/components/co-radio-group/co-radio-group.d.ts +2 -0
- package/dist/types/components/co-ref-field/co-ref-field.d.ts +54 -1
- package/dist/types/components/co-rich-text-editor/co-rich-text-editor.d.ts +94 -0
- package/dist/types/components/co-rich-text-toolbar/co-rich-text-toolbar.d.ts +42 -0
- package/dist/types/components/co-rich-text-viewer/co-rich-text-viewer.d.ts +32 -0
- package/dist/types/components/co-select/co-select.d.ts +31 -1
- package/dist/types/components/co-switch/co-switch.d.ts +2 -0
- package/dist/types/components/co-tags-field/co-tags-field.d.ts +82 -0
- package/dist/types/components/co-textarea/co-textarea.d.ts +65 -0
- package/dist/types/components/co-toggle-button-group/co-toggle-button-group.d.ts +2 -0
- package/dist/types/components/co-transfer-list/co-transfer-list.d.ts +4 -0
- package/dist/types/components.d.ts +3796 -422
- package/dist/types/utils/dateI18n.d.ts +39 -0
- package/dist/types/utils/fileI18n.d.ts +34 -0
- package/dist/types/utils/icon-config.d.ts +20 -0
- package/dist/types/utils/lightboxI18n.d.ts +12 -0
- package/dist/types/utils/normalizeText.d.ts +41 -0
- package/dist/types/utils/overlayScroll.d.ts +17 -0
- package/dist/types/utils/positioning.d.ts +7 -14
- package/dist/types/utils/requiredMark.d.ts +13 -0
- package/package.json +9 -1
- package/dist/cjs/co-drawer.cjs.entry.js +0 -75
- package/dist/cjs/color-YhUkm10t.js +0 -32
- package/dist/cobalt/p-08afdc51.entry.js +0 -1
- package/dist/cobalt/p-1d3338b6.entry.js +0 -1
- package/dist/cobalt/p-230a23f3.entry.js +0 -1
- package/dist/cobalt/p-31bc842d.entry.js +0 -1
- package/dist/cobalt/p-37c1f700.entry.js +0 -1
- package/dist/cobalt/p-4ce98a64.entry.js +0 -1
- package/dist/cobalt/p-4dd7499c.entry.js +0 -1
- package/dist/cobalt/p-4e7ce8ee.entry.js +0 -1
- package/dist/cobalt/p-6793c51e.entry.js +0 -1
- package/dist/cobalt/p-689e38b3.entry.js +0 -1
- package/dist/cobalt/p-7028880b.entry.js +0 -1
- package/dist/cobalt/p-72113ec2.entry.js +0 -1
- package/dist/cobalt/p-8e54e74d.entry.js +0 -1
- package/dist/cobalt/p-92c39eed.entry.js +0 -1
- package/dist/cobalt/p-9887b828.entry.js +0 -1
- package/dist/cobalt/p-9a5c6600.entry.js +0 -1
- package/dist/cobalt/p-Am-OlB8h.js +0 -1
- package/dist/cobalt/p-B0lqrhFo.js +0 -2
- package/dist/cobalt/p-BG4WRR22.js +0 -1
- package/dist/cobalt/p-a1b248ad.entry.js +0 -1
- package/dist/cobalt/p-a470b764.entry.js +0 -1
- package/dist/cobalt/p-a477d23a.entry.js +0 -1
- package/dist/cobalt/p-a4d55b1a.entry.js +0 -1
- package/dist/cobalt/p-b6840df4.entry.js +0 -1
- package/dist/cobalt/p-b89d54d9.entry.js +0 -1
- package/dist/cobalt/p-ba84631a.entry.js +0 -1
- package/dist/cobalt/p-c7517f86.entry.js +0 -1
- package/dist/cobalt/p-ca41eec2.entry.js +0 -1
- package/dist/cobalt/p-d29c77cb.entry.js +0 -1
- package/dist/cobalt/p-d9d8b10e.entry.js +0 -1
- package/dist/cobalt/p-da55678f.entry.js +0 -1
- package/dist/cobalt/p-dc5598d1.entry.js +0 -1
- package/dist/cobalt/p-e2c9cb00.entry.js +0 -1
- package/dist/cobalt/p-ebd68f56.entry.js +0 -1
- package/dist/cobalt/p-f051f44d.entry.js +0 -1
- package/dist/cobalt/p-fe1447a3.entry.js +0 -1
- package/dist/components/p-Am-OlB8h.js +0 -1
- package/dist/components/p-BG4WRR22.js +0 -1
- package/dist/components/p-wwWquAtm.js +0 -1
- package/dist/esm/co-drawer.entry.js +0 -73
- package/dist/esm/color-BG4WRR22.js +0 -30
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
export interface DateStrings {
|
|
11
|
+
prevMonth: string;
|
|
12
|
+
nextMonth: string;
|
|
13
|
+
dateLabel: string;
|
|
14
|
+
clearDate: string;
|
|
15
|
+
today: string;
|
|
16
|
+
yesterday: string;
|
|
17
|
+
last7Days: string;
|
|
18
|
+
last14Days: string;
|
|
19
|
+
last30Days: string;
|
|
20
|
+
last90Days: string;
|
|
21
|
+
thisWeek: string;
|
|
22
|
+
thisMonth: string;
|
|
23
|
+
lastMonth: string;
|
|
24
|
+
thisYear: string;
|
|
25
|
+
lastYear: string;
|
|
26
|
+
custom: string;
|
|
27
|
+
apply: string;
|
|
28
|
+
cancel: string;
|
|
29
|
+
clear: string;
|
|
30
|
+
from: string;
|
|
31
|
+
to: string;
|
|
32
|
+
selectDate: string;
|
|
33
|
+
setDate: string;
|
|
34
|
+
}
|
|
35
|
+
export type DateLang = 'es' | 'en' | 'pt';
|
|
36
|
+
/** Map any BCP-47 locale (e.g. "es-CO") to a supported language; fallback 'en'. */
|
|
37
|
+
export declare function langFromLocale(locale: string | undefined): DateLang;
|
|
38
|
+
/** Resolve the built-in UI strings for a locale. */
|
|
39
|
+
export declare function getDateStrings(locale?: string): DateStrings;
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
export interface FileStrings {
|
|
10
|
+
uploadButton: string;
|
|
11
|
+
dropHint: string;
|
|
12
|
+
helperBoth: string;
|
|
13
|
+
helperFiles: string;
|
|
14
|
+
helperBytes: string;
|
|
15
|
+
uploadedTitle: string;
|
|
16
|
+
removeFile: string;
|
|
17
|
+
copyUrl: string;
|
|
18
|
+
copied: string;
|
|
19
|
+
dragToReorder: string;
|
|
20
|
+
openPreview: string;
|
|
21
|
+
errInvalidFormat: string;
|
|
22
|
+
errTooLarge: string;
|
|
23
|
+
errMaxFiles: string;
|
|
24
|
+
}
|
|
25
|
+
export type FileLang = 'es' | 'en' | 'pt';
|
|
26
|
+
/** Map any BCP-47 locale (e.g. "es-CO") to a supported language; fallback 'en'. */
|
|
27
|
+
export declare function langFromLocale(locale: string | undefined): FileLang;
|
|
28
|
+
/** Resolve the built-in UI strings for a locale. */
|
|
29
|
+
export declare function getFileStrings(locale?: string): FileStrings;
|
|
30
|
+
/** Fill the `{n}` / `{x}` placeholders of a template string. */
|
|
31
|
+
export declare function fillTemplate(tpl: string, vars: {
|
|
32
|
+
n?: number | string;
|
|
33
|
+
x?: string;
|
|
34
|
+
}): string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
var __cobaltIconBasePath: string | undefined;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Override the base URL used by `<co-icon>` to resolve Phosphor SVG assets.
|
|
6
|
+
*
|
|
7
|
+
* Call once at app startup before any icon renders.
|
|
8
|
+
* The path should point to a directory containing `regular/`, `bold/`, `fill/`, etc.
|
|
9
|
+
* A trailing slash is optional — it will be normalized.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* // Serve icons from your own public folder:
|
|
13
|
+
* setIconBasePath('/phosphor')
|
|
14
|
+
*
|
|
15
|
+
* // Or from a custom CDN:
|
|
16
|
+
* setIconBasePath('https://my-cdn.com/phosphor-icons/2.1.1/assets')
|
|
17
|
+
*/
|
|
18
|
+
export declare function setIconBasePath(path: string): void;
|
|
19
|
+
/** Returns the current icon base path (default: jsDelivr CDN). */
|
|
20
|
+
export declare function getIconBasePath(): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface LightboxStrings {
|
|
2
|
+
close: string;
|
|
3
|
+
prevImage: string;
|
|
4
|
+
nextImage: string;
|
|
5
|
+
zoomIn: string;
|
|
6
|
+
zoomOut: string;
|
|
7
|
+
zoomReset: string;
|
|
8
|
+
openOriginal: string;
|
|
9
|
+
counter: string;
|
|
10
|
+
}
|
|
11
|
+
/** Resolve the built-in UI strings for a locale. */
|
|
12
|
+
export declare function getLightboxStrings(locale?: string): LightboxStrings;
|
|
@@ -0,0 +1,41 @@
|
|
|
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 declare function normalizeText(str: string): string;
|
|
11
|
+
/** Diacritic/case-insensitive substring test (`needle` found in `haystack`). */
|
|
12
|
+
export declare function textIncludes(haystack: string, needle: string): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Relevance score of `query` against `label` (diacritic/case-insensitive):
|
|
15
|
+
* 4 = exact · 3 = label starts with query · 2 = a word in the label starts
|
|
16
|
+
* with query · 1 = substring anywhere · 0 = no match.
|
|
17
|
+
* An empty query scores 1 (neutral). Used to rank autocomplete results so
|
|
18
|
+
* "me" surfaces "México" above "Camerún".
|
|
19
|
+
*/
|
|
20
|
+
export declare function matchScore(label: string, query: string): number;
|
|
21
|
+
/**
|
|
22
|
+
* Split `label` into the segment before / matching / after the first
|
|
23
|
+
* (diacritic/case-insensitive) occurrence of `query`, for highlighting. The
|
|
24
|
+
* returned slices come from the ORIGINAL label (accents intact) — we map the
|
|
25
|
+
* match position from the normalized string back to original codepoints, since
|
|
26
|
+
* stripping diacritics can shift indices. Returns null when there is no match
|
|
27
|
+
* or the query is empty.
|
|
28
|
+
*/
|
|
29
|
+
export declare function highlightMatch(label: string, query: string): {
|
|
30
|
+
pre: string;
|
|
31
|
+
match: string;
|
|
32
|
+
post: string;
|
|
33
|
+
} | null;
|
|
34
|
+
/**
|
|
35
|
+
* Filter `items` to those matching `query` and sort by relevance (best first),
|
|
36
|
+
* stable within a score tier (original order preserved on ties). `getText`
|
|
37
|
+
* returns the text to match — a string, or an array of fields (the best score
|
|
38
|
+
* across them wins, e.g. a country's name + dial code + ISO). Empty query
|
|
39
|
+
* returns the list unchanged.
|
|
40
|
+
*/
|
|
41
|
+
export declare function rankByMatch<T>(items: T[], query: string, getText: (item: T) => string | string[]): T[];
|
|
@@ -0,0 +1,17 @@
|
|
|
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 declare function initOverlayScroll(target: HTMLElement, onScroll?: (viewport: HTMLElement) => void): OverlayScrollbars;
|
|
17
|
+
export type OverlayScrollInstance = ReturnType<typeof initOverlayScroll>;
|
|
@@ -22,22 +22,15 @@ export interface PositionResult {
|
|
|
22
22
|
* Calculate top/left for a fixed-position panel relative to a trigger.
|
|
23
23
|
*/
|
|
24
24
|
export declare function computePosition(triggerRect: DOMRect, panelRect: DOMRect, options: PositionOptions): PositionResult;
|
|
25
|
-
/**
|
|
26
|
-
* Walk up the FLATTENED tree (after slot projection) to find the nearest
|
|
27
|
-
* ancestor that creates a containing block for `position: fixed`. Per CSS spec,
|
|
28
|
-
* `transform`, `perspective`, `filter`, `backdrop-filter`,
|
|
29
|
-
* `contain: paint|layout|strict|content`, or `will-change: transform` all trap
|
|
30
|
-
* `position: fixed`.
|
|
31
|
-
*
|
|
32
|
-
* The flattened tree differs from the DOM tree in two places:
|
|
33
|
-
* 1. Shadow boundaries: `parentElement` stops at the shadow root, so we
|
|
34
|
-
* fall back to `getRootNode().host`.
|
|
35
|
-
* 2. Slot projection: a slotted child's visual parent is the slot's parent
|
|
36
|
-
* INSIDE the host's shadow, not its DOM parent. We use `assignedSlot`
|
|
37
|
-
* to follow that projection.
|
|
38
|
-
*/
|
|
39
25
|
export declare function getOffsetAncestor(el: HTMLElement): HTMLElement | null;
|
|
40
26
|
/**
|
|
41
27
|
* Find the nearest ancestor of `start` that scrolls (overflow).
|
|
28
|
+
*
|
|
29
|
+
* Walks the FLATTENED tree (via {@link flattenedParent}) so it can reach a
|
|
30
|
+
* scroll container that lives in an ancestor's shadow DOM — e.g. `co-popover`
|
|
31
|
+
* slotted into a `<co-drawer>`/`<co-modal>` whose `__body` (the actual scroller)
|
|
32
|
+
* is inside the host's shadow. A plain `parentNode` walk never reaches it, which
|
|
33
|
+
* left popovers detached on modal-body scroll (scroll events are not composed,
|
|
34
|
+
* so the window capture listener never sees them either).
|
|
42
35
|
*/
|
|
43
36
|
export declare function findNearestScrollParent(start: Element): Element | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FunctionalComponent } from '../stencil-public-runtime';
|
|
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 declare const RequiredMark: FunctionalComponent<{
|
|
12
|
+
required?: boolean;
|
|
13
|
+
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prolibu-suite/cobalt-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Cobalt Design System — Framework-agnostic Web Components built with Stencil",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
"import": "./dist/index.js",
|
|
12
12
|
"require": "./dist/index.cjs.js"
|
|
13
13
|
},
|
|
14
|
+
"./icon-config": {
|
|
15
|
+
"types": "./dist/types/utils/icon-config.d.ts",
|
|
16
|
+
"import": "./dist/collection/utils/icon-config.js"
|
|
17
|
+
},
|
|
14
18
|
"./loader": {
|
|
15
19
|
"types": "./loader/index.d.ts",
|
|
16
20
|
"import": "./loader/index.js",
|
|
@@ -44,6 +48,10 @@
|
|
|
44
48
|
"license": "MIT",
|
|
45
49
|
"dependencies": {
|
|
46
50
|
"@phosphor-icons/core": "^2.1.1",
|
|
51
|
+
"dompurify": "^3.2.6",
|
|
52
|
+
"overlayscrollbars": "^2.16.0",
|
|
53
|
+
"@prolibu-suite/cobalt-date-utils": "0.1.1",
|
|
54
|
+
"@prolibu-suite/cobalt-rich-text": "0.1.1",
|
|
47
55
|
"@prolibu-suite/cobalt-tokens": "0.1.1"
|
|
48
56
|
},
|
|
49
57
|
"devDependencies": {
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('./index-BEovErzl.js');
|
|
4
|
-
|
|
5
|
-
const coDrawerCss = () => `:host{display:contents}.co-drawer{position:fixed;background:var(--co-semantic-surface-page);display:flex;flex-direction:column;font-family:var(--co-font-family-primary);transition:transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);overflow:hidden;will-change:transform;z-index:1}.co-drawer--right{top:0;right:0;margin:6px;height:100vh;height:-webkit-fill-available;border-radius:24px;transform:translateX(calc(100% + 12px));box-shadow:0 4px 24px rgba(0, 0, 0, 0.12)}.co-drawer--right.co-drawer--open{transform:translateX(0)}.co-drawer--left{top:0;left:0;margin:6px;height:100vh;height:-webkit-fill-available;border-radius:24px;transform:translateX(calc(-100% - 12px));box-shadow:0 4px 24px rgba(0, 0, 0, 0.12)}.co-drawer--left.co-drawer--open{transform:translateX(0)}.co-drawer--bottom{bottom:0;left:0;right:0;margin:6px;width:auto;transform:translateY(calc(100% + 12px));box-shadow:0 -4px 24px rgba(0, 0, 0, 0.12);border-radius:24px}.co-drawer--bottom.co-drawer--open{transform:translateY(0)}.co-drawer--right.co-drawer--sm,.co-drawer--left.co-drawer--sm{width:400px;max-width:100vw}.co-drawer--right.co-drawer--md,.co-drawer--left.co-drawer--md{width:520px;max-width:100vw}.co-drawer--right.co-drawer--lg,.co-drawer--left.co-drawer--lg{width:720px;max-width:100vw}.co-drawer--right.co-drawer--xl,.co-drawer--left.co-drawer--xl{width:960px;max-width:100vw}.co-drawer--right.co-drawer--full,.co-drawer--left.co-drawer--full{width:100vw}.co-drawer--bottom.co-drawer--sm{height:40vh}.co-drawer--bottom.co-drawer--md{height:60vh}.co-drawer--bottom.co-drawer--lg{height:80vh}.co-drawer--bottom.co-drawer--xl{height:95vh}.co-drawer--bottom.co-drawer--full{height:100vh}.co-drawer__header{display:flex;align-items:center;gap:var(--co-spacing-md);padding:var(--co-spacing-lg) var(--co-spacing-xl);border-bottom:1px solid var(--co-semantic-border-default);flex-shrink:0}.co-drawer__header-content{flex:1;min-width:0}.co-drawer__heading{margin:0;font-size:var(--co-font-size-18);font-weight:600;color:var(--co-semantic-text-default);line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.co-drawer__close{display:flex;align-items:center;justify-content:center;padding:var(--co-spacing-xs);margin:0;border:none;background:transparent;cursor:pointer;color:var(--co-semantic-text-muted);border-radius:var(--co-border-radius-sm);transition:background 0.1s ease;flex-shrink:0}.co-drawer__close:hover{background:var(--co-semantic-surface-hover)}.co-drawer__close:focus-visible{outline:2px solid var(--co-color-primary-azul);outline-offset:2px}.co-drawer__tabs{flex-shrink:0;border-bottom:1px solid var(--co-semantic-border-default)}.co-drawer__tabs:empty{display:none}.co-drawer__body{flex:1;overflow-y:auto;padding:var(--co-spacing-xl);position:relative}.co-drawer__footer{display:flex;justify-content:flex-end;align-items:center;gap:var(--co-spacing-md);padding:var(--co-spacing-lg) var(--co-spacing-xl);border-top:1px solid var(--co-semantic-border-default);flex-shrink:0}.co-drawer__footer:empty{display:none}@media (max-width: 600px){.co-drawer--right,.co-drawer--left{width:100vw !important}}`;
|
|
6
|
-
|
|
7
|
-
const CoDrawer = class {
|
|
8
|
-
constructor(hostRef) {
|
|
9
|
-
index.registerInstance(this, hostRef);
|
|
10
|
-
this.coClose = index.createEvent(this, "coClose", 7);
|
|
11
|
-
this.coOpen = index.createEvent(this, "coOpen", 7);
|
|
12
|
-
this.coAfterOpen = index.createEvent(this, "coAfterOpen", 7);
|
|
13
|
-
this.coAfterClose = index.createEvent(this, "coAfterClose", 7);
|
|
14
|
-
/** Whether the drawer is visible */
|
|
15
|
-
this.open = false;
|
|
16
|
-
/** Side from which the drawer slides in */
|
|
17
|
-
this.position = 'right';
|
|
18
|
-
/** Predefined sizes — sm 400 / md 520 / lg 720 / xl 960 / full 100% */
|
|
19
|
-
this.size = 'md';
|
|
20
|
-
/** Drawer title (used when `header` slot is empty) */
|
|
21
|
-
this.heading = '';
|
|
22
|
-
/** Show close (X) button in header */
|
|
23
|
-
this.closable = true;
|
|
24
|
-
/** Close when clicking the backdrop */
|
|
25
|
-
this.closeOnOverlay = true;
|
|
26
|
-
/** Close when pressing Escape */
|
|
27
|
-
this.closeOnEscape = true;
|
|
28
|
-
/** Show a loading overlay over the body */
|
|
29
|
-
this.loading = false;
|
|
30
|
-
this.handleOverlayClose = () => {
|
|
31
|
-
if (this.closeOnOverlay)
|
|
32
|
-
this.coClose.emit();
|
|
33
|
-
};
|
|
34
|
-
this.handleCloseClick = () => {
|
|
35
|
-
this.coClose.emit();
|
|
36
|
-
};
|
|
37
|
-
this.stopPropagation = (e) => {
|
|
38
|
-
e.stopPropagation();
|
|
39
|
-
};
|
|
40
|
-
this.handleTransitionEnd = (e) => {
|
|
41
|
-
if (e.propertyName !== 'transform')
|
|
42
|
-
return;
|
|
43
|
-
if (this.open)
|
|
44
|
-
this.coAfterOpen.emit();
|
|
45
|
-
else
|
|
46
|
-
this.coAfterClose.emit();
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
onOpenChange(next, prev) {
|
|
50
|
-
if (next && !prev)
|
|
51
|
-
this.coOpen.emit();
|
|
52
|
-
}
|
|
53
|
-
handleKey(e) {
|
|
54
|
-
if (this.open && this.closeOnEscape && e.key === 'Escape') {
|
|
55
|
-
this.coClose.emit();
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
render() {
|
|
59
|
-
return (index.h("co-overlay", { key: '7f8f76010bc12983c86d0d38bbdb2f73d4f9a30f', open: this.open, onCoClose: this.handleOverlayClose }, index.h("aside", { key: '690c564145cf4b6dcad6f2fd69837f215cc9dff1', class: {
|
|
60
|
-
'co-drawer': true,
|
|
61
|
-
'co-drawer--open': this.open,
|
|
62
|
-
[`co-drawer--${this.position}`]: true,
|
|
63
|
-
[`co-drawer--${this.size}`]: true,
|
|
64
|
-
}, part: "drawer", role: "dialog", "aria-modal": "true", "aria-labelledby": "co-drawer-heading", onClick: this.stopPropagation, onTransitionEnd: this.handleTransitionEnd }, index.h("header", { key: '25bde1a909e3193f58b69b51a96ddc7047b127ad', class: "co-drawer__header", part: "header" }, index.h("div", { key: '8275159a2f5014beeccfa91e3f38e4553a8d4767', class: "co-drawer__header-content" }, index.h("slot", { key: 'c2c820b841b5db2967a33d14a95e17a4ab81c85a', name: "header" }, index.h("h2", { key: '9dd5bc6c6e5a7f82693a44b5ce3b325bf46df2d5', class: "co-drawer__heading", id: "co-drawer-heading" }, this.heading))), this.closable && (index.h("button", { key: 'e9f45d205e7ebf8518b7648b4173d265a781f692', class: "co-drawer__close", type: "button", "aria-label": "Close", onClick: this.handleCloseClick }, index.h("co-icon", { key: '35f4e707c886934c2bbc197e82e9962d0a0239ac', name: "x", size: 20 })))), index.h("div", { key: '7aa4cb9b859aead97347f2a9b2a95f905fee2c8d', class: "co-drawer__tabs", part: "tabs" }, index.h("slot", { key: '76337250192da2fac77af76c0ea05d16acb6ea80', name: "tabs" })), index.h("div", { key: '7ed67e52ee496ab545d40c0869a427a50fc1b4d5', class: "co-drawer__body", part: "body" }, index.h("slot", { key: '433ba3a19c5a8b534907c2ca366b05e63fcf3e20' }), index.h("co-loader", { key: '0e0c33ca5205450f700e35e5664fb0d55c8ec0a6', overlay: true, visible: this.loading, part: "loader" })), index.h("footer", { key: '88e2e9a8f5fc3b8e8fc4875d0eaf5a0953000f01', class: "co-drawer__footer", part: "footer" }, index.h("slot", { key: 'edf5528718a7ddd392776241efc248af028bbecf', name: "footer" })))));
|
|
65
|
-
}
|
|
66
|
-
get el() { return index.getElement(this); }
|
|
67
|
-
static get watchers() { return {
|
|
68
|
-
"open": [{
|
|
69
|
-
"onOpenChange": 0
|
|
70
|
-
}]
|
|
71
|
-
}; }
|
|
72
|
-
};
|
|
73
|
-
CoDrawer.style = coDrawerCss();
|
|
74
|
-
|
|
75
|
-
exports.co_drawer = CoDrawer;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Shared color utilities for Cobalt components.
|
|
5
|
-
* WCAG sRGB relative luminance for contrast detection.
|
|
6
|
-
*/
|
|
7
|
-
function parseHex(hex) {
|
|
8
|
-
if (!hex || typeof hex !== 'string')
|
|
9
|
-
return null;
|
|
10
|
-
const h = hex.replace('#', '');
|
|
11
|
-
if (h.length === 3) {
|
|
12
|
-
return { r: parseInt(h[0] + h[0], 16), g: parseInt(h[1] + h[1], 16), b: parseInt(h[2] + h[2], 16) };
|
|
13
|
-
}
|
|
14
|
-
if (h.length === 6) {
|
|
15
|
-
return { r: parseInt(h.slice(0, 2), 16), g: parseInt(h.slice(2, 4), 16), b: parseInt(h.slice(4, 6), 16) };
|
|
16
|
-
}
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
/** WCAG sRGB relative luminance (0–1). */
|
|
20
|
-
function luminance(hex) {
|
|
21
|
-
const c = parseHex(hex);
|
|
22
|
-
if (!c)
|
|
23
|
-
return 0;
|
|
24
|
-
const [rs, gs, bs] = [c.r / 255, c.g / 255, c.b / 255].map((v) => v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4));
|
|
25
|
-
return 0.2126 * rs + 0.7152 * gs + 0.0722 * bs;
|
|
26
|
-
}
|
|
27
|
-
/** Returns true when the color is perceptually light (needs dark foreground). */
|
|
28
|
-
function isLightColor(hex) {
|
|
29
|
-
return luminance(hex) > 0.4;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
exports.isLightColor = isLightColor;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as a}from"./p-B0lqrhFo.js";import{i as r}from"./p-BG4WRR22.js";const s={xl:80,lg:64,md:56,sm:48,xs:32,xxs:24},i={xl:32,lg:28,md:24,sm:20,xs:16,xxs:12},o={xl:"var(--co-font-size-26)",lg:"var(--co-font-size-22)",md:"var(--co-font-size-18)",sm:"var(--co-font-size-16)",xs:"var(--co-font-size-12)",xxs:"var(--co-font-size-10)"},e=class{constructor(a){t(this,a),this.type="text",this.size="md",this.icon="user",this.iconWeight="regular",this.shape="circle"}render(){var t,e,c;const n=null!==(t=s[this.size])&&void 0!==t?t:56,l=null!==(e=i[this.size])&&void 0!==e?e:24,h=null!==(c=o[this.size])&&void 0!==c?c:"var(--co-font-size-18)";return a("div",{key:"6065912f7c2f812a8313048c727c644f2066845e",class:{"co-avatar":!0,[`co-avatar--${this.size}`]:!0,[`co-avatar--${this.type}`]:!0,"co-avatar--square":"square"===this.shape,"co-avatar--light":!!this.color&&r(this.color)},style:Object.assign({width:`${n}px`,height:`${n}px`,fontSize:h},this.color?{background:this.color}:{}),part:"avatar",role:"img","aria-label":"text"===this.type?this.text:this.icon},"icon"===this.type?a("co-icon",{name:this.icon,weight:this.iconWeight,size:l}):a("span",{class:"co-avatar__text"},this.text))}};e.style=":host{display:inline-flex}.co-avatar{display:inline-flex;align-items:center;justify-content:center;border-radius:var(--co-border-radius-full);background:var(--co-semantic-surface-primary);color:var(--co-semantic-on-primary);font-family:var(--co-font-family-primary);font-weight:600;line-height:1;letter-spacing:var(--co-font-letter-spacing-body);overflow:hidden;flex-shrink:0;user-select:none;-webkit-font-smoothing:antialiased}.co-avatar__text{text-transform:uppercase}.co-avatar--square{border-radius:var(--co-border-radius-xs)}.co-avatar--light{color:rgba(0, 0, 0, 0.87)}";export{e as co_avatar}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as i,h as o,a as r}from"./p-B0lqrhFo.js";import{i as t}from"./p-BG4WRR22.js";const s=class{constructor(o){e(this,o),this.coChange=i(this,"coChange",7),this.coClear=i(this,"coClear",7),this.coSearch=i(this,"coSearch",7),this.coLoadMore=i(this,"coLoadMore",7),this.coOpen=i(this,"coOpen",3),this.coClose=i(this,"coClose",3),this.coCreate=i(this,"coCreate",7),this.coRemove=i(this,"coRemove",7),this.coFooterPrimary=i(this,"coFooterPrimary",7),this.coFooterSecondary=i(this,"coFooterSecondary",7),this.placeholder="Select…",this.disabled=!1,this.clearable=!0,this.multiple=!1,this.status="default",this.value="",this.options="[]",this.selectedDisplay="[]",this.loading=!1,this.total=0,this.searchable=!0,this.searchPlaceholder="Search…",this.searchDebounce=350,this.emptyMessage="No results found",this.showFooter=!1,this.footerPrimaryLabel="Ok",this.footerSecondaryLabel="New",this.maxChips=3,this.isOpen=!1,this.searchText="",this.handlePopoverOpen=()=>{this.isOpen=!0},this.handlePopoverClose=()=>{this.isOpen=!1},this.handleTriggerClick=e=>{this.disabled&&e.stopPropagation()},this.handleSearchInput=e=>{const i=e.target.value;this.searchText=i,this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout((()=>{this.coSearch.emit(i)}),this.searchDebounce)},this.handleOptionClick=e=>{if(this.multiple){const i=this.parsedValue;let o;o=i.indexOf(e._id)>=0?i.filter((i=>i!==e._id)):[...i,e._id],this.value=JSON.stringify(o),this.coChange.emit({value:o,item:e})}else this.value=e._id,this.coChange.emit({value:e._id,item:e}),this.isOpen=!1},this.handleClear=e=>{e.stopPropagation(),this.value=this.multiple?"[]":"",this.coClear.emit()},this.handleRemoveChip=(e,i)=>{i.stopPropagation();const o=this.parsedValue.filter((i=>i!==e));this.value=JSON.stringify(o),this.coRemove.emit(e)},this.handleScroll=()=>{if(!this.optionsEl||this.loading||!this.hasMore)return;const{scrollTop:e,scrollHeight:i,clientHeight:o}=this.optionsEl;e+o>=i-40&&this.coLoadMore.emit()},this.handleCreateClick=()=>{this.coCreate.emit(this.searchText)},this.handleFooterPrimary=()=>{this.coFooterPrimary.emit(),this.isOpen=!1},this.handleFooterSecondary=()=>{this.coFooterSecondary.emit()}}get parsedOptions(){try{const e="string"==typeof this.options?JSON.parse(this.options):this.options;return Array.isArray(e)?e:[]}catch(e){return[]}}get parsedSelectedDisplay(){try{const e="string"==typeof this.selectedDisplay?JSON.parse(this.selectedDisplay):this.selectedDisplay;return Array.isArray(e)?e:[]}catch(e){return[]}}get effectiveDisplayItems(){const e=this.parsedValue;if(0===e.length)return[];const i=new Map;for(const e of this.parsedSelectedDisplay)i.set(e._id,e);for(const e of this.parsedOptions)i.has(e._id)||i.set(e._id,{_id:e._id,label:e.label,description:e.description,color:e.color,avatar:e.avatar});return e.map((e=>i.get(e))).filter(Boolean)}get parsedValue(){if(!this.value)return[];try{const e=JSON.parse(this.value);return Array.isArray(e)?e:[this.value]}catch(e){return this.value?[this.value]:[]}}get hasMore(){return this.parsedOptions.length<this.total}get remainingCount(){return Math.max(0,this.total-this.parsedOptions.length)}disconnectedCallback(){this.debounceTimer&&clearTimeout(this.debounceTimer)}onOpenChange(e){e?(this.coOpen.emit(),requestAnimationFrame((()=>{var e;null===(e=this.searchInputEl)||void 0===e||e.focus()}))):(this.searchText="",this.coClose.emit())}renderTrigger(){const e=this.effectiveDisplayItems,i=e.length>0;return o("div",{class:{"co-ref-field__trigger":!0,"co-ref-field--open":this.isOpen,"co-ref-field--disabled":this.disabled,[`co-ref-field--${this.status}`]:"default"!==this.status},onClick:this.handleTriggerClick},this.iconLeft&&o("span",{class:"co-ref-field__icon"},o("co-icon",{name:this.iconLeft,size:16})),o("div",{class:"co-ref-field__value"},!i&&o("span",{class:"co-ref-field__placeholder"},this.placeholder),i&&!this.multiple&&this.renderSingleValue(e[0]),i&&this.multiple&&this.renderMultipleValue(e)),i&&this.clearable&&!this.disabled&&o("button",{class:"co-ref-field__clear",onClick:this.handleClear,type:"button"},o("co-icon",{name:"x",size:14})),o("span",{class:"co-ref-field__caret"},o("co-icon",{name:"caret-up-down",size:16})))}renderSingleValue(e){return o("div",{class:"co-ref-field__selected"},e.avatar?o("span",{class:{"co-ref-field__avatar-sm":!0,"co-ref-field__avatar-sm--light":!!e.color&&t(e.color)},style:{backgroundColor:e.color||"var(--co-color-primary-azul)"}},e.avatar):e.color?o("span",{class:"co-ref-field__color-dot",style:{backgroundColor:e.color}}):null,o("span",{class:"co-ref-field__selected-label"},e.label))}renderMultipleValue(e){const i=e.slice(0,this.maxChips),r=e.length-this.maxChips;return o("div",{class:"co-ref-field__chips"},i.map((e=>o("span",{class:"co-ref-field__chip",key:e._id},e.color&&o("span",{class:"co-ref-field__chip-dot",style:{backgroundColor:e.color}}),o("span",{class:"co-ref-field__chip-label"},e.label),o("button",{class:"co-ref-field__chip-remove",onClick:i=>this.handleRemoveChip(e._id,i),type:"button"},o("co-icon",{name:"x",size:10}))))),r>0&&o("span",{class:"co-ref-field__chip-overflow"},"+",r))}renderPanel(){const e=this.parsedOptions,i=this.parsedValue;return o("div",{class:"co-ref-field__panel"},this.searchable&&o("div",{class:"co-ref-field__search"},o("co-icon",{name:"magnifying-glass",size:16}),o("input",{class:"co-ref-field__search-input",type:"text",placeholder:this.searchPlaceholder,value:this.searchText,onInput:this.handleSearchInput,ref:e=>this.searchInputEl=e})),o("div",{class:"co-ref-field__options",ref:e=>this.optionsEl=e,onScroll:this.handleScroll},this.loading&&0===e.length&&o("div",{class:"co-ref-field__loading"},o("co-loader",{size:"sm"})),!this.loading&&0===e.length&&o("div",{class:"co-ref-field__empty"},o("co-icon",{name:"magnifying-glass",size:20}),o("span",null,this.emptyMessage)),e.map((e=>{const r=i.includes(e._id);return o("div",{class:{"co-ref-field__option":!0,"co-ref-field__option--selected":r},key:e._id,onClick:()=>this.handleOptionClick(e)},e.avatar&&o("span",{class:{"co-ref-field__option-avatar":!0,"co-ref-field__option-avatar--light":!!e.color&&t(e.color)},style:{backgroundColor:e.color||"var(--co-color-primary-azul)"}},e.avatar),!e.avatar&&e.color&&o("span",{class:"co-ref-field__option-color",style:{backgroundColor:e.color}}),e.icon&&!e.color&&!e.avatar&&o("co-icon",{name:e.icon,size:16,class:"co-ref-field__option-icon"}),o("div",{class:"co-ref-field__option-text"},o("span",{class:"co-ref-field__option-label"},e.label),e.description&&o("span",{class:"co-ref-field__option-desc"},e.description)),r&&o("button",{class:"co-ref-field__option-deselect",onClick:i=>{i.stopPropagation(),this.handleOptionClick(e)},type:"button"},o("co-icon",{name:"x-circle",weight:"fill",size:18})))})),this.loading&&e.length>0&&o("div",{class:"co-ref-field__loading-more"},o("div",{class:"co-ref-field__spinner-sm"})),!this.loading&&this.hasMore&&this.remainingCount>0&&o("div",{class:"co-ref-field__more"},this.remainingCount," more results")),this.showFooter&&o("div",{class:"co-ref-field__footer"},o("button",{class:"co-ref-field__footer-btn co-ref-field__footer-btn--secondary",type:"button",onClick:this.handleFooterSecondary},o("co-icon",{name:"plus",size:16}),o("span",null,this.footerSecondaryLabel)),o("button",{class:"co-ref-field__footer-btn co-ref-field__footer-btn--primary",type:"button",onClick:this.handleFooterPrimary},o("co-icon",{name:"check",size:16}),o("span",null,this.footerPrimaryLabel))),!this.showFooter&&this.createLabel&&o("div",{class:"co-ref-field__footer"},o("button",{class:"co-ref-field__create-btn",onClick:this.handleCreateClick,type:"button"},o("co-icon",{name:"plus",size:14}),o("span",null,this.createLabel))))}render(){return o("div",{key:"6153fa8ba51c07acd9be897e118a7216caa98993",class:"co-ref-field"},(this.label||this.secondaryLabel)&&o("div",{key:"3030bf64028c44ab89e4c9666e38f3024b148e91",class:"co-ref-field__labels"},this.label&&o("label",{key:"23a6315ce9b480f2b5163da2e679b5bd67f62ba8",class:"co-ref-field__label"},this.label),this.secondaryLabel&&o("span",{key:"f3ad11000ff8446603ad9e3d4e2a10ddb16f678f",class:"co-ref-field__secondary-label"},this.secondaryLabel)),o("co-popover",{key:"3fb1374f50cd82d8098b4888e3cdd4fcbc9cbb15",open:this.isOpen,placement:"bottom-start",matchWidth:!0,offset:4,onCoOpen:this.handlePopoverOpen,onCoClose:this.handlePopoverClose},o("div",{key:"ce8fd9568c6a8eb911ceee4dc79d6e1551f61d04",slot:"trigger"},this.renderTrigger()),this.renderPanel()),this.helperText&&o("div",{key:"7f2127c6fd4050db16da696c6c3df250a65e853a",class:`co-ref-field__helper co-ref-field__helper--${this.status}`},"default"!==this.status&&o("co-icon",{key:"0e36272220332148acd867c322baf23b0a056bff",name:"error"===this.status?"warning-circle":"success"===this.status?"check-circle":"info",size:14}),o("span",{key:"28a61124531c5a5a9ea87239133986ae7882744d"},this.helperText)))}get el(){return r(this)}static get watchers(){return{isOpen:[{onOpenChange:0}]}}};s.style=":host{display:block;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);letter-spacing:var(--co-font-letter-spacing-body);line-height:1;position:relative}.co-ref-field{display:flex;flex-direction:column;gap:var(--co-spacing-sm2)}.co-ref-field__labels{display:flex;align-items:center;justify-content:space-between;padding:0 var(--co-spacing-xs);gap:var(--co-spacing-sm2)}.co-ref-field__label{color:var(--co-ref-field-label-color, var(--co-semantic-text-secondary));font-family:var(--co-ref-field-label-font-family, var(--co-font-family-primary));font-size:var(--co-ref-field-label-font-size, var(--co-font-size-12));font-weight:var(--co-ref-field-label-font-weight, 500);line-height:1;white-space:nowrap;cursor:default;text-transform:uppercase;letter-spacing:0.06em}.co-ref-field__secondary-label{color:var(--co-semantic-text-muted);font-family:var(--co-font-family-mono);font-size:var(--co-font-size-12);font-weight:400;line-height:1;white-space:nowrap;text-align:right}.co-ref-field__trigger{display:flex;align-items:center;gap:var(--co-spacing-sm2);padding:var(--co-spacing-sm2) var(--co-spacing-md);background:var(--co-semantic-surface-secondary);border:1px solid var(--co-semantic-border-subtle);border-radius:var(--co-border-radius-xs);min-height:40px;box-sizing:border-box;cursor:pointer;transition:border-color 0.15s ease, box-shadow 0.15s ease}.co-ref-field--open{border-color:var(--co-semantic-border-focus);box-shadow:0 0 0 2px var(--co-semantic-border-focus-ring)}.co-ref-field--disabled{background:var(--co-semantic-surface-disabled);border-color:transparent;cursor:not-allowed}.co-ref-field--error{border-color:var(--co-semantic-status-error)}.co-ref-field--success{border-color:var(--co-semantic-status-success)}.co-ref-field--warning{border-color:var(--co-color-status-review)}.co-ref-field__icon{flex-shrink:0;color:var(--co-semantic-text-muted);display:flex;align-items:center}.co-ref-field__value{flex:1;min-width:0;display:flex;align-items:center}.co-ref-field__placeholder{color:var(--co-semantic-text-muted);font-size:inherit;font-weight:400;line-height:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.co-ref-field__caret{flex-shrink:0;color:var(--co-semantic-text-muted);display:flex;align-items:center}.co-ref-field__clear{flex-shrink:0;display:flex;align-items:center;padding:0;margin:0;border:none;background:transparent;cursor:pointer;color:var(--co-semantic-text-muted);transition:color 0.15s ease}.co-ref-field__clear:hover{color:var(--co-semantic-text-default)}.co-ref-field__selected{display:flex;align-items:center;gap:var(--co-spacing-sm);min-width:0}.co-ref-field__color-dot{width:10px;height:10px;min-width:10px;border-radius:var(--co-border-radius-full);flex-shrink:0}.co-ref-field__avatar-sm{width:24px;height:24px;min-width:24px;border-radius:var(--co-border-radius-xxs);display:flex;align-items:center;justify-content:center;font-size:var(--co-font-size-10);font-weight:700;color:var(--co-color-base-blanco);flex-shrink:0}.co-ref-field__avatar-sm--light{color:rgba(0, 0, 0, 0.87)}.co-ref-field__selected-label{color:var(--co-semantic-text-default);font-size:inherit;font-weight:400;line-height:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.co-ref-field__chips{display:flex;flex-wrap:wrap;gap:var(--co-spacing-xs);align-items:center}.co-ref-field__chip{display:inline-flex;align-items:center;gap:var(--co-spacing-xs);padding:2px var(--co-spacing-sm) 2px var(--co-spacing-sm);background:var(--co-semantic-surface-muted);border-radius:var(--co-border-radius-full);font-size:var(--co-font-size-12);line-height:1;max-width:120px}.co-ref-field__chip-dot{width:8px;height:8px;min-width:8px;border-radius:var(--co-border-radius-full);flex-shrink:0}.co-ref-field__chip-label{color:var(--co-semantic-text-default);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.co-ref-field__chip-remove{display:flex;align-items:center;padding:0;margin:0;border:none;background:transparent;cursor:pointer;color:var(--co-semantic-text-muted);transition:color 0.1s ease;flex-shrink:0}.co-ref-field__chip-remove:hover{color:var(--co-semantic-text-default)}.co-ref-field__chip-overflow{display:inline-flex;align-items:center;justify-content:center;padding:2px var(--co-spacing-sm);background:var(--co-color-opacity-negro-8);border-radius:var(--co-border-radius-full);font-size:var(--co-font-size-12);font-weight:600;color:var(--co-semantic-text-secondary);line-height:1}.co-ref-field__panel{display:flex;flex-direction:column}.co-ref-field__search{display:flex;align-items:center;gap:var(--co-spacing-xs);padding:var(--co-spacing-xs) var(--co-spacing-sm2);margin:var(--co-spacing-sm2) var(--co-spacing-sm2) 0;border:1px solid var(--co-semantic-border-subtle);border-radius:var(--co-border-radius-xs);overflow:hidden;height:32px;box-sizing:border-box;color:var(--co-semantic-text-muted)}.co-ref-field__search co-icon{flex-shrink:0;opacity:0.7;display:flex;align-items:center}.co-ref-field__search-input{flex:1;border:none;outline:none;background:transparent;font-family:inherit;font-size:var(--co-font-size-12, 12px);font-weight:500;letter-spacing:inherit;line-height:1;color:var(--co-semantic-text-default);padding:0;margin:0}.co-ref-field__search-input::placeholder{color:var(--co-semantic-text-muted)}.co-ref-field__options{max-height:280px;overflow-y:auto;overflow-x:hidden;padding:var(--co-spacing-sm2);scrollbar-width:thin;scrollbar-color:var(--co-semantic-border-default) transparent}.co-ref-field__options::-webkit-scrollbar{width:6px}.co-ref-field__options::-webkit-scrollbar-track{background:transparent}.co-ref-field__options::-webkit-scrollbar-thumb{background:var(--co-semantic-border-default);border-radius:var(--co-border-radius-full)}.co-ref-field__option{display:flex;align-items:center;gap:var(--co-spacing-sm2);padding:var(--co-spacing-xs) var(--co-spacing-sm2);border-radius:var(--co-border-radius-xs);cursor:pointer;transition:background 0.1s ease;min-height:40px;box-sizing:border-box}.co-ref-field__option:hover{background:var(--co-semantic-surface-hover)}.co-ref-field__option--selected{background:var(--co-semantic-surface-muted)}.co-ref-field__option-color{width:10px;height:10px;min-width:10px;border-radius:var(--co-border-radius-full);flex-shrink:0}.co-ref-field__option-avatar{width:32px;height:32px;min-width:32px;border-radius:var(--co-border-radius-xxs);display:flex;align-items:center;justify-content:center;font-size:var(--co-font-size-12);font-weight:700;color:var(--co-color-base-blanco);flex-shrink:0;letter-spacing:0.02em}.co-ref-field__option-avatar--light{color:rgba(0, 0, 0, 0.87)}.co-ref-field__option-icon{flex-shrink:0;color:var(--co-semantic-text-muted)}.co-ref-field__option-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.co-ref-field__option-label{color:var(--co-semantic-text-default);font-size:var(--co-font-size-14);font-weight:400;line-height:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.co-ref-field__option-desc{color:var(--co-semantic-text-muted);font-size:var(--co-font-size-12);font-weight:400;line-height:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.co-ref-field__option-check{flex-shrink:0;color:var(--co-semantic-text-default)}.co-ref-field__option-deselect{flex-shrink:0;display:flex;align-items:center;justify-content:center;background:none;border:none;padding:0;cursor:pointer;color:var(--co-semantic-text-muted);transition:color 0.15s ease}.co-ref-field__option-deselect:hover{color:var(--co-semantic-text-default)}.co-ref-field__loading,.co-ref-field__loading-more{display:flex;align-items:center;justify-content:center;padding:var(--co-spacing-md)}.co-ref-field__spinner-sm{width:16px;height:16px;border:2px solid var(--co-semantic-border-subtle);border-top-color:var(--co-color-primary-azul);border-radius:50%;animation:co-ref-spin 0.6s linear infinite}@keyframes co-ref-spin{to{transform:rotate(360deg)}}.co-ref-field__empty{display:flex;flex-direction:column;align-items:center;gap:var(--co-spacing-sm);padding:var(--co-spacing-lg) var(--co-spacing-md);color:var(--co-semantic-text-muted);font-size:var(--co-font-size-12)}.co-ref-field__more{text-align:center;padding:var(--co-spacing-sm);font-size:var(--co-font-size-12);color:var(--co-semantic-text-muted)}.co-ref-field__footer{display:flex;gap:var(--co-spacing-sm2);border-top:1px solid var(--co-semantic-border-subtle);padding:var(--co-spacing-sm2)}.co-ref-field__footer-btn{flex:1;display:flex;align-items:center;justify-content:center;gap:var(--co-spacing-sm);padding:var(--co-spacing-sm2) var(--co-spacing-md);border-radius:var(--co-border-radius-xs);font-family:var(--co-font-family-primary);font-size:var(--co-font-size-12, 12px);font-weight:500;line-height:1;letter-spacing:var(--co-font-letter-spacing-body);white-space:nowrap;cursor:pointer;transition:opacity 0.15s ease;box-sizing:border-box;min-height:32px}.co-ref-field__footer-btn:hover{opacity:0.85}.co-ref-field__footer-btn--secondary{background:transparent;color:var(--co-semantic-text-default);border:1px solid var(--co-semantic-border-default)}.co-ref-field__footer-btn--primary{background:var(--co-semantic-surface-primary);color:var(--co-semantic-on-primary);border:none}.co-ref-field__create-btn{display:flex;align-items:center;gap:var(--co-spacing-sm);width:100%;padding:var(--co-spacing-sm2) var(--co-spacing-md);border:none;border-radius:var(--co-border-radius-xs);background:transparent;cursor:pointer;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);color:var(--co-color-primary-azul);font-weight:500;transition:background 0.1s ease}.co-ref-field__create-btn:hover{background:var(--co-semantic-surface-hover)}.co-ref-field__helper{display:flex;align-items:center;gap:var(--co-spacing-xs);padding:0 var(--co-spacing-xs);font-size:var(--co-font-size-12);color:var(--co-semantic-text-muted)}.co-ref-field__helper--error{color:var(--co-semantic-status-error)}.co-ref-field__helper--success{color:var(--co-semantic-status-success)}.co-ref-field__helper--warning{color:var(--co-color-status-review)}";export{s as co_ref_field}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as c,h as a}from"./p-B0lqrhFo.js";const o=class{constructor(a){c(this,a),this.variant="elevated",this.padding="md",this.clickable=!1}render(){return a("div",{key:"6b4f52af5fc9be705779b0965917552961dd1e3c",class:{"co-card":!0,[`co-card--${this.variant}`]:!0,[`co-card--pad-${this.padding}`]:!0,"co-card--clickable":this.clickable},part:"card",role:this.clickable?"button":void 0,tabIndex:this.clickable?0:void 0},a("div",{key:"fc8e0f408e41e7ae7266b1e2e6be5b2568a1eda5",class:"co-card__header",part:"header"},a("slot",{key:"d287de7e1ecdcbf015a0d5001646ae540947e8f2",name:"header"})),a("div",{key:"163e2aa54cb8b3c371af7ce98543e9fd3133e997",class:"co-card__body",part:"body"},a("slot",{key:"c78f6a0141d654c2ed86ac524decc2cdbc547fb4"})),a("div",{key:"75c86965c7b22aaa80b81684c3130935791c88c4",class:"co-card__footer",part:"footer"},a("slot",{key:"0bd63594d516c0cd32c88be4f46414eb6aed5bb1",name:"footer"})))}};o.style=":host{display:block}.co-card{display:flex;flex-direction:column;font-family:var(--co-font-family-primary);background:var(--co-semantic-surface-page);border-radius:var(--co-border-radius-lg);overflow:hidden;box-sizing:border-box}.co-card--elevated{box-shadow:0 1px 3px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.06)}.co-card--outlined{border:1px solid var(--co-semantic-border-subtle)}.co-card--flat{background:var(--co-semantic-surface-muted)}.co-card--pad-none .co-card__header,.co-card--pad-none .co-card__body,.co-card--pad-none .co-card__footer{padding:0}.co-card--pad-sm .co-card__header,.co-card--pad-sm .co-card__body,.co-card--pad-sm .co-card__footer{padding:var(--co-spacing-sm2) var(--co-spacing-md)}.co-card--pad-md .co-card__header,.co-card--pad-md .co-card__body,.co-card--pad-md .co-card__footer{padding:var(--co-spacing-md) var(--co-spacing-lg)}.co-card--pad-lg .co-card__header,.co-card--pad-lg .co-card__body,.co-card--pad-lg .co-card__footer{padding:var(--co-spacing-lg) var(--co-spacing-xl)}.co-card__header:empty,.co-card__footer:empty{display:none}.co-card__header{border-bottom:1px solid var(--co-semantic-border-subtle)}.co-card__footer{border-top:1px solid var(--co-semantic-border-subtle)}.co-card--clickable{cursor:pointer;transition:box-shadow 0.15s ease}.co-card--clickable:hover{box-shadow:0 2px 6px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.08)}.co-card--clickable:focus-visible{outline:2px solid var(--co-semantic-border-focus);outline-offset:2px}";export{o as co_card}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as a,h as s,a as e}from"./p-B0lqrhFo.js";const c=class{constructor(s){t(this,s),this.coTabChange=a(this,"coTabChange",7)}onTabSelect(t){t.stopPropagation(),this.value=t.detail,this.coTabChange.emit(this.value),this.syncTabs()}watchValue(){this.syncTabs()}componentDidLoad(){this.syncTabs()}syncTabs(){this.el.querySelectorAll("co-tab").forEach((t=>{t.selected=(t.value||t.label)===this.value}))}render(){return s("div",{key:"fb43d323a8146aa707955f62cdb2fc4fedfea6a0",class:"co-tab-group",role:"tablist",part:"tab-group"},s("slot",{key:"96e31ba1a9cf0e21763dff25de4750dfe147b479"}))}get el(){return e(this)}static get watchers(){return{value:[{watchValue:0}]}}};c.style=":host{display:flex}.co-tab-group{display:flex;align-items:center;gap:var(--co-spacing-sm2)}";export{c as co_tab_group}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,c as e,h as t,a as c}from"./p-B0lqrhFo.js";const o=class{constructor(t){i(this,t),this.coInput=e(this,"coInput",7),this.coChange=e(this,"coChange",7),this.coClear=e(this,"coClear",7),this.coFocus=e(this,"coFocus",7),this.coBlur=e(this,"coBlur",7),this.coAction=e(this,"coAction",7),this.placeholder="Placeholder",this.value="",this.disabled=!1,this.readonly=!1,this.clearable=!1,this.layout="vertical",this.type="text",this.required=!1,this.status="default",this.hasFocus=!1,this.handleInput=i=>{this.value=i.target.value,this.coInput.emit(this.value)},this.handleChange=()=>{this.coChange.emit(this.value)},this.handleFocus=()=>{this.hasFocus=!0,this.coFocus.emit()},this.handleBlur=()=>{this.hasFocus=!1,this.coBlur.emit()},this.handleKeyDown=i=>{if("Enter"===i.key){const i=this.el.closest("form");i&&i.requestSubmit()}},this.handleClear=()=>{var i;this.value="",this.coClear.emit(),this.coInput.emit(""),null===(i=this.inputEl)||void 0===i||i.focus()},this.handleAction=()=>{this.coAction.emit()}}get hasAction(){return!(!this.actionLabel&&!this.actionIcon)}get hasValue(){return null!=this.value&&""!==this.value}get statusFieldIcon(){switch(this.status){case"success":return"check";case"error":case"warning":return"warning";case"info":return"info";default:return null}}get helperIcon(){switch(this.status){case"error":case"warning":return"warning-circle";case"success":return"check-circle";default:return"info"}}render(){const i=this.clearable&&this.hasValue&&!this.disabled&&!this.readonly;return t("div",{key:"adf9b30a1e30c80aadd40cda78aa58aab550c8eb",class:{"co-input":!0,[`co-input--${this.layout}`]:!0,"co-input--disabled":this.disabled,"co-input--focused":this.hasFocus,"co-input--filled":this.hasValue,[`co-input--${this.status}`]:"default"!==this.status,"co-input--has-action":this.hasAction},part:"wrapper"},(this.label||this.secondaryLabel)&&t("div",{key:"04141c6c3bb90aed8ef85eff89223d881867f297",class:"co-input__labels"},this.label&&t("label",{key:"36cb0df1fd33f24bb71cbb4327907e51678eaab6",class:"co-input__label",part:"label"},this.label),this.secondaryLabel&&t("span",{key:"c9ad30c7e1808025c20da30d8e179fdc714c3652",class:"co-input__secondary-label",part:"secondary-label"},this.secondaryLabel)),t("div",{key:"2f0c9f1af58883225fa72148cef2f1998c0e71bc",class:"co-input__field-row"},t("div",{key:"1cc1787860143d83c4f77f026ad50df7a257e975",class:"co-input__field",part:"field"},this.iconLeft&&t("co-icon",{key:"b6aa8992ea42362499c3f414e3762ec93405e37a",name:this.iconLeft,size:16,class:"co-input__icon co-input__icon--left"}),t("slot",{key:"45b2cac795f8e7bc4299cfc6a9349b4ea69f271e",name:"chips"}),t("div",{key:"8f429d3dcaaea5dc722bfdbe2c2d319946e42b8c",class:"co-input__input-wrapper"},t("input",{key:"2e1c80fd93686f6ce541847483e0b3d75098c0b1",ref:i=>this.inputEl=i,class:"co-input__native",type:this.type,name:this.name,value:this.value,placeholder:this.placeholder,disabled:this.disabled,readOnly:this.readonly,required:this.required,autoComplete:this.autocomplete,onInput:this.handleInput,onChange:this.handleChange,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,part:"input"})),this.clearable&&t("button",{key:"d17166364b0ee3509d72679200aae3ade43e9c62",class:{"co-input__clear":!0,"co-input__clear--hidden":!i},type:"button",tabIndex:-1,onClick:this.handleClear,"aria-label":"Clear input",part:"clear"},t("co-icon",{key:"1bab39f254dc2dfb7457236ba6e56240fa223c0d",name:"x-circle",size:16,weight:"fill"})),this.iconRight&&t("co-icon",{key:"8163a8a31350015fe18de0443984f96a12f0bfa0",name:this.iconRight,size:16,class:"co-input__icon co-input__icon--right"}),this.statusFieldIcon&&t("co-icon",{key:"d5444649632af9239e38d3585aa97a24df3ff7ad",name:this.statusFieldIcon,size:16,class:"co-input__status-icon"}),t("slot",{key:"a70abffe4a46e4400fe6bce5ec2f5bbadff07ee3",name:"suffix"}),t("slot",{key:"4c86167514a4cccfe6cbd002ecae42e718ce51bb"}),t("slot",{key:"de44689baa43be6835c133465b74555fc8b2ec1a",name:"action"})),this.hasAction&&t("button",{key:"79fa0c13fdefb809023b2372d2bbd33b8bfbb8fe",class:"co-input__action",type:"button",onClick:this.handleAction,disabled:this.disabled,part:"action"},this.actionIcon&&t("co-icon",{key:"d4382b393ed71a1f1964a04bface66b8c6df1918",name:this.actionIcon,size:16,class:"co-input__action-icon"}),this.actionLabel&&t("span",{key:"117d048c07cf0c043638aac4f0e3f29140013ec4",class:"co-input__action-label"},this.actionLabel))),this.helperText&&t("div",{key:"1ec10258065fb8fbab2dbe823899a77c6f5ac62d",class:`co-input__helper co-input__helper--${this.status}`,part:"helper"},t("co-icon",{key:"82ff0fb23e25ab4caef0a34511f8f7281ae4e342",name:this.helperIcon,size:14,class:"co-input__helper-icon"}),t("span",{key:"de48de86e89c5cebd5c54a7d89716b17987bba91",class:"co-input__helper-text"},this.helperText)))}get el(){return c(this)}};o.style=':host{display:block;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);letter-spacing:var(--co-font-letter-spacing-body);line-height:1}.co-input{display:flex;flex-direction:column;gap:var(--co-spacing-sm2)}.co-input--horizontal{flex-direction:row;align-items:flex-start}.co-input--horizontal .co-input__labels{flex-shrink:0;padding-top:var(--co-spacing-sm2);min-width:0}.co-input--horizontal .co-input__field-row{flex:1;min-width:0}.co-input__labels{display:flex;align-items:center;justify-content:space-between;padding:0 var(--co-spacing-xs);gap:var(--co-spacing-sm2)}.co-input__label{color:var(--co-semantic-text-secondary);font-size:var(--co-font-size-14);font-weight:400;letter-spacing:var(--co-font-letter-spacing-body);line-height:1;white-space:nowrap;cursor:default}.co-input__secondary-label{color:var(--co-semantic-text-secondary);font-size:var(--co-font-size-14);font-weight:400;letter-spacing:var(--co-font-letter-spacing-body);line-height:1;white-space:nowrap;text-align:right}.co-input__field-row{display:flex;align-items:stretch}.co-input__field{display:flex;align-items:center;gap:var(--co-spacing-sm2);padding:var(--co-spacing-sm2) var(--co-spacing-md);background:var(--co-semantic-surface-secondary);border:1px solid var(--co-semantic-border-subtle);border-radius:var(--co-border-radius-xs);transition:border-color 0.15s ease, box-shadow 0.15s ease;min-height:40px;box-sizing:border-box;overflow:hidden;flex:1;min-width:0}.co-input--has-action .co-input__field{border-radius:var(--co-border-radius-xs) 0 0 var(--co-border-radius-xs);border-right:none}.co-input__field ::slotted([slot="action"]){margin-left:auto;margin-right:calc(-1 * var(--co-spacing-md));margin-top:calc(-1 * var(--co-spacing-sm2));margin-bottom:calc(-1 * var(--co-spacing-sm2));border-radius:0 var(--co-border-radius-xs) var(--co-border-radius-xs) 0;flex-shrink:0}.co-input__field ::slotted([slot="chips"]){display:flex;gap:var(--co-spacing-xxs);align-items:center;flex-wrap:wrap;min-width:0}.co-input__input-wrapper{flex:1;display:flex;align-items:center;min-width:0;min-height:24px;padding:var(--co-spacing-xxs) 0}.co-input__native{width:100%;border:none;outline:none;background:transparent;font-family:inherit;font-size:inherit;font-weight:400;letter-spacing:inherit;line-height:1;color:var(--co-semantic-text-default);padding:0;margin:0}.co-input__native::placeholder{color:var(--co-semantic-text-muted)}.co-input__icon{flex-shrink:0;color:var(--co-semantic-text-muted);display:flex;align-items:center}.co-input__clear{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:16px;padding:0;margin:0;border:none;background:transparent;cursor:pointer;color:var(--co-semantic-text-muted);transition:color 0.15s ease}.co-input__clear--hidden{visibility:hidden;pointer-events:none}.co-input__clear:hover{color:var(--co-semantic-text-default)}.co-input__action{display:flex;align-items:center;gap:var(--co-spacing-sm);padding:var(--co-spacing-sm2) var(--co-spacing-md) var(--co-spacing-sm2) var(--co-spacing-sm2);background:var(--co-semantic-surface-primary);color:var(--co-semantic-on-primary);border:none;border-radius:0 var(--co-border-radius-xs) var(--co-border-radius-xs) 0;cursor:pointer;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);font-weight:400;letter-spacing:var(--co-font-letter-spacing-body);line-height:1;white-space:nowrap;flex-shrink:0;transition:opacity 0.15s ease;box-sizing:border-box}.co-input__action:hover{opacity:0.85}.co-input__action:disabled{opacity:0.4;cursor:not-allowed}.co-input__action-icon{display:flex;align-items:center;flex-shrink:0}.co-input__action-label{display:flex;align-items:center}.co-input__helper{display:flex;align-items:center;gap:var(--co-spacing-xs);padding:0 var(--co-spacing-xs)}.co-input__helper-icon{flex-shrink:0;color:var(--co-semantic-text-muted);display:flex;align-items:center}.co-input__helper-text{color:var(--co-semantic-text-muted);font-size:var(--co-font-size-14);font-weight:400;line-height:1;letter-spacing:var(--co-font-letter-spacing-body)}.co-input--focused .co-input__field{border-color:var(--co-semantic-border-focus);box-shadow:0 0 0 2px var(--co-semantic-border-focus-ring)}.co-input--disabled .co-input__labels .co-input__label,.co-input--disabled .co-input__labels .co-input__secondary-label{color:var(--co-semantic-text-disabled)}.co-input--disabled .co-input__field{background:var(--co-semantic-surface-disabled);border-color:transparent;cursor:not-allowed}.co-input--disabled .co-input__native{color:var(--co-semantic-text-disabled);cursor:not-allowed}.co-input--disabled .co-input__native::placeholder{color:var(--co-semantic-text-disabled)}.co-input--disabled .co-input__icon{color:var(--co-semantic-text-disabled)}.co-input__status-icon{flex-shrink:0;display:flex;align-items:center}.co-input--success .co-input__status-icon{color:var(--co-semantic-status-success)}.co-input--error .co-input__status-icon{color:var(--co-semantic-status-error)}.co-input--warning .co-input__status-icon{color:var(--co-color-status-review)}.co-input--info .co-input__status-icon{color:var(--co-semantic-status-info)}.co-input--error .co-input__field{border-color:var(--co-semantic-status-error)}.co-input--error.co-input--focused .co-input__field{border-color:var(--co-semantic-status-error);box-shadow:0 0 0 2px rgba(170, 46, 27, 0.12)}.co-input__helper--error .co-input__helper-icon,.co-input__helper--error .co-input__helper-text{color:var(--co-semantic-status-error)}.co-input--success .co-input__field{border-color:var(--co-semantic-status-success)}.co-input--success.co-input--focused .co-input__field{border-color:var(--co-semantic-status-success);box-shadow:0 0 0 2px rgba(10, 119, 36, 0.12)}.co-input__helper--success .co-input__helper-icon,.co-input__helper--success .co-input__helper-text{color:var(--co-semantic-status-success)}.co-input--warning .co-input__field{border-color:var(--co-color-status-review)}.co-input--warning.co-input--focused .co-input__field{border-color:var(--co-color-status-review);box-shadow:0 0 0 2px rgba(133, 87, 31, 0.12)}.co-input__helper--warning .co-input__helper-icon,.co-input__helper--warning .co-input__helper-text{color:var(--co-color-status-review)}.co-input--info .co-input__field{border-color:var(--co-semantic-status-info)}.co-input--info.co-input--focused .co-input__field{border-color:var(--co-semantic-status-info);box-shadow:0 0 0 2px rgba(45, 108, 197, 0.12)}.co-input__helper--info .co-input__helper-icon,.co-input__helper--info .co-input__helper-text{color:var(--co-semantic-status-info)}';export{o as co_input}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,c as e,h as t,a as c}from"./p-B0lqrhFo.js";const i=class{constructor(t){o(this,t),this.coChange=e(this,"coChange",7),this.coOpen=e(this,"coOpen",7),this.coClose=e(this,"coClose",7),this.coClear=e(this,"coClear",7),this.coFooterPrimary=e(this,"coFooterPrimary",7),this.coFooterSecondary=e(this,"coFooterSecondary",7),this.placeholder="Placeholder",this.disabled=!1,this.clearable=!0,this.searchable=!1,this.searchPlaceholder="Search",this.showFooter=!1,this.footerPrimaryLabel="Ok",this.footerSecondaryLabel="New Tags",this.options="[]",this.value="[]",this.multiple=!0,this.isOpen=!1,this.searchQuery="",this.overflowCount=0,this.scrollTop=0,this.handleTriggerClick=o=>{console.log("[co-combobox] handleTriggerClick, disabled:",this.disabled),this.disabled&&o.stopPropagation()},this.handlePopoverOpen=()=>{console.log("[co-combobox] handlePopoverOpen called"),this.isOpen=!0},this.handlePopoverClose=()=>{console.log("[co-combobox] handlePopoverClose called"),this.isOpen=!1},this.handleClear=o=>{o.stopPropagation(),this.value="[]",this.coClear.emit(),this.coChange.emit([])},this.handleOptionClick=o=>{const e=[...this.selectedValues],t=e.indexOf(o);t>=0?e.splice(t,1):this.multiple?e.push(o):(e.length=0,e.push(o),this.isOpen=!1),this.value=JSON.stringify(e),this.coChange.emit(e)},this.handleRemoveOption=(o,e)=>{o.stopPropagation();const t=this.selectedValues.filter((o=>o!==e));this.value=JSON.stringify(t),this.coChange.emit(t)},this.handleSearchInput=o=>{this.searchQuery=o.target.value,this.scrollTop=0,this.optionsContainerEl&&(this.optionsContainerEl.scrollTop=0)},this.handleFooterPrimary=()=>{this.coFooterPrimary.emit(),this.isOpen=!1},this.handleFooterSecondary=()=>{this.coFooterSecondary.emit()},this.handleOptionsScroll=o=>{this.scrollTop=o.target.scrollTop}}normalizeOptions(o){return o.map((o=>"string"==typeof o?{label:o,value:o}:o))}get parsedOptions(){if("string"==typeof this.options)try{return this.normalizeOptions(JSON.parse(this.options))}catch(o){return[]}return this.normalizeOptions(this.options)}get selectedValues(){if("string"==typeof this.value)try{return JSON.parse(this.value)}catch(o){return[]}return this.value}get filteredOptions(){if(!this.searchQuery)return this.parsedOptions;const o=this.searchQuery.toLowerCase();return this.parsedOptions.filter((e=>e.label.toLowerCase().includes(o)))}get displayText(){const o=this.selectedValues;if(0===o.length)return"";const e=this.parsedOptions.find((e=>e.value===o[0]));return e?e.label:o[0]}get selectedOptions(){return this.selectedValues.map((o=>this.parsedOptions.find((e=>e.value===o)))).filter((o=>!!o))}get hasValue(){return this.selectedValues.length>0}onOpenChange(o){o?(this.searchQuery="",this.scrollTop=0,this.coOpen.emit()):this.coClose.emit()}onValueChange(){}connectedCallback(){this.resizeObserver=new ResizeObserver((()=>{this.calcOverflow()}))}disconnectedCallback(){var o;null===(o=this.resizeObserver)||void 0===o||o.disconnect()}componentDidRender(){var o,e;this.chipContainerEl&&(null===(o=this.resizeObserver)||void 0===o||o.disconnect(),null===(e=this.resizeObserver)||void 0===e||e.observe(this.chipContainerEl)),this.calcOverflow()}calcOverflow(){if(!this.multiple||!this.chipContainerEl)return;const o=this.chipContainerEl,e=Array.from(o.querySelectorAll("co-chip"));if(0===e.length)return void(0!==this.overflowCount&&(this.overflowCount=0));const t=o.getBoundingClientRect().right;let c=0;for(let o=e.length-1;o>=0&&e[o].getBoundingClientRect().right>t+1;o--)c++;c!==this.overflowCount&&(this.overflowCount=c)}getVirtualSlice(o){const{ITEM_HEIGHT:e,VIEWPORT_ITEMS:t,OVERSCAN:c}=i,a=o.length,s=a*e,r=Math.max(0,Math.floor(this.scrollTop/e)-c);return{totalHeight:s,startIdx:r,endIdx:Math.min(a,r+t+2*c),offsetY:r*e}}render(){const o=this.selectedValues,e=this.filteredOptions;return t("div",{key:"e77d4338436c01bf4aeac90a08ec31c60c320e56",class:{"co-combobox":!0,"co-combobox--open":this.isOpen,"co-combobox--disabled":this.disabled,"co-combobox--filled":this.hasValue},part:"wrapper"},(this.label||this.secondaryLabel)&&t("div",{key:"60f9e0522a8dee4833bbfa564fb55e2bd4b924eb",class:"co-combobox__labels"},this.label&&t("label",{key:"070a1111f508e299313d90364920aca7c2c00062",class:"co-combobox__label",part:"label"},this.label),this.secondaryLabel&&t("span",{key:"77544e3e6783ae2b7e4c51fdf2c614b43db3df18",class:"co-combobox__secondary-label",part:"secondary-label"},this.secondaryLabel)),t("co-popover",{key:"69b76f964e92406025c94c44aa639c7d128643ee",open:this.isOpen,placement:"bottom-start",matchWidth:!0,offset:4,onCoOpen:this.handlePopoverOpen,onCoClose:this.handlePopoverClose},t("div",{key:"4ea12edc1d79d609379fe293f7807af3c4a31c20",slot:"trigger",class:"co-combobox__trigger",part:"trigger",onClick:this.handleTriggerClick},this.iconLeft&&t("co-icon",{key:"7c9053e320c472bd67a621487de2b456714de2b7",name:this.iconLeft,size:16,class:"co-combobox__icon"}),t("div",{key:"1c9e01f82203801fd4e11c3d01448f0caa3d9cd5",class:"co-combobox__input-wrapper",ref:o=>this.chipContainerEl=o},this.multiple&&this.hasValue?this.selectedOptions.map((o=>t("co-chip",{size:"small","icon-mode":"both",label:o.label},t("co-icon",{slot:"icon-left",name:o.icon||"circle",size:10}),t("co-icon",{slot:"icon-right",name:"x-circle",size:10,weight:"fill",onClick:e=>this.handleRemoveOption(e,o.value)})))):t("span",{class:{"co-combobox__text":!0,"co-combobox__text--placeholder":!this.hasValue}},this.hasValue?this.displayText:this.placeholder)),this.multiple&&this.overflowCount>0&&t("span",{key:"dba6a9ca703aa80b0b47b3ca132a3ad4364a5968",class:"co-combobox__overflow-badge"},this.overflowCount),this.clearable&&this.hasValue&&!this.disabled&&t("button",{key:"2b1f12c41ee1eb95a59dc763b6d1c23f191543aa",class:"co-combobox__clear",type:"button",tabIndex:-1,onClick:this.handleClear,"aria-label":"Clear selection",part:"clear"},t("co-icon",{key:"d34a19853a49618668609c963bbf1d6c79170859",name:"x-circle",size:16,weight:"fill"})),t("co-icon",{key:"bc0be278e45f1a4be653f294f4fcea5253491653",name:this.isOpen?"caret-up":"caret-down",size:16,class:"co-combobox__caret"})),t("div",{key:"0a346246fb89f71f1b55e68b102c6d670d2d5e17",class:"co-combobox__dropdown",part:"dropdown"},this.searchable&&t("div",{key:"5c7134c5a68402e62b050d6a1ac43bfa110232b4",class:"co-combobox__search",part:"search"},t("co-icon",{key:"4533ade5d31966b24d6f3f57d32fefe711f2ee5f",name:"magnifying-glass",size:16,class:"co-combobox__search-icon"}),t("input",{key:"edbfb2c18dbba3416410a4bbb67dfffa962eeb57",class:"co-combobox__search-input",type:"text",placeholder:this.searchPlaceholder,value:this.searchQuery,onInput:this.handleSearchInput,part:"search-input"})),t("div",{key:"6734495aca88397e2874e5dda5252bda2a96a5ca",class:"co-combobox__options",part:"options",ref:o=>this.optionsContainerEl=o,onScroll:this.handleOptionsScroll},(()=>{const{totalHeight:c,startIdx:i,endIdx:a,offsetY:s}=this.getVirtualSlice(e);return t("div",{class:"co-combobox__virtual-spacer",style:{height:`${c}px`,position:"relative"}},t("div",{style:{position:"absolute",top:`${s}px`,left:"0",right:"0"}},e.slice(i,a).map((e=>{const c=o.includes(e.value);return t("div",{class:{"co-combobox__option":!0,"co-combobox__option--selected":c},onClick:()=>this.handleOptionClick(e.value),part:"option"},t("div",{class:"co-combobox__option-content"},t("div",{class:"co-combobox__option-icon-wrapper"},t("co-icon",{name:e.icon||"circle",size:20,class:"co-combobox__option-icon"})),t("span",{class:"co-combobox__option-label"},e.label)),c&&this.multiple&&t("button",{class:"co-combobox__option-remove",type:"button",tabIndex:-1,onClick:o=>this.handleRemoveOption(o,e.value),"aria-label":`Remove ${e.label}`},t("co-icon",{name:"x-circle",size:16,weight:"fill"})),c&&!this.multiple&&t("co-icon",{name:"check",size:16,class:"co-combobox__option-check"}))}))))})()),this.showFooter&&t("div",{key:"d618d08c25c1f2d1d04b9e7b19df9b01d79f7002",class:"co-combobox__footer",part:"footer"},t("button",{key:"950ab40c71a96de34f339859b9f69397ad69b1c3",class:"co-combobox__footer-btn co-combobox__footer-btn--secondary",type:"button",onClick:this.handleFooterSecondary},t("co-icon",{key:"89c72b7cbbfab66980fc3b5ff2d6e61cfc0e544d",name:"plus",size:16}),t("span",{key:"167aadfbcae4abccf7e35f2b32e0893f75a495f6"},this.footerSecondaryLabel)),t("button",{key:"92778f91ff795978396c3b99b7f1900645a51cf7",class:"co-combobox__footer-btn co-combobox__footer-btn--primary",type:"button",onClick:this.handleFooterPrimary},t("co-icon",{key:"31c26c2ee563b10948313d750cfce00e5cf47a9f",name:"plus",size:16}),t("span",{key:"4860a6e7399596dd28ad3e0e9c577a1e93ece861"},this.footerPrimaryLabel))))))}get el(){return c(this)}static get watchers(){return{isOpen:[{onOpenChange:0}],value:[{onValueChange:0}]}}};i.ITEM_HEIGHT=34,i.VIEWPORT_ITEMS=8,i.OVERSCAN=3,i.style=":host{display:block;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);letter-spacing:var(--co-font-letter-spacing-body);line-height:1;position:relative}.co-combobox{display:flex;flex-direction:column;gap:var(--co-spacing-sm2);position:relative}.co-combobox__labels{display:flex;align-items:center;justify-content:space-between;padding:0 var(--co-spacing-xs);gap:var(--co-spacing-sm2)}.co-combobox__label{color:var(--co-semantic-text-secondary);font-size:var(--co-font-size-14);font-weight:400;letter-spacing:var(--co-font-letter-spacing-body);line-height:1;white-space:nowrap;cursor:default}.co-combobox__secondary-label{color:var(--co-semantic-text-secondary);font-size:var(--co-font-size-14);font-weight:400;letter-spacing:var(--co-font-letter-spacing-body);line-height:1;white-space:nowrap;text-align:right}.co-combobox__trigger{display:flex;align-items:center;gap:var(--co-spacing-sm2);padding:var(--co-spacing-sm2) var(--co-spacing-md);background:var(--co-semantic-surface-white, white);border:1px solid var(--co-semantic-border-subtle);border-radius:var(--co-border-radius-xs);min-height:40px;box-sizing:border-box;cursor:pointer;transition:border-color 0.15s ease, box-shadow 0.15s ease;overflow:hidden}.co-combobox--open .co-combobox__trigger{border-color:var(--co-semantic-border-focus);box-shadow:0 0 0 2px var(--co-semantic-border-focus-ring)}.co-combobox--disabled .co-combobox__trigger{background:var(--co-semantic-surface-disabled);border-color:transparent;cursor:not-allowed}.co-combobox__icon{flex-shrink:0;color:var(--co-semantic-text-muted);display:flex;align-items:center}.co-combobox--disabled .co-combobox__icon{color:var(--co-semantic-text-disabled)}.co-combobox__input-wrapper{flex:1;display:flex;align-items:center;flex-wrap:nowrap;gap:4px;min-width:0;min-height:24px;padding:var(--co-spacing-xxs) 0;overflow:hidden}.co-combobox__input-wrapper co-chip{--co-chip-max-width:120px;--co-chip-bg:var(--co-semantic-surface-muted);--co-chip-color:var(--co-semantic-text-default);--co-chip-border:1px solid var(--co-semantic-border-subtle);flex-shrink:0}.co-combobox__overflow-badge{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 4px;border-radius:var(--co-border-radius-full);background:var(--co-semantic-surface-info, #2563eb);color:#fff;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-10);font-weight:600;line-height:1;white-space:nowrap}.co-combobox__text{color:var(--co-semantic-text-default);font-family:inherit;font-size:inherit;font-weight:400;letter-spacing:inherit;line-height:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.co-combobox__text--placeholder{color:var(--co-semantic-text-muted)}.co-combobox--disabled .co-combobox__text{color:var(--co-semantic-text-disabled)}.co-combobox__clear{flex-shrink:0;display:flex;align-items:center;justify-content:center;padding:0;margin:0;border:none;background:transparent;cursor:pointer;color:var(--co-semantic-text-muted);transition:color 0.15s ease}.co-combobox__clear:hover{color:var(--co-semantic-text-default)}.co-combobox__caret{flex-shrink:0;color:var(--co-semantic-text-muted);display:flex;align-items:center}.co-combobox--disabled .co-combobox__caret{color:var(--co-semantic-text-disabled)}.co-combobox__dropdown{padding:var(--co-spacing-md);display:flex;flex-direction:column;gap:var(--co-spacing-sm2)}.co-combobox__search{display:flex;align-items:center;gap:var(--co-spacing-xs);padding:var(--co-spacing-xs) var(--co-spacing-sm2);border:1px solid var(--co-semantic-border-subtle);border-radius:var(--co-border-radius-xs);overflow:hidden;height:32px;box-sizing:border-box}.co-combobox__search-icon{flex-shrink:0;color:var(--co-semantic-text-muted);opacity:0.7;display:flex;align-items:center}.co-combobox__search-input{flex:1;border:none;outline:none;background:transparent;font-family:inherit;font-size:var(--co-font-size-12, 12px);font-weight:500;letter-spacing:inherit;line-height:1;color:var(--co-semantic-text-default);padding:0;margin:0}.co-combobox__search-input::placeholder{color:var(--co-semantic-text-muted)}.co-combobox__options{max-height:280px;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:var(--co-semantic-border-subtle) transparent}.co-combobox__options::-webkit-scrollbar{width:6px}.co-combobox__options::-webkit-scrollbar-track{background:transparent;border-radius:3px}.co-combobox__options::-webkit-scrollbar-thumb{background:var(--co-semantic-border-subtle);border-radius:3px;transition:background 0.15s ease}.co-combobox__options::-webkit-scrollbar-thumb:hover{background:var(--co-semantic-text-muted)}.co-combobox__virtual-spacer{width:100%}.co-combobox__option{display:flex;align-items:center;justify-content:space-between;padding:var(--co-spacing-xs) var(--co-spacing-sm);border-radius:var(--co-border-radius-xs);cursor:pointer;height:32px;margin-bottom:2px;box-sizing:border-box;transition:background 0.1s ease}.co-combobox__option:hover{background:var(--co-semantic-surface-hover, rgba(31, 28, 27, 0.04))}.co-combobox__option-content{display:flex;align-items:center;gap:var(--co-spacing-sm2);flex:1;min-width:0}.co-combobox__option-icon-wrapper{width:24px;height:24px;border-radius:6px;overflow:hidden;display:flex;align-items:center;justify-content:center;flex-shrink:0}.co-combobox__option-icon{color:var(--co-semantic-text-muted);display:flex;align-items:center}.co-combobox__option-label{color:var(--co-semantic-text-default);font-size:var(--co-font-size-14);font-weight:400;line-height:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.co-combobox__option-remove{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:6px;overflow:hidden;padding:0;margin:0;border:none;background:transparent;cursor:pointer;color:var(--co-semantic-text-muted);transition:color 0.15s ease}.co-combobox__option-remove:hover{color:var(--co-semantic-text-default)}.co-combobox__option-check{flex-shrink:0;color:var(--co-semantic-text-default)}.co-combobox__footer{display:flex;gap:var(--co-spacing-sm2);padding-top:var(--co-spacing-sm2)}.co-combobox__footer-btn{flex:1;display:flex;align-items:center;justify-content:center;gap:var(--co-spacing-sm);padding:var(--co-spacing-sm2) var(--co-spacing-md);border-radius:var(--co-border-radius-xs);font-family:var(--co-font-family-primary);font-size:var(--co-font-size-12, 12px);font-weight:500;line-height:1;letter-spacing:var(--co-font-letter-spacing-body);white-space:nowrap;cursor:pointer;transition:opacity 0.15s ease;box-sizing:border-box;min-height:32px}.co-combobox__footer-btn:hover{opacity:0.85}.co-combobox__footer-btn--secondary{background:transparent;color:var(--co-semantic-text-default);border:1px solid var(--co-semantic-border-default)}.co-combobox__footer-btn--primary{background:var(--co-semantic-surface-primary);color:var(--co-semantic-on-primary);border:none}";export{i as co_combobox}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as a,h as e,a as o}from"./p-B0lqrhFo.js";const i=class{constructor(e){t(this,e),this.coSort=a(this,"coSort",7),this.coRowSelect=a(this,"coRowSelect",7),this.coSelectAll=a(this,"coSelectAll",7),this.coColumnResize=a(this,"coColumnResize",7),this.coColumnPin=a(this,"coColumnPin",7),this.coRowDblClick=a(this,"coRowDblClick",7),this.coRowClick=a(this,"coRowClick",7),this.columns="[]",this.rows="[]",this.rowKey="_id",this.loading=!1,this.skeletonRows=10,this.emptyTitle="",this.emptyMessage="No records found",this.emptyIcon="magnifying-glass",this.sortField="",this.sortOrder="",this.selectable=!1,this.selectedKeys="[]",this.resizable=!0,this.parsedColumns=[],this.parsedRows=[],this.parsedSelectedKeys=new Set,this.columnWidths=new Map,this.resizingColumn=null,this.resizeStartX=0,this.resizeStartWidth=0}parseColumns(){try{const t="string"==typeof this.columns?JSON.parse(this.columns):this.columns;this.parsedColumns=t,t.forEach((t=>{t.width&&!this.columnWidths.has(t.field)&&this.columnWidths.set(t.field,t.width)}))}catch(t){this.parsedColumns=[]}}parseRows(){try{this.parsedRows="string"==typeof this.rows?JSON.parse(this.rows):this.rows}catch(t){this.parsedRows=[]}}parseSelectedKeys(){try{const t="string"==typeof this.selectedKeys?JSON.parse(this.selectedKeys):this.selectedKeys;this.parsedSelectedKeys=new Set(t)}catch(t){this.parsedSelectedKeys=new Set}}componentWillLoad(){this.parseColumns(),this.parseRows(),this.parseSelectedKeys()}handleSort(t){let a;a=this.sortField===t&&"asc"===this.sortOrder?"desc":"asc",this.sortField=t,this.sortOrder=a,this.coSort.emit({field:t,order:a})}isAllSelected(){return 0!==this.parsedRows.length&&this.parsedRows.every((t=>this.parsedSelectedKeys.has(String(t[this.rowKey]))))}isSomeSelected(){if(0===this.parsedRows.length)return!1;const t=this.parsedRows.filter((t=>this.parsedSelectedKeys.has(String(t[this.rowKey])))).length;return t>0&&t<this.parsedRows.length}handleSelectAll(){const t=!this.isAllSelected()&&!this.isSomeSelected();this.coSelectAll.emit({selected:!this.isAllSelected()||t})}handleRowSelect(t){const a=String(t[this.rowKey]),e=!this.parsedSelectedKeys.has(a);this.coRowSelect.emit({key:a,selected:e})}handleResizeStart(t,a){a.preventDefault(),a.stopPropagation(),this.resizingColumn=t,this.resizeStartX=a.clientX,this.resizeStartWidth=this.columnWidths.get(t)||150;const e=t=>{var a;if(!this.resizingColumn)return;const e=t.clientX-this.resizeStartX,o=(null===(a=this.parsedColumns.find((t=>t.field===this.resizingColumn)))||void 0===a?void 0:a.minWidth)||80,i=Math.max(o,this.resizeStartWidth+e);this.columnWidths=new Map(this.columnWidths.set(this.resizingColumn,i))},o=()=>{if(this.resizingColumn){const t=this.columnWidths.get(this.resizingColumn)||150;this.coColumnResize.emit({field:this.resizingColumn,width:t})}this.resizingColumn=null,document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",o)};document.addEventListener("mousemove",e),document.addEventListener("mouseup",o)}handleRowClick(t,a){this.coRowClick.emit({row:t,index:a})}handleRowDblClick(t,a){this.coRowDblClick.emit({row:t,index:a})}handleColumnPin(t,a){a.stopPropagation(),this.coColumnPin.emit({field:t})}formatCellValue(t){if(null==t)return"";if("boolean"==typeof t)return t?"Yes":"No";if("string"==typeof t){if(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/.test(t))try{const a=new Date(t);if(!isNaN(a.getTime()))return a.toLocaleDateString("es",{year:"numeric",month:"short",day:"numeric"})+" "+a.toLocaleTimeString("es",{hour:"2-digit",minute:"2-digit"})}catch(t){}return t}return"number"==typeof t?String(t):Array.isArray(t)?t.map((t=>this.formatCellValue(t))).join(", "):"object"==typeof t?t.firstName||t.lastName?[t.firstName,t.lastName].filter(Boolean).join(" "):t.name?String(t.name):t.title?String(t.title):t.label?String(t.label):t.stageName?String(t.stageName):t.companyName?String(t.companyName):t.dealName?String(t.dealName):t._id&&Object.keys(t).length<=3?String(t._id):JSON.stringify(t):String(t)}getColumnStyle(t){return Object.assign({},t.sticky?{left:this.selectable?"48px":"0px"}:{})}getColumnWidth(t){return this.columnWidths.get(t.field)||t.width||t.minWidth||150}getTableWidth(){let t=this.selectable?48:0;for(const a of this.parsedColumns)t+=this.getColumnWidth(a);return t}renderColgroup(){return e("colgroup",null,this.selectable&&e("col",{style:{width:"48px"}}),this.parsedColumns.map((t=>e("col",{style:{width:`${this.getColumnWidth(t)}px`,minWidth:`${t.minWidth||80}px`}}))))}renderHeader(){return e("thead",{class:"co-data-table__head"},e("tr",{class:"co-data-table__header-row"},this.selectable&&e("th",{class:"co-data-table__th co-data-table__th--checkbox co-data-table__th--sticky",style:{left:"0px"}},e("co-checkbox",{size:"small",checked:this.isAllSelected(),indeterminate:this.isSomeSelected(),onCoChange:()=>this.handleSelectAll()})),this.parsedColumns.map(((t,a)=>e("th",{class:{"co-data-table__th":!0,"co-data-table__th--sticky":!!t.sticky,"co-data-table__th--sortable":!!t.sortable,"co-data-table__th--sorted":this.sortField===t.field,[`co-data-table__th--align-${t.align||"left"}`]:!0},style:this.getColumnStyle(t),onClick:()=>t.sortable&&this.handleSort(t.field)},e("span",{class:"co-data-table__th-content"},e("span",{class:{"co-data-table__pin-icon":!0,"co-data-table__pin-icon--active":!!t.sticky},title:t.sticky?"Unpin column":"Pin column",onClick:a=>this.handleColumnPin(t.field,a)},e("co-icon",{name:"push-pin",size:14,weight:t.sticky?"fill":"regular"})),e("span",{class:"co-data-table__th-label"},t.label),t.sortable&&e("span",{class:{"co-data-table__sort-icon":!0,"co-data-table__sort-icon--active":this.sortField===t.field}},e("co-icon",{name:"caret-up-down",size:16,weight:this.sortField===t.field?"fill":"regular"}))),this.resizable&&a<this.parsedColumns.length-1&&e("span",{class:{"co-data-table__resize-handle":!0,"co-data-table__resize-handle--active":this.resizingColumn===t.field},onMouseDown:a=>this.handleResizeStart(t.field,a)}))))))}renderBody(){return this.loading?e("tbody",{class:"co-data-table__body"},Array.from({length:this.skeletonRows}).map(((t,a)=>e("tr",{class:"co-data-table__row co-data-table__row--skeleton",key:`skeleton-${a}`},this.selectable&&e("td",{class:"co-data-table__td co-data-table__td--checkbox co-data-table__td--sticky",style:{left:"0px"}},e("div",{class:"co-data-table__skeleton co-data-table__skeleton--checkbox"})),this.parsedColumns.map((t=>e("td",{class:{"co-data-table__td":!0,"co-data-table__td--sticky":!!t.sticky},style:Object.assign({},this.getColumnStyle(t))},e("div",{class:"co-data-table__skeleton"})))))))):e("slot",null)}renderEmpty(){return this.loading||this.parsedRows.length>0?null:e("div",{class:"co-data-table__empty",part:"empty"},e("div",{class:"co-data-table__empty-icon"},e("co-icon",{name:this.emptyIcon,size:32,weight:"regular"})),this.emptyTitle&&e("h3",{class:"co-data-table__empty-title"},this.emptyTitle),this.emptyMessage&&e("p",{class:"co-data-table__empty-message"},this.emptyMessage),e("div",{class:"co-data-table__empty-action"},e("slot",{name:"empty-action"})))}render(){return e("div",{key:"98c9ac2234b00d8c69095f9d9bcd4633d79265a8",class:{"co-data-table":!0,"co-data-table--resizing":null!==this.resizingColumn,"co-data-table--loading":this.loading,"co-data-table--empty":!this.loading&&0===this.parsedRows.length}},e("div",{key:"0e40f9c3b536d58cabe9e61d2beb425337e3391a",class:"co-data-table__scroll"},e("table",{key:"96ee1fce70ab168c2ba40b6e748c0c11cbcccd89",class:"co-data-table__table",style:{width:`${this.getTableWidth()}px`,minWidth:"100%"}},this.renderColgroup(),this.renderHeader(),this.renderBody())),this.renderEmpty())}get el(){return o(this)}static get watchers(){return{columns:[{parseColumns:0}],rows:[{parseRows:0}],selectedKeys:[{parseSelectedKeys:0}]}}};i.style="co-data-table{display:block;flex:1;min-height:0;overflow:hidden}.co-data-table{position:relative;font-family:var(--co-font-family-primary);background:var(--co-color-base-blanco);display:flex;flex-direction:column;height:100%}.co-data-table--resizing{cursor:col-resize;user-select:none}.co-data-table__scroll{flex:1;overflow-x:auto;overflow-y:auto;min-height:0}.co-data-table__table{min-width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed}.co-data-table__head{position:sticky;top:0;z-index:2}.co-data-table__header-row{height:40px}.co-data-table__th{position:relative;padding:var(--co-spacing-md);background:var(--co-color-base-blanco);border-bottom:1px solid var(--co-color-opacity-negro-8);border-right:1px solid var(--co-color-opacity-negro-8);text-align:left;vertical-align:middle;font-size:var(--co-font-size-14);font-weight:500;color:var(--co-semantic-text-default);letter-spacing:var(--co-font-letter-spacing-body);white-space:nowrap;overflow:hidden;box-sizing:border-box}.co-data-table__th:last-child{border-right:none}.co-data-table__th--sortable{cursor:pointer}.co-data-table__th--sortable:hover{background:var(--co-semantic-surface-hover)}.co-data-table__th-content{display:flex;align-items:center;justify-content:space-between;gap:var(--co-spacing-sm)}.co-data-table__pin-icon{display:flex;align-items:center;flex-shrink:0;color:var(--co-color-gray-300);cursor:pointer;opacity:0;transition:opacity 0.15s ease, color 0.15s ease}.co-data-table__pin-icon--active{opacity:1;color:var(--co-semantic-text-default)}.co-data-table__th:hover .co-data-table__pin-icon{opacity:1}.co-data-table__pin-icon:hover{color:var(--co-semantic-text-default)}.co-data-table__th-label{flex:1;overflow:hidden;text-overflow:ellipsis}.co-data-table__sort-icon{display:flex;align-items:center;flex-shrink:0;color:var(--co-color-gray-400);transition:color 0.15s ease}.co-data-table__sort-icon--active{color:var(--co-semantic-text-default)}.co-data-table__th--checkbox,.co-data-table__td--checkbox{width:48px;min-width:48px;max-width:48px;padding:var(--co-spacing-md);text-align:center}.co-data-table__th--sticky,.co-data-table__td--sticky{position:sticky;z-index:1;background:var(--co-color-base-blanco)}.co-data-table__th--sticky{z-index:3}.co-data-table__td--sticky::after,.co-data-table__th--sticky::after{content:'';position:absolute;top:0;right:-4px;bottom:0;width:4px;pointer-events:none;opacity:0;background:linear-gradient(to right, var(--co-color-opacity-negro-8), transparent);transition:opacity 0.15s ease}.co-data-table__resize-handle{position:absolute;top:0;right:-2px;width:5px;height:100%;cursor:col-resize;z-index:1}.co-data-table__resize-handle:hover{background:var(--co-color-primary-azul);opacity:0.3}.co-data-table__resize-handle--active{background:var(--co-color-primary-azul);opacity:0.3}.co-data-table__row{height:48px;transition:background-color 0.15s ease;content-visibility:auto;contain-intrinsic-size:auto 48px}.co-data-table__row:hover{background:var(--co-semantic-surface-hover)}.co-data-table__row--selected{background:var(--co-color-opacity-negro-4)}.co-data-table__row--selected:hover{background:var(--co-color-opacity-negro-8)}.co-data-table__td{padding:var(--co-spacing-md);background:inherit;border-bottom:1px solid var(--co-color-opacity-negro-8);border-right:1px solid var(--co-color-opacity-negro-8);vertical-align:middle;font-size:var(--co-font-size-12);color:var(--co-semantic-text-default);letter-spacing:var(--co-font-letter-spacing-body);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-sizing:border-box}.co-data-table__td:last-child{border-right:none}.co-data-table__th--align-center,.co-data-table__td--align-center{text-align:center}.co-data-table__th--align-right,.co-data-table__td--align-right{text-align:right}.co-data-table__cell-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}.co-data-table--empty .co-data-table__scroll{flex:0 0 auto;overflow:hidden}.co-data-table__empty{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;flex:1;min-height:280px;padding:var(--co-spacing-3xl) var(--co-spacing-lg);gap:var(--co-spacing-sm)}.co-data-table__empty-icon{display:inline-flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:var(--co-border-radius-full);background:var(--co-semantic-surface-muted);color:var(--co-semantic-text-secondary);margin-bottom:var(--co-spacing-sm)}.co-data-table__empty-title{font-size:var(--co-font-size-16);font-weight:600;color:var(--co-semantic-text-default);letter-spacing:-0.03em;margin:0}.co-data-table__empty-message{font-size:var(--co-font-size-14);font-weight:400;color:var(--co-semantic-text-secondary);margin:0;max-width:360px}.co-data-table__empty-action{margin-top:var(--co-spacing-md);display:inline-flex}.co-data-table__empty-action:empty{display:none}.co-data-table__skeleton{height:14px;border-radius:var(--co-border-radius-xxs);background:var(--co-color-gray-100);animation:co-dt-shimmer 1.5s ease-in-out infinite;width:70%}.co-data-table__skeleton--checkbox{width:16px;height:16px;margin:0 auto}@keyframes co-dt-shimmer{0%,100%{opacity:1}50%{opacity:0.4}}.co-data-table__row--skeleton{pointer-events:none;content-visibility:visible}.co-data-table__row--flash-create{animation:co-dt-flash-create 1s ease-out}.co-data-table__row--flash-update{animation:co-dt-flash-update 1s ease-out}.co-data-table__row--flash-delete{animation:co-dt-flash-delete 0.5s ease-out forwards}@keyframes co-dt-flash-create{0%{background-color:rgba(2, 162, 112, 0.15)}100%{background-color:transparent}}@keyframes co-dt-flash-update{0%{background-color:rgba(37, 99, 235, 0.15)}100%{background-color:transparent}}@keyframes co-dt-flash-delete{0%{opacity:1;background-color:rgba(170, 46, 27, 0.1)}100%{opacity:0;height:0;padding:0;overflow:hidden}}";export{i as co_data_table}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as r,h as a,a as o}from"./p-B0lqrhFo.js";const t=class{constructor(a){e(this,a),this.coClose=r(this,"coClose",7),this.coOpen=r(this,"coOpen",7),this.coAfterOpen=r(this,"coAfterOpen",7),this.coAfterClose=r(this,"coAfterClose",7),this.open=!1,this.position="right",this.size="md",this.heading="",this.closable=!0,this.closeOnOverlay=!0,this.closeOnEscape=!0,this.loading=!1,this.handleOverlayClose=()=>{this.closeOnOverlay&&this.coClose.emit()},this.handleCloseClick=()=>{this.coClose.emit()},this.stopPropagation=e=>{e.stopPropagation()},this.handleTransitionEnd=e=>{"transform"===e.propertyName&&(this.open?this.coAfterOpen.emit():this.coAfterClose.emit())}}onOpenChange(e,r){e&&!r&&this.coOpen.emit()}handleKey(e){this.open&&this.closeOnEscape&&"Escape"===e.key&&this.coClose.emit()}render(){return a("co-overlay",{key:"7f8f76010bc12983c86d0d38bbdb2f73d4f9a30f",open:this.open,onCoClose:this.handleOverlayClose},a("aside",{key:"690c564145cf4b6dcad6f2fd69837f215cc9dff1",class:{"co-drawer":!0,"co-drawer--open":this.open,[`co-drawer--${this.position}`]:!0,[`co-drawer--${this.size}`]:!0},part:"drawer",role:"dialog","aria-modal":"true","aria-labelledby":"co-drawer-heading",onClick:this.stopPropagation,onTransitionEnd:this.handleTransitionEnd},a("header",{key:"25bde1a909e3193f58b69b51a96ddc7047b127ad",class:"co-drawer__header",part:"header"},a("div",{key:"8275159a2f5014beeccfa91e3f38e4553a8d4767",class:"co-drawer__header-content"},a("slot",{key:"c2c820b841b5db2967a33d14a95e17a4ab81c85a",name:"header"},a("h2",{key:"9dd5bc6c6e5a7f82693a44b5ce3b325bf46df2d5",class:"co-drawer__heading",id:"co-drawer-heading"},this.heading))),this.closable&&a("button",{key:"e9f45d205e7ebf8518b7648b4173d265a781f692",class:"co-drawer__close",type:"button","aria-label":"Close",onClick:this.handleCloseClick},a("co-icon",{key:"35f4e707c886934c2bbc197e82e9962d0a0239ac",name:"x",size:20}))),a("div",{key:"7aa4cb9b859aead97347f2a9b2a95f905fee2c8d",class:"co-drawer__tabs",part:"tabs"},a("slot",{key:"76337250192da2fac77af76c0ea05d16acb6ea80",name:"tabs"})),a("div",{key:"7ed67e52ee496ab545d40c0869a427a50fc1b4d5",class:"co-drawer__body",part:"body"},a("slot",{key:"433ba3a19c5a8b534907c2ca366b05e63fcf3e20"}),a("co-loader",{key:"0e0c33ca5205450f700e35e5664fb0d55c8ec0a6",overlay:!0,visible:this.loading,part:"loader"})),a("footer",{key:"88e2e9a8f5fc3b8e8fc4875d0eaf5a0953000f01",class:"co-drawer__footer",part:"footer"},a("slot",{key:"edf5528718a7ddd392776241efc248af028bbecf",name:"footer"}))))}get el(){return o(this)}static get watchers(){return{open:[{onOpenChange:0}]}}};t.style=":host{display:contents}.co-drawer{position:fixed;background:var(--co-semantic-surface-page);display:flex;flex-direction:column;font-family:var(--co-font-family-primary);transition:transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);overflow:hidden;will-change:transform;z-index:1}.co-drawer--right{top:0;right:0;margin:6px;height:100vh;height:-webkit-fill-available;border-radius:24px;transform:translateX(calc(100% + 12px));box-shadow:0 4px 24px rgba(0, 0, 0, 0.12)}.co-drawer--right.co-drawer--open{transform:translateX(0)}.co-drawer--left{top:0;left:0;margin:6px;height:100vh;height:-webkit-fill-available;border-radius:24px;transform:translateX(calc(-100% - 12px));box-shadow:0 4px 24px rgba(0, 0, 0, 0.12)}.co-drawer--left.co-drawer--open{transform:translateX(0)}.co-drawer--bottom{bottom:0;left:0;right:0;margin:6px;width:auto;transform:translateY(calc(100% + 12px));box-shadow:0 -4px 24px rgba(0, 0, 0, 0.12);border-radius:24px}.co-drawer--bottom.co-drawer--open{transform:translateY(0)}.co-drawer--right.co-drawer--sm,.co-drawer--left.co-drawer--sm{width:400px;max-width:100vw}.co-drawer--right.co-drawer--md,.co-drawer--left.co-drawer--md{width:520px;max-width:100vw}.co-drawer--right.co-drawer--lg,.co-drawer--left.co-drawer--lg{width:720px;max-width:100vw}.co-drawer--right.co-drawer--xl,.co-drawer--left.co-drawer--xl{width:960px;max-width:100vw}.co-drawer--right.co-drawer--full,.co-drawer--left.co-drawer--full{width:100vw}.co-drawer--bottom.co-drawer--sm{height:40vh}.co-drawer--bottom.co-drawer--md{height:60vh}.co-drawer--bottom.co-drawer--lg{height:80vh}.co-drawer--bottom.co-drawer--xl{height:95vh}.co-drawer--bottom.co-drawer--full{height:100vh}.co-drawer__header{display:flex;align-items:center;gap:var(--co-spacing-md);padding:var(--co-spacing-lg) var(--co-spacing-xl);border-bottom:1px solid var(--co-semantic-border-default);flex-shrink:0}.co-drawer__header-content{flex:1;min-width:0}.co-drawer__heading{margin:0;font-size:var(--co-font-size-18);font-weight:600;color:var(--co-semantic-text-default);line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.co-drawer__close{display:flex;align-items:center;justify-content:center;padding:var(--co-spacing-xs);margin:0;border:none;background:transparent;cursor:pointer;color:var(--co-semantic-text-muted);border-radius:var(--co-border-radius-sm);transition:background 0.1s ease;flex-shrink:0}.co-drawer__close:hover{background:var(--co-semantic-surface-hover)}.co-drawer__close:focus-visible{outline:2px solid var(--co-color-primary-azul);outline-offset:2px}.co-drawer__tabs{flex-shrink:0;border-bottom:1px solid var(--co-semantic-border-default)}.co-drawer__tabs:empty{display:none}.co-drawer__body{flex:1;overflow-y:auto;padding:var(--co-spacing-xl);position:relative}.co-drawer__footer{display:flex;justify-content:flex-end;align-items:center;gap:var(--co-spacing-md);padding:var(--co-spacing-lg) var(--co-spacing-xl);border-top:1px solid var(--co-semantic-border-default);flex-shrink:0}.co-drawer__footer:empty{display:none}@media (max-width: 600px){.co-drawer--right,.co-drawer--left{width:100vw !important}}";export{t as co_drawer}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,h as o}from"./p-B0lqrhFo.js";const e=class{constructor(o){r(this,o)}render(){return o("hr",{key:"50dcc97db96c79c6ce7398d627e991750a0f05ac",class:"co-menu-divider",role:"separator"})}};e.style=":host{display:block}.co-menu-divider{border:0;border-top:1px solid var(--co-semantic-border-subtle, rgba(31, 28, 27, 0.08));margin:var(--co-spacing-xs, 4px) 0}";export{e as co_menu_divider}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as t,h as c,a as s}from"./p-B0lqrhFo.js";const o=class{constructor(c){e(this,c),this.coChange=t(this,"coChange",7),this.coClear=t(this,"coClear",7),this.placeholder="Select…",this.disabled=!1,this.clearable=!1,this.status="default",this.options="[]",this.value="",this.multiple=!1,this.isOpen=!1,this.scrollTop=0,this.handleTriggerClick=e=>{this.disabled&&e.stopPropagation()},this.handlePopoverOpen=()=>{this.isOpen=!0},this.handlePopoverClose=()=>{this.isOpen=!1},this.handleClear=e=>{e.stopPropagation(),this.value=this.multiple?"[]":"",this.coClear.emit(),this.coChange.emit(this.multiple?[]:"")},this.handleOptionClick=e=>{if(this.multiple){const t=[...this.selectedValues],c=t.indexOf(e);c>=0?t.splice(c,1):t.push(e),this.value=JSON.stringify(t),this.coChange.emit(t)}else this.value=e,this.isOpen=!1,this.coChange.emit(e)},this.handleOptionsScroll=e=>{this.scrollTop=e.target.scrollTop}}get parsedOptions(){let e=this.options;if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return[]}return Array.isArray(e)?e.map((e=>"string"==typeof e?{label:e,value:e}:e)):[]}get selectedValues(){if(this.multiple){if("string"==typeof this.value)try{return JSON.parse(this.value)}catch(e){return this.value?[this.value]:[]}return this.value}return"string"==typeof this.value&&this.value?[this.value]:[]}get hasValue(){return this.selectedValues.length>0}get displayText(){const e=this.selectedValues;if(0===e.length)return"";if(!this.multiple){const t=this.parsedOptions.find((t=>t.value===e[0]));return t?t.label:e[0]}return e.map((e=>{const t=this.parsedOptions.find((t=>t.value===e));return t?t.label:e})).join(", ")}get statusIcon(){return{error:"warning-circle",success:"check-circle",warning:"warning",info:"info"}[this.status]||null}onOpenChange(e){e&&(this.scrollTop=0)}getVirtualSlice(e){const{ITEM_HEIGHT:t,VIEWPORT_ITEMS:c,OVERSCAN:s}=o,i=e.length,r=i*t,a=Math.max(0,Math.floor(this.scrollTop/t)-s);return{totalHeight:r,startIdx:a,endIdx:Math.min(i,a+c+2*s),offsetY:a*t}}render(){const e=this.selectedValues,t=this.parsedOptions;return c("div",{key:"62e8257cc3b4e5f21c411fae888c2fbfb5e0966f",class:{"co-select":!0,"co-select--open":this.isOpen,"co-select--disabled":this.disabled,[`co-select--${this.status}`]:"default"!==this.status}},(this.label||this.secondaryLabel)&&c("div",{key:"b686a479a92fa78105a2d8b70544dafee562d04e",class:"co-select__labels"},this.label&&c("label",{key:"605ec7cdd6614397b18010b3c5aa7c563c5f2b5e",class:"co-select__label"},this.label),this.secondaryLabel&&c("span",{key:"808c1038a7beb82a0d8279b45161f0f2058a3f6d",class:"co-select__secondary-label"},this.secondaryLabel)),c("co-popover",{key:"e3c4dfb846300956a721e6d39c0bf01226945b1f",open:this.isOpen,placement:"bottom-start",matchWidth:!0,offset:4,onCoOpen:this.handlePopoverOpen,onCoClose:this.handlePopoverClose},c("div",{key:"9b6a5847d6223317d8df65e7964e4574da426482",slot:"trigger",class:"co-select__trigger",onClick:this.handleTriggerClick},this.iconLeft&&c("co-icon",{key:"d0f62a9e449acf5234d9f876d6e7c97fa181a42b",name:this.iconLeft,size:16,class:"co-select__icon"}),c("span",{key:"ec49195d6e7e15e1400e436ba39bc5dfa119ff66",class:{"co-select__text":!0,"co-select__text--placeholder":!this.hasValue}},this.hasValue?this.displayText:this.placeholder),this.clearable&&this.hasValue&&!this.disabled&&c("button",{key:"14637ea81b731edf44e8d03c9dc316c9e6a5db2c",class:"co-select__clear",type:"button",tabIndex:-1,onClick:this.handleClear,"aria-label":"Clear"},c("co-icon",{key:"965c17bae724c916fdb4ce5438625801446d341e",name:"x-circle",size:16,weight:"fill"})),c("co-icon",{key:"706be511d092a16835d0fc7907b41ea550ba3100",name:this.isOpen?"caret-up":"caret-down",size:16,class:"co-select__caret"})),c("div",{key:"33e5a0c3075357ca4080a4be72c579f34e3a1e94",class:"co-select__dropdown"},c("div",{key:"a6f857d29a52fe2969da4d8536f9d0a0bf9c06dc",class:"co-select__options",ref:e=>this.optionsContainerEl=e,onScroll:this.handleOptionsScroll},(()=>{const{totalHeight:s,startIdx:o,endIdx:i,offsetY:r}=this.getVirtualSlice(t);return c("div",{class:"co-select__virtual-spacer",style:{height:`${s}px`,position:"relative"}},c("div",{style:{position:"absolute",top:`${r}px`,left:"0",right:"0"}},t.slice(o,i).map((t=>{const s=e.includes(t.value),o=!!t.disabled;return c("div",{class:{"co-select__option":!0,"co-select__option--selected":s,"co-select__option--disabled":o},onClick:()=>!o&&this.handleOptionClick(t.value)},t.icon&&c("co-icon",{name:t.icon,size:20,class:"co-select__option-icon"}),c("span",{class:"co-select__option-label"},t.label),s&&c("co-icon",{name:"check",size:16,class:"co-select__option-check"}))}))))})()))),this.helperText&&c("div",{key:"abd1a1647c257674ad54a7d8623f75c211d1ac84",class:`co-select__helper co-select__helper--${this.status}`},this.statusIcon&&c("co-icon",{key:"1db3bfcc66e832bd5c41d2ddf6ae202a1cafa31d",name:this.statusIcon,size:14,weight:"fill",class:"co-select__helper-icon"}),c("span",{key:"b5b66e6ec7c098e8b98bd6f59ef8234630f8ee39",class:"co-select__helper-text"},this.helperText)))}get el(){return s(this)}static get watchers(){return{isOpen:[{onOpenChange:0}]}}};o.ITEM_HEIGHT=34,o.VIEWPORT_ITEMS=8,o.OVERSCAN=3,o.style=":host{display:block;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);letter-spacing:var(--co-font-letter-spacing-body);line-height:1;position:relative}.co-select{display:flex;flex-direction:column;gap:var(--co-spacing-sm2);position:relative}.co-select__labels{display:flex;align-items:center;justify-content:space-between;padding:0 var(--co-spacing-xs);gap:var(--co-spacing-sm2)}.co-select__label{color:var(--co-semantic-text-secondary);font-size:var(--co-font-size-14);font-weight:400;line-height:1;white-space:nowrap;cursor:default}.co-select__secondary-label{color:var(--co-semantic-text-muted);font-size:var(--co-font-size-14);font-weight:400;line-height:1;white-space:nowrap;text-align:right}.co-select--disabled .co-select__label,.co-select--disabled .co-select__secondary-label{color:var(--co-semantic-text-disabled)}.co-select__trigger{display:flex;align-items:center;gap:var(--co-spacing-sm2);padding:var(--co-spacing-sm2) var(--co-spacing-md);background:var(--co-semantic-surface-secondary);border:1px solid var(--co-semantic-border-subtle);border-radius:var(--co-border-radius-xs);min-height:40px;box-sizing:border-box;cursor:pointer;transition:border-color 0.15s ease, box-shadow 0.15s ease}.co-select--open .co-select__trigger{border-color:var(--co-semantic-border-focus);box-shadow:0 0 0 2px var(--co-semantic-border-focus-ring)}.co-select--disabled .co-select__trigger{background:var(--co-semantic-surface-disabled);border-color:transparent;cursor:not-allowed}.co-select--error .co-select__trigger{border-color:var(--co-semantic-status-error)}.co-select--success .co-select__trigger{border-color:var(--co-semantic-status-success)}.co-select--warning .co-select__trigger{border-color:var(--co-color-status-review)}.co-select--info .co-select__trigger{border-color:var(--co-semantic-status-info)}.co-select__icon{flex-shrink:0;color:var(--co-semantic-text-muted);display:flex;align-items:center}.co-select__text{flex:1;min-width:0;color:var(--co-semantic-text-default);font-size:inherit;font-weight:400;line-height:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.co-select__text--placeholder{color:var(--co-semantic-text-muted)}.co-select--disabled .co-select__text{color:var(--co-semantic-text-disabled)}.co-select__clear{flex-shrink:0;display:flex;align-items:center;padding:0;margin:0;border:none;background:transparent;cursor:pointer;color:var(--co-semantic-text-muted);transition:color 0.15s ease}.co-select__clear:hover{color:var(--co-semantic-text-default)}.co-select__caret{flex-shrink:0;color:var(--co-semantic-text-muted);display:flex;align-items:center}.co-select__dropdown{padding:var(--co-spacing-sm2)}.co-select__options{max-height:calc(34px * 8);overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--co-semantic-border-default) transparent}.co-select__options::-webkit-scrollbar{width:6px}.co-select__options::-webkit-scrollbar-track{background:transparent}.co-select__options::-webkit-scrollbar-thumb{background:var(--co-semantic-border-default);border-radius:var(--co-border-radius-full)}.co-select__option{display:flex;align-items:center;gap:var(--co-spacing-sm2);padding:var(--co-spacing-sm2) var(--co-spacing-md);border-radius:var(--co-border-radius-xs);cursor:pointer;transition:background 0.1s ease;min-height:32px;box-sizing:border-box}.co-select__option:hover{background:var(--co-semantic-surface-hover)}.co-select__option--selected{background:var(--co-semantic-surface-muted)}.co-select__option--disabled{opacity:0.4;cursor:not-allowed;pointer-events:none}.co-select__option-icon{flex-shrink:0;color:var(--co-semantic-text-muted)}.co-select__option-label{flex:1;color:var(--co-semantic-text-default);font-size:var(--co-font-size-14);font-weight:400;line-height:1}.co-select__option-check{flex-shrink:0;color:var(--co-semantic-text-default)}.co-select__helper{display:flex;align-items:center;gap:var(--co-spacing-xs);padding:0 var(--co-spacing-xs)}.co-select__helper-icon{flex-shrink:0;display:flex;align-items:center}.co-select__helper-text{color:var(--co-semantic-text-muted);font-size:var(--co-font-size-14);font-weight:400;line-height:1}.co-select__helper--error .co-select__helper-icon,.co-select__helper--error .co-select__helper-text{color:var(--co-semantic-status-error)}.co-select__helper--success .co-select__helper-icon,.co-select__helper--success .co-select__helper-text{color:var(--co-semantic-status-success)}.co-select__helper--warning .co-select__helper-icon,.co-select__helper--warning .co-select__helper-text{color:var(--co-color-status-review)}.co-select__helper--info .co-select__helper-icon,.co-select__helper--info .co-select__helper-text{color:var(--co-semantic-status-info)}";export{o as co_select}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as n,H as s}from"./p-B0lqrhFo.js";const i=new Map,e=class{constructor(n){t(this,n),this.name="",this.weight="regular",this.size=16,this.svgContent=""}async componentWillLoad(){await this.fetch()}async onPropsChange(){await this.fetch()}async fetch(){this.svgContent=this.name?await async function(t,n){const s=`${n}/${t}`;if(i.has(s))return i.get(s);const e=function(t,n){return"regular"===n?`${t}.svg`:`${t}-${n}.svg`}(t,n),r=`https://cdn.jsdelivr.net/npm/@phosphor-icons/core@2.1.1/assets/${n}/${e}`;try{const t=await fetch(r);if(!t.ok)return"";const n=await t.text();return i.set(s,n),n}catch(t){return""}}(this.name,this.weight):""}render(){return n(s,{key:"05b934c6c75b66802014bcb3365110bbd49e8267","aria-hidden":"true",style:{display:"inline-flex",width:`${this.size}px`,height:`${this.size}px`,flexShrink:"0"}},n("span",{key:"15ab00cbd1a8affffb54c257c1c4556a517a556b",part:"svg",innerHTML:this.svgContent}))}static get watchers(){return{name:[{onPropsChange:0}],weight:[{onPropsChange:0}]}}};e.style=":host{display:inline-flex;align-items:center;justify-content:center;color:inherit;line-height:1;flex-shrink:0}span{display:contents}svg{display:block;width:100%;height:100%;fill:currentColor}";export{e as co_icon}
|