ngx-render-material-forms 1.9.5 → 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.
- package/esm2020/lib/components/datagrid/datagrid.component.mjs +11 -6
- 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 +91 -23
- package/fesm2015/ngx-render-material-forms.mjs.map +1 -1
- package/fesm2020/ngx-render-material-forms.js +89 -23
- 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) {
|
|
@@ -3907,10 +3968,15 @@ class MaterialDataGridComponent extends MaterialNestedComponent {
|
|
|
3907
3968
|
}
|
|
3908
3969
|
return '';
|
|
3909
3970
|
}
|
|
3910
|
-
|
|
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");
|
|
@@ -4250,7 +4316,7 @@ MaterialDataGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.
|
|
|
4250
4316
|
|
|
4251
4317
|
</mat-card-content>
|
|
4252
4318
|
<mat-card-actions *ngIf="instance.hasAddButton() && instance.component.addAnotherPosition !== 'top'">
|
|
4253
|
-
<button class = "picker2new-btn" mat-raised-button color="primary" (click)="addAnother()" *ngIf="!(isCustomerCountryFiltered && emptyArray
|
|
4319
|
+
<button class = "picker2new-btn" mat-raised-button color="primary" (click)="addAnother()" *ngIf="!(isCustomerCountryFiltered && emptyArray && !showNewProductPicker)">
|
|
4254
4320
|
<mat-icon>add</mat-icon>
|
|
4255
4321
|
{{instance.component.addAnother || 'Add Another'}}
|
|
4256
4322
|
</button>
|
|
@@ -4392,7 +4458,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImpor
|
|
|
4392
4458
|
|
|
4393
4459
|
</mat-card-content>
|
|
4394
4460
|
<mat-card-actions *ngIf="instance.hasAddButton() && instance.component.addAnotherPosition !== 'top'">
|
|
4395
|
-
<button class = "picker2new-btn" mat-raised-button color="primary" (click)="addAnother()" *ngIf="!(isCustomerCountryFiltered && emptyArray
|
|
4461
|
+
<button class = "picker2new-btn" mat-raised-button color="primary" (click)="addAnother()" *ngIf="!(isCustomerCountryFiltered && emptyArray && !showNewProductPicker)">
|
|
4396
4462
|
<mat-icon>add</mat-icon>
|
|
4397
4463
|
{{instance.component.addAnother || 'Add Another'}}
|
|
4398
4464
|
</button>
|