{
    "version": 1,
    "supportedProjectTypes": [ ],
    "id": "Z.QtStudio.JavaScript.2",
    "category": "R.StudioJSFiles",
    "trDescription": "Creates a JavaScript file.",
    "trDisplayName": "JavaScript File",
    "trDisplayCategory": "JavaScript",
    "icon": "file_javascript.png",
    "platformIndependent": true,

    "options":
        [
        { "key": "JSFile", "value": "%{Class}.%{JS: Util.preferredSuffix('application/javascript')}" },
        { "key": "ApplicationImport", "value": "%{QmlProjectName} 1.0" },
        { "key": "RootItem", "value": "%{JS: %{RootItemCB}.RootItem}" },
        { "key": "UseImportDefault", "value": "%{JS: false}" },
        { "key": "UseQtQuickControls2Default", "value": "%{JS: true}" }
    ],

    "pages" :
        [
        {
            "trDisplayName": "Define Class",
            "trShortTitle": "Details",
            "typeId": "Fields",
            "data" :
                [
                {
                    "name": "Class",
                    "trDisplayName": "Component name:",
                    "mandatory": true,
                    "type": "LineEdit",
                    "data": {
                        "validator": "(?:[A-Z_][a-zA-Z_0-9]*|)",
                        "fixup": "%{JS: '%{INPUT}'.charAt(0).toUpperCase() + '%{INPUT}'.slice(1) }"
                    }
                },
                {
                    "name": "TargetPath",
                    "type": "PathChooser",
                    "trDisplayName": "Path:",
                    "mandatory": true,
                    "data":
                    {
                        "kind": "existingDirectory",
                        "basePath": "%{InitialPath}",
                        "path": "%{InitialPath}"
                    }
                }
            ]
        },
        {
            "trDisplayName": "Options",
            "trShortTitle": "Options",
            "typeId": "Fields",
            "data":
            [
                {
                    "name": "Stateless",
                    "trDisplayName": "Stateless library",
                    "type": "CheckBox",
                    "span": true,
                    "data":
                    {
                        "checked": false
                    }
                }
            ]
        }
    ],
    "generators" :
        [
        {
            "typeId": "File",
            "data":
            {
                "source": "file.js.tpl",
                "target": "%{TargetPath}/%{JSFile}",
                "openInEditor": true
            }
        }
    ]
}
