@wavemaker/app-ng-runtime 11.4.0-next.25703 → 11.4.0-next.25704
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.
- app-ng-runtime/build-task/basic/tree/tree.build.d.ts +1 -2
- app-ng-runtime/build-task/bundles/index.umd.js +7 -9
- app-ng-runtime/build-task/bundles/index.umd.js.map +1 -1
- app-ng-runtime/build-task/esm2015/basic/tree/tree.build.js +3 -4
- app-ng-runtime/build-task/esm2015/navigation/popover/popover.build.js +3 -3
- app-ng-runtime/build-task/fesm2015/index.js +7 -9
- app-ng-runtime/build-task/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/base/bundles/index.umd.js +6 -3
- app-ng-runtime/components/base/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/base/esm2015/utils/widget-utils.js +7 -4
- app-ng-runtime/components/base/fesm2015/index.js +6 -3
- app-ng-runtime/components/base/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/base/utils/widget-utils.d.ts +1 -1
- app-ng-runtime/components/basic/tree/bundles/index.umd.js +280 -256
- app-ng-runtime/components/basic/tree/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/basic/tree/esm2015/public_api.js +2 -2
- app-ng-runtime/components/basic/tree/esm2015/tree.component.js +322 -0
- app-ng-runtime/components/basic/tree/esm2015/tree.module.js +3 -3
- app-ng-runtime/components/basic/tree/fesm2015/index.js +260 -248
- app-ng-runtime/components/basic/tree/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/basic/tree/index.metadata.json +1 -1
- app-ng-runtime/components/basic/tree/public_api.d.ts +1 -1
- app-ng-runtime/components/basic/tree/tree.component.d.ts +34 -0
- app-ng-runtime/components/data/list/bundles/index.umd.js +28 -4
- app-ng-runtime/components/data/list/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/data/list/esm2015/list.component.js +29 -5
- app-ng-runtime/components/data/list/fesm2015/index.js +28 -4
- app-ng-runtime/components/data/list/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/data/list/index.metadata.json +1 -1
- app-ng-runtime/components/dialogs/default/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/dialogs/default/esm2015/base-dialog.js +1 -1
- app-ng-runtime/components/dialogs/default/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/dialogs/default/index.metadata.json +1 -1
- app-ng-runtime/components/input/epoch/bundles/index.umd.js +39 -21
- app-ng-runtime/components/input/epoch/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/input/epoch/esm2015/base-date-time.component.js +43 -25
- app-ng-runtime/components/input/epoch/esm2015/date/date.component.js +3 -3
- app-ng-runtime/components/input/epoch/esm2015/date-time/date-time.component.js +2 -2
- app-ng-runtime/components/input/epoch/fesm2015/index.js +45 -27
- app-ng-runtime/components/input/epoch/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/input/epoch/index.metadata.json +1 -1
- app-ng-runtime/components/navigation/popover/bundles/index.umd.js +3 -4
- app-ng-runtime/components/navigation/popover/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/navigation/popover/esm2015/popover.component.js +5 -6
- app-ng-runtime/components/navigation/popover/fesm2015/index.js +4 -5
- app-ng-runtime/components/navigation/popover/fesm2015/index.js.map +1 -1
- app-ng-runtime/package.json +1 -1
- app-ng-runtime/scripts/datatable/datatable.js +23 -23
- app-ng-runtime/scripts/tree-keyboard-navigation/keyboard-navigation.js +251 -0
- app-ng-runtime/variables/bundles/index.umd.js +14 -4
- app-ng-runtime/variables/bundles/index.umd.js.map +1 -1
- app-ng-runtime/variables/esm2015/manager/action/notification-action.manager.js +5 -6
- app-ng-runtime/variables/esm2015/service/variables.service.js +8 -1
- app-ng-runtime/variables/fesm2015/index.js +11 -5
- app-ng-runtime/variables/fesm2015/index.js.map +1 -1
- app-ng-runtime/variables/index.metadata.json +1 -1
- app-ng-runtime/variables/service/variables.service.d.ts +4 -0
- app-ng-runtime/components/basic/tree/esm2015/tree.directive.js +0 -310
- app-ng-runtime/components/basic/tree/tree.directive.d.ts +0 -35
|
@@ -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',
|
|
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,
|
|
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,
|
|
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,
|
|
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;
|