ngx-render-material-forms 1.2.3 → 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
  }
@@ -2621,7 +2623,12 @@ class MaterialSelectComponent extends MaterialComponent {
2621
2623
  const enpageSize = this.scrumble(pageSize);
2622
2624
  const ensearchQuery = this.scrumble(searchQuery);
2623
2625
  const enactive = this.scrumble(onlyActive);
2624
- const endescription = this.scrumble(includeDescription);
2626
+ // const endescription = this.scrumble(includeDescription);
2627
+ // Scrumble and handle the includeDescription parameter
2628
+ let endescription = this.scrumble(includeDescription);
2629
+ if (!endescription) {
2630
+ endescription = this.scrumble(false); // Set to 'false' if undefined, null, or blank
2631
+ }
2625
2632
  const baseUrlMapping = {
2626
2633
  'localhost': 'http://localhost:58504',
2627
2634
  'lincoln.vartopia.com': 'https://lincoln-api.vartopia.com',
@@ -2634,7 +2641,7 @@ class MaterialSelectComponent extends MaterialComponent {
2634
2641
  const baseApiUrl = baseUrlMapping[hostname] || null;
2635
2642
  this.http.get(`${baseApiUrl}/api/VendorFormBuilder/GetVendorProducts?vendorId=${envendorId}&pageNumber=${enpageNumber}&pageSize=${enpageSize}&search=${ensearchQuery}&onlyActive=${enactive}&includeDescription=${endescription}`, { headers }).subscribe(response => {
2636
2643
  if (response && response.code === 200) {
2637
- this.totalPages = response.data.dataSource;
2644
+ this.totalPages = response?.data?.dataSource?.totalPages;
2638
2645
  if (this.instance.component.key.toLowerCase() === 'vendorproductid') {
2639
2646
  const transformedData = this.transformResponseData(response.data.dataSource);
2640
2647
  // Process the transformed data
@@ -2647,6 +2654,8 @@ class MaterialSelectComponent extends MaterialComponent {
2647
2654
  setTimeout(() => {
2648
2655
  this.productsloadingFlag = true;
2649
2656
  }, 1000);
2657
+ console.log('productsloadingFlag', this.productsloadingFlag);
2658
+ console.log('totalPage=>', this.totalPages);
2650
2659
  }
2651
2660
  });
2652
2661
  }