igniteui-webcomponents
Version:
Ignite UI for Web Components is a complete library of UI components, giving you the ability to build modern web applications using encapsulation and the concept of reusable components in a dependency-free approach.
56 lines (55 loc) • 2.52 kB
TypeScript
import type IgcTreeItemComponent from './tree-item.js';
import type IgcTreeComponent from './tree.js';
export declare class IgcTreeSelectionService {
private tree;
private itemSelection;
private indeterminateItems;
private itemsToBeSelected;
private itemsToBeIndeterminate;
constructor(tree: IgcTreeComponent);
/** Select range from last selected item to the current specified item. */
selectMultipleItems(item: IgcTreeItemComponent): void;
/** Select the specified item and emit event. */
selectItem(item: IgcTreeItemComponent): void;
/** Deselect the specified item and emit event. */
deselectItem(item: IgcTreeItemComponent): void;
/** Clears item selection */
clearItemsSelection(): void;
isItemSelected(item: IgcTreeItemComponent): boolean;
isItemIndeterminate(item: IgcTreeItemComponent): boolean;
/** Called on item`s disconnectedCallback */
ensureStateOnItemDelete(item: IgcTreeItemComponent): void;
/** Retrigger the selection state of the item. */
retriggerItemState(item: IgcTreeItemComponent): void;
private emitItemSelectionEvent;
/** Select specified items. No event is emitted. */
selectItemsWithNoEvent(items: IgcTreeItemComponent[]): void;
/** Deselect specified items. No event is emitted. */
deselectItemsWithNoEvent(items?: IgcTreeItemComponent[], onDelete?: boolean): void;
private emitCascadeItemSelectionEvent;
private cascadeSelectItemsWithNoEvent;
private cascadeDeselectItemsWithNoEvent;
/**
* populates the itemsToBeSelected and itemsToBeIndeterminate sets
* with the items which will be eventually in selected/indeterminate state
*/
private calculateItemsNewSelectionState;
/** Ensures proper selection state for all predescessors and descendants during a selection event */
private cascadeSelectionState;
/**
* recursively handle the selection state of the direct and indirect parents
*/
private handleParentSelectionState;
/**
* Handle the selection state of a given item based the selection states of its direct children
*/
private handleItemSelectionState;
/** Emits the `selectedChange` event for each item affected by the selection */
private updateItemsState;
/** Returns array of the selected items. */
private getSelectedItems;
/** Returns array of the items in indeterminate state. */
private getIndeterminateItems;
private areEqualCollections;
private selectDeselectItem;
}