"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const GridHelper_1 = require("../../../../../lib/project-utility/GridHelper");
const AngularTemplate_1 = require("../../../../../lib/templates/AngularTemplate");
class HierarchicalGridEditingTemplate extends AngularTemplate_1.AngularTemplate {
    constructor() {
        super(__dirname);
        this.userExtraConfiguration = {};
        this.id = "hierarchical-grid-editing";
        this.name = "Editing Hierarchical Grid";
        this.widget = "igHierarchicalGrid";
        this.controlGroup = "Data Grids";
        this.description = "igHierarchicalGrid editing template for Angular";
        this.dependencies = ["igHierarchicalGrid"];
        this.projectType = "ig-ts";
        this.extraConfigurations = [];
        this.hasExtraConfiguration = true;
        this.listInComponentTemplates = true;
        this.gridHelper = new GridHelper_1.GridHelper();
        this.gridHelper.hierarchical = true;
        const featureConfiguration = {
            choices: ["Sorting", "Filtering", "Paging"],
            default: "",
            key: "features",
            message: "Select features for the igHierarchicalGrid",
            type: 1 /* ControlExtraConfigType.MultiChoice */
        };
        this.extraConfigurations.push(featureConfiguration);
    }
    setExtraConfiguration(extraConfigKeys) {
        this.userExtraConfiguration = extraConfigKeys;
    }
    generateConfig(name, ...options) {
        this.gridHelper.addFeature("Updating", { enableAddRow: true });
        const features = this.gridHelper.generateFeatures(this.userExtraConfiguration["features"], 3);
        const config = { gridFeatures: features };
        return super.generateConfig(name, { extraConfig: config });
    }
    getExtraConfiguration() {
        return this.extraConfigurations;
    }
}
module.exports = new HierarchicalGridEditingTemplate();
