"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const GridHelper_1 = require("../../../../../lib/project-utility/GridHelper");
const ReactTemplate_1 = require("../../../../../lib/templates/ReactTemplate");
class GridEditingTemplate extends ReactTemplate_1.ReactTemplate {
    constructor() {
        super(__dirname);
        this.extraConfigurations = [];
        this.userExtraConfiguration = {};
        this.id = "grid-editing";
        this.name = "Grid Editing";
        this.widget = "igGrid";
        this.description = "igGrid editing template for React";
        this.projectType = "es6";
        this.components = ["Grid"];
        this.controlGroup = "Data Grids";
        this.dependencies = ["igGrid"];
        this.gridHelper = new GridHelper_1.GridHelper();
        this.hasExtraConfiguration = true;
        this.extraConfigurations.push({
            choices: ["Sorting", "Filtering", "Paging"],
            default: "",
            key: "features",
            message: "Select features for the igGrid",
            type: 1 /* ControlExtraConfigType.MultiChoice */
        });
    }
    generateConfig(name, ...options) {
        this.gridHelper.addFeature("Updating", { enableAddRow: true });
        const features = this.gridHelper.generateFeatures(this.userExtraConfiguration["features"], 5);
        const config = { gridfeatures: features };
        return super.generateConfig(name, { extraConfig: config });
    }
    getExtraConfiguration() {
        return this.extraConfigurations;
    }
    setExtraConfiguration(extraConfigKeys) {
        this.userExtraConfiguration = extraConfigKeys;
    }
}
module.exports = new GridEditingTemplate();
