<commit_before># aurelia-form

[![ZenHub](https://raw.githubusercontent.com/ZenHubIO/support/master/zenhub-badge.png)](https://zenhub.io)
[![Join the chat at https://gitter.im/aurelia/discuss](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/aurelia/discuss?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

> Makes working with forms just a tad more pleasant.

This library is an unofficial plugin for the [Aurelia](http://www.aurelia.io/) platform.

> To keep up to date on [Aurelia](http://www.aurelia.io/), please visit and subscribe to [the official blog](http://blog.durandal.io/). If you have questions, we invite you to [join us on Gitter](https://gitter.im/aurelia/discuss). If you would like to have deeper insight into our development process, please install the [ZenHub](https://zenhub.io) Chrome Extension and visit any of our repository's boards. You can get an overview of all Aurelia work by visiting [the framework board](https://github.com/aurelia/framework#boards).

## Features (currently)

- Generates forms based on a form schema
- Select what framework you would want to use
- Use the form elements belonging to the chosen framework or
- Overwrite the framework elements with a custom one.
- Custom elements for defining where and with what you would want to generate
  forms
- Always defaults to a input text element
- Two-way data binding by default.
- Nest schemas in schemas using the fieldset type

## Installation

Make sure to execute these commands from project root.

### webpack

`npm install aurelia-form`

### jspm

`jspm install github:spoonx/aurelia-form`

## Configure

To get started some configurations are required.

```js
  aurelia.use
    .plugin('aurelia-form', config => {
      config.configure({

        /* will only work if i18n is defined */
        translate: true,

        /* this will determine what framework is to be used */
        framework: 'bootstrap',

        /* used to define the location of custom components */
        location: './my/components',

        /* set your custom components */
        components: {

          /* key is the type and value the location of the component*/
          date: '{{location}}/datepicker'

        }

        /***
         * Aliases are used to avoid having to define a custom component because
         * there is no component registered for that type. When interpreting the
         * schema, it checks if the type is an alias, and uses the aliased type
         * instead when rendering the forms.
         *
         * It is also necessary to leverage the input field to it's fullest. The
         * input field needs a valid type-attribute value. Imagine you use the<commit_msg>doc(README): Update README.md<commit_after># aurelia-form

[![ZenHub](https://raw.githubusercontent.com/ZenHubIO/support/master/zenhub-badge.png)](https://zenhub.io)
[![Join the chat at https://gitter.im/aurelia/discuss](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/aurelia/discuss?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

> Makes working with forms just a tad more pleasant.

This library is an unofficial plugin for the [Aurelia](http://www.aurelia.io/) platform.

> To keep up to date on [Aurelia](http://www.aurelia.io/), please visit and subscribe to [the official blog](http://blog.durandal.io/). If you have questions, we invite you to [join us on Gitter](https://gitter.im/aurelia/discuss). If you would like to have deeper insight into our development process, please install the [ZenHub](https://zenhub.io) Chrome Extension and visit any of our repository's boards. You can get an overview of all Aurelia work by visiting [the framework board](https://github.com/aurelia/framework#boards).

## Features (currently)

- Generates forms based on a form schema
- Select what framework you would want to use
- Use the form elements belonging to the chosen framework or
- Overwrite the framework elements with a custom one.
- Custom elements for defining where and with what you would want to generate
  forms
- Always defaults to a input text element
- Two-way data binding by default.
- Nest schemas in schemas using the fieldset type

## Installation

Make sure to execute these commands from project root.

### webpack

`npm install aurelia-form`

### jspm

`jspm install github:spoonx/aurelia-form`

## Configure

To get started some configurations are required.

```js
  aurelia.use
    .plugin('aurelia-form', config => {
      config.configure({

        /* will only work if i18n is defined */
        translate: true,

        /* this will determine what framework is to be used */
        framework: 'bootstrap',

        /* used to define the location of custom components */
        location: './my/components',

        /* set your custom components */
        components: {

          /* key is the type and value the location of the component*/
          date: '{{location}}/datepicker'

        },

        /***
         * Aliases are used to avoid having to define a custom component because
         * there is no component registered for that type. When interpreting the
         * schema, it checks if the type is an alias, and uses the aliased type
         * instead when rendering the forms.
         *
         * It is also necessary to leverage the input field to it's fullest. The
         * input field needs a valid type-attribute value. Imagine you use the
{'fraction_non_alphanumeric': 0.09313815187557183, 'fraction_numerical': 0.001463860933211345, 'mean_word_length': 3.2175925925925926, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 16, 'lorem ipsum': 0, 'www.': 4, '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': '392012', 'n_tokens_mistral': 1542, 'n_tokens_neox': 1479, 'n_words': 615}