@alfresco/aca-shared 7.2.0-18833161813 → 7.2.0-18837796869

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.
@@ -2328,6 +2328,7 @@ class ToolbarMenuComponent {
2328
2328
  matTrigger;
2329
2329
  menu;
2330
2330
  toolbarMenuItems;
2331
+ dynamicExtensionComponents;
2331
2332
  data;
2332
2333
  type = 'default';
2333
2334
  handleKeydownEscape() {
@@ -2337,10 +2338,27 @@ class ToolbarMenuComponent {
2337
2338
  this.type = this.data?.menuType || 'default';
2338
2339
  }
2339
2340
  ngAfterViewInit() {
2341
+ const dynamicComponentMap = new Map(this.dynamicExtensionComponents.map((component) => [component.id, component]));
2342
+ const toolbarItemMap = new Map();
2343
+ this.toolbarMenuItems.forEach((item) => {
2344
+ if (item.actionRef?.id) {
2345
+ toolbarItemMap.set(item.actionRef.id, item);
2346
+ }
2347
+ });
2340
2348
  const menuItems = [];
2341
- this.toolbarMenuItems.forEach((toolbarMenuItem) => {
2342
- if (toolbarMenuItem.menuItem !== undefined) {
2343
- menuItems.push(toolbarMenuItem.menuItem);
2349
+ this.actionRef.children?.forEach((child) => {
2350
+ if (child.type === ContentActionType.custom) {
2351
+ const componentId = child.component || child.id;
2352
+ const component = dynamicComponentMap.get(componentId);
2353
+ if (component?.menuItem) {
2354
+ menuItems.push(component.menuItem);
2355
+ }
2356
+ }
2357
+ else {
2358
+ const toolbarItem = toolbarItemMap.get(child.id);
2359
+ if (toolbarItem?.menuItem) {
2360
+ menuItems.push(toolbarItem.menuItem);
2361
+ }
2344
2362
  }
2345
2363
  });
2346
2364
  const menuItemsQueryList = new QueryList();
@@ -2352,7 +2370,7 @@ class ToolbarMenuComponent {
2352
2370
  return obj.id;
2353
2371
  }
2354
2372
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: ToolbarMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2355
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.6", type: ToolbarMenuComponent, isStandalone: true, selector: "app-toolbar-menu", inputs: { actionRef: "actionRef", color: "color", data: "data" }, host: { listeners: { "document:keydown.Escape": "handleKeydownEscape()" }, classAttribute: "app-toolbar-menu" }, viewQueries: [{ propertyName: "matTrigger", first: true, predicate: ["matTrigger"], descendants: true }, { propertyName: "menu", first: true, predicate: MatMenu, descendants: true }, { propertyName: "toolbarMenuItems", predicate: ToolbarMenuItemComponent, descendants: true }], ngImport: i0, template: "<ng-container [ngSwitch]=\"type\">\n <ng-container *ngSwitchCase=\"'button'\">\n <button\n [id]=\"actionRef.id\"\n [color]=\"data?.color || color\"\n mat-button\n [attr.aria-label]=\"actionRef.description || actionRef.title | translate\"\n [attr.title]=\"actionRef.description || actionRef.title | translate\"\n [matMenuTriggerFor]=\"menu\"\n [disabled]=\"actionRef.disabled\"\n #matTrigger=\"matMenuTrigger\"\n >\n <span *ngIf=\"actionRef.title\">{{ actionRef.title | translate }}</span>\n </button>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'flat-button'\">\n <button\n [id]=\"actionRef.id\"\n [color]=\"data?.color || color\"\n mat-flat-button\n [attr.aria-label]=\"actionRef.description || actionRef.title | translate\"\n [attr.title]=\"actionRef.description || actionRef.title | translate\"\n [matMenuTriggerFor]=\"menu\"\n [disabled]=\"actionRef.disabled\"\n #matTrigger=\"matMenuTrigger\"\n >\n <span *ngIf=\"actionRef.title\">{{ actionRef.title | translate }}</span>\n </button>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'stroked-button'\">\n <button\n [id]=\"actionRef.id\"\n [color]=\"data?.color || color\"\n mat-stroked-button\n [attr.aria-label]=\"actionRef.description || actionRef.title | translate\"\n [attr.title]=\"actionRef.description || actionRef.title | translate\"\n [matMenuTriggerFor]=\"menu\"\n [disabled]=\"actionRef.disabled\"\n #matTrigger=\"matMenuTrigger\"\n >\n <span *ngIf=\"actionRef.title\">{{ actionRef.title | translate }}</span>\n </button>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <button\n [id]=\"actionRef.id\"\n [color]=\"data?.color || color\"\n mat-icon-button\n [attr.aria-label]=\"actionRef.description || actionRef.title | translate\"\n [attr.title]=\"actionRef.description || actionRef.title | translate\"\n [matMenuTriggerFor]=\"menu\"\n [disabled]=\"actionRef.disabled\"\n #matTrigger=\"matMenuTrigger\"\n >\n <adf-icon *ngIf=\"actionRef.icon\" [value]=\"actionRef.icon\" />\n </button>\n </ng-container>\n</ng-container>\n\n<mat-menu #menu=\"matMenu\" [overlapTrigger]=\"false\" [xPosition]=\"'before'\">\n <ng-container *ngFor=\"let child of actionRef.children; trackBy: trackByActionId\">\n <ng-container [ngSwitch]=\"child.type\">\n <ng-container *ngSwitchCase=\"'custom'\">\n <adf-dynamic-component [id]=\"child.component\" [data]=\"child.data\" />\n </ng-container>\n <ng-container *ngSwitchDefault>\n <app-toolbar-menu-item [actionRef]=\"child\" [menuId]=\"actionRef.id\" />\n </ng-container>\n </ng-container>\n </ng-container>\n</mat-menu>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3$2.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i3$3.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "directive", type: i3$3.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: ToolbarMenuItemComponent, selector: "app-toolbar-menu-item", inputs: ["actionRef", "menuId"] }, { kind: "component", type: IconComponent, selector: "adf-icon", inputs: ["color", "fontSet", "value"] }, { kind: "component", type: DynamicExtensionComponent, selector: "adf-dynamic-component", inputs: ["id", "data"] }], encapsulation: i0.ViewEncapsulation.None });
2373
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.6", type: ToolbarMenuComponent, isStandalone: true, selector: "app-toolbar-menu", inputs: { actionRef: "actionRef", color: "color", data: "data" }, host: { listeners: { "document:keydown.Escape": "handleKeydownEscape()" }, classAttribute: "app-toolbar-menu" }, viewQueries: [{ propertyName: "matTrigger", first: true, predicate: ["matTrigger"], descendants: true }, { propertyName: "menu", first: true, predicate: MatMenu, descendants: true }, { propertyName: "toolbarMenuItems", predicate: ToolbarMenuItemComponent, descendants: true }, { propertyName: "dynamicExtensionComponents", predicate: DynamicExtensionComponent, descendants: true }], ngImport: i0, template: "<ng-container [ngSwitch]=\"type\">\n <ng-container *ngSwitchCase=\"'button'\">\n <button\n [id]=\"actionRef.id\"\n [color]=\"data?.color || color\"\n mat-button\n [attr.aria-label]=\"actionRef.description || actionRef.title | translate\"\n [attr.title]=\"actionRef.description || actionRef.title | translate\"\n [matMenuTriggerFor]=\"menu\"\n [disabled]=\"actionRef.disabled\"\n #matTrigger=\"matMenuTrigger\"\n >\n <span *ngIf=\"actionRef.title\">{{ actionRef.title | translate }}</span>\n </button>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'flat-button'\">\n <button\n [id]=\"actionRef.id\"\n [color]=\"data?.color || color\"\n mat-flat-button\n [attr.aria-label]=\"actionRef.description || actionRef.title | translate\"\n [attr.title]=\"actionRef.description || actionRef.title | translate\"\n [matMenuTriggerFor]=\"menu\"\n [disabled]=\"actionRef.disabled\"\n #matTrigger=\"matMenuTrigger\"\n >\n <span *ngIf=\"actionRef.title\">{{ actionRef.title | translate }}</span>\n </button>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'stroked-button'\">\n <button\n [id]=\"actionRef.id\"\n [color]=\"data?.color || color\"\n mat-stroked-button\n [attr.aria-label]=\"actionRef.description || actionRef.title | translate\"\n [attr.title]=\"actionRef.description || actionRef.title | translate\"\n [matMenuTriggerFor]=\"menu\"\n [disabled]=\"actionRef.disabled\"\n #matTrigger=\"matMenuTrigger\"\n >\n <span *ngIf=\"actionRef.title\">{{ actionRef.title | translate }}</span>\n </button>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <button\n [id]=\"actionRef.id\"\n [color]=\"data?.color || color\"\n mat-icon-button\n [attr.aria-label]=\"actionRef.description || actionRef.title | translate\"\n [attr.title]=\"actionRef.description || actionRef.title | translate\"\n [matMenuTriggerFor]=\"menu\"\n [disabled]=\"actionRef.disabled\"\n #matTrigger=\"matMenuTrigger\"\n >\n <adf-icon *ngIf=\"actionRef.icon\" [value]=\"actionRef.icon\" />\n </button>\n </ng-container>\n</ng-container>\n\n<mat-menu #menu=\"matMenu\" [overlapTrigger]=\"false\" [xPosition]=\"'before'\">\n <ng-container *ngFor=\"let child of actionRef.children; trackBy: trackByActionId\">\n <ng-container [ngSwitch]=\"child.type\">\n <ng-container *ngSwitchCase=\"'custom'\">\n <adf-dynamic-component [id]=\"child.component\" [data]=\"child.data\" />\n </ng-container>\n <ng-container *ngSwitchDefault>\n <app-toolbar-menu-item [actionRef]=\"child\" [menuId]=\"actionRef.id\" />\n </ng-container>\n </ng-container>\n </ng-container>\n</mat-menu>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3$2.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i3$3.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "directive", type: i3$3.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: ToolbarMenuItemComponent, selector: "app-toolbar-menu-item", inputs: ["actionRef", "menuId"] }, { kind: "component", type: IconComponent, selector: "adf-icon", inputs: ["color", "fontSet", "value"] }, { kind: "component", type: DynamicExtensionComponent, selector: "adf-dynamic-component", inputs: ["id", "data"] }], encapsulation: i0.ViewEncapsulation.None });
2356
2374
  }
2357
2375
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: ToolbarMenuComponent, decorators: [{
2358
2376
  type: Component,
@@ -2370,6 +2388,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImpor
2370
2388
  }], toolbarMenuItems: [{
2371
2389
  type: ViewChildren,
2372
2390
  args: [ToolbarMenuItemComponent]
2391
+ }], dynamicExtensionComponents: [{
2392
+ type: ViewChildren,
2393
+ args: [DynamicExtensionComponent]
2373
2394
  }], data: [{
2374
2395
  type: Input
2375
2396
  }], handleKeydownEscape: [{