@agilemotion/oui-react-js 1.3.8 → 1.4.0

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 (230) hide show
  1. package/README.TXT +1 -0
  2. package/dist/{ApplicationContext.js → ApplicationManager.js} +334 -335
  3. package/dist/BasicApp.js +67 -64
  4. package/dist/BasicAppHome.js +90 -110
  5. package/dist/BusinessPortalApp.js +1 -1
  6. package/dist/BusinessPortalAppHome.js +15 -50
  7. package/dist/DynamicJS.js +24 -52
  8. package/dist/RestUtils.js +90 -116
  9. package/dist/Utils.js +49 -37
  10. package/dist/WithRouter.js +34 -0
  11. package/dist/assets/jss/components/authNavbarStyle.js +34 -35
  12. package/dist/assets/jss/components/cardHeaderStyle.js +12 -12
  13. package/dist/assets/jss/components/customDropdownStyle.js +26 -26
  14. package/dist/assets/jss/components/customInputStyle.js +2 -8
  15. package/dist/assets/jss/components/dropdownStyle.js +10 -15
  16. package/dist/assets/jss/components/footerStyle.js +12 -18
  17. package/dist/assets/jss/components/headerLinksStyle.js +7 -13
  18. package/dist/assets/jss/components/headerStyle.js +24 -25
  19. package/dist/assets/jss/components/navbarLinksStyle.js +7 -13
  20. package/dist/assets/jss/components/navbarStyle.js +24 -25
  21. package/dist/assets/jss/components/sidebarStyle.js +41 -43
  22. package/dist/assets/jss/components/typographyStyle.js +2 -8
  23. package/dist/assets/jss/rootStyle.js +32 -47
  24. package/dist/assets/jss/views/layoutStyle.js +6 -11
  25. package/dist/assets/jss/views/loginStyle.js +4 -10
  26. package/dist/assets/lotties/call-loading.json +1 -0
  27. package/dist/assets/lotties/calling-2.json +1 -0
  28. package/dist/assets/lotties/calling.json +1 -0
  29. package/dist/assets/lotties/calling2.json +1 -0
  30. package/dist/assets/lotties/chat.json +1 -0
  31. package/dist/assets/lotties/join.json +1 -0
  32. package/dist/assets/lotties/loading.json +1 -0
  33. package/dist/assets/lotties/msg2.json +1 -0
  34. package/dist/assets/lotties/recording.json +1 -0
  35. package/dist/assets/lotties/waiting.json +1 -0
  36. package/dist/assets/scss/black-dashboard-react/bootstrap/_card.scss +5 -5
  37. package/dist/assets/scss/black-dashboard-react/bootstrap/_carousel.scss +2 -2
  38. package/dist/assets/scss/black-dashboard-react/bootstrap/_custom-forms.scss +3 -3
  39. package/dist/assets/scss/black-dashboard-react/bootstrap/_functions.scss +1 -1
  40. package/dist/assets/scss/black-dashboard-react/bootstrap/_images.scss +1 -1
  41. package/dist/assets/scss/black-dashboard-react/bootstrap/_jumbotron.scss +1 -1
  42. package/dist/assets/scss/black-dashboard-react/bootstrap/_popover.scss +7 -5
  43. package/dist/assets/scss/black-dashboard-react/bootstrap/_tooltip.scss +4 -4
  44. package/dist/assets/scss/black-dashboard-react/bootstrap/_variables.scss +5 -5
  45. package/dist/assets/scss/black-dashboard-react/bootstrap/mixins/_grid-framework.scss +2 -2
  46. package/dist/assets/scss/black-dashboard-react/bootstrap/mixins/_grid.scss +11 -9
  47. package/dist/assets/scss/black-dashboard-react/bootstrap/utilities/_embed.scss +6 -4
  48. package/dist/assets/scss/black-dashboard-react/custom/_sidebar-and-main-panel.scss +1 -1
  49. package/dist/assets/scss/black-dashboard-react/custom/_variables.scss +1 -1
  50. package/dist/components/AlertBar.js +39 -80
  51. package/dist/components/AlertItem.js +4 -26
  52. package/dist/components/Button.js +49 -52
  53. package/dist/components/Calendar.js +442 -0
  54. package/dist/components/Calender.css +244 -0
  55. package/dist/components/ConfirmationDialog.js +5 -29
  56. package/dist/components/DataGrid.js +207 -345
  57. package/dist/components/DataGridColumn.js +6 -29
  58. package/dist/components/DataGridFilter.js +48 -116
  59. package/dist/components/DataGridHeading.js +11 -19
  60. package/dist/components/Dialog.js +27 -121
  61. package/dist/components/DocumentViewer.js +12 -38
  62. package/dist/components/DocumentViewerComponent.js +2 -20
  63. package/dist/components/FileThumb.js +126 -0
  64. package/dist/components/Graph.js +33 -75
  65. package/dist/components/GraphNode.js +5 -22
  66. package/dist/components/HtmlPanel.js +68 -82
  67. package/dist/components/Icon.js +107 -1
  68. package/dist/components/LoadingIndicator.js +4 -4
  69. package/dist/components/LottieIcon.js +134 -0
  70. package/dist/components/PopupView.js +3 -21
  71. package/dist/components/Portlet.js +100 -0
  72. package/dist/components/RegularButton.js +15 -19
  73. package/dist/components/SignaturePanel.js +9 -40
  74. package/dist/components/SocketManager.js +170 -0
  75. package/dist/components/StepperTitleBar.js +33 -59
  76. package/dist/components/TabPage.js +6 -9
  77. package/dist/components/TabPanel.js +49 -98
  78. package/dist/components/TableCellContent.js +31 -39
  79. package/dist/components/TemplateDesigner.js +114 -158
  80. package/dist/components/TemplateItemEventHandler.js +33 -100
  81. package/dist/components/TemplateTable.js +6 -42
  82. package/dist/components/TitleBar.js +38 -54
  83. package/dist/components/Toolbar.js +67 -182
  84. package/dist/components/Tree.js +29 -66
  85. package/dist/components/card/Card.js +16 -20
  86. package/dist/components/card/CardAvatar.js +9 -13
  87. package/dist/components/card/CardBody.js +13 -17
  88. package/dist/components/card/CardFooter.js +12 -16
  89. package/dist/components/card/CardHeader.js +13 -17
  90. package/dist/components/card/CardIcon.js +6 -10
  91. package/dist/components/card/CardText.js +6 -10
  92. package/dist/components/customInput/CustomInput.js +12 -10
  93. package/dist/components/dashboard/BasicBusinessAppDashboard.js +85 -159
  94. package/dist/components/dashboard/BusinessPortalAppDashboard.js +30 -75
  95. package/dist/components/dashboard/components/Header.js +9 -26
  96. package/dist/components/dashboard/components/LeftDrawer.js +3 -1
  97. package/dist/components/dashboard/components/blackDashboard/fixedPlugin/FixedPlugin.js +1 -1
  98. package/dist/components/dashboard/components/blackDashboard/sidebar/Sidebar.css +7 -0
  99. package/dist/components/dashboard/components/blackDashboard/sidebar/Sidebar.js +189 -79
  100. package/dist/components/footer/Footer.js +6 -18
  101. package/dist/components/form/AddressSearch.js +32 -66
  102. package/dist/components/form/AutoComplete.js +161 -0
  103. package/dist/components/form/BaseField.js +89 -107
  104. package/dist/components/form/DatePicker.js +8 -23
  105. package/dist/components/form/FieldSet.js +161 -191
  106. package/dist/components/form/Form.css +1 -1
  107. package/dist/components/form/Form.js +153 -479
  108. package/dist/components/form/GridField.js +46 -146
  109. package/dist/components/form/IconField.js +35 -0
  110. package/dist/components/form/ImageEditor.js +22 -60
  111. package/dist/components/form/LookupField.js +8 -29
  112. package/dist/components/form/MultiFileUploadField.js +187 -0
  113. package/dist/components/form/RadioGroup.js +10 -26
  114. package/dist/components/form/Section.js +40 -91
  115. package/dist/components/form/SelectItem.js +14 -33
  116. package/dist/components/form/SignatureTemplateDesignerField.js +0 -1
  117. package/dist/components/form/Switch.js +53 -0
  118. package/dist/components/form/TextField.js +10 -17
  119. package/dist/components/form/TimePicker.js +8 -1
  120. package/dist/components/form/TransferList.css +2 -2
  121. package/dist/components/form/TransferList.js +67 -125
  122. package/dist/components/form/UploadField.js +132 -177
  123. package/dist/components/form/fieldset.css +8 -0
  124. package/dist/components/grid/GridContainer.js +5 -9
  125. package/dist/components/grid/GridItem.js +5 -9
  126. package/dist/components/layout/CollapsiblePanel.js +11 -33
  127. package/dist/components/layout/Layout.js +228 -290
  128. package/dist/components/layout/VC.css +17 -0
  129. package/dist/components/layout/View.css +18 -1
  130. package/dist/components/layout/View.js +80 -200
  131. package/dist/components/layout/ViewContainer.css +3 -0
  132. package/dist/components/layout/ViewContainer.js +59 -0
  133. package/dist/components/layout/ViewPort.js +50 -80
  134. package/dist/components/layout/Window.css +18 -0
  135. package/dist/components/layout/Window.js +287 -0
  136. package/dist/components/layout/WindowViewPort.js +71 -0
  137. package/dist/components/loader.css +1 -1
  138. package/dist/components/media/ClosablePanel.css +37 -0
  139. package/dist/components/media/ClosablePanel.js +53 -0
  140. package/dist/components/media/LobbyWaitingList.js +91 -0
  141. package/dist/components/media/MediaSoupHelper.js +223 -0
  142. package/dist/components/media/Recorder.js +235 -0
  143. package/dist/components/media/SideBarContent.css +54 -0
  144. package/dist/components/media/SideBarContent.js +46 -0
  145. package/dist/components/media/SocketRequest.js +20 -0
  146. package/dist/components/media/SocketResponse.js +16 -0
  147. package/dist/components/media/Timer.css +30 -0
  148. package/dist/components/media/Timer.js +88 -0
  149. package/dist/components/media/Toolbar.css +35 -0
  150. package/dist/components/media/Toolbar.js +494 -0
  151. package/dist/components/media/Tracks.js +39 -0
  152. package/dist/components/media/TrainingRoom.js +608 -0
  153. package/dist/components/media/Transports.js +35 -0
  154. package/dist/components/media/VCEventManager.js +74 -0
  155. package/dist/components/media/VCEventType.js +164 -0
  156. package/dist/components/media/VCParticipantList.css +72 -0
  157. package/dist/components/media/VCParticipantList.js +56 -0
  158. package/dist/components/media/VCParticipantListItem.css +73 -0
  159. package/dist/components/media/VCParticipantListItem.js +319 -0
  160. package/dist/components/media/VCRoom.css +42 -0
  161. package/dist/components/media/VCRoom.js +90 -0
  162. package/dist/components/media/VCRoomParticipant.css +25 -0
  163. package/dist/components/media/VCRoomParticipant.js +808 -0
  164. package/dist/components/media/VCRoomRecorder.js +223 -0
  165. package/dist/components/media/VCRoomWorkspace.css +86 -0
  166. package/dist/components/media/VCRoomWorkspace.js +666 -0
  167. package/dist/components/media/Video.css +4 -0
  168. package/dist/components/media/Video.js +131 -0
  169. package/dist/components/media/VideoPlayer.css +10 -0
  170. package/dist/components/media/VideoPlayer.js +86 -0
  171. package/dist/components/media/chat/ChatRoom.js +926 -0
  172. package/dist/components/media/chat/ChatRoomItem.js +83 -0
  173. package/dist/components/media/chat/ChatRoomList.js +78 -0
  174. package/dist/components/media/chat/ChatRooms.scss +567 -0
  175. package/dist/components/menu/CollapsibleMenu.js +2 -19
  176. package/dist/components/menu/MenuBars.js +6 -33
  177. package/dist/components/menu/MenuButton.js +27 -39
  178. package/dist/components/menu/MenuItem.js +3 -20
  179. package/dist/components/menu/MenuLink.js +22 -13
  180. package/dist/components/navbars/AuthNavbar.js +5 -18
  181. package/dist/components/navbars/HomeNavbar.js +5 -7
  182. package/dist/components/navbars/PortalNavbar.js +7 -25
  183. package/dist/components/signatures/AgilitySignaturePanel.js +38 -104
  184. package/dist/components/signatures/AlertItem.js +3 -24
  185. package/dist/components/signatures/DocumentContainer.js +47 -134
  186. package/dist/components/signatures/ImageSignatureInput.js +11 -38
  187. package/dist/components/signatures/MenuButton.js +1 -16
  188. package/dist/components/signatures/Prompt.js +3 -24
  189. package/dist/components/signatures/ResponsiveTable.js +42 -83
  190. package/dist/components/signatures/SearchView.js +13 -50
  191. package/dist/components/signatures/SignatorySearch.js +83 -99
  192. package/dist/components/signatures/SignatorySearchForm.js +11 -17
  193. package/dist/components/signatures/SignatureInput.js +18 -47
  194. package/dist/components/signatures/SignatureInputProps.js +18 -60
  195. package/dist/components/signatures/SignatureTemplateDesigner.js +151 -239
  196. package/dist/components/signatures/Toolbar.js +7 -34
  197. package/dist/components/signatures/ViewUtils.js +2 -6
  198. package/dist/components/typography/Danger.js +3 -1
  199. package/dist/components/typography/Info.js +3 -1
  200. package/dist/components/typography/Link.js +6 -2
  201. package/dist/event/ActionHandlers.js +6 -6
  202. package/dist/event/EventType.js +7 -1
  203. package/dist/event/LoadDataActionHandler.js +1 -1
  204. package/dist/event/Observable.js +80 -174
  205. package/dist/event/RouteActionHandler.js +74 -31
  206. package/dist/event/ServiceCallActionHandler.js +36 -24
  207. package/dist/event/SignalGraphActionHandler.js +2 -2
  208. package/dist/js/Addresses.js +10 -8
  209. package/dist/js/Calendar.js +220 -0
  210. package/dist/js/Media.js +157 -0
  211. package/dist/redux/store/ConfigureStore.js +3 -9
  212. package/dist/redux/store/DashboardStore.js +42 -94
  213. package/dist/redux/store/SecurityStore.js +15 -50
  214. package/dist/view/Dashboard.js +256 -171
  215. package/dist/view/Views.js +30 -0
  216. package/dist/view/security/ChangePasswordBasic.js +29 -80
  217. package/dist/view/security/ForgotPassword.js +13 -46
  218. package/dist/view/security/ForgotPasswordBasic.js +12 -45
  219. package/dist/view/security/Login.js +15 -51
  220. package/dist/view/security/LoginBasic.js +13 -46
  221. package/dist/view/security/LoginBusinessPortal.js +12 -45
  222. package/dist/view/security/ResetPassword.js +13 -51
  223. package/dist/view/security/ResetPasswordBasic.js +27 -75
  224. package/dist/view/security/Security.js +1 -0
  225. package/package.json +31 -25
  226. package/README.md +0 -1623
  227. package/dist/components/dashboard/BasicApp.js +0 -140
  228. package/dist/components/navbars/NavbarLinks.js +0 -212
  229. package/dist/components/signatures/OLD.js +0 -1138
  230. package/gulpfile.js +0 -77
