material-dynamic-table
Version:
Dynamic table component for angular built on top of angular material table. It offers sorting, pagination, filtering per column and the ability to specify content types and components used for displaying them.
81 lines (80 loc) • 4.36 kB
TypeScript
import { ChangeDetectorRef, OnDestroy, OnInit, ElementRef } from '@angular/core';
import { MdtMultiSort } from './multi-sort.directive';
import { SortDirection, MatSortable, MatSortHeader, MatSortHeaderIntl } from '@angular/material/sort';
import { FocusMonitor } from '@angular/cdk/a11y';
import * as i0 from "@angular/core";
/**
* Valid positions for the arrow to be in for its opacity and translation. If the state is a
* sort direction, the position of the arrow will be above/below and opacity 0. If the state is
* hint, the arrow will be in the center with a slight opacity. Active state means the arrow will
* be fully opaque in the center.
*
* @docs-private
*/
export type ArrowViewState = SortDirection | 'hint' | 'active';
/**
* States describing the arrow's animated position (animating fromState to toState).
* If the fromState is not defined, there will be no animated transition to the toState.
* @docs-private
*/
export interface ArrowViewStateTransition {
fromState?: ArrowViewState;
toState: ArrowViewState;
}
/** Column definition associated with a `MatSortHeader`. */
interface MatSortHeaderColumnDef {
name: string;
}
/**
* Applies sorting behavior (click to change sort) and styles to an element, including an
* arrow to display the current sort direction.
*
* Must be provided with an id and contained within a parent MatSort directive.
*
* If used on header cells in a CdkTable, it will automatically default its id from its containing
* column definition.
*/
export declare class MdtMultiSortHeader extends MatSortHeader implements MatSortable, OnDestroy, OnInit {
_intl: MatSortHeaderIntl;
_multiSort: MdtMultiSort;
_columnDef: MatSortHeaderColumnDef;
/**
* ID of this sort header. If used within the context of a CdkColumnDef, this will default to
* the column's name.
*/
id: string;
/** Overrides the sort start value of the containing MatSort for this MatSortable. */
start: 'asc' | 'desc';
private _sortHeader;
constructor(_intl: MatSortHeaderIntl, changeDetectorRef: ChangeDetectorRef, _multiSort: MdtMultiSort, _columnDef: MatSortHeaderColumnDef, _focusMonitor: FocusMonitor, _elementRef: ElementRef<HTMLElement>);
_handleClick(): void;
/** Whether this MatSortHeader is currently sorted in either ascending or descending order. */
_isSorted(): boolean;
/**
* Updates the direction the arrow should be pointing. If it is not sorted, the arrow should be
* facing the start direction. Otherwise if it is sorted, the arrow should point in the currently
* active sorted direction. The reason this is updated through a function is because the direction
* should only be changed at specific times - when deactivated but the hint is displayed and when
* the sort is active and the direction changes. Otherwise the arrow's direction should linger
* in cases such as the sort becoming deactivated but we want to animate the arrow away while
* preserving its direction, even though the next sort direction is actually different and should
* only be changed once the arrow displays again (hint or activation).
*/
_updateArrowDirection(): void;
/**
* Gets the aria-sort attribute that should be applied to this sort header. If this header
* is not sorted, returns null so that the attribute is removed from the host element. Aria spec
* says that the aria-sort property should only be present on one header at a time, so removing
* ensures this is true.
*/
_getAriaSortAttribute(): "none" | "ascending" | "descending";
getSortDirection(): 'asc' | 'desc' | '';
/**
* Gets the sort counter that will display whenever multisort is enabled. It shows the order
* in which sort is applied, whenever there are multiple columns being used for sorting.
*/
_getSortCounter(): string;
static ɵfac: i0.ɵɵFactoryDeclaration<MdtMultiSortHeader, [null, null, { optional: true; }, { optional: true; }, null, null]>;
static ɵcmp: i0.ɵɵComponentDeclaration<MdtMultiSortHeader, "[mdt-sort-header]", ["mdtSortHeader"], { "disabled": { "alias": "disabled"; "required": false; }; "id": { "alias": "mdt-sort-header"; "required": false; }; "start": { "alias": "start"; "required": false; }; }, {}, never, ["*"], false, never>;
}
export {};