import { ElementRef, OnInit, Renderer2 } from "@angular/core"; import { MatLegacyDialogRef as MatDialogRef } from "@angular/material/legacy-dialog"; import { StarkTableColumnComponent } from "../column.component"; import { AbstractStarkUiComponent } from "@nationalbankbelgium/stark-ui/src/internal-common"; import { StarkTableColumnSortingDirection } from "../../entities"; import * as i0 from "@angular/core"; /** * Content of the data to be passed to the StarkTableMultisortDialogComponent */ export interface StarkTableMultisortDialogData { /** * Sortable StarkTable columns whose configuration can be defined in this dialog component */ columns: StarkTableColumnComponent[]; } /** * Rule object to be configured in the StarkTableMultisortDialogComponent */ export interface StarkSortingRule { /** * Sortable StarkTable column */ column: StarkTableColumnComponent; /** * Sorting direction: "ascending" or "descending" */ sortDirection: StarkTableColumnSortingDirection; /** * Priority of this rule. Priority is a number between 0 and 100 where 0 represents the higher priority */ sortPriority: number; } /** * Component to display the multi column sorting configuration */ export declare class StarkTableMultisortDialogComponent extends AbstractStarkUiComponent implements OnInit { dialogRef: MatDialogRef; data: StarkTableMultisortDialogData; /** * Array of sorting rules currently applied */ rules: StarkSortingRule[]; /** * The priority to be set to a new rule when added */ currentPriority: number; /** * Whether the Add button is disabled */ isAddDisabled: boolean; /** * Class constructor * @param dialogRef - Reference to this dialog opened via the MatDialog service * @param data - The data to be passed to this dialog component * @param renderer - Angular `Renderer2` wrapper for DOM manipulations. * @param elementRef - Reference to the DOM element where this component is attached to. */ constructor(dialogRef: MatDialogRef, data: StarkTableMultisortDialogData, renderer: Renderer2, elementRef: ElementRef); /** * Component lifecycle hook */ ngOnInit(): void; /** * Called when Add button is clicked. * Sets the sorting direction to "asc" to a rule that doesn't have sorting direction yet so it is displayed in the dialog */ onAdd(): void; /** * Called when Delete button is clicked. * Deletes the given column sorting rule. * @param rule - The column sorting rule to be deleted */ onDelete(rule: StarkSortingRule): void; /** * Called when Cancel button is clicked. * Closes this dialog discarding any changes done to the original sorting rules. */ onCancel(): void; /** * Called when the sorting rule changes. * @param oldRule - New state of the sorting rule * @param newRule - Previous state of the sorting rule */ onColumnChange(oldRule: StarkSortingRule, newRule: StarkSortingRule): void; /** * Called when Save button is clicked. * Close the dialog returning the updated rules defined back to the dialog opener. */ onSave(): void; /** * Sort all sorting rules by priority */ sortRules(): void; /** * @ignore */ trackRuleFn(_index: number, item: StarkSortingRule): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }