/**----------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ import { ElementRef, EventEmitter, NgZone, OnChanges, OnDestroy, OnInit, Renderer2, ViewContainerRef, TrackByFunction, SimpleChanges, ChangeDetectorRef, AfterViewInit } from '@angular/core'; import { LocalizationService } from '@progress/kendo-angular-l10n'; import { BehaviorSubject, Observable } from 'rxjs'; import { CheckedState } from './checkbox/checked-state'; import { DataChangeNotificationService } from './data-change-notification.service'; import { ExpandStateService } from './expand-state.service'; import { NavigationService } from './navigation/navigation.service'; import { NodeChildrenService } from './node-children.service'; import { NodeClickEvent } from './node-click-event.interface'; import { NodeTemplateDirective } from './node-template.directive'; import { LoadMoreButtonTemplateDirective } from './load-more/load-more-button-template.directive'; import { DataBoundComponent } from './data-bound-component'; import { SelectionService } from './selection/selection.service'; import { TreeItemLookup } from './treeitem-lookup.interface'; import { TreeItem } from './treeitem.interface'; import { TreeViewLookupService } from './treeview-lookup.service'; import { LoadMoreService } from './load-more/load-more.service'; import { TreeItemDropEvent, TreeItemAddRemoveArgs, EditService, TreeItemDragEvent, TreeItemDragStartEvent } from './drag-and-drop/models'; import { FilterState } from './filter-state.interface'; import { TreeViewSize } from './size'; import { SVGIcon } from '@progress/kendo-svg-icons'; import { TextBoxComponent } from '@progress/kendo-angular-inputs'; import * as i0 from "@angular/core"; /** * Represents the [Kendo UI TreeView component for Angular](slug:overview_treeview). * * @example * ```html * * * ``` * * @remarks * Supported children components are: {@link CustomMessagesComponent} */ export declare class TreeViewComponent implements OnChanges, OnInit, AfterViewInit, OnDestroy, DataBoundComponent { element: ElementRef; changeDetectorRef: ChangeDetectorRef; protected expandService: ExpandStateService; protected navigationService: NavigationService; protected nodeChildrenService: NodeChildrenService; protected selectionService: SelectionService; protected treeViewLookupService: TreeViewLookupService; private ngZone; private renderer; private dataChangeNotification; private localization; /** * @hidden */ searchIcon: SVGIcon; classNames: boolean; /** @hidden */ get direction(): string; /** * @hidden */ assetsContainer: ViewContainerRef; /** * @hidden */ searchbox: TextBoxComponent; /** * Sets the placeholder text for the filter input when the component is empty. */ filterInputPlaceholder: string; /** * Allows expanding disabled nodes. * * @default false */ expandDisabledNodes: boolean; /** * Enables or disables content animation. */ set animate(value: boolean); get animate(): boolean; /** @hidden */ fetchNodes: () => BehaviorSubject; /** * Fires when the children of the expanded node are loaded. */ childrenLoaded: EventEmitter<{ children: TreeItem[]; item: TreeItem; }>; /** * Fires when the component loses focus. */ onBlur: EventEmitter; /** * Fires when the component receives focus. */ onFocus: EventEmitter; /** * Fires when a TreeView node expands. */ expand: EventEmitter; /** * Fires when a TreeView node collapses. */ collapse: EventEmitter; /** * Fires just before node dragging starts ([see example](slug:draganddrop_treeview#setup)). This event is preventable. * Prevent the default event to stop drag hint creation and further drag events. */ nodeDragStart: EventEmitter; /** * Fires when an item is being dragged ([see example](slug:draganddrop_treeview#setup)). */ nodeDrag: EventEmitter; /** * Emits when the built-in filtering mechanism updates node visibility. * Used for the built-in auto-expand functionalities. Handle this event for custom implementations. */ filterStateChange: EventEmitter; /** * Fires on the target TreeView when a dragged item is dropped ([see example](slug:draganddrop_treeview#setup)). * * Prevent the default event (`event.preventDefault()`) or set the event as invalid (`event.setValid(false)`) to stop the `addItem` and `removeItem` events from triggering. * * Use `preventDefault` to handle add/remove manually, or `setValid(false)` to indicate an unsuccessful operation. While `setValid(false)` animates the drag clue to its original position, `event.preventDefault()` simply removes the clue. */ nodeDrop: EventEmitter; /** * Fires on the source TreeView after the dragged item is dropped ([see example](slug:draganddrop_treeview#setup)). */ nodeDragEnd: EventEmitter; /** * Fires after a dragged item is dropped ([see example](slug:draganddrop_treeview#setup)). Called on the TreeView where the item is dropped. */ addItem: EventEmitter; /** * Fires after a dragged item is dropped ([see example](slug:draganddrop_treeview#setup)). Called on the TreeView from where the item is dragged. */ removeItem: EventEmitter; /** * Fires when a TreeView node checkbox is selected ([see example](slug:checkboxes_treeview#toc-modifying-the-checked-state)). */ checkedChange: EventEmitter; /** * Fires when a TreeView node is selected ([see example](slug:selection_treeview#toc-modifying-the-selection)). */ selectionChange: EventEmitter; /** * Fires when the value of the built-in filter input changes. */ filterChange: EventEmitter; /** * Fires when a TreeView node is clicked. */ nodeClick: EventEmitter; /** * Fires when a TreeView node is double-clicked. */ nodeDblClick: EventEmitter; /** * @hidden * * Queries the template for a node template declaration. * Ignored if a `[nodeTemplate]` value is explicitly provided. */ nodeTemplateQuery: NodeTemplateDirective; /** * @hidden * * Defines the template for each node. * Takes precedence over nested templates in the TreeView tag. */ set nodeTemplateRef(template: NodeTemplateDirective); get nodeTemplateRef(): NodeTemplateDirective; /** * @hidden * * Queries the template for a load-more button template declaration. * Ignored if a `[loadMoreButtonTemplate]` value is explicitly provided. */ loadMoreButtonTemplateQuery: LoadMoreButtonTemplateDirective; /** * @hidden * * Defines the template for each load-more button. * Takes precedence over nested templates in the TreeView tag. */ set loadMoreButtonTemplateRef(template: LoadMoreButtonTemplateDirective); get loadMoreButtonTemplateRef(): LoadMoreButtonTemplateDirective; /** * A function that defines how to track node changes. * By default, the TreeView tracks the nodes by data item object reference. */ trackBy: TrackByFunction; /** * The nodes displayed by the TreeView ([see example](slug:databinding_treeview)). */ set nodes(value: any[]); get nodes(): any[]; /** * The fields of the data item that provide the text content of the nodes ([see example](slug:databinding_treeview)). * If set to an array, each level uses the field at the same index or the last item in the array. */ textField: string | string[]; /** * A function that determines if a node has child nodes ([see example](slug:databinding_treeview)). */ get hasChildren(): (item: object) => boolean; set hasChildren(callback: (item: object) => boolean); /** * A function that determines if a node is checked ([see example](slug:checkboxes_treeview#toc-modifying-the-checked-state)). */ get isChecked(): (item: object, index: string) => CheckedState; set isChecked(callback: (item: object, index: string) => CheckedState); /** * A function that determines if a node is disabled. */ isDisabled: (item: object, index: string) => boolean; /** * A function that determines if a node has a checkbox. If there is no checkbox, the node is not checkable and is excluded from built-in check functionality. */ hasCheckbox: (item: object, index: string) => boolean; /** * A function that determines if a node is expanded. */ get isExpanded(): (item: object, index: string) => boolean; set isExpanded(callback: (item: object, index: string) => boolean); /** * A function that determines if a node is selected ([see example](slug:selection_treeview#modifying-the-selection)). */ get isSelected(): (item: object, index: string) => boolean; set isSelected(callback: (item: object, index: string) => boolean); /** * A callback that determines whether a TreeView node should be rendered as hidden. Uses the `.k-hidden` utility class. Useful for custom filtering. * */ isVisible: (item: object, index: string) => boolean; /** * Enables keyboard navigation for the TreeView. * * @default true */ navigable: boolean; /** * A function that provides the child nodes for a given parent node ([see example](slug:databinding_treeview)). */ children: (item: object) => Observable; /** * Indicates whether child nodes are fetched on expand or initally prefetched. * * @default true */ loadOnDemand: boolean; /** * Renders the built-in input element for filtering. If `true`, emits the `filterChange` event that can be handled for [manual filtering](slug:filtering_treeview#toc-manual-filtering). * Built-in filtering is available with [`kendoTreeViewHierarchyBinding`](slug:api_treeview_hierarchybindingdirective) and [`kendoTreeViewFlatDataBinding`](slug:api_treeview_flatdatabindingdirective) directives. * * @default false */ filterable: boolean; /** * Sets the initial value of the built-in filter input. */ filter: string; /** * Sets the size of the component. * * @default 'medium' */ set size(size: TreeViewSize); get size(): TreeViewSize; get isActive(): boolean; /** * @hidden */ get treeviewId(): string; /** * Indicates whether only parent nodes should be disabled or their child nodes as well. * * @default false */ disableParentNodesOnly: boolean; /** * @hidden */ loadMoreService: LoadMoreService; /** * @hidden */ editService: EditService; checkboxes: boolean; expandIcons: boolean; selectable: boolean; touchActions: boolean; data: BehaviorSubject; private _animate; private _isChecked; private _isExpanded; private _isSelected; private _hasChildren; private _nodeTemplateRef; private _loadMoreButtonTemplateRef; private _size; private subscriptions; private domSubscriptions; private _nextId; constructor(element: ElementRef, changeDetectorRef: ChangeDetectorRef, expandService: ExpandStateService, navigationService: NavigationService, nodeChildrenService: NodeChildrenService, selectionService: SelectionService, treeViewLookupService: TreeViewLookupService, ngZone: NgZone, renderer: Renderer2, dataChangeNotification: DataChangeNotificationService, localization: LocalizationService); ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; ngOnInit(): void; ngAfterViewInit(): void; /** * Blurs the focused TreeView item. */ blur(): void; /** * Focuses the first focusable item in the TreeView if no hierarchical index is provided. */ focus(index?: string): void; /** * Returns the `TreeItemLookup` node for the specified index. * * @param index - The index of the node. * @returns {TreeItemLookup} - The looked up item. */ itemLookup(index: string): TreeItemLookup; /** * Calls the [`children`](slug:api_treeview_treeviewcomponent#children) function for every expanded node and fetches all rendered child nodes again. */ rebindChildren(): void; /** * Triggers the `expand` event for the provided node and shows its loading indicator. */ expandNode(item: any, index: string): void; /** * Triggers the `collapse` event for the provided node. */ collapseNode(item: any, index: string): void; /** * Gets the current page size of the data item's children collection ([see example](slug:loadmorebutton_treeview#managing-page-sizes)). * Pass `null` as `dataItem` to get the root collection's page size. * * @param dataItem {any} - The parent data item of the targeted collection. * @returns {number} - The page size of the data item's children collection. */ getNodePageSize(dataItem: any): number; /** * Sets the page size of the data item's children collection ([see example](slug:loadmorebutton_treeview#managing-page-sizes)). * Pass `null` as `dataItem` to set the root collection's page size. * * @param dataItem {any} - The parent data item of the targeted collection. * @param pageSize {number} - The new page size. */ setNodePageSize(dataItem: any, pageSize: number): void; /** * @hidden * * Clears the current TreeViewLookupService node map and re-registers all nodes anew. * Child nodes are acquired through the provided `children` callback. */ preloadChildNodes(): void; private attachDomHandlers; private focusHandler; private blurHandler; private clickHandler; private keydownHandler; private verifyLoadMoreService; private registerLookupItems; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }