@wavemaker/app-ng-runtime 11.4.0-next.28701 → 11.4.0-rc.121

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 (127) 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 +7 -9
  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/navigation/popover/popover.build.js +3 -3
  6. app-ng-runtime/build-task/fesm2015/index.js +7 -9
  7. app-ng-runtime/build-task/fesm2015/index.js.map +1 -1
  8. app-ng-runtime/components/base/bundles/index.umd.js +22 -8
  9. app-ng-runtime/components/base/bundles/index.umd.js.map +1 -1
  10. app-ng-runtime/components/base/esm2015/directives/show-in-device.directive.js +16 -5
  11. app-ng-runtime/components/base/esm2015/utils/widget-utils.js +7 -4
  12. app-ng-runtime/components/base/esm2015/widgets/common/dialog/dialog.service.js +3 -3
  13. app-ng-runtime/components/base/fesm2015/index.js +23 -9
  14. app-ng-runtime/components/base/fesm2015/index.js.map +1 -1
  15. app-ng-runtime/components/base/utils/widget-utils.d.ts +1 -1
  16. app-ng-runtime/components/basic/tree/bundles/index.umd.js +369 -245
  17. app-ng-runtime/components/basic/tree/bundles/index.umd.js.map +1 -1
  18. app-ng-runtime/components/basic/tree/esm2015/public_api.js +2 -2
  19. app-ng-runtime/components/basic/tree/esm2015/tree.component.js +403 -0
  20. app-ng-runtime/components/basic/tree/esm2015/tree.module.js +3 -3
  21. app-ng-runtime/components/basic/tree/fesm2015/index.js +333 -240
  22. app-ng-runtime/components/basic/tree/fesm2015/index.js.map +1 -1
  23. app-ng-runtime/components/basic/tree/index.metadata.json +1 -1
  24. app-ng-runtime/components/basic/tree/public_api.d.ts +1 -1
  25. app-ng-runtime/components/basic/tree/tree.component.d.ts +43 -0
  26. app-ng-runtime/components/chart/bundles/index.umd.js +1 -1
  27. app-ng-runtime/components/chart/bundles/index.umd.js.map +1 -1
  28. app-ng-runtime/components/chart/esm2015/chart.component.js +2 -2
  29. app-ng-runtime/components/chart/fesm2015/index.js +1 -1
  30. app-ng-runtime/components/chart/fesm2015/index.js.map +1 -1
  31. app-ng-runtime/components/containers/tabs/bundles/index.umd.js +39 -23
  32. app-ng-runtime/components/containers/tabs/bundles/index.umd.js.map +1 -1
  33. app-ng-runtime/components/containers/tabs/esm2015/tab-pane/tab-pane.component.js +8 -1
  34. app-ng-runtime/components/containers/tabs/esm2015/tabs.animator.js +33 -13
  35. app-ng-runtime/components/containers/tabs/fesm2015/index.js +40 -13
  36. app-ng-runtime/components/containers/tabs/fesm2015/index.js.map +1 -1
  37. app-ng-runtime/components/containers/tabs/tabs.animator.d.ts +5 -1
  38. app-ng-runtime/components/containers/wizard/bundles/index.umd.js +43 -2
  39. app-ng-runtime/components/containers/wizard/bundles/index.umd.js.map +1 -1
  40. app-ng-runtime/components/containers/wizard/esm2015/wizard-step/wizard-step.props.js +3 -2
  41. app-ng-runtime/components/containers/wizard/esm2015/wizard.component.js +42 -2
  42. app-ng-runtime/components/containers/wizard/fesm2015/index.js +43 -2
  43. app-ng-runtime/components/containers/wizard/fesm2015/index.js.map +1 -1
  44. app-ng-runtime/components/containers/wizard/index.metadata.json +1 -1
  45. app-ng-runtime/components/containers/wizard/wizard.component.d.ts +2 -0
  46. app-ng-runtime/components/data/list/bundles/index.umd.js +51 -42
  47. app-ng-runtime/components/data/list/bundles/index.umd.js.map +1 -1
  48. app-ng-runtime/components/data/list/esm2015/list.component.js +51 -42
  49. app-ng-runtime/components/data/list/fesm2015/index.js +50 -41
  50. app-ng-runtime/components/data/list/fesm2015/index.js.map +1 -1
  51. app-ng-runtime/components/data/list/index.metadata.json +1 -1
  52. app-ng-runtime/components/data/pagination/bundles/index.umd.js +21 -4
  53. app-ng-runtime/components/data/pagination/bundles/index.umd.js.map +1 -1
  54. app-ng-runtime/components/data/pagination/esm2015/pagination.component.js +22 -5
  55. app-ng-runtime/components/data/pagination/fesm2015/index.js +21 -4
  56. app-ng-runtime/components/data/pagination/fesm2015/index.js.map +1 -1
  57. app-ng-runtime/components/data/pagination/index.metadata.json +1 -1
  58. app-ng-runtime/components/data/pagination/pagination.component.d.ts +1 -0
  59. app-ng-runtime/components/data/table/bundles/index.umd.js +7 -0
  60. app-ng-runtime/components/data/table/bundles/index.umd.js.map +1 -1
  61. app-ng-runtime/components/data/table/esm2015/table.component.js +8 -1
  62. app-ng-runtime/components/data/table/fesm2015/index.js +7 -0
  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/dialogs/default/base-dialog.d.ts +1 -0
  66. app-ng-runtime/components/dialogs/default/bundles/index.umd.js +13 -4
  67. app-ng-runtime/components/dialogs/default/bundles/index.umd.js.map +1 -1
  68. app-ng-runtime/components/dialogs/default/esm2015/base-dialog.js +14 -6
  69. app-ng-runtime/components/dialogs/default/fesm2015/index.js +13 -5
  70. app-ng-runtime/components/dialogs/default/fesm2015/index.js.map +1 -1
  71. app-ng-runtime/components/dialogs/default/index.metadata.json +1 -1
  72. app-ng-runtime/components/input/epoch/bundles/index.umd.js +66 -29
  73. app-ng-runtime/components/input/epoch/bundles/index.umd.js.map +1 -1
  74. app-ng-runtime/components/input/epoch/date-time/date-time-picker.component.d.ts +1 -0
  75. app-ng-runtime/components/input/epoch/esm2015/base-date-time.component.js +43 -25
  76. app-ng-runtime/components/input/epoch/esm2015/date/date.component.js +3 -3
  77. app-ng-runtime/components/input/epoch/esm2015/date-time/date-time-picker.component.js +31 -11
  78. app-ng-runtime/components/input/epoch/esm2015/date-time/date-time.component.js +2 -2
  79. app-ng-runtime/components/input/epoch/fesm2015/index.js +75 -37
  80. app-ng-runtime/components/input/epoch/fesm2015/index.js.map +1 -1
  81. app-ng-runtime/components/input/epoch/index.metadata.json +1 -1
  82. app-ng-runtime/components/navigation/popover/bundles/index.umd.js +3 -4
  83. app-ng-runtime/components/navigation/popover/bundles/index.umd.js.map +1 -1
  84. app-ng-runtime/components/navigation/popover/esm2015/popover.component.js +5 -6
  85. app-ng-runtime/components/navigation/popover/fesm2015/index.js +4 -5
  86. app-ng-runtime/components/navigation/popover/fesm2015/index.js.map +1 -1
  87. app-ng-runtime/core/bundles/index.umd.js +12 -2
  88. app-ng-runtime/core/bundles/index.umd.js.map +1 -1
  89. app-ng-runtime/core/esm2015/services/viewport.service.js +6 -4
  90. app-ng-runtime/core/esm2015/utils/utils.js +11 -3
  91. app-ng-runtime/core/fesm2015/index.js +15 -5
  92. app-ng-runtime/core/fesm2015/index.js.map +1 -1
  93. app-ng-runtime/core/index.metadata.json +1 -1
  94. app-ng-runtime/core/utils/utils.d.ts +2 -2
  95. app-ng-runtime/mobile/components/page/default/bundles/index.umd.js +24 -6
  96. app-ng-runtime/mobile/components/page/default/bundles/index.umd.js.map +1 -1
  97. app-ng-runtime/mobile/components/page/default/esm2015/page.directive.js +20 -3
  98. app-ng-runtime/mobile/components/page/default/fesm2015/index.js +19 -2
  99. app-ng-runtime/mobile/components/page/default/fesm2015/index.js.map +1 -1
  100. app-ng-runtime/mobile/components/page/default/index.metadata.json +1 -1
  101. app-ng-runtime/mobile/components/page/default/page.directive.d.ts +4 -1
  102. app-ng-runtime/package.json +1 -1
  103. app-ng-runtime/runtime/base/bundles/index.umd.js +164 -133
  104. app-ng-runtime/runtime/base/bundles/index.umd.js.map +1 -1
  105. app-ng-runtime/runtime/base/esm2015/components/app-component/app.component.js +2 -2
  106. app-ng-runtime/runtime/base/esm2015/public_api.js +2 -1
  107. app-ng-runtime/runtime/base/esm2015/runtime-base.module.js +3 -1
  108. app-ng-runtime/runtime/base/esm2015/services/app.service.js +3 -1
  109. app-ng-runtime/runtime/base/esm2015/services/pipe.service.js +33 -0
  110. app-ng-runtime/runtime/base/fesm2015/index.js +149 -120
  111. app-ng-runtime/runtime/base/fesm2015/index.js.map +1 -1
  112. app-ng-runtime/runtime/base/index.metadata.json +1 -1
  113. app-ng-runtime/runtime/base/public_api.d.ts +1 -0
  114. app-ng-runtime/runtime/base/services/pipe.service.d.ts +9 -0
  115. app-ng-runtime/scripts/datatable/datatable.js +23 -23
  116. app-ng-runtime/scripts/tree-keyboard-navigation/keyboard-navigation.js +251 -0
  117. app-ng-runtime/variables/bundles/index.umd.js +37 -22
  118. app-ng-runtime/variables/bundles/index.umd.js.map +1 -1
  119. app-ng-runtime/variables/esm2015/manager/action/notification-action.manager.js +29 -24
  120. app-ng-runtime/variables/esm2015/service/variables.service.js +8 -1
  121. app-ng-runtime/variables/fesm2015/index.js +35 -24
  122. app-ng-runtime/variables/fesm2015/index.js.map +1 -1
  123. app-ng-runtime/variables/index.metadata.json +1 -1
  124. app-ng-runtime/variables/manager/action/notification-action.manager.d.ts +1 -0
  125. app-ng-runtime/variables/service/variables.service.d.ts +4 -0
  126. app-ng-runtime/components/basic/tree/esm2015/tree.directive.js +0 -310
  127. app-ng-runtime/components/basic/tree/tree.directive.d.ts +0 -35
