Fix:
- Merged the fixes from v2.2.2
Fix:
- Fixed the rebuild on changes
Feature:
- Added a Pre Submit Handler
Fix:
- Fixed the compatibility for pre-Ivy apps.
Feature:
- Added a Pre Submit Handler
Feature:
- Updated the peerDependencies for Angular 12
Change:
- Extracted an interface of the FormBuilderComponent to remove a cyclic dependency.
BREAKING CHANGE:
- Dropped support for Angular <10.0.0
Fix:
- Fixed the order of the form fields in Firefox.
Change:
- Added type arguments to
AbstractCollectionComponent
Fix:
- Using
FormArray.push(...)
instead ofFormArray.controls.push(...)
to ensure FormGroup updates.
Fix:
- The builderInstance field was not set on AbstractLayoutType
Features:
- Added a Type Parameter for the FormModel to improve autocomplete.
- Added Angular 10 and 11 version constraints to the package.json
Fix:
- Fixed ExpressionChangedAfterItHasBeenCheckedError.
Change:
- Copyright updated.
- Added shorthand getters for valid and invalid.
Change
- Added a version constraint for Angular 9
Fix
- Recursive form validation fixed
- Fixed change detection of dynamic created components
Fix
- The content of
mwFormSlot
andmwFormField
on nonng-content
tags will be projected inside the host element
Fixed component rendering:
mw-form-slot
andmw-form-field
isn't rendered anymore in the dom
BREAKING CHANGE:
-
mw-form-slot
Component is now a Directive!- To fix your templates replace
<mw-form-slot
with<div><ng-container mwFormSlot
mw-form-slot>
withng-container></div>
- To fix your templates replace
-
mw-form-field
Component is now a Directive!- To fix your templates replace
<mw-form-field
with<div><ng-container mwFormField
mw-form-field>
withng-container></div>
- To fix your templates replace
-
AbstractFormGroupComponent
mwIsRootGroup
-> removed
Bugfix:
- Nested elements will be rendered correctly
Changes:
AbstractFormGroupComponent
- Made
cfr
andcdr
protected.
- Made
CollectionFormFieldComponent
- Made
cdr
protected.
- Made
InitHandler
- Made
instance
protected.
- Made
BREAKING CHANGE: Added parameter prefix to prevent name collision. I know that means a lot of work for you but it's necessary to reduce future bugs.
-
AbstractFormFieldComponent
formGroup
->mwFormGroup
element
->mwElement
index
->mwIndex
fieldType
->mwFieldType
path
->mwPath
slots
->mwSlots
-
AbstractFormGroupComponent
element
->mwElement
isRootGroup
->mwIsRootGroup
-
FormSlotComponent
fieldName
->mwFieldName
Features:
- Introducing the new
AbstractLayoutType
. For details check the example. - Added
AbstractLayoutComponent
Changes:
- Extracted FormGroup logic into the
AbstractFormGroupComponent
BREAKING CHANGE:
model
property removed from themw-form-group
component. UsefieldType
instead.AbstractGroupFormField
renamed toAbstractFormGroupComponent
AbstractCollectionFormFieldComponent
renamed toAbstractCollectionComponent
Code cleanup
- Created
Constructor
types instead of usingnew (...args: any[]) => any
- Using the
ModelHandler
in theAbstractCollectionFormFieldComponent
- Created a
AbstractFormControl
type to reduce usage of any - Set the return Type of the onSubmit EventEmitter in the form explicitly
- Using the
ModelHandler
in theFormComponent.initializeCollectionField
method - Made
ModelHandler.buildSingleField
public - Removed a lot of
as
and usinginstanceof
instead
- Fixed FormGroup, FormControl and FormArray initialization when the form was rebuild
- Added a
control
field to the AbstractType which holds the form control
Fixed wrong bool check in FormControl abstractions
Improved performance
- Created own FormArray, FormGroup and FormControl which extends from the default Angular classes.
- This abstractions blocks the
updateValueAndValidity
calls until the form rendering has finished - Checking in the
FormGroupComponent.ngAfterViewInit
hook, if the form was already rendered and block unnecessary rebuilding.
Other changes:
- Replaced
x.hasOwnProperty('y')
by'y' in x
and replacedif (x != null)
byif (x)
to improve the readability. - Added
asyncValidators
andupdateOn
to the AbstractType and madevalidators
non abstract
Thanks to @billbeeio for many improvements (PR#1)
Overall:
- Docs updated
- Abstract components added
- Abstract field types added
- Added FormArray type and FormGroup type. This allows to build complex and reusable form models.
- added the
getErrors
method to the form builder. It returns all validation errors as a nested object
Initial Release