i-tech-shared-components 1.4.52 → 1.4.54

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.
@@ -678,14 +678,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
678
678
  }] } });
679
679
 
680
680
  class AutocompleteSelectComponent {
681
- /**
682
- * See AutocompleteConfigsInterface for available configurations.
683
- */
684
681
  set configs(data) {
685
- this.selectConfig = data;
686
682
  if (!data) {
683
+ this.selectConfig = data;
687
684
  return;
688
685
  }
686
+ // Generate a signature that works with functions
687
+ const signature = JSON.stringify(data, (key, value) => {
688
+ // Replace functions with a stable placeholder
689
+ return typeof value === 'function' ? '[Function]' : value;
690
+ });
691
+ // Stop if config hasn't actually changed
692
+ if (this._lastConfigSignature === signature) {
693
+ this.selectConfig = data; // Update reference but skip initialization
694
+ return;
695
+ }
696
+ // Config changed - proceed with initialization
697
+ this._lastConfigSignature = signature;
698
+ this.selectConfig = data;
689
699
  // Set default search strategy to 'backend' if not specified
690
700
  if (!this.selectConfig.searchStrategy) {
691
701
  this.selectConfig.searchStrategy = 'backend';
@@ -720,6 +730,7 @@ class AutocompleteSelectComponent {
720
730
  }
721
731
  constructor(inputService) {
722
732
  this.inputService = inputService;
733
+ this._lastConfigSignature = '';
723
734
  this.selectionChange = new EventEmitter();
724
735
  this.multiSelectSelectionChange = new EventEmitter();
725
736
  this.emitAction = new EventEmitter();
@@ -774,6 +785,9 @@ class AutocompleteSelectComponent {
774
785
  this.isNeededForRecall = true;
775
786
  this.reCallData();
776
787
  }
788
+ else if (!newValue) {
789
+ this.resetVariables();
790
+ }
777
791
  });
778
792
  }
779
793
  hardReload() {
@@ -782,7 +796,13 @@ class AutocompleteSelectComponent {
782
796
  resetVariables() {
783
797
  this.defaultValueForFirst = '';
784
798
  this.showingValue = null;
799
+ this.accessToNextRequest = true;
800
+ this.pending = false;
801
+ this.requestLoading = false;
785
802
  this.defaultValue = null;
803
+ if (this.searchInput?.nativeElement) {
804
+ this.searchInput.nativeElement.value = '';
805
+ }
786
806
  }
787
807
  resetAllAndHardReload() {
788
808
  this.resetVariables();