ngx-render-material-forms 1.2.2 → 1.2.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.
@@ -2621,7 +2621,12 @@ class MaterialSelectComponent extends MaterialComponent {
2621
2621
  const enpageSize = this.scrumble(pageSize);
2622
2622
  const ensearchQuery = this.scrumble(searchQuery);
2623
2623
  const enactive = this.scrumble(onlyActive);
2624
- const endescription = this.scrumble(includeDescription);
2624
+ // const endescription = this.scrumble(includeDescription);
2625
+ // Scrumble and handle the includeDescription parameter
2626
+ let endescription = this.scrumble(includeDescription);
2627
+ if (!endescription) {
2628
+ endescription = this.scrumble(false); // Set to 'false' if undefined, null, or blank
2629
+ }
2625
2630
  const baseUrlMapping = {
2626
2631
  'localhost': 'http://localhost:58504',
2627
2632
  'lincoln.vartopia.com': 'https://lincoln-api.vartopia.com',
@@ -2635,13 +2640,15 @@ class MaterialSelectComponent extends MaterialComponent {
2635
2640
  this.http.get(`${baseApiUrl}/api/VendorFormBuilder/GetVendorProducts?vendorId=${envendorId}&pageNumber=${enpageNumber}&pageSize=${enpageSize}&search=${ensearchQuery}&onlyActive=${enactive}&includeDescription=${endescription}`, { headers }).subscribe(response => {
2636
2641
  if (response && response.code === 200) {
2637
2642
  this.totalPages = response.data.dataSource;
2638
- const transformedData = this.transformResponseData(response.data.dataSource);
2639
- // Process the transformed data
2640
- this.filteredOptions = Promise.resolve(transformedData.map(item => ({
2641
- label: item.label,
2642
- value: item.value,
2643
- date: item.date
2644
- })));
2643
+ if (this.instance.component.key.toLowerCase() === 'vendorproductid') {
2644
+ const transformedData = this.transformResponseData(response.data.dataSource);
2645
+ // Process the transformed data
2646
+ this.filteredOptions = Promise.resolve(transformedData.map(item => ({
2647
+ label: item.label,
2648
+ value: item.value,
2649
+ date: item.date
2650
+ })));
2651
+ }
2645
2652
  setTimeout(() => {
2646
2653
  this.productsloadingFlag = true;
2647
2654
  }, 1000);
@@ -2686,14 +2693,18 @@ class MaterialSelectComponent extends MaterialComponent {
2686
2693
  }
2687
2694
  onClearAll() {
2688
2695
  if (this.searchFlag) {
2689
- this.loadData(1, 20, '');
2696
+ if (this.instance.component.key.toLowerCase() === 'vendorproductid') {
2697
+ this.loadData(1, 20, '');
2698
+ }
2690
2699
  }
2691
2700
  }
2692
2701
  ngAfterViewInit() {
2693
2702
  this.selectElem.openedChange.subscribe((isOpen) => {
2694
2703
  if (isOpen) {
2695
2704
  this.searchFlag = false;
2696
- this.loadData(1, 20, '');
2705
+ if (this.instance.component.key.toLowerCase() === 'vendorproductid') {
2706
+ this.loadData(1, 20, '');
2707
+ }
2697
2708
  }
2698
2709
  else {
2699
2710
  this.searchFlag = false;