@progress/kendo-angular-grid
Version:
Kendo UI Grid for Angular - high performance data grid with paging, filtering, virtualization, CRUD, and more.
68 lines (67 loc) • 3.27 kB
JavaScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { ColumnMenuItemDirective } from './column-menu-item.directive';
import { Component, ContentChildren, Inject, NgZone, QueryList } from '@angular/core';
import { take } from 'rxjs/operators';
import { ColumnMenuService } from './column-menu.service';
import { DropDownListComponent } from '@progress/kendo-angular-dropdowns';
import * as i0 from "@angular/core";
import * as i1 from "./column-menu.service";
/**
* @hidden
*/
export class ColumnMenuContainerComponent {
service;
ngZone;
columnMenuItems;
templateMenuItems = [];
constructor(service, ngZone) {
this.service = service;
this.ngZone = ngZone;
service.columnMenuContainer = this;
}
ngAfterViewInit() {
if (this.columnMenuItems.length) {
this.columnMenuItems.first.isFirst = true;
this.columnMenuItems.last.isLast = true;
}
else if (this.templateMenuItems.length) {
this.templateMenuItems[0].isFirst = true;
this.templateMenuItems[this.templateMenuItems.length - 1].isLast = true;
}
else {
return;
}
this.ngZone.onStable.pipe(take(1)).subscribe(() => {
const firstFocusable = this.service.menuTabbingService.firstFocusable;
if (firstFocusable instanceof DropDownListComponent) {
firstFocusable.wrapper.nativeElement.focus({ preventScroll: true });
}
else {
firstFocusable?.focus({ preventScroll: true });
}
});
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ColumnMenuContainerComponent, deps: [{ token: i1.ColumnMenuService }, { token: NgZone }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", type: ColumnMenuContainerComponent, isStandalone: true, selector: "kendo-grid-columnmenu-container", queries: [{ propertyName: "columnMenuItems", predicate: ColumnMenuItemDirective, descendants: true }], ngImport: i0, template: `
<ng-content></ng-content>
`, isInline: true });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ColumnMenuContainerComponent, decorators: [{
type: Component,
args: [{
selector: 'kendo-grid-columnmenu-container',
template: `
<ng-content></ng-content>
`,
standalone: true
}]
}], ctorParameters: () => [{ type: i1.ColumnMenuService }, { type: i0.NgZone, decorators: [{
type: Inject,
args: [NgZone]
}] }], propDecorators: { columnMenuItems: [{
type: ContentChildren,
args: [ColumnMenuItemDirective, { descendants: true }]
}] } });