ngx-render-material-forms 1.9.6 → 1.9.8
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.
- package/esm2020/lib/components/add-on-products/add-on-products.component.mjs +6 -2
- package/esm2020/lib/components/datagrid/datagrid.component.mjs +9 -4
- package/esm2020/lib/components/select/select.component.mjs +74 -19
- package/esm2020/lib/components/textarea/textarea.component.mjs +7 -1
- package/fesm2015/ngx-render-material-forms.js +94 -22
- package/fesm2015/ngx-render-material-forms.mjs.map +1 -1
- package/fesm2020/ngx-render-material-forms.js +92 -22
- package/fesm2020/ngx-render-material-forms.mjs.map +1 -1
- package/lib/components/datagrid/datagrid.component.d.ts +1 -0
- package/package.json +1 -1
|
@@ -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
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
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) {
|
|
@@ -3731,7 +3792,11 @@ class AddOnProductsComponent {
|
|
|
3731
3792
|
getProducts(flag) {
|
|
3732
3793
|
this.spinnerFlag = true;
|
|
3733
3794
|
const search = this.searchQuery;
|
|
3734
|
-
|
|
3795
|
+
const levelOneId = this.levelOneId ? this.levelOneId : 0;
|
|
3796
|
+
const levelTwoId = this.levelTwoId ? this.levelTwoId : 0;
|
|
3797
|
+
const levelThreeId = this.levelThreeId ? this.levelThreeId : 0;
|
|
3798
|
+
const levelFourId = this.levelFourId ? this.levelFourId : 0;
|
|
3799
|
+
this.commonSevice.loadProducts(this.pageNumber, this.pageSize, search, true, false, levelOneId, levelTwoId, levelThreeId, levelFourId).subscribe(response => {
|
|
3735
3800
|
this.spinnerFlag = false;
|
|
3736
3801
|
if (response && response.code === 200) {
|
|
3737
3802
|
this.totalPages = response?.data?.totalPages;
|
|
@@ -3907,10 +3972,15 @@ class MaterialDataGridComponent extends MaterialNestedComponent {
|
|
|
3907
3972
|
}
|
|
3908
3973
|
return '';
|
|
3909
3974
|
}
|
|
3910
|
-
|
|
3911
|
-
|
|
3975
|
+
ngOnInit() {
|
|
3976
|
+
if (this.element && this.element.nativeElement && this.instance) {
|
|
3977
|
+
// Add custom classes to elements.
|
|
3978
|
+
if (this.instance.component.customClass) {
|
|
3979
|
+
this.element.nativeElement.classList.add(this.instance.component.customClass);
|
|
3980
|
+
}
|
|
3981
|
+
}
|
|
3982
|
+
}
|
|
3912
3983
|
setInstance(instance) {
|
|
3913
|
-
//const newProductPickerFlag = instance?.component?.attributes;
|
|
3914
3984
|
const checkAttribute = instance?.component?.attributes;
|
|
3915
3985
|
this.showNewProductPicker = this.commonService.checkIsAttributeTrue(checkAttribute, "newproductpicker");
|
|
3916
3986
|
this.showCategory = this.commonService.checkIsAttributeTrue(checkAttribute, "showCategory");
|