@prolibu-suite/cobalt-core 0.8.0 → 0.9.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 +188 -19
- package/dist/cjs/co-accordion.cjs.entry.js +2 -2
- package/dist/cjs/co-action-bar.cjs.entry.js +2 -2
- package/dist/cjs/co-app-shell.cjs.entry.js +2 -2
- package/dist/cjs/co-audio-player.cjs.entry.js +2 -2
- package/dist/cjs/co-autocomplete.cjs.entry.js +15 -6
- package/dist/cjs/co-avatar-group.cjs.entry.js +2 -2
- package/dist/cjs/co-avatar_2.cjs.entry.js +16 -5
- package/dist/cjs/co-badge.cjs.entry.js +1 -1
- package/dist/cjs/co-bottom-sheet.cjs.entry.js +2 -2
- 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 +2 -2
- package/dist/cjs/co-calendar_3.cjs.entry.js +9 -9
- package/dist/cjs/co-card.cjs.entry.js +2 -2
- package/dist/cjs/co-carousel-item.cjs.entry.js +1 -1
- package/dist/cjs/co-carousel.cjs.entry.js +1 -1
- package/dist/cjs/co-checkbox-group.cjs.entry.js +2 -2
- package/dist/cjs/co-checkbox.cjs.entry.js +3 -3
- package/dist/cjs/co-chip_2.cjs.entry.js +26 -14
- package/dist/cjs/co-color-picker.cjs.entry.js +5 -5
- package/dist/cjs/co-column-picker.cjs.entry.js +4 -4
- package/dist/cjs/co-combobox.cjs.entry.js +14 -6
- package/dist/cjs/co-command-search.cjs.entry.js +20 -6
- package/dist/cjs/co-data-table-pagination.cjs.entry.js +6 -6
- package/dist/cjs/co-data-table.cjs.entry.js +128 -9
- package/dist/cjs/co-date-picker.cjs.entry.js +2 -2
- 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 +5 -5
- package/dist/cjs/co-drive-card.cjs.entry.js +3 -3
- package/dist/cjs/co-drop-zone.cjs.entry.js +2 -2
- package/dist/cjs/co-empty-state.cjs.entry.js +3 -3
- 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 +4 -4
- package/dist/cjs/co-file-field.cjs.entry.js +8 -8
- 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 +3 -3
- package/dist/cjs/co-icon.cjs.entry.js +3 -3
- package/dist/cjs/co-input.cjs.entry.js +3 -3
- package/dist/cjs/co-json-field.cjs.entry.js +6 -6
- package/dist/cjs/co-lightbox.cjs.entry.js +6 -6
- package/dist/cjs/co-list-footer.cjs.entry.js +3 -3
- package/dist/cjs/co-list-item.cjs.entry.js +6 -6
- 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 +2 -2
- package/dist/cjs/co-menu.cjs.entry.js +2 -2
- package/dist/cjs/co-modal.cjs.entry.js +4 -4
- package/dist/cjs/co-navbar.cjs.entry.js +3 -3
- package/dist/cjs/co-number-field.cjs.entry.js +5 -5
- package/dist/cjs/co-overlay.cjs.entry.js +3 -3
- package/dist/cjs/co-page-header.cjs.entry.js +2 -2
- package/dist/cjs/co-phone-field.cjs.entry.js +4 -4
- package/dist/cjs/co-popover.cjs.entry.js +79 -7
- package/dist/cjs/co-progress-bar.cjs.entry.js +3 -3
- package/dist/cjs/co-progress-circle.cjs.entry.js +4 -4
- package/dist/cjs/co-provider-logo_2.cjs.entry.js +2 -2
- package/dist/cjs/co-radio-group.cjs.entry.js +2 -2
- package/dist/cjs/co-radio.cjs.entry.js +5 -5
- package/dist/cjs/co-rating.cjs.entry.js +5 -5
- package/dist/cjs/co-ref-field.cjs.entry.js +28 -7
- package/dist/cjs/co-rich-text-editor.cjs.entry.js +5 -5
- package/dist/cjs/co-rich-text-toolbar.cjs.entry.js +2 -2
- package/dist/cjs/co-rich-text-viewer.cjs.entry.js +1 -1
- 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 +16 -7
- package/dist/cjs/co-separator.cjs.entry.js +2 -2
- package/dist/cjs/co-sidebar-nav.cjs.entry.js +4 -4
- package/dist/cjs/co-sidebar.cjs.entry.js +4 -4
- package/dist/cjs/co-slider.cjs.entry.js +4 -4
- 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 +4 -4
- package/dist/cjs/co-tags-field.cjs.entry.js +9 -9
- package/dist/cjs/co-textarea.cjs.entry.js +7 -7
- package/dist/cjs/co-toast.cjs.entry.js +35 -5
- package/dist/cjs/co-toggle-button-group.cjs.entry.js +3 -3
- package/dist/cjs/co-toggle-button.cjs.entry.js +4 -4
- package/dist/cjs/co-transfer-list.cjs.entry.js +2 -2
- package/dist/cjs/co-video.cjs.entry.js +4 -4
- package/dist/cjs/cobalt.cjs.js +2 -2
- package/dist/cjs/{fieldChip-B_npd9rL.js → fieldChip-xNJPEFcS.js} +1 -1
- package/dist/cjs/{index-kBiXCEE7.js → index-DK-2Lzmf.js} +13 -13
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{requiredMark-DuMIcKtt.js → requiredMark-C1xcrzSZ.js} +1 -1
- package/dist/cobalt/cobalt.css +1 -1
- package/dist/cobalt/cobalt.esm.js +1 -1
- package/dist/cobalt/{p-890296f9.entry.js → p-02ac492f.entry.js} +1 -1
- package/dist/cobalt/{p-f0c589ad.entry.js → p-02f4b71a.entry.js} +1 -1
- package/dist/cobalt/p-07d570a6.entry.js +1 -0
- package/dist/cobalt/p-136440fc.entry.js +1 -0
- package/dist/cobalt/{p-3ae69426.entry.js → p-138b8bc1.entry.js} +1 -1
- package/dist/cobalt/{p-df63f23c.entry.js → p-17ae943c.entry.js} +1 -1
- package/dist/cobalt/p-1ddbc48b.entry.js +1 -0
- package/dist/cobalt/{p-38ae8bff.entry.js → p-2637efc5.entry.js} +1 -1
- package/dist/cobalt/p-2c0099a4.entry.js +1 -0
- package/dist/cobalt/{p-202eadfc.entry.js → p-2d329ac8.entry.js} +1 -1
- package/dist/cobalt/p-2d81b292.entry.js +1 -0
- package/dist/cobalt/p-2f778a5a.entry.js +1 -0
- package/dist/cobalt/p-315586b0.entry.js +1 -0
- package/dist/cobalt/{p-0fc1edca.entry.js → p-316c62c0.entry.js} +1 -1
- package/dist/cobalt/p-342e1da4.entry.js +1 -0
- package/dist/cobalt/{p-acdb68a7.entry.js → p-37c17bd8.entry.js} +1 -1
- package/dist/cobalt/p-3a229bba.entry.js +1 -0
- package/dist/cobalt/{p-69723cc1.entry.js → p-3ced4269.entry.js} +1 -1
- package/dist/cobalt/{p-5c1328ff.entry.js → p-3d338881.entry.js} +1 -1
- package/dist/cobalt/{p-6985a964.entry.js → p-3ef0f849.entry.js} +1 -1
- package/dist/cobalt/p-40ce8a3d.entry.js +1 -0
- package/dist/cobalt/{p-8fe08257.entry.js → p-4299cfa5.entry.js} +1 -1
- package/dist/cobalt/{p-959556f4.entry.js → p-43bd298d.entry.js} +1 -1
- package/dist/cobalt/{p-dc8e88f4.entry.js → p-43d31055.entry.js} +1 -1
- package/dist/cobalt/{p-3a746267.entry.js → p-44fb4a3f.entry.js} +1 -1
- package/dist/cobalt/p-4a503187.entry.js +1 -0
- package/dist/cobalt/p-4fe9a3ae.entry.js +1 -0
- package/dist/cobalt/{p-f53b9536.entry.js → p-5c1767db.entry.js} +1 -1
- package/dist/cobalt/p-60cb66f5.entry.js +1 -0
- package/dist/cobalt/p-6556465f.entry.js +1 -0
- package/dist/cobalt/{p-48fbf051.entry.js → p-6795a258.entry.js} +1 -1
- package/dist/cobalt/p-682b3313.entry.js +1 -0
- package/dist/cobalt/p-6c35b5cc.entry.js +1 -0
- package/dist/cobalt/p-7457aa89.entry.js +1 -0
- package/dist/cobalt/{p-0769eee9.entry.js → p-75b7ed13.entry.js} +1 -1
- package/dist/cobalt/{p-afd957c0.entry.js → p-7c5e846a.entry.js} +1 -1
- package/dist/cobalt/{p-cd96aabf.entry.js → p-7cf4b4ae.entry.js} +1 -1
- package/dist/cobalt/p-7fbd3359.entry.js +1 -0
- package/dist/cobalt/p-8183f56f.entry.js +1 -0
- package/dist/cobalt/p-82c8f07b.entry.js +1 -0
- package/dist/cobalt/p-85a61e28.entry.js +1 -0
- package/dist/cobalt/p-88a0659f.entry.js +1 -0
- package/dist/cobalt/{p-dc269096.entry.js → p-8e667eb6.entry.js} +1 -1
- package/dist/cobalt/{p-1e9c9d46.entry.js → p-8eb485c8.entry.js} +1 -1
- package/dist/cobalt/p-8f600512.entry.js +1 -0
- package/dist/cobalt/{p-25f59046.entry.js → p-905ba0dd.entry.js} +1 -1
- package/dist/cobalt/p-909c0113.entry.js +1 -0
- package/dist/cobalt/p-90e292de.entry.js +1 -0
- package/dist/cobalt/p-929a4f19.entry.js +1 -0
- package/dist/cobalt/p-9c89cb01.entry.js +1 -0
- package/dist/cobalt/p-9c9f5b26.entry.js +1 -0
- package/dist/cobalt/p-CQAYgqA6.js +1 -0
- package/dist/cobalt/p-CrtiywTB.js +2 -0
- package/dist/cobalt/p-T4la7ly_.js +1 -0
- package/dist/cobalt/p-a0a6bfa3.entry.js +1 -0
- package/dist/cobalt/p-a3669301.entry.js +1 -0
- package/dist/cobalt/p-a3c6b974.entry.js +1 -0
- package/dist/cobalt/{p-20bd3702.entry.js → p-a6357340.entry.js} +1 -1
- package/dist/cobalt/p-a6b5cadd.entry.js +1 -0
- package/dist/cobalt/p-a811464d.entry.js +1 -0
- package/dist/cobalt/p-a8c64cc3.entry.js +1 -0
- package/dist/cobalt/p-a9b29cc2.entry.js +1 -0
- package/dist/cobalt/p-aafb9d11.entry.js +1 -0
- package/dist/cobalt/p-ab45d9bd.entry.js +1 -0
- package/dist/cobalt/p-b107063c.entry.js +1 -0
- package/dist/cobalt/{p-a04feb70.entry.js → p-b22981fd.entry.js} +1 -1
- package/dist/cobalt/p-b28dc0fe.entry.js +1 -0
- package/dist/cobalt/p-b5b97c9b.entry.js +1 -0
- package/dist/cobalt/{p-6b256d01.entry.js → p-b892b312.entry.js} +1 -1
- package/dist/cobalt/{p-39dea0c0.entry.js → p-bfc2a849.entry.js} +1 -1
- package/dist/cobalt/p-c1880595.entry.js +1 -0
- package/dist/cobalt/{p-7c6b3175.entry.js → p-c3bb7e1f.entry.js} +1 -1
- package/dist/cobalt/{p-ce961fba.entry.js → p-c3fd7b22.entry.js} +1 -1
- package/dist/cobalt/p-c6b9b9d6.entry.js +1 -0
- package/dist/cobalt/{p-195c67ee.entry.js → p-c8dba82f.entry.js} +1 -1
- package/dist/cobalt/{p-00830b8c.entry.js → p-ce35c898.entry.js} +1 -1
- package/dist/cobalt/p-d4debd6f.entry.js +1 -0
- package/dist/cobalt/p-da18b5f4.entry.js +1 -0
- package/dist/cobalt/{p-3af74ab8.entry.js → p-da546d08.entry.js} +1 -1
- package/dist/cobalt/{p-50bbfad8.entry.js → p-e085b4ff.entry.js} +1 -1
- package/dist/cobalt/{p-b45ea918.entry.js → p-e4ef25b0.entry.js} +1 -1
- package/dist/cobalt/{p-97875bde.entry.js → p-e6882ddd.entry.js} +1 -1
- package/dist/cobalt/{p-bebacee2.entry.js → p-e742e978.entry.js} +1 -1
- package/dist/cobalt/{p-52af222b.entry.js → p-e8878cf9.entry.js} +1 -1
- package/dist/cobalt/{p-a252f8c5.entry.js → p-f83b48fd.entry.js} +1 -1
- package/dist/cobalt/{p-3d4e697e.entry.js → p-f945a1bd.entry.js} +1 -1
- package/dist/cobalt/p-fabe5fb2.entry.js +1 -0
- package/dist/cobalt/{p-15852fec.entry.js → p-fd39f410.entry.js} +1 -1
- package/dist/cobalt/{p-51a1ad38.entry.js → p-fdc6ec11.entry.js} +1 -1
- package/dist/collection/components/co-accordion/co-accordion.css +12 -4
- package/dist/collection/components/co-action-bar/co-action-bar.css +4 -16
- package/dist/collection/components/co-app-shell/co-app-shell.css +1 -1
- package/dist/collection/components/co-audio-player/co-audio-player.css +1 -2
- package/dist/collection/components/co-autocomplete/co-autocomplete.css +3 -3
- package/dist/collection/components/co-autocomplete/co-autocomplete.js +14 -5
- package/dist/collection/components/co-avatar-group/co-avatar-group.css +1 -1
- package/dist/collection/components/co-bottom-sheet/co-bottom-sheet.css +4 -12
- package/dist/collection/components/co-button/co-button.css +17 -1
- package/dist/collection/components/co-calendar/co-calendar.css +2 -2
- package/dist/collection/components/co-calendar-month/co-calendar-month.css +1 -1
- package/dist/collection/components/co-card/co-card.css +1 -1
- package/dist/collection/components/co-checkbox/co-checkbox.css +84 -58
- package/dist/collection/components/co-checkbox/co-checkbox.js +1 -1
- package/dist/collection/components/co-checkbox-group/co-checkbox-group.css +1 -1
- package/dist/collection/components/co-chip/co-chip.css +2 -2
- package/dist/collection/components/co-chip/co-chip.js +2 -2
- package/dist/collection/components/co-color-picker/co-color-picker.css +3 -3
- package/dist/collection/components/co-color-picker/co-color-picker.js +2 -2
- package/dist/collection/components/co-column-picker/co-column-picker.css +8 -8
- package/dist/collection/components/co-column-picker/co-column-picker.js +2 -2
- package/dist/collection/components/co-combobox/co-combobox.css +5 -3
- package/dist/collection/components/co-combobox/co-combobox.js +13 -5
- package/dist/collection/components/co-command-search/co-command-search.css +13 -3
- package/dist/collection/components/co-command-search/co-command-search.js +18 -4
- package/dist/collection/components/co-data-table/co-data-table.css +38 -5
- package/dist/collection/components/co-data-table/co-data-table.js +89 -7
- package/dist/collection/components/co-data-table-pagination/co-data-table-pagination.css +5 -5
- 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 +2 -2
- 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.css +2 -2
- package/dist/collection/components/co-date-time-picker/co-date-time-picker.css +2 -2
- package/dist/collection/components/co-date-time-picker/co-date-time-picker.js +2 -2
- package/dist/collection/components/co-drawer/co-drawer.css +2 -2
- package/dist/collection/components/co-drive-card/co-drive-card.css +5 -5
- 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-empty-state/co-empty-state.js +2 -2
- package/dist/collection/components/co-event-calendar/co-event-calendar.css +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.css +1 -2
- package/dist/collection/components/co-event-popover/co-event-popover.js +1 -1
- package/dist/collection/components/co-fab/co-fab.css +26 -17
- package/dist/collection/components/co-fab/co-fab.js +2 -2
- package/dist/collection/components/co-file-field/co-file-field.css +5 -5
- package/dist/collection/components/co-file-field/co-file-field.js +5 -5
- 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 +10 -1
- package/dist/collection/components/co-icon-button/co-icon-button.js +1 -1
- package/dist/collection/components/co-input/co-input.css +3 -3
- package/dist/collection/components/co-json-field/co-json-field.css +1 -1
- package/dist/collection/components/co-json-field/co-json-field.js +3 -3
- package/dist/collection/components/co-lightbox/co-lightbox.css +4 -4
- package/dist/collection/components/co-lightbox/co-lightbox.js +4 -4
- package/dist/collection/components/co-list-footer/co-list-footer.css +1 -1
- package/dist/collection/components/co-list-footer/co-list-footer.js +1 -1
- package/dist/collection/components/co-list-item/co-list-item.css +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 +1 -1
- package/dist/collection/components/co-modal/co-modal.css +2 -2
- package/dist/collection/components/co-modal/co-modal.js +2 -2
- package/dist/collection/components/co-navbar/co-navbar.js +2 -2
- package/dist/collection/components/co-number-field/co-number-field.css +3 -3
- package/dist/collection/components/co-number-field/co-number-field.js +2 -2
- package/dist/collection/components/co-option-list/co-option-list.css +13 -11
- package/dist/collection/components/co-option-list/co-option-list.js +23 -11
- package/dist/collection/components/co-overlay/co-overlay.css +2 -2
- 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 +1 -1
- package/dist/collection/components/co-phone-field/co-phone-field.js +1 -1
- package/dist/collection/components/co-popover/co-popover.css +27 -0
- package/dist/collection/components/co-popover/co-popover.js +54 -6
- package/dist/collection/components/co-progress-bar/co-progress-bar.js +2 -2
- package/dist/collection/components/co-progress-circle/co-progress-circle.css +1 -1
- package/dist/collection/components/co-progress-circle/co-progress-circle.js +2 -2
- package/dist/collection/components/co-radio/co-radio.css +1 -1
- package/dist/collection/components/co-radio/co-radio.js +3 -3
- package/dist/collection/components/co-radio-group/co-radio-group.css +1 -1
- package/dist/collection/components/co-rating/co-rating.css +1 -1
- package/dist/collection/components/co-rating/co-rating.js +3 -3
- package/dist/collection/components/co-ref-field/co-ref-field.css +19 -4
- package/dist/collection/components/co-ref-field/co-ref-field.js +83 -3
- package/dist/collection/components/co-rich-text-editor/co-rich-text-editor.css +5 -5
- package/dist/collection/components/co-rich-text-editor/co-rich-text-editor.js +3 -3
- package/dist/collection/components/co-rich-text-toolbar/co-rich-text-toolbar.css +12 -12
- package/dist/collection/components/co-row/co-row.js +2 -2
- package/dist/collection/components/co-select/co-select.css +4 -4
- package/dist/collection/components/co-select/co-select.js +67 -4
- package/dist/collection/components/co-separator/co-separator.js +1 -1
- package/dist/collection/components/co-sidebar/co-sidebar.css +1 -1
- package/dist/collection/components/co-sidebar/co-sidebar.js +2 -2
- package/dist/collection/components/co-sidebar-nav/co-sidebar-nav.css +33 -7
- package/dist/collection/components/co-sidebar-nav/co-sidebar-nav.js +2 -2
- package/dist/collection/components/co-skeleton/co-skeleton.js +1 -1
- package/dist/collection/components/co-slider/co-slider.css +9 -2
- package/dist/collection/components/co-slider/co-slider.js +2 -2
- package/dist/collection/components/co-switch/co-switch.css +5 -4
- package/dist/collection/components/co-switch/co-switch.js +3 -3
- package/dist/collection/components/co-tab/co-tab.css +2 -2
- 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.css +3 -3
- package/dist/collection/components/co-tags-field/co-tags-field.js +5 -5
- package/dist/collection/components/co-textarea/co-textarea.css +2 -2
- package/dist/collection/components/co-textarea/co-textarea.js +4 -4
- package/dist/collection/components/co-toast/co-toast.css +63 -1
- package/dist/collection/components/co-toast/co-toast.js +38 -3
- package/dist/collection/components/co-toggle-button/co-toggle-button.css +1 -1
- 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.js +2 -2
- package/dist/collection/components/co-tooltip/co-tooltip.css +1 -1
- package/dist/collection/components/co-tooltip/co-tooltip.js +14 -3
- package/dist/collection/components/co-transfer-list/co-transfer-list.css +3 -3
- package/dist/collection/components/co-video/co-video.css +9 -9
- package/dist/collection/components/co-video/co-video.js +2 -2
- package/dist/collection/utils/columnResize.js +37 -0
- package/dist/collection/utils/popover-stack.js +28 -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-bottom-sheet.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-card.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-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-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-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-BC6sxVVr.js → p-4t5Fputx.js} +1 -1
- package/dist/components/p-8wvfrEY4.js +1 -0
- package/dist/components/{p-DbISGXT_.js → p-BCZ-tPBT.js} +1 -1
- package/dist/components/p-BEiPCCVl.js +1 -0
- package/dist/components/{p-CDWXNRpo.js → p-BOmAHbix.js} +1 -1
- package/dist/components/p-BUYgHlPz.js +1 -0
- package/dist/components/p-BYnSPxpp.js +1 -0
- package/dist/components/{p-CVCEiwOS.js → p-Bhuk55S0.js} +1 -1
- package/dist/components/{p-CIWoKlGj.js → p-C4So28aS.js} +1 -1
- package/dist/components/p-CRABrJmD.js +1 -0
- package/dist/components/p-CXLX8DpD.js +1 -0
- package/dist/components/{p-ChPooamL.js → p-CXdIxtbK.js} +1 -1
- package/dist/components/p-ClAsHpYv.js +1 -0
- package/dist/components/p-CnBjUP_M.js +1 -0
- package/dist/components/p-DEYpoVxc.js +1 -0
- package/dist/components/p-DP0bbhfN.js +1 -0
- package/dist/components/{p-T0MdU7sb.js → p-DUYGgqjB.js} +1 -1
- package/dist/components/p-DWt_rL1l.js +1 -0
- package/dist/components/p-DmyELlI1.js +1 -0
- package/dist/components/{p-uZ2D6ESV.js → p-aiNhl9Xd.js} +1 -1
- package/dist/components/p-njonLO8t.js +1 -0
- package/dist/components/{p-BQFperIX.js → p-xjzIZcgZ.js} +1 -1
- package/dist/esm/co-accordion.entry.js +2 -2
- package/dist/esm/co-action-bar.entry.js +2 -2
- package/dist/esm/co-app-shell.entry.js +2 -2
- package/dist/esm/co-audio-player.entry.js +2 -2
- package/dist/esm/co-autocomplete.entry.js +15 -6
- package/dist/esm/co-avatar-group.entry.js +2 -2
- package/dist/esm/co-avatar_2.entry.js +16 -5
- package/dist/esm/co-badge.entry.js +1 -1
- package/dist/esm/co-bottom-sheet.entry.js +2 -2
- 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 +2 -2
- package/dist/esm/co-calendar_3.entry.js +9 -9
- package/dist/esm/co-card.entry.js +2 -2
- package/dist/esm/co-carousel-item.entry.js +1 -1
- package/dist/esm/co-carousel.entry.js +1 -1
- package/dist/esm/co-checkbox-group.entry.js +2 -2
- package/dist/esm/co-checkbox.entry.js +3 -3
- package/dist/esm/co-chip_2.entry.js +26 -14
- package/dist/esm/co-color-picker.entry.js +5 -5
- package/dist/esm/co-column-picker.entry.js +4 -4
- package/dist/esm/co-combobox.entry.js +14 -6
- package/dist/esm/co-command-search.entry.js +20 -6
- package/dist/esm/co-data-table-pagination.entry.js +6 -6
- package/dist/esm/co-data-table.entry.js +128 -9
- package/dist/esm/co-date-picker.entry.js +2 -2
- 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 +5 -5
- package/dist/esm/co-drive-card.entry.js +3 -3
- package/dist/esm/co-drop-zone.entry.js +2 -2
- package/dist/esm/co-empty-state.entry.js +3 -3
- 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 +4 -4
- package/dist/esm/co-file-field.entry.js +8 -8
- 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 +3 -3
- package/dist/esm/co-icon.entry.js +3 -3
- package/dist/esm/co-input.entry.js +3 -3
- package/dist/esm/co-json-field.entry.js +6 -6
- package/dist/esm/co-lightbox.entry.js +6 -6
- package/dist/esm/co-list-footer.entry.js +3 -3
- package/dist/esm/co-list-item.entry.js +6 -6
- 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 +2 -2
- package/dist/esm/co-menu.entry.js +2 -2
- package/dist/esm/co-modal.entry.js +4 -4
- package/dist/esm/co-navbar.entry.js +3 -3
- package/dist/esm/co-number-field.entry.js +5 -5
- package/dist/esm/co-overlay.entry.js +3 -3
- package/dist/esm/co-page-header.entry.js +2 -2
- package/dist/esm/co-phone-field.entry.js +4 -4
- package/dist/esm/co-popover.entry.js +79 -7
- package/dist/esm/co-progress-bar.entry.js +3 -3
- package/dist/esm/co-progress-circle.entry.js +4 -4
- package/dist/esm/co-provider-logo_2.entry.js +2 -2
- package/dist/esm/co-radio-group.entry.js +2 -2
- package/dist/esm/co-radio.entry.js +5 -5
- package/dist/esm/co-rating.entry.js +5 -5
- package/dist/esm/co-ref-field.entry.js +28 -7
- package/dist/esm/co-rich-text-editor.entry.js +5 -5
- package/dist/esm/co-rich-text-toolbar.entry.js +2 -2
- package/dist/esm/co-rich-text-viewer.entry.js +1 -1
- 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 +16 -7
- package/dist/esm/co-separator.entry.js +2 -2
- package/dist/esm/co-sidebar-nav.entry.js +4 -4
- package/dist/esm/co-sidebar.entry.js +4 -4
- package/dist/esm/co-slider.entry.js +4 -4
- 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 +4 -4
- package/dist/esm/co-tags-field.entry.js +9 -9
- package/dist/esm/co-textarea.entry.js +7 -7
- package/dist/esm/co-toast.entry.js +35 -5
- package/dist/esm/co-toggle-button-group.entry.js +3 -3
- package/dist/esm/co-toggle-button.entry.js +4 -4
- package/dist/esm/co-transfer-list.entry.js +2 -2
- package/dist/esm/co-video.entry.js +4 -4
- package/dist/esm/cobalt.js +3 -3
- package/dist/esm/{fieldChip-Bb8YIN0J.js → fieldChip-BZDUy9Z-.js} +1 -1
- package/dist/esm/{index-BCEz3S-z.js → index-CrtiywTB.js} +13 -13
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{requiredMark-D7kAMXHM.js → requiredMark-DCD-ZA51.js} +1 -1
- package/dist/types/components/co-autocomplete/co-autocomplete.d.ts +1 -1
- package/dist/types/components/co-combobox/co-combobox.d.ts +1 -1
- package/dist/types/components/co-command-search/co-command-search.d.ts +7 -0
- package/dist/types/components/co-data-table/co-data-table.d.ts +5 -0
- package/dist/types/components/co-option-list/co-option-list.d.ts +5 -1
- package/dist/types/components/co-popover/co-popover.d.ts +8 -1
- package/dist/types/components/co-ref-field/co-ref-field.d.ts +21 -0
- package/dist/types/components/co-select/co-select.d.ts +7 -0
- package/dist/types/components/co-toast/co-toast.d.ts +19 -0
- package/dist/types/components/co-tooltip/co-tooltip.d.ts +6 -0
- package/dist/types/components.d.ts +66 -8
- package/dist/types/utils/columnResize.d.ts +42 -0
- package/dist/types/utils/popover-stack.d.ts +5 -0
- package/package.json +2 -2
- package/dist/cobalt/p-0f18c4d2.entry.js +0 -1
- package/dist/cobalt/p-260196cb.entry.js +0 -1
- package/dist/cobalt/p-27dce0ac.entry.js +0 -1
- package/dist/cobalt/p-2bf44b2b.entry.js +0 -1
- package/dist/cobalt/p-2c100914.entry.js +0 -1
- package/dist/cobalt/p-2e1d930f.entry.js +0 -1
- package/dist/cobalt/p-35518aee.entry.js +0 -1
- package/dist/cobalt/p-38cf47b6.entry.js +0 -1
- package/dist/cobalt/p-445acc4c.entry.js +0 -1
- package/dist/cobalt/p-4de9232a.entry.js +0 -1
- package/dist/cobalt/p-523aca9f.entry.js +0 -1
- package/dist/cobalt/p-5319ac3f.entry.js +0 -1
- package/dist/cobalt/p-53a276a8.entry.js +0 -1
- package/dist/cobalt/p-543cc00d.entry.js +0 -1
- package/dist/cobalt/p-59f7d44b.entry.js +0 -1
- package/dist/cobalt/p-5b984323.entry.js +0 -1
- package/dist/cobalt/p-5bfaca70.entry.js +0 -1
- package/dist/cobalt/p-5c250889.entry.js +0 -1
- package/dist/cobalt/p-5e21ca17.entry.js +0 -1
- package/dist/cobalt/p-61d5ca3c.entry.js +0 -1
- package/dist/cobalt/p-6357d9dd.entry.js +0 -1
- package/dist/cobalt/p-69b8d98e.entry.js +0 -1
- package/dist/cobalt/p-6b089060.entry.js +0 -1
- package/dist/cobalt/p-7d077a7c.entry.js +0 -1
- package/dist/cobalt/p-7f4bf341.entry.js +0 -1
- package/dist/cobalt/p-869c338a.entry.js +0 -1
- package/dist/cobalt/p-913b2a14.entry.js +0 -1
- package/dist/cobalt/p-9824c478.entry.js +0 -1
- package/dist/cobalt/p-99c1ff0f.entry.js +0 -1
- package/dist/cobalt/p-BCEz3S-z.js +0 -2
- package/dist/cobalt/p-C-d15gih.js +0 -1
- package/dist/cobalt/p-D5gr2ent.js +0 -1
- package/dist/cobalt/p-a4f39ba2.entry.js +0 -1
- package/dist/cobalt/p-a7c23027.entry.js +0 -1
- package/dist/cobalt/p-ab8e150e.entry.js +0 -1
- package/dist/cobalt/p-bad7ce84.entry.js +0 -1
- package/dist/cobalt/p-c237add6.entry.js +0 -1
- package/dist/cobalt/p-c32949a5.entry.js +0 -1
- package/dist/cobalt/p-cd5555d2.entry.js +0 -1
- package/dist/cobalt/p-d56b8a1f.entry.js +0 -1
- package/dist/cobalt/p-d6fff135.entry.js +0 -1
- package/dist/cobalt/p-d71b87d3.entry.js +0 -1
- package/dist/cobalt/p-d83e5189.entry.js +0 -1
- package/dist/cobalt/p-de5a05fc.entry.js +0 -1
- package/dist/cobalt/p-e2188319.entry.js +0 -1
- package/dist/cobalt/p-f4370423.entry.js +0 -1
- package/dist/cobalt/p-f4e4bebf.entry.js +0 -1
- package/dist/cobalt/p-f7ae0228.entry.js +0 -1
- package/dist/components/p-B21rOC2Y.js +0 -1
- package/dist/components/p-BXtiFFM2.js +0 -1
- package/dist/components/p-BdArvV6T.js +0 -1
- package/dist/components/p-BnkGlFYy.js +0 -1
- package/dist/components/p-CfeNhAHW.js +0 -1
- package/dist/components/p-ChLib-si.js +0 -1
- package/dist/components/p-D-3BTFRs.js +0 -1
- package/dist/components/p-D0wrmRH8.js +0 -1
- package/dist/components/p-DZX7cEqP.js +0 -1
- package/dist/components/p-W8Y8ZuPs.js +0 -1
- package/dist/components/p-cteJszd-.js +0 -1
- package/dist/components/p-mUoTCiYa.js +0 -1
- package/dist/components/p-ySi6UG0O.js +0 -1
|
@@ -65,13 +65,13 @@ export class CoToggleButtonGroup {
|
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
render() {
|
|
68
|
-
return (h("div", { key: '
|
|
68
|
+
return (h("div", { key: '01f91b5b2749347beebc42452a260093ce47e117', class: {
|
|
69
69
|
'co-toggle-button-group': true,
|
|
70
70
|
[`co-toggle-button-group--${this.direction}`]: true,
|
|
71
71
|
[`co-toggle-button-group--${this.variant}`]: true,
|
|
72
72
|
'co-toggle-button-group--disabled': this.disabled,
|
|
73
73
|
'co-toggle-button-group--full': this.fullWidth,
|
|
74
|
-
}, role: "group" }, h("slot", { key: '
|
|
74
|
+
}, role: "group" }, h("slot", { key: '1f5b0b91d4ec0a2b6cf120ba3e62d8c9ca60f41b' })));
|
|
75
75
|
}
|
|
76
76
|
static get is() { return "co-toggle-button-group"; }
|
|
77
77
|
static get encapsulation() { return "shadow"; }
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
word-wrap: break-word;
|
|
64
64
|
|
|
65
65
|
/* Entry animation */
|
|
66
|
-
transition: opacity
|
|
66
|
+
transition: opacity var(--co-motion-duration-base) var(--co-motion-ease-out), transform var(--co-motion-duration-base) var(--co-motion-ease-out);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
.co-tooltip__panel--positioned {
|
|
@@ -28,12 +28,17 @@ export class CoTooltip {
|
|
|
28
28
|
// ── State ──────────────────────────────────────────────────
|
|
29
29
|
this.visible = false;
|
|
30
30
|
this.actualPlacement = 'top';
|
|
31
|
+
/** Activación del trigger (click/tap): el tooltip se oculta y queda
|
|
32
|
+
* SUPRIMIDO hasta que el puntero salga y vuelva a entrar (o el foco salga).
|
|
33
|
+
* Sin esto, el tooltip re-aparece SOBRE el menú/popover que el click abrió
|
|
34
|
+
* (el botón conserva hover+focus). El foco por teclado no suprime. */
|
|
35
|
+
this.suppressed = false;
|
|
31
36
|
this.scrollParents = [];
|
|
32
37
|
this.cachedOffsetAncestor = null;
|
|
33
38
|
this.offsetAncestorComputed = false;
|
|
34
39
|
// ── Show / Hide ────────────────────────────────────────────
|
|
35
40
|
this.scheduleShow = () => {
|
|
36
|
-
if (this.disabled || !this.content)
|
|
41
|
+
if (this.disabled || !this.content || this.suppressed)
|
|
37
42
|
return;
|
|
38
43
|
this.clearHideTimeout();
|
|
39
44
|
if (this.visible)
|
|
@@ -59,12 +64,18 @@ export class CoTooltip {
|
|
|
59
64
|
this.scheduleShow();
|
|
60
65
|
};
|
|
61
66
|
this.handleMouseLeave = () => {
|
|
67
|
+
this.suppressed = false;
|
|
62
68
|
this.scheduleHide();
|
|
63
69
|
};
|
|
70
|
+
this.handlePointerDown = () => {
|
|
71
|
+
this.suppressed = true;
|
|
72
|
+
this.hideImmediate();
|
|
73
|
+
};
|
|
64
74
|
this.handleFocusIn = () => {
|
|
65
75
|
this.scheduleShow();
|
|
66
76
|
};
|
|
67
77
|
this.handleFocusOut = () => {
|
|
78
|
+
this.suppressed = false;
|
|
68
79
|
this.scheduleHide();
|
|
69
80
|
};
|
|
70
81
|
this.handleKeyDown = (e) => {
|
|
@@ -214,7 +225,7 @@ export class CoTooltip {
|
|
|
214
225
|
// ── Render ─────────────────────────────────────────────────
|
|
215
226
|
render() {
|
|
216
227
|
const side = this.actualPlacement.split('-')[0];
|
|
217
|
-
return (h("div", { key: '
|
|
228
|
+
return (h("div", { key: '530faa6db12a88e00f7af7331a23d3e350c3f8c5', class: "co-tooltip" }, h("div", { key: 'de0d1beac3ae5a253ef724b21321c81cdad86760', class: "co-tooltip__trigger", ref: (el) => (this.triggerEl = el), onMouseEnter: this.handleMouseEnter, onMouseLeave: this.handleMouseLeave, onPointerDown: this.handlePointerDown, onFocusin: this.handleFocusIn, onFocusout: this.handleFocusOut, onKeyDown: this.handleKeyDown, "aria-describedby": this.visible ? 'tooltip-panel' : undefined }, h("slot", { key: 'efc9d367cdcd83ea797996261482c09031e85db3' })), this.visible && this.content && (h("div", { key: '82fc28ee8eff7c7a0d9bbae39197853874d591fc', id: "tooltip-panel", class: {
|
|
218
229
|
'co-tooltip__panel': true,
|
|
219
230
|
[`co-tooltip__panel--${side}`]: true,
|
|
220
231
|
}, role: "tooltip", popover: "manual", ref: (el) => {
|
|
@@ -223,7 +234,7 @@ export class CoTooltip {
|
|
|
223
234
|
this.promotePanel();
|
|
224
235
|
this.scheduleUpdate();
|
|
225
236
|
}
|
|
226
|
-
}, style: { maxWidth: this.maxWidth } }, this.arrow && h("div", { key: '
|
|
237
|
+
}, style: { maxWidth: this.maxWidth } }, this.arrow && h("div", { key: '98744b724c3a165c4c6048731520f0fd2ac598ce', class: `co-tooltip__arrow co-tooltip__arrow--${side}` }), h("span", { key: '400b3c10dea6ded8e206d14326b424e01c4970ac', class: "co-tooltip__content" }, this.content)))));
|
|
227
238
|
}
|
|
228
239
|
static get is() { return "co-tooltip"; }
|
|
229
240
|
static get encapsulation() { return "shadow"; }
|
|
@@ -764,7 +764,7 @@ html[data-overlayscrollbars-viewport~=scrollbarHidden] > body::-webkit-scrollbar
|
|
|
764
764
|
padding: var(--co-spacing-sm2) var(--co-spacing-sm2);
|
|
765
765
|
border-radius: var(--co-border-radius-xxs, 4px);
|
|
766
766
|
cursor: pointer;
|
|
767
|
-
transition: background
|
|
767
|
+
transition: background var(--co-motion-duration-fast) var(--co-motion-ease-out);
|
|
768
768
|
}
|
|
769
769
|
|
|
770
770
|
.co-transfer-list__item:hover {
|
|
@@ -791,7 +791,7 @@ html[data-overlayscrollbars-viewport~=scrollbarHidden] > body::-webkit-scrollbar
|
|
|
791
791
|
border: 1px solid var(--co-semantic-border-default);
|
|
792
792
|
background: transparent;
|
|
793
793
|
flex-shrink: 0;
|
|
794
|
-
transition: background
|
|
794
|
+
transition: background var(--co-motion-duration-fast) var(--co-motion-ease-out), border-color var(--co-motion-duration-fast) var(--co-motion-ease-out);
|
|
795
795
|
color: var(--co-semantic-on-primary);
|
|
796
796
|
}
|
|
797
797
|
|
|
@@ -836,7 +836,7 @@ html[data-overlayscrollbars-viewport~=scrollbarHidden] > body::-webkit-scrollbar
|
|
|
836
836
|
color: var(--co-semantic-text-default);
|
|
837
837
|
cursor: pointer;
|
|
838
838
|
padding: 0;
|
|
839
|
-
transition: background
|
|
839
|
+
transition: background var(--co-motion-duration-fast) var(--co-motion-ease-out);
|
|
840
840
|
}
|
|
841
841
|
|
|
842
842
|
.co-transfer-list__btn:hover:not(:disabled) {
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
display: flex;
|
|
151
151
|
align-items: center;
|
|
152
152
|
justify-content: center;
|
|
153
|
-
transition: transform
|
|
153
|
+
transition: transform var(--co-motion-duration-base) var(--co-motion-ease-out), background var(--co-motion-duration-base) var(--co-motion-ease-out);
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
.co-video__big-play:hover .co-video__big-play-circle {
|
|
@@ -193,7 +193,7 @@
|
|
|
193
193
|
font-family: var(--co-font-family-primary);
|
|
194
194
|
font-size: var(--co-font-size-14);
|
|
195
195
|
cursor: pointer;
|
|
196
|
-
transition: background
|
|
196
|
+
transition: background var(--co-motion-duration-fast) var(--co-motion-ease-out), border-color var(--co-motion-duration-fast) var(--co-motion-ease-out);
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
.co-video__error-retry:hover {
|
|
@@ -214,7 +214,7 @@
|
|
|
214
214
|
padding: var(--co-spacing-3xl) var(--co-spacing-lg) var(--co-spacing-md);
|
|
215
215
|
z-index: 5;
|
|
216
216
|
opacity: 1;
|
|
217
|
-
transition: opacity
|
|
217
|
+
transition: opacity var(--co-motion-duration-slow) var(--co-motion-ease-out);
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
.co-video__controls--hidden {
|
|
@@ -229,7 +229,7 @@
|
|
|
229
229
|
width: 100%;
|
|
230
230
|
height: var(--co-video-progress-height);
|
|
231
231
|
cursor: pointer;
|
|
232
|
-
transition: height
|
|
232
|
+
transition: height var(--co-motion-duration-fast) var(--co-motion-ease-out);
|
|
233
233
|
margin-bottom: var(--co-spacing-sm);
|
|
234
234
|
outline: none;
|
|
235
235
|
touch-action: none;
|
|
@@ -261,7 +261,7 @@
|
|
|
261
261
|
height: 100%;
|
|
262
262
|
background: var(--co-video-buffered);
|
|
263
263
|
border-radius: var(--co-border-radius-full);
|
|
264
|
-
transition: width
|
|
264
|
+
transition: width var(--co-motion-duration-slow) var(--co-motion-ease-out);
|
|
265
265
|
}
|
|
266
266
|
|
|
267
267
|
.co-video__progress-played {
|
|
@@ -281,7 +281,7 @@
|
|
|
281
281
|
border-radius: var(--co-border-radius-full);
|
|
282
282
|
background: var(--co-video-accent);
|
|
283
283
|
transform: translate(-50%, -50%) scale(0);
|
|
284
|
-
transition: transform
|
|
284
|
+
transition: transform var(--co-motion-duration-fast) var(--co-motion-ease-out);
|
|
285
285
|
pointer-events: none;
|
|
286
286
|
}
|
|
287
287
|
|
|
@@ -319,7 +319,7 @@
|
|
|
319
319
|
cursor: pointer;
|
|
320
320
|
border-radius: var(--co-border-radius-xs);
|
|
321
321
|
padding: 0;
|
|
322
|
-
transition: background
|
|
322
|
+
transition: background var(--co-motion-duration-fast) var(--co-motion-ease-out);
|
|
323
323
|
flex-shrink: 0;
|
|
324
324
|
}
|
|
325
325
|
|
|
@@ -359,7 +359,7 @@
|
|
|
359
359
|
.co-video__volume-slider-wrap {
|
|
360
360
|
width: 0;
|
|
361
361
|
overflow: hidden;
|
|
362
|
-
transition: width
|
|
362
|
+
transition: width var(--co-motion-duration-base) var(--co-motion-ease-out), opacity var(--co-motion-duration-base) var(--co-motion-ease-out);
|
|
363
363
|
opacity: 0;
|
|
364
364
|
}
|
|
365
365
|
|
|
@@ -452,7 +452,7 @@
|
|
|
452
452
|
cursor: pointer;
|
|
453
453
|
background: transparent;
|
|
454
454
|
border: none;
|
|
455
|
-
transition: background
|
|
455
|
+
transition: background var(--co-motion-duration-fast) var(--co-motion-ease-out);
|
|
456
456
|
text-align: left;
|
|
457
457
|
}
|
|
458
458
|
|
|
@@ -789,14 +789,14 @@ export class CoVideo {
|
|
|
789
789
|
// ═══════════════════════════════════════════════════
|
|
790
790
|
render() {
|
|
791
791
|
const aspectClass = `co-video--${this.aspectRatio.replace(':', '-')}`;
|
|
792
|
-
return (h(Host, { key: '
|
|
792
|
+
return (h(Host, { key: 'afcd3252e4796089e104c7dff1252aee299739de' }, h("div", { key: '4cc677bbd6ce519e262b2cc67a574c85f5ea9066', class: {
|
|
793
793
|
'co-video': true,
|
|
794
794
|
[aspectClass]: true,
|
|
795
795
|
[`co-video--rounded-${this.rounded}`]: true,
|
|
796
796
|
'co-video--disabled': this.disabled,
|
|
797
797
|
'co-video--fullscreen': this.isFullscreen,
|
|
798
798
|
'co-video--playing': this.isPlaying,
|
|
799
|
-
}, part: "container", ref: el => (this.containerEl = el), role: "region", "aria-label": this.t.player, tabindex: 0, onKeyDown: this.handleKeyDown, onMouseMove: this.handleContainerMouseMove, onMouseLeave: this.handleContainerMouseLeave, onTouchStart: this.handleContainerTouchStart }, h("video", { key: '
|
|
799
|
+
}, part: "container", ref: el => (this.containerEl = el), role: "region", "aria-label": this.t.player, tabindex: 0, onKeyDown: this.handleKeyDown, onMouseMove: this.handleContainerMouseMove, onMouseLeave: this.handleContainerMouseLeave, onTouchStart: this.handleContainerTouchStart }, h("video", { key: 'f5313eb0f49b5185c62252fb68364526195ffd1c', ref: el => (this.videoEl = el), class: "co-video__native", part: "video", src: this.src || undefined, poster: undefined, preload: this.preload, loop: this.loop, playsinline: true, tabindex: -1, controlsList: this.allowDownload ? undefined : 'nodownload' }), this.renderPoster(), this.renderLoader(), this.renderBigPlayButton(), this.renderError(), h("div", { key: 'c6c54c6b9d329f7933b1b6fce15661c23f3f6c04', class: "co-video__click-area", onClick: this.handleVideoAreaClick }), this.renderControls())));
|
|
800
800
|
}
|
|
801
801
|
static get is() { return "co-video"; }
|
|
802
802
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure math for co-data-table's column-resize drag.
|
|
3
|
+
*
|
|
4
|
+
* Growing a column past the viewport needs the scroll container to CHASE the
|
|
5
|
+
* pointer: while it hovers an edge zone, each frame the drag adds
|
|
6
|
+
* `edgeAutoScrollSpeed()` px to the column width AND scrolls by the same
|
|
7
|
+
* amount, so the boundary keeps following the pointer instead of dying at the
|
|
8
|
+
* viewport edge (release → scrollbar → drag again).
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Signed px/frame to scroll (and grow the column) for the current pointer
|
|
12
|
+
* position: positive inside the right zone, negative inside the left zone,
|
|
13
|
+
* 0 in the middle. Speed ramps linearly across the zone so entering it never
|
|
14
|
+
* jumps, and clamps at maxSpeed past the container edge (the pointer can
|
|
15
|
+
* leave the viewport mid-drag).
|
|
16
|
+
*/
|
|
17
|
+
export function edgeAutoScrollSpeed({ pointerX, containerLeft, containerRight, edgeZone = 72, maxSpeed = 24, }) {
|
|
18
|
+
const width = containerRight - containerLeft;
|
|
19
|
+
// Unmeasured/degenerate rect (display:none, JSDOM) → never auto-scroll.
|
|
20
|
+
if (width <= 0)
|
|
21
|
+
return 0;
|
|
22
|
+
// Narrow containers: cap zones at a third of the width so they never overlap.
|
|
23
|
+
const zone = Math.min(edgeZone, width / 3);
|
|
24
|
+
const rightStart = containerRight - zone;
|
|
25
|
+
if (pointerX > rightStart) {
|
|
26
|
+
return Math.min(maxSpeed, ((pointerX - rightStart) / zone) * maxSpeed);
|
|
27
|
+
}
|
|
28
|
+
const leftStart = containerLeft + zone;
|
|
29
|
+
if (pointerX < leftStart) {
|
|
30
|
+
return -Math.min(maxSpeed, ((leftStart - pointerX) / zone) * maxSpeed);
|
|
31
|
+
}
|
|
32
|
+
return 0;
|
|
33
|
+
}
|
|
34
|
+
/** Column width for the current drag state, clamped to the column's minimum. */
|
|
35
|
+
export function resizeWidth({ startWidth, minWidth, pointerDelta, autoScrollExtra }) {
|
|
36
|
+
return Math.max(minWidth, startWidth + pointerDelta + autoScrollExtra);
|
|
37
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pila global de popovers abiertos (orden de apertura). Permite que el
|
|
3
|
+
* outside-click y ESC cierren SOLO el popover de más arriba: con un dropdown
|
|
4
|
+
* anidado dentro de un panel (filtro de columna), el primer click afuera
|
|
5
|
+
* cierra el dropdown y el segundo cierra el panel — no todo junto.
|
|
6
|
+
*
|
|
7
|
+
* Alcance: EXCLUSIVAMENTE co-popover. co-drawer, co-modal, co-overlay y
|
|
8
|
+
* co-bottom-sheet NO participan de esta pila — resuelven su propio layering
|
|
9
|
+
* por separado (co-drawer, por ejemplo, con un querySelector de drawers/
|
|
10
|
+
* modales abiertos). No es un layer manager global.
|
|
11
|
+
*/
|
|
12
|
+
const stack = [];
|
|
13
|
+
export function pushLayer(el) {
|
|
14
|
+
removeLayer(el); // re-open: mover al tope, nunca duplicar
|
|
15
|
+
stack.push(el);
|
|
16
|
+
}
|
|
17
|
+
export function removeLayer(el) {
|
|
18
|
+
const i = stack.indexOf(el);
|
|
19
|
+
if (i !== -1)
|
|
20
|
+
stack.splice(i, 1);
|
|
21
|
+
}
|
|
22
|
+
export function isTopLayer(el) {
|
|
23
|
+
return stack.length > 0 && stack[stack.length - 1] === el;
|
|
24
|
+
}
|
|
25
|
+
/** Solo para tests: vacía la pila entre casos. */
|
|
26
|
+
export function _resetLayers() {
|
|
27
|
+
stack.length = 0;
|
|
28
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as o,p as
|
|
1
|
+
import{t as o,p as c,H as e,c as i,h as a}from"./index.js";import{d as t}from"./p-BCZ-tPBT.js";const n=c(class extends e{constructor(o){super(),!1!==o&&this.__registerHost(),this.__attachShadow(),this.coToggle=i(this,"coToggle",7),this.open=!0,this.heading="",this.subheading="",this.disabled=!1,this.hasSubheadingSlot=!1,this.handleToggle=()=>{this.disabled||(this.open=!this.open,this.coToggle.emit(this.open))}}componentWillLoad(){this.hasSubheadingSlot=!!this.el.querySelector('[slot="subheading"]')}componentWillRender(){this.hasSubheadingSlot=!!this.el.querySelector('[slot="subheading"]')}get showSubheading(){return!(!this.subheading||!this.subheading.trim())||this.hasSubheadingSlot}render(){return a("div",{key:"4e2089349432ce39bb797397aacaebd022fcbcee",class:{"co-accordion":!0,"co-accordion--open":this.open,"co-accordion--disabled":this.disabled},part:"accordion"},a("div",{key:"4337878858bd31822201a925010f3150568fa056",class:"co-accordion__header",part:"header"},a("span",{key:"cf69c69cc786981ca6bd54bd0f6a6c38a3baa0b6",class:"co-accordion__heading-group"},a("span",{key:"0e7efd52e6d48c35ce0270485e8ce6099c6a3302",class:"co-accordion__heading",part:"heading"},a("slot",{key:"b575ce7ae5611007490724f430819f083781f84d",name:"header"},this.heading)),this.showSubheading&&a("span",{key:"996a58f3f3b5cd656849b413b0f998675452cc2f",class:"co-accordion__subheading",part:"subheading"},a("slot",{key:"a9029aa67f51162ad54c010d23bf20545883ef45",name:"subheading"},this.subheading))),a("button",{key:"757286aaf2914fe7d32fc14ab0f5de57ffeab48c",class:"co-accordion__caret",type:"button","aria-expanded":this.open?"true":"false","aria-label":this.heading||"Toggle section",disabled:this.disabled,onClick:this.handleToggle,part:"caret"},a("co-icon",{key:"b4c3c96489a30607727a44955dbff2d504ef2b6e",name:"caret-up",size:20}))),a("div",{key:"bd56b12cbd7484f61fec140740312800536d7b18",class:"co-accordion__body",part:"body"},a("div",{key:"1f2ff56e7bd7a49f8484c988ecdf434d108ef4ed",class:"co-accordion__body-inner",part:"body-inner"},a("slot",{key:"25ef25609ccece786a05709d90a32e7e135fec72"}))))}get el(){return this}static get style(){return":host{display:block}.co-accordion{display:flex;flex-direction:column;width:100%}.co-accordion__header{display:flex;align-items:center;justify-content:space-between;gap:var(--co-spacing-sm, 6px);width:100%;font-family:var(--co-font-family-primary);color:var(--co-semantic-text-default);text-align:left}.co-accordion__heading-group{flex:1;min-width:0;display:flex;flex-direction:column;gap:var(--co-spacing-xxs, 2px)}.co-accordion__heading{font-size:var(--co-font-size-24);font-weight:500;line-height:1.25;letter-spacing:-0.03em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.co-accordion__subheading{font-size:var(--co-font-size-14);font-weight:400;line-height:1.3;letter-spacing:normal;color:var(--co-semantic-text-secondary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.co-accordion__caret{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:none;background:transparent;border-radius:var(--co-border-radius-full, 9999px);color:var(--co-semantic-text-default);cursor:pointer;transition:transform var(--co-motion-duration-base) var(--co-motion-ease-out), background-color var(--co-motion-duration-fast) var(--co-motion-ease-out);transform:rotate(180deg);}.co-accordion__caret:hover:not(:disabled){background:var(--co-color-opacity-negro-8, rgba(31, 28, 27, 0.08))}.co-accordion--open .co-accordion__caret{transform:rotate(0deg);}.co-accordion__body{display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--co-motion-duration-slow) var(--co-motion-ease-out)}.co-accordion__body-inner{min-height:0;overflow:hidden;padding-top:var(--co-spacing-2xl);transition:padding-top var(--co-motion-duration-slow) var(--co-motion-ease-out)}.co-accordion:not(.co-accordion--open) .co-accordion__body-inner{padding-top:0}.co-accordion--open .co-accordion__body{grid-template-rows:1fr}.co-accordion:not(.co-accordion--open) .co-accordion__body-inner{visibility:hidden;transition:padding-top var(--co-motion-duration-slow) var(--co-motion-ease-out), visibility 0s linear var(--co-motion-duration-slow)}.co-accordion--open .co-accordion__body-inner{visibility:visible;transition:padding-top var(--co-motion-duration-slow) var(--co-motion-ease-out), visibility 0s linear 0s}.co-accordion__caret:focus-visible{outline:2px solid var(--co-color-primary-azul, #2563eb);outline-offset:2px}.co-accordion--disabled .co-accordion__header{opacity:0.5}.co-accordion--disabled .co-accordion__caret{cursor:not-allowed}"}},[257,"co-accordion",{open:[1540],heading:[1],subheading:[1],disabled:[4],hasSubheadingSlot:[32]}]);function r(){"undefined"!=typeof customElements&&["co-accordion","co-icon"].forEach((c=>{switch(c){case"co-accordion":customElements.get(o(c))||customElements.define(o(c),n);break;case"co-icon":customElements.get(o(c))||t()}}))}r();const d=n,s=r;export{d as CoAccordion,s as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as a,p as i,H as
|
|
1
|
+
import{t as a,p as i,H as o,c as t,h as e}from"./index.js";import{d as n}from"./p-BCZ-tPBT.js";import{d as s}from"./p-BUYgHlPz.js";const c=i(class extends o{constructor(a){super(),!1!==a&&this.__registerHost(),this.__attachShadow(),this.coDismiss=t(this,"coDismiss",7),this.open=!1,this.dismissible=!0,this.position="none",this.liveText="",this.animated=!1,this.handleDismiss=()=>{this.coDismiss.emit()}}onLabelChange(a){void 0!==this.liveTimer&&clearTimeout(this.liveTimer),this.liveTimer=setTimeout((()=>{this.liveTimer=void 0,this.liveText=null!=a?a:""}),600)}componentWillLoad(){var a;this.liveText=null!==(a=this.label)&&void 0!==a?a:""}componentDidLoad(){const a=()=>this.animated=!0;"function"==typeof requestAnimationFrame?this.rafId=requestAnimationFrame(a):a()}disconnectedCallback(){void 0!==this.liveTimer&&(clearTimeout(this.liveTimer),this.liveTimer=void 0),void 0!==this.rafId&&"function"==typeof cancelAnimationFrame&&(cancelAnimationFrame(this.rafId),this.rafId=void 0)}render(){return e("div",{key:"c350ea38a12157a5cefe26f303ef7100938d55c9",class:{"co-action-bar":!0,"co-action-bar--open":this.open,"co-action-bar--animated":this.animated},part:"bar",role:"group","aria-label":this.ariaLabelText||this.label,"aria-hidden":this.open?null:"true"},e("span",{key:"9f2d3d5729fd150e5aa0c487067c7c8ad6cd8b59",class:"co-action-bar__live","aria-live":"polite"},this.liveText),e("span",{key:"d2617507df8f2b48a743c1bb20482d9cc2e227df",class:"co-action-bar__label",part:"label"},e("slot",{key:"aad415247f017bd8ea38e38f84a0cd768a2f6f38",name:"label"},this.label)),e("div",{key:"8999cd574e430246824effda0bfa531d62a3530a",class:"co-action-bar__actions",part:"actions"},e("slot",{key:"f06636fd076da38bc07982637f7def5d75df733e"})),!1!==this.dismissible&&e("co-icon-button",{key:"4227fa464073430c67190ac4afc6c6534b627934",class:"co-action-bar__dismiss",part:"dismiss",icon:"x",variant:"ghost",surface:"dark",size:"xs",label:"Dismiss",onClick:this.handleDismiss}))}static get watchers(){return{label:[{onLabelChange:0}]}}static get style(){return":host{display:inline-flex;font-family:var(--co-font-family-primary);pointer-events:none}:host([position='bottom-center']){position:fixed;left:50%;transform:translateX(-50%);bottom:var(--co-action-bar-offset, 24px);z-index:var(--co-action-bar-z, 1000);max-width:calc(100vw - 2 * var(--co-action-bar-inline-margin, 24px))}.co-action-bar{position:relative;display:flex;align-items:center;box-sizing:border-box;max-width:100%;gap:var(--co-spacing-sm2);padding:var(--co-spacing-sm2) var(--co-spacing-md) var(--co-spacing-sm2) var(--co-spacing-lg);border-radius:var(--co-border-radius-lg);background:var(--co-semantic-surface-primary);color:var(--co-semantic-text-inverse);box-shadow:var(--co-shadow-lg);opacity:0;transform:translateY(8px);pointer-events:none;visibility:hidden}.co-action-bar--open{opacity:1;transform:translateY(0);pointer-events:auto;visibility:visible}.co-action-bar--animated{transition:opacity var(--co-motion-duration-base) var(--co-motion-ease-out), transform var(--co-motion-duration-base) var(--co-motion-ease-out), visibility 0s linear var(--co-motion-duration-base)}.co-action-bar--animated.co-action-bar--open{transition:opacity var(--co-motion-duration-base) var(--co-motion-ease-out), transform var(--co-motion-duration-base) var(--co-motion-ease-out), visibility 0s}.co-action-bar__label{font-size:var(--co-font-size-14);font-weight:500;letter-spacing:var(--co-font-letter-spacing-body);line-height:1;white-space:nowrap;flex-shrink:0;padding-right:var(--co-spacing-xs)}.co-action-bar__actions{display:flex;align-items:center;gap:var(--co-spacing-xs);min-width:0}::slotted(hr){width:1px;height:24px;flex-shrink:0;align-self:center;margin:0 var(--co-spacing-xs);border:none;padding:0;background:color-mix(in srgb, var(--co-color-base-blanco, #fff) 28%, transparent)}.co-action-bar__dismiss{flex-shrink:0}.co-action-bar__live{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap}"}},[257,"co-action-bar",{open:[516],label:[1],dismissible:[4],position:[513],ariaLabelText:[1,"aria-label-text"],liveText:[32],animated:[32]},void 0,{label:[{onLabelChange:0}]}]);function r(){"undefined"!=typeof customElements&&["co-action-bar","co-icon","co-icon-button"].forEach((i=>{switch(i){case"co-action-bar":customElements.get(a(i))||customElements.define(a(i),c);break;case"co-icon":customElements.get(a(i))||n();break;case"co-icon-button":customElements.get(a(i))||s()}}))}r();const l=c,d=r;export{l as CoActionBar,d as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as
|
|
1
|
+
import{t as a,p as e,H as r,c as o,h as t,a as c}from"./index.js";const s=e(class extends r{constructor(a){super(),!1!==a&&this.__registerHost(),this.__attachShadow(),this.coSidebarModeChange=o(this,"coSidebarModeChange",7),this.sidebarMode="min",this.contentCard=!0}render(){return t(c,{key:"7a45ab21e3ad256e25f05df33ad827931532c34a"},t("aside",{key:"5ca5469a35e630b4ab01be23cae46efc43cb1519",class:"sidebar",part:"sidebar"},t("div",{key:"f4243197b46e67b4d632aa8abad803b07f471bb2",class:"sidebar__header",part:"sidebar-header"},t("slot",{key:"b609c8272c05f7e4cbb2c8ae1ab0c24430541f84",name:"sidebar-header"})),t("div",{key:"72ca1118e1eeb6b5f3467c16c82dac60c4dc4042",class:"sidebar__body",part:"sidebar-body"},t("slot",{key:"48c65d150a4836996cf7406f32142bcb86e545df",name:"sidebar"})),t("div",{key:"be09567b81d7abae1738decfd30b9b7b6edb47f2",class:"sidebar__footer",part:"sidebar-footer"},t("slot",{key:"d202466aa14916d7fd3be163a615ce1156151150",name:"sidebar-footer"}))),t("div",{key:"d8b6f0cfdf0c4123b413d5d8bad78813fb7ba1a9",class:"main",part:"main"},t("div",{key:"0efa85801eaa0cd339875ff4a1fd9cedcd715751",class:"main__card",part:"card"},t("header",{key:"befa647b3822ed055166c3e2da9aca9fb54c1204",class:"main__header",part:"header"},t("slot",{key:"b08034b07963d178f3b8e9cee16d3975f97a7b90",name:"navbar"})),t("main",{key:"3b0adfc33dd08b08fb2edf84a5f098c0ff7d1003",class:{main__content:!0,"main__content--card":this.contentCard},part:"content"},t("slot",{key:"4c38a0a04548bc6cd2cc04d9b3fb095f5548fdde"})))))}static get style(){return':host{display:flex;height:100vh;overflow:hidden;background:var(--co-app-shell-bg, linear-gradient( 180deg, var(--co-color-base-off-white) 0%, var(--co-color-neutral-100) 50%, var(--co-color-neutral-100) 100% ));font-family:var(--co-font-family-primary)}.sidebar{display:flex;flex-direction:column;width:256px;height:100%;flex-shrink:0;overflow:hidden;transition:width var(--co-motion-duration-base) var(--co-motion-ease-out);padding:var(--co-spacing-sm);padding-right:0;box-sizing:border-box}:host([sidebar-mode="min"]) .sidebar{--co-sidebar-min-width:64px;width:var(--co-sidebar-min-width);align-items:flex-start;padding:var(--co-spacing-sm) 0}.sidebar__header{flex-shrink:0}.sidebar__body{flex:1;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:transparent transparent}.sidebar__body:hover{scrollbar-color:var(--co-color-opacity-blanco-16) transparent}.sidebar__body::-webkit-scrollbar{width:6px}.sidebar__body::-webkit-scrollbar-track{background:transparent}.sidebar__body::-webkit-scrollbar-thumb{background:transparent;border-radius:9999px}.sidebar__body:hover::-webkit-scrollbar-thumb{background:var(--co-color-opacity-blanco-16)}.sidebar__body:hover::-webkit-scrollbar-thumb:hover{background:var(--co-color-opacity-blanco-25)}.sidebar__body:hover::-webkit-scrollbar-thumb:active{background:var(--co-color-opacity-blanco-50)}.sidebar__footer{flex-shrink:0}:host([sidebar-mode="min"]) .sidebar__header,:host([sidebar-mode="min"]) .sidebar__body,:host([sidebar-mode="min"]) .sidebar__footer{display:flex;flex-direction:column;align-items:center;width:var(--co-sidebar-min-width, 64px)}:host([sidebar-mode="min"]) .sidebar__header{gap:var(--co-spacing-sm);padding-bottom:var(--co-spacing-md)}:host([sidebar-mode="min"]) .sidebar__body{scrollbar-width:none}:host([sidebar-mode="min"]) .sidebar__body::-webkit-scrollbar{width:0}.main{display:flex;flex-direction:column;flex:1;min-width:0;padding:0;margin:var(--co-spacing-sm);margin-left:0;min-height:0;filter:drop-shadow(0 1px 2px rgba(31, 28, 27, 0.06)) drop-shadow(0 10px 28px rgba(31, 28, 27, 0.12));--co-shell-r:var(--co-border-radius-md);--co-sq-tl:url("data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 100 100%27 preserveAspectRatio=%27none%27><path d=%27M100 0L97.5 0L95 0L92.5 0L90 0L87.5 0.01L85 0.01L82.5 0.02L80 0.04L77.5 0.06L75 0.1L72.5 0.14L70 0.2L67.5 0.28L65 0.38L62.5 0.5L60 0.65L57.5 0.83L55 1.04L52.5 1.3L50 1.6L47.5 1.96L45 2.37L42.5 2.85L40 3.41L37.5 4.05L35 4.8L32.5 5.65L30 6.63L27.5 7.77L25 9.07L22.5 10.58L20 12.34L17.5 14.41L15 16.85L12.5 19.79L10 23.42L7.5 28.06L5 34.37L2.5 44.29L0 100L100 100Z%27 fill=%27%23fff%27/></svg>");--co-sq-tr:url("data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 100 100%27 preserveAspectRatio=%27none%27><path d=%27M0 0L2.5 0L5 0L7.5 0L10 0L12.5 0.01L15 0.01L17.5 0.02L20 0.04L22.5 0.06L25 0.1L27.5 0.14L30 0.2L32.5 0.28L35 0.38L37.5 0.5L40 0.65L42.5 0.83L45 1.04L47.5 1.3L50 1.6L52.5 1.96L55 2.37L57.5 2.85L60 3.41L62.5 4.05L65 4.8L67.5 5.65L70 6.63L72.5 7.77L75 9.07L77.5 10.58L80 12.34L82.5 14.41L85 16.85L87.5 19.79L90 23.42L92.5 28.06L95 34.37L97.5 44.29L100 100L0 100Z%27 fill=%27%23fff%27/></svg>");--co-sq-bl:url("data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 100 100%27 preserveAspectRatio=%27none%27><path d=%27M0 0L2.5 55.71L5 65.63L7.5 71.94L10 76.58L12.5 80.21L15 83.15L17.5 85.59L20 87.66L22.5 89.42L25 90.93L27.5 92.23L30 93.37L32.5 94.35L35 95.2L37.5 95.95L40 96.59L42.5 97.15L45 97.63L47.5 98.04L50 98.4L52.5 98.7L55 98.96L57.5 99.17L60 99.35L62.5 99.5L65 99.62L67.5 99.72L70 99.8L72.5 99.86L75 99.9L77.5 99.94L80 99.96L82.5 99.98L85 99.99L87.5 99.99L90 100L92.5 100L95 100L97.5 100L100 100L100 0Z%27 fill=%27%23fff%27/></svg>");--co-sq-br:url("data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 100 100%27 preserveAspectRatio=%27none%27><path d=%27M100 0L97.5 55.71L95 65.63L92.5 71.94L90 76.58L87.5 80.21L85 83.15L82.5 85.59L80 87.66L77.5 89.42L75 90.93L72.5 92.23L70 93.37L67.5 94.35L65 95.2L62.5 95.95L60 96.59L57.5 97.15L55 97.63L52.5 98.04L50 98.4L47.5 98.7L45 98.96L42.5 99.17L40 99.35L37.5 99.5L35 99.62L32.5 99.72L30 99.8L27.5 99.86L25 99.9L22.5 99.94L20 99.96L17.5 99.98L15 99.99L12.5 99.99L10 100L7.5 100L5 100L2.5 100L0 100L0 0Z%27 fill=%27%23fff%27/></svg>")}.main__card{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden;border-radius:0;-webkit-mask:var(--co-sq-tl) top left / var(--co-shell-r) var(--co-shell-r) no-repeat, var(--co-sq-tr) top right / var(--co-shell-r) var(--co-shell-r) no-repeat, var(--co-sq-bl) bottom left / var(--co-shell-r) var(--co-shell-r) no-repeat, var(--co-sq-br) bottom right / var(--co-shell-r) var(--co-shell-r) no-repeat, linear-gradient(#fff 0 0) center / 100% calc(100% - 2 * var(--co-shell-r) + 2px) no-repeat, linear-gradient(#fff 0 0) center / calc(100% - 2 * var(--co-shell-r) + 2px) 100% no-repeat;mask:var(--co-sq-tl) top left / var(--co-shell-r) var(--co-shell-r) no-repeat, var(--co-sq-tr) top right / var(--co-shell-r) var(--co-shell-r) no-repeat, var(--co-sq-bl) bottom left / var(--co-shell-r) var(--co-shell-r) no-repeat, var(--co-sq-br) bottom right / var(--co-shell-r) var(--co-shell-r) no-repeat, linear-gradient(#fff 0 0) center / 100% calc(100% - 2 * var(--co-shell-r) + 2px) no-repeat, linear-gradient(#fff 0 0) center / calc(100% - 2 * var(--co-shell-r) + 2px) 100% no-repeat}.main__header{flex-shrink:0}.main__content{flex:1;min-height:0;overflow:hidden;scrollbar-width:thin;scrollbar-color:transparent transparent}.main__content:hover{scrollbar-color:var(--co-color-opacity-negro-16) transparent}.main__content::-webkit-scrollbar{width:6px;height:6px}.main__content::-webkit-scrollbar-track{background:transparent}.main__content::-webkit-scrollbar-thumb{background:transparent;border-radius:9999px}.main__content:hover::-webkit-scrollbar-thumb{background:var(--co-color-opacity-negro-16)}.main__content:hover::-webkit-scrollbar-thumb:hover{background:var(--co-color-opacity-negro-25)}.main__content:hover::-webkit-scrollbar-thumb:active{background:var(--co-color-opacity-negro-50)}.main__content--card{background:var(--co-semantic-surface-secondary)}'}},[257,"co-app-shell",{sidebarMode:[1537,"sidebar-mode"],contentCard:[4,"content-card"]}]);function i(){"undefined"!=typeof customElements&&["co-app-shell"].forEach((e=>{"co-app-shell"===e&&(customElements.get(a(e))||customElements.define(a(e),s))}))}i();const d=s,n=i;export{d as CoAppShell,n as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,p as i,H as a,c as e,h as s}from"./index.js";import{d as o}from"./p-DbISGXT_.js";function r(t){const i=Math.max(0,Math.floor(t||0));return`${Math.floor(i/60)}:${(""+i%60).padStart(2,"0")}`}function c(t,i){const a=t.length;if(!a||i<=0)return[];const e=Math.max(1,Math.floor(a/i)),s=[];for(let o=0;o<i;o++){let i=0;const r=o*e;for(let s=r;s<r+e&&s<a;s++){const a=Math.abs(t[s]);a>i&&(i=a)}s.push(.12+.88*i)}return s}function n(t){if(t<=0)return[];const i=[];for(let a=0;a<t;a++)i.push(.12+(.6*Math.sin(a/Math.max(1,t)*Math.PI)+.3)*(.75+.25*Math.abs(Math.sin(1.7*a)))*.88);return i}const h=i(class extends a{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.coPlay=e(this,"coPlay",7),this.coPause=e(this,"coPause",7),this.coEnded=e(this,"coEnded",7),this.coError=e(this,"coError",7),this.compact=!1,this.bars=64,this.barDensity=3,this.preload="metadata",this.downloadFilename="audio",this.noDownload=!1,this.isPlaying=!1,this.isLoading=!1,this.hasError=!1,this.currentTime=0,this.duration=0,this.peaks=[],this.containerWidth=0,this.playbackRate=1,this.rawChannelData=null,this.onMeta=()=>{var t;this.duration=(null===(t=this.audio)||void 0===t?void 0:t.duration)||0},this.onCanPlay=()=>{this.isLoading=!1},this.onWaiting=()=>{this.isLoading=!0},this.onTime=()=>{var t;this.currentTime=(null===(t=this.audio)||void 0===t?void 0:t.currentTime)||0},this.onEnded=()=>{this.isPlaying=!1,this.currentTime=0,this.coEnded.emit()},this.onErr=t=>{this.isLoading=!1,this.hasError=!0,this.coError.emit(t)},this.toggle=()=>{this.audio&&!this.hasError&&(this.isPlaying?(this.audio.pause(),this.isPlaying=!1,this.coPause.emit()):this.audio.play().then((()=>{this.isPlaying=!0,this.coPlay.emit()})).catch((()=>{})))},this.SPEEDS=[1,1.5,2,.5],this.cycleSpeed=()=>{const t=this.SPEEDS.indexOf(this.playbackRate);this.playbackRate=this.SPEEDS[(t+1)%this.SPEEDS.length],this.audio&&(this.audio.playbackRate=this.playbackRate)},this.seekAt=t=>{if(!this.audio||!this.waveEl||!this.duration)return;const i=function(t,i){return i.width?Math.max(0,Math.min(1,(t-i.left)/i.width)):0}(t,this.waveEl.getBoundingClientRect());this.audio.currentTime=i*this.duration,this.currentTime=this.audio.currentTime},this.onWaveKey=t=>{if(" "===t.key||"Enter"===t.key)return t.preventDefault(),void this.toggle();if(this.audio&&this.duration){if("ArrowRight"===t.key)this.audio.currentTime=Math.min(this.duration,this.audio.currentTime+5);else{if("ArrowLeft"!==t.key)return;this.audio.currentTime=Math.max(0,this.audio.currentTime-5)}this.currentTime=this.audio.currentTime}}}get effectiveBars(){return this.containerWidth>0?Math.max(24,Math.floor(this.containerWidth/this.barDensity)):this.bars}componentWillLoad(){this.init()}componentDidLoad(){if("undefined"==typeof ResizeObserver||!this.waveEl)return;this.resizeObserver=new ResizeObserver((t=>{var i;for(const a of t){const t=(null===(i=a.contentRect)||void 0===i?void 0:i.width)||a.target.clientWidth||0;t>2&&Math.abs(t-this.containerWidth)>2&&(this.containerWidth=t,this.rebuildBars())}})),this.resizeObserver.observe(this.waveEl);const t=this.waveEl.clientWidth||0;t>2&&(this.containerWidth=t,this.rebuildBars())}disconnectedCallback(){var t;this.teardown(),null===(t=this.resizeObserver)||void 0===t||t.disconnect(),this.resizeObserver=void 0}onSrcChange(){this.init()}rebuildBars(){this.peaks=this.rawChannelData?c(this.rawChannelData,this.effectiveBars):n(this.effectiveBars)}init(){if(this.teardown(),this.rawChannelData=null,this.peaks=n(this.effectiveBars),this.currentTime=0,this.duration=0,this.playbackRate=1,this.hasError=!1,!this.src)return;if(this.isLoading=!0,this.extractPeaks(this.src),"undefined"==typeof Audio)return;const t=new Audio;t.preload=this.preload,t.crossOrigin="anonymous",t.src=this.src,t.addEventListener("loadedmetadata",this.onMeta),t.addEventListener("timeupdate",this.onTime),t.addEventListener("ended",this.onEnded),t.addEventListener("error",this.onErr),t.addEventListener("canplay",this.onCanPlay),t.addEventListener("waiting",this.onWaiting),this.audio=t}teardown(){this.audio&&(this.audio.pause(),this.audio.removeEventListener("loadedmetadata",this.onMeta),this.audio.removeEventListener("timeupdate",this.onTime),this.audio.removeEventListener("ended",this.onEnded),this.audio.removeEventListener("error",this.onErr),this.audio.removeEventListener("canplay",this.onCanPlay),this.audio.removeEventListener("waiting",this.onWaiting),this.audio.src="",this.audio=void 0),this.isPlaying=!1}async extractPeaks(t){try{const i=window.AudioContext||window.webkitAudioContext;if(!i||"undefined"==typeof fetch)return;const a=new i,e=await(await fetch(t)).arrayBuffer(),s=await a.decodeAudioData(e);this.rawChannelData=s.getChannelData(0),this.peaks=c(this.rawChannelData,this.effectiveBars),a.close()}catch(t){this.rawChannelData=null,this.peaks=n(this.effectiveBars)}}async download(){if(this.src&&"undefined"!=typeof fetch)try{const t=await(await fetch(this.src)).blob(),i=URL.createObjectURL(t),a=document.createElement("a");a.href=i,a.download=this.downloadFilename,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(i)}catch(t){}}render(){const t=Math.max(1,3*this.peaks.length),i=this.duration?this.currentTime/this.duration*100:0,a=(t,i,a=!1)=>s("rect",{key:"ffe5ce97626e52c12e60b953b62d237f14acb582",x:3*i,y:20-40*t/2,width:1.8,height:Math.max(40*t,2),rx:.6,class:{"co-audio-player__bar":!0,"co-audio-player__bar--played":a}});return s("div",{key:"012710aded6ca183e80d7fde087cb0fdf413249b",class:{"co-audio-player":!0,"co-audio-player--compact":this.compact,"co-audio-player--error":this.hasError,"co-audio-player--playing":this.isPlaying},part:"player"},s("button",{key:"2505b88e97e73fd39aa31e3dad5e7fe0c1b94c80",type:"button",class:"co-audio-player__play",part:"play","aria-label":this.hasError?"Audio no disponible":this.isPlaying?"Pausar":"Reproducir","aria-busy":this.isLoading?"true":"false",disabled:this.hasError||!this.src,onClick:this.toggle},s("co-icon",{key:"e0e0d2dd5f6e0578ba80a3c235e5c221a6e8fe21",name:this.hasError?"warning-circle":this.isPlaying?"pause":"play",weight:"fill",size:this.compact?12:14})),s("div",{key:"d2b32119c69c64d2f68d469fe4ae056780446322",class:"co-audio-player__wave",part:"wave",role:"slider",tabindex:"0","aria-label":"Progreso de reproducción","aria-valuemin":0,"aria-valuemax":Math.floor(this.duration),"aria-valuenow":Math.floor(this.currentTime),ref:t=>this.waveEl=t,onClick:t=>this.seekAt(t.clientX),onKeyDown:this.onWaveKey},s("svg",{key:"fb9643df152d2d0b119580954f639cb3a9c2cd66",class:"co-audio-player__svg",viewBox:`0 0 ${t} 40`,preserveAspectRatio:"none","aria-hidden":"true"},this.peaks.map(((t,i)=>a(t,i))),s("clipPath",{key:"c2901cfe7c7e910bd53c8c92894b2d2395cde270",id:"co-ap-clip"},s("rect",{key:"8129a85201e09ba6646b08ed0075798b0a0b0dfc",x:"0",y:"0",width:i/100*t,height:40})),s("g",{key:"69bc1780122d48f1a545d1c59bf7ed6536285ed2","clip-path":"url(#co-ap-clip)"},this.peaks.map(((t,i)=>a(t,i,!0)))))),s("span",{key:"3747622619bd81545f85e7eb2f9c19b1aca6e7c2",class:"co-audio-player__time",part:"time"},r(this.currentTime)," / ",r(this.duration)),!this.compact&&s("button",{key:"84341856fb2e0b6a094c673a727370b148190e30",type:"button",class:"co-audio-player__speed",part:"speed","aria-label":`Velocidad de reproducción ${this.playbackRate}x`,onClick:this.cycleSpeed},this.playbackRate,"x"),!this.compact&&!this.noDownload&&s("button",{key:"d6767d185317f20299b40c4050a806d88165682f",type:"button",class:"co-audio-player__dl",part:"download","aria-label":"Descargar",onClick:()=>this.download()},s("co-icon",{key:"a0f0a09cdf705ecf15e0156cf93011f89f41ffa5",name:"download-simple",size:14})))}static get watchers(){return{src:[{onSrcChange:0}]}}static get style(){return":host{display:block;font-family:var(--co-font-family-primary)}.co-audio-player{display:flex;align-items:center;gap:var(--co-spacing-md);padding:var(--co-spacing-sm) var(--co-spacing-md);border:1px solid var(--co-semantic-border-default);border-radius:var(--co-border-radius-xs);background:var(--co-semantic-surface-secondary);min-width:180px}.co-audio-player--compact{gap:var(--co-spacing-sm2);padding:var(--co-spacing-sm2) var(--co-spacing-sm);min-width:140px}.co-audio-player__play{flex:0 0 auto;width:28px;height:28px;border:none;border-radius:50%;cursor:pointer;background:var(--co-semantic-surface-primary);color:var(--co-semantic-text-inverse);display:inline-flex;align-items:center;justify-content:center}.co-audio-player--compact .co-audio-player__play{width:24px;height:24px}.co-audio-player__play:disabled{opacity:.5;cursor:not-allowed}.co-audio-player__play:focus-visible{outline:2px solid var(--co-semantic-border-focus);outline-offset:2px}.co-audio-player__wave{flex:1;height:40px;min-width:0;cursor:pointer;display:flex;align-items:center}.co-audio-player__wave:focus-visible{outline:2px solid var(--co-semantic-border-focus);outline-offset:2px;border-radius:var(--co-border-radius-xxs)}.co-audio-player__svg{width:100%;height:100%;display:block}.co-audio-player__bar{fill:var(--co-semantic-border-field);transition:fill .15s}.co-audio-player__wave:hover .co-audio-player__bar{fill:var(--co-semantic-text-muted)}.co-audio-player__bar--played{fill:var(--co-semantic-surface-primary)}.co-audio-player__time{flex:0 0 auto;font-size:var(--co-font-size-12);color:var(--co-semantic-text-muted);font-variant-numeric:tabular-nums;min-width:62px;text-align:right}.co-audio-player__speed{flex:0 0 auto;border:none;background:transparent;cursor:pointer;padding:2px 4px;color:var(--co-semantic-text-muted);font-family:var(--co-font-family-primary);font-size:var(--co-font-size-12);font-variant-numeric:tabular-nums;min-width:34px;text-align:center}.co-audio-player__speed:hover{color:var(--co-semantic-text-default)}.co-audio-player__speed:focus-visible{outline:2px solid var(--co-semantic-border-focus);outline-offset:2px;border-radius:var(--co-border-radius-xxs)}.co-audio-player__dl{flex:0 0 auto;border:none;background:transparent;cursor:pointer;padding:2px;color:var(--co-semantic-text-muted);display:inline-flex}.co-audio-player__dl:hover{color:var(--co-semantic-text-default)}.co-audio-player__dl:focus-visible{outline:2px solid var(--co-semantic-border-focus);outline-offset:2px}.co-audio-player--error .co-audio-player__wave{opacity:.5}.co-audio-player--error .co-audio-player__play{background:var(--co-color-status-error);color:var(--co-semantic-text-inverse);opacity:1}@media (prefers-reduced-motion: reduce){.co-audio-player__bar{transition:none}}"}},[1,"co-audio-player",{src:[1],compact:[4],bars:[2],barDensity:[2,"bar-density"],preload:[1],downloadFilename:[1,"download-filename"],noDownload:[4,"no-download"],isPlaying:[32],isLoading:[32],hasError:[32],currentTime:[32],duration:[32],peaks:[32],containerWidth:[32],playbackRate:[32]},void 0,{src:[{onSrcChange:0}]}]);function d(){"undefined"!=typeof customElements&&["co-audio-player","co-icon"].forEach((i=>{switch(i){case"co-audio-player":customElements.get(t(i))||customElements.define(t(i),h);break;case"co-icon":customElements.get(t(i))||o()}}))}d();const l=h,u=d;export{l as CoAudioPlayer,u as defineCustomElement}
|
|
1
|
+
import{t,p as i,H as a,c as e,h as s}from"./index.js";import{d as o}from"./p-BCZ-tPBT.js";function r(t){const i=Math.max(0,Math.floor(t||0));return`${Math.floor(i/60)}:${(""+i%60).padStart(2,"0")}`}function c(t,i){const a=t.length;if(!a||i<=0)return[];const e=Math.max(1,Math.floor(a/i)),s=[];for(let o=0;o<i;o++){let i=0;const r=o*e;for(let s=r;s<r+e&&s<a;s++){const a=Math.abs(t[s]);a>i&&(i=a)}s.push(.12+.88*i)}return s}function h(t){if(t<=0)return[];const i=[];for(let a=0;a<t;a++)i.push(.12+(.6*Math.sin(a/Math.max(1,t)*Math.PI)+.3)*(.75+.25*Math.abs(Math.sin(1.7*a)))*.88);return i}const n=i(class extends a{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.coPlay=e(this,"coPlay",7),this.coPause=e(this,"coPause",7),this.coEnded=e(this,"coEnded",7),this.coError=e(this,"coError",7),this.compact=!1,this.bars=64,this.barDensity=3,this.preload="metadata",this.downloadFilename="audio",this.noDownload=!1,this.isPlaying=!1,this.isLoading=!1,this.hasError=!1,this.currentTime=0,this.duration=0,this.peaks=[],this.containerWidth=0,this.playbackRate=1,this.rawChannelData=null,this.onMeta=()=>{var t;this.duration=(null===(t=this.audio)||void 0===t?void 0:t.duration)||0},this.onCanPlay=()=>{this.isLoading=!1},this.onWaiting=()=>{this.isLoading=!0},this.onTime=()=>{var t;this.currentTime=(null===(t=this.audio)||void 0===t?void 0:t.currentTime)||0},this.onEnded=()=>{this.isPlaying=!1,this.currentTime=0,this.coEnded.emit()},this.onErr=t=>{this.isLoading=!1,this.hasError=!0,this.coError.emit(t)},this.toggle=()=>{this.audio&&!this.hasError&&(this.isPlaying?(this.audio.pause(),this.isPlaying=!1,this.coPause.emit()):this.audio.play().then((()=>{this.isPlaying=!0,this.coPlay.emit()})).catch((()=>{})))},this.SPEEDS=[1,1.5,2,.5],this.cycleSpeed=()=>{const t=this.SPEEDS.indexOf(this.playbackRate);this.playbackRate=this.SPEEDS[(t+1)%this.SPEEDS.length],this.audio&&(this.audio.playbackRate=this.playbackRate)},this.seekAt=t=>{if(!this.audio||!this.waveEl||!this.duration)return;const i=function(t,i){return i.width?Math.max(0,Math.min(1,(t-i.left)/i.width)):0}(t,this.waveEl.getBoundingClientRect());this.audio.currentTime=i*this.duration,this.currentTime=this.audio.currentTime},this.onWaveKey=t=>{if(" "===t.key||"Enter"===t.key)return t.preventDefault(),void this.toggle();if(this.audio&&this.duration){if("ArrowRight"===t.key)this.audio.currentTime=Math.min(this.duration,this.audio.currentTime+5);else{if("ArrowLeft"!==t.key)return;this.audio.currentTime=Math.max(0,this.audio.currentTime-5)}this.currentTime=this.audio.currentTime}}}get effectiveBars(){return this.containerWidth>0?Math.max(24,Math.floor(this.containerWidth/this.barDensity)):this.bars}componentWillLoad(){this.init()}componentDidLoad(){if("undefined"==typeof ResizeObserver||!this.waveEl)return;this.resizeObserver=new ResizeObserver((t=>{var i;for(const a of t){const t=(null===(i=a.contentRect)||void 0===i?void 0:i.width)||a.target.clientWidth||0;t>2&&Math.abs(t-this.containerWidth)>2&&(this.containerWidth=t,this.rebuildBars())}})),this.resizeObserver.observe(this.waveEl);const t=this.waveEl.clientWidth||0;t>2&&(this.containerWidth=t,this.rebuildBars())}disconnectedCallback(){var t;this.teardown(),null===(t=this.resizeObserver)||void 0===t||t.disconnect(),this.resizeObserver=void 0}onSrcChange(){this.init()}rebuildBars(){this.peaks=this.rawChannelData?c(this.rawChannelData,this.effectiveBars):h(this.effectiveBars)}init(){if(this.teardown(),this.rawChannelData=null,this.peaks=h(this.effectiveBars),this.currentTime=0,this.duration=0,this.playbackRate=1,this.hasError=!1,!this.src)return;if(this.isLoading=!0,this.extractPeaks(this.src),"undefined"==typeof Audio)return;const t=new Audio;t.preload=this.preload,t.crossOrigin="anonymous",t.src=this.src,t.addEventListener("loadedmetadata",this.onMeta),t.addEventListener("timeupdate",this.onTime),t.addEventListener("ended",this.onEnded),t.addEventListener("error",this.onErr),t.addEventListener("canplay",this.onCanPlay),t.addEventListener("waiting",this.onWaiting),this.audio=t}teardown(){this.audio&&(this.audio.pause(),this.audio.removeEventListener("loadedmetadata",this.onMeta),this.audio.removeEventListener("timeupdate",this.onTime),this.audio.removeEventListener("ended",this.onEnded),this.audio.removeEventListener("error",this.onErr),this.audio.removeEventListener("canplay",this.onCanPlay),this.audio.removeEventListener("waiting",this.onWaiting),this.audio.src="",this.audio=void 0),this.isPlaying=!1}async extractPeaks(t){try{const i=window.AudioContext||window.webkitAudioContext;if(!i||"undefined"==typeof fetch)return;const a=new i,e=await(await fetch(t)).arrayBuffer(),s=await a.decodeAudioData(e);this.rawChannelData=s.getChannelData(0),this.peaks=c(this.rawChannelData,this.effectiveBars),a.close()}catch(t){this.rawChannelData=null,this.peaks=h(this.effectiveBars)}}async download(){if(this.src&&"undefined"!=typeof fetch)try{const t=await(await fetch(this.src)).blob(),i=URL.createObjectURL(t),a=document.createElement("a");a.href=i,a.download=this.downloadFilename,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(i)}catch(t){}}render(){const t=Math.max(1,3*this.peaks.length),i=this.duration?this.currentTime/this.duration*100:0,a=(t,i,a=!1)=>s("rect",{key:"ffe5ce97626e52c12e60b953b62d237f14acb582",x:3*i,y:20-40*t/2,width:1.8,height:Math.max(40*t,2),rx:.6,class:{"co-audio-player__bar":!0,"co-audio-player__bar--played":a}});return s("div",{key:"012710aded6ca183e80d7fde087cb0fdf413249b",class:{"co-audio-player":!0,"co-audio-player--compact":this.compact,"co-audio-player--error":this.hasError,"co-audio-player--playing":this.isPlaying},part:"player"},s("button",{key:"2505b88e97e73fd39aa31e3dad5e7fe0c1b94c80",type:"button",class:"co-audio-player__play",part:"play","aria-label":this.hasError?"Audio no disponible":this.isPlaying?"Pausar":"Reproducir","aria-busy":this.isLoading?"true":"false",disabled:this.hasError||!this.src,onClick:this.toggle},s("co-icon",{key:"e0e0d2dd5f6e0578ba80a3c235e5c221a6e8fe21",name:this.hasError?"warning-circle":this.isPlaying?"pause":"play",weight:"fill",size:this.compact?12:14})),s("div",{key:"d2b32119c69c64d2f68d469fe4ae056780446322",class:"co-audio-player__wave",part:"wave",role:"slider",tabindex:"0","aria-label":"Progreso de reproducción","aria-valuemin":0,"aria-valuemax":Math.floor(this.duration),"aria-valuenow":Math.floor(this.currentTime),ref:t=>this.waveEl=t,onClick:t=>this.seekAt(t.clientX),onKeyDown:this.onWaveKey},s("svg",{key:"fb9643df152d2d0b119580954f639cb3a9c2cd66",class:"co-audio-player__svg",viewBox:`0 0 ${t} 40`,preserveAspectRatio:"none","aria-hidden":"true"},this.peaks.map(((t,i)=>a(t,i))),s("clipPath",{key:"c2901cfe7c7e910bd53c8c92894b2d2395cde270",id:"co-ap-clip"},s("rect",{key:"8129a85201e09ba6646b08ed0075798b0a0b0dfc",x:"0",y:"0",width:i/100*t,height:40})),s("g",{key:"69bc1780122d48f1a545d1c59bf7ed6536285ed2","clip-path":"url(#co-ap-clip)"},this.peaks.map(((t,i)=>a(t,i,!0)))))),s("span",{key:"3747622619bd81545f85e7eb2f9c19b1aca6e7c2",class:"co-audio-player__time",part:"time"},r(this.currentTime)," / ",r(this.duration)),!this.compact&&s("button",{key:"84341856fb2e0b6a094c673a727370b148190e30",type:"button",class:"co-audio-player__speed",part:"speed","aria-label":`Velocidad de reproducción ${this.playbackRate}x`,onClick:this.cycleSpeed},this.playbackRate,"x"),!this.compact&&!this.noDownload&&s("button",{key:"d6767d185317f20299b40c4050a806d88165682f",type:"button",class:"co-audio-player__dl",part:"download","aria-label":"Descargar",onClick:()=>this.download()},s("co-icon",{key:"a0f0a09cdf705ecf15e0156cf93011f89f41ffa5",name:"download-simple",size:14})))}static get watchers(){return{src:[{onSrcChange:0}]}}static get style(){return":host{display:block;font-family:var(--co-font-family-primary)}.co-audio-player{display:flex;align-items:center;gap:var(--co-spacing-md);padding:var(--co-spacing-sm) var(--co-spacing-md);border:1px solid var(--co-semantic-border-default);border-radius:var(--co-border-radius-xs);background:var(--co-semantic-surface-secondary);min-width:180px}.co-audio-player--compact{gap:var(--co-spacing-sm2);padding:var(--co-spacing-sm2) var(--co-spacing-sm);min-width:140px}.co-audio-player__play{flex:0 0 auto;width:28px;height:28px;border:none;border-radius:50%;cursor:pointer;background:var(--co-semantic-surface-primary);color:var(--co-semantic-text-inverse);display:inline-flex;align-items:center;justify-content:center}.co-audio-player--compact .co-audio-player__play{width:24px;height:24px}.co-audio-player__play:disabled{opacity:.5;cursor:not-allowed}.co-audio-player__play:focus-visible{outline:2px solid var(--co-semantic-border-focus);outline-offset:2px}.co-audio-player__wave{flex:1;height:40px;min-width:0;cursor:pointer;display:flex;align-items:center}.co-audio-player__wave:focus-visible{outline:2px solid var(--co-semantic-border-focus);outline-offset:2px;border-radius:var(--co-border-radius-xxs)}.co-audio-player__svg{width:100%;height:100%;display:block}.co-audio-player__bar{fill:var(--co-semantic-border-field);transition:fill var(--co-motion-duration-fast)}.co-audio-player__wave:hover .co-audio-player__bar{fill:var(--co-semantic-text-muted)}.co-audio-player__bar--played{fill:var(--co-semantic-surface-primary)}.co-audio-player__time{flex:0 0 auto;font-size:var(--co-font-size-12);color:var(--co-semantic-text-muted);font-variant-numeric:tabular-nums;min-width:62px;text-align:right}.co-audio-player__speed{flex:0 0 auto;border:none;background:transparent;cursor:pointer;padding:2px 4px;color:var(--co-semantic-text-muted);font-family:var(--co-font-family-primary);font-size:var(--co-font-size-12);font-variant-numeric:tabular-nums;min-width:34px;text-align:center}.co-audio-player__speed:hover{color:var(--co-semantic-text-default)}.co-audio-player__speed:focus-visible{outline:2px solid var(--co-semantic-border-focus);outline-offset:2px;border-radius:var(--co-border-radius-xxs)}.co-audio-player__dl{flex:0 0 auto;border:none;background:transparent;cursor:pointer;padding:2px;color:var(--co-semantic-text-muted);display:inline-flex}.co-audio-player__dl:hover{color:var(--co-semantic-text-default)}.co-audio-player__dl:focus-visible{outline:2px solid var(--co-semantic-border-focus);outline-offset:2px}.co-audio-player--error .co-audio-player__wave{opacity:.5}.co-audio-player--error .co-audio-player__play{background:var(--co-color-status-error);color:var(--co-semantic-text-inverse);opacity:1}"}},[1,"co-audio-player",{src:[1],compact:[4],bars:[2],barDensity:[2,"bar-density"],preload:[1],downloadFilename:[1,"download-filename"],noDownload:[4,"no-download"],isPlaying:[32],isLoading:[32],hasError:[32],currentTime:[32],duration:[32],peaks:[32],containerWidth:[32],playbackRate:[32]},void 0,{src:[{onSrcChange:0}]}]);function d(){"undefined"!=typeof customElements&&["co-audio-player","co-icon"].forEach((i=>{switch(i){case"co-audio-player":customElements.get(t(i))||customElements.define(t(i),n);break;case"co-icon":customElements.get(t(i))||o()}}))}d();const l=n,u=d;export{l as CoAudioPlayer,u as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e,p as t,H as o,c,h as a}from"./index.js";import{R as s}from"./p-CWneqh4n.js";import{d as i}from"./p-uZ2D6ESV.js";import{d as r}from"./p-CfeNhAHW.js";import{d as l}from"./p-DbISGXT_.js";import{d as n}from"./p-DzoNGEDU.js";import{d as p}from"./p-D0wrmRH8.js";import{d as h}from"./p-cteJszd-.js";const d=t(class extends o{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.coSearch=c(this,"coSearch",7),this.coChange=c(this,"coChange",7),this.coClear=c(this,"coClear",7),this.required=!1,this.placeholder="Search…",this.disabled=!1,this.clearable=!0,this.layout="vertical",this.size="md",this.status="default",this.options="[]",this.value="",this.multiple=!1,this.loading=!1,this.minChars=1,this.searchDebounce=300,this.emptyMessage="No results",this.isOpen=!1,this.query="",this.focused=!1,this.handleInput=e=>{const t=e.target.value;this.query=t,this.debounceTimer&&clearTimeout(this.debounceTimer),t.length>=this.minChars?(this.debounceTimer=setTimeout((()=>this.coSearch.emit(t)),this.searchDebounce),this.isOpen=!0):this.isOpen=!1},this.handleFocus=()=>{this.focused=!0,this.query.length>=this.minChars&&this.parsedOptions.length>0&&(this.isOpen=!0)},this.handleClear=e=>{var t;e.stopPropagation(),this.query="",this.value=this.multiple?"[]":"",this.isOpen=!1,this.coClear.emit(),this.coChange.emit({value:this.multiple?[]:"",item:null}),null===(t=this.inputEl)||void 0===t||t.focus()},this.handleChipRemove=e=>{const t=this.selectedValues.filter((t=>t!==e));this.value=JSON.stringify(t),this.coChange.emit({value:t,item:{_id:e,label:e}})},this.handleListChange=e=>{this.multiple?(this.value=JSON.stringify(e.value),this.coChange.emit({value:e.value,item:e.item})):(this.value=e.value,this.query=e.item.label,this.isOpen=!1,this.coChange.emit({value:e.value,item:e.item}))},this.handleInputKeyDown=async e=>{"Escape"!==e.key?this.isOpen&&this.optionListEl&&("ArrowDown"!==e.key&&"ArrowUp"!==e.key&&"Enter"!==e.key||(e.preventDefault(),await this.optionListEl.handleKey(e))):this.isOpen=!1}}get parsedOptions(){let e=this.options;if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return[]}return Array.isArray(e)?e.map((e=>"string"==typeof e?{label:e,value:e}:e)):[]}get selectedValues(){if(this.multiple){if("string"==typeof this.value)try{return JSON.parse(this.value)}catch(e){return this.value?[this.value]:[]}return this.value}return"string"==typeof this.value&&this.value?[this.value]:[]}get hasValue(){return this.selectedValues.length>0}get statusIcon(){return{error:"warning-circle",success:"check-circle",warning:"warning",info:"info"}[this.status]||null}componentWillLoad(){this.syncQueryFromValue()}onOptionsChange(){this.query.length>=this.minChars&&(this.isOpen=!0),this.focused||this.syncQueryFromValue()}onValueChange(){this.syncQueryFromValue()}syncQueryFromValue(){if(!this.multiple&&"string"==typeof this.value&&this.value){const e=this.parsedOptions.find((e=>e.value===this.value));this.query=e?e.label:this.value}else this.multiple||this.value||(this.query="")}handleDocumentClick(e){this.el.contains(e.target)||(this.isOpen=!1,this.focused=!1)}render(){const e=this.parsedOptions,t=this.selectedValues;return a("div",{key:"a152ee025b4c76813f8783ba1cd0e6791a7372ee",class:{"co-autocomplete":!0,"co-autocomplete--disabled":this.disabled,"co-autocomplete--focused":this.focused,["co-autocomplete--"+this.size]:!0,["co-autocomplete--"+this.status]:"default"!==this.status}},(this.label||this.secondaryLabel)&&a("div",{key:"484443890da0c01c028716095ef2215f56b64e93",class:"co-autocomplete__labels"},this.label&&a("label",{key:"24fc760c0fa0322e1952d948e8daf463a4999226",class:"co-autocomplete__label"},this.label,a(s,{key:"250f449b8d860d5476652dd906b5405e76cba1d1",required:this.required})),this.secondaryLabel&&a("span",{key:"5f7b6c3b0308cc031336d945ce629aa06495404d",class:"co-autocomplete__secondary-label"},this.secondaryLabel)),a("div",{key:"632abdc8eb131cf8f5c482487d377d9297c11ad6",class:"co-autocomplete__field"},this.iconLeft&&a("co-icon",{key:"7c1f1af01c2a9b9686de933a38d4da0302f40cbc",name:this.iconLeft,size:16,class:"co-autocomplete__icon"}),this.multiple&&t.length>0&&a("div",{key:"bfe9c9fbce1c7050f928128fb77f8bf5018903d1",class:"co-autocomplete__chips"},t.map((e=>{const t=this.parsedOptions.find((t=>t.value===e));return a("co-chip",{label:t?t.label:e,size:"small",removable:!0,onCoRemove:()=>this.handleChipRemove(e)})}))),a("input",{key:"fc621839dde68853a1b28231551e6cb0a6f415e7",ref:e=>this.inputEl=e,class:"co-autocomplete__input",type:"text",value:this.query,placeholder:this.placeholder,disabled:this.disabled,onInput:this.handleInput,onFocus:this.handleFocus,onKeyDown:this.handleInputKeyDown}),this.loading&&a("div",{key:"fbe41e89ca6202a4de04a09437f1f11f756f25eb",class:"co-autocomplete__spinner"}),this.clearable&&(this.hasValue||this.query)&&!this.disabled&&a("button",{key:"e3096cd897d7a98fa7cd203d21eb57dc6ce961a5",class:"co-autocomplete__clear",type:"button",tabIndex:-1,onClick:this.handleClear,"aria-label":"Clear"},a("co-icon",{key:"3211cf54fcdae0a73afb62e2b6cb25081486f3a7",name:"x-circle",size:16,weight:"fill"}))),this.isOpen&&a("div",{key:"9c5e500a17c9486b6834c46be9e95c0e0fea6beb",class:"co-autocomplete__dropdown"},a("co-option-list",{key:"b44c39253a07c470dc5e059223fce58548e8d02d",ref:e=>this.optionListEl=e,items:JSON.stringify(e.map((e=>({_id:e.value,label:e.label,icon:e.icon,disabled:e.disabled})))),value:this.multiple?JSON.stringify(this.selectedValues):this.selectedValues[0]||"",multiple:this.multiple,selectedAffordance:"check",virtual:!0,loading:this.loading,emptyMessage:this.emptyMessage,onCoChange:e=>this.handleListChange(e.detail)})),this.helperText&&a("div",{key:"30ac040bfef45e66d1b18bfdda9b5b07b8f2c3d5",class:"co-autocomplete__helper co-autocomplete__helper--"+this.status},this.statusIcon&&a("co-icon",{key:"a4fc8c4c9695c13cd515d9b7562986a62bf07110",name:this.statusIcon,size:14,weight:"fill",class:"co-autocomplete__helper-icon"}),a("span",{key:"4a7f3031b62c451e0561024d232331b1c7679a07",class:"co-autocomplete__helper-text"},this.helperText)))}get el(){return this}static get watchers(){return{options:[{onOptionsChange:0}],value:[{onValueChange:0}]}}static get style(){return":host{display:block;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);letter-spacing:var(--co-font-letter-spacing-body);line-height:1;position:relative}.co-autocomplete{display:flex;flex-direction:column;gap:var(--co-spacing-sm2);position:relative}.co-autocomplete__labels{display:flex;align-items:center;justify-content:space-between;padding:0 var(--co-spacing-xs);gap:var(--co-spacing-sm2)}.co-autocomplete__label{color:var(--co-semantic-text-secondary);font-size:var(--co-font-size-14);font-weight:400;line-height:1;white-space:nowrap;cursor:default}.co-autocomplete__secondary-label{color:var(--co-semantic-text-muted);font-size:var(--co-font-size-14);font-weight:400;line-height:1;white-space:nowrap;text-align:right}.co-autocomplete--disabled .co-autocomplete__label,.co-autocomplete--disabled .co-autocomplete__secondary-label{color:var(--co-semantic-text-disabled)}.co-autocomplete__field{display:flex;align-items:center;flex-wrap:wrap;gap:var(--co-spacing-xs);padding:var(--co-spacing-sm2) var(--co-spacing-md);background:var(--co-semantic-surface-page);border:1px solid var(--co-semantic-border-field);border-radius:var(--co-border-radius-xs);min-height:40px;box-sizing:border-box;transition:border-color 0.15s ease, box-shadow 0.15s ease}.co-autocomplete--s .co-autocomplete__field{min-height:28px;padding:var(--co-spacing-xxs) var(--co-spacing-sm);font-size:var(--co-font-size-12)}.co-autocomplete--sm .co-autocomplete__field{min-height:32px;padding:var(--co-spacing-xs) var(--co-spacing-sm);font-size:var(--co-font-size-14)}.co-autocomplete--lg .co-autocomplete__field{min-height:48px;padding:var(--co-spacing-sm) var(--co-spacing-lg);font-size:var(--co-font-size-16)}.co-autocomplete--focused .co-autocomplete__field{border-color:var(--co-semantic-border-focus);box-shadow:0 0 0 2px var(--co-semantic-border-focus-ring)}.co-autocomplete--disabled .co-autocomplete__field{background:var(--co-semantic-surface-disabled);border-color:transparent;cursor:not-allowed}.co-autocomplete--error .co-autocomplete__field{border-color:var(--co-semantic-status-error)}.co-autocomplete--success .co-autocomplete__field{border-color:var(--co-semantic-status-success)}.co-autocomplete--warning .co-autocomplete__field{border-color:var(--co-color-status-review)}.co-autocomplete--info .co-autocomplete__field{border-color:var(--co-semantic-status-info)}.co-autocomplete__icon{flex-shrink:0;color:var(--co-semantic-text-muted);display:flex;align-items:center}.co-autocomplete__chips{display:flex;flex-wrap:wrap;gap:var(--co-spacing-xs)}.co-autocomplete__input{flex:1;min-width:80px;border:none;background:transparent;color:var(--co-semantic-text-default);font-family:inherit;font-size:inherit;font-weight:400;line-height:1;padding:0;outline:none}.co-autocomplete__input::placeholder{color:var(--co-semantic-text-muted)}.co-autocomplete--disabled .co-autocomplete__input{color:var(--co-semantic-text-disabled);cursor:not-allowed}.co-autocomplete__clear{flex-shrink:0;display:flex;align-items:center;padding:0;margin:0;border:none;background:transparent;cursor:pointer;color:var(--co-semantic-text-muted);transition:color 0.15s ease}.co-autocomplete__clear:hover{color:var(--co-semantic-text-default)}.co-autocomplete__spinner{width:16px;height:16px;border:2px solid var(--co-semantic-border-subtle);border-top-color:var(--co-semantic-text-default);border-radius:var(--co-border-radius-full);animation:co-spin 0.6s linear infinite;flex-shrink:0}@keyframes co-spin{to{transform:rotate(360deg)}}.co-autocomplete__dropdown{position:absolute;top:100%;left:0;right:0;z-index:100;margin-top:var(--co-spacing-xs);background:var(--co-semantic-surface-secondary);border:1px solid var(--co-semantic-border-subtle);border-radius:var(--co-border-radius-sm, 12px);box-shadow:0 4px 16px rgba(31, 28, 27, 0.08);overflow:hidden;padding:var(--co-spacing-sm2)}.co-autocomplete__helper{display:flex;align-items:center;gap:var(--co-spacing-xs);padding:0 var(--co-spacing-xs)}.co-autocomplete__helper-icon{flex-shrink:0;display:flex;align-items:center}.co-autocomplete__helper-text{color:var(--co-semantic-text-muted);font-size:var(--co-font-size-14);font-weight:400;line-height:1}.co-autocomplete__helper--error .co-autocomplete__helper-icon,.co-autocomplete__helper--error .co-autocomplete__helper-text{color:var(--co-semantic-status-error)}.co-autocomplete__helper--success .co-autocomplete__helper-icon,.co-autocomplete__helper--success .co-autocomplete__helper-text{color:var(--co-semantic-status-success)}.co-autocomplete__helper--warning .co-autocomplete__helper-icon,.co-autocomplete__helper--warning .co-autocomplete__helper-text{color:var(--co-color-status-review)}.co-autocomplete__helper--info .co-autocomplete__helper-icon,.co-autocomplete__helper--info .co-autocomplete__helper-text{color:var(--co-semantic-status-info)}:host([layout='horizontal']) .co-autocomplete{display:grid;grid-template-columns:var(--co-field-label-width, max-content) 1fr;align-items:start;column-gap:var(--co-spacing-md);row-gap:var(--co-spacing-sm2)}:host([layout='horizontal']) .co-autocomplete__labels{grid-column:1;grid-row:1;padding-top:var(--co-spacing-sm2);min-width:0}:host([layout='horizontal']) .co-autocomplete__label{white-space:normal}:host([layout='horizontal']) .co-autocomplete>:not(.co-autocomplete__labels){grid-column:2;min-width:0}.co-field-required{margin-left:2px;color:var(--co-color-status-error)}.co-field-required__caption{margin-left:4px;color:var(--co-semantic-text-muted);font-size:var(--co-font-size-12);font-weight:400}.co-field-required__caption::before{content:var(--co-field-required-text, ' (required)')}"}},[1,"co-autocomplete",{label:[1],required:[4],secondaryLabel:[1,"secondary-label"],placeholder:[1],disabled:[4],iconLeft:[1,"icon-left"],clearable:[4],helperText:[1,"helper-text"],layout:[513],size:[513],status:[1],options:[1],value:[1025],multiple:[4],loading:[4],minChars:[2,"min-chars"],searchDebounce:[2,"search-debounce"],emptyMessage:[1,"empty-message"],isOpen:[32],query:[32],focused:[32]},[[4,"click","handleDocumentClick"]],{options:[{onOptionsChange:0}],value:[{onValueChange:0}]}]);function u(){"undefined"!=typeof customElements&&["co-autocomplete","co-avatar","co-chip","co-icon","co-loader","co-option-list","co-tooltip"].forEach((t=>{switch(t){case"co-autocomplete":customElements.get(e(t))||customElements.define(e(t),d);break;case"co-avatar":customElements.get(e(t))||i();break;case"co-chip":customElements.get(e(t))||r();break;case"co-icon":customElements.get(e(t))||l();break;case"co-loader":customElements.get(e(t))||n();break;case"co-option-list":customElements.get(e(t))||p();break;case"co-tooltip":customElements.get(e(t))||h()}}))}u();const m=d,f=u;export{m as CoAutocomplete,f as defineCustomElement}
|
|
1
|
+
import{t as e,p as t,H as o,c,h as a}from"./index.js";import{R as i}from"./p-CWneqh4n.js";import{d as s}from"./p-aiNhl9Xd.js";import{d as r}from"./p-DEYpoVxc.js";import{d as l}from"./p-BCZ-tPBT.js";import{d as n}from"./p-DzoNGEDU.js";import{d as p}from"./p-CnBjUP_M.js";import{d as h}from"./p-BYnSPxpp.js";const d=t(class extends o{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.coSearch=c(this,"coSearch",7),this.coChange=c(this,"coChange",7),this.coClear=c(this,"coClear",7),this.required=!1,this.placeholder="Search…",this.disabled=!1,this.clearable=!0,this.layout="vertical",this.size="md",this.status="default",this.options="[]",this.value="",this.multiple=!1,this.loading=!1,this.minChars=1,this.searchDebounce=300,this.emptyMessage="No results",this.isOpen=!1,this.query="",this.focused=!1,this.handleInput=e=>{const t=e.target.value;this.query=t,this.debounceTimer&&clearTimeout(this.debounceTimer),t.length>=this.minChars?(this.debounceTimer=setTimeout((()=>this.coSearch.emit(t)),this.searchDebounce),this.isOpen=!0):this.isOpen=!1},this.handleFocus=()=>{this.focused=!0,this.query.length>=this.minChars&&this.parsedOptions.length>0&&(this.isOpen=!0)},this.handleClear=e=>{var t;e.stopPropagation(),this.query="",this.value=this.multiple?"[]":"",this.isOpen=!1,this.coClear.emit(),this.coChange.emit({value:this.multiple?[]:"",item:null}),null===(t=this.inputEl)||void 0===t||t.focus()},this.handleChipRemove=e=>{const t=this.selectedValues.filter((t=>t!==e));this.value=JSON.stringify(t),this.coChange.emit({value:t,item:{_id:e,label:e}})},this.handleListChange=e=>{if(null==e.value)return this.value=this.multiple?"[]":"",this.query="",this.isOpen=!1,void this.coChange.emit({value:null,item:null});this.multiple?(this.value=JSON.stringify(e.value),this.coChange.emit({value:e.value,item:e.item})):(this.value=e.value,this.query=e.item.label,this.isOpen=!1,this.coChange.emit({value:e.value,item:e.item}))},this.handleInputKeyDown=async e=>{"Escape"!==e.key?this.isOpen&&this.optionListEl&&("ArrowDown"!==e.key&&"ArrowUp"!==e.key&&"Enter"!==e.key||(e.preventDefault(),await this.optionListEl.handleKey(e))):this.isOpen=!1}}get parsedOptions(){let e=this.options;if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return[]}return Array.isArray(e)?e.map((e=>"string"==typeof e?{label:e,value:e}:e)):[]}get selectedValues(){if(this.multiple){if("string"==typeof this.value)try{return JSON.parse(this.value)}catch(e){return this.value?[this.value]:[]}return this.value}return"string"==typeof this.value&&this.value?[this.value]:[]}get hasValue(){return this.selectedValues.length>0}get statusIcon(){return{error:"warning-circle",success:"check-circle",warning:"warning",info:"info"}[this.status]||null}componentWillLoad(){this.syncQueryFromValue()}onOptionsChange(){this.query.length>=this.minChars&&(this.isOpen=!0),this.focused||this.syncQueryFromValue()}onValueChange(){this.syncQueryFromValue()}syncQueryFromValue(){if(!this.multiple&&"string"==typeof this.value&&this.value){const e=this.parsedOptions.find((e=>e.value===this.value));this.query=e?e.label:this.value}else this.multiple||this.value||(this.query="")}handleDocumentClick(e){this.el.contains(e.target)||(this.isOpen=!1,this.focused=!1)}render(){const e=this.parsedOptions,t=this.selectedValues;return a("div",{key:"0fad340e2daa5ee4b56e28325d5eaec4d60d7188",class:{"co-autocomplete":!0,"co-autocomplete--disabled":this.disabled,"co-autocomplete--focused":this.focused,["co-autocomplete--"+this.size]:!0,["co-autocomplete--"+this.status]:"default"!==this.status}},(this.label||this.secondaryLabel)&&a("div",{key:"a724b6267fd6dbe267725f3619677e043843c96c",class:"co-autocomplete__labels"},this.label&&a("label",{key:"45c176c82f0967c6ff0f1f323d36834d247f8ac6",class:"co-autocomplete__label"},this.label,a(i,{key:"52940ac88fa7ba5f2b662990a66b0ad84d728ecc",required:this.required})),this.secondaryLabel&&a("span",{key:"5eac2ccf44d59067f7ca070561c18c9b45b4cfc1",class:"co-autocomplete__secondary-label"},this.secondaryLabel)),a("div",{key:"4837e011ac491a34efdfb84bd80f2baa52c4f451",class:"co-autocomplete__field"},this.iconLeft&&a("co-icon",{key:"1a46dba433dec3b8dec82b6d2e93cee0575f5673",name:this.iconLeft,size:16,class:"co-autocomplete__icon"}),this.multiple&&t.length>0&&a("div",{key:"95054c8e5ec371ba04f6fa5938d74babffef473f",class:"co-autocomplete__chips"},t.map((e=>{const t=this.parsedOptions.find((t=>t.value===e));return a("co-chip",{label:t?t.label:e,size:"small",removable:!0,onCoRemove:()=>this.handleChipRemove(e)})}))),a("input",{key:"016887bf4fa1872bafd1ba60a7fb960ca89e8b76",ref:e=>this.inputEl=e,class:"co-autocomplete__input",type:"text",value:this.query,placeholder:this.placeholder,disabled:this.disabled,onInput:this.handleInput,onFocus:this.handleFocus,onKeyDown:this.handleInputKeyDown}),this.loading&&a("div",{key:"eac7e752a8d8f18b866c5fe4283707e851355328",class:"co-autocomplete__spinner"}),this.clearable&&(this.hasValue||this.query)&&!this.disabled&&a("button",{key:"aac8dcfced13e8abf3bb6beb0fa56124814804ea",class:"co-autocomplete__clear",type:"button",tabIndex:-1,onClick:this.handleClear,"aria-label":"Clear"},a("co-icon",{key:"8a5605cfe09eb17ca65c9fd97662ceec893431b7",name:"x-circle",size:16,weight:"fill"}))),this.isOpen&&a("div",{key:"7263c42e73656db3ee8d1c1c2f5f5cd941b0e40b",class:"co-autocomplete__dropdown"},a("co-option-list",{key:"32071562943c992b0013451c8b89da20590554cf",ref:e=>this.optionListEl=e,items:JSON.stringify(e.map((e=>({_id:e.value,label:e.label,icon:e.icon,disabled:e.disabled})))),value:this.multiple?JSON.stringify(this.selectedValues):this.selectedValues[0]||"",multiple:this.multiple,selectedAffordance:"check",virtual:!0,loading:this.loading,emptyMessage:this.emptyMessage,onCoChange:e=>this.handleListChange(e.detail)})),this.helperText&&a("div",{key:"47ba4956d829c700700a7509e8fd2fc58dd6e4d9",class:"co-autocomplete__helper co-autocomplete__helper--"+this.status},this.statusIcon&&a("co-icon",{key:"b4363e83a7258241d23f4911c1f6fb352330c19d",name:this.statusIcon,size:14,weight:"fill",class:"co-autocomplete__helper-icon"}),a("span",{key:"952777047bd27a6604daea9531f26ce5aab0c475",class:"co-autocomplete__helper-text"},this.helperText)))}get el(){return this}static get watchers(){return{options:[{onOptionsChange:0}],value:[{onValueChange:0}]}}static get style(){return":host{display:block;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);letter-spacing:var(--co-font-letter-spacing-body);line-height:1;position:relative}.co-autocomplete{display:flex;flex-direction:column;gap:var(--co-spacing-sm2);position:relative}.co-autocomplete__labels{display:flex;align-items:center;justify-content:space-between;padding:0 var(--co-spacing-xs);gap:var(--co-spacing-sm2)}.co-autocomplete__label{color:var(--co-semantic-text-secondary);font-size:var(--co-font-size-14);font-weight:400;line-height:1;white-space:nowrap;cursor:default}.co-autocomplete__secondary-label{color:var(--co-semantic-text-muted);font-size:var(--co-font-size-14);font-weight:400;line-height:1;white-space:nowrap;text-align:right}.co-autocomplete--disabled .co-autocomplete__label,.co-autocomplete--disabled .co-autocomplete__secondary-label{color:var(--co-semantic-text-disabled)}.co-autocomplete__field{display:flex;align-items:center;flex-wrap:wrap;gap:var(--co-spacing-xs);padding:var(--co-spacing-sm2) var(--co-spacing-md);background:var(--co-semantic-surface-page);border:1px solid var(--co-semantic-border-field);border-radius:var(--co-border-radius-xs);min-height:40px;box-sizing:border-box;transition:border-color var(--co-motion-duration-fast) var(--co-motion-ease-out), box-shadow var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-autocomplete--s .co-autocomplete__field{min-height:28px;padding:var(--co-spacing-xxs) var(--co-spacing-sm);font-size:var(--co-font-size-12)}.co-autocomplete--sm .co-autocomplete__field{min-height:32px;padding:var(--co-spacing-xs) var(--co-spacing-sm);font-size:var(--co-font-size-14)}.co-autocomplete--lg .co-autocomplete__field{min-height:48px;padding:var(--co-spacing-sm) var(--co-spacing-lg);font-size:var(--co-font-size-16)}.co-autocomplete--focused .co-autocomplete__field{border-color:var(--co-semantic-border-focus);box-shadow:0 0 0 2px var(--co-semantic-border-focus-ring)}.co-autocomplete--disabled .co-autocomplete__field{background:var(--co-semantic-surface-disabled);border-color:transparent;cursor:not-allowed}.co-autocomplete--error .co-autocomplete__field{border-color:var(--co-semantic-status-error)}.co-autocomplete--success .co-autocomplete__field{border-color:var(--co-semantic-status-success)}.co-autocomplete--warning .co-autocomplete__field{border-color:var(--co-color-status-review)}.co-autocomplete--info .co-autocomplete__field{border-color:var(--co-semantic-status-info)}.co-autocomplete__icon{flex-shrink:0;color:var(--co-semantic-text-muted);display:flex;align-items:center}.co-autocomplete__chips{display:flex;flex-wrap:wrap;gap:var(--co-spacing-xs)}.co-autocomplete__input{flex:1;min-width:80px;border:none;background:transparent;color:var(--co-semantic-text-default);font-family:inherit;font-size:inherit;font-weight:400;line-height:1;padding:0;outline:none}.co-autocomplete__input::placeholder{color:var(--co-semantic-text-muted)}.co-autocomplete--disabled .co-autocomplete__input{color:var(--co-semantic-text-disabled);cursor:not-allowed}.co-autocomplete__clear{flex-shrink:0;display:flex;align-items:center;padding:0;margin:0;border:none;background:transparent;cursor:pointer;color:var(--co-semantic-text-muted);transition:color var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-autocomplete__clear:hover{color:var(--co-semantic-text-default)}.co-autocomplete__spinner{width:16px;height:16px;border:2px solid var(--co-semantic-border-subtle);border-top-color:var(--co-semantic-text-default);border-radius:var(--co-border-radius-full);animation:co-spin 0.6s linear infinite;flex-shrink:0}@keyframes co-spin{to{transform:rotate(360deg)}}.co-autocomplete__dropdown{position:absolute;top:100%;left:0;right:0;z-index:100;margin-top:var(--co-spacing-xs);background:var(--co-semantic-surface-secondary);border:1px solid var(--co-semantic-border-subtle);border-radius:var(--co-border-radius-sm, 12px);box-shadow:0 4px 16px rgba(31, 28, 27, 0.08);overflow:hidden;}.co-autocomplete__helper{display:flex;align-items:center;gap:var(--co-spacing-xs);padding:0 var(--co-spacing-xs)}.co-autocomplete__helper-icon{flex-shrink:0;display:flex;align-items:center}.co-autocomplete__helper-text{color:var(--co-semantic-text-muted);font-size:var(--co-font-size-14);font-weight:400;line-height:1}.co-autocomplete__helper--error .co-autocomplete__helper-icon,.co-autocomplete__helper--error .co-autocomplete__helper-text{color:var(--co-semantic-status-error)}.co-autocomplete__helper--success .co-autocomplete__helper-icon,.co-autocomplete__helper--success .co-autocomplete__helper-text{color:var(--co-semantic-status-success)}.co-autocomplete__helper--warning .co-autocomplete__helper-icon,.co-autocomplete__helper--warning .co-autocomplete__helper-text{color:var(--co-color-status-review)}.co-autocomplete__helper--info .co-autocomplete__helper-icon,.co-autocomplete__helper--info .co-autocomplete__helper-text{color:var(--co-semantic-status-info)}:host([layout='horizontal']) .co-autocomplete{display:grid;grid-template-columns:var(--co-field-label-width, max-content) 1fr;align-items:start;column-gap:var(--co-spacing-md);row-gap:var(--co-spacing-sm2)}:host([layout='horizontal']) .co-autocomplete__labels{grid-column:1;grid-row:1;padding-top:var(--co-spacing-sm2);min-width:0}:host([layout='horizontal']) .co-autocomplete__label{white-space:normal}:host([layout='horizontal']) .co-autocomplete>:not(.co-autocomplete__labels){grid-column:2;min-width:0}.co-field-required{margin-left:2px;color:var(--co-color-status-error)}.co-field-required__caption{margin-left:4px;color:var(--co-semantic-text-muted);font-size:var(--co-font-size-12);font-weight:400}.co-field-required__caption::before{content:var(--co-field-required-text, ' (required)')}"}},[1,"co-autocomplete",{label:[1],required:[4],secondaryLabel:[1,"secondary-label"],placeholder:[1],disabled:[4],iconLeft:[1,"icon-left"],clearable:[4],helperText:[1,"helper-text"],layout:[513],size:[513],status:[1],options:[1],value:[1025],multiple:[4],loading:[4],minChars:[2,"min-chars"],searchDebounce:[2,"search-debounce"],emptyMessage:[1,"empty-message"],isOpen:[32],query:[32],focused:[32]},[[4,"click","handleDocumentClick"]],{options:[{onOptionsChange:0}],value:[{onValueChange:0}]}]);function u(){"undefined"!=typeof customElements&&["co-autocomplete","co-avatar","co-chip","co-icon","co-loader","co-option-list","co-tooltip"].forEach((t=>{switch(t){case"co-autocomplete":customElements.get(e(t))||customElements.define(e(t),d);break;case"co-avatar":customElements.get(e(t))||s();break;case"co-chip":customElements.get(e(t))||r();break;case"co-icon":customElements.get(e(t))||l();break;case"co-loader":customElements.get(e(t))||n();break;case"co-option-list":customElements.get(e(t))||p();break;case"co-tooltip":customElements.get(e(t))||h()}}))}u();const m=d,f=u;export{m as CoAutocomplete,f as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as a,p as
|
|
1
|
+
import{t as a,p as o,H as t,c as e,h as r}from"./index.js";import{d as i}from"./p-aiNhl9Xd.js";import{d as s}from"./p-BCZ-tPBT.js";import{d as c}from"./p-BYnSPxpp.js";const n={xl:80,lg:64,md:56,sm:48,xs:32,xxs:24},l={xl:"var(--co-font-size-26)",lg:"var(--co-font-size-22)",md:"var(--co-font-size-18)",sm:"var(--co-font-size-16)",xs:"var(--co-font-size-12)",xxs:"var(--co-font-size-10)"},v=o(class extends t{constructor(a){super(),!1!==a&&this.__registerHost(),this.__attachShadow(),this.coClick=e(this,"coClick",3),this.items=[],this.max=4,this.size="xs",this.shape="circle",this.interactive=!1,this.activate=()=>{this.coClick.emit()}}accessibleLabel(a){return this.label?this.label:a.map((a=>a.name||a.text)).filter(Boolean).join(", ")}render(){var a,o;const t=Array.isArray(this.items)?this.items:[],e=this.max>0?this.max:t.length,i=t.slice(0,e),s=Math.max(0,t.length-e),c=null!==(a=n[this.size])&&void 0!==a?a:n.xs,v=null!==(o=l[this.size])&&void 0!==o?o:l.xs,p=t.slice(e).map((a=>a.name||a.text)).filter(Boolean).join(", "),u=this.interactive?"button":"div",d=this.interactive?{type:"button","aria-label":this.accessibleLabel(t),onClick:this.activate}:{role:"group"};return r(u,Object.assign({key:"efe3aa5c3a13c33d220caf93f8ce7dfc929f9833",class:{"co-avatar-group":!0,"co-avatar-group--interactive":this.interactive}},d),i.map(((a,o)=>{var t,e,i;return r("co-avatar",{key:o,class:"co-avatar-group__avatar",type:null!==(t=a.type)&&void 0!==t?t:a.src?"image":a.icon?"icon":"text",size:this.size,shape:null!==(e=a.shape)&&void 0!==e?e:this.shape,text:a.text,src:a.src,icon:null!==(i=a.icon)&&void 0!==i?i:"user",color:a.color,"ring-color":a.ringColor,name:a.name||a.text||""})})),s>0&&r("co-tooltip",{key:"b6dffe856f5984d2e2731e84d9d4a46cfcfa0c7b",class:"co-avatar-group__slot",content:p,placement:"bottom"},r("div",{key:"b7fe90ee1800ede2bdc3b8674d6ab0dcdfa4ac48",class:"co-avatar-group__overflow",style:{width:c+"px",height:c+"px",fontSize:v},role:"img","aria-label":"+"+s},"+",s)))}static get style(){return":host{display:inline-flex}.co-avatar-group{display:inline-flex;align-items:center}.co-avatar-group--interactive{appearance:none;-webkit-appearance:none;background:none;border:0;margin:0;padding:0;font:inherit;color:inherit;cursor:pointer;border-radius:var(--co-border-radius-full);outline:none;transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-out)}.co-avatar-group--interactive:hover{opacity:0.88}.co-avatar-group--interactive:focus-visible{box-shadow:0 0 0 2px var(--co-semantic-surface-page), 0 0 0 4px var(--co-semantic-border-focus)}.co-avatar-group__slot{display:inline-flex;align-items:center;line-height:0}.co-avatar-group>*:not(:first-child){margin-left:calc(-1 * var(--co-avatar-group-overlap, var(--co-spacing-sm)))}.co-avatar-group__avatar::part(avatar),.co-avatar-group__overflow{box-shadow:0 0 0 var(--co-avatar-group-ring-width, 2px) var(--co-semantic-surface-page)}.co-avatar-group__avatar,.co-avatar-group__overflow{vertical-align:middle}.co-avatar-group__overflow{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;border-radius:var(--co-border-radius-full);background:var(--co-semantic-surface-muted);color:var(--co-semantic-text-secondary);font-family:var(--co-font-family-primary);font-weight:600;line-height:1;letter-spacing:var(--co-font-letter-spacing-body);flex-shrink:0;user-select:none;-webkit-font-smoothing:antialiased}"}},[1,"co-avatar-group",{items:[16],max:[2],size:[1],shape:[1],interactive:[4],label:[1]}]);function p(){"undefined"!=typeof customElements&&["co-avatar-group","co-avatar","co-icon","co-tooltip"].forEach((o=>{switch(o){case"co-avatar-group":customElements.get(a(o))||customElements.define(a(o),v);break;case"co-avatar":customElements.get(a(o))||i();break;case"co-icon":customElements.get(a(o))||s();break;case"co-tooltip":customElements.get(a(o))||c()}}))}p();const u=v,d=p;export{u as CoAvatarGroup,d as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as o,d as s}from"./p-
|
|
1
|
+
import{C as o,d as s}from"./p-aiNhl9Xd.js";const a=o,p=s;export{a as CoAvatar,p as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,p as e,H as o,c as s,h as i}from"./index.js";function h(t,e=48){return t<=0?0:e*(1-1/(t/e+1))}const a=e(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.coClose=s(this,"coClose",3),this.coOpen=s(this,"coOpen",3),this.coAfterOpen=s(this,"coAfterOpen",3),this.coAfterClose=s(this,"coAfterClose",3),this.open=!1,this.heading="",this.maxHeight="85dvh",this.dismissible=!0,this.closeOnOverlay=!0,this.closeOnEscape=!0,this.showHandle=!0,this.hasFooter=!1,this.hasHeaderSlot=!1,this.tracker=function(t=100,e=8){let o=[];return{add(s,i){o.push({t:s,y:i}),o.length>e&&o.shift(),o=o.filter((e=>s-e.t<=t))},velocity(){if(o.length<2)return 0;const t=o[0],e=o[o.length-1],s=e.t-t.t;return s<8?0:(e.y-t.y)/s},reset(){o=[]}}}(),this.armed=!1,this.engaged=!1,this.fromBody=!1,this.startY=0,this.startX=0,this.startScrollTop=0,this.sheetHeight=0,this.dismissPending=!1,this.pendingAfter=null,this.handleBackdropClick=()=>{this.closeOnOverlay&&this.coClose.emit()},this.handleFooterSlotChange=t=>{this.hasFooter=this.slotHasContent(t)},this.handleHeaderSlotChange=t=>{this.hasHeaderSlot=this.slotHasContent(t)},this.handleTransitionEnd=t=>{"transform"===t.propertyName&&t.target===this.sheetEl&&("open"===this.pendingAfter&&this.open&&this.coAfterOpen.emit(),"close"!==this.pendingAfter||this.open||this.coAfterClose.emit(),this.pendingAfter=null)},this.handleGripPointerDown=t=>{this.arm(t,!1)},this.handleBodyPointerDown=t=>{this.arm(t,!0)},this.handlePointerMove=t=>{if(!this.armed||!t.isPrimary)return;const e=t.clientY-this.startY,o=t.clientX-this.startX;if(!this.engaged){const s=this.fromBody?8:4;if(Math.abs(e)<s)return;if(this.fromBody){const t=!!this.bodyEl&&this.bodyEl.scrollHeight>this.bodyEl.clientHeight;if(this.startScrollTop>0||Math.abs(e)<=Math.abs(o)||e<0&&t)return void this.disarm()}this.engage(t,t.currentTarget)}const s=t.clientY-this.startY;let i;i=s>=0?this.dismissible?s:h(s):-h(-s),this.sheetEl&&(this.sheetEl.style.transform=`translate3d(0, ${i}px, 0)`),this.backdropEl&&this.sheetHeight>0&&(this.backdropEl.style.opacity=1-Math.min(Math.max(i/this.sheetHeight,0),1)+""),this.tracker.add(t.timeStamp,t.clientY)},this.handlePointerUp=t=>{if(!this.armed)return;const e=this.engaged,o=e?Math.max(t.clientY-this.startY,0):0,s=this.tracker.velocity();if(this.disarm(),!e)return;const i=function({offset:t,height:e,velocity:o,dismissible:s}){return s?o>=.5&&t>=24?"dismiss":o<=-.15?"restore":e>0&&t>=.45*e?"dismiss":"restore":"restore"}({offset:o,height:this.sheetHeight,velocity:s,dismissible:this.dismissible});"dismiss"===i?(this.dismissPending=!0,this.sheetEl&&(this.sheetEl.style.transform=`translate3d(0, ${this.sheetHeight}px, 0)`),this.backdropEl&&(this.backdropEl.style.opacity="0"),this.coClose.emit(),this.dismissFallback=setTimeout((()=>{this.open&&this.dismissPending&&(this.dismissPending=!1,this.clearInlineStyles())}),500)):this.clearInlineStyles()},this.handlePointerCancel=()=>{this.armed&&(this.disarm(),this.clearInlineStyles())},this.touchBlocker=t=>{(this.engaged||this.armed&&this.startScrollTop<=0&&t.touches[0].clientY-this.startY>0)&&t.preventDefault()}}onOpenChange(t,e){t!==e&&(this.pendingAfter=t?"open":"close",t?(this.coOpen.emit(),this.clearInlineStyles()):(this.dismissPending=!1,this.dismissFallback&&clearTimeout(this.dismissFallback),requestAnimationFrame((()=>this.clearInlineStyles()))))}handleKey(t){this.open&&this.closeOnEscape&&"Escape"===t.key&&this.coClose.emit()}disconnectedCallback(){this.detachTouchBlocker(),this.dismissFallback&&clearTimeout(this.dismissFallback)}clearInlineStyles(){this.sheetEl&&(this.sheetEl.style.transform=""),this.backdropEl&&(this.backdropEl.style.opacity="")}slotHasContent(t){return t.target.assignedNodes({flatten:!0}).some((t=>t.nodeType===Node.ELEMENT_NODE||t.nodeType===Node.TEXT_NODE&&""!==(t.textContent||"").trim()))}arm(t,e){this.open&&!this.dismissPending&&t.isPrimary&&(this.armed=!0,this.engaged=!1,this.fromBody=e,this.startY=t.clientY,this.startX=t.clientX,this.startScrollTop=e&&this.bodyEl?this.bodyEl.scrollTop:0,e&&this.attachTouchBlocker())}engage(t,e){var o,s;this.engaged=!0,this.startY=t.clientY,this.sheetHeight=(null===(o=this.sheetEl)||void 0===o?void 0:o.getBoundingClientRect().height)||0,null===(s=this.sheetEl)||void 0===s||s.classList.add("co-bottom-sheet--dragging");try{null==e||e.setPointerCapture(t.pointerId)}catch(t){}this.tracker.reset(),this.tracker.add(t.timeStamp,t.clientY)}disarm(){var t;this.armed=!1,this.engaged=!1,null===(t=this.sheetEl)||void 0===t||t.classList.remove("co-bottom-sheet--dragging"),this.detachTouchBlocker()}attachTouchBlocker(){var t;null===(t=this.bodyEl)||void 0===t||t.addEventListener("touchmove",this.touchBlocker,{passive:!1})}detachTouchBlocker(){var t;null===(t=this.bodyEl)||void 0===t||t.removeEventListener("touchmove",this.touchBlocker)}render(){return i("div",{key:"ba3db3d99801b70af3d5adc93c83868e2b2df3e2",class:{"co-bottom-sheet-root":!0,"co-bottom-sheet-root--open":this.open}},i("div",{key:"1003cdf6554d5594a3cd6ce51850cf767e76f5e2",class:"co-bottom-sheet__backdrop",part:"backdrop",onClick:this.handleBackdropClick,ref:t=>this.backdropEl=t}),i("section",{key:"8474a75c0b2bcf05e91f56274bbeef93e471b28f",class:{"co-bottom-sheet":!0,"co-bottom-sheet--open":this.open},part:"sheet",role:"dialog","aria-modal":"true","aria-labelledby":this.heading?"co-bottom-sheet-heading":void 0,style:{"--co-bottom-sheet-max-height":this.maxHeight},onTransitionEnd:this.handleTransitionEnd,ref:t=>this.sheetEl=t},i("div",{key:"a0c45bd9389353b7c28a85cf02002e417e9295cd",class:"co-bottom-sheet__grip",onPointerDown:this.handleGripPointerDown,onPointerMove:this.handlePointerMove,onPointerUp:this.handlePointerUp,onPointerCancel:this.handlePointerCancel},this.showHandle&&i("div",{key:"36251f7b8031cb20ac95b9b8f674d094a5240789",class:"co-bottom-sheet__handle",part:"handle","aria-hidden":"true"}),i("header",{key:"f6533a7ed9bf8985cf3712f6587fd129557aed75",class:{"co-bottom-sheet__header":!0,"co-bottom-sheet__header--show":this.hasHeaderSlot||!!this.heading},part:"header"},i("slot",{key:"b7061e6c4d48b1a221805962ab55153e06edecf7",name:"header",onSlotchange:this.handleHeaderSlotChange},this.heading&&i("h2",{key:"8180cb9cc8e1c234475cc02d7fdab3bc94fa7f31",class:"co-bottom-sheet__heading",id:"co-bottom-sheet-heading"},this.heading)))),i("div",{key:"e8094b7c7c0919b0cc724404b2c97c4c18b031c9",class:"co-bottom-sheet__body",part:"body",onPointerDown:this.handleBodyPointerDown,onPointerMove:this.handlePointerMove,onPointerUp:this.handlePointerUp,onPointerCancel:this.handlePointerCancel,ref:t=>this.bodyEl=t},i("slot",{key:"0b9271b2ad92c1a8f7bcfde66955ceb026b0fffd"})),i("footer",{key:"016e2c9974dc2a1c88aacfd0d5a7a6b6e10f1033",class:{"co-bottom-sheet__footer":!0,"co-bottom-sheet__footer--show":this.hasFooter},part:"footer"},i("slot",{key:"5d571808b9b49eca346b7ce30525cab841b3ff4a",name:"footer",onSlotchange:this.handleFooterSlotChange}))))}get el(){return this}static get watchers(){return{open:[{onOpenChange:0}]}}static get style(){return":host{display:contents}.co-bottom-sheet__backdrop{position:fixed;inset:0;z-index:1000;background:rgba(0, 0, 0, 0.4);-webkit-backdrop-filter:blur(var(--co-overlay-blur, 2px));backdrop-filter:blur(var(--co-overlay-blur, 2px));opacity:0;pointer-events:none;transition:opacity 0.25s ease}.co-bottom-sheet-root--open .co-bottom-sheet__backdrop{opacity:1;pointer-events:auto;transition:opacity 0.12s ease}.co-bottom-sheet{position:fixed;left:0;right:0;bottom:0;z-index:1001;display:flex;flex-direction:column;height:auto;max-height:var(--co-bottom-sheet-max-height, 85dvh);background:var(--co-semantic-surface-page);font-family:var(--co-font-family-primary);border-radius:var(--co-border-radius-xl) var(--co-border-radius-xl) 0 0;box-shadow:0 -4px 24px rgba(0, 0, 0, 0.12);transform:translateY(100%);transition:transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);will-change:transform;overflow:hidden;visibility:hidden}.co-bottom-sheet--open{transform:translateY(0);visibility:visible}.co-bottom-sheet:not(.co-bottom-sheet--open){transition:transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.25s}.co-bottom-sheet--dragging,.co-bottom-sheet-root:has(.co-bottom-sheet--dragging) .co-bottom-sheet__backdrop{transition:none !important}.co-bottom-sheet__grip{flex-shrink:0;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent;cursor:grab}.co-bottom-sheet--dragging .co-bottom-sheet__grip{cursor:grabbing}.co-bottom-sheet__handle{width:40px;height:4px;margin:var(--co-spacing-sm) auto var(--co-spacing-xs);border-radius:var(--co-border-radius-full);background:var(--co-semantic-border-default)}.co-bottom-sheet__header{padding:0 var(--co-spacing-xl)}.co-bottom-sheet__header--show{padding-bottom:var(--co-spacing-sm)}.co-bottom-sheet__heading{margin:0;font-size:var(--co-font-size-16);font-weight:700;color:var(--co-semantic-text-default)}.co-bottom-sheet__body{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior-y:contain;touch-action:pan-y}.co-bottom-sheet__footer{flex-shrink:0;display:none}.co-bottom-sheet__footer--show{display:block;border-top:1px solid var(--co-semantic-border-default);padding:var(--co-spacing-md) var(--co-spacing-xl) calc(var(--co-spacing-lg) + env(safe-area-inset-bottom, 0px));background:var(--co-semantic-surface-page)}@media (prefers-reduced-motion: reduce){.co-bottom-sheet,.co-bottom-sheet:not(.co-bottom-sheet--open),.co-bottom-sheet__backdrop{transition-duration:0.01s !important}}"}},[257,"co-bottom-sheet",{open:[1540],heading:[513],maxHeight:[513,"max-height"],dismissible:[4],closeOnOverlay:[4,"close-on-overlay"],closeOnEscape:[4,"close-on-escape"],showHandle:[516,"show-handle"],hasFooter:[32],hasHeaderSlot:[32]},[[4,"keydown","handleKey"]],{open:[{onOpenChange:0}]}]);function r(){"undefined"!=typeof customElements&&["co-bottom-sheet"].forEach((e=>{"co-bottom-sheet"===e&&(customElements.get(t(e))||customElements.define(t(e),a))}))}r();const c=a,n=r;export{c as CoBottomSheet,n as defineCustomElement}
|
|
1
|
+
import{t,p as o,H as e,c as s,h as i}from"./index.js";function h(t,o=48){return t<=0?0:o*(1-1/(t/o+1))}const a=o(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.coClose=s(this,"coClose",3),this.coOpen=s(this,"coOpen",3),this.coAfterOpen=s(this,"coAfterOpen",3),this.coAfterClose=s(this,"coAfterClose",3),this.open=!1,this.heading="",this.maxHeight="85dvh",this.dismissible=!0,this.closeOnOverlay=!0,this.closeOnEscape=!0,this.showHandle=!0,this.hasFooter=!1,this.hasHeaderSlot=!1,this.tracker=function(t=100,o=8){let e=[];return{add(s,i){e.push({t:s,y:i}),e.length>o&&e.shift(),e=e.filter((o=>s-o.t<=t))},velocity(){if(e.length<2)return 0;const t=e[0],o=e[e.length-1],s=o.t-t.t;return s<8?0:(o.y-t.y)/s},reset(){e=[]}}}(),this.armed=!1,this.engaged=!1,this.fromBody=!1,this.startY=0,this.startX=0,this.startScrollTop=0,this.sheetHeight=0,this.dismissPending=!1,this.pendingAfter=null,this.handleBackdropClick=()=>{this.closeOnOverlay&&this.coClose.emit()},this.handleFooterSlotChange=t=>{this.hasFooter=this.slotHasContent(t)},this.handleHeaderSlotChange=t=>{this.hasHeaderSlot=this.slotHasContent(t)},this.handleTransitionEnd=t=>{"transform"===t.propertyName&&t.target===this.sheetEl&&("open"===this.pendingAfter&&this.open&&this.coAfterOpen.emit(),"close"!==this.pendingAfter||this.open||this.coAfterClose.emit(),this.pendingAfter=null)},this.handleGripPointerDown=t=>{this.arm(t,!1)},this.handleBodyPointerDown=t=>{this.arm(t,!0)},this.handlePointerMove=t=>{if(!this.armed||!t.isPrimary)return;const o=t.clientY-this.startY,e=t.clientX-this.startX;if(!this.engaged){const s=this.fromBody?8:4;if(Math.abs(o)<s)return;if(this.fromBody){const t=!!this.bodyEl&&this.bodyEl.scrollHeight>this.bodyEl.clientHeight;if(this.startScrollTop>0||Math.abs(o)<=Math.abs(e)||o<0&&t)return void this.disarm()}this.engage(t,t.currentTarget)}const s=t.clientY-this.startY;let i;i=s>=0?this.dismissible?s:h(s):-h(-s),this.sheetEl&&(this.sheetEl.style.transform=`translate3d(0, ${i}px, 0)`),this.backdropEl&&this.sheetHeight>0&&(this.backdropEl.style.opacity=1-Math.min(Math.max(i/this.sheetHeight,0),1)+""),this.tracker.add(t.timeStamp,t.clientY)},this.handlePointerUp=t=>{if(!this.armed)return;const o=this.engaged,e=o?Math.max(t.clientY-this.startY,0):0,s=this.tracker.velocity();if(this.disarm(),!o)return;const i=function({offset:t,height:o,velocity:e,dismissible:s}){return s?e>=.5&&t>=24?"dismiss":e<=-.15?"restore":o>0&&t>=.45*o?"dismiss":"restore":"restore"}({offset:e,height:this.sheetHeight,velocity:s,dismissible:this.dismissible});"dismiss"===i?(this.dismissPending=!0,this.sheetEl&&(this.sheetEl.style.transform=`translate3d(0, ${this.sheetHeight}px, 0)`),this.backdropEl&&(this.backdropEl.style.opacity="0"),this.coClose.emit(),this.dismissFallback=setTimeout((()=>{this.open&&this.dismissPending&&(this.dismissPending=!1,this.clearInlineStyles())}),500)):this.clearInlineStyles()},this.handlePointerCancel=()=>{this.armed&&(this.disarm(),this.clearInlineStyles())},this.touchBlocker=t=>{(this.engaged||this.armed&&this.startScrollTop<=0&&t.touches[0].clientY-this.startY>0)&&t.preventDefault()}}onOpenChange(t,o){t!==o&&(this.pendingAfter=t?"open":"close",t?(this.coOpen.emit(),this.clearInlineStyles()):(this.dismissPending=!1,this.dismissFallback&&clearTimeout(this.dismissFallback),requestAnimationFrame((()=>this.clearInlineStyles()))))}handleKey(t){this.open&&this.closeOnEscape&&"Escape"===t.key&&this.coClose.emit()}disconnectedCallback(){this.detachTouchBlocker(),this.dismissFallback&&clearTimeout(this.dismissFallback)}clearInlineStyles(){this.sheetEl&&(this.sheetEl.style.transform=""),this.backdropEl&&(this.backdropEl.style.opacity="")}slotHasContent(t){return t.target.assignedNodes({flatten:!0}).some((t=>t.nodeType===Node.ELEMENT_NODE||t.nodeType===Node.TEXT_NODE&&""!==(t.textContent||"").trim()))}arm(t,o){this.open&&!this.dismissPending&&t.isPrimary&&(this.armed=!0,this.engaged=!1,this.fromBody=o,this.startY=t.clientY,this.startX=t.clientX,this.startScrollTop=o&&this.bodyEl?this.bodyEl.scrollTop:0,o&&this.attachTouchBlocker())}engage(t,o){var e,s;this.engaged=!0,this.startY=t.clientY,this.sheetHeight=(null===(e=this.sheetEl)||void 0===e?void 0:e.getBoundingClientRect().height)||0,null===(s=this.sheetEl)||void 0===s||s.classList.add("co-bottom-sheet--dragging");try{null==o||o.setPointerCapture(t.pointerId)}catch(t){}this.tracker.reset(),this.tracker.add(t.timeStamp,t.clientY)}disarm(){var t;this.armed=!1,this.engaged=!1,null===(t=this.sheetEl)||void 0===t||t.classList.remove("co-bottom-sheet--dragging"),this.detachTouchBlocker()}attachTouchBlocker(){var t;null===(t=this.bodyEl)||void 0===t||t.addEventListener("touchmove",this.touchBlocker,{passive:!1})}detachTouchBlocker(){var t;null===(t=this.bodyEl)||void 0===t||t.removeEventListener("touchmove",this.touchBlocker)}render(){return i("div",{key:"ba3db3d99801b70af3d5adc93c83868e2b2df3e2",class:{"co-bottom-sheet-root":!0,"co-bottom-sheet-root--open":this.open}},i("div",{key:"1003cdf6554d5594a3cd6ce51850cf767e76f5e2",class:"co-bottom-sheet__backdrop",part:"backdrop",onClick:this.handleBackdropClick,ref:t=>this.backdropEl=t}),i("section",{key:"8474a75c0b2bcf05e91f56274bbeef93e471b28f",class:{"co-bottom-sheet":!0,"co-bottom-sheet--open":this.open},part:"sheet",role:"dialog","aria-modal":"true","aria-labelledby":this.heading?"co-bottom-sheet-heading":void 0,style:{"--co-bottom-sheet-max-height":this.maxHeight},onTransitionEnd:this.handleTransitionEnd,ref:t=>this.sheetEl=t},i("div",{key:"a0c45bd9389353b7c28a85cf02002e417e9295cd",class:"co-bottom-sheet__grip",onPointerDown:this.handleGripPointerDown,onPointerMove:this.handlePointerMove,onPointerUp:this.handlePointerUp,onPointerCancel:this.handlePointerCancel},this.showHandle&&i("div",{key:"36251f7b8031cb20ac95b9b8f674d094a5240789",class:"co-bottom-sheet__handle",part:"handle","aria-hidden":"true"}),i("header",{key:"f6533a7ed9bf8985cf3712f6587fd129557aed75",class:{"co-bottom-sheet__header":!0,"co-bottom-sheet__header--show":this.hasHeaderSlot||!!this.heading},part:"header"},i("slot",{key:"b7061e6c4d48b1a221805962ab55153e06edecf7",name:"header",onSlotchange:this.handleHeaderSlotChange},this.heading&&i("h2",{key:"8180cb9cc8e1c234475cc02d7fdab3bc94fa7f31",class:"co-bottom-sheet__heading",id:"co-bottom-sheet-heading"},this.heading)))),i("div",{key:"e8094b7c7c0919b0cc724404b2c97c4c18b031c9",class:"co-bottom-sheet__body",part:"body",onPointerDown:this.handleBodyPointerDown,onPointerMove:this.handlePointerMove,onPointerUp:this.handlePointerUp,onPointerCancel:this.handlePointerCancel,ref:t=>this.bodyEl=t},i("slot",{key:"0b9271b2ad92c1a8f7bcfde66955ceb026b0fffd"})),i("footer",{key:"016e2c9974dc2a1c88aacfd0d5a7a6b6e10f1033",class:{"co-bottom-sheet__footer":!0,"co-bottom-sheet__footer--show":this.hasFooter},part:"footer"},i("slot",{key:"5d571808b9b49eca346b7ce30525cab841b3ff4a",name:"footer",onSlotchange:this.handleFooterSlotChange}))))}get el(){return this}static get watchers(){return{open:[{onOpenChange:0}]}}static get style(){return":host{display:contents}.co-bottom-sheet__backdrop{position:fixed;inset:0;z-index:1000;background:rgba(0, 0, 0, 0.4);-webkit-backdrop-filter:blur(var(--co-overlay-blur, 2px));backdrop-filter:blur(var(--co-overlay-blur, 2px));opacity:0;pointer-events:none;transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-in)}.co-bottom-sheet-root--open .co-bottom-sheet__backdrop{opacity:1;pointer-events:auto;transition:opacity var(--co-motion-duration-base) var(--co-motion-ease-out)}.co-bottom-sheet{position:fixed;left:0;right:0;bottom:0;z-index:1001;display:flex;flex-direction:column;height:auto;max-height:var(--co-bottom-sheet-max-height, 85dvh);background:var(--co-semantic-surface-page);font-family:var(--co-font-family-primary);border-radius:var(--co-border-radius-xl) var(--co-border-radius-xl) 0 0;box-shadow:0 -4px 24px rgba(0, 0, 0, 0.12);transform:translateY(100%);transition:transform var(--co-motion-duration-slow) var(--co-motion-ease-in-out);will-change:transform;overflow:hidden;visibility:hidden}.co-bottom-sheet--open{transform:translateY(0);visibility:visible}.co-bottom-sheet:not(.co-bottom-sheet--open){transition:transform var(--co-motion-duration-slow) var(--co-motion-ease-in-out), visibility 0s linear var(--co-motion-duration-slow)}.co-bottom-sheet--dragging,.co-bottom-sheet-root:has(.co-bottom-sheet--dragging) .co-bottom-sheet__backdrop{transition:none !important}.co-bottom-sheet__grip{flex-shrink:0;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent;cursor:grab}.co-bottom-sheet--dragging .co-bottom-sheet__grip{cursor:grabbing}.co-bottom-sheet__handle{width:40px;height:4px;margin:var(--co-spacing-sm) auto var(--co-spacing-xs);border-radius:var(--co-border-radius-full);background:var(--co-semantic-border-default)}.co-bottom-sheet__header{padding:0 var(--co-spacing-xl)}.co-bottom-sheet__header--show{padding-bottom:var(--co-spacing-sm)}.co-bottom-sheet__heading{margin:0;font-size:var(--co-font-size-16);font-weight:700;color:var(--co-semantic-text-default)}.co-bottom-sheet__body{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior-y:contain;touch-action:pan-y}.co-bottom-sheet__footer{flex-shrink:0;display:none}.co-bottom-sheet__footer--show{display:block;border-top:1px solid var(--co-semantic-border-default);padding:var(--co-spacing-md) var(--co-spacing-xl) calc(var(--co-spacing-lg) + env(safe-area-inset-bottom, 0px));background:var(--co-semantic-surface-page)}"}},[257,"co-bottom-sheet",{open:[1540],heading:[513],maxHeight:[513,"max-height"],dismissible:[4],closeOnOverlay:[4,"close-on-overlay"],closeOnEscape:[4,"close-on-escape"],showHandle:[516,"show-handle"],hasFooter:[32],hasHeaderSlot:[32]},[[4,"keydown","handleKey"]],{open:[{onOpenChange:0}]}]);function r(){"undefined"!=typeof customElements&&["co-bottom-sheet"].forEach((o=>{"co-bottom-sheet"===o&&(customElements.get(t(o))||customElements.define(t(o),a))}))}r();const n=a,c=r;export{n as CoBottomSheet,c as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as
|
|
1
|
+
import{C as t,d as o}from"./p-4t5Fputx.js";const p=t,s=o;export{p as CoBreadcrumbItem,s as defineCustomElement}
|