@progress/kendo-angular-grid
Version:
Kendo UI Grid for Angular - high performance data grid with paging, filtering, virtualization, CRUD, and more.
51 lines (50 loc) • 1.91 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 { Inject, Injectable, InjectionToken, Optional } from '@angular/core';
import * as i0 from "@angular/core";
/**
* @hidden
*/
export const FOCUS_ROOT_ACTIVE = new InjectionToken('focus-root-initial-active-state');
/**
* @hidden
*/
export class FocusRoot {
active;
groups = new Set();
constructor(active = false) {
this.active = active;
}
registerGroup(group) {
if (this.active) {
this.groups.add(group);
}
}
unregisterGroup(group) {
if (this.active) {
this.groups.delete(group);
}
}
activate() {
if (this.active) {
this.groups.forEach(f => f.activate());
}
}
deactivate() {
if (this.active) {
this.groups.forEach(f => f.deactivate());
}
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FocusRoot, deps: [{ token: FOCUS_ROOT_ACTIVE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FocusRoot });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FocusRoot, decorators: [{
type: Injectable
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
type: Optional
}, {
type: Inject,
args: [FOCUS_ROOT_ACTIVE]
}] }]; } });