Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ngneat/reactive-forms

Package Overview
Dependencies
Maintainers
3
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ngneat/reactive-forms - npm Package Compare versions

Comparing version 1.7.3 to 1.7.4

13

bundles/ngneat-reactive-forms.umd.js

@@ -713,3 +713,14 @@ (function (global, factory) {

if (opts === void 0) { opts = {}; }
this.errorsSubject.next(errors);
var _a;
/**
* @description
* Use an elvis operator to avoid a throw when the control is used with an async validator
* Which will be instantly resolved (like with `of(null)`)
* In such case, Angular will call this method instantly before even instancing the properties causing the throw
* Can be easily reproduced with a step-by-step debug once compiled when checking the stack trace of the constructor
*
* Issue: https://github.com/ngneat/reactive-forms/issues/91
* Reproduction: https://codesandbox.io/embed/github/C0ZEN/ngneat-reactive-forms-error-issue-cs/tree/main/?autoresize=1&expanddevtools=1&fontsize=14&hidenavigation=1&theme=dark
*/
(_a = this.errorsSubject) === null || _a === void 0 ? void 0 : _a.next(errors);
return _super.prototype.setErrors.call(this, errors, opts);

@@ -716,0 +727,0 @@ };

2

bundles/ngneat-reactive-forms.umd.min.js

@@ -15,3 +15,3 @@ !function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@angular/forms"),require("rxjs"),require("rxjs/operators"),require("@angular/core")):"function"==typeof define&&define.amd?define("@ngneat/reactive-forms",["exports","@angular/forms","rxjs","rxjs/operators","@angular/core"],r):r(((t="undefined"!=typeof globalThis?globalThis:t||self).ngneat=t.ngneat||{},t.ngneat["reactive-forms"]={}),t.ng.forms,t.rxjs,t.rxjs.operators,t.ng.core)}(this,(function(t,r,e,o,n){"use strict";

PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var i=function(t,r){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])})(t,r)};function s(t,r){function e(){this.constructor=t}i(t,r),t.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)}Object.create;function a(t,r){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var o,n,i=e.call(t),s=[];try{for(;(void 0===r||r-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(t){n={error:t}}finally{try{o&&!o.done&&(e=i.return)&&e.call(i)}finally{if(n)throw n.error}}return s}function u(){for(var t=[],r=0;r<arguments.length;r++)t=t.concat(a(arguments[r]));return t}Object.create;function c(t){return Array.isArray(t)?t:[t]}function l(t){return null==t}function p(t){return e.isObservable(t)||function(t){return"function"==typeof(null==t?void 0:t.then)}(t)?e.from(t):e.of(t)}function h(t,r){return t||r?Object.assign(Object.assign({},t),r):null}function f(t,r){if(!t)return null;var e=Object.assign({},t);return delete e[r],Object.keys(e).length>0?e:null}var y=Object.getOwnPropertyDescriptor(r.AbstractControl.prototype,"validator"),d=Object.getOwnPropertyDescriptor(r.AbstractControl.prototype,"asyncValidator");function g(t){return t.getRawValue?t.getRawValue():t.value}function b(t){return e.merge(e.defer((function(){return e.of(g(t))})),t.valueChanges.pipe(o.map((function(){return g(t)}))))}function v(t){return e.merge(e.defer((function(){return e.of(t.disabled)})),t.statusChanges.pipe(o.map((function(){return t.disabled})),o.distinctUntilChanged()))}function m(t){return e.merge(e.defer((function(){return e.of(t.enabled)})),t.statusChanges.pipe(o.map((function(){return t.enabled})),o.distinctUntilChanged()))}function V(t){return e.merge(e.defer((function(){return e.of(t.status)})),t.statusChanges.pipe(o.map((function(){return t.status})),o.distinctUntilChanged()))}function A(t,r){return e.merge(e.defer((function(){return e.of(t.errors)})),r,t.valueChanges.pipe(o.map((function(){return t.errors})),o.distinctUntilChanged((function(t,r){return function(t,r){return l(t)||l(r)?t===r:JSON.stringify(t)===JSON.stringify(r)}(t,r)}))))}function C(t,r,e){r?t.enable(e):t.disable(e)}function O(t,r,e){C(t,!r,e)}function j(t,r,e){return r.subscribe((function(r){return O(t,r,e)}))}function E(t,r,e){return r.subscribe((function(r){return C(t,r,e)}))}function k(t,r,e){t.setValidators(u([t.validator],c(r))),t.updateValueAndValidity(e)}function S(t,r){return r.subscribe((function(r){t.setErrors(r)}))}function w(t,r,e){return t.hasError(r,e&&0!==e.length?e:void 0)&&t.touched}function x(t,r,e){return t.hasError(r,e&&0!==e.length?e:void 0)&&t.dirty}function D(t){t.markAsDirty({onlySelf:!0}),t._forEachChild((function(t){return t.markAllAsDirty()}))}var $=function(t){function r(r,n,i){var s=t.call(this,r,n,i)||this;return s.controls=r,s.touchChanges=new e.Subject,s.dirtyChanges=new e.Subject,s.errorsSubject=new e.Subject,s.touch$=s.touchChanges.asObservable().pipe(o.distinctUntilChanged()),s.dirty$=s.dirtyChanges.asObservable().pipe(o.distinctUntilChanged()),s.value$=b(s),s.disabled$=v(s),s.enabled$=m(s),s.status$=V(s),s.errors$=A(s,s.errorsSubject.asObservable()),s}return s(r,t),Object.defineProperty(r.prototype,"asyncValidator",{get:function(){return d.get.call(this)},set:function(t){d.set.call(this,t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"validator",{get:function(){return y.get.call(this)},set:function(t){y.set.call(this,t)},enumerable:!1,configurable:!0}),r.prototype.select=function(t){return this.value$.pipe(o.map(t),o.distinctUntilChanged())},r.prototype.getRawValue=function(){return t.prototype.getRawValue.call(this)},r.prototype.at=function(r){return t.prototype.at.call(this,r)},r.prototype.setValue=function(r,o){var n=this;if(e.isObservable(r))return r.subscribe((function(r){return t.prototype.setValue.call(n,r,o)}));t.prototype.setValue.call(this,r,o)},r.prototype.patchValue=function(r,o){var n=this;if(e.isObservable(r))return r.subscribe((function(r){return t.prototype.patchValue.call(n,r,o)}));t.prototype.patchValue.call(this,r,o)},r.prototype.push=function(r){return t.prototype.push.call(this,r)},r.prototype.insert=function(r,e){return t.prototype.insert.call(this,r,e)},r.prototype.setControl=function(r,e){return t.prototype.setControl.call(this,r,e)},r.prototype.disabledWhile=function(t,r){return j(this,t,r)},r.prototype.enabledWhile=function(t,r){return E(this,t,r)},r.prototype.mergeValidators=function(t,r){k(this,t,r)},r.prototype.mergeAsyncValidators=function(t,r){this.setAsyncValidators(u([this.asyncValidator],c(t))),this.updateValueAndValidity(r)},r.prototype.markAsTouched=function(r){t.prototype.markAsTouched.call(this,r),this.touchChanges.next(!0)},r.prototype.markAsUntouched=function(r){t.prototype.markAsUntouched.call(this,r),this.touchChanges.next(!1)},r.prototype.markAsPristine=function(r){t.prototype.markAsPristine.call(this,r),this.dirtyChanges.next(!1)},r.prototype.markAsDirty=function(r){t.prototype.markAsDirty.call(this,r),this.dirtyChanges.next(!0)},r.prototype.markAllAsDirty=function(){D(this)},r.prototype.reset=function(r,e){t.prototype.reset.call(this,r,e)},r.prototype.setValidators=function(r,e){t.prototype.setValidators.call(this,r),t.prototype.updateValueAndValidity.call(this,e)},r.prototype.setAsyncValidators=function(r,e){t.prototype.setAsyncValidators.call(this,r),t.prototype.updateValueAndValidity.call(this,e)},r.prototype.validateOn=function(t){var r=this;return t.subscribe((function(t){r.setErrors(t)}))},r.prototype.hasError=function(r,e){return t.prototype.hasError.call(this,r,e)},r.prototype.setErrors=function(r,e){return void 0===e&&(e={}),this.errorsSubject.next(r),t.prototype.setErrors.call(this,r,e)},r.prototype.mergeErrors=function(t,r){void 0===r&&(r={}),this.setErrors(h(this.errors,t),r)},r.prototype.removeError=function(t,r){void 0===r&&(r={}),this.setErrors(f(this.errors,t),r)},r.prototype.getError=function(r,e){return t.prototype.getError.call(this,r,e)},r.prototype.hasErrorAndTouched=function(t,r){return w(this,t,r)},r.prototype.hasErrorAndDirty=function(t,r){return x(this,t,r)},r.prototype.setEnable=function(t,r){void 0===t&&(t=!0),C(this,t,r)},r.prototype.setDisable=function(t,r){void 0===t&&(t=!0),O(this,t,r)},r.prototype.remove=function(t){this.removeWhen((function(r){return r.value===t}))},r.prototype.removeWhen=function(t){for(var r=this.length-1;r>=0;--r)t(this.at(r))&&this.removeAt(r)},r}(r.FormArray),P=function(t){function r(r,n,i){var s=t.call(this,r,n,i)||this;return s.touchChanges=new e.Subject,s.dirtyChanges=new e.Subject,s.errorsSubject=new e.Subject,s.touch$=s.touchChanges.asObservable().pipe(o.distinctUntilChanged()),s.dirty$=s.dirtyChanges.asObservable().pipe(o.distinctUntilChanged()),s.value$=b(s),s.disabled$=v(s),s.enabled$=m(s),s.status$=V(s),s.errors$=A(s,s.errorsSubject.asObservable()),s}return s(r,t),Object.defineProperty(r.prototype,"asyncValidator",{get:function(){return d.get.call(this)},set:function(t){d.set.call(this,t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"validator",{get:function(){return y.get.call(this)},set:function(t){y.set.call(this,t)},enumerable:!1,configurable:!0}),r.prototype.setValue=function(r,o){var n=this;if(e.isObservable(r))return r.subscribe((function(r){return t.prototype.setValue.call(n,r,o)}));t.prototype.setValue.call(this,r,o)},r.prototype.patchValue=function(r,o){var n=this;if(e.isObservable(r))return r.subscribe((function(r){return t.prototype.patchValue.call(n,r,o)}));t.prototype.patchValue.call(this,r,o)},r.prototype.disabledWhile=function(t,r){return j(this,t,r)},r.prototype.enabledWhile=function(t,r){return E(this,t,r)},r.prototype.mergeValidators=function(t,r){k(this,t,r)},r.prototype.mergeAsyncValidators=function(t,r){this.setAsyncValidators(u([this.asyncValidator],c(t))),this.updateValueAndValidity(r)},r.prototype.markAsTouched=function(r){t.prototype.markAsTouched.call(this,r),this.touchChanges.next(!0)},r.prototype.markAsUntouched=function(r){t.prototype.markAsUntouched.call(this,r),this.touchChanges.next(!1)},r.prototype.markAsPristine=function(r){t.prototype.markAsPristine.call(this,r),this.dirtyChanges.next(!1)},r.prototype.markAsDirty=function(r){t.prototype.markAsDirty.call(this,r),this.dirtyChanges.next(!0)},r.prototype.markAllAsDirty=function(){this.markAsDirty({onlySelf:!0})},r.prototype.reset=function(r,e){t.prototype.reset.call(this,r,e)},r.prototype.setValidators=function(r,e){t.prototype.setValidators.call(this,r),t.prototype.updateValueAndValidity.call(this,e)},r.prototype.setAsyncValidators=function(r,e){t.prototype.setAsyncValidators.call(this,r),t.prototype.updateValueAndValidity.call(this,e)},r.prototype.validateOn=function(t){return S(this,t)},r.prototype.getError=function(r){return t.prototype.getError.call(this,r)},r.prototype.hasError=function(r){return t.prototype.hasError.call(this,r)},r.prototype.setErrors=function(r,e){return void 0===e&&(e={}),this.errorsSubject.next(r),t.prototype.setErrors.call(this,r,e)},r.prototype.mergeErrors=function(t,r){void 0===r&&(r={}),this.setErrors(h(this.errors,t),r)},r.prototype.removeError=function(t,r){void 0===r&&(r={}),this.setErrors(f(this.errors,t),r)},r.prototype.hasErrorAndTouched=function(t){return w(this,t)},r.prototype.hasErrorAndDirty=function(t){return x(this,t)},r.prototype.setEnable=function(t,r){void 0===t&&(t=!0),C(this,t,r)},r.prototype.setDisable=function(t,r){void 0===t&&(t=!0),O(this,t,r)},r}(r.FormControl),T=function(){function t(){}return t.prototype.setValue=function(t,r){return localStorage.setItem(t,JSON.stringify(r)),r},t.prototype.getValue=function(t){return JSON.parse(localStorage.getItem(t)||"{}")},t}(),U=function(t){function n(r,n,i){var s=t.call(this,r,n,i)||this;return s.controls=r,s.touchChanges=new e.Subject,s.dirtyChanges=new e.Subject,s.errorsSubject=new e.Subject,s.touch$=s.touchChanges.asObservable().pipe(o.distinctUntilChanged()),s.dirty$=s.dirtyChanges.asObservable().pipe(o.distinctUntilChanged()),s.value$=b(s),s.disabled$=v(s),s.enabled$=m(s),s.status$=V(s),s.errors$=A(s,s.errorsSubject.asObservable()),s}return s(n,t),Object.defineProperty(n.prototype,"asyncValidator",{get:function(){return d.get.call(this)},set:function(t){d.set.call(this,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"validator",{get:function(){return y.get.call(this)},set:function(t){y.set.call(this,t)},enumerable:!1,configurable:!0}),n.prototype.select=function(t){return function(t,r){return t.value$.pipe(o.map(r),o.distinctUntilChanged())}(this,t)},n.prototype.getRawValue=function(){return t.prototype.getRawValue.call(this)},n.prototype.get=function(r){return t.prototype.get.call(this,r)},n.prototype.getControl=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return this.get(t)},n.prototype.addControl=function(r,e){t.prototype.addControl.call(this,r,e)},n.prototype.removeControl=function(r){t.prototype.removeControl.call(this,r)},n.prototype.contains=function(r){return t.prototype.contains.call(this,r)},n.prototype.setControl=function(r,e){t.prototype.setControl.call(this,r,e)},n.prototype.setValue=function(r,o){var n=this;if(e.isObservable(r))return r.subscribe((function(r){return t.prototype.setValue.call(n,r,o)}));t.prototype.setValue.call(this,r,o)},n.prototype.patchValue=function(r,o){var n=this;if(e.isObservable(r))return r.subscribe((function(r){return t.prototype.patchValue.call(n,r,o)}));t.prototype.patchValue.call(this,r,o)},n.prototype.disabledWhile=function(t,r){return j(this,t,r)},n.prototype.enabledWhile=function(t,r){return E(this,t,r)},n.prototype.mergeValidators=function(t,r){k(this,t,r)},n.prototype.mergeAsyncValidators=function(t,r){this.setAsyncValidators(u([this.asyncValidator],c(t))),this.updateValueAndValidity(r)},n.prototype.markAsTouched=function(r){t.prototype.markAsTouched.call(this,r),this.touchChanges.next(!0)},n.prototype.markAsUntouched=function(r){t.prototype.markAsUntouched.call(this,r),this.touchChanges.next(!1)},n.prototype.markAsPristine=function(r){t.prototype.markAsPristine.call(this,r),this.dirtyChanges.next(!1)},n.prototype.markAsDirty=function(r){t.prototype.markAsDirty.call(this,r),this.dirtyChanges.next(!0)},n.prototype.markAllAsDirty=function(){D(this)},n.prototype.reset=function(r,e){t.prototype.reset.call(this,r,e)},n.prototype.setValidators=function(r,e){t.prototype.setValidators.call(this,r),t.prototype.updateValueAndValidity.call(this,e)},n.prototype.setAsyncValidators=function(r,e){t.prototype.setAsyncValidators.call(this,r),t.prototype.updateValueAndValidity.call(this,e)},n.prototype.validateOn=function(t){return S(this,t)},n.prototype.hasError=function(r,e){return t.prototype.hasError.call(this,r,e)},n.prototype.setErrors=function(r,e){return void 0===e&&(e={}),this.errorsSubject.next(r),t.prototype.setErrors.call(this,r,e)},n.prototype.mergeErrors=function(t,r){void 0===r&&(r={}),this.setErrors(h(this.errors,t),r)},n.prototype.removeError=function(t,r){void 0===r&&(r={}),this.setErrors(f(this.errors,t),r)},n.prototype.getError=function(r,e){return t.prototype.getError.call(this,r,e)},n.prototype.hasErrorAndTouched=function(t){for(var r=[],e=1;e<arguments.length;e++)r[e-1]=arguments[e];return w.apply(void 0,u([this,t],r))},n.prototype.hasErrorAndDirty=function(t){for(var r=[],e=1;e<arguments.length;e++)r[e-1]=arguments[e];return x.apply(void 0,u([this,t],r))},n.prototype.setEnable=function(t,r){void 0===t&&(t=!0),C(this,t,r)},n.prototype.setDisable=function(t,r){void 0===t&&(t=!0),O(this,t,r)},n.prototype.persist=function(t,r){var e=this,n=r.debounceTime,i=r.manager,s=r.arrControlFactory,a=r.persistDisabledControls,u=i||new T;return this.restore(t,u,s).pipe(o.switchMap((function(){return function(t,r,e){return t.valueChanges.pipe(o.debounceTime(e.debounceTime),o.switchMap((function(o){return p(e.manager.setValue(r,e.persistDisabledControls?t.getRawValue():o))})))}(e,t,{debounceTime:n||250,manager:u,persistDisabledControls:a})})))},n.prototype.restore=function(t,e,n){var i=this;return p(e.getValue(t)).pipe(o.take(1),o.tap((function(t){t&&(!function(t,e,o){Object.keys(e).forEach((function(n){var i=e[n];if(Array.isArray(i)&&t.get(n)instanceof r.FormArray){if(!o||o&&!(n in o))throw new Error("Please provide arrControlFactory for "+n);var s=t.get(n),a=o[n];!function(t){for(;0!==t.length;)t.removeAt(0)}(s),i.forEach((function(t,r){return s.insert(r,a(t))}))}}))}(i,t,n),i.patchValue(t,{emitEvent:!1}))})))},n}(r.FormGroup);var _=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return s(r,t),r.prototype.group=function(t,r){var e,o=this._reduceControls(t),n=null,i=null;return null!=r&&(!function(t){return void 0!==t.asyncValidators||void 0!==t.validators||void 0!==t.updateOn}(r)?(n=null!=r.validator?r.validator:null,i=null!=r.asyncValidator?r.asyncValidator:null):(n=null!=r.validators?r.validators:null,i=null!=r.asyncValidators?r.asyncValidators:null,e=null!=r.updateOn?r.updateOn:void 0)),new U(o,{asyncValidators:i,updateOn:e,validators:n})},r.prototype.control=function(t,r,e){return new P(t,r,e)},r.prototype.array=function(t,r,e){var o=this,n=t.map((function(t){return o._createControl(t)}));return new $(n,r,e)},r}(r.FormBuilder);_.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new _},token:_,providedIn:"root"}),_.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}];var F=function(){function t(){this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t}(),W=function(){function t(){}return t.prototype.setValue=function(t,r){return sessionStorage.setItem(t,JSON.stringify(r)),r},t.prototype.getValue=function(t){return JSON.parse(sessionStorage.getItem(t)||"{}")},t}(),I=function(t){return Object.keys(t)},R=function(t){return t&&Array.isArray(t)},J=function(t){return"object"==typeof t&&null!==t},N=function(t,r){return R(r)||R(t)},M=function(t,r){return J(r)||J(t)},q=function(t,r){return!N(t,r)&&!M(t,r)},B=function(t,r){return[t,r]};function G(t,r){if(void 0===t)return r;if(q(t,r))return t===r?void 0:r;if(N(t,r)){var e=a(B(t,r),2);return function(t,r){return t=Array.isArray(t)?t:[],r=Array.isArray(r)?r:[],t.length===r.length&&t.every((function(t){return r.includes(t)}))}(e[0],e[1])?void 0:r}return function(t,r){var e=function(t,r){if(!t)return r;return I(r).reduce((function(e,o){var n=G(t[o],r[o]);return void 0!==n&&(e[o]=n),e}),{})}(t,r);return 0===I(e).length?void 0:e}(t,r)}t.ControlValueAccessor=F,t.FormArray=$,t.FormBuilder=_,t.FormControl=P,t.FormGroup=U,t.LocalStorageManager=T,t.SessionStorageManager=W,t.diff=function(){return function(t){return t.pipe(o.startWith(void 0),o.pairwise(),o.map((function(t){return G.apply(void 0,u(t))})),o.filter((function(t){return void 0!==t})))}},Object.defineProperty(t,"__esModule",{value:!0})}));
***************************************************************************** */var i=function(t,r){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])})(t,r)};function s(t,r){function e(){this.constructor=t}i(t,r),t.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)}Object.create;function a(t,r){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var o,n,i=e.call(t),s=[];try{for(;(void 0===r||r-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(t){n={error:t}}finally{try{o&&!o.done&&(e=i.return)&&e.call(i)}finally{if(n)throw n.error}}return s}function u(){for(var t=[],r=0;r<arguments.length;r++)t=t.concat(a(arguments[r]));return t}Object.create;function c(t){return Array.isArray(t)?t:[t]}function l(t){return null==t}function p(t){return e.isObservable(t)||function(t){return"function"==typeof(null==t?void 0:t.then)}(t)?e.from(t):e.of(t)}function h(t,r){return t||r?Object.assign(Object.assign({},t),r):null}function f(t,r){if(!t)return null;var e=Object.assign({},t);return delete e[r],Object.keys(e).length>0?e:null}var y=Object.getOwnPropertyDescriptor(r.AbstractControl.prototype,"validator"),d=Object.getOwnPropertyDescriptor(r.AbstractControl.prototype,"asyncValidator");function g(t){return t.getRawValue?t.getRawValue():t.value}function b(t){return e.merge(e.defer((function(){return e.of(g(t))})),t.valueChanges.pipe(o.map((function(){return g(t)}))))}function v(t){return e.merge(e.defer((function(){return e.of(t.disabled)})),t.statusChanges.pipe(o.map((function(){return t.disabled})),o.distinctUntilChanged()))}function m(t){return e.merge(e.defer((function(){return e.of(t.enabled)})),t.statusChanges.pipe(o.map((function(){return t.enabled})),o.distinctUntilChanged()))}function V(t){return e.merge(e.defer((function(){return e.of(t.status)})),t.statusChanges.pipe(o.map((function(){return t.status})),o.distinctUntilChanged()))}function A(t,r){return e.merge(e.defer((function(){return e.of(t.errors)})),r,t.valueChanges.pipe(o.map((function(){return t.errors})),o.distinctUntilChanged((function(t,r){return function(t,r){return l(t)||l(r)?t===r:JSON.stringify(t)===JSON.stringify(r)}(t,r)}))))}function C(t,r,e){r?t.enable(e):t.disable(e)}function O(t,r,e){C(t,!r,e)}function j(t,r,e){return r.subscribe((function(r){return O(t,r,e)}))}function E(t,r,e){return r.subscribe((function(r){return C(t,r,e)}))}function k(t,r,e){t.setValidators(u([t.validator],c(r))),t.updateValueAndValidity(e)}function S(t,r){return r.subscribe((function(r){t.setErrors(r)}))}function w(t,r,e){return t.hasError(r,e&&0!==e.length?e:void 0)&&t.touched}function x(t,r,e){return t.hasError(r,e&&0!==e.length?e:void 0)&&t.dirty}function D(t){t.markAsDirty({onlySelf:!0}),t._forEachChild((function(t){return t.markAllAsDirty()}))}var $=function(t){function r(r,n,i){var s=t.call(this,r,n,i)||this;return s.controls=r,s.touchChanges=new e.Subject,s.dirtyChanges=new e.Subject,s.errorsSubject=new e.Subject,s.touch$=s.touchChanges.asObservable().pipe(o.distinctUntilChanged()),s.dirty$=s.dirtyChanges.asObservable().pipe(o.distinctUntilChanged()),s.value$=b(s),s.disabled$=v(s),s.enabled$=m(s),s.status$=V(s),s.errors$=A(s,s.errorsSubject.asObservable()),s}return s(r,t),Object.defineProperty(r.prototype,"asyncValidator",{get:function(){return d.get.call(this)},set:function(t){d.set.call(this,t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"validator",{get:function(){return y.get.call(this)},set:function(t){y.set.call(this,t)},enumerable:!1,configurable:!0}),r.prototype.select=function(t){return this.value$.pipe(o.map(t),o.distinctUntilChanged())},r.prototype.getRawValue=function(){return t.prototype.getRawValue.call(this)},r.prototype.at=function(r){return t.prototype.at.call(this,r)},r.prototype.setValue=function(r,o){var n=this;if(e.isObservable(r))return r.subscribe((function(r){return t.prototype.setValue.call(n,r,o)}));t.prototype.setValue.call(this,r,o)},r.prototype.patchValue=function(r,o){var n=this;if(e.isObservable(r))return r.subscribe((function(r){return t.prototype.patchValue.call(n,r,o)}));t.prototype.patchValue.call(this,r,o)},r.prototype.push=function(r){return t.prototype.push.call(this,r)},r.prototype.insert=function(r,e){return t.prototype.insert.call(this,r,e)},r.prototype.setControl=function(r,e){return t.prototype.setControl.call(this,r,e)},r.prototype.disabledWhile=function(t,r){return j(this,t,r)},r.prototype.enabledWhile=function(t,r){return E(this,t,r)},r.prototype.mergeValidators=function(t,r){k(this,t,r)},r.prototype.mergeAsyncValidators=function(t,r){this.setAsyncValidators(u([this.asyncValidator],c(t))),this.updateValueAndValidity(r)},r.prototype.markAsTouched=function(r){t.prototype.markAsTouched.call(this,r),this.touchChanges.next(!0)},r.prototype.markAsUntouched=function(r){t.prototype.markAsUntouched.call(this,r),this.touchChanges.next(!1)},r.prototype.markAsPristine=function(r){t.prototype.markAsPristine.call(this,r),this.dirtyChanges.next(!1)},r.prototype.markAsDirty=function(r){t.prototype.markAsDirty.call(this,r),this.dirtyChanges.next(!0)},r.prototype.markAllAsDirty=function(){D(this)},r.prototype.reset=function(r,e){t.prototype.reset.call(this,r,e)},r.prototype.setValidators=function(r,e){t.prototype.setValidators.call(this,r),t.prototype.updateValueAndValidity.call(this,e)},r.prototype.setAsyncValidators=function(r,e){t.prototype.setAsyncValidators.call(this,r),t.prototype.updateValueAndValidity.call(this,e)},r.prototype.validateOn=function(t){var r=this;return t.subscribe((function(t){r.setErrors(t)}))},r.prototype.hasError=function(r,e){return t.prototype.hasError.call(this,r,e)},r.prototype.setErrors=function(r,e){return void 0===e&&(e={}),this.errorsSubject.next(r),t.prototype.setErrors.call(this,r,e)},r.prototype.mergeErrors=function(t,r){void 0===r&&(r={}),this.setErrors(h(this.errors,t),r)},r.prototype.removeError=function(t,r){void 0===r&&(r={}),this.setErrors(f(this.errors,t),r)},r.prototype.getError=function(r,e){return t.prototype.getError.call(this,r,e)},r.prototype.hasErrorAndTouched=function(t,r){return w(this,t,r)},r.prototype.hasErrorAndDirty=function(t,r){return x(this,t,r)},r.prototype.setEnable=function(t,r){void 0===t&&(t=!0),C(this,t,r)},r.prototype.setDisable=function(t,r){void 0===t&&(t=!0),O(this,t,r)},r.prototype.remove=function(t){this.removeWhen((function(r){return r.value===t}))},r.prototype.removeWhen=function(t){for(var r=this.length-1;r>=0;--r)t(this.at(r))&&this.removeAt(r)},r}(r.FormArray),P=function(t){function r(r,n,i){var s=t.call(this,r,n,i)||this;return s.touchChanges=new e.Subject,s.dirtyChanges=new e.Subject,s.errorsSubject=new e.Subject,s.touch$=s.touchChanges.asObservable().pipe(o.distinctUntilChanged()),s.dirty$=s.dirtyChanges.asObservable().pipe(o.distinctUntilChanged()),s.value$=b(s),s.disabled$=v(s),s.enabled$=m(s),s.status$=V(s),s.errors$=A(s,s.errorsSubject.asObservable()),s}return s(r,t),Object.defineProperty(r.prototype,"asyncValidator",{get:function(){return d.get.call(this)},set:function(t){d.set.call(this,t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"validator",{get:function(){return y.get.call(this)},set:function(t){y.set.call(this,t)},enumerable:!1,configurable:!0}),r.prototype.setValue=function(r,o){var n=this;if(e.isObservable(r))return r.subscribe((function(r){return t.prototype.setValue.call(n,r,o)}));t.prototype.setValue.call(this,r,o)},r.prototype.patchValue=function(r,o){var n=this;if(e.isObservable(r))return r.subscribe((function(r){return t.prototype.patchValue.call(n,r,o)}));t.prototype.patchValue.call(this,r,o)},r.prototype.disabledWhile=function(t,r){return j(this,t,r)},r.prototype.enabledWhile=function(t,r){return E(this,t,r)},r.prototype.mergeValidators=function(t,r){k(this,t,r)},r.prototype.mergeAsyncValidators=function(t,r){this.setAsyncValidators(u([this.asyncValidator],c(t))),this.updateValueAndValidity(r)},r.prototype.markAsTouched=function(r){t.prototype.markAsTouched.call(this,r),this.touchChanges.next(!0)},r.prototype.markAsUntouched=function(r){t.prototype.markAsUntouched.call(this,r),this.touchChanges.next(!1)},r.prototype.markAsPristine=function(r){t.prototype.markAsPristine.call(this,r),this.dirtyChanges.next(!1)},r.prototype.markAsDirty=function(r){t.prototype.markAsDirty.call(this,r),this.dirtyChanges.next(!0)},r.prototype.markAllAsDirty=function(){this.markAsDirty({onlySelf:!0})},r.prototype.reset=function(r,e){t.prototype.reset.call(this,r,e)},r.prototype.setValidators=function(r,e){t.prototype.setValidators.call(this,r),t.prototype.updateValueAndValidity.call(this,e)},r.prototype.setAsyncValidators=function(r,e){t.prototype.setAsyncValidators.call(this,r),t.prototype.updateValueAndValidity.call(this,e)},r.prototype.validateOn=function(t){return S(this,t)},r.prototype.getError=function(r){return t.prototype.getError.call(this,r)},r.prototype.hasError=function(r){return t.prototype.hasError.call(this,r)},r.prototype.setErrors=function(r,e){var o;return void 0===e&&(e={}),null===(o=this.errorsSubject)||void 0===o||o.next(r),t.prototype.setErrors.call(this,r,e)},r.prototype.mergeErrors=function(t,r){void 0===r&&(r={}),this.setErrors(h(this.errors,t),r)},r.prototype.removeError=function(t,r){void 0===r&&(r={}),this.setErrors(f(this.errors,t),r)},r.prototype.hasErrorAndTouched=function(t){return w(this,t)},r.prototype.hasErrorAndDirty=function(t){return x(this,t)},r.prototype.setEnable=function(t,r){void 0===t&&(t=!0),C(this,t,r)},r.prototype.setDisable=function(t,r){void 0===t&&(t=!0),O(this,t,r)},r}(r.FormControl),T=function(){function t(){}return t.prototype.setValue=function(t,r){return localStorage.setItem(t,JSON.stringify(r)),r},t.prototype.getValue=function(t){return JSON.parse(localStorage.getItem(t)||"{}")},t}(),U=function(t){function n(r,n,i){var s=t.call(this,r,n,i)||this;return s.controls=r,s.touchChanges=new e.Subject,s.dirtyChanges=new e.Subject,s.errorsSubject=new e.Subject,s.touch$=s.touchChanges.asObservable().pipe(o.distinctUntilChanged()),s.dirty$=s.dirtyChanges.asObservable().pipe(o.distinctUntilChanged()),s.value$=b(s),s.disabled$=v(s),s.enabled$=m(s),s.status$=V(s),s.errors$=A(s,s.errorsSubject.asObservable()),s}return s(n,t),Object.defineProperty(n.prototype,"asyncValidator",{get:function(){return d.get.call(this)},set:function(t){d.set.call(this,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"validator",{get:function(){return y.get.call(this)},set:function(t){y.set.call(this,t)},enumerable:!1,configurable:!0}),n.prototype.select=function(t){return function(t,r){return t.value$.pipe(o.map(r),o.distinctUntilChanged())}(this,t)},n.prototype.getRawValue=function(){return t.prototype.getRawValue.call(this)},n.prototype.get=function(r){return t.prototype.get.call(this,r)},n.prototype.getControl=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return this.get(t)},n.prototype.addControl=function(r,e){t.prototype.addControl.call(this,r,e)},n.prototype.removeControl=function(r){t.prototype.removeControl.call(this,r)},n.prototype.contains=function(r){return t.prototype.contains.call(this,r)},n.prototype.setControl=function(r,e){t.prototype.setControl.call(this,r,e)},n.prototype.setValue=function(r,o){var n=this;if(e.isObservable(r))return r.subscribe((function(r){return t.prototype.setValue.call(n,r,o)}));t.prototype.setValue.call(this,r,o)},n.prototype.patchValue=function(r,o){var n=this;if(e.isObservable(r))return r.subscribe((function(r){return t.prototype.patchValue.call(n,r,o)}));t.prototype.patchValue.call(this,r,o)},n.prototype.disabledWhile=function(t,r){return j(this,t,r)},n.prototype.enabledWhile=function(t,r){return E(this,t,r)},n.prototype.mergeValidators=function(t,r){k(this,t,r)},n.prototype.mergeAsyncValidators=function(t,r){this.setAsyncValidators(u([this.asyncValidator],c(t))),this.updateValueAndValidity(r)},n.prototype.markAsTouched=function(r){t.prototype.markAsTouched.call(this,r),this.touchChanges.next(!0)},n.prototype.markAsUntouched=function(r){t.prototype.markAsUntouched.call(this,r),this.touchChanges.next(!1)},n.prototype.markAsPristine=function(r){t.prototype.markAsPristine.call(this,r),this.dirtyChanges.next(!1)},n.prototype.markAsDirty=function(r){t.prototype.markAsDirty.call(this,r),this.dirtyChanges.next(!0)},n.prototype.markAllAsDirty=function(){D(this)},n.prototype.reset=function(r,e){t.prototype.reset.call(this,r,e)},n.prototype.setValidators=function(r,e){t.prototype.setValidators.call(this,r),t.prototype.updateValueAndValidity.call(this,e)},n.prototype.setAsyncValidators=function(r,e){t.prototype.setAsyncValidators.call(this,r),t.prototype.updateValueAndValidity.call(this,e)},n.prototype.validateOn=function(t){return S(this,t)},n.prototype.hasError=function(r,e){return t.prototype.hasError.call(this,r,e)},n.prototype.setErrors=function(r,e){return void 0===e&&(e={}),this.errorsSubject.next(r),t.prototype.setErrors.call(this,r,e)},n.prototype.mergeErrors=function(t,r){void 0===r&&(r={}),this.setErrors(h(this.errors,t),r)},n.prototype.removeError=function(t,r){void 0===r&&(r={}),this.setErrors(f(this.errors,t),r)},n.prototype.getError=function(r,e){return t.prototype.getError.call(this,r,e)},n.prototype.hasErrorAndTouched=function(t){for(var r=[],e=1;e<arguments.length;e++)r[e-1]=arguments[e];return w.apply(void 0,u([this,t],r))},n.prototype.hasErrorAndDirty=function(t){for(var r=[],e=1;e<arguments.length;e++)r[e-1]=arguments[e];return x.apply(void 0,u([this,t],r))},n.prototype.setEnable=function(t,r){void 0===t&&(t=!0),C(this,t,r)},n.prototype.setDisable=function(t,r){void 0===t&&(t=!0),O(this,t,r)},n.prototype.persist=function(t,r){var e=this,n=r.debounceTime,i=r.manager,s=r.arrControlFactory,a=r.persistDisabledControls,u=i||new T;return this.restore(t,u,s).pipe(o.switchMap((function(){return function(t,r,e){return t.valueChanges.pipe(o.debounceTime(e.debounceTime),o.switchMap((function(o){return p(e.manager.setValue(r,e.persistDisabledControls?t.getRawValue():o))})))}(e,t,{debounceTime:n||250,manager:u,persistDisabledControls:a})})))},n.prototype.restore=function(t,e,n){var i=this;return p(e.getValue(t)).pipe(o.take(1),o.tap((function(t){t&&(!function(t,e,o){Object.keys(e).forEach((function(n){var i=e[n];if(Array.isArray(i)&&t.get(n)instanceof r.FormArray){if(!o||o&&!(n in o))throw new Error("Please provide arrControlFactory for "+n);var s=t.get(n),a=o[n];!function(t){for(;0!==t.length;)t.removeAt(0)}(s),i.forEach((function(t,r){return s.insert(r,a(t))}))}}))}(i,t,n),i.patchValue(t,{emitEvent:!1}))})))},n}(r.FormGroup);var _=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return s(r,t),r.prototype.group=function(t,r){var e,o=this._reduceControls(t),n=null,i=null;return null!=r&&(!function(t){return void 0!==t.asyncValidators||void 0!==t.validators||void 0!==t.updateOn}(r)?(n=null!=r.validator?r.validator:null,i=null!=r.asyncValidator?r.asyncValidator:null):(n=null!=r.validators?r.validators:null,i=null!=r.asyncValidators?r.asyncValidators:null,e=null!=r.updateOn?r.updateOn:void 0)),new U(o,{asyncValidators:i,updateOn:e,validators:n})},r.prototype.control=function(t,r,e){return new P(t,r,e)},r.prototype.array=function(t,r,e){var o=this,n=t.map((function(t){return o._createControl(t)}));return new $(n,r,e)},r}(r.FormBuilder);_.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new _},token:_,providedIn:"root"}),_.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}];var F=function(){function t(){this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t}(),W=function(){function t(){}return t.prototype.setValue=function(t,r){return sessionStorage.setItem(t,JSON.stringify(r)),r},t.prototype.getValue=function(t){return JSON.parse(sessionStorage.getItem(t)||"{}")},t}(),I=function(t){return Object.keys(t)},R=function(t){return t&&Array.isArray(t)},J=function(t){return"object"==typeof t&&null!==t},N=function(t,r){return R(r)||R(t)},M=function(t,r){return J(r)||J(t)},q=function(t,r){return!N(t,r)&&!M(t,r)},B=function(t,r){return[t,r]};function G(t,r){if(void 0===t)return r;if(q(t,r))return t===r?void 0:r;if(N(t,r)){var e=a(B(t,r),2);return function(t,r){return t=Array.isArray(t)?t:[],r=Array.isArray(r)?r:[],t.length===r.length&&t.every((function(t){return r.includes(t)}))}(e[0],e[1])?void 0:r}return function(t,r){var e=function(t,r){if(!t)return r;return I(r).reduce((function(e,o){var n=G(t[o],r[o]);return void 0!==n&&(e[o]=n),e}),{})}(t,r);return 0===I(e).length?void 0:e}(t,r)}t.ControlValueAccessor=F,t.FormArray=$,t.FormBuilder=_,t.FormControl=P,t.FormGroup=U,t.LocalStorageManager=T,t.SessionStorageManager=W,t.diff=function(){return function(t){return t.pipe(o.startWith(void 0),o.pairwise(),o.map((function(t){return G.apply(void 0,u(t))})),o.filter((function(t){return void 0!==t})))}},Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=ngneat-reactive-forms.umd.min.js.map

@@ -97,3 +97,14 @@ import { FormControl as NgFormControl } from '@angular/forms';

setErrors(errors, opts = {}) {
this.errorsSubject.next(errors);
var _a;
/**
* @description
* Use an elvis operator to avoid a throw when the control is used with an async validator
* Which will be instantly resolved (like with `of(null)`)
* In such case, Angular will call this method instantly before even instancing the properties causing the throw
* Can be easily reproduced with a step-by-step debug once compiled when checking the stack trace of the constructor
*
* Issue: https://github.com/ngneat/reactive-forms/issues/91
* Reproduction: https://codesandbox.io/embed/github/C0ZEN/ngneat-reactive-forms-error-issue-cs/tree/main/?autoresize=1&expanddevtools=1&fontsize=14&hidenavigation=1&theme=dark
*/
(_a = this.errorsSubject) === null || _a === void 0 ? void 0 : _a.next(errors);
return super.setErrors(errors, opts);

@@ -120,2 +131,2 @@ }

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybUNvbnRyb2wuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ25lYXQvcmVhY3RpdmUtZm9ybXMvc3JjL2xpYi9mb3JtQ29udHJvbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQW1CLFdBQVcsSUFBSSxhQUFhLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUMvRSxPQUFPLEVBQUUsWUFBWSxFQUFjLE9BQU8sRUFBZ0IsTUFBTSxNQUFNLENBQUM7QUFDdkUsT0FBTyxFQUFFLG9CQUFvQixFQUFFLE1BQU0sZ0JBQWdCLENBQ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V0RXJyb3JzKG1lcmdlRXJyb3JzPEU+KHRoaXMuZXJyb3JzLCBlcnJvcnMpLCBvcHRzKTtcbiAgfVxuXG4gIHJlbW92ZUVycm9yKGtleToga2V5b2YgRSwgb3B0czogRW1pdEV2ZW50ID0ge30pOiB2b2lkIHtcbiAgICB0aGlzLnNldEVycm9ycyhyZW1vdmVFcnJvcjxFPih0aGlzLmVycm9ycywga2V5KSwgb3B0cyk7XG4gIH1cblxuICBoYXNFcnJvckFuZFRvdWNoZWQoZXJyb3I6IEV4dHJhY3RTdHJpbmdzPEU+KTogYm9vbGVhbiB7XG4gICAgcmV0dXJuIGhhc0Vycm9yQW5kVG91Y2hlZCh0aGlzLCBlcnJvcik7XG4gIH1cblxuICBoYXNFcnJvckFuZERpcnR5KGVycm9yOiBFeHRyYWN0U3RyaW5nczxFPik6IGJvb2xlYW4ge1xuICAgIHJldHVybiBoYXNFcnJvckFuZERpcnR5KHRoaXMsIGVycm9yKTtcbiAgfVxuXG4gIHNldEVuYWJsZShlbmFibGUgPSB0cnVlLCBvcHRzPzogQ29udHJvbEV2ZW50T3B0aW9ucykge1xuICAgIGVuYWJsZUNvbnRyb2wodGhpcywgZW5hYmxlLCBvcHRzKTtcbiAgfVxuXG4gIHNldERpc2FibGUoZGlzYWJsZSA9IHRydWUsIG9wdHM/OiBDb250cm9sRXZlbnRPcHRpb25zKSB7XG4gICAgZGlzYWJsZUNvbnRyb2wodGhpcywgZGlzYWJsZSwgb3B0cyk7XG4gIH1cbn1cbiJdfQ==

@@ -379,3 +379,14 @@ import { AbstractControl, FormArray as FormArray$1, FormControl as FormControl$1, FormGroup as FormGroup$1, FormBuilder as FormBuilder$1 } from '@angular/forms';

setErrors(errors, opts = {}) {
this.errorsSubject.next(errors);
var _a;
/**
* @description
* Use an elvis operator to avoid a throw when the control is used with an async validator
* Which will be instantly resolved (like with `of(null)`)
* In such case, Angular will call this method instantly before even instancing the properties causing the throw
* Can be easily reproduced with a step-by-step debug once compiled when checking the stack trace of the constructor
*
* Issue: https://github.com/ngneat/reactive-forms/issues/91
* Reproduction: https://codesandbox.io/embed/github/C0ZEN/ngneat-reactive-forms-error-issue-cs/tree/main/?autoresize=1&expanddevtools=1&fontsize=14&hidenavigation=1&theme=dark
*/
(_a = this.errorsSubject) === null || _a === void 0 ? void 0 : _a.next(errors);
return super.setErrors(errors, opts);

@@ -382,0 +393,0 @@ }

{
"name": "@ngneat/reactive-forms",
"description": "(Angular Reactive) Forms with Benefits",
"version": "1.7.3",
"version": "1.7.4",
"schematics": "./schematics/collection.json",

@@ -6,0 +6,0 @@ "keywords": [

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 not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc