"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.QuickSearchReducer = exports.QuickSearchReady = exports.QuickSearchSetCellMatchingStyle = exports.QuickSearchRun = exports.QUICK_SEARCH_READY = exports.QUICK_SEARCH_SET_CELL_MATCHING_STYLE = exports.QUICK_SEARCH_RUN = exports.QUICK_SEARCH_SET_CELL_MATCHING_STYLE_DEFAULT = void 0;
const ReduxConstants_1 = require("../../Utilities/Constants/ReduxConstants");
const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
exports.QUICK_SEARCH_SET_CELL_MATCHING_STYLE_DEFAULT = {
    BackColor: ReduxConstants_1.QUICK_SEARCH_DEFAULT_BACK_COLOR,
    ForeColor: ReduxConstants_1.QUICK_SEARCH_DEFAULT_FORE_COLOR,
};
/**
 * @ReduxAction Runs Quick Search
 */
exports.QUICK_SEARCH_RUN = 'QUICK_SEARCH_RUN';
/**
 * @ReduxAction Sets Quick Search style
 */
exports.QUICK_SEARCH_SET_CELL_MATCHING_STYLE = 'QUICK_SEARCH_SET_CELL_MATCHING_STYLE';
/**
 * @ReduxAction Quick Search Module is ready
 */
exports.QUICK_SEARCH_READY = 'QUICK_SEARCH_READY';
const QuickSearchRun = (quickSearchText) => ({
    type: exports.QUICK_SEARCH_RUN,
    quickSearchText,
});
exports.QuickSearchRun = QuickSearchRun;
const QuickSearchSetCellMatchingStyle = (matchingCellStyle) => ({
    type: exports.QUICK_SEARCH_SET_CELL_MATCHING_STYLE,
    matchingCellStyle: matchingCellStyle,
});
exports.QuickSearchSetCellMatchingStyle = QuickSearchSetCellMatchingStyle;
const QuickSearchReady = (quickSearchState) => ({
    type: exports.QUICK_SEARCH_READY,
    quickSearchState,
});
exports.QuickSearchReady = QuickSearchReady;
const initialState = {
    QuickSearchText: GeneralConstants_1.EMPTY_STRING,
};
const QuickSearchReducer = (state = initialState, action) => {
    switch (action.type) {
        case exports.QUICK_SEARCH_RUN:
            return Object.assign({}, state, {
                QuickSearchText: action.quickSearchText,
            });
        case exports.QUICK_SEARCH_SET_CELL_MATCHING_STYLE:
            return Object.assign({}, state, {
                CellMatchStyle: action.matchingCellStyle,
            });
        default:
            return state;
    }
};
exports.QuickSearchReducer = QuickSearchReducer;
