"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.QuickSearchApiImpl = void 0;
const tslib_1 = require("tslib");
const QuickSearchRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/QuickSearchRedux"));
const InternalRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/InternalRedux"));
const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
const ApiBase_1 = require("./ApiBase");
class QuickSearchApiImpl extends ApiBase_1.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 this.getQuickSearchState().CellMatchStyle;
    }
    getQuickSearchTextMatchStyle() {
        return this.getQuickSearchState().TextMatchStyle;
    }
    getQuickSearchCurrentTextMatchStyle() {
        return this.getQuickSearchState().CurrentTextMatchStyle;
    }
    setQuickSearchCellMatchStyle(style) {
        this.dispatchAction(QuickSearchRedux.QuickSearchSetCellMatchingStyle(style));
    }
    openQuickSearchSettingsPanel() {
        this.showModulePopup(ModuleConstants.QuickSearchModuleId);
    }
    showFloatingQuickSearch() {
        this.dispatchAction(InternalRedux.QuickSearchFloatingVisibility(true));
    }
    hideFloatingQuickSearch() {
        this.dispatchAction(InternalRedux.QuickSearchFloatingVisibility(false));
    }
}
exports.QuickSearchApiImpl = QuickSearchApiImpl;
