@adaptabletools/adaptable
Version:
Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
53 lines (52 loc) • 2.2 kB
JavaScript
import * as QuickSearchRedux from '../../Redux/ActionsReducers/QuickSearchRedux';
import * as InternalRedux from '../../Redux/ActionsReducers/InternalRedux';
import * as ModuleConstants from '../../Utilities/Constants/ModuleConstants';
import { resolveQuickSearchCellMatchStyle, resolveQuickSearchCurrentTextMatchStyle, resolveQuickSearchTextMatchStyle, } from '../../Utilities/Helpers/QuickSearchHelper';
import { ApiBase } from './ApiBase';
export class QuickSearchApiImpl extends ApiBase {
getQuickSearchState() {
return this.getAdaptableState().QuickSearch;
}
runQuickSearch(quickSearchText) {
this.dispatchAction(QuickSearchRedux.QuickSearchRun(quickSearchText));
}
clearQuickSearch() {
this.dispatchAction(QuickSearchRedux.QuickSearchRun(''));
}
gotoNextMatch() {
this.getAdaptableApi().agGridApi.findNext();
}
gotoPreviousMatch() {
this.getAdaptableApi().agGridApi.findPrevious();
}
getQuickSearchValue() {
return this.getQuickSearchState().QuickSearchText;
}
getQuickSearchCellMatchStyle() {
return resolveQuickSearchCellMatchStyle(this.getQuickSearchState());
}
getQuickSearchTextMatchStyle() {
return resolveQuickSearchTextMatchStyle(this.getQuickSearchState());
}
getQuickSearchCurrentTextMatchStyle() {
return resolveQuickSearchCurrentTextMatchStyle(this.getQuickSearchState());
}
setQuickSearchCellMatchStyle(style) {
this.dispatchAction(QuickSearchRedux.QuickSearchSetCellMatchingStyle(style));
}
setQuickSearchTextMatchStyle(style) {
this.dispatchAction(QuickSearchRedux.QuickSearchSetTextMatchingStyle(style));
}
setQuickSearchCurrentTextMatchStyle(style) {
this.dispatchAction(QuickSearchRedux.QuickSearchSetCurrentTextMatchingStyle(style));
}
openQuickSearchSettingsPanel() {
this.showModulePopup(ModuleConstants.QuickSearchModuleId);
}
showFloatingQuickSearch() {
this.dispatchAction(InternalRedux.QuickSearchFloatingVisibility(true));
}
hideFloatingQuickSearch() {
this.dispatchAction(InternalRedux.QuickSearchFloatingVisibility(false));
}
}