UNPKG

dfx-bootstrap-table

Version:

Angular table CDK implementation for Bootstrap with filtering, sorting and pagination.

93 lines (92 loc) 4.4 kB
/** * @license * Original work Copyright Google LLC All Rights Reserved. * Modified work Copyright DatePoll-Systems * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { EventEmitter, InjectionToken, OnChanges, OnDestroy, OnInit } from '@angular/core'; import { Observable, Subject } from 'rxjs'; import { SortDirection } from './sort-direction'; import * as i0 from "@angular/core"; /** Position of the arrow that displays when sorted. */ export type SortHeaderArrowPosition = 'before' | 'after'; /** Interface for a directive that holds sorting state consumed by `NgbSortHeader`. */ export interface NgbSortable { /** The id of the column being sorted. */ id: string; /** Starting sort direction. */ start: SortDirection; /** Whether to disable clearing the sorting state. */ disableClear: boolean; } /** The current sort state. */ export interface Sort { /** The id of the column being sorted. */ active: string; /** The sort direction. */ direction: SortDirection; } /** Default options for `ngb-sort`. */ export interface NgbSortDefaultOptions { /** Whether to disable clearing the sorting state. */ disableClear?: boolean; /** Position of the arrow that displays when sorted. */ arrowPosition?: SortHeaderArrowPosition; } /** Injection token to be used to override the default options for `ngb-sort`. */ export declare const NGB_SORT_DEFAULT_OPTIONS: InjectionToken<NgbSortDefaultOptions>; /** Container for NgbSortable to manage the sort state and provide default sort parameters. */ export declare class NgbSort implements OnChanges, OnDestroy, OnInit { private _defaultOptions?; private _initializedStream; /** Collection of all registered sortables that this directive manages. */ sortables: Map<string, NgbSortable>; /** Used to notify any child components listening to state changes. */ readonly _stateChanges: Subject<void>; /** The id of the most recently sorted NgbSortable. */ active: string; /** * The direction to set when an NgbSortable is initially sorted. * May be overriden by the NgbSortable's sort start. */ start: SortDirection; /** The sort direction of the currently active NgbSortable. */ get direction(): SortDirection; set direction(direction: SortDirection); private _direction; /** * Whether to disable the user from clearing the sort by finishing the sort direction cycle. * May be overriden by the NgbSortable's disable clear input. */ disableClear: boolean; /** Whether the sortable is disabled. */ disabled: boolean; /** Event emitted when the user changes either the active sort or sort direction. */ readonly sortChange: EventEmitter<Sort>; /** Emits when the paginator is initialized. */ initialized: Observable<void>; constructor(_defaultOptions?: NgbSortDefaultOptions | undefined); /** * Register function to be used by the contained NgbSortables. Adds the NgbSortable to the * collection of NgbSortables. */ register(sortable: NgbSortable): void; /** * Unregister function to be used by the contained NgbSortable. Removes the NgbSortable from the * collection of contained NgbSortable. */ deregister(sortable: NgbSortable): void; /** Sets the active sort id and determines the new sort direction. */ sort(sortable: NgbSortable): void; /** Returns the next sort direction of the active sortable, checking for potential overrides. */ getNextSortDirection(sortable: NgbSortable): SortDirection; ngOnInit(): void; ngOnChanges(): void; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration<NgbSort, [{ optional: true; }]>; static ɵdir: i0.ɵɵDirectiveDeclaration<NgbSort, "[ngb-sort]", ["ngbSort"], { "active": { "alias": "ngbSortActive"; "required": false; }; "start": { "alias": "ngbSortStart"; "required": false; }; "direction": { "alias": "ngbSortDirection"; "required": false; }; "disableClear": { "alias": "ngbSortDisableClear"; "required": false; }; "disabled": { "alias": "ngbSortDisabled"; "required": false; }; }, { "sortChange": "ngbSortChange"; }, never, never, true, never>; static ngAcceptInputType_disableClear: unknown; static ngAcceptInputType_disabled: unknown; }