"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const GridHelper_1 = require("../../../../../lib/project-utility/GridHelper");
const jQueryTemplate_1 = require("../../../../../lib/templates/jQueryTemplate");
class TreeGridEditingTemplate extends jQueryTemplate_1.jQueryTemplate {
    constructor() {
        super(__dirname);
        this.userExtraConfiguration = {};
        this.extraConfigurations = [];
        this.id = "tree-grid-editing";
        this.name = "TreeGrid Editing";
        this.description = "igTreeGrid editing template";
        this.projectType = "js";
        this.components = ["Tree Grid"];
        this.controlGroup = "Data Grids";
        this.dependencies = ["igTreeGrid"];
        this.hasExtraConfiguration = true;
        this.listInComponentTemplates = true;
        this.gridHelper = new GridHelper_1.GridHelper();
        this.gridHelper.tree = true;
        const featureConfiguration = {
            choices: ["Sorting", "Filtering"],
            default: "",
            key: "features",
            message: "Select optional features for the editing template",
            type: 1 /* ControlExtraConfigType.MultiChoice */
        };
        this.extraConfigurations.push(featureConfiguration);
    }
    setExtraConfiguration(extraConfigKeys) {
        this.userExtraConfiguration = extraConfigKeys;
    }
    generateConfig(name, ...options) {
        this.gridHelper.addFeature("Updating", {
            columnSettings: [{
                    columnKey: "progress",
                    editorOptions: {
                        buttonType: "spin"
                    },
                    editorType: "currency"
                },
                {
                    columnKey: "start",
                    editorType: "datepicker"
                },
                {
                    columnKey: "finish",
                    editorType: "datepicker"
                }]
        });
        const features = this.gridHelper.generateFeatures(this.userExtraConfiguration["features"], 4);
        const config = { treeGridFeatures: features };
        return super.generateConfig(name, { extraConfig: config });
    }
    getExtraConfiguration() {
        return this.extraConfigurations;
    }
}
module.exports = new TreeGridEditingTemplate();
