@agilemotion/oui-react-js 1.6.3 → 1.6.5

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 (219) hide show
  1. package/dist/ApplicationManager.js +675 -1044
  2. package/dist/BasicApp.js +7 -27
  3. package/dist/BasicAppHome.js +27 -101
  4. package/dist/DynamicJS.js +109 -197
  5. package/dist/InteractionPortalApp.js +7 -27
  6. package/dist/InteractionPortalAppHome.js +21 -87
  7. package/dist/InteractionPortalApp_old.js +60 -122
  8. package/dist/RestUtils.js +269 -410
  9. package/dist/TypedValue.js +20 -26
  10. package/dist/Utils.js +295 -481
  11. package/dist/WithRouter.js +9 -17
  12. package/dist/assets/jss/components/authNavbarStyle.js +168 -171
  13. package/dist/assets/jss/components/buttonStyle.js +2 -5
  14. package/dist/assets/jss/components/cardAvatarStyle.js +2 -5
  15. package/dist/assets/jss/components/cardBodyStyle.js +2 -5
  16. package/dist/assets/jss/components/cardFooterStyle.js +2 -5
  17. package/dist/assets/jss/components/cardHeaderStyle.js +20 -17
  18. package/dist/assets/jss/components/cardIconStyle.js +2 -5
  19. package/dist/assets/jss/components/cardStyle.js +2 -5
  20. package/dist/assets/jss/components/cardTextStyle.js +2 -5
  21. package/dist/assets/jss/components/customDropdownStyle.js +171 -173
  22. package/dist/assets/jss/components/customInputStyle.js +5 -13
  23. package/dist/assets/jss/components/dropdownStyle.js +71 -74
  24. package/dist/assets/jss/components/footerStyle.js +14 -23
  25. package/dist/assets/jss/components/headerLinksStyle.js +52 -53
  26. package/dist/assets/jss/components/headerStyle.js +68 -73
  27. package/dist/assets/jss/components/navbarLinksStyle.js +81 -74
  28. package/dist/assets/jss/components/navbarStyle.js +79 -84
  29. package/dist/assets/jss/components/sidebarStyle.js +438 -441
  30. package/dist/assets/jss/components/typographyStyle.js +5 -13
  31. package/dist/assets/jss/rootStyle.js +85 -151
  32. package/dist/assets/jss/views/layoutStyle.js +45 -51
  33. package/dist/assets/jss/views/loginBasicStyle.js +2 -5
  34. package/dist/assets/jss/views/loginBusinessPortalStyle.js +2 -5
  35. package/dist/assets/jss/views/loginStyle.js +80 -87
  36. package/dist/components/AlertBar.js +20 -75
  37. package/dist/components/AlertItem.js +13 -49
  38. package/dist/components/AlertTemplate.js +12 -18
  39. package/dist/components/Button.js +41 -112
  40. package/dist/components/Calendar.js +99 -208
  41. package/dist/components/ConfirmationDialog.js +13 -54
  42. package/dist/components/DataGrid.js +271 -695
  43. package/dist/components/DataGridColumn.js +24 -74
  44. package/dist/components/DataGridFilter.js +107 -245
  45. package/dist/components/DataGridHeading.js +34 -78
  46. package/dist/components/Dialog.js +37 -130
  47. package/dist/components/DocumentTemplateDesigner.js +16 -57
  48. package/dist/components/DocumentTemplateDesignerComponent.js +47 -141
  49. package/dist/components/DocumentTemplatePlaceholderDialog.js +34 -67
  50. package/dist/components/DocumentViewer.js +25 -65
  51. package/dist/components/DocumentViewerComponent.js +13 -44
  52. package/dist/components/ElementResizeHandler.js +148 -200
  53. package/dist/components/FileThumb.js +15 -56
  54. package/dist/components/Graph.js +98 -203
  55. package/dist/components/GraphNode.js +20 -61
  56. package/dist/components/HtmlPanel.js +38 -105
  57. package/dist/components/Icon.js +174 -253
  58. package/dist/components/LoadingIndicator.js +4 -11
  59. package/dist/components/LottieIcon.js +63 -60
  60. package/dist/components/PopupView.js +21 -60
  61. package/dist/components/Portlet.js +18 -60
  62. package/dist/components/RegularButton.js +34 -42
  63. package/dist/components/SignaturePanel.js +19 -67
  64. package/dist/components/SocketManager.js +133 -228
  65. package/dist/components/StepperTitleBar.js +48 -99
  66. package/dist/components/TabPage.js +30 -47
  67. package/dist/components/TabPanel.js +35 -122
  68. package/dist/components/TableCellContent.js +34 -98
  69. package/dist/components/TemplateDesigner.js +115 -230
  70. package/dist/components/TemplateItemEventHandler.js +298 -481
  71. package/dist/components/TemplateTable.js +117 -218
  72. package/dist/components/TitleBar.js +15 -53
  73. package/dist/components/Toolbar.js +44 -110
  74. package/dist/components/Tooltip.js +37 -56
  75. package/dist/components/Tree.js +50 -143
  76. package/dist/components/UseIsVisible.js +5 -25
  77. package/dist/components/card/Card.js +35 -39
  78. package/dist/components/card/CardAvatar.js +21 -32
  79. package/dist/components/card/CardBody.js +29 -36
  80. package/dist/components/card/CardFooter.js +26 -35
  81. package/dist/components/card/CardHeader.js +29 -36
  82. package/dist/components/card/CardIcon.js +15 -29
  83. package/dist/components/card/CardText.js +15 -29
  84. package/dist/components/customInput/CustomInput.js +38 -40
  85. package/dist/components/dashboard/FoldingSideTabDashboard.js +65 -184
  86. package/dist/components/dashboard/SideMenuModuleDashboard.js +67 -185
  87. package/dist/components/dashboard/TopMenuModuleDashboard.js +22 -63
  88. package/dist/components/dashboard/components/Header.js +15 -52
  89. package/dist/components/dashboard/components/LeftDrawer.js +9 -23
  90. package/dist/components/dashboard/components/UserIdentity.js +4 -12
  91. package/dist/components/dashboard/components/blackDashboard/fixedPlugin/FixedPlugin.js +115 -155
  92. package/dist/components/dashboard/components/blackDashboard/sidebar/FoldingTabSidebar.js +344 -419
  93. package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenu.js +15 -29
  94. package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenuSidebar.js +405 -485
  95. package/dist/components/dashboard/components/portal/Timeline.js +3 -8
  96. package/dist/components/dashboard/components/portal/Workspace.js +4 -13
  97. package/dist/components/footer/Footer.js +23 -45
  98. package/dist/components/footer/HomeFooter.js +38 -78
  99. package/dist/components/form/AddressSearch.js +26 -76
  100. package/dist/components/form/AutoComplete.js +54 -168
  101. package/dist/components/form/BaseField.js +59 -189
  102. package/dist/components/form/Checkbox.js +11 -24
  103. package/dist/components/form/DatePicker.js +28 -82
  104. package/dist/components/form/FieldSet.js +84 -300
  105. package/dist/components/form/Form.js +206 -501
  106. package/dist/components/form/GridField.js +83 -243
  107. package/dist/components/form/IconField.js +10 -21
  108. package/dist/components/form/ImageEditor.js +98 -208
  109. package/dist/components/form/LabelField.js +13 -28
  110. package/dist/components/form/LookupField.js +36 -102
  111. package/dist/components/form/MultiFileUploadField.js +67 -134
  112. package/dist/components/form/RadioGroup.js +20 -57
  113. package/dist/components/form/Section.js +33 -118
  114. package/dist/components/form/SelectItem.js +36 -83
  115. package/dist/components/form/SignatureTemplateDesignerField.js +12 -26
  116. package/dist/components/form/Switch.js +11 -24
  117. package/dist/components/form/TextField.js +19 -55
  118. package/dist/components/form/TimePicker.js +18 -43
  119. package/dist/components/form/TransferList.js +76 -200
  120. package/dist/components/form/UploadField.js +134 -256
  121. package/dist/components/grid/GridContainer.js +10 -23
  122. package/dist/components/grid/GridItem.js +10 -23
  123. package/dist/components/layout/CollapsiblePanel.js +20 -59
  124. package/dist/components/layout/Layout.js +40 -149
  125. package/dist/components/layout/View.js +65 -195
  126. package/dist/components/layout/ViewContainer.js +13 -33
  127. package/dist/components/layout/ViewPort.js +14 -48
  128. package/dist/components/layout/Window.js +62 -135
  129. package/dist/components/layout/WindowViewPort.js +18 -63
  130. package/dist/components/media/ClosablePanel.js +9 -18
  131. package/dist/components/media/LobbyWaitingList.js +11 -17
  132. package/dist/components/media/MediaSoupHelper.js +173 -401
  133. package/dist/components/media/SideBarContent.js +17 -34
  134. package/dist/components/media/SocketRequest.js +7 -18
  135. package/dist/components/media/SocketResponse.js +5 -14
  136. package/dist/components/media/Timer.js +18 -54
  137. package/dist/components/media/Toolbar.js +97 -254
  138. package/dist/components/media/ToolbarButton.js +34 -95
  139. package/dist/components/media/Toolbar_bck.js +70 -186
  140. package/dist/components/media/Tracks.js +19 -33
  141. package/dist/components/media/TrainingRoom.js +121 -374
  142. package/dist/components/media/Transports.js +17 -29
  143. package/dist/components/media/VCEventManager.js +45 -116
  144. package/dist/components/media/VCEventType.js +82 -168
  145. package/dist/components/media/VCParticipantList.js +16 -51
  146. package/dist/components/media/VCParticipantListItem.js +44 -141
  147. package/dist/components/media/VCRoom.js +14 -58
  148. package/dist/components/media/VCRoomParticipant.js +235 -556
  149. package/dist/components/media/VCRoomRecorder.js +106 -204
  150. package/dist/components/media/VCRoomWorkspace.js +248 -584
  151. package/dist/components/media/Video.js +27 -112
  152. package/dist/components/media/VideoPlayer.js +23 -91
  153. package/dist/components/media/chat/ChatRoom.js +143 -361
  154. package/dist/components/media/chat/ChatRoomItem.js +17 -58
  155. package/dist/components/media/chat/ChatRoomList.js +15 -60
  156. package/dist/components/menu/CollapsibleMenu.js +22 -52
  157. package/dist/components/menu/MenuBars.js +50 -116
  158. package/dist/components/menu/MenuButton.js +53 -130
  159. package/dist/components/menu/MenuItem.js +11 -51
  160. package/dist/components/menu/MenuLink.js +13 -41
  161. package/dist/components/menu/PopupMenu.js +13 -25
  162. package/dist/components/navbars/AuthNavbar.js +21 -56
  163. package/dist/components/navbars/HomeNavbar.js +213 -290
  164. package/dist/components/navbars/PortalNavbar.js +26 -81
  165. package/dist/components/signatures/AgilitySignaturePanel.js +41 -135
  166. package/dist/components/signatures/AlertItem.js +14 -50
  167. package/dist/components/signatures/Card.js +6 -16
  168. package/dist/components/signatures/DocumentContainer.js +57 -165
  169. package/dist/components/signatures/ImageSignatureInput.js +64 -124
  170. package/dist/components/signatures/MenuButton.js +28 -63
  171. package/dist/components/signatures/Prompt.js +6 -41
  172. package/dist/components/signatures/ResponsiveTable.js +181 -370
  173. package/dist/components/signatures/SearchView.js +34 -112
  174. package/dist/components/signatures/SignatorySearch.js +11 -44
  175. package/dist/components/signatures/SignatorySearchForm.js +19 -50
  176. package/dist/components/signatures/SignatureInput.js +28 -91
  177. package/dist/components/signatures/SignatureInputProps.js +49 -144
  178. package/dist/components/signatures/SignatureTemplateDesigner.js +230 -430
  179. package/dist/components/signatures/Toolbar.js +99 -173
  180. package/dist/components/signatures/ViewUtils.js +207 -313
  181. package/dist/components/typography/Danger.js +6 -11
  182. package/dist/components/typography/Info.js +7 -11
  183. package/dist/components/typography/Link.js +6 -12
  184. package/dist/event/ActionHandlers.js +48 -87
  185. package/dist/event/Event.js +21 -25
  186. package/dist/event/EventListener.js +54 -48
  187. package/dist/event/EventType.js +18 -40
  188. package/dist/event/LoadDataActionHandler.js +10 -31
  189. package/dist/event/Observable.js +204 -396
  190. package/dist/event/RouteActionHandler.js +119 -171
  191. package/dist/event/ScriptActionHandler.js +10 -32
  192. package/dist/event/ServiceCallActionHandler.js +37 -64
  193. package/dist/event/SignalGraphActionHandler.js +9 -31
  194. package/dist/js/Addresses.js +23 -42
  195. package/dist/js/Calendar.js +41 -89
  196. package/dist/js/DynamicLib.js +11 -23
  197. package/dist/js/Media.js +80 -174
  198. package/dist/js/Validators.js +6 -12
  199. package/dist/js/Windows.js +22 -40
  200. package/dist/redux/store/ConfigureStore.js +12 -29
  201. package/dist/redux/store/DashboardStore.js +47 -120
  202. package/dist/redux/store/History.js +2 -5
  203. package/dist/redux/store/SecurityStore.js +22 -65
  204. package/dist/security/TokenManager.js +29 -53
  205. package/dist/theme-default.js +3 -8
  206. package/dist/view/Dashboard.js +140 -308
  207. package/dist/view/PortalDashboard.js +6 -13
  208. package/dist/view/Settings.js +3 -11
  209. package/dist/view/Views.js +15 -35
  210. package/dist/view/security/ChangePasswordBasic.js +41 -147
  211. package/dist/view/security/ForgotPassword.js +26 -106
  212. package/dist/view/security/ForgotPasswordBasic.js +22 -96
  213. package/dist/view/security/Login.js +29 -117
  214. package/dist/view/security/LoginBasic.js +28 -108
  215. package/dist/view/security/LoginInteractionPortal.js +28 -106
  216. package/dist/view/security/ResetPassword.js +25 -110
  217. package/dist/view/security/ResetPasswordBasic.js +39 -142
  218. package/dist/view/security/Security.js +14 -26
  219. package/package.json +26 -21
