@reactables/forms 0.5.0-alpha.0 → 0.5.2-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +4 -3
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -811,8 +811,7 @@ var hasErrors$1 = function (errors) {
811
811
  var mergeRemoveControl = function (state, form, controlRef) {
812
812
  var parentRef = controlRef.slice(0, -1);
813
813
  var existingBranch = getControlBranch(parentRef, state);
814
- var descendants = existingBranch.filter(function (control) { return control.controlRef.length < parentRef.length; });
815
- var controlBranch = getControlBranch(parentRef, form)
814
+ var updatedControlBranch = getControlBranch(parentRef, form)
816
815
  .reverse()
817
816
  .reduce(function (acc, baseControl) {
818
817
  var _a;
@@ -840,11 +839,13 @@ var mergeRemoveControl = function (state, form, controlRef) {
840
839
  }
841
840
  return __assign(__assign({}, acc), (_a = {}, _a[key] = __assign(__assign(__assign({}, existingControl), baseControl), { errors: errors, valid: selfValid && childrenValid, childrenValid: childrenValid }), _a));
842
841
  }, {});
842
+ var descendants = existingBranch.filter(function (control) { return control.controlRef.length > parentRef.length; });
843
843
  var removedControls = __assign({}, state);
844
844
  descendants.forEach(function (control) {
845
845
  delete removedControls[getFormKey(control.controlRef)];
846
846
  });
847
- return __assign(__assign({}, removedControls), controlBranch);
847
+ delete removedControls[getFormKey(controlRef)];
848
+ return __assign(__assign({}, removedControls), updatedControlBranch);
848
849
  };
849
850
 
850
851
  var mergeTouchUpdated = function (state, form, controlRef) {
package/package.json CHANGED
@@ -14,12 +14,12 @@
14
14
  "author": "David Lai",
15
15
  "license": "ISC",
16
16
  "dependencies": {
17
- "@reactables/core": "^0.5.0-alpha.0",
17
+ "@reactables/core": "^0.5.2-alpha.0",
18
18
  "lodash.clonedeep": "^4.5.0",
19
19
  "lodash.isequal": "^4.5.0"
20
20
  },
21
21
  "peerDependencies": {
22
22
  "rxjs": "^6.0.0 || ^7.0.0"
23
23
  },
24
- "version": "0.5.0-alpha.0"
24
+ "version": "0.5.2-alpha.0"
25
25
  }