import { ElementRef, EventEmitter, OnChanges, OnInit, Renderer2, SimpleChanges, TemplateRef } from "@angular/core"; import { AbstractStarkUiComponent } from "@nationalbankbelgium/stark-ui/src/internal-common"; import { BooleanInput } from "@angular/cdk/coercion"; import { UntypedFormControl } from "@angular/forms"; import { LegacyMenuPositionY as MenuPositionY } from "@angular/material/legacy-menu"; import { MatLegacyColumnDef as MatColumnDef } from "@angular/material/legacy-table"; import { StarkColumnCellClickedOutput, StarkColumnFilterChangedOutput, StarkColumnSortChangedOutput, StarkTableColumnSortingDirection } from "../entities"; import * as i0 from "@angular/core"; /** * Component to display a column inside the StarkTableComponent */ export declare class StarkTableColumnComponent extends AbstractStarkUiComponent implements OnInit, OnChanges { /** * Name of the property that will be the source of the column. */ get name(): string; set name(name: string); /** * Function that returns * 1 : if obj1 > obj2 * 0 : if obj1 === obj2 * -1 : if obj1 < obj2 * * @param obj1 - First object in the comparison * @param obj2 - Second object in the comparison */ compareFn?: (obj1: object, obj2: object) => number; /** * Function that returns the raw value of this column in case the access to such value can't be provided via the column name. */ dataAccessor?: (data: object, name: string) => string; /** * Function that returns a formatted value (string) to be set in the cell. It can be used to set different formats * depending on the row, value and or columnName. This function is called with 3 parameters: * @param value - The value of the cell to be formatted * @param row - The row object that contains the cell * @param columnName - The column that the cell belongs to */ cellFormatter?: (value: any, row?: object, columnName?: string) => string; /** * Sorting direction of the column. */ sortDirection: StarkTableColumnSortingDirection; /** * Whether this column is filterable */ get filterable(): boolean; set filterable(value: boolean); static ngAcceptInputType_filterable: BooleanInput; /** * Value of the filter * Wildcards can be used: "*" to match any anything and "?" to match one character. * Use "\*" and "\?" to match exactly the characters "*" and "?" */ filterValue?: string; /** * Label to be shown as the column's header. * * Default: the column's name */ set headerLabel(value: string); /** * Returns the header label of the column if it's specified. If not, simply returns the name of the column */ get headerLabel(): string; static ngAcceptInputType_headerLabel: string | undefined; /** * Value to be shown as the column's footer. */ set footerValue(value: string | number | undefined); /** * Returns the footer value of the column if it's specified. */ get footerValue(): string | number | undefined; /** * Whether the column is sortable or not. * * Default: `true` */ sortable: boolean; /** * Position where the column filter box should be displayed. * * Default: `"below"` */ get filterPosition(): MenuPositionY; set filterPosition(value: MenuPositionY); static ngAcceptInputType_filterPosition: MenuPositionY | undefined; /** * Priority of the column. */ sortPriority: number; static ngAcceptInputType_sortPriority: number | undefined; /** * Whether the column is visible or not. * * Default: `true` */ get visible(): boolean; set visible(value: boolean); static ngAcceptInputType_visible: BooleanInput; /** * A function to generate classNames for cells based on the value, its row and the name of the column. * Or a static string with the classNames. */ cellClassName?: ((value: any, row?: object, columnName?: string) => string) | string; /** * A static className for the header */ headerClassName?: string; /** * Make the column stick to the right side of the table */ get stickyEnd(): boolean; set stickyEnd(value: boolean); static ngAcceptInputType_stickyEnd: BooleanInput; /** * Output that will emit a StarkColumnCellClickedOutput whenever a cell in the column is clicked */ readonly cellClicked: EventEmitter; /** * Output that will emit a specific column whenever its filter value has changed */ readonly filterChanged: EventEmitter; /** * Output that will emit a specific column whenever its sorting direction has changed */ readonly sortChanged: EventEmitter; /** * Reference to the MatColumnDef embedded in this component */ columnDef: MatColumnDef; /** * Reference to the transcluded template in this component via the ngTemplateOutlet */ columnTemplate: TemplateRef | null; /** * @ignore * Internal formControl to manage the filter value of the column */ _filterFormCtrl: UntypedFormControl; /** * Class constructor * @param renderer - Angular `Renderer2` wrapper for DOM manipulations. * @param elementRef - Reference to the DOM element where this component is attached to. */ constructor(renderer: Renderer2, elementRef: ElementRef); /** * Component lifecycle hook */ ngOnInit(): void; /** * Component lifecycle hook * @param simpleChanges - Contains the changed properties */ ngOnChanges(simpleChanges: SimpleChanges): void; /** * Get the raw value of the column * @param row - The row item * @returns The raw value of the property from the given row item */ getRawValue(row: object): any | undefined; /** * Called whenever a cell of the column is clicked * @param $event - The handled event * @param row - The row item */ onCellClick($event: Event, row: object): void; /** * Get the final displayed value of the column * @param row - The row item * @returns The displayed value of the property from the given row item after applying the * formatter (if there was any defined in the column) and translating the value (in case the value is a translation key) */ getDisplayedValue(row: object): string | number; /** * Called when the Clear button in the filter pop-up is clicked */ onClearFilter(): void; /** * Called whenever the value of the filter input changes */ onFilterChange(): void; /** * Called whenever the sorting of the column changes */ onSortChange(): void; /** * Gets a the classes for a specific cell, based on the cellClassName Input and the cellClassNameFn function if it was given. * @param row - The data object of the row the cell is in. * @returns The classes for the cell. */ getCellClassNames(row: object): string; /** * Get the classes for a header * @returns The classes for the header */ getHeaderClassNames(): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }