/** * Copyright 2018 the original author or authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { OnInit, OnDestroy, EventEmitter } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { SelectionModel } from '@angular/cdk/collections'; import { PageEvent, MatCheckboxChange } from '@angular/material'; import { ObservableMedia } from '@angular/flex-layout'; import { Subscription } from 'rxjs/Subscription'; import { ApiTableService } from './api-table.service'; import { TableDataSource } from './dataSource/tableDataSource'; import { ObjectWithLinks, HateosPagedResponse, ModelMeta } from '../../common'; export declare class ApiTableComponent implements OnInit, OnDestroy { media: ObservableMedia; private activatedRoute; private router; private service; /** * All Subscriptions */ all$: Subscription; /** * Data table instance */ tableDataSource: TableDataSource; /** * Collumns in the model meta */ columns: string[]; /** * All columns including select and edit */ allColumns: string[]; modelMeta: ModelMeta; tableResponse: HateosPagedResponse; data: Object[]; url: string; selector: string; selectorName: string; searchClicked: boolean; /** * Selected model name */ model: string; /** * Table to have multiple selection */ multiSelect: boolean; /** * Fire on selecting and item or empty one to indicate a emty item */ select: EventEmitter; /** * Selected Items */ selected: string[]; selectedChange: EventEmitter; /** * Selection model */ selection: SelectionModel; constructor(media: ObservableMedia, activatedRoute: ActivatedRoute, router: Router, service: ApiTableService); ngOnInit(): void; private handleMetaModel(meta); private handdleDataResponse(tableResponse); /** * Fire when add new item clicked */ addNew(): void; /** * Fire When existing item it clicked * @param item */ editRow(item: ObjectWithLinks): void; pageEvent(event: PageEvent): void; isAllSelected(): boolean; delete(item: ObjectWithLinks): void; deleteAll(): void; selectionChange(event: MatCheckboxChange): void; /** Selects all rows if they are not all selected; otherwise clear selection. */ masterToggle(): void; ngOnDestroy(): void; }