@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,451 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { getLightboxStrings } from "../../utils/lightboxI18n";
|
|
3
|
+
const MIN_SCALE = 1;
|
|
4
|
+
const MAX_SCALE = 8;
|
|
5
|
+
const WHEEL_FACTOR = 1.15;
|
|
6
|
+
const DBLCLICK_SCALE = 2.5;
|
|
7
|
+
/**
|
|
8
|
+
* Fullscreen image viewer — dark scrim, zoom (wheel / buttons / double-click,
|
|
9
|
+
* anchored at the cursor), drag-to-pan while zoomed, and prev/next carousel
|
|
10
|
+
* when more than one image is provided. Keyboard: Escape closes, arrows
|
|
11
|
+
* navigate, +/- zoom, 0 resets.
|
|
12
|
+
*
|
|
13
|
+
* Controlled like co-modal: the host owns `open` and reacts to `coClose`.
|
|
14
|
+
*
|
|
15
|
+
* CAVEAT: the root is `position: fixed`, so an ancestor with `transform`,
|
|
16
|
+
* `filter` or `will-change: transform` (e.g. an OPEN co-drawer) becomes its
|
|
17
|
+
* containing block and traps the overlay. When opening from inside such a
|
|
18
|
+
* context, create the element imperatively on `document.body` instead of
|
|
19
|
+
* rendering it declaratively (this is what co-file-field does).
|
|
20
|
+
*
|
|
21
|
+
* @part overlay - Fullscreen scrim container
|
|
22
|
+
* @part toolbar - Top bar (caption + zoom controls + actions)
|
|
23
|
+
* @part image - The active image element
|
|
24
|
+
* @part prev - Previous-image arrow button
|
|
25
|
+
* @part next - Next-image arrow button
|
|
26
|
+
* @part counter - The "i / n" indicator
|
|
27
|
+
* @part close - The close button
|
|
28
|
+
*/
|
|
29
|
+
export class CoLightbox {
|
|
30
|
+
constructor() {
|
|
31
|
+
/** JSON array of {@link LightboxImage} (controlled by the host). */
|
|
32
|
+
this.images = '[]';
|
|
33
|
+
/** Index shown when the viewer opens. */
|
|
34
|
+
this.startIndex = 0;
|
|
35
|
+
/** Whether the viewer is visible. */
|
|
36
|
+
this.open = false;
|
|
37
|
+
this.index = 0;
|
|
38
|
+
this.scale = 1;
|
|
39
|
+
this.tx = 0;
|
|
40
|
+
this.ty = 0;
|
|
41
|
+
this.dragging = false;
|
|
42
|
+
this.lastImagesStr = '';
|
|
43
|
+
this.lastParsed = [];
|
|
44
|
+
this.dragStart = { x: 0, y: 0, tx: 0, ty: 0 };
|
|
45
|
+
/** Focus the close button on the render that follows opening. */
|
|
46
|
+
this.pendingFocus = false;
|
|
47
|
+
this.handleKey = (e) => {
|
|
48
|
+
if (!this.open)
|
|
49
|
+
return;
|
|
50
|
+
switch (e.key) {
|
|
51
|
+
case 'Escape':
|
|
52
|
+
this.requestClose();
|
|
53
|
+
break;
|
|
54
|
+
case 'ArrowLeft':
|
|
55
|
+
this.goTo(-1);
|
|
56
|
+
break;
|
|
57
|
+
case 'ArrowRight':
|
|
58
|
+
this.goTo(1);
|
|
59
|
+
break;
|
|
60
|
+
case '+':
|
|
61
|
+
case '=':
|
|
62
|
+
this.zoomAt(this.scale * WHEEL_FACTOR, 0, 0);
|
|
63
|
+
break;
|
|
64
|
+
case '-':
|
|
65
|
+
this.zoomAt(this.scale / WHEEL_FACTOR, 0, 0);
|
|
66
|
+
break;
|
|
67
|
+
case '0':
|
|
68
|
+
this.resetView();
|
|
69
|
+
break;
|
|
70
|
+
case 'Tab':
|
|
71
|
+
this.trapTab(e);
|
|
72
|
+
return;
|
|
73
|
+
default:
|
|
74
|
+
return; // unhandled keys pass through untouched
|
|
75
|
+
}
|
|
76
|
+
e.preventDefault();
|
|
77
|
+
e.stopPropagation();
|
|
78
|
+
};
|
|
79
|
+
this.requestClose = () => {
|
|
80
|
+
this.coClose.emit();
|
|
81
|
+
};
|
|
82
|
+
this.handleWheel = (e) => {
|
|
83
|
+
e.preventDefault();
|
|
84
|
+
const [px, py] = this.stagePoint(e);
|
|
85
|
+
const factor = e.deltaY < 0 ? WHEEL_FACTOR : 1 / WHEEL_FACTOR;
|
|
86
|
+
this.zoomAt(this.scale * factor, px, py);
|
|
87
|
+
};
|
|
88
|
+
this.handleDblClick = (e) => {
|
|
89
|
+
const [px, py] = this.stagePoint(e);
|
|
90
|
+
this.zoomAt(this.scale > MIN_SCALE ? MIN_SCALE : DBLCLICK_SCALE, px, py);
|
|
91
|
+
};
|
|
92
|
+
this.handlePointerDown = (e) => {
|
|
93
|
+
var _a;
|
|
94
|
+
if (this.scale <= MIN_SCALE)
|
|
95
|
+
return;
|
|
96
|
+
e.preventDefault();
|
|
97
|
+
this.dragging = true;
|
|
98
|
+
this.dragStart = { x: e.clientX, y: e.clientY, tx: this.tx, ty: this.ty };
|
|
99
|
+
(_a = this.imgEl) === null || _a === void 0 ? void 0 : _a.setPointerCapture(e.pointerId);
|
|
100
|
+
};
|
|
101
|
+
this.handlePointerMove = (e) => {
|
|
102
|
+
if (!this.dragging)
|
|
103
|
+
return;
|
|
104
|
+
const tx = this.dragStart.tx + (e.clientX - this.dragStart.x);
|
|
105
|
+
const ty = this.dragStart.ty + (e.clientY - this.dragStart.y);
|
|
106
|
+
[this.tx, this.ty] = this.clampPan(tx, ty, this.scale);
|
|
107
|
+
};
|
|
108
|
+
this.handlePointerUp = (e) => {
|
|
109
|
+
var _a;
|
|
110
|
+
if (!this.dragging)
|
|
111
|
+
return;
|
|
112
|
+
this.dragging = false;
|
|
113
|
+
(_a = this.imgEl) === null || _a === void 0 ? void 0 : _a.releasePointerCapture(e.pointerId);
|
|
114
|
+
};
|
|
115
|
+
this.openOriginal = () => {
|
|
116
|
+
const img = this.parsedImages[this.index];
|
|
117
|
+
if (img === null || img === void 0 ? void 0 : img.src)
|
|
118
|
+
window.open(img.src, '_blank', 'noopener');
|
|
119
|
+
};
|
|
120
|
+
this.stop = (e) => e.stopPropagation();
|
|
121
|
+
}
|
|
122
|
+
get parsedImages() {
|
|
123
|
+
const raw = this.images;
|
|
124
|
+
if (typeof raw !== 'string' || !raw.trim())
|
|
125
|
+
return [];
|
|
126
|
+
if (raw === this.lastImagesStr)
|
|
127
|
+
return this.lastParsed;
|
|
128
|
+
let parsed = [];
|
|
129
|
+
try {
|
|
130
|
+
const p = JSON.parse(raw);
|
|
131
|
+
if (Array.isArray(p))
|
|
132
|
+
parsed = p.filter((i) => i && i.src);
|
|
133
|
+
}
|
|
134
|
+
catch (_a) {
|
|
135
|
+
/* not JSON */
|
|
136
|
+
}
|
|
137
|
+
this.lastImagesStr = raw;
|
|
138
|
+
this.lastParsed = parsed;
|
|
139
|
+
return parsed;
|
|
140
|
+
}
|
|
141
|
+
componentWillLoad() {
|
|
142
|
+
this.index = this.clampIndex(this.startIndex);
|
|
143
|
+
}
|
|
144
|
+
connectedCallback() {
|
|
145
|
+
if (this.open)
|
|
146
|
+
this.attachKeyListener();
|
|
147
|
+
}
|
|
148
|
+
disconnectedCallback() {
|
|
149
|
+
this.detachKeyListener();
|
|
150
|
+
}
|
|
151
|
+
componentDidRender() {
|
|
152
|
+
var _a;
|
|
153
|
+
if (this.pendingFocus) {
|
|
154
|
+
this.pendingFocus = false;
|
|
155
|
+
(_a = this.closeBtnEl) === null || _a === void 0 ? void 0 : _a.focus();
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
onOpenChange(open) {
|
|
159
|
+
var _a, _b, _c;
|
|
160
|
+
if (open) {
|
|
161
|
+
this.index = this.clampIndex(this.startIndex);
|
|
162
|
+
this.resetView();
|
|
163
|
+
this.preloadNeighbors();
|
|
164
|
+
this.attachKeyListener();
|
|
165
|
+
// aria-modal dialog: move focus in on open, restore it on close.
|
|
166
|
+
this.previouslyFocused = (_a = document.activeElement) !== null && _a !== void 0 ? _a : undefined;
|
|
167
|
+
this.pendingFocus = true;
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
this.detachKeyListener();
|
|
171
|
+
(_c = (_b = this.previouslyFocused) === null || _b === void 0 ? void 0 : _b.focus) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
172
|
+
this.previouslyFocused = undefined;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
onStartIndexChange(v) {
|
|
176
|
+
if (this.open) {
|
|
177
|
+
this.index = this.clampIndex(v);
|
|
178
|
+
this.resetView();
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
onImagesChange() {
|
|
182
|
+
this.index = this.clampIndex(this.index);
|
|
183
|
+
}
|
|
184
|
+
// Manual capture-phase listener (not @Listen): while the viewer is open it
|
|
185
|
+
// must own the keyboard — an ancestor co-drawer/co-modal also listens for
|
|
186
|
+
// Escape on document, and without capture + stopPropagation one keypress
|
|
187
|
+
// would close both (losing unsaved drawer state). Capture runs first, and
|
|
188
|
+
// preventDefault keeps arrows/+/- from scrolling the page behind the scrim.
|
|
189
|
+
attachKeyListener() {
|
|
190
|
+
window.addEventListener('keydown', this.handleKey, { capture: true });
|
|
191
|
+
}
|
|
192
|
+
detachKeyListener() {
|
|
193
|
+
window.removeEventListener('keydown', this.handleKey, { capture: true });
|
|
194
|
+
}
|
|
195
|
+
/** Minimal focus trap: Tab cycles through the viewer's own buttons. */
|
|
196
|
+
trapTab(e) {
|
|
197
|
+
var _a, _b, _c;
|
|
198
|
+
const focusables = Array.from((_b = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('button')) !== null && _b !== void 0 ? _b : []);
|
|
199
|
+
if (focusables.length === 0)
|
|
200
|
+
return;
|
|
201
|
+
e.preventDefault();
|
|
202
|
+
e.stopPropagation();
|
|
203
|
+
const active = (_c = this.el.shadowRoot) === null || _c === void 0 ? void 0 : _c.activeElement;
|
|
204
|
+
const i = focusables.indexOf(active);
|
|
205
|
+
const delta = e.shiftKey ? -1 : 1;
|
|
206
|
+
const next = focusables[(i + delta + focusables.length) % focusables.length];
|
|
207
|
+
next.focus();
|
|
208
|
+
}
|
|
209
|
+
clampIndex(i) {
|
|
210
|
+
const n = this.parsedImages.length;
|
|
211
|
+
if (n === 0)
|
|
212
|
+
return 0;
|
|
213
|
+
return Math.min(Math.max(0, i), n - 1);
|
|
214
|
+
}
|
|
215
|
+
resetView() {
|
|
216
|
+
this.scale = 1;
|
|
217
|
+
this.tx = 0;
|
|
218
|
+
this.ty = 0;
|
|
219
|
+
this.dragging = false;
|
|
220
|
+
}
|
|
221
|
+
goTo(delta) {
|
|
222
|
+
const n = this.parsedImages.length;
|
|
223
|
+
if (n < 2)
|
|
224
|
+
return;
|
|
225
|
+
this.index = (this.index + delta + n) % n;
|
|
226
|
+
this.resetView();
|
|
227
|
+
this.coChange.emit(this.index);
|
|
228
|
+
this.preloadNeighbors();
|
|
229
|
+
}
|
|
230
|
+
preloadNeighbors() {
|
|
231
|
+
const imgs = this.parsedImages;
|
|
232
|
+
if (imgs.length < 2)
|
|
233
|
+
return;
|
|
234
|
+
for (const d of [1, -1]) {
|
|
235
|
+
const neighbor = imgs[(this.index + d + imgs.length) % imgs.length];
|
|
236
|
+
if (neighbor === null || neighbor === void 0 ? void 0 : neighbor.src)
|
|
237
|
+
new Image().src = neighbor.src;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
// ── Zoom / pan ────────────────────────────────────────────────
|
|
241
|
+
/** Pan is clamped so the scaled image can't be dragged fully off-stage. */
|
|
242
|
+
clampPan(tx, ty, scale) {
|
|
243
|
+
const stage = this.stageEl;
|
|
244
|
+
const img = this.imgEl;
|
|
245
|
+
if (!stage || !img)
|
|
246
|
+
return [tx, ty];
|
|
247
|
+
const maxTx = Math.max(0, (img.offsetWidth * scale - stage.clientWidth) / 2);
|
|
248
|
+
const maxTy = Math.max(0, (img.offsetHeight * scale - stage.clientHeight) / 2);
|
|
249
|
+
return [Math.min(Math.max(tx, -maxTx), maxTx), Math.min(Math.max(ty, -maxTy), maxTy)];
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Zoom keeping the stage point (px,py — relative to the stage center) fixed:
|
|
253
|
+
* t' = p − (p − t)·(s'/s), with transform-origin at the center.
|
|
254
|
+
*/
|
|
255
|
+
zoomAt(nextScale, px, py) {
|
|
256
|
+
const s = this.scale;
|
|
257
|
+
const ns = Math.min(Math.max(nextScale, MIN_SCALE), MAX_SCALE);
|
|
258
|
+
if (ns === s)
|
|
259
|
+
return;
|
|
260
|
+
const ratio = ns / s;
|
|
261
|
+
let tx = px - (px - this.tx) * ratio;
|
|
262
|
+
let ty = py - (py - this.ty) * ratio;
|
|
263
|
+
if (ns === MIN_SCALE) {
|
|
264
|
+
tx = 0;
|
|
265
|
+
ty = 0;
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
[tx, ty] = this.clampPan(tx, ty, ns);
|
|
269
|
+
}
|
|
270
|
+
this.scale = ns;
|
|
271
|
+
this.tx = tx;
|
|
272
|
+
this.ty = ty;
|
|
273
|
+
}
|
|
274
|
+
stagePoint(e) {
|
|
275
|
+
var _a;
|
|
276
|
+
const rect = (_a = this.stageEl) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
277
|
+
if (!rect)
|
|
278
|
+
return [0, 0];
|
|
279
|
+
return [e.clientX - rect.left - rect.width / 2, e.clientY - rect.top - rect.height / 2];
|
|
280
|
+
}
|
|
281
|
+
render() {
|
|
282
|
+
const s = getLightboxStrings(this.locale);
|
|
283
|
+
const imgs = this.parsedImages;
|
|
284
|
+
const img = imgs[this.index];
|
|
285
|
+
const multi = imgs.length > 1;
|
|
286
|
+
const counter = s.counter
|
|
287
|
+
.replace('{i}', String(this.index + 1))
|
|
288
|
+
.replace('{n}', String(imgs.length));
|
|
289
|
+
return (h("div", { key: '7df4d99f46591697c48d3a069239811d997a4390', class: { 'co-lightbox': true, 'co-lightbox--open': this.open }, part: "overlay", role: "dialog", "aria-modal": "true", "aria-label": img === null || img === void 0 ? void 0 : img.alt, onClick: this.requestClose }, img && (h("div", { key: '2bb47942785b8273f7f3699ab74a67e101ac3eb1', class: "co-lightbox__toolbar", part: "toolbar", onClick: this.stop }, h("span", { key: 'e47844036d53ed71322c8e0cb3b4e926571f1031', class: "co-lightbox__caption", title: img.alt }, img.alt), h("div", { key: 'c7cf53faeb4f303e79316587df60b31964daa549', class: "co-lightbox__zoom" }, h("button", { key: '77b34981937a114d22670414b75d041fdd3d074e', class: "co-lightbox__btn", type: "button", "aria-label": s.zoomOut, title: s.zoomOut, onClick: () => this.zoomAt(this.scale / WHEEL_FACTOR, 0, 0) }, h("co-icon", { key: '16ff12d54c8a3d1cd16342adb79c0baa3ada38a4', name: "minus", size: 16 })), h("button", { key: '66c850302c30966f4ab7d1b0ed1efc41651ebba8', class: "co-lightbox__btn co-lightbox__zoom-value", type: "button", "aria-label": s.zoomReset, title: s.zoomReset, onClick: () => this.resetView() }, Math.round(this.scale * 100), "%"), h("button", { key: 'd9441914db2193d661c3e5a6f1ba65fa70b6f1cf', class: "co-lightbox__btn", type: "button", "aria-label": s.zoomIn, title: s.zoomIn, onClick: () => this.zoomAt(this.scale * WHEEL_FACTOR, 0, 0) }, h("co-icon", { key: 'ace38453321e1a8e0df4bb6ffccff15906e7b8e3', name: "plus", size: 16 }))), h("button", { key: 'bb81d23f14638c2b1a134573ab2a44a848f58abe', class: "co-lightbox__btn", type: "button", "aria-label": s.openOriginal, title: s.openOriginal, onClick: this.openOriginal }, h("co-icon", { key: '42bf9277561388580d2b0797d7d732815629776f', name: "arrow-square-out", size: 16 })), h("button", { key: '500b2af225fd4692fbd472c5b6287a6d3d5f77e9', class: "co-lightbox__btn", part: "close", type: "button", "aria-label": s.close, title: s.close, ref: (el) => (this.closeBtnEl = el), onClick: this.requestClose }, h("co-icon", { key: '7141d31ad2a3e09131dd8084b669c7c3fd13b9e2', name: "x", size: 16 })))), img && (h("div", { key: '47a092023486d0ac585cf0e35a1d0a374c69fd51', class: "co-lightbox__stage", ref: (el) => (this.stageEl = el), onWheel: this.handleWheel }, h("img", { key: '3868a39927e3bfc01201e372c5c30b3dcde73562', class: {
|
|
290
|
+
'co-lightbox__img': true,
|
|
291
|
+
'co-lightbox__img--zoomed': this.scale > MIN_SCALE,
|
|
292
|
+
'co-lightbox__img--dragging': this.dragging,
|
|
293
|
+
}, part: "image", ref: (el) => (this.imgEl = el), src: img.src, alt: img.alt || '', draggable: false, style: { transform: `translate(${this.tx}px, ${this.ty}px) scale(${this.scale})` }, onClick: this.stop, onDblClick: this.handleDblClick, onPointerDown: this.handlePointerDown, onPointerMove: this.handlePointerMove, onPointerUp: this.handlePointerUp, onPointerCancel: this.handlePointerUp }))), img && multi && (h("button", { key: 'b3e3dcab9fd5caeb5a56e621febfde4d0da22147', class: "co-lightbox__nav co-lightbox__nav--prev", part: "prev", type: "button", "aria-label": s.prevImage, title: s.prevImage, onClick: (e) => {
|
|
294
|
+
e.stopPropagation();
|
|
295
|
+
this.goTo(-1);
|
|
296
|
+
} }, h("co-icon", { key: '6dcc8cd799b4acfd1bf048600c5d3e9b97dba746', name: "caret-left", size: 24 }))), img && multi && (h("button", { key: 'a47298cf2436b35b95773cf9151e84192056caf5', class: "co-lightbox__nav co-lightbox__nav--next", part: "next", type: "button", "aria-label": s.nextImage, title: s.nextImage, onClick: (e) => {
|
|
297
|
+
e.stopPropagation();
|
|
298
|
+
this.goTo(1);
|
|
299
|
+
} }, h("co-icon", { key: '7efe343ba92c77e2f760bd7ea236caf325a50c1e', name: "caret-right", size: 24 }))), img && multi && (h("div", { key: '008f102eb44447b7f762c0cd4ba8c19e9fed2ee5', class: "co-lightbox__counter", part: "counter", onClick: this.stop }, counter))));
|
|
300
|
+
}
|
|
301
|
+
static get is() { return "co-lightbox"; }
|
|
302
|
+
static get encapsulation() { return "shadow"; }
|
|
303
|
+
static get originalStyleUrls() {
|
|
304
|
+
return {
|
|
305
|
+
"$": ["co-lightbox.css"]
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
static get styleUrls() {
|
|
309
|
+
return {
|
|
310
|
+
"$": ["co-lightbox.css"]
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
static get properties() {
|
|
314
|
+
return {
|
|
315
|
+
"images": {
|
|
316
|
+
"type": "string",
|
|
317
|
+
"mutable": false,
|
|
318
|
+
"complexType": {
|
|
319
|
+
"original": "string",
|
|
320
|
+
"resolved": "string",
|
|
321
|
+
"references": {}
|
|
322
|
+
},
|
|
323
|
+
"required": false,
|
|
324
|
+
"optional": false,
|
|
325
|
+
"docs": {
|
|
326
|
+
"tags": [],
|
|
327
|
+
"text": "JSON array of {@link LightboxImage} (controlled by the host)."
|
|
328
|
+
},
|
|
329
|
+
"getter": false,
|
|
330
|
+
"setter": false,
|
|
331
|
+
"reflect": false,
|
|
332
|
+
"attribute": "images",
|
|
333
|
+
"defaultValue": "'[]'"
|
|
334
|
+
},
|
|
335
|
+
"startIndex": {
|
|
336
|
+
"type": "number",
|
|
337
|
+
"mutable": false,
|
|
338
|
+
"complexType": {
|
|
339
|
+
"original": "number",
|
|
340
|
+
"resolved": "number",
|
|
341
|
+
"references": {}
|
|
342
|
+
},
|
|
343
|
+
"required": false,
|
|
344
|
+
"optional": false,
|
|
345
|
+
"docs": {
|
|
346
|
+
"tags": [],
|
|
347
|
+
"text": "Index shown when the viewer opens."
|
|
348
|
+
},
|
|
349
|
+
"getter": false,
|
|
350
|
+
"setter": false,
|
|
351
|
+
"reflect": false,
|
|
352
|
+
"attribute": "start-index",
|
|
353
|
+
"defaultValue": "0"
|
|
354
|
+
},
|
|
355
|
+
"open": {
|
|
356
|
+
"type": "boolean",
|
|
357
|
+
"mutable": true,
|
|
358
|
+
"complexType": {
|
|
359
|
+
"original": "boolean",
|
|
360
|
+
"resolved": "boolean",
|
|
361
|
+
"references": {}
|
|
362
|
+
},
|
|
363
|
+
"required": false,
|
|
364
|
+
"optional": false,
|
|
365
|
+
"docs": {
|
|
366
|
+
"tags": [],
|
|
367
|
+
"text": "Whether the viewer is visible."
|
|
368
|
+
},
|
|
369
|
+
"getter": false,
|
|
370
|
+
"setter": false,
|
|
371
|
+
"reflect": true,
|
|
372
|
+
"attribute": "open",
|
|
373
|
+
"defaultValue": "false"
|
|
374
|
+
},
|
|
375
|
+
"locale": {
|
|
376
|
+
"type": "string",
|
|
377
|
+
"mutable": false,
|
|
378
|
+
"complexType": {
|
|
379
|
+
"original": "string",
|
|
380
|
+
"resolved": "string | undefined",
|
|
381
|
+
"references": {}
|
|
382
|
+
},
|
|
383
|
+
"required": false,
|
|
384
|
+
"optional": true,
|
|
385
|
+
"docs": {
|
|
386
|
+
"tags": [],
|
|
387
|
+
"text": "BCP-47 locale for the built-in aria strings (es/en/pt)."
|
|
388
|
+
},
|
|
389
|
+
"getter": false,
|
|
390
|
+
"setter": false,
|
|
391
|
+
"reflect": false,
|
|
392
|
+
"attribute": "locale"
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
static get states() {
|
|
397
|
+
return {
|
|
398
|
+
"index": {},
|
|
399
|
+
"scale": {},
|
|
400
|
+
"tx": {},
|
|
401
|
+
"ty": {},
|
|
402
|
+
"dragging": {}
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
static get events() {
|
|
406
|
+
return [{
|
|
407
|
+
"method": "coClose",
|
|
408
|
+
"name": "coClose",
|
|
409
|
+
"bubbles": false,
|
|
410
|
+
"cancelable": true,
|
|
411
|
+
"composed": true,
|
|
412
|
+
"docs": {
|
|
413
|
+
"tags": [],
|
|
414
|
+
"text": "Emitted when the viewer requests to close (backdrop, X, Escape)."
|
|
415
|
+
},
|
|
416
|
+
"complexType": {
|
|
417
|
+
"original": "void",
|
|
418
|
+
"resolved": "void",
|
|
419
|
+
"references": {}
|
|
420
|
+
}
|
|
421
|
+
}, {
|
|
422
|
+
"method": "coChange",
|
|
423
|
+
"name": "coChange",
|
|
424
|
+
"bubbles": false,
|
|
425
|
+
"cancelable": true,
|
|
426
|
+
"composed": true,
|
|
427
|
+
"docs": {
|
|
428
|
+
"tags": [],
|
|
429
|
+
"text": "Emitted when the active image changes (prev/next/keyboard)."
|
|
430
|
+
},
|
|
431
|
+
"complexType": {
|
|
432
|
+
"original": "number",
|
|
433
|
+
"resolved": "number",
|
|
434
|
+
"references": {}
|
|
435
|
+
}
|
|
436
|
+
}];
|
|
437
|
+
}
|
|
438
|
+
static get elementRef() { return "el"; }
|
|
439
|
+
static get watchers() {
|
|
440
|
+
return [{
|
|
441
|
+
"propName": "open",
|
|
442
|
+
"methodName": "onOpenChange"
|
|
443
|
+
}, {
|
|
444
|
+
"propName": "startIndex",
|
|
445
|
+
"methodName": "onStartIndexChange"
|
|
446
|
+
}, {
|
|
447
|
+
"propName": "images",
|
|
448
|
+
"methodName": "onImagesChange"
|
|
449
|
+
}];
|
|
450
|
+
}
|
|
451
|
+
}
|
|
@@ -30,6 +30,11 @@
|
|
|
30
30
|
background: var(--co-semantic-surface-hover);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
.co-list-item:focus-visible {
|
|
34
|
+
outline: none;
|
|
35
|
+
box-shadow: 0 0 0 2px var(--co-semantic-border-focus);
|
|
36
|
+
}
|
|
37
|
+
|
|
33
38
|
.co-list-item--selected {
|
|
34
39
|
background: var(--co-semantic-surface-muted);
|
|
35
40
|
}
|
|
@@ -19,15 +19,25 @@ export class CoListItem {
|
|
|
19
19
|
return;
|
|
20
20
|
this.coSelect.emit();
|
|
21
21
|
};
|
|
22
|
+
// Keyboard operable like a native option/button: Enter or Space activates it
|
|
23
|
+
// (Space is prevented so the page doesn't scroll).
|
|
24
|
+
this.handleKeyDown = (event) => {
|
|
25
|
+
if (this.disabled)
|
|
26
|
+
return;
|
|
27
|
+
if (event.key === 'Enter' || event.key === ' ' || event.key === 'Spacebar') {
|
|
28
|
+
event.preventDefault();
|
|
29
|
+
this.coSelect.emit();
|
|
30
|
+
}
|
|
31
|
+
};
|
|
22
32
|
}
|
|
23
33
|
render() {
|
|
24
|
-
return (h("div", { key: '
|
|
34
|
+
return (h("div", { key: 'c20c81d99d5377684e95422ef24edc7349b56d78', class: {
|
|
25
35
|
'co-list-item': true,
|
|
26
36
|
'co-list-item--selected': this.selected,
|
|
27
37
|
'co-list-item--disabled': this.disabled,
|
|
28
38
|
'co-list-item--dense': this.dense,
|
|
29
39
|
'co-list-item--has-description': !!this.description,
|
|
30
|
-
}, part: "item", role: "option", "aria-selected": this.selected ? 'true' : 'false', onClick: this.handleClick }, h("span", { key: '
|
|
40
|
+
}, part: "item", role: "option", tabindex: this.disabled ? -1 : 0, "aria-selected": this.selected ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false', onClick: this.handleClick, onKeyDown: this.handleKeyDown }, h("span", { key: '763f88155a5c3f29a44cfd4d49da29636c590bde', class: "co-list-item__prefix" }, this.icon && h("co-icon", { key: 'da92fc7a6b988eb204a5f3bfd267ebd79fcf1230', name: this.icon, size: 18 }), h("slot", { key: 'e00510cf206ce0f863f993bd0ad57bc6d8af2a0d', name: "prefix" })), h("div", { key: '3b5ad6d35640d57d9019e4a020effeef66b16c32', class: "co-list-item__content" }, this.label && h("span", { key: 'c745840c3b94ef786c8efd34567506eab39e969d', class: "co-list-item__label" }, this.label), this.description && h("span", { key: '0988768cf7fde689ed1e995efaefd4168ca17af0', class: "co-list-item__description" }, this.description), h("slot", { key: 'bf6c9f3d55980b433a4d858c58c799f7c3e2898e' })), h("span", { key: '6fb267f7ac2fae4b57efff3a3b6cd2b5f4161d79', class: "co-list-item__suffix" }, h("slot", { key: '9ed7454c37b83cde16a66ce990cad1cf3368e3d9', name: "suffix" }))));
|
|
31
41
|
}
|
|
32
42
|
static get is() { return "co-list-item"; }
|
|
33
43
|
static get encapsulation() { return "shadow"; }
|
|
@@ -111,7 +111,7 @@ export class CoMenu {
|
|
|
111
111
|
(_b = (_a = items[next]) === null || _a === void 0 ? void 0 : _a.focusItem) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
112
112
|
}
|
|
113
113
|
render() {
|
|
114
|
-
return (h("co-popover", { key: '
|
|
114
|
+
return (h("co-popover", { key: 'dcdcbba45a201fbd121c94fa10cfbfe9c5d3792b', placement: this.placement, offset: this.offset, open: this.open, onCoOpen: this.handlePopoverOpen, onCoClose: this.handlePopoverClose }, h("slot", { key: '44d999a9fad8f6950ded890c97b047733aff4080', name: "trigger", slot: "trigger" }), h("div", { key: 'd4ea139be0a26e84e50207f332c2e4f00126d717', class: "co-menu", role: "menu" }, h("slot", { key: 'c00f197bae58f3e8e0fe56fda4489fe7878fd995' }))));
|
|
115
115
|
}
|
|
116
116
|
static get is() { return "co-menu"; }
|
|
117
117
|
static get encapsulation() { return "shadow"; }
|
|
@@ -5,7 +5,7 @@ import { h } from "@stencil/core";
|
|
|
5
5
|
*/
|
|
6
6
|
export class CoMenuDivider {
|
|
7
7
|
render() {
|
|
8
|
-
return h("hr", { key: '
|
|
8
|
+
return h("hr", { key: '6e4378c89e42bfa38073213cb7a27dfb3401f663', class: "co-menu-divider", role: "separator" });
|
|
9
9
|
}
|
|
10
10
|
static get is() { return "co-menu-divider"; }
|
|
11
11
|
static get encapsulation() { return "shadow"; }
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
.co-modal {
|
|
6
6
|
display: flex;
|
|
7
7
|
flex-direction: column;
|
|
8
|
-
background: var(--co-semantic-surface-
|
|
8
|
+
background: var(--co-semantic-surface-secondary);
|
|
9
9
|
border-radius: var(--co-border-radius-xl);
|
|
10
10
|
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
|
|
11
11
|
max-width: 540px;
|
|
@@ -18,8 +18,11 @@
|
|
|
18
18
|
transition: transform 0.2s ease, opacity 0.2s ease;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
.co-modal--sm { max-width: 400px; }
|
|
22
|
+
.co-modal--lg { max-width: 680px; }
|
|
23
|
+
|
|
21
24
|
.co-modal--open {
|
|
22
|
-
transform:
|
|
25
|
+
transform: none;
|
|
23
26
|
opacity: 1;
|
|
24
27
|
}
|
|
25
28
|
|
|
@@ -74,11 +77,12 @@
|
|
|
74
77
|
|
|
75
78
|
/* ─── Body ──────────────────────────────────────────────────── */
|
|
76
79
|
.co-modal__body {
|
|
77
|
-
padding: var(--co-spacing-
|
|
80
|
+
padding: var(--co-spacing-lg) var(--co-spacing-xl);
|
|
78
81
|
overflow-y: auto;
|
|
79
82
|
font-size: var(--co-font-size-14);
|
|
80
83
|
color: var(--co-semantic-text-secondary);
|
|
81
84
|
line-height: 1.6;
|
|
85
|
+
border-top: 1px solid var(--co-semantic-border-default);
|
|
82
86
|
}
|
|
83
87
|
|
|
84
88
|
.co-modal__body:empty { display: none; }
|
|
@@ -89,6 +93,16 @@
|
|
|
89
93
|
justify-content: flex-end;
|
|
90
94
|
gap: var(--co-spacing-md);
|
|
91
95
|
padding: var(--co-spacing-lg) var(--co-spacing-xl) var(--co-spacing-xl);
|
|
96
|
+
border-top: 1px solid var(--co-semantic-border-default);
|
|
97
|
+
/* Footer action buttons default to square corners (inherited by slotted
|
|
98
|
+
co-buttons via --co-button-radius). Override per button with shape or by
|
|
99
|
+
resetting --co-button-radius. */
|
|
100
|
+
--co-button-radius: var(--co-border-radius-xs);
|
|
92
101
|
}
|
|
93
102
|
|
|
94
103
|
.co-modal__footer:empty { display: none; }
|
|
104
|
+
|
|
105
|
+
/* ─── No dividers variant ───────────────────────────────────── */
|
|
106
|
+
.co-modal--no-dividers .co-modal__footer {
|
|
107
|
+
border-top: none;
|
|
108
|
+
}
|
|
@@ -13,6 +13,10 @@ export class CoModal {
|
|
|
13
13
|
this.closable = true;
|
|
14
14
|
/** Close when clicking the overlay backdrop */
|
|
15
15
|
this.closeOnOverlay = true;
|
|
16
|
+
/** Modal width: sm (400px), md (540px), lg (680px) */
|
|
17
|
+
this.size = 'md';
|
|
18
|
+
/** Hide body section and all border dividers (compact confirm dialogs) */
|
|
19
|
+
this.noDividers = false;
|
|
16
20
|
this.handleOverlayClick = () => {
|
|
17
21
|
if (this.closeOnOverlay)
|
|
18
22
|
this.coClose.emit();
|
|
@@ -25,7 +29,13 @@ export class CoModal {
|
|
|
25
29
|
};
|
|
26
30
|
}
|
|
27
31
|
render() {
|
|
28
|
-
return (h("co-overlay", { key: '
|
|
32
|
+
return (h("co-overlay", { key: '8b8d87da7d6d0cc1f8758dc85d536901c1b8e559', open: this.open, onCoClose: this.handleOverlayClick }, h("div", { key: '21406763f2a69fbb8d6deca46d06e5d470aa3238', class: {
|
|
33
|
+
'co-modal': true,
|
|
34
|
+
'co-modal--open': this.open,
|
|
35
|
+
'co-modal--sm': this.size === 'sm',
|
|
36
|
+
'co-modal--lg': this.size === 'lg',
|
|
37
|
+
'co-modal--no-dividers': this.noDividers,
|
|
38
|
+
}, part: "modal", role: "dialog", "aria-modal": "true", "aria-labelledby": "modal-heading", onClick: this.stopPropagation }, h("div", { key: 'e0cbf1b770a791d94185500e98550de7428cf61d', class: "co-modal__header", part: "header" }, h("div", { key: '493aaaed168299eb167514dae238e218ce53b78e', class: "co-modal__header-text" }, h("h2", { key: 'de76fdc6f85420119170425b7166807c2c81df0f', class: "co-modal__heading", id: "modal-heading" }, this.heading), this.description && (h("p", { key: 'c5c0ec7113a1715c4db372b6641fcac2989ff113', class: "co-modal__description" }, this.description))), this.closable && (h("button", { key: '64bae9c3dcac4e036671d36863f419eb051a986c', class: "co-modal__close", type: "button", "aria-label": "Close", onClick: this.handleCloseClick }, h("co-icon", { key: '74fffda310bb8c09812239218f6ee0ca413be44a', name: "x", size: 20 })))), !this.noDividers && (h("div", { key: '448b9b55b2bf70b57d478938ab9bb3704d3bcf10', class: "co-modal__body", part: "body" }, h("slot", { key: '77ac168d42a68fac4dd240f2b8dfa5f2ff2ce2bc' }))), h("div", { key: 'd72a9dfdb6a8b1f5f182746eb2df3551bb27f884', class: "co-modal__footer", part: "footer" }, h("slot", { key: '97b3f2d7f2838388f80817d123a9970b159c9223', name: "footer" })))));
|
|
29
39
|
}
|
|
30
40
|
static get is() { return "co-modal"; }
|
|
31
41
|
static get encapsulation() { return "shadow"; }
|
|
@@ -139,6 +149,46 @@ export class CoModal {
|
|
|
139
149
|
"reflect": false,
|
|
140
150
|
"attribute": "close-on-overlay",
|
|
141
151
|
"defaultValue": "true"
|
|
152
|
+
},
|
|
153
|
+
"size": {
|
|
154
|
+
"type": "string",
|
|
155
|
+
"mutable": false,
|
|
156
|
+
"complexType": {
|
|
157
|
+
"original": "'sm' | 'md' | 'lg'",
|
|
158
|
+
"resolved": "\"lg\" | \"md\" | \"sm\"",
|
|
159
|
+
"references": {}
|
|
160
|
+
},
|
|
161
|
+
"required": false,
|
|
162
|
+
"optional": false,
|
|
163
|
+
"docs": {
|
|
164
|
+
"tags": [],
|
|
165
|
+
"text": "Modal width: sm (400px), md (540px), lg (680px)"
|
|
166
|
+
},
|
|
167
|
+
"getter": false,
|
|
168
|
+
"setter": false,
|
|
169
|
+
"reflect": true,
|
|
170
|
+
"attribute": "size",
|
|
171
|
+
"defaultValue": "'md'"
|
|
172
|
+
},
|
|
173
|
+
"noDividers": {
|
|
174
|
+
"type": "boolean",
|
|
175
|
+
"mutable": false,
|
|
176
|
+
"complexType": {
|
|
177
|
+
"original": "boolean",
|
|
178
|
+
"resolved": "boolean",
|
|
179
|
+
"references": {}
|
|
180
|
+
},
|
|
181
|
+
"required": false,
|
|
182
|
+
"optional": false,
|
|
183
|
+
"docs": {
|
|
184
|
+
"tags": [],
|
|
185
|
+
"text": "Hide body section and all border dividers (compact confirm dialogs)"
|
|
186
|
+
},
|
|
187
|
+
"getter": false,
|
|
188
|
+
"setter": false,
|
|
189
|
+
"reflect": true,
|
|
190
|
+
"attribute": "no-dividers",
|
|
191
|
+
"defaultValue": "false"
|
|
142
192
|
}
|
|
143
193
|
};
|
|
144
194
|
}
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
.co-navbar--dark {
|
|
33
|
-
--co-navbar-bg: var(--co-theme-navbar-bg, var(--co-color-
|
|
33
|
+
--co-navbar-bg: var(--co-theme-navbar-bg, var(--co-color-base-negro, #1F1C1B));
|
|
34
34
|
--co-navbar-color: var(--co-theme-on-navbar, #fff);
|
|
35
35
|
backdrop-filter: blur(40px);
|
|
36
36
|
-webkit-backdrop-filter: blur(40px);
|