ngx-render-material-forms 1.9.6 → 1.9.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.
@@ -1071,6 +1071,12 @@ ButtonComponent.MaterialComponent = MaterialButtonComponent;
1071
1071
 
1072
1072
  class MaterialTextareaComponent extends MaterialComponent {
1073
1073
  ngAfterViewInit() {
1074
+ if (this.element && this.element.nativeElement && this.instance) {
1075
+ // Add custom classes to elements.
1076
+ if (this.instance.component.customClass) {
1077
+ this.element.nativeElement.classList.add(this.instance.component.customClass);
1078
+ }
1079
+ }
1074
1080
  // Attach the element so the wysiwyg will work.
1075
1081
  this.instance.attachElement(this.textarea.nativeElement);
1076
1082
  }
@@ -3002,27 +3008,82 @@ class MaterialSelectComponent extends MaterialComponent {
3002
3008
  }
3003
3009
  }
3004
3010
  updateSecondDropdown(value) {
3005
- const apiEndPoint = 'ManageVendors/GetReferenceDataItemsByVendorIdAndDataValue';
3006
- let finalParams = JSON.parse(localStorage.getItem('cascadingDropdownsParams'));
3007
- if (Array.isArray(finalParams)) {
3008
- const index = finalParams.findIndex(param => param.key === 'dataValue');
3009
- if (index !== -1) {
3010
- // If the object exists, update its value
3011
- finalParams[index].value = value;
3012
- }
3013
- else {
3014
- // If the object doesn't exist, add it to the array
3015
- finalParams.push({ key: 'dataValue', value: value });
3016
- }
3017
- this.commonService.initializeApiPath(apiEndPoint, finalParams).subscribe(response => {
3018
- if (response && response.code === 200) {
3019
- this.secondDropdownItems = response.data;
3020
- this.commonService.setDropdownItems(this.secondDropdownItems);
3011
+ const paramsData = JSON.parse(localStorage.getItem('cascadingDropdownsParamsone'));
3012
+ const vendorId = this.getValueByKey(paramsData, 'vendorId');
3013
+ const dealId = this.getValueByKey(paramsData, 'dealId');
3014
+ const isEdit = this.getValueByKey(paramsData, 'isEdit');
3015
+ let finalParams;
3016
+ this.instance?.parent?.components?.length && this.instance.parent.components.forEach(items => {
3017
+ if (this.checkVendorRefItems(items)) {
3018
+ const apiEndPoint = items?.component?.selectValues;
3019
+ if (apiEndPoint != '') {
3020
+ var parameters = [
3021
+ {
3022
+ "key": "userId",
3023
+ "value": JSON.parse(localStorage.getItem('currentUser')).UserId
3024
+ },
3025
+ {
3026
+ "key": "vendorId",
3027
+ "value": vendorId
3028
+ },
3029
+ {
3030
+ "key": "loginUserId",
3031
+ "value": JSON.parse(localStorage.getItem('currentUser')).UserId
3032
+ },
3033
+ {
3034
+ "key": "country",
3035
+ "value": typeof value === 'string' ? value.trim() : ''
3036
+ },
3037
+ {
3038
+ "key": "dataValue",
3039
+ "value": typeof value === 'string' ? value.trim() : ''
3040
+ },
3041
+ {
3042
+ "key": "dealId",
3043
+ "value": dealId
3044
+ },
3045
+ {
3046
+ "key": "isEdit",
3047
+ "value": isEdit
3048
+ },
3049
+ {
3050
+ "key": "referenceListName",
3051
+ "value": items?.component?.key
3052
+ },
3053
+ {
3054
+ "key": "referenceListFieldName",
3055
+ "value": this.instance?.component?.key
3056
+ }
3057
+ ];
3058
+ finalParams = parameters?.filter(f1 => items?.component?.data?.headers.some(f2 => f1.key === f2.key));
3059
+ if (Array.isArray(finalParams)) {
3060
+ const index = finalParams.findIndex(param => param.key === 'dataValue');
3061
+ if (index !== -1) {
3062
+ // If the object exists, update its value
3063
+ finalParams[index].value = value;
3064
+ }
3065
+ else {
3066
+ // If the object doesn't exist, add it to the array
3067
+ finalParams.push({ key: 'dataValue', value: value });
3068
+ }
3069
+ this.commonService.initializeApiPath(apiEndPoint, finalParams).subscribe(response => {
3070
+ if (response && response.code === 200) {
3071
+ this.secondDropdownItems = response.data;
3072
+ this.commonService.setDropdownItems(this.secondDropdownItems);
3073
+ }
3074
+ });
3075
+ }
3021
3076
  }
3022
- });
3023
- }
3077
+ }
3078
+ });
3024
3079
  }
3025
3080
  ngAfterViewInit() {
3081
+ if (this.element && this.element.nativeElement && this.instance) {
3082
+ // Add custom classes to elements.
3083
+ if (this.instance.component.customClass) {
3084
+ this.element.nativeElement.classList.add(this.instance.component.customClass);
3085
+ }
3086
+ }
3026
3087
  this.selectElem.openedChange.subscribe(async (isOpen) => {
3027
3088
  let i = 0;
3028
3089
  if (isOpen) {
@@ -3907,10 +3968,15 @@ class MaterialDataGridComponent extends MaterialNestedComponent {
3907
3968
  }
3908
3969
  return '';
3909
3970
  }
3910
- // ngOnInit(): void {
3911
- // }
3971
+ ngOnInit() {
3972
+ if (this.element && this.element.nativeElement && this.instance) {
3973
+ // Add custom classes to elements.
3974
+ if (this.instance.component.customClass) {
3975
+ this.element.nativeElement.classList.add(this.instance.component.customClass);
3976
+ }
3977
+ }
3978
+ }
3912
3979
  setInstance(instance) {
3913
- //const newProductPickerFlag = instance?.component?.attributes;
3914
3980
  const checkAttribute = instance?.component?.attributes;
3915
3981
  this.showNewProductPicker = this.commonService.checkIsAttributeTrue(checkAttribute, "newproductpicker");
3916
3982
  this.showCategory = this.commonService.checkIsAttributeTrue(checkAttribute, "showCategory");