import { AdaptableModuleBase } from './AdaptableModuleBase';
import * as ModuleConstants from '../Utilities/Constants/ModuleConstants';
import { EditGridFilterButton } from '../View/NamedQuery/EditCurrentQueryButton';
import { GridFilterStatusbar } from '../View/GridFilter/GridFilterStatusbar';
export class GridFilterModule extends 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,
                    extraActions: [EditGridFilterButton],
                    popover,
                };
            },
        };
    }
}
