@elementar-rt/components 0.6.58 → 0.7.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/README.md +7 -2
- package/fesm2022/elementar-rt-components-action-required.mjs +8 -8
- package/fesm2022/elementar-rt-components-action-required.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-alert.mjs +21 -25
- package/fesm2022/elementar-rt-components-alert.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-announcement.mjs +12 -14
- package/fesm2022/elementar-rt-components-announcement.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-avatar.mjs +34 -38
- package/fesm2022/elementar-rt-components-avatar.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-badge.mjs +10 -10
- package/fesm2022/elementar-rt-components-badge.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-block-loader.mjs +10 -16
- package/fesm2022/elementar-rt-components-block-loader.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-block-state.mjs +24 -24
- package/fesm2022/elementar-rt-components-block-state.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-bottom-sheet.mjs +12 -12
- package/fesm2022/elementar-rt-components-bottom-sheet.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-brand-colors.mjs +9 -13
- package/fesm2022/elementar-rt-components-brand-colors.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-breadcrumbs.mjs +49 -53
- package/fesm2022/elementar-rt-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-button-toggle.mjs +16 -16
- package/fesm2022/elementar-rt-components-button-toggle.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-calendar.mjs +10 -10
- package/fesm2022/elementar-rt-components-calendar.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-card-overlay.mjs +10 -16
- package/fesm2022/elementar-rt-components-card-overlay.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-card.mjs +18 -18
- package/fesm2022/elementar-rt-components-card.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-carousel.mjs +48 -50
- package/fesm2022/elementar-rt-components-carousel.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-chips.mjs +12 -12
- package/fesm2022/elementar-rt-components-chips.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-clipboard-copy.mjs +17 -17
- package/fesm2022/elementar-rt-components-clipboard-copy.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-code-highlighter.mjs +12 -12
- package/fesm2022/elementar-rt-components-code-highlighter.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-color-picker.mjs +44 -52
- package/fesm2022/elementar-rt-components-color-picker.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-color-scheme.mjs +10 -10
- package/fesm2022/elementar-rt-components-color-scheme.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-combobox.mjs +13 -13
- package/fesm2022/elementar-rt-components-combobox.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-command-bar.mjs +15 -17
- package/fesm2022/elementar-rt-components-command-bar.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-comment-editor.mjs +106 -106
- package/fesm2022/elementar-rt-components-comment-editor.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-comparison-slider.mjs +16 -16
- package/fesm2022/elementar-rt-components-comparison-slider.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-confirm.mjs +7 -7
- package/fesm2022/elementar-rt-components-confirm.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-content-editor.mjs +7 -7
- package/fesm2022/elementar-rt-components-content-editor.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-content-fade.mjs +7 -7
- package/fesm2022/elementar-rt-components-content-fade.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-cookie-popup.mjs +15 -17
- package/fesm2022/elementar-rt-components-cookie-popup.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-core.mjs +68 -75
- package/fesm2022/elementar-rt-components-core.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-country-select.mjs +15 -17
- package/fesm2022/elementar-rt-components-country-select.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-crop.mjs +12 -12
- package/fesm2022/elementar-rt-components-crop.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-currency-select.mjs +15 -17
- package/fesm2022/elementar-rt-components-currency-select.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-dashboard.mjs +15 -19
- package/fesm2022/elementar-rt-components-dashboard.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-data-grid.mjs +20 -20
- package/fesm2022/elementar-rt-components-data-grid.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-data-view.mjs +38 -52
- package/fesm2022/elementar-rt-components-data-view.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-date-format-select.mjs +8 -8
- package/fesm2022/elementar-rt-components-date-format-select.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-datepicker.mjs +12 -12
- package/fesm2022/elementar-rt-components-datepicker.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-dialog.mjs +19 -19
- package/fesm2022/elementar-rt-components-dialog.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-digit-roller.mjs +10 -10
- package/fesm2022/elementar-rt-components-digit-roller.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-divider.mjs +8 -8
- package/fesm2022/elementar-rt-components-divider.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-drawer.mjs +14 -14
- package/fesm2022/elementar-rt-components-drawer.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-emoji-picker.mjs +15 -17
- package/fesm2022/elementar-rt-components-emoji-picker.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-empty-state.mjs +8 -8
- package/fesm2022/elementar-rt-components-empty-state.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-expand.mjs +10 -14
- package/fesm2022/elementar-rt-components-expand.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-expansion-panel.mjs +6 -6
- package/fesm2022/elementar-rt-components-expansion-panel.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-filter-builder.mjs +24 -26
- package/fesm2022/elementar-rt-components-filter-builder.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-filter-select.mjs +19 -19
- package/fesm2022/elementar-rt-components-filter-select.mjs.map +1 -1
- package/fesm2022/{elementar-rt-components-form-renderer-autocomplete-many-field.component-C2Ai6F2X.mjs → elementar-rt-components-form-renderer-autocomplete-many-field.component-DYDAWUBL.mjs} +6 -6
- package/fesm2022/{elementar-rt-components-form-renderer-autocomplete-many-field.component-C2Ai6F2X.mjs.map → elementar-rt-components-form-renderer-autocomplete-many-field.component-DYDAWUBL.mjs.map} +1 -1
- package/fesm2022/{elementar-rt-components-form-renderer-checkbox-field.component-a0XAs0-_.mjs → elementar-rt-components-form-renderer-checkbox-field.component-DCdtWKHi.mjs} +7 -7
- package/fesm2022/{elementar-rt-components-form-renderer-checkbox-field.component-a0XAs0-_.mjs.map → elementar-rt-components-form-renderer-checkbox-field.component-DCdtWKHi.mjs.map} +1 -1
- package/fesm2022/{elementar-rt-components-form-renderer-datepicker-field.component-CTVrrf43.mjs → elementar-rt-components-form-renderer-datepicker-field.component-D9gAkq6u.mjs} +6 -6
- package/fesm2022/{elementar-rt-components-form-renderer-datepicker-field.component-CTVrrf43.mjs.map → elementar-rt-components-form-renderer-datepicker-field.component-D9gAkq6u.mjs.map} +1 -1
- package/fesm2022/{elementar-rt-components-form-renderer-divider-content.component-CkYa0MOQ.mjs → elementar-rt-components-form-renderer-divider-content.component-DB4F4Av6.mjs} +4 -4
- package/fesm2022/{elementar-rt-components-form-renderer-divider-content.component-CkYa0MOQ.mjs.map → elementar-rt-components-form-renderer-divider-content.component-DB4F4Av6.mjs.map} +1 -1
- package/fesm2022/{elementar-rt-components-form-renderer-image-content.component-B5uj3hoV.mjs → elementar-rt-components-form-renderer-image-content.component-BvxbVzag.mjs} +5 -5
- package/fesm2022/{elementar-rt-components-form-renderer-image-content.component-B5uj3hoV.mjs.map → elementar-rt-components-form-renderer-image-content.component-BvxbVzag.mjs.map} +1 -1
- package/fesm2022/{elementar-rt-components-form-renderer-input-field.component-DnaWJIK9.mjs → elementar-rt-components-form-renderer-input-field.component-BPOCpB7i.mjs} +7 -7
- package/fesm2022/{elementar-rt-components-form-renderer-input-field.component-DnaWJIK9.mjs.map → elementar-rt-components-form-renderer-input-field.component-BPOCpB7i.mjs.map} +1 -1
- package/fesm2022/{elementar-rt-components-form-renderer-radio-group-field.component-9BLv1MsP.mjs → elementar-rt-components-form-renderer-radio-group-field.component-D65JtgyW.mjs} +7 -7
- package/fesm2022/{elementar-rt-components-form-renderer-radio-group-field.component-9BLv1MsP.mjs.map → elementar-rt-components-form-renderer-radio-group-field.component-D65JtgyW.mjs.map} +1 -1
- package/fesm2022/{elementar-rt-components-form-renderer-select-field.component-C97pIEdh.mjs → elementar-rt-components-form-renderer-select-field.component-HgwzMHVU.mjs} +6 -6
- package/fesm2022/{elementar-rt-components-form-renderer-select-field.component-C97pIEdh.mjs.map → elementar-rt-components-form-renderer-select-field.component-HgwzMHVU.mjs.map} +1 -1
- package/fesm2022/{elementar-rt-components-form-renderer-text-content.component-CJxCc5vX.mjs → elementar-rt-components-form-renderer-text-content.component-fHh_BaZl.mjs} +5 -5
- package/fesm2022/{elementar-rt-components-form-renderer-text-content.component-CJxCc5vX.mjs.map → elementar-rt-components-form-renderer-text-content.component-fHh_BaZl.mjs.map} +1 -1
- package/fesm2022/{elementar-rt-components-form-renderer-textarea-field.component-CCtWiJOk.mjs → elementar-rt-components-form-renderer-textarea-field.component-CQ68jF7W.mjs} +6 -6
- package/fesm2022/{elementar-rt-components-form-renderer-textarea-field.component-CCtWiJOk.mjs.map → elementar-rt-components-form-renderer-textarea-field.component-CQ68jF7W.mjs.map} +1 -1
- package/fesm2022/{elementar-rt-components-form-renderer-timezone-field.component-GvZgdvUX.mjs → elementar-rt-components-form-renderer-timezone-field.component-CgS9fcCV.mjs} +7 -7
- package/fesm2022/{elementar-rt-components-form-renderer-timezone-field.component-GvZgdvUX.mjs.map → elementar-rt-components-form-renderer-timezone-field.component-CgS9fcCV.mjs.map} +1 -1
- package/fesm2022/{elementar-rt-components-form-renderer-toggle-field.component-DBiIiV-9.mjs → elementar-rt-components-form-renderer-toggle-field.component-nj0FmsWA.mjs} +7 -7
- package/fesm2022/{elementar-rt-components-form-renderer-toggle-field.component-DBiIiV-9.mjs.map → elementar-rt-components-form-renderer-toggle-field.component-nj0FmsWA.mjs.map} +1 -1
- package/fesm2022/elementar-rt-components-form-renderer.mjs +36 -36
- package/fesm2022/elementar-rt-components-form-renderer.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-gauge.mjs +11 -17
- package/fesm2022/elementar-rt-components-gauge.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-grid.mjs +12 -12
- package/fesm2022/elementar-rt-components-grid.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-guided-tour.mjs +12 -12
- package/fesm2022/elementar-rt-components-guided-tour.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-headless-stepper.mjs +10 -10
- package/fesm2022/elementar-rt-components-headless-stepper.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-icon.mjs +6 -6
- package/fesm2022/elementar-rt-components-icon.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-image-placeholder.mjs +10 -10
- package/fesm2022/elementar-rt-components-image-placeholder.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-image-resizer.mjs +17 -25
- package/fesm2022/elementar-rt-components-image-resizer.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-image-viewer.mjs +29 -29
- package/fesm2022/elementar-rt-components-image-viewer.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-image-zoom-viewer.mjs +16 -16
- package/fesm2022/elementar-rt-components-image-zoom-viewer.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-incidents.mjs +55 -57
- package/fesm2022/elementar-rt-components-incidents.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-inline-text-edit.mjs +8 -10
- package/fesm2022/elementar-rt-components-inline-text-edit.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-input-mask.mjs +12 -12
- package/fesm2022/elementar-rt-components-input-mask.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-input-validator.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-kanban-board.mjs +10 -10
- package/fesm2022/elementar-rt-components-kanban-board.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-keyboard.mjs +9 -9
- package/fesm2022/elementar-rt-components-keyboard.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-layout.mjs +36 -40
- package/fesm2022/elementar-rt-components-layout.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-list.mjs +13 -13
- package/fesm2022/elementar-rt-components-list.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-logo.mjs +12 -12
- package/fesm2022/elementar-rt-components-logo.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-marquee.mjs +9 -13
- package/fesm2022/elementar-rt-components-marquee.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-menu.mjs +19 -19
- package/fesm2022/elementar-rt-components-menu.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-micro-chart.mjs +65 -111
- package/fesm2022/elementar-rt-components-micro-chart.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-multi-select.mjs +13 -13
- package/fesm2022/elementar-rt-components-multi-select.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-navigation.mjs +56 -66
- package/fesm2022/elementar-rt-components-navigation.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-notifications.mjs +47 -53
- package/fesm2022/elementar-rt-components-notifications.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-number-input.mjs +23 -31
- package/fesm2022/elementar-rt-components-number-input.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-overlay-scrollbar.mjs +34 -34
- package/fesm2022/elementar-rt-components-overlay-scrollbar.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-overlay.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-page-loading-bar.mjs +5 -7
- package/fesm2022/elementar-rt-components-page-loading-bar.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-paginator.mjs +12 -12
- package/fesm2022/elementar-rt-components-paginator.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-panel.mjs +25 -27
- package/fesm2022/elementar-rt-components-panel.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-password-strength.mjs +35 -59
- package/fesm2022/elementar-rt-components-password-strength.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-phone-input.mjs +23 -26
- package/fesm2022/elementar-rt-components-phone-input.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-pin-input.mjs +17 -21
- package/fesm2022/elementar-rt-components-pin-input.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-popover.mjs +18 -28
- package/fesm2022/elementar-rt-components-popover.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-progress-bar.mjs +10 -10
- package/fesm2022/elementar-rt-components-progress-bar.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-progress-spinner.mjs +14 -14
- package/fesm2022/elementar-rt-components-progress-spinner.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-radio-card.mjs +21 -21
- package/fesm2022/elementar-rt-components-radio-card.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-rail-nav.mjs +14 -14
- package/fesm2022/elementar-rt-components-rail-nav.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-rating.mjs +15 -15
- package/fesm2022/elementar-rt-components-rating.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-resizable-container.mjs +5 -7
- package/fesm2022/elementar-rt-components-resizable-container.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-screen-loader.mjs +5 -7
- package/fesm2022/elementar-rt-components-screen-loader.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-scroll-spy.mjs +18 -18
- package/fesm2022/elementar-rt-components-scroll-spy.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-segmented.mjs +18 -24
- package/fesm2022/elementar-rt-components-segmented.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-side-panel.mjs +18 -18
- package/fesm2022/elementar-rt-components-side-panel.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-sidebar.mjs +71 -77
- package/fesm2022/elementar-rt-components-sidebar.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-sidenav.mjs +15 -15
- package/fesm2022/elementar-rt-components-sidenav.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-signature-pad.mjs +17 -17
- package/fesm2022/elementar-rt-components-signature-pad.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-skeleton.mjs +17 -17
- package/fesm2022/elementar-rt-components-skeleton.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-slider.mjs +13 -13
- package/fesm2022/elementar-rt-components-slider.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-snackbar.mjs +10 -10
- package/fesm2022/elementar-rt-components-snackbar.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-sort.mjs +11 -11
- package/fesm2022/elementar-rt-components-sort.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-splash-screen.mjs +6 -10
- package/fesm2022/elementar-rt-components-splash-screen.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-split-pane.mjs +10 -10
- package/fesm2022/elementar-rt-components-split-pane.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-stat-card.mjs +10 -10
- package/fesm2022/elementar-rt-components-stat-card.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-step-tracker.mjs +8 -8
- package/fesm2022/elementar-rt-components-step-tracker.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-stepper.mjs +21 -23
- package/fesm2022/elementar-rt-components-stepper.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-suggestions.mjs +21 -25
- package/fesm2022/elementar-rt-components-suggestions.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-tab-panel.mjs +54 -60
- package/fesm2022/elementar-rt-components-tab-panel.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-table.mjs +16 -16
- package/fesm2022/elementar-rt-components-table.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-tabs.mjs +14 -14
- package/fesm2022/elementar-rt-components-tabs.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-tag.mjs +9 -9
- package/fesm2022/elementar-rt-components-tag.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-text-editor.mjs +97 -96
- package/fesm2022/elementar-rt-components-text-editor.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-thumbnail-maker.mjs +11 -13
- package/fesm2022/elementar-rt-components-thumbnail-maker.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-tiles.mjs +9 -9
- package/fesm2022/elementar-rt-components-tiles.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-timeline.mjs +39 -39
- package/fesm2022/elementar-rt-components-timeline.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-timepicker.mjs +11 -11
- package/fesm2022/elementar-rt-components-timepicker.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-timezone-select.mjs +23 -29
- package/fesm2022/elementar-rt-components-timezone-select.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-toast.mjs +14 -14
- package/fesm2022/elementar-rt-components-toast.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-toolbar.mjs +6 -6
- package/fesm2022/elementar-rt-components-toolbar.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-tooltip.mjs +14 -14
- package/fesm2022/elementar-rt-components-tooltip.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-tree.mjs +17 -17
- package/fesm2022/elementar-rt-components-tree.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-upload.mjs +77 -87
- package/fesm2022/elementar-rt-components-upload.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-video-player.mjs +22 -22
- package/fesm2022/elementar-rt-components-video-player.mjs.map +1 -1
- package/fesm2022/elementar-rt-components-video-viewer.mjs +16 -16
- package/fesm2022/elementar-rt-components-video-viewer.mjs.map +1 -1
- package/package.json +136 -135
- package/schematics/collection.json +16 -0
- package/schematics/ng-add/actions/add-fonts.d.ts +2 -0
- package/schematics/ng-add/actions/add-fonts.js +70 -0
- package/schematics/ng-add/actions/add-fonts.js.map +1 -0
- package/schematics/ng-add/actions/add-styles.d.ts +3 -0
- package/schematics/ng-add/actions/add-styles.js +70 -0
- package/schematics/ng-add/actions/add-styles.js.map +1 -0
- package/schematics/ng-add/index.d.ts +3 -0
- package/schematics/ng-add/index.js +83 -0
- package/schematics/ng-add/index.js.map +1 -0
- package/schematics/ng-add/schema.d.ts +3 -0
- package/schematics/ng-add/schema.js +3 -0
- package/schematics/ng-add/schema.js.map +1 -0
- package/schematics/ng-add/schema.json +8 -0
- package/schematics/ng-add/setup-project.d.ts +3 -0
- package/schematics/ng-add/setup-project.js +14 -0
- package/schematics/ng-add/setup-project.js.map +1 -0
- package/schematics/utils/package-config.d.ts +3 -0
- package/schematics/utils/package-config.js +36 -0
- package/schematics/utils/package-config.js.map +1 -0
- package/schematics/utils/project.d.ts +10 -0
- package/schematics/utils/project.js +46 -0
- package/schematics/utils/project.js.map +1 -0
- package/{country-select/index.d.ts → types/elementar-rt-components-country-select.d.ts} +1 -1
- package/{currency-select/index.d.ts → types/elementar-rt-components-currency-select.d.ts} +1 -1
- /package/{action-required/index.d.ts → types/elementar-rt-components-action-required.d.ts} +0 -0
- /package/{alert/index.d.ts → types/elementar-rt-components-alert.d.ts} +0 -0
- /package/{announcement/index.d.ts → types/elementar-rt-components-announcement.d.ts} +0 -0
- /package/{avatar/index.d.ts → types/elementar-rt-components-avatar.d.ts} +0 -0
- /package/{badge/index.d.ts → types/elementar-rt-components-badge.d.ts} +0 -0
- /package/{block-loader/index.d.ts → types/elementar-rt-components-block-loader.d.ts} +0 -0
- /package/{block-state/index.d.ts → types/elementar-rt-components-block-state.d.ts} +0 -0
- /package/{bottom-sheet/index.d.ts → types/elementar-rt-components-bottom-sheet.d.ts} +0 -0
- /package/{brand-colors/index.d.ts → types/elementar-rt-components-brand-colors.d.ts} +0 -0
- /package/{breadcrumbs/index.d.ts → types/elementar-rt-components-breadcrumbs.d.ts} +0 -0
- /package/{button-toggle/index.d.ts → types/elementar-rt-components-button-toggle.d.ts} +0 -0
- /package/{calendar/index.d.ts → types/elementar-rt-components-calendar.d.ts} +0 -0
- /package/{card-overlay/index.d.ts → types/elementar-rt-components-card-overlay.d.ts} +0 -0
- /package/{card/index.d.ts → types/elementar-rt-components-card.d.ts} +0 -0
- /package/{carousel/index.d.ts → types/elementar-rt-components-carousel.d.ts} +0 -0
- /package/{chips/index.d.ts → types/elementar-rt-components-chips.d.ts} +0 -0
- /package/{clipboard-copy/index.d.ts → types/elementar-rt-components-clipboard-copy.d.ts} +0 -0
- /package/{code-highlighter/index.d.ts → types/elementar-rt-components-code-highlighter.d.ts} +0 -0
- /package/{color-picker/index.d.ts → types/elementar-rt-components-color-picker.d.ts} +0 -0
- /package/{color-scheme/index.d.ts → types/elementar-rt-components-color-scheme.d.ts} +0 -0
- /package/{combobox/index.d.ts → types/elementar-rt-components-combobox.d.ts} +0 -0
- /package/{command-bar/index.d.ts → types/elementar-rt-components-command-bar.d.ts} +0 -0
- /package/{comment-editor/index.d.ts → types/elementar-rt-components-comment-editor.d.ts} +0 -0
- /package/{comparison-slider/index.d.ts → types/elementar-rt-components-comparison-slider.d.ts} +0 -0
- /package/{confirm/index.d.ts → types/elementar-rt-components-confirm.d.ts} +0 -0
- /package/{content-editor/index.d.ts → types/elementar-rt-components-content-editor.d.ts} +0 -0
- /package/{content-fade/index.d.ts → types/elementar-rt-components-content-fade.d.ts} +0 -0
- /package/{cookie-popup/index.d.ts → types/elementar-rt-components-cookie-popup.d.ts} +0 -0
- /package/{core/index.d.ts → types/elementar-rt-components-core.d.ts} +0 -0
- /package/{crop/index.d.ts → types/elementar-rt-components-crop.d.ts} +0 -0
- /package/{dashboard/index.d.ts → types/elementar-rt-components-dashboard.d.ts} +0 -0
- /package/{data-grid/index.d.ts → types/elementar-rt-components-data-grid.d.ts} +0 -0
- /package/{data-view/index.d.ts → types/elementar-rt-components-data-view.d.ts} +0 -0
- /package/{date-format-select/index.d.ts → types/elementar-rt-components-date-format-select.d.ts} +0 -0
- /package/{datepicker/index.d.ts → types/elementar-rt-components-datepicker.d.ts} +0 -0
- /package/{dialog/index.d.ts → types/elementar-rt-components-dialog.d.ts} +0 -0
- /package/{digit-roller/index.d.ts → types/elementar-rt-components-digit-roller.d.ts} +0 -0
- /package/{divider/index.d.ts → types/elementar-rt-components-divider.d.ts} +0 -0
- /package/{drawer/index.d.ts → types/elementar-rt-components-drawer.d.ts} +0 -0
- /package/{emoji-picker/index.d.ts → types/elementar-rt-components-emoji-picker.d.ts} +0 -0
- /package/{empty-state/index.d.ts → types/elementar-rt-components-empty-state.d.ts} +0 -0
- /package/{expand/index.d.ts → types/elementar-rt-components-expand.d.ts} +0 -0
- /package/{expansion-panel/index.d.ts → types/elementar-rt-components-expansion-panel.d.ts} +0 -0
- /package/{filter-builder/index.d.ts → types/elementar-rt-components-filter-builder.d.ts} +0 -0
- /package/{filter-select/index.d.ts → types/elementar-rt-components-filter-select.d.ts} +0 -0
- /package/{form-renderer/index.d.ts → types/elementar-rt-components-form-renderer.d.ts} +0 -0
- /package/{gauge/index.d.ts → types/elementar-rt-components-gauge.d.ts} +0 -0
- /package/{grid/index.d.ts → types/elementar-rt-components-grid.d.ts} +0 -0
- /package/{guided-tour/index.d.ts → types/elementar-rt-components-guided-tour.d.ts} +0 -0
- /package/{headless-stepper/index.d.ts → types/elementar-rt-components-headless-stepper.d.ts} +0 -0
- /package/{icon/index.d.ts → types/elementar-rt-components-icon.d.ts} +0 -0
- /package/{image-placeholder/index.d.ts → types/elementar-rt-components-image-placeholder.d.ts} +0 -0
- /package/{image-resizer/index.d.ts → types/elementar-rt-components-image-resizer.d.ts} +0 -0
- /package/{image-viewer/index.d.ts → types/elementar-rt-components-image-viewer.d.ts} +0 -0
- /package/{image-zoom-viewer/index.d.ts → types/elementar-rt-components-image-zoom-viewer.d.ts} +0 -0
- /package/{incidents/index.d.ts → types/elementar-rt-components-incidents.d.ts} +0 -0
- /package/{inline-text-edit/index.d.ts → types/elementar-rt-components-inline-text-edit.d.ts} +0 -0
- /package/{input-mask/index.d.ts → types/elementar-rt-components-input-mask.d.ts} +0 -0
- /package/{input-validator/index.d.ts → types/elementar-rt-components-input-validator.d.ts} +0 -0
- /package/{kanban-board/index.d.ts → types/elementar-rt-components-kanban-board.d.ts} +0 -0
- /package/{keyboard/index.d.ts → types/elementar-rt-components-keyboard.d.ts} +0 -0
- /package/{layout/index.d.ts → types/elementar-rt-components-layout.d.ts} +0 -0
- /package/{list/index.d.ts → types/elementar-rt-components-list.d.ts} +0 -0
- /package/{logo/index.d.ts → types/elementar-rt-components-logo.d.ts} +0 -0
- /package/{marquee/index.d.ts → types/elementar-rt-components-marquee.d.ts} +0 -0
- /package/{menu/index.d.ts → types/elementar-rt-components-menu.d.ts} +0 -0
- /package/{micro-chart/index.d.ts → types/elementar-rt-components-micro-chart.d.ts} +0 -0
- /package/{multi-select/index.d.ts → types/elementar-rt-components-multi-select.d.ts} +0 -0
- /package/{navigation/index.d.ts → types/elementar-rt-components-navigation.d.ts} +0 -0
- /package/{notifications/index.d.ts → types/elementar-rt-components-notifications.d.ts} +0 -0
- /package/{number-input/index.d.ts → types/elementar-rt-components-number-input.d.ts} +0 -0
- /package/{overlay-scrollbar/index.d.ts → types/elementar-rt-components-overlay-scrollbar.d.ts} +0 -0
- /package/{overlay/index.d.ts → types/elementar-rt-components-overlay.d.ts} +0 -0
- /package/{page-loading-bar/index.d.ts → types/elementar-rt-components-page-loading-bar.d.ts} +0 -0
- /package/{paginator/index.d.ts → types/elementar-rt-components-paginator.d.ts} +0 -0
- /package/{panel/index.d.ts → types/elementar-rt-components-panel.d.ts} +0 -0
- /package/{password-strength/index.d.ts → types/elementar-rt-components-password-strength.d.ts} +0 -0
- /package/{phone-input/index.d.ts → types/elementar-rt-components-phone-input.d.ts} +0 -0
- /package/{pin-input/index.d.ts → types/elementar-rt-components-pin-input.d.ts} +0 -0
- /package/{popover/index.d.ts → types/elementar-rt-components-popover.d.ts} +0 -0
- /package/{progress-bar/index.d.ts → types/elementar-rt-components-progress-bar.d.ts} +0 -0
- /package/{progress-spinner/index.d.ts → types/elementar-rt-components-progress-spinner.d.ts} +0 -0
- /package/{radio-card/index.d.ts → types/elementar-rt-components-radio-card.d.ts} +0 -0
- /package/{rail-nav/index.d.ts → types/elementar-rt-components-rail-nav.d.ts} +0 -0
- /package/{rating/index.d.ts → types/elementar-rt-components-rating.d.ts} +0 -0
- /package/{resizable-container/index.d.ts → types/elementar-rt-components-resizable-container.d.ts} +0 -0
- /package/{screen-loader/index.d.ts → types/elementar-rt-components-screen-loader.d.ts} +0 -0
- /package/{scroll-spy/index.d.ts → types/elementar-rt-components-scroll-spy.d.ts} +0 -0
- /package/{segmented/index.d.ts → types/elementar-rt-components-segmented.d.ts} +0 -0
- /package/{side-panel/index.d.ts → types/elementar-rt-components-side-panel.d.ts} +0 -0
- /package/{sidebar/index.d.ts → types/elementar-rt-components-sidebar.d.ts} +0 -0
- /package/{sidenav/index.d.ts → types/elementar-rt-components-sidenav.d.ts} +0 -0
- /package/{signature-pad/index.d.ts → types/elementar-rt-components-signature-pad.d.ts} +0 -0
- /package/{skeleton/index.d.ts → types/elementar-rt-components-skeleton.d.ts} +0 -0
- /package/{slider/index.d.ts → types/elementar-rt-components-slider.d.ts} +0 -0
- /package/{snackbar/index.d.ts → types/elementar-rt-components-snackbar.d.ts} +0 -0
- /package/{sort/index.d.ts → types/elementar-rt-components-sort.d.ts} +0 -0
- /package/{splash-screen/index.d.ts → types/elementar-rt-components-splash-screen.d.ts} +0 -0
- /package/{split-pane/index.d.ts → types/elementar-rt-components-split-pane.d.ts} +0 -0
- /package/{stat-card/index.d.ts → types/elementar-rt-components-stat-card.d.ts} +0 -0
- /package/{step-tracker/index.d.ts → types/elementar-rt-components-step-tracker.d.ts} +0 -0
- /package/{stepper/index.d.ts → types/elementar-rt-components-stepper.d.ts} +0 -0
- /package/{suggestions/index.d.ts → types/elementar-rt-components-suggestions.d.ts} +0 -0
- /package/{tab-panel/index.d.ts → types/elementar-rt-components-tab-panel.d.ts} +0 -0
- /package/{table/index.d.ts → types/elementar-rt-components-table.d.ts} +0 -0
- /package/{tabs/index.d.ts → types/elementar-rt-components-tabs.d.ts} +0 -0
- /package/{tag/index.d.ts → types/elementar-rt-components-tag.d.ts} +0 -0
- /package/{text-editor/index.d.ts → types/elementar-rt-components-text-editor.d.ts} +0 -0
- /package/{thumbnail-maker/index.d.ts → types/elementar-rt-components-thumbnail-maker.d.ts} +0 -0
- /package/{tiles/index.d.ts → types/elementar-rt-components-tiles.d.ts} +0 -0
- /package/{timeline/index.d.ts → types/elementar-rt-components-timeline.d.ts} +0 -0
- /package/{timepicker/index.d.ts → types/elementar-rt-components-timepicker.d.ts} +0 -0
- /package/{timezone-select/index.d.ts → types/elementar-rt-components-timezone-select.d.ts} +0 -0
- /package/{toast/index.d.ts → types/elementar-rt-components-toast.d.ts} +0 -0
- /package/{toolbar/index.d.ts → types/elementar-rt-components-toolbar.d.ts} +0 -0
- /package/{tooltip/index.d.ts → types/elementar-rt-components-tooltip.d.ts} +0 -0
- /package/{tree/index.d.ts → types/elementar-rt-components-tree.d.ts} +0 -0
- /package/{upload/index.d.ts → types/elementar-rt-components-upload.d.ts} +0 -0
- /package/{video-player/index.d.ts → types/elementar-rt-components-video-player.d.ts} +0 -0
- /package/{video-viewer/index.d.ts → types/elementar-rt-components-video-viewer.d.ts} +0 -0
- /package/{index.d.ts → types/elementar-rt-components.d.ts} +0 -0
|
@@ -2,28 +2,28 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { input, booleanAttribute, viewChild, signal, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
class VideoPlayerComponent {
|
|
5
|
-
src = input('', ...(ngDevMode ? [{ debugName: "src" }] : []));
|
|
6
|
-
poster = input('', ...(ngDevMode ? [{ debugName: "poster" }] : []));
|
|
7
|
-
autoplay = input(false, ...(ngDevMode ?
|
|
8
|
-
loop = input(false, ...(ngDevMode ?
|
|
9
|
-
chapters = input([], ...(ngDevMode ? [{ debugName: "chapters" }] : []));
|
|
10
|
-
_videoEl = viewChild('videoEl', ...(ngDevMode ? [{ debugName: "_videoEl" }] : []));
|
|
11
|
-
_playing = signal(false, ...(ngDevMode ? [{ debugName: "_playing" }] : []));
|
|
12
|
-
_muted = signal(false, ...(ngDevMode ? [{ debugName: "_muted" }] : []));
|
|
13
|
-
_volume = signal(1, ...(ngDevMode ? [{ debugName: "_volume" }] : []));
|
|
14
|
-
_currentTime = signal(0, ...(ngDevMode ? [{ debugName: "_currentTime" }] : []));
|
|
15
|
-
_duration = signal(0, ...(ngDevMode ? [{ debugName: "_duration" }] : []));
|
|
16
|
-
_buffered = signal(0, ...(ngDevMode ? [{ debugName: "_buffered" }] : []));
|
|
17
|
-
_speed = signal(1, ...(ngDevMode ? [{ debugName: "_speed" }] : []));
|
|
18
|
-
_showSpeedMenu = signal(false, ...(ngDevMode ? [{ debugName: "_showSpeedMenu" }] : []));
|
|
19
|
-
_fullscreen = signal(false, ...(ngDevMode ? [{ debugName: "_fullscreen" }] : []));
|
|
20
|
-
_progress = computed(() => this._duration() > 0 ? (this._currentTime() / this._duration()) * 100 : 0, ...(ngDevMode ? [{ debugName: "_progress" }] : []));
|
|
21
|
-
_bufferedPct = computed(() => this._duration() > 0 ? (this._buffered() / this._duration()) * 100 : 0, ...(ngDevMode ? [{ debugName: "_bufferedPct" }] : []));
|
|
5
|
+
src = input('', ...(ngDevMode ? [{ debugName: "src" }] : /* istanbul ignore next */ []));
|
|
6
|
+
poster = input('', ...(ngDevMode ? [{ debugName: "poster" }] : /* istanbul ignore next */ []));
|
|
7
|
+
autoplay = input(false, { ...(ngDevMode ? { debugName: "autoplay" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
8
|
+
loop = input(false, { ...(ngDevMode ? { debugName: "loop" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
9
|
+
chapters = input([], ...(ngDevMode ? [{ debugName: "chapters" }] : /* istanbul ignore next */ []));
|
|
10
|
+
_videoEl = viewChild('videoEl', ...(ngDevMode ? [{ debugName: "_videoEl" }] : /* istanbul ignore next */ []));
|
|
11
|
+
_playing = signal(false, ...(ngDevMode ? [{ debugName: "_playing" }] : /* istanbul ignore next */ []));
|
|
12
|
+
_muted = signal(false, ...(ngDevMode ? [{ debugName: "_muted" }] : /* istanbul ignore next */ []));
|
|
13
|
+
_volume = signal(1, ...(ngDevMode ? [{ debugName: "_volume" }] : /* istanbul ignore next */ []));
|
|
14
|
+
_currentTime = signal(0, ...(ngDevMode ? [{ debugName: "_currentTime" }] : /* istanbul ignore next */ []));
|
|
15
|
+
_duration = signal(0, ...(ngDevMode ? [{ debugName: "_duration" }] : /* istanbul ignore next */ []));
|
|
16
|
+
_buffered = signal(0, ...(ngDevMode ? [{ debugName: "_buffered" }] : /* istanbul ignore next */ []));
|
|
17
|
+
_speed = signal(1, ...(ngDevMode ? [{ debugName: "_speed" }] : /* istanbul ignore next */ []));
|
|
18
|
+
_showSpeedMenu = signal(false, ...(ngDevMode ? [{ debugName: "_showSpeedMenu" }] : /* istanbul ignore next */ []));
|
|
19
|
+
_fullscreen = signal(false, ...(ngDevMode ? [{ debugName: "_fullscreen" }] : /* istanbul ignore next */ []));
|
|
20
|
+
_progress = computed(() => this._duration() > 0 ? (this._currentTime() / this._duration()) * 100 : 0, ...(ngDevMode ? [{ debugName: "_progress" }] : /* istanbul ignore next */ []));
|
|
21
|
+
_bufferedPct = computed(() => this._duration() > 0 ? (this._buffered() / this._duration()) * 100 : 0, ...(ngDevMode ? [{ debugName: "_bufferedPct" }] : /* istanbul ignore next */ []));
|
|
22
22
|
_currentChapter = computed(() => {
|
|
23
23
|
const t = this._currentTime();
|
|
24
24
|
const chapters = [...this.chapters()].sort((a, b) => b.time - a.time);
|
|
25
25
|
return chapters.find(c => t >= c.time)?.label ?? '';
|
|
26
|
-
}, ...(ngDevMode ? [{ debugName: "_currentChapter" }] : []));
|
|
26
|
+
}, ...(ngDevMode ? [{ debugName: "_currentChapter" }] : /* istanbul ignore next */ []));
|
|
27
27
|
_speeds = [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2];
|
|
28
28
|
ngAfterViewInit() {
|
|
29
29
|
const v = this._videoEl()?.nativeElement;
|
|
@@ -128,12 +128,12 @@ class VideoPlayerComponent {
|
|
|
128
128
|
_video() {
|
|
129
129
|
return this._videoEl()?.nativeElement ?? null;
|
|
130
130
|
}
|
|
131
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
132
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
131
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: VideoPlayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
132
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: VideoPlayerComponent, isStandalone: true, selector: "emr-video-player", inputs: { src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, poster: { classPropertyName: "poster", publicName: "poster", isSignal: true, isRequired: false, transformFunction: null }, autoplay: { classPropertyName: "autoplay", publicName: "autoplay", isSignal: true, isRequired: false, transformFunction: null }, loop: { classPropertyName: "loop", publicName: "loop", isSignal: true, isRequired: false, transformFunction: null }, chapters: { classPropertyName: "chapters", publicName: "chapters", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "_videoEl", first: true, predicate: ["videoEl"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"vp-container\">\n <video\n #videoEl\n class=\"vp-video\"\n [src]=\"src()\"\n [poster]=\"poster()\"\n [loop]=\"loop()\"\n [muted]=\"_muted()\"\n (timeupdate)=\"_onTimeUpdate()\"\n (play)=\"_onPlay()\"\n (pause)=\"_onPause()\"\n (loadedmetadata)=\"_onLoadedMetadata()\"\n (click)=\"_togglePlay()\"\n ></video>\n\n @if (_currentChapter()) {\n <div class=\"vp-chapter-badge\">{{ _currentChapter() }}</div>\n }\n\n <div class=\"vp-controls\">\n <!-- Progress bar -->\n <div class=\"vp-progress-wrap\">\n <div class=\"vp-buffered\" [style.width.%]=\"_bufferedPct()\"></div>\n <input\n type=\"range\" class=\"vp-seek\"\n min=\"0\" max=\"100\" step=\"0.1\"\n [value]=\"_progress()\"\n (input)=\"_onSeek($event)\"\n />\n @for (ch of chapters(); track ch.time) {\n <div class=\"vp-chapter-marker\" [style.left.%]=\"_chapterOffset(ch)\" [title]=\"ch.label\"></div>\n }\n </div>\n\n <!-- Bottom bar -->\n <div class=\"vp-bar\">\n <div class=\"vp-bar-left\">\n <!-- Play/Pause -->\n <button type=\"button\" class=\"vp-btn\" (click)=\"_togglePlay()\" [attr.aria-label]=\"_playing() ? 'Pause' : 'Play'\">\n @if (_playing()) {\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><rect x=\"6\" y=\"4\" width=\"4\" height=\"16\"/><rect x=\"14\" y=\"4\" width=\"4\" height=\"16\"/></svg>\n } @else {\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><polygon points=\"5 3 19 12 5 21 5 3\"/></svg>\n }\n </button>\n\n <!-- Volume -->\n <button type=\"button\" class=\"vp-btn\" (click)=\"_toggleMute()\" aria-label=\"Mute\">\n @if (_muted() || _volume() === 0) {\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><polygon points=\"11 5 6 9 2 9 2 15 6 15 11 19 11 5\"/><line x1=\"23\" y1=\"9\" x2=\"17\" y2=\"15\"/><line x1=\"17\" y1=\"9\" x2=\"23\" y2=\"15\"/></svg>\n } @else {\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><polygon points=\"11 5 6 9 2 9 2 15 6 15 11 19 11 5\"/><path d=\"M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07\"/></svg>\n }\n </button>\n <input type=\"range\" class=\"vp-volume\" min=\"0\" max=\"1\" step=\"0.05\" [value]=\"_volume()\" (input)=\"_onVolumeChange($event)\" aria-label=\"Volume\" />\n\n <!-- Time -->\n <span class=\"vp-time\">{{ _formatTime(_currentTime()) }} / {{ _formatTime(_duration()) }}</span>\n </div>\n\n <div class=\"vp-bar-right\">\n <!-- Speed -->\n <div class=\"vp-speed-wrap\">\n <button type=\"button\" class=\"vp-btn vp-speed-btn\" (click)=\"_showSpeedMenu.set(!_showSpeedMenu())\">\n {{ _speed() }}\u00D7\n </button>\n @if (_showSpeedMenu()) {\n <div class=\"vp-speed-menu\">\n @for (s of _speeds; track s) {\n <button type=\"button\" class=\"vp-speed-opt\" [attr.data-active]=\"_speed() === s || null\" (click)=\"_setSpeed(s)\">{{ s }}\u00D7</button>\n }\n </div>\n }\n </div>\n\n <!-- PiP -->\n <button type=\"button\" class=\"vp-btn\" (click)=\"_togglePiP()\" aria-label=\"Picture in picture\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><rect x=\"2\" y=\"3\" width=\"20\" height=\"14\" rx=\"2\"/><rect x=\"12\" y=\"10\" width=\"8\" height=\"6\" rx=\"1\" fill=\"currentColor\"/></svg>\n </button>\n\n <!-- Fullscreen -->\n <button type=\"button\" class=\"vp-btn\" (click)=\"_toggleFullscreen()\" aria-label=\"Fullscreen\">\n @if (_fullscreen()) {\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 0 2-2h3M3 16h3a2 2 0 0 0 2 2v3\"/></svg>\n } @else {\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3\"/></svg>\n }\n </button>\n </div>\n </div>\n </div>\n</div>\n", styles: [":host{display:block}.vp-container{position:relative;background:#000;border-radius:.75rem;overflow:hidden;aspect-ratio:16/9}.vp-container:hover .vp-controls{opacity:1}.vp-video{width:100%;height:100%;object-fit:contain;cursor:pointer;display:block}.vp-chapter-badge{position:absolute;top:calc(var(--spacing, .25rem) * 3);left:calc(var(--spacing, .25rem) * 3);background:#0009;color:#fff;font-size:.75rem;font-weight:600;padding:calc(var(--spacing, .25rem) * .5) calc(var(--spacing, .25rem) * 2);border-radius:9999px}.vp-controls{position:absolute;bottom:0;left:0;right:0;padding:calc(var(--spacing, .25rem) * 4) calc(var(--spacing, .25rem) * 3) calc(var(--spacing, .25rem) * 2);background:linear-gradient(transparent,#000000b3);opacity:0;transition:opacity .2s ease;display:flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 2)}.vp-progress-wrap{position:relative;height:calc(var(--spacing, .25rem) * 4);display:flex;align-items:center}.vp-buffered{position:absolute;left:0;height:3px;background:#ffffff4d;border-radius:9999px;pointer-events:none;z-index:0}.vp-seek{width:100%;position:relative;z-index:1;accent-color:var(--color-primary);cursor:pointer;background:transparent;height:3px}.vp-chapter-marker{position:absolute;width:2px;height:calc(var(--spacing, .25rem) * 2.5);background:#fff9;border-radius:1px;z-index:2;pointer-events:none;transform:translate(-50%)}.vp-bar{display:flex;align-items:center;justify-content:space-between;gap:calc(var(--spacing, .25rem) * 2)}.vp-bar-left,.vp-bar-right{display:flex;align-items:center;gap:var(--spacing, .25rem)}.vp-btn{width:calc(var(--spacing, .25rem) * 8);height:calc(var(--spacing, .25rem) * 8);display:flex;align-items:center;justify-content:center;background:transparent;border:none;cursor:pointer;color:#fff;border-radius:.375rem}.vp-btn:hover{background:#ffffff26}.vp-btn svg{width:calc(var(--spacing, .25rem) * 4);height:calc(var(--spacing, .25rem) * 4)}.vp-volume{width:calc(var(--spacing, .25rem) * 20);accent-color:var(--color-primary);cursor:pointer}.vp-time{font-size:.75rem;color:#ffffffd9;white-space:nowrap;font-variant-numeric:tabular-nums}.vp-speed-wrap{position:relative}.vp-speed-btn{font-size:.75rem;font-weight:700;width:auto;padding:0 calc(var(--spacing, .25rem) * 1.5);min-width:calc(var(--spacing, .25rem) * 9)}.vp-speed-menu{position:absolute;bottom:calc(100% + calc(var(--spacing, .25rem) * 2));right:0;background:var(--color-surface-container-high);border:1px solid var(--color-outline-variant);border-radius:.5rem;overflow:hidden;display:flex;flex-direction:column;min-width:calc(var(--spacing, .25rem) * 16);box-shadow:0 4px 16px #0000004d}.vp-speed-opt{font-size:.875rem;padding:calc(var(--spacing, .25rem) * 1.5) calc(var(--spacing, .25rem) * 3);background:transparent;border:none;cursor:pointer;text-align:center;color:var(--color-on-surface)}.vp-speed-opt:hover{background:var(--color-surface-container)}.vp-speed-opt[data-active]{color:var(--color-primary);font-weight:600}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
133
133
|
}
|
|
134
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
134
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: VideoPlayerComponent, decorators: [{
|
|
135
135
|
type: Component,
|
|
136
|
-
args: [{ selector: 'emr-video-player', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"vp-container\">\n <video\n #videoEl\n class=\"vp-video\"\n [src]=\"src()\"\n [poster]=\"poster()\"\n [loop]=\"loop()\"\n [muted]=\"_muted()\"\n (timeupdate)=\"_onTimeUpdate()\"\n (play)=\"_onPlay()\"\n (pause)=\"_onPause()\"\n (loadedmetadata)=\"_onLoadedMetadata()\"\n (click)=\"_togglePlay()\"\n ></video>\n\n @if (_currentChapter()) {\n <div class=\"vp-chapter-badge\">{{ _currentChapter() }}</div>\n }\n\n <div class=\"vp-controls\">\n <!-- Progress bar -->\n <div class=\"vp-progress-wrap\">\n <div class=\"vp-buffered\" [style.width.%]=\"_bufferedPct()\"></div>\n <input\n type=\"range\" class=\"vp-seek\"\n min=\"0\" max=\"100\" step=\"0.1\"\n [value]=\"_progress()\"\n (input)=\"_onSeek($event)\"\n />\n @for (ch of chapters(); track ch.time) {\n <div class=\"vp-chapter-marker\" [style.left.%]=\"_chapterOffset(ch)\" [title]=\"ch.label\"></div>\n }\n </div>\n\n <!-- Bottom bar -->\n <div class=\"vp-bar\">\n <div class=\"vp-bar-left\">\n <!-- Play/Pause -->\n <button type=\"button\" class=\"vp-btn\" (click)=\"_togglePlay()\" [attr.aria-label]=\"_playing() ? 'Pause' : 'Play'\">\n @if (_playing()) {\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><rect x=\"6\" y=\"4\" width=\"4\" height=\"16\"/><rect x=\"14\" y=\"4\" width=\"4\" height=\"16\"/></svg>\n } @else {\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><polygon points=\"5 3 19 12 5 21 5 3\"/></svg>\n }\n </button>\n\n <!-- Volume -->\n <button type=\"button\" class=\"vp-btn\" (click)=\"_toggleMute()\" aria-label=\"Mute\">\n @if (_muted() || _volume() === 0) {\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><polygon points=\"11 5 6 9 2 9 2 15 6 15 11 19 11 5\"/><line x1=\"23\" y1=\"9\" x2=\"17\" y2=\"15\"/><line x1=\"17\" y1=\"9\" x2=\"23\" y2=\"15\"/></svg>\n } @else {\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><polygon points=\"11 5 6 9 2 9 2 15 6 15 11 19 11 5\"/><path d=\"M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07\"/></svg>\n }\n </button>\n <input type=\"range\" class=\"vp-volume\" min=\"0\" max=\"1\" step=\"0.05\" [value]=\"_volume()\" (input)=\"_onVolumeChange($event)\" aria-label=\"Volume\" />\n\n <!-- Time -->\n <span class=\"vp-time\">{{ _formatTime(_currentTime()) }} / {{ _formatTime(_duration()) }}</span>\n </div>\n\n <div class=\"vp-bar-right\">\n <!-- Speed -->\n <div class=\"vp-speed-wrap\">\n <button type=\"button\" class=\"vp-btn vp-speed-btn\" (click)=\"_showSpeedMenu.set(!_showSpeedMenu())\">\n {{ _speed() }}\u00D7\n </button>\n @if (_showSpeedMenu()) {\n <div class=\"vp-speed-menu\">\n @for (s of _speeds; track s) {\n <button type=\"button\" class=\"vp-speed-opt\" [attr.data-active]=\"_speed() === s || null\" (click)=\"_setSpeed(s)\">{{ s }}\u00D7</button>\n }\n </div>\n }\n </div>\n\n <!-- PiP -->\n <button type=\"button\" class=\"vp-btn\" (click)=\"_togglePiP()\" aria-label=\"Picture in picture\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><rect x=\"2\" y=\"3\" width=\"20\" height=\"14\" rx=\"2\"/><rect x=\"12\" y=\"10\" width=\"8\" height=\"6\" rx=\"1\" fill=\"currentColor\"/></svg>\n </button>\n\n <!-- Fullscreen -->\n <button type=\"button\" class=\"vp-btn\" (click)=\"_toggleFullscreen()\" aria-label=\"Fullscreen\">\n @if (_fullscreen()) {\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 0 2-2h3M3 16h3a2 2 0 0 0 2 2v3\"/></svg>\n } @else {\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3\"/></svg>\n }\n </button>\n </div>\n </div>\n </div>\n</div>\n", styles: [":host{display:block}.vp-container{position:relative;background:#000;border-radius:.75rem;overflow:hidden;aspect-ratio:16/9}.vp-container:hover .vp-controls{opacity:1}.vp-video{width:100%;height:100%;object-fit:contain;cursor:pointer;display:block}.vp-chapter-badge{position:absolute;top:calc(var(--spacing, .25rem) * 3);left:calc(var(--spacing, .25rem) * 3);background:#0009;color:#fff;font-size:.75rem;font-weight:600;padding:calc(var(--spacing, .25rem) * .5) calc(var(--spacing, .25rem) * 2);border-radius:9999px}.vp-controls{position:absolute;bottom:0;left:0;right:0;padding:calc(var(--spacing, .25rem) * 4) calc(var(--spacing, .25rem) * 3) calc(var(--spacing, .25rem) * 2);background:linear-gradient(transparent,#000000b3);opacity:0;transition:opacity .2s ease;display:flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 2)}.vp-progress-wrap{position:relative;height:calc(var(--spacing, .25rem) * 4);display:flex;align-items:center}.vp-buffered{position:absolute;left:0;height:3px;background:#ffffff4d;border-radius:9999px;pointer-events:none;z-index:0}.vp-seek{width:100%;position:relative;z-index:1;accent-color:var(--color-primary);cursor:pointer;background:transparent;height:3px}.vp-chapter-marker{position:absolute;width:2px;height:calc(var(--spacing, .25rem) * 2.5);background:#fff9;border-radius:1px;z-index:2;pointer-events:none;transform:translate(-50%)}.vp-bar{display:flex;align-items:center;justify-content:space-between;gap:calc(var(--spacing, .25rem) * 2)}.vp-bar-left,.vp-bar-right{display:flex;align-items:center;gap:var(--spacing, .25rem)}.vp-btn{width:calc(var(--spacing, .25rem) * 8);height:calc(var(--spacing, .25rem) * 8);display:flex;align-items:center;justify-content:center;background:transparent;border:none;cursor:pointer;color:#fff;border-radius:.375rem}.vp-btn:hover{background:#ffffff26}.vp-btn svg{width:calc(var(--spacing, .25rem) * 4);height:calc(var(--spacing, .25rem) * 4)}.vp-volume{width:calc(var(--spacing, .25rem) * 20);accent-color:var(--color-primary);cursor:pointer}.vp-time{font-size:.75rem;color:#ffffffd9;white-space:nowrap;font-variant-numeric:tabular-nums}.vp-speed-wrap{position:relative}.vp-speed-btn{font-size:.75rem;font-weight:700;width:auto;padding:0 calc(var(--spacing, .25rem) * 1.5);min-width:calc(var(--spacing, .25rem) * 9)}.vp-speed-menu{position:absolute;bottom:calc(100% + calc(var(--spacing, .25rem) * 2));right:0;background:var(--color-surface-container-high);border:1px solid var(--color-outline-variant);border-radius:.5rem;overflow:hidden;display:flex;flex-direction:column;min-width:calc(var(--spacing, .25rem) * 16);box-shadow:0 4px 16px #0000004d}.vp-speed-opt{font-size:.875rem;padding:calc(var(--spacing, .25rem) * 1.5) calc(var(--spacing, .25rem) * 3);background:transparent;border:none;cursor:pointer;text-align:center;color:var(--color-on-surface)}.vp-speed-opt:hover{background:var(--color-surface-container)}.vp-speed-opt[data-active]{color:var(--color-primary);font-weight:600}\n/*! tailwindcss v4.3.
|
|
136
|
+
args: [{ selector: 'emr-video-player', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"vp-container\">\n <video\n #videoEl\n class=\"vp-video\"\n [src]=\"src()\"\n [poster]=\"poster()\"\n [loop]=\"loop()\"\n [muted]=\"_muted()\"\n (timeupdate)=\"_onTimeUpdate()\"\n (play)=\"_onPlay()\"\n (pause)=\"_onPause()\"\n (loadedmetadata)=\"_onLoadedMetadata()\"\n (click)=\"_togglePlay()\"\n ></video>\n\n @if (_currentChapter()) {\n <div class=\"vp-chapter-badge\">{{ _currentChapter() }}</div>\n }\n\n <div class=\"vp-controls\">\n <!-- Progress bar -->\n <div class=\"vp-progress-wrap\">\n <div class=\"vp-buffered\" [style.width.%]=\"_bufferedPct()\"></div>\n <input\n type=\"range\" class=\"vp-seek\"\n min=\"0\" max=\"100\" step=\"0.1\"\n [value]=\"_progress()\"\n (input)=\"_onSeek($event)\"\n />\n @for (ch of chapters(); track ch.time) {\n <div class=\"vp-chapter-marker\" [style.left.%]=\"_chapterOffset(ch)\" [title]=\"ch.label\"></div>\n }\n </div>\n\n <!-- Bottom bar -->\n <div class=\"vp-bar\">\n <div class=\"vp-bar-left\">\n <!-- Play/Pause -->\n <button type=\"button\" class=\"vp-btn\" (click)=\"_togglePlay()\" [attr.aria-label]=\"_playing() ? 'Pause' : 'Play'\">\n @if (_playing()) {\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><rect x=\"6\" y=\"4\" width=\"4\" height=\"16\"/><rect x=\"14\" y=\"4\" width=\"4\" height=\"16\"/></svg>\n } @else {\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><polygon points=\"5 3 19 12 5 21 5 3\"/></svg>\n }\n </button>\n\n <!-- Volume -->\n <button type=\"button\" class=\"vp-btn\" (click)=\"_toggleMute()\" aria-label=\"Mute\">\n @if (_muted() || _volume() === 0) {\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><polygon points=\"11 5 6 9 2 9 2 15 6 15 11 19 11 5\"/><line x1=\"23\" y1=\"9\" x2=\"17\" y2=\"15\"/><line x1=\"17\" y1=\"9\" x2=\"23\" y2=\"15\"/></svg>\n } @else {\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><polygon points=\"11 5 6 9 2 9 2 15 6 15 11 19 11 5\"/><path d=\"M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07\"/></svg>\n }\n </button>\n <input type=\"range\" class=\"vp-volume\" min=\"0\" max=\"1\" step=\"0.05\" [value]=\"_volume()\" (input)=\"_onVolumeChange($event)\" aria-label=\"Volume\" />\n\n <!-- Time -->\n <span class=\"vp-time\">{{ _formatTime(_currentTime()) }} / {{ _formatTime(_duration()) }}</span>\n </div>\n\n <div class=\"vp-bar-right\">\n <!-- Speed -->\n <div class=\"vp-speed-wrap\">\n <button type=\"button\" class=\"vp-btn vp-speed-btn\" (click)=\"_showSpeedMenu.set(!_showSpeedMenu())\">\n {{ _speed() }}\u00D7\n </button>\n @if (_showSpeedMenu()) {\n <div class=\"vp-speed-menu\">\n @for (s of _speeds; track s) {\n <button type=\"button\" class=\"vp-speed-opt\" [attr.data-active]=\"_speed() === s || null\" (click)=\"_setSpeed(s)\">{{ s }}\u00D7</button>\n }\n </div>\n }\n </div>\n\n <!-- PiP -->\n <button type=\"button\" class=\"vp-btn\" (click)=\"_togglePiP()\" aria-label=\"Picture in picture\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><rect x=\"2\" y=\"3\" width=\"20\" height=\"14\" rx=\"2\"/><rect x=\"12\" y=\"10\" width=\"8\" height=\"6\" rx=\"1\" fill=\"currentColor\"/></svg>\n </button>\n\n <!-- Fullscreen -->\n <button type=\"button\" class=\"vp-btn\" (click)=\"_toggleFullscreen()\" aria-label=\"Fullscreen\">\n @if (_fullscreen()) {\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 0 2-2h3M3 16h3a2 2 0 0 0 2 2v3\"/></svg>\n } @else {\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3\"/></svg>\n }\n </button>\n </div>\n </div>\n </div>\n</div>\n", styles: [":host{display:block}.vp-container{position:relative;background:#000;border-radius:.75rem;overflow:hidden;aspect-ratio:16/9}.vp-container:hover .vp-controls{opacity:1}.vp-video{width:100%;height:100%;object-fit:contain;cursor:pointer;display:block}.vp-chapter-badge{position:absolute;top:calc(var(--spacing, .25rem) * 3);left:calc(var(--spacing, .25rem) * 3);background:#0009;color:#fff;font-size:.75rem;font-weight:600;padding:calc(var(--spacing, .25rem) * .5) calc(var(--spacing, .25rem) * 2);border-radius:9999px}.vp-controls{position:absolute;bottom:0;left:0;right:0;padding:calc(var(--spacing, .25rem) * 4) calc(var(--spacing, .25rem) * 3) calc(var(--spacing, .25rem) * 2);background:linear-gradient(transparent,#000000b3);opacity:0;transition:opacity .2s ease;display:flex;flex-direction:column;gap:calc(var(--spacing, .25rem) * 2)}.vp-progress-wrap{position:relative;height:calc(var(--spacing, .25rem) * 4);display:flex;align-items:center}.vp-buffered{position:absolute;left:0;height:3px;background:#ffffff4d;border-radius:9999px;pointer-events:none;z-index:0}.vp-seek{width:100%;position:relative;z-index:1;accent-color:var(--color-primary);cursor:pointer;background:transparent;height:3px}.vp-chapter-marker{position:absolute;width:2px;height:calc(var(--spacing, .25rem) * 2.5);background:#fff9;border-radius:1px;z-index:2;pointer-events:none;transform:translate(-50%)}.vp-bar{display:flex;align-items:center;justify-content:space-between;gap:calc(var(--spacing, .25rem) * 2)}.vp-bar-left,.vp-bar-right{display:flex;align-items:center;gap:var(--spacing, .25rem)}.vp-btn{width:calc(var(--spacing, .25rem) * 8);height:calc(var(--spacing, .25rem) * 8);display:flex;align-items:center;justify-content:center;background:transparent;border:none;cursor:pointer;color:#fff;border-radius:.375rem}.vp-btn:hover{background:#ffffff26}.vp-btn svg{width:calc(var(--spacing, .25rem) * 4);height:calc(var(--spacing, .25rem) * 4)}.vp-volume{width:calc(var(--spacing, .25rem) * 20);accent-color:var(--color-primary);cursor:pointer}.vp-time{font-size:.75rem;color:#ffffffd9;white-space:nowrap;font-variant-numeric:tabular-nums}.vp-speed-wrap{position:relative}.vp-speed-btn{font-size:.75rem;font-weight:700;width:auto;padding:0 calc(var(--spacing, .25rem) * 1.5);min-width:calc(var(--spacing, .25rem) * 9)}.vp-speed-menu{position:absolute;bottom:calc(100% + calc(var(--spacing, .25rem) * 2));right:0;background:var(--color-surface-container-high);border:1px solid var(--color-outline-variant);border-radius:.5rem;overflow:hidden;display:flex;flex-direction:column;min-width:calc(var(--spacing, .25rem) * 16);box-shadow:0 4px 16px #0000004d}.vp-speed-opt{font-size:.875rem;padding:calc(var(--spacing, .25rem) * 1.5) calc(var(--spacing, .25rem) * 3);background:transparent;border:none;cursor:pointer;text-align:center;color:var(--color-on-surface)}.vp-speed-opt:hover{background:var(--color-surface-container)}.vp-speed-opt[data-active]{color:var(--color-primary);font-weight:600}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
|
|
137
137
|
}], propDecorators: { src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }], poster: [{ type: i0.Input, args: [{ isSignal: true, alias: "poster", required: false }] }], autoplay: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoplay", required: false }] }], loop: [{ type: i0.Input, args: [{ isSignal: true, alias: "loop", required: false }] }], chapters: [{ type: i0.Input, args: [{ isSignal: true, alias: "chapters", required: false }] }], _videoEl: [{ type: i0.ViewChild, args: ['videoEl', { isSignal: true }] }] } });
|
|
138
138
|
|
|
139
139
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elementar-rt-components-video-player.mjs","sources":["../../../projects/components/video-player/src/video-player/video-player.component.ts","../../../projects/components/video-player/src/video-player/video-player.component.html","../../../projects/components/video-player/elementar-rt-components-video-player.ts"],"sourcesContent":["import {\n Component, input, signal, computed, ChangeDetectionStrategy,\n booleanAttribute, viewChild, ElementRef, AfterViewInit, OnDestroy\n} from '@angular/core';\n\nexport interface VideoChapter {\n time: number;\n label: string;\n}\n\n@Component({\n selector: 'emr-video-player',\n standalone: true,\n templateUrl: './video-player.component.html',\n styleUrl: './video-player.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class VideoPlayerComponent implements AfterViewInit, OnDestroy {\n src = input('');\n poster = input('');\n autoplay = input(false, { transform: booleanAttribute });\n loop = input(false, { transform: booleanAttribute });\n chapters = input<VideoChapter[]>([]);\n\n protected _videoEl = viewChild<ElementRef<HTMLVideoElement>>('videoEl');\n\n protected _playing = signal(false);\n protected _muted = signal(false);\n protected _volume = signal(1);\n protected _currentTime = signal(0);\n protected _duration = signal(0);\n protected _buffered = signal(0);\n protected _speed = signal(1);\n protected _showSpeedMenu = signal(false);\n protected _fullscreen = signal(false);\n\n protected _progress = computed(() =>\n this._duration() > 0 ? (this._currentTime() / this._duration()) * 100 : 0\n );\n\n protected _bufferedPct = computed(() =>\n this._duration() > 0 ? (this._buffered() / this._duration()) * 100 : 0\n );\n\n protected _currentChapter = computed(() => {\n const t = this._currentTime();\n const chapters = [...this.chapters()].sort((a, b) => b.time - a.time);\n return chapters.find(c => t >= c.time)?.label ?? '';\n });\n\n protected readonly _speeds = [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2];\n\n ngAfterViewInit(): void {\n const v = this._videoEl()?.nativeElement;\n if (v && this.autoplay()) { v.play().catch(() => {}); }\n }\n\n ngOnDestroy(): void {}\n\n protected _togglePlay(): void {\n const v = this._video();\n if (!v) return;\n if (this._playing()) { v.pause(); } else { v.play().catch(() => {}); }\n }\n\n protected _toggleMute(): void {\n const v = this._video();\n if (!v) return;\n v.muted = !v.muted;\n this._muted.set(v.muted);\n }\n\n protected _onVolumeChange(e: Event): void {\n const v = this._video();\n if (!v) return;\n const vol = parseFloat((e.target as HTMLInputElement).value);\n v.volume = vol;\n v.muted = vol === 0;\n this._volume.set(vol);\n this._muted.set(v.muted);\n }\n\n protected _onSeek(e: Event): void {\n const v = this._video();\n if (!v) return;\n const pct = parseFloat((e.target as HTMLInputElement).value);\n v.currentTime = (pct / 100) * this._duration();\n }\n\n protected _setSpeed(s: number): void {\n const v = this._video();\n if (!v) return;\n v.playbackRate = s;\n this._speed.set(s);\n this._showSpeedMenu.set(false);\n }\n\n protected _togglePiP(): void {\n const v = this._video();\n if (!v) return;\n if (document.pictureInPictureElement) {\n document.exitPictureInPicture().catch(() => {});\n } else {\n v.requestPictureInPicture().catch(() => {});\n }\n }\n\n protected _toggleFullscreen(): void {\n const el = document.querySelector('.vp-container') as HTMLElement;\n if (!el) return;\n if (document.fullscreenElement) {\n document.exitFullscreen().then(() => this._fullscreen.set(false)).catch(() => {});\n } else {\n el.requestFullscreen().then(() => this._fullscreen.set(true)).catch(() => {});\n }\n }\n\n protected _onTimeUpdate(): void {\n const v = this._video();\n if (!v) return;\n this._currentTime.set(v.currentTime);\n if (v.buffered.length > 0) this._buffered.set(v.buffered.end(v.buffered.length - 1));\n }\n\n protected _onPlay(): void { this._playing.set(true); }\n protected _onPause(): void { this._playing.set(false); }\n protected _onLoadedMetadata(): void {\n const v = this._video();\n if (v) this._duration.set(v.duration);\n }\n\n protected _formatTime(s: number): string {\n if (!s || isNaN(s)) return '0:00';\n const h = Math.floor(s / 3600);\n const m = Math.floor((s % 3600) / 60);\n const sec = Math.floor(s % 60);\n if (h > 0) return `${h}:${m.toString().padStart(2, '0')}:${sec.toString().padStart(2, '0')}`;\n return `${m}:${sec.toString().padStart(2, '0')}`;\n }\n\n protected _chapterOffset(chapter: VideoChapter): number {\n return this._duration() > 0 ? (chapter.time / this._duration()) * 100 : 0;\n }\n\n private _video(): HTMLVideoElement | null {\n return this._videoEl()?.nativeElement ?? null;\n }\n}\n","<div class=\"vp-container\">\n <video\n #videoEl\n class=\"vp-video\"\n [src]=\"src()\"\n [poster]=\"poster()\"\n [loop]=\"loop()\"\n [muted]=\"_muted()\"\n (timeupdate)=\"_onTimeUpdate()\"\n (play)=\"_onPlay()\"\n (pause)=\"_onPause()\"\n (loadedmetadata)=\"_onLoadedMetadata()\"\n (click)=\"_togglePlay()\"\n ></video>\n\n @if (_currentChapter()) {\n <div class=\"vp-chapter-badge\">{{ _currentChapter() }}</div>\n }\n\n <div class=\"vp-controls\">\n <!-- Progress bar -->\n <div class=\"vp-progress-wrap\">\n <div class=\"vp-buffered\" [style.width.%]=\"_bufferedPct()\"></div>\n <input\n type=\"range\" class=\"vp-seek\"\n min=\"0\" max=\"100\" step=\"0.1\"\n [value]=\"_progress()\"\n (input)=\"_onSeek($event)\"\n />\n @for (ch of chapters(); track ch.time) {\n <div class=\"vp-chapter-marker\" [style.left.%]=\"_chapterOffset(ch)\" [title]=\"ch.label\"></div>\n }\n </div>\n\n <!-- Bottom bar -->\n <div class=\"vp-bar\">\n <div class=\"vp-bar-left\">\n <!-- Play/Pause -->\n <button type=\"button\" class=\"vp-btn\" (click)=\"_togglePlay()\" [attr.aria-label]=\"_playing() ? 'Pause' : 'Play'\">\n @if (_playing()) {\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><rect x=\"6\" y=\"4\" width=\"4\" height=\"16\"/><rect x=\"14\" y=\"4\" width=\"4\" height=\"16\"/></svg>\n } @else {\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><polygon points=\"5 3 19 12 5 21 5 3\"/></svg>\n }\n </button>\n\n <!-- Volume -->\n <button type=\"button\" class=\"vp-btn\" (click)=\"_toggleMute()\" aria-label=\"Mute\">\n @if (_muted() || _volume() === 0) {\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><polygon points=\"11 5 6 9 2 9 2 15 6 15 11 19 11 5\"/><line x1=\"23\" y1=\"9\" x2=\"17\" y2=\"15\"/><line x1=\"17\" y1=\"9\" x2=\"23\" y2=\"15\"/></svg>\n } @else {\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><polygon points=\"11 5 6 9 2 9 2 15 6 15 11 19 11 5\"/><path d=\"M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07\"/></svg>\n }\n </button>\n <input type=\"range\" class=\"vp-volume\" min=\"0\" max=\"1\" step=\"0.05\" [value]=\"_volume()\" (input)=\"_onVolumeChange($event)\" aria-label=\"Volume\" />\n\n <!-- Time -->\n <span class=\"vp-time\">{{ _formatTime(_currentTime()) }} / {{ _formatTime(_duration()) }}</span>\n </div>\n\n <div class=\"vp-bar-right\">\n <!-- Speed -->\n <div class=\"vp-speed-wrap\">\n <button type=\"button\" class=\"vp-btn vp-speed-btn\" (click)=\"_showSpeedMenu.set(!_showSpeedMenu())\">\n {{ _speed() }}×\n </button>\n @if (_showSpeedMenu()) {\n <div class=\"vp-speed-menu\">\n @for (s of _speeds; track s) {\n <button type=\"button\" class=\"vp-speed-opt\" [attr.data-active]=\"_speed() === s || null\" (click)=\"_setSpeed(s)\">{{ s }}×</button>\n }\n </div>\n }\n </div>\n\n <!-- PiP -->\n <button type=\"button\" class=\"vp-btn\" (click)=\"_togglePiP()\" aria-label=\"Picture in picture\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><rect x=\"2\" y=\"3\" width=\"20\" height=\"14\" rx=\"2\"/><rect x=\"12\" y=\"10\" width=\"8\" height=\"6\" rx=\"1\" fill=\"currentColor\"/></svg>\n </button>\n\n <!-- Fullscreen -->\n <button type=\"button\" class=\"vp-btn\" (click)=\"_toggleFullscreen()\" aria-label=\"Fullscreen\">\n @if (_fullscreen()) {\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 0 2-2h3M3 16h3a2 2 0 0 0 2 2v3\"/></svg>\n } @else {\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3\"/></svg>\n }\n </button>\n </div>\n </div>\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAiBa,oBAAoB,CAAA;AAC/B,IAAA,GAAG,GAAG,KAAK,CAAC,EAAE,+CAAC;AACf,IAAA,MAAM,GAAG,KAAK,CAAC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,CAAA;AAApB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,oBAAoB,izBCjBjC,0uIA4FA,EAAA,MAAA,EAAA,CAAA,89FAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FD3Ea,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAPhC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,EAAA,UAAA,EAChB,IAAI,EAAA,eAAA,EAGC,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,0uIAAA,EAAA,MAAA,EAAA,CAAA,89FAAA,CAAA,EAAA;ghBASc,SAAS,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AExBxE;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"elementar-rt-components-video-player.mjs","sources":["../../../projects/components/video-player/src/video-player/video-player.component.ts","../../../projects/components/video-player/src/video-player/video-player.component.html","../../../projects/components/video-player/elementar-rt-components-video-player.ts"],"sourcesContent":["import {\n Component, input, signal, computed, ChangeDetectionStrategy,\n booleanAttribute, viewChild, ElementRef, AfterViewInit, OnDestroy\n} from '@angular/core';\n\nexport interface VideoChapter {\n time: number;\n label: string;\n}\n\n@Component({\n selector: 'emr-video-player',\n standalone: true,\n templateUrl: './video-player.component.html',\n styleUrl: './video-player.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class VideoPlayerComponent implements AfterViewInit, OnDestroy {\n src = input('');\n poster = input('');\n autoplay = input(false, { transform: booleanAttribute });\n loop = input(false, { transform: booleanAttribute });\n chapters = input<VideoChapter[]>([]);\n\n protected _videoEl = viewChild<ElementRef<HTMLVideoElement>>('videoEl');\n\n protected _playing = signal(false);\n protected _muted = signal(false);\n protected _volume = signal(1);\n protected _currentTime = signal(0);\n protected _duration = signal(0);\n protected _buffered = signal(0);\n protected _speed = signal(1);\n protected _showSpeedMenu = signal(false);\n protected _fullscreen = signal(false);\n\n protected _progress = computed(() =>\n this._duration() > 0 ? (this._currentTime() / this._duration()) * 100 : 0\n );\n\n protected _bufferedPct = computed(() =>\n this._duration() > 0 ? (this._buffered() / this._duration()) * 100 : 0\n );\n\n protected _currentChapter = computed(() => {\n const t = this._currentTime();\n const chapters = [...this.chapters()].sort((a, b) => b.time - a.time);\n return chapters.find(c => t >= c.time)?.label ?? '';\n });\n\n protected readonly _speeds = [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2];\n\n ngAfterViewInit(): void {\n const v = this._videoEl()?.nativeElement;\n if (v && this.autoplay()) { v.play().catch(() => {}); }\n }\n\n ngOnDestroy(): void {}\n\n protected _togglePlay(): void {\n const v = this._video();\n if (!v) return;\n if (this._playing()) { v.pause(); } else { v.play().catch(() => {}); }\n }\n\n protected _toggleMute(): void {\n const v = this._video();\n if (!v) return;\n v.muted = !v.muted;\n this._muted.set(v.muted);\n }\n\n protected _onVolumeChange(e: Event): void {\n const v = this._video();\n if (!v) return;\n const vol = parseFloat((e.target as HTMLInputElement).value);\n v.volume = vol;\n v.muted = vol === 0;\n this._volume.set(vol);\n this._muted.set(v.muted);\n }\n\n protected _onSeek(e: Event): void {\n const v = this._video();\n if (!v) return;\n const pct = parseFloat((e.target as HTMLInputElement).value);\n v.currentTime = (pct / 100) * this._duration();\n }\n\n protected _setSpeed(s: number): void {\n const v = this._video();\n if (!v) return;\n v.playbackRate = s;\n this._speed.set(s);\n this._showSpeedMenu.set(false);\n }\n\n protected _togglePiP(): void {\n const v = this._video();\n if (!v) return;\n if (document.pictureInPictureElement) {\n document.exitPictureInPicture().catch(() => {});\n } else {\n v.requestPictureInPicture().catch(() => {});\n }\n }\n\n protected _toggleFullscreen(): void {\n const el = document.querySelector('.vp-container') as HTMLElement;\n if (!el) return;\n if (document.fullscreenElement) {\n document.exitFullscreen().then(() => this._fullscreen.set(false)).catch(() => {});\n } else {\n el.requestFullscreen().then(() => this._fullscreen.set(true)).catch(() => {});\n }\n }\n\n protected _onTimeUpdate(): void {\n const v = this._video();\n if (!v) return;\n this._currentTime.set(v.currentTime);\n if (v.buffered.length > 0) this._buffered.set(v.buffered.end(v.buffered.length - 1));\n }\n\n protected _onPlay(): void { this._playing.set(true); }\n protected _onPause(): void { this._playing.set(false); }\n protected _onLoadedMetadata(): void {\n const v = this._video();\n if (v) this._duration.set(v.duration);\n }\n\n protected _formatTime(s: number): string {\n if (!s || isNaN(s)) return '0:00';\n const h = Math.floor(s / 3600);\n const m = Math.floor((s % 3600) / 60);\n const sec = Math.floor(s % 60);\n if (h > 0) return `${h}:${m.toString().padStart(2, '0')}:${sec.toString().padStart(2, '0')}`;\n return `${m}:${sec.toString().padStart(2, '0')}`;\n }\n\n protected _chapterOffset(chapter: VideoChapter): number {\n return this._duration() > 0 ? (chapter.time / this._duration()) * 100 : 0;\n }\n\n private _video(): HTMLVideoElement | null {\n return this._videoEl()?.nativeElement ?? null;\n }\n}\n","<div class=\"vp-container\">\n <video\n #videoEl\n class=\"vp-video\"\n [src]=\"src()\"\n [poster]=\"poster()\"\n [loop]=\"loop()\"\n [muted]=\"_muted()\"\n (timeupdate)=\"_onTimeUpdate()\"\n (play)=\"_onPlay()\"\n (pause)=\"_onPause()\"\n (loadedmetadata)=\"_onLoadedMetadata()\"\n (click)=\"_togglePlay()\"\n ></video>\n\n @if (_currentChapter()) {\n <div class=\"vp-chapter-badge\">{{ _currentChapter() }}</div>\n }\n\n <div class=\"vp-controls\">\n <!-- Progress bar -->\n <div class=\"vp-progress-wrap\">\n <div class=\"vp-buffered\" [style.width.%]=\"_bufferedPct()\"></div>\n <input\n type=\"range\" class=\"vp-seek\"\n min=\"0\" max=\"100\" step=\"0.1\"\n [value]=\"_progress()\"\n (input)=\"_onSeek($event)\"\n />\n @for (ch of chapters(); track ch.time) {\n <div class=\"vp-chapter-marker\" [style.left.%]=\"_chapterOffset(ch)\" [title]=\"ch.label\"></div>\n }\n </div>\n\n <!-- Bottom bar -->\n <div class=\"vp-bar\">\n <div class=\"vp-bar-left\">\n <!-- Play/Pause -->\n <button type=\"button\" class=\"vp-btn\" (click)=\"_togglePlay()\" [attr.aria-label]=\"_playing() ? 'Pause' : 'Play'\">\n @if (_playing()) {\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><rect x=\"6\" y=\"4\" width=\"4\" height=\"16\"/><rect x=\"14\" y=\"4\" width=\"4\" height=\"16\"/></svg>\n } @else {\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><polygon points=\"5 3 19 12 5 21 5 3\"/></svg>\n }\n </button>\n\n <!-- Volume -->\n <button type=\"button\" class=\"vp-btn\" (click)=\"_toggleMute()\" aria-label=\"Mute\">\n @if (_muted() || _volume() === 0) {\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><polygon points=\"11 5 6 9 2 9 2 15 6 15 11 19 11 5\"/><line x1=\"23\" y1=\"9\" x2=\"17\" y2=\"15\"/><line x1=\"17\" y1=\"9\" x2=\"23\" y2=\"15\"/></svg>\n } @else {\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><polygon points=\"11 5 6 9 2 9 2 15 6 15 11 19 11 5\"/><path d=\"M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07\"/></svg>\n }\n </button>\n <input type=\"range\" class=\"vp-volume\" min=\"0\" max=\"1\" step=\"0.05\" [value]=\"_volume()\" (input)=\"_onVolumeChange($event)\" aria-label=\"Volume\" />\n\n <!-- Time -->\n <span class=\"vp-time\">{{ _formatTime(_currentTime()) }} / {{ _formatTime(_duration()) }}</span>\n </div>\n\n <div class=\"vp-bar-right\">\n <!-- Speed -->\n <div class=\"vp-speed-wrap\">\n <button type=\"button\" class=\"vp-btn vp-speed-btn\" (click)=\"_showSpeedMenu.set(!_showSpeedMenu())\">\n {{ _speed() }}×\n </button>\n @if (_showSpeedMenu()) {\n <div class=\"vp-speed-menu\">\n @for (s of _speeds; track s) {\n <button type=\"button\" class=\"vp-speed-opt\" [attr.data-active]=\"_speed() === s || null\" (click)=\"_setSpeed(s)\">{{ s }}×</button>\n }\n </div>\n }\n </div>\n\n <!-- PiP -->\n <button type=\"button\" class=\"vp-btn\" (click)=\"_togglePiP()\" aria-label=\"Picture in picture\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><rect x=\"2\" y=\"3\" width=\"20\" height=\"14\" rx=\"2\"/><rect x=\"12\" y=\"10\" width=\"8\" height=\"6\" rx=\"1\" fill=\"currentColor\"/></svg>\n </button>\n\n <!-- Fullscreen -->\n <button type=\"button\" class=\"vp-btn\" (click)=\"_toggleFullscreen()\" aria-label=\"Fullscreen\">\n @if (_fullscreen()) {\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 0 2-2h3M3 16h3a2 2 0 0 0 2 2v3\"/></svg>\n } @else {\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3\"/></svg>\n }\n </button>\n </div>\n </div>\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAiBa,oBAAoB,CAAA;AAC/B,IAAA,GAAG,GAAG,KAAK,CAAC,EAAE,0EAAC;AACf,IAAA,MAAM,GAAG,KAAK,CAAC,EAAE,6EAAC;IAClB,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS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,89FAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FD3Ea,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAPhC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,EAAA,UAAA,EAChB,IAAI,EAAA,eAAA,EAGC,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,0uIAAA,EAAA,MAAA,EAAA,CAAA,89FAAA,CAAA,EAAA;ghBASc,SAAS,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AExBxE;;AAEG;;"}
|
|
@@ -3,18 +3,18 @@ import { input, booleanAttribute, output, inject, signal, computed, HostListener
|
|
|
3
3
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
4
4
|
|
|
5
5
|
class VideoViewerComponent {
|
|
6
|
-
src = input('', ...(ngDevMode ? [{ debugName: "src" }] : []));
|
|
7
|
-
poster = input('', ...(ngDevMode ? [{ debugName: "poster" }] : []));
|
|
8
|
-
open = input(false, ...(ngDevMode ?
|
|
6
|
+
src = input('', ...(ngDevMode ? [{ debugName: "src" }] : /* istanbul ignore next */ []));
|
|
7
|
+
poster = input('', ...(ngDevMode ? [{ debugName: "poster" }] : /* istanbul ignore next */ []));
|
|
8
|
+
open = input(false, { ...(ngDevMode ? { debugName: "open" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
9
9
|
closed = output();
|
|
10
10
|
_sanitizer = inject(DomSanitizer);
|
|
11
|
-
_open = signal(false, ...(ngDevMode ? [{ debugName: "_open" }] : []));
|
|
12
|
-
_playing = signal(false, ...(ngDevMode ? [{ debugName: "_playing" }] : []));
|
|
13
|
-
_muted = signal(false, ...(ngDevMode ? [{ debugName: "_muted" }] : []));
|
|
14
|
-
_volume = signal(1, ...(ngDevMode ? [{ debugName: "_volume" }] : []));
|
|
15
|
-
_currentTime = signal(0, ...(ngDevMode ? [{ debugName: "_currentTime" }] : []));
|
|
16
|
-
_duration = signal(0, ...(ngDevMode ? [{ debugName: "_duration" }] : []));
|
|
17
|
-
_progress = computed(() => this._duration() > 0 ? (this._currentTime() / this._duration()) * 100 : 0, ...(ngDevMode ? [{ debugName: "_progress" }] : []));
|
|
11
|
+
_open = signal(false, ...(ngDevMode ? [{ debugName: "_open" }] : /* istanbul ignore next */ []));
|
|
12
|
+
_playing = signal(false, ...(ngDevMode ? [{ debugName: "_playing" }] : /* istanbul ignore next */ []));
|
|
13
|
+
_muted = signal(false, ...(ngDevMode ? [{ debugName: "_muted" }] : /* istanbul ignore next */ []));
|
|
14
|
+
_volume = signal(1, ...(ngDevMode ? [{ debugName: "_volume" }] : /* istanbul ignore next */ []));
|
|
15
|
+
_currentTime = signal(0, ...(ngDevMode ? [{ debugName: "_currentTime" }] : /* istanbul ignore next */ []));
|
|
16
|
+
_duration = signal(0, ...(ngDevMode ? [{ debugName: "_duration" }] : /* istanbul ignore next */ []));
|
|
17
|
+
_progress = computed(() => this._duration() > 0 ? (this._currentTime() / this._duration()) * 100 : 0, ...(ngDevMode ? [{ debugName: "_progress" }] : /* istanbul ignore next */ []));
|
|
18
18
|
_videoType = computed(() => {
|
|
19
19
|
const s = this.src();
|
|
20
20
|
if (/youtube\.com|youtu\.be/.test(s))
|
|
@@ -22,7 +22,7 @@ class VideoViewerComponent {
|
|
|
22
22
|
if (/vimeo\.com/.test(s))
|
|
23
23
|
return 'vimeo';
|
|
24
24
|
return 'mp4';
|
|
25
|
-
}, ...(ngDevMode ? [{ debugName: "_videoType" }] : []));
|
|
25
|
+
}, ...(ngDevMode ? [{ debugName: "_videoType" }] : /* istanbul ignore next */ []));
|
|
26
26
|
_embedUrl = computed(() => {
|
|
27
27
|
const s = this.src();
|
|
28
28
|
const type = this._videoType();
|
|
@@ -37,7 +37,7 @@ class VideoViewerComponent {
|
|
|
37
37
|
return this._sanitizer.bypassSecurityTrustResourceUrl(`https://player.vimeo.com/video/${id}?autoplay=1`);
|
|
38
38
|
}
|
|
39
39
|
return null;
|
|
40
|
-
}, ...(ngDevMode ? [{ debugName: "_embedUrl" }] : []));
|
|
40
|
+
}, ...(ngDevMode ? [{ debugName: "_embedUrl" }] : /* istanbul ignore next */ []));
|
|
41
41
|
onKey(e) {
|
|
42
42
|
if (!this._open())
|
|
43
43
|
return;
|
|
@@ -77,14 +77,14 @@ class VideoViewerComponent {
|
|
|
77
77
|
const sec = Math.floor(s % 60);
|
|
78
78
|
return `${m}:${sec.toString().padStart(2, '0')}`;
|
|
79
79
|
}
|
|
80
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
81
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
80
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: VideoViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
81
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: VideoViewerComponent, isStandalone: true, selector: "emr-video-viewer", inputs: { src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, poster: { classPropertyName: "poster", publicName: "poster", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed" }, host: { listeners: { "keydown": "onKey($event)" }, properties: { "attr.data-open": "_open() || null" } }, ngImport: i0, template: "@if (_open()) {\n <div class=\"vv-backdrop\" (click)=\"_close()\">\n <div class=\"vv-player\" (click)=\"$event.stopPropagation()\">\n <button type=\"button\" class=\"vv-close\" (click)=\"_close()\" aria-label=\"Close\">\u00D7</button>\n\n @if (_videoType() === 'mp4') {\n <video\n class=\"vv-video\"\n [src]=\"src()\"\n [poster]=\"poster()\"\n [muted]=\"_muted()\"\n [volume]=\"_volume()\"\n [autoplay]=\"true\"\n (timeupdate)=\"_onTimeUpdate($event)\"\n (play)=\"_playing.set(true)\"\n (pause)=\"_playing.set(false)\"\n (click)=\"_togglePlay()\"\n ></video>\n <div class=\"vv-controls\">\n <button type=\"button\" class=\"vv-btn\" (click)=\"_togglePlay()\">\n @if (_playing()) { \u23F8 } @else { \u25B6 }\n </button>\n <span class=\"vv-time\">{{ _formatTime(_currentTime()) }} / {{ _formatTime(_duration()) }}</span>\n <input\n type=\"range\" class=\"vv-seek\" min=\"0\" max=\"100\"\n [value]=\"_progress()\"\n (change)=\"_onSeek($event)\"\n />\n <button type=\"button\" class=\"vv-btn\" (click)=\"_toggleMute()\">\n @if (_muted()) { \uD83D\uDD07 } @else { \uD83D\uDD0A }\n </button>\n <button type=\"button\" class=\"vv-btn\" (click)=\"_fullscreen()\">\u26F6</button>\n </div>\n } @else {\n <iframe\n class=\"vv-embed\"\n [src]=\"_embedUrl()\"\n frameborder=\"0\"\n allowfullscreen\n allow=\"autoplay; fullscreen; picture-in-picture\"\n ></iframe>\n }\n </div>\n </div>\n}\n", styles: [".vv-backdrop{position:fixed;inset:0;background:#000000d9;z-index:9000;display:flex;align-items:center;justify-content:center;padding:calc(var(--spacing, .25rem) * 4);animation:fadeIn .2s ease}.vv-player{position:relative;width:100%;max-width:calc(var(--spacing, .25rem) * 192);aspect-ratio:16/9;background:#000;border-radius:.75rem;overflow:hidden}.vv-close{position:absolute;top:calc(var(--spacing, .25rem) * 3);right:calc(var(--spacing, .25rem) * 3);z-index:10;width:calc(var(--spacing, .25rem) * 9);height:calc(var(--spacing, .25rem) * 9);display:flex;align-items:center;justify-content:center;background:#0009;border:none;border-radius:50%;cursor:pointer;color:#fff;font-size:1.25rem;line-height:1}.vv-close:hover{background:#000c}.vv-video{width:100%;height:100%;object-fit:contain;cursor:pointer}.vv-embed{width:100%;height:100%;border:none}.vv-controls{position:absolute;bottom:0;left:0;right:0;display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2);padding:calc(var(--spacing, .25rem) * 2) calc(var(--spacing, .25rem) * 3);background:linear-gradient(transparent,#000000b3)}.vv-btn{background:transparent;border:none;cursor:pointer;color:#fff;font-size:1rem;padding:var(--spacing, .25rem);border-radius:.25rem}.vv-btn:hover{background:#ffffff26}.vv-time{font-size:.75rem;color:#fffc;white-space:nowrap}.vv-seek{flex:1;height:var(--spacing, .25rem);cursor:pointer;accent-color:var(--color-primary)}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
82
82
|
}
|
|
83
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
83
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: VideoViewerComponent, decorators: [{
|
|
84
84
|
type: Component,
|
|
85
85
|
args: [{ selector: 'emr-video-viewer', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
86
86
|
'[attr.data-open]': '_open() || null',
|
|
87
|
-
}, template: "@if (_open()) {\n <div class=\"vv-backdrop\" (click)=\"_close()\">\n <div class=\"vv-player\" (click)=\"$event.stopPropagation()\">\n <button type=\"button\" class=\"vv-close\" (click)=\"_close()\" aria-label=\"Close\">\u00D7</button>\n\n @if (_videoType() === 'mp4') {\n <video\n class=\"vv-video\"\n [src]=\"src()\"\n [poster]=\"poster()\"\n [muted]=\"_muted()\"\n [volume]=\"_volume()\"\n [autoplay]=\"true\"\n (timeupdate)=\"_onTimeUpdate($event)\"\n (play)=\"_playing.set(true)\"\n (pause)=\"_playing.set(false)\"\n (click)=\"_togglePlay()\"\n ></video>\n <div class=\"vv-controls\">\n <button type=\"button\" class=\"vv-btn\" (click)=\"_togglePlay()\">\n @if (_playing()) { \u23F8 } @else { \u25B6 }\n </button>\n <span class=\"vv-time\">{{ _formatTime(_currentTime()) }} / {{ _formatTime(_duration()) }}</span>\n <input\n type=\"range\" class=\"vv-seek\" min=\"0\" max=\"100\"\n [value]=\"_progress()\"\n (change)=\"_onSeek($event)\"\n />\n <button type=\"button\" class=\"vv-btn\" (click)=\"_toggleMute()\">\n @if (_muted()) { \uD83D\uDD07 } @else { \uD83D\uDD0A }\n </button>\n <button type=\"button\" class=\"vv-btn\" (click)=\"_fullscreen()\">\u26F6</button>\n </div>\n } @else {\n <iframe\n class=\"vv-embed\"\n [src]=\"_embedUrl()\"\n frameborder=\"0\"\n allowfullscreen\n allow=\"autoplay; fullscreen; picture-in-picture\"\n ></iframe>\n }\n </div>\n </div>\n}\n", styles: [".vv-backdrop{position:fixed;inset:0;background:#000000d9;z-index:9000;display:flex;align-items:center;justify-content:center;padding:calc(var(--spacing, .25rem) * 4);animation:fadeIn .2s ease}.vv-player{position:relative;width:100%;max-width:calc(var(--spacing, .25rem) * 192);aspect-ratio:16/9;background:#000;border-radius:.75rem;overflow:hidden}.vv-close{position:absolute;top:calc(var(--spacing, .25rem) * 3);right:calc(var(--spacing, .25rem) * 3);z-index:10;width:calc(var(--spacing, .25rem) * 9);height:calc(var(--spacing, .25rem) * 9);display:flex;align-items:center;justify-content:center;background:#0009;border:none;border-radius:50%;cursor:pointer;color:#fff;font-size:1.25rem;line-height:1}.vv-close:hover{background:#000c}.vv-video{width:100%;height:100%;object-fit:contain;cursor:pointer}.vv-embed{width:100%;height:100%;border:none}.vv-controls{position:absolute;bottom:0;left:0;right:0;display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2);padding:calc(var(--spacing, .25rem) * 2) calc(var(--spacing, .25rem) * 3);background:linear-gradient(transparent,#000000b3)}.vv-btn{background:transparent;border:none;cursor:pointer;color:#fff;font-size:1rem;padding:var(--spacing, .25rem);border-radius:.25rem}.vv-btn:hover{background:#ffffff26}.vv-time{font-size:.75rem;color:#fffc;white-space:nowrap}.vv-seek{flex:1;height:var(--spacing, .25rem);cursor:pointer;accent-color:var(--color-primary)}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}\n/*! tailwindcss v4.3.
|
|
87
|
+
}, template: "@if (_open()) {\n <div class=\"vv-backdrop\" (click)=\"_close()\">\n <div class=\"vv-player\" (click)=\"$event.stopPropagation()\">\n <button type=\"button\" class=\"vv-close\" (click)=\"_close()\" aria-label=\"Close\">\u00D7</button>\n\n @if (_videoType() === 'mp4') {\n <video\n class=\"vv-video\"\n [src]=\"src()\"\n [poster]=\"poster()\"\n [muted]=\"_muted()\"\n [volume]=\"_volume()\"\n [autoplay]=\"true\"\n (timeupdate)=\"_onTimeUpdate($event)\"\n (play)=\"_playing.set(true)\"\n (pause)=\"_playing.set(false)\"\n (click)=\"_togglePlay()\"\n ></video>\n <div class=\"vv-controls\">\n <button type=\"button\" class=\"vv-btn\" (click)=\"_togglePlay()\">\n @if (_playing()) { \u23F8 } @else { \u25B6 }\n </button>\n <span class=\"vv-time\">{{ _formatTime(_currentTime()) }} / {{ _formatTime(_duration()) }}</span>\n <input\n type=\"range\" class=\"vv-seek\" min=\"0\" max=\"100\"\n [value]=\"_progress()\"\n (change)=\"_onSeek($event)\"\n />\n <button type=\"button\" class=\"vv-btn\" (click)=\"_toggleMute()\">\n @if (_muted()) { \uD83D\uDD07 } @else { \uD83D\uDD0A }\n </button>\n <button type=\"button\" class=\"vv-btn\" (click)=\"_fullscreen()\">\u26F6</button>\n </div>\n } @else {\n <iframe\n class=\"vv-embed\"\n [src]=\"_embedUrl()\"\n frameborder=\"0\"\n allowfullscreen\n allow=\"autoplay; fullscreen; picture-in-picture\"\n ></iframe>\n }\n </div>\n </div>\n}\n", styles: [".vv-backdrop{position:fixed;inset:0;background:#000000d9;z-index:9000;display:flex;align-items:center;justify-content:center;padding:calc(var(--spacing, .25rem) * 4);animation:fadeIn .2s ease}.vv-player{position:relative;width:100%;max-width:calc(var(--spacing, .25rem) * 192);aspect-ratio:16/9;background:#000;border-radius:.75rem;overflow:hidden}.vv-close{position:absolute;top:calc(var(--spacing, .25rem) * 3);right:calc(var(--spacing, .25rem) * 3);z-index:10;width:calc(var(--spacing, .25rem) * 9);height:calc(var(--spacing, .25rem) * 9);display:flex;align-items:center;justify-content:center;background:#0009;border:none;border-radius:50%;cursor:pointer;color:#fff;font-size:1.25rem;line-height:1}.vv-close:hover{background:#000c}.vv-video{width:100%;height:100%;object-fit:contain;cursor:pointer}.vv-embed{width:100%;height:100%;border:none}.vv-controls{position:absolute;bottom:0;left:0;right:0;display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2);padding:calc(var(--spacing, .25rem) * 2) calc(var(--spacing, .25rem) * 3);background:linear-gradient(transparent,#000000b3)}.vv-btn{background:transparent;border:none;cursor:pointer;color:#fff;font-size:1rem;padding:var(--spacing, .25rem);border-radius:.25rem}.vv-btn:hover{background:#ffffff26}.vv-time{font-size:.75rem;color:#fffc;white-space:nowrap}.vv-seek{flex:1;height:var(--spacing, .25rem);cursor:pointer;accent-color:var(--color-primary)}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"] }]
|
|
88
88
|
}], propDecorators: { src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }], poster: [{ type: i0.Input, args: [{ isSignal: true, alias: "poster", required: false }] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }], onKey: [{
|
|
89
89
|
type: HostListener,
|
|
90
90
|
args: ['keydown', ['$event']]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elementar-rt-components-video-viewer.mjs","sources":["../../../projects/components/video-viewer/src/video-viewer/video-viewer.component.ts","../../../projects/components/video-viewer/src/video-viewer/video-viewer.component.html","../../../projects/components/video-viewer/elementar-rt-components-video-viewer.ts"],"sourcesContent":["import {\n Component, input, signal, computed, ChangeDetectionStrategy,\n booleanAttribute, output, HostListener\n} from '@angular/core';\nimport { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';\nimport { inject } from '@angular/core';\n\ntype VideoType = 'mp4' | 'youtube' | 'vimeo';\n\n@Component({\n selector: 'emr-video-viewer',\n standalone: true,\n templateUrl: './video-viewer.component.html',\n styleUrl: './video-viewer.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.data-open]': '_open() || null',\n }\n})\nexport class VideoViewerComponent {\n src = input('');\n poster = input('');\n open = input(false, { transform: booleanAttribute });\n\n closed = output<void>();\n\n private _sanitizer = inject(DomSanitizer);\n\n protected _open = signal(false);\n protected _playing = signal(false);\n protected _muted = signal(false);\n protected _volume = signal(1);\n protected _currentTime = signal(0);\n protected _duration = signal(0);\n protected _progress = computed(() =>\n this._duration() > 0 ? (this._currentTime() / this._duration()) * 100 : 0\n );\n\n protected _videoType = computed<VideoType>(() => {\n const s = this.src();\n if (/youtube\\.com|youtu\\.be/.test(s)) return 'youtube';\n if (/vimeo\\.com/.test(s)) return 'vimeo';\n return 'mp4';\n });\n\n protected _embedUrl = computed<SafeResourceUrl | null>(() => {\n const s = this.src();\n const type = this._videoType();\n if (type === 'youtube') {\n const id = s.match(/(?:v=|youtu\\.be\\/)([^&?/]+)/)?.[1];\n if (id) return this._sanitizer.bypassSecurityTrustResourceUrl(`https://www.youtube.com/embed/${id}?autoplay=1`);\n }\n if (type === 'vimeo') {\n const id = s.match(/vimeo\\.com\\/(\\d+)/)?.[1];\n if (id) return this._sanitizer.bypassSecurityTrustResourceUrl(`https://player.vimeo.com/video/${id}?autoplay=1`);\n }\n return null;\n });\n\n @HostListener('keydown', ['$event'])\n onKey(e: KeyboardEvent): void {\n if (!this._open()) return;\n if (e.code === 'Space') { e.preventDefault(); this._togglePlay(); }\n if (e.code === 'Escape') this._close();\n if (e.code === 'KeyF') this._fullscreen();\n }\n\n protected _show(): void { this._open.set(true); }\n protected _close(): void { this._open.set(false); this.closed.emit(); }\n\n protected _togglePlay(): void { this._playing.set(!this._playing()); }\n protected _toggleMute(): void { this._muted.set(!this._muted()); }\n\n protected _onTimeUpdate(e: Event): void {\n const v = e.target as HTMLVideoElement;\n this._currentTime.set(v.currentTime);\n this._duration.set(v.duration);\n }\n\n protected _onSeek(e: Event): void {\n const v = (e.target as HTMLInputElement);\n const video = document.querySelector('.vv-video') as HTMLVideoElement;\n if (video) video.currentTime = (parseFloat(v.value) / 100) * this._duration();\n }\n\n protected _fullscreen(): void {\n const el = document.querySelector('.vv-player') as HTMLElement;\n if (el?.requestFullscreen) el.requestFullscreen();\n }\n\n protected _formatTime(s: number): string {\n if (!s || isNaN(s)) return '0:00';\n const m = Math.floor(s / 60);\n const sec = Math.floor(s % 60);\n return `${m}:${sec.toString().padStart(2, '0')}`;\n }\n}\n","@if (_open()) {\n <div class=\"vv-backdrop\" (click)=\"_close()\">\n <div class=\"vv-player\" (click)=\"$event.stopPropagation()\">\n <button type=\"button\" class=\"vv-close\" (click)=\"_close()\" aria-label=\"Close\">×</button>\n\n @if (_videoType() === 'mp4') {\n <video\n class=\"vv-video\"\n [src]=\"src()\"\n [poster]=\"poster()\"\n [muted]=\"_muted()\"\n [volume]=\"_volume()\"\n [autoplay]=\"true\"\n (timeupdate)=\"_onTimeUpdate($event)\"\n (play)=\"_playing.set(true)\"\n (pause)=\"_playing.set(false)\"\n (click)=\"_togglePlay()\"\n ></video>\n <div class=\"vv-controls\">\n <button type=\"button\" class=\"vv-btn\" (click)=\"_togglePlay()\">\n @if (_playing()) { ⏸ } @else { ▶ }\n </button>\n <span class=\"vv-time\">{{ _formatTime(_currentTime()) }} / {{ _formatTime(_duration()) }}</span>\n <input\n type=\"range\" class=\"vv-seek\" min=\"0\" max=\"100\"\n [value]=\"_progress()\"\n (change)=\"_onSeek($event)\"\n />\n <button type=\"button\" class=\"vv-btn\" (click)=\"_toggleMute()\">\n @if (_muted()) { 🔇 } @else { 🔊 }\n </button>\n <button type=\"button\" class=\"vv-btn\" (click)=\"_fullscreen()\">⛶</button>\n </div>\n } @else {\n <iframe\n class=\"vv-embed\"\n [src]=\"_embedUrl()\"\n frameborder=\"0\"\n allowfullscreen\n allow=\"autoplay; fullscreen; picture-in-picture\"\n ></iframe>\n }\n </div>\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAmBa,oBAAoB,CAAA;AAC/B,IAAA,GAAG,GAAG,KAAK,CAAC,EAAE
|
|
1
|
+
{"version":3,"file":"elementar-rt-components-video-viewer.mjs","sources":["../../../projects/components/video-viewer/src/video-viewer/video-viewer.component.ts","../../../projects/components/video-viewer/src/video-viewer/video-viewer.component.html","../../../projects/components/video-viewer/elementar-rt-components-video-viewer.ts"],"sourcesContent":["import {\n Component, input, signal, computed, ChangeDetectionStrategy,\n booleanAttribute, output, HostListener\n} from '@angular/core';\nimport { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';\nimport { inject } from '@angular/core';\n\ntype VideoType = 'mp4' | 'youtube' | 'vimeo';\n\n@Component({\n selector: 'emr-video-viewer',\n standalone: true,\n templateUrl: './video-viewer.component.html',\n styleUrl: './video-viewer.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.data-open]': '_open() || null',\n }\n})\nexport class VideoViewerComponent {\n src = input('');\n poster = input('');\n open = input(false, { transform: booleanAttribute });\n\n closed = output<void>();\n\n private _sanitizer = inject(DomSanitizer);\n\n protected _open = signal(false);\n protected _playing = signal(false);\n protected _muted = signal(false);\n protected _volume = signal(1);\n protected _currentTime = signal(0);\n protected _duration = signal(0);\n protected _progress = computed(() =>\n this._duration() > 0 ? (this._currentTime() / this._duration()) * 100 : 0\n );\n\n protected _videoType = computed<VideoType>(() => {\n const s = this.src();\n if (/youtube\\.com|youtu\\.be/.test(s)) return 'youtube';\n if (/vimeo\\.com/.test(s)) return 'vimeo';\n return 'mp4';\n });\n\n protected _embedUrl = computed<SafeResourceUrl | null>(() => {\n const s = this.src();\n const type = this._videoType();\n if (type === 'youtube') {\n const id = s.match(/(?:v=|youtu\\.be\\/)([^&?/]+)/)?.[1];\n if (id) return this._sanitizer.bypassSecurityTrustResourceUrl(`https://www.youtube.com/embed/${id}?autoplay=1`);\n }\n if (type === 'vimeo') {\n const id = s.match(/vimeo\\.com\\/(\\d+)/)?.[1];\n if (id) return this._sanitizer.bypassSecurityTrustResourceUrl(`https://player.vimeo.com/video/${id}?autoplay=1`);\n }\n return null;\n });\n\n @HostListener('keydown', ['$event'])\n onKey(e: KeyboardEvent): void {\n if (!this._open()) return;\n if (e.code === 'Space') { e.preventDefault(); this._togglePlay(); }\n if (e.code === 'Escape') this._close();\n if (e.code === 'KeyF') this._fullscreen();\n }\n\n protected _show(): void { this._open.set(true); }\n protected _close(): void { this._open.set(false); this.closed.emit(); }\n\n protected _togglePlay(): void { this._playing.set(!this._playing()); }\n protected _toggleMute(): void { this._muted.set(!this._muted()); }\n\n protected _onTimeUpdate(e: Event): void {\n const v = e.target as HTMLVideoElement;\n this._currentTime.set(v.currentTime);\n this._duration.set(v.duration);\n }\n\n protected _onSeek(e: Event): void {\n const v = (e.target as HTMLInputElement);\n const video = document.querySelector('.vv-video') as HTMLVideoElement;\n if (video) video.currentTime = (parseFloat(v.value) / 100) * this._duration();\n }\n\n protected _fullscreen(): void {\n const el = document.querySelector('.vv-player') as HTMLElement;\n if (el?.requestFullscreen) el.requestFullscreen();\n }\n\n protected _formatTime(s: number): string {\n if (!s || isNaN(s)) return '0:00';\n const m = Math.floor(s / 60);\n const sec = Math.floor(s % 60);\n return `${m}:${sec.toString().padStart(2, '0')}`;\n }\n}\n","@if (_open()) {\n <div class=\"vv-backdrop\" (click)=\"_close()\">\n <div class=\"vv-player\" (click)=\"$event.stopPropagation()\">\n <button type=\"button\" class=\"vv-close\" (click)=\"_close()\" aria-label=\"Close\">×</button>\n\n @if (_videoType() === 'mp4') {\n <video\n class=\"vv-video\"\n [src]=\"src()\"\n [poster]=\"poster()\"\n [muted]=\"_muted()\"\n [volume]=\"_volume()\"\n [autoplay]=\"true\"\n (timeupdate)=\"_onTimeUpdate($event)\"\n (play)=\"_playing.set(true)\"\n (pause)=\"_playing.set(false)\"\n (click)=\"_togglePlay()\"\n ></video>\n <div class=\"vv-controls\">\n <button type=\"button\" class=\"vv-btn\" (click)=\"_togglePlay()\">\n @if (_playing()) { ⏸ } @else { ▶ }\n </button>\n <span class=\"vv-time\">{{ _formatTime(_currentTime()) }} / {{ _formatTime(_duration()) }}</span>\n <input\n type=\"range\" class=\"vv-seek\" min=\"0\" max=\"100\"\n [value]=\"_progress()\"\n (change)=\"_onSeek($event)\"\n />\n <button type=\"button\" class=\"vv-btn\" (click)=\"_toggleMute()\">\n @if (_muted()) { 🔇 } @else { 🔊 }\n </button>\n <button type=\"button\" class=\"vv-btn\" (click)=\"_fullscreen()\">⛶</button>\n </div>\n } @else {\n <iframe\n class=\"vv-embed\"\n [src]=\"_embedUrl()\"\n frameborder=\"0\"\n allowfullscreen\n allow=\"autoplay; fullscreen; picture-in-picture\"\n ></iframe>\n }\n </div>\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAmBa,oBAAoB,CAAA;AAC/B,IAAA,GAAG,GAAG,KAAK,CAAC,EAAE,0EAAC;AACf,IAAA,MAAM,GAAG,KAAK,CAAC,EAAE,6EAAC;IAClB,IAAI,GAAG,KAAK,CAAC,KAAK,4EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;IAEpD,MAAM,GAAG,MAAM,EAAQ;AAEf,IAAA,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC;AAE/B,IAAA,KAAK,GAAG,MAAM,CAAC,KAAK,4EAAC;AACrB,IAAA,QAAQ,GAAG,MAAM,CAAC,KAAK,+EAAC;AACxB,IAAA,MAAM,GAAG,MAAM,CAAC,KAAK,6EAAC;AACtB,IAAA,OAAO,GAAG,MAAM,CAAC,CAAC,8EAAC;AACnB,IAAA,YAAY,GAAG,MAAM,CAAC,CAAC,mFAAC;AACxB,IAAA,SAAS,GAAG,MAAM,CAAC,CAAC,gFAAC;AACrB,IAAA,SAAS,GAAG,QA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