ngx-render-material-forms 1.5.5 → 1.5.7

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.
@@ -2562,6 +2562,8 @@ class MaterialSelectComponent extends MaterialComponent {
2562
2562
  this.productsloadingFlag = false;
2563
2563
  this.searching = false;
2564
2564
  this.productList = [];
2565
+ this.selectedValue = '';
2566
+ this.searchItem = "";
2565
2567
  // Variable to hold the reference to the current panel element
2566
2568
  this.currentPanelElement = null;
2567
2569
  this.openCounter = 1;
@@ -2576,6 +2578,7 @@ class MaterialSelectComponent extends MaterialComponent {
2576
2578
  clearProducts() {
2577
2579
  if (this.instance.component.key.toLowerCase() === 'vendorproductid') {
2578
2580
  this.onClearAll();
2581
+ this.searchItem = "";
2579
2582
  }
2580
2583
  }
2581
2584
  scrumble(msg) {
@@ -2706,16 +2709,14 @@ class MaterialSelectComponent extends MaterialComponent {
2706
2709
  this.productsloadingFlag = true;
2707
2710
  setTimeout(() => {
2708
2711
  const ele = this.selectElem?.panel?.nativeElement;
2709
- const trackHeight = ele.scrollHeight - ele.offsetHeight;
2710
- const middlePosition = trackHeight / 2 - 50;
2711
- ele.scrollTo({ top: middlePosition, behavior: 'auto' });
2712
- // if (ele) {
2713
- // const trackHeight = ele.scrollHeight - ele.offsetHeight
2714
- // const middlePosition = trackHeight / 2 - 50;
2715
- // ele.scrollTo({ top: middlePosition, behavior: 'auto' });
2716
- // } else {
2717
- // console.log('Panel element is not available yet.');
2718
- // }
2712
+ if (ele) {
2713
+ const trackHeight = ele.scrollHeight - ele.offsetHeight;
2714
+ const middlePosition = trackHeight / 2 - 50;
2715
+ ele.scrollTo({ top: middlePosition, behavior: 'auto' });
2716
+ }
2717
+ else {
2718
+ console.log('Panel element is not available yet.');
2719
+ }
2719
2720
  }, 250);
2720
2721
  }
2721
2722
  }
@@ -2767,6 +2768,7 @@ class MaterialSelectComponent extends MaterialComponent {
2767
2768
  this.searchQuery = '';
2768
2769
  this.searching = false;
2769
2770
  this.productList = [];
2771
+ this.selectedValue = '';
2770
2772
  this.loadData(this.pageNumber, this.pageSize, this.searchQuery);
2771
2773
  }
2772
2774
  }
@@ -2778,20 +2780,25 @@ class MaterialSelectComponent extends MaterialComponent {
2778
2780
  this.pageSize = 20;
2779
2781
  this.searchQuery = '';
2780
2782
  this.searching = false;
2783
+ this.selectedValue = this.getValue();
2784
+ if (this.searchItem?.length > 0) {
2785
+ this.websiteMultiFilterCtrl.setValue(this.searchItem);
2786
+ this.ref.detectChanges();
2787
+ }
2781
2788
  //this.loadData(this.pageNumber, this.pageSize, this.searchQuery);
2782
2789
  this.registerPanelScrollEvent(this.selectElem);
2783
2790
  }
2784
2791
  else {
2785
2792
  this.removePanelScrollEvent();
2786
2793
  this.searching = false;
2787
- let selectedValue = this.getValue();
2788
- if (selectedValue?.toString().length == '' || this.searchQuery == '' || this.productList?.length === 0) {
2789
- this.productList = [];
2790
- this.pageNumber = 1;
2791
- this.pageSize = 20;
2792
- this.searchQuery = '';
2793
- this.loadData(this.pageNumber, this.pageSize, this.searchQuery);
2794
- }
2794
+ // this.selectedValue = this.getValue();
2795
+ // if (this.selectedValue?.toString().length == 0) {
2796
+ // this.productList = [];
2797
+ // this.pageNumber = 1;
2798
+ // this.pageSize = 20;
2799
+ // this.searchQuery = '';
2800
+ // this.loadData(this.pageNumber, this.pageSize, this.searchQuery);
2801
+ // }
2795
2802
  }
2796
2803
  });
2797
2804
  }
@@ -2817,6 +2824,7 @@ class MaterialSelectComponent extends MaterialComponent {
2817
2824
  this.productList = [];
2818
2825
  this.searching = true;
2819
2826
  this.searchQuery = searchQuery;
2827
+ this.searchItem = searchQuery;
2820
2828
  this.loadData(this.pageNumber, this.pageSize, searchQuery);
2821
2829
  }
2822
2830
  });