mmhglobal-dynamicform 2.23.0 → 2.23.1

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.
@@ -2491,7 +2491,7 @@ class ZGridBindingDirective extends DataBindingDirective {
2491
2491
  columnConfigurations: columnsConfig
2492
2492
  };
2493
2493
  ZComponentHelper.getGridColumns(this.gridSetting);
2494
- this.loggingService.logToConsoleForDebug('generated grid columns', this.gridSetting);
2494
+ this.loggingService.debugLog('generated grid columns', this.gridSetting);
2495
2495
  this.getFilterParamsColumns();
2496
2496
  this.getFilter();
2497
2497
  this.getFilterParams();
@@ -3095,10 +3095,20 @@ class ZGridBindingDirective extends DataBindingDirective {
3095
3095
  console.log("GridFilterConfiguration.OnChange triggered");
3096
3096
  // Use switchMap to handle the asynchronous operation
3097
3097
  of(this.params.filterParams).pipe(switchMap((filterParams) => {
3098
+ // Get the function expression from the configuration
3098
3099
  let expression = this.field.GridFilterConfiguration.OnChange;
3099
- expression = expression.replace('modalGroup.', 'group.');
3100
- expression = expression.replace('group.', 'grp.');
3101
- const func = eval('this.' + expression);
3100
+ // Replace 'modalGroup.' with 'group.' and 'group.' with 'grp.'
3101
+ expression = expression.replace(/modalGroup\./g, 'group.').replace(/group\./g, 'grp.');
3102
+ // Ensure the expression starts with 'this.' to avoid accessing global scope
3103
+ if (!expression.startsWith('this.')) {
3104
+ expression = `this.${expression}`;
3105
+ }
3106
+ const func = eval(expression);
3107
+ if (!func) {
3108
+ this.loggingService.log(`${expression} not found in this scope for ${this.field.Name} grid.`);
3109
+ // Since function not found, we return the original params.
3110
+ return of(this.params.filterParams);
3111
+ }
3102
3112
  const callFunc = func.bind(this.grp);
3103
3113
  return callFunc(filterParams);
3104
3114
  })).subscribe((updatedFilterParams) => {
@@ -3168,7 +3178,7 @@ class ZGridBindingDirective extends DataBindingDirective {
3168
3178
  setColumns(columns) {
3169
3179
  this.gridSetting.columnField = columns;
3170
3180
  ZComponentHelper.getGridColumns(this.gridSetting);
3171
- this.loggingService.logToConsoleForDebug('generated grid columns', this.gridSetting);
3181
+ this.loggingService.debugLog('generated grid columns', this.gridSetting);
3172
3182
  }
3173
3183
  }
3174
3184
  ZGridBindingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ZGridBindingDirective, deps: [{ token: GridComponent }, { token: i2.WebApiService }, { token: i2.ToastService }, { token: i2.OfflineDatabaseService }, { token: i2.SignalrService }, { token: ZGridService }, { token: i2.LoggingService }], target: i0.ɵɵFactoryTarget.Directive });