@progress/kendo-angular-treeview
Version:
Kendo UI TreeView for Angular
88 lines (87 loc) • 3.57 kB
TypeScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { EventEmitter, OnDestroy, OnChanges, NgZone } from '@angular/core';
import { TreeViewComponent } from './treeview.component';
import { CheckableSettings } from './checkable-settings';
import { CheckedState } from './checkbox/checked-state';
import { Subscription } from 'rxjs';
import { TreeItem } from './treeitem.interface';
import { TreeItemLookup } from './treeitem-lookup.interface';
import * as i0 from "@angular/core";
/**
* Represents a directive that manages the in-memory checked state of the TreeView node
* ([see example](slug:checkboxes_treeview)).
*
* @example
* ```html
* <kendo-treeview
* kendoTreeViewCheckable
* checkBy="id"
* [(checkedKeys)]="checkedKeys"
* [nodes]="data">
* </kendo-treeview>
* ```
*
* @remarks
* Applied to: {@link TreeViewComponent}
*/
export declare class CheckDirective implements OnChanges, OnDestroy {
protected treeView: TreeViewComponent;
private zone;
/**
* @hidden
*/
set isChecked(value: (item: object, index: string) => CheckedState);
/**
* Defines the item key stored in the `checkedKeys` collection.
*/
checkKey: string | ((context: TreeItem) => any);
/**
* Defines the collection that stores the checked keys
* ([see example](slug:checkboxes_treeview)).
*/
checkedKeys: any[];
/**
* Defines the checkable settings
* ([see example](slug:checkboxes_treeview#setup)).
* If you do not provide a value, the default [`CheckableSettings`](slug:api_treeview_checkablesettings) apply.
*/
checkable: boolean | CheckableSettings | string;
/**
* Fires when the `checkedKeys` collection updates.
*/
checkedKeysChange: EventEmitter<any[]>;
protected subscriptions: Subscription;
private get options();
private checkActions;
/**
* Reflects the internal `checkedKeys` state.
*/
private state;
private clickSubscription;
/**
* Holds the last emitted `checkedKeys` collection.
*/
private lastChange;
constructor(treeView: TreeViewComponent, zone: NgZone);
ngOnChanges(changes: any): void;
ngOnDestroy(): void;
protected isItemChecked(dataItem: any, index: string): CheckedState;
protected isIndexChecked(index: string): CheckedState;
protected itemKey(item: TreeItem): any;
protected check(e: any): void;
protected checkSingle(node: any): void;
protected checkMultiple(node: TreeItemLookup): void;
protected toggleCheckOnClick(): void;
private unsubscribeClick;
private checkNode;
private uncheckChildren;
private checkParents;
private allChildrenSelected;
private notify;
private addCheckedItemsChildren;
static ɵfac: i0.ɵɵFactoryDeclaration<CheckDirective, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<CheckDirective, "[kendoTreeViewCheckable]", never, { "isChecked": { "alias": "isChecked"; "required": false; }; "checkKey": { "alias": "checkBy"; "required": false; }; "checkedKeys": { "alias": "checkedKeys"; "required": false; }; "checkable": { "alias": "kendoTreeViewCheckable"; "required": false; }; }, { "checkedKeysChange": "checkedKeysChange"; }, never, never, true, never>;
}