|
@@ -1,17 +1,19 @@
|
|
# NgDynaform
|
|
# NgDynaform
|
|
|
|
|
|
-Beakout project to develop Dynamic Form Builder module.
|
|
|
|
|
|
+A Dynamic Form Builder for Angular.
|
|
|
|
|
|
-## General options for each control ##
|
|
|
|
|
|
+## General options for each control
|
|
|
|
|
|
-### Common field metadata properties ###
|
|
|
|
|
|
+### Common field metadata properties
|
|
|
|
+
|
|
|
|
+All fields support the following metadata. The missing properties will be 'filled oin' by dynaform's field-specific models, allowing forms to specifiued tersely.
|
|
|
|
|
|
| Property | Description | Default / Notes |
|
|
| Property | Description | Default / Notes |
|
|
|-------------------- |------------------------------------------------------------------------------- |------------------------------------------------------ |
|
|
|-------------------- |------------------------------------------------------------------------------- |------------------------------------------------------ |
|
|
-| name | The FormControl name | OBLIGATORY |
|
|
|
|
|
|
+| name | The FormControl name | Derived from the key of the control's metadata object |
|
|
| type | The control type | Text |
|
|
| type | The control type | Text |
|
|
| label | The controls's label | UnCamelCased and spaced version of name |
|
|
| label | The controls's label | UnCamelCased and spaced version of name |
|
|
-| value | The control's initial value | Empty string |
|
|
|
|
|
|
+| value | The control's initial value | Empty string |
|
|
| checkedValue | Value when checked* | Checkboxes / Checkbuttons only |
|
|
| checkedValue | Value when checked* | Checkboxes / Checkbuttons only |
|
|
| default | Default value | |
|
|
| default | Default value | |
|
|
| placeholder | Optional placeholder text | |
|
|
| placeholder | Optional placeholder text | |
|
|
@@ -25,21 +27,41 @@ Beakout project to develop Dynamic Form Builder module.
|
|
| validators | Array of validator functions - following Angular FormControl API | |
|
|
| validators | Array of validator functions - following Angular FormControl API | |
|
|
| asyncValidators | Array of async validator functions - following Angular FormControl API | |
|
|
| asyncValidators | Array of async validator functions - following Angular FormControl API | |
|
|
| valFailureMessages | Validation failure messages - display appropriate message if validation fails | |
|
|
| valFailureMessages | Validation failure messages - display appropriate message if validation fails | |
|
|
-| | | |
|
|
|
|
|
|
|
|
-### Options metadata (selects, radios, checkbutton groups, etc) ###
|
|
|
|
|
|
+```
|
|
|
|
+{
|
|
|
|
+ firstName: {},
|
|
|
|
+ lastName: {},
|
|
|
|
+ telephoneNumber: {}
|
|
|
|
+}
|
|
|
|
+```
|
|
|
|
+
|
|
|
|
+### Options metadata (selects, radios, checkbutton groups, etc)
|
|
|
|
+
|
|
|
|
+Supply an array of values, an array of [calue, label] pairs, or an array of { value: <VALUE>, label: <LABEL> } objects. If you supply a aimple array of values, each value is used as both the value and label.
|
|
|
|
+
|
|
|
|
+```
|
|
|
|
+{
|
|
|
|
+ firstName: {},
|
|
|
|
+ lastName: {},
|
|
|
|
+ telephoneNumber: {},
|
|
|
|
+ country: { type: 'select', options: ['France', 'Germany', 'Italy', 'Norway', 'Spain', 'UK'] }
|
|
|
|
+}
|
|
|
|
+```
|
|
|
|
|
|
-Supply an array of values, an array of [key, label] pairs, or an array of { label: <LABEL>, value: <VALUE> } objects. If you supply an array of values, each value is used as both the options value and label.
|
|
|
|
|
|
|
|
-## Grouping related controls using containers ##
|
|
|
|
|
|
+## Grouping related controls using containers
|
|
|
|
|
|
-Blah, de blah blat. TO ADD.
|
|
|
|
|
|
+Related cpontrols can be grouped in containers.
|
|
|
|
|
|
-### Seeding groups with shared options ###
|
|
|
|
|
|
+### Seeding groups with shared options
|
|
|
|
|
|
-### Repeating groups ###
|
|
|
|
|
|
+### Repeating groups
|
|
|
|
|
|
-## The built-in model mapper ##
|
|
|
|
|
|
+## The built-in model mapper
|
|
|
|
|
|
TO ADD.
|
|
TO ADD.
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|