"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const __1 = require("../..");
const handlebars = require("handlebars");
handlebars.registerHelper('calculateFormGroupCol', function (property) {
    switch (property.type) {
        case __1.SqlType.CHAR:
            if (!property.length)
                return 'col-12';
            if (property.length < 11)
                return 'col-2';
            if (property.length < 31)
                return 'col-4';
            if (property.length < 51)
                return 'col-6';
            if (property.length < 71)
                return 'col-8';
            if (property.length < 91)
                return 'col-10';
            return 'col-12';
        case __1.SqlType.BOOLEAN:
            return 'col-4';
        case __1.SqlType.DATE:
        case __1.SqlType.TIMESTAMP:
        case __1.SqlType.ENUM:
            return 'col-4';
        case __1.SqlType.ID:
            return `col-6`;
        case __1.SqlType.INT:
        case __1.SqlType['INT.UNSIGNED']:
        case __1.SqlType.SMALLINT:
        case __1.SqlType['SMALLINT.UNSIGNED']:
            if (!property.maxLength)
                return 'col-12';
            if (property.maxLength < 11)
                return 'col-2';
            if (property.maxLength < 31)
                return 'col-4';
            if (property.maxLength < 51)
                return 'col-6';
            if (property.maxLength < 71)
                return 'col-8';
            if (property.maxLength < 91)
                return 'col-10';
            return 'col-12';
        case __1.SqlType.TEXT:
            return 'col-12';
        case __1.SqlType.VARCHAR:
            if (!property.maxLength)
                return 'col-12';
            if (property.maxLength < 11)
                return 'col-2';
            if (property.maxLength < 31)
                return 'col-4';
            if (property.maxLength < 51)
                return 'col-6';
            if (property.maxLength < 71)
                return 'col-8';
            if (property.maxLength < 91)
                return 'col-10';
            return 'col-12';
    }
});
