@prolibu-suite/cobalt-core 0.9.6 → 0.10.1
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 +1125 -89
- package/dist/cjs/co-accordion.cjs.entry.js +5 -5
- package/dist/cjs/co-action-bar.cjs.entry.js +2 -2
- package/dist/cjs/co-app-shell.cjs.entry.js +4 -4
- package/dist/cjs/co-audio-player.cjs.entry.js +83 -13
- package/dist/cjs/co-autocomplete.cjs.entry.js +2 -2
- package/dist/cjs/co-avatar-group.cjs.entry.js +1 -1
- package/dist/cjs/co-avatar.cjs.entry.js +72 -0
- package/dist/cjs/co-badge.cjs.entry.js +11 -3
- package/dist/cjs/co-bottom-sheet.cjs.entry.js +1 -1
- package/dist/cjs/co-breadcrumb-item.cjs.entry.js +1 -1
- package/dist/cjs/co-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/co-button-group.cjs.entry.js +1 -1
- package/dist/cjs/co-button.cjs.entry.js +2 -2
- package/dist/cjs/co-calendar-month_2.cjs.entry.js +55 -20
- package/dist/cjs/co-calendar_3.cjs.entry.js +27 -15
- package/dist/cjs/co-card.cjs.entry.js +1 -1
- package/dist/cjs/co-carousel-item.cjs.entry.js +1 -1
- package/dist/cjs/co-carousel.cjs.entry.js +2 -2
- package/dist/cjs/co-checkbox-group.cjs.entry.js +2 -2
- package/dist/cjs/co-checkbox.cjs.entry.js +6 -6
- package/dist/cjs/co-chip_2.cjs.entry.js +68 -13
- package/dist/cjs/co-color-picker.cjs.entry.js +1078 -27
- package/dist/cjs/co-column-picker.cjs.entry.js +3 -3
- package/dist/cjs/co-combobox.cjs.entry.js +2 -2
- package/dist/cjs/co-command-search.cjs.entry.js +1 -1
- package/dist/cjs/co-data-table-pagination.cjs.entry.js +5 -5
- package/dist/cjs/co-data-table.cjs.entry.js +83 -5
- package/dist/cjs/co-date-picker.cjs.entry.js +3 -3
- package/dist/cjs/co-date-range-picker.cjs.entry.js +3 -3
- package/dist/cjs/co-date-range.cjs.entry.js +2 -2
- package/dist/cjs/co-date-time-picker.cjs.entry.js +101 -130
- package/dist/cjs/co-drive-card.cjs.entry.js +2 -2
- package/dist/cjs/co-drop-zone.cjs.entry.js +2 -2
- package/dist/cjs/co-emoji-picker.cjs.entry.js +4 -4
- package/dist/cjs/co-empty-state.cjs.entry.js +4 -4
- package/dist/cjs/co-event-calendar.cjs.entry.js +4 -4
- package/dist/cjs/co-event-popover.cjs.entry.js +3 -3
- package/dist/cjs/co-fab.cjs.entry.js +3 -3
- package/dist/cjs/co-file-field.cjs.entry.js +102 -106
- package/dist/cjs/co-file-type-tile.cjs.entry.js +3 -3
- package/dist/cjs/co-helper-text.cjs.entry.js +3 -3
- package/dist/cjs/co-icon-button.cjs.entry.js +6 -6
- package/dist/cjs/co-icon.cjs.entry.js +3 -3
- package/dist/cjs/co-input.cjs.entry.js +32 -6
- package/dist/cjs/co-json-field.cjs.entry.js +5 -5
- package/dist/cjs/co-lightbox.cjs.entry.js +204 -21
- package/dist/cjs/co-list-footer.cjs.entry.js +2 -2
- package/dist/cjs/co-list-item.cjs.entry.js +5 -5
- package/dist/cjs/co-loader.cjs.entry.js +1 -1
- package/dist/cjs/co-media-thumb.cjs.entry.js +3 -3
- package/dist/cjs/co-menu-divider.cjs.entry.js +2 -2
- package/dist/cjs/co-menu-item.cjs.entry.js +85 -4
- package/dist/cjs/co-menu.cjs.entry.js +2 -2
- package/dist/cjs/co-modal.cjs.entry.js +10 -4
- package/dist/cjs/co-navbar.cjs.entry.js +4 -4
- package/dist/cjs/co-number-field.cjs.entry.js +272 -9
- package/dist/cjs/co-overlay.cjs.entry.js +6 -4
- package/dist/cjs/co-page-header.cjs.entry.js +2 -2
- package/dist/cjs/co-phone-field.cjs.entry.js +3 -3
- package/dist/cjs/co-popover.cjs.entry.js +58 -21
- package/dist/cjs/co-progress-bar.cjs.entry.js +3 -3
- package/dist/cjs/co-progress-circle.cjs.entry.js +3 -3
- package/dist/cjs/co-provider-logo_2.cjs.entry.js +47 -3
- package/dist/cjs/co-radio-group.cjs.entry.js +1 -1
- 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 +104 -13
- package/dist/cjs/co-rich-text-editor.cjs.entry.js +11 -8
- package/dist/cjs/co-rich-text-toolbar.cjs.entry.js +7 -3
- package/dist/cjs/co-rich-text-viewer.cjs.entry.js +4 -3
- package/dist/cjs/co-row.cjs.entry.js +3 -3
- package/dist/cjs/co-segmented-bar.cjs.entry.js +1 -1
- package/dist/cjs/co-select.cjs.entry.js +6 -6
- package/dist/cjs/co-separator.cjs.entry.js +2 -2
- package/dist/cjs/co-sidebar-nav.cjs.entry.js +2 -2
- 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 +6 -6
- package/dist/cjs/co-tab-group.cjs.entry.js +3 -3
- package/dist/cjs/co-tab.cjs.entry.js +3 -3
- package/dist/cjs/co-tags-field.cjs.entry.js +8 -8
- package/dist/cjs/co-textarea.cjs.entry.js +6 -6
- package/dist/cjs/co-time-field.cjs.entry.js +325 -0
- package/dist/cjs/co-toast.cjs.entry.js +2 -2
- package/dist/cjs/co-toggle-button-group.cjs.entry.js +4 -4
- package/dist/cjs/co-toggle-button.cjs.entry.js +4 -4
- package/dist/cjs/{co-avatar_2.cjs.entry.js → co-tooltip.cjs.entry.js} +48 -84
- package/dist/cjs/co-transfer-list.cjs.entry.js +1 -1
- package/dist/cjs/co-video.cjs.entry.js +32 -7
- package/dist/cjs/cobalt.cjs.js +2 -2
- package/dist/cjs/color-CML2Cfdh.js +142 -0
- package/dist/cjs/{dateI18n-wblvKRq_.js → dateI18n-BK2qHqoC.js} +36 -0
- package/dist/cjs/{fieldChip-BLzo9MEV.js → fieldChip-B6YIGU1V.js} +1 -1
- package/dist/cjs/fileI18n-6sdbKvo6.js +88 -0
- package/dist/cjs/{index-DFZ5YhIT.js → index-BYwrR87Z.js} +28 -10
- package/dist/cjs/{index-DK-2Lzmf.js → index-MDAnKsze.js} +35 -27
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{positioning-DCj_AJ2T.js → positioning-CyatXeT_.js} +32 -13
- package/dist/cjs/{requiredMark-C1xcrzSZ.js → requiredMark-D-t-IPN0.js} +1 -1
- package/dist/cjs/{toolbar-config-BQfWTW6P.js → toolbar-config-BSGas-Wl.js} +10 -0
- package/dist/cobalt/cobalt.css +1 -1
- package/dist/cobalt/cobalt.esm.js +1 -1
- package/dist/cobalt/{p-bfc2a849.entry.js → p-000a15b8.entry.js} +1 -1
- package/dist/cobalt/{p-f83b48fd.entry.js → p-011dc80b.entry.js} +1 -1
- package/dist/cobalt/{p-316c62c0.entry.js → p-0678c797.entry.js} +1 -1
- package/dist/cobalt/{p-43bd298d.entry.js → p-08e42e00.entry.js} +1 -1
- package/dist/cobalt/{p-0e91e5c4.entry.js → p-148d4aa6.entry.js} +1 -1
- package/dist/cobalt/{p-07d570a6.entry.js → p-16954cea.entry.js} +1 -1
- package/dist/cobalt/{p-d40a465f.entry.js → p-16f8cee6.entry.js} +1 -1
- package/dist/cobalt/{p-85a61e28.entry.js → p-17244412.entry.js} +1 -1
- package/dist/cobalt/{p-da546d08.entry.js → p-1dc55e43.entry.js} +1 -1
- package/dist/cobalt/p-239c5c5f.entry.js +1 -0
- package/dist/cobalt/{p-4c7e3984.entry.js → p-23ab0cc5.entry.js} +1 -1
- package/dist/cobalt/{p-fabe5fb2.entry.js → p-2636b7eb.entry.js} +1 -1
- package/dist/cobalt/{p-88a0659f.entry.js → p-27a7e549.entry.js} +1 -1
- package/dist/cobalt/{p-dca4cd5f.entry.js → p-28764b8e.entry.js} +1 -1
- package/dist/cobalt/{p-18d34b01.entry.js → p-290066ef.entry.js} +1 -1
- package/dist/cobalt/p-2a30c143.entry.js +1 -0
- package/dist/cobalt/p-2f0f3bb1.entry.js +1 -0
- package/dist/cobalt/{p-89e38c5e.entry.js → p-2f9cbbd5.entry.js} +1 -1
- package/dist/cobalt/p-2fba312b.entry.js +1 -0
- package/dist/cobalt/p-354d5089.entry.js +1 -0
- package/dist/cobalt/{p-60cb66f5.entry.js → p-37f5036b.entry.js} +1 -1
- package/dist/cobalt/{p-ac91259e.entry.js → p-383a998e.entry.js} +1 -1
- package/dist/cobalt/{p-ef5e1167.entry.js → p-3c4f7026.entry.js} +1 -1
- package/dist/cobalt/p-410bee4d.entry.js +1 -0
- package/dist/cobalt/p-416795f5.entry.js +1 -0
- package/dist/cobalt/{p-6795a258.entry.js → p-44c4e4a3.entry.js} +1 -1
- package/dist/cobalt/{p-4b083da4.entry.js → p-44ea675f.entry.js} +1 -1
- package/dist/cobalt/{p-2828ecf6.entry.js → p-4592ca00.entry.js} +1 -1
- package/dist/cobalt/{p-342e1da4.entry.js → p-4d65e713.entry.js} +1 -1
- package/dist/cobalt/p-56551580.entry.js +1 -0
- package/dist/cobalt/p-58137c9e.entry.js +1 -0
- package/dist/cobalt/{p-4f754c9a.entry.js → p-58d9b650.entry.js} +1 -1
- package/dist/cobalt/p-59963937.entry.js +1 -0
- package/dist/cobalt/p-5a3e4c81.entry.js +1 -0
- package/dist/cobalt/p-5adf117c.entry.js +1 -0
- package/dist/cobalt/{p-23b3ff3f.entry.js → p-5ca394b1.entry.js} +1 -1
- package/dist/cobalt/p-5e4973a6.entry.js +1 -0
- package/dist/cobalt/{p-2d329ac8.entry.js → p-623cc195.entry.js} +1 -1
- package/dist/cobalt/{p-8e667eb6.entry.js → p-66b11b38.entry.js} +1 -1
- package/dist/cobalt/{p-7e53e9c8.entry.js → p-6c82a892.entry.js} +1 -1
- package/dist/cobalt/{p-a6357340.entry.js → p-76249983.entry.js} +1 -1
- package/dist/cobalt/{p-568cfe8d.entry.js → p-789c4b3e.entry.js} +1 -1
- package/dist/cobalt/p-7e8e6907.entry.js +1 -0
- package/dist/cobalt/{p-a9b29cc2.entry.js → p-826ee074.entry.js} +1 -1
- package/dist/cobalt/{p-1c68bc41.entry.js → p-8471abe2.entry.js} +1 -1
- package/dist/cobalt/p-8f2199ff.entry.js +1 -0
- package/dist/cobalt/{p-c8dba82f.entry.js → p-91e73a92.entry.js} +1 -1
- package/dist/cobalt/p-9246e09c.entry.js +1 -0
- package/dist/cobalt/{p-c1e7fb32.entry.js → p-93fe45fd.entry.js} +1 -1
- package/dist/cobalt/{p-8f38e24d.entry.js → p-95cfcb34.entry.js} +1 -1
- package/dist/cobalt/{p-36197363.entry.js → p-996f4e38.entry.js} +1 -1
- package/dist/cobalt/{p-c5684c79.entry.js → p-9cf738ed.entry.js} +1 -1
- package/dist/cobalt/p-BRbgGqLw.js +1 -0
- package/dist/cobalt/{p-BL0sCfMH.js → p-Bryf3-Js.js} +1 -1
- package/dist/cobalt/p-DFHRS9cJ.js +1 -0
- package/dist/cobalt/{p-CrtiywTB.js → p-DH5lfRNj.js} +1 -1
- package/dist/{components/p-WeuPA9Rw.js → cobalt/p-DOL2zACE.js} +1 -1
- package/dist/cobalt/p-D_zA1Pv4.js +1 -0
- package/dist/cobalt/p-a2462d7a.entry.js +1 -0
- package/dist/cobalt/p-a325ea0c.entry.js +1 -0
- package/dist/cobalt/{p-fef5db54.entry.js → p-a32b20eb.entry.js} +1 -1
- package/dist/cobalt/p-aa9400bf.entry.js +1 -0
- package/dist/cobalt/{p-8eb485c8.entry.js → p-aaca6dab.entry.js} +1 -1
- package/dist/cobalt/p-b0c4fc71.entry.js +1 -0
- package/dist/cobalt/p-b5bba7fe.entry.js +1 -0
- package/dist/cobalt/{p-fb3a095b.entry.js → p-b821d9de.entry.js} +1 -1
- package/dist/cobalt/{p-b0319a2d.entry.js → p-b90d41e4.entry.js} +1 -1
- package/dist/cobalt/{p-ac466658.entry.js → p-be34e447.entry.js} +1 -1
- package/dist/cobalt/{p-1ddbc48b.entry.js → p-c124e82b.entry.js} +1 -1
- package/dist/cobalt/{p-95efe661.entry.js → p-c2ebf0ec.entry.js} +1 -1
- package/dist/cobalt/{p-54ae807d.entry.js → p-c465d619.entry.js} +1 -1
- package/dist/cobalt/p-c7d7d7f7.entry.js +1 -0
- package/dist/cobalt/{p-ab45d9bd.entry.js → p-c91d4fc6.entry.js} +1 -1
- package/dist/cobalt/{p-e5495539.entry.js → p-d0b2c418.entry.js} +1 -1
- package/dist/cobalt/{p-ce35c898.entry.js → p-d29bb0fa.entry.js} +1 -1
- package/dist/cobalt/{p-33ea4a90.entry.js → p-d3344187.entry.js} +1 -1
- package/dist/cobalt/p-d375014b.entry.js +1 -0
- package/dist/cobalt/p-d9d9e8ae.entry.js +1 -0
- package/dist/cobalt/{p-7c5e846a.entry.js → p-db805569.entry.js} +1 -1
- package/dist/cobalt/p-e371ec7a.entry.js +1 -0
- package/dist/cobalt/p-e3aae282.entry.js +1 -0
- package/dist/cobalt/{p-d15d3a97.entry.js → p-e4264532.entry.js} +1 -1
- package/dist/cobalt/{p-3f0eed59.entry.js → p-e49a564c.entry.js} +1 -1
- package/dist/cobalt/p-e8a2f993.entry.js +1 -0
- package/dist/cobalt/p-eadfd661.entry.js +1 -0
- package/dist/cobalt/p-eb82358d.entry.js +1 -0
- package/dist/cobalt/{p-2114c036.entry.js → p-eb8691f2.entry.js} +1 -1
- package/dist/cobalt/{p-e8878cf9.entry.js → p-ee2023da.entry.js} +1 -1
- package/dist/cobalt/p-ee9a623d.entry.js +1 -0
- package/dist/cobalt/p-ef301976.entry.js +1 -0
- package/dist/cobalt/p-f4e1c3c3.entry.js +1 -0
- package/dist/cobalt/{p-e364b8a5.entry.js → p-f57dffca.entry.js} +1 -1
- package/dist/cobalt/p-f6691108.entry.js +1 -0
- package/dist/cobalt/p-fMqVDypp.js +1 -0
- package/dist/cobalt/p-fb2d1144.entry.js +1 -0
- package/dist/cobalt/{p-0c463d9a.entry.js → p-fd150cc6.entry.js} +1 -1
- package/dist/cobalt/p-gKnOhsd2.js +1 -0
- package/dist/cobalt/p-jYd9gu_c.js +1 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/co-accordion/co-accordion.css +2 -2
- package/dist/collection/components/co-accordion/co-accordion.js +4 -4
- package/dist/collection/components/co-action-bar/co-action-bar.css +9 -2
- package/dist/collection/components/co-app-shell/co-app-shell.css +107 -41
- package/dist/collection/components/co-app-shell/co-app-shell.js +2 -2
- package/dist/collection/components/co-audio-player/co-audio-player.js +138 -12
- package/dist/collection/components/co-autocomplete/co-autocomplete.js +1 -1
- package/dist/collection/components/co-avatar-group/co-avatar-group.js +1 -1
- package/dist/collection/components/co-badge/co-badge.css +18 -0
- package/dist/collection/components/co-badge/co-badge.js +29 -1
- package/dist/collection/components/co-button/co-button.css +10 -7
- package/dist/collection/components/co-checkbox/co-checkbox.css +12 -3
- package/dist/collection/components/co-checkbox/co-checkbox.js +25 -6
- package/dist/collection/components/co-checkbox-group/co-checkbox-group.css +1 -3
- package/dist/collection/components/co-checkbox-group/co-checkbox-group.js +1 -1
- package/dist/collection/components/co-color-picker/co-color-picker.css +252 -5
- package/dist/collection/components/co-color-picker/co-color-picker.js +962 -15
- package/dist/collection/components/co-color-picker/presets.js +113 -15
- package/dist/collection/components/co-column-picker/co-column-picker.js +2 -2
- package/dist/collection/components/co-combobox/co-combobox.js +1 -1
- package/dist/collection/components/co-command-search/co-command-search.js +1 -1
- package/dist/collection/components/co-data-table/co-data-table.css +63 -2
- package/dist/collection/components/co-data-table/co-data-table.js +59 -4
- package/dist/collection/components/co-data-table/headerTruncationLogic.js +34 -0
- 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.js +4 -4
- package/dist/collection/components/co-date-range/co-date-range.js +1 -1
- package/dist/collection/components/co-date-range-picker/co-date-range-picker.js +2 -2
- package/dist/collection/components/co-date-time-picker/co-date-time-picker.css +128 -32
- package/dist/collection/components/co-date-time-picker/co-date-time-picker.js +142 -138
- package/dist/collection/components/co-drawer/co-drawer.css +99 -36
- package/dist/collection/components/co-drawer/co-drawer.js +19 -7
- package/dist/collection/components/co-drive-card/co-drive-card.js +1 -1
- package/dist/collection/components/co-drop-zone/co-drop-zone.js +1 -1
- package/dist/collection/components/co-emoji-picker/co-emoji-picker.js +2 -2
- package/dist/collection/components/co-empty-state/co-empty-state.css +28 -0
- package/dist/collection/components/co-empty-state/co-empty-state.js +2 -2
- package/dist/collection/components/co-event-calendar/co-event-calendar.js +2 -2
- package/dist/collection/components/co-event-popover/co-event-popover.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 +55 -2
- package/dist/collection/components/co-file-field/co-file-field.js +41 -13
- package/dist/collection/components/co-file-field/co-file-field.utils.js +51 -4
- package/dist/collection/components/co-file-type-tile/co-file-type-tile.js +2 -2
- package/dist/collection/components/co-helper-text/co-helper-text.js +2 -2
- package/dist/collection/components/co-icon/co-icon.js +2 -2
- package/dist/collection/components/co-icon-button/co-icon-button.css +40 -2
- package/dist/collection/components/co-icon-button/co-icon-button.js +43 -4
- package/dist/collection/components/co-input/co-input.css +33 -0
- package/dist/collection/components/co-input/co-input.js +42 -7
- package/dist/collection/components/co-json-field/co-json-field.js +3 -3
- package/dist/collection/components/co-lightbox/co-lightbox.css +23 -0
- package/dist/collection/components/co-lightbox/co-lightbox.js +209 -20
- package/dist/collection/components/co-list-footer/co-list-footer.js +1 -1
- package/dist/collection/components/co-list-item/co-list-item.js +4 -4
- package/dist/collection/components/co-media-thumb/co-media-thumb.js +2 -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-menu-item/co-menu-item.css +9 -0
- package/dist/collection/components/co-menu-item/co-menu-item.js +67 -3
- package/dist/collection/components/co-modal/co-modal.css +112 -37
- package/dist/collection/components/co-modal/co-modal.js +35 -2
- package/dist/collection/components/co-navbar/co-navbar.css +4 -2
- package/dist/collection/components/co-navbar/co-navbar.js +2 -2
- package/dist/collection/components/co-number-field/co-number-field.css +22 -0
- package/dist/collection/components/co-number-field/co-number-field.js +216 -9
- package/dist/collection/components/co-option-list/co-option-list.css +25 -4
- package/dist/collection/components/co-option-list/co-option-list.js +56 -4
- package/dist/collection/components/co-option-list/optionListLogic.js +31 -8
- package/dist/collection/components/co-overlay/co-overlay.js +5 -3
- package/dist/collection/components/co-page-header/co-page-header.js +1 -1
- package/dist/collection/components/co-phone-field/co-phone-field.js +1 -1
- package/dist/collection/components/co-popover/co-popover.css +18 -3
- package/dist/collection/components/co-popover/co-popover.js +83 -20
- package/dist/collection/components/co-progress-bar/co-progress-bar.js +2 -2
- package/dist/collection/components/co-progress-circle/co-progress-circle.js +2 -2
- package/dist/collection/components/co-radio/co-radio.js +3 -3
- package/dist/collection/components/co-radio-group/co-radio-group.js +1 -1
- package/dist/collection/components/co-rating/co-rating.js +3 -3
- package/dist/collection/components/co-ref-field/co-ref-field.css +40 -0
- package/dist/collection/components/co-ref-field/co-ref-field.js +207 -11
- package/dist/collection/components/co-rich-text-editor/co-rich-text-editor.css +14 -1
- package/dist/collection/components/co-rich-text-editor/co-rich-text-editor.js +9 -6
- package/dist/collection/components/co-rich-text-toolbar/co-rich-text-toolbar.js +7 -3
- package/dist/collection/components/co-rich-text-viewer/co-rich-text-viewer.js +3 -2
- package/dist/collection/components/co-row/co-row.js +2 -2
- package/dist/collection/components/co-segmented-bar/co-segmented-bar.js +1 -1
- package/dist/collection/components/co-select/co-select.js +24 -5
- 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.css +2 -2
- package/dist/collection/components/co-sidebar-nav/co-sidebar-nav.js +1 -1
- package/dist/collection/components/co-skeleton/co-skeleton.css +18 -0
- package/dist/collection/components/co-skeleton/co-skeleton.js +83 -1
- package/dist/collection/components/co-slider/co-slider.js +2 -2
- package/dist/collection/components/co-switch/co-switch.css +3 -3
- package/dist/collection/components/co-switch/co-switch.js +3 -3
- package/dist/collection/components/co-tab/co-tab.js +2 -2
- package/dist/collection/components/co-tab-group/co-tab-group.js +2 -2
- package/dist/collection/components/co-tags-field/co-tags-field.js +5 -5
- package/dist/collection/components/co-textarea/co-textarea.js +4 -4
- package/dist/collection/components/co-time-field/co-time-field.css +111 -0
- package/dist/collection/components/co-time-field/co-time-field.js +536 -0
- package/dist/collection/components/co-toast/co-toast.css +13 -7
- package/dist/collection/components/co-toast/co-toast.js +2 -2
- package/dist/collection/components/co-toggle-button/co-toggle-button.css +20 -14
- 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 +14 -4
- package/dist/collection/components/co-toggle-button-group/co-toggle-button-group.js +2 -2
- package/dist/collection/components/co-tooltip/co-tooltip.css +12 -1
- package/dist/collection/components/co-tooltip/co-tooltip.js +49 -16
- package/dist/collection/components/co-transfer-list/co-transfer-list.js +1 -1
- package/dist/collection/components/co-video/co-video.js +34 -9
- package/dist/collection/utils/amountText.js +95 -0
- package/dist/collection/utils/color.js +109 -3
- package/dist/collection/utils/colorPickerI18n.js +55 -0
- package/dist/collection/utils/dateI18n.js +36 -0
- package/dist/collection/utils/fileI18n.js +3 -0
- package/dist/collection/utils/positioning.js +37 -4
- package/dist/collection/utils/submenu.js +35 -0
- package/dist/components/co-accordion.js +1 -1
- package/dist/components/co-action-bar.js +1 -1
- package/dist/components/co-app-shell.js +1 -1
- package/dist/components/co-audio-player.js +1 -1
- package/dist/components/co-autocomplete.js +1 -1
- package/dist/components/co-avatar-group.js +1 -1
- package/dist/components/co-avatar.js +1 -1
- package/dist/components/co-badge.js +1 -1
- package/dist/components/co-breadcrumb-item.js +1 -1
- package/dist/components/co-breadcrumb.js +1 -1
- package/dist/components/co-button.js +1 -1
- package/dist/components/co-calendar-month.js +1 -1
- package/dist/components/co-calendar-timegrid.js +1 -1
- package/dist/components/co-calendar.js +1 -1
- package/dist/components/co-carousel.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.js +1 -1
- package/dist/components/co-column-picker.js +1 -1
- 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.js +1 -1
- package/dist/components/co-date-picker.js +1 -1
- package/dist/components/co-date-range-picker.js +1 -1
- package/dist/components/co-date-range.js +1 -1
- package/dist/components/co-date-time-picker.js +1 -1
- package/dist/components/co-drawer.js +1 -1
- package/dist/components/co-drive-card.js +1 -1
- package/dist/components/co-drop-zone.js +1 -1
- package/dist/components/co-emoji-picker.js +1 -1
- package/dist/components/co-empty-state.js +1 -1
- package/dist/components/co-event-calendar.js +1 -1
- package/dist/components/co-event-popover.js +1 -1
- package/dist/components/co-fab.js +1 -1
- package/dist/components/co-file-field.js +1 -1
- package/dist/components/co-file-type-tile.js +1 -1
- 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.js +1 -1
- package/dist/components/co-lightbox.js +1 -1
- package/dist/components/co-list-footer.js +1 -1
- package/dist/components/co-list-item.js +1 -1
- package/dist/components/co-media-thumb.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-option-list.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.js +1 -1
- package/dist/components/co-popover.js +1 -1
- package/dist/components/co-progress-bar.js +1 -1
- package/dist/components/co-progress-circle.js +1 -1
- 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.js +1 -1
- package/dist/components/co-rich-text-toolbar.js +1 -1
- package/dist/components/co-rich-text-viewer.js +1 -1
- 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-skeleton.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.js +1 -1
- package/dist/components/co-textarea.js +1 -1
- package/dist/components/co-time-field.d.ts +11 -0
- package/dist/components/co-time-field.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/co-video.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/p-7TncUlLN.js +1 -0
- package/dist/components/p-B4NCaKrR.js +1 -0
- package/dist/components/p-B9xitpGU.js +1 -0
- package/dist/components/{p-Dabi98BI.js → p-BGDqldEg.js} +1 -1
- package/dist/components/p-BRbgGqLw.js +1 -0
- package/dist/components/{p-BL0sCfMH.js → p-Bryf3-Js.js} +1 -1
- package/dist/components/{p-D6OUW6oW.js → p-CBTGN490.js} +1 -1
- package/dist/components/{p-P8wvwhM2.js → p-CFFDmGPS.js} +1 -1
- package/dist/components/p-CLsAo0-A.js +1 -0
- package/dist/components/{p-CA_JAK9s.js → p-CT2enQ6h.js} +1 -1
- package/dist/components/p-D2ldYZo1.js +1 -0
- package/dist/components/{p-CuZXTvDM.js → p-D3mVYO-G.js} +1 -1
- package/dist/components/p-DDV_bRcU.js +1 -0
- package/dist/components/p-DFHRS9cJ.js +1 -0
- package/dist/components/{p-Dj1EZ5qD.js → p-DNJAIVfI.js} +1 -1
- package/dist/{cobalt/p-WeuPA9Rw.js → components/p-DOL2zACE.js} +1 -1
- package/dist/components/p-DRP8D9ro.js +1 -0
- package/dist/components/p-DSnJWzQw.js +1 -0
- package/dist/components/p-DTi2O4O8.js +1 -0
- package/dist/components/p-De7w9k6_.js +1 -0
- package/dist/components/{p-D5EdMieb.js → p-DoHLTC0n.js} +1 -1
- package/dist/components/{p-Bxk96Zgc.js → p-Du_CgT5E.js} +1 -1
- package/dist/components/p-DxtNejr2.js +1 -0
- package/dist/components/{p-BHYtxTzM.js → p-HxVRXXXC.js} +1 -1
- package/dist/components/{p-B0Dc-I_C.js → p-NNxjElcX.js} +1 -1
- package/dist/components/p-gKnOhsd2.js +1 -0
- package/dist/components/p-jYd9gu_c.js +1 -0
- package/dist/components/{p-D4qzGifz.js → p-vby0ITbe.js} +1 -1
- package/dist/components/p-wjt4IAGZ.js +1 -0
- package/dist/components/p-zuhal3IZ.js +1 -0
- package/dist/esm/co-accordion.entry.js +5 -5
- package/dist/esm/co-action-bar.entry.js +2 -2
- package/dist/esm/co-app-shell.entry.js +4 -4
- package/dist/esm/co-audio-player.entry.js +83 -13
- package/dist/esm/co-autocomplete.entry.js +2 -2
- package/dist/esm/co-avatar-group.entry.js +1 -1
- package/dist/esm/co-avatar.entry.js +70 -0
- package/dist/esm/co-badge.entry.js +11 -3
- package/dist/esm/co-bottom-sheet.entry.js +1 -1
- package/dist/esm/co-breadcrumb-item.entry.js +1 -1
- package/dist/esm/co-breadcrumb.entry.js +1 -1
- package/dist/esm/co-button-group.entry.js +1 -1
- package/dist/esm/co-button.entry.js +2 -2
- package/dist/esm/co-calendar-month_2.entry.js +37 -2
- package/dist/esm/co-calendar_3.entry.js +27 -15
- package/dist/esm/co-card.entry.js +1 -1
- package/dist/esm/co-carousel-item.entry.js +1 -1
- package/dist/esm/co-carousel.entry.js +2 -2
- package/dist/esm/co-checkbox-group.entry.js +2 -2
- package/dist/esm/co-checkbox.entry.js +6 -6
- package/dist/esm/co-chip_2.entry.js +68 -13
- package/dist/esm/co-color-picker.entry.js +1078 -27
- package/dist/esm/co-column-picker.entry.js +3 -3
- package/dist/esm/co-combobox.entry.js +2 -2
- package/dist/esm/co-command-search.entry.js +1 -1
- package/dist/esm/co-data-table-pagination.entry.js +5 -5
- package/dist/esm/co-data-table.entry.js +83 -5
- package/dist/esm/co-date-picker.entry.js +3 -3
- package/dist/esm/co-date-range-picker.entry.js +3 -3
- package/dist/esm/co-date-range.entry.js +2 -2
- package/dist/esm/co-date-time-picker.entry.js +101 -130
- package/dist/esm/co-drive-card.entry.js +2 -2
- package/dist/esm/co-drop-zone.entry.js +2 -2
- package/dist/esm/co-emoji-picker.entry.js +4 -4
- package/dist/esm/co-empty-state.entry.js +4 -4
- package/dist/esm/co-event-calendar.entry.js +4 -4
- package/dist/esm/co-event-popover.entry.js +3 -3
- package/dist/esm/co-fab.entry.js +3 -3
- package/dist/esm/co-file-field.entry.js +95 -99
- package/dist/esm/co-file-type-tile.entry.js +3 -3
- package/dist/esm/co-helper-text.entry.js +3 -3
- package/dist/esm/co-icon-button.entry.js +6 -6
- package/dist/esm/co-icon.entry.js +3 -3
- package/dist/esm/co-input.entry.js +32 -6
- package/dist/esm/co-json-field.entry.js +5 -5
- package/dist/esm/co-lightbox.entry.js +204 -21
- package/dist/esm/co-list-footer.entry.js +2 -2
- package/dist/esm/co-list-item.entry.js +5 -5
- package/dist/esm/co-loader.entry.js +1 -1
- package/dist/esm/co-media-thumb.entry.js +3 -3
- package/dist/esm/co-menu-divider.entry.js +2 -2
- package/dist/esm/co-menu-item.entry.js +85 -4
- package/dist/esm/co-menu.entry.js +2 -2
- package/dist/esm/co-modal.entry.js +10 -4
- package/dist/esm/co-navbar.entry.js +4 -4
- package/dist/esm/co-number-field.entry.js +272 -9
- package/dist/esm/co-overlay.entry.js +6 -4
- package/dist/esm/co-page-header.entry.js +2 -2
- package/dist/esm/co-phone-field.entry.js +3 -3
- package/dist/esm/co-popover.entry.js +58 -21
- package/dist/esm/co-progress-bar.entry.js +3 -3
- package/dist/esm/co-progress-circle.entry.js +3 -3
- package/dist/esm/co-provider-logo_2.entry.js +47 -3
- package/dist/esm/co-radio-group.entry.js +1 -1
- 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 +104 -13
- package/dist/esm/co-rich-text-editor.entry.js +11 -8
- package/dist/esm/co-rich-text-toolbar.entry.js +7 -3
- package/dist/esm/co-rich-text-viewer.entry.js +4 -3
- package/dist/esm/co-row.entry.js +3 -3
- package/dist/esm/co-segmented-bar.entry.js +1 -1
- package/dist/esm/co-select.entry.js +6 -6
- package/dist/esm/co-separator.entry.js +2 -2
- package/dist/esm/co-sidebar-nav.entry.js +2 -2
- 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 +6 -6
- package/dist/esm/co-tab-group.entry.js +3 -3
- package/dist/esm/co-tab.entry.js +3 -3
- package/dist/esm/co-tags-field.entry.js +8 -8
- package/dist/esm/co-textarea.entry.js +6 -6
- package/dist/esm/co-time-field.entry.js +323 -0
- package/dist/esm/co-toast.entry.js +2 -2
- package/dist/esm/co-toggle-button-group.entry.js +4 -4
- package/dist/esm/co-toggle-button.entry.js +4 -4
- package/dist/esm/{co-avatar_2.entry.js → co-tooltip.entry.js} +49 -84
- package/dist/esm/co-transfer-list.entry.js +1 -1
- package/dist/esm/co-video.entry.js +32 -7
- package/dist/esm/cobalt.js +3 -3
- package/dist/esm/color-BRbgGqLw.js +136 -0
- package/dist/esm/{dateI18n-CnNpoKwg.js → dateI18n-jYd9gu_c.js} +36 -0
- package/dist/esm/{fieldChip-DsAfq1e0.js → fieldChip-uyggU8VV.js} +1 -1
- package/dist/esm/fileI18n-gKnOhsd2.js +84 -0
- package/dist/esm/{index-RuXxdKzC.js → index-68iUQp5j.js} +28 -10
- package/dist/esm/{index-CrtiywTB.js → index-DH5lfRNj.js} +35 -27
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{positioning-BMdapAL8.js → positioning-DFHRS9cJ.js} +32 -13
- package/dist/esm/{requiredMark-DCD-ZA51.js → requiredMark-BCJUuZvC.js} +1 -1
- package/dist/esm/{toolbar-config-WeuPA9Rw.js → toolbar-config-DOL2zACE.js} +10 -0
- package/dist/types/components/co-accordion/co-accordion.d.ts +6 -0
- package/dist/types/components/co-audio-player/co-audio-player.d.ts +25 -0
- package/dist/types/components/co-badge/co-badge.d.ts +7 -0
- package/dist/types/components/co-checkbox/co-checkbox.d.ts +5 -1
- package/dist/types/components/co-color-picker/co-color-picker.d.ts +360 -4
- package/dist/types/components/co-color-picker/presets.d.ts +107 -4
- package/dist/types/components/co-data-table/co-data-table.d.ts +15 -0
- package/dist/types/components/co-data-table/headerTruncationLogic.d.ts +24 -0
- package/dist/types/components/co-date-time-picker/co-date-time-picker.d.ts +43 -21
- package/dist/types/components/co-drawer/co-drawer.d.ts +4 -3
- package/dist/types/components/co-file-field/co-file-field.d.ts +14 -0
- package/dist/types/components/co-file-field/co-file-field.utils.d.ts +18 -1
- package/dist/types/components/co-icon-button/co-icon-button.d.ts +9 -0
- package/dist/types/components/co-input/co-input.d.ts +9 -1
- package/dist/types/components/co-lightbox/co-lightbox.d.ts +60 -4
- package/dist/types/components/co-menu-item/co-menu-item.d.ts +16 -0
- package/dist/types/components/co-modal/co-modal.d.ts +10 -0
- package/dist/types/components/co-number-field/co-number-field.d.ts +42 -1
- package/dist/types/components/co-option-list/co-option-list.d.ts +16 -0
- package/dist/types/components/co-option-list/optionListLogic.d.ts +23 -6
- package/dist/types/components/co-overlay/co-overlay.d.ts +4 -2
- package/dist/types/components/co-popover/co-popover.d.ts +16 -0
- package/dist/types/components/co-ref-field/co-ref-field.d.ts +38 -0
- package/dist/types/components/co-rich-text-toolbar/co-rich-text-toolbar.d.ts +1 -1
- package/dist/types/components/co-select/co-select.d.ts +6 -0
- package/dist/types/components/co-skeleton/co-skeleton.d.ts +13 -0
- package/dist/types/components/co-time-field/co-time-field.d.ts +60 -0
- package/dist/types/components/co-tooltip/co-tooltip.d.ts +5 -0
- package/dist/types/components/co-video/co-video.d.ts +4 -0
- package/dist/types/components.d.ts +530 -90
- package/dist/types/utils/amountText.d.ts +34 -0
- package/dist/types/utils/color.d.ts +44 -1
- package/dist/types/utils/colorPickerI18n.d.ts +26 -0
- package/dist/types/utils/dateI18n.d.ts +12 -0
- package/dist/types/utils/fileI18n.d.ts +1 -0
- package/dist/types/utils/positioning.d.ts +10 -0
- package/dist/types/utils/submenu.d.ts +44 -0
- package/package.json +3 -3
- package/dist/cjs/color-YhUkm10t.js +0 -32
- package/dist/cjs/time-LBHtzLHe.js +0 -42
- package/dist/cobalt/p-07904986.entry.js +0 -1
- package/dist/cobalt/p-09799193.entry.js +0 -1
- package/dist/cobalt/p-17ae943c.entry.js +0 -1
- package/dist/cobalt/p-23a103a0.entry.js +0 -1
- package/dist/cobalt/p-2f88d151.entry.js +0 -1
- package/dist/cobalt/p-3495fda1.entry.js +0 -1
- package/dist/cobalt/p-409f28bb.entry.js +0 -1
- package/dist/cobalt/p-682b3313.entry.js +0 -1
- package/dist/cobalt/p-6bf814f9.entry.js +0 -1
- package/dist/cobalt/p-7532c739.entry.js +0 -1
- package/dist/cobalt/p-76420ac1.entry.js +0 -1
- package/dist/cobalt/p-7c88163e.entry.js +0 -1
- package/dist/cobalt/p-7cf4b4ae.entry.js +0 -1
- package/dist/cobalt/p-7ea87b75.entry.js +0 -1
- package/dist/cobalt/p-8183f56f.entry.js +0 -1
- package/dist/cobalt/p-8345b25f.entry.js +0 -1
- package/dist/cobalt/p-93c68029.entry.js +0 -1
- package/dist/cobalt/p-983af614.entry.js +0 -1
- package/dist/cobalt/p-BG4WRR22.js +0 -1
- package/dist/cobalt/p-BMdapAL8.js +0 -1
- package/dist/cobalt/p-CF8OB_TM.js +0 -1
- package/dist/cobalt/p-CnNpoKwg.js +0 -1
- package/dist/cobalt/p-T4la7ly_.js +0 -1
- package/dist/cobalt/p-a2d31248.entry.js +0 -1
- package/dist/cobalt/p-a6b5cadd.entry.js +0 -1
- package/dist/cobalt/p-a8c64cc3.entry.js +0 -1
- package/dist/cobalt/p-b8581787.entry.js +0 -1
- package/dist/cobalt/p-bcedbd73.entry.js +0 -1
- package/dist/cobalt/p-da18b5f4.entry.js +0 -1
- package/dist/cobalt/p-dea43204.entry.js +0 -1
- package/dist/cobalt/p-dfcf667d.entry.js +0 -1
- package/dist/cobalt/p-dfd25f1d.entry.js +0 -1
- package/dist/cobalt/p-e6882ddd.entry.js +0 -1
- package/dist/cobalt/p-e84eda2e.entry.js +0 -1
- package/dist/cobalt/p-f25967fb.entry.js +0 -1
- package/dist/cobalt/p-f5f1b463.entry.js +0 -1
- package/dist/cobalt/p-fd39f410.entry.js +0 -1
- package/dist/cobalt/p-mAGnZXRn.js +0 -1
- package/dist/components/p-BMdapAL8.js +0 -1
- package/dist/components/p-BTQEg3UO.js +0 -1
- package/dist/components/p-Bbny3WUc.js +0 -1
- package/dist/components/p-Bz0QZqnB.js +0 -1
- package/dist/components/p-CF8OB_TM.js +0 -1
- package/dist/components/p-CR0izsJC.js +0 -1
- package/dist/components/p-CnNpoKwg.js +0 -1
- package/dist/components/p-DI1ek0EB.js +0 -1
- package/dist/components/p-DP0bbhfN.js +0 -1
- package/dist/components/p-D_9BRkj6.js +0 -1
- package/dist/components/p-DbipMAyT.js +0 -1
- package/dist/components/p-DgUBcJIS.js +0 -1
- package/dist/components/p-DolCkNsL.js +0 -1
- package/dist/components/p-hfGFsvaD.js +0 -1
- package/dist/esm/color-BG4WRR22.js +0 -30
- package/dist/esm/time-CF8OB_TM.js +0 -37
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
+
import { langFromLocale } from "../../utils/dateI18n";
|
|
2
3
|
import { getLightboxStrings } from "../../utils/lightboxI18n";
|
|
3
4
|
const MIN_SCALE = 1;
|
|
4
5
|
const MAX_SCALE = 8;
|
|
5
6
|
const WHEEL_FACTOR = 1.15;
|
|
6
7
|
const DBLCLICK_SCALE = 2.5;
|
|
7
8
|
/**
|
|
8
|
-
* Fullscreen
|
|
9
|
+
* Fullscreen media viewer — dark scrim, zoom (wheel / buttons / double-click,
|
|
9
10
|
* anchored at the cursor), drag-to-pan while zoomed, and prev/next carousel
|
|
10
|
-
* when more than one
|
|
11
|
+
* when more than one item is provided. Keyboard: Escape closes, arrows
|
|
11
12
|
* navigate, +/- zoom, 0 resets.
|
|
12
13
|
*
|
|
14
|
+
* An item with `kind: 'video'` mounts a `co-video` instead of an `<img>`:
|
|
15
|
+
* zoom/pan make no sense over a seek bar, so they are disabled (and their
|
|
16
|
+
* toolbar cluster hidden) for as long as that slide is active.
|
|
17
|
+
*
|
|
13
18
|
* Controlled like co-modal: the host owns `open` and reacts to `coClose`.
|
|
14
19
|
*
|
|
15
20
|
* CAVEAT: the root is `position: fixed`, so an ancestor with `transform`,
|
|
@@ -21,6 +26,7 @@ const DBLCLICK_SCALE = 2.5;
|
|
|
21
26
|
* @part overlay - Fullscreen scrim container
|
|
22
27
|
* @part toolbar - Top bar (caption + zoom controls + actions)
|
|
23
28
|
* @part image - The active image element
|
|
29
|
+
* @part video - The co-video player on a video slide
|
|
24
30
|
* @part prev - Previous-image arrow button
|
|
25
31
|
* @part next - Next-image arrow button
|
|
26
32
|
* @part counter - The "i / n" indicator
|
|
@@ -72,10 +78,32 @@ export class CoLightbox {
|
|
|
72
78
|
this.handleKey = (e) => {
|
|
73
79
|
if (!this.open)
|
|
74
80
|
return;
|
|
81
|
+
if (e.key === 'Escape') {
|
|
82
|
+
// This Escape belongs to something else — the browser leaving fullscreen,
|
|
83
|
+
// or the player closing its speed menu. Either way the viewer must NOT
|
|
84
|
+
// close... and must still swallow the event: an ancestor co-drawer also
|
|
85
|
+
// listens for Escape on document, so merely returning here would close
|
|
86
|
+
// THAT instead, tearing down the drawer (and its unsaved edits) under a
|
|
87
|
+
// user who only wanted to leave fullscreen.
|
|
88
|
+
if (this.escapeBelongsToPlayer()) {
|
|
89
|
+
e.stopPropagation();
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
this.requestClose();
|
|
93
|
+
e.preventDefault();
|
|
94
|
+
e.stopPropagation();
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
if (e.key === 'Tab') {
|
|
98
|
+
this.trapTab(e);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
// While the player holds focus it owns the keyboard — space toggles play,
|
|
102
|
+
// arrows seek. Stealing those would leave the video keyboard-operable
|
|
103
|
+
// everywhere except when the user is actually inside it.
|
|
104
|
+
if (this.isFocusInPlayer())
|
|
105
|
+
return;
|
|
75
106
|
switch (e.key) {
|
|
76
|
-
case 'Escape':
|
|
77
|
-
this.requestClose();
|
|
78
|
-
break;
|
|
79
107
|
case 'ArrowLeft':
|
|
80
108
|
this.goTo(-1);
|
|
81
109
|
break;
|
|
@@ -84,17 +112,20 @@ export class CoLightbox {
|
|
|
84
112
|
break;
|
|
85
113
|
case '+':
|
|
86
114
|
case '=':
|
|
115
|
+
if (this.isVideoSlide)
|
|
116
|
+
return;
|
|
87
117
|
this.zoomAt(this.scale * WHEEL_FACTOR, 0, 0);
|
|
88
118
|
break;
|
|
89
119
|
case '-':
|
|
120
|
+
if (this.isVideoSlide)
|
|
121
|
+
return;
|
|
90
122
|
this.zoomAt(this.scale / WHEEL_FACTOR, 0, 0);
|
|
91
123
|
break;
|
|
92
124
|
case '0':
|
|
125
|
+
if (this.isVideoSlide)
|
|
126
|
+
return;
|
|
93
127
|
this.resetView();
|
|
94
128
|
break;
|
|
95
|
-
case 'Tab':
|
|
96
|
-
this.trapTab(e);
|
|
97
|
-
return;
|
|
98
129
|
default:
|
|
99
130
|
return; // unhandled keys pass through untouched
|
|
100
131
|
}
|
|
@@ -104,6 +135,27 @@ export class CoLightbox {
|
|
|
104
135
|
this.requestClose = () => {
|
|
105
136
|
this.coClose.emit();
|
|
106
137
|
};
|
|
138
|
+
// ── Video slide ───────────────────────────────────────────────────
|
|
139
|
+
this.mountPlayer = (el) => {
|
|
140
|
+
if (!el || el === this.playerEl)
|
|
141
|
+
return;
|
|
142
|
+
this.playerEl = el;
|
|
143
|
+
this.tryAutoplay();
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* Ajusta la caja del slide al frame real. Sin esto el player es un rectángulo
|
|
147
|
+
* FIJO (ancho tope × alto tope) y el `object-fit: contain` deja franjas negras
|
|
148
|
+
* a los costados: en un vertical — el caso típico, una grabación de pantalla —
|
|
149
|
+
* la losa negra tapa media pantalla y se traga los clicks que el usuario dirige
|
|
150
|
+
* al scrim para cerrar.
|
|
151
|
+
*/
|
|
152
|
+
this.handlePlayerReady = (e) => {
|
|
153
|
+
var _a;
|
|
154
|
+
const { width, height } = e.detail || {};
|
|
155
|
+
if (!width || !height)
|
|
156
|
+
return; // el navegador todavía no sabe el tamaño
|
|
157
|
+
(_a = this.playerEl) === null || _a === void 0 ? void 0 : _a.style.setProperty('--co-lb-ar', String(width / height));
|
|
158
|
+
};
|
|
107
159
|
this.handleWheel = (e) => {
|
|
108
160
|
e.preventDefault();
|
|
109
161
|
const [px, py] = this.stagePoint(e);
|
|
@@ -144,6 +196,14 @@ export class CoLightbox {
|
|
|
144
196
|
};
|
|
145
197
|
this.stop = (e) => e.stopPropagation();
|
|
146
198
|
}
|
|
199
|
+
get activeItem() {
|
|
200
|
+
return this.parsedImages[this.index];
|
|
201
|
+
}
|
|
202
|
+
/** Zoom, pan and the toolbar's zoom cluster are all gated on this. */
|
|
203
|
+
get isVideoSlide() {
|
|
204
|
+
var _a;
|
|
205
|
+
return ((_a = this.activeItem) === null || _a === void 0 ? void 0 : _a.kind) === 'video';
|
|
206
|
+
}
|
|
147
207
|
get parsedImages() {
|
|
148
208
|
const raw = this.images;
|
|
149
209
|
if (typeof raw !== 'string' || !raw.trim())
|
|
@@ -165,6 +225,12 @@ export class CoLightbox {
|
|
|
165
225
|
}
|
|
166
226
|
componentWillLoad() {
|
|
167
227
|
this.index = this.clampIndex(this.startIndex);
|
|
228
|
+
// Hosts that create the viewer imperatively flip `open` on the next frame,
|
|
229
|
+
// which lands BEFORE the lazy chunk hydrates — and Stencil skips @Watch
|
|
230
|
+
// callbacks fired before the instance exists, so `onOpenChange` never runs
|
|
231
|
+
// on that path (same reason connectedCallback re-checks `open` below).
|
|
232
|
+
// Seeding here is what makes a viewer opened straight onto a video play.
|
|
233
|
+
this.pendingAutoplay = this.open;
|
|
168
234
|
}
|
|
169
235
|
connectedCallback() {
|
|
170
236
|
if (this.open)
|
|
@@ -172,6 +238,7 @@ export class CoLightbox {
|
|
|
172
238
|
}
|
|
173
239
|
disconnectedCallback() {
|
|
174
240
|
this.detachKeyListener();
|
|
241
|
+
this.pauseVideo();
|
|
175
242
|
clearTimeout(this.demoteTimer);
|
|
176
243
|
}
|
|
177
244
|
componentDidRender() {
|
|
@@ -189,12 +256,19 @@ export class CoLightbox {
|
|
|
189
256
|
this.resetView();
|
|
190
257
|
this.preloadNeighbors();
|
|
191
258
|
this.attachKeyListener();
|
|
259
|
+
this.pendingAutoplay = true;
|
|
260
|
+
this.tryAutoplay();
|
|
192
261
|
// aria-modal dialog: move focus in on open, restore it on close.
|
|
193
262
|
this.previouslyFocused = (_a = document.activeElement) !== null && _a !== void 0 ? _a : undefined;
|
|
194
263
|
this.pendingFocus = true;
|
|
195
264
|
}
|
|
196
265
|
else {
|
|
197
266
|
this.detachKeyListener();
|
|
267
|
+
// The host fades the viewer out before dropping the node; a video left
|
|
268
|
+
// playing keeps its audio going through the whole fade (and beyond, if
|
|
269
|
+
// the node is detached rather than removed).
|
|
270
|
+
this.pauseVideo();
|
|
271
|
+
this.pendingAutoplay = false;
|
|
198
272
|
(_c = (_b = this.previouslyFocused) === null || _b === void 0 ? void 0 : _b.focus) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
199
273
|
this.previouslyFocused = undefined;
|
|
200
274
|
}
|
|
@@ -219,18 +293,66 @@ export class CoLightbox {
|
|
|
219
293
|
detachKeyListener() {
|
|
220
294
|
window.removeEventListener('keydown', this.handleKey, { capture: true });
|
|
221
295
|
}
|
|
222
|
-
/**
|
|
223
|
-
|
|
296
|
+
/**
|
|
297
|
+
* Minimal focus trap: Tab cycles through the viewer's own buttons — plus the
|
|
298
|
+
* player's, on a video slide. A shadow root is opaque to `querySelectorAll`,
|
|
299
|
+
* so co-video's controls have to be pulled in explicitly; without this the
|
|
300
|
+
* trap would cycle around the player and its play/seek would be unreachable
|
|
301
|
+
* by keyboard. (Safe because the viewer pins the controls visible: an
|
|
302
|
+
* auto-hidden control bar is `opacity: 0` and would take focus invisibly.)
|
|
303
|
+
*/
|
|
304
|
+
focusables() {
|
|
305
|
+
var _a, _b;
|
|
306
|
+
const nodes = Array.from((_b = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('button, co-video')) !== null && _b !== void 0 ? _b : []);
|
|
307
|
+
return nodes.flatMap((el) => {
|
|
308
|
+
var _a, _b;
|
|
309
|
+
return el.tagName === 'CO-VIDEO'
|
|
310
|
+
? // `button` alone is not enough: the seek bar and the volume slider are
|
|
311
|
+
// `role="slider"` divs, and the player's own keyboard shortcuts live on
|
|
312
|
+
// its `role="region"` container — all three are tabindex 0, and all
|
|
313
|
+
// three would be skipped by a button-only sweep.
|
|
314
|
+
// `:not([tabindex="-1"])` importa: co-video marca así su overlay de
|
|
315
|
+
// play grande, que se DESMONTA al activarse — enfocarlo tira el foco
|
|
316
|
+
// fuera del visor en el mismo gesto.
|
|
317
|
+
Array.from((_b = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('button:not([tabindex="-1"]), [tabindex="0"]')) !== null && _b !== void 0 ? _b : [])
|
|
318
|
+
: [el];
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
/** Deepest focused element, walking down through nested shadow roots. */
|
|
322
|
+
deepActive() {
|
|
224
323
|
var _a, _b, _c;
|
|
225
|
-
|
|
324
|
+
let a = (_b = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.activeElement) !== null && _b !== void 0 ? _b : null;
|
|
325
|
+
while ((_c = a === null || a === void 0 ? void 0 : a.shadowRoot) === null || _c === void 0 ? void 0 : _c.activeElement)
|
|
326
|
+
a = a.shadowRoot.activeElement;
|
|
327
|
+
return a;
|
|
328
|
+
}
|
|
329
|
+
/** True while the player owns this Escape: it is fullscreen (co-video enters
|
|
330
|
+
* through the webkit-prefixed API where that is all Safari has, so both
|
|
331
|
+
* spellings are checked), or its speed menu is open on top of it. */
|
|
332
|
+
escapeBelongsToPlayer() {
|
|
333
|
+
var _a, _b;
|
|
334
|
+
const doc = document;
|
|
335
|
+
if (doc.fullscreenElement || doc.webkitFullscreenElement)
|
|
336
|
+
return true;
|
|
337
|
+
return !!((_b = (_a = this.playerEl) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('.co-video__speed-menu'));
|
|
338
|
+
}
|
|
339
|
+
isFocusInPlayer() {
|
|
340
|
+
var _a;
|
|
341
|
+
const player = this.playerEl;
|
|
342
|
+
return !!player && ((_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.activeElement) === player;
|
|
343
|
+
}
|
|
344
|
+
trapTab(e) {
|
|
345
|
+
const focusables = this.focusables();
|
|
226
346
|
if (focusables.length === 0)
|
|
227
347
|
return;
|
|
228
348
|
e.preventDefault();
|
|
229
349
|
e.stopPropagation();
|
|
230
|
-
const active = (_c = this.el.shadowRoot) === null || _c === void 0 ? void 0 : _c.activeElement;
|
|
231
|
-
const i = focusables.indexOf(active);
|
|
232
350
|
const delta = e.shiftKey ? -1 : 1;
|
|
233
|
-
const
|
|
351
|
+
const i = focusables.indexOf(this.deepActive());
|
|
352
|
+
// Sin foco previo (i === -1) el módulo daría el ANTEÚLTIMO con Shift+Tab.
|
|
353
|
+
const next = i < 0
|
|
354
|
+
? focusables[delta > 0 ? 0 : focusables.length - 1]
|
|
355
|
+
: focusables[(i + delta + focusables.length) % focusables.length];
|
|
234
356
|
next.focus();
|
|
235
357
|
}
|
|
236
358
|
clampIndex(i) {
|
|
@@ -249,6 +371,9 @@ export class CoLightbox {
|
|
|
249
371
|
const n = this.parsedImages.length;
|
|
250
372
|
if (n < 2)
|
|
251
373
|
return;
|
|
374
|
+
this.pauseVideo();
|
|
375
|
+
// From here on the user is driving: nothing plays unless they press play.
|
|
376
|
+
this.pendingAutoplay = false;
|
|
252
377
|
this.index = (this.index + delta + n) % n;
|
|
253
378
|
this.resetView();
|
|
254
379
|
this.coChange.emit(this.index);
|
|
@@ -260,8 +385,65 @@ export class CoLightbox {
|
|
|
260
385
|
return;
|
|
261
386
|
for (const d of [1, -1]) {
|
|
262
387
|
const neighbor = imgs[(this.index + d + imgs.length) % imgs.length];
|
|
263
|
-
if (neighbor
|
|
264
|
-
|
|
388
|
+
if (!neighbor)
|
|
389
|
+
continue;
|
|
390
|
+
// A video's `src` is the media: pushing it through `new Image()` would
|
|
391
|
+
// download the whole file only to fail at decode. Its poster is what
|
|
392
|
+
// the slide paints first, so that is what's worth having warm.
|
|
393
|
+
const src = neighbor.kind === 'video' ? neighbor.poster : neighbor.src;
|
|
394
|
+
if (src)
|
|
395
|
+
new Image().src = src;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Autoplay rides the click that opened the viewer instead of co-video's own
|
|
400
|
+
* `autoplay` prop, which only fires when muted — and a silent video reads as
|
|
401
|
+
* a broken one. If the browser refuses the unmuted start (Safari), the
|
|
402
|
+
* rejection is swallowed and the player simply waits on its play button.
|
|
403
|
+
*
|
|
404
|
+
* Called from BOTH sides of a race: the player mounts on the first render,
|
|
405
|
+
* which hosts do while still closed (co-file-field fades the viewer in on
|
|
406
|
+
* the next frame), so `open` usually arrives second — but a host that
|
|
407
|
+
* renders the viewer already open flips the order.
|
|
408
|
+
*/
|
|
409
|
+
tryAutoplay() {
|
|
410
|
+
var _a;
|
|
411
|
+
if (!this.pendingAutoplay || !this.open)
|
|
412
|
+
return;
|
|
413
|
+
if (!this.isVideoSlide) {
|
|
414
|
+
// Opened onto an image: the chance is SPENT, not saved. Leaving the flag
|
|
415
|
+
// armed would make the first video the user arrows to start by itself.
|
|
416
|
+
this.pendingAutoplay = false;
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
const player = this.playerEl;
|
|
420
|
+
if (!player)
|
|
421
|
+
return;
|
|
422
|
+
this.pendingAutoplay = false;
|
|
423
|
+
Promise.resolve((_a = player.componentOnReady) === null || _a === void 0 ? void 0 : _a.call(player))
|
|
424
|
+
.then(() => {
|
|
425
|
+
var _a;
|
|
426
|
+
// Revalidar: entre el click y el chunk lazy de co-video puede pasar
|
|
427
|
+
// cualquier cosa — el usuario cierra el visor o flecha a otro slide, y
|
|
428
|
+
// un play() a ciegas deja audio sonando sobre una pantalla que ya no
|
|
429
|
+
// muestra ese video (o que ya no muestra nada).
|
|
430
|
+
if (!this.open || this.playerEl !== player || !this.isVideoSlide)
|
|
431
|
+
return;
|
|
432
|
+
return (_a = player.play) === null || _a === void 0 ? void 0 : _a.call(player);
|
|
433
|
+
})
|
|
434
|
+
.catch(() => {
|
|
435
|
+
/* blocked by the autoplay policy — the play button takes over */
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
pauseVideo() {
|
|
439
|
+
var _a, _b;
|
|
440
|
+
try {
|
|
441
|
+
const p = (_b = (_a = this.playerEl) === null || _a === void 0 ? void 0 : _a.pause) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
442
|
+
if (p && typeof p.catch === 'function')
|
|
443
|
+
p.catch(() => { });
|
|
444
|
+
}
|
|
445
|
+
catch (_c) {
|
|
446
|
+
/* not hydrated yet — nothing is playing either */
|
|
265
447
|
}
|
|
266
448
|
}
|
|
267
449
|
// ── Zoom / pan ────────────────────────────────────────────────
|
|
@@ -310,20 +492,27 @@ export class CoLightbox {
|
|
|
310
492
|
const imgs = this.parsedImages;
|
|
311
493
|
const img = imgs[this.index];
|
|
312
494
|
const multi = imgs.length > 1;
|
|
495
|
+
const video = (img === null || img === void 0 ? void 0 : img.kind) === 'video';
|
|
313
496
|
const counter = s.counter
|
|
314
497
|
.replace('{i}', String(this.index + 1))
|
|
315
498
|
.replace('{n}', String(imgs.length));
|
|
316
|
-
return (h("div", { key: '
|
|
499
|
+
return (h("div", { key: '1a3c29e98fd491c92b82ba9d9296588609cdd006', 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, popover: "manual", ref: this.syncTopLayer, onClick: this.requestClose }, img && (h("div", { key: 'cc9e9db83ef082deab744f259c4da63a58eb0c3b', class: "co-lightbox__toolbar", part: "toolbar", onClick: this.stop }, h("span", { key: 'ab3fa42e21008407f2cab377566a1793a96a8a50', class: "co-lightbox__caption", title: img.alt }, img.alt), !video && (h("div", { key: 'af8761111e7c5e0e7a838d8e69971cc2863ee9d4', class: "co-lightbox__zoom" }, h("button", { key: 'e73628b4fd25fa7c3ed9ca947fccd196e6433f84', 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: '371f4edc5141561b348ce36a8791fb81500248fa', name: "minus", size: 16 })), h("button", { key: 'e07adc772687ef65d97db5669ed235749e43c034', 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: '29ed305a4f464e38c4b4ef331dbbfc35aa6fdc95', 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: '6b56559a4dad36bee62545deb426734450f64f58', name: "plus", size: 16 })))), h("button", { key: '53099c4e3dec82cfc9087e89916154ef4a8845f6', class: "co-lightbox__btn", type: "button", "aria-label": s.openOriginal, title: s.openOriginal, onClick: this.openOriginal }, h("co-icon", { key: 'de160ed313ba0559cd1523f9f73fad7e3b167848', name: "arrow-square-out", size: 16 })), h("button", { key: 'd1658ff7b8d0fc22f1a489c0138a16077304a165', 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: 'fcbcbbf6001e67199b6ec7b99bde5f9f24537ca0', name: "x", size: 16 })))), img && (h("div", { key: '39cef6c2bd1bf3fe9f641778b48b618a62f1b5f8', class: "co-lightbox__stage", ref: (el) => (this.stageEl = el), onWheel: video ? undefined : this.handleWheel }, video ? (h("co-video", { class: "co-lightbox__video", part: "video",
|
|
500
|
+
/* Keyed per slide: a fresh player is the only way to be sure
|
|
501
|
+
poster, error state and playback all start clean. */
|
|
502
|
+
key: `video-${this.index}`, ref: this.mountPlayer, src: img.src, poster: img.poster || '', aspectRatio: "auto", rounded: "none",
|
|
503
|
+
/* Auto-hiding controls go `opacity: 0` while staying
|
|
504
|
+
focusable — invisible focus in a viewer that traps Tab. */
|
|
505
|
+
controlsAutoHide: false, showSpeed: true, showPip: true, locale: langFromLocale(this.locale), onCoReady: this.handlePlayerReady, onClick: this.stop })) : (h("img", { class: {
|
|
317
506
|
'co-lightbox__img': true,
|
|
318
507
|
'co-lightbox__img--zoomed': this.scale > MIN_SCALE,
|
|
319
508
|
'co-lightbox__img--dragging': this.dragging,
|
|
320
|
-
}, 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: '
|
|
509
|
+
}, 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: 'a161402e30021374f608755ea0a5dc6ccee0e99a', class: "co-lightbox__nav co-lightbox__nav--prev", part: "prev", type: "button", "aria-label": s.prevImage, title: s.prevImage, onClick: (e) => {
|
|
321
510
|
e.stopPropagation();
|
|
322
511
|
this.goTo(-1);
|
|
323
|
-
} }, h("co-icon", { key: '
|
|
512
|
+
} }, h("co-icon", { key: '649171d5330299b3ccb368bb0b434c643157c3f5', name: "caret-left", size: 24 }))), img && multi && (h("button", { key: '5cc5d07467e1ecf9c27094947ce421c28c35472d', class: "co-lightbox__nav co-lightbox__nav--next", part: "next", type: "button", "aria-label": s.nextImage, title: s.nextImage, onClick: (e) => {
|
|
324
513
|
e.stopPropagation();
|
|
325
514
|
this.goTo(1);
|
|
326
|
-
} }, h("co-icon", { key: '
|
|
515
|
+
} }, h("co-icon", { key: 'd9d32607a6b4350009db5c1719987aa8afcbb007', name: "caret-right", size: 24 }))), img && multi && (h("div", { key: 'a23f10a2c9d82c4295285feeedfbe0d9016f4db0', class: "co-lightbox__counter", part: "counter", onClick: this.stop }, counter))));
|
|
327
516
|
}
|
|
328
517
|
static get is() { return "co-lightbox"; }
|
|
329
518
|
static get encapsulation() { return "shadow"; }
|
|
@@ -17,7 +17,7 @@ export class CoListFooter {
|
|
|
17
17
|
this.handleSecondary = () => this.coSecondary.emit();
|
|
18
18
|
}
|
|
19
19
|
render() {
|
|
20
|
-
return (h("div", { key: '
|
|
20
|
+
return (h("div", { key: 'fbf4ec72aa2f6814b558d51c44592e784355751e', class: "co-list-footer", part: "footer" }, this.secondaryLabel && (h("button", { key: '78abef0f79117263c7d30e5ce37a876d193ba5e4', class: "co-list-footer__btn co-list-footer__btn--secondary", type: "button", onClick: this.handleSecondary }, this.secondaryIcon && h("co-icon", { key: 'a765ab5be51d7eb5791d3161cf5c7d3688fa0fd7', name: this.secondaryIcon, size: 16 }), h("span", { key: '0f5d57201bcd6ce40439c26916e01f1e37fcd87e' }, this.secondaryLabel))), this.primaryLabel && (h("button", { key: '27aa3b20666c9fe2a6fb7f28a9ca6e2542dd8fd7', class: "co-list-footer__btn co-list-footer__btn--primary", type: "button", onClick: this.handlePrimary }, this.primaryIcon && h("co-icon", { key: 'bafe2ebb9cfb2cc26c682ae9b419b09a512652f8', name: this.primaryIcon, size: 16 }), h("span", { key: 'c3c9baead987beea02ead3a65d3372c5532a67b8' }, this.primaryLabel))), h("slot", { key: '7a1ce48c91cc95c320c4d680053f42555e601187' })));
|
|
21
21
|
}
|
|
22
22
|
static get is() { return "co-list-footer"; }
|
|
23
23
|
static get encapsulation() { return "shadow"; }
|
|
@@ -70,21 +70,21 @@ export class CoListItem {
|
|
|
70
70
|
requestAnimationFrame(this.measureTruncation);
|
|
71
71
|
}
|
|
72
72
|
render() {
|
|
73
|
-
return (h("div", { key: '
|
|
73
|
+
return (h("div", { key: '23cfee682f0e7d3a22ca793b9e6b29eb89cf8ca1', class: {
|
|
74
74
|
'co-list-item': true,
|
|
75
75
|
'co-list-item--selected': this.selected,
|
|
76
76
|
'co-list-item--disabled': this.disabled,
|
|
77
77
|
'co-list-item--dense': this.dense,
|
|
78
78
|
'co-list-item--has-description': !!this.description,
|
|
79
|
-
}, 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: '
|
|
79
|
+
}, 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: 'a0f3c86656e408225fdbfeb610a088f8adebfa55', class: "co-list-item__prefix" }, this.icon && h("co-icon", { key: '18be77a790afd7b83f8ad07c9af5925abed4f23b', name: this.icon, size: 18 }), h("slot", { key: '2e198e4c541e1c86c6c266cf93408e195c851428', name: "prefix" })), h("div", { key: 'cbb5768d0a7bb287dbab1e013ae5e03ff2194a1f', class: "co-list-item__content" }, this.label && (h("co-tooltip", { key: '79730131bb1a74660d6dba076b622358b7c1ee15', block: true, class: "co-list-item__tip", content: this.label, placement: "top", disabled: !this.labelTruncated }, h("span", { key: '778b003dc31bc196a770a7dc6c4eebe649faf8c3', class: "co-list-item__label", ref: (el) => {
|
|
80
80
|
this.labelEl = el;
|
|
81
81
|
if (el && this.ro)
|
|
82
82
|
this.ro.observe(el);
|
|
83
|
-
} }, this.label))), this.description && (h("co-tooltip", { key: '
|
|
83
|
+
} }, this.label))), this.description && (h("co-tooltip", { key: '56c81304ceec7039a659c1e2443a17df48bf88eb', block: true, class: "co-list-item__tip", content: this.description, placement: "top", disabled: !this.descTruncated }, h("span", { key: '5f1f870da25778bfbe801cfb769319cff71fac75', class: "co-list-item__description", ref: (el) => {
|
|
84
84
|
this.descEl = el;
|
|
85
85
|
if (el && this.ro)
|
|
86
86
|
this.ro.observe(el);
|
|
87
|
-
} }, this.description))), h("slot", { key: '
|
|
87
|
+
} }, this.description))), h("slot", { key: '136ec5db83f4d2a77126d734ecac511c92b36d91' })), h("span", { key: '759b18ea3bedcb7b7b8023cb6ca1444fbacb5748', class: "co-list-item__suffix" }, h("slot", { key: 'c6519a183c1b7cdb84e4d822a5e2fa523a99ab52', name: "suffix" }))));
|
|
88
88
|
}
|
|
89
89
|
static get is() { return "co-list-item"; }
|
|
90
90
|
static get encapsulation() { return "shadow"; }
|
|
@@ -23,13 +23,13 @@ export class CoMediaThumb {
|
|
|
23
23
|
}
|
|
24
24
|
render() {
|
|
25
25
|
var _a;
|
|
26
|
-
return (h("div", { key: '
|
|
26
|
+
return (h("div", { key: 'acd021eb5ebcc987eeb1528b874fdbdfa48f8b52', class: {
|
|
27
27
|
'co-media-thumb': true,
|
|
28
28
|
'co-media-thumb--video': this.video,
|
|
29
29
|
}, part: "thumb", style: {
|
|
30
30
|
height: this.toCss(this.height),
|
|
31
31
|
borderRadius: `${this.radius}px`,
|
|
32
|
-
} }, this.src ? (h("img", { class: "co-media-thumb__img", src: this.src, alt: (_a = this.alt) !== null && _a !== void 0 ? _a : '', part: "img" })) : (h("slot", null)), this.video && (h("div", { key: '
|
|
32
|
+
} }, this.src ? (h("img", { class: "co-media-thumb__img", src: this.src, alt: (_a = this.alt) !== null && _a !== void 0 ? _a : '', part: "img" })) : (h("slot", null)), this.video && (h("div", { key: 'a6ec84bed9d75673b7b917b2cb513f01545d5bf2', class: "co-media-thumb__scrim", part: "scrim" }, h("div", { key: '9ce636bf0a3d9e53eb271803fc0bbd60f4314989', class: "co-media-thumb__play", part: "play" }, h("svg", { key: '07016dfed6ee4ff793650d830f152d2555731550', class: "co-media-thumb__play-icon", width: "16", height: "18", viewBox: "0 0 16 18", fill: "none", "aria-hidden": "true" }, h("path", { key: '825b3921b94248f28b30ce91b63525fd2fda5b35', d: "M2 2l12 7-12 7z", fill: "var(--co-color-base-negro, #1f1c1b)" })))))));
|
|
33
33
|
}
|
|
34
34
|
static get is() { return "co-media-thumb"; }
|
|
35
35
|
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: 'a386ccd371e9eb5627b6c70f43e66d6844df0b8a', placement: this.placement, offset: this.offset, open: this.open, onCoOpen: this.handlePopoverOpen, onCoClose: this.handlePopoverClose }, h("slot", { key: '9115ac2e7689183d9d397bd602d1a8651dcf364d', name: "trigger", slot: "trigger" }), h("div", { key: 'a56a14dfc5810144b93ca68ce54aceb7e5c2b85c', class: "co-menu", role: "menu", style: this.width ? { width: this.width, minWidth: this.width } : undefined }, h("slot", { key: '045510a7bbde56d841eee17d7561249a090e6de3' }))));
|
|
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: '9896239f2395bd79f45309fb61e0a0173572947a', class: "co-menu-divider", role: "separator" });
|
|
9
9
|
}
|
|
10
10
|
static get is() { return "co-menu-divider"; }
|
|
11
11
|
static get encapsulation() { return "shadow"; }
|
|
@@ -122,6 +122,15 @@
|
|
|
122
122
|
|
|
123
123
|
.co-menu-item__trigger-wrap { display: block; }
|
|
124
124
|
|
|
125
|
+
/* El trigger de un submenú va envuelto en co-popover, cuyo :host es inline-block:
|
|
126
|
+
sin esto la fila se encoge a su contenido y la flecha queda pegada al texto en
|
|
127
|
+
vez de al borde derecho del panel (las filas hoja no pasan por co-popover). Una
|
|
128
|
+
regla del scope exterior sobre el host gana a su :host. */
|
|
129
|
+
.co-menu-item__wrap--submenu > co-popover {
|
|
130
|
+
display: block;
|
|
131
|
+
width: 100%;
|
|
132
|
+
}
|
|
133
|
+
|
|
125
134
|
.co-menu-item__submenu {
|
|
126
135
|
/* surface-secondary = base-blanco. NOT surface-primary (that's base-negro). */
|
|
127
136
|
background: var(--co-semantic-surface-secondary, #fff);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
+
import { SUBMENU_SIDE_ATTR, inheritedSubmenuSide, sideOfPlacement, submenuPlacement } from "../../utils/submenu";
|
|
2
3
|
/**
|
|
3
4
|
* Row inside a `co-menu`. Two modes:
|
|
4
5
|
*
|
|
@@ -29,6 +30,11 @@ export class CoMenuItem {
|
|
|
29
30
|
this.variant = 'default';
|
|
30
31
|
this.hasSubmenu = false;
|
|
31
32
|
this.submenuOpen = false;
|
|
33
|
+
/** Lado hacia el que este ítem PIDE abrir su submenú. Se recalcula en cada
|
|
34
|
+
* apertura (no en render) heredando la dirección del ancestro: para cuando
|
|
35
|
+
* el usuario puede hoverear una fila de este panel, el submenú del ancestro
|
|
36
|
+
* ya se posicionó y publicó su lado. Ver utils/submenu.ts. */
|
|
37
|
+
this.submenuPlacementValue = 'right-start';
|
|
32
38
|
this.handleClick = (e) => {
|
|
33
39
|
if (this.disabled)
|
|
34
40
|
return;
|
|
@@ -80,6 +86,16 @@ export class CoMenuItem {
|
|
|
80
86
|
return;
|
|
81
87
|
this.scheduleClose();
|
|
82
88
|
};
|
|
89
|
+
/** El popover ya se posicionó: publicamos el lado RESUELTO (post-flip) en el
|
|
90
|
+
* host para que los co-menu-item anidados —hijos de light DOM— lo hereden.
|
|
91
|
+
* Va como atributo y no como evento que burbujee a propósito: `coPlacement`
|
|
92
|
+
* es `bubbles: false`, así que el de un submenú de adentro no se confunde
|
|
93
|
+
* con el nuestro. */
|
|
94
|
+
this.handlePlacement = (e) => {
|
|
95
|
+
const side = sideOfPlacement(e.detail.placement);
|
|
96
|
+
if (side)
|
|
97
|
+
this.el.setAttribute(SUBMENU_SIDE_ATTR, side);
|
|
98
|
+
};
|
|
83
99
|
// Arrow function (not a plain method) so `this` stays bound when it is passed
|
|
84
100
|
// directly as a JSX event handler (`onMouseEnter={this.cancelClose}`). Stencil
|
|
85
101
|
// does NOT auto-bind plain methods used as listeners — as a listener `this`
|
|
@@ -117,7 +133,37 @@ export class CoMenuItem {
|
|
|
117
133
|
}
|
|
118
134
|
return false;
|
|
119
135
|
}
|
|
120
|
-
openSubmenu() {
|
|
136
|
+
openSubmenu() {
|
|
137
|
+
// Coordinación de HERMANOS: abrir este submenú cierra inmediato el de
|
|
138
|
+
// cualquier co-menu-item del mismo parent. Sin esto, el delay de gracia de
|
|
139
|
+
// 260ms de scheduleClose deja DOS paneles visibles cuando el cursor pasa
|
|
140
|
+
// rápido de un trigger al de al lado (los ancestros no se tocan: un
|
|
141
|
+
// submenú anidado vive DENTRO de su ancestro, no es hermano).
|
|
142
|
+
if (!this.submenuOpen)
|
|
143
|
+
this.closeSiblingSubmenus();
|
|
144
|
+
// La dirección se resuelve ACÁ y no en render: heredarla exige que el
|
|
145
|
+
// submenú del ancestro ya esté posicionado, y eso solo está garantizado
|
|
146
|
+
// cuando el cursor pudo llegar a esta fila (que vive dentro de ese panel).
|
|
147
|
+
this.submenuPlacementValue = submenuPlacement(inheritedSubmenuSide(this.el));
|
|
148
|
+
this.submenuOpen = true;
|
|
149
|
+
}
|
|
150
|
+
/** Cierra el submenú YA (sin delay de gracia). Público: lo invoca el hermano
|
|
151
|
+
* que se está abriendo, mismo patrón cross-elemento que `focusItem`. */
|
|
152
|
+
async closeSubmenu() {
|
|
153
|
+
this.cancelClose();
|
|
154
|
+
this.submenuOpen = false;
|
|
155
|
+
}
|
|
156
|
+
closeSiblingSubmenus() {
|
|
157
|
+
var _a, _b;
|
|
158
|
+
const parent = this.el.parentElement;
|
|
159
|
+
if (!parent)
|
|
160
|
+
return;
|
|
161
|
+
for (const sib of Array.from(parent.children)) {
|
|
162
|
+
if (sib !== this.el && sib.tagName.toLowerCase() === 'co-menu-item') {
|
|
163
|
+
(_b = (_a = sib).closeSubmenu) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
121
167
|
scheduleClose() {
|
|
122
168
|
this.cancelClose();
|
|
123
169
|
// Delay tolerates the cursor travelling from the trigger row, across the
|
|
@@ -142,7 +188,7 @@ export class CoMenuItem {
|
|
|
142
188
|
}
|
|
143
189
|
// Submenu trigger — wrap the row in a co-popover anchored to the right.
|
|
144
190
|
// The default slot (nested co-menu-items) is projected into the popover.
|
|
145
|
-
return (h("div", { class: "co-menu-item__wrap co-menu-item__wrap--submenu", onMouseEnter: this.cancelClose, onMouseLeave: this.handleMouseLeave }, h("co-popover", { placement:
|
|
191
|
+
return (h("div", { class: "co-menu-item__wrap co-menu-item__wrap--submenu", onMouseEnter: this.cancelClose, onMouseLeave: this.handleMouseLeave }, h("co-popover", { placement: this.submenuPlacementValue, offset: 4, open: this.submenuOpen, onCoOpen: () => this.openSubmenu(), onCoClose: () => { this.submenuOpen = false; }, onCoPlacement: this.handlePlacement }, h("div", { slot: "trigger", class: "co-menu-item__trigger-wrap" }, row), h("div", { class: "co-menu-item__submenu", role: "menu", onMouseEnter: this.cancelClose, onMouseLeave: this.handleMouseLeave }, h("slot", null)))));
|
|
146
192
|
}
|
|
147
193
|
static get is() { return "co-menu-item"; }
|
|
148
194
|
static get encapsulation() { return "shadow"; }
|
|
@@ -339,7 +385,8 @@ export class CoMenuItem {
|
|
|
339
385
|
static get states() {
|
|
340
386
|
return {
|
|
341
387
|
"hasSubmenu": {},
|
|
342
|
-
"submenuOpen": {}
|
|
388
|
+
"submenuOpen": {},
|
|
389
|
+
"submenuPlacementValue": {}
|
|
343
390
|
};
|
|
344
391
|
}
|
|
345
392
|
static get events() {
|
|
@@ -393,6 +440,23 @@ export class CoMenuItem {
|
|
|
393
440
|
"text": "Programmatic focus \u2014 used by `co-menu`'s keyboard navigation. Named\n`focusItem` (not `focus`) because Stencil reserves the latter (it shadows\nHTMLElement.prototype.focus).",
|
|
394
441
|
"tags": []
|
|
395
442
|
}
|
|
443
|
+
},
|
|
444
|
+
"closeSubmenu": {
|
|
445
|
+
"complexType": {
|
|
446
|
+
"signature": "() => Promise<void>",
|
|
447
|
+
"parameters": [],
|
|
448
|
+
"references": {
|
|
449
|
+
"Promise": {
|
|
450
|
+
"location": "global",
|
|
451
|
+
"id": "global::Promise"
|
|
452
|
+
}
|
|
453
|
+
},
|
|
454
|
+
"return": "Promise<void>"
|
|
455
|
+
},
|
|
456
|
+
"docs": {
|
|
457
|
+
"text": "Cierra el submen\u00FA YA (sin delay de gracia). P\u00FAblico: lo invoca el hermano\nque se est\u00E1 abriendo, mismo patr\u00F3n cross-elemento que `focusItem`.",
|
|
458
|
+
"tags": []
|
|
459
|
+
}
|
|
396
460
|
}
|
|
397
461
|
};
|
|
398
462
|
}
|