@agilemotion/oui-react-js 1.8.56 → 1.8.57

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 (186) hide show
  1. package/dist/ApplicationManager.js +446 -472
  2. package/dist/BasicApp.js +30 -0
  3. package/dist/BasicAppHome.js +2 -3
  4. package/dist/DateUtils.js +2 -2
  5. package/dist/DynamicJS.js +93 -101
  6. package/dist/InteractionPortalAppHome.js +1 -1
  7. package/dist/InteractionPortalApp_old.js +1 -2
  8. package/dist/MouseTracker.js +23 -0
  9. package/dist/RestService.js +13 -11
  10. package/dist/RestUtils.js +1 -1
  11. package/dist/TypedValue.js +15 -14
  12. package/dist/Utils.js +121 -114
  13. package/dist/ViewContext.js +152 -159
  14. package/dist/assets/jss/components/authNavbarStyle.js +34 -37
  15. package/dist/assets/jss/components/cardHeaderStyle.js +11 -18
  16. package/dist/assets/jss/components/customDropdownStyle.js +25 -27
  17. package/dist/assets/jss/components/customInputStyle.js +7 -3
  18. package/dist/assets/jss/components/dropdownStyle.js +14 -11
  19. package/dist/assets/jss/components/footerStyle.js +17 -12
  20. package/dist/assets/jss/components/headerLinksStyle.js +12 -9
  21. package/dist/assets/jss/components/headerStyle.js +24 -26
  22. package/dist/assets/jss/components/navbarLinksStyle.js +12 -9
  23. package/dist/assets/jss/components/navbarStyle.js +24 -26
  24. package/dist/assets/jss/components/sidebarStyle.js +42 -42
  25. package/dist/assets/jss/components/typographyStyle.js +7 -3
  26. package/dist/assets/jss/rootStyle.js +30 -34
  27. package/dist/assets/jss/views/layoutStyle.js +12 -9
  28. package/dist/assets/jss/views/loginStyle.js +9 -6
  29. package/dist/components/AlertBar.js +1 -1
  30. package/dist/components/Button.js +18 -11
  31. package/dist/components/Calendar.js +9 -6
  32. package/dist/components/Chart.js +1 -1
  33. package/dist/components/DataGrid.css +10 -1
  34. package/dist/components/DataGrid.js +115 -56
  35. package/dist/components/DataGridColumn.js +2 -1
  36. package/dist/components/DocumentTemplateDesignerComponent.js +7 -7
  37. package/dist/components/DocumentTemplateDesignerComponent2.js +3 -4
  38. package/dist/components/DocumentTemplatePlaceholderDialog.js +3 -4
  39. package/dist/components/DocumentViewer.js +15 -5
  40. package/dist/components/ElementResizeHandler.js +177 -174
  41. package/dist/components/FaceApi.js +2 -2
  42. package/dist/components/FileThumb.js +5 -5
  43. package/dist/components/Graph.js +77 -74
  44. package/dist/components/GraphNode.js +39 -36
  45. package/dist/components/HtmlPanel.js +2 -1
  46. package/dist/components/Icon.js +1 -2
  47. package/dist/components/PDFViewer.js +2 -3
  48. package/dist/components/PopupView.js +1 -1
  49. package/dist/components/Portlet.js +3 -2
  50. package/dist/components/RegularButton.js +17 -14
  51. package/dist/components/SocketManager.js +97 -94
  52. package/dist/components/StepperTitleBar.js +7 -6
  53. package/dist/components/TabPage.js +10 -7
  54. package/dist/components/TabPanel.js +11 -6
  55. package/dist/components/TableCellContent.js +13 -9
  56. package/dist/components/TemplateDesigner.js +2 -2
  57. package/dist/components/TemplateItemEventHandler.js +232 -228
  58. package/dist/components/TemplateTable.js +32 -29
  59. package/dist/components/TitleBar.js +2 -2
  60. package/dist/components/Toolbar.js +17 -10
  61. package/dist/components/Tree.js +3 -3
  62. package/dist/components/WordDocumentViewer.css +1 -0
  63. package/dist/components/WordDocumentViewer.js +205 -14
  64. package/dist/components/card/Card.js +18 -15
  65. package/dist/components/card/CardAvatar.js +11 -8
  66. package/dist/components/card/CardBody.js +16 -13
  67. package/dist/components/card/CardFooter.js +15 -12
  68. package/dist/components/card/CardHeader.js +16 -13
  69. package/dist/components/card/CardIcon.js +9 -6
  70. package/dist/components/card/CardText.js +9 -6
  71. package/dist/components/customInput/File.js +4 -5
  72. package/dist/components/dashboard/FoldingSideTabDashboard.bck.js +1 -1
  73. package/dist/components/dashboard/FoldingSideTabDashboard.js +2 -3
  74. package/dist/components/dashboard/components/Header.js +6 -4
  75. package/dist/components/dashboard/components/LeftDrawer.js +2 -2
  76. package/dist/components/dashboard/components/blackDashboard/fixedPlugin/FixedPlugin.js +26 -28
  77. package/dist/components/dashboard/components/blackDashboard/sidebar/FoldingTabSidebar.bck.js +182 -188
  78. package/dist/components/dashboard/components/blackDashboard/sidebar/FoldingTabSidebar.js +27 -30
  79. package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenuSidebar.js +12 -14
  80. package/dist/components/drag-spec-design.json +15 -0
  81. package/dist/components/facialRecognition/FaceRecognitionComponent.js +10 -11
  82. package/dist/components/facialRecognition/service/faceApi.js +3 -3
  83. package/dist/components/form/AddressSearch.js +8 -5
  84. package/dist/components/form/AutoComplete.js +4 -4
  85. package/dist/components/form/BaseField.js +3 -2
  86. package/dist/components/form/CurrencyField.js +8 -8
  87. package/dist/components/form/DatePicker.js +3 -2
  88. package/dist/components/form/FieldSet.js +2 -1
  89. package/dist/components/form/Form.css +1 -1
  90. package/dist/components/form/Form.js +10 -7
  91. package/dist/components/form/GridField.js +4 -3
  92. package/dist/components/form/IconField.js +2 -1
  93. package/dist/components/form/ImageEditor.js +13 -8
  94. package/dist/components/form/LookupField.js +8 -7
  95. package/dist/components/form/MultiFileUploadField.js +14 -8
  96. package/dist/components/form/SelectItem.js +7 -6
  97. package/dist/components/form/TextField.js +6 -6
  98. package/dist/components/form/TimePicker.js +3 -2
  99. package/dist/components/form/TransferList.js +2 -2
  100. package/dist/components/form/UploadField.js +5 -5
  101. package/dist/components/grid/GridContainer.js +7 -4
  102. package/dist/components/grid/GridItem.js +7 -4
  103. package/dist/components/layout/CollapsiblePanel.js +7 -5
  104. package/dist/components/layout/Layout.js +5 -5
  105. package/dist/components/layout/View.js +6 -5
  106. package/dist/components/layout/ViewContainer.js +1 -2
  107. package/dist/components/layout/ViewPort.js +1 -1
  108. package/dist/components/layout/Window.js +2 -3
  109. package/dist/components/layout/WindowDialog.js +9 -7
  110. package/dist/components/layout/WindowViewPort.js +3 -3
  111. package/dist/components/media/Chat.js +2 -1
  112. package/dist/components/media/MediaSoupHelper.js +57 -53
  113. package/dist/components/media/SocketRequest.js +9 -7
  114. package/dist/components/media/SocketResponse.js +7 -5
  115. package/dist/components/media/Timer.js +1 -2
  116. package/dist/components/media/Toolbar.js +3 -3
  117. package/dist/components/media/ToolbarButton.js +3 -3
  118. package/dist/components/media/Toolbar_bck.js +3 -3
  119. package/dist/components/media/Tracks.js +24 -19
  120. package/dist/components/media/TrainingRoom.js +3 -4
  121. package/dist/components/media/Transports.js +21 -17
  122. package/dist/components/media/VCEventManager.js +25 -24
  123. package/dist/components/media/VCEventType.js +81 -79
  124. package/dist/components/media/VCParticipantList.js +1 -2
  125. package/dist/components/media/VCParticipantListItem.js +2 -3
  126. package/dist/components/media/VCRoomParticipant.js +4 -5
  127. package/dist/components/media/VCRoomRecorder.js +163 -160
  128. package/dist/components/media/VCRoomWorkspace.js +3 -4
  129. package/dist/components/media/Video.js +1 -2
  130. package/dist/components/media/VideoPlayer.js +1 -2
  131. package/dist/components/media/chat/ChatPoll.js +15 -15
  132. package/dist/components/media/chat/ChatRoom.js +15 -15
  133. package/dist/components/media/chat/ChatRoomItem.js +2 -3
  134. package/dist/components/media/chat/ChatRoomList.js +1 -2
  135. package/dist/components/media/chat/ChatRoomWrapper.js +1 -1
  136. package/dist/components/media/chat/PollContainer.js +14 -8
  137. package/dist/components/media/chat/PollResult.js +1 -2
  138. package/dist/components/menu/MenuBars.js +8 -5
  139. package/dist/components/menu/MenuButton.js +11 -5
  140. package/dist/components/menu/MenuItem.js +13 -6
  141. package/dist/components/menu/MenuLink.js +2 -1
  142. package/dist/components/navbars/HomeNavbar.js +43 -41
  143. package/dist/components/navbars/PortalNavbar.js +1 -2
  144. package/dist/components/signatures/AgilitySignaturePanel.js +39 -15
  145. package/dist/components/signatures/{DocumentContainer.js → HtmlSignatureDocumentContainer.js} +4 -4
  146. package/dist/components/signatures/ImageSignatureInput.js +27 -16
  147. package/dist/components/signatures/ResponsiveTable.js +1 -1
  148. package/dist/components/signatures/SearchView.js +1 -1
  149. package/dist/components/signatures/SignatureInput.js +42 -98
  150. package/dist/components/signatures/SignatureInputProps.js +1 -1
  151. package/dist/components/signatures/SignatureTemplateDesigner.js +13 -10
  152. package/dist/components/signatures/Toolbar.js +7 -3
  153. package/dist/components/signatures/ViewUtils.js +21 -16
  154. package/dist/event/ActionHandlers.js +10 -7
  155. package/dist/event/Event.js +15 -13
  156. package/dist/event/EventListener.js +39 -41
  157. package/dist/event/EventType.js +24 -19
  158. package/dist/event/Observable.js +120 -125
  159. package/dist/event/RouteActionHandler.js +4 -4
  160. package/dist/event/ScriptActionHandler.js +1 -1
  161. package/dist/event/ServiceCallActionHandler.js +1 -1
  162. package/dist/interaction/CursorOverlay.js +48 -0
  163. package/dist/interaction/DragContext.js +39 -0
  164. package/dist/interaction/GrabContext.js +40 -0
  165. package/dist/js/Addresses.js +9 -8
  166. package/dist/js/Calendar.js +152 -149
  167. package/dist/js/Docs.js +92 -87
  168. package/dist/js/DynamicLib.js +9 -6
  169. package/dist/js/Media.js +134 -131
  170. package/dist/js/ProcurementMeetings.js +81 -78
  171. package/dist/js/Validators.js +53 -50
  172. package/dist/js/Windows.js +35 -32
  173. package/dist/redux/store/ConfigureStore.js +8 -5
  174. package/dist/redux/store/DashboardStore.js +13 -12
  175. package/dist/redux/store/SecurityStore.js +9 -6
  176. package/dist/security/TokenManager.js +1 -1
  177. package/dist/view/Dashboard.js +11 -12
  178. package/dist/view/security/ForgotPassword.js +3 -3
  179. package/dist/view/security/ForgotPasswordBasic.js +1 -1
  180. package/dist/view/security/Login.js +4 -4
  181. package/dist/view/security/LoginBasic.js +2 -2
  182. package/dist/view/security/LoginInteractionPortal.js +2 -2
  183. package/dist/view/security/ResetPassword.js +1 -1
  184. package/dist/view/security/ResetPasswordBasic.js +1 -1
  185. package/dist/view/security/Security.js +4 -4
  186. package/package.json +1 -1
