{% import "_includes/forms" as forms %}


{{ forms.textField({
    label: "Title"|t('app'),
    instructions: "Enter a custom widget title, or leave blank to use default."|t('freeform'),
    id: 'title',
    name: 'title',
    value: settings.title,
    errors: settings.getErrors('title')
}) }}

{{ forms.selectField({
    label: "Chart Type"|t('freeform'),
    id: 'chartType',
    name: 'chartType',
    options: chartTypes,
    value: settings.chartType,
    errors: settings.getErrors('chartType')
}) }}

{{ forms.selectField({
    label: "Chart Height"|t('freeform'),
    id: 'chartHeight',
    name: 'chartHeight',
    options: {
        10: "10%",
        20: "20%",
        30: "30%",
        40: "40%",
        50: "50%",
        60: "60%",
        70: "70%",
        80: "80%",
        90: "90%",
        100: "100%",
    },
    value: settings.chartHeight,
    errors: settings.getErrors('chartHeight')
}) }}

{{ forms.selectField({
    label: "Date Range"|t('freeform'),
    id: 'dateRange',
    name: 'dateRange',
    options: dateRangeOptions,
    value: settings.dateRange,
    errors: settings.getErrors('dateRange')
}) }}

{{ forms.lightswitchField({
    label: "Display all Form Data as a Single Combined Line"|t('freeform'),
    id: 'aggregate',
    name: 'aggregate',
    on: settings.aggregate,
    errors: settings.getErrors('aggregate')
}) }}

{{ forms.checkboxSelectField({
    label: "Forms"|t('freeform'),
    instructions: "Select the forms for which submission data should be included."|t('freeform'),
    id: 'formIds',
    name: 'formIds',
    options: formOptions,
    values: settings.formIds|length ? settings.formIds : '*',
    errors: settings.getErrors('formIds'),
    showAllOption: true,
}) }}
