UNPKG

2.7 kBTypeScriptView Raw
1import { Observable } from 'rxjs';
2import { NbCollectionViewer } from '../../cdk/collections/collection-viewer';
3import { NbDataSource } from '../../cdk/table/data-source';
4import { NbSortable, NbSortRequest } from '../tree-grid-sort.component';
5import { NbTreeGridDataService } from './tree-grid-data.service';
6import { NbTreeGridFilterService } from './tree-grid-filter.service';
7import { NbTreeGridSortService } from './tree-grid-sort.service';
8import { NbGetters, NbTreeGridPresentationNode } from './tree-grid.model';
9import { NbToggleOptions, NbTreeGridService } from './tree-grid.service';
10import * as i0 from "@angular/core";
11export interface NbFilterable {
12 filter(filterRequest: string): any;
13}
14export declare class NbTreeGridDataSource<T> extends NbDataSource<NbTreeGridPresentationNode<T>> implements NbSortable, NbFilterable {
15 private sortService;
16 private filterService;
17 private treeGridService;
18 private treeGridDataService;
19 /** Stream that emits when a new data array is set on the data source. */
20 private data;
21 /** Stream emitting render data to the table (depends on ordered data changes). */
22 private readonly renderData;
23 private readonly filterRequest;
24 private readonly sortRequest;
25 constructor(sortService: NbTreeGridSortService<T>, filterService: NbTreeGridFilterService<T>, treeGridService: NbTreeGridService<T>, treeGridDataService: NbTreeGridDataService<T>);
26 setData<N>(data: N[], customGetters?: NbGetters<N, T>): void;
27 connect(collectionViewer: NbCollectionViewer): Observable<NbTreeGridPresentationNode<T>[] | ReadonlyArray<NbTreeGridPresentationNode<T>>>;
28 disconnect(collectionViewer: NbCollectionViewer): void;
29 expand(row: T): void;
30 collapse(row: T): void;
31 toggle(row: T, options?: NbToggleOptions): void;
32 toggleByIndex(dataIndex: number, options?: NbToggleOptions): void;
33 getLevel(rowIndex: number): number;
34 sort(sortRequest: NbSortRequest): void;
35 filter(searchQuery: string): void;
36 protected updateChangeSubscription(): void;
37 private filterData;
38 private sortData;
39}
40export declare class NbTreeGridDataSourceBuilder<T> {
41 private filterService;
42 private sortService;
43 private treeGridService;
44 private treeGridDataService;
45 constructor(filterService: NbTreeGridFilterService<T>, sortService: NbTreeGridSortService<T>, treeGridService: NbTreeGridService<T>, treeGridDataService: NbTreeGridDataService<T>);
46 create<N>(data: N[], customGetters?: NbGetters<N, T>): NbTreeGridDataSource<T>;
47 static ɵfac: i0.ɵɵFactoryDeclaration<NbTreeGridDataSourceBuilder<any>, never>;
48 static ɵprov: i0.ɵɵInjectableDeclaration<NbTreeGridDataSourceBuilder<any>>;
49}