import { XDataDefinition } from "../../../Common/Data/XDataDefinition";
import { ObjectDataDefinition } from "../../../Common/Data/Definitions/ObjectDataDefinition";
import { StringDataDefinition } from "../../../Common/Data/Definitions/StringDataDefinition";
import { BooleanDataDefinition } from "../../../Common/Data/Definitions/BooleanDataDefinition";
import { NumberDataDefinition } from "../../../Common/Data/Definitions/NumberDataDefinition";
import { DateDataDefinition } from "../../../Common/Data/Definitions/DateDataDefinition";
export function getEmptyDataDefinition() {
    return new XDataDefinition();
}
export function getMergeEditorDataDefinition() {
    let def = new XDataDefinition();
    let fdef = new StringDataDefinition();
    fdef.name = "name";
    def.fields.push(fdef);
    fdef = new StringDataDefinition();
    fdef.name = "title";
    def.fields.push(fdef);
    fdef = new StringDataDefinition();
    fdef.name = "job";
    def.fields.push(fdef);
    return def;
}
export function getFilledDataDefinition() {
    let def = new XDataDefinition();
    let fdef;
    fdef = new StringDataDefinition();
    fdef.name = "stringfield";
    def.fields.push(fdef);
    fdef = new BooleanDataDefinition();
    fdef.name = "boolfield";
    def.fields.push(fdef);
    def.fields.push(new BooleanDataDefinition('isMarried'));
    let odef = new ObjectDataDefinition();
    odef.name = "person";
    fdef = new StringDataDefinition();
    fdef.name = "firstName";
    odef.fields.push(fdef);
    fdef = new StringDataDefinition();
    fdef.name = "lastName";
    odef.fields.push(fdef);
    let childdef = new ObjectDataDefinition();
    childdef.name = "children";
    childdef.list = true;
    fdef = new StringDataDefinition();
    fdef.name = "name";
    childdef.fields.push(fdef);
    odef.fields.push(childdef);
    def.fields.push(odef);
    return def;
}
// 5 x 5 string data definition
export function get5x5StringDataDefinition(list, validValues) {
    let def = new XDataDefinition();
    for (let i = 0; i < 5; i++) {
        for (let j = 0; j < 5; j++) {
            let fdef = new StringDataDefinition(`string_${i}_${j}`);
            if (list) {
                fdef.list = list;
            }
            if (validValues) {
                fdef.validValues = validValues;
            }
            if (((i + 1) * (j + 1)) % 2 === 0) {
                for (let k = 0; k < (i + 1) * (j + 1); k++) {
                    fdef.validValues.push(`${k + 1}`);
                }
            }
            def.fields.push(fdef);
        }
    }
    return def;
}
export function get5x5NumberDataDefinition(list) {
    let def = new XDataDefinition();
    for (let i = 0; i < 5; i++) {
        for (let j = 0; j < 5; j++) {
            let fdef = new NumberDataDefinition(`number_${i}_${j}`);
            if (list) {
                fdef.list = list;
            }
            def.fields.push(fdef);
        }
    }
    return def;
}
export function get5x5BooleanDataDefinition(list) {
    let def = new XDataDefinition();
    for (let i = 0; i < 5; i++) {
        for (let j = 0; j < 5; j++) {
            let fdef = new BooleanDataDefinition(`boolean_${i}_${j}`);
            if (list) {
                fdef.list = list;
            }
            def.fields.push(fdef);
        }
    }
    return def;
}
export function get5x5DateDataDefinition(list) {
    let def = new XDataDefinition();
    for (let i = 0; i < 5; i++) {
        for (let j = 0; j < 5; j++) {
            let fdef = new DateDataDefinition(`date_${i}_${j}`);
            if (list) {
                fdef.list = list;
            }
            def.fields.push(fdef);
        }
    }
    return def;
}
export function get5x5ObjectDefinition(list) {
    let def = new XDataDefinition();
    for (let i = 0; i < 5; i++) {
        for (let j = 0; j < 5; j++) {
            let odef = new ObjectDataDefinition(`object_${i}_${j}`);
            if (list) {
                odef.list = list;
            }
            let str1 = new StringDataDefinition("firstName");
            let str2 = new StringDataDefinition("lastName");
            odef.fields.push(str1);
            odef.fields.push(str2);
            def.fields.push(odef);
        }
    }
    return def;
}
//# sourceMappingURL=DataTestData.js.map