@@ -983,7 +983,7 @@ $.widget('wm.datatable', {
983
983
  this._render(true);
984
984
  },
985
985
  _setGridEditMode: function (val) {
986
- if ($.isFunction(this.options.setGridEditMode)) {
986
+ if (_.isFunction(this.options.setGridEditMode)) {
987
987
  this.options.setGridEditMode(val);
988
988
  }
989
989
  },
@@ -1041,7 +1041,7 @@ $.widget('wm.datatable', {
1041
1041
  $gridBody,
1042
1042
  $alwaysNewRow;
1043
1043
 
1044
- if (!alwaysNewRow && $.isFunction(this.options.beforeRowInsert)) {
1044
+ if (!alwaysNewRow && _.isFunction(this.options.beforeRowInsert)) {
1045
1045
  this.options.beforeRowInsert();
1046
1046
  }
1047
1047
 
@@ -1680,10 +1680,10 @@ $.widget('wm.datatable', {
1680
1680
  isQuickEdit = this.options.editmode === this.CONSTANTS.QUICK_EDIT;
1681
1681
 
1682
1682
  function callRowSelectionEvents() {
1683
- if (selected && $.isFunction(self.options.onRowSelect)) {
1683
+ if (selected && _.isFunction(self.options.onRowSelect)) {
1684
1684
  self.options.onRowSelect(data, e);
1685
1685
  }
1686
- if (!selected && $.isFunction(self.options.onRowDeselect)) {
1686
+ if (!selected && _.isFunction(self.options.onRowDeselect)) {
1687
1687
  self.options.onRowDeselect(data, e);
1688
1688
  }
1689
1689
  }
@@ -1728,7 +1728,7 @@ $.widget('wm.datatable', {
1728
1728
  if (!rowData) {
1729
1729
  return;
1730
1730
  }
1731
- if ($.isFunction(this.options.onRowDblClick)) {
1731
+ if (_.isFunction(this.options.onRowDblClick)) {
1732
1732
  this.options.onRowDblClick(rowData, e);
1733
1733
  }
1734
1734
  },
@@ -1770,13 +1770,13 @@ $.widget('wm.datatable', {
1770
1770
  if (selected) {
1771
1771
  $column.addClass(selectedClass);
1772
1772
  $th.addClass(selectedClass);
1773
- if ($.isFunction(this.options.onColumnSelect) && e) {
1773
+ if (_.isFunction(this.options.onColumnSelect) && e) {
1774
1774
  this.options.onColumnSelect(colInfo, e);
1775
1775
  }
1776
1776
  } else {
1777
1777
  $column.removeClass(selectedClass);
1778
1778
  $th.removeClass(selectedClass);
1779
- if ($.isFunction(this.options.onColumnDeselect) && e) {
1779
+ if (_.isFunction(this.options.onColumnDeselect) && e) {
1780
1780
  this.options.onColumnDeselect(colInfo, e);
1781
1781
  }
1782
1782
  }
@@ -2029,7 +2029,7 @@ $.widget('wm.datatable', {
2029
2029
 
2030
2030
  //On success of update or delete
2031
2031
  function onSaveSuccess(skipFocus, error) {
2032
- if ($.isFunction(options.success)) {
2032
+ if (_.isFunction(options.success)) {
2033
2033
  options.success(skipFocus, error);
2034
2034
  }
2035
2035
  if (!advancedEdit || self.options.actionsEnabled.edit) {
@@ -2060,7 +2060,7 @@ $.widget('wm.datatable', {
2060
2060
  return;
2061
2061
  }
2062
2062
  $row.addClass('row-editing');
2063
- if ($.isFunction(this.options.beforeRowUpdate)) {
2063
+ if (_.isFunction(this.options.beforeRowUpdate)) {
2064
2064
  this.options.beforeRowUpdate(rowData, e);
2065
2065
  }
2066
2066
 
@@ -2073,7 +2073,7 @@ $.widget('wm.datatable', {
2073
2073
  self.toggleNewRowActions(true);
2074
2074
  }
2075
2075
  //Event for on before form render. User can update row data here.
2076
- if ($.isFunction(this.options.onBeforeFormRender)) {
2076
+ if (_.isFunction(this.options.onBeforeFormRender)) {
2077
2077
  isValid = this.options.onBeforeFormRender(rowData, e, options.operation || action);
2078
2078
  if (isValid === false) {
2079
2079
  return;
@@ -2096,7 +2096,7 @@ $.widget('wm.datatable', {
2096
2096
  });
2097
2097
  }
2098
2098
  //Event for on before form render. User can access form widgets here.
2099
- if ($.isFunction(this.options.onFormRender)) {
2099
+ if (_.isFunction(this.options.onFormRender)) {
2100
2100
  this.options.onFormRender($row, e, options.operation || action, $row.hasClass('always-new-row'));
2101
2101
  }
2102
2102
  } else {
@@ -2160,7 +2160,7 @@ $.widget('wm.datatable', {
2160
2160
  }
2161
2161
  self.options.setTouched($invalidTd.find('[formcontrolname]').attr('formcontrolname'));
2162
2162
  });
2163
- if ($.isFunction(options.success)) {
2163
+ if (_.isFunction(options.success)) {
2164
2164
  options.success(false, true);
2165
2165
  }
2166
2166
  return;
@@ -2168,14 +2168,14 @@ $.widget('wm.datatable', {
2168
2168
 
2169
2169
  if (isNewRow && advancedEdit && _.isEmpty(rowData)) {
2170
2170
  self.removeNewRow($row);
2171
- if ($.isFunction(options.success)) {
2171
+ if (_.isFunction(options.success)) {
2172
2172
  options.success(false, undefined, true);
2173
2173
  }
2174
2174
  return;
2175
2175
  }
2176
2176
 
2177
2177
  if (isNewRow) {
2178
- if ($.isFunction(this.options.onBeforeRowInsert)) {
2178
+ if (_.isFunction(this.options.onBeforeRowInsert)) {
2179
2179
  isValid = this.options.onBeforeRowInsert(rowData, e, editOptions);
2180
2180
  if (isValid === false) {
2181
2181
  return;
@@ -2192,7 +2192,7 @@ $.widget('wm.datatable', {
2192
2192
  self.removeNewRow($row);
2193
2193
  }
2194
2194
  } else {
2195
- if ($.isFunction(this.options.onBeforeRowUpdate)) {
2195
+ if (_.isFunction(this.options.onBeforeRowUpdate)) {
2196
2196
  isValid = this.options.onBeforeRowUpdate(rowData, e, editOptions);
2197
2197
  if (isValid === false) {
2198
2198
  return;
@@ -2205,7 +2205,7 @@ $.widget('wm.datatable', {
2205
2205
  if (!options.noMsg) {
2206
2206
  this.options.noChangesDetected();
2207
2207
  }
2208
- if ($.isFunction(options.success)) {
2208
+ if (_.isFunction(options.success)) {
2209
2209
  options.success(false);
2210
2210
  }
2211
2211
  }
@@ -2315,7 +2315,7 @@ $.widget('wm.datatable', {
2315
2315
  this.options.setActionRowIndex(rowId);
2316
2316
  this.options.setLastActionPerformed(this.options.ACTIONS.DELETE);
2317
2317
 
2318
- if ($.isFunction(this.options.beforeRowDelete)) {
2318
+ if (_.isFunction(this.options.beforeRowDelete)) {
2319
2319
  this.options.beforeRowDelete(rowData, e);
2320
2320
  }
2321
2321
  if (isNewRow) {
@@ -2331,13 +2331,13 @@ $.widget('wm.datatable', {
2331
2331
  return;
2332
2332
  }
2333
2333
  /* calling onbeforerowDelete callback function.*/
2334
- if($.isFunction(this.options.onBeforeRowDelete)) {
2334
+ if(_.isFunction(this.options.onBeforeRowDelete)) {
2335
2335
  isValid = this.options.onBeforeRowDelete(rowData, e, options);
2336
2336
  if (isValid === false) {
2337
2337
  return;
2338
2338
  }
2339
2339
  }
2340
- if ($.isFunction(this.options.onRowDelete)) {
2340
+ if (_.isFunction(this.options.onRowDelete)) {
2341
2341
  className = this.options.cssClassNames.deleteRow;
2342
2342
  isActiveRow = $row.attr('class').indexOf('active') !== -1;
2343
2343
  if (isActiveRow) {
@@ -2982,10 +2982,10 @@ $.widget('wm.datatable', {
2982
2982
  // If we enable multiselect and check header checkbox then updating selecteditem in datatable.
2983
2983
  self.options.assignSelectedItems(rowData, e);
2984
2984
  self.toggleRowSelection($row, checked, e, true);
2985
- if (checked && $.isFunction(self.options.onRowSelect)) {
2985
+ if (checked && _.isFunction(self.options.onRowSelect)) {
2986
2986
  self.options.onRowSelect(rowData, e);
2987
2987
  }
2988
- if (!checked && $.isFunction(self.options.onRowDeselect)) {
2988
+ if (!checked && _.isFunction(self.options.onRowDeselect)) {
2989
2989
  self.options.onRowDeselect(rowData, e);
2990
2990
  }
2991
2991
  });
@@ -3020,7 +3020,7 @@ $.widget('wm.datatable', {
3020
3020
  /**Add event handler, to the select all checkbox on the header**/
3021
3021
  $header.on('click', '.app-datagrid-header-cell input:checkbox', toggleSelectAll);
3022
3022
 
3023
- if ($.isFunction(this.options.onHeaderClick)) {
3023
+ if (_.isFunction(this.options.onHeaderClick)) {
3024
3024
  this.gridHeaderElement.find('th.app-datagrid-header-cell').on('click', this.headerClickHandler.bind(this));
3025
3025
  }
3026
3026
 
@@ -3168,7 +3168,7 @@ $.widget('wm.datatable', {
3168
3168
  if (isCreated) {
3169
3169
  this._setColSpan(this.options.headerConfig);
3170
3170
  }
3171
- if ($.isFunction(this.options.onDataRender)) {
3171
+ if (_.isFunction(this.options.onDataRender)) {
3172
3172
  this.options.onDataRender();
3173
3173
  }
3174
3174
  if (!isCreated && this.options.selectFirstRow) {
@@ -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);
@@ -1563,30 +1563,35 @@
1563
1563
  toaster.onHidden.subscribe(this.onToasterHide.bind(this, variable));
1564
1564
  }
1565
1565
  };
1566
+ NotificationActionManager.prototype.getDialogConfig = function (variable, options, dialogId, closeCallBackFn) {
1567
+ return {
1568
+ 'title': options.title || variable.dataBinding.title,
1569
+ 'text': options.message || variable.dataBinding.text,
1570
+ 'okButtonText': options.okButtonText || variable.dataBinding.okButtonText || 'OK',
1571
+ 'cancelButtonText': options.cancelButtonText || variable.dataBinding.cancelButtonText || 'CANCEL',
1572
+ 'alerttype': options.alerttype || variable.dataBinding.alerttype || 'information',
1573
+ onOk: function () {
1574
+ // Close the action dialog after triggering onOk callback event
1575
+ exports.dialogService.close(dialogId, undefined, closeCallBackFn);
1576
+ },
1577
+ onCancel: function () {
1578
+ initiateCallback('onCancel', variable, options.data);
1579
+ // Close the action dialog after triggering onCancel callback event
1580
+ exports.dialogService.close(dialogId, undefined);
1581
+ },
1582
+ onClose: function () {
1583
+ initiateCallback('onClose', variable, options.data);
1584
+ }
1585
+ };
1586
+ };
1566
1587
  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';
1588
+ var isPrefabType = core.getWmProjectProperties().type === 'PREFAB';
1589
+ var dialogPrefix = isPrefabType ? 'Prefab' : 'Common';
1590
+ var dialogId = dialogPrefix + _.capitalize(variable.operation) + 'Dialog';
1568
1591
  var closeCallBackFn = function () { return initiateCallback('onOk', variable, options.data); };
1569
- exports.dialogService.open(dialogId, variable._context, {
1570
- notification: {
1571
- 'title': options.title || variable.dataBinding.title,
1572
- 'text': options.message || variable.dataBinding.text,
1573
- 'okButtonText': options.okButtonText || variable.dataBinding.okButtonText || 'OK',
1574
- 'cancelButtonText': options.cancelButtonText || variable.dataBinding.cancelButtonText || 'CANCEL',
1575
- 'alerttype': options.alerttype || variable.dataBinding.alerttype || 'information',
1576
- onOk: function () {
1577
- // Close the action dialog after triggering onOk callback event
1578
- exports.dialogService.close(dialogId, variable._context, closeCallBackFn);
1579
- },
1580
- onCancel: function () {
1581
- initiateCallback('onCancel', variable, options.data);
1582
- // Close the action dialog after triggering onCancel callback event
1583
- exports.dialogService.close(dialogId, variable._context);
1584
- },
1585
- onClose: function () {
1586
- initiateCallback('onClose', variable, options.data);
1587
- }
1588
- }
1589
- });
1592
+ var dialogConfig = this.getDialogConfig(variable, options, dialogId, closeCallBackFn);
1593
+ dialogConfig = isPrefabType ? dialogConfig : { notification: dialogConfig };
1594
+ exports.dialogService.open(dialogId, undefined, dialogConfig);
1590
1595
  };
1591
1596
  // *********************************************************** PUBLIC ***********************************************************//
1592
1597
  NotificationActionManager.prototype.notify = function (variable, options, success, error) {
@@ -3486,6 +3491,14 @@
3486
3491
  { type: core.AbstractHttpService }
3487
3492
  ]; };
3488
3493
 
3494
+ var Formatter = /** @class */ (function () {
3495
+ function Formatter() {
3496
+ }
3497
+ Formatter.prototype.format = function (value, format) {
3498
+ return exports.appManager.getPipe('date').transform(value, format);
3499
+ };
3500
+ return Formatter;
3501
+ }());
3489
3502
  var VariablesService = /** @class */ (function () {
3490
3503
  function VariablesService(httpService, metadataService, navigationService, routerService, toasterService, oAuthService, securityService, dialogService) {
3491
3504
  this.httpService = httpService;
@@ -3611,6 +3624,7 @@
3611
3624
  if (this.isVariableSeperated(variablesJson, variableName)) {
3612
3625
  this.processBinding(varInstance, scope, 'dataBinding', this.getBindSourceTarget(varInstance));
3613
3626
  varInstance.httpService = this.httpService;
3627
+ varInstance.dateFormatter = new Formatter();
3614
3628
  varInstance.subscribe('afterInvoke', function () { return core.$invokeWatchers(true); });
3615
3629
  if (varInstance.category === 'wm.LiveVariable' && varInstance.operation === 'read') {
3616
3630
  core.processFilterExpBindNode(varInstance._context, varInstance.filterExpressions, varInstance);
@@ -3705,6 +3719,7 @@
3705
3719
  exports.DB_CONSTANTS = DB_CONSTANTS;
3706
3720
  exports.DeviceVariableManager = DeviceVariableManager;
3707
3721
  exports.DeviceVariableService = DeviceVariableService;
3722
+ exports.Formatter = Formatter;
3708
3723
  exports.MetadataService = MetadataService;
3709
3724
  exports.SWAGGER_CONSTANTS = SWAGGER_CONSTANTS;
3710
3725
  exports.VARIABLE_CONSTANTS = VARIABLE_CONSTANTS;