/******************************************************************************* * Copyright (c) Lenovo 2020. * * LIMITED AND RESTRICTED RIGHTS NOTICE: If data or software is delivered * pursuant a General Services Administration (GSA) contract, use, reproduction, or * disclosure is subject to restrictions set forth in Contract No. GS-35F-05925. ******************************************************************************/ import { OnInit, ChangeDetectorRef, ElementRef, AfterViewInit, EventEmitter, SimpleChanges, OnChanges } from '@angular/core'; import { SortingAndFilteringParamsBuilder } from '../../classes/sortingFilteringUtils/sortingFilteringUtils'; import { StringTableFilterSearchValue, TableFilter } from '../../interfaces/tableFilter'; import { Action } from '../../interfaces/action'; import { TableFilteringConfigurationsService } from '../../services/tableFilteringService/tableFilteringConfigurations.service'; import { LocalStorageService } from '../../services/localStorageService/localStorage.service'; import { LocalStorageFilter } from '../../services/localStorageService/localStorageItems'; import { TranslateService } from '@ngx-translate/core'; import { Subscription, Observable } from 'rxjs'; import { PrimeNGConfig } from 'primeng/api'; import { CalendarLocaleService } from '../../classes/primengCalendarLocales'; import * as i0 from "@angular/core"; export declare class TableToolbarComponent implements OnInit, OnChanges, AfterViewInit { private tableFilteringConfigSvc; private cdr; private calendarLocaleSvc; private localStorageSvc; private translateSvc; private elRef; private primeNGConfig; actions: Action[]; table: any; /** * Boolean indicating if the refresh button should be displayed or not */ showRefreshButton: boolean; /** * When prefilling filters from shortcuts, the component sends the active filters to the toolbar and it applies them */ activeFilters: TableFilter[]; /** * If currentUser is received (e.g. from sessionStorage.getItem('currentUser')), table settings will be saved per that user. * Else, these will be saved in sessionStorage as 'tableSettings' in the 'uiSettings' object. */ currentUser: string; /** * The configuration of the table, including column names and properties used. */ tableFilteringConfig: TableFilter[]; /** * Custom Table toolbar icons configuration for filters */ tableToolbarIconsClassConfig: object; /** * After setting the active filters, clear them because they are already applied and saved in session storage */ activeFiltersChange: EventEmitter; disabled: boolean; filters: TableFilter[]; /** Previously searched global value */ /** Current search global value */ tableGlobalSearchValue: StringTableFilterSearchValue; /** Boolean indifcating if the global filter on table was applied */ globalFilterOnTableWasApplied: boolean; /** In order to show days in the current selected language */ calendarLocale: any; savedFilterConfigurations: LocalStorageFilter[]; filterName: string; showFilterNameInput: boolean; initialTableBuilder: SortingAndFilteringParamsBuilder; searchSavedFiltersInputValue: string; /** Actions for filtering like save filter, save filter as and clear filter */ filtersActions: Action[]; activeFilteringConfigurationName: string | undefined; startDateTime: Date; endDateTime: Date; translatedNotAvailable: string; isGlobalSearchPopoverOpen: boolean; tableEventsSubscription: Subscription; refreshAction: Action; toggleColumnsAction: Action; tableEvents: Observable; constructor(tableFilteringConfigSvc: TableFilteringConfigurationsService, cdr: ChangeDetectorRef, calendarLocaleSvc: CalendarLocaleService, localStorageSvc: LocalStorageService, translateSvc: TranslateService, elRef: ElementRef, primeNGConfig: PrimeNGConfig); ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; ngAfterViewInit(): void; removePath(src: string): string; onEnterButton(evt: MouseEvent, srcDisabled?: string): void; onLeaveButton(evt: MouseEvent, srcDisabled?: string): void; getActiveFiltersRecursively(filters: TableFilter[], activeFilters: TableFilter[]): any; getActiveFilters(): TableFilter[]; /** * When opening a filter, clear what was entered before and was not saved; show what was saved, if any. */ resetFilter(): void; /** * Toggle isActive property for a given filter * @param filter */ afterFilterToggleOff(filter: TableFilter, noFetch?: boolean): void; /** * Add input in order to search by multiple values when the filter type is string * @param values */ addInput(values: { currentValue: string; previousValue?: string; enteredPreviousSearch: boolean; }[]): void; /** * Remove input if the user wants to search only by one value and there are two inputs added * @param event * @param filter * @param index */ removeInput(event: any, filter: TableFilter, index: number): void; /** * Remove individual column filter * @param filter */ removeFilter(filter: TableFilter, noFetch?: boolean): void; /** * Remove all column filters AND also the global table filter */ removeAllFilters(): void; /** * Apply individual column filter * @param filter */ applyFilter(filter: TableFilter, noFetch?: boolean): void; /** * Method used only when the filter values are not coming from the UI and we only need to apply the filters on the builder */ applyFilterOnBuilder(filter: TableFilter, sortingAndFilteringBuilder: SortingAndFilteringParamsBuilder): void; /** * Apply filtering configuration * @param filteringConfiguration */ applyAllFiltersFromTheFilteringConfiguration(filteringConfiguration: LocalStorageFilter): void; performGlobalSearchOnTable(noFetch?: boolean): void; removeGlobalSearchFilter(): void; removeTrailingSpacesFromGlobalSearchValue(value: string): string; checkIfFilterCanBeApplied(filter: TableFilter): boolean; checkIfFirstInputIsCompleted(filter: TableFilter): boolean; checkIfInputCanBeRemoved(filter: TableFilter): boolean; setTableFilterWasAppliedProp(): void; getLocaleForCalendar(): void; saveFilteringConfigurationAs(): void; saveFilteringConfiguration(filteringConfiguration: LocalStorageFilter | undefined): void; getFilterConfigurationsFromLocalStorage(): void; checkIfAnyFilterWasApplied(): boolean; applyFilteringConfiguration(filteringConfiguration: LocalStorageFilter): void; removeFilteringConfiguration(filterConfiguration: LocalStorageFilter): void; onDropdownShown(): void; markSavedFilterAsActive(): void; onBooleanSelectChange(event: any, filter: TableFilter): void; clickAllFiltersDropdownButton(): void; clickIndividualFilterDropdownButton(filterId: string): void; xssCharactersValidation(value: StringTableFilterSearchValue): void; checkLength(value: StringTableFilterSearchValue): void; toggleHTMLElementDisplayProp(id: string, filter: TableFilter): void; /** * For a given filter, add additional columns to the search in order to perform and OR operation instead of AND between all active column filters * * @param filter Filter to be modified * @param id Id of the filter which needs to be activated in the additional properties */ markAdditionalPropertiesAsActive(filter: TableFilter, id: string): void; /** * See if a specifc set of properties corresponding to one filter is marked as additional in another filter * @param filter * @param id */ areAdditionalProperties(filter: TableFilter, id: string): boolean; /** Return true if the filter has any other properties selected in order to perform an OR */ filterHasAdditionalProperties(filter: TableFilter): boolean; /** * Filter the saved queries */ /** * Method used to retrieve the last active filters (column filters and global search filter) from session storage and apply them */ applyLastActiveFilterFromSessionStorage(): void; /** * Method used to save the currently applied filters in session storage in order to re-use them when data is refetched after a certain operation (add/remove etc) */ saveActiveFilterInSessionStorage(): void; /** * Method used to delete the saved active filters in local storage. The filters should be removed when the component is destroyed * TODO: See if this fits the server click scenario */ resetActiveFilterInSessionStorage(): void; /** * Method used to reset only the global search value from the session storage saved active filters */ resetActiveFilterGlobalSearchInSessionStorage(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }