@wavemaker/app-ng-runtime 11.4.0-next.28152 → 11.4.0-rc.5339

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 (122) hide show
  1. app-ng-runtime/build-task/basic/tree/tree.build.d.ts +1 -2
  2. app-ng-runtime/build-task/bundles/index.umd.js +8 -10
  3. app-ng-runtime/build-task/bundles/index.umd.js.map +1 -1
  4. app-ng-runtime/build-task/esm2015/basic/tree/tree.build.js +3 -4
  5. app-ng-runtime/build-task/esm2015/data/form/form-field/form-field.build.js +2 -2
  6. app-ng-runtime/build-task/esm2015/navigation/popover/popover.build.js +3 -3
  7. app-ng-runtime/build-task/fesm2015/index.js +8 -10
  8. app-ng-runtime/build-task/fesm2015/index.js.map +1 -1
  9. app-ng-runtime/components/base/bundles/index.umd.js +29 -4
  10. app-ng-runtime/components/base/bundles/index.umd.js.map +1 -1
  11. app-ng-runtime/components/base/esm2015/public_api.js +2 -2
  12. app-ng-runtime/components/base/esm2015/utils/widget-utils.js +22 -4
  13. app-ng-runtime/components/base/esm2015/widgets/common/base/base-field-validations.js +3 -2
  14. app-ng-runtime/components/base/esm2015/widgets/common/dialog/dialog.service.js +7 -1
  15. app-ng-runtime/components/base/fesm2015/index.js +30 -6
  16. app-ng-runtime/components/base/fesm2015/index.js.map +1 -1
  17. app-ng-runtime/components/base/index.metadata.json +1 -1
  18. app-ng-runtime/components/base/public_api.d.ts +1 -1
  19. app-ng-runtime/components/base/utils/widget-utils.d.ts +8 -1
  20. app-ng-runtime/components/basic/tree/bundles/index.umd.js +280 -256
  21. app-ng-runtime/components/basic/tree/bundles/index.umd.js.map +1 -1
  22. app-ng-runtime/components/basic/tree/esm2015/public_api.js +2 -2
  23. app-ng-runtime/components/basic/tree/esm2015/tree.component.js +322 -0
  24. app-ng-runtime/components/basic/tree/esm2015/tree.module.js +3 -3
  25. app-ng-runtime/components/basic/tree/fesm2015/index.js +260 -248
  26. app-ng-runtime/components/basic/tree/fesm2015/index.js.map +1 -1
  27. app-ng-runtime/components/basic/tree/index.metadata.json +1 -1
  28. app-ng-runtime/components/basic/tree/public_api.d.ts +1 -1
  29. app-ng-runtime/components/basic/tree/tree.component.d.ts +34 -0
  30. app-ng-runtime/components/containers/tabs/bundles/index.umd.js +39 -23
  31. app-ng-runtime/components/containers/tabs/bundles/index.umd.js.map +1 -1
  32. app-ng-runtime/components/containers/tabs/esm2015/tab-pane/tab-pane.component.js +8 -1
  33. app-ng-runtime/components/containers/tabs/esm2015/tabs.animator.js +33 -13
  34. app-ng-runtime/components/containers/tabs/fesm2015/index.js +40 -13
  35. app-ng-runtime/components/containers/tabs/fesm2015/index.js.map +1 -1
  36. app-ng-runtime/components/containers/tabs/tabs.animator.d.ts +5 -1
  37. app-ng-runtime/components/data/form/bundles/index.umd.js +37 -13
  38. app-ng-runtime/components/data/form/bundles/index.umd.js.map +1 -1
  39. app-ng-runtime/components/data/form/esm2015/form-field/form-field.directive.js +26 -7
  40. app-ng-runtime/components/data/form/esm2015/form.component.js +10 -5
  41. app-ng-runtime/components/data/form/fesm2015/index.js +34 -10
  42. app-ng-runtime/components/data/form/fesm2015/index.js.map +1 -1
  43. app-ng-runtime/components/data/form/index.metadata.json +1 -1
  44. app-ng-runtime/components/data/list/bundles/index.umd.js +52 -43
  45. app-ng-runtime/components/data/list/bundles/index.umd.js.map +1 -1
  46. app-ng-runtime/components/data/list/esm2015/list.component.js +52 -43
  47. app-ng-runtime/components/data/list/fesm2015/index.js +51 -42
  48. app-ng-runtime/components/data/list/fesm2015/index.js.map +1 -1
  49. app-ng-runtime/components/data/list/index.metadata.json +1 -1
  50. app-ng-runtime/components/data/list/list.component.d.ts +1 -1
  51. app-ng-runtime/components/data/pagination/bundles/index.umd.js +22 -5
  52. app-ng-runtime/components/data/pagination/bundles/index.umd.js.map +1 -1
  53. app-ng-runtime/components/data/pagination/esm2015/pagination.component.js +23 -6
  54. app-ng-runtime/components/data/pagination/fesm2015/index.js +22 -5
  55. app-ng-runtime/components/data/pagination/fesm2015/index.js.map +1 -1
  56. app-ng-runtime/components/data/pagination/index.metadata.json +1 -1
  57. app-ng-runtime/components/data/pagination/pagination.component.d.ts +1 -0
  58. app-ng-runtime/components/data/table/bundles/index.umd.js +64 -12
  59. app-ng-runtime/components/data/table/bundles/index.umd.js.map +1 -1
  60. app-ng-runtime/components/data/table/esm2015/table.component.js +63 -13
  61. app-ng-runtime/components/data/table/esm2015/table.props.js +3 -1
  62. app-ng-runtime/components/data/table/fesm2015/index.js +64 -12
  63. app-ng-runtime/components/data/table/fesm2015/index.js.map +1 -1
  64. app-ng-runtime/components/data/table/index.metadata.json +1 -1
  65. app-ng-runtime/components/data/table/table.component.d.ts +9 -0
  66. app-ng-runtime/components/dialogs/default/base-dialog.d.ts +1 -0
  67. app-ng-runtime/components/dialogs/default/bundles/index.umd.js +17 -3
  68. app-ng-runtime/components/dialogs/default/bundles/index.umd.js.map +1 -1
  69. app-ng-runtime/components/dialogs/default/esm2015/base-dialog.js +18 -5
  70. app-ng-runtime/components/dialogs/default/fesm2015/index.js +17 -4
  71. app-ng-runtime/components/dialogs/default/fesm2015/index.js.map +1 -1
  72. app-ng-runtime/components/dialogs/default/index.metadata.json +1 -1
  73. app-ng-runtime/components/input/epoch/base-date-time.component.d.ts +1 -0
  74. app-ng-runtime/components/input/epoch/bundles/index.umd.js +78 -35
  75. app-ng-runtime/components/input/epoch/bundles/index.umd.js.map +1 -1
  76. app-ng-runtime/components/input/epoch/date-time/date-time-picker.component.d.ts +1 -0
  77. app-ng-runtime/components/input/epoch/esm2015/base-date-time.component.js +55 -31
  78. app-ng-runtime/components/input/epoch/esm2015/date/date.component.js +3 -3
  79. app-ng-runtime/components/input/epoch/esm2015/date-time/date-time-picker.component.js +31 -11
  80. app-ng-runtime/components/input/epoch/esm2015/date-time/date-time.component.js +2 -2
  81. app-ng-runtime/components/input/epoch/fesm2015/index.js +87 -43
  82. app-ng-runtime/components/input/epoch/fesm2015/index.js.map +1 -1
  83. app-ng-runtime/components/input/epoch/index.metadata.json +1 -1
  84. app-ng-runtime/components/navigation/menu/bundles/index.umd.js +25 -19
  85. app-ng-runtime/components/navigation/menu/bundles/index.umd.js.map +1 -1
  86. app-ng-runtime/components/navigation/menu/esm2015/menu-dropdown-item/menu-dropdown-item.component.js +15 -5
  87. app-ng-runtime/components/navigation/menu/esm2015/menu.component.js +14 -19
  88. app-ng-runtime/components/navigation/menu/fesm2015/index.js +25 -20
  89. app-ng-runtime/components/navigation/menu/fesm2015/index.js.map +1 -1
  90. app-ng-runtime/components/navigation/menu/index.metadata.json +1 -1
  91. app-ng-runtime/components/navigation/menu/menu-dropdown-item/menu-dropdown-item.component.d.ts +7 -4
  92. app-ng-runtime/components/navigation/menu/menu.component.d.ts +3 -7
  93. app-ng-runtime/components/navigation/popover/bundles/index.umd.js +3 -1
  94. app-ng-runtime/components/navigation/popover/bundles/index.umd.js.map +1 -1
  95. app-ng-runtime/components/navigation/popover/esm2015/popover.component.js +5 -3
  96. app-ng-runtime/components/navigation/popover/fesm2015/index.js +4 -2
  97. app-ng-runtime/components/navigation/popover/fesm2015/index.js.map +1 -1
  98. app-ng-runtime/core/bundles/index.umd.js +7 -1
  99. app-ng-runtime/core/bundles/index.umd.js.map +1 -1
  100. app-ng-runtime/core/esm2015/services/pagination.service.js +8 -2
  101. app-ng-runtime/core/fesm2015/index.js +7 -1
  102. app-ng-runtime/core/fesm2015/index.js.map +1 -1
  103. app-ng-runtime/mobile/components/page/default/bundles/index.umd.js +24 -6
  104. app-ng-runtime/mobile/components/page/default/bundles/index.umd.js.map +1 -1
  105. app-ng-runtime/mobile/components/page/default/esm2015/page.directive.js +20 -3
  106. app-ng-runtime/mobile/components/page/default/fesm2015/index.js +19 -2
  107. app-ng-runtime/mobile/components/page/default/fesm2015/index.js.map +1 -1
  108. app-ng-runtime/mobile/components/page/default/index.metadata.json +1 -1
  109. app-ng-runtime/mobile/components/page/default/page.directive.d.ts +4 -1
  110. app-ng-runtime/package.json +1 -1
  111. app-ng-runtime/scripts/datatable/datatable.js +86 -36
  112. app-ng-runtime/scripts/tree-keyboard-navigation/keyboard-navigation.js +251 -0
  113. app-ng-runtime/variables/bundles/index.umd.js +14 -4
  114. app-ng-runtime/variables/bundles/index.umd.js.map +1 -1
  115. app-ng-runtime/variables/esm2015/manager/action/notification-action.manager.js +5 -6
  116. app-ng-runtime/variables/esm2015/service/variables.service.js +8 -1
  117. app-ng-runtime/variables/fesm2015/index.js +11 -5
  118. app-ng-runtime/variables/fesm2015/index.js.map +1 -1
  119. app-ng-runtime/variables/index.metadata.json +1 -1
  120. app-ng-runtime/variables/service/variables.service.d.ts +4 -0
  121. app-ng-runtime/components/basic/tree/esm2015/tree.directive.js +0 -310
  122. app-ng-runtime/components/basic/tree/tree.directive.d.ts +0 -35
