mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
[ACS-9266][ACS-9234] Make notification and user menu accessible with keyboard (#10647)
* [ACS-9266][ACS-9234] Make notification and user menu accessible with keyboard * [ACS-9266] cr fix * [ACS-9266] cr fixes * [ACS-9266] fix eslint * [ACS-9266] fix circular dependency * [ACS-9266] cr fix
This commit is contained in:
committed by
GitHub
parent
c8aa27a87b
commit
e4feb68381
@@ -15,9 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, Input, ComponentRef, ViewChild, ViewContainerRef, OnDestroy, OnChanges, SimpleChanges } from '@angular/core';
|
||||
import { Component, Input, ComponentRef, ViewChild, ViewContainerRef, OnDestroy, OnChanges, SimpleChanges, AfterViewInit } from '@angular/core';
|
||||
import { ExtensionService } from '../../services/extension.service';
|
||||
import { ExtensionComponent } from '../../services/component-register.service';
|
||||
import { MatMenuItem } from '@angular/material/menu';
|
||||
|
||||
// cSpell:words lifecycle
|
||||
@Component({
|
||||
@@ -25,7 +26,7 @@ import { ExtensionComponent } from '../../services/component-register.service';
|
||||
standalone: true,
|
||||
template: `<div #content></div>`
|
||||
})
|
||||
export class DynamicExtensionComponent implements OnChanges, OnDestroy {
|
||||
export class DynamicExtensionComponent implements OnChanges, OnDestroy, AfterViewInit {
|
||||
@ViewChild('content', { read: ViewContainerRef, static: true })
|
||||
content: ViewContainerRef;
|
||||
|
||||
@@ -35,6 +36,9 @@ export class DynamicExtensionComponent implements OnChanges, OnDestroy {
|
||||
/** Data for the dynamically-loaded component instance. */
|
||||
@Input() data: any;
|
||||
|
||||
/** Provides the menu item of dynamically-loaded component instance. */
|
||||
menuItem: MatMenuItem;
|
||||
|
||||
private componentRef: ComponentRef<ExtensionComponent>;
|
||||
private loaded: boolean = false;
|
||||
|
||||
@@ -61,6 +65,10 @@ export class DynamicExtensionComponent implements OnChanges, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
this.menuItem = this.componentRef?.instance?.menuItem;
|
||||
}
|
||||
|
||||
private loadComponent() {
|
||||
const componentType = this.extensions.getComponentById<ExtensionComponent>(this.id);
|
||||
if (componentType) {
|
||||
|
Reference in New Issue
Block a user