"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const GridHelper_1 = require("../../../../../lib/project-utility/GridHelper");
const AngularTemplate_1 = require("../../../../../lib/templates/AngularTemplate");
class TreeGridFileExplorerTemplate extends AngularTemplate_1.AngularTemplate {
    constructor() {
        super(__dirname);
        this.userExtraConfiguration = {};
        this.id = "tree-grid-file-explorer";
        this.name = "Tree Grid File Explorer";
        this.widget = "igTreeGrid";
        this.controlGroup = "Data Grids";
        this.description = "igTreeGrid file explorer template for Angular";
        this.dependencies = ["igTreeGrid"];
        this.projectType = "ig-ts";
        this.listInComponentTemplates = false;
        this.listInCustomTemplates = true;
        this.hasExtraConfiguration = true;
        this.extraConfigurations = [];
        this.gridHelper = new GridHelper_1.GridHelper();
        this.gridHelper.tree = true;
        const featureConfiguration = {
            choices: ["Sorting"],
            default: "",
            key: "features",
            message: "Select features for the igTreeGrid",
            type: 1 /* ControlExtraConfigType.MultiChoice */
        };
        this.extraConfigurations.push(featureConfiguration);
    }
    setExtraConfiguration(extraConfigKeys) {
        this.userExtraConfiguration = extraConfigKeys;
    }
    generateConfig(name, ...options) {
        this.gridHelper.addFeature("Selection", { multipleSelection: true });
        this.gridHelper.updateFeature("RowSelectors", {
            checkBoxMode: "biState",
            enableCheckBoxes: true,
            enableRowNumbering: false,
            enableSelectAllForPaging: true,
            rowSelectorColumnWidth: null
        });
        this.gridHelper.addFeature("Filtering", {
            columnSettings: [{
                    columnKey: "dateModified",
                    condition: "after"
                },
                {
                    columnKey: "size",
                    condition: "greaterThan"
                }]
        });
        this.gridHelper.addFeature("Paging", { pageSize: 4, mode: "rootLevelOnly" });
        const features = this.gridHelper.generateFeatures(this.userExtraConfiguration["features"], 3);
        const config = { treeGridFeatures: features };
        return super.generateConfig(name, { extraConfig: config });
    }
    getExtraConfiguration() {
        return this.extraConfigurations;
    }
}
module.exports = new TreeGridFileExplorerTemplate();