@@ -534,11 +534,18 @@ $.widget('wm.datatable', {
534
534
 
535
535
  /* Returns the tbody markup. */
536
536
  _getGridTemplate: function () {
537
+
537
538
  var self = this, preparedData,$tbody,pageStartIndex = self.getPageStartIndex(),
538
539
  startRowIndex = self.options.startRowIndex,
539
540
  isScrollorOnDemand = self.options.isNavTypeScrollOrOndemand();
540
541
  if(isScrollorOnDemand) {
541
542
  $tbody = this.gridElement;
543
+ if(this.renderTableOnViewLess) {
544
+ $tbody = this.gridElement.empty();
545
+ this.hideLoadingIndicator();
546
+ // this.addNavigationControls();
547
+ this.renderTableOnViewLess = false;
548
+ }
542
549
  } else {
543
550
  $tbody = this.gridElement.empty();
544
551
  }
@@ -976,7 +983,7 @@ $.widget('wm.datatable', {
976
983
  this._render(true);
977
984
  },
978
985
  _setGridEditMode: function (val) {
979
- if ($.isFunction(this.options.setGridEditMode)) {
986
+ if (_.isFunction(this.options.setGridEditMode)) {
980
987
  this.options.setGridEditMode(val);
981
988
  }
982
989
  },
@@ -1034,7 +1041,7 @@ $.widget('wm.datatable', {
1034
1041
  $gridBody,
1035
1042
  $alwaysNewRow;
1036
1043
 
1037
- if (!alwaysNewRow && $.isFunction(this.options.beforeRowInsert)) {
1044
+ if (!alwaysNewRow && _.isFunction(this.options.beforeRowInsert)) {
1038
1045
  this.options.beforeRowInsert();
1039
1046
  }
1040
1047
 
@@ -1101,25 +1108,52 @@ $.widget('wm.datatable', {
1101
1108
  },
1102
1109
 
1103
1110
  /* Inserts a load more button at the end of the table when the pagination selected is on demand */
1104
- addLoadMoreBtn : function (onDemandMsg, loadingdatamsg, cb) {
1111
+ addLoadMoreBtn : function (onDemandMsg, loadingdatamsg, cb, infScroll) {
1105
1112
  // Show Load more button only if it not the last page
1106
- if (!this.options.isLastPage) {
1113
+ var $btnEl;
1114
+ if (!this.options.isLastPage || infScroll) {
1107
1115
  var self = this;
1108
1116
  var $parenEl = $('<div class="on-demand-datagrid"><a class="app-button btn btn-block on-demand-load-btn"></a></div>');
1109
- var $btnEl = $parenEl.find('a');
1117
+ $btnEl = $parenEl.find('a');
1110
1118
  $btnEl.append(onDemandMsg);
1111
1119
  // Adding load more button in case of on demand pagination
1112
1120
  this.element.find('.app-grid-header-inner').append($parenEl);
1121
+ if(infScroll) {
1122
+ if(this.element.find('.on-demand-load-btn').length) {
1123
+ this.element.find('.on-demand-load-btn').text(this.options.viewlessmessage);
1124
+ }
1125
+ }
1126
+
1113
1127
  // Adding click event to the button
1114
1128
  $btnEl.on('click', function (e) {
1115
- if (cb && typeof cb === 'function') {
1116
- // when the button is clicked, hide the button and show loading indicator
1117
- $btnEl.hide();
1129
+ // when the button is clicked, hide the button and show loading indicator
1130
+ var lastPage = (self.options.getCurrentPage() == self.options.getPageCount());
1131
+ if(!lastPage) {
1118
1132
  self.showLoadingIndicator(loadingdatamsg, false);
1133
+ }
1134
+ if(!self.options.showviewlessbutton){
1135
+ $btnEl.hide();
1136
+ }
1137
+ if(infScroll) {
1138
+ if(lastPage) {
1139
+ self.element.find('.on-demand-datagrid').remove();
1140
+ }
1141
+ }
1142
+ // Fix for [WMS-23839] refresh data when clicked on View less button
1143
+ if (lastPage && self.options.showviewlessbutton) {
1144
+ $btnEl.hide();
1145
+ self.renderTableOnViewLess = true;
1146
+ self.renderPaginationOnViewLess = true;
1147
+ self.options.enableNavigation();
1148
+ self._renderGrid();
1149
+ }
1150
+ if (cb && typeof cb === 'function') {
1119
1151
  cb(e);
1120
1152
  }
1153
+
1121
1154
  });
1122
1155
  }
1156
+
1123
1157
  },
1124
1158
 
1125
1159
  /* Shows loading indicator when clicked on load more button or in case of infinite scroll event is triggered */
@@ -1152,10 +1186,19 @@ $.widget('wm.datatable', {
1152
1186
  if (!showLoadBtn && !infScroll) {
1153
1187
  // In case of on demand pagination, when the next page is not disabled hide the individual elements
1154
1188
  this.element.find('.loading-data-msg').hide();
1189
+ this.element.find('.on-demand-load-btn').text(this.options.ondemandmessage);
1155
1190
  this.element.find('.on-demand-load-btn').show();
1191
+ } else if((this.options.getCurrentPage() == this.options.getPageCount()) && this.options.showviewlessbutton) {
1192
+ this.element.find('.on-demand-load-btn').show().text(this.options.viewlessmessage);
1193
+ this.element.find('.loading-data-msg').hide();
1194
+ if(infScroll) {
1195
+ if(!this.element.find('.on-demand-load-btn').length) {
1196
+ this.options.addLoadMoreBtn();
1197
+ }
1198
+ this.element.find('.loading-data-msg').hide();
1199
+ }
1156
1200
  } else {
1157
- // In case of infinite scroll or when next page is disable hide the grid element which is the parent. If we don't the parent ele border will be shown
1158
- this.element.find('.on-demand-datagrid').hide();
1201
+ this.element.find('.on-demand-datagrid').hide();
1159
1202
  }
1160
1203
  },
1161
1204
 
@@ -1637,10 +1680,10 @@ $.widget('wm.datatable', {
1637
1680
  isQuickEdit = this.options.editmode === this.CONSTANTS.QUICK_EDIT;
1638
1681
 
1639
1682
  function callRowSelectionEvents() {
1640
- if (selected && $.isFunction(self.options.onRowSelect)) {
1683
+ if (selected && _.isFunction(self.options.onRowSelect)) {
1641
1684
  self.options.onRowSelect(data, e);
1642
1685
  }
1643
- if (!selected && $.isFunction(self.options.onRowDeselect)) {
1686
+ if (!selected && _.isFunction(self.options.onRowDeselect)) {
1644
1687
  self.options.onRowDeselect(data, e);
1645
1688
  }
1646
1689
  }
@@ -1685,7 +1728,7 @@ $.widget('wm.datatable', {
1685
1728
  if (!rowData) {
1686
1729
  return;
1687
1730
  }
1688
- if ($.isFunction(this.options.onRowDblClick)) {
1731
+ if (_.isFunction(this.options.onRowDblClick)) {
1689
1732
  this.options.onRowDblClick(rowData, e);
1690
1733
  }
1691
1734
  },
@@ -1727,13 +1770,13 @@ $.widget('wm.datatable', {
1727
1770
  if (selected) {
1728
1771
  $column.addClass(selectedClass);
1729
1772
  $th.addClass(selectedClass);
1730
- if ($.isFunction(this.options.onColumnSelect) && e) {
1773
+ if (_.isFunction(this.options.onColumnSelect) && e) {
1731
1774
  this.options.onColumnSelect(colInfo, e);
1732
1775
  }
1733
1776
  } else {
1734
1777
  $column.removeClass(selectedClass);
1735
1778
  $th.removeClass(selectedClass);
1736
- if ($.isFunction(this.options.onColumnDeselect) && e) {
1779
+ if (_.isFunction(this.options.onColumnDeselect) && e) {
1737
1780
  this.options.onColumnDeselect(colInfo, e);
1738
1781
  }
1739
1782
  }
@@ -1986,7 +2029,7 @@ $.widget('wm.datatable', {
1986
2029
 
1987
2030
  //On success of update or delete
1988
2031
  function onSaveSuccess(skipFocus, error) {
1989
- if ($.isFunction(options.success)) {
2032
+ if (_.isFunction(options.success)) {
1990
2033
  options.success(skipFocus, error);
1991
2034
  }
1992
2035
  if (!advancedEdit || self.options.actionsEnabled.edit) {
@@ -2017,7 +2060,7 @@ $.widget('wm.datatable', {
2017
2060
  return;
2018
2061
  }
2019
2062
  $row.addClass('row-editing');
2020
- if ($.isFunction(this.options.beforeRowUpdate)) {
2063
+ if (_.isFunction(this.options.beforeRowUpdate)) {
2021
2064
  this.options.beforeRowUpdate(rowData, e);
2022
2065
  }
2023
2066
 
@@ -2030,7 +2073,7 @@ $.widget('wm.datatable', {
2030
2073
  self.toggleNewRowActions(true);
2031
2074
  }
2032
2075
  //Event for on before form render. User can update row data here.
2033
- if ($.isFunction(this.options.onBeforeFormRender)) {
2076
+ if (_.isFunction(this.options.onBeforeFormRender)) {
2034
2077
  isValid = this.options.onBeforeFormRender(rowData, e, options.operation || action);
2035
2078
  if (isValid === false) {
2036
2079
  return;
@@ -2053,7 +2096,7 @@ $.widget('wm.datatable', {
2053
2096
  });
2054
2097
  }
2055
2098
  //Event for on before form render. User can access form widgets here.
2056
- if ($.isFunction(this.options.onFormRender)) {
2099
+ if (_.isFunction(this.options.onFormRender)) {
2057
2100
  this.options.onFormRender($row, e, options.operation || action, $row.hasClass('always-new-row'));
2058
2101
  }
2059
2102
  } else {
@@ -2117,7 +2160,7 @@ $.widget('wm.datatable', {
2117
2160
  }
2118
2161
  self.options.setTouched($invalidTd.find('[formcontrolname]').attr('formcontrolname'));
2119
2162
  });
2120
- if ($.isFunction(options.success)) {
2163
+ if (_.isFunction(options.success)) {
2121
2164
  options.success(false, true);
2122
2165
  }
2123
2166
  return;
@@ -2125,14 +2168,14 @@ $.widget('wm.datatable', {
2125
2168
 
2126
2169
  if (isNewRow && advancedEdit && _.isEmpty(rowData)) {
2127
2170
  self.removeNewRow($row);
2128
- if ($.isFunction(options.success)) {
2171
+ if (_.isFunction(options.success)) {
2129
2172
  options.success(false, undefined, true);
2130
2173
  }
2131
2174
  return;
2132
2175
  }
2133
2176
 
2134
2177
  if (isNewRow) {
2135
- if ($.isFunction(this.options.onBeforeRowInsert)) {
2178
+ if (_.isFunction(this.options.onBeforeRowInsert)) {
2136
2179
  isValid = this.options.onBeforeRowInsert(rowData, e, editOptions);
2137
2180
  if (isValid === false) {
2138
2181
  return;
@@ -2149,7 +2192,7 @@ $.widget('wm.datatable', {
2149
2192
  self.removeNewRow($row);
2150
2193
  }
2151
2194
  } else {
2152
- if ($.isFunction(this.options.onBeforeRowUpdate)) {
2195
+ if (_.isFunction(this.options.onBeforeRowUpdate)) {
2153
2196
  isValid = this.options.onBeforeRowUpdate(rowData, e, editOptions);
2154
2197
  if (isValid === false) {
2155
2198
  return;
@@ -2162,7 +2205,7 @@ $.widget('wm.datatable', {
2162
2205
  if (!options.noMsg) {
2163
2206
  this.options.noChangesDetected();
2164
2207
  }
2165
- if ($.isFunction(options.success)) {
2208
+ if (_.isFunction(options.success)) {
2166
2209
  options.success(false);
2167
2210
  }
2168
2211
  }
@@ -2272,7 +2315,7 @@ $.widget('wm.datatable', {
2272
2315
  this.options.setActionRowIndex(rowId);
2273
2316
  this.options.setLastActionPerformed(this.options.ACTIONS.DELETE);
2274
2317
 
2275
- if ($.isFunction(this.options.beforeRowDelete)) {
2318
+ if (_.isFunction(this.options.beforeRowDelete)) {
2276
2319
  this.options.beforeRowDelete(rowData, e);
2277
2320
  }
2278
2321
  if (isNewRow) {
@@ -2288,13 +2331,13 @@ $.widget('wm.datatable', {
2288
2331
  return;
2289
2332
  }
2290
2333
  /* calling onbeforerowDelete callback function.*/
2291
- if($.isFunction(this.options.onBeforeRowDelete)) {
2334
+ if(_.isFunction(this.options.onBeforeRowDelete)) {
2292
2335
  isValid = this.options.onBeforeRowDelete(rowData, e, options);
2293
2336
  if (isValid === false) {
2294
2337
  return;
2295
2338
  }
2296
2339
  }
2297
- if ($.isFunction(this.options.onRowDelete)) {
2340
+ if (_.isFunction(this.options.onRowDelete)) {
2298
2341
  className = this.options.cssClassNames.deleteRow;
2299
2342
  isActiveRow = $row.attr('class').indexOf('active') !== -1;
2300
2343
  if (isActiveRow) {
@@ -2939,10 +2982,10 @@ $.widget('wm.datatable', {
2939
2982
  // If we enable multiselect and check header checkbox then updating selecteditem in datatable.
2940
2983
  self.options.assignSelectedItems(rowData, e);
2941
2984
  self.toggleRowSelection($row, checked, e, true);
2942
- if (checked && $.isFunction(self.options.onRowSelect)) {
2985
+ if (checked && _.isFunction(self.options.onRowSelect)) {
2943
2986
  self.options.onRowSelect(rowData, e);
2944
2987
  }
2945
- if (!checked && $.isFunction(self.options.onRowDeselect)) {
2988
+ if (!checked && _.isFunction(self.options.onRowDeselect)) {
2946
2989
  self.options.onRowDeselect(rowData, e);
2947
2990
  }
2948
2991
  });
@@ -2977,7 +3020,7 @@ $.widget('wm.datatable', {
2977
3020
  /**Add event handler, to the select all checkbox on the header**/
2978
3021
  $header.on('click', '.app-datagrid-header-cell input:checkbox', toggleSelectAll);
2979
3022
 
2980
- if ($.isFunction(this.options.onHeaderClick)) {
3023
+ if (_.isFunction(this.options.onHeaderClick)) {
2981
3024
  this.gridHeaderElement.find('th.app-datagrid-header-cell').on('click', this.headerClickHandler.bind(this));
2982
3025
  }
2983
3026
 
@@ -3085,6 +3128,7 @@ $.widget('wm.datatable', {
3085
3128
  // initally append tbody to gridElement
3086
3129
  this.gridElement.append($htm);
3087
3130
  }
3131
+
3088
3132
  } else {
3089
3133
  var templates = this._getGridTemplate();
3090
3134
  $htm = $(templates);
@@ -3096,7 +3140,9 @@ $.widget('wm.datatable', {
3096
3140
  if (this.options.summaryRow) {
3097
3141
  var $summaryRowHtm = $(this._getSummaryRowTemplate());
3098
3142
  this.tableContainer.find('tfoot').remove();
3099
- this.tableContainer.append($summaryRowHtm);
3143
+ if (this.options.data.length){
3144
+ this.tableContainer.append($summaryRowHtm);
3145
+ }
3100
3146
  }
3101
3147
  // Set proper data status messages after the grid is rendered.
3102
3148
  if (!this.options.data.length && this.dataStatus.state === 'nodata') {
@@ -3107,7 +3153,7 @@ $.widget('wm.datatable', {
3107
3153
  this.setStatus(this.dataStatus.state, this.dataStatus.message, isCreated);
3108
3154
  }
3109
3155
  this.gridBody = this.gridElement.find('tbody');
3110
- this.gridFooter = this.gridElement.find('tfoot');
3156
+ this.gridFooter = this.tableContainer.find('tfoot');
3111
3157
  this._findAndReplaceCompiledTemplates();
3112
3158
  this.options.clearRowActions();
3113
3159
  // attach event handlers
@@ -3122,7 +3168,7 @@ $.widget('wm.datatable', {
3122
3168
  if (isCreated) {
3123
3169
  this._setColSpan(this.options.headerConfig);
3124
3170
  }
3125
- if ($.isFunction(this.options.onDataRender)) {
3171
+ if (_.isFunction(this.options.onDataRender)) {
3126
3172
  this.options.onDataRender();
3127
3173
  }
3128
3174
  if (!isCreated && this.options.selectFirstRow) {
@@ -3195,13 +3241,16 @@ $.widget('wm.datatable', {
3195
3241
  this._toggleSpacingClasses('condensed');
3196
3242
  }
3197
3243
  this._renderGrid(isCreated);
3244
+ this.addNavigationControls();
3245
+ },
3246
+ addNavigationControls: function() {
3198
3247
  /**
3199
3248
  * bind on demand / scroll events to the table in case of dynamictable in render fn
3200
3249
  * Render is called everytime when there is a change in dataset and the previously binded events are lost
3201
3250
  */
3202
3251
  if (this.options.isdynamictable) {
3203
- this.element.find('.on-demand-datagrid').remove();
3204
- if (this.options.navigation === 'On-Demand' && !this.element.find('.on-demand-datagrid').length) {
3252
+ this.element.find('.on-demand-datagrid').remove();
3253
+ if (this.options.navigation === 'On-Demand' && (!this.element.find('.on-demand-datagrid').length)) {
3205
3254
  this.options.addLoadMoreBtn();
3206
3255
  } else if (this.options.navigation === 'Scroll') {
3207
3256
  this.options.bindScrollEvt();
@@ -3221,7 +3270,8 @@ $.widget('wm.datatable', {
3221
3270
  if (state === 'ready') {
3222
3271
  this.dataStatusContainer.hide();
3223
3272
  } else {
3224
- if (this.options.isNavTypeScrollOrOndemand() && (state === 'nodata' || this.options.isLastPage)) {
3273
+ // [WMS-23839] always show load more btn if show view less btn is true
3274
+ if (this.options.isNavTypeScrollOrOndemand() && (state === 'nodata' || ((this.options.getCurrentPage() == this.options.getPageCount()) && !this.options.showviewlessbutton))) {
3225
3275
  this.element.find('.on-demand-datagrid a').hide();
3226
3276
  }
3227
3277
  this.dataStatusContainer.show();
@@ -0,0 +1,251 @@
1
+ (function ($) {
2
+ /**
3
+ * Dummy function to provide a placeholder for the destroy function
4
+ */
5
+ $.fn.zTreeKeyboardNavigationDestroy = function () {
6
+ }
7
+
8
+ /**
9
+ * Creates a function that adds keyboard navigation:
10
+ * Home: home key (keycode 36) Goes to the first root element is visible
11
+ * End: end key (keycode 35) Goes to the last leaf node and will expand nodes and scroll the element into view
12
+ * Down: right cursor key (keycode 39) Goes to the next visible node in the tree following the hierarchy
13
+ * Next: down cursor key (keycode 40) Goes to the next visible node at the same level
14
+ * Up: up cursor key (keycode 37) Goes to the prior visible node at the same level
15
+ * Previous: left cursor key (keycode 38) Goes to the prior visible node following the hierarchy
16
+ * Toggle: space key (keycode 32) Toggles the expand/collapse state of a parent node
17
+ * @param {IxTreeObj} zTree
18
+ * @param {string|JQuery<HTMLElement} element
19
+ * @param {IJSON[]} selectedNodes
20
+ */
21
+ $.fn.zTreeKeyboardNavigation = function (zTree, element, selectedNodes = null, treeicon) {
22
+ if (typeof element === 'string' || element instanceof String) {
23
+ element = $(element);
24
+ }
25
+
26
+ var rootNodes = zTree.getNodes();
27
+ if (!rootNodes) return;
28
+
29
+ var focusSelectedNode = function () {
30
+ if ((selectedNodes = zTree.getSelectedNodes()) && selectedNodes.length) {
31
+ $("#" + selectedNodes[0].tId).focus();
32
+ }
33
+ }
34
+
35
+ // Clear the previous event handler (there may be none)
36
+ $.fn.zTreeKeyboardNavigationDestroy();
37
+
38
+ /**
39
+ * Make it possible to destroy (remove the event handlers)
40
+ */
41
+ $.fn.zTreeKeyboardNavigationDestroy = function () {
42
+ $(element).off('keydown');
43
+ }
44
+
45
+ $.fn.changeTreeIcons = function () {
46
+ let eleClose = $('.app-tree li span.button.switch');
47
+
48
+ $(eleClose).map((idx, ele) => {
49
+ $(ele).addClass(treeicon);
50
+ $(ele).on("click", function (e) {
51
+ setTimeout(() => {
52
+ $(ele).addClass(treeicon);
53
+ }, 0);
54
+ });
55
+ })
56
+ }
57
+
58
+
59
+ $(element).on('keydown', function (e) {
60
+ var selectedNodes = zTree.getSelectedNodes();
61
+ var selectedNode = selectedNodes.length ? selectedNodes[0] : null;
62
+
63
+ var processSpace = function () {
64
+ // If there are no nodes or the selected node is not a parent, get out
65
+ if (selectedNode && selectedNode.isParent) {
66
+ // Toggle the node
67
+ zTree.expandNode(selectedNode, selectedNode.open ? false : true, true, true);
68
+ $.fn.changeTreeIcons()
69
+ }
70
+ }
71
+
72
+ var processHome = function () {
73
+ zTree.selectNode(rootNodes[0], false, true);
74
+ }
75
+
76
+ var processEnd = function () {
77
+ var nodes = zTree.transformToArray(rootNodes);
78
+ // Select the last node
79
+ zTree.selectNode(nodes[nodes.length - 1]);
80
+ }
81
+
82
+ var processUp = function () {
83
+ var priorNode;
84
+ if (selectedNode) {
85
+ priorNode = selectedNode.getPreNode();
86
+ if (!priorNode) return;
87
+ }
88
+ else {
89
+ processEnd();
90
+ }
91
+
92
+ if (!priorNode) return;
93
+
94
+ zTree.selectNode(priorNode);
95
+ }
96
+
97
+ var processDown = function () {
98
+ var nextNode;
99
+ if (selectedNode) {
100
+ nextNode = selectedNode.getNextNode();
101
+ if (!nextNode) return;
102
+ }
103
+ else {
104
+ processHome();
105
+ }
106
+
107
+ if (!nextNode) return;
108
+
109
+ zTree.selectNode(nextNode);
110
+ }
111
+
112
+ var processOut = function () {
113
+ if (!selectedNode) return;
114
+
115
+ var parentNode = selectedNode.getParentNode();
116
+ var priorNode = selectedNode.getPreNode();
117
+ if (!parentNode && !priorNode) return; // Must have been the root node
118
+
119
+ if (priorNode) {
120
+ if (priorNode.isParent) {
121
+ // There is a prior node, now the the question is where is the last open node?
122
+ while (priorNode) {
123
+ if (!priorNode.isParent || !priorNode.open || !priorNode.children) break;
124
+
125
+ priorNode = priorNode.children[priorNode.children.length - 1];
126
+ }
127
+
128
+ zTree.selectNode(priorNode);
129
+ return;
130
+ }
131
+ else {
132
+ zTree.selectNode(priorNode);
133
+ return;
134
+ }
135
+ }
136
+
137
+ // Find the parent node with a valid prior sibling
138
+ if (parentNode) {
139
+ // This call should be silent otherwise (in my view a bug in)
140
+ // selectNode causes the root node to blur
141
+ zTree.selectNode(parentNode, false, true);
142
+ }
143
+ }
144
+
145
+ var processIn = function () {
146
+ if (!selectedNode) return;
147
+
148
+ if (selectedNode.isParent && selectedNode.open && selectedNode.children) {
149
+ zTree.selectNode(selectedNode.children[0]);
150
+ return;
151
+ }
152
+
153
+ var nextNode = selectedNode.getNextNode();
154
+ if (nextNode) {
155
+ zTree.selectNode(nextNode);
156
+ }
157
+ else {
158
+ // Cannot be root if there is a selected node that is not a parent
159
+ var node = selectedNode;
160
+ // Find the parent node with a valid next sibling
161
+ while (node = node.getParentNode()) {
162
+ var nextNode = node.getNextNode();
163
+ if (nextNode) {
164
+ zTree.selectNode(nextNode);
165
+ break;
166
+ }
167
+ }
168
+ }
169
+ }
170
+
171
+ var processLetter = function (keyCode) {
172
+ if (!Array.from({ length: 26 }, (v, i) => i + 65).includes(keyCode & 95)) return false;
173
+
174
+ var nodes = zTree.transformToArray(rootNodes);
175
+ nodes = nodes.filter(node => {
176
+ return 'accesskey' in node && node.accesskey.length && (node.accesskey.charCodeAt(0) & 95) == keyCode;
177
+ });
178
+
179
+ if (!nodes.length) return false;
180
+
181
+ var selectedNodes = zTree.getSelectedNodes();
182
+ if (!selectedNodes.length) return false;
183
+
184
+ if (selectedNodes[0] == nodes[0]) return false;
185
+
186
+ zTree.selectNode(nodes[0]);
187
+
188
+ return true;
189
+ }
190
+
191
+ // console.log('before');
192
+ // console.log(document.activeElement);
193
+
194
+ switch (e.keyCode) {
195
+ case 32: /* Toggle parent nodes */
196
+ processSpace();
197
+ return;
198
+
199
+ case 36: /* Home - go to the root node */
200
+ processHome();
201
+ break;
202
+
203
+ case 35: /* End - go to the last node */
204
+ processEnd();
205
+ break;
206
+
207
+ case 33: /* PageUp */
208
+ // Do nothing
209
+ break;
210
+
211
+ case 34: /* PageDown */
212
+ // Do nothing
213
+ break;
214
+
215
+ case 37: /* Left */
216
+ processOut();
217
+ break;
218
+
219
+ case 38: /* Up */
220
+ processUp();
221
+ break;
222
+
223
+ case 39: /* Right */
224
+ processIn();
225
+ break;
226
+
227
+ case 40: /* Down */
228
+ processDown();
229
+ break;
230
+
231
+ default:
232
+ if (!processLetter(e.keyCode & 95)) return;
233
+ break;
234
+ }
235
+
236
+ // console.log('after');
237
+ // console.log(document.activeElement);
238
+ focusSelectedNode();
239
+ });
240
+
241
+ if (selectedNodes && selectedNodes.length) {
242
+ zTree.selectNode(selectedNodes[0]);
243
+ focusSelectedNode();
244
+ }
245
+ else {
246
+ $(element).trigger({ type: 'keydown', which: 36, keyCode: 36 });
247
+ }
248
+
249
+ }
250
+
251
+ })(jQuery);
@@ -1564,9 +1564,9 @@
1564
1564
  }
1565
1565
  };
1566
1566
  NotificationActionManager.prototype.notifyViaDialog = function (variable, options) {
1567
- var commonPageDialogId = 'Common' + _.capitalize(variable.operation) + 'Dialog', variableOwner = variable.owner, dialogId = (variableOwner === VARIABLE_CONSTANTS.OWNER.APP) ? commonPageDialogId : 'notification' + variable.operation + 'dialog';
1567
+ var commonPageDialogId = 'Common' + _.capitalize(variable.operation) + 'Dialog', dialogId = commonPageDialogId;
1568
1568
  var closeCallBackFn = function () { return initiateCallback('onOk', variable, options.data); };
1569
- exports.dialogService.open(dialogId, variable._context, {
1569
+ exports.dialogService.open(dialogId, undefined, {
1570
1570
  notification: {
1571
1571
  'title': options.title || variable.dataBinding.title,
1572
1572
  'text': options.message || variable.dataBinding.text,
@@ -1575,12 +1575,12 @@
1575
1575
  'alerttype': options.alerttype || variable.dataBinding.alerttype || 'information',
1576
1576
  onOk: function () {
1577
1577
  // Close the action dialog after triggering onOk callback event
1578
- exports.dialogService.close(dialogId, variable._context, closeCallBackFn);
1578
+ exports.dialogService.close(dialogId, undefined, closeCallBackFn);
1579
1579
  },
1580
1580
  onCancel: function () {
1581
1581
  initiateCallback('onCancel', variable, options.data);
1582
1582
  // Close the action dialog after triggering onCancel callback event
1583
- exports.dialogService.close(dialogId, variable._context);
1583
+ exports.dialogService.close(dialogId, undefined);
1584
1584
  },
1585
1585
  onClose: function () {
1586
1586
  initiateCallback('onClose', variable, options.data);
@@ -3486,6 +3486,14 @@
3486
3486
  { type: core.AbstractHttpService }
3487
3487
  ]; };
3488
3488
 
3489
+ var Formatter = /** @class */ (function () {
3490
+ function Formatter() {
3491
+ }
3492
+ Formatter.prototype.format = function (value, format) {
3493
+ return exports.appManager.getPipe('date').transform(value, format);
3494
+ };
3495
+ return Formatter;
3496
+ }());
3489
3497
  var VariablesService = /** @class */ (function () {
3490
3498
  function VariablesService(httpService, metadataService, navigationService, routerService, toasterService, oAuthService, securityService, dialogService) {
3491
3499
  this.httpService = httpService;
@@ -3611,6 +3619,7 @@
3611
3619
  if (this.isVariableSeperated(variablesJson, variableName)) {
3612
3620
  this.processBinding(varInstance, scope, 'dataBinding', this.getBindSourceTarget(varInstance));
3613
3621
  varInstance.httpService = this.httpService;
3622
+ varInstance.dateFormatter = new Formatter();
3614
3623
  varInstance.subscribe('afterInvoke', function () { return core.$invokeWatchers(true); });
3615
3624
  if (varInstance.category === 'wm.LiveVariable' && varInstance.operation === 'read') {
3616
3625
  core.processFilterExpBindNode(varInstance._context, varInstance.filterExpressions, varInstance);
@@ -3705,6 +3714,7 @@
3705
3714
  exports.DB_CONSTANTS = DB_CONSTANTS;
3706
3715
  exports.DeviceVariableManager = DeviceVariableManager;
3707
3716
  exports.DeviceVariableService = DeviceVariableService;
3717
+ exports.Formatter = Formatter;
3708
3718
  exports.MetadataService = MetadataService;
3709
3719
  exports.SWAGGER_CONSTANTS = SWAGGER_CONSTANTS;
3710
3720
  exports.VARIABLE_CONSTANTS = VARIABLE_CONSTANTS;