@@ -12,18 +12,461 @@ var _DynamicJS = _interopRequireWildcard(require("./DynamicJS"));
12
12
  var _TypedValue = _interopRequireDefault(require("./TypedValue"));
13
13
  var _SocketManager = _interopRequireDefault(require("./components/SocketManager"));
14
14
  var _ViewContext = require("./ViewContext");
15
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
16
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
17
16
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
18
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
19
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
18
20
  const APP_VARIABLE = exports.APP_VARIABLE = '__APPLICATION_OUI_SYS_VAR__';
19
21
  const SOCKET_VARIABLE = exports.SOCKET_VARIABLE = '__SOCKET_VARIABLE_OUI_SYS_VAR__';
20
22
  const AVATAR_LISTENER_TYPE = exports.AVATAR_LISTENER_TYPE = 'AVATAR_LISTENER';
21
23
  const SYSTEM_EVENT = exports.SYSTEM_EVENT = 'SYSTEM_EVENT';
22
24
  const TEMPLATE_TOKEN_REGEX = exports.TEMPLATE_TOKEN_REGEX = new RegExp('(([$]{1}[{]{1})(([a-zA-Z0-9_$.@#{}[\\]]*)+){1}([}]{1}))+', 'g');
23
- const LEGEND_ARROW_ICON = exports.LEGEND_ARROW_ICON = ` <i class=\"fa fa-arrow-right fa-xs\" aria-hidden=\"true\" style='color:__COLOR__'></i> `;
25
+ const LEGEND_ARROW_ICON = exports.LEGEND_ARROW_ICON = " <i class=\"fa fa-arrow-right fa-xs\" aria-hidden=\"true\" style='color:__COLOR__'></i> ";
24
26
  const applicationContext = {};
