/******************************************************************************* * 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. ******************************************************************************/ export interface StringTableFilterSearchValue { currentValue: string; previousValue?: string; enteredPreviousSearch: boolean; hasXssCharsError?: boolean; hasMaxLengthError?: boolean; } export declare class TableFilter { /** The property which will be used to build the filter (eg: the property is 'releaseDate' and the label is 'Release Date') */ properties?: string[]; /** Label to display in the button */ label: string; /** Filter type */ type?: 'string' | 'checkbox' | 'date' | 'boolean'; /** Boolean indicating whether the filter is active in order to show it in the table toolbar */ isActive: boolean; /** Id to be used for buttons and so on */ id: string; /** Boolean indicating if the user clicked the apply button in order to disable/enable the remove filter button */ wasApplied?: boolean; /** For the string filter type the values array will contain the values based on which we make the search * and a disabled property which will indicate if the search has been made considering that particular value */ searchValues?: StringTableFilterSearchValue[]; /** Selected value in case of boolean filter */ selectedValue?: { currentValue: boolean | undefined; previousValue: boolean | undefined; }; /** Only for checkbox filter type, the possible values will be 'Normal', 'Critical', 'Warning' each with its translated value */ possibleValues?: { translatedValue: string; value: string; isSelected: boolean; enteredPreviousSearch: boolean; }[]; /** Range dates to search for when the filter type is date */ rangeDates?: Date[]; /** If the user changes the dates we need to remove the previous search and replace those values in the url, * we need to retain the values that have already been used in the search query */ alreadySearchedForRangeDates?: Date[]; iconType?: 'severity' | 'updateSeverity' | 'generalStatus' | 'power' | 'connectivity' | 'serviceability' | 'ticketState' | 'jobStatus' | 'policyState' | 'status' | 'compatibility'; subFilters?: TableFilter[]; tableLabel?: string; /** True if instead of filterEquals should be filterNotEquals or instead of filterContains should be filterNotContains */ negation?: { currentValue: boolean; previousValue: boolean | undefined; }; /** Used to perform an OR operation between two or multiple columns over some values. So at search, the user will search one value in filter.properties OR in filter.additionalPropertiesForSearch.map(p => p.prop). It is basically and or over the entered values between the base filter properties and the selected additional ones*/ additionalPropertiesForSearch?: { id: string; prop: string; enteredPreviousSearch: boolean; isSelected: boolean; }[]; }