@maro-tech/form 0.1.3 → 0.1.4

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.
@@ -2531,7 +2531,10 @@ class InputSelectControlComponent {
2531
2531
  });
2532
2532
  }
2533
2533
  ngOnChanges(changes) {
2534
- if ('data' in changes || 'dataParams' in changes) {
2534
+ const dataChanged = 'data' in changes;
2535
+ const dataParamsChanged = 'dataParams' in changes
2536
+ && !this.sameDataParams(changes['dataParams'].previousValue, changes['dataParams'].currentValue);
2537
+ if (dataChanged || dataParamsChanged) {
2535
2538
  this.reloadDictionaryOptions();
2536
2539
  }
2537
2540
  }
@@ -2703,6 +2706,18 @@ class InputSelectControlComponent {
2703
2706
  getDictionaryName() {
2704
2707
  return String(this.data || '').trim();
2705
2708
  }
2709
+ sameDataParams(previous, current) {
2710
+ if (previous === current)
2711
+ return true;
2712
+ if (!previous || !current || typeof previous !== 'object' || typeof current !== 'object')
2713
+ return false;
2714
+ const previousEntries = Object.entries(previous);
2715
+ const currentEntries = Object.entries(current);
2716
+ if (previousEntries.length !== currentEntries.length)
2717
+ return false;
2718
+ return previousEntries.every(([key, value]) => Object.prototype.hasOwnProperty.call(current, key)
2719
+ && current[key] === value);
2720
+ }
2706
2721
  reloadDictionaryOptions() {
2707
2722
  const dictionaryName = this.getDictionaryName();
2708
2723
  this.dictionaryRequestVersions.clear();