UNPKG

angular-table-searcher

Version:

This is an angular table searcher. it helps to use keys provided to search through a list of objects and if no keys are provided, it searches for the occurrence of the input value. it also makes request to endpoint if url is provided for backend search.

57 lines (56 loc) 1.79 kB
import { OnInit } from '@angular/core'; import { TableSearcherService } from './table-searcher.service'; import { EventsService } from './event.service'; import 'rxjs/add/observable/fromEvent'; import 'rxjs/add/operator/filter'; import 'rxjs/add/operator/debounceTime'; import 'rxjs/add/operator/switch'; import 'rxjs/add/operator/do'; import 'rxjs/add/observable/throw'; import 'rxjs/add/operator/map'; import { TableSearcherInterface } from "./table-searcher.interface"; export declare class TableSearcherComponent implements OnInit { private tableSearcherService; private eventsService; private static defaultAllSettings; allSettings: TableSearcherInterface<Object>; searching: boolean; private copyData; constructor(tableSearcherService: TableSearcherService, eventsService: EventsService); /** * This is used to set the border color for the div * @returns {{border-bottom: string}} */ setBorderColor(): { 'border-bottom': string; }; /** * This is used to style the button background * @returns {{background: string}} */ setButtonColor(): { 'background': string; }; /** * This is used to initialize searching on a table. * @param query */ doSearch(query: any): any; /** * This is used to search query strings * @param type * @param query */ private processSearching(type, query); /** * This is used to make a request to a backend api for searching. * @param query */ private doSearchBackend(query); /** * This is used to validate object passed down to table searcher. * @constructor */ ValidateSettings(): void; ngOnInit(): void; }