@mtna/web-form-angular 1.0.6-SNAPSHOT.7 → 1.0.6-SNAPSHOT.8

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.
@@ -4440,6 +4440,9 @@
4440
4440
  },
4441
4441
  set: function (value) {
4442
4442
  this._item = value;
4443
+ if (this.wfItemComponent) {
4444
+ this.reset();
4445
+ }
4443
4446
  },
4444
4447
  enumerable: false,
4445
4448
  configurable: true
@@ -4474,6 +4477,20 @@
4474
4477
  enumerable: false,
4475
4478
  configurable: true
4476
4479
  });
4480
+ MtnaWfItemInjector.prototype.reset = function () {
4481
+ var _a, _b, _c;
4482
+ if (coreTs.isPresent(this.focusedSectionSubscription)) {
4483
+ (_a = this.focusedSectionSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
4484
+ this.focusedSectionSubscription = undefined;
4485
+ }
4486
+ if (coreTs.isPresent(this.toggleFormItemsSubscription)) {
4487
+ (_b = this.toggleFormItemsSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
4488
+ this.toggleFormItemsSubscription = undefined;
4489
+ }
4490
+ (_c = this.componentRef) === null || _c === void 0 ? void 0 : _c.destroy();
4491
+ this.wfItemComponent = undefined;
4492
+ this.ngOnInit();
4493
+ };
4477
4494
  MtnaWfItemInjector.prototype.ngOnInit = function () {
4478
4495
  if (this.item) {
4479
4496
  _super.prototype.ngOnInit.call(this);
@@ -4481,6 +4498,7 @@
4481
4498
  };
4482
4499
  MtnaWfItemInjector.prototype.configureComponent = function (componentRef) {
4483
4500
  var _this = this;
4501
+ this.componentRef = componentRef;
4484
4502
  this.wfItemComponent = componentRef.instance;
4485
4503
  this.wfItemComponent.header = this.header;
4486
4504
  this._indicatorStatus.subscribe(function (status) {
@@ -4499,7 +4517,7 @@
4499
4517
  if (this.wfItemComponent instanceof MtnaWfBaseParentValueItem) {
4500
4518
  this.wfItemComponent.parentIds = this.parentIds;
4501
4519
  // added output to remove ui service from base components
4502
- this.wfItemComponent.toggleFormItems.subscribe(function (data) {
4520
+ this.toggleFormItemsSubscription = this.wfItemComponent.toggleFormItems.subscribe(function (data) {
4503
4521
  _this.toggleFormItems.emit(data);
4504
4522
  });
4505
4523
  if (this.wfItemComponent instanceof MtnaWfBaseSingleSelectionParentValueItem) {
@@ -4512,7 +4530,7 @@
4512
4530
  this.wfItemComponent.parentIds = this.parentIds;
4513
4531
  if (this.wfItemComponent instanceof MtnaWfBaseSectionItem) {
4514
4532
  this.wfItemComponent.step = this.step;
4515
- this.wfItemComponent.focused.subscribe(function (step) {
4533
+ this.focusedSectionSubscription = this.wfItemComponent.focused.subscribe(function (step) {
4516
4534
  _this.focusedSection.emit(step);
4517
4535
  });
4518
4536
  }