Browse Source

Starting bare-bones documentation in README

Richard Knight 6 years ago
parent
commit
9182bf4588

+ 43 - 1
README.md

@@ -1,3 +1,45 @@
 # NgDynaform
 
-Beakout project to develop Dynamic Form Builder module
+Beakout project to develop Dynamic Form Builder module.
+
+## General options for each control ##
+
+### Common field metadata properties ###
+
+| Property           	| Description                                                                   	| Default / Notes                                      	|
+|--------------------	|-------------------------------------------------------------------------------	|------------------------------------------------------	|
+| name               	| The FormControl name                                                          	| OBLIGATORY                                           	|
+| type               	| The control type                                                              	| Text                                                 	|
+| label              	| The controls's label                                                          	| UnCamelCased and spaced version of name              	|
+| value              	| The control's initial value                                                                              	| Empty string                                         	|
+| checkedValue       	| Value when checked*                                                           	| Checkboxes / Checkbuttons only                       	|
+| default            	| Default value                                                                 	|                                                      	|
+| placeholder        	| Optional placeholder text                                                     	|                                                      	|
+| class              	| CSS classes to apply                                                          	| Single class (string) or array of classes (string[]) 	|
+| id                 	| CSS id to apply                                                               	|                                                      	|
+| disabled           	| Whether field is disbled                                                      	|                                                      	|
+| change             	| Name of function in host component to call when value changes                 	|                                                      	|
+| source             	| Location of data in model                                                      	| Same name and path. Used by model-mapper.            	|
+| before             	| Ordering instruction - move before <name of another control in group>         	|                                                      	|
+| after              	| Ordering instruction - move after <name of another control in group>          	|                                                      	|
+| validators         	| Array of 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 	|                                                      	|
+|                    	|                                                                               	|                                                      	|
+
+### Options metadata (selects, radios, checkbutton groups, etc) ###
+
+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 ##
+
+Blah, de blah blat. TO ADD.
+
+### Seeding groups with shared options ###
+
+### Repeating groups ###
+
+## The built-in model mapper ##
+
+TO ADD.
+

File diff suppressed because it is too large
+ 375 - 442
package-lock.json


+ 20 - 20
package.json

@@ -12,48 +12,48 @@
 	},
 	"private": true,
 	"dependencies": {
-		"@angular/animations": "^7.2.0",
-		"@angular/common": "^7.2.0",
-		"@angular/compiler": "^7.2.0",
-		"@angular/core": "^7.2.0",
-		"@angular/forms": "^7.2.0",
-		"@angular/http": "^7.2.0",
-		"@angular/platform-browser": "^7.2.0",
-		"@angular/platform-browser-dynamic": "^7.2.0",
-		"@angular/router": "^7.2.0",
+		"@angular/animations": "^7.2.2",
+		"@angular/common": "^7.2.2",
+		"@angular/compiler": "^7.2.2",
+		"@angular/core": "^7.2.2",
+		"@angular/forms": "^7.2.2",
+		"@angular/http": "^7.2.2",
+		"@angular/platform-browser": "^7.2.2",
+		"@angular/platform-browser-dynamic": "^7.2.2",
+		"@angular/router": "^7.2.2",
 		"@clr/angular": "^1.0.4",
 		"@clr/icons": "^1.0.4",
 		"@clr/ui": "^1.0.4",
 		"@webcomponents/custom-elements": "^1.2.1",
 		"angular-super-validator": "^2.0.0",
-		"core-js": "^2.6.2",
+		"core-js": "^2.6.3",
 		"json-formatter-js": "^2.2.1",
 		"lodash": "^4.17.11",
 		"rxjs": "^6.3.3",
 		"rxjs-compat": "^6.3.3",
-		"zone.js": "^0.8.27"
+		"zone.js": "^0.8.29"
 	},
 	"devDependencies": {
-		"@angular-devkit/build-angular": "~0.12.1",
-		"@angular/cli": "~7.2.1",
-		"@angular/compiler-cli": "^7.2.0",
-		"@angular/language-service": "^7.2.0",
-		"@types/jasmine": "~3.3.5",
+		"@angular-devkit/build-angular": "~0.12.3",
+		"@angular/cli": "~7.2.3",
+		"@angular/compiler-cli": "^7.2.2",
+		"@angular/language-service": "^7.2.2",
+		"@types/jasmine": "~3.3.8",
 		"@types/jasminewd2": "~2.0.6",
-		"@types/lodash": "^4.14.119",
+		"@types/lodash": "^4.14.120",
 		"@types/node": "~10.12.18",
 		"codelyzer": "^4.5.0",
 		"jasmine-core": "~3.3.0",
 		"jasmine-spec-reporter": "~4.2.1",
-		"karma": "~3.1.4",
+		"karma": "~4.0.0",
 		"karma-chrome-launcher": "~2.2.0",
 		"karma-coverage-istanbul-reporter": "^2.0.4",
 		"karma-jasmine": "~2.0.1",
 		"karma-jasmine-html-reporter": "^1.4.0",
 		"protractor": "^5.4.2",
 		"rxjs-tslint": "^0.1.6",
-		"ts-node": "~7.0.1",
+		"ts-node": "~8.0.2",
 		"tslint": "~5.12.1",
-		"typescript": "3.2.2"
+		"typescript": "3.2.4"
 	}
 }

+ 1 - 1
src/app/dynaform/components/clarity/checkbox/clr-checkbox.component.ts

@@ -1,6 +1,6 @@
 import { Component } from '@angular/core';
 import { NativeInputComponent } from '../../_abstract/native-input.component';
-import { meta } from '@modules/dynaform/testdata/testset.1';
+
 
 @Component({
 	selector: 'app-checkbox',

+ 1 - 1
src/app/dynaform/models/field.model.ts

@@ -124,7 +124,7 @@ class Option implements IOption {
 
 abstract class OptionsField extends SimpleField {
 	options: Option[] = [];
-	constructor(meta: IOptionsFieldMetaData, context: any) {
+	constructor(meta: IOptionsFieldMetaData, context?: any) {
 		super(meta);
 		let options;
 		if (typeof meta.options === 'function') {