"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GridFilterModule = void 0;
const tslib_1 = require("tslib");
const AdaptableModuleBase_1 = require("./AdaptableModuleBase");
const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
const EditCurrentQueryButton_1 = require("../View/NamedQuery/EditCurrentQueryButton");
const GridFilterStatusbar_1 = require("../View/GridFilter/GridFilterStatusbar");
class GridFilterModule extends AdaptableModuleBase_1.AdaptableModuleBase {
    constructor(api) {
        super(ModuleConstants.GridFilterModuleId, ModuleConstants.GridFilterFriendlyName, 'filter-list', 'GridFilterPopup', 'Controls the Grid Filter funtionality', api);
    }
    setModuleEntitlement() {
        if (!this.api.optionsApi.getFilterOptions().useAdaptableFiltering) {
            this.AccessLevel = 'Hidden';
        }
        else {
            this.AccessLevel = this.api.entitlementApi.getEntitlementAccessLevelForModule(this.moduleInfo.ModuleName);
        }
    }
    getModuleAdaptableObjects() {
        const currentGridFilter = this.api.filterApi.gridFilterApi.getCurrentGridFilter();
        return currentGridFilter ? [currentGridFilter] : [];
    }
    getViewProperties() {
        return {
            getStatusBarPanelProps: () => {
                const popover = this.api.filterApi.gridFilterApi.getCurrentGridFilterExpression();
                return {
                    content: GridFilterStatusbar_1.GridFilterStatusbar,
                    extraActions: [EditCurrentQueryButton_1.EditGridFilterButton],
                    popover,
                };
            },
        };
    }
}
exports.GridFilterModule = GridFilterModule;