25
27
  class ApplicationManager {
26
28
  constructor() {
29
+ var _this = this;
30
+ _defineProperty(this, "addApplicationContextSubscription", subscription => {
31
+ return new Promise(resolve => {
32
+ _Observable.default.addApplicationContextSubscription(subscription);
33
+ resolve(applicationContext);
34
+ });
35
+ });
36
+ _defineProperty(this, "setConfirmDialogHandler", controller => {
37
+ this.props.confirmationDialogController = controller;
38
+ });
39
+ /**
40
+ * registers a library
41
+ *
42
+ * @param name
43
+ * @param lib
44
+ */
45
+ _defineProperty(this, "registerLibrary", (name, lib) => {
46
+ this.libs[name] = lib;
47
+ });
48
+ /**
49
+ * set application history
50
+ *
51
+ * @param history
52
+ */
53
+ _defineProperty(this, "setApplicationHistory", history => {
54
+ this.props.applicationHistory = history;
55
+ });
56
+ /**
57
+ * get application history
58
+ *
59
+ * @returns application history
60
+ */
61
+ _defineProperty(this, "getApplicationHistory", () => {
62
+ return this.props.applicationHistory;
63
+ });
64
+ /**
65
+ * update appbar title
66
+ *
67
+ * @param viewId
68
+ * @param title
69
+ */
70
+ _defineProperty(this, "updateAppBarTitle", (viewId, title) => {
71
+ Object.keys(this.viewContext).forEach(key => {
72
+ this.viewContext[key].updateAppBarTitle(viewId, title);
73
+ });
74
+ });
75
+ /**
76
+ * clears all views
77
+ *
78
+ */
79
+ _defineProperty(this, "clear", () => {
80
+ _Observable.default.clearAllEventListeners();
81
+ Object.keys(this.viewContext).forEach(key => {
82
+ this.viewContext[key].clear();
83
+ });
84
+ this.fileCache.splice(0, this.fileCache.length);
85
+ });
86
+ _defineProperty(this, "getFileDomainCache", domain => {
87
+ for (const fileCacheElement of this.fileCache) {
88
+ if (fileCacheElement.domain === domain) {
89
+ return fileCacheElement;
90
+ }
91
+ }
92
+ return null;
93
+ });
94
+ /**
95
+ * add view configuration
96
+ *
97
+ * @param domain
98
+ * @param file
99
+ */
100
+ _defineProperty(this, "addFile", (domain, file) => {
101
+ if (_Utils.default.isNull(domain)) {
102
+ console.error('Please specify file domain');
103
+ return;
104
+ }
105
+ let fileDomainCache = this.getFileDomainCache(domain);
106
+ if (fileDomainCache === null) {
107
+ fileDomainCache = {};
108
+ fileDomainCache.domain = domain;
109
+ fileDomainCache.files = [];
110
+ this.fileCache.push(fileDomainCache);
111
+ }
112
+ let cachedFile = null;
113
+ for (const domainFile of fileDomainCache.files) {
114
+ if (domainFile.correlationId === file.correlationId) {
115
+ cachedFile = domainFile;
116
+ }
117
+ }
118
+ if (cachedFile === null) {
119
+ fileDomainCache.files.push(file);
120
+ } else {
121
+ cachedFile.content = file.content;
122
+ }
123
+ });
124
+ _defineProperty(this, "updateContext", function (values) {
125
+ let publish = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
126
+ if (publish) {
127
+ _Observable.default.emitContextChangeEvent(applicationContext, values);
128
+ }
129
+ Object.keys(values).forEach(key => {
130
+ applicationContext[key] = values[key];
131
+ });
132
+ });
133
+ /**
134
+ * add view configuration
135
+ *
136
+ * @param view the listener to be added
137
+ * @param path
138
+ * @param forward
139
+ */
140
+ _defineProperty(this, "addDashboardView", (view, path) => {
141
+ this.viewContext.dashboard.addView(view);
142
+ });
143
+ /**
144
+ * clear dashboard view configuration
145
+ *
146
+ */
147
+ _defineProperty(this, "clearDashboardViews", () => {
148
+ this.viewContext.dashboard.closeAllViews();
149
+ });
150
+ /**
151
+ * add view configuration
152
+ *
153
+ * @param view the listener to be added
154
+ * @param path
155
+ * @param forward
156
+ * @param managerId
157
+ */
158
+ _defineProperty(this, "addView", (view, path, forward, managerId) => {
159
+ this.viewContext[managerId].addView(view, path, forward);
160
+ });
161
+ /**
162
+ * closes all views
163
+ *
164
+ */
165
+ _defineProperty(this, "closeAllViews", () => {
166
+ Object.keys(this.viewContext).forEach(key => {
167
+ this.viewContext[key].closeAllViews();
168
+ });
169
+ _Observable.default.emitContextChangeEvent(applicationContext, {
170
+ windowView: null
171
+ });
172
+ applicationContext.windowView = null;
173
+ });
174
+ /**
175
+ * closes the specified view
176
+ *
177
+ * @param viewId the listener to be added
178
+ * @param forward
179
+ */
180
+ _defineProperty(this, "closeView", (viewId, forward) => {
181
+ for (const key of Object.keys(this.viewContext)) {
182
+ let viewContextElement = this.viewContext[key];
183
+ if (key === 'popup') {
184
+ this.props.confirmationDialogController.closePopupView();
185
+ } else {
186
+ const view = viewContextElement.getView();
187
+ if (view) {
188
+ viewContextElement.closeView(viewId, forward);
189
+ if (key === 'window') {
190
+ _Observable.default.emitContextChangeEvent(applicationContext, {
191
+ windowView: null
192
+ });
193
+ applicationContext.windowView = null;
194
+ }
195
+ break;
196
+ }
197
+ }
198
+ }
199
+ });
200
+ /**
201
+ * Returns a view configuration with a particular id
202
+ *
203
+ */
204
+ _defineProperty(this, "getView", id => {
205
+ for (const key of Object.keys(this.viewContext)) {
206
+ const view = this.viewContext[key].getView(id);
207
+ if (view) {
208
+ return view;
209
+ }
210
+ }
211
+ return null;
212
+ });
213
+ _defineProperty(this, "getViewComponent", (view, id) => {
214
+ if (!_Utils.default.isNull(view) && !_Utils.default.isNull(view.handle) && !_Utils.default.isNull(view.handle.api)) {
215
+ if (id === view.handle.api.id) {
216
+ return view.handle.api;
217
+ }
218
+ let handle = view.handle.api.getChild(id);
219
+ if (handle) {
220
+ return handle.api;
221
+ }
222
+ if (id === 'view') {
223
+ return view.handle.api;
224
+ }
225
+ }
226
+ });
227
+ /**
228
+ * Returns a view configuration with a particular id
229
+ *
230
+ */
231
+ _defineProperty(this, "resolveComponentApi", id => {
232
+ if (APP_VARIABLE === id) {
233
+ return this.api;
234
+ }
235
+ let graphs = [];
236
+ for (const key of Object.keys(this.viewContext)) {
237
+ let viewContext = this.viewContext[key];
238
+ for (const graph of viewContext.getGraphs()) {
239
+ graphs.push(graph);
240
+ }
241
+ }
242
+ for (const graph of graphs) {
243
+ if (graph.id === id) {
244
+ return graph;
245
+ }
246
+ }
247
+ let views = [];
248
+ for (const key of Object.keys(this.viewContext)) {
249
+ let viewContext = this.viewContext[key];
250
+ for (const view of viewContext.getViews()) {
251
+ views.push(view);
252
+ }
253
+ }
254
+ for (const view of views) {
255
+ let component = this.getViewComponent(view, id);
256
+ if (component) {
257
+ return component;
258
+ }
259
+ }
260
+ return null;
261
+ });
262
+ /**
263
+ * Populate all place holders in the given template
264
+ *
265
+ */
266
+ _defineProperty(this, "populateTemplate", (template, eventData) => {
267
+ let matches = template.match(TEMPLATE_TOKEN_REGEX);
268
+ if (!_Utils.default.isNull(matches)) {
269
+ for (const match of matches) {
270
+ let expresionContent = match.substring(match.indexOf('{') + 1, match.lastIndexOf('}'));
271
+ let expressionValue = '';
272
+ if (expresionContent.startsWith('$event.data') && !_Utils.default.isNull(eventData)) {
273
+ let props = expresionContent.replace('$event.data.', '').split('.');
274
+ let vo = eventData;
275
+ for (const prop of props) {
276
+ vo = vo[prop];
277
+ }
278
+ expressionValue = vo;
279
+ } else {
280
+ expressionValue = this.resolveExpressionValue(expresionContent);
281
+ }
282
+ template = template.replace(match, expressionValue);
283
+ }
284
+ }
285
+ return template;
286
+ });
287
+ _defineProperty(this, "resolveExpressionValue", function (expression) {
288
+ let eventData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
289
+ let paramExpression = expression.match(/\(([^)]*)\)/);
290
+ let isEvent = expression.startsWith('$event.data');
291
+ let baseExpression = isEvent ? '$event.data' : !_Utils.default.isNull(paramExpression) && paramExpression.length > 0 ? expression.replace(paramExpression[0], '') : expression;
292
+ let expressionContent = baseExpression.substring(baseExpression.indexOf('{') + 1, baseExpression.indexOf('}'));
293
+ let isComponent = baseExpression.startsWith('@#{');
294
+ let isLib = baseExpression.startsWith('@@{');
295
+ let tokens = expressionContent.split('.');
296
+ let idToken = tokens[0];
297
+ if (isComponent || isEvent) {
298
+ let value = isEvent ? eventData : _this.resolveComponentApi(expressionContent);
299
+ let expressionClosure = isEvent ? 'data.' : '}.';
300
+ let index = expression.indexOf(expressionClosure);
301
+ if (index > 0) {
302
+ let propertyChain = expression.substring(index + expressionClosure.length);
303
+ let props = propertyChain.split('.');
304
+ for (const prop of props) {
305
+ if (_Utils.default.isNull(value)) {
306
+ return null;
307
+ }
308
+ value = value[prop];
309
+ if (typeof value === 'function') {
310
+ value = value();
311
+ }
312
+ }
313
+ }
314
+ return value;
315
+ } else if (isLib) {
316
+ /*if (idToken === 'view') {
317
+ idToken = this.getCurrentView().config.id + '_lib';
318
+ }*/
319
+
320
+ return _this.libs[idToken];
321
+ }
322
+ return expression;
323
+ });
324
+ _defineProperty(this, "setExpressionValues", function (obj) {
325
+ let eventData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
326
+ let isArray = Array.isArray(obj);
327
+ const updated = isArray ? [] : {};
328
+ Object.keys(obj).forEach(key => {
329
+ if (typeof obj[key] === 'object' && obj[key] !== null) {
330
+ updated[key] = _this.setExpressionValues(obj[key], eventData);
331
+ } else {
332
+ let objValue = obj[key];
333
+ if (typeof objValue === 'function') {
334
+ objValue = objValue();
335
+ }
336
+ if (typeof objValue === 'undefined') {
337
+ objValue = null;
338
+ }
339
+ if (_this.isExpression(objValue)) {
340
+ try {
341
+ let scriptValue = _DynamicJS.default.executeScript("resolveParam_".concat(Math.random().toString().replace('.', '_')), objValue, null, null, eventData);
342
+ if (typeof scriptValue === 'undefined') {
343
+ scriptValue = null;
344
+ }
345
+ let objKey = key === 'valueExpression' ? 'value' : key;
346
+ updated[objKey] = scriptValue !== null && scriptValue.instanceType === 'TypedValue' ? scriptValue.value : scriptValue;
347
+ if (typeof updated[objKey] === 'undefined') {
348
+ delete updated.type;
349
+ }
350
+ } catch (e) {
351
+ console.error("Error processing parameter expression : " + objValue);
352
+ throw e;
353
+ }
354
+ } else {
355
+ updated[key] = objValue;
356
+ }
357
+ }
358
+ });
359
+ return updated;
360
+ });
361
+ /**
362
+ * Returns a view configuration with a particular id
363
+ *
364
+ */
365
+ _defineProperty(this, "resolveParameterConfigValue", (configValue, eventData) => {
366
+ if (!configValue) {
367
+ return configValue;
368
+ }
369
+ if (this.isExpression(configValue)) {
370
+ return this.resolveExpressionValue(configValue, eventData);
371
+ } else {
372
+ let json = JSON.stringify(configValue);
373
+ let matches = json.match(_DynamicJS.TEMPLATE_REGEX);
374
+ if (!_Utils.default.isNull(matches)) {
375
+ return this.setExpressionValues(configValue);
376
+ } else {
377
+ return configValue;
378
+ }
379
+ }
380
+ });
381
+ /**
382
+ * Returns a view configuration with a particular id
383
+ *
384
+ */
385
+ _defineProperty(this, "resolveParameterValue", function (parameterConfig) {
386
+ let eventData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
387
+ if (parameterConfig.static) {
388
+ return parameterConfig.value;
389
+ }
390
+ let expression = parameterConfig.value.toString();
391
+ let isEvent = expression.startsWith('$event.data');
392
+ if (isEvent) {
393
+ let value = eventData;
394
+ let expressionClosure = 'data.';
395
+ let index = expression.indexOf(expressionClosure);
396
+ if (index > 0) {
397
+ let propertyChain = expression.substring(index + expressionClosure.length);
398
+ let props = propertyChain.split('.');
399
+ for (const prop of props) {
400
+ if (_Utils.default.isNull(value)) {
401
+ return null;
402
+ }
403
+ value = value[prop];
404
+ }
405
+ }
406
+ return value;
407
+ }
408
+ let val = null;
409
+ if (_Utils.default.isNull(parameterConfig.value)) {
410
+ console.error('NULL parameter value expression in : ' + JSON.stringify(parameterConfig));
411
+ return null;
412
+ }
413
+ if (!_this.isExpression(parameterConfig.value)) {
414
+ val = _this.resolveParameterConfigValue(parameterConfig.value);
415
+ } else {
416
+ let expression = parameterConfig.value;
417
+ val = _DynamicJS.default.executeScript("resolveParam_".concat(Math.random().toString().replace('.', '_')), expression, null, null, {
418
+ data: eventData
419
+ });
420
+ }
421
+ if (_Utils.default.isNull(val)) {
422
+ return null;
423
+ }
424
+ if (!_Utils.default.isNull(val) && !_Utils.default.isNull(val.instanceType) && val.instanceType === 'TypedValue') {
425
+ if (!_Utils.default.isNull(parameterConfig.type)) {
426
+ val.type = parameterConfig.type;
427
+ }
428
+ return val;
429
+ }
430
+ let type = null;
431
+ if (!_Utils.default.isNull(parameterConfig.type)) {
432
+ type = parameterConfig.type;
433
+ } else if (val !== null) {
434
+ type = typeof val;
435
+ }
436
+ return new _TypedValue.default(type, val);
437
+ });
438
+ /**
439
+ * Sets a value to the specified view's model
440
+ * @param key
441
+ * @param value
442
+ * @param viewId
443
+ */
444
+ _defineProperty(this, "setModelValue", (key, value, viewId) => {
445
+ this.getView(viewId).handle.api.setModelValue(key, value);
446
+ _Observable.default.processSystemGeneratedSubscriptions(viewId);
447
+ });
448
+ _defineProperty(this, "getId", () => {
449
+ return 'applicationManager';
450
+ });
451
+ /**
452
+ * viewContext
453
+ */
454
+ _defineProperty(this, "getPreviousHistoryElement", viewContext => {
455
+ return this.viewContext[viewContext].getPreviousHistoryElement();
456
+ });
457
+ /**
458
+ * viewContext
459
+ */
460
+ _defineProperty(this, "getCurrentGraph", viewContext => {
461
+ let graphs = this.viewContext[viewContext].graphs;
462
+ return graphs && graphs.length > 0 ? graphs[graphs.length - 1] : null;
463
+ });
464
+ /**
465
+ * viewContext
466
+ */
467
+ _defineProperty(this, "getTopView", viewContext => {
468
+ return this.viewContext[viewContext].getTopView();
469
+ });
27
470
  if (!ApplicationManager.instance) {
28
471
  this.viewContext = {
29
472
  main: new _ViewContext.ViewContext('main'),
@@ -100,12 +543,6 @@ class ApplicationManager {
100
543
  }
101
544
  return roles[0];
102
545
  }
103
- addApplicationContextSubscription = subscription => {
104
- return new Promise(resolve => {
105
- _Observable.default.addApplicationContextSubscription(subscription);
106
- resolve(applicationContext);
107
- });
108
- };
109
546
  navigate(path) {
110
547
  this.props.navigator(path);
111
548
  }
@@ -177,9 +614,6 @@ class ApplicationManager {
177
614
  }
178
615
  }
179
616
  }
