import { SelectionModel } from '@angular/cdk/collections';
import { CdkDrag, CdkDragDrop } from '@angular/cdk/drag-drop';
import { BreakpointObserver } from '@angular/cdk/layout';
import { AfterContentInit, AfterViewInit, ChangeDetectorRef, DoCheck, IterableDiffer, IterableDiffers, KeyValueDiffer, KeyValueDiffers, OnDestroy, OnInit, QueryList, TrackByFunction } from '@angular/core';
import { FormArray, FormBuilder, FormControl, UntypedFormControl } from '@angular/forms';
import { MatSort } from '@angular/material/sort';
import { MatTable, MatTableDataSource } from '@angular/material/table';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { Subscription } from 'rxjs';
import { PaginatorComponent } from '../paginator/paginator.component';
import { PaginatorFetcher, PaginatorFilters } from '../paginator/paginator.model';
import { ThemingService } from '../theming/theming.service';
import { TableActionsDirective } from './table-actions.directive';
import { TableCellTemplateDirective } from './table-cell-template.directive';
import { TableColumnSelectorDirective } from './table-column-selector.directive';
import { TableGroupHeaderDirective } from './table-group-header.directive';
import { TableHeaderCellTemplateDirective } from './table-header-cell-template.directive';
import { TableNoDataTemplateDirective } from './table-no-data-template.directive';
import { TableRowActionsDirective } from './table-row-actions.directive';
import { TableRowDetailDirective } from './table-row-detail.directive';
import { TableRowMenuDirective } from './table-row-menu.directive';
import { Column, ExpandableItem, FilterConfig, FiltersConfig, Group, SortDirection, TableConfig } from './table.model';
import * as i0 from "@angular/core";
/**
 * Table component
 */
