import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y';
import { DestroyRef, ElementRef, EventEmitter, OnInit } from '@angular/core';
import { FormControl, UntypedFormControl } from '@angular/forms';
import { KbqButton, KbqButtonStyles } from '@koobiq/components/button';
import { KbqComponentColors, PopUpPlacements, PopUpSizes } from '@koobiq/components/core';
import { KbqDropdownTrigger } from '@koobiq/components/dropdown';
import { KbqPopoverTrigger } from '@koobiq/components/popover';
import { Observable } from 'rxjs';
import { KbqFilterBar } from './filter-bar';
import { KbqFilter, KbqSaveFilterError, KbqSaveFilterEvent } from './filter-bar.types';
import * as i0 from "@angular/core";
export declare class KbqFilters implements OnInit {
    /** @docs-private */
    protected readonly elementRef: ElementRef<any>;
    /** @docs-private */
    protected readonly destroyRef: DestroyRef;
    /** @docs-private */
    protected readonly focusMonitor: FocusMonitor;
    /** @docs-private */
    protected readonly placements: typeof PopUpPlacements;
    /** @docs-private */
    protected readonly styles: typeof KbqButtonStyles;
    /** @docs-private */
    protected readonly colors: typeof KbqComponentColors;
    /** KbqFilterBar instance */
    protected readonly filterBar: KbqFilterBar;
    /** @docs-private */
    private readonly changeDetectorRef;
    /** @docs-private */
    protected mainButton: KbqButton;
    /** @docs-private */
    protected saveNewFilterButton: KbqButton;
    /** @docs-private */
    protected filterActionsButton: KbqButton;
    /** @docs-private */
    protected popover: KbqPopoverTrigger;
    /** @docs-private */
    protected dropdown: KbqDropdownTrigger;
    /** @docs-private */
    protected filterActionsDropdown: KbqDropdownTrigger;
    private search;
    private newFilterName;
    private saveFilterButton;
    /** control for search filter */
    searchControl: UntypedFormControl;
    /** filtered by search filters */
    filteredOptions: Observable<KbqFilter[]>;
    /** @docs-private */
    popoverSize: PopUpSizes;
    /** @docs-private */
    popoverOffset: number;
    /** new filter name for saving */
    filterName: FormControl<string | null>;
    /** true if saving a new filter, false if saving changes in filter */
    saveNewFilter: boolean;
    showFilterSavingError: boolean;
    filterSavingErrorText: string;
    isSaving: boolean;
    filters: KbqFilter[];
    /** Event that is generated whenever the user selects a filter. */
    readonly onSelectFilter: EventEmitter<KbqFilter>;
    /** Event that is generated whenever the user save a filter. */
    readonly onSave: EventEmitter<KbqSaveFilterEvent>;
    /** Event that is generated whenever the user change a filter. */
    readonly onChangeFilter: EventEmitter<KbqSaveFilterEvent>;
    /** Event that is generated whenever the user saves a filter as new.
     * @deprecated use onSave with status = newFilter. */
    readonly onSaveAsNew: EventEmitter<KbqSaveFilterEvent>;
    /** Event that is generated whenever the user remove a filter. */
    readonly onRemoveFilter: EventEmitter<KbqFilter>;
    /** Event that is generated whenever the user reset a filter changes. */
    readonly onResetFilterChanges: EventEmitter<KbqFilter | null>;
    /** header of popover. Depends on the mode */
    get popoverHeader(): string;
    /** Component state. true if opened dropdown or popup */
    get opened(): boolean;
    /** Component state. true if opened dropdown or popup of filterActions */
    get filterActionsOpened(): boolean;
    /** Selected filter */
    get filter(): KbqFilter | null;
    /** Component state. True if 'filters' input contains no elements. */
    get isEmpty(): boolean;
    /** localized data
     * @docs-private */
    get localeData(): any;
    /** Current focus origin state.
     * @docs-private */
    get focusOrigin(): FocusOrigin;
    private _focusOrigin;
    private focusedElementBeforeOpen;
    constructor();
    ngOnInit(): void;
    /** @docs-private */
    focusedElementBeforeIs(button: KbqButton): boolean;
    selectFilter(filter: KbqFilter): void;
    saveChanges(): void;
    saveAsNew(event?: Event): void;
    showError(error?: KbqSaveFilterError): void;
    restoreFocus(): void;
    preparePopover(): void;
    openSaveAsNewFilterPopover(): void;
    openChangeFilterNamePopover(): void;
    /** @docs-private */
    saveFocusedElement(button?: KbqButton): void;
    closePopover: (restoreFocus?: boolean) => void;
    /** @docs-private */
    stopEventPropagation(event: Event): void;
    /** @docs-private */
    searchKeydownHandler(event: KeyboardEvent): void;
    /** @docs-private */
    onDropdownOpen(): void;
    resetFilterChanges(): void;
    removeFilter(): void;
    /** Hide the popup and restore focus.
     * Use this method in the onSave, onSaveAsNew, or onChangeFilter events after the data has been successfully saved. */
    filterSavedSuccessfully(): void;
    /** Shows an error. Use this method in the onSave, onSaveAsNew, or onChangeFilter events if saving data failed. */
    filterSavedUnsuccessfully(error?: KbqSaveFilterError): void;
    private getFilteredOptions;
    static ɵfac: i0.ɵɵFactoryDeclaration<KbqFilters, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<KbqFilters, "kbq-filters", ["kbqFilters"], { "filters": { "alias": "filters"; "required": false; }; }, { "onSelectFilter": "onSelectFilter"; "onSave": "onSave"; "onChangeFilter": "onChangeFilter"; "onSaveAsNew": "onSaveAsNew"; "onRemoveFilter": "onRemoveFilter"; "onResetFilterChanges": "onResetFilterChanges"; }, never, ["*"], true, never>;
}
