@wavemaker/app-ng-runtime 11.14.1-20.6468 → 11.14.1-21.64739

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.
Files changed (80) hide show
  1. package/components/base/bundles/index.umd.js +81 -17
  2. package/components/base/esm2022/pipes/custom-pipes.mjs +10 -10
  3. package/components/base/esm2022/utils/widget-utils.mjs +3 -3
  4. package/components/base/esm2022/widgets/common/base/base.component.mjs +61 -6
  5. package/components/base/esm2022/widgets/common/lazy-load/lazy-load.directive.mjs +7 -3
  6. package/components/base/esm2022/widgets/framework/property-change-handler.mjs +7 -2
  7. package/components/base/fesm2022/index.mjs +82 -18
  8. package/components/base/fesm2022/index.mjs.map +1 -1
  9. package/components/base/pipes/custom-pipes.d.ts +5 -5
  10. package/components/basic/label/bundles/index.umd.js +9 -1
  11. package/components/basic/label/esm2022/label.directive.mjs +10 -2
  12. package/components/basic/label/fesm2022/index.mjs +9 -1
  13. package/components/basic/label/fesm2022/index.mjs.map +1 -1
  14. package/components/chart/bundles/index.umd.js +2 -2
  15. package/components/chart/esm2022/chart.utils.mjs +3 -3
  16. package/components/chart/fesm2022/index.mjs +2 -2
  17. package/components/chart/fesm2022/index.mjs.map +1 -1
  18. package/components/containers/wizard/bundles/index.umd.js +21 -2
  19. package/components/containers/wizard/esm2022/wizard-step/wizard-step.component.mjs +3 -1
  20. package/components/containers/wizard/esm2022/wizard.component.mjs +20 -3
  21. package/components/containers/wizard/fesm2022/index.mjs +21 -2
  22. package/components/containers/wizard/fesm2022/index.mjs.map +1 -1
  23. package/components/containers/wizard/wizard-step/wizard-step.component.d.ts +2 -0
  24. package/components/data/pagination/bundles/index.umd.js +4 -0
  25. package/components/data/pagination/esm2022/pagination.component.mjs +5 -1
  26. package/components/data/pagination/fesm2022/index.mjs +4 -0
  27. package/components/data/pagination/fesm2022/index.mjs.map +1 -1
  28. package/components/data/table/bundles/index.umd.js +371 -15
  29. package/components/data/table/esm2022/table-action/table-action.directive.mjs +8 -1
  30. package/components/data/table/esm2022/table-column/table-column.directive.mjs +108 -4
  31. package/components/data/table/esm2022/table-column-group/table-column-group.directive.mjs +9 -1
  32. package/components/data/table/esm2022/table-cud.directive.mjs +8 -2
  33. package/components/data/table/esm2022/table-filter.directive.mjs +12 -2
  34. package/components/data/table/esm2022/table-row/table-row.directive.mjs +8 -1
  35. package/components/data/table/esm2022/table-row-action/table-row-action.directive.mjs +8 -1
  36. package/components/data/table/esm2022/table.component.mjs +219 -12
  37. package/components/data/table/fesm2022/index.mjs +372 -16
  38. package/components/data/table/fesm2022/index.mjs.map +1 -1
  39. package/components/data/table/table-action/table-action.directive.d.ts +3 -2
  40. package/components/data/table/table-column/table-column.directive.d.ts +3 -2
  41. package/components/data/table/table-column-group/table-column-group.directive.d.ts +3 -2
  42. package/components/data/table/table-cud.directive.d.ts +3 -1
  43. package/components/data/table/table-filter.directive.d.ts +3 -1
  44. package/components/data/table/table-row/table-row.directive.d.ts +3 -2
  45. package/components/data/table/table-row-action/table-row-action.directive.d.ts +3 -2
  46. package/components/data/table/table.component.d.ts +6 -2
  47. package/components/navigation/menu/bundles/index.umd.js +5 -0
  48. package/components/navigation/menu/esm2022/menu.component.mjs +6 -1
  49. package/components/navigation/menu/fesm2022/index.mjs +5 -0
  50. package/components/navigation/menu/fesm2022/index.mjs.map +1 -1
  51. package/components/navigation/popover/bundles/index.umd.js +6 -6
  52. package/components/navigation/popover/esm2022/popover.component.mjs +4 -4
  53. package/components/navigation/popover/fesm2022/index.mjs +3 -3
  54. package/components/navigation/popover/fesm2022/index.mjs.map +1 -1
  55. package/components/navigation/popover/popover.component.d.ts +6 -0
  56. package/core/bundles/index.umd.js +120 -15
  57. package/core/esm2022/public_api.mjs +2 -2
  58. package/core/esm2022/utils/utils.mjs +6 -2
  59. package/core/esm2022/utils/watcher.mjs +118 -15
  60. package/core/fesm2022/index.mjs +124 -15
  61. package/core/fesm2022/index.mjs.map +1 -1
  62. package/core/public_api.d.ts +1 -1
  63. package/core/utils/utils.d.ts +1 -0
  64. package/locales/moment-timezone/moment-timezone-with-data.js +5 -5
  65. package/npm-shrinkwrap.json +2 -2
  66. package/package-lock.json +2 -2
  67. package/package.json +1 -1
  68. package/runtime/base/bundles/index.umd.js +23 -14
  69. package/runtime/base/components/base-prefab.component.d.ts +6 -4
  70. package/runtime/base/esm2022/components/base-page.component.mjs +2 -1
  71. package/runtime/base/esm2022/components/base-partial.component.mjs +2 -2
  72. package/runtime/base/esm2022/components/base-prefab.component.mjs +20 -12
  73. package/runtime/base/esm2022/services/pipe-provider.service.mjs +4 -4
  74. package/runtime/base/fesm2022/index.mjs +23 -14
  75. package/runtime/base/fesm2022/index.mjs.map +1 -1
  76. package/runtime/dynamic/bundles/index.umd.js +4 -0
  77. package/runtime/dynamic/esm2022/app/app.config.mjs +6 -2
  78. package/runtime/dynamic/fesm2022/index.mjs +5 -1
  79. package/runtime/dynamic/fesm2022/index.mjs.map +1 -1
  80. package/scripts/datatable/datatable.js +104 -16
@@ -507,7 +507,22 @@ $.widget('wm.datatable', {
507
507
 
508
508
  /* function to get start index of the current active page */
509
509
  getPageStartIndex: function() {
510
- var currentPage = this.options.getCurrentPage(), pagesize = this.options.getPageSize();
510
+ // Guard against undefined getCurrentPage or getPageSize functions
511
+ var getCurrentPageFn = this.options.getCurrentPage;
512
+ var getPageSizeFn = this.options.getPageSize;
513
+ var currentPage, pagesize;
514
+ if (!getCurrentPageFn || typeof getCurrentPageFn !== 'function') {
515
+ // Default to page 1 if getCurrentPage is not available
516
+ currentPage = 1;
517
+ } else {
518
+ currentPage = getCurrentPageFn();
519
+ }
520
+ if (!getPageSizeFn || typeof getPageSizeFn !== 'function') {
521
+ // Default to 10 if getPageSize is not available
522
+ pagesize = 10;
523
+ } else {
524
+ pagesize = getPageSizeFn();
525
+ }
511
526
  var isPrevPageUpdated = this.options.actionRowPage < currentPage;
512
527
  var pageIndex = isPrevPageUpdated ? this.options.actionRowPage : currentPage;
513
528
  return ((pageIndex - 1) * pagesize);
@@ -568,6 +583,8 @@ $.widget('wm.datatable', {
568
583
  var self = this, preparedData,$tbody,pageStartIndex = self.getPageStartIndex(),
569
584
  startRowIndex = self.options.startRowIndex,
570
585
  isScrollorOnDemand = self.options.isNavTypeScrollOrOndemand();
586
+ var $activeRow = self.gridElement.find('tr.row-editing:not(.always-new-row)').first();
587
+ var index = $activeRow.index();
571
588
  if(isScrollorOnDemand) {
572
589
  $tbody = this.gridElement;
573
590
  if(this.renderTableOnViewLess) {
@@ -623,6 +640,16 @@ $.widget('wm.datatable', {
623
640
  this.options.setIsDataUpdatedByUser(false);
624
641
  this.options.clearActionRowIndex();
625
642
  }
643
+ if(this.options.editmode===this.CONSTANTS.QUICK_EDIT){
644
+ if (index>=0) {
645
+ const $newActiveRow = self.gridElement.find('tr').eq(index);
646
+ if ($newActiveRow && $newActiveRow.length) {
647
+ $newActiveRow.addClass('active');
648
+ $newActiveRow.trigger('click', [undefined, {action: 'edit', skipFocus:false}]);
649
+ self.setActiveRow($newActiveRow);
650
+ self.focusActiveRow();
651
+ }
652
+ }}
626
653
  return $tbody;
627
654
  },
628
655
 
@@ -1042,7 +1069,9 @@ $.widget('wm.datatable', {
1042
1069
  'value': '',
1043
1070
  'event': null
1044
1071
  },
1045
- compiledCellTemplates: {}
1072
+ compiledCellTemplates: {},
1073
+ // MEMORY LEAK FIX: Store bound function for proper event listener cleanup
1074
+ // boundRowClickHandlerOnCapture: null
1046
1075
  });
1047
1076
  // TODO: Variable loading status is getting updated before dataset update. This is resulting in loader going off before data is rendered.
1048
1077
  // Need to update code with suitable fix. For now 250ms is added as workaround
@@ -1264,7 +1293,9 @@ $.widget('wm.datatable', {
1264
1293
  this.element.find('.loading-data-msg').hide();
1265
1294
  this.element.find('.on-demand-load-btn').text(this.options.ondemandmessage);
1266
1295
  this.element.find('.on-demand-load-btn').show();
1267
- } else if((this.options.getCurrentPage() == this.options.getPageCount()) && this.options.showviewlessbutton) {
1296
+ } else if(this.options.getCurrentPage && typeof this.options.getCurrentPage === 'function' &&
1297
+ this.options.getPageCount && typeof this.options.getPageCount === 'function' &&
1298
+ (this.options.getCurrentPage() == this.options.getPageCount()) && this.options.showviewlessbutton) {
1268
1299
  this.element.find('.on-demand-load-btn').show().text(this.options.viewlessmessage);
1269
1300
  this.element.find('.loading-data-msg').hide();
1270
1301
  if(infScroll) {
@@ -1652,8 +1683,8 @@ $.widget('wm.datatable', {
1652
1683
  },
1653
1684
 
1654
1685
  /* Selects a row. */
1655
- selectRow: function (row, value) {
1656
- var rowIndex = _.isNumber(row) ? row : this.Utils.getObjectIndex(this.options.data, row),
1686
+ selectRow: function (row, value,index) {
1687
+ var rowIndex =index?index:( _.isNumber(row) ? row : this.Utils.getObjectIndex(this.options.data, row)),
1657
1688
  selector,
1658
1689
  $row;
1659
1690
  if (rowIndex !== -1) {
@@ -1982,7 +2013,7 @@ $.widget('wm.datatable', {
1982
2013
  if (!$firstEl.length) {
1983
2014
  $firstEl = $($el).first().find('select');
1984
2015
  }
1985
- if(!($(e.target).find('td').first().hasClass('td.cell-editing'))){
2016
+ if(!($(e?.target).find('td').first().hasClass('td.cell-editing'))){
1986
2017
  $firstEl=$el.find('td');
1987
2018
  }
1988
2019
  }
@@ -2078,10 +2109,11 @@ $.widget('wm.datatable', {
2078
2109
  });
2079
2110
 
2080
2111
  $editableElements = $row.find('td.cell-editing');
2081
- $editableElements.on('click', function (e) {
2112
+ // PERFORMANCE FIX: Use event delegation on row instead of individual cell listeners
2113
+ $row.on('click.cellEdit', 'td.cell-editing', function (e) {
2082
2114
  e.stopPropagation();
2083
2115
  });
2084
- $editableElements.on('keydown', function (e) {
2116
+ $row.on('keydown.cellEdit', 'td.cell-editing', function (e) {
2085
2117
  //To prevent up and down arrows, navigating to other rows in edit mode
2086
2118
  if ((e.which === 38 || e.which === 40) && (e.currentTarget && !e.currentTarget.closest('.always-new-row'))) {
2087
2119
  e.stopPropagation();
@@ -2150,7 +2182,8 @@ $.widget('wm.datatable', {
2150
2182
  $requiredEls,
2151
2183
  alwaysNewRow = $row.hasClass('always-new-row'),
2152
2184
  advancedEdit = self.options.editmode === self.CONSTANTS.QUICK_EDIT,
2153
- editOptions = {};
2185
+ editOptions = {},
2186
+ rowindex=$row.attr('data-row-id');
2154
2187
 
2155
2188
  // when a row is edited set actionrow variables
2156
2189
  this.options.setActionRowIndex($row.attr('data-row-id'));
@@ -2172,7 +2205,7 @@ $.widget('wm.datatable', {
2172
2205
  }
2173
2206
  //Select the current edited row
2174
2207
  if (options.selectRow) {
2175
- this.selectRow(rowData, true);
2208
+ this.selectRow(rowData, true,rowindex);
2176
2209
  }
2177
2210
  e = e || {};
2178
2211
  e.data = e.data || {};
@@ -2327,6 +2360,9 @@ $.widget('wm.datatable', {
2327
2360
  return;
2328
2361
  }
2329
2362
  }
2363
+ if(this.options?.getDataSource()?.category== "wm.Variable") {
2364
+ editOptions.rowindex = rowindex;
2365
+ }
2330
2366
  this.options.afterRowUpdate(rowData, e, onSaveSuccess, editOptions);
2331
2367
  }
2332
2368
  } else {
@@ -2363,6 +2399,8 @@ $.widget('wm.datatable', {
2363
2399
 
2364
2400
  this.disableActions(false);
2365
2401
  $row.removeClass('row-editing');
2402
+ // PERFORMANCE FIX: Remove namespaced event listeners from row
2403
+ $row.off('.cellEdit');
2366
2404
  $editableElements.off('click');
2367
2405
  $editableElements.each(function () {
2368
2406
  var $el = $(this),
@@ -2411,6 +2449,8 @@ $.widget('wm.datatable', {
2411
2449
  $saveButton = $row.find('.save-edit-row-button'),
2412
2450
  self = this;
2413
2451
  $row.removeClass('row-editing');
2452
+ // PERFORMANCE FIX: Remove namespaced event listeners from row
2453
+ $row.off('.cellEdit');
2414
2454
  $editableElements.off('click');
2415
2455
  this.disableActions(false);
2416
2456
  this._setGridEditMode(false);
@@ -2831,7 +2871,7 @@ $.widget('wm.datatable', {
2831
2871
  var $cell = $target.closest('td.app-datagrid-cell'),
2832
2872
  $editCells;
2833
2873
 
2834
- if ($cell.is(':last-child')) {
2874
+ if ($cell.is(':last-child') || $cell.nextAll('td.app-datagrid-cell:visible').length === 0) {
2835
2875
  return true;
2836
2876
  }
2837
2877
 
@@ -2859,8 +2899,17 @@ $.widget('wm.datatable', {
2859
2899
 
2860
2900
  if (this.options.enableRowSelection) {
2861
2901
  $htm[0].removeEventListener('click', this.rowClickHandlerOnCapture.bind(this));
2902
+ // MEMORY LEAK FIX: Remove old listener if exists before adding new one
2903
+ // if (this.boundRowClickHandlerOnCapture && $htm[0]) {
2904
+ // $htm[0].removeEventListener('click', this.boundRowClickHandlerOnCapture, true);
2905
+ // }
2862
2906
  $htm.off();
2863
2907
  $htm[0].addEventListener('click', this.rowClickHandlerOnCapture.bind(this));
2908
+
2909
+ // MEMORY LEAK FIX: Store bound function reference for proper removal
2910
+ // this.boundRowClickHandlerOnCapture = this.rowClickHandlerOnCapture.bind(this);
2911
+ // $htm[0].addEventListener('click', this.boundRowClickHandlerOnCapture, true);
2912
+
2864
2913
  // add js click handler for capture phase in order to first listen on grid and
2865
2914
  // assign selectedItems so that any child actions can have access to the selectedItems.
2866
2915
  $htm.on('click', this.rowSelectionHandler.bind(this));
@@ -2906,6 +2955,9 @@ $.widget('wm.datatable', {
2906
2955
  $htm.on('focus', 'tr.app-datagrid-row', function (e) {
2907
2956
  var $row = $(e.currentTarget);
2908
2957
  if (!$row.hasClass('row-editing')) {
2958
+ if(e.target===e.currentTarget && (e.which===0||!e.which)) {
2959
+ return;
2960
+ }
2909
2961
  self.toggleEditRow(e, { $row: $row, action: 'edit'});
2910
2962
  }
2911
2963
  });
@@ -2944,7 +2996,7 @@ $.widget('wm.datatable', {
2944
2996
  // triggered from the Row Actions
2945
2997
  if (!isTargetGridAction && !isTargetRowAction) {
2946
2998
  //Save the row on last column of the data table. Do not save the row if focus is out of input file.
2947
- if (!isLastColumn || (isLastColumn && e.relatedTarget === null) || $target.hasClass("file-upload")) {
2999
+ if (!isLastColumn || (isLastColumn && (e.relatedTarget === null || $(e.target).is('tr.app-datagrid-row'))) || $target.hasClass("file-upload")) {
2948
3000
  return;
2949
3001
  }
2950
3002
  }
@@ -3494,7 +3546,11 @@ $.widget('wm.datatable', {
3494
3546
  this.dataStatusContainer.hide();
3495
3547
  } else {
3496
3548
  // [WMS-23839] always show load more btn if show view less btn is true
3497
- if (this.options.isNavTypeScrollOrOndemand() && (state === 'nodata' || ((this.options.getCurrentPage() == this.options.getPageCount()) && !this.options.showviewlessbutton))) {
3549
+ if (this.options.isNavTypeScrollOrOndemand() &&
3550
+ (state === 'nodata' ||
3551
+ (this.options.getCurrentPage && typeof this.options.getCurrentPage === 'function' &&
3552
+ this.options.getPageCount && typeof this.options.getPageCount === 'function' &&
3553
+ (this.options.getCurrentPage() == this.options.getPageCount()) && !this.options.showviewlessbutton))) {
3498
3554
  this.element.find('.on-demand-datagrid a').hide();
3499
3555
  }
3500
3556
  this.dataStatusContainer.show();
@@ -3504,7 +3560,9 @@ $.widget('wm.datatable', {
3504
3560
  if (state === 'nodata') {
3505
3561
  this.dataStatusContainer.css('height', 'auto');
3506
3562
  this.dataStatus.contentHeight = 0;
3507
- } else if (this.options.isNavTypeScrollOrOndemand() && this.options.getCurrentPage() > 1){
3563
+ } else if (this.options.isNavTypeScrollOrOndemand() &&
3564
+ this.options.getCurrentPage && typeof this.options.getCurrentPage === 'function' &&
3565
+ this.options.getCurrentPage() > 1){
3508
3566
  // showing the loading icon only for the first page
3509
3567
  // from second page there is another loader which is being shown instead of LoadMore btn
3510
3568
  this.dataStatusContainer.hide();
@@ -3514,7 +3572,9 @@ $.widget('wm.datatable', {
3514
3572
  this.dataStatusContainer.css('height', this.dataStatus.height > this.dataStatus.contentHeight ? 'auto' : this.dataStatus.contentHeight);
3515
3573
  }
3516
3574
  }
3517
- if (!isScrollOrOndemand || (isScrollOrOndemand && this.options.getCurrentPage() === 1)) {
3575
+ if (!isScrollOrOndemand || (isScrollOrOndemand &&
3576
+ this.options.getCurrentPage && typeof this.options.getCurrentPage === 'function' &&
3577
+ this.options.getCurrentPage() === 1)) {
3518
3578
  this.gridContainer.addClass("show-msg");
3519
3579
  }
3520
3580
  } else {
@@ -3633,7 +3693,35 @@ $.widget('wm.datatable', {
3633
3693
  },
3634
3694
 
3635
3695
  _destroy: function () {
3696
+ // MEMORY LEAK FIX: Remove native event listener using stored bound function
3697
+ // if (this.gridElement && this.gridElement[0] && this.boundRowClickHandlerOnCapture) {
3698
+ // this.gridElement[0].removeEventListener('click', this.boundRowClickHandlerOnCapture, true);
3699
+ // this.boundRowClickHandlerOnCapture = null;
3700
+ // }
3701
+
3702
+ // MEMORY LEAK FIX: Remove all jQuery event handlers
3703
+ if (this.gridHeaderElement) {
3704
+ this.gridHeaderElement.off();
3705
+ }
3706
+ if (this.gridElement) {
3707
+ this.gridElement.off();
3708
+ }
3709
+ if (this.gridSearch) {
3710
+ this.gridSearch.off();
3711
+ }
3712
+ if (this.tableContainer) {
3713
+ this.tableContainer.off();
3714
+ }
3715
+ if (this.gridContainer) {
3716
+ this.gridContainer.off();
3717
+ }
3718
+
3719
+ // MEMORY LEAK FIX: Clear all internal structures
3720
+ this.preparedData = [];
3721
+ this.preparedHeaderData = [];
3722
+ this.compiledCellTemplates = {};
3723
+
3636
3724
  this.element.text('');
3637
3725
  window.clearTimeout(this.refreshGridTimeout);
3638
3726
  }
3639
- });
3727
+ });