<commit_before>/**
 * Created by <NAME> on 08.03.2017.
 */


import {IEventHandler} from 'phovea_core/src/event';

/**
 * List of all available for elements that the form builder can handle
 * @see FormBuilder.appendElement()
 */
export enum FormElementType {
  /**
   * shows a simple select box
   * @see IFormSelectDesc
   */
  SELECT,
    /**
     * shows a select box based on select2
     * @see IFormSelect2
     */
  SELECT2,
    /**
     * similar to SELECT2 but with multiple selections allowed
     */
  SELECT2_MULTIPLE,
    /**
     * SELECT2 with additional functionality such as validation, tokenize and file drag
     */
  SELECT3,
    /**
     * similar to SELECT3 but with multiple selections allowed
     */
  SELECT3_MULTIPLE,
    /**
     * a text field
     * @see IFormInputTextDesc
     */
  INPUT_TEXT,
    /**
     * a complex dynamic sub map form element
     * @see IFormMapDesc
     */
  MAP,
    /**
     * a simple button
     * @see IButtonElementDesc
     */
  BUTTON,
    /**
     * a checkbox
     * @see ICheckBoxElementDesc
     */
  CHECKBOX,
    /**
     * a checkbox
     * @see IRadioElementDesc
     */
  RADIO
}

/**
 * The description is used to build the form element
 */
export interface IFormElementDesc {
  /**
   * Choose a type which element should be created
   */
  type: FormElementType;

  /**
   * Unique identifier for each page
   */
  id: string;

  /**
   * Label for the form element
   */
  label?: string;

  /**
   * Show or hide form element
   */
  visible?: boolean;

  /**
   * is this field required
   */
  required?: boolean;<commit_msg>Allow strings as form element type<commit_after>/**
 * Created by <NAME> on 08.03.2017.
 */


import {IEventHandler} from 'phovea_core/src/event';

/**
 * List of all available for elements that the form builder can handle
 * @see FormBuilder.appendElement()
 */
export enum FormElementType {
  /**
   * shows a simple select box
   * @see IFormSelectDesc
   */
  SELECT,
    /**
     * shows a select box based on select2
     * @see IFormSelect2
     */
  SELECT2,
    /**
     * similar to SELECT2 but with multiple selections allowed
     */
  SELECT2_MULTIPLE,
    /**
     * SELECT2 with additional functionality such as validation, tokenize and file drag
     */
  SELECT3,
    /**
     * similar to SELECT3 but with multiple selections allowed
     */
  SELECT3_MULTIPLE,
    /**
     * a text field
     * @see IFormInputTextDesc
     */
  INPUT_TEXT,
    /**
     * a complex dynamic sub map form element
     * @see IFormMapDesc
     */
  MAP,
    /**
     * a simple button
     * @see IButtonElementDesc
     */
  BUTTON,
    /**
     * a checkbox
     * @see ICheckBoxElementDesc
     */
  CHECKBOX,
    /**
     * a checkbox
     * @see IRadioElementDesc
     */
  RADIO
}

/**
 * The description is used to build the form element
 */
export interface IFormElementDesc {
  /**
   * Choose a type which element should be created
   */
  type: FormElementType | string;

  /**
   * Unique identifier for each page
   */
  id: string;

  /**
   * Label for the form element
   */
  label?: string;

  /**
   * Show or hide form element
   */
  visible?: boolean;

  /**
   * is this field required
   */
  required?: boolean;
{'fraction_non_alphanumeric': 0.10388409371146733, 'fraction_numerical': 0.010480887792848335, 'mean_word_length': 2.1382978723404253, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5180127', 'n_tokens_mistral': 1032, 'n_tokens_neox': 976, 'n_words': 317}