Skip to content

Commit

Permalink
1.1.0 (closes #153)
Browse files Browse the repository at this point in the history
  • Loading branch information
udos86 committed Oct 28, 2016
1 parent a4b2424 commit 8ff742f
Show file tree
Hide file tree
Showing 30 changed files with 93 additions and 28 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# 1.1.0

### **Breaking Changes**

* none

### **Bugfixes**

* none

### **Features**

* Error Messaging system to `ui-bootstrap` and `ui-foundation` added (closes [#153](https://github.com/udos86/ng2-dynamic-forms/issues/153)
, see [README.md](https://github.com/udos86/ng2-dynamic-forms#validation-messaging)) **Thanks @DavyJohnes**
* `()Output change` `EventEmitter<Event>` added to `DynamicFormControlComponent` ([#149](https://github.com/udos86/ng2-dynamic-forms/issues/149))
* Update to `@angular 2.1.2`


# 1.0.7

### **Breaking Changes**
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -543,10 +543,14 @@ new DynamicInputModel({
**2. Enable error messaging by binding the** `hasErrorMessaging` `@Input()`**property of any** `DynamicFormBootstrapComponent` **or**
`DynamicFormFoundationSitesComponent` **to** `true`:
```ts
<dynamic-form-bootstrap-control *ngFor="let controlModel of myDynamicFormModel"
[controlGroup]="control.at(idx)"
[model]="controlModel"
[hasErrorMessaging]="controlModel.hasErrorMessages"></dynamic-form-bootstrap-control>

<form [formGroup]="myForm">

<dynamic-form-bootstrap-control *ngFor="let controlModel of myDynamicFormModel"
[controlGroup]="myForm"
[model]="controlModel"
[hasErrorMessaging]="controlModel.hasErrorMessages"></dynamic-form-bootstrap-control>
</form>
```

**Still you are completely free to implement your own validation messaging. Follow the recommended approach below**:
Expand Down
4 changes: 2 additions & 2 deletions build/tasks/increment-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ module.exports = function (pkg, src, type, dest) {
switch (type) {

case "MAJOR":
versionString = (Number($1) + 1) + "." + $2 + "." + $3;
versionString = (Number($1) + 1) + ".0.0";
break;

case "MINOR":
versionString = $1 + "." + (Number($2) + 1) + "." + $3;
versionString = $1 + "." + (Number($2) + 1) + ".0";
break;

case "PATCH":
Expand Down
2 changes: 1 addition & 1 deletion modules/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ng2-dynamic-forms/core",
"version": "1.0.7",
"version": "1.1.0",
"description": "A rapid form development library for Angular 2",
"main": "./bundles/core.umd.js",
"keywords": [
Expand Down
7 changes: 5 additions & 2 deletions modules/core/src/component/dynamic-form-control.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export abstract class DynamicFormControlComponent implements OnInit, OnDestroy {

bindId: boolean;
blur: EventEmitter<FocusEvent>;
change: EventEmitter<Event>;
control: FormControl;
controlGroup: FormGroup;
customTemplate: TemplateRef<any>;
Expand Down Expand Up @@ -177,14 +178,16 @@ export abstract class DynamicFormControlComponent implements OnInit, OnDestroy {
//@endexclude
}

onChange($event) {
onChange($event: Event) {

this.change.emit($event);

if (this.model.type === DYNAMIC_FORM_CONTROL_TYPE_INPUT) {

let inputModel = <DynamicInputModel> this.model;

if (inputModel.inputType === DYNAMIC_FORM_CONTROL_INPUT_TYPE_FILE) {
inputModel.files = $event.srcElement.files;
inputModel.files = $event.srcElement["files"];
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ describe("DynamicRadioModel test suite", () => {
it("tests if default model is correctly initialized", () => {

expect(defaultModel.disabled).toBe(false);
expect(defaultModel.errorMessages).toBeNull();
expect(defaultModel.hasErrorMessages).toBe(false);
expect(defaultModel.id).toEqual(config.id);
expect(defaultModel.label).toBeNull();
expect(defaultModel.legend).toBeNull();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ describe("DynamicTextAreaModel test suite", () => {
expect(defaultModel.cols).toBe(20);
expect(defaultModel.disabled).toBe(false);
expect(defaultModel.errorMessages).toBeNull();
expect(defaultModel.hasErrorMessages).toBe(false);
expect(defaultModel.id).toEqual(config.id);
expect(defaultModel.label).toBeNull();
expect(defaultModel.name).toEqual(defaultModel.id);
Expand Down
4 changes: 2 additions & 2 deletions modules/ui-basic/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ng2-dynamic-forms/ui-basic",
"version": "1.0.7",
"version": "1.1.0",
"description": "Basic UI package for ng2 Dynamic Forms",
"main": "./bundles/ui-basic.umd.js",
"keywords": [
Expand Down Expand Up @@ -30,7 +30,7 @@
"@angular/core": "^2.1.2",
"@angular/common": "^2.1.2",
"@angular/forms": "^2.1.2",
"@ng2-dynamic-forms/core": "^1.0.7",
"@ng2-dynamic-forms/core": "^1.1.0",
"rxjs": "^5.0.0-rc.1"
}
}
2 changes: 2 additions & 0 deletions modules/ui-basic/src/dynamic-form-basic.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
[model]="controlModel"
[nestedTemplate]="nestedTemplate"
(blur)="onBlur($event)"
(change)="onChange($event)"
(focus)="onFocus($event)"></dynamic-form-basic-control>

<template [ngTemplateOutlet]="customTemplate || nestedTemplate"
Expand All @@ -57,6 +58,7 @@
[model]="controlModel"
[nestedTemplate]="customTemplate"
(blur)="onBlur($event)"
(change)="onChange($event)"
(focus)="onFocus($event)"></dynamic-form-basic-control>
</fieldset>

Expand Down
5 changes: 5 additions & 0 deletions modules/ui-basic/src/dynamic-form-basic.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ describe("DynamicFormBasicComponent test suite", () => {
expect(component.onControlValueChanges).toBeDefined();
expect(component.onModelDisabledUpdates).toBeDefined();
expect(component.onModelValueUpdates).toBeDefined();

expect(component.blur).toBeDefined();
expect(component.change).toBeDefined();
expect(component.focus).toBeDefined();

expect(component.onBlur).toBeDefined();
expect(component.onChange).toBeDefined();
expect(component.onFocus).toBeDefined();
Expand Down
1 change: 1 addition & 0 deletions modules/ui-basic/src/dynamic-form-basic.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export class DynamicFormBasicComponent extends DynamicFormControlComponent {
@Input() nestedTemplate: TemplateRef<any>;

@Output() blur: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();
@Output() change: EventEmitter<Event> = new EventEmitter<Event>();
@Output() focus: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();

@ContentChild(TemplateRef) customTemplate;
Expand Down
4 changes: 2 additions & 2 deletions modules/ui-bootstrap/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ng2-dynamic-forms/ui-bootstrap",
"version": "1.0.7",
"version": "1.1.0",
"description": "Bootstrap UI package for ng2 Dynamic Forms",
"main": "./bundles/ui-bootstrap.umd.js",
"keywords": [
Expand Down Expand Up @@ -31,7 +31,7 @@
"@angular/core": "^2.1.2",
"@angular/forms": "^2.1.2",
"@angular/common": "^2.1.2",
"@ng2-dynamic-forms/core": "^1.0.7",
"@ng2-dynamic-forms/core": "^1.1.0",
"bootstrap": "^3.3.7",
"rxjs": "^5.0.0-rc.1"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
[model]="controlModel"
[nestedTemplate]="nestedTemplate"
(blur)="onBlur($event)"
(change)="onChange($event)"
(focus)="onFocus($event)"></dynamic-form-bootstrap-control>

<template [ngTemplateOutlet]="customTemplate || nestedTemplate"
Expand All @@ -75,6 +76,7 @@
[model]="controlModel"
[nestedTemplate]="customTemplate"
(blur)="onBlur($event)"
(change)="onChange($event)"
(focus)="onFocus($event)"></dynamic-form-bootstrap-control>
</fieldset>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ describe("DynamicFormBootstrapComponent test suite", () => {
expect(component.onModelDisabledUpdates).toBeDefined();
expect(component.onModelValueUpdates).toBeDefined();

expect(component.blur).toBeDefined();
expect(component.change).toBeDefined();
expect(component.focus).toBeDefined();

expect(component.onBlur).toBeDefined();
expect(component.onChange).toBeDefined();
expect(component.onFocus).toBeDefined();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export class DynamicFormBootstrapComponent extends DynamicFormControlComponent {
@Input() nestedTemplate: TemplateRef<any>;

@Output() blur: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();
@Output() change: EventEmitter<Event> = new EventEmitter<Event>();
@Output() focus: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();

@ContentChild(TemplateRef) customTemplate;
Expand Down
4 changes: 2 additions & 2 deletions modules/ui-foundation/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ng2-dynamic-forms/ui-foundation",
"version": "1.0.7",
"version": "1.1.0",
"description": "Foundation UI package for ng2 Dynamic Forms",
"main": "./bundles/ui-foundation.umd.js",
"keywords": [
Expand Down Expand Up @@ -31,7 +31,7 @@
"@angular/core": "^2.1.2",
"@angular/common": "^2.1.2",
"@angular/forms": "^2.1.2",
"@ng2-dynamic-forms/core": "^1.0.7",
"@ng2-dynamic-forms/core": "^1.1.0",
"foundation-sites": "^6.2.3",
"rxjs": "^5.0.0-rc.1"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
[model]="controlModel"
[nestedTemplate]="nestedTemplate"
(blur)="onBlur($event)"
(change)="onChange($event)"
(focus)="onFocus($event)"></dynamic-form-foundation-sites-control>

<template [ngTemplateOutlet]="customTemplate || nestedTemplate"
Expand All @@ -52,6 +53,7 @@
[model]="controlModel"
[nestedTemplate]="customTemplate"
(blur)="onBlur($event)"
(change)="onChange($event)"
(focus)="onFocus($event)"></dynamic-form-foundation-sites-control>
</fieldset>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ describe("DynamicFormFoundationSitesComponent test suite", () => {
expect(component.onModelDisabledUpdates).toBeDefined();
expect(component.onModelValueUpdates).toBeDefined();

expect(component.blur).toBeDefined();
expect(component.change).toBeDefined();
expect(component.focus).toBeDefined();

expect(component.onBlur).toBeDefined();
expect(component.onChange).toBeDefined();
expect(component.onFocus).toBeDefined();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export class DynamicFormFoundationSitesComponent extends DynamicFormControlCompo
@Input() nestedTemplate: TemplateRef<any>;

@Output() blur: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();
@Output() change: EventEmitter<Event> = new EventEmitter<Event>();
@Output() focus: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();

@ContentChild(TemplateRef) customTemplate;
Expand Down
4 changes: 2 additions & 2 deletions modules/ui-kendo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ng2-dynamic-forms/ui-kendo",
"version": "1.0.7",
"version": "1.1.0",
"description": "Kendo UI package for ng2 Dynamic Forms",
"main": "./bundles/ui-kendo.umd.js",
"keywords": [
Expand Down Expand Up @@ -31,7 +31,7 @@
"@angular/core": "^2.1.2",
"@angular/common": "^2.1.2",
"@angular/forms": "^2.1.2",
"@ng2-dynamic-forms/core": "^1.0.7",
"@ng2-dynamic-forms/core": "^1.1.0",
"@progress/kendo-angular-dropdowns": "^0.11.0",
"@progress/kendo-angular-inputs": "^0.11.0",
"rxjs": "^5.0.0-rc.1"
Expand Down
1 change: 1 addition & 0 deletions modules/ui-kendo/src/dynamic-form-kendo.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export class DynamicFormKendoComponent extends DynamicFormControlComponent {
@Input() nestedTemplate: TemplateRef<any>;

@Output() blur: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();
@Output() change: EventEmitter<Event> = new EventEmitter<Event>();
@Output() focus: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();

@ContentChild(TemplateRef) customTemplate;
Expand Down
4 changes: 2 additions & 2 deletions modules/ui-material/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ng2-dynamic-forms/ui-material",
"version": "1.0.7",
"version": "1.1.0",
"description": "Material UI package for ng2 Dynamic Forms",
"main": "./bundles/ui-material.umd.js",
"keywords": [
Expand Down Expand Up @@ -32,7 +32,7 @@
"@angular/common": "^2.1.2",
"@angular/forms": "^2.1.2",
"@angular/material": "^2.0.0-alpha.9-3",
"@ng2-dynamic-forms/core": "^1.0.7",
"@ng2-dynamic-forms/core": "^1.1.0",
"hammerjs": "^2.0.8",
"rxjs": "^5.0.0-rc.1"
}
Expand Down
2 changes: 2 additions & 0 deletions modules/ui-material/src/dynamic-form-material.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
[model]="controlModel"
[nestedTemplate]="customTemplate"
(blur)="onBlur($event)"
(change)="onChange($event)"
(focus)="onFocus($event)"></dynamic-form-material-control>
</fieldset>

Expand All @@ -38,6 +39,7 @@
[model]="controlModel"
[nestedTemplate]="nestedTemplate"
(blur)="onBlur($event)"
(change)="onChange($event)"
(focus)="onFocus($event)"></dynamic-form-material-control>

<template [ngTemplateOutlet]="customTemplate || nestedTemplate"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ describe("DynamicFormMaterialComponent test suite", () => {
expect(component.onModelDisabledUpdates).toBeDefined();
expect(component.onModelValueUpdates).toBeDefined();

expect(component.blur).toBeDefined();
expect(component.change).toBeDefined();
expect(component.focus).toBeDefined();

expect(component.onBlur).toBeDefined();
expect(component.onChange).toBeDefined();
expect(component.onFocus).toBeDefined();
Expand Down
1 change: 1 addition & 0 deletions modules/ui-material/src/dynamic-form-material.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export class DynamicFormMaterialComponent extends DynamicFormControlComponent {
@Input() nestedTemplate: TemplateRef<any>;

@Output() blur: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();
@Output() change: EventEmitter<Event> = new EventEmitter<Event>();
@Output() focus: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();

@ContentChild(TemplateRef) customTemplate;
Expand Down
4 changes: 2 additions & 2 deletions modules/ui-primeng/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ng2-dynamic-forms/ui-primeng",
"version": "1.0.7",
"version": "1.1.0",
"description": "PrimeNG UI package for ng2 Dynamic Forms",
"main": "./bundles/ui-primeng.umd.js",
"keywords": [
Expand Down Expand Up @@ -31,7 +31,7 @@
"@angular/core": "^2.1.2",
"@angular/common": "^2.1.2",
"@angular/forms": "^2.1.2",
"@ng2-dynamic-forms/core": "^1.0.7",
"@ng2-dynamic-forms/core": "^1.1.0",
"primeng": "^1.0.0-beta.20",
"primeui": "^4.1.15",
"rxjs": "^5.0.0-rc.1"
Expand Down
2 changes: 2 additions & 0 deletions modules/ui-primeng/src/dynamic-form-primeng.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
[model]="controlModel"
[nestedTemplate]="customTemplate"
(blur)="onBlur($event)"
(change)="onChange($event)"
(focus)="onFocus($event)"></dynamic-form-primeng-control>
</fieldset>

Expand All @@ -100,6 +101,7 @@
[model]="controlModel"
[nestedTemplate]="nestedTemplate"
(blur)="onBlur($event)"
(change)="onChange($event)"
(focus)="onFocus($event)"></dynamic-form-primeng-control>

<template [ngTemplateOutlet]="customTemplate || nestedTemplate"
Expand Down
4 changes: 4 additions & 0 deletions modules/ui-primeng/src/dynamic-form-primeng.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ describe("DynamicFormPrimeNGComponent test suite", () => {
expect(component.onModelDisabledUpdates).toBeDefined();
expect(component.onModelValueUpdates).toBeDefined();

expect(component.blur).toBeDefined();
expect(component.change).toBeDefined();
expect(component.focus).toBeDefined();

expect(component.onBlur).toBeDefined();
expect(component.onChange).toBeDefined();
expect(component.onFocus).toBeDefined();
Expand Down
1 change: 1 addition & 0 deletions modules/ui-primeng/src/dynamic-form-primeng.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export class DynamicFormPrimeNGComponent extends DynamicFormControlComponent {
@Input() nestedTemplate: TemplateRef<any>;

@Output() blur: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();
@Output() change: EventEmitter<Event> = new EventEmitter<Event>();
@Output() focus: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();

@ContentChild(TemplateRef) customTemplate;
Expand Down
Loading

0 comments on commit 8ff742f

Please sign in to comment.