"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const GridHelper_1 = require("../../../../../lib/project-utility/GridHelper");
const jQueryTemplate_1 = require("../../../../../lib/templates/jQueryTemplate");
class HierarchicalGridTemplate extends jQueryTemplate_1.jQueryTemplate {
    constructor() {
        super(__dirname);
        this.userExtraConfiguration = {};
        this.id = "hierarchical-grid";
        this.name = "Hierarchical Grid";
        this.description = "igHierarchicalGrid default template";
        this.projectType = "js";
        this.components = ["Hierarchical Grid"];
        this.controlGroup = "Data Grids";
        this.dependencies = ["igHierarchicalGrid"];
        this.gridHelper = new GridHelper_1.GridHelper();
        this.gridHelper.hierarchical = true;
        this.gridHelper.space = "    ";
        this.hasExtraConfiguration = true;
        this.extraConfigurations = [];
        const featureConfiguration = {
            choices: ["Sorting", "Paging", "Filtering"],
            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) {
        // tslint:disable:object-literal-sort-keys
        this.gridHelper.addFeature("Responsive", {
            inherit: false,
            enableVerticalRendering: false,
            columnSettings: [
                {
                    columnKey: "Title",
                    classes: "ui-hidden-phone"
                },
                {
                    columnKey: "Region",
                    classes: "ui-hidden-phone"
                },
                {
                    columnKey: "City",
                    classes: "ui-hidden-phone"
                }
            ]
        });
        // tslint:enable:object-literal-sort-keys
        const features = this.gridHelper.generateFeatures(this.userExtraConfiguration["features"], 4);
        const config = { gridfeatures: features };
        return super.generateConfig(name, { extraConfig: config });
    }
    getExtraConfiguration() {
        return this.extraConfigurations;
    }
}
module.exports = new HierarchicalGridTemplate();
