@ux-aspects/ux-aspects
Version:
Open source user interface framework for building modern, responsive, mobile big data applications
38 lines (37 loc) • 1.82 kB
TypeScript
import { OnDestroy, TemplateRef } from '@angular/core';
import { Subject } from 'rxjs';
import * as i0 from "@angular/core";
export declare class ColumnSortingDirective implements OnDestroy {
/** If set to true the column will sort by only this column, removing sorting from all others. */
singleSort: boolean;
/** Provide a custom template for the sort indicator */
sortIndicator: TemplateRef<ColumnSortingIndicatorContext>;
/** Emit the current sort state for all columns within the table */
events: Subject<readonly ColumnSortingOrder[]>;
/** Store the current sort state for all columns within the table */
order: ReadonlyArray<ColumnSortingOrder>;
ngOnDestroy(): void;
/** Toggle the sorting state of a column */
toggleColumn(sorting: ColumnSortingOrder): ReadonlyArray<ColumnSortingOrder>;
/** Explicitly set the column state */
setColumnState(key: string, state: ColumnSortingState): void;
/** Toggle the sorting state of a column when using single select */
private toggleSingleColumn;
/** Toggle the sorting state of a column when using multiple select */
private toggleMultipleColumn;
static ɵfac: i0.ɵɵFactoryDeclaration<ColumnSortingDirective, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<ColumnSortingDirective, "[uxColumnSorting]", never, { "singleSort": { "alias": "singleSort"; "required": false; }; "sortIndicator": { "alias": "sortIndicator"; "required": false; }; }, {}, never, never, false, never>;
}
export interface ColumnSortingOrder {
key: string;
state: ColumnSortingState;
}
export declare enum ColumnSortingState {
Ascending = "ascending",
Descending = "descending",
NoSort = "none"
}
export interface ColumnSortingIndicatorContext {
state: ColumnSortingState;
order: number;
}