@@ -19,18 +19,12 @@ var _DynamicJS = _interopRequireWildcard(require("./DynamicJS"));
19
19
 
20
20
  var _TypedValue = _interopRequireDefault(require("./TypedValue"));
21
21
 
22
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
22
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
23
23
 
24
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
25
 
26
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
27
 
28
- 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; } } }; }
29
-
30
- 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); }
31
-
32
- 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; }
33
-
34
28
  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; }
35
29
 
36
30
  const APP_VARIABLE = '__DOLLAR_APPLICATION_OUI_SYS_VAR__';
@@ -43,9 +37,18 @@ const TEMPLATE_TOKEN_REGEX = new RegExp('(([$]{1}[{]{1})(([a-zA-Z0-9_$.@#{}[\\]]
43
37
  exports.TEMPLATE_TOKEN_REGEX = TEMPLATE_TOKEN_REGEX;
44
38
  const LEGEND_ARROW_ICON = " <i class=\"fa fa-arrow-right fa-xs\" aria-hidden=\"true\" style='color:__COLOR__'></i> ";
45
39
  exports.LEGEND_ARROW_ICON = LEGEND_ARROW_ICON;
40
+ const applicationContext = {};
46
41
 
47
- class ApplicationContext {
42
+ class ApplicationManager {
48
43
  constructor() {
44
+ _defineProperty(this, "addApplicationContextSubscription", subscription => {
45
+ return new Promise(resolve => {
46
+ _Observable.default.addApplicationContextSubscription(subscription);
47
+
48
+ resolve(applicationContext);
49
+ });
50
+ });
51
+
49
52
  _defineProperty(this, "setConfirmDialogHandler", controller => {
50
53
  this.props.confirmationDialogController = controller;
51
54
  });
@@ -62,16 +65,23 @@ class ApplicationContext {
62
65
  return this.props.applicationHistory;
63
66
  });
64
67
 
65
- _defineProperty(this, "setViewPortHistory", history => {
66
- this.props.viewPortHistory = history;
67
- });
68
-
69
68
  _defineProperty(this, "getAppBarTitle", () => {
70
69
  return this.props.appBarTitle;
71
70
  });
72
71
 
73
72
  _defineProperty(this, "updateAppBarTitle", (viewId, title) => {
73
+ console.log('updateAppBarTitle VIEW LENGTH : ', this.views.length);
74
+
75
+ for (const view1 of this.views) {
76
+ console.log('updateAppBarTitle VIEW : ', view1.config.id);
77
+ }
78
+
74
79
  let view = this.getView(viewId);
80
+
81
+ if (!view) {
82
+ return;
83
+ }
84
+
75
85
  let legendIconArrow = LEGEND_ARROW_ICON.replace('__COLOR__', this.props.secondaryColor);
76
86
  let titleValue = '';
77
87
 
@@ -82,48 +92,27 @@ class ApplicationContext {
82
92
  }
83
93
 
84
94
  if (!view.popUp && this.graphs.length === 0) {
85
- var _iterator = _createForOfIteratorHelper(this.navHistory),
86
- _step;
87
-
88
- try {
89
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
90
- const navHistoryElement = _step.value;
91
-
92
- if (navHistoryElement.viewId === viewId) {
93
- navHistoryElement.title = titleValue;
94
- }
95
+ for (const navHistoryElement of this.navHistory) {
96
+ if (navHistoryElement.viewId === viewId) {
97
+ navHistoryElement.title = titleValue;
95
98
  }
96
- } catch (err) {
97
- _iterator.e(err);
98
- } finally {
99
- _iterator.f();
100
99
  }
101
100
 
102
- let legendValue = "<span>";
101
+ let legendValue = '<span>';
103
102
  let counter = 0;
104
103
 
105
- var _iterator2 = _createForOfIteratorHelper(this.navHistory),
106
- _step2;
107
-
108
- try {
109
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
110
- const navHistoryElement = _step2.value;
111
- legendValue += "".concat(navHistoryElement.title);
104
+ for (const navHistoryElement of this.navHistory) {
105
+ legendValue += "".concat(navHistoryElement.title);
112
106
 
113
- if (counter++ < this.navHistory.length - 1) {
114
- legendValue += legendIconArrow;
115
- }
107
+ if (counter++ < this.navHistory.length - 1) {
108
+ legendValue += legendIconArrow;
116
109
  }
117
- } catch (err) {
118
- _iterator2.e(err);
119
- } finally {
120
- _iterator2.f();
121
110
  }
122
111
 
123
- legendValue += "</span>";
112
+ legendValue += '</span>';
124
113
  this.props.appBarTitle = legendValue;
125
114
  } else if (!view.popUp) {
126
- let legendPath = "";
115
+ let legendPath = '';
127
116
 
128
117
  for (let i = 0; i < this.graphs[0].initialNavHistoryDepth; i++) {
129
118
  legendPath += "".concat(this.navHistory[i].title);
@@ -154,6 +143,10 @@ class ApplicationContext {
154
143
  }
155
144
  });
156
145
 
146
+ _defineProperty(this, "setViewPortHistory", history => {
147
+ this.props.viewPortHistory = history;
148
+ });
149
+
157
150
  _defineProperty(this, "getViewPortHistory", () => {
158
151
  return this.props.viewPortHistory;
159
152
  });
@@ -174,21 +167,10 @@ class ApplicationContext {
174
167
  });
175
168
 
176
169
  _defineProperty(this, "getFileDomainCache", domain => {
177
- var _iterator3 = _createForOfIteratorHelper(this.fileCache),
178
- _step3;
179
-
180
- try {
181
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
182
- const fileCacheElement = _step3.value;
183
-
184
- if (fileCacheElement.domain === domain) {
185
- return fileCacheElement;
186
- }
170
+ for (const fileCacheElement of this.fileCache) {
171
+ if (fileCacheElement.domain === domain) {
172
+ return fileCacheElement;
187
173
  }
188
- } catch (err) {
189
- _iterator3.e(err);
190
- } finally {
191
- _iterator3.f();
192
174
  }
193
175
 
194
176
  return null;
@@ -196,7 +178,7 @@ class ApplicationContext {
196
178
 
197
179
  _defineProperty(this, "addFile", (domain, file) => {
198
180
  if (_Utils.default.isNull(domain)) {
199
- console.error("Please specify file domain");
181
+ console.error('Please specify file domain');
200
182
  return;
201
183
  }
202
184
 
@@ -211,21 +193,10 @@ class ApplicationContext {
211
193
 
212
194
  let cachedFile = null;
213
195
 
214
- var _iterator4 = _createForOfIteratorHelper(fileDomainCache.files),
215
- _step4;
216
-
217
- try {
218
- for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
219
- const domainFile = _step4.value;
220
-
221
- if (domainFile.correlationId === file.correlationId) {
222
- cachedFile = domainFile;
223
- }
196
+ for (const domainFile of fileDomainCache.files) {
197
+ if (domainFile.correlationId === file.correlationId) {
198
+ cachedFile = domainFile;
224
199
  }
225
- } catch (err) {
226
- _iterator4.e(err);
227
- } finally {
228
- _iterator4.f();
229
200
  }
230
201
 
231
202
  if (cachedFile === null) {
@@ -235,155 +206,193 @@ class ApplicationContext {
235
206
  }
236
207
  });
237
208
 
209
+ _defineProperty(this, "updateContext", values => {
210
+ _Observable.default.emitContextChangeEvent(applicationContext, values);
211
+
212
+ Object.keys(values).forEach(key => {
213
+ applicationContext[key] = values[key];
214
+ });
215
+ });
216
+
238
217
  _defineProperty(this, "addView", (view, path, forward) => {
239
- if (!view.popUp) {
240
- this.closeCurrentView(forward);
218
+ if (!view.popUp && !view.window) {
219
+ let topView = this.getTopAnchorView();
241
220
 
242
- if (!forward) {
243
- this.navHistory.pop();
221
+ if (topView) {
222
+ this.closeView(topView === null || topView === void 0 ? void 0 : topView.config.id);
244
223
  }
245
224
  } else {
246
- this.props.confirmationDialogController.openPopupView(view);
225
+ if (view.popUp) {
226
+ this.props.confirmationDialogController.openPopupView(view);
227
+ }
228
+
229
+ if (view.window) {
230
+ let topView = this.getTopWindowView();
231
+
232
+ if (topView) {
233
+ this.closeView(topView === null || topView === void 0 ? void 0 : topView.config.id);
234
+ }
235
+ }
247
236
  }
248
237
 
249
238
  if (view.parent) {
250
239
  this.navHistory.splice(0, this.navHistory.length);
251
240
 
252
- var _iterator5 = _createForOfIteratorHelper(this.views),
253
- _step5;
241
+ for (const contextView of this.views) {
242
+ let shouldClose = view.window && contextView.window || !view.window && !contextView.window;
254
243
 
255
- try {
256
- for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
257
- const contextView = _step5.value;
258
-
259
- if (!_Utils.default.isNull(contextView) && !_Utils.default.isNull(contextView.handle.api)) {
260
- this.closeView(contextView.handle.api.id, forward);
261
- }
244
+ if (!_Utils.default.isNull(contextView) && !_Utils.default.isNull(contextView.handle.api) && shouldClose) {
245
+ this.closeView(contextView.handle.api.id, forward);
262
246
  }
263
- } catch (err) {
264
- _iterator5.e(err);
265
- } finally {
266
- _iterator5.f();
267
247
  }
268
248
  }
269
249
 
270
250
  let historyElement = {};
271
251
  historyElement.viewId = view.config.id;
252
+ historyElement.parent = view.parent;
272
253
  historyElement.path = path;
273
254
  this.navHistory.push(historyElement);
274
255
  this.views.push(view);
275
- });
276
256
 
277
- _defineProperty(this, "getCurrentView", () => {
278
- return this.views[this.views.length - 1];
279
- });
257
+ if (view.window) {
258
+ _Observable.default.emitContextChangeEvent(applicationContext, {
259
+ windowView: view
260
+ });
261
+
262
+ applicationContext.windowView = view;
263
+ }
280
264
 
281
- _defineProperty(this, "closeCurrentView", forward => {
282
- let currentView = this.views[this.views.length - 1];
265
+ let currentGraph = this.graphs.length > 0 ? this.graphs[this.graphs.length - 1] : null;
283
266
 
284
- if (!_Utils.default.isNull(currentView) && !_Utils.default.isNull(currentView.handle.api)) {
285
- this.closeView(currentView.handle.api.id, forward);
267
+ if (!view.window && view.parent && currentGraph && currentGraph.config.isWindow) {
268
+ currentGraph.anchorView = view;
269
+ currentGraph.anchorHistoryElement = this.navHistory[this.navHistory.length - 1];
270
+ this.updateContext({
271
+ windowDisplayState: 'MINIMIZED'
272
+ });
286
273
  }
287
274
  });
288
275
 
276
+ _defineProperty(this, "closeAllViews", () => {
277
+ for (const view of this.views) {
278
+ this.closeView(view.config.id, false);
279
+ }
280
+
281
+ _Observable.default.emitContextChangeEvent(applicationContext, {
282
+ windowView: null
283
+ });
284
+
285
+ applicationContext.windowView = null;
286
+ });
287
+
289
288
  _defineProperty(this, "closeView", (viewId, forward) => {
290
- _Observable.default.clearEventListeners(viewId);
289
+ let view = this.getView(viewId);
291
290
 
292
- for (let i = 0; i < this.fileCache.length; i++) {
293
- let cacheElement = this.fileCache[i];
291
+ if (view) {
292
+ if (!_Utils.default.isNull(view) && !_Utils.default.isNull(view.handle.api)) {
293
+ _Observable.default.clearEventListeners(viewId);
294
294
 
295
- if (cacheElement.domain === viewId) {
296
- this.fileCache.slice(i, 1);
297
- break;
298
- }
299
- }
295
+ for (let i = 0; i < this.fileCache.length; i++) {
296
+ let cacheElement = this.fileCache[i];
300
297
 
301
- let count = 0;
298
+ if (cacheElement.domain === viewId) {
299
+ this.fileCache.slice(i, 1);
300
+ break;
301
+ }
302
+ }
302
303
 
303
- var _iterator6 = _createForOfIteratorHelper(this.views),
304
- _step6;
304
+ let count = 0;
305
305
 
306
- try {
307
- for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
308
- const view = _step6.value;
306
+ for (const view of this.views) {
307
+ if (view.handle.api.id === viewId) {
308
+ this.views.splice(count, 1);
309
309
 
310
- if (view.handle.api.id === viewId) {
311
- this.views.splice(count, 1);
310
+ if (!view.popUp && !view.parent && (_Utils.default.isNull(forward) || forward === false)) {
311
+ let viewIndex = this.navHistory.findIndex(h => h.viewId === viewId);
312
312
 
313
- if (!view.popUp && !view.parent && (_Utils.default.isNull(forward) || forward === false)) {
314
- this.navHistory.pop();
315
- } else if (view.popUp) {
316
- this.props.confirmationDialogController.closePopupView();
313
+ if (viewIndex >= 0) {
314
+ this.navHistory.splice(viewIndex, 1);
315
+ }
316
+ } else if (view.popUp) {
317
+ this.props.confirmationDialogController.closePopupView();
318
+ }
317
319
  }
320
+
321
+ count++;
318
322
  }
323
+ }
319
324
 
320
- count++;
325
+ let hasWindow = false;
326
+
327
+ for (const viewsElement of this.views) {
328
+ if (viewsElement.window) {
329
+ hasWindow = true;
330
+ break;
331
+ }
332
+ }
333
+
334
+ if (!hasWindow) {
335
+ _Observable.default.emitContextChangeEvent(applicationContext, {
336
+ windowView: null
337
+ });
338
+
339
+ applicationContext.windowView = null;
321
340
  }
322
- } catch (err) {
323
- _iterator6.e(err);
324
- } finally {
325
- _iterator6.f();
326
341
  }
327
342
  });
328
343
 
329
344
  _defineProperty(this, "getView", id => {
330
- var _iterator7 = _createForOfIteratorHelper(this.views),
331
- _step7;
332
-
333
- try {
334
- for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
335
- const view = _step7.value;
336
-
337
- if (id === view.config.id) {
338
- return view;
339
- }
345
+ for (const view of this.views) {
346
+ if (id === view.config.id) {
347
+ return view;
340
348
  }
341
- } catch (err) {
342
- _iterator7.e(err);
343
- } finally {
344
- _iterator7.f();
345
349
  }
346
350
 
347
351
  return null;
348
352
  });
349
353
 
350
- _defineProperty(this, "resolveComponentApi", id => {
351
- if (APP_VARIABLE === id) {
352
- return this.api;
353
- }
354
+ _defineProperty(this, "getViewComponent", (view, id) => {
355
+ if (!_Utils.default.isNull(view) && !_Utils.default.isNull(view.handle) && !_Utils.default.isNull(view.handle.api)) {
356
+ if (id === view.handle.api.id) {
357
+ return view.handle.api;
358
+ }
354
359
 
355
- var _iterator8 = _createForOfIteratorHelper(this.graphs),
356
- _step8;
360
+ let handle = view.handle.api.getChild(id);
357
361
 
358
- try {
359
- for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
360
- const graph = _step8.value;
362
+ if (handle) {
363
+ return handle.api;
364
+ }
361
365
 
362
- if (graph.id === id) {
363
- return graph;
364
- }
366
+ if (id === 'view') {
367
+ return view.handle.api;
368
+ }
369
+ } else {
370
+ if (id === 'trainingScheduleCalendarEventForm') {
371
+ console.log('NO HANDLES');
365
372
  }
366
- } catch (err) {
367
- _iterator8.e(err);
368
- } finally {
369
- _iterator8.f();
370
373
  }
374
+ });
371
375
 
372
- let currentView = this.views[this.views.length - 1];
376
+ _defineProperty(this, "resolveComponentApi", id => {
377
+ if (APP_VARIABLE === id) {
378
+ return this.api;
379
+ }
373
380
 
374
- if (!_Utils.default.isNull(currentView) && !_Utils.default.isNull(currentView.handle) && !_Utils.default.isNull(currentView.handle.api)) {
375
- if (id === currentView.handle.api.id) {
376
- return currentView.handle.api;
381
+ for (const graph of this.graphs) {
382
+ if (graph.id === id) {
383
+ return graph;
377
384
  }
385
+ }
378
386
 
379
- let handle = currentView.handle.api.getChild(id);
387
+ if (this.views.length === 0) {
388
+ return this.getViewComponent(this.props.dashboardView, id);
389
+ }
380
390
 
381
- if (handle !== null) {
382
- return handle.api;
383
- }
391
+ for (const view of this.views) {
392
+ let component = this.getViewComponent(view, id);
384
393
 
385
- if (id === 'view') {
386
- return currentView.handle.api;
394
+ if (component) {
395
+ return component;
387
396
  }
388
397
  }
389
398
 
@@ -394,44 +403,24 @@ class ApplicationContext {
394
403
  let matches = template.match(TEMPLATE_TOKEN_REGEX);
395
404
 
396
405
  if (!_Utils.default.isNull(matches)) {
397
- var _iterator9 = _createForOfIteratorHelper(matches),
398
- _step9;
399
-
400
- try {
401
- for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
402
- const match = _step9.value;
403
- let expresionContent = match.substring(match.indexOf('{') + 1, match.lastIndexOf('}'));
404
- let expressionValue = "";
405
-
406
- if (expresionContent.startsWith("$event.data") && !_Utils.default.isNull(eventData)) {
407
- let props = expresionContent.replace("$event.data.", "").split(".");
408
- let vo = eventData;
409
-
410
- var _iterator10 = _createForOfIteratorHelper(props),
411
- _step10;
412
-
413
- try {
414
- for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
415
- const prop = _step10.value;
416
- vo = vo[prop];
417
- }
418
- } catch (err) {
419
- _iterator10.e(err);
420
- } finally {
421
- _iterator10.f();
422
- }
406
+ for (const match of matches) {
407
+ let expresionContent = match.substring(match.indexOf('{') + 1, match.lastIndexOf('}'));
408
+ let expressionValue = '';
423
409
 
424
- expressionValue = vo;
425
- } else {
426
- expressionValue = this.resolveExpressionValue(expresionContent);
410
+ if (expresionContent.startsWith('$event.data') && !_Utils.default.isNull(eventData)) {
411
+ let props = expresionContent.replace('$event.data.', '').split('.');
412
+ let vo = eventData;
413
+
414
+ for (const prop of props) {
415
+ vo = vo[prop];
427
416
  }
428
417
 
429
- template = template.replace(match, expressionValue);
418
+ expressionValue = vo;
419
+ } else {
420
+ expressionValue = this.resolveExpressionValue(expresionContent);
430
421
  }
431
- } catch (err) {
432
- _iterator9.e(err);
433
- } finally {
434
- _iterator9.f();
422
+
423
+ template = template.replace(match, expressionValue);
435
424
  }
436
425
  }
437
426
 
@@ -441,68 +430,52 @@ class ApplicationContext {
441
430
  _defineProperty(this, "resolveExpressionValue", (expression, eventData = null) => {
442
431
  let paramExpression = expression.match(/\(([^)]*)\)/);
443
432
  let isEvent = expression.startsWith('$event.data');
444
- let baseExpression = isEvent ? "$event.data" : !_Utils.default.isNull(paramExpression) && paramExpression.length > 0 ? expression.replace(paramExpression[0], '') : expression;
445
- let expresionContent = baseExpression.substring(baseExpression.indexOf('{') + 1, baseExpression.indexOf('}'));
433
+ let baseExpression = isEvent ? '$event.data' : !_Utils.default.isNull(paramExpression) && paramExpression.length > 0 ? expression.replace(paramExpression[0], '') : expression;
434
+ let expressionContent = baseExpression.substring(baseExpression.indexOf('{') + 1, baseExpression.indexOf('}'));
446
435
  let isComponent = baseExpression.startsWith('@#{');
447
436
  let isLib = baseExpression.startsWith('@@{');
448
- let tokens = expresionContent.split('.');
437
+ let tokens = expressionContent.split('.');
449
438
  let idToken = tokens[0];
450
439
 
451
440
  if (isComponent || isEvent) {
452
- let value = isEvent ? eventData : this.resolveComponentApi(expresionContent);
441
+ let value = isEvent ? eventData : this.resolveComponentApi(expressionContent);
453
442
  let expressionClosure = isEvent ? 'data.' : '}.';
454
443
  let index = expression.indexOf(expressionClosure);
455
444
 
456
445
  if (index > 0) {
457
446
  let propertyChain = expression.substring(index + expressionClosure.length);
458
- let props = propertyChain.split(".");
459
-
460
- var _iterator11 = _createForOfIteratorHelper(props),
461
- _step11;
462
-
463
- try {
464
- for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
465
- const prop = _step11.value;
447
+ let props = propertyChain.split('.');
466
448
 
467
- if (_Utils.default.isNull(value)) {
468
- return null;
469
- }
449
+ for (const prop of props) {
450
+ if (_Utils.default.isNull(value)) {
451
+ return null;
452
+ }
470
453
 
471
- value = value[prop];
454
+ value = value[prop];
472
455
 
473
- if (typeof value === 'function') {
474
- value = value();
475
- }
456
+ if (typeof value === 'function') {
457
+ value = value();
476
458
  }
477
- } catch (err) {
478
- _iterator11.e(err);
479
- } finally {
480
- _iterator11.f();
481
459
  }
482
460
  }
483
461
 
484
462
  return value;
485
463
  } else if (isLib) {
486
- if (idToken === 'view') {
487
- idToken = this.getCurrentView().config.id + '_lib';
488
- }
489
-
464
+ /*if (idToken === 'view') {
465
+ idToken = this.getCurrentView().config.id + '_lib';
466
+ }*/
490
467
  return this.libs[idToken];
491
468
  }
492
469
 
493
470
  return expression;
494
471
  });
495
472
 
496
- _defineProperty(this, "setExpressionValues", obj => {
473
+ _defineProperty(this, "setExpressionValues", (obj, eventData = null) => {
497
474
  let isArray = Array.isArray(obj);
498
475
  const updated = isArray ? [] : {};
499
476
  Object.keys(obj).forEach(key => {
500
477
  if (typeof obj[key] === 'object' && obj[key] !== null) {
501
- updated[key] = this.setExpressionValues(obj[key]);
502
-
503
- if (_Utils.default.isNull(updated[key].type)) {
504
- updated[key].type = "String";
505
- }
478
+ updated[key] = this.setExpressionValues(obj[key], eventData);
506
479
  } else {
507
480
  let objValue = obj[key];
508
481
 
@@ -521,8 +494,8 @@ class ApplicationContext {
521
494
  scriptValue = null;
522
495
  }
523
496
 
524
- let objKey = key === "valueExpression" ? "value" : key;
525
- updated[objKey] = !_Utils.default.isNull(scriptValue) && scriptValue.instanceType === 'TypedValue' ? scriptValue.value : scriptValue;
497
+ let objKey = key === 'valueExpression' ? 'value' : key;
498
+ updated[objKey] = scriptValue !== null && scriptValue.instanceType === 'TypedValue' ? scriptValue.value : scriptValue;
526
499
 
527
500
  if (typeof updated[objKey] === 'undefined') {
528
501
  delete updated.type;
@@ -535,14 +508,22 @@ class ApplicationContext {
535
508
  return updated;
536
509
  });
537
510
 
538
- _defineProperty(this, "resolveParameterConfigValue", configValue => {
539
- let json = JSON.stringify(configValue);
540
- let matches = json.match(_DynamicJS.TEMPLATE_REGEX);
511
+ _defineProperty(this, "resolveParameterConfigValue", (configValue, eventData) => {
512
+ if (!configValue) {
513
+ return configValue;
514
+ }
541
515
 
542
- if (!_Utils.default.isNull(matches)) {
543
- return this.setExpressionValues(configValue);
516
+ if (this.isExpression(configValue)) {
517
+ return this.resolveExpressionValue(configValue, eventData);
544
518
  } else {
545
- return configValue;
519
+ let json = JSON.stringify(configValue);
520
+ let matches = json.match(_DynamicJS.TEMPLATE_REGEX);
521
+
522
+ if (!_Utils.default.isNull(matches)) {
523
+ return this.setExpressionValues(configValue);
524
+ } else {
525
+ return configValue;
526
+ }
546
527
  }
547
528
  });
548
529
 
@@ -557,25 +538,14 @@ class ApplicationContext {
557
538
 
558
539
  if (index > 0) {
559
540
  let propertyChain = expression.substring(index + expressionClosure.length);
560
- let props = propertyChain.split(".");
541
+ let props = propertyChain.split('.');
561
542
 
562
- var _iterator12 = _createForOfIteratorHelper(props),
563
- _step12;
564
-
565
- try {
566
- for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
567
- const prop = _step12.value;
568
-
569
- if (_Utils.default.isNull(value)) {
570
- return null;
571
- }
572
-
573
- value = value[prop];
543
+ for (const prop of props) {
544
+ if (_Utils.default.isNull(value)) {
545
+ return null;
574
546
  }
575
- } catch (err) {
576
- _iterator12.e(err);
577
- } finally {
578
- _iterator12.f();
547
+
548
+ value = value[prop];
579
549
  }
580
550
  }
581
551
 
@@ -585,7 +555,7 @@ class ApplicationContext {
585
555
  let val = null;
586
556
 
587
557
  if (_Utils.default.isNull(parameterConfig.value)) {
588
- console.error("NULL parameter value expression in : " + JSON.stringify(parameterConfig));
558
+ console.error('NULL parameter value expression in : ' + JSON.stringify(parameterConfig));
589
559
  return null;
590
560
  }
591
561
 
@@ -626,10 +596,10 @@ class ApplicationContext {
626
596
  });
627
597
 
628
598
  _defineProperty(this, "getId", () => {
629
- return "applicationContext";
599
+ return 'applicationManager';
630
600
  });
631
601
 
632
- if (!ApplicationContext.instance) {
602
+ if (!ApplicationManager.instance) {
633
603
  this.views = [];
634
604
  this.props = {};
635
605
  this.listeners = [];
@@ -642,16 +612,16 @@ class ApplicationContext {
642
612
  return instance.getId();
643
613
  },
644
614
 
645
- closeCurrentView() {
646
- instance.closeCurrentView();
647
- },
648
-
649
615
  refreshUserAvatar(avatar) {
650
616
  instance.refreshUserAvatar(avatar);
651
617
  },
652
618
 
653
- alert(message, messageType) {
654
- instance.alert(message, messageType);
619
+ alert(viewId, message, messageType) {
620
+ instance.alert(viewId, message, messageType);
621
+ },
622
+
623
+ removeLoadedGraph(routeToAnchor) {
624
+ instance.removeLoadedGraph(routeToAnchor);
655
625
  }
656
626
 
657
627
  };
@@ -662,18 +632,34 @@ class ApplicationContext {
662
632
  };
663
633
  }
664
634
 
665
- ApplicationContext.instance = this;
635
+ ApplicationManager.instance = this;
666
636
  }
667
637
 
668
- return ApplicationContext.instance;
638
+ return ApplicationManager.instance;
639
+ }
640
+
641
+ navigate(path) {
642
+ this.props.navigator(path);
669
643
  }
670
644
 
671
- setBaseApiUrl(baseApiUrl) {
672
- this.props.baseApiUrl = baseApiUrl;
645
+ setDashboardSettings(dashboardSettings) {
646
+ this.props.dashboardSettings = dashboardSettings;
673
647
  }
674
648
 
675
- getBaseApiUrl() {
676
- return this.props.contextRoot + this.props.baseApiUrl;
649
+ getDashboardSettings() {
650
+ return this.props.dashboardSettings;
651
+ }
652
+
653
+ setNavigator(navigator) {
654
+ this.props.navigator = navigator;
655
+ }
656
+
657
+ setHasActiveMeeting(hasActiveMeeting) {
658
+ this.props.hasActiveMeeting = hasActiveMeeting;
659
+ }
660
+
661
+ hasActiveMeeting() {
662
+ return this.props.hasActiveMeeting;
677
663
  }
678
664
 
679
665
  setServiceApiPath(serviceApiPath) {
@@ -712,8 +698,8 @@ class ApplicationContext {
712
698
  this.listeners.push(listener);
713
699
  }
714
700
 
715
- alert(message, messageType) {
716
- let event = new _Event.default(this, this.getCurrentView().config.id, {
701
+ alert(viewId, message, messageType) {
702
+ let event = new _Event.default(this, this.getView(viewId).config.id, {
717
703
  messageType: messageType,
718
704
  message: message
719
705
  });
@@ -722,21 +708,10 @@ class ApplicationContext {
722
708
  }
723
709
 
724
710
  refreshUserAvatar(avatar) {
725
- var _iterator13 = _createForOfIteratorHelper(this.listeners),
726
- _step13;
727
-
728
- try {
729
- for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
730
- const listener = _step13.value;
731
-
732
- if (listener.type === AVATAR_LISTENER_TYPE) {
733
- listener.handler(avatar);
734
- }
711
+ for (const listener of this.listeners) {
712
+ if (listener.type === AVATAR_LISTENER_TYPE) {
713
+ listener.handler(avatar);
735
714
  }
736
- } catch (err) {
737
- _iterator13.e(err);
738
- } finally {
739
- _iterator13.f();
740
715
  }
741
716
  }
742
717
 
@@ -749,6 +724,10 @@ class ApplicationContext {
749
724
  return this.props.primaryColor;
750
725
  }
751
726
 
727
+ getApplicationSecondaryColor() {
728
+ return this.props.secondaryColor;
729
+ }
730
+
752
731
  openConfirmDialog(message, resultCallback) {
753
732
  return this.props.confirmationDialogController.openDialog(message, {
754
733
  execute: result => {
@@ -757,8 +736,32 @@ class ApplicationContext {
757
736
  });
758
737
  }
759
738
 
739
+ fillEventDataValue(obj, eventData) {
740
+ if (obj) {
741
+ Object.keys(obj).forEach(key => {
742
+ let val = obj[key];
743
+
744
+ if (typeof val === 'object') {
745
+ this.fillEventDataValue(val, eventData);
746
+ }
747
+
748
+ if (val === '$event.data') {
749
+ obj[key] = eventData;
750
+ }
751
+ });
752
+ return obj;
753
+ }
754
+
755
+ return null;
756
+ }
757
+ /**
758
+ * Returns a view configuration with a particular id
759
+ *
760
+ */
761
+
762
+
760
763
  isExpression(objValue) {
761
- return objValue && objValue.toString().startsWith("$event.data") || !_Utils.default.isNull(objValue) && typeof objValue === 'string' && !_Utils.default.isNull(objValue.match(_DynamicJS.TEMPLATE_REGEX));
764
+ return objValue && objValue.toString().startsWith('$event.data') || !_Utils.default.isNull(objValue) && typeof objValue === 'string' && !_Utils.default.isNull(objValue.match(_DynamicJS.TEMPLATE_REGEX));
762
765
  }
763
766
  /**
764
767
  * Returns a view configuration with a particular id
@@ -769,91 +772,83 @@ class ApplicationContext {
769
772
  loadAnchor(graph) {
770
773
  this.navHistory.splice(graph.initialNavHistoryDepth - 1, this.navHistory.length);
771
774
  this.addView(graph.anchorView, graph.anchorHistoryElement.path, true);
772
- this.getViewPortHistory().push("/switch");
773
- this.getViewPortHistory().push("/view/" + graph.anchorView.config.id);
775
+ this.navigate('/view/unload');
776
+ this.navigate('/view/' + graph.anchorView.config.id);
774
777
  }
775
778
 
776
- removeLoadedGraph() {
779
+ removeLoadedGraph(routeBackToAnchor) {
777
780
  if (this.graphs.length > 0) {
778
- this.closeCurrentView(false);
779
781
  let graph = this.graphs[this.graphs.length - 1];
782
+ let view = graph.config.isWindow ? this.getTopWindowView() : this.getTopAnchorView();
783
+ this.closeView(view.config.id, false);
780
784
 
781
- if (!_Utils.default.isNull(graph.anchorHistoryElement)) {
785
+ if (!_Utils.default.isNull(graph.anchorHistoryElement) && routeBackToAnchor) {
782
786
  this.loadAnchor(graph);
783
787
  }
784
788
 
785
789
  this.graphs.splice(0, this.graphs.length);
790
+
791
+ if (!_Utils.default.isNull(graph.anchorHistoryElement)) {
792
+ this.updateAppBarTitle(graph.anchorView.config.id, graph.anchorView.config.title);
793
+ }
786
794
  }
787
795
  }
788
796
 
789
- loadGraph(isParent, isPopup, config, parameterValues) {
790
- if (isParent && !isPopup) {
797
+ loadGraph(isParent, isPopup, isWindow, config, parameterValues) {
798
+ if (isParent && !isPopup && !isWindow) {
791
799
  this.navHistory.splice(0, this.navHistory.length);
792
800
 
793
- var _iterator14 = _createForOfIteratorHelper(this.views),
794
- _step14;
795
-
796
- try {
797
- for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
798
- const contextView = _step14.value;
799
- this.closeView(contextView.handle.api.id, false);
800
- }
801
- } catch (err) {
802
- _iterator14.e(err);
803
- } finally {
804
- _iterator14.f();
801
+ for (const contextView of this.views) {
802
+ this.closeView(contextView.handle.api.id, false);
805
803
  }
806
804
 
807
- this.getViewPortHistory().push("/switch");
805
+ this.getViewPortHistory().push('/switch');
808
806
  }
809
807
 
808
+ config.isWindow = isWindow;
810
809
  let graph = new _Graph.default(_Utils.default.parseConfig(config));
811
810
  graph.initialNavHistoryDepth = this.navHistory.length;
812
811
 
813
812
  if (this.navHistory.length > 0) {
814
- graph.anchorView = this.getCurrentView();
813
+ graph.anchorView = this.getTopAnchorView(); //= this.getCurrentView();
814
+
815
815
  graph.anchorHistoryElement = this.navHistory[this.navHistory.length - 1];
816
816
  }
817
817
 
818
818
  graph.init();
819
819
 
820
- var _iterator15 = _createForOfIteratorHelper(parameterValues),
821
- _step15;
820
+ for (const parameterValue of parameterValues) {
821
+ graph.model[parameterValue.name] = parameterValue.value;
822
+ }
822
823
 
823
- try {
824
- for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
825
- const parameterValue = _step15.value;
826
- graph.model[parameterValue.name] = parameterValue.value;
824
+ this.graphs.push(graph);
825
+ }
826
+
827
+ getTopAnchorView() {
828
+ for (let i = this.views.length - 1; i >= 0; i--) {
829
+ if (!this.views[i].window) {
830
+ return this.views[i];
827
831
  }
828
- } catch (err) {
829
- _iterator15.e(err);
830
- } finally {
831
- _iterator15.f();
832
832
  }
833
+ }
833
834
 
834
- this.graphs.push(graph);
835
+ getTopWindowView() {
836
+ for (let i = this.views.length - 1; i >= 0; i--) {
837
+ if (this.views[i].window) {
838
+ return this.views[i];
839
+ }
840
+ }
835
841
  }
836
842
 
837
843
  signalGraph(id, event) {
838
844
  if (this.graphs.length > 0) {
839
845
  let graphToSignal = this.graphs[this.graphs.length - 1];
840
846
 
841
- var _iterator16 = _createForOfIteratorHelper(this.graphs),
842
- _step16;
843
-
844
- try {
845
- for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
846
- const graph = _step16.value;
847
-
848
- if (id === graph.id) {
849
- graphToSignal = graph;
850
- break;
851
- }
847
+ for (const graph of this.graphs) {
848
+ if (id === graph.id) {
849
+ graphToSignal = graph;
850
+ break;
852
851
  }
853
- } catch (err) {
854
- _iterator16.e(err);
855
- } finally {
856
- _iterator16.f();
857
852
  }
858
853
 
859
854
  graphToSignal.signal(event);
@@ -868,9 +863,13 @@ class ApplicationContext {
868
863
  return this.props.formMarkersEnabled;
869
864
  }
870
865
 
866
+ setDashboardView(view) {
867
+ this.props.dashboardView = view;
868
+ }
869
+
871
870
  }
872
871
 
873
- const instance = new ApplicationContext();
872
+ const instance = new ApplicationManager();
874
873
  Object.freeze(instance);
875
874
  var _default = instance;
876
875
  exports.default = _default;