@smartbit4all/ng-client 3.3.234 → 3.3.236

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.
@@ -5598,6 +5598,8 @@ class SmartformwidgetComponent {
5598
5598
  (_a = this.onBlur) === null || _a === void 0 ? void 0 : _a.pipe(takeUntil(this._destroy$)).subscribe(() => {
5599
5599
  this.getErrorMessage(this.widgetInstance);
5600
5600
  });
5601
+ // handle initial error message from server
5602
+ this.getErrorMessage(this.widgetInstance);
5601
5603
  if (this.widgetInstance.type === SmartFormWidgetType.INDICATOR &&
5602
5604
  this.widgetInstance.indicator) {
5603
5605
  if ((_b = this.widgetInstance.indicator) === null || _b === void 0 ? void 0 : _b.indicatorLength) {
@@ -14660,16 +14662,14 @@ class SmartFilterEditorContentComponent {
14660
14662
  this._destroy$.complete();
14661
14663
  }
14662
14664
  setupSimpleFilter() {
14663
- var _a, _b, _c, _d, _e;
14664
- (_a = this.simpleFilterVcRef) === null || _a === void 0 ? void 0 : _a.clear();
14665
- (_b = this.simpleFilterRef) === null || _b === void 0 ? void 0 : _b.destroy();
14665
+ var _a, _b, _c, _d, _e, _f, _g;
14666
14666
  if (!this.simpleFilterVcRef) {
14667
14667
  return;
14668
14668
  }
14669
14669
  let widgets = [];
14670
14670
  let key;
14671
14671
  let model = {};
14672
- (_e = (_d = (_c = this.service.model) === null || _c === void 0 ? void 0 : _c.model) === null || _d === void 0 ? void 0 : _d.workplaceList) === null || _e === void 0 ? void 0 : _e.filters.forEach((filterExpressionField, index) => {
14672
+ (_c = (_b = (_a = this.service.model) === null || _a === void 0 ? void 0 : _a.model) === null || _b === void 0 ? void 0 : _b.workplaceList) === null || _c === void 0 ? void 0 : _c.filters.forEach((filterExpressionField, index) => {
14673
14673
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
14674
14674
  model[index] = filterExpressionField;
14675
14675
  if (filterExpressionField.widgetType === FilterExpressionFieldWidgetType.TEXT_FIELD_LOOKUP) {
@@ -14711,6 +14711,18 @@ class SmartFilterEditorContentComponent {
14711
14711
  useOnBlurEvent: true,
14712
14712
  widgets,
14713
14713
  };
14714
+ if ((_d = this.simpleFilterRef) === null || _d === void 0 ? void 0 : _d.instance) {
14715
+ // we already have a SmartFormComponent, use that
14716
+ let comp = (_e = this.simpleFilterRef) === null || _e === void 0 ? void 0 : _e.instance;
14717
+ if (comp.smartForm && deepEqual(comp.smartForm, smartForm)) {
14718
+ // there's no structural change, don't recreate SmartFormComponent
14719
+ comp.smartForm.componentModel = { data: model };
14720
+ comp.constructForm();
14721
+ return;
14722
+ }
14723
+ }
14724
+ (_f = this.simpleFilterVcRef) === null || _f === void 0 ? void 0 : _f.clear();
14725
+ (_g = this.simpleFilterRef) === null || _g === void 0 ? void 0 : _g.destroy();
14714
14726
  this.simpleFilterRef = this.cfService.createComponent(this.simpleFilterVcRef, SmartformComponent, new Map([['smartForm', smartForm]]));
14715
14727
  this.subsrcibeSimpleFormChildrenEvents();
14716
14728
  }