mmhglobal-dynamicform 2.23.0 → 2.23.2

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.
@@ -2504,7 +2504,7 @@ class ZGridBindingDirective extends DataBindingDirective {
2504
2504
  }
2505
2505
  this.gridSetting = Object.assign(Object.assign({}, this.gridSetting), { columnField: data, group: this.zgridbinding.group, columnConfigurations: columnsConfig });
2506
2506
  ZComponentHelper.getGridColumns(this.gridSetting);
2507
- this.loggingService.logToConsoleForDebug('generated grid columns', this.gridSetting);
2507
+ this.loggingService.debugLog('generated grid columns', this.gridSetting);
2508
2508
  this.getFilterParamsColumns();
2509
2509
  this.getFilter();
2510
2510
  this.getFilterParams();
@@ -3118,10 +3118,20 @@ class ZGridBindingDirective extends DataBindingDirective {
3118
3118
  console.log("GridFilterConfiguration.OnChange triggered");
3119
3119
  // Use switchMap to handle the asynchronous operation
3120
3120
  of(this.params.filterParams).pipe(switchMap((filterParams) => {
3121
+ // Get the function expression from the configuration
3121
3122
  let expression = this.field.GridFilterConfiguration.OnChange;
3122
- expression = expression.replace('modalGroup.', 'group.');
3123
- expression = expression.replace('group.', 'grp.');
3124
- const func = eval('this.' + expression);
3123
+ // Replace 'modalGroup.' with 'group.' and 'group.' with 'grp.'
3124
+ expression = expression.replace(/modalGroup\./g, 'group.').replace(/group\./g, 'grp.');
3125
+ // Ensure the expression starts with 'this.' to avoid accessing global scope
3126
+ if (!expression.startsWith('this.')) {
3127
+ expression = `this.${expression}`;
3128
+ }
3129
+ const func = eval(expression);
3130
+ if (!func) {
3131
+ this.loggingService.log(`${expression} not found in this scope for ${this.field.Name} grid.`);
3132
+ // Since function not found, we return the original params.
3133
+ return of(this.params.filterParams);
3134
+ }
3125
3135
  const callFunc = func.bind(this.grp);
3126
3136
  return callFunc(filterParams);
3127
3137
  })).subscribe((updatedFilterParams) => {
@@ -3174,14 +3184,6 @@ class ZGridBindingDirective extends DataBindingDirective {
3174
3184
  getPageNo(stateSkip, stateTake) {
3175
3185
  return stateSkip / stateTake;
3176
3186
  }
3177
- beforeGridGetData(group, me) {
3178
- console.warn("beforeDataBinding triggered");
3179
- if (!group.beforeGridGetData) {
3180
- console.warn("group.beforeDataBinding is undefined");
3181
- return of(true);
3182
- }
3183
- return group.beforeGridGetData(group, me);
3184
- }
3185
3187
  // columnField = data: Array<ZField>,
3186
3188
  // columns = gridColumns: any[],
3187
3189
  // group = group: ZGroup,
@@ -3191,7 +3193,7 @@ class ZGridBindingDirective extends DataBindingDirective {
3191
3193
  setColumns(columns) {
3192
3194
  this.gridSetting.columnField = columns;
3193
3195
  ZComponentHelper.getGridColumns(this.gridSetting);
3194
- this.loggingService.logToConsoleForDebug('generated grid columns', this.gridSetting);
3196
+ this.loggingService.debugLog('generated grid columns', this.gridSetting);
3195
3197
  }
3196
3198
  }
3197
3199
  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 });
@@ -9584,14 +9586,6 @@ class ZgridComponent extends DataListingFieldBase {
9584
9586
  }
9585
9587
  //#endregion
9586
9588
  //#region Event
9587
- beforeGridGetData(group, me) {
9588
- console.warn("beforeDataBinding triggered");
9589
- if (!group.beforeGridGetData) {
9590
- console.warn("group.beforeDataBinding is undefined");
9591
- return of(true);
9592
- }
9593
- return group.beforeGridGetData(group, me);
9594
- }
9595
9589
  // Source: https://www.telerik.com/forums/kendo-angular-grid-blank-space-in-the-end-when-you-resize(reduce)-any-column
9596
9590
  adjustWidthUponResize() {
9597
9591
  const tableWidth = document.querySelector(".k-grid-table")[`offsetWidth`];