@smartbit4all/ng-client 3.3.238 → 3.3.239

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.
@@ -6834,6 +6834,19 @@ class SmartObjectUtility {
6834
6834
  }
6835
6835
  return undefined;
6836
6836
  }
6837
+ static compareByProps(o1, o2, props) {
6838
+ for (let prop of props) {
6839
+ if (prop in o1 && prop in o2) {
6840
+ if (!deepEqual(o1[prop], o2[prop])) {
6841
+ return false;
6842
+ }
6843
+ }
6844
+ else {
6845
+ return false;
6846
+ }
6847
+ }
6848
+ return true;
6849
+ }
6837
6850
  }
6838
6851
 
6839
6852
  class Table {
@@ -14628,7 +14641,7 @@ class SmartFilterEditorContentComponent {
14628
14641
  if (this.simpleFilterRef?.instance) {
14629
14642
  // we already have a SmartFormComponent, use that
14630
14643
  let comp = this.simpleFilterRef?.instance;
14631
- if (comp.smartForm && deepEqual(comp.smartForm.widgets, smartForm.widgets)) {
14644
+ if (comp.smartForm && this.compareWidgets(comp.smartForm.widgets, smartForm.widgets)) {
14632
14645
  // there's no structural change, don't recreate SmartFormComponent
14633
14646
  comp.smartForm.componentModel = smartForm.componentModel;
14634
14647
  comp.constructForm();
@@ -14640,6 +14653,29 @@ class SmartFilterEditorContentComponent {
14640
14653
  this.simpleFilterRef = this.cfService.createComponent(this.simpleFilterVcRef, SmartformComponent, new Map([['smartForm', smartForm]]));
14641
14654
  this.subsrcibeSimpleFormChildrenEvents();
14642
14655
  }
14656
+ compareWidgets(ws1, ws2) {
14657
+ if (ws1.length !== ws2.length) {
14658
+ return false;
14659
+ }
14660
+ for (let i = 0; i < ws1.length; i++) {
14661
+ if (!this.compareWidget(ws1[i], ws2[i])) {
14662
+ return false;
14663
+ }
14664
+ }
14665
+ return true;
14666
+ }
14667
+ compareWidget(w1, w2) {
14668
+ return SmartObjectUtility.compareByProps(w1, w2, [
14669
+ 'error',
14670
+ 'key',
14671
+ 'label',
14672
+ 'type',
14673
+ 'value',
14674
+ 'showLabel',
14675
+ 'valueList',
14676
+ 'toolbarId',
14677
+ ]);
14678
+ }
14643
14679
  extractFilterFieldFromFormModel() {
14644
14680
  let simpleFilter = this.simpleFilterRef?.instance?.submitForm(false).componentModel.data;
14645
14681
  let result = [];