@smartbit4all/ng-client 3.3.237 → 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 {
@@ -14597,7 +14610,7 @@ class SmartFilterEditorContentComponent {
14597
14610
  }
14598
14611
  if (filterExpressionField.widgetType === 'SELECT_MULTIPLE') {
14599
14612
  key = index + '.expressionData.operand2.selectedValues';
14600
- widgets.push(this.constructFormWidget(key, filterExpressionField.label2, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TEXT_FIELD, filterExpressionField.possibleValues, filterExpressionField.expressionData?.operand2?.valueAsString ?? '', filterExpressionField.toolbarId));
14613
+ widgets.push(this.constructFormWidget(key, filterExpressionField.label2, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TEXT_FIELD, filterExpressionField.possibleValues, filterExpressionField.expressionData?.operand2?.selectedValues ?? [], filterExpressionField.toolbarId));
14601
14614
  return;
14602
14615
  }
14603
14616
  if (filterExpressionField.expressionData?.currentOperation === 'BETWEEN') {
@@ -14608,16 +14621,12 @@ class SmartFilterEditorContentComponent {
14608
14621
  return;
14609
14622
  }
14610
14623
  if (filterExpressionField.expressionData?.operand2) {
14611
- if (key !== index + '.expressionData.operand2.selectedValues') {
14612
- key = index + '.expressionData.operand2.valueAsString';
14613
- }
14624
+ key = index + '.expressionData.operand2.valueAsString';
14614
14625
  widgets.push(this.constructFormWidget(key, filterExpressionField.label2, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TEXT_FIELD, filterExpressionField.possibleValues, filterExpressionField.expressionData?.operand2?.valueAsString ?? '', filterExpressionField.toolbarId));
14615
14626
  return;
14616
14627
  }
14617
14628
  if (filterExpressionField?.expressionData?.operand3) {
14618
- if (key !== index + '.selectedValues') {
14619
- key = index + '.expressionData.operand3.valueAsString';
14620
- }
14629
+ key = index + '.expressionData.operand3.valueAsString';
14621
14630
  widgets.push(this.constructFormWidget(key, filterExpressionField.label3, filterExpressionField.widgetType ?? FilterExpressionFieldWidgetType.TEXT_FIELD, filterExpressionField.possibleValues, filterExpressionField.expressionData?.operand3?.valueAsString ?? '', filterExpressionField.toolbarId));
14622
14631
  return;
14623
14632
  }
@@ -14632,7 +14641,7 @@ class SmartFilterEditorContentComponent {
14632
14641
  if (this.simpleFilterRef?.instance) {
14633
14642
  // we already have a SmartFormComponent, use that
14634
14643
  let comp = this.simpleFilterRef?.instance;
14635
- if (comp.smartForm && deepEqual(comp.smartForm.widgets, smartForm.widgets)) {
14644
+ if (comp.smartForm && this.compareWidgets(comp.smartForm.widgets, smartForm.widgets)) {
14636
14645
  // there's no structural change, don't recreate SmartFormComponent
14637
14646
  comp.smartForm.componentModel = smartForm.componentModel;
14638
14647
  comp.constructForm();
@@ -14644,6 +14653,29 @@ class SmartFilterEditorContentComponent {
14644
14653
  this.simpleFilterRef = this.cfService.createComponent(this.simpleFilterVcRef, SmartformComponent, new Map([['smartForm', smartForm]]));
14645
14654
  this.subsrcibeSimpleFormChildrenEvents();
14646
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
+ }
14647
14679
  extractFilterFieldFromFormModel() {
14648
14680
  let simpleFilter = this.simpleFilterRef?.instance?.submitForm(false).componentModel.data;
14649
14681
  let result = [];