ngrx-forms
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -1431,2 +1431,6 @@ var __extends = (this && this.__extends) || (function () { | ||
} | ||
if (this.state && newState.id !== this.state.id) { | ||
this.valueWasReported = false; | ||
this.lastReportedViewValue = (undefined); | ||
} | ||
this.state = newState; | ||
@@ -1459,3 +1463,3 @@ this.stateSubject$.next(newState); | ||
*/ | ||
NgrxFormControlDirective.prototype.ngOnInit = function () { | ||
NgrxFormControlDirective.prototype.ngAfterViewInit = function () { | ||
var _this = this; | ||
@@ -1468,2 +1472,3 @@ if (!this.state) { | ||
if (newValue !== _this.state.value) { | ||
_this.valueWasReported = true; | ||
_this.lastReportedViewValue = newValue; | ||
@@ -1482,3 +1487,3 @@ _this.actionsSubject.next(new SetValueAction(_this.state.id, newValue)); | ||
.map(function (s) { return s.value; }) | ||
.filter(function (v) { return v !== _this.lastReportedViewValue; }) | ||
.filter(function (v) { return !_this.valueWasReported || v !== _this.lastReportedViewValue; }) | ||
.subscribe(function (value) { return _this.valueAccessor.writeValue(value); })); | ||
@@ -1485,0 +1490,0 @@ if (this.valueAccessor.setDisabledState) { |
@@ -1381,2 +1381,6 @@ import { Directive, ElementRef, HostBinding, HostListener, Inject, Input, NgModule, Renderer2, Self, forwardRef } from '@angular/core'; | ||
} | ||
if (this.state && newState.id !== this.state.id) { | ||
this.valueWasReported = false; | ||
this.lastReportedViewValue = (undefined); | ||
} | ||
this.state = newState; | ||
@@ -1398,3 +1402,3 @@ this.stateSubject$.next(newState); | ||
*/ | ||
ngOnInit() { | ||
ngAfterViewInit() { | ||
if (!this.state) { | ||
@@ -1406,2 +1410,3 @@ throw new Error('The form state must not be undefined!'); | ||
if (newValue !== this.state.value) { | ||
this.valueWasReported = true; | ||
this.lastReportedViewValue = newValue; | ||
@@ -1420,3 +1425,3 @@ this.actionsSubject.next(new SetValueAction(this.state.id, newValue)); | ||
.map(s => s.value) | ||
.filter(v => v !== this.lastReportedViewValue) | ||
.filter(v => !this.valueWasReported || v !== this.lastReportedViewValue) | ||
.subscribe(value => this.valueAccessor.writeValue(value))); | ||
@@ -1423,0 +1428,0 @@ if (this.valueAccessor.setDisabledState) { |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":3,"metadata":{"ɵa":{"__symbolic":"function"},"ɵb":{"__symbolic":"function"},"SetValueAction":{"__symbolic":"class","arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"error","message":"Could not resolve type","line":15,"character":11,"context":{"typeName":"TValue"},"module":"./src/actions"}]}]},"statics":{"TYPE":"ngrx/forms/SET_VALUE"}},"SetErrorsAction":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"@angular/forms","name":"ValidationErrors"}]}]},"statics":{"TYPE":"ngrx/forms/SET_ERRORS"}},"MarkAsDirtyAction":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"}]}]},"statics":{"TYPE":"ngrx/forms/MARK_AS_DIRTY"}},"MarkAsPristineAction":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"}]}]},"statics":{"TYPE":"ngrx/forms/MARK_AS_PRISTINE"}},"EnableAction":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"}]}]},"statics":{"TYPE":"ngrx/forms/ENABLE"}},"DisableAction":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"}]}]},"statics":{"TYPE":"ngrx/forms/DISABLE"}},"MarkAsTouchedAction":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"}]}]},"statics":{"TYPE":"ngrx/forms/MARK_AS_TOUCHED"}},"MarkAsUntouchedAction":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"}]}]},"statics":{"TYPE":"ngrx/forms/MARK_AS_UNTOUCHED"}},"FocusAction":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"}]}]},"statics":{"TYPE":"ngrx/forms/FOCUS"}},"UnfocusAction":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"}]}]},"statics":{"TYPE":"ngrx/forms/UNFOCUS"}},"SetLastKeyDownCodeAction":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"number"}]}]},"statics":{"TYPE":"ngrx/forms/SET_LAST_KEY_DOWN_CODE"}},"MarkAsSubmittedAction":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"}]}]},"statics":{"TYPE":"ngrx/forms/MARK_AS_SUBMITTED"}},"MarkAsUnsubmittedAction":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"}]}]},"statics":{"TYPE":"ngrx/forms/MARK_AS_UNSUBMITTED"}},"AddControlAction":{"__symbolic":"class","arity":2,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"error","message":"Expression form not supported","line":169,"character":10,"module":"./src/actions"},{"__symbolic":"error","message":"Expression form not supported","line":170,"character":11,"module":"./src/actions"}]}]},"statics":{"TYPE":"ngrx/forms/ADD_CONTROL"}},"RemoveControlAction":{"__symbolic":"class","arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"error","message":"Expression form not supported","line":188,"character":10,"module":"./src/actions"}]}]},"statics":{"TYPE":"ngrx/forms/REMOVE_CONTROL"}},"ValidationErrors":{"__symbolic":"interface"},"KeyValue":{"__symbolic":"interface"},"AbstractControlState":{"__symbolic":"class","arity":1,"members":{}},"FormControlState":{"__symbolic":"class","arity":1,"extends":{"__symbolic":"reference","name":"AbstractControlState"},"members":{}},"FormGroupState":{"__symbolic":"class","arity":1,"extends":{"__symbolic":"reference","name":"AbstractControlState"},"members":{}},"cast":{"__symbolic":"function","parameters":["state"],"value":{"__symbolic":"reference","name":"state"}},"createFormControlState":{"__symbolic":"function","parameters":["id","value"],"value":{"id":{"__symbolic":"reference","name":"id"},"value":{"__symbolic":"reference","name":"value"},"isValid":true,"isInvalid":false,"isEnabled":true,"isDisabled":false,"isFocused":false,"isUnfocused":true,"errors":{},"isPristine":true,"isDirty":false,"isTouched":false,"isUntouched":true,"lastKeyDownCode":-1,"isSubmitted":false,"isUnsubmitted":true}},"createFormGroupState":{"__symbolic":"function"},"formControlReducer":{"__symbolic":"function","parameters":["state","action"],"value":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"ɵa"},"arguments":[{"__symbolic":"reference","name":"state"},{"__symbolic":"reference","name":"action"}]}},"formGroupReducer":{"__symbolic":"function","parameters":["state","action"],"value":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"ɵb"},"arguments":[{"__symbolic":"reference","name":"state"},{"__symbolic":"reference","name":"action"}]}},"NgrxFormControlDirective":{"__symbolic":"class","arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[ngrxFormControlState]"}]}],"members":{"ngrxFormControlState":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"ngrxEnableFocusTracking":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"ngrxEnableLastKeydownCodeTracking":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"focusRegionStartAttr":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding"},"arguments":["attr.cdk-focus-region-start"]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject"},"arguments":[{"__symbolic":"reference","module":"@angular/platform-browser","name":"DOCUMENT"}]}],null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Self"}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject"},"arguments":[{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR"}]}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"error","message":"Could not resolve type","line":73,"character":35,"context":{"typeName":"Document"},"module":"./src/control/directive"},{"__symbolic":"reference","module":"@ngrx/store","name":"ActionsSubject"},{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"@angular/forms","name":"ControlValueAccessor"}]}]}],"convertViewValue":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"convertModelValue":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"onFocusChange":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener"},"arguments":["focusin"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener"},"arguments":["focusout"]}]}],"onKeyDown":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener"},"arguments":["keydown",["$event"]]}]}]}},"NgrxFormDirective":{"__symbolic":"class","arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"form[ngrxFormState]"}]}],"members":{"state":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["ngrxFormState"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@ngrx/store","name":"ActionsSubject"}]}],"ngOnInit":[{"__symbolic":"method"}],"onSubmit":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener"},"arguments":["submit",["$event"]]}]}]}},"updateGroup":{"__symbolic":"function","parameters":["updateFns"],"value":{"__symbolic":"error","message":"Function call not supported","line":55,"character":9,"module":"./src/update-functions"}},"compose":{"__symbolic":"function","parameters":["fns"],"value":{"__symbolic":"error","message":"Function call not supported","line":62,"character":9,"module":"./src/update-functions"}},"groupUpdateReducer":{"__symbolic":"function","parameters":["updateFnsArr"],"value":{"__symbolic":"error","message":"Function call not supported","line":66,"character":9,"module":"./src/update-functions"}},"setValue":{"__symbolic":"function"},"validate":{"__symbolic":"function"},"enable":{"__symbolic":"function","parameters":["state"],"value":{"__symbolic":"error","message":"Reference to a non-exported function","line":73,"character":9,"context":{"name":"abstractControlReducer"},"module":"./src/update-functions"}},"disable":{"__symbolic":"function","parameters":["state"],"value":{"__symbolic":"error","message":"Reference to a non-exported function","line":73,"character":9,"context":{"name":"abstractControlReducer"},"module":"./src/update-functions"}},"markAsDirty":{"__symbolic":"function","parameters":["state"],"value":{"__symbolic":"error","message":"Reference to a non-exported function","line":73,"character":9,"context":{"name":"abstractControlReducer"},"module":"./src/update-functions"}},"markAsPristine":{"__symbolic":"function","parameters":["state"],"value":{"__symbolic":"error","message":"Reference to a non-exported function","line":73,"character":9,"context":{"name":"abstractControlReducer"},"module":"./src/update-functions"}},"markAsTouched":{"__symbolic":"function","parameters":["state"],"value":{"__symbolic":"error","message":"Reference to a non-exported function","line":73,"character":9,"context":{"name":"abstractControlReducer"},"module":"./src/update-functions"}},"markAsUntouched":{"__symbolic":"function","parameters":["state"],"value":{"__symbolic":"error","message":"Reference to a non-exported function","line":73,"character":9,"context":{"name":"abstractControlReducer"},"module":"./src/update-functions"}},"markAsSubmitted":{"__symbolic":"function","parameters":["state"],"value":{"__symbolic":"error","message":"Reference to a non-exported function","line":73,"character":9,"context":{"name":"abstractControlReducer"},"module":"./src/update-functions"}},"markAsUnsubmitted":{"__symbolic":"function","parameters":["state"],"value":{"__symbolic":"error","message":"Reference to a non-exported function","line":73,"character":9,"context":{"name":"abstractControlReducer"},"module":"./src/update-functions"}},"focus":{"__symbolic":"function","parameters":["state"],"value":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"formControlReducer"},"arguments":[{"__symbolic":"reference","name":"state"},{"__symbolic":"new","expression":{"__symbolic":"reference","name":"FocusAction"},"arguments":[{"__symbolic":"select","expression":{"__symbolic":"reference","name":"state"},"member":"id"}]}]}},"unfocus":{"__symbolic":"function","parameters":["state"],"value":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"formControlReducer"},"arguments":[{"__symbolic":"reference","name":"state"},{"__symbolic":"new","expression":{"__symbolic":"reference","name":"UnfocusAction"},"arguments":[{"__symbolic":"select","expression":{"__symbolic":"reference","name":"state"},"member":"id"}]}]}},"setLastKeyDownCode":{"__symbolic":"function","parameters":["code"],"value":{"__symbolic":"error","message":"Function call not supported","line":168,"character":9,"module":"./src/update-functions"}},"addControl":{"__symbolic":"function","parameters":["name","value"],"value":{"__symbolic":"error","message":"Function call not supported","line":175,"character":9,"module":"./src/update-functions"}},"removeControl":{"__symbolic":"function","parameters":["name"],"value":{"__symbolic":"error","message":"Function call not supported","line":179,"character":9,"module":"./src/update-functions"}},"NgrxDefaultValueAccessor":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@angular/forms","name":"DefaultValueAccessor"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"input:not([type=checkbox])[ngrxFormControlState],textarea[ngrxFormControlState]","host":{"(input)":"_handleInput($event.target.value)","(blur)":"onTouched()","(compositionstart)":"_compositionStart()","(compositionend)":"_compositionEnd($event.target.value)"},"providers":[{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR"},"useExisting":{"__symbolic":"reference","name":"NgrxDefaultValueAccessor"},"multi":true}]}]}],"members":{}},"NgrxCheckboxControlValueAccessor":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@angular/forms","name":"CheckboxControlValueAccessor"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"input[type=checkbox][ngrxFormControlState]","host":{"(change)":"onChange($event.target.checked)","(blur)":"onTouched()"},"providers":[{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR"},"useExisting":{"__symbolic":"reference","name":"NgrxCheckboxControlValueAccessor"},"multi":true}]}]}],"members":{}},"NgrxNumberValueAccessor":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"input[type=number][ngrxFormControlState]","host":{"(change)":"onChange($event.target.value)","(input)":"onChange($event.target.value)","(blur)":"onTouched()"},"providers":[{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR"},"useExisting":{"__symbolic":"reference","name":"NgrxNumberValueAccessor"},"multi":true}]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2"},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"}]}],"writeValue":[{"__symbolic":"method"}],"registerOnChange":[{"__symbolic":"method"}],"registerOnTouched":[{"__symbolic":"method"}],"setDisabledState":[{"__symbolic":"method"}]}},"NgrxRangeValueAccessor":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"input[type=range][ngrxFormControlState]","host":{"(change)":"onChange($event.target.value)","(input)":"onChange($event.target.value)","(blur)":"onTouched()"},"providers":[{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR"},"useExisting":{"__symbolic":"reference","name":"NgrxRangeValueAccessor"},"multi":true}]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2"},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"}]}],"writeValue":[{"__symbolic":"method"}],"registerOnChange":[{"__symbolic":"method"}],"registerOnTouched":[{"__symbolic":"method"}],"setDisabledState":[{"__symbolic":"method"}]}},"NgrxSelectControlValueAccessor":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@angular/forms","name":"SelectControlValueAccessor"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"select:not([multiple])[ngrxFormControlState]","host":{"(change)":"onChange($event.target.value)","(blur)":"onTouched()"},"providers":[{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR"},"useExisting":{"__symbolic":"reference","name":"NgrxSelectControlValueAccessor"},"multi":true}]}]}],"members":{}},"NgrxSelectMultipleControlValueAccessor":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@angular/forms","name":"SelectMultipleControlValueAccessor"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"select[multiple][ngrxFormControlState]","host":{"(change)":"onChange($event.target)","(blur)":"onTouched()"},"providers":[{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR"},"useExisting":{"__symbolic":"reference","name":"NgrxSelectMultipleControlValueAccessor"},"multi":true}]}]}],"members":{}},"NgrxRadioControlValueAccessor":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@angular/forms","name":"RadioControlValueAccessor"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"input[type=radio][ngrxFormControlState]","host":{"(change)":"onChange()","(blur)":"onTouched()"},"providers":[{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR"},"useExisting":{"__symbolic":"reference","name":"NgrxRadioControlValueAccessor"},"multi":true}]}]}],"members":{}},"NgrxFormsModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"imports":[],"declarations":[{"__symbolic":"reference","name":"NgrxFormControlDirective"},{"__symbolic":"reference","name":"NgrxFormDirective"},{"__symbolic":"reference","name":"NgrxDefaultValueAccessor"},{"__symbolic":"reference","name":"NgrxCheckboxControlValueAccessor"},{"__symbolic":"reference","name":"NgrxNumberValueAccessor"},{"__symbolic":"reference","name":"NgrxRangeValueAccessor"},{"__symbolic":"reference","name":"NgrxSelectControlValueAccessor"},{"__symbolic":"reference","name":"NgrxSelectMultipleControlValueAccessor"},{"__symbolic":"reference","name":"NgrxRadioControlValueAccessor"}],"exports":[{"__symbolic":"reference","name":"NgrxFormControlDirective"},{"__symbolic":"reference","name":"NgrxFormDirective"},{"__symbolic":"reference","name":"NgrxDefaultValueAccessor"},{"__symbolic":"reference","name":"NgrxCheckboxControlValueAccessor"},{"__symbolic":"reference","name":"NgrxNumberValueAccessor"},{"__symbolic":"reference","name":"NgrxRangeValueAccessor"},{"__symbolic":"reference","name":"NgrxSelectControlValueAccessor"},{"__symbolic":"reference","name":"NgrxSelectMultipleControlValueAccessor"},{"__symbolic":"reference","name":"NgrxRadioControlValueAccessor"}]}]}],"members":{}}},"origins":{"ɵa":"./src/control/reducer","ɵb":"./src/group/reducer","SetValueAction":"./src/actions","SetErrorsAction":"./src/actions","MarkAsDirtyAction":"./src/actions","MarkAsPristineAction":"./src/actions","EnableAction":"./src/actions","DisableAction":"./src/actions","MarkAsTouchedAction":"./src/actions","MarkAsUntouchedAction":"./src/actions","FocusAction":"./src/actions","UnfocusAction":"./src/actions","SetLastKeyDownCodeAction":"./src/actions","MarkAsSubmittedAction":"./src/actions","MarkAsUnsubmittedAction":"./src/actions","AddControlAction":"./src/actions","RemoveControlAction":"./src/actions","ValidationErrors":"./src/state","KeyValue":"./src/state","AbstractControlState":"./src/state","FormControlState":"./src/state","FormGroupState":"./src/state","cast":"./src/state","createFormControlState":"./src/state","createFormGroupState":"./src/state","formControlReducer":"./src/control/reducer","formGroupReducer":"./src/group/reducer","NgrxFormControlDirective":"./src/control/directive","NgrxFormDirective":"./src/group/directive","updateGroup":"./src/update-functions","compose":"./src/update-functions","groupUpdateReducer":"./src/update-functions","setValue":"./src/update-functions","validate":"./src/update-functions","enable":"./src/update-functions","disable":"./src/update-functions","markAsDirty":"./src/update-functions","markAsPristine":"./src/update-functions","markAsTouched":"./src/update-functions","markAsUntouched":"./src/update-functions","markAsSubmitted":"./src/update-functions","markAsUnsubmitted":"./src/update-functions","focus":"./src/update-functions","unfocus":"./src/update-functions","setLastKeyDownCode":"./src/update-functions","addControl":"./src/update-functions","removeControl":"./src/update-functions","NgrxDefaultValueAccessor":"./src/value-accessors","NgrxCheckboxControlValueAccessor":"./src/value-accessors","NgrxNumberValueAccessor":"./src/value-accessors","NgrxRangeValueAccessor":"./src/value-accessors","NgrxSelectControlValueAccessor":"./src/value-accessors","NgrxSelectMultipleControlValueAccessor":"./src/value-accessors","NgrxRadioControlValueAccessor":"./src/value-accessors","NgrxFormsModule":"./src/module"},"importAs":"ngrx-forms"} | ||
{"__symbolic":"module","version":3,"metadata":{"ɵa":{"__symbolic":"function"},"ɵb":{"__symbolic":"function"},"SetValueAction":{"__symbolic":"class","arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"error","message":"Could not resolve type","line":15,"character":11,"context":{"typeName":"TValue"},"module":"./src/actions"}]}]},"statics":{"TYPE":"ngrx/forms/SET_VALUE"}},"SetErrorsAction":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"@angular/forms","name":"ValidationErrors"}]}]},"statics":{"TYPE":"ngrx/forms/SET_ERRORS"}},"MarkAsDirtyAction":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"}]}]},"statics":{"TYPE":"ngrx/forms/MARK_AS_DIRTY"}},"MarkAsPristineAction":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"}]}]},"statics":{"TYPE":"ngrx/forms/MARK_AS_PRISTINE"}},"EnableAction":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"}]}]},"statics":{"TYPE":"ngrx/forms/ENABLE"}},"DisableAction":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"}]}]},"statics":{"TYPE":"ngrx/forms/DISABLE"}},"MarkAsTouchedAction":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"}]}]},"statics":{"TYPE":"ngrx/forms/MARK_AS_TOUCHED"}},"MarkAsUntouchedAction":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"}]}]},"statics":{"TYPE":"ngrx/forms/MARK_AS_UNTOUCHED"}},"FocusAction":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"}]}]},"statics":{"TYPE":"ngrx/forms/FOCUS"}},"UnfocusAction":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"}]}]},"statics":{"TYPE":"ngrx/forms/UNFOCUS"}},"SetLastKeyDownCodeAction":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"number"}]}]},"statics":{"TYPE":"ngrx/forms/SET_LAST_KEY_DOWN_CODE"}},"MarkAsSubmittedAction":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"}]}]},"statics":{"TYPE":"ngrx/forms/MARK_AS_SUBMITTED"}},"MarkAsUnsubmittedAction":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"}]}]},"statics":{"TYPE":"ngrx/forms/MARK_AS_UNSUBMITTED"}},"AddControlAction":{"__symbolic":"class","arity":2,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"error","message":"Expression form not supported","line":169,"character":10,"module":"./src/actions"},{"__symbolic":"error","message":"Expression form not supported","line":170,"character":11,"module":"./src/actions"}]}]},"statics":{"TYPE":"ngrx/forms/ADD_CONTROL"}},"RemoveControlAction":{"__symbolic":"class","arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"error","message":"Expression form not supported","line":188,"character":10,"module":"./src/actions"}]}]},"statics":{"TYPE":"ngrx/forms/REMOVE_CONTROL"}},"ValidationErrors":{"__symbolic":"interface"},"KeyValue":{"__symbolic":"interface"},"AbstractControlState":{"__symbolic":"class","arity":1,"members":{}},"FormControlState":{"__symbolic":"class","arity":1,"extends":{"__symbolic":"reference","name":"AbstractControlState"},"members":{}},"FormGroupState":{"__symbolic":"class","arity":1,"extends":{"__symbolic":"reference","name":"AbstractControlState"},"members":{}},"cast":{"__symbolic":"function","parameters":["state"],"value":{"__symbolic":"reference","name":"state"}},"createFormControlState":{"__symbolic":"function","parameters":["id","value"],"value":{"id":{"__symbolic":"reference","name":"id"},"value":{"__symbolic":"reference","name":"value"},"isValid":true,"isInvalid":false,"isEnabled":true,"isDisabled":false,"isFocused":false,"isUnfocused":true,"errors":{},"isPristine":true,"isDirty":false,"isTouched":false,"isUntouched":true,"lastKeyDownCode":-1,"isSubmitted":false,"isUnsubmitted":true}},"createFormGroupState":{"__symbolic":"function"},"formControlReducer":{"__symbolic":"function","parameters":["state","action"],"value":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"ɵa"},"arguments":[{"__symbolic":"reference","name":"state"},{"__symbolic":"reference","name":"action"}]}},"formGroupReducer":{"__symbolic":"function","parameters":["state","action"],"value":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"ɵb"},"arguments":[{"__symbolic":"reference","name":"state"},{"__symbolic":"reference","name":"action"}]}},"NgrxFormControlDirective":{"__symbolic":"class","arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"[ngrxFormControlState]"}]}],"members":{"ngrxFormControlState":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"ngrxEnableFocusTracking":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"ngrxEnableLastKeydownCodeTracking":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"focusRegionStartAttr":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding"},"arguments":["attr.cdk-focus-region-start"]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject"},"arguments":[{"__symbolic":"reference","module":"@angular/platform-browser","name":"DOCUMENT"}]}],null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Self"}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject"},"arguments":[{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR"}]}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"error","message":"Could not resolve type","line":79,"character":35,"context":{"typeName":"Document"},"module":"./src/control/directive"},{"__symbolic":"reference","module":"@ngrx/store","name":"ActionsSubject"},{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"@angular/forms","name":"ControlValueAccessor"}]}]}],"convertViewValue":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"convertModelValue":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"ngAfterViewInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"onFocusChange":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener"},"arguments":["focusin"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener"},"arguments":["focusout"]}]}],"onKeyDown":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener"},"arguments":["keydown",["$event"]]}]}]}},"NgrxFormDirective":{"__symbolic":"class","arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"form[ngrxFormState]"}]}],"members":{"state":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["ngrxFormState"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@ngrx/store","name":"ActionsSubject"}]}],"ngOnInit":[{"__symbolic":"method"}],"onSubmit":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener"},"arguments":["submit",["$event"]]}]}]}},"updateGroup":{"__symbolic":"function","parameters":["updateFns"],"value":{"__symbolic":"error","message":"Function call not supported","line":55,"character":9,"module":"./src/update-functions"}},"compose":{"__symbolic":"function","parameters":["fns"],"value":{"__symbolic":"error","message":"Function call not supported","line":62,"character":9,"module":"./src/update-functions"}},"groupUpdateReducer":{"__symbolic":"function","parameters":["updateFnsArr"],"value":{"__symbolic":"error","message":"Function call not supported","line":66,"character":9,"module":"./src/update-functions"}},"setValue":{"__symbolic":"function"},"validate":{"__symbolic":"function"},"enable":{"__symbolic":"function","parameters":["state"],"value":{"__symbolic":"error","message":"Reference to a non-exported function","line":73,"character":9,"context":{"name":"abstractControlReducer"},"module":"./src/update-functions"}},"disable":{"__symbolic":"function","parameters":["state"],"value":{"__symbolic":"error","message":"Reference to a non-exported function","line":73,"character":9,"context":{"name":"abstractControlReducer"},"module":"./src/update-functions"}},"markAsDirty":{"__symbolic":"function","parameters":["state"],"value":{"__symbolic":"error","message":"Reference to a non-exported function","line":73,"character":9,"context":{"name":"abstractControlReducer"},"module":"./src/update-functions"}},"markAsPristine":{"__symbolic":"function","parameters":["state"],"value":{"__symbolic":"error","message":"Reference to a non-exported function","line":73,"character":9,"context":{"name":"abstractControlReducer"},"module":"./src/update-functions"}},"markAsTouched":{"__symbolic":"function","parameters":["state"],"value":{"__symbolic":"error","message":"Reference to a non-exported function","line":73,"character":9,"context":{"name":"abstractControlReducer"},"module":"./src/update-functions"}},"markAsUntouched":{"__symbolic":"function","parameters":["state"],"value":{"__symbolic":"error","message":"Reference to a non-exported function","line":73,"character":9,"context":{"name":"abstractControlReducer"},"module":"./src/update-functions"}},"markAsSubmitted":{"__symbolic":"function","parameters":["state"],"value":{"__symbolic":"error","message":"Reference to a non-exported function","line":73,"character":9,"context":{"name":"abstractControlReducer"},"module":"./src/update-functions"}},"markAsUnsubmitted":{"__symbolic":"function","parameters":["state"],"value":{"__symbolic":"error","message":"Reference to a non-exported function","line":73,"character":9,"context":{"name":"abstractControlReducer"},"module":"./src/update-functions"}},"focus":{"__symbolic":"function","parameters":["state"],"value":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"formControlReducer"},"arguments":[{"__symbolic":"reference","name":"state"},{"__symbolic":"new","expression":{"__symbolic":"reference","name":"FocusAction"},"arguments":[{"__symbolic":"select","expression":{"__symbolic":"reference","name":"state"},"member":"id"}]}]}},"unfocus":{"__symbolic":"function","parameters":["state"],"value":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"formControlReducer"},"arguments":[{"__symbolic":"reference","name":"state"},{"__symbolic":"new","expression":{"__symbolic":"reference","name":"UnfocusAction"},"arguments":[{"__symbolic":"select","expression":{"__symbolic":"reference","name":"state"},"member":"id"}]}]}},"setLastKeyDownCode":{"__symbolic":"function","parameters":["code"],"value":{"__symbolic":"error","message":"Function call not supported","line":168,"character":9,"module":"./src/update-functions"}},"addControl":{"__symbolic":"function","parameters":["name","value"],"value":{"__symbolic":"error","message":"Function call not supported","line":175,"character":9,"module":"./src/update-functions"}},"removeControl":{"__symbolic":"function","parameters":["name"],"value":{"__symbolic":"error","message":"Function call not supported","line":179,"character":9,"module":"./src/update-functions"}},"NgrxDefaultValueAccessor":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@angular/forms","name":"DefaultValueAccessor"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"input:not([type=checkbox])[ngrxFormControlState],textarea[ngrxFormControlState]","host":{"(input)":"_handleInput($event.target.value)","(blur)":"onTouched()","(compositionstart)":"_compositionStart()","(compositionend)":"_compositionEnd($event.target.value)"},"providers":[{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR"},"useExisting":{"__symbolic":"reference","name":"NgrxDefaultValueAccessor"},"multi":true}]}]}],"members":{}},"NgrxCheckboxControlValueAccessor":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@angular/forms","name":"CheckboxControlValueAccessor"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"input[type=checkbox][ngrxFormControlState]","host":{"(change)":"onChange($event.target.checked)","(blur)":"onTouched()"},"providers":[{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR"},"useExisting":{"__symbolic":"reference","name":"NgrxCheckboxControlValueAccessor"},"multi":true}]}]}],"members":{}},"NgrxNumberValueAccessor":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"input[type=number][ngrxFormControlState]","host":{"(change)":"onChange($event.target.value)","(input)":"onChange($event.target.value)","(blur)":"onTouched()"},"providers":[{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR"},"useExisting":{"__symbolic":"reference","name":"NgrxNumberValueAccessor"},"multi":true}]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2"},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"}]}],"writeValue":[{"__symbolic":"method"}],"registerOnChange":[{"__symbolic":"method"}],"registerOnTouched":[{"__symbolic":"method"}],"setDisabledState":[{"__symbolic":"method"}]}},"NgrxRangeValueAccessor":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"input[type=range][ngrxFormControlState]","host":{"(change)":"onChange($event.target.value)","(input)":"onChange($event.target.value)","(blur)":"onTouched()"},"providers":[{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR"},"useExisting":{"__symbolic":"reference","name":"NgrxRangeValueAccessor"},"multi":true}]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2"},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"}]}],"writeValue":[{"__symbolic":"method"}],"registerOnChange":[{"__symbolic":"method"}],"registerOnTouched":[{"__symbolic":"method"}],"setDisabledState":[{"__symbolic":"method"}]}},"NgrxSelectControlValueAccessor":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@angular/forms","name":"SelectControlValueAccessor"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"select:not([multiple])[ngrxFormControlState]","host":{"(change)":"onChange($event.target.value)","(blur)":"onTouched()"},"providers":[{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR"},"useExisting":{"__symbolic":"reference","name":"NgrxSelectControlValueAccessor"},"multi":true}]}]}],"members":{}},"NgrxSelectMultipleControlValueAccessor":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@angular/forms","name":"SelectMultipleControlValueAccessor"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"select[multiple][ngrxFormControlState]","host":{"(change)":"onChange($event.target)","(blur)":"onTouched()"},"providers":[{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR"},"useExisting":{"__symbolic":"reference","name":"NgrxSelectMultipleControlValueAccessor"},"multi":true}]}]}],"members":{}},"NgrxRadioControlValueAccessor":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@angular/forms","name":"RadioControlValueAccessor"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"input[type=radio][ngrxFormControlState]","host":{"(change)":"onChange()","(blur)":"onTouched()"},"providers":[{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR"},"useExisting":{"__symbolic":"reference","name":"NgrxRadioControlValueAccessor"},"multi":true}]}]}],"members":{}},"NgrxFormsModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"imports":[],"declarations":[{"__symbolic":"reference","name":"NgrxFormControlDirective"},{"__symbolic":"reference","name":"NgrxFormDirective"},{"__symbolic":"reference","name":"NgrxDefaultValueAccessor"},{"__symbolic":"reference","name":"NgrxCheckboxControlValueAccessor"},{"__symbolic":"reference","name":"NgrxNumberValueAccessor"},{"__symbolic":"reference","name":"NgrxRangeValueAccessor"},{"__symbolic":"reference","name":"NgrxSelectControlValueAccessor"},{"__symbolic":"reference","name":"NgrxSelectMultipleControlValueAccessor"},{"__symbolic":"reference","name":"NgrxRadioControlValueAccessor"}],"exports":[{"__symbolic":"reference","name":"NgrxFormControlDirective"},{"__symbolic":"reference","name":"NgrxFormDirective"},{"__symbolic":"reference","name":"NgrxDefaultValueAccessor"},{"__symbolic":"reference","name":"NgrxCheckboxControlValueAccessor"},{"__symbolic":"reference","name":"NgrxNumberValueAccessor"},{"__symbolic":"reference","name":"NgrxRangeValueAccessor"},{"__symbolic":"reference","name":"NgrxSelectControlValueAccessor"},{"__symbolic":"reference","name":"NgrxSelectMultipleControlValueAccessor"},{"__symbolic":"reference","name":"NgrxRadioControlValueAccessor"}]}]}],"members":{}}},"origins":{"ɵa":"./src/control/reducer","ɵb":"./src/group/reducer","SetValueAction":"./src/actions","SetErrorsAction":"./src/actions","MarkAsDirtyAction":"./src/actions","MarkAsPristineAction":"./src/actions","EnableAction":"./src/actions","DisableAction":"./src/actions","MarkAsTouchedAction":"./src/actions","MarkAsUntouchedAction":"./src/actions","FocusAction":"./src/actions","UnfocusAction":"./src/actions","SetLastKeyDownCodeAction":"./src/actions","MarkAsSubmittedAction":"./src/actions","MarkAsUnsubmittedAction":"./src/actions","AddControlAction":"./src/actions","RemoveControlAction":"./src/actions","ValidationErrors":"./src/state","KeyValue":"./src/state","AbstractControlState":"./src/state","FormControlState":"./src/state","FormGroupState":"./src/state","cast":"./src/state","createFormControlState":"./src/state","createFormGroupState":"./src/state","formControlReducer":"./src/control/reducer","formGroupReducer":"./src/group/reducer","NgrxFormControlDirective":"./src/control/directive","NgrxFormDirective":"./src/group/directive","updateGroup":"./src/update-functions","compose":"./src/update-functions","groupUpdateReducer":"./src/update-functions","setValue":"./src/update-functions","validate":"./src/update-functions","enable":"./src/update-functions","disable":"./src/update-functions","markAsDirty":"./src/update-functions","markAsPristine":"./src/update-functions","markAsTouched":"./src/update-functions","markAsUntouched":"./src/update-functions","markAsSubmitted":"./src/update-functions","markAsUnsubmitted":"./src/update-functions","focus":"./src/update-functions","unfocus":"./src/update-functions","setLastKeyDownCode":"./src/update-functions","addControl":"./src/update-functions","removeControl":"./src/update-functions","NgrxDefaultValueAccessor":"./src/value-accessors","NgrxCheckboxControlValueAccessor":"./src/value-accessors","NgrxNumberValueAccessor":"./src/value-accessors","NgrxRangeValueAccessor":"./src/value-accessors","NgrxSelectControlValueAccessor":"./src/value-accessors","NgrxSelectMultipleControlValueAccessor":"./src/value-accessors","NgrxRadioControlValueAccessor":"./src/value-accessors","NgrxFormsModule":"./src/module"},"importAs":"ngrx-forms"} |
{ | ||
"name": "ngrx-forms", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Proper integration of forms in Angular 4 applications using ngrx", | ||
@@ -31,3 +31,5 @@ "module": "@ngrx/forms.es5.js", | ||
"javascript", | ||
"typescript" | ||
"typescript", | ||
"ngrx", | ||
"redux" | ||
], | ||
@@ -34,0 +36,0 @@ "license": "MIT", |
@@ -155,3 +155,3 @@ # ngrx-forms | ||
export class AbstractControlState<TValue> { | ||
export interface AbstractControlState<TValue> { | ||
id: string; | ||
@@ -172,3 +172,3 @@ value: TValue; | ||
export class FormControlState<TValue extends FormControlValueTypes> extends AbstractControlState<TValue> { | ||
export interface FormControlState<TValue extends FormControlValueTypes> extends AbstractControlState<TValue> { | ||
isFocused: boolean; | ||
@@ -195,3 +195,3 @@ isUnfocused: boolean; | ||
Control states are associated with a form element via the `NgrxFormControlDirective` (applied with `[ngrxFormControlState]="controlState"`). This directive is reponsible keeping the view and the state in sync. When the state is changed the update is always immediately sync'ed to the view. Currently this also always happens immediately when the view is changed (e.g. as soon as the value of an `input` changes the state is updated), but there are plans to allow specifying the event on which the sync happens (e.g. `change`, `blur` etc.). | ||
Control states are associated with a form element via the `NgrxFormControlDirective` (applied with `[ngrxFormControlState]="controlState"`). This directive is reponsible for keeping the view and the state in sync. When the state is changed the update is always immediately sync'ed to the view. Currently this also always happens immediately when the view is changed (e.g. as soon as the value of an `input` changes the state is updated), but there are plans to allow specifying the event on which the sync happens (e.g. `change`, `blur` etc.). | ||
@@ -205,3 +205,3 @@ ### Form Groups | ||
export type FormGroupControls<TValue> = {[controlId in keyof TValue]: AbstractControlState<TValue[controlId]> }; | ||
export class FormGroupState<TValue extends KeyValue> extends AbstractControlState<TValue> { | ||
export interface FormGroupState<TValue extends KeyValue> extends AbstractControlState<TValue> { | ||
controls: FormGroupControls<TValue>; | ||
@@ -227,2 +227,63 @@ } | ||
#### Dynamic Form Groups | ||
Sometimes you will have to render a variable number of fields in your form. In such a case you can provide a form value interface that has an index signature and then add and remove controls dynamically. Instead of an index signature you can also use optional fields if the potential members of the form value are statically known. At runtime you can add and remove controls in two ways: | ||
1) explicitly call the `addControl` and `removeControl` update functions (see the section below) | ||
2) set the value of the form group via `setValue` which will automatically update the form group based on the value you provide | ||
Below you can find an example of how this would look. Assume that we have an action that provides a variable set of objects which each should be mapped to a group with two form controls. | ||
```typescript | ||
import { Action } from '@ngrx/store'; | ||
import { FormGroupState, setValue, cast } from 'ngrx-forms'; | ||
interface DynamicObject { | ||
id: string; | ||
someNumber: number; | ||
someCheckbox: boolean; | ||
} | ||
interface DynamicObjectFormValue { | ||
someNumber: number; | ||
someCheckbox: boolean; | ||
} | ||
interface DynamicFormValue { | ||
[id: string]: DynamicObjectFormValue; | ||
} | ||
interface SetDynamicObjectsAction extends Action { | ||
type: 'SET_DYNAMIC_OBJECTS'; | ||
objects: DynamicObject[]; | ||
} | ||
interface AppState { | ||
someOtherState: string; | ||
dynamicForm: FormGroupState<DynamicFormValue>; | ||
} | ||
export function appReducer(state: AppState, action: Action): AppState { | ||
switch (action.type) { | ||
case 'SET_DYNAMIC_OBJECTS': { | ||
const newFormValue = (action as SetDynamicObjectsAction).objects.reduce((v, obj) => { | ||
v[obj.id] = { | ||
someNumber: obj.someNumber, | ||
someCheckbox: obj.someCheckbox, | ||
}; | ||
return v; | ||
}, {} as DynamicFormValue); | ||
// the `setValue` will add and remove controls as required; existing controls that are still | ||
// present get their value updated but are otherwise kept in the same state as before | ||
const dynamicForm = cast(setValue(newFormValue, state.dynamicForm)); | ||
return { ...state, dynamicForm }; | ||
} | ||
default: | ||
return state; | ||
} | ||
} | ||
``` | ||
### Updating the State | ||
@@ -229,0 +290,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { ElementRef, OnInit, OnDestroy } from '@angular/core'; | ||
import { ElementRef, AfterViewInit, OnDestroy } from '@angular/core'; | ||
import { ControlValueAccessor } from '@angular/forms'; | ||
@@ -8,3 +8,3 @@ import { ActionsSubject } from '@ngrx/store'; | ||
import { FormControlState, FormControlValueTypes } from '../state'; | ||
export declare class NgrxFormControlDirective<TValue extends FormControlValueTypes> implements OnInit, OnDestroy { | ||
export declare class NgrxFormControlDirective<TValue extends FormControlValueTypes> implements AfterViewInit, OnDestroy { | ||
private el; | ||
@@ -22,2 +22,3 @@ private dom; | ||
private readonly state$; | ||
private valueWasReported; | ||
private lastReportedViewValue; | ||
@@ -27,3 +28,3 @@ constructor(el: ElementRef, dom: Document, actionsSubject: ActionsSubject, valueAccessors: ControlValueAccessor[]); | ||
convertModelValue: (value: TValue) => any; | ||
ngOnInit(): void; | ||
ngAfterViewInit(): void; | ||
ngOnDestroy(): void; | ||
@@ -30,0 +31,0 @@ onFocusChange(): void; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1881226
14824
459