180
- setConfirmDialogHandler = controller => {
181
- this.props.confirmationDialogController = controller;
182
- };
183
617
  setApplicationThemeColors(primary, secondary) {
184
618
  this.props.primaryColor = primary;
185
619
  this.props.secondaryColor = secondary;
@@ -210,348 +644,6 @@ class ApplicationManager {
210
644
  });
211
645
  applicationContext.windowView = view;
212
646
  }
213
-
214
- /**
215
- * registers a library
216
- *
217
- * @param name
218
- * @param lib
219
- */
220
- registerLibrary = (name, lib) => {
221
- this.libs[name] = lib;
222
- };
223
-
224
- /**
225
- * set application history
226
- *
227
- * @param history
228
- */
229
- setApplicationHistory = history => {
230
- this.props.applicationHistory = history;
231
- };
232
-
233
- /**
234
- * get application history
235
- *
236
- * @returns application history
237
- */
238
- getApplicationHistory = () => {
239
- return this.props.applicationHistory;
240
- };
241
-
242
- /**
243
- * update appbar title
244
- *
245
- * @param viewId
246
- * @param title
247
- */
248
- updateAppBarTitle = (viewId, title) => {
249
- Object.keys(this.viewContext).forEach(key => {
250
- this.viewContext[key].updateAppBarTitle(viewId, title);
251
- });
252
- };
253
-
254
- /**
255
- * clears all views
256
- *
257
- */
258
- clear = () => {
259
- _Observable.default.clearAllEventListeners();
260
- Object.keys(this.viewContext).forEach(key => {
261
- this.viewContext[key].clear();
262
- });
263
- this.fileCache.splice(0, this.fileCache.length);
264
- };
265
- getFileDomainCache = domain => {
266
- for (const fileCacheElement of this.fileCache) {
267
- if (fileCacheElement.domain === domain) {
268
- return fileCacheElement;
269
- }
270
- }
271
- return null;
272
- };
273
-
274
- /**
275
- * add view configuration
276
- *
277
- * @param domain
278
- * @param file
279
- */
280
- addFile = (domain, file) => {
281
- if (_Utils.default.isNull(domain)) {
282
- console.error('Please specify file domain');
283
- return;
284
- }
285
- let fileDomainCache = this.getFileDomainCache(domain);
286
- if (fileDomainCache === null) {
287
- fileDomainCache = {};
288
- fileDomainCache.domain = domain;
289
- fileDomainCache.files = [];
290
- this.fileCache.push(fileDomainCache);
291
- }
292
- let cachedFile = null;
293
- for (const domainFile of fileDomainCache.files) {
294
- if (domainFile.correlationId === file.correlationId) {
295
- cachedFile = domainFile;
296
- }
297
- }
298
- if (cachedFile === null) {
299
- fileDomainCache.files.push(file);
300
- } else {
301
- cachedFile.content = file.content;
302
- }
303
- };
304
- updateContext = (() => function (values) {
305
- let publish = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
306
- if (publish) {
307
- _Observable.default.emitContextChangeEvent(applicationContext, values);
308
- }
309
- Object.keys(values).forEach(key => {
310
- applicationContext[key] = values[key];
311
- });
312
- })();
313
-
314
- /**
315
- * add view configuration
316
- *
317
- * @param view the listener to be added
318
- * @param path
319
- * @param forward
320
- */
321
- addDashboardView = (view, path) => {
322
- this.viewContext.dashboard.addView(view);
323
- };
324
-
325
- /**
326
- * clear dashboard view configuration
327
- *
328
- */
329
- clearDashboardViews = () => {
330
- this.viewContext.dashboard.closeAllViews();
331
- };
332
-
333
- /**
334
- * add view configuration
335
- *
336
- * @param view the listener to be added
337
- * @param path
338
- * @param forward
339
- * @param managerId
340
- */
341
- addView = (view, path, forward, managerId) => {
342
- this.viewContext[managerId].addView(view, path, forward);
343
- };
344
-
345
- /**
346
- * closes all views
347
- *
348
- */
349
- closeAllViews = () => {
350
- Object.keys(this.viewContext).forEach(key => {
351
- this.viewContext[key].closeAllViews();
352
- });
353
- _Observable.default.emitContextChangeEvent(applicationContext, {
354
- windowView: null
355
- });
356
- applicationContext.windowView = null;
357
- };
358
-
359
- /**
360
- * closes the specified view
361
- *
362
- * @param viewId the listener to be added
363
- * @param forward
364
- */
365
- closeView = (viewId, forward) => {
366
- for (const key of Object.keys(this.viewContext)) {
367
- let viewContextElement = this.viewContext[key];
368
- if (key === 'popup') {
369
- this.props.confirmationDialogController.closePopupView();
370
- } else {
371
- const view = viewContextElement.getView();
372
- if (view) {
373
- viewContextElement.closeView(viewId, forward);
374
- if (key === 'window') {
375
- _Observable.default.emitContextChangeEvent(applicationContext, {
376
- windowView: null
377
- });
378
- applicationContext.windowView = null;
379
- }
380
- break;
381
- }
382
- }
383
- }
384
- };
385
-
386
- /**
387
- * Returns a view configuration with a particular id
388
- *
389
- */
390
- getView = id => {
391
- for (const key of Object.keys(this.viewContext)) {
392
- const view = this.viewContext[key].getView(id);
393
- if (view) {
394
- return view;
395
- }
396
- }
397
- return null;
398
- };
399
- getViewComponent = (view, id) => {
400
- if (!_Utils.default.isNull(view) && !_Utils.default.isNull(view.handle) && !_Utils.default.isNull(view.handle.api)) {
401
- if (id === view.handle.api.id) {
402
- return view.handle.api;
403
- }
404
- let handle = view.handle.api.getChild(id);
405
- if (handle) {
406
- return handle.api;
407
- }
408
- if (id === 'view') {
409
- return view.handle.api;
410
- }
411
- }
412
- };
413
-
414
- /**
415
- * Returns a view configuration with a particular id
416
- *
417
- */
418
- resolveComponentApi = id => {
419
- if (APP_VARIABLE === id) {
420
- return this.api;
421
- }
422
- let graphs = [];
423
- for (const key of Object.keys(this.viewContext)) {
424
- let viewContext = this.viewContext[key];
425
- for (const graph of viewContext.getGraphs()) {
426
- graphs.push(graph);
427
- }
428
- }
429
- for (const graph of graphs) {
430
- if (graph.id === id) {
431
- return graph;
432
- }
433
- }
434
- let views = [];
435
- for (const key of Object.keys(this.viewContext)) {
436
- let viewContext = this.viewContext[key];
437
- for (const view of viewContext.getViews()) {
438
- views.push(view);
439
- }
440
- }
441
- for (const view of views) {
442
- let component = this.getViewComponent(view, id);
443
- if (component) {
444
- return component;
445
- }
446
- }
447
- return null;
448
- };
449
-
450
- /**
451
- * Populate all place holders in the given template
452
- *
453
- */
454
- populateTemplate = (template, eventData) => {
455
- let matches = template.match(TEMPLATE_TOKEN_REGEX);
456
- if (!_Utils.default.isNull(matches)) {
457
- for (const match of matches) {
458
- let expresionContent = match.substring(match.indexOf('{') + 1, match.lastIndexOf('}'));
459
- let expressionValue = '';
460
- if (expresionContent.startsWith('$event.data') && !_Utils.default.isNull(eventData)) {
461
- let props = expresionContent.replace('$event.data.', '').split('.');
462
- let vo = eventData;
463
- for (const prop of props) {
464
- vo = vo[prop];
465
- }
466
- expressionValue = vo;
467
- } else {
468
- expressionValue = this.resolveExpressionValue(expresionContent);
469
- }
470
- template = template.replace(match, expressionValue);
471
- }
472
- }
473
- return template;
474
- };
475
- resolveExpressionValue = (() => {
476
- var _this = this;
477
- return function (expression) {
478
- let eventData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
479
- let paramExpression = expression.match(/\(([^)]*)\)/);
480
- let isEvent = expression.startsWith('$event.data');
481
- let baseExpression = isEvent ? '$event.data' : !_Utils.default.isNull(paramExpression) && paramExpression.length > 0 ? expression.replace(paramExpression[0], '') : expression;
482
- let expressionContent = baseExpression.substring(baseExpression.indexOf('{') + 1, baseExpression.indexOf('}'));
483
- let isComponent = baseExpression.startsWith('@#{');
484
- let isLib = baseExpression.startsWith('@@{');
485
- let tokens = expressionContent.split('.');
486
- let idToken = tokens[0];
487
- if (isComponent || isEvent) {
488
- let value = isEvent ? eventData : _this.resolveComponentApi(expressionContent);
489
- let expressionClosure = isEvent ? 'data.' : '}.';
490
- let index = expression.indexOf(expressionClosure);
491
- if (index > 0) {
492
- let propertyChain = expression.substring(index + expressionClosure.length);
493
- let props = propertyChain.split('.');
494
- for (const prop of props) {
495
- if (_Utils.default.isNull(value)) {
496
- return null;
497
- }
498
- value = value[prop];
499
- if (typeof value === 'function') {
500
- value = value();
501
- }
502
- }
503
- }
504
- return value;
505
- } else if (isLib) {
506
- /*if (idToken === 'view') {
507
- idToken = this.getCurrentView().config.id + '_lib';
508
- }*/
509
-
510
- return _this.libs[idToken];
511
- }
512
- return expression;
513
- };
514
- })();
515
- setExpressionValues = (() => {
516
- var _this2 = this;
517
- return function (obj) {
518
- let eventData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
519
- let isArray = Array.isArray(obj);
520
- const updated = isArray ? [] : {};
521
- Object.keys(obj).forEach(key => {
522
- if (typeof obj[key] === 'object' && obj[key] !== null) {
523
- updated[key] = _this2.setExpressionValues(obj[key], eventData);
524
- } else {
525
- let objValue = obj[key];
526
- if (typeof objValue === 'function') {
527
- objValue = objValue();
528
- }
529
- if (typeof objValue === 'undefined') {
530
- objValue = null;
531
- }
532
- if (_this2.isExpression(objValue)) {
533
- try {
534
- let scriptValue = _DynamicJS.default.executeScript(`resolveParam_${Math.random().toString().replace('.', '_')}`, objValue, null, null, eventData);
535
- if (typeof scriptValue === 'undefined') {
536
- scriptValue = null;
537
- }
538
- let objKey = key === 'valueExpression' ? 'value' : key;
539
- updated[objKey] = scriptValue !== null && scriptValue.instanceType === 'TypedValue' ? scriptValue.value : scriptValue;
540
- if (typeof updated[objKey] === 'undefined') {
541
- delete updated.type;
542
- }
543
- } catch (e) {
544
- console.error("Error processing parameter expression : " + objValue);
545
- throw e;
546
- }
547
- } else {
548
- updated[key] = objValue;
549
- }
550
- }
551
- });
552
- return updated;
553
- };
554
- })();
555
647
  fillEventDataValue(obj, eventData) {
556
648
  if (obj) {
557
649
  Object.keys(obj).forEach(key => {
@@ -567,105 +659,9 @@ class ApplicationManager {
567
659
  }
568
660
  return null;
569
661
  }
570
-
571
- /**
572
- * Returns a view configuration with a particular id
573
- *
574
- */
575
- resolveParameterConfigValue = (configValue, eventData) => {
576
- if (!configValue) {
577
- return configValue;
578
- }
579
- if (this.isExpression(configValue)) {
580
- return this.resolveExpressionValue(configValue, eventData);
581
- } else {
582
- let json = JSON.stringify(configValue);
583
- let matches = json.match(_DynamicJS.TEMPLATE_REGEX);
584
- if (!_Utils.default.isNull(matches)) {
585
- return this.setExpressionValues(configValue);
586
- } else {
587
- return configValue;
588
- }
589
- }
590
- };
591
662
  isExpression(objValue) {
592
663
  return objValue && objValue.toString().includes('$application') || objValue && objValue.toString().startsWith('$event.data') || !_Utils.default.isNull(objValue) && typeof objValue === 'string' && !_Utils.default.isNull(objValue.match(_DynamicJS.TEMPLATE_REGEX));
593
664
  }
594
-
595
- /**
596
- * Returns a view configuration with a particular id
597
- *
598
- */
599
- resolveParameterValue = (() => {
600
- var _this3 = this;
601
- return function (parameterConfig) {
602
- let eventData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
603
- if (parameterConfig.static) {
604
- return parameterConfig.value;
605
- }
606
- let expression = parameterConfig.value.toString();
607
- let isEvent = expression.startsWith('$event.data');
608
- if (isEvent) {
609
- let value = eventData;
610
- let expressionClosure = 'data.';
611
- let index = expression.indexOf(expressionClosure);
612
- if (index > 0) {
613
- let propertyChain = expression.substring(index + expressionClosure.length);
614
- let props = propertyChain.split('.');
615
- for (const prop of props) {
616
- if (_Utils.default.isNull(value)) {
617
- return null;
618
- }
619
- value = value[prop];
620
- }
621
- }
622
- return value;
623
- }
624
- let val = null;
625
- if (_Utils.default.isNull(parameterConfig.value)) {
626
- console.error('NULL parameter value expression in : ' + JSON.stringify(parameterConfig));
627
- return null;
628
- }
629
- if (!_this3.isExpression(parameterConfig.value)) {
630
- val = _this3.resolveParameterConfigValue(parameterConfig.value);
631
- } else {
632
- let expression = parameterConfig.value;
633
- val = _DynamicJS.default.executeScript(`resolveParam_${Math.random().toString().replace('.', '_')}`, expression, null, null, {
634
- data: eventData
635
- });
636
- }
637
- if (_Utils.default.isNull(val)) {
638
- return null;
639
- }
640
- if (!_Utils.default.isNull(val) && !_Utils.default.isNull(val.instanceType) && val.instanceType === 'TypedValue') {
641
- if (!_Utils.default.isNull(parameterConfig.type)) {
642
- val.type = parameterConfig.type;
643
- }
644
- return val;
645
- }
646
- let type = null;
647
- if (!_Utils.default.isNull(parameterConfig.type)) {
648
- type = parameterConfig.type;
649
- } else if (val !== null) {
650
- type = typeof val;
651
- }
652
- return new _TypedValue.default(type, val);
653
- };
654
- })();
655
-
656
- /**
657
- * Sets a value to the specified view's model
658
- * @param key
659
- * @param value
660
- * @param viewId
661
- */
662
- setModelValue = (key, value, viewId) => {
663
- this.getView(viewId).handle.api.setModelValue(key, value);
664
- _Observable.default.processSystemGeneratedSubscriptions(viewId);
665
- };
666
- getId = () => {
667
- return 'applicationManager';
668
- };
669
665
  enableFormMarkers(enabled) {
670
666
  this.props.formMarkersEnabled = enabled;
671
667
  }
@@ -698,28 +694,6 @@ class ApplicationManager {
698
694
  this.viewContext[key].signalGraph(id, event);
699
695
  });
700
696
  }
701
-
702
- /**
703
- * viewContext
704
- */
705
- getPreviousHistoryElement = viewContext => {
706
- return this.viewContext[viewContext].getPreviousHistoryElement();
707
- };
708
-
709
- /**
710
- * viewContext
711
- */
712
- getCurrentGraph = viewContext => {
713
- let graphs = this.viewContext[viewContext].graphs;
714
- return graphs && graphs.length > 0 ? graphs[graphs.length - 1] : null;
715
- };
716
-
717
- /**
718
- * viewContext
719
- */
720
- getTopView = viewContext => {
721
- return this.viewContext[viewContext].getTopView();
722
- };
723
697
  }
724
698
  const instance = new ApplicationManager();
725
699
  Object.freeze(instance);