export declare class TableComponent<T extends ExpandableItem = Partial<ExpandableItem>, F extends Params = Params> implements OnInit, DoCheck, AfterContentInit, AfterViewInit, OnDestroy {
    private readonly route;
    private readonly router;
    private readonly changeDetector;
    private readonly breakpointObserver;
    private readonly formBuilder;
    private readonly themeService;
    private readonly differs;
    private readonly groupsDiffers;
    /**
     * Table configuration
     */
    config: TableConfig<T>;
    /**
     * Put data with a material datasource
     *
     * Alternative : use fetcher method (recommanded)
     */
    dataSource?: MatTableDataSource<T>;
    /**
     * Method to retrieve data
     *
     * Sort, filter parameters are automatically
     */
    fetcher?: PaginatorFetcher<T>;
    /**
     * Manage header filters button with this configuration
     */
    filtersConfig?: FiltersConfig;
    selectedItems: T[];
    /**
     * Method to compare items
     *
     * @param i
     * @param j
     * @returns
     */
    compareWith: (i: T, j: T) => boolean;
    trackBy?: TrackByFunction<T>;
    cellsQuery: QueryList<TableCellTemplateDirective>;
    headerCellsQuery: QueryList<TableHeaderCellTemplateDirective>;
    rowMenuQuery: TableRowMenuDirective;
    rowActionsQuery: TableRowActionsDirective;
    columnSelectorQuery: TableColumnSelectorDirective;
    actionsQuery: TableActionsDirective;
    rowDetailQuery: TableRowDetailDirective;
    tableNoData: TableNoDataTemplateDirective;
    groupHeaderQuery: TableGroupHeaderDirective;
    table: MatTable<T | Group<T>>;
    sort: MatSort;
    paginator: PaginatorComponent<T>;
    onResize(): void;
    dataSourceDiffer: KeyValueDiffer<any, any>;
    configDiffer: KeyValueDiffer<any, any>;
    configColumnDiffers: KeyValueDiffer<any, any>[];
    collapsedDiffer: KeyValueDiffer<any, any>;
    dataDiffer: KeyValueDiffer<any, any>;
    checked: {
        [key: string | number]: boolean;
    };
    selection: SelectionModel<T>;
    columnForm: import("@angular/forms").FormGroup<{
        selected: FormArray<FormControl<boolean>>;
    }>;
    columns: {
        [key: string]: Column<T>;
    };
    initialColumnKeys: string[];
    columnKeys: string[];
    groupColumnsKey: string[];
    orderedColumnKeys: string[];
    otherStoredColumnKeys: string[];
    cells: {
        [name: string]: TableCellTemplateDirective;
    };
    headerCells: {
        [name: string]: TableHeaderCellTemplateDirective;
    };
    filters?: {
        [key: string]: FilterConfig;
    };
    filterControls?: {
        [key: string]: UntypedFormControl;
    };
    filterDateControls: {
        [key: string]: UntypedFormControl;
    };
    filtersResetValue?: Params;
    activeSort?: string;
    activeSortDirection?: SortDirection;
    expandedRows: T[];
    collapsed: Group<T>[];
    groupedData?: MatTableDataSource<T | Group<T>>;
    total?: boolean;
    theme: import("@angular/core").WritableSignal<string>;
    sortSubscr?: Subscription;
    themeSubscr?: Subscription;
    breakPointSubscr?: Subscription;
    small?: boolean;
    columnsSubscr?: Subscription;
    selectionSubscr?: Subscription;
    dragDisabled: boolean;
    templateFinder: (name: string) => import("@angular/core").TemplateRef<{
        $implicit: any;
    }>;
    headerTemplateFinder: (name: string) => import("@angular/core").TemplateRef<{
        $implicit: void;
    }>;
    sortGroupPredicate: (index: number, item: CdkDrag<T>) => boolean;
    groupsDataDiffer: IterableDiffer<Partial<Group<T>>>;
    singleClickTimeout: ReturnType<typeof setTimeout> | undefined;
    constructor(route: ActivatedRoute, router: Router, changeDetector: ChangeDetectorRef, breakpointObserver: BreakpointObserver, formBuilder: FormBuilder, themeService: ThemingService, differs: KeyValueDiffers, groupsDiffers: IterableDiffers);
    get columnFormArray(): FormArray<FormControl<boolean>>;
    compare(o1: T | Group<T>, o2: T | Group<T>): boolean;
    ngOnInit(): void;
    private manageFilterConfiguration;
    /**
     * Define a fetcher if not declare
     * Fetcher allow to filter datasource with pagination result
     *
     * Manage pages and sorts
     */
    private mergeFetcherAndDatasource;
    /**
     * Sort data using pagination filters
     *
     * @param filters
     */
    sortDataSource(filters: PaginatorFilters): void;
    ngAfterViewInit(): void;
    ngAfterContentInit(): void;
    ngDoCheck(): void;
    ngOnDestroy(): void;
    /**
     * Init differs to detect change on table config columns
     */
    private initConfigurationColumnsDiffer;
    getCheckLabel(row: T): string;
    /**
     * Change detection on table config attributes and each columns using differs
     * Use for dynamic translation refresh (using ngx-translate)
     */
    private doCheckOnConfiguration;
    /**
     * Init method triggered after config change
     */
    protected initConfiguration(): void;
    /**
     * Generates columns from table config
     *
     * @param config TableConfig
     */
    protected generateColumns(config: TableConfig<T>): void;
    /**
     * Init column form selector subscription
     */
    protected initColumnSelectorSubscr(): void;
    /**
     * Init responsive breakpoint event
     * For mobiles, table selector (checkboxes) is displayed first
     */
    protected initResponsiveBreakpointSubscr(): void;
    /**
     * Get datasource
     * Two cases :
     * - Classic Datasource
     * - Datasource through paginator component
     */
    get ds(): MatTableDataSource<T> | MatTableDataSource<T | Group<T>> | (T | Group<T>)[];
    /**
     * Get table data
     * Two cases :
     * - Classic Datasource
     * - Data through paginator component
     */
    get data(): T[];
    /**
     * Update columns depending of form array (sort and display)
     */
    protected setColumns(init?: boolean): void;
    /**
     * Init column object
     * Retrive of table config + default values
     */
    protected createColumnFromConfig(config: Column<T>, columnKey: string): Column<T>;
    /**
     * Create a form control array with table configuration
     * This form array is made to control columns :
     * - sort
     * - display
     */
    protected createColumnKeys(columns: {
        [key: string]: Column<T>;
    }): void;
    /**
     * Does groupColumnQuery exist and not empty
     */
    protected isGroupColumnsQuery(): boolean;
    /**
     * When rows support expanded format
     * This method trigger an event through the table configuration to make some treatments
     */
    onRowExpand(item: T): void;
    /**
     * Manage click on row by using rowClick function in table configuration
     */
    onRowClick(item: T, e: MouseEvent): void;
    /**
     * Manage double click on row by using rowDoubleClick function in table configuration
     * @param item
     * @param e
     */
    onRowDoubleClick(item: T, e: MouseEvent): void;
    delaySingleClickAction(item: T, e: MouseEvent): void;
    isButtonClick(e: MouseEvent): boolean;
    isTableRowClick(e: MouseEvent): boolean;
    clearSingleClickTimeout(): void;
    private invokeDoubleClickHandler;
    /**
     * Method triggered when row is hovered by using rowDoubleClick function in table configuration
     * @param item
     * @param e
     */
    onRowHover(item: T, e: MouseEvent): void;
    /**
     * Method triggered when selection changed
     * (or when pagination change to reset all checkbocx)
     */
    protected selectionChanged(emitEvent: boolean): void;
    /**
     * Computes which items are checked if the table is grouped or not
     */
    computeCheckedItems(): void;
    /**
     * Method to select/deselect all item in the table
     */
    toggleAll(): void;
    isAllSelected(): boolean;
    /**
     * Method to select/deselect all items of a group
     */
    toggleGroup(group: Group<T>): void;
    toggleSelection(row: T): void;
    updateSelection(emitEvent: boolean): void;
    /**
     * Is the value selected
     *
     * @param value
     * @returns
     */
    isSelected(value: T): boolean;
    /**
     * Is the group selected
     *
     * @param group
     * @returns
     */
    isGroupSelected(group: Group<T>): boolean;
    /**
     * Is a row menu displayed ?
     */
    isMenuDisplayed(item: T): boolean;
    /**
     * Get sum for a giving column
     */
    getTotal(columnKey: string): number;
    /**
     * Appy extra filters through paginator
     */
    patchExtraFilters(extraFilters: Partial<F>, noSelectionReset?: boolean): void;
    /**
     * Reset filters through paginator
     * Use date to trigger update
     */
    resetFilters(noSelectionReset?: boolean): void;
    /**
     * Get filters through paginator
     */
    getFilters(): PaginatorFilters | null;
    /**
     * Reset dropdown values (filters)
     * Use date to trigger update
     */
    resetFilterDropdownValues(): void;
    /**
     * Apply the filter value give through the header dropdowns
     */
    applyFilterDropdownValues(opened: boolean): void;
    /**
     * Action trigger when column are organized
     * (drag & drop)
     */
    dropColumnKey(event: CdkDragDrop<string[]>): void;
    /**
     * Method triggered when the dropdown to select columns is closed
     * Apply updates if necessary
     */
    onColumnSelectorClose(): void;
    /********************
     *  GROUP BY
     ********************/
    /**
     * Add groups into existing data
     *
     * @param data table data
     * @param groupByColumns list of data to group on
     * @returns grouped data
     */
    groupBy(data: T[], groupByColumns: string[]): (T | Group<T>)[];
    /**
     * Compute sub groups
     *
     * @param data array of data
     * @param level current group level
     * @param groupByColumns array of grouped colums
     * @param parent Parent Group
     * @returns Array of group and data
     */
    getSubGroups(data: T[], level: number, groupByColumns: string[], parent: Group<T>): (T | Group<T>)[];
    formatDefaultGroups(level: number, groupByColumns: string[], parent: Group<T>): Group<T>[];
    createGroup(level: number, groupByColumns: string[], parent: Group<T>, row: ExpandableItem | Partial<Group<T>>): Group<T>;
    /**
     * Find unique groups in the array of groups
     *
     * @param groups Group array
     * @param getKey function to extract a key from a group
     * @returns array of unique groups
     */
    uniqueBy(groups: Group<T>[], getKey: (item: Group<T>) => string): Group<T>[];
    /**
     * Check if the specified item is a group.
     *
     * @param index item index in the table
     * @param item item in the table
     * @returns true if the item is a group
     */
    isGroup(index: number, item: Group<T> | T): boolean;
    /**
     * Check if the specified item is not a group.
     *
     * @param index item index in the table
     * @param item item in the table
     * @returns false if the item is a group
     */
    isNotGroup(index: number, item: Group<T> | T): boolean;
    /**
     * Filter predicate used on the datasource to check if the data should be displayed in the table
     *
     * @param data Group or data
     * @returns true if the group is at root level
     *          true if the group parent is not collapsed
     *          false if the group parent is collapsed
     */
    customFilterPredicate(data: T | Group<T>): boolean;
    /**
     * Check if the data should be displayed in the table
     *
     * @param data
     * @returns
     */
    getDataRowVisible(data: T): boolean;
    /**
     * Collapse / Uncollaps clicked group
     *
     * @param row Clicked group
     */
    groupHeaderClick(group: Group<T>): void;
    /**
     * Check if the group is expanded or not
     *
     * @param group Group to check
     * @returns true or false
     */
    isExpanded(group: Group<T>): boolean;
    /**
     * On item dropped
     *
     * @param event Drop event info
     */
    drop(event: CdkDragDrop<string[]>): void;
    /**
     * On item dropped update group data and item index
     *
     * @param event Drop event info
     */
    protected getUpdatedGroups(event: CdkDragDrop<string[]>, updatedItems: T[]): void;
    /**
     * If configured update the item 'positionField'
     *
     * @param updatedItems array of items updated
     * @param event drop Event
     */
    updateItemsPosition(updatedItems: T[], event: CdkDragDrop<string[]>): void;
    removeFilter(key: string, value: string): void;
    openFilterOverlay($event: Event, key: string): void;
    closeFilterOverlay(key: string): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<TableComponent<any, any>, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<TableComponent<any, any>, "mic-table", never, { "config": { "alias": "config"; "required": false; }; "dataSource": { "alias": "dataSource"; "required": false; }; "fetcher": { "alias": "fetcher"; "required": false; }; "filtersConfig": { "alias": "filtersConfig"; "required": false; }; "compareWith": { "alias": "compareWith"; "required": false; }; "trackBy": { "alias": "trackBy"; "required": false; }; }, {}, ["rowMenuQuery", "rowActionsQuery", "columnSelectorQuery", "actionsQuery", "rowDetailQuery", "tableNoData", "groupHeaderQuery", "cellsQuery", "headerCellsQuery"], never, false, never>;
}
