UNPKG

2.48 kBTypeScriptView Raw
1/// <reference types="angular" />
2/// <reference types="angular-mocks" />
3/**
4 * ngTable: Table + Angular JS
5 *
6 * @author Vitalii Savchuk <esvit666@gmail.com>
7 * @url https://github.com/esvit/ng-table/
8 * @license New BSD License <http://creativecommons.org/licenses/BSD/>
9 */
10import { IAttributes, IAugmentedJQuery, ICompileService, IDocumentService, IParseService, IScope, ITimeoutService } from 'angular';
11import { DataResults, GroupedDataResults, NgTableParams, NgTableEventsChannel, IPageButton } from '../core';
12import { IColumnDef, IDynamicTableColDef, ITableInputAttributes } from './public-interfaces';
13import { NgTableColumn } from './ngTableColumn';
14/**
15 * @private
16 */
17export interface ITableScope<T> extends IScope {
18 $columns: IColumnDef[];
19 $loading: boolean;
20 $filterRow: {
21 disabled: boolean;
22 };
23 $data?: DataResults<T>;
24 $groups?: GroupedDataResults<T>;
25 $groupRow: {
26 show: boolean;
27 };
28 show_filter: boolean;
29 pages: IPageButton[];
30 templates: {
31 header: string;
32 pagination: string;
33 };
34 params: NgTableParams<T>;
35}
36/**
37 * The controller for the {@link ngTable ngTable} and {@link ngTableDynamic ngTableDynamic} directives
38 */
39export declare class NgTableController<TParams, TCol extends IColumnDef | IDynamicTableColDef> {
40 private $scope;
41 private $parse;
42 private $compile;
43 private $attrs;
44 private $element;
45 private $document;
46 private ngTableColumn;
47 private ngTableEventsChannel;
48 static $inject: string[];
49 private delayFilter;
50 private readonly hasVisibleFilterColumn;
51 constructor($scope: ITableScope<TParams>, $timeout: ITimeoutService, $parse: IParseService, $compile: ICompileService, $attrs: IAttributes & ITableInputAttributes, $element: IAugmentedJQuery, $document: IDocumentService, ngTableColumn: NgTableColumn<TCol>, ngTableEventsChannel: NgTableEventsChannel);
52 private onDataReloadStatusChange(newStatus);
53 compileDirectiveTemplates(): void;
54 loadFilterData($columns: IColumnDef[]): void;
55 buildColumns(columns: TCol[]): IColumnDef[];
56 parseNgTableDynamicExpr(attr: string): {
57 tableParams: string;
58 columns: string;
59 };
60 setupBindingsToInternalScope(tableParamsExpr: string): void;
61 private setupFilterRowBindingsToInternalScope();
62 private setupGroupRowBindingsToInternalScope();
63 private getVisibleColumns();
64 private subscribeToTableEvents();
65 private some<T>(array, predicate);
66}