@ux-aspects/ux-aspects
Version:
Open source user interface framework for building modern, responsive, mobile big data applications
33 lines (32 loc) • 1.44 kB
TypeScript
import { OnDestroy } from '@angular/core';
import { BehaviorSubject } from 'rxjs';
import { TreeGridItem } from './tree-grid-item.interface';
import { TreeGridLoadFunction } from './tree-grid-load-function.type';
import * as i0 from "@angular/core";
export declare class TreeGridService implements OnDestroy {
/** The raw table data */
data$: BehaviorSubject<TreeGridItem[]>;
/** The flattened table data */
rows$: BehaviorSubject<TreeGridItem[]>;
/** The function to load child items */
loadChildren: TreeGridLoadFunction;
/** Ensure we destroy all observables correctly */
private readonly _onDestroy;
constructor();
/** Unsubscribe from all observables */
ngOnDestroy(): void;
/** Set the expanded state of a row */
setExpanded(item: TreeGridItem, expanded: boolean): Promise<void>;
/** A function to flatten tree data */
private getFlattenedTree;
/** Load any children dynamically */
private getChildren;
/** We want to support an array, a promise and an observable. This will return all types as a promise */
private getNormalizedChildren;
/** Insert the children into the flattened tree at the correct location */
private insertChildren;
/** Remove all rows from the flattened tree */
private removeChildren;
static ɵfac: i0.ɵɵFactoryDeclaration<TreeGridService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<TreeGridService>;
}