<commit_before>import React, { Component, PropTypes } from 'react'
import models from 'template-ui/lib/plugins2/form/models'
import fields from 'template-ui/lib/plugins2/form/fields'
import utils from 'template-ui/lib/plugins2/form/utils'
import validators from 'template-tools/src/utils/validators'

import config from './config'
import tables from './tables'

import TestModal from './components/TestModal'

const auth = {
  username: {
    title: 'Email',
    component: fields.input,
    validate: [validators.required,validators.email]
  },
  password: {
    type: 'password',
    validate: validators.required
  }
}

const authLogin = auth
const authRegister = auth

const layer2 = {
  name: {
    title: 'Layer2',
    validate: [validators.required]
  }
}

const inject = {
  injected: {
    title: 'Injected',
    validate: [validators.required]
  }
}

const layer1 = {
  name: {
    title: 'Layer1',  
    validate: [validators.required]
  },
  others: {
    component: fields.list,
    itemTitle: 'Thing2',
    schema: layer2,
    table: tables.layer2
  }
}

const address = {
  address1: {
    title: 'Address 1',
    validate: [validators.required]
  },
  address2: {
    title: 'Address 2',
    default: 'APPLES DEFAULT',
    validate: []
  },
  area: {
    title: 'Area',
    validate: []
  },
  city: {
    title: 'City',
    validate: [validators.required]
  },
  postcode: {
    title: 'Postcode',
    validate: [validators.required]
  }
}

const options = {
  newsletter: {
    title: 'Get newsletter?',
    component: fields.checkbox
  },
  topics: {
    title: 'Topics',
    horizontal: true,
    component: fields.multipleCheckbox,
    source: ['science', 'art', 'history']
  },
  cost: models.number({
    title: 'Cost',
    default: 22.4
  }),
  color: {
    title: 'Color',
    validate: [validators.required]
  },
  format: {
    title: 'Format',
    horizontal: true,
    component: fields.radio,
    source: ['A4', 'A3', 'A5']
  },
  country: {
    title: 'Country',
    component: fields.select,
    source: ['UK', 'France', 'SPain']
  },
  about: {
    title: 'Read This!',
    notes: 'This is some text',
    component: fields.notes
  },
  notes: {
    title: 'Notes',
    multiline: true,
    rows: 5
  }
}

const project = utils.composeParts([{
  name: {
    title: 'Name',
    validate: [validators.required]
  },
  options: {
    containerComponent: fields.section,
    childSchema: options,
    sectionTitle: 'Apples',
    inset: true
  }
},
inject,
{
  test: {
    title: 'Test List',
    itemTitle: 'Thing',
    component: fields.list,
    schema: layer1,
    table: tables.layer1,
    //formHook: 'testHook',
    //itemWindowComponent: TestModal
  },
  address: {
    title: 'Address',
    itemTitle: 'Address',
    component: fields.item,
    schema: address
  }
}])


const forms = {
  authLogin,
  authRegister,
  project
}

export default forms<commit_msg>change example forms<commit_after>import React, { Component, PropTypes } from 'react'
import models from 'template-ui/lib/plugins2/form/models'
import fields from 'template-ui/lib/plugins2/form/fields'
import utils from 'template-ui/lib/plugins2/form/utils'
import validators from 'template-tools/src/utils/validators'

import config from './config'
import tables from './tables'

import TestModal from './components/TestModal'

const auth = {
  username: {
    title: 'Email',
    component: fields.input,
    validate: [validators.required,validators.email]
  },
  password: {
    type: 'password',
    validate: validators.required
  }
}

const authLogin = auth
const authRegister = auth

const layer2 = {
  name: {
    title: 'Layer2',
    validate: [validators.required]
  }
}

const inject = {
  injected: {
    title: 'Injected',
    validate: [validators.required]
  }
}

const layer1 = {
  name: {
    title: 'Layer1',  
    validate: [validators.required]
  },
  others: {
    component: fields.list,
    itemTitle: 'Thing2',
    schema: layer2,
    table: tables.layer2
  }
}

const address = {
  address1: {
    title: 'Address 1',
    validate: [validators.required]
  },
  address2: {
    title: 'Address 2',
    default: 'APPLES DEFAULT',
    validate: []
  },
  area: {
    title: 'Area',
    validate: []
  },
  city: {
    title: 'City',
    validate: [validators.required]
  },
  postcode: {
    title: 'Postcode',
    validate: [validators.required]
  }
}

const options = {
  newsletter: {
    title: 'Get newsletter?',
    component: fields.checkbox
  },
  topics: {
    title: 'Topics',
    horizontal: true,
    component: fields.multipleCheckbox,
    source: ['science', 'art', 'history']
  },
  cost: models.number({
    title: 'Cost',
    default: 22.4
  }),
  color: {
    title: 'Color',
    validate: [validators.required]
  },
  format: {
    title: 'Format',
    horizontal: true,
    component: fields.radio,
    source: ['A4', 'A3', 'A5']
  },
  country: {
    title: 'Country',
    component: fields.select,
    source: ['UK', 'France', 'SPain']
  },
  about: {
    title: 'Read This!',
    notes: 'This is some text',
    component: fields.notes
  },
  notes: {
    title: 'Notes',
    multiline: true,
    rows: 5
  }
}

const multiForm = utils.composeParts([{
  name: {
    title: 'Name',
    validate: [validators.required]
  },
  options: {
    containerComponent: fields.section,
    childSchema: options,
    sectionTitle: 'Apples',
    inset: true
  }
},
inject,
{
  test: {
    title: 'Test List',
    itemTitle: 'Thing',
    component: fields.list,
    schema: layer1,
    table: tables.layer1,
    //formHook: 'testHook',
    //itemWindowComponent: TestModal
  },
  address: {
    title: 'Address',
    itemTitle: 'Address',
    component: fields.item,
    schema: address
  }
}])

const project = {
  name: {
    title: 'Name',
    validate: [validators.required]
  },
  options: {
    containerComponent: fields.section,
    childSchema: options,
    sectionTitle: 'Apples',
    inset: true
  }
}

const forms = {
  authLogin,
  authRegister,
  project,
  multiForm
}

export default forms
{'fraction_non_alphanumeric': 0.1443247721623861, 'fraction_numerical': 0.007622203811101905, 'mean_word_length': 2.9067961165048546, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1654112', 'n_tokens_mistral': 2044, 'n_tokens_neox': 2031, 'n_words': 484}