"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.fieldParams = void 0;
const ns_1 = __importDefault(require("../../ns"));
const style_1 = require("../../style");
/**
 * The fieldParams object defines various constants
 * for use in various form fields. Depending on the
 * field in questions, different values may be read
 * from here.
 */
exports.fieldParams = {
    /**
     * Text field
     *
     * For possible date popups see e.g. http://www.dynamicdrive.com/dynamicindex7/jasoncalendar.htm
     * or use HTML5: http://www.w3.org/TR/2011/WD-html-markup-20110113/input.date.html
     */
    [ns_1.default.ui('ColorField').uri]: {
        size: 9,
        type: 'color',
        style: 'height: 3em;', // around 1.5em is padding
        dt: 'color',
        pattern: /^\s*#[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]([0-9a-f][0-9a-f])?\s*$/
    }, // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/color
    [ns_1.default.ui('DateField').uri]: {
        size: 20,
        type: 'date',
        dt: 'date',
        pattern: /^\s*[0-9][0-9][0-9][0-9](-[0-1]?[0-9]-[0-3]?[0-9])?Z?\s*$/
    },
    [ns_1.default.ui('DateTimeField').uri]: {
        size: 20,
        type: 'datetime-local', // See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime
        dt: 'dateTime',
        pattern: /^\s*[0-9][0-9][0-9][0-9](-[0-1]?[0-9]-[0-3]?[0-9])?(T[0-2][0-9]:[0-5][0-9](:[0-5][0-9])?)?Z?\s*$/
    },
    [ns_1.default.ui('TimeField').uri]: {
        size: 10,
        type: 'time',
        dt: 'time',
        pattern: /^\s*([0-2]?[0-9]:[0-5][0-9](:[0-5][0-9])?)\s*$/
    },
    [ns_1.default.ui('IntegerField').uri]: {
        size: 12,
        style: 'text-align: right;',
        dt: 'integer',
        pattern: /^\s*-?[0-9]+\s*$/
    },
    [ns_1.default.ui('DecimalField').uri]: {
        size: 12,
        style: 'text-align: right;',
        dt: 'decimal',
        pattern: /^\s*-?[0-9]*(\.[0-9]*)?\s*$/
    },
    [ns_1.default.ui('FloatField').uri]: {
        size: 12,
        style: 'text-align: right;',
        dt: 'float',
        pattern: /^\s*-?[0-9]*(\.[0-9]*)?((e|E)-?[0-9]*)?\s*$/
    },
    [ns_1.default.ui('SingleLineTextField').uri]: {},
    [ns_1.default.ui('NamedNodeURIField').uri]: {
        namedNode: true
    },
    [ns_1.default.ui('TextField').uri]: {},
    [ns_1.default.ui('PhoneField').uri]: {
        size: 20,
        uriPrefix: 'tel:',
        pattern: /^\+?[\d-]+[\d]*$/
    },
    [ns_1.default.ui('EmailField').uri]: {
        size: 30,
        uriPrefix: 'mailto:',
        pattern: /^\s*.*@.*\..*\s*$/ // @@ Get the right regexp here
    },
    [ns_1.default.ui('Group').uri]: {
        style: style_1.style.formGroupStyle
    },
    /**
     * Non-interactive fields
     */
    [ns_1.default.ui('Comment').uri]: {
        element: 'p',
        style: style_1.style.commentStyle
    },
    [ns_1.default.ui('Heading').uri]: {
        element: 'h3',
        style: style_1.style.formHeadingStyle
    }
};
//# sourceMappingURL=fieldParams.js.map