ngx-render-material-forms 1.2.4 → 1.2.5

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.
@@ -2532,8 +2532,8 @@ class MaterialSelectComponent extends MaterialComponent {
2532
2532
  this._onDestroy = new Subject();
2533
2533
  // Variables to track pagination
2534
2534
  this.pageNumber = 1;
2535
- this.pageSize = 3;
2536
- this.totalPages = 3;
2535
+ this.pageSize = 20;
2536
+ this.totalPages = 0;
2537
2537
  this.searchQuery = '';
2538
2538
  this.holy = '';
2539
2539
  this.grail = '';
@@ -2588,10 +2588,12 @@ class MaterialSelectComponent extends MaterialComponent {
2588
2588
  if (this.instance.component.key.toLowerCase() === 'vendorproductid') {
2589
2589
  const scrollElement = event.target;
2590
2590
  const trackHeight = scrollElement.scrollHeight - scrollElement.offsetHeight;
2591
+ console.log('productsloadingFlagScroll=>', this.productsloadingFlag);
2591
2592
  if (this.productsloadingFlag && Math.floor(scrollElement.scrollTop / trackHeight * 100) > 50) {
2592
2593
  this.productsloadingFlag = false;
2593
- if (this.pageNumber < this.totalPages && this.totalPages > 1) {
2594
+ if (this.pageNumber < this.totalPages) {
2594
2595
  this.pageNumber = this.pageNumber + 1;
2596
+ console.log('this.pageNumber', this.pageNumber, this.totalPages);
2595
2597
  this.loadData(this.pageNumber, this.pageSize, this.searchQuery);
2596
2598
  }
2597
2599
  }
@@ -2639,7 +2641,7 @@ class MaterialSelectComponent extends MaterialComponent {
2639
2641
  const baseApiUrl = baseUrlMapping[hostname] || null;
2640
2642
  this.http.get(`${baseApiUrl}/api/VendorFormBuilder/GetVendorProducts?vendorId=${envendorId}&pageNumber=${enpageNumber}&pageSize=${enpageSize}&search=${ensearchQuery}&onlyActive=${enactive}&includeDescription=${endescription}`, { headers }).subscribe(response => {
2641
2643
  if (response && response.code === 200) {
2642
- this.totalPages = response.data.dataSource;
2644
+ this.totalPages = response?.data?.dataSource?.totalPages;
2643
2645
  if (this.instance.component.key.toLowerCase() === 'vendorproductid') {
2644
2646
  const transformedData = this.transformResponseData(response.data.dataSource);
2645
2647
  // Process the transformed data
@@ -2652,6 +2654,8 @@ class MaterialSelectComponent extends MaterialComponent {
2652
2654
  setTimeout(() => {
2653
2655
  this.productsloadingFlag = true;
2654
2656
  }, 1000);
2657
+ console.log('productsloadingFlag', this.productsloadingFlag);
2658
+ console.log('totalPage=>', this.totalPages);
2655
2659
  }
2656
2660
  });
2657
2661
  }