<commit_before>///<reference path="../../../references.ts"/>

class StringRenderer implements JSONForms.IRenderer {

    priority = 2;

    static inject = ['RenderDescriptionFactory'];

    render(element: IControlObject, subSchema: SchemaElement, schemaPath: string, services: JSONForms.Services): JSONForms.IRenderDescription {
        var control = JSONForms.RenderDescriptionFactory.createControlDescription(schemaPath, services, element);
        control['template'] = `<jsonforms-control>
          <input type="text" id="${schemaPath}" class="form-control jsf-control-string" ${element.readOnly ? 'readonly' : ''} data-jsonforms-model data-jsonforms-validation/>
        </jsonforms-control>`;
        return control;
    }

    isApplicable(uiElement: IUISchemaElement, subSchema: SchemaElement, schemaPath: string):boolean {
        return uiElement.type == 'Control' && subSchema !== undefined && subSchema.type == 'string';
    }
}

angular.module('jsonforms.renderers.controls.string').run(['RenderService', (RenderService) => {
    RenderService.register(new StringRenderer());
}]);<commit_msg>Fixes #166: add option for string multi-line support<commit_after>///<reference path="../../../references.ts"/>

class StringRenderer implements JSONForms.IRenderer {

    priority = 2;

    static inject = ['RenderDescriptionFactory'];

    render(element: IControlObject, subSchema: SchemaElement, schemaPath: string, services: JSONForms.Services): JSONForms.IRenderDescription {
        let control = JSONForms.RenderDescriptionFactory.createControlDescription(schemaPath, services, element);

        if (element['options'] != null && element['options']['multi']) {
            control.template = `<jsonforms-control>
               <textarea id="${schemaPath}" class="form-control jsf-control-string" ${element.readOnly ? 'readonly' : ''} data-jsonforms-model data-jsonforms-validation/>
            </jsonforms-control>`
        } else {
            control.template = `<jsonforms-control>
               <input type="text" id="${schemaPath}" class="form-control jsf-control-string" ${element.readOnly ? 'readonly' : ''} data-jsonforms-model data-jsonforms-validation/>
            </jsonforms-control>`;
        }

        return control;
    }

    isApplicable(uiElement: IUISchemaElement, subSchema: SchemaElement, schemaPath: string):boolean {
        return uiElement.type == 'Control' && subSchema !== undefined && subSchema.type == 'string';
    }
}

angular.module('jsonforms.renderers.controls.string').run(['RenderService', (RenderService) => {
    RenderService.register(new StringRenderer());
}]);
{'fraction_non_alphanumeric': 0.14557926829268292, 'fraction_numerical': 0.0019054878048780487, 'mean_word_length': 4.0, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7554659', 'n_tokens_mistral': 700, 'n_tokens_neox': 674, 'n_words': 135}