@@ -3,697 +3,596 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = exports.LEGEND_ARROW_ICON = exports.TEMPLATE_TOKEN_REGEX = exports.SYSTEM_EVENT = exports.AVATAR_LISTENER_TYPE = exports.APP_VARIABLE = void 0;
7
-
6
+ exports.default = exports.TEMPLATE_TOKEN_REGEX = exports.SYSTEM_EVENT = exports.LEGEND_ARROW_ICON = exports.AVATAR_LISTENER_TYPE = exports.APP_VARIABLE = void 0;
8
7
  var _Observable = _interopRequireDefault(require("./event/Observable"));
9
-
10
8
  var _Event = _interopRequireDefault(require("./event/Event"));
11
-
12
9
  var _EventType = _interopRequireDefault(require("./event/EventType"));
13
-
14
10
  var _Graph = _interopRequireDefault(require("./components/Graph"));
15
-
16
11
  var _Utils = _interopRequireDefault(require("./Utils"));
17
-
18
12
  var _DynamicJS = _interopRequireWildcard(require("./DynamicJS"));
19
-
20
13
  var _TypedValue = _interopRequireDefault(require("./TypedValue"));
21
-
22
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
23
-
24
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
-
26
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
-
28
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
29
-
30
- function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
31
-
32
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
33
-
34
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
35
-
36
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
37
-
38
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
39
-
40
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
41
-
42
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
43
-
44
- var APP_VARIABLE = '__DOLLAR_APPLICATION_OUI_SYS_VAR__';
45
- exports.APP_VARIABLE = APP_VARIABLE;
46
- var AVATAR_LISTENER_TYPE = 'AVATAR_LISTENER';
47
- exports.AVATAR_LISTENER_TYPE = AVATAR_LISTENER_TYPE;
48
- var SYSTEM_EVENT = 'SYSTEM_EVENT';
49
- exports.SYSTEM_EVENT = SYSTEM_EVENT;
50
- var TEMPLATE_TOKEN_REGEX = new RegExp('(([$]{1}[{]{1})(([a-zA-Z0-9_$.@#{}[\\]]*)+){1}([}]{1}))+', 'g');
51
- exports.TEMPLATE_TOKEN_REGEX = TEMPLATE_TOKEN_REGEX;
52
- var LEGEND_ARROW_ICON = " <i class=\"fa fa-arrow-right fa-xs\" aria-hidden=\"true\" style='color:__COLOR__'></i> ";
53
- exports.LEGEND_ARROW_ICON = LEGEND_ARROW_ICON;
54
- var applicationContext = {};
55
-
56
- var ApplicationManager = /*#__PURE__*/function () {
57
- function ApplicationManager() {
58
- var _this = this;
59
-
60
- _classCallCheck(this, ApplicationManager);
61
-
62
- _defineProperty(this, "addApplicationContextSubscription", function (subscription) {
63
- return new Promise(function (resolve) {
64
- _Observable.default.addApplicationContextSubscription(subscription);
65
-
66
- resolve(applicationContext);
67
- });
68
- });
69
-
70
- _defineProperty(this, "setConfirmDialogHandler", function (controller) {
71
- _this.props.confirmationDialogController = controller;
72
- });
73
-
74
- _defineProperty(this, "registerLibrary", function (name, lib) {
75
- _this.libs[name] = lib;
76
- });
77
-
78
- _defineProperty(this, "setApplicationHistory", function (history) {
79
- _this.props.applicationHistory = history;
80
- });
81
-
82
- _defineProperty(this, "getApplicationHistory", function () {
83
- return _this.props.applicationHistory;
84
- });
85
-
86
- _defineProperty(this, "getAppBarTitle", function () {
87
- return _this.props.appBarTitle;
88
- });
89
-
90
- _defineProperty(this, "updateAppBarTitle", function (viewId, title) {
91
- console.log('updateAppBarTitle VIEW LENGTH : ', _this.views.length);
92
-
93
- var _iterator = _createForOfIteratorHelper(_this.views),
94
- _step;
95
-
96
- try {
97
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
98
- var view1 = _step.value;
99
- console.log('updateAppBarTitle VIEW : ', view1.config.id);
100
- }
101
- } catch (err) {
102
- _iterator.e(err);
103
- } finally {
104
- _iterator.f();
105
- }
106
-
107
- var view = _this.getView(viewId);
108
-
109
- if (!view) {
110
- return;
111
- }
112
-
113
- var legendIconArrow = LEGEND_ARROW_ICON.replace('__COLOR__', _this.props.secondaryColor);
114
- var titleValue = '';
115
-
116
- if (!title.match(_DynamicJS.TEMPLATE_REGEX)) {
117
- titleValue = title;
118
- } else {
119
- titleValue = _DynamicJS.default.executeScript(viewId + 'Title', title, viewId);
120
- }
121
-
122
- if (!view.popUp && _this.graphs.length === 0) {
123
- var _iterator2 = _createForOfIteratorHelper(_this.navHistory),
124
- _step2;
125
-
126
- try {
127
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
128
- var navHistoryElement = _step2.value;
129
-
130
- if (navHistoryElement.viewId === viewId) {
131
- navHistoryElement.title = titleValue;
132
- }
133
- }
134
- } catch (err) {
135
- _iterator2.e(err);
136
- } finally {
137
- _iterator2.f();
138
- }
139
-
140
- var legendValue = '<span>';
141
- var counter = 0;
142
-
143
- var _iterator3 = _createForOfIteratorHelper(_this.navHistory),
144
- _step3;
145
-
146
- try {
147
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
148
- var _navHistoryElement = _step3.value;
149
- legendValue += "".concat(_navHistoryElement.title);
150
-
151
- if (counter++ < _this.navHistory.length - 1) {
152
- legendValue += legendIconArrow;
153
- }
154
- }
155
- } catch (err) {
156
- _iterator3.e(err);
157
- } finally {
158
- _iterator3.f();
159
- }
160
-
161
- legendValue += '</span>';
162
- _this.props.appBarTitle = legendValue;
163
- } else if (!view.popUp) {
164
- var legendPath = '';
165
-
166
- for (var i = 0; i < _this.graphs[0].initialNavHistoryDepth && i < _this.navHistory.length; i++) {
167
- legendPath += "".concat(_this.navHistory[i].title);
168
-
169
- if (i < _this.graphs[0].initialNavHistoryDepth - 1) {
170
- legendPath += legendIconArrow;
171
- }
14
+ 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); }
15
+ 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; }
16
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
+ const APP_VARIABLE = exports.APP_VARIABLE = '__DOLLAR_APPLICATION_OUI_SYS_VAR__';
18
+ const AVATAR_LISTENER_TYPE = exports.AVATAR_LISTENER_TYPE = 'AVATAR_LISTENER';
19
+ const SYSTEM_EVENT = exports.SYSTEM_EVENT = 'SYSTEM_EVENT';
20
+ const TEMPLATE_TOKEN_REGEX = exports.TEMPLATE_TOKEN_REGEX = new RegExp('(([$]{1}[{]{1})(([a-zA-Z0-9_$.@#{}[\\]]*)+){1}([}]{1}))+', 'g');
21
+ const LEGEND_ARROW_ICON = exports.LEGEND_ARROW_ICON = ` <i class=\"fa fa-arrow-right fa-xs\" aria-hidden=\"true\" style='color:__COLOR__'></i> `;
22
+ const applicationContext = {};
23
+ class ApplicationManager {
24
+ constructor() {
25
+ if (!ApplicationManager.instance) {
26
+ this.views = [];
27
+ this.props = {};
28
+ this.listeners = [];
29
+ this.libs = {};
30
+ this.navHistory = [];
31
+ this.fileCache = [];
32
+ this.graphs = [];
33
+ this.api = {
34
+ get id() {
35
+ return instance.getId();
36
+ },
37
+ refreshUserAvatar(avatar) {
38
+ instance.refreshUserAvatar(avatar);
39
+ },
40
+ alert(viewId, message, messageType) {
41
+ instance.alert(viewId, message, messageType);
42
+ },
43
+ removeLoadedGraph(routeToAnchor) {
44
+ instance.removeLoadedGraph(routeToAnchor);
45
+ },
46
+ hasActiveMeeting() {
47
+ return instance.hasActiveMeeting();
172
48
  }
173
-
174
- legendPath = legendPath.length > 0 ? legendPath + legendIconArrow : '';
175
- _this.props.appBarTitle = _this.graphs[0].initialNavHistoryDepth === 0 ? titleValue : "".concat(legendPath, "<span>").concat(_this.graphs[0].title, "</span>");
176
-
177
- _this.graphs[0].setCurrentNodeTitle(titleValue);
178
- }
179
-
180
- var property = {};
181
- property.name = 'title';
182
- property.value = _this.props.appBarTitle;
183
- var event = new _Event.default(_this, SYSTEM_EVENT, property);
184
-
185
- _Observable.default.fireEvent(_EventType.default.APPLICATION_CONTEXT_CHANGE, event);
186
-
187
- if (!view.popUp && _this.graphs.length > 0) {
188
- property = {};
189
- property.name = 'stepperTitle';
190
-
191
- var _event = new _Event.default(_this, SYSTEM_EVENT, property);
192
-
193
- _Observable.default.fireEvent(_EventType.default.APPLICATION_CONTEXT_CHANGE, _event);
49
+ };
50
+ if (!Array.isArray) {
51
+ Array.isArray = function (arg) {
52
+ return Object.prototype.toString.call(arg) === '[object Array]';
53
+ };
194
54
  }
55
+ ApplicationManager.instance = this;
56
+ }
57
+ return ApplicationManager.instance;
58
+ }
59
+ addApplicationContextSubscription = subscription => {
60
+ return new Promise(resolve => {
61
+ _Observable.default.addApplicationContextSubscription(subscription);
62
+ resolve(applicationContext);
195
63
  });
196
-
197
- _defineProperty(this, "setViewPortHistory", function (history) {
198
- _this.props.viewPortHistory = history;
199
- });
200
-
201
- _defineProperty(this, "getViewPortHistory", function () {
202
- return _this.props.viewPortHistory;
203
- });
204
-
205
- _defineProperty(this, "clear", function () {
206
- _Observable.default.clearAllEventListeners();
207
-
208
- _this.views.splice(0, _this.views.length);
209
-
210
- _this.fileCache.splice(0, _this.fileCache.length);
64
+ };
65
+ navigate(path) {
66
+ this.props.navigator(path);
67
+ }
68
+ setDashboardSettings(dashboardSettings) {
69
+ this.props.dashboardSettings = dashboardSettings;
70
+ }
71
+ getDashboardSettings() {
72
+ return this.props.dashboardSettings;
73
+ }
74
+ setNavigator(navigator) {
75
+ this.props.navigator = navigator;
76
+ }
77
+ setHasActiveMeeting(hasActiveMeeting) {
78
+ this.props.hasActiveMeeting = hasActiveMeeting;
79
+ }
80
+ hasActiveMeeting() {
81
+ return this.props.hasActiveMeeting;
82
+ }
83
+ setServiceApiPath(serviceApiPath) {
84
+ this.props.serviceApiPath = serviceApiPath;
85
+ }
86
+ getServiceApiPath() {
87
+ return this.props.serviceApiPath;
88
+ }
89
+ setUIConfigPath(uiConfigPath) {
90
+ this.props.uiConfigPath = uiConfigPath;
91
+ }
92
+ setContextRoot(contextRoot) {
93
+ this.props.contextRoot = contextRoot;
94
+ }
95
+ getContextRoot() {
96
+ return this.props.contextRoot;
97
+ }
98
+ getUIConfigPath() {
99
+ return this.props.uiConfigPath;
100
+ }
101
+ setFilesApiPath(filesApiPath) {
102
+ this.props.filesApiPath = filesApiPath;
103
+ }
104
+ getFilesApiPath() {
105
+ return this.props.filesApiPath;
106
+ }
107
+ addApplicationListener(listener) {
108
+ this.listeners.push(listener);
109
+ }
110
+ alert(viewId, message, messageType) {
111
+ let event = new _Event.default(this, this.getView(viewId).config.id, {
112
+ messageType: messageType,
113
+ message: message
211
114
  });
212
-
213
- _defineProperty(this, "getPreviousHistoryElement", function () {
214
- if (_this.navHistory.length > 1) {
215
- return _this.navHistory[_this.navHistory.length - 2];
115
+ _Observable.default.fireEvent(_EventType.default.MESSAGE_ARRIVED, event);
116
+ }
117
+ refreshUserAvatar(avatar) {
118
+ for (const listener of this.listeners) {
119
+ if (listener.type === AVATAR_LISTENER_TYPE) {
120
+ listener.handler(avatar);
216
121
  }
217
-
218
- return null;
219
- });
220
-
221
- _defineProperty(this, "getFileDomainCache", function (domain) {
222
- var _iterator4 = _createForOfIteratorHelper(_this.fileCache),
223
- _step4;
224
-
225
- try {
226
- for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
227
- var fileCacheElement = _step4.value;
228
-
229
- if (fileCacheElement.domain === domain) {
230
- return fileCacheElement;
231
- }
232
- }
233
- } catch (err) {
234
- _iterator4.e(err);
235
- } finally {
236
- _iterator4.f();
122
+ }
123
+ }
124
+ setConfirmDialogHandler = controller => {
125
+ this.props.confirmationDialogController = controller;
126
+ };
127
+ setApplicationThemeColors(primary, secondary) {
128
+ this.props.primaryColor = primary;
129
+ this.props.secondaryColor = secondary;
130
+ }
131
+ getApplicationPrimaryColor() {
132
+ return this.props.primaryColor;
133
+ }
134
+ getApplicationSecondaryColor() {
135
+ return this.props.secondaryColor;
136
+ }
137
+ openConfirmDialog(message, resultCallback) {
138
+ return this.props.confirmationDialogController.openDialog(message, {
139
+ execute: result => {
140
+ resultCallback(result);
237
141
  }
238
-
239
- return null;
240
142
  });
241
-
242
- _defineProperty(this, "addFile", function (domain, file) {
243
- if (_Utils.default.isNull(domain)) {
244
- console.error('Please specify file domain');
245
- return;
246
- }
247
-
248
- var fileDomainCache = _this.getFileDomainCache(domain);
249
-
250
- if (fileDomainCache === null) {
251
- fileDomainCache = {};
252
- fileDomainCache.domain = domain;
253
- fileDomainCache.files = [];
254
-
255
- _this.fileCache.push(fileDomainCache);
143
+ }
144
+ /**
145
+ * registers a library
146
+ *
147
+ * @param name
148
+ * @param lib
149
+ */
150
+ registerLibrary = (name, lib) => {
151
+ this.libs[name] = lib;
152
+ };
153
+
154
+ /**
155
+ * set application history
156
+ *
157
+ * @param history
158
+ */
159
+ setApplicationHistory = history => {
160
+ this.props.applicationHistory = history;
161
+ };
162
+
163
+ /**
164
+ * get application history
165
+ *
166
+ * @returns application history
167
+ */
168
+ getApplicationHistory = () => {
169
+ return this.props.applicationHistory;
170
+ };
171
+
172
+ /**
173
+ * get app bar title
174
+ *
175
+ * @returns app bar title
176
+ */
177
+ getAppBarTitle = () => {
178
+ return this.props.appBarTitle;
179
+ };
180
+
181
+ /**
182
+ * update appbar title
183
+ *
184
+ * @param viewId
185
+ * @param title
186
+ */
187
+ updateAppBarTitle = (viewId, title) => {
188
+ console.log('updateAppBarTitle VIEW LENGTH : ', this.views.length);
189
+ for (const view1 of this.views) {
190
+ console.log('updateAppBarTitle VIEW : ', view1.config.id);
191
+ }
192
+ let view = this.getView(viewId);
193
+ if (!view) {
194
+ return;
195
+ }
196
+ let legendIconArrow = LEGEND_ARROW_ICON.replace('__COLOR__', this.props.secondaryColor);
197
+ let titleValue = '';
198
+ if (!title.match(_DynamicJS.TEMPLATE_REGEX)) {
199
+ titleValue = title;
200
+ } else {
201
+ titleValue = _DynamicJS.default.executeScript(viewId + 'Title', title, viewId);
202
+ }
203
+ if (!view.popUp && this.graphs.length === 0) {
204
+ for (const navHistoryElement of this.navHistory) {
205
+ if (navHistoryElement.viewId === viewId) {
206
+ navHistoryElement.title = titleValue;
207
+ }
208
+ }
209
+ let legendValue = '<span>';
210
+ let counter = 0;
211
+ for (const navHistoryElement of this.navHistory) {
212
+ legendValue += `${navHistoryElement.title}`;
213
+ if (counter++ < this.navHistory.length - 1) {
214
+ legendValue += legendIconArrow;
215
+ }
216
+ }
217
+ legendValue += '</span>';
218
+ this.props.appBarTitle = legendValue;
219
+ } else if (!view.popUp) {
220
+ let legendPath = '';
221
+ for (let i = 0; i < this.graphs[0].initialNavHistoryDepth && i < this.navHistory.length; i++) {
222
+ legendPath += `${this.navHistory[i].title}`;
223
+ if (i < this.graphs[0].initialNavHistoryDepth - 1) {
224
+ legendPath += legendIconArrow;
225
+ }
226
+ }
227
+ legendPath = legendPath.length > 0 ? legendPath + legendIconArrow : '';
228
+ this.props.appBarTitle = this.graphs[0].initialNavHistoryDepth === 0 ? titleValue : `${legendPath}<span>${this.graphs[0].title}</span>`;
229
+ this.graphs[0].setCurrentNodeTitle(titleValue);
230
+ }
231
+ let property = {};
232
+ property.name = 'title';
233
+ property.value = this.props.appBarTitle;
234
+ let event = new _Event.default(this, SYSTEM_EVENT, property);
235
+ _Observable.default.fireEvent(_EventType.default.APPLICATION_CONTEXT_CHANGE, event);
236
+ if (!view.popUp && this.graphs.length > 0) {
237
+ property = {};
238
+ property.name = 'stepperTitle';
239
+ let event = new _Event.default(this, SYSTEM_EVENT, property);
240
+ _Observable.default.fireEvent(_EventType.default.APPLICATION_CONTEXT_CHANGE, event);
241
+ }
242
+ };
243
+
244
+ /**
245
+ * set viewport history
246
+ *
247
+ * @param history
248
+ */
249
+ setViewPortHistory = history => {
250
+ this.props.viewPortHistory = history;
251
+ };
252
+
253
+ /**
254
+ * get viewport history
255
+ *
256
+ * @returns viewport history
257
+ */
258
+ getViewPortHistory = () => {
259
+ return this.props.viewPortHistory;
260
+ };
261
+
262
+ /**
263
+ * clears all views
264
+ *
265
+ */
266
+ clear = () => {
267
+ _Observable.default.clearAllEventListeners();
268
+ this.views.splice(0, this.views.length);
269
+ this.fileCache.splice(0, this.fileCache.length);
270
+ };
271
+
272
+ /**
273
+ *
274
+ */
275
+ getPreviousHistoryElement = () => {
276
+ if (this.navHistory.length > 1) {
277
+ return this.navHistory[this.navHistory.length - 2];
278
+ }
279
+ return null;
280
+ };
281
+ getFileDomainCache = domain => {
282
+ for (const fileCacheElement of this.fileCache) {
283
+ if (fileCacheElement.domain === domain) {
284
+ return fileCacheElement;
285
+ }
286
+ }
287
+ return null;
288
+ };
289
+
290
+ /**
291
+ * add view configuration
292
+ *
293
+ * @param domain
294
+ * @param file
295
+ */
296
+ addFile = (domain, file) => {
297
+ if (_Utils.default.isNull(domain)) {
298
+ console.error('Please specify file domain');
299
+ return;
300
+ }
301
+ let fileDomainCache = this.getFileDomainCache(domain);
302
+ if (fileDomainCache === null) {
303
+ fileDomainCache = {};
304
+ fileDomainCache.domain = domain;
305
+ fileDomainCache.files = [];
306
+ this.fileCache.push(fileDomainCache);
307
+ }
308
+ let cachedFile = null;
309
+ for (const domainFile of fileDomainCache.files) {
310
+ if (domainFile.correlationId === file.correlationId) {
311
+ cachedFile = domainFile;
312
+ }
313
+ }
314
+ if (cachedFile === null) {
315
+ fileDomainCache.files.push(file);
316
+ } else {
317
+ cachedFile.content = file.content;
318
+ }
319
+ };
320
+ updateContext = values => {
321
+ _Observable.default.emitContextChangeEvent(applicationContext, values);
322
+ Object.keys(values).forEach(key => {
323
+ applicationContext[key] = values[key];
324
+ });
325
+ };
326
+ /**
327
+ * add view configuration
328
+ *
329
+ * @param view the listener to be added
330
+ * @param path
331
+ * @param forward
332
+ */
333
+ addView = (view, path, forward) => {
334
+ if (!view.popUp && !view.window) {
335
+ let topView = this.getTopAnchorView();
336
+ if (topView) {
337
+ this.closeView(topView?.config.id);
338
+ }
339
+ } else {
340
+ if (view.popUp) {
341
+ this.props.confirmationDialogController.openPopupView(view);
256
342
  }
257
-
258
- var cachedFile = null;
259
-
260
- var _iterator5 = _createForOfIteratorHelper(fileDomainCache.files),
261
- _step5;
262
-
263
- try {
264
- for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
265
- var domainFile = _step5.value;
266
-
267
- if (domainFile.correlationId === file.correlationId) {
268
- cachedFile = domainFile;
269
- }
343
+ if (view.window) {
344
+ let topView = this.getTopWindowView();
345
+ if (topView) {
346
+ this.closeView(topView?.config.id);
270
347
  }
271
- } catch (err) {
272
- _iterator5.e(err);
273
- } finally {
274
- _iterator5.f();
275
348
  }
276
-
277
- if (cachedFile === null) {
278
- fileDomainCache.files.push(file);
279
- } else {
280
- cachedFile.content = file.content;
349
+ }
350
+ if (view.parent) {
351
+ this.navHistory.splice(0, this.navHistory.length);
352
+ for (const contextView of this.views) {
353
+ let shouldClose = view.window && contextView.window || !view.window && !contextView.window;
354
+ if (!_Utils.default.isNull(contextView) && !_Utils.default.isNull(contextView.handle.api) && shouldClose) {
355
+ this.closeView(contextView.handle.api.id, forward);
356
+ }
281
357
  }
282
- });
283
-
284
- _defineProperty(this, "updateContext", function (values) {
285
- _Observable.default.emitContextChangeEvent(applicationContext, values);
286
-
287
- Object.keys(values).forEach(function (key) {
288
- applicationContext[key] = values[key];
358
+ }
359
+ let historyElement = {};
360
+ historyElement.viewId = view.config.id;
361
+ historyElement.parent = view.parent;
362
+ historyElement.path = path;
363
+ this.navHistory.push(historyElement);
364
+ this.views.push(view);
365
+ if (view.window) {
366
+ _Observable.default.emitContextChangeEvent(applicationContext, {
367
+ windowView: view
289
368
  });
290
- });
291
-
292
- _defineProperty(this, "addView", function (view, path, forward) {
293
- if (!view.popUp && !view.window) {
294
- var topView = _this.getTopAnchorView();
295
-
296
- if (topView) {
297
- _this.closeView(topView === null || topView === void 0 ? void 0 : topView.config.id);
298
- }
299
- } else {
300
- if (view.popUp) {
301
- _this.props.confirmationDialogController.openPopupView(view);
302
- }
303
-
304
- if (view.window) {
305
- var _topView = _this.getTopWindowView();
369
+ applicationContext.windowView = view;
370
+ }
371
+ let currentGraph = this.graphs.length > 0 ? this.graphs[this.graphs.length - 1] : null;
372
+ if (!view.window && view.parent && currentGraph && currentGraph.config.isWindow) {
373
+ currentGraph.anchorView = view;
374
+ currentGraph.anchorHistoryElement = this.navHistory[this.navHistory.length - 1];
375
+ currentGraph.initialNavHistoryDepth = 0;
376
+ this.updateContext({
377
+ windowDisplayState: 'PINNED'
378
+ });
379
+ }
380
+ };
306
381
 
307
- if (_topView) {
308
- _this.closeView(_topView === null || _topView === void 0 ? void 0 : _topView.config.id);
382
+ /**
383
+ * closes the current view
384
+ *
385
+ */
386
+ closeAllViews = () => {
387
+ for (const view of this.views) {
388
+ this.closeView(view.config.id, false);
389
+ }
390
+ _Observable.default.emitContextChangeEvent(applicationContext, {
391
+ windowView: null
392
+ });
393
+ applicationContext.windowView = null;
394
+ };
395
+
396
+ /**
397
+ * closes the specified view
398
+ *
399
+ * @param viewId the listener to be added
400
+ * @param forward
401
+ */
402
+ closeView = (viewId, forward) => {
403
+ let view = this.getView(viewId);
404
+ if (view) {
405
+ if (!_Utils.default.isNull(view) && !_Utils.default.isNull(view.handle.api)) {
406
+ _Observable.default.clearEventListeners(viewId);
407
+ for (let i = 0; i < this.fileCache.length; i++) {
408
+ let cacheElement = this.fileCache[i];
409
+ if (cacheElement.domain === viewId) {
410
+ this.fileCache.slice(i, 1);
411
+ break;
309
412
  }
310
413
  }
311
- }
312
-
313
- if (view.parent) {
314
- _this.navHistory.splice(0, _this.navHistory.length);
315
-
316
- var _iterator6 = _createForOfIteratorHelper(_this.views),
317
- _step6;
318
-
319
- try {
320
- for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
321
- var contextView = _step6.value;
322
- var shouldClose = view.window && contextView.window || !view.window && !contextView.window;
323
-
324
- if (!_Utils.default.isNull(contextView) && !_Utils.default.isNull(contextView.handle.api) && shouldClose) {
325
- _this.closeView(contextView.handle.api.id, forward);
414
+ let count = 0;
415
+ for (const view of this.views) {
416
+ if (view.handle.api.id === viewId) {
417
+ this.views.splice(count, 1);
418
+ if (!view.popUp && !view.parent && (_Utils.default.isNull(forward) || forward === false)) {
419
+ let viewIndex = this.navHistory.findIndex(h => h.viewId === viewId);
420
+ if (viewIndex >= 0) {
421
+ this.navHistory.splice(viewIndex, 1);
422
+ }
423
+ } else if (view.popUp) {
424
+ this.props.confirmationDialogController.closePopupView();
326
425
  }
327
426
  }
328
- } catch (err) {
329
- _iterator6.e(err);
330
- } finally {
331
- _iterator6.f();
427
+ count++;
332
428
  }
333
429
  }
334
-
335
- var historyElement = {};
336
- historyElement.viewId = view.config.id;
337
- historyElement.parent = view.parent;
338
- historyElement.path = path;
339
-
340
- _this.navHistory.push(historyElement);
341
-
342
- _this.views.push(view);
343
-
344
- if (view.window) {
430
+ let hasWindow = false;
431
+ for (const viewsElement of this.views) {
432
+ if (viewsElement.window) {
433
+ hasWindow = true;
434
+ break;
435
+ }
436
+ }
437
+ if (!hasWindow) {
345
438
  _Observable.default.emitContextChangeEvent(applicationContext, {
346
- windowView: view
439
+ windowView: null
347
440
  });
348
-
349
- applicationContext.windowView = view;
441
+ applicationContext.windowView = null;
350
442
  }
351
-
352
- var currentGraph = _this.graphs.length > 0 ? _this.graphs[_this.graphs.length - 1] : null;
353
-
354
- if (!view.window && view.parent && currentGraph && currentGraph.config.isWindow) {
355
- currentGraph.anchorView = view;
356
- currentGraph.anchorHistoryElement = _this.navHistory[_this.navHistory.length - 1];
357
- currentGraph.initialNavHistoryDepth = 0;
358
-
359
- _this.updateContext({
360
- windowDisplayState: 'PINNED'
443
+ if (view.window) {
444
+ this.updateContext({
445
+ windowDisplayState: 'CLOSED'
361
446
  });
362
447
  }
363
- });
364
-
365
- _defineProperty(this, "closeAllViews", function () {
366
- var _iterator7 = _createForOfIteratorHelper(_this.views),
367
- _step7;
368
-
369
- try {
370
- for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
371
- var view = _step7.value;
372
-
373
- _this.closeView(view.config.id, false);
374
- }
375
- } catch (err) {
376
- _iterator7.e(err);
377
- } finally {
378
- _iterator7.f();
379
- }
380
-
381
- _Observable.default.emitContextChangeEvent(applicationContext, {
382
- windowView: null
383
- });
384
-
385
- applicationContext.windowView = null;
386
- });
387
-
388
- _defineProperty(this, "closeView", function (viewId, forward) {
389
- var view = _this.getView(viewId);
390
-
391
- if (view) {
392
- if (!_Utils.default.isNull(view) && !_Utils.default.isNull(view.handle.api)) {
393
- _Observable.default.clearEventListeners(viewId);
394
-
395
- for (var i = 0; i < _this.fileCache.length; i++) {
396
- var cacheElement = _this.fileCache[i];
397
-
398
- if (cacheElement.domain === viewId) {
399
- _this.fileCache.slice(i, 1);
400
-
401
- break;
402
- }
403
- }
404
-
405
- var count = 0;
406
-
407
- var _iterator8 = _createForOfIteratorHelper(_this.views),
408
- _step8;
409
-
410
- try {
411
- for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
412
- var _view = _step8.value;
413
-
414
- if (_view.handle.api.id === viewId) {
415
- _this.views.splice(count, 1);
416
-
417
- if (!_view.popUp && !_view.parent && (_Utils.default.isNull(forward) || forward === false)) {
418
- var viewIndex = _this.navHistory.findIndex(function (h) {
419
- return h.viewId === viewId;
420
- });
421
-
422
- if (viewIndex >= 0) {
423
- _this.navHistory.splice(viewIndex, 1);
424
- }
425
- } else if (_view.popUp) {
426
- _this.props.confirmationDialogController.closePopupView();
427
- }
428
- }
429
-
430
- count++;
431
- }
432
- } catch (err) {
433
- _iterator8.e(err);
434
- } finally {
435
- _iterator8.f();
436
- }
437
- }
438
-
439
- var hasWindow = false;
440
-
441
- var _iterator9 = _createForOfIteratorHelper(_this.views),
442
- _step9;
443
-
444
- try {
445
- for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
446
- var viewsElement = _step9.value;
447
-
448
- if (viewsElement.window) {
449
- hasWindow = true;
450
- break;
451
- }
452
- }
453
- } catch (err) {
454
- _iterator9.e(err);
455
- } finally {
456
- _iterator9.f();
457
- }
458
-
459
- if (!hasWindow) {
460
- _Observable.default.emitContextChangeEvent(applicationContext, {
461
- windowView: null
462
- });
463
-
464
- applicationContext.windowView = null;
465
- }
448
+ }
449
+ };
466
450
 
467
- if (view.window) {
468
- _this.updateContext({
469
- windowDisplayState: 'CLOSED'
470
- });
471
- }
451
+ /**
452
+ * Returns a view configuration with a particular id
453
+ *
454
+ */
455
+ getView = id => {
456
+ for (const view of this.views) {
457
+ if (id === view.config.id) {
458
+ return view;
472
459
  }
473
- });
474
-
475
- _defineProperty(this, "getView", function (id) {
476
- var _iterator10 = _createForOfIteratorHelper(_this.views),
477
- _step10;
478
-
479
- try {
480
- for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
481
- var view = _step10.value;
482
-
483
- if (id === view.config.id) {
484
- return view;
485
- }
486
- }
487
- } catch (err) {
488
- _iterator10.e(err);
489
- } finally {
490
- _iterator10.f();
460
+ }
461
+ return null;
462
+ };
463
+ getViewComponent = (view, id) => {
464
+ if (!_Utils.default.isNull(view) && !_Utils.default.isNull(view.handle) && !_Utils.default.isNull(view.handle.api)) {
465
+ if (id === view.handle.api.id) {
466
+ return view.handle.api;
491
467
  }
492
-
493
- return null;
494
- });
495
-
496
- _defineProperty(this, "getViewComponent", function (view, id) {
497
- if (!_Utils.default.isNull(view) && !_Utils.default.isNull(view.handle) && !_Utils.default.isNull(view.handle.api)) {
498
- if (id === view.handle.api.id) {
499
- return view.handle.api;
500
- }
501
-
502
- var handle = view.handle.api.getChild(id);
503
-
504
- if (handle) {
505
- return handle.api;
506
- }
507
-
508
- if (id === 'view') {
509
- return view.handle.api;
510
- }
511
- } else {
512
- if (id === 'trainingScheduleCalendarEventForm') {
513
- console.log('NO HANDLES');
514
- }
468
+ let handle = view.handle.api.getChild(id);
469
+ if (handle) {
470
+ return handle.api;
515
471
  }
516
- });
517
-
518
- _defineProperty(this, "resolveComponentApi", function (id) {
519
- if (APP_VARIABLE === id) {
520
- return _this.api;
472
+ if (id === 'view') {
473
+ return view.handle.api;
521
474
  }
522
-
523
- var _iterator11 = _createForOfIteratorHelper(_this.graphs),
524
- _step11;
525
-
526
- try {
527
- for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
528
- var graph = _step11.value;
529
-
530
- if (graph.id === id) {
531
- return graph;
532
- }
533
- }
534
- } catch (err) {
535
- _iterator11.e(err);
536
- } finally {
537
- _iterator11.f();
475
+ } else {
476
+ if (id === 'trainingScheduleCalendarEventForm') {
477
+ console.log('NO HANDLES');
538
478
  }
479
+ }
480
+ };
539
481
 
540
- if (_this.views.length === 0) {
541
- return _this.getViewComponent(_this.props.dashboardView, id);
482
+ /**
483
+ * Returns a view configuration with a particular id
484
+ *
485
+ */
486
+ resolveComponentApi = id => {
487
+ if (APP_VARIABLE === id) {
488
+ return this.api;
489
+ }
490
+ for (const graph of this.graphs) {
491
+ if (graph.id === id) {
492
+ return graph;
542
493
  }
543
-
544
- var _iterator12 = _createForOfIteratorHelper(_this.views),
545
- _step12;
546
-
547
- try {
548
- for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
549
- var view = _step12.value;
550
-
551
- var component = _this.getViewComponent(view, id);
552
-
553
- if (component) {
554
- return component;
555
- }
556
- }
557
- } catch (err) {
558
- _iterator12.e(err);
559
- } finally {
560
- _iterator12.f();
494
+ }
495
+ if (this.views.length === 0) {
496
+ return this.getViewComponent(this.props.dashboardView, id);
497
+ }
498
+ for (const view of this.views) {
499
+ let component = this.getViewComponent(view, id);
500
+ if (component) {
501
+ return component;
561
502
  }
503
+ }
504
+ return null;
505
+ };
562
506
 
563
- return null;
564
- });
565
-
566
- _defineProperty(this, "populateTemplate", function (template, eventData) {
567
- var matches = template.match(TEMPLATE_TOKEN_REGEX);
568
-
569
- if (!_Utils.default.isNull(matches)) {
570
- var _iterator13 = _createForOfIteratorHelper(matches),
571
- _step13;
572
-
573
- try {
574
- for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
575
- var match = _step13.value;
576
- var expresionContent = match.substring(match.indexOf('{') + 1, match.lastIndexOf('}'));
577
- var expressionValue = '';
578
-
579
- if (expresionContent.startsWith('$event.data') && !_Utils.default.isNull(eventData)) {
580
- var props = expresionContent.replace('$event.data.', '').split('.');
581
- var vo = eventData;
582
-
583
- var _iterator14 = _createForOfIteratorHelper(props),
584
- _step14;
585
-
586
- try {
587
- for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
588
- var prop = _step14.value;
589
- vo = vo[prop];
590
- }
591
- } catch (err) {
592
- _iterator14.e(err);
593
- } finally {
594
- _iterator14.f();
595
- }
596
-
597
- expressionValue = vo;
598
- } else {
599
- expressionValue = _this.resolveExpressionValue(expresionContent);
600
- }
601
-
602
- template = template.replace(match, expressionValue);
507
+ /**
508
+ * Populate all place holders in the given template
509
+ *
510
+ */
511
+ populateTemplate = (template, eventData) => {
512
+ let matches = template.match(TEMPLATE_TOKEN_REGEX);
513
+ if (!_Utils.default.isNull(matches)) {
514
+ for (const match of matches) {
515
+ let expresionContent = match.substring(match.indexOf('{') + 1, match.lastIndexOf('}'));
516
+ let expressionValue = '';
517
+ if (expresionContent.startsWith('$event.data') && !_Utils.default.isNull(eventData)) {
518
+ let props = expresionContent.replace('$event.data.', '').split('.');
519
+ let vo = eventData;
520
+ for (const prop of props) {
521
+ vo = vo[prop];
603
522
  }
604
- } catch (err) {
605
- _iterator13.e(err);
606
- } finally {
607
- _iterator13.f();
523
+ expressionValue = vo;
524
+ } else {
525
+ expressionValue = this.resolveExpressionValue(expresionContent);
608
526
  }
527
+ template = template.replace(match, expressionValue);
609
528
  }
610
-
611
- return template;
612
- });
613
-
614
- _defineProperty(this, "resolveExpressionValue", function (expression) {
615
- var eventData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
616
- var paramExpression = expression.match(/\(([^)]*)\)/);
617
- var isEvent = expression.startsWith('$event.data');
618
- var baseExpression = isEvent ? '$event.data' : !_Utils.default.isNull(paramExpression) && paramExpression.length > 0 ? expression.replace(paramExpression[0], '') : expression;
619
- var expressionContent = baseExpression.substring(baseExpression.indexOf('{') + 1, baseExpression.indexOf('}'));
620
- var isComponent = baseExpression.startsWith('@#{');
621
- var isLib = baseExpression.startsWith('@@{');
622
- var tokens = expressionContent.split('.');
623
- var idToken = tokens[0];
624
-
529
+ }
530
+ return template;
531
+ };
532
+ resolveExpressionValue = (() => {
533
+ var _this = this;
534
+ return function (expression) {
535
+ let eventData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
536
+ let paramExpression = expression.match(/\(([^)]*)\)/);
537
+ let isEvent = expression.startsWith('$event.data');
538
+ let baseExpression = isEvent ? '$event.data' : !_Utils.default.isNull(paramExpression) && paramExpression.length > 0 ? expression.replace(paramExpression[0], '') : expression;
539
+ let expressionContent = baseExpression.substring(baseExpression.indexOf('{') + 1, baseExpression.indexOf('}'));
540
+ let isComponent = baseExpression.startsWith('@#{');
541
+ let isLib = baseExpression.startsWith('@@{');
542
+ let tokens = expressionContent.split('.');
543
+ let idToken = tokens[0];
625
544
  if (isComponent || isEvent) {
626
- var value = isEvent ? eventData : _this.resolveComponentApi(expressionContent);
627
- var expressionClosure = isEvent ? 'data.' : '}.';
628
- var index = expression.indexOf(expressionClosure);
629
-
545
+ let value = isEvent ? eventData : _this.resolveComponentApi(expressionContent);
546
+ let expressionClosure = isEvent ? 'data.' : '}.';
547
+ let index = expression.indexOf(expressionClosure);
630
548
  if (index > 0) {
631
- var propertyChain = expression.substring(index + expressionClosure.length);
632
- var props = propertyChain.split('.');
633
-
634
- var _iterator15 = _createForOfIteratorHelper(props),
635
- _step15;
636
-
637
- try {
638
- for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
639
- var prop = _step15.value;
640
-
641
- if (_Utils.default.isNull(value)) {
642
- return null;
643
- }
644
-
645
- value = value[prop];
646
-
647
- if (typeof value === 'function') {
648
- value = value();
649
- }
549
+ let propertyChain = expression.substring(index + expressionClosure.length);
550
+ let props = propertyChain.split('.');
551
+ for (const prop of props) {
552
+ if (_Utils.default.isNull(value)) {
553
+ return null;
554
+ }
555
+ value = value[prop];
556
+ if (typeof value === 'function') {
557
+ value = value();
650
558
  }
651
- } catch (err) {
652
- _iterator15.e(err);
653
- } finally {
654
- _iterator15.f();
655
559
  }
656
560
  }
657
-
658
561
  return value;
659
562
  } else if (isLib) {
660
563
  /*if (idToken === 'view') {
661
564
  idToken = this.getCurrentView().config.id + '_lib';
662
565
  }*/
566
+
663
567
  return _this.libs[idToken];
664
568
  }
665
-
666
569
  return expression;
667
- });
668
-
669
- _defineProperty(this, "setExpressionValues", function (obj) {
670
- var eventData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
671
- var isArray = Array.isArray(obj);
672
- var updated = isArray ? [] : {};
673
- Object.keys(obj).forEach(function (key) {
674
- if (_typeof(obj[key]) === 'object' && obj[key] !== null) {
675
- updated[key] = _this.setExpressionValues(obj[key], eventData);
570
+ };
571
+ })();
572
+ setExpressionValues = (() => {
573
+ var _this2 = this;
574
+ return function (obj) {
575
+ let eventData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
576
+ let isArray = Array.isArray(obj);
577
+ const updated = isArray ? [] : {};
578
+ Object.keys(obj).forEach(key => {
579
+ if (typeof obj[key] === 'object' && obj[key] !== null) {
580
+ updated[key] = _this2.setExpressionValues(obj[key], eventData);
676
581
  } else {
677
- var objValue = obj[key];
678
-
582
+ let objValue = obj[key];
679
583
  if (typeof objValue === 'function') {
680
584
  objValue = objValue();
681
585
  }
682
-
683
586
  if (typeof objValue === 'undefined') {
684
587
  objValue = null;
685
588
  }
686
-
687
- if (_this.isExpression(objValue)) {
688
- var scriptValue = _DynamicJS.default.executeScript("resolveParam_".concat(Math.random().toString().replace('.', '_')), objValue);
689
-
589
+ if (_this2.isExpression(objValue)) {
590
+ let scriptValue = _DynamicJS.default.executeScript(`resolveParam_${Math.random().toString().replace('.', '_')}`, objValue);
690
591
  if (typeof scriptValue === 'undefined') {
691
592
  scriptValue = null;
692
593
  }
693
-
694
- var objKey = key === 'valueExpression' ? 'value' : key;
594
+ let objKey = key === 'valueExpression' ? 'value' : key;
695
595
  updated[objKey] = scriptValue !== null && scriptValue.instanceType === 'TypedValue' ? scriptValue.value : scriptValue;
696
-
697
596
  if (typeof updated[objKey] === 'undefined') {
698
597
  delete updated.type;
699
598
  }
@@ -703,467 +602,199 @@ var ApplicationManager = /*#__PURE__*/function () {
703
602
  }
704
603
  });
705
604
  return updated;
706
- });
707
-
708
- _defineProperty(this, "resolveParameterConfigValue", function (configValue, eventData) {
709
- if (!configValue) {
710
- return configValue;
711
- }
605
+ };
606
+ })();
607
+ fillEventDataValue(obj, eventData) {
608
+ if (obj) {
609
+ Object.keys(obj).forEach(key => {
610
+ let val = obj[key];
611
+ if (typeof val === 'object') {
612
+ this.fillEventDataValue(val, eventData);
613
+ }
614
+ if (val === '$event.data') {
615
+ obj[key] = eventData;
616
+ }
617
+ });
618
+ return obj;
619
+ }
620
+ return null;
621
+ }
712
622
 
713
- if (_this.isExpression(configValue)) {
714
- return _this.resolveExpressionValue(configValue, eventData);
623
+ /**
624
+ * Returns a view configuration with a particular id
625
+ *
626
+ */
627
+ resolveParameterConfigValue = (configValue, eventData) => {
628
+ if (!configValue) {
629
+ return configValue;
630
+ }
631
+ if (this.isExpression(configValue)) {
632
+ return this.resolveExpressionValue(configValue, eventData);
633
+ } else {
634
+ let json = JSON.stringify(configValue);
635
+ let matches = json.match(_DynamicJS.TEMPLATE_REGEX);
636
+ if (!_Utils.default.isNull(matches)) {
637
+ return this.setExpressionValues(configValue);
715
638
  } else {
716
- var json = JSON.stringify(configValue);
717
- var matches = json.match(_DynamicJS.TEMPLATE_REGEX);
718
-
719
- if (!_Utils.default.isNull(matches)) {
720
- return _this.setExpressionValues(configValue);
721
- } else {
722
- return configValue;
723
- }
639
+ return configValue;
724
640
  }
725
- });
726
-
727
- _defineProperty(this, "resolveParameterValue", function (parameterConfig) {
728
- var eventData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
729
- var expression = parameterConfig.value.toString();
730
- var isEvent = expression.startsWith('$event.data');
641
+ }
642
+ };
643
+ isExpression(objValue) {
644
+ return objValue && objValue.toString().startsWith('$event.data') || !_Utils.default.isNull(objValue) && typeof objValue === 'string' && !_Utils.default.isNull(objValue.match(_DynamicJS.TEMPLATE_REGEX));
645
+ }
731
646
 
647
+ /**
648
+ * Returns a view configuration with a particular id
649
+ *
650
+ */
651
+ resolveParameterValue = (() => {
652
+ var _this3 = this;
653
+ return function (parameterConfig) {
654
+ let eventData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
655
+ let expression = parameterConfig.value.toString();
656
+ let isEvent = expression.startsWith('$event.data');
732
657
  if (isEvent) {
733
- var value = eventData;
734
- var expressionClosure = 'data.';
735
- var index = expression.indexOf(expressionClosure);
736
-
658
+ let value = eventData;
659
+ let expressionClosure = 'data.';
660
+ let index = expression.indexOf(expressionClosure);
737
661
  if (index > 0) {
738
- var propertyChain = expression.substring(index + expressionClosure.length);
739
- var props = propertyChain.split('.');
740
-
741
- var _iterator16 = _createForOfIteratorHelper(props),
742
- _step16;
743
-
744
- try {
745
- for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
746
- var prop = _step16.value;
747
-
748
- if (_Utils.default.isNull(value)) {
749
- return null;
750
- }
751
-
752
- value = value[prop];
662
+ let propertyChain = expression.substring(index + expressionClosure.length);
663
+ let props = propertyChain.split('.');
664
+ for (const prop of props) {
665
+ if (_Utils.default.isNull(value)) {
666
+ return null;
753
667
  }
754
- } catch (err) {
755
- _iterator16.e(err);
756
- } finally {
757
- _iterator16.f();
668
+ value = value[prop];
758
669
  }
759
670
  }
760
-
761
671
  return value;
762
672
  }
763
-
764
- var val = null;
765
-
673
+ let val = null;
766
674
  if (_Utils.default.isNull(parameterConfig.value)) {
767
675
  console.error('NULL parameter value expression in : ' + JSON.stringify(parameterConfig));
768
676
  return null;
769
677
  }
770
-
771
- if (!_this.isExpression(parameterConfig.value)) {
772
- val = _this.resolveParameterConfigValue(parameterConfig.value);
678
+ if (!_this3.isExpression(parameterConfig.value)) {
679
+ val = _this3.resolveParameterConfigValue(parameterConfig.value);
773
680
  } else {
774
- var _expression = parameterConfig.value;
775
- val = _DynamicJS.default.executeScript("resolveParam_".concat(Math.random().toString().replace('.', '_')), _expression);
681
+ let expression = parameterConfig.value;
682
+ val = _DynamicJS.default.executeScript(`resolveParam_${Math.random().toString().replace('.', '_')}`, expression);
776
683
  }
777
-
778
684
  if (_Utils.default.isNull(val)) {
779
685
  return null;
780
686
  }
781
-
782
687
  if (!_Utils.default.isNull(val) && !_Utils.default.isNull(val.instanceType) && val.instanceType === 'TypedValue') {
783
688
  if (!_Utils.default.isNull(parameterConfig.type)) {
784
689
  val.type = parameterConfig.type;
785
690
  }
786
-
787
691
  return val;
788
692
  }
789
-
790
- var type = null;
791
-
693
+ let type = null;
792
694
  if (!_Utils.default.isNull(parameterConfig.type)) {
793
695
  type = parameterConfig.type;
794
696
  } else if (val !== null) {
795
- type = _typeof(val);
697
+ type = typeof val;
796
698
  }
797
-
798
699
  return new _TypedValue.default(type, val);
799
- });
800
-
801
- _defineProperty(this, "setModelValue", function (key, value, viewId) {
802
- _this.getView(viewId).handle.api.setModelValue(key, value);
803
-
804
- _Observable.default.processSystemGeneratedSubscriptions(viewId);
805
- });
806
-
807
- _defineProperty(this, "getId", function () {
808
- return 'applicationManager';
809
- });
810
-
811
- if (!ApplicationManager.instance) {
812
- this.views = [];
813
- this.props = {};
814
- this.listeners = [];
815
- this.libs = {};
816
- this.navHistory = [];
817
- this.fileCache = [];
818
- this.graphs = [];
819
- this.api = {
820
- get id() {
821
- return instance.getId();
822
- },
823
-
824
- refreshUserAvatar: function refreshUserAvatar(avatar) {
825
- instance.refreshUserAvatar(avatar);
826
- },
827
- alert: function alert(viewId, message, messageType) {
828
- instance.alert(viewId, message, messageType);
829
- },
830
- removeLoadedGraph: function removeLoadedGraph(routeToAnchor) {
831
- instance.removeLoadedGraph(routeToAnchor);
832
- },
833
- hasActiveMeeting: function hasActiveMeeting() {
834
- return instance.hasActiveMeeting();
835
- }
836
- };
837
-
838
- if (!Array.isArray) {
839
- Array.isArray = function (arg) {
840
- return Object.prototype.toString.call(arg) === '[object Array]';
841
- };
842
- }
843
-
844
- ApplicationManager.instance = this;
845
- }
846
-
847
- return ApplicationManager.instance;
700
+ };
701
+ })();
702
+
703
+ /**
704
+ * Sets a value to the specified view's model
705
+ * @param key
706
+ * @param value
707
+ * @param viewId
708
+ */
709
+ setModelValue = (key, value, viewId) => {
710
+ this.getView(viewId).handle.api.setModelValue(key, value);
711
+ _Observable.default.processSystemGeneratedSubscriptions(viewId);
712
+ };
713
+ getId = () => {
714
+ return 'applicationManager';
715
+ };
716
+ loadAnchor(graph) {
717
+ this.navHistory.splice(graph.initialNavHistoryDepth - 1, this.navHistory.length);
718
+ this.addView(graph.anchorView, graph.anchorHistoryElement.path, true);
719
+ this.navigate('/view/unload');
720
+ this.navigate('/view/' + graph.anchorView.config.id);
848
721
  }
849
-
850
- _createClass(ApplicationManager, [{
851
- key: "navigate",
852
- value: function navigate(path) {
853
- this.props.navigator(path);
854
- }
855
- }, {
856
- key: "setDashboardSettings",
857
- value: function setDashboardSettings(dashboardSettings) {
858
- this.props.dashboardSettings = dashboardSettings;
859
- }
860
- }, {
861
- key: "getDashboardSettings",
862
- value: function getDashboardSettings() {
863
- return this.props.dashboardSettings;
864
- }
865
- }, {
866
- key: "setNavigator",
867
- value: function setNavigator(navigator) {
868
- this.props.navigator = navigator;
869
- }
870
- }, {
871
- key: "setHasActiveMeeting",
872
- value: function setHasActiveMeeting(hasActiveMeeting) {
873
- this.props.hasActiveMeeting = hasActiveMeeting;
874
- }
875
- }, {
876
- key: "hasActiveMeeting",
877
- value: function hasActiveMeeting() {
878
- return this.props.hasActiveMeeting;
879
- }
880
- }, {
881
- key: "setServiceApiPath",
882
- value: function setServiceApiPath(serviceApiPath) {
883
- this.props.serviceApiPath = serviceApiPath;
884
- }
885
- }, {
886
- key: "getServiceApiPath",
887
- value: function getServiceApiPath() {
888
- return this.props.serviceApiPath;
889
- }
890
- }, {
891
- key: "setUIConfigPath",
892
- value: function setUIConfigPath(uiConfigPath) {
893
- this.props.uiConfigPath = uiConfigPath;
894
- }
895
- }, {
896
- key: "setContextRoot",
897
- value: function setContextRoot(contextRoot) {
898
- this.props.contextRoot = contextRoot;
899
- }
900
- }, {
901
- key: "getContextRoot",
902
- value: function getContextRoot() {
903
- return this.props.contextRoot;
904
- }
905
- }, {
906
- key: "getUIConfigPath",
907
- value: function getUIConfigPath() {
908
- return this.props.uiConfigPath;
909
- }
910
- }, {
911
- key: "setFilesApiPath",
912
- value: function setFilesApiPath(filesApiPath) {
913
- this.props.filesApiPath = filesApiPath;
914
- }
915
- }, {
916
- key: "getFilesApiPath",
917
- value: function getFilesApiPath() {
918
- return this.props.filesApiPath;
919
- }
920
- }, {
921
- key: "addApplicationListener",
922
- value: function addApplicationListener(listener) {
923
- this.listeners.push(listener);
924
- }
925
- }, {
926
- key: "alert",
927
- value: function alert(viewId, message, messageType) {
928
- var event = new _Event.default(this, this.getView(viewId).config.id, {
929
- messageType: messageType,
930
- message: message
931
- });
932
-
933
- _Observable.default.fireEvent(_EventType.default.MESSAGE_ARRIVED, event);
934
- }
935
- }, {
936
- key: "refreshUserAvatar",
937
- value: function refreshUserAvatar(avatar) {
938
- var _iterator17 = _createForOfIteratorHelper(this.listeners),
939
- _step17;
940
-
941
- try {
942
- for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) {
943
- var listener = _step17.value;
944
-
945
- if (listener.type === AVATAR_LISTENER_TYPE) {
946
- listener.handler(avatar);
947
- }
948
- }
949
- } catch (err) {
950
- _iterator17.e(err);
951
- } finally {
952
- _iterator17.f();
953
- }
954
- }
955
- }, {
956
- key: "setApplicationThemeColors",
957
- value: function setApplicationThemeColors(primary, secondary) {
958
- this.props.primaryColor = primary;
959
- this.props.secondaryColor = secondary;
960
- }
961
- }, {
962
- key: "getApplicationPrimaryColor",
963
- value: function getApplicationPrimaryColor() {
964
- return this.props.primaryColor;
965
- }
966
- }, {
967
- key: "getApplicationSecondaryColor",
968
- value: function getApplicationSecondaryColor() {
969
- return this.props.secondaryColor;
970
- }
971
- }, {
972
- key: "openConfirmDialog",
973
- value: function openConfirmDialog(message, resultCallback) {
974
- return this.props.confirmationDialogController.openDialog(message, {
975
- execute: function execute(result) {
976
- resultCallback(result);
977
- }
978
- });
979
- }
980
- }, {
981
- key: "fillEventDataValue",
982
- value: function fillEventDataValue(obj, eventData) {
983
- var _this2 = this;
984
-
985
- if (obj) {
986
- Object.keys(obj).forEach(function (key) {
987
- var val = obj[key];
988
-
989
- if (_typeof(val) === 'object') {
990
- _this2.fillEventDataValue(val, eventData);
991
- }
992
-
993
- if (val === '$event.data') {
994
- obj[key] = eventData;
995
- }
722
+ removeLoadedGraph(routeBackToAnchor) {
723
+ if (this.graphs.length > 0) {
724
+ let graph = this.graphs[this.graphs.length - 1];
725
+ let view = graph.config.isWindow ? this.getTopWindowView() : this.getTopAnchorView();
726
+ this.closeView(view.config.id, false);
727
+ if (!_Utils.default.isNull(graph.anchorHistoryElement) && routeBackToAnchor) {
728
+ this.loadAnchor(graph);
729
+ }
730
+ this.graphs.splice(0, this.graphs.length);
731
+ if (!_Utils.default.isNull(graph.anchorHistoryElement)) {
732
+ this.updateAppBarTitle(graph.anchorView.config.id, graph.anchorView.config.title);
733
+ }
734
+ if (graph.config.isWindow) {
735
+ this.updateContext({
736
+ windowDisplayState: 'CLOSED'
996
737
  });
997
- return obj;
998
- }
999
-
1000
- return null;
1001
- }
1002
- /**
1003
- * Returns a view configuration with a particular id
1004
- *
1005
- */
1006
-
1007
- }, {
1008
- key: "isExpression",
1009
- value: function isExpression(objValue) {
1010
- return objValue && objValue.toString().startsWith('$event.data') || !_Utils.default.isNull(objValue) && typeof objValue === 'string' && !_Utils.default.isNull(objValue.match(_DynamicJS.TEMPLATE_REGEX));
1011
- }
1012
- /**
1013
- * Returns a view configuration with a particular id
1014
- *
1015
- */
1016
-
1017
- }, {
1018
- key: "loadAnchor",
1019
- value: function loadAnchor(graph) {
1020
- this.navHistory.splice(graph.initialNavHistoryDepth - 1, this.navHistory.length);
1021
- this.addView(graph.anchorView, graph.anchorHistoryElement.path, true);
1022
- this.navigate('/view/unload');
1023
- this.navigate('/view/' + graph.anchorView.config.id);
1024
- }
1025
- }, {
1026
- key: "removeLoadedGraph",
1027
- value: function removeLoadedGraph(routeBackToAnchor) {
1028
- if (this.graphs.length > 0) {
1029
- var graph = this.graphs[this.graphs.length - 1];
1030
- var view = graph.config.isWindow ? this.getTopWindowView() : this.getTopAnchorView();
1031
- this.closeView(view.config.id, false);
1032
-
1033
- if (!_Utils.default.isNull(graph.anchorHistoryElement) && routeBackToAnchor) {
1034
- this.loadAnchor(graph);
1035
- }
1036
-
1037
- this.graphs.splice(0, this.graphs.length);
1038
-
1039
- if (!_Utils.default.isNull(graph.anchorHistoryElement)) {
1040
- this.updateAppBarTitle(graph.anchorView.config.id, graph.anchorView.config.title);
1041
- }
1042
-
1043
- if (graph.config.isWindow) {
1044
- this.updateContext({
1045
- windowDisplayState: 'CLOSED'
1046
- });
1047
- }
1048
- }
1049
- }
1050
- }, {
1051
- key: "loadGraph",
1052
- value: function loadGraph(isParent, isPopup, isWindow, config, parameterValues) {
1053
- if (isParent && !isPopup && !isWindow) {
1054
- this.navHistory.splice(0, this.navHistory.length);
1055
-
1056
- var _iterator18 = _createForOfIteratorHelper(this.views),
1057
- _step18;
1058
-
1059
- try {
1060
- for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) {
1061
- var contextView = _step18.value;
1062
- this.closeView(contextView.handle.api.id, false);
1063
- }
1064
- } catch (err) {
1065
- _iterator18.e(err);
1066
- } finally {
1067
- _iterator18.f();
1068
- }
1069
-
1070
- this.getViewPortHistory().push('/switch');
1071
- }
1072
-
1073
- config.isWindow = isWindow;
1074
- var graph = new _Graph.default(_Utils.default.parseConfig(config));
1075
- graph.initialNavHistoryDepth = this.navHistory.length;
1076
-
1077
- if (this.navHistory.length > 0) {
1078
- graph.anchorView = this.getTopAnchorView(); //= this.getCurrentView();
1079
-
1080
- graph.anchorHistoryElement = this.navHistory[this.navHistory.length - 1];
1081
- }
1082
-
1083
- graph.init();
1084
-
1085
- var _iterator19 = _createForOfIteratorHelper(parameterValues),
1086
- _step19;
1087
-
1088
- try {
1089
- for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) {
1090
- var parameterValue = _step19.value;
1091
- graph.model[parameterValue.name] = parameterValue.value;
1092
- }
1093
- } catch (err) {
1094
- _iterator19.e(err);
1095
- } finally {
1096
- _iterator19.f();
1097
738
  }
1098
-
1099
- this.graphs.push(graph);
1100
739
  }
1101
- }, {
1102
- key: "getTopAnchorView",
1103
- value: function getTopAnchorView() {
1104
- for (var i = this.views.length - 1; i >= 0; i--) {
1105
- if (!this.views[i].window) {
1106
- return this.views[i];
1107
- }
740
+ }
741
+ loadGraph(isParent, isPopup, isWindow, config, parameterValues) {
742
+ if (isParent && !isPopup && !isWindow) {
743
+ this.navHistory.splice(0, this.navHistory.length);
744
+ for (const contextView of this.views) {
745
+ this.closeView(contextView.handle.api.id, false);
746
+ }
747
+ this.getViewPortHistory().push('/switch');
748
+ }
749
+ config.isWindow = isWindow;
750
+ let graph = new _Graph.default(_Utils.default.parseConfig(config));
751
+ graph.initialNavHistoryDepth = this.navHistory.length;
752
+ if (this.navHistory.length > 0) {
753
+ graph.anchorView = this.getTopAnchorView(); //= this.getCurrentView();
754
+ graph.anchorHistoryElement = this.navHistory[this.navHistory.length - 1];
755
+ }
756
+ graph.init();
757
+ for (const parameterValue of parameterValues) {
758
+ graph.model[parameterValue.name] = parameterValue.value;
759
+ }
760
+ this.graphs.push(graph);
761
+ }
762
+ getTopAnchorView() {
763
+ for (let i = this.views.length - 1; i >= 0; i--) {
764
+ if (!this.views[i].window) {
765
+ return this.views[i];
1108
766
  }
1109
767
  }
1110
- }, {
1111
- key: "getTopWindowView",
1112
- value: function getTopWindowView() {
1113
- for (var i = this.views.length - 1; i >= 0; i--) {
1114
- if (this.views[i].window) {
1115
- return this.views[i];
1116
- }
768
+ }
769
+ getTopWindowView() {
770
+ for (let i = this.views.length - 1; i >= 0; i--) {
771
+ if (this.views[i].window) {
772
+ return this.views[i];
1117
773
  }
1118
774
  }
1119
- }, {
1120
- key: "signalGraph",
1121
- value: function signalGraph(id, event) {
1122
- if (this.graphs.length > 0) {
1123
- var graphToSignal = this.graphs[this.graphs.length - 1];
1124
-
1125
- var _iterator20 = _createForOfIteratorHelper(this.graphs),
1126
- _step20;
1127
-
1128
- try {
1129
- for (_iterator20.s(); !(_step20 = _iterator20.n()).done;) {
1130
- var graph = _step20.value;
1131
-
1132
- if (id === graph.id) {
1133
- graphToSignal = graph;
1134
- break;
1135
- }
1136
- }
1137
- } catch (err) {
1138
- _iterator20.e(err);
1139
- } finally {
1140
- _iterator20.f();
775
+ }
776
+ signalGraph(id, event) {
777
+ if (this.graphs.length > 0) {
778
+ let graphToSignal = this.graphs[this.graphs.length - 1];
779
+ for (const graph of this.graphs) {
780
+ if (id === graph.id) {
781
+ graphToSignal = graph;
782
+ break;
1141
783
  }
1142
-
1143
- graphToSignal.signal(event);
1144
784
  }
785
+ graphToSignal.signal(event);
1145
786
  }
1146
- }, {
1147
- key: "enableFormMarkers",
1148
- value: function enableFormMarkers(enabled) {
1149
- this.props.formMarkersEnabled = enabled;
1150
- }
1151
- }, {
1152
- key: "isFormMarkersEnabled",
1153
- value: function isFormMarkersEnabled() {
1154
- return this.props.formMarkersEnabled;
1155
- }
1156
- }, {
1157
- key: "setDashboardView",
1158
- value: function setDashboardView(view) {
1159
- this.props.dashboardView = view;
1160
- }
1161
- }]);
1162
-
1163
- return ApplicationManager;
1164
- }();
1165
-
1166
- var instance = new ApplicationManager();
787
+ }
788
+ enableFormMarkers(enabled) {
789
+ this.props.formMarkersEnabled = enabled;
790
+ }
791
+ isFormMarkersEnabled() {
792
+ return this.props.formMarkersEnabled;
793
+ }
794
+ setDashboardView(view) {
795
+ this.props.dashboardView = view;
796
+ }
797
+ }
798
+ const instance = new ApplicationManager();
1167
799
  Object.freeze(instance);
1168
- var _default = instance;
1169
- exports.default = _default;
800
+ var _default = exports